@syncfusion/ej2-schedule 29.1.34 → 29.1.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ej2-schedule.min.js +2 -2
- package/dist/ej2-schedule.umd.min.js +2 -2
- package/dist/ej2-schedule.umd.min.js.map +1 -1
- package/dist/es6/ej2-schedule.es2015.js +1 -1
- package/dist/es6/ej2-schedule.es2015.js.map +1 -1
- package/dist/es6/ej2-schedule.es5.js +1 -1
- package/dist/es6/ej2-schedule.es5.js.map +1 -1
- package/dist/global/ej2-schedule.min.js +2 -2
- package/dist/global/ej2-schedule.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +23 -21
- package/src/schedule/actions/resize.js +1 -1
package/dist/ej2-schedule.min.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: ej2-schedule.min.js
|
|
3
|
-
* version : 29.1.
|
|
3
|
+
* version : 29.1.37
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2024. All rights reserved.
|
|
5
5
|
* Use of this code is subject to the terms of our license.
|
|
6
6
|
* A copy of the current license can be obtained at any time by e-mailing
|
|
7
7
|
* licensing@syncfusion.com. Any infringement will be prosecuted under
|
|
8
8
|
* applicable laws.
|
|
9
9
|
*/
|
|
10
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("SyncfusionBase"),require("SyncfusionPopups"),require("SyncfusionNavigations"),require("SyncfusionCalendars"),require("SyncfusionData"),require("SyncfusionButtons"),require("SyncfusionInputs"),require("SyncfusionDropdowns"),require("SyncfusionLists"),require("SyncfusionExcelExport")):"function"==typeof define&&define.amd?define(["SyncfusionBase","SyncfusionPopups","SyncfusionNavigations","SyncfusionCalendars","SyncfusionData","SyncfusionButtons","SyncfusionInputs","SyncfusionDropdowns","SyncfusionLists","SyncfusionExcelExport"],t):"object"==typeof exports?exports.SyncfusionSchedule=t(require("SyncfusionBase"),require("SyncfusionPopups"),require("SyncfusionNavigations"),require("SyncfusionCalendars"),require("SyncfusionData"),require("SyncfusionButtons"),require("SyncfusionInputs"),require("SyncfusionDropdowns"),require("SyncfusionLists"),require("SyncfusionExcelExport")):e.SyncfusionSchedule=t(e.SyncfusionBase,e.SyncfusionPopups,e.SyncfusionNavigations,e.SyncfusionCalendars,e.SyncfusionData,e.SyncfusionButtons,e.SyncfusionInputs,e.SyncfusionDropdowns,e.SyncfusionLists,e.SyncfusionExcelExport)}(self,((e,t,i,n,r,a,s,o,l,p)=>(()=>{"use strict";var c={766:t=>{t.exports=e},741:e=>{e.exports=a},570:e=>{e.exports=n},74:e=>{e.exports=r},778:e=>{e.exports=o},437:e=>{e.exports=p},323:e=>{e.exports=s},90:e=>{e.exports=l},215:e=>{e.exports=i},197:e=>{e.exports=t}},h={};function d(e){var t=h[e];if(void 0!==t)return t.exports;var i=h[e]={exports:{}};return c[e](i,i.exports,d),i.exports}d.d=(e,t)=>{for(var i in t)d.o(t,i)&&!d.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},d.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),d.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var u={};return(()=>{d.r(u),d.d(u,{Agenda:()=>ml,DEFAULT_WEEKS:()=>te,Day:()=>nl,DragAndDrop:()=>Jo,ExcelExport:()=>Al,Gregorian:()=>Or,HeaderRenderer:()=>yr,ICalendarExport:()=>El,ICalendarImport:()=>xl,Islamic:()=>Er,MS_PER_DAY:()=>ie,MS_PER_MINUTE:()=>ne,Month:()=>pl,MonthAgenda:()=>yl,Print:()=>Il,RecurrenceEditor:()=>io,Resize:()=>Xo,Schedule:()=>Yo,TimelineMonth:()=>Sl,TimelineViews:()=>Dl,TimelineYear:()=>Ol,Timezone:()=>xr,ViewBase:()=>$o,WEEK_LENGTH:()=>ee,Week:()=>al,WorkWeek:()=>ol,Year:()=>hl,actionBegin:()=>p,actionComplete:()=>c,actionFailure:()=>h,addDays:()=>ye,addMonths:()=>Te,addYears:()=>we,agendaCells:()=>H,beforePaste:()=>N,beforePrint:()=>L,capitalizeFirstWord:()=>je,cellClick:()=>r,cellDoubleClick:()=>a,cellMouseDown:()=>$,cellSelect:()=>I,contentReady:()=>_,dataBinding:()=>T,dataBound:()=>w,dataReady:()=>z,dateHeader:()=>j,documentClick:()=>Z,documentPaste:()=>J,drag:()=>C,dragStart:()=>S,dragStop:()=>O,eventClick:()=>m,eventDoubleClick:()=>f,eventRendered:()=>y,eventsLoaded:()=>Y,excelExport:()=>q,extractObjectFromRule:()=>Jr,findIndexInData:()=>Ae,firstDateOfMonth:()=>ce,generate:()=>Mr,generateSummary:()=>Ar,getCalendarUtil:()=>ra,getDateCount:()=>fe,getDateFromRecurrenceDateString:()=>kr,getDateFromString:()=>Ce,getDateInMs:()=>me,getDaysCount:()=>Se,getElementHeight:()=>Le,getElementHeightFromClass:()=>re,getElementTop:()=>qe,getElementWidth:()=>Ne,getElementWidthFromClass:()=>ae,getMaxDays:()=>be,getOuterHeight:()=>Ie,getRecurrenceStringFromDate:()=>Ea,getScrollBarWidth:()=>xe,getStartEndHours:()=>De,getTranslateX:()=>oe,getTranslateY:()=>se,getUniversalTime:()=>Re,getWeekFirstDate:()=>le,getWeekLastDate:()=>pe,getWeekMiddleDate:()=>ue,getWeekNumber:()=>de,hover:()=>l,initialEnd:()=>B,initialLoad:()=>U,inlineClick:()=>A,isDaylightSavingTime:()=>ke,isIPadDevice:()=>Pe,isMobile:()=>He,lastDateOfMonth:()=>he,moreEventsClick:()=>s,navigating:()=>g,noEvents:()=>R,popupClose:()=>b,popupOpen:()=>D,print:()=>W,removeChildren:()=>Me,renderCell:()=>v,resetScrollbarWidth:()=>Ve,resetTime:()=>ve,resizeStart:()=>E,resizeStop:()=>V,resizing:()=>x,resourceHeader:()=>P,scroll:()=>G,scrollUiUpdate:()=>Q,select:()=>o,setTime:()=>ge,timezoneData:()=>Vr,tooltipOpen:()=>F,uiUpdate:()=>K,virtualScroll:()=>X,virtualScrollStart:()=>M,virtualScrollStop:()=>k});var e=d(766),t=d(197),i=d(215),n=d(570),r="cellClick",a="cellDoubleClick",s="moreEventsClick",o="select",l="hover",p="actionBegin",c="actionComplete",h="actionFailure",g="navigating",v="renderCell",m="eventClick",f="eventDoubleClick",y="eventRendered",T="dataBinding",w="dataBound",D="popupOpen",b="popupClose",S="dragStart",C="drag",O="dragStop",E="resizeStart",x="resizing",V="resizeStop",A="inlineClick",I="cellSelect",M="virtualScrollStart",k="virtualScrollStop",R="noEvents",H="agendaCells",P="resourceHeader",j="dateHeader",N="beforePaste",L="beforePrint",q="excelExport",F="tooltipOpen",U="initial-load",B="initial-end",W="print",z="data-ready",Y="events-loaded",_="content-ready",G="scroll",X="virtual-scroll",Q="scroll-ui-update",K="ui-update",Z="document-click",J="document-paste",$="cell-mouse-down",ee=7,te=6,ie=864e5,ne=6e4;function re(t,i,n){var r,a=(0,e.createElement)("div",{className:i}).cloneNode();return a.style.visibility="hidden",a.style.position="absolute",t.appendChild(a),r=Le(a,n),(0,e.remove)(a),r}function ae(t,i,n){var r,a=(0,e.createElement)("div",{className:i}).cloneNode();return a.style.visibility="hidden",a.style.position="absolute",t.appendChild(a),r=Ne(a,n),(0,e.remove)(a),r}function se(e){var t=getComputedStyle(e);return window.WebKitCSSMatrix?new WebKitCSSMatrix(t.webkitTransform).m42:0}function oe(e){var t=getComputedStyle(e);return window.WebKitCSSMatrix?new WebKitCSSMatrix(t.webkitTransform).m41:0}function le(e,t){var i=new Date(e.getTime());return t=(t-i.getDay()-7)%7,new Date(i.setDate(i.getDate()+(isNaN(t)?0:t)))}function pe(e,t){var i=le(e,t),n=new Date(i.getFullYear(),i.getMonth(),i.getDate()+6);return new Date(n.getTime())}function ce(e){return new Date(e.getFullYear(),e.getMonth(),1)}function he(e){return new Date(e.getFullYear(),e.getMonth()+1,0)}function de(e){var t=new Date(e.getFullYear(),0,1).valueOf(),i=(new Date(e.getFullYear(),e.getMonth(),e.getDate()).valueOf()-t+ie)/ie;return Math.ceil(i/7)}function ue(e,t){return new Date(t.valueOf()-(t.valueOf()-e.valueOf())/2)}function ge(e,t){var i=e.getTimezoneOffset(),n=new Date(e.getTime()+t),r=n.getTimezoneOffset()-i;return e.setTime(n.getTime()+r*ne),e}function ve(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function me(e){var t=new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0).getTimezoneOffset(),i=e.getTimezoneOffset()-t;return e.getTime()-new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0).getTime()-60*i*1e3}function fe(e,t){return Math.ceil((t.getTime()-e.getTime())/ie)}function ye(e,t){return e=new Date(""+e),new Date(e.setDate(e.getDate()+t))}function Te(e,t){var i=(e=new Date(""+e)).getDate();return e.setDate(1),e.setMonth(e.getMonth()+t),e.setDate(Math.min(i,be(e))),e}function we(e,t){var i=(e=new Date(""+e)).getDate();return e.setDate(1),e.setFullYear(e.getFullYear()+t),e.setDate(Math.min(i,be(e))),e}function De(e,t,i){var n=new Date(e.getTime());n.setHours(t.getHours()),n.setMinutes(t.getMinutes()),n.setSeconds(t.getSeconds());var r=new Date(e.getTime());return 0===i.getHours()?r=ye(r,1):(r.setHours(i.getHours()),r.setMinutes(i.getMinutes()),r.setSeconds(i.getSeconds())),{startHour:n,endHour:r}}function be(e){return he(e).getDate()}function Se(e,t){var i=ve(new Date(e)),n=ve(new Date(t));return Math.round((n.getTime()-i.getTime())/ie)}function Ce(e){return-1!==e.indexOf("Date")?new Date(parseInt(e.match(/\d+/g).toString(),10)):-1!==e.indexOf("T")?new Date(e):new Date(e.replace(/-/g,"/"))}var Oe=null,Ee=null;function xe(){if(null!==Oe)return Oe;null===Ee&&(Ee=window.devicePixelRatio||window.screen.availWidth/document.documentElement.clientWidth);var t,i=(0,e.createElement)("div");i.style.cssText="width:100px;height: 100px;overflow: scroll;position: absolute;top: -9999px;",document.body.appendChild(i);var n=devicePixelRatio?"1.10"===devicePixelRatio.toFixed(2)||devicePixelRatio<=1?Math.ceil(devicePixelRatio%1):Math.floor(devicePixelRatio%1):0;return t=i.offsetWidth-i.clientWidth-n|0,document.body.removeChild(i),Oe=t}function Ve(){var e=window.devicePixelRatio||window.screen.availWidth/document.documentElement.clientWidth;Ee&&Ee!==e&&(Oe=null,Ee=e)}function Ae(e,t,i,n,r){for(var a=0,s=e.length;a<s;a++)if(e[parseInt(a.toString(),10)][""+t]===i){if(!n)return a;var o=r.slice(-2)[0].field;if((n[""+o]instanceof Array?n[""+o]:[n[""+o]]).join(",").includes(e[parseInt(a.toString(),10)][r.slice(-1)[0].groupIDField]))return a}return-1}function Ie(e){var t=getComputedStyle(e);return e.offsetHeight+(parseInt(t.marginTop,10)||0)+(parseInt(t.marginBottom,10)||0)}function Me(e){for(var t=0,i=[].slice.call(e.children);t<i.length;t++){var n=i[t];e.removeChild(n)}}function ke(e){var t=new Date(e.getFullYear(),0,1),i=new Date(e.getFullYear(),6,1);return e.getTimezoneOffset()<Math.max(t.getTimezoneOffset(),i.getTimezoneOffset())}function Re(e){var t=e.getFullYear(),i=e.getMonth(),n=e.getDate(),r=e.getHours(),a=e.getMinutes(),s=e.getSeconds(),o=e.getMilliseconds();return Date.UTC(t,i,n,r,a,s,o)}function He(){return window.navigator.userAgent.toLowerCase().indexOf("mobi")>-1}function Pe(){return window.navigator.userAgent.toLowerCase().indexOf("ipad")>-1}function je(t,i){if("multiple"===i)t=t.split(" ").map((function(e){return e.charAt(0).toLocaleUpperCase()+e.substring(1)})).join(" ");else if("single"===i){if(t[0]>="0"&&t[0]<="9"){var n=t.match(/[a-zA-Z]/);t=(0,e.isNullOrUndefined)(n)?t:t.slice(0,n.index)+t[n.index].toLocaleUpperCase()+t.slice(n.index+1)}t=t[0].toLocaleUpperCase()+t.slice(1)}return t}function Ne(e,t){return t?e.offsetWidth:e.getBoundingClientRect().width}function Le(e,t){return t?e.offsetHeight:e.getBoundingClientRect().height}function qe(e,t){return t?e.offsetTop:e.getBoundingClientRect().top}var Fe="e-schedule",Ue="e-rtl",Be="e-device",We="e-adaptive",ze="e-multi-drag",Ye="e-icons",_e="e-enable",Ge="e-disable",Xe="e-table-container",Qe="e-schedule-table",Ke="e-all-day-cells",Ze="e-all-day-row",Je="e-content-table",$e="e-work-cells",et="e-work-hours",tt="e-popup-open",it="e-date-header-wrap",nt="e-date-header-container",rt="e-header-cells",at="e-work-days",st="e-other-month",ot="e-current-day",lt="e-current-date",pt="e-current-panel",ct="e-previous-panel",ht="e-next-panel",dt="e-translate",ut="e-left-indent",gt="e-left-indent-wrap",vt="e-event-table",mt="e-resource-group-cells",ft="e-resource-text",yt="e-resource-column-wrap",Tt="e-resource-column-table",wt="e-child-node",Dt="e-parent-node",bt="e-resource-expand",St="e-resource-collapse",Ct="e-resource-tree-icon",Ot="e-resource-cells",Et="e-time-cells-wrap",xt="e-time-cells",Vt="e-time-slots",At="e-alternate-cells",It="e-current-time",Mt="e-current-timeline",kt="e-previous-timeline",Rt="e-hide-childs",Ht="e-scroll-container",Pt="e-timeline-wrapper",jt="e-appointment-wrapper",Nt="e-appointment-wrapper-hidden",Lt="e-day-wrapper",qt="e-schedule-resource-toolbar-container",Ft="e-schedule-toolbar",Ut="e-schedule-resource-toolbar",Bt="e-selected-cell",Wt="e-week-number-wrapper",zt="e-week-number",Yt="e-appointment-wrap",_t="e-wrapper-container",Gt="e-appointment-container",Xt="e-appointment",Qt="e-block-appointment",Kt="e-block-indicator",Zt="e-appointment-border",Jt="e-appointment-details",$t="e-subject-wrap",ei="e-resource-name",ti="e-time",ii="e-table-wrap",ni="e-outer-table",ri="e-content-wrap",ai="e-virtual-track",si="e-agenda-cells",oi="e-current-day",li="e-active-appointment-agenda",pi="e-month-header",ci="e-day-date-header",hi="e-date-column",di="e-navigate",ui="e-date-header",gi="e-day-border",vi="e-date-time",mi="e-no-event",fi="e-appointment-indicator",yi="e-indicator",Ti="e-left-icon",wi="e-right-icon",Di="e-event-action",bi="e-new-event",Si="e-schedule-event-clone",Ci="e-clone-time-indicator",Oi="e-drag-clone",Ei="e-event-resize",xi="e-resize-clone",Vi="e-left-handler",Ai="e-right-handler",Ii="e-top-handler",Mi="e-bottom-handler",ki="e-recurrence-icon",Ri="e-recurrence-edit-icon",Hi="e-header-row",Pi="e-all-day-appointment-wrapper",ji="e-all-day-appointment",Ni="e-appointment-hide",Li="e-row-count-wrapper",qi="e-all-day-appointment-section",Fi="e-appointment-expand",Ui="e-appointment-collapse",Bi="e-more-indicator",Wi="e-cell-popup",zi="e-event-popup",Yi="e-popup-header",_i="e-header-icon-wrapper",Gi="e-popup-footer",Xi="e-date-time-details",Qi="e-event-details",Ki="e-event-create",Zi="e-event-edit",Ji="e-event-delete",$i="e-text-ellipsis",en="e-more-popup-wrapper",tn="e-more-event-popup",nn="e-more-event-date-header",rn="e-header-day",an="e-header-date",sn="e-more-event-close",on="e-more-event-content",ln="e-more-appointment-wrapper",pn="e-quick-dialog-occurrence-event",cn="e-quick-dialog-series-event",hn="e-quick-dialog-following-events",dn="e-following-events-dialog",un="e-quick-dialog-delete",gn="e-quick-dialog-cancel",vn="e-quick-alertok",mn="e-quick-alertcancel",fn="e-quick-alertfollowing",yn="e-quick-dialog-alert-btn",Tn="e-schedule-dialog",wn="e-schedule-form",Dn="e-all-day",bn="e-time-zone",Sn="e-repeat",Cn="e-subject",On="e-location",En="e-location-details",xn="e-start",Vn="e-end",An="e-description",In="e-description-details",Mn="e-time-zone-row",kn="e-start-time-zone",Rn="e-end-time-zone",Hn="e-save-icon",Pn="e-event-cancel",jn="e-event-save",Nn="e-title-text",Ln="e-icon-disable",qn="e-edit",Fn="e-edit-icon",Un="e-delete",Bn="e-delete-icon",Wn="e-close",zn="e-close-icon",Yn="e-schedule-error",_n="e-tooltip-hidden",Gn="e-animate",Xn="e-hidden",Qn="e-disable-dates",Kn="e-quick-popup-wrapper",Zn="e-resource-menu",Jn="e-icon-menu",$n="e-resource-level-title",er="e-resource-tree-popup-overlay",tr="e-resource-tree-popup",ir="e-resource",nr="e-resource-icon",rr="e-resource-details",ar="e-date-time-icon",sr="e-virtual-scroll",or="e-icon-disable",lr="e-auto-height",pr="e-ignore-whitespace",cr="e-read-only",hr="e-month-header-wrapper",dr="e-inline-subject",ur="e-inline-appointment",gr="e-scroll-hidden",vr="e-all-day-scroll",mr="e-all-day-auto",fr=function(){return fr=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},fr.apply(this,arguments)},yr=function(){function r(e){this.parent=e,this.l10n=this.parent.localeObj,this.renderHeader(),this.addEventListener()}return r.prototype.addEventListener=function(){this.parent.on(Z,this.closeHeaderPopup,this)},r.prototype.removeEventListener=function(){this.parent.off(Z,this.closeHeaderPopup)},r.prototype.closeHeaderPopup=function(t){var i=(0,e.closest)(t.event.target,".e-date-range,.e-header-popup,.e-day,.e-selected"),n=(0,e.closest)(t.event.target,".e-hor-nav,.e-toolbar-pop"),r=this.parent.element.querySelector("."+ri);if(this.parent.isAdaptive)if((0,e.isNullOrUndefined)(n)||!n.classList.contains("e-toolbar-pop")&&!n.classList.contains("e-hor-nav")||n.classList.contains("e-hor-nav")&&this.element.querySelector(".e-toolbar-pop").classList.contains(tt)){(0,e.removeClass)([r],gr);var a=this.element.querySelector(".e-toolbar-pop");if(!(0,e.isNullOrUndefined)(a)){var s=a.ej2_instances[0];!s||!(0,e.isNullOrUndefined)(n)&&n.classList.contains("e-hor-nav")&&a.classList.contains(tt)||s.hide()}}else(0,e.addClass)([r],gr);(0,e.isNullOrUndefined)(i)&&this.hideHeaderPopup()},r.prototype.hideHeaderPopup=function(){this.headerPopup&&this.headerPopup.hide()},r.prototype.renderHeader=function(){this.element=(0,e.createElement)("div",{className:"e-schedule-toolbar-container"});var t=(0,e.createElement)("div",{className:Ft});this.element.appendChild(t),this.parent.element.insertBefore(this.element,this.parent.element.firstElementChild),this.renderToolbar()},r.prototype.renderToolbar=function(){var e=this,t=this.parent.toolbarItems&&this.parent.toolbarItems.length>0?this.getToolbarItems():this.getItems();this.parent.trigger(p,{requestType:"toolbarItemRendering",items:t},(function(t){e.toolbarObj=new i.Toolbar({items:t.items,overflowMode:"Popup",clicked:e.toolbarClickHandler.bind(e),created:e.toolbarCreateHandler.bind(e),enableRtl:e.parent.enableRtl,enableHtmlSanitizer:e.parent.enableHtmlSanitizer,locale:e.parent.locale}),e.toolbarObj.isStringTemplate=!0,e.toolbarObj.root=e.parent.root?e.parent.root:e.parent,e.toolbarObj.appendTo(e.parent.element.querySelector("."+Ft)),e.toolbarObj.element.setAttribute("aria-label","Scheduler");var n=e.toolbarObj.element.querySelector(".e-prev");n&&n.firstElementChild.setAttribute("title",e.l10n.getConstant("previous"));var r=e.toolbarObj.element.querySelector(".e-next");r&&r.firstElementChild.setAttribute("title",e.l10n.getConstant("next")),e.updateAddIcon(),e.updateActiveView(),e.parent.trigger(c,{requestType:"toolBarItemRendered",items:e.toolbarObj.items})}))},r.prototype.updateItems=function(){var e=this;if(this.toolbarObj){var t=this.getItems();this.parent.trigger(p,{requestType:"toolbarItemRendering",items:t},(function(t){e.toolbarObj.items=t.items,e.toolbarObj.dataBind(),e.parent.trigger(c,{requestType:"toolBarItemRendered",items:e.toolbarObj.items})}))}},r.prototype.getPopUpRelativeElement=function(){return this.parent.isAdaptive?this.toolbarObj.element:this.element.querySelector(".e-date-range")},r.prototype.setDayOfWeek=function(e){this.headerCalendar&&(this.headerCalendar.firstDayOfWeek=e,this.headerCalendar.dataBind())},r.prototype.setCalendarDate=function(e){this.headerCalendar&&(this.headerCalendar.value=e,this.headerCalendar.dataBind())},r.prototype.setCalendarMinMaxDate=function(){this.headerCalendar&&(this.headerCalendar.min=this.parent.minDate,this.headerCalendar.max=this.parent.maxDate,this.headerCalendar.dataBind())},r.prototype.getCalendarView=function(){return["Month","MonthAgenda","TimelineMonth"].indexOf(this.parent.currentView)>-1?"Year":["Year","TimelineYear"].indexOf(this.parent.currentView)>-1?"Decade":"Month"},r.prototype.setCalendarView=function(){if(this.headerCalendar){var e=this.getCalendarView();this.headerCalendar.depth=e,this.headerCalendar.start=e,this.headerCalendar.refresh()}},r.prototype.updateActiveView=function(){var t=[].slice.call(this.toolbarObj.element.querySelectorAll(".e-views"));(0,e.removeClass)(t,["e-active-view"]),t.length>0&&t[this.parent.viewIndex]&&(0,e.addClass)([t[this.parent.viewIndex]],["e-active-view"])},r.prototype.updateDateRange=function(t){var i=this.toolbarObj.element.querySelector(".e-date-range");if(i){i.firstElementChild.setAttribute("aria-haspopup","true");var n=i.querySelector(".e-tbar-btn-text");if(this.parent.activeViewOptions.dateRangeTemplate){n.textContent="";var r={startDate:this.parent.activeView.getStartDate(),endDate:this.parent.activeView.getEndDate(),currentView:this.parent.currentView},a=this.parent.activeViewOptions.dateRangeTemplateName,s=this.parent.element.id+"_"+a+"dateRangeTemplate",o=[].slice.call(this.parent.getDateRangeTemplate()(r,this.parent,"dateRangeTemplate",s,!1,void 0,void 0,this.parent.root));(0,e.append)(o,n)}else{var l=this.parent.activeView.getDateRangeText(t);i.firstElementChild.setAttribute("aria-label",l),n.textContent=l}this.refresh()}},r.prototype.refresh=function(){this.toolbarObj&&this.toolbarObj.refreshOverflow()},r.prototype.updateAddIcon=function(){var t=this.toolbarObj.element.querySelector(".e-add");t&&(this.parent.eventSettings.allowAdding?(0,e.removeClass)([t],Xn):(0,e.addClass)([t],Xn))},r.prototype.getDateRangeText=function(){return je(this.parent.globalize.formatDate(this.parent.selectedDate,{format:"MMMM y",calendar:this.parent.getCalendarMode()}),"single")},r.prototype.getItemModel=function(e){var t={};return e.id&&(t.id=e.id),e.text&&(t.text=e.text),e.tooltipText&&(t.tooltipText=e.tooltipText),e.prefixIcon&&(t.prefixIcon=e.prefixIcon),e.cssClass&&(t.cssClass=e.cssClass),"Both"!==e.showTextOn&&(t.showTextOn=e.showTextOn),e.template&&(t.template=e.template),e.disabled&&(t.disabled=e.disabled),"auto"!==e.width&&(t.width=e.width),e.suffixIcon&&(t.suffixIcon=e.suffixIcon),"Left"!==e.align&&(t.align=e.align),"None"!==e.overflow&&(t.overflow=e.overflow),e.htmlAttributes&&(t.htmlAttributes=e.htmlAttributes),"Button"!==e.type&&(t.type=e.type),!0!==e.visible&&(t.visible=e.visible),e.showAlwaysInPopup&&(t.showAlwaysInPopup=e.showAlwaysInPopup),-1!==e.tabIndex&&(t.tabIndex=e.tabIndex),t},r.prototype.getToolbarItems=function(){for(var t,i=[],n=0,r=this.parent.toolbarItems;n<r.length;n++){var a=r[n];t=this.getItemModel(a);var s=void 0;if(a.name)switch(a.name){case"Today":(s={showAlwaysInPopup:this.parent.isAdaptive||this.parent.enableAdaptiveUI,prefixIcon:"e-icon-today",text:this.l10n.getConstant("today"),cssClass:"e-today",overflow:"Show"}).align=t.align?t.align:a.align,i.push(fr({},s,t));break;case"Previous":(s={prefixIcon:"e-icon-prev",tooltipText:"Previous",overflow:"Show",cssClass:"e-prev",htmlAttributes:{role:"navigation"}}).align=t.align?t.align:a.align,i.push(fr({},s,t));break;case"Next":(s={prefixIcon:"e-icon-next",tooltipText:"Next",overflow:"Show",cssClass:"e-next",htmlAttributes:{role:"navigation"}}).align=t.align?t.align:a.align,i.push(fr({},s,t));break;case"DateRangeText":(s={text:this.getDateRangeText(),suffixIcon:"e-icon-down-arrow",cssClass:"e-date-range",overflow:"Show",htmlAttributes:{"aria-atomic":"true","aria-live":"assertive",role:"navigation"}}).align=t.align?t.align:a.align,i.push(fr({},s,t));break;case"NewEvent":(s={showAlwaysInPopup:this.parent.isAdaptive||this.parent.enableAdaptiveUI,prefixIcon:"e-icon-add",text:this.l10n.getConstant("newEvent"),cssClass:"e-add",overflow:"Show"}).align=t.align?t.align:a.align,i.push(fr({},s,t));break;case"Views":if(!(0,e.isNullOrUndefined)(this.parent.views)&&this.parent.views.length>1)for(var o=0,l=this.parent.views;o<l.length;o++){var p=l[o];(s=this.getItemObject(p)).align=t.align?t.align:a.align,i.push(fr({},s,t))}break;case"Custom":i.push(a)}else i.push(a)}return i},r.prototype.getItems=function(){var t=[];if(t.push({align:"Left",prefixIcon:"e-icon-prev",tooltipText:"Previous",overflow:"Show",cssClass:"e-prev"}),t.push({align:"Left",prefixIcon:"e-icon-next",tooltipText:"Next",overflow:"Show",cssClass:"e-next"}),t.push({align:"Left",text:this.getDateRangeText(),suffixIcon:"e-icon-down-arrow",cssClass:"e-date-range",overflow:"Show",htmlAttributes:{"aria-atomic":"true","aria-live":"assertive"}}),this.parent.isAdaptive||this.parent.enableAdaptiveUI?(t.push({align:"Right",showAlwaysInPopup:this.parent.isAdaptive||this.parent.enableAdaptiveUI,prefixIcon:"e-icon-add",text:this.l10n.getConstant("newEvent"),cssClass:"e-add",overflow:"Show"}),t.push({align:"Right",showAlwaysInPopup:this.parent.isAdaptive||this.parent.enableAdaptiveUI,prefixIcon:"e-icon-today",text:this.l10n.getConstant("today"),cssClass:"e-today",overflow:"Show"})):(t.push({align:"Right",showAlwaysInPopup:this.parent.isAdaptive||this.parent.enableAdaptiveUI,prefixIcon:"e-icon-today",text:this.l10n.getConstant("today"),cssClass:"e-today",overflow:"Show"}),!(0,e.isNullOrUndefined)(this.parent.views)&&this.parent.views.length>1&&t.push({align:"Right",type:"Separator",cssClass:"e-schedule-seperator"})),!(0,e.isNullOrUndefined)(this.parent.views)&&this.parent.views.length>1)for(var i=0,n=this.parent.views;i<n.length;i++){var r=n[i];t.push(this.getItemObject(r))}return t},r.prototype.getItemObject=function(e){var t,i,n;"string"==typeof e?(t=e.toLowerCase(),i=null):(t=e.option.toLowerCase(),i=e.displayName);var r=this.parent.isAdaptive||this.parent.enableAdaptiveUI;switch(t){case"day":n={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-day",text:i||this.l10n.getConstant("day"),cssClass:"e-views e-day"};break;case"week":n={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-week",text:i||this.l10n.getConstant("week"),cssClass:"e-views e-week"};break;case"workweek":n={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-workweek",text:i||this.l10n.getConstant("workWeek"),cssClass:"e-views e-work-week"};break;case"month":n={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-month",text:i||this.l10n.getConstant("month"),cssClass:"e-views e-month"};break;case"year":n={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-year",text:i||this.l10n.getConstant("year"),cssClass:"e-views e-year"};break;case"agenda":n={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-agenda",text:i||this.l10n.getConstant("agenda"),cssClass:"e-views e-agenda"};break;case"monthagenda":n={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-month-agenda",text:i||this.l10n.getConstant("monthAgenda"),cssClass:"e-views e-month-agenda"};break;case"timelineday":n={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-timeline-day",text:i||this.l10n.getConstant("timelineDay"),cssClass:"e-views e-timeline-day"};break;case"timelineweek":n={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-timeline-week",text:i||this.l10n.getConstant("timelineWeek"),cssClass:"e-views e-timeline-week"};break;case"timelineworkweek":n={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-timeline-workweek",text:i||this.l10n.getConstant("timelineWorkWeek"),cssClass:"e-views e-timeline-work-week"};break;case"timelinemonth":n={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-timeline-month",text:i||this.l10n.getConstant("timelineMonth"),cssClass:"e-views e-timeline-month"};break;case"timelineyear":n={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-timeline-year-"+("Vertical"===e.orientation?"vertical":"horizontal"),text:i||this.l10n.getConstant("timelineYear"),cssClass:"e-views e-timeline-year"}}return n},r.prototype.renderHeaderPopup=function(){var i=(0,e.createElement)("div",{className:"e-header-popup"}),r=(0,e.createElement)("div",{className:"e-header-calendar"});i.appendChild(r),this.element.appendChild(i),this.headerPopup=new t.Popup(i,{actionOnScroll:"hide",targetType:"relative",relateTo:this.getPopUpRelativeElement(),position:{X:"left",Y:"bottom"},collision:{X:"fit"},viewPortElement:this.element,enableRtl:this.parent.enableRtl});var a=this.getCalendarView(),s="Month"===this.parent.currentView&&!(0,e.isNullOrUndefined)(this.parent.activeViewOptions.displayDate)&&!this.hasSelectedDate();this.headerCalendar=new n.Calendar({value:s?this.parent.activeViewOptions.displayDate:this.parent.selectedDate,min:this.parent.minDate,max:this.parent.maxDate,firstDayOfWeek:this.parent.activeViewOptions.firstDayOfWeek,weekNumber:this.parent.activeViewOptions.showWeekNumber,enableRtl:this.parent.enableRtl,locale:this.parent.locale,depth:a,start:a,calendarMode:this.parent.calendarMode,change:this.calendarChange.bind(this)}),this.setCalendarTimezone(),this.headerCalendar.appendTo(r),this.headerPopup.hide()},r.prototype.calendarChange=function(e){if(e.value.getTime()!==this.parent.selectedDate.getTime()){var t=ve(new Date(e.value));this.parent.changeDate(t)}this.headerPopup.hide()},r.prototype.setCalendarTimezone=function(){this.headerCalendar&&(this.headerCalendar.timezone=this.parent.timezone||this.parent.tzModule.getLocalTimezoneName())},r.prototype.calculateViewIndex=function(t){var i=(0,e.closest)(t.originalEvent.target,".e-views");return[].slice.call(this.element.querySelectorAll(".e-views")).indexOf(i)},r.prototype.toolbarCreateHandler=function(){this.parent&&this.parent.portals&&this.toolbarObj&&this.toolbarObj.portals&&(this.parent.portals=this.parent.portals.concat(this.toolbarObj.portals),this.parent.renderReactTemplates())},r.prototype.toolbarClickHandler=function(t){if(t.item){var i,n,r;switch(t.item.cssClass.replace("e-views ","")){case"e-date-range":this.headerPopup||this.renderHeaderPopup(),this.headerPopup.element.classList.contains(tt)?this.headerPopup.hide():this.headerPopup.show();break;case"e-day":this.parent.changeView("Day",t.originalEvent,void 0,this.calculateViewIndex(t));break;case"e-week":this.parent.changeView("Week",t.originalEvent,void 0,this.calculateViewIndex(t));break;case"e-work-week":this.parent.changeView("WorkWeek",t.originalEvent,void 0,this.calculateViewIndex(t));break;case"e-month":this.parent.changeView("Month",t.originalEvent,void 0,this.calculateViewIndex(t));break;case"e-year":this.parent.changeView("Year",t.originalEvent,void 0,this.calculateViewIndex(t));break;case"e-agenda":this.parent.changeView("Agenda",t.originalEvent,void 0,this.calculateViewIndex(t));break;case"e-month-agenda":this.parent.changeView("MonthAgenda",t.originalEvent,void 0,this.calculateViewIndex(t));break;case"e-timeline-day":this.parent.changeView("TimelineDay",t.originalEvent,void 0,this.calculateViewIndex(t));break;case"e-timeline-week":this.parent.changeView("TimelineWeek",t.originalEvent,void 0,this.calculateViewIndex(t));break;case"e-timeline-work-week":this.parent.changeView("TimelineWorkWeek",t.originalEvent,void 0,this.calculateViewIndex(t));break;case"e-timeline-month":this.parent.changeView("TimelineMonth",t.originalEvent,void 0,this.calculateViewIndex(t));break;case"e-timeline-year":this.parent.changeView("TimelineYear",t.originalEvent,void 0,this.calculateViewIndex(t));break;case"e-today":r=ve(this.parent.getCurrentTime()),("Agenda"===this.parent.currentView||"MonthAgenda"===this.parent.currentView||!this.parent.isSelectedDate(r)||"Month"===this.parent.currentView&&this.parent.activeViewOptions.displayDate&&!this.hasSelectedDate()&&ve(this.parent.activeViewOptions.displayDate)!==r||"Month"===this.parent.currentView&&this.parent.activeViewOptions.numberOfWeeks>0&&!this.hasSelectedDate()&&ve(ce(this.parent.selectedDate))!==r)&&this.parent.changeDate(r,t.originalEvent);break;case"e-prev":this.parent.changeDate(this.parent.activeView.getNextPreviousDate("Previous"),t.originalEvent);break;case"e-next":this.parent.changeDate(this.parent.activeView.getNextPreviousDate("Next"),t.originalEvent);break;case"e-add":if(n=this.parent.activeCellsData.startTime.getTime()===this.parent.activeCellsData.endTime.getTime(),this.parent.activeCellsData&&!n)i=this.parent.activeCellsData;else{var a=this.parent.activeViewOptions.timeScale.interval,s=this.parent.activeViewOptions.timeScale.slotCount,o=a*ne/s,l=new Date(this.parent.selectedDate.getTime()),p=this.parent.getCurrentTime();l.setHours(p.getHours(),Math.round(l.getMinutes()/o)*o,0);var c=new Date(new Date(l.getTime()).setMilliseconds(l.getMilliseconds()+o));i={startTime:l,endTime:c,isAllDay:!1}}this.parent.eventWindow.openEditor((0,e.extend)(i,{cancel:!1,event:t.originalEvent}),"Add")}if(!(0,e.isNullOrUndefined)(this.toolbarObj)){var h=this.toolbarObj.element.querySelector(".e-toolbar-pop");h&&"Input"!==t.item.type&&h.ej2_instances[0].hide({name:"SlideUp",duration:100})}}},r.prototype.hasSelectedDate=function(){var e=ve(this.parent.selectedDate).getTime();return e>=this.parent.activeView.getStartDate().getTime()&&e<=this.parent.activeView.getEndDate().getTime()},r.prototype.getHeaderElement=function(){return this.toolbarObj.element},r.prototype.updateHeaderItems=function(t){var i=this.toolbarObj.element.querySelector(".e-prev"),n=this.toolbarObj.element.querySelector(".e-next"),r=this.toolbarObj.element.querySelector(".e-date-range");i&&("add"===t?(0,e.addClass)([i],Xn):(0,e.removeClass)([i],Xn)),n&&("add"===t?(0,e.addClass)([n],Xn):(0,e.removeClass)([n],Xn)),r&&("add"===t?(0,e.addClass)([r],$i):(0,e.removeClass)([r],$i))},r.prototype.previousNextIconHandler=function(){var t="Agenda"===this.parent.currentView?[this.parent.getCurrentViewDates()[0]]:this.parent.getCurrentViewDates(),i=this.toolbarObj.element.querySelector(".e-prev"),n=this.toolbarObj.element.querySelector(".e-next"),r=new Date(t[0].getTime()),a=new Date(t[t.length-1].getTime());if("WorkWeek"===this.parent.currentView||"TimelineWorkWeek"===this.parent.currentView)a=ye(r=le(ve(this.parent.selectedDate),this.parent.activeViewOptions.firstDayOfWeek),7*this.parent.activeViewOptions.interval);else if("Month"===this.parent.currentView){var s=!(0,e.isNullOrUndefined)(this.parent.activeViewOptions.displayDate)||this.parent.activeViewOptions.numberOfWeeks>0;r=s?this.parent.activeView.getStartDate():ce(this.parent.selectedDate),a=s?this.parent.activeView.getEndDate():he(Te(r,this.parent.activeViewOptions.interval-1))}(0,e.isNullOrUndefined)(i)||this.toolbarObj.enableItems(i,r>ve(this.parent.minDate)),(0,e.isNullOrUndefined)(n)||this.toolbarObj.enableItems(n,a<ve(this.parent.maxDate)),this.setCalendarMinMaxDate()},r.prototype.getModuleName=function(){return"headerbar"},r.prototype.destroy=function(){this.headerPopup&&!this.headerPopup.isDestroyed&&(this.headerPopup.destroy(),this.headerPopup=null),this.headerCalendar&&!this.headerCalendar.isDestroyed&&(this.headerCalendar.destroy(),this.headerCalendar=null),this.toolbarObj&&!this.toolbarObj.isDestroyed&&(this.toolbarObj.destroy(),this.removeEventListener(),(0,e.remove)(this.element),this.toolbarObj=null),this.element=null,this.parent=null,this.l10n=null},r}(),Tr=function(){function t(e){this.parent=e,this.addEventListener()}return t.prototype.getModuleName=function(){return"scroll"},t.prototype.setWidth=function(){this.parent.element.style.width=(0,e.formatUnit)(this.parent.width)},t.prototype.setHeight=function(){this.parent.element.style.height=(0,e.formatUnit)(this.parent.height)},t.prototype.addEventListener=function(){this.parent.on(_,this.setDimensions,this),this.parent.on(K,this.onPropertyChanged,this)},t.prototype.removeEventListener=function(){this.parent.off(_,this.setDimensions),this.parent.off(K,this.onPropertyChanged)},t.prototype.setDimensions=function(){this.setWidth(),this.setHeight();var e={cssProperties:this.parent.getCssProperties(),module:this.getModuleName()};this.parent.notify(Q,e)},t.prototype.onPropertyChanged=function(){this.setDimensions()},t.prototype.destroy=function(){this.removeEventListener()},t}(),wr=function(){function t(t){this.parent=t,this.element=this.parent.element.querySelector("."+Xe),this.touchObj=new e.Touch(this.element,{scroll:this.scrollHandler.bind(this),swipe:this.swipeHandler.bind(this),tapHold:this.tapHoldHandler.bind(this),swipeSettings:{swipeThresholdDistance:1}}),e.EventHandler.add(this.element,"transitionend",this.onTransitionEnd,this),this.touchLeftDirection=this.parent.enableRtl?"Right":"Left",this.touchRightDirection=this.parent.enableRtl?"Left":"Right"}return t.prototype.scrollHandler=function(t){(0,e.isNullOrUndefined)(this.parent.eventTooltip)||this.parent.eventTooltip.close();var i=!this.parent.isAdaptive&&t.originalEvent&&t.originalEvent.target&&!(0,e.isNullOrUndefined)((0,e.closest)(t.originalEvent.target,"."+Xt));if(this.parent.uiStateValues.isTouchScroll=i&&"touchmove"===t.originalEvent.type&&!this.parent.uiStateValues.action,!i&&"Agenda"!==this.parent.currentView&&!this.parent.uiStateValues.action&&this.parent.allowSwiping&&!this.parent.uiStateValues.isTapHold){if(this.parent.uiStateValues.isSwipeScroll=!0,this.timeStampStart||(this.timeStampStart=Date.now()),this.element.classList.contains(dt)&&this.onTransitionEnd(),"Left"===t.scrollDirection||"Right"===t.scrollDirection){var n={requestType:"dateNavigate",cancel:!1,event:t.originalEvent};if(this.parent.trigger(p,n),n.cancel)return;var r=this.element.querySelector("."+ri);if(r&&r.scrollWidth>r.clientWidth)return;this.isScrollTriggered=!0,t.originalEvent.preventDefault(),t.originalEvent.stopPropagation()}if(t.scrollDirection===this.touchLeftDirection){this.nextPanel||(this.renderPanel(ht,"Next"),this.nextPanel={element:this.parent.activeView.getPanel(),selectedDate:new Date(this.parent.selectedDate.getTime()),renderDates:this.parent.activeView.renderDates,colLevels:this.parent.activeView.colLevels},this.setDimensions(this.nextPanel.element));var a=this.parent.enableRtl?t.distanceX:-t.distanceX;this.element.style.transform="translatex("+(this.getTranslateX(this.element)+a)+"px)"}else if(t.scrollDirection===this.touchRightDirection){var s=0;this.previousPanel||(this.renderPanel(ct,"Previous"),this.previousPanel={element:this.parent.activeView.getPanel(),selectedDate:new Date(this.parent.selectedDate.getTime()),renderDates:this.parent.activeView.renderDates,colLevels:this.parent.activeView.colLevels},this.setDimensions(this.previousPanel.element),s=this.previousPanel.element.offsetWidth);a=this.parent.enableRtl?s-t.distanceX:-s+t.distanceX;this.element.style.transform="translatex("+(this.getTranslateX(this.element)+a)+"px)"}}},t.prototype.swipeHandler=function(t){if(this.isScrollTriggered&&!this.parent.uiStateValues.action&&this.parent.allowSwiping&&!this.parent.uiStateValues.isTapHold){this.isScrollTriggered=!1;var i="Left"===t.swipeDirection?this.parent.activeView.renderDates[0]:this.parent.activeView.renderDates.slice(-1)[0];if("Left"===t.swipeDirection&&i<this.parent.maxDate||"Right"===t.swipeDirection&&i>=this.parent.minDate){var n=Date.now()-this.timeStampStart,r=t.distanceX*(e.Browser.isDevice?6:1.66);r>n||t.distanceX>this.parent.element.offsetWidth/2?(this.swapPanels(t.swipeDirection),r>n&&t.distanceX>this.parent.element.offsetWidth/2&&(this.element.style.transitionDuration=(e.Browser.isDevice?t.distanceX:r)/n/10+"s"),this.confirmSwipe(t.swipeDirection)):this.cancelSwipe();var a={requestType:"dateNavigate",cancel:!1,event:t.originalEvent};this.parent.trigger(c,a)}else this.cancelSwipe();this.timeStampStart=null}},t.prototype.tapHoldHandler=function(t){var i=(0,e.closest)(t.originalEvent.target,"."+Xt);(0,e.isNullOrUndefined)(i)||(this.parent.uiStateValues.isTapHold=!0,this.parent.isAdaptive?(e.Browser.isIos&&e.EventHandler.add(this.element,"touchend",this.preventEventClick,this),this.parent.quickPopup.tapHoldEventPopup(t.originalEvent),this.triggerResizeStart(t.originalEvent)):["Agenda","MonthAgenda","Year"].indexOf(this.parent.currentView)<0&&(this.parent.selectedElements=[],this.parent.eventBase.getSelectedEventElements(i),this.triggerResizeStart(t.originalEvent)))},t.prototype.triggerResizeStart=function(t){this.parent.resizeModule&&(0,e.closest)(t.target,"."+Ei)&&this.parent.resizeModule.resizeStart(t)},t.prototype.preventEventClick=function(t){t.preventDefault(),e.EventHandler.remove(this.element,"touchend",this.preventEventClick)},t.prototype.renderPanel=function(e,t){this.currentPanel?this.parent.setProperties({selectedDate:this.currentPanel.selectedDate},!0):(this.currentPanel={element:this.parent.activeView.getPanel(),selectedDate:new Date(this.parent.selectedDate.getTime()),renderDates:this.parent.activeView.renderDates,colLevels:this.parent.activeView.colLevels},this.setDimensions(this.currentPanel.element)),this.parent.setProperties({selectedDate:this.parent.activeView.getNextPreviousDate(t)},!0),this.parent.headerModule&&this.parent.headerModule.setCalendarDate(this.parent.selectedDate),this.parent.activeView.getRenderDates(),this.parent.activeView.renderLayout(e)},t.prototype.swapPanels=function(e){if(e===this.touchLeftDirection){var t=this.nextPanel;this.nextPanel=this.currentPanel,this.currentPanel=t}else{t=this.previousPanel;this.previousPanel=this.currentPanel,this.currentPanel=t}},t.prototype.confirmSwipe=function(t){var i=this,n={action:"date",cancel:!1,previousDate:t===this.touchLeftDirection?this.nextPanel.selectedDate:this.previousPanel.selectedDate,currentDate:this.currentPanel.selectedDate};this.parent.trigger(g,n,(function(n){if(n.cancel)i.swapPanels(t),i.cancelSwipe();else{i.parent.activeView.setPanel(i.currentPanel.element),i.parent.setProperties({selectedDate:i.currentPanel.selectedDate},!0);var r=void 0;r=i.parent.enableRtl?t===i.touchLeftDirection?i.previousPanel?i.previousPanel.element.offsetLeft:i.currentPanel.element.offsetWidth:0:t===i.touchLeftDirection?-i.currentPanel.element.offsetLeft:0,i.parent.activeView.renderDates=i.currentPanel.renderDates,i.parent.activeView.colLevels=i.currentPanel.colLevels,(0,e.addClass)([i.element],dt),i.element.style.transform="translatex("+r+"px)",i.parent.headerModule&&i.parent.headerModule.updateDateRange(),i.parent.renderTemplates(),i.parent.crudModule.refreshDataManager()}}))},t.prototype.cancelSwipe=function(){this.parent.activeView.setPanel(this.currentPanel.element),this.parent.setProperties({selectedDate:this.currentPanel.selectedDate},!0),this.parent.activeView.renderDates=this.currentPanel.renderDates,this.parent.activeView.colLevels=this.currentPanel.colLevels,(0,e.addClass)([this.element],dt);var t=this.previousPanel?this.previousPanel.element.offsetWidth:0;this.element.style.transform="translatex("+(this.parent.enableRtl?t:-this.currentPanel.element.offsetLeft)+"px)"},t.prototype.onTransitionEnd=function(){((0,e.isNullOrUndefined)(this.element)||this.element.classList.contains(dt))&&(this.parent.uiStateValues.isSwipeScroll=!1,(0,e.removeClass)([this.element],dt),this.element.style.transitionDuration="",this.element.style.transform="",this.previousPanel&&((0,e.remove)(this.previousPanel.element),this.previousPanel=null,(0,e.removeClass)([this.currentPanel.element],ct),(0,e.addClass)([this.currentPanel.element],pt)),this.nextPanel&&((0,e.remove)(this.nextPanel.element),this.nextPanel=null,(0,e.removeClass)([this.currentPanel.element],ht),(0,e.addClass)([this.currentPanel.element],pt)),this.currentPanel=null,this.parent.activeView.getPanel().style.width="")},t.prototype.getTranslateX=function(e){var t=window.getComputedStyle(e);return new WebKitCSSMatrix(t.webkitTransform).m41},t.prototype.setDimensions=function(e){e.style.width=this.parent.element.clientWidth+"px"},t.prototype.resetValues=function(){this.currentPanel=null,this.previousPanel=null,this.nextPanel=null,this.timeStampStart=null,this.element.style.transform="",this.element.style.transitionDuration="",Me(this.element),(0,e.removeClass)([this.element],dt)},t.prototype.destroy=function(){this.touchObj&&(this.touchObj.destroy(),this.touchObj=null),e.EventHandler.remove(this.element,"transitionend",this.onTransitionEnd),this.resetValues()},t}(),Dr=function(){return Dr=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},Dr.apply(this,arguments)},br=function(){function t(t){this.selectedCells=[],this.isCutContentPasted=!1,this.isCutAction=!1,this.keyConfigs={downArrow:"downarrow",upArrow:"uparrow",rightArrow:"rightarrow",leftArrow:"leftarrow",shiftDownArrow:"shift+downarrow",shiftUpArrow:"shift+uparrow",shiftRightArrow:"shift+rightarrow",shiftLeftArrow:"shift+leftarrow",ctrlLeftArrow:"ctrl+leftarrow",ctrlRightArrow:"ctrl+rightarrow",altOne:"alt+1",altTwo:"alt+2",altThree:"alt+3",altFour:"alt+4",altFive:"alt+5",altSix:"alt+6",altSeven:"alt+7",altEight:"alt+8",altNine:"alt+9",enter:"enter",escape:"escape",delete:"delete",backspace:"backspace",home:"home",pageUp:"pageup",pageDown:"pagedown",tab:"tab",shiftTab:"shift+tab",ctrlShiftUpArrow:"ctrl+shift+uparrow",ctrlShiftDownArrow:"ctrl+shift+downarrow",ctrlShiftLeftArrow:"ctrl+shift+leftarrow",ctrlShiftRightArrow:"ctrl+shift+rightarrow",shiftAltY:"shift+alt+y",shiftAltN:"shift+alt+n",cut:"ctrl+x",copy:"ctrl+c",cmdCut:"cmd+x",cmdCopy:"cmd+c"},this.parent=t,this.parent.element.tabIndex=-1===this.parent.element.tabIndex?0:this.parent.element.tabIndex,this.keyboardModule=new e.KeyboardEvents(this.parent.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}),this.addEventListener(),this.createClipboardElement()}return t.prototype.keyActionHandler=function(e){switch(e.action){case"downArrow":case"shiftDownArrow":this.processDown(e,e.shiftKey);break;case"upArrow":case"shiftUpArrow":this.processUp(e,e.shiftKey);break;case"leftArrow":case"shiftLeftArrow":this.processLeft(e,e.shiftKey);break;case"rightArrow":case"shiftRightArrow":this.processRight(e,e.shiftKey);break;case"ctrlLeftArrow":this.parent.changeDate(this.parent.activeView.getNextPreviousDate("Previous"),e),this.parent.headerModule&&this.parent.headerModule.element.querySelector(".e-prev button").focus();break;case"ctrlRightArrow":this.parent.changeDate(this.parent.activeView.getNextPreviousDate("Next"),e),this.parent.headerModule&&this.parent.headerModule.element.querySelector(".e-next button").focus();break;case"altOne":case"altTwo":case"altThree":case"altFour":case"altFive":case"altSix":case"altSeven":case"altEight":case"altNine":this.processViewNavigation(e);break;case"enter":this.processEnter(e);break;case"home":this.focusFirstCell();break;case"tab":case"shiftTab":this.processTab(e,e.shiftKey);break;case"delete":case"backspace":this.processDelete(e);break;case"ctrlShiftUpArrow":case"ctrlShiftDownArrow":case"ctrlShiftLeftArrow":case"ctrlShiftRightArrow":this.processCtrlShiftNavigationArrows(e);break;case"escape":this.processEscape(e);break;case"fTwelve":this.parent.allowInline&&this.parent.inlineModule&&(e.preventDefault(),this.processFTwelve(e));break;case"shiftAltY":this.parent.changeDate(new Date,e);break;case"shiftAltN":if("Agenda"===this.parent.currentView||"MonthAgenda"===this.parent.currentView||"Year"===this.parent.currentView)return;this.processShiftAltN(e);break;case"cut":case"cmdCut":this.processClipboardAction(!0,void 0,e);break;case"copy":case"cmdCopy":this.processClipboardAction(!1,void 0,e)}},t.prototype.processShiftAltN=function(t){var i=this.parent.getSelectedCells(),n=t.target,r=(0,e.extend)({},null,!0);if(i.length>0&&((0,e.closest)(n,"."+$e)||(0,e.closest)(n,"."+Ke)||(0,e.closest)(n,"."+rt)))r=this.getSelectedElements(n);else if((0,e.closest)(n,"."+Xt)&&!(0,e.isNullOrUndefined)(this.parent.activeEventData.event)){var a=this.parent.activeEventData.event;r.startTime=a.StartTime,r.endTime=a.EndTime,r.isAllDay=a.IsAllDay}else{var s=this.parent.getStartEndTime(this.parent.workHours.start),o=this.parent.activeViewOptions.timeScale.interval/this.parent.activeViewOptions.timeScale.slotCount;r.startTime=new Date(this.parent.selectedDate),r.startTime.setHours(s.getHours(),s.getMinutes(),0,0),r.endTime=new Date(r.startTime.getTime()+6e4*o)}var l=(0,e.extend)(r,{cancel:!1,event:t});null!=l&&this.parent.eventWindow.openEditor(l,"Add")},t.prototype.processFTwelve=function(t){var i=t.target;if(i.classList.contains($e)||i.classList.contains(Ke)){this.parent.activeCellsData=this.getSelectedElements(i);var n=(0,e.extend)(this.parent.activeCellsData,{cancel:!1,event:t}),r={element:n.element,groupIndex:n.groupIndex,type:"Cell"};this.parent.notify(A,r)}i.classList.contains(Xt)&&i.click()},t.prototype.addEventListener=function(){this.parent.on($,this.onCellMouseDown,this),this.parent.allowClipboard&&this.parent.on(J,this.pasteHandler,this)},t.prototype.removeEventListener=function(){this.parent.off($,this.onCellMouseDown),this.parent.off(J,this.pasteHandler)},t.prototype.onCellMouseDown=function(t){if(!t.event.shiftKey&&(this.initialTarget=this.getClosestCell(t.event),!this.parent.activeViewOptions.readonly&&"MonthAgenda"!==this.parent.currentView&&this.initialTarget&&(t.event.target.classList.contains($e)&&3!==t.event.which&&(this.parent.removeSelectedClass(),e.EventHandler.add(this.parent.getContentTable(),"mousemove",this.onMouseSelection,this),e.EventHandler.add(this.parent.getContentTable(),"mouseup mouseleave",this.onMoveUp,this)),t.event.target.classList.contains(Ke)&&3!==t.event.which))){this.parent.removeSelectedClass();var i=this.parent.getAllDayRow();e.EventHandler.add(i,"mousemove",this.onMouseSelection,this),e.EventHandler.add(i,"mouseup mouseleave",this.onMoveUp,this)}},t.prototype.onMouseSelection=function(t){var i=[].slice.call(this.parent.element.querySelectorAll("."+Xt));(0,e.addClass)(i,"e-allow-select");var n=this.parent.boundaryValidation(t.pageY,t.pageX);if(n.bottom||n.top||n.left||n.right){var r=this.parent.element.querySelector("."+ri),a=r.offsetHeight<=r.scrollHeight&&r.scrollTop>=0&&r.scrollTop+r.offsetHeight<=r.scrollHeight,s=r.offsetWidth<=r.scrollWidth&&r.scrollLeft>=0&&r.scrollLeft+r.offsetWidth<=r.scrollWidth;a&&(n.top||n.bottom)&&(r.scrollTop+=n.top?-t.target.offsetHeight:t.target.offsetHeight),s&&(n.left||n.right)&&(r.scrollLeft+=n.left?-t.target.offsetWidth:t.target.offsetWidth)}var o=this.getClosestCell(t);o&&this.selectCells(!0,o)},t.prototype.getClosestCell=function(t){return(0,e.closest)(t.target,"."+$e+",."+Ke)},t.prototype.onMoveUp=function(t){var i=this,n=[].slice.call(this.parent.element.querySelectorAll("."+Xt));if((0,e.removeClass)(n,"e-allow-select"),e.EventHandler.remove(this.parent.getContentTable(),"mousemove",this.onMouseSelection),e.EventHandler.remove(this.parent.getContentTable(),"mouseup mouseleave",this.onMoveUp),t.target.classList.contains(Ke)){var a=this.parent.getAllDayRow();e.EventHandler.remove(a,"mousemove",this.onMouseSelection),e.EventHandler.remove(a,"mouseup mouseleave",this.onMoveUp)}if(!this.isPreventAction(t)){var s="."+$e+",."+Ke+",."+rt,l=(0,e.closest)(t.target,s),p=this.parent.getSelectedCells();if(p.length>0&&-1===p.indexOf(l)&&(l=p[p.length-1]),"TimelineYear"!==this.parent.currentView||!l.classList.contains(st)){this.parent.activeCellsData=this.getSelectedElements(l);var c={};this.parent.eventWindow&&this.parent.eventWindow.convertToEventData(this.parent.activeCellsData,c);var h={data:c,element:this.parent.activeCellsData.element,event:t,requestType:I,showQuickPopup:!1};this.parent.trigger(o,h,(function(n){if((n.showQuickPopup||i.parent.quickInfoOnSelectionEnd)&&p.length>1){var a=(0,e.extend)(i.parent.activeCellsData,{cancel:!1,event:t,name:"cellClick"});i.parent.notify(r,a)}}))}}},t.prototype.processEnter=function(t){if(!(this.parent.activeViewOptions.readonly&&!t.target.classList.contains(Xt)||this.isPreventAction(t)||"TimelineYear"===this.parent.currentView&&t.target.classList.contains(st))){var i=t.target;if((0,e.closest)(i,"."+Kn))i.classList.contains(Qi)||i.classList.contains(Ki)||i.classList.contains(Zi)||i.classList.contains(Ji)||i.classList.contains(Wn)?(i.click(),t.preventDefault()):i.classList.contains(Cn)&&(this.parent.element.querySelector("."+Ki).click(),t.preventDefault());else if(i.classList.contains(Ot)&&i.classList.contains(Dt)){var n=i.querySelector("."+Ct);n&&n.click()}else if(i.classList.contains($e)||i.classList.contains(Ke)){this.parent.activeCellsData=this.getSelectedElements(i);var a=(0,e.extend)(this.parent.activeCellsData,{cancel:!1,event:t});if(this.parent.allowInline){var s={element:a.element,groupIndex:a.groupIndex,type:"Cell"};this.parent.notify(A,s)}else"Year"===this.parent.currentView?i.click():this.parent.notify(r,a)}else if(i.classList.contains(dr)&&this.parent.inlineModule)this.parent.inlineModule.inlineCrudActions(i);else{if(!(i.classList.contains(Xt)||i.classList.contains(sn)||i.classList.contains(qi)||i.classList.contains(Bi)))return i.classList.contains(an)?(this.parent.setProperties({selectedDate:this.parent.getDateFromElement(i)},!0),this.parent.changeView(this.parent.getNavigateView(),t),void this.processEscape(t)):void 0;i.click()}}},t.prototype.getSelectedElements=function(e){var t;if(this.selectedCells.length>1&&e.classList.contains(Bt)){var i=this.parent.getCellDetails(this.selectedCells[0]),n=this.parent.getCellDetails(this.selectedCells.slice(-1)[0]);i.endTime=n.endTime,i.element=e,t=i}else t=this.parent.getCellDetails(e);return t},t.prototype.getCells=function(e,t,i){var n=this.parent.getContentTable(),r="TimelineYear"===this.parent.currentView,a=r&&!e?"."+$e+":not(."+st+")":"td",s=[].slice.call(n.querySelectorAll(a)),o=n.rows.length,l=n.rows[0].cells.length;if(t&&t.classList.contains(Ke)){var p=this.parent.getAllDayRow();s=[].slice.call(p.cells),o=1,l=p.cells.length}var c=s.indexOf(t),h=s.indexOf(i),d=[];if(e){for(var u=0;u<l;u++)for(var g=0;g<o;g++){var v=s[l*g+u];r&&v.classList.contains(st)||d.push(v)}c=d.indexOf(t),h=d.indexOf(i)}if(c>h){var m=c;c=h,h=m}return(e?d:s).slice(c,h+1)},t.prototype.focusFirstCell=function(){if("Agenda"===this.parent.currentView){var e=this.parent.getContentTable().querySelector("."+si);return e.setAttribute("tabindex","0"),void e.focus()}if(this.parent.eventBase.removeSelectedAppointmentClass(),this.parent.activeView.isTimelineView()&&"TimelineYear"!==this.parent.currentView){var t=this.parent.element.querySelector("."+Je+" tr:not(."+Xn+") ."+$e+":not(."+mt+")");this.selectCells(!1,t)}else if(this.parent.currentView.indexOf("Year")>-1){var i="."+$e+":not(."+st+"):not(."+mt+")";i+="TimelineYear"===this.parent.currentView&&"Vertical"===this.parent.activeViewOptions.orientation?'[data-date="'+this.parent.activeView.startDate().getTime()+'"]':"",this.selectCells(!1,this.parent.element.querySelector(i))}else this.selectCells(!1,this.parent.getWorkCellElements()[0])},t.prototype.isInverseTableSelect=function(){return this.parent.activeView.isInverseTableSelect},t.prototype.selectCells=function(e,t){var i=this;this.parent.removeSelectedClass();var n=t instanceof Array?t.slice(-1)[0]:t;if(e){var r,a=["Day","Week","WorkWeek","TimelineDay","TimelineWeek","TimelineWorkWeek","TimelineMonth","TimelineYear"],s={element:t,requestType:"mousemove",allowMultipleRow:!0};this.parent.inlineModule.removeInlineAppointmentElement(),this.parent.trigger(o,s,(function(e){if(!e.allowMultipleRow||!i.parent.allowMultiRowSelection){var t="TimelineYear"===i.parent.currentView;if(t&&"Horizontal"===i.parent.activeViewOptions.orientation||"Month"===i.parent.currentView){var s=t&&i.parent.activeViewOptions.group.resources.length>0;n=s?i.initialTarget:i.initialTarget.parentElement.children[n.cellIndex]}else a.indexOf(i.parent.currentView)>-1&&(n=n.parentElement.children[i.initialTarget.cellIndex])}var o=i.getCells(i.isInverseTableSelect(),i.initialTarget,n);if(i.parent.activeViewOptions.group.resources.length>0){r=i.initialTarget.getAttribute("data-group-index");for(var l=[],p=0,c=o;p<c.length;p++){(v=c[p]).getAttribute("data-group-index")===r&&l.push(v)}o=l}if(i.parent.allowMultiCellSelection||(o=[i.initialTarget]),i.selectedCells=o,o.length>2&&!n.classList.contains(Ke)){var h=i.getAllDayCells(o);if(i.parent.activeViewOptions.group.resources.length>0){for(var d=[],u=0,g=h;u<g.length;u++){var v;(v=g[u]).getAttribute("data-group-index")===r&&d.push(v)}h=d}o=o.concat(h)}n.getAttribute("data-group-index")!==r&&i.parent.activeViewOptions.group.resources.length>0&&(n=i.selectedCells[i.selectedCells.length-1]),i.parent.addSelectedClass(o,n)}))}else{s={element:n,requestType:I};this.parent.trigger(o,s,(function(){i.initialTarget=n,i.selectedCells=[n],i.parent.addSelectedClass([n],n)}))}},t.prototype.selectAppointment=function(t,i){var n=this.getAppointmentElements();if(!(n.length<0)){var r;if(this.parent.eventBase.removeSelectedAppointmentClass(),i.classList.contains(Xt)){var a=n.indexOf(i);r=n[t?a-1:a+1]}else r=t?n[n.length-1]:n[0];r&&(this.parent.eventBase.addSelectedAppointments([r],!0),r.focus(),(0,e.addClass)([r],li))}},t.prototype.selectAppointmentElementFromWorkCell=function(e,t){var i=this;if(this.parent.eventBase.removeSelectedAppointmentClass(),this.parent.removeSelectedClass(),t.classList.contains($e)||t.classList.contains(Ke)){var n=this.getUniqueAppointmentElements(),r=[],a=this.parent.getDateFromElement(t).getTime();if(this.parent.eventsProcessed.filter((function(t){return e?t[i.parent.eventFields.startTime].getTime()<=a:t[i.parent.eventFields.startTime].getTime()>=a})).filter((function(e){n.filter((function(t){JSON.stringify(e.Guid)===JSON.stringify(t.getAttribute("data-guid"))&&r.push(t)}))})),r.length>0){var s=e?r[r.length-1]:r[0],o=this.getAppointmentElementsByGuid(s.getAttribute("data-guid"));this.parent.eventBase.addSelectedAppointments(o,!0),o[o.length-1].focus()}}},t.prototype.getAllDayCells=function(e){var t=this.parent.getAllDayRow();if(!t)return[];var i=e[0],n=e[e.length-1],r=this.parent.getCellDetails(i);return this.parent.getCellDetails(n).endTime.getTime()-r.startTime.getTime()>=ie?[].slice.call(t.cells).slice(i.cellIndex,n.cellIndex+1):[]},t.prototype.getAppointmentElements=function(){return[].slice.call(this.parent.element.querySelectorAll("."+Xt))},t.prototype.getAppointmentElementsByGuid=function(e){return[].slice.call(this.parent.element.querySelectorAll('div[data-guid="'+e+'"]'))},t.prototype.getUniqueAppointmentElements=function(){var e=this.getAppointmentElements(),t=[];return e.map((function(e){return e.getAttribute("data-guid")})).filter((function(i,n,r){r.indexOf(i)===n&&t.push(e[parseInt(n.toString(),10)])})),t},t.prototype.getWorkCellFromAppointmentElement=function(e){var t=this.parent.eventBase.getEventByGuid(e.getAttribute("data-guid"));return this.parent.eventBase.selectWorkCellByTime([t])},t.prototype.processViewNavigation=function(t){if(!(0,e.isNullOrUndefined)(t.code)){var i=parseInt(t.code.slice(t.code.length-1),10)-1;if(!isNaN(i)&&!(0,e.isNullOrUndefined)(this.parent.views)&&i<this.parent.views.length){var n=this.parent.viewCollections[parseInt(i.toString(),10)].option;this.parent.changeView(n,t,void 0,i),this.parent.headerModule&&this.parent.headerModule.element.querySelector(".e-active-view button").focus()}}},t.prototype.isCalendarTarget=function(t){var i=t.currentTarget||t.target;return!(!i||(0,e.isNullOrUndefined)(i.querySelector(".e-header-popup.e-popup-open")))},t.prototype.cancelUpDownAction=function(e){var t=e&&"Vertical"===this.parent.activeViewOptions.orientation,i=this.parent.activeViewOptions.group.resources.length>0;return!!(t&&i||e&&this.initialTarget.classList.contains(st))||!((!this.parent.activeView.isTimelineView()||e)&&"MonthAgenda"!==this.parent.currentView)},t.prototype.processUp=function(e,t){var i="TimelineYear"===this.parent.currentView;if(!(t&&this.cancelUpDownAction(i)||this.isCalendarTarget(e))){var n=e.target,r=this.parent.getSelectedCells(),a=this.parent.eventBase.getSelectedAppointments(),s=this.parent.element.querySelector("."+en),o=this.getQuickPopupElement();if(r.length>0&&!e.target.classList.contains($e)&&(n=r[r.length-1]),a.length>0&&!s.classList.contains(tt)&&!o.classList.contains(tt)&&-1!==["Day","Week","WorkWeek","Month"].indexOf(this.parent.currentView)&&(n=this.getWorkCellFromAppointmentElement(a[a.length-1]),this.parent.eventBase.removeSelectedAppointmentClass()),n)if(n.classList.contains($e)&&!this.parent.element.querySelector("."+tt)){var l=this.parent.getTableRows(),p=l.indexOf(n.parentElement),c=void 0;if(i&&t&&0===this.parent.activeViewOptions.group.resources.length&&(c=this.isInverseTableSelect()?this.getVerticalUpDownCell(l,n,p,!0):this.getHorizontalUpDownCell(l,n,p,!0)),(p>0||c)&&p<l.length){if(c=c||l[p-1].cells[n.cellIndex],"Year"===this.parent.currentView&&c.classList.contains(st)){if(!(this.parent.activeView.getStartDate().getTime()<+c.getAttribute("data-date")))return;c=this.getYearUpDownCell(l,p-1,n.cellIndex,!0)}e.preventDefault(),this.selectCells(t,c)}}else"Agenda"!==this.parent.currentView&&"MonthAgenda"!==this.parent.currentView||this.selectAppointment(!0,n)}},t.prototype.processDown=function(e,t){var i="TimelineYear"===this.parent.currentView;if(!(t&&this.cancelUpDownAction(i)||this.isCalendarTarget(e))){var n=e.target,r=this.parent.getSelectedCells(),a=this.parent.eventBase.getSelectedAppointments(),s=this.parent.element.querySelector("."+en),o=this.getQuickPopupElement();r.length>0&&!e.target.classList.contains($e)&&(n=r[r.length-1]),a.length>0&&!s.classList.contains(tt)&&!o.classList.contains(tt)&&-1!==["Day","Week","WorkWeek","Month"].indexOf(this.parent.currentView)&&(n=this.getWorkCellFromAppointmentElement(a[a.length-1]),this.parent.eventBase.removeSelectedAppointmentClass());var l=this.parent.getTableRows();if(n)if(n.classList.contains($e)&&!this.parent.element.querySelector("."+tt)){var p=l.indexOf(n.parentElement),c=void 0;if(i&&t&&0===this.parent.activeViewOptions.group.resources.length&&(c=this.isInverseTableSelect()?this.getVerticalUpDownCell(l,n,p,!1):this.getHorizontalUpDownCell(l,n,p,!1)),p>=0&&(p<l.length-1||c)){if(c=c||l[p+1].cells[n.cellIndex],"Year"===this.parent.currentView&&c.classList.contains(st)){if(!(this.parent.activeView.getEndDate().getTime()>+c.getAttribute("data-date")))return;c=this.getYearUpDownCell(l,p+1,n.cellIndex,!1)}e.preventDefault(),this.selectCells(t,c)}}else"Agenda"!==this.parent.currentView&&"MonthAgenda"!==this.parent.currentView||this.selectAppointment(!1,n)}},t.prototype.getYearUpDownCell=function(e,t,i,n){for(;e[parseInt(t.toString(),10)]&&e[parseInt(t.toString(),10)].cells[parseInt(i.toString(),10)].classList.contains(st);)t+=n?-1:1;return e[parseInt(t.toString(),10)].cells[parseInt(i.toString(),10)]},t.prototype.getHorizontalUpDownCell=function(e,t,i,n){var r=e[i+(n?-1:1)],a=r?r.cells[t.cellIndex]:t;if(a.classList.contains(st)){var s=r.querySelector("."+$e+":not(."+st+")"),o=new Date(+s.getAttribute("data-date")),l='[data-date="'+new Date(o.getFullYear(),o.getMonth()+1,0).getTime()+'"]';a=a.cellIndex<s.cellIndex?s:r.querySelector(l)}return a},t.prototype.getVerticalUpDownCell=function(e,t,i,n){var r=n&&i>0||!n&&i<e.length-1?e[i+(n?-1:1)].cells[t.cellIndex]:void 0;if(!r||r.classList.contains(st)){if(e[parseInt(i.toString(),10)].cells[t.cellIndex-(n?1:-1)]){var a=+t.getAttribute("data-date")-(n?ie:-ie);return this.parent.getContentTable().querySelector("."+$e+'[data-date="'+a+'"]')}r=t}return r},t.prototype.processLeftRight=function(e){var t="Year"===this.parent.currentView?e.closest("tbody"):this.parent.getContentTable(),i=e.parentNode.sectionRowIndex;return{element:t,rowIndex:i,columnIndex:e.cellIndex,maxIndex:t.rows[parseInt(i.toString(),10)].cells.length}},t.prototype.getQuickPopupElement=function(){return(this.parent.isAdaptive?document.body:this.parent.element).querySelector("."+Kn)},t.prototype.isCancelLeftRightAction=function(e,t,i){var n="MonthAgenda"===this.parent.currentView||i&&this.initialTarget.classList.contains(st);if("Agenda"===this.parent.currentView||t&&n)return!0;if(this.isPreventAction(e)&&t)return!0;var r=this.parent.element.querySelector("."+en),a=this.getQuickPopupElement();return!(!r.classList.contains(tt)&&!a.classList.contains(tt))},t.prototype.processRight=function(t,i){var n="TimelineYear"===this.parent.currentView;if(!this.isCancelLeftRightAction(t,i,n)&&!this.isCalendarTarget(t)){var r,a=this.parent.getSelectedCells(),s=this.parent.eventBase.getSelectedAppointments(),o=t.target;if(a.length>0&&!o.classList.contains($e)&&!o.classList.contains(Ke)&&(o=a[a.length-1]),!(s.length>0)||(o=this.getWorkCellFromAppointmentElement(s[s.length-1]),this.parent.eventBase.removeSelectedAppointmentClass(),o))if(o.classList.contains($e)&&t.target.classList.contains($e)){var l=this.processLeftRight(o),p=new Date(+o.getAttribute("data-date")),c="Year"===this.parent.currentView&&p.getTime()===he(p).getTime();if(l.columnIndex>=0&&l.columnIndex<l.maxIndex-1&&!c)r=this.calculateNextPrevDate(o,l.element.rows[l.rowIndex].cells[o.cellIndex+1],"right"),n&&i&&r.classList.contains(st)&&(r=this.getTimelineYearTargetCell(l,o,!0)),(0,e.isNullOrUndefined)(r)||this.selectCells(i,r);else if(l.columnIndex===l.maxIndex-1||c)if(!this.isInverseTableSelect()&&l.rowIndex<l.element.rows.length-1&&!c){r=this.calculateNextPrevDate(o,l.element.rows[l.rowIndex+1].cells[0],"right");var h=n&&i&&r.classList.contains(st);r=h?this.getHorizontalLeftRightCell(l,o,!0):r,(0,e.isNullOrUndefined)(r)||this.selectCells(i,r)}else if(!i){if(c&&p.getTime()!==this.parent.activeView.getEndDate().getTime())return void this.selectCells(i,this.parent.element.querySelector(":not(."+st+')[data-date="'+(p.getTime()+ie)+'"]'));var d=this.isInverseTableSelect()?l.rowIndex:0;this.parent.changeDate(this.parent.activeView.getNextPreviousDate("Next"),t);var u=this.parent.getContentTable(),g=c?u.rows[parseInt(d.toString(),10)].querySelector("."+$e+":not(."+st+")"):u.rows[parseInt(d.toString(),10)].cells[0];this.selectCells(!1,g)}}else if(o.classList.contains(Ke)){var v=o.cellIndex,m=this.parent.getAllDayRow(),f=m.cells.length;if(v>=0&&v<f-1)this.selectCells(i,m.cells[v+1]);else if(v===f-1&&!i){this.parent.changeDate(this.parent.activeView.getNextPreviousDate("Next"),t);var y=this.parent.getAllDayRow();this.selectCells(!1,y.cells[0])}}}},t.prototype.processLeft=function(t,i){var n="TimelineYear"===this.parent.currentView;if(!this.isCancelLeftRightAction(t,i,n)&&!this.isCalendarTarget(t)){var r,a=t.target,s=this.parent.getSelectedCells();s.length>0&&!a.classList.contains($e)&&!a.classList.contains(Ke)&&(a=s[s.length-1]);var o=this.parent.eventBase.getSelectedAppointments();if(!(o.length>0)||(a=this.getWorkCellFromAppointmentElement(o[o.length-1]),this.parent.eventBase.removeSelectedAppointmentClass(),a))if(t.target.classList.contains($e)&&a.classList.contains($e)){var l=this.processLeftRight(a),p=new Date(+a.getAttribute("data-date")),c="Year"===this.parent.currentView&&p.getTime()===ce(p).getTime();if(l.columnIndex>0&&l.columnIndex<l.maxIndex&&!c)r=this.calculateNextPrevDate(a,l.element.rows[l.rowIndex].cells[a.cellIndex-1],"left"),n&&i&&r.classList.contains(st)&&(r=this.getTimelineYearTargetCell(l,a,!1)),(0,e.isNullOrUndefined)(r)||this.selectCells(i,r);else if(0===l.columnIndex||c)if(!this.isInverseTableSelect()&&l.rowIndex>0){r=this.calculateNextPrevDate(a,l.element.rows[l.rowIndex-1].cells[l.maxIndex-1],"left");var h=n&&i&&r.classList.contains(st);r=h?this.getHorizontalLeftRightCell(l,a,!1):r,(0,e.isNullOrUndefined)(r)||this.selectCells(i,r)}else if(!i){if(c&&p.getTime()!==this.parent.activeView.getStartDate().getTime())return void this.selectCells(i,this.parent.element.querySelector('[data-date="'+(p.getTime()-ie)+'"]'));this.parent.changeDate(this.parent.activeView.getNextPreviousDate("Previous"),t);var d=this.parent.getContentTable(),u=this.isInverseTableSelect()?l.rowIndex:d.rows.length-1,g=d.rows[parseInt(u.toString(),10)].cells[l.maxIndex-1];if(c){var v=this.parent.element.querySelectorAll("."+Je+" tbody");g=v.item(v.length-1).querySelector(":not(."+st+')[data-date="'+this.parent.activeView.getEndDate().getTime()+'"]')}this.selectCells(!1,g)}}else if(a.classList.contains(Ke)){var m=a.cellIndex,f=this.parent.getAllDayRow(),y=f.cells.length;if(m>0&&m<y)this.selectCells(i,f.cells[m-1]);else if(0===m&&!i){this.parent.changeDate(this.parent.activeView.getNextPreviousDate("Previous"),t);var T=this.parent.getAllDayRow();this.selectCells(!1,T.cells[y-1])}}}},t.prototype.getTimelineYearTargetCell=function(e,t,i){return this.isInverseTableSelect()?this.getVerticalLeftRightCell(t,i):this.getHorizontalLeftRightCell(e,t,i)},t.prototype.getHorizontalLeftRightCell=function(e,t,i){var n=e.element.rows[t.parentNode.sectionRowIndex+(i?1:-1)];if(n){var r=i?"."+$e+":not(."+st+")":'[data-date="'+(+t.getAttribute("data-date")-ie)+'"]';return n.querySelector(r)}return t},t.prototype.getVerticalLeftRightCell=function(e,t){var i=new Date(+e.getAttribute("data-date")),n=new Date(i.getFullYear(),i.getMonth()+(t?1:-1),1),r=this.parent.getContentTable(),a=r.querySelector('[data-date="'+n.getTime()+'"]');return a.parentNode.sectionRowIndex>e.parentNode.sectionRowIndex?a:r.querySelector('[data-date="'+new Date(n.getFullYear(),n.getMonth()+1,0).getTime()+'"]')},t.prototype.calculateNextPrevDate=function(e,t,i){var n=this.initialTarget.getAttribute("data-group-index");if(this.parent.activeViewOptions.group.resources.length>0&&"Month"===this.parent.currentView&&e&&t&&t.getAttribute("data-group-index")!==n){var r=this.parent.getDateFromElement(e),a="right"===i?new Date(r.setDate(r.getDate()+1)):new Date(r.setDate(r.getDate()-1));t=[].slice.call(this.parent.element.querySelectorAll('td[data-date="'+a.getTime().toString()+'"][data-group-index="'+n+'"]'))[0]}return t},t.prototype.getFocusableElements=function(e){return[].slice.call(e.querySelectorAll('a[href]:not([tabindex="-1"]),input:not([disabled]):not([tabindex="-1"]),textarea:not([disabled]):not([tabindex="-1"]),button:not([disabled]):not([tabindex="-1"]),select:not([disabled]):not([tabindex="-1"]),[tabindex]:not([tabindex="-1"]),[contentEditable=true]:not([tabindex="-1"])'))},t.prototype.processTabOnPopup=function(t,i){var n=this,r=this.getFocusableElements(i),a=(r=r.filter((function(e){var t=n.parent.element.querySelector("."+Gi);return t&&t.offsetParent?!(e.classList.contains(qn)||e.classList.contains(Un)):!(e.classList.contains(Zi)||e.classList.contains(Ji))})))[0],s=r[r.length-1];(0,e.isNullOrUndefined)(s)||document.activeElement!==s||t.shiftKey||(t.preventDefault(),a.focus()),!(0,e.isNullOrUndefined)(a)&&document.activeElement===a&&t.shiftKey&&(t.preventDefault(),s.focus())},t.prototype.processTab=function(t,i){var n=t.target;if(n.classList.contains(dr)&&this.parent.inlineModule&&(n=n.closest(".e-appointment"),this.parent.inlineModule.inlineCrudActions(t.target)),"TimelineYear"===this.parent.currentView&&n.classList.contains(st))n.classList.contains(Bt)&&this.parent.removeSelectedClass();else{var r=(0,e.closest)(n,"."+Kn+",."+en);if(r&&r.classList.contains(tt))return r.classList.contains(en)&&this.parent.eventBase.removeSelectedAppointmentClass(),void this.processTabOnPopup(t,r);if(n.classList.contains(Fe))this.parent.eventBase.removeSelectedAppointmentClass();else if(n.classList.contains(Ot)&&this.parent.activeView.isTimelineView()&&this.parent.activeViewOptions.group.resources.length>0){var a=parseInt(n.getAttribute("data-group-index"),10),s="."+Xt+'[data-group-index="'+(i?a-1:a)+'"]';if((c=[].slice.call(this.parent.element.querySelectorAll(s))).length>0){this.parent.eventBase.removeSelectedAppointmentClass();var o=i?c.slice(-1)[0]:c[0];this.parent.eventBase.addSelectedAppointments([o],!0),o.focus(),t.preventDefault()}else if(a+1===this.parent.resourceBase.lastResourceLevel.length)this.parent.element.focus(),t.preventDefault();else if(this.parent.virtualScrollModule){var l=this.parent.element.querySelector("."+ai),p=Math.round(l.offsetHeight/this.parent.resourceBase.expandedResources.length);this.parent.element.querySelector(".e-content-wrap").scrollTop=(i?a-1:a+1)*p,this.parent.virtualScrollModule.virtualScrolling()}else this.setScrollPosition(a)}else if(n.classList.contains(Xt)){var c=[].slice.call(this.parent.element.querySelectorAll("."+Xt)),h="TimelineYear"===this.parent.currentView;if((this.parent.activeView.isTimelineView()&&!h||h&&"Vertical"===this.parent.activeViewOptions.orientation)&&this.parent.activeViewOptions.group.resources.length>0){a=parseInt(n.getAttribute("data-group-index"),10);c=[].slice.call(this.parent.element.querySelectorAll("."+Xt+'[data-group-index="'+a+'"]'));var d="."+Ot+'[data-group-index="'+(i?a:a+1)+'"]',u=this.parent.element.querySelector(d);if(u&&(i&&n.getAttribute("data-guid")===c[0].getAttribute("data-guid")||!i&&n.getAttribute("data-guid")===c.slice(-1)[0].getAttribute("data-guid")))return this.parent.eventBase.removeSelectedAppointmentClass(),this.parent.virtualScrollModule?u.focus({preventScroll:!0}):u.focus(),this.parent.activeView.isTimelineView()&&this.parent.activeViewOptions.group.resources.length>0&&(0,e.isNullOrUndefined)(this.parent.virtualScrollModule)&&this.setScrollPosition(a),void t.preventDefault()}var g=this.parent.eventBase.getSelectedAppointments();if(g.length>0&&(n=g[g.length-1]),this.parent.eventBase.removeSelectedAppointmentClass(),!i&&n.getAttribute("data-guid")===c[c.length-1].getAttribute("data-guid")||i&&n.getAttribute("data-guid")===c[0].getAttribute("data-guid"))return;"Agenda"!==this.parent.currentView&&"MonthAgenda"!==this.parent.currentView||(this.selectAppointment(i,n),t.preventDefault())}else{var v=this.parent.getSelectedCells();if(v.length>0&&!n.classList.contains(Xt))return n=v[v.length-1],this.selectAppointmentElementFromWorkCell(i,n),void t.preventDefault();n&&!n.classList.contains(Ot)&&this.parent.activeView.isTimelineView()&&this.parent.activeViewOptions.group.resources.length>0&&this.processTabOnResourceCells(n,i)}}},t.prototype.processDelete=function(t){var i=document.activeElement;if("MonthAgenda"===this.parent.currentView){var n=this.parent.eventBase.getSelectedEvents().element;i=n&&(0,e.isNullOrUndefined)(n.length)?n:n[0]}if(i&&i.classList.contains(Xt)){if((0,e.addClass)([i],Zt),this.parent.activeEventData=this.parent.eventBase.getSelectedEvents(),this.parent.activeViewOptions.readonly||i.classList.contains(cr)||!this.parent.eventSettings.allowDeleting)return;this.parent.quickPopup.deleteClick(t)}},t.prototype.processCtrlShiftNavigationArrows=function(e){if(this.parent.activeViewOptions.group.resources.length>0&&document.activeElement.classList.contains(Xt)){var t=parseInt(document.activeElement.getAttribute("data-group-index"),10);r=(r="ctrlShiftLeftArrow"===e.action||"ctrlShiftUpArrow"===e.action?t-1:t+1)<0?0:r>this.parent.resourceBase.lastResourceLevel.length?this.parent.resourceBase.lastResourceLevel.length:r;for(var i=[];0===i.length&&r>=0&&r<=this.parent.resourceBase.lastResourceLevel.length;)i=[].slice.call(this.parent.element.querySelectorAll("."+Xt+'[data-group-index="'+r+'"]')),r="ctrlShiftLeftArrow"===e.action||"ctrlShiftUpArrow"===e.action?r-1:r+1;var n=i[0];n&&(this.parent.eventBase.removeSelectedAppointmentClass(),this.parent.eventBase.addSelectedAppointments([n],!0),n.focus())}else if(this.parent.activeViewOptions.group.resources.length>0&&!document.activeElement.classList.contains(Xt)){var r=this.parent.resourceBase.renderedResources[0].groupIndex,a="."+Xt+'[data-group-index="'+r+'"]',s=[].slice.call(this.parent.element.querySelectorAll(a));if(s.length>0){this.parent.eventBase.removeSelectedAppointmentClass();var o=s[0];this.parent.eventBase.addSelectedAppointments([o],!0),o.focus(),e.preventDefault()}}},t.prototype.processEscape=function(e){this.parent.quickPopup.onClosePopup(e),this.parent.quickPopup.morePopup.hide(),this.parent.headerModule&&this.parent.headerModule.hideHeaderPopup(),this.parent.inlineModule&&this.parent.inlineModule.removeInlineAppointmentElement()},t.prototype.isPreventAction=function(t){var i=(0,e.closest)(t.target,"."+mt);return!(!this.parent.activeView.isTimelineView()||(0,e.isNullOrUndefined)(i))},t.prototype.processTabOnResourceCells=function(e,t){var i=[].slice.call(this.parent.element.querySelectorAll('[tabIndex="0"]')),n=i.indexOf(e),r=t?i[n-1]:i[n+1];if(r&&r.classList.contains(Ot)){var a=parseInt(r.getAttribute("data-group-index"),10);if(this.parent.virtualScrollModule){var s=this.parent.element.querySelector("."+yt);[].slice.call(this.parent.element.querySelectorAll("."+Ot)).forEach((function(e){e.getBoundingClientRect().top<s.getBoundingClientRect().top&&e.setAttribute("tabindex","-1")}))}else this.setScrollPosition(a)}},t.prototype.setScrollPosition=function(e){var t=this.parent.element.querySelector("."+$e+'[data-group-index="'+e+'"]');t&&(this.parent.element.querySelector("."+ri).scrollTop=t.offsetTop)},t.prototype.createClipboardElement=function(){this.parent.allowClipboard&&(this.clipBoardTextArea=this.parent.createElement("textarea",{className:"e-clipboard",attrs:{tabindex:"-1"}}),this.parent.element.appendChild(this.clipBoardTextArea))},t.prototype.setCopy=function(t,i){var n=this;if(""===window.getSelection().toString()){this.clipBoardTextArea.value="";var r={elements:[],eventDatas:[]};if(t){var a=this.filterReadOnlyEvent(t);r.eventDatas=a}else{if(!this.parent||!this.parent.eventBase)return;var s=this.parent.eventBase.getSelectedEvents();s.event=s&&s.event?Array.isArray(s.event)?this.filterReadOnlyEvent(s.event):this.filterReadOnlyEvent([s.event]):void 0,s.element&&s.event?r={elements:s.element,eventDatas:s.event}:(r.element=[i.target],r.eventDatas=[this.parent.getEventDetails(i.target)])}this.clipBoardTextArea.value=JSON.stringify(r.eventDatas,void 0,2),/ipad|ipod|iphone/i.test(e.Browser.userAgent)?this.clipBoardTextArea.setSelectionRange(0,this.clipBoardTextArea.value.length):this.clipBoardTextArea.select(),(0,e.isNullOrUndefined)(navigator.clipboard)||navigator.clipboard.writeText(this.clipBoardTextArea.value).then((function(){if(n.clipBoardTextArea.blur(),window.getSelection().removeAllRanges(),i){var e=i.target.closest("."+Xt);e&&e.focus()}})).catch((function(e){throw e}))}},t.prototype.filterReadOnlyEvent=function(e){var t=this;return e.filter((function(e){return!e[t.parent.eventFields.isReadonly]}))},t.prototype.processClipboardAction=function(e,t,i){this.parent.allowClipboard&&(this.isCutAction=e,this.isCutContentPasted=!1,this.parent.closeQuickInfoPopup(),this.setCopy(t||void 0,i))},t.prototype.pasteHandler=function(e,t){var i=this;if(this.parent.allowClipboard&&!this.isCutContentPasted){var n=this.parent.getSelectedCells().length>0?this.parent.getSelectedCells():t?[t]:[];if(0!==n.length&&!this.parent.eventWindow.dialogObject.visible&&!this.parent.quickPopup.quickPopup.element.classList.contains(tt)){var r=(e.clipboardData||e.event.clipboardData||window.clipboardData).getData("text");if("[]"!==r&&""!==r){var a;try{a=JSON.parse(r)}catch(e){a=r}var s={cancel:!1,data:a,element:n};this.parent.trigger(N,s,(function(e){e.cancel?i.parent.closeQuickInfoPopup():Array.isArray(e.data)&&e.data.every((function(e){return"object"==typeof e}))?(i.processPaste(e.data,t),i.isCutAction&&(i.isCutContentPasted=!0)):i.clipBoardTextArea.value=""}))}}}},t.prototype.processPaste=function(t,i){if(this.parent&&this.parent.eventWindow&&this.parent.eventBase&&t&&t.length){var n=this.getTargetElements(i),r=this.parent.getCellDetails(n),a={};this.parent.eventWindow.convertToEventData(r,a);var s=this.isAllDayEvent(n),o=this.parent.getResourcesByIndex(r.groupIndex),l=this.processEventData(t,s,r,o),p=this.parent.eventBase.sortByDateTime(l),c=this.prepareEventData(p,a);(0,e.removeClass)(n,Bt),c.length>0&&(this.isCutAction?this.parent.saveEvent(c):this.parent.addEvent(c))}},t.prototype.getTargetElements=function(e){return this.parent.getSelectedCells().length>0?this.parent.getSelectedCells():e?[e]:[]},t.prototype.isAllDayEvent=function(e){return!e.some((function(e){return e.classList.contains($e)}))},t.prototype.processEventData=function(e,t,i,n){var r=this;return e.map((function(e){var a,s=Dr({},e,((a={})[r.parent.eventFields.startTime]=new Date(e[r.parent.eventFields.startTime]),a[r.parent.eventFields.endTime]=new Date(e[r.parent.eventFields.endTime]),a[r.parent.eventFields.recurrenceID]=null,a[r.parent.eventFields.isAllDay]=t,a));return r.adjustEventTime(s,t,e.IsAllDay,i),n&&n.groupData&&Object.assign(s,n.groupData),s}))},t.prototype.adjustEventTime=function(e,t,i,n){var r=this.parent.activeViewOptions.timeScale.enable;-1!==["Day","Week","WorkWeek"].indexOf(this.parent.currentView)&&r?t?(e[this.parent.eventFields.endTime]=new Date(e[this.parent.eventFields.startTime]),e[this.parent.eventFields.endTime].setDate(e[this.parent.eventFields.startTime].getDate()+1)):i&&(e[this.parent.eventFields.startTime]=new Date(e[this.parent.eventFields.startTime].setHours(0,0,0,0)),e[this.parent.eventFields.endTime]=new Date(e[this.parent.eventFields.startTime].getTime()+(n.endTime.getTime()-n.startTime.getTime()))):i&&(e[this.parent.eventFields.isAllDay]=!0,e[this.parent.eventFields.startTime]=new Date(e[this.parent.eventFields.startTime].setHours(0,0,0,0)),e[this.parent.eventFields.endTime]=new Date(e[this.parent.eventFields.startTime].getTime()+(e[this.parent.eventFields.endTime].getTime()-e[this.parent.eventFields.startTime].getTime())))},t.prototype.prepareEventData=function(e,t){var i=this,n=new Date(e[0][this.parent.eventFields.startTime]),r=this.parent.getEventMaxID();return e.map((function(e){var a=i.calculateTotalDuration(e,t,n),s=i.isCutAction?e:Dr({},e);return e[i.parent.eventFields.recurrenceRule]||(s[i.parent.eventFields.startTime]=new Date(new Date(s[i.parent.eventFields.startTime]).setMilliseconds(a)),s[i.parent.eventFields.endTime]=new Date(new Date(s[i.parent.eventFields.endTime]).setMilliseconds(a))),i.isCutAction||(s[i.parent.eventFields.id]=r++),s}))},t.prototype.calculateTotalDuration=function(e,t,i){if(-1===["Month","TimelineMonth","TimelineYear"].indexOf(this.parent.currentView)&&this.parent.activeViewOptions.timeScale.enable)return t[this.parent.eventFields.startTime].getTime()-i.getTime();var n=new Date(e[this.parent.eventFields.startTime]);return t[this.parent.eventFields.startTime].getTime()-i.getTime()+(36e5*n.getHours()+6e4*n.getMinutes()+1e3*n.getSeconds())},t.prototype.getModuleName=function(){return"keyboard"},t.prototype.destroy=function(){this.removeEventListener(),this.selectedCells=[],this.clipBoardTextArea=null,this.keyboardModule.destroy()},t}(),Sr=d(74),Cr=function(){function t(e,t,i){this.parent=e,this.initDataManager(t,i)}return t.prototype.initDataManager=function(e,t){this.dataManager=e instanceof Sr.DataManager?e:new Sr.DataManager(e),this.query=t instanceof Sr.Query?t:new Sr.Query},t.prototype.generateQuery=function(t,i){var n=this.query.clone();if(this.parent&&t&&i){if(this.parent.activeViewOptions&&this.parent.activeViewOptions.enableLazyLoading&&!(0,e.isNullOrUndefined)(this.parent.activeViewOptions.group.resources)&&this.parent.activeViewOptions.group.resources.length>0&&this.parent.resourceBase&&this.parent.resourceBase.resourceCollection.length>0&&this.parent.resourceBase.renderedResources.length>0){var r=[];this.parent.resourceBase.resourceCollection.forEach((function(){return r.push([])})),this.parent.resourceBase.renderedResources.forEach((function(e){r.forEach((function(t,i){var n=e.groupOrder[parseInt(i.toString(),10)];n&&t.indexOf(n)<0&&t.push(n)}))})),this.parent.resourceBase.resourceCollection.forEach((function(e,t){n.addParams(e.field,r[parseInt(t.toString(),10)].toString())}))}if(this.parent.timezone&&(t=this.parent.tzModule.remove(new Date(+t.getTime()),this.parent.timezone),i=this.parent.tzModule.remove(new Date(+i.getTime()),this.parent.timezone)),this.parent.eventSettings.includeFiltersInQuery){var a=this.getStartEndQuery(t,i),s=new Sr.Predicate(this.parent.eventFields.recurrenceRule,"notequal",null).and(new Sr.Predicate(this.parent.eventFields.recurrenceRule,"notequal",""));return n.where(a.or(s))}n.addParams("StartDate",t.toISOString()),n.addParams("EndDate",i.toISOString())}return n},t.prototype.getStartEndQuery=function(e,t){var i=this.parent.eventFields;return new Sr.Predicate(i.startTime,"greaterthanorequal",e).and(new Sr.Predicate(i.endTime,"greaterthanorequal",e)).and(new Sr.Predicate(i.startTime,"lessthan",t)).or(new Sr.Predicate(i.startTime,"lessthanorequal",e).and(new Sr.Predicate(i.endTime,"greaterthan",e)))},t.prototype.getData=function(e){return this.dataManager.executeQuery(e)},t.prototype.destroy=function(){this.dataManager=null,this.query=null},t}(),Or=function(){function t(){}return t.prototype.firstDateOfMonth=function(e){return new Date(e.getFullYear(),e.getMonth())},t.prototype.lastDateOfMonth=function(e){return new Date(e.getFullYear(),e.getMonth()+1,0)},t.prototype.isMonthStart=function(e){return 1===e.getDate()},t.prototype.getLeapYearDaysCount=function(){return 366},t.prototype.getYearDaysCount=function(e,t){return(e.getFullYear()+t)%4==0?366:365},t.prototype.getDate=function(e){return e.getDate()},t.prototype.getMonth=function(e){return e.getMonth()+1},t.prototype.getFullYear=function(e){return e.getFullYear()},t.prototype.getYearLastDate=function(e,t){return new Date(e.getFullYear()+t,0,0)},t.prototype.getMonthDaysCount=function(e){return this.lastDateOfMonth(e).getDate()},t.prototype.getMonthStartDate=function(e){return new Date(e.getFullYear(),e.getMonth(),1,e.getHours(),e.getMinutes())},t.prototype.getMonthEndDate=function(e){return e.setDate(1),new Date(e.setMonth(e.getMonth()+1))},t.prototype.getExpectedDays=function(e,t){return t},t.prototype.setDate=function(e,t){e.setDate(t)},t.prototype.setValidDate=function(t,i,n,r,a){(0,e.isNullOrUndefined)(a)?t.setMonth(t.getMonth()+i,n):t.setMonth((a?r:t.getMonth())+i)},t.prototype.setMonth=function(e,t,i){e.setDate(1),e.setFullYear(e.getFullYear()),e.setMonth(t-1);var n=new Date(e.getFullYear(),e.getMonth()+1,0).getDate();e.setDate(Math.min(i,n))},t.prototype.addYears=function(e,t){e.setFullYear(e.getFullYear()+t)},t.prototype.isSameMonth=function(e,t){return e.getMonth()===t.getMonth()},t.prototype.checkMonth=function(e,t){return-1===t.indexOf(e.getMonth()+1)},t.prototype.compareMonth=function(e,t){return e.getMonth()>t.getMonth()},t.prototype.isSameYear=function(e,t){return e.getFullYear()===t.getFullYear()},t.prototype.isLastMonth=function(e){return 11===e.getMonth()},t.prototype.isLeapYear=function(e,t){return(e+t)%4==0},t}(),Er=function(){function t(){}return t.prototype.firstDateOfMonth=function(t){var i=this.getHijriDate(t);return e.HijriParser.toGregorian(i.year,i.month,1)},t.prototype.lastDateOfMonth=function(t){var i=this.getHijriDate(t),n=this.getDaysInMonth(i.month,i.year),r=e.HijriParser.toGregorian(i.year,i.month,n),a=new Date(r.getTime());a=new Date(a.setDate(a.getDate()+1));var s=this.getHijriDate(a);return i.month===s.month?a:(s=this.getHijriDate(r),i.month===s.month?r:new Date(r.setDate(r.getDate()-1)))},t.prototype.isMonthStart=function(e){return 1===this.getHijriDate(e).date},t.prototype.getLeapYearDaysCount=function(){return 355},t.prototype.getYearDaysCount=function(e,t){var i=this.getHijriDate(e);return this.isLeapYear(i.year,t)?355:354},t.prototype.getDate=function(e){return this.getHijriDate(e).date},t.prototype.getMonth=function(e){return this.getHijriDate(e).month},t.prototype.getFullYear=function(e){return this.getHijriDate(e).year},t.prototype.getYearLastDate=function(t,i){var n=this.getHijriDate(t);return e.HijriParser.toGregorian(n.year+i,1,0)},t.prototype.getMonthDaysCount=function(e){var t=this.lastDateOfMonth(e);return this.getHijriDate(t).date},t.prototype.getMonthStartDate=function(e){var t=this.firstDateOfMonth(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate(),e.getHours(),e.getMinutes())},t.prototype.getMonthEndDate=function(e){var t=this.lastDateOfMonth(e);return t.setDate(t.getDate()+1),new Date(t.setMonth(t.getMonth()))},t.prototype.getExpectedDays=function(t,i){for(var n=this.getHijriDate(t),r=[],a=0;a<i.length;a++){var s=e.HijriParser.toGregorian(n.year,n.month,i[parseInt(a.toString(),10)]);r.push(s.getDate())}return r},t.prototype.setDate=function(t,i){var n=this.getHijriDate(t),r=e.HijriParser.toGregorian(n.year,n.month,i);this.updateDateObj(t,r)},t.prototype.setValidDate=function(t,i,n,r,a){var s=(0,e.isNullOrUndefined)(a)?t:this.firstDateOfMonth(a),o=this.getHijriDate(s),l=e.HijriParser.toGregorian(o.year,o.month+i,n);this.updateDateObj(t,l)},t.prototype.setMonth=function(t,i,n){var r=this.getHijriDate(t),a=e.HijriParser.toGregorian(r.year,i,n);this.updateDateObj(t,a)},t.prototype.addYears=function(t,i,n){var r=this.getHijriDate(t),a=e.HijriParser.toGregorian(r.year+i,n,1);this.updateDateObj(t,a)},t.prototype.isSameMonth=function(e,t){var i=this.getHijriDate(e),n=this.getHijriDate(t);return i.month===n.month},t.prototype.checkMonth=function(e,t){var i=this.getHijriDate(e);return-1===t.indexOf(i.month)},t.prototype.compareMonth=function(e,t){var i=this.getHijriDate(e),n=this.getHijriDate(t);return i.month>n.month},t.prototype.isSameYear=function(e,t){var i=this.getHijriDate(e),n=this.getHijriDate(t);return i.year===n.year},t.prototype.isLastMonth=function(e){return 12===this.getHijriDate(e).month},t.prototype.updateDateObj=function(e,t){e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate())},t.prototype.isLeapYear=function(e,t){return(14+11*(e+t))%30<11},t.prototype.getDaysInMonth=function(e,t){var i=0;return i=29+(e+1)%2,11===e&&this.isLeapYear(t,0)&&i++,i},t.prototype.getHijriDate=function(t){return e.HijriParser.getHijriDate(t)},t}(),xr=function(){function e(){this.timezoneData=[],this.timezoneData=this.getTimezoneData()}return e.prototype.offset=function(e,t){var i=e.getTimezoneOffset();try{var n=new Date(e.toLocaleString("en-US",{timeZone:t}));return isNaN(n.getTime())?0:(e.getTime()-n.getTime())/6e4+i}catch(e){return 0}},e.prototype.convert=function(e,t,i){"string"==typeof t&&(t=this.offset(e,t)),"string"==typeof i&&(i=this.offset(e,i));var n=e.getTimezoneOffset(),r=(e=new Date(e.getTime()+6e4*(t-i))).getTimezoneOffset();return new Date(e.getTime()+6e4*(r-n))},e.prototype.add=function(e,t){return this.convert(e,e.getTimezoneOffset(),t)},e.prototype.remove=function(e,t){return this.convert(e,t,e.getTimezoneOffset())},e.prototype.removeLocalOffset=function(e){return new Date(e.getTime()-6e4*e.getTimezoneOffset())},e.prototype.getLocalTimezoneName=function(){return window.Intl&&Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"},e.prototype.getTimezoneData=function(){return Vr},e}(),Vr=[{Value:"Pacific/Niue",Text:"(UTC-11:00) Niue"},{Value:"Pacific/Pago_Pago",Text:"(UTC-11:00) Pago Pago"},{Value:"Pacific/Honolulu",Text:"(UTC-10:00) Hawaii Time"},{Value:"Pacific/Rarotonga",Text:"(UTC-10:00) Rarotonga"},{Value:"Pacific/Tahiti",Text:"(UTC-10:00) Tahiti"},{Value:"Pacific/Marquesas",Text:"(UTC-09:30) Marquesas"},{Value:"America/Anchorage",Text:"(UTC-09:00) Alaska Time"},{Value:"Pacific/Gambier",Text:"(UTC-09:00) Gambier"},{Value:"America/Los_Angeles",Text:"(UTC-08:00) Pacific Time"},{Value:"America/Tijuana",Text:"(UTC-08:00) Pacific Time - Tijuana"},{Value:"America/Vancouver",Text:"(UTC-08:00) Pacific Time - Vancouver"},{Value:"America/Whitehorse",Text:"(UTC-08:00) Pacific Time - Whitehorse"},{Value:"Pacific/Pitcairn",Text:"(UTC-08:00) Pitcairn"},{Value:"America/Denver",Text:"(UTC-07:00) Mountain Time"},{Value:"America/Phoenix",Text:"(UTC-07:00) Mountain Time - Arizona"},{Value:"America/Mazatlan",Text:"(UTC-07:00) Mountain Time - Chihuahua, Mazatlan"},{Value:"America/Dawson_Creek",Text:"(UTC-07:00) Mountain Time - Dawson Creek"},{Value:"America/Edmonton",Text:"(UTC-07:00) Mountain Time - Edmonton"},{Value:"America/Hermosillo",Text:"(UTC-07:00) Mountain Time - Hermosillo"},{Value:"America/Yellowknife",Text:"(UTC-07:00) Mountain Time - Yellowknife"},{Value:"America/Belize",Text:"(UTC-06:00) Belize"},{Value:"America/Chicago",Text:"(UTC-06:00) Central Time"},{Value:"America/Mexico_City",Text:"(UTC-06:00) Central Time - Mexico City"},{Value:"America/Regina",Text:"(UTC-06:00) Central Time - Regina"},{Value:"America/Tegucigalpa",Text:"(UTC-06:00) Central Time - Tegucigalpa"},{Value:"America/Winnipeg",Text:"(UTC-06:00) Central Time - Winnipeg"},{Value:"America/Costa_Rica",Text:"(UTC-06:00) Costa Rica"},{Value:"America/El_Salvador",Text:"(UTC-06:00) El Salvador"},{Value:"Pacific/Galapagos",Text:"(UTC-06:00) Galapagos"},{Value:"America/Guatemala",Text:"(UTC-06:00) Guatemala"},{Value:"America/Managua",Text:"(UTC-06:00) Managua"},{Value:"America/Cancun",Text:"(UTC-05:00) America Cancun"},{Value:"America/Bogota",Text:"(UTC-05:00) Bogota"},{Value:"Pacific/Easter",Text:"(UTC-05:00) Easter Island"},{Value:"America/New_York",Text:"(UTC-05:00) Eastern Time"},{Value:"America/Iqaluit",Text:"(UTC-05:00) Eastern Time - Iqaluit"},{Value:"America/Toronto",Text:"(UTC-05:00) Eastern Time - Toronto"},{Value:"America/Guayaquil",Text:"(UTC-05:00) Guayaquil"},{Value:"America/Havana",Text:"(UTC-05:00) Havana"},{Value:"America/Jamaica",Text:"(UTC-05:00) Jamaica"},{Value:"America/Lima",Text:"(UTC-05:00) Lima"},{Value:"America/Nassau",Text:"(UTC-05:00) Nassau"},{Value:"America/Panama",Text:"(UTC-05:00) Panama"},{Value:"America/Port-au-Prince",Text:"(UTC-05:00) Port-au-Prince"},{Value:"America/Rio_Branco",Text:"(UTC-05:00) Rio Branco"},{Value:"America/Halifax",Text:"(UTC-04:00) Atlantic Time - Halifax"},{Value:"America/Barbados",Text:"(UTC-04:00) Barbados"},{Value:"Atlantic/Bermuda",Text:"(UTC-04:00) Bermuda"},{Value:"America/Boa_Vista",Text:"(UTC-04:00) Boa Vista"},{Value:"America/Caracas",Text:"(UTC-04:00) Caracas"},{Value:"America/Curacao",Text:"(UTC-04:00) Curacao"},{Value:"America/Grand_Turk",Text:"(UTC-04:00) Grand Turk"},{Value:"America/Guyana",Text:"(UTC-04:00) Guyana"},{Value:"America/La_Paz",Text:"(UTC-04:00) La Paz"},{Value:"America/Manaus",Text:"(UTC-04:00) Manaus"},{Value:"America/Martinique",Text:"(UTC-04:00) Martinique"},{Value:"America/Port_of_Spain",Text:"(UTC-04:00) Port of Spain"},{Value:"America/Porto_Velho",Text:"(UTC-04:00) Porto Velho"},{Value:"America/Puerto_Rico",Text:"(UTC-04:00) Puerto Rico"},{Value:"America/Santo_Domingo",Text:"(UTC-04:00) Santo Domingo"},{Value:"America/Thule",Text:"(UTC-04:00) Thule"},{Value:"America/St_Johns",Text:"(UTC-03:30) Newfoundland Time - St. Johns"},{Value:"America/Araguaina",Text:"(UTC-03:00) Araguaina"},{Value:"America/Asuncion",Text:"(UTC-03:00) Asuncion"},{Value:"America/Belem",Text:"(UTC-03:00) Belem"},{Value:"America/Argentina/Buenos_Aires",Text:"(UTC-03:00) Buenos Aires"},{Value:"America/Campo_Grande",Text:"(UTC-03:00) Campo Grande"},{Value:"America/Cayenne",Text:"(UTC-03:00) Cayenne"},{Value:"America/Cuiaba",Text:"(UTC-03:00) Cuiaba"},{Value:"America/Fortaleza",Text:"(UTC-03:00) Fortaleza"},{Value:"America/Godthab",Text:"(UTC-03:00) Godthab"},{Value:"America/Maceio",Text:"(UTC-03:00) Maceio"},{Value:"America/Miquelon",Text:"(UTC-03:00) Miquelon"},{Value:"America/Montevideo",Text:"(UTC-03:00) Montevideo"},{Value:"Antarctica/Palmer",Text:"(UTC-03:00) Palmer"},{Value:"America/Paramaribo",Text:"(UTC-03:00) Paramaribo"},{Value:"America/Punta_Arenas",Text:"(UTC-03:00) Punta Arenas"},{Value:"America/Recife",Text:"(UTC-03:00) Recife"},{Value:"Antarctica/Rothera",Text:"(UTC-03:00) Rothera"},{Value:"America/Bahia",Text:"(UTC-03:00) Salvador"},{Value:"America/Santiago",Text:"(UTC-03:00) Santiago"},{Value:"Atlantic/Stanley",Text:"(UTC-03:00) Stanley"},{Value:"America/Noronha",Text:"(UTC-02:00) Noronha"},{Value:"America/Sao_Paulo",Text:"(UTC-02:00) Sao Paulo"},{Value:"Atlantic/South_Georgia",Text:"(UTC-02:00) South Georgia"},{Value:"Atlantic/Azores",Text:"(UTC-01:00) Azores"},{Value:"Atlantic/Cape_Verde",Text:"(UTC-01:00) Cape Verde"},{Value:"America/Scoresbysund",Text:"(UTC-01:00) Scoresbysund"},{Value:"Africa/Abidjan",Text:"(UTC+00:00) Abidjan"},{Value:"Africa/Accra",Text:"(UTC+00:00) Accra"},{Value:"Africa/Bissau",Text:"(UTC+00:00) Bissau"},{Value:"Atlantic/Canary",Text:"(UTC+00:00) Canary Islands"},{Value:"Africa/Casablanca",Text:"(UTC+00:00) Casablanca"},{Value:"America/Danmarkshavn",Text:"(UTC+00:00) Danmarkshavn"},{Value:"Europe/Dublin",Text:"(UTC+00:00) Dublin"},{Value:"Africa/El_Aaiun",Text:"(UTC+00:00) El Aaiun"},{Value:"Atlantic/Faroe",Text:"(UTC+00:00) Faeroe"},{Value:"Etc/UTC",Text:"(UTC+00:00) UTC (no daylight saving)"},{Value:"Europe/Lisbon",Text:"(UTC+00:00) Lisbon"},{Value:"Europe/London",Text:"(UTC+00:00) London"},{Value:"Africa/Monrovia",Text:"(UTC+00:00) Monrovia"},{Value:"Atlantic/Reykjavik",Text:"(UTC+00:00) Reykjavik"},{Value:"UTC",Text:"UTC"},{Value:"Africa/Algiers",Text:"(UTC+01:00) Algiers"},{Value:"Europe/Amsterdam",Text:"(UTC+01:00) Amsterdam"},{Value:"Europe/Andorra",Text:"(UTC+01:00) Andorra"},{Value:"Europe/Berlin",Text:"(UTC+01:00) Berlin"},{Value:"Europe/Brussels",Text:"(UTC+01:00) Brussels"},{Value:"Europe/Budapest",Text:"(UTC+01:00) Budapest"},{Value:"Europe/Belgrade",Text:"(UTC+01:00) Central European Time - Belgrade"},{Value:"Europe/Prague",Text:"(UTC+01:00) Central European Time - Prague"},{Value:"Africa/Ceuta",Text:"(UTC+01:00) Ceuta"},{Value:"Europe/Copenhagen",Text:"(UTC+01:00) Copenhagen"},{Value:"Europe/Gibraltar",Text:"(UTC+01:00) Gibraltar"},{Value:"Africa/Lagos",Text:"(UTC+01:00) Lagos"},{Value:"Europe/Luxembourg",Text:"(UTC+01:00) Luxembourg"},{Value:"Europe/Madrid",Text:"(UTC+01:00) Madrid"},{Value:"Europe/Malta",Text:"(UTC+01:00) Malta"},{Value:"Europe/Monaco",Text:"(UTC+01:00) Monaco"},{Value:"Africa/Ndjamena",Text:"(UTC+01:00) Ndjamena"},{Value:"Europe/Oslo",Text:"(UTC+01:00) Oslo"},{Value:"Europe/Paris",Text:"(UTC+01:00) Paris"},{Value:"Europe/Rome",Text:"(UTC+01:00) Rome"},{Value:"Europe/Stockholm",Text:"(UTC+01:00) Stockholm"},{Value:"Europe/Tirane",Text:"(UTC+01:00) Tirane"},{Value:"Africa/Tunis",Text:"(UTC+01:00) Tunis"},{Value:"Europe/Vienna",Text:"(UTC+01:00) Vienna"},{Value:"Europe/Warsaw",Text:"(UTC+01:00) Warsaw"},{Value:"Europe/Zurich",Text:"(UTC+01:00) Zurich"},{Value:"Asia/Amman",Text:"(UTC+02:00) Amman"},{Value:"Europe/Athens",Text:"(UTC+02:00) Athens"},{Value:"Asia/Beirut",Text:"(UTC+02:00) Beirut"},{Value:"Europe/Bucharest",Text:"(UTC+02:00) Bucharest"},{Value:"Africa/Cairo",Text:"(UTC+02:00) Cairo"},{Value:"Europe/Chisinau",Text:"(UTC+02:00) Chisinau"},{Value:"Asia/Damascus",Text:"(UTC+02:00) Damascus"},{Value:"Asia/Gaza",Text:"(UTC+02:00) Gaza"},{Value:"Europe/Helsinki",Text:"(UTC+02:00) Helsinki"},{Value:"Asia/Jerusalem",Text:"(UTC+02:00) Jerusalem"},{Value:"Africa/Johannesburg",Text:"(UTC+02:00) Johannesburg"},{Value:"Africa/Khartoum",Text:"(UTC+02:00) Khartoum"},{Value:"Europe/Kiev",Text:"(UTC+02:00) Kiev"},{Value:"Africa/Maputo",Text:"(UTC+02:00) Maputo"},{Value:"Europe/Kaliningrad",Text:"(UTC+02:00) Moscow-01 - Kaliningrad"},{Value:"Asia/Nicosia",Text:"(UTC+02:00) Nicosia"},{Value:"Europe/Riga",Text:"(UTC+02:00) Riga"},{Value:"Europe/Sofia",Text:"(UTC+02:00) Sofia"},{Value:"Europe/Tallinn",Text:"(UTC+02:00) Tallinn"},{Value:"Africa/Tripoli",Text:"(UTC+02:00) Tripoli"},{Value:"Europe/Vilnius",Text:"(UTC+02:00) Vilnius"},{Value:"Africa/Windhoek",Text:"(UTC+02:00) Windhoek"},{Value:"Asia/Baghdad",Text:"(UTC+03:00) Baghdad"},{Value:"Europe/Istanbul",Text:"(UTC+03:00) Istanbul"},{Value:"Europe/Minsk",Text:"(UTC+03:00) Minsk"},{Value:"Europe/Moscow",Text:"(UTC+03:00) Moscow+00 - Moscow"},{Value:"Africa/Nairobi",Text:"(UTC+03:00) Nairobi"},{Value:"Asia/Qatar",Text:"(UTC+03:00) Qatar"},{Value:"Asia/Riyadh",Text:"(UTC+03:00) Riyadh"},{Value:"Antarctica/Syowa",Text:"(UTC+03:00) Syowa"},{Value:"Asia/Tehran",Text:"(UTC+03:30) Tehran"},{Value:"Asia/Baku",Text:"(UTC+04:00) Baku"},{Value:"Asia/Dubai",Text:"(UTC+04:00) Dubai"},{Value:"Indian/Mahe",Text:"(UTC+04:00) Mahe"},{Value:"Indian/Mauritius",Text:"(UTC+04:00) Mauritius"},{Value:"Europe/Samara",Text:"(UTC+04:00) Moscow+01 - Samara"},{Value:"Indian/Reunion",Text:"(UTC+04:00) Reunion"},{Value:"Asia/Tbilisi",Text:"(UTC+04:00) Tbilisi"},{Value:"Asia/Yerevan",Text:"(UTC+04:00) Yerevan"},{Value:"Asia/Kabul",Text:"(UTC+04:30) Kabul"},{Value:"Asia/Aqtau",Text:"(UTC+05:00) Aqtau"},{Value:"Asia/Aqtobe",Text:"(UTC+05:00) Aqtobe"},{Value:"Asia/Ashgabat",Text:"(UTC+05:00) Ashgabat"},{Value:"Asia/Dushanbe",Text:"(UTC+05:00) Dushanbe"},{Value:"Asia/Karachi",Text:"(UTC+05:00) Karachi"},{Value:"Indian/Kerguelen",Text:"(UTC+05:00) Kerguelen"},{Value:"Indian/Maldives",Text:"(UTC+05:00) Maldives"},{Value:"Antarctica/Mawson",Text:"(UTC+05:00) Mawson"},{Value:"Asia/Yekaterinburg",Text:"(UTC+05:00) Moscow+02 - Yekaterinburg"},{Value:"Asia/Tashkent",Text:"(UTC+05:00) Tashkent"},{Value:"Asia/Colombo",Text:"(UTC+05:30) Colombo"},{Value:"Asia/Kolkata",Text:"(UTC+05:30) India Standard Time"},{Value:"Asia/Katmandu",Text:"(UTC+05:45) Katmandu"},{Value:"Asia/Almaty",Text:"(UTC+06:00) Almaty"},{Value:"Asia/Bishkek",Text:"(UTC+06:00) Bishkek"},{Value:"Indian/Chagos",Text:"(UTC+06:00) Chagos"},{Value:"Asia/Dhaka",Text:"(UTC+06:00) Dhaka"},{Value:"Asia/Omsk",Text:"(UTC+06:00) Moscow+03 - Omsk"},{Value:"Asia/Thimphu",Text:"(UTC+06:00) Thimphu"},{Value:"Antarctica/Vostok",Text:"(UTC+06:00) Vostok"},{Value:"Indian/Cocos",Text:"(UTC+06:30) Cocos"},{Value:"Asia/Yangon",Text:"(UTC+06:30) Rangoon"},{Value:"Asia/Bangkok",Text:"(UTC+07:00) Bangkok"},{Value:"Indian/Christmas",Text:"(UTC+07:00) Christmas"},{Value:"Antarctica/Davis",Text:"(UTC+07:00) Davis"},{Value:"Asia/Saigon",Text:"(UTC+07:00) Hanoi"},{Value:"Asia/Hovd",Text:"(UTC+07:00) Hovd"},{Value:"Asia/Jakarta",Text:"(UTC+07:00) Jakarta"},{Value:"Asia/Krasnoyarsk",Text:"(UTC+07:00) Moscow+04 - Krasnoyarsk"},{Value:"Asia/Brunei",Text:"(UTC+08:00) Brunei"},{Value:"Asia/Shanghai",Text:"(UTC+08:00) China Time - Beijing"},{Value:"Asia/Choibalsan",Text:"(UTC+08:00) Choibalsan"},{Value:"Asia/Hong_Kong",Text:"(UTC+08:00) Hong Kong"},{Value:"Asia/Kuala_Lumpur",Text:"(UTC+08:00) Kuala Lumpur"},{Value:"Asia/Macau",Text:"(UTC+08:00) Macau"},{Value:"Asia/Makassar",Text:"(UTC+08:00) Makassar"},{Value:"Asia/Manila",Text:"(UTC+08:00) Manila"},{Value:"Asia/Irkutsk",Text:"(UTC+08:00) Moscow+05 - Irkutsk"},{Value:"Asia/Singapore",Text:"(UTC+08:00) Singapore"},{Value:"Asia/Taipei",Text:"(UTC+08:00) Taipei"},{Value:"Asia/Ulaanbaatar",Text:"(UTC+08:00) Ulaanbaatar"},{Value:"Australia/Perth",Text:"(UTC+08:00) Western Time - Perth"},{Value:"Asia/Pyongyang",Text:"(UTC+08:30) Pyongyang"},{Value:"Asia/Dili",Text:"(UTC+09:00) Dili"},{Value:"Asia/Jayapura",Text:"(UTC+09:00) Jayapura"},{Value:"Asia/Yakutsk",Text:"(UTC+09:00) Moscow+06 - Yakutsk"},{Value:"Pacific/Palau",Text:"(UTC+09:00) Palau"},{Value:"Asia/Seoul",Text:"(UTC+09:00) Seoul"},{Value:"Asia/Tokyo",Text:"(UTC+09:00) Tokyo"},{Value:"Australia/Darwin",Text:"(UTC+09:30) Central Time - Darwin"},{Value:"Antarctica/DumontDUrville",Text:'(UTC+10:00) Dumont D"Urville'},{Value:"Australia/Brisbane",Text:"(UTC+10:00) Eastern Time - Brisbane"},{Value:"Pacific/Guam",Text:"(UTC+10:00) Guam"},{Value:"Asia/Vladivostok",Text:"(UTC+10:00) Moscow+07 - Vladivostok"},{Value:"Pacific/Port_Moresby",Text:"(UTC+10:00) Port Moresby"},{Value:"Pacific / Chuuk",Text:"(UTC+10:00) Truk"},{Value:"Australia/Adelaide",Text:"(UTC+10:30) Central Time - Adelaide"},{Value:"Antarctica/Casey",Text:"(UTC+11:00) Casey"},{Value:"Australia/Hobart",Text:"(UTC+11:00) Eastern Time - Hobart"},{Value:"Australia/Sydney",Text:"(UTC+11:00) Eastern Time - Melbourne, Sydney"},{Value:"Pacific/Efate",Text:"(UTC+11:00) Efate"},{Value:"Pacific/Guadalcanal",Text:"(UTC+11:00) Guadalcanal"},{Value:"Pacific/Kosrae",Text:"(UTC+11:00) Kosrae"},{Value:"Asia/Magadan",Text:"(UTC+11:00) Moscow+08 - Magadan"},{Value:"Pacific / Norfolk",Text:"(UTC+11:00) Norfolk"},{Value:"Pacific/Noumea",Text:"(UTC+11:00) Noumea"},{Value:"Pacific/Pohnpei",Text:"(UTC+11:00) Ponape"},{Value:"Pacific/Funafuti",Text:"(UTC+12:00) Funafuti"},{Value:"Pacific/Kwajalein",Text:"(UTC+12:00) Kwajalein"},{Value:"Pacific/Majuro",Text:"(UTC+12:00) Majuro"},{Value:"Asia/Kamchatka",Text:"(UTC+12:00) Moscow+09 - Petropavlovsk - Kamchatskiy"},{Value:"Pacific / Nauru",Text:"(UTC+12:00) Nauru"},{Value:"Pacific/Tarawa",Text:"(UTC+12:00) Tarawa"},{Value:"Pacific/Wake",Text:"(UTC+12:00) Wake"},{Value:"Pacific/Wallis",Text:"(UTC+12:00) Wallis"},{Value:"Pacific/Auckland",Text:"(UTC+13:00) Auckland"},{Value:"Pacific/Enderbury",Text:"(UTC+13:00) Enderbury"},{Value:"Pacific/Fakaofo",Text:"(UTC+13:00) Fakaofo"},{Value:"Pacific/Fiji",Text:"(UTC+13:00) Fiji"},{Value:"Pacific/Tongatapu",Text:"(UTC+13:00) Tongatapu"},{Value:"Pacific/Apia",Text:"(UTC+14:00) Apia"},{Value:"Pacific/Kiritimati",Text:"(UTC+14:00) Kiritimati"}];function Ar(t,i,n,r){void 0===r&&(r="Gregorian");var a,s,o=Jr(t),l=i.getConstant(ma)+" ",p=r.toLowerCase();if("en"===n||"en-US"===n){var c="months.stand-alone.abbreviated",h="days.stand-alone.abbreviated";s=(0,e.getValue)(c,(0,e.getDefaultDateObject)(p)),a=(0,e.getValue)(h,(0,e.getDefaultDateObject)(p))}else{c="main."+n+".dates.calendars."+p+".months.stand-alone.abbreviated",h="main."+n+".dates.calendars."+p+".days.stand-alone.abbreviated";s=(0,e.getValue)(c,e.cldrData),a=(0,e.getValue)(h,e.cldrData)}switch(o.interval>1&&(l+=o.interval+" "),o.freq){case"DAILY":l+=i.getConstant(ya);break;case"WEEKLY":l+=i.getConstant(Ta)+" "+i.getConstant(va)+" ",o.day.forEach((function(t,i){l+=je((0,e.getValue)(ba[""+t],a),"single"),l+=o.day.length-1===i?"":", "}));break;case"MONTHLY":l+=i.getConstant(wa)+" "+i.getConstant(va)+" ",l+=Ir(o,a,i);break;case"YEARLY":l+=i.getConstant(Da)+" "+i.getConstant(va)+" ",l+=je((0,e.getValue)(o.month[0].toString(),s),"single")+" ",l+=Ir(o,a,i)}if(o.count)l+=", "+o.count+" "+i.getConstant(ga);else if(o.until){var d=o.until;l+=", "+i.getConstant(fa)+" "+d.getDate()+" "+je((0,e.getValue)((d.getMonth()+1).toString(),s),"single")+" "+d.getFullYear()}return l}function Ir(t,i,n){var r="";if(t.monthDay.length)r+=t.monthDay[0];else if(t.day){var a=t.setPosition-1;r+=n.getConstant(ua[a>-1?a:ua.length-1])+" "+je((0,e.getValue)(ba[t.day[0]],i),"single")}return r}function Mr(t,i,n,r,a,s,o,l){void 0===a&&(a=da),void 0===s&&(s=null),void 0===o&&(o="Gregorian"),void 0===l&&(l=null);var p,c=Jr(i);la=ra(o);var h=[],d=new Date(t.getTime());aa=[];var u=(0,e.isNullOrUndefined)(n)?[]:n.split(","),g=new xr;if(u.forEach((function(e){var t=kr(e);l&&(t=g.add(new Date(t.getTime()),l)),aa.push(new Date(t.getTime()).setHours(0,0,0,0))})),c.recExceptionCount=(0,e.isNullOrUndefined)(c.count)?0:aa.length,oa=s&&s>t&&!c.count?new Date(new Date(s.getTime()).setHours(0,0,0)):null,!c.until&&oa&&((p=new Date(oa.getTime())).setDate(oa.getDate()+a*c.interval),c.until=p),c.until&&t>c.until)return h;if(sa=a,r=r||0,function(e){for(;ca[0]!==e;)ia(ca)}(ha[parseInt(r.toString(),10)]),c.until){var v=ve(c.until);c.until=new Date(v.getFullYear(),v.getMonth(),v.getDate(),23,59,59)}switch(c.freq){case"DAILY":!function(e,t,i,n){var r=new Date(e.getTime()),a=n.interval,s=Hr(e,n),o=n.day;for(;Qr(r,t)&&!(na(r,n)&&(o.indexOf(ha[r.getDay()])>-1||0===o.length)&&(Rr(i,r.getTime()),s&&i.length+n.recExceptionCount>=s));)r.setDate(r.getDate()+a),r.getHours()!==e.getHours()&&r.setHours(e.getHours())}(d,c.until,h,c);break;case"WEEKLY":!function(t,i,n,r,a){var s=new Date(t.getTime());r.day.length||r.day.push(ha[t.getDay()]);var o,l=r.interval,p=r.day,c=Hr(t,r),h=!0,d=[];if(p.length>1)for(((0,e.isNullOrUndefined)(r.wkst)||""===r.wkst)&&(r.wkst=ca[0]),o=ha.indexOf(r.wkst);Qr(s,i);){var u=ha.indexOf(ha[s.getDay()])-o,g=ye(s,-(u=-1===u?6:u)),v=ye(g,6),m=new Date(s.getTime());for(v=ve(v),m=ve(m);v>=m&&(p.indexOf(ha[s.getDay()])>-1&&d.push([s.getTime()]),!(c&&n.length+r.recExceptionCount>=c));)s.setDate(s.getDate()+1),s.getHours()!==t.getHours()&&s.setHours(t.getHours()),m=ve(m=new Date(s.getTime()));if(s.setDate(s.getDate()-1),c&&n.length+r.recExceptionCount>=c)break;s.setDate(s.getDate()+1+7*(l-1)),Ur(d,h,t,i,n,r),d=[]}else{for(s=Zr(t,r.day),l>1&&ca.indexOf(r.day[0])<t.getDay()-a&&s.setDate(s.getDate()+7*(l-1));Qr(s,i)&&((h=na(s,r))&&p.indexOf(ha[s.getDay()])>-1&&Rr(n,s.getTime()),!(c&&n.length+r.recExceptionCount>=c));)s.setDate(s.getDate()+7*l);Ur(d,h,t,i,n,r),d=[]}}(d,c.until,h,c,r);break;case"MONTHLY":Pr(d,c.until,h,c);break;case"YEARLY":!function(t,i,n,r){switch(function(e){if(e.yearDay.length)return"YEARDAY";if(e.weekNo.length)return"WEEKNO";return"MONTH"}(r)){case"MONTH":Pr(t,i,n,r);break;case"WEEKNO":!function(t,i,n,r){var a,s,o,l,p,c,h=la.getYearLastDate(t,0),d=Hr(t,r),u=r.weekNo,g=[],v=r.day;for(;Qr(h,i);){o=6-ca.indexOf(ha[h.getDay()])+1;for(var m=0;m<u.length;m++)for(p=1===(l=(l=u[parseInt(m.toString(),10)])>0?l:53+l+1)?o:o+7*(l-1),c=1===l?o-7:o+7*(l-2);c<p;)a=new Date(h.getTime()+ie*c),(0===v.length||v.indexOf(ha[a.getDay()])>-1)&&((0,e.isNullOrUndefined)(r.setPosition)?Yr(s,t,i,n,r,a.getTime()):g.push([a.getTime()])),c++;if((0,e.isNullOrUndefined)(r.setPosition)||Xr(g,s,t,i,n,r),d&&n.length+r.recExceptionCount>=d)return;h=la.getYearLastDate(a,r.interval),g=[]}}(t,i,n,r);break;case"YEARDAY":!function(t,i,n,r){var a,s,o,l=la.getYearLastDate(t,0),p=Hr(t,r),c=[],h=r.day;for(;Qr(l,i);){for(var d=0;d<r.yearDay.length;d++)o=r.yearDay[parseInt(d.toString(),10)],a=new Date(l.getTime()),o!==la.getLeapYearDaysCount()&&o!==-la.getLeapYearDaysCount()||la.isLeapYear(la.getFullYear(a),1)?(a.setDate(a.getDate()+(o<0?la.getYearDaysCount(a,1)+1+o:o)),(0===h.length||h.indexOf(ha[a.getDay()])>-1)&&(null==r.setPosition?Yr(s,t,i,n,r,a.getTime()):c.push([a.getTime()]))):a.setDate(a.getDate()+1);if((0,e.isNullOrUndefined)(r.setPosition)||Xr(c,s,t,i,n,r),p&&n.length+r.recExceptionCount>=p)return;l=la.getYearLastDate(a,r.interval),c=[]}}(t,i,n,r)}}(d,c.until,h,c)}return h}function kr(e){return new Date(e.substr(0,4)+"-"+e.substr(4,2)+"-"+e.substr(6,5)+":"+e.substr(11,2)+":"+e.substr(13))}function Rr(e,t){var i=new Date(t).setHours(0,0,0,0);-1===aa.indexOf(i)&&(!oa||i>=oa.getTime())&&e.push(t)}function Hr(e,t){var i=sa;return t.count?i=t.count:t.until&&("DAILY"===t.freq||"WEEKLY"===t.freq?i=Math.floor((t.until.getTime()-e.getTime())/ie)+1:"MONTHLY"!==t.freq&&"YEARLY"!==t.freq||(i=Math.floor((t.until.getMonth()+12*t.until.getFullYear()-(e.getMonth()+12*e.getFullYear()))/t.interval)+(t.day.length>1?Math.floor((t.until.getTime()-e.getTime())/ie)+1:1),"YEARLY"===t.freq&&(i=t.month.length>1?i*t.month.length:i))),i}function Pr(t,i,n,r){r.month.length||r.day.length||r.monthDay.length?r.month.length>0&&!r.day.length&&!r.monthDay.length&&r.monthDay.push(t.getDate()):(r.monthDay.push(t.getDate()),"YEARLY"===r.freq&&r.month.push(t.getMonth()+1));var a=function(e){if(e.monthDay.length&&!e.day.length)return"date";if(!e.monthDay.length&&e.day.length)return"day";return"both"}(r);switch(a){case"day":switch(r.freq){case"MONTHLY":Fr(t,i,n,r);break;case"YEARLY":!function(t,i,n,r){var a=r.day,s=a.map((function(e){return Sa.test(e)}));if(a.length>1&&s.indexOf(!0)>-1)return void function(t,i,n,r){var a,s,o,l,p,c=r.day,h=Hr(t,r),d=new Date(t.getTime()),u=r.interval,g=[],v=[],m=0;d=la.getMonthStartDate(d);var f=[];r.month.length&&la.setMonth(d,r.month[0],1);d=Zr(d,r.day);for(;Qr(d,i);){o=new Date(d.getTime());for(var y=0;y<=r.month.length;y++)for(var T=0;T<=c.length-1;T++){for(d=Zr(d=la.getMonthStartDate(d),r.day),g=[];la.isSameYear(o,d)&&h&&n.length+r.recExceptionCount<=h;)for(;la.isSameYear(o,d);){if(o=new Date(d.getTime()),0===r.month.length||r.month.length>0&&r.month[parseInt(y.toString(),10)]===la.getMonth(o)){var w=c[parseInt(T.toString(),10)].match(Oa),D=parseInt(w[0],10);for(l=new Date(d.getTime());la.isSameYear(l,d)&&la.isSameMonth(l,d);)w[w.length-1]===ha[l.getDay()]&&g.push([l.getTime()]),l.setDate(l.getDate()+1);l.setDate(l.getDate()-1),a=w[0].indexOf("-")>-1?g.length- -1*D:D-1,a=isNaN(a)?0:a}m=qr(d,r,m,p,1),d=Zr(d,r.day)}if(d=0===T&&l?new Date(l.getTime()):new Date(o.getTime()),g.length>0&&((0,e.isNullOrUndefined)(r.setPosition)?Xr(g,s,t,i,n,r,a):v=[zr(g,a,f)]),h&&n.length+r.recExceptionCount>=h)return}(0,e.isNullOrUndefined)(r.setPosition)||(Gr(v,s,t,i,n,r),f=[]),la.isLastMonth(d)?(la.setValidDate(d,1,1),d.setFullYear(d.getFullYear()+u-1)):d.setFullYear(d.getFullYear()+u),d=Zr(d,r.day),r.month.length&&la.setMonth(d,r.month[0],d.getDate())}}(t,i,n,r);if(r.month.length&&1===a.length&&s.indexOf(!0)>-1)return void Fr(t,i,n,r);var o,l=new Date(t.getTime()),p=Hr(t,r),c=r.interval,h=[];r.month.length&&la.setMonth(l,r.month[0],l.getDate());(0,e.isNullOrUndefined)(r.setPosition)&&0===r.month.length&&0===r.weekNo.length&&l.setFullYear(t.getFullYear(),0,1);l=Zr(l=la.getMonthStartDate(l),r.day);for(;Qr(l,i);){for(o=new Date(l.getTime());la.isSameYear(o,l)&&p&&n.length+r.recExceptionCount<=p;)for(o=new Date(l.getTime());la.isSameYear(o,l);){if(!(0===r.month.length||r.month.length>0&&!la.checkMonth(l,r.month))){la.setValidDate(l,1,1),l=Zr(l,r.day);break}if(a.length>1){if(la.compareMonth(o,l)){la.setValidDate(l,1,1),l=Zr(l,r.day);break}a.indexOf(ha[o.getDay()])>-1&&h.push([o.getTime()]),o.setDate(o.getDate()+1)}else{if(o.getFullYear()>l.getFullYear()){la.setValidDate(l,1,1),l=Zr(l,r.day);break}var d=Kr(a[0]);ha[o.getDay()]===d&&new Date(o.getFullYear(),o.getMonth(),0)>new Date(t.getFullYear())&&h.push([o.getTime()]),o.setDate(o.getDate()+7)}}if(l.setFullYear(o.getFullYear(),o.getMonth(),o.getDate()),Wr(h,t,i,n,r),la.isLastMonth(l)&&(la.setValidDate(l,1,1),l=Zr(l,r.day)),l.setFullYear(l.getFullYear()+c-1),p&&n.length+r.recExceptionCount>=p)return;l=Zr(l,r.day),h=[]}}(t,i,n,r)}break;case"both":case"date":switch(r.freq){case"MONTHLY":Nr(t,i,n,r);break;case"YEARLY":!function(e,t,i,n){if(n.month.length)return void Nr(e,t,i,n);var r,a=jr(e,n);a.tempDate=a.mainDate=la.getMonthStartDate(a.tempDate);for(;Qr(a.tempDate,t);){for(r=new Date(a.tempDate.getTime());la.isSameYear(r,a.tempDate)&&a.expectedCount&&i.length+n.recExceptionCount<=a.expectedCount;){if(!(0===n.month.length||n.month.length>0&&!la.checkMonth(a.tempDate,n.month))){la.setValidDate(a.tempDate,1,1),a.tempDate=Zr(a.tempDate,n.day);break}Lr(n,a,t,!1),a.beginDate=new Date(a.tempDate.getTime()),a.monthInit=qr(a.tempDate,n,a.monthInit,a.beginDate)}if(a.tempDate.setFullYear(r.getFullYear(),r.getMonth(),r.getDate()),Ur(a.dateCollection,a.state,e,t,i,n),la.isLastMonth(a.tempDate)&&(la.setValidDate(a.tempDate,1,1),a.tempDate=Zr(a.tempDate,n.day)),a.expectedCount&&i.length+n.recExceptionCount>=a.expectedCount)return;a.tempDate.setFullYear(a.tempDate.getFullYear()+n.interval-1),a.tempDate=Zr(a.tempDate,n.day),a.monthInit=qr(a.tempDate,n,a.monthInit,a.beginDate),a.dateCollection=[]}}(t,i,n,r)}}}function jr(e,t){var i={monthCollection:[],index:0,tempDate:new Date(e.getTime()),mainDate:new Date(e.getTime()),expectedCount:Hr(e,t),monthInit:0,dateCollection:[]};return t.month.length&&la.setMonth(i.tempDate,t.month[0],i.tempDate.getDate()),i}function Nr(t,i,n,r){var a=jr(t,r);if(a.tempDate=a.mainDate=la.getMonthStartDate(a.tempDate),!(("MONTHLY"===r.freq&&12===r.interval||"YEARLY"===r.freq)&&la.getMonthDaysCount(t)<r.monthDay[0]))for(;Qr(a.tempDate,i);){if(a.beginDate=new Date(a.tempDate.getTime()),Lr(r,a,i,!0,t,n),(0,e.isNullOrUndefined)(r.setPosition)||Xr(a.dateCollection,a.state,t,i,n,r),a.expectedCount&&n.length+r.recExceptionCount>=a.expectedCount)return;a.monthInit=qr(a.tempDate,r,a.monthInit,a.beginDate),a.dateCollection=[]}}function Lr(t,i,n,r,a,s){for(var o=0;o<t.monthDay.length;o++){i.date=t.monthDay[parseInt(o.toString(),10)],i.tempDate=la.getMonthStartDate(i.tempDate);var l=la.getMonthDaysCount(i.tempDate);if(i.date=i.date>0?i.date:l+i.date+1,$r(i.tempDate,i.date,i.mainDate)&&i.date>0){if(la.setDate(i.tempDate,i.date),n&&i.tempDate>n)return;(0===t.day.length||t.day.indexOf(ha[i.tempDate.getDay()])>-1)&&(r&&(0,e.isNullOrUndefined)(t.setPosition)&&i.expectedCount&&s.length+t.recExceptionCount<i.expectedCount?Yr(i.state,a,n,s,t,i.tempDate.getTime()):i.dateCollection.push([i.tempDate.getTime()]))}}}function qr(t,i,n,r,a){void 0===r&&(r=null);var s=r?r.getMonth():0,o=la.getMonthStartDate(t);return a=(0,e.isNullOrUndefined)(a)?i.interval:a,t.setFullYear(o.getFullYear()),t.setMonth(o.getMonth()),t.setDate(o.getDate()),i.month.length?(n++,n%=i.month.length,la.setMonth(t,i.month[parseInt(n.toString(),10)],1),0===n&&la.addYears(t,a,i.month[0])):(r&&r.getFullYear()<t.getFullYear()&&(s=t.getMonth()-1),la.setValidDate(t,a,1,s,r)),n}function Fr(t,i,n,r){if(r.day.length>1)!function(t,i,n,r){var a=r.day,s=new Date(t.getTime());s=la.getMonthStartDate(s);var o,l,p,c=[],h=[],d=[],u=Hr(t,r),g=0;for(r.month.length&&la.setMonth(s,r.month[0],1),s=Zr(s,r.day);Qr(s,i)&&u&&n.length+r.recExceptionCount<u;){var v=new Date(s.getTime());if(a.map((function(e){return Sa.test(e)})).indexOf(!0)>-1){for(var m=0;m<=a.length-1;m++){var f=a[parseInt(m.toString(),10)].match(Oa),y=parseInt(f[0],10);for(s=new Date(s.getTime()),s=Zr(s=la.getMonthStartDate(s),a),v.setFullYear(s.getFullYear(),s.getMonth(),s.getDate());la.isSameYear(v,s)&&la.isSameMonth(v,s);)f[f.length-1]===ha[v.getDay()]&&c.push([v.getTime()]),v.setDate(v.getDate()+1);if(v.setDate(v.getDate()-1),o=f[0].indexOf("-")>-1?c.length- -1*y:y-1,o=isNaN(o)?0:o,c.length>0&&((0,e.isNullOrUndefined)(r.setPosition)?Xr(c,l,t,i,n,r,o):h=[zr(c,o,d)]),u&&n.length+r.recExceptionCount>=u)return;c=[]}(0,e.isNullOrUndefined)(r.setPosition)||(Gr(h,l,t,i,n,r),d=[]),g=qr(s,r,g,p),s=Zr(s,r.day),c=[]}else{var T=[],w=ea(a);v.setFullYear(s.getFullYear(),s.getMonth(),s.getDate());var D=new Date(s.getTime());for(p=new Date(s.getTime());la.isSameMonth(D,s);)T.push(s.getTime()),a.indexOf(ha[s.getDay()])>-1&&(c.push(T),T=[]),s.setDate(s.getDate()+w[ha[s.getDay()]]);if(o=r.setPosition<1?c.length+r.setPosition:r.setPosition-1,(0,e.isNullOrUndefined)(r.setPosition)){o=0;for(var b=[],S=0;S<c.length;S++)for(var C=0;C<c[parseInt(S.toString(),10)].length;C++)b.push(c[parseInt(S.toString(),10)][parseInt(C.toString(),10)]);c=[b]}if(c.length>0&&Xr(c,l,t,i,n,r,o),u&&n.length+r.recExceptionCount>=u)return;g=qr(s,r,g,p),s=Zr(s,r.day),c=[]}}}(t,i,n,r);else{var a,s=new Date(t.getTime()),o=Hr(t,r),l=[],p=0;for(s=la.getMonthStartDate(s),r.month.length&&la.setMonth(s,r.month[0],1),s=Zr(s,r.day);Qr(s,i)&&o&&n.length+r.recExceptionCount<o;){a=new Date(s.getTime());for(var c=new Date(s.getTime());la.isSameMonth(s,c);)l.push([c.getTime()]),c.setDate(c.getDate()+7);Wr(l,t,i,n,r),p=qr(s,r,p,a),s=Zr(s,r.day),l=[]}}}function Ur(t,i,n,r,a,s){var o=s.setPosition<1?t.length+s.setPosition:s.setPosition-1;(0,e.isNullOrUndefined)(s.setPosition)&&(o=0,t=Br(t)),t.length>0&&Xr(t,i,n,r,a,s,o)}function Br(e){for(var t=[],i=0;i<e.length;i++)for(var n=0;n<e[parseInt(i.toString(),10)].length;n++)t.push(new Date(e[parseInt(i.toString(),10)][parseInt(n.toString(),10)]).getTime());return e=t.length>0?[t]:[]}function Wr(e,t,i,n,r){var a,s=[],o=function(e,t){var i,n={monthCollection:[],index:0};if(1===t.length){var r=t[0].match(Oa),a=void 0;r.length>1?i=(a=parseInt(r[0],10))<1?e.length+a:a-1:(i=0,e=Br(e))}else i=0,e=Br(e);return n.monthCollection=e,n.index=i,n}(e,r.day);e=o.monthCollection;var l=o.index;null!=r.setPosition?Gr([zr(e,l,s)],a,t,i,n,r):e.length>0&&Xr(e,a,t,i,n,r,l),s=[]}function zr(e,t,i){for(var n=0;n<e[parseInt(t.toString(),10)].length;n++)i.push(e[parseInt(t.toString(),10)][parseInt(n.toString(),10)]);return i}function Yr(e,t,i,n,r,a){var s=Hr(t,r),o=new Date(a);e=na(o,r),o>=t&&Qr(o,i)&&e&&s&&n.length+r.recExceptionCount<s&&Rr(n,a)}function _r(e,t,i,n,r){var a=t||0,s=new Date(e,r.month[0]-1,1),o=new Date(e,r.month[0],0).getDate(),l=(s.getDay()-a+7)%7+o,p=Math.ceil(l/7)-1,c=i[parseInt(n.toString(),10)][parseInt(p.toString(),10)];return na(new Date(c),r)?p:p-1}function Gr(e,t,i,n,r,a){if(e.length>0)for(var s=0;s<e.length;s++){e[parseInt(s.toString(),10)].sort();var o=a.day.map((function(e){return Sa.test(e)})),l="YEARLY"===a.freq&&a.validRules.indexOf("BYMONTH")>-1&&!(o.indexOf(!0)>-1)?_r(new Date(e[0][0]).getFullYear(),0,e,s,a):e[parseInt(s.toString(),10)].length+a.setPosition,p=a.setPosition<1?l:a.setPosition-1;Yr(t,i,n,r,a,e[parseInt(s.toString(),10)][parseInt(p.toString(),10)])}}function Xr(t,i,n,r,a,s,o){if(t.length>0){o=(0,e.isNullOrUndefined)(o)?s.setPosition<1?t.length+s.setPosition:s.setPosition-1:o,t[parseInt(o.toString(),10)].sort();for(var l=0;l<t[parseInt(o.toString(),10)].length;l++){Yr(i,n,r,a,s,t[parseInt(o.toString(),10)][parseInt(l.toString(),10)])}}}function Qr(e,t){return!t||e<=t}function Kr(e){return e.replace(Ca,"")}function Zr(e,t){var i,n=new Date(e.getTime());if(t.length>0){for(var r=[],a=0;a<=t.length-1;a++)i=Kr(t[parseInt(a.toString(),10)]),r.push(i);if(-1===r.indexOf(ha[n.getDay()]))do{n.setDate(n.getDate()+1)}while(-1===r.indexOf(ha[n.getDay()]))}return n}function Jr(e){var t,i={freq:null,interval:1,count:null,until:null,day:[],wkst:null,month:[],weekNo:[],monthDay:[],yearDay:[],setPosition:null,validRules:[]},n=e.split(";"),r=[];if(n.forEach((function(e){switch((r=e.split("="))[0]){case"UNTIL":t=r[1],i.until=kr(t);break;case"BYDAY":i.day=r[1].split(","),i.validRules.push(r[0]);break;case"BYMONTHDAY":i.monthDay=r[1].split(",").map(Number),i.validRules.push(r[0]);break;case"BYMONTH":i.month=r[1].split(",").map(Number),i.validRules.push(r[0]);break;case"BYYEARDAY":i.yearDay=r[1].split(",").map(Number),i.validRules.push(r[0]);break;case"BYWEEKNO":i.weekNo=r[1].split(",").map(Number),i.validRules.push(r[0]);break;case"INTERVAL":i.interval=parseInt(r[1],10);break;case"COUNT":i.count=parseInt(r[1],10);break;case"BYSETPOS":i.setPosition=parseInt(r[1],10)>4?-1:parseInt(r[1],10);break;case"FREQ":i.freq=r[1];break;case"WKST":i.wkst=r[1]}})),"MONTHLY"===i.freq&&0===i.monthDay.length){var a=i.validRules.indexOf("BYDAY");i.validRules.splice(a,1)}return i}function $r(e,t,i){return t<=la.getMonthDaysCount(e)&&e>=i}function ea(e){var t={};return e.forEach((function(i,n){if(n===e.length-1){for(var r=ca.indexOf(i),a=r;a%7!==ca.indexOf(e[0]);)a++;t[""+i]=a-r}else t[""+i]=ca.indexOf(e[n+1])-ca.indexOf(i)})),t}function ta(e,t){var i,n=t.slice(0),r=function(e){pa[la.getFullYear(e)]||(pa[la.getFullYear(e)]=la.getYearLastDate(e,0));var t=pa[la.getFullYear(e)],i=e.getTime()-t.getTime();return Math.ceil(i/ie)}(e);for(i=n.shift();i;){if(i<0&&(i=i+la.getYearDaysCount(e,0)+1),i===r)return!1;i=n.shift()}return!0}function ia(e){var t=e.shift();e.push(t)}function na(e,t){var i=!0,n=t.day,r=t.month,a=la.getExpectedDays(e,t.monthDay),s=t.yearDay;return t.validRules.forEach((function(t){switch(t){case"BYDAY":(function(e,t){var i=[];return t.forEach((function(e){var t=e.match(Oa);2===t.length?i.push(t[1]):i.push(t[0])})),-1===i.indexOf(ha[parseInt(e.toString(),10)])})(e.getDay(),n)&&(i=!1);break;case"BYMONTH":la.checkMonth(e,r)&&(i=!1);break;case"BYMONTHDAY":(function(e,t){var i,n=t.slice(0),r=la.getMonthDaysCount(e);for(i=n.shift();i;){if(i<0&&(i=i+r+1),i===e.getDate())return!1;i=n.shift()}return!0})(e,a)&&(i=!1);break;case"BYYEARDAY":ta(e,s)&&(i=!1)}})),i}function ra(e){return"Islamic"===e?new Er:new Or}var aa,sa,oa,la,pa={},ca=["SU","MO","TU","WE","TH","FR","SA"],ha=["SU","MO","TU","WE","TH","FR","SA"],da=43,ua=["first","second","third","fourth","last"],ga="summaryTimes",va="summaryOn",ma="every",fa="summaryUntil",ya="summaryDay",Ta="summaryWeek",wa="summaryMonth",Da="summaryYear",ba={SU:"sun",MO:"mon",TU:"tue",WE:"wed",TH:"thu",FR:"fri",SA:"sat"},Sa=/\d/,Ca=/[^A-Z]+/,Oa=/[a-z]+|[^a-z]+/gi;function Ea(e){return[e.getUTCFullYear(),xa(e.getUTCMonth()+1),xa(e.getUTCDate()),"T",xa(e.getUTCHours()),xa(e.getUTCMinutes()),xa(e.getUTCSeconds()),"Z"].join("")}function xa(e){return("0"+e).slice(-2)}var Va,Aa=function(){function t(e){this.slots=[],this.processedData=[],this.isDoubleTapped=!1,this.parent=e}return t.prototype.processData=function(t,i,n){var r=this,a=this.parent.activeView.startDate(),s=this.parent.activeView.endDate(),o=this.parent.eventFields,l=[],p=1,c=!1,h=this.parent.resourceBase?this.parent.resourceBase.resourceCollection:[];t.length>0&&(0,e.isNullOrUndefined)(t[0][o.id])&&(c=!0);for(var d=function(t){c&&(t[o.id]=p++),t=u.updateEventDateTime(t),i?u.processTimezoneChange(t,n):u.parent.isPrinting||u.parent.uiStateValues.isPreventTimezone||(t=u.processTimezone(t));for(var a=0;a<h.length;a++)null!==t[h[parseInt(a.toString(),10)].field]&&0!==t[h[parseInt(a.toString(),10)].field]||(t[h[parseInt(a.toString(),10)].field]=void 0);if((0,e.isNullOrUndefined)(t[o.recurrenceRule])||""!==t[o.recurrenceRule]||(t[o.recurrenceRule]=null),(0,e.isNullOrUndefined)(t[o.recurrenceRule])||!(0,e.isNullOrUndefined)(t[o.recurrenceID])||u.parent.crudModule&&u.parent.crudModule.crudObj.isCrudAction)if(u.parent.crudModule&&u.parent.crudModule.crudObj.isCrudAction)if(!(0,e.isNullOrUndefined)(t[o.recurrenceRule])&&(0,e.isNullOrUndefined)(t[o.recurrenceID]))for(var s=function(e){var t=u.parent.eventsProcessed.filter((function(t){return t[o.startTime].getTime()-e[o.startTime].getTime()==0&&t[o.id]===e[o.id]}));e.Guid=t.length>0?t[0].Guid:u.generateGuid(),l.push(e)},d=0,g=u.generateOccurrence(t,null,!0);d<g.length;d++){s(g[d])}else{var v=u.parent.eventsProcessed.filter((function(e){return e[r.parent.eventFields.id]===t[r.parent.eventFields.id]}));t.Guid=v.length>0?v[0].Guid:u.generateGuid(),l.push(t)}else t.Guid=u.generateGuid(),l.push(t);else l=l.concat(u.generateOccurrence(t,null,!0))},u=this,g=0,v=t;g<v.length;g++){d(v[g])}this.parent.eventsProcessed=[];var m=l.filter((function(e){return!e[r.parent.eventFields.isBlock]}));if(this.parent.eventsProcessed=this.filterEvents(a,s,m),!this.parent.activeViewOptions.allowOverlap&&this.parent.eventsProcessed.length>0){this.processedData=this.parent.eventsProcessed;for(var f=[],y=this.parent.eventFields,T=0,w=this.parent.eventsProcessed;T<w.length;T++){var D=w[T],b=this.findOverlappingData(D,f);if(b){if(!this.parent.eventSettings.sortComparer){if(new Date(D[y.endTime]).getTime()-new Date(D[y.startTime]).getTime()>new Date(b[y.endTime]).getTime()-new Date(b[y.startTime]).getTime()&&D[y.startTime]===b[y.startTime]||!0===D[y.isAllDay]){var S=f.indexOf(b);-1!==S&&f.splice(S,1),f.push(D)}}}else f.push(D)}this.parent.eventsProcessed=f}for(var C=l.filter((function(e){return e[r.parent.eventFields.isBlock]})),O=0,E=C;O<E.length;O++){var x=E[O];if(x[o.isAllDay])ve(new Date(x[o.startTime].getTime()))<ve(new Date(x[o.endTime].getTime()))||(x[o.startTime]=ve(x[o.startTime]),x[o.endTime]=ye(ve(x[o.endTime]),1))}return this.parent.blockProcessed=C,m},t.prototype.findOverlappingData=function(t,i){for(var n=this.parent.activeViewOptions.group.resources.length>0,r=n?this.parent.resourceBase.resourceCollection:[],a=n?r[r.length-1].field:null,s=this.parent.eventFields,o=new Date(t[s.startTime]),l=new Date(t[s.endTime]),p=0,c=i;p<c.length;p++){var h=c[p];if(o<h[s.endTime]&&l>h[s.startTime]&&h[s.id]!==t[s.id]&&(!n||(0,e.isNullOrUndefined)(a)||this.compareResourceValues(h[""+a],t[""+a])))return h}},t.prototype.isOverlapRange=function(t,i){var n=this;void 0===i&&(i=null);for(var r=this.parent.activeViewOptions.group.resources.length>0,a=r?this.parent.resourceBase.resourceCollection:[],s=r?a[a.length-1].field:null,o=Array.isArray(t)?t:[t],l=this.parent.eventFields,p=function(t){return n.processedData.filter((function(i){return t[l.startTime]<i[l.endTime]&&t[l.endTime]>i[l.startTime]&&i[l.id]!==t[l.id]&&(!r||(0,e.isNullOrUndefined)(s)||n.compareResourceValues(i[""+s],t[""+s]))}))},c=[],h=!1,d=0,u=o;d<u.length;d++)for(var g=u[d],v=0,m=(0,e.isNullOrUndefined)(g[l.recurrenceRule])||!(0,e.isNullOrUndefined)(g[l.recurrenceID])&&g[l.recurrenceID]!==g[l.id]||!(0,e.isNullOrUndefined)(g[l.recurrenceID])&&"EditSeries"!==i?[g]:this.generateOccurrence(g);v<m.length;v++){var f=m[v],y=p(f);y.length>0&&c.push.apply(c,y),this.findOverlappingData(f,this.parent.eventsProcessed)&&(h=!0)}return this.parent.overlapAppointments=c,h},t.prototype.compareResourceValues=function(e,t){var i=function(e){return Array.isArray(e)?e[0]:e};return i(e)===i(t)},t.prototype.checkOverlap=function(e){return!(this.parent.activeViewOptions.allowOverlap||!this.isOverlapRange(e))&&(this.parent.quickPopup.openValidationError("overlapAlert",e),!0)},t.prototype.updateEventDateTime=function(e){return"string"==typeof e[this.parent.eventFields.startTime]&&(e[this.parent.eventFields.startTime]=Ce(e[this.parent.eventFields.startTime])),"string"==typeof e[this.parent.eventFields.endTime]&&(e[this.parent.eventFields.endTime]=Ce(e[this.parent.eventFields.endTime])),e},t.prototype.getProcessedEvents=function(t){void 0===t&&(t=this.parent.eventsData);for(var i=[],n=0,r=t;n<r.length;n++){var a=r[n];!(0,e.isNullOrUndefined)(a[this.parent.eventFields.recurrenceRule])&&(0,e.isNullOrUndefined)(a[this.parent.eventFields.recurrenceID])?i=i.concat(this.generateOccurrence(a)):i.push(a)}return i},t.prototype.timezonePropertyChange=function(e){var t=this.parent.eventsData.concat(this.parent.blockData),i=this.processData(t,!0,e);this.parent.notify(z,{processedData:i})},t.prototype.timezoneConvert=function(e){var t=this.parent.eventFields;if(e[t.startTimezone]=e[t.startTimezone]||e[t.endTimezone],e[t.endTimezone]=e[t.endTimezone]||e[t.startTimezone],this.parent.timezone){var i=e[t.startTimezone],n=e[t.endTimezone];e[t.startTime]=this.parent.tzModule.convert(e[t.startTime],this.parent.timezone,i),e[t.endTime]=this.parent.tzModule.convert(e[t.endTime],this.parent.timezone,n)}},t.prototype.processTimezoneChange=function(e,t){var i=this.parent.eventFields;e[i.isAllDay]||(t&&this.parent.timezone?(e[i.startTime]=this.parent.tzModule.convert(e[i.startTime],t,this.parent.timezone),e[i.endTime]=this.parent.tzModule.convert(e[i.endTime],t,this.parent.timezone)):!t&&this.parent.timezone?(e[i.startTime]=this.parent.tzModule.add(e[i.startTime],this.parent.timezone),e[i.endTime]=this.parent.tzModule.add(e[i.endTime],this.parent.timezone)):t&&!this.parent.timezone&&(e[i.startTime]=this.parent.tzModule.remove(e[i.startTime],t),e[i.endTime]=this.parent.tzModule.remove(e[i.endTime],t)))},t.prototype.processTimezone=function(e,t){void 0===t&&(t=!1);var i=this.parent.eventFields;if(e[i.isAllDay])return e;if(e[i.startTimezone]||e[i.endTimezone]){var n=e[i.startTimezone]||e[i.endTimezone],r=e[i.endTimezone]||e[i.startTimezone];t?this.parent.timezone?(e[i.startTime]=this.parent.tzModule.convert(e[i.startTime],n,this.parent.timezone),e[i.endTime]=this.parent.tzModule.convert(e[i.endTime],r,this.parent.timezone),e[i.startTime]=this.parent.tzModule.remove(e[i.startTime],this.parent.timezone),e[i.endTime]=this.parent.tzModule.remove(e[i.endTime],this.parent.timezone)):(e[i.startTime]=this.parent.tzModule.remove(e[i.startTime],n),e[i.endTime]=this.parent.tzModule.remove(e[i.endTime],r)):(e[i.startTime]=this.parent.tzModule.add(e[i.startTime],n),e[i.endTime]=this.parent.tzModule.add(e[i.endTime],r),this.parent.timezone&&(e[i.startTime]=this.parent.tzModule.convert(e[i.startTime],n,this.parent.timezone),e[i.endTime]=this.parent.tzModule.convert(e[i.endTime],r,this.parent.timezone)))}else this.parent.timezone&&(t?(e[i.startTime]=this.parent.tzModule.remove(e[i.startTime],this.parent.timezone),e[i.endTime]=this.parent.tzModule.remove(e[i.endTime],this.parent.timezone)):(e[i.startTime]=this.parent.tzModule.add(e[i.startTime],this.parent.timezone),e[i.endTime]=this.parent.tzModule.add(e[i.endTime],this.parent.timezone)));return e},t.prototype.filterBlockEvents=function(t){var i,n=this.parent.eventFields,r=t[n.startTime],a=t[n.endTime];if(this.parent.activeViewOptions.group.resources.length>0){var s=this.getGroupIndexFromEvent(t);i=this.parent.resourceBase.lastResourceLevel[parseInt(s.toString(),10)]}for(var o=(0,e.extend)([],this.parent.blockProcessed,null,!0),l=0,p=o;l<p.length;l++){var c=p[l];if(c[n.isAllDay])c[n.endTime].getTime()>ve(new Date(c[n.endTime].getTime())).getTime()&&(c[n.startTime]=ve(c[n.startTime]),c[n.endTime]=ye(ve(c[n.endTime]),1))}return this.filterEvents(r,a,o,i)},t.prototype.filterEvents=function(e,t,i,n){void 0===i&&(i=this.parent.eventsProcessed);var r=this.parent.dataModule.getStartEndQuery(e,t),a=new Sr.DataManager({json:i}).executeLocal((new Sr.Query).where(r));return n&&(a=this.filterEventsByResource(n,a)),this.sortByTime(a)},t.prototype.filterEventsByRange=function(e,t,i){var n=this,r=[];return r=t&&i?this.filterEvents(t,i,e):t&&!i?e.filter((function(e){return e[n.parent.eventFields.startTime]>=t})):!t&&i?e.filter((function(e){return e[n.parent.eventFields.endTime]<=i})):e,this.sortByTime(r)},t.prototype.filterEventsByResource=function(e,t){void 0===t&&(t=this.parent.eventsProcessed);for(var i={},n=this.parent.resourceBase.resourceCollection,r=0;r<n.length;r++)i[n[parseInt(r.toString(),10)].field]=e.groupOrder[parseInt(r.toString(),10)];var a=Object.keys(i);return t.filter((function(e){return a.every((function(t){return e[""+t]instanceof Array?e[""+t].indexOf(i[""+t])>-1:e[""+t]===i[""+t]}))}))},t.prototype.sortByTime=function(e){if(!this.parent.eventSettings.sortComparer||"function"!=typeof this.parent.eventSettings.sortComparer&&"string"!=typeof this.parent.eventSettings.sortComparer){var t=this.parent.eventFields;e.sort((function(e,i){var n=e[t.startTime],r=i[t.startTime];return n.getTime()-r.getTime()}))}else e=this.customSorting(e);return e},t.prototype.sortByDateTime=function(e){if(!this.parent.eventSettings.sortComparer||"function"!=typeof this.parent.eventSettings.sortComparer&&"string"!=typeof this.parent.eventSettings.sortComparer){var t=this.parent.eventFields;e.sort((function(e,i){var n=e[t.startTime],r=i[t.startTime],a=e[t.endTime],s=i[t.endTime],o=a.getTime()-n.getTime(),l=s.getTime()-r.getTime();return n.getTime()-r.getTime()||l-o}))}else e=this.customSorting(e);return e},t.prototype.customSorting=function(t){if("function"==typeof this.parent.eventSettings.sortComparer)return this.parent.eventSettings.sortComparer.call(this.parent,t);if("string"==typeof this.parent.eventSettings.sortComparer){var i=this.parent.eventSettings.sortComparer.split("."),n=void 0;if((0,e.isNullOrUndefined)(window)||(n=window[i[i.length-1]]),n)return n(t)}return t},t.prototype.getSmallestMissingNumber=function(e){for(var t=Math.max.apply(Math,e),i=0;i<t;i++)if(-1===e.indexOf(i))return i;return t+1},t.prototype.splitEventByDay=function(t){var i=this.parent.eventFields,n=[],r=t[i.startTime],a=t[i.endTime];if(ve(new Date(r.getTime()))<ve(new Date(a.getTime())))for(var s=new Date(r.getTime()),o=ye(ve(new Date(r.getTime())),1),l=0===a.getHours()&&0===a.getMinutes()?a:ye(a,1),p=1,c=Se(r.getTime(),l.getTime());o<=a&&s.getTime()!==o.getTime();){var h=(0,e.extend)({},t);h[i.startTime]=s,h[i.endTime]=o,h.data={index:p,count:c},h.Guid=this.generateGuid(),h.isSpanned=!0,n.push(h),s=o,ve(new Date(s.getTime())).getTime()===ve(new Date(a.getTime())).getTime()&&o.getTime()!==a.getTime()?(o=new Date(s.getTime()),o=new Date(o.setHours(a.getHours(),a.getMinutes(),a.getSeconds()))):o=ye(ve(new Date(s.getTime())),1),p++}else n.push(t);return n},t.prototype.splitEvent=function(t,i){var n=this.parent.eventFields,r=ve(t[n.startTime]).getTime(),a=ve(t[n.endTime]).getTime();me(t[n.endTime])<=0&&(a=r>(w=ye(ve(t[n.endTime]),-1).getTime())?r:w);var s=r,o=a,l=[];if(r!==a){r<i[0].getTime()&&(r=i[0].getTime()),a>i[i.length-1].getTime()&&(a=i[i.length-1].getTime());for(var p=r,c=0;c<this.slots.length;c++){var h=this.slots[parseInt(c.toString(),10)];if("WorkWeek"===this.parent.currentView||"TimelineWorkWeek"===this.parent.currentView||this.parent.activeViewOptions.group.byDate||this.parent.activeViewOptions.showWeekend){for(var d=[],u=0,g=h;u<g.length;u++){var v=g[u];d.push(new Date(v))}var m=this.getRenderedDates(d);if(!(0,e.isNullOrUndefined)(m)&&m.length>0){h=[];for(var f=0,y=m;f<y.length;f++){var T=y[f];h.push(T.getTime())}}}if("number"==typeof h){var w=h;(h=[]).push(w)}var D=h[0];if((p=p<=D&&a>=D?D:p)>a||D>a)break;if(!this.parent.activeViewOptions.group.byDate&&this.parent.activeViewOptions.showWeekend&&"WorkWeek"!==this.parent.currentView&&"TimelineWorkWeek"!==this.parent.currentView){var b=h.indexOf(p);if(-1!==b){var S=h.indexOf(a),C=-1!==S,O=(S=C?S:h.length-1)-b+1,E=h[parseInt(b.toString(),10)]!==s,x=h[parseInt(S.toString(),10)]!==o;if(l.push(this.cloneEventObject(t,h[parseInt(b.toString(),10)],h[parseInt(S.toString(),10)],O,E,x)),C)break}}else if(this.dateInRange(p,h[0],h[h.length-1])){for(var V=[],A=0;A<h.length;A++)this.dateInRange(h[parseInt(A.toString(),10)],s,o)&&V.push(h[parseInt(A.toString(),10)]);if(V.length>0)if(this.parent.activeViewOptions.group.byDate)for(var I=0,M=V;I<M.length;I++){var k=M[I];l.push(this.cloneEventObject(t,k,k,1,k!==s,k!==o))}else{E=V[0]!==s,x=V[V.length-1]!==o;l.push(this.cloneEventObject(t,V[0],V[V.length-1],V.length,E,x))}}}}else l.push(this.cloneEventObject(t,r,a,1,!1,!1));return l},t.prototype.cloneEventObject=function(t,i,n,r,a,s){var o=this.parent.eventFields,l=(0,e.extend)({},t,null,!0),p={count:r,isLeft:a,isRight:s};return p[o.startTime]=t[o.startTime],p[o.endTime]=t[o.endTime],l.data=p,l[o.startTime]=new Date(i),l[o.endTime]=new Date(n),l},t.prototype.dateInRange=function(e,t,i){return t<=e&&e<=i},t.prototype.getSelectedEventElements=function(e){if(this.removeSelectedAppointmentClass(),this.parent.selectedElements.length<=0)this.parent.selectedElements.push(e);else{var t=this.parent.selectedElements.filter((function(t){return t.getAttribute("data-guid")===e.getAttribute("data-guid")}));if(t.length<=0)for(var i='div[data-guid="'+e.getAttribute("data-guid")+'"]',n=0,r=[].slice.call(this.parent.element.querySelectorAll(i));n<r.length;n++){var a=r[n];this.parent.selectedElements.push(a)}else{var s=this.parent.selectedElements.filter((function(t){return t.getAttribute("data-guid")!==e.getAttribute("data-guid")}));this.parent.selectedElements=s}}return e&&this.parent.selectedElements.length>0&&this.addSelectedAppointments(this.parent.selectedElements,!1),this.parent.selectedElements},t.prototype.getSelectedEvents=function(){var e=this,t=[],i=[];return[].slice.call(this.parent.element.querySelectorAll("."+Zt)).filter((function(n){0===t.filter((function(e){return e.Guid===n.getAttribute("data-guid")})).length&&t.push(e.getEventByGuid(n.getAttribute("data-guid"))),i.push(n)})),{event:t.length>1?t:t[0],element:i.length>1?i:i[0]}},t.prototype.removeSelectedAppointmentClass=function(){var t=this.getSelectedAppointments();(0,e.removeClass)(t,Zt),"Agenda"!==this.parent.currentView&&"MonthAgenda"!==this.parent.currentView||(0,e.removeClass)(t,li)},t.prototype.addSelectedAppointments=function(t,i){"MonthAgenda"!==this.parent.currentView&&this.parent.removeSelectedClass(),(0,e.addClass)(t,Zt),t.length>0&&!i&&t[t.length-1].focus()},t.prototype.getSelectedAppointments=function(){return[].slice.call(this.parent.element.querySelectorAll("."+Zt+",."+Xt+":focus"))},t.prototype.focusElement=function(t){if(!this.parent.eventWindow.dialogObject||!this.parent.eventWindow.dialogObject.visible){var i=document.activeElement,n=this.parent.getSelectedCells();if(!(n.length>0&&(i&&(this.parent.element.contains(i)||-1!==n.indexOf(i))||t))){var r=this.getSelectedAppointments();return r.length>0?this.parent.activeEventData&&this.parent.activeEventData.element&&r.indexOf(this.parent.activeEventData.element)>-1?void this.parent.activeEventData.element.focus():void r[r.length-1].focus():void 0}if(this.parent.keyboardInteractionModule){var a=!(0,e.isNullOrUndefined)(this.parent.activeCellsData)&&this.parent.activeCellsData.element||n[n.length-1];this.parent.keyboardInteractionModule.selectCells(a instanceof Array,a)}}},t.prototype.selectWorkCellByTime=function(t){var i;if("Agenda"===this.parent.currentView||"MonthAgenda"===this.parent.currentView)return i;if(t.length>0){var n=t[t.length-1],r=n[this.parent.eventFields.startTime],a=void 0,s=this.isAllDayAppointment(n);a="Month"===this.parent.currentView||s||!this.parent.activeViewOptions.timeScale.enable?new Date(+r).setHours(0,0,0,0):this.findNearestSlot(r);var o=void 0;o=s&&-1!==["Day","Week","WorkWeek"].indexOf(this.parent.currentView)?this.parent.getAllDayRow():this.parent.getContentTable();var l='[data-date="'+new Date(a).getTime()+'"]';if(!(0,e.isNullOrUndefined)(this.parent.activeViewOptions.group.resources)&&this.parent.activeViewOptions.group.resources.length>0&&(l+='[data-group-index="'+this.getGroupIndexFromEvent(n)+'"]'),i=o.querySelector(l))return this.parent.activeCellsData=this.parent.getCellDetails(i),this.parent.keyboardInteractionModule&&this.parent.keyboardInteractionModule.selectCells(!1,i),i}return i},t.prototype.findNearestSlot=function(e){var t=this.parent.activeViewOptions.timeScale.interval*ne/this.parent.activeViewOptions.timeScale.slotCount,i=Math.round(ie/t),n=new Date(e);n.setHours(0,0,0,0);var r=Array.from({length:i},(function(e,i){return new Date(n.getTime()+i*t)})).reduce((function(t,i){var n=Math.abs(e.getTime()-i.getTime());return!t||n<Math.abs(e.getTime()-t.getTime())?i:t}),null);return 1e3*Math.trunc(r.getTime()/1e3)},t.prototype.getGroupIndexFromEvent=function(t){for(var i,n,r,a,s=this.parent.resourceBase.resourceCollection.length-1;s>=0;s--){var o=t[this.parent.resourceBase.resourceCollection[parseInt(s.toString(),10)].field];if(!(0,e.isNullOrUndefined)(o)){n=this.parent.resourceBase.resourceCollection[parseInt(s.toString(),10)],i=s,r=n.name,a=n.field;break}}(0,e.isNullOrUndefined)(r)&&(0,e.isNullOrUndefined)(i)&&(r=this.parent.resourceCollection.slice(-1)[0].name,i=this.parent.resourceCollection.length-1,a=this.parent.resourceCollection.slice(-1)[0].field,n=this.parent.resourceCollection.filter((function(e,t){return e.name===r?(i=t,e):null}))[0]);var l=t[""+a]instanceof Array?t[""+a][0]:t[""+a];if(i>0){var p=this.parent.resourceCollection[i-1].field;return this.parent.resourceBase.getIndexFromResourceId(l,r,n,t,p)}return this.parent.resourceBase.getIndexFromResourceId(l,r,n)},t.prototype.isAllDayAppointment=function(e){var t=this.parent.eventFields,i=e[t.isAllDay],n=(Re(e[t.endTime])-Re(e[t.startTime]))/ie>=1;return!!(i||"TimeSlot"!==this.parent.eventSettings.spannedEventPlacement&&n)},t.prototype.addEventListener=function(){this.parent.on(Z,this.appointmentBorderRemove,this)},t.prototype.removeEventListener=function(){this.parent.off(Z,this.appointmentBorderRemove)},t.prototype.appointmentBorderRemove=function(t){var i=t.event.target;if((0,e.closest)(i,"."+Xt))"MonthAgenda"!==this.parent.currentView&&this.parent.removeSelectedClass();else if(!(0,e.closest)(i,"."+tt)){if(this.parent.uiStateValues.isTapHold&&(0,e.closest)(i,"."+$e+",."+Ke))return;this.parent.uiStateValues.isTapHold=!1,this.removeSelectedAppointmentClass(),this.parent.selectedElements=[]}},t.prototype.wireAppointmentEvents=function(t,i,n){void 0===n&&(n=!1);var r=!(0,e.isNullOrUndefined)(i)&&i[this.parent.eventFields.isReadonly];e.EventHandler.add(t,"click",this.eventClick,this),this.parent.isAdaptive||this.parent.activeViewOptions.readonly||r||(e.EventHandler.add(t,"touchend",this.eventTouchClick,this),e.EventHandler.add(t,"dblclick",this.eventDoubleClick,this)),this.parent.activeViewOptions.readonly||r||n||(this.parent.resizeModule&&this.parent.resizeModule.wireResizeEvent(t),this.parent.dragAndDropModule&&this.parent.dragAndDropModule.wireDragEvent(t))},t.prototype.eventTouchClick=function(e){var t=this;this.parent.uiStateValues.isTouchScroll||this.parent.uiStateValues.isTapHold||this.parent.uiStateValues.action?this.parent.uiStateValues.isTouchScroll=this.parent.uiStateValues.isTapHold=!1:(setTimeout((function(){return t.isDoubleTapped=!1}),250),e.preventDefault(),this.isDoubleTapped?this.eventDoubleClick(e):this.isDoubleTapped||(this.isDoubleTapped=!0,this.eventClick(e)))},t.prototype.renderResizeHandler=function(t,i,n){if(this.parent.resizeModule&&this.parent.allowResizing&&!this.parent.activeViewOptions.readonly&&!n)for(var r=0,a=Object.keys(i);r<a.length;r++){var s=a[r],o=(0,e.createElement)("div",{className:Ei});switch(s){case"isLeft":i.isLeft||(o.appendChild((0,e.createElement)("div",{className:"e-left-right-resize"})),(0,e.addClass)([o],this.parent.enableRtl?Ai:Vi),(0,e.prepend)([o],t));break;case"isRight":i.isRight||(o.appendChild((0,e.createElement)("div",{className:"e-left-right-resize"})),(0,e.addClass)([o],this.parent.enableRtl?Vi:Ai),(0,e.append)([o],t));break;case"isTop":i.isTop||(o.appendChild((0,e.createElement)("div",{className:"e-top-bottom-resize"})),(0,e.addClass)([o],Ii),(0,e.prepend)([o],t));break;case"isBottom":i.isBottom||(o.appendChild((0,e.createElement)("div",{className:"e-top-bottom-resize"})),(0,e.addClass)([o],Mi),(0,e.append)([o],t))}}},t.prototype.eventClick=function(t){var i=this,n=t.target;if(!(n.classList.contains(Oi)||n.classList.contains(xi)||n.classList.contains(dr)))if((t.ctrlKey||t.metaKey)&&1===t.which&&this.parent.keyboardInteractionModule){this.parent.quickPopup.quickPopup.hide(),this.parent.selectedElements=[].slice.call(this.parent.element.querySelectorAll("."+Zt));var r=(0,e.closest)(t.target,"."+Xt);this.getSelectedEventElements(r),this.activeEventData(t,!1);var a={data:this.parent.activeEventData.event,element:this.parent.activeEventData.element,event:t,requestType:"eventSelect"};this.parent.trigger(o,a);var s=(0,e.extend)(this.parent.activeEventData,{cancel:!1,originalEvent:t});this.parent.trigger(m,s)}else{this.removeSelectedAppointmentClass(),this.activeEventData(t,!0);var l={data:this.parent.activeEventData.event,element:this.parent.activeEventData.element,event:t,requestType:"eventSelect"};this.parent.trigger(o,l);s=(0,e.extend)(this.parent.activeEventData,{cancel:!1,originalEvent:t});this.parent.trigger(m,s,(function(t){if(t.cancel)i.removeSelectedAppointmentClass(),i.parent.selectedElements=[],i.parent.quickPopup&&i.parent.quickPopup.quickPopupHide();else if("Agenda"!==i.parent.currentView&&"MonthAgenda"!==i.parent.currentView||(0,e.addClass)([i.parent.activeEventData.element],li),i.parent.allowInline){var n={data:t.event,element:t.element,type:"Event"};i.parent.notify(A,n)}else i.parent.notify(m,t)}))}},t.prototype.eventDoubleClick=function(t){var i=this;if(this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide(!0),"touchend"===t.type&&this.activeEventData(t,!0),this.removeSelectedAppointmentClass(),this.parent.selectedElements=[],!this.parent.activeEventData.element.classList.contains(ur)&&!this.parent.activeEventData.element.querySelector("."+dr)){var n=(0,e.extend)(this.parent.activeEventData,{cancel:!1,originalEvent:t});this.parent.trigger(f,n,(function(t){t.cancel||(!(0,e.isNullOrUndefined)(i.parent.activeEventData.event)&&(0,e.isNullOrUndefined)(i.parent.activeEventData.event[i.parent.eventFields.recurrenceID])?i.parent.eventWindow.openEditor(i.parent.activeEventData.event,"Save"):(i.parent.currentAction="EditOccurrence",i.parent.quickPopup.openRecurrenceAlert()))}))}},t.prototype.getEventByGuid=function(e){return this.parent.eventsProcessed.filter((function(t){return t.Guid===e}))[0]},t.prototype.getEventById=function(e){var t=this;return this.parent.eventsData.filter((function(i){return i[t.parent.eventFields.id]===e}))[0]},t.prototype.generateGuid=function(){return"xyxxxxyx-xxxy-yxxx-xyxx-xxyxxxxyyxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))},t.prototype.getEventIDType=function(){return 0!==this.parent.eventsData.length?typeof this.parent.eventsData[0][this.parent.eventFields.id]:0!==this.parent.blockData.length?typeof this.parent.blockData[0][this.parent.eventFields.id]:"string"},t.prototype.getEventMaxID=function(t){var i,n=this;if(this.parent.eventsData.length<1&&this.parent.blockData.length<1)return 1;var r=this.getEventIDType();if("string"===r&&(i=this.generateGuid()),"number"===r){var a=this.parent.eventsData.concat(this.parent.blockData).map((function(e){return e[n.parent.eventFields.id]})).reduce((function(e,t){return Math.max(e,t)}));i=(a=(0,e.isNullOrUndefined)(t)?a:a+t)+1}return i},t.prototype.activeEventData=function(t,i){var n=this,r=(0,e.closest)(t.target,"."+Xt),a=r.getAttribute("data-guid");i&&(this.addSelectedAppointments([].slice.call(this.parent.element.querySelectorAll('div[data-guid="'+a+'"]')),!0),r.focus());var s=this.getEventByGuid(a);s&&s.isSpanned&&(s=this.parent.eventsData.filter((function(e){return e[n.parent.eventFields.id]===s[n.parent.eventFields.id]}))[0]),this.parent.activeEventData={event:s,element:r}},t.prototype.generateOccurrence=function(t,i,n){var r=this,a=t[this.parent.eventFields.startTime],s=t[this.parent.eventFields.endTime],o=t[this.parent.eventFields.recurrenceRule],l=s.getTimezoneOffset()-a.getTimezoneOffset(),p=s.getTime()-a.getTime()-6e4*l;i=new Date((i||this.parent.activeView.startDate()).getTime()-p);var c,h=t[this.parent.eventFields.recurrenceException];"Agenda"!==this.parent.currentView&&n&&(c=fe(i,this.parent.activeView.endDate())+1);var d=this.parent.timezone||this.parent.tzModule.getLocalTimezoneName(),u=this.parent.activeViewOptions.firstDayOfWeek,g=this.parent.calendarMode;t[this.parent.eventFields.recurrenceRule]&&this.isDayBasedRecurrence(t)&&this.parent.timezone&&t[this.parent.eventFields.startTimezone]&&t[this.parent.eventFields.endTimezone]&&(a=this.parent.tzModule.convert(t[this.parent.eventFields.startTime],this.parent.timezone,t[this.parent.eventFields.startTimezone]));var v=Mr(a,o,h,u,c,i,g,d);"Agenda"===this.parent.currentView&&-1===o.indexOf("COUNT")&&-1===o.indexOf("UNTIL")&&((0,e.isNullOrUndefined)(t.generatedDates)?t.generatedDates={start:new Date(v[0]),end:new Date(v[v.length-1])}:(v[0]<t.generatedDates.start.getTime()&&(t.generatedDates.start=new Date(v[0])),v[v.length-1]>t.generatedDates.end.getTime()&&(t.generatedDates.end=new Date(v[v.length-1]))));var m=!1,f=[];t[this.parent.eventFields.recurrenceRule]&&this.isDayBasedRecurrence(t)&&this.parent.timezone&&t[this.parent.eventFields.startTimezone]&&t[this.parent.eventFields.endTimezone]&&(m=!0,f.push.apply(f,v.map((function(e){return r.parent.tzModule.convert(new Date(e),t[r.parent.eventFields.startTimezone],r.parent.timezone).getTime()}))));for(var y=[],T=0,w=f=f.length>0?f:v;T<w.length;T++){var D=w[T],b=(0,e.extend)({},t,null,!0);D=m?D:this.getDSTAdjustedTime(D,b),b[this.parent.eventFields.startTime]=new Date(D),b[this.parent.eventFields.endTime]=new Date(new Date(D).setMilliseconds(p)),b[this.parent.eventFields.recurrenceID]=b[this.parent.eventFields.id],delete b[this.parent.eventFields.recurrenceException],delete b[this.parent.eventFields.followingID],b.Guid=this.generateGuid(),y.push(b)}return y},t.prototype.isDayBasedRecurrence=function(e){return e[this.parent.eventFields.recurrenceRule].includes("BYMONTHDAY")||e[this.parent.eventFields.recurrenceRule].includes("BYDAY")},t.prototype.getDSTAdjustedTime=function(e,t){var i=e;if(this.parent.timezone&&(t[this.parent.eventFields.startTimezone]||t[this.parent.eventFields.endTimezone])){var n=this.getDSTDiff(t[this.parent.eventFields.startTime],new Date(e),t[this.parent.eventFields.startTimezone]),r=this.getDSTDiff(t[this.parent.eventFields.startTime],new Date(e),this.parent.timezone);i=new Date(e).getTime()-6e4*(n-r)}return i},t.prototype.getDSTDiff=function(e,t,i){return this.parent.tzModule.offset(new Date(e),i)-this.parent.tzModule.offset(new Date(t),i)},t.prototype.getParentEvent=function(t,i){var n;void 0===i&&(i=!1);do{(t=this.getFollowingEvent(t))&&(n=(0,e.extend)({},t,null,!0))}while(t&&i);if(i&&n){var r=this.getEventCollections(n),a=r.follow.slice(-1)[0];r.occurrence.length>0&&!n[this.parent.eventFields.recurrenceException]&&(a=r.occurrence.slice(-1)[0]),a&&(n[this.parent.eventFields.recurrenceRule]=a[this.parent.eventFields.recurrenceRule])}return n},t.prototype.getEventCollections=function(e,t){var i=[],n=[],r=e;do{(r=this.getFollowingEvent(r,!0))&&i.push(r),n=n.concat(this.getOccurrenceEvent(r||e))}while(r);var a={};if(t){var s=this.parent.eventFields;a={follow:i.filter((function(e){return e[s.startTime]>=t[s.startTime]})),occurrence:n.filter((function(e){return e[s.startTime]>=t[s.startTime]}))}}else a={follow:i,occurrence:n};return a},t.prototype.getFollowingEvent=function(e,t){var i,n=this.parent.eventFields;return i=t?e[n.id]:e[n.recurrenceID]||e[n.followingID],this.parent.eventsData.filter((function(e){return e[t?n.followingID:n.id]===i})).shift()},t.prototype.isFollowingEvent=function(e,t){var i=e[this.parent.eventFields.startTime],n=t[this.parent.eventFields.startTime];return i.getHours()===n.getHours()&&i.getMinutes()===n.getMinutes()&&i.getSeconds()===n.getSeconds()},t.prototype.getOccurrenceEvent=function(e,t,i){void 0===t&&(t=!1),void 0===i&&(i=!1);var n=t?"Guid":i?this.parent.eventFields.followingID:this.parent.eventFields.recurrenceID,r=t?"Guid":this.parent.eventFields.id;return(t?this.parent.eventsProcessed:this.parent.eventsData).filter((function(t){return t[""+n]===e[""+r]}))},t.prototype.getOccurrencesByID=function(t){for(var i=this.parent.eventFields,n=[],r=0,a=this.parent.eventsData.filter((function(e){return e[i.id]===t}));r<a.length;r++){var s=a[r];(0,e.isNullOrUndefined)(s[i.recurrenceRule])||(n=n.concat(this.generateOccurrence(s)))}return n},t.prototype.getOccurrencesByRange=function(t,i){for(var n=this.parent.eventFields,r=[],a=0,s=this.parent.eventsData;a<s.length;a++){var o=s[a];(0,e.isNullOrUndefined)(o[n.recurrenceRule])||(r=r.concat(this.generateOccurrence(o)))}return r.filter((function(r){return r[n.startTime]>=t&&r[n.endTime]<=i&&!(0,e.isNullOrUndefined)(r[n.recurrenceID])}))},t.prototype.getDeletedOccurrences=function(t){var i,n=this.parent.eventFields,r=[];if((i="string"==typeof t||"number"==typeof t?this.parent.eventsData.filter((function(e){return e[n.id]===t}))[0]:(0,e.extend)({},t,null,!0))[n.recurrenceException])for(var a=i[n.recurrenceException].split(","),s=function(s,l){if(0===o.parent.eventsData.filter((function(e){return e[n.recurrenceID]===i[n.id]&&e[n.recurrenceException]===a[parseInt(s.toString(),10)]})).length){var p=kr(a[parseInt(s.toString(),10)]),c=(0,e.extend)({},t,null,!0);c[n.recurrenceID]=i[n.id],delete c[n.followingID],c[n.recurrenceException]=a[parseInt(s.toString(),10)];var h=new Date(p.getTime()),d=i[n.endTime].getTime()-i[n.startTime].getTime(),u=new Date(h.getTime());u.setMilliseconds(d),c[n.startTime]=new Date(h.getTime()),c[n.endTime]=new Date(u.getTime()),r.push(c)}},o=this,l=0,p=a.length;l<p;l++)s(l);return r},t.prototype.applyResourceColor=function(t,i,n,r,a){if(this.parent.resourceBase){var s=this.parent.resourceBase.getResourceColor(i,r);s&&(t.style[n]=(0,e.isNullOrUndefined)(a)?s:function(e,t){return e=e.replace("#",""),"rgba("+parseInt(e.substring(0,e.length/3),16)+", "+parseInt(e.substring(e.length/3,2*e.length/3),16)+", "+parseInt(e.substring(2*e.length/3,3*e.length/3),16)+", "+t+")"}(s,a))}},t.prototype.createBlockAppointmentElement=function(t,i,n){var r,a=t[this.parent.eventFields.subject]||this.parent.eventSettings.fields.subject.default,s=(0,e.createElement)("div",{className:Qt,attrs:{"data-id":"Appointment_"+t[this.parent.eventFields.id],"aria-disabled":"true"}});if((0,e.isNullOrUndefined)(this.parent.activeViewOptions.eventTemplate)){var o=(0,e.createElement)("div",{className:Cn});this.parent.sanitize(a,o),r=[o]}else{var l=this.parent.element.id+"_"+this.parent.activeViewOptions.eventTemplateName+"eventTemplate",p=n&&-1===this.parent.currentView.indexOf("Year")?this.parent.getEventTemplateName(i):"eventTemplate";r=this.parent.getAppointmentTemplate()(t,this.parent,p,l,!1,void 0,void 0,this.parent.root)}return(0,e.append)(r,s),this.setWrapperAttributes(s,i),s},t.prototype.setWrapperAttributes=function(t,i){(0,e.isNullOrUndefined)(this.cssClass)||(0,e.addClass)([t],this.cssClass),this.parent.activeViewOptions.group.resources.length>0&&t.setAttribute("data-group-index",i.toString())},t.prototype.getReadonlyAttribute=function(e){return(e[this.parent.eventFields.isReadonly]||this.parent.readonly).toString()},t.prototype.isBlockRange=function(t){for(var i=t instanceof Array?t:[t],n=!1,r=this.parent.eventFields,a=0,s=i;a<s.length;a++){var o=s[a],l=[];(0,e.isNullOrUndefined)(o[r.recurrenceRule])||!(0,e.isNullOrUndefined)(o[r.recurrenceID])&&o[r.id]!==o[r.recurrenceID]?l.push(o):l=this.generateOccurrence(o);for(var p=0,c=l;p<c.length;p++){var h=c[p];if(this.filterBlockEvents(h).length>0){n=!0;break}}}return this.parent.uiStateValues.isBlock=n,n},t.prototype.getFilterEventsList=function(e,t){return new Sr.DataManager(e).executeLocal((new Sr.Query).where(t))},t.prototype.getSeriesEvents=function(t,i){var n,r,a=this.parent.eventFields;i=(0,e.isNullOrUndefined)(i)?t[a.startTime]:i;var s,o=[],l=t[a.id],p=t[a.followingID],c="EditSeries"===this.parent.currentAction?"greaterthan":"greaterthanorequal";do{s=new Sr.Predicate(a.followingID,"equal",l).and(new Sr.Predicate(a.startTime,c,i)),n=(r=this.getFilterEventsList(this.parent.eventsData,s)).slice(-1)[0],(0,e.isNullOrUndefined)(n)||n[a.id]===p?p=null:(o.push(n),l=n[a.id],p=n[a.followingID])}while(1===r.length&&!(0,e.isNullOrUndefined)(n[a.followingID]));return o},t.prototype.getEditedOccurrences=function(e,t){for(var i,n=this.parent.eventFields,r=[],a=0,s=e;a<s.length;a++){var o=s[a],l=new Sr.Predicate(n.recurrenceID,"equal",o[n.id]).or(new Sr.Predicate(n.recurrenceID,"equal",o[n.followingID]).and(new Sr.Predicate(n.recurrenceID,"notequal",void 0)).and(new Sr.Predicate(n.recurrenceID,"notequal",null)));"EditFollowingEvents"!==this.parent.currentAction&&"DeleteFollowingEvents"!==this.parent.currentAction||(l=l.and(new Sr.Predicate(n.startTime,"greaterthanorequal",t))),i=this.getFilterEventsList(this.parent.eventsData,l),r=r.concat(i)}return r},t.prototype.getRenderedDates=function(t){var i,n=0,r=t.length,a=(0,e.isNullOrUndefined)(this.parent.maxDate)?new Date(2099,11,31):this.parent.maxDate,s=(0,e.isNullOrUndefined)(this.parent.minDate)?new Date(1900,0,1):this.parent.minDate;if(t[0]<s&&t[t.length-1]>a){for(var o=0;o<t.length;o++)ve(t[parseInt(o.toString(),10)]).getTime()===ve(new Date(s)).getTime()&&(n=o),ve(t[parseInt(o.toString(),10)]).getTime()===ve(new Date(a)).getTime()&&(r=o);i=t.filter((function(e){return e>=t[parseInt(n.toString(),10)]&&e<=t[parseInt(r.toString(),10)]}))}return i},t.prototype.isValidEvent=function(e,t,i,n){var r=i.getTime()>n.startHour.getTime()&&t.getTime()<n.endHour.getTime(),a=n.startHour.getTime()<=t.getTime()&&e[this.parent.eventFields.startTime].getTime()>=n.startHour.getTime()&&e[this.parent.eventFields.endTime].getTime()<n.endHour.getTime()&&t.getTime()===i.getTime();return r||a},t.prototype.allDayExpandScroll=function(t){var i=0;[].slice.call(this.parent.element.querySelectorAll("."+Hi)).forEach((function(e){[].slice.call(e.children).forEach((function(e){e.style.top=i+"px"})),i+=e.offsetHeight})),i=t.offsetHeight-i,this.parent.element.querySelector("."+Ke).style.height=i/12+"em",this.parent.uiStateValues.expand?(0,e.addClass)([t],vr):(0,e.removeClass)([t],vr)},t.prototype.updateEventMinimumDuration=function(e,t,i){if((t.getTime()<i.getTime()||t.getTime()===i.getTime()&&e.startHour.getTime()<i.getTime()&&e.endHour.getTime()>t.getTime()&&-1===this.parent.currentView.indexOf("Timeline"))&&(Re(i)-Re(t))/ne<this.parent.eventSettings.minimumEventDuration){var n=new Date(t);if(n.setMinutes(n.getMinutes()+this.parent.eventSettings.minimumEventDuration),(i=n).getTime()>e.endHour.getTime()){var r=new Date(e.endHour.getTime());r.setMinutes(r.getMinutes()-this.parent.eventSettings.minimumEventDuration),t=r,i=e.endHour}}return{startDate:t,endDate:i}},t.prototype.createEventWrapper=function(t,i){void 0===t&&(t=""),void 0===i&&(i=0);for(var n=(0,e.createElement)("tr"),r=this.parent.activeView.colLevels.slice(-1)[0],a=this.parent.isReact&&this.parent.activeViewOptions.eventTemplate?" "+Nt:"",s=0,o=r.length;s<o;s++){var l=r[parseInt(s.toString(),10)],p=(0,e.createElement)("td",{className:"allDay"===t?Pi+a:"timeIndicator"===t?Pt:Lt+a,attrs:{"data-date":l.date.getTime().toString()}});if((0,e.isNullOrUndefined)(l.groupIndex)||p.setAttribute("data-group-index",l.groupIndex.toString()),""===t){var c=(0,e.createElement)("div",{id:jt+"-"+i.toString(),className:jt});p.appendChild(c)}n.appendChild(p),i+=1}return n},t.prototype.getPageCoordinates=function(t){if((0,e.isNullOrUndefined)(t))return t;var i=t.event;return i&&i.changedTouches?i.changedTouches[0]:t.changedTouches?t.changedTouches[0]:i||t},t.prototype.renderSpannedIcon=function(t,i){var n=(0,e.createElement)("div",{className:yi+" "+Ye});if(i.isLeft){var r=n.cloneNode();(0,e.addClass)([r],Ti),(0,e.prepend)([r],t)}if(i.isRight){var a=n.cloneNode();(0,e.addClass)([a],wi),(0,e.append)([a],t)}if(i.isTop){var s=n.cloneNode();(0,e.addClass)([s],"e-up-icon"),(0,e.prepend)([s],t)}if(i.isBottom){var o=n.cloneNode();(0,e.addClass)([o],"e-down-icon"),(0,e.append)([o],t)}},t.prototype.addCellHeight=function(t,i,n,r,a,s){if(void 0===s&&(s=!0),this.parent.activeViewOptions.maxEventsPerRow&&!this.parent.rowAutoHeight){for(var o=[].slice.call(this.parent.element.querySelectorAll(t)),l=this.parent.showWeekNumber?[].slice.call(this.parent.element.querySelectorAll("."+Wt+" tbody tr")):[],p=0,c=o;p<c.length;p++){var h=c[p],d=this.parent.activeViewOptions.maxEventsPerRow*(i+("Month"===this.parent.currentView?n:2))+r+a;l.length>0&&(0,e.setStyleAttribute)(l[o.indexOf(h)].firstElementChild,{height:d+"px"}),(0,e.setStyleAttribute)(h.firstElementChild,{height:d+"px"})}this.parent.enablePersistence||this.parent.activeViewOptions.allowVirtualScrolling||!s||this.parent.notify(_,{})}},t.prototype.unWireEvents=function(){for(var t=0,i=[].slice.call(this.parent.element.querySelectorAll("."+Xt));t<i.length;t++){var n=i[t];e.EventHandler.clearEvents(n)}},t.prototype.destroy=function(){this.unWireEvents(),this.parent=null},t}(),Ia=(Va=function(e,t){return Va=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},Va(e,t)},function(e,t){function i(){this.constructor=e}Va(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),Ma=function(t){function i(i){var n=t.call(this,i)||this;return n.dateRender=[],n.renderedEvents=[],n.renderedAllDayEvents=[],n.overlapEvents=[],n.moreEvents=[],n.overlapList=[],n.allDayEvents=[],n.slotCount=n.parent.activeViewOptions.timeScale.slotCount,n.interval=n.parent.activeViewOptions.timeScale.interval,n.allDayLevel=0,n.startHour=n.getStartEndHours(n.parent.activeViewOptions.startHour),n.endHour=n.getStartEndHours(n.parent.activeViewOptions.endHour),n.element=n.parent.activeView.getPanel(),n.fields=n.parent.eventFields,n.animation=new e.Animation({progress:n.animationUiUpdate.bind(n)}),n.addEventListener(),n}return Ia(i,t),i.prototype.renderAppointments=function(){var t=this;if(!(0,e.isNullOrUndefined)(this.parent)){this.parent.dragAndDropModule&&this.parent.dragAndDropModule.setDragArea(),this.isResourceEventTemplate=this.parent.isSpecificResourceEvents();for(var i=[].slice.call(this.parent.element.querySelectorAll("."+Qt+",."+Xt+",."+Li)),n=!(!this.parent.crudModule||!this.parent.crudModule.crudObj.isCrudAction),r=function(i){if(t.parent.isReact&&!(0,e.isNullOrUndefined)(t.parent.activeViewOptions.eventTemplate)){var n=(0,e.closest)(i,"."+Lt+",."+Pi);n&&!n.classList.contains(Nt)&&(0,e.addClass)([n],Nt)}},a=0,s=i;a<s.length;a++){var o=s[a];if(!n||o.classList.contains(ji)||o.classList.contains(Li))r(o),(0,e.remove)(o);else for(var l=parseInt(o.getAttribute("data-group-index"),10),p=0,c=this.parent.crudModule.crudObj.sourceEvent.length;p<c;p++)l!==this.parent.crudModule.crudObj.sourceEvent[parseInt(p.toString(),10)].groupIndex&&l!==this.parent.crudModule.crudObj.targetEvent[parseInt(p.toString(),10)].groupIndex||(r(o),(0,e.remove)(o))}if(this.element.querySelector("."+$e)&&(this.parent.virtualScrollModule&&this.parent.virtualScrollModule.updateFocusedWorkCell(),this.allDayElement=[].slice.call(this.element.querySelectorAll("."+Ke)),this.setAllDayRowHeight(0),0!==this.parent.eventsProcessed.length||0!==this.parent.blockProcessed.length)){var h=this.element.querySelector("."+qi);e.EventHandler.remove(h,"click",this.rowExpandCollapse),e.EventHandler.add(h,"click",this.rowExpandCollapse,this),this.renderedEvents=[],this.renderedAllDayEvents=[],this.initializeValues(),this.processBlockEvents(),this.renderEvents("normalEvents"),this.allDayEvents.length>0&&(this.allDayEvents=this.allDayEvents.filter((function(e,t,i){return t===i.map((function(e){return e.Guid})).indexOf(e.Guid)})),(0,e.removeClass)(this.allDayElement,Gn),this.slots.push(this.parent.activeView.renderDates.map((function(e){return+e}))),this.renderEvents("allDayEvents"),this.animation.animate(this.allDayElement[0])),this.parent.notify(_,{}),(0,e.addClass)(this.allDayElement,Gn),n&&(this.parent.crudModule.crudObj.isCrudAction=!1),this.parent.renderTemplates((function(){if(t.parent&&t.parent.isReact&&t.parent.activeViewOptions.eventTemplate){var i=[].slice.call(t.parent.element.querySelectorAll("."+Nt));(0,e.removeClass)(i,Nt)}}))}}},i.prototype.initializeValues=function(){if(this.resources=this.parent.activeViewOptions.group.resources.length>0?this.parent.uiStateValues.isGroupAdaptive?[this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]]:this.parent.resourceBase.lastResourceLevel:[],this.resources.length>0&&this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.virtualScrollModule&&(this.resources=this.parent.resourceBase.renderedResources),this.cellHeight=parseFloat(this.parent.getElementHeight(this.parent.element.querySelector(".e-content-wrap tbody tr")).toFixed(2)),this.dateRender[0]=this.parent.activeView.renderDates,this.parent.activeViewOptions.group.resources.length>0)for(var e=0,t=this.resources.length;e<t;e++)this.dateRender[parseInt(e.toString(),10)]=this.resources[parseInt(e.toString(),10)].renderDates},i.prototype.getHeight=function(e,t){var i=(Re(t)-Re(e))/ne*(this.cellHeight*this.slotCount)/this.interval;return i=i<=0?this.cellHeight:i},i.prototype.appendEvent=function(t,i,n,r){var a=this.element.querySelector("."+jt+'[id="'+jt+"-"+n+'"]');this.parent.enableRtl?(0,e.setStyleAttribute)(i,{right:r}):(0,e.setStyleAttribute)(i,{left:r});var s=i.classList.contains(Qt)?"blockEvent":"event",o={data:(0,e.extend)({},t,null,!0),element:i,cancel:!1,type:s};this.parent.trigger(y,o,(function(e){e.cancel||a.appendChild(i)}))},i.prototype.processBlockEvents=function(){for(var e=this.getResourceList(),t=this.getStartCount(),i=0,n=e;i<n.length;i++)for(var r=n[i],a=this.dateRender[parseInt(r.toString(),10)],s=0,o=a.length;s<o;s++){for(var l=new Date(a[parseInt(s.toString(),10)].getTime()),p=ve(ye(a[parseInt(s.toString(),10)],1)),c=0,h=this.filterEvents(l,p,this.parent.blockProcessed,this.resources[parseInt(r.toString(),10)]);c<h.length;c++){var d=h[c];this.parent.resourceBase&&this.setValues(d,r),this.renderBlockEvents(d,s,r,t),this.cssClass=null,this.groupOrder=null}t+=1}},i.prototype.renderBlockEvents=function(t,i,n,r){var a=this.isSpannedEvent(t,i,n),s=a[this.fields.startTime],o=a[this.fields.endTime],l=De(ve(new Date(this.dateRender[parseInt(n.toString(),10)][parseInt(i.toString(),10)].getTime())),this.startHour,this.endHour);if(s<=o&&this.isValidEvent(t,s,o,l)&&this.isWorkDayAvailable(n,s)){var p=void 0,c=void 0;if(a[this.fields.isAllDay]){var h=this.parent.element.querySelector("."+ri+" table");c=(0,e.formatUnit)(h.offsetHeight),p=(0,e.formatUnit)(0)}else c=(0,e.formatUnit)(this.getHeight(s,o)),p=(0,e.formatUnit)(this.getTopValue(s));var d=this.createBlockAppointmentElement(t,n,this.isResourceEventTemplate);(0,e.setStyleAttribute)(d,{width:"100%",height:c,top:p});var u=this.getDayIndex(i,n,r);this.appendEvent(t,d,u,"0px")}},i.prototype.renderEvents=function(t){(0,e.removeClass)(this.allDayElement,Gn);for(var i,n="allDayEvents"===t?this.sortByDateTime(this.allDayEvents):void 0,r=this.getResourceList(),a=this.getStartCount(),s="allDayEvents"===t?this.parent.getElementHeightFromClass(this.element.querySelector("."+Pi),Xt):0,o="allDayEvents"===t&&this.allDayElement.length>0?this.allDayElement[0].offsetTop:0,l=function(r){i=!0,p.parent.crudModule&&p.parent.crudModule.crudObj.isCrudAction&&"allDayEvents"!==t&&!p.parent.uiStateValues.isGroupAdaptive&&0===p.parent.crudModule.crudObj.sourceEvent.filter((function(e){return e.groupIndex===r})).length&&0===p.parent.crudModule.crudObj.targetEvent.filter((function(e){return e.groupIndex===r})).length&&(i=!1),p.slots=[];var l=p.dateRender[parseInt(r.toString(),10)],c=p.getRenderedDates(l)||l;p.slots.push(l.map((function(e){return+e})));for(var h=0,d=l.length;h<d&&l[parseInt(h.toString(),10)]<=c[c.length-1];h++){p.renderedEvents=[];var u=new Date(l[parseInt(h.toString(),10)].getTime()),g=ve(ye(l[parseInt(h.toString(),10)],1)),v=p.filterEvents(u,g,n,p.resources[parseInt(r.toString(),10)]);if(i)for(var m=0,f=v;m<f.length;m++){var y=f[m];if(p.parent.resourceBase&&p.setValues(y,r),"allDayEvents"===t)p.renderAllDayEvents(y,h,r,a,!1,o,s);else if(p.isAllDayAppointment(y))p.allDayEvents.push((0,e.extend)({},y,null,!0));else{if(p.parent.eventSettings.enableMaxHeight&&p.getOverlapIndex(y,h,!1,r)>0)continue;p.renderNormalEvents(y,h,r,a)}p.cssClass=null,p.groupOrder=null}else for(var T=0,w=v;T<w.length;T++){var D=w[T];p.isAllDayAppointment(D)&&p.allDayEvents.push((0,e.extend)({},D,null,!0))}a+=1}},p=this,c=0,h=r;c<h.length;c++){l(h[c])}},i.prototype.getStartCount=function(){return this.parent.virtualScrollModule&&this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.timeScale.enable?parseInt(this.element.querySelector("."+jt).getAttribute("id").split("-").slice(-1)[0],10):0},i.prototype.getDayIndex=function(e,t,i){var n=this;if(!this.parent.activeViewOptions.group.byDate)return i;if(this.parent.activeViewOptions.group.byDate&&!this.parent.activeViewOptions.group.hideNonWorkingDays){var r=this.parent.resourceBase.lastResourceLevel[0].renderDates.indexOf(this.dateRender[parseInt(t.toString(),10)][parseInt(e.toString(),10)]);return this.resources.length*r+t}for(var a=0,s=this.parent.activeView.colLevels[0],o=this.dateRender[parseInt(t.toString(),10)][parseInt(e.toString(),10)].getTime(),l=[],p=0;p<s.length&&(l=this.parent.resourceBase.resourceDateTree[parseInt(p.toString(),10)],o!==s[parseInt(p.toString(),10)].date.getTime());p++)a+=s[parseInt(p.toString(),10)].colSpan;var c=l.findIndex((function(e){return e.groupOrder.toString()===n.resources[parseInt(t.toString(),10)].groupOrder.toString()}));return c<0?a:a+c},i.prototype.setValues=function(e,t){this.parent.activeViewOptions.group.resources.length>0?(this.cssClass=this.resources[parseInt(t.toString(),10)].cssClass,this.groupOrder=this.resources[parseInt(t.toString(),10)].groupOrder):this.cssClass=this.parent.resourceBase.getCssClass(e)},i.prototype.getResourceList=function(){return Array.apply(null,{length:this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive?this.resources.length:1}).map((function(e,t){return t}))},i.prototype.createAppointmentElement=function(t,i,n,r){var a=this.parent.eventFields,s=t[a.subject]||this.parent.eventSettings.fields.subject.default||this.parent.localeObj.getConstant("addTitle"),o=(0,e.createElement)("div",{className:Xt,attrs:{"data-id":"Appointment_"+t[a.id],"data-guid":t.Guid,role:"button",tabindex:"0","aria-disabled":this.parent.eventBase.getReadonlyAttribute(t),"aria-label":this.parent.getAnnouncementString(t)}});t[this.fields.isReadonly]&&(0,e.addClass)([o],"e-read-only");var l,p=(0,e.createElement)("div",{className:Jt});if(o.appendChild(p),this.parent.activeViewOptions.group.resources.length>0){var c=this.parent.uiStateValues.isGroupAdaptive?this.parent.uiStateValues.groupIndex:r;o.setAttribute("data-group-index",c.toString())}var h=n;if((0,e.isNullOrUndefined)(this.parent.activeViewOptions.eventTemplate)){var d=(0,e.createElement)("div",{className:Cn});if(this.parent.sanitize(s,d),i)if(t[a.isAllDay])l=[d];else{l=[];var u=(0,e.createElement)("div",{className:ti+(this.parent.isAdaptive?" "+Ge:""),innerHTML:this.parent.getTimeString(t[a.startTime])}),g=(0,e.createElement)("div",{className:ti+(this.parent.isAdaptive?" "+Ge:""),innerHTML:this.parent.getTimeString(t[a.endTime])});(0,e.addClass)([d],"e-text-center"),h.isLeft||l.push(u),l.push(d),h.isRight||l.push(g)}else{var v=this.parent.getTimeString(t[a.startTime])+" - "+this.parent.getTimeString(t[a.endTime]),m=(0,e.createElement)("div",{className:ti+(this.parent.isAdaptive?" "+Ge:""),innerHTML:v}),f=(0,e.createElement)("div",{className:On});this.parent.sanitize(t[a.location]||this.parent.eventSettings.fields.location.default||"",f),l=[d,m,f]}}else{var y=this.parent.element.id+"_"+this.parent.activeViewOptions.eventTemplateName+"eventTemplate",T=this.parent.uiStateValues.isGroupAdaptive?this.parent.uiStateValues.groupIndex:r,w=this.isResourceEventTemplate?this.parent.getEventTemplateName(T):"eventTemplate";l=this.parent.getAppointmentTemplate()(t,this.parent,w,y,!1,void 0,void 0,this.parent.root)}if((0,e.append)(l,p),!(this.parent.isAdaptive||(0,e.isNullOrUndefined)(t[a.recurrenceRule])&&(0,e.isNullOrUndefined)(t[a.recurrenceID]))){var D=t[a.id]===t[a.recurrenceID]?ki:Ri,b=(0,e.createElement)("div",{className:Ye+" "+D});i?p.appendChild(b):o.appendChild(b)}return this.parent.eventBase.renderSpannedIcon(i?p:o,h),(0,e.isNullOrUndefined)(this.cssClass)||(0,e.addClass)([o],this.cssClass),this.applyResourceColor(o,t,"backgroundColor",this.groupOrder),this.renderResizeHandler(o,h,t[this.fields.isReadonly]),o},i.prototype.createMoreIndicator=function(t,i,n){var r=n+i,a=t[parseInt(r.toString(),10)];if(a.childElementCount<=0){var s=(0,e.createElement)("div",{className:Li,id:Li+"-"+r.toString()}),o=(0,e.createElement)("div",{className:Bi,attrs:{tabindex:"0","data-index":r.toString(),"data-count":"1"},innerHTML:"+1 "+(this.parent.isAdaptive?"":this.parent.localeObj.getConstant("more"))});s.appendChild(o),a.appendChild(s),e.EventHandler.add(o,"click",this.rowExpandCollapse,this)}else{var l=a.querySelector("."+Bi),p=parseInt(l.getAttribute("data-count"),10)+1;l.setAttribute("data-count",p.toString()),l.innerHTML="+"+this.parent.globalize.formatNumber(p)+" "+(this.parent.isAdaptive?"":this.parent.localeObj.getConstant("more"))}},i.prototype.isSpannedEvent=function(t,i,n){var r=ve(this.dateRender[parseInt(n.toString(),10)][parseInt(i.toString(),10)]),a=this.getRenderedDates(this.dateRender[parseInt(n.toString(),10)])||[r];0===a.filter((function(e){return e.getDay()===i})).length&&(r=ve(a[0]));var s=this.parent.eventFields,o=De(r,this.startHour,this.endHour),l=(0,e.extend)({},t,null,!0);l.isSpanned={isBottom:!1,isTop:!1,isSameDuration:l[s.startTime].getTime()===l[s.endTime].getTime()},t[s.startTime].getTime()<o.startHour.getTime()&&(l[s.startTime]=o.startHour,l.isSpanned.isTop=!0),t[s.endTime].getTime()>o.endHour.getTime()&&(l[s.endTime]=o.endHour,l.isSpanned.isBottom=!0);var p=this.updateEventMinimumDuration(o,l[s.startTime],l[s.endTime]);return l[s.startTime]=p.startDate,l[s.endTime]=p.endDate,l},i.prototype.isWorkDayAvailable=function(e,t){if(this.parent.activeViewOptions.group.hideNonWorkingDays&&this.resources.length>0){var i=this.resources[parseInt(e.toString(),10)].resourceData[this.resources[parseInt(e.toString(),10)].resource.workDaysField]||this.parent.activeViewOptions.workDays;return i&&i.indexOf(t.getDay())>=0}return!0},i.prototype.renderAllDayEvents=function(t,i,n,r,a,s,o){var l=this,p=this.getRenderedDates(this.dateRender[parseInt(n.toString(),10)])||this.dateRender[parseInt(n.toString(),10)];this.parent.activeViewOptions.group.byDate&&(this.slots[0]=[this.dateRender[parseInt(n.toString(),10)][parseInt(i.toString(),10)].getTime()],p=[this.dateRender[parseInt(n.toString(),10)][parseInt(i.toString(),10)]]);var c=this.splitEvent(t,p)[0],h=new Date(c[this.parent.eventFields.startTime].getTime()),d=new Date(c[this.parent.eventFields.endTime].getTime()),u=0,g=1,v=p[0].getTime()<=h.getTime()&&ye(p.slice(-1)[0],1).getTime()>=h.getTime();if(h<=d&&v&&this.isWorkDayAvailable(n,h)){var m=[];if(this.renderedAllDayEvents[parseInt(n.toString(),10)]&&(m=this.renderedAllDayEvents[parseInt(n.toString(),10)].filter((function(e){return e.Guid===t.Guid})),this.parent.activeViewOptions.group.byDate&&(m=m.filter((function(e){return e[l.parent.eventFields.startTime]>=p[parseInt(i.toString(),10)]&&e[l.parent.eventFields.endTime]<=ye(new Date(+p[parseInt(i.toString(),10)]),1)})))),0===m.length){var f=c.data.count,T=this.getOverlapIndex(c,i,!0,n);c.Index=T,this.allDayLevel=this.allDayLevel<T?T:this.allDayLevel;var w=c.data.isRight?0:"Day"===this.parent.currentView?4:7;f>=0&&(u=100*f-(this.parent.activeViewOptions.allowOverlap?w:0)),(0,e.isNullOrUndefined)(this.renderedAllDayEvents[parseInt(n.toString(),10)])&&(this.renderedAllDayEvents[parseInt(n.toString(),10)]=[]),this.renderedAllDayEvents[parseInt(n.toString(),10)].push((0,e.extend)({},c,null,!0));var D,b=[].slice.call(this.element.querySelector("."+Ze).children),S=this.getDayIndex(i,n,r),C=this.element.querySelector("."+Pi+":nth-child("+(S+1)+")");D=a?this.parent.inlineModule.createInlineAppointmentElement(t):this.createAppointmentElement(t,!0,c.data,n),(0,e.addClass)([D],ji);var O=(0,e.extend)({},c.data,null,!0);t.data=O;var E={data:t,element:D,cancel:!1};this.parent.trigger(y,E,(function(i){if(!i.cancel){if(C.appendChild(D),g+=(0===T?s:s+T*o)+1,(0,e.setStyleAttribute)(D,{width:u+"%",top:(0,e.formatUnit)(g)}),T>1){l.moreEvents.push(D);for(var n=0,r=f;n<r;n++)l.createMoreIndicator(b,n,S)}l.allDayElement[0].setAttribute("data-count",l.allDayLevel.toString());var a=4+(!l.parent.uiStateValues.expand&&l.allDayLevel>2?3*o:(l.allDayLevel+1)*o);l.setAllDayRowHeight(a),l.addOrRemoveClass(),l.wireAppointmentEvents(D,t)}}))}}},i.prototype.renderNormalEvents=function(t,i,n,r,a){var s=this.isSpannedEvent(t,i,n),o=s[this.fields.startTime],l=s[this.fields.endTime],p=0,c=De(ve(new Date(this.dateRender[parseInt(n.toString(),10)][parseInt(i.toString(),10)].getTime())),this.startHour,this.endHour),h=this.isValidEvent(t,o,l,c);if(!(o.getTime()<this.parent.minDate.getTime()||l.getTime()>this.parent.maxDate.getTime())&&o<=l&&h&&this.isWorkDayAvailable(n,o)){var d=s.isSpanned.isSameDuration?this.cellHeight:this.getHeight(o,l);o.getTime()>=c.startHour.getTime()&&(p=this.getTopValue(o));var u=this.getOverlapIndex(s,i,!1,n);s.Index=u,this.overlapList.push(s),this.overlapList.length>1?((0,e.isNullOrUndefined)(this.overlapEvents[parseInt(u.toString(),10)])&&(this.overlapEvents[parseInt(u.toString(),10)]=[]),this.overlapEvents[parseInt(u.toString(),10)].push(s)):(this.overlapEvents=[],this.overlapEvents.push([s]));var g={index:u,left:"0%",width:this.getEventWidth(),day:r,dayIndex:i,record:s,resource:n},v=this.adjustOverlapElements(g);v.appWidth,(0,e.isNullOrUndefined)(this.renderedEvents[parseInt(n.toString(),10)])&&(this.renderedEvents[parseInt(n.toString(),10)]=[]),this.renderedEvents[parseInt(n.toString(),10)].push((0,e.extend)({},s,null,!0));var m=void 0;m=a?this.parent.inlineModule.createInlineAppointmentElement(t):this.createAppointmentElement(t,!1,s.isSpanned,n),(0,e.setStyleAttribute)(m,{width:this.parent.eventSettings.enableMaxHeight||!this.parent.activeViewOptions.allowOverlap?"100%":v.appWidth,height:d+"px",top:p+"px"});var f=d-40-15*m.querySelectorAll("."+yi).length,y=m.querySelector("."+Cn);!this.parent.isAdaptive&&y&&(y.style.maxHeight=(0,e.formatUnit)(f));var T=this.getDayIndex(i,n,r),w={};w[this.fields.startTime]=t[this.fields.startTime],w[this.fields.endTime]=t[this.fields.endTime],s.data=w,this.appendEvent(s,m,T,v.appLeft),this.wireAppointmentEvents(m,t)}},i.prototype.getEventWidth=function(){var e=(("Day"===this.parent.currentView?97:94)-this.overlapEvents.length)/this.overlapEvents.length;return(e<0?0:e)+"%"},i.prototype.getEventLeft=function(e,t){var i=(parseFloat(e)+1)*t;return(i>99?99:i)+"%"},i.prototype.getStartEndHours=function(t){if(!(0,e.isNullOrUndefined)(t)&&""!==t){var i=new Date(2e3,0,0,0),n=t.split(":");return 2===n.length&&i.setHours(parseInt(n[0],10),parseInt(n[1],10),0),i}return null},i.prototype.getTopValue=function(e){var t=this.getStartEndHours(this.parent.activeViewOptions.startHour),i=60*(e.getHours()-t.getHours())+(e.getMinutes()-t.getMinutes());return this.parent.activeViewOptions.timeScale.enable?i*this.cellHeight*this.slotCount/this.interval:0},i.prototype.getOverlapIndex=function(t,i,n,r){var a=this,s=this.parent.eventFields,o=[],l=-1;if(this.overlapEvents=[],n){if(!(0,e.isNullOrUndefined)(this.renderedAllDayEvents[parseInt(r.toString(),10)])){var p=ve(new Date(this.dateRender[parseInt(r.toString(),10)][parseInt(i.toString(),10)].getTime()));o=this.renderedAllDayEvents[parseInt(r.toString(),10)].filter((function(e){return ve(e[s.startTime]).getTime()<=p.getTime()&&ve(e[s.endTime]).getTime()>=p.getTime()})),this.parent.activeViewOptions.group.resources.length>0&&(o=this.filterEventsByResource(this.resources[parseInt(r.toString(),10)],o))}}else{var c=(0,e.isNullOrUndefined)(this.renderedEvents[parseInt(r.toString(),10)])?[]:this.renderedEvents[parseInt(r.toString(),10)],h=[],d=t[s.startTime],u=t[s.endTime];this.overlapList=c.filter((function(e){return e[s.endTime]>d&&e[s.startTime]<=u||e[s.startTime]>=u&&e[s.endTime]<=d||e[s.endTime].getTime()===e[s.startTime].getTime()&&e[s.startTime].getTime()===d.getTime()&&e[s.endTime]<u})),this.parent.activeViewOptions.group.resources.length>0&&(this.overlapList=this.filterEventsByResource(this.resources[parseInt(r.toString(),10)],this.overlapList));var g=[];this.overlapList.forEach((function(e){g.push(e);for(var t=[],i=new Set,n=function(){var e=g.shift();if(c.filter((function(t){return t[s.endTime]>e[s.startTime]&&t[s.startTime]<=e[s.endTime]&&!i.has(t[s.id])})).forEach((function(e){t.push(e),i.add(e[s.id]),g.push(e)})),i.size<c.length-1)return"break"};g.length>0;){if("break"===n())break}a.parent.activeViewOptions.group.resources.length>0&&(t=a.filterEventsByResource(a.resources[parseInt(r.toString(),10)],t));var o=t.filter((function(e){return-1===a.overlapList.indexOf(e)}));o.length>0&&(h=h.concat(o))}));for(var v=0;v<h.length-1;v++)for(var m=v+1;m<h.length;m++)h[parseInt(v.toString(),10)][s.id]===h[parseInt(m.toString(),10)][s.id]&&(h.splice(m,1),m--);this.overlapList=this.overlapList.concat(h);for(var f=0,y=o=this.overlapList;f<y.length;f++){var T=y[f],w=T.Index;(0,e.isNullOrUndefined)(this.overlapEvents[parseInt(w.toString(),10)])?this.overlapEvents[parseInt(w.toString(),10)]=[T]:this.overlapEvents[parseInt(w.toString(),10)].push(T)}}if(n||(o=o.filter((function(e){return e[s.startTime]===t[s.startTime]&&e[s.endTime]>t[s.endTime]||e[s.endTime]>t[s.startTime]&&e[s.startTime]<t[s.endTime]||e[s.endTime]===t[s.startTime]&&e[s.startTime]===t[s.endTime]||e[s.startTime].getTime()===t[s.startTime].getTime()&&e[s.endTime].getTime()===t[s.endTime].getTime()||e[s.startTime].getTime()===t[s.startTime].getTime()&&e[s.endTime].getTime()<t[s.endTime].getTime()||e[s.endTime].getTime()>t[s.endTime].getTime()}))),o.length>0){var D=o.map((function(e){return e.Index}));l=D.length>0?this.getSmallestMissingNumber(D):0}return-1===l?0:l},i.prototype.adjustOverlapElements=function(t){for(var i={appWidth:t.width,appLeft:t.left},n=0,r=this.overlapEvents.length;n<r;n++)if(!(0,e.isNullOrUndefined)(this.overlapEvents[parseInt(n.toString(),10)]))for(var a=0,s=this.overlapEvents[parseInt(n.toString(),10)].length;a<s;a++){var o=this.getDayIndex(t.dayIndex,t.resource,t.day),l=this.element.querySelector("#e-appointment-wrapper-"+o);if(l&&l.childElementCount>0){var p=this.overlapEvents[parseInt(n.toString(),10)][parseInt(a.toString(),10)].Guid;if(l.querySelectorAll('div[data-guid="'+p+'"]').length>0&&p!==t.record.Guid){var c=l.querySelector('div[data-guid="'+p+'"]');parseFloat(t.width)<=parseFloat(c.style.width)?(this.parent.enableRtl?c.style.right=this.getEventLeft(t.width,n):c.style.left=this.getEventLeft(t.width,n),c.style.width=parseFloat(t.width)+"%",i.appWidth=c.style.width):i.appWidth=c.style.width}else{var h=t.width;(0,e.isNullOrUndefined)(this.overlapEvents[n-1])&&(h=this.getEventWidth()),i.appWidth=h,i.appLeft=this.getEventLeft(h,t.index)}}}return i},i.prototype.setAllDayRowHeight=function(t){var i=this.parent.element.querySelector("."+it);"auto"!==this.parent.height&&this.parent.enableAllDayScroll||(0,e.addClass)([i],mr);var n=this.parent.element.querySelector("."+Ze);if(n.style.height="",this.parent.uiStateValues.expand&&"auto"!==this.parent.height&&this.parent.enableAllDayScroll)n.style.height=t/12+"em",this.parent.eventBase.allDayExpandScroll(i);else{for(var r=0,a=this.allDayElement;r<a.length;r++){a[r].style.height=t/12+"em"}(0,e.removeClass)([i],vr)}},i.prototype.addOrRemoveClass=function(){var t=this;this.moreEvents.filter((function(i){!t.parent.uiStateValues.expand&&t.allDayLevel>2?((0,e.addClass)([i],Ni),i.setAttribute("tabindex","-1")):((0,e.removeClass)([i],Ni),i.setAttribute("tabindex","0"))}));var i=this.element.querySelector("."+qi);this.parent.uiStateValues.expand?((0,e.removeClass)([i],Fi),(0,e.addClass)([i],Ui)):((0,e.removeClass)([i],Ui),(0,e.addClass)([i],Fi)),this.allDayLevel>2?(0,e.removeClass)([i],Ge):(0,e.addClass)([i],Ge),[].slice.call(this.element.querySelectorAll("."+Li)).forEach((function(i){!t.parent.uiStateValues.expand&&t.allDayLevel>2?(0,e.removeClass)([i],Ge):(0,e.addClass)([i],Ge)}))},i.prototype.getEventHeight=function(){var t=(0,e.createElement)("div",{className:Xt,styles:"visibility:hidden"});this.element.querySelector("."+Pi+":first-child").appendChild(t);var i=t.offsetHeight;return(0,e.remove)(t),i},i.prototype.rowExpandCollapse=function(){var e,t=this.element.querySelector("."+qi);this.parent.uiStateValues.expand=t.classList.contains(Fi),this.parent.uiStateValues.expand?(t.setAttribute("title",this.parent.localeObj.getConstant("collapseAllDaySection")),t.setAttribute("aria-label",this.parent.localeObj.getConstant("collapseAllDaySection")),e=(this.allDayLevel+1)*this.getEventHeight()+4):(t.setAttribute("title",this.parent.localeObj.getConstant("expandAllDaySection")),t.setAttribute("aria-label",this.parent.localeObj.getConstant("expandAllDaySection")),e=3*this.getEventHeight()+4,this.parent.element.querySelector("."+it).scrollTop=0),this.setAllDayRowHeight(e),this.animation.animate(this.allDayElement[0]),this.addOrRemoveClass(),this.animation.animate(t)},i.prototype.animationUiUpdate=function(){this.parent.notify(_,{})},i.prototype.destroy=function(){!this.parent||this.parent&&this.parent.isDestroyed||(this.removeEventListener(),this.allDayElement=null,this.renderedAllDayEvents=null,this.renderedEvents=null,this.slotCount=null,this.interval=null,this.startHour=null,this.endHour=null,this.element=null,this.fields=null,this.animation=null,t.prototype.destroy.call(this))},i}(Aa),ka=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ra=function(t){function i(e){var i=t.call(this,e)||this;return i.renderedEvents=[],i.monthHeaderHeight=0,i.moreIndicatorHeight=19,i.renderType="day",i.element=i.parent.activeView.getPanel(),i.fields=i.parent.eventFields,i.maxHeight=i.parent.eventSettings.enableMaxHeight&&!i.parent.eventSettings.enableIndicator&&!i.parent.rowAutoHeight,i.withIndicator=i.parent.eventSettings.enableMaxHeight&&i.parent.eventSettings.enableIndicator&&!i.parent.rowAutoHeight,i.maxOrIndicator=i.maxHeight||i.withIndicator,i.moreIndicatorHeight=i.parent.rowAutoHeight&&i.parent.eventSettings.ignoreWhitespace?0:i.moreIndicatorHeight,i.addEventListener(),i}return ka(i,t),i.prototype.removeEventWrapper=function(t){if(t.length>0)for(var i=0,n=t="Month"===this.parent.currentView||!this.parent.activeView.isTimelineView()&&!this.parent.activeViewOptions.timeScale.enable?t:[t[0]];i<n.length;i++){var r=n[i];r.parentElement&&r.parentElement.parentNode&&(0,e.remove)(r.parentElement)}},i.prototype.renderAppointments=function(){this.parent.dragAndDropModule&&this.parent.dragAndDropModule.setDragArea(),this.isResourceEventTemplate=this.parent.isSpecificResourceEvents();var t=this.parent.element.querySelector("."+ri);this.parent.rowAutoHeight&&(this.parent.uiStateValues.top=t.scrollTop,this.parent.uiStateValues.left=t.scrollLeft);var i=[].slice.call(this.element.querySelectorAll("."+jt));if(this.parent.crudModule&&this.parent.crudModule.crudObj.isCrudAction)for(var n=0,r=this.parent.crudModule.crudObj.sourceEvent.length;n<r;n++){var a=[].slice.call(this.element.querySelectorAll('.e-appointment-wrapper [data-group-index="'+this.parent.crudModule.crudObj.sourceEvent[parseInt(n.toString(),10)].groupIndex+'"]'));if(this.removeEventWrapper(a),this.parent.crudModule.crudObj.targetEvent[parseInt(n.toString(),10)]&&this.parent.crudModule.crudObj.sourceEvent[parseInt(n.toString(),10)].groupIndex!==this.parent.crudModule.crudObj.targetEvent[parseInt(n.toString(),10)].groupIndex){var s=[].slice.call(this.element.querySelectorAll('.e-appointment-wrapper [data-group-index="'+this.parent.crudModule.crudObj.targetEvent[parseInt(n.toString(),10)].groupIndex+'"]'));this.removeEventWrapper(s)}}else for(var o=0,l=i;o<l.length;o++){var p=l[o];(0,e.remove)(p)}if(this.removeHeightProperty(Je),this.element.querySelector("."+$e)){if("Month"===this.parent.currentView){var c=(0,e.createElement)("div",{className:jt}),h=this.parent.element.querySelector("."+$e);h.appendChild(c),this.monthHeaderHeight=c.offsetTop-h.offsetTop,h.removeChild(c)}this.eventHeight=this.parent.getElementHeightFromClass(this.element,Xt);var d="."+Je+" tbody tr";this.addCellHeight(d,this.eventHeight,"Month"===this.parent.currentView?0:2,this.monthHeaderHeight,this.moreIndicatorHeight);var u=t.scrollTop;if(this.parent.rowAutoHeight&&this.parent.virtualScrollModule&&!this.parent.virtualScrollModule.isHorizontalScroll&&!(0,e.isNullOrUndefined)(this.parent.currentAction)&&(t.scrollTop=t.scrollTop-1),this.parent.activeViewOptions.group.resources.length>0?(this.renderResourceEvents(),this.parent.virtualScrollModule&&this.parent.virtualScrollModule.updateFocusedWorkCell()):this.renderEventsHandler(this.parent.activeView.renderDates,this.parent.activeViewOptions.workDays),this.parent.rowAutoHeight){this.updateBlockElements();var g={cssProperties:this.parent.getCssProperties(),module:this.parent.getModuleName(),isPreventScrollUpdate:!0,scrollPosition:{left:this.parent.uiStateValues.left,top:this.parent.uiStateValues.top}};if(this.parent.virtualScrollModule&&!this.parent.virtualScrollModule.isHorizontalScroll&&(this.parent.currentAction?(t.scrollTop=u,this.parent.currentAction=null):this.parent.virtualScrollModule.updateVirtualScrollHeight()),this.parent.enablePersistence||this.parent.notify(_,{}),this.parent.notify(Q,g),"Month"===this.parent.currentView&&this.parent.showWeekNumber){var v=[].slice.call(this.parent.element.querySelectorAll(".e-content-wrap table tr td:first-child"));[].slice.call(this.parent.element.querySelectorAll("."+zt)).forEach((function(t,i){var n=v[parseInt(i.toString(),10)].offsetHeight;(0,e.setStyleAttribute)(t,{height:n+"px"})})),this.parent.element.querySelector("."+Wt).scrollTop=this.parent.element.querySelector("."+ri).scrollTop}}this.parent.renderTemplates()}},i.prototype.renderEventsHandler=function(t,i,n){var r,a;this.renderedEvents=[];var s=0;if(n?(s=n.groupIndex,this.cssClass=n.cssClass,this.groupOrder=n.groupOrder,r=this.parent.eventBase.filterEventsByResource(n,this.parent.eventsProcessed),a=this.parent.eventBase.filterEventsByResource(n,this.parent.blockProcessed),this.workCells=[].slice.call(this.element.querySelectorAll("."+$e+'[data-group-index="'+s+'"]'))):(r=this.parent.eventsProcessed,a=this.parent.blockProcessed,this.workCells=[].slice.call(this.element.querySelectorAll("."+$e))),this.sortByDateTime(r),this.sortByDateTime(a),"Month"===this.parent.currentView&&this.parent.rowAutoHeight&&0===this.parent.activeViewOptions.group.resources.length){var o=[].slice.call(this.parent.element.querySelectorAll(".e-content-wrap table tr td:first-child")),l=this.parent.element.querySelector("."+Je).clientHeight/o.length;o.forEach((function(t){(0,e.setStyleAttribute)(t,{height:l+"px"})}))}var p=this.workCells[this.parent.activeView.isTimelineView()?0:this.workCells.length-1];this.cellWidth=this.parent.getElementWidth(p),this.cellHeight=this.parent.getElementHeight(p),this.dateRender=t;var c=this.getRenderedDates(t);this.getSlotDates(i||this.parent.activeViewOptions.workDays),this.processBlockEvents(a,s,n);for(var h=[],d=0,u=r;d<u.length;d++){var g=u[d];this.parent.resourceBase&&!n&&(this.cssClass=this.parent.resourceBase.getCssClass(g)),h=h.concat(this.splitEvent(g,c||this.dateRender))}for(var v=0;v<this.slots.length;v++){this.renderedEvents=[];for(var m=this.slots[parseInt(v.toString(),10)],f=ye(new Date(m[m.length-1]),1),y=0,T=this.filterEvents(new Date(m[0]),f,h);y<T.length;y++){var w=T[y];if(this.maxHeight){var D="Month"===this.parent.currentView?w[this.fields.startTime]:this.getStartTime(w,w.data);if(this.getIndex(D)>0)continue}this.updateIndicatorIcon(w),this.renderEvents(w,s,r)}}this.cssClass=null,this.groupOrder=null},i.prototype.processBlockEvents=function(t,i,n){for(var r=0,a=t;r<a.length;r++){var s=a[r];this.parent.resourceBase&&!n&&(this.cssClass=this.parent.resourceBase.getCssClass(s));var o=[];if("day"!==this.renderType||s[this.fields.isAllDay])o.push(s);else{var l,p=(0,e.extend)({},s,null,!0),c=this.isSameDate(p[this.fields.startTime],p[this.fields.endTime]);if(p.isBlockIcon=c,!c&&me(p[this.fields.startTime])>0)(l=(0,e.extend)({},s,null,!0))[this.fields.endTime]=ye(ve(new Date(s[this.fields.startTime]+"")),1),l.isBlockIcon=!0,p[this.fields.startTime]=l[this.fields.endTime],o.push(l);if(!(c=this.isSameDate(p[this.fields.startTime],p[this.fields.endTime]))&&me(p[this.fields.endTime])>0)(l=(0,e.extend)({},s,null,!0))[this.fields.startTime]=ve(new Date(s[this.fields.endTime]+"")),l.isBlockIcon=!0,o.push(l),p[this.fields.endTime]=l[this.fields.startTime];o.push(p)}for(var h=0,d=o;h<d.length;h++)for(var u=d[h],g=0,v=this.splitEvent(u,this.dateRender);g<v.length;g++){var m=v[g];this.renderBlockEvents(m,i,!!u.isBlockIcon)}}},i.prototype.isSameDate=function(e,t){return new Date(+e).setHours(0,0,0,0)===new Date(+t).setHours(0,0,0,0)},i.prototype.renderBlockEvents=function(t,i,n){var r=t.data,a=this.getStartTime(t,r),s=this.getEndTime(t,r),o=this.parent.getIndexOfDate(this.dateRender,ve(new Date(a.getTime())));if(!(o<0||a>s)){var l=this.getCellTd(o),p=this.getPosition(a,s,t[this.fields.isAllDay],o);if(n)this.renderBlockIndicator(l,p,i);else{var c=r.count,h=this.getEventWidth(a,s,t[this.fields.isAllDay],c);h=h<=0?this.cellWidth:h;var d=this.parent.enableRtl?0:p,u=this.parent.enableRtl?p:0,g=this.cellHeight-this.monthHeaderHeight,v=this.getRowTop(i),m=this.createBlockAppointmentElement(t,i,this.isResourceEventTemplate);(0,e.setStyleAttribute)(m,{width:h+"px",height:g+"px",left:d+"px",right:u+"px",top:v+"px"}),this.renderEventElement(t,m,l)}}},i.prototype.renderBlockIndicator=function(t,i,n){var r=(0,e.createElement)("div",{className:"e-icons "+Kt});(0,e.isNullOrUndefined)(t.querySelector("."+Kt))&&t.appendChild(r)},i.prototype.getStartTime=function(e,t){return e[this.fields.startTime]},i.prototype.getEndTime=function(e,t){return e[this.fields.endTime]},i.prototype.getCellTd=function(e){return this.workCells[parseInt(e.toString(),10)]},i.prototype.getEventWidth=function(e,t,i,n){return n*this.cellWidth-1},i.prototype.getPosition=function(e,t,i,n){return 0},i.prototype.getRowTop=function(e){return 0},i.prototype.updateIndicatorIcon=function(e){if(-1!==this.parent.currentView.indexOf("Timeline")&&"TimelineMonth"!==this.parent.currentView&&!e[this.fields.isAllDay]){var t=e.data,i=this.parent.activeView.getStartHour(),n=this.parent.activeView.getEndHour(),r=De(e[this.fields.startTime],i,n),a=De(e[this.fields.endTime],i,n),s=t[this.fields.startTime],o=t[this.fields.endTime];if(t.isLeft=t.isLeft||s.getTime()<r.startHour.getTime(),t.isRight=t.isRight||o.getTime()>a.endHour.getTime(),ve(s).getTime()!==ve(o).getTime()){var l=r.startHour,p=a.endHour,c=new Date(ve(s));if(c.setHours(p.getHours(),p.getMinutes(),p.getSeconds()),t.isLeft=t.isLeft||s.getTime()>=(l.getDate()===r.endHour.getDate()?c.getTime():ye(c,1).getTime()),o.getTime()!==ve(o).getTime()){var h=new Date(ve(o));t.isRight=t.isRight||o.getTime()<=h.setHours(l.getHours(),l.getMinutes(),l.getSeconds())}}}},i.prototype.renderResourceEvents=function(){var e=this.parent.uiStateValues.isGroupAdaptive?[this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]]:this.parent.resourceBase.renderedResources;if(this.parent.crudModule&&this.parent.crudModule.crudObj.isCrudAction){for(var t=0,i=this.parent.crudModule.crudObj.sourceEvent.length;t<i;t++){var n=this.parent.crudModule.crudObj.sourceEvent[parseInt(t.toString(),10)];if((!this.parent.uiStateValues.isGroupAdaptive||this.parent.uiStateValues.groupIndex===n.groupIndex&&this.parent.uiStateValues.isGroupAdaptive)&&this.renderEventsHandler(n.renderDates,n.workDays,n),this.parent.crudModule.crudObj.sourceEvent[parseInt(t.toString(),10)].groupIndex!==this.parent.crudModule.crudObj.targetEvent[parseInt(t.toString(),10)].groupIndex){var r=this.parent.crudModule.crudObj.targetEvent[parseInt(t.toString(),10)];this.renderEventsHandler(r.renderDates,r.workDays,r)}}this.parent.crudModule.crudObj.isCrudAction=!1}else for(var a=0,s=e;a<s.length;a++){var o=s[a];this.renderEventsHandler(o.renderDates,o.workDays,o)}},i.prototype.getSlotDates=function(e){this.slots=[];for(var t=this.dateRender.map((function(e){return+e})),i=!this.parent.activeViewOptions.showWeekend||this.parent.activeViewOptions.group.byDate&&this.parent.activeViewOptions.group.hideNonWorkingDays?e.length:ee;t.length>0;)this.slots.push(t.splice(0,i))},i.prototype.createAppointmentElement=function(t,i,n){void 0===n&&(n=!1);var r=t[this.fields.subject]||this.parent.eventSettings.fields.subject.default||this.parent.localeObj.getConstant("addTitle"),a=(0,e.extend)({},t,t.data,!0),s={"data-id":"Appointment_"+t[this.fields.id],role:"button",tabindex:"0","aria-disabled":this.parent.eventBase.getReadonlyAttribute(t),"aria-label":this.parent.getAnnouncementString(a,r)};n||(s["data-guid"]=t.Guid),this.parent.activeViewOptions.group.resources.length>0&&(s["data-group-index"]=i.toString());var o=(0,e.createElement)("div",{className:Xt,attrs:s});(0,e.isNullOrUndefined)(this.cssClass)||(0,e.addClass)([o],this.cssClass),t[this.fields.isReadonly]&&(0,e.addClass)([o],"e-read-only");var l,p=(0,e.createElement)("div",{className:Jt});o.appendChild(p);var c=t.data,h=this.getEventData(t);if((0,e.isNullOrUndefined)(this.parent.activeViewOptions.eventTemplate)){var d=t[this.fields.location]||this.parent.eventSettings.fields.location.default||"",u=(0,e.createElement)("div",{className:Cn});this.parent.sanitize(r+(d?"; "+d:""),u);var g=(0,e.createElement)("div",{className:ti+(this.parent.isAdaptive?" "+Ge:""),innerHTML:this.parent.getTimeString(c[this.fields.startTime])}),v=(0,e.createElement)("div",{className:ti+(this.parent.isAdaptive?" "+Ge:""),innerHTML:this.parent.getTimeString(c[this.fields.endTime])});if("Month"===this.parent.currentView)t[this.fields.isAllDay]?(l=[u],(0,e.addClass)([u],"e-text-center")):c.count<=1&&!c.isLeft&&!c.isRight?l=[g,u]:(l=[],(0,e.addClass)([u],"e-text-center"),c.isLeft||l.push(g),l.push(u),c.isRight||l.push(v));else{var m=void 0;if(t[this.fields.isAllDay]){m=[u,(0,e.createElement)("div",{className:ti,innerHTML:this.parent.localeObj.getConstant("allDay")})]}else{var f=this.parent.getTimeString(c[this.fields.startTime])+" - "+this.parent.getTimeString(c[this.fields.endTime]),y=(0,e.createElement)("div",{className:ti+(this.parent.isAdaptive?" "+Ge:""),innerHTML:f}),T=(0,e.createElement)("div",{className:On});this.parent.sanitize(d,T),m=[u,y,T]}var w=(0,e.createElement)("div",{className:"e-inner-wrap"});(0,e.append)(m,w),l=[w]}}else{var D=this.parent.element.id+"_"+this.parent.activeViewOptions.eventTemplateName+"eventTemplate",b=this.isResourceEventTemplate?this.parent.getEventTemplateName(i):"eventTemplate";l=this.parent.getAppointmentTemplate()(h,this.parent,b,D,!1,void 0,void 0,this.parent.root)}return(0,e.append)(l,p),this.appendEventIcons(t,p),this.renderResizeHandler(o,t.data,t[this.fields.isReadonly]),o},i.prototype.appendEventIcons=function(t,i){var n=t.data;if(!(0,e.isNullOrUndefined)(t[this.fields.recurrenceRule])||!(0,e.isNullOrUndefined)(t[this.fields.recurrenceID])){var r=t[this.fields.id]===t[this.fields.recurrenceID]?ki:Ri;i.appendChild((0,e.createElement)("div",{className:Ye+" "+r+(this.parent.isAdaptive?" "+Ge:"")}))}if(n.isLeft){var a=(0,e.createElement)("div",{className:yi+" "+Ye+" "+Ti});(0,e.prepend)([a],i)}if(n.isRight){var s=(0,e.createElement)("div",{className:yi+" "+Ye+" "+wi});(0,e.append)([s],i)}},i.prototype.renderEvents=function(t,i,n){var r=t[this.fields.startTime],a=t[this.fields.endTime],s=this.parent.getIndexOfDate(this.dateRender,ve(r));if(!(s<0||r.getTime()<this.parent.minDate.getTime()||a.getTime()>this.parent.maxDate.getTime())){var o=this.parent.rowAutoHeight?1:this.parent.activeViewOptions.maxEventsPerRow,l=this.getIndex(r);t.Index=l;var p=t.data.count;if(r.getTime()<=a.getTime()){var c=p*this.cellWidth-5,h=this.workCells[parseInt(s.toString(),10)],d=l*(this.eventHeight+0),u=this.monthHeaderHeight+(l+1)*(this.eventHeight+0)+this.moreIndicatorHeight,g=!this.parent.activeViewOptions.maxEventsPerRow||this.parent.rowAutoHeight||this.parent.eventSettings.enableIndicator?this.maxOrIndicator?l<1:this.cellHeight>u:l<o;if(this.parent.rowAutoHeight||g){this.renderedEvents.push((0,e.extend)({},t,null,!0));var v=void 0;if(v=this.inlineValue?this.parent.inlineModule.createInlineAppointmentElement():this.createAppointmentElement(t,i),this.applyResourceColor(v,t,"backgroundColor",this.groupOrder),this.wireAppointmentEvents(v,t),(0,e.setStyleAttribute)(v,{width:c+"px",top:d+"px"}),this.renderEventElement(t,v,h),this.parent.rowAutoHeight){var m=this.parent.element.querySelector("."+ri),f=this.parent.getElementWidth(m),y=m.offsetHeight===m.clientHeight&&m.offsetWidth===m.clientWidth,T=h.parentElement.firstElementChild;this.updateCellHeight(T,u),y&&(m.offsetWidth>m.clientWidth||f!==this.parent.getElementWidth(m))&&this.adjustAppointments(f)}}else for(var w=0;w<p;w++)if(this.workCells[s+w]){var D=this.workCells[s+w].querySelector("."+Bi);if(D){var b=parseInt(D.getAttribute("data-count"),10)+1;D.setAttribute("data-count",b.toString()),D.setAttribute("aria-label",b+" "+this.parent.localeObj.getConstant("moreEvents")),D.innerHTML=this.getMoreIndicatorText(b)}else{var S=new Date(this.dateRender[s+w].getTime()),C=ye(this.dateRender[s+w],1),O=this.workCells[s+w].getAttribute("data-group-index"),E=this.getMoreIndicatorElement(1,S,C);(0,e.isNullOrUndefined)(O)||E.setAttribute("data-group-index",O),E.style.top=this.cellHeight-this.monthHeaderHeight-this.moreIndicatorHeight+"px",E.style.width=this.cellWidth-2+"px",this.renderElement(this.workCells[s+w],E),e.EventHandler.add(E,"click",this.moreIndicatorClick,this)}}}}},i.prototype.adjustAppointments=function(e){var t=this,i=this.parent.element.querySelector("."+Je+" tbody tr"),n=this.parent.getElementWidth(this.workCells[0]);this.cellWidth=n/+(this.workCells[0].getAttribute("colspan")||1);var r=n*i.children.length/(e/100);[].slice.call(this.parent.element.querySelectorAll("."+Xt)).forEach((function(e){t.parent.enableRtl&&"0px"!==e.style.right?e.style.right=parseFloat(e.style.right)/100*r+"px":"0px"!==e.style.left&&(e.style.left=parseFloat(e.style.left)/100*r+"px"),e.style.width=parseFloat(e.style.width)/100*r+"px"}))},i.prototype.updateCellHeight=function(t,i){i>t.offsetHeight&&(0,e.setStyleAttribute)(t,{height:i+"px"})},i.prototype.updateBlockElements=function(){for(var t=0,i=[].slice.call(this.element.querySelectorAll("."+Qt));t<i.length;t++){var n=i[t],r=(0,e.closest)(n,"tr");this.monthHeaderHeight=n.offsetParent.offsetTop-r.offsetTop,n.style.height=r.offsetHeight-1-this.monthHeaderHeight+"px";var a=r.firstElementChild,s=Math.round(n.offsetWidth/a.offsetWidth);n.style.width=a.offsetWidth*s+"px"}},i.prototype.getFilteredEvents=function(t,i,n,r){var a;if((0,e.isNullOrUndefined)(n))a=this.filterEvents(t,i);else{var s=this.parent.resourceBase.lastResourceLevel[parseInt(n,10)];a=this.filterEvents(t,i,(0,e.isNullOrUndefined)(r)?void 0:r,s)}return a},i.prototype.getOverlapEvents=function(e,t){for(var i=[],n=ve(e).getTime(),r=0,a=t;r<a.length;r++){var s=a[r];ve(s[this.fields.startTime]).getTime()<=n&&ve(s[this.fields.endTime]).getTime()>=n&&i.push(s)}return i},i.prototype.getIndex=function(e){var t=-1,i=this.renderedEvents;if(i.length>0){var n=this.getOverlapEvents(e,i).map((function(e){return e.Index}));t=n.length>0?this.getSmallestMissingNumber(n):0}return-1===t?0:t},i.prototype.moreIndicatorClick=function(t){var i=this,n=(0,e.closest)(t.target,"."+Bi),r=new Date(parseInt(n.getAttribute("data-start-date"),10)),a=new Date(parseInt(n.getAttribute("data-end-date"),10)),o=n.getAttribute("data-group-index"),l={cancel:!1,event:t,element:n,isPopupOpen:!0,startTime:r,endTime:a,viewName:this.parent.getNavigateView()};o&&(l.groupIndex=parseInt(o,10)),this.parent.trigger(s,l,(function(e){if(!e.cancel)if(e.isPopupOpen){var n=i.getFilteredEvents(r,a,o),s={date:r,event:n,element:t.target};i.parent.quickPopup.moreEventClick(s,a,o)}else i.parent.setProperties({selectedDate:r},!0),i.parent.changeView(e.viewName,t)}))},i.prototype.renderEventElement=function(e,t,i){var n=this,r=t.classList.contains(Qt)?"blockEvent":"event",a=t.classList.contains(Xt),s={data:"Month"===this.parent.currentView?this.getSpannedTime(e):this.getEventData(e),element:t,cancel:!1,type:r};this.parent.trigger(y,s,(function(e){e.cancel?n.renderedEvents.pop():n.renderElement(i,t,a)}))},i.prototype.getSpannedTime=function(t){var i=(0,e.extend)({},t,null,!0);return i[this.fields.startTime].getDate()===i.data[this.fields.startTime].getDate()&&(i[this.fields.startTime]=i.data[this.fields.startTime]),i[this.fields.endTime].getDate()===i.data[this.fields.endTime].getDate()&&(i[this.fields.endTime]=i.data[this.fields.endTime]),i},i.prototype.getEventData=function(t){var i=(0,e.extend)({},t,null,!0);return i[this.fields.startTime]=t.data[this.fields.startTime],i[this.fields.endTime]=t.data[this.fields.endTime],i},i.prototype.renderElement=function(t,i,n){void 0===n&&(n=!1),this.maxOrIndicator&&n&&this.setMaxEventHeight(i,t);var r=t.querySelector("."+jt);if(r)r.appendChild(i);else{var a=(0,e.createElement)("div",{className:jt});a.appendChild(i),t.appendChild(a)}},i.prototype.getMoreIndicatorElement=function(t,i,n){return(0,e.createElement)("div",{className:Bi,innerHTML:this.getMoreIndicatorText(t),attrs:{role:"button",tabindex:"0","aria-label":this.parent.globalize.formatNumber(t)+" "+this.parent.localeObj.getConstant("moreEvents"),"data-count":t.toString(),"data-start-date":i.getTime().toString(),"data-end-date":n.getTime().toString()}})},i.prototype.getMoreIndicatorText=function(e){return"+"+this.parent.globalize.formatNumber(e)+" "+(this.parent.isAdaptive?"":this.parent.localeObj.getConstant("more"))},i.prototype.removeHeightProperty=function(e){for(var t=0,i=[].slice.call(this.element.querySelectorAll("."+e+" tbody tr"));t<i.length;t++){i[t].firstElementChild.style.height=""}},i.prototype.setMaxEventHeight=function(t,i){var n=Ie(i.querySelector("."+ui)),r=i.offsetHeight-n-(this.maxHeight?0:this.moreIndicatorHeight);(0,e.setStyleAttribute)(t,{height:r+"px","align-items":"center"})},i.prototype.destroy=function(){this.element=null,this.fields=null,this.maxHeight=null,this.withIndicator=null,this.maxOrIndicator=null,this.moreIndicatorHeight=null,this.removeEventListener(),t.prototype.destroy.call(this)},i}(Aa),Ha=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Pa=function(t){function i(e,i){var n=t.call(this,e)||this;n.startHour=n.parent.activeView.getStartHour(),n.endHour=n.parent.activeView.getEndHour(),n.slotCount=n.parent.activeViewOptions.timeScale.slotCount,n.interval=n.parent.activeViewOptions.timeScale.interval,n.day=0,n.rowIndex=0,n.cellTops=[],n.renderType=i,n.eventContainers=[].slice.call(n.element.querySelectorAll("."+Gt));var r=[].slice.call(n.element.querySelectorAll("."+Je+" tbody tr"));return n.dayLength=0===r.length?0:r[0].children.length,n.content=n.parent.element.querySelector("."+Qe+"."+Je),n}return Ha(i,t),i.prototype.getSlotDates=function(){if(this.slots=[],this.slots.push(this.parent.activeView.renderDates.map((function(e){return+e}))),this.parent.activeViewOptions.headerRows.length>0&&"Hour"!==this.parent.activeViewOptions.headerRows.slice(-1)[0].option){this.renderType="day";var e=this.content.querySelector("."+$e);this.cellWidth=this.parent.getElementWidth(e)/+(e.getAttribute("colspan")||1),this.slotsPerDay=1}else this.slotsPerDay=this.dayLength/this.dateRender.length},i.prototype.getOverlapEvents=function(e,t){var i=[];if("day"===this.renderType)for(var n=0,r=t;n<r.length;n++){ve((o=r[n])[this.fields.startTime]).getTime()<=ve(new Date(e.getTime())).getTime()&&ve(o[this.fields.endTime]).getTime()>=ve(new Date(e.getTime())).getTime()&&i.push(o)}else for(var a=0,s=t;a<s.length;a++){var o,l=(o=s[a]).data;(l.trimStartTime.getTime()<=e.getTime()&&l.trimEndTime.getTime()>e.getTime()||l.trimStartTime.getTime()===e.getTime()&&l.trimEndTime.getTime()===e.getTime())&&i.push(o)}return i},i.prototype.getSortComparerIndex=function(e,t){var i=-1,n=this.renderedEvents;if(n.length>0){var r=this.getOverlapSortComparerEvents(e,t,n).map((function(e){return e.Index}));i=r.length>0?this.getSmallestMissingNumber(r):0}return-1===i?0:i},i.prototype.getOverlapSortComparerEvents=function(e,t,i){for(var n=[],r=function(i){if("day"===a.renderType){var r=ve(e).getTime(),s=ve(t).getTime(),o=ve(i[a.fields.startTime]).getTime(),l=ve(i[a.fields.endTime]).getTime();(o<=r&&l>=r||(c=s-(me(t)<=0?ie:0),l>=(c=r>c?r:c)&&o<=c)||o>r&&l<s)&&n.push(i)}else{var p=i.data;(p.trimStartTime.getTime()<=e.getTime()&&e.getTime()<p.trimEndTime.getTime()||e.getTime()<=p.trimStartTime.getTime()&&p.trimStartTime.getTime()<t.getTime())&&n.push(i)}var c},a=this,s=0,o=i;s<o.length;s++){r(o[s])}return n},i.prototype.renderResourceEvents=function(){this.removeHeightProperty(Tt);var e="."+Tt+" tbody tr";this.addCellHeight(e,this.eventHeight,2,this.moreIndicatorHeight,0,!1);var t=this.parent.uiStateValues.isGroupAdaptive?[this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]]:this.parent.resourceBase.renderedResources;if(this.parent.crudModule&&this.parent.crudModule.crudObj.isCrudAction){for(var i=0,n=this.parent.crudModule.crudObj.sourceEvent.length;i<n;i++){var r=this.parent.crudModule.crudObj.sourceEvent[parseInt(i.toString(),10)];if(this.rowIndex=r.groupIndex,(!this.parent.uiStateValues.isGroupAdaptive||this.parent.uiStateValues.groupIndex===r.groupIndex&&this.parent.uiStateValues.isGroupAdaptive)&&this.renderEventsHandler(this.parent.activeView.renderDates,this.parent.activeViewOptions.workDays,r),this.parent.crudModule.crudObj.targetEvent[parseInt(i.toString(),10)]&&this.parent.crudModule.crudObj.sourceEvent[parseInt(i.toString(),10)].groupIndex!==this.parent.crudModule.crudObj.targetEvent[parseInt(i.toString(),10)].groupIndex){var a=this.parent.crudModule.crudObj.targetEvent[parseInt(i.toString(),10)];this.rowIndex=a.groupIndex,this.renderEventsHandler(this.parent.activeView.renderDates,this.parent.activeViewOptions.workDays,a)}}this.parent.crudModule.crudObj.isCrudAction=!1}else for(i=0;i<t.length;i++)this.rowIndex=i,this.renderEventsHandler(this.parent.activeView.renderDates,this.parent.activeViewOptions.workDays,t[parseInt(i.toString(),10)])},i.prototype.renderEvents=function(t,i,n){var r=t[this.fields.startTime],a=t[this.fields.endTime];if(!(r.getTime()<this.parent.minDate.getTime()||a.getTime()>this.parent.maxDate.getTime())){var s=t.data;r=this.getStartTime(t,s),a=this.getEndTime(t,s);var o=De(t[this.fields.startTime],this.startHour,this.endHour),l=this.updateEventMinimumDuration(o,r,a);if(r=l.startDate,a=l.endDate,this.day=this.parent.getIndexOfDate(this.dateRender,ve(new Date(r.getTime()))),!(this.day<0)){var p=this.getCellTd(),c=this.parent.rowAutoHeight?1:this.parent.activeViewOptions.maxEventsPerRow,h=(0,e.isNullOrUndefined)(this.parent.eventSettings.sortComparer)?this.getIndex(r):this.getSortComparerIndex(r,a);t.Index=h;var d=this.eventHeight,u=s.count,g=(0,e.extend)({},t,null,!0);g[this.fields.startTime]=s[this.fields.startTime],g[this.fields.endTime]=s[this.fields.endTime];var v=De(ve(new Date(this.dateRender[this.day].getTime())),this.startHour,this.endHour),m=!0;if(m=!(!this.isDayProcess()&&!g[this.fields.isAllDay])||this.isValidEvent(g,r,a,v),r<=a&&m){var f=this.getEventWidth(r,a,t[this.fields.isAllDay],u);f="day"===this.renderType?f-2:f;var y,T,w=this.getPosition(r,a,t[this.fields.isAllDay],this.day);f=f<=0?this.cellWidth:f,this.renderedEvents.push((0,e.extend)({},t,null,!0)),(0,e.isNullOrUndefined)(this.cellTops[parseInt(i.toString(),10)])&&(this.cellTops[parseInt(i.toString(),10)]=this.getRowTop(i));var D=this.cellTops[parseInt(i.toString(),10)],b=D+(this.maxHeight?0:2)+h*(d+2);y=this.parent.enableRtl?0:w,T=this.parent.enableRtl?w:0;var S=(h+1)*(d+2)+this.moreIndicatorHeight,C=!this.parent.activeViewOptions.maxEventsPerRow||this.parent.rowAutoHeight||this.parent.eventSettings.enableIndicator?this.maxOrIndicator?h<1:this.cellHeight>S:h<c;if(this.parent.rowAutoHeight||C){var O=void 0;if(O=(0,e.isNullOrUndefined)(this.inlineValue)?this.createAppointmentElement(t,i):this.parent.inlineModule.createInlineAppointmentElement(),this.applyResourceColor(O,t,"backgroundColor",this.groupOrder),(0,e.setStyleAttribute)(O,{width:f+"px",left:y+"px",right:T+"px",top:b+"px"}),this.wireAppointmentEvents(O,t),this.parent.rowAutoHeight){var E=this.parent.element.querySelector("."+ri),x=this.parent.getElementWidth(E),V=E.offsetHeight===E.clientHeight&&E.offsetWidth===E.clientWidth;this.renderEventElement(t,O,p);var A=this.getFirstChild(i);this.updateCellHeight(A,S),V&&(E.offsetWidth>E.clientWidth||x!==this.parent.getElementWidth(E))&&this.adjustAppointments(x)}else this.renderEventElement(t,O,p)}else for(var I=0;I<u;I++){var M=p.querySelector("."+Bi),k=this.parent.enableRtl?T:y;k=Math.floor(k/this.cellWidth)*this.cellWidth;var R=this.interval/this.slotCount,H="TimelineMonth"===this.parent.activeViewOptions.option||"day"===this.renderType||0!==I?new Date(this.dateRender[this.day+I].getTime()):new Date(r),P=ye(this.dateRender[this.day+I],1);if("TimelineMonth"===this.parent.activeViewOptions.option||"day"===this.renderType){var j=this.getPosition(H,P,t[this.fields.isAllDay],this.day+I);this.renderTimelineMoreIndicator(r,H,P,d,R,i,n,D,y,T,p,M,k,j)}else for(var N=(Re(a)-Re(r))/ne*this.slotCount/this.interval,L=0;L<N&&(H=0===L?new Date(H.getTime()):new Date(H.getTime()+6e4*R),N<1&&(H=this.adjustToNearestTimeSlot(H,R)),P=new Date(H.getTime()+6e4*R),!(N>=1&&P.getTime()>a.getTime()));L++){var q=this.getPosition(H,P,!1,this.day+I);if(k>q)break;k=q,this.renderTimelineMoreIndicator(r,H,P,d,R,i,n,D,y,T,p,M,k,q)}}}this.parent.renderTemplates()}}},i.prototype.adjustToNearestTimeSlot=function(e,t){var i=new Date(e),n=60*i.getHours()*60*1e3+60*i.getMinutes()*1e3,r=Math.floor(n/(60*t*1e3))*(60*t*1e3),a=new Date(i.getTime());return a.setHours(r/36e5%24),a.setMinutes(r%36e5/6e4),a},i.prototype.renderTimelineMoreIndicator=function(t,i,n,r,a,s,o,l,p,c,h,d,u,g){if(p=this.parent.enableRtl?c=g:g,u=this.parent.enableRtl?c:p,u=Math.floor(u/this.cellWidth)*this.cellWidth,h&&(0,e.isNullOrUndefined)(d)||!this.isAlreadyAvail(u,h)){var v="TimelineMonth"===this.parent.activeViewOptions.option||"day"===this.renderType?new Date(+t):i,m=new Date(v.setMinutes(Math.floor(v.getMinutes()/a)*a)),f=new Date(m.getTime()+6e4*a),y=void 0;this.parent.activeViewOptions.group.resources.length>0&&!(0,e.isNullOrUndefined)(s)&&(y=s.toString());var T=this.getFilterEvents(i,n,m,f,y,o),w=this.cellHeight-this.moreIndicatorHeight;r=this.withIndicator?w-2:r;var D=Math.floor(w/(r+2)),b=this.parent.activeViewOptions.maxEventsPerRow&&!this.parent.eventSettings.enableIndicator?T.length-this.parent.activeViewOptions.maxEventsPerRow:T.length-D<=0?1:T.length-D,S=void 0;S="day"===this.renderType?this.getMoreIndicatorElement(b,i,n):this.getMoreIndicatorElement(b,m,f),(0,e.isNullOrUndefined)(y)||S.setAttribute("data-group-index",y),S.style.top=l+w+"px",S.style.width=this.cellWidth+"px",S.style.left=Math.floor(p/this.cellWidth)*this.cellWidth+"px",S.style.right=Math.floor(c/this.cellWidth)*this.cellWidth+"px",this.renderElement(h,S),e.EventHandler.add(S,"click",this.moreIndicatorClick,this)}},i.prototype.updateCellHeight=function(t,i){if(i>(""===t.style.height?this.cellHeight:parseInt(t.style.height,10))){if((0,e.setStyleAttribute)(t,{height:i+"px"}),this.parent.activeViewOptions.group.resources.length>0){var n=this.parent.element.querySelector("."+Tt+' tbody td[data-group-index="'+t.getAttribute("data-group-index")+'"]');n&&(0,e.setStyleAttribute)(n,{height:i+"px"})}var r=this.parent.element.querySelector(".e-month-header-wrapper table tr:nth-child("+(t.parentElement.rowIndex+1)+") td");r&&(0,e.setStyleAttribute)(r,{height:i+"px"})}},i.prototype.getFirstChild=function(e){var t="."+Je+" tbody td",i="";return this.parent.activeViewOptions.group.resources.length>0&&(i='[data-group-index="'+e.toString()+'"]'),this.parent.element.querySelector(t+i)},i.prototype.updateBlockElements=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll("."+Qt));e<t.length;e++){var i=t[e],n=parseInt(i.getAttribute("data-group-index"),10),r=this.getFirstChild(n);i.style.height=r.offsetHeight+"px";var a=i.offsetWidth/r.offsetWidth;i.style.width=r.offsetWidth*a+"px"}for(var s=0,o=[].slice.call(this.element.querySelectorAll("."+Kt));s<o.length;s++){i=o[s],n=parseInt(i.getAttribute("data-group-index"),10);i.style.top=this.getRowTop(n)+this.getFirstChild(n).offsetHeight-18+"px"}},i.prototype.getStartTime=function(e,t){var i=e[this.fields.startTime],n=De(i,this.startHour,this.endHour);return i=this.isDayProcess()?e[this.fields.startTime]:n.startHour.getTime()>=t[this.fields.startTime]?n.startHour:n.endHour.getTime()<=t[this.fields.startTime]?this.getNextDay(n.startHour,t):t[this.fields.startTime],t.trimStartTime=e[this.fields.isAllDay]?n.startHour:t[this.fields.startTime],i},i.prototype.getNextDay=function(e,t){for(var i,n=1;n<=this.dateRender.length;n++)if(i=ye(e,n),-1!==this.parent.getIndexOfDate(this.dateRender,ve(new Date(e.getTime()))))return t.count=t.count-1,i;return i},i.prototype.getEndTime=function(e,t){var i=e[this.fields.endTime],n=De(i,this.startHour,this.endHour);return this.isDayProcess()?i=t[this.fields.endTime]:(i=t[this.fields.endTime],(n.endHour.getTime()<=t[this.fields.endTime]||e[this.fields.isAllDay])&&(i=n.endHour),n.startHour.getTime()>=t[this.fields.endTime].getTime()&&!e[this.fields.isAllDay]&&(i=this.getPreviousDay(n.startHour,n.endHour,t))),t.trimEndTime=e[this.fields.isAllDay]?n.endHour:t[this.fields.endTime],i},i.prototype.getPreviousDay=function(e,t,i){for(var n=1;n<=this.dateRender.length;n++){var r=ye(t,-n);if(-1!==this.parent.getIndexOfDate(this.dateRender,ve(new Date(e.getTime())))){(r=ve(new Date(r.getTime()))).setHours(t.getHours(),t.getMinutes(),t.getSeconds());var a=i.count,s=i[this.fields.endTime];return i.count=0!==s.getHours()||0!==s.getMinutes()?a-1:a,r}}return i[this.fields.endTime]},i.prototype.getEventWidth=function(e,t,i,n){return"day"===this.renderType||i?n*this.slotsPerDay*this.cellWidth:this.isSameDay(e,t)?this.getSameDayEventsWidth(e,t):this.getSpannedEventsWidth(e,t,n)},i.prototype.getSameDayEventsWidth=function(e,t){return(Re(t)-Re(e))/ne*(this.cellWidth*this.slotCount)/this.getIntervalInMinutes(e)},i.prototype.getSpannedEventsWidth=function(e,t,i){var n,r=i*this.slotsPerDay*this.cellWidth,a=De(ve(new Date(e.getTime())),this.startHour,this.endHour),s=this.getSameDayEventsWidth(a.startHour,e);if(-1===this.parent.getIndexOfDate(this.dateRender,ve(new Date(t.getTime()))))n=0;else{var o=De(ve(new Date(t.getTime())),this.startHour,this.endHour),l=o.startHour,p=o.endHour,c=this.interval/this.slotCount,h=this.getEndTimeOfLastSlot(l,p,c),d=p<h?p:h;n=this.getSameDayEventsWidth(t,d),n=this.slotsPerDay*this.cellWidth===n?0:n}var u=s+n;return r>u?r-u:r-s},i.prototype.getEndTimeOfLastSlot=function(e,t,i){var n=(t.getTime()-e.getTime())/6e4,r=Math.floor(n/i)*i,a=new Date(e);return a.setMinutes(r),a},i.prototype.isSameDay=function(e,t){return this.parent.getIndexOfDate(this.dateRender,ve(new Date(e.getTime())))===this.parent.getIndexOfDate(this.dateRender,ve(new Date(t.getTime())))},i.prototype.getAppointmentLeft=function(e,t,i){var n=this.isSameDay(t,e.startHour)?(Re(t)-Re(e.startHour))/(ne*this.getIntervalInMinutes(t))*this.slotCount:0;return 0===i?n:Math.round((Re(e.endHour)-Re(e.startHour))/this.interval/ne*this.slotCount)*i+n},i.prototype.getPosition=function(e,t,i,n){if("day"===this.renderType||i)return n*this.slotsPerDay*this.cellWidth;var r=De(ve(new Date(this.dateRender[parseInt(n.toString(),10)].getTime())),this.startHour,this.endHour);return(r.endHour.getTime()<=t.getTime()&&r.startHour.getTime()>=e.getTime()?this.getAppointmentLeft(r,r.startHour,n):r.endHour.getTime()<=t.getTime()?this.getAppointmentLeft(r,e,n):r.startHour.getTime()>=e.getTime()?this.getAppointmentLeft(r,r.startHour,n):this.getAppointmentLeft(r,e,n))*this.cellWidth},i.prototype.getFilterEvents=function(e,t,i,n,r,a){return"day"===this.renderType?this.getFilteredEvents(e,t,r,a):this.getFilteredEvents(i,n,r,a)},i.prototype.getIntervalInMinutes=function(e){if(1!==this.slotsPerDay)return this.interval;var t=De(ve(new Date(e.getTime())),this.startHour,this.endHour);return(t.endHour.getTime()-t.startHour.getTime())/ne},i.prototype.isAlreadyAvail=function(e,t){for(var i=[].slice.call(t.querySelectorAll("."+Bi)),n=0;n<i.length;n++){var r=void 0;if(i&&(r=this.parent.enableRtl?i[parseInt(n.toString(),10)].style.right:i[parseInt(n.toString(),10)].style.left),parseInt(r,10)===Math.floor(e))return!0}return!1},i.prototype.getRowTop=function(e){return this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive?this.parent.element.querySelector("."+ri+' tbody td[data-group-index="'+e.toString()+'"]').offsetTop:0},i.prototype.getCellTd=function(){var e=this.parent.uiStateValues.isGroupAdaptive?0:this.rowIndex;return this.eventContainers[parseInt(e.toString(),10)]},i.prototype.renderBlockIndicator=function(t,i,n){if(!(this.parent.headerRows.length>0&&("Hour"!==this.parent.headerRows[this.parent.headerRows.length-1].option||"Date"!==this.parent.headerRows[this.parent.headerRows.length-1].option)||(i=Math.floor(i/this.cellWidth)*this.cellWidth+this.cellWidth-22,this.isAlreadyAvail(i,t)))){var r=(0,e.createElement)("div",{className:"e-icons "+Kt});this.parent.activeViewOptions.group.resources.length>0&&r.setAttribute("data-group-index",n.toString()),this.parent.enableRtl?r.style.right=i+"px":r.style.left=i+"px",r.style.top=this.getRowTop(n)+this.cellHeight-18+"px",this.renderElement(t,r)}},i.prototype.setMaxEventHeight=function(t,i){(0,e.setStyleAttribute)(t,{height:this.cellHeight-(this.maxHeight?0:2)-(this.maxHeight?0:this.moreIndicatorHeight)+"px"})},i.prototype.isDayProcess=function(){return"TimelineMonth"===this.parent.currentView||!this.parent.activeViewOptions.timeScale.enable||this.parent.activeViewOptions.headerRows.length>0&&"Hour"!==this.parent.activeViewOptions.headerRows.slice(-1)[0].option},i.prototype.destroy=function(){this.renderType=null,this.eventContainers=null,this.dayLength=null,this.content=null,t.prototype.destroy.call(this),this.parent=null},i}(Ra),ja=function(){function t(e){this.parent=e,this.parent.on(A,this.inlineEdit,this)}return t.prototype.inlineEdit=function(e){if(this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide(),"Cell"===e.type){var t=this.parent.element.querySelector("."+en);t&&t.classList.contains(tt)&&this.parent.quickPopup.morePopup.hide(),this.removeInlineAppointmentElement(),this.cellEdit(e)}else this.parent.element.querySelector("."+dr)!==e.element.querySelector("."+dr)&&this.removeInlineAppointmentElement(),this.eventEdit(e)},t.prototype.cellEdit=function(e){var t=this.generateEventData(),i=e.element.cellIndex,n=this.getEventDaysCount(t);n>1&&(n=Math.round(n),i-=--n);var r=ve(new Date(""+t[this.parent.eventFields.startTime])).getTime(),a=ve(new Date(""+t[this.parent.eventFields.endTime])).getTime(),s=e.groupIndex||0,o="Day"===this.parent.currentView||"Week"===this.parent.currentView||"WorkWeek"===this.parent.currentView;if(this.parent.activeViewOptions.timeScale.enable&&o){var l=t[this.parent.eventFields.startTime].getDay();this.createVerticalViewInline(t,l,s,i)}else"Month"===this.parent.currentView||!this.parent.activeViewOptions.timeScale.enable&&o?this.createMonthViewInline(t,s,r,a):this.createTimelineViewInline(t,r,a,s);var p=this.parent.element.querySelector("."+dr);p&&p.focus()},t.prototype.eventEdit=function(t){var i,n=t.element.querySelector("."+dr);if(n)i=n.value;else{var r=t.element.querySelector("."+Cn);if((0,e.isNullOrUndefined)(r)?i=t.data[this.parent.eventFields.subject]:((0,e.addClass)([r],Ge),i=r.innerText),n=this.inlineInputEle=(0,e.createElement)("input",{className:dr,attrs:{value:i}}),(0,e.closest)(t.element,"."+en))t.element.insertBefore(n,r);else if(["Agenda","MonthAgenda"].indexOf(this.parent.currentView)>-1){var a=t.element.querySelector("."+$t);(0,e.isNullOrUndefined)(a)&&(a=(0,e.createElement)("div",{className:$t}),t.element.prepend(a)),a.insertBefore(n,a.firstChild)}else{var s=["TimelineDay","TimelineWeek","TimelineWorkWeek","TimelineMonth"].indexOf(this.parent.currentView)>-1?".e-inner-wrap":".e-appointment-details",o=t.element.querySelector(s);(0,e.isNullOrUndefined)(o)?t.element.querySelector(".e-appointment-details").prepend(n):o.prepend(n)}n.focus()}n.setSelectionRange(i.length,i.length)},t.prototype.createVerticalViewInline=function(e,t,i,n){var r,a=this.getEventDaysCount(e),s=new Ma(this.parent);s.initializeValues();var o=s.dateRender[parseInt(i.toString(),10)].map((function(e){return e.getDay()})).indexOf(t);if(a>=1){s.allDayElement=[].slice.call(this.parent.element.querySelectorAll("."+Ke)),(r=s.slots).push.apply(r,this.parent.activeView.renderDates.map((function(e){return+e})));var l=[].slice.call(this.parent.element.querySelectorAll("."+ji)),p=0;l.length>0&&(p=Math.floor(this.parent.getElementHeight(this.parent.element.querySelector("."+Ze))/l[0].offsetHeight)-1),s.allDayLevel=p;var c=this.parent.getElementHeightFromClass(this.parent.element.querySelector("."+Pi),Xt),h=s.allDayElement.length>0?s.allDayElement[0].offsetTop:0;s.renderAllDayEvents(e,o,i,n,this.parent.allowInline,h,c)}else s.renderNormalEvents(e,o,i,n,this.parent.allowInline)},t.prototype.createMonthViewInline=function(e,t,i,n){var r=this.getEventDaysCount(e),a=this.parent.eventBase.cloneEventObject(e,i,n,r,!1,!1),s=new Ra(this.parent);s.dateRender=this.parent.activeView.renderDates,s.inlineValue=this.parent.allowInline;var o=this.parent.activeView.renderDates,l=this.parent.activeViewOptions.workDays,p="."+$e;if(this.parent.activeViewOptions.group.resources.length>0){p+='[data-group-index="'+t+'"]';var c=this.parent.resourceBase.lastResourceLevel[parseInt(t.toString(),10)];o=c.renderDates,l=c.workDays}s.dateRender=o,s.workCells=[].slice.call(this.parent.element.querySelectorAll(p)),s.cellWidth=s.workCells[0].offsetWidth,s.cellHeight=s.workCells[0].offsetHeight,s.eventHeight=this.parent.getElementHeightFromClass(this.parent.monthModule.element||s.element,Xt),s.getSlotDates(l);for(var h=s.getRenderedDates(o),d=0,u=s.splitEvent(a,h||o);d<u.length;d++){var g=u[d];s.renderEvents(g,t)}this.parent.element.querySelector("."+dr).focus()},t.prototype.createTimelineViewInline=function(e,t,i,n){var r=this.getEventDaysCount(e),a=this.parent.eventBase.cloneEventObject(e,t,i,r,!1,!1),s=new Pa(this.parent,this.parent.activeViewOptions.timeScale.enable?"hour":"day");s.dateRender=this.parent.activeView.renderDates,s.eventContainers=[].slice.call(this.parent.element.querySelectorAll("."+Gt));var o=this.parent.element.querySelector("."+$e);s.inlineValue=this.parent.allowInline,s.cellWidth=o.offsetWidth,s.cellHeight=o.offsetHeight;var l=0===this.parent.element.querySelectorAll("."+Je+" tbody tr").length?0:this.parent.element.querySelectorAll("."+Je+" tbody tr")[0].children.length;s.slotsPerDay=l/s.dateRender.length,s.eventHeight=this.parent.getElementHeightFromClass(s.element,Xt),s.renderEvents(a,n)},t.prototype.getEventDaysCount=function(e){var t=e[this.parent.eventFields.startTime],i=e[this.parent.eventFields.endTime];return Math.abs(i.getTime()-t.getTime())/ie},t.prototype.generateEventData=function(e){var t=this.parent.element.querySelector("."+dr),i=t?t.value:e?e.innerHTML:"",n={};return n[this.parent.eventFields.id]=this.parent.eventBase.getEventMaxID(),n[this.parent.eventFields.subject]=i,n[this.parent.eventFields.startTime]=this.parent.activeCellsData.startTime,n[this.parent.eventFields.endTime]=this.parent.activeCellsData.endTime,n[this.parent.eventFields.isAllDay]=this.parent.activeCellsData.isAllDay,this.parent.eventWindow.setDefaultValueToObject(n),this.parent.resourceBase&&this.parent.resourceBase.setResourceValues(n,this.parent.activeCellsData.groupIndex),n},t.prototype.documentClick=function(e){e&&""!==e.value?this.inlineCrudActions(e):this.removeInlineAppointmentElement()},t.prototype.inlineCrudActions=function(t){if((0,e.closest)(t,"."+ur)){var i=this.generateEventData(t);this.parent.addEvent(i)}else{var n=(0,e.closest)(t,"."+Xt),r=this.parent.getEventDetails(n);r[this.parent.eventFields.subject]=t.value;var a=void 0;r[this.parent.eventFields.id]===r[this.parent.eventFields.recurrenceID]&&(a="EditOccurrence",r[this.parent.eventFields.id]=this.parent.eventBase.getEventMaxID()),this.parent.saveEvent(r,a)}this.removeInlineAppointmentElement()},t.prototype.createInlineAppointmentElement=function(t){var i=(0,e.createElement)("div",{className:Xt+" "+ur}),n=(0,e.createElement)("div",{className:Jt});i.appendChild(n);var r=this.inlineInputEle=(0,e.createElement)("input",{className:dr});return n.appendChild(r),t&&this.parent.eventBase.applyResourceColor(i,t,"backgroundColor"),i},t.prototype.removeInlineAppointmentElement=function(){var t=[].slice.call(this.parent.element.querySelectorAll("."+ur));t.length>0&&t.forEach((function(t){var i=t.querySelector("."+dr);(0,e.isNullOrUndefined)(i)||i.blur(),(0,e.remove)(t)}));var i=this.getInlineElement();if(i){var n=(0,e.closest)(i,"."+Xt).querySelector("."+Cn);(0,e.isNullOrUndefined)(n)||(0,e.removeClass)([n],Ge),(0,e.remove)(i)}this.inlineInputEle=null},t.prototype.getInlineElement=function(){return this.inlineInputEle},t.prototype.destroy=function(){this.inlineInputEle=null,this.parent.off(A,this.inlineEdit)},t}(),Na=d(741),La=d(323),qa=function(){function t(){}return t.prototype.renderFormValidator=function(e,t,i,n){var r=this;this.element=i,this.formObj=new La.FormValidator(e,{locale:n,customPlacement:function(e,t){r.errorPlacement(e,t)},rules:t,validationComplete:function(e){r.validationComplete(e)},focusout:function(e){r.focusOut(e)}})},t.prototype.focusOut=function(e){var t=e.relatedTarget;t&&(t.classList.contains("e-dlg-closeicon-btn")||t.classList.contains("e-close")||t.classList.contains(Ke)||t.classList.contains(rt)||t.classList.contains(Qi)||t.classList.contains($e)||t.classList.contains(Pn))?this.ignoreError=!0:this.ignoreError=!1},t.prototype.validationComplete=function(e){var t=this.element.querySelector("#"+e.inputName+"_Error");t&&(t.style.display="failure"===e.status?"":"none")},t.prototype.errorPlacement=function(t,i){var n=i.getAttribute("for"),r=this.element.querySelector("#"+n+"_Error");r||this.ignoreError||this.createTooltip(t,i,n,""),(0,e.isNullOrUndefined)(r)||(r.querySelector(".e-error").innerHTML=i.innerHTML)},t.prototype.createTooltip=function(t,i,n,r){var a,s,o=t.getBoundingClientRect();this.element.classList.contains(Kn)?(a=this.element,s=this.element.getBoundingClientRect()):s=(a=this.element.querySelector(".e-schedule-dialog .e-dlg-content")).getBoundingClientRect();var l=(0,e.createElement)("div",{className:"e-tooltip-wrap e-popup "+Yn,id:n+"_Error",styles:"display:"+r+";top:"+(o.bottom-s.top+a.scrollTop+9)+"px;left:"+(o.left-s.left+a.scrollLeft+o.width/2)+"px;"}),p=(0,e.createElement)("div",{className:"e-tip-content"});p.appendChild(i);var c=(0,e.createElement)("div",{className:"e-arrow-tip e-tip-top"});c.appendChild((0,e.createElement)("div",{className:"e-arrow-tip-outer e-tip-top"})),c.appendChild((0,e.createElement)("div",{className:"e-arrow-tip-inner e-tip-top"})),l.appendChild(p),l.appendChild(c),a.appendChild(l),l.style.left=parseInt(l.style.left,10)-l.offsetWidth/2+"px"},t.prototype.destroyToolTip=function(){if(this.element)for(var t=0,i=[].slice.call(this.element.querySelectorAll("."+Yn));t<i.length;t++){var n=i[t];(0,e.remove)(n)}this.formObj&&this.formObj.element&&this.formObj.reset()},t.prototype.destroy=function(){this.formObj&&this.formObj.element&&!this.formObj.isDestroyed&&this.formObj.destroy(),this.formObj=null,this.element=null},t}(),Fa=function(){function i(e){this.isMultipleEventSelect=!1,this.isCrudAction=!1,this.parent=e,this.l10n=this.parent.localeObj,this.fieldValidator=new qa,this.render(),this.addEventListener()}return i.prototype.render=function(){this.renderQuickPopup(),this.renderMorePopup(),this.renderQuickDialog()},i.prototype.renderQuickPopup=function(){var i=(0,e.createElement)("div",{className:Kn+" e-popup-close",attrs:{role:"dialog"}});this.parent.isAdaptive?(document.body.appendChild(i),(0,e.addClass)([i],Be)):this.parent.element.appendChild(i),this.quickPopup=new t.Popup(i,{targetType:this.parent.isAdaptive?"container":"relative",enableRtl:this.parent.enableRtl,open:this.quickPopupOpen.bind(this),close:this.quickPopupClose.bind(this),hideAnimation:this.parent.isAdaptive?{name:"ZoomOut"}:{name:"FadeOut",duration:150},showAnimation:this.parent.isAdaptive?{name:"ZoomIn"}:{name:"FadeIn",duration:150},collision:this.parent.isAdaptive?{X:"fit",Y:"fit"}:this.parent.enableRtl?{X:"flip",Y:"fit"}:{X:"none",Y:"fit"},position:this.parent.isAdaptive||this.parent.enableRtl?{X:"left",Y:"top"}:{X:"right",Y:"top"},viewPortElement:this.parent.isAdaptive?document.body:this.parent.element,zIndex:this.parent.isAdaptive?1004:3})},i.prototype.renderMorePopup=function(){var i='<div class="'+tn+'"><div class="e-more-event-header"><div class="'+sn+'" title="'+this.l10n.getConstant("close")+'" tabindex="0" role="button"></div><div class="'+nn+'"><div class="'+rn+'" id="'+this.parent.element.id+'_more_popup"></div><div class="'+an+" "+di+'" tabindex="0" role="link"></div></div></div></div>',n=(0,e.createElement)("div",{className:en+" e-popup-close",innerHTML:i});this.parent.isAdaptive?(document.body.appendChild(n),(0,e.addClass)([n],Be)):this.parent.element.appendChild(n),this.morePopup=new t.Popup(n,{targetType:this.parent.isAdaptive?"container":"relative",enableRtl:this.parent.enableRtl,hideAnimation:{name:"ZoomOut",duration:300},showAnimation:{name:"ZoomIn",duration:300},open:this.morePopupOpen.bind(this),close:this.morePopupClose.bind(this),collision:this.parent.isAdaptive?{X:"fit",Y:"fit"}:this.parent.enableRtl?{X:"flip",Y:"fit"}:{X:"flip",Y:"flip"},viewPortElement:this.parent.isAdaptive?document.body:this.parent.element,zIndex:this.parent.isAdaptive?1002:2}),this.morePopup.element.setAttribute("role","dialog"),this.morePopup.element.setAttribute("aria-labelledby",this.parent.element.id+"_more_popup");var r=this.morePopup.element.querySelector("."+sn);this.renderButton("e-round",Ye+" "+zn,!1,r,this.closeClick),e.EventHandler.add(this.morePopup.element.querySelector("."+an),"click",this.navigationClick,this)},i.prototype.renderQuickDialog=function(){var i=[{buttonModel:{cssClass:"e-quick-alertok e-flat",isPrimary:!0},click:this.dialogButtonClick.bind(this)},{buttonModel:{cssClass:"e-quick-alertcancel e-flat",isPrimary:!1},click:this.dialogButtonClick.bind(this)},{buttonModel:{cssClass:"e-quick-dialog-cancel e-disable e-flat",isPrimary:!1},click:this.dialogButtonClick.bind(this)}];if(this.parent.eventSettings.editFollowingEvents){var n={buttonModel:{cssClass:"e-quick-alertfollowing e-flat",isPrimary:!1},click:this.dialogButtonClick.bind(this)};i.splice(1,0,n)}this.quickDialog=new t.Dialog({animationSettings:{effect:"Zoom"},buttons:i,cssClass:"e-quick-dialog",closeOnEscape:!0,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,beforeClose:this.beforeQuickDialogClose.bind(this),isModal:!0,position:{X:"center",Y:"center"},showCloseIcon:!0,target:document.body,visible:!1,width:"auto"});var r=(0,e.createElement)("div",{id:this.parent.element.id+"QuickDialog"});this.parent.element.appendChild(r),this.quickDialog.appendTo(r);var a=this.quickDialog.element.querySelector("."+vn);a&&(a.setAttribute("aria-label",this.l10n.getConstant("occurrence")),a.setAttribute("aria-label",a.innerHTML));var s=this.quickDialog.element.querySelector("."+mn);s&&(s.setAttribute("aria-label",this.l10n.getConstant("series")),s.setAttribute("aria-label",s.innerHTML)),this.quickDialog.element.querySelector(".e-dlg-closeicon-btn")&&this.quickDialog.element.querySelector(".e-dlg-closeicon-btn").setAttribute("title",this.l10n.getConstant("close"))},i.prototype.renderButton=function(t,i,n,r,a){new Na.Button({cssClass:t,disabled:n,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,iconCss:i}).appendTo(r),e.EventHandler.add(r,"click",a,this),(0,e.removeClass)([r],Ye)},i.prototype.quickDialogClass=function(t){var i=[pn,cn,un,gn,yn,Ge],n=this.quickDialog.element.querySelector("."+vn),r=this.quickDialog.element.querySelector("."+mn),a=this.quickDialog.element.querySelector("."+fn);switch((0,e.removeClass)([n,r],i),(0,e.addClass)([this.quickDialog.element.querySelector("."+gn)],Ge),this.parent.eventSettings.editFollowingEvents&&((0,e.addClass)([a],Ge),(0,e.removeClass)([this.quickDialog.element],dn)),t){case"Recurrence":(0,e.addClass)([n],pn),(0,e.addClass)([r],cn),this.parent.eventSettings.editFollowingEvents&&((0,e.removeClass)([a],Ge),(0,e.addClass)([this.quickDialog.element],dn),(0,e.addClass)([a],hn));break;case"Delete":(0,e.addClass)([n],un),(0,e.addClass)([r],gn);break;case"Alert":(0,e.addClass)([n],[vn,yn]),(0,e.addClass)([r],[mn,Ge])}},i.prototype.applyFormValidation=function(){var e=this.quickPopup.element.querySelector("."+wn),t={};t[this.parent.eventSettings.fields.subject.name]=this.parent.eventSettings.fields.subject.validation,this.fieldValidator.renderFormValidator(e,t,this.quickPopup.element,this.parent.locale)},i.prototype.openRecurrenceAlert=function(){var e=this.quickDialog.element.querySelector("."+vn);e&&(e.innerHTML=this.l10n.getConstant("Delete"===this.parent.currentAction?"deleteEvent":"editEvent"),e.setAttribute("aria-label",e.innerHTML));var t=this.quickDialog.element.querySelector("."+fn);t&&(t.innerHTML=this.l10n.getConstant("editFollowingEvent"),t.setAttribute("aria-label",t.innerHTML));var i=this.quickDialog.element.querySelector("."+mn);i&&(i.innerHTML=this.l10n.getConstant("Delete"===this.parent.currentAction?"deleteSeries":"editSeries"),i.setAttribute("aria-label",i.innerHTML)),this.quickDialog.content=this.l10n.getConstant("editContent"),this.quickDialog.header=this.l10n.getConstant("Delete"===this.parent.currentAction?"deleteTitle":"editTitle"),this.quickDialogClass("Recurrence"),this.showQuickDialog("RecurrenceAlert")},i.prototype.openRecurrenceValidationAlert=function(t){this.quickDialogClass("Alert");var i=this.quickDialog.element.querySelector("."+vn);i.innerHTML=this.l10n.getConstant("ok"),i.setAttribute("aria-label",i.innerHTML);var n,r=this.quickDialog.element.querySelector("."+mn);switch(r.innerHTML=this.l10n.getConstant("cancel"),r.setAttribute("aria-label",r.innerHTML),this.quickDialog.header=this.l10n.getConstant("alert"),t){case"wrongPattern":(0,e.addClass)([r],Ge),this.quickDialog.content=this.l10n.getConstant("wrongPattern");break;case"createError":(0,e.addClass)([r],Ge),this.quickDialog.content=this.l10n.getConstant("createError");break;case"sameDayAlert":(0,e.addClass)([r],Ge),this.quickDialog.content=this.l10n.getConstant("sameDayAlert");break;case"seriesChangeAlert":n=this.quickDialog.element.querySelector("."+gn),(0,e.removeClass)([r,n],Ge),this.quickDialog.content=this.l10n.getConstant("seriesChangeAlert"),i.innerHTML=this.l10n.getConstant("yes"),r.innerHTML=this.l10n.getConstant("no"),n.innerHTML=this.l10n.getConstant("cancel");break;case"occurrenceAlert":(0,e.addClass)([r],Ge),this.quickDialog.content=this.l10n.getConstant("occurenceAlert")}(!this.parent.enableRecurrenceValidation&&"wrongPattern"===t||this.parent.enableRecurrenceValidation)&&this.showQuickDialog("RecurrenceValidationAlert")},i.prototype.openDeleteAlert=function(){if(!this.parent.activeViewOptions.readonly){var e=this.quickDialog.element.querySelector("."+vn);e&&(e.innerHTML=this.l10n.getConstant("delete"),e.setAttribute("aria-label",e.innerHTML));var t=this.quickDialog.element.querySelector("."+mn);t&&(t.innerHTML=this.l10n.getConstant("cancel"),t.setAttribute("aria-label",t.innerHTML)),this.quickDialog.content=this.parent.activeEventData.event.length>1?this.l10n.getConstant("deleteMultipleContent"):this.l10n.getConstant("deleteContent"),this.quickDialog.header=this.parent.activeEventData.event.length>1?this.l10n.getConstant("deleteMultipleEvent"):this.l10n.getConstant("deleteEvent"),this.quickDialogClass("Delete"),this.showQuickDialog("DeleteAlert")}},i.prototype.openValidationError=function(e,t){this.quickDialog.header=this.l10n.getConstant("alert"),this.quickDialog.content=this.l10n.getConstant(e);var i=this.quickDialog.element.querySelector("."+vn);i&&(i.innerHTML=this.l10n.getConstant("ok"),i.setAttribute("aria-label",i.innerHTML));var n=this.quickDialog.element.querySelector("."+mn);n&&(n.innerHTML=this.l10n.getConstant("cancel"),i.setAttribute("aria-label",n.innerHTML)),this.quickDialogClass("Alert"),this.showQuickDialog("overlapAlert"===e?"OverlapAlert":"ValidationAlert",t)},i.prototype.showQuickDialog=function(t,i){var n=this;this.quickDialog.dataBind();var r={type:t,cancel:!1,element:this.quickDialog.element,data:(0,e.extend)({},i||this.parent.activeEventData.event,null,!0)};this.parent.activeViewOptions.allowOverlap||(r.overlapEvents=this.parent.overlapAppointments),this.parent.trigger(D,r,(function(e){e.cancel||n.quickDialog.show()}))},i.prototype.createMoreEventList=function(t,i,n){var r=this,a=this.parent.eventFields,s=(0,e.createElement)("div",{className:on}),o=(0,e.createElement)("div",{className:ln});if(0===t.length)o=(0,e.createElement)("div",{className:on,innerHTML:this.l10n.getConstant("emptyContainer")});else for(var l=function(t){var s=t[a.subject]||p.parent.eventSettings.fields.subject.default||p.parent.localeObj.getConstant("addTitle"),l=(0,e.createElement)("div",{className:Xt,attrs:{"data-id":""+t[a.id],"data-guid":t.Guid,role:"button",tabindex:"0","aria-disabled":p.parent.eventBase.getReadonlyAttribute(t),"aria-label":p.parent.getAnnouncementString(t)}});t[a.isReadonly]&&(0,e.addClass)([l],"e-read-only");var c=void 0;if((0,e.isNullOrUndefined)(p.parent.activeViewOptions.eventTemplate))l.appendChild((0,e.createElement)("div",{className:Cn})),p.parent.sanitize(s,l.firstElementChild);else{var h=p.parent.element.id+"_"+p.parent.activeViewOptions.eventTemplateName+"eventTemplate";c=p.parent.getAppointmentTemplate()(t,p.parent,"eventTemplate",h,!1,void 0,void 0,p.parent.root),(0,e.append)(c,l)}if((0,e.isNullOrUndefined)(n)||l.setAttribute("data-group-index",n),!(0,e.isNullOrUndefined)(t[a.recurrenceRule])){var d=t[a.id]===t[a.recurrenceID]?ki:Ri;l.appendChild((0,e.createElement)("div",{className:Ye+" "+d}))}var u={data:(0,e.extend)({},t,null,!0),element:l,cancel:!1};p.parent.trigger(y,u,(function(e){if(!e.cancel){o.appendChild(l);var n=r.parent.isAdaptive||"Year"===r.parent.currentView;r.parent.eventBase.wireAppointmentEvents(l,t,n),r.parent.eventBase.applyResourceColor(l,t,"backgroundColor",i)}}))},p=this,c=0,h=t;c<h.length;c++){l(h[c])}return s.appendChild(o),s},i.prototype.tapHoldEventPopup=function(t){var i=(0,e.closest)(t.target,"."+Xt);this.parent.selectedElements=[],this.isMultipleEventSelect=!0,this.parent.eventBase.getSelectedEventElements(i),this.parent.activeEventData=this.parent.eventBase.getSelectedEvents();var n=i.getAttribute("data-guid"),r=this.parent.eventBase.getEventByGuid(n);if(!(0,e.isNullOrUndefined)(r)){var a=r[this.parent.eventFields.subject]||this.l10n.getConstant("noTitle"),s='<div class="e-multiple-event-popup"><div class="'+Yi+'"><button class="'+Wn+'" title="'+this.l10n.getConstant("close")+'"></button><div class="'+Cn+'">'+a+'</div><button class="'+qn+'" title="'+this.l10n.getConstant("edit")+'"></button><button class="'+Un+'" title="'+this.l10n.getConstant("delete")+'"></button></div></div>';this.quickPopup.element.innerHTML=s;var o=this.quickPopup.element.querySelector("."+Wn);this.renderButton("e-flat e-round e-small",Ye+" "+zn,!1,o,this.closeClick);var l=this.parent.activeViewOptions.readonly||r[this.parent.eventFields.isReadonly],p=!this.parent.eventSettings.allowEditing||l,c=!this.parent.eventSettings.allowDeleting||l,h=this.quickPopup.element.querySelector("."+qn);h&&this.renderButton("e-flat e-round e-small",Ye+" "+Fn,p,h,this.editClick);var d=this.quickPopup.element.querySelector("."+Un);d&&this.renderButton("e-flat e-round e-small",Ye+" "+Bn,c,d,this.deleteClick),this.beforeQuickPopupOpen(i,this.parent.eventBase.getPageCoordinates(t))}},i.prototype.isCellBlocked=function(e){var t={};if(t[this.parent.eventFields.startTime]=this.parent.activeCellsData.startTime,t[this.parent.eventFields.endTime]=this.parent.activeCellsData.endTime,t[this.parent.eventFields.isAllDay]=this.parent.activeCellsData.isAllDay,this.parent.activeViewOptions.group.resources.length>0){var i=e.element instanceof Array?e.element[0]:e.element,n=parseInt(i.getAttribute("data-group-index"),10);this.parent.resourceBase.setResourceValues(t,isNaN(n)?null:n)}return this.parent.eventBase.isBlockRange(t)},i.prototype.cellClick=function(t){var i=new Date(t.startTime.getTime());if(this.parent.showQuickInfo&&this.parent.eventSettings.allowAdding&&"MonthAgenda"!==this.parent.currentView&&!this.isCellBlocked(t)&&this.parent.isMinMaxDate(new Date(i.setHours(0,0,0,0)))){var n=(0,e.isNullOrUndefined)(t.event)?t.element:t.event.target;if(this.parent.isAdaptive){this.quickPopupHide();var r=this.parent.element.querySelector("."+bi);(0,e.isNullOrUndefined)(r)&&(r=(0,e.createElement)("div",{className:bi,innerHTML:'<div class="e-title">+ '+this.l10n.getConstant("newEvent")+"</div>"}));var a=(0,e.closest)(n,"."+$e+",."+Ke);a&&a.appendChild(r)}else{var s=(0,e.closest)(n,"."+$e+",."+Ke+",."+rt);if(!(0,e.isNullOrUndefined)(s)&&!n.classList.contains(Bi))if(this.quickPopup.relateTo===s&&this.quickPopup.element.classList.contains(tt)){var o=this.quickPopup.element.querySelector("."+Cn);o&&o.focus()}else{this.quickPopup.element&&this.destroyPopupButtons("quickPopup");var l={};l[this.parent.eventFields.startTime]=this.parent.activeCellsData.startTime,l[this.parent.eventFields.endTime]=this.parent.activeCellsData.endTime,l[this.parent.eventFields.isAllDay]=this.parent.activeCellsData.isAllDay;var p=(0,e.createElement)("div",{className:Wi});p.appendChild(this.getPopupHeader("Cell",l)),p.appendChild(this.getPopupContent("Cell",t,l)),p.appendChild(this.getPopupFooter("Cell",l)),this.quickPopup.element.setAttribute("aria-label",this.l10n.getConstant("newEvent"));var c=p.querySelector("."+Cn);c&&La.Input.createInput({element:c,properties:{placeholder:this.l10n.getConstant("addTitle")}}),(0,e.isNullOrUndefined)(this.parent.eventSettings.fields.subject.default)||(c.value=this.parent.eventSettings.fields.subject.default);var h=p.querySelector("."+Wn);h&&this.renderButton("e-flat e-round e-small",Ye+" "+zn,!1,h,this.popupClose);var d=p.querySelector("."+Qi);d&&this.renderButton("e-flat","",!1,d,this.detailsClick);var u=p.querySelector("."+Ki);u&&this.renderButton("e-flat e-primary","",this.parent.activeViewOptions.readonly,u,this.saveClick),this.morePopup&&this.morePopup.hide(),this.quickPopup.content=p,this.quickPopup.relateTo=s,this.quickPopup.dataBind(),this.beforeQuickPopupOpen(s,this.parent.eventBase.getPageCoordinates(t.event))}}}else this.quickPopupHide()},i.prototype.isSameEventClick=function(t){if(this.quickPopup.relateTo===(0,e.closest)(t.element,"."+Xt)&&this.quickPopup.element.classList.contains(tt)){var i=this.quickPopup.element.querySelector("."+qn);if(i&&i.focus(),!this.parent.isAdaptive){var n=this.quickPopup.element.querySelector("."+Zi);n&&n.focus()}return!0}return!1},i.prototype.isQuickTemplate=function(e){return"Both"===this.parent.quickInfoTemplates.templateType||this.parent.quickInfoTemplates.templateType===e},i.prototype.eventClick=function(t){if(this.parent.eventTooltip&&this.parent.eventTooltip.close(),this.parent.showQuickInfo)if(this.parent.isAdaptive&&this.isMultipleEventSelect)this.updateTapHoldEventPopup((0,e.closest)(t.element,"."+Xt));else{var i=this.isSameEventClick(t);if(this.parent.selectedElements=[],i)return;this.quickPopup.element&&this.destroyPopupButtons("quickPopup");var n=t.event,r=(0,e.createElement)("div",{className:zi});r.appendChild(this.getPopupHeader("Event",n)),r.appendChild(this.getPopupContent("Event",t,n)),r.appendChild(this.getPopupFooter("Event",n)),this.quickPopup.element.setAttribute("aria-label",this.l10n.getConstant("editEvent"));var a=this.parent.activeViewOptions.readonly||n[this.parent.eventFields.isReadonly],s=!this.parent.eventSettings.allowEditing||a,o=!this.parent.eventSettings.allowDeleting||a,l=r.querySelector("."+qn),p="e-flat e-round e-small";l&&this.renderButton(p,Ye+" "+Fn,s,l,this.editClick);var c=r.querySelector("."+Un);c&&this.renderButton(p,Ye+" "+Bn,o,c,this.deleteClick);var h=r.querySelector("."+Wn);h&&this.renderButton(p,Ye+" "+zn,!1,h,this.popupClose);var d=r.querySelector("."+Zi);d&&this.renderButton("e-flat e-primary","",s,d,this.editClick);var u=r.querySelector("."+Ji);u&&this.renderButton("e-flat","",o,u,this.deleteClick),this.morePopup&&!(0,e.closest)(t.element,"."+ln)&&this.morePopup.hide(),this.quickPopup.content=r,this.quickPopup.relateTo=this.parent.isAdaptive?document.body:(0,e.closest)(t.element,"."+Xt),this.quickPopup.dataBind(),this.beforeQuickPopupOpen(t.element,this.parent.eventBase.getPageCoordinates(t.originalEvent))}},i.prototype.getPopupHeader=function(t,i){var n=(0,e.createElement)("div",{className:Yi});if(this.isQuickTemplate(t)&&this.parent.quickInfoTemplates.header){var r=(0,e.extend)({},i,{elementType:t.toLowerCase()},!0),a=this.parent.element.id,s=[].slice.call(this.parent.getQuickInfoTemplatesHeader()(r,this.parent,"header",a+"_headerTemplate",!1));(0,e.append)([].slice.call(s),n)}else{var o=void 0,l=void 0;switch(t){case"Cell":o='<div class="'+_i+'"><button class="'+Wn+'" title="'+this.l10n.getConstant("close")+'"></button></div>';break;case"Event":l=this.getFormattedString(i),o='<div class="'+_i+'"><button class="'+qn+" "+Ye+'" title="'+this.l10n.getConstant("edit")+'"></button><button class="'+Un+" "+Ye+'" title="'+this.l10n.getConstant("delete")+'"></button><button class="'+Wn+'" title="'+this.l10n.getConstant("close")+'"></button></div><div class="'+$t+'"><div class="'+Cn+" "+$i+'" title="'+(l.eventSubject?l.eventSubject.replaceAll('"',"'"):l.eventSubject)+'"></div></div >'}var p=(0,e.createElement)("div",{innerHTML:o});if("Event"===t){var c=p.querySelector("."+Cn);this.parent.sanitize(l.eventSubject,c)}(0,e.append)([].slice.call(p.childNodes),n)}return n},i.prototype.getPopupContent=function(t,i,n){var r=(0,e.createElement)("div",{className:"e-popup-content"});if(this.isQuickTemplate(t)&&this.parent.quickInfoTemplates.content){var a=(0,e.extend)({},n,{elementType:t.toLowerCase()},!0),s=this.parent.element.id,o=[].slice.call(this.parent.getQuickInfoTemplatesContent()(a,this.parent,"content",s+"_contentTemplate",!1));(0,e.append)([].slice.call(o),r)}else{var l=void 0,p=void 0,c=void 0,h=this.getResourceText(i,t.toLowerCase());switch(t){case"Cell":p=this.getFormattedString(n),l='<table class="e-popup-table"><tbody><tr><td><form class="'+wn+'" onsubmit="return false;"><input class="'+Cn+' e-field" type="text" name="'+this.parent.eventFields.subject+'" /></form></td></tr><tr><td><div class="'+vi+'"><div class="'+ar+" "+Ye+'"></div><div class="'+Xi+" "+$i+'">'+p.details+"</div></div>"+(this.parent.activeViewOptions.group.resources.length>0?'<div class="'+ir+'"><div class="'+nr+" "+Ye+' "></div><div class="'+rr+" "+$i+'"></div></div>':"")+"</td></tr></tbody></table>";break;case"Event":c=this.getFormattedString(n),l='<div class="'+vi+'"><div class="'+ar+" "+Ye+'"></div><div class="e-date-time-wrapper '+$i+'"><div class="'+Xi+" "+$i+'">'+c.details+"</div>",n[this.parent.eventFields.recurrenceRule]&&(l+='<div class="e-recurrence-summary '+$i+'">'+this.getRecurrenceSummary(n)+"</div>"),l+="</div></div>",n[this.parent.eventFields.location]&&(l+='<div class="'+On+'"><div class="e-location-icon '+Ye+'"></div><div class="'+En+" "+$i+'"></div></div>'),(n[this.parent.eventFields.startTimezone]||n[this.parent.eventFields.endTimezone])&&(l+='<div class="'+bn+'"><div class="e-time-zone-icon '+Ye+'"></div><div class="e-time-zone-details '+$i+'">'+this.getTimezone(n)+"</div></div>"),n[this.parent.eventFields.description]&&(l+='<div class="'+An+'"><div class="e-description-icon '+Ye+'"></div><div class="'+In+" "+$i+'"></div></div>'),this.parent.resourceCollection.length>0&&(l+='<div class="'+ir+'"><div class="'+nr+" "+Ye+'"></div><div class="'+rr+" "+$i+'"></div></div>')}var d=(0,e.createElement)("div",{innerHTML:l});if(n[this.parent.eventFields.location]){var u=d.querySelector("."+En);(0,e.isNullOrUndefined)(u)||this.parent.sanitize(n[this.parent.eventFields.location],u)}if(n[this.parent.eventFields.description]){var g=d.querySelector("."+In);(0,e.isNullOrUndefined)(g)||this.parent.sanitize(n[this.parent.eventFields.description],g)}if(h){var v=d.querySelector("."+rr);(0,e.isNullOrUndefined)(v)||this.parent.sanitize(h,v)}(0,e.append)([].slice.call(d.childNodes),r)}return r},i.prototype.getPopupFooter=function(t,i){var n=(0,e.createElement)("div",{className:Gi});if(this.isQuickTemplate(t)&&this.parent.quickInfoTemplates.footer){var r=(0,e.extend)({},i,{elementType:t.toLowerCase()},!0),a=this.parent.element.id,s=[].slice.call(this.parent.getQuickInfoTemplatesFooter()(r,this.parent,"footer",a+"_footerTemplate",!1));(0,e.append)([].slice.call(s),n)}else{var o=void 0;switch(t){case"Cell":o='<button class="'+Qi+" "+$i+'" title="'+this.l10n.getConstant("moreDetails")+'">'+this.l10n.getConstant("moreDetails")+'</button><button class="'+Ki+" "+$i+'" title="'+this.l10n.getConstant("save")+'">'+this.l10n.getConstant("save")+"</button>";break;case"Event":o=this.parent.isAdaptive?"":'<button class="'+Zi+" "+$i+'" title="'+this.l10n.getConstant("edit")+'">'+this.l10n.getConstant("edit")+'</button><button class="'+Ji+" "+$i+'" title="'+this.l10n.getConstant("delete")+'">'+this.l10n.getConstant("delete")+"</button>"}var l=(0,e.createElement)("div",{innerHTML:o});(0,e.append)([].slice.call(l.childNodes),n)}return n},i.prototype.getResourceText=function(t,i){if(0===this.parent.resourceCollection.length)return null;var n="";if(0===this.parent.activeViewOptions.group.resources.length){var r=this.parent.resourceBase.resourceCollection.slice(-1)[0],a=r.dataSource;if("event"===i)for(var s=t.event,o=function(e){var t=s[r.field];if(t instanceof Array){if(t.indexOf(e[r.idField])>-1){var i=t[t.indexOf(e[r.idField])],o=a.filter((function(e){return e[r.idField]===i}))[0];n+=""===n?o[r.textField]:", "+o[r.textField]}}else e[r.idField]===t&&(n=e[r.textField].toString())},l=0,p=a;l<p.length;l++){o(p[l])}else n=a[0][r.textField].toString()}else if("event"===i){s=t.event,a=void 0;for(var c,h=this.parent.resourceBase.resourceCollection.length-1;h>=0;h--)if(a=s[this.parent.resourceBase.resourceCollection[parseInt(h.toString(),10)].field],!(0,e.isNullOrUndefined)(a)){c=this.parent.resourceBase.resourceCollection[parseInt(h.toString(),10)];break}Array.isArray(a)||(a=[a]);var d=[],u=c.dataSource;a.forEach((function(e){var t,i=Ae(u,c.idField,e);i>-1&&(t=u[parseInt(i.toString(),10)][c.textField]),t&&d.push(t)})),n=d.join(", ")}else{var g=t,v=(0,e.isNullOrUndefined)(g.groupIndex)?0:g.groupIndex,m=this.parent.resourceBase.lastResourceLevel[parseInt(v.toString(),10)];n=m.resourceData[m.resource.textField]}return n},i.prototype.getFormattedString=function(e){var t=this.parent.eventFields,i=e[t.subject]||this.l10n.getConstant("noTitle"),n=e[t.startTime],r=e[t.endTime],a=this.getDateFormat(n,"long"),s=e[t.isAllDay]&&0===r.getHours()&&0===r.getMinutes()?this.getDateFormat(ye(new Date(r.getTime()),-1),"long"):this.getDateFormat(r,"long"),o=this.parent.getTimeString(n),l=this.parent.getTimeString(r),p="",c=r.getDate()!==n.getDate()&&(r.getTime()-n.getTime())/36e5<24?1:0;return e[t.isAllDay]?(p=a+" ("+this.l10n.getConstant("allDay")+")",(Re(r)-Re(n))/ie>1&&(p+=" - "+s+" ("+this.l10n.getConstant("allDay")+")")):p=(Re(r)-Re(n))/ie>=1||c>0?a+" ("+o+") - "+s+" ("+l+")":a+" ("+o+" - "+l+")",{eventSubject:i,details:p}},i.prototype.moreEventClick=function(t,i,n){var r=this;this.quickPopupHide(!0);var a=this.morePopup.element.querySelector("."+on);a&&(0,e.remove)(a);var s=t.date.getTime().toString(),o=(0,e.closest)(t.element,"."+Bi+",."+$e),l=this.parent.globalize.formatDate(t.date,{format:"E",calendar:this.parent.getCalendarMode()});this.morePopup.element.querySelector("."+rn).innerHTML=je(l,"single");var p,c=this.morePopup.element.querySelector("."+an);c.innerHTML=this.getDateFormat(t.date,"d"),c.setAttribute("data-date",s),c.setAttribute("data-end-date",i.getTime().toString()),(0,e.isNullOrUndefined)(n)||(c.setAttribute("data-group-index",n),p=this.parent.resourceBase.lastResourceLevel[parseInt(n,10)].groupOrder);var h=this.createMoreEventList(t.event,p,n);if(this.morePopup.element.querySelector("."+tn).appendChild(h),(0,e.removeClass)(this.morePopup.element.querySelector("."+nn).childNodes,lt),ve(t.date).getTime()===ve(this.parent.getCurrentTime()).getTime()&&(0,e.addClass)(this.morePopup.element.querySelector("."+nn).childNodes,lt),!this.parent.isAdaptive)if(-1!==this.parent.currentView.indexOf("Timeline")){var d=o.getAttribute("data-group-index"),u=new Date(parseInt(o.getAttribute("data-start-date"),10));u.setHours(u.getHours(),u.getMinutes(),0);var g=u.getTime().toString();if((0,e.isNullOrUndefined)(d))this.morePopup.relateTo=this.parent.element.querySelector("."+ri+' tbody tr td[data-date="'+g+'"]');else if(this.morePopup.relateTo=this.parent.element.querySelector("."+ri+' tbody tr td[data-group-index="'+d+'"][data-date="'+g+'"]'),(0,e.isNullOrUndefined)(this.morePopup.relateTo))for(var v=[].slice.call(this.parent.element.querySelectorAll("."+ri+' tbody tr td[data-group-index="'+d+'"]')),m=0;m<v.length;m++){v[parseInt(m.toString(),10)].getAttribute("data-date")<g&&(this.morePopup.relateTo=v[parseInt(m.toString(),10)])}}else this.morePopup.relateTo=(0,e.closest)(o,"."+$e);this.parent.renderTemplates((function(){var e={type:"EventContainer",cancel:!1,element:r.morePopup.element,data:t};r.parent.trigger(D,e,(function(e){e.cancel||r.morePopup.show()}))}))},i.prototype.saveClick=function(e){this.applyFormValidation(),this.dialogEvent=e,this.isCrudAction=!0,this.quickPopupHide()},i.prototype.detailsClick=function(t){var i=this.quickPopup.element.querySelector("."+Cn);i&&""!==i.value&&(0,e.extend)(this.parent.activeCellsData,{subject:i.value}),this.dialogEvent=t,this.isCrudAction=!1,this.fieldValidator.destroyToolTip(),this.quickPopupHide(),this.parent.eventWindow.openEditor(this.parent.activeCellsData,"Add")},i.prototype.editClick=function(t){this.dialogEvent=t,this.quickPopupHide(!0);var i=this.parent.activeEventData.event;this.parent.currentAction="EditSeries",(0,e.isNullOrUndefined)(i[this.parent.eventFields.recurrenceRule])?this.parent.eventWindow.openEditor(i,this.parent.currentAction):(this.parent.currentAction="EditOccurrence",this.openRecurrenceAlert())},i.prototype.deleteClick=function(e){this.dialogEvent=e,this.quickPopupHide(!0),this.parent.currentAction="Delete",this.parent.activeEventData.event[this.parent.eventFields.recurrenceRule]?this.openRecurrenceAlert():this.openDeleteAlert()},i.prototype.updateMoreEventContent=function(){if(!this.morePopup.element.classList.contains("e-popup-close")){var t=this.morePopup.element.querySelector("."+on);t&&(0,e.remove)(t);var i,n,r=this.morePopup.element.querySelector("."+an),a=new Date(parseInt(r.getAttribute("data-date"),10)),s=new Date(parseInt(r.getAttribute("data-end-date"),10)),o=r.getAttribute("data-group-index");(0,e.isNullOrUndefined)(o)||(n=(i=this.parent.resourceBase.lastResourceLevel[parseInt(o,10)]).groupOrder);var l=this.parent.eventBase.filterEvents(a,s,this.parent.eventsProcessed,i),p=this.createMoreEventList(l,n,o);this.morePopup.element.querySelector("."+tn).appendChild(p)}},i.prototype.closeClick=function(e){this.dialogEvent=e,"Year"===this.parent.currentView&&this.parent.activeCellsData&&this.parent.activeCellsData.element&&this.parent.selectCell(this.parent.activeCellsData.element),this.quickPopupHide(),this.morePopup.hide()},i.prototype.dialogButtonClick=function(e){this.dialogEvent=e,this.quickDialog.hide();var t=e.target,i=this.quickDialog.element.querySelector("."+mn),n=this.parent.activeEventData.event;if(t.classList.contains(pn))switch(this.parent.currentAction="Delete"===this.parent.currentAction?"DeleteOccurrence":"EditOccurrence",this.parent.currentAction){case"EditOccurrence":this.parent.eventWindow.openEditor(n,this.parent.currentAction);break;case"DeleteOccurrence":this.parent.crudModule.deleteEvent(n,this.parent.currentAction)}else if(t.classList.contains(hn))switch(this.parent.currentAction="Delete"===this.parent.currentAction?"DeleteFollowingEvents":"EditFollowingEvents",this.parent.currentAction){case"EditFollowingEvents":this.parent.eventWindow.openEditor(n,this.parent.currentAction);break;case"DeleteFollowingEvents":this.parent.crudModule.deleteEvent(n,this.parent.currentAction)}else if(t.classList.contains(cn))switch(this.parent.currentAction="Delete"===this.parent.currentAction?"DeleteSeries":"EditSeries",this.parent.currentAction){case"EditSeries":this.parent.eventWindow.openEditor(this.parent.eventBase.getParentEvent(n,!0),this.parent.currentAction);break;case"DeleteSeries":this.parent.crudModule.deleteEvent(n,this.parent.currentAction)}else t.classList.contains(un)?this.parent.crudModule.deleteEvent(n,this.parent.currentAction):!i.classList.contains(Ge)&&(t.classList.contains(vn)||t.classList.contains(mn)&&!i.classList.contains(gn))&&(this.parent.uiStateValues.isIgnoreOccurrence=t.classList.contains(mn),this.parent.eventWindow.eventSave(e,this.l10n.getConstant("ok")))},i.prototype.updateTapHoldEventPopup=function(t){var i=this.parent.eventBase.getSelectedEventElements(t);if(this.parent.activeEventData=this.parent.eventBase.getSelectedEvents(),i.length>0){var n=this.parent.eventBase.getEventByGuid(i[0].getAttribute("data-guid")),r=1===i.length?n[this.parent.eventFields.subject]||this.l10n.getConstant("noTitle"):"("+i.length+") "+this.l10n.getConstant("selectedItems");this.quickPopup.element.querySelector("."+Cn).innerHTML=r,i.length>1?(0,e.addClass)([this.quickPopup.element.querySelector("."+Fn)],Xn):(0,e.removeClass)([this.quickPopup.element.querySelector("."+Fn)],Xn)}else this.parent.selectedElements=[],this.quickPopupHide()},i.prototype.getTimezone=function(e){var t="";return t+=e[this.parent.eventFields.startTimezone]||"",t+=""===t?"":" - ",t+=e[this.parent.eventFields.endTimezone]||""},i.prototype.getRecurrenceSummary=function(e){var t=this.parent.eventWindow.getRecurrenceEditorInstance();if(t){var i=t.getRuleSummary(e[this.parent.eventFields.recurrenceRule]);return i.charAt(0).toUpperCase()+i.slice(1)}return""},i.prototype.getDateFormat=function(e,t){return je(this.parent.globalize.formatDate(e,{skeleton:t,calendar:this.parent.getCalendarMode()}),"single")},i.prototype.getDataFromTarget=function(e){if(e.classList.contains(Xt))return this.parent.activeEventData.event;var t={startTime:this.parent.activeCellsData.startTime,endTime:this.parent.activeCellsData.endTime,isAllDay:this.parent.activeCellsData.isAllDay,groupIndex:this.parent.activeCellsData.groupIndex},i=this.parent.activeCellsData;return this.parent.eventWindow.convertToEventData(i,t),t},i.prototype.beforeQuickDialogClose=function(t){var i=this,n={event:t.event||this.dialogEvent,type:(0,e.isNullOrUndefined)(this.parent.activeEventData.event)?"ValidationAlert":(0,e.isNullOrUndefined)(this.parent.activeEventData.event[this.parent.eventFields.recurrenceRule])?"DeleteAlert":"RecurrenceAlert",cancel:!1,data:this.parent.activeEventData.event,element:this.quickDialog.element};this.parent.trigger(b,n,(function(e){e.cancel||i.parent.eventBase.focusElement(!0)}))},i.prototype.beforeQuickPopupOpen=function(i,n){var r=this;this.parent.renderTemplates((function(){var a=r.quickPopup.element.querySelector("."+zi),s=r.parent.isAdaptive?a?"ViewEventInfo":"EditEventInfo":"QuickInfo",o={type:s,cancel:!1,data:(0,e.extend)({},r.getDataFromTarget(i),null,!0),target:i,element:r.quickPopup.element};r.parent.trigger(D,o,(function(o){if(o.cancel)r.quickPopupHide(),r.destroyPopupButtons("quickPopup"),o.element.classList.contains(tt)&&r.quickPopupClose(),Me(r.quickPopup.element),r.isMultipleEventSelect=!1;else{var l=r.quickPopup.element.style.display;if(r.quickPopup.element.style.display="block",r.parent.isAdaptive)r.quickPopup.element.removeAttribute("style"),r.quickPopup.element.style.display="block",r.quickPopup.element.style.height=(0,e.formatUnit)("EditEventInfo"===s?65:window.innerHeight);else{var p=r.parent.virtualScrollModule&&r.parent.virtualScrollModule.isHorizontalScroll&&!(0,e.isNullOrUndefined)((0,e.closest)(i,"."+Je)),c=r.parent.element.querySelector("."+ri+" table");r.quickPopup.offsetX=p&&!r.parent.enableRtl?oe(c)+10:10,r.quickPopup.offsetY=r.parent.virtualScrollModule&&!r.parent.virtualScrollModule.isHorizontalScroll?r.quickPopup.offsetY:0,r.quickPopup.collision={X:r.parent.enableRtl?"flip":"none",Y:"fit"},r.quickPopup.position={X:r.parent.enableRtl?"left":"right",Y:r.parent.enableRtl?"bottom":"top"},r.quickPopup.dataBind(),r.quickPopup.refreshPosition(null,!0);var h=(0,t.isCollide)(r.quickPopup.element,r.parent.element);if(h.indexOf(r.parent.enableRtl?"left":"right")>-1)r.quickPopup.offsetX=-i.offsetWidth-10-r.quickPopup.element.offsetWidth,p&&!r.parent.enableRtl&&(r.quickPopup.offsetX=oe(c)+r.quickPopup.offsetX),r.quickPopup.dataBind(),r.quickPopup.refreshPosition(null,!0),(0,t.isCollide)(r.quickPopup.element,r.parent.element).indexOf("left")>-1&&(r.quickPopup.position={X:"center",Y:"center"},r.quickPopup.collision={X:"fit",Y:"fit"},r.quickPopup.offsetX=-r.quickPopup.element.offsetWidth/2,r.quickPopup.dataBind());if(r.parent.virtualScrollModule&&!r.parent.virtualScrollModule.isHorizontalScroll&&(h.indexOf("top")>-1||h.indexOf("bottom")>-1)){var d=se(c);r.quickPopup.offsetY=d,r.quickPopup.dataBind(),r.quickPopup.refreshPosition(null,!0)}if("center"===r.quickPopup.position.X&&"center"===r.quickPopup.position.Y&&!(0,e.isNullOrUndefined)(n)&&n.clientX&&n.clientY){var u=n.clientX,g=n.clientY,v=i.getBoundingClientRect(),m=n.offsetY||Math.ceil(g-v.y),f=r.quickPopup.offsetY,y=(0,t.isCollide)(r.quickPopup.element,i),T=r.quickPopup.element.getBoundingClientRect(),w=document.elementFromPoint(u,g);(y.indexOf("top")>-1||y.indexOf("bottom")>-1||(0,e.closest)(w,"."+Kn))&&(T.top<=g&&g<=T.top+T.height?(r.quickPopup.offsetY=f-T.height-10,r.quickPopup.dataBind(),(y=(0,t.isCollide)(r.quickPopup.element,r.parent.element)).indexOf("top")>-1&&(r.quickPopup.offsetY=f+m+10,r.quickPopup.dataBind())):(0,t.isCollide)(r.quickPopup.element,r.parent.element).indexOf("bottom")>-1&&(r.quickPopup.offsetY=f-m-Math.ceil(T.height)-10,r.quickPopup.dataBind()))}}a&&r.applyEventColor(),r.quickPopup.element.style.display=l,r.quickPopup.dataBind(),r.quickPopup.show()}}))}))},i.prototype.applyEventColor=function(){var e="";e="Agenda"===this.parent.currentView||"MonthAgenda"===this.parent.currentView?this.parent.enableRtl?"border-right-color":"border-left-color":"background-color";var t=this.parent.activeEventData.element.style[e];if(""!==t){var i=this.quickPopup.element.querySelector("."+Yi),n=this.quickPopup.element.querySelector("."+Gi);n&&n.offsetParent&&(i=this.quickPopup.element.querySelector("."+Cn))&&(i.style.borderLeftColor=t,t="rgba("+t.match(/\d+/g).join()+",0.3)"),i&&(i.style.backgroundColor=t)}},i.prototype.quickPopupOpen=function(){if(this.parent.isAdaptive)this.quickPopup.element.style.top="0px";else if(this.quickPopup.element.querySelector("."+Wi)){var e=this.quickPopup.element.querySelector("."+Cn);e&&e.focus()}else{var t=this.quickPopup.element.querySelector("."+Zi);t&&t.focus();var i=this.quickPopup.element.querySelector("."+qn);i&&i.focus()}},i.prototype.quickPopupClose=function(){this.parent.eventBase.focusElement(),this.quickPopup.relateTo="."+$e,this.fieldValidator.destroyToolTip(),this.quickPopup.element.querySelectorAll(".e-formvalidator").length&&this.fieldValidator.destroy(),this.destroyPopupButtons("quickPopup"),Me(this.quickPopup.element)},i.prototype.morePopupOpen=function(){if(this.parent.isAdaptive)return this.morePopup.element.style.top="0px",this.morePopup.element.style.left="0px",void(this.morePopup.element.style.height=(0,e.formatUnit)(window.innerHeight));this.morePopup.element.querySelector("."+an).focus(),this.morePopup.refreshPosition()},i.prototype.morePopupClose=function(){var t=this.parent.element.querySelector("."+ln);t&&(0,e.remove)(t)},i.prototype.popupClose=function(e){this.dialogEvent=e,this.isCrudAction=!1,this.quickPopupHide(!0)},i.prototype.quickPopupHide=function(e){var t=this;if(this.quickPopup.element.classList.contains(tt)){var i,n=this.quickPopup.element.querySelector("."+Wi);if(n){var r=this.quickPopup.element.querySelector(".e-formvalidator");if(this.isCrudAction&&r&&!r.ej2_instances[0].validate())return;var a=this.parent.eventFields,s=this.parent.eventWindow.getObjectFromFormData(Kn);this.parent.eventWindow.setDefaultValueToObject(s),s[a.id]=this.parent.eventBase.getEventMaxID(),s[a.startTime]=this.parent.activeCellsData.startTime,s[a.endTime]=this.parent.activeCellsData.endTime,s[a.isAllDay]=this.parent.activeCellsData.isAllDay,this.parent.resourceBase&&this.parent.resourceBase.setResourceValues(s),i=s}else i=this.parent.activeEventData.event;var o=this.quickPopup.element.querySelector("."+zi),l={event:this.dialogEvent,type:this.parent.isAdaptive?o?"ViewEventInfo":"EditEventInfo":"QuickInfo",cancel:!1,data:i,element:this.quickPopup.element,target:n?this.parent.activeCellsData.element:this.parent.activeEventData.element};this.parent.trigger(b,l,(function(i){if(!i.cancel&&t.quickPopup.element.classList.contains("e-popup-open")){if(n&&t.isCrudAction&&(t.parent.currentAction="Add",t.parent.crudModule.addEvent(i.data)),e){var r=t.quickPopup.hideAnimation;t.quickPopup.hideAnimation=null,t.quickPopup.hide(),t.quickPopup.hideAnimation=r}else t.quickPopup.hide();t.isMultipleEventSelect=!1,t.isCrudAction=!1}}))}},i.prototype.navigationClick=function(t){var i=(0,e.closest)(t.target,"."+di);if(!(0,e.isNullOrUndefined)(i)){var n=this.parent.getDateFromElement(t.currentTarget);(0,e.isNullOrUndefined)(n)||(this.closeClick(t),this.parent.setProperties({selectedDate:n},!0),this.parent.changeView(this.parent.getNavigateView(),t))}},i.prototype.documentClick=function(t){var i=t.event.target,n=!!(0,e.closest)(i,".e-dialog"),r="."+Kn+",."+rt+",."+Ke+",."+$e+",."+Xt;n||(r+=",.e-popup");var a=this.parent.element.querySelector("."+Kn);(a&&a.childElementCount>0&&!(0,e.closest)(i,r)||!(0,e.closest)(i,r))&&(this.quickPopupHide(),this.parent.removeNewEventElement());var s=this.parent.allowInline?this.parent.inlineModule.getInlineElement():null;s&&s!==i&&this.parent.inlineModule.documentClick(s),(0,e.closest)(i,"."+Xt+",."+rt)&&this.parent.removeNewEventElement(),(0,e.closest)(i,"."+en)||!i.classList||i.classList.contains(Bi)||(0,e.closest)(i,"."+en+"."+tt)||(0,e.closest)(i,"."+$e)||this.morePopup.hide()},i.prototype.onClosePopup=function(t){(0,e.isNullOrUndefined)(t)||(this.dialogEvent=t),this.quickPopupHide(),((0,e.isNullOrUndefined)(t)||!(0,e.isNullOrUndefined)(t)&&"escape"!==t.action||this.parent.inlineModule&&this.parent.element.querySelector("."+ur))&&this.parent.eventBase.focusElement()},i.prototype.addEventListener=function(){this.parent.on(r,this.cellClick,this),this.parent.on(m,this.eventClick,this),this.parent.on(Z,this.documentClick,this),this.parent.on(z,this.updateMoreEventContent,this)},i.prototype.removeEventListener=function(){this.parent.off(r,this.cellClick),this.parent.off(m,this.eventClick),this.parent.off(Z,this.documentClick),this.parent.off(z,this.updateMoreEventContent)},i.prototype.destroyPopupButtons=function(e){for(var t="quickPopup"===e?this.quickPopup:this.morePopup,i=0,n=[].slice.call(t.element.querySelectorAll(".e-control.e-btn"));i<n.length;i++){var r=n[i].ej2_instances[0];r&&r.destroy()}if("quickPopup"===e){var a=t.element.querySelector("input."+Cn);a&&a.remove();var s=this.quickPopup.element.querySelector("form."+wn);s&&(Me(s),s.remove()),this.parent.resetTemplates(["content","header","footer"])}},i.prototype.refreshQuickDialog=function(){this.destroyQuickDialog(),this.renderQuickDialog()},i.prototype.refreshQuickPopup=function(){this.destroyQuickPopup(),this.renderQuickPopup()},i.prototype.refreshMorePopup=function(){this.destroyMorePopup(),this.renderMorePopup()},i.prototype.destroyQuickDialog=function(){this.quickDialog.element&&(this.quickDialog.destroy(),(0,e.remove)(this.quickDialog.element),this.quickDialog=null)},i.prototype.destroyQuickPopup=function(){this.quickPopup.element&&(this.destroyPopupButtons("quickPopup"),this.quickPopup.destroy(),(0,e.remove)(this.quickPopup.element),this.quickPopup=null)},i.prototype.destroyMorePopup=function(){this.morePopup.element&&(this.destroyPopupButtons("morePopup"),this.morePopup.destroy(),(0,e.remove)(this.morePopup.element),this.morePopup=null)},i.prototype.destroy=function(){this.quickPopup.element.querySelectorAll(".e-formvalidator").length&&this.fieldValidator.destroy(),this.removeEventListener(),this.destroyQuickPopup(),this.destroyMorePopup(),this.destroyQuickDialog(),this.dialogEvent=null,this.parent=null,this.l10n=null,this.isCrudAction=null,this.fieldValidator=null,this.isMultipleEventSelect=null},i}(),Ua=function(){function i(e){this.parent=e,this.tooltipObj=new t.Tooltip({animation:{close:{effect:"FadeOut"}},content:"No title",position:"BottomRight",offsetY:10,mouseTrail:!this.parent.isAdaptive,showTipPointer:!1,cssClass:this.parent.cssClass+" e-schedule-event-tooltip",target:this.getTargets(),beforeRender:this.onBeforeRender.bind(this),beforeClose:this.onTooltipClose.bind(this),beforeOpen:this.onTooltipOpen.bind(this),enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer}),this.tooltipObj.appendTo(this.parent.element)}return i.prototype.getTargets=function(){var e=[];return this.parent.activeViewOptions.group.headerTooltipTemplate&&e.push("."+Ot),this.parent.eventSettings.enableTooltip&&e.push("."+Xt),e.join(",")},i.prototype.onBeforeRender=function(t){var i=this;if(this.parent.uiStateValues.isSwipeScroll)t.cancel=!0;else if((0,e.isNullOrUndefined)(t.target.getAttribute("data-tooltip-id"))){if(t.target.classList.contains(Ot)&&this.parent.activeViewOptions.group.resources.length>0){var n=void 0;if(this.parent.activeView.isTimelineView()){var r=parseInt(t.target.getAttribute("data-group-index"),10);n=this.parent.resourceBase.lastResourceLevel[parseInt(r.toString(),10)]}else{var a=t.target.parentNode.sectionRowIndex,s=t.target.cellIndex;n=this.parent.activeView.getColumnLevels()[parseInt(a.toString(),10)][parseInt(s.toString(),10)]}var o={resource:n.resource,resourceData:n.resourceData},l=(0,e.createElement)("div"),p=this.parent.element.id+"_headerTooltipTemplate",c=[].slice.call(this.parent.getHeaderTooltipTemplate()(o,this.parent,"headerTooltipTemplate",p,!1));return(0,e.append)(c,l),this.setContent(l),void this.parent.renderTemplates()}var h=this.parent.eventBase.getEventByGuid(t.target.getAttribute("data-guid"));if(!(0,e.isNullOrUndefined)(h)){if((0,e.isNullOrUndefined)(this.parent.eventSettings.tooltipTemplate)){var d=this.parent.globalize,u=this.parent.eventFields,g=new Date(""+h[u.startTime]),v=new Date(""+h[u.endTime]);v=v.getTime()-g.getTime()!=0&&0===v.getHours()&&0===v.getMinutes()?new Date(v.setMilliseconds(-1e3)):v;var m=ve(new Date(""+g)),f=ve(new Date(""+v)),y=h[u.subject]||this.parent.eventSettings.fields.subject.default||this.parent.localeObj.getConstant("addTitle"),T=(0,e.isNullOrUndefined)(h[u.location])?"":h[u.location],w="",D="",b="";w=d.formatDate(g,{type:"date",skeleton:"MMMd",calendar:this.parent.getCalendarMode()}),D=d.formatDate(g,{type:"date",skeleton:"medium",calendar:this.parent.getCalendarMode()}),b=d.formatDate(v,{type:"date",skeleton:"medium",calendar:this.parent.getCalendarMode()}),w=je(w,"single"),D=je(D,"single"),b=je(b,"single");var S=this.parent.getTimeString(g),C=this.parent.getTimeString(v),O='<div><div class="e-subject">'+y+'</div><div class="e-location">'+T+'</div><div class="e-details">'+(m.getTime()===f.getTime()?je(d.formatDate(g,{type:"date",skeleton:"long",calendar:this.parent.getCalendarMode()}),"single"):m.getFullYear()===f.getFullYear()?w+" - "+b:D+" - "+b)+'</div><div class="e-all-day">'+(h[u.isAllDay]?this.parent.localeObj.getConstant("allDay"):S+" - "+C)+"</div></div>";this.setContent((0,e.initializeCSPTemplate)((function(){return O})))}else{l=(0,e.createElement)("div"),p=this.parent.element.id+"_tooltipTemplate",c=[].slice.call(this.parent.getEventTooltipTemplate()(h,this.parent,"tooltipTemplate",p,!1));(0,e.append)(c,l),this.setContent(l)}this.parent.renderTemplates((function(){if(i.parent&&i.parent.isReact&&!(0,e.isNullOrUndefined)(i.parent.eventSettings.tooltipTemplate)){var t=document.querySelector("."+_n);t&&(0,e.removeClass)([t],_n)}}))}}},i.prototype.onTooltipOpen=function(t){t.element&&this.parent.isReact&&!(0,e.isNullOrUndefined)(this.parent.eventSettings.tooltipTemplate)&&(0,e.addClass)([t.element],_n);var i=this.parent.eventBase.getEventByGuid(t.target.getAttribute("data-guid"));if(!(0,e.isNullOrUndefined)(i)){var n={cancel:!1,data:i,content:t.element,target:t.target};this.parent.trigger(F,n,(function(e){e.cancel?t.cancel=!0:t.element=e.content}))}},i.prototype.onTooltipClose=function(t){t.element&&((0,e.removeClass)([t.element],tt),(0,e.addClass)([t.element],"e-popup-close")),this.parent.isReact&&this.parent.eventWindow.dialogObject&&this.parent.eventWindow.dialogObject.visible||this.parent.resetTemplates(["tooltipTemplate","headerTooltipTemplate"])},i.prototype.setContent=function(e){this.tooltipObj.setProperties({content:e,windowCollision:!0},!0)},i.prototype.close=function(){this.tooltipObj.close()},i.prototype.destroy=function(){this.tooltipObj.destroy(),(0,e.addClass)([this.parent.element],"e-control"),this.tooltipObj=null,this.parent=null},i}(),Ba=d(778),Wa=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),za=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},Ya="e-input-wrapper",_a="e-input-wrapper-side",Ga="e-repeat-element",Xa="e-repeat-interval",Qa="e-interval",Ka="e-days",Za="e-non-week",Ja="e-year-expander",$a="e-year-expander-element",es="e-month-expander",ts="e-month-expander-element",is="e-month-expander-checkbox-wrapper",ns="e-form-left",rs="e-form-right",as="e-month-day",ss="e-month-expander-wrapper",os="e-month-pos",ls="e-month-week",ps="e-end-on",cs="e-end-on-element",hs="e-end-on-date",ds="e-until-date",us="e-end-on-count",gs="e-recurrence-count",vs="e-hide-recurrence-element",ms="e-rtl",fs="e-primary",ys="e-active",Ts="e-recurrence-table",ws="e-repeat-content",Ds="none",bs="daily",Ss="weekly",Cs="monthly",Os="yearly",Es="never",xs="until",Vs="count",As="text",Is="value",Ms="repeat",ks="BYDAY",Rs="DAILY",Hs="WEEKLY",Ps="MONTHLY",js="YEARLY",Ns="SU",Ls="MO",qs="TU",Fs="WE",Us="TH",Bs="FR",Ws="SA",zs="=",Ys=";",_s={none:"",daily:"days",weekly:"weeks",monthly:"months",yearly:"years"},Gs={sun:Ns,mon:Ls,tue:qs,wed:Fs,thu:Us,fri:Bs,sat:Ws},Xs=[Ka,Za,ps,Qa,Ja,es],Qs=[Za],Ks=[Ka,Ja],Zs=[Ka],Js=[Ka,Za,Ja,es],$s=[hs,us],eo=[hs],to=[us],io=function(t){function i(e,i){var n=t.call(this,e,i)||this;return n.defaultLocale={none:"None",daily:"Daily",weekly:"Weekly",monthly:"Monthly",month:"Month",yearly:"Yearly",never:"Never",until:"Until",count:"Count",first:"First",second:"Second",third:"Third",fourth:"Fourth",last:"Last",repeat:"Repeat",repeatEvery:"Repeat every",on:"Repeat On",end:"End",onDay:"Day",days:"Day(s)",weeks:"Week(s)",months:"Month(s)",years:"Year(s)",every:"every",summaryTimes:"time(s)",summaryOn:"on",summaryUntil:"until",summaryRepeat:"Repeats",summaryDay:"day(s)",summaryWeek:"week(s)",summaryMonth:"month(s)",summaryYear:"year(s)",monthWeek:"Month Week",monthPosition:"Month Position",monthExpander:"Month Expander",yearExpander:"Year Expander",repeatInterval:"Repeat Interval"},n.renderStatus=!1,n.dayButtons=[],n.monthButtons=[],n}return Wa(i,t),i.prototype.startState=function(e,t,i){this.showFormElement(),this.updateForm(e),this.freshOnEndForm(),this.updateEndOnForm(t),this.selectMonthDay(i),this.updateUntilDate(i),this.onMonthDay.setProperties({checked:!0})},i.prototype.preRender=function(){this.localeObj=new e.L10n(this.getModuleName(),this.defaultLocale,this.locale),this.calendarUtil=ra(this.calendarMode)},i.prototype.applyCustomClass=function(t){t&&(0,e.addClass)([this.element],t.split(" "))},i.prototype.initialize=function(){(0,e.addClass)([this.element],"e-"+this.getModuleName()),this.renderComponent(),(0,e.isNullOrUndefined)(this.value)||""===this.value?((0,e.isNullOrUndefined)(this.repeatType.value)||(this.startState(this.repeatType.value.toString().toUpperCase(),this.endTypes[0],this.startDate),this.updateForm(this.repeatType.value.toString())),this.selectedType>0&&this.setProperties({value:this.getRecurrenceRule()},!1)):this.setRecurrenceRule(this.value),this.applyCustomClass(this.cssClass)},i.prototype.triggerChangeEvent=function(){var e=this;if(this.renderStatus){var t=this.getRecurrenceRule();this.trigger("change",{value:t},(function(t){return e.setProperties({value:t.value},!1)}))}},i.prototype.resetDayButton=function(){[].slice.call(this.element.querySelectorAll("."+Ka+" button")).forEach((function(t){return(0,e.removeClass)([t],[ys,fs])}))},i.prototype.daySelection=function(t){this.resetDayButton();var i=[0,1,2,3,4,5,6];this.rotateArray(i,this.firstDayOfWeek);var n=this.element.querySelector("."+Ka+' button[data-index="'+i.indexOf(t)+'"]');n&&(0,e.addClass)([n],[ys,fs])},i.prototype.rtlClass=function(t){t?(0,e.addClass)([this.element],ms):(0,e.removeClass)([this.element],ms)},i.prototype.updateUntilDate=function(e){var t=new Date(e.getTime());t.setDate(t.getDate()+60),this.untilDateObj.setProperties({value:t})},i.prototype.selectMonthDay=function(e){var t=["sun","mon","tue","wed","thu","fri","sat"];this.monthDate.setProperties({value:this.calendarUtil.getDate(e)}),this.monthWeekDays.setProperties({value:Gs[t[e.getDay()]]}),this.monthValue.setProperties({value:""+this.calendarUtil.getMonth(e)}),this.monthWeekPos.setProperties({value:this.getDayPosition(e)}),this.daySelection(e.getDay())},i.prototype.updateForm=function(t){var i=this;this.repeatType.setProperties({value:t});var n=this.element.querySelector("."+ps);switch(t===bs?(0,e.classList)(n,[ns],[rs]):(0,e.classList)(n,[rs],[ns]),t){case Ds:Xs.forEach((function(t){return(0,e.addClass)([i.element.querySelector("."+t)],vs)}));break;case Ss:Qs.forEach((function(t){return(0,e.addClass)([i.element.querySelector("."+t)],vs)}));break;case Cs:Ks.forEach((function(t){return(0,e.addClass)([i.element.querySelector("."+t)],vs)}));break;case Os:Zs.forEach((function(t){return(0,e.addClass)([i.element.querySelector("."+t)],vs)}));break;case bs:Js.forEach((function(t){return(0,e.addClass)([i.element.querySelector("."+t)],vs)}))}},i.prototype.updateEndOnForm=function(t){var i=this;switch(this.endType.setProperties({value:t}),t){case Es:$s.forEach((function(t){return(0,e.addClass)([i.element.querySelector("."+t)],vs)}));break;case xs:to.forEach((function(t){return(0,e.addClass)([i.element.querySelector("."+t)],vs)}));break;case Vs:eo.forEach((function(t){return(0,e.addClass)([i.element.querySelector("."+t)],vs)}))}},i.prototype.freshOnEndForm=function(){var t=this;$s.forEach((function(i){var n=t.element.querySelector("."+i);n&&(0,e.removeClass)([n],vs)}))},i.prototype.showFormElement=function(){var t=this;Xs.forEach((function(i){var n=t.element.querySelector("."+i);n&&(0,e.removeClass)([n],vs)}))},i.prototype.renderDropdowns=function(){var e=this,t=this;this.repeatType=new Ba.DropDownList({dataSource:this.getRepeatData(),floatLabelType:"Always",enableRtl:this.enableRtl,index:this.selectedType,fields:{text:As,value:Is},placeholder:this.localeObj.getConstant(Ms),htmlAttributes:{title:this.localeObj.getConstant(Ms)},change:function(i){t.setProperties({selectedType:e.frequencies.indexOf(i.value)},!1),t.element.querySelector("."+ws).innerHTML=t.localeObj.getConstant(_s[i.value]),t.showFormElement(),t.updateForm(i.value),t.resetFormValues(),t.triggerChangeEvent()}}),this.repeatType.appendTo(this.element.querySelector("."+Ga)),this.endType=new Ba.DropDownList({dataSource:this.getEndData(),popupWidth:this.getPopupWidth(),floatLabelType:"Always",placeholder:this.localeObj.getConstant("end"),enableRtl:this.enableRtl,index:1,fields:{text:As,value:Is},change:function(e){t.freshOnEndForm(),t.updateEndOnForm(e.value),t.resetFormValues(),t.triggerChangeEvent()}}),this.endType.appendTo(this.element.querySelector("."+cs));var i=function(i){return new Ba.DropDownList({dataSource:i,popupWidth:e.getPopupWidth(),enableRtl:e.enableRtl,fields:{text:As,value:Is},index:1,change:function(e){t.onWeekDay.setProperties({checked:!0}),t.resetFormValues(),t.triggerChangeEvent()}})};this.monthWeekPos=i(this.getMonthPosData()),this.monthWeekPos.appendTo(this.element.querySelector("."+os)),this.monthWeekDays=i(this.getDayData("wide")),this.monthWeekDays.appendTo(this.element.querySelector("."+ls)),this.monthValue=new Ba.DropDownList({dataSource:this.getMonthData(),fields:{text:As,value:Is},enableRtl:this.enableRtl,index:7,change:function(e){t.resetFormValues(),t.triggerChangeEvent()}}),this.monthValue.appendTo(this.element.querySelector("."+$a))},i.prototype.setDefaultValue=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll(".e-control .e-numerictextbox"));e<t.length;e++){var i=t[e].ej2_instances[0];i.element.classList.contains(Xa)?(i.value=1,i.dataBind()):i.element.classList.contains(gs)&&(i.value=10,i.dataBind())}},i.prototype.resetFormValues=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll('.e-control [type="text"]'));e<t.length;e++){var i=t[e],n=void 0;if(i.classList.contains("e-datepicker"))(n=i.ej2_instances[0]).value?(n.value=n.value,n.dataBind()):this.updateUntilDate(this.startDate);else if(i.classList.contains("e-dropdownlist"))(n=i.ej2_instances[0]).index=n.index||0,n.dataBind();else if(i.classList.contains("e-numerictextbox")){var r=void 0;r=(n=i.ej2_instances[0]).element.classList.contains(Xa)?1:n.element.classList.contains(gs)?10:this.startDate.getDate(),n.value=n.value||r,n.dataBind()}}},i.prototype.getPopupWidth=function(){return e.Browser.isDevice?"100%":"auto"},i.prototype.renderDatePickers=function(){var t=this;this.untilDateObj=new n.DatePicker({firstDayOfWeek:this.firstDayOfWeek,enableRtl:this.enableRtl,locale:this.locale,min:this.minDate,max:this.maxDate,format:(0,e.isNullOrUndefined)(this.dateFormat)?this.getFormat("dateFormats"):this.dateFormat,change:function(e){e.value&&t.triggerChangeEvent()}}),this.untilDateObj.appendTo(this.element.querySelector("."+ds))},i.prototype.getFormat=function(t){return"en"===this.locale||"en-US"===this.locale?(0,e.getValue)(t+".short",(0,e.getDefaultDateObject)(this.getCalendarMode())):(0,e.getValue)("main."+this.locale+".dates.calendars."+this.getCalendarMode()+"."+t+".short",e.cldrData)},i.prototype.dayButtonRender=function(){for(var t=this,i=[].slice.call(this.element.querySelectorAll("."+Ka+" button")),n=this,r=0,a=i;r<a.length;r++){var s=a[r],o=new Na.Button({isToggle:!0,enableRtl:this.enableRtl},s);this.dayButtons.push(o),e.EventHandler.add(s,"click",(function(i){var r=[].slice.call(t.element.querySelectorAll("."+Ka+" button."+fs)),a=i.target;a.classList.contains(fs)?r.length>1&&((0,e.removeClass)([a],fs),n.triggerChangeEvent()):((0,e.addClass)([a],fs),n.triggerChangeEvent())}))}},i.prototype.radioButtonRender=function(){var e=this;this.onMonthDay=new Na.RadioButton({label:this.localeObj.getConstant("onDay"),enableRtl:this.enableRtl,name:"monthType",value:"day",change:function(){e.resetFormValues(),e.triggerChangeEvent()}}),this.onMonthDay.appendTo(this.element.querySelector("."+ts)),this.monthButtons.push(this.onMonthDay),this.onWeekDay=new Na.RadioButton({label:this.localeObj.getConstant("monthExpander"),cssClass:"e-month-type",name:"monthType",enableRtl:this.enableRtl,value:"daypos",change:function(){e.resetFormValues(),e.triggerChangeEvent()}}),this.onWeekDay.appendTo(this.element.querySelector("."+ss)),this.monthButtons.push(this.onWeekDay)},i.prototype.numericTextboxRender=function(){var e=this;this.recurrenceCount=new La.NumericTextBox({value:10,format:"#",enableRtl:this.enableRtl,min:1,max:999,change:function(){e.triggerChangeEvent()}}),this.recurrenceCount.appendTo(this.element.querySelector("."+gs)),this.monthDate=new La.NumericTextBox({value:1,format:"#",enableRtl:this.enableRtl,min:1,max:31,change:function(){e.onMonthDay.setProperties({checked:!0}),e.triggerChangeEvent()}}),this.monthDate.appendTo(this.element.querySelector("."+as)),this.repeatInterval=new La.NumericTextBox({value:1,format:"#",min:1,max:999,enableRtl:this.enableRtl,floatLabelType:"Always",placeholder:this.localeObj.getConstant("repeatEvery"),change:function(){e.triggerChangeEvent()}}),this.repeatInterval.appendTo(this.element.querySelector("."+Xa))},i.prototype.renderComponent=function(){this.setTemplate(),this.renderDropdowns(),this.renderDatePickers(),this.dayButtonRender(),this.radioButtonRender(),this.numericTextboxRender()},i.prototype.rotateArray=function(e,t){for(var i,n=0;n<t;n++)i=e.shift(),e.push(i)},i.prototype.getEndData=function(){var e=this,t=[];return this.endTypes.forEach((function(i){t.push({text:e.localeObj.getConstant(i),value:i})})),t},i.prototype.getDayPosition=function(e){var t=new Date(e.getTime()),i=new Date(e.getTime()),n=e.getDay(),r=[];for(t=this.calendarUtil.getMonthStartDate(t),i=this.calendarUtil.getMonthEndDate(i);t<i;)t.getDay()===n&&r.push(t.getTime()),t.setDate(t.getDate()+1);return r.indexOf(e.getTime())===r.length-1?-1:r.indexOf(e.getTime())+1},i.prototype.getRepeatData=function(){var e=[],t=this;return this.frequencies.forEach((function(i){var n=i===Ds?Es:i;e.push({text:t.localeObj.getConstant(n),value:i})})),e},i.prototype.getMonthPosData=function(){var e={first:1,second:2,third:3,fourth:4,last:-1},t=this,i=[];return["first","second","third","fourth","last"].forEach((function(n){i.push({text:t.localeObj.getConstant(n),value:e[""+n]})})),i},i.prototype.getDayData=function(t){var i,n=["sun","mon","tue","wed","thu","fri","sat"],r=[];if(this.rotateArray(n,this.firstDayOfWeek),"en"===this.locale||"en-US"===this.locale){var a="days.stand-alone.";i=(0,e.getValue)(a+t,(0,e.getDefaultDateObject)(this.getCalendarMode()))}else{a="main."+this.locale+".dates.calendars."+this.getCalendarMode()+".days.stand-alone."+t;i=(0,e.getValue)(a,e.cldrData)}for(var s=0,o=n;s<o.length;s++){var l=o[s],p=(0,e.getValue)(l,i);r.push({text:"narrow"===t?p:je(p,"single"),value:Gs[""+l]})}return r},i.prototype.getMonthData=function(){var t,i=[];if("en"===this.locale||"en-US"===this.locale){var n="months.stand-alone.wide";t=(0,e.getValue)(n,(0,e.getDefaultDateObject)(this.getCalendarMode()))}else{n="main."+this.locale+".dates.calendars."+this.getCalendarMode()+".months.stand-alone.wide";t=(0,e.getValue)(n,e.cldrData)}for(var r=0,a=Object.keys(t);r<a.length;r++){var s=a[r];i.push({text:je((0,e.getValue)(s,t),"single"),value:s})}return i},i.prototype.setTemplate=function(){var e=this.getDayData("narrow"),t=this.getDayData("wide");this.element.innerHTML='<div class="e-editor"><div class="'+Ya+" "+ns+'"><input type="text" tabindex="0" class="'+Ga+'"label="'+Ga.substr(2)+'" /></div><div class="'+Ya+" "+Qa+" "+rs+'"><table class="'+Ts+' e-repeat-content-wrapper" role="none"><tr><td><input type="text" tabindex="0" id="'+this.element.id+"_"+Xa+'" class="'+Xa+'"title="'+this.localeObj.getConstant("repeatEvery")+'" /></td><td><span class="'+ws+'"></span></td></tr></table></div><div class="'+_a+" "+Ka+" "+ns+'"><div class=e-week-expander-label>'+this.localeObj.getConstant("on")+'</div><button type="button" class="e-round" data-index="0" title="'+t[0].text+'">'+e[0].text+'</button><button type="button" class="e-round" data-index="1" title="'+t[1].text+'">'+e[1].text+'</button><button type="button" class="e-round" data-index="2" title="'+t[2].text+'">'+e[2].text+'</button><button type="button" class="e-round" data-index="3" title="'+t[3].text+'">'+e[3].text+'</button><button type="button" class="e-round" data-index="4" title="'+t[4].text+'">'+e[4].text+'</button><button type="button" class="e-round" data-index="5" title="'+t[5].text+'">'+e[5].text+'</button><button type="button" class="e-round" data-index="6" title="'+t[6].text+'">'+e[6].text+'</button></div><div class="'+_a+" "+Za+" "+ns+'"><div class=e-month-expander-label>'+this.localeObj.getConstant("on")+'</div><div class="'+Ja+'"><input class="'+$a+'" type="text" tabindex="0" title="'+this.localeObj.getConstant("yearExpander")+'"/></div><div class="'+es+'"><table class="'+Ts+' e-month-expand-wrapper" role="none"><tr><td><div class="'+Ya+" "+is+'"><input class="'+ts+'"title="'+this.localeObj.getConstant("monthExpander")+'" type="radio"></div></td><td colspan="2"><div class="'+Ya+' e-monthday-element"><input type="text" tabindex="0" id="'+this.element.id+"_"+as+'" class="'+as+'"title="'+this.localeObj.getConstant("on")+'" /></div></td></tr><tr><td><div class="'+Ya+" "+is+' e-repeat-on-week-selector"><input class="'+ss+'"title="'+this.localeObj.getConstant("monthExpander")+'" type="radio"></div></td><td><div class="'+Ya+' e-week-position" ><input type="text" tabindex="0" class="'+os+'"title="'+this.localeObj.getConstant("monthPosition")+'" /></div></td><td><div class="'+Ya+' e-day-position"><input type="text" tabindex="0" class="'+ls+'"title="'+this.localeObj.getConstant("monthWeek")+'" /></div></td></tr></table></div></div><div class="'+_a+" "+ps+" "+rs+'"><div class="'+Ya+' e-end-on-left"><input type="text" tabindex="0" class="'+cs+'"title="'+this.localeObj.getConstant("end")+'" /></div><div class="'+Ya+" "+hs+'" ><input type="text" tabindex="0" class="'+ds+'"title="'+this.localeObj.getConstant(xs)+'" /></div><div class="'+Ya+" "+us+'"><input type="text" tabindex="0" id="'+this.element.id+"_"+gs+'" class="'+gs+'"title="'+this.localeObj.getConstant(Vs)+'" /></div></div></div></div>'},i.prototype.getSelectedDaysData=function(){var e=ks+zs,t=[].slice.call(this.element.querySelectorAll("."+Ka+" button."+fs)),i=[Ns,Ls,qs,Fs,Us,Bs,Ws];this.rotateArray(i,this.firstDayOfWeek);for(var n=0;n<t.length;n++)e+=i[parseInt(t[parseInt(n.toString(),10)].getAttribute("data-index"),10)]+(n===t.length-1?"":",");return e+Ys},i.prototype.getSelectedMonthData=function(){return this.onWeekDay.checked?ks+zs+this.monthWeekDays.value+Ys+"BYSETPOS"+zs+this.monthWeekPos.value+Ys:"BYMONTHDAY="+this.monthDate.value+Ys},i.prototype.getIntervalData=function(){return"INTERVAL="+this.repeatInterval.value+Ys},i.prototype.getEndOnCount=function(){return"COUNT="+this.recurrenceCount.value+Ys},i.prototype.getYearMonthRuleData=function(){return"BYMONTH="+this.monthValue.value+Ys},i.prototype.updateWeekButton=function(e){var t=[Ns,Ls,qs,Fs,Us,Bs,Ws];this.rotateArray(t,this.firstDayOfWeek);for(var i=0,n=this.dayButtons;i<n.length;i++){var r=n[i],a=parseInt(r.element.getAttribute("data-index"),10);-1!==e.indexOf(t[parseInt(a.toString(),10)])?r.setProperties({isPrimary:!0}):r.setProperties({isPrimary:!1})}},i.prototype.updateMonthUI=function(){if(this.ruleObject.monthDay.length)this.monthDate.setProperties({value:this.ruleObject.monthDay[0]}),this.onMonthDay.setProperties({checked:!0});else{this.onWeekDay.setProperties({checked:!0}),this.monthWeekPos.setProperties({value:this.ruleObject.setPosition});for(var e=0,t=Object.keys(Gs);e<t.length;e++){var i=t[e];if(Gs[""+i]===this.ruleObject.day[0]){this.monthWeekDays.setProperties({value:this.ruleObject.day[0]});break}}}},i.prototype.updateUI=function(e,t){switch(this.repeatInterval.setProperties({value:this.ruleObject.interval}),t){case xs:this.untilDateObj.setProperties({value:this.ruleObject.until});break;case Vs:this.recurrenceCount.setProperties({value:this.ruleObject.count})}switch(e){case Ss:this.updateWeekButton(this.ruleObject.day);break;case Os:this.monthValue.setProperties({index:this.ruleObject.month[0]-1}),this.updateMonthUI();break;case Cs:this.updateMonthUI()}},i.prototype.getUntilData=function(){return this.untilDateObj.value?"UNTIL="+Ea(this.untilDateObj.value)+Ys:""},i.prototype.destroyComponents=function(){this.recurrenceCount.isDestroyed||(this.recurrenceCount.destroy(),this.recurrenceCount=null),this.monthDate.isDestroyed||(this.monthDate.destroy(),this.monthDate=null),this.repeatInterval.isDestroyed||(this.repeatInterval.destroy(),this.repeatInterval=null),this.untilDateObj.isDestroyed||(this.untilDateObj.destroy(),this.untilDateObj=null),this.repeatType.isDestroyed||(this.repeatType.destroy(),this.repeatType=null),this.endType.isDestroyed||(this.endType.destroy(),this.endType=null),this.monthWeekPos.isDestroyed||(this.monthWeekPos.destroy(),this.monthWeekPos=null),this.monthWeekDays.isDestroyed||(this.monthWeekDays.destroy(),this.monthWeekDays=null),this.monthValue.isDestroyed||(this.monthValue.destroy(),this.monthValue=null),this.onMonthDay.isDestroyed||(this.onMonthDay.destroy(),this.onMonthDay=null),this.onWeekDay.isDestroyed||(this.onWeekDay.destroy(),this.onWeekDay=null),this.dayButtons.forEach((function(e){e.isDestroyed||e.destroy()})),this.dayButtons=[],this.monthButtons.forEach((function(e){e.isDestroyed||e.destroy()})),this.monthButtons=[]},i.prototype.resetFields=function(){this.startState(Ds,this.endTypes[0],this.startDate),this.setDefaultValue()},i.prototype.updateRuleUntilDate=function(e){if(this.untilDateObj.value&&e){var t=this.untilDateObj.value,i=new Date(t.getFullYear(),t.getMonth(),t.getDate(),e.getHours(),e.getMinutes(),e.getMilliseconds());this.untilDateObj.setProperties({value:i})}},i.prototype.getCalendarMode=function(){return(0,e.isNullOrUndefined)(this.calendarMode)?"gregorian":this.calendarMode.toLowerCase()},i.prototype.getRuleSummary=function(e){return void 0===e&&(e=this.getRecurrenceRule()),Ar(e,this.localeObj,this.locale,this.calendarMode)},i.prototype.getRecurrenceDates=function(t,i,n,r,a){return a=(0,e.isNullOrUndefined)(a)?this.startDate:a,Mr(t,i,n,this.firstDayOfWeek,r,a,this.calendarMode)},i.prototype.getRecurrenceRule=function(){var e="FREQ=";switch(this.repeatType.value){case bs:e+=Rs+Ys;break;case Ss:e+=Hs+Ys+this.getSelectedDaysData();break;case Cs:e+=Ps+Ys+this.getSelectedMonthData();break;case Os:e+=js+Ys+this.getSelectedMonthData()+this.getYearMonthRuleData();break;case Ds:return""}switch(e+=this.getIntervalData(),this.endType.value){case xs:e+=this.getUntilData();break;case Vs:e+=this.getEndOnCount()}return e},i.prototype.setRecurrenceRule=function(e,t){if(void 0===t&&(t=this.startDate),e){this.renderStatus=!1,this.ruleObject=Jr(e);var i=this.ruleObject.count?Vs:this.ruleObject.until?xs:Es;switch(this.ruleObject.freq){case Rs:this.startState(bs,i,t),this.updateUI(bs,i);break;case Hs:this.startState(Ss,i,t),this.updateUI(Ss,i);break;case Ps:this.startState(Cs,i,t),this.updateUI(Cs,i);break;case js:this.startState(Os,i,t),this.updateUI(Os,i)}this.renderStatus=!0,this.triggerChangeEvent()}else this.repeatType.setProperties({value:Ds})},i.prototype.detachInputs=function(){for(var t=0,i=[].slice.call(this.element.querySelectorAll("input"));t<i.length;t++){var n=i[t];(0,e.detach)(n)}},i.prototype.destroy=function(){if(!this.isDestroyed){this.destroyComponents(),t.prototype.destroy.call(this);var i=["e-"+this.getModuleName()];for(this.cssClass&&(i=i.concat(this.cssClass.split(" "))),(0,e.removeClass)([this.element],i),this.detachInputs();this.element.firstElementChild;)this.element.removeChild(this.element.firstElementChild)}},i.prototype.getModuleName=function(){return"recurrenceeditor"},i.prototype.getPersistData=function(){return this.addOnPersist([])},i.prototype.render=function(){this.initialize(),this.rtlClass(this.enableRtl),this.renderStatus=!0,this.renderComplete()},i.prototype.onPropertyChanged=function(t,i){for(var n=0,r=Object.keys(t);n<r.length;n++){switch(r[n]){case"startDate":this.selectMonthDay(t.startDate),this.updateUntilDate(t.startDate),this.endType.setProperties({index:0});break;case"enableRtl":this.rtlClass(t.enableRtl);break;case"cssClass":i.cssClass&&(0,e.removeClass)([this.element],i.cssClass.split(" ")),t.cssClass&&(0,e.addClass)([this.element],t.cssClass.split(" "));break;case"selectedType":this.repeatType.setProperties({index:this.selectedType});break;case"minDate":this.untilDateObj.setProperties({min:this.minDate});break;case"maxDate":this.untilDateObj.setProperties({max:this.maxDate});break;case"value":this.getRecurrenceRule()!==this.value&&this.setRecurrenceRule(this.value);break;case"calendarMode":this.calendarMode=t.calendarMode,this.calendarUtil=ra(t.calendarMode);break;case"locale":case"frequencies":case"firstDayOfWeek":case"endTypes":this.refresh();break;case"dateFormat":this.untilDateObj.setProperties({format:t.dateFormat})}}},za([(0,e.Property)(["none","daily","weekly","monthly","yearly"])],i.prototype,"frequencies",void 0),za([(0,e.Property)(["never","until","count"])],i.prototype,"endTypes",void 0),za([(0,e.Property)(0)],i.prototype,"firstDayOfWeek",void 0),za([(0,e.Property)(new Date)],i.prototype,"startDate",void 0),za([(0,e.Property)()],i.prototype,"dateFormat",void 0),za([(0,e.Property)("Gregorian")],i.prototype,"calendarMode",void 0),za([(0,e.Property)()],i.prototype,"cssClass",void 0),za([(0,e.Property)()],i.prototype,"value",void 0),za([(0,e.Property)(new Date(1900,0,1))],i.prototype,"minDate",void 0),za([(0,e.Property)(new Date(2099,11,31))],i.prototype,"maxDate",void 0),za([(0,e.Property)(0)],i.prototype,"selectedType",void 0),za([(0,e.Event)()],i.prototype,"change",void 0),za([(0,e.Event)()],i.prototype,"created",void 0),za([(0,e.Event)()],i.prototype,"destroyed",void 0),i=za([e.NotifyPropertyChanges],i)}(e.Component),no="e-field",ro="e-recurrence-container",ao="e-hide",so=function(){function i(e){this.parent=e,this.l10n=this.parent.localeObj,this.fields=this.parent.eventFields,this.eventWindowTime={startTime:new Date,endTime:new Date},this.renderEventWindow()}return i.prototype.renderEventWindow=function(){this.element=(0,e.createElement)("div",{id:this.parent.element.id+"_dialog_wrapper"}),this.parent.element.appendChild(this.element);var i={animationSettings:{effect:"Zoom"},content:this.getEventWindowContent(),cssClass:Tn,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,height:this.parent.isAdaptive?"100%":"auto",minHeight:"300px",isModal:!0,showCloseIcon:!this.parent.isAdaptive,target:document.body,visible:!1,width:"500px",beforeOpen:this.onBeforeOpen.bind(this),beforeClose:this.onBeforeClose.bind(this)};this.parent.isAdaptive?(i.cssClass=Tn+" "+Be,this.parent.editorHeaderTemplate||(i.header='<div class="e-title-header"><div class="e-back-icon e-icons"></div><div class="e-title-text">'+this.l10n.getConstant("newEvent")+'</div><div class="e-save-icon e-icons"></div></div>')):(this.parent.editorFooterTemplate||this.renderDialogButtons(i),this.parent.editorHeaderTemplate||(i.header='<div class="e-title-text">'+this.l10n.getConstant("newEvent")+"</div>")),this.dialogObject=new t.Dialog(i,this.element),this.dialogObject.element.querySelector(".e-dlg-closeicon-btn")&&this.dialogObject.element.querySelector(".e-dlg-closeicon-btn").setAttribute("title",this.l10n.getConstant("close")),this.addEventHandlers(),(0,e.addClass)([this.element.parentElement],Tn+"-container"),e.EventHandler.add(this.dialogObject.element,"keydown",this.preventEventSave,this),this.applyFormValidation()},i.prototype.renderDialogButtons=function(e){e.buttons=[{buttonModel:{content:this.l10n.getConstant("deleteButton"),cssClass:Ji,disabled:!this.parent.eventSettings.allowDeleting||this.parent.readonly},click:this.eventDelete.bind(this)},{buttonModel:{content:this.l10n.getConstant("saveButton"),cssClass:"e-primary "+jn,isPrimary:!0,disabled:!this.parent.eventSettings.allowAdding||this.parent.readonly},click:this.eventSave.bind(this)},{buttonModel:{cssClass:Pn,content:this.l10n.getConstant("cancelButton")},click:this.dialogClose.bind(this)}]},i.prototype.addEventHandlers=function(){var t=this.element.querySelector(".e-back-icon"),i=this.element.querySelector("."+Hn);!this.parent.isAdaptive||(0,e.isNullOrUndefined)(t)||(0,e.isNullOrUndefined)(i)||(e.EventHandler.add(t,"click",this.dialogClose,this),e.EventHandler.add(i,"click",this.eventSave,this))},i.prototype.refresh=function(){this.destroy(!0),this.renderEventWindow()},i.prototype.refreshRecurrenceEditor=function(){if(this.recurrenceEditor){var e=this.recurrenceEditor.element;this.recurrenceEditor.destroy(),this.createRecurrenceEditor(e)}},i.prototype.setRecurrenceEditor=function(e){this.parent.editorTemplate&&(this.recurrenceEditor=e)},i.prototype.openEditor=function(t,i,n,r){if(this.parent.currentAction=i,this.parent.removeNewEventElement(),this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide(!0),this.parent.inlineModule.removeInlineAppointmentElement(),"Add"===i){var a={};this.cellClickAction=!n,this.parent.activeCellsData=t;var s=t;this.cellClickAction?this.convertToEventData(s,a):(this.parent.activeCellsData={startTime:s.startTime||s[this.fields.startTime],endTime:s.endTime||s[this.fields.endTime],isAllDay:s.isAllDay||s[this.fields.isAllDay],element:s.element,groupIndex:s.groupIndex},a=s),t=a}(0,e.isNullOrUndefined)(this.parent.editorHeaderTemplate)||(this.parent.resetTemplates(["editorHeaderTemplate"]),this.parent.isAdaptive&&!this.parent.editorFooterTemplate?this.dialogObject.header=this.createAdaptiveHeaderElement(t):this.dialogObject.header=this.getDialogHeader(t)),(0,e.isNullOrUndefined)(this.parent.editorFooterTemplate)||(this.parent.resetTemplates(["editorFooterTemplate"]),this.dialogObject.footerTemplate=this.getDialogFooter(t)),(0,e.isNullOrUndefined)(this.parent.editorHeaderTemplate)&&(0,e.isNullOrUndefined)(this.parent.editorFooterTemplate)||(this.dialogObject.dataBind(),this.addEventHandlers()),(0,e.isNullOrUndefined)(this.parent.editorTemplate)?this.setEditorContent(t,i,r):this.renderFormElements(this.element.querySelector(".e-schedule-form"),t,i,r)},i.prototype.setEditorContent=function(t,i,n){switch(!this.parent.isAdaptive&&(0,e.isNullOrUndefined)(this.parent.editorTemplate)&&(0,e.removeClass)([this.dialogObject.element.querySelector(".e-recurrenceeditor")],Ge),this.recurrenceEditor&&(this.recurrenceEditor.firstDayOfWeek=this.parent.activeViewOptions.firstDayOfWeek),i){case"Add":this.onCellDetailsUpdate(t,n);break;case"Save":case"EditOccurrence":case"EditSeries":case"EditFollowingEvents":"EditOccurrence"===i&&!this.parent.isAdaptive&&(0,e.isNullOrUndefined)(this.parent.editorTemplate)&&(0,e.addClass)([this.dialogObject.element.querySelector(".e-recurrenceeditor")],Ge),this.cellClickAction=!1,this.onEventDetailsUpdate(t)}},i.prototype.setDialogContent=function(){this.dialogObject.content=this.getEventWindowContent(),this.dialogObject.dataBind(),this.applyFormValidation()},i.prototype.setDialogHeader=function(){(0,e.isNullOrUndefined)(this.parent.editorHeaderTemplate)?this.parent.isAdaptive?this.dialogObject.header='<div class="e-title-header"><div class="e-back-icon e-icons"></div><div class="e-title-text">'+this.l10n.getConstant("newEvent")+'</div><div class="e-save-icon e-icons"></div></div>':this.dialogObject.header='<div class="e-title-text">'+this.l10n.getConstant("newEvent")+"</div>":(this.parent.resetTemplates(["editorHeaderTemplate"]),this.parent.isAdaptive&&!this.parent.editorFooterTemplate?this.dialogObject.header=this.createAdaptiveHeaderElement():this.dialogObject.header=this.getDialogHeader()),this.dialogObject.dataBind(),this.addEventHandlers()},i.prototype.setDialogFooter=function(){(0,e.isNullOrUndefined)(this.parent.editorFooterTemplate)?!this.parent.isAdaptive&&(0,e.isNullOrUndefined)(this.parent.editorFooterTemplate)?this.renderDialogButtons(this.dialogObject):this.parent.isAdaptive&&(0,e.isNullOrUndefined)(this.parent.editorFooterTemplate)&&(this.dialogObject.footerTemplate=null):(this.parent.resetTemplates(["editorFooterTemplate"]),this.dialogObject.footerTemplate=this.getDialogFooter()),this.dialogObject.dataBind()},i.prototype.createAdaptiveHeaderElement=function(t){var i=(0,e.createElement)("div",{className:"e-title-header"}),n=(0,e.createElement)("div",{className:"e-back-icon e-icons"});i.appendChild(n);var r=this.getDialogHeader(t);i.appendChild(r);var a=(0,e.createElement)("div",{className:"e-save-icon e-icons"});return i.appendChild(a),i},i.prototype.getDialogHeader=function(t){var i,n=this.parent.element.id+"_editorHeaderTemplate",r=document.createElement("div");return i=[].slice.call(this.parent.getEditorHeaderTemplate()(t||{},this.parent,"editorHeaderTemplate",n,!1)),(0,e.append)(i,r),r},i.prototype.getDialogFooter=function(t){var i,n=this.parent.element.id+"_editorFooterTemplate",r=document.createElement("div");return i=[].slice.call(this.parent.getEditorFooterTemplate()(t||{},this.parent,"editorFooterTemplate",n,!1)),(0,e.append)(i,r),r},i.prototype.preventEventSave=function(e){this.parent&&!this.parent.allowKeyboardInteraction&&"Enter"===e.code&&(this.isEnterKey=!0)},i.prototype.onBeforeOpen=function(t){var i=this,n=this.eventData[this.fields.endTime].getTime(),r={type:"Editor",data:this.eventData,cancel:!1,element:this.element,target:this.cellClickAction?this.parent.activeCellsData.element:this.parent.activeEventData.element};this.cellClickAction&&(r.duration=this.getSlotDuration());var a=this.getInstance(jn);a&&(a.disabled=!(this.cellClickAction?this.parent.eventSettings.allowAdding:this.parent.eventSettings.allowEditing),a.dataBind());var s=this.getInstance(Ji);s&&(s.disabled=!this.parent.eventSettings.allowDeleting,s.dataBind());var o=new Sr.Deferred;return this.parent.trigger(D,r,(function(r){if(t.cancel=r.cancel,t.maxHeight=i.parent.isAdaptive?"max-content":t.maxHeight,i.duration=i.cellClickAction?r.duration:null,i.eventData[i.fields.endTime].getTime()!==n||i.cellClickAction||0!==i.eventData[i.fields.endTime].getHours()||0!==i.eventData[i.fields.endTime].getMinutes()||(i.eventData=(0,e.extend)({},i.eventData,null,!0),i.trimAllDay(i.eventData)),i.refreshDateTimePicker(i.duration),i.cellClickAction&&r.duration!==i.getSlotDuration()&&(0,e.isNullOrUndefined)(i.parent.editorTemplate)){var a=i.getInstance(xn),s=i.getInstance(Vn);s.value=new Date(a.value.getTime()+ne*r.duration),s.dataBind()}i.parent.editorTemplate&&i.element.querySelector(".e-recurrenceeditor")&&!i.recurrenceEditor&&(i.recurrenceEditor=i.getInstance("e-recurrenceeditor")),o.resolve(t)})),o},i.prototype.onBeforeClose=function(e){var t=this;e.isInteracted&&(this.isCrudAction=!1);var i={type:"Editor",event:e.event||this.dialogEvent,data:this.eventCrudData,cancel:!1,element:this.element,target:this.cellClickAction?this.parent.activeCellsData.element:this.parent.activeEventData.element},n=new Sr.Deferred;return this.parent.trigger(b,i,(function(i){e.cancel=i.cancel,i.cancel||(t.isCrudAction&&(e.cancel=t.processCrudActions(i.data),t.isCrudAction=e.cancel),t.isCrudAction||(t.resetForm(),t.parent.eventBase.focusElement(!0),t.eventCrudData=null)),n.resolve(e)})),n},i.prototype.getEventWindowContent=function(){var t=(0,e.createElement)("div",{className:"e-form-container"}),i=(0,e.createElement)("form",{id:this.parent.element.id+"EditForm",className:wn,attrs:{onsubmit:"return false;"}});return this.renderFormElements(i),t.appendChild(i),t},i.prototype.renderFormElements=function(t,i,n,r){var a=this;if((0,e.isNullOrUndefined)(this.parent.editorTemplate))t.appendChild(this.getDefaultEventWindowContent()),i&&this.setEditorContent(i,n,r);else{if(i&&(this.fieldValidator&&(this.fieldValidator.destroy(),this.fieldValidator=null),this.recurrenceEditor&&(this.recurrenceEditor.destroy(),this.recurrenceEditor=null),this.destroyComponents(),this.parent.resetTemplates(["editorTemplate"]),e.EventHandler.clearEvents(t),!this.parent.isReact))for(var s=0,o=[].slice.call(t.children);s<o.length;s++){var l=o[s];(0,e.remove)(l)}var p=this.parent.element.id+"_editorTemplate",c=[].slice.call(this.parent.getEditorTemplate()(i||{},this.parent,"editorTemplate",p,!1));(0,e.append)(c,t),this.parent.renderTemplates((function(){a.element&&(a.applyFormValidation(),i&&a.setEditorContent(i,n,r))}))}},i.prototype.getDefaultEventWindowContent=function(){var t=this.createDivElement("e-dialog-parent"),i=this.createDivElement("e-title-location-row");t.appendChild(i),i.appendChild(this.renderTextBox(Cn)),i.appendChild(this.renderTextBox(On));var n=this.createDivElement("e-start-end-row");t.appendChild(n),n.appendChild(this.renderDateTimePicker(xn,this.onTimeChange.bind(this))),n.appendChild(this.renderDateTimePicker(Vn));var r=this.createDivElement("e-all-day-time-zone-row");t.appendChild(r),r.appendChild(this.renderCheckBox(Dn)),r.appendChild(this.renderCheckBox(bn));var a=this.createDivElement(Mn);t.appendChild(a),a.appendChild(this.renderDropDown(kn)),a.appendChild(this.renderDropDown(Rn));var s=this.createDivElement("e-repeat-parent-row");t.appendChild(s);var o=this.renderCheckBox(Sn),l=(0,e.createElement)("span",{className:ro}),p=(0,e.createElement)("button",{className:"e-recurrence-edit-button",attrs:{type:"button",title:this.l10n.getConstant("editRecurrence")}});if(this.buttonObj=new Na.Button({iconCss:"e-recurrence-edit e-icons",cssClass:"e-medium "+this.parent.cssClass}),l.appendChild(p),this.buttonObj.appendTo(p),o.appendChild(l),s.appendChild(o),this.parent.isAdaptive?e.EventHandler.add(p,"click",this.loadRecurrenceEditor,this):this.createRecurrenceEditor(t),this.parent.resourceCollection.length>0){for(var c=this.createDivElement("e-resources-row"),h=0,d=this.parent.resourceBase.resourceCollection;h<d.length;h++){var u=d[h];c.appendChild(this.renderResourceDetails(u))}t.appendChild(c)}var g=this.createDivElement(An+"-row");g.appendChild(this.renderTextBox(An)),t.appendChild(g);var v=(0,e.createElement)("button",{attrs:{type:"hidden",title:"submit"}});return v.style.display="none",t.appendChild(v),t},i.prototype.createRecurrenceEditor=function(t){var i=(0,e.createElement)("div",{id:this.parent.element.id+"_recurrence_editor"});t.appendChild(i),this.recurrenceEditor=this.renderRecurrenceEditor(),this.recurrenceEditor.appendTo(i),this.updateMinMaxDateToEditor()},i.prototype.createDivElement=function(t){return(0,e.createElement)("div",{className:t})},i.prototype.createInputElement=function(t,i,n){return(0,e.createElement)(n||"input",{className:t,attrs:{type:"text",name:i,value:"",id:i}})},i.prototype.getSlotDuration=function(){return this.parent.activeViewOptions.timeScale.interval/this.parent.activeViewOptions.timeScale.slotCount},i.prototype.renderDateTimePicker=function(t,i){var r=this.createDivElement(t+"-container"),a=this.getFieldName(t),s=this.createInputElement(t+" "+no,a);return r.appendChild(s),new n.DateTimePicker({change:i,firstDayOfWeek:this.parent.activeViewOptions.firstDayOfWeek,calendarMode:this.parent.calendarMode,min:this.parent.minDate,max:new Date(new Date(+this.parent.maxDate).setHours(23,59,59)),cssClass:this.parent.cssClass,enableRtl:this.parent.enableRtl,locale:this.parent.locale,floatLabelType:"Always",strictMode:!0,timeFormat:this.parent.activeViewOptions.timeFormat,format:((0,e.isNullOrUndefined)(this.parent.dateFormat)?this.getFormat("dateFormats"):this.parent.dateFormat)+" "+this.parent.activeViewOptions.timeFormat,placeholder:this.getFieldLabel(t),step:this.getSlotDuration(),width:"100%"}).appendTo(s),r},i.prototype.refreshDateTimePicker=function(e){for(var t="."+xn+",."+Vn,i=0,n=[].slice.call(this.element.querySelectorAll(t));i<n.length;i++){var r=n[i].ej2_instances[0];r.firstDayOfWeek=this.parent.activeViewOptions.firstDayOfWeek,r.timeFormat=this.parent.activeViewOptions.timeFormat,r.step=e||this.getSlotDuration(),r.dataBind()}},i.prototype.onTimeChange=function(){var t=this.getInstance(xn);if(t.element.parentElement.classList.contains("e-input-focus")){var i=this.getInstance(Vn),n=0;this.cellClickAction?(n=ne*this.duration,this.eventWindowTime.startTime=t.value):n=this.eventData[this.fields.endTime].getTime()-this.eventData[this.fields.startTime].getTime();var r=(0,e.isNullOrUndefined)(t.value)?null:new Date(t.value.getTime()+n);this.cellClickAction&&(this.eventWindowTime.endTime=r),i.value=r,i.dataBind()}this.recurrenceEditor&&this.recurrenceEditor.updateRuleUntilDate(this.eventWindowTime.startTime)},i.prototype.renderResourceDetails=function(t){var i=this,n=t.field,r="e-"+n,a=t.title,s=this.createDivElement(r+"-container e-resources"),o=this.createInputElement(r+" "+no,n);s.appendChild(o);var l=function(i){return e.SanitizeHtmlHelper.sanitize('<div class="e-resource-template">\n <div class="e-resource-color" data-resource-color="'+i[t.colorField]+'"></div>\n <div class="e-resource-text">'+i[t.textField]+"</div></div>")};((0,e.initializeCSPTemplate)(l,t),t.allowMultiple)?new Ba.MultiSelect({enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:this.parent.cssClass||"",dataSource:t.dataSource,change:this.onMultiselectResourceChange.bind(this),itemTemplate:l,fields:{text:t.textField,value:t.idField},htmlAttributes:{name:n},floatLabelType:"Always",placeholder:a,popupHeight:"230px",popupWidth:"447px",mode:"Box",open:function(e){Promise.resolve().then((function(){i.applyStylesAfterRender(e)}))}}).appendTo(o):new Ba.DropDownList({cssClass:this.parent.cssClass||"",change:this.onDropdownResourceChange.bind(this),dataSource:t.dataSource,enableRtl:this.parent.enableRtl,fields:{text:t.textField,value:t.idField},htmlAttributes:{name:n},floatLabelType:"Always",placeholder:a,popupHeight:"230px",popupWidth:"447px",itemTemplate:l,open:function(e){Promise.resolve().then((function(){i.applyStylesAfterRender(e)}))}}).appendTo(o);return s},i.prototype.applyStylesAfterRender=function(e){e.popup&&e.popup.element&&e.popup.element.querySelectorAll(".e-resource-color[data-resource-color]").forEach((function(e){var t=e.getAttribute("data-resource-color");t&&(e.style.backgroundColor=t)}))},i.prototype.renderDropDown=function(e){var t=this,i=this.getFieldName(e),n=this.createDivElement(e+"-container"),r=this.createInputElement(e+" "+no,i);return n.appendChild(r),new Ba.DropDownList({allowFiltering:!0,change:this.onTimezoneChange.bind(this),cssClass:this.parent.cssClass||"",dataSource:this.parent.timezoneDataSource,enableRtl:this.parent.enableRtl,fields:{text:"Text",value:"Value"},filterBarPlaceholder:this.parent.localeObj.getConstant("searchTimezone"),noRecordsTemplate:this.parent.localeObj.getConstant("noRecords"),filtering:function(e){var i=new Sr.Query;i=""!==e.text?i.where("Text","contains",e.text,!0):i,e.updateData(t.parent.timezoneDataSource,i)},htmlAttributes:{title:this.getFieldLabel(e),name:i},floatLabelType:"Always",placeholder:this.getFieldLabel(e),popupHeight:"230px"}).appendTo(r),n},i.prototype.onMultiselectResourceChange=function(t){if(t.value&&this.parent.activeViewOptions.group.byGroupID&&!(this.parent.resourceCollection.length<=1))for(var i=this.parent.resourceBase.resourceCollection,n=t.element.getAttribute("name")||this.getColumnName(t.element),r=0;r<i.length;r++)if(i[parseInt(r.toString(),10)].field===n&&r<i.length-1){for(var a=this.createInstance(r),s=[],o=function(n){var a=i[r+1],o=a.dataSource.filter((function(e){return e[a.groupIDField]===t.value[parseInt(n.toString(),10)]}))[0],p=(0,e.isNullOrUndefined)(o)?null:o[i[r+1].groupIDField],c=l.filterDatasource(r,p);s=s.concat(c)},l=this,p=0;p<t.value.length;p++)o(p);a.dataSource=s,a.dataBind()}},i.prototype.createInstance=function(e){var t=this.parent.resourceBase.resourceCollection[e+1],i=this.element.querySelector(".e-"+t.field).ej2_instances[0];return i.clear(),i},i.prototype.onDropdownResourceChange=function(e){if(e.value&&!(this.parent.resourceCollection.length<=1)&&this.parent.activeViewOptions.group.byGroupID)for(var t=e.element.getAttribute("name")||this.getColumnName(e.element),i=this.parent.resourceBase.resourceCollection,n=0;n<i.length;n++)if(n<i.length-1&&i[parseInt(n.toString(),10)].field===t){var r=this.createInstance(n),a=e.itemData[i[parseInt(n.toString(),10)].idField];r.dataSource=this.filterDatasource(n,a),r.dataBind();var s=r.dataSource.length>0?r.dataSource[0][i[n+1].idField]:null;r.value=i[n+1].allowMultiple?[s]:s,r.dataBind()}},i.prototype.filterDatasource=function(e,t){var i=this.parent.resourceBase.resourceCollection[e+1];return i.dataSource.filter((function(e){return e[i.groupIDField]===t}))},i.prototype.onTimezoneChange=function(e){if((e.element.getAttribute("name")||this.getColumnName(e.element))===this.parent.eventFields.startTimezone){var t=this.getInstance(kn),i=this.getInstance(Rn);i.value=t.value,i.dataBind()}},i.prototype.renderCheckBox=function(e){var t=this.createDivElement(e+"-container"),i=this.getFieldName(e),n=this.createInputElement(e+" "+no,i);t.appendChild(n);var r=new Na.CheckBox({change:this.onChange.bind(this),cssClass:e+" "+this.parent.cssClass,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,label:this.getFieldLabel(e)});return r.appendTo(n),n.setAttribute("name",i),"Repeat"===i&&(this.repeatStatus=r),t},i.prototype.renderTextBox=function(e){var t=this.createDivElement(e+"-container"),i=this.getFieldName(e),n=e===An?"textarea":"input",r=this.createInputElement(e+" "+no,i,n);return t.appendChild(r),La.Input.createInput({element:r,floatLabelType:"Always",properties:{enableRtl:this.parent.enableRtl,placeholder:this.getFieldLabel(e)}}),t},i.prototype.getFieldName=function(e){var t="";switch(e){case Cn:t=this.fields.subject;break;case On:t=this.fields.location;break;case xn:t=this.fields.startTime;break;case Vn:t=this.fields.endTime;break;case An:t=this.fields.description;break;case Dn:t=this.fields.isAllDay;break;case kn:t=this.fields.startTimezone;break;case Rn:t=this.fields.endTimezone;break;case bn:t="Timezone";break;case Sn:t="Repeat"}return t},i.prototype.getFieldLabel=function(e){var t="";switch(e){case Cn:t=this.parent.editorTitles.subject;break;case On:t=this.parent.editorTitles.location;break;case An:t=this.parent.editorTitles.description;break;case xn:t=this.parent.editorTitles.startTime;break;case Vn:t=this.parent.editorTitles.endTime;break;case kn:t=this.parent.editorTitles.startTimezone;break;case Rn:t=this.parent.editorTitles.endTimezone;break;case Sn:t=this.parent.editorTitles.recurrenceRule;break;case Dn:t=this.parent.editorTitles.isAllDay;break;case bn:t=this.l10n.getConstant("timezone")}return t},i.prototype.onChange=function(t){if(t.event&&t.event.target){var i="."+Dn+",."+bn+",."+Sn,n=(0,e.closest)(t.event.target,i);n.classList.contains(Dn)?this.onAllDayChange(t.checked):n.classList.contains(bn)?this.timezoneChangeStyle(t.checked):n.classList.contains(Sn)&&this.onRepeatChange(t.checked)}},i.prototype.renderRepeatDialog=function(){var i=(0,e.createElement)("div");this.repeatDialogObject=new t.Dialog({header:this.l10n.getConstant("recurrence"),visible:!1,content:'<div class="e-rec-editor"></div>',closeOnEscape:!0,width:"90%",buttons:[{click:this.repeatSaveDialog.bind(this),buttonModel:{content:this.l10n.getConstant("save"),cssClass:"e-save",isPrimary:!0}},{click:this.repeatCancelDialog.bind(this),buttonModel:{cssClass:"e-cancel",content:this.l10n.getConstant("cancel")}}],target:this.element,animationSettings:{effect:"Zoom"},enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,isModal:!0,cssClass:"e-recurrence-dialog",open:this.repeatOpenDialog.bind(this)}),this.element.appendChild(i),this.repeatDialogObject.appendTo(i),this.createRecurrenceEditor(this.repeatDialogObject.element.querySelector(".e-rec-editor"))},i.prototype.loadRecurrenceEditor=function(){this.repeatDialogObject.show(),this.recurrenceEditor&&this.repeatRule&&this.recurrenceEditor.setRecurrenceRule(this.repeatRule)},i.prototype.onRepeatChange=function(t){if(t)this.repeatDialogObject||this.renderRepeatDialog(),this.recurrenceEditor.setProperties({startDate:this.repeatStartDate,selectedType:0}),this.loadRecurrenceEditor();else{this.repeatDialogObject&&this.repeatDialogObject.hide(),this.repeatRule="",this.recurrenceEditor&&(this.recurrenceEditor.setRecurrenceRule(this.repeatRule),this.updateRepeatLabel(this.repeatRule));var i=this.element.querySelector("."+ro);(0,e.addClass)([i],ao)}},i.prototype.repeatSaveDialog=function(){this.repeatRule=this.recurrenceEditor.getRecurrenceRule();var t=this.element.querySelector("."+ro);this.recurrenceEditor.getRecurrenceRule()?(0,e.removeClass)([t],ao):((0,e.addClass)([t],ao),this.repeatStatus.setProperties({checked:!1})),this.updateRepeatLabel(this.repeatRule),this.closeRepeatDialog()},i.prototype.closeRepeatDialog=function(){this.repeatDialogObject.hide()},i.prototype.repeatCancelDialog=function(){this.closeRepeatDialog(),this.recurrenceEditor&&this.recurrenceEditor.setRecurrenceRule(this.repeatTempRule),this.repeatTempRule||this.repeatStatus.setProperties({checked:!1})},i.prototype.repeatOpenDialog=function(){this.repeatTempRule=this.recurrenceEditor.getRecurrenceRule()},i.prototype.onCellDetailsUpdate=function(t,i){if(this.parent.eventSettings.allowAdding){this.parent.isAdaptive&&i&&!this.repeatDialogObject&&this.renderRepeatDialog(),this.element.querySelector("."+wn).removeAttribute("data-id"),(0,e.isNullOrUndefined)(this.parent.editorHeaderTemplate)&&(this.element.querySelector("."+Nn).innerHTML=this.l10n.getConstant("newEvent")),t.Timezone=!1,this.repeatStartDate=t[this.fields.startTime],this.repeatRule="",(0,e.isNullOrUndefined)(this.parent.eventSettings.fields.subject.default)||(t[this.fields.subject]=this.parent.eventSettings.fields.subject.default),(0,e.isNullOrUndefined)(this.parent.eventSettings.fields.location.default)||(t[this.fields.location]=this.parent.eventSettings.fields.location.default),(0,e.isNullOrUndefined)(this.parent.eventSettings.fields.description.default)||(t[this.fields.description]=this.parent.eventSettings.fields.description.default),this.showDetails(t),t[this.fields.recurrenceRule]&&this.recurrenceEditor&&(this.recurrenceEditor.setRecurrenceRule(t[this.fields.recurrenceRule],t[this.fields.startTime]),this.repeatRule=t[this.fields.recurrenceRule]);var n=this.element.querySelector("."+Ji);if(n&&(0,e.addClass)([n],Ge),this.recurrenceEditor&&(this.recurrenceEditor.setProperties({startDate:t[this.fields.startTime],selectedType:(0,e.isNullOrUndefined)(i)?(0,e.isNullOrUndefined)(t[this.fields.recurrenceRule])?0:this.recurrenceEditor.selectedType:i}),this.repeatRule=this.recurrenceEditor.value),this.parent.isAdaptive&&(0,e.isNullOrUndefined)(this.parent.editorTemplate)){var r=this.element.querySelector("."+ro);t[this.fields.recurrenceRule]||i?((0,e.removeClass)([r],ao),this.repeatStatus.setProperties({checked:!0})):((0,e.addClass)([r],ao),this.repeatStatus.setProperties({checked:!1})),this.updateRepeatLabel(this.repeatRule)}else{var a=this.element.querySelector("."+jn);this.disableButton(a,!1)}this.dialogObject.show()}},i.prototype.convertToEventData=function(e,t){e.subject&&(t[this.fields.subject]=e.subject),t[this.fields.startTime]=e.startTime,t[this.fields.endTime]=e.endTime,t[this.fields.isAllDay]=e.isAllDay,e.RecurrenceRule&&(t[this.fields.recurrenceRule]=e.RecurrenceRule),(this.parent.resourceCollection.length>0||this.parent.activeViewOptions.group.resources.length>0)&&this.parent.resourceBase.setResourceValues(t)},i.prototype.applyFormValidation=function(){var t=this.element.querySelector("."+wn);if(t){var i=function(e){return e&&Object.keys(e).length>0?e:void 0},n={},r=i(this.parent.eventSettings.fields.subject.validation);(0,e.isNullOrUndefined)(r)||(n[this.parent.eventSettings.fields.subject.name]=r);var a=i(this.parent.eventSettings.fields.location.validation);(0,e.isNullOrUndefined)(a)||(n[this.parent.eventSettings.fields.location.name]=a);var s=i(this.parent.eventSettings.fields.startTime.validation);(0,e.isNullOrUndefined)(s)||(n[this.parent.eventSettings.fields.startTime.name]=s);var o=i(this.parent.eventSettings.fields.endTime.validation);(0,e.isNullOrUndefined)(o)||(n[this.parent.eventSettings.fields.endTime.name]=o);var l=i(this.parent.eventSettings.fields.description.validation);(0,e.isNullOrUndefined)(l)||(n[this.parent.eventSettings.fields.description.name]=l),this.fieldValidator&&(this.fieldValidator.destroy(),this.fieldValidator=null),this.fieldValidator=new qa,this.fieldValidator.renderFormValidator(t,n,this.element,this.parent.locale)}},i.prototype.showDetails=function(t){this.eventData=t;var i=(0,e.extend)({},t,null,!0),n=this.getFormElements(Tn);this.cellClickAction&&(!this.cellClickAction||(0,e.isNullOrUndefined)(this.parent.editorTemplate))||0!==i[this.fields.endTime].getHours()||0!==i[this.fields.endTime].getMinutes()||this.trimAllDay(i);for(var r=Object.keys(i),a=0,s=n;a<s.length;a++){var o=s[a],l=o.name||this.getColumnName(o);(0,e.isNullOrUndefined)(l)||""===l||(-1!==r.indexOf(l)?this.setValueToElement(o,i[""+l]):this.setDefaultValueToElement(o))}if((0,e.isNullOrUndefined)(this.parent.editorTemplate)){this.onAllDayChange(i[this.fields.isAllDay]);var p=this.getInstance(bn+"."+no);(0,e.isNullOrUndefined)(i[this.fields.startTimezone])&&(0,e.isNullOrUndefined)(i[this.fields.endTimezone])||(p.checked=!0,p.dataBind()),this.timezoneChangeStyle(p.checked),delete i.Timezone}},i.prototype.getColumnName=function(t){var i=t.getAttribute("data-name")||"";if(""===i){var n=!1,r="";t.classList.contains("e-dropdownlist")?(r="e-ddl",n=!0):t.classList.contains("e-multiselect")?(r="e-multiselect",n=!0):t.classList.contains("e-datetimepicker")?r="e-datetimepicker":t.classList.contains("e-datepicker")?r="e-datepicker":t.classList.contains("e-checkbox")?r="e-checkbox":t.classList.contains("e-numerictextbox")&&(r="e-numerictextbox");var a=n?"."+r+":not(.e-control)":"."+r,s=(0,e.closest)(t,a)||t.querySelector("."+r);if(s){var o=s.querySelector("[name]");o&&(i=o.name)}}return i},i.prototype.onAllDayChange=function(t){var i,n=this.getInstance(xn),r=this.getInstance(Vn),a=this.element.querySelector(".e-time-zone-container");t?(i=(0,e.isNullOrUndefined)(this.parent.dateFormat)?this.getFormat("dateFormats"):this.parent.dateFormat,(0,e.addClass)(this.element.querySelectorAll(".e-time-icon"),Ln),(0,e.addClass)([a],Ge),this.element.querySelector("."+Mn)&&(0,e.removeClass)([this.element.querySelector("."+Mn)],_e),n.format=r.format=i):(i=(0,e.isNullOrUndefined)(this.parent.dateFormat)?this.getFormat("dateFormats")+" "+this.parent.activeViewOptions.timeFormat:this.parent.dateFormat+" "+this.parent.activeViewOptions.timeFormat,(0,e.removeClass)(this.element.querySelectorAll(".e-time-icon"),Ln),(0,e.removeClass)([a],Ge),this.element.querySelector(".e-checkbox-wrapper .e-time-zone").checked&&(0,e.addClass)([this.element.querySelector("."+Mn)],_e),n.format=r.format=i),this.cellClickAction&&this.updateDateTime(t,n,r),n.dataBind(),r.dataBind(),(0,e.isNullOrUndefined)(this.recurrenceEditor)||this.recurrenceEditor.updateRuleUntilDate(n.value)},i.prototype.updateDateTime=function(e,t,i){var n,r;if(e)if(n=ve(new Date(this.eventWindowTime.startTime.getTime())),this.parent.activeCellsData.isAllDay){var a=ye(new Date(this.eventWindowTime.endTime.getTime()),-1).getTime();r=+this.eventWindowTime.startTime>a?this.eventWindowTime.endTime:new Date(a)}else r=ve(new Date(this.eventWindowTime.endTime.getTime()));else{var s=this.parent.activeCellsData.startTime;if((n=new Date(this.eventWindowTime.startTime.getTime())).setHours(s.getHours(),s.getMinutes(),s.getSeconds()),this.parent.activeCellsData.isAllDay){var o=this.parent.getStartEndTime(this.parent.workHours.start);n.setHours(o.getHours(),o.getMinutes(),o.getSeconds()),(r=new Date(n.getTime())).setMilliseconds(ne*this.getSlotDuration())}else(r=new Date(n.getTime())).setMilliseconds(this.parent.activeCellsData.endTime.getTime()-this.parent.activeCellsData.startTime.getTime())}this.eventWindowTime={startTime:new Date(n.getTime()),endTime:new Date(r.getTime())},t.value=n,i.value=r,t.dataBind(),i.dataBind()},i.prototype.getFormat=function(t){return(0,e.isNullOrUndefined)(this.parent.locale)||"en"===this.parent.locale||"en-US"===this.parent.locale?(0,e.getValue)(t+".short",(0,e.getDefaultDateObject)(this.parent.getCalendarMode())):(0,e.getValue)("main."+this.parent.locale+".dates.calendars."+this.parent.getCalendarMode()+"."+t+".short",e.cldrData)},i.prototype.onEventDetailsUpdate=function(t){if(this.parent.eventSettings.allowEditing){if(!this.parent.isAdaptive&&(0,e.isNullOrUndefined)(this.parent.editorFooterTemplate)&&(0,e.removeClass)([this.element.querySelector("."+Ji)],Ge),(0,e.isNullOrUndefined)(this.parent.editorHeaderTemplate)&&(this.element.querySelector("."+Nn).innerHTML=this.l10n.getConstant("editEvent")),this.element.querySelector("."+wn).setAttribute("data-id",t[this.fields.id].toString()),(0,e.isNullOrUndefined)(this.parent.editorTemplate)){t=(0,e.extend)({},t,null,!0);var i=this.getInstance(bn+"."+no),n=void 0;t[this.fields.startTimezone]||t[this.fields.endTimezone]?(n=!0,this.parent.eventBase.timezoneConvert(t)):n=!1,t.Timezone=n,i.checked=n,i.dataBind()}if(this.showDetails(t),t[this.fields.recurrenceRule]&&this.recurrenceEditor?this.recurrenceEditor.setRecurrenceRule(t[this.fields.recurrenceRule],t[this.fields.startTime]):!this.parent.isAdaptive&&this.recurrenceEditor&&(this.recurrenceEditor.setProperties({startDate:t[this.fields.startTime]}),this.recurrenceEditor.setRecurrenceRule("")),this.repeatStartDate=t[this.fields.startTime],this.repeatRule="",t[this.fields.recurrenceRule]&&(this.recurrenceEditor&&this.recurrenceEditor.setRecurrenceRule(t[this.fields.recurrenceRule],t[this.fields.startTime]),this.repeatRule=t[this.fields.recurrenceRule]),this.parent.isAdaptive&&(0,e.isNullOrUndefined)(this.parent.editorTemplate)){var r=this.element.querySelector("."+ro);t[this.fields.recurrenceRule]?((0,e.removeClass)([r],ao),this.repeatStatus.setProperties({checked:!0})):((0,e.addClass)([r],ao),this.repeatStatus.setProperties({checked:!1})),this.updateRepeatLabel(this.repeatRule)}var a=this.parent.readonly||t[this.fields.isReadonly];if(this.parent.isAdaptive){var s=this.element.querySelector("."+Hn);s&&(a?(0,e.addClass)([s],or):(0,e.removeClass)([s],or))}else{var o=this.element.querySelector("."+jn),l=this.element.querySelector("."+Ji);this.disableButton(o,a),this.disableButton(l,a)}this.dialogObject.show()}},i.prototype.disableButton=function(e,t){e&&(e.ej2_instances[0].disabled=t)},i.prototype.renderRecurrenceEditor=function(){return new io({calendarMode:this.parent.calendarMode,cssClass:this.parent.cssClass,dateFormat:this.parent.dateFormat,enableRtl:this.parent.enableRtl,firstDayOfWeek:this.parent.activeViewOptions.firstDayOfWeek,locale:this.parent.locale})},i.prototype.updateMinMaxDateToEditor=function(){var e=this.element.querySelector(".e-start"),t=this.element.querySelector(".e-end");if(e&&t){var i=e.ej2_instances[0],n=t.ej2_instances[0];i.min=this.parent.minDate,i.max=this.parent.maxDate,n.min=this.parent.minDate,n.max=this.parent.maxDate,i.dataBind(),n.dataBind()}if(this.recurrenceEditor){var r=this.recurrenceEditor.element.querySelector(".e-until-date");if(r){var a=r.ej2_instances[0];a.min=this.parent.minDate,a.max=this.parent.maxDate,a.dataBind()}}},i.prototype.updateRepeatLabel=function(e){this.parent.isAdaptive&&!this.repeatDialogObject&&this.renderRepeatDialog();var t=e?this.l10n.getConstant("repeats")+" "+this.recurrenceEditor.getRuleSummary(e):this.l10n.getConstant("repeat");this.repeatStatus.setProperties({label:t})},i.prototype.dialogClose=function(e){this.isEnterKey?this.isEnterKey=!1:(this.dialogEvent=e,this.isCrudAction=!1,this.parent.activeEventData={event:void 0,element:void 0},this.parent.currentAction=null,this.dialogObject.hide())},i.prototype.resetForm=function(){this.fieldValidator.destroyToolTip(),this.resetFormFields(),this.parent.isAdaptive||!this.recurrenceEditor||this.recurrenceEditor.isDestroyed||this.recurrenceEditor.resetFields()},i.prototype.timezoneChangeStyle=function(t){var i=this.element.querySelector("."+Mn),n=this.parent.tzModule.getLocalTimezoneName();if(t){(0,e.addClass)([i],_e);var r=this.getInstance(kn),a=this.getInstance(Rn),s=r.dataSource;if(!r.value||!this.parent.timezone)s.some((function(e){return e.Value===n}))||(s.push({Value:n,Text:n}),r.dataSource=s,a.dataSource=s,r.dataBind(),a.dataBind());r.value=r.value||this.parent.timezone||n,a.value=a.value||this.parent.timezone||n,r.dataBind(),a.dataBind()}else(0,e.removeClass)([i],_e)},i.prototype.resetFormFields=function(){for(var t=0,i=this.getFormElements(Tn);t<i.length;t++){var n=i[t],r=n.name||this.getColumnName(n);(0,e.isNullOrUndefined)(r)||""===r||this.setDefaultValueToElement(n)}},i.prototype.eventSave=function(e,t){if(this.isEnterKey)this.isEnterKey=!1;else{var i=this.element.querySelector("."+wn);if(!i||!i.classList.contains("e-formvalidator")||i.ej2_instances[0].validate()){var n=this.getEventDataFromEditor();this.processEventValidation(n.tempData,t)||(this.eventCrudData=n.eventData,this.dialogEvent=e,this.isCrudAction=!0,this.dialogObject.hide())}}},i.prototype.getEventDataFromEditor=function(){var t=(0,e.extend)({},this.getObjectFromFormData(Tn));t.Timezone||(t[this.fields.startTimezone]=null,t[this.fields.endTimezone]=null),delete t.Timezone,delete t.Repeat,this.setDefaultValueToObject(t),t[this.fields.recurrenceRule]=this.recurrenceEditor?this.recurrenceEditor.getRecurrenceRule()||null:void 0;var i=(0,e.extend)({},t,null,!0);return t[this.fields.isAllDay]&&(t[this.fields.startTime]=(0,e.isNullOrUndefined)(t[this.fields.startTime])?null:ve(new Date(t[this.fields.startTime].getTime())),t[this.fields.endTime]=(0,e.isNullOrUndefined)(t[this.fields.endTime])?null:ye(ve(new Date(t[this.fields.endTime].getTime())),1)),{eventData:t,tempData:i}},i.prototype.processEventValidation=function(t,i){var n;if((0,e.isNullOrUndefined)(this.parent.editorTemplate)){if(!t[this.fields.startTime]||!t[this.fields.endTime])return this.parent.quickPopup.openValidationError("invalidDateError"),!0;if(t[this.fields.startTime]>t[this.fields.endTime])return this.parent.quickPopup.openValidationError("startEndError"),!0}if(this.recurrenceEditor&&this.recurrenceEditor.value&&""!==this.recurrenceEditor.value){"EditOccurrence"!==this.parent.currentAction&&(n=this.recurrenceValidation(t[this.fields.startTime],t[this.fields.endTime],i));var r=!0;if("seriesChangeAlert"===n&&this.parent.uiStateValues.isIgnoreOccurrence&&(r=!1),!(0,e.isNullOrUndefined)(n)&&r&&(!this.parent.enableRecurrenceValidation&&"wrongPattern"===n||this.parent.enableRecurrenceValidation))return this.parent.quickPopup.openRecurrenceValidationAlert(n),!0}return!1},i.prototype.processCrudActions=function(t){var i=this;this.parent.uiStateValues.isBlock=!1;var n=this.getResourceData(t),r=(this.parent.activeViewOptions.group.resources.length>0||this.parent.resourceCollection.length>0)&&!this.parent.activeViewOptions.group.allowGroupEdit&&!(0,e.isNullOrUndefined)(n),a=this.getEventIdFromForm();if((0,e.isNullOrUndefined)(a)){if(this.parent.currentAction="Add",this.parent.eventBase.checkOverlap(t))return!0;r?this.resourceSaveEvent(t,this.parent.currentAction):(t[this.fields.id]=this.parent.eventBase.getEventMaxID(),this.parent.addEvent(t))}else{var s="string"===this.parent.eventBase.getEventIDType()?a:parseInt(a,10),o=this.parent.eventsData.filter((function(e){return e[i.fields.id]===s}))[0];if((0,e.isNullOrUndefined)(o)&&(o=this.parent.blockData.filter((function(e){return e[i.fields.id]===s}))[0]),(t=(0,e.extend)({},o,t))[this.fields.isReadonly])return!1;if(this.parent.eventBase.checkOverlap(t))return!0;var l=void 0;if(!(0,e.isNullOrUndefined)(o[this.fields.recurrenceRule])){if(l=this.parent.currentAction,t.Guid=this.parent.activeEventData.event.Guid,"EditOccurrence"===this.parent.currentAction&&(t[this.fields.recurrenceID]?(s=t[this.fields.recurrenceID],l=null):(t[this.fields.id]=this.parent.eventBase.getEventMaxID(),t.Guid=this.parent.activeEventData.event.Guid),this.parent.enableRecurrenceValidation&&this.editOccurrenceValidation(s,t)))return!0;"EditSeries"===this.parent.currentAction||t[this.fields.id]!==o[this.fields.id]?t[this.fields.recurrenceID]=o[this.fields.id]:"EditFollowingEvents"===this.parent.currentAction&&(t[this.fields.id]=this.parent.eventBase.getEventMaxID(),t[this.fields.followingID]=o[this.fields.id])}r?this.resourceSaveEvent(t,"Save",l):this.parent.saveEvent(t,l)}return this.parent.uiStateValues.isBlock},i.prototype.getResourceData=function(t){var i=null;!(0,e.isNullOrUndefined)(this.parent.resourceBase)&&!(0,e.isNullOrUndefined)(this.parent.resourceBase.resourceCollection)&&this.parent.resourceBase.resourceCollection.length>0&&(i=t[this.parent.resourceBase.resourceCollection.slice(-1)[0].field]);return i},i.prototype.getObjectFromFormData=function(t){for(var i={},n=0,r=this.getFormElements(t);n<r.length;n++){var a=r[n],s=a.name||this.getColumnName(a);(0,e.isNullOrUndefined)(s)||""===s||(i[""+s]=this.getValueFromElement(a))}return i},i.prototype.setDefaultValueToObject=function(t){(0,e.isNullOrUndefined)(t[this.fields.subject])||(t[this.fields.subject]=t[this.fields.subject]||this.parent.eventSettings.fields.subject.default||this.l10n.getConstant("addTitle")),(0,e.isNullOrUndefined)(t[this.fields.location])||(t[this.fields.location]=t[this.fields.location]||this.parent.eventSettings.fields.location.default),(0,e.isNullOrUndefined)(t[this.fields.description])||(t[this.fields.description]=t[this.fields.description]||this.parent.eventSettings.fields.description.default)},i.prototype.recurrenceValidation=function(t,i,n){var r,a=this.recurrenceEditor,s=this.getInstance("e-repeat-interval.e-numerictextbox").value;if(n!==this.l10n.getConstant("ok")){var o=this.parent.activeEventData.event,l=[];if(("EditSeries"===this.parent.currentAction||"EditFollowingEvents"===this.parent.currentAction)&&!(0,e.isNullOrUndefined)(o)){var p=o[this.parent.eventFields.startTime],c=this.parent.eventBase.getSeriesEvents(this.eventData,p);if(c.length>0)l=this.parent.eventBase.getEditedOccurrences(c,p);else{var h=this.parent.eventBase.getEventById(o[this.parent.eventFields.id]);l=this.parent.eventBase.getEditedOccurrences([h],p)}"EditSeries"!==this.parent.currentAction||(0,e.isNullOrUndefined)(this.eventData[this.parent.eventFields.recurrenceException])||l.push(this.eventData)}if(l.length>0&&(r="seriesChangeAlert"),"until"===this.getInstance("e-end-on-left .e-ddl .e-dropdownlist").value&&this.getInstance("e-end-on-date .e-datepicker").value<t&&(r="wrongPattern"),(0,e.isNullOrUndefined)(r)){var d=a.value.split(";")[1].split("=")[1].split(","),u={SU:0,MO:1,TU:2,WE:3,TH:4,FR:5,SA:6},g=[],v=[],m=void 0;switch(a.value.split(";")[0].split("=")[1]){case"DAILY":(i.getTime()-t.getTime())/36e5>24*s&&(r="createError");break;case"WEEKLY":d=a.value.split(";")[1].split("=")[1].split(",");for(var f=0;f<d.length*(s+1);f++)g[parseInt(f.toString(),10)]=d.length>f?u[d[parseInt(f.toString(),10)]]:g[f-d.length]+7*s;m=g.sort((function(e,t){return e-t}));for(f=1;f<m.length;f++)v.push(m[parseInt(f.toString(),10)]-m[f-1]);((i.getTime()-t.getTime())/36e5>=24*Math.min.apply(Math,v)||(0,e.isNullOrUndefined)(s))&&(r="createError");break;case"MONTHLY":i.getTime()>=new Date(+t).setMonth(t.getMonth()+s)&&(r="createError");break;case"YEARLY":i.getTime()>=new Date(+t).setFullYear(t.getFullYear()+s)&&(r="createError")}}}else i.getTime()>=new Date(+t).setMonth(t.getMonth()+s)&&(r="createError"),(0,e.isNullOrUndefined)(r)&&this.parent.quickPopup.quickDialog.hide();return(0,e.isNullOrUndefined)(s)&&(r="createError"),r},i.prototype.getRecurrenceIndex=function(e,t){for(var i,n=0;n<e.length;n++)if(t[this.fields.startTime].valueOf()===e[parseInt(n.toString(),10)][this.fields.startTime].valueOf()){i=n;break}return i},i.prototype.trimAllDay=function(e){if(e[this.fields.isAllDay]){var t=ye(new Date(+e[this.fields.endTime]),-1).getTime();e[this.fields.endTime]=+e[this.fields.startTime]>t?e[this.fields.endTime]:new Date(t)}},i.prototype.editOccurrenceValidation=function(t,i,n){var r=this;void 0===n&&(n=this.eventData);var a=this.parent.getOccurrencesByID(t),s=this.parent.eventsData.filter((function(e){return e[r.fields.recurrenceID]===t}));s.map((function(t){return a.push((0,e.extend)({},t))})),i=(0,e.extend)({},i),this.trimAllDay(i);for(var o=0,l=a;o<l.length;o++){var p=l[o];this.trimAllDay(p)}this.parent.eventBase.sortByTime(a);var c=this.getRecurrenceIndex(a,n);if((0,e.isNullOrUndefined)(c))return!1;var h,d,u=new Date(+i[this.fields.startTime]),g=new Date(+i[this.fields.endTime]);c!==a.length-1&&(h=new Date(+a[c+1][this.fields.startTime]),d=new Date(+a[c+1][this.fields.endTime]));var v=new Date(+a[a.length-1][this.fields.endTime]);if(0===c){if(!(0,e.isNullOrUndefined)(a[c+1])){if(!(h.getTime()>=g.getTime())&&ve(v).getTime()>=ve(u).getTime()||ve(v).getTime()<ve(u).getTime())return this.parent.quickPopup.openRecurrenceValidationAlert("occurrenceAlert"),!0;if(!(ve(u).getTime()<ve(h).getTime()))return this.parent.quickPopup.openRecurrenceValidationAlert("sameDayAlert"),!0}return!1}var m=new Date(+a[c-1][this.fields.startTime]),f=new Date(+a[c-1][this.fields.endTime]);if(c===a.length-1){if(ve(new Date(+a[a.length-1-c][this.fields.startTime])).getTime()>ve(u).getTime())return this.parent.quickPopup.openRecurrenceValidationAlert("occurrenceAlert"),!0;if(!(f.getTime()<=u.getTime()&&ve(u).getTime()>ve(m).getTime()))return this.parent.quickPopup.openRecurrenceValidationAlert("sameDayAlert"),!0}else{if(!(ve(m).getTime()<ve(u).getTime()||ve(new Date(+a[0][this.fields.startTime])).getTime()>ve(u).getTime())||!(ve(h).getTime()>ve(u).getTime()||v.getTime()<u.getTime()))return this.parent.quickPopup.openRecurrenceValidationAlert("sameDayAlert"),!0;if(!(f.getTime()<=u.getTime()&&h.getTime()>=g.getTime())||ve(d).getTime()<ve(u).getTime()||ve(m).getTime()>ve(g).getTime()||!(ve(u).getTime()<ve(h).getTime()))return this.parent.quickPopup.openRecurrenceValidationAlert("occurrenceAlert"),!0}return!1},i.prototype.resourceSaveEvent=function(t,i,n){var r=this,a=this.parent.resourceBase.resourceCollection.slice(-1)[0],s=t[a.field];s=s instanceof Array?s.reverse():[s].reverse();for(var o=this.parent.resourceBase.lastResourceLevel,l=[],p=function(p){var h=(0,e.extend)({},t,null,!0);h[c.fields.id]=c.parent.eventBase.getEventMaxID();var d=[],u=function(){if("Save"===i&&p===s.length-1)if(d.length>0){d[0][r.fields.id]=t[r.fields.id];for(var e=1;e<d.length;e++)d[parseInt(e.toString(),10)][r.fields.id]=r.parent.eventBase.getEventMaxID(p),l.push(d[parseInt(e.toString(),10)]),r.parent.saveEvent(d[0],n)}else h[r.fields.id]=t[r.fields.id],r.parent.saveEvent(h,n);else if(d.length>0)for(var a=0;a<d.length;a++)d[parseInt(a.toString(),10)][r.fields.id]=r.parent.eventBase.getEventMaxID(a),l.push(d[parseInt(a.toString(),10)]);else h[r.fields.id]=r.parent.eventBase.getEventMaxID(p),l.push(h)};if(c.parent.activeViewOptions.group.byGroupID&&!(0,e.isNullOrUndefined)(o)){var g=a.dataSource,v=c.parent.resourceCollection,m=void 0;if((m=v.length>1?Ae(g,a.idField,s[parseInt(p.toString(),10)],h,v):Ae(g,a.idField,s[parseInt(p.toString(),10)]))<0)return{value:void 0};for(var f=g[parseInt(m.toString(),10)][a.groupIDField],y=o.filter((function(e){return e.resourceData[a.idField]===s[parseInt(p.toString(),10)]})).filter((function(e){return e.resourceData[a.groupIDField]===f}))[0].groupOrder,T=0;T<c.parent.resourceBase.resourceCollection.length;T++){var w=c.parent.resourceBase.resourceCollection[parseInt(T.toString(),10)].field;h[""+w]=y[parseInt(T.toString(),10)]instanceof Array?y[parseInt(T.toString(),10)][0]:y[parseInt(T.toString(),10)]}u()}else{for(m=0;m<c.parent.resourceBase.resourceCollection.length-1;m++){w=c.parent.resourceBase.resourceCollection[parseInt(m.toString(),10)].field;if(h[""+w]instanceof Array&&h[""+w].length>1)for(var D=0;D<h[""+w].length;D++){var b=(0,e.extend)({},h,null,!0);b[""+w]=t[""+w][parseInt(D.toString(),10)],b[a.field]=s[parseInt(p.toString(),10)],d.push(b)}else if(0===d.length)h[""+w]=t[""+w]instanceof Array?t[""+w][0]:t[""+w],h[a.field]=s[parseInt(p.toString(),10)];else for(var S=0;S<d.length;S++)d[parseInt(S.toString(),10)][""+w]=t[""+w]instanceof Array?t[""+w][0]:t[""+w]}h[a.field]=s[parseInt(p.toString(),10)],u()}},c=this,h=0;h<s.length;h++){var d=p(h);if("object"==typeof d)return d.value}if(l.length>0){for(var u=0,g=l;u<g.length;u++){var v=g[u];v[this.fields.recurrenceException]=null,v[this.fields.recurrenceID]=null}this.parent.addEvent(l)}},i.prototype.getEventIdFromForm=function(){return this.element.querySelector("."+wn).getAttribute("data-id")},i.prototype.getFormElements=function(e){return e===Tn?[].slice.call(this.element.querySelectorAll("."+no)):[].slice.call(this.parent.element.querySelectorAll("."+e+" ."+no))},i.prototype.getValueFromElement=function(t){return t.classList.contains("e-datepicker")||t.classList.contains("e-datetimepicker")||t.classList.contains("e-dropdownlist")||t.classList.contains("e-multiselect")?t.ej2_instances[0].value:t.classList.contains("e-checkbox")?t.ej2_instances[0].checked:t.classList.contains("e-numerictextbox")?t.ej2_instances[0].value:"checkbox"===t.type?t.checked:this.parent.enableHtmlSanitizer?e.SanitizeHtmlHelper.sanitize(t.value):t.value},i.prototype.setValueToElement=function(e,t){if(e.classList.contains("e-datepicker"))(i=e.ej2_instances[0]).value=t,i.dataBind();else if(e.classList.contains("e-datetimepicker")){(i=e.ej2_instances[0]).element.classList.contains(xn)?this.eventWindowTime.startTime=new Date(""+t):this.eventWindowTime.endTime=new Date(""+t),i.value=t,i.dataBind()}else if(e.classList.contains("e-dropdownlist")){(i=e.ej2_instances[0]).value=t,i.dataBind()}else if(e.classList.contains("e-multiselect")){(i=e.ej2_instances[0]).value=[],i.value=t instanceof Array?t:[t],i.dataBind()}else if(e.classList.contains("e-checkbox")){(i=e.ej2_instances[0]).checked=t,i.dataBind()}else if(e.classList.contains("e-numerictextbox")){var i;(i=e.ej2_instances[0]).value=t,i.dataBind()}else"checkbox"!==e.type?e.value=t||"":e.checked=t},i.prototype.setDefaultValueToElement=function(e){if(e.classList.contains("e-datepicker"))(t=e.ej2_instances[0]).value=this.parent.getCurrentTime(),t.dataBind();else if(e.classList.contains("e-datetimepicker")){var t=e.ej2_instances[0],i=this.parent.getCurrentTime();this.eventWindowTime={startTime:i,endTime:i},t.value=i,t.dataBind()}else if(e.classList.contains("e-dropdownlist")){(t=e.ej2_instances[0]).value=null,t.dataBind()}else if(e.classList.contains("e-multiselect")){(t=e.ej2_instances[0]).value=[],t.dataBind()}else if(e.classList.contains("e-checkbox")){(t=e.ej2_instances[0]).checked=!1,t.dataBind()}else if(e.classList.contains("e-numerictextbox")){(t=e.ej2_instances[0]).value=null,t.dataBind()}else"checkbox"===e.type?e.checked=!1:e.value=""},i.prototype.getInstance=function(e){var t=this.element.querySelector("."+e);return t?t.ej2_instances[0]:null},i.prototype.eventDelete=function(t){if(this.isEnterKey)this.isEnterKey=!1;else{switch(this.parent.currentAction){case"EditOccurrence":(0,e.isNullOrUndefined)(this.parent.activeEventData.event[this.parent.eventFields.recurrenceRule])?this.parent.currentAction="Delete":this.parent.currentAction="DeleteOccurrence";break;case"EditSeries":this.parent.currentAction="DeleteSeries";break;case"Save":this.parent.currentAction="Delete";break;case"EditFollowingEvents":(0,e.isNullOrUndefined)(this.parent.activeEventData.event[this.parent.eventFields.recurrenceRule])||(this.parent.currentAction="DeleteFollowingEvents")}this.dialogEvent=t,this.isCrudAction=!1,this.dialogObject.hide(),this.parent.quickPopup.openDeleteAlert()}},i.prototype.getRecurrenceEditorInstance=function(){return this.parent.isAdaptive&&!this.repeatDialogObject&&this.renderRepeatDialog(),this.recurrenceEditor},i.prototype.destroyComponents=function(){for(var e=0,t=this.getFormElements(Tn);e<t.length;e++){var i=t[e],n=void 0;(i.classList.contains("e-datetimepicker")||i.classList.contains("e-datepicker")||i.classList.contains("e-checkbox")||i.classList.contains("e-dropdownlist")||i.classList.contains("e-multiselect")||i.classList.contains("e-numerictextbox"))&&(n=i.ej2_instances),n&&n[0]&&n[0].destroy()}this.buttonObj&&this.buttonObj.destroy()},i.prototype.detachComponents=function(){for(var t=0,i=this.getFormElements(Tn);t<i.length;t++){var n=i[t];(0,e.detach)(n)}},i.prototype.destroy=function(t){if(this.parent&&!this.parent.isDestroyed&&this.parent.resetTemplates(["editorTemplate","editorHeaderTemplate","editorFooterTemplate"]),this.destroyComponents(),this.recurrenceEditor&&(this.recurrenceEditor.destroy(),(0,e.detach)(this.recurrenceEditor.element),this.recurrenceEditor=null),this.fieldValidator&&(this.fieldValidator.destroy(),this.fieldValidator=null),this.repeatDialogObject&&(this.repeatDialogObject.destroy(),this.repeatDialogObject=null),this.detachComponents(),this.dialogObject){if(this.dialogObject.element){var i=this.dialogObject.element.querySelector("form");Me(i),(0,e.detach)(i),e.EventHandler.remove(this.dialogObject.element,"keydown",this.preventEventSave)}this.dialogObject.destroy(),this.dialogObject=null}this.element&&((0,e.remove)(this.element),this.element=null),t||(this.l10n=null,this.parent=null,this.fields=null,this.buttonObj=null,this.repeatStatus=null,this.eventWindowTime=null,this.dialogEvent=null)},i}(),oo=function(){function t(e){this.translateY=0,this.itemSize=60,this.renderedLength=0,this.averageRowHeight=0,this.startIndex=0,this.existingDataCollection=[],this.enableTransition=!0,this.parent=e,this.bufferCount=e.activeViewOptions.overscanCount<3?3:e.activeViewOptions.overscanCount,this.addEventListener()}return t.prototype.addEventListener=function(){!this.parent||this.parent&&this.parent.isDestroyed||this.parent.on(X,this.virtualScrolling,this)},t.prototype.removeEventListener=function(){!this.parent||this.parent&&this.parent.isDestroyed||this.parent.off(X,this.virtualScrolling)},t.prototype.getRenderedCount=function(){this.setItemSize();var e=this.isHorizontalScroll?this.parent.element.clientWidth:this.parent.element.clientHeight;return this.renderedLength=Math.ceil(e/this.itemSize)+this.bufferCount,this.renderedLength},t.prototype.renderVirtualTrack=function(t){var i=(0,e.createElement)("div",{className:ai});if(this.isHorizontalScroll){var n=this.parent.activeView.colLevels[this.parent.activeView.colLevels.length-1].length;i.style.width=n*this.itemSize+"px"}else i.style.height=this.parent.resourceBase.expandedResources.length*this.itemSize+"px";t.appendChild(i)},t.prototype.updateVirtualScrollHeight=function(){var e=this.parent.element.querySelector("."+ai),t=this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length-1].groupIndex;if(this.parent.resourceBase.renderedResources[this.parent.resourceBase.renderedResources.length-1].groupIndex!==t){var i=this.parent.element.querySelector("."+Je);this.renderedLength=i.querySelector("tbody").children.length,e.style.height=i.offsetHeight+(this.parent.resourceBase.expandedResources.length-this.renderedLength)*i.offsetHeight/this.renderedLength+"px";var n=this.parent.element.querySelector("."+ri);n.scrollHeight-n.scrollTop<n.offsetHeight*this.bufferCount&&(e.style.height=parseInt(e.style.height,10)+n.offsetHeight*this.bufferCount+"px")}else e.style.height="";this.averageRowHeight=e.offsetHeight/this.parent.resourceBase.expandedResources.length},t.prototype.updateVirtualTrackHeight=function(e){var t=this.parent.resourceBase.renderedResources.length;if(t!==this.getRenderedCount()){e.style.height=this.parent.element.querySelector(".e-content-wrap").clientHeight+"px";var i=this.parent.element.querySelector("."+yt),n=this.parent.element.querySelector("."+ri),r=this.parent.element.querySelector("."+vt);this.translateY=0,this.setTranslate(i,n,r)}else{var a=this.parent.resourceBase.renderedResources[t-1].groupIndex,s=t+(this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length-1].groupIndex-a);s=s>this.parent.resourceBase.expandedResources.length?this.parent.resourceBase.expandedResources.length:s,e.style.height=s*this.itemSize+"px"}},t.prototype.setItemSize=function(){this.isHorizontalScroll?this.itemSize=ae(this.parent.activeView.element,$e,this.parent.uiStateValues.isTransformed)||this.itemSize:this.itemSize=this.parent.getElementHeightFromClass(this.parent.activeView.element,$e)||this.itemSize},t.prototype.refreshLayout=function(){var t=this.parent.uiStateValues.scheduleHeight;this.parent.uiStateValues.scheduleHeight=this.parent.element.offsetHeight;var i=this.renderedLength;if(this.parent.uiStateValues.scheduleHeight!==t){i<this.getRenderedCount()&&(this.isRemoteRefresh=!0);var n=this.parent.element.querySelector("."+yt),r=this.parent.element.querySelector("."+ri),a=this.parent.element.querySelector("."+vt);this.parent.rowAutoHeight||(this.enableTransition=!1,(0,e.removeClass)([r,n],"e-transition"));var s=parseInt(n.querySelector("tbody td").getAttribute("data-group-index"),10),o=s+this.renderedLength;s=(s=o>this.parent.resourceBase.expandedResources.length?this.parent.resourceBase.expandedResources.length-this.renderedLength:s)<0?0:s,this.existingDataCollection=this.parent.resourceBase.renderedResources,this.parent.resourceBase.renderedResources=this.parent.resourceBase.expandedResources.slice(s,o),this.parent.resourceBase.renderedResources.length>0&&this.updateContent(n,r,a,this.parent.resourceBase.renderedResources)}},t.prototype.renderEvents=function(){this.setTabIndex();var e=this.triggerScrollEvent(k);if(this.parent.activeViewOptions&&this.parent.activeViewOptions.enableLazyLoading&&this.parent.crudModule)return e.length>0?(this.parent.crudModule.refreshProcessedData(!0,e),void this.parent.hideSpinner()):void this.parent.crudModule.refreshDataManager();this.parent.crudModule&&this.parent.crudModule.refreshProcessedData(!0),"Month"!==this.parent.currentView&&this.parent.notify(_,{}),this.parent.hideSpinner()},t.prototype.virtualScrolling=function(){var t=this;this.parent.quickPopup&&(this.parent.quickPopup.quickPopupHide(),this.parent.quickPopup.morePopup.hide());var i=this.parent.element.querySelector("."+ri);if(this.isHorizontalScroll)this.horizontalScrolling(i);else{var n=this.parent.element.querySelector("."+yt),r=this.parent.element.querySelector("."+vt),a=this.parent.element.querySelector("."+Mt),s=this.parent.element.querySelector("."+Je);this.parent.rowAutoHeight||(0,e.addClass)([i,n],"e-transition"),this.renderedLength=n.querySelector("tbody").children.length;var o=parseInt(n.querySelector("tbody td").getAttribute("data-group-index"),10),l=this.parent.rowAutoHeight?s.offsetHeight-i.offsetHeight:this.bufferCount*this.itemSize,p=[];if(this.existingDataCollection=this.parent.resourceBase.renderedResources,i.scrollTop-this.translateY<0?p=this.upScroll(i,o):i.scrollTop-this.translateY>l&&(p=this.downScroll(i,o)),!(0,e.isNullOrUndefined)(p)&&p.length>0){this.triggerScrollEvent(M);var c=this.parent.getSelectedCells();this.focusedEle=c[c.length-1]||this.focusedEle,this.updateContent(n,i,r,p),this.setTranslate(n,i,r,a),this.parent.dragAndDropModule&&"drag"===this.parent.dragAndDropModule.actionObj.action&&this.parent.dragAndDropModule.navigationWrapper(),window.clearTimeout(this.timeValue),this.timeValue=window.setTimeout((function(){t.renderEvents()}),250)}}},t.prototype.horizontalScrolling=function(t){var i=this,n=[],r=this.bufferCount*this.itemSize;if(Math.abs(t.scrollLeft)-Math.abs(this.translateY)<0?n=this.leftScroll(t):Math.abs(t.scrollLeft)-Math.abs(this.translateY)>r&&(n=this.rightScroll(t)),!(0,e.isNullOrUndefined)(n)&&n.length>0){if(this.parent.resourceBase.expandedResources.length!==n.length||this.parent.resourceBase.expandedResources[0]!==n[0]||this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length-1]!==n[n.length-1]){this.triggerScrollEvent(M);var a=this.parent.activeView.colLevels.slice(0);this.updateHorizontalContent(t,n),(0,e.setStyleAttribute)(t.querySelector("table"),{transform:"translateX("+this.translateY+"px)"}),this.parent.activeView.colLevels=a,this.parent.dragAndDropModule&&"drag"===this.parent.dragAndDropModule.actionObj.action&&this.parent.dragAndDropModule.navigationWrapper()}window.clearTimeout(this.timeValue),this.timeValue=window.setTimeout((function(){i.renderEvents()}),250)}},t.prototype.triggerScrollEvent=function(t){var i=this,n=[];if(!this.parent.activeView)return n;var r={startDate:this.parent.activeView.startDate(),endDate:this.parent.activeView.endDate(),startIndex:this.parent.resourceBase.renderedResources[0].groupIndex,endIndex:this.parent.resourceBase.renderedResources[this.parent.resourceBase.renderedResources.length-1].groupIndex,resourceData:this.parent.resourceBase.renderedResources.map((function(e){return e.resourceData})),name:t};return this.parent.trigger(t,r,(function(r){t===M?i.parent.showSpinner():t===k&&!(0,e.isNullOrUndefined)(r.eventData)&&r.eventData.length>0&&(n=r.eventData)})),n},t.prototype.upScroll=function(e,t){var i=0;i=~~(e.scrollTop/this.itemSize)+Math.ceil(e.clientHeight/this.itemSize)-this.renderedLength,this.parent.rowAutoHeight&&(i=i>t?t-this.bufferCount:i),i=i>0?i:0;var n=this.getBufferCollection(i,i+this.renderedLength);if(this.parent.resourceBase.renderedResources=n,0===t)this.translateY=e.scrollTop;else{var r=this.parent.rowAutoHeight?this.averageRowHeight:this.itemSize;r=r>0?r:this.itemSize,this.translateY=e.scrollTop-this.bufferCount*r>0?e.scrollTop-this.bufferCount*r:0}return n},t.prototype.downScroll=function(e,t){if(this.parent.resourceBase.renderedResources[this.parent.resourceBase.renderedResources.length-1].groupIndex===this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length-1].groupIndex)return null;var i=0;i=~~(e.scrollTop/this.itemSize),this.parent.rowAutoHeight&&(i=(i=~~((e.scrollTop-this.translateY)/this.averageRowHeight)+t)>t+this.bufferCount?i:t+this.bufferCount);var n=i+this.renderedLength;n=n>this.parent.resourceBase.expandedResources.length?i+(this.parent.resourceBase.expandedResources.length-i):n;var r=this.getBufferCollection(n-this.renderedLength,n);return this.translateY=e.scrollTop,r},t.prototype.leftScroll=function(e){var t=0;return t=(t=~~(Math.abs(e.scrollLeft)/this.itemSize)+Math.ceil(e.clientWidth/this.itemSize)-this.renderedLength)>0?t:0,this.getCollection(t,t+this.renderedLength)},t.prototype.rightScroll=function(e){var t=this.parent.activeView.colLevels[this.parent.activeView.colLevels.length-1],i=~~(Math.abs(e.scrollLeft)/this.itemSize)+this.renderedLength;return i=i>t.length-1?t.length-1:i,this.getCollection(i-this.renderedLength,i)},t.prototype.getCollection=function(e,t){this.translateY=e*this.itemSize,e=e<0?0:e;var i=this.getResCollection(e,t);return this.parent.enableRtl&&(this.translateY=-this.translateY),i},t.prototype.getResCollection=function(e,t){var i=this.parent.activeView.colLevels[this.parent.activeView.colLevels.length-1];t=t>i.length?i.length-1:t;var n=[],r={startIndex:0,endIndex:0};if(this.parent.activeViewOptions.group.byDate){if(i[parseInt(e.toString(),10)].date.getTime()===this.parent.resourceBase.expandedResources[0].date.getTime()&&i[parseInt(t.toString(),10)].date.getTime()===this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length-1].date.getTime())return this.parent.resourceBase.expandedResources;n=this.getByDateCollection(i[parseInt(e.toString(),10)],i[parseInt(t.toString(),10)],r),this.setRenderedDates(n)}else{if(i[parseInt(e.toString(),10)].groupIndex===this.parent.resourceBase.expandedResources[0].groupIndex&&i[parseInt(t.toString(),10)].groupIndex===this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length-1].groupIndex)return this.parent.resourceBase.expandedResources;n=this.getByIdCollection(i[parseInt(e.toString(),10)],i[parseInt(t.toString(),10)],r)}return"Month"!==this.parent.currentView&&(this.startIndex=r.startIndex,n=i.slice(r.startIndex,r.endIndex)),this.translateY=r.startIndex*this.itemSize,n},t.prototype.getByDateCollection=function(e,t,i){var n=this.parent.activeView.colLevels[0].filter((function(i){return e.date.getTime()<=i.date.getTime()&&i.date.getTime()<=t.date.getTime()}));return this.setStartEndIndex(this.parent.activeView.colLevels[0],n[0],n[n.length-1],i),n},t.prototype.getByIdCollection=function(e,t,i){var n=this.parent.resourceBase.lastResourceLevel.filter((function(i){return e.groupIndex<=i.groupIndex&&i.groupIndex<=t.groupIndex}));return this.parent.resourceBase.renderedResources=n,this.setStartEndIndex(this.parent.resourceBase.lastResourceLevel,n[0],n[n.length-1],i),n},t.prototype.setStartEndIndex=function(e,t,i,n){var r=0;e.filter((function(e){t===e?n.startIndex=r:i===e&&(n.endIndex=r+e.colSpan),r+=e.colSpan})),t===i&&(n.endIndex=n.startIndex+i.colSpan)},t.prototype.updateContent=function(t,i,n,r){var a=t.querySelector("tbody").children.length;document.activeElement&&document.activeElement.classList.contains(Ot)&&(this.isResourceCell=!0,this.parent.element.focus());for(var s=0;s<a;s++)(0,e.remove)(n.querySelector("div"));this.parent.resourceBase.renderedResources=r;var o=this.parent.activeView.getGroupIndices(r),l=this.parent.activeView.getGroupIndices(this.existingDataCollection),p=o.filter((function(e){return l.indexOf(e)<0})),c=Array.from(t.querySelectorAll("tbody tr")),h=Array.from(i.querySelectorAll("tbody tr")),d=t.querySelector("tbody"),u=i.querySelector("tbody");this.removeObsoleteRows(c,o),this.removeObsoleteRows(h,o);var g=this.parent.resourceBase.getContentRows(r,!0),v=this.parent.activeView.getContentRows(),m=this.parent.activeView.getEventRows(r.length);for(s=0;s<p.length;s++){var f=o.indexOf(p[parseInt(s.toString(),10)]);0===f?((0,e.prepend)([g[parseInt(s.toString(),10)]],d),(0,e.prepend)([v[parseInt(s.toString(),10)]],u)):d&&u&&d.children[parseInt(f.toString(),10)]&&u.children[parseInt(f.toString(),10)]?(d.insertBefore(g[parseInt(s.toString(),10)],d.children[parseInt(f.toString(),10)]),u.insertBefore(v[parseInt(s.toString(),10)],u.children[parseInt(f.toString(),10)])):((0,e.append)([g[parseInt(s.toString(),10)]],d),(0,e.append)([v[parseInt(s.toString(),10)]],u))}(0,e.append)(m,n)},t.prototype.removeObsoleteRows=function(t,i){t.forEach((function(t){var n=parseInt(t.firstElementChild.getAttribute("data-group-index"),10);i.indexOf(n)<0&&(0,e.remove)(t)}))},t.prototype.updateHorizontalContent=function(e,t){this.existingDataCollection=this.parent.resourceBase.expandedResources,this.parent.resourceBase.expandedResources=t;var i=this.parent.getSelectedCells();this.focusedEle=i[i.length-1]||this.focusedEle;var n=e.querySelector("tbody"),r=Array.from(n.querySelectorAll("tr"));"Month"===this.parent.currentView?this.updateMonthViewContent(e,t):this.updateOtherViewContent(e,t,r)},t.prototype.updateMonthViewContent=function(t,i){for(var n=t.querySelectorAll(" tr").length,r=0;r<n;r++)(0,e.remove)(t.querySelector("tbody tr"));this.parent.activeViewOptions.group.byDate?this.parent.activeView.colLevels[0]=i:this.parent.activeView.colLevels[this.parent.activeView.colLevels.length-2]=i;var a=this.parent.activeView.getContentRows();(0,e.append)(a,t.querySelector("tbody"))},t.prototype.updateOtherViewContent=function(t,i,n){var r=t.querySelector("tbody"),a=t.querySelector("colgroup"),s=t.querySelector("thead"),o=t.querySelector("table");this.parent.activeView.colLevels[this.parent.activeView.colLevels.length-1]=i;var l=new Set(i.map((function(e){return e.groupIndex})));n.forEach((function(e){e.querySelectorAll("td").forEach((function(e){var t=parseInt(e.getAttribute("data-group-index"),10);l.has(t)||e.remove()}))}));for(var p=[].slice.call(t.querySelector("colgroup").children),c=0;c<p.length;c++)(0,e.remove)(p[parseInt(c.toString(),10)]);i.forEach((function(){return a.appendChild((0,e.createElement)("col"))}));var h=[].slice.call(t.querySelector("thead").children);for(c=0;c<h.length;c++)(0,e.remove)(h[parseInt(c.toString(),10)]);s.appendChild(this.parent.eventBase.createEventWrapper("",this.startIndex>0?this.startIndex:0)),this.parent.activeViewOptions.timeScale.enable&&s.appendChild(this.parent.eventBase.createEventWrapper("timeIndicator")),(0,e.prepend)([s],o);var d=this.parent.activeView.getContentRows();this.mergeNewTdData(r,d)},t.prototype.mergeNewTdData=function(e,t){Array.from(e.querySelectorAll("tr")).forEach((function(e,i){if(i<t.length){var n=t[parseInt(i.toString(),10)],r=Array.from(e.querySelectorAll("td"));Array.from(n.querySelectorAll("td")).forEach((function(t){for(var i=parseInt(t.getAttribute("data-group-index").toString(),10),n=!1,a=0,s=r;a<s.length;a++){var o=s[a];if(i<parseInt(o.getAttribute("data-group-index").toString(),10)){e.insertBefore(t,o),n=!0;break}}n||e.appendChild(t)}))}}))},t.prototype.getBufferCollection=function(e,t){return this.parent.resourceBase.expandedResources.slice(e,t)},t.prototype.setTranslate=function(t,i,n,r){(0,e.setStyleAttribute)(t.querySelector("table"),{transform:"translateY("+this.translateY+"px)"}),(0,e.setStyleAttribute)(i.querySelector("table"),{transform:"translateY("+this.translateY+"px)"}),(0,e.setStyleAttribute)(n,{transform:"translateY("+this.translateY+"px)"}),(0,e.isNullOrUndefined)(r)||(0,e.setStyleAttribute)(r,{transform:"translateY("+this.translateY+"px)"})},t.prototype.updateFocusedWorkCell=function(){if(this.focusedEle){var e=parseInt(this.focusedEle.getAttribute("data-date"),10),t=parseInt(this.focusedEle.getAttribute("data-group-index"),10),i=this.parent.element.querySelector("."+$e+'[data-date="'+e+'"][data-group-index="'+t+'"]');i&&this.parent.addSelectedClass([i],i,!0),this.focusedEle=null}},t.prototype.setRenderedDates=function(e){if("Month"!==this.parent.currentView){var t=e.map((function(e){return e.date}));this.parent.resourceBase.renderedResources.forEach((function(e){return e.renderDates=t}))}else{var i=e.map((function(e){return e.date.getDay()})),n=this.parent.activeView.renderDates.filter((function(e){return i.indexOf(e.getDay())>=0}));this.parent.resourceBase.renderedResources.forEach((function(e){return e.renderDates=n}))}},t.prototype.setTabIndex=function(){var e=this.parent.element.querySelector("."+yt),t=[].slice.call(this.parent.element.querySelectorAll("."+Ot));t&&e&&t.forEach((function(t){t.getBoundingClientRect().top>=e.getBoundingClientRect().top&&t.setAttribute("tabindex","0")}));var i=this.parent.element.querySelector("."+Ot+'[tabindex="0"]');this.isResourceCell&&i&&(i.focus(),this.isResourceCell=!1)},t.prototype.destroy=function(){this.removeEventListener(),this.focusedEle=null},t}(),lo=function(){function t(e){this.parent=e}return t.prototype.render=function(e,t){void 0===t&&(t=!0),this.initializeLayout(e),this.parent.activeView&&t&&this.parent.crudModule.refreshDataManager()},t.prototype.initializeLayout=function(t){if(this.parent.activeView){var i=["cellTemplate","tooltipTemplate","majorSlotTemplate","minorSlotTemplate","headerTooltipTemplate","dateHeaderTemplate","dayHeaderTemplate","monthHeaderTemplate","headerIndentTemplate","resourceHeaderTemplate","cellHeaderTemplate","dateRangeTemplate"];this.parent.activeEventTemplates.length>0?(i=i.concat(this.parent.activeEventTemplates),this.parent.activeEventTemplates=[]):i.push("eventTemplate"),this.parent.resetTemplates(i),this.parent.activeView.removeEventListener(),this.parent.activeView.destroy()}switch(t){case"Day":this.parent.activeView=this.parent.dayModule;break;case"Week":this.parent.activeView=this.parent.weekModule;break;case"WorkWeek":this.parent.activeView=this.parent.workWeekModule;break;case"Month":this.parent.activeView=this.parent.monthModule;break;case"Year":this.parent.activeView=this.parent.yearModule;break;case"Agenda":this.parent.activeView=this.parent.agendaModule;break;case"MonthAgenda":this.parent.activeView=this.parent.monthAgendaModule;break;case"TimelineDay":this.parent.activeView=this.parent.timelineViewsModule,(0,e.isNullOrUndefined)(this.parent.activeView)||(this.parent.activeView.viewClass="e-timeline-day-view");break;case"TimelineWorkWeek":this.parent.activeView=this.parent.timelineViewsModule,(0,e.isNullOrUndefined)(this.parent.activeView)||(this.parent.activeView.viewClass="e-timeline-work-week-view");break;case"TimelineWeek":this.parent.activeView=this.parent.timelineViewsModule,(0,e.isNullOrUndefined)(this.parent.activeView)||(this.parent.activeView.viewClass="e-timeline-week-view");break;case"TimelineMonth":this.parent.activeView=this.parent.timelineMonthModule;break;case"TimelineYear":this.parent.activeView=this.parent.timelineYearModule}if((0,e.isNullOrUndefined)(this.parent.activeView)){var n=this.parent.viewCollections[0].option;if(n)return this.parent.setProperties({currentView:n},!0),this.parent.headerModule&&(this.parent.headerModule.updateActiveView(),this.parent.headerModule.setCalendarView()),console.warn('[WARNING] :: Module "'+t+'" is not available in Schedule component! You either misspelled the module name or forgot to load it.'),this.initializeLayout(n);throw Error("Inject required modules")}this.parent.uiStateValues.scheduleHeight=this.parent.element.offsetHeight,this.parent.activeView.viewIndex=this.parent.viewIndex,this.updateLabelText(t),this.parent.activeView.addEventListener(),this.parent.activeView.getRenderDates(),this.parent.uiStateValues.isGroupAdaptive=this.parent.activeViewOptions.group.resources.length>0&&(this.parent.enableAdaptiveUI&&!this.parent.isAdaptive||this.parent.isAdaptive&&this.parent.activeViewOptions.group.enableCompactView),this.parent.virtualScrollModule&&(this.parent.virtualScrollModule.destroy(),this.parent.virtualScrollModule=null),(-1===["Agenda","MonthAgenda","Year","TimelineYear"].indexOf(this.parent.currentView)||"TimelineYear"===this.parent.currentView&&"Vertical"===this.parent.activeViewOptions.orientation)&&this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&(this.parent.virtualScrollModule=new oo(this.parent),this.parent.activeView.isTimelineView()?this.parent.uiStateValues.top=0:(this.parent.virtualScrollModule.isHorizontalScroll=!0,this.parent.uiStateValues.left=0)),this.updateHeader(),this.parent.currentTimezoneDate=this.parent.getCurrentTime(),this.parent.activeView.renderLayout(pt),this.parent.renderTemplates(),this.parent.eventTooltip&&(this.parent.eventTooltip.destroy(),this.parent.eventTooltip=null),(this.parent.eventSettings.enableTooltip||this.parent.activeViewOptions.group.resources.length>0&&this.parent.activeViewOptions.group.headerTooltipTemplate)&&(this.parent.eventTooltip=new Ua(this.parent))},t.prototype.updateHeader=function(){this.parent.headerModule&&(this.parent.headerModule.setDayOfWeek(this.parent.activeViewOptions.firstDayOfWeek),this.parent.activeViewOptions.readonly?(0,e.addClass)([this.parent.element],cr):this.parent.element.classList.contains(cr)&&(0,e.removeClass)([this.parent.element],cr),this.parent.headerModule.updateDateRange(),this.parent.headerModule.updateHeaderItems("remove"))},t.prototype.updateLabelText=function(e){this.parent.element.setAttribute("role","application"),this.parent.element.removeAttribute("aria-labelledby"),this.parent.element.removeAttribute("aria-label"),"Year"===e?this.parent.element.setAttribute("aria-label",this.parent.activeView.getLabelText(e)):this.parent.element.setAttribute("aria-labelledby",this.parent.element.id+"_table")},t}(),po=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),co=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},ho=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return po(i,t),co([(0,e.Property)(!0)],i.prototype,"highlight",void 0),co([(0,e.Property)("09:00")],i.prototype,"start",void 0),co([(0,e.Property)("18:00")],i.prototype,"end",void 0),i}(e.ChildProperty),uo=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),go=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},vo=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return uo(i,t),go([(0,e.Property)(!0)],i.prototype,"enable",void 0),go([(0,e.Property)(60)],i.prototype,"interval",void 0),go([(0,e.Property)(2)],i.prototype,"slotCount",void 0),go([(0,e.Property)()],i.prototype,"minorSlotTemplate",void 0),go([(0,e.Property)()],i.prototype,"majorSlotTemplate",void 0),i}(e.ChildProperty),mo=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),fo=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},yo=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return mo(i,t),fo([(0,e.Property)("Both")],i.prototype,"templateType",void 0),fo([(0,e.Property)()],i.prototype,"header",void 0),fo([(0,e.Property)()],i.prototype,"content",void 0),fo([(0,e.Property)()],i.prototype,"footer",void 0),i}(e.ChildProperty),To=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),wo=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},Do=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return To(i,t),wo([(0,e.Property)()],i.prototype,"option",void 0),wo([(0,e.Property)()],i.prototype,"template",void 0),i}(e.ChildProperty),bo=function(){function t(e){this.parent=e,this.crudObj={sourceEvent:null,targetEvent:null,isCrudAction:!1}}return t.prototype.getQuery=function(){var e=this.parent.activeView.startDate(),t=this.parent.activeView.endDate();return this.parent.dataModule.generateQuery(e,t)},t.prototype.getTable=function(){return this.parent.eventSettings.query?this.parent.eventSettings.query.clone().fromTable:null},t.prototype.refreshDataManager=function(){var e=this;if(this.parent.activeView){if(this.parent.uiStateValues&&this.parent.uiStateValues.isPreventEventRefresh)return this.parent.uiStateValues.isPreventEventRefresh=!1,this.parent.refreshEvents(!1),void this.parent.hideSpinner();var t=this.parent.activeView.startDate(),i=this.parent.activeView.endDate();this.parent.dataModule.getData(this.parent.dataModule.generateQuery(t,i)).then((function(t){return e.dataManagerSuccess(t)})).catch((function(t){return e.dataManagerFailure(t)}))}},t.prototype.dataManagerSuccess=function(t){var i=this;!this.parent||this.parent&&this.parent.isDestroyed||this.parent.trigger(T,t,(function(t){if(!t.cancel){var n=(0,e.extend)([],t.result,null,!0);i.parent.eventsData=n.filter((function(e){return!e[i.parent.eventFields.isBlock]})),i.parent.blockData=n.filter((function(e){return e[i.parent.eventFields.isBlock]})),i.refreshProcessedData(),i.parent.dragAndDropModule&&"drag"===i.parent.dragAndDropModule.actionObj.action&&i.parent.dragAndDropModule.navigationWrapper(),i.parent.trigger(w,null,(function(){i.parent.hideSpinner(),i.parent.isPrinting&&setTimeout((function(){i.parent.notify(W,{})}),100)}))}}))},t.prototype.dataManagerFailure=function(e){var t=this;!this.parent||this.parent&&this.parent.isDestroyed||this.parent.trigger(h,{error:e},(function(){return t.parent.hideSpinner()}))},t.prototype.refreshProcessedData=function(t,i){if(void 0===t&&(t=!1),this.parent.dragAndDropModule&&(this.parent.dragAndDropModule.actionObj.action="",(0,e.removeClass)([this.parent.element],"e-event-action")),this.parent.activeViewOptions&&this.parent.activeViewOptions.eventTemplate){var n=["eventTemplate"];if(this.crudObj.isCrudAction&&-1===["Agenda","MonthAgenda","Year","TimelineYear"].indexOf(this.parent.currentView)){n=[];for(var r=0,a=this.crudObj.sourceEvent.length;r<a;r++)n.push("eventTemplate_"+this.crudObj.sourceEvent[parseInt(r.toString(),10)].groupIndex),this.crudObj.targetEvent[parseInt(r.toString(),10)]&&this.crudObj.sourceEvent[parseInt(r.toString(),10)].groupIndex!==this.crudObj.targetEvent[parseInt(r.toString(),10)].groupIndex&&n.push("eventTemplate_"+this.crudObj.targetEvent[parseInt(r.toString(),10)].groupIndex)}n.length>0&&this.parent.resetTemplates(n)}if(t)this.parent.notify(z,{processedData:i?this.parent.eventBase.processData(i):this.parent.eventsProcessed});else{var s=this.parent.eventsData||[],o=this.parent.blockData||[],l=s.concat(o);this.parent.notify(z,{processedData:this.parent.eventBase?this.parent.eventBase.processData(l):[]})}},t.prototype.refreshData=function(t){var i=this,n={requestType:t.requestType,cancel:!1,data:t.data,addedRecords:t.editParams.addedRecords,changedRecords:t.editParams.changedRecords,deletedRecords:t.editParams.deletedRecords};if(this.parent.dragAndDropModule&&this.parent.dragAndDropModule.actionObj&&this.parent.dragAndDropModule.actionObj.element&&this.parent.dragAndDropModule.actionObj.action&&(this.parent.dragAndDropModule.actionObj.element.style.display="none"),this.parent.resizeModule&&this.parent.resizeModule.actionObj&&this.parent.resizeModule.actionObj.element&&this.parent.resizeModule.actionObj.action&&(this.parent.resizeModule.actionObj.element.style.display="none"),this.parent.isSpecificResourceEvents()&&("eventCreated"===t.requestType||"eventRemoved"===t.requestType)){this.crudObj.isCrudAction=!0,this.crudObj.sourceEvent=[];for(var r=t.data instanceof Array?0===t.data.length&&"eventRemoved"===t.requestType?t.editParams.deletedRecords:t.data:"string"!=typeof t.data&&"number"!=typeof t.data||"eventRemoved"!==t.requestType?[t.data]:t.editParams.deletedRecords,a=function(i){s.crudObj.isCrudAction=!("eventRemoved"===t.requestType&&!(0,e.isNullOrUndefined)(i.parent));var n=s.parent.eventBase.getGroupIndexFromEvent(i);n>-1&&0===s.parent.crudModule.crudObj.sourceEvent.filter((function(e){return e.groupIndex===n})).length&&s.crudObj.isCrudAction&&s.crudObj.sourceEvent.push(s.parent.resourceBase.lastResourceLevel[parseInt(n.toString(),10)])},s=this,o=0,l=r;o<l.length;o++){a(l[o])}this.crudObj.targetEvent=this.crudObj.sourceEvent}this.parent.dataModule.dataManager.dataSource.offline?this.parent.trigger(c,n,(function(e){e.cancel||i.refreshDataManager()})):t.promise.then((function(){!i.parent||i.parent&&i.parent.isDestroyed||i.parent.trigger(c,n,(function(e){e.cancel||i.refreshDataManager()}))})).catch((function(e){!i.parent||i.parent&&i.parent.isDestroyed||i.parent.trigger(h,{error:e})}))},t.prototype.processAddEvent=function(t){var i,n=this.parent.eventFields,r={addedRecords:[],changedRecords:[],deletedRecords:[]};if(t.addedRecords instanceof Array){for(var a=0,s=t.addedRecords;a<s.length;a++){var o=s[a];o=this.parent.eventBase.updateEventDateTime(o);var l=(0,e.extend)({},this.parent.eventBase.processTimezone(o,!0),null,!0);r.addedRecords.push(l)}i=this.parent.dataModule.dataManager.saveChanges(r,n.id,this.getTable(),this.getQuery())}else{var p=this.parent.eventBase.processTimezone(t.addedRecords,!0);r.addedRecords.push(p),i=this.parent.dataModule.dataManager.insert(p,this.getTable(),this.getQuery())}var c={requestType:"eventCreated",cancel:!1,data:t.addedRecords,promise:i,editParams:r};this.refreshData(c)},t.prototype.processSaveEvent=function(t){var i,n=this.parent.eventFields,r={addedRecords:[],changedRecords:[],deletedRecords:[]};if(t.changedRecords instanceof Array){for(var a=0,s=t.changedRecords;a<s.length;a++){var o=s[a];o=this.parent.eventBase.updateEventDateTime(o);var l=(0,e.extend)({},this.parent.eventBase.processTimezone(o,!0),null,!0);r.changedRecords.push(l)}i=this.parent.dataModule.dataManager.saveChanges(r,n.id,this.getTable(),this.getQuery())}else{var p=this.parent.eventBase.processTimezone(t.changedRecords,!0);r.changedRecords.push(p),i=this.parent.dataModule.dataManager.update(n.id,p,this.getTable(),this.getQuery())}var c=(0,e.extend)({},t.changedRecords[t.changedRecords.length-1],null,!0);this.parent.eventBase.selectWorkCellByTime([this.parent.eventBase.processTimezone(c)]);var h={requestType:"eventChanged",cancel:!1,data:t.changedRecords,promise:i,editParams:r};this.refreshData(h)},t.prototype.processDeleteEvent=function(e){var t,i=this.parent.eventFields,n={addedRecords:[],changedRecords:[],deletedRecords:[]};e.deletedRecords.length>1?(n.deletedRecords=n.deletedRecords.concat(e.deletedRecords),t=this.parent.dataModule.dataManager.saveChanges(n,i.id,this.getTable(),this.getQuery())):(n.deletedRecords.push(e.deletedRecords[0]),t=this.parent.dataModule.dataManager.remove(i.id,e.deletedRecords[0],this.getTable(),this.getQuery())),this.parent.eventBase.selectWorkCellByTime(e.deletedRecords);var r={requestType:"eventRemoved",cancel:!1,data:e.deletedRecords,promise:t,editParams:n};this.refreshData(r)},t.prototype.addEvent=function(e){var t=this;if(this.parent.eventSettings.allowAdding&&!this.parent.activeViewOptions.readonly){if(!this.isBlockEvent(e)&&this.parent.eventBase.isBlockRange(e))return void this.parent.quickPopup.openValidationError("blockAlert",e);if(this.parent.eventBase.checkOverlap(e))return;var i=e instanceof Array?e:[e];if(0===i.length)return;var n={requestType:"eventCreate",cancel:!1,data:i,addedRecords:i,changedRecords:[],deletedRecords:[]};this.parent.trigger(p,n,(function(e){e.cancel||(e.promise?e.promise.then((function(i){!t.parent||t.parent&&t.parent.isDestroyed||i&&t.processAddEvent(e)})).catch((function(e){!t.parent||t.parent&&t.parent.isDestroyed||t.parent.trigger(h,{error:e})})):t.processAddEvent(e))}))}},t.prototype.saveEvent=function(e,t){var i=this;if(this.parent.eventSettings.allowEditing&&!this.parent.activeViewOptions.readonly){if("EditFollowingEvents"!==this.parent.currentAction&&!this.isBlockEvent(e)&&this.parent.eventBase.isBlockRange(e))return this.parent.quickPopup.openValidationError("blockAlert",e),void(this.parent.crudModule.crudObj.isCrudAction=!1);var n=e instanceof Array?e:[e];if(0===n.length)return;if(this.parent.currentAction=t,t)switch(t){case"Save":this.processSave(e);break;case"EditOccurrence":this.processOccurrences(e,t);break;case"EditFollowingEvents":this.processFollowSeries(e,t);break;case"EditSeries":this.processEntireSeries(e,t)}else{if(this.parent.eventBase.checkOverlap(e))return;var r={requestType:"eventChange",cancel:!1,data:e,addedRecords:[],changedRecords:n,deletedRecords:[]};this.parent.trigger(p,r,(function(e){e.cancel||(e.promise?e.promise.then((function(t){!i.parent||i.parent&&i.parent.isDestroyed||t&&i.processSaveEvent(e)})).catch((function(e){!i.parent||i.parent&&i.parent.isDestroyed||i.parent.trigger(h,{error:e})})):i.processSaveEvent(e))}))}}},t.prototype.deleteEvent=function(e,t){var i=this;if(this.parent.eventSettings.allowDeleting&&!this.parent.activeViewOptions.readonly){this.parent.currentAction=t;var n=[];if(0===(n="string"==typeof e||"number"==typeof e?this.parent.eventsData.filter((function(t){return t[i.parent.eventFields.id]===e})):e instanceof Array?e:[e]).length)return;if(t)switch(t){case"Delete":this.processDelete(n);break;case"DeleteOccurrence":this.processOccurrences(n,t);break;case"DeleteFollowingEvents":this.processFollowSeries(n,t);break;case"DeleteSeries":this.processEntireSeries(n,t)}else{var r={requestType:"eventRemove",cancel:!1,data:e,addedRecords:[],changedRecords:[],deletedRecords:n};this.parent.trigger(p,r,(function(e){e.cancel||(e.promise?e.promise.then((function(t){!i.parent||i.parent&&i.parent.isDestroyed||t&&i.processDeleteEvent(e)})).catch((function(e){!i.parent||i.parent&&i.parent.isDestroyed||i.parent.trigger(h,{error:e})})):i.processDeleteEvent(e))}))}}},t.prototype.processOccurrences=function(t,i){var n=this,r=[],a=!1;if(t instanceof Array)for(var s=0,o=t;s<o.length;s++){var l=o[s];r.push({occurrence:l,parent:this.getParentEvent(l)})}else r={occurrence:t,parent:this.getParentEvent(t)};var c={requestType:"EditOccurrence"===i?"eventChange":"eventRemove",cancel:!1,addedRecords:[],changedRecords:t instanceof Array?t:[t],deletedRecords:[]};c.data=r,this.parent.trigger(p,c,(function(t){if(!t.cancel){for(var s=n.parent.eventFields,o={addedRecords:[],changedRecords:[],deletedRecords:[]},l=r instanceof Array?r:[r],p=function(e,r){var p=t.changedRecords[parseInt(e.toString(),10)],c=l[parseInt(e.toString(),10)].parent,h=c[s.recurrenceException],d=void 0,u=void 0;switch(i){case"EditOccurrence":d=n.parent.eventsProcessed.filter((function(e){return e.Guid===p.Guid}))[0],(u=n.excludeDateCheck(d[s.startTime],h))!==c[s.recurrenceException]?(c[s.recurrenceException]=u,p[s.recurrenceException]=Ea(d[s.startTime]),p[s.recurrenceID]=c[s.id],p[s.followingID]=null,o.changedRecords.push(n.parent.eventBase.processTimezone(c,!0)),o.addedRecords.push(n.parent.eventBase.processTimezone(p,!0))):o.changedRecords.push(n.parent.eventBase.processTimezone(p,!0));break;case"DeleteOccurrence":p[s.recurrenceException]||(c[s.recurrenceException]=n.excludeDateCheck(p[s.startTime],h),o.changedRecords.push(n.parent.eventBase.processTimezone(c,!0))),p[s.id]!==c[s.id]&&(o.deletedRecords.push(n.parent.eventBase.processTimezone(p,!0)),a=!0)}},c=0,h=t.changedRecords.length;c<h;c++)p(c);var d=n.parent.dataModule.dataManager.saveChanges(o,s.id,n.getTable(),n.getQuery()),u=(0,e.extend)({},t.changedRecords[t.changedRecords.length-1],null,!0);n.parent.eventBase.selectWorkCellByTime("EditOccurrence"===i?[n.parent.eventBase.processTimezone(u)]:[u]);var g={requestType:"EditOccurrence"===i?"eventChanged":"eventRemoved",cancel:!1,data:a?t.deletedRecords:t.changedRecords,promise:d,editParams:o};n.refreshData(g)}}))},t.prototype.processFollowSeries=function(t,i){var n=this,r=[];if(t instanceof Array)for(var a=0,s=t;a<s.length;a++){var o=s[a];r.push({occurrence:o,parent:this.getParentEvent(o)})}else r={occurrence:t,parent:this.getParentEvent(t)};var l={requestType:"EditFollowingEvents"===i?"eventChange":"eventRemove",cancel:!1,addedRecords:[],changedRecords:t instanceof Array?t:[t],deletedRecords:[]};l.data=r,this.parent.trigger(p,l,(function(t){if(!t.cancel){for(var a=n.parent.eventFields,s={addedRecords:[],changedRecords:[],deletedRecords:[]},o=r instanceof Array?r:[r],l=function(e,r){var l=t.changedRecords[parseInt(e.toString(),10)],p=o[parseInt(e.toString(),10)].parent,c=n.parent.eventBase.getEventCollections(p,l),h=void 0;switch(i){case"EditFollowingEvents":if(n.processRecurrenceRule(p,l),h=!n.parent.eventBase.isFollowingEvent(p,l),l[a.followingID]=h?null:p[a.id],l[a.recurrenceID]=null,s.addedRecords.push(n.parent.eventBase.processTimezone(l,!0)),s.changedRecords.push(n.parent.eventBase.processTimezone(p,!0)),!n.parent.uiStateValues.isIgnoreOccurrence){if(l[a.recurrenceException]=null,c.occurrence.length>0){var d=c.occurrence.slice(-1)[0][a.recurrenceRule];-1===d.indexOf("COUNT")&&(l[a.recurrenceRule]=d)}c.follow.length>0&&(l[a.recurrenceRule]=c.follow.slice(-1)[0][a.recurrenceRule],s.deletedRecords=s.deletedRecords.concat(c.follow)),h&&(c.occurrence=c.occurrence.filter((function(e){return e[a.recurrenceID]===p[a.id]}))),s.deletedRecords=s.deletedRecords.concat(c.occurrence)}break;case"DeleteFollowingEvents":n.processRecurrenceRule(p,l[a.startTime]),s.changedRecords.push(n.parent.eventBase.processTimezone(p,!0)),s.deletedRecords=s.deletedRecords.concat(c.occurrence).concat(c.follow)}},p=0,c=t.changedRecords.length;p<c;p++)l(p);var h=n.parent.dataModule.dataManager.saveChanges(s,a.id,n.getTable(),n.getQuery()),d=(0,e.extend)({},t.changedRecords[t.changedRecords.length-1],null,!0);n.parent.eventBase.selectWorkCellByTime("EditFollowingEvents"===i?[n.parent.eventBase.processTimezone(d)]:[d]);var u={requestType:"EditFollowingEvents"===i?"eventChanged":"eventRemoved",cancel:!1,data:t.changedRecords,promise:h,editParams:s};n.refreshData(u)}}))},t.prototype.processEntireSeries=function(t,i){var n=this,r=[],a=!1;if(t instanceof Array)for(var s=0,o=t;s<o.length;s++){var l=o[s];r.push(this.getParentEvent(l,!0))}else r=this.getParentEvent(t,!0);var c=t instanceof Array?t:[t],h={requestType:"EditSeries"===i?"eventChange":"eventRemove",cancel:!1,addedRecords:[],changedRecords:[],deletedRecords:[]};if(h.data=r,"EditSeries"===i?h.changedRecords=c:h.deletedRecords=c,"EditSeries"===i&&!this.parent.uiStateValues.isIgnoreOccurrence)for(var d=r instanceof Array?r:[r],u=0,g=h.changedRecords.length;u<g;u++){var v=d[parseInt(u.toString(),10)],m=this.parent.eventBase.getEventCollections(v),f=m.follow.concat(m.occurrence);h.deletedRecords=h.deletedRecords.concat(f)}this.parent.trigger(p,h,(function(t){if(!t.cancel){for(var s=n.parent.eventFields,o={addedRecords:[],changedRecords:[],deletedRecords:[]},l=r instanceof Array?r:[r],p="EditSeries"===i?t.changedRecords:t.deletedRecords,c=function(e,t){var r=p[parseInt(e.toString(),10)],c=l[parseInt(e.toString(),10)],h=n.parent.eventBase.getEventCollections(c),d=h.follow.concat(h.occurrence);switch(i){case"EditSeries":if(r[s.id]=c[s.id],r[s.recurrenceID]=null,r[s.followingID]=null,n.parent.uiStateValues.isIgnoreOccurrence&&r[s.recurrenceException]){var u=n.parent.eventsData.filter((function(e){return e[s.id]===r[s.id]}));u.length>0&&(r[s.recurrenceRule]=u[0][s.recurrenceRule])}else r[s.recurrenceException]=null,o.deletedRecords=o.deletedRecords.concat(d);o.changedRecords.push(n.parent.eventBase.processTimezone(r,!0)),n.parent.uiStateValues.isIgnoreOccurrence=!1;break;case"DeleteSeries":o.deletedRecords=o.deletedRecords.concat(d.concat(n.parent.eventBase.processTimezone(c,!0))),a=!0}},h=0,d=p.length;h<d;h++)c(h);var u=n.parent.dataModule.dataManager.saveChanges(o,s.id,n.getTable(),n.getQuery()),g=(0,e.extend)({},p[p.length-1],null,!0);n.parent.eventBase.selectWorkCellByTime("EditSeries"===i?[n.parent.eventBase.processTimezone(g)]:[g]);var v={requestType:"EditSeries"===i?"eventChanged":"eventRemoved",cancel:!1,data:a?t.deletedRecords:t.changedRecords,promise:u,editParams:o};n.refreshData(v)}}))},t.prototype.processDelete=function(t){for(var i=this,n=[],r=0,a=t;r<a.length;r++){var s=a[r];s[this.parent.eventFields.recurrenceRule]?n.push({occurrence:s,parent:this.getParentEvent(s)}):n.push(s)}var o={requestType:"eventRemove",cancel:!1,addedRecords:[],changedRecords:[],deletedRecords:t};o.data=n,this.parent.trigger(p,o,(function(t){if(!t.cancel){for(var r=i.parent.eventFields,a={addedRecords:[],changedRecords:[],deletedRecords:[]},s=function(s,o){var l=(0,e.isNullOrUndefined)(t.deletedRecords[parseInt(s.toString(),10)][i.parent.eventFields.recurrenceRule]);if(!l){var p=n[parseInt(s.toString(),10)].parent,c=a.changedRecords.filter((function(e){return e[r.id]===p[r.id]})),h=t.deletedRecords[parseInt(s.toString(),10)][r.startTime];if(c.length>0){var d=c[0];d[r.recurrenceException]=i.excludeDateCheck(h,d[r.recurrenceException])}else p[r.recurrenceException]=i.excludeDateCheck(h,p[r.recurrenceException]);0===c.length&&a.changedRecords.push(i.parent.eventBase.processTimezone(p,!0)),l=t.deletedRecords[parseInt(s.toString(),10)][r.id]!==p[r.id]}if(l){if(t.deletedRecords instanceof Array)for(var u=0,g=t.deletedRecords;u<g.length;u++){var v=g[u];i.parent.eventBase.processTimezone(v,!0)}a.deletedRecords.push(t.deletedRecords[parseInt(s.toString(),10)])}},o=0,l=t.deletedRecords.length;o<l;o++)s(o);var p=i.parent.dataModule.dataManager.saveChanges(a,r.id,i.getTable(),i.getQuery()),c=(0,e.extend)({},t.deletedRecords[t.deletedRecords.length-1],null,!0);i.parent.eventBase.selectWorkCellByTime([i.parent.eventBase.processTimezone(c)]);var h={requestType:"eventRemoved",cancel:!1,data:t.deletedRecords,promise:p,editParams:a};i.refreshData(h)}}))},t.prototype.processSave=function(t){for(var i=this,n=t instanceof Array?t:[t],r=[],a=0,s=n;a<s.length;a++){var o=s[a];o[this.parent.eventFields.recurrenceRule]?r.push({occurrence:o,parent:this.getParentEvent(o)}):r.push(o)}var l={requestType:"eventChange",cancel:!1,addedRecords:[],changedRecords:n,deletedRecords:[]};l.data=r,this.parent.trigger(p,l,(function(t){if(!t.cancel){for(var n=i.parent.eventFields,r={addedRecords:[],changedRecords:[],deletedRecords:[]},a=0,s=t.changedRecords;a<s.length;a++){var o=s[a];if(!(0,e.isNullOrUndefined)(o[n.recurrenceRule])&&(0,e.isNullOrUndefined)(o[n.recurrenceException])){var l=Ea(o[n.startTime]),p=i.getParentEvent(o);p[n.recurrenceException]=(0,e.isNullOrUndefined)(p[n.recurrenceException])?l:p[n.recurrenceException].concat(","+l),o[n.id]=i.parent.getEventMaxID(),o[n.recurrenceException]=l,r.addedRecords.push(i.parent.eventBase.processTimezone(o,!0)),r.changedRecords.push(i.parent.eventBase.processTimezone(p,!0))}else r.changedRecords.push(i.parent.eventBase.processTimezone(o,!0))}var c=i.parent.dataModule.dataManager.saveChanges(r,n.id,i.getTable(),i.getQuery()),h=(0,e.extend)({},t.changedRecords[t.changedRecords.length-1],null,!0);i.parent.eventBase.selectWorkCellByTime([i.parent.eventBase.processTimezone(h)]);var d={requestType:"eventChanged",cancel:!1,data:t.changedRecords,promise:c,editParams:r};i.refreshData(d)}}))},t.prototype.getParentEvent=function(e,t){void 0===t&&(t=!1);var i=this.parent.eventBase.getParentEvent(e,t)||e;return(i[this.parent.eventFields.startTimezone]||i[this.parent.eventFields.endTimezone])&&this.parent.eventBase.timezoneConvert(i),i},t.prototype.excludeDateCheck=function(t,i){var n=this.parent.timezone||this.parent.tzModule.getLocalTimezoneName();n&&(t=this.parent.tzModule.remove(new Date(+t.getTime()),n));var r=Ea(t);return(0,e.isNullOrUndefined)(i)?i=r:-1===i.indexOf(r)&&(i=(0,e.isNullOrUndefined)(i)?r:i+","+r),i},t.prototype.processRecurrenceRule=function(e,t){var i,n=this.parent.eventFields,r=e[n.recurrenceRule];if(t instanceof Date)i=new Date(+t);else{i=new Date(+t[n.startTime]);var a=t[n.recurrenceRule];if(a){var s=e[n.startTime],o=Mr(s,a,"DeleteFollowingEvents"===this.parent.currentAction?t[n.recurrenceException]:null,this.parent.activeViewOptions.firstDayOfWeek),l=new Date(o.slice(-1)[0]);l.setHours(i.getHours(),i.getMinutes(),i.getSeconds()),i.setHours(s.getHours(),s.getMinutes(),s.getSeconds()),t[n.recurrenceRule]=this.getUpdatedRecurrenceRule(a,new Date(+l),!1)}}e[n.recurrenceRule]=this.getUpdatedRecurrenceRule(r,ye(new Date(i.getTime()),-1),!0)},t.prototype.getUpdatedRecurrenceRule=function(e,t,i){for(var n="",r=0,a=e.split(";");r<a.length;r++){var s=a[r];if(""!==s){var o=s.split("=")[0],l=s.split("=")[1];"COUNT"!==o&&"UNTIL"!==o||(l=Ea(t),s=s.replace(s,"UNTIL="+l)),n+=s+";"}}return i&&-1===n.indexOf("UNTIL")&&(n+="UNTIL="+Ea(t)),n},t.prototype.isBlockEvent=function(e){for(var t=!1,i=0,n=e instanceof Array?e:[e];i<n.length;i++){t=n[i][this.parent.eventFields.isBlock]||!1}return t},t.prototype.destroy=function(){this.crudObj=null,this.parent=null},t}(),So=function(){function t(t){this.parent=t,e.EventHandler.add(this.parent.element,"mouseover",this.onHover,this)}return t.prototype.cellMouseDown=function(e){this.isPreventAction(e)||this.parent.notify($,{event:e})},t.prototype.cellClick=function(t){var i=this;if(!this.isPreventAction(t)){var n="."+$e+",."+Ke+",."+rt,a=(0,e.closest)(t.target,n);if(!(0,e.isNullOrUndefined)(a))if((0,e.isNullOrUndefined)((0,e.closest)(t.target,"."+bi))){var s=a.classList.contains($e)||a.classList.contains(Ke);this.parent.uiStateValues.isTapHold&&!this.parent.uiStateValues.action&&s&&(this.parent.uiStateValues.isTapHold=!1,this.parent.eventBase.removeSelectedAppointmentClass(),this.parent.selectedElements=[]);var o=(0,e.closest)(t.target,"."+di),l=this.parent.getNavigateView(),p=this.parent.currentView===l;if((0,e.isNullOrUndefined)(o)||p||(0,e.isNullOrUndefined)(this.parent.viewOptions[l.charAt(0).toLowerCase()+l.slice(1)])){if(this.parent.activeViewOptions.readonly&&"MonthAgenda"!==this.parent.currentView)return void(this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide());if(this.parent.isAdaptive&&(t.target.classList.contains(Bi)||(0,e.closest)(t.target,"."+Bi)))return;if(s&&t.shiftKey&&1===t.which&&this.parent.keyboardInteractionModule)return void this.parent.keyboardInteractionModule.onMouseSelection(t);this.parent.activeCellsData=this.parent.getCellDetails(a);var c=(0,e.extend)(this.parent.activeCellsData,{cancel:!1,event:t,name:"cellClick"});this.parent.trigger(r,c,(function(e){if(e.cancel)i.parent.quickPopup&&i.parent.quickPopup.quickPopupHide();else if(s&&i.parent.selectCell(a),i.parent.allowInline){var t={element:e.element,groupIndex:e.groupIndex,type:"Cell"};i.parent.notify(A,t)}else i.parent.notify(r,e)}))}else{var h=this.parent.getDateFromElement(a);!(0,e.isNullOrUndefined)(h)&&this.parent.isMinMaxDate(h)&&(this.parent.setProperties({selectedDate:h},!0),this.parent.changeView(this.parent.getNavigateView(),t))}}else this.parent.eventWindow.openEditor(this.parent.activeCellsData,"Add")}},t.prototype.cellDblClick=function(t){var i=this,n="."+$e+",."+Ke+",."+rt,r=(0,e.closest)(t.target,n);if(!(this.parent.activeViewOptions.readonly||this.isPreventAction(t)||(0,e.isNullOrUndefined)(r))){var s=(0,e.extend)(this.parent.activeCellsData,{cancel:!1,event:t,name:"cellDoubleClick"});this.parent.trigger(a,s,(function(e){var t=new Date(e.startTime.getTime());i.parent.isMinMaxDate(new Date(t.setHours(0,0,0,0)))&&(e.cancel||i.parent.eventWindow.openEditor(i.parent.activeCellsData,"Add"))}))}},t.prototype.onHover=function(t){var i="."+$e+",."+Vt+",."+Ke+",."+rt+",."+Ot+",."+Xt+",."+zt+",."+pi,n=(0,e.closest)(t.target,i);if(n){var r={element:n,event:t};this.parent.trigger(l,r)}},t.prototype.isPreventAction=function(t){if((0,e.closest)(t.target,"."+di))return!1;if((0,e.closest)(t.target,"."+jt)&&!(0,e.closest)(t.target,"."+Bi))return!0;var i=(0,e.closest)(t.target,"."+Xt+",."+mt);return!(0,e.isNullOrUndefined)(i)||(i=(0,e.closest)(t.target,"."+rt),!(!this.parent.activeView||!this.parent.activeView.isTimelineView()||(0,e.isNullOrUndefined)(i)))},t.prototype.destroy=function(){e.EventHandler.remove(this.parent.element,"mouseover",this.onHover)},t}(),Co=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Oo=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},Eo=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return Co(i,t),Oo([(0,e.Property)()],i.prototype,"name",void 0),Oo([(0,e.Property)()],i.prototype,"default",void 0),Oo([(0,e.Property)()],i.prototype,"title",void 0),Oo([(0,e.Property)({})],i.prototype,"validation",void 0),i}(e.ChildProperty),xo=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Vo=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},Ao=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return xo(i,t),Vo([(0,e.Property)("Id")],i.prototype,"id",void 0),Vo([(0,e.Property)("IsBlock")],i.prototype,"isBlock",void 0),Vo([(0,e.Complex)({name:"Subject"},Eo)],i.prototype,"subject",void 0),Vo([(0,e.Complex)({name:"StartTime"},Eo)],i.prototype,"startTime",void 0),Vo([(0,e.Complex)({name:"EndTime"},Eo)],i.prototype,"endTime",void 0),Vo([(0,e.Complex)({name:"StartTimezone"},Eo)],i.prototype,"startTimezone",void 0),Vo([(0,e.Complex)({name:"EndTimezone"},Eo)],i.prototype,"endTimezone",void 0),Vo([(0,e.Complex)({name:"Location"},Eo)],i.prototype,"location",void 0),Vo([(0,e.Complex)({name:"Description"},Eo)],i.prototype,"description",void 0),Vo([(0,e.Complex)({name:"IsAllDay"},Eo)],i.prototype,"isAllDay",void 0),Vo([(0,e.Complex)({name:"RecurrenceID"},Eo)],i.prototype,"recurrenceID",void 0),Vo([(0,e.Complex)({name:"RecurrenceRule"},Eo)],i.prototype,"recurrenceRule",void 0),Vo([(0,e.Complex)({name:"RecurrenceException"},Eo)],i.prototype,"recurrenceException",void 0),Vo([(0,e.Property)("IsReadonly")],i.prototype,"isReadonly",void 0),Vo([(0,e.Property)("FollowingID")],i.prototype,"followingID",void 0),i}(e.ChildProperty),Io=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Mo=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},ko=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return Io(i,t),Mo([(0,e.Property)()],i.prototype,"template",void 0),Mo([(0,e.Property)([])],i.prototype,"dataSource",void 0),Mo([(0,e.Property)()],i.prototype,"query",void 0),Mo([(0,e.Complex)({},Ao)],i.prototype,"fields",void 0),Mo([(0,e.Property)(!1)],i.prototype,"enableTooltip",void 0),Mo([(0,e.Property)("AllDayRow")],i.prototype,"spannedEventPlacement",void 0),Mo([(0,e.Property)(1)],i.prototype,"minimumEventDuration",void 0),Mo([(0,e.Property)()],i.prototype,"tooltipTemplate",void 0),Mo([(0,e.Property)()],i.prototype,"resourceColorField",void 0),Mo([(0,e.Property)(!1)],i.prototype,"editFollowingEvents",void 0),Mo([(0,e.Property)(!0)],i.prototype,"allowAdding",void 0),Mo([(0,e.Property)(!0)],i.prototype,"allowEditing",void 0),Mo([(0,e.Property)(!0)],i.prototype,"allowDeleting",void 0),Mo([(0,e.Property)(!1)],i.prototype,"enableMaxHeight",void 0),Mo([(0,e.Property)(!1)],i.prototype,"enableIndicator",void 0),Mo([(0,e.Property)(!1)],i.prototype,"ignoreWhitespace",void 0),Mo([(0,e.Property)()],i.prototype,"sortComparer",void 0),Mo([(0,e.Property)()],i.prototype,"includeFiltersInQuery",void 0),i}(e.ChildProperty),Ro=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ho=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},Po=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return Ro(i,t),Ho([(0,e.Property)(!1)],i.prototype,"byDate",void 0),Ho([(0,e.Property)(!0)],i.prototype,"byGroupID",void 0),Ho([(0,e.Property)(!1)],i.prototype,"allowGroupEdit",void 0),Ho([(0,e.Property)([])],i.prototype,"resources",void 0),Ho([(0,e.Property)(!0)],i.prototype,"enableCompactView",void 0),Ho([(0,e.Property)()],i.prototype,"headerTooltipTemplate",void 0),Ho([(0,e.Property)(!1)],i.prototype,"hideNonWorkingDays",void 0),i}(e.ChildProperty),jo=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),No=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},Lo=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return jo(i,t),No([(0,e.Property)()],i.prototype,"field",void 0),No([(0,e.Property)()],i.prototype,"title",void 0),No([(0,e.Property)()],i.prototype,"name",void 0),No([(0,e.Property)(!1)],i.prototype,"allowMultiple",void 0),No([(0,e.Property)([])],i.prototype,"dataSource",void 0),No([(0,e.Property)()],i.prototype,"query",void 0),No([(0,e.Property)("Id")],i.prototype,"idField",void 0),No([(0,e.Property)("Text")],i.prototype,"textField",void 0),No([(0,e.Property)("Expanded")],i.prototype,"expandedField",void 0),No([(0,e.Property)("GroupID")],i.prototype,"groupIDField",void 0),No([(0,e.Property)("Color")],i.prototype,"colorField",void 0),No([(0,e.Property)("StartHour")],i.prototype,"startHourField",void 0),No([(0,e.Property)("EndHour")],i.prototype,"endHourField",void 0),No([(0,e.Property)("WorkDays")],i.prototype,"workDaysField",void 0),No([(0,e.Property)("CssClass")],i.prototype,"cssClassField",void 0),i}(e.ChildProperty),qo=function(){function n(e){this.resourceCollection=[],this.leftPixel=25,this.resourceDateTree=[],this.parent=e}return n.prototype.renderResourceHeaderIndent=function(t){var i=(0,e.createElement)("td",{className:"e-resource-left-td"}),n=(0,e.createElement)("div",{className:ft});if(this.parent.activeViewOptions.headerIndentTemplate){var r={className:[i.className],type:"emptyCells"};this.parent.renderHeaderIndentTemplate(r,i)}else i.appendChild(n);var a={elementType:"emptyCells",element:i};this.parent.trigger(v,a),t.appendChild(i)},n.prototype.hideResourceRows=function(t){if(!(this.resourceCollection.length<=1||this.parent.virtualScrollModule))for(var i=this.lastResourceLevel.length,n=0;n<i;n++){var r=this.lastResourceLevel[parseInt(n.toString(),10)].resourceData,a=this.lastResourceLevel[parseInt(n.toString(),10)].resource;if(r.ClassName===Dt&&!r[a.expandedField]&&!(0,e.isNullOrUndefined)(r[a.expandedField])){var s=[].slice.call(t.children).slice(n+1,n+(parseInt(r.Count,10)+1));(0,e.addClass)(s,Xn)}}},n.prototype.createResourceColumn=function(){var t=this.resourceCollection,i=(0,e.createElement)("div",{className:yt}),n=this.parent.activeView.createTableLayout(Tt);!this.parent.uiStateValues.isGroupAdaptive&&this.parent.rowAutoHeight&&this.parent.activeView.isTimelineView()&&this.parent.activeViewOptions.group.resources.length>0&&(0,e.addClass)([n],lr);var r=n.querySelector("tbody"),a=this.generateTreeData(!0);if(this.countCalculation(t.slice(0,-2),t.slice(0,-1)),this.renderedResources=this.lastResourceLevel,this.parent.virtualScrollModule){var s=this.parent.virtualScrollModule.getRenderedCount();this.setExpandedResources(),a=this.expandedResources.slice(0,s),this.renderedResources=a}return(0,e.append)(this.getContentRows(a),r),this.hideResourceRows(r),n.appendChild(r),i.appendChild(n),i},n.prototype.setRenderedResources=function(){var e=this.resourceCollection;this.generateTreeData(!0);this.countCalculation(e.slice(0,-2),e.slice(0,-1)),this.renderedResources=this.lastResourceLevel},n.prototype.setExpandedResources=function(){for(var t=[],i=0;i<this.lastResourceLevel.length;i++){var n=this.lastResourceLevel[parseInt(i.toString(),10)].resourceData,r=n.Count;t.push(this.lastResourceLevel[parseInt(i.toString(),10)]);var a=n[this.lastResourceLevel[parseInt(i.toString(),10)].resource.expandedField];!(0,e.isNullOrUndefined)(a)&&!a&&r>0&&(i+=r)}this.expandedResources=t},n.prototype.getContentRows=function(t,i){for(var n,r,a=[],s=this.resourceCollection,o=(0,e.createElement)("tr"),l=(0,e.createElement)("td",{attrs:{tabindex:i?"-1":"0"}}),p=this.parent.activeView.getGroupIndices(),c=0;c<t.length;c++)if(!(p.length>0&&p.indexOf(t[parseInt(c.toString(),10)].groupIndex)>-1)){var h=l.cloneNode();if((r=Ae(s,"name",t[parseInt(c.toString(),10)].resource.name))===s.length-1?((0,e.extend)(t[parseInt(c.toString(),10)].resourceData,{ClassName:wt}),this.renderedResources[parseInt(c.toString(),10)].className=[wt]):((0,e.extend)(t[parseInt(c.toString(),10)].resourceData,{ClassName:Dt}),this.renderedResources[parseInt(c.toString(),10)].className=[Dt]),n=r*this.leftPixel+"px",t[parseInt(c.toString(),10)].resourceData.ClassName===Dt&&!(0,e.isNullOrUndefined)(t[parseInt(c.toString(),10)].resourceData.Count)&&t[parseInt(c.toString(),10)].resourceData.Count>0){var d=void 0;d=t[parseInt(c.toString(),10)].resourceData[s[parseInt(r.toString(),10)].expandedField]||(0,e.isNullOrUndefined)(t[parseInt(c.toString(),10)].resourceData[s[parseInt(r.toString(),10)].expandedField])?St:bt;var u=(0,e.createElement)("div");(0,e.addClass)([u],[Ct,d]),this.setMargin(u,n),h.appendChild(u),this.resourceCollection.length>1&&e.EventHandler.add(u,"click",this.onTreeIconClick,this)}this.parent.activeView.setResourceHeaderContent(h,t[parseInt(c.toString(),10)],ft),h.setAttribute("data-group-index",t[parseInt(c.toString(),10)].groupIndex.toString()),h.setAttribute("aria-label",t[parseInt(c.toString(),10)].resourceData[t[parseInt(c.toString(),10)].resource.textField]+" resource"),this.parent.activeViewOptions.resourceHeaderTemplate||this.setMargin(h.querySelector("."+ft),n);var g=[Ot,t[parseInt(c.toString(),10)].resourceData.ClassName];(0,e.addClass)([h],g);var m={elementType:"resourceHeader",element:h,groupIndex:t[parseInt(c.toString(),10)].groupIndex};this.parent.trigger(v,m);var f=o.cloneNode();f.appendChild(h),a.push(f)}return a},n.prototype.setMargin=function(e,t){this.parent.enableRtl?e.style.marginRight=t:e.style.marginLeft=t},n.prototype.countCalculation=function(t,i){for(var n,r=0;r<t.length;r++){for(var a=t[t.length-(r+1)].dataSource,s=0;s<a.length;s++){var o=0;if(this.parent.activeViewOptions.group.byGroupID){var l=(new Sr.Query).where(i[i.length-1].groupIDField,"equal",a[parseInt(s.toString(),10)][t[t.length-(r+1)].idField]);n=new Sr.DataManager(i[i.length-1].dataSource).executeLocal(l)}else n=i[i.length-1].dataSource;for(var p=0;p<n.length;p++)o+=parseInt(n[parseInt(p.toString(),10)].Count,10);o+=parseInt(a[parseInt(s.toString(),10)].Count,10),(0,e.extend)(a[parseInt(s.toString(),10)],{Count:o})}i=i.slice(0,-1)}},n.prototype.onTreeIconClick=function(t){var i=this;this.parent.eventTooltip&&this.parent.eventTooltip.close();var n,r=t.target,a=(0,e.closest)(r,"."+Dt).parentElement,s=parseInt(a.children[0].getAttribute("data-group-index"),10),o={cancel:!1,event:t,groupIndex:s,requestType:r.classList.contains(St)?"resourceCollapse":"resourceExpand"};this.parent.trigger(p,o,(function(a){if(!a.cancel){r.classList.contains(St)?((0,e.classList)(r,[bt],[St]),n=!0):((0,e.classList)(r,[St],[bt]),n=!1);for(var l=0,p=[].slice.call(i.parent.element.querySelectorAll("."+Xt+",."+Bi));l<p.length;l++){var h=p[l];(0,e.remove)(h)}i.parent.virtualScrollModule?i.updateVirtualContent(s,n,t,r):i.updateContent(s,n);var d={cssProperties:i.parent.getCssProperties(),module:"scroll"};i.parent.notify(Q,d),o={cancel:!1,event:t,groupIndex:s,requestType:r.classList.contains(St)?"resourceExpanded":"resourceCollapsed"},i.parent.refreshEvents(!1),i.parent.trigger(c,o)}}))},n.prototype.updateContent=function(t,i){for(var n,r=[],a=[],s=[],o=this.lastResourceLevel[parseInt(t.toString(),10)].resourceData,l=[].slice.call(this.parent.element.querySelectorAll("."+yt+" tr")),p=[].slice.call(this.parent.element.querySelectorAll("."+ri+" tbody tr")),c=[].slice.call(this.parent.element.querySelectorAll("."+ri+" ."+Gt)),h=0;h<o.Count;h++)r.push(l[t+h+1]),a.push(p[t+h+1]),s.push(c[t+h+1]);for(var d=this.lastResourceLevel,u=0;u<r.length;u++){var g=!0;if(n=r[parseInt(u.toString(),10)].children[0].classList.contains(Dt),d[parseInt(t.toString(),10)].resourceData[d[parseInt(t.toString(),10)].resource.expandedField]=!i,i){if(n)(v=r[parseInt(u.toString(),10)].querySelector("."+Ct))&&(0,e.classList)(v,[bt],[St]);r[parseInt(u.toString(),10)].classList.contains(Xn)||(0,e.addClass)([r[parseInt(u.toString(),10)],a[parseInt(u.toString(),10)],s[parseInt(u.toString(),10)]],Xn)}else{if(n){var v,m=r[parseInt(u.toString(),10)].rowIndex;if(d[parseInt(m.toString(),10)].resourceData[d[parseInt(m.toString(),10)].resource.expandedField]||(0,e.isNullOrUndefined)(d[parseInt(m.toString(),10)].resourceData[d[parseInt(m.toString(),10)].resource.expandedField])||(r.splice(u+1,parseInt(d[parseInt(m.toString(),10)].resourceData.Count,10)),a.splice(u+1,parseInt(d[parseInt(m.toString(),10)].resourceData.Count,10)),s.splice(u+1,parseInt(d[parseInt(m.toString(),10)].resourceData.Count,10)),g=!1),g)(v=r[parseInt(u.toString(),10)].querySelector("."+Ct))&&(0,e.classList)(v,[St],[bt])}r[parseInt(u.toString(),10)].classList.contains(Xn)&&(0,e.removeClass)([r[parseInt(u.toString(),10)],a[parseInt(u.toString(),10)],s[parseInt(u.toString(),10)]],Xn)}}},n.prototype.updateVirtualContent=function(t,i,n,r){this.lastResourceLevel[parseInt(t.toString(),10)].resourceData[this.lastResourceLevel[parseInt(t.toString(),10)].resource.expandedField]=!i,this.setExpandedResources();var a=this.parent.virtualScrollModule.getRenderedCount(),s=this.expandedResources.indexOf(this.renderedResources[0]);if(this.parent.virtualScrollModule.existingDataCollection=this.renderedResources,this.renderedResources=this.expandedResources.slice(s,s+a),this.renderedResources.length<a){var o=this.expandedResources.length-a;o=o>0?o:0,this.renderedResources=this.expandedResources.slice(o,this.expandedResources.length)}var l=this.parent.element.querySelector("."+ai);this.parent.virtualScrollModule.updateVirtualTrackHeight(l);var p=this.parent.element.querySelector("."+yt+" table"),c=this.parent.element.querySelector("."+ri+" table"),h=this.parent.element.querySelector("."+vt);this.parent.virtualScrollModule.updateContent(p,c,h,this.renderedResources);var d=this.parent.element.querySelector("."+Mt);(0,e.isNullOrUndefined)(d)||(d.style.height=this.parent.element.querySelector("."+Je).offsetHeight+"px")},n.prototype.renderResourceHeader=function(){var t=(0,e.createElement)("div",{className:qt});if(t.innerHTML='<div class="'+Ut+'"><div class="'+Zn+'"><div class="e-icons '+Jn+'"></div></div><div class="'+$n+'"></div></div>',"MonthAgenda"===this.parent.currentView){var i=this.parent.activeView.getPanel().querySelector("."+ri);i.insertBefore(t,i.querySelector("."+_t))}else this.parent.element.insertBefore(t,this.parent.element.querySelector("."+Xe));this.renderResourceHeaderText(),e.EventHandler.add(t.querySelector("."+Jn),"click",this.menuClick,this)},n.prototype.renderResourceTree=function(){this.popupOverlay=(0,e.createElement)("div",{className:er});var n=(0,e.createElement)("div",{className:tr+" e-popup-close"});if("MonthAgenda"===this.parent.currentView){var r=this.parent.activeView.getPanel().querySelector("."+_t);r.insertBefore(n,r.children[0]),r.appendChild(this.popupOverlay)}else this.parent.element.querySelector("."+Xe).appendChild(n),this.parent.element.querySelector("."+Xe).appendChild(this.popupOverlay);var a=(0,e.createElement)("div",{className:"e-resource-tree"});n.appendChild(a),this.treeViewObj=new i.TreeView({cssClass:this.parent.cssClass,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,fields:{dataSource:[].slice.call(this.generateTreeData()),id:"resourceId",text:"resourceName",child:"resourceChild"},nodeTemplate:this.parent.resourceHeaderTemplate,nodeClicked:this.resourceClick.bind(this),created:this.resourceTreeCreated.bind(this)}),this.treeViewObj.root=this.parent.root?this.parent.root:this.parent,this.treeViewObj.appendTo(a),this.treeViewObj.expandAll(),this.treePopup=new t.Popup(n,{targetType:"relative",actionOnScroll:"none",content:this.treeViewObj.element,relateTo:this.parent.element.querySelector("."+Xe),enableRtl:this.parent.enableRtl,hideAnimation:{name:"SlideLeftOut",duration:500},showAnimation:{name:"SlideLeftIn",duration:500},viewPortElement:this.parent.element.querySelector("."+("MonthAgenda"===this.parent.currentView?_t:Xe))}),this.parent.on(Z,this.documentClick,this)},n.prototype.resourceTreeCreated=function(){this.parent.activeViewOptions.resourceHeaderTemplate&&this.parent.portals&&this.treeViewObj.portals&&(this.parent.portals=this.parent.portals.concat(this.treeViewObj.portals),this.parent.renderTemplates())},n.prototype.generateTreeData=function(t){for(var i=this,n=[],r=[],a=0,s=function(s,l){var p=function(n,s,o){var l,c,h=i.resourceCollection[parseInt(s.toString(),10)];t?(c={type:"resourceHeader",resource:n.resource,resourceData:n.resourceData,groupIndex:a,groupOrder:n.groupOrder},r.push(c),a++):l={resourceId:o,resourceName:n.resourceData[h.textField],resource:n.resource,resourceData:n.resourceData},n.child.length>0&&!t&&(l.resourceChild=[]);for(var d=1,u=0,g=n.child;u<g.length;u++){var v=g[u];t?p(v,s+1,o+"-"+d):l.resourceChild.push(p(v,s+1,o+"-"+d)),d+=1}return t&&(0,e.extend)(c.resourceData,{Count:d-1}),l};t?p(o.resourceTreeLevel[parseInt(s.toString(),10)],0,(s+1).toString()):n.push(p(o.resourceTreeLevel[parseInt(s.toString(),10)],0,(s+1).toString()))},o=this,l=0,p=this.resourceTreeLevel.length;l<p;l++)s(l);return t?(this.lastResourceLevel=r,r):n},n.prototype.renderResourceHeaderText=function(){for(var t=this.lastResourceLevel[this.parent.uiStateValues.groupIndex],i=[],n=function(n,a){var s=r.resourceCollection[parseInt(n.toString(),10)],o=s.dataSource.filter((function(e){return e[s.idField]===t.groupOrder[parseInt(n.toString(),10)]})),l=(0,e.createElement)("div",{className:ei});r.parent.sanitize(o[0][s.textField],l),i.push(l);var p=(0,e.createElement)("div",{className:"e-icons e-icon-next"});i.push(p)},r=this,a=0,s=t.groupOrder.length;a<s;a++)n(a);i.pop();var o=("MonthAgenda"===this.parent.currentView?this.parent.activeView.getPanel():this.parent.element).querySelector("."+$n);Me(o);for(var l=0,p=i;l<p.length;l++){var c=p[l];o.appendChild(c)}1===this.lastResourceLevel.length&&(0,e.addClass)([this.parent.element.querySelector("."+Zn)],Ge)},n.prototype.menuClick=function(t){if(this.parent.element.querySelector("."+tr).classList.contains(tt))this.treePopup.hide(),(0,e.removeClass)([this.popupOverlay],_e);else{var i=[].slice.call(this.treeViewObj.element.querySelectorAll(".e-list-item:not(.e-has-child)"));(0,e.removeClass)(i,"e-active"),(0,e.addClass)([i[this.parent.uiStateValues.groupIndex]],"e-active"),this.treePopup.show(),(0,e.addClass)([this.popupOverlay],_e)}},n.prototype.selectResourceByIndex=function(e){this.lastResourceLevel&&e>-1&&e<this.lastResourceLevel.length&&this.triggerEvents(e)},n.prototype.resourceClick=function(t){if(!t.node.classList.contains("e-has-child")){this.treePopup.hide(),(0,e.removeClass)([this.popupOverlay],_e);var i=[].slice.call(this.treeViewObj.element.querySelectorAll(".e-list-item:not(.e-has-child)")).indexOf(t.node);this.triggerEvents(i,t),t.event.preventDefault()}},n.prototype.triggerEvents=function(e,t){var i=this,n={cancel:!1,event:t?t.event:null,groupIndex:e,requestType:"resourceChange"};this.parent.trigger(p,n,(function(e){e.cancel||(i.parent.uiStateValues.groupIndex=e.groupIndex,i.parent.renderModule.render(i.parent.currentView),n={cancel:!1,event:t?t.event:null,groupIndex:i.parent.uiStateValues.groupIndex,requestType:"resourceChanged"},i.parent.adaptiveGroupIndex=i.parent.uiStateValues.groupIndex,i.parent.trigger(c,n))}))},n.prototype.documentClick=function(t){if(!(0,e.closest)(t.event.target,"."+tr)){var i=this.parent.element.querySelector("."+tr);i&&i.classList.contains(tt)&&(this.treePopup.hide(),(0,e.removeClass)([this.popupOverlay],_e))}},n.prototype.bindResourcesData=function(e){var t=this;this.parent.showSpinner();for(var i=[],n=0,r=this.parent.resources;n<r.length;n++){var a=r[n],s=new Cr(this.parent,a.dataSource,a.query);i.push(s.getData(s.generateQuery()))}Promise.all(i).then((function(i){return t.dataManagerSuccess(i,e)})).catch((function(e){return t.parent.crudModule.dataManagerFailure(e)}))},n.prototype.dataManagerSuccess=function(e,t){if(!(!this.parent||this.parent&&this.parent.isDestroyed)){this.parent.resourceCollection=[];for(var i=0,n=e.length;i<n;i++){var r=this.parent.resources[parseInt(i.toString(),10)],a=this.getResourceModel(r,e[parseInt(i.toString(),10)].result);this.parent.resourceCollection.push(a)}this.refreshLayout(t)}},n.prototype.getResourceModel=function(e,t){return{field:e.field,title:e.title,name:e.name,allowMultiple:e.allowMultiple,dataSource:t||e.dataSource,idField:e.idField,textField:e.textField,groupIDField:e.groupIDField,colorField:e.colorField,startHourField:e.startHourField,endHourField:e.endHourField,workDaysField:e.workDaysField,expandedField:e.expandedField,cssClassField:e.cssClassField}},n.prototype.refreshLayout=function(t){!(0,e.isNullOrUndefined)(this.parent.uiStateValues.groupIndex)&&this.parent.enablePersistence||(this.parent.uiStateValues.groupIndex=0),this.parent.renderElements(t)},n.prototype.setResourceCollection=function(){var t=[];if(this.resourceCollection=[],this.colorIndex=null,this.parent.activeViewOptions.group.resources.length>0)for(var i=0,n=this.parent.activeViewOptions.group.resources;i<n.length;i++){var r=n[i],a=Ae(this.parent.resourceCollection,"name",r);a>=0&&t.push(this.parent.resourceCollection[parseInt(a.toString(),10)])}else this.parent.resourceCollection.length>0&&(t=this.parent.resourceCollection);for(var s=0,o=0,l=t;o<l.length;o++){r=l[o];var p=this.getResourceModel(r);r.name===this.parent.eventSettings.resourceColorField&&(this.colorIndex=s),s++,this.resourceCollection.push(p)}(0,e.isNullOrUndefined)(this.colorIndex)&&(this.colorIndex=this.resourceCollection.length-1)},n.prototype.generateResourceLevels=function(e,t){var i=this,n=this.resourceCollection,r=[],a=[],s=function(t,n,o,l,p){var c=[],h=t[0];if(h){var d=void 0;if(l&&i.parent.activeViewOptions.group.byGroupID){var u=l[o.idField];d=h.dataSource.filter((function(e){return e[h.groupIDField]===u}))}else d=h.dataSource;for(var g=0;g<d.length;g++){var v=[];p&&p.length>0&&(v=v.concat(p)),v.push(d[parseInt(g.toString(),10)][h.idField]);var m=s(t.slice(1),n+1,h,d[parseInt(g.toString(),10)],v);if(!(0===n&&0===m.length&&i.resourceCollection.length>1)){var f=[],y=i.parent.activeView.renderDates,T=void 0;if(!i.parent.activeViewOptions.group.byDate&&n+1===i.resourceCollection.length){var w=d[parseInt(g.toString(),10)][h.workDaysField],D=d[parseInt(g.toString(),10)][h.startHourField],b=d[parseInt(g.toString(),10)][h.endHourField];w&&w.length>0?(y=i.parent.activeView.getRenderDates(w),T=w,f=i.parent.activeView.getDateSlots(y,w)):(T=i.parent.activeViewOptions.workDays,f=e);var S=i.generateCustomHours(f,D,b,v);a=a.concat(S)}var C=d[parseInt(g.toString(),10)][h.cssClassField],O={type:"resourceHeader",className:["e-resource-cells"],resourceLevelIndex:n,groupOrder:v,resource:h,resourceData:d[parseInt(g.toString(),10)],colSpan:i.parent.activeViewOptions.group.byDate?1:f.length,renderDates:y,workDays:T,cssClass:C,child:m};c.push(O)}}return r[parseInt(n.toString(),10)]||(r[parseInt(n.toString(),10)]=[]),c.length>0&&r[parseInt(n.toString(),10)].push(c),c}return[]};return this.resourceTreeLevel=s(n,0),t?[]:this.generateHeaderLevels(r,a,e)},n.prototype.generateCustomHours=function(t,i,n,r){for(var a=(0,e.extend)([],t,null,!0),s=0,o=a;s<o.length;s++){var l=o[s];i&&(l.startHour=this.parent.getStartEndTime(i)),n&&(l.endHour=this.parent.getStartEndTime(n)),r&&(l.groupOrder=r)}return a},n.prototype.generateHeaderLevels=function(t,i,n){for(var r=[],a=t.length-1;a>=0;a--)for(var s=0,o=0,l=t[parseInt(a.toString(),10)];o<l.length;o++)for(var p=0,c=l[o];p<c.length;p++){var h=c[p];if(t[a+1]&&t[a+1].length>0){var d=t[parseInt((a+1).toString(),10)][parseInt(s.toString(),10)];if(!d)continue;for(var u=0,g=0,v=d;g<v.length;g++){var m=v[g];(!this.parent.activeViewOptions.group.byGroupID||this.parent.activeViewOptions.group.byGroupID&&m.resourceData[m.resource.groupIDField]===h.resourceData[h.resource.idField])&&(u+=m.colSpan)}h.colSpan=u}h.groupIndex=s,s++,r[h.resourceLevelIndex]=r[h.resourceLevelIndex]||[],r[h.resourceLevelIndex].push(h)}if(this.lastResourceLevel=r.slice(-1)[0]||[],!this.parent.activeViewOptions.group.byDate){for(var f=0,y=0,T=this.lastResourceLevel;y<T.length;y++){var w=T[y];for(a=0;a<w.colSpan;a++)i[parseInt(f.toString(),10)].groupIndex=w.groupIndex,f++}return r.push(i),r}var D=[],b=(0,e.extend)([],r,null,!0),S=[];if(this.parent.activeViewOptions.group.hideNonWorkingDays){for(var C=[],O=0,E=function(t){x.resourceDateTree[parseInt(O.toString(),10)]=[];for(var i=[],n=function(n){var r=x.lastResourceLevel[parseInt(n.toString(),10)].resourceData[x.lastResourceLevel[parseInt(n.toString(),10)].resource.workDaysField];if(r||(r=x.parent.activeViewOptions.workDays),-1!==r.indexOf(t.date.getDay())){var a=(0,e.extend)({},x.lastResourceLevel[parseInt(n.toString(),10)],null,!0);a.date=t.date,x.lastResourceLevel[parseInt(n.toString(),10)].workDays=r,a.startHour=x.parent.getStartEndTime(a.resourceData[a.resource.startHourField])||t.startHour,a.endHour=x.parent.getStartEndTime(a.resourceData[a.resource.endHourField])||t.endHour,x.resourceDateTree[parseInt(O.toString(),10)].push(a);for(var s=function(r){if(i[parseInt(r.toString(),10)]||(i[parseInt(r.toString(),10)]=[]),r===a.groupOrder.length-1){C[parseInt(n.toString(),10)]||(C[parseInt(n.toString(),10)]=[]);var s=a.renderDates.filter((function(e){return e.getDay()===t.date.getDay()}));return C[parseInt(n.toString(),10)]=C[parseInt(n.toString(),10)].concat(s),i[parseInt(r.toString(),10)].push(a),"continue"}var o=b[parseInt(r.toString(),10)].filter((function(e){return e.resourceData[e.resource.idField]===a.groupOrder[parseInt(r.toString(),10)]}));if(o&&o.length>0){var l=i[parseInt(r.toString(),10)].filter((function(e){return e.resourceData[e.resource.idField]===a.groupOrder[parseInt(r.toString(),10)]}));if(l&&l.length>0)l[0].colSpan+=1;else{var p=(0,e.extend)({},o[0],null,!0);p.colSpan=1,i[parseInt(r.toString(),10)].push(p)}}},o=0;o<a.groupOrder.length;o++)s(o)}},r=0;r<x.lastResourceLevel.length;r++)n(r);if(i.length>0){for(var a=0;a<b.length;a++)D[parseInt(a.toString(),10)]||(D[parseInt(a.toString(),10)]=[]),D[parseInt(a.toString(),10)]=D[parseInt(a.toString(),10)].concat(i[parseInt(a.toString(),10)]);t.colSpan=i[i.length-1].length,S.push(t)}O++},x=this,V=0,A=n;V<A.length;V++){E(P=A[V])}return this.resourceDateTree=this.resourceDateTree.filter((function(e){return e.length>0})),this.lastResourceLevel.forEach((function(e,t){C[parseInt(t.toString(),10)]&&(e.renderDates=C[parseInt(t.toString(),10)].sort((function(e,t){return e.getTime()-t.getTime()})))})),D.unshift(S),D}for(var I=0,M=0,k=b[0];M<k.length;M++){I+=k[M].colSpan}for(var R=0,H=n;R<H.length;R++){var P;(P=H[R]).colSpan=I,S.push(P);for(var j=(0,e.extend)([],b,null,!0),N=0,L=j.length;N<L;N++){if(N===j.length-1)for(var q=0,F=j[parseInt(N.toString(),10)];q<F.length;q++){var U=F[q];U.date=P.date,U.workDays=P.workDays,U.startHour=this.parent.getStartEndTime(U.resourceData[U.resource.startHourField])||P.startHour,U.endHour=this.parent.getStartEndTime(U.resourceData[U.resource.endHourField])||P.endHour}D[parseInt(N.toString(),10)]||(D[parseInt(N.toString(),10)]=[]),D[parseInt(N.toString(),10)]=D[parseInt(N.toString(),10)].concat(j[parseInt(N.toString(),10)])}}return D.unshift(S),D},n.prototype.setResourceValues=function(t,i){var n=this,r=function(e,i,r){n.resourceCollection[parseInt(e.toString(),10)].allowMultiple&&n.parent.activeViewOptions.group.allowGroupEdit?t[""+i]=[r]:t[""+i]=r};if(void 0===i&&(i=this.parent.uiStateValues.isGroupAdaptive?this.parent.uiStateValues.groupIndex:this.parent.activeCellsData.groupIndex),this.parent.activeViewOptions.group.resources.length>0&&!(0,e.isNullOrUndefined)(i))for(var a=this.lastResourceLevel[parseInt(i.toString(),10)].groupOrder,s=0;s<this.resourceCollection.length;s++)r(s,this.resourceCollection[parseInt(s.toString(),10)].field,a[parseInt(s.toString(),10)]);else if(this.parent.resourceCollection.length>0)for(s=0;s<this.resourceCollection.length;s++){var o=this.resourceCollection[parseInt(s.toString(),10)].dataSource[0];o&&r(s,this.resourceCollection[parseInt(s.toString(),10)].field,o[this.resourceCollection[parseInt(s.toString(),10)].idField])}},n.prototype.getResourceColor=function(t,i){var n=!(0,e.isNullOrUndefined)(i)&&this.colorIndex>i.length-1?i.length-1:this.colorIndex,r=this.resourceCollection[parseInt(n.toString(),10)];if(!((0,e.isNullOrUndefined)(i)&&this.parent.activeViewOptions.group.allowGroupEdit&&r.allowMultiple)){var a=(0,e.isNullOrUndefined)(i)?t[r.field]:i[parseInt(n.toString(),10)],s=this.filterData(r.dataSource,r.idField,a);return s.length>0?s[0][r.colorField]:void 0}},n.prototype.getCssClass=function(e){var t=this.resourceCollection.slice(-1)[0];if(!this.parent.activeViewOptions.group.allowGroupEdit||!t.allowMultiple){var i=this.filterData(t.dataSource,t.idField,e[t.field]);return i.length>0?i[0][t.cssClassField]:void 0}},n.prototype.getResourceRenderDates=function(){var e=[].concat.apply([],this.lastResourceLevel.map((function(e){return e.renderDates}))),t=e.map((function(e){return e.getTime()})),i=e.filter((function(e,i){return t.indexOf(e.getTime())===i}));return i.sort((function(e,t){return e.getTime()-t.getTime()})),i},n.prototype.filterData=function(e,t,i){return e.filter((function(e){return e[""+t]===i}))},n.prototype.getResourceData=function(t,i,n){if(this.parent.activeViewOptions.group.allowGroupEdit){for(var r={},a=0,s=n;a<s.length;a++)for(var o=s[a],l=this.lastResourceLevel[parseInt(o.toString(),10)].groupOrder,p=0,c=l.length;p<c;p++){var h=this.resourceCollection[parseInt(p.toString(),10)].field;(0,e.isNullOrUndefined)(r[""+h])&&(r[""+h]=[]),r[""+h].push(l[parseInt(p.toString(),10)])}t=(0,e.extend)(t,r)}else{p=0;for(var d=this.resourceCollection.length;p<d;p++)this.lastResourceLevel[parseInt(i.toString(),10)]&&(t[this.resourceCollection[parseInt(p.toString(),10)].field]=this.lastResourceLevel[parseInt(i.toString(),10)].groupOrder[parseInt(p.toString(),10)])}},n.prototype.addResource=function(e,t,i){for(var n=e instanceof Array?e:[e],r=function(e){if(e.name===t)return n.forEach((function(t,n){return new Sr.DataManager({json:e.dataSource}).insert(t,null,null,i+n)})),"break"},a=0,s=this.parent.resourceCollection;a<s.length;a++){if("break"===r(s[a]))break}this.refreshLayout(!0)},n.prototype.removeResource=function(e,t){for(var i=e instanceof Array?e:[e],n=function(e){if(e.name===t)return i.forEach((function(t){return new Sr.DataManager({json:e.dataSource}).remove(e.idField,t)})),"break"},r=0,a=this.parent.resourceCollection;r<a.length;r++){if("break"===n(a[r]))break}this.refreshLayout(!0)},n.prototype.getIndexFromResourceId=function(t,i,n,r,a){if(i=i||this.parent.resourceCollection.slice(-1)[0].name,(0,e.isNullOrUndefined)(n)&&(n=this.resourceCollection.filter((function(e){return e.name===i}))[0],(0,e.isNullOrUndefined)(n)))return null;var s=n.dataSource.filter((function(e){return r&&e[n.idField]===t?e[n.groupIDField]===r[""+a]?e[n.idField]===t:null:e[n.idField]===t}))[0];return this.lastResourceLevel.map((function(e){return e.resourceData})).indexOf(s)},n.prototype.resourceExpand=function(e,t,i){var n=this.parent.resourceCollection.filter((function(e){return e.name===t?e:null}))[0],r=0,a=n.dataSource.filter((function(t){return t[n.idField]===e}))[0];r=this.parent.activeViewOptions.group.byGroupID?this.lastResourceLevel.map((function(e){return e.resourceData})).indexOf(a):this.getIndexFromResourceId(e,t,n);var s=this.parent.element.querySelector("."+yt+' [data-group-index="'+r+'"] .'+Ct);s&&(s.classList.contains(bt)&&!i||s.classList.contains(St)&&i)&&s.click()},n.prototype.resourceScroll=function(e,t){if(!(this.parent.isAdaptive||["Agenda","MonthAgenda"].indexOf(this.parent.currentView)>-1)){var i=t||this.parent.resourceCollection.slice(-1)[0].name,n=this.parent.resourceCollection.length-1,r=this.parent.resourceCollection.filter((function(e,t){return e.name===i?(n=t,e):null}))[0],a=this.parent.element.querySelector("."+ri),s=0;if(this.parent.activeView.isTimelineView()){if(this.parent.activeViewOptions.group.byGroupID){var o=r.dataSource.filter((function(t){return t[r.idField]===e}))[0];s=this.lastResourceLevel.map((function(e){return e.resourceData})).indexOf(o)}else s=this.getIndexFromResourceId(e,i,r);if(this.parent.virtualScrollModule){var l=this.parent.element.querySelector("."+ai),p=Math.round(l.offsetHeight/this.expandedResources.length);if(this.parent.rowAutoHeight&&(a.scrollTop=0,this.parent.virtualScrollModule.virtualScrolling()),a.scrollTop=s*p-(this.parent.virtualScrollModule.bufferCount-1)*p,this.parent.virtualScrollModule.virtualScrolling(),this.parent.rowAutoHeight)(c=this.parent.element.querySelector("."+$e+'[data-group-index="'+s+'"]'))&&!c.parentElement.classList.contains(Xn)&&(a.scrollTop=a.scrollTop<c.offsetTop?c.offsetTop:a.scrollTop+c.offsetTop);else a.scrollTop=s*p}else{var c;(c=this.parent.element.querySelector("."+$e+'[data-group-index="'+s+'"]'))&&!c.parentElement.classList.contains(Xn)&&(a.scrollTop=c.offsetTop)}}else{s=this.parent.activeViewOptions.group.byGroupID?i===this.parent.resourceCollection.slice(-1)[0].name?this.lastResourceLevel.map((function(e){return e.resourceData[r.idField]})).indexOf(e):r.dataSource.map((function(e){return e[r.idField]})).indexOf(e):this.getIndexFromResourceId(e,i,r);var h="Month"===this.parent.currentView?this.parent.element.querySelector("."+it+" tbody tr:nth-child("+(n+1)+")"):this.parent.element.querySelector("."+Hi+":nth-child("+(n+1)+")"),d=[].slice.call(h.children).map((function(e){return e.offsetLeft}));a.scrollLeft=d[parseInt(s.toString(),10)]}}},n.prototype.destroy=function(){if(this.parent.off(Z,this.documentClick),this.treeViewObj){if(this.treeViewObj.portals&&this.treeViewObj.portals.length>0){var t=this.treeViewObj.portals.map((function(e){return e.propName}));t.length>0&&this.parent.resetTemplates(t)}this.treeViewObj.destroy(),this.treeViewObj=null}this.treePopup&&(this.treePopup.destroy(),this.treePopup=null,(0,e.remove)(this.parent.element.querySelector("."+tr)),(0,e.remove)(this.parent.element.querySelector("."+er)));var i=this.parent.element.querySelector("."+qt);i&&(0,e.remove)(i)},n}(),Fo=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Uo=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},Bo=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return Fo(i,t),Uo([(0,e.Property)("")],i.prototype,"id",void 0),Uo([(0,e.Property)("")],i.prototype,"text",void 0),Uo([(0,e.Property)("auto")],i.prototype,"width",void 0),Uo([(0,e.Property)("")],i.prototype,"cssClass",void 0),Uo([(0,e.Property)(!1)],i.prototype,"showAlwaysInPopup",void 0),Uo([(0,e.Property)(!1)],i.prototype,"disabled",void 0),Uo([(0,e.Property)("")],i.prototype,"prefixIcon",void 0),Uo([(0,e.Property)("")],i.prototype,"suffixIcon",void 0),Uo([(0,e.Property)(!0)],i.prototype,"visible",void 0),Uo([(0,e.Property)("None")],i.prototype,"overflow",void 0),Uo([(0,e.Property)("")],i.prototype,"template",void 0),Uo([(0,e.Property)("Button")],i.prototype,"type",void 0),Uo([(0,e.Property)("Both")],i.prototype,"showTextOn",void 0),Uo([(0,e.Property)(null)],i.prototype,"htmlAttributes",void 0),Uo([(0,e.Property)("")],i.prototype,"tooltipText",void 0),Uo([(0,e.Property)("Left")],i.prototype,"align",void 0),Uo([(0,e.Property)(-1)],i.prototype,"tabIndex",void 0),Uo([(0,e.Property)("Custom")],i.prototype,"name",void 0),Uo([(0,e.Event)()],i.prototype,"click",void 0),i}(e.ChildProperty),Wo=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),zo=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},Yo=function(i){function n(e,t){var n=i.call(this,e,t)||this;return n.adaptiveGroupIndex=0,n}return Wo(n,i),n.prototype.render=function(){var i=[],n=[];if(i.push(Fe),this.enableRtl?i.push(Ue):n.push(Ue),this.isAdaptive?i.push(Be):n.push(Be),this.enableAdaptiveUI?i.push(We):n.push(We),this.allowMultiDrag?i.push(ze):n.push(ze),this.cssClass)for(var r=0,a=this.cssClass.split(" ");r<a.length;r++){var s=a[r];i.push(s)}(0,e.classList)(this.element,i,n),this.validateDate(),(0,t.createSpinner)({target:this.element}),this.scrollModule=new Tr(this),this.scrollModule.setWidth(),this.scrollModule.setHeight(),this.renderModule=new lo(this),this.eventBase=new Aa(this),this.workCellAction=new So(this),this.allowKeyboardInteraction&&(this.keyboardInteractionModule=new br(this)),this.inlineModule=new ja(this),this.initializeDataModule(),this.renderTableContainer(),this.activeViewOptions=this.getActiveViewOptions(),this.initializeResources(),this.wireEvents()},n.prototype.renderTableContainer=function(){this.element.querySelector("."+Xe)||this.element.appendChild(this.createElement("div",{className:Xe}))},n.prototype.getEventTemplateName=function(e){var t="eventTemplate_"+e;return this.activeEventTemplates.indexOf(t)<0&&this.activeEventTemplates.push(t),t},n.prototype.getElementWidth=function(e){return Ne(e,this.uiStateValues.isTransformed)},n.prototype.getElementHeight=function(e){return Le(e,this.uiStateValues.isTransformed)},n.prototype.getElementHeightFromClass=function(e,t){return re(e,t,this.uiStateValues.isTransformed)},n.prototype.renderTemplates=function(e){this.isReact?this.renderReactTemplates(e):e&&e()},n.prototype.resetTemplates=function(e){(this.isAngular||this.isReact)&&this.clearTemplate(e)},n.prototype.sanitize=function(t,i){this.enableHtmlSanitizer?i.innerText=e.SanitizeHtmlHelper.sanitize(t):i.innerHTML=t},n.prototype.initializeResources=function(e){void 0===e&&(e=!1),this.resources.length>0?(this.resourceBase=new qo(this),this.resourceBase.bindResourcesData(e)):(this.resourceBase=null,this.resourceCollection=[],this.renderElements(e))},n.prototype.destroyEditorWindow=function(){this.eventWindow&&(this.eventWindow.destroy(),this.eventWindow=null),this.eventWindow=new so(this)},n.prototype.renderElements=function(t){if(t)return this.initializeView(this.currentView),void this.eventWindow.refresh();this.destroyHeaderModule(),this.showHeaderBar&&(this.headerModule=new yr(this)),this.renderTableContainer(),this.uiStateValues.isTransformed=Math.round(this.element.getBoundingClientRect().width)!==this.element.offsetWidth,(e.Browser.isDevice||e.Browser.isTouch)&&(this.scheduleTouchModule=new wr(this)),this.initializeView(this.currentView),this.destroyPopups(),this.isPrinting||this.initializePopups()},n.prototype.validateDate=function(t){void 0===t&&(t=this.selectedDate);var i=t instanceof Date?new Date(t.getTime()):new Date(t),n=(0,e.isNullOrUndefined)(this.minDate)?new Date(1900,0,1):this.minDate instanceof Date?new Date(this.minDate.getTime()):new Date(this.minDate),r=(0,e.isNullOrUndefined)(this.maxDate)?new Date(2099,11,31):this.maxDate instanceof Date?new Date(this.maxDate.getTime()):new Date(this.maxDate);if(!(n<=r))throw Error("minDate should be equal or less than maxDate");i<n&&(i=n),i>r&&(i=r),this.setProperties({selectedDate:new Date(""+i),minDate:new Date(""+n),maxDate:new Date(""+r)},!0),this.eventWindow&&this.eventWindow.updateMinMaxDateToEditor()},n.prototype.getViewIndex=function(e){for(var t=0;t<this.viewCollections.length;t++){if(this.viewCollections[parseInt(t.toString(),10)].option===e)return t}return-1},n.prototype.setViewOptions=function(t){if(void 0===t&&(t=!1),!(0,e.isNullOrUndefined)(this.views)&&0!==this.views.length){var i,n;this.viewOptions={},this.viewCollections=[];var r=this.viewIndex,a=0;this.viewIndex=-1;for(var s=0,o=this.views;s<o.length;s++){var l=o[s],p="string"!=typeof l;"string"==typeof l?(i=l,this.currentView===i&&(n=i,this.viewIndex=a)):(i=l.option,l.isSelected&&(n=i,this.viewIndex=a));var c=(0,e.extend)({option:i},p?l:{}),h=i.charAt(0).toLowerCase()+i.slice(1);c.cellHeaderTemplateName=c.cellHeaderTemplate?c.option:"",c.dateHeaderTemplateName=c.dateHeaderTemplate?c.option:"",c.dateRangeTemplateName=c.dateRangeTemplate?c.option:"",c.cellTemplateName=c.cellTemplate?c.option:"",c.dayHeaderTemplateName=c.dayHeaderTemplate?c.option:"",c.monthHeaderTemplateName=c.monthHeaderTemplate?c.option:"",c.resourceHeaderTemplateName=c.resourceHeaderTemplate?c.option:"",c.headerIndentTemplateName=c.headerIndentTemplate?c.option:"",c.eventTemplateName=c.eventTemplate?c.option:"",(0,e.isNullOrUndefined)(c.firstDayOfWeek)||0!==c.firstDayOfWeek||delete c.firstDayOfWeek,(0,e.isNullOrUndefined)(c.interval)||1!==c.interval||delete c.interval,this.viewCollections.push(c),(0,e.isNullOrUndefined)(this.viewOptions[""+h])?this.viewOptions[""+h]=[c]:this.viewOptions[""+h].push(c),a++}if(!t&&n&&this.setProperties({currentView:n},!0),-1===this.viewIndex){var d=this.getViewIndex(this.currentView);this.viewIndex="string"==typeof this.views[0]||(0,e.isNullOrUndefined)(r)||-1===r?-1===d?0:d:r}}},n.prototype.getActiveViewOptions=function(){var t={enable:this.timeScale.enable,interval:this.timeScale.interval,slotCount:this.timeScale.slotCount,majorSlotTemplate:this.timeScale.majorSlotTemplate,minorSlotTemplate:this.timeScale.minorSlotTemplate},i={byDate:!(this.viewCollections[this.viewIndex].option.indexOf("Year")>-1)&&this.group.byDate,byGroupID:this.group.byGroupID,allowGroupEdit:this.group.allowGroupEdit,resources:(0,e.isNullOrUndefined)(this.group.resources)?[]:this.group.resources,headerTooltipTemplate:this.group.headerTooltipTemplate,enableCompactView:this.group.enableCompactView,hideNonWorkingDays:["Day","Week","WorkWeek","Month"].indexOf(this.currentView)>-1&&this.group.hideNonWorkingDays},n=this.viewCollections[this.viewIndex].workDays?[]:this.workDays,r={dateFormat:this.dateFormat,endHour:this.endHour,isSelected:!1,option:null,readonly:this.readonly,startHour:this.startHour,allowVirtualScrolling:!1,allowOverlap:this.allowOverlap,overscanCount:this.overscanCount,cellHeaderTemplate:this.cellHeaderTemplate,dayHeaderTemplate:this.dayHeaderTemplate,monthHeaderTemplate:this.monthHeaderTemplate,cellTemplate:this.cellTemplate,eventTemplate:this.eventSettings.template,dateHeaderTemplate:this.dateHeaderTemplate,dateRangeTemplate:this.dateRangeTemplate,resourceHeaderTemplate:this.resourceHeaderTemplate,headerIndentTemplate:this.headerIndentTemplate,firstMonthOfYear:this.firstMonthOfYear,firstDayOfWeek:this.firstDayOfWeek,workDays:n,monthsCount:this.monthsCount,showWeekend:this.showWeekend,showWeekNumber:this.showWeekNumber,displayName:null,interval:1,timeScale:t,timeFormat:this.internalTimeFormat,group:i,headerRows:this.headerRows,orientation:"Horizontal",numberOfWeeks:0,displayDate:null,enableLazyLoading:!1},a=this.viewCollections[this.viewIndex],s=(0,e.extend)(r,a,void 0,!0);return 0!==this.firstDayOfWeek&&a.firstDayOfWeek&&this.firstDayOfWeek!==a.firstDayOfWeek&&(s.firstDayOfWeek=this.firstDayOfWeek),s.displayDate&&(s.displayDate=s.displayDate instanceof Date?new Date(s.displayDate.getTime()):new Date(s.displayDate)),s.enableLazyLoading&&!(0,e.isNullOrUndefined)(s.group.resources)&&s.group.resources.length>0&&(-1===["Agenda","MonthAgenda","Year","TimelineYear"].indexOf(s.option)||"TimelineYear"===s.option&&"Vertical"===s.orientation)&&(s.allowVirtualScrolling=!0),s},n.prototype.initializeDataModule=function(){this.eventFields={id:this.eventSettings.fields.id,isBlock:this.eventSettings.fields.isBlock,subject:this.eventSettings.fields.subject.name,startTime:this.eventSettings.fields.startTime.name,endTime:this.eventSettings.fields.endTime.name,startTimezone:this.eventSettings.fields.startTimezone.name,endTimezone:this.eventSettings.fields.endTimezone.name,location:this.eventSettings.fields.location.name,description:this.eventSettings.fields.description.name,isAllDay:this.eventSettings.fields.isAllDay.name,recurrenceID:this.eventSettings.fields.recurrenceID.name,recurrenceRule:this.eventSettings.fields.recurrenceRule.name,recurrenceException:this.eventSettings.fields.recurrenceException.name,isReadonly:this.eventSettings.fields.isReadonly,followingID:this.eventSettings.fields.followingID},this.setEditorTitles(),this.dataModule=new Cr(this,this.eventSettings.dataSource,this.eventSettings.query),this.crudModule=new bo(this)},n.prototype.setEditorTitles=function(){this.editorTitles={subject:this.eventSettings.fields.subject.title||this.localeObj.getConstant("title"),startTime:this.eventSettings.fields.startTime.title||this.localeObj.getConstant("start"),endTime:this.eventSettings.fields.endTime.title||this.localeObj.getConstant("end"),isAllDay:this.eventSettings.fields.isAllDay.title||this.localeObj.getConstant("allDay"),startTimezone:this.eventSettings.fields.startTimezone.title||this.localeObj.getConstant("startTimezone"),endTimezone:this.eventSettings.fields.endTimezone.title||this.localeObj.getConstant("endTimezone"),location:this.eventSettings.fields.location.title||this.localeObj.getConstant("location"),description:this.eventSettings.fields.description.title||this.localeObj.getConstant("description"),recurrenceRule:this.eventSettings.fields.recurrenceRule.title||this.localeObj.getConstant("repeat")}},n.prototype.initializeView=function(e){this.showSpinner(),this.activeViewOptions=this.getActiveViewOptions(),this.resourceBase&&this.resourceBase.setResourceCollection(),this.initializeTemplates(),this.renderModule.render(e)},n.prototype.initializeTemplates=function(){this.cellHeaderTemplateFn=this.templateParser(this.activeViewOptions.cellHeaderTemplate),this.dayHeaderTemplateFn=this.templateParser(this.activeViewOptions.dayHeaderTemplate),this.monthHeaderTemplateFn=this.templateParser(this.activeViewOptions.monthHeaderTemplate),this.cellTemplateFn=this.templateParser(this.activeViewOptions.cellTemplate),this.dateHeaderTemplateFn=this.templateParser(this.activeViewOptions.dateHeaderTemplate),this.dateRangeTemplateFn=this.templateParser(this.activeViewOptions.dateRangeTemplate),this.majorSlotTemplateFn=this.templateParser(this.activeViewOptions.timeScale.majorSlotTemplate),this.minorSlotTemplateFn=this.templateParser(this.activeViewOptions.timeScale.minorSlotTemplate),this.appointmentTemplateFn=this.templateParser(this.activeViewOptions.eventTemplate),this.resourceHeaderTemplateFn=this.templateParser(this.activeViewOptions.resourceHeaderTemplate),this.headerIndentTemplateFn=this.templateParser(this.activeViewOptions.headerIndentTemplate),this.headerTooltipTemplateFn=this.templateParser(this.activeViewOptions.group.headerTooltipTemplate),this.eventTooltipTemplateFn=this.templateParser(this.eventSettings.tooltipTemplate),this.editorTemplateFn=this.templateParser(this.editorTemplate),this.editorHeaderTemplateFn=this.templateParser(this.editorHeaderTemplate),this.editorFooterTemplateFn=this.templateParser(this.editorFooterTemplate),this.quickInfoTemplatesHeaderFn=this.templateParser(this.quickInfoTemplates.header),this.quickInfoTemplatesContentFn=this.templateParser(this.quickInfoTemplates.content),this.quickInfoTemplatesFooterFn=this.templateParser(this.quickInfoTemplates.footer)},n.prototype.initializePopups=function(){this.eventWindow=new so(this),this.quickPopup=new Fa(this)},n.prototype.getDayNames=function(t){var i,n=[],r="";(0,e.isNullOrUndefined)(this.locale)||"en"===this.locale||"en-US"===this.locale?(r="days.stand-alone.",i=(0,e.getValue)(r+t,(0,e.getDefaultDateObject)(this.getCalendarMode()))):(r="main."+this.locale+".dates.calendars."+this.getCalendarMode()+".days.format."+t,i=(0,e.getValue)(r,e.cldrData));for(var a=0,s=Object.keys(i);a<s.length;a++){var o=s[a];n.push((0,e.getValue)(o,i))}return n},n.prototype.setCldrTimeFormat=function(){(0,e.isNullOrUndefined)(this.timeFormat)?(0,e.isNullOrUndefined)(this.locale)||"en"===this.locale||"en-US"===this.locale?this.internalTimeFormat=(0,e.getValue)("timeFormats.short",(0,e.getDefaultDateObject)(this.getCalendarMode())):this.internalTimeFormat=(0,e.getValue)("main."+this.locale+".dates.calendars."+this.getCalendarMode()+".timeFormats.short",e.cldrData):this.internalTimeFormat=this.timeFormat},n.prototype.getCalendarMode=function(){return(0,e.isNullOrUndefined)(this.calendarMode)?"gregorian":this.calendarMode.toLowerCase()},n.prototype.getTimeString=function(e){return this.globalize.formatDate(e,{format:this.activeViewOptions.timeFormat,type:"time",calendar:this.getCalendarMode()}).toLocaleUpperCase()},n.prototype.getDateTime=function(e){return e instanceof Date?new Date(e.getTime()):new Date(e)},n.prototype.setCalendarMode=function(){"Islamic"===this.calendarMode?this.calendarUtil=new Er:this.calendarUtil=new Or},n.prototype.changeView=function(t,i,n,r){var a=this;if((0,e.isNullOrUndefined)(r)&&(r=this.getViewIndex(t)),!(!n&&r===this.viewIndex&&this.currentView===t||r<0)){var s=this.activeViewOptions?this.activeViewOptions.option:this.currentView,o={requestType:"viewNavigate",cancel:!1,event:i};this.trigger(p,o,(function(e){if(e.cancel)a.currentView=s;else{var n={action:"view",cancel:!1,currentDate:a.selectedDate,previousView:s,currentView:t,viewIndex:r};a.trigger(g,n,(function(e){if(e.cancel)a.currentView=s;else{var n=["Day","Week","WorkWeek"].indexOf(t)>-1&&["Day","Week","WorkWeek"].indexOf(s)<0;a.uiStateValues.isInitial=n||t.indexOf("Timeline")>-1||t.indexOf("Year")>-1,a.uiStateValues.top=t.indexOf("Timeline")>-1&&s.indexOf("Timeline")<0?0:a.uiStateValues.top,a.viewIndex=e.viewIndex,a.setProperties({currentView:t},!0),a.headerModule&&(a.headerModule.updateActiveView(),a.headerModule.setCalendarDate(a.selectedDate),a.headerModule.setCalendarView()),a.initializeView(a.currentView),a.animateLayout(),o={requestType:"viewNavigate",cancel:!1,event:i},a.trigger(c,o)}}))}}))}},n.prototype.changeDate=function(e,t){var i=this,n={requestType:"dateNavigate",cancel:!1,event:t};this.trigger(p,n,(function(r){if(!r.cancel){var a={action:"date",cancel:!1,previousDate:i.selectedDate,currentDate:e};i.trigger(g,a,(function(e){e.cancel||(i.uiStateValues.isInitial=i.activeView.isTimelineView()&&"TimelineYear"!==i.currentView,i.validateDate(e.currentDate),i.headerModule&&i.headerModule.setCalendarDate(e.currentDate),"MonthAgenda"===i.currentView&&i.monthAgendaModule&&(i.monthAgendaModule.monthAgendaDate=new Date(""+i.selectedDate)),i.initializeView(i.currentView),i.animateLayout(),n={requestType:"dateNavigate",cancel:!1,event:t},i.trigger(c,n))}))}}))},n.prototype.isMinMaxDate=function(t){void 0===t&&(t=this.selectedDate);var i=(0,e.isNullOrUndefined)(this.maxDate)?new Date(2099,11,31):this.maxDate,n=(0,e.isNullOrUndefined)(this.minDate)?new Date(1900,0,1):this.minDate;return t.getTime()>=n.getTime()&&t.getTime()<=i.getTime()},n.prototype.isSelectedDate=function(e){return e.setHours(0,0,0,0)===new Date(""+this.selectedDate).setHours(0,0,0,0)},n.prototype.getCurrentTime=function(e){return void 0===e&&(e=new Date),this.timezone?this.tzModule.convert(e,this.tzModule.getLocalTimezoneName(),this.timezone):e},n.prototype.getNavigateView=function(){return this.activeView.isTimelineView()?"TimelineMonth"===this.currentView||"TimelineYear"===this.currentView?"TimelineDay":"Agenda":"Day"},n.prototype.animateLayout=function(){this.activeView.element&&new e.Animation({duration:600,name:"FadeIn",timingFunction:"easeIn"}).animate(this.activeView.element)},n.prototype.requiredModules=function(){var e=[];this.setViewOptions(!0);for(var t=0,i=Object.keys(this.viewOptions);t<i.length;t++){var n=i[t];n="timelineDay"===n||"timelineWeek"===n||"timelineWorkWeek"===n?"timelineViews":n,e.push({member:n,args:[this]})}return this.allowDragAndDrop&&e.push({member:"dragAndDrop",args:[this]}),this.allowResizing&&e.push({member:"resize",args:[this]}),e.push({member:"excelExport",args:[this]}),e.push({member:"iCalendarExport",args:[this]}),e.push({member:"iCalendarImport",args:[this]}),e.push({member:"print",args:[this]}),e},n.prototype.preRender=function(){this.isAdaptive=e.Browser.isDevice||Pe(),this.globalize=new e.Internationalization(this.locale),this.tzModule=new xr,(this&&(0,e.isNullOrUndefined)(this.uiStateValues)||!this.enablePersistence)&&(this.uiStateValues={expand:!1,isInitial:!0,left:0,top:0,isGroupAdaptive:!1,isIgnoreOccurrence:!1,groupIndex:this.adaptiveGroupIndex,action:!1,isBlock:!1,isCustomMonth:!0,isPreventTimezone:!1,isTransformed:!1}),this.currentTimezoneDate=this.getCurrentTime(),this.activeCellsData={startTime:new Date(this.currentTimezoneDate),endTime:new Date(this.currentTimezoneDate),isAllDay:!1},this.activeEventData={event:void 0,element:void 0},this.getDefaultLocale(),this.localeObj=new e.L10n(this.getModuleName(),this.defaultLocale,this.locale),this.setCldrTimeFormat(),this.setCalendarMode(),this.eventsData=[],this.eventsProcessed=[],this.blockData=[],this.blockProcessed=[],this.resourceCollection=[],this.currentAction=null,this.selectedElements=[],this.activeEventTemplates=[],this.setViewOptions()},n.prototype.getDefaultLocale=function(){this.defaultLocale={day:"Day",week:"Week",workWeek:"Work Week",month:"Month",year:"Year",agenda:"Agenda",weekAgenda:"Week Agenda",workWeekAgenda:"Work Week Agenda",monthAgenda:"Month Agenda",today:"Today",noEvents:"No events",emptyContainer:"There are no events scheduled on this day.",allDay:"All day",start:"Start",end:"End",more:"more",close:"Close",cancel:"Cancel",noTitle:"(No Title)",delete:"Delete",deleteEvent:"Delete Event",deleteMultipleEvent:"Delete Multiple Events",selectedItems:"Items selected",deleteSeries:"Entire Series",edit:"Edit",editSeries:"Entire Series",editEvent:"Edit Event",createEvent:"Create",subject:"Subject",addTitle:"Add title",moreDetails:"More Details",moreEvents:"More Events",save:"Save",editContent:"How would you like to change the appointment in the series?",deleteContent:"Are you sure you want to delete this event?",deleteMultipleContent:"Are you sure you want to delete the selected events?",newEvent:"New Event",title:"Title",location:"Location",description:"Description",timezone:"Timezone",startTimezone:"Start Timezone",endTimezone:"End Timezone",repeat:"Repeat",saveButton:"Save",cancelButton:"Cancel",deleteButton:"Delete",recurrence:"Recurrence",wrongPattern:"The recurrence pattern is not valid.",seriesChangeAlert:"Do you want to cancel the changes made to specific instances of this series and match it to the whole series again?",createError:"The duration of the event must be shorter than how frequently it occurs. Shorten the duration, or change the recurrence pattern in the recurrence event editor.",sameDayAlert:"Two occurrences of the same event cannot occur on the same day.",occurenceAlert:"Cannot reschedule an occurrence of the recurring appointment if it skips over a later occurrence of the same appointment.",editRecurrence:"Edit Recurrence",recurringEvent:"Recurring Event",repeats:"Repeats",alert:"Alert",startEndError:"The selected end date occurs before the start date.",invalidDateError:"The entered date value is invalid.",blockAlert:"Events cannot be scheduled within the blocked time range.",overlapAlert:"Events cannot be scheduled during the chosen time as it overlaps with another event.",ok:"Ok",yes:"Yes",no:"No",of:"of",occurrence:"Occurrence",series:"Series",previous:"Previous",next:"Next",timelineDay:"Timeline Day",timelineWeek:"Timeline Week",timelineWorkWeek:"Timeline Work Week",timelineMonth:"Timeline Month",timelineYear:"Timeline Year",editFollowingEvent:"Following Events",deleteTitle:"Delete Event",editTitle:"Edit Event",beginFrom:"Begin From",endAt:"Ends At",expandAllDaySection:"Expand-all-day-section",collapseAllDaySection:"Collapse-all-day-section",searchTimezone:"Search Timezone",noRecords:"No records found"}},n.prototype.wireEvents=function(){e.EventHandler.add(window,"resize",this.onScheduleResize,this),e.EventHandler.add(window,"orientationchange",this.onScheduleResize,this),e.EventHandler.add(document,e.Browser.touchStartEvent,this.onDocumentClick,this),this.allowClipboard&&e.EventHandler.add(document,"paste",this.onDocumentPaste,this)},n.prototype.removeSelectedClass=function(){for(var t=this.getSelectedCells(),i=0,n=t;i<n.length;i++){n[i].removeAttribute("tabindex")}(0,e.removeClass)(t,Bt),this.keyboardInteractionModule&&this.keyboardInteractionModule.selectedCells.length>0&&(this.keyboardInteractionModule.selectedCells=[])},n.prototype.addSelectedClass=function(t,i,n){(0,e.addClass)(t,Bt),i&&(i.setAttribute("tabindex","0"),i.focus({preventScroll:n||!1}))},n.prototype.selectCell=function(e){this.removeSelectedClass(),this.addSelectedClass([e],e)},n.prototype.getAllDayRow=function(){return this.element.querySelector("."+Ze)},n.prototype.getContentTable=function(){return this.activeView.element.querySelector("."+Je+" tbody")},n.prototype.getTableRows=function(){return[].slice.call(this.element.querySelectorAll("."+Je+" tbody tr:not(."+Xn+")"))},n.prototype.getWorkCellElements=function(){return[].slice.call(this.element.querySelectorAll("."+$e))},n.prototype.getIndexOfDate=function(e,t){return e.map(Number).indexOf(+t)},n.prototype.isAllDayCell=function(e){return!(!(["Month","TimelineMonth","TimelineYear","MonthAgenda"].indexOf(this.currentView)>-1||e.classList.contains(Ke)||e.classList.contains(rt))&&this.activeViewOptions.timeScale.enable)||!!(this.activeView.isTimelineView()&&this.activeViewOptions.headerRows.length>0&&"Hour"!==this.activeViewOptions.headerRows.slice(-1)[0].option)},n.prototype.getDateFromElement=function(t){var i;if((0,e.isNullOrUndefined)(t)||(i=t.getAttribute("data-date")),!(0,e.isNullOrUndefined)(i)){var n=parseInt(i,10);return new Date(n)}},n.prototype.getTargetElement=function(e,t,i){var n,r=document.elementFromPoint(t,i);return r&&(n=r.closest(e)),n?[n]:null},n.prototype.getCellHeaderTemplate=function(){return this.cellHeaderTemplateFn},n.prototype.getDayHeaderTemplate=function(){return this.dayHeaderTemplateFn},n.prototype.getMonthHeaderTemplate=function(){return this.monthHeaderTemplateFn},n.prototype.getCellTemplate=function(){return this.cellTemplateFn},n.prototype.getDateHeaderTemplate=function(){return this.dateHeaderTemplateFn},n.prototype.getDateRangeTemplate=function(){return this.dateRangeTemplateFn},n.prototype.getMajorSlotTemplate=function(){return this.majorSlotTemplateFn},n.prototype.getMinorSlotTemplate=function(){return this.minorSlotTemplateFn},n.prototype.getAppointmentTemplate=function(){return this.appointmentTemplateFn},n.prototype.getEventTooltipTemplate=function(){return this.eventTooltipTemplateFn},n.prototype.getHeaderTooltipTemplate=function(){return this.headerTooltipTemplateFn},n.prototype.getEditorTemplate=function(){return this.editorTemplateFn},n.prototype.getEditorHeaderTemplate=function(){return this.editorHeaderTemplateFn},n.prototype.getEditorFooterTemplate=function(){return this.editorFooterTemplateFn},n.prototype.getQuickInfoTemplatesHeader=function(){return this.quickInfoTemplatesHeaderFn},n.prototype.getQuickInfoTemplatesContent=function(){return this.quickInfoTemplatesContentFn},n.prototype.getQuickInfoTemplatesFooter=function(){return this.quickInfoTemplatesFooterFn},n.prototype.getResourceHeaderTemplate=function(){return this.resourceHeaderTemplateFn},n.prototype.getHeaderIndentTemplate=function(){return this.headerIndentTemplateFn},n.prototype.getCssProperties=function(){return{border:this.enableRtl?"borderLeftWidth":"borderRightWidth",padding:this.enableRtl?"paddingLeft":"paddingRight",rtlBorder:this.enableRtl?"borderRightWidth":"borderLeftWidth",rtlPadding:this.enableRtl?"paddingRight":"paddingLeft"}},n.prototype.removeNewEventElement=function(){var t=this.element.querySelector("."+bi);(0,e.isNullOrUndefined)(t)||(0,e.remove)(t)},n.prototype.getStartEndTime=function(t){if(!(0,e.isNullOrUndefined)(t)&&""!==t){var i=ve(new Date(this.currentTimezoneDate)||this.getCurrentTime()),n=t.split(":");return 2===n.length&&i.setHours(parseInt(n[0],10),parseInt(n[1],10),0),i}return null},n.prototype.onDocumentClick=function(e){this.notify(Z,{event:e})},n.prototype.onDocumentPaste=function(e){this.notify(J,{event:e})},n.prototype.onScheduleResize=function(){if(!((0,e.isNullOrUndefined)(this.activeView)||(this.isAdaptive||He())&&document.activeElement&&(document.activeElement.classList.contains(Cn)||document.activeElement.classList.contains(dr))||this.uiStateValues.isTapHold))if(this.virtualScrollModule&&this.activeView.isTimelineView()&&this.virtualScrollModule.refreshLayout(),this.activeViewOptions.timeScale.enable&&this.activeView&&this.activeView.highlightCurrentTime(),this.quickPopup&&this.quickPopup.onClosePopup(),Ve(),"Month"===this.currentView||"Agenda"!==this.currentView&&"MonthAgenda"!==this.currentView&&!this.activeViewOptions.timeScale.enable||this.activeView.isTimelineView()){this.activeView.resetColWidth(),this.notify(Q,{cssProperties:this.getCssProperties(),isPreventScrollUpdate:!0});var t=!1;if(this.activeViewOptions.enableLazyLoading&&this.virtualScrollModule&&this.virtualScrollModule.isRemoteRefresh&&(t=this.virtualScrollModule.isRemoteRefresh,this.virtualScrollModule.isRemoteRefresh=!1),this.refreshEvents(t),this.virtualScrollModule&&!this.virtualScrollModule.enableTransition){var i=this.element.querySelector("."+yt),n=this.element.querySelector("."+ri);this.virtualScrollModule.enableTransition=!0,(0,e.addClass)([n,i],"e-transition")}}else this.notify(_,{})},n.prototype.templateParser=function(t){if(t)try{return"function"==typeof t?(0,e.compile)(t):document.querySelectorAll(t).length?(0,e.compile)(document.querySelector(t).innerHTML.trim()):(0,e.compile)(t)}catch(i){return(0,e.compile)(t)}},n.prototype.getSelectedCells=function(){return[].slice.call(this.element.querySelectorAll("."+Bt))},n.prototype.getAnnouncementString=function(e,t){var i;if(this.quickPopup&&this.activeViewOptions.group.resources.length>0){i=this.quickPopup.getResourceText({event:e},"event")+'"s event - '}var n=t||e[this.eventFields.subject]||this.eventSettings.fields.subject.default,r=e[this.eventFields.location]||this.eventSettings.fields.location.default,a="full",s=this.globalize.formatDate(e[this.eventFields.startTime],{type:"dateTime",skeleton:a,calendar:this.getCalendarMode()}),o=this.globalize.formatDate(e[this.eventFields.endTime],{type:"dateTime",skeleton:a,calendar:this.getCalendarMode()}),l=n+" "+this.localeObj.getConstant("beginFrom")+" "+s+" "+this.localeObj.getConstant("endAt")+" "+o;return i&&(l=i+" "+l),r&&""!==r&&(l=l+" "+this.localeObj.getConstant("location")+" "+r),e[this.eventFields.recurrenceRule]&&""!==e[this.eventFields.recurrenceRule]&&e[this.eventFields.id]===e[this.eventFields.recurrenceID]&&(l=l+" "+this.localeObj.getConstant("recurringEvent")),l},n.prototype.boundaryValidation=function(e,t){var i={left:!1,right:!1,top:!1,bottom:!1},n=this.element.querySelector("."+ri).getBoundingClientRect();return e<n.top+30+window.pageYOffset&&e>n.top+window.pageYOffset&&(i.top=!0),e>n.bottom-30+window.pageYOffset&&e<n.bottom+window.pageYOffset&&(i.bottom=!0),t<n.left+30+window.pageXOffset&&t>n.left+window.pageXOffset&&(i.left=!0),t>n.right-30+window.pageXOffset&&t<n.right+window.pageXOffset&&(i.right=!0),i},n.prototype.getWeekNumberContent=function(e){var t;if("FirstDay"===this.weekRule){var i=pe(e.slice(-1)[0],this.firstDayOfWeek);t=this.globalize.formatNumber(de(i))}else if("FirstFourDayWeek"===this.weekRule){var n=ue(r=le(e.slice(-1)[0],this.firstDayOfWeek),pe(e.slice(-1)[0],this.firstDayOfWeek));t=this.globalize.formatNumber(de(n))}else if("FirstFullWeek"===this.weekRule){var r=le(e.slice(-1)[0],this.firstDayOfWeek);t=this.globalize.formatNumber(de(r))}return t},n.prototype.renderHeaderIndentTemplate=function(t,i){if(this.activeViewOptions.headerIndentTemplate){var n=this.element.id+"_"+this.activeViewOptions.headerIndentTemplateName+"headerIndentTemplate",r=[].slice.call(this.getHeaderIndentTemplate()(t,this,"headerIndentTemplate",n,!1,void 0,void 0,this.root));(0,e.append)(r,i)}},n.prototype.isSpecificResourceEvents=function(){return this.activeViewOptions.group.resources.length>0&&!this.activeViewOptions.group.allowGroupEdit&&!this.rowAutoHeight&&!this.virtualScrollModule&&this.activeViewOptions.group.byGroupID},n.prototype.unWireEvents=function(){e.EventHandler.remove(window,"resize",this.onScheduleResize),e.EventHandler.remove(window,"orientationchange",this.onScheduleResize),e.EventHandler.remove(document,e.Browser.touchStartEvent,this.onDocumentClick),e.EventHandler.remove(document,"paste",this.onDocumentPaste)},n.prototype.getModuleName=function(){return"schedule"},n.prototype.getPersistData=function(){return this.addOnPersist(["currentView","selectedDate","scrollTop","scrollLeft","adaptiveGroupIndex"])},n.prototype.onPropertyChanged=function(t,i){if(!this.isReact||!(0,e.isNullOrUndefined)(this.activeView)){for(var n={isRefresh:!1,isResource:!1,isDate:!1,isView:!1,isLayout:!1,isDataManager:!1},r=0,a=Object.keys(t);r<a.length;r++){var s=a[r];switch(s){case"views":this.setViewOptions(),this.headerModule&&this.headerModule.updateItems(),n.isView=!0;break;case"currentView":n.isView=!0;break;case"minDate":case"maxDate":case"selectedDate":n.isDate=!0;break;case"dateFormat":this.activeViewOptions=this.getActiveViewOptions(),this.headerModule&&this.headerModule.updateDateRange();break;case"showHeaderBar":case"toolbarItems":this.destroyHeaderModule(),t.showHeaderBar&&(this.headerModule=new yr(this),this.headerModule.updateDateRange()),this.notify(Q,{cssProperties:this.getCssProperties()}),this.activeView.isTimelineView()&&this.refreshEvents(!1);break;case"workDays":JSON.stringify(i.workDays)!==JSON.stringify(t.workDays)&&(n.isLayout=!0);break;case"showWeekend":case"startHour":case"endHour":case"workHours":case"readonly":case"headerRows":case"showWeekNumber":case"rowAutoHeight":n.isLayout=!0;break;case"locale":case"calendarMode":this.globalize=new e.Internationalization(this.locale),this.localeObj=new e.L10n(this.getModuleName(),this.defaultLocale,this.locale),this.setCldrTimeFormat(),this.setCalendarMode(),n.isRefresh=!0;break;case"firstDayOfWeek":this.activeViewOptions.firstDayOfWeek=t.firstDayOfWeek,this.eventWindow&&this.eventWindow.refreshRecurrenceEditor(),n.isLayout=!0;break;case"showTimeIndicator":this.activeViewOptions.timeScale.enable&&this.activeView&&this.activeView.highlightCurrentTime();break;case"cellHeaderTemplate":this.activeViewOptions.cellHeaderTemplate=t.cellHeaderTemplate,this.cellHeaderTemplateFn=this.templateParser(this.activeViewOptions.cellHeaderTemplate),n.isLayout=!0;break;case"cellTemplate":this.activeViewOptions.cellTemplate=t.cellTemplate,this.cellTemplateFn=this.templateParser(this.activeViewOptions.cellTemplate),n.isLayout=!0;break;case"dateHeaderTemplate":this.activeViewOptions.dateHeaderTemplate=t.dateHeaderTemplate,this.dateHeaderTemplateFn=this.templateParser(this.activeViewOptions.dateHeaderTemplate),n.isLayout=!0;break;case"dateRangeTemplate":this.activeViewOptions.dateRangeTemplate=t.dateRangeTemplate,this.dateRangeTemplateFn=this.templateParser(this.activeViewOptions.dateRangeTemplate),this.headerModule&&this.headerModule.updateDateRange();break;case"dayHeaderTemplate":this.activeViewOptions.dayHeaderTemplate=t.dayHeaderTemplate,this.dayHeaderTemplateFn=this.templateParser(this.activeViewOptions.dayHeaderTemplate),n.isLayout=!0;break;case"monthHeaderTemplate":this.activeViewOptions.monthHeaderTemplate=t.monthHeaderTemplate,this.monthHeaderTemplateFn=this.templateParser(this.activeViewOptions.monthHeaderTemplate),n.isLayout=!0;break;case"resourceHeaderTemplate":this.activeViewOptions.resourceHeaderTemplate=t.resourceHeaderTemplate,this.resourceHeaderTemplateFn=this.templateParser(this.activeViewOptions.resourceHeaderTemplate),n.isLayout=!0;break;case"timezone":this.eventBase.timezonePropertyChange(i.timezone),this.headerModule&&this.headerModule.setCalendarTimezone();break;case"enableRtl":this.setRtlClass(),n.isRefresh=!0;break;default:this.extendedPropertyChange(s,t,i,n)}}this.propertyChangeAction(n)}},n.prototype.propertyChangeAction=function(t){t.isRefresh?this.refresh():t.isResource?this.initializeResources(!0):t.isView?this.changeView(this.currentView,null,!0):t.isDate?((0,e.isNullOrUndefined)(this.selectedDate)&&this.setProperties({selectedDate:this.getCurrentTime()},!0),this.changeDate(this.selectedDate)):t.isLayout?(this.activeCellsData=null,this.initializeView(this.currentView)):t.isDataManager&&this.crudModule&&(this.dragAndDropModule&&(this.dragAndDropModule.actionObj.action="",(0,e.removeClass)([this.element],Di)),this.crudModule.refreshDataManager())},n.prototype.allDayRowScrollUpdate=function(){var t=this.element.querySelector("."+it),i=this.element.querySelector("."+Ze);if("auto"!==this.height&&this.enableAllDayScroll)t.classList.contains(mr)&&(0,e.removeClass)([t],mr),this.eventBase.allDayExpandScroll(t);else if((0,e.addClass)([t],mr),t.classList.contains(vr)&&(0,e.removeClass)([t],vr),this.uiStateValues.expand){var n=[].slice.call(this.element.querySelectorAll("."+Ke));n[0].style.height=i.style.height?i.style.height:n[1].style.height}this.uiStateValues.expand||(i.style.height="")},n.prototype.extendedPropertyChange=function(t,i,n,r){switch(t){case"width":case"height":case"enableAllDayScroll":["Day","Week","WorkWeek"].indexOf(this.currentView)>-1&&this.allDayRowScrollUpdate(),this.notify(K,{module:"scroll",properties:{width:i.width,height:i.height}});break;case"cssClass":n.cssClass&&(0,e.removeClass)([this.element],n.cssClass.split(" ")),i.cssClass&&(0,e.addClass)([this.element],i.cssClass.split(" "));break;case"hideEmptyAgendaDays":case"agendaDaysCount":this.activeViewOptions=this.getActiveViewOptions(),r.isView=!0;break;case"eventSettings":this.onEventSettingsPropertyChanged(i.eventSettings,n.eventSettings,r);break;case"allowKeyboardInteraction":case"allowClipboard":this.keyboardInteractionModule&&(this.keyboardInteractionModule.destroy(),this.keyboardInteractionModule=null),(i.allowKeyboardInteraction||i.allowClipboard)&&(this.keyboardInteractionModule=new br(this));break;case"timezoneDataSource":this.eventWindow&&this.eventWindow.refresh();break;case"editorTemplate":(0,e.isNullOrUndefined)(this.editorTemplate)||(this.editorTemplateFn=this.templateParser(this.editorTemplate)),this.eventWindow&&this.eventWindow.setDialogContent();break;case"editorHeaderTemplate":(0,e.isNullOrUndefined)(this.editorHeaderTemplate)||(this.editorHeaderTemplateFn=this.templateParser(this.editorHeaderTemplate)),this.eventWindow&&this.eventWindow.setDialogHeader();break;case"editorFooterTemplate":(0,e.isNullOrUndefined)(this.editorFooterTemplate)||(this.editorFooterTemplateFn=this.templateParser(this.editorFooterTemplate)),this.eventWindow&&this.eventWindow.setDialogFooter();break;case"quickInfoTemplates":this.quickInfoTemplates.header&&(this.quickInfoTemplatesHeaderFn=this.templateParser(this.quickInfoTemplates.header)),this.quickInfoTemplates.content&&(this.quickInfoTemplatesContentFn=this.templateParser(this.quickInfoTemplates.content)),this.quickInfoTemplates.footer&&(this.quickInfoTemplatesFooterFn=this.templateParser(this.quickInfoTemplates.footer));break;case"group":this.onGroupSettingsPropertyChanged(i.group,n.group,r);break;case"resources":r.isResource=!0;break;case"timeScale":this.activeViewOptions.timeScale.interval=i.timeScale.interval||this.activeViewOptions.timeScale.interval,this.activeViewOptions.timeScale.slotCount=i.timeScale.slotCount||this.activeViewOptions.timeScale.slotCount,this.eventWindow&&this.eventWindow.refreshDateTimePicker(),r.isLayout=!0;break;case"allowDragAndDrop":case"allowResizing":case"eventDragArea":case"allowOverlap":this.refreshEvents(!1);break;case"weekRule":r.isLayout=!0;break;case"firstMonthOfYear":this.activeViewOptions.firstMonthOfYear=i.firstMonthOfYear,this.viewIndex=this.activeView.viewIndex,r.isLayout=!0;break;case"monthsCount":this.activeViewOptions.monthsCount=i.monthsCount,this.viewIndex=this.activeView.viewIndex,r.isLayout=!0;break;case"timeFormat":this.internalTimeFormat=i.timeFormat||this.activeViewOptions.timeFormat,this.eventWindow&&this.eventWindow.refreshDateTimePicker(),r.isLayout=!0;break;case"enableAdaptiveUI":this.showHeaderBar&&this.headerModule&&(this.destroyHeaderModule(),this.headerModule=new yr(this),this.headerModule.updateDateRange()),r.isLayout=!0;break;case"headerIndentTemplate":this.activeViewOptions.headerIndentTemplate=i.headerIndentTemplate,this.headerIndentTemplateFn=this.templateParser(this.activeViewOptions.headerIndentTemplate),r.isLayout=!0}},n.prototype.setRtlClass=function(){this.enableRtl?(0,e.addClass)([this.element],"e-rtl"):(0,e.removeClass)([this.element],"e-rtl")},n.prototype.onGroupSettingsPropertyChanged=function(e,t,i){for(var n=0,r=Object.keys(e);n<r.length;n++){"headerTooltipTemplate"===r[n]?this.headerTooltipTemplateFn=this.templateParser(e.headerTooltipTemplate):(i.isLayout=!0,this.eventWindow&&this.eventWindow.refresh())}},n.prototype.onEventSettingsPropertyChanged=function(e,t,i){for(var n=0,r=Object.keys(e);n<r.length;n++){switch(r[n]){case"dataSource":case"query":case"fields":case"includeFiltersInQuery":this.initializeDataModule(),i.isDataManager=!0;break;case"template":this.activeViewOptions.eventTemplate=e.template,this.appointmentTemplateFn=this.templateParser(this.activeViewOptions.eventTemplate),i.isDataManager=!0;break;case"enableTooltip":this.eventTooltip&&(this.eventTooltip.destroy(),this.eventTooltip=null),e.enableTooltip&&(this.eventTooltip=new Ua(this));break;case"tooltipTemplate":this.eventTooltipTemplateFn=this.templateParser(this.eventSettings.tooltipTemplate);break;case"resourceColorField":this.resourceBase&&this.resourceBase.setResourceCollection(),i.isDataManager=!0;break;case"editFollowingEvents":this.quickPopup&&this.quickPopup.refreshQuickDialog();break;case"allowAdding":case"allowEditing":case"allowDeleting":this.showHeaderBar&&this.headerModule&&this.headerModule.updateAddIcon(),this.eventWindow&&this.eventWindow.refresh();break;case"spannedEventPlacement":case"minimumEventDuration":case"enableMaxHeight":case"enableIndicator":this.refreshEvents(!1);break;case"ignoreWhitespace":i.isLayout=!0}}},n.prototype.destroyHeaderModule=function(){this.headerModule&&(this.headerModule.destroy(),this.headerModule=null)},n.prototype.destroyPopups=function(){this.quickPopup&&(this.quickPopup.destroy(),this.quickPopup=null),this.eventWindow&&(this.eventWindow.destroy(),this.eventWindow=null)},n.prototype.showSpinner=function(){(0,t.showSpinner)(this.element)},n.prototype.hideSpinner=function(){(0,t.hideSpinner)(this.element)},n.prototype.setWorkHours=function(t,i,n,r){var a;a=this.getWorkHourCells(t,i,n,r),(0,e.addClass)(a,et)},n.prototype.resetWorkHours=function(t,i,n,r){if(void 0===t&&(t=this.activeView.renderDates),t&&i&&n){var a=this.getWorkHourCells(t,i,n,r);(0,e.removeClass)(a,et)}else{var s=[].slice.call(this.element.querySelectorAll("."+et));(0,e.removeClass)(s,et)}},n.prototype.getWorkHourCells=function(t,i,n,r){if(["Agenda","MonthAgenda","Month","TimelineMonth"].indexOf(this.currentView)>-1)return[];var a=this.getStartEndTime(i),s=this.getStartEndTime(n),o=this.getContentTable();if((0,e.isNullOrUndefined)(a)||(0,e.isNullOrUndefined)(s)||!o)return[];a.setMilliseconds(0),s.setMilliseconds(0);var l=this.activeView.getStartHour();a<l&&(a=l);var p=this.activeView.getEndHour();s>p&&(s=p);for(var c=this.activeViewOptions.timeScale.interval*ne/this.activeViewOptions.timeScale.slotCount,h=(l.getTimezoneOffset()-a.getTimezoneOffset())*ne,d=Math.abs((l.getTimezoneOffset()-s.getTimezoneOffset())*ne),u=Math.round((a.getTime()-l.getTime()+h)/c),g=Math.ceil((s.getTime()-l.getTime()-d)/c),v=u,m=g,f=[],y=0,T=t;y<T.length;y++){var w=T[y];ve(w=this.getDateTime(w));var D=this.activeView.renderDates;(0,e.isNullOrUndefined)(r)||!this.resourceBase||this.activeView.isTimelineView()||(D=this.resourceBase.lastResourceLevel[parseInt(r.toString(),10)].renderDates);var b=this.getIndexOfDate(D,w);if(b>=0){if(this.activeView.isTimelineView()){var S=Math.round((p.getTime()-l.getTime())/c);u=v+b*S,g=m+b*S}for(var C=u;C<g;C++)if(this.activeView.isTimelineView()){var O=(0,e.isNullOrUndefined)(r)?0:r;f.push(o.rows[parseInt(O.toString(),10)].cells[parseInt(C.toString(),10)])}else if((0,e.isNullOrUndefined)(r))f.push(o.rows[parseInt(C.toString(),10)].cells[parseInt(b.toString(),10)]);else{var E="."+$e+'[data-group-index="'+r+'"]',x=[].slice.call(o.rows[parseInt(C.toString(),10)].querySelectorAll(E));f.push(x[parseInt(b.toString(),10)])}}}return f},n.prototype.getCellDetails=function(t){var i=t instanceof Array?t:[t],n=(0,e.getElement)(i[0]),r=(0,e.getElement)(i.slice(-1)[0]),a=this.getDateFromElement(n),s=this.getDateFromElement(r);if(!(0,e.isNullOrUndefined)(a)&&!(0,e.isNullOrUndefined)(s)){var o=this.activeView.isTimelineView()&&!(0,e.isNullOrUndefined)(r.getAttribute("colSpan"))&&this.headerRows.length>0,l=o?parseInt(r.getAttribute("colSpan"),10):1,p={startTime:a,endTime:s=!this.activeViewOptions.timeScale.enable||o||r.classList.contains(Ke)||r.classList.contains(rt)?ye(new Date(s.getTime()),l):this.activeView.getEndDateFromStartDate(s),isAllDay:this.isAllDayCell(n),element:t},c=n.getAttribute("data-group-index");return(0,e.isNullOrUndefined)(c)||(p.groupIndex=parseInt(c,10)),p}},n.prototype.getSelectedElements=function(){return this.keyboardInteractionModule&&this.keyboardInteractionModule.selectedCells.length>0?this.keyboardInteractionModule.selectedCells:this.getSelectedCells()},n.prototype.getResourceCollections=function(){return this.resourceCollection},n.prototype.setResourceCollections=function(e,t){void 0===t&&(t=!0),!t&&this.uiStateValues&&(this.uiStateValues.isPreventEventRefresh=!0),this.setProperties({resources:e},!1)},n.prototype.changeCurrentView=function(e,t){var i=this.getViewIndex(e),n=e.charAt(0).toLowerCase()+e.slice(1),r=this.viewOptions[""+n];r&&(i=this.viewCollections.indexOf(r[t||0])),-1!==i&&i!==this.viewIndex&&this.changeView(e,null,null,i)},n.prototype.getCurrentViewIndex=function(){return this.viewIndex},n.prototype.getResourcesByIndex=function(e){if(this.resourceBase&&this.resourceBase.lastResourceLevel){if(e<0||e>=this.resourceBase.lastResourceLevel.length)return;var t=this.resourceBase.lastResourceLevel[parseInt(e.toString(),10)],i={};return this.resourceBase.setResourceValues(i,e),{resource:t.resource,resourceData:t.resourceData,groupData:i}}},n.prototype.expandResource=function(e,t){this.activeView.isTimelineView()&&this.resourceBase&&this.resourceCollection.length>1&&this.resourceBase.resourceExpand(e,t,!1)},n.prototype.collapseResource=function(e,t){this.activeView.isTimelineView()&&this.resourceBase&&this.resourceCollection.length>1&&this.resourceBase.resourceExpand(e,t,!0)},n.prototype.scrollTo=function(t,i){this.currentView.indexOf("Agenda")<0&&(0,e.isNullOrUndefined)(this.element.querySelector(".e-work-cells"))||(this.activeView.scrollToDate&&(0,e.isNullOrUndefined)(t)&&i?this.activeView.scrollToDate(i):this.activeView.scrollToHour&&this.activeView.scrollToHour(t,i))},n.prototype.scrollToResource=function(e,t){this.resourceBase&&this.resourceBase.lastResourceLevel&&this.resourceBase.resourceScroll(e,t)},n.prototype.exportToICalendar=function(e,t){if(!this.iCalendarExportModule)throw console.warn('[WARNING] :: Module "ICalendarExport" is not available in Schedule component! You either misspelled the module name or forgot to load it.'),Error("Inject ICalendarExport module");this.iCalendarExportModule.initializeCalendarExport(e,t)},n.prototype.importICalendar=function(e){if(!this.iCalendarImportModule)throw console.warn('[WARNING] :: Module "ICalendarImport" is not available in Schedule component! You either misspelled the module name or forgot to load it.'),Error("Inject ICalendarImport module");this.iCalendarImportModule.initializeCalendarImport(e)},n.prototype.addEvent=function(e){this.crudModule.addEvent(e)},n.prototype.generateEventOccurrences=function(e,t){return this.eventBase?this.eventBase.generateOccurrence(e,t):[]},n.prototype.exportToExcel=function(e){if(!this.excelExportModule)throw console.warn('[WARNING] :: Module "ExcelExport" is not available in Schedule component! You either misspelled the module name or forgot to load it.'),Error("Inject ExcelExport module");this.excelExportModule.initializeExcelExport(e)},n.prototype.print=function(e){if(!this.printModule)throw console.warn('[WARNING] :: Module "Print" is not available in Schedule component! You either misspelled the module name or forgot to load it.'),Error("Inject Print module");this.printModule.print(e)},n.prototype.saveEvent=function(e,t){this.crudModule.saveEvent(e,t)},n.prototype.deleteEvent=function(e,t){this.crudModule.deleteEvent(e,t)},n.prototype.getEvents=function(e,t,i){var n=[];return n=i?this.eventBase.getProcessedEvents():this.eventsData,e&&(e=this.getDateTime(e)),t&&(t=this.getDateTime(t)),n=this.eventBase.filterEventsByRange(n,e,t)},n.prototype.getBlockEvents=function(e,t,i){var n=[];return n=i?this.eventBase.getProcessedEvents(this.blockData):this.blockData,e&&(e=this.getDateTime(e)),t&&(t=this.getDateTime(t)),n=this.eventBase.filterEventsByRange(n,e,t)},n.prototype.getOccurrencesByID=function(e){return this.eventBase.getOccurrencesByID(e)},n.prototype.getOccurrencesByRange=function(e,t){return e=this.getDateTime(e),t=this.getDateTime(t),this.eventBase.getOccurrencesByRange(e,t)},n.prototype.getCurrentViewDates=function(){return this.activeView?this.activeView.renderDates:[]},n.prototype.setRecurrenceEditor=function(e){this.eventWindow.setRecurrenceEditor(e)},n.prototype.getEventMaxID=function(){return this.eventBase.getEventMaxID()},n.prototype.getDeletedOccurrences=function(e){return this.eventBase.getDeletedOccurrences(e)},n.prototype.getCurrentViewEvents=function(){return this.eventsProcessed},n.prototype.refreshEvents=function(t){void 0===t&&(t=!0),t?(this.dragAndDropModule&&(this.dragAndDropModule.actionObj.action="",(0,e.removeClass)([this.element],Di)),this.crudModule.refreshDataManager()):(this.uiStateValues&&(this.uiStateValues.isPreventTimezone=!0),this.crudModule&&this.crudModule.refreshProcessedData(),this.uiStateValues&&(this.uiStateValues.isPreventTimezone=!1))},n.prototype.refreshTemplates=function(e){switch(e?this.resetTemplates([e]):this.resetTemplates(),e){case"eventTemplate":this.appointmentTemplateFn=this.templateParser(this.activeViewOptions.eventTemplate),this.refreshEvents(!1);break;case"dateHeaderTemplate":this.dateHeaderTemplateFn=this.templateParser(this.activeViewOptions.dateHeaderTemplate),this.activeView.refreshHeader();break;case"dateRangeTemplate":this.dateRangeTemplateFn=this.templateParser(this.activeViewOptions.dateRangeTemplate),this.headerModule&&this.headerModule.refresh();break;case"resourceHeaderTemplate":this.resourceHeaderTemplateFn=this.templateParser(this.activeViewOptions.resourceHeaderTemplate),this.activeView.isTimelineView()?this.activeView.refreshResourceHeader():this.activeView.refreshHeader();break;case"quickInfoTemplates":this.quickPopup&&(this.quickPopup.destroy(),this.quickPopup=null),this.quickPopup=new Fa(this),this.quickInfoTemplatesHeaderFn=this.templateParser(this.quickInfoTemplates.header),this.quickInfoTemplatesContentFn=this.templateParser(this.quickInfoTemplates.content),this.quickInfoTemplatesFooterFn=this.templateParser(this.quickInfoTemplates.footer);break;case"editorTemplate":this.destroyEditorWindow(),this.editorTemplateFn=this.templateParser(this.editorTemplate);break;case"editorHeaderTemplate":this.destroyEditorWindow(),this.editorHeaderTemplateFn=this.templateParser(this.editorHeaderTemplate);break;case"editorFooterTemplate":this.destroyEditorWindow(),this.editorFooterTemplateFn=this.templateParser(this.editorFooterTemplate);break;case"tooltipTemplate":case"headerTooltipTemplate":this.eventTooltip&&(this.eventTooltip.destroy(),this.eventTooltip=null),this.eventTooltip=new Ua(this),this.eventTooltipTemplateFn=this.templateParser(this.eventSettings.tooltipTemplate),this.headerTooltipTemplateFn=this.templateParser(this.activeViewOptions.group.headerTooltipTemplate);break;default:this.initializeView(this.currentView)}},n.prototype.refreshLayout=function(){this.onScheduleResize(),this.headerModule&&this.headerModule.refresh(),this.eventWindow&&this.eventWindow.refresh()},n.prototype.getEventDetails=function(t){var i=(t=(0,e.getElement)(t)).getAttribute("data-guid");return i?this.eventBase.getEventByGuid(i):{}},n.prototype.isSlotAvailable=function(t,i,n){var r,a,s=this,o=this.activeEventData.event;if(t instanceof Date||"string"==typeof t?(r=t,a=i):(o=t,r=t[this.eventFields.startTime],a=t[this.eventFields.endTime],this.resourceBase&&(n=this.eventBase.getGroupIndexFromEvent(t))),(0,e.isNullOrUndefined)(r)||(0,e.isNullOrUndefined)(a))return!0;r=this.getDateTime(r),a=this.getDateTime(a);var l=this.eventBase.filterEvents(r,a);return!(0,e.isNullOrUndefined)(n)&&this.resourceBase&&this.resourceBase.lastResourceLevel.length>0&&(l=this.eventBase.filterEventsByResource(this.resourceBase.lastResourceLevel[parseInt(n.toString(),10)],l)),o&&(l=o.Guid?l.filter((function(e){return e.Guid!==o.Guid})):l.filter((function(e){return e[s.eventFields.id]!==o[s.eventFields.id]}))),!(l.length>0)},n.prototype.copy=function(e){this.processCutCopyActions(e,!1)},n.prototype.cut=function(e){this.processCutCopyActions(e,!0)},n.prototype.paste=function(t){var i=this;if(this.allowClipboard&&this.allowKeyboardInteraction&&(t.classList.contains("e-work-cells")||t.classList.contains("e-all-day-cells"))){var n=new DataTransfer;(0,e.isNullOrUndefined)(navigator.clipboard)||navigator.clipboard.readText().then((function(e){n.setData("text/plain",e);var r=new ClipboardEvent("paste",{bubbles:!0,cancelable:!0});Object.defineProperty(r,"clipboardData",{value:n}),i.keyboardInteractionModule.pasteHandler(r,t)})).catch((function(e){throw e}))}},n.prototype.processCutCopyActions=function(e,t){var i=this;if(e&&this.allowClipboard&&this.allowKeyboardInteraction){var n=[];e.forEach((function(e){if(e.classList.contains(Xt)){var t=i.getEventDetails(e);t&&n.push(t)}})),n.length>0&&this.keyboardInteractionModule.processClipboardAction(t,n)}},n.prototype.openEditor=function(t,i,n,r){"Add"!==i||n?(t[this.eventFields.startTime]=this.getDateTime(t[this.eventFields.startTime]),t[this.eventFields.endTime]=this.getDateTime(t[this.eventFields.endTime])):(t.startTime=this.getDateTime(t.startTime),t.endTime=this.getDateTime(t.endTime),(0,e.isNullOrUndefined)(t.element)||(t.element=(0,e.getElement)(t.element))),this.currentAction=i,"Add"!==i&&(this.activeEventData.event=t),this.eventWindow.openEditor(t,i,n,r)},n.prototype.closeEditor=function(){this.eventWindow&&this.eventWindow.dialogClose()},n.prototype.openQuickInfoPopup=function(t){var i=this;if("Year"!==this.currentView&&!(0,e.isNullOrUndefined)(t))if((0,e.isNullOrUndefined)(t[this.eventFields.id])){if("Agenda"===this.currentView||"MonthAgenda"===this.currentView||(0,e.isNullOrUndefined)(this.activeView))return;var n={startTime:this.activeCellsData.startTime=this.getDateTime(t[this.eventFields.startTime]),endTime:this.activeCellsData.endTime=this.getDateTime(t[this.eventFields.endTime]),isAllDay:this.activeCellsData.isAllDay=!(0,e.isNullOrUndefined)(t[this.eventFields.isAllDay])&&t[this.eventFields.isAllDay]},a=this.activeView.getAdjustedDate(new Date(n.startTime));if(a){var s="."+$e+'[data-date="'+a.getTime()+'"]';this.activeViewOptions.group.resources.length>0&&!this.uiStateValues.isGroupAdaptive&&this.resourceBase&&this.eventBase&&(n.groupIndex=this.eventBase.getGroupIndexFromEvent(t),s="."+$e+'[data-date="'+a.getTime()+'"][data-group-index="'+n.groupIndex+'"]');var o=this.element.querySelector(s);o&&(o.focus(),n.element=o,this.notify(r,n))}}else{var l=this.getCurrentViewEvents().filter((function(e){return t[i.eventFields.id]===e[i.eventFields.id]}));if(l.length<=0)return;var p=l[0];if(t[this.eventFields.recurrenceRule]){var c=l.filter((function(e){return e[i.eventFields.startTime].getTime()===t[i.eventFields.startTime].getTime()}));c.length>0&&(p=c[0])}var h=this.element.querySelector('div[data-guid="'+p.Guid+'"]');h&&(this.eventBase.removeSelectedAppointmentClass(),this.eventBase.addSelectedAppointments([h],!1),this.activeEventData={event:p,element:h},"Agenda"!==this.currentView&&"MonthAgenda"!==this.currentView||(0,e.addClass)([this.activeEventData.element],li),this.notify(m,this.activeEventData))}},n.prototype.closeQuickInfoPopup=function(){this.quickPopup&&this.quickPopup.quickPopupHide(!0)},n.prototype.openOverlapAlert=function(e){var t=this;if(this.quickPopup){var i={type:"OverlapAlert",cancel:!1,element:this.quickPopup.quickDialog.element,data:e.data,overlapEvents:e.overlapEvents};this.trigger(D,i,(function(i){i.cancel||t.quickPopup.openValidationError("overlapAlert",e.data)}))}},n.prototype.closeOverlapAlert=function(){var e=this;if(this.quickPopup){var t={type:"OverlapAlert",cancel:!1,data:this.activeEventData.event,element:this.quickPopup.quickDialog.element};this.trigger(b,t,(function(t){t.cancel||e.quickPopup.quickDialog.hide()}))}},n.prototype.closeTooltip=function(){this.eventTooltip&&this.eventTooltip.close()},n.prototype.getDateRangeText=function(t){return(0,e.isNullOrUndefined)(t)&&0===t.length||!this.activeView?"":this.activeView.getDateRangeText(t[0],t)},n.prototype.getViewDates=function(e){if(void 0===e&&(e="Current"),!this.activeView)return[];switch(e){case"Previous":case"Next":return this.activeView.getRenderDates(void 0,this.activeView.getNextPreviousDate(e));case"Current":return this.getCurrentViewDates()}},n.prototype.selectResourceByIndex=function(e){this.resourceBase&&this.uiStateValues.isGroupAdaptive&&this.resourceBase.selectResourceByIndex(e)},n.prototype.getIndexFromResourceId=function(e,t){return this.resourceBase?this.resourceBase.getIndexFromResourceId(e,t):null},n.prototype.addResource=function(e,t,i){this.resourceBase.addResource(e,t,i)},n.prototype.removeResource=function(e,t){this.resourceBase.removeResource(e,t)},n.prototype.destroy=function(){this.eventTooltip&&(this.eventTooltip.destroy(),this.eventTooltip=null),this.destroyPopups(),this.hideSpinner(),this.unWireEvents(),this.destroyHeaderModule(),this.eventBase&&(this.eventBase.destroy(),this.eventBase=null),this.workCellAction&&(this.workCellAction.destroy(),this.workCellAction=null),this.inlineModule&&(this.inlineModule.destroy(),this.inlineModule=null),this.keyboardInteractionModule&&(this.keyboardInteractionModule.destroy(),this.keyboardInteractionModule=null),this.scrollModule&&(this.scrollModule.destroy(),this.scrollModule=null),this.printModule&&this.printModule.destroy(),this.activeView&&(this.resetTemplates(),this.activeView.removeEventListener(),this.activeView.destroy(),this.activeView=null),this.scheduleTouchModule&&(this.scheduleTouchModule.destroy(),this.scheduleTouchModule=null),this.crudModule&&(this.crudModule.destroy(),this.crudModule=null),this.dataModule&&(this.dataModule.destroy(),this.dataModule=null),i.prototype.destroy.call(this);for(var t=0,n=["dayModule","weekModule","workWeekModule","monthModule","monthAgendaModule","yearModule","agendaModule","timelineViewsModule","timelineMonthModule","timelineYearModule","resizeModule","dragAndDropModule","excelExportModule","printModule","iCalendarExportModule","iCalendarImportModule","tzModule","eventsData","eventsProcessed","blockData","blockProcessed","uiStateValues","viewCollections","viewOptions","defaultLocale","localeObj","selectedElements","resourceCollection","editorTitles","eventFields","activeViewOptions","activeEventData","activeCellsData","renderModule"];t<n.length;t++){this[""+n[t]]=null}Me(this.element);var r=[Fe,Ue,Be,ze];this.cssClass&&(r=r.concat(this.cssClass.split(" "))),(0,e.removeClass)([this.element],r)},zo([(0,e.Property)("auto")],n.prototype,"width",void 0),zo([(0,e.Property)("auto")],n.prototype,"height",void 0),zo([(0,e.Property)(!0)],n.prototype,"showHeaderBar",void 0),zo([(0,e.Property)(!0)],n.prototype,"showTimeIndicator",void 0),zo([(0,e.Property)(!0)],n.prototype,"allowSwiping",void 0),zo([(0,e.Property)(!0)],n.prototype,"allowOverlap",void 0),zo([(0,e.Property)(3)],n.prototype,"overscanCount",void 0),zo([(0,e.Collection)([],Bo)],n.prototype,"toolbarItems",void 0),zo([(0,e.Property)("Week")],n.prototype,"currentView",void 0),zo([(0,e.Property)(["Day","Week","WorkWeek","Month","Agenda"])],n.prototype,"views",void 0),zo([(0,e.Property)(new Date)],n.prototype,"selectedDate",void 0),zo([(0,e.Property)(new Date(1900,0,1))],n.prototype,"minDate",void 0),zo([(0,e.Property)(new Date(2099,11,31))],n.prototype,"maxDate",void 0),zo([(0,e.Property)()],n.prototype,"dateFormat",void 0),zo([(0,e.Property)("Gregorian")],n.prototype,"calendarMode",void 0),zo([(0,e.Property)(!0)],n.prototype,"showWeekend",void 0),zo([(0,e.Property)(0)],n.prototype,"firstDayOfWeek",void 0),zo([(0,e.Property)("FirstDay")],n.prototype,"weekRule",void 0),zo([(0,e.Property)([1,2,3,4,5])],n.prototype,"workDays",void 0),zo([(0,e.Property)(12)],n.prototype,"monthsCount",void 0),zo([(0,e.Property)("00:00")],n.prototype,"startHour",void 0),zo([(0,e.Property)("24:00")],n.prototype,"endHour",void 0),zo([(0,e.Property)(null)],n.prototype,"timeFormat",void 0),zo([(0,e.Property)(!0)],n.prototype,"enableHtmlSanitizer",void 0),zo([(0,e.Property)(!1)],n.prototype,"enableAllDayScroll",void 0),zo([(0,e.Property)(!1)],n.prototype,"enableAdaptiveUI",void 0),zo([(0,e.Property)(!0)],n.prototype,"allowResizing",void 0),zo([(0,e.Complex)({},ho)],n.prototype,"workHours",void 0),zo([(0,e.Complex)({},vo)],n.prototype,"timeScale",void 0),zo([(0,e.Property)(!0)],n.prototype,"allowKeyboardInteraction",void 0),zo([(0,e.Property)(!0)],n.prototype,"allowDragAndDrop",void 0),zo([(0,e.Property)()],n.prototype,"dateHeaderTemplate",void 0),zo([(0,e.Property)()],n.prototype,"dateRangeTemplate",void 0),zo([(0,e.Property)()],n.prototype,"cellHeaderTemplate",void 0),zo([(0,e.Property)()],n.prototype,"dayHeaderTemplate",void 0),zo([(0,e.Property)()],n.prototype,"monthHeaderTemplate",void 0),zo([(0,e.Property)()],n.prototype,"cellTemplate",void 0),zo([(0,e.Property)(!1)],n.prototype,"readonly",void 0),zo([(0,e.Property)(!0)],n.prototype,"showQuickInfo",void 0),zo([(0,e.Property)(!1)],n.prototype,"allowInline",void 0),zo([(0,e.Property)(!0)],n.prototype,"allowMultiCellSelection",void 0),zo([(0,e.Property)(!0)],n.prototype,"allowMultiRowSelection",void 0),zo([(0,e.Property)(!1)],n.prototype,"quickInfoOnSelectionEnd",void 0),zo([(0,e.Property)(!1)],n.prototype,"showWeekNumber",void 0),zo([(0,e.Property)(!1)],n.prototype,"rowAutoHeight",void 0),zo([(0,e.Property)(!1)],n.prototype,"allowMultiDrag",void 0),zo([(0,e.Property)(0)],n.prototype,"firstMonthOfYear",void 0),zo([(0,e.Property)()],n.prototype,"editorTemplate",void 0),zo([(0,e.Property)()],n.prototype,"editorHeaderTemplate",void 0),zo([(0,e.Property)()],n.prototype,"editorFooterTemplate",void 0),zo([(0,e.Complex)({},yo)],n.prototype,"quickInfoTemplates",void 0),zo([(0,e.Property)(7)],n.prototype,"agendaDaysCount",void 0),zo([(0,e.Property)(!0)],n.prototype,"hideEmptyAgendaDays",void 0),zo([(0,e.Property)(!0)],n.prototype,"enableRecurrenceValidation",void 0),zo([(0,e.Property)()],n.prototype,"timezone",void 0),zo([(0,e.Complex)({},ko)],n.prototype,"eventSettings",void 0),zo([(0,e.Property)(Vr)],n.prototype,"timezoneDataSource",void 0),zo([(0,e.Property)()],n.prototype,"resourceHeaderTemplate",void 0),zo([(0,e.Property)()],n.prototype,"headerIndentTemplate",void 0),zo([(0,e.Complex)({},Po)],n.prototype,"group",void 0),zo([(0,e.Collection)([],Lo)],n.prototype,"resources",void 0),zo([(0,e.Collection)([],Do)],n.prototype,"headerRows",void 0),zo([(0,e.Property)()],n.prototype,"cssClass",void 0),zo([(0,e.Property)(!1)],n.prototype,"allowClipboard",void 0),zo([(0,e.Property)()],n.prototype,"eventDragArea",void 0),zo([(0,e.Event)()],n.prototype,"created",void 0),zo([(0,e.Event)()],n.prototype,"destroyed",void 0),zo([(0,e.Event)()],n.prototype,"cellClick",void 0),zo([(0,e.Event)()],n.prototype,"cellDoubleClick",void 0),zo([(0,e.Event)()],n.prototype,"moreEventsClick",void 0),zo([(0,e.Event)()],n.prototype,"hover",void 0),zo([(0,e.Event)()],n.prototype,"select",void 0),zo([(0,e.Event)()],n.prototype,"actionBegin",void 0),zo([(0,e.Event)()],n.prototype,"actionComplete",void 0),zo([(0,e.Event)()],n.prototype,"actionFailure",void 0),zo([(0,e.Event)()],n.prototype,"navigating",void 0),zo([(0,e.Event)()],n.prototype,"renderCell",void 0),zo([(0,e.Event)()],n.prototype,"eventClick",void 0),zo([(0,e.Event)()],n.prototype,"eventDoubleClick",void 0),zo([(0,e.Event)()],n.prototype,"eventRendered",void 0),zo([(0,e.Event)()],n.prototype,"dataBinding",void 0),zo([(0,e.Event)()],n.prototype,"popupOpen",void 0),zo([(0,e.Event)()],n.prototype,"popupClose",void 0),zo([(0,e.Event)()],n.prototype,"dragStart",void 0),zo([(0,e.Event)()],n.prototype,"drag",void 0),zo([(0,e.Event)()],n.prototype,"dragStop",void 0),zo([(0,e.Event)()],n.prototype,"resizeStart",void 0),zo([(0,e.Event)()],n.prototype,"resizing",void 0),zo([(0,e.Event)()],n.prototype,"resizeStop",void 0),zo([(0,e.Event)()],n.prototype,"virtualScrollStart",void 0),zo([(0,e.Event)()],n.prototype,"virtualScrollStop",void 0),zo([(0,e.Event)()],n.prototype,"dataBound",void 0),zo([(0,e.Event)()],n.prototype,"beforePaste",void 0),zo([(0,e.Event)()],n.prototype,"beforePrint",void 0),zo([(0,e.Event)()],n.prototype,"excelExport",void 0),zo([(0,e.Event)()],n.prototype,"tooltipOpen",void 0),n=zo([e.NotifyPropertyChanges],n)}(e.Component),_o=function(){function t(e){this.daysVariation=0,this.parent=e,this.actionObj={X:0,Y:0,groupIndex:0,cellWidth:0,cellHeight:0,slotInterval:0,interval:0,actionIndex:0,cloneElement:[],originalElement:[],action:null,isAllDay:null,excludeSelectors:null,index:0,navigationInterval:null,scrollInterval:null},this.scrollArgs={element:null,width:0,height:0},this.resizeEdges={left:!1,right:!1,top:!1,bottom:!1},this.scrollEdges={left:!1,right:!1,top:!1,bottom:!1}}return t.prototype.getChangedData=function(t){var i=this,n=(0,e.extend)({},this.actionObj.event,null,!0);if(n[this.parent.eventFields.startTime]=this.actionObj.start,n[this.parent.eventFields.endTime]=this.actionObj.end,(0,e.isNullOrUndefined)(this.actionObj.isAllDay)||(n[this.parent.eventFields.isAllDay]=this.actionObj.isAllDay),this.parent.activeViewOptions.group.resources.length>0){var r=this.getOriginalElement(this.actionObj.element);if(r){var a=r.map((function(e){return parseInt(e.getAttribute("data-group-index"),10)}));if(-1===a.indexOf(this.actionObj.groupIndex)||!(0,e.isNullOrUndefined)(t)&&t.length>0){var s=parseInt(this.actionObj.clone.getAttribute("data-group-index"),10);(a=a.filter((function(e){return e!==s}))).push(this.actionObj.groupIndex),t&&t.length>0?t.forEach((function(e){i.parent.resourceBase.getResourceData(e,i.actionObj.groupIndex,a)})):this.parent.resourceBase.getResourceData(n,this.actionObj.groupIndex,a)}}}return n},t.prototype.saveChangedData=function(e,t){var i;void 0===t&&(t=!1),this.parent.activeEventData.event=this.actionObj.event,this.parent.currentAction="Save";var n=[e.data];t&&(n=e.selectedData);for(var r=0,a=n;r<a.length;r++){var s=a[r],o=!(this.parent.activeViewOptions.group.resources.length>0)||parseInt(this.actionObj.element.getAttribute("data-group-index"),10)===this.actionObj.groupIndex;if(+s[this.parent.eventFields.startTime]==+this.actionObj.event[this.parent.eventFields.startTime]&&+s[this.parent.eventFields.endTime]==+this.actionObj.event[this.parent.eventFields.endTime]&&o)return void(this.parent.crudModule.crudObj.isCrudAction=!1);if(s[this.parent.eventFields.recurrenceRule]){var l=s[this.parent.eventFields.recurrenceID]||s[this.parent.eventFields.id];if(s[this.parent.eventFields.id]===s[this.parent.eventFields.recurrenceID]&&(s[this.parent.eventFields.id]=this.parent.eventBase.getEventMaxID(),i="EditOccurrence"),this.parent.enableRecurrenceValidation&&this.parent.eventWindow.editOccurrenceValidation(l,s,this.actionObj.event))return}else i=null;(s[this.parent.eventFields.startTimezone]||s[this.parent.eventFields.endTimezone])&&this.parent.eventBase.timezoneConvert(s),this.parent.crudModule.saveEvent(s,i)}},t.prototype.calculateIntervalTime=function(e){var t=ve(e).getTime(),i=this.parent.activeView.getStartHour(),n=ne*this.actionObj.interval;return t+=(60*i.getHours()+i.getMinutes())*ne+1e3*i.getSeconds(),t+=Math.floor((e.getTime()-t)/n)*n,new Date(t)},t.prototype.getContentAreaDimension=function(){var e=this.parent.element.querySelector("."+ri),t=[].slice.call(e.querySelector("tr").children);this.parent.activeView.isTimelineView()||!(this.parent.activeViewOptions.group.resources.length>0)||this.parent.isAdaptive||this.parent.enableAdaptiveUI||this.parent.virtualScrollModule||(t=this.getResourceElements(t));var i=t[0].getBoundingClientRect(),n=t.slice(-1)[0].getBoundingClientRect();return{bottom:e.scrollHeight-5,left:this.parent.enableRtl?n.left:i.left,right:this.parent.enableRtl?i.right:n.right,top:0,leftOffset:this.parent.enableRtl?n.right:i.right,rightOffset:this.parent.enableRtl?i.left:n.left}},t.prototype.getIndex=function(e){var t=[].slice.call(this.parent.getContentTable().querySelector("tr").children),i={minIndex:0,maxIndex:t.length-1};if("resize"===this.actionObj.action&&this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&!this.parent.activeView.isTimelineView()){var n=this.getResourceElements(t);i.minIndex=n[0].cellIndex,i.maxIndex=n.slice(-1)[0].cellIndex}return e<i.minIndex&&(e=i.minIndex),e>i.maxIndex&&(e=i.maxIndex),e},t.prototype.updateTimePosition=function(t,i){for(var n=0,r=0,a=this.actionObj.cloneElement;r<a.length;r++){var s=a[r].querySelector("."+ti);if(s){var o=this.actionObj.start,l=this.actionObj.end;i&&i.length>0&&(o=i[parseInt(n.toString(),10)][this.parent.eventFields.startTime],l=i[parseInt(n.toString(),10)][this.parent.eventFields.endTime]),s.innerHTML=this.parent.getTimeString(o)+" - "+this.parent.getTimeString(l)}n++}if(this.parent.activeViewOptions.timeScale.enable&&this.parent.isAdaptive&&"Month"!==this.parent.currentView&&"TimelineMonth"!==this.parent.currentView){var p=this.parent.element.querySelector("."+Ci);if(!p){p=(0,e.createElement)("div",{className:Ci});var c=this.parent.activeView.isTimelineView()?it:Et;this.parent.element.querySelector("."+c).appendChild(p)}p.innerHTML=this.parent.getTimeString(t);var h=0;if(this.parent.activeView.isTimelineView())if(this.parent.enableRtl){var d=parseInt(this.actionObj.clone.style.right,10);h="drag"===this.actionObj.action||this.resizeEdges.left?d+this.actionObj.clone.offsetWidth:d,p.style.right=(0,e.formatUnit)(h)}else{var u=parseInt(this.actionObj.clone.style.left,10);h="drag"===this.actionObj.action||this.resizeEdges.left?u:u+this.actionObj.clone.offsetWidth,p.style.left=(0,e.formatUnit)(h)}else h="drag"===this.actionObj.action||this.resizeEdges.top?this.actionObj.clone.offsetTop:this.actionObj.clone.offsetTop+this.actionObj.clone.offsetHeight,p.style.top=(0,e.formatUnit)(h)}},t.prototype.getResourceElements=function(e){var t=this;return e.filter((function(e){return parseInt(e.getAttribute("data-group-index"),10)===t.actionObj.groupIndex}))},t.prototype.getOriginalElement=function(t){var i,n=t.getAttribute("data-guid");if(t.offsetParent&&t.offsetParent.classList.contains(tn)||this.parent.activeView.isTimelineView()||"resize"!==this.actionObj.action&&this.parent.virtualScrollModule)i=[].slice.call(this.parent.element.querySelectorAll('[data-guid="'+n+'"]'));else{var r=(0,e.closest)(t,"tr");r&&(i=[].slice.call(r.querySelectorAll('[data-guid="'+n+'"]')))}return i},t.prototype.createCloneElement=function(t){var i=document.createElement("div");i.appendChild(t.cloneNode(!0));var n=i.children[0],r=[Si];r.push("drag"===this.actionObj.action?Oi:xi),"Month"!==this.parent.currentView&&"TimelineMonth"!==this.parent.currentView||r.push("e-month-event"),(0,e.addClass)([n],r),(0,e.addClass)([t],Di),(0,e.isNullOrUndefined)(t.parentElement)||t.parentElement.appendChild(n),n.style.width=(0,e.formatUnit)(n.offsetWidth-2);var a=document.querySelector(this.parent.eventDragArea);return this.parent.eventDragArea&&"drag"===this.actionObj.action&&a&&a.appendChild(n),(0,e.setStyleAttribute)(n,{border:"0px"}),n},t.prototype.removeCloneElementClasses=function(){var t=this.actionObj.originalElement;"Month"!==this.parent.currentView&&"TimelineYear"!==this.parent.currentView&&"Day"!==this.parent.currentView&&"Week"!==this.parent.currentView&&"WorkWeek"!==this.parent.currentView||(t=[].slice.call(this.parent.element.querySelectorAll("."+Di))),(0,e.removeClass)(t,Di)},t.prototype.removeCloneElement=function(){this.actionObj.originalElement=[];for(var t=0,i=[].slice.call(this.parent.element.querySelectorAll(".e-dynamic-clone"));t<i.length;t++){var n=i[t];(0,e.remove)(n)}for(var r=0,a=this.actionObj.cloneElement;r<a.length;r++){var s=a[r];(0,e.isNullOrUndefined)(s.parentNode)||(0,e.remove)(s)}this.actionObj.cloneElement=[];var o=this.parent.element.querySelector("."+Ci);o&&(0,e.remove)(o)},t.prototype.getCursorElement=function(e){var t=this.parent.eventBase.getPageCoordinates(e);return document.elementFromPoint(t.clientX,t.clientY)},t.prototype.autoScroll=function(){var e=this.parent.element.querySelector("."+ri),t=e.offsetHeight<=e.scrollHeight,i=e.offsetWidth<=e.scrollWidth,n=t&&e.scrollTop>=0&&e.scrollTop+e.offsetHeight<=e.scrollHeight,r=i&&e.scrollLeft>=0&&e.scrollLeft+e.offsetWidth<=e.scrollWidth;if("resize"===this.actionObj.action&&this.scrollEdges.right&&e.scrollLeft+e.offsetWidth>e.scrollWidth){var a=[].slice.call(this.parent.getContentTable().querySelector("tr").children).length-1;r=Math.ceil((this.actionObj.clone.offsetLeft+this.actionObj.clone.offsetWidth)/this.actionObj.cellWidth)===a}n&&(this.scrollEdges.top||this.scrollEdges.bottom)&&(e.scrollTop+=this.scrollEdges.top?-this.actionObj.scroll.scrollBy:this.actionObj.scroll.scrollBy,"resize"===this.actionObj.action&&e.scrollHeight!==e.offsetHeight+e.scrollTop&&e.scrollTop>0&&(this.actionObj.Y+=this.scrollEdges.top?this.actionObj.scroll.scrollBy:-this.actionObj.scroll.scrollBy)),r&&(this.scrollEdges.left||this.scrollEdges.right)&&(e.scrollLeft+=this.scrollEdges.left?-this.actionObj.scroll.scrollBy:this.actionObj.scroll.scrollBy,"resize"===this.actionObj.action&&e.scrollWidth!==e.offsetWidth+e.scrollLeft&&e.scrollLeft>0&&(this.actionObj.X+=this.scrollEdges.left?this.actionObj.scroll.scrollBy:-this.actionObj.scroll.scrollBy))},t.prototype.autoScrollValidation=function(){if(!this.actionObj.scroll.enable)return!1;var e=this.parent.boundaryValidation(this.actionObj.pageY,this.actionObj.pageX);return this.scrollEdges=e,e.bottom||e.top||e.left||e.right},t.prototype.actionClass=function(t){"addClass"===t?(0,e.addClass)([this.parent.element],Di):(0,e.removeClass)([this.parent.element],Di)},t.prototype.updateScrollPosition=function(t){var i=this;this.scrollEventArgs=t,this.actionObj.scroll.enable&&(0,e.isNullOrUndefined)(this.actionObj.scrollInterval)&&(this.actionObj.scrollInterval=window.setInterval((function(){if(i.autoScrollValidation()&&!i.actionObj.clone.classList.contains(ji)){if(i.parent.activeView.isTimelineView()&&i.parent.activeViewOptions.group.resources.length>0&&i.actionObj.groupIndex<0)return;i.autoScroll(),"drag"===i.actionObj.action?i.parent.dragAndDropModule.updateDraggingDateTime(i.scrollEventArgs):i.parent.resizeModule.updateResizingDirection(i.scrollEventArgs)}}),this.actionObj.scroll.timeDelay))},t.prototype.updateOriginalElement=function(t){var i='[data-id="'+t.getAttribute("data-id")+'"]';this.parent.activeViewOptions.group.resources.length>0&&(i=i.concat('[data-group-index = "'+t.getAttribute("data-group-index")+'"]'));var n=[].slice.call(this.parent.element.querySelectorAll(i));(0,e.addClass)(n,Di);var r=[].slice.call(this.parent.element.querySelectorAll("."+Si));(0,e.removeClass)(r,Di)},t.prototype.getUpdatedEvent=function(e,t,i){var n=JSON.parse(JSON.stringify(i));return n[this.parent.eventFields.startTime]=e,n[this.parent.eventFields.endTime]=t,n},t.prototype.dynamicYearlyEventsRendering=function(t,i){if(void 0===i&&(i=!1),(0,e.isNullOrUndefined)(this.parent.eventDragArea)){var n,r=this.actionObj.cellWidth-7;if(i&&(this.resizeEdges.left||this.resizeEdges.right)&&(r=this.actionObj.cellWidth*t.count),!i&&"Horizontal"===this.parent.activeViewOptions.orientation&&0===this.parent.activeViewOptions.group.resources.length)(n=this.yearEvent.isSpannedEvent(t,t[this.parent.eventFields.startTime]))[this.parent.eventFields.startTime].getTime()===n[this.parent.eventFields.endTime].getTime()&&(n.isSpanned.count=1),r=n.isSpanned.count*this.actionObj.cellWidth;if(!i&&"Vertical"===this.parent.activeViewOptions.orientation&&0!==this.parent.activeViewOptions.group.resources.length)r=(n=this.yearEvent.isSpannedEvent(t,t[this.parent.eventFields.startTime])).isSpanned.count*this.actionObj.cellWidth;var a=this.createAppointmentElement(this.actionObj.groupIndex,t[this.parent.eventFields.subject]);a.setAttribute("drag","true"),(0,e.addClass)([a],Si),(0,e.setStyleAttribute)(a,{width:r+"px",border:"0px","pointer-events":"none",position:"absolute",overflow:"hidden",padding:"3px"}),""!==this.actionObj.clone.style.backgroundColor&&(0,e.setStyleAttribute)(a,{backgroundColor:this.actionObj.clone.style.backgroundColor});var s=ve(t[this.parent.eventFields.startTime]).getTime(),o="."+$e+'[data-date="'+s+'"]';this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&(o="."+$e+'[data-date="'+s+'"][data-group-index="'+this.actionObj.groupIndex+'"]');var l=this.parent.element.querySelector(o);if(!(0,e.isNullOrUndefined)(l)){if(i){var p=l.querySelector("."+ui),c=this.actionObj.cellHeight*t.count-(p?p.offsetHeight:0)-7;(this.resizeEdges.right||this.resizeEdges.left)&&(c=parseInt(this.actionObj.clone.style.height,10)),(0,e.setStyleAttribute)(a,{height:c+"px"})}this.renderDynamicElement(l,a,!0),this.actionObj.cloneElement.push(a)}}},t.prototype.renderDynamicElement=function(t,i,n){if(void 0===n&&(n=!1),t.querySelector("."+jt))t.querySelector("."+jt).appendChild(i);else{var r=(0,e.createElement)("div",{className:jt});r.appendChild(i),t.appendChild(r)}},t.prototype.createAppointmentElement=function(t,i){var n=(0,e.createElement)("div",{className:Xt,innerHTML:i});return this.parent.activeViewOptions.group.resources.length>0&&n.setAttribute("data-group-index",t.toString()),n},t.prototype.dynamicEventsRendering=function(t){var i=this;if((0,e.isNullOrUndefined)(this.parent.eventDragArea)){var n,r=this.parent.activeView.renderDates,a=[].slice.call(this.parent.element.querySelectorAll("."+$e)),s=this.parent.activeViewOptions.workDays;if(this.parent.activeViewOptions.group.resources.length>0){var o=(this.parent.virtualScrollModule&&this.parent.virtualScrollModule.isHorizontalScroll?this.parent.resourceBase.renderedResources:this.parent.resourceBase.lastResourceLevel).filter((function(e){return e.groupIndex===i.actionObj.groupIndex}));r=o[0].renderDates;var l="."+$e+'[data-group-index="'+this.actionObj.groupIndex+'"]';a=[].slice.call(this.parent.element.querySelectorAll(l)),s=o[0].workDays,n=o[0].groupOrder}if(this.monthEvent.dateRender=r,this.monthEvent.getSlotDates(s),this.resizeEdges.left||this.resizeEdges.right)for(var p=0,c=[].slice.call(this.parent.element.querySelectorAll("."+Si));p<c.length;p++){var h=c[p];(0,e.remove)(h)}for(var d=0,u=this.monthEvent.splitEvent(t,r);d<u.length;d++){var g=u[d],v=this.parent.getIndexOfDate(r,ve(g[this.monthEvent.fields.startTime])),m=g.data.count*this.actionObj.cellWidth-7,f=this.monthEvent.createAppointmentElement(g,this.actionObj.groupIndex,!0);f.setAttribute("drag","true"),(0,e.addClass)([f],Si),this.monthEvent.applyResourceColor(f,g,"backgroundColor",n),(0,e.setStyleAttribute)(f,{width:m+"px",border:"0px","pointer-events":"none"});var y=a[parseInt(v.toString(),10)];y&&(this.monthEvent.renderElement(y,f,!0),this.actionObj.cloneElement.push(f))}}},t.prototype.destroy=function(){!this.parent||this.parent&&this.parent.isDestroyed||(this.actionObj={},this.scrollArgs={},this.resizeEdges={left:!1,right:!1,top:!1,bottom:!1},this.scrollEdges={left:!1,right:!1,top:!1,bottom:!1})},t}(),Go=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Xo=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return Go(i,t),i.prototype.wireResizeEvent=function(t){for(var i=0,n=[].slice.call(t.querySelectorAll("."+Ei));i<n.length;i++){var r=n[i];e.EventHandler.add(r,e.Browser.touchStartEvent,this.resizeStart,this)}},i.prototype.resizeHelper=function(){if(this.parent.activeViewOptions.group.resources.length>0&&this.parent.activeViewOptions.group.allowGroupEdit)for(var e=0,t=this.actionObj.originalElement.length;e<t;e++){var i=this.createCloneElement(this.actionObj.originalElement[parseInt(e.toString(),10)]);this.actionObj.cloneElement[parseInt(e.toString(),10)]=i,this.actionObj.element===this.actionObj.originalElement[parseInt(e.toString(),10)]&&(this.actionObj.clone=i)}else this.actionObj.element&&(this.actionObj.clone=this.createCloneElement(this.actionObj.element)),this.actionObj.cloneElement=[this.actionObj.clone],this.actionObj.originalElement=[this.actionObj.element]},i.prototype.resizeStart=function(t){var i=this;if(!t||"touchstart"!==t.type||this.parent.uiStateValues.isTapHold&&(0,e.closest)(t.target,"."+Zt)){this.parent.eventBase.removeSelectedAppointmentClass(),this.actionObj.action="resize",this.actionObj.slotInterval=this.parent.activeViewOptions.timeScale.interval/this.parent.activeViewOptions.timeScale.slotCount,this.actionObj.interval=this.actionObj.slotInterval;var n=(0,e.closest)(t.target,"."+Ei);this.actionObj.element=(0,e.closest)(n,"."+Xt),this.actionObj.event=this.parent.eventBase.getEventByGuid(this.actionObj.element.getAttribute("data-guid"));var r=(0,e.extend)({},this.actionObj.event,null,!0),a={cancel:!1,data:r,element:this.actionObj.element,event:t,interval:this.actionObj.interval,scroll:{enable:!0,scrollBy:30,timeDelay:100}};this.parent.trigger(E,a,(function(a){if(!a.cancel){i.actionClass("addClass"),i.parent.uiStateValues.action=!0,i.resizeEdges={left:n.classList.contains(Vi),right:n.classList.contains(Ai),top:n.classList.contains(Ii),bottom:n.classList.contains(Mi)},i.actionObj.groupIndex=i.parent.uiStateValues.isGroupAdaptive?i.parent.uiStateValues.groupIndex:0;var s=i.parent.element.querySelector("."+$e);i.actionObj.cellWidth=i.parent.getElementWidth(s),i.actionObj.cellHeight=i.parent.getElementHeight(s);var o=i.parent.activeViewOptions.headerRows.map((function(e){return e.option}));if(i.parent.activeView.isTimelineView()&&o.length>0&&["Date","Hour"].indexOf(o.slice(-1)[0])<0){for(var l=i.parent.getContentTable().querySelector("tr"),p=0,c=0,h=[].slice.call(l.children);c<h.length;c++){var d=h[c];p+=parseInt(d.getAttribute("colspan"),10)}var u=l.getBoundingClientRect();i.actionObj.cellWidth=u.width/p,i.actionObj.cellHeight=u.height}var g=i.parent.eventBase.getPageCoordinates(t);i.actionObj.X=g.pageX,i.actionObj.Y=g.pageY,i.actionObj.groupIndex=parseInt(i.actionObj.element.getAttribute("data-group-index")||"0",10),i.actionObj.interval=a.interval,i.actionObj.scroll=a.scroll,i.actionObj.start=new Date(r[i.parent.eventFields.startTime].getTime()),i.actionObj.end=new Date(r[i.parent.eventFields.endTime].getTime()),i.actionObj.originalElement=i.getOriginalElement(i.actionObj.element),"Month"===i.parent.currentView&&(i.daysVariation=-1,i.monthEvent=new Ra(i.parent));var v=i.parent.element.querySelector("."+ri);if(i.scrollArgs={element:v,width:v.scrollWidth,height:v.scrollHeight},["Month","TimelineYear"].indexOf(i.parent.currentView)<0){var m=Math.round(i.scrollArgs.width/i.actionObj.cellWidth)*i.actionObj.cellWidth;i.scrollArgs.width=i.scrollArgs.width<m?m:i.scrollArgs.width}e.EventHandler.add(document,e.Browser.touchMoveEvent,i.resizing,i),e.EventHandler.add(document,e.Browser.touchEndEvent,i.resizeStop,i)}}))}},i.prototype.resizing=function(t){if(t&&"touchmove"===t.type&&t.preventDefault(),this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide(),0===this.parent.element.querySelectorAll("."+xi).length&&this.resizeHelper(),(0,e.isNullOrUndefined)(t.target)||!t.target.classList.contains(Qn)){var i=this.parent.eventBase.getPageCoordinates(t);if("Month"===this.parent.currentView||"TimelineYear"===this.parent.currentView){var n=document.documentElement,r=(window.pageXOffset||n.scrollLeft)-(n.clientLeft||0),a=(window.pageYOffset||n.scrollTop)-(n.clientTop||0);this.actionObj.pageX=i.pageX-r,this.actionObj.pageY=i.pageY-a}else this.actionObj.pageX=i.pageX,this.actionObj.pageY=i.pageY;this.updateScrollPosition(t),this.updateResizingDirection(t);var s={cancel:!1,data:(0,e.extend)({},this.actionObj.event,null,!0),element:this.actionObj.element,event:t,startTime:this.actionObj.start,endTime:this.actionObj.end};this.parent.group.resources.length>0&&(s.groupIndex=this.actionObj.groupIndex),this.parent.trigger(x,s)}},i.prototype.updateResizingDirection=function(t){if("Month"!==this.parent.currentView&&"TimelineYear"!==this.parent.currentView){var i=this.resizeValidation(t);if(this.resizeEdges.left){if(i){var n=this.getLeftRightStyles(t,!0);if(parseInt(n.width,10)<1)return;for(var r=0,a=this.actionObj.cloneElement;r<a.length;r++){var s=a[r];(0,e.setStyleAttribute)(s,n),(0,e.addClass)([s],Vi)}}this.horizontalResizing(!this.parent.enableRtl)}if(this.resizeEdges.right){if(i){var o=this.getLeftRightStyles(t,!1);if(parseInt(o.width,10)<1)return;for(var l=0,p=this.actionObj.cloneElement;l<p.length;l++){s=p[l];(0,e.setStyleAttribute)(s,o),(0,e.addClass)([s],Ai)}}this.horizontalResizing(this.parent.enableRtl)}if(this.resizeEdges.top){if(i){var c=this.getTopBottomStyles(t,!0);if(parseInt(c.height,10)<1)return;for(var h=0,d=this.actionObj.cloneElement;h<d.length;h++){s=d[h];(0,e.setStyleAttribute)(s,c),(0,e.addClass)([s],Ii)}}this.verticalResizing(!0)}if(this.resizeEdges.bottom){if(i){var u=this.getTopBottomStyles(t,!1);if(parseInt(u.height,10)<1)return;for(var g=0,v=this.actionObj.cloneElement;g<v.length;g++){s=v[g];(0,e.setStyleAttribute)(s,u),(0,e.addClass)([s],Mi)}}this.verticalResizing(!1)}}else this.monthResizing()},i.prototype.monthResizing=function(){if(this.removeCloneElement(),!(0,e.isNullOrUndefined)(this.actionObj.pageX)&&!(0,e.isNullOrUndefined)(this.actionObj.pageY)){var t=document.elementFromPoint(this.actionObj.pageX,this.actionObj.pageY);if(!(0,e.isNullOrUndefined)(t)){var i=this.parent.getDateFromElement(t),n=!(this.parent.activeViewOptions.group.resources.length>0)||parseInt(t.getAttribute("data-group-index"),10)===this.actionObj.groupIndex,r=new Date(this.actionObj.event[this.parent.eventFields.startTime].getTime()),a=new Date(this.actionObj.event[this.parent.eventFields.endTime].getTime());if(!this.parent.enableRtl&&this.resizeEdges.left||this.parent.enableRtl&&this.resizeEdges.right||this.resizeEdges.top?r=i:(!this.parent.enableRtl&&this.resizeEdges.right||this.parent.enableRtl&&this.resizeEdges.left||this.resizeEdges.bottom)&&(a=ye(i,1)),n&&r<a){this.actionObj.start=r,this.actionObj.end=a;var s=this.getUpdatedEvent(this.actionObj.start,this.actionObj.end,this.actionObj.event);"TimelineYear"===this.parent.currentView?this.yearEventsRendering(s):this.dynamicEventsRendering(s),this.updateOriginalElement(this.actionObj.clone)}}}},i.prototype.yearEventsRendering=function(t){for(var i=0,n=[].slice.call(this.parent.element.querySelectorAll("."+Si));i<n.length;i++){var r=n[i];(0,e.remove)(r)}var a=new Date(t[this.parent.eventFields.endTime]),s=0;0===this.parent.activeViewOptions.group.resources.length&&(s=this.getMonthDiff(t[this.parent.eventFields.startTime],ye(a,-1)));for(var o=0;o<=s;o++){var l=void 0;0===this.parent.activeViewOptions.group.resources.length?l=this.getEventCount(t,this.actionObj.start.getMonth()+o):(l=(0,e.extend)({},t,null,!0),a=this.resizeEdges.left||this.resizeEdges.right?ye(a,-1):a,l.count=this.getMonthDiff(t[this.parent.eventFields.startTime],a)+1),this.dynamicYearlyEventsRendering(l,!0)}},i.prototype.getMonthDiff=function(e,t){var i;return i=12*(t.getFullYear()-e.getFullYear()),i-=e.getMonth(),(i+=t.getMonth())<=0?0:i},i.prototype.getEventCount=function(t,i){var n=(0,e.extend)({},t,null,!0),r=n[this.parent.eventFields.startTime],a=n[this.parent.eventFields.endTime],s=new Date(this.parent.selectedDate.getFullYear(),i,1),o=ye(new Date(this.parent.selectedDate.getFullYear(),i+1,0),1),l=1;return r.getTime()<s.getTime()&&(n[this.parent.eventFields.startTime]=s),a.getTime()>o.getTime()&&(n[this.parent.eventFields.endTime]=o),0===this.parent.activeViewOptions.group.resources.length&&(l=Math.ceil((n[this.parent.eventFields.endTime].getTime()-n[this.parent.eventFields.startTime].getTime())/ie)),n.count=l,n},i.prototype.resizeStop=function(t){var i=this;e.EventHandler.remove(document,e.Browser.touchMoveEvent,this.resizing),e.EventHandler.remove(document,e.Browser.touchEndEvent,this.resizeStop),clearInterval(this.actionObj.scrollInterval),this.actionObj.scrollInterval=null,this.actionObj.action=null,this.removeCloneElementClasses(),this.removeCloneElement(),this.actionClass("removeClass"),this.parent.uiStateValues.action=this.parent.uiStateValues.isTapHold=!1;var n={cancel:!1,data:this.getChangedData(),element:this.actionObj.element,event:t};this.parent.trigger(V,n,(function(e){e.cancel||i.parent.eventBase.checkOverlap(e.data)||(i.parent.isSpecificResourceEvents()&&(i.parent.crudModule.crudObj.sourceEvent=[i.parent.resourceBase.lastResourceLevel[parseInt(e.element.getAttribute("data-group-index"),10)]],i.parent.crudModule.crudObj.targetEvent=i.parent.crudModule.crudObj.sourceEvent,i.parent.crudModule.crudObj.isCrudAction=!0),i.saveChangedData(e))}))},i.prototype.verticalResizing=function(t){var i=this.actionObj.clone.offsetTop;t||(i+=this.actionObj.clone.offsetHeight);var n=i/this.actionObj.cellHeight*this.actionObj.slotInterval,r=this.actionObj.clone.offsetParent;if(!(0,e.isNullOrUndefined)(r)){var a=ve(this.parent.getDateFromElement(r));a.setHours(this.parent.activeView.getStartHour().getHours()),a.setMinutes(n+this.parent.activeView.getStartHour().getMinutes()),t?this.actionObj.start=this.calculateIntervalTime(a):this.actionObj.end=this.calculateIntervalTime(a),this.updateTimePosition(a)}},i.prototype.horizontalResizing=function(t){var i,n=new Date(this.actionObj.event[this.parent.eventFields.startTime].getTime()),r=new Date(this.actionObj.event[this.parent.eventFields.endTime].getTime()),a=this.parent.currentView,s="TimelineMonth"===this.parent.currentView;if(this.parent.activeView.isTimelineView()){var o=this.parent.getContentTable().querySelector("tr");if(this.parent.activeViewOptions.headerRows.length>0){var l=this.parent.activeViewOptions.headerRows.map((function(e){return e.option}));a=l.slice(-1)[0],s&&"Hour"===a&&(a=l.slice(-2)[0]||"Month")}i=t?n:r;var p=0,c=[].slice.call(o.children),h=!1,d=this.actionObj.cellWidth/(this.parent.activeViewOptions.timeScale.interval/this.parent.activeViewOptions.timeScale.slotCount),u=parseFloat(this.parent.enableRtl?this.actionObj.clone.style.right:this.actionObj.clone.style.left);if(u=Math.round(u/d)*d,-1!==["Year","Month","Week","Date"].indexOf(a)){for(var g=0,v=0,m=c;v<m.length;v++){var f=m[v];g+=parseInt(f.getAttribute("colspan"),10)}var y=this.parent.enableRtl?parseInt(this.actionObj.clone.style.right,10):parseInt(this.actionObj.clone.style.left,10);y=Math.round(y/this.actionObj.cellWidth)*this.actionObj.cellWidth,t||(y+=this.parent.getElementWidth(this.actionObj.clone)-this.actionObj.cellWidth),p=s?Math.floor(y/Math.floor(this.parent.getElementWidth(o)/g)):Math.round(y/(this.parent.getElementWidth(o)/g)),h=(p=t?p:s?p+1:p)===c.length,p=p<0?0:p>=g?g-1:p}else{var T=this.actionObj.cellWidth;if(p=t?Math.round(u/this.actionObj.cellWidth):Math.ceil((u+(this.parent.getElementWidth(this.actionObj.clone)-T))/this.actionObj.cellWidth),this.parent.enableRtl){var w=Math.round(u/this.actionObj.cellWidth)*this.actionObj.cellWidth+(t?0:this.parent.getElementWidth(this.actionObj.clone)-this.actionObj.cellWidth);p=Math.floor(w/this.actionObj.cellWidth)}h=p===c.length,p=this.getIndex(p)}var D=void 0;if(D=-1!==["Year","Month","Week","Date"].indexOf(a)?new Date(this.parent.activeView.renderDates[parseInt(p.toString(),10)].getTime()):this.parent.getDateFromElement(o.children[parseInt(p.toString(),10)]),-1===["TimelineMonth","Year","Month","Week","Date"].indexOf(a)&&this.parent.activeViewOptions.timeScale.enable){t||(u+=this.parent.getElementWidth(this.actionObj.clone));var b=Math.floor(this.actionObj.slotInterval/this.actionObj.cellWidth*(u-Math.floor(u/this.actionObj.cellWidth)*this.actionObj.cellWidth));b=h||!t&&0===b?this.actionObj.slotInterval:b,i=new Date(D.getTime()),i=new Date(D.getTime()+b*ne),this.updateTimePosition(i)}else i=new Date(D.setHours(i.getHours(),i.getMinutes(),i.getSeconds()))}else{var S=(0,e.closest)(this.actionObj.clone,"td").cellIndex,C=Math.ceil((t?this.parent.getElementWidth(this.actionObj.element):0)/this.actionObj.cellWidth)*this.actionObj.cellWidth,O=(g=Math.ceil((this.parent.getElementWidth(this.actionObj.clone)-C)/this.actionObj.cellWidth),o=(0,e.closest)(this.actionObj.clone,"tr"),t?S-g:S+g-1);O=this.getIndex(O),i=this.parent.getDateFromElement(o.children[parseInt(O.toString(),10)]),t?i.setHours(n.getHours(),n.getMinutes(),n.getSeconds()):i.setHours(r.getHours(),r.getMinutes(),r.getSeconds())}var E=-1!==["TimelineMonth","Year","Month","Week","WorkWeek","Date","Day"].indexOf(a)||!this.parent.activeViewOptions.timeScale.enable;if(t)r.getTime()-i.getTime()<=0&&(i=E?ve(r):n),this.actionObj.start=E?i:this.calculateIntervalTime(i);else{var x=E&&0===i.getHours()&&0===i.getMinutes()?ye(i,1):i;E&&x.getTime()-n.getTime()<=0&&(x=ye(ve(n),1)),this.actionObj.end=E?x:this.calculateIntervalTime(x)}},i.prototype.getTopBottomStyles=function(t,i){var n=this.parent.element.querySelector("."+ri),r=this.actionObj.cellHeight/this.actionObj.slotInterval*this.actionObj.interval,a=i?this.actionObj.element.offsetHeight+(this.actionObj.Y-this.actionObj.pageY):this.actionObj.element.offsetHeight+(this.actionObj.pageY-this.actionObj.Y),s=i?this.actionObj.element.offsetTop-(this.actionObj.Y-this.actionObj.pageY):this.actionObj.clone.offsetTop;return a=s<0||this.actionObj.clone.offsetTop+this.actionObj.clone.offsetHeight>this.scrollArgs.height?this.actionObj.clone.offsetHeight:a,s=s<0?0:s,a=(s=i?Math.floor(s/r)*r:s)+a>=n.scrollHeight?n.scrollHeight-s:Math.ceil(a/r)*r,!i&&this.actionObj.clone.offsetTop+a>=this.parent.getContentTable().offsetHeight&&(a=this.parent.getContentTable().offsetHeight-this.actionObj.clone.offsetTop),{height:(0,e.formatUnit)(a<this.actionObj.cellHeight?Math.floor(a/r)*r:a),top:(0,e.formatUnit)(a<this.actionObj.cellHeight&&i?Math.ceil(s/r)*r:s),left:"0px",right:"0px",width:"100%"}},i.prototype.getLeftRightStyles=function(t,i){var n={},r=this.parent.activeView.isTimelineView(),a=["TimelineDay","TimelineWeek","TimelineWorkWeek"].indexOf(this.parent.currentView)>-1&&this.parent.activeViewOptions.timeScale.enable,s=this.actionObj.cellWidth/this.actionObj.slotInterval*this.actionObj.interval,o=i?this.actionObj.X-this.actionObj.pageX:this.actionObj.pageX-this.actionObj.X,l=r?Math.round(this.parent.getElementWidth(this.actionObj.element)/this.actionObj.cellWidth)*this.actionObj.cellWidth:"Month"===this.parent.currentView?this.parent.getElementWidth(this.actionObj.element):Math.ceil(this.parent.getElementWidth(this.actionObj.element)/this.actionObj.cellWidth)*this.actionObj.cellWidth,p=l+Math.ceil(o/this.actionObj.cellWidth)*this.actionObj.cellWidth,c=this.parent.enableRtl?parseInt(this.actionObj.element.style.right,10):this.actionObj.clone.offsetLeft;if(c=Math.round(c/s)*s,a){if(p=l+Math.ceil(o/s)*s,!i){var h=(+parseFloat(this.actionObj.element.style[this.parent.enableRtl?"right":"left"])).toFixed(1),d=Math.round(l/s)*s;h===c.toFixed(1)&&d===l||(p=Math.round((c+p)/s)*s-c)}this.actionObj.event[this.parent.eventFields.isAllDay]=!1}var u=!i&&p+this.actionObj.clone.offsetLeft>this.scrollArgs.width?this.parent.getElementWidth(this.actionObj.clone):(this.actionObj.cellWidth,p);if(this.parent.enableRtl){var g=r?parseInt(this.actionObj.element.style.right,10):-(p-this.actionObj.cellWidth);g=r?g:i||g>0?0:g,r&&!i&&(g=Math.round(g/s)*s,(g-=Math.ceil((this.actionObj.pageX-this.actionObj.X)/s)*s)<0&&(g=parseInt(this.actionObj.clone.style.right,10),u=parseInt(this.actionObj.clone.style.width,10))),g=g>=this.scrollArgs.width?this.scrollArgs.width-this.actionObj.cellWidth:g,n.right=(0,e.formatUnit)(g),u=u+g>this.scrollArgs.width?this.parent.getElementWidth(this.actionObj.clone):u}else{var v=i?this.actionObj.element.offsetLeft-(this.actionObj.X-this.actionObj.pageX):this.parent.enableRtl?this.actionObj.element.offsetLeft:0;r&&(v=i?v:parseInt(this.actionObj.clone.style.left,10),v=this.parent.enableRtl?i?v:this.actionObj.pageX<this.actionObj.X-this.parent.getElementWidth(this.actionObj.clone)?parseInt(this.actionObj.clone.style.right,10):v:i&&this.actionObj.pageX>this.actionObj.X+this.parent.getElementWidth(this.actionObj.clone)&&this.parent.getElementWidth(this.actionObj.clone)===this.actionObj.cellWidth?parseInt(this.actionObj.clone.style.left,10):v);var m=v;(v=r?a?i?this.actionObj.element.offsetLeft-Math.ceil((this.actionObj.element.offsetLeft-v)/s)*s:v:Math.floor(v/this.actionObj.cellWidth)*this.actionObj.cellWidth:Math.ceil(Math.abs(v)/this.actionObj.cellWidth)*this.actionObj.cellWidth)<0&&(r&&i&&v%s?(v=parseInt(this.actionObj.clone.style.left,10),u=parseInt(this.actionObj.clone.style.width,10)):(v=0,u=this.parent.getElementWidth(this.actionObj.clone)));var f=Math.ceil(this.parent.getElementWidth(this.actionObj.clone)/this.actionObj.cellWidth)*this.actionObj.cellWidth;i&&(n.left=(0,e.formatUnit)(r?v:i?m<0?-v:Math.ceil((l-f)/this.actionObj.cellWidth)*this.actionObj.cellWidth:v))}return n.width=(0,e.formatUnit)(u),n},i.prototype.resizeValidation=function(e){var t=this.parent.eventBase.getPageCoordinates(e),i=this.getContentAreaDimension(),n=this.parent.activeView.isTimelineView()&&this.parent.activeViewOptions.timeScale.enable,r=this.actionObj.cellWidth,a=!1;return this.resizeEdges.left&&(t.pageX<i.leftOffset&&t.pageX>=i.left&&n&&(r=0),a=t.pageX-r>=i.left),this.resizeEdges.right&&(t.pageX>i.rightOffset&&t.pageX<=i.right&&n&&(r=0),a=t.pageX+r<=i.right),this.resizeEdges.top&&(a=this.actionObj.clone.offsetTop>=i.top),this.resizeEdges.bottom&&(a=this.actionObj.clone.offsetTop+this.actionObj.clone.offsetHeight<=this.scrollArgs.height),a},i.prototype.getModuleName=function(){return"resize"},i}(_o),Qo=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ko=function(t){function i(e){var i=t.call(this,e,"day")||this;return i.isResource=!1,i}return Qo(i,t),i.prototype.renderAppointments=function(){this.parent.dragAndDropModule&&this.parent.dragAndDropModule.setDragArea(),this.fields=this.parent.eventFields;for(var t="Year"===this.parent.currentView?"."+$e+" ."+Xt:"."+jt+",."+Bi,i=0,n=[].slice.call(this.parent.element.querySelectorAll(t));i<n.length;i++){var r=n[i];(0,e.remove)(r)}this.renderedEvents=[],"Year"===this.parent.currentView?this.yearViewEvents():(this.removeCellHeight(),this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive?(this.isResource=!0,this.timelineResourceEvents()):this.timelineYearViewEvents()),this.parent.renderTemplates(),this.parent.notify(_,{})},i.prototype.yearViewEvents=function(){for(var t=this.getMonths(),i=0,n=t;i<n.length;i++)for(var r=n[i],a=".e-month-calendar:nth-child("+(t.indexOf(r)+1)+") td.e-work-cells",s=[].slice.call(this.parent.element.querySelectorAll(a)),o=new Date(this.parent.selectedDate.getFullYear(),r,1),l=this.parent.calendarUtil.getMonthStartDate(new Date(o.getTime())),p=this.parent.calendarUtil.getMonthEndDate(new Date(o.getTime())),c=le(l,this.parent.activeViewOptions.firstDayOfWeek),h=ye(pe(p,this.parent.activeViewOptions.firstDayOfWeek),1),d=0;c.getTime()<h.getTime();d++){var u=ve(new Date(c.getTime())),g=ye(new Date(u.getTime()),1);if(c=ye(new Date(c.getTime()),1),this.parent.isMinMaxDate(u))if(this.parent.eventBase.filterEvents(u,g).length>0){var v=s[parseInt(d.toString(),10)];v&&v.appendChild((0,e.createElement)("div",{className:Xt}))}}},i.prototype.timelineYearViewEvents=function(){var t=this,i=this.parent.element.querySelector("."+$e+":not(."+st+")");this.cellWidth=this.parent.getElementWidth(i),this.cellHeader=Ie(i.querySelector("."+ui));var n=this.parent.element.querySelector("."+vt);this.eventHeight=this.parent.getElementHeightFromClass(n,Xt);var r="."+hr+" tbody tr,."+Tt+" tbody tr,."+Je+" tbody tr";this.addCellHeight(r,this.eventHeight,2,this.cellHeader,this.moreIndicatorHeight);for(var a=[].slice.call(this.parent.element.querySelectorAll("."+Gt)),s=this.getMonths(),o=this.parent.activeViewOptions.group.resources.length>0&&this.parent.uiStateValues.isGroupAdaptive?this.parent.uiStateValues.groupIndex:void 0,l=0;l<s.length;l++){var p=a[parseInt(l.toString(),10)],c=l+1,h=(0,e.createElement)("div",{className:jt});p.appendChild(h);var d=new Date(this.parent.selectedDate.getFullYear(),s[parseInt(l.toString(),10)],1),u=new Date(d.getFullYear(),d.getMonth()+1,0),g=d.getDay(),v=[];for("Horizontal"===this.parent.activeViewOptions.orientation&&(this.renderedEvents=[]);d.getTime()<=u.getTime();){var m=void 0,f=void 0;if("Vertical"===this.parent.activeViewOptions.orientation){var y=a[parseInt(g.toString(),10)];c=g+1,(h=y.querySelector("."+jt))||(h=(0,e.createElement)("div",{className:jt}),y.appendChild(h)),this.parent.enableRtl?f=l*this.cellWidth:m=l*this.cellWidth}else this.parent.enableRtl?f=(g+d.getDate()-1)*this.cellWidth:m=(g+d.getDate()-1)*this.cellWidth;var T=this.parent.element.querySelector(".e-content-wrap tr:nth-child("+c+") td");this.cellHeight=T.offsetHeight;var w=ve(new Date(d.getTime())),D=ye(new Date(w.getTime()),1),b=void 0;this.parent.uiStateValues.isGroupAdaptive&&(b=this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]);var S=this.parent.eventBase.filterEvents(w,D,void 0,b);S=this.parent.eventBase.sortByDateTime(S);for(var C=function(t,i){var n=(0,e.extend)({},S[parseInt(t.toString(),10)],null,!0);O.updateSpannedEvents(n,w,D);var r=O.getIndex(w);n.Index=r;var a=O.cellHeader+O.eventHeight*(r+1)+2+O.moreIndicatorHeight,s=O.cellHeight-O.cellHeader-O.moreIndicatorHeight,p=Math.floor(s/(O.eventHeight+2)),c=O.parent.rowAutoHeight?1:O.parent.activeViewOptions.maxEventsPerRow,u=O.parent.activeViewOptions.maxEventsPerRow?i-c:i-p<=0?1:i-p;if("Horizontal"===O.parent.activeViewOptions.orientation){var y=O.renderedEvents.filter((function(e){return e.Guid===n.Guid})),b=v.filter((function(e){return e.Guid===n.Guid}));if(y.length>0&&y[0].MoreIndicator||b.length>0&&b[0].MoreIndicator){var C="Horizontal"===O.parent.activeViewOptions.orientation?l:g;return O.renderMoreIndicator(h,u,w,C,m,f,o),"continue"}if(y.length>0||b.length>0)return"continue"}var E=O.maxOrIndicator||r<c||O.cellHeight>a;if(O.parent.rowAutoHeight||E||O.cellHeight>a)O.renderEvent(h,n,l,m,f,d,g),(O.parent.rowAutoHeight||O.cellHeight>a)&&O.updateCellHeight(T,a),v.push(n);else{C="Horizontal"===O.parent.activeViewOptions.orientation?l:g;O.renderMoreIndicator(h,u,w,C,m,f,o),"Horizontal"===O.parent.activeViewOptions.orientation&&(n.MoreIndicator=!0,O.renderedEvents.push(n),v.push(n))}},O=this,E=0,x=S.length;E<x;E++)C(E,x);d=ye(new Date(d.getTime()),1),"Vertical"===this.parent.activeViewOptions.orientation&&(g++,this.renderedEvents=[])}}if(this.parent.rowAutoHeight&&"Vertical"===this.parent.activeViewOptions.orientation){var V=[].slice.call(this.parent.element.querySelectorAll("."+Gt)),A=[].slice.call(this.parent.element.querySelectorAll("."+Je+" tbody tr"));V.forEach((function(e,i){var n=[].slice.call(e.querySelectorAll("."+Xt)),r=A[parseInt(i.toString(),10)].offsetTop+t.cellHeader+2;n.forEach((function(e){var i=parseInt(e.getAttribute("data-index"),10);e.style.top=r+i*t.eventHeight+"px",e.removeAttribute("data-index")}))}))}},i.prototype.updateSpannedEvents=function(e,t,i){var n=this.isResource&&"Vertical"===this.parent.activeViewOptions.orientation||!this.isResource&&"Horizontal"===this.parent.activeViewOptions.orientation,r={isLeft:!0,isRight:!0,isBottom:!0,isTop:!0};t.getTime()<=e[this.fields.startTime].getTime()&&(n?r.isLeft=!1:r.isTop=!1),(i.getTime()>=e[this.fields.endTime].getTime()||n&&!this.isResource&&ye(i,-1).getMonth()===e[this.fields.endTime].getMonth()||n&&this.isResource&&i.getTime()<=e[this.fields.endTime].getTime())&&(n?r.isRight=!1:r.isBottom=!1),e.data=r},i.prototype.timelineResourceEvents=function(){var e=this,t=this.parent.element.querySelector("."+ri),i=t.offsetWidth>t.clientWidth,n=this.parent.element.querySelector("."+$e);this.cellWidth=this.parent.getElementWidth(n),this.cellHeader=0;var r=this.parent.element.querySelector("."+vt);this.eventHeight=this.parent.getElementHeightFromClass(r,Xt);var a="."+hr+" tbody tr,."+Tt+" tbody tr,."+Je+" tbody tr";this.addCellHeight(a,this.eventHeight,2,this.cellHeader,this.moreIndicatorHeight);var s=[].slice.call(this.parent.element.querySelectorAll("."+Gt)),o=this.parent.uiStateValues.isGroupAdaptive?[this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]]:this.parent.activeViewOptions.allowVirtualScrolling?this.parent.resourceBase.renderedResources:this.parent.resourceBase.lastResourceLevel,l=this.getMonths();if("Horizontal"===this.parent.activeViewOptions.orientation)for(var p=0;p<l.length;p++)for(var c=new Date(this.parent.selectedDate.getFullYear(),l[parseInt(p.toString(),10)],1),h=0,d=o.length;h<d;h++)this.renderedEvents=[],this.renderResourceEvent(s[parseInt(p.toString(),10)],o[parseInt(h.toString(),10)],p,h,c);else for(h=0,d=o.length;h<d;h++){this.renderedEvents=[];for(p=0;p<l.length;p++){c=new Date(this.parent.selectedDate.getFullYear(),l[parseInt(p.toString(),10)],1);this.renderResourceEvent(s[parseInt(h.toString(),10)],o[parseInt(h.toString(),10)],p,h,c)}}if(this.parent.rowAutoHeight&&!i&&t.offsetWidth>t.clientWidth){[].slice.call(this.parent.element.querySelectorAll("."+Xt)).forEach((function(e){e.style.removeProperty("left"),e.style.removeProperty("right")}));var u=[].slice.call(this.parent.element.querySelectorAll("."+Gt)),g=this.parent.element.querySelector("."+Je),v=[].slice.call(g.querySelectorAll("tbody tr"));u.forEach((function(t,i){var n=[].slice.call(t.children),r=v[parseInt(i.toString(),10)];n.forEach((function(t,i){var n=r.querySelector("td:nth-child("+(i+1)+")"),a=[].slice.call(t.children),s=e.parent.getElementWidth(n),o=n.offsetLeft;if(e.parent.enableRtl){var l=g.offsetWidth-o-n.offsetWidth;a.forEach((function(e){e.style.width=Math.floor(parseInt(e.style.width,10)/s)*s+"px",e.style.right=l+"px"}))}else a.forEach((function(e){e.style.width=Math.floor(parseInt(e.style.width,10)/s)*s+"px",e.style.left=o+"px"}))}))}))}},i.prototype.renderResourceEvent=function(t,i,n,r,a){var s=(0,e.createElement)("div",{className:jt});t.appendChild(s);var o=ye(he(new Date(a.getTime())),1),l=this.parent.eventBase.filterEvents(a,o,void 0,i),p="Vertical"===this.parent.activeViewOptions.orientation?r:n,c=this.parent.element.querySelector(".e-content-wrap tr:nth-child("+(p+1)+") td");this.cellHeight=c.offsetHeight,this.groupOrder=i.groupOrder;for(var h=[],d=function(t){var i=l[parseInt(t.toString(),10)],o=void 0,p=(0,e.extend)({},i,null,!0);if(u.parent.activeViewOptions.group.resources.length>0){var d=u.isSpannedEvent(p,a);o=u.getIndex(d[u.fields.startTime]),p.Index=o}else o=u.getIndex(p[u.fields.startTime]),p.Index=o;var g=u.cellHeader+u.eventHeight*(t+1)+2+u.moreIndicatorHeight,v="Vertical"===u.parent.activeViewOptions.orientation?n*u.cellWidth:r*u.cellWidth;if(!u.parent.isMinMaxDate(p[u.fields.startTime]))return{value:void 0};if("Vertical"===u.parent.activeViewOptions.orientation&&u.parent.activeViewOptions.group.resources.length>0){var m=u.renderedEvents.filter((function(e){return e.Guid===p.Guid})),f=h.filter((function(e){return e.Guid===p.Guid}));if(m.length>0||f.length>0)return"continue"}if(!(u.parent.rowAutoHeight||u.cellHeight>g)){var y="Horizontal"===u.parent.activeViewOptions.orientation?n:r;if(u.renderMoreIndicator(s,l.length-t,a,y,v,v,r),"Horizontal"===u.parent.activeViewOptions.orientation)for(var T=r;T<l.length;T++)u.renderedEvents.push((0,e.extend)({},l[parseInt(T.toString(),10)],{Index:o+T},!0));return"break"}u.renderEvent(s,p,n,v,v,a,r),u.updateCellHeight(c,g),h.push(p)},u=this,g=0;g<l.length;g++){var v=d(g);if("object"==typeof v)return v.value;if("break"===v)break}},i.prototype.renderEvent=function(t,i,n,r,a,s,o){var l,p,c=this,h=this.isSpannedEvent(i,s),d=this.createEventElement(h);if(1===h.isSpanned.count){var u=ye(h[this.fields.endTime],-1);h[this.fields.endTime]=u>h[this.fields.startTime]?u:h[this.fields.endTime]}if(!(h[this.fields.startTime]>h[this.fields.endTime])){"Horizontal"===this.parent.activeViewOptions.orientation?(p=n+1,h[this.fields.startTime].getTime()===h[this.fields.endTime].getTime()&&(h.isSpanned.count=1),l=h.isSpanned.count*this.cellWidth):(p=o+1,l=this.isResource?h.isSpanned.count*this.cellWidth:this.cellWidth);var g=this.parent.element.querySelector(".e-content-wrap tr:nth-child("+p+") td").offsetTop+this.cellHeader+this.eventHeight*h.Index+2;(0,e.setStyleAttribute)(d,{width:l+"px",height:this.eventHeight+"px",left:r+"px",right:a+"px",top:g+"px"}),!this.isResource&&this.parent.rowAutoHeight&&"Vertical"===this.parent.activeViewOptions.orientation&&d.setAttribute("data-index",h.Index.toString());var v={data:h,element:d,cancel:!1,type:"event"};this.parent.trigger(y,v,(function(i){i.cancel||(t.appendChild(d),c.wireAppointmentEvents(d,h),(c.parent.activeViewOptions.group.resources.length>0||"Vertical"===c.parent.activeViewOptions.orientation||(h.isSpanned.isRight||h.isSpanned.isLeft)&&"Horizontal"===c.parent.activeViewOptions.orientation||!h.isSpanned.isRight)&&c.renderedEvents.push((0,e.extend)({},h,null,!0)))}))}},i.prototype.renderMoreIndicator=function(t,i,n,r,a,s,o){if(0!==this.parent.activeViewOptions.group.resources.length||!t.querySelector('[data-start-date="'+n.getTime()+'"]')){var l;l=this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive?ye(he(new Date(n.getTime())),1):ye(new Date(n.getTime()),1);var p=this.getMoreIndicatorElement(i,n,l),c=this.parent.element.querySelector(".e-content-wrap tr:nth-child("+(r+1)+")").offsetTop+(this.cellHeight-this.moreIndicatorHeight);a=Math.floor(a/this.cellWidth)*this.cellWidth,s=Math.floor(s/this.cellWidth)*this.cellWidth,(0,e.setStyleAttribute)(p,{width:this.cellWidth+"px",left:a+"px",right:s+"px",top:c+"px"}),(0,e.isNullOrUndefined)(o)||p.setAttribute("data-group-index",o.toString()),t.appendChild(p),e.EventHandler.add(p,"click",this.moreIndicatorClick,this)}},i.prototype.createEventElement=function(t){var i=t[this.fields.subject]||this.parent.eventSettings.fields.subject.default||this.parent.localeObj.getConstant("addTitle"),n=(0,e.createElement)("div",{className:Xt,attrs:{"data-id":"Appointment_"+t[this.fields.id],"data-guid":t.Guid,role:"button",tabindex:"0","aria-disabled":this.parent.eventBase.getReadonlyAttribute(t),"aria-label":this.parent.getAnnouncementString(t)}});if(this.cssClass&&(0,e.addClass)([n],this.cssClass),t[this.fields.isReadonly]&&(0,e.addClass)([n],cr),this.parent.activeViewOptions.group.resources.length>0){var r=this.getGroupIndexFromEvent(t);n.setAttribute("data-group-index",r.toString())}var a=[],s=(0,e.extend)({},t,null,!0);if(this.parent.activeViewOptions.eventTemplate){var o=this.parent.element.id+"_"+this.parent.activeViewOptions.eventTemplateName+"eventTemplate";a=this.parent.getAppointmentTemplate()(s,this.parent,"eventTemplate",o,!1,void 0,void 0,this.parent.root)}else{var l=t[this.fields.location]||this.parent.eventSettings.fields.location.default||"",p=(0,e.createElement)("div",{className:Cn,innerHTML:i+(l?"; "+l:"")}),c=(0,e.createElement)("div",{className:ti+(this.parent.isAdaptive?" "+Ge:""),innerHTML:this.parent.getTimeString(s[this.fields.startTime])}),h=(0,e.createElement)("div",{className:ti+(this.parent.isAdaptive?" "+Ge:""),innerHTML:this.parent.getTimeString(s[this.fields.endTime])});(0,e.addClass)([p],"e-text-center"),t[this.fields.isAllDay]?a=[p]:s.isLeft||s.isRight?(s.isLeft||a.push(c),a.push(p),s.isRight||a.push(h)):a=[c,p,h]}var d=(0,e.createElement)("div",{className:Jt});return(0,e.append)(a,d),n.appendChild(d),this.parent.eventBase.renderSpannedIcon(n,t.isSpanned),this.renderResizeHandler(n,t.data,t[this.fields.isReadonly]),this.applyResourceColor(n,s,"backgroundColor",this.groupOrder),n},i.prototype.isSpannedEvent=function(t,i){var n=new Date(i.getFullYear(),i.getMonth(),1),r=ye(new Date(i.getFullYear(),i.getMonth()+1,0),1),a=(0,e.extend)({},t,null,!0),s=a[this.fields.startTime],o=a[this.fields.endTime],l={isLeft:!1,isRight:!1,count:1},p=new Date(this.parent.selectedDate.getFullYear(),this.parent.firstMonthOfYear,1),c=Te(p,this.parent.monthsCount);if(this.isResource&&this.updateSpannedEvents(t,n,r),"Vertical"===this.parent.activeViewOptions.orientation&&this.parent.activeViewOptions.group.resources.length>0){this.updateSpannedEventDetails(s,o,p,c,a,l);var h=a[this.fields.startTime],d=new Date(a[this.fields.endTime]-1);l.count=d.getMonth()-h.getMonth()+this.parent.monthsCount*(d.getFullYear()-h.getFullYear())+1}else if(this.updateSpannedEventDetails(s,o,n,r,a,l),0===this.parent.activeViewOptions.group.resources.length||this.parent.uiStateValues.isGroupAdaptive){var u=ve(a[this.fields.endTime]).getTime(),g=ve(a[this.fields.startTime]).getTime();(t[this.fields.isAllDay]&&u===t[this.fields.endTime].getTime()||l.isRight)&&(u=ye(new Date(u),-1).getTime()),l.count=Math.round((u-g)/ie)+1}return a.isSpanned=l,ve(s).getTime()<ve(this.parent.minDate).getTime()&&(a[this.fields.startTime]=this.parent.minDate),ve(o).getTime()>ve(this.parent.maxDate).getTime()&&(a[this.fields.endTime]=this.parent.maxDate),a},i.prototype.updateSpannedEventDetails=function(e,t,i,n,r,a){e.getTime()<i.getTime()&&(r[this.fields.startTime]=i,a.isLeft=!0),t.getTime()>n.getTime()&&(r[this.fields.endTime]=n,a.isRight=!0)},i.prototype.getOverlapEvents=function(e,t){var i,n,r=[];if(this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive){var a=this.parent.calendarUtil.getMonthStartDate(new Date(e.getTime())),s=ye(this.parent.calendarUtil.getMonthEndDate(new Date(e.getTime())),-1);i=ve(new Date(a.getTime())).getTime(),n=ve(new Date(s.getTime())).getTime()}else this.parent.rowAutoHeight?(i=ve(new Date(e.getTime())).getTime(),n=ye(ve(new Date(e.getTime())),1).getTime()):i=n=ve(new Date(e.getTime())).getTime();for(var o=0,l=t;o<l.length;o++){var p=l[o],c=new Date(p[this.fields.startTime].getTime()),h=new Date(p[this.fields.endTime].getTime()),d=p[this.fields.isAllDay]?ve(h).getTime()>i:ve(h).getTime()>=i;(ve(c).getTime()<=i&&d||ve(c).getTime()>=i&&ve(h).getTime()<=n||"Vertical"===this.parent.activeViewOptions.orientation&&ve(c).getTime()>=i&&ve(h).getTime()>=n)&&r.push(p)}return r},i.prototype.getMonths=function(){var e=this;return Array.apply(null,{length:this.parent.monthsCount}).map((function(t,i){return e.parent.firstMonthOfYear+i}))},i.prototype.removeCellHeight=function(){for(var e="."+hr+" tbody tr,."+Tt+" tbody tr,."+Je+" tbody tr",t=0,i=[].slice.call(this.element.querySelectorAll(e));t<i.length;t++){i[t].firstElementChild.style.height=""}},i.prototype.destroy=function(){t.prototype.destroy.call(this),this.parent=null},i}(Pa),Zo=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Jo=function(t){function i(){var e=null!==t&&t.apply(this,arguments)||this;return e.widthUptoCursorPoint=0,e.heightUptoCursorPoint=0,e.cursorPointIndex=0,e.isHeaderRows=!1,e.isTimelineDayProcess=!1,e.widthPerMinute=0,e.heightPerMinute=0,e.minDiff=0,e.isStepDragging=!1,e.isMorePopupOpened=!1,e.isAllDayDrag=!1,e.isMultiSelect=!1,e.multiData=[],e.updatedData=[],e.swagData=[],e.startTime=0,e.isAllDayTarget=!1,e.targetTd=null,e.isCursorAhead=!1,e.enableCurrentViewDrag=!1,e.isPreventMultiDrag=!1,e.slotsUptoCursor=-1,e.eleTop=0,e.distanceUptoCursor=0,e}return Zo(i,t),i.prototype.wireDragEvent=function(t){new e.Draggable(t,{abort:"."+Ei,clone:!0,isDragScroll:!0,enableTailMode:!!this.parent.eventDragArea,cursorAt:this.parent.eventDragArea?{left:-20,top:-20}:{left:0,top:0},dragArea:this.dragArea,dragStart:this.dragStart.bind(this),drag:this.drag.bind(this),dragStop:this.dragStop.bind(this),enableAutoScroll:!1,helper:this.dragHelper.bind(this),queryPositionInfo:this.dragPosition.bind(this)})},i.prototype.setDragArea=function(){var e=document.querySelector(this.parent.eventDragArea);this.dragArea=this.parent.eventDragArea&&e?e:this.parent.element.querySelector("."+Je)},i.prototype.dragHelper=function(t){var i=this;if(t.sender&&"touchmove"===t.sender.type&&(!this.parent.uiStateValues.isTapHold||!t.element.classList.contains(Zt)))return null;if(this.setDragActionDefaultValues(),this.actionObj.element=t.element,t.sender&&["Day","Week","WorkWeek"].indexOf(this.parent.currentView)>-1){var n=this.parent.eventBase.getPageCoordinates(t.sender);this.distanceUptoCursor=n.clientY-this.actionObj.element.getBoundingClientRect().top,this.eleTop=parseFloat(this.actionObj.element.style.top),this.slotsUptoCursor=-1}this.actionObj.action="drag";var r=[];return!this.parent.allowMultiDrag||(0,e.isNullOrUndefined)(this.parent.selectedElements)||0===this.parent.selectedElements.length||this.parent.selectedElements.length>0&&-1===this.parent.selectedElements.indexOf(this.actionObj.element)?r=[t.element]:(r=this.parent.selectedElements,this.isMultiSelect=!0),r.forEach((function(t){var n=i.createCloneElement(t);t.getAttribute("data-guid")===i.actionObj.element.getAttribute("data-guid")&&(i.actionObj.clone=n,i.parent.eventDragArea||"Month"===i.parent.currentView||!i.parent.activeViewOptions.timeScale.enable||i.parent.activeView.isTimelineView()||i.actionObj.element.classList.contains(ji)||(0,e.setStyleAttribute)(i.actionObj.clone,{cursor:"move",left:"0%",right:"0%",width:"100%"}),i.actionObj.clone.style.top=(0,e.formatUnit)(i.actionObj.element.offsetTop)),i.actionObj.cloneElement.push(n),i.actionObj.originalElement.push(t)})),this.actionObj.clone},i.prototype.dragPosition=function(t){if(this.parent.eventDragArea)return{left:t.left,top:t.top};var i,n=this.actionObj.cellHeight/this.actionObj.slotInterval*this.actionObj.interval,r=(0,e.formatUnit)(0);"Month"===this.parent.currentView&&(r=t.left),i=this.isStepDragging?Math.ceil(this.actionObj.clone.getBoundingClientRect().right)+this.actionObj.interval:this.actionObj.clone.getBoundingClientRect().right;var a,s=this.parent.element.querySelector("."+ri).getBoundingClientRect().right;if(!(this.parent.activeView.isTimelineView()&&"TimelineYear"!==this.parent.currentView&&!this.parent.enableRtl&&this.actionObj.pageX>i)||this.isMorePopupOpened||this.actionObj.pageX>s||(this.isCursorAhead=!0),this.parent.activeView.isTimelineView()&&(r=(0,e.formatUnit)(this.actionObj.clone.offsetLeft)),this.parent.activeView.isTimelineView()||!this.parent.timeScale.enable||!(0,e.isNullOrUndefined)(this.actionObj.clone.offsetParent)&&this.actionObj.clone.offsetParent.classList.contains(tn))a=(0,e.formatUnit)(this.actionObj.clone.offsetTop);else if("Month"===this.parent.currentView)a=(0,e.formatUnit)(0);else if(this.actionObj.clone.classList.contains(ji))a=(0,e.formatUnit)(this.parent.element.querySelector("."+Ze).offsetTop),(0,e.setStyleAttribute)(this.actionObj.clone,{width:(0,e.formatUnit)(Math.ceil(this.actionObj.clone.offsetWidth/this.actionObj.cellWidth)*this.actionObj.cellWidth),right:this.parent.enableRtl&&(0,e.formatUnit)(0)});else{this.actionObj.element.classList.contains(ji)&&!this.actionObj.clone.classList.contains(ji)&&(0,e.setStyleAttribute)(this.actionObj.clone,{height:(0,e.formatUnit)(this.actionObj.cellHeight),width:(0,e.formatUnit)(this.actionObj.cellWidth-1),pointerEvents:"none"});var o=parseInt(t.top,10);if(o=o<0?0:o,this.slotsUptoCursor<0){var l=Math.floor((this.eleTop+this.distanceUptoCursor)/n),p=Math.floor(this.eleTop/n);this.slotsUptoCursor=l-p}o=(Math.floor((o+this.distanceUptoCursor+1)/n)-this.slotsUptoCursor)*n,a=(0,e.formatUnit)(o<0?0:o);var c=this.parent.element.querySelector(".e-content-wrap").scrollHeight,h=parseInt(a,10)+this.actionObj.clone.offsetHeight;h>c&&(a=parseInt(a,10)-(h-c)+"px"),this.isPreventMultiDrag&&(a=(0,e.formatUnit)(this.actionObj.clone.offsetTop))}return{left:r,top:a}},i.prototype.setDragActionDefaultValues=function(){this.actionObj.action="drag",this.actionObj.isAllDay=null,this.actionObj.slotInterval=this.parent.activeViewOptions.timeScale.interval/this.parent.activeViewOptions.timeScale.slotCount,this.actionObj.interval=this.actionObj.slotInterval;var e=this.parent.element.querySelector("."+$e);this.actionObj.cellWidth=e.offsetWidth,this.actionObj.cellHeight=e.offsetHeight},i.prototype.dragStart=function(t){var i=this,n=this.actionObj.element.getAttribute("data-guid");this.actionObj.event=this.parent.eventBase.getEventByGuid(n);var r=(0,e.extend)({},this.actionObj.event,null,!0);(0,e.isNullOrUndefined)(r)||(this.startTime=r[this.parent.eventFields.startTime].getTime()),this.parent.allowMultiDrag||this.parent.eventBase.removeSelectedAppointmentClass();var a={cancel:!1,data:r,selectedData:this.getSelectedData(),event:t,excludeSelectors:null,element:this.actionObj.element,interval:this.actionObj.interval,navigation:{enable:!1,timeDelay:2e3},scroll:{enable:!0,scrollBy:30,timeDelay:100}};this.parent.trigger(S,a,(function(n){if(n.cancel||!(0,e.isNullOrUndefined)(i.actionObj.element)&&(0,e.isNullOrUndefined)(i.actionObj.element.parentElement)){var s=i.actionObj.element.ej2_instances[0];return(0,e.isNullOrUndefined)(s)||s.intDestroy(t.event),i.actionObj.action="",i.removeCloneElementClasses(),void i.removeCloneElement()}i.actionClass("addClass"),i.parent.uiStateValues.action=!0,i.actionObj.start=r[i.parent.eventFields.startTime],i.actionObj.end=r[i.parent.eventFields.endTime],i.actionObj.groupIndex=parseInt(i.actionObj.element.getAttribute("data-group-index")||"0",10),i.actionObj.interval=n.interval,i.actionObj.navigation=n.navigation,i.actionObj.scroll=n.scroll,i.enableCurrentViewDrag=a.dragWithinRange&&!a.navigation.enable&&i.parent.allowMultiDrag,i.actionObj.excludeSelectors=n.excludeSelectors;var o=i.parent.element.querySelector("."+ri);if(i.scrollArgs={element:o,width:o.scrollWidth,height:o.scrollHeight},i.widthPerMinute=i.actionObj.cellWidth/i.actionObj.slotInterval*i.actionObj.interval,i.heightPerMinute=i.actionObj.cellHeight/i.actionObj.slotInterval*i.actionObj.interval,i.widthUptoCursorPoint=0,i.heightUptoCursorPoint=0,i.cursorPointIndex=-1,i.isHeaderRows=!1,i.isTimelineDayProcess=!1,i.minDiff=0,i.isMorePopupOpened=!1,i.daysVariation=-1,i.isAllDayTarget=i.actionObj.clone.classList.contains(ji),(i.parent.activeView.isTimelineView()||!i.parent.timeScale.enable)&&"TimelineYear"!==i.parent.currentView){!(0,e.isNullOrUndefined)(i.actionObj.clone.offsetParent)&&i.actionObj.clone.offsetParent.classList.contains(tn)&&(i.isMorePopupOpened=!0),i.actionObj.pageX=t.event.pageX;var l=i.parent.activeViewOptions.headerRows;i.isHeaderRows=l.length>0&&"Hour"!==l[l.length-1].option&&"Date"!==l[l.length-1].option,i.isTimelineDayProcess=!i.parent.activeViewOptions.timeScale.enable||i.isHeaderRows||"TimelineMonth"===i.parent.currentView||l.length>0&&"Date"===l[l.length-1].option,i.isAllDayDrag=!i.isTimelineDayProcess&&r[i.parent.eventFields.isAllDay],i.isStepDragging=!i.isTimelineDayProcess&&!i.isAllDayDrag&&i.actionObj.slotInterval!==i.actionObj.interval,i.isTimelineDayProcess?i.timelineEventModule=new Pa(i.parent,"day"):i.timelineEventModule=new Pa(i.parent,"hour")}("TimelineYear"===i.parent.currentView&&(i.yearEvent=new Ko(i.parent)),"Month"===i.parent.currentView&&(i.startTime=ve(new Date(i.startTime)).getTime(),i.updateOriginalElement(i.actionObj.clone),i.monthEvent=new Ra(i.parent)),"Day"===i.parent.currentView||"Week"===i.parent.currentView||"WorkWeek"===i.parent.currentView)&&(i.verticalEvent=new Ma(i.parent),i.verticalEvent.initializeValues(),i.splitEvent(i.actionObj.event).forEach((function(t){var n='.e-day-wrapper[data-date="'+ve(t[i.parent.eventFields.startTime]).getTime()+'"]';i.parent.activeViewOptions.group.resources.length>0&&(n=n.concat('[data-group-index = "'+i.actionObj.groupIndex+'"]'));var r=i.parent.element.querySelector(n);if(r){var a=r.querySelector('[data-id="'+i.actionObj.clone.getAttribute("data-id")+'"]');a&&(0,e.addClass)([a],Di)}})))}))},i.prototype.getSelectedData=function(){if(this.isMultiSelect&&0===this.multiData.length&&this.parent.selectedElements.length>0)for(var t=0,i=this.parent.selectedElements;t<i.length;t++){var n=i[t].getAttribute("data-guid"),r=this.parent.eventBase.getEventByGuid(n);this.multiData.push((0,e.extend)({},r,null,!0))}return this.multiData},i.prototype.drag=function(t){if(t.event&&"touchmove"===t.event.type&&t.event.preventDefault(),this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide(!0),(0,e.isNullOrUndefined)(t.target)||!t.target.classList||!t.target.classList.contains(Qn)){var i=(0,e.extend)({},this.actionObj.event,null,!0),n=this.parent.eventBase.getPageCoordinates(t);if(this.actionObj.Y=this.actionObj.pageY=n.pageY,this.actionObj.X=this.actionObj.pageX=n.pageX,this.actionObj.target=t.target,this.widthUptoCursorPoint=0===this.widthUptoCursorPoint?Math.ceil(Math.abs(this.actionObj.clone.getBoundingClientRect().left-this.actionObj.X)/this.widthPerMinute)*this.widthPerMinute:this.widthUptoCursorPoint,this.widthUptoCursorPoint=this.isMorePopupOpened?this.actionObj.cellWidth:this.widthUptoCursorPoint,this.heightUptoCursorPoint=0===this.heightUptoCursorPoint?Math.ceil(Math.abs(this.actionObj.clone.getBoundingClientRect().top-this.actionObj.Y)/this.heightPerMinute)*this.heightPerMinute:this.heightUptoCursorPoint,["Day","Week","WorkWeek"].indexOf(this.parent.currentView)>-1&&(this.isAllDayDrag=this.parent.activeViewOptions.timeScale.enable?this.actionObj.clone.classList.contains(ji):this.actionObj.event[this.parent.eventFields.isAllDay]),this.isStepDragging&&0===this.minDiff&&this.calculateMinutesDiff(i),("Month"===this.parent.currentView||this.isAllDayDrag)&&this.daysVariation<0){var r=this.parent.getDateFromElement(this.actionObj.target);if((0,e.isNullOrUndefined)(r))this.daysVariation=0;else{var a=ve(r),s=ve(new Date(i[this.parent.eventFields.startTime].getTime()));this.daysVariation=(a.getTime()-s.getTime())/ie}}else this.daysVariation=0;if(this.parent.eventDragArea){var o=n.target;this.actionObj.clone.style.top=(0,e.formatUnit)(o.offsetTop),this.actionObj.clone.style.left=(0,e.formatUnit)(o.offsetLeft),(0,e.closest)(o,"."+Fe)?"Week"!==this.parent.currentView&&"WorkWeek"!==this.parent.currentView&&"Day"!==this.parent.currentView&&(this.actionObj.clone.style.width=(0,e.formatUnit)(this.actionObj.element.offsetWidth)):(this.actionObj.clone.style.height="",this.actionObj.clone.style.width="")}this.updateScrollPosition(t),this.updateNavigatingPosition(t),this.updateDraggingDateTime(t);var l={data:i,event:t,element:this.actionObj.element,startTime:this.actionObj.start,endTime:this.actionObj.end,selectedData:this.updatedData};this.parent.group.resources.length>0&&(l.groupIndex=this.actionObj.groupIndex),this.parent.trigger(C,l)}},i.prototype.calculateMinutesDiff=function(e){this.parent.enableRtl?this.minDiff=(this.actionObj.clone.offsetWidth-this.widthUptoCursorPoint)/this.widthPerMinute*this.actionObj.interval:this.minDiff=this.widthUptoCursorPoint/this.widthPerMinute*this.actionObj.interval;var t=e[this.parent.eventFields.startTime],i=De(this.parent.activeView.renderDates[0],this.parent.activeView.getStartHour(),this.parent.activeView.getEndHour());i.startHour.getTime()>t.getTime()&&(this.minDiff=this.minDiff+(i.startHour.getTime()-t.getTime())/ne)},i.prototype.dragStop=function(t){var i=this;if(this.isCursorAhead=!1,this.isPreventMultiDrag=!1,this.removeCloneElementClasses(),this.removeCloneElement(),clearInterval(this.actionObj.navigationInterval),this.actionObj.navigationInterval=null,clearInterval(this.actionObj.scrollInterval),this.actionObj.scrollInterval=null,this.actionClass("removeClass"),this.parent.uiStateValues.action=this.parent.uiStateValues.isTapHold=!1,!this.isAllowDrop(t)){var n=t.target.classList&&!t.target.classList.contains("e-work-cells")&&this.parent.cellTemplate?(0,e.closest)(t.target,".e-work-cells"):t.target,r={cancel:!1,data:this.getChangedData(this.updatedData),selectedData:this.updatedData,event:t,element:this.actionObj.element,target:n};this.actionObj.action=null,this.parent.trigger(O,r,(function(e){if(!e.cancel&&!i.parent.eventBase.checkOverlap(e.data)){if(i.parent.isSpecificResourceEvents()){i.parent.crudModule.crudObj.isCrudAction=!0,i.parent.crudModule.crudObj.sourceEvent=[i.parent.resourceBase.lastResourceLevel[parseInt(r.element.getAttribute("data-group-index"),10)]];var t=parseInt(r.target.getAttribute("data-group-index"),10)||i.actionObj.groupIndex;i.parent.crudModule.crudObj.targetEvent=[i.parent.resourceBase.lastResourceLevel[parseInt(t.toString(),10)]]}i.saveChangedData(e,i.isMultiSelect)}})),this.updatedData=[],this.multiData=[],this.isMultiSelect=!1,this.parent.selectedElements=[]}},i.prototype.updateNavigatingPosition=function(t){var i=this;if(this.actionObj.navigation.enable){var n=this.parent.getCurrentTime();(0,e.isNullOrUndefined)(this.actionObj.navigationInterval)&&(this.actionObj.navigationInterval=window.setInterval((function(){if(n){var e=i.parent.getCurrentTime().getSeconds(),r=n.getSeconds()+i.actionObj.navigation.timeDelay/1e3;(r=r>=60?r-60:r)===e&&(n=i.parent.getCurrentTime(),i.viewNavigation(t),i.updateDraggingDateTime(t))}}),this.actionObj.navigation.timeDelay))}},i.prototype.updateDraggingDateTime=function(t){!(0,e.isNullOrUndefined)(this.actionObj.clone.offsetParent)&&this.actionObj.clone.offsetParent.classList.contains(tn)?this.morePopupEventDragging(t):this.parent.activeView.isTimelineView()&&"TimelineYear"!==this.parent.currentView?(this.timelineEventModule.dateRender=this.parent.activeView.renderDates,this.timelineEventModule.cellWidth=this.actionObj.cellWidth,this.timelineEventModule.getSlotDates(),this.actionObj.cellWidth=this.isHeaderRows?this.timelineEventModule.cellWidth:this.parent.getElementWidth(this.parent.element.querySelector("."+$e)),this.calculateTimelineTime(t)):"Month"===this.parent.currentView||"TimelineYear"===this.parent.currentView?this.calculateVerticalDate(t):this.calculateVerticalTime(t)},i.prototype.navigationWrapper=function(){if(this.parent.activeView.isTimelineView()){var t=void 0;if(t=this.parent.activeViewOptions.group.resources.length>0?this.parent.element.querySelectorAll(".e-appointment-container:not(.e-hidden)").item(this.actionObj.index):this.parent.element.querySelector("."+Gt),!(0,e.isNullOrUndefined)(t)){var i=t.querySelector("."+jt);i||(i=(0,e.createElement)("div",{className:jt}),t.appendChild(i)),this.actionObj.cloneElement.forEach((function(e){i.appendChild(e)}))}}else if("Month"!==this.parent.currentView&&this.parent.timeScale.enable){var n=this.actionObj.clone.classList.contains(ji)?"."+Pi:"."+jt;if(this.parent.element.querySelectorAll(n).item(this.actionObj.index).appendChild(this.actionObj.clone),n==="."+Pi){var r=this.getAllDayEventHeight(),a=[].slice.call(this.parent.element.querySelectorAll("."+Ke+":first-child"));if(a[0].offsetHeight<r)for(var s=0,o=a;s<o.length;s++){o[s].style.height=(r+2)/12+"em"}this.actionObj.clone.style.height=(0,e.formatUnit)(r)}this.actionObj.height=parseInt(this.actionObj.clone.style.height,10)}else{var l=[].slice.call(this.parent.element.querySelectorAll("."+$e));this.actionObj.index=this.parent.activeView.renderDates.length<this.actionObj.index?this.parent.activeView.renderDates.length-1:this.actionObj.index;var p=l[this.actionObj.index].querySelector("."+jt);p||(p=(0,e.createElement)("div",{className:jt}),l[this.actionObj.index].appendChild(p)),p.appendChild(this.actionObj.clone)}},i.prototype.viewNavigation=function(t){var i,n=this.parent.element.querySelector("."+ri);n&&(!this.scrollEdges.top&&!this.scrollEdges.bottom||(0,e.closest)(this.actionObj.clone,"."+Pi))&&(0===n.scrollLeft&&Math.round(this.actionObj.X)<=Math.round(n.getBoundingClientRect().left+this.actionObj.cellWidth+window.pageXOffset)?i=this.parent.enableRtl?"Next":"Previous":Math.round(n.scrollLeft)+n.clientWidth===n.scrollWidth&&Math.round(this.actionObj.X)>=Math.round(n.getBoundingClientRect().right-this.actionObj.cellWidth+window.pageXOffset)&&(i=this.parent.enableRtl?"Previous":"Next"),i&&this.parent.changeDate(this.parent.activeView.getNextPreviousDate(i)))},i.prototype.morePopupEventDragging=function(t){if(!((0,e.isNullOrUndefined)(t.target)||t.target&&(0,e.isNullOrUndefined)((0,e.closest)(t.target,"td")))){var i=(0,e.extend)({},this.actionObj.event,null,!0),n=i[this.parent.eventFields.endTime].getTime()-i[this.parent.eventFields.startTime].getTime(),r=(0,e.closest)(t.target,"td");if("TimelineYear"!==this.parent.currentView||r.classList.contains($e)&&!r.classList.contains(st)){var a=this.parent.getDateFromElement(r),s=new Date(a.getTime());s.setMilliseconds(n),this.parent.activeViewOptions.group.resources.length>0&&(this.actionObj.groupIndex=parseInt(r.getAttribute("data-group-index"),10)),this.actionObj.start=new Date(a.getTime()),this.actionObj.end=new Date(s.getTime()),this.actionObj.clone.style.top=(0,e.formatUnit)(r.offsetParent.offsetTop),this.actionObj.clone.style.left=(0,e.formatUnit)(r.offsetLeft),this.actionObj.clone.style.width=(0,e.formatUnit)(r.offsetWidth);var o,l=r;if(this.parent.activeView.isTimelineView()){var p=(0,e.closest)(r,"tr").rowIndex;l=this.parent.element.querySelectorAll(".e-appointment-container").item(p)}(o=l.querySelector("."+jt))||(o=(0,e.createElement)("div",{className:jt}),l.appendChild(o)),this.appendCloneElement(o)}}},i.prototype.calculateVerticalTime=function(t){var i=this;if(!((0,e.isNullOrUndefined)(this.actionObj.target)||this.actionObj.target&&(0,e.isNullOrUndefined)((0,e.closest)(this.actionObj.target,"tr")))&&((0,e.isNullOrUndefined)((0,e.closest)(this.actionObj.target,"td"))||(0,e.closest)(this.actionObj.target,"td").classList.contains($e)||(0,e.closest)(this.actionObj.target,"td").classList.contains(Ke))){this.parent.activeViewOptions.timeScale.enable&&this.swapDragging(t);var n=this.parent.element.querySelector("."+ri),r=(0,e.extend)({},this.actionObj.event,null,!0),a=r[this.parent.eventFields.startTime],s=Re(r[this.parent.eventFields.endTime])-Re(a),o=Math.floor(parseInt(this.actionObj.clone.style.top,10)/this.actionObj.cellHeight)*this.actionObj.cellHeight;o=o<0?0:o,(this.scrollEdges.top||this.scrollEdges.bottom)&&(o=this.scrollEdges.top?n.scrollTop-this.heightUptoCursorPoint+this.actionObj.cellHeight+window.pageYOffset:n.scrollTop+n.offsetHeight-this.actionObj.clone.offsetHeight+window.pageYOffset+(this.actionObj.clone.offsetHeight-this.heightUptoCursorPoint),o=Math.round(o/this.actionObj.cellHeight)*this.actionObj.cellHeight,n.scrollTop>0&&o<n.scrollHeight&&(this.actionObj.clone.style.top=(0,e.formatUnit)(o)));var l,p,c=this.parent.activeViewOptions.timeScale.enable?o/this.actionObj.cellHeight:0,h=this.actionObj.cellHeight/this.actionObj.slotInterval,d=parseInt(this.actionObj.clone.style.top,10)-o;if(this.isAllDayDrag)l=this.parent.element.querySelector("."+Ze);else l=[].slice.call(this.parent.getContentTable().querySelectorAll("tr"))[parseInt(c.toString(),10)];(0,e.isNullOrUndefined)((0,e.closest)(this.actionObj.target,"td"))||!(0,e.closest)(this.actionObj.target,"td").classList.contains($e)&&!(0,e.closest)(this.actionObj.target,"td").classList.contains(Ke)||(p=(0,e.closest)(this.actionObj.target,"td").cellIndex);var u=(0,e.isNullOrUndefined)(p)?(0,e.closest)(this.actionObj.clone,"td").cellIndex:p;if(this.actionObj.index=u,!(0,e.isNullOrUndefined)(l)){var g,v,m=l.children[parseInt(u.toString(),10)];if(this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&(this.actionObj.groupIndex=parseInt(m.getAttribute("data-group-index"),10)),this.parent.activeViewOptions.timeScale.enable&&!this.isAllDayDrag)this.enableCurrentViewDrag&&0!==this.multiData.length||this.appendCloneElement(this.getEventWrapper(u)),(g=this.parent.getDateFromElement(m)).setMinutes(g.getMinutes()+d/h),v=new Date(g.getTime()),this.actionObj.element.classList.contains(ji)?v.setMinutes(v.getMinutes()+this.actionObj.slotInterval):v.setMilliseconds(s);else{(g=this.parent.getDateFromElement(m)).setDate(g.getDate()-this.daysVariation),g.setHours(a.getHours(),a.getMinutes(),a.getSeconds()),(v=new Date(g.getTime())).setMilliseconds(s),!this.actionObj.element.classList.contains(ji)&&this.actionObj.clone.classList.contains(ji)&&(v=ye(ve(v),1));var f=this.parent.activeViewOptions.group.byDate||this.parent.virtualScrollModule&&!this.parent.activeViewOptions.timeScale.enable?u:void 0;this.updateAllDayEvents(g,v,f)}this.actionObj.start=new Date(+g),this.actionObj.end=new Date(+v);for(var y=this.getUpdatedEvent(this.actionObj.start,this.actionObj.end,this.actionObj.event),T=0,w=[].slice.call(this.parent.element.querySelectorAll(".e-dynamic-clone"));T<w.length;T++){var D=w[T];(0,e.remove)(D)}if(this.multiData.length>0){if(this.isAllDayTarget&&this.isAllDayDrag&&!(0,e.isNullOrUndefined)(this.actionObj.isAllDay)&&!this.actionObj.isAllDay){var b=parseInt((0,e.closest)(this.actionObj.target,"td").getAttribute("data-date"),10);this.multiData.forEach((function(t){if(i.swagData.push((0,e.extend)({},t,null,!0)),t[i.parent.eventFields.isAllDay]){t[i.parent.eventFields.startTime]=new Date(t[i.parent.eventFields.startTime].getTime()+(b-i.startTime));var n=new Date(t[i.parent.eventFields.startTime]),r=new Date(n.setMinutes(n.getMinutes()+i.actionObj.slotInterval));t[i.parent.eventFields.endTime]=r,t[i.parent.eventFields.isAllDay]=!1}})),this.startTime=b}if(this.isAllDayTarget&&this.isAllDayDrag&&!(0,e.isNullOrUndefined)(this.actionObj.isAllDay)&&this.actionObj.isAllDay&&this.swagData.length>0){this.multiData=this.swagData,this.swagData=[];var S=(0,e.extend)({},this.actionObj.event,null,!0);this.startTime=S[this.parent.eventFields.startTime].getTime()}var C=y[this.parent.eventFields.startTime].getTime()-this.startTime;if(this.enableCurrentViewDrag)for(var O=this.getRenderedDates(),E=0;E<this.multiData.length;E++){var x=(0,e.extend)({},this.multiData[parseInt(E.toString(),10)],null,!0),V=new Date(x[this.parent.eventFields.startTime].getTime()+C);if((I=this.parent.getIndexOfDate(O,ve(V)))<0){this.isPreventMultiDrag=!0;break}this.isPreventMultiDrag=!1}if(!this.isPreventMultiDrag)for(var A=0;A<this.multiData.length;A++){var I;if(this.updatedData[parseInt(A.toString(),10)]=this.updateMultipleData(this.multiData[parseInt(A.toString(),10)],C),(I=this.getDayIndex(this.updatedData[parseInt(A.toString(),10)]))>=0){var M=this.updatedData[parseInt(A.toString(),10)][this.parent.eventFields.isAllDay];D=this.getEventWrapper(I,M);this.appendCloneElement(D,this.actionObj.cloneElement[parseInt(A.toString(),10)]),this.updateEventHeight(this.updatedData[parseInt(A.toString(),10)],A,I)}else(0,e.isNullOrUndefined)(this.actionObj.cloneElement[parseInt(A.toString(),10)].parentNode)||(0,e.remove)(this.actionObj.cloneElement[parseInt(A.toString(),10)])}}else this.updateEventHeight(y);this.updateTimePosition(this.actionObj.start,this.updatedData)}}},i.prototype.splitEvent=function(t){var i=this.parent.eventFields,n=[],r=t[i.startTime],a=t[i.endTime];if(ve(new Date(r.getTime()))<ve(new Date(a.getTime()))){for(var s=ve(new Date(r.getTime())),o=new Date(s.getTime()),l=0;s<new Date(a.getTime());l++){o=new Date(o.setDate(s.getDate()+1));var p=(0,e.extend)({},t,null,!0);p[i.startTime]=new Date(s),p[i.endTime]=new Date(o),s=new Date(s.setDate(s.getDate()+1)),n.push(p)}var c=n.length-1;n[0][i.startTime]=r,n[parseInt(c.toString(),10)][i.endTime]=a}else n.push(t);return n},i.prototype.updateMultipleData=function(t,i){var n=(0,e.extend)({},t,null,!0);!(0,e.isNullOrUndefined)(this.actionObj.isAllDay)&&this.parent.activeViewOptions.timeScale.enable&&(this.isAllDayTarget&&n[this.parent.eventFields.isAllDay]||!this.isAllDayTarget&&!n[this.parent.eventFields.isAllDay])&&(n[this.parent.eventFields.isAllDay]=this.actionObj.isAllDay);var r=n[this.parent.eventFields.endTime].getTime()-n[this.parent.eventFields.startTime].getTime();if(n[this.parent.eventFields.isAllDay]){var a=Math.ceil(i/864e5),s=Math.ceil(r/864e5),o=new Date(n[this.parent.eventFields.startTime]);n[this.parent.eventFields.startTime]=ve(new Date(o.setDate(o.getDate()+a))),n[this.parent.eventFields.endTime]=ye(n[this.parent.eventFields.startTime],s)}else n[this.parent.eventFields.startTime]=new Date(n[this.parent.eventFields.startTime].getTime()+i),n[this.parent.eventFields.endTime]=new Date(n[this.parent.eventFields.startTime].getTime()+r);return n},i.prototype.getDayIndex=function(t){var i=(0,e.extend)({},t,null,!0),n=ve(i[this.parent.eventFields.startTime]);if(this.parent.activeViewOptions.timeScale.enable&&!i[this.parent.eventFields.isAllDay]){var r=this.parent.activeView.getStartHour();n.setMilliseconds(r.getTime()-ve(r).getTime())}var a=n.getTime(),s="";return s="."+(this.parent.activeViewOptions.timeScale.enable&&i[this.parent.eventFields.isAllDay]?Pi:$e)+'[data-date="'+a+'"]',this.parent.activeViewOptions.group.resources.length>0&&(s=s+'[data-group-index="'+this.actionObj.groupIndex+'"]'),this.targetTd=this.parent.element.querySelector(s),(0,e.isNullOrUndefined)(this.targetTd)?-1:this.targetTd.cellIndex},i.prototype.updateEventHeight=function(t,i,n){this.verticalEvent.initializeValues();var r=this.verticalEvent.getStartCount();if(!this.parent.uiStateValues.isGroupAdaptive)for(var a=0;a<this.actionObj.groupIndex;a++)this.verticalEvent.dateRender[parseInt(a.toString(),10)]&&(r+=this.verticalEvent.dateRender[parseInt(a.toString(),10)].length);var s=this.parent.uiStateValues.isGroupAdaptive?r:this.actionObj.groupIndex;if(!(!this.parent.activeViewOptions.group.byDate||(0,e.isNullOrUndefined)(this.parent.getDateFromElement(this.actionObj.target)))||!this.parent.activeViewOptions.group.byDate){var o=-1,l=this.parent.activeViewOptions.group.byDate?this.parent.getIndexOfDate(this.verticalEvent.dateRender[parseInt(s.toString(),10)],ve(this.parent.getDateFromElement((0,e.isNullOrUndefined)(i)?this.actionObj.target:this.targetTd))):(0,e.isNullOrUndefined)(i)?this.actionObj.index-r:n-r,p=this.splitEvent(t),c=this.parent.eventBase.isAllDayAppointment(t)||p.length>2||"TimeSlot"!==this.parent.eventSettings.spannedEventPlacement?[t]:p;for(a=0;a<c.length;a++){if(a>0){var h='.e-day-wrapper[data-date="'+ve(c[parseInt(a.toString(),10)][this.parent.eventFields.startTime]).getTime()+'"]';this.parent.activeViewOptions.group.resources.length>0&&(h=h.concat('[data-group-index = "'+this.actionObj.groupIndex+'"]'));var d=this.parent.element.querySelector(h);d?(l+=1,o=d.cellIndex):l=-1}if(l>=0){var u=this.verticalEvent.isSpannedEvent(c[parseInt(a.toString(),10)],l,s),g=u[this.verticalEvent.fields.startTime],v=u[this.verticalEvent.fields.endTime],m=this.parent.activeViewOptions.timeScale.enable?this.verticalEvent.getHeight(g,v):this.actionObj.element.offsetHeight,f=this.parent.activeViewOptions.timeScale.enable?this.verticalEvent.getTopValue(g):this.actionObj.element.offsetTop;if((0,e.isNullOrUndefined)(i))0===a?(this.actionObj.clone.style.top=(0,e.formatUnit)(f),this.actionObj.clone.style.height=(0,e.formatUnit)(m)):this.renderSpannedEvents(u,o,f,m);else{var y=this.actionObj.cellWidth;if(t[this.parent.eventFields.isAllDay]){f=this.parent.element.querySelector("."+Ze).offsetTop,m=this.getAllDayEventHeight();var T=t[this.parent.eventFields.endTime].getTime()-t[this.parent.eventFields.startTime].getTime(),w=Math.ceil(T/864e5);w>=0&&(y=w*this.actionObj.cellWidth)}this.actionObj.cloneElement[parseInt(i.toString(),10)]&&(0===a?(this.actionObj.cloneElement[parseInt(i.toString(),10)].style.top=(0,e.formatUnit)(f),this.actionObj.cloneElement[parseInt(i.toString(),10)].style.height=(0,e.formatUnit)(m),this.actionObj.cloneElement[parseInt(i.toString(),10)].style.width=(0,e.formatUnit)(y),this.actionObj.cloneElement[parseInt(i.toString(),10)].style.left=(0,e.formatUnit)(0)):this.renderSpannedEvents(u,o,f,m))}}}}},i.prototype.renderSpannedEvents=function(t,i,n,r){if(t[this.parent.eventFields.startTime].getTime()!==t[this.parent.eventFields.endTime].getTime()){var a=this.verticalEvent.createAppointmentElement(t,!1,t.isSpanned,this.actionObj.groupIndex);(0,e.addClass)([a],[Si,"e-dynamic-clone"]),(0,e.setStyleAttribute)(a,{width:"100%",height:r+"px",top:n+"px",border:"0px"}),[].slice.call(this.parent.element.querySelectorAll("."+jt))[parseInt(i.toString(),10)].appendChild(a)}},i.prototype.getRenderedDates=function(){var e,t,i=this,n=this.parent.activeView.renderDates;((e=this.parent.eventBase.slots).push.apply(e,this.parent.activeView.renderDates.map((function(e){return+e}))),this.parent.activeViewOptions.group.resources.length>0)&&(this.parent.eventBase.slots=[],n=this.parent.resourceBase.lastResourceLevel.filter((function(e){return e.groupIndex===i.actionObj.groupIndex}))[0].renderDates,(t=this.parent.eventBase.slots).push.apply(t,n.map((function(e){return+e}))));return n},i.prototype.updateAllDayEvents=function(t,i,n){this.parent.eventBase.slots=[];var r=this.getUpdatedEvent(t,i,this.actionObj.event),a=this.getRenderedDates(),s=this.parent.eventBase.splitEvent(r,a),o='.e-all-day-cells[data-date="'+s[0][this.parent.eventFields.startTime].getTime()+'"]';this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&(o=o.concat('[data-group-index = "'+this.actionObj.groupIndex+'"]'));var l=[].slice.call(this.parent.element.querySelectorAll(o));if(l.length>0||!(0,e.isNullOrUndefined)(n)){var p=(0,e.isNullOrUndefined)(n)?l[0].cellIndex:n;this.appendCloneElement(this.getEventWrapper(p)),this.actionObj.clone.style.width=(0,e.formatUnit)(s[0].data.count*this.actionObj.cellWidth)}},i.prototype.swapDragging=function(t){if(!this.isPreventMultiDrag){var i=!(0,e.isNullOrUndefined)((0,e.closest)(this.actionObj.target,"td"))&&(0,e.closest)(this.actionObj.target,"td").cellIndex;if((0,e.closest)(this.actionObj.target,"."+it)&&!(0,e.closest)(this.actionObj.clone,"."+Pi)){(0,e.addClass)([this.actionObj.clone],ji),this.appendCloneElement(this.getEventWrapper(i)),this.actionObj.isAllDay=!0;var n=this.getAllDayEventHeight(),r=[].slice.call(this.parent.element.querySelectorAll("."+Ke+":first-child"));if(r[0].offsetHeight<n)for(var a=0,s=r;a<s.length;a++){s[a].style.height=(n+2)/12+"em"}(0,e.setStyleAttribute)(this.actionObj.clone,{width:(0,e.formatUnit)(this.actionObj.cellWidth),height:(0,e.formatUnit)(n),top:(0,e.formatUnit)(this.parent.element.querySelector("."+Ze).offsetTop)})}if((0,e.closest)(this.actionObj.target,"."+$e)&&!(0,e.closest)(this.actionObj.clone,"."+Lt)){(0,e.removeClass)([this.actionObj.clone],ji),this.appendCloneElement(this.getEventWrapper(i)),this.actionObj.isAllDay=!1;var o=0===this.actionObj.element.offsetHeight?this.actionObj.height:this.actionObj.element.offsetHeight;(0,e.setStyleAttribute)(this.actionObj.clone,{left:(0,e.formatUnit)(0),height:(0,e.formatUnit)(o),width:(0,e.formatUnit)(this.actionObj.cellWidth)})}}},i.prototype.calculateVerticalDate=function(t){if(!((0,e.isNullOrUndefined)(t.target)||t.target&&(0,e.isNullOrUndefined)((0,e.closest)(t.target,"tr"))||t.target&&"DIV"===t.target.tagName)){var i=(0,e.extend)({},this.actionObj.event,null,!0);(0,e.isNullOrUndefined)(this.parent.eventDragArea)&&this.removeCloneElement();var n=Re(i[this.parent.eventFields.endTime])-Re(i[this.parent.eventFields.startTime]),r=(0,e.closest)(this.actionObj.target,"td");if(!(0,e.isNullOrUndefined)(r)){var a=r.parentElement;this.actionObj.index=a.rowIndex*a.children.length+r.cellIndex,r=[].slice.call(this.parent.element.querySelectorAll("."+$e))[this.actionObj.index];var s=this.parent.getDateFromElement(r);if(!(0,e.isNullOrUndefined)(s)){this.parent.activeViewOptions.group.resources.length>0&&(this.actionObj.groupIndex=parseInt(r.getAttribute("data-group-index"),10));var o=new Date(s.setDate(s.getDate()-this.daysVariation)),l=new Date(o.getTime()),p=Re(i[this.parent.eventFields.startTime])-Re(ve(new Date(+i[this.parent.eventFields.startTime])));l.setMilliseconds(p);var c=new Date(l.getTime());c.setMilliseconds(n),this.actionObj.start=new Date(l.getTime()),this.actionObj.end=new Date(c.getTime())}}var h=this.getUpdatedEvent(this.actionObj.start,this.actionObj.end,this.actionObj.event);if((0,e.isNullOrUndefined)(this.parent.eventDragArea))for(var d=0,u=[].slice.call(this.parent.element.querySelectorAll("."+Si));d<u.length;d++){var g=u[d];(0,e.remove)(g)}if(this.multiData&&this.multiData.length>0){var v=ve(new Date(h[this.parent.eventFields.startTime]));p=v.getTime()-this.startTime;"TimelineYear"===this.parent.currentView&&this.parent.group.resources.length>0&&(p=12*(v.getFullYear()-new Date(this.startTime).getFullYear()),p-=new Date(this.startTime).getMonth(),p+=v.getMonth());for(var m=0;m<this.multiData.length;m++)this.updatedData[parseInt(m.toString(),10)]=this.updateMultipleVerticalDate(this.multiData[parseInt(m.toString(),10)],p),"TimelineYear"===this.parent.currentView?this.dynamicYearlyEventsRendering(this.updatedData[parseInt(m.toString(),10)]):this.dynamicEventsRendering(this.updatedData[parseInt(m.toString(),10)])}else"TimelineYear"===this.parent.currentView?this.dynamicYearlyEventsRendering(h):this.dynamicEventsRendering(h)}},i.prototype.updateMultipleVerticalDate=function(t,i){var n=(0,e.extend)({},t,null,!0),r=n[this.parent.eventFields.endTime].getTime()-n[this.parent.eventFields.startTime].getTime(),a=new Date(n[this.parent.eventFields.startTime]);if("TimelineYear"===this.parent.currentView&&this.parent.group.resources.length>0)n[this.parent.eventFields.startTime]=new Date(a.setMonth(a.getMonth()+i));else{var s=Math.ceil(i/ie);n[this.parent.eventFields.startTime]=new Date(a.setDate(a.getDate()+s))}return n[this.parent.eventFields.endTime]=new Date(n[this.parent.eventFields.startTime].getTime()+r),n},i.prototype.calculateTimelineTime=function(t){var i,n=(0,e.extend)({},this.actionObj.event,null,!0),r=Re(n[this.parent.eventFields.endTime])-Re(n[this.parent.eventFields.startTime]),a=this.parent.enableRtl?Math.abs(this.actionObj.clone.offsetLeft)-this.actionObj.clone.offsetWidth:parseInt(this.actionObj.clone.style.left,10);a=Math.round(a/this.actionObj.cellWidth)*this.actionObj.cellWidth,this.parent.enableRtl&&(i=Math.abs(parseInt(this.actionObj.clone.style.right,10)),this.actionObj.clone.style.right=(0,e.formatUnit)(i)),a=this.getOffsetValue(a,i);var s=this.getColumnIndex(a),o=this.parent.element.querySelector("."+ri),l=o.getBoundingClientRect().right,p=this.parent.activeView.isTimelineView()&&!this.parent.enableRtl&&this.actionObj.pageX>this.actionObj.clone.getBoundingClientRect().right&&!this.isMorePopupOpened&&!(this.actionObj.pageX>l),c=this.parent.eventDragArea?o.scrollLeft-o.offsetLeft:0;!this.isCursorAhead&&!p||this.isStepDragging||(this.isCursorAhead=!0);var h=Math.floor((this.actionObj.pageX-this.actionObj.clone.getBoundingClientRect().left+c)/this.actionObj.cellWidth);this.parent.enableRtl&&(h=Math.abs(Math.floor((this.actionObj.pageX-this.actionObj.clone.getBoundingClientRect().right)/this.actionObj.cellWidth))-1),this.cursorPointIndex<0&&this.cursorIndex(t,n,a,h);var d=this.parent.getContentTable().querySelector("tr"),u=this.getCursorCurrentIndex(s,h,d);u=u<0?0:u;var g=this.isHeaderRows?new Date(this.timelineEventModule.dateRender[parseInt(u.toString(),10)].getTime()):this.parent.getDateFromElement(d.children[parseInt(u.toString(),10)]);if(g=this.isAllDayDrag?ve(g):g,this.isStepDragging){var v=this.getWidthDiff(d,u);if(0!==v){var m=Math.ceil(v/this.widthPerMinute);if(g.setMinutes(g.getMinutes()+m*this.actionObj.interval),this.isCursorAhead||p)g.setMilliseconds(-r);else{g.setMinutes(g.getMinutes()-this.minDiff);var f=this.actionObj.interval*ne;m=Math.abs(g.getTime()-this.actionObj.start.getTime())/f;var y=Math.trunc(m);y!==m&&(m=y*f*(g>this.actionObj.start?1:-1),g=new Date(this.actionObj.start.getTime()+m))}}else g=this.actionObj.start}else if(!this.isCursorAhead&&!p||this.isAllDayDrag)g.setMinutes(g.getMinutes()-this.cursorPointIndex*(this.isTimelineDayProcess||this.isAllDayDrag?1440:this.actionObj.slotInterval));else{var T=this.isTimelineDayProcess||this.isAllDayDrag?1440:this.actionObj.slotInterval;g.setMinutes(g.getMinutes()+T),g.setMilliseconds(-r),g.getTime()===ve(g).getTime()&&0===g.getMinutes()&&0===r&&g.setMinutes(-T)}if(this.isStepDragging||(g=this.calculateIntervalTime(g)),this.isTimelineDayProcess||this.isAllDayDrag){var w=n[this.parent.eventFields.startTime];g.setHours(w.getHours(),w.getMinutes(),w.getSeconds())}if(this.parent.eventDragArea){var D=this.parent.getDateFromElement(t.target);if(!(0,e.isNullOrUndefined)(D))if(this.parent.activeViewOptions.timeScale.enable&&"TimelineMonth"!==this.parent.currentView)g=D;else{w=n[this.parent.eventFields.startTime];g=new Date(D.setHours(w.getHours(),w.getMinutes(),w.getSeconds()))}}var b=new Date(g.getTime());b.setMilliseconds(r);var S=[this.getUpdatedEvent(g,b,this.actionObj.event)];if(this.multiData.length>0){for(var C=S[0][this.parent.eventFields.startTime].getTime()-this.startTime,O=0;O<this.multiData.length;O++)this.updatedData[parseInt(O.toString(),10)]=this.updateMultipleData(this.multiData[parseInt(O.toString(),10)],C);S=this.updatedData}for(var E=0;E<S.length;E++){var x=this.multiData.length>0?this.actionObj.cloneElement[parseInt(E.toString(),10)]:this.actionObj.clone;if((0,e.isNullOrUndefined)(this.parent.eventDragArea)){var V=this.timelineEventModule.splitEvent(S[parseInt(E.toString(),10)],this.timelineEventModule.dateRender),A=V[0].data,I=this.timelineEventModule.getStartTime(V[0],A),M=this.timelineEventModule.getEndTime(V[0],A),k=this.timelineEventModule.getEventWidth(I,M,n[this.parent.eventFields.isAllDay],A.count),R=this.parent.getIndexOfDate(this.timelineEventModule.dateRender,ve(new Date(I.getTime())));R=R<0?0:R;var H=this.timelineEventModule.getPosition(I,M,n[this.parent.eventFields.isAllDay],R);this.parent.enableRtl?x.style.right=(0,e.formatUnit)(H):x.style.left=(0,e.formatUnit)(H),this.isMorePopupOpened||(x.style.width=(0,e.formatUnit)(k))}this.parent.activeViewOptions.group.resources.length>0&&this.calculateResourceGroupingPosition(t,x),this.actionObj.start=new Date(g.getTime()),this.actionObj.end=new Date(b.getTime()),this.updateTimePosition(this.actionObj.start,this.updatedData)}},i.prototype.getOffsetValue=function(t,i){if(this.scrollEdges.left||this.scrollEdges.right){var n=this.parent.element.querySelector("."+ri);this.parent.enableRtl?(i=n.offsetWidth-n.scrollLeft,this.scrollEdges.right?i=i-n.offsetWidth+this.actionObj.clone.offsetWidth-(this.actionObj.clone.offsetWidth-this.widthUptoCursorPoint):(i+=this.widthUptoCursorPoint)-this.widthUptoCursorPoint>=n.scrollWidth&&(this.actionObj.clone.style.width=(0,e.formatUnit)(this.actionObj.clone.offsetWidth-this.widthUptoCursorPoint+this.actionObj.cellWidth),i=n.scrollLeft-n.scrollWidth),(0,e.isNullOrUndefined)(this.parent.eventDragArea)&&(this.actionObj.clone.style.left=(0,e.formatUnit)(i))):(this.scrollEdges.left?(t=n.scrollLeft-this.widthUptoCursorPoint+this.actionObj.cellWidth,n.scrollLeft+n.offsetWidth>=n.offsetWidth?n.scrollLeft=n.scrollLeft-1:0===this.actionObj.clone.offsetLeft&&(t=n.scrollLeft)):t=n.scrollLeft+n.offsetWidth-this.actionObj.clone.offsetWidth+(this.actionObj.clone.offsetWidth-this.widthUptoCursorPoint),t=t<0?0:t,(0,e.isNullOrUndefined)(this.parent.eventDragArea)&&(this.actionObj.clone.style.left=(0,e.formatUnit)(t)))}return t},i.prototype.getWidthDiff=function(e,t){var i=this.scrollArgs.element.getBoundingClientRect();if(i.left<=this.actionObj.pageX&&i.right>=this.actionObj.pageX){var n=e.children[parseInt(t.toString(),10)].offsetLeft,r=this.actionObj.pageX-i.left;return this.parent.enableRtl?n+this.actionObj.cellWidth-(this.scrollArgs.element.scrollLeft+r):this.scrollArgs.element.scrollLeft+r-n}return 0},i.prototype.getColumnIndex=function(e){var t=Math.round(e/this.actionObj.cellWidth);return this.isHeaderRows?t:this.getIndex(t)},i.prototype.getCursorCurrentIndex=function(e,t,i){var n=e+t;if(this.isHeaderRows){var r=Math.floor(i.offsetWidth/this.actionObj.cellWidth);return n>r-1?r-1:n}return n>i.children.length-1?i.children.length-1:n},i.prototype.cursorIndex=function(t,i,n,r){var a=(0,e.closest)(t.target,".e-work-cells");if((0,e.isNullOrUndefined)(a)||this.isMorePopupOpened)this.cursorPointIndex=0;else{var s=this.parent.getDateFromElement(a);if(s=this.isAllDayDrag?ve(s):s,this.isHeaderRows){var o=Math.floor(n/this.actionObj.cellWidth);s=new Date(this.timelineEventModule.dateRender[o+r].getTime())}var l=s.getTime()-i[this.parent.eventFields.startTime].getTime();if(this.isTimelineDayProcess||this.isAllDayDrag)this.cursorPointIndex=Math.abs(Math.ceil(l/ie));else{var p=Math.floor(l/ne/(this.actionObj.slotInterval/this.actionObj.cellWidth));this.cursorPointIndex=Math.floor(p/this.actionObj.cellWidth),this.cursorPointIndex=this.cursorPointIndex<0?0:this.cursorPointIndex}}},i.prototype.calculateResourceGroupingPosition=function(t,i){var n=this.parent.element.querySelector("."+ri),r=[].slice.call(this.parent.element.querySelectorAll(".e-content-wrap .e-content-table tr:not(.e-hidden)")),a=se(n.querySelector("table"));a=(0,e.isNullOrUndefined)(a)?0:a;var s=this.parent.rowAutoHeight?~~(n.querySelector("table").offsetHeight/r.length):this.actionObj.cellHeight,o=Math.floor(Math.floor(this.actionObj.Y+(n.scrollTop-a-(window.scrollY||window.pageYOffset))-qe(n,this.parent.uiStateValues.isTransformed))/s);o=o<0?0:o>r.length-1?r.length-1:o,this.actionObj.index=o;var l=this.parent.element.querySelectorAll(".e-appointment-container:not(.e-hidden)").item(o),p=l.querySelector("."+jt);p||(p=(0,e.createElement)("div",{className:jt}),l.appendChild(p)),this.appendCloneElement(p,i);var c=(0,e.closest)(this.actionObj.target,"td");if(this.actionObj.groupIndex=c&&!isNaN(parseInt(c.getAttribute("data-group-index"),10))?parseInt(c.getAttribute("data-group-index"),10):this.actionObj.groupIndex,(0,e.isNullOrUndefined)(this.parent.eventDragArea)){var h=this.parent.getElementHeight(r[parseInt(o.toString(),10)])*o;if(this.parent.rowAutoHeight){var d=this.getCursorElement(t);d&&(h=d.classList.contains($e)?d.offsetTop:d.offsetParent&&d.offsetParent.classList.contains(Xt)?d.offsetParent.offsetTop:h)}i.style.top=(0,e.formatUnit)(h)}},i.prototype.appendCloneElement=function(t,i){void 0===i&&(i=null),i=(0,e.isNullOrUndefined)(i)?this.actionObj.clone:i;var n=document.querySelector(this.parent.eventDragArea);this.parent.eventDragArea&&n?n.appendChild(i):t.appendChild(i)},i.prototype.getEventWrapper=function(t,i){var n;if((0,e.isNullOrUndefined)(i)&&(i=this.actionObj.clone.classList.contains(ji)),this.parent.activeViewOptions.timeScale.enable){var r=i?"."+Pi:"."+jt;n=this.parent.element.querySelectorAll(r).item(t)}else{var a=this.parent.element.querySelectorAll("."+$e).item(t);(n=a.querySelector("."+jt))||(n=(0,e.createElement)("div",{className:jt}),a.appendChild(n))}return n},i.prototype.getAllDayEventHeight=function(){var t=(0,e.createElement)("div",{className:Xt});this.parent.element.querySelector("."+Pi).appendChild(t);var i=t.offsetHeight;return(0,e.remove)(t),i},i.prototype.isAllowDrop=function(e){if(!this.actionObj.excludeSelectors)return!1;for(var t=!1,i=0,n=this.actionObj.excludeSelectors.split(",");i<n.length;i++){var r=n[i];if(e.target.classList.contains(r)){t=!0;break}}return t},i.prototype.getModuleName=function(){return"dragAndDrop"},i}(_o),$o=function(){function t(e){this.previousNextAction="Next",this.parent=e}return t.prototype.isTimelineView=function(){return-1!==this.parent.currentView.indexOf("Timeline")},t.prototype.getContentRows=function(){return[]},t.prototype.refreshHeader=function(){},t.prototype.refreshResourceHeader=function(){var t=this.element.querySelector("."+Tt),i=Array.from(t.querySelectorAll("."+Ot));i.forEach((function(t){Array.from(t.children).forEach((function(t){t.classList.contains(bt)||t.classList.contains(St)||(0,e.remove)(t)}))}));var n=this.parent.resourceBase.renderedResources;if(!(0,e.isNullOrUndefined)(n)&&n.length>0)for(var r=0;r<i.length;r++){var a=i[parseInt(r.toString(),10)],s=n[parseInt(r.toString(),10)];!this.parent.activeView||(0,e.isNullOrUndefined)(a)||(0,e.isNullOrUndefined)(s)||parseInt(a.getAttribute("data-group-index"),10)!==s.groupIndex||this.parent.activeView.setResourceHeaderContent(a,s,ft)}this.parent.renderTemplates(),this.parent.notify(_,{})},t.prototype.getDayName=function(e){return this.parent.getDayNames("abbreviated")[e.getDay()]},t.prototype.getDate=function(e){return this.parent.globalize.formatDate(e,{format:"d",calendar:this.parent.getCalendarMode()})},t.prototype.getTime=function(e){return this.parent.isAdaptive?"HH:mm"===this.parent.activeViewOptions.timeFormat||"HH.mm"===this.parent.activeViewOptions.timeFormat?this.parent.globalize.formatDate(e,{format:"H",calendar:this.parent.getCalendarMode()}):this.parent.globalize.formatDate(e,{skeleton:"h",calendar:this.parent.getCalendarMode()}):this.parent.getTimeString(e)},t.prototype.getTimelineDate=function(e){return je(this.parent.globalize.formatDate(e,{skeleton:"MMMd",calendar:this.parent.getCalendarMode()})+", "+this.parent.getDayNames("wide")[e.getDay()],"multiple")},t.prototype.createEventTable=function(t){var i=(0,e.createElement)("div",{className:vt});return(0,e.append)(this.getEventRows(t),i),i},t.prototype.getEventRows=function(t){for(var i,n=[],r=0;r<t;r++)i=(0,e.createElement)("div",{className:Gt}),this.parent.resourceBase&&!this.parent.uiStateValues.isGroupAdaptive&&this.parent.resourceBase.renderedResources&&i.setAttribute("data-group-index",this.parent.resourceBase.renderedResources[parseInt(r.toString(),10)].groupIndex.toString()),n.push(i);return n},t.prototype.collapseRows=function(e){this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&(this.parent.resourceBase.hideResourceRows(e.querySelector("tbody")),this.parent.resourceBase.hideResourceRows(e.querySelector("."+vt)))},t.prototype.createTableLayout=function(t){var i=t||"",n=(0,e.createElement)("table",{className:Qe+" "+i}),r=(0,e.createElement)("tbody");return n.appendChild(r),n},t.prototype.setAriaAttributes=function(e){e.setAttribute("role","grid"),"Year"!==this.parent.currentView&&e.setAttribute("id",this.parent.element.id+"_table"),e.setAttribute("aria-label",this.getLabelText(this.parent.currentView))},t.prototype.createColGroup=function(t,i){if(!(0,e.isNullOrUndefined)(i)){var n=i.length;i[0]&&i[0].colSpan&&(n=i.map((function(e){return e.colSpan})).reduce((function(e,t){return e+t})));for(var r=(0,e.createElement)("colgroup"),a=0;a<n;a++)r.appendChild((0,e.createElement)("col"));(0,e.prepend)([r],t)}},t.prototype.getScrollXIndent=function(e){return e.offsetHeight-e.clientHeight>0?xe():0},t.prototype.scrollTopPanel=function(e){this.getDatesHeaderElement().firstElementChild.scrollLeft=e.scrollLeft},t.prototype.scrollHeaderLabels=function(t){for(var i=this.element.querySelector(".e-date-header-wrap table"),n=i.offsetWidth/i.querySelectorAll("colgroup col").length,r=function(i,r){for(var a,s=0,o=0,l=r?-t.scrollLeft:t.scrollLeft,p=0,c=i;p<c.length;p++){var h=c[p];if((o+=parseInt(h.getAttribute("colSpan"),10))>Math.floor(l/n)){a=h;break}s+=h.offsetWidth}(0,e.isNullOrUndefined)(a)||(a.children[0].style[r?"right":"left"]=l-s+"px")},a=0,s=[".e-header-year-cell",".e-header-month-cell",".e-header-week-cell",".e-header-cells"];a<s.length;a++){var o=s[a],l=[].slice.call(this.element.querySelectorAll(o));if(l.length>0){for(var p=0,c=l;p<c.length;p++){c[p].children[0].style[this.parent.enableRtl?"right":"left"]=""}r(l,this.parent.enableRtl)}}},t.prototype.addAttributes=function(t,i){t.template&&(0,e.append)(t.template,i),t.colSpan&&i.setAttribute("colspan",t.colSpan.toString()),t.className&&(0,e.addClass)([i],t.className)},t.prototype.getHeaderBarHeight=function(){var e=2;if(this.parent.headerModule&&(e+=Ie(this.parent.headerModule.getHeaderElement())),this.parent.uiStateValues.isGroupAdaptive){var t=this.parent.element.querySelector("."+Ut);t&&(e+=t.offsetHeight)}return e},t.prototype.renderPanel=function(t){t===ct?(0,e.prepend)([this.element],this.parent.element.querySelector("."+Xe)):this.parent.element.querySelector("."+Xe).appendChild(this.element)},t.prototype.setPanel=function(e){this.element=e},t.prototype.getPanel=function(){return this.element},t.prototype.getDatesHeaderElement=function(){return this.element.querySelector("."+nt)},t.prototype.getDateSlots=function(e,t){return[]},t.prototype.generateColumnLevels=function(){return[]},t.prototype.getColumnLevels=function(){return this.colLevels},t.prototype.highlightCurrentTime=function(){},t.prototype.getStartDate=function(){return this.renderDates[0]},t.prototype.getEndDate=function(){return this.renderDates[this.renderDates.length-1]},t.prototype.startDate=function(){return this.renderDates[0]},t.prototype.endDate=function(){return ye(this.renderDates[this.renderDates.length-1],1)},t.prototype.getStartHour=function(){var t=this.parent.getStartEndTime(this.parent.activeViewOptions.startHour);return(0,e.isNullOrUndefined)(t)&&(t=new Date(2e3,0,0,0)),t},t.prototype.getEndHour=function(){var t=this.parent.getStartEndTime(this.parent.activeViewOptions.endHour);return(0,e.isNullOrUndefined)(t)&&(t=new Date(2e3,0,0,0)),t},t.prototype.isCurrentDate=function(e){return e.setHours(0,0,0,0)===new Date(this.parent.currentTimezoneDate).setHours(0,0,0,0)},t.prototype.isCurrentMonth=function(e){return this.parent.activeViewOptions.displayDate||this.parent.activeViewOptions.numberOfWeeks>0?this.parent.activeView.getStartDate().getTime()<=this.parent.getCurrentTime().getTime()&&this.parent.activeView.getEndDate().getTime()>=this.parent.getCurrentTime().getTime():e.getFullYear()===this.parent.getCurrentTime().getFullYear()&&e.getMonth()===this.parent.getCurrentTime().getMonth()},t.prototype.isWorkDay=function(t,i){return void 0===i&&(i=this.parent.activeViewOptions.workDays),!(0,e.isNullOrUndefined)(i)&&i.indexOf(t.getDay())>=0},t.prototype.isWorkHour=function(t,i,n,r){return!(0,e.isNullOrUndefined)(i)&&!(0,e.isNullOrUndefined)(n)&&(i.setMilliseconds(0),n.setMilliseconds(0),ve(t).getTime()!==ve(i).getTime()&&(i=new Date(2e3,0,0,i.getHours(),i.getMinutes(),i.getMilliseconds()),n=new Date(2e3,0,0,n.getHours(),n.getMinutes(),n.getMilliseconds())),!(me(t)<me(i)||me(t)>=me(n)||!this.isWorkDay(t,r)))},t.prototype.getRenderDates=function(e,t){void 0===t&&(t=this.parent.selectedDate);var i=[];if("Week"===this.parent.currentView||"TimelineWeek"===this.parent.currentView)for(var n=le(ve(t),this.parent.activeViewOptions.firstDayOfWeek),r=0,a=ee*this.parent.activeViewOptions.interval;r<a;r++)(this.parent.activeViewOptions.showWeekend||this.isWorkDay(n,e))&&i.push(n),n=ye(n,1);else if("WorkWeek"===this.parent.currentView||"TimelineWorkWeek"===this.parent.currentView){n=le(ve(t),this.parent.activeViewOptions.firstDayOfWeek),r=0;for(var s=ee*this.parent.activeViewOptions.interval;r<s;r++)this.isWorkDay(n,e)&&i.push(n),n=ye(n,1)}else{var o="Agenda"===this.parent.currentView?this.parent.agendaDaysCount:this.parent.activeViewOptions.interval;n=ve(t);do{(this.parent.activeViewOptions.showWeekend||this.isWorkDay(n,e))&&i.push(n),n=ye(n,1)}while(o!==i.length)}return e||(this.renderDates=i),this.parent.headerModule&&this.parent.headerModule.previousNextIconHandler(),i},t.prototype.getNextPreviousDate=function(e){if(this.previousNextAction=e,"Day"===this.parent.currentView||"TimelineDay"===this.parent.currentView){if(this.parent.activeViewOptions.showWeekend){var t=this.parent.activeViewOptions.interval;return ye(this.parent.selectedDate,"Next"===e?t:-t)}var i=void 0;if("Next"===e)for(i=ye(this.renderDates.slice(-1)[0],1);!this.isWorkDay(i);)i=ye(i,1);else{i=ye(this.renderDates[0],-1);var n=0;do{this.isWorkDay(i)&&(n+=1),this.parent.activeViewOptions.interval!==n&&(i=ye(i,-1))}while(this.parent.activeViewOptions.interval!==n)}return i}var r="Next"===e?ee:-ee;return ye(this.parent.selectedDate,r*this.parent.activeViewOptions.interval)},t.prototype.formatViewLabel=function(e,t,i){var n={type:"date",skeleton:"full",calendar:this.parent.getCalendarMode()};return this.parent.localeObj.getConstant(e)+" "+this.parent.localeObj.getConstant("start")+" "+this.parent.globalize.formatDate(t,n)+" "+this.parent.localeObj.getConstant("endAt")+" "+this.parent.globalize.formatDate(i,n)},t.prototype.getLabelText=function(e){var t=e.charAt(0).toLowerCase()+e.substring(1);return"Year"===e||"TimelineYear"===e?this.formatViewLabel(t,this.parent.activeView.getStartDate(),this.parent.activeView.getEndDate()):this.renderDates.length>0?"Day"===this.parent.currentView||"TimelineDay"===this.parent.currentView?this.parent.localeObj.getConstant(t)+" of "+je(this.parent.globalize.formatDate(this.parent.selectedDate,{type:"date",skeleton:"full",calendar:this.parent.getCalendarMode()}),"single"):this.formatViewLabel(t,this.renderDates[0],this.renderDates[this.renderDates.length-1]):""},t.prototype.getDateRangeText=function(e,t){if(void 0===e&&(e=this.renderDates[0]),void 0===t&&(t=this.renderDates),this.parent.isAdaptive){var i=this.parent.activeViewOptions.dateFormat?this.parent.activeViewOptions.dateFormat:"MMMM y";return je(this.parent.globalize.formatDate(this.parent.selectedDate,{format:i,calendar:this.parent.getCalendarMode()}),"single")}return this.formatDateRange(e,t[t.length-1])},t.prototype.formatDateRange=function(t,i){var n,r=this.parent.globalize,a=this.parent.getCalendarMode();if(t===i&&(i=null),!(0,e.isNullOrUndefined)(this.parent.activeViewOptions.dateFormat)){return je(i?r.formatDate(t,{format:this.parent.activeViewOptions.dateFormat,calendar:a})+" - "+r.formatDate(i,{format:this.parent.activeViewOptions.dateFormat,calendar:a}):r.formatDate(t,{format:this.parent.activeViewOptions.dateFormat,calendar:a}),"multiple")}if(n=(0,e.isNullOrUndefined)(this.parent.locale)||"en"===this.parent.locale||"en-US"===this.parent.locale?(0,e.getValue)("dateFormats.long",(0,e.getDefaultDateObject)(a)):(0,e.getValue)("main."+this.parent.locale+".dates.calendars."+a+".dateFormats.long",e.cldrData),!i)return je(r.formatDate(t,{format:n,calendar:a}),"single");var s=n.trim().toLocaleLowerCase();return je("d"===s.substr(0,1)?t.getFullYear()===i.getFullYear()?t.getMonth()===i.getMonth()?r.formatDate(t,{format:"dd",calendar:a})+" - "+r.formatDate(i,{format:"dd MMMM yyyy",calendar:a}):r.formatDate(t,{format:"dd MMM",calendar:a})+" - "+r.formatDate(i,{format:"dd MMM yyyy",calendar:a}):r.formatDate(t,{format:"dd MMM yyyy",calendar:a})+" - "+r.formatDate(i,{format:"dd MMM yyyy",calendar:a}):"m"===s.substr(0,1)?t.getFullYear()===i.getFullYear()?t.getMonth()===i.getMonth()?r.formatDate(t,{format:"MMMM dd",calendar:a})+" - "+r.formatDate(i,{format:"dd, yyyy",calendar:a}):r.formatDate(t,{format:"MMM dd",calendar:a})+" - "+r.formatDate(i,{format:"MMM dd, yyyy",calendar:a}):r.formatDate(t,{format:"MMM dd, yyyy",calendar:a})+" - "+r.formatDate(i,{format:"MMM dd, yyyy",calendar:a}):r.formatDate(t,{format:n,calendar:a})+" - "+r.formatDate(i,{format:n,calendar:a}),"multiple")},t.prototype.getMobileDateElement=function(t,i){return(0,e.createElement)("div",{className:i,innerHTML:'<div class="e-m-date">'+this.parent.globalize.formatDate(t,{format:"d",calendar:this.parent.getCalendarMode()})+'</div><div class="e-m-day">'+je(this.parent.globalize.formatDate(t,{format:"E",calendar:this.parent.getCalendarMode()}),"single")+"</div>"})},t.prototype.setResourceHeaderContent=function(t,i,n){if(void 0===n&&(n=$i),this.parent.activeViewOptions.resourceHeaderTemplate){var r={resource:i.resource,resourceData:i.resourceData},a=this.parent.element.id+"_"+this.parent.activeViewOptions.resourceHeaderTemplateName+"resourceHeaderTemplate",s=[].slice.call(this.parent.getResourceHeaderTemplate()(r,this.parent,"resourceHeaderTemplate",a,!1,void 0,void 0,this.parent.root));(0,e.append)(s,t)}else{var o=(0,e.createElement)("div",{className:n});this.parent.sanitize(i.resourceData[i.resource.textField],o),t.appendChild(o)}},t.prototype.renderResourceMobileLayout=function(){this.parent.resourceBase.lastResourceLevel&&this.parent.resourceBase.lastResourceLevel.length<=0||(this.parent.resourceBase.renderResourceHeader(),this.parent.resourceBase.renderResourceTree())},t.prototype.addAutoHeightClass=function(t){!this.parent.uiStateValues.isGroupAdaptive&&this.parent.rowAutoHeight&&this.isTimelineView()&&this.parent.activeViewOptions.group.resources.length>0&&(0,e.addClass)([t],lr)},t.prototype.getColElements=function(){return[].slice.call(this.element.querySelectorAll("."+ri+" col, ."+it+" col"))},t.prototype.setColWidth=function(t){if(this.isTimelineView()){var i=this.getColElements(),n=this.element.querySelector("."+Je+" tbody"),r=this.parent.getElementWidth(n)/(i.length/2);if(t.offsetHeight!==t.clientHeight){var a=this.parent.element.querySelector("."+yt);(0,e.isNullOrUndefined)(a)||a.offsetHeight===t.clientHeight||(0,e.setStyleAttribute)(a,{height:(0,e.formatUnit)(t.clientHeight)})}var s="."+rt+",."+Vt+",.e-header-week-cell,.e-header-month-cell,.e-header-year-cell";[].slice.call(this.element.querySelectorAll(s)).forEach((function(t){var i=(0,e.isNullOrUndefined)(t.getAttribute("colspan"))?"1":t.getAttribute("colspan"),n=parseInt(i,10);(0,e.setStyleAttribute)(t,{width:(0,e.formatUnit)(r*n)})}))}},t.prototype.resetColWidth=function(){for(var e=0,t=this.getColElements();e<t.length;e++){t[e].style.width=""}},t.prototype.getContentAreaElement=function(){return this.element.querySelector("."+ri)},t.prototype.wireExpandCollapseIconEvents=function(){if(this.parent.resourceBase&&this.parent.resourceBase.resourceCollection.length>1)for(var t=0,i=[].slice.call(this.element.querySelectorAll("."+Ct));t<i.length;t++){var n=i[t];e.EventHandler.clearEvents(n),e.EventHandler.add(n,"click",this.parent.resourceBase.onTreeIconClick,this.parent.resourceBase)}},t.prototype.scrollToDate=function(t){if(-1!==["Month","TimelineMonth"].indexOf(this.parent.currentView)&&!(0,e.isNullOrUndefined)(t)){var i=this.getContentAreaElement(),n=new Date(ve(new Date(+t)).getTime()).getTime(),r=i.querySelector("."+$e+'[data-date="'+n+'"]');"Month"===this.parent.currentView&&r&&(i.scrollWidth>i.clientWidth&&(this.parent.enableRtl?i.scrollLeft=-(this.parent.getContentTable().offsetWidth-r.offsetLeft-r.offsetWidth):i.scrollLeft=r.offsetLeft),i.scrollTop=r.offsetTop),"TimelineMonth"===this.parent.currentView&&r&&(this.parent.enableRtl?i.scrollLeft=-(this.parent.getContentTable().offsetWidth-r.offsetLeft-r.offsetWidth):i.scrollLeft=r.offsetLeft)}},t.prototype.setPersistence=function(){if(this.parent.enablePersistence){var t=this.element.querySelector(".e-content-wrap");(0,e.isNullOrUndefined)(t)||(this.parent.scrollLeft=t.scrollLeft,this.parent.scrollTop=t.scrollTop)}},t.prototype.retainScrollPosition=function(){if(this.parent.enablePersistence){var t=this.parent.element.querySelector(".e-content-wrap");(0,e.isNullOrUndefined)(t)||(0,e.isNullOrUndefined)(this.parent.scrollLeft)||(0,e.isNullOrUndefined)(this.parent.scrollTop)||(t.scrollTop=this.parent.scrollTop,t.scrollLeft=this.parent.scrollLeft)}},t.prototype.getViewStartDate=function(){var e=this.renderDates[0];return this.parent.activeViewOptions.group.resources.length>0&&this.parent.resourceBase.lastResourceLevel.length>0&&(e=this.parent.resourceBase.getResourceRenderDates()[0]),e},t.prototype.getViewEndDate=function(){var e=ye(this.renderDates[this.renderDates.length-1],1);return this.parent.activeViewOptions.group.resources.length>0&&this.parent.resourceBase.lastResourceLevel.length>0&&(e=ye(this.parent.resourceBase.getResourceRenderDates().slice(-1)[0],1)),e},t.prototype.getAdjustedDate=function(e){return!this.parent.activeViewOptions.timeScale.enable||"Month"===this.parent.currentView||"TimelineYear"===this.parent.currentView&&0===this.parent.activeViewOptions.group.resources.length?new Date(e.setHours(0,0,0,0)):"TimelineYear"===this.parent.currentView&&this.parent.activeViewOptions.group.resources.length>0?(e.setHours(0,0,0,0),new Date(e.setDate(1))):null},t.prototype.resetColLevels=function(){this.parent.resourceBase.expandedResources=[];for(var e=this.parent.virtualScrollModule.getRenderedCount(),t=this.parent.activeViewOptions.group.byDate?this.colLevels[0]:this.parent.resourceBase.renderedResources,i=0,n=0;n<t.length&&!(i>=e);n++)i+=t[parseInt(n.toString(),10)].colSpan,this.parent.resourceBase.expandedResources.push(t[parseInt(n.toString(),10)]);this.parent.activeViewOptions.group.byDate?(this.colLevels[0]=this.parent.resourceBase.expandedResources,this.parent.virtualScrollModule.setRenderedDates(this.parent.resourceBase.expandedResources)):(this.colLevels[this.colLevels.length-2]=this.parent.resourceBase.expandedResources,this.parent.resourceBase.renderedResources=this.parent.resourceBase.expandedResources),"Month"!==this.parent.currentView&&(this.colLevels[this.colLevels.length-1]=this.colLevels[this.colLevels.length-1].slice(0,i),this.parent.resourceBase.expandedResources=this.colLevels[this.colLevels.length-1])},t.prototype.getGroupIndices=function(t){var i=[];return this.parent.virtualScrollModule&&this.parent.activeViewOptions.group.resources.length>0&&(t||this.parent.virtualScrollModule.existingDataCollection.length>0)&&!this.parent.uiStateValues.isGroupAdaptive&&(i=(t=(0,e.isNullOrUndefined)(t)?this.parent.virtualScrollModule.existingDataCollection:t).map((function(e){return e.groupIndex}))),i},t.prototype.destroy=function(){this.element&&this.element.parentNode&&(0,e.remove)(this.element),this.element=null,this.renderDates=null,this.colLevels=null},t}(),el=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),tl=function(t){function i(e){var i=t.call(this,e)||this;return i.viewClass="e-day-view",i.isInverseTableSelect=!0,i.baseCssClass="e-vertical-view",i.appointment=null,i}return el(i,t),i.prototype.getModuleName=function(){return"verticalView"},i.prototype.addEventListener=function(){this.parent.on(Q,this.scrollUiUpdate,this),this.parent.on(z,this.renderEvents,this)},i.prototype.removeEventListener=function(){this.parent&&(this.parent.off(Q,this.scrollUiUpdate),this.parent.off(z,this.renderEvents))},i.prototype.renderEvents=function(){this.appointment=this.parent.activeViewOptions.timeScale.enable?new Ma(this.parent):new Ra(this.parent),this.appointment.renderAppointments(),this.parent.notify(Y,{})},i.prototype.onContentScroll=function(t){this.parent.removeNewEventElement();var i=t.target;this.parent.notify(X,t),this.scrollLeftPanel(i),this.scrollTopPanel(i),this.parent.isAdaptive||(this.parent.uiStateValues.top=i.scrollTop),this.parent.uiStateValues.left=i.scrollLeft,(0,e.isNullOrUndefined)(this.parent.quickPopup)||this.parent.uiStateValues.isTapHold||this.parent.quickPopup.quickPopupHide(),this.setPersistence()},i.prototype.onAdaptiveMove=function(e){this.parent.uiStateValues.action&&e.preventDefault()},i.prototype.onAdaptiveScroll=function(e){this.parent&&!this.parent.isDestroyed&&(this.parent.removeNewEventElement(),this.parent.uiStateValues.top=e.target.scrollTop)},i.prototype.scrollLeftPanel=function(t){var i=this.getLeftPanelElement();(0,e.isNullOrUndefined)(i)||(i.scrollTop=t.scrollTop)},i.prototype.scrollUiUpdate=function(t){if(this.parent){var i=this.parent.element.querySelector("."+it),n=this.getHeaderBarHeight(),r=this.getLeftPanelElement(),a=this.getScrollableElement(),s=this.getDatesHeaderElement(),o=this.parent.element.offsetHeight-n-s.offsetHeight;this.setContentHeight(a,r,o),this.setColWidth(a);var l=xe();s.firstElementChild.style[t.cssProperties.rtlBorder]="",s.style[t.cssProperties.rtlPadding]="";var p=!this.parent.enableAllDayScroll||!(a.offsetWidth-a.clientWidth<=i.offsetWidth-i.clientWidth&&i.classList.contains("e-all-day-scroll"));a.offsetWidth-a.clientWidth>0&&p?(s.firstElementChild.style[t.cssProperties.border]=l>0?"1px":"0px",s.style[t.cssProperties.padding]=l>0?l-1+"px":"0px"):(s.firstElementChild.style[t.cssProperties.border]="",s.style[t.cssProperties.padding]=""),t.isPreventScrollUpdate||(this.parent.uiStateValues.isInitial?(this.parent.currentView.indexOf("Timeline")>-1&&(a.scrollTop=this.parent.uiStateValues.top),this.scrollToWorkHour(),this.parent.uiStateValues.isInitial=!1):(r&&(r.scrollTop=this.parent.uiStateValues.top),a.scrollTop=this.parent.uiStateValues.top,a.scrollLeft=this.parent.uiStateValues.left)),this.parent.activeViewOptions.timeScale.enable&&this.highlightCurrentTime(),this.retainScrollPosition(),(0,e.isNullOrUndefined)(r)||(0,e.isNullOrUndefined)(a)||r.scrollTop===a.scrollTop||(r.scrollTop=a.scrollTop)}},i.prototype.setContentHeight=function(t,i,n){this.parent.isAdaptive&&!this.isTimelineView()||(0,e.isNullOrUndefined)(i)||(i.style.height="auto"===this.parent.height?"auto":(0,e.formatUnit)(n-this.getScrollXIndent(t))),t.style.height="auto"===this.parent.height?"auto":(0,e.formatUnit)(n)},i.prototype.scrollToWorkHour=function(){if(this.parent.workHours.highlight){var e=this.element.querySelector("."+et);e&&(this.getScrollableElement().scrollTop=e.offsetTop,this.parent.uiStateValues.top=e.offsetTop,this.parent.uiStateValues.left=0)}},i.prototype.scrollToHour=function(t,i){var n=this.parent.getStartEndTime(t);if(!(0,e.isNullOrUndefined)(i)){var r=this.element.querySelector("."+rt+'[data-date="'+new Date(ve(i)).getTime()+'"]');if(r)if(this.parent.enableRtl){var a=this.element.querySelector("."+Je);this.getScrollableElement().scrollLeft=-(a.offsetWidth-r.offsetLeft-r.offsetWidth)}else this.getScrollableElement().scrollLeft=r.offsetLeft}(0,e.isNullOrUndefined)(n)||(this.getScrollableElement().scrollTop=this.getTopFromDateTime(n))},i.prototype.scrollToDate=function(e){this.scrollToHour(null,e)},i.prototype.generateColumnLevels=function(){var e=this.getDateSlots(this.renderDates,this.parent.activeViewOptions.workDays),t=[];if(this.parent.activeViewOptions.group.resources.length>0){if(t=this.parent.resourceBase.generateResourceLevels(e),this.parent.activeViewOptions.group.hideNonWorkingDays)for(;0===t[0].length;)this.parent.setProperties({selectedDate:this.parent.activeView.getNextPreviousDate(this.previousNextAction)},!0),this.parent.activeView.getRenderDates(),this.parent.headerModule&&(this.parent.headerModule.setCalendarDate(this.parent.selectedDate),this.parent.headerModule.updateDateRange()),e=this.getDateSlots(this.renderDates,this.parent.activeViewOptions.workDays),t=this.parent.resourceBase.generateResourceLevels(e);if(this.parent.uiStateValues.isGroupAdaptive&&this.parent.resourceBase.lastResourceLevel.length>0){var i=this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex],n=i.resourceData[i.resource.startHourField],r=i.resourceData[i.resource.endHourField];t=[this.getDateSlots(i.renderDates,i.workDays,n,r)]}}else t.push(e);return this.colLevels=t,t},i.prototype.getDateSlots=function(e,t,i,n){void 0===i&&(i=this.parent.workHours.start),void 0===n&&(n=this.parent.workHours.end);for(var r=[],a=this.parent.getStartEndTime(i),s=this.parent.getStartEndTime(n),o=0,l=e;o<l.length;o++){var p=l[o],c=[rt];this.isCurrentDate(p)&&c.push(ot),r.push({date:p,type:"dateHeader",className:c,colSpan:1,workDays:t,startHour:new Date(+a),endHour:new Date(+s)})}return r},i.prototype.isWorkHourRange=function(e){return this.getStartHour().getTime()<=e.getTime()&&this.getEndHour().getTime()>=e.getTime()},i.prototype.highlightCurrentTime=function(){var t=this;if(!(this.parent.activeViewOptions.headerRows.length>0&&"Hour"!==this.parent.activeViewOptions.headerRows.slice(-1)[0].option)){var i=this.parent.getCurrentTime();if(this.parent.showTimeIndicator&&this.isWorkHourRange(i))if(this.getCurrentTimeIndicatorIndex().length>0&&!(0,e.isNullOrUndefined)(this.element.querySelector("."+$e))){if(this.changeCurrentTimePosition(),(0,e.isNullOrUndefined)(this.currentTimeIndicatorTimer)){var n=ne-(1e3*i.getSeconds()+i.getMilliseconds());n<=ne-1e3&&window.setTimeout((function(){(0,e.isNullOrUndefined)(t.currentTimeIndicatorTimer)||(t.clearCurrentTimeIndicatorTimer(),t.changeCurrentTimePosition(),t.updateCurrentTimeIndicatorTimer())}),n),this.updateCurrentTimeIndicatorTimer()}}else this.clearCurrentTimeIndicatorTimer();else this.clearCurrentTimeIndicatorTimer()}},i.prototype.getCurrentTimeIndicatorIndex=function(){var t=[];if(!(0,e.isNullOrUndefined)(this.parent.resourceBase)&&this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive){var i=0,n=ve(this.parent.getCurrentTime());if(this.parent.virtualScrollModule&&this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.activeViewOptions.group.byDate)for(var r=0,a=this.parent.resourceBase.expandedResources;r<a.length;r++){ve((l=a[r]).date).getTime()===n.getTime()&&t.push(i),i+=1}else for(var s=0,o=this.parent.resourceBase.renderedResources;s<o.length;s++){var l=o[s];if((c=this.parent.getIndexOfDate(l.renderDates,n))>=0){var p=this.parent.activeViewOptions.group.byDate?this.parent.resourceBase.lastResourceLevel.length*c+i:i+c;t.push(p)}i+=this.parent.activeViewOptions.group.byDate?1:l.renderDates.length}}else{var c,h=this.parent.uiStateValues.isGroupAdaptive&&this.parent.resourceBase.lastResourceLevel.length>0?this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex].renderDates:this.renderDates;(c=this.parent.getIndexOfDate(h,ve(this.parent.getCurrentTime())))>=0&&t.push(c)}return t},i.prototype.clearCurrentTimeIndicatorTimer=function(){(0,e.isNullOrUndefined)(this.currentTimeIndicatorTimer)||(window.clearInterval(this.currentTimeIndicatorTimer),this.currentTimeIndicatorTimer=null,this.removeCurrentTimeIndicatorElements())},i.prototype.updateCurrentTimeIndicatorTimer=function(){var e=this;this.currentTimeIndicatorTimer=window.setInterval((function(){e.changeCurrentTimePosition()}),ne)},i.prototype.removeCurrentTimeIndicatorElements=function(){for(var t="."+kt+",."+Mt+",."+It,i=0,n=[].slice.call(this.element.querySelectorAll(t));i<n.length;i++){var r=n[i];(0,e.remove)(r)}},i.prototype.changeCurrentTimePosition=function(){if(!(!this.parent||this.parent&&this.parent.isDestroyed)){this.removeCurrentTimeIndicatorElements();var t=this.getCurrentTimeIndicatorIndex(),i=this.parent.getContentTable().rows[0],n=this.getTopFromDateTime(this.parent.getCurrentTime()),r=(0,e.formatUnit)(n),a=Math.floor(n/i.cells[0].offsetHeight),s=this.getLeftPanelElement(),o=[].slice.call(s.querySelectorAll("tr"));if(!(0,e.isNullOrUndefined)(a)&&!isNaN(a)&&a!==o.length){for(var l=[].slice.call(this.element.querySelectorAll("."+Pt)),p=0,c=t[0];p<c;p++)l[parseInt(p.toString(),10)].appendChild((0,e.createElement)("div",{className:kt,styles:"top:"+r}));for(var h=0,d=t;h<d.length;h++){var u=d[h];l.length>u&&l[parseInt(u.toString(),10)].appendChild((0,e.createElement)("div",{className:Mt,styles:"top:"+r}))}var g=(0,e.createElement)("div",{innerHTML:this.parent.getTimeString(this.parent.getCurrentTime()),className:It,styles:"top:"+r});a<=o.length&&((0,e.removeClass)(s.querySelectorAll("."+Rt),Rt),o[parseInt(a.toString(),10)]&&(0,e.addClass)([o[parseInt(a.toString(),10)].lastElementChild],Rt),(0,e.prepend)([g],s),g.style.top=(0,e.formatUnit)(g.offsetTop-g.offsetHeight/2))}}},i.prototype.getTopFromDateTime=function(e){var t=this.getStartEndHours(this.parent.activeViewOptions.startHour),i=this.getStartEndHours(this.parent.activeViewOptions.endHour),n=60*(e.getHours()-t.getHours())+(e.getMinutes()-t.getMinutes()),r=De(ve(new Date(e.getTime())),t,i),a=(r.endHour.getTime()-r.startHour.getTime())/ne,s=this.parent.activeViewOptions.timeScale.interval,o=0;return o=0===t.getHours()&&0===t.getMinutes()&&0===i.getHours()&&0===i.getMinutes()||1!==this.parent.activeViewOptions.timeScale.slotCount?s:s>a?a:s,n*this.getWorkCellHeight()*this.parent.activeViewOptions.timeScale.slotCount/o},i.prototype.getWorkCellHeight=function(){return parseFloat(this.parent.getElementHeight(this.element.querySelector("."+$e)).toFixed(2))},i.prototype.getTdContent=function(t,i,n){var r,a=(0,e.createElement)("div"),s="",o=this.parent.element.id+"_";switch(i){case"dateHeader":if(this.parent.activeViewOptions.dateHeaderTemplate){s="dateHeaderTemplate";var l={date:t,type:i},p=this.parent.activeViewOptions.dateHeaderTemplateName;r=[].slice.call(this.parent.getDateHeaderTemplate()(l,this.parent,s,o+p+s,!1,void 0,void 0,this.parent.root))}else a.innerHTML=this.parent.activeView.isTimelineView()?'<span class="e-header-date e-navigate">'+this.getTimelineDate(t)+"</span>":'<div class="e-header-day">'+je(this.getDayName(t),"single")+'</div><div class="e-header-date e-navigate" role="link">'+this.getDate(t)+"</div>",r=[].slice.call(a.childNodes);break;case"majorSlot":if(this.parent.activeViewOptions.timeScale.majorSlotTemplate){s="majorSlotTemplate";l={date:t,type:i};r=[].slice.call(this.parent.getMajorSlotTemplate()(l,this.parent,s,o+s,!1,void 0,void 0,this.parent.root))}else a.innerHTML="<span>"+this.getTime(t)+"</span>",r=[].slice.call(a.childNodes);break;case"minorSlot":if(this.parent.activeViewOptions.timeScale.minorSlotTemplate){s="minorSlotTemplate";l={date:t,type:i};r=[].slice.call(this.parent.getMinorSlotTemplate()(l,this.parent,s,o+s,!1,void 0,void 0,this.parent.root))}else r=[].slice.call(a.childNodes);break;case"alldayCells":if(this.parent.activeViewOptions.cellTemplate){p=this.parent.activeViewOptions.cellTemplateName;s="cellTemplate";l={date:t,type:i,groupIndex:n};r=[].slice.call(this.parent.getCellTemplate()(l,this.parent,s,o+p+s,!1,void 0,void 0,this.parent.root))}}return r},i.prototype.refreshHeader=function(){(0,e.remove)(this.element.querySelector("tbody tr")),this.renderHeader(),this.parent.notify(_,{});var t=this.element.querySelector("."+it);t&&(t.scrollLeft=this.parent.uiStateValues.left)},i.prototype.renderLayout=function(t){this.setPanel((0,e.createElement)("div",{className:ii}));var i=[this.baseCssClass,this.viewClass];i.push(t),this.parent.activeViewOptions.group.byDate&&i.push("e-by-date"),this.parent.activeViewOptions.timeScale.enable||(0,e.addClass)([this.element],["e-timescale-disable",this.viewClass]),this.parent.activeViewOptions.allowVirtualScrolling&&!this.parent.uiStateValues.isGroupAdaptive&&i.push(sr),this.parent.rowAutoHeight&&this.parent.eventSettings.ignoreWhitespace&&i.push(pr),this.renderPanel(t),(0,e.addClass)([this.element],i),this.element.appendChild(this.createTableLayout(ni)),this.element.querySelector("table").setAttribute("role","presentation"),this.colLevels=this.generateColumnLevels(),this.renderHeader(),this.renderContent(),this.parent.uiStateValues.isGroupAdaptive&&!this.parent.element.querySelector("."+qt)&&this.renderResourceMobileLayout(),this.parent.notify(_,{})},i.prototype.renderHeader=function(){var t=(0,e.createElement)("tr"),i=(0,e.createElement)("td");if(i.appendChild(this.renderDatesHeader()),this.parent.activeViewOptions.timeScale.enable){var n=(0,e.createElement)("td",{className:ut});n.appendChild(this.renderLeftIndent()),t.appendChild(n)}t.appendChild(i),(0,e.prepend)([t],this.element.querySelector("tbody"))},i.prototype.renderContent=function(){this.parent.activeViewOptions.group.resources.length>0&&(this.parent.resourceBase.renderedResources=(0,e.extend)([],this.parent.resourceBase.lastResourceLevel,null,!0));var t=(0,e.createElement)("tr"),i=(0,e.createElement)("td");if(this.parent.isAdaptive){i.setAttribute("colspan",this.parent.activeViewOptions.timeScale.enable?"2":"1");var n=(0,e.createElement)("div",{className:Ht});this.parent.activeViewOptions.timeScale.enable&&n.appendChild(this.renderTimeCells()),n.appendChild(this.renderContentArea()),i.appendChild(n),e.EventHandler.add(n,"scroll",this.onAdaptiveScroll,this),e.EventHandler.add(n,e.Browser.touchMoveEvent,this.onAdaptiveMove,this),t.appendChild(i)}else{var r=this.colLevels.slice(0);this.parent.virtualScrollModule&&this.resetColLevels();var a=this.renderContentArea();if(i.appendChild(a),this.parent.activeViewOptions.timeScale.enable){var s=(0,e.createElement)("td");s.appendChild(this.renderTimeCells()),t.appendChild(s)}t.appendChild(i),this.parent.virtualScrollModule&&(this.colLevels=r,this.parent.virtualScrollModule.renderVirtualTrack(a))}this.element.querySelector("tbody").appendChild(t)},i.prototype.renderLeftIndent=function(){for(var t,i=(0,e.createElement)("div",{className:gt}),n=this.createTableLayout(),r=(0,e.createElement)("tr"),a=this.colLevels.length,s=0;s<a;s++){var o=r.cloneNode(),l={className:[this.colLevels[parseInt(s.toString(),10)][0]&&this.colLevels[parseInt(s.toString(),10)][0].className[0]],type:"emptyCells"};if(this.parent.activeViewOptions.showWeekNumber&&-1!==l.className.indexOf(rt)){l.className.push(zt);var p=this.parent.getWeekNumberContent(this.renderDates);l.template=[(0,e.createElement)("span",{innerHTML:""+p,attrs:{title:this.parent.localeObj.getConstant("week")+" "+p}})]}t=this.createTd(l),this.parent.renderHeaderIndentTemplate(l,t),o.appendChild(t),n.querySelector("tbody").appendChild(o)}var c=r.cloneNode(),h=(0,e.createElement)("div",{attrs:{tabindex:"0",role:"button",title:this.parent.localeObj.getConstant("expandAllDaySection"),"aria-disabled":"false","aria-label":this.parent.localeObj.getConstant("expandAllDaySection")},className:qi+" "+Fi+" "+Ye+" "+Ge}),d={className:[Ke],type:"emptyCells"};return(t=this.createTd(d)).appendChild(h),this.parent.renderHeaderIndentTemplate(d,t),c.appendChild(t),n.querySelector("tbody").appendChild(c),i.appendChild(n),i},i.prototype.renderDatesHeader=function(){var t=(0,e.createElement)("div",{className:nt}),i=(0,e.createElement)("div",{className:it});t.appendChild(i);for(var n=this.createTableLayout(),r=(0,e.createElement)("tr",{className:Hi}),a=this.colLevels.length,s=this.colLevels[a-1],o=0;o<a;o++){for(var l=r.cloneNode(),p=this.colLevels[parseInt(o.toString(),10)],c=0;c<p.length;c++)l.appendChild(this.createTd(p[parseInt(c.toString(),10)]));n.querySelector("tbody").appendChild(l)}return this.createAllDayRow(n,s),this.createColGroup(n,s),i.appendChild(n),t},i.prototype.createAllDayRow=function(t,i){for(var n=(0,e.createElement)("tr",{className:Ze}),r=0;r<i.length;r++){var a=(0,e.extend)({},i[parseInt(r.toString(),10)]);a.className=[Ke],a.type="alldayCells";var s=this.createTd(a);s.setAttribute("data-date",a.date.getTime().toString()),(0,e.isNullOrUndefined)(a.groupIndex)?this.parent.uiStateValues.isGroupAdaptive&&s.setAttribute("data-group-index",""+this.parent.uiStateValues.groupIndex):s.setAttribute("data-group-index",""+a.groupIndex),this.wireCellEvents(s),n.appendChild(s)}t.querySelector("tbody").appendChild(n);var o=(0,e.createElement)("thead");o.appendChild(this.parent.eventBase.createEventWrapper("allDay")),(0,e.prepend)([o],t)},i.prototype.createTd=function(t){var i=(0,e.createElement)("td");if(this.addAttributes(t,i),t.date&&t.type){var n=this.getTdContent(t.date,t.type,t.groupIndex);n&&n.length&&(0,e.append)(n,i)}this.parent.isMinMaxDate(ve(new Date(""+t.date)))||(0,e.addClass)([i],Qn),"resourceHeader"===t.type&&this.setResourceHeaderContent(i,t),"dateHeader"===t.type&&t.className.indexOf(rt)>=0&&(i.setAttribute("data-date",t.date.getTime().toString()),(0,e.isNullOrUndefined)(t.groupIndex)||i.setAttribute("data-group-index",""+t.groupIndex),this.wireMouseEvents(i));var r={elementType:t.type,element:i,date:t.date,groupIndex:t.groupIndex};return this.parent.trigger(v,r),i},i.prototype.wireCellEvents=function(t){e.EventHandler.add(t,"mousedown",this.parent.workCellAction.cellMouseDown,this.parent.workCellAction),this.wireMouseEvents(t)},i.prototype.wireMouseEvents=function(t){e.EventHandler.add(t,"click",this.parent.workCellAction.cellClick,this.parent.workCellAction),this.parent.isAdaptive||e.EventHandler.add(t,"dblclick",this.parent.workCellAction.cellDblClick,this.parent.workCellAction)},i.prototype.renderTimeCells=function(){var t=this,i=(0,e.createElement)("div",{className:Et}),n=this.createTableLayout(),r=(0,e.createElement)("tr");return this.getTimeSlotRows((function(e){e.type=e.first?"majorSlot":"minorSlot",e.className=e.last?[xt,Vt]:[Vt];var i=r.cloneNode(),a={date:e.date,type:e.type,className:e.className};return i.appendChild(t.createTd(a)),n.querySelector("tbody").appendChild(i),e})),i.appendChild(n),i},i.prototype.renderContentArea=function(){var t=(0,e.createElement)("div",{className:ri}),i=this.createTableLayout(Je);return this.setAriaAttributes(i),this.addAutoHeightClass(i),this.renderContentTable(i),this.createColGroup(i,this.colLevels.slice(-1)[0]),t.appendChild(i),this.wireCellEvents(i.querySelector("tbody")),e.EventHandler.add(t,"scroll",this.onContentScroll,this),e.EventHandler.add(t,e.Browser.touchMoveEvent,this.onAdaptiveMove,this),t},i.prototype.renderContentTable=function(t){var i=t.querySelector("tbody");(0,e.append)(this.getContentRows(),i),this.renderContentTableHeader(t)},i.prototype.getContentRows=function(){var t=this,i=[],n=(0,e.createElement)("tr"),r=(0,e.createElement)("td"),a=this.getGroupIndices();return this.getTimeSlotRows((function(e){for(var s=n.cloneNode(),o=0,l=t.colLevels[t.colLevels.length-1];o<l.length;o++){var p=l[o],c=!0;if(t.parent.virtualScrollModule&&t.parent.activeViewOptions.group.resources.length>0&&a.indexOf(p.groupIndex)>-1&&(c=!1),c){var h=t.createContentTd(p,e,r);s.appendChild(h)}}return i.push(s),e})),i},i.prototype.createContentTd=function(t,i,n){var r=n.cloneNode();t.colSpan&&r.setAttribute("colspan",t.colSpan.toString());var a=this.getContentTdClass(i),s=ve(t.date);this.parent.isMinMaxDate(s)||a.push(Qn),s=new Date(s.setHours(i.date.getHours(),i.date.getMinutes(),i.date.getSeconds(),i.date.getMilliseconds()));var o="workCells";if(-1!==t.className.indexOf(Dt)&&(a.push(mt),o="resourceGroupCells"),this.parent.workHours.highlight&&(this.parent.activeViewOptions.timeScale.enable&&this.isWorkHour(s,t.startHour,t.endHour,t.workDays)||!this.parent.activeViewOptions.timeScale.enable&&this.isWorkDay(s,t.workDays))&&a.push(et),(0,e.addClass)([r],a),this.parent.activeViewOptions.cellTemplate){var l={date:s,type:o,groupIndex:t.groupIndex},p=this.parent.element.id+"_"+this.parent.activeViewOptions.cellTemplateName+"cellTemplate",c=[].slice.call(this.parent.getCellTemplate()(l,this.parent,"cellTemplate",p,!1,void 0,void 0,this.parent.root));(0,e.append)(c,r)}r.setAttribute("data-date",s.getTime().toString());var h="full";if(this.parent.activeViewOptions.timeScale.enable){var d=this.parent.globalize.formatDate(s,{type:"dateTime",skeleton:h,calendar:this.parent.getCalendarMode()}),u=this.parent.globalize.formatDate(this.getEndDateFromStartDate(s),{type:"dateTime",skeleton:h,calendar:this.parent.getCalendarMode()});r.setAttribute("aria-label",d+" "+this.parent.localeObj.getConstant("endAt")+" "+u)}else{var g=this.parent.globalize.formatDate(t.date,{skeleton:h,calendar:this.parent.getCalendarMode()});r.setAttribute("aria-label",g)}if(!(0,e.isNullOrUndefined)(t.groupIndex)||this.parent.uiStateValues.isGroupAdaptive){var m=this.parent.uiStateValues.isGroupAdaptive?this.parent.uiStateValues.groupIndex:t.groupIndex;r.setAttribute("data-group-index",""+m)}var f={elementType:o,element:r,date:s,groupIndex:t.groupIndex};return this.parent.trigger(v,f),r},i.prototype.getContentTdClass=function(e){return e.last?[$e]:[$e,At]},i.prototype.renderContentTableHeader=function(t){var i=(0,e.createElement)("thead");i.appendChild(this.parent.eventBase.createEventWrapper()),this.parent.activeViewOptions.timeScale.enable&&i.appendChild(this.parent.eventBase.createEventWrapper("timeIndicator")),(0,e.prepend)([i],t)},i.prototype.getScrollableElement=function(){return this.parent.isAdaptive&&!this.isTimelineView()?this.element.querySelector("."+Ht):this.getContentAreaElement()},i.prototype.getLeftPanelElement=function(){return this.element.querySelector("."+Et)},i.prototype.getEndDateFromStartDate=function(e){var t=this.parent.activeViewOptions.timeScale.interval*ne/this.parent.activeViewOptions.timeScale.slotCount,i=new Date(e.getTime());return i.setMilliseconds(i.getMilliseconds()+t),i},i.prototype.getStartEndHours=function(t){if(!(0,e.isNullOrUndefined)(t)&&""!==t){var i=new Date(2e3,0,0,0),n=t.split(":");return 2===n.length&&i.setHours(parseInt(n[0],10),parseInt(n[1],10),0),i}return new Date(2e3,0,0,0)},i.prototype.getTimeSlotRows=function(e){var t=[],i=this.getStartEndHours(this.parent.activeViewOptions.startHour),n=this.getStartEndHours(this.parent.activeViewOptions.endHour),r=this.parent.activeViewOptions.timeScale.interval*ne,a=r/this.parent.activeViewOptions.timeScale.slotCount,s=Math.round(ie/a),o=i.getTime(),l=n.getTime();if(o!==l){var p=i.getTimezoneOffset()!==n.getTimezoneOffset()?l-o-36e5:l-o;s=Math.round(p/a)}this.parent.activeViewOptions.timeScale.enable||(s=1);for(var c=this.parent.getStartEndTime(this.parent.workHours.start),h=this.parent.getStartEndTime(this.parent.workHours.end),d=0;d<s;d++){var u=new Date(o+a*d);if(ke(u)||new Date(o).getTimezoneOffset()!==u.getTimezoneOffset()){var g=new Date(o).getTimezoneOffset()-u.getTimezoneOffset();u=new Date(u.getTime()-6e4*g)}var v=d%(r/a),m={date:new Date(""+u),startHour:c,endHour:h,first:0===v,middle:v<this.parent.activeViewOptions.timeScale.slotCount-1,last:v===this.parent.activeViewOptions.timeScale.slotCount-1,type:""};e&&e(m),t.push(m)}return t},i.prototype.getAdjustedDate=function(e){if(!this.parent.activeViewOptions.timeScale.enable)return new Date(e.setHours(0,0,0,0));for(var t=this.getTimeSlotRows(),i=new Date(new Date(t[0].date.getTime()).setHours(e.getHours(),e.getMinutes(),e.getMilliseconds())),n=0;n<t.length;n++)if(t[parseInt(n.toString(),10)].date.getTime()>i.getTime())return e.setHours(t[n-1].date.getHours(),t[n-1].date.getMinutes(),t[n-1].date.getMilliseconds()),new Date(e);return null},i.prototype.destroy=function(){if(!(!this.parent||this.parent&&this.parent.isDestroyed)&&(this.clearCurrentTimeIndicatorTimer(),this.element)){this.appointment&&(this.appointment.destroy(),this.appointment=null);var i=this.getContentAreaElement();i&&(e.EventHandler.remove(i,"scroll",this.onContentScroll),e.EventHandler.remove(i,e.Browser.touchMoveEvent,this.onAdaptiveMove)),this.parent.resourceBase&&this.parent.resourceBase.destroy(),this.parent.scheduleTouchModule&&this.parent.scheduleTouchModule.resetValues(),t.prototype.destroy.call(this)}},i}($o),il=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),nl=function(e){function t(t){var i=e.call(this,t)||this;return i.viewClass="e-day-view",i}return il(t,e),t.prototype.getModuleName=function(){return"day"},t}(tl),rl=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),al=function(e){function t(t){var i=e.call(this,t)||this;return i.viewClass="e-week-view",i}return rl(t,e),t.prototype.startDate=function(){return this.getViewStartDate()},t.prototype.endDate=function(){return this.getViewEndDate()},t.prototype.getModuleName=function(){return"week"},t}(tl),sl=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ol=function(e){function t(t){var i=e.call(this,t)||this;return i.viewClass="e-work-week-view",i}return sl(t,e),t.prototype.startDate=function(){return this.getViewStartDate()},t.prototype.endDate=function(){return this.getViewEndDate()},t.prototype.getModuleName=function(){return"workWeek"},t}(tl),ll=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),pl=function(t){function i(e){var i=t.call(this,e)||this;return i.dayNameFormat="wide",i.viewClass="e-month-view",i.isInverseTableSelect=!1,i.monthEvent=null,i.monthDates={},i}return ll(i,t),i.prototype.addEventListener=function(){this.parent.on(Q,this.onScrollUIUpdate,this),this.parent.on(z,this.onDataReady,this),this.parent.on(r,this.onCellClick,this)},i.prototype.removeEventListener=function(){this.parent&&(this.parent.off(Q,this.onScrollUIUpdate),this.parent.off(z,this.onDataReady),this.parent.off(r,this.onCellClick))},i.prototype.onDataReady=function(e){this.monthEvent=new Ra(this.parent),this.monthEvent.renderAppointments(),this.parent.notify(Y,{})},i.prototype.onCellClick=function(e){},i.prototype.onContentScroll=function(e){this.parent.removeNewEventElement(),this.parent.notify(X,e),this.scrollTopPanel(e.target),this.scrollLeftPanel(e.target),this.parent.uiStateValues.top=e.target.scrollTop,this.parent.uiStateValues.left=e.target.scrollLeft,this.setPersistence()},i.prototype.scrollLeftPanel=function(e){var t=this.getLeftPanelElement();t&&(t.scrollTop=e.scrollTop)},i.prototype.getLeftPanelElement=function(){return this.element.querySelector("."+Wt)},i.prototype.onScrollUIUpdate=function(e){var t=this.getHeaderBarHeight(),i=this.getDatesHeaderElement(),n=this.getContentAreaElement(),r=this.parent.element.offsetHeight-t-i.offsetHeight,a=this.getLeftPanelElement();"auto"!==this.parent.height&&this.setContentHeight(n,a,r);var s=xe();if(i.firstElementChild.style[e.cssProperties.rtlBorder]="",i.style[e.cssProperties.rtlPadding]="",n.offsetWidth-n.clientWidth>0?(i.firstElementChild.style[e.cssProperties.border]=s>0?"1px":"0px",i.style[e.cssProperties.padding]=s>0?s-1+"px":"0px"):(i.firstElementChild.style[e.cssProperties.border]="",i.style[e.cssProperties.padding]=""),this.setColWidth(n),e.scrollPosition||!e.isPreventScrollUpdate&&"TimelineMonth"===this.parent.currentView){var o="TimelineMonth"===this.parent.currentView?this.parent.uiStateValues.top:e.scrollPosition.top;a&&(a.scrollTop=o),n.scrollTop=o,this.parent.uiStateValues.isInitial?(this.scrollToSelectedDate(),this.parent.uiStateValues.isInitial=!1):n.scrollLeft="TimelineMonth"===this.parent.currentView?this.parent.uiStateValues.left:e.scrollPosition.left}this.retainScrollPosition()},i.prototype.scrollToSelectedDate=function(){var t=new Date(this.parent.selectedDate);t.setHours(0,0,0,0);var i=this.element.querySelector("."+rt+'[data-date="'+t.getTime().toString()+'"]'),n=this.getContentAreaElement();(0,e.isNullOrUndefined)(i)?n.scrollLeft=0:n.scrollLeft=this.parent.enableRtl?-(this.parent.getContentTable().offsetWidth-i.offsetLeft-i.offsetWidth):i.offsetLeft,0===n.scrollLeft&&this.parent.uiStateValues.isInitial&&(this.parent.uiStateValues.left=0)},i.prototype.setContentHeight=function(t,i,n){t.style.height="auto","Month"===this.parent.currentView&&(t.style.height=(0,e.formatUnit)(n)),i&&("MonthAgenda"===this.parent.currentView&&(n=this.parent.activeViewOptions.interval>1?this.getContentAreaElement().firstElementChild.offsetHeight:this.element.querySelector("."+Je).offsetHeight),i.style.height="auto",i.style.height=(0,e.formatUnit)(n-this.getScrollXIndent(t)))},i.prototype.generateColumnLevels=function(){var e=[],t=this.getDateSlots(this.renderDates,this.parent.activeViewOptions.workDays);if(this.parent.activeViewOptions.group.resources.length>0){if(e=this.parent.resourceBase.generateResourceLevels(t),"MonthAgenda"===this.parent.currentView&&(e=[t]),this.parent.uiStateValues.isGroupAdaptive&&this.parent.resourceBase.lastResourceLevel.length>0){var i=this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex],n=this.getDateSlots(i.renderDates,i.workDays);if(this.parent.activeViewOptions.group.byDate&&this.parent.activeViewOptions.group.hideNonWorkingDays){var r=n.findIndex((function(e,t){return 0!==t&&e.date.getDay()===n[0].date.getDay()}));n=r>-1?n.slice(0,r):n}e=[n]}}else e.push(t);return this.colLevels=e,e},i.prototype.getDateSlots=function(e,t){for(var i=this.parent.activeViewOptions.showWeekend?ee:t.length,n=[],r=this.isCurrentMonth(this.parent.selectedDate),a=0;a<i;a++){var s=[rt],o=e.slice(0,i).map((function(e){return e.getDay()}));r&&o.indexOf(this.parent.currentTimezoneDate.getDay())===a&&s.push(ot),n.push({date:e[parseInt(a.toString(),10)],type:"monthDay",className:s,colSpan:1,workDays:t})}return n},i.prototype.getDayNameFormat=function(){return this.parent.isAdaptive||this.parent.activeViewOptions.group.resources.length>0?"abbreviated":"wide"},i.prototype.renderLayout=function(t){this.dayNameFormat=this.getDayNameFormat(),this.setPanel((0,e.createElement)("div",{className:ii}));var i=[this.viewClass];i.push(t),this.parent.activeViewOptions.group.byDate&&(i.push("e-by-date"),"Month"!==this.parent.currentView&&(this.parent.activeViewOptions.group.hideNonWorkingDays=!1)),this.parent.activeViewOptions.allowVirtualScrolling&&!this.parent.uiStateValues.isGroupAdaptive&&i.push(sr),this.parent.rowAutoHeight&&this.parent.eventSettings.ignoreWhitespace&&i.push(pr),(0,e.addClass)([this.element],i),this.renderPanel(t),this.element.appendChild(this.createTableLayout(ni)),this.element.querySelector("table").setAttribute("role","presentation"),this.colLevels=this.generateColumnLevels(),this.renderHeader(),this.renderContent();var n="MonthAgenda"===this.parent.currentView?this.parent.activeView.getPanel():this.parent.element;this.parent.uiStateValues.isGroupAdaptive&&!n.querySelector("."+qt)&&this.renderResourceMobileLayout(),this.parent.notify(_,{}),this.parent.uiStateValues.isCustomMonth&&(this.parent.uiStateValues.isCustomMonth=!1)},i.prototype.refreshHeader=function(){(0,e.remove)(this.element.querySelector("tbody tr")),this.renderHeader(),this.parent.notify(_,{});var t=this.element.querySelector("."+it),i=this.element.querySelector("."+ri);t&&(t.scrollLeft=this.parent.uiStateValues.left),i&&(i.scrollLeft=this.parent.uiStateValues.left)},i.prototype.wireCellEvents=function(t){e.EventHandler.add(t,"mousedown",this.parent.workCellAction.cellMouseDown,this.parent.workCellAction),e.EventHandler.add(t,"click",this.parent.workCellAction.cellClick,this.parent.workCellAction),this.parent.isAdaptive||e.EventHandler.add(t,"dblclick",this.parent.workCellAction.cellDblClick,this.parent.workCellAction)},i.prototype.renderHeader=function(){var t=(0,e.createElement)("tr");this.renderLeftIndent(t);var i=(0,e.createElement)("td");i.appendChild(this.renderDatesHeader()),t.appendChild(i),(0,e.prepend)([t],this.element.querySelector("tbody"))},i.prototype.renderLeftIndent=function(t){this.parent.activeViewOptions.showWeekNumber&&t.appendChild((0,e.createElement)("td",{className:"e-left-indent"}))},i.prototype.renderContent=function(){this.parent.activeViewOptions.group.resources.length>0&&(this.parent.resourceBase.renderedResources=(0,e.extend)([],this.parent.resourceBase.lastResourceLevel,null,!0));var t=(0,e.createElement)("tr");this.parent.activeViewOptions.showWeekNumber&&t.appendChild(this.renderWeekNumberContent());var i=(0,e.createElement)("td"),n=this.colLevels.slice(0);this.parent.virtualScrollModule&&this.resetColLevels();var r=(0,e.createElement)("div",{className:ri}),a=this.renderContentArea();if("Month"===this.parent.currentView)r.appendChild(a);else{var s=(0,e.createElement)("div",{className:Xe});s.appendChild(a),r.appendChild(s)}e.EventHandler.add(r,"scroll",this.onContentScroll,this),i.appendChild(r),t.appendChild(i),this.parent.virtualScrollModule&&(this.colLevels=n,this.parent.virtualScrollModule.renderVirtualTrack(r)),this.element.querySelector("tbody").appendChild(t),this.renderAppointmentContainer()},i.prototype.renderWeekNumberContent=function(){var t=this.renderDates.map((function(e){return new Date(+e)})),i=(0,e.createElement)("td"),n=(0,e.createElement)("div",{className:Wt});i.appendChild(n);var r=this.createTableLayout();n.appendChild(r);for(var a=this.parent.activeViewOptions.showWeekend?ee:this.parent.activeViewOptions.workDays.length,s=0,o=this.renderDates.length/a;s<o;s++){var l=t.splice(0,a),p=this.parent.getWeekNumberContent(l);r.querySelector("tbody").appendChild(this.createWeekNumberElement(p))}return i},i.prototype.renderAppointmentContainer=function(){},i.prototype.renderDatesHeader=function(){var t=(0,e.createElement)("div",{className:nt}),i=(0,e.createElement)("div",{className:it});t.appendChild(i);var n=this.createTableLayout();if("Month"===this.parent.currentView){var r=(0,e.createElement)("thead");r.appendChild((0,e.createElement)("tr")),(0,e.prepend)([r],n)}this.createColGroup(n,this.colLevels[this.colLevels.length-1]);for(var a=(0,e.createElement)("tr"),s=0;s<this.colLevels.length;s++){for(var o=this.colLevels[parseInt(s.toString(),10)],l=a.cloneNode(),p=0;p<o.length;p++){var c=o[parseInt(p.toString(),10)];l.appendChild(this.createHeaderCell(c))}n.querySelector("tbody").appendChild(l)}return i.appendChild(n),t},i.prototype.createHeaderCell=function(t){var i=(0,e.createElement)("td");if(this.addAttributes(t,i),"monthDay"===t.type){var n=(0,e.createElement)("span",{innerHTML:je(this.parent.getDayNames(this.dayNameFormat)[t.date.getDay()],"single")});i.appendChild(n)}if("resourceHeader"===t.type&&this.setResourceHeaderContent(i,t),"dateHeader"===t.type){if((0,e.addClass)([i],ui),i.setAttribute("data-date",t.date.getTime().toString()),this.parent.activeViewOptions.dateHeaderTemplate){var r={date:t.date,type:t.type},a=this.parent.element.id+"_"+this.parent.activeViewOptions.dateHeaderTemplateName+"dateHeaderTemplate",s=[].slice.call(this.parent.getDateHeaderTemplate()(r,this.parent,"dateHeaderTemplate",a,!1,void 0,void 0,this.parent.root));s&&s.length&&(0,e.append)(s,i)}else{n=(0,e.createElement)("span",{className:di});var o=this.parent.globalize.formatDate(t.date,{skeleton:"full",calendar:this.parent.getCalendarMode()});n.setAttribute("title",je(o,"multiple"));var l=!this.parent.calendarUtil.isMonthStart(t.date)||this.isCurrentDate(t.date)||this.parent.isAdaptive?this.parent.globalize.formatDate(t.date,{skeleton:"d",calendar:this.parent.getCalendarMode()}):this.parent.globalize.formatDate(t.date,{format:"MMM d",calendar:this.parent.getCalendarMode()});n.innerHTML=je(l,"single"),i.appendChild(n)}this.wireCellEvents(i)}var p={elementType:t.type,element:i,date:t.date,groupIndex:t.groupIndex};return this.parent.trigger(v,p),i},i.prototype.getContentSlots=function(){if(!this.colLevels[this.colLevels.length-1]||!this.colLevels[this.colLevels.length-1][0])return[];var e=[],t=function(t,i,n,r){var a={date:new Date(+i),groupIndex:n.groupIndex,workDays:n.workDays,type:"monthCells",className:r||[$e]};e[parseInt(t.toString(),10)]||(e[parseInt(t.toString(),10)]=[]),e[parseInt(t.toString(),10)].push(a)},i="MonthAgenda"!==this.parent.currentView&&this.parent.activeViewOptions.group.resources.length>0;if(!i||this.parent.uiStateValues.isGroupAdaptive||this.parent.activeViewOptions.group.byDate){u=this.renderDates.map((function(e){return new Date(+e)})),g=this.parent.activeViewOptions.showWeekend?ee:this.parent.activeViewOptions.workDays.length;var n=this.colLevels.slice(0,1)[0],r=this.renderDates.map(Number).indexOf(+n[0].date);for(v=0;v<this.renderDates.length/g;v++){m=u.splice(0,g);for(var a,s=r,o=function(e){var n=m[parseInt(s.toString(),10)];if(s++,i){var r=l.colLevels[l.colLevels.length-1],o=r.length/g,p=r.slice(0,o);if(l.parent.activeViewOptions.group.hideNonWorkingDays&&0===(p=r.filter((function(e){return e.date.getDay()===n.getDay()}))).length)return a=e-=1,"continue";for(var c=0;c<p.length;c++){var h=void 0;0!==c&&(h=[$e,"e-disable-date"]),t(v,n,p[parseInt(c.toString(),10)],h)}}else t(v,n,l.colLevels[l.colLevels.length-1][0]);a=e},l=this,p=r;p<this.colLevels[0].length+r&&p<m.length;p++)o(p),p=a}}else for(var c=0,h=this.colLevels[this.colLevels.length-2];c<h.length;c++)for(var d=h[c],u=d.renderDates.map((function(e){return new Date(+e)})),g=this.parent.activeViewOptions.showWeekend?ee:d.workDays.length,v=0;v<d.renderDates.length/g;v++)for(var m,f=0,y=m=u.splice(0,g);f<y.length;f++){var T=y[f];t(v,T,d)}return e},i.prototype.updateClassList=function(e){!this.isCustomMonth()&&this.isOtherMonth(e.date)&&e.className.push(st),this.parent.isMinMaxDate(e.date)||e.className.push(Qn),this.updateSelectedCellClass(e)},i.prototype.updateSelectedCellClass=function(e){},i.prototype.isOtherMonth=function(e){return e.getTime()<this.monthDates.start.getTime()||e.getTime()>this.monthDates.end.getTime()},i.prototype.renderContentArea=function(){var t=this.createTableLayout(Je);this.setAriaAttributes(t),this.addAutoHeightClass(t),"TimelineMonth"===this.parent.currentView&&this.createColGroup(t,this.colLevels[this.colLevels.length-1]);var i=new Date(this.parent.selectedDate.getTime());this.monthDates={start:this.parent.calendarUtil.firstDateOfMonth(i),end:this.parent.calendarUtil.lastDateOfMonth(Te(i,this.parent.activeViewOptions.interval-1))};var n=t.querySelector("tbody");return(0,e.append)(this.getContentRows(),n),this.wireCellEvents(n),t},i.prototype.getContentRows=function(){for(var t=[],i=(0,e.createElement)("tr"),n=(0,e.createElement)("td"),r=this.getContentSlots(),a="TimelineMonth"===this.parent.currentView?this.getGroupIndices():[],s=0;s<r.length;s++)if(!(a.length>0&&a.indexOf(r[parseInt(s.toString(),10)][0].groupIndex)>-1)){for(var o=i.cloneNode(),l=0;l<r[parseInt(s.toString(),10)].length;l++){var p=this.createContentTd(r[parseInt(s.toString(),10)][parseInt(l.toString(),10)],n);o.appendChild(p)}t.push(o)}return t},i.prototype.createContentTd=function(t,i){var n=i.cloneNode();t.colSpan&&n.setAttribute("colspan",t.colSpan.toString()),this.updateClassList(t);var r=t.type;if(-1!==t.className.indexOf(Dt)&&(t.className.push(mt),r="resourceGroupCells"),this.parent.workHours.highlight&&this.isWorkDay(t.date,t.workDays)&&t.className.push(at),this.isCurrentDate(t.date)&&t.className.push(lt),(0,e.addClass)([n],t.className),n.setAttribute("data-date",t.date.getTime().toString()),!(0,e.isNullOrUndefined)(t.groupIndex)||this.parent.uiStateValues.isGroupAdaptive){var a=this.parent.uiStateValues.isGroupAdaptive?this.parent.uiStateValues.groupIndex:t.groupIndex;n.setAttribute("data-group-index",""+a)}if(this.renderDateHeaderElement(t,n),this.parent.activeViewOptions.cellTemplate){var s={date:t.date,type:r,groupIndex:t.groupIndex},o=this.parent.element.id+"_"+this.parent.activeViewOptions.cellTemplateName+"cellTemplate",l=[].slice.call(this.parent.getCellTemplate()(s,this.parent,"cellTemplate",o,!1,void 0,void 0,this.parent.root));(0,e.append)(l,n)}var p={elementType:r,element:n,date:t.date,groupIndex:t.groupIndex};return this.parent.trigger(v,p),n},i.prototype.renderDateHeaderElement=function(t,i){if("TimelineMonth"!==this.parent.currentView){var n=(0,e.createElement)("div",{className:ui});if(this.parent.activeViewOptions.cellHeaderTemplate){var r={date:t.date,type:t.type,groupIndex:t.groupIndex},a=this.parent.element.id+"_"+this.parent.activeViewOptions.cellHeaderTemplateName+"cellHeaderTemplate",s=[].slice.call(this.parent.getCellHeaderTemplate()(r,this.parent,"cellHeaderTemplate",a,!1,void 0,void 0,this.parent.root));(0,e.append)(s,n)}else{var o=!this.parent.calendarUtil.isMonthStart(t.date)||this.isCurrentDate(t.date)||this.parent.isAdaptive?this.parent.globalize.formatDate(t.date,{skeleton:"d",calendar:this.parent.getCalendarMode()}):this.parent.globalize.formatDate(t.date,{format:"MMM d",calendar:this.parent.getCalendarMode()});n.innerHTML=je(o,"single")}if(i.appendChild(n),"month"===this.getModuleName()){(0,e.addClass)([n],di);var l=this.parent.globalize.formatDate(t.date,{skeleton:"full",calendar:this.parent.getCalendarMode()});i.setAttribute("aria-label",l)}}},i.prototype.getMonthStart=function(t){var i=le("Month"===this.parent.currentView&&!(0,e.isNullOrUndefined)(this.parent.activeViewOptions.displayDate)&&!this.parent.uiStateValues.isSwipeScroll&&(this.parent.uiStateValues.isCustomMonth||this.isCustomRange())?this.parent.activeViewOptions.displayDate:this.parent.uiStateValues.isCustomMonth||!this.parent.uiStateValues.isSwipeScroll&&this.isCustomRange()||!this.isCustomMonth()?this.parent.calendarUtil.firstDateOfMonth(t):t,this.parent.activeViewOptions.firstDayOfWeek);return new Date(i.getFullYear(),i.getMonth(),i.getDate())},i.prototype.getMonthEnd=function(e){if(this.isCustomMonth())return ye(this.getMonthStart(e),ee*(this.parent.activeViewOptions.numberOfWeeks>0?this.parent.activeViewOptions.numberOfWeeks:te)-1);var t=Te(e,this.parent.activeViewOptions.interval-1);return ye(le(this.parent.calendarUtil.lastDateOfMonth(t),this.parent.activeViewOptions.firstDayOfWeek),ee-1)},i.prototype.isCustomRange=function(){var e=this.parent.getCurrentViewDates();if(e&&e.length>0){var t=ve(this.parent.selectedDate).getTime(),i=le(e[e.length-1],this.parent.activeViewOptions.firstDayOfWeek);return!(t>=le(e[0],this.parent.activeViewOptions.firstDayOfWeek).getTime()&&t<=ye(i,6).getTime())}return!1},i.prototype.getRenderDates=function(e,t){void 0===t&&(t=this.parent.selectedDate);var i=[],n=ve(t),r=this.getMonthStart(n),a=this.getMonthEnd(n);do{(this.parent.activeViewOptions.showWeekend||this.isWorkDay(r,e))&&i.push(r),(r=ye(r,1)).getHours()>0&&(r=ve(r))}while(r.getTime()<=a.getTime());return e||(this.renderDates=i),this.parent.headerModule&&this.parent.headerModule.previousNextIconHandler(),i},i.prototype.getNextPreviousDate=function(e){if(this.isCustomMonth()){var t=this.parent.getCurrentViewDates();return ye(le("Next"===e?t[t.length-1]:t[0],this.parent.activeViewOptions.firstDayOfWeek),"Next"===e?ee:-(this.parent.activeViewOptions.numberOfWeeks>0?this.parent.activeViewOptions.numberOfWeeks:te)*ee)}return Te(this.parent.selectedDate,("Next"===e?1:-1)*this.parent.activeViewOptions.interval)},i.prototype.getStartDate=function(){return this.getMonthStart(this.parent.selectedDate)},i.prototype.getEndDate=function(){return this.getMonthEnd(this.parent.selectedDate)},i.prototype.getEndDateFromStartDate=function(e){return ye(new Date(e.getTime()),1)},i.prototype.getDateRangeText=function(t,i){if(void 0===t&&(t=this.parent.selectedDate),void 0===i&&(i=null),this.parent.isAdaptive||(0,e.isNullOrUndefined)(this.parent.activeViewOptions.dateFormat)){t=!(0,e.isNullOrUndefined)(i)&&i.length>6?i[6]:t;var n=void 0,r=!1;if(this.isCustomMonth()){var a=!(0,e.isNullOrUndefined)(i)&&i.length>0?i:this.parent.getCurrentViewDates();(r=a[0].getMonth()!==a[a.length-1].getMonth()||a[0].getFullYear()!==a[a.length-1].getFullYear())&&(t=a[0],n=a[a.length-1])}var s="Month"!==this.parent.currentView||!this.isCustomMonth();if(this.parent.activeViewOptions.interval>1&&s||r)return n=n||Te(he(t),this.parent.activeViewOptions.interval-1),t.getFullYear()===n.getFullYear()?je(this.parent.globalize.formatDate(t,{format:"MMMM",calendar:this.parent.getCalendarMode()})+" - "+this.parent.globalize.formatDate(n,{format:"MMMM ",calendar:this.parent.getCalendarMode()})+this.parent.globalize.formatDate(n,{skeleton:"y",calendar:this.parent.getCalendarMode()}),"single"):je(this.parent.globalize.formatDate(t,{format:"MMMM",calendar:this.parent.getCalendarMode()})+" "+t.getFullYear()+" - "+this.parent.globalize.formatDate(n,{format:"MMMM ",calendar:this.parent.getCalendarMode()})+this.parent.globalize.formatDate(n,{skeleton:"y",calendar:this.parent.getCalendarMode()}),"single");var o=this.parent.activeViewOptions.dateFormat?this.parent.activeViewOptions.dateFormat:"MMMM y";return je(this.parent.globalize.formatDate(t,{format:o,calendar:this.parent.getCalendarMode()}),"single")}return this.formatDateRange(!(0,e.isNullOrUndefined)(i)&&i.length>0?i[0]:this.parent.selectedDate)},i.prototype.getLabelText=function(e){var t=e.charAt(0).toLowerCase()+e.substring(1);return this.formatViewLabel(t,this.getStartDate(),this.getEndDate())},i.prototype.createWeekNumberElement=function(t){var i=(0,e.createElement)("tr"),n=(0,e.createElement)("td",{className:zt,attrs:{title:t?this.parent.localeObj.getConstant("week")+" "+t:""},innerHTML:t||""});i.appendChild(n);var r={elementType:"weekNumberCell",element:n};return this.parent.trigger(v,r),i},i.prototype.unWireEvents=function(){var t=this.element.querySelector("."+ri);t&&e.EventHandler.remove(t,"scroll",this.onContentScroll)},i.prototype.isCustomMonth=function(){return"Month"===this.parent.currentView&&(!(0,e.isNullOrUndefined)(this.parent.activeViewOptions.displayDate)||this.parent.activeViewOptions.numberOfWeeks>0)},i.prototype.getModuleName=function(){return"month"},i.prototype.destroy=function(){!this.parent||this.parent&&this.parent.isDestroyed||this.element&&(this.monthEvent&&(this.monthEvent.destroy(),this.monthEvent=null),this.unWireEvents(),this.parent.resourceBase&&this.parent.resourceBase.destroy(),this.parent.scheduleTouchModule&&this.parent.scheduleTouchModule.resetValues(),t.prototype.destroy.call(this))},i}($o),cl=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),hl=function(t){function i(e){var i=t.call(this,e)||this;return i.viewClass="e-year-view",i.isInverseTableSelect=!1,i.yearEventModule=null,i}return cl(i,t),i.prototype.getModuleName=function(){return"year"},i.prototype.renderLayout=function(t){this.parent.resourceBase&&this.parent.resourceBase.generateResourceLevels([{renderDates:this.parent.activeView.renderDates}]),this.setPanel((0,e.createElement)("div",{className:ii}));var i="Horizontal"===this.parent.activeViewOptions.orientation?"e-horizontal":"e-vertical";(0,e.addClass)([this.element],[this.viewClass,i,t]),this.renderPanel(t),this.parent.activeViewOptions.allowVirtualScrolling&&(0,e.addClass)([this.element],[sr]);var n=this.createTableLayout(ni);this.element.appendChild(n),this.element.querySelector("table").setAttribute("role","presentation");var r=n.querySelector("tbody");this.rowCount=this.getRowColumnCount("row"),this.columnCount=this.getRowColumnCount("column"),this.renderHeader(r),this.renderContent(r),"Year"!==this.parent.currentView&&this.parent.uiStateValues.isGroupAdaptive&&(this.generateColumnLevels(),this.renderResourceMobileLayout()),e.EventHandler.add(this.element.querySelector("."+ri),"scroll",this.onContentScroll,this),this.parent.notify(_,{})},i.prototype.renderHeader=function(e){},i.prototype.renderContent=function(t){var i=(0,e.createElement)("tr");t.appendChild(i);var n=(0,e.createElement)("td");i.appendChild(n),this.element.querySelector("tbody").appendChild(i);var r=(0,e.createElement)("div",{className:ri});n.appendChild(r);var a=this.createTableLayout("e-calendar-table");r.appendChild(a);var s=(0,e.createElement)("tr");a.querySelector("tbody").appendChild(s);var o=(0,e.createElement)("td");s.appendChild(o);var l=(0,e.createElement)("div",{className:"e-calendar-wrapper"});o.appendChild(l);for(var p=0,c=this.getMonths();p<c.length;p++){var h=c[p],d=new Date(this.parent.selectedDate.getFullYear(),h,1),u=(0,e.createElement)("div",{className:"e-month-calendar e-calendar",attrs:{"data-role":"calendar"}});u.appendChild(this.renderCalendarHeader(d)),u.appendChild(this.renderCalendarContent(d)),l.appendChild(u)}this.renderDates.splice(0,1)},i.prototype.renderCalendarHeader=function(t){var i=(0,e.createElement)("div",{className:"e-header e-month"}),n=(0,e.createElement)("div",{className:"e-day e-title"});if(this.parent.activeViewOptions.monthHeaderTemplate){var r={date:t,type:"monthHeader"};this.renderTemplates(this.parent.getMonthHeaderTemplate(),r,"monthHeaderTemplate",this.parent.activeViewOptions.monthHeaderTemplateName,n)}else n.innerHTML=this.getMonthName(t);return i.appendChild(n),this.parent.trigger(v,{elementType:"headerCells",element:n,date:t}),i},i.prototype.renderCalendarContent=function(t){var i=this.getMonthDates(t),n=(0,e.createElement)("div",{className:"e-content e-month"}),r=this.createTableLayout("e-calendar-table "+Je);n.appendChild(r),this.setAriaAttributes(r);var a=(0,e.createElement)("thead",{className:"e-week-header"}),s=(0,e.createElement)("tr"),o=le(ce(t),this.parent.activeViewOptions.firstDayOfWeek);this.parent.activeViewOptions.showWeekNumber&&s.appendChild((0,e.createElement)("th"));for(var l=0;l<ee;l++){if(this.parent.activeViewOptions.dayHeaderTemplate){var p=(0,e.createElement)("th"),c={date:o,type:"dayHeader"};this.renderTemplates(this.parent.getDayHeaderTemplate(),c,"dayHeaderTemplate",this.parent.activeViewOptions.dayHeaderTemplateName,p),s.appendChild(p)}else s.appendChild((0,e.createElement)("th",{innerHTML:this.parent.getDayNames("narrow")[o.getDay()]}));var h=new Date(o.getTime()+ie);o=h.getDate()===o.getDate()?ye(h,1):h}a.appendChild(s),(0,e.prepend)([a],r);for(var d=r.querySelector("tbody");i.length>0;){var u=i.splice(0,ee),g=(0,e.createElement)("tr");if(this.parent.activeViewOptions.showWeekNumber){var m=this.parent.getWeekNumberContent(u),f=(0,e.createElement)("td",{className:"e-week-number",attrs:{title:this.parent.localeObj.getConstant("week")+" "+m},innerHTML:m});g.appendChild(f),this.parent.trigger(v,{elementType:"weekNumberCells",element:f})}for(var y=0,T=u;y<T.length;y++){var w=T[y];f=(0,e.createElement)("td",{className:"e-cell "+$e,attrs:{"data-date":w.getTime().toString()}});if(this.parent.activeViewOptions.cellHeaderTemplate){c={date:w,type:"monthCells"};this.renderTemplates(this.parent.getCellHeaderTemplate(),c,"cellHeaderTemplate",this.parent.activeViewOptions.cellHeaderTemplateName,f)}else{var D=(0,e.createElement)("span",{className:"e-day",innerHTML:this.parent.globalize.formatDate(w,{skeleton:"d",calendar:this.parent.getCalendarMode()}),attrs:{title:this.parent.globalize.formatDate(w,{type:"date",skeleton:"full"})}});f.appendChild(D)}if(this.parent.activeViewOptions.cellTemplate){c={date:w,type:"monthCells"};this.renderTemplates(this.parent.getCellTemplate(),c,"cellTemplate",this.parent.activeViewOptions.cellTemplateName,f)}var b=[];t.getMonth()!==w.getMonth()&&(b.push(st),f.firstElementChild&&!this.parent.activeViewOptions.cellTemplate&&f.firstElementChild.setAttribute("aria-disabled","true")),this.isCurrentDate(w)&&t.getMonth()===w.getMonth()&&(b=b.concat(["e-today","e-selected"])),b.length>0&&(0,e.addClass)([f],b),g.appendChild(f),t.getMonth()===w.getMonth()&&this.renderDates.push(new Date(w)),this.parent.isMinMaxDate(w)?(e.EventHandler.add(f,"click",this.onCellClick,this),this.parent.isAdaptive||e.EventHandler.add(f,"dblclick",this.parent.workCellAction.cellDblClick,this.parent.workCellAction)):(0,e.addClass)([f],Qn),this.parent.trigger(v,{elementType:"workCells",element:f,date:w})}d.appendChild(g)}return n},i.prototype.createTableColGroup=function(t){for(var i=(0,e.createElement)("colgroup"),n=0;n<t;n++)i.appendChild((0,e.createElement)("col"));return i},i.prototype.getMonthName=function(e){return je(this.parent.globalize.formatDate(e,{format:this.parent.activeViewOptions.dateFormat||"MMMM y",calendar:this.parent.getCalendarMode()}),"multiple")},i.prototype.generateColumnLevels=function(){var e=[],t=this.getDateSlots([this.parent.selectedDate],this.parent.activeViewOptions.workDays);if(this.parent.activeViewOptions.group.resources.length>0){if(e=this.parent.resourceBase.generateResourceLevels(t),this.parent.uiStateValues.isGroupAdaptive){var i=this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex];e=[this.getDateSlots([this.parent.selectedDate],i.workDays)]}}else e.push(t);return e.pop(),this.colLevels=e,e},i.prototype.getDateSlots=function(e,t,i,n){return void 0===i&&(i=this.parent.workHours.start),void 0===n&&(n=this.parent.workHours.end),[{date:e[0],type:"dateHeader",className:[rt],colSpan:1,workDays:t,startHour:new Date(+this.parent.globalize.parseDate(i,{skeleton:"Hm"})),endHour:new Date(+this.parent.globalize.parseDate(n,{skeleton:"Hm"}))}]},i.prototype.getMonthDates=function(e){for(var t=le(ce(e),this.parent.activeViewOptions.firstDayOfWeek),i=ye(new Date(+t),6*ee),n=[],r=t;r.getTime()<i.getTime();r=ye(r,1))n.push(ve(new Date(r)));return n},i.prototype.getRowColumnCount=function(e){for(var t=this.getMonths(),i=this.parent.selectedDate.getFullYear(),n=[],r=0,a=t;r<a.length;r++){var s=a[r];n.push(new Date(i,s,1).getDay()+new Date(i,s+1,0).getDate())}var o=Math.max.apply(Math,n);return"row"===e?"Horizontal"===this.parent.activeViewOptions.orientation?t.length:o:"Horizontal"===this.parent.activeViewOptions.orientation?o:t.length},i.prototype.isCurrentDate=function(e){return ve(new Date).getTime()===ve(new Date(e.getTime())).getTime()},i.prototype.getMonths=function(){var e=this;return Array.apply(null,{length:this.parent.activeViewOptions.monthsCount}).map((function(t,i){return e.parent.firstMonthOfYear+i}))},i.prototype.renderTemplates=function(t,i,n,r,a){var s=this.parent.element.id+"_"+r+n,o=[].slice.call(t(i,this.parent,n,s,!1,void 0,void 0,this.parent.root));(0,e.append)(o,a)},i.prototype.onCellClick=function(t){var i=(0,e.closest)(t.target,"."+$e),n=this.parent.getDateFromElement(i);this.parent.activeCellsData=this.parent.getCellDetails(i);var a=n.getTime()<this.getStartDate().getTime();if(a||n.getTime()>this.getEndDate().getTime()){this.parent.changeDate(this.parent.activeView.getNextPreviousDate(a?"Previous":"Next"),t);var s=this.parent.activeCellsData.startTime.getTime(),o=s>=this.getStartDate().getTime()&&s<=this.getEndDate().getTime()?s:(a?this.getEndDate():this.getStartDate()).getTime(),l=this.parent.element.querySelector(":not(."+st+')[data-date="'+o+'"]');this.parent.selectCell(l),this.parent.activeCellsData=this.parent.getCellDetails(l)}else{var p=ye(new Date(n.getTime()),1),c={date:n,event:this.parent.eventBase.filterEvents(n,p),element:t.target};i.classList.contains(st)&&(i=this.parent.element.querySelector(":not(."+st+')[data-date="'+i.getAttribute("data-date")+'"]')),this.parent.activeCellsData=this.parent.getCellDetails(i);var h=(0,e.extend)(this.parent.activeCellsData,{cancel:!1,event:t,name:"cellClick"});this.parent.trigger(r,h),this.parent.quickPopup.moreEventClick(c,p)}},i.prototype.onContentScroll=function(e){var t=e.target,i=this.getDatesHeaderElement();this.parent.notify(X,e),i&&(i.firstElementChild.scrollLeft=t.scrollLeft);var n="."+hr+",."+yt,r=this.element.querySelector(n);r&&(r.scrollTop=t.scrollTop),this.parent.isAdaptive||(this.parent.uiStateValues.top=e.target.scrollTop),this.parent.uiStateValues.left=e.target.scrollLeft,this.setPersistence()},i.prototype.onScrollUiUpdate=function(t){var i=this.parent.element.offsetHeight-this.getHeaderBarHeight(),n=this.element.querySelector("."+nt);n&&(i-=n.offsetHeight);var r=this.element.querySelector("."+ri);if(r&&(r.style.height=(0,e.formatUnit)(i)),!this.parent.isAdaptive&&n){var a=xe();r.offsetWidth-r.clientWidth>0?(n.firstElementChild.style[t.cssProperties.border]=a>0?"1px":"0px",n.style[t.cssProperties.padding]=a>0?a-1+"px":"0px"):(n.firstElementChild.style[t.cssProperties.border]="",n.style[t.cssProperties.padding]="")}this.setColWidth(this.getContentAreaElement());var s="."+hr+",."+yt,o=this.element.querySelector(s);if(o){var l=r.scrollWidth>r.clientWidth;o.style.height=(0,e.formatUnit)(i-(l?17:0))}t.isPreventScrollUpdate||(this.parent.uiStateValues.isInitial?(this.parent.uiStateValues.isInitial=!1,this.parent.uiStateValues.top=this.parent.uiStateValues.left=0):(o&&(o.scrollTop=this.parent.uiStateValues.top),r.scrollTop=this.parent.uiStateValues.top,r.scrollLeft=this.parent.uiStateValues.left)),this.retainScrollPosition()},i.prototype.getStartDate=function(){return new Date(this.parent.selectedDate.getFullYear(),this.parent.firstMonthOfYear%12,1)},i.prototype.getEndDate=function(){return ye(Te(this.getStartDate(),this.parent.monthsCount),-1)},i.prototype.startDate=function(){return"Year"===this.parent.currentView?le(this.getStartDate(),this.parent.activeViewOptions.firstDayOfWeek):this.getStartDate()},i.prototype.endDate=function(){return"Year"===this.parent.currentView?ye(pe(this.getEndDate(),this.parent.activeViewOptions.firstDayOfWeek),1):ye(this.getEndDate(),1)},i.prototype.getEndDateFromStartDate=function(e){var t=new Date(e.getTime());return this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&(t=he(t)),ye(new Date(t.getTime()),1)},i.prototype.getNextPreviousDate=function(e){return we(this.parent.selectedDate,"Next"===e?1:-1)},i.prototype.getDateRangeText=function(t,i){void 0===t&&(t=this.parent.selectedDate),void 0===i&&(i=null);var n=!(0,e.isNullOrUndefined)(i)&&i.length>0,r=n?i[0]:this.getStartDate(),a=n?i[i.length-1]:this.getEndDate();return r.getFullYear()!==a.getFullYear()?this.parent.globalize.formatDate(r,{skeleton:"yMMM"})+" - "+this.parent.globalize.formatDate(a,{skeleton:"yMMM"}):this.parent.globalize.formatDate(n?i[0]:t,{skeleton:"y"})},i.prototype.addEventListener=function(){this.parent.on(Q,this.onScrollUiUpdate,this),this.parent.on(z,this.onDataReady,this)},i.prototype.removeEventListener=function(){this.parent&&(this.parent.off(Q,this.onScrollUiUpdate),this.parent.off(z,this.onDataReady))},i.prototype.onDataReady=function(e){this.yearEventModule=new Ko(this.parent),this.yearEventModule.renderAppointments(),this.parent.notify(Y,e)},i.prototype.scrollToDate=function(t){var i=+new Date(ve(t)),n=this.element.querySelector("."+$e+":not(."+st+')[data-date="'+i+'"]');n&&(n=(0,e.closest)(n,".e-month-calendar"),this.getContentAreaElement().scrollTop=n.offsetTop)},i.prototype.destroy=function(){if(!(!this.parent||this.parent&&this.parent.isDestroyed)&&this.element){var i=this.element.querySelector("."+ri);i&&e.EventHandler.remove(i,"scroll",this.onContentScroll),this.yearEventModule&&(this.yearEventModule.destroy(),this.yearEventModule=null),this.parent.resourceBase&&this.parent.resourceBase.destroy(),t.prototype.destroy.call(this)}},i}($o),dl=d(90),ul=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),gl=function(t){function i(e){return t.call(this,e)||this}return ul(i,t),i.prototype.createAgendaContentElement=function(t,i,n,r,a){var s,o=this,l=this.parent.eventFields;if("noEvents"===t){var p=[{subject:this.parent.localeObj.getConstant("noEvents")}];0===(s=dl.ListBase.createList(this.parent.createElement,p,{moduleName:"agenda",listClass:this.parent.activeView.viewClass,itemClass:this.parent.activeView.viewClass,template:'<div class="'+mi+'">'+this.parent.localeObj.getConstant("noEvents")+"</div>"})).querySelector(".e-agenda-item").children.length&&s.firstElementChild.appendChild((0,e.createElement)("div",{className:mi,innerHTML:this.parent.localeObj.getConstant("noEvents")}))}else{s=dl.ListBase.createList(this.parent.createElement,i,{moduleName:"agenda",listClass:this.parent.activeView.viewClass,itemClass:this.parent.activeView.viewClass}),[].slice.call(s.children).forEach((function(t,n){var s,p=(0,e.createElement)("div",{className:Xt,attrs:{"data-id":"Appointment_"+i[parseInt(n.toString(),10)][""+o.parent.eventFields.id],"data-guid":i[parseInt(n.toString(),10)].Guid,role:"button",tabindex:"0","aria-disabled":o.parent.eventBase.getReadonlyAttribute(i[parseInt(n.toString(),10)]),"aria-label":o.parent.getAnnouncementString(i[parseInt(n.toString(),10)])}});if((0,e.isNullOrUndefined)(a)||p.setAttribute("data-group-index",a.toString()),o.parent.eventBase.applyResourceColor(p,i[parseInt(n.toString(),10)],"borderColor",r),(0,e.isNullOrUndefined)(o.parent.activeViewOptions.eventTemplate))s=o.createAppointment(i[parseInt(n.toString(),10)]);else{(0,e.addClass)([p],"e-template");var c=o.parent.element.id+"_"+o.parent.activeViewOptions.eventTemplateName+"eventTemplate";if(s=o.parent.getAppointmentTemplate()(i[parseInt(n.toString(),10)],o.parent,"eventTemplate",c,!1,void 0,void 0,o.parent.root),!(0,e.isNullOrUndefined)(i[parseInt(n.toString(),10)][l.recurrenceRule])){var h=i[parseInt(n.toString(),10)][l.id]===i[parseInt(n.toString(),10)][l.recurrenceID]?ki:Ri;p.appendChild((0,e.createElement)("div",{className:Ye+" "+h}))}}(0,e.append)([].slice.call(s),p),Me(t),t.appendChild(p);var d={data:(0,e.extend)({},i[parseInt(n.toString(),10)],null,!0),element:t,cancel:!1};o.parent.trigger(y,d,(function(i){i.cancel&&(0,e.remove)(t)}))}))}return n.appendChild(s),("MonthAgenda"===this.parent.currentView&&this.parent.activeViewOptions.group.resources.length>0||"Agenda"===this.parent.currentView)&&(0,e.addClass)([n],gi),this.parent.renderTemplates(),n},i.prototype.createAppointment=function(t){var i=this.parent.eventFields,n=t[i.subject]||this.parent.eventSettings.fields.subject.default||this.parent.localeObj.getConstant("addTitle"),r=t[i.location]||this.parent.eventSettings.fields.location.default,a=(0,e.createElement)("div",{className:$t});(0,e.isNullOrUndefined)(r)||""===r||(n+=",");var s=(0,e.createElement)("div",{className:Cn});if(this.parent.sanitize(n,s),a.appendChild(s),!(0,e.isNullOrUndefined)(r)&&""!==r){var o=(0,e.createElement)("div",{className:On});this.parent.sanitize(r,o),a.appendChild(o)}if(!(0,e.isNullOrUndefined)(t[i.recurrenceRule])){var l=t[i.id]===t[i.recurrenceID]?ki:Ri;a.appendChild((0,e.createElement)("div",{className:Ye+" "+l}))}var p=t[i.startTime],c=t[i.endTime],h=t[i.isAllDay],d=this.parent.localeObj.getConstant("allDay"),u=this.parent.getTimeString(p)+" - "+this.parent.getTimeString(c);(0,e.isNullOrUndefined)(t.data)||(d=((c.getTimezoneOffset()!==p.getTimezoneOffset()?c.getTime()-p.getTime()+36e5:c.getTime()-p.getTime())/ie>=1?d:u)+" ("+this.parent.localeObj.getConstant("day")+" "+t.data.index+"/"+t.data.count+")");var g=!(0,e.isNullOrUndefined)(t.data)||h?d:u;return[a,(0,e.createElement)("div",{className:vi,innerHTML:g})]},i.prototype.processAgendaEvents=function(t){var i=[];if((0,e.isNullOrUndefined)(t))return i;for(var n=0,r=t;n<r.length;n++){var a=r[n],s=this.parent.eventBase.splitEventByDay(a);i=i.concat(s.length>1?s:a)}return i},i.prototype.wireEventActions=function(){for(var t=0,i=[].slice.call(this.parent.element.querySelectorAll("."+Xt));t<i.length;t++){var n=i[t];this.parent.eventBase.wireAppointmentEvents(n,this.parent.getEventDetails(n),!0)}for(var r=0,a=[].slice.call(this.parent.element.querySelectorAll(".e-m-date"));r<a.length;r++){n=a[r];e.EventHandler.add(n,"click",this.parent.agendaModule.dayNavigationClick,this)}},i.prototype.calculateResourceTableElement=function(t,i,n,r){if(void 0===r&&(r=null),(0,e.isNullOrUndefined)(this.parent.resourceBase.lastResourceLevel)){var a=this.getDateSlots(this.renderDates,this.parent.activeViewOptions.workDays);this.parent.resourceBase.generateResourceLevels(a)}for(var s=ye(new Date(n.getTime()),i),o=this.parent.activeViewOptions.group.byDate||"MonthAgenda"===this.parent.currentView?i:1,l=this.parent.resourceBase.resourceCollection,p=this.parent.resourceBase.lastResourceLevel,c=n,h=n,d=this.parent.activeViewOptions.showWeekend,u=0;u<o;u++){var g=[],v=[],m=0,f=void 0,y=void 0,T=ye(h,u);if("Agenda"===this.parent.currentView&&this.parent.activeViewOptions.group.byDate&&this.parent.activeViewOptions.allowVirtualScrolling&&!d&&!this.isWorkDay(T)){do{if((T=ye(T,1))>=r)break}while(!this.isWorkDay(T)||this.parent.eventBase.filterEvents(T,ye(T,1)).length<1);if(T>=r)break;h=ye(T,-u),s=ye(T,1)}var w=this.parent.activeViewOptions.group.byDate||"MonthAgenda"===this.parent.currentView?ye(T,1):s,D=this.parent.eventBase.filterEvents(T,w);if(D.length>0||!this.parent.hideEmptyAgendaDays||"MonthAgenda"===this.parent.currentView){for(var b=0;b<p.length;b++){i=this.parent.activeViewOptions.group.byDate&&"MonthAgenda"!==this.parent.currentView?1:i;var S=[];n=T;var C=this.parent.eventBase.filterEvents(n,s,D,p[parseInt(b.toString(),10)]);if(C.length>0||!this.parent.hideEmptyAgendaDays||"MonthAgenda"===this.parent.currentView)for(var O=0;O<i;O++){var E=this.parent.eventBase.filterEvents(n,ye(n,1),C,void 0);if(((d||!d&&(this.parent.group.byDate?this.isWorkDay(n):this.isWorkDay(n,p[parseInt(b.toString(),10)].workDays)))&&(E.length>0||!this.parent.hideEmptyAgendaDays)||"MonthAgenda"===this.parent.currentView)&&(S.push(E[0]),f={rowSpan:1,type:"eventColumn",resource:l[l.length-1],groupIndex:p[parseInt(b.toString(),10)].groupIndex,groupOrder:p[parseInt(b.toString(),10)].groupOrder,resourceData:p[parseInt(b.toString(),10)].resourceData,eventData:E,date:n},y={rowSpan:1,type:"dateColumn",resource:l[parseInt((l.length-1).toString(),10)],groupOrder:p[parseInt(b.toString(),10)].groupOrder,resourceData:p[parseInt(b.toString(),10)].resourceData,date:n},g[parseInt(m.toString(),10)]||(g[parseInt(m.toString(),10)]=[]),g[parseInt(m.toString(),10)].push(f),g[parseInt(m.toString(),10)].push(y),m++),(n=ye(n,1)).getTime()>=s.getTime()||this.parent.activeViewOptions.group.byDate||"MonthAgenda"===this.parent.currentView){if(S.length>0){g[g.length-1][1].cssClass=gi;var x={rowSpan:S.length,type:"resourceColumn",resource:l[parseInt((l.length-1).toString(),10)],groupOrder:p[parseInt(b.toString(),10)].groupOrder.slice(0,-1),resourceData:p[parseInt(b.toString(),10)].resourceData,groupIndex:g.length-S.length,className:[ei],date:n};g[parseInt((g.length-S.length).toString(),10)].push(x),v.push((0,e.extend)({},x,null,!0))}break}}}for(var V=l.slice(0,-1),A=[],I=0,M=0;M<V.length;M++){S=V[V.length-(M+1)].dataSource;for(var k=0;k<S.length;k++)for(var R=0,H=0;H<v.length;H++)v[parseInt(H.toString(),10)].groupOrder[V.length-(M+1)]===S[parseInt(k.toString(),10)][V[V.length-(M+1)].idField]&&(I+=v[parseInt(H.toString(),10)].rowSpan,A.push((0,e.extend)({},v[parseInt(H.toString(),10)],null,!0))),++R===v.length&&A.length>0&&(A[0].rowSpan=I,A[0].type="parentColumnLevel_"+(M+1),A[0].resource=V[V.length-(M+1)],A[0].resourceData=S[parseInt(k.toString(),10)],A[0].date=n,g[A[0].groupIndex].push(A[0]),A=[],I=0)}this.createResourceTableRow(g,t)}}0===this.parent.eventBase.filterEvents(c,s).length&&!this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.hideEmptyAgendaDays&&this.renderEmptyContent(t,c)},i.prototype.createResourceTableRow=function(t,i){var n,r,a,s=(0,e.createElement)("tr"),o=(0,e.createElement)("td"),l=0;if(this.parent.activeViewOptions.group.byDate||"MonthAgenda"===this.parent.currentView){for(var p=[],c=this.parent.resourceBase.resourceCollection.slice(0,-1),h=0;h<t.length;h++)p=p.concat(t[parseInt(h.toString(),10)]);a=c.length>0?"parentColumnLevel_"+c.length:"resourceColumn";for(var d=p.filter((function(e){return e.type===a})),u=0;u<d.length;u++)l+=d[parseInt(u.toString(),10)].rowSpan}for(var g=0;g<t.length;g++){n=s.cloneNode();for(var m=t[parseInt(g.toString(),10)].length-1;m>=0;m--){var f=t[parseInt(g.toString(),10)][parseInt(m.toString(),10)],y=o.cloneNode();if("dateColumn"===f.type){if(this.parent.activeViewOptions.group.byDate||"MonthAgenda"===this.parent.currentView){r=t[parseInt(g.toString(),10)][parseInt(m.toString(),10)];continue}y.setAttribute("data-date",f.date.getTime().toString()),y.appendChild(this.createDateHeaderElement(f.date));var T=[si,hi];f.cssClass&&T.push(f.cssClass),(0,e.addClass)([y],T),this.isCurrentDate(new Date(f.date.getTime()))&&(0,e.addClass)(y.childNodes,oi),n.appendChild(y)}else if("eventColumn"===f.type){for(var w=0===f.eventData.length?"noEvents":"data",D=0;D<n.childNodes.length;D++){var b=n.childNodes.item(D),S=b.classList.contains("e-resource-column")?P:j;this.parent.trigger(v,{elementType:S,element:b,date:f.date,groupIndex:f.groupIndex})}(y=this.createAgendaContentElement(w,f.eventData,y,f.groupOrder,f.groupIndex)).setAttribute("data-date",f.date.getTime().toString()),(this.parent.activeViewOptions.group.byDate||"MonthAgenda"===this.parent.currentView)&&(0,e.addClass)([y],[si,"e-day-padding"]),n.appendChild(y);var C=0===f.eventData.length?R:H;this.parent.trigger(v,{elementType:C,element:y,date:f.date,groupIndex:f.groupIndex})}else y.setAttribute("rowspan",f.rowSpan.toString()),(0,e.addClass)([y],"e-resource-column"),this.setResourceHeaderContent(y,f,f.className[0]),n.appendChild(y)}if(this.parent.activeViewOptions.group.byDate&&0===g&&"MonthAgenda"!==this.parent.currentView){(y=o.cloneNode()).setAttribute("data-date",r.date.getTime().toString()),y.setAttribute("rowspan",l.toString()),y.appendChild(this.createDateHeaderElement(r.date)),(0,e.addClass)([y],[si,hi,"e-date-border"]);var O=Se(this.parent.selectedDate.getTime(),r.date.getTime());if(n.setAttribute("data-row-index",O.toString()),this.parent.element.querySelector('.e-agenda-view tr[data-row-index="'+O+'"]'))break;n.insertBefore(y,n.childNodes[0])}i.appendChild(n)}},i.prototype.createDateHeaderElement=function(t){var i;if(this.parent.activeViewOptions.dateHeaderTemplate){i=(0,e.createElement)("div",{className:ci});var n={date:t,type:"dateHeader"},r=this.parent.element.id+"_"+this.parent.activeViewOptions.dateHeaderTemplateName+"dateHeaderTemplate",a=[].slice.call(this.parent.getDateHeaderTemplate()(n,this.parent,"dateHeaderTemplate",r,!1,void 0,void 0,this.parent.root));(0,e.append)(a,i)}else i=this.getMobileDateElement(t,ci);return i},i.prototype.renderEmptyContent=function(t,i,n){var r=this.createTableRowElement(i,"noEvents"),a=r.children[0],s=(0,e.createElement)("div",{className:"e-empty-event",innerHTML:this.parent.localeObj.getConstant("noEvents")});a.appendChild(s),t.appendChild(r),n&&this.parent.trigger(v,{elementType:R,element:a,date:i})},i.prototype.createTableRowElement=function(t,i){var n=Se(this.parent.selectedDate.getTime(),t.getTime()),r=(0,e.createElement)("tr",{attrs:{"data-row-index":n.toString()}}),a=(0,e.createElement)("td",{attrs:{class:"monthHeader"===i?pi:si,"aria-selected":"false","data-column-index":n.toString(),"data-date":t.getTime().toString()}}),s=a.cloneNode(),o=a.cloneNode();return r.appendChild(s),"noEvents"!==i&&r.appendChild(o),r},i.prototype.destroy=function(){t.prototype.destroy.call(this)},i}($o),vl=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ml=function(t){function i(e){var i=t.call(this,e)||this;return i.viewClass="e-agenda-view",i.isInverseTableSelect=!1,i.agendaDates={},i.virtualScrollTop=1,i}return vl(i,t),i.prototype.getModuleName=function(){return"agenda"},i.prototype.renderLayout=function(){this.agendaDates={},this.element=(0,e.createElement)("div",{className:ii}),(0,e.addClass)([this.element],this.viewClass),this.element.appendChild(this.createTableLayout(ni)),this.element.querySelector("table").setAttribute("role","presentation"),this.parent.element.querySelector("."+Xe).appendChild(this.element);var t=(0,e.createElement)("tr");this.element.querySelector("tbody").appendChild(t);var i=(0,e.createElement)("td");t.appendChild(i);var n=(0,e.createElement)("div",{className:ri});i.appendChild(n);var r=this.createTableLayout(Je);this.setAriaAttributes(r),n.appendChild(r);var a=r.querySelector("tbody"),s=ve(this.parent.selectedDate);this.renderEmptyContent(a,s),this.wireEvents(),this.parent.resourceBase&&this.parent.resourceBase.generateResourceLevels([{renderDates:this.parent.activeView.renderDates}]),this.parent.uiStateValues.isGroupAdaptive&&!this.parent.element.querySelector("."+qt)&&this.renderResourceMobileLayout(),this.parent.notify(_,{})},i.prototype.eventLoad=function(t){this.dataSource=(0,e.extend)([],this.parent.eventsData,null,!0);for(var i=0,n=this.parent.eventsData;i<n.length;i++){delete n[i].generatedDates}var r=this.parent.activeViewOptions.allowVirtualScrolling?t.processedData:this.parent.eventsProcessed;if(this.parent.uiStateValues.isGroupAdaptive){var a=this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex];this.dataSource=this.parent.eventBase.filterEventsByResource(a,this.dataSource),r=this.parent.eventBase.filterEventsByResource(a,r)}this.parent.eventsProcessed=this.processAgendaEvents(r);var s=ve(this.parent.selectedDate),o=this.element.querySelector("."+Je+" tbody");Me(o),this.renderInitialContent(o,s),this.wireEventActions(),(0,e.closest)(o,"."+ri).scrollTop=1,this.parent.notify(Y,{}),this.parent.activeViewOptions.allowVirtualScrolling||this.retainScrollPosition()},i.prototype.refreshEvent=function(t){for(var i=[],n=this.parent.eventFields,r=0,a=this.dataSource;r<a.length;r++){var s=a[r];(0,e.isNullOrUndefined)(s[n.recurrenceID])&&!(0,e.isNullOrUndefined)(s[n.recurrenceRule])&&!(0,e.isNullOrUndefined)(s.generatedDates)&&t>=s.generatedDates.end&&(i=i.concat(this.parent.eventBase.generateOccurrence(s,t)))}this.parent.eventsProcessed=this.parent.eventsProcessed.concat(this.processAgendaEvents(i))},i.prototype.refreshHeader=function(){var t=this.element.querySelector("."+Je+" tbody");this.parent.activeViewOptions.group.byDate?Me(t):(0,e.remove)(t.firstElementChild);var i=ve(this.parent.selectedDate),n=(0,e.createElement)("tbody"),r=new Date(i.getTime()),a=this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.hideEmptyAgendaDays?this.getEndDateFromStartDate(r):ye(r,this.parent.agendaDaysCount);this.renderContent(n,r,a),(0,e.append)([].slice.call(n.childNodes),t)},i.prototype.renderInitialContent=function(t,i){var n=(0,e.createElement)("tbody"),r=new Date(i.getTime()),a=this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.hideEmptyAgendaDays?this.getEndDateFromStartDate(r):ye(r,this.parent.agendaDaysCount);if(this.renderContent(n,r,a),(0,e.append)([].slice.call(n.childNodes),t),this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.hideEmptyAgendaDays&&this.parent.eventsData.length>0)for(var s=this.getContentAreaElement(),o=s.querySelector(".e-content-table");s.offsetWidth<=s.clientWidth&&!(this.parent.isAdaptive&&o.offsetHeight>=s.clientHeight);){var l=(0,e.createElement)("tbody");if(r=ye(a=r,-this.parent.agendaDaysCount),this.renderContent(l,r,a),(0,e.prepend)([].slice.call(l.childNodes),t),r<=this.parent.minDate)break}t.childNodes.length<=0&&this.renderEmptyContent(t,i,!0)},i.prototype.renderContent=function(t,i,n){var r,a=this.parent.eventFields,s=new Date(i.getTime()),o=this.appointmentFiltering(s,n);if(o.length>0&&this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.hideEmptyAgendaDays)if(this.parent.activeViewOptions.showWeekend||this.isAgendaWorkDay(o[0][a.startTime]))i=new Date(new Date(o[0][a.startTime].getTime()).setHours(0,0,0,0)),this.updateHeaderText(o[0][a.startTime]);else for(var l=0,p=o;l<p.length;l++){var c=p[l];if(this.isAgendaWorkDay(c[a.startTime])){i=new Date(new Date(c[a.startTime].getTime()).setHours(0,0,0,0)),this.updateHeaderText(c[a.startTime]);break}}if(!this.parent.hideEmptyAgendaDays||this.parent.agendaDaysCount>0&&o.length>0){if(this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive){var h=i;this.parent.activeViewOptions.group.byDate||(this.parent.activeViewOptions.allowVirtualScrolling=!1,h=s,this.parent.headerModule&&(this.parent.headerModule.updateDateRange(),this.parent.headerModule.updateHeaderItems("remove"))),this.calculateResourceTableElement(t,this.parent.agendaDaysCount,h,n)}else for(var d=0;d<this.parent.agendaDaysCount;d++){var u=this.createTableRowElement(i,"data"),g=this.element.querySelector('tr[data-row-index="'+ +u.dataset.rowIndex+'"]');if(g||!this.parent.activeViewOptions.showWeekend&&!this.isAgendaWorkDay(i)){if(i=ye(i,1),!g&&this.parent.activeViewOptions.allowVirtualScrolling&&d--,i.getTime()>n.getTime())break}else{var m=u.children[0],f=u.children[1],y=this.appointmentFiltering(i);if(y.length>0||!this.parent.hideEmptyAgendaDays&&0===y.length){var T=this.parent.hideEmptyAgendaDays||0!==y.length?"data":"noEvents";m.appendChild(this.createDateHeaderElement(i)),u.appendChild(m),this.parent.trigger(v,{elementType:j,element:m,date:i});var w=this.createAgendaContentElement(T,y,f);u.appendChild(w),w.querySelectorAll("li").length>0&&t.appendChild(u);var D=this.parent.hideEmptyAgendaDays||0!==y.length?H:R;this.parent.trigger(v,{elementType:D,element:w,date:i})}else this.parent.activeViewOptions.allowVirtualScrolling&&d--;if(this.isCurrentDate(new Date(i.getTime()))&&(0,e.addClass)(m.childNodes,oi),(i=ye(i,1)).getTime()>n.getTime())break}}r=new Date(i.getTime()-ie)}this.agendaDates={start:s,end:r}},i.prototype.isAgendaWorkDay=function(e){return this.parent.uiStateValues.isGroupAdaptive&&!this.parent.group.byDate?this.isWorkDay(e,this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex].workDays):this.isWorkDay(e)},i.prototype.agendaScrolling=function(e){this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide(),this.parent.activeViewOptions.allowVirtualScrolling&&this.virtualScrolling(e),this.parent.activeViewOptions.allowVirtualScrolling||this.setPersistence()},i.prototype.virtualScrolling=function(t){var i,n=t.target,r=n.scrollTop,a=n.scrollHeight,s=r+n.clientHeight,o=this.virtualScrollTop<r?"next":"previous",l=n.querySelector("tbody"),p=(0,e.createElement)("tbody"),c=this.getElementFromScrollerPosition(t),h=this.parent.getDateFromElement(c);if(0===r){if(i=this.getPreviousNextDate(ye(h,-1),o),this.appointmentFiltering(i.start,i.end).length>0||!this.parent.hideEmptyAgendaDays){this.renderContent(p,i.start,i.end),(0,e.prepend)([].slice.call(p.childNodes),l),this.wireEventActions();for(var d=0,u=l.children;d<u.length;d++)if(u[parseInt(d.toString(),10)].getAttribute("data-row-index")===c.getAttribute("data-column-index")){var g=u[parseInt(d.toString(),10)].offsetTop-this.element.querySelector(".e-agenda-item").offsetHeight;n.scrollTop=g;break}this.updateHeaderText(h)}}else s>=a-5?(i=this.getPreviousNextDate(ye(h,1),o),(this.appointmentFiltering(i.start,i.end).length>0||!this.parent.hideEmptyAgendaDays)&&(this.renderContent(p,i.start,i.end),(0,e.append)([].slice.call(p.childNodes),l),this.wireEventActions(),this.updateHeaderText(h))):this.updateHeaderText(h);this.virtualScrollTop=r;var v=this.parent.eventBase.getSelectedAppointments();v.length>0&&v[v.length-1].focus()},i.prototype.getElementFromScrollerPosition=function(t){var i,n,r=t.target,a=r.scrollTop,s=r.scrollHeight,o=a+r.clientHeight,l=[].slice.call(r.querySelectorAll(".e-agenda-item"));if(l.length>0)if(0===a)n=l[0],i=(0,e.closest)(n,"."+si);else if(o===s)n=l[l.length-1],i=(0,e.closest)(n,"."+si);else for(var p=0,c=l.length;p<c;p++)if((n=l[parseInt(p.toString(),10)]).getBoundingClientRect().top>=0){i=(0,e.closest)(n,"."+si);break}return i},i.prototype.updateHeaderText=function(e){this.parent.showHeaderBar&&this.parent.headerModule.updateDateRange(e)},i.prototype.getPreviousNextDate=function(e,t){var i=new Date(e.getTime()),n=this.getStartDateFromEndDate(e),r=this.getEndDateFromStartDate(e),a=0;do{if(this.parent.activeViewOptions.showWeekend||!this.parent.activeViewOptions.showWeekend&&this.isAgendaWorkDay(i))(this.appointmentFiltering(i).length>0||!this.parent.hideEmptyAgendaDays)&&a++;if((i=ye(i,"next"===t?1:-1))<n||i>r)break}while(a!==this.parent.agendaDaysCount);var s=ye(i,"next"===t?-1:1);return"next"===t?{start:e,end:ye(s,1)}:{start:s,end:ye(e,1)}},i.prototype.appointmentFiltering=function(t,i){var n,r;!(0,e.isNullOrUndefined)(t)&&(0,e.isNullOrUndefined)(i)?(n=ve(new Date(t.getTime())),r=ge(new Date(n.getTime()),ie)):(n=new Date(t.getTime()),r=new Date(i.getTime()));var a=this.parent.eventBase.filterEvents(n,r);return 0===a.length&&(this.refreshEvent(t),a=this.parent.eventBase.filterEvents(n,r)),a},i.prototype.getStartDateFromEndDate=function(e){var t,i=this.parent.eventFields;if(this.parent.eventsProcessed.length>0){var n=Math.min.apply(Math,this.parent.eventsProcessed.map((function(e){return e[i.startTime].getTime()})));t=this.parent.hideEmptyAgendaDays?new Date(n):this.parent.minDate}else t=this.parent.hideEmptyAgendaDays?Te(e,-1):this.parent.minDate;return ve(t)},i.prototype.getEndDateFromStartDate=function(e){var t,i=this.parent.eventFields;if(this.parent.eventsProcessed.length>0){var n=Math.max.apply(Math,this.parent.eventsProcessed.map((function(e){return e[i.endTime].getTime()})));t=this.parent.hideEmptyAgendaDays?new Date(n):this.parent.maxDate}else t=this.parent.hideEmptyAgendaDays?Te(e,1):this.parent.maxDate;return ve(ye(t,1))},i.prototype.getNextPreviousDate=function(e){var t="Next"===e?1:-1;return ye(this.parent.selectedDate,t)},i.prototype.startDate=function(){return ve(this.parent.selectedDate)},i.prototype.endDate=function(){return this.parent.activeViewOptions.allowVirtualScrolling?this.getEndDateFromStartDate(this.startDate()):ye(this.startDate(),this.parent.agendaDaysCount)},i.prototype.getDateRangeText=function(t){var i=this.parent.activeViewOptions.dateFormat?this.parent.activeViewOptions.dateFormat:"MMMM y";if(this.parent.activeViewOptions.allowVirtualScrolling||this.parent.isAdaptive){var n=(0,e.isNullOrUndefined)(t)?this.parent.selectedDate:t;return je(this.parent.globalize.formatDate(n,{format:i,calendar:this.parent.getCalendarMode()}),"multiple")}var r=this.parent.selectedDate,a=ye(r,this.parent.agendaDaysCount-1);return this.formatDateRange(r,a)},i.prototype.dayNavigationClick=function(t){var i=(0,e.closest)(t.currentTarget,"."+si),n=this.parent.getDateFromElement(i);(0,e.isNullOrUndefined)(n)||this.parent.isAdaptive||!this.parent.isMinMaxDate(n)||(this.parent.setProperties({selectedDate:n},!0),this.parent.changeView("Day",t))},i.prototype.wireEvents=function(){e.EventHandler.add(this.element.querySelector("."+ri),G,this.agendaScrolling,this)},i.prototype.unWireEvents=function(){e.EventHandler.remove(this.element.querySelector("."+ri),G,this.agendaScrolling);for(var t=0,i=[].slice.call(this.element.querySelectorAll(".e-m-date"));t<i.length;t++){var n=i[t];e.EventHandler.remove(n,"click",this.dayNavigationClick)}},i.prototype.addEventListener=function(){this.parent.on(Q,this.onAgendaScrollUiUpdate,this),this.parent.on(z,this.eventLoad,this)},i.prototype.removeEventListener=function(){this.parent&&(this.parent.off(Q,this.onAgendaScrollUiUpdate),this.parent.off(z,this.eventLoad))},i.prototype.onAgendaScrollUiUpdate=function(){var t=this.getHeaderBarHeight();this.parent.headerModule&&(this.parent.activeViewOptions.allowVirtualScrolling?this.parent.headerModule.updateHeaderItems("add"):this.parent.headerModule.updateHeaderItems("remove"));var i=this.element.querySelector("."+ri);"auto"!==this.parent.height&&(i.style.height=(0,e.formatUnit)(this.parent.element.offsetHeight-t))},i.prototype.scrollToDate=function(e){var t=new Date(+ve(e));if(this.parent.activeViewOptions.allowVirtualScrolling)(!this.parent.hideEmptyAgendaDays||this.parent.getEvents(t,ye(t,1),!0).length>0)&&this.parent.changeDate(t);else{var i=this.element.querySelector("."+si+'[data-date="'+t.getTime()+'"]');i&&(this.getContentAreaElement().scrollTop=i.offsetTop)}},i.prototype.destroy=function(){!this.parent||this.parent&&this.parent.isDestroyed||this.element&&(this.unWireEvents(),this.parent.resourceBase&&this.parent.resourceBase.destroy(),this.parent.headerModule&&this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.headerModule.updateHeaderItems("remove"),t.prototype.destroy.call(this))},i}(gl),fl=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),yl=function(t){function i(e){var i=t.call(this,e)||this;return i.dayNameFormat="narrow",i.viewClass="e-month-agenda-view",i.monthAgendaDate=new Date(""+e.selectedDate),i}return fl(i,t),i.prototype.getModuleName=function(){return"monthAgenda"},i.prototype.renderAppointmentContainer=function(){var t=this.getContentAreaElement(),i=(0,e.createElement)("div",{className:_t});t.appendChild(i);var n=(0,e.createElement)("div",{className:Yt});i.appendChild(n),this.appendAppContainer(n),this.setEventWrapperHeight()},i.prototype.getDayNameFormat=function(){return this.parent.isAdaptive?"narrow":"abbreviated"},i.prototype.updateSelectedCellClass=function(e){ve(e.date).getTime()===ve(new Date(""+this.parent.selectedDate)).getTime()&&e.className.push(Bt)},i.prototype.setEventWrapperHeight=function(){var t=(this.parent.headerModule?this.parent.headerModule.getHeaderElement().offsetHeight:0)+2,i=this.parent.element.querySelector("."+Ut);i&&(t+=i.offsetHeight);var n=this.getContentAreaElement().firstElementChild,r=this.element.querySelector("."+it),a=this.parent.element.offsetHeight-t-r.offsetHeight,s=this.parent.activeViewOptions.interval>1?Math.round(.8*a):n.offsetHeight,o=a-s,l=this.element.querySelector("."+_t),p=this.element.querySelector("."+Yt);"auto"!==this.parent.height&&(this.parent.activeViewOptions.interval>1&&(n.style.height=(0,e.formatUnit)(s),e.EventHandler.add(n,"scroll",this.onContentScroll,this)),l.style.height=p.style.height=(0,e.formatUnit)(o))},i.prototype.onDataReady=function(t){this.setEventWrapperHeight(),this.clearElements();var i=t.processedData;if(this.parent.uiStateValues.isGroupAdaptive){var n=this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex];i=this.parent.eventBase.filterEventsByResource(n,i)}this.agendaBase=this.getAgendaBase(),this.parent.eventsProcessed=this.agendaBase.processAgendaEvents(i);for(var r=0,a=0,s=this.renderDates;a<s.length;a++){var o=s[a],l=this.appointmentFiltering(o),p=this.element.querySelectorAll("."+$e)[parseInt(r.toString(),10)];l.length>0&&(p.querySelector("."+fi)||p.appendChild((0,e.createElement)("div",{className:fi})),o.getTime()===ve(new Date(this.monthAgendaDate.getTime())).getTime()&&this.onEventRender(l,o)),r++}this.parent.notify(Y,{})},i.prototype.onCellClick=function(e){this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide();var t=this.appointmentFiltering(e.startTime);this.onEventRender(t,e.startTime),this.parent.notify(Y,{}),this.monthAgendaDate=new Date(""+e.startTime),this.parent.setProperties({selectedDate:this.monthAgendaDate},!0)},i.prototype.onEventRender=function(t,i){this.agendaBase=this.getAgendaBase();var n=this.element.querySelector("."+Yt);if(Me(n),0===this.parent.activeViewOptions.group.resources.length||this.parent.uiStateValues.isGroupAdaptive)if(t.length>0){var r=(0,e.createElement)("div",{className:Gt});n.appendChild(this.agendaBase.createAgendaContentElement("data",t,r))}else this.appendAppContainer(n);else if(t.length>0){var a=this.createTableLayout(),s=a.querySelector("tbody");this.agendaBase.calculateResourceTableElement(s,1,i),a.appendChild(s),n.appendChild(a)}else this.appendAppContainer(n);this.agendaBase.wireEventActions()},i.prototype.appointmentFiltering=function(e){var t=ve(new Date(e.getTime())),i=ge(new Date(t.getTime()),ie);return this.parent.eventBase.filterEvents(t,i)},i.prototype.clearElements=function(){for(var t=0,i=[].slice.call(this.element.querySelectorAll("."+fi));t<i.length;t++){var n=i[t];(0,e.remove)(n)}this.appendAppContainer(this.element.querySelector("."+Yt))},i.prototype.appendAppContainer=function(t){var i=(0,e.createElement)("div",{className:Gt});(0,e.addClass)([i],mi),i.innerHTML=this.parent.localeObj.getConstant("noEvents"),Me(t),t.appendChild(i)},i.prototype.getNextPreviousDate=function(e){var t=this.parent.selectedDate,i="Next"===e?this.parent.activeViewOptions.interval:-this.parent.activeViewOptions.interval,n=Te(this.parent.selectedDate,i),r="Next"===e?2:0,a=new Date(t.getFullYear(),t.getMonth()+r,0).getDate(),s=a>=this.monthAgendaDate.getDate()?this.monthAgendaDate.getDate():a;return this.monthAgendaDate=new Date(n.getFullYear(),n.getMonth(),s),this.monthAgendaDate},i.prototype.getAgendaBase=function(){return this.agendaBase||new gl(this.parent)},i.prototype.destroy=function(){this.agendaBase&&(this.agendaBase.destroy(),this.agendaBase=null),t.prototype.destroy.call(this)},i}(pl),Tl=function(){function t(e,t){this.parent=e,this.renderDates=t}return t.prototype.groupByYear=function(e){for(var t={},i=0,n=e;i<n.length;i++){var r=n[i],a=r.getFullYear();t[parseInt(a.toString(),10)]=t[parseInt(a.toString(),10)]||[],t[parseInt(a.toString(),10)].push(r)}return t},t.prototype.groupByMonth=function(e){for(var t={},i=0,n=e;i<n.length;i++){var r=n[i],a=12*(r.getFullYear()-1970)+r.getMonth();t[parseInt(a.toString(),10)]=t[parseInt(a.toString(),10)]||[],t[parseInt(a.toString(),10)].push(r)}return t},t.prototype.groupByWeek=function(e){for(var t={},i=0,n=e;i<n.length;i++){var r=n[i],a=+new Date(1970,0,1),s=r.getTimezoneOffset()-new Date(1970,0,1).getTimezoneOffset(),o=Math.ceil(((+r-a-60*s*1e3)/ie+new Date(a).getDay()+1)/7);this.parent.activeViewOptions.firstDayOfWeek&&this.parent.activeViewOptions.firstDayOfWeek>new Date(+r).getDay()&&(o-=1),t[parseInt(o.toString(),10)]=t[parseInt(o.toString(),10)]||[],t[parseInt(o.toString(),10)].push(r)}return t},t.prototype.generateSlots=function(t,i,n,r,a){for(var s=this,o=function(e,t){return s.parent.globalize.formatDate(e,{format:t,calendar:s.parent.getCalendarMode()})},l=[],p=Object.keys(t),c=0;c<p.length;c++){var h=t[p[parseInt(c.toString(),10)]],d=void 0;if(n.template){var u={date:h[0],type:a},g=this.parent.element.id+"_headerRowTemplate";d=[].slice.call(this.parent.templateParser(n.template)(u,this.parent,"template",g,!1))}else{var v=void 0;switch(n.option){case"Year":v='<span class="e-header-year">'+o(h[0],"y")+"</span>";break;case"Month":v='<span class="e-header-month">'+je(o(h[0],"MMMM"),"single")+"</span>";break;case"Week":v='<span class="e-header-week">'+this.parent.getWeekNumberContent(h)+"</span>"}var m=(0,e.createElement)("div",{innerHTML:v});d=[].slice.call(m.childNodes)}l.push({date:h[0],type:a,className:[r],colSpan:h.length*i,template:d})}return l},t.prototype.generateColumnLevels=function(e,t){var i=[],n=this.parent.activeViewOptions.headerRows,r=1;"Hour"===n[n.length-1].option&&t.length>0&&(r=t.length/e.length);for(var a,s,o,l=[],p=0,c=n;p<c.length;p++){var h=c[p];switch(h.option){case"Year":a=this.groupByYear(this.renderDates),l=this.generateSlots(a,r,h,"e-header-year-cell","yearHeader"),i.push(l);break;case"Month":s=this.groupByMonth(this.renderDates),l=this.generateSlots(s,r,h,"e-header-month-cell","monthHeader"),i.push(l);break;case"Week":o=this.groupByWeek(this.renderDates),l=this.generateSlots(o,r,h,"e-header-week-cell","weekHeader"),i.push(l);break;case"Date":l=(l=e).map((function(e){return e.colSpan=r,e})),i.push(l);break;case"Hour":t.length>0&&i.push(t)}}return i},t}(),wl=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Dl=function(t){function i(e){var i=t.call(this,e)||this;return i.timelineAppointment=null,i.baseCssClass="e-timeline-view",i}return wl(i,t),i.prototype.getModuleName=function(){return"timelineViews"},i.prototype.getLeftPanelElement=function(){return this.element.querySelector("."+yt)},i.prototype.scrollTopPanel=function(e){t.prototype.scrollTopPanel.call(this,e),this.scrollHeaderLabels(e)},i.prototype.scrollToWorkHour=function(){var t=this.parent.getStartEndTime(this.parent.workHours.start),i=this.isWorkDay(this.parent.selectedDate)&&this.parent.workHours.highlight&&!(0,e.isNullOrUndefined)(t)?new Date(+this.parent.selectedDate).setHours(t.getHours(),t.getMinutes(),0,0):new Date(+this.parent.selectedDate).setHours(0,0,0,0),n='[data-date="'+new Date(i).getTime().toString()+'"]',r=this.element.querySelector(n);r&&(this.getContentAreaElement().scrollLeft=this.parent.enableRtl?-(this.parent.getContentTable().offsetWidth-r.offsetLeft-r.offsetWidth):r.offsetLeft)},i.prototype.scrollToHour=function(t,i){var n,r,a;if(i&&(r=this.parent.getIndexOfDate(this.renderDates,ve(i)))>=0&&(n=i,!(0,e.isNullOrUndefined)(t))){var s=t.split(":");2===s.length&&(n=new Date(i.setHours(parseInt(s[0],10),parseInt(s[1],10),0)))}(n=(0,e.isNullOrUndefined)(i)?this.parent.getStartEndTime(t):n,(0,e.isNullOrUndefined)(n))||(a=(0,e.isNullOrUndefined)(t)||!this.parent.activeViewOptions.timeScale.enable?r*this.parent.getElementWidth(this.element.querySelector(".e-work-cells")):(0,e.isNullOrUndefined)(i)?this.getLeftFromDateTime(null,n):this.getLeftFromDateTime([r],n),this.getScrollableElement().scrollLeft=this.parent.enableRtl?-a:a)},i.prototype.generateColumnLevels=function(){var e=[],t=this.getDateSlots(this.renderDates,this.parent.activeViewOptions.workDays);e.push(t),this.parent.activeViewOptions.group.resources.length>0&&this.parent.resourceBase.generateResourceLevels(t,!this.parent.uiStateValues.isGroupAdaptive);var i=[];(this.parent.activeViewOptions.timeScale.enable&&(i=this.generateTimeSlots(e[e.length-1]),e.push(i)),this.parent.activeViewOptions.headerRows.length>0)&&(e=new Tl(this.parent,this.renderDates).generateColumnLevels(t,i));return e},i.prototype.generateTimeSlots=function(t){for(var i=this,n=this.getTimeSlotRows((function(e){return e.type=e.first?"majorSlot":"minorSlot",e.className=e.first?[Vt]:[Vt,xt],e.workDays=i.parent.activeViewOptions.workDays,e})),r=[],a=0,s=t;a<s.length;a++){var o=s[a];o.colSpan=n.length;for(var l=0,p=(0,e.extend)([],n,null,!0);l<p.length;l++){var c=p[l],h=ve(new Date(""+o.date));c.date=ge(h,me(c.date)),r.push(c)}}return r},i.prototype.changeCurrentTimePosition=function(){if(!(!this.parent||this.parent&&this.parent.isDestroyed)){this.removeCurrentTimeIndicatorElements();var t=this.getCurrentTimeIndicatorIndex(),i=this.getLeftFromDateTime(t,this.parent.getCurrentTime()),n=this.element.querySelector("."+Je).offsetHeight,r=this.element.querySelector("."+it);if(this.element.querySelector("."+ri).appendChild((0,e.createElement)("div",{className:Mt,styles:(this.parent.enableRtl?"right":"left")+":"+(0,e.formatUnit)(i)+"; height:"+(0,e.formatUnit)(n)})),this.parent.virtualScrollModule){var a=this.parent.element.querySelector("."+Mt),s=this.parent.element.querySelector("."+ri+" table");(0,e.setStyleAttribute)(a,{transform:s.style.transform})}var o=(0,e.createElement)("div",{innerHTML:this.parent.getTimeString(this.parent.getCurrentTime()),className:It});r.appendChild(o),o.style[this.parent.enableRtl?"right":"left"]=(0,e.formatUnit)(i-o.offsetWidth/2)}},i.prototype.getLeftFromDateTime=function(t,i){var n=this.getStartHour(),r=this.getEndHour(),a=0,s=60*(i.getHours()-n.getHours())+(i.getMinutes()-n.getMinutes()),o=De(ve(new Date(i.getTime())),n,r),l=(o.endHour.getTime()-o.startHour.getTime())/ne,p=this.parent.activeViewOptions.timeScale.interval,c=0;if(c=0===n.getHours()&&0===n.getMinutes()&&0===r.getHours()&&0===r.getMinutes()||1!==this.parent.activeViewOptions.timeScale.slotCount?p:p>l?l:p,!(0,e.isNullOrUndefined)(t)&&0!==t[0]){var h=this.parent.activeView.colLevels.findIndex((function(e){return"dateHeader"===e[0].type}));if(this.parent.activeView.colLevels[parseInt(h.toString(),10)]&&this.parent.activeView.colLevels[parseInt(h.toString(),10)][0].colSpan)a=t[0]*this.parent.activeView.colLevels[parseInt(h.toString(),10)][0].colSpan*this.parent.getElementWidth(this.element.querySelector(".e-work-cells"));else{var d=this.getEndHour(),u=0===d.getHours()?24:d.getHours();s+=t[0]*(60*(u-n.getHours())+(d.getMinutes()-n.getMinutes()))}}return a+s*this.parent.getElementWidth(this.element.querySelector(".e-work-cells"))*this.parent.activeViewOptions.timeScale.slotCount/c},i.prototype.renderHeader=function(){var t=(0,e.createElement)("tr");this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&this.parent.resourceBase.renderResourceHeaderIndent(t);var i=(0,e.createElement)("td");i.appendChild(this.renderDatesHeader()),t.appendChild(i),(0,e.prepend)([t],this.element.querySelector("tbody"))},i.prototype.createAllDayRow=function(e,t){},i.prototype.getCurrentTimeIndicatorIndex=function(){var e=[],t=this.parent.getIndexOfDate(this.renderDates,ve(this.parent.getCurrentTime()));return t>=0&&e.push(t),e},i.prototype.renderContent=function(){var t=(0,e.createElement)("tr");if(this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive){var i=(0,e.createElement)("td");i.appendChild(this.parent.resourceBase.createResourceColumn()),t.appendChild(i)}var n=(0,e.createElement)("td"),r=this.renderContentArea();r.appendChild(this.createEventTable(this.getRowCount())),this.collapseRows(r),n.appendChild(r),t.appendChild(n),this.parent.virtualScrollModule&&this.parent.virtualScrollModule.renderVirtualTrack(r),this.element.querySelector("tbody").appendChild(t)},i.prototype.getRowCount=function(){return this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive?this.parent.resourceBase.renderedResources.length:1},i.prototype.getResourceTdData=function(e,t){var i=this.parent.resourceBase.renderedResources[parseInt(e.toString(),10)],n=i.resourceData[i.resource.startHourField]||this.parent.workHours.start,r=i.resourceData[i.resource.endHourField]||this.parent.workHours.end;return t.startHour=this.parent.getStartEndTime(n),t.endHour=this.parent.getStartEndTime(r),t.workDays=i.resourceData[i.resource.workDaysField]||this.parent.workDays,t.className=i.className,t.groupIndex=i.groupIndex,t.groupOrder=i.groupOrder,t},i.prototype.renderContentTable=function(t){var i=t.querySelector("tbody");(0,e.append)(this.getContentRows(),i)},i.prototype.getContentRows=function(){for(var t=[],i=(0,e.createElement)("tr"),n=(0,e.createElement)("td"),r=this.getRowCount(),a=this.getGroupIndices(),s=0;s<r;s++)if(!(a.length>0&&a.indexOf(this.parent.resourceBase.renderedResources[parseInt(s.toString(),10)].groupIndex)>-1)){for(var o=i.cloneNode(),l=0,p=this.colLevels[this.colLevels.length-1];l<p.length;l++){var c=p[l];this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&(c=this.getResourceTdData(s,c));var h=this.createContentTd(c,c,n);o.appendChild(h)}t.push(o)}return t},i.prototype.getContentTdClass=function(e){return e.first||!this.parent.activeViewOptions.timeScale.enable?[$e]:[$e,At]},i.prototype.renderEvents=function(){this.timelineAppointment=new Pa(this.parent,this.parent.activeViewOptions.timeScale.enable?"hour":"day"),this.timelineAppointment.renderAppointments(),this.parent.notify(Y,{})},i.prototype.getAdjustedDate=function(e){if(!this.parent.activeViewOptions.timeScale.enable)return new Date(e.setHours(0,0,0,0));for(var t=this.colLevels[this.colLevels.length-1],i=0;i<t.length;i++)if(t[parseInt(i.toString(),10)].date.getTime()>e.getTime())return t[i-1].date;return null},i.prototype.destroy=function(){!this.parent||this.parent&&this.parent.isDestroyed||(this.timelineAppointment&&(this.timelineAppointment.destroy(),this.timelineAppointment=null),t.prototype.destroy.call(this))},i}(tl),bl=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Sl=function(t){function i(e){var i=t.call(this,e)||this;return i.viewClass="e-timeline-month-view",i.isInverseTableSelect=!0,i.appointment=null,i}return bl(i,t),i.prototype.getModuleName=function(){return"timelineMonth"},i.prototype.onDataReady=function(){this.appointment=new Pa(this.parent,"day"),this.appointment.renderAppointments(),this.parent.notify(Y,{})},i.prototype.getLeftPanelElement=function(){return this.element.querySelector("."+yt)},i.prototype.scrollTopPanel=function(e){t.prototype.scrollTopPanel.call(this,e),this.scrollHeaderLabels(e)},i.prototype.setContentHeight=function(t,i,n){i&&(i.style.height=(0,e.formatUnit)(n-this.getScrollXIndent(t))),t.style.height=(0,e.formatUnit)(n)},i.prototype.getDateSlots=function(e,t){for(var i=[],n=0,r=e;n<r.length;n++){var a=r[n],s=[rt];this.isCurrentDate(a)&&s.push(ot),i.push({date:a,type:"dateHeader",className:s,colSpan:1,workDays:t})}return i},i.prototype.renderLeftIndent=function(e){this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&this.parent.resourceBase.renderResourceHeaderIndent(e)},i.prototype.renderContent=function(){var t=(0,e.createElement)("tr");if(this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive){var i=(0,e.createElement)("td");i.appendChild(this.parent.resourceBase.createResourceColumn()),t.appendChild(i)}var n=(0,e.createElement)("td");this.element.querySelector("tbody").appendChild(t);var r=(0,e.createElement)("div",{className:ri});r.appendChild(this.renderContentArea()),r.appendChild(this.createEventTable(this.getRowCount())),this.collapseRows(r),e.EventHandler.add(r,"scroll",this.onContentScroll,this),n.appendChild(r),this.parent.virtualScrollModule&&this.parent.virtualScrollModule.renderVirtualTrack(r),t.appendChild(n)},i.prototype.getRowCount=function(){return this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive?this.parent.resourceBase.renderedResources.length:1},i.prototype.getContentSlots=function(){for(var e=[],t=0;t<this.getRowCount();t++)for(var i=0,n=this.colLevels[this.colLevels.length-1];i<n.length;i++){var r=n[i];if(r.className=[$e],this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive){var a=this.parent.resourceBase.renderedResources[parseInt(t.toString(),10)];r.workDays=a.resourceData[a.resource.workDaysField]||this.parent.workDays,r.className=r.className.concat(a.className),r.groupIndex=a.groupIndex,r.groupOrder=a.groupOrder}var s={date:new Date(+r.date),colSpan:r.colSpan,groupIndex:r.groupIndex,workDays:r.workDays,type:"monthCells",className:r.className};e[parseInt(t.toString(),10)]||(e[parseInt(t.toString(),10)]=[]),e[parseInt(t.toString(),10)].push(s)}return e},i.prototype.updateClassList=function(e){this.parent.isMinMaxDate(e.date)||e.className.push(Qn)},i.prototype.unWireEvents=function(){e.EventHandler.remove(this.getContentAreaElement(),"scroll",this.onContentScroll)},i.prototype.getMonthStart=function(e){var t=this.parent.calendarUtil.firstDateOfMonth(ve(e));return new Date(t.getFullYear(),t.getMonth(),t.getDate())},i.prototype.getMonthEnd=function(e){var t=this.parent.calendarUtil.firstDateOfMonth(ve(e));return this.parent.calendarUtil.lastDateOfMonth(Te(new Date(+t),this.parent.activeViewOptions.interval-1))},i.prototype.generateColumnLevels=function(){var e=[],t=this.getDateSlots(this.renderDates,this.parent.activeViewOptions.workDays);e.push(t),this.parent.activeViewOptions.group.resources.length>0&&this.parent.resourceBase.generateResourceLevels(t,!this.parent.uiStateValues.isGroupAdaptive);this.parent.activeViewOptions.headerRows.length>0&&(e=new Tl(this.parent,this.renderDates).generateColumnLevels(t,[]));return this.colLevels=e,e},i.prototype.getAdjustedDate=function(e){for(var t=this.colLevels[this.colLevels.length-1],i=0;i<t.length;i++)if(t[parseInt(i.toString(),10)].date.getTime()>e.getTime())return t[i-1].date;return null},i.prototype.destroy=function(){if(!(!this.parent||this.parent&&this.parent.isDestroyed)){if(this.element){var i=this.element.querySelector("."+ri);i&&e.EventHandler.remove(i,"scroll",this.onContentScroll)}this.appointment&&(this.appointment.destroy(),this.appointment=null),t.prototype.destroy.call(this)}},i}(pl),Cl=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ol=function(t){function i(e){var i=t.call(this,e)||this;return i.viewClass="e-timeline-year-view",i.isInverseTableSelect=!0,i}return Cl(i,t),i.prototype.getModuleName=function(){return"timelineYear"},i.prototype.renderHeader=function(t){var i=(0,e.createElement)("tr");if(t.appendChild(i),"Vertical"===this.parent.activeViewOptions.orientation&&this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive)this.parent.resourceBase.renderResourceHeaderIndent(i);else{var n=(0,e.createElement)("td",{className:ut});i.appendChild(n),n.appendChild(this.renderResourceHeader(gt))}var r="Horizontal"===this.parent.activeViewOptions.orientation,a=this.parent.activeViewOptions.group.resources.length>0;this.isInverseTableSelect=!(r&&!a);var s=(0,e.createElement)("td");i.appendChild(s);var o=(0,e.createElement)("div",{className:nt});if(s.appendChild(o),"Horizontal"===this.parent.activeViewOptions.orientation&&this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive)o.appendChild(this.renderResourceHeader(it)),this.columnCount=this.colLevels.slice(-1)[0].length;else{var l=(0,e.createElement)("div",{className:it});o.appendChild(l);var p=this.createTableLayout();l.appendChild(p),p.appendChild(this.createTableColGroup(this.columnCount));var c=(0,e.createElement)("tr");p.querySelector("tbody").appendChild(c);for(var h=this.getMonths(),d=this.getMonthDates(new Date(this.parent.selectedDate.getFullYear(),h[0],1)),u=0;u<this.columnCount;u++){var g=new Date(this.parent.selectedDate.getFullYear(),h[parseInt(u.toString(),10)],1),m=(0,e.createElement)("td",{className:rt});"Horizontal"===this.parent.activeViewOptions.orientation?this.parent.dayHeaderTemplate?(0,e.append)(this.renderDayMonthHeaderTemplate(d[parseInt(u.toString(),10)],u,"dayHeaderTemplate"),m):m.innerHTML="<span>"+this.parent.getDayNames("abbreviated")[u%7]+"</span>":(this.parent.monthHeaderTemplate?(0,e.append)(this.renderDayMonthHeaderTemplate(g,h[parseInt(u.toString(),10)],"monthHeaderTemplate"),m):m.innerHTML="<span>"+this.getMonthName(g)+"</span>",m.setAttribute("data-date",g.getTime().toString())),c.appendChild(m),this.parent.trigger(v,{elementType:"headerCells",element:m})}}},i.prototype.renderResourceHeader=function(t){var i=(0,e.createElement)("div",{className:t}),n=this.createTableLayout();i.appendChild(n);var r=(0,e.createElement)("tr");if(this.parent.activeViewOptions.group.resources.length>0)this.colLevels=this.generateColumnLevels();else{var a=[{className:[rt],type:"headerCell"}];this.colLevels=[a]}for(var s=0,o=this.colLevels;s<o.length;s++){for(var l=o[s],p=r.cloneNode(),c=0,h=t===it?l:[l[0]];c<h.length;c++){var d=h[c],u=(0,e.createElement)("td");d.className&&(0,e.addClass)([u],d.className),t===it&&(d.template&&(0,e.append)(d.template,u),d.colSpan&&u.setAttribute("colspan",d.colSpan.toString()),d.groupIndex>-1&&u.setAttribute("data-group-index",d.groupIndex.toString()),this.setResourceHeaderContent(u,d)),t===gt&&this.parent.renderHeaderIndentTemplate(d,u);var g={elementType:d.type,element:u,date:d.date,groupIndex:d.groupIndex};this.parent.trigger(v,g),p.appendChild(u)}n.querySelector("tbody").appendChild(p)}return t===it&&n.appendChild(this.createTableColGroup(this.colLevels.slice(-1)[0].length)),i},i.prototype.renderContent=function(t){var i=(0,e.createElement)("tr");t.appendChild(i);var n,r=(0,e.createElement)("td"),a=(0,e.createElement)("td"),s=[];if("Vertical"===this.parent.activeViewOptions.orientation&&this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive)s.push(r),r.appendChild(this.parent.resourceBase.createResourceColumn()),this.rowCount=this.parent.resourceBase.renderedResources.length;else{s.push(r);var o=(0,e.createElement)("div",{className:hr});r.appendChild(o),o.appendChild(this.createTableLayout()),n=o.querySelector("tbody")}s.push(a),(0,e.append)(s,i);var l=(0,e.createElement)("div",{className:ri});a.appendChild(l);var p=this.createTableLayout(Je);this.setAriaAttributes(p),l.appendChild(p);var c=(0,e.createElement)("div",{className:vt});l.appendChild(c),this.parent.virtualScrollModule&&this.parent.virtualScrollModule.renderVirtualTrack(l);var h=p.querySelector("tbody");if(this.parent.rowAutoHeight){var d=[p],u=this.parent.element.querySelector("."+hr+" ."+Qe);u&&d.push(u),(0,e.addClass)(d,lr)}if(this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive){var g="Horizontal"===this.parent.activeViewOptions.orientation?this.colLevels.slice(-1)[0].length:this.columnCount;p.appendChild(this.createTableColGroup(g)),this.renderResourceContent(c,n,h)}else p.appendChild(this.createTableColGroup(this.columnCount)),this.renderDefaultContent(c,n,h)},i.prototype.renderDefaultContent=function(t,i,n){for(var r=this.getMonths(),a=this.getMonthDates(new Date(this.parent.selectedDate.getFullYear(),r[0],1)),s=0;s<this.rowCount;s++){t.appendChild((0,e.createElement)("div",{className:Gt}));var o=new Date(this.parent.selectedDate.getFullYear(),r[parseInt(s.toString(),10)],1),l=this.parent.calendarUtil.getMonthStartDate(new Date(o.getTime())),p=this.parent.calendarUtil.getMonthEndDate(new Date(o.getTime())),c=(0,e.createElement)("tr"),h=c.cloneNode();i.appendChild(h);var d=c.cloneNode();n.appendChild(d);var u=(0,e.createElement)("td",{className:pi});"Horizontal"===this.parent.activeViewOptions.orientation?(this.parent.monthHeaderTemplate?(0,e.append)(this.renderDayMonthHeaderTemplate(l,s,"monthHeaderTemplate"),u):u.innerHTML="<span>"+this.getMonthName(o)+"</span>",u.setAttribute("data-date",o.getTime().toString())):this.parent.dayHeaderTemplate?(0,e.append)(this.renderDayMonthHeaderTemplate(a[parseInt(s.toString(),10)],s,"dayHeaderTemplate"),u):u.innerHTML="<span>"+this.parent.getDayNames("abbreviated")[s%7]+"</span>",h.appendChild(u),this.parent.trigger(v,{elementType:"leftHeaderCells",element:u});for(var g=new Date(l.getTime()),m=0;m<this.columnCount;m++){var f=void 0;if("Vertical"===this.parent.activeViewOptions.orientation){o=new Date(this.parent.selectedDate.getFullYear(),r[parseInt(m.toString(),10)],1),l=this.parent.calendarUtil.getMonthStartDate(new Date(o.getTime())),p=this.parent.calendarUtil.getMonthEndDate(new Date(o.getTime()));var y=s-l.getDay()+1;g=new Date(this.parent.selectedDate.getFullYear(),r[parseInt(m.toString(),10)],y),f=y>0&&g.getTime()<p.getTime()}else f=m>=l.getDay()&&g.getTime()<p.getTime();var T=this.parent.globalize.formatDate(g,{skeleton:"full",calendar:this.parent.getCalendarMode()}),w=(0,e.createElement)("td",{className:$e,attrs:{"aria-label":T}});d.appendChild(w);var D=(0,e.createElement)("div",{className:ui+" "+di,innerHTML:f?this.parent.globalize.formatDate(g,{skeleton:"d",calendar:this.parent.getCalendarMode()}):""});if(f){var b=[w],S=[];this.parent.activeViewOptions.workDays.indexOf(g.getDay())>-1&&S.push(at),this.parent.isMinMaxDate(g)||(0,e.addClass)([w],Qn),this.isCurrentDate(g)&&(S.push(ot),"Horizontal"===this.parent.activeViewOptions.orientation?b.push(this.element.querySelector("."+rt+":nth-child("+(m+1)+")")):b.push(this.element.querySelectorAll("."+pi).item(s))),S.length>0&&(0,e.addClass)(b,S)}else(0,e.addClass)([w],st),this.parent.isMinMaxDate(g)||(0,e.addClass)([w],Qn);w.classList.contains(st)||(this.renderDates.push(new Date(g)),w.appendChild(D),f&&(w.setAttribute("data-date",g.getTime().toString()),this.wireEvents(w)),this.renderCellTemplate({date:g,type:"workCells"},w),this.parent.trigger(v,{elementType:"workCells",element:w,date:g}),f&&"Horizontal"===this.parent.activeViewOptions.orientation&&(g=ye(new Date(g.getTime()),1)))}}this.renderDates.splice(0,1)},i.prototype.getContentRows=function(){for(var t=[],i=this.getMonths(),n=this.getGroupIndices(),r=0;r<this.parent.resourceBase.renderedResources.length;r++){var a=void 0;if(!(this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&(a=this.parent.resourceBase.renderedResources[parseInt(r.toString(),10)],n.length>0&&n.indexOf(a.groupIndex)>-1))){var s=(0,e.createElement)("tr");t.push(s);for(var o=new Date(this.parent.selectedDate.getFullYear(),i[parseInt(r.toString(),10)],1),l=this.parent.calendarUtil.getMonthStartDate(new Date(o.getTime())),p=0;p<this.columnCount;p++){var c=[],h=a.groupIndex;(c=c.concat(a.className)).indexOf(Dt)>-1?c.push(mt):c.push(at),o=new Date(this.parent.selectedDate.getFullYear(),i[parseInt(p.toString(),10)],1),l=this.parent.calendarUtil.getMonthStartDate(new Date(o.getTime()));var d=(0,e.createElement)("td",{className:$e,attrs:{"aria-selected":"false","data-date":l.getTime().toString()}});(0,e.addClass)([d],c),d.setAttribute("data-group-index",h.toString()),this.renderCellTemplate({date:l,type:"resourceGroupCells",groupIndex:h},d),this.wireEvents(d),this.parent.trigger(v,{elementType:"resourceGroupCells",element:d,date:l}),s.appendChild(d)}}}return t},i.prototype.renderResourceContent=function(t,i,n){for(var r=this.getMonths(),a=0;a<this.rowCount;a++){t.appendChild((0,e.createElement)("div",{className:Gt}));var s=(0,e.createElement)("tr");n.appendChild(s);var o=void 0;"Vertical"===this.parent.activeViewOptions.orientation&&this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&(o=this.parent.resourceBase.renderedResources[parseInt(a.toString(),10)]);var l=new Date(this.parent.selectedDate.getFullYear(),r[parseInt(a.toString(),10)],1),p=this.parent.calendarUtil.getMonthStartDate(new Date(l.getTime()));if("Horizontal"===this.parent.activeViewOptions.orientation){var c=s.cloneNode();i.appendChild(c);var h=(0,e.createElement)("td",{className:pi,attrs:{"data-date":p.getTime().toString()}});this.parent.monthHeaderTemplate?(0,e.append)(this.renderDayMonthHeaderTemplate(l,a,"monthHeaderTemplate"),h):h.innerHTML="<span>"+this.getMonthName(l)+"</span>",c.appendChild(h)}for(var d=0;d<this.columnCount;d++){var u=[],g=void 0;"Vertical"===this.parent.activeViewOptions.orientation?(g=o.groupIndex,(u=u.concat(o.className)).indexOf(Dt)>-1?u.push(mt):u.push(at),l=new Date(this.parent.selectedDate.getFullYear(),r[parseInt(d.toString(),10)],1),p=this.parent.calendarUtil.getMonthStartDate(new Date(l.getTime()))):(g=this.colLevels.slice(-1)[0][parseInt(d.toString(),10)].groupIndex,u.push(at));var m=this.parent.globalize.formatDate(p,{type:"dateTime",skeleton:"full",calendar:this.parent.getCalendarMode()}),f=this.parent.globalize.formatDate(this.parent.calendarUtil.getMonthEndDate(new Date(l.getTime())),{type:"dateTime",skeleton:"full",calendar:this.parent.getCalendarMode()}),y=(0,e.createElement)("td",{className:$e,attrs:{"aria-selected":"false","data-date":p.getTime().toString(),"aria-label":m+" "+this.parent.localeObj.getConstant("endAt")+" "+f}});(0,e.addClass)([y],u),y.setAttribute("data-group-index",g.toString()),this.renderCellTemplate({date:p,type:"resourceGroupCells",groupIndex:g},y),this.wireEvents(y),s.appendChild(y),this.parent.trigger(v,{elementType:"resourceGroupCells",element:y,date:p})}}"Vertical"===this.parent.activeViewOptions.orientation&&this.collapseRows(this.parent.element.querySelector("."+ri))},i.prototype.renderDayMonthHeaderTemplate=function(e,t,i){var n={date:e,type:"dayHeaderTemplate"===i?"dayHeader":"monthHeader"},r="schedule_"+this.parent.activeViewOptions.dayHeaderTemplateName+"dayHeaderTemplate",a="schedule_"+this.parent.activeViewOptions.dayHeaderTemplateName+"monthHeaderTemplate";return"dayHeaderTemplate"===i?(n.day=this.parent.getDayNames("wide")[t%7],[].slice.call(this.parent.getDayHeaderTemplate()(n,this.parent,"dayHeaderTemplate",r,!1,void 0,void 0,this.parent.root))):[].slice.call(this.parent.getMonthHeaderTemplate()(n,this.parent,"monthHeaderTemplate",a,!1,void 0,void 0,this.parent.root))},i.prototype.renderCellTemplate=function(t,i){if(this.parent.activeViewOptions.cellTemplate&&!i.classList.contains(st)){var n={date:t.date,type:t.type};t.groupIndex&&(n.groupIndex=t.groupIndex);var r=this.parent.element.id+"_"+this.parent.activeViewOptions.cellTemplateName+"cellTemplate",a=[].slice.call(this.parent.getCellTemplate()(n,this.parent,"cellTemplate",r,!1,void 0,void 0,this.parent.root));(0,e.append)(a,i)}},i.prototype.scrollToDate=function(e){var t;t=null!==this.parent.activeViewOptions.group.resources&&this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive?+new Date(ve(ce(e))):+new Date(ve(e));var i=this.element.querySelector('[data-date="'+t+'"]');if(i){var n=this.getScrollableElement();if(this.parent.enableRtl){var r=this.element.querySelector("."+Je);n.scrollLeft=-(r.offsetWidth-i.offsetLeft-i.offsetWidth)}else n.scrollLeft=i.offsetLeft;n.scrollTop=i.offsetTop}},i.prototype.getScrollableElement=function(){return this.parent.isAdaptive&&!this.isTimelineView()?this.element.querySelector("."+Ht):this.getContentAreaElement()},i.prototype.wireEvents=function(t){e.EventHandler.add(t,"mousedown",this.parent.workCellAction.cellMouseDown,this.parent.workCellAction),e.EventHandler.add(t,"click",this.parent.workCellAction.cellClick,this.parent.workCellAction),this.parent.isAdaptive||e.EventHandler.add(t,"dblclick",this.parent.workCellAction.cellDblClick,this.parent.workCellAction)},i}(hl),El=function(){function t(e){this.parent=e}return t.prototype.initializeCalendarExport=function(e,t){var i=this.getCalendarString(e,t);this.download(i,e)},t.prototype.getCalendarString=function(t,i){var n=this,r=i||(0,e.extend)([],this.parent.eventsData,null,!0);r=this.parent.eventBase.sortByTime(r);var a=-1!==navigator.appVersion.indexOf("Win")?"\r\n":"\n",s=[],o=[],l=this.parent.timezone||this.parent.tzModule.getLocalTimezoneName(),p=this.parent.eventFields;return r.forEach((function(t){var i=t[p.id]||t.Guid||n.parent.eventBase.generateGuid(),c=[];if(t[p.recurrenceID]){var h=n.filterEvents(o,p.id,t[p.recurrenceID]);i=h.length>0?h[0].UID:i}if(!t[p.recurrenceID]&&t[p.recurrenceRule]&&t[p.recurrenceException]){var d=t[p.recurrenceException].split(",");n.filterEvents(r,p.recurrenceID,t[p.id]).forEach((function(e){c.push(Ea(e[p.startTime]))}));var u=d.filter((function(e){return-1===c.indexOf(e)}));t[p.recurrenceException]=u.length>0?u.join(",")+",":""}var g=t[p.startTimezone]||l,v=t[p.endTimezone]||l,m=!!t[p.isReadonly]&&t[p.isReadonly],f=["BEGIN:VEVENT","LOCATION:"+(t[p.location]||""),"SUMMARY:"+(t[p.subject]||""),"UID:"+i,"DESCRIPTION:"+(t[p.description]||""),"ISREADONLY:"+m,"END:VEVENT"];if(t[p.isAllDay]?(f.splice(4,0,"DTEND;VALUE=DATE:"+n.convertDateToString(t[p.endTime],!0)),f.splice(4,0,"DTSTART;VALUE=DATE:"+n.convertDateToString(t[p.startTime],!0))):t[p.isAllDay]||t[p.recurrenceRule]?(f.splice(4,0,'DTEND;TZID="'+v+'":'+n.convertDateToString(t[p.endTime])),f.splice(4,0,'DTSTART;TZID="'+g+'":'+n.convertDateToString(t[p.startTime]))):(f.splice(4,0,"DTEND:"+n.convertDateToString(t[p.endTime])),f.splice(4,0,"DTSTART:"+n.convertDateToString(t[p.startTime]))),t[p.recurrenceRule]&&f.splice(4,0,"RRULE:"+t[p.recurrenceRule]),t[p.recurrenceException]){d=t[p.recurrenceException].split(",");for(var y=0;y<d.length-1;y++)f.splice(5,0,"EXDATE:"+n.convertDateToString(kr(d[parseInt(y.toString(),10)]),t[p.isAllDay]))}t[p.recurrenceID]&&f.splice(4,0,'RECURRENCE-ID;TZID="'+g+'":'+n.convertDateToString(t[p.startTime],t[p.isAllDay]));var T=n.customFieldFilter(t,p);T.length>0&&T.forEach((function(e){return f.splice(4,0,e+":"+(t[""+e]||""))}));var w=(0,e.extend)({},t);w.UID=i,o.push(w),s.push(f.join(a))})),["BEGIN:VCALENDAR","PRODID:-//Syncfusion Inc//Scheduler//EN","VERSION:2.0","CALSCALE:GREGORIAN","METHOD:PUBLISH","X-WR-CALNAME:"+(t||"Calendar"),"X-WR-TIMEZONE:"+l].join(a)+a+s.join(a)+a+"END:VCALENDAR"},t.prototype.customFieldFilter=function(e,t){var i=Object.keys(t).map((function(e){return t[""+e]}));return Object.keys(e).filter((function(e){return-1===i.indexOf(e)&&"Guid"!==e}))},t.prototype.convertDateToString=function(e,t){var i=("0000"+e.getFullYear().toString()).slice(-4),n=("00"+(e.getMonth()+1).toString()).slice(-2),r=("00"+e.getDate().toString()).slice(-2),a=("00"+e.getHours().toString()).slice(-2),s=("00"+e.getMinutes().toString()).slice(-2),o=("00"+e.getSeconds().toString()).slice(-2);return t?i+n+r:i+n+r+"T"+a+s+o},t.prototype.download=function(e,t){var i=new Blob([e],{type:"data:text/calendar;charset=utf8"});if(t=(t||"Calendar")+".ics",navigator.msSaveBlob)navigator.msSaveBlob(i,t);else{var n=document.createElementNS("http://www.w3.org/1999/xhtml","a");n.download=t,n.href=URL.createObjectURL(i);var r=document.createEvent("MouseEvent");r.initEvent("click",!0,!0),n.dispatchEvent(r),setTimeout((function(){URL.revokeObjectURL(n.href),n.href=void 0}))}},t.prototype.filterEvents=function(e,t,i){return e.filter((function(e){return e[""+t]===i}))},t.prototype.getModuleName=function(){return"iCalendarExport"},t.prototype.destroy=function(){!this.parent||this.parent&&this.parent.isDestroyed||(this.parent=null)},t}(),xl=function(){function t(e){this.allDay=!1,this.parent=e}return t.prototype.initializeCalendarImport=function(e){var t=this;if(e&&e instanceof Blob){var i=new FileReader;i.onload=function(){var e=i.result;t.iCalendarParser(e)},i.readAsText(e,"UTF-8")}else e&&"string"==typeof e&&this.iCalendarParser(e)},t.prototype.iCalendarParser=function(t){var i,n,r={isEvent:!1,curEvent:null,id:this.parent.eventBase.getEventMaxID(),count:0,events:[],key:null},a=t.length,s=t.search(/[^ \t]/),o=s;do{0===(o=t.indexOf("\n",s)+1)?(o=a,n=0):n=o>1&&"\r"===t[o-2]?2:1;var l=t.charAt(s);" "===l||"\n"===l||"\t"===l?i+=t.slice(s+1,o-n):(i&&(r=this.updateEventData(i,r)),i=t.slice(s,o-n)),s=o}while(o!==a);(i=i.trim()).length&&(r=this.updateEventData(i,r));var p=(0,e.extend)([],r.events,null,!0);this.parent.addEvent(this.processOccurrence(p,r.id))},t.prototype.updateEventData=function(t,i){var n=this.parent.eventFields,r=i.id,a=i.events,s=i.isEvent,o=i.count,l=i.curEvent,p=i.key;if(s||"BEGIN:VEVENT"!==t||(s=!0,l={}),s&&"END:VEVENT"===t&&(s=!1,a.push(l),l=null),s){var c=t.indexOf(":"),h=t.substring(0,c).replace(/^\s\s*/,"").replace(/\s\s*$/,""),d=t.substring(c+1,t.length).replace(/^\s\s*/,"").replace(/\s\s*$/,"");if(-1!==t.indexOf("SUMMARY")&&(h="SUMMARY"),-1!==t.indexOf("DTSTART"))l[n.startTime]=this.dateParsing(t),l[n.isAllDay]=this.allDay,this.allDay=!1;else if(-1!==t.indexOf("DTEND"))l[n.endTime]=this.dateParsing(t);else if(-1!==t.indexOf("EXDATE"))d=Ea(this.dateParsing(t)),l[n.recurrenceException]=(0,e.isNullOrUndefined)(l[n.recurrenceException])?d:l[n.recurrenceException]+","+d;else if(-1!==t.indexOf("RECURRENCE-ID"))d=Ea(this.dateParsing(t)),l[n.recurrenceException]=d,l[n.recurrenceID]=d;else switch(p=h||p){case"BEGIN":break;case"UID":l[""+h]=d,"number"==typeof r?(l[n.id]=parseInt(d,10),isNaN(l[n.id])&&(l[n.id]=r+o,o++)):l[n.id]=d;break;case"SUMMARY":l[n.subject]=this.getFormattedString(d);break;case"LOCATION":l[n.location]=this.getFormattedString(d);break;case"DESCRIPTION":l[n.description]?l[n.description]=this.getFormattedString(l[n.description]+"\r\n"+d):l[n.description]=this.getFormattedString(d);break;case"ISREADONLY":l[n.isReadonly]=d.indexOf("true")>-1;break;case"RRULE":l[n.recurrenceRule]=d;break;default:if(this.parent.resourceCollection.length>0){var u=this.parent.resourceCollection.filter((function(e){return e.field===h}));l[""+h]=u.length>0&&"number"==typeof u[0].dataSource[0][u[0].idField]?parseInt(d,10):d}else l[""+h]=d}}return{isEvent:s,curEvent:l,id:r,count:o,events:a,key:p}},t.prototype.processOccurrence=function(t,i){var n=this,r=[],a="UID",s=this.parent.eventFields,o=[];return this.parent.eventsData.forEach((function(e){o.push(e[s.id])})),t.forEach((function(l){var p,c;if(l.hasOwnProperty(s.recurrenceID)||(p=l,c=l[s.id]),o.indexOf(l[s.id])<0){var h=t.filter((function(e){return e.UID===l[""+a]}));if(h.length>1&&(0,e.isNullOrUndefined)(l[s.recurrenceID])){c="number"==typeof i?i++:c;for(var d=0;d<h.length;d++)if(h[parseInt(d.toString(),10)].hasOwnProperty(s.recurrenceID)){var u=h[parseInt(d.toString(),10)][s.recurrenceID];h[parseInt(d.toString(),10)][s.id]="number"==typeof i?i++:n.parent.eventBase.generateGuid(),h[parseInt(d.toString(),10)][s.recurrenceID]=c,h[parseInt(d.toString(),10)][s.recurrenceException]=null,p[s.recurrenceException]=n.getExcludeDateString(p[s.recurrenceException],u),delete h[parseInt(d.toString(),10)][""+a],r.push(h[parseInt(d.toString(),10)])}delete p[""+a],p[s.id]=c,r.push(p)}else l.hasOwnProperty(s.recurrenceID)||(delete l[""+a],l[s.id]="number"==typeof i?i++:c,r.push(l))}})),r},t.prototype.getExcludeDateString=function(t,i){if((0,e.isNullOrUndefined)(t))return i;if((0,e.isNullOrUndefined)(i))return t;var n=t.split(",").map((function(e){return e.split("T")[0]})),r=i.split(",").map((function(e){return e.split("T")[0]}));return n.filter((function(e){return r.indexOf(e)>-1})).length>0?t:t+","+i},t.prototype.getFormattedString=function(e){return(e=e||"").replace(/\\\,/g,",").replace(/\\\;/g,";").replace(/\\[nN]/g,"\n").replace(/\\\\/g,"\\")},t.prototype.dateParsing=function(e){var t=e.split(":"),i=t[t.length-1],n=new Date(this.getFormattedString(i));if(e&&(e.indexOf("VALUE=DATE")>-1||e.indexOf("RECURRENCE-ID;TZID")>-1)){var r=/^(\d{4})(\d{2})(\d{2})$/.exec(i);null!==r&&(n=new Date(parseInt(r[1],10),parseInt(r[2],10)-1,parseInt(r[3],10))),e.indexOf("DTSTART")>-1&&(this.allDay=!0)}var a=/^(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2})(Z)?$/.exec(i);return null!==a&&(n="Z"===a[7]?new Date(Date.UTC(parseInt(a[1],10),parseInt(a[2],10)-1,parseInt(a[3],10),parseInt(a[4],10),parseInt(a[5],10),parseInt(a[6],10))):new Date(parseInt(a[1],10),parseInt(a[2],10)-1,parseInt(a[3],10),parseInt(a[4],10),parseInt(a[5],10),parseInt(a[6],10))),n},t.prototype.getModuleName=function(){return"iCalendarImport"},t.prototype.destroy=function(){!this.parent||this.parent&&this.parent.isDestroyed},t}(),Vl=d(437),Al=function(){function t(e){this.parent=e}return t.prototype.initializeExcelExport=function(t){void 0===t&&(t={});var i,n,r=this.getExportColumns(t),a=t.fileName||"Schedule",s=t.exportType||"xlsx",o=t.includeOccurrences||!1;(0,e.isNullOrUndefined)(t.separator)||","===t.separator||(i=t.separator),n=t.customData?o?this.parent.eventBase.getProcessedEvents(t.customData):t.customData:o?this.parent.eventsProcessed:this.parent.eventsData,this.processWorkbook(r,a,s,n,i)},t.prototype.processWorkbook=function(t,i,n,r,a){var s=this,o=[],l=[],p=[];t.forEach((function(e,t){o.push({index:t+1,width:"Id"===e.name?50:150})}));var c={fontSize:12,borders:{color:"#E0E0E0"},bold:!0};t.forEach((function(e,t){p.push({index:t+1,value:e.text,style:c})})),l.push({index:1,cells:p}),r.forEach((function(i,n){var r=[];t.forEach((function(t,n){var a={index:n+1,value:i[t.name]||""};if(t.name===s.parent.eventFields.startTime||t.name===s.parent.eventFields.endTime){a=(0,e.extend)({},a,{style:{fontSize:12,numberFormat:"m/d/yyyy h:mm a"}},!0)}r.push(a)})),l.push({index:n+2,cells:r})}));var h={cancel:!1,worksheets:[{columns:o,rows:l}]};this.parent.trigger(q,h,(function(e){e.cancel||new Vl.Workbook({worksheets:e.worksheets},n,s.parent.locale,void 0,a).save(i+"."+n)}))},t.prototype.getExportColumns=function(e){var t=this,i=e.fieldsInfo||[];0===i.length&&(e.fields||Object.keys(this.parent.eventFields).map((function(e){return t.parent.eventFields[""+e]}))).forEach((function(e){i.push({name:e,text:e})}));return i},t.prototype.getModuleName=function(){return"excelExport"},t.prototype.destroy=function(){this.parent=null},t}(),Il=function(){function t(e){this.parent=e}return t.prototype.print=function(t){(0,e.isNullOrUndefined)(t)?this.printScheduler():this.printSchedulerWithModel(t)},t.prototype.printScheduler=function(){var t=this,i=this.parent.element.cloneNode(!0);i.id=this.parent.element.id+"_print";var n={cancel:!1,printElement:i};this.parent.trigger(L,n,(function(n){if(!n.cancel){document.body.appendChild(i);for(var r="MonthAgenda"===t.parent.currentView?".e-appointment-wrap":".e-content-wrap",a=t.parent.element.querySelector(r),s="",o=0,l=[].slice.call(document.getElementsByTagName("head")[0].querySelectorAll("link, style"));o<l.length;o++){s+=l[o].outerHTML}var p=(0,e.createElement)("div");i.style.width=t.parent.element.offsetWidth+"px";var c=100*Math.round(parseInt(i.style.width,10)/100);p.appendChild(i);var h=window.open("","print","height=550,width="+c+",tabbar=no");h.document.write("<!DOCTYPE html><html><head>"+s+"</head><body>"+p.innerHTML+"<script>(function() { window.ready = true; })();<\/script></body></html>"),h.document.close(),h.focus(),setTimeout((function(){if(h.ready&&a){a.scrollLeft=a.scrollLeft,a.scrollTop=a.scrollTop;var e=h.document.querySelector(".e-date-header-wrap");e&&(e.scrollLeft=a.scrollLeft);var t=h.document.querySelector(".e-time-cells-wrap");t&&(t.scrollTop=a.scrollTop);var i=h.document.querySelector(r);i&&(i.scrollLeft=a.scrollLeft,i.scrollTop=a.scrollTop),h.print(),h.close()}}),500)}}))},t.prototype.printSchedulerWithModel=function(t){var i=this,n=(0,e.createElement)("div",{id:this.parent.element.id+"_print",className:"e-print-schedule"});document.body.appendChild(n),Yo.Inject(nl,al,ol,pl,ml,yl,Dl,Sl,hl,Ol),this.printInstance=new Yo(this.getPrintScheduleModel(t)),this.printInstance.isPrinting=!0,this.printInstance.registeredTemplate=this.parent.registeredTemplate,this.printInstance.root=this.parent.root?this.parent.root:this.parent,this.printInstance.appendTo(n);var r={cancel:!1,printElement:n};this.parent.trigger(L,r,(function(e){e.cancel?i.printCleanup():(i.printInstance.on(W,i.contentReady,i),i.printWindow=window.open("","print","height="+window.outerHeight+",width="+window.outerWidth+",tabbar=no"),i.printWindow.moveTo(0,0),i.printWindow.resizeTo(screen.availWidth,screen.availHeight))}))},t.prototype.getPrintScheduleModel=function(t){for(var i,n,r,a,s={},o=["cellHeaderTemplate","dayHeaderTemplate","monthHeaderTemplate","cellTemplate","dateHeaderTemplate","dateRangeTemplate","eventTemplate","resourceHeaderTemplate","headerIndentTemplate"],l=["actionBegin","actionComplete","actionFailure","created","dataBinding","dataBound","destroyed","eventRendered","moreEventsClick","navigating","popupOpen","popupClose","renderCell"],p=0,c=["agendaDaysCount","calendarMode","cssClass","currentView","dateFormat","enableRtl","endHour","eventSettings","firstDayOfWeek","firstMonthOfYear","group","height","locale","maxDate","minDate","readonly","resources","rowAutoHeight","selectedDate","showHeaderBar","showTimeIndicator","showWeekNumber","showWeekend","startHour","timeFormat","timeScale","timezone","views","width","workDays","workHours","dateHeaderTemplate","dateRangeTemplate","cellHeaderTemplate","dayHeaderTemplate","monthHeaderTemplate","cellTemplate","resourceHeaderTemplate","headerIndentTemplate","actionBegin","actionComplete","actionFailure","created","dataBinding","dataBound","destroyed","eventRendered","moreEventsClick","navigating","popupOpen","popupClose","renderCell"];p<c.length;p++){var h=c[p];switch(h){case"eventSettings":(i=Object.assign({},this.parent.eventSettings.properties)).dataSource=this.parent.eventsData;var d=(0,e.isNullOrUndefined)(t.eventSettings)||(0,e.isNullOrUndefined)(t.eventSettings.template)?i.template:t.eventSettings.template;i.template=this.parent.isAngular||"function"!=typeof d?d:null,s.eventSettings=i;break;case"group":(n=(0,e.isNullOrUndefined)(t.group)?this.parent.group:t.group).headerTooltipTemplate=null,s.group=n;break;case"timeScale":r=(0,e.isNullOrUndefined)(t.timeScale)?this.parent.timeScale:t.timeScale,this.parent.isAngular||(r.majorSlotTemplate="function"==typeof r.majorSlotTemplate?null:r.majorSlotTemplate,r.minorSlotTemplate="function"==typeof r.minorSlotTemplate?null:r.minorSlotTemplate),s.timeScale=r;break;case"views":if(a=(0,e.isNullOrUndefined)(t.views)?this.parent.views:t.views,!this.parent.isAngular&&a&&a.length>0&&"object"==typeof a[0])for(var u=function(t){o.forEach((function(i){(0,e.isNullOrUndefined)(t[""+i])||(t[""+i]="function"==typeof t[""+i]?null:t[""+i])}))},g=0,v=a;g<v.length;g++){u(v[g])}s.views=a;break;default:if(o.indexOf(h)>-1){s[""+h]=(0,e.isNullOrUndefined)(t[""+h])?this.parent.isAngular||"function"!=typeof this.parent[""+h]?this.parent[""+h]:null:this.parent.isAngular||"function"!=typeof t[""+h]?t[""+h]:null;break}if(l.indexOf(h)>-1){s[""+h]=t[""+h];break}s[""+h]=(0,e.isNullOrUndefined)(t[""+h])?this.parent[""+h]:t[""+h]}}return s},t.prototype.contentReady=function(){var t=this;this.printWindow=(0,e.print)(this.printInstance.element,this.printWindow),this.closePrintWindow(this.printWindow,!0),this.printWindow.onbeforeunload=function(){t.printCleanup()}},t.prototype.closePrintWindow=function(t,i){var n=this;if(e.Browser.isIos)var r=setInterval((function(){t.opener?t.close():(0,e.isNullOrUndefined)(t.opener)&&(i&&n.printCleanup(),clearInterval(r))}),500)},t.prototype.printCleanup=function(){this.printInstance&&(this.printInstance.off(W,this.contentReady),this.printInstance.element.remove(),this.printInstance.destroy(),this.printInstance=null),this.printWindow&&(this.printWindow.onbeforeunload=null,this.printWindow=null)},t.prototype.getModuleName=function(){return"print"},t.prototype.destroy=function(){this.parent=null},t}()})(),u})()));
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("SyncfusionBase"),require("SyncfusionPopups"),require("SyncfusionNavigations"),require("SyncfusionCalendars"),require("SyncfusionData"),require("SyncfusionButtons"),require("SyncfusionInputs"),require("SyncfusionDropdowns"),require("SyncfusionLists"),require("SyncfusionExcelExport")):"function"==typeof define&&define.amd?define(["SyncfusionBase","SyncfusionPopups","SyncfusionNavigations","SyncfusionCalendars","SyncfusionData","SyncfusionButtons","SyncfusionInputs","SyncfusionDropdowns","SyncfusionLists","SyncfusionExcelExport"],t):"object"==typeof exports?exports.SyncfusionSchedule=t(require("SyncfusionBase"),require("SyncfusionPopups"),require("SyncfusionNavigations"),require("SyncfusionCalendars"),require("SyncfusionData"),require("SyncfusionButtons"),require("SyncfusionInputs"),require("SyncfusionDropdowns"),require("SyncfusionLists"),require("SyncfusionExcelExport")):e.SyncfusionSchedule=t(e.SyncfusionBase,e.SyncfusionPopups,e.SyncfusionNavigations,e.SyncfusionCalendars,e.SyncfusionData,e.SyncfusionButtons,e.SyncfusionInputs,e.SyncfusionDropdowns,e.SyncfusionLists,e.SyncfusionExcelExport)}(self,((e,t,i,n,r,a,s,o,l,p)=>(()=>{"use strict";var c={766:t=>{t.exports=e},741:e=>{e.exports=a},570:e=>{e.exports=n},74:e=>{e.exports=r},778:e=>{e.exports=o},437:e=>{e.exports=p},323:e=>{e.exports=s},90:e=>{e.exports=l},215:e=>{e.exports=i},197:e=>{e.exports=t}},h={};function d(e){var t=h[e];if(void 0!==t)return t.exports;var i=h[e]={exports:{}};return c[e](i,i.exports,d),i.exports}d.d=(e,t)=>{for(var i in t)d.o(t,i)&&!d.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},d.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),d.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var u={};return(()=>{d.r(u),d.d(u,{Agenda:()=>ml,DEFAULT_WEEKS:()=>te,Day:()=>nl,DragAndDrop:()=>Jo,ExcelExport:()=>Al,Gregorian:()=>Or,HeaderRenderer:()=>yr,ICalendarExport:()=>El,ICalendarImport:()=>xl,Islamic:()=>Er,MS_PER_DAY:()=>ie,MS_PER_MINUTE:()=>ne,Month:()=>pl,MonthAgenda:()=>yl,Print:()=>Il,RecurrenceEditor:()=>io,Resize:()=>Xo,Schedule:()=>Yo,TimelineMonth:()=>Sl,TimelineViews:()=>Dl,TimelineYear:()=>Ol,Timezone:()=>xr,ViewBase:()=>$o,WEEK_LENGTH:()=>ee,Week:()=>al,WorkWeek:()=>ol,Year:()=>hl,actionBegin:()=>p,actionComplete:()=>c,actionFailure:()=>h,addDays:()=>ye,addMonths:()=>Te,addYears:()=>we,agendaCells:()=>H,beforePaste:()=>N,beforePrint:()=>L,capitalizeFirstWord:()=>je,cellClick:()=>r,cellDoubleClick:()=>a,cellMouseDown:()=>$,cellSelect:()=>I,contentReady:()=>_,dataBinding:()=>T,dataBound:()=>w,dataReady:()=>z,dateHeader:()=>j,documentClick:()=>Z,documentPaste:()=>J,drag:()=>C,dragStart:()=>S,dragStop:()=>O,eventClick:()=>m,eventDoubleClick:()=>f,eventRendered:()=>y,eventsLoaded:()=>Y,excelExport:()=>q,extractObjectFromRule:()=>Jr,findIndexInData:()=>Ae,firstDateOfMonth:()=>ce,generate:()=>Mr,generateSummary:()=>Ar,getCalendarUtil:()=>ra,getDateCount:()=>fe,getDateFromRecurrenceDateString:()=>kr,getDateFromString:()=>Ce,getDateInMs:()=>me,getDaysCount:()=>Se,getElementHeight:()=>Le,getElementHeightFromClass:()=>re,getElementTop:()=>qe,getElementWidth:()=>Ne,getElementWidthFromClass:()=>ae,getMaxDays:()=>be,getOuterHeight:()=>Ie,getRecurrenceStringFromDate:()=>Ea,getScrollBarWidth:()=>xe,getStartEndHours:()=>De,getTranslateX:()=>oe,getTranslateY:()=>se,getUniversalTime:()=>Re,getWeekFirstDate:()=>le,getWeekLastDate:()=>pe,getWeekMiddleDate:()=>ue,getWeekNumber:()=>de,hover:()=>l,initialEnd:()=>B,initialLoad:()=>U,inlineClick:()=>A,isDaylightSavingTime:()=>ke,isIPadDevice:()=>Pe,isMobile:()=>He,lastDateOfMonth:()=>he,moreEventsClick:()=>s,navigating:()=>g,noEvents:()=>R,popupClose:()=>b,popupOpen:()=>D,print:()=>W,removeChildren:()=>Me,renderCell:()=>v,resetScrollbarWidth:()=>Ve,resetTime:()=>ve,resizeStart:()=>E,resizeStop:()=>V,resizing:()=>x,resourceHeader:()=>P,scroll:()=>G,scrollUiUpdate:()=>Q,select:()=>o,setTime:()=>ge,timezoneData:()=>Vr,tooltipOpen:()=>F,uiUpdate:()=>K,virtualScroll:()=>X,virtualScrollStart:()=>M,virtualScrollStop:()=>k});var e=d(766),t=d(197),i=d(215),n=d(570),r="cellClick",a="cellDoubleClick",s="moreEventsClick",o="select",l="hover",p="actionBegin",c="actionComplete",h="actionFailure",g="navigating",v="renderCell",m="eventClick",f="eventDoubleClick",y="eventRendered",T="dataBinding",w="dataBound",D="popupOpen",b="popupClose",S="dragStart",C="drag",O="dragStop",E="resizeStart",x="resizing",V="resizeStop",A="inlineClick",I="cellSelect",M="virtualScrollStart",k="virtualScrollStop",R="noEvents",H="agendaCells",P="resourceHeader",j="dateHeader",N="beforePaste",L="beforePrint",q="excelExport",F="tooltipOpen",U="initial-load",B="initial-end",W="print",z="data-ready",Y="events-loaded",_="content-ready",G="scroll",X="virtual-scroll",Q="scroll-ui-update",K="ui-update",Z="document-click",J="document-paste",$="cell-mouse-down",ee=7,te=6,ie=864e5,ne=6e4;function re(t,i,n){var r,a=(0,e.createElement)("div",{className:i}).cloneNode();return a.style.visibility="hidden",a.style.position="absolute",t.appendChild(a),r=Le(a,n),(0,e.remove)(a),r}function ae(t,i,n){var r,a=(0,e.createElement)("div",{className:i}).cloneNode();return a.style.visibility="hidden",a.style.position="absolute",t.appendChild(a),r=Ne(a,n),(0,e.remove)(a),r}function se(e){var t=getComputedStyle(e);return window.WebKitCSSMatrix?new WebKitCSSMatrix(t.webkitTransform).m42:0}function oe(e){var t=getComputedStyle(e);return window.WebKitCSSMatrix?new WebKitCSSMatrix(t.webkitTransform).m41:0}function le(e,t){var i=new Date(e.getTime());return t=(t-i.getDay()-7)%7,new Date(i.setDate(i.getDate()+(isNaN(t)?0:t)))}function pe(e,t){var i=le(e,t),n=new Date(i.getFullYear(),i.getMonth(),i.getDate()+6);return new Date(n.getTime())}function ce(e){return new Date(e.getFullYear(),e.getMonth(),1)}function he(e){return new Date(e.getFullYear(),e.getMonth()+1,0)}function de(e){var t=new Date(e.getFullYear(),0,1).valueOf(),i=(new Date(e.getFullYear(),e.getMonth(),e.getDate()).valueOf()-t+ie)/ie;return Math.ceil(i/7)}function ue(e,t){return new Date(t.valueOf()-(t.valueOf()-e.valueOf())/2)}function ge(e,t){var i=e.getTimezoneOffset(),n=new Date(e.getTime()+t),r=n.getTimezoneOffset()-i;return e.setTime(n.getTime()+r*ne),e}function ve(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function me(e){var t=new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0).getTimezoneOffset(),i=e.getTimezoneOffset()-t;return e.getTime()-new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0).getTime()-60*i*1e3}function fe(e,t){return Math.ceil((t.getTime()-e.getTime())/ie)}function ye(e,t){return e=new Date(""+e),new Date(e.setDate(e.getDate()+t))}function Te(e,t){var i=(e=new Date(""+e)).getDate();return e.setDate(1),e.setMonth(e.getMonth()+t),e.setDate(Math.min(i,be(e))),e}function we(e,t){var i=(e=new Date(""+e)).getDate();return e.setDate(1),e.setFullYear(e.getFullYear()+t),e.setDate(Math.min(i,be(e))),e}function De(e,t,i){var n=new Date(e.getTime());n.setHours(t.getHours()),n.setMinutes(t.getMinutes()),n.setSeconds(t.getSeconds());var r=new Date(e.getTime());return 0===i.getHours()?r=ye(r,1):(r.setHours(i.getHours()),r.setMinutes(i.getMinutes()),r.setSeconds(i.getSeconds())),{startHour:n,endHour:r}}function be(e){return he(e).getDate()}function Se(e,t){var i=ve(new Date(e)),n=ve(new Date(t));return Math.round((n.getTime()-i.getTime())/ie)}function Ce(e){return-1!==e.indexOf("Date")?new Date(parseInt(e.match(/\d+/g).toString(),10)):-1!==e.indexOf("T")?new Date(e):new Date(e.replace(/-/g,"/"))}var Oe=null,Ee=null;function xe(){if(null!==Oe)return Oe;null===Ee&&(Ee=window.devicePixelRatio||window.screen.availWidth/document.documentElement.clientWidth);var t,i=(0,e.createElement)("div");i.style.cssText="width:100px;height: 100px;overflow: scroll;position: absolute;top: -9999px;",document.body.appendChild(i);var n=devicePixelRatio?"1.10"===devicePixelRatio.toFixed(2)||devicePixelRatio<=1?Math.ceil(devicePixelRatio%1):Math.floor(devicePixelRatio%1):0;return t=i.offsetWidth-i.clientWidth-n|0,document.body.removeChild(i),Oe=t}function Ve(){var e=window.devicePixelRatio||window.screen.availWidth/document.documentElement.clientWidth;Ee&&Ee!==e&&(Oe=null,Ee=e)}function Ae(e,t,i,n,r){for(var a=0,s=e.length;a<s;a++)if(e[parseInt(a.toString(),10)][""+t]===i){if(!n)return a;var o=r.slice(-2)[0].field;if((n[""+o]instanceof Array?n[""+o]:[n[""+o]]).join(",").includes(e[parseInt(a.toString(),10)][r.slice(-1)[0].groupIDField]))return a}return-1}function Ie(e){var t=getComputedStyle(e);return e.offsetHeight+(parseInt(t.marginTop,10)||0)+(parseInt(t.marginBottom,10)||0)}function Me(e){for(var t=0,i=[].slice.call(e.children);t<i.length;t++){var n=i[t];e.removeChild(n)}}function ke(e){var t=new Date(e.getFullYear(),0,1),i=new Date(e.getFullYear(),6,1);return e.getTimezoneOffset()<Math.max(t.getTimezoneOffset(),i.getTimezoneOffset())}function Re(e){var t=e.getFullYear(),i=e.getMonth(),n=e.getDate(),r=e.getHours(),a=e.getMinutes(),s=e.getSeconds(),o=e.getMilliseconds();return Date.UTC(t,i,n,r,a,s,o)}function He(){return window.navigator.userAgent.toLowerCase().indexOf("mobi")>-1}function Pe(){return window.navigator.userAgent.toLowerCase().indexOf("ipad")>-1}function je(t,i){if("multiple"===i)t=t.split(" ").map((function(e){return e.charAt(0).toLocaleUpperCase()+e.substring(1)})).join(" ");else if("single"===i){if(t[0]>="0"&&t[0]<="9"){var n=t.match(/[a-zA-Z]/);t=(0,e.isNullOrUndefined)(n)?t:t.slice(0,n.index)+t[n.index].toLocaleUpperCase()+t.slice(n.index+1)}t=t[0].toLocaleUpperCase()+t.slice(1)}return t}function Ne(e,t){return t?e.offsetWidth:e.getBoundingClientRect().width}function Le(e,t){return t?e.offsetHeight:e.getBoundingClientRect().height}function qe(e,t){return t?e.offsetTop:e.getBoundingClientRect().top}var Fe="e-schedule",Ue="e-rtl",Be="e-device",We="e-adaptive",ze="e-multi-drag",Ye="e-icons",_e="e-enable",Ge="e-disable",Xe="e-table-container",Qe="e-schedule-table",Ke="e-all-day-cells",Ze="e-all-day-row",Je="e-content-table",$e="e-work-cells",et="e-work-hours",tt="e-popup-open",it="e-date-header-wrap",nt="e-date-header-container",rt="e-header-cells",at="e-work-days",st="e-other-month",ot="e-current-day",lt="e-current-date",pt="e-current-panel",ct="e-previous-panel",ht="e-next-panel",dt="e-translate",ut="e-left-indent",gt="e-left-indent-wrap",vt="e-event-table",mt="e-resource-group-cells",ft="e-resource-text",yt="e-resource-column-wrap",Tt="e-resource-column-table",wt="e-child-node",Dt="e-parent-node",bt="e-resource-expand",St="e-resource-collapse",Ct="e-resource-tree-icon",Ot="e-resource-cells",Et="e-time-cells-wrap",xt="e-time-cells",Vt="e-time-slots",At="e-alternate-cells",It="e-current-time",Mt="e-current-timeline",kt="e-previous-timeline",Rt="e-hide-childs",Ht="e-scroll-container",Pt="e-timeline-wrapper",jt="e-appointment-wrapper",Nt="e-appointment-wrapper-hidden",Lt="e-day-wrapper",qt="e-schedule-resource-toolbar-container",Ft="e-schedule-toolbar",Ut="e-schedule-resource-toolbar",Bt="e-selected-cell",Wt="e-week-number-wrapper",zt="e-week-number",Yt="e-appointment-wrap",_t="e-wrapper-container",Gt="e-appointment-container",Xt="e-appointment",Qt="e-block-appointment",Kt="e-block-indicator",Zt="e-appointment-border",Jt="e-appointment-details",$t="e-subject-wrap",ei="e-resource-name",ti="e-time",ii="e-table-wrap",ni="e-outer-table",ri="e-content-wrap",ai="e-virtual-track",si="e-agenda-cells",oi="e-current-day",li="e-active-appointment-agenda",pi="e-month-header",ci="e-day-date-header",hi="e-date-column",di="e-navigate",ui="e-date-header",gi="e-day-border",vi="e-date-time",mi="e-no-event",fi="e-appointment-indicator",yi="e-indicator",Ti="e-left-icon",wi="e-right-icon",Di="e-event-action",bi="e-new-event",Si="e-schedule-event-clone",Ci="e-clone-time-indicator",Oi="e-drag-clone",Ei="e-event-resize",xi="e-resize-clone",Vi="e-left-handler",Ai="e-right-handler",Ii="e-top-handler",Mi="e-bottom-handler",ki="e-recurrence-icon",Ri="e-recurrence-edit-icon",Hi="e-header-row",Pi="e-all-day-appointment-wrapper",ji="e-all-day-appointment",Ni="e-appointment-hide",Li="e-row-count-wrapper",qi="e-all-day-appointment-section",Fi="e-appointment-expand",Ui="e-appointment-collapse",Bi="e-more-indicator",Wi="e-cell-popup",zi="e-event-popup",Yi="e-popup-header",_i="e-header-icon-wrapper",Gi="e-popup-footer",Xi="e-date-time-details",Qi="e-event-details",Ki="e-event-create",Zi="e-event-edit",Ji="e-event-delete",$i="e-text-ellipsis",en="e-more-popup-wrapper",tn="e-more-event-popup",nn="e-more-event-date-header",rn="e-header-day",an="e-header-date",sn="e-more-event-close",on="e-more-event-content",ln="e-more-appointment-wrapper",pn="e-quick-dialog-occurrence-event",cn="e-quick-dialog-series-event",hn="e-quick-dialog-following-events",dn="e-following-events-dialog",un="e-quick-dialog-delete",gn="e-quick-dialog-cancel",vn="e-quick-alertok",mn="e-quick-alertcancel",fn="e-quick-alertfollowing",yn="e-quick-dialog-alert-btn",Tn="e-schedule-dialog",wn="e-schedule-form",Dn="e-all-day",bn="e-time-zone",Sn="e-repeat",Cn="e-subject",On="e-location",En="e-location-details",xn="e-start",Vn="e-end",An="e-description",In="e-description-details",Mn="e-time-zone-row",kn="e-start-time-zone",Rn="e-end-time-zone",Hn="e-save-icon",Pn="e-event-cancel",jn="e-event-save",Nn="e-title-text",Ln="e-icon-disable",qn="e-edit",Fn="e-edit-icon",Un="e-delete",Bn="e-delete-icon",Wn="e-close",zn="e-close-icon",Yn="e-schedule-error",_n="e-tooltip-hidden",Gn="e-animate",Xn="e-hidden",Qn="e-disable-dates",Kn="e-quick-popup-wrapper",Zn="e-resource-menu",Jn="e-icon-menu",$n="e-resource-level-title",er="e-resource-tree-popup-overlay",tr="e-resource-tree-popup",ir="e-resource",nr="e-resource-icon",rr="e-resource-details",ar="e-date-time-icon",sr="e-virtual-scroll",or="e-icon-disable",lr="e-auto-height",pr="e-ignore-whitespace",cr="e-read-only",hr="e-month-header-wrapper",dr="e-inline-subject",ur="e-inline-appointment",gr="e-scroll-hidden",vr="e-all-day-scroll",mr="e-all-day-auto",fr=function(){return fr=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},fr.apply(this,arguments)},yr=function(){function r(e){this.parent=e,this.l10n=this.parent.localeObj,this.renderHeader(),this.addEventListener()}return r.prototype.addEventListener=function(){this.parent.on(Z,this.closeHeaderPopup,this)},r.prototype.removeEventListener=function(){this.parent.off(Z,this.closeHeaderPopup)},r.prototype.closeHeaderPopup=function(t){var i=(0,e.closest)(t.event.target,".e-date-range,.e-header-popup,.e-day,.e-selected"),n=(0,e.closest)(t.event.target,".e-hor-nav,.e-toolbar-pop"),r=this.parent.element.querySelector("."+ri);if(this.parent.isAdaptive)if((0,e.isNullOrUndefined)(n)||!n.classList.contains("e-toolbar-pop")&&!n.classList.contains("e-hor-nav")||n.classList.contains("e-hor-nav")&&this.element.querySelector(".e-toolbar-pop").classList.contains(tt)){(0,e.removeClass)([r],gr);var a=this.element.querySelector(".e-toolbar-pop");if(!(0,e.isNullOrUndefined)(a)){var s=a.ej2_instances[0];!s||!(0,e.isNullOrUndefined)(n)&&n.classList.contains("e-hor-nav")&&a.classList.contains(tt)||s.hide()}}else(0,e.addClass)([r],gr);(0,e.isNullOrUndefined)(i)&&this.hideHeaderPopup()},r.prototype.hideHeaderPopup=function(){this.headerPopup&&this.headerPopup.hide()},r.prototype.renderHeader=function(){this.element=(0,e.createElement)("div",{className:"e-schedule-toolbar-container"});var t=(0,e.createElement)("div",{className:Ft});this.element.appendChild(t),this.parent.element.insertBefore(this.element,this.parent.element.firstElementChild),this.renderToolbar()},r.prototype.renderToolbar=function(){var e=this,t=this.parent.toolbarItems&&this.parent.toolbarItems.length>0?this.getToolbarItems():this.getItems();this.parent.trigger(p,{requestType:"toolbarItemRendering",items:t},(function(t){e.toolbarObj=new i.Toolbar({items:t.items,overflowMode:"Popup",clicked:e.toolbarClickHandler.bind(e),created:e.toolbarCreateHandler.bind(e),enableRtl:e.parent.enableRtl,enableHtmlSanitizer:e.parent.enableHtmlSanitizer,locale:e.parent.locale}),e.toolbarObj.isStringTemplate=!0,e.toolbarObj.root=e.parent.root?e.parent.root:e.parent,e.toolbarObj.appendTo(e.parent.element.querySelector("."+Ft)),e.toolbarObj.element.setAttribute("aria-label","Scheduler");var n=e.toolbarObj.element.querySelector(".e-prev");n&&n.firstElementChild.setAttribute("title",e.l10n.getConstant("previous"));var r=e.toolbarObj.element.querySelector(".e-next");r&&r.firstElementChild.setAttribute("title",e.l10n.getConstant("next")),e.updateAddIcon(),e.updateActiveView(),e.parent.trigger(c,{requestType:"toolBarItemRendered",items:e.toolbarObj.items})}))},r.prototype.updateItems=function(){var e=this;if(this.toolbarObj){var t=this.getItems();this.parent.trigger(p,{requestType:"toolbarItemRendering",items:t},(function(t){e.toolbarObj.items=t.items,e.toolbarObj.dataBind(),e.parent.trigger(c,{requestType:"toolBarItemRendered",items:e.toolbarObj.items})}))}},r.prototype.getPopUpRelativeElement=function(){return this.parent.isAdaptive?this.toolbarObj.element:this.element.querySelector(".e-date-range")},r.prototype.setDayOfWeek=function(e){this.headerCalendar&&(this.headerCalendar.firstDayOfWeek=e,this.headerCalendar.dataBind())},r.prototype.setCalendarDate=function(e){this.headerCalendar&&(this.headerCalendar.value=e,this.headerCalendar.dataBind())},r.prototype.setCalendarMinMaxDate=function(){this.headerCalendar&&(this.headerCalendar.min=this.parent.minDate,this.headerCalendar.max=this.parent.maxDate,this.headerCalendar.dataBind())},r.prototype.getCalendarView=function(){return["Month","MonthAgenda","TimelineMonth"].indexOf(this.parent.currentView)>-1?"Year":["Year","TimelineYear"].indexOf(this.parent.currentView)>-1?"Decade":"Month"},r.prototype.setCalendarView=function(){if(this.headerCalendar){var e=this.getCalendarView();this.headerCalendar.depth=e,this.headerCalendar.start=e,this.headerCalendar.refresh()}},r.prototype.updateActiveView=function(){var t=[].slice.call(this.toolbarObj.element.querySelectorAll(".e-views"));(0,e.removeClass)(t,["e-active-view"]),t.length>0&&t[this.parent.viewIndex]&&(0,e.addClass)([t[this.parent.viewIndex]],["e-active-view"])},r.prototype.updateDateRange=function(t){var i=this.toolbarObj.element.querySelector(".e-date-range");if(i){i.firstElementChild.setAttribute("aria-haspopup","true");var n=i.querySelector(".e-tbar-btn-text");if(this.parent.activeViewOptions.dateRangeTemplate){n.textContent="";var r={startDate:this.parent.activeView.getStartDate(),endDate:this.parent.activeView.getEndDate(),currentView:this.parent.currentView},a=this.parent.activeViewOptions.dateRangeTemplateName,s=this.parent.element.id+"_"+a+"dateRangeTemplate",o=[].slice.call(this.parent.getDateRangeTemplate()(r,this.parent,"dateRangeTemplate",s,!1,void 0,void 0,this.parent.root));(0,e.append)(o,n)}else{var l=this.parent.activeView.getDateRangeText(t);i.firstElementChild.setAttribute("aria-label",l),n.textContent=l}this.refresh()}},r.prototype.refresh=function(){this.toolbarObj&&this.toolbarObj.refreshOverflow()},r.prototype.updateAddIcon=function(){var t=this.toolbarObj.element.querySelector(".e-add");t&&(this.parent.eventSettings.allowAdding?(0,e.removeClass)([t],Xn):(0,e.addClass)([t],Xn))},r.prototype.getDateRangeText=function(){return je(this.parent.globalize.formatDate(this.parent.selectedDate,{format:"MMMM y",calendar:this.parent.getCalendarMode()}),"single")},r.prototype.getItemModel=function(e){var t={};return e.id&&(t.id=e.id),e.text&&(t.text=e.text),e.tooltipText&&(t.tooltipText=e.tooltipText),e.prefixIcon&&(t.prefixIcon=e.prefixIcon),e.cssClass&&(t.cssClass=e.cssClass),"Both"!==e.showTextOn&&(t.showTextOn=e.showTextOn),e.template&&(t.template=e.template),e.disabled&&(t.disabled=e.disabled),"auto"!==e.width&&(t.width=e.width),e.suffixIcon&&(t.suffixIcon=e.suffixIcon),"Left"!==e.align&&(t.align=e.align),"None"!==e.overflow&&(t.overflow=e.overflow),e.htmlAttributes&&(t.htmlAttributes=e.htmlAttributes),"Button"!==e.type&&(t.type=e.type),!0!==e.visible&&(t.visible=e.visible),e.showAlwaysInPopup&&(t.showAlwaysInPopup=e.showAlwaysInPopup),-1!==e.tabIndex&&(t.tabIndex=e.tabIndex),t},r.prototype.getToolbarItems=function(){for(var t,i=[],n=0,r=this.parent.toolbarItems;n<r.length;n++){var a=r[n];t=this.getItemModel(a);var s=void 0;if(a.name)switch(a.name){case"Today":(s={showAlwaysInPopup:this.parent.isAdaptive||this.parent.enableAdaptiveUI,prefixIcon:"e-icon-today",text:this.l10n.getConstant("today"),cssClass:"e-today",overflow:"Show"}).align=t.align?t.align:a.align,i.push(fr({},s,t));break;case"Previous":(s={prefixIcon:"e-icon-prev",tooltipText:"Previous",overflow:"Show",cssClass:"e-prev",htmlAttributes:{role:"navigation"}}).align=t.align?t.align:a.align,i.push(fr({},s,t));break;case"Next":(s={prefixIcon:"e-icon-next",tooltipText:"Next",overflow:"Show",cssClass:"e-next",htmlAttributes:{role:"navigation"}}).align=t.align?t.align:a.align,i.push(fr({},s,t));break;case"DateRangeText":(s={text:this.getDateRangeText(),suffixIcon:"e-icon-down-arrow",cssClass:"e-date-range",overflow:"Show",htmlAttributes:{"aria-atomic":"true","aria-live":"assertive",role:"navigation"}}).align=t.align?t.align:a.align,i.push(fr({},s,t));break;case"NewEvent":(s={showAlwaysInPopup:this.parent.isAdaptive||this.parent.enableAdaptiveUI,prefixIcon:"e-icon-add",text:this.l10n.getConstant("newEvent"),cssClass:"e-add",overflow:"Show"}).align=t.align?t.align:a.align,i.push(fr({},s,t));break;case"Views":if(!(0,e.isNullOrUndefined)(this.parent.views)&&this.parent.views.length>1)for(var o=0,l=this.parent.views;o<l.length;o++){var p=l[o];(s=this.getItemObject(p)).align=t.align?t.align:a.align,i.push(fr({},s,t))}break;case"Custom":i.push(a)}else i.push(a)}return i},r.prototype.getItems=function(){var t=[];if(t.push({align:"Left",prefixIcon:"e-icon-prev",tooltipText:"Previous",overflow:"Show",cssClass:"e-prev"}),t.push({align:"Left",prefixIcon:"e-icon-next",tooltipText:"Next",overflow:"Show",cssClass:"e-next"}),t.push({align:"Left",text:this.getDateRangeText(),suffixIcon:"e-icon-down-arrow",cssClass:"e-date-range",overflow:"Show",htmlAttributes:{"aria-atomic":"true","aria-live":"assertive"}}),this.parent.isAdaptive||this.parent.enableAdaptiveUI?(t.push({align:"Right",showAlwaysInPopup:this.parent.isAdaptive||this.parent.enableAdaptiveUI,prefixIcon:"e-icon-add",text:this.l10n.getConstant("newEvent"),cssClass:"e-add",overflow:"Show"}),t.push({align:"Right",showAlwaysInPopup:this.parent.isAdaptive||this.parent.enableAdaptiveUI,prefixIcon:"e-icon-today",text:this.l10n.getConstant("today"),cssClass:"e-today",overflow:"Show"})):(t.push({align:"Right",showAlwaysInPopup:this.parent.isAdaptive||this.parent.enableAdaptiveUI,prefixIcon:"e-icon-today",text:this.l10n.getConstant("today"),cssClass:"e-today",overflow:"Show"}),!(0,e.isNullOrUndefined)(this.parent.views)&&this.parent.views.length>1&&t.push({align:"Right",type:"Separator",cssClass:"e-schedule-seperator"})),!(0,e.isNullOrUndefined)(this.parent.views)&&this.parent.views.length>1)for(var i=0,n=this.parent.views;i<n.length;i++){var r=n[i];t.push(this.getItemObject(r))}return t},r.prototype.getItemObject=function(e){var t,i,n;"string"==typeof e?(t=e.toLowerCase(),i=null):(t=e.option.toLowerCase(),i=e.displayName);var r=this.parent.isAdaptive||this.parent.enableAdaptiveUI;switch(t){case"day":n={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-day",text:i||this.l10n.getConstant("day"),cssClass:"e-views e-day"};break;case"week":n={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-week",text:i||this.l10n.getConstant("week"),cssClass:"e-views e-week"};break;case"workweek":n={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-workweek",text:i||this.l10n.getConstant("workWeek"),cssClass:"e-views e-work-week"};break;case"month":n={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-month",text:i||this.l10n.getConstant("month"),cssClass:"e-views e-month"};break;case"year":n={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-year",text:i||this.l10n.getConstant("year"),cssClass:"e-views e-year"};break;case"agenda":n={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-agenda",text:i||this.l10n.getConstant("agenda"),cssClass:"e-views e-agenda"};break;case"monthagenda":n={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-month-agenda",text:i||this.l10n.getConstant("monthAgenda"),cssClass:"e-views e-month-agenda"};break;case"timelineday":n={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-timeline-day",text:i||this.l10n.getConstant("timelineDay"),cssClass:"e-views e-timeline-day"};break;case"timelineweek":n={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-timeline-week",text:i||this.l10n.getConstant("timelineWeek"),cssClass:"e-views e-timeline-week"};break;case"timelineworkweek":n={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-timeline-workweek",text:i||this.l10n.getConstant("timelineWorkWeek"),cssClass:"e-views e-timeline-work-week"};break;case"timelinemonth":n={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-timeline-month",text:i||this.l10n.getConstant("timelineMonth"),cssClass:"e-views e-timeline-month"};break;case"timelineyear":n={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-timeline-year-"+("Vertical"===e.orientation?"vertical":"horizontal"),text:i||this.l10n.getConstant("timelineYear"),cssClass:"e-views e-timeline-year"}}return n},r.prototype.renderHeaderPopup=function(){var i=(0,e.createElement)("div",{className:"e-header-popup"}),r=(0,e.createElement)("div",{className:"e-header-calendar"});i.appendChild(r),this.element.appendChild(i),this.headerPopup=new t.Popup(i,{actionOnScroll:"hide",targetType:"relative",relateTo:this.getPopUpRelativeElement(),position:{X:"left",Y:"bottom"},collision:{X:"fit"},viewPortElement:this.element,enableRtl:this.parent.enableRtl});var a=this.getCalendarView(),s="Month"===this.parent.currentView&&!(0,e.isNullOrUndefined)(this.parent.activeViewOptions.displayDate)&&!this.hasSelectedDate();this.headerCalendar=new n.Calendar({value:s?this.parent.activeViewOptions.displayDate:this.parent.selectedDate,min:this.parent.minDate,max:this.parent.maxDate,firstDayOfWeek:this.parent.activeViewOptions.firstDayOfWeek,weekNumber:this.parent.activeViewOptions.showWeekNumber,enableRtl:this.parent.enableRtl,locale:this.parent.locale,depth:a,start:a,calendarMode:this.parent.calendarMode,change:this.calendarChange.bind(this)}),this.setCalendarTimezone(),this.headerCalendar.appendTo(r),this.headerPopup.hide()},r.prototype.calendarChange=function(e){if(e.value.getTime()!==this.parent.selectedDate.getTime()){var t=ve(new Date(e.value));this.parent.changeDate(t)}this.headerPopup.hide()},r.prototype.setCalendarTimezone=function(){this.headerCalendar&&(this.headerCalendar.timezone=this.parent.timezone||this.parent.tzModule.getLocalTimezoneName())},r.prototype.calculateViewIndex=function(t){var i=(0,e.closest)(t.originalEvent.target,".e-views");return[].slice.call(this.element.querySelectorAll(".e-views")).indexOf(i)},r.prototype.toolbarCreateHandler=function(){this.parent&&this.parent.portals&&this.toolbarObj&&this.toolbarObj.portals&&(this.parent.portals=this.parent.portals.concat(this.toolbarObj.portals),this.parent.renderReactTemplates())},r.prototype.toolbarClickHandler=function(t){if(t.item){var i,n,r;switch(t.item.cssClass.replace("e-views ","")){case"e-date-range":this.headerPopup||this.renderHeaderPopup(),this.headerPopup.element.classList.contains(tt)?this.headerPopup.hide():this.headerPopup.show();break;case"e-day":this.parent.changeView("Day",t.originalEvent,void 0,this.calculateViewIndex(t));break;case"e-week":this.parent.changeView("Week",t.originalEvent,void 0,this.calculateViewIndex(t));break;case"e-work-week":this.parent.changeView("WorkWeek",t.originalEvent,void 0,this.calculateViewIndex(t));break;case"e-month":this.parent.changeView("Month",t.originalEvent,void 0,this.calculateViewIndex(t));break;case"e-year":this.parent.changeView("Year",t.originalEvent,void 0,this.calculateViewIndex(t));break;case"e-agenda":this.parent.changeView("Agenda",t.originalEvent,void 0,this.calculateViewIndex(t));break;case"e-month-agenda":this.parent.changeView("MonthAgenda",t.originalEvent,void 0,this.calculateViewIndex(t));break;case"e-timeline-day":this.parent.changeView("TimelineDay",t.originalEvent,void 0,this.calculateViewIndex(t));break;case"e-timeline-week":this.parent.changeView("TimelineWeek",t.originalEvent,void 0,this.calculateViewIndex(t));break;case"e-timeline-work-week":this.parent.changeView("TimelineWorkWeek",t.originalEvent,void 0,this.calculateViewIndex(t));break;case"e-timeline-month":this.parent.changeView("TimelineMonth",t.originalEvent,void 0,this.calculateViewIndex(t));break;case"e-timeline-year":this.parent.changeView("TimelineYear",t.originalEvent,void 0,this.calculateViewIndex(t));break;case"e-today":r=ve(this.parent.getCurrentTime()),("Agenda"===this.parent.currentView||"MonthAgenda"===this.parent.currentView||!this.parent.isSelectedDate(r)||"Month"===this.parent.currentView&&this.parent.activeViewOptions.displayDate&&!this.hasSelectedDate()&&ve(this.parent.activeViewOptions.displayDate)!==r||"Month"===this.parent.currentView&&this.parent.activeViewOptions.numberOfWeeks>0&&!this.hasSelectedDate()&&ve(ce(this.parent.selectedDate))!==r)&&this.parent.changeDate(r,t.originalEvent);break;case"e-prev":this.parent.changeDate(this.parent.activeView.getNextPreviousDate("Previous"),t.originalEvent);break;case"e-next":this.parent.changeDate(this.parent.activeView.getNextPreviousDate("Next"),t.originalEvent);break;case"e-add":if(n=this.parent.activeCellsData.startTime.getTime()===this.parent.activeCellsData.endTime.getTime(),this.parent.activeCellsData&&!n)i=this.parent.activeCellsData;else{var a=this.parent.activeViewOptions.timeScale.interval,s=this.parent.activeViewOptions.timeScale.slotCount,o=a*ne/s,l=new Date(this.parent.selectedDate.getTime()),p=this.parent.getCurrentTime();l.setHours(p.getHours(),Math.round(l.getMinutes()/o)*o,0);var c=new Date(new Date(l.getTime()).setMilliseconds(l.getMilliseconds()+o));i={startTime:l,endTime:c,isAllDay:!1}}this.parent.eventWindow.openEditor((0,e.extend)(i,{cancel:!1,event:t.originalEvent}),"Add")}if(!(0,e.isNullOrUndefined)(this.toolbarObj)){var h=this.toolbarObj.element.querySelector(".e-toolbar-pop");h&&"Input"!==t.item.type&&h.ej2_instances[0].hide({name:"SlideUp",duration:100})}}},r.prototype.hasSelectedDate=function(){var e=ve(this.parent.selectedDate).getTime();return e>=this.parent.activeView.getStartDate().getTime()&&e<=this.parent.activeView.getEndDate().getTime()},r.prototype.getHeaderElement=function(){return this.toolbarObj.element},r.prototype.updateHeaderItems=function(t){var i=this.toolbarObj.element.querySelector(".e-prev"),n=this.toolbarObj.element.querySelector(".e-next"),r=this.toolbarObj.element.querySelector(".e-date-range");i&&("add"===t?(0,e.addClass)([i],Xn):(0,e.removeClass)([i],Xn)),n&&("add"===t?(0,e.addClass)([n],Xn):(0,e.removeClass)([n],Xn)),r&&("add"===t?(0,e.addClass)([r],$i):(0,e.removeClass)([r],$i))},r.prototype.previousNextIconHandler=function(){var t="Agenda"===this.parent.currentView?[this.parent.getCurrentViewDates()[0]]:this.parent.getCurrentViewDates(),i=this.toolbarObj.element.querySelector(".e-prev"),n=this.toolbarObj.element.querySelector(".e-next"),r=new Date(t[0].getTime()),a=new Date(t[t.length-1].getTime());if("WorkWeek"===this.parent.currentView||"TimelineWorkWeek"===this.parent.currentView)a=ye(r=le(ve(this.parent.selectedDate),this.parent.activeViewOptions.firstDayOfWeek),7*this.parent.activeViewOptions.interval);else if("Month"===this.parent.currentView){var s=!(0,e.isNullOrUndefined)(this.parent.activeViewOptions.displayDate)||this.parent.activeViewOptions.numberOfWeeks>0;r=s?this.parent.activeView.getStartDate():ce(this.parent.selectedDate),a=s?this.parent.activeView.getEndDate():he(Te(r,this.parent.activeViewOptions.interval-1))}(0,e.isNullOrUndefined)(i)||this.toolbarObj.enableItems(i,r>ve(this.parent.minDate)),(0,e.isNullOrUndefined)(n)||this.toolbarObj.enableItems(n,a<ve(this.parent.maxDate)),this.setCalendarMinMaxDate()},r.prototype.getModuleName=function(){return"headerbar"},r.prototype.destroy=function(){this.headerPopup&&!this.headerPopup.isDestroyed&&(this.headerPopup.destroy(),this.headerPopup=null),this.headerCalendar&&!this.headerCalendar.isDestroyed&&(this.headerCalendar.destroy(),this.headerCalendar=null),this.toolbarObj&&!this.toolbarObj.isDestroyed&&(this.toolbarObj.destroy(),this.removeEventListener(),(0,e.remove)(this.element),this.toolbarObj=null),this.element=null,this.parent=null,this.l10n=null},r}(),Tr=function(){function t(e){this.parent=e,this.addEventListener()}return t.prototype.getModuleName=function(){return"scroll"},t.prototype.setWidth=function(){this.parent.element.style.width=(0,e.formatUnit)(this.parent.width)},t.prototype.setHeight=function(){this.parent.element.style.height=(0,e.formatUnit)(this.parent.height)},t.prototype.addEventListener=function(){this.parent.on(_,this.setDimensions,this),this.parent.on(K,this.onPropertyChanged,this)},t.prototype.removeEventListener=function(){this.parent.off(_,this.setDimensions),this.parent.off(K,this.onPropertyChanged)},t.prototype.setDimensions=function(){this.setWidth(),this.setHeight();var e={cssProperties:this.parent.getCssProperties(),module:this.getModuleName()};this.parent.notify(Q,e)},t.prototype.onPropertyChanged=function(){this.setDimensions()},t.prototype.destroy=function(){this.removeEventListener()},t}(),wr=function(){function t(t){this.parent=t,this.element=this.parent.element.querySelector("."+Xe),this.touchObj=new e.Touch(this.element,{scroll:this.scrollHandler.bind(this),swipe:this.swipeHandler.bind(this),tapHold:this.tapHoldHandler.bind(this),swipeSettings:{swipeThresholdDistance:1}}),e.EventHandler.add(this.element,"transitionend",this.onTransitionEnd,this),this.touchLeftDirection=this.parent.enableRtl?"Right":"Left",this.touchRightDirection=this.parent.enableRtl?"Left":"Right"}return t.prototype.scrollHandler=function(t){(0,e.isNullOrUndefined)(this.parent.eventTooltip)||this.parent.eventTooltip.close();var i=!this.parent.isAdaptive&&t.originalEvent&&t.originalEvent.target&&!(0,e.isNullOrUndefined)((0,e.closest)(t.originalEvent.target,"."+Xt));if(this.parent.uiStateValues.isTouchScroll=i&&"touchmove"===t.originalEvent.type&&!this.parent.uiStateValues.action,!i&&"Agenda"!==this.parent.currentView&&!this.parent.uiStateValues.action&&this.parent.allowSwiping&&!this.parent.uiStateValues.isTapHold){if(this.parent.uiStateValues.isSwipeScroll=!0,this.timeStampStart||(this.timeStampStart=Date.now()),this.element.classList.contains(dt)&&this.onTransitionEnd(),"Left"===t.scrollDirection||"Right"===t.scrollDirection){var n={requestType:"dateNavigate",cancel:!1,event:t.originalEvent};if(this.parent.trigger(p,n),n.cancel)return;var r=this.element.querySelector("."+ri);if(r&&r.scrollWidth>r.clientWidth)return;this.isScrollTriggered=!0,t.originalEvent.preventDefault(),t.originalEvent.stopPropagation()}if(t.scrollDirection===this.touchLeftDirection){this.nextPanel||(this.renderPanel(ht,"Next"),this.nextPanel={element:this.parent.activeView.getPanel(),selectedDate:new Date(this.parent.selectedDate.getTime()),renderDates:this.parent.activeView.renderDates,colLevels:this.parent.activeView.colLevels},this.setDimensions(this.nextPanel.element));var a=this.parent.enableRtl?t.distanceX:-t.distanceX;this.element.style.transform="translatex("+(this.getTranslateX(this.element)+a)+"px)"}else if(t.scrollDirection===this.touchRightDirection){var s=0;this.previousPanel||(this.renderPanel(ct,"Previous"),this.previousPanel={element:this.parent.activeView.getPanel(),selectedDate:new Date(this.parent.selectedDate.getTime()),renderDates:this.parent.activeView.renderDates,colLevels:this.parent.activeView.colLevels},this.setDimensions(this.previousPanel.element),s=this.previousPanel.element.offsetWidth);a=this.parent.enableRtl?s-t.distanceX:-s+t.distanceX;this.element.style.transform="translatex("+(this.getTranslateX(this.element)+a)+"px)"}}},t.prototype.swipeHandler=function(t){if(this.isScrollTriggered&&!this.parent.uiStateValues.action&&this.parent.allowSwiping&&!this.parent.uiStateValues.isTapHold){this.isScrollTriggered=!1;var i="Left"===t.swipeDirection?this.parent.activeView.renderDates[0]:this.parent.activeView.renderDates.slice(-1)[0];if("Left"===t.swipeDirection&&i<this.parent.maxDate||"Right"===t.swipeDirection&&i>=this.parent.minDate){var n=Date.now()-this.timeStampStart,r=t.distanceX*(e.Browser.isDevice?6:1.66);r>n||t.distanceX>this.parent.element.offsetWidth/2?(this.swapPanels(t.swipeDirection),r>n&&t.distanceX>this.parent.element.offsetWidth/2&&(this.element.style.transitionDuration=(e.Browser.isDevice?t.distanceX:r)/n/10+"s"),this.confirmSwipe(t.swipeDirection)):this.cancelSwipe();var a={requestType:"dateNavigate",cancel:!1,event:t.originalEvent};this.parent.trigger(c,a)}else this.cancelSwipe();this.timeStampStart=null}},t.prototype.tapHoldHandler=function(t){var i=(0,e.closest)(t.originalEvent.target,"."+Xt);(0,e.isNullOrUndefined)(i)||(this.parent.uiStateValues.isTapHold=!0,this.parent.isAdaptive?(e.Browser.isIos&&e.EventHandler.add(this.element,"touchend",this.preventEventClick,this),this.parent.quickPopup.tapHoldEventPopup(t.originalEvent),this.triggerResizeStart(t.originalEvent)):["Agenda","MonthAgenda","Year"].indexOf(this.parent.currentView)<0&&(this.parent.selectedElements=[],this.parent.eventBase.getSelectedEventElements(i),this.triggerResizeStart(t.originalEvent)))},t.prototype.triggerResizeStart=function(t){this.parent.resizeModule&&(0,e.closest)(t.target,"."+Ei)&&this.parent.resizeModule.resizeStart(t)},t.prototype.preventEventClick=function(t){t.preventDefault(),e.EventHandler.remove(this.element,"touchend",this.preventEventClick)},t.prototype.renderPanel=function(e,t){this.currentPanel?this.parent.setProperties({selectedDate:this.currentPanel.selectedDate},!0):(this.currentPanel={element:this.parent.activeView.getPanel(),selectedDate:new Date(this.parent.selectedDate.getTime()),renderDates:this.parent.activeView.renderDates,colLevels:this.parent.activeView.colLevels},this.setDimensions(this.currentPanel.element)),this.parent.setProperties({selectedDate:this.parent.activeView.getNextPreviousDate(t)},!0),this.parent.headerModule&&this.parent.headerModule.setCalendarDate(this.parent.selectedDate),this.parent.activeView.getRenderDates(),this.parent.activeView.renderLayout(e)},t.prototype.swapPanels=function(e){if(e===this.touchLeftDirection){var t=this.nextPanel;this.nextPanel=this.currentPanel,this.currentPanel=t}else{t=this.previousPanel;this.previousPanel=this.currentPanel,this.currentPanel=t}},t.prototype.confirmSwipe=function(t){var i=this,n={action:"date",cancel:!1,previousDate:t===this.touchLeftDirection?this.nextPanel.selectedDate:this.previousPanel.selectedDate,currentDate:this.currentPanel.selectedDate};this.parent.trigger(g,n,(function(n){if(n.cancel)i.swapPanels(t),i.cancelSwipe();else{i.parent.activeView.setPanel(i.currentPanel.element),i.parent.setProperties({selectedDate:i.currentPanel.selectedDate},!0);var r=void 0;r=i.parent.enableRtl?t===i.touchLeftDirection?i.previousPanel?i.previousPanel.element.offsetLeft:i.currentPanel.element.offsetWidth:0:t===i.touchLeftDirection?-i.currentPanel.element.offsetLeft:0,i.parent.activeView.renderDates=i.currentPanel.renderDates,i.parent.activeView.colLevels=i.currentPanel.colLevels,(0,e.addClass)([i.element],dt),i.element.style.transform="translatex("+r+"px)",i.parent.headerModule&&i.parent.headerModule.updateDateRange(),i.parent.renderTemplates(),i.parent.crudModule.refreshDataManager()}}))},t.prototype.cancelSwipe=function(){this.parent.activeView.setPanel(this.currentPanel.element),this.parent.setProperties({selectedDate:this.currentPanel.selectedDate},!0),this.parent.activeView.renderDates=this.currentPanel.renderDates,this.parent.activeView.colLevels=this.currentPanel.colLevels,(0,e.addClass)([this.element],dt);var t=this.previousPanel?this.previousPanel.element.offsetWidth:0;this.element.style.transform="translatex("+(this.parent.enableRtl?t:-this.currentPanel.element.offsetLeft)+"px)"},t.prototype.onTransitionEnd=function(){((0,e.isNullOrUndefined)(this.element)||this.element.classList.contains(dt))&&(this.parent.uiStateValues.isSwipeScroll=!1,(0,e.removeClass)([this.element],dt),this.element.style.transitionDuration="",this.element.style.transform="",this.previousPanel&&((0,e.remove)(this.previousPanel.element),this.previousPanel=null,(0,e.removeClass)([this.currentPanel.element],ct),(0,e.addClass)([this.currentPanel.element],pt)),this.nextPanel&&((0,e.remove)(this.nextPanel.element),this.nextPanel=null,(0,e.removeClass)([this.currentPanel.element],ht),(0,e.addClass)([this.currentPanel.element],pt)),this.currentPanel=null,this.parent.activeView.getPanel().style.width="")},t.prototype.getTranslateX=function(e){var t=window.getComputedStyle(e);return new WebKitCSSMatrix(t.webkitTransform).m41},t.prototype.setDimensions=function(e){e.style.width=this.parent.element.clientWidth+"px"},t.prototype.resetValues=function(){this.currentPanel=null,this.previousPanel=null,this.nextPanel=null,this.timeStampStart=null,this.element.style.transform="",this.element.style.transitionDuration="",Me(this.element),(0,e.removeClass)([this.element],dt)},t.prototype.destroy=function(){this.touchObj&&(this.touchObj.destroy(),this.touchObj=null),e.EventHandler.remove(this.element,"transitionend",this.onTransitionEnd),this.resetValues()},t}(),Dr=function(){return Dr=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},Dr.apply(this,arguments)},br=function(){function t(t){this.selectedCells=[],this.isCutContentPasted=!1,this.isCutAction=!1,this.keyConfigs={downArrow:"downarrow",upArrow:"uparrow",rightArrow:"rightarrow",leftArrow:"leftarrow",shiftDownArrow:"shift+downarrow",shiftUpArrow:"shift+uparrow",shiftRightArrow:"shift+rightarrow",shiftLeftArrow:"shift+leftarrow",ctrlLeftArrow:"ctrl+leftarrow",ctrlRightArrow:"ctrl+rightarrow",altOne:"alt+1",altTwo:"alt+2",altThree:"alt+3",altFour:"alt+4",altFive:"alt+5",altSix:"alt+6",altSeven:"alt+7",altEight:"alt+8",altNine:"alt+9",enter:"enter",escape:"escape",delete:"delete",backspace:"backspace",home:"home",pageUp:"pageup",pageDown:"pagedown",tab:"tab",shiftTab:"shift+tab",ctrlShiftUpArrow:"ctrl+shift+uparrow",ctrlShiftDownArrow:"ctrl+shift+downarrow",ctrlShiftLeftArrow:"ctrl+shift+leftarrow",ctrlShiftRightArrow:"ctrl+shift+rightarrow",shiftAltY:"shift+alt+y",shiftAltN:"shift+alt+n",cut:"ctrl+x",copy:"ctrl+c",cmdCut:"cmd+x",cmdCopy:"cmd+c"},this.parent=t,this.parent.element.tabIndex=-1===this.parent.element.tabIndex?0:this.parent.element.tabIndex,this.keyboardModule=new e.KeyboardEvents(this.parent.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}),this.addEventListener(),this.createClipboardElement()}return t.prototype.keyActionHandler=function(e){switch(e.action){case"downArrow":case"shiftDownArrow":this.processDown(e,e.shiftKey);break;case"upArrow":case"shiftUpArrow":this.processUp(e,e.shiftKey);break;case"leftArrow":case"shiftLeftArrow":this.processLeft(e,e.shiftKey);break;case"rightArrow":case"shiftRightArrow":this.processRight(e,e.shiftKey);break;case"ctrlLeftArrow":this.parent.changeDate(this.parent.activeView.getNextPreviousDate("Previous"),e),this.parent.headerModule&&this.parent.headerModule.element.querySelector(".e-prev button").focus();break;case"ctrlRightArrow":this.parent.changeDate(this.parent.activeView.getNextPreviousDate("Next"),e),this.parent.headerModule&&this.parent.headerModule.element.querySelector(".e-next button").focus();break;case"altOne":case"altTwo":case"altThree":case"altFour":case"altFive":case"altSix":case"altSeven":case"altEight":case"altNine":this.processViewNavigation(e);break;case"enter":this.processEnter(e);break;case"home":this.focusFirstCell();break;case"tab":case"shiftTab":this.processTab(e,e.shiftKey);break;case"delete":case"backspace":this.processDelete(e);break;case"ctrlShiftUpArrow":case"ctrlShiftDownArrow":case"ctrlShiftLeftArrow":case"ctrlShiftRightArrow":this.processCtrlShiftNavigationArrows(e);break;case"escape":this.processEscape(e);break;case"fTwelve":this.parent.allowInline&&this.parent.inlineModule&&(e.preventDefault(),this.processFTwelve(e));break;case"shiftAltY":this.parent.changeDate(new Date,e);break;case"shiftAltN":if("Agenda"===this.parent.currentView||"MonthAgenda"===this.parent.currentView||"Year"===this.parent.currentView)return;this.processShiftAltN(e);break;case"cut":case"cmdCut":this.processClipboardAction(!0,void 0,e);break;case"copy":case"cmdCopy":this.processClipboardAction(!1,void 0,e)}},t.prototype.processShiftAltN=function(t){var i=this.parent.getSelectedCells(),n=t.target,r=(0,e.extend)({},null,!0);if(i.length>0&&((0,e.closest)(n,"."+$e)||(0,e.closest)(n,"."+Ke)||(0,e.closest)(n,"."+rt)))r=this.getSelectedElements(n);else if((0,e.closest)(n,"."+Xt)&&!(0,e.isNullOrUndefined)(this.parent.activeEventData.event)){var a=this.parent.activeEventData.event;r.startTime=a.StartTime,r.endTime=a.EndTime,r.isAllDay=a.IsAllDay}else{var s=this.parent.getStartEndTime(this.parent.workHours.start),o=this.parent.activeViewOptions.timeScale.interval/this.parent.activeViewOptions.timeScale.slotCount;r.startTime=new Date(this.parent.selectedDate),r.startTime.setHours(s.getHours(),s.getMinutes(),0,0),r.endTime=new Date(r.startTime.getTime()+6e4*o)}var l=(0,e.extend)(r,{cancel:!1,event:t});null!=l&&this.parent.eventWindow.openEditor(l,"Add")},t.prototype.processFTwelve=function(t){var i=t.target;if(i.classList.contains($e)||i.classList.contains(Ke)){this.parent.activeCellsData=this.getSelectedElements(i);var n=(0,e.extend)(this.parent.activeCellsData,{cancel:!1,event:t}),r={element:n.element,groupIndex:n.groupIndex,type:"Cell"};this.parent.notify(A,r)}i.classList.contains(Xt)&&i.click()},t.prototype.addEventListener=function(){this.parent.on($,this.onCellMouseDown,this),this.parent.allowClipboard&&this.parent.on(J,this.pasteHandler,this)},t.prototype.removeEventListener=function(){this.parent.off($,this.onCellMouseDown),this.parent.off(J,this.pasteHandler)},t.prototype.onCellMouseDown=function(t){if(!t.event.shiftKey&&(this.initialTarget=this.getClosestCell(t.event),!this.parent.activeViewOptions.readonly&&"MonthAgenda"!==this.parent.currentView&&this.initialTarget&&(t.event.target.classList.contains($e)&&3!==t.event.which&&(this.parent.removeSelectedClass(),e.EventHandler.add(this.parent.getContentTable(),"mousemove",this.onMouseSelection,this),e.EventHandler.add(this.parent.getContentTable(),"mouseup mouseleave",this.onMoveUp,this)),t.event.target.classList.contains(Ke)&&3!==t.event.which))){this.parent.removeSelectedClass();var i=this.parent.getAllDayRow();e.EventHandler.add(i,"mousemove",this.onMouseSelection,this),e.EventHandler.add(i,"mouseup mouseleave",this.onMoveUp,this)}},t.prototype.onMouseSelection=function(t){var i=[].slice.call(this.parent.element.querySelectorAll("."+Xt));(0,e.addClass)(i,"e-allow-select");var n=this.parent.boundaryValidation(t.pageY,t.pageX);if(n.bottom||n.top||n.left||n.right){var r=this.parent.element.querySelector("."+ri),a=r.offsetHeight<=r.scrollHeight&&r.scrollTop>=0&&r.scrollTop+r.offsetHeight<=r.scrollHeight,s=r.offsetWidth<=r.scrollWidth&&r.scrollLeft>=0&&r.scrollLeft+r.offsetWidth<=r.scrollWidth;a&&(n.top||n.bottom)&&(r.scrollTop+=n.top?-t.target.offsetHeight:t.target.offsetHeight),s&&(n.left||n.right)&&(r.scrollLeft+=n.left?-t.target.offsetWidth:t.target.offsetWidth)}var o=this.getClosestCell(t);o&&this.selectCells(!0,o)},t.prototype.getClosestCell=function(t){return(0,e.closest)(t.target,"."+$e+",."+Ke)},t.prototype.onMoveUp=function(t){var i=this,n=[].slice.call(this.parent.element.querySelectorAll("."+Xt));if((0,e.removeClass)(n,"e-allow-select"),e.EventHandler.remove(this.parent.getContentTable(),"mousemove",this.onMouseSelection),e.EventHandler.remove(this.parent.getContentTable(),"mouseup mouseleave",this.onMoveUp),t.target.classList.contains(Ke)){var a=this.parent.getAllDayRow();e.EventHandler.remove(a,"mousemove",this.onMouseSelection),e.EventHandler.remove(a,"mouseup mouseleave",this.onMoveUp)}if(!this.isPreventAction(t)){var s="."+$e+",."+Ke+",."+rt,l=(0,e.closest)(t.target,s),p=this.parent.getSelectedCells();if(p.length>0&&-1===p.indexOf(l)&&(l=p[p.length-1]),"TimelineYear"!==this.parent.currentView||!l.classList.contains(st)){this.parent.activeCellsData=this.getSelectedElements(l);var c={};this.parent.eventWindow&&this.parent.eventWindow.convertToEventData(this.parent.activeCellsData,c);var h={data:c,element:this.parent.activeCellsData.element,event:t,requestType:I,showQuickPopup:!1};this.parent.trigger(o,h,(function(n){if((n.showQuickPopup||i.parent.quickInfoOnSelectionEnd)&&p.length>1){var a=(0,e.extend)(i.parent.activeCellsData,{cancel:!1,event:t,name:"cellClick"});i.parent.notify(r,a)}}))}}},t.prototype.processEnter=function(t){if(!(this.parent.activeViewOptions.readonly&&!t.target.classList.contains(Xt)||this.isPreventAction(t)||"TimelineYear"===this.parent.currentView&&t.target.classList.contains(st))){var i=t.target;if((0,e.closest)(i,"."+Kn))i.classList.contains(Qi)||i.classList.contains(Ki)||i.classList.contains(Zi)||i.classList.contains(Ji)||i.classList.contains(Wn)?(i.click(),t.preventDefault()):i.classList.contains(Cn)&&(this.parent.element.querySelector("."+Ki).click(),t.preventDefault());else if(i.classList.contains(Ot)&&i.classList.contains(Dt)){var n=i.querySelector("."+Ct);n&&n.click()}else if(i.classList.contains($e)||i.classList.contains(Ke)){this.parent.activeCellsData=this.getSelectedElements(i);var a=(0,e.extend)(this.parent.activeCellsData,{cancel:!1,event:t});if(this.parent.allowInline){var s={element:a.element,groupIndex:a.groupIndex,type:"Cell"};this.parent.notify(A,s)}else"Year"===this.parent.currentView?i.click():this.parent.notify(r,a)}else if(i.classList.contains(dr)&&this.parent.inlineModule)this.parent.inlineModule.inlineCrudActions(i);else{if(!(i.classList.contains(Xt)||i.classList.contains(sn)||i.classList.contains(qi)||i.classList.contains(Bi)))return i.classList.contains(an)?(this.parent.setProperties({selectedDate:this.parent.getDateFromElement(i)},!0),this.parent.changeView(this.parent.getNavigateView(),t),void this.processEscape(t)):void 0;i.click()}}},t.prototype.getSelectedElements=function(e){var t;if(this.selectedCells.length>1&&e.classList.contains(Bt)){var i=this.parent.getCellDetails(this.selectedCells[0]),n=this.parent.getCellDetails(this.selectedCells.slice(-1)[0]);i.endTime=n.endTime,i.element=e,t=i}else t=this.parent.getCellDetails(e);return t},t.prototype.getCells=function(e,t,i){var n=this.parent.getContentTable(),r="TimelineYear"===this.parent.currentView,a=r&&!e?"."+$e+":not(."+st+")":"td",s=[].slice.call(n.querySelectorAll(a)),o=n.rows.length,l=n.rows[0].cells.length;if(t&&t.classList.contains(Ke)){var p=this.parent.getAllDayRow();s=[].slice.call(p.cells),o=1,l=p.cells.length}var c=s.indexOf(t),h=s.indexOf(i),d=[];if(e){for(var u=0;u<l;u++)for(var g=0;g<o;g++){var v=s[l*g+u];r&&v.classList.contains(st)||d.push(v)}c=d.indexOf(t),h=d.indexOf(i)}if(c>h){var m=c;c=h,h=m}return(e?d:s).slice(c,h+1)},t.prototype.focusFirstCell=function(){if("Agenda"===this.parent.currentView){var e=this.parent.getContentTable().querySelector("."+si);return e.setAttribute("tabindex","0"),void e.focus()}if(this.parent.eventBase.removeSelectedAppointmentClass(),this.parent.activeView.isTimelineView()&&"TimelineYear"!==this.parent.currentView){var t=this.parent.element.querySelector("."+Je+" tr:not(."+Xn+") ."+$e+":not(."+mt+")");this.selectCells(!1,t)}else if(this.parent.currentView.indexOf("Year")>-1){var i="."+$e+":not(."+st+"):not(."+mt+")";i+="TimelineYear"===this.parent.currentView&&"Vertical"===this.parent.activeViewOptions.orientation?'[data-date="'+this.parent.activeView.startDate().getTime()+'"]':"",this.selectCells(!1,this.parent.element.querySelector(i))}else this.selectCells(!1,this.parent.getWorkCellElements()[0])},t.prototype.isInverseTableSelect=function(){return this.parent.activeView.isInverseTableSelect},t.prototype.selectCells=function(e,t){var i=this;this.parent.removeSelectedClass();var n=t instanceof Array?t.slice(-1)[0]:t;if(e){var r,a=["Day","Week","WorkWeek","TimelineDay","TimelineWeek","TimelineWorkWeek","TimelineMonth","TimelineYear"],s={element:t,requestType:"mousemove",allowMultipleRow:!0};this.parent.inlineModule.removeInlineAppointmentElement(),this.parent.trigger(o,s,(function(e){if(!e.allowMultipleRow||!i.parent.allowMultiRowSelection){var t="TimelineYear"===i.parent.currentView;if(t&&"Horizontal"===i.parent.activeViewOptions.orientation||"Month"===i.parent.currentView){var s=t&&i.parent.activeViewOptions.group.resources.length>0;n=s?i.initialTarget:i.initialTarget.parentElement.children[n.cellIndex]}else a.indexOf(i.parent.currentView)>-1&&(n=n.parentElement.children[i.initialTarget.cellIndex])}var o=i.getCells(i.isInverseTableSelect(),i.initialTarget,n);if(i.parent.activeViewOptions.group.resources.length>0){r=i.initialTarget.getAttribute("data-group-index");for(var l=[],p=0,c=o;p<c.length;p++){(v=c[p]).getAttribute("data-group-index")===r&&l.push(v)}o=l}if(i.parent.allowMultiCellSelection||(o=[i.initialTarget]),i.selectedCells=o,o.length>2&&!n.classList.contains(Ke)){var h=i.getAllDayCells(o);if(i.parent.activeViewOptions.group.resources.length>0){for(var d=[],u=0,g=h;u<g.length;u++){var v;(v=g[u]).getAttribute("data-group-index")===r&&d.push(v)}h=d}o=o.concat(h)}n.getAttribute("data-group-index")!==r&&i.parent.activeViewOptions.group.resources.length>0&&(n=i.selectedCells[i.selectedCells.length-1]),i.parent.addSelectedClass(o,n)}))}else{s={element:n,requestType:I};this.parent.trigger(o,s,(function(){i.initialTarget=n,i.selectedCells=[n],i.parent.addSelectedClass([n],n)}))}},t.prototype.selectAppointment=function(t,i){var n=this.getAppointmentElements();if(!(n.length<0)){var r;if(this.parent.eventBase.removeSelectedAppointmentClass(),i.classList.contains(Xt)){var a=n.indexOf(i);r=n[t?a-1:a+1]}else r=t?n[n.length-1]:n[0];r&&(this.parent.eventBase.addSelectedAppointments([r],!0),r.focus(),(0,e.addClass)([r],li))}},t.prototype.selectAppointmentElementFromWorkCell=function(e,t){var i=this;if(this.parent.eventBase.removeSelectedAppointmentClass(),this.parent.removeSelectedClass(),t.classList.contains($e)||t.classList.contains(Ke)){var n=this.getUniqueAppointmentElements(),r=[],a=this.parent.getDateFromElement(t).getTime();if(this.parent.eventsProcessed.filter((function(t){return e?t[i.parent.eventFields.startTime].getTime()<=a:t[i.parent.eventFields.startTime].getTime()>=a})).filter((function(e){n.filter((function(t){JSON.stringify(e.Guid)===JSON.stringify(t.getAttribute("data-guid"))&&r.push(t)}))})),r.length>0){var s=e?r[r.length-1]:r[0],o=this.getAppointmentElementsByGuid(s.getAttribute("data-guid"));this.parent.eventBase.addSelectedAppointments(o,!0),o[o.length-1].focus()}}},t.prototype.getAllDayCells=function(e){var t=this.parent.getAllDayRow();if(!t)return[];var i=e[0],n=e[e.length-1],r=this.parent.getCellDetails(i);return this.parent.getCellDetails(n).endTime.getTime()-r.startTime.getTime()>=ie?[].slice.call(t.cells).slice(i.cellIndex,n.cellIndex+1):[]},t.prototype.getAppointmentElements=function(){return[].slice.call(this.parent.element.querySelectorAll("."+Xt))},t.prototype.getAppointmentElementsByGuid=function(e){return[].slice.call(this.parent.element.querySelectorAll('div[data-guid="'+e+'"]'))},t.prototype.getUniqueAppointmentElements=function(){var e=this.getAppointmentElements(),t=[];return e.map((function(e){return e.getAttribute("data-guid")})).filter((function(i,n,r){r.indexOf(i)===n&&t.push(e[parseInt(n.toString(),10)])})),t},t.prototype.getWorkCellFromAppointmentElement=function(e){var t=this.parent.eventBase.getEventByGuid(e.getAttribute("data-guid"));return this.parent.eventBase.selectWorkCellByTime([t])},t.prototype.processViewNavigation=function(t){if(!(0,e.isNullOrUndefined)(t.code)){var i=parseInt(t.code.slice(t.code.length-1),10)-1;if(!isNaN(i)&&!(0,e.isNullOrUndefined)(this.parent.views)&&i<this.parent.views.length){var n=this.parent.viewCollections[parseInt(i.toString(),10)].option;this.parent.changeView(n,t,void 0,i),this.parent.headerModule&&this.parent.headerModule.element.querySelector(".e-active-view button").focus()}}},t.prototype.isCalendarTarget=function(t){var i=t.currentTarget||t.target;return!(!i||(0,e.isNullOrUndefined)(i.querySelector(".e-header-popup.e-popup-open")))},t.prototype.cancelUpDownAction=function(e){var t=e&&"Vertical"===this.parent.activeViewOptions.orientation,i=this.parent.activeViewOptions.group.resources.length>0;return!!(t&&i||e&&this.initialTarget.classList.contains(st))||!((!this.parent.activeView.isTimelineView()||e)&&"MonthAgenda"!==this.parent.currentView)},t.prototype.processUp=function(e,t){var i="TimelineYear"===this.parent.currentView;if(!(t&&this.cancelUpDownAction(i)||this.isCalendarTarget(e))){var n=e.target,r=this.parent.getSelectedCells(),a=this.parent.eventBase.getSelectedAppointments(),s=this.parent.element.querySelector("."+en),o=this.getQuickPopupElement();if(r.length>0&&!e.target.classList.contains($e)&&(n=r[r.length-1]),a.length>0&&!s.classList.contains(tt)&&!o.classList.contains(tt)&&-1!==["Day","Week","WorkWeek","Month"].indexOf(this.parent.currentView)&&(n=this.getWorkCellFromAppointmentElement(a[a.length-1]),this.parent.eventBase.removeSelectedAppointmentClass()),n)if(n.classList.contains($e)&&!this.parent.element.querySelector("."+tt)){var l=this.parent.getTableRows(),p=l.indexOf(n.parentElement),c=void 0;if(i&&t&&0===this.parent.activeViewOptions.group.resources.length&&(c=this.isInverseTableSelect()?this.getVerticalUpDownCell(l,n,p,!0):this.getHorizontalUpDownCell(l,n,p,!0)),(p>0||c)&&p<l.length){if(c=c||l[p-1].cells[n.cellIndex],"Year"===this.parent.currentView&&c.classList.contains(st)){if(!(this.parent.activeView.getStartDate().getTime()<+c.getAttribute("data-date")))return;c=this.getYearUpDownCell(l,p-1,n.cellIndex,!0)}e.preventDefault(),this.selectCells(t,c)}}else"Agenda"!==this.parent.currentView&&"MonthAgenda"!==this.parent.currentView||this.selectAppointment(!0,n)}},t.prototype.processDown=function(e,t){var i="TimelineYear"===this.parent.currentView;if(!(t&&this.cancelUpDownAction(i)||this.isCalendarTarget(e))){var n=e.target,r=this.parent.getSelectedCells(),a=this.parent.eventBase.getSelectedAppointments(),s=this.parent.element.querySelector("."+en),o=this.getQuickPopupElement();r.length>0&&!e.target.classList.contains($e)&&(n=r[r.length-1]),a.length>0&&!s.classList.contains(tt)&&!o.classList.contains(tt)&&-1!==["Day","Week","WorkWeek","Month"].indexOf(this.parent.currentView)&&(n=this.getWorkCellFromAppointmentElement(a[a.length-1]),this.parent.eventBase.removeSelectedAppointmentClass());var l=this.parent.getTableRows();if(n)if(n.classList.contains($e)&&!this.parent.element.querySelector("."+tt)){var p=l.indexOf(n.parentElement),c=void 0;if(i&&t&&0===this.parent.activeViewOptions.group.resources.length&&(c=this.isInverseTableSelect()?this.getVerticalUpDownCell(l,n,p,!1):this.getHorizontalUpDownCell(l,n,p,!1)),p>=0&&(p<l.length-1||c)){if(c=c||l[p+1].cells[n.cellIndex],"Year"===this.parent.currentView&&c.classList.contains(st)){if(!(this.parent.activeView.getEndDate().getTime()>+c.getAttribute("data-date")))return;c=this.getYearUpDownCell(l,p+1,n.cellIndex,!1)}e.preventDefault(),this.selectCells(t,c)}}else"Agenda"!==this.parent.currentView&&"MonthAgenda"!==this.parent.currentView||this.selectAppointment(!1,n)}},t.prototype.getYearUpDownCell=function(e,t,i,n){for(;e[parseInt(t.toString(),10)]&&e[parseInt(t.toString(),10)].cells[parseInt(i.toString(),10)].classList.contains(st);)t+=n?-1:1;return e[parseInt(t.toString(),10)].cells[parseInt(i.toString(),10)]},t.prototype.getHorizontalUpDownCell=function(e,t,i,n){var r=e[i+(n?-1:1)],a=r?r.cells[t.cellIndex]:t;if(a.classList.contains(st)){var s=r.querySelector("."+$e+":not(."+st+")"),o=new Date(+s.getAttribute("data-date")),l='[data-date="'+new Date(o.getFullYear(),o.getMonth()+1,0).getTime()+'"]';a=a.cellIndex<s.cellIndex?s:r.querySelector(l)}return a},t.prototype.getVerticalUpDownCell=function(e,t,i,n){var r=n&&i>0||!n&&i<e.length-1?e[i+(n?-1:1)].cells[t.cellIndex]:void 0;if(!r||r.classList.contains(st)){if(e[parseInt(i.toString(),10)].cells[t.cellIndex-(n?1:-1)]){var a=+t.getAttribute("data-date")-(n?ie:-ie);return this.parent.getContentTable().querySelector("."+$e+'[data-date="'+a+'"]')}r=t}return r},t.prototype.processLeftRight=function(e){var t="Year"===this.parent.currentView?e.closest("tbody"):this.parent.getContentTable(),i=e.parentNode.sectionRowIndex;return{element:t,rowIndex:i,columnIndex:e.cellIndex,maxIndex:t.rows[parseInt(i.toString(),10)].cells.length}},t.prototype.getQuickPopupElement=function(){return(this.parent.isAdaptive?document.body:this.parent.element).querySelector("."+Kn)},t.prototype.isCancelLeftRightAction=function(e,t,i){var n="MonthAgenda"===this.parent.currentView||i&&this.initialTarget.classList.contains(st);if("Agenda"===this.parent.currentView||t&&n)return!0;if(this.isPreventAction(e)&&t)return!0;var r=this.parent.element.querySelector("."+en),a=this.getQuickPopupElement();return!(!r.classList.contains(tt)&&!a.classList.contains(tt))},t.prototype.processRight=function(t,i){var n="TimelineYear"===this.parent.currentView;if(!this.isCancelLeftRightAction(t,i,n)&&!this.isCalendarTarget(t)){var r,a=this.parent.getSelectedCells(),s=this.parent.eventBase.getSelectedAppointments(),o=t.target;if(a.length>0&&!o.classList.contains($e)&&!o.classList.contains(Ke)&&(o=a[a.length-1]),!(s.length>0)||(o=this.getWorkCellFromAppointmentElement(s[s.length-1]),this.parent.eventBase.removeSelectedAppointmentClass(),o))if(o.classList.contains($e)&&t.target.classList.contains($e)){var l=this.processLeftRight(o),p=new Date(+o.getAttribute("data-date")),c="Year"===this.parent.currentView&&p.getTime()===he(p).getTime();if(l.columnIndex>=0&&l.columnIndex<l.maxIndex-1&&!c)r=this.calculateNextPrevDate(o,l.element.rows[l.rowIndex].cells[o.cellIndex+1],"right"),n&&i&&r.classList.contains(st)&&(r=this.getTimelineYearTargetCell(l,o,!0)),(0,e.isNullOrUndefined)(r)||this.selectCells(i,r);else if(l.columnIndex===l.maxIndex-1||c)if(!this.isInverseTableSelect()&&l.rowIndex<l.element.rows.length-1&&!c){r=this.calculateNextPrevDate(o,l.element.rows[l.rowIndex+1].cells[0],"right");var h=n&&i&&r.classList.contains(st);r=h?this.getHorizontalLeftRightCell(l,o,!0):r,(0,e.isNullOrUndefined)(r)||this.selectCells(i,r)}else if(!i){if(c&&p.getTime()!==this.parent.activeView.getEndDate().getTime())return void this.selectCells(i,this.parent.element.querySelector(":not(."+st+')[data-date="'+(p.getTime()+ie)+'"]'));var d=this.isInverseTableSelect()?l.rowIndex:0;this.parent.changeDate(this.parent.activeView.getNextPreviousDate("Next"),t);var u=this.parent.getContentTable(),g=c?u.rows[parseInt(d.toString(),10)].querySelector("."+$e+":not(."+st+")"):u.rows[parseInt(d.toString(),10)].cells[0];this.selectCells(!1,g)}}else if(o.classList.contains(Ke)){var v=o.cellIndex,m=this.parent.getAllDayRow(),f=m.cells.length;if(v>=0&&v<f-1)this.selectCells(i,m.cells[v+1]);else if(v===f-1&&!i){this.parent.changeDate(this.parent.activeView.getNextPreviousDate("Next"),t);var y=this.parent.getAllDayRow();this.selectCells(!1,y.cells[0])}}}},t.prototype.processLeft=function(t,i){var n="TimelineYear"===this.parent.currentView;if(!this.isCancelLeftRightAction(t,i,n)&&!this.isCalendarTarget(t)){var r,a=t.target,s=this.parent.getSelectedCells();s.length>0&&!a.classList.contains($e)&&!a.classList.contains(Ke)&&(a=s[s.length-1]);var o=this.parent.eventBase.getSelectedAppointments();if(!(o.length>0)||(a=this.getWorkCellFromAppointmentElement(o[o.length-1]),this.parent.eventBase.removeSelectedAppointmentClass(),a))if(t.target.classList.contains($e)&&a.classList.contains($e)){var l=this.processLeftRight(a),p=new Date(+a.getAttribute("data-date")),c="Year"===this.parent.currentView&&p.getTime()===ce(p).getTime();if(l.columnIndex>0&&l.columnIndex<l.maxIndex&&!c)r=this.calculateNextPrevDate(a,l.element.rows[l.rowIndex].cells[a.cellIndex-1],"left"),n&&i&&r.classList.contains(st)&&(r=this.getTimelineYearTargetCell(l,a,!1)),(0,e.isNullOrUndefined)(r)||this.selectCells(i,r);else if(0===l.columnIndex||c)if(!this.isInverseTableSelect()&&l.rowIndex>0){r=this.calculateNextPrevDate(a,l.element.rows[l.rowIndex-1].cells[l.maxIndex-1],"left");var h=n&&i&&r.classList.contains(st);r=h?this.getHorizontalLeftRightCell(l,a,!1):r,(0,e.isNullOrUndefined)(r)||this.selectCells(i,r)}else if(!i){if(c&&p.getTime()!==this.parent.activeView.getStartDate().getTime())return void this.selectCells(i,this.parent.element.querySelector('[data-date="'+(p.getTime()-ie)+'"]'));this.parent.changeDate(this.parent.activeView.getNextPreviousDate("Previous"),t);var d=this.parent.getContentTable(),u=this.isInverseTableSelect()?l.rowIndex:d.rows.length-1,g=d.rows[parseInt(u.toString(),10)].cells[l.maxIndex-1];if(c){var v=this.parent.element.querySelectorAll("."+Je+" tbody");g=v.item(v.length-1).querySelector(":not(."+st+')[data-date="'+this.parent.activeView.getEndDate().getTime()+'"]')}this.selectCells(!1,g)}}else if(a.classList.contains(Ke)){var m=a.cellIndex,f=this.parent.getAllDayRow(),y=f.cells.length;if(m>0&&m<y)this.selectCells(i,f.cells[m-1]);else if(0===m&&!i){this.parent.changeDate(this.parent.activeView.getNextPreviousDate("Previous"),t);var T=this.parent.getAllDayRow();this.selectCells(!1,T.cells[y-1])}}}},t.prototype.getTimelineYearTargetCell=function(e,t,i){return this.isInverseTableSelect()?this.getVerticalLeftRightCell(t,i):this.getHorizontalLeftRightCell(e,t,i)},t.prototype.getHorizontalLeftRightCell=function(e,t,i){var n=e.element.rows[t.parentNode.sectionRowIndex+(i?1:-1)];if(n){var r=i?"."+$e+":not(."+st+")":'[data-date="'+(+t.getAttribute("data-date")-ie)+'"]';return n.querySelector(r)}return t},t.prototype.getVerticalLeftRightCell=function(e,t){var i=new Date(+e.getAttribute("data-date")),n=new Date(i.getFullYear(),i.getMonth()+(t?1:-1),1),r=this.parent.getContentTable(),a=r.querySelector('[data-date="'+n.getTime()+'"]');return a.parentNode.sectionRowIndex>e.parentNode.sectionRowIndex?a:r.querySelector('[data-date="'+new Date(n.getFullYear(),n.getMonth()+1,0).getTime()+'"]')},t.prototype.calculateNextPrevDate=function(e,t,i){var n=this.initialTarget.getAttribute("data-group-index");if(this.parent.activeViewOptions.group.resources.length>0&&"Month"===this.parent.currentView&&e&&t&&t.getAttribute("data-group-index")!==n){var r=this.parent.getDateFromElement(e),a="right"===i?new Date(r.setDate(r.getDate()+1)):new Date(r.setDate(r.getDate()-1));t=[].slice.call(this.parent.element.querySelectorAll('td[data-date="'+a.getTime().toString()+'"][data-group-index="'+n+'"]'))[0]}return t},t.prototype.getFocusableElements=function(e){return[].slice.call(e.querySelectorAll('a[href]:not([tabindex="-1"]),input:not([disabled]):not([tabindex="-1"]),textarea:not([disabled]):not([tabindex="-1"]),button:not([disabled]):not([tabindex="-1"]),select:not([disabled]):not([tabindex="-1"]),[tabindex]:not([tabindex="-1"]),[contentEditable=true]:not([tabindex="-1"])'))},t.prototype.processTabOnPopup=function(t,i){var n=this,r=this.getFocusableElements(i),a=(r=r.filter((function(e){var t=n.parent.element.querySelector("."+Gi);return t&&t.offsetParent?!(e.classList.contains(qn)||e.classList.contains(Un)):!(e.classList.contains(Zi)||e.classList.contains(Ji))})))[0],s=r[r.length-1];(0,e.isNullOrUndefined)(s)||document.activeElement!==s||t.shiftKey||(t.preventDefault(),a.focus()),!(0,e.isNullOrUndefined)(a)&&document.activeElement===a&&t.shiftKey&&(t.preventDefault(),s.focus())},t.prototype.processTab=function(t,i){var n=t.target;if(n.classList.contains(dr)&&this.parent.inlineModule&&(n=n.closest(".e-appointment"),this.parent.inlineModule.inlineCrudActions(t.target)),"TimelineYear"===this.parent.currentView&&n.classList.contains(st))n.classList.contains(Bt)&&this.parent.removeSelectedClass();else{var r=(0,e.closest)(n,"."+Kn+",."+en);if(r&&r.classList.contains(tt))return r.classList.contains(en)&&this.parent.eventBase.removeSelectedAppointmentClass(),void this.processTabOnPopup(t,r);if(n.classList.contains(Fe))this.parent.eventBase.removeSelectedAppointmentClass();else if(n.classList.contains(Ot)&&this.parent.activeView.isTimelineView()&&this.parent.activeViewOptions.group.resources.length>0){var a=parseInt(n.getAttribute("data-group-index"),10),s="."+Xt+'[data-group-index="'+(i?a-1:a)+'"]';if((c=[].slice.call(this.parent.element.querySelectorAll(s))).length>0){this.parent.eventBase.removeSelectedAppointmentClass();var o=i?c.slice(-1)[0]:c[0];this.parent.eventBase.addSelectedAppointments([o],!0),o.focus(),t.preventDefault()}else if(a+1===this.parent.resourceBase.lastResourceLevel.length)this.parent.element.focus(),t.preventDefault();else if(this.parent.virtualScrollModule){var l=this.parent.element.querySelector("."+ai),p=Math.round(l.offsetHeight/this.parent.resourceBase.expandedResources.length);this.parent.element.querySelector(".e-content-wrap").scrollTop=(i?a-1:a+1)*p,this.parent.virtualScrollModule.virtualScrolling()}else this.setScrollPosition(a)}else if(n.classList.contains(Xt)){var c=[].slice.call(this.parent.element.querySelectorAll("."+Xt)),h="TimelineYear"===this.parent.currentView;if((this.parent.activeView.isTimelineView()&&!h||h&&"Vertical"===this.parent.activeViewOptions.orientation)&&this.parent.activeViewOptions.group.resources.length>0){a=parseInt(n.getAttribute("data-group-index"),10);c=[].slice.call(this.parent.element.querySelectorAll("."+Xt+'[data-group-index="'+a+'"]'));var d="."+Ot+'[data-group-index="'+(i?a:a+1)+'"]',u=this.parent.element.querySelector(d);if(u&&(i&&n.getAttribute("data-guid")===c[0].getAttribute("data-guid")||!i&&n.getAttribute("data-guid")===c.slice(-1)[0].getAttribute("data-guid")))return this.parent.eventBase.removeSelectedAppointmentClass(),this.parent.virtualScrollModule?u.focus({preventScroll:!0}):u.focus(),this.parent.activeView.isTimelineView()&&this.parent.activeViewOptions.group.resources.length>0&&(0,e.isNullOrUndefined)(this.parent.virtualScrollModule)&&this.setScrollPosition(a),void t.preventDefault()}var g=this.parent.eventBase.getSelectedAppointments();if(g.length>0&&(n=g[g.length-1]),this.parent.eventBase.removeSelectedAppointmentClass(),!i&&n.getAttribute("data-guid")===c[c.length-1].getAttribute("data-guid")||i&&n.getAttribute("data-guid")===c[0].getAttribute("data-guid"))return;"Agenda"!==this.parent.currentView&&"MonthAgenda"!==this.parent.currentView||(this.selectAppointment(i,n),t.preventDefault())}else{var v=this.parent.getSelectedCells();if(v.length>0&&!n.classList.contains(Xt))return n=v[v.length-1],this.selectAppointmentElementFromWorkCell(i,n),void t.preventDefault();n&&!n.classList.contains(Ot)&&this.parent.activeView.isTimelineView()&&this.parent.activeViewOptions.group.resources.length>0&&this.processTabOnResourceCells(n,i)}}},t.prototype.processDelete=function(t){var i=document.activeElement;if("MonthAgenda"===this.parent.currentView){var n=this.parent.eventBase.getSelectedEvents().element;i=n&&(0,e.isNullOrUndefined)(n.length)?n:n[0]}if(i&&i.classList.contains(Xt)){if((0,e.addClass)([i],Zt),this.parent.activeEventData=this.parent.eventBase.getSelectedEvents(),this.parent.activeViewOptions.readonly||i.classList.contains(cr)||!this.parent.eventSettings.allowDeleting)return;this.parent.quickPopup.deleteClick(t)}},t.prototype.processCtrlShiftNavigationArrows=function(e){if(this.parent.activeViewOptions.group.resources.length>0&&document.activeElement.classList.contains(Xt)){var t=parseInt(document.activeElement.getAttribute("data-group-index"),10);r=(r="ctrlShiftLeftArrow"===e.action||"ctrlShiftUpArrow"===e.action?t-1:t+1)<0?0:r>this.parent.resourceBase.lastResourceLevel.length?this.parent.resourceBase.lastResourceLevel.length:r;for(var i=[];0===i.length&&r>=0&&r<=this.parent.resourceBase.lastResourceLevel.length;)i=[].slice.call(this.parent.element.querySelectorAll("."+Xt+'[data-group-index="'+r+'"]')),r="ctrlShiftLeftArrow"===e.action||"ctrlShiftUpArrow"===e.action?r-1:r+1;var n=i[0];n&&(this.parent.eventBase.removeSelectedAppointmentClass(),this.parent.eventBase.addSelectedAppointments([n],!0),n.focus())}else if(this.parent.activeViewOptions.group.resources.length>0&&!document.activeElement.classList.contains(Xt)){var r=this.parent.resourceBase.renderedResources[0].groupIndex,a="."+Xt+'[data-group-index="'+r+'"]',s=[].slice.call(this.parent.element.querySelectorAll(a));if(s.length>0){this.parent.eventBase.removeSelectedAppointmentClass();var o=s[0];this.parent.eventBase.addSelectedAppointments([o],!0),o.focus(),e.preventDefault()}}},t.prototype.processEscape=function(e){this.parent.quickPopup.onClosePopup(e),this.parent.quickPopup.morePopup.hide(),this.parent.headerModule&&this.parent.headerModule.hideHeaderPopup(),this.parent.inlineModule&&this.parent.inlineModule.removeInlineAppointmentElement()},t.prototype.isPreventAction=function(t){var i=(0,e.closest)(t.target,"."+mt);return!(!this.parent.activeView.isTimelineView()||(0,e.isNullOrUndefined)(i))},t.prototype.processTabOnResourceCells=function(e,t){var i=[].slice.call(this.parent.element.querySelectorAll('[tabIndex="0"]')),n=i.indexOf(e),r=t?i[n-1]:i[n+1];if(r&&r.classList.contains(Ot)){var a=parseInt(r.getAttribute("data-group-index"),10);if(this.parent.virtualScrollModule){var s=this.parent.element.querySelector("."+yt);[].slice.call(this.parent.element.querySelectorAll("."+Ot)).forEach((function(e){e.getBoundingClientRect().top<s.getBoundingClientRect().top&&e.setAttribute("tabindex","-1")}))}else this.setScrollPosition(a)}},t.prototype.setScrollPosition=function(e){var t=this.parent.element.querySelector("."+$e+'[data-group-index="'+e+'"]');t&&(this.parent.element.querySelector("."+ri).scrollTop=t.offsetTop)},t.prototype.createClipboardElement=function(){this.parent.allowClipboard&&(this.clipBoardTextArea=this.parent.createElement("textarea",{className:"e-clipboard",attrs:{tabindex:"-1"}}),this.parent.element.appendChild(this.clipBoardTextArea))},t.prototype.setCopy=function(t,i){var n=this;if(""===window.getSelection().toString()){this.clipBoardTextArea.value="";var r={elements:[],eventDatas:[]};if(t){var a=this.filterReadOnlyEvent(t);r.eventDatas=a}else{if(!this.parent||!this.parent.eventBase)return;var s=this.parent.eventBase.getSelectedEvents();s.event=s&&s.event?Array.isArray(s.event)?this.filterReadOnlyEvent(s.event):this.filterReadOnlyEvent([s.event]):void 0,s.element&&s.event?r={elements:s.element,eventDatas:s.event}:(r.element=[i.target],r.eventDatas=[this.parent.getEventDetails(i.target)])}this.clipBoardTextArea.value=JSON.stringify(r.eventDatas,void 0,2),/ipad|ipod|iphone/i.test(e.Browser.userAgent)?this.clipBoardTextArea.setSelectionRange(0,this.clipBoardTextArea.value.length):this.clipBoardTextArea.select(),(0,e.isNullOrUndefined)(navigator.clipboard)||navigator.clipboard.writeText(this.clipBoardTextArea.value).then((function(){if(n.clipBoardTextArea.blur(),window.getSelection().removeAllRanges(),i){var e=i.target.closest("."+Xt);e&&e.focus()}})).catch((function(e){throw e}))}},t.prototype.filterReadOnlyEvent=function(e){var t=this;return e.filter((function(e){return!e[t.parent.eventFields.isReadonly]}))},t.prototype.processClipboardAction=function(e,t,i){this.parent.allowClipboard&&(this.isCutAction=e,this.isCutContentPasted=!1,this.parent.closeQuickInfoPopup(),this.setCopy(t||void 0,i))},t.prototype.pasteHandler=function(e,t){var i=this;if(this.parent.allowClipboard&&!this.isCutContentPasted){var n=this.parent.getSelectedCells().length>0?this.parent.getSelectedCells():t?[t]:[];if(0!==n.length&&!this.parent.eventWindow.dialogObject.visible&&!this.parent.quickPopup.quickPopup.element.classList.contains(tt)){var r=(e.clipboardData||e.event.clipboardData||window.clipboardData).getData("text");if("[]"!==r&&""!==r){var a;try{a=JSON.parse(r)}catch(e){a=r}var s={cancel:!1,data:a,element:n};this.parent.trigger(N,s,(function(e){e.cancel?i.parent.closeQuickInfoPopup():Array.isArray(e.data)&&e.data.every((function(e){return"object"==typeof e}))?(i.processPaste(e.data,t),i.isCutAction&&(i.isCutContentPasted=!0)):i.clipBoardTextArea.value=""}))}}}},t.prototype.processPaste=function(t,i){if(this.parent&&this.parent.eventWindow&&this.parent.eventBase&&t&&t.length){var n=this.getTargetElements(i),r=this.parent.getCellDetails(n),a={};this.parent.eventWindow.convertToEventData(r,a);var s=this.isAllDayEvent(n),o=this.parent.getResourcesByIndex(r.groupIndex),l=this.processEventData(t,s,r,o),p=this.parent.eventBase.sortByDateTime(l),c=this.prepareEventData(p,a);(0,e.removeClass)(n,Bt),c.length>0&&(this.isCutAction?this.parent.saveEvent(c):this.parent.addEvent(c))}},t.prototype.getTargetElements=function(e){return this.parent.getSelectedCells().length>0?this.parent.getSelectedCells():e?[e]:[]},t.prototype.isAllDayEvent=function(e){return!e.some((function(e){return e.classList.contains($e)}))},t.prototype.processEventData=function(e,t,i,n){var r=this;return e.map((function(e){var a,s=Dr({},e,((a={})[r.parent.eventFields.startTime]=new Date(e[r.parent.eventFields.startTime]),a[r.parent.eventFields.endTime]=new Date(e[r.parent.eventFields.endTime]),a[r.parent.eventFields.recurrenceID]=null,a[r.parent.eventFields.isAllDay]=t,a));return r.adjustEventTime(s,t,e.IsAllDay,i),n&&n.groupData&&Object.assign(s,n.groupData),s}))},t.prototype.adjustEventTime=function(e,t,i,n){var r=this.parent.activeViewOptions.timeScale.enable;-1!==["Day","Week","WorkWeek"].indexOf(this.parent.currentView)&&r?t?(e[this.parent.eventFields.endTime]=new Date(e[this.parent.eventFields.startTime]),e[this.parent.eventFields.endTime].setDate(e[this.parent.eventFields.startTime].getDate()+1)):i&&(e[this.parent.eventFields.startTime]=new Date(e[this.parent.eventFields.startTime].setHours(0,0,0,0)),e[this.parent.eventFields.endTime]=new Date(e[this.parent.eventFields.startTime].getTime()+(n.endTime.getTime()-n.startTime.getTime()))):i&&(e[this.parent.eventFields.isAllDay]=!0,e[this.parent.eventFields.startTime]=new Date(e[this.parent.eventFields.startTime].setHours(0,0,0,0)),e[this.parent.eventFields.endTime]=new Date(e[this.parent.eventFields.startTime].getTime()+(e[this.parent.eventFields.endTime].getTime()-e[this.parent.eventFields.startTime].getTime())))},t.prototype.prepareEventData=function(e,t){var i=this,n=new Date(e[0][this.parent.eventFields.startTime]),r=this.parent.getEventMaxID();return e.map((function(e){var a=i.calculateTotalDuration(e,t,n),s=i.isCutAction?e:Dr({},e);return e[i.parent.eventFields.recurrenceRule]||(s[i.parent.eventFields.startTime]=new Date(new Date(s[i.parent.eventFields.startTime]).setMilliseconds(a)),s[i.parent.eventFields.endTime]=new Date(new Date(s[i.parent.eventFields.endTime]).setMilliseconds(a))),i.isCutAction||(s[i.parent.eventFields.id]=r++),s}))},t.prototype.calculateTotalDuration=function(e,t,i){if(-1===["Month","TimelineMonth","TimelineYear"].indexOf(this.parent.currentView)&&this.parent.activeViewOptions.timeScale.enable)return t[this.parent.eventFields.startTime].getTime()-i.getTime();var n=new Date(e[this.parent.eventFields.startTime]);return t[this.parent.eventFields.startTime].getTime()-i.getTime()+(36e5*n.getHours()+6e4*n.getMinutes()+1e3*n.getSeconds())},t.prototype.getModuleName=function(){return"keyboard"},t.prototype.destroy=function(){this.removeEventListener(),this.selectedCells=[],this.clipBoardTextArea=null,this.keyboardModule.destroy()},t}(),Sr=d(74),Cr=function(){function t(e,t,i){this.parent=e,this.initDataManager(t,i)}return t.prototype.initDataManager=function(e,t){this.dataManager=e instanceof Sr.DataManager?e:new Sr.DataManager(e),this.query=t instanceof Sr.Query?t:new Sr.Query},t.prototype.generateQuery=function(t,i){var n=this.query.clone();if(this.parent&&t&&i){if(this.parent.activeViewOptions&&this.parent.activeViewOptions.enableLazyLoading&&!(0,e.isNullOrUndefined)(this.parent.activeViewOptions.group.resources)&&this.parent.activeViewOptions.group.resources.length>0&&this.parent.resourceBase&&this.parent.resourceBase.resourceCollection.length>0&&this.parent.resourceBase.renderedResources.length>0){var r=[];this.parent.resourceBase.resourceCollection.forEach((function(){return r.push([])})),this.parent.resourceBase.renderedResources.forEach((function(e){r.forEach((function(t,i){var n=e.groupOrder[parseInt(i.toString(),10)];n&&t.indexOf(n)<0&&t.push(n)}))})),this.parent.resourceBase.resourceCollection.forEach((function(e,t){n.addParams(e.field,r[parseInt(t.toString(),10)].toString())}))}if(this.parent.timezone&&(t=this.parent.tzModule.remove(new Date(+t.getTime()),this.parent.timezone),i=this.parent.tzModule.remove(new Date(+i.getTime()),this.parent.timezone)),this.parent.eventSettings.includeFiltersInQuery){var a=this.getStartEndQuery(t,i),s=new Sr.Predicate(this.parent.eventFields.recurrenceRule,"notequal",null).and(new Sr.Predicate(this.parent.eventFields.recurrenceRule,"notequal",""));return n.where(a.or(s))}n.addParams("StartDate",t.toISOString()),n.addParams("EndDate",i.toISOString())}return n},t.prototype.getStartEndQuery=function(e,t){var i=this.parent.eventFields;return new Sr.Predicate(i.startTime,"greaterthanorequal",e).and(new Sr.Predicate(i.endTime,"greaterthanorequal",e)).and(new Sr.Predicate(i.startTime,"lessthan",t)).or(new Sr.Predicate(i.startTime,"lessthanorequal",e).and(new Sr.Predicate(i.endTime,"greaterthan",e)))},t.prototype.getData=function(e){return this.dataManager.executeQuery(e)},t.prototype.destroy=function(){this.dataManager=null,this.query=null},t}(),Or=function(){function t(){}return t.prototype.firstDateOfMonth=function(e){return new Date(e.getFullYear(),e.getMonth())},t.prototype.lastDateOfMonth=function(e){return new Date(e.getFullYear(),e.getMonth()+1,0)},t.prototype.isMonthStart=function(e){return 1===e.getDate()},t.prototype.getLeapYearDaysCount=function(){return 366},t.prototype.getYearDaysCount=function(e,t){return(e.getFullYear()+t)%4==0?366:365},t.prototype.getDate=function(e){return e.getDate()},t.prototype.getMonth=function(e){return e.getMonth()+1},t.prototype.getFullYear=function(e){return e.getFullYear()},t.prototype.getYearLastDate=function(e,t){return new Date(e.getFullYear()+t,0,0)},t.prototype.getMonthDaysCount=function(e){return this.lastDateOfMonth(e).getDate()},t.prototype.getMonthStartDate=function(e){return new Date(e.getFullYear(),e.getMonth(),1,e.getHours(),e.getMinutes())},t.prototype.getMonthEndDate=function(e){return e.setDate(1),new Date(e.setMonth(e.getMonth()+1))},t.prototype.getExpectedDays=function(e,t){return t},t.prototype.setDate=function(e,t){e.setDate(t)},t.prototype.setValidDate=function(t,i,n,r,a){(0,e.isNullOrUndefined)(a)?t.setMonth(t.getMonth()+i,n):t.setMonth((a?r:t.getMonth())+i)},t.prototype.setMonth=function(e,t,i){e.setDate(1),e.setFullYear(e.getFullYear()),e.setMonth(t-1);var n=new Date(e.getFullYear(),e.getMonth()+1,0).getDate();e.setDate(Math.min(i,n))},t.prototype.addYears=function(e,t){e.setFullYear(e.getFullYear()+t)},t.prototype.isSameMonth=function(e,t){return e.getMonth()===t.getMonth()},t.prototype.checkMonth=function(e,t){return-1===t.indexOf(e.getMonth()+1)},t.prototype.compareMonth=function(e,t){return e.getMonth()>t.getMonth()},t.prototype.isSameYear=function(e,t){return e.getFullYear()===t.getFullYear()},t.prototype.isLastMonth=function(e){return 11===e.getMonth()},t.prototype.isLeapYear=function(e,t){return(e+t)%4==0},t}(),Er=function(){function t(){}return t.prototype.firstDateOfMonth=function(t){var i=this.getHijriDate(t);return e.HijriParser.toGregorian(i.year,i.month,1)},t.prototype.lastDateOfMonth=function(t){var i=this.getHijriDate(t),n=this.getDaysInMonth(i.month,i.year),r=e.HijriParser.toGregorian(i.year,i.month,n),a=new Date(r.getTime());a=new Date(a.setDate(a.getDate()+1));var s=this.getHijriDate(a);return i.month===s.month?a:(s=this.getHijriDate(r),i.month===s.month?r:new Date(r.setDate(r.getDate()-1)))},t.prototype.isMonthStart=function(e){return 1===this.getHijriDate(e).date},t.prototype.getLeapYearDaysCount=function(){return 355},t.prototype.getYearDaysCount=function(e,t){var i=this.getHijriDate(e);return this.isLeapYear(i.year,t)?355:354},t.prototype.getDate=function(e){return this.getHijriDate(e).date},t.prototype.getMonth=function(e){return this.getHijriDate(e).month},t.prototype.getFullYear=function(e){return this.getHijriDate(e).year},t.prototype.getYearLastDate=function(t,i){var n=this.getHijriDate(t);return e.HijriParser.toGregorian(n.year+i,1,0)},t.prototype.getMonthDaysCount=function(e){var t=this.lastDateOfMonth(e);return this.getHijriDate(t).date},t.prototype.getMonthStartDate=function(e){var t=this.firstDateOfMonth(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate(),e.getHours(),e.getMinutes())},t.prototype.getMonthEndDate=function(e){var t=this.lastDateOfMonth(e);return t.setDate(t.getDate()+1),new Date(t.setMonth(t.getMonth()))},t.prototype.getExpectedDays=function(t,i){for(var n=this.getHijriDate(t),r=[],a=0;a<i.length;a++){var s=e.HijriParser.toGregorian(n.year,n.month,i[parseInt(a.toString(),10)]);r.push(s.getDate())}return r},t.prototype.setDate=function(t,i){var n=this.getHijriDate(t),r=e.HijriParser.toGregorian(n.year,n.month,i);this.updateDateObj(t,r)},t.prototype.setValidDate=function(t,i,n,r,a){var s=(0,e.isNullOrUndefined)(a)?t:this.firstDateOfMonth(a),o=this.getHijriDate(s),l=e.HijriParser.toGregorian(o.year,o.month+i,n);this.updateDateObj(t,l)},t.prototype.setMonth=function(t,i,n){var r=this.getHijriDate(t),a=e.HijriParser.toGregorian(r.year,i,n);this.updateDateObj(t,a)},t.prototype.addYears=function(t,i,n){var r=this.getHijriDate(t),a=e.HijriParser.toGregorian(r.year+i,n,1);this.updateDateObj(t,a)},t.prototype.isSameMonth=function(e,t){var i=this.getHijriDate(e),n=this.getHijriDate(t);return i.month===n.month},t.prototype.checkMonth=function(e,t){var i=this.getHijriDate(e);return-1===t.indexOf(i.month)},t.prototype.compareMonth=function(e,t){var i=this.getHijriDate(e),n=this.getHijriDate(t);return i.month>n.month},t.prototype.isSameYear=function(e,t){var i=this.getHijriDate(e),n=this.getHijriDate(t);return i.year===n.year},t.prototype.isLastMonth=function(e){return 12===this.getHijriDate(e).month},t.prototype.updateDateObj=function(e,t){e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate())},t.prototype.isLeapYear=function(e,t){return(14+11*(e+t))%30<11},t.prototype.getDaysInMonth=function(e,t){var i=0;return i=29+(e+1)%2,11===e&&this.isLeapYear(t,0)&&i++,i},t.prototype.getHijriDate=function(t){return e.HijriParser.getHijriDate(t)},t}(),xr=function(){function e(){this.timezoneData=[],this.timezoneData=this.getTimezoneData()}return e.prototype.offset=function(e,t){var i=e.getTimezoneOffset();try{var n=new Date(e.toLocaleString("en-US",{timeZone:t}));return isNaN(n.getTime())?0:(e.getTime()-n.getTime())/6e4+i}catch(e){return 0}},e.prototype.convert=function(e,t,i){"string"==typeof t&&(t=this.offset(e,t)),"string"==typeof i&&(i=this.offset(e,i));var n=e.getTimezoneOffset(),r=(e=new Date(e.getTime()+6e4*(t-i))).getTimezoneOffset();return new Date(e.getTime()+6e4*(r-n))},e.prototype.add=function(e,t){return this.convert(e,e.getTimezoneOffset(),t)},e.prototype.remove=function(e,t){return this.convert(e,t,e.getTimezoneOffset())},e.prototype.removeLocalOffset=function(e){return new Date(e.getTime()-6e4*e.getTimezoneOffset())},e.prototype.getLocalTimezoneName=function(){return window.Intl&&Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"},e.prototype.getTimezoneData=function(){return Vr},e}(),Vr=[{Value:"Pacific/Niue",Text:"(UTC-11:00) Niue"},{Value:"Pacific/Pago_Pago",Text:"(UTC-11:00) Pago Pago"},{Value:"Pacific/Honolulu",Text:"(UTC-10:00) Hawaii Time"},{Value:"Pacific/Rarotonga",Text:"(UTC-10:00) Rarotonga"},{Value:"Pacific/Tahiti",Text:"(UTC-10:00) Tahiti"},{Value:"Pacific/Marquesas",Text:"(UTC-09:30) Marquesas"},{Value:"America/Anchorage",Text:"(UTC-09:00) Alaska Time"},{Value:"Pacific/Gambier",Text:"(UTC-09:00) Gambier"},{Value:"America/Los_Angeles",Text:"(UTC-08:00) Pacific Time"},{Value:"America/Tijuana",Text:"(UTC-08:00) Pacific Time - Tijuana"},{Value:"America/Vancouver",Text:"(UTC-08:00) Pacific Time - Vancouver"},{Value:"America/Whitehorse",Text:"(UTC-08:00) Pacific Time - Whitehorse"},{Value:"Pacific/Pitcairn",Text:"(UTC-08:00) Pitcairn"},{Value:"America/Denver",Text:"(UTC-07:00) Mountain Time"},{Value:"America/Phoenix",Text:"(UTC-07:00) Mountain Time - Arizona"},{Value:"America/Mazatlan",Text:"(UTC-07:00) Mountain Time - Chihuahua, Mazatlan"},{Value:"America/Dawson_Creek",Text:"(UTC-07:00) Mountain Time - Dawson Creek"},{Value:"America/Edmonton",Text:"(UTC-07:00) Mountain Time - Edmonton"},{Value:"America/Hermosillo",Text:"(UTC-07:00) Mountain Time - Hermosillo"},{Value:"America/Yellowknife",Text:"(UTC-07:00) Mountain Time - Yellowknife"},{Value:"America/Belize",Text:"(UTC-06:00) Belize"},{Value:"America/Chicago",Text:"(UTC-06:00) Central Time"},{Value:"America/Mexico_City",Text:"(UTC-06:00) Central Time - Mexico City"},{Value:"America/Regina",Text:"(UTC-06:00) Central Time - Regina"},{Value:"America/Tegucigalpa",Text:"(UTC-06:00) Central Time - Tegucigalpa"},{Value:"America/Winnipeg",Text:"(UTC-06:00) Central Time - Winnipeg"},{Value:"America/Costa_Rica",Text:"(UTC-06:00) Costa Rica"},{Value:"America/El_Salvador",Text:"(UTC-06:00) El Salvador"},{Value:"Pacific/Galapagos",Text:"(UTC-06:00) Galapagos"},{Value:"America/Guatemala",Text:"(UTC-06:00) Guatemala"},{Value:"America/Managua",Text:"(UTC-06:00) Managua"},{Value:"America/Cancun",Text:"(UTC-05:00) America Cancun"},{Value:"America/Bogota",Text:"(UTC-05:00) Bogota"},{Value:"Pacific/Easter",Text:"(UTC-05:00) Easter Island"},{Value:"America/New_York",Text:"(UTC-05:00) Eastern Time"},{Value:"America/Iqaluit",Text:"(UTC-05:00) Eastern Time - Iqaluit"},{Value:"America/Toronto",Text:"(UTC-05:00) Eastern Time - Toronto"},{Value:"America/Guayaquil",Text:"(UTC-05:00) Guayaquil"},{Value:"America/Havana",Text:"(UTC-05:00) Havana"},{Value:"America/Jamaica",Text:"(UTC-05:00) Jamaica"},{Value:"America/Lima",Text:"(UTC-05:00) Lima"},{Value:"America/Nassau",Text:"(UTC-05:00) Nassau"},{Value:"America/Panama",Text:"(UTC-05:00) Panama"},{Value:"America/Port-au-Prince",Text:"(UTC-05:00) Port-au-Prince"},{Value:"America/Rio_Branco",Text:"(UTC-05:00) Rio Branco"},{Value:"America/Halifax",Text:"(UTC-04:00) Atlantic Time - Halifax"},{Value:"America/Barbados",Text:"(UTC-04:00) Barbados"},{Value:"Atlantic/Bermuda",Text:"(UTC-04:00) Bermuda"},{Value:"America/Boa_Vista",Text:"(UTC-04:00) Boa Vista"},{Value:"America/Caracas",Text:"(UTC-04:00) Caracas"},{Value:"America/Curacao",Text:"(UTC-04:00) Curacao"},{Value:"America/Grand_Turk",Text:"(UTC-04:00) Grand Turk"},{Value:"America/Guyana",Text:"(UTC-04:00) Guyana"},{Value:"America/La_Paz",Text:"(UTC-04:00) La Paz"},{Value:"America/Manaus",Text:"(UTC-04:00) Manaus"},{Value:"America/Martinique",Text:"(UTC-04:00) Martinique"},{Value:"America/Port_of_Spain",Text:"(UTC-04:00) Port of Spain"},{Value:"America/Porto_Velho",Text:"(UTC-04:00) Porto Velho"},{Value:"America/Puerto_Rico",Text:"(UTC-04:00) Puerto Rico"},{Value:"America/Santo_Domingo",Text:"(UTC-04:00) Santo Domingo"},{Value:"America/Thule",Text:"(UTC-04:00) Thule"},{Value:"America/St_Johns",Text:"(UTC-03:30) Newfoundland Time - St. Johns"},{Value:"America/Araguaina",Text:"(UTC-03:00) Araguaina"},{Value:"America/Asuncion",Text:"(UTC-03:00) Asuncion"},{Value:"America/Belem",Text:"(UTC-03:00) Belem"},{Value:"America/Argentina/Buenos_Aires",Text:"(UTC-03:00) Buenos Aires"},{Value:"America/Campo_Grande",Text:"(UTC-03:00) Campo Grande"},{Value:"America/Cayenne",Text:"(UTC-03:00) Cayenne"},{Value:"America/Cuiaba",Text:"(UTC-03:00) Cuiaba"},{Value:"America/Fortaleza",Text:"(UTC-03:00) Fortaleza"},{Value:"America/Godthab",Text:"(UTC-03:00) Godthab"},{Value:"America/Maceio",Text:"(UTC-03:00) Maceio"},{Value:"America/Miquelon",Text:"(UTC-03:00) Miquelon"},{Value:"America/Montevideo",Text:"(UTC-03:00) Montevideo"},{Value:"Antarctica/Palmer",Text:"(UTC-03:00) Palmer"},{Value:"America/Paramaribo",Text:"(UTC-03:00) Paramaribo"},{Value:"America/Punta_Arenas",Text:"(UTC-03:00) Punta Arenas"},{Value:"America/Recife",Text:"(UTC-03:00) Recife"},{Value:"Antarctica/Rothera",Text:"(UTC-03:00) Rothera"},{Value:"America/Bahia",Text:"(UTC-03:00) Salvador"},{Value:"America/Santiago",Text:"(UTC-03:00) Santiago"},{Value:"Atlantic/Stanley",Text:"(UTC-03:00) Stanley"},{Value:"America/Noronha",Text:"(UTC-02:00) Noronha"},{Value:"America/Sao_Paulo",Text:"(UTC-02:00) Sao Paulo"},{Value:"Atlantic/South_Georgia",Text:"(UTC-02:00) South Georgia"},{Value:"Atlantic/Azores",Text:"(UTC-01:00) Azores"},{Value:"Atlantic/Cape_Verde",Text:"(UTC-01:00) Cape Verde"},{Value:"America/Scoresbysund",Text:"(UTC-01:00) Scoresbysund"},{Value:"Africa/Abidjan",Text:"(UTC+00:00) Abidjan"},{Value:"Africa/Accra",Text:"(UTC+00:00) Accra"},{Value:"Africa/Bissau",Text:"(UTC+00:00) Bissau"},{Value:"Atlantic/Canary",Text:"(UTC+00:00) Canary Islands"},{Value:"Africa/Casablanca",Text:"(UTC+00:00) Casablanca"},{Value:"America/Danmarkshavn",Text:"(UTC+00:00) Danmarkshavn"},{Value:"Europe/Dublin",Text:"(UTC+00:00) Dublin"},{Value:"Africa/El_Aaiun",Text:"(UTC+00:00) El Aaiun"},{Value:"Atlantic/Faroe",Text:"(UTC+00:00) Faeroe"},{Value:"Etc/UTC",Text:"(UTC+00:00) UTC (no daylight saving)"},{Value:"Europe/Lisbon",Text:"(UTC+00:00) Lisbon"},{Value:"Europe/London",Text:"(UTC+00:00) London"},{Value:"Africa/Monrovia",Text:"(UTC+00:00) Monrovia"},{Value:"Atlantic/Reykjavik",Text:"(UTC+00:00) Reykjavik"},{Value:"UTC",Text:"UTC"},{Value:"Africa/Algiers",Text:"(UTC+01:00) Algiers"},{Value:"Europe/Amsterdam",Text:"(UTC+01:00) Amsterdam"},{Value:"Europe/Andorra",Text:"(UTC+01:00) Andorra"},{Value:"Europe/Berlin",Text:"(UTC+01:00) Berlin"},{Value:"Europe/Brussels",Text:"(UTC+01:00) Brussels"},{Value:"Europe/Budapest",Text:"(UTC+01:00) Budapest"},{Value:"Europe/Belgrade",Text:"(UTC+01:00) Central European Time - Belgrade"},{Value:"Europe/Prague",Text:"(UTC+01:00) Central European Time - Prague"},{Value:"Africa/Ceuta",Text:"(UTC+01:00) Ceuta"},{Value:"Europe/Copenhagen",Text:"(UTC+01:00) Copenhagen"},{Value:"Europe/Gibraltar",Text:"(UTC+01:00) Gibraltar"},{Value:"Africa/Lagos",Text:"(UTC+01:00) Lagos"},{Value:"Europe/Luxembourg",Text:"(UTC+01:00) Luxembourg"},{Value:"Europe/Madrid",Text:"(UTC+01:00) Madrid"},{Value:"Europe/Malta",Text:"(UTC+01:00) Malta"},{Value:"Europe/Monaco",Text:"(UTC+01:00) Monaco"},{Value:"Africa/Ndjamena",Text:"(UTC+01:00) Ndjamena"},{Value:"Europe/Oslo",Text:"(UTC+01:00) Oslo"},{Value:"Europe/Paris",Text:"(UTC+01:00) Paris"},{Value:"Europe/Rome",Text:"(UTC+01:00) Rome"},{Value:"Europe/Stockholm",Text:"(UTC+01:00) Stockholm"},{Value:"Europe/Tirane",Text:"(UTC+01:00) Tirane"},{Value:"Africa/Tunis",Text:"(UTC+01:00) Tunis"},{Value:"Europe/Vienna",Text:"(UTC+01:00) Vienna"},{Value:"Europe/Warsaw",Text:"(UTC+01:00) Warsaw"},{Value:"Europe/Zurich",Text:"(UTC+01:00) Zurich"},{Value:"Asia/Amman",Text:"(UTC+02:00) Amman"},{Value:"Europe/Athens",Text:"(UTC+02:00) Athens"},{Value:"Asia/Beirut",Text:"(UTC+02:00) Beirut"},{Value:"Europe/Bucharest",Text:"(UTC+02:00) Bucharest"},{Value:"Africa/Cairo",Text:"(UTC+02:00) Cairo"},{Value:"Europe/Chisinau",Text:"(UTC+02:00) Chisinau"},{Value:"Asia/Damascus",Text:"(UTC+02:00) Damascus"},{Value:"Asia/Gaza",Text:"(UTC+02:00) Gaza"},{Value:"Europe/Helsinki",Text:"(UTC+02:00) Helsinki"},{Value:"Asia/Jerusalem",Text:"(UTC+02:00) Jerusalem"},{Value:"Africa/Johannesburg",Text:"(UTC+02:00) Johannesburg"},{Value:"Africa/Khartoum",Text:"(UTC+02:00) Khartoum"},{Value:"Europe/Kiev",Text:"(UTC+02:00) Kiev"},{Value:"Africa/Maputo",Text:"(UTC+02:00) Maputo"},{Value:"Europe/Kaliningrad",Text:"(UTC+02:00) Moscow-01 - Kaliningrad"},{Value:"Asia/Nicosia",Text:"(UTC+02:00) Nicosia"},{Value:"Europe/Riga",Text:"(UTC+02:00) Riga"},{Value:"Europe/Sofia",Text:"(UTC+02:00) Sofia"},{Value:"Europe/Tallinn",Text:"(UTC+02:00) Tallinn"},{Value:"Africa/Tripoli",Text:"(UTC+02:00) Tripoli"},{Value:"Europe/Vilnius",Text:"(UTC+02:00) Vilnius"},{Value:"Africa/Windhoek",Text:"(UTC+02:00) Windhoek"},{Value:"Asia/Baghdad",Text:"(UTC+03:00) Baghdad"},{Value:"Europe/Istanbul",Text:"(UTC+03:00) Istanbul"},{Value:"Europe/Minsk",Text:"(UTC+03:00) Minsk"},{Value:"Europe/Moscow",Text:"(UTC+03:00) Moscow+00 - Moscow"},{Value:"Africa/Nairobi",Text:"(UTC+03:00) Nairobi"},{Value:"Asia/Qatar",Text:"(UTC+03:00) Qatar"},{Value:"Asia/Riyadh",Text:"(UTC+03:00) Riyadh"},{Value:"Antarctica/Syowa",Text:"(UTC+03:00) Syowa"},{Value:"Asia/Tehran",Text:"(UTC+03:30) Tehran"},{Value:"Asia/Baku",Text:"(UTC+04:00) Baku"},{Value:"Asia/Dubai",Text:"(UTC+04:00) Dubai"},{Value:"Indian/Mahe",Text:"(UTC+04:00) Mahe"},{Value:"Indian/Mauritius",Text:"(UTC+04:00) Mauritius"},{Value:"Europe/Samara",Text:"(UTC+04:00) Moscow+01 - Samara"},{Value:"Indian/Reunion",Text:"(UTC+04:00) Reunion"},{Value:"Asia/Tbilisi",Text:"(UTC+04:00) Tbilisi"},{Value:"Asia/Yerevan",Text:"(UTC+04:00) Yerevan"},{Value:"Asia/Kabul",Text:"(UTC+04:30) Kabul"},{Value:"Asia/Aqtau",Text:"(UTC+05:00) Aqtau"},{Value:"Asia/Aqtobe",Text:"(UTC+05:00) Aqtobe"},{Value:"Asia/Ashgabat",Text:"(UTC+05:00) Ashgabat"},{Value:"Asia/Dushanbe",Text:"(UTC+05:00) Dushanbe"},{Value:"Asia/Karachi",Text:"(UTC+05:00) Karachi"},{Value:"Indian/Kerguelen",Text:"(UTC+05:00) Kerguelen"},{Value:"Indian/Maldives",Text:"(UTC+05:00) Maldives"},{Value:"Antarctica/Mawson",Text:"(UTC+05:00) Mawson"},{Value:"Asia/Yekaterinburg",Text:"(UTC+05:00) Moscow+02 - Yekaterinburg"},{Value:"Asia/Tashkent",Text:"(UTC+05:00) Tashkent"},{Value:"Asia/Colombo",Text:"(UTC+05:30) Colombo"},{Value:"Asia/Kolkata",Text:"(UTC+05:30) India Standard Time"},{Value:"Asia/Katmandu",Text:"(UTC+05:45) Katmandu"},{Value:"Asia/Almaty",Text:"(UTC+06:00) Almaty"},{Value:"Asia/Bishkek",Text:"(UTC+06:00) Bishkek"},{Value:"Indian/Chagos",Text:"(UTC+06:00) Chagos"},{Value:"Asia/Dhaka",Text:"(UTC+06:00) Dhaka"},{Value:"Asia/Omsk",Text:"(UTC+06:00) Moscow+03 - Omsk"},{Value:"Asia/Thimphu",Text:"(UTC+06:00) Thimphu"},{Value:"Antarctica/Vostok",Text:"(UTC+06:00) Vostok"},{Value:"Indian/Cocos",Text:"(UTC+06:30) Cocos"},{Value:"Asia/Yangon",Text:"(UTC+06:30) Rangoon"},{Value:"Asia/Bangkok",Text:"(UTC+07:00) Bangkok"},{Value:"Indian/Christmas",Text:"(UTC+07:00) Christmas"},{Value:"Antarctica/Davis",Text:"(UTC+07:00) Davis"},{Value:"Asia/Saigon",Text:"(UTC+07:00) Hanoi"},{Value:"Asia/Hovd",Text:"(UTC+07:00) Hovd"},{Value:"Asia/Jakarta",Text:"(UTC+07:00) Jakarta"},{Value:"Asia/Krasnoyarsk",Text:"(UTC+07:00) Moscow+04 - Krasnoyarsk"},{Value:"Asia/Brunei",Text:"(UTC+08:00) Brunei"},{Value:"Asia/Shanghai",Text:"(UTC+08:00) China Time - Beijing"},{Value:"Asia/Choibalsan",Text:"(UTC+08:00) Choibalsan"},{Value:"Asia/Hong_Kong",Text:"(UTC+08:00) Hong Kong"},{Value:"Asia/Kuala_Lumpur",Text:"(UTC+08:00) Kuala Lumpur"},{Value:"Asia/Macau",Text:"(UTC+08:00) Macau"},{Value:"Asia/Makassar",Text:"(UTC+08:00) Makassar"},{Value:"Asia/Manila",Text:"(UTC+08:00) Manila"},{Value:"Asia/Irkutsk",Text:"(UTC+08:00) Moscow+05 - Irkutsk"},{Value:"Asia/Singapore",Text:"(UTC+08:00) Singapore"},{Value:"Asia/Taipei",Text:"(UTC+08:00) Taipei"},{Value:"Asia/Ulaanbaatar",Text:"(UTC+08:00) Ulaanbaatar"},{Value:"Australia/Perth",Text:"(UTC+08:00) Western Time - Perth"},{Value:"Asia/Pyongyang",Text:"(UTC+08:30) Pyongyang"},{Value:"Asia/Dili",Text:"(UTC+09:00) Dili"},{Value:"Asia/Jayapura",Text:"(UTC+09:00) Jayapura"},{Value:"Asia/Yakutsk",Text:"(UTC+09:00) Moscow+06 - Yakutsk"},{Value:"Pacific/Palau",Text:"(UTC+09:00) Palau"},{Value:"Asia/Seoul",Text:"(UTC+09:00) Seoul"},{Value:"Asia/Tokyo",Text:"(UTC+09:00) Tokyo"},{Value:"Australia/Darwin",Text:"(UTC+09:30) Central Time - Darwin"},{Value:"Antarctica/DumontDUrville",Text:'(UTC+10:00) Dumont D"Urville'},{Value:"Australia/Brisbane",Text:"(UTC+10:00) Eastern Time - Brisbane"},{Value:"Pacific/Guam",Text:"(UTC+10:00) Guam"},{Value:"Asia/Vladivostok",Text:"(UTC+10:00) Moscow+07 - Vladivostok"},{Value:"Pacific/Port_Moresby",Text:"(UTC+10:00) Port Moresby"},{Value:"Pacific / Chuuk",Text:"(UTC+10:00) Truk"},{Value:"Australia/Adelaide",Text:"(UTC+10:30) Central Time - Adelaide"},{Value:"Antarctica/Casey",Text:"(UTC+11:00) Casey"},{Value:"Australia/Hobart",Text:"(UTC+11:00) Eastern Time - Hobart"},{Value:"Australia/Sydney",Text:"(UTC+11:00) Eastern Time - Melbourne, Sydney"},{Value:"Pacific/Efate",Text:"(UTC+11:00) Efate"},{Value:"Pacific/Guadalcanal",Text:"(UTC+11:00) Guadalcanal"},{Value:"Pacific/Kosrae",Text:"(UTC+11:00) Kosrae"},{Value:"Asia/Magadan",Text:"(UTC+11:00) Moscow+08 - Magadan"},{Value:"Pacific / Norfolk",Text:"(UTC+11:00) Norfolk"},{Value:"Pacific/Noumea",Text:"(UTC+11:00) Noumea"},{Value:"Pacific/Pohnpei",Text:"(UTC+11:00) Ponape"},{Value:"Pacific/Funafuti",Text:"(UTC+12:00) Funafuti"},{Value:"Pacific/Kwajalein",Text:"(UTC+12:00) Kwajalein"},{Value:"Pacific/Majuro",Text:"(UTC+12:00) Majuro"},{Value:"Asia/Kamchatka",Text:"(UTC+12:00) Moscow+09 - Petropavlovsk - Kamchatskiy"},{Value:"Pacific / Nauru",Text:"(UTC+12:00) Nauru"},{Value:"Pacific/Tarawa",Text:"(UTC+12:00) Tarawa"},{Value:"Pacific/Wake",Text:"(UTC+12:00) Wake"},{Value:"Pacific/Wallis",Text:"(UTC+12:00) Wallis"},{Value:"Pacific/Auckland",Text:"(UTC+13:00) Auckland"},{Value:"Pacific/Enderbury",Text:"(UTC+13:00) Enderbury"},{Value:"Pacific/Fakaofo",Text:"(UTC+13:00) Fakaofo"},{Value:"Pacific/Fiji",Text:"(UTC+13:00) Fiji"},{Value:"Pacific/Tongatapu",Text:"(UTC+13:00) Tongatapu"},{Value:"Pacific/Apia",Text:"(UTC+14:00) Apia"},{Value:"Pacific/Kiritimati",Text:"(UTC+14:00) Kiritimati"}];function Ar(t,i,n,r){void 0===r&&(r="Gregorian");var a,s,o=Jr(t),l=i.getConstant(ma)+" ",p=r.toLowerCase();if("en"===n||"en-US"===n){var c="months.stand-alone.abbreviated",h="days.stand-alone.abbreviated";s=(0,e.getValue)(c,(0,e.getDefaultDateObject)(p)),a=(0,e.getValue)(h,(0,e.getDefaultDateObject)(p))}else{c="main."+n+".dates.calendars."+p+".months.stand-alone.abbreviated",h="main."+n+".dates.calendars."+p+".days.stand-alone.abbreviated";s=(0,e.getValue)(c,e.cldrData),a=(0,e.getValue)(h,e.cldrData)}switch(o.interval>1&&(l+=o.interval+" "),o.freq){case"DAILY":l+=i.getConstant(ya);break;case"WEEKLY":l+=i.getConstant(Ta)+" "+i.getConstant(va)+" ",o.day.forEach((function(t,i){l+=je((0,e.getValue)(ba[""+t],a),"single"),l+=o.day.length-1===i?"":", "}));break;case"MONTHLY":l+=i.getConstant(wa)+" "+i.getConstant(va)+" ",l+=Ir(o,a,i);break;case"YEARLY":l+=i.getConstant(Da)+" "+i.getConstant(va)+" ",l+=je((0,e.getValue)(o.month[0].toString(),s),"single")+" ",l+=Ir(o,a,i)}if(o.count)l+=", "+o.count+" "+i.getConstant(ga);else if(o.until){var d=o.until;l+=", "+i.getConstant(fa)+" "+d.getDate()+" "+je((0,e.getValue)((d.getMonth()+1).toString(),s),"single")+" "+d.getFullYear()}return l}function Ir(t,i,n){var r="";if(t.monthDay.length)r+=t.monthDay[0];else if(t.day){var a=t.setPosition-1;r+=n.getConstant(ua[a>-1?a:ua.length-1])+" "+je((0,e.getValue)(ba[t.day[0]],i),"single")}return r}function Mr(t,i,n,r,a,s,o,l){void 0===a&&(a=da),void 0===s&&(s=null),void 0===o&&(o="Gregorian"),void 0===l&&(l=null);var p,c=Jr(i);la=ra(o);var h=[],d=new Date(t.getTime());aa=[];var u=(0,e.isNullOrUndefined)(n)?[]:n.split(","),g=new xr;if(u.forEach((function(e){var t=kr(e);l&&(t=g.add(new Date(t.getTime()),l)),aa.push(new Date(t.getTime()).setHours(0,0,0,0))})),c.recExceptionCount=(0,e.isNullOrUndefined)(c.count)?0:aa.length,oa=s&&s>t&&!c.count?new Date(new Date(s.getTime()).setHours(0,0,0)):null,!c.until&&oa&&((p=new Date(oa.getTime())).setDate(oa.getDate()+a*c.interval),c.until=p),c.until&&t>c.until)return h;if(sa=a,r=r||0,function(e){for(;ca[0]!==e;)ia(ca)}(ha[parseInt(r.toString(),10)]),c.until){var v=ve(c.until);c.until=new Date(v.getFullYear(),v.getMonth(),v.getDate(),23,59,59)}switch(c.freq){case"DAILY":!function(e,t,i,n){var r=new Date(e.getTime()),a=n.interval,s=Hr(e,n),o=n.day;for(;Qr(r,t)&&!(na(r,n)&&(o.indexOf(ha[r.getDay()])>-1||0===o.length)&&(Rr(i,r.getTime()),s&&i.length+n.recExceptionCount>=s));)r.setDate(r.getDate()+a),r.getHours()!==e.getHours()&&r.setHours(e.getHours())}(d,c.until,h,c);break;case"WEEKLY":!function(t,i,n,r,a){var s=new Date(t.getTime());r.day.length||r.day.push(ha[t.getDay()]);var o,l=r.interval,p=r.day,c=Hr(t,r),h=!0,d=[];if(p.length>1)for(((0,e.isNullOrUndefined)(r.wkst)||""===r.wkst)&&(r.wkst=ca[0]),o=ha.indexOf(r.wkst);Qr(s,i);){var u=ha.indexOf(ha[s.getDay()])-o,g=ye(s,-(u=-1===u?6:u)),v=ye(g,6),m=new Date(s.getTime());for(v=ve(v),m=ve(m);v>=m&&(p.indexOf(ha[s.getDay()])>-1&&d.push([s.getTime()]),!(c&&n.length+r.recExceptionCount>=c));)s.setDate(s.getDate()+1),s.getHours()!==t.getHours()&&s.setHours(t.getHours()),m=ve(m=new Date(s.getTime()));if(s.setDate(s.getDate()-1),c&&n.length+r.recExceptionCount>=c)break;s.setDate(s.getDate()+1+7*(l-1)),Ur(d,h,t,i,n,r),d=[]}else{for(s=Zr(t,r.day),l>1&&ca.indexOf(r.day[0])<t.getDay()-a&&s.setDate(s.getDate()+7*(l-1));Qr(s,i)&&((h=na(s,r))&&p.indexOf(ha[s.getDay()])>-1&&Rr(n,s.getTime()),!(c&&n.length+r.recExceptionCount>=c));)s.setDate(s.getDate()+7*l);Ur(d,h,t,i,n,r),d=[]}}(d,c.until,h,c,r);break;case"MONTHLY":Pr(d,c.until,h,c);break;case"YEARLY":!function(t,i,n,r){switch(function(e){if(e.yearDay.length)return"YEARDAY";if(e.weekNo.length)return"WEEKNO";return"MONTH"}(r)){case"MONTH":Pr(t,i,n,r);break;case"WEEKNO":!function(t,i,n,r){var a,s,o,l,p,c,h=la.getYearLastDate(t,0),d=Hr(t,r),u=r.weekNo,g=[],v=r.day;for(;Qr(h,i);){o=6-ca.indexOf(ha[h.getDay()])+1;for(var m=0;m<u.length;m++)for(p=1===(l=(l=u[parseInt(m.toString(),10)])>0?l:53+l+1)?o:o+7*(l-1),c=1===l?o-7:o+7*(l-2);c<p;)a=new Date(h.getTime()+ie*c),(0===v.length||v.indexOf(ha[a.getDay()])>-1)&&((0,e.isNullOrUndefined)(r.setPosition)?Yr(s,t,i,n,r,a.getTime()):g.push([a.getTime()])),c++;if((0,e.isNullOrUndefined)(r.setPosition)||Xr(g,s,t,i,n,r),d&&n.length+r.recExceptionCount>=d)return;h=la.getYearLastDate(a,r.interval),g=[]}}(t,i,n,r);break;case"YEARDAY":!function(t,i,n,r){var a,s,o,l=la.getYearLastDate(t,0),p=Hr(t,r),c=[],h=r.day;for(;Qr(l,i);){for(var d=0;d<r.yearDay.length;d++)o=r.yearDay[parseInt(d.toString(),10)],a=new Date(l.getTime()),o!==la.getLeapYearDaysCount()&&o!==-la.getLeapYearDaysCount()||la.isLeapYear(la.getFullYear(a),1)?(a.setDate(a.getDate()+(o<0?la.getYearDaysCount(a,1)+1+o:o)),(0===h.length||h.indexOf(ha[a.getDay()])>-1)&&(null==r.setPosition?Yr(s,t,i,n,r,a.getTime()):c.push([a.getTime()]))):a.setDate(a.getDate()+1);if((0,e.isNullOrUndefined)(r.setPosition)||Xr(c,s,t,i,n,r),p&&n.length+r.recExceptionCount>=p)return;l=la.getYearLastDate(a,r.interval),c=[]}}(t,i,n,r)}}(d,c.until,h,c)}return h}function kr(e){return new Date(e.substr(0,4)+"-"+e.substr(4,2)+"-"+e.substr(6,5)+":"+e.substr(11,2)+":"+e.substr(13))}function Rr(e,t){var i=new Date(t).setHours(0,0,0,0);-1===aa.indexOf(i)&&(!oa||i>=oa.getTime())&&e.push(t)}function Hr(e,t){var i=sa;return t.count?i=t.count:t.until&&("DAILY"===t.freq||"WEEKLY"===t.freq?i=Math.floor((t.until.getTime()-e.getTime())/ie)+1:"MONTHLY"!==t.freq&&"YEARLY"!==t.freq||(i=Math.floor((t.until.getMonth()+12*t.until.getFullYear()-(e.getMonth()+12*e.getFullYear()))/t.interval)+(t.day.length>1?Math.floor((t.until.getTime()-e.getTime())/ie)+1:1),"YEARLY"===t.freq&&(i=t.month.length>1?i*t.month.length:i))),i}function Pr(t,i,n,r){r.month.length||r.day.length||r.monthDay.length?r.month.length>0&&!r.day.length&&!r.monthDay.length&&r.monthDay.push(t.getDate()):(r.monthDay.push(t.getDate()),"YEARLY"===r.freq&&r.month.push(t.getMonth()+1));var a=function(e){if(e.monthDay.length&&!e.day.length)return"date";if(!e.monthDay.length&&e.day.length)return"day";return"both"}(r);switch(a){case"day":switch(r.freq){case"MONTHLY":Fr(t,i,n,r);break;case"YEARLY":!function(t,i,n,r){var a=r.day,s=a.map((function(e){return Sa.test(e)}));if(a.length>1&&s.indexOf(!0)>-1)return void function(t,i,n,r){var a,s,o,l,p,c=r.day,h=Hr(t,r),d=new Date(t.getTime()),u=r.interval,g=[],v=[],m=0;d=la.getMonthStartDate(d);var f=[];r.month.length&&la.setMonth(d,r.month[0],1);d=Zr(d,r.day);for(;Qr(d,i);){o=new Date(d.getTime());for(var y=0;y<=r.month.length;y++)for(var T=0;T<=c.length-1;T++){for(d=Zr(d=la.getMonthStartDate(d),r.day),g=[];la.isSameYear(o,d)&&h&&n.length+r.recExceptionCount<=h;)for(;la.isSameYear(o,d);){if(o=new Date(d.getTime()),0===r.month.length||r.month.length>0&&r.month[parseInt(y.toString(),10)]===la.getMonth(o)){var w=c[parseInt(T.toString(),10)].match(Oa),D=parseInt(w[0],10);for(l=new Date(d.getTime());la.isSameYear(l,d)&&la.isSameMonth(l,d);)w[w.length-1]===ha[l.getDay()]&&g.push([l.getTime()]),l.setDate(l.getDate()+1);l.setDate(l.getDate()-1),a=w[0].indexOf("-")>-1?g.length- -1*D:D-1,a=isNaN(a)?0:a}m=qr(d,r,m,p,1),d=Zr(d,r.day)}if(d=0===T&&l?new Date(l.getTime()):new Date(o.getTime()),g.length>0&&((0,e.isNullOrUndefined)(r.setPosition)?Xr(g,s,t,i,n,r,a):v=[zr(g,a,f)]),h&&n.length+r.recExceptionCount>=h)return}(0,e.isNullOrUndefined)(r.setPosition)||(Gr(v,s,t,i,n,r),f=[]),la.isLastMonth(d)?(la.setValidDate(d,1,1),d.setFullYear(d.getFullYear()+u-1)):d.setFullYear(d.getFullYear()+u),d=Zr(d,r.day),r.month.length&&la.setMonth(d,r.month[0],d.getDate())}}(t,i,n,r);if(r.month.length&&1===a.length&&s.indexOf(!0)>-1)return void Fr(t,i,n,r);var o,l=new Date(t.getTime()),p=Hr(t,r),c=r.interval,h=[];r.month.length&&la.setMonth(l,r.month[0],l.getDate());(0,e.isNullOrUndefined)(r.setPosition)&&0===r.month.length&&0===r.weekNo.length&&l.setFullYear(t.getFullYear(),0,1);l=Zr(l=la.getMonthStartDate(l),r.day);for(;Qr(l,i);){for(o=new Date(l.getTime());la.isSameYear(o,l)&&p&&n.length+r.recExceptionCount<=p;)for(o=new Date(l.getTime());la.isSameYear(o,l);){if(!(0===r.month.length||r.month.length>0&&!la.checkMonth(l,r.month))){la.setValidDate(l,1,1),l=Zr(l,r.day);break}if(a.length>1){if(la.compareMonth(o,l)){la.setValidDate(l,1,1),l=Zr(l,r.day);break}a.indexOf(ha[o.getDay()])>-1&&h.push([o.getTime()]),o.setDate(o.getDate()+1)}else{if(o.getFullYear()>l.getFullYear()){la.setValidDate(l,1,1),l=Zr(l,r.day);break}var d=Kr(a[0]);ha[o.getDay()]===d&&new Date(o.getFullYear(),o.getMonth(),0)>new Date(t.getFullYear())&&h.push([o.getTime()]),o.setDate(o.getDate()+7)}}if(l.setFullYear(o.getFullYear(),o.getMonth(),o.getDate()),Wr(h,t,i,n,r),la.isLastMonth(l)&&(la.setValidDate(l,1,1),l=Zr(l,r.day)),l.setFullYear(l.getFullYear()+c-1),p&&n.length+r.recExceptionCount>=p)return;l=Zr(l,r.day),h=[]}}(t,i,n,r)}break;case"both":case"date":switch(r.freq){case"MONTHLY":Nr(t,i,n,r);break;case"YEARLY":!function(e,t,i,n){if(n.month.length)return void Nr(e,t,i,n);var r,a=jr(e,n);a.tempDate=a.mainDate=la.getMonthStartDate(a.tempDate);for(;Qr(a.tempDate,t);){for(r=new Date(a.tempDate.getTime());la.isSameYear(r,a.tempDate)&&a.expectedCount&&i.length+n.recExceptionCount<=a.expectedCount;){if(!(0===n.month.length||n.month.length>0&&!la.checkMonth(a.tempDate,n.month))){la.setValidDate(a.tempDate,1,1),a.tempDate=Zr(a.tempDate,n.day);break}Lr(n,a,t,!1),a.beginDate=new Date(a.tempDate.getTime()),a.monthInit=qr(a.tempDate,n,a.monthInit,a.beginDate)}if(a.tempDate.setFullYear(r.getFullYear(),r.getMonth(),r.getDate()),Ur(a.dateCollection,a.state,e,t,i,n),la.isLastMonth(a.tempDate)&&(la.setValidDate(a.tempDate,1,1),a.tempDate=Zr(a.tempDate,n.day)),a.expectedCount&&i.length+n.recExceptionCount>=a.expectedCount)return;a.tempDate.setFullYear(a.tempDate.getFullYear()+n.interval-1),a.tempDate=Zr(a.tempDate,n.day),a.monthInit=qr(a.tempDate,n,a.monthInit,a.beginDate),a.dateCollection=[]}}(t,i,n,r)}}}function jr(e,t){var i={monthCollection:[],index:0,tempDate:new Date(e.getTime()),mainDate:new Date(e.getTime()),expectedCount:Hr(e,t),monthInit:0,dateCollection:[]};return t.month.length&&la.setMonth(i.tempDate,t.month[0],i.tempDate.getDate()),i}function Nr(t,i,n,r){var a=jr(t,r);if(a.tempDate=a.mainDate=la.getMonthStartDate(a.tempDate),!(("MONTHLY"===r.freq&&12===r.interval||"YEARLY"===r.freq)&&la.getMonthDaysCount(t)<r.monthDay[0]))for(;Qr(a.tempDate,i);){if(a.beginDate=new Date(a.tempDate.getTime()),Lr(r,a,i,!0,t,n),(0,e.isNullOrUndefined)(r.setPosition)||Xr(a.dateCollection,a.state,t,i,n,r),a.expectedCount&&n.length+r.recExceptionCount>=a.expectedCount)return;a.monthInit=qr(a.tempDate,r,a.monthInit,a.beginDate),a.dateCollection=[]}}function Lr(t,i,n,r,a,s){for(var o=0;o<t.monthDay.length;o++){i.date=t.monthDay[parseInt(o.toString(),10)],i.tempDate=la.getMonthStartDate(i.tempDate);var l=la.getMonthDaysCount(i.tempDate);if(i.date=i.date>0?i.date:l+i.date+1,$r(i.tempDate,i.date,i.mainDate)&&i.date>0){if(la.setDate(i.tempDate,i.date),n&&i.tempDate>n)return;(0===t.day.length||t.day.indexOf(ha[i.tempDate.getDay()])>-1)&&(r&&(0,e.isNullOrUndefined)(t.setPosition)&&i.expectedCount&&s.length+t.recExceptionCount<i.expectedCount?Yr(i.state,a,n,s,t,i.tempDate.getTime()):i.dateCollection.push([i.tempDate.getTime()]))}}}function qr(t,i,n,r,a){void 0===r&&(r=null);var s=r?r.getMonth():0,o=la.getMonthStartDate(t);return a=(0,e.isNullOrUndefined)(a)?i.interval:a,t.setFullYear(o.getFullYear()),t.setMonth(o.getMonth()),t.setDate(o.getDate()),i.month.length?(n++,n%=i.month.length,la.setMonth(t,i.month[parseInt(n.toString(),10)],1),0===n&&la.addYears(t,a,i.month[0])):(r&&r.getFullYear()<t.getFullYear()&&(s=t.getMonth()-1),la.setValidDate(t,a,1,s,r)),n}function Fr(t,i,n,r){if(r.day.length>1)!function(t,i,n,r){var a=r.day,s=new Date(t.getTime());s=la.getMonthStartDate(s);var o,l,p,c=[],h=[],d=[],u=Hr(t,r),g=0;for(r.month.length&&la.setMonth(s,r.month[0],1),s=Zr(s,r.day);Qr(s,i)&&u&&n.length+r.recExceptionCount<u;){var v=new Date(s.getTime());if(a.map((function(e){return Sa.test(e)})).indexOf(!0)>-1){for(var m=0;m<=a.length-1;m++){var f=a[parseInt(m.toString(),10)].match(Oa),y=parseInt(f[0],10);for(s=new Date(s.getTime()),s=Zr(s=la.getMonthStartDate(s),a),v.setFullYear(s.getFullYear(),s.getMonth(),s.getDate());la.isSameYear(v,s)&&la.isSameMonth(v,s);)f[f.length-1]===ha[v.getDay()]&&c.push([v.getTime()]),v.setDate(v.getDate()+1);if(v.setDate(v.getDate()-1),o=f[0].indexOf("-")>-1?c.length- -1*y:y-1,o=isNaN(o)?0:o,c.length>0&&((0,e.isNullOrUndefined)(r.setPosition)?Xr(c,l,t,i,n,r,o):h=[zr(c,o,d)]),u&&n.length+r.recExceptionCount>=u)return;c=[]}(0,e.isNullOrUndefined)(r.setPosition)||(Gr(h,l,t,i,n,r),d=[]),g=qr(s,r,g,p),s=Zr(s,r.day),c=[]}else{var T=[],w=ea(a);v.setFullYear(s.getFullYear(),s.getMonth(),s.getDate());var D=new Date(s.getTime());for(p=new Date(s.getTime());la.isSameMonth(D,s);)T.push(s.getTime()),a.indexOf(ha[s.getDay()])>-1&&(c.push(T),T=[]),s.setDate(s.getDate()+w[ha[s.getDay()]]);if(o=r.setPosition<1?c.length+r.setPosition:r.setPosition-1,(0,e.isNullOrUndefined)(r.setPosition)){o=0;for(var b=[],S=0;S<c.length;S++)for(var C=0;C<c[parseInt(S.toString(),10)].length;C++)b.push(c[parseInt(S.toString(),10)][parseInt(C.toString(),10)]);c=[b]}if(c.length>0&&Xr(c,l,t,i,n,r,o),u&&n.length+r.recExceptionCount>=u)return;g=qr(s,r,g,p),s=Zr(s,r.day),c=[]}}}(t,i,n,r);else{var a,s=new Date(t.getTime()),o=Hr(t,r),l=[],p=0;for(s=la.getMonthStartDate(s),r.month.length&&la.setMonth(s,r.month[0],1),s=Zr(s,r.day);Qr(s,i)&&o&&n.length+r.recExceptionCount<o;){a=new Date(s.getTime());for(var c=new Date(s.getTime());la.isSameMonth(s,c);)l.push([c.getTime()]),c.setDate(c.getDate()+7);Wr(l,t,i,n,r),p=qr(s,r,p,a),s=Zr(s,r.day),l=[]}}}function Ur(t,i,n,r,a,s){var o=s.setPosition<1?t.length+s.setPosition:s.setPosition-1;(0,e.isNullOrUndefined)(s.setPosition)&&(o=0,t=Br(t)),t.length>0&&Xr(t,i,n,r,a,s,o)}function Br(e){for(var t=[],i=0;i<e.length;i++)for(var n=0;n<e[parseInt(i.toString(),10)].length;n++)t.push(new Date(e[parseInt(i.toString(),10)][parseInt(n.toString(),10)]).getTime());return e=t.length>0?[t]:[]}function Wr(e,t,i,n,r){var a,s=[],o=function(e,t){var i,n={monthCollection:[],index:0};if(1===t.length){var r=t[0].match(Oa),a=void 0;r.length>1?i=(a=parseInt(r[0],10))<1?e.length+a:a-1:(i=0,e=Br(e))}else i=0,e=Br(e);return n.monthCollection=e,n.index=i,n}(e,r.day);e=o.monthCollection;var l=o.index;null!=r.setPosition?Gr([zr(e,l,s)],a,t,i,n,r):e.length>0&&Xr(e,a,t,i,n,r,l),s=[]}function zr(e,t,i){for(var n=0;n<e[parseInt(t.toString(),10)].length;n++)i.push(e[parseInt(t.toString(),10)][parseInt(n.toString(),10)]);return i}function Yr(e,t,i,n,r,a){var s=Hr(t,r),o=new Date(a);e=na(o,r),o>=t&&Qr(o,i)&&e&&s&&n.length+r.recExceptionCount<s&&Rr(n,a)}function _r(e,t,i,n,r){var a=t||0,s=new Date(e,r.month[0]-1,1),o=new Date(e,r.month[0],0).getDate(),l=(s.getDay()-a+7)%7+o,p=Math.ceil(l/7)-1,c=i[parseInt(n.toString(),10)][parseInt(p.toString(),10)];return na(new Date(c),r)?p:p-1}function Gr(e,t,i,n,r,a){if(e.length>0)for(var s=0;s<e.length;s++){e[parseInt(s.toString(),10)].sort();var o=a.day.map((function(e){return Sa.test(e)})),l="YEARLY"===a.freq&&a.validRules.indexOf("BYMONTH")>-1&&!(o.indexOf(!0)>-1)?_r(new Date(e[0][0]).getFullYear(),0,e,s,a):e[parseInt(s.toString(),10)].length+a.setPosition,p=a.setPosition<1?l:a.setPosition-1;Yr(t,i,n,r,a,e[parseInt(s.toString(),10)][parseInt(p.toString(),10)])}}function Xr(t,i,n,r,a,s,o){if(t.length>0){o=(0,e.isNullOrUndefined)(o)?s.setPosition<1?t.length+s.setPosition:s.setPosition-1:o,t[parseInt(o.toString(),10)].sort();for(var l=0;l<t[parseInt(o.toString(),10)].length;l++){Yr(i,n,r,a,s,t[parseInt(o.toString(),10)][parseInt(l.toString(),10)])}}}function Qr(e,t){return!t||e<=t}function Kr(e){return e.replace(Ca,"")}function Zr(e,t){var i,n=new Date(e.getTime());if(t.length>0){for(var r=[],a=0;a<=t.length-1;a++)i=Kr(t[parseInt(a.toString(),10)]),r.push(i);if(-1===r.indexOf(ha[n.getDay()]))do{n.setDate(n.getDate()+1)}while(-1===r.indexOf(ha[n.getDay()]))}return n}function Jr(e){var t,i={freq:null,interval:1,count:null,until:null,day:[],wkst:null,month:[],weekNo:[],monthDay:[],yearDay:[],setPosition:null,validRules:[]},n=e.split(";"),r=[];if(n.forEach((function(e){switch((r=e.split("="))[0]){case"UNTIL":t=r[1],i.until=kr(t);break;case"BYDAY":i.day=r[1].split(","),i.validRules.push(r[0]);break;case"BYMONTHDAY":i.monthDay=r[1].split(",").map(Number),i.validRules.push(r[0]);break;case"BYMONTH":i.month=r[1].split(",").map(Number),i.validRules.push(r[0]);break;case"BYYEARDAY":i.yearDay=r[1].split(",").map(Number),i.validRules.push(r[0]);break;case"BYWEEKNO":i.weekNo=r[1].split(",").map(Number),i.validRules.push(r[0]);break;case"INTERVAL":i.interval=parseInt(r[1],10);break;case"COUNT":i.count=parseInt(r[1],10);break;case"BYSETPOS":i.setPosition=parseInt(r[1],10)>4?-1:parseInt(r[1],10);break;case"FREQ":i.freq=r[1];break;case"WKST":i.wkst=r[1]}})),"MONTHLY"===i.freq&&0===i.monthDay.length){var a=i.validRules.indexOf("BYDAY");i.validRules.splice(a,1)}return i}function $r(e,t,i){return t<=la.getMonthDaysCount(e)&&e>=i}function ea(e){var t={};return e.forEach((function(i,n){if(n===e.length-1){for(var r=ca.indexOf(i),a=r;a%7!==ca.indexOf(e[0]);)a++;t[""+i]=a-r}else t[""+i]=ca.indexOf(e[n+1])-ca.indexOf(i)})),t}function ta(e,t){var i,n=t.slice(0),r=function(e){pa[la.getFullYear(e)]||(pa[la.getFullYear(e)]=la.getYearLastDate(e,0));var t=pa[la.getFullYear(e)],i=e.getTime()-t.getTime();return Math.ceil(i/ie)}(e);for(i=n.shift();i;){if(i<0&&(i=i+la.getYearDaysCount(e,0)+1),i===r)return!1;i=n.shift()}return!0}function ia(e){var t=e.shift();e.push(t)}function na(e,t){var i=!0,n=t.day,r=t.month,a=la.getExpectedDays(e,t.monthDay),s=t.yearDay;return t.validRules.forEach((function(t){switch(t){case"BYDAY":(function(e,t){var i=[];return t.forEach((function(e){var t=e.match(Oa);2===t.length?i.push(t[1]):i.push(t[0])})),-1===i.indexOf(ha[parseInt(e.toString(),10)])})(e.getDay(),n)&&(i=!1);break;case"BYMONTH":la.checkMonth(e,r)&&(i=!1);break;case"BYMONTHDAY":(function(e,t){var i,n=t.slice(0),r=la.getMonthDaysCount(e);for(i=n.shift();i;){if(i<0&&(i=i+r+1),i===e.getDate())return!1;i=n.shift()}return!0})(e,a)&&(i=!1);break;case"BYYEARDAY":ta(e,s)&&(i=!1)}})),i}function ra(e){return"Islamic"===e?new Er:new Or}var aa,sa,oa,la,pa={},ca=["SU","MO","TU","WE","TH","FR","SA"],ha=["SU","MO","TU","WE","TH","FR","SA"],da=43,ua=["first","second","third","fourth","last"],ga="summaryTimes",va="summaryOn",ma="every",fa="summaryUntil",ya="summaryDay",Ta="summaryWeek",wa="summaryMonth",Da="summaryYear",ba={SU:"sun",MO:"mon",TU:"tue",WE:"wed",TH:"thu",FR:"fri",SA:"sat"},Sa=/\d/,Ca=/[^A-Z]+/,Oa=/[a-z]+|[^a-z]+/gi;function Ea(e){return[e.getUTCFullYear(),xa(e.getUTCMonth()+1),xa(e.getUTCDate()),"T",xa(e.getUTCHours()),xa(e.getUTCMinutes()),xa(e.getUTCSeconds()),"Z"].join("")}function xa(e){return("0"+e).slice(-2)}var Va,Aa=function(){function t(e){this.slots=[],this.processedData=[],this.isDoubleTapped=!1,this.parent=e}return t.prototype.processData=function(t,i,n){var r=this,a=this.parent.activeView.startDate(),s=this.parent.activeView.endDate(),o=this.parent.eventFields,l=[],p=1,c=!1,h=this.parent.resourceBase?this.parent.resourceBase.resourceCollection:[];t.length>0&&(0,e.isNullOrUndefined)(t[0][o.id])&&(c=!0);for(var d=function(t){c&&(t[o.id]=p++),t=u.updateEventDateTime(t),i?u.processTimezoneChange(t,n):u.parent.isPrinting||u.parent.uiStateValues.isPreventTimezone||(t=u.processTimezone(t));for(var a=0;a<h.length;a++)null!==t[h[parseInt(a.toString(),10)].field]&&0!==t[h[parseInt(a.toString(),10)].field]||(t[h[parseInt(a.toString(),10)].field]=void 0);if((0,e.isNullOrUndefined)(t[o.recurrenceRule])||""!==t[o.recurrenceRule]||(t[o.recurrenceRule]=null),(0,e.isNullOrUndefined)(t[o.recurrenceRule])||!(0,e.isNullOrUndefined)(t[o.recurrenceID])||u.parent.crudModule&&u.parent.crudModule.crudObj.isCrudAction)if(u.parent.crudModule&&u.parent.crudModule.crudObj.isCrudAction)if(!(0,e.isNullOrUndefined)(t[o.recurrenceRule])&&(0,e.isNullOrUndefined)(t[o.recurrenceID]))for(var s=function(e){var t=u.parent.eventsProcessed.filter((function(t){return t[o.startTime].getTime()-e[o.startTime].getTime()==0&&t[o.id]===e[o.id]}));e.Guid=t.length>0?t[0].Guid:u.generateGuid(),l.push(e)},d=0,g=u.generateOccurrence(t,null,!0);d<g.length;d++){s(g[d])}else{var v=u.parent.eventsProcessed.filter((function(e){return e[r.parent.eventFields.id]===t[r.parent.eventFields.id]}));t.Guid=v.length>0?v[0].Guid:u.generateGuid(),l.push(t)}else t.Guid=u.generateGuid(),l.push(t);else l=l.concat(u.generateOccurrence(t,null,!0))},u=this,g=0,v=t;g<v.length;g++){d(v[g])}this.parent.eventsProcessed=[];var m=l.filter((function(e){return!e[r.parent.eventFields.isBlock]}));if(this.parent.eventsProcessed=this.filterEvents(a,s,m),!this.parent.activeViewOptions.allowOverlap&&this.parent.eventsProcessed.length>0){this.processedData=this.parent.eventsProcessed;for(var f=[],y=this.parent.eventFields,T=0,w=this.parent.eventsProcessed;T<w.length;T++){var D=w[T],b=this.findOverlappingData(D,f);if(b){if(!this.parent.eventSettings.sortComparer){if(new Date(D[y.endTime]).getTime()-new Date(D[y.startTime]).getTime()>new Date(b[y.endTime]).getTime()-new Date(b[y.startTime]).getTime()&&D[y.startTime]===b[y.startTime]||!0===D[y.isAllDay]){var S=f.indexOf(b);-1!==S&&f.splice(S,1),f.push(D)}}}else f.push(D)}this.parent.eventsProcessed=f}for(var C=l.filter((function(e){return e[r.parent.eventFields.isBlock]})),O=0,E=C;O<E.length;O++){var x=E[O];if(x[o.isAllDay])ve(new Date(x[o.startTime].getTime()))<ve(new Date(x[o.endTime].getTime()))||(x[o.startTime]=ve(x[o.startTime]),x[o.endTime]=ye(ve(x[o.endTime]),1))}return this.parent.blockProcessed=C,m},t.prototype.findOverlappingData=function(t,i){for(var n=this.parent.activeViewOptions.group.resources.length>0,r=n?this.parent.resourceBase.resourceCollection:[],a=n?r[r.length-1].field:null,s=this.parent.eventFields,o=new Date(t[s.startTime]),l=new Date(t[s.endTime]),p=0,c=i;p<c.length;p++){var h=c[p];if(o<h[s.endTime]&&l>h[s.startTime]&&h[s.id]!==t[s.id]&&(!n||(0,e.isNullOrUndefined)(a)||this.compareResourceValues(h[""+a],t[""+a])))return h}},t.prototype.isOverlapRange=function(t,i){var n=this;void 0===i&&(i=null);for(var r=this.parent.activeViewOptions.group.resources.length>0,a=r?this.parent.resourceBase.resourceCollection:[],s=r?a[a.length-1].field:null,o=Array.isArray(t)?t:[t],l=this.parent.eventFields,p=function(t){return n.processedData.filter((function(i){return t[l.startTime]<i[l.endTime]&&t[l.endTime]>i[l.startTime]&&i[l.id]!==t[l.id]&&(!r||(0,e.isNullOrUndefined)(s)||n.compareResourceValues(i[""+s],t[""+s]))}))},c=[],h=!1,d=0,u=o;d<u.length;d++)for(var g=u[d],v=0,m=(0,e.isNullOrUndefined)(g[l.recurrenceRule])||!(0,e.isNullOrUndefined)(g[l.recurrenceID])&&g[l.recurrenceID]!==g[l.id]||!(0,e.isNullOrUndefined)(g[l.recurrenceID])&&"EditSeries"!==i?[g]:this.generateOccurrence(g);v<m.length;v++){var f=m[v],y=p(f);y.length>0&&c.push.apply(c,y),this.findOverlappingData(f,this.parent.eventsProcessed)&&(h=!0)}return this.parent.overlapAppointments=c,h},t.prototype.compareResourceValues=function(e,t){var i=function(e){return Array.isArray(e)?e[0]:e};return i(e)===i(t)},t.prototype.checkOverlap=function(e){return!(this.parent.activeViewOptions.allowOverlap||!this.isOverlapRange(e))&&(this.parent.quickPopup.openValidationError("overlapAlert",e),!0)},t.prototype.updateEventDateTime=function(e){return"string"==typeof e[this.parent.eventFields.startTime]&&(e[this.parent.eventFields.startTime]=Ce(e[this.parent.eventFields.startTime])),"string"==typeof e[this.parent.eventFields.endTime]&&(e[this.parent.eventFields.endTime]=Ce(e[this.parent.eventFields.endTime])),e},t.prototype.getProcessedEvents=function(t){void 0===t&&(t=this.parent.eventsData);for(var i=[],n=0,r=t;n<r.length;n++){var a=r[n];!(0,e.isNullOrUndefined)(a[this.parent.eventFields.recurrenceRule])&&(0,e.isNullOrUndefined)(a[this.parent.eventFields.recurrenceID])?i=i.concat(this.generateOccurrence(a)):i.push(a)}return i},t.prototype.timezonePropertyChange=function(e){var t=this.parent.eventsData.concat(this.parent.blockData),i=this.processData(t,!0,e);this.parent.notify(z,{processedData:i})},t.prototype.timezoneConvert=function(e){var t=this.parent.eventFields;if(e[t.startTimezone]=e[t.startTimezone]||e[t.endTimezone],e[t.endTimezone]=e[t.endTimezone]||e[t.startTimezone],this.parent.timezone){var i=e[t.startTimezone],n=e[t.endTimezone];e[t.startTime]=this.parent.tzModule.convert(e[t.startTime],this.parent.timezone,i),e[t.endTime]=this.parent.tzModule.convert(e[t.endTime],this.parent.timezone,n)}},t.prototype.processTimezoneChange=function(e,t){var i=this.parent.eventFields;e[i.isAllDay]||(t&&this.parent.timezone?(e[i.startTime]=this.parent.tzModule.convert(e[i.startTime],t,this.parent.timezone),e[i.endTime]=this.parent.tzModule.convert(e[i.endTime],t,this.parent.timezone)):!t&&this.parent.timezone?(e[i.startTime]=this.parent.tzModule.add(e[i.startTime],this.parent.timezone),e[i.endTime]=this.parent.tzModule.add(e[i.endTime],this.parent.timezone)):t&&!this.parent.timezone&&(e[i.startTime]=this.parent.tzModule.remove(e[i.startTime],t),e[i.endTime]=this.parent.tzModule.remove(e[i.endTime],t)))},t.prototype.processTimezone=function(e,t){void 0===t&&(t=!1);var i=this.parent.eventFields;if(e[i.isAllDay])return e;if(e[i.startTimezone]||e[i.endTimezone]){var n=e[i.startTimezone]||e[i.endTimezone],r=e[i.endTimezone]||e[i.startTimezone];t?this.parent.timezone?(e[i.startTime]=this.parent.tzModule.convert(e[i.startTime],n,this.parent.timezone),e[i.endTime]=this.parent.tzModule.convert(e[i.endTime],r,this.parent.timezone),e[i.startTime]=this.parent.tzModule.remove(e[i.startTime],this.parent.timezone),e[i.endTime]=this.parent.tzModule.remove(e[i.endTime],this.parent.timezone)):(e[i.startTime]=this.parent.tzModule.remove(e[i.startTime],n),e[i.endTime]=this.parent.tzModule.remove(e[i.endTime],r)):(e[i.startTime]=this.parent.tzModule.add(e[i.startTime],n),e[i.endTime]=this.parent.tzModule.add(e[i.endTime],r),this.parent.timezone&&(e[i.startTime]=this.parent.tzModule.convert(e[i.startTime],n,this.parent.timezone),e[i.endTime]=this.parent.tzModule.convert(e[i.endTime],r,this.parent.timezone)))}else this.parent.timezone&&(t?(e[i.startTime]=this.parent.tzModule.remove(e[i.startTime],this.parent.timezone),e[i.endTime]=this.parent.tzModule.remove(e[i.endTime],this.parent.timezone)):(e[i.startTime]=this.parent.tzModule.add(e[i.startTime],this.parent.timezone),e[i.endTime]=this.parent.tzModule.add(e[i.endTime],this.parent.timezone)));return e},t.prototype.filterBlockEvents=function(t){var i,n=this.parent.eventFields,r=t[n.startTime],a=t[n.endTime];if(this.parent.activeViewOptions.group.resources.length>0){var s=this.getGroupIndexFromEvent(t);i=this.parent.resourceBase.lastResourceLevel[parseInt(s.toString(),10)]}for(var o=(0,e.extend)([],this.parent.blockProcessed,null,!0),l=0,p=o;l<p.length;l++){var c=p[l];if(c[n.isAllDay])c[n.endTime].getTime()>ve(new Date(c[n.endTime].getTime())).getTime()&&(c[n.startTime]=ve(c[n.startTime]),c[n.endTime]=ye(ve(c[n.endTime]),1))}return this.filterEvents(r,a,o,i)},t.prototype.filterEvents=function(e,t,i,n){void 0===i&&(i=this.parent.eventsProcessed);var r=this.parent.dataModule.getStartEndQuery(e,t),a=new Sr.DataManager({json:i}).executeLocal((new Sr.Query).where(r));return n&&(a=this.filterEventsByResource(n,a)),this.sortByTime(a)},t.prototype.filterEventsByRange=function(e,t,i){var n=this,r=[];return r=t&&i?this.filterEvents(t,i,e):t&&!i?e.filter((function(e){return e[n.parent.eventFields.startTime]>=t})):!t&&i?e.filter((function(e){return e[n.parent.eventFields.endTime]<=i})):e,this.sortByTime(r)},t.prototype.filterEventsByResource=function(e,t){void 0===t&&(t=this.parent.eventsProcessed);for(var i={},n=this.parent.resourceBase.resourceCollection,r=0;r<n.length;r++)i[n[parseInt(r.toString(),10)].field]=e.groupOrder[parseInt(r.toString(),10)];var a=Object.keys(i);return t.filter((function(e){return a.every((function(t){return e[""+t]instanceof Array?e[""+t].indexOf(i[""+t])>-1:e[""+t]===i[""+t]}))}))},t.prototype.sortByTime=function(e){if(!this.parent.eventSettings.sortComparer||"function"!=typeof this.parent.eventSettings.sortComparer&&"string"!=typeof this.parent.eventSettings.sortComparer){var t=this.parent.eventFields;e.sort((function(e,i){var n=e[t.startTime],r=i[t.startTime];return n.getTime()-r.getTime()}))}else e=this.customSorting(e);return e},t.prototype.sortByDateTime=function(e){if(!this.parent.eventSettings.sortComparer||"function"!=typeof this.parent.eventSettings.sortComparer&&"string"!=typeof this.parent.eventSettings.sortComparer){var t=this.parent.eventFields;e.sort((function(e,i){var n=e[t.startTime],r=i[t.startTime],a=e[t.endTime],s=i[t.endTime],o=a.getTime()-n.getTime(),l=s.getTime()-r.getTime();return n.getTime()-r.getTime()||l-o}))}else e=this.customSorting(e);return e},t.prototype.customSorting=function(t){if("function"==typeof this.parent.eventSettings.sortComparer)return this.parent.eventSettings.sortComparer.call(this.parent,t);if("string"==typeof this.parent.eventSettings.sortComparer){var i=this.parent.eventSettings.sortComparer.split("."),n=void 0;if((0,e.isNullOrUndefined)(window)||(n=window[i[i.length-1]]),n)return n(t)}return t},t.prototype.getSmallestMissingNumber=function(e){for(var t=Math.max.apply(Math,e),i=0;i<t;i++)if(-1===e.indexOf(i))return i;return t+1},t.prototype.splitEventByDay=function(t){var i=this.parent.eventFields,n=[],r=t[i.startTime],a=t[i.endTime];if(ve(new Date(r.getTime()))<ve(new Date(a.getTime())))for(var s=new Date(r.getTime()),o=ye(ve(new Date(r.getTime())),1),l=0===a.getHours()&&0===a.getMinutes()?a:ye(a,1),p=1,c=Se(r.getTime(),l.getTime());o<=a&&s.getTime()!==o.getTime();){var h=(0,e.extend)({},t);h[i.startTime]=s,h[i.endTime]=o,h.data={index:p,count:c},h.Guid=this.generateGuid(),h.isSpanned=!0,n.push(h),s=o,ve(new Date(s.getTime())).getTime()===ve(new Date(a.getTime())).getTime()&&o.getTime()!==a.getTime()?(o=new Date(s.getTime()),o=new Date(o.setHours(a.getHours(),a.getMinutes(),a.getSeconds()))):o=ye(ve(new Date(s.getTime())),1),p++}else n.push(t);return n},t.prototype.splitEvent=function(t,i){var n=this.parent.eventFields,r=ve(t[n.startTime]).getTime(),a=ve(t[n.endTime]).getTime();me(t[n.endTime])<=0&&(a=r>(w=ye(ve(t[n.endTime]),-1).getTime())?r:w);var s=r,o=a,l=[];if(r!==a){r<i[0].getTime()&&(r=i[0].getTime()),a>i[i.length-1].getTime()&&(a=i[i.length-1].getTime());for(var p=r,c=0;c<this.slots.length;c++){var h=this.slots[parseInt(c.toString(),10)];if("WorkWeek"===this.parent.currentView||"TimelineWorkWeek"===this.parent.currentView||this.parent.activeViewOptions.group.byDate||this.parent.activeViewOptions.showWeekend){for(var d=[],u=0,g=h;u<g.length;u++){var v=g[u];d.push(new Date(v))}var m=this.getRenderedDates(d);if(!(0,e.isNullOrUndefined)(m)&&m.length>0){h=[];for(var f=0,y=m;f<y.length;f++){var T=y[f];h.push(T.getTime())}}}if("number"==typeof h){var w=h;(h=[]).push(w)}var D=h[0];if((p=p<=D&&a>=D?D:p)>a||D>a)break;if(!this.parent.activeViewOptions.group.byDate&&this.parent.activeViewOptions.showWeekend&&"WorkWeek"!==this.parent.currentView&&"TimelineWorkWeek"!==this.parent.currentView){var b=h.indexOf(p);if(-1!==b){var S=h.indexOf(a),C=-1!==S,O=(S=C?S:h.length-1)-b+1,E=h[parseInt(b.toString(),10)]!==s,x=h[parseInt(S.toString(),10)]!==o;if(l.push(this.cloneEventObject(t,h[parseInt(b.toString(),10)],h[parseInt(S.toString(),10)],O,E,x)),C)break}}else if(this.dateInRange(p,h[0],h[h.length-1])){for(var V=[],A=0;A<h.length;A++)this.dateInRange(h[parseInt(A.toString(),10)],s,o)&&V.push(h[parseInt(A.toString(),10)]);if(V.length>0)if(this.parent.activeViewOptions.group.byDate)for(var I=0,M=V;I<M.length;I++){var k=M[I];l.push(this.cloneEventObject(t,k,k,1,k!==s,k!==o))}else{E=V[0]!==s,x=V[V.length-1]!==o;l.push(this.cloneEventObject(t,V[0],V[V.length-1],V.length,E,x))}}}}else l.push(this.cloneEventObject(t,r,a,1,!1,!1));return l},t.prototype.cloneEventObject=function(t,i,n,r,a,s){var o=this.parent.eventFields,l=(0,e.extend)({},t,null,!0),p={count:r,isLeft:a,isRight:s};return p[o.startTime]=t[o.startTime],p[o.endTime]=t[o.endTime],l.data=p,l[o.startTime]=new Date(i),l[o.endTime]=new Date(n),l},t.prototype.dateInRange=function(e,t,i){return t<=e&&e<=i},t.prototype.getSelectedEventElements=function(e){if(this.removeSelectedAppointmentClass(),this.parent.selectedElements.length<=0)this.parent.selectedElements.push(e);else{var t=this.parent.selectedElements.filter((function(t){return t.getAttribute("data-guid")===e.getAttribute("data-guid")}));if(t.length<=0)for(var i='div[data-guid="'+e.getAttribute("data-guid")+'"]',n=0,r=[].slice.call(this.parent.element.querySelectorAll(i));n<r.length;n++){var a=r[n];this.parent.selectedElements.push(a)}else{var s=this.parent.selectedElements.filter((function(t){return t.getAttribute("data-guid")!==e.getAttribute("data-guid")}));this.parent.selectedElements=s}}return e&&this.parent.selectedElements.length>0&&this.addSelectedAppointments(this.parent.selectedElements,!1),this.parent.selectedElements},t.prototype.getSelectedEvents=function(){var e=this,t=[],i=[];return[].slice.call(this.parent.element.querySelectorAll("."+Zt)).filter((function(n){0===t.filter((function(e){return e.Guid===n.getAttribute("data-guid")})).length&&t.push(e.getEventByGuid(n.getAttribute("data-guid"))),i.push(n)})),{event:t.length>1?t:t[0],element:i.length>1?i:i[0]}},t.prototype.removeSelectedAppointmentClass=function(){var t=this.getSelectedAppointments();(0,e.removeClass)(t,Zt),"Agenda"!==this.parent.currentView&&"MonthAgenda"!==this.parent.currentView||(0,e.removeClass)(t,li)},t.prototype.addSelectedAppointments=function(t,i){"MonthAgenda"!==this.parent.currentView&&this.parent.removeSelectedClass(),(0,e.addClass)(t,Zt),t.length>0&&!i&&t[t.length-1].focus()},t.prototype.getSelectedAppointments=function(){return[].slice.call(this.parent.element.querySelectorAll("."+Zt+",."+Xt+":focus"))},t.prototype.focusElement=function(t){if(!this.parent.eventWindow.dialogObject||!this.parent.eventWindow.dialogObject.visible){var i=document.activeElement,n=this.parent.getSelectedCells();if(!(n.length>0&&(i&&(this.parent.element.contains(i)||-1!==n.indexOf(i))||t))){var r=this.getSelectedAppointments();return r.length>0?this.parent.activeEventData&&this.parent.activeEventData.element&&r.indexOf(this.parent.activeEventData.element)>-1?void this.parent.activeEventData.element.focus():void r[r.length-1].focus():void 0}if(this.parent.keyboardInteractionModule){var a=!(0,e.isNullOrUndefined)(this.parent.activeCellsData)&&this.parent.activeCellsData.element||n[n.length-1];this.parent.keyboardInteractionModule.selectCells(a instanceof Array,a)}}},t.prototype.selectWorkCellByTime=function(t){var i;if("Agenda"===this.parent.currentView||"MonthAgenda"===this.parent.currentView)return i;if(t.length>0){var n=t[t.length-1],r=n[this.parent.eventFields.startTime],a=void 0,s=this.isAllDayAppointment(n);a="Month"===this.parent.currentView||s||!this.parent.activeViewOptions.timeScale.enable?new Date(+r).setHours(0,0,0,0):this.findNearestSlot(r);var o=void 0;o=s&&-1!==["Day","Week","WorkWeek"].indexOf(this.parent.currentView)?this.parent.getAllDayRow():this.parent.getContentTable();var l='[data-date="'+new Date(a).getTime()+'"]';if(!(0,e.isNullOrUndefined)(this.parent.activeViewOptions.group.resources)&&this.parent.activeViewOptions.group.resources.length>0&&(l+='[data-group-index="'+this.getGroupIndexFromEvent(n)+'"]'),i=o.querySelector(l))return this.parent.activeCellsData=this.parent.getCellDetails(i),this.parent.keyboardInteractionModule&&this.parent.keyboardInteractionModule.selectCells(!1,i),i}return i},t.prototype.findNearestSlot=function(e){var t=this.parent.activeViewOptions.timeScale.interval*ne/this.parent.activeViewOptions.timeScale.slotCount,i=Math.round(ie/t),n=new Date(e);n.setHours(0,0,0,0);var r=Array.from({length:i},(function(e,i){return new Date(n.getTime()+i*t)})).reduce((function(t,i){var n=Math.abs(e.getTime()-i.getTime());return!t||n<Math.abs(e.getTime()-t.getTime())?i:t}),null);return 1e3*Math.trunc(r.getTime()/1e3)},t.prototype.getGroupIndexFromEvent=function(t){for(var i,n,r,a,s=this.parent.resourceBase.resourceCollection.length-1;s>=0;s--){var o=t[this.parent.resourceBase.resourceCollection[parseInt(s.toString(),10)].field];if(!(0,e.isNullOrUndefined)(o)){n=this.parent.resourceBase.resourceCollection[parseInt(s.toString(),10)],i=s,r=n.name,a=n.field;break}}(0,e.isNullOrUndefined)(r)&&(0,e.isNullOrUndefined)(i)&&(r=this.parent.resourceCollection.slice(-1)[0].name,i=this.parent.resourceCollection.length-1,a=this.parent.resourceCollection.slice(-1)[0].field,n=this.parent.resourceCollection.filter((function(e,t){return e.name===r?(i=t,e):null}))[0]);var l=t[""+a]instanceof Array?t[""+a][0]:t[""+a];if(i>0){var p=this.parent.resourceCollection[i-1].field;return this.parent.resourceBase.getIndexFromResourceId(l,r,n,t,p)}return this.parent.resourceBase.getIndexFromResourceId(l,r,n)},t.prototype.isAllDayAppointment=function(e){var t=this.parent.eventFields,i=e[t.isAllDay],n=(Re(e[t.endTime])-Re(e[t.startTime]))/ie>=1;return!!(i||"TimeSlot"!==this.parent.eventSettings.spannedEventPlacement&&n)},t.prototype.addEventListener=function(){this.parent.on(Z,this.appointmentBorderRemove,this)},t.prototype.removeEventListener=function(){this.parent.off(Z,this.appointmentBorderRemove)},t.prototype.appointmentBorderRemove=function(t){var i=t.event.target;if((0,e.closest)(i,"."+Xt))"MonthAgenda"!==this.parent.currentView&&this.parent.removeSelectedClass();else if(!(0,e.closest)(i,"."+tt)){if(this.parent.uiStateValues.isTapHold&&(0,e.closest)(i,"."+$e+",."+Ke))return;this.parent.uiStateValues.isTapHold=!1,this.removeSelectedAppointmentClass(),this.parent.selectedElements=[]}},t.prototype.wireAppointmentEvents=function(t,i,n){void 0===n&&(n=!1);var r=!(0,e.isNullOrUndefined)(i)&&i[this.parent.eventFields.isReadonly];e.EventHandler.add(t,"click",this.eventClick,this),this.parent.isAdaptive||this.parent.activeViewOptions.readonly||r||(e.EventHandler.add(t,"touchend",this.eventTouchClick,this),e.EventHandler.add(t,"dblclick",this.eventDoubleClick,this)),this.parent.activeViewOptions.readonly||r||n||(this.parent.resizeModule&&this.parent.resizeModule.wireResizeEvent(t),this.parent.dragAndDropModule&&this.parent.dragAndDropModule.wireDragEvent(t))},t.prototype.eventTouchClick=function(e){var t=this;this.parent.uiStateValues.isTouchScroll||this.parent.uiStateValues.isTapHold||this.parent.uiStateValues.action?this.parent.uiStateValues.isTouchScroll=this.parent.uiStateValues.isTapHold=!1:(setTimeout((function(){return t.isDoubleTapped=!1}),250),e.preventDefault(),this.isDoubleTapped?this.eventDoubleClick(e):this.isDoubleTapped||(this.isDoubleTapped=!0,this.eventClick(e)))},t.prototype.renderResizeHandler=function(t,i,n){if(this.parent.resizeModule&&this.parent.allowResizing&&!this.parent.activeViewOptions.readonly&&!n)for(var r=0,a=Object.keys(i);r<a.length;r++){var s=a[r],o=(0,e.createElement)("div",{className:Ei});switch(s){case"isLeft":i.isLeft||(o.appendChild((0,e.createElement)("div",{className:"e-left-right-resize"})),(0,e.addClass)([o],this.parent.enableRtl?Ai:Vi),(0,e.prepend)([o],t));break;case"isRight":i.isRight||(o.appendChild((0,e.createElement)("div",{className:"e-left-right-resize"})),(0,e.addClass)([o],this.parent.enableRtl?Vi:Ai),(0,e.append)([o],t));break;case"isTop":i.isTop||(o.appendChild((0,e.createElement)("div",{className:"e-top-bottom-resize"})),(0,e.addClass)([o],Ii),(0,e.prepend)([o],t));break;case"isBottom":i.isBottom||(o.appendChild((0,e.createElement)("div",{className:"e-top-bottom-resize"})),(0,e.addClass)([o],Mi),(0,e.append)([o],t))}}},t.prototype.eventClick=function(t){var i=this,n=t.target;if(!(n.classList.contains(Oi)||n.classList.contains(xi)||n.classList.contains(dr)))if((t.ctrlKey||t.metaKey)&&1===t.which&&this.parent.keyboardInteractionModule){this.parent.quickPopup.quickPopup.hide(),this.parent.selectedElements=[].slice.call(this.parent.element.querySelectorAll("."+Zt));var r=(0,e.closest)(t.target,"."+Xt);this.getSelectedEventElements(r),this.activeEventData(t,!1);var a={data:this.parent.activeEventData.event,element:this.parent.activeEventData.element,event:t,requestType:"eventSelect"};this.parent.trigger(o,a);var s=(0,e.extend)(this.parent.activeEventData,{cancel:!1,originalEvent:t});this.parent.trigger(m,s)}else{this.removeSelectedAppointmentClass(),this.activeEventData(t,!0);var l={data:this.parent.activeEventData.event,element:this.parent.activeEventData.element,event:t,requestType:"eventSelect"};this.parent.trigger(o,l);s=(0,e.extend)(this.parent.activeEventData,{cancel:!1,originalEvent:t});this.parent.trigger(m,s,(function(t){if(t.cancel)i.removeSelectedAppointmentClass(),i.parent.selectedElements=[],i.parent.quickPopup&&i.parent.quickPopup.quickPopupHide();else if("Agenda"!==i.parent.currentView&&"MonthAgenda"!==i.parent.currentView||(0,e.addClass)([i.parent.activeEventData.element],li),i.parent.allowInline){var n={data:t.event,element:t.element,type:"Event"};i.parent.notify(A,n)}else i.parent.notify(m,t)}))}},t.prototype.eventDoubleClick=function(t){var i=this;if(this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide(!0),"touchend"===t.type&&this.activeEventData(t,!0),this.removeSelectedAppointmentClass(),this.parent.selectedElements=[],!this.parent.activeEventData.element.classList.contains(ur)&&!this.parent.activeEventData.element.querySelector("."+dr)){var n=(0,e.extend)(this.parent.activeEventData,{cancel:!1,originalEvent:t});this.parent.trigger(f,n,(function(t){t.cancel||(!(0,e.isNullOrUndefined)(i.parent.activeEventData.event)&&(0,e.isNullOrUndefined)(i.parent.activeEventData.event[i.parent.eventFields.recurrenceID])?i.parent.eventWindow.openEditor(i.parent.activeEventData.event,"Save"):(i.parent.currentAction="EditOccurrence",i.parent.quickPopup.openRecurrenceAlert()))}))}},t.prototype.getEventByGuid=function(e){return this.parent.eventsProcessed.filter((function(t){return t.Guid===e}))[0]},t.prototype.getEventById=function(e){var t=this;return this.parent.eventsData.filter((function(i){return i[t.parent.eventFields.id]===e}))[0]},t.prototype.generateGuid=function(){return"xyxxxxyx-xxxy-yxxx-xyxx-xxyxxxxyyxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))},t.prototype.getEventIDType=function(){return 0!==this.parent.eventsData.length?typeof this.parent.eventsData[0][this.parent.eventFields.id]:0!==this.parent.blockData.length?typeof this.parent.blockData[0][this.parent.eventFields.id]:"string"},t.prototype.getEventMaxID=function(t){var i,n=this;if(this.parent.eventsData.length<1&&this.parent.blockData.length<1)return 1;var r=this.getEventIDType();if("string"===r&&(i=this.generateGuid()),"number"===r){var a=this.parent.eventsData.concat(this.parent.blockData).map((function(e){return e[n.parent.eventFields.id]})).reduce((function(e,t){return Math.max(e,t)}));i=(a=(0,e.isNullOrUndefined)(t)?a:a+t)+1}return i},t.prototype.activeEventData=function(t,i){var n=this,r=(0,e.closest)(t.target,"."+Xt),a=r.getAttribute("data-guid");i&&(this.addSelectedAppointments([].slice.call(this.parent.element.querySelectorAll('div[data-guid="'+a+'"]')),!0),r.focus());var s=this.getEventByGuid(a);s&&s.isSpanned&&(s=this.parent.eventsData.filter((function(e){return e[n.parent.eventFields.id]===s[n.parent.eventFields.id]}))[0]),this.parent.activeEventData={event:s,element:r}},t.prototype.generateOccurrence=function(t,i,n){var r=this,a=t[this.parent.eventFields.startTime],s=t[this.parent.eventFields.endTime],o=t[this.parent.eventFields.recurrenceRule],l=s.getTimezoneOffset()-a.getTimezoneOffset(),p=s.getTime()-a.getTime()-6e4*l;i=new Date((i||this.parent.activeView.startDate()).getTime()-p);var c,h=t[this.parent.eventFields.recurrenceException];"Agenda"!==this.parent.currentView&&n&&(c=fe(i,this.parent.activeView.endDate())+1);var d=this.parent.timezone||this.parent.tzModule.getLocalTimezoneName(),u=this.parent.activeViewOptions.firstDayOfWeek,g=this.parent.calendarMode;t[this.parent.eventFields.recurrenceRule]&&this.isDayBasedRecurrence(t)&&this.parent.timezone&&t[this.parent.eventFields.startTimezone]&&t[this.parent.eventFields.endTimezone]&&(a=this.parent.tzModule.convert(t[this.parent.eventFields.startTime],this.parent.timezone,t[this.parent.eventFields.startTimezone]));var v=Mr(a,o,h,u,c,i,g,d);"Agenda"===this.parent.currentView&&-1===o.indexOf("COUNT")&&-1===o.indexOf("UNTIL")&&((0,e.isNullOrUndefined)(t.generatedDates)?t.generatedDates={start:new Date(v[0]),end:new Date(v[v.length-1])}:(v[0]<t.generatedDates.start.getTime()&&(t.generatedDates.start=new Date(v[0])),v[v.length-1]>t.generatedDates.end.getTime()&&(t.generatedDates.end=new Date(v[v.length-1]))));var m=!1,f=[];t[this.parent.eventFields.recurrenceRule]&&this.isDayBasedRecurrence(t)&&this.parent.timezone&&t[this.parent.eventFields.startTimezone]&&t[this.parent.eventFields.endTimezone]&&(m=!0,f.push.apply(f,v.map((function(e){return r.parent.tzModule.convert(new Date(e),t[r.parent.eventFields.startTimezone],r.parent.timezone).getTime()}))));for(var y=[],T=0,w=f=f.length>0?f:v;T<w.length;T++){var D=w[T],b=(0,e.extend)({},t,null,!0);D=m?D:this.getDSTAdjustedTime(D,b),b[this.parent.eventFields.startTime]=new Date(D),b[this.parent.eventFields.endTime]=new Date(new Date(D).setMilliseconds(p)),b[this.parent.eventFields.recurrenceID]=b[this.parent.eventFields.id],delete b[this.parent.eventFields.recurrenceException],delete b[this.parent.eventFields.followingID],b.Guid=this.generateGuid(),y.push(b)}return y},t.prototype.isDayBasedRecurrence=function(e){return e[this.parent.eventFields.recurrenceRule].includes("BYMONTHDAY")||e[this.parent.eventFields.recurrenceRule].includes("BYDAY")},t.prototype.getDSTAdjustedTime=function(e,t){var i=e;if(this.parent.timezone&&(t[this.parent.eventFields.startTimezone]||t[this.parent.eventFields.endTimezone])){var n=this.getDSTDiff(t[this.parent.eventFields.startTime],new Date(e),t[this.parent.eventFields.startTimezone]),r=this.getDSTDiff(t[this.parent.eventFields.startTime],new Date(e),this.parent.timezone);i=new Date(e).getTime()-6e4*(n-r)}return i},t.prototype.getDSTDiff=function(e,t,i){return this.parent.tzModule.offset(new Date(e),i)-this.parent.tzModule.offset(new Date(t),i)},t.prototype.getParentEvent=function(t,i){var n;void 0===i&&(i=!1);do{(t=this.getFollowingEvent(t))&&(n=(0,e.extend)({},t,null,!0))}while(t&&i);if(i&&n){var r=this.getEventCollections(n),a=r.follow.slice(-1)[0];r.occurrence.length>0&&!n[this.parent.eventFields.recurrenceException]&&(a=r.occurrence.slice(-1)[0]),a&&(n[this.parent.eventFields.recurrenceRule]=a[this.parent.eventFields.recurrenceRule])}return n},t.prototype.getEventCollections=function(e,t){var i=[],n=[],r=e;do{(r=this.getFollowingEvent(r,!0))&&i.push(r),n=n.concat(this.getOccurrenceEvent(r||e))}while(r);var a={};if(t){var s=this.parent.eventFields;a={follow:i.filter((function(e){return e[s.startTime]>=t[s.startTime]})),occurrence:n.filter((function(e){return e[s.startTime]>=t[s.startTime]}))}}else a={follow:i,occurrence:n};return a},t.prototype.getFollowingEvent=function(e,t){var i,n=this.parent.eventFields;return i=t?e[n.id]:e[n.recurrenceID]||e[n.followingID],this.parent.eventsData.filter((function(e){return e[t?n.followingID:n.id]===i})).shift()},t.prototype.isFollowingEvent=function(e,t){var i=e[this.parent.eventFields.startTime],n=t[this.parent.eventFields.startTime];return i.getHours()===n.getHours()&&i.getMinutes()===n.getMinutes()&&i.getSeconds()===n.getSeconds()},t.prototype.getOccurrenceEvent=function(e,t,i){void 0===t&&(t=!1),void 0===i&&(i=!1);var n=t?"Guid":i?this.parent.eventFields.followingID:this.parent.eventFields.recurrenceID,r=t?"Guid":this.parent.eventFields.id;return(t?this.parent.eventsProcessed:this.parent.eventsData).filter((function(t){return t[""+n]===e[""+r]}))},t.prototype.getOccurrencesByID=function(t){for(var i=this.parent.eventFields,n=[],r=0,a=this.parent.eventsData.filter((function(e){return e[i.id]===t}));r<a.length;r++){var s=a[r];(0,e.isNullOrUndefined)(s[i.recurrenceRule])||(n=n.concat(this.generateOccurrence(s)))}return n},t.prototype.getOccurrencesByRange=function(t,i){for(var n=this.parent.eventFields,r=[],a=0,s=this.parent.eventsData;a<s.length;a++){var o=s[a];(0,e.isNullOrUndefined)(o[n.recurrenceRule])||(r=r.concat(this.generateOccurrence(o)))}return r.filter((function(r){return r[n.startTime]>=t&&r[n.endTime]<=i&&!(0,e.isNullOrUndefined)(r[n.recurrenceID])}))},t.prototype.getDeletedOccurrences=function(t){var i,n=this.parent.eventFields,r=[];if((i="string"==typeof t||"number"==typeof t?this.parent.eventsData.filter((function(e){return e[n.id]===t}))[0]:(0,e.extend)({},t,null,!0))[n.recurrenceException])for(var a=i[n.recurrenceException].split(","),s=function(s,l){if(0===o.parent.eventsData.filter((function(e){return e[n.recurrenceID]===i[n.id]&&e[n.recurrenceException]===a[parseInt(s.toString(),10)]})).length){var p=kr(a[parseInt(s.toString(),10)]),c=(0,e.extend)({},t,null,!0);c[n.recurrenceID]=i[n.id],delete c[n.followingID],c[n.recurrenceException]=a[parseInt(s.toString(),10)];var h=new Date(p.getTime()),d=i[n.endTime].getTime()-i[n.startTime].getTime(),u=new Date(h.getTime());u.setMilliseconds(d),c[n.startTime]=new Date(h.getTime()),c[n.endTime]=new Date(u.getTime()),r.push(c)}},o=this,l=0,p=a.length;l<p;l++)s(l);return r},t.prototype.applyResourceColor=function(t,i,n,r,a){if(this.parent.resourceBase){var s=this.parent.resourceBase.getResourceColor(i,r);s&&(t.style[n]=(0,e.isNullOrUndefined)(a)?s:function(e,t){return e=e.replace("#",""),"rgba("+parseInt(e.substring(0,e.length/3),16)+", "+parseInt(e.substring(e.length/3,2*e.length/3),16)+", "+parseInt(e.substring(2*e.length/3,3*e.length/3),16)+", "+t+")"}(s,a))}},t.prototype.createBlockAppointmentElement=function(t,i,n){var r,a=t[this.parent.eventFields.subject]||this.parent.eventSettings.fields.subject.default,s=(0,e.createElement)("div",{className:Qt,attrs:{"data-id":"Appointment_"+t[this.parent.eventFields.id],"aria-disabled":"true"}});if((0,e.isNullOrUndefined)(this.parent.activeViewOptions.eventTemplate)){var o=(0,e.createElement)("div",{className:Cn});this.parent.sanitize(a,o),r=[o]}else{var l=this.parent.element.id+"_"+this.parent.activeViewOptions.eventTemplateName+"eventTemplate",p=n&&-1===this.parent.currentView.indexOf("Year")?this.parent.getEventTemplateName(i):"eventTemplate";r=this.parent.getAppointmentTemplate()(t,this.parent,p,l,!1,void 0,void 0,this.parent.root)}return(0,e.append)(r,s),this.setWrapperAttributes(s,i),s},t.prototype.setWrapperAttributes=function(t,i){(0,e.isNullOrUndefined)(this.cssClass)||(0,e.addClass)([t],this.cssClass),this.parent.activeViewOptions.group.resources.length>0&&t.setAttribute("data-group-index",i.toString())},t.prototype.getReadonlyAttribute=function(e){return(e[this.parent.eventFields.isReadonly]||this.parent.readonly).toString()},t.prototype.isBlockRange=function(t){for(var i=t instanceof Array?t:[t],n=!1,r=this.parent.eventFields,a=0,s=i;a<s.length;a++){var o=s[a],l=[];(0,e.isNullOrUndefined)(o[r.recurrenceRule])||!(0,e.isNullOrUndefined)(o[r.recurrenceID])&&o[r.id]!==o[r.recurrenceID]?l.push(o):l=this.generateOccurrence(o);for(var p=0,c=l;p<c.length;p++){var h=c[p];if(this.filterBlockEvents(h).length>0){n=!0;break}}}return this.parent.uiStateValues.isBlock=n,n},t.prototype.getFilterEventsList=function(e,t){return new Sr.DataManager(e).executeLocal((new Sr.Query).where(t))},t.prototype.getSeriesEvents=function(t,i){var n,r,a=this.parent.eventFields;i=(0,e.isNullOrUndefined)(i)?t[a.startTime]:i;var s,o=[],l=t[a.id],p=t[a.followingID],c="EditSeries"===this.parent.currentAction?"greaterthan":"greaterthanorequal";do{s=new Sr.Predicate(a.followingID,"equal",l).and(new Sr.Predicate(a.startTime,c,i)),n=(r=this.getFilterEventsList(this.parent.eventsData,s)).slice(-1)[0],(0,e.isNullOrUndefined)(n)||n[a.id]===p?p=null:(o.push(n),l=n[a.id],p=n[a.followingID])}while(1===r.length&&!(0,e.isNullOrUndefined)(n[a.followingID]));return o},t.prototype.getEditedOccurrences=function(e,t){for(var i,n=this.parent.eventFields,r=[],a=0,s=e;a<s.length;a++){var o=s[a],l=new Sr.Predicate(n.recurrenceID,"equal",o[n.id]).or(new Sr.Predicate(n.recurrenceID,"equal",o[n.followingID]).and(new Sr.Predicate(n.recurrenceID,"notequal",void 0)).and(new Sr.Predicate(n.recurrenceID,"notequal",null)));"EditFollowingEvents"!==this.parent.currentAction&&"DeleteFollowingEvents"!==this.parent.currentAction||(l=l.and(new Sr.Predicate(n.startTime,"greaterthanorequal",t))),i=this.getFilterEventsList(this.parent.eventsData,l),r=r.concat(i)}return r},t.prototype.getRenderedDates=function(t){var i,n=0,r=t.length,a=(0,e.isNullOrUndefined)(this.parent.maxDate)?new Date(2099,11,31):this.parent.maxDate,s=(0,e.isNullOrUndefined)(this.parent.minDate)?new Date(1900,0,1):this.parent.minDate;if(t[0]<s&&t[t.length-1]>a){for(var o=0;o<t.length;o++)ve(t[parseInt(o.toString(),10)]).getTime()===ve(new Date(s)).getTime()&&(n=o),ve(t[parseInt(o.toString(),10)]).getTime()===ve(new Date(a)).getTime()&&(r=o);i=t.filter((function(e){return e>=t[parseInt(n.toString(),10)]&&e<=t[parseInt(r.toString(),10)]}))}return i},t.prototype.isValidEvent=function(e,t,i,n){var r=i.getTime()>n.startHour.getTime()&&t.getTime()<n.endHour.getTime(),a=n.startHour.getTime()<=t.getTime()&&e[this.parent.eventFields.startTime].getTime()>=n.startHour.getTime()&&e[this.parent.eventFields.endTime].getTime()<n.endHour.getTime()&&t.getTime()===i.getTime();return r||a},t.prototype.allDayExpandScroll=function(t){var i=0;[].slice.call(this.parent.element.querySelectorAll("."+Hi)).forEach((function(e){[].slice.call(e.children).forEach((function(e){e.style.top=i+"px"})),i+=e.offsetHeight})),i=t.offsetHeight-i,this.parent.element.querySelector("."+Ke).style.height=i/12+"em",this.parent.uiStateValues.expand?(0,e.addClass)([t],vr):(0,e.removeClass)([t],vr)},t.prototype.updateEventMinimumDuration=function(e,t,i){if((t.getTime()<i.getTime()||t.getTime()===i.getTime()&&e.startHour.getTime()<i.getTime()&&e.endHour.getTime()>t.getTime()&&-1===this.parent.currentView.indexOf("Timeline"))&&(Re(i)-Re(t))/ne<this.parent.eventSettings.minimumEventDuration){var n=new Date(t);if(n.setMinutes(n.getMinutes()+this.parent.eventSettings.minimumEventDuration),(i=n).getTime()>e.endHour.getTime()){var r=new Date(e.endHour.getTime());r.setMinutes(r.getMinutes()-this.parent.eventSettings.minimumEventDuration),t=r,i=e.endHour}}return{startDate:t,endDate:i}},t.prototype.createEventWrapper=function(t,i){void 0===t&&(t=""),void 0===i&&(i=0);for(var n=(0,e.createElement)("tr"),r=this.parent.activeView.colLevels.slice(-1)[0],a=this.parent.isReact&&this.parent.activeViewOptions.eventTemplate?" "+Nt:"",s=0,o=r.length;s<o;s++){var l=r[parseInt(s.toString(),10)],p=(0,e.createElement)("td",{className:"allDay"===t?Pi+a:"timeIndicator"===t?Pt:Lt+a,attrs:{"data-date":l.date.getTime().toString()}});if((0,e.isNullOrUndefined)(l.groupIndex)||p.setAttribute("data-group-index",l.groupIndex.toString()),""===t){var c=(0,e.createElement)("div",{id:jt+"-"+i.toString(),className:jt});p.appendChild(c)}n.appendChild(p),i+=1}return n},t.prototype.getPageCoordinates=function(t){if((0,e.isNullOrUndefined)(t))return t;var i=t.event;return i&&i.changedTouches?i.changedTouches[0]:t.changedTouches?t.changedTouches[0]:i||t},t.prototype.renderSpannedIcon=function(t,i){var n=(0,e.createElement)("div",{className:yi+" "+Ye});if(i.isLeft){var r=n.cloneNode();(0,e.addClass)([r],Ti),(0,e.prepend)([r],t)}if(i.isRight){var a=n.cloneNode();(0,e.addClass)([a],wi),(0,e.append)([a],t)}if(i.isTop){var s=n.cloneNode();(0,e.addClass)([s],"e-up-icon"),(0,e.prepend)([s],t)}if(i.isBottom){var o=n.cloneNode();(0,e.addClass)([o],"e-down-icon"),(0,e.append)([o],t)}},t.prototype.addCellHeight=function(t,i,n,r,a,s){if(void 0===s&&(s=!0),this.parent.activeViewOptions.maxEventsPerRow&&!this.parent.rowAutoHeight){for(var o=[].slice.call(this.parent.element.querySelectorAll(t)),l=this.parent.showWeekNumber?[].slice.call(this.parent.element.querySelectorAll("."+Wt+" tbody tr")):[],p=0,c=o;p<c.length;p++){var h=c[p],d=this.parent.activeViewOptions.maxEventsPerRow*(i+("Month"===this.parent.currentView?n:2))+r+a;l.length>0&&(0,e.setStyleAttribute)(l[o.indexOf(h)].firstElementChild,{height:d+"px"}),(0,e.setStyleAttribute)(h.firstElementChild,{height:d+"px"})}this.parent.enablePersistence||this.parent.activeViewOptions.allowVirtualScrolling||!s||this.parent.notify(_,{})}},t.prototype.unWireEvents=function(){for(var t=0,i=[].slice.call(this.parent.element.querySelectorAll("."+Xt));t<i.length;t++){var n=i[t];e.EventHandler.clearEvents(n)}},t.prototype.destroy=function(){this.unWireEvents(),this.parent=null},t}(),Ia=(Va=function(e,t){return Va=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},Va(e,t)},function(e,t){function i(){this.constructor=e}Va(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),Ma=function(t){function i(i){var n=t.call(this,i)||this;return n.dateRender=[],n.renderedEvents=[],n.renderedAllDayEvents=[],n.overlapEvents=[],n.moreEvents=[],n.overlapList=[],n.allDayEvents=[],n.slotCount=n.parent.activeViewOptions.timeScale.slotCount,n.interval=n.parent.activeViewOptions.timeScale.interval,n.allDayLevel=0,n.startHour=n.getStartEndHours(n.parent.activeViewOptions.startHour),n.endHour=n.getStartEndHours(n.parent.activeViewOptions.endHour),n.element=n.parent.activeView.getPanel(),n.fields=n.parent.eventFields,n.animation=new e.Animation({progress:n.animationUiUpdate.bind(n)}),n.addEventListener(),n}return Ia(i,t),i.prototype.renderAppointments=function(){var t=this;if(!(0,e.isNullOrUndefined)(this.parent)){this.parent.dragAndDropModule&&this.parent.dragAndDropModule.setDragArea(),this.isResourceEventTemplate=this.parent.isSpecificResourceEvents();for(var i=[].slice.call(this.parent.element.querySelectorAll("."+Qt+",."+Xt+",."+Li)),n=!(!this.parent.crudModule||!this.parent.crudModule.crudObj.isCrudAction),r=function(i){if(t.parent.isReact&&!(0,e.isNullOrUndefined)(t.parent.activeViewOptions.eventTemplate)){var n=(0,e.closest)(i,"."+Lt+",."+Pi);n&&!n.classList.contains(Nt)&&(0,e.addClass)([n],Nt)}},a=0,s=i;a<s.length;a++){var o=s[a];if(!n||o.classList.contains(ji)||o.classList.contains(Li))r(o),(0,e.remove)(o);else for(var l=parseInt(o.getAttribute("data-group-index"),10),p=0,c=this.parent.crudModule.crudObj.sourceEvent.length;p<c;p++)l!==this.parent.crudModule.crudObj.sourceEvent[parseInt(p.toString(),10)].groupIndex&&l!==this.parent.crudModule.crudObj.targetEvent[parseInt(p.toString(),10)].groupIndex||(r(o),(0,e.remove)(o))}if(this.element.querySelector("."+$e)&&(this.parent.virtualScrollModule&&this.parent.virtualScrollModule.updateFocusedWorkCell(),this.allDayElement=[].slice.call(this.element.querySelectorAll("."+Ke)),this.setAllDayRowHeight(0),0!==this.parent.eventsProcessed.length||0!==this.parent.blockProcessed.length)){var h=this.element.querySelector("."+qi);e.EventHandler.remove(h,"click",this.rowExpandCollapse),e.EventHandler.add(h,"click",this.rowExpandCollapse,this),this.renderedEvents=[],this.renderedAllDayEvents=[],this.initializeValues(),this.processBlockEvents(),this.renderEvents("normalEvents"),this.allDayEvents.length>0&&(this.allDayEvents=this.allDayEvents.filter((function(e,t,i){return t===i.map((function(e){return e.Guid})).indexOf(e.Guid)})),(0,e.removeClass)(this.allDayElement,Gn),this.slots.push(this.parent.activeView.renderDates.map((function(e){return+e}))),this.renderEvents("allDayEvents"),this.animation.animate(this.allDayElement[0])),this.parent.notify(_,{}),(0,e.addClass)(this.allDayElement,Gn),n&&(this.parent.crudModule.crudObj.isCrudAction=!1),this.parent.renderTemplates((function(){if(t.parent&&t.parent.isReact&&t.parent.activeViewOptions.eventTemplate){var i=[].slice.call(t.parent.element.querySelectorAll("."+Nt));(0,e.removeClass)(i,Nt)}}))}}},i.prototype.initializeValues=function(){if(this.resources=this.parent.activeViewOptions.group.resources.length>0?this.parent.uiStateValues.isGroupAdaptive?[this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]]:this.parent.resourceBase.lastResourceLevel:[],this.resources.length>0&&this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.virtualScrollModule&&(this.resources=this.parent.resourceBase.renderedResources),this.cellHeight=parseFloat(this.parent.getElementHeight(this.parent.element.querySelector(".e-content-wrap tbody tr")).toFixed(2)),this.dateRender[0]=this.parent.activeView.renderDates,this.parent.activeViewOptions.group.resources.length>0)for(var e=0,t=this.resources.length;e<t;e++)this.dateRender[parseInt(e.toString(),10)]=this.resources[parseInt(e.toString(),10)].renderDates},i.prototype.getHeight=function(e,t){var i=(Re(t)-Re(e))/ne*(this.cellHeight*this.slotCount)/this.interval;return i=i<=0?this.cellHeight:i},i.prototype.appendEvent=function(t,i,n,r){var a=this.element.querySelector("."+jt+'[id="'+jt+"-"+n+'"]');this.parent.enableRtl?(0,e.setStyleAttribute)(i,{right:r}):(0,e.setStyleAttribute)(i,{left:r});var s=i.classList.contains(Qt)?"blockEvent":"event",o={data:(0,e.extend)({},t,null,!0),element:i,cancel:!1,type:s};this.parent.trigger(y,o,(function(e){e.cancel||a.appendChild(i)}))},i.prototype.processBlockEvents=function(){for(var e=this.getResourceList(),t=this.getStartCount(),i=0,n=e;i<n.length;i++)for(var r=n[i],a=this.dateRender[parseInt(r.toString(),10)],s=0,o=a.length;s<o;s++){for(var l=new Date(a[parseInt(s.toString(),10)].getTime()),p=ve(ye(a[parseInt(s.toString(),10)],1)),c=0,h=this.filterEvents(l,p,this.parent.blockProcessed,this.resources[parseInt(r.toString(),10)]);c<h.length;c++){var d=h[c];this.parent.resourceBase&&this.setValues(d,r),this.renderBlockEvents(d,s,r,t),this.cssClass=null,this.groupOrder=null}t+=1}},i.prototype.renderBlockEvents=function(t,i,n,r){var a=this.isSpannedEvent(t,i,n),s=a[this.fields.startTime],o=a[this.fields.endTime],l=De(ve(new Date(this.dateRender[parseInt(n.toString(),10)][parseInt(i.toString(),10)].getTime())),this.startHour,this.endHour);if(s<=o&&this.isValidEvent(t,s,o,l)&&this.isWorkDayAvailable(n,s)){var p=void 0,c=void 0;if(a[this.fields.isAllDay]){var h=this.parent.element.querySelector("."+ri+" table");c=(0,e.formatUnit)(h.offsetHeight),p=(0,e.formatUnit)(0)}else c=(0,e.formatUnit)(this.getHeight(s,o)),p=(0,e.formatUnit)(this.getTopValue(s));var d=this.createBlockAppointmentElement(t,n,this.isResourceEventTemplate);(0,e.setStyleAttribute)(d,{width:"100%",height:c,top:p});var u=this.getDayIndex(i,n,r);this.appendEvent(t,d,u,"0px")}},i.prototype.renderEvents=function(t){(0,e.removeClass)(this.allDayElement,Gn);for(var i,n="allDayEvents"===t?this.sortByDateTime(this.allDayEvents):void 0,r=this.getResourceList(),a=this.getStartCount(),s="allDayEvents"===t?this.parent.getElementHeightFromClass(this.element.querySelector("."+Pi),Xt):0,o="allDayEvents"===t&&this.allDayElement.length>0?this.allDayElement[0].offsetTop:0,l=function(r){i=!0,p.parent.crudModule&&p.parent.crudModule.crudObj.isCrudAction&&"allDayEvents"!==t&&!p.parent.uiStateValues.isGroupAdaptive&&0===p.parent.crudModule.crudObj.sourceEvent.filter((function(e){return e.groupIndex===r})).length&&0===p.parent.crudModule.crudObj.targetEvent.filter((function(e){return e.groupIndex===r})).length&&(i=!1),p.slots=[];var l=p.dateRender[parseInt(r.toString(),10)],c=p.getRenderedDates(l)||l;p.slots.push(l.map((function(e){return+e})));for(var h=0,d=l.length;h<d&&l[parseInt(h.toString(),10)]<=c[c.length-1];h++){p.renderedEvents=[];var u=new Date(l[parseInt(h.toString(),10)].getTime()),g=ve(ye(l[parseInt(h.toString(),10)],1)),v=p.filterEvents(u,g,n,p.resources[parseInt(r.toString(),10)]);if(i)for(var m=0,f=v;m<f.length;m++){var y=f[m];if(p.parent.resourceBase&&p.setValues(y,r),"allDayEvents"===t)p.renderAllDayEvents(y,h,r,a,!1,o,s);else if(p.isAllDayAppointment(y))p.allDayEvents.push((0,e.extend)({},y,null,!0));else{if(p.parent.eventSettings.enableMaxHeight&&p.getOverlapIndex(y,h,!1,r)>0)continue;p.renderNormalEvents(y,h,r,a)}p.cssClass=null,p.groupOrder=null}else for(var T=0,w=v;T<w.length;T++){var D=w[T];p.isAllDayAppointment(D)&&p.allDayEvents.push((0,e.extend)({},D,null,!0))}a+=1}},p=this,c=0,h=r;c<h.length;c++){l(h[c])}},i.prototype.getStartCount=function(){return this.parent.virtualScrollModule&&this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.timeScale.enable?parseInt(this.element.querySelector("."+jt).getAttribute("id").split("-").slice(-1)[0],10):0},i.prototype.getDayIndex=function(e,t,i){var n=this;if(!this.parent.activeViewOptions.group.byDate)return i;if(this.parent.activeViewOptions.group.byDate&&!this.parent.activeViewOptions.group.hideNonWorkingDays){var r=this.parent.resourceBase.lastResourceLevel[0].renderDates.indexOf(this.dateRender[parseInt(t.toString(),10)][parseInt(e.toString(),10)]);return this.resources.length*r+t}for(var a=0,s=this.parent.activeView.colLevels[0],o=this.dateRender[parseInt(t.toString(),10)][parseInt(e.toString(),10)].getTime(),l=[],p=0;p<s.length&&(l=this.parent.resourceBase.resourceDateTree[parseInt(p.toString(),10)],o!==s[parseInt(p.toString(),10)].date.getTime());p++)a+=s[parseInt(p.toString(),10)].colSpan;var c=l.findIndex((function(e){return e.groupOrder.toString()===n.resources[parseInt(t.toString(),10)].groupOrder.toString()}));return c<0?a:a+c},i.prototype.setValues=function(e,t){this.parent.activeViewOptions.group.resources.length>0?(this.cssClass=this.resources[parseInt(t.toString(),10)].cssClass,this.groupOrder=this.resources[parseInt(t.toString(),10)].groupOrder):this.cssClass=this.parent.resourceBase.getCssClass(e)},i.prototype.getResourceList=function(){return Array.apply(null,{length:this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive?this.resources.length:1}).map((function(e,t){return t}))},i.prototype.createAppointmentElement=function(t,i,n,r){var a=this.parent.eventFields,s=t[a.subject]||this.parent.eventSettings.fields.subject.default||this.parent.localeObj.getConstant("addTitle"),o=(0,e.createElement)("div",{className:Xt,attrs:{"data-id":"Appointment_"+t[a.id],"data-guid":t.Guid,role:"button",tabindex:"0","aria-disabled":this.parent.eventBase.getReadonlyAttribute(t),"aria-label":this.parent.getAnnouncementString(t)}});t[this.fields.isReadonly]&&(0,e.addClass)([o],"e-read-only");var l,p=(0,e.createElement)("div",{className:Jt});if(o.appendChild(p),this.parent.activeViewOptions.group.resources.length>0){var c=this.parent.uiStateValues.isGroupAdaptive?this.parent.uiStateValues.groupIndex:r;o.setAttribute("data-group-index",c.toString())}var h=n;if((0,e.isNullOrUndefined)(this.parent.activeViewOptions.eventTemplate)){var d=(0,e.createElement)("div",{className:Cn});if(this.parent.sanitize(s,d),i)if(t[a.isAllDay])l=[d];else{l=[];var u=(0,e.createElement)("div",{className:ti+(this.parent.isAdaptive?" "+Ge:""),innerHTML:this.parent.getTimeString(t[a.startTime])}),g=(0,e.createElement)("div",{className:ti+(this.parent.isAdaptive?" "+Ge:""),innerHTML:this.parent.getTimeString(t[a.endTime])});(0,e.addClass)([d],"e-text-center"),h.isLeft||l.push(u),l.push(d),h.isRight||l.push(g)}else{var v=this.parent.getTimeString(t[a.startTime])+" - "+this.parent.getTimeString(t[a.endTime]),m=(0,e.createElement)("div",{className:ti+(this.parent.isAdaptive?" "+Ge:""),innerHTML:v}),f=(0,e.createElement)("div",{className:On});this.parent.sanitize(t[a.location]||this.parent.eventSettings.fields.location.default||"",f),l=[d,m,f]}}else{var y=this.parent.element.id+"_"+this.parent.activeViewOptions.eventTemplateName+"eventTemplate",T=this.parent.uiStateValues.isGroupAdaptive?this.parent.uiStateValues.groupIndex:r,w=this.isResourceEventTemplate?this.parent.getEventTemplateName(T):"eventTemplate";l=this.parent.getAppointmentTemplate()(t,this.parent,w,y,!1,void 0,void 0,this.parent.root)}if((0,e.append)(l,p),!(this.parent.isAdaptive||(0,e.isNullOrUndefined)(t[a.recurrenceRule])&&(0,e.isNullOrUndefined)(t[a.recurrenceID]))){var D=t[a.id]===t[a.recurrenceID]?ki:Ri,b=(0,e.createElement)("div",{className:Ye+" "+D});i?p.appendChild(b):o.appendChild(b)}return this.parent.eventBase.renderSpannedIcon(i?p:o,h),(0,e.isNullOrUndefined)(this.cssClass)||(0,e.addClass)([o],this.cssClass),this.applyResourceColor(o,t,"backgroundColor",this.groupOrder),this.renderResizeHandler(o,h,t[this.fields.isReadonly]),o},i.prototype.createMoreIndicator=function(t,i,n){var r=n+i,a=t[parseInt(r.toString(),10)];if(a.childElementCount<=0){var s=(0,e.createElement)("div",{className:Li,id:Li+"-"+r.toString()}),o=(0,e.createElement)("div",{className:Bi,attrs:{tabindex:"0","data-index":r.toString(),"data-count":"1"},innerHTML:"+1 "+(this.parent.isAdaptive?"":this.parent.localeObj.getConstant("more"))});s.appendChild(o),a.appendChild(s),e.EventHandler.add(o,"click",this.rowExpandCollapse,this)}else{var l=a.querySelector("."+Bi),p=parseInt(l.getAttribute("data-count"),10)+1;l.setAttribute("data-count",p.toString()),l.innerHTML="+"+this.parent.globalize.formatNumber(p)+" "+(this.parent.isAdaptive?"":this.parent.localeObj.getConstant("more"))}},i.prototype.isSpannedEvent=function(t,i,n){var r=ve(this.dateRender[parseInt(n.toString(),10)][parseInt(i.toString(),10)]),a=this.getRenderedDates(this.dateRender[parseInt(n.toString(),10)])||[r];0===a.filter((function(e){return e.getDay()===i})).length&&(r=ve(a[0]));var s=this.parent.eventFields,o=De(r,this.startHour,this.endHour),l=(0,e.extend)({},t,null,!0);l.isSpanned={isBottom:!1,isTop:!1,isSameDuration:l[s.startTime].getTime()===l[s.endTime].getTime()},t[s.startTime].getTime()<o.startHour.getTime()&&(l[s.startTime]=o.startHour,l.isSpanned.isTop=!0),t[s.endTime].getTime()>o.endHour.getTime()&&(l[s.endTime]=o.endHour,l.isSpanned.isBottom=!0);var p=this.updateEventMinimumDuration(o,l[s.startTime],l[s.endTime]);return l[s.startTime]=p.startDate,l[s.endTime]=p.endDate,l},i.prototype.isWorkDayAvailable=function(e,t){if(this.parent.activeViewOptions.group.hideNonWorkingDays&&this.resources.length>0){var i=this.resources[parseInt(e.toString(),10)].resourceData[this.resources[parseInt(e.toString(),10)].resource.workDaysField]||this.parent.activeViewOptions.workDays;return i&&i.indexOf(t.getDay())>=0}return!0},i.prototype.renderAllDayEvents=function(t,i,n,r,a,s,o){var l=this,p=this.getRenderedDates(this.dateRender[parseInt(n.toString(),10)])||this.dateRender[parseInt(n.toString(),10)];this.parent.activeViewOptions.group.byDate&&(this.slots[0]=[this.dateRender[parseInt(n.toString(),10)][parseInt(i.toString(),10)].getTime()],p=[this.dateRender[parseInt(n.toString(),10)][parseInt(i.toString(),10)]]);var c=this.splitEvent(t,p)[0],h=new Date(c[this.parent.eventFields.startTime].getTime()),d=new Date(c[this.parent.eventFields.endTime].getTime()),u=0,g=1,v=p[0].getTime()<=h.getTime()&&ye(p.slice(-1)[0],1).getTime()>=h.getTime();if(h<=d&&v&&this.isWorkDayAvailable(n,h)){var m=[];if(this.renderedAllDayEvents[parseInt(n.toString(),10)]&&(m=this.renderedAllDayEvents[parseInt(n.toString(),10)].filter((function(e){return e.Guid===t.Guid})),this.parent.activeViewOptions.group.byDate&&(m=m.filter((function(e){return e[l.parent.eventFields.startTime]>=p[parseInt(i.toString(),10)]&&e[l.parent.eventFields.endTime]<=ye(new Date(+p[parseInt(i.toString(),10)]),1)})))),0===m.length){var f=c.data.count,T=this.getOverlapIndex(c,i,!0,n);c.Index=T,this.allDayLevel=this.allDayLevel<T?T:this.allDayLevel;var w=c.data.isRight?0:"Day"===this.parent.currentView?4:7;f>=0&&(u=100*f-(this.parent.activeViewOptions.allowOverlap?w:0)),(0,e.isNullOrUndefined)(this.renderedAllDayEvents[parseInt(n.toString(),10)])&&(this.renderedAllDayEvents[parseInt(n.toString(),10)]=[]),this.renderedAllDayEvents[parseInt(n.toString(),10)].push((0,e.extend)({},c,null,!0));var D,b=[].slice.call(this.element.querySelector("."+Ze).children),S=this.getDayIndex(i,n,r),C=this.element.querySelector("."+Pi+":nth-child("+(S+1)+")");D=a?this.parent.inlineModule.createInlineAppointmentElement(t):this.createAppointmentElement(t,!0,c.data,n),(0,e.addClass)([D],ji);var O=(0,e.extend)({},c.data,null,!0);t.data=O;var E={data:t,element:D,cancel:!1};this.parent.trigger(y,E,(function(i){if(!i.cancel){if(C.appendChild(D),g+=(0===T?s:s+T*o)+1,(0,e.setStyleAttribute)(D,{width:u+"%",top:(0,e.formatUnit)(g)}),T>1){l.moreEvents.push(D);for(var n=0,r=f;n<r;n++)l.createMoreIndicator(b,n,S)}l.allDayElement[0].setAttribute("data-count",l.allDayLevel.toString());var a=4+(!l.parent.uiStateValues.expand&&l.allDayLevel>2?3*o:(l.allDayLevel+1)*o);l.setAllDayRowHeight(a),l.addOrRemoveClass(),l.wireAppointmentEvents(D,t)}}))}}},i.prototype.renderNormalEvents=function(t,i,n,r,a){var s=this.isSpannedEvent(t,i,n),o=s[this.fields.startTime],l=s[this.fields.endTime],p=0,c=De(ve(new Date(this.dateRender[parseInt(n.toString(),10)][parseInt(i.toString(),10)].getTime())),this.startHour,this.endHour),h=this.isValidEvent(t,o,l,c);if(!(o.getTime()<this.parent.minDate.getTime()||l.getTime()>this.parent.maxDate.getTime())&&o<=l&&h&&this.isWorkDayAvailable(n,o)){var d=s.isSpanned.isSameDuration?this.cellHeight:this.getHeight(o,l);o.getTime()>=c.startHour.getTime()&&(p=this.getTopValue(o));var u=this.getOverlapIndex(s,i,!1,n);s.Index=u,this.overlapList.push(s),this.overlapList.length>1?((0,e.isNullOrUndefined)(this.overlapEvents[parseInt(u.toString(),10)])&&(this.overlapEvents[parseInt(u.toString(),10)]=[]),this.overlapEvents[parseInt(u.toString(),10)].push(s)):(this.overlapEvents=[],this.overlapEvents.push([s]));var g={index:u,left:"0%",width:this.getEventWidth(),day:r,dayIndex:i,record:s,resource:n},v=this.adjustOverlapElements(g);v.appWidth,(0,e.isNullOrUndefined)(this.renderedEvents[parseInt(n.toString(),10)])&&(this.renderedEvents[parseInt(n.toString(),10)]=[]),this.renderedEvents[parseInt(n.toString(),10)].push((0,e.extend)({},s,null,!0));var m=void 0;m=a?this.parent.inlineModule.createInlineAppointmentElement(t):this.createAppointmentElement(t,!1,s.isSpanned,n),(0,e.setStyleAttribute)(m,{width:this.parent.eventSettings.enableMaxHeight||!this.parent.activeViewOptions.allowOverlap?"100%":v.appWidth,height:d+"px",top:p+"px"});var f=d-40-15*m.querySelectorAll("."+yi).length,y=m.querySelector("."+Cn);!this.parent.isAdaptive&&y&&(y.style.maxHeight=(0,e.formatUnit)(f));var T=this.getDayIndex(i,n,r),w={};w[this.fields.startTime]=t[this.fields.startTime],w[this.fields.endTime]=t[this.fields.endTime],s.data=w,this.appendEvent(s,m,T,v.appLeft),this.wireAppointmentEvents(m,t)}},i.prototype.getEventWidth=function(){var e=(("Day"===this.parent.currentView?97:94)-this.overlapEvents.length)/this.overlapEvents.length;return(e<0?0:e)+"%"},i.prototype.getEventLeft=function(e,t){var i=(parseFloat(e)+1)*t;return(i>99?99:i)+"%"},i.prototype.getStartEndHours=function(t){if(!(0,e.isNullOrUndefined)(t)&&""!==t){var i=new Date(2e3,0,0,0),n=t.split(":");return 2===n.length&&i.setHours(parseInt(n[0],10),parseInt(n[1],10),0),i}return null},i.prototype.getTopValue=function(e){var t=this.getStartEndHours(this.parent.activeViewOptions.startHour),i=60*(e.getHours()-t.getHours())+(e.getMinutes()-t.getMinutes());return this.parent.activeViewOptions.timeScale.enable?i*this.cellHeight*this.slotCount/this.interval:0},i.prototype.getOverlapIndex=function(t,i,n,r){var a=this,s=this.parent.eventFields,o=[],l=-1;if(this.overlapEvents=[],n){if(!(0,e.isNullOrUndefined)(this.renderedAllDayEvents[parseInt(r.toString(),10)])){var p=ve(new Date(this.dateRender[parseInt(r.toString(),10)][parseInt(i.toString(),10)].getTime()));o=this.renderedAllDayEvents[parseInt(r.toString(),10)].filter((function(e){return ve(e[s.startTime]).getTime()<=p.getTime()&&ve(e[s.endTime]).getTime()>=p.getTime()})),this.parent.activeViewOptions.group.resources.length>0&&(o=this.filterEventsByResource(this.resources[parseInt(r.toString(),10)],o))}}else{var c=(0,e.isNullOrUndefined)(this.renderedEvents[parseInt(r.toString(),10)])?[]:this.renderedEvents[parseInt(r.toString(),10)],h=[],d=t[s.startTime],u=t[s.endTime];this.overlapList=c.filter((function(e){return e[s.endTime]>d&&e[s.startTime]<=u||e[s.startTime]>=u&&e[s.endTime]<=d||e[s.endTime].getTime()===e[s.startTime].getTime()&&e[s.startTime].getTime()===d.getTime()&&e[s.endTime]<u})),this.parent.activeViewOptions.group.resources.length>0&&(this.overlapList=this.filterEventsByResource(this.resources[parseInt(r.toString(),10)],this.overlapList));var g=[];this.overlapList.forEach((function(e){g.push(e);for(var t=[],i=new Set,n=function(){var e=g.shift();if(c.filter((function(t){return t[s.endTime]>e[s.startTime]&&t[s.startTime]<=e[s.endTime]&&!i.has(t[s.id])})).forEach((function(e){t.push(e),i.add(e[s.id]),g.push(e)})),i.size<c.length-1)return"break"};g.length>0;){if("break"===n())break}a.parent.activeViewOptions.group.resources.length>0&&(t=a.filterEventsByResource(a.resources[parseInt(r.toString(),10)],t));var o=t.filter((function(e){return-1===a.overlapList.indexOf(e)}));o.length>0&&(h=h.concat(o))}));for(var v=0;v<h.length-1;v++)for(var m=v+1;m<h.length;m++)h[parseInt(v.toString(),10)][s.id]===h[parseInt(m.toString(),10)][s.id]&&(h.splice(m,1),m--);this.overlapList=this.overlapList.concat(h);for(var f=0,y=o=this.overlapList;f<y.length;f++){var T=y[f],w=T.Index;(0,e.isNullOrUndefined)(this.overlapEvents[parseInt(w.toString(),10)])?this.overlapEvents[parseInt(w.toString(),10)]=[T]:this.overlapEvents[parseInt(w.toString(),10)].push(T)}}if(n||(o=o.filter((function(e){return e[s.startTime]===t[s.startTime]&&e[s.endTime]>t[s.endTime]||e[s.endTime]>t[s.startTime]&&e[s.startTime]<t[s.endTime]||e[s.endTime]===t[s.startTime]&&e[s.startTime]===t[s.endTime]||e[s.startTime].getTime()===t[s.startTime].getTime()&&e[s.endTime].getTime()===t[s.endTime].getTime()||e[s.startTime].getTime()===t[s.startTime].getTime()&&e[s.endTime].getTime()<t[s.endTime].getTime()||e[s.endTime].getTime()>t[s.endTime].getTime()}))),o.length>0){var D=o.map((function(e){return e.Index}));l=D.length>0?this.getSmallestMissingNumber(D):0}return-1===l?0:l},i.prototype.adjustOverlapElements=function(t){for(var i={appWidth:t.width,appLeft:t.left},n=0,r=this.overlapEvents.length;n<r;n++)if(!(0,e.isNullOrUndefined)(this.overlapEvents[parseInt(n.toString(),10)]))for(var a=0,s=this.overlapEvents[parseInt(n.toString(),10)].length;a<s;a++){var o=this.getDayIndex(t.dayIndex,t.resource,t.day),l=this.element.querySelector("#e-appointment-wrapper-"+o);if(l&&l.childElementCount>0){var p=this.overlapEvents[parseInt(n.toString(),10)][parseInt(a.toString(),10)].Guid;if(l.querySelectorAll('div[data-guid="'+p+'"]').length>0&&p!==t.record.Guid){var c=l.querySelector('div[data-guid="'+p+'"]');parseFloat(t.width)<=parseFloat(c.style.width)?(this.parent.enableRtl?c.style.right=this.getEventLeft(t.width,n):c.style.left=this.getEventLeft(t.width,n),c.style.width=parseFloat(t.width)+"%",i.appWidth=c.style.width):i.appWidth=c.style.width}else{var h=t.width;(0,e.isNullOrUndefined)(this.overlapEvents[n-1])&&(h=this.getEventWidth()),i.appWidth=h,i.appLeft=this.getEventLeft(h,t.index)}}}return i},i.prototype.setAllDayRowHeight=function(t){var i=this.parent.element.querySelector("."+it);"auto"!==this.parent.height&&this.parent.enableAllDayScroll||(0,e.addClass)([i],mr);var n=this.parent.element.querySelector("."+Ze);if(n.style.height="",this.parent.uiStateValues.expand&&"auto"!==this.parent.height&&this.parent.enableAllDayScroll)n.style.height=t/12+"em",this.parent.eventBase.allDayExpandScroll(i);else{for(var r=0,a=this.allDayElement;r<a.length;r++){a[r].style.height=t/12+"em"}(0,e.removeClass)([i],vr)}},i.prototype.addOrRemoveClass=function(){var t=this;this.moreEvents.filter((function(i){!t.parent.uiStateValues.expand&&t.allDayLevel>2?((0,e.addClass)([i],Ni),i.setAttribute("tabindex","-1")):((0,e.removeClass)([i],Ni),i.setAttribute("tabindex","0"))}));var i=this.element.querySelector("."+qi);this.parent.uiStateValues.expand?((0,e.removeClass)([i],Fi),(0,e.addClass)([i],Ui)):((0,e.removeClass)([i],Ui),(0,e.addClass)([i],Fi)),this.allDayLevel>2?(0,e.removeClass)([i],Ge):(0,e.addClass)([i],Ge),[].slice.call(this.element.querySelectorAll("."+Li)).forEach((function(i){!t.parent.uiStateValues.expand&&t.allDayLevel>2?(0,e.removeClass)([i],Ge):(0,e.addClass)([i],Ge)}))},i.prototype.getEventHeight=function(){var t=(0,e.createElement)("div",{className:Xt,styles:"visibility:hidden"});this.element.querySelector("."+Pi+":first-child").appendChild(t);var i=t.offsetHeight;return(0,e.remove)(t),i},i.prototype.rowExpandCollapse=function(){var e,t=this.element.querySelector("."+qi);this.parent.uiStateValues.expand=t.classList.contains(Fi),this.parent.uiStateValues.expand?(t.setAttribute("title",this.parent.localeObj.getConstant("collapseAllDaySection")),t.setAttribute("aria-label",this.parent.localeObj.getConstant("collapseAllDaySection")),e=(this.allDayLevel+1)*this.getEventHeight()+4):(t.setAttribute("title",this.parent.localeObj.getConstant("expandAllDaySection")),t.setAttribute("aria-label",this.parent.localeObj.getConstant("expandAllDaySection")),e=3*this.getEventHeight()+4,this.parent.element.querySelector("."+it).scrollTop=0),this.setAllDayRowHeight(e),this.animation.animate(this.allDayElement[0]),this.addOrRemoveClass(),this.animation.animate(t)},i.prototype.animationUiUpdate=function(){this.parent.notify(_,{})},i.prototype.destroy=function(){!this.parent||this.parent&&this.parent.isDestroyed||(this.removeEventListener(),this.allDayElement=null,this.renderedAllDayEvents=null,this.renderedEvents=null,this.slotCount=null,this.interval=null,this.startHour=null,this.endHour=null,this.element=null,this.fields=null,this.animation=null,t.prototype.destroy.call(this))},i}(Aa),ka=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ra=function(t){function i(e){var i=t.call(this,e)||this;return i.renderedEvents=[],i.monthHeaderHeight=0,i.moreIndicatorHeight=19,i.renderType="day",i.element=i.parent.activeView.getPanel(),i.fields=i.parent.eventFields,i.maxHeight=i.parent.eventSettings.enableMaxHeight&&!i.parent.eventSettings.enableIndicator&&!i.parent.rowAutoHeight,i.withIndicator=i.parent.eventSettings.enableMaxHeight&&i.parent.eventSettings.enableIndicator&&!i.parent.rowAutoHeight,i.maxOrIndicator=i.maxHeight||i.withIndicator,i.moreIndicatorHeight=i.parent.rowAutoHeight&&i.parent.eventSettings.ignoreWhitespace?0:i.moreIndicatorHeight,i.addEventListener(),i}return ka(i,t),i.prototype.removeEventWrapper=function(t){if(t.length>0)for(var i=0,n=t="Month"===this.parent.currentView||!this.parent.activeView.isTimelineView()&&!this.parent.activeViewOptions.timeScale.enable?t:[t[0]];i<n.length;i++){var r=n[i];r.parentElement&&r.parentElement.parentNode&&(0,e.remove)(r.parentElement)}},i.prototype.renderAppointments=function(){this.parent.dragAndDropModule&&this.parent.dragAndDropModule.setDragArea(),this.isResourceEventTemplate=this.parent.isSpecificResourceEvents();var t=this.parent.element.querySelector("."+ri);this.parent.rowAutoHeight&&(this.parent.uiStateValues.top=t.scrollTop,this.parent.uiStateValues.left=t.scrollLeft);var i=[].slice.call(this.element.querySelectorAll("."+jt));if(this.parent.crudModule&&this.parent.crudModule.crudObj.isCrudAction)for(var n=0,r=this.parent.crudModule.crudObj.sourceEvent.length;n<r;n++){var a=[].slice.call(this.element.querySelectorAll('.e-appointment-wrapper [data-group-index="'+this.parent.crudModule.crudObj.sourceEvent[parseInt(n.toString(),10)].groupIndex+'"]'));if(this.removeEventWrapper(a),this.parent.crudModule.crudObj.targetEvent[parseInt(n.toString(),10)]&&this.parent.crudModule.crudObj.sourceEvent[parseInt(n.toString(),10)].groupIndex!==this.parent.crudModule.crudObj.targetEvent[parseInt(n.toString(),10)].groupIndex){var s=[].slice.call(this.element.querySelectorAll('.e-appointment-wrapper [data-group-index="'+this.parent.crudModule.crudObj.targetEvent[parseInt(n.toString(),10)].groupIndex+'"]'));this.removeEventWrapper(s)}}else for(var o=0,l=i;o<l.length;o++){var p=l[o];(0,e.remove)(p)}if(this.removeHeightProperty(Je),this.element.querySelector("."+$e)){if("Month"===this.parent.currentView){var c=(0,e.createElement)("div",{className:jt}),h=this.parent.element.querySelector("."+$e);h.appendChild(c),this.monthHeaderHeight=c.offsetTop-h.offsetTop,h.removeChild(c)}this.eventHeight=this.parent.getElementHeightFromClass(this.element,Xt);var d="."+Je+" tbody tr";this.addCellHeight(d,this.eventHeight,"Month"===this.parent.currentView?0:2,this.monthHeaderHeight,this.moreIndicatorHeight);var u=t.scrollTop;if(this.parent.rowAutoHeight&&this.parent.virtualScrollModule&&!this.parent.virtualScrollModule.isHorizontalScroll&&!(0,e.isNullOrUndefined)(this.parent.currentAction)&&(t.scrollTop=t.scrollTop-1),this.parent.activeViewOptions.group.resources.length>0?(this.renderResourceEvents(),this.parent.virtualScrollModule&&this.parent.virtualScrollModule.updateFocusedWorkCell()):this.renderEventsHandler(this.parent.activeView.renderDates,this.parent.activeViewOptions.workDays),this.parent.rowAutoHeight){this.updateBlockElements();var g={cssProperties:this.parent.getCssProperties(),module:this.parent.getModuleName(),isPreventScrollUpdate:!0,scrollPosition:{left:this.parent.uiStateValues.left,top:this.parent.uiStateValues.top}};if(this.parent.virtualScrollModule&&!this.parent.virtualScrollModule.isHorizontalScroll&&(this.parent.currentAction?(t.scrollTop=u,this.parent.currentAction=null):this.parent.virtualScrollModule.updateVirtualScrollHeight()),this.parent.enablePersistence||this.parent.notify(_,{}),this.parent.notify(Q,g),"Month"===this.parent.currentView&&this.parent.showWeekNumber){var v=[].slice.call(this.parent.element.querySelectorAll(".e-content-wrap table tr td:first-child"));[].slice.call(this.parent.element.querySelectorAll("."+zt)).forEach((function(t,i){var n=v[parseInt(i.toString(),10)].offsetHeight;(0,e.setStyleAttribute)(t,{height:n+"px"})})),this.parent.element.querySelector("."+Wt).scrollTop=this.parent.element.querySelector("."+ri).scrollTop}}this.parent.renderTemplates()}},i.prototype.renderEventsHandler=function(t,i,n){var r,a;this.renderedEvents=[];var s=0;if(n?(s=n.groupIndex,this.cssClass=n.cssClass,this.groupOrder=n.groupOrder,r=this.parent.eventBase.filterEventsByResource(n,this.parent.eventsProcessed),a=this.parent.eventBase.filterEventsByResource(n,this.parent.blockProcessed),this.workCells=[].slice.call(this.element.querySelectorAll("."+$e+'[data-group-index="'+s+'"]'))):(r=this.parent.eventsProcessed,a=this.parent.blockProcessed,this.workCells=[].slice.call(this.element.querySelectorAll("."+$e))),this.sortByDateTime(r),this.sortByDateTime(a),"Month"===this.parent.currentView&&this.parent.rowAutoHeight&&0===this.parent.activeViewOptions.group.resources.length){var o=[].slice.call(this.parent.element.querySelectorAll(".e-content-wrap table tr td:first-child")),l=this.parent.element.querySelector("."+Je).clientHeight/o.length;o.forEach((function(t){(0,e.setStyleAttribute)(t,{height:l+"px"})}))}var p=this.workCells[this.parent.activeView.isTimelineView()?0:this.workCells.length-1];this.cellWidth=this.parent.getElementWidth(p),this.cellHeight=this.parent.getElementHeight(p),this.dateRender=t;var c=this.getRenderedDates(t);this.getSlotDates(i||this.parent.activeViewOptions.workDays),this.processBlockEvents(a,s,n);for(var h=[],d=0,u=r;d<u.length;d++){var g=u[d];this.parent.resourceBase&&!n&&(this.cssClass=this.parent.resourceBase.getCssClass(g)),h=h.concat(this.splitEvent(g,c||this.dateRender))}for(var v=0;v<this.slots.length;v++){this.renderedEvents=[];for(var m=this.slots[parseInt(v.toString(),10)],f=ye(new Date(m[m.length-1]),1),y=0,T=this.filterEvents(new Date(m[0]),f,h);y<T.length;y++){var w=T[y];if(this.maxHeight){var D="Month"===this.parent.currentView?w[this.fields.startTime]:this.getStartTime(w,w.data);if(this.getIndex(D)>0)continue}this.updateIndicatorIcon(w),this.renderEvents(w,s,r)}}this.cssClass=null,this.groupOrder=null},i.prototype.processBlockEvents=function(t,i,n){for(var r=0,a=t;r<a.length;r++){var s=a[r];this.parent.resourceBase&&!n&&(this.cssClass=this.parent.resourceBase.getCssClass(s));var o=[];if("day"!==this.renderType||s[this.fields.isAllDay])o.push(s);else{var l,p=(0,e.extend)({},s,null,!0),c=this.isSameDate(p[this.fields.startTime],p[this.fields.endTime]);if(p.isBlockIcon=c,!c&&me(p[this.fields.startTime])>0)(l=(0,e.extend)({},s,null,!0))[this.fields.endTime]=ye(ve(new Date(s[this.fields.startTime]+"")),1),l.isBlockIcon=!0,p[this.fields.startTime]=l[this.fields.endTime],o.push(l);if(!(c=this.isSameDate(p[this.fields.startTime],p[this.fields.endTime]))&&me(p[this.fields.endTime])>0)(l=(0,e.extend)({},s,null,!0))[this.fields.startTime]=ve(new Date(s[this.fields.endTime]+"")),l.isBlockIcon=!0,o.push(l),p[this.fields.endTime]=l[this.fields.startTime];o.push(p)}for(var h=0,d=o;h<d.length;h++)for(var u=d[h],g=0,v=this.splitEvent(u,this.dateRender);g<v.length;g++){var m=v[g];this.renderBlockEvents(m,i,!!u.isBlockIcon)}}},i.prototype.isSameDate=function(e,t){return new Date(+e).setHours(0,0,0,0)===new Date(+t).setHours(0,0,0,0)},i.prototype.renderBlockEvents=function(t,i,n){var r=t.data,a=this.getStartTime(t,r),s=this.getEndTime(t,r),o=this.parent.getIndexOfDate(this.dateRender,ve(new Date(a.getTime())));if(!(o<0||a>s)){var l=this.getCellTd(o),p=this.getPosition(a,s,t[this.fields.isAllDay],o);if(n)this.renderBlockIndicator(l,p,i);else{var c=r.count,h=this.getEventWidth(a,s,t[this.fields.isAllDay],c);h=h<=0?this.cellWidth:h;var d=this.parent.enableRtl?0:p,u=this.parent.enableRtl?p:0,g=this.cellHeight-this.monthHeaderHeight,v=this.getRowTop(i),m=this.createBlockAppointmentElement(t,i,this.isResourceEventTemplate);(0,e.setStyleAttribute)(m,{width:h+"px",height:g+"px",left:d+"px",right:u+"px",top:v+"px"}),this.renderEventElement(t,m,l)}}},i.prototype.renderBlockIndicator=function(t,i,n){var r=(0,e.createElement)("div",{className:"e-icons "+Kt});(0,e.isNullOrUndefined)(t.querySelector("."+Kt))&&t.appendChild(r)},i.prototype.getStartTime=function(e,t){return e[this.fields.startTime]},i.prototype.getEndTime=function(e,t){return e[this.fields.endTime]},i.prototype.getCellTd=function(e){return this.workCells[parseInt(e.toString(),10)]},i.prototype.getEventWidth=function(e,t,i,n){return n*this.cellWidth-1},i.prototype.getPosition=function(e,t,i,n){return 0},i.prototype.getRowTop=function(e){return 0},i.prototype.updateIndicatorIcon=function(e){if(-1!==this.parent.currentView.indexOf("Timeline")&&"TimelineMonth"!==this.parent.currentView&&!e[this.fields.isAllDay]){var t=e.data,i=this.parent.activeView.getStartHour(),n=this.parent.activeView.getEndHour(),r=De(e[this.fields.startTime],i,n),a=De(e[this.fields.endTime],i,n),s=t[this.fields.startTime],o=t[this.fields.endTime];if(t.isLeft=t.isLeft||s.getTime()<r.startHour.getTime(),t.isRight=t.isRight||o.getTime()>a.endHour.getTime(),ve(s).getTime()!==ve(o).getTime()){var l=r.startHour,p=a.endHour,c=new Date(ve(s));if(c.setHours(p.getHours(),p.getMinutes(),p.getSeconds()),t.isLeft=t.isLeft||s.getTime()>=(l.getDate()===r.endHour.getDate()?c.getTime():ye(c,1).getTime()),o.getTime()!==ve(o).getTime()){var h=new Date(ve(o));t.isRight=t.isRight||o.getTime()<=h.setHours(l.getHours(),l.getMinutes(),l.getSeconds())}}}},i.prototype.renderResourceEvents=function(){var e=this.parent.uiStateValues.isGroupAdaptive?[this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]]:this.parent.resourceBase.renderedResources;if(this.parent.crudModule&&this.parent.crudModule.crudObj.isCrudAction){for(var t=0,i=this.parent.crudModule.crudObj.sourceEvent.length;t<i;t++){var n=this.parent.crudModule.crudObj.sourceEvent[parseInt(t.toString(),10)];if((!this.parent.uiStateValues.isGroupAdaptive||this.parent.uiStateValues.groupIndex===n.groupIndex&&this.parent.uiStateValues.isGroupAdaptive)&&this.renderEventsHandler(n.renderDates,n.workDays,n),this.parent.crudModule.crudObj.sourceEvent[parseInt(t.toString(),10)].groupIndex!==this.parent.crudModule.crudObj.targetEvent[parseInt(t.toString(),10)].groupIndex){var r=this.parent.crudModule.crudObj.targetEvent[parseInt(t.toString(),10)];this.renderEventsHandler(r.renderDates,r.workDays,r)}}this.parent.crudModule.crudObj.isCrudAction=!1}else for(var a=0,s=e;a<s.length;a++){var o=s[a];this.renderEventsHandler(o.renderDates,o.workDays,o)}},i.prototype.getSlotDates=function(e){this.slots=[];for(var t=this.dateRender.map((function(e){return+e})),i=!this.parent.activeViewOptions.showWeekend||this.parent.activeViewOptions.group.byDate&&this.parent.activeViewOptions.group.hideNonWorkingDays?e.length:ee;t.length>0;)this.slots.push(t.splice(0,i))},i.prototype.createAppointmentElement=function(t,i,n){void 0===n&&(n=!1);var r=t[this.fields.subject]||this.parent.eventSettings.fields.subject.default||this.parent.localeObj.getConstant("addTitle"),a=(0,e.extend)({},t,t.data,!0),s={"data-id":"Appointment_"+t[this.fields.id],role:"button",tabindex:"0","aria-disabled":this.parent.eventBase.getReadonlyAttribute(t),"aria-label":this.parent.getAnnouncementString(a,r)};n||(s["data-guid"]=t.Guid),this.parent.activeViewOptions.group.resources.length>0&&(s["data-group-index"]=i.toString());var o=(0,e.createElement)("div",{className:Xt,attrs:s});(0,e.isNullOrUndefined)(this.cssClass)||(0,e.addClass)([o],this.cssClass),t[this.fields.isReadonly]&&(0,e.addClass)([o],"e-read-only");var l,p=(0,e.createElement)("div",{className:Jt});o.appendChild(p);var c=t.data,h=this.getEventData(t);if((0,e.isNullOrUndefined)(this.parent.activeViewOptions.eventTemplate)){var d=t[this.fields.location]||this.parent.eventSettings.fields.location.default||"",u=(0,e.createElement)("div",{className:Cn});this.parent.sanitize(r+(d?"; "+d:""),u);var g=(0,e.createElement)("div",{className:ti+(this.parent.isAdaptive?" "+Ge:""),innerHTML:this.parent.getTimeString(c[this.fields.startTime])}),v=(0,e.createElement)("div",{className:ti+(this.parent.isAdaptive?" "+Ge:""),innerHTML:this.parent.getTimeString(c[this.fields.endTime])});if("Month"===this.parent.currentView)t[this.fields.isAllDay]?(l=[u],(0,e.addClass)([u],"e-text-center")):c.count<=1&&!c.isLeft&&!c.isRight?l=[g,u]:(l=[],(0,e.addClass)([u],"e-text-center"),c.isLeft||l.push(g),l.push(u),c.isRight||l.push(v));else{var m=void 0;if(t[this.fields.isAllDay]){m=[u,(0,e.createElement)("div",{className:ti,innerHTML:this.parent.localeObj.getConstant("allDay")})]}else{var f=this.parent.getTimeString(c[this.fields.startTime])+" - "+this.parent.getTimeString(c[this.fields.endTime]),y=(0,e.createElement)("div",{className:ti+(this.parent.isAdaptive?" "+Ge:""),innerHTML:f}),T=(0,e.createElement)("div",{className:On});this.parent.sanitize(d,T),m=[u,y,T]}var w=(0,e.createElement)("div",{className:"e-inner-wrap"});(0,e.append)(m,w),l=[w]}}else{var D=this.parent.element.id+"_"+this.parent.activeViewOptions.eventTemplateName+"eventTemplate",b=this.isResourceEventTemplate?this.parent.getEventTemplateName(i):"eventTemplate";l=this.parent.getAppointmentTemplate()(h,this.parent,b,D,!1,void 0,void 0,this.parent.root)}return(0,e.append)(l,p),this.appendEventIcons(t,p),this.renderResizeHandler(o,t.data,t[this.fields.isReadonly]),o},i.prototype.appendEventIcons=function(t,i){var n=t.data;if(!(0,e.isNullOrUndefined)(t[this.fields.recurrenceRule])||!(0,e.isNullOrUndefined)(t[this.fields.recurrenceID])){var r=t[this.fields.id]===t[this.fields.recurrenceID]?ki:Ri;i.appendChild((0,e.createElement)("div",{className:Ye+" "+r+(this.parent.isAdaptive?" "+Ge:"")}))}if(n.isLeft){var a=(0,e.createElement)("div",{className:yi+" "+Ye+" "+Ti});(0,e.prepend)([a],i)}if(n.isRight){var s=(0,e.createElement)("div",{className:yi+" "+Ye+" "+wi});(0,e.append)([s],i)}},i.prototype.renderEvents=function(t,i,n){var r=t[this.fields.startTime],a=t[this.fields.endTime],s=this.parent.getIndexOfDate(this.dateRender,ve(r));if(!(s<0||r.getTime()<this.parent.minDate.getTime()||a.getTime()>this.parent.maxDate.getTime())){var o=this.parent.rowAutoHeight?1:this.parent.activeViewOptions.maxEventsPerRow,l=this.getIndex(r);t.Index=l;var p=t.data.count;if(r.getTime()<=a.getTime()){var c=p*this.cellWidth-5,h=this.workCells[parseInt(s.toString(),10)],d=l*(this.eventHeight+0),u=this.monthHeaderHeight+(l+1)*(this.eventHeight+0)+this.moreIndicatorHeight,g=!this.parent.activeViewOptions.maxEventsPerRow||this.parent.rowAutoHeight||this.parent.eventSettings.enableIndicator?this.maxOrIndicator?l<1:this.cellHeight>u:l<o;if(this.parent.rowAutoHeight||g){this.renderedEvents.push((0,e.extend)({},t,null,!0));var v=void 0;if(v=this.inlineValue?this.parent.inlineModule.createInlineAppointmentElement():this.createAppointmentElement(t,i),this.applyResourceColor(v,t,"backgroundColor",this.groupOrder),this.wireAppointmentEvents(v,t),(0,e.setStyleAttribute)(v,{width:c+"px",top:d+"px"}),this.renderEventElement(t,v,h),this.parent.rowAutoHeight){var m=this.parent.element.querySelector("."+ri),f=this.parent.getElementWidth(m),y=m.offsetHeight===m.clientHeight&&m.offsetWidth===m.clientWidth,T=h.parentElement.firstElementChild;this.updateCellHeight(T,u),y&&(m.offsetWidth>m.clientWidth||f!==this.parent.getElementWidth(m))&&this.adjustAppointments(f)}}else for(var w=0;w<p;w++)if(this.workCells[s+w]){var D=this.workCells[s+w].querySelector("."+Bi);if(D){var b=parseInt(D.getAttribute("data-count"),10)+1;D.setAttribute("data-count",b.toString()),D.setAttribute("aria-label",b+" "+this.parent.localeObj.getConstant("moreEvents")),D.innerHTML=this.getMoreIndicatorText(b)}else{var S=new Date(this.dateRender[s+w].getTime()),C=ye(this.dateRender[s+w],1),O=this.workCells[s+w].getAttribute("data-group-index"),E=this.getMoreIndicatorElement(1,S,C);(0,e.isNullOrUndefined)(O)||E.setAttribute("data-group-index",O),E.style.top=this.cellHeight-this.monthHeaderHeight-this.moreIndicatorHeight+"px",E.style.width=this.cellWidth-2+"px",this.renderElement(this.workCells[s+w],E),e.EventHandler.add(E,"click",this.moreIndicatorClick,this)}}}}},i.prototype.adjustAppointments=function(e){var t=this,i=this.parent.element.querySelector("."+Je+" tbody tr"),n=this.parent.getElementWidth(this.workCells[0]);this.cellWidth=n/+(this.workCells[0].getAttribute("colspan")||1);var r=n*i.children.length/(e/100);[].slice.call(this.parent.element.querySelectorAll("."+Xt)).forEach((function(e){t.parent.enableRtl&&"0px"!==e.style.right?e.style.right=parseFloat(e.style.right)/100*r+"px":"0px"!==e.style.left&&(e.style.left=parseFloat(e.style.left)/100*r+"px"),e.style.width=parseFloat(e.style.width)/100*r+"px"}))},i.prototype.updateCellHeight=function(t,i){i>t.offsetHeight&&(0,e.setStyleAttribute)(t,{height:i+"px"})},i.prototype.updateBlockElements=function(){for(var t=0,i=[].slice.call(this.element.querySelectorAll("."+Qt));t<i.length;t++){var n=i[t],r=(0,e.closest)(n,"tr");this.monthHeaderHeight=n.offsetParent.offsetTop-r.offsetTop,n.style.height=r.offsetHeight-1-this.monthHeaderHeight+"px";var a=r.firstElementChild,s=Math.round(n.offsetWidth/a.offsetWidth);n.style.width=a.offsetWidth*s+"px"}},i.prototype.getFilteredEvents=function(t,i,n,r){var a;if((0,e.isNullOrUndefined)(n))a=this.filterEvents(t,i);else{var s=this.parent.resourceBase.lastResourceLevel[parseInt(n,10)];a=this.filterEvents(t,i,(0,e.isNullOrUndefined)(r)?void 0:r,s)}return a},i.prototype.getOverlapEvents=function(e,t){for(var i=[],n=ve(e).getTime(),r=0,a=t;r<a.length;r++){var s=a[r];ve(s[this.fields.startTime]).getTime()<=n&&ve(s[this.fields.endTime]).getTime()>=n&&i.push(s)}return i},i.prototype.getIndex=function(e){var t=-1,i=this.renderedEvents;if(i.length>0){var n=this.getOverlapEvents(e,i).map((function(e){return e.Index}));t=n.length>0?this.getSmallestMissingNumber(n):0}return-1===t?0:t},i.prototype.moreIndicatorClick=function(t){var i=this,n=(0,e.closest)(t.target,"."+Bi),r=new Date(parseInt(n.getAttribute("data-start-date"),10)),a=new Date(parseInt(n.getAttribute("data-end-date"),10)),o=n.getAttribute("data-group-index"),l={cancel:!1,event:t,element:n,isPopupOpen:!0,startTime:r,endTime:a,viewName:this.parent.getNavigateView()};o&&(l.groupIndex=parseInt(o,10)),this.parent.trigger(s,l,(function(e){if(!e.cancel)if(e.isPopupOpen){var n=i.getFilteredEvents(r,a,o),s={date:r,event:n,element:t.target};i.parent.quickPopup.moreEventClick(s,a,o)}else i.parent.setProperties({selectedDate:r},!0),i.parent.changeView(e.viewName,t)}))},i.prototype.renderEventElement=function(e,t,i){var n=this,r=t.classList.contains(Qt)?"blockEvent":"event",a=t.classList.contains(Xt),s={data:"Month"===this.parent.currentView?this.getSpannedTime(e):this.getEventData(e),element:t,cancel:!1,type:r};this.parent.trigger(y,s,(function(e){e.cancel?n.renderedEvents.pop():n.renderElement(i,t,a)}))},i.prototype.getSpannedTime=function(t){var i=(0,e.extend)({},t,null,!0);return i[this.fields.startTime].getDate()===i.data[this.fields.startTime].getDate()&&(i[this.fields.startTime]=i.data[this.fields.startTime]),i[this.fields.endTime].getDate()===i.data[this.fields.endTime].getDate()&&(i[this.fields.endTime]=i.data[this.fields.endTime]),i},i.prototype.getEventData=function(t){var i=(0,e.extend)({},t,null,!0);return i[this.fields.startTime]=t.data[this.fields.startTime],i[this.fields.endTime]=t.data[this.fields.endTime],i},i.prototype.renderElement=function(t,i,n){void 0===n&&(n=!1),this.maxOrIndicator&&n&&this.setMaxEventHeight(i,t);var r=t.querySelector("."+jt);if(r)r.appendChild(i);else{var a=(0,e.createElement)("div",{className:jt});a.appendChild(i),t.appendChild(a)}},i.prototype.getMoreIndicatorElement=function(t,i,n){return(0,e.createElement)("div",{className:Bi,innerHTML:this.getMoreIndicatorText(t),attrs:{role:"button",tabindex:"0","aria-label":this.parent.globalize.formatNumber(t)+" "+this.parent.localeObj.getConstant("moreEvents"),"data-count":t.toString(),"data-start-date":i.getTime().toString(),"data-end-date":n.getTime().toString()}})},i.prototype.getMoreIndicatorText=function(e){return"+"+this.parent.globalize.formatNumber(e)+" "+(this.parent.isAdaptive?"":this.parent.localeObj.getConstant("more"))},i.prototype.removeHeightProperty=function(e){for(var t=0,i=[].slice.call(this.element.querySelectorAll("."+e+" tbody tr"));t<i.length;t++){i[t].firstElementChild.style.height=""}},i.prototype.setMaxEventHeight=function(t,i){var n=Ie(i.querySelector("."+ui)),r=i.offsetHeight-n-(this.maxHeight?0:this.moreIndicatorHeight);(0,e.setStyleAttribute)(t,{height:r+"px","align-items":"center"})},i.prototype.destroy=function(){this.element=null,this.fields=null,this.maxHeight=null,this.withIndicator=null,this.maxOrIndicator=null,this.moreIndicatorHeight=null,this.removeEventListener(),t.prototype.destroy.call(this)},i}(Aa),Ha=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Pa=function(t){function i(e,i){var n=t.call(this,e)||this;n.startHour=n.parent.activeView.getStartHour(),n.endHour=n.parent.activeView.getEndHour(),n.slotCount=n.parent.activeViewOptions.timeScale.slotCount,n.interval=n.parent.activeViewOptions.timeScale.interval,n.day=0,n.rowIndex=0,n.cellTops=[],n.renderType=i,n.eventContainers=[].slice.call(n.element.querySelectorAll("."+Gt));var r=[].slice.call(n.element.querySelectorAll("."+Je+" tbody tr"));return n.dayLength=0===r.length?0:r[0].children.length,n.content=n.parent.element.querySelector("."+Qe+"."+Je),n}return Ha(i,t),i.prototype.getSlotDates=function(){if(this.slots=[],this.slots.push(this.parent.activeView.renderDates.map((function(e){return+e}))),this.parent.activeViewOptions.headerRows.length>0&&"Hour"!==this.parent.activeViewOptions.headerRows.slice(-1)[0].option){this.renderType="day";var e=this.content.querySelector("."+$e);this.cellWidth=this.parent.getElementWidth(e)/+(e.getAttribute("colspan")||1),this.slotsPerDay=1}else this.slotsPerDay=this.dayLength/this.dateRender.length},i.prototype.getOverlapEvents=function(e,t){var i=[];if("day"===this.renderType)for(var n=0,r=t;n<r.length;n++){ve((o=r[n])[this.fields.startTime]).getTime()<=ve(new Date(e.getTime())).getTime()&&ve(o[this.fields.endTime]).getTime()>=ve(new Date(e.getTime())).getTime()&&i.push(o)}else for(var a=0,s=t;a<s.length;a++){var o,l=(o=s[a]).data;(l.trimStartTime.getTime()<=e.getTime()&&l.trimEndTime.getTime()>e.getTime()||l.trimStartTime.getTime()===e.getTime()&&l.trimEndTime.getTime()===e.getTime())&&i.push(o)}return i},i.prototype.getSortComparerIndex=function(e,t){var i=-1,n=this.renderedEvents;if(n.length>0){var r=this.getOverlapSortComparerEvents(e,t,n).map((function(e){return e.Index}));i=r.length>0?this.getSmallestMissingNumber(r):0}return-1===i?0:i},i.prototype.getOverlapSortComparerEvents=function(e,t,i){for(var n=[],r=function(i){if("day"===a.renderType){var r=ve(e).getTime(),s=ve(t).getTime(),o=ve(i[a.fields.startTime]).getTime(),l=ve(i[a.fields.endTime]).getTime();(o<=r&&l>=r||(c=s-(me(t)<=0?ie:0),l>=(c=r>c?r:c)&&o<=c)||o>r&&l<s)&&n.push(i)}else{var p=i.data;(p.trimStartTime.getTime()<=e.getTime()&&e.getTime()<p.trimEndTime.getTime()||e.getTime()<=p.trimStartTime.getTime()&&p.trimStartTime.getTime()<t.getTime())&&n.push(i)}var c},a=this,s=0,o=i;s<o.length;s++){r(o[s])}return n},i.prototype.renderResourceEvents=function(){this.removeHeightProperty(Tt);var e="."+Tt+" tbody tr";this.addCellHeight(e,this.eventHeight,2,this.moreIndicatorHeight,0,!1);var t=this.parent.uiStateValues.isGroupAdaptive?[this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]]:this.parent.resourceBase.renderedResources;if(this.parent.crudModule&&this.parent.crudModule.crudObj.isCrudAction){for(var i=0,n=this.parent.crudModule.crudObj.sourceEvent.length;i<n;i++){var r=this.parent.crudModule.crudObj.sourceEvent[parseInt(i.toString(),10)];if(this.rowIndex=r.groupIndex,(!this.parent.uiStateValues.isGroupAdaptive||this.parent.uiStateValues.groupIndex===r.groupIndex&&this.parent.uiStateValues.isGroupAdaptive)&&this.renderEventsHandler(this.parent.activeView.renderDates,this.parent.activeViewOptions.workDays,r),this.parent.crudModule.crudObj.targetEvent[parseInt(i.toString(),10)]&&this.parent.crudModule.crudObj.sourceEvent[parseInt(i.toString(),10)].groupIndex!==this.parent.crudModule.crudObj.targetEvent[parseInt(i.toString(),10)].groupIndex){var a=this.parent.crudModule.crudObj.targetEvent[parseInt(i.toString(),10)];this.rowIndex=a.groupIndex,this.renderEventsHandler(this.parent.activeView.renderDates,this.parent.activeViewOptions.workDays,a)}}this.parent.crudModule.crudObj.isCrudAction=!1}else for(i=0;i<t.length;i++)this.rowIndex=i,this.renderEventsHandler(this.parent.activeView.renderDates,this.parent.activeViewOptions.workDays,t[parseInt(i.toString(),10)])},i.prototype.renderEvents=function(t,i,n){var r=t[this.fields.startTime],a=t[this.fields.endTime];if(!(r.getTime()<this.parent.minDate.getTime()||a.getTime()>this.parent.maxDate.getTime())){var s=t.data;r=this.getStartTime(t,s),a=this.getEndTime(t,s);var o=De(t[this.fields.startTime],this.startHour,this.endHour),l=this.updateEventMinimumDuration(o,r,a);if(r=l.startDate,a=l.endDate,this.day=this.parent.getIndexOfDate(this.dateRender,ve(new Date(r.getTime()))),!(this.day<0)){var p=this.getCellTd(),c=this.parent.rowAutoHeight?1:this.parent.activeViewOptions.maxEventsPerRow,h=(0,e.isNullOrUndefined)(this.parent.eventSettings.sortComparer)?this.getIndex(r):this.getSortComparerIndex(r,a);t.Index=h;var d=this.eventHeight,u=s.count,g=(0,e.extend)({},t,null,!0);g[this.fields.startTime]=s[this.fields.startTime],g[this.fields.endTime]=s[this.fields.endTime];var v=De(ve(new Date(this.dateRender[this.day].getTime())),this.startHour,this.endHour),m=!0;if(m=!(!this.isDayProcess()&&!g[this.fields.isAllDay])||this.isValidEvent(g,r,a,v),r<=a&&m){var f=this.getEventWidth(r,a,t[this.fields.isAllDay],u);f="day"===this.renderType?f-2:f;var y,T,w=this.getPosition(r,a,t[this.fields.isAllDay],this.day);f=f<=0?this.cellWidth:f,this.renderedEvents.push((0,e.extend)({},t,null,!0)),(0,e.isNullOrUndefined)(this.cellTops[parseInt(i.toString(),10)])&&(this.cellTops[parseInt(i.toString(),10)]=this.getRowTop(i));var D=this.cellTops[parseInt(i.toString(),10)],b=D+(this.maxHeight?0:2)+h*(d+2);y=this.parent.enableRtl?0:w,T=this.parent.enableRtl?w:0;var S=(h+1)*(d+2)+this.moreIndicatorHeight,C=!this.parent.activeViewOptions.maxEventsPerRow||this.parent.rowAutoHeight||this.parent.eventSettings.enableIndicator?this.maxOrIndicator?h<1:this.cellHeight>S:h<c;if(this.parent.rowAutoHeight||C){var O=void 0;if(O=(0,e.isNullOrUndefined)(this.inlineValue)?this.createAppointmentElement(t,i):this.parent.inlineModule.createInlineAppointmentElement(),this.applyResourceColor(O,t,"backgroundColor",this.groupOrder),(0,e.setStyleAttribute)(O,{width:f+"px",left:y+"px",right:T+"px",top:b+"px"}),this.wireAppointmentEvents(O,t),this.parent.rowAutoHeight){var E=this.parent.element.querySelector("."+ri),x=this.parent.getElementWidth(E),V=E.offsetHeight===E.clientHeight&&E.offsetWidth===E.clientWidth;this.renderEventElement(t,O,p);var A=this.getFirstChild(i);this.updateCellHeight(A,S),V&&(E.offsetWidth>E.clientWidth||x!==this.parent.getElementWidth(E))&&this.adjustAppointments(x)}else this.renderEventElement(t,O,p)}else for(var I=0;I<u;I++){var M=p.querySelector("."+Bi),k=this.parent.enableRtl?T:y;k=Math.floor(k/this.cellWidth)*this.cellWidth;var R=this.interval/this.slotCount,H="TimelineMonth"===this.parent.activeViewOptions.option||"day"===this.renderType||0!==I?new Date(this.dateRender[this.day+I].getTime()):new Date(r),P=ye(this.dateRender[this.day+I],1);if("TimelineMonth"===this.parent.activeViewOptions.option||"day"===this.renderType){var j=this.getPosition(H,P,t[this.fields.isAllDay],this.day+I);this.renderTimelineMoreIndicator(r,H,P,d,R,i,n,D,y,T,p,M,k,j)}else for(var N=(Re(a)-Re(r))/ne*this.slotCount/this.interval,L=0;L<N&&(H=0===L?new Date(H.getTime()):new Date(H.getTime()+6e4*R),N<1&&(H=this.adjustToNearestTimeSlot(H,R)),P=new Date(H.getTime()+6e4*R),!(N>=1&&P.getTime()>a.getTime()));L++){var q=this.getPosition(H,P,!1,this.day+I);if(k>q)break;k=q,this.renderTimelineMoreIndicator(r,H,P,d,R,i,n,D,y,T,p,M,k,q)}}}this.parent.renderTemplates()}}},i.prototype.adjustToNearestTimeSlot=function(e,t){var i=new Date(e),n=60*i.getHours()*60*1e3+60*i.getMinutes()*1e3,r=Math.floor(n/(60*t*1e3))*(60*t*1e3),a=new Date(i.getTime());return a.setHours(r/36e5%24),a.setMinutes(r%36e5/6e4),a},i.prototype.renderTimelineMoreIndicator=function(t,i,n,r,a,s,o,l,p,c,h,d,u,g){if(p=this.parent.enableRtl?c=g:g,u=this.parent.enableRtl?c:p,u=Math.floor(u/this.cellWidth)*this.cellWidth,h&&(0,e.isNullOrUndefined)(d)||!this.isAlreadyAvail(u,h)){var v="TimelineMonth"===this.parent.activeViewOptions.option||"day"===this.renderType?new Date(+t):i,m=new Date(v.setMinutes(Math.floor(v.getMinutes()/a)*a)),f=new Date(m.getTime()+6e4*a),y=void 0;this.parent.activeViewOptions.group.resources.length>0&&!(0,e.isNullOrUndefined)(s)&&(y=s.toString());var T=this.getFilterEvents(i,n,m,f,y,o),w=this.cellHeight-this.moreIndicatorHeight;r=this.withIndicator?w-2:r;var D=Math.floor(w/(r+2)),b=this.parent.activeViewOptions.maxEventsPerRow&&!this.parent.eventSettings.enableIndicator?T.length-this.parent.activeViewOptions.maxEventsPerRow:T.length-D<=0?1:T.length-D,S=void 0;S="day"===this.renderType?this.getMoreIndicatorElement(b,i,n):this.getMoreIndicatorElement(b,m,f),(0,e.isNullOrUndefined)(y)||S.setAttribute("data-group-index",y),S.style.top=l+w+"px",S.style.width=this.cellWidth+"px",S.style.left=Math.floor(p/this.cellWidth)*this.cellWidth+"px",S.style.right=Math.floor(c/this.cellWidth)*this.cellWidth+"px",this.renderElement(h,S),e.EventHandler.add(S,"click",this.moreIndicatorClick,this)}},i.prototype.updateCellHeight=function(t,i){if(i>(""===t.style.height?this.cellHeight:parseInt(t.style.height,10))){if((0,e.setStyleAttribute)(t,{height:i+"px"}),this.parent.activeViewOptions.group.resources.length>0){var n=this.parent.element.querySelector("."+Tt+' tbody td[data-group-index="'+t.getAttribute("data-group-index")+'"]');n&&(0,e.setStyleAttribute)(n,{height:i+"px"})}var r=this.parent.element.querySelector(".e-month-header-wrapper table tr:nth-child("+(t.parentElement.rowIndex+1)+") td");r&&(0,e.setStyleAttribute)(r,{height:i+"px"})}},i.prototype.getFirstChild=function(e){var t="."+Je+" tbody td",i="";return this.parent.activeViewOptions.group.resources.length>0&&(i='[data-group-index="'+e.toString()+'"]'),this.parent.element.querySelector(t+i)},i.prototype.updateBlockElements=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll("."+Qt));e<t.length;e++){var i=t[e],n=parseInt(i.getAttribute("data-group-index"),10),r=this.getFirstChild(n);i.style.height=r.offsetHeight+"px";var a=i.offsetWidth/r.offsetWidth;i.style.width=r.offsetWidth*a+"px"}for(var s=0,o=[].slice.call(this.element.querySelectorAll("."+Kt));s<o.length;s++){i=o[s],n=parseInt(i.getAttribute("data-group-index"),10);i.style.top=this.getRowTop(n)+this.getFirstChild(n).offsetHeight-18+"px"}},i.prototype.getStartTime=function(e,t){var i=e[this.fields.startTime],n=De(i,this.startHour,this.endHour);return i=this.isDayProcess()?e[this.fields.startTime]:n.startHour.getTime()>=t[this.fields.startTime]?n.startHour:n.endHour.getTime()<=t[this.fields.startTime]?this.getNextDay(n.startHour,t):t[this.fields.startTime],t.trimStartTime=e[this.fields.isAllDay]?n.startHour:t[this.fields.startTime],i},i.prototype.getNextDay=function(e,t){for(var i,n=1;n<=this.dateRender.length;n++)if(i=ye(e,n),-1!==this.parent.getIndexOfDate(this.dateRender,ve(new Date(e.getTime()))))return t.count=t.count-1,i;return i},i.prototype.getEndTime=function(e,t){var i=e[this.fields.endTime],n=De(i,this.startHour,this.endHour);return this.isDayProcess()?i=t[this.fields.endTime]:(i=t[this.fields.endTime],(n.endHour.getTime()<=t[this.fields.endTime]||e[this.fields.isAllDay])&&(i=n.endHour),n.startHour.getTime()>=t[this.fields.endTime].getTime()&&!e[this.fields.isAllDay]&&(i=this.getPreviousDay(n.startHour,n.endHour,t))),t.trimEndTime=e[this.fields.isAllDay]?n.endHour:t[this.fields.endTime],i},i.prototype.getPreviousDay=function(e,t,i){for(var n=1;n<=this.dateRender.length;n++){var r=ye(t,-n);if(-1!==this.parent.getIndexOfDate(this.dateRender,ve(new Date(e.getTime())))){(r=ve(new Date(r.getTime()))).setHours(t.getHours(),t.getMinutes(),t.getSeconds());var a=i.count,s=i[this.fields.endTime];return i.count=0!==s.getHours()||0!==s.getMinutes()?a-1:a,r}}return i[this.fields.endTime]},i.prototype.getEventWidth=function(e,t,i,n){return"day"===this.renderType||i?n*this.slotsPerDay*this.cellWidth:this.isSameDay(e,t)?this.getSameDayEventsWidth(e,t):this.getSpannedEventsWidth(e,t,n)},i.prototype.getSameDayEventsWidth=function(e,t){return(Re(t)-Re(e))/ne*(this.cellWidth*this.slotCount)/this.getIntervalInMinutes(e)},i.prototype.getSpannedEventsWidth=function(e,t,i){var n,r=i*this.slotsPerDay*this.cellWidth,a=De(ve(new Date(e.getTime())),this.startHour,this.endHour),s=this.getSameDayEventsWidth(a.startHour,e);if(-1===this.parent.getIndexOfDate(this.dateRender,ve(new Date(t.getTime()))))n=0;else{var o=De(ve(new Date(t.getTime())),this.startHour,this.endHour),l=o.startHour,p=o.endHour,c=this.interval/this.slotCount,h=this.getEndTimeOfLastSlot(l,p,c),d=p<h?p:h;n=this.getSameDayEventsWidth(t,d),n=this.slotsPerDay*this.cellWidth===n?0:n}var u=s+n;return r>u?r-u:r-s},i.prototype.getEndTimeOfLastSlot=function(e,t,i){var n=(t.getTime()-e.getTime())/6e4,r=Math.floor(n/i)*i,a=new Date(e);return a.setMinutes(r),a},i.prototype.isSameDay=function(e,t){return this.parent.getIndexOfDate(this.dateRender,ve(new Date(e.getTime())))===this.parent.getIndexOfDate(this.dateRender,ve(new Date(t.getTime())))},i.prototype.getAppointmentLeft=function(e,t,i){var n=this.isSameDay(t,e.startHour)?(Re(t)-Re(e.startHour))/(ne*this.getIntervalInMinutes(t))*this.slotCount:0;return 0===i?n:Math.round((Re(e.endHour)-Re(e.startHour))/this.interval/ne*this.slotCount)*i+n},i.prototype.getPosition=function(e,t,i,n){if("day"===this.renderType||i)return n*this.slotsPerDay*this.cellWidth;var r=De(ve(new Date(this.dateRender[parseInt(n.toString(),10)].getTime())),this.startHour,this.endHour);return(r.endHour.getTime()<=t.getTime()&&r.startHour.getTime()>=e.getTime()?this.getAppointmentLeft(r,r.startHour,n):r.endHour.getTime()<=t.getTime()?this.getAppointmentLeft(r,e,n):r.startHour.getTime()>=e.getTime()?this.getAppointmentLeft(r,r.startHour,n):this.getAppointmentLeft(r,e,n))*this.cellWidth},i.prototype.getFilterEvents=function(e,t,i,n,r,a){return"day"===this.renderType?this.getFilteredEvents(e,t,r,a):this.getFilteredEvents(i,n,r,a)},i.prototype.getIntervalInMinutes=function(e){if(1!==this.slotsPerDay)return this.interval;var t=De(ve(new Date(e.getTime())),this.startHour,this.endHour);return(t.endHour.getTime()-t.startHour.getTime())/ne},i.prototype.isAlreadyAvail=function(e,t){for(var i=[].slice.call(t.querySelectorAll("."+Bi)),n=0;n<i.length;n++){var r=void 0;if(i&&(r=this.parent.enableRtl?i[parseInt(n.toString(),10)].style.right:i[parseInt(n.toString(),10)].style.left),parseInt(r,10)===Math.floor(e))return!0}return!1},i.prototype.getRowTop=function(e){return this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive?this.parent.element.querySelector("."+ri+' tbody td[data-group-index="'+e.toString()+'"]').offsetTop:0},i.prototype.getCellTd=function(){var e=this.parent.uiStateValues.isGroupAdaptive?0:this.rowIndex;return this.eventContainers[parseInt(e.toString(),10)]},i.prototype.renderBlockIndicator=function(t,i,n){if(!(this.parent.headerRows.length>0&&("Hour"!==this.parent.headerRows[this.parent.headerRows.length-1].option||"Date"!==this.parent.headerRows[this.parent.headerRows.length-1].option)||(i=Math.floor(i/this.cellWidth)*this.cellWidth+this.cellWidth-22,this.isAlreadyAvail(i,t)))){var r=(0,e.createElement)("div",{className:"e-icons "+Kt});this.parent.activeViewOptions.group.resources.length>0&&r.setAttribute("data-group-index",n.toString()),this.parent.enableRtl?r.style.right=i+"px":r.style.left=i+"px",r.style.top=this.getRowTop(n)+this.cellHeight-18+"px",this.renderElement(t,r)}},i.prototype.setMaxEventHeight=function(t,i){(0,e.setStyleAttribute)(t,{height:this.cellHeight-(this.maxHeight?0:2)-(this.maxHeight?0:this.moreIndicatorHeight)+"px"})},i.prototype.isDayProcess=function(){return"TimelineMonth"===this.parent.currentView||!this.parent.activeViewOptions.timeScale.enable||this.parent.activeViewOptions.headerRows.length>0&&"Hour"!==this.parent.activeViewOptions.headerRows.slice(-1)[0].option},i.prototype.destroy=function(){this.renderType=null,this.eventContainers=null,this.dayLength=null,this.content=null,t.prototype.destroy.call(this),this.parent=null},i}(Ra),ja=function(){function t(e){this.parent=e,this.parent.on(A,this.inlineEdit,this)}return t.prototype.inlineEdit=function(e){if(this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide(),"Cell"===e.type){var t=this.parent.element.querySelector("."+en);t&&t.classList.contains(tt)&&this.parent.quickPopup.morePopup.hide(),this.removeInlineAppointmentElement(),this.cellEdit(e)}else this.parent.element.querySelector("."+dr)!==e.element.querySelector("."+dr)&&this.removeInlineAppointmentElement(),this.eventEdit(e)},t.prototype.cellEdit=function(e){var t=this.generateEventData(),i=e.element.cellIndex,n=this.getEventDaysCount(t);n>1&&(n=Math.round(n),i-=--n);var r=ve(new Date(""+t[this.parent.eventFields.startTime])).getTime(),a=ve(new Date(""+t[this.parent.eventFields.endTime])).getTime(),s=e.groupIndex||0,o="Day"===this.parent.currentView||"Week"===this.parent.currentView||"WorkWeek"===this.parent.currentView;if(this.parent.activeViewOptions.timeScale.enable&&o){var l=t[this.parent.eventFields.startTime].getDay();this.createVerticalViewInline(t,l,s,i)}else"Month"===this.parent.currentView||!this.parent.activeViewOptions.timeScale.enable&&o?this.createMonthViewInline(t,s,r,a):this.createTimelineViewInline(t,r,a,s);var p=this.parent.element.querySelector("."+dr);p&&p.focus()},t.prototype.eventEdit=function(t){var i,n=t.element.querySelector("."+dr);if(n)i=n.value;else{var r=t.element.querySelector("."+Cn);if((0,e.isNullOrUndefined)(r)?i=t.data[this.parent.eventFields.subject]:((0,e.addClass)([r],Ge),i=r.innerText),n=this.inlineInputEle=(0,e.createElement)("input",{className:dr,attrs:{value:i}}),(0,e.closest)(t.element,"."+en))t.element.insertBefore(n,r);else if(["Agenda","MonthAgenda"].indexOf(this.parent.currentView)>-1){var a=t.element.querySelector("."+$t);(0,e.isNullOrUndefined)(a)&&(a=(0,e.createElement)("div",{className:$t}),t.element.prepend(a)),a.insertBefore(n,a.firstChild)}else{var s=["TimelineDay","TimelineWeek","TimelineWorkWeek","TimelineMonth"].indexOf(this.parent.currentView)>-1?".e-inner-wrap":".e-appointment-details",o=t.element.querySelector(s);(0,e.isNullOrUndefined)(o)?t.element.querySelector(".e-appointment-details").prepend(n):o.prepend(n)}n.focus()}n.setSelectionRange(i.length,i.length)},t.prototype.createVerticalViewInline=function(e,t,i,n){var r,a=this.getEventDaysCount(e),s=new Ma(this.parent);s.initializeValues();var o=s.dateRender[parseInt(i.toString(),10)].map((function(e){return e.getDay()})).indexOf(t);if(a>=1){s.allDayElement=[].slice.call(this.parent.element.querySelectorAll("."+Ke)),(r=s.slots).push.apply(r,this.parent.activeView.renderDates.map((function(e){return+e})));var l=[].slice.call(this.parent.element.querySelectorAll("."+ji)),p=0;l.length>0&&(p=Math.floor(this.parent.getElementHeight(this.parent.element.querySelector("."+Ze))/l[0].offsetHeight)-1),s.allDayLevel=p;var c=this.parent.getElementHeightFromClass(this.parent.element.querySelector("."+Pi),Xt),h=s.allDayElement.length>0?s.allDayElement[0].offsetTop:0;s.renderAllDayEvents(e,o,i,n,this.parent.allowInline,h,c)}else s.renderNormalEvents(e,o,i,n,this.parent.allowInline)},t.prototype.createMonthViewInline=function(e,t,i,n){var r=this.getEventDaysCount(e),a=this.parent.eventBase.cloneEventObject(e,i,n,r,!1,!1),s=new Ra(this.parent);s.dateRender=this.parent.activeView.renderDates,s.inlineValue=this.parent.allowInline;var o=this.parent.activeView.renderDates,l=this.parent.activeViewOptions.workDays,p="."+$e;if(this.parent.activeViewOptions.group.resources.length>0){p+='[data-group-index="'+t+'"]';var c=this.parent.resourceBase.lastResourceLevel[parseInt(t.toString(),10)];o=c.renderDates,l=c.workDays}s.dateRender=o,s.workCells=[].slice.call(this.parent.element.querySelectorAll(p)),s.cellWidth=s.workCells[0].offsetWidth,s.cellHeight=s.workCells[0].offsetHeight,s.eventHeight=this.parent.getElementHeightFromClass(this.parent.monthModule.element||s.element,Xt),s.getSlotDates(l);for(var h=s.getRenderedDates(o),d=0,u=s.splitEvent(a,h||o);d<u.length;d++){var g=u[d];s.renderEvents(g,t)}this.parent.element.querySelector("."+dr).focus()},t.prototype.createTimelineViewInline=function(e,t,i,n){var r=this.getEventDaysCount(e),a=this.parent.eventBase.cloneEventObject(e,t,i,r,!1,!1),s=new Pa(this.parent,this.parent.activeViewOptions.timeScale.enable?"hour":"day");s.dateRender=this.parent.activeView.renderDates,s.eventContainers=[].slice.call(this.parent.element.querySelectorAll("."+Gt));var o=this.parent.element.querySelector("."+$e);s.inlineValue=this.parent.allowInline,s.cellWidth=o.offsetWidth,s.cellHeight=o.offsetHeight;var l=0===this.parent.element.querySelectorAll("."+Je+" tbody tr").length?0:this.parent.element.querySelectorAll("."+Je+" tbody tr")[0].children.length;s.slotsPerDay=l/s.dateRender.length,s.eventHeight=this.parent.getElementHeightFromClass(s.element,Xt),s.renderEvents(a,n)},t.prototype.getEventDaysCount=function(e){var t=e[this.parent.eventFields.startTime],i=e[this.parent.eventFields.endTime];return Math.abs(i.getTime()-t.getTime())/ie},t.prototype.generateEventData=function(e){var t=this.parent.element.querySelector("."+dr),i=t?t.value:e?e.innerHTML:"",n={};return n[this.parent.eventFields.id]=this.parent.eventBase.getEventMaxID(),n[this.parent.eventFields.subject]=i,n[this.parent.eventFields.startTime]=this.parent.activeCellsData.startTime,n[this.parent.eventFields.endTime]=this.parent.activeCellsData.endTime,n[this.parent.eventFields.isAllDay]=this.parent.activeCellsData.isAllDay,this.parent.eventWindow.setDefaultValueToObject(n),this.parent.resourceBase&&this.parent.resourceBase.setResourceValues(n,this.parent.activeCellsData.groupIndex),n},t.prototype.documentClick=function(e){e&&""!==e.value?this.inlineCrudActions(e):this.removeInlineAppointmentElement()},t.prototype.inlineCrudActions=function(t){if((0,e.closest)(t,"."+ur)){var i=this.generateEventData(t);this.parent.addEvent(i)}else{var n=(0,e.closest)(t,"."+Xt),r=this.parent.getEventDetails(n);r[this.parent.eventFields.subject]=t.value;var a=void 0;r[this.parent.eventFields.id]===r[this.parent.eventFields.recurrenceID]&&(a="EditOccurrence",r[this.parent.eventFields.id]=this.parent.eventBase.getEventMaxID()),this.parent.saveEvent(r,a)}this.removeInlineAppointmentElement()},t.prototype.createInlineAppointmentElement=function(t){var i=(0,e.createElement)("div",{className:Xt+" "+ur}),n=(0,e.createElement)("div",{className:Jt});i.appendChild(n);var r=this.inlineInputEle=(0,e.createElement)("input",{className:dr});return n.appendChild(r),t&&this.parent.eventBase.applyResourceColor(i,t,"backgroundColor"),i},t.prototype.removeInlineAppointmentElement=function(){var t=[].slice.call(this.parent.element.querySelectorAll("."+ur));t.length>0&&t.forEach((function(t){var i=t.querySelector("."+dr);(0,e.isNullOrUndefined)(i)||i.blur(),(0,e.remove)(t)}));var i=this.getInlineElement();if(i){var n=(0,e.closest)(i,"."+Xt).querySelector("."+Cn);(0,e.isNullOrUndefined)(n)||(0,e.removeClass)([n],Ge),(0,e.remove)(i)}this.inlineInputEle=null},t.prototype.getInlineElement=function(){return this.inlineInputEle},t.prototype.destroy=function(){this.inlineInputEle=null,this.parent.off(A,this.inlineEdit)},t}(),Na=d(741),La=d(323),qa=function(){function t(){}return t.prototype.renderFormValidator=function(e,t,i,n){var r=this;this.element=i,this.formObj=new La.FormValidator(e,{locale:n,customPlacement:function(e,t){r.errorPlacement(e,t)},rules:t,validationComplete:function(e){r.validationComplete(e)},focusout:function(e){r.focusOut(e)}})},t.prototype.focusOut=function(e){var t=e.relatedTarget;t&&(t.classList.contains("e-dlg-closeicon-btn")||t.classList.contains("e-close")||t.classList.contains(Ke)||t.classList.contains(rt)||t.classList.contains(Qi)||t.classList.contains($e)||t.classList.contains(Pn))?this.ignoreError=!0:this.ignoreError=!1},t.prototype.validationComplete=function(e){var t=this.element.querySelector("#"+e.inputName+"_Error");t&&(t.style.display="failure"===e.status?"":"none")},t.prototype.errorPlacement=function(t,i){var n=i.getAttribute("for"),r=this.element.querySelector("#"+n+"_Error");r||this.ignoreError||this.createTooltip(t,i,n,""),(0,e.isNullOrUndefined)(r)||(r.querySelector(".e-error").innerHTML=i.innerHTML)},t.prototype.createTooltip=function(t,i,n,r){var a,s,o=t.getBoundingClientRect();this.element.classList.contains(Kn)?(a=this.element,s=this.element.getBoundingClientRect()):s=(a=this.element.querySelector(".e-schedule-dialog .e-dlg-content")).getBoundingClientRect();var l=(0,e.createElement)("div",{className:"e-tooltip-wrap e-popup "+Yn,id:n+"_Error",styles:"display:"+r+";top:"+(o.bottom-s.top+a.scrollTop+9)+"px;left:"+(o.left-s.left+a.scrollLeft+o.width/2)+"px;"}),p=(0,e.createElement)("div",{className:"e-tip-content"});p.appendChild(i);var c=(0,e.createElement)("div",{className:"e-arrow-tip e-tip-top"});c.appendChild((0,e.createElement)("div",{className:"e-arrow-tip-outer e-tip-top"})),c.appendChild((0,e.createElement)("div",{className:"e-arrow-tip-inner e-tip-top"})),l.appendChild(p),l.appendChild(c),a.appendChild(l),l.style.left=parseInt(l.style.left,10)-l.offsetWidth/2+"px"},t.prototype.destroyToolTip=function(){if(this.element)for(var t=0,i=[].slice.call(this.element.querySelectorAll("."+Yn));t<i.length;t++){var n=i[t];(0,e.remove)(n)}this.formObj&&this.formObj.element&&this.formObj.reset()},t.prototype.destroy=function(){this.formObj&&this.formObj.element&&!this.formObj.isDestroyed&&this.formObj.destroy(),this.formObj=null,this.element=null},t}(),Fa=function(){function i(e){this.isMultipleEventSelect=!1,this.isCrudAction=!1,this.parent=e,this.l10n=this.parent.localeObj,this.fieldValidator=new qa,this.render(),this.addEventListener()}return i.prototype.render=function(){this.renderQuickPopup(),this.renderMorePopup(),this.renderQuickDialog()},i.prototype.renderQuickPopup=function(){var i=(0,e.createElement)("div",{className:Kn+" e-popup-close",attrs:{role:"dialog"}});this.parent.isAdaptive?(document.body.appendChild(i),(0,e.addClass)([i],Be)):this.parent.element.appendChild(i),this.quickPopup=new t.Popup(i,{targetType:this.parent.isAdaptive?"container":"relative",enableRtl:this.parent.enableRtl,open:this.quickPopupOpen.bind(this),close:this.quickPopupClose.bind(this),hideAnimation:this.parent.isAdaptive?{name:"ZoomOut"}:{name:"FadeOut",duration:150},showAnimation:this.parent.isAdaptive?{name:"ZoomIn"}:{name:"FadeIn",duration:150},collision:this.parent.isAdaptive?{X:"fit",Y:"fit"}:this.parent.enableRtl?{X:"flip",Y:"fit"}:{X:"none",Y:"fit"},position:this.parent.isAdaptive||this.parent.enableRtl?{X:"left",Y:"top"}:{X:"right",Y:"top"},viewPortElement:this.parent.isAdaptive?document.body:this.parent.element,zIndex:this.parent.isAdaptive?1004:3})},i.prototype.renderMorePopup=function(){var i='<div class="'+tn+'"><div class="e-more-event-header"><div class="'+sn+'" title="'+this.l10n.getConstant("close")+'" tabindex="0" role="button"></div><div class="'+nn+'"><div class="'+rn+'" id="'+this.parent.element.id+'_more_popup"></div><div class="'+an+" "+di+'" tabindex="0" role="link"></div></div></div></div>',n=(0,e.createElement)("div",{className:en+" e-popup-close",innerHTML:i});this.parent.isAdaptive?(document.body.appendChild(n),(0,e.addClass)([n],Be)):this.parent.element.appendChild(n),this.morePopup=new t.Popup(n,{targetType:this.parent.isAdaptive?"container":"relative",enableRtl:this.parent.enableRtl,hideAnimation:{name:"ZoomOut",duration:300},showAnimation:{name:"ZoomIn",duration:300},open:this.morePopupOpen.bind(this),close:this.morePopupClose.bind(this),collision:this.parent.isAdaptive?{X:"fit",Y:"fit"}:this.parent.enableRtl?{X:"flip",Y:"fit"}:{X:"flip",Y:"flip"},viewPortElement:this.parent.isAdaptive?document.body:this.parent.element,zIndex:this.parent.isAdaptive?1002:2}),this.morePopup.element.setAttribute("role","dialog"),this.morePopup.element.setAttribute("aria-labelledby",this.parent.element.id+"_more_popup");var r=this.morePopup.element.querySelector("."+sn);this.renderButton("e-round",Ye+" "+zn,!1,r,this.closeClick),e.EventHandler.add(this.morePopup.element.querySelector("."+an),"click",this.navigationClick,this)},i.prototype.renderQuickDialog=function(){var i=[{buttonModel:{cssClass:"e-quick-alertok e-flat",isPrimary:!0},click:this.dialogButtonClick.bind(this)},{buttonModel:{cssClass:"e-quick-alertcancel e-flat",isPrimary:!1},click:this.dialogButtonClick.bind(this)},{buttonModel:{cssClass:"e-quick-dialog-cancel e-disable e-flat",isPrimary:!1},click:this.dialogButtonClick.bind(this)}];if(this.parent.eventSettings.editFollowingEvents){var n={buttonModel:{cssClass:"e-quick-alertfollowing e-flat",isPrimary:!1},click:this.dialogButtonClick.bind(this)};i.splice(1,0,n)}this.quickDialog=new t.Dialog({animationSettings:{effect:"Zoom"},buttons:i,cssClass:"e-quick-dialog",closeOnEscape:!0,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,beforeClose:this.beforeQuickDialogClose.bind(this),isModal:!0,position:{X:"center",Y:"center"},showCloseIcon:!0,target:document.body,visible:!1,width:"auto"});var r=(0,e.createElement)("div",{id:this.parent.element.id+"QuickDialog"});this.parent.element.appendChild(r),this.quickDialog.appendTo(r);var a=this.quickDialog.element.querySelector("."+vn);a&&(a.setAttribute("aria-label",this.l10n.getConstant("occurrence")),a.setAttribute("aria-label",a.innerHTML));var s=this.quickDialog.element.querySelector("."+mn);s&&(s.setAttribute("aria-label",this.l10n.getConstant("series")),s.setAttribute("aria-label",s.innerHTML)),this.quickDialog.element.querySelector(".e-dlg-closeicon-btn")&&this.quickDialog.element.querySelector(".e-dlg-closeicon-btn").setAttribute("title",this.l10n.getConstant("close"))},i.prototype.renderButton=function(t,i,n,r,a){new Na.Button({cssClass:t,disabled:n,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,iconCss:i}).appendTo(r),e.EventHandler.add(r,"click",a,this),(0,e.removeClass)([r],Ye)},i.prototype.quickDialogClass=function(t){var i=[pn,cn,un,gn,yn,Ge],n=this.quickDialog.element.querySelector("."+vn),r=this.quickDialog.element.querySelector("."+mn),a=this.quickDialog.element.querySelector("."+fn);switch((0,e.removeClass)([n,r],i),(0,e.addClass)([this.quickDialog.element.querySelector("."+gn)],Ge),this.parent.eventSettings.editFollowingEvents&&((0,e.addClass)([a],Ge),(0,e.removeClass)([this.quickDialog.element],dn)),t){case"Recurrence":(0,e.addClass)([n],pn),(0,e.addClass)([r],cn),this.parent.eventSettings.editFollowingEvents&&((0,e.removeClass)([a],Ge),(0,e.addClass)([this.quickDialog.element],dn),(0,e.addClass)([a],hn));break;case"Delete":(0,e.addClass)([n],un),(0,e.addClass)([r],gn);break;case"Alert":(0,e.addClass)([n],[vn,yn]),(0,e.addClass)([r],[mn,Ge])}},i.prototype.applyFormValidation=function(){var e=this.quickPopup.element.querySelector("."+wn),t={};t[this.parent.eventSettings.fields.subject.name]=this.parent.eventSettings.fields.subject.validation,this.fieldValidator.renderFormValidator(e,t,this.quickPopup.element,this.parent.locale)},i.prototype.openRecurrenceAlert=function(){var e=this.quickDialog.element.querySelector("."+vn);e&&(e.innerHTML=this.l10n.getConstant("Delete"===this.parent.currentAction?"deleteEvent":"editEvent"),e.setAttribute("aria-label",e.innerHTML));var t=this.quickDialog.element.querySelector("."+fn);t&&(t.innerHTML=this.l10n.getConstant("editFollowingEvent"),t.setAttribute("aria-label",t.innerHTML));var i=this.quickDialog.element.querySelector("."+mn);i&&(i.innerHTML=this.l10n.getConstant("Delete"===this.parent.currentAction?"deleteSeries":"editSeries"),i.setAttribute("aria-label",i.innerHTML)),this.quickDialog.content=this.l10n.getConstant("editContent"),this.quickDialog.header=this.l10n.getConstant("Delete"===this.parent.currentAction?"deleteTitle":"editTitle"),this.quickDialogClass("Recurrence"),this.showQuickDialog("RecurrenceAlert")},i.prototype.openRecurrenceValidationAlert=function(t){this.quickDialogClass("Alert");var i=this.quickDialog.element.querySelector("."+vn);i.innerHTML=this.l10n.getConstant("ok"),i.setAttribute("aria-label",i.innerHTML);var n,r=this.quickDialog.element.querySelector("."+mn);switch(r.innerHTML=this.l10n.getConstant("cancel"),r.setAttribute("aria-label",r.innerHTML),this.quickDialog.header=this.l10n.getConstant("alert"),t){case"wrongPattern":(0,e.addClass)([r],Ge),this.quickDialog.content=this.l10n.getConstant("wrongPattern");break;case"createError":(0,e.addClass)([r],Ge),this.quickDialog.content=this.l10n.getConstant("createError");break;case"sameDayAlert":(0,e.addClass)([r],Ge),this.quickDialog.content=this.l10n.getConstant("sameDayAlert");break;case"seriesChangeAlert":n=this.quickDialog.element.querySelector("."+gn),(0,e.removeClass)([r,n],Ge),this.quickDialog.content=this.l10n.getConstant("seriesChangeAlert"),i.innerHTML=this.l10n.getConstant("yes"),r.innerHTML=this.l10n.getConstant("no"),n.innerHTML=this.l10n.getConstant("cancel");break;case"occurrenceAlert":(0,e.addClass)([r],Ge),this.quickDialog.content=this.l10n.getConstant("occurenceAlert")}(!this.parent.enableRecurrenceValidation&&"wrongPattern"===t||this.parent.enableRecurrenceValidation)&&this.showQuickDialog("RecurrenceValidationAlert")},i.prototype.openDeleteAlert=function(){if(!this.parent.activeViewOptions.readonly){var e=this.quickDialog.element.querySelector("."+vn);e&&(e.innerHTML=this.l10n.getConstant("delete"),e.setAttribute("aria-label",e.innerHTML));var t=this.quickDialog.element.querySelector("."+mn);t&&(t.innerHTML=this.l10n.getConstant("cancel"),t.setAttribute("aria-label",t.innerHTML)),this.quickDialog.content=this.parent.activeEventData.event.length>1?this.l10n.getConstant("deleteMultipleContent"):this.l10n.getConstant("deleteContent"),this.quickDialog.header=this.parent.activeEventData.event.length>1?this.l10n.getConstant("deleteMultipleEvent"):this.l10n.getConstant("deleteEvent"),this.quickDialogClass("Delete"),this.showQuickDialog("DeleteAlert")}},i.prototype.openValidationError=function(e,t){this.quickDialog.header=this.l10n.getConstant("alert"),this.quickDialog.content=this.l10n.getConstant(e);var i=this.quickDialog.element.querySelector("."+vn);i&&(i.innerHTML=this.l10n.getConstant("ok"),i.setAttribute("aria-label",i.innerHTML));var n=this.quickDialog.element.querySelector("."+mn);n&&(n.innerHTML=this.l10n.getConstant("cancel"),i.setAttribute("aria-label",n.innerHTML)),this.quickDialogClass("Alert"),this.showQuickDialog("overlapAlert"===e?"OverlapAlert":"ValidationAlert",t)},i.prototype.showQuickDialog=function(t,i){var n=this;this.quickDialog.dataBind();var r={type:t,cancel:!1,element:this.quickDialog.element,data:(0,e.extend)({},i||this.parent.activeEventData.event,null,!0)};this.parent.activeViewOptions.allowOverlap||(r.overlapEvents=this.parent.overlapAppointments),this.parent.trigger(D,r,(function(e){e.cancel||n.quickDialog.show()}))},i.prototype.createMoreEventList=function(t,i,n){var r=this,a=this.parent.eventFields,s=(0,e.createElement)("div",{className:on}),o=(0,e.createElement)("div",{className:ln});if(0===t.length)o=(0,e.createElement)("div",{className:on,innerHTML:this.l10n.getConstant("emptyContainer")});else for(var l=function(t){var s=t[a.subject]||p.parent.eventSettings.fields.subject.default||p.parent.localeObj.getConstant("addTitle"),l=(0,e.createElement)("div",{className:Xt,attrs:{"data-id":""+t[a.id],"data-guid":t.Guid,role:"button",tabindex:"0","aria-disabled":p.parent.eventBase.getReadonlyAttribute(t),"aria-label":p.parent.getAnnouncementString(t)}});t[a.isReadonly]&&(0,e.addClass)([l],"e-read-only");var c=void 0;if((0,e.isNullOrUndefined)(p.parent.activeViewOptions.eventTemplate))l.appendChild((0,e.createElement)("div",{className:Cn})),p.parent.sanitize(s,l.firstElementChild);else{var h=p.parent.element.id+"_"+p.parent.activeViewOptions.eventTemplateName+"eventTemplate";c=p.parent.getAppointmentTemplate()(t,p.parent,"eventTemplate",h,!1,void 0,void 0,p.parent.root),(0,e.append)(c,l)}if((0,e.isNullOrUndefined)(n)||l.setAttribute("data-group-index",n),!(0,e.isNullOrUndefined)(t[a.recurrenceRule])){var d=t[a.id]===t[a.recurrenceID]?ki:Ri;l.appendChild((0,e.createElement)("div",{className:Ye+" "+d}))}var u={data:(0,e.extend)({},t,null,!0),element:l,cancel:!1};p.parent.trigger(y,u,(function(e){if(!e.cancel){o.appendChild(l);var n=r.parent.isAdaptive||"Year"===r.parent.currentView;r.parent.eventBase.wireAppointmentEvents(l,t,n),r.parent.eventBase.applyResourceColor(l,t,"backgroundColor",i)}}))},p=this,c=0,h=t;c<h.length;c++){l(h[c])}return s.appendChild(o),s},i.prototype.tapHoldEventPopup=function(t){var i=(0,e.closest)(t.target,"."+Xt);this.parent.selectedElements=[],this.isMultipleEventSelect=!0,this.parent.eventBase.getSelectedEventElements(i),this.parent.activeEventData=this.parent.eventBase.getSelectedEvents();var n=i.getAttribute("data-guid"),r=this.parent.eventBase.getEventByGuid(n);if(!(0,e.isNullOrUndefined)(r)){var a=r[this.parent.eventFields.subject]||this.l10n.getConstant("noTitle"),s='<div class="e-multiple-event-popup"><div class="'+Yi+'"><button class="'+Wn+'" title="'+this.l10n.getConstant("close")+'"></button><div class="'+Cn+'">'+a+'</div><button class="'+qn+'" title="'+this.l10n.getConstant("edit")+'"></button><button class="'+Un+'" title="'+this.l10n.getConstant("delete")+'"></button></div></div>';this.quickPopup.element.innerHTML=s;var o=this.quickPopup.element.querySelector("."+Wn);this.renderButton("e-flat e-round e-small",Ye+" "+zn,!1,o,this.closeClick);var l=this.parent.activeViewOptions.readonly||r[this.parent.eventFields.isReadonly],p=!this.parent.eventSettings.allowEditing||l,c=!this.parent.eventSettings.allowDeleting||l,h=this.quickPopup.element.querySelector("."+qn);h&&this.renderButton("e-flat e-round e-small",Ye+" "+Fn,p,h,this.editClick);var d=this.quickPopup.element.querySelector("."+Un);d&&this.renderButton("e-flat e-round e-small",Ye+" "+Bn,c,d,this.deleteClick),this.beforeQuickPopupOpen(i,this.parent.eventBase.getPageCoordinates(t))}},i.prototype.isCellBlocked=function(e){var t={};if(t[this.parent.eventFields.startTime]=this.parent.activeCellsData.startTime,t[this.parent.eventFields.endTime]=this.parent.activeCellsData.endTime,t[this.parent.eventFields.isAllDay]=this.parent.activeCellsData.isAllDay,this.parent.activeViewOptions.group.resources.length>0){var i=e.element instanceof Array?e.element[0]:e.element,n=parseInt(i.getAttribute("data-group-index"),10);this.parent.resourceBase.setResourceValues(t,isNaN(n)?null:n)}return this.parent.eventBase.isBlockRange(t)},i.prototype.cellClick=function(t){var i=new Date(t.startTime.getTime());if(this.parent.showQuickInfo&&this.parent.eventSettings.allowAdding&&"MonthAgenda"!==this.parent.currentView&&!this.isCellBlocked(t)&&this.parent.isMinMaxDate(new Date(i.setHours(0,0,0,0)))){var n=(0,e.isNullOrUndefined)(t.event)?t.element:t.event.target;if(this.parent.isAdaptive){this.quickPopupHide();var r=this.parent.element.querySelector("."+bi);(0,e.isNullOrUndefined)(r)&&(r=(0,e.createElement)("div",{className:bi,innerHTML:'<div class="e-title">+ '+this.l10n.getConstant("newEvent")+"</div>"}));var a=(0,e.closest)(n,"."+$e+",."+Ke);a&&a.appendChild(r)}else{var s=(0,e.closest)(n,"."+$e+",."+Ke+",."+rt);if(!(0,e.isNullOrUndefined)(s)&&!n.classList.contains(Bi))if(this.quickPopup.relateTo===s&&this.quickPopup.element.classList.contains(tt)){var o=this.quickPopup.element.querySelector("."+Cn);o&&o.focus()}else{this.quickPopup.element&&this.destroyPopupButtons("quickPopup");var l={};l[this.parent.eventFields.startTime]=this.parent.activeCellsData.startTime,l[this.parent.eventFields.endTime]=this.parent.activeCellsData.endTime,l[this.parent.eventFields.isAllDay]=this.parent.activeCellsData.isAllDay;var p=(0,e.createElement)("div",{className:Wi});p.appendChild(this.getPopupHeader("Cell",l)),p.appendChild(this.getPopupContent("Cell",t,l)),p.appendChild(this.getPopupFooter("Cell",l)),this.quickPopup.element.setAttribute("aria-label",this.l10n.getConstant("newEvent"));var c=p.querySelector("."+Cn);c&&La.Input.createInput({element:c,properties:{placeholder:this.l10n.getConstant("addTitle")}}),(0,e.isNullOrUndefined)(this.parent.eventSettings.fields.subject.default)||(c.value=this.parent.eventSettings.fields.subject.default);var h=p.querySelector("."+Wn);h&&this.renderButton("e-flat e-round e-small",Ye+" "+zn,!1,h,this.popupClose);var d=p.querySelector("."+Qi);d&&this.renderButton("e-flat","",!1,d,this.detailsClick);var u=p.querySelector("."+Ki);u&&this.renderButton("e-flat e-primary","",this.parent.activeViewOptions.readonly,u,this.saveClick),this.morePopup&&this.morePopup.hide(),this.quickPopup.content=p,this.quickPopup.relateTo=s,this.quickPopup.dataBind(),this.beforeQuickPopupOpen(s,this.parent.eventBase.getPageCoordinates(t.event))}}}else this.quickPopupHide()},i.prototype.isSameEventClick=function(t){if(this.quickPopup.relateTo===(0,e.closest)(t.element,"."+Xt)&&this.quickPopup.element.classList.contains(tt)){var i=this.quickPopup.element.querySelector("."+qn);if(i&&i.focus(),!this.parent.isAdaptive){var n=this.quickPopup.element.querySelector("."+Zi);n&&n.focus()}return!0}return!1},i.prototype.isQuickTemplate=function(e){return"Both"===this.parent.quickInfoTemplates.templateType||this.parent.quickInfoTemplates.templateType===e},i.prototype.eventClick=function(t){if(this.parent.eventTooltip&&this.parent.eventTooltip.close(),this.parent.showQuickInfo)if(this.parent.isAdaptive&&this.isMultipleEventSelect)this.updateTapHoldEventPopup((0,e.closest)(t.element,"."+Xt));else{var i=this.isSameEventClick(t);if(this.parent.selectedElements=[],i)return;this.quickPopup.element&&this.destroyPopupButtons("quickPopup");var n=t.event,r=(0,e.createElement)("div",{className:zi});r.appendChild(this.getPopupHeader("Event",n)),r.appendChild(this.getPopupContent("Event",t,n)),r.appendChild(this.getPopupFooter("Event",n)),this.quickPopup.element.setAttribute("aria-label",this.l10n.getConstant("editEvent"));var a=this.parent.activeViewOptions.readonly||n[this.parent.eventFields.isReadonly],s=!this.parent.eventSettings.allowEditing||a,o=!this.parent.eventSettings.allowDeleting||a,l=r.querySelector("."+qn),p="e-flat e-round e-small";l&&this.renderButton(p,Ye+" "+Fn,s,l,this.editClick);var c=r.querySelector("."+Un);c&&this.renderButton(p,Ye+" "+Bn,o,c,this.deleteClick);var h=r.querySelector("."+Wn);h&&this.renderButton(p,Ye+" "+zn,!1,h,this.popupClose);var d=r.querySelector("."+Zi);d&&this.renderButton("e-flat e-primary","",s,d,this.editClick);var u=r.querySelector("."+Ji);u&&this.renderButton("e-flat","",o,u,this.deleteClick),this.morePopup&&!(0,e.closest)(t.element,"."+ln)&&this.morePopup.hide(),this.quickPopup.content=r,this.quickPopup.relateTo=this.parent.isAdaptive?document.body:(0,e.closest)(t.element,"."+Xt),this.quickPopup.dataBind(),this.beforeQuickPopupOpen(t.element,this.parent.eventBase.getPageCoordinates(t.originalEvent))}},i.prototype.getPopupHeader=function(t,i){var n=(0,e.createElement)("div",{className:Yi});if(this.isQuickTemplate(t)&&this.parent.quickInfoTemplates.header){var r=(0,e.extend)({},i,{elementType:t.toLowerCase()},!0),a=this.parent.element.id,s=[].slice.call(this.parent.getQuickInfoTemplatesHeader()(r,this.parent,"header",a+"_headerTemplate",!1));(0,e.append)([].slice.call(s),n)}else{var o=void 0,l=void 0;switch(t){case"Cell":o='<div class="'+_i+'"><button class="'+Wn+'" title="'+this.l10n.getConstant("close")+'"></button></div>';break;case"Event":l=this.getFormattedString(i),o='<div class="'+_i+'"><button class="'+qn+" "+Ye+'" title="'+this.l10n.getConstant("edit")+'"></button><button class="'+Un+" "+Ye+'" title="'+this.l10n.getConstant("delete")+'"></button><button class="'+Wn+'" title="'+this.l10n.getConstant("close")+'"></button></div><div class="'+$t+'"><div class="'+Cn+" "+$i+'" title="'+(l.eventSubject?l.eventSubject.replaceAll('"',"'"):l.eventSubject)+'"></div></div >'}var p=(0,e.createElement)("div",{innerHTML:o});if("Event"===t){var c=p.querySelector("."+Cn);this.parent.sanitize(l.eventSubject,c)}(0,e.append)([].slice.call(p.childNodes),n)}return n},i.prototype.getPopupContent=function(t,i,n){var r=(0,e.createElement)("div",{className:"e-popup-content"});if(this.isQuickTemplate(t)&&this.parent.quickInfoTemplates.content){var a=(0,e.extend)({},n,{elementType:t.toLowerCase()},!0),s=this.parent.element.id,o=[].slice.call(this.parent.getQuickInfoTemplatesContent()(a,this.parent,"content",s+"_contentTemplate",!1));(0,e.append)([].slice.call(o),r)}else{var l=void 0,p=void 0,c=void 0,h=this.getResourceText(i,t.toLowerCase());switch(t){case"Cell":p=this.getFormattedString(n),l='<table class="e-popup-table"><tbody><tr><td><form class="'+wn+'" onsubmit="return false;"><input class="'+Cn+' e-field" type="text" name="'+this.parent.eventFields.subject+'" /></form></td></tr><tr><td><div class="'+vi+'"><div class="'+ar+" "+Ye+'"></div><div class="'+Xi+" "+$i+'">'+p.details+"</div></div>"+(this.parent.activeViewOptions.group.resources.length>0?'<div class="'+ir+'"><div class="'+nr+" "+Ye+' "></div><div class="'+rr+" "+$i+'"></div></div>':"")+"</td></tr></tbody></table>";break;case"Event":c=this.getFormattedString(n),l='<div class="'+vi+'"><div class="'+ar+" "+Ye+'"></div><div class="e-date-time-wrapper '+$i+'"><div class="'+Xi+" "+$i+'">'+c.details+"</div>",n[this.parent.eventFields.recurrenceRule]&&(l+='<div class="e-recurrence-summary '+$i+'">'+this.getRecurrenceSummary(n)+"</div>"),l+="</div></div>",n[this.parent.eventFields.location]&&(l+='<div class="'+On+'"><div class="e-location-icon '+Ye+'"></div><div class="'+En+" "+$i+'"></div></div>'),(n[this.parent.eventFields.startTimezone]||n[this.parent.eventFields.endTimezone])&&(l+='<div class="'+bn+'"><div class="e-time-zone-icon '+Ye+'"></div><div class="e-time-zone-details '+$i+'">'+this.getTimezone(n)+"</div></div>"),n[this.parent.eventFields.description]&&(l+='<div class="'+An+'"><div class="e-description-icon '+Ye+'"></div><div class="'+In+" "+$i+'"></div></div>'),this.parent.resourceCollection.length>0&&(l+='<div class="'+ir+'"><div class="'+nr+" "+Ye+'"></div><div class="'+rr+" "+$i+'"></div></div>')}var d=(0,e.createElement)("div",{innerHTML:l});if(n[this.parent.eventFields.location]){var u=d.querySelector("."+En);(0,e.isNullOrUndefined)(u)||this.parent.sanitize(n[this.parent.eventFields.location],u)}if(n[this.parent.eventFields.description]){var g=d.querySelector("."+In);(0,e.isNullOrUndefined)(g)||this.parent.sanitize(n[this.parent.eventFields.description],g)}if(h){var v=d.querySelector("."+rr);(0,e.isNullOrUndefined)(v)||this.parent.sanitize(h,v)}(0,e.append)([].slice.call(d.childNodes),r)}return r},i.prototype.getPopupFooter=function(t,i){var n=(0,e.createElement)("div",{className:Gi});if(this.isQuickTemplate(t)&&this.parent.quickInfoTemplates.footer){var r=(0,e.extend)({},i,{elementType:t.toLowerCase()},!0),a=this.parent.element.id,s=[].slice.call(this.parent.getQuickInfoTemplatesFooter()(r,this.parent,"footer",a+"_footerTemplate",!1));(0,e.append)([].slice.call(s),n)}else{var o=void 0;switch(t){case"Cell":o='<button class="'+Qi+" "+$i+'" title="'+this.l10n.getConstant("moreDetails")+'">'+this.l10n.getConstant("moreDetails")+'</button><button class="'+Ki+" "+$i+'" title="'+this.l10n.getConstant("save")+'">'+this.l10n.getConstant("save")+"</button>";break;case"Event":o=this.parent.isAdaptive?"":'<button class="'+Zi+" "+$i+'" title="'+this.l10n.getConstant("edit")+'">'+this.l10n.getConstant("edit")+'</button><button class="'+Ji+" "+$i+'" title="'+this.l10n.getConstant("delete")+'">'+this.l10n.getConstant("delete")+"</button>"}var l=(0,e.createElement)("div",{innerHTML:o});(0,e.append)([].slice.call(l.childNodes),n)}return n},i.prototype.getResourceText=function(t,i){if(0===this.parent.resourceCollection.length)return null;var n="";if(0===this.parent.activeViewOptions.group.resources.length){var r=this.parent.resourceBase.resourceCollection.slice(-1)[0],a=r.dataSource;if("event"===i)for(var s=t.event,o=function(e){var t=s[r.field];if(t instanceof Array){if(t.indexOf(e[r.idField])>-1){var i=t[t.indexOf(e[r.idField])],o=a.filter((function(e){return e[r.idField]===i}))[0];n+=""===n?o[r.textField]:", "+o[r.textField]}}else e[r.idField]===t&&(n=e[r.textField].toString())},l=0,p=a;l<p.length;l++){o(p[l])}else n=a[0][r.textField].toString()}else if("event"===i){s=t.event,a=void 0;for(var c,h=this.parent.resourceBase.resourceCollection.length-1;h>=0;h--)if(a=s[this.parent.resourceBase.resourceCollection[parseInt(h.toString(),10)].field],!(0,e.isNullOrUndefined)(a)){c=this.parent.resourceBase.resourceCollection[parseInt(h.toString(),10)];break}Array.isArray(a)||(a=[a]);var d=[],u=c.dataSource;a.forEach((function(e){var t,i=Ae(u,c.idField,e);i>-1&&(t=u[parseInt(i.toString(),10)][c.textField]),t&&d.push(t)})),n=d.join(", ")}else{var g=t,v=(0,e.isNullOrUndefined)(g.groupIndex)?0:g.groupIndex,m=this.parent.resourceBase.lastResourceLevel[parseInt(v.toString(),10)];n=m.resourceData[m.resource.textField]}return n},i.prototype.getFormattedString=function(e){var t=this.parent.eventFields,i=e[t.subject]||this.l10n.getConstant("noTitle"),n=e[t.startTime],r=e[t.endTime],a=this.getDateFormat(n,"long"),s=e[t.isAllDay]&&0===r.getHours()&&0===r.getMinutes()?this.getDateFormat(ye(new Date(r.getTime()),-1),"long"):this.getDateFormat(r,"long"),o=this.parent.getTimeString(n),l=this.parent.getTimeString(r),p="",c=r.getDate()!==n.getDate()&&(r.getTime()-n.getTime())/36e5<24?1:0;return e[t.isAllDay]?(p=a+" ("+this.l10n.getConstant("allDay")+")",(Re(r)-Re(n))/ie>1&&(p+=" - "+s+" ("+this.l10n.getConstant("allDay")+")")):p=(Re(r)-Re(n))/ie>=1||c>0?a+" ("+o+") - "+s+" ("+l+")":a+" ("+o+" - "+l+")",{eventSubject:i,details:p}},i.prototype.moreEventClick=function(t,i,n){var r=this;this.quickPopupHide(!0);var a=this.morePopup.element.querySelector("."+on);a&&(0,e.remove)(a);var s=t.date.getTime().toString(),o=(0,e.closest)(t.element,"."+Bi+",."+$e),l=this.parent.globalize.formatDate(t.date,{format:"E",calendar:this.parent.getCalendarMode()});this.morePopup.element.querySelector("."+rn).innerHTML=je(l,"single");var p,c=this.morePopup.element.querySelector("."+an);c.innerHTML=this.getDateFormat(t.date,"d"),c.setAttribute("data-date",s),c.setAttribute("data-end-date",i.getTime().toString()),(0,e.isNullOrUndefined)(n)||(c.setAttribute("data-group-index",n),p=this.parent.resourceBase.lastResourceLevel[parseInt(n,10)].groupOrder);var h=this.createMoreEventList(t.event,p,n);if(this.morePopup.element.querySelector("."+tn).appendChild(h),(0,e.removeClass)(this.morePopup.element.querySelector("."+nn).childNodes,lt),ve(t.date).getTime()===ve(this.parent.getCurrentTime()).getTime()&&(0,e.addClass)(this.morePopup.element.querySelector("."+nn).childNodes,lt),!this.parent.isAdaptive)if(-1!==this.parent.currentView.indexOf("Timeline")){var d=o.getAttribute("data-group-index"),u=new Date(parseInt(o.getAttribute("data-start-date"),10));u.setHours(u.getHours(),u.getMinutes(),0);var g=u.getTime().toString();if((0,e.isNullOrUndefined)(d))this.morePopup.relateTo=this.parent.element.querySelector("."+ri+' tbody tr td[data-date="'+g+'"]');else if(this.morePopup.relateTo=this.parent.element.querySelector("."+ri+' tbody tr td[data-group-index="'+d+'"][data-date="'+g+'"]'),(0,e.isNullOrUndefined)(this.morePopup.relateTo))for(var v=[].slice.call(this.parent.element.querySelectorAll("."+ri+' tbody tr td[data-group-index="'+d+'"]')),m=0;m<v.length;m++){v[parseInt(m.toString(),10)].getAttribute("data-date")<g&&(this.morePopup.relateTo=v[parseInt(m.toString(),10)])}}else this.morePopup.relateTo=(0,e.closest)(o,"."+$e);this.parent.renderTemplates((function(){var e={type:"EventContainer",cancel:!1,element:r.morePopup.element,data:t};r.parent.trigger(D,e,(function(e){e.cancel||r.morePopup.show()}))}))},i.prototype.saveClick=function(e){this.applyFormValidation(),this.dialogEvent=e,this.isCrudAction=!0,this.quickPopupHide()},i.prototype.detailsClick=function(t){var i=this.quickPopup.element.querySelector("."+Cn);i&&""!==i.value&&(0,e.extend)(this.parent.activeCellsData,{subject:i.value}),this.dialogEvent=t,this.isCrudAction=!1,this.fieldValidator.destroyToolTip(),this.quickPopupHide(),this.parent.eventWindow.openEditor(this.parent.activeCellsData,"Add")},i.prototype.editClick=function(t){this.dialogEvent=t,this.quickPopupHide(!0);var i=this.parent.activeEventData.event;this.parent.currentAction="EditSeries",(0,e.isNullOrUndefined)(i[this.parent.eventFields.recurrenceRule])?this.parent.eventWindow.openEditor(i,this.parent.currentAction):(this.parent.currentAction="EditOccurrence",this.openRecurrenceAlert())},i.prototype.deleteClick=function(e){this.dialogEvent=e,this.quickPopupHide(!0),this.parent.currentAction="Delete",this.parent.activeEventData.event[this.parent.eventFields.recurrenceRule]?this.openRecurrenceAlert():this.openDeleteAlert()},i.prototype.updateMoreEventContent=function(){if(!this.morePopup.element.classList.contains("e-popup-close")){var t=this.morePopup.element.querySelector("."+on);t&&(0,e.remove)(t);var i,n,r=this.morePopup.element.querySelector("."+an),a=new Date(parseInt(r.getAttribute("data-date"),10)),s=new Date(parseInt(r.getAttribute("data-end-date"),10)),o=r.getAttribute("data-group-index");(0,e.isNullOrUndefined)(o)||(n=(i=this.parent.resourceBase.lastResourceLevel[parseInt(o,10)]).groupOrder);var l=this.parent.eventBase.filterEvents(a,s,this.parent.eventsProcessed,i),p=this.createMoreEventList(l,n,o);this.morePopup.element.querySelector("."+tn).appendChild(p)}},i.prototype.closeClick=function(e){this.dialogEvent=e,"Year"===this.parent.currentView&&this.parent.activeCellsData&&this.parent.activeCellsData.element&&this.parent.selectCell(this.parent.activeCellsData.element),this.quickPopupHide(),this.morePopup.hide()},i.prototype.dialogButtonClick=function(e){this.dialogEvent=e,this.quickDialog.hide();var t=e.target,i=this.quickDialog.element.querySelector("."+mn),n=this.parent.activeEventData.event;if(t.classList.contains(pn))switch(this.parent.currentAction="Delete"===this.parent.currentAction?"DeleteOccurrence":"EditOccurrence",this.parent.currentAction){case"EditOccurrence":this.parent.eventWindow.openEditor(n,this.parent.currentAction);break;case"DeleteOccurrence":this.parent.crudModule.deleteEvent(n,this.parent.currentAction)}else if(t.classList.contains(hn))switch(this.parent.currentAction="Delete"===this.parent.currentAction?"DeleteFollowingEvents":"EditFollowingEvents",this.parent.currentAction){case"EditFollowingEvents":this.parent.eventWindow.openEditor(n,this.parent.currentAction);break;case"DeleteFollowingEvents":this.parent.crudModule.deleteEvent(n,this.parent.currentAction)}else if(t.classList.contains(cn))switch(this.parent.currentAction="Delete"===this.parent.currentAction?"DeleteSeries":"EditSeries",this.parent.currentAction){case"EditSeries":this.parent.eventWindow.openEditor(this.parent.eventBase.getParentEvent(n,!0),this.parent.currentAction);break;case"DeleteSeries":this.parent.crudModule.deleteEvent(n,this.parent.currentAction)}else t.classList.contains(un)?this.parent.crudModule.deleteEvent(n,this.parent.currentAction):!i.classList.contains(Ge)&&(t.classList.contains(vn)||t.classList.contains(mn)&&!i.classList.contains(gn))&&(this.parent.uiStateValues.isIgnoreOccurrence=t.classList.contains(mn),this.parent.eventWindow.eventSave(e,this.l10n.getConstant("ok")))},i.prototype.updateTapHoldEventPopup=function(t){var i=this.parent.eventBase.getSelectedEventElements(t);if(this.parent.activeEventData=this.parent.eventBase.getSelectedEvents(),i.length>0){var n=this.parent.eventBase.getEventByGuid(i[0].getAttribute("data-guid")),r=1===i.length?n[this.parent.eventFields.subject]||this.l10n.getConstant("noTitle"):"("+i.length+") "+this.l10n.getConstant("selectedItems");this.quickPopup.element.querySelector("."+Cn).innerHTML=r,i.length>1?(0,e.addClass)([this.quickPopup.element.querySelector("."+Fn)],Xn):(0,e.removeClass)([this.quickPopup.element.querySelector("."+Fn)],Xn)}else this.parent.selectedElements=[],this.quickPopupHide()},i.prototype.getTimezone=function(e){var t="";return t+=e[this.parent.eventFields.startTimezone]||"",t+=""===t?"":" - ",t+=e[this.parent.eventFields.endTimezone]||""},i.prototype.getRecurrenceSummary=function(e){var t=this.parent.eventWindow.getRecurrenceEditorInstance();if(t){var i=t.getRuleSummary(e[this.parent.eventFields.recurrenceRule]);return i.charAt(0).toUpperCase()+i.slice(1)}return""},i.prototype.getDateFormat=function(e,t){return je(this.parent.globalize.formatDate(e,{skeleton:t,calendar:this.parent.getCalendarMode()}),"single")},i.prototype.getDataFromTarget=function(e){if(e.classList.contains(Xt))return this.parent.activeEventData.event;var t={startTime:this.parent.activeCellsData.startTime,endTime:this.parent.activeCellsData.endTime,isAllDay:this.parent.activeCellsData.isAllDay,groupIndex:this.parent.activeCellsData.groupIndex},i=this.parent.activeCellsData;return this.parent.eventWindow.convertToEventData(i,t),t},i.prototype.beforeQuickDialogClose=function(t){var i=this,n={event:t.event||this.dialogEvent,type:(0,e.isNullOrUndefined)(this.parent.activeEventData.event)?"ValidationAlert":(0,e.isNullOrUndefined)(this.parent.activeEventData.event[this.parent.eventFields.recurrenceRule])?"DeleteAlert":"RecurrenceAlert",cancel:!1,data:this.parent.activeEventData.event,element:this.quickDialog.element};this.parent.trigger(b,n,(function(e){e.cancel||i.parent.eventBase.focusElement(!0)}))},i.prototype.beforeQuickPopupOpen=function(i,n){var r=this;this.parent.renderTemplates((function(){var a=r.quickPopup.element.querySelector("."+zi),s=r.parent.isAdaptive?a?"ViewEventInfo":"EditEventInfo":"QuickInfo",o={type:s,cancel:!1,data:(0,e.extend)({},r.getDataFromTarget(i),null,!0),target:i,element:r.quickPopup.element};r.parent.trigger(D,o,(function(o){if(o.cancel)r.quickPopupHide(),r.destroyPopupButtons("quickPopup"),o.element.classList.contains(tt)&&r.quickPopupClose(),Me(r.quickPopup.element),r.isMultipleEventSelect=!1;else{var l=r.quickPopup.element.style.display;if(r.quickPopup.element.style.display="block",r.parent.isAdaptive)r.quickPopup.element.removeAttribute("style"),r.quickPopup.element.style.display="block",r.quickPopup.element.style.height=(0,e.formatUnit)("EditEventInfo"===s?65:window.innerHeight);else{var p=r.parent.virtualScrollModule&&r.parent.virtualScrollModule.isHorizontalScroll&&!(0,e.isNullOrUndefined)((0,e.closest)(i,"."+Je)),c=r.parent.element.querySelector("."+ri+" table");r.quickPopup.offsetX=p&&!r.parent.enableRtl?oe(c)+10:10,r.quickPopup.offsetY=r.parent.virtualScrollModule&&!r.parent.virtualScrollModule.isHorizontalScroll?r.quickPopup.offsetY:0,r.quickPopup.collision={X:r.parent.enableRtl?"flip":"none",Y:"fit"},r.quickPopup.position={X:r.parent.enableRtl?"left":"right",Y:r.parent.enableRtl?"bottom":"top"},r.quickPopup.dataBind(),r.quickPopup.refreshPosition(null,!0);var h=(0,t.isCollide)(r.quickPopup.element,r.parent.element);if(h.indexOf(r.parent.enableRtl?"left":"right")>-1)r.quickPopup.offsetX=-i.offsetWidth-10-r.quickPopup.element.offsetWidth,p&&!r.parent.enableRtl&&(r.quickPopup.offsetX=oe(c)+r.quickPopup.offsetX),r.quickPopup.dataBind(),r.quickPopup.refreshPosition(null,!0),(0,t.isCollide)(r.quickPopup.element,r.parent.element).indexOf("left")>-1&&(r.quickPopup.position={X:"center",Y:"center"},r.quickPopup.collision={X:"fit",Y:"fit"},r.quickPopup.offsetX=-r.quickPopup.element.offsetWidth/2,r.quickPopup.dataBind());if(r.parent.virtualScrollModule&&!r.parent.virtualScrollModule.isHorizontalScroll&&(h.indexOf("top")>-1||h.indexOf("bottom")>-1)){var d=se(c);r.quickPopup.offsetY=d,r.quickPopup.dataBind(),r.quickPopup.refreshPosition(null,!0)}if("center"===r.quickPopup.position.X&&"center"===r.quickPopup.position.Y&&!(0,e.isNullOrUndefined)(n)&&n.clientX&&n.clientY){var u=n.clientX,g=n.clientY,v=i.getBoundingClientRect(),m=n.offsetY||Math.ceil(g-v.y),f=r.quickPopup.offsetY,y=(0,t.isCollide)(r.quickPopup.element,i),T=r.quickPopup.element.getBoundingClientRect(),w=document.elementFromPoint(u,g);(y.indexOf("top")>-1||y.indexOf("bottom")>-1||(0,e.closest)(w,"."+Kn))&&(T.top<=g&&g<=T.top+T.height?(r.quickPopup.offsetY=f-T.height-10,r.quickPopup.dataBind(),(y=(0,t.isCollide)(r.quickPopup.element,r.parent.element)).indexOf("top")>-1&&(r.quickPopup.offsetY=f+m+10,r.quickPopup.dataBind())):(0,t.isCollide)(r.quickPopup.element,r.parent.element).indexOf("bottom")>-1&&(r.quickPopup.offsetY=f-m-Math.ceil(T.height)-10,r.quickPopup.dataBind()))}}a&&r.applyEventColor(),r.quickPopup.element.style.display=l,r.quickPopup.dataBind(),r.quickPopup.show()}}))}))},i.prototype.applyEventColor=function(){var e="";e="Agenda"===this.parent.currentView||"MonthAgenda"===this.parent.currentView?this.parent.enableRtl?"border-right-color":"border-left-color":"background-color";var t=this.parent.activeEventData.element.style[e];if(""!==t){var i=this.quickPopup.element.querySelector("."+Yi),n=this.quickPopup.element.querySelector("."+Gi);n&&n.offsetParent&&(i=this.quickPopup.element.querySelector("."+Cn))&&(i.style.borderLeftColor=t,t="rgba("+t.match(/\d+/g).join()+",0.3)"),i&&(i.style.backgroundColor=t)}},i.prototype.quickPopupOpen=function(){if(this.parent.isAdaptive)this.quickPopup.element.style.top="0px";else if(this.quickPopup.element.querySelector("."+Wi)){var e=this.quickPopup.element.querySelector("."+Cn);e&&e.focus()}else{var t=this.quickPopup.element.querySelector("."+Zi);t&&t.focus();var i=this.quickPopup.element.querySelector("."+qn);i&&i.focus()}},i.prototype.quickPopupClose=function(){this.parent.eventBase.focusElement(),this.quickPopup.relateTo="."+$e,this.fieldValidator.destroyToolTip(),this.quickPopup.element.querySelectorAll(".e-formvalidator").length&&this.fieldValidator.destroy(),this.destroyPopupButtons("quickPopup"),Me(this.quickPopup.element)},i.prototype.morePopupOpen=function(){if(this.parent.isAdaptive)return this.morePopup.element.style.top="0px",this.morePopup.element.style.left="0px",void(this.morePopup.element.style.height=(0,e.formatUnit)(window.innerHeight));this.morePopup.element.querySelector("."+an).focus(),this.morePopup.refreshPosition()},i.prototype.morePopupClose=function(){var t=this.parent.element.querySelector("."+ln);t&&(0,e.remove)(t)},i.prototype.popupClose=function(e){this.dialogEvent=e,this.isCrudAction=!1,this.quickPopupHide(!0)},i.prototype.quickPopupHide=function(e){var t=this;if(this.quickPopup.element.classList.contains(tt)){var i,n=this.quickPopup.element.querySelector("."+Wi);if(n){var r=this.quickPopup.element.querySelector(".e-formvalidator");if(this.isCrudAction&&r&&!r.ej2_instances[0].validate())return;var a=this.parent.eventFields,s=this.parent.eventWindow.getObjectFromFormData(Kn);this.parent.eventWindow.setDefaultValueToObject(s),s[a.id]=this.parent.eventBase.getEventMaxID(),s[a.startTime]=this.parent.activeCellsData.startTime,s[a.endTime]=this.parent.activeCellsData.endTime,s[a.isAllDay]=this.parent.activeCellsData.isAllDay,this.parent.resourceBase&&this.parent.resourceBase.setResourceValues(s),i=s}else i=this.parent.activeEventData.event;var o=this.quickPopup.element.querySelector("."+zi),l={event:this.dialogEvent,type:this.parent.isAdaptive?o?"ViewEventInfo":"EditEventInfo":"QuickInfo",cancel:!1,data:i,element:this.quickPopup.element,target:n?this.parent.activeCellsData.element:this.parent.activeEventData.element};this.parent.trigger(b,l,(function(i){if(!i.cancel&&t.quickPopup.element.classList.contains("e-popup-open")){if(n&&t.isCrudAction&&(t.parent.currentAction="Add",t.parent.crudModule.addEvent(i.data)),e){var r=t.quickPopup.hideAnimation;t.quickPopup.hideAnimation=null,t.quickPopup.hide(),t.quickPopup.hideAnimation=r}else t.quickPopup.hide();t.isMultipleEventSelect=!1,t.isCrudAction=!1}}))}},i.prototype.navigationClick=function(t){var i=(0,e.closest)(t.target,"."+di);if(!(0,e.isNullOrUndefined)(i)){var n=this.parent.getDateFromElement(t.currentTarget);(0,e.isNullOrUndefined)(n)||(this.closeClick(t),this.parent.setProperties({selectedDate:n},!0),this.parent.changeView(this.parent.getNavigateView(),t))}},i.prototype.documentClick=function(t){var i=t.event.target,n=!!(0,e.closest)(i,".e-dialog"),r="."+Kn+",."+rt+",."+Ke+",."+$e+",."+Xt;n||(r+=",.e-popup");var a=this.parent.element.querySelector("."+Kn);(a&&a.childElementCount>0&&!(0,e.closest)(i,r)||!(0,e.closest)(i,r))&&(this.quickPopupHide(),this.parent.removeNewEventElement());var s=this.parent.allowInline?this.parent.inlineModule.getInlineElement():null;s&&s!==i&&this.parent.inlineModule.documentClick(s),(0,e.closest)(i,"."+Xt+",."+rt)&&this.parent.removeNewEventElement(),(0,e.closest)(i,"."+en)||!i.classList||i.classList.contains(Bi)||(0,e.closest)(i,"."+en+"."+tt)||(0,e.closest)(i,"."+$e)||this.morePopup.hide()},i.prototype.onClosePopup=function(t){(0,e.isNullOrUndefined)(t)||(this.dialogEvent=t),this.quickPopupHide(),((0,e.isNullOrUndefined)(t)||!(0,e.isNullOrUndefined)(t)&&"escape"!==t.action||this.parent.inlineModule&&this.parent.element.querySelector("."+ur))&&this.parent.eventBase.focusElement()},i.prototype.addEventListener=function(){this.parent.on(r,this.cellClick,this),this.parent.on(m,this.eventClick,this),this.parent.on(Z,this.documentClick,this),this.parent.on(z,this.updateMoreEventContent,this)},i.prototype.removeEventListener=function(){this.parent.off(r,this.cellClick),this.parent.off(m,this.eventClick),this.parent.off(Z,this.documentClick),this.parent.off(z,this.updateMoreEventContent)},i.prototype.destroyPopupButtons=function(e){for(var t="quickPopup"===e?this.quickPopup:this.morePopup,i=0,n=[].slice.call(t.element.querySelectorAll(".e-control.e-btn"));i<n.length;i++){var r=n[i].ej2_instances[0];r&&r.destroy()}if("quickPopup"===e){var a=t.element.querySelector("input."+Cn);a&&a.remove();var s=this.quickPopup.element.querySelector("form."+wn);s&&(Me(s),s.remove()),this.parent.resetTemplates(["content","header","footer"])}},i.prototype.refreshQuickDialog=function(){this.destroyQuickDialog(),this.renderQuickDialog()},i.prototype.refreshQuickPopup=function(){this.destroyQuickPopup(),this.renderQuickPopup()},i.prototype.refreshMorePopup=function(){this.destroyMorePopup(),this.renderMorePopup()},i.prototype.destroyQuickDialog=function(){this.quickDialog.element&&(this.quickDialog.destroy(),(0,e.remove)(this.quickDialog.element),this.quickDialog=null)},i.prototype.destroyQuickPopup=function(){this.quickPopup.element&&(this.destroyPopupButtons("quickPopup"),this.quickPopup.destroy(),(0,e.remove)(this.quickPopup.element),this.quickPopup=null)},i.prototype.destroyMorePopup=function(){this.morePopup.element&&(this.destroyPopupButtons("morePopup"),this.morePopup.destroy(),(0,e.remove)(this.morePopup.element),this.morePopup=null)},i.prototype.destroy=function(){this.quickPopup.element.querySelectorAll(".e-formvalidator").length&&this.fieldValidator.destroy(),this.removeEventListener(),this.destroyQuickPopup(),this.destroyMorePopup(),this.destroyQuickDialog(),this.dialogEvent=null,this.parent=null,this.l10n=null,this.isCrudAction=null,this.fieldValidator=null,this.isMultipleEventSelect=null},i}(),Ua=function(){function i(e){this.parent=e,this.tooltipObj=new t.Tooltip({animation:{close:{effect:"FadeOut"}},content:"No title",position:"BottomRight",offsetY:10,mouseTrail:!this.parent.isAdaptive,showTipPointer:!1,cssClass:this.parent.cssClass+" e-schedule-event-tooltip",target:this.getTargets(),beforeRender:this.onBeforeRender.bind(this),beforeClose:this.onTooltipClose.bind(this),beforeOpen:this.onTooltipOpen.bind(this),enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer}),this.tooltipObj.appendTo(this.parent.element)}return i.prototype.getTargets=function(){var e=[];return this.parent.activeViewOptions.group.headerTooltipTemplate&&e.push("."+Ot),this.parent.eventSettings.enableTooltip&&e.push("."+Xt),e.join(",")},i.prototype.onBeforeRender=function(t){var i=this;if(this.parent.uiStateValues.isSwipeScroll)t.cancel=!0;else if((0,e.isNullOrUndefined)(t.target.getAttribute("data-tooltip-id"))){if(t.target.classList.contains(Ot)&&this.parent.activeViewOptions.group.resources.length>0){var n=void 0;if(this.parent.activeView.isTimelineView()){var r=parseInt(t.target.getAttribute("data-group-index"),10);n=this.parent.resourceBase.lastResourceLevel[parseInt(r.toString(),10)]}else{var a=t.target.parentNode.sectionRowIndex,s=t.target.cellIndex;n=this.parent.activeView.getColumnLevels()[parseInt(a.toString(),10)][parseInt(s.toString(),10)]}var o={resource:n.resource,resourceData:n.resourceData},l=(0,e.createElement)("div"),p=this.parent.element.id+"_headerTooltipTemplate",c=[].slice.call(this.parent.getHeaderTooltipTemplate()(o,this.parent,"headerTooltipTemplate",p,!1));return(0,e.append)(c,l),this.setContent(l),void this.parent.renderTemplates()}var h=this.parent.eventBase.getEventByGuid(t.target.getAttribute("data-guid"));if(!(0,e.isNullOrUndefined)(h)){if((0,e.isNullOrUndefined)(this.parent.eventSettings.tooltipTemplate)){var d=this.parent.globalize,u=this.parent.eventFields,g=new Date(""+h[u.startTime]),v=new Date(""+h[u.endTime]);v=v.getTime()-g.getTime()!=0&&0===v.getHours()&&0===v.getMinutes()?new Date(v.setMilliseconds(-1e3)):v;var m=ve(new Date(""+g)),f=ve(new Date(""+v)),y=h[u.subject]||this.parent.eventSettings.fields.subject.default||this.parent.localeObj.getConstant("addTitle"),T=(0,e.isNullOrUndefined)(h[u.location])?"":h[u.location],w="",D="",b="";w=d.formatDate(g,{type:"date",skeleton:"MMMd",calendar:this.parent.getCalendarMode()}),D=d.formatDate(g,{type:"date",skeleton:"medium",calendar:this.parent.getCalendarMode()}),b=d.formatDate(v,{type:"date",skeleton:"medium",calendar:this.parent.getCalendarMode()}),w=je(w,"single"),D=je(D,"single"),b=je(b,"single");var S=this.parent.getTimeString(g),C=this.parent.getTimeString(v),O='<div><div class="e-subject">'+y+'</div><div class="e-location">'+T+'</div><div class="e-details">'+(m.getTime()===f.getTime()?je(d.formatDate(g,{type:"date",skeleton:"long",calendar:this.parent.getCalendarMode()}),"single"):m.getFullYear()===f.getFullYear()?w+" - "+b:D+" - "+b)+'</div><div class="e-all-day">'+(h[u.isAllDay]?this.parent.localeObj.getConstant("allDay"):S+" - "+C)+"</div></div>";this.setContent((0,e.initializeCSPTemplate)((function(){return O})))}else{l=(0,e.createElement)("div"),p=this.parent.element.id+"_tooltipTemplate",c=[].slice.call(this.parent.getEventTooltipTemplate()(h,this.parent,"tooltipTemplate",p,!1));(0,e.append)(c,l),this.setContent(l)}this.parent.renderTemplates((function(){if(i.parent&&i.parent.isReact&&!(0,e.isNullOrUndefined)(i.parent.eventSettings.tooltipTemplate)){var t=document.querySelector("."+_n);t&&(0,e.removeClass)([t],_n)}}))}}},i.prototype.onTooltipOpen=function(t){t.element&&this.parent.isReact&&!(0,e.isNullOrUndefined)(this.parent.eventSettings.tooltipTemplate)&&(0,e.addClass)([t.element],_n);var i=this.parent.eventBase.getEventByGuid(t.target.getAttribute("data-guid"));if(!(0,e.isNullOrUndefined)(i)){var n={cancel:!1,data:i,content:t.element,target:t.target};this.parent.trigger(F,n,(function(e){e.cancel?t.cancel=!0:t.element=e.content}))}},i.prototype.onTooltipClose=function(t){t.element&&((0,e.removeClass)([t.element],tt),(0,e.addClass)([t.element],"e-popup-close")),this.parent.isReact&&this.parent.eventWindow.dialogObject&&this.parent.eventWindow.dialogObject.visible||this.parent.resetTemplates(["tooltipTemplate","headerTooltipTemplate"])},i.prototype.setContent=function(e){this.tooltipObj.setProperties({content:e,windowCollision:!0},!0)},i.prototype.close=function(){this.tooltipObj.close()},i.prototype.destroy=function(){this.tooltipObj.destroy(),(0,e.addClass)([this.parent.element],"e-control"),this.tooltipObj=null,this.parent=null},i}(),Ba=d(778),Wa=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),za=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},Ya="e-input-wrapper",_a="e-input-wrapper-side",Ga="e-repeat-element",Xa="e-repeat-interval",Qa="e-interval",Ka="e-days",Za="e-non-week",Ja="e-year-expander",$a="e-year-expander-element",es="e-month-expander",ts="e-month-expander-element",is="e-month-expander-checkbox-wrapper",ns="e-form-left",rs="e-form-right",as="e-month-day",ss="e-month-expander-wrapper",os="e-month-pos",ls="e-month-week",ps="e-end-on",cs="e-end-on-element",hs="e-end-on-date",ds="e-until-date",us="e-end-on-count",gs="e-recurrence-count",vs="e-hide-recurrence-element",ms="e-rtl",fs="e-primary",ys="e-active",Ts="e-recurrence-table",ws="e-repeat-content",Ds="none",bs="daily",Ss="weekly",Cs="monthly",Os="yearly",Es="never",xs="until",Vs="count",As="text",Is="value",Ms="repeat",ks="BYDAY",Rs="DAILY",Hs="WEEKLY",Ps="MONTHLY",js="YEARLY",Ns="SU",Ls="MO",qs="TU",Fs="WE",Us="TH",Bs="FR",Ws="SA",zs="=",Ys=";",_s={none:"",daily:"days",weekly:"weeks",monthly:"months",yearly:"years"},Gs={sun:Ns,mon:Ls,tue:qs,wed:Fs,thu:Us,fri:Bs,sat:Ws},Xs=[Ka,Za,ps,Qa,Ja,es],Qs=[Za],Ks=[Ka,Ja],Zs=[Ka],Js=[Ka,Za,Ja,es],$s=[hs,us],eo=[hs],to=[us],io=function(t){function i(e,i){var n=t.call(this,e,i)||this;return n.defaultLocale={none:"None",daily:"Daily",weekly:"Weekly",monthly:"Monthly",month:"Month",yearly:"Yearly",never:"Never",until:"Until",count:"Count",first:"First",second:"Second",third:"Third",fourth:"Fourth",last:"Last",repeat:"Repeat",repeatEvery:"Repeat every",on:"Repeat On",end:"End",onDay:"Day",days:"Day(s)",weeks:"Week(s)",months:"Month(s)",years:"Year(s)",every:"every",summaryTimes:"time(s)",summaryOn:"on",summaryUntil:"until",summaryRepeat:"Repeats",summaryDay:"day(s)",summaryWeek:"week(s)",summaryMonth:"month(s)",summaryYear:"year(s)",monthWeek:"Month Week",monthPosition:"Month Position",monthExpander:"Month Expander",yearExpander:"Year Expander",repeatInterval:"Repeat Interval"},n.renderStatus=!1,n.dayButtons=[],n.monthButtons=[],n}return Wa(i,t),i.prototype.startState=function(e,t,i){this.showFormElement(),this.updateForm(e),this.freshOnEndForm(),this.updateEndOnForm(t),this.selectMonthDay(i),this.updateUntilDate(i),this.onMonthDay.setProperties({checked:!0})},i.prototype.preRender=function(){this.localeObj=new e.L10n(this.getModuleName(),this.defaultLocale,this.locale),this.calendarUtil=ra(this.calendarMode)},i.prototype.applyCustomClass=function(t){t&&(0,e.addClass)([this.element],t.split(" "))},i.prototype.initialize=function(){(0,e.addClass)([this.element],"e-"+this.getModuleName()),this.renderComponent(),(0,e.isNullOrUndefined)(this.value)||""===this.value?((0,e.isNullOrUndefined)(this.repeatType.value)||(this.startState(this.repeatType.value.toString().toUpperCase(),this.endTypes[0],this.startDate),this.updateForm(this.repeatType.value.toString())),this.selectedType>0&&this.setProperties({value:this.getRecurrenceRule()},!1)):this.setRecurrenceRule(this.value),this.applyCustomClass(this.cssClass)},i.prototype.triggerChangeEvent=function(){var e=this;if(this.renderStatus){var t=this.getRecurrenceRule();this.trigger("change",{value:t},(function(t){return e.setProperties({value:t.value},!1)}))}},i.prototype.resetDayButton=function(){[].slice.call(this.element.querySelectorAll("."+Ka+" button")).forEach((function(t){return(0,e.removeClass)([t],[ys,fs])}))},i.prototype.daySelection=function(t){this.resetDayButton();var i=[0,1,2,3,4,5,6];this.rotateArray(i,this.firstDayOfWeek);var n=this.element.querySelector("."+Ka+' button[data-index="'+i.indexOf(t)+'"]');n&&(0,e.addClass)([n],[ys,fs])},i.prototype.rtlClass=function(t){t?(0,e.addClass)([this.element],ms):(0,e.removeClass)([this.element],ms)},i.prototype.updateUntilDate=function(e){var t=new Date(e.getTime());t.setDate(t.getDate()+60),this.untilDateObj.setProperties({value:t})},i.prototype.selectMonthDay=function(e){var t=["sun","mon","tue","wed","thu","fri","sat"];this.monthDate.setProperties({value:this.calendarUtil.getDate(e)}),this.monthWeekDays.setProperties({value:Gs[t[e.getDay()]]}),this.monthValue.setProperties({value:""+this.calendarUtil.getMonth(e)}),this.monthWeekPos.setProperties({value:this.getDayPosition(e)}),this.daySelection(e.getDay())},i.prototype.updateForm=function(t){var i=this;this.repeatType.setProperties({value:t});var n=this.element.querySelector("."+ps);switch(t===bs?(0,e.classList)(n,[ns],[rs]):(0,e.classList)(n,[rs],[ns]),t){case Ds:Xs.forEach((function(t){return(0,e.addClass)([i.element.querySelector("."+t)],vs)}));break;case Ss:Qs.forEach((function(t){return(0,e.addClass)([i.element.querySelector("."+t)],vs)}));break;case Cs:Ks.forEach((function(t){return(0,e.addClass)([i.element.querySelector("."+t)],vs)}));break;case Os:Zs.forEach((function(t){return(0,e.addClass)([i.element.querySelector("."+t)],vs)}));break;case bs:Js.forEach((function(t){return(0,e.addClass)([i.element.querySelector("."+t)],vs)}))}},i.prototype.updateEndOnForm=function(t){var i=this;switch(this.endType.setProperties({value:t}),t){case Es:$s.forEach((function(t){return(0,e.addClass)([i.element.querySelector("."+t)],vs)}));break;case xs:to.forEach((function(t){return(0,e.addClass)([i.element.querySelector("."+t)],vs)}));break;case Vs:eo.forEach((function(t){return(0,e.addClass)([i.element.querySelector("."+t)],vs)}))}},i.prototype.freshOnEndForm=function(){var t=this;$s.forEach((function(i){var n=t.element.querySelector("."+i);n&&(0,e.removeClass)([n],vs)}))},i.prototype.showFormElement=function(){var t=this;Xs.forEach((function(i){var n=t.element.querySelector("."+i);n&&(0,e.removeClass)([n],vs)}))},i.prototype.renderDropdowns=function(){var e=this,t=this;this.repeatType=new Ba.DropDownList({dataSource:this.getRepeatData(),floatLabelType:"Always",enableRtl:this.enableRtl,index:this.selectedType,fields:{text:As,value:Is},placeholder:this.localeObj.getConstant(Ms),htmlAttributes:{title:this.localeObj.getConstant(Ms)},change:function(i){t.setProperties({selectedType:e.frequencies.indexOf(i.value)},!1),t.element.querySelector("."+ws).innerHTML=t.localeObj.getConstant(_s[i.value]),t.showFormElement(),t.updateForm(i.value),t.resetFormValues(),t.triggerChangeEvent()}}),this.repeatType.appendTo(this.element.querySelector("."+Ga)),this.endType=new Ba.DropDownList({dataSource:this.getEndData(),popupWidth:this.getPopupWidth(),floatLabelType:"Always",placeholder:this.localeObj.getConstant("end"),enableRtl:this.enableRtl,index:1,fields:{text:As,value:Is},change:function(e){t.freshOnEndForm(),t.updateEndOnForm(e.value),t.resetFormValues(),t.triggerChangeEvent()}}),this.endType.appendTo(this.element.querySelector("."+cs));var i=function(i){return new Ba.DropDownList({dataSource:i,popupWidth:e.getPopupWidth(),enableRtl:e.enableRtl,fields:{text:As,value:Is},index:1,change:function(e){t.onWeekDay.setProperties({checked:!0}),t.resetFormValues(),t.triggerChangeEvent()}})};this.monthWeekPos=i(this.getMonthPosData()),this.monthWeekPos.appendTo(this.element.querySelector("."+os)),this.monthWeekDays=i(this.getDayData("wide")),this.monthWeekDays.appendTo(this.element.querySelector("."+ls)),this.monthValue=new Ba.DropDownList({dataSource:this.getMonthData(),fields:{text:As,value:Is},enableRtl:this.enableRtl,index:7,change:function(e){t.resetFormValues(),t.triggerChangeEvent()}}),this.monthValue.appendTo(this.element.querySelector("."+$a))},i.prototype.setDefaultValue=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll(".e-control .e-numerictextbox"));e<t.length;e++){var i=t[e].ej2_instances[0];i.element.classList.contains(Xa)?(i.value=1,i.dataBind()):i.element.classList.contains(gs)&&(i.value=10,i.dataBind())}},i.prototype.resetFormValues=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll('.e-control [type="text"]'));e<t.length;e++){var i=t[e],n=void 0;if(i.classList.contains("e-datepicker"))(n=i.ej2_instances[0]).value?(n.value=n.value,n.dataBind()):this.updateUntilDate(this.startDate);else if(i.classList.contains("e-dropdownlist"))(n=i.ej2_instances[0]).index=n.index||0,n.dataBind();else if(i.classList.contains("e-numerictextbox")){var r=void 0;r=(n=i.ej2_instances[0]).element.classList.contains(Xa)?1:n.element.classList.contains(gs)?10:this.startDate.getDate(),n.value=n.value||r,n.dataBind()}}},i.prototype.getPopupWidth=function(){return e.Browser.isDevice?"100%":"auto"},i.prototype.renderDatePickers=function(){var t=this;this.untilDateObj=new n.DatePicker({firstDayOfWeek:this.firstDayOfWeek,enableRtl:this.enableRtl,locale:this.locale,min:this.minDate,max:this.maxDate,format:(0,e.isNullOrUndefined)(this.dateFormat)?this.getFormat("dateFormats"):this.dateFormat,change:function(e){e.value&&t.triggerChangeEvent()}}),this.untilDateObj.appendTo(this.element.querySelector("."+ds))},i.prototype.getFormat=function(t){return"en"===this.locale||"en-US"===this.locale?(0,e.getValue)(t+".short",(0,e.getDefaultDateObject)(this.getCalendarMode())):(0,e.getValue)("main."+this.locale+".dates.calendars."+this.getCalendarMode()+"."+t+".short",e.cldrData)},i.prototype.dayButtonRender=function(){for(var t=this,i=[].slice.call(this.element.querySelectorAll("."+Ka+" button")),n=this,r=0,a=i;r<a.length;r++){var s=a[r],o=new Na.Button({isToggle:!0,enableRtl:this.enableRtl},s);this.dayButtons.push(o),e.EventHandler.add(s,"click",(function(i){var r=[].slice.call(t.element.querySelectorAll("."+Ka+" button."+fs)),a=i.target;a.classList.contains(fs)?r.length>1&&((0,e.removeClass)([a],fs),n.triggerChangeEvent()):((0,e.addClass)([a],fs),n.triggerChangeEvent())}))}},i.prototype.radioButtonRender=function(){var e=this;this.onMonthDay=new Na.RadioButton({label:this.localeObj.getConstant("onDay"),enableRtl:this.enableRtl,name:"monthType",value:"day",change:function(){e.resetFormValues(),e.triggerChangeEvent()}}),this.onMonthDay.appendTo(this.element.querySelector("."+ts)),this.monthButtons.push(this.onMonthDay),this.onWeekDay=new Na.RadioButton({label:this.localeObj.getConstant("monthExpander"),cssClass:"e-month-type",name:"monthType",enableRtl:this.enableRtl,value:"daypos",change:function(){e.resetFormValues(),e.triggerChangeEvent()}}),this.onWeekDay.appendTo(this.element.querySelector("."+ss)),this.monthButtons.push(this.onWeekDay)},i.prototype.numericTextboxRender=function(){var e=this;this.recurrenceCount=new La.NumericTextBox({value:10,format:"#",enableRtl:this.enableRtl,min:1,max:999,change:function(){e.triggerChangeEvent()}}),this.recurrenceCount.appendTo(this.element.querySelector("."+gs)),this.monthDate=new La.NumericTextBox({value:1,format:"#",enableRtl:this.enableRtl,min:1,max:31,change:function(){e.onMonthDay.setProperties({checked:!0}),e.triggerChangeEvent()}}),this.monthDate.appendTo(this.element.querySelector("."+as)),this.repeatInterval=new La.NumericTextBox({value:1,format:"#",min:1,max:999,enableRtl:this.enableRtl,floatLabelType:"Always",placeholder:this.localeObj.getConstant("repeatEvery"),change:function(){e.triggerChangeEvent()}}),this.repeatInterval.appendTo(this.element.querySelector("."+Xa))},i.prototype.renderComponent=function(){this.setTemplate(),this.renderDropdowns(),this.renderDatePickers(),this.dayButtonRender(),this.radioButtonRender(),this.numericTextboxRender()},i.prototype.rotateArray=function(e,t){for(var i,n=0;n<t;n++)i=e.shift(),e.push(i)},i.prototype.getEndData=function(){var e=this,t=[];return this.endTypes.forEach((function(i){t.push({text:e.localeObj.getConstant(i),value:i})})),t},i.prototype.getDayPosition=function(e){var t=new Date(e.getTime()),i=new Date(e.getTime()),n=e.getDay(),r=[];for(t=this.calendarUtil.getMonthStartDate(t),i=this.calendarUtil.getMonthEndDate(i);t<i;)t.getDay()===n&&r.push(t.getTime()),t.setDate(t.getDate()+1);return r.indexOf(e.getTime())===r.length-1?-1:r.indexOf(e.getTime())+1},i.prototype.getRepeatData=function(){var e=[],t=this;return this.frequencies.forEach((function(i){var n=i===Ds?Es:i;e.push({text:t.localeObj.getConstant(n),value:i})})),e},i.prototype.getMonthPosData=function(){var e={first:1,second:2,third:3,fourth:4,last:-1},t=this,i=[];return["first","second","third","fourth","last"].forEach((function(n){i.push({text:t.localeObj.getConstant(n),value:e[""+n]})})),i},i.prototype.getDayData=function(t){var i,n=["sun","mon","tue","wed","thu","fri","sat"],r=[];if(this.rotateArray(n,this.firstDayOfWeek),"en"===this.locale||"en-US"===this.locale){var a="days.stand-alone.";i=(0,e.getValue)(a+t,(0,e.getDefaultDateObject)(this.getCalendarMode()))}else{a="main."+this.locale+".dates.calendars."+this.getCalendarMode()+".days.stand-alone."+t;i=(0,e.getValue)(a,e.cldrData)}for(var s=0,o=n;s<o.length;s++){var l=o[s],p=(0,e.getValue)(l,i);r.push({text:"narrow"===t?p:je(p,"single"),value:Gs[""+l]})}return r},i.prototype.getMonthData=function(){var t,i=[];if("en"===this.locale||"en-US"===this.locale){var n="months.stand-alone.wide";t=(0,e.getValue)(n,(0,e.getDefaultDateObject)(this.getCalendarMode()))}else{n="main."+this.locale+".dates.calendars."+this.getCalendarMode()+".months.stand-alone.wide";t=(0,e.getValue)(n,e.cldrData)}for(var r=0,a=Object.keys(t);r<a.length;r++){var s=a[r];i.push({text:je((0,e.getValue)(s,t),"single"),value:s})}return i},i.prototype.setTemplate=function(){var e=this.getDayData("narrow"),t=this.getDayData("wide");this.element.innerHTML='<div class="e-editor"><div class="'+Ya+" "+ns+'"><input type="text" tabindex="0" class="'+Ga+'"label="'+Ga.substr(2)+'" /></div><div class="'+Ya+" "+Qa+" "+rs+'"><table class="'+Ts+' e-repeat-content-wrapper" role="none"><tr><td><input type="text" tabindex="0" id="'+this.element.id+"_"+Xa+'" class="'+Xa+'"title="'+this.localeObj.getConstant("repeatEvery")+'" /></td><td><span class="'+ws+'"></span></td></tr></table></div><div class="'+_a+" "+Ka+" "+ns+'"><div class=e-week-expander-label>'+this.localeObj.getConstant("on")+'</div><button type="button" class="e-round" data-index="0" title="'+t[0].text+'">'+e[0].text+'</button><button type="button" class="e-round" data-index="1" title="'+t[1].text+'">'+e[1].text+'</button><button type="button" class="e-round" data-index="2" title="'+t[2].text+'">'+e[2].text+'</button><button type="button" class="e-round" data-index="3" title="'+t[3].text+'">'+e[3].text+'</button><button type="button" class="e-round" data-index="4" title="'+t[4].text+'">'+e[4].text+'</button><button type="button" class="e-round" data-index="5" title="'+t[5].text+'">'+e[5].text+'</button><button type="button" class="e-round" data-index="6" title="'+t[6].text+'">'+e[6].text+'</button></div><div class="'+_a+" "+Za+" "+ns+'"><div class=e-month-expander-label>'+this.localeObj.getConstant("on")+'</div><div class="'+Ja+'"><input class="'+$a+'" type="text" tabindex="0" title="'+this.localeObj.getConstant("yearExpander")+'"/></div><div class="'+es+'"><table class="'+Ts+' e-month-expand-wrapper" role="none"><tr><td><div class="'+Ya+" "+is+'"><input class="'+ts+'"title="'+this.localeObj.getConstant("monthExpander")+'" type="radio"></div></td><td colspan="2"><div class="'+Ya+' e-monthday-element"><input type="text" tabindex="0" id="'+this.element.id+"_"+as+'" class="'+as+'"title="'+this.localeObj.getConstant("on")+'" /></div></td></tr><tr><td><div class="'+Ya+" "+is+' e-repeat-on-week-selector"><input class="'+ss+'"title="'+this.localeObj.getConstant("monthExpander")+'" type="radio"></div></td><td><div class="'+Ya+' e-week-position" ><input type="text" tabindex="0" class="'+os+'"title="'+this.localeObj.getConstant("monthPosition")+'" /></div></td><td><div class="'+Ya+' e-day-position"><input type="text" tabindex="0" class="'+ls+'"title="'+this.localeObj.getConstant("monthWeek")+'" /></div></td></tr></table></div></div><div class="'+_a+" "+ps+" "+rs+'"><div class="'+Ya+' e-end-on-left"><input type="text" tabindex="0" class="'+cs+'"title="'+this.localeObj.getConstant("end")+'" /></div><div class="'+Ya+" "+hs+'" ><input type="text" tabindex="0" class="'+ds+'"title="'+this.localeObj.getConstant(xs)+'" /></div><div class="'+Ya+" "+us+'"><input type="text" tabindex="0" id="'+this.element.id+"_"+gs+'" class="'+gs+'"title="'+this.localeObj.getConstant(Vs)+'" /></div></div></div></div>'},i.prototype.getSelectedDaysData=function(){var e=ks+zs,t=[].slice.call(this.element.querySelectorAll("."+Ka+" button."+fs)),i=[Ns,Ls,qs,Fs,Us,Bs,Ws];this.rotateArray(i,this.firstDayOfWeek);for(var n=0;n<t.length;n++)e+=i[parseInt(t[parseInt(n.toString(),10)].getAttribute("data-index"),10)]+(n===t.length-1?"":",");return e+Ys},i.prototype.getSelectedMonthData=function(){return this.onWeekDay.checked?ks+zs+this.monthWeekDays.value+Ys+"BYSETPOS"+zs+this.monthWeekPos.value+Ys:"BYMONTHDAY="+this.monthDate.value+Ys},i.prototype.getIntervalData=function(){return"INTERVAL="+this.repeatInterval.value+Ys},i.prototype.getEndOnCount=function(){return"COUNT="+this.recurrenceCount.value+Ys},i.prototype.getYearMonthRuleData=function(){return"BYMONTH="+this.monthValue.value+Ys},i.prototype.updateWeekButton=function(e){var t=[Ns,Ls,qs,Fs,Us,Bs,Ws];this.rotateArray(t,this.firstDayOfWeek);for(var i=0,n=this.dayButtons;i<n.length;i++){var r=n[i],a=parseInt(r.element.getAttribute("data-index"),10);-1!==e.indexOf(t[parseInt(a.toString(),10)])?r.setProperties({isPrimary:!0}):r.setProperties({isPrimary:!1})}},i.prototype.updateMonthUI=function(){if(this.ruleObject.monthDay.length)this.monthDate.setProperties({value:this.ruleObject.monthDay[0]}),this.onMonthDay.setProperties({checked:!0});else{this.onWeekDay.setProperties({checked:!0}),this.monthWeekPos.setProperties({value:this.ruleObject.setPosition});for(var e=0,t=Object.keys(Gs);e<t.length;e++){var i=t[e];if(Gs[""+i]===this.ruleObject.day[0]){this.monthWeekDays.setProperties({value:this.ruleObject.day[0]});break}}}},i.prototype.updateUI=function(e,t){switch(this.repeatInterval.setProperties({value:this.ruleObject.interval}),t){case xs:this.untilDateObj.setProperties({value:this.ruleObject.until});break;case Vs:this.recurrenceCount.setProperties({value:this.ruleObject.count})}switch(e){case Ss:this.updateWeekButton(this.ruleObject.day);break;case Os:this.monthValue.setProperties({index:this.ruleObject.month[0]-1}),this.updateMonthUI();break;case Cs:this.updateMonthUI()}},i.prototype.getUntilData=function(){return this.untilDateObj.value?"UNTIL="+Ea(this.untilDateObj.value)+Ys:""},i.prototype.destroyComponents=function(){this.recurrenceCount.isDestroyed||(this.recurrenceCount.destroy(),this.recurrenceCount=null),this.monthDate.isDestroyed||(this.monthDate.destroy(),this.monthDate=null),this.repeatInterval.isDestroyed||(this.repeatInterval.destroy(),this.repeatInterval=null),this.untilDateObj.isDestroyed||(this.untilDateObj.destroy(),this.untilDateObj=null),this.repeatType.isDestroyed||(this.repeatType.destroy(),this.repeatType=null),this.endType.isDestroyed||(this.endType.destroy(),this.endType=null),this.monthWeekPos.isDestroyed||(this.monthWeekPos.destroy(),this.monthWeekPos=null),this.monthWeekDays.isDestroyed||(this.monthWeekDays.destroy(),this.monthWeekDays=null),this.monthValue.isDestroyed||(this.monthValue.destroy(),this.monthValue=null),this.onMonthDay.isDestroyed||(this.onMonthDay.destroy(),this.onMonthDay=null),this.onWeekDay.isDestroyed||(this.onWeekDay.destroy(),this.onWeekDay=null),this.dayButtons.forEach((function(e){e.isDestroyed||e.destroy()})),this.dayButtons=[],this.monthButtons.forEach((function(e){e.isDestroyed||e.destroy()})),this.monthButtons=[]},i.prototype.resetFields=function(){this.startState(Ds,this.endTypes[0],this.startDate),this.setDefaultValue()},i.prototype.updateRuleUntilDate=function(e){if(this.untilDateObj.value&&e){var t=this.untilDateObj.value,i=new Date(t.getFullYear(),t.getMonth(),t.getDate(),e.getHours(),e.getMinutes(),e.getMilliseconds());this.untilDateObj.setProperties({value:i})}},i.prototype.getCalendarMode=function(){return(0,e.isNullOrUndefined)(this.calendarMode)?"gregorian":this.calendarMode.toLowerCase()},i.prototype.getRuleSummary=function(e){return void 0===e&&(e=this.getRecurrenceRule()),Ar(e,this.localeObj,this.locale,this.calendarMode)},i.prototype.getRecurrenceDates=function(t,i,n,r,a){return a=(0,e.isNullOrUndefined)(a)?this.startDate:a,Mr(t,i,n,this.firstDayOfWeek,r,a,this.calendarMode)},i.prototype.getRecurrenceRule=function(){var e="FREQ=";switch(this.repeatType.value){case bs:e+=Rs+Ys;break;case Ss:e+=Hs+Ys+this.getSelectedDaysData();break;case Cs:e+=Ps+Ys+this.getSelectedMonthData();break;case Os:e+=js+Ys+this.getSelectedMonthData()+this.getYearMonthRuleData();break;case Ds:return""}switch(e+=this.getIntervalData(),this.endType.value){case xs:e+=this.getUntilData();break;case Vs:e+=this.getEndOnCount()}return e},i.prototype.setRecurrenceRule=function(e,t){if(void 0===t&&(t=this.startDate),e){this.renderStatus=!1,this.ruleObject=Jr(e);var i=this.ruleObject.count?Vs:this.ruleObject.until?xs:Es;switch(this.ruleObject.freq){case Rs:this.startState(bs,i,t),this.updateUI(bs,i);break;case Hs:this.startState(Ss,i,t),this.updateUI(Ss,i);break;case Ps:this.startState(Cs,i,t),this.updateUI(Cs,i);break;case js:this.startState(Os,i,t),this.updateUI(Os,i)}this.renderStatus=!0,this.triggerChangeEvent()}else this.repeatType.setProperties({value:Ds})},i.prototype.detachInputs=function(){for(var t=0,i=[].slice.call(this.element.querySelectorAll("input"));t<i.length;t++){var n=i[t];(0,e.detach)(n)}},i.prototype.destroy=function(){if(!this.isDestroyed){this.destroyComponents(),t.prototype.destroy.call(this);var i=["e-"+this.getModuleName()];for(this.cssClass&&(i=i.concat(this.cssClass.split(" "))),(0,e.removeClass)([this.element],i),this.detachInputs();this.element.firstElementChild;)this.element.removeChild(this.element.firstElementChild)}},i.prototype.getModuleName=function(){return"recurrenceeditor"},i.prototype.getPersistData=function(){return this.addOnPersist([])},i.prototype.render=function(){this.initialize(),this.rtlClass(this.enableRtl),this.renderStatus=!0,this.renderComplete()},i.prototype.onPropertyChanged=function(t,i){for(var n=0,r=Object.keys(t);n<r.length;n++){switch(r[n]){case"startDate":this.selectMonthDay(t.startDate),this.updateUntilDate(t.startDate),this.endType.setProperties({index:0});break;case"enableRtl":this.rtlClass(t.enableRtl);break;case"cssClass":i.cssClass&&(0,e.removeClass)([this.element],i.cssClass.split(" ")),t.cssClass&&(0,e.addClass)([this.element],t.cssClass.split(" "));break;case"selectedType":this.repeatType.setProperties({index:this.selectedType});break;case"minDate":this.untilDateObj.setProperties({min:this.minDate});break;case"maxDate":this.untilDateObj.setProperties({max:this.maxDate});break;case"value":this.getRecurrenceRule()!==this.value&&this.setRecurrenceRule(this.value);break;case"calendarMode":this.calendarMode=t.calendarMode,this.calendarUtil=ra(t.calendarMode);break;case"locale":case"frequencies":case"firstDayOfWeek":case"endTypes":this.refresh();break;case"dateFormat":this.untilDateObj.setProperties({format:t.dateFormat})}}},za([(0,e.Property)(["none","daily","weekly","monthly","yearly"])],i.prototype,"frequencies",void 0),za([(0,e.Property)(["never","until","count"])],i.prototype,"endTypes",void 0),za([(0,e.Property)(0)],i.prototype,"firstDayOfWeek",void 0),za([(0,e.Property)(new Date)],i.prototype,"startDate",void 0),za([(0,e.Property)()],i.prototype,"dateFormat",void 0),za([(0,e.Property)("Gregorian")],i.prototype,"calendarMode",void 0),za([(0,e.Property)()],i.prototype,"cssClass",void 0),za([(0,e.Property)()],i.prototype,"value",void 0),za([(0,e.Property)(new Date(1900,0,1))],i.prototype,"minDate",void 0),za([(0,e.Property)(new Date(2099,11,31))],i.prototype,"maxDate",void 0),za([(0,e.Property)(0)],i.prototype,"selectedType",void 0),za([(0,e.Event)()],i.prototype,"change",void 0),za([(0,e.Event)()],i.prototype,"created",void 0),za([(0,e.Event)()],i.prototype,"destroyed",void 0),i=za([e.NotifyPropertyChanges],i)}(e.Component),no="e-field",ro="e-recurrence-container",ao="e-hide",so=function(){function i(e){this.parent=e,this.l10n=this.parent.localeObj,this.fields=this.parent.eventFields,this.eventWindowTime={startTime:new Date,endTime:new Date},this.renderEventWindow()}return i.prototype.renderEventWindow=function(){this.element=(0,e.createElement)("div",{id:this.parent.element.id+"_dialog_wrapper"}),this.parent.element.appendChild(this.element);var i={animationSettings:{effect:"Zoom"},content:this.getEventWindowContent(),cssClass:Tn,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,height:this.parent.isAdaptive?"100%":"auto",minHeight:"300px",isModal:!0,showCloseIcon:!this.parent.isAdaptive,target:document.body,visible:!1,width:"500px",beforeOpen:this.onBeforeOpen.bind(this),beforeClose:this.onBeforeClose.bind(this)};this.parent.isAdaptive?(i.cssClass=Tn+" "+Be,this.parent.editorHeaderTemplate||(i.header='<div class="e-title-header"><div class="e-back-icon e-icons"></div><div class="e-title-text">'+this.l10n.getConstant("newEvent")+'</div><div class="e-save-icon e-icons"></div></div>')):(this.parent.editorFooterTemplate||this.renderDialogButtons(i),this.parent.editorHeaderTemplate||(i.header='<div class="e-title-text">'+this.l10n.getConstant("newEvent")+"</div>")),this.dialogObject=new t.Dialog(i,this.element),this.dialogObject.element.querySelector(".e-dlg-closeicon-btn")&&this.dialogObject.element.querySelector(".e-dlg-closeicon-btn").setAttribute("title",this.l10n.getConstant("close")),this.addEventHandlers(),(0,e.addClass)([this.element.parentElement],Tn+"-container"),e.EventHandler.add(this.dialogObject.element,"keydown",this.preventEventSave,this),this.applyFormValidation()},i.prototype.renderDialogButtons=function(e){e.buttons=[{buttonModel:{content:this.l10n.getConstant("deleteButton"),cssClass:Ji,disabled:!this.parent.eventSettings.allowDeleting||this.parent.readonly},click:this.eventDelete.bind(this)},{buttonModel:{content:this.l10n.getConstant("saveButton"),cssClass:"e-primary "+jn,isPrimary:!0,disabled:!this.parent.eventSettings.allowAdding||this.parent.readonly},click:this.eventSave.bind(this)},{buttonModel:{cssClass:Pn,content:this.l10n.getConstant("cancelButton")},click:this.dialogClose.bind(this)}]},i.prototype.addEventHandlers=function(){var t=this.element.querySelector(".e-back-icon"),i=this.element.querySelector("."+Hn);!this.parent.isAdaptive||(0,e.isNullOrUndefined)(t)||(0,e.isNullOrUndefined)(i)||(e.EventHandler.add(t,"click",this.dialogClose,this),e.EventHandler.add(i,"click",this.eventSave,this))},i.prototype.refresh=function(){this.destroy(!0),this.renderEventWindow()},i.prototype.refreshRecurrenceEditor=function(){if(this.recurrenceEditor){var e=this.recurrenceEditor.element;this.recurrenceEditor.destroy(),this.createRecurrenceEditor(e)}},i.prototype.setRecurrenceEditor=function(e){this.parent.editorTemplate&&(this.recurrenceEditor=e)},i.prototype.openEditor=function(t,i,n,r){if(this.parent.currentAction=i,this.parent.removeNewEventElement(),this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide(!0),this.parent.inlineModule.removeInlineAppointmentElement(),"Add"===i){var a={};this.cellClickAction=!n,this.parent.activeCellsData=t;var s=t;this.cellClickAction?this.convertToEventData(s,a):(this.parent.activeCellsData={startTime:s.startTime||s[this.fields.startTime],endTime:s.endTime||s[this.fields.endTime],isAllDay:s.isAllDay||s[this.fields.isAllDay],element:s.element,groupIndex:s.groupIndex},a=s),t=a}(0,e.isNullOrUndefined)(this.parent.editorHeaderTemplate)||(this.parent.resetTemplates(["editorHeaderTemplate"]),this.parent.isAdaptive&&!this.parent.editorFooterTemplate?this.dialogObject.header=this.createAdaptiveHeaderElement(t):this.dialogObject.header=this.getDialogHeader(t)),(0,e.isNullOrUndefined)(this.parent.editorFooterTemplate)||(this.parent.resetTemplates(["editorFooterTemplate"]),this.dialogObject.footerTemplate=this.getDialogFooter(t)),(0,e.isNullOrUndefined)(this.parent.editorHeaderTemplate)&&(0,e.isNullOrUndefined)(this.parent.editorFooterTemplate)||(this.dialogObject.dataBind(),this.addEventHandlers()),(0,e.isNullOrUndefined)(this.parent.editorTemplate)?this.setEditorContent(t,i,r):this.renderFormElements(this.element.querySelector(".e-schedule-form"),t,i,r)},i.prototype.setEditorContent=function(t,i,n){switch(!this.parent.isAdaptive&&(0,e.isNullOrUndefined)(this.parent.editorTemplate)&&(0,e.removeClass)([this.dialogObject.element.querySelector(".e-recurrenceeditor")],Ge),this.recurrenceEditor&&(this.recurrenceEditor.firstDayOfWeek=this.parent.activeViewOptions.firstDayOfWeek),i){case"Add":this.onCellDetailsUpdate(t,n);break;case"Save":case"EditOccurrence":case"EditSeries":case"EditFollowingEvents":"EditOccurrence"===i&&!this.parent.isAdaptive&&(0,e.isNullOrUndefined)(this.parent.editorTemplate)&&(0,e.addClass)([this.dialogObject.element.querySelector(".e-recurrenceeditor")],Ge),this.cellClickAction=!1,this.onEventDetailsUpdate(t)}},i.prototype.setDialogContent=function(){this.dialogObject.content=this.getEventWindowContent(),this.dialogObject.dataBind(),this.applyFormValidation()},i.prototype.setDialogHeader=function(){(0,e.isNullOrUndefined)(this.parent.editorHeaderTemplate)?this.parent.isAdaptive?this.dialogObject.header='<div class="e-title-header"><div class="e-back-icon e-icons"></div><div class="e-title-text">'+this.l10n.getConstant("newEvent")+'</div><div class="e-save-icon e-icons"></div></div>':this.dialogObject.header='<div class="e-title-text">'+this.l10n.getConstant("newEvent")+"</div>":(this.parent.resetTemplates(["editorHeaderTemplate"]),this.parent.isAdaptive&&!this.parent.editorFooterTemplate?this.dialogObject.header=this.createAdaptiveHeaderElement():this.dialogObject.header=this.getDialogHeader()),this.dialogObject.dataBind(),this.addEventHandlers()},i.prototype.setDialogFooter=function(){(0,e.isNullOrUndefined)(this.parent.editorFooterTemplate)?!this.parent.isAdaptive&&(0,e.isNullOrUndefined)(this.parent.editorFooterTemplate)?this.renderDialogButtons(this.dialogObject):this.parent.isAdaptive&&(0,e.isNullOrUndefined)(this.parent.editorFooterTemplate)&&(this.dialogObject.footerTemplate=null):(this.parent.resetTemplates(["editorFooterTemplate"]),this.dialogObject.footerTemplate=this.getDialogFooter()),this.dialogObject.dataBind()},i.prototype.createAdaptiveHeaderElement=function(t){var i=(0,e.createElement)("div",{className:"e-title-header"}),n=(0,e.createElement)("div",{className:"e-back-icon e-icons"});i.appendChild(n);var r=this.getDialogHeader(t);i.appendChild(r);var a=(0,e.createElement)("div",{className:"e-save-icon e-icons"});return i.appendChild(a),i},i.prototype.getDialogHeader=function(t){var i,n=this.parent.element.id+"_editorHeaderTemplate",r=document.createElement("div");return i=[].slice.call(this.parent.getEditorHeaderTemplate()(t||{},this.parent,"editorHeaderTemplate",n,!1)),(0,e.append)(i,r),r},i.prototype.getDialogFooter=function(t){var i,n=this.parent.element.id+"_editorFooterTemplate",r=document.createElement("div");return i=[].slice.call(this.parent.getEditorFooterTemplate()(t||{},this.parent,"editorFooterTemplate",n,!1)),(0,e.append)(i,r),r},i.prototype.preventEventSave=function(e){this.parent&&!this.parent.allowKeyboardInteraction&&"Enter"===e.code&&(this.isEnterKey=!0)},i.prototype.onBeforeOpen=function(t){var i=this,n=this.eventData[this.fields.endTime].getTime(),r={type:"Editor",data:this.eventData,cancel:!1,element:this.element,target:this.cellClickAction?this.parent.activeCellsData.element:this.parent.activeEventData.element};this.cellClickAction&&(r.duration=this.getSlotDuration());var a=this.getInstance(jn);a&&(a.disabled=!(this.cellClickAction?this.parent.eventSettings.allowAdding:this.parent.eventSettings.allowEditing),a.dataBind());var s=this.getInstance(Ji);s&&(s.disabled=!this.parent.eventSettings.allowDeleting,s.dataBind());var o=new Sr.Deferred;return this.parent.trigger(D,r,(function(r){if(t.cancel=r.cancel,t.maxHeight=i.parent.isAdaptive?"max-content":t.maxHeight,i.duration=i.cellClickAction?r.duration:null,i.eventData[i.fields.endTime].getTime()!==n||i.cellClickAction||0!==i.eventData[i.fields.endTime].getHours()||0!==i.eventData[i.fields.endTime].getMinutes()||(i.eventData=(0,e.extend)({},i.eventData,null,!0),i.trimAllDay(i.eventData)),i.refreshDateTimePicker(i.duration),i.cellClickAction&&r.duration!==i.getSlotDuration()&&(0,e.isNullOrUndefined)(i.parent.editorTemplate)){var a=i.getInstance(xn),s=i.getInstance(Vn);s.value=new Date(a.value.getTime()+ne*r.duration),s.dataBind()}i.parent.editorTemplate&&i.element.querySelector(".e-recurrenceeditor")&&!i.recurrenceEditor&&(i.recurrenceEditor=i.getInstance("e-recurrenceeditor")),o.resolve(t)})),o},i.prototype.onBeforeClose=function(e){var t=this;e.isInteracted&&(this.isCrudAction=!1);var i={type:"Editor",event:e.event||this.dialogEvent,data:this.eventCrudData,cancel:!1,element:this.element,target:this.cellClickAction?this.parent.activeCellsData.element:this.parent.activeEventData.element},n=new Sr.Deferred;return this.parent.trigger(b,i,(function(i){e.cancel=i.cancel,i.cancel||(t.isCrudAction&&(e.cancel=t.processCrudActions(i.data),t.isCrudAction=e.cancel),t.isCrudAction||(t.resetForm(),t.parent.eventBase.focusElement(!0),t.eventCrudData=null)),n.resolve(e)})),n},i.prototype.getEventWindowContent=function(){var t=(0,e.createElement)("div",{className:"e-form-container"}),i=(0,e.createElement)("form",{id:this.parent.element.id+"EditForm",className:wn,attrs:{onsubmit:"return false;"}});return this.renderFormElements(i),t.appendChild(i),t},i.prototype.renderFormElements=function(t,i,n,r){var a=this;if((0,e.isNullOrUndefined)(this.parent.editorTemplate))t.appendChild(this.getDefaultEventWindowContent()),i&&this.setEditorContent(i,n,r);else{if(i&&(this.fieldValidator&&(this.fieldValidator.destroy(),this.fieldValidator=null),this.recurrenceEditor&&(this.recurrenceEditor.destroy(),this.recurrenceEditor=null),this.destroyComponents(),this.parent.resetTemplates(["editorTemplate"]),e.EventHandler.clearEvents(t),!this.parent.isReact))for(var s=0,o=[].slice.call(t.children);s<o.length;s++){var l=o[s];(0,e.remove)(l)}var p=this.parent.element.id+"_editorTemplate",c=[].slice.call(this.parent.getEditorTemplate()(i||{},this.parent,"editorTemplate",p,!1));(0,e.append)(c,t),this.parent.renderTemplates((function(){a.element&&(a.applyFormValidation(),i&&a.setEditorContent(i,n,r))}))}},i.prototype.getDefaultEventWindowContent=function(){var t=this.createDivElement("e-dialog-parent"),i=this.createDivElement("e-title-location-row");t.appendChild(i),i.appendChild(this.renderTextBox(Cn)),i.appendChild(this.renderTextBox(On));var n=this.createDivElement("e-start-end-row");t.appendChild(n),n.appendChild(this.renderDateTimePicker(xn,this.onTimeChange.bind(this))),n.appendChild(this.renderDateTimePicker(Vn));var r=this.createDivElement("e-all-day-time-zone-row");t.appendChild(r),r.appendChild(this.renderCheckBox(Dn)),r.appendChild(this.renderCheckBox(bn));var a=this.createDivElement(Mn);t.appendChild(a),a.appendChild(this.renderDropDown(kn)),a.appendChild(this.renderDropDown(Rn));var s=this.createDivElement("e-repeat-parent-row");t.appendChild(s);var o=this.renderCheckBox(Sn),l=(0,e.createElement)("span",{className:ro}),p=(0,e.createElement)("button",{className:"e-recurrence-edit-button",attrs:{type:"button",title:this.l10n.getConstant("editRecurrence")}});if(this.buttonObj=new Na.Button({iconCss:"e-recurrence-edit e-icons",cssClass:"e-medium "+this.parent.cssClass}),l.appendChild(p),this.buttonObj.appendTo(p),o.appendChild(l),s.appendChild(o),this.parent.isAdaptive?e.EventHandler.add(p,"click",this.loadRecurrenceEditor,this):this.createRecurrenceEditor(t),this.parent.resourceCollection.length>0){for(var c=this.createDivElement("e-resources-row"),h=0,d=this.parent.resourceBase.resourceCollection;h<d.length;h++){var u=d[h];c.appendChild(this.renderResourceDetails(u))}t.appendChild(c)}var g=this.createDivElement(An+"-row");g.appendChild(this.renderTextBox(An)),t.appendChild(g);var v=(0,e.createElement)("button",{attrs:{type:"hidden",title:"submit"}});return v.style.display="none",t.appendChild(v),t},i.prototype.createRecurrenceEditor=function(t){var i=(0,e.createElement)("div",{id:this.parent.element.id+"_recurrence_editor"});t.appendChild(i),this.recurrenceEditor=this.renderRecurrenceEditor(),this.recurrenceEditor.appendTo(i),this.updateMinMaxDateToEditor()},i.prototype.createDivElement=function(t){return(0,e.createElement)("div",{className:t})},i.prototype.createInputElement=function(t,i,n){return(0,e.createElement)(n||"input",{className:t,attrs:{type:"text",name:i,value:"",id:i}})},i.prototype.getSlotDuration=function(){return this.parent.activeViewOptions.timeScale.interval/this.parent.activeViewOptions.timeScale.slotCount},i.prototype.renderDateTimePicker=function(t,i){var r=this.createDivElement(t+"-container"),a=this.getFieldName(t),s=this.createInputElement(t+" "+no,a);return r.appendChild(s),new n.DateTimePicker({change:i,firstDayOfWeek:this.parent.activeViewOptions.firstDayOfWeek,calendarMode:this.parent.calendarMode,min:this.parent.minDate,max:new Date(new Date(+this.parent.maxDate).setHours(23,59,59)),cssClass:this.parent.cssClass,enableRtl:this.parent.enableRtl,locale:this.parent.locale,floatLabelType:"Always",strictMode:!0,timeFormat:this.parent.activeViewOptions.timeFormat,format:((0,e.isNullOrUndefined)(this.parent.dateFormat)?this.getFormat("dateFormats"):this.parent.dateFormat)+" "+this.parent.activeViewOptions.timeFormat,placeholder:this.getFieldLabel(t),step:this.getSlotDuration(),width:"100%"}).appendTo(s),r},i.prototype.refreshDateTimePicker=function(e){for(var t="."+xn+",."+Vn,i=0,n=[].slice.call(this.element.querySelectorAll(t));i<n.length;i++){var r=n[i].ej2_instances[0];r.firstDayOfWeek=this.parent.activeViewOptions.firstDayOfWeek,r.timeFormat=this.parent.activeViewOptions.timeFormat,r.step=e||this.getSlotDuration(),r.dataBind()}},i.prototype.onTimeChange=function(){var t=this.getInstance(xn);if(t.element.parentElement.classList.contains("e-input-focus")){var i=this.getInstance(Vn),n=0;this.cellClickAction?(n=ne*this.duration,this.eventWindowTime.startTime=t.value):n=this.eventData[this.fields.endTime].getTime()-this.eventData[this.fields.startTime].getTime();var r=(0,e.isNullOrUndefined)(t.value)?null:new Date(t.value.getTime()+n);this.cellClickAction&&(this.eventWindowTime.endTime=r),i.value=r,i.dataBind()}this.recurrenceEditor&&this.recurrenceEditor.updateRuleUntilDate(this.eventWindowTime.startTime)},i.prototype.renderResourceDetails=function(t){var i=this,n=t.field,r="e-"+n,a=t.title,s=this.createDivElement(r+"-container e-resources"),o=this.createInputElement(r+" "+no,n);s.appendChild(o);var l=function(i){return e.SanitizeHtmlHelper.sanitize('<div class="e-resource-template">\n <div class="e-resource-color" data-resource-color="'+i[t.colorField]+'"></div>\n <div class="e-resource-text">'+i[t.textField]+"</div></div>")};((0,e.initializeCSPTemplate)(l,t),t.allowMultiple)?new Ba.MultiSelect({enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:this.parent.cssClass||"",dataSource:t.dataSource,change:this.onMultiselectResourceChange.bind(this),itemTemplate:l,fields:{text:t.textField,value:t.idField},htmlAttributes:{name:n},floatLabelType:"Always",placeholder:a,popupHeight:"230px",popupWidth:"447px",mode:"Box",open:function(e){Promise.resolve().then((function(){i.applyStylesAfterRender(e)}))}}).appendTo(o):new Ba.DropDownList({cssClass:this.parent.cssClass||"",change:this.onDropdownResourceChange.bind(this),dataSource:t.dataSource,enableRtl:this.parent.enableRtl,fields:{text:t.textField,value:t.idField},htmlAttributes:{name:n},floatLabelType:"Always",placeholder:a,popupHeight:"230px",popupWidth:"447px",itemTemplate:l,open:function(e){Promise.resolve().then((function(){i.applyStylesAfterRender(e)}))}}).appendTo(o);return s},i.prototype.applyStylesAfterRender=function(e){e.popup&&e.popup.element&&e.popup.element.querySelectorAll(".e-resource-color[data-resource-color]").forEach((function(e){var t=e.getAttribute("data-resource-color");t&&(e.style.backgroundColor=t)}))},i.prototype.renderDropDown=function(e){var t=this,i=this.getFieldName(e),n=this.createDivElement(e+"-container"),r=this.createInputElement(e+" "+no,i);return n.appendChild(r),new Ba.DropDownList({allowFiltering:!0,change:this.onTimezoneChange.bind(this),cssClass:this.parent.cssClass||"",dataSource:this.parent.timezoneDataSource,enableRtl:this.parent.enableRtl,fields:{text:"Text",value:"Value"},filterBarPlaceholder:this.parent.localeObj.getConstant("searchTimezone"),noRecordsTemplate:this.parent.localeObj.getConstant("noRecords"),filtering:function(e){var i=new Sr.Query;i=""!==e.text?i.where("Text","contains",e.text,!0):i,e.updateData(t.parent.timezoneDataSource,i)},htmlAttributes:{title:this.getFieldLabel(e),name:i},floatLabelType:"Always",placeholder:this.getFieldLabel(e),popupHeight:"230px"}).appendTo(r),n},i.prototype.onMultiselectResourceChange=function(t){if(t.value&&this.parent.activeViewOptions.group.byGroupID&&!(this.parent.resourceCollection.length<=1))for(var i=this.parent.resourceBase.resourceCollection,n=t.element.getAttribute("name")||this.getColumnName(t.element),r=0;r<i.length;r++)if(i[parseInt(r.toString(),10)].field===n&&r<i.length-1){for(var a=this.createInstance(r),s=[],o=function(n){var a=i[r+1],o=a.dataSource.filter((function(e){return e[a.groupIDField]===t.value[parseInt(n.toString(),10)]}))[0],p=(0,e.isNullOrUndefined)(o)?null:o[i[r+1].groupIDField],c=l.filterDatasource(r,p);s=s.concat(c)},l=this,p=0;p<t.value.length;p++)o(p);a.dataSource=s,a.dataBind()}},i.prototype.createInstance=function(e){var t=this.parent.resourceBase.resourceCollection[e+1],i=this.element.querySelector(".e-"+t.field).ej2_instances[0];return i.clear(),i},i.prototype.onDropdownResourceChange=function(e){if(e.value&&!(this.parent.resourceCollection.length<=1)&&this.parent.activeViewOptions.group.byGroupID)for(var t=e.element.getAttribute("name")||this.getColumnName(e.element),i=this.parent.resourceBase.resourceCollection,n=0;n<i.length;n++)if(n<i.length-1&&i[parseInt(n.toString(),10)].field===t){var r=this.createInstance(n),a=e.itemData[i[parseInt(n.toString(),10)].idField];r.dataSource=this.filterDatasource(n,a),r.dataBind();var s=r.dataSource.length>0?r.dataSource[0][i[n+1].idField]:null;r.value=i[n+1].allowMultiple?[s]:s,r.dataBind()}},i.prototype.filterDatasource=function(e,t){var i=this.parent.resourceBase.resourceCollection[e+1];return i.dataSource.filter((function(e){return e[i.groupIDField]===t}))},i.prototype.onTimezoneChange=function(e){if((e.element.getAttribute("name")||this.getColumnName(e.element))===this.parent.eventFields.startTimezone){var t=this.getInstance(kn),i=this.getInstance(Rn);i.value=t.value,i.dataBind()}},i.prototype.renderCheckBox=function(e){var t=this.createDivElement(e+"-container"),i=this.getFieldName(e),n=this.createInputElement(e+" "+no,i);t.appendChild(n);var r=new Na.CheckBox({change:this.onChange.bind(this),cssClass:e+" "+this.parent.cssClass,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,label:this.getFieldLabel(e)});return r.appendTo(n),n.setAttribute("name",i),"Repeat"===i&&(this.repeatStatus=r),t},i.prototype.renderTextBox=function(e){var t=this.createDivElement(e+"-container"),i=this.getFieldName(e),n=e===An?"textarea":"input",r=this.createInputElement(e+" "+no,i,n);return t.appendChild(r),La.Input.createInput({element:r,floatLabelType:"Always",properties:{enableRtl:this.parent.enableRtl,placeholder:this.getFieldLabel(e)}}),t},i.prototype.getFieldName=function(e){var t="";switch(e){case Cn:t=this.fields.subject;break;case On:t=this.fields.location;break;case xn:t=this.fields.startTime;break;case Vn:t=this.fields.endTime;break;case An:t=this.fields.description;break;case Dn:t=this.fields.isAllDay;break;case kn:t=this.fields.startTimezone;break;case Rn:t=this.fields.endTimezone;break;case bn:t="Timezone";break;case Sn:t="Repeat"}return t},i.prototype.getFieldLabel=function(e){var t="";switch(e){case Cn:t=this.parent.editorTitles.subject;break;case On:t=this.parent.editorTitles.location;break;case An:t=this.parent.editorTitles.description;break;case xn:t=this.parent.editorTitles.startTime;break;case Vn:t=this.parent.editorTitles.endTime;break;case kn:t=this.parent.editorTitles.startTimezone;break;case Rn:t=this.parent.editorTitles.endTimezone;break;case Sn:t=this.parent.editorTitles.recurrenceRule;break;case Dn:t=this.parent.editorTitles.isAllDay;break;case bn:t=this.l10n.getConstant("timezone")}return t},i.prototype.onChange=function(t){if(t.event&&t.event.target){var i="."+Dn+",."+bn+",."+Sn,n=(0,e.closest)(t.event.target,i);n.classList.contains(Dn)?this.onAllDayChange(t.checked):n.classList.contains(bn)?this.timezoneChangeStyle(t.checked):n.classList.contains(Sn)&&this.onRepeatChange(t.checked)}},i.prototype.renderRepeatDialog=function(){var i=(0,e.createElement)("div");this.repeatDialogObject=new t.Dialog({header:this.l10n.getConstant("recurrence"),visible:!1,content:'<div class="e-rec-editor"></div>',closeOnEscape:!0,width:"90%",buttons:[{click:this.repeatSaveDialog.bind(this),buttonModel:{content:this.l10n.getConstant("save"),cssClass:"e-save",isPrimary:!0}},{click:this.repeatCancelDialog.bind(this),buttonModel:{cssClass:"e-cancel",content:this.l10n.getConstant("cancel")}}],target:this.element,animationSettings:{effect:"Zoom"},enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,isModal:!0,cssClass:"e-recurrence-dialog",open:this.repeatOpenDialog.bind(this)}),this.element.appendChild(i),this.repeatDialogObject.appendTo(i),this.createRecurrenceEditor(this.repeatDialogObject.element.querySelector(".e-rec-editor"))},i.prototype.loadRecurrenceEditor=function(){this.repeatDialogObject.show(),this.recurrenceEditor&&this.repeatRule&&this.recurrenceEditor.setRecurrenceRule(this.repeatRule)},i.prototype.onRepeatChange=function(t){if(t)this.repeatDialogObject||this.renderRepeatDialog(),this.recurrenceEditor.setProperties({startDate:this.repeatStartDate,selectedType:0}),this.loadRecurrenceEditor();else{this.repeatDialogObject&&this.repeatDialogObject.hide(),this.repeatRule="",this.recurrenceEditor&&(this.recurrenceEditor.setRecurrenceRule(this.repeatRule),this.updateRepeatLabel(this.repeatRule));var i=this.element.querySelector("."+ro);(0,e.addClass)([i],ao)}},i.prototype.repeatSaveDialog=function(){this.repeatRule=this.recurrenceEditor.getRecurrenceRule();var t=this.element.querySelector("."+ro);this.recurrenceEditor.getRecurrenceRule()?(0,e.removeClass)([t],ao):((0,e.addClass)([t],ao),this.repeatStatus.setProperties({checked:!1})),this.updateRepeatLabel(this.repeatRule),this.closeRepeatDialog()},i.prototype.closeRepeatDialog=function(){this.repeatDialogObject.hide()},i.prototype.repeatCancelDialog=function(){this.closeRepeatDialog(),this.recurrenceEditor&&this.recurrenceEditor.setRecurrenceRule(this.repeatTempRule),this.repeatTempRule||this.repeatStatus.setProperties({checked:!1})},i.prototype.repeatOpenDialog=function(){this.repeatTempRule=this.recurrenceEditor.getRecurrenceRule()},i.prototype.onCellDetailsUpdate=function(t,i){if(this.parent.eventSettings.allowAdding){this.parent.isAdaptive&&i&&!this.repeatDialogObject&&this.renderRepeatDialog(),this.element.querySelector("."+wn).removeAttribute("data-id"),(0,e.isNullOrUndefined)(this.parent.editorHeaderTemplate)&&(this.element.querySelector("."+Nn).innerHTML=this.l10n.getConstant("newEvent")),t.Timezone=!1,this.repeatStartDate=t[this.fields.startTime],this.repeatRule="",(0,e.isNullOrUndefined)(this.parent.eventSettings.fields.subject.default)||(t[this.fields.subject]=this.parent.eventSettings.fields.subject.default),(0,e.isNullOrUndefined)(this.parent.eventSettings.fields.location.default)||(t[this.fields.location]=this.parent.eventSettings.fields.location.default),(0,e.isNullOrUndefined)(this.parent.eventSettings.fields.description.default)||(t[this.fields.description]=this.parent.eventSettings.fields.description.default),this.showDetails(t),t[this.fields.recurrenceRule]&&this.recurrenceEditor&&(this.recurrenceEditor.setRecurrenceRule(t[this.fields.recurrenceRule],t[this.fields.startTime]),this.repeatRule=t[this.fields.recurrenceRule]);var n=this.element.querySelector("."+Ji);if(n&&(0,e.addClass)([n],Ge),this.recurrenceEditor&&(this.recurrenceEditor.setProperties({startDate:t[this.fields.startTime],selectedType:(0,e.isNullOrUndefined)(i)?(0,e.isNullOrUndefined)(t[this.fields.recurrenceRule])?0:this.recurrenceEditor.selectedType:i}),this.repeatRule=this.recurrenceEditor.value),this.parent.isAdaptive&&(0,e.isNullOrUndefined)(this.parent.editorTemplate)){var r=this.element.querySelector("."+ro);t[this.fields.recurrenceRule]||i?((0,e.removeClass)([r],ao),this.repeatStatus.setProperties({checked:!0})):((0,e.addClass)([r],ao),this.repeatStatus.setProperties({checked:!1})),this.updateRepeatLabel(this.repeatRule)}else{var a=this.element.querySelector("."+jn);this.disableButton(a,!1)}this.dialogObject.show()}},i.prototype.convertToEventData=function(e,t){e.subject&&(t[this.fields.subject]=e.subject),t[this.fields.startTime]=e.startTime,t[this.fields.endTime]=e.endTime,t[this.fields.isAllDay]=e.isAllDay,e.RecurrenceRule&&(t[this.fields.recurrenceRule]=e.RecurrenceRule),(this.parent.resourceCollection.length>0||this.parent.activeViewOptions.group.resources.length>0)&&this.parent.resourceBase.setResourceValues(t)},i.prototype.applyFormValidation=function(){var t=this.element.querySelector("."+wn);if(t){var i=function(e){return e&&Object.keys(e).length>0?e:void 0},n={},r=i(this.parent.eventSettings.fields.subject.validation);(0,e.isNullOrUndefined)(r)||(n[this.parent.eventSettings.fields.subject.name]=r);var a=i(this.parent.eventSettings.fields.location.validation);(0,e.isNullOrUndefined)(a)||(n[this.parent.eventSettings.fields.location.name]=a);var s=i(this.parent.eventSettings.fields.startTime.validation);(0,e.isNullOrUndefined)(s)||(n[this.parent.eventSettings.fields.startTime.name]=s);var o=i(this.parent.eventSettings.fields.endTime.validation);(0,e.isNullOrUndefined)(o)||(n[this.parent.eventSettings.fields.endTime.name]=o);var l=i(this.parent.eventSettings.fields.description.validation);(0,e.isNullOrUndefined)(l)||(n[this.parent.eventSettings.fields.description.name]=l),this.fieldValidator&&(this.fieldValidator.destroy(),this.fieldValidator=null),this.fieldValidator=new qa,this.fieldValidator.renderFormValidator(t,n,this.element,this.parent.locale)}},i.prototype.showDetails=function(t){this.eventData=t;var i=(0,e.extend)({},t,null,!0),n=this.getFormElements(Tn);this.cellClickAction&&(!this.cellClickAction||(0,e.isNullOrUndefined)(this.parent.editorTemplate))||0!==i[this.fields.endTime].getHours()||0!==i[this.fields.endTime].getMinutes()||this.trimAllDay(i);for(var r=Object.keys(i),a=0,s=n;a<s.length;a++){var o=s[a],l=o.name||this.getColumnName(o);(0,e.isNullOrUndefined)(l)||""===l||(-1!==r.indexOf(l)?this.setValueToElement(o,i[""+l]):this.setDefaultValueToElement(o))}if((0,e.isNullOrUndefined)(this.parent.editorTemplate)){this.onAllDayChange(i[this.fields.isAllDay]);var p=this.getInstance(bn+"."+no);(0,e.isNullOrUndefined)(i[this.fields.startTimezone])&&(0,e.isNullOrUndefined)(i[this.fields.endTimezone])||(p.checked=!0,p.dataBind()),this.timezoneChangeStyle(p.checked),delete i.Timezone}},i.prototype.getColumnName=function(t){var i=t.getAttribute("data-name")||"";if(""===i){var n=!1,r="";t.classList.contains("e-dropdownlist")?(r="e-ddl",n=!0):t.classList.contains("e-multiselect")?(r="e-multiselect",n=!0):t.classList.contains("e-datetimepicker")?r="e-datetimepicker":t.classList.contains("e-datepicker")?r="e-datepicker":t.classList.contains("e-checkbox")?r="e-checkbox":t.classList.contains("e-numerictextbox")&&(r="e-numerictextbox");var a=n?"."+r+":not(.e-control)":"."+r,s=(0,e.closest)(t,a)||t.querySelector("."+r);if(s){var o=s.querySelector("[name]");o&&(i=o.name)}}return i},i.prototype.onAllDayChange=function(t){var i,n=this.getInstance(xn),r=this.getInstance(Vn),a=this.element.querySelector(".e-time-zone-container");t?(i=(0,e.isNullOrUndefined)(this.parent.dateFormat)?this.getFormat("dateFormats"):this.parent.dateFormat,(0,e.addClass)(this.element.querySelectorAll(".e-time-icon"),Ln),(0,e.addClass)([a],Ge),this.element.querySelector("."+Mn)&&(0,e.removeClass)([this.element.querySelector("."+Mn)],_e),n.format=r.format=i):(i=(0,e.isNullOrUndefined)(this.parent.dateFormat)?this.getFormat("dateFormats")+" "+this.parent.activeViewOptions.timeFormat:this.parent.dateFormat+" "+this.parent.activeViewOptions.timeFormat,(0,e.removeClass)(this.element.querySelectorAll(".e-time-icon"),Ln),(0,e.removeClass)([a],Ge),this.element.querySelector(".e-checkbox-wrapper .e-time-zone").checked&&(0,e.addClass)([this.element.querySelector("."+Mn)],_e),n.format=r.format=i),this.cellClickAction&&this.updateDateTime(t,n,r),n.dataBind(),r.dataBind(),(0,e.isNullOrUndefined)(this.recurrenceEditor)||this.recurrenceEditor.updateRuleUntilDate(n.value)},i.prototype.updateDateTime=function(e,t,i){var n,r;if(e)if(n=ve(new Date(this.eventWindowTime.startTime.getTime())),this.parent.activeCellsData.isAllDay){var a=ye(new Date(this.eventWindowTime.endTime.getTime()),-1).getTime();r=+this.eventWindowTime.startTime>a?this.eventWindowTime.endTime:new Date(a)}else r=ve(new Date(this.eventWindowTime.endTime.getTime()));else{var s=this.parent.activeCellsData.startTime;if((n=new Date(this.eventWindowTime.startTime.getTime())).setHours(s.getHours(),s.getMinutes(),s.getSeconds()),this.parent.activeCellsData.isAllDay){var o=this.parent.getStartEndTime(this.parent.workHours.start);n.setHours(o.getHours(),o.getMinutes(),o.getSeconds()),(r=new Date(n.getTime())).setMilliseconds(ne*this.getSlotDuration())}else(r=new Date(n.getTime())).setMilliseconds(this.parent.activeCellsData.endTime.getTime()-this.parent.activeCellsData.startTime.getTime())}this.eventWindowTime={startTime:new Date(n.getTime()),endTime:new Date(r.getTime())},t.value=n,i.value=r,t.dataBind(),i.dataBind()},i.prototype.getFormat=function(t){return(0,e.isNullOrUndefined)(this.parent.locale)||"en"===this.parent.locale||"en-US"===this.parent.locale?(0,e.getValue)(t+".short",(0,e.getDefaultDateObject)(this.parent.getCalendarMode())):(0,e.getValue)("main."+this.parent.locale+".dates.calendars."+this.parent.getCalendarMode()+"."+t+".short",e.cldrData)},i.prototype.onEventDetailsUpdate=function(t){if(this.parent.eventSettings.allowEditing){if(!this.parent.isAdaptive&&(0,e.isNullOrUndefined)(this.parent.editorFooterTemplate)&&(0,e.removeClass)([this.element.querySelector("."+Ji)],Ge),(0,e.isNullOrUndefined)(this.parent.editorHeaderTemplate)&&(this.element.querySelector("."+Nn).innerHTML=this.l10n.getConstant("editEvent")),this.element.querySelector("."+wn).setAttribute("data-id",t[this.fields.id].toString()),(0,e.isNullOrUndefined)(this.parent.editorTemplate)){t=(0,e.extend)({},t,null,!0);var i=this.getInstance(bn+"."+no),n=void 0;t[this.fields.startTimezone]||t[this.fields.endTimezone]?(n=!0,this.parent.eventBase.timezoneConvert(t)):n=!1,t.Timezone=n,i.checked=n,i.dataBind()}if(this.showDetails(t),t[this.fields.recurrenceRule]&&this.recurrenceEditor?this.recurrenceEditor.setRecurrenceRule(t[this.fields.recurrenceRule],t[this.fields.startTime]):!this.parent.isAdaptive&&this.recurrenceEditor&&(this.recurrenceEditor.setProperties({startDate:t[this.fields.startTime]}),this.recurrenceEditor.setRecurrenceRule("")),this.repeatStartDate=t[this.fields.startTime],this.repeatRule="",t[this.fields.recurrenceRule]&&(this.recurrenceEditor&&this.recurrenceEditor.setRecurrenceRule(t[this.fields.recurrenceRule],t[this.fields.startTime]),this.repeatRule=t[this.fields.recurrenceRule]),this.parent.isAdaptive&&(0,e.isNullOrUndefined)(this.parent.editorTemplate)){var r=this.element.querySelector("."+ro);t[this.fields.recurrenceRule]?((0,e.removeClass)([r],ao),this.repeatStatus.setProperties({checked:!0})):((0,e.addClass)([r],ao),this.repeatStatus.setProperties({checked:!1})),this.updateRepeatLabel(this.repeatRule)}var a=this.parent.readonly||t[this.fields.isReadonly];if(this.parent.isAdaptive){var s=this.element.querySelector("."+Hn);s&&(a?(0,e.addClass)([s],or):(0,e.removeClass)([s],or))}else{var o=this.element.querySelector("."+jn),l=this.element.querySelector("."+Ji);this.disableButton(o,a),this.disableButton(l,a)}this.dialogObject.show()}},i.prototype.disableButton=function(e,t){e&&(e.ej2_instances[0].disabled=t)},i.prototype.renderRecurrenceEditor=function(){return new io({calendarMode:this.parent.calendarMode,cssClass:this.parent.cssClass,dateFormat:this.parent.dateFormat,enableRtl:this.parent.enableRtl,firstDayOfWeek:this.parent.activeViewOptions.firstDayOfWeek,locale:this.parent.locale})},i.prototype.updateMinMaxDateToEditor=function(){var e=this.element.querySelector(".e-start"),t=this.element.querySelector(".e-end");if(e&&t){var i=e.ej2_instances[0],n=t.ej2_instances[0];i.min=this.parent.minDate,i.max=this.parent.maxDate,n.min=this.parent.minDate,n.max=this.parent.maxDate,i.dataBind(),n.dataBind()}if(this.recurrenceEditor){var r=this.recurrenceEditor.element.querySelector(".e-until-date");if(r){var a=r.ej2_instances[0];a.min=this.parent.minDate,a.max=this.parent.maxDate,a.dataBind()}}},i.prototype.updateRepeatLabel=function(e){this.parent.isAdaptive&&!this.repeatDialogObject&&this.renderRepeatDialog();var t=e?this.l10n.getConstant("repeats")+" "+this.recurrenceEditor.getRuleSummary(e):this.l10n.getConstant("repeat");this.repeatStatus.setProperties({label:t})},i.prototype.dialogClose=function(e){this.isEnterKey?this.isEnterKey=!1:(this.dialogEvent=e,this.isCrudAction=!1,this.parent.activeEventData={event:void 0,element:void 0},this.parent.currentAction=null,this.dialogObject.hide())},i.prototype.resetForm=function(){this.fieldValidator.destroyToolTip(),this.resetFormFields(),this.parent.isAdaptive||!this.recurrenceEditor||this.recurrenceEditor.isDestroyed||this.recurrenceEditor.resetFields()},i.prototype.timezoneChangeStyle=function(t){var i=this.element.querySelector("."+Mn),n=this.parent.tzModule.getLocalTimezoneName();if(t){(0,e.addClass)([i],_e);var r=this.getInstance(kn),a=this.getInstance(Rn),s=r.dataSource;if(!r.value||!this.parent.timezone)s.some((function(e){return e.Value===n}))||(s.push({Value:n,Text:n}),r.dataSource=s,a.dataSource=s,r.dataBind(),a.dataBind());r.value=r.value||this.parent.timezone||n,a.value=a.value||this.parent.timezone||n,r.dataBind(),a.dataBind()}else(0,e.removeClass)([i],_e)},i.prototype.resetFormFields=function(){for(var t=0,i=this.getFormElements(Tn);t<i.length;t++){var n=i[t],r=n.name||this.getColumnName(n);(0,e.isNullOrUndefined)(r)||""===r||this.setDefaultValueToElement(n)}},i.prototype.eventSave=function(e,t){if(this.isEnterKey)this.isEnterKey=!1;else{var i=this.element.querySelector("."+wn);if(!i||!i.classList.contains("e-formvalidator")||i.ej2_instances[0].validate()){var n=this.getEventDataFromEditor();this.processEventValidation(n.tempData,t)||(this.eventCrudData=n.eventData,this.dialogEvent=e,this.isCrudAction=!0,this.dialogObject.hide())}}},i.prototype.getEventDataFromEditor=function(){var t=(0,e.extend)({},this.getObjectFromFormData(Tn));t.Timezone||(t[this.fields.startTimezone]=null,t[this.fields.endTimezone]=null),delete t.Timezone,delete t.Repeat,this.setDefaultValueToObject(t),t[this.fields.recurrenceRule]=this.recurrenceEditor?this.recurrenceEditor.getRecurrenceRule()||null:void 0;var i=(0,e.extend)({},t,null,!0);return t[this.fields.isAllDay]&&(t[this.fields.startTime]=(0,e.isNullOrUndefined)(t[this.fields.startTime])?null:ve(new Date(t[this.fields.startTime].getTime())),t[this.fields.endTime]=(0,e.isNullOrUndefined)(t[this.fields.endTime])?null:ye(ve(new Date(t[this.fields.endTime].getTime())),1)),{eventData:t,tempData:i}},i.prototype.processEventValidation=function(t,i){var n;if((0,e.isNullOrUndefined)(this.parent.editorTemplate)){if(!t[this.fields.startTime]||!t[this.fields.endTime])return this.parent.quickPopup.openValidationError("invalidDateError"),!0;if(t[this.fields.startTime]>t[this.fields.endTime])return this.parent.quickPopup.openValidationError("startEndError"),!0}if(this.recurrenceEditor&&this.recurrenceEditor.value&&""!==this.recurrenceEditor.value){"EditOccurrence"!==this.parent.currentAction&&(n=this.recurrenceValidation(t[this.fields.startTime],t[this.fields.endTime],i));var r=!0;if("seriesChangeAlert"===n&&this.parent.uiStateValues.isIgnoreOccurrence&&(r=!1),!(0,e.isNullOrUndefined)(n)&&r&&(!this.parent.enableRecurrenceValidation&&"wrongPattern"===n||this.parent.enableRecurrenceValidation))return this.parent.quickPopup.openRecurrenceValidationAlert(n),!0}return!1},i.prototype.processCrudActions=function(t){var i=this;this.parent.uiStateValues.isBlock=!1;var n=this.getResourceData(t),r=(this.parent.activeViewOptions.group.resources.length>0||this.parent.resourceCollection.length>0)&&!this.parent.activeViewOptions.group.allowGroupEdit&&!(0,e.isNullOrUndefined)(n),a=this.getEventIdFromForm();if((0,e.isNullOrUndefined)(a)){if(this.parent.currentAction="Add",this.parent.eventBase.checkOverlap(t))return!0;r?this.resourceSaveEvent(t,this.parent.currentAction):(t[this.fields.id]=this.parent.eventBase.getEventMaxID(),this.parent.addEvent(t))}else{var s="string"===this.parent.eventBase.getEventIDType()?a:parseInt(a,10),o=this.parent.eventsData.filter((function(e){return e[i.fields.id]===s}))[0];if((0,e.isNullOrUndefined)(o)&&(o=this.parent.blockData.filter((function(e){return e[i.fields.id]===s}))[0]),(t=(0,e.extend)({},o,t))[this.fields.isReadonly])return!1;if(this.parent.eventBase.checkOverlap(t))return!0;var l=void 0;if(!(0,e.isNullOrUndefined)(o[this.fields.recurrenceRule])){if(l=this.parent.currentAction,t.Guid=this.parent.activeEventData.event.Guid,"EditOccurrence"===this.parent.currentAction&&(t[this.fields.recurrenceID]?(s=t[this.fields.recurrenceID],l=null):(t[this.fields.id]=this.parent.eventBase.getEventMaxID(),t.Guid=this.parent.activeEventData.event.Guid),this.parent.enableRecurrenceValidation&&this.editOccurrenceValidation(s,t)))return!0;"EditSeries"===this.parent.currentAction||t[this.fields.id]!==o[this.fields.id]?t[this.fields.recurrenceID]=o[this.fields.id]:"EditFollowingEvents"===this.parent.currentAction&&(t[this.fields.id]=this.parent.eventBase.getEventMaxID(),t[this.fields.followingID]=o[this.fields.id])}r?this.resourceSaveEvent(t,"Save",l):this.parent.saveEvent(t,l)}return this.parent.uiStateValues.isBlock},i.prototype.getResourceData=function(t){var i=null;!(0,e.isNullOrUndefined)(this.parent.resourceBase)&&!(0,e.isNullOrUndefined)(this.parent.resourceBase.resourceCollection)&&this.parent.resourceBase.resourceCollection.length>0&&(i=t[this.parent.resourceBase.resourceCollection.slice(-1)[0].field]);return i},i.prototype.getObjectFromFormData=function(t){for(var i={},n=0,r=this.getFormElements(t);n<r.length;n++){var a=r[n],s=a.name||this.getColumnName(a);(0,e.isNullOrUndefined)(s)||""===s||(i[""+s]=this.getValueFromElement(a))}return i},i.prototype.setDefaultValueToObject=function(t){(0,e.isNullOrUndefined)(t[this.fields.subject])||(t[this.fields.subject]=t[this.fields.subject]||this.parent.eventSettings.fields.subject.default||this.l10n.getConstant("addTitle")),(0,e.isNullOrUndefined)(t[this.fields.location])||(t[this.fields.location]=t[this.fields.location]||this.parent.eventSettings.fields.location.default),(0,e.isNullOrUndefined)(t[this.fields.description])||(t[this.fields.description]=t[this.fields.description]||this.parent.eventSettings.fields.description.default)},i.prototype.recurrenceValidation=function(t,i,n){var r,a=this.recurrenceEditor,s=this.getInstance("e-repeat-interval.e-numerictextbox").value;if(n!==this.l10n.getConstant("ok")){var o=this.parent.activeEventData.event,l=[];if(("EditSeries"===this.parent.currentAction||"EditFollowingEvents"===this.parent.currentAction)&&!(0,e.isNullOrUndefined)(o)){var p=o[this.parent.eventFields.startTime],c=this.parent.eventBase.getSeriesEvents(this.eventData,p);if(c.length>0)l=this.parent.eventBase.getEditedOccurrences(c,p);else{var h=this.parent.eventBase.getEventById(o[this.parent.eventFields.id]);l=this.parent.eventBase.getEditedOccurrences([h],p)}"EditSeries"!==this.parent.currentAction||(0,e.isNullOrUndefined)(this.eventData[this.parent.eventFields.recurrenceException])||l.push(this.eventData)}if(l.length>0&&(r="seriesChangeAlert"),"until"===this.getInstance("e-end-on-left .e-ddl .e-dropdownlist").value&&this.getInstance("e-end-on-date .e-datepicker").value<t&&(r="wrongPattern"),(0,e.isNullOrUndefined)(r)){var d=a.value.split(";")[1].split("=")[1].split(","),u={SU:0,MO:1,TU:2,WE:3,TH:4,FR:5,SA:6},g=[],v=[],m=void 0;switch(a.value.split(";")[0].split("=")[1]){case"DAILY":(i.getTime()-t.getTime())/36e5>24*s&&(r="createError");break;case"WEEKLY":d=a.value.split(";")[1].split("=")[1].split(",");for(var f=0;f<d.length*(s+1);f++)g[parseInt(f.toString(),10)]=d.length>f?u[d[parseInt(f.toString(),10)]]:g[f-d.length]+7*s;m=g.sort((function(e,t){return e-t}));for(f=1;f<m.length;f++)v.push(m[parseInt(f.toString(),10)]-m[f-1]);((i.getTime()-t.getTime())/36e5>=24*Math.min.apply(Math,v)||(0,e.isNullOrUndefined)(s))&&(r="createError");break;case"MONTHLY":i.getTime()>=new Date(+t).setMonth(t.getMonth()+s)&&(r="createError");break;case"YEARLY":i.getTime()>=new Date(+t).setFullYear(t.getFullYear()+s)&&(r="createError")}}}else i.getTime()>=new Date(+t).setMonth(t.getMonth()+s)&&(r="createError"),(0,e.isNullOrUndefined)(r)&&this.parent.quickPopup.quickDialog.hide();return(0,e.isNullOrUndefined)(s)&&(r="createError"),r},i.prototype.getRecurrenceIndex=function(e,t){for(var i,n=0;n<e.length;n++)if(t[this.fields.startTime].valueOf()===e[parseInt(n.toString(),10)][this.fields.startTime].valueOf()){i=n;break}return i},i.prototype.trimAllDay=function(e){if(e[this.fields.isAllDay]){var t=ye(new Date(+e[this.fields.endTime]),-1).getTime();e[this.fields.endTime]=+e[this.fields.startTime]>t?e[this.fields.endTime]:new Date(t)}},i.prototype.editOccurrenceValidation=function(t,i,n){var r=this;void 0===n&&(n=this.eventData);var a=this.parent.getOccurrencesByID(t),s=this.parent.eventsData.filter((function(e){return e[r.fields.recurrenceID]===t}));s.map((function(t){return a.push((0,e.extend)({},t))})),i=(0,e.extend)({},i),this.trimAllDay(i);for(var o=0,l=a;o<l.length;o++){var p=l[o];this.trimAllDay(p)}this.parent.eventBase.sortByTime(a);var c=this.getRecurrenceIndex(a,n);if((0,e.isNullOrUndefined)(c))return!1;var h,d,u=new Date(+i[this.fields.startTime]),g=new Date(+i[this.fields.endTime]);c!==a.length-1&&(h=new Date(+a[c+1][this.fields.startTime]),d=new Date(+a[c+1][this.fields.endTime]));var v=new Date(+a[a.length-1][this.fields.endTime]);if(0===c){if(!(0,e.isNullOrUndefined)(a[c+1])){if(!(h.getTime()>=g.getTime())&&ve(v).getTime()>=ve(u).getTime()||ve(v).getTime()<ve(u).getTime())return this.parent.quickPopup.openRecurrenceValidationAlert("occurrenceAlert"),!0;if(!(ve(u).getTime()<ve(h).getTime()))return this.parent.quickPopup.openRecurrenceValidationAlert("sameDayAlert"),!0}return!1}var m=new Date(+a[c-1][this.fields.startTime]),f=new Date(+a[c-1][this.fields.endTime]);if(c===a.length-1){if(ve(new Date(+a[a.length-1-c][this.fields.startTime])).getTime()>ve(u).getTime())return this.parent.quickPopup.openRecurrenceValidationAlert("occurrenceAlert"),!0;if(!(f.getTime()<=u.getTime()&&ve(u).getTime()>ve(m).getTime()))return this.parent.quickPopup.openRecurrenceValidationAlert("sameDayAlert"),!0}else{if(!(ve(m).getTime()<ve(u).getTime()||ve(new Date(+a[0][this.fields.startTime])).getTime()>ve(u).getTime())||!(ve(h).getTime()>ve(u).getTime()||v.getTime()<u.getTime()))return this.parent.quickPopup.openRecurrenceValidationAlert("sameDayAlert"),!0;if(!(f.getTime()<=u.getTime()&&h.getTime()>=g.getTime())||ve(d).getTime()<ve(u).getTime()||ve(m).getTime()>ve(g).getTime()||!(ve(u).getTime()<ve(h).getTime()))return this.parent.quickPopup.openRecurrenceValidationAlert("occurrenceAlert"),!0}return!1},i.prototype.resourceSaveEvent=function(t,i,n){var r=this,a=this.parent.resourceBase.resourceCollection.slice(-1)[0],s=t[a.field];s=s instanceof Array?s.reverse():[s].reverse();for(var o=this.parent.resourceBase.lastResourceLevel,l=[],p=function(p){var h=(0,e.extend)({},t,null,!0);h[c.fields.id]=c.parent.eventBase.getEventMaxID();var d=[],u=function(){if("Save"===i&&p===s.length-1)if(d.length>0){d[0][r.fields.id]=t[r.fields.id];for(var e=1;e<d.length;e++)d[parseInt(e.toString(),10)][r.fields.id]=r.parent.eventBase.getEventMaxID(p),l.push(d[parseInt(e.toString(),10)]),r.parent.saveEvent(d[0],n)}else h[r.fields.id]=t[r.fields.id],r.parent.saveEvent(h,n);else if(d.length>0)for(var a=0;a<d.length;a++)d[parseInt(a.toString(),10)][r.fields.id]=r.parent.eventBase.getEventMaxID(a),l.push(d[parseInt(a.toString(),10)]);else h[r.fields.id]=r.parent.eventBase.getEventMaxID(p),l.push(h)};if(c.parent.activeViewOptions.group.byGroupID&&!(0,e.isNullOrUndefined)(o)){var g=a.dataSource,v=c.parent.resourceCollection,m=void 0;if((m=v.length>1?Ae(g,a.idField,s[parseInt(p.toString(),10)],h,v):Ae(g,a.idField,s[parseInt(p.toString(),10)]))<0)return{value:void 0};for(var f=g[parseInt(m.toString(),10)][a.groupIDField],y=o.filter((function(e){return e.resourceData[a.idField]===s[parseInt(p.toString(),10)]})).filter((function(e){return e.resourceData[a.groupIDField]===f}))[0].groupOrder,T=0;T<c.parent.resourceBase.resourceCollection.length;T++){var w=c.parent.resourceBase.resourceCollection[parseInt(T.toString(),10)].field;h[""+w]=y[parseInt(T.toString(),10)]instanceof Array?y[parseInt(T.toString(),10)][0]:y[parseInt(T.toString(),10)]}u()}else{for(m=0;m<c.parent.resourceBase.resourceCollection.length-1;m++){w=c.parent.resourceBase.resourceCollection[parseInt(m.toString(),10)].field;if(h[""+w]instanceof Array&&h[""+w].length>1)for(var D=0;D<h[""+w].length;D++){var b=(0,e.extend)({},h,null,!0);b[""+w]=t[""+w][parseInt(D.toString(),10)],b[a.field]=s[parseInt(p.toString(),10)],d.push(b)}else if(0===d.length)h[""+w]=t[""+w]instanceof Array?t[""+w][0]:t[""+w],h[a.field]=s[parseInt(p.toString(),10)];else for(var S=0;S<d.length;S++)d[parseInt(S.toString(),10)][""+w]=t[""+w]instanceof Array?t[""+w][0]:t[""+w]}h[a.field]=s[parseInt(p.toString(),10)],u()}},c=this,h=0;h<s.length;h++){var d=p(h);if("object"==typeof d)return d.value}if(l.length>0){for(var u=0,g=l;u<g.length;u++){var v=g[u];v[this.fields.recurrenceException]=null,v[this.fields.recurrenceID]=null}this.parent.addEvent(l)}},i.prototype.getEventIdFromForm=function(){return this.element.querySelector("."+wn).getAttribute("data-id")},i.prototype.getFormElements=function(e){return e===Tn?[].slice.call(this.element.querySelectorAll("."+no)):[].slice.call(this.parent.element.querySelectorAll("."+e+" ."+no))},i.prototype.getValueFromElement=function(t){return t.classList.contains("e-datepicker")||t.classList.contains("e-datetimepicker")||t.classList.contains("e-dropdownlist")||t.classList.contains("e-multiselect")?t.ej2_instances[0].value:t.classList.contains("e-checkbox")?t.ej2_instances[0].checked:t.classList.contains("e-numerictextbox")?t.ej2_instances[0].value:"checkbox"===t.type?t.checked:this.parent.enableHtmlSanitizer?e.SanitizeHtmlHelper.sanitize(t.value):t.value},i.prototype.setValueToElement=function(e,t){if(e.classList.contains("e-datepicker"))(i=e.ej2_instances[0]).value=t,i.dataBind();else if(e.classList.contains("e-datetimepicker")){(i=e.ej2_instances[0]).element.classList.contains(xn)?this.eventWindowTime.startTime=new Date(""+t):this.eventWindowTime.endTime=new Date(""+t),i.value=t,i.dataBind()}else if(e.classList.contains("e-dropdownlist")){(i=e.ej2_instances[0]).value=t,i.dataBind()}else if(e.classList.contains("e-multiselect")){(i=e.ej2_instances[0]).value=[],i.value=t instanceof Array?t:[t],i.dataBind()}else if(e.classList.contains("e-checkbox")){(i=e.ej2_instances[0]).checked=t,i.dataBind()}else if(e.classList.contains("e-numerictextbox")){var i;(i=e.ej2_instances[0]).value=t,i.dataBind()}else"checkbox"!==e.type?e.value=t||"":e.checked=t},i.prototype.setDefaultValueToElement=function(e){if(e.classList.contains("e-datepicker"))(t=e.ej2_instances[0]).value=this.parent.getCurrentTime(),t.dataBind();else if(e.classList.contains("e-datetimepicker")){var t=e.ej2_instances[0],i=this.parent.getCurrentTime();this.eventWindowTime={startTime:i,endTime:i},t.value=i,t.dataBind()}else if(e.classList.contains("e-dropdownlist")){(t=e.ej2_instances[0]).value=null,t.dataBind()}else if(e.classList.contains("e-multiselect")){(t=e.ej2_instances[0]).value=[],t.dataBind()}else if(e.classList.contains("e-checkbox")){(t=e.ej2_instances[0]).checked=!1,t.dataBind()}else if(e.classList.contains("e-numerictextbox")){(t=e.ej2_instances[0]).value=null,t.dataBind()}else"checkbox"===e.type?e.checked=!1:e.value=""},i.prototype.getInstance=function(e){var t=this.element.querySelector("."+e);return t?t.ej2_instances[0]:null},i.prototype.eventDelete=function(t){if(this.isEnterKey)this.isEnterKey=!1;else{switch(this.parent.currentAction){case"EditOccurrence":(0,e.isNullOrUndefined)(this.parent.activeEventData.event[this.parent.eventFields.recurrenceRule])?this.parent.currentAction="Delete":this.parent.currentAction="DeleteOccurrence";break;case"EditSeries":this.parent.currentAction="DeleteSeries";break;case"Save":this.parent.currentAction="Delete";break;case"EditFollowingEvents":(0,e.isNullOrUndefined)(this.parent.activeEventData.event[this.parent.eventFields.recurrenceRule])||(this.parent.currentAction="DeleteFollowingEvents")}this.dialogEvent=t,this.isCrudAction=!1,this.dialogObject.hide(),this.parent.quickPopup.openDeleteAlert()}},i.prototype.getRecurrenceEditorInstance=function(){return this.parent.isAdaptive&&!this.repeatDialogObject&&this.renderRepeatDialog(),this.recurrenceEditor},i.prototype.destroyComponents=function(){for(var e=0,t=this.getFormElements(Tn);e<t.length;e++){var i=t[e],n=void 0;(i.classList.contains("e-datetimepicker")||i.classList.contains("e-datepicker")||i.classList.contains("e-checkbox")||i.classList.contains("e-dropdownlist")||i.classList.contains("e-multiselect")||i.classList.contains("e-numerictextbox"))&&(n=i.ej2_instances),n&&n[0]&&n[0].destroy()}this.buttonObj&&this.buttonObj.destroy()},i.prototype.detachComponents=function(){for(var t=0,i=this.getFormElements(Tn);t<i.length;t++){var n=i[t];(0,e.detach)(n)}},i.prototype.destroy=function(t){if(this.parent&&!this.parent.isDestroyed&&this.parent.resetTemplates(["editorTemplate","editorHeaderTemplate","editorFooterTemplate"]),this.destroyComponents(),this.recurrenceEditor&&(this.recurrenceEditor.destroy(),(0,e.detach)(this.recurrenceEditor.element),this.recurrenceEditor=null),this.fieldValidator&&(this.fieldValidator.destroy(),this.fieldValidator=null),this.repeatDialogObject&&(this.repeatDialogObject.destroy(),this.repeatDialogObject=null),this.detachComponents(),this.dialogObject){if(this.dialogObject.element){var i=this.dialogObject.element.querySelector("form");Me(i),(0,e.detach)(i),e.EventHandler.remove(this.dialogObject.element,"keydown",this.preventEventSave)}this.dialogObject.destroy(),this.dialogObject=null}this.element&&((0,e.remove)(this.element),this.element=null),t||(this.l10n=null,this.parent=null,this.fields=null,this.buttonObj=null,this.repeatStatus=null,this.eventWindowTime=null,this.dialogEvent=null)},i}(),oo=function(){function t(e){this.translateY=0,this.itemSize=60,this.renderedLength=0,this.averageRowHeight=0,this.startIndex=0,this.existingDataCollection=[],this.enableTransition=!0,this.parent=e,this.bufferCount=e.activeViewOptions.overscanCount<3?3:e.activeViewOptions.overscanCount,this.addEventListener()}return t.prototype.addEventListener=function(){!this.parent||this.parent&&this.parent.isDestroyed||this.parent.on(X,this.virtualScrolling,this)},t.prototype.removeEventListener=function(){!this.parent||this.parent&&this.parent.isDestroyed||this.parent.off(X,this.virtualScrolling)},t.prototype.getRenderedCount=function(){this.setItemSize();var e=this.isHorizontalScroll?this.parent.element.clientWidth:this.parent.element.clientHeight;return this.renderedLength=Math.ceil(e/this.itemSize)+this.bufferCount,this.renderedLength},t.prototype.renderVirtualTrack=function(t){var i=(0,e.createElement)("div",{className:ai});if(this.isHorizontalScroll){var n=this.parent.activeView.colLevels[this.parent.activeView.colLevels.length-1].length;i.style.width=n*this.itemSize+"px"}else i.style.height=this.parent.resourceBase.expandedResources.length*this.itemSize+"px";t.appendChild(i)},t.prototype.updateVirtualScrollHeight=function(){var e=this.parent.element.querySelector("."+ai),t=this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length-1].groupIndex;if(this.parent.resourceBase.renderedResources[this.parent.resourceBase.renderedResources.length-1].groupIndex!==t){var i=this.parent.element.querySelector("."+Je);this.renderedLength=i.querySelector("tbody").children.length,e.style.height=i.offsetHeight+(this.parent.resourceBase.expandedResources.length-this.renderedLength)*i.offsetHeight/this.renderedLength+"px";var n=this.parent.element.querySelector("."+ri);n.scrollHeight-n.scrollTop<n.offsetHeight*this.bufferCount&&(e.style.height=parseInt(e.style.height,10)+n.offsetHeight*this.bufferCount+"px")}else e.style.height="";this.averageRowHeight=e.offsetHeight/this.parent.resourceBase.expandedResources.length},t.prototype.updateVirtualTrackHeight=function(e){var t=this.parent.resourceBase.renderedResources.length;if(t!==this.getRenderedCount()){e.style.height=this.parent.element.querySelector(".e-content-wrap").clientHeight+"px";var i=this.parent.element.querySelector("."+yt),n=this.parent.element.querySelector("."+ri),r=this.parent.element.querySelector("."+vt);this.translateY=0,this.setTranslate(i,n,r)}else{var a=this.parent.resourceBase.renderedResources[t-1].groupIndex,s=t+(this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length-1].groupIndex-a);s=s>this.parent.resourceBase.expandedResources.length?this.parent.resourceBase.expandedResources.length:s,e.style.height=s*this.itemSize+"px"}},t.prototype.setItemSize=function(){this.isHorizontalScroll?this.itemSize=ae(this.parent.activeView.element,$e,this.parent.uiStateValues.isTransformed)||this.itemSize:this.itemSize=this.parent.getElementHeightFromClass(this.parent.activeView.element,$e)||this.itemSize},t.prototype.refreshLayout=function(){var t=this.parent.uiStateValues.scheduleHeight;this.parent.uiStateValues.scheduleHeight=this.parent.element.offsetHeight;var i=this.renderedLength;if(this.parent.uiStateValues.scheduleHeight!==t){i<this.getRenderedCount()&&(this.isRemoteRefresh=!0);var n=this.parent.element.querySelector("."+yt),r=this.parent.element.querySelector("."+ri),a=this.parent.element.querySelector("."+vt);this.parent.rowAutoHeight||(this.enableTransition=!1,(0,e.removeClass)([r,n],"e-transition"));var s=parseInt(n.querySelector("tbody td").getAttribute("data-group-index"),10),o=s+this.renderedLength;s=(s=o>this.parent.resourceBase.expandedResources.length?this.parent.resourceBase.expandedResources.length-this.renderedLength:s)<0?0:s,this.existingDataCollection=this.parent.resourceBase.renderedResources,this.parent.resourceBase.renderedResources=this.parent.resourceBase.expandedResources.slice(s,o),this.parent.resourceBase.renderedResources.length>0&&this.updateContent(n,r,a,this.parent.resourceBase.renderedResources)}},t.prototype.renderEvents=function(){this.setTabIndex();var e=this.triggerScrollEvent(k);if(this.parent.activeViewOptions&&this.parent.activeViewOptions.enableLazyLoading&&this.parent.crudModule)return e.length>0?(this.parent.crudModule.refreshProcessedData(!0,e),void this.parent.hideSpinner()):void this.parent.crudModule.refreshDataManager();this.parent.crudModule&&this.parent.crudModule.refreshProcessedData(!0),"Month"!==this.parent.currentView&&this.parent.notify(_,{}),this.parent.hideSpinner()},t.prototype.virtualScrolling=function(){var t=this;this.parent.quickPopup&&(this.parent.quickPopup.quickPopupHide(),this.parent.quickPopup.morePopup.hide());var i=this.parent.element.querySelector("."+ri);if(this.isHorizontalScroll)this.horizontalScrolling(i);else{var n=this.parent.element.querySelector("."+yt),r=this.parent.element.querySelector("."+vt),a=this.parent.element.querySelector("."+Mt),s=this.parent.element.querySelector("."+Je);this.parent.rowAutoHeight||(0,e.addClass)([i,n],"e-transition"),this.renderedLength=n.querySelector("tbody").children.length;var o=parseInt(n.querySelector("tbody td").getAttribute("data-group-index"),10),l=this.parent.rowAutoHeight?s.offsetHeight-i.offsetHeight:this.bufferCount*this.itemSize,p=[];if(this.existingDataCollection=this.parent.resourceBase.renderedResources,i.scrollTop-this.translateY<0?p=this.upScroll(i,o):i.scrollTop-this.translateY>l&&(p=this.downScroll(i,o)),!(0,e.isNullOrUndefined)(p)&&p.length>0){this.triggerScrollEvent(M);var c=this.parent.getSelectedCells();this.focusedEle=c[c.length-1]||this.focusedEle,this.updateContent(n,i,r,p),this.setTranslate(n,i,r,a),this.parent.dragAndDropModule&&"drag"===this.parent.dragAndDropModule.actionObj.action&&this.parent.dragAndDropModule.navigationWrapper(),window.clearTimeout(this.timeValue),this.timeValue=window.setTimeout((function(){t.renderEvents()}),250)}}},t.prototype.horizontalScrolling=function(t){var i=this,n=[],r=this.bufferCount*this.itemSize;if(Math.abs(t.scrollLeft)-Math.abs(this.translateY)<0?n=this.leftScroll(t):Math.abs(t.scrollLeft)-Math.abs(this.translateY)>r&&(n=this.rightScroll(t)),!(0,e.isNullOrUndefined)(n)&&n.length>0){if(this.parent.resourceBase.expandedResources.length!==n.length||this.parent.resourceBase.expandedResources[0]!==n[0]||this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length-1]!==n[n.length-1]){this.triggerScrollEvent(M);var a=this.parent.activeView.colLevels.slice(0);this.updateHorizontalContent(t,n),(0,e.setStyleAttribute)(t.querySelector("table"),{transform:"translateX("+this.translateY+"px)"}),this.parent.activeView.colLevels=a,this.parent.dragAndDropModule&&"drag"===this.parent.dragAndDropModule.actionObj.action&&this.parent.dragAndDropModule.navigationWrapper()}window.clearTimeout(this.timeValue),this.timeValue=window.setTimeout((function(){i.renderEvents()}),250)}},t.prototype.triggerScrollEvent=function(t){var i=this,n=[];if(!this.parent.activeView)return n;var r={startDate:this.parent.activeView.startDate(),endDate:this.parent.activeView.endDate(),startIndex:this.parent.resourceBase.renderedResources[0].groupIndex,endIndex:this.parent.resourceBase.renderedResources[this.parent.resourceBase.renderedResources.length-1].groupIndex,resourceData:this.parent.resourceBase.renderedResources.map((function(e){return e.resourceData})),name:t};return this.parent.trigger(t,r,(function(r){t===M?i.parent.showSpinner():t===k&&!(0,e.isNullOrUndefined)(r.eventData)&&r.eventData.length>0&&(n=r.eventData)})),n},t.prototype.upScroll=function(e,t){var i=0;i=~~(e.scrollTop/this.itemSize)+Math.ceil(e.clientHeight/this.itemSize)-this.renderedLength,this.parent.rowAutoHeight&&(i=i>t?t-this.bufferCount:i),i=i>0?i:0;var n=this.getBufferCollection(i,i+this.renderedLength);if(this.parent.resourceBase.renderedResources=n,0===t)this.translateY=e.scrollTop;else{var r=this.parent.rowAutoHeight?this.averageRowHeight:this.itemSize;r=r>0?r:this.itemSize,this.translateY=e.scrollTop-this.bufferCount*r>0?e.scrollTop-this.bufferCount*r:0}return n},t.prototype.downScroll=function(e,t){if(this.parent.resourceBase.renderedResources[this.parent.resourceBase.renderedResources.length-1].groupIndex===this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length-1].groupIndex)return null;var i=0;i=~~(e.scrollTop/this.itemSize),this.parent.rowAutoHeight&&(i=(i=~~((e.scrollTop-this.translateY)/this.averageRowHeight)+t)>t+this.bufferCount?i:t+this.bufferCount);var n=i+this.renderedLength;n=n>this.parent.resourceBase.expandedResources.length?i+(this.parent.resourceBase.expandedResources.length-i):n;var r=this.getBufferCollection(n-this.renderedLength,n);return this.translateY=e.scrollTop,r},t.prototype.leftScroll=function(e){var t=0;return t=(t=~~(Math.abs(e.scrollLeft)/this.itemSize)+Math.ceil(e.clientWidth/this.itemSize)-this.renderedLength)>0?t:0,this.getCollection(t,t+this.renderedLength)},t.prototype.rightScroll=function(e){var t=this.parent.activeView.colLevels[this.parent.activeView.colLevels.length-1],i=~~(Math.abs(e.scrollLeft)/this.itemSize)+this.renderedLength;return i=i>t.length-1?t.length-1:i,this.getCollection(i-this.renderedLength,i)},t.prototype.getCollection=function(e,t){this.translateY=e*this.itemSize,e=e<0?0:e;var i=this.getResCollection(e,t);return this.parent.enableRtl&&(this.translateY=-this.translateY),i},t.prototype.getResCollection=function(e,t){var i=this.parent.activeView.colLevels[this.parent.activeView.colLevels.length-1];t=t>i.length?i.length-1:t;var n=[],r={startIndex:0,endIndex:0};if(this.parent.activeViewOptions.group.byDate){if(i[parseInt(e.toString(),10)].date.getTime()===this.parent.resourceBase.expandedResources[0].date.getTime()&&i[parseInt(t.toString(),10)].date.getTime()===this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length-1].date.getTime())return this.parent.resourceBase.expandedResources;n=this.getByDateCollection(i[parseInt(e.toString(),10)],i[parseInt(t.toString(),10)],r),this.setRenderedDates(n)}else{if(i[parseInt(e.toString(),10)].groupIndex===this.parent.resourceBase.expandedResources[0].groupIndex&&i[parseInt(t.toString(),10)].groupIndex===this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length-1].groupIndex)return this.parent.resourceBase.expandedResources;n=this.getByIdCollection(i[parseInt(e.toString(),10)],i[parseInt(t.toString(),10)],r)}return"Month"!==this.parent.currentView&&(this.startIndex=r.startIndex,n=i.slice(r.startIndex,r.endIndex)),this.translateY=r.startIndex*this.itemSize,n},t.prototype.getByDateCollection=function(e,t,i){var n=this.parent.activeView.colLevels[0].filter((function(i){return e.date.getTime()<=i.date.getTime()&&i.date.getTime()<=t.date.getTime()}));return this.setStartEndIndex(this.parent.activeView.colLevels[0],n[0],n[n.length-1],i),n},t.prototype.getByIdCollection=function(e,t,i){var n=this.parent.resourceBase.lastResourceLevel.filter((function(i){return e.groupIndex<=i.groupIndex&&i.groupIndex<=t.groupIndex}));return this.parent.resourceBase.renderedResources=n,this.setStartEndIndex(this.parent.resourceBase.lastResourceLevel,n[0],n[n.length-1],i),n},t.prototype.setStartEndIndex=function(e,t,i,n){var r=0;e.filter((function(e){t===e?n.startIndex=r:i===e&&(n.endIndex=r+e.colSpan),r+=e.colSpan})),t===i&&(n.endIndex=n.startIndex+i.colSpan)},t.prototype.updateContent=function(t,i,n,r){var a=t.querySelector("tbody").children.length;document.activeElement&&document.activeElement.classList.contains(Ot)&&(this.isResourceCell=!0,this.parent.element.focus());for(var s=0;s<a;s++)(0,e.remove)(n.querySelector("div"));this.parent.resourceBase.renderedResources=r;var o=this.parent.activeView.getGroupIndices(r),l=this.parent.activeView.getGroupIndices(this.existingDataCollection),p=o.filter((function(e){return l.indexOf(e)<0})),c=Array.from(t.querySelectorAll("tbody tr")),h=Array.from(i.querySelectorAll("tbody tr")),d=t.querySelector("tbody"),u=i.querySelector("tbody");this.removeObsoleteRows(c,o),this.removeObsoleteRows(h,o);var g=this.parent.resourceBase.getContentRows(r,!0),v=this.parent.activeView.getContentRows(),m=this.parent.activeView.getEventRows(r.length);for(s=0;s<p.length;s++){var f=o.indexOf(p[parseInt(s.toString(),10)]);0===f?((0,e.prepend)([g[parseInt(s.toString(),10)]],d),(0,e.prepend)([v[parseInt(s.toString(),10)]],u)):d&&u&&d.children[parseInt(f.toString(),10)]&&u.children[parseInt(f.toString(),10)]?(d.insertBefore(g[parseInt(s.toString(),10)],d.children[parseInt(f.toString(),10)]),u.insertBefore(v[parseInt(s.toString(),10)],u.children[parseInt(f.toString(),10)])):((0,e.append)([g[parseInt(s.toString(),10)]],d),(0,e.append)([v[parseInt(s.toString(),10)]],u))}(0,e.append)(m,n)},t.prototype.removeObsoleteRows=function(t,i){t.forEach((function(t){var n=parseInt(t.firstElementChild.getAttribute("data-group-index"),10);i.indexOf(n)<0&&(0,e.remove)(t)}))},t.prototype.updateHorizontalContent=function(e,t){this.existingDataCollection=this.parent.resourceBase.expandedResources,this.parent.resourceBase.expandedResources=t;var i=this.parent.getSelectedCells();this.focusedEle=i[i.length-1]||this.focusedEle;var n=e.querySelector("tbody"),r=Array.from(n.querySelectorAll("tr"));"Month"===this.parent.currentView?this.updateMonthViewContent(e,t):this.updateOtherViewContent(e,t,r)},t.prototype.updateMonthViewContent=function(t,i){for(var n=t.querySelectorAll(" tr").length,r=0;r<n;r++)(0,e.remove)(t.querySelector("tbody tr"));this.parent.activeViewOptions.group.byDate?this.parent.activeView.colLevels[0]=i:this.parent.activeView.colLevels[this.parent.activeView.colLevels.length-2]=i;var a=this.parent.activeView.getContentRows();(0,e.append)(a,t.querySelector("tbody"))},t.prototype.updateOtherViewContent=function(t,i,n){var r=t.querySelector("tbody"),a=t.querySelector("colgroup"),s=t.querySelector("thead"),o=t.querySelector("table");this.parent.activeView.colLevels[this.parent.activeView.colLevels.length-1]=i;var l=new Set(i.map((function(e){return e.groupIndex})));n.forEach((function(e){e.querySelectorAll("td").forEach((function(e){var t=parseInt(e.getAttribute("data-group-index"),10);l.has(t)||e.remove()}))}));for(var p=[].slice.call(t.querySelector("colgroup").children),c=0;c<p.length;c++)(0,e.remove)(p[parseInt(c.toString(),10)]);i.forEach((function(){return a.appendChild((0,e.createElement)("col"))}));var h=[].slice.call(t.querySelector("thead").children);for(c=0;c<h.length;c++)(0,e.remove)(h[parseInt(c.toString(),10)]);s.appendChild(this.parent.eventBase.createEventWrapper("",this.startIndex>0?this.startIndex:0)),this.parent.activeViewOptions.timeScale.enable&&s.appendChild(this.parent.eventBase.createEventWrapper("timeIndicator")),(0,e.prepend)([s],o);var d=this.parent.activeView.getContentRows();this.mergeNewTdData(r,d)},t.prototype.mergeNewTdData=function(e,t){Array.from(e.querySelectorAll("tr")).forEach((function(e,i){if(i<t.length){var n=t[parseInt(i.toString(),10)],r=Array.from(e.querySelectorAll("td"));Array.from(n.querySelectorAll("td")).forEach((function(t){for(var i=parseInt(t.getAttribute("data-group-index").toString(),10),n=!1,a=0,s=r;a<s.length;a++){var o=s[a];if(i<parseInt(o.getAttribute("data-group-index").toString(),10)){e.insertBefore(t,o),n=!0;break}}n||e.appendChild(t)}))}}))},t.prototype.getBufferCollection=function(e,t){return this.parent.resourceBase.expandedResources.slice(e,t)},t.prototype.setTranslate=function(t,i,n,r){(0,e.setStyleAttribute)(t.querySelector("table"),{transform:"translateY("+this.translateY+"px)"}),(0,e.setStyleAttribute)(i.querySelector("table"),{transform:"translateY("+this.translateY+"px)"}),(0,e.setStyleAttribute)(n,{transform:"translateY("+this.translateY+"px)"}),(0,e.isNullOrUndefined)(r)||(0,e.setStyleAttribute)(r,{transform:"translateY("+this.translateY+"px)"})},t.prototype.updateFocusedWorkCell=function(){if(this.focusedEle){var e=parseInt(this.focusedEle.getAttribute("data-date"),10),t=parseInt(this.focusedEle.getAttribute("data-group-index"),10),i=this.parent.element.querySelector("."+$e+'[data-date="'+e+'"][data-group-index="'+t+'"]');i&&this.parent.addSelectedClass([i],i,!0),this.focusedEle=null}},t.prototype.setRenderedDates=function(e){if("Month"!==this.parent.currentView){var t=e.map((function(e){return e.date}));this.parent.resourceBase.renderedResources.forEach((function(e){return e.renderDates=t}))}else{var i=e.map((function(e){return e.date.getDay()})),n=this.parent.activeView.renderDates.filter((function(e){return i.indexOf(e.getDay())>=0}));this.parent.resourceBase.renderedResources.forEach((function(e){return e.renderDates=n}))}},t.prototype.setTabIndex=function(){var e=this.parent.element.querySelector("."+yt),t=[].slice.call(this.parent.element.querySelectorAll("."+Ot));t&&e&&t.forEach((function(t){t.getBoundingClientRect().top>=e.getBoundingClientRect().top&&t.setAttribute("tabindex","0")}));var i=this.parent.element.querySelector("."+Ot+'[tabindex="0"]');this.isResourceCell&&i&&(i.focus(),this.isResourceCell=!1)},t.prototype.destroy=function(){this.removeEventListener(),this.focusedEle=null},t}(),lo=function(){function t(e){this.parent=e}return t.prototype.render=function(e,t){void 0===t&&(t=!0),this.initializeLayout(e),this.parent.activeView&&t&&this.parent.crudModule.refreshDataManager()},t.prototype.initializeLayout=function(t){if(this.parent.activeView){var i=["cellTemplate","tooltipTemplate","majorSlotTemplate","minorSlotTemplate","headerTooltipTemplate","dateHeaderTemplate","dayHeaderTemplate","monthHeaderTemplate","headerIndentTemplate","resourceHeaderTemplate","cellHeaderTemplate","dateRangeTemplate"];this.parent.activeEventTemplates.length>0?(i=i.concat(this.parent.activeEventTemplates),this.parent.activeEventTemplates=[]):i.push("eventTemplate"),this.parent.resetTemplates(i),this.parent.activeView.removeEventListener(),this.parent.activeView.destroy()}switch(t){case"Day":this.parent.activeView=this.parent.dayModule;break;case"Week":this.parent.activeView=this.parent.weekModule;break;case"WorkWeek":this.parent.activeView=this.parent.workWeekModule;break;case"Month":this.parent.activeView=this.parent.monthModule;break;case"Year":this.parent.activeView=this.parent.yearModule;break;case"Agenda":this.parent.activeView=this.parent.agendaModule;break;case"MonthAgenda":this.parent.activeView=this.parent.monthAgendaModule;break;case"TimelineDay":this.parent.activeView=this.parent.timelineViewsModule,(0,e.isNullOrUndefined)(this.parent.activeView)||(this.parent.activeView.viewClass="e-timeline-day-view");break;case"TimelineWorkWeek":this.parent.activeView=this.parent.timelineViewsModule,(0,e.isNullOrUndefined)(this.parent.activeView)||(this.parent.activeView.viewClass="e-timeline-work-week-view");break;case"TimelineWeek":this.parent.activeView=this.parent.timelineViewsModule,(0,e.isNullOrUndefined)(this.parent.activeView)||(this.parent.activeView.viewClass="e-timeline-week-view");break;case"TimelineMonth":this.parent.activeView=this.parent.timelineMonthModule;break;case"TimelineYear":this.parent.activeView=this.parent.timelineYearModule}if((0,e.isNullOrUndefined)(this.parent.activeView)){var n=this.parent.viewCollections[0].option;if(n)return this.parent.setProperties({currentView:n},!0),this.parent.headerModule&&(this.parent.headerModule.updateActiveView(),this.parent.headerModule.setCalendarView()),console.warn('[WARNING] :: Module "'+t+'" is not available in Schedule component! You either misspelled the module name or forgot to load it.'),this.initializeLayout(n);throw Error("Inject required modules")}this.parent.uiStateValues.scheduleHeight=this.parent.element.offsetHeight,this.parent.activeView.viewIndex=this.parent.viewIndex,this.updateLabelText(t),this.parent.activeView.addEventListener(),this.parent.activeView.getRenderDates(),this.parent.uiStateValues.isGroupAdaptive=this.parent.activeViewOptions.group.resources.length>0&&(this.parent.enableAdaptiveUI&&!this.parent.isAdaptive||this.parent.isAdaptive&&this.parent.activeViewOptions.group.enableCompactView),this.parent.virtualScrollModule&&(this.parent.virtualScrollModule.destroy(),this.parent.virtualScrollModule=null),(-1===["Agenda","MonthAgenda","Year","TimelineYear"].indexOf(this.parent.currentView)||"TimelineYear"===this.parent.currentView&&"Vertical"===this.parent.activeViewOptions.orientation)&&this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&(this.parent.virtualScrollModule=new oo(this.parent),this.parent.activeView.isTimelineView()?this.parent.uiStateValues.top=0:(this.parent.virtualScrollModule.isHorizontalScroll=!0,this.parent.uiStateValues.left=0)),this.updateHeader(),this.parent.currentTimezoneDate=this.parent.getCurrentTime(),this.parent.activeView.renderLayout(pt),this.parent.renderTemplates(),this.parent.eventTooltip&&(this.parent.eventTooltip.destroy(),this.parent.eventTooltip=null),(this.parent.eventSettings.enableTooltip||this.parent.activeViewOptions.group.resources.length>0&&this.parent.activeViewOptions.group.headerTooltipTemplate)&&(this.parent.eventTooltip=new Ua(this.parent))},t.prototype.updateHeader=function(){this.parent.headerModule&&(this.parent.headerModule.setDayOfWeek(this.parent.activeViewOptions.firstDayOfWeek),this.parent.activeViewOptions.readonly?(0,e.addClass)([this.parent.element],cr):this.parent.element.classList.contains(cr)&&(0,e.removeClass)([this.parent.element],cr),this.parent.headerModule.updateDateRange(),this.parent.headerModule.updateHeaderItems("remove"))},t.prototype.updateLabelText=function(e){this.parent.element.setAttribute("role","application"),this.parent.element.removeAttribute("aria-labelledby"),this.parent.element.removeAttribute("aria-label"),"Year"===e?this.parent.element.setAttribute("aria-label",this.parent.activeView.getLabelText(e)):this.parent.element.setAttribute("aria-labelledby",this.parent.element.id+"_table")},t}(),po=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),co=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},ho=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return po(i,t),co([(0,e.Property)(!0)],i.prototype,"highlight",void 0),co([(0,e.Property)("09:00")],i.prototype,"start",void 0),co([(0,e.Property)("18:00")],i.prototype,"end",void 0),i}(e.ChildProperty),uo=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),go=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},vo=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return uo(i,t),go([(0,e.Property)(!0)],i.prototype,"enable",void 0),go([(0,e.Property)(60)],i.prototype,"interval",void 0),go([(0,e.Property)(2)],i.prototype,"slotCount",void 0),go([(0,e.Property)()],i.prototype,"minorSlotTemplate",void 0),go([(0,e.Property)()],i.prototype,"majorSlotTemplate",void 0),i}(e.ChildProperty),mo=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),fo=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},yo=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return mo(i,t),fo([(0,e.Property)("Both")],i.prototype,"templateType",void 0),fo([(0,e.Property)()],i.prototype,"header",void 0),fo([(0,e.Property)()],i.prototype,"content",void 0),fo([(0,e.Property)()],i.prototype,"footer",void 0),i}(e.ChildProperty),To=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),wo=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},Do=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return To(i,t),wo([(0,e.Property)()],i.prototype,"option",void 0),wo([(0,e.Property)()],i.prototype,"template",void 0),i}(e.ChildProperty),bo=function(){function t(e){this.parent=e,this.crudObj={sourceEvent:null,targetEvent:null,isCrudAction:!1}}return t.prototype.getQuery=function(){var e=this.parent.activeView.startDate(),t=this.parent.activeView.endDate();return this.parent.dataModule.generateQuery(e,t)},t.prototype.getTable=function(){return this.parent.eventSettings.query?this.parent.eventSettings.query.clone().fromTable:null},t.prototype.refreshDataManager=function(){var e=this;if(this.parent.activeView){if(this.parent.uiStateValues&&this.parent.uiStateValues.isPreventEventRefresh)return this.parent.uiStateValues.isPreventEventRefresh=!1,this.parent.refreshEvents(!1),void this.parent.hideSpinner();var t=this.parent.activeView.startDate(),i=this.parent.activeView.endDate();this.parent.dataModule.getData(this.parent.dataModule.generateQuery(t,i)).then((function(t){return e.dataManagerSuccess(t)})).catch((function(t){return e.dataManagerFailure(t)}))}},t.prototype.dataManagerSuccess=function(t){var i=this;!this.parent||this.parent&&this.parent.isDestroyed||this.parent.trigger(T,t,(function(t){if(!t.cancel){var n=(0,e.extend)([],t.result,null,!0);i.parent.eventsData=n.filter((function(e){return!e[i.parent.eventFields.isBlock]})),i.parent.blockData=n.filter((function(e){return e[i.parent.eventFields.isBlock]})),i.refreshProcessedData(),i.parent.dragAndDropModule&&"drag"===i.parent.dragAndDropModule.actionObj.action&&i.parent.dragAndDropModule.navigationWrapper(),i.parent.trigger(w,null,(function(){i.parent.hideSpinner(),i.parent.isPrinting&&setTimeout((function(){i.parent.notify(W,{})}),100)}))}}))},t.prototype.dataManagerFailure=function(e){var t=this;!this.parent||this.parent&&this.parent.isDestroyed||this.parent.trigger(h,{error:e},(function(){return t.parent.hideSpinner()}))},t.prototype.refreshProcessedData=function(t,i){if(void 0===t&&(t=!1),this.parent.dragAndDropModule&&(this.parent.dragAndDropModule.actionObj.action="",(0,e.removeClass)([this.parent.element],"e-event-action")),this.parent.activeViewOptions&&this.parent.activeViewOptions.eventTemplate){var n=["eventTemplate"];if(this.crudObj.isCrudAction&&-1===["Agenda","MonthAgenda","Year","TimelineYear"].indexOf(this.parent.currentView)){n=[];for(var r=0,a=this.crudObj.sourceEvent.length;r<a;r++)n.push("eventTemplate_"+this.crudObj.sourceEvent[parseInt(r.toString(),10)].groupIndex),this.crudObj.targetEvent[parseInt(r.toString(),10)]&&this.crudObj.sourceEvent[parseInt(r.toString(),10)].groupIndex!==this.crudObj.targetEvent[parseInt(r.toString(),10)].groupIndex&&n.push("eventTemplate_"+this.crudObj.targetEvent[parseInt(r.toString(),10)].groupIndex)}n.length>0&&this.parent.resetTemplates(n)}if(t)this.parent.notify(z,{processedData:i?this.parent.eventBase.processData(i):this.parent.eventsProcessed});else{var s=this.parent.eventsData||[],o=this.parent.blockData||[],l=s.concat(o);this.parent.notify(z,{processedData:this.parent.eventBase?this.parent.eventBase.processData(l):[]})}},t.prototype.refreshData=function(t){var i=this,n={requestType:t.requestType,cancel:!1,data:t.data,addedRecords:t.editParams.addedRecords,changedRecords:t.editParams.changedRecords,deletedRecords:t.editParams.deletedRecords};if(this.parent.dragAndDropModule&&this.parent.dragAndDropModule.actionObj&&this.parent.dragAndDropModule.actionObj.element&&this.parent.dragAndDropModule.actionObj.action&&(this.parent.dragAndDropModule.actionObj.element.style.display="none"),this.parent.resizeModule&&this.parent.resizeModule.actionObj&&this.parent.resizeModule.actionObj.element&&this.parent.resizeModule.actionObj.action&&(this.parent.resizeModule.actionObj.element.style.display="none"),this.parent.isSpecificResourceEvents()&&("eventCreated"===t.requestType||"eventRemoved"===t.requestType)){this.crudObj.isCrudAction=!0,this.crudObj.sourceEvent=[];for(var r=t.data instanceof Array?0===t.data.length&&"eventRemoved"===t.requestType?t.editParams.deletedRecords:t.data:"string"!=typeof t.data&&"number"!=typeof t.data||"eventRemoved"!==t.requestType?[t.data]:t.editParams.deletedRecords,a=function(i){s.crudObj.isCrudAction=!("eventRemoved"===t.requestType&&!(0,e.isNullOrUndefined)(i.parent));var n=s.parent.eventBase.getGroupIndexFromEvent(i);n>-1&&0===s.parent.crudModule.crudObj.sourceEvent.filter((function(e){return e.groupIndex===n})).length&&s.crudObj.isCrudAction&&s.crudObj.sourceEvent.push(s.parent.resourceBase.lastResourceLevel[parseInt(n.toString(),10)])},s=this,o=0,l=r;o<l.length;o++){a(l[o])}this.crudObj.targetEvent=this.crudObj.sourceEvent}this.parent.dataModule.dataManager.dataSource.offline?this.parent.trigger(c,n,(function(e){e.cancel||i.refreshDataManager()})):t.promise.then((function(){!i.parent||i.parent&&i.parent.isDestroyed||i.parent.trigger(c,n,(function(e){e.cancel||i.refreshDataManager()}))})).catch((function(e){!i.parent||i.parent&&i.parent.isDestroyed||i.parent.trigger(h,{error:e})}))},t.prototype.processAddEvent=function(t){var i,n=this.parent.eventFields,r={addedRecords:[],changedRecords:[],deletedRecords:[]};if(t.addedRecords instanceof Array){for(var a=0,s=t.addedRecords;a<s.length;a++){var o=s[a];o=this.parent.eventBase.updateEventDateTime(o);var l=(0,e.extend)({},this.parent.eventBase.processTimezone(o,!0),null,!0);r.addedRecords.push(l)}i=this.parent.dataModule.dataManager.saveChanges(r,n.id,this.getTable(),this.getQuery())}else{var p=this.parent.eventBase.processTimezone(t.addedRecords,!0);r.addedRecords.push(p),i=this.parent.dataModule.dataManager.insert(p,this.getTable(),this.getQuery())}var c={requestType:"eventCreated",cancel:!1,data:t.addedRecords,promise:i,editParams:r};this.refreshData(c)},t.prototype.processSaveEvent=function(t){var i,n=this.parent.eventFields,r={addedRecords:[],changedRecords:[],deletedRecords:[]};if(t.changedRecords instanceof Array){for(var a=0,s=t.changedRecords;a<s.length;a++){var o=s[a];o=this.parent.eventBase.updateEventDateTime(o);var l=(0,e.extend)({},this.parent.eventBase.processTimezone(o,!0),null,!0);r.changedRecords.push(l)}i=this.parent.dataModule.dataManager.saveChanges(r,n.id,this.getTable(),this.getQuery())}else{var p=this.parent.eventBase.processTimezone(t.changedRecords,!0);r.changedRecords.push(p),i=this.parent.dataModule.dataManager.update(n.id,p,this.getTable(),this.getQuery())}var c=(0,e.extend)({},t.changedRecords[t.changedRecords.length-1],null,!0);this.parent.eventBase.selectWorkCellByTime([this.parent.eventBase.processTimezone(c)]);var h={requestType:"eventChanged",cancel:!1,data:t.changedRecords,promise:i,editParams:r};this.refreshData(h)},t.prototype.processDeleteEvent=function(e){var t,i=this.parent.eventFields,n={addedRecords:[],changedRecords:[],deletedRecords:[]};e.deletedRecords.length>1?(n.deletedRecords=n.deletedRecords.concat(e.deletedRecords),t=this.parent.dataModule.dataManager.saveChanges(n,i.id,this.getTable(),this.getQuery())):(n.deletedRecords.push(e.deletedRecords[0]),t=this.parent.dataModule.dataManager.remove(i.id,e.deletedRecords[0],this.getTable(),this.getQuery())),this.parent.eventBase.selectWorkCellByTime(e.deletedRecords);var r={requestType:"eventRemoved",cancel:!1,data:e.deletedRecords,promise:t,editParams:n};this.refreshData(r)},t.prototype.addEvent=function(e){var t=this;if(this.parent.eventSettings.allowAdding&&!this.parent.activeViewOptions.readonly){if(!this.isBlockEvent(e)&&this.parent.eventBase.isBlockRange(e))return void this.parent.quickPopup.openValidationError("blockAlert",e);if(this.parent.eventBase.checkOverlap(e))return;var i=e instanceof Array?e:[e];if(0===i.length)return;var n={requestType:"eventCreate",cancel:!1,data:i,addedRecords:i,changedRecords:[],deletedRecords:[]};this.parent.trigger(p,n,(function(e){e.cancel||(e.promise?e.promise.then((function(i){!t.parent||t.parent&&t.parent.isDestroyed||i&&t.processAddEvent(e)})).catch((function(e){!t.parent||t.parent&&t.parent.isDestroyed||t.parent.trigger(h,{error:e})})):t.processAddEvent(e))}))}},t.prototype.saveEvent=function(e,t){var i=this;if(this.parent.eventSettings.allowEditing&&!this.parent.activeViewOptions.readonly){if("EditFollowingEvents"!==this.parent.currentAction&&!this.isBlockEvent(e)&&this.parent.eventBase.isBlockRange(e))return this.parent.quickPopup.openValidationError("blockAlert",e),void(this.parent.crudModule.crudObj.isCrudAction=!1);var n=e instanceof Array?e:[e];if(0===n.length)return;if(this.parent.currentAction=t,t)switch(t){case"Save":this.processSave(e);break;case"EditOccurrence":this.processOccurrences(e,t);break;case"EditFollowingEvents":this.processFollowSeries(e,t);break;case"EditSeries":this.processEntireSeries(e,t)}else{if(this.parent.eventBase.checkOverlap(e))return;var r={requestType:"eventChange",cancel:!1,data:e,addedRecords:[],changedRecords:n,deletedRecords:[]};this.parent.trigger(p,r,(function(e){e.cancel||(e.promise?e.promise.then((function(t){!i.parent||i.parent&&i.parent.isDestroyed||t&&i.processSaveEvent(e)})).catch((function(e){!i.parent||i.parent&&i.parent.isDestroyed||i.parent.trigger(h,{error:e})})):i.processSaveEvent(e))}))}}},t.prototype.deleteEvent=function(e,t){var i=this;if(this.parent.eventSettings.allowDeleting&&!this.parent.activeViewOptions.readonly){this.parent.currentAction=t;var n=[];if(0===(n="string"==typeof e||"number"==typeof e?this.parent.eventsData.filter((function(t){return t[i.parent.eventFields.id]===e})):e instanceof Array?e:[e]).length)return;if(t)switch(t){case"Delete":this.processDelete(n);break;case"DeleteOccurrence":this.processOccurrences(n,t);break;case"DeleteFollowingEvents":this.processFollowSeries(n,t);break;case"DeleteSeries":this.processEntireSeries(n,t)}else{var r={requestType:"eventRemove",cancel:!1,data:e,addedRecords:[],changedRecords:[],deletedRecords:n};this.parent.trigger(p,r,(function(e){e.cancel||(e.promise?e.promise.then((function(t){!i.parent||i.parent&&i.parent.isDestroyed||t&&i.processDeleteEvent(e)})).catch((function(e){!i.parent||i.parent&&i.parent.isDestroyed||i.parent.trigger(h,{error:e})})):i.processDeleteEvent(e))}))}}},t.prototype.processOccurrences=function(t,i){var n=this,r=[],a=!1;if(t instanceof Array)for(var s=0,o=t;s<o.length;s++){var l=o[s];r.push({occurrence:l,parent:this.getParentEvent(l)})}else r={occurrence:t,parent:this.getParentEvent(t)};var c={requestType:"EditOccurrence"===i?"eventChange":"eventRemove",cancel:!1,addedRecords:[],changedRecords:t instanceof Array?t:[t],deletedRecords:[]};c.data=r,this.parent.trigger(p,c,(function(t){if(!t.cancel){for(var s=n.parent.eventFields,o={addedRecords:[],changedRecords:[],deletedRecords:[]},l=r instanceof Array?r:[r],p=function(e,r){var p=t.changedRecords[parseInt(e.toString(),10)],c=l[parseInt(e.toString(),10)].parent,h=c[s.recurrenceException],d=void 0,u=void 0;switch(i){case"EditOccurrence":d=n.parent.eventsProcessed.filter((function(e){return e.Guid===p.Guid}))[0],(u=n.excludeDateCheck(d[s.startTime],h))!==c[s.recurrenceException]?(c[s.recurrenceException]=u,p[s.recurrenceException]=Ea(d[s.startTime]),p[s.recurrenceID]=c[s.id],p[s.followingID]=null,o.changedRecords.push(n.parent.eventBase.processTimezone(c,!0)),o.addedRecords.push(n.parent.eventBase.processTimezone(p,!0))):o.changedRecords.push(n.parent.eventBase.processTimezone(p,!0));break;case"DeleteOccurrence":p[s.recurrenceException]||(c[s.recurrenceException]=n.excludeDateCheck(p[s.startTime],h),o.changedRecords.push(n.parent.eventBase.processTimezone(c,!0))),p[s.id]!==c[s.id]&&(o.deletedRecords.push(n.parent.eventBase.processTimezone(p,!0)),a=!0)}},c=0,h=t.changedRecords.length;c<h;c++)p(c);var d=n.parent.dataModule.dataManager.saveChanges(o,s.id,n.getTable(),n.getQuery()),u=(0,e.extend)({},t.changedRecords[t.changedRecords.length-1],null,!0);n.parent.eventBase.selectWorkCellByTime("EditOccurrence"===i?[n.parent.eventBase.processTimezone(u)]:[u]);var g={requestType:"EditOccurrence"===i?"eventChanged":"eventRemoved",cancel:!1,data:a?t.deletedRecords:t.changedRecords,promise:d,editParams:o};n.refreshData(g)}}))},t.prototype.processFollowSeries=function(t,i){var n=this,r=[];if(t instanceof Array)for(var a=0,s=t;a<s.length;a++){var o=s[a];r.push({occurrence:o,parent:this.getParentEvent(o)})}else r={occurrence:t,parent:this.getParentEvent(t)};var l={requestType:"EditFollowingEvents"===i?"eventChange":"eventRemove",cancel:!1,addedRecords:[],changedRecords:t instanceof Array?t:[t],deletedRecords:[]};l.data=r,this.parent.trigger(p,l,(function(t){if(!t.cancel){for(var a=n.parent.eventFields,s={addedRecords:[],changedRecords:[],deletedRecords:[]},o=r instanceof Array?r:[r],l=function(e,r){var l=t.changedRecords[parseInt(e.toString(),10)],p=o[parseInt(e.toString(),10)].parent,c=n.parent.eventBase.getEventCollections(p,l),h=void 0;switch(i){case"EditFollowingEvents":if(n.processRecurrenceRule(p,l),h=!n.parent.eventBase.isFollowingEvent(p,l),l[a.followingID]=h?null:p[a.id],l[a.recurrenceID]=null,s.addedRecords.push(n.parent.eventBase.processTimezone(l,!0)),s.changedRecords.push(n.parent.eventBase.processTimezone(p,!0)),!n.parent.uiStateValues.isIgnoreOccurrence){if(l[a.recurrenceException]=null,c.occurrence.length>0){var d=c.occurrence.slice(-1)[0][a.recurrenceRule];-1===d.indexOf("COUNT")&&(l[a.recurrenceRule]=d)}c.follow.length>0&&(l[a.recurrenceRule]=c.follow.slice(-1)[0][a.recurrenceRule],s.deletedRecords=s.deletedRecords.concat(c.follow)),h&&(c.occurrence=c.occurrence.filter((function(e){return e[a.recurrenceID]===p[a.id]}))),s.deletedRecords=s.deletedRecords.concat(c.occurrence)}break;case"DeleteFollowingEvents":n.processRecurrenceRule(p,l[a.startTime]),s.changedRecords.push(n.parent.eventBase.processTimezone(p,!0)),s.deletedRecords=s.deletedRecords.concat(c.occurrence).concat(c.follow)}},p=0,c=t.changedRecords.length;p<c;p++)l(p);var h=n.parent.dataModule.dataManager.saveChanges(s,a.id,n.getTable(),n.getQuery()),d=(0,e.extend)({},t.changedRecords[t.changedRecords.length-1],null,!0);n.parent.eventBase.selectWorkCellByTime("EditFollowingEvents"===i?[n.parent.eventBase.processTimezone(d)]:[d]);var u={requestType:"EditFollowingEvents"===i?"eventChanged":"eventRemoved",cancel:!1,data:t.changedRecords,promise:h,editParams:s};n.refreshData(u)}}))},t.prototype.processEntireSeries=function(t,i){var n=this,r=[],a=!1;if(t instanceof Array)for(var s=0,o=t;s<o.length;s++){var l=o[s];r.push(this.getParentEvent(l,!0))}else r=this.getParentEvent(t,!0);var c=t instanceof Array?t:[t],h={requestType:"EditSeries"===i?"eventChange":"eventRemove",cancel:!1,addedRecords:[],changedRecords:[],deletedRecords:[]};if(h.data=r,"EditSeries"===i?h.changedRecords=c:h.deletedRecords=c,"EditSeries"===i&&!this.parent.uiStateValues.isIgnoreOccurrence)for(var d=r instanceof Array?r:[r],u=0,g=h.changedRecords.length;u<g;u++){var v=d[parseInt(u.toString(),10)],m=this.parent.eventBase.getEventCollections(v),f=m.follow.concat(m.occurrence);h.deletedRecords=h.deletedRecords.concat(f)}this.parent.trigger(p,h,(function(t){if(!t.cancel){for(var s=n.parent.eventFields,o={addedRecords:[],changedRecords:[],deletedRecords:[]},l=r instanceof Array?r:[r],p="EditSeries"===i?t.changedRecords:t.deletedRecords,c=function(e,t){var r=p[parseInt(e.toString(),10)],c=l[parseInt(e.toString(),10)],h=n.parent.eventBase.getEventCollections(c),d=h.follow.concat(h.occurrence);switch(i){case"EditSeries":if(r[s.id]=c[s.id],r[s.recurrenceID]=null,r[s.followingID]=null,n.parent.uiStateValues.isIgnoreOccurrence&&r[s.recurrenceException]){var u=n.parent.eventsData.filter((function(e){return e[s.id]===r[s.id]}));u.length>0&&(r[s.recurrenceRule]=u[0][s.recurrenceRule])}else r[s.recurrenceException]=null,o.deletedRecords=o.deletedRecords.concat(d);o.changedRecords.push(n.parent.eventBase.processTimezone(r,!0)),n.parent.uiStateValues.isIgnoreOccurrence=!1;break;case"DeleteSeries":o.deletedRecords=o.deletedRecords.concat(d.concat(n.parent.eventBase.processTimezone(c,!0))),a=!0}},h=0,d=p.length;h<d;h++)c(h);var u=n.parent.dataModule.dataManager.saveChanges(o,s.id,n.getTable(),n.getQuery()),g=(0,e.extend)({},p[p.length-1],null,!0);n.parent.eventBase.selectWorkCellByTime("EditSeries"===i?[n.parent.eventBase.processTimezone(g)]:[g]);var v={requestType:"EditSeries"===i?"eventChanged":"eventRemoved",cancel:!1,data:a?t.deletedRecords:t.changedRecords,promise:u,editParams:o};n.refreshData(v)}}))},t.prototype.processDelete=function(t){for(var i=this,n=[],r=0,a=t;r<a.length;r++){var s=a[r];s[this.parent.eventFields.recurrenceRule]?n.push({occurrence:s,parent:this.getParentEvent(s)}):n.push(s)}var o={requestType:"eventRemove",cancel:!1,addedRecords:[],changedRecords:[],deletedRecords:t};o.data=n,this.parent.trigger(p,o,(function(t){if(!t.cancel){for(var r=i.parent.eventFields,a={addedRecords:[],changedRecords:[],deletedRecords:[]},s=function(s,o){var l=(0,e.isNullOrUndefined)(t.deletedRecords[parseInt(s.toString(),10)][i.parent.eventFields.recurrenceRule]);if(!l){var p=n[parseInt(s.toString(),10)].parent,c=a.changedRecords.filter((function(e){return e[r.id]===p[r.id]})),h=t.deletedRecords[parseInt(s.toString(),10)][r.startTime];if(c.length>0){var d=c[0];d[r.recurrenceException]=i.excludeDateCheck(h,d[r.recurrenceException])}else p[r.recurrenceException]=i.excludeDateCheck(h,p[r.recurrenceException]);0===c.length&&a.changedRecords.push(i.parent.eventBase.processTimezone(p,!0)),l=t.deletedRecords[parseInt(s.toString(),10)][r.id]!==p[r.id]}if(l){if(t.deletedRecords instanceof Array)for(var u=0,g=t.deletedRecords;u<g.length;u++){var v=g[u];i.parent.eventBase.processTimezone(v,!0)}a.deletedRecords.push(t.deletedRecords[parseInt(s.toString(),10)])}},o=0,l=t.deletedRecords.length;o<l;o++)s(o);var p=i.parent.dataModule.dataManager.saveChanges(a,r.id,i.getTable(),i.getQuery()),c=(0,e.extend)({},t.deletedRecords[t.deletedRecords.length-1],null,!0);i.parent.eventBase.selectWorkCellByTime([i.parent.eventBase.processTimezone(c)]);var h={requestType:"eventRemoved",cancel:!1,data:t.deletedRecords,promise:p,editParams:a};i.refreshData(h)}}))},t.prototype.processSave=function(t){for(var i=this,n=t instanceof Array?t:[t],r=[],a=0,s=n;a<s.length;a++){var o=s[a];o[this.parent.eventFields.recurrenceRule]?r.push({occurrence:o,parent:this.getParentEvent(o)}):r.push(o)}var l={requestType:"eventChange",cancel:!1,addedRecords:[],changedRecords:n,deletedRecords:[]};l.data=r,this.parent.trigger(p,l,(function(t){if(!t.cancel){for(var n=i.parent.eventFields,r={addedRecords:[],changedRecords:[],deletedRecords:[]},a=0,s=t.changedRecords;a<s.length;a++){var o=s[a];if(!(0,e.isNullOrUndefined)(o[n.recurrenceRule])&&(0,e.isNullOrUndefined)(o[n.recurrenceException])){var l=Ea(o[n.startTime]),p=i.getParentEvent(o);p[n.recurrenceException]=(0,e.isNullOrUndefined)(p[n.recurrenceException])?l:p[n.recurrenceException].concat(","+l),o[n.id]=i.parent.getEventMaxID(),o[n.recurrenceException]=l,r.addedRecords.push(i.parent.eventBase.processTimezone(o,!0)),r.changedRecords.push(i.parent.eventBase.processTimezone(p,!0))}else r.changedRecords.push(i.parent.eventBase.processTimezone(o,!0))}var c=i.parent.dataModule.dataManager.saveChanges(r,n.id,i.getTable(),i.getQuery()),h=(0,e.extend)({},t.changedRecords[t.changedRecords.length-1],null,!0);i.parent.eventBase.selectWorkCellByTime([i.parent.eventBase.processTimezone(h)]);var d={requestType:"eventChanged",cancel:!1,data:t.changedRecords,promise:c,editParams:r};i.refreshData(d)}}))},t.prototype.getParentEvent=function(e,t){void 0===t&&(t=!1);var i=this.parent.eventBase.getParentEvent(e,t)||e;return(i[this.parent.eventFields.startTimezone]||i[this.parent.eventFields.endTimezone])&&this.parent.eventBase.timezoneConvert(i),i},t.prototype.excludeDateCheck=function(t,i){var n=this.parent.timezone||this.parent.tzModule.getLocalTimezoneName();n&&(t=this.parent.tzModule.remove(new Date(+t.getTime()),n));var r=Ea(t);return(0,e.isNullOrUndefined)(i)?i=r:-1===i.indexOf(r)&&(i=(0,e.isNullOrUndefined)(i)?r:i+","+r),i},t.prototype.processRecurrenceRule=function(e,t){var i,n=this.parent.eventFields,r=e[n.recurrenceRule];if(t instanceof Date)i=new Date(+t);else{i=new Date(+t[n.startTime]);var a=t[n.recurrenceRule];if(a){var s=e[n.startTime],o=Mr(s,a,"DeleteFollowingEvents"===this.parent.currentAction?t[n.recurrenceException]:null,this.parent.activeViewOptions.firstDayOfWeek),l=new Date(o.slice(-1)[0]);l.setHours(i.getHours(),i.getMinutes(),i.getSeconds()),i.setHours(s.getHours(),s.getMinutes(),s.getSeconds()),t[n.recurrenceRule]=this.getUpdatedRecurrenceRule(a,new Date(+l),!1)}}e[n.recurrenceRule]=this.getUpdatedRecurrenceRule(r,ye(new Date(i.getTime()),-1),!0)},t.prototype.getUpdatedRecurrenceRule=function(e,t,i){for(var n="",r=0,a=e.split(";");r<a.length;r++){var s=a[r];if(""!==s){var o=s.split("=")[0],l=s.split("=")[1];"COUNT"!==o&&"UNTIL"!==o||(l=Ea(t),s=s.replace(s,"UNTIL="+l)),n+=s+";"}}return i&&-1===n.indexOf("UNTIL")&&(n+="UNTIL="+Ea(t)),n},t.prototype.isBlockEvent=function(e){for(var t=!1,i=0,n=e instanceof Array?e:[e];i<n.length;i++){t=n[i][this.parent.eventFields.isBlock]||!1}return t},t.prototype.destroy=function(){this.crudObj=null,this.parent=null},t}(),So=function(){function t(t){this.parent=t,e.EventHandler.add(this.parent.element,"mouseover",this.onHover,this)}return t.prototype.cellMouseDown=function(e){this.isPreventAction(e)||this.parent.notify($,{event:e})},t.prototype.cellClick=function(t){var i=this;if(!this.isPreventAction(t)){var n="."+$e+",."+Ke+",."+rt,a=(0,e.closest)(t.target,n);if(!(0,e.isNullOrUndefined)(a))if((0,e.isNullOrUndefined)((0,e.closest)(t.target,"."+bi))){var s=a.classList.contains($e)||a.classList.contains(Ke);this.parent.uiStateValues.isTapHold&&!this.parent.uiStateValues.action&&s&&(this.parent.uiStateValues.isTapHold=!1,this.parent.eventBase.removeSelectedAppointmentClass(),this.parent.selectedElements=[]);var o=(0,e.closest)(t.target,"."+di),l=this.parent.getNavigateView(),p=this.parent.currentView===l;if((0,e.isNullOrUndefined)(o)||p||(0,e.isNullOrUndefined)(this.parent.viewOptions[l.charAt(0).toLowerCase()+l.slice(1)])){if(this.parent.activeViewOptions.readonly&&"MonthAgenda"!==this.parent.currentView)return void(this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide());if(this.parent.isAdaptive&&(t.target.classList.contains(Bi)||(0,e.closest)(t.target,"."+Bi)))return;if(s&&t.shiftKey&&1===t.which&&this.parent.keyboardInteractionModule)return void this.parent.keyboardInteractionModule.onMouseSelection(t);this.parent.activeCellsData=this.parent.getCellDetails(a);var c=(0,e.extend)(this.parent.activeCellsData,{cancel:!1,event:t,name:"cellClick"});this.parent.trigger(r,c,(function(e){if(e.cancel)i.parent.quickPopup&&i.parent.quickPopup.quickPopupHide();else if(s&&i.parent.selectCell(a),i.parent.allowInline){var t={element:e.element,groupIndex:e.groupIndex,type:"Cell"};i.parent.notify(A,t)}else i.parent.notify(r,e)}))}else{var h=this.parent.getDateFromElement(a);!(0,e.isNullOrUndefined)(h)&&this.parent.isMinMaxDate(h)&&(this.parent.setProperties({selectedDate:h},!0),this.parent.changeView(this.parent.getNavigateView(),t))}}else this.parent.eventWindow.openEditor(this.parent.activeCellsData,"Add")}},t.prototype.cellDblClick=function(t){var i=this,n="."+$e+",."+Ke+",."+rt,r=(0,e.closest)(t.target,n);if(!(this.parent.activeViewOptions.readonly||this.isPreventAction(t)||(0,e.isNullOrUndefined)(r))){var s=(0,e.extend)(this.parent.activeCellsData,{cancel:!1,event:t,name:"cellDoubleClick"});this.parent.trigger(a,s,(function(e){var t=new Date(e.startTime.getTime());i.parent.isMinMaxDate(new Date(t.setHours(0,0,0,0)))&&(e.cancel||i.parent.eventWindow.openEditor(i.parent.activeCellsData,"Add"))}))}},t.prototype.onHover=function(t){var i="."+$e+",."+Vt+",."+Ke+",."+rt+",."+Ot+",."+Xt+",."+zt+",."+pi,n=(0,e.closest)(t.target,i);if(n){var r={element:n,event:t};this.parent.trigger(l,r)}},t.prototype.isPreventAction=function(t){if((0,e.closest)(t.target,"."+di))return!1;if((0,e.closest)(t.target,"."+jt)&&!(0,e.closest)(t.target,"."+Bi))return!0;var i=(0,e.closest)(t.target,"."+Xt+",."+mt);return!(0,e.isNullOrUndefined)(i)||(i=(0,e.closest)(t.target,"."+rt),!(!this.parent.activeView||!this.parent.activeView.isTimelineView()||(0,e.isNullOrUndefined)(i)))},t.prototype.destroy=function(){e.EventHandler.remove(this.parent.element,"mouseover",this.onHover)},t}(),Co=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Oo=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},Eo=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return Co(i,t),Oo([(0,e.Property)()],i.prototype,"name",void 0),Oo([(0,e.Property)()],i.prototype,"default",void 0),Oo([(0,e.Property)()],i.prototype,"title",void 0),Oo([(0,e.Property)({})],i.prototype,"validation",void 0),i}(e.ChildProperty),xo=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Vo=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},Ao=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return xo(i,t),Vo([(0,e.Property)("Id")],i.prototype,"id",void 0),Vo([(0,e.Property)("IsBlock")],i.prototype,"isBlock",void 0),Vo([(0,e.Complex)({name:"Subject"},Eo)],i.prototype,"subject",void 0),Vo([(0,e.Complex)({name:"StartTime"},Eo)],i.prototype,"startTime",void 0),Vo([(0,e.Complex)({name:"EndTime"},Eo)],i.prototype,"endTime",void 0),Vo([(0,e.Complex)({name:"StartTimezone"},Eo)],i.prototype,"startTimezone",void 0),Vo([(0,e.Complex)({name:"EndTimezone"},Eo)],i.prototype,"endTimezone",void 0),Vo([(0,e.Complex)({name:"Location"},Eo)],i.prototype,"location",void 0),Vo([(0,e.Complex)({name:"Description"},Eo)],i.prototype,"description",void 0),Vo([(0,e.Complex)({name:"IsAllDay"},Eo)],i.prototype,"isAllDay",void 0),Vo([(0,e.Complex)({name:"RecurrenceID"},Eo)],i.prototype,"recurrenceID",void 0),Vo([(0,e.Complex)({name:"RecurrenceRule"},Eo)],i.prototype,"recurrenceRule",void 0),Vo([(0,e.Complex)({name:"RecurrenceException"},Eo)],i.prototype,"recurrenceException",void 0),Vo([(0,e.Property)("IsReadonly")],i.prototype,"isReadonly",void 0),Vo([(0,e.Property)("FollowingID")],i.prototype,"followingID",void 0),i}(e.ChildProperty),Io=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Mo=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},ko=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return Io(i,t),Mo([(0,e.Property)()],i.prototype,"template",void 0),Mo([(0,e.Property)([])],i.prototype,"dataSource",void 0),Mo([(0,e.Property)()],i.prototype,"query",void 0),Mo([(0,e.Complex)({},Ao)],i.prototype,"fields",void 0),Mo([(0,e.Property)(!1)],i.prototype,"enableTooltip",void 0),Mo([(0,e.Property)("AllDayRow")],i.prototype,"spannedEventPlacement",void 0),Mo([(0,e.Property)(1)],i.prototype,"minimumEventDuration",void 0),Mo([(0,e.Property)()],i.prototype,"tooltipTemplate",void 0),Mo([(0,e.Property)()],i.prototype,"resourceColorField",void 0),Mo([(0,e.Property)(!1)],i.prototype,"editFollowingEvents",void 0),Mo([(0,e.Property)(!0)],i.prototype,"allowAdding",void 0),Mo([(0,e.Property)(!0)],i.prototype,"allowEditing",void 0),Mo([(0,e.Property)(!0)],i.prototype,"allowDeleting",void 0),Mo([(0,e.Property)(!1)],i.prototype,"enableMaxHeight",void 0),Mo([(0,e.Property)(!1)],i.prototype,"enableIndicator",void 0),Mo([(0,e.Property)(!1)],i.prototype,"ignoreWhitespace",void 0),Mo([(0,e.Property)()],i.prototype,"sortComparer",void 0),Mo([(0,e.Property)()],i.prototype,"includeFiltersInQuery",void 0),i}(e.ChildProperty),Ro=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ho=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},Po=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return Ro(i,t),Ho([(0,e.Property)(!1)],i.prototype,"byDate",void 0),Ho([(0,e.Property)(!0)],i.prototype,"byGroupID",void 0),Ho([(0,e.Property)(!1)],i.prototype,"allowGroupEdit",void 0),Ho([(0,e.Property)([])],i.prototype,"resources",void 0),Ho([(0,e.Property)(!0)],i.prototype,"enableCompactView",void 0),Ho([(0,e.Property)()],i.prototype,"headerTooltipTemplate",void 0),Ho([(0,e.Property)(!1)],i.prototype,"hideNonWorkingDays",void 0),i}(e.ChildProperty),jo=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),No=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},Lo=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return jo(i,t),No([(0,e.Property)()],i.prototype,"field",void 0),No([(0,e.Property)()],i.prototype,"title",void 0),No([(0,e.Property)()],i.prototype,"name",void 0),No([(0,e.Property)(!1)],i.prototype,"allowMultiple",void 0),No([(0,e.Property)([])],i.prototype,"dataSource",void 0),No([(0,e.Property)()],i.prototype,"query",void 0),No([(0,e.Property)("Id")],i.prototype,"idField",void 0),No([(0,e.Property)("Text")],i.prototype,"textField",void 0),No([(0,e.Property)("Expanded")],i.prototype,"expandedField",void 0),No([(0,e.Property)("GroupID")],i.prototype,"groupIDField",void 0),No([(0,e.Property)("Color")],i.prototype,"colorField",void 0),No([(0,e.Property)("StartHour")],i.prototype,"startHourField",void 0),No([(0,e.Property)("EndHour")],i.prototype,"endHourField",void 0),No([(0,e.Property)("WorkDays")],i.prototype,"workDaysField",void 0),No([(0,e.Property)("CssClass")],i.prototype,"cssClassField",void 0),i}(e.ChildProperty),qo=function(){function n(e){this.resourceCollection=[],this.leftPixel=25,this.resourceDateTree=[],this.parent=e}return n.prototype.renderResourceHeaderIndent=function(t){var i=(0,e.createElement)("td",{className:"e-resource-left-td"}),n=(0,e.createElement)("div",{className:ft});if(this.parent.activeViewOptions.headerIndentTemplate){var r={className:[i.className],type:"emptyCells"};this.parent.renderHeaderIndentTemplate(r,i)}else i.appendChild(n);var a={elementType:"emptyCells",element:i};this.parent.trigger(v,a),t.appendChild(i)},n.prototype.hideResourceRows=function(t){if(!(this.resourceCollection.length<=1||this.parent.virtualScrollModule))for(var i=this.lastResourceLevel.length,n=0;n<i;n++){var r=this.lastResourceLevel[parseInt(n.toString(),10)].resourceData,a=this.lastResourceLevel[parseInt(n.toString(),10)].resource;if(r.ClassName===Dt&&!r[a.expandedField]&&!(0,e.isNullOrUndefined)(r[a.expandedField])){var s=[].slice.call(t.children).slice(n+1,n+(parseInt(r.Count,10)+1));(0,e.addClass)(s,Xn)}}},n.prototype.createResourceColumn=function(){var t=this.resourceCollection,i=(0,e.createElement)("div",{className:yt}),n=this.parent.activeView.createTableLayout(Tt);!this.parent.uiStateValues.isGroupAdaptive&&this.parent.rowAutoHeight&&this.parent.activeView.isTimelineView()&&this.parent.activeViewOptions.group.resources.length>0&&(0,e.addClass)([n],lr);var r=n.querySelector("tbody"),a=this.generateTreeData(!0);if(this.countCalculation(t.slice(0,-2),t.slice(0,-1)),this.renderedResources=this.lastResourceLevel,this.parent.virtualScrollModule){var s=this.parent.virtualScrollModule.getRenderedCount();this.setExpandedResources(),a=this.expandedResources.slice(0,s),this.renderedResources=a}return(0,e.append)(this.getContentRows(a),r),this.hideResourceRows(r),n.appendChild(r),i.appendChild(n),i},n.prototype.setRenderedResources=function(){var e=this.resourceCollection;this.generateTreeData(!0);this.countCalculation(e.slice(0,-2),e.slice(0,-1)),this.renderedResources=this.lastResourceLevel},n.prototype.setExpandedResources=function(){for(var t=[],i=0;i<this.lastResourceLevel.length;i++){var n=this.lastResourceLevel[parseInt(i.toString(),10)].resourceData,r=n.Count;t.push(this.lastResourceLevel[parseInt(i.toString(),10)]);var a=n[this.lastResourceLevel[parseInt(i.toString(),10)].resource.expandedField];!(0,e.isNullOrUndefined)(a)&&!a&&r>0&&(i+=r)}this.expandedResources=t},n.prototype.getContentRows=function(t,i){for(var n,r,a=[],s=this.resourceCollection,o=(0,e.createElement)("tr"),l=(0,e.createElement)("td",{attrs:{tabindex:i?"-1":"0"}}),p=this.parent.activeView.getGroupIndices(),c=0;c<t.length;c++)if(!(p.length>0&&p.indexOf(t[parseInt(c.toString(),10)].groupIndex)>-1)){var h=l.cloneNode();if((r=Ae(s,"name",t[parseInt(c.toString(),10)].resource.name))===s.length-1?((0,e.extend)(t[parseInt(c.toString(),10)].resourceData,{ClassName:wt}),this.renderedResources[parseInt(c.toString(),10)].className=[wt]):((0,e.extend)(t[parseInt(c.toString(),10)].resourceData,{ClassName:Dt}),this.renderedResources[parseInt(c.toString(),10)].className=[Dt]),n=r*this.leftPixel+"px",t[parseInt(c.toString(),10)].resourceData.ClassName===Dt&&!(0,e.isNullOrUndefined)(t[parseInt(c.toString(),10)].resourceData.Count)&&t[parseInt(c.toString(),10)].resourceData.Count>0){var d=void 0;d=t[parseInt(c.toString(),10)].resourceData[s[parseInt(r.toString(),10)].expandedField]||(0,e.isNullOrUndefined)(t[parseInt(c.toString(),10)].resourceData[s[parseInt(r.toString(),10)].expandedField])?St:bt;var u=(0,e.createElement)("div");(0,e.addClass)([u],[Ct,d]),this.setMargin(u,n),h.appendChild(u),this.resourceCollection.length>1&&e.EventHandler.add(u,"click",this.onTreeIconClick,this)}this.parent.activeView.setResourceHeaderContent(h,t[parseInt(c.toString(),10)],ft),h.setAttribute("data-group-index",t[parseInt(c.toString(),10)].groupIndex.toString()),h.setAttribute("aria-label",t[parseInt(c.toString(),10)].resourceData[t[parseInt(c.toString(),10)].resource.textField]+" resource"),this.parent.activeViewOptions.resourceHeaderTemplate||this.setMargin(h.querySelector("."+ft),n);var g=[Ot,t[parseInt(c.toString(),10)].resourceData.ClassName];(0,e.addClass)([h],g);var m={elementType:"resourceHeader",element:h,groupIndex:t[parseInt(c.toString(),10)].groupIndex};this.parent.trigger(v,m);var f=o.cloneNode();f.appendChild(h),a.push(f)}return a},n.prototype.setMargin=function(e,t){this.parent.enableRtl?e.style.marginRight=t:e.style.marginLeft=t},n.prototype.countCalculation=function(t,i){for(var n,r=0;r<t.length;r++){for(var a=t[t.length-(r+1)].dataSource,s=0;s<a.length;s++){var o=0;if(this.parent.activeViewOptions.group.byGroupID){var l=(new Sr.Query).where(i[i.length-1].groupIDField,"equal",a[parseInt(s.toString(),10)][t[t.length-(r+1)].idField]);n=new Sr.DataManager(i[i.length-1].dataSource).executeLocal(l)}else n=i[i.length-1].dataSource;for(var p=0;p<n.length;p++)o+=parseInt(n[parseInt(p.toString(),10)].Count,10);o+=parseInt(a[parseInt(s.toString(),10)].Count,10),(0,e.extend)(a[parseInt(s.toString(),10)],{Count:o})}i=i.slice(0,-1)}},n.prototype.onTreeIconClick=function(t){var i=this;this.parent.eventTooltip&&this.parent.eventTooltip.close();var n,r=t.target,a=(0,e.closest)(r,"."+Dt).parentElement,s=parseInt(a.children[0].getAttribute("data-group-index"),10),o={cancel:!1,event:t,groupIndex:s,requestType:r.classList.contains(St)?"resourceCollapse":"resourceExpand"};this.parent.trigger(p,o,(function(a){if(!a.cancel){r.classList.contains(St)?((0,e.classList)(r,[bt],[St]),n=!0):((0,e.classList)(r,[St],[bt]),n=!1);for(var l=0,p=[].slice.call(i.parent.element.querySelectorAll("."+Xt+",."+Bi));l<p.length;l++){var h=p[l];(0,e.remove)(h)}i.parent.virtualScrollModule?i.updateVirtualContent(s,n,t,r):i.updateContent(s,n);var d={cssProperties:i.parent.getCssProperties(),module:"scroll"};i.parent.notify(Q,d),o={cancel:!1,event:t,groupIndex:s,requestType:r.classList.contains(St)?"resourceExpanded":"resourceCollapsed"},i.parent.refreshEvents(!1),i.parent.trigger(c,o)}}))},n.prototype.updateContent=function(t,i){for(var n,r=[],a=[],s=[],o=this.lastResourceLevel[parseInt(t.toString(),10)].resourceData,l=[].slice.call(this.parent.element.querySelectorAll("."+yt+" tr")),p=[].slice.call(this.parent.element.querySelectorAll("."+ri+" tbody tr")),c=[].slice.call(this.parent.element.querySelectorAll("."+ri+" ."+Gt)),h=0;h<o.Count;h++)r.push(l[t+h+1]),a.push(p[t+h+1]),s.push(c[t+h+1]);for(var d=this.lastResourceLevel,u=0;u<r.length;u++){var g=!0;if(n=r[parseInt(u.toString(),10)].children[0].classList.contains(Dt),d[parseInt(t.toString(),10)].resourceData[d[parseInt(t.toString(),10)].resource.expandedField]=!i,i){if(n)(v=r[parseInt(u.toString(),10)].querySelector("."+Ct))&&(0,e.classList)(v,[bt],[St]);r[parseInt(u.toString(),10)].classList.contains(Xn)||(0,e.addClass)([r[parseInt(u.toString(),10)],a[parseInt(u.toString(),10)],s[parseInt(u.toString(),10)]],Xn)}else{if(n){var v,m=r[parseInt(u.toString(),10)].rowIndex;if(d[parseInt(m.toString(),10)].resourceData[d[parseInt(m.toString(),10)].resource.expandedField]||(0,e.isNullOrUndefined)(d[parseInt(m.toString(),10)].resourceData[d[parseInt(m.toString(),10)].resource.expandedField])||(r.splice(u+1,parseInt(d[parseInt(m.toString(),10)].resourceData.Count,10)),a.splice(u+1,parseInt(d[parseInt(m.toString(),10)].resourceData.Count,10)),s.splice(u+1,parseInt(d[parseInt(m.toString(),10)].resourceData.Count,10)),g=!1),g)(v=r[parseInt(u.toString(),10)].querySelector("."+Ct))&&(0,e.classList)(v,[St],[bt])}r[parseInt(u.toString(),10)].classList.contains(Xn)&&(0,e.removeClass)([r[parseInt(u.toString(),10)],a[parseInt(u.toString(),10)],s[parseInt(u.toString(),10)]],Xn)}}},n.prototype.updateVirtualContent=function(t,i,n,r){this.lastResourceLevel[parseInt(t.toString(),10)].resourceData[this.lastResourceLevel[parseInt(t.toString(),10)].resource.expandedField]=!i,this.setExpandedResources();var a=this.parent.virtualScrollModule.getRenderedCount(),s=this.expandedResources.indexOf(this.renderedResources[0]);if(this.parent.virtualScrollModule.existingDataCollection=this.renderedResources,this.renderedResources=this.expandedResources.slice(s,s+a),this.renderedResources.length<a){var o=this.expandedResources.length-a;o=o>0?o:0,this.renderedResources=this.expandedResources.slice(o,this.expandedResources.length)}var l=this.parent.element.querySelector("."+ai);this.parent.virtualScrollModule.updateVirtualTrackHeight(l);var p=this.parent.element.querySelector("."+yt+" table"),c=this.parent.element.querySelector("."+ri+" table"),h=this.parent.element.querySelector("."+vt);this.parent.virtualScrollModule.updateContent(p,c,h,this.renderedResources);var d=this.parent.element.querySelector("."+Mt);(0,e.isNullOrUndefined)(d)||(d.style.height=this.parent.element.querySelector("."+Je).offsetHeight+"px")},n.prototype.renderResourceHeader=function(){var t=(0,e.createElement)("div",{className:qt});if(t.innerHTML='<div class="'+Ut+'"><div class="'+Zn+'"><div class="e-icons '+Jn+'"></div></div><div class="'+$n+'"></div></div>',"MonthAgenda"===this.parent.currentView){var i=this.parent.activeView.getPanel().querySelector("."+ri);i.insertBefore(t,i.querySelector("."+_t))}else this.parent.element.insertBefore(t,this.parent.element.querySelector("."+Xe));this.renderResourceHeaderText(),e.EventHandler.add(t.querySelector("."+Jn),"click",this.menuClick,this)},n.prototype.renderResourceTree=function(){this.popupOverlay=(0,e.createElement)("div",{className:er});var n=(0,e.createElement)("div",{className:tr+" e-popup-close"});if("MonthAgenda"===this.parent.currentView){var r=this.parent.activeView.getPanel().querySelector("."+_t);r.insertBefore(n,r.children[0]),r.appendChild(this.popupOverlay)}else this.parent.element.querySelector("."+Xe).appendChild(n),this.parent.element.querySelector("."+Xe).appendChild(this.popupOverlay);var a=(0,e.createElement)("div",{className:"e-resource-tree"});n.appendChild(a),this.treeViewObj=new i.TreeView({cssClass:this.parent.cssClass,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,fields:{dataSource:[].slice.call(this.generateTreeData()),id:"resourceId",text:"resourceName",child:"resourceChild"},nodeTemplate:this.parent.resourceHeaderTemplate,nodeClicked:this.resourceClick.bind(this),created:this.resourceTreeCreated.bind(this)}),this.treeViewObj.root=this.parent.root?this.parent.root:this.parent,this.treeViewObj.appendTo(a),this.treeViewObj.expandAll(),this.treePopup=new t.Popup(n,{targetType:"relative",actionOnScroll:"none",content:this.treeViewObj.element,relateTo:this.parent.element.querySelector("."+Xe),enableRtl:this.parent.enableRtl,hideAnimation:{name:"SlideLeftOut",duration:500},showAnimation:{name:"SlideLeftIn",duration:500},viewPortElement:this.parent.element.querySelector("."+("MonthAgenda"===this.parent.currentView?_t:Xe))}),this.parent.on(Z,this.documentClick,this)},n.prototype.resourceTreeCreated=function(){this.parent.activeViewOptions.resourceHeaderTemplate&&this.parent.portals&&this.treeViewObj.portals&&(this.parent.portals=this.parent.portals.concat(this.treeViewObj.portals),this.parent.renderTemplates())},n.prototype.generateTreeData=function(t){for(var i=this,n=[],r=[],a=0,s=function(s,l){var p=function(n,s,o){var l,c,h=i.resourceCollection[parseInt(s.toString(),10)];t?(c={type:"resourceHeader",resource:n.resource,resourceData:n.resourceData,groupIndex:a,groupOrder:n.groupOrder},r.push(c),a++):l={resourceId:o,resourceName:n.resourceData[h.textField],resource:n.resource,resourceData:n.resourceData},n.child.length>0&&!t&&(l.resourceChild=[]);for(var d=1,u=0,g=n.child;u<g.length;u++){var v=g[u];t?p(v,s+1,o+"-"+d):l.resourceChild.push(p(v,s+1,o+"-"+d)),d+=1}return t&&(0,e.extend)(c.resourceData,{Count:d-1}),l};t?p(o.resourceTreeLevel[parseInt(s.toString(),10)],0,(s+1).toString()):n.push(p(o.resourceTreeLevel[parseInt(s.toString(),10)],0,(s+1).toString()))},o=this,l=0,p=this.resourceTreeLevel.length;l<p;l++)s(l);return t?(this.lastResourceLevel=r,r):n},n.prototype.renderResourceHeaderText=function(){for(var t=this.lastResourceLevel[this.parent.uiStateValues.groupIndex],i=[],n=function(n,a){var s=r.resourceCollection[parseInt(n.toString(),10)],o=s.dataSource.filter((function(e){return e[s.idField]===t.groupOrder[parseInt(n.toString(),10)]})),l=(0,e.createElement)("div",{className:ei});r.parent.sanitize(o[0][s.textField],l),i.push(l);var p=(0,e.createElement)("div",{className:"e-icons e-icon-next"});i.push(p)},r=this,a=0,s=t.groupOrder.length;a<s;a++)n(a);i.pop();var o=("MonthAgenda"===this.parent.currentView?this.parent.activeView.getPanel():this.parent.element).querySelector("."+$n);Me(o);for(var l=0,p=i;l<p.length;l++){var c=p[l];o.appendChild(c)}1===this.lastResourceLevel.length&&(0,e.addClass)([this.parent.element.querySelector("."+Zn)],Ge)},n.prototype.menuClick=function(t){if(this.parent.element.querySelector("."+tr).classList.contains(tt))this.treePopup.hide(),(0,e.removeClass)([this.popupOverlay],_e);else{var i=[].slice.call(this.treeViewObj.element.querySelectorAll(".e-list-item:not(.e-has-child)"));(0,e.removeClass)(i,"e-active"),(0,e.addClass)([i[this.parent.uiStateValues.groupIndex]],"e-active"),this.treePopup.show(),(0,e.addClass)([this.popupOverlay],_e)}},n.prototype.selectResourceByIndex=function(e){this.lastResourceLevel&&e>-1&&e<this.lastResourceLevel.length&&this.triggerEvents(e)},n.prototype.resourceClick=function(t){if(!t.node.classList.contains("e-has-child")){this.treePopup.hide(),(0,e.removeClass)([this.popupOverlay],_e);var i=[].slice.call(this.treeViewObj.element.querySelectorAll(".e-list-item:not(.e-has-child)")).indexOf(t.node);this.triggerEvents(i,t),t.event.preventDefault()}},n.prototype.triggerEvents=function(e,t){var i=this,n={cancel:!1,event:t?t.event:null,groupIndex:e,requestType:"resourceChange"};this.parent.trigger(p,n,(function(e){e.cancel||(i.parent.uiStateValues.groupIndex=e.groupIndex,i.parent.renderModule.render(i.parent.currentView),n={cancel:!1,event:t?t.event:null,groupIndex:i.parent.uiStateValues.groupIndex,requestType:"resourceChanged"},i.parent.adaptiveGroupIndex=i.parent.uiStateValues.groupIndex,i.parent.trigger(c,n))}))},n.prototype.documentClick=function(t){if(!(0,e.closest)(t.event.target,"."+tr)){var i=this.parent.element.querySelector("."+tr);i&&i.classList.contains(tt)&&(this.treePopup.hide(),(0,e.removeClass)([this.popupOverlay],_e))}},n.prototype.bindResourcesData=function(e){var t=this;this.parent.showSpinner();for(var i=[],n=0,r=this.parent.resources;n<r.length;n++){var a=r[n],s=new Cr(this.parent,a.dataSource,a.query);i.push(s.getData(s.generateQuery()))}Promise.all(i).then((function(i){return t.dataManagerSuccess(i,e)})).catch((function(e){return t.parent.crudModule.dataManagerFailure(e)}))},n.prototype.dataManagerSuccess=function(e,t){if(!(!this.parent||this.parent&&this.parent.isDestroyed)){this.parent.resourceCollection=[];for(var i=0,n=e.length;i<n;i++){var r=this.parent.resources[parseInt(i.toString(),10)],a=this.getResourceModel(r,e[parseInt(i.toString(),10)].result);this.parent.resourceCollection.push(a)}this.refreshLayout(t)}},n.prototype.getResourceModel=function(e,t){return{field:e.field,title:e.title,name:e.name,allowMultiple:e.allowMultiple,dataSource:t||e.dataSource,idField:e.idField,textField:e.textField,groupIDField:e.groupIDField,colorField:e.colorField,startHourField:e.startHourField,endHourField:e.endHourField,workDaysField:e.workDaysField,expandedField:e.expandedField,cssClassField:e.cssClassField}},n.prototype.refreshLayout=function(t){!(0,e.isNullOrUndefined)(this.parent.uiStateValues.groupIndex)&&this.parent.enablePersistence||(this.parent.uiStateValues.groupIndex=0),this.parent.renderElements(t)},n.prototype.setResourceCollection=function(){var t=[];if(this.resourceCollection=[],this.colorIndex=null,this.parent.activeViewOptions.group.resources.length>0)for(var i=0,n=this.parent.activeViewOptions.group.resources;i<n.length;i++){var r=n[i],a=Ae(this.parent.resourceCollection,"name",r);a>=0&&t.push(this.parent.resourceCollection[parseInt(a.toString(),10)])}else this.parent.resourceCollection.length>0&&(t=this.parent.resourceCollection);for(var s=0,o=0,l=t;o<l.length;o++){r=l[o];var p=this.getResourceModel(r);r.name===this.parent.eventSettings.resourceColorField&&(this.colorIndex=s),s++,this.resourceCollection.push(p)}(0,e.isNullOrUndefined)(this.colorIndex)&&(this.colorIndex=this.resourceCollection.length-1)},n.prototype.generateResourceLevels=function(e,t){var i=this,n=this.resourceCollection,r=[],a=[],s=function(t,n,o,l,p){var c=[],h=t[0];if(h){var d=void 0;if(l&&i.parent.activeViewOptions.group.byGroupID){var u=l[o.idField];d=h.dataSource.filter((function(e){return e[h.groupIDField]===u}))}else d=h.dataSource;for(var g=0;g<d.length;g++){var v=[];p&&p.length>0&&(v=v.concat(p)),v.push(d[parseInt(g.toString(),10)][h.idField]);var m=s(t.slice(1),n+1,h,d[parseInt(g.toString(),10)],v);if(!(0===n&&0===m.length&&i.resourceCollection.length>1)){var f=[],y=i.parent.activeView.renderDates,T=void 0;if(!i.parent.activeViewOptions.group.byDate&&n+1===i.resourceCollection.length){var w=d[parseInt(g.toString(),10)][h.workDaysField],D=d[parseInt(g.toString(),10)][h.startHourField],b=d[parseInt(g.toString(),10)][h.endHourField];w&&w.length>0?(y=i.parent.activeView.getRenderDates(w),T=w,f=i.parent.activeView.getDateSlots(y,w)):(T=i.parent.activeViewOptions.workDays,f=e);var S=i.generateCustomHours(f,D,b,v);a=a.concat(S)}var C=d[parseInt(g.toString(),10)][h.cssClassField],O={type:"resourceHeader",className:["e-resource-cells"],resourceLevelIndex:n,groupOrder:v,resource:h,resourceData:d[parseInt(g.toString(),10)],colSpan:i.parent.activeViewOptions.group.byDate?1:f.length,renderDates:y,workDays:T,cssClass:C,child:m};c.push(O)}}return r[parseInt(n.toString(),10)]||(r[parseInt(n.toString(),10)]=[]),c.length>0&&r[parseInt(n.toString(),10)].push(c),c}return[]};return this.resourceTreeLevel=s(n,0),t?[]:this.generateHeaderLevels(r,a,e)},n.prototype.generateCustomHours=function(t,i,n,r){for(var a=(0,e.extend)([],t,null,!0),s=0,o=a;s<o.length;s++){var l=o[s];i&&(l.startHour=this.parent.getStartEndTime(i)),n&&(l.endHour=this.parent.getStartEndTime(n)),r&&(l.groupOrder=r)}return a},n.prototype.generateHeaderLevels=function(t,i,n){for(var r=[],a=t.length-1;a>=0;a--)for(var s=0,o=0,l=t[parseInt(a.toString(),10)];o<l.length;o++)for(var p=0,c=l[o];p<c.length;p++){var h=c[p];if(t[a+1]&&t[a+1].length>0){var d=t[parseInt((a+1).toString(),10)][parseInt(s.toString(),10)];if(!d)continue;for(var u=0,g=0,v=d;g<v.length;g++){var m=v[g];(!this.parent.activeViewOptions.group.byGroupID||this.parent.activeViewOptions.group.byGroupID&&m.resourceData[m.resource.groupIDField]===h.resourceData[h.resource.idField])&&(u+=m.colSpan)}h.colSpan=u}h.groupIndex=s,s++,r[h.resourceLevelIndex]=r[h.resourceLevelIndex]||[],r[h.resourceLevelIndex].push(h)}if(this.lastResourceLevel=r.slice(-1)[0]||[],!this.parent.activeViewOptions.group.byDate){for(var f=0,y=0,T=this.lastResourceLevel;y<T.length;y++){var w=T[y];for(a=0;a<w.colSpan;a++)i[parseInt(f.toString(),10)].groupIndex=w.groupIndex,f++}return r.push(i),r}var D=[],b=(0,e.extend)([],r,null,!0),S=[];if(this.parent.activeViewOptions.group.hideNonWorkingDays){for(var C=[],O=0,E=function(t){x.resourceDateTree[parseInt(O.toString(),10)]=[];for(var i=[],n=function(n){var r=x.lastResourceLevel[parseInt(n.toString(),10)].resourceData[x.lastResourceLevel[parseInt(n.toString(),10)].resource.workDaysField];if(r||(r=x.parent.activeViewOptions.workDays),-1!==r.indexOf(t.date.getDay())){var a=(0,e.extend)({},x.lastResourceLevel[parseInt(n.toString(),10)],null,!0);a.date=t.date,x.lastResourceLevel[parseInt(n.toString(),10)].workDays=r,a.startHour=x.parent.getStartEndTime(a.resourceData[a.resource.startHourField])||t.startHour,a.endHour=x.parent.getStartEndTime(a.resourceData[a.resource.endHourField])||t.endHour,x.resourceDateTree[parseInt(O.toString(),10)].push(a);for(var s=function(r){if(i[parseInt(r.toString(),10)]||(i[parseInt(r.toString(),10)]=[]),r===a.groupOrder.length-1){C[parseInt(n.toString(),10)]||(C[parseInt(n.toString(),10)]=[]);var s=a.renderDates.filter((function(e){return e.getDay()===t.date.getDay()}));return C[parseInt(n.toString(),10)]=C[parseInt(n.toString(),10)].concat(s),i[parseInt(r.toString(),10)].push(a),"continue"}var o=b[parseInt(r.toString(),10)].filter((function(e){return e.resourceData[e.resource.idField]===a.groupOrder[parseInt(r.toString(),10)]}));if(o&&o.length>0){var l=i[parseInt(r.toString(),10)].filter((function(e){return e.resourceData[e.resource.idField]===a.groupOrder[parseInt(r.toString(),10)]}));if(l&&l.length>0)l[0].colSpan+=1;else{var p=(0,e.extend)({},o[0],null,!0);p.colSpan=1,i[parseInt(r.toString(),10)].push(p)}}},o=0;o<a.groupOrder.length;o++)s(o)}},r=0;r<x.lastResourceLevel.length;r++)n(r);if(i.length>0){for(var a=0;a<b.length;a++)D[parseInt(a.toString(),10)]||(D[parseInt(a.toString(),10)]=[]),D[parseInt(a.toString(),10)]=D[parseInt(a.toString(),10)].concat(i[parseInt(a.toString(),10)]);t.colSpan=i[i.length-1].length,S.push(t)}O++},x=this,V=0,A=n;V<A.length;V++){E(P=A[V])}return this.resourceDateTree=this.resourceDateTree.filter((function(e){return e.length>0})),this.lastResourceLevel.forEach((function(e,t){C[parseInt(t.toString(),10)]&&(e.renderDates=C[parseInt(t.toString(),10)].sort((function(e,t){return e.getTime()-t.getTime()})))})),D.unshift(S),D}for(var I=0,M=0,k=b[0];M<k.length;M++){I+=k[M].colSpan}for(var R=0,H=n;R<H.length;R++){var P;(P=H[R]).colSpan=I,S.push(P);for(var j=(0,e.extend)([],b,null,!0),N=0,L=j.length;N<L;N++){if(N===j.length-1)for(var q=0,F=j[parseInt(N.toString(),10)];q<F.length;q++){var U=F[q];U.date=P.date,U.workDays=P.workDays,U.startHour=this.parent.getStartEndTime(U.resourceData[U.resource.startHourField])||P.startHour,U.endHour=this.parent.getStartEndTime(U.resourceData[U.resource.endHourField])||P.endHour}D[parseInt(N.toString(),10)]||(D[parseInt(N.toString(),10)]=[]),D[parseInt(N.toString(),10)]=D[parseInt(N.toString(),10)].concat(j[parseInt(N.toString(),10)])}}return D.unshift(S),D},n.prototype.setResourceValues=function(t,i){var n=this,r=function(e,i,r){n.resourceCollection[parseInt(e.toString(),10)].allowMultiple&&n.parent.activeViewOptions.group.allowGroupEdit?t[""+i]=[r]:t[""+i]=r};if(void 0===i&&(i=this.parent.uiStateValues.isGroupAdaptive?this.parent.uiStateValues.groupIndex:this.parent.activeCellsData.groupIndex),this.parent.activeViewOptions.group.resources.length>0&&!(0,e.isNullOrUndefined)(i))for(var a=this.lastResourceLevel[parseInt(i.toString(),10)].groupOrder,s=0;s<this.resourceCollection.length;s++)r(s,this.resourceCollection[parseInt(s.toString(),10)].field,a[parseInt(s.toString(),10)]);else if(this.parent.resourceCollection.length>0)for(s=0;s<this.resourceCollection.length;s++){var o=this.resourceCollection[parseInt(s.toString(),10)].dataSource[0];o&&r(s,this.resourceCollection[parseInt(s.toString(),10)].field,o[this.resourceCollection[parseInt(s.toString(),10)].idField])}},n.prototype.getResourceColor=function(t,i){var n=!(0,e.isNullOrUndefined)(i)&&this.colorIndex>i.length-1?i.length-1:this.colorIndex,r=this.resourceCollection[parseInt(n.toString(),10)];if(!((0,e.isNullOrUndefined)(i)&&this.parent.activeViewOptions.group.allowGroupEdit&&r.allowMultiple)){var a=(0,e.isNullOrUndefined)(i)?t[r.field]:i[parseInt(n.toString(),10)],s=this.filterData(r.dataSource,r.idField,a);return s.length>0?s[0][r.colorField]:void 0}},n.prototype.getCssClass=function(e){var t=this.resourceCollection.slice(-1)[0];if(!this.parent.activeViewOptions.group.allowGroupEdit||!t.allowMultiple){var i=this.filterData(t.dataSource,t.idField,e[t.field]);return i.length>0?i[0][t.cssClassField]:void 0}},n.prototype.getResourceRenderDates=function(){var e=[].concat.apply([],this.lastResourceLevel.map((function(e){return e.renderDates}))),t=e.map((function(e){return e.getTime()})),i=e.filter((function(e,i){return t.indexOf(e.getTime())===i}));return i.sort((function(e,t){return e.getTime()-t.getTime()})),i},n.prototype.filterData=function(e,t,i){return e.filter((function(e){return e[""+t]===i}))},n.prototype.getResourceData=function(t,i,n){if(this.parent.activeViewOptions.group.allowGroupEdit){for(var r={},a=0,s=n;a<s.length;a++)for(var o=s[a],l=this.lastResourceLevel[parseInt(o.toString(),10)].groupOrder,p=0,c=l.length;p<c;p++){var h=this.resourceCollection[parseInt(p.toString(),10)].field;(0,e.isNullOrUndefined)(r[""+h])&&(r[""+h]=[]),r[""+h].push(l[parseInt(p.toString(),10)])}t=(0,e.extend)(t,r)}else{p=0;for(var d=this.resourceCollection.length;p<d;p++)this.lastResourceLevel[parseInt(i.toString(),10)]&&(t[this.resourceCollection[parseInt(p.toString(),10)].field]=this.lastResourceLevel[parseInt(i.toString(),10)].groupOrder[parseInt(p.toString(),10)])}},n.prototype.addResource=function(e,t,i){for(var n=e instanceof Array?e:[e],r=function(e){if(e.name===t)return n.forEach((function(t,n){return new Sr.DataManager({json:e.dataSource}).insert(t,null,null,i+n)})),"break"},a=0,s=this.parent.resourceCollection;a<s.length;a++){if("break"===r(s[a]))break}this.refreshLayout(!0)},n.prototype.removeResource=function(e,t){for(var i=e instanceof Array?e:[e],n=function(e){if(e.name===t)return i.forEach((function(t){return new Sr.DataManager({json:e.dataSource}).remove(e.idField,t)})),"break"},r=0,a=this.parent.resourceCollection;r<a.length;r++){if("break"===n(a[r]))break}this.refreshLayout(!0)},n.prototype.getIndexFromResourceId=function(t,i,n,r,a){if(i=i||this.parent.resourceCollection.slice(-1)[0].name,(0,e.isNullOrUndefined)(n)&&(n=this.resourceCollection.filter((function(e){return e.name===i}))[0],(0,e.isNullOrUndefined)(n)))return null;var s=n.dataSource.filter((function(e){return r&&e[n.idField]===t?e[n.groupIDField]===r[""+a]?e[n.idField]===t:null:e[n.idField]===t}))[0];return this.lastResourceLevel.map((function(e){return e.resourceData})).indexOf(s)},n.prototype.resourceExpand=function(e,t,i){var n=this.parent.resourceCollection.filter((function(e){return e.name===t?e:null}))[0],r=0,a=n.dataSource.filter((function(t){return t[n.idField]===e}))[0];r=this.parent.activeViewOptions.group.byGroupID?this.lastResourceLevel.map((function(e){return e.resourceData})).indexOf(a):this.getIndexFromResourceId(e,t,n);var s=this.parent.element.querySelector("."+yt+' [data-group-index="'+r+'"] .'+Ct);s&&(s.classList.contains(bt)&&!i||s.classList.contains(St)&&i)&&s.click()},n.prototype.resourceScroll=function(e,t){if(!(this.parent.isAdaptive||["Agenda","MonthAgenda"].indexOf(this.parent.currentView)>-1)){var i=t||this.parent.resourceCollection.slice(-1)[0].name,n=this.parent.resourceCollection.length-1,r=this.parent.resourceCollection.filter((function(e,t){return e.name===i?(n=t,e):null}))[0],a=this.parent.element.querySelector("."+ri),s=0;if(this.parent.activeView.isTimelineView()){if(this.parent.activeViewOptions.group.byGroupID){var o=r.dataSource.filter((function(t){return t[r.idField]===e}))[0];s=this.lastResourceLevel.map((function(e){return e.resourceData})).indexOf(o)}else s=this.getIndexFromResourceId(e,i,r);if(this.parent.virtualScrollModule){var l=this.parent.element.querySelector("."+ai),p=Math.round(l.offsetHeight/this.expandedResources.length);if(this.parent.rowAutoHeight&&(a.scrollTop=0,this.parent.virtualScrollModule.virtualScrolling()),a.scrollTop=s*p-(this.parent.virtualScrollModule.bufferCount-1)*p,this.parent.virtualScrollModule.virtualScrolling(),this.parent.rowAutoHeight)(c=this.parent.element.querySelector("."+$e+'[data-group-index="'+s+'"]'))&&!c.parentElement.classList.contains(Xn)&&(a.scrollTop=a.scrollTop<c.offsetTop?c.offsetTop:a.scrollTop+c.offsetTop);else a.scrollTop=s*p}else{var c;(c=this.parent.element.querySelector("."+$e+'[data-group-index="'+s+'"]'))&&!c.parentElement.classList.contains(Xn)&&(a.scrollTop=c.offsetTop)}}else{s=this.parent.activeViewOptions.group.byGroupID?i===this.parent.resourceCollection.slice(-1)[0].name?this.lastResourceLevel.map((function(e){return e.resourceData[r.idField]})).indexOf(e):r.dataSource.map((function(e){return e[r.idField]})).indexOf(e):this.getIndexFromResourceId(e,i,r);var h="Month"===this.parent.currentView?this.parent.element.querySelector("."+it+" tbody tr:nth-child("+(n+1)+")"):this.parent.element.querySelector("."+Hi+":nth-child("+(n+1)+")"),d=[].slice.call(h.children).map((function(e){return e.offsetLeft}));a.scrollLeft=d[parseInt(s.toString(),10)]}}},n.prototype.destroy=function(){if(this.parent.off(Z,this.documentClick),this.treeViewObj){if(this.treeViewObj.portals&&this.treeViewObj.portals.length>0){var t=this.treeViewObj.portals.map((function(e){return e.propName}));t.length>0&&this.parent.resetTemplates(t)}this.treeViewObj.destroy(),this.treeViewObj=null}this.treePopup&&(this.treePopup.destroy(),this.treePopup=null,(0,e.remove)(this.parent.element.querySelector("."+tr)),(0,e.remove)(this.parent.element.querySelector("."+er)));var i=this.parent.element.querySelector("."+qt);i&&(0,e.remove)(i)},n}(),Fo=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Uo=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},Bo=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return Fo(i,t),Uo([(0,e.Property)("")],i.prototype,"id",void 0),Uo([(0,e.Property)("")],i.prototype,"text",void 0),Uo([(0,e.Property)("auto")],i.prototype,"width",void 0),Uo([(0,e.Property)("")],i.prototype,"cssClass",void 0),Uo([(0,e.Property)(!1)],i.prototype,"showAlwaysInPopup",void 0),Uo([(0,e.Property)(!1)],i.prototype,"disabled",void 0),Uo([(0,e.Property)("")],i.prototype,"prefixIcon",void 0),Uo([(0,e.Property)("")],i.prototype,"suffixIcon",void 0),Uo([(0,e.Property)(!0)],i.prototype,"visible",void 0),Uo([(0,e.Property)("None")],i.prototype,"overflow",void 0),Uo([(0,e.Property)("")],i.prototype,"template",void 0),Uo([(0,e.Property)("Button")],i.prototype,"type",void 0),Uo([(0,e.Property)("Both")],i.prototype,"showTextOn",void 0),Uo([(0,e.Property)(null)],i.prototype,"htmlAttributes",void 0),Uo([(0,e.Property)("")],i.prototype,"tooltipText",void 0),Uo([(0,e.Property)("Left")],i.prototype,"align",void 0),Uo([(0,e.Property)(-1)],i.prototype,"tabIndex",void 0),Uo([(0,e.Property)("Custom")],i.prototype,"name",void 0),Uo([(0,e.Event)()],i.prototype,"click",void 0),i}(e.ChildProperty),Wo=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),zo=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},Yo=function(i){function n(e,t){var n=i.call(this,e,t)||this;return n.adaptiveGroupIndex=0,n}return Wo(n,i),n.prototype.render=function(){var i=[],n=[];if(i.push(Fe),this.enableRtl?i.push(Ue):n.push(Ue),this.isAdaptive?i.push(Be):n.push(Be),this.enableAdaptiveUI?i.push(We):n.push(We),this.allowMultiDrag?i.push(ze):n.push(ze),this.cssClass)for(var r=0,a=this.cssClass.split(" ");r<a.length;r++){var s=a[r];i.push(s)}(0,e.classList)(this.element,i,n),this.validateDate(),(0,t.createSpinner)({target:this.element}),this.scrollModule=new Tr(this),this.scrollModule.setWidth(),this.scrollModule.setHeight(),this.renderModule=new lo(this),this.eventBase=new Aa(this),this.workCellAction=new So(this),this.allowKeyboardInteraction&&(this.keyboardInteractionModule=new br(this)),this.inlineModule=new ja(this),this.initializeDataModule(),this.renderTableContainer(),this.activeViewOptions=this.getActiveViewOptions(),this.initializeResources(),this.wireEvents()},n.prototype.renderTableContainer=function(){this.element.querySelector("."+Xe)||this.element.appendChild(this.createElement("div",{className:Xe}))},n.prototype.getEventTemplateName=function(e){var t="eventTemplate_"+e;return this.activeEventTemplates.indexOf(t)<0&&this.activeEventTemplates.push(t),t},n.prototype.getElementWidth=function(e){return Ne(e,this.uiStateValues.isTransformed)},n.prototype.getElementHeight=function(e){return Le(e,this.uiStateValues.isTransformed)},n.prototype.getElementHeightFromClass=function(e,t){return re(e,t,this.uiStateValues.isTransformed)},n.prototype.renderTemplates=function(e){this.isReact?this.renderReactTemplates(e):e&&e()},n.prototype.resetTemplates=function(e){(this.isAngular||this.isReact)&&this.clearTemplate(e)},n.prototype.sanitize=function(t,i){this.enableHtmlSanitizer?i.innerText=e.SanitizeHtmlHelper.sanitize(t):i.innerHTML=t},n.prototype.initializeResources=function(e){void 0===e&&(e=!1),this.resources.length>0?(this.resourceBase=new qo(this),this.resourceBase.bindResourcesData(e)):(this.resourceBase=null,this.resourceCollection=[],this.renderElements(e))},n.prototype.destroyEditorWindow=function(){this.eventWindow&&(this.eventWindow.destroy(),this.eventWindow=null),this.eventWindow=new so(this)},n.prototype.renderElements=function(t){if(t)return this.initializeView(this.currentView),void this.eventWindow.refresh();this.destroyHeaderModule(),this.showHeaderBar&&(this.headerModule=new yr(this)),this.renderTableContainer(),this.uiStateValues.isTransformed=Math.round(this.element.getBoundingClientRect().width)!==this.element.offsetWidth,(e.Browser.isDevice||e.Browser.isTouch)&&(this.scheduleTouchModule=new wr(this)),this.initializeView(this.currentView),this.destroyPopups(),this.isPrinting||this.initializePopups()},n.prototype.validateDate=function(t){void 0===t&&(t=this.selectedDate);var i=t instanceof Date?new Date(t.getTime()):new Date(t),n=(0,e.isNullOrUndefined)(this.minDate)?new Date(1900,0,1):this.minDate instanceof Date?new Date(this.minDate.getTime()):new Date(this.minDate),r=(0,e.isNullOrUndefined)(this.maxDate)?new Date(2099,11,31):this.maxDate instanceof Date?new Date(this.maxDate.getTime()):new Date(this.maxDate);if(!(n<=r))throw Error("minDate should be equal or less than maxDate");i<n&&(i=n),i>r&&(i=r),this.setProperties({selectedDate:new Date(""+i),minDate:new Date(""+n),maxDate:new Date(""+r)},!0),this.eventWindow&&this.eventWindow.updateMinMaxDateToEditor()},n.prototype.getViewIndex=function(e){for(var t=0;t<this.viewCollections.length;t++){if(this.viewCollections[parseInt(t.toString(),10)].option===e)return t}return-1},n.prototype.setViewOptions=function(t){if(void 0===t&&(t=!1),!(0,e.isNullOrUndefined)(this.views)&&0!==this.views.length){var i,n;this.viewOptions={},this.viewCollections=[];var r=this.viewIndex,a=0;this.viewIndex=-1;for(var s=0,o=this.views;s<o.length;s++){var l=o[s],p="string"!=typeof l;"string"==typeof l?(i=l,this.currentView===i&&(n=i,this.viewIndex=a)):(i=l.option,l.isSelected&&(n=i,this.viewIndex=a));var c=(0,e.extend)({option:i},p?l:{}),h=i.charAt(0).toLowerCase()+i.slice(1);c.cellHeaderTemplateName=c.cellHeaderTemplate?c.option:"",c.dateHeaderTemplateName=c.dateHeaderTemplate?c.option:"",c.dateRangeTemplateName=c.dateRangeTemplate?c.option:"",c.cellTemplateName=c.cellTemplate?c.option:"",c.dayHeaderTemplateName=c.dayHeaderTemplate?c.option:"",c.monthHeaderTemplateName=c.monthHeaderTemplate?c.option:"",c.resourceHeaderTemplateName=c.resourceHeaderTemplate?c.option:"",c.headerIndentTemplateName=c.headerIndentTemplate?c.option:"",c.eventTemplateName=c.eventTemplate?c.option:"",(0,e.isNullOrUndefined)(c.firstDayOfWeek)||0!==c.firstDayOfWeek||delete c.firstDayOfWeek,(0,e.isNullOrUndefined)(c.interval)||1!==c.interval||delete c.interval,this.viewCollections.push(c),(0,e.isNullOrUndefined)(this.viewOptions[""+h])?this.viewOptions[""+h]=[c]:this.viewOptions[""+h].push(c),a++}if(!t&&n&&this.setProperties({currentView:n},!0),-1===this.viewIndex){var d=this.getViewIndex(this.currentView);this.viewIndex="string"==typeof this.views[0]||(0,e.isNullOrUndefined)(r)||-1===r?-1===d?0:d:r}}},n.prototype.getActiveViewOptions=function(){var t={enable:this.timeScale.enable,interval:this.timeScale.interval,slotCount:this.timeScale.slotCount,majorSlotTemplate:this.timeScale.majorSlotTemplate,minorSlotTemplate:this.timeScale.minorSlotTemplate},i={byDate:!(this.viewCollections[this.viewIndex].option.indexOf("Year")>-1)&&this.group.byDate,byGroupID:this.group.byGroupID,allowGroupEdit:this.group.allowGroupEdit,resources:(0,e.isNullOrUndefined)(this.group.resources)?[]:this.group.resources,headerTooltipTemplate:this.group.headerTooltipTemplate,enableCompactView:this.group.enableCompactView,hideNonWorkingDays:["Day","Week","WorkWeek","Month"].indexOf(this.currentView)>-1&&this.group.hideNonWorkingDays},n=this.viewCollections[this.viewIndex].workDays?[]:this.workDays,r={dateFormat:this.dateFormat,endHour:this.endHour,isSelected:!1,option:null,readonly:this.readonly,startHour:this.startHour,allowVirtualScrolling:!1,allowOverlap:this.allowOverlap,overscanCount:this.overscanCount,cellHeaderTemplate:this.cellHeaderTemplate,dayHeaderTemplate:this.dayHeaderTemplate,monthHeaderTemplate:this.monthHeaderTemplate,cellTemplate:this.cellTemplate,eventTemplate:this.eventSettings.template,dateHeaderTemplate:this.dateHeaderTemplate,dateRangeTemplate:this.dateRangeTemplate,resourceHeaderTemplate:this.resourceHeaderTemplate,headerIndentTemplate:this.headerIndentTemplate,firstMonthOfYear:this.firstMonthOfYear,firstDayOfWeek:this.firstDayOfWeek,workDays:n,monthsCount:this.monthsCount,showWeekend:this.showWeekend,showWeekNumber:this.showWeekNumber,displayName:null,interval:1,timeScale:t,timeFormat:this.internalTimeFormat,group:i,headerRows:this.headerRows,orientation:"Horizontal",numberOfWeeks:0,displayDate:null,enableLazyLoading:!1},a=this.viewCollections[this.viewIndex],s=(0,e.extend)(r,a,void 0,!0);return 0!==this.firstDayOfWeek&&a.firstDayOfWeek&&this.firstDayOfWeek!==a.firstDayOfWeek&&(s.firstDayOfWeek=this.firstDayOfWeek),s.displayDate&&(s.displayDate=s.displayDate instanceof Date?new Date(s.displayDate.getTime()):new Date(s.displayDate)),s.enableLazyLoading&&!(0,e.isNullOrUndefined)(s.group.resources)&&s.group.resources.length>0&&(-1===["Agenda","MonthAgenda","Year","TimelineYear"].indexOf(s.option)||"TimelineYear"===s.option&&"Vertical"===s.orientation)&&(s.allowVirtualScrolling=!0),s},n.prototype.initializeDataModule=function(){this.eventFields={id:this.eventSettings.fields.id,isBlock:this.eventSettings.fields.isBlock,subject:this.eventSettings.fields.subject.name,startTime:this.eventSettings.fields.startTime.name,endTime:this.eventSettings.fields.endTime.name,startTimezone:this.eventSettings.fields.startTimezone.name,endTimezone:this.eventSettings.fields.endTimezone.name,location:this.eventSettings.fields.location.name,description:this.eventSettings.fields.description.name,isAllDay:this.eventSettings.fields.isAllDay.name,recurrenceID:this.eventSettings.fields.recurrenceID.name,recurrenceRule:this.eventSettings.fields.recurrenceRule.name,recurrenceException:this.eventSettings.fields.recurrenceException.name,isReadonly:this.eventSettings.fields.isReadonly,followingID:this.eventSettings.fields.followingID},this.setEditorTitles(),this.dataModule=new Cr(this,this.eventSettings.dataSource,this.eventSettings.query),this.crudModule=new bo(this)},n.prototype.setEditorTitles=function(){this.editorTitles={subject:this.eventSettings.fields.subject.title||this.localeObj.getConstant("title"),startTime:this.eventSettings.fields.startTime.title||this.localeObj.getConstant("start"),endTime:this.eventSettings.fields.endTime.title||this.localeObj.getConstant("end"),isAllDay:this.eventSettings.fields.isAllDay.title||this.localeObj.getConstant("allDay"),startTimezone:this.eventSettings.fields.startTimezone.title||this.localeObj.getConstant("startTimezone"),endTimezone:this.eventSettings.fields.endTimezone.title||this.localeObj.getConstant("endTimezone"),location:this.eventSettings.fields.location.title||this.localeObj.getConstant("location"),description:this.eventSettings.fields.description.title||this.localeObj.getConstant("description"),recurrenceRule:this.eventSettings.fields.recurrenceRule.title||this.localeObj.getConstant("repeat")}},n.prototype.initializeView=function(e){this.showSpinner(),this.activeViewOptions=this.getActiveViewOptions(),this.resourceBase&&this.resourceBase.setResourceCollection(),this.initializeTemplates(),this.renderModule.render(e)},n.prototype.initializeTemplates=function(){this.cellHeaderTemplateFn=this.templateParser(this.activeViewOptions.cellHeaderTemplate),this.dayHeaderTemplateFn=this.templateParser(this.activeViewOptions.dayHeaderTemplate),this.monthHeaderTemplateFn=this.templateParser(this.activeViewOptions.monthHeaderTemplate),this.cellTemplateFn=this.templateParser(this.activeViewOptions.cellTemplate),this.dateHeaderTemplateFn=this.templateParser(this.activeViewOptions.dateHeaderTemplate),this.dateRangeTemplateFn=this.templateParser(this.activeViewOptions.dateRangeTemplate),this.majorSlotTemplateFn=this.templateParser(this.activeViewOptions.timeScale.majorSlotTemplate),this.minorSlotTemplateFn=this.templateParser(this.activeViewOptions.timeScale.minorSlotTemplate),this.appointmentTemplateFn=this.templateParser(this.activeViewOptions.eventTemplate),this.resourceHeaderTemplateFn=this.templateParser(this.activeViewOptions.resourceHeaderTemplate),this.headerIndentTemplateFn=this.templateParser(this.activeViewOptions.headerIndentTemplate),this.headerTooltipTemplateFn=this.templateParser(this.activeViewOptions.group.headerTooltipTemplate),this.eventTooltipTemplateFn=this.templateParser(this.eventSettings.tooltipTemplate),this.editorTemplateFn=this.templateParser(this.editorTemplate),this.editorHeaderTemplateFn=this.templateParser(this.editorHeaderTemplate),this.editorFooterTemplateFn=this.templateParser(this.editorFooterTemplate),this.quickInfoTemplatesHeaderFn=this.templateParser(this.quickInfoTemplates.header),this.quickInfoTemplatesContentFn=this.templateParser(this.quickInfoTemplates.content),this.quickInfoTemplatesFooterFn=this.templateParser(this.quickInfoTemplates.footer)},n.prototype.initializePopups=function(){this.eventWindow=new so(this),this.quickPopup=new Fa(this)},n.prototype.getDayNames=function(t){var i,n=[],r="";(0,e.isNullOrUndefined)(this.locale)||"en"===this.locale||"en-US"===this.locale?(r="days.stand-alone.",i=(0,e.getValue)(r+t,(0,e.getDefaultDateObject)(this.getCalendarMode()))):(r="main."+this.locale+".dates.calendars."+this.getCalendarMode()+".days.format."+t,i=(0,e.getValue)(r,e.cldrData));for(var a=0,s=Object.keys(i);a<s.length;a++){var o=s[a];n.push((0,e.getValue)(o,i))}return n},n.prototype.setCldrTimeFormat=function(){(0,e.isNullOrUndefined)(this.timeFormat)?(0,e.isNullOrUndefined)(this.locale)||"en"===this.locale||"en-US"===this.locale?this.internalTimeFormat=(0,e.getValue)("timeFormats.short",(0,e.getDefaultDateObject)(this.getCalendarMode())):this.internalTimeFormat=(0,e.getValue)("main."+this.locale+".dates.calendars."+this.getCalendarMode()+".timeFormats.short",e.cldrData):this.internalTimeFormat=this.timeFormat},n.prototype.getCalendarMode=function(){return(0,e.isNullOrUndefined)(this.calendarMode)?"gregorian":this.calendarMode.toLowerCase()},n.prototype.getTimeString=function(e){return this.globalize.formatDate(e,{format:this.activeViewOptions.timeFormat,type:"time",calendar:this.getCalendarMode()}).toLocaleUpperCase()},n.prototype.getDateTime=function(e){return e instanceof Date?new Date(e.getTime()):new Date(e)},n.prototype.setCalendarMode=function(){"Islamic"===this.calendarMode?this.calendarUtil=new Er:this.calendarUtil=new Or},n.prototype.changeView=function(t,i,n,r){var a=this;if((0,e.isNullOrUndefined)(r)&&(r=this.getViewIndex(t)),!(!n&&r===this.viewIndex&&this.currentView===t||r<0)){var s=this.activeViewOptions?this.activeViewOptions.option:this.currentView,o={requestType:"viewNavigate",cancel:!1,event:i};this.trigger(p,o,(function(e){if(e.cancel)a.currentView=s;else{var n={action:"view",cancel:!1,currentDate:a.selectedDate,previousView:s,currentView:t,viewIndex:r};a.trigger(g,n,(function(e){if(e.cancel)a.currentView=s;else{var n=["Day","Week","WorkWeek"].indexOf(t)>-1&&["Day","Week","WorkWeek"].indexOf(s)<0;a.uiStateValues.isInitial=n||t.indexOf("Timeline")>-1||t.indexOf("Year")>-1,a.uiStateValues.top=t.indexOf("Timeline")>-1&&s.indexOf("Timeline")<0?0:a.uiStateValues.top,a.viewIndex=e.viewIndex,a.setProperties({currentView:t},!0),a.headerModule&&(a.headerModule.updateActiveView(),a.headerModule.setCalendarDate(a.selectedDate),a.headerModule.setCalendarView()),a.initializeView(a.currentView),a.animateLayout(),o={requestType:"viewNavigate",cancel:!1,event:i},a.trigger(c,o)}}))}}))}},n.prototype.changeDate=function(e,t){var i=this,n={requestType:"dateNavigate",cancel:!1,event:t};this.trigger(p,n,(function(r){if(!r.cancel){var a={action:"date",cancel:!1,previousDate:i.selectedDate,currentDate:e};i.trigger(g,a,(function(e){e.cancel||(i.uiStateValues.isInitial=i.activeView.isTimelineView()&&"TimelineYear"!==i.currentView,i.validateDate(e.currentDate),i.headerModule&&i.headerModule.setCalendarDate(e.currentDate),"MonthAgenda"===i.currentView&&i.monthAgendaModule&&(i.monthAgendaModule.monthAgendaDate=new Date(""+i.selectedDate)),i.initializeView(i.currentView),i.animateLayout(),n={requestType:"dateNavigate",cancel:!1,event:t},i.trigger(c,n))}))}}))},n.prototype.isMinMaxDate=function(t){void 0===t&&(t=this.selectedDate);var i=(0,e.isNullOrUndefined)(this.maxDate)?new Date(2099,11,31):this.maxDate,n=(0,e.isNullOrUndefined)(this.minDate)?new Date(1900,0,1):this.minDate;return t.getTime()>=n.getTime()&&t.getTime()<=i.getTime()},n.prototype.isSelectedDate=function(e){return e.setHours(0,0,0,0)===new Date(""+this.selectedDate).setHours(0,0,0,0)},n.prototype.getCurrentTime=function(e){return void 0===e&&(e=new Date),this.timezone?this.tzModule.convert(e,this.tzModule.getLocalTimezoneName(),this.timezone):e},n.prototype.getNavigateView=function(){return this.activeView.isTimelineView()?"TimelineMonth"===this.currentView||"TimelineYear"===this.currentView?"TimelineDay":"Agenda":"Day"},n.prototype.animateLayout=function(){this.activeView.element&&new e.Animation({duration:600,name:"FadeIn",timingFunction:"easeIn"}).animate(this.activeView.element)},n.prototype.requiredModules=function(){var e=[];this.setViewOptions(!0);for(var t=0,i=Object.keys(this.viewOptions);t<i.length;t++){var n=i[t];n="timelineDay"===n||"timelineWeek"===n||"timelineWorkWeek"===n?"timelineViews":n,e.push({member:n,args:[this]})}return this.allowDragAndDrop&&e.push({member:"dragAndDrop",args:[this]}),this.allowResizing&&e.push({member:"resize",args:[this]}),e.push({member:"excelExport",args:[this]}),e.push({member:"iCalendarExport",args:[this]}),e.push({member:"iCalendarImport",args:[this]}),e.push({member:"print",args:[this]}),e},n.prototype.preRender=function(){this.isAdaptive=e.Browser.isDevice||Pe(),this.globalize=new e.Internationalization(this.locale),this.tzModule=new xr,(this&&(0,e.isNullOrUndefined)(this.uiStateValues)||!this.enablePersistence)&&(this.uiStateValues={expand:!1,isInitial:!0,left:0,top:0,isGroupAdaptive:!1,isIgnoreOccurrence:!1,groupIndex:this.adaptiveGroupIndex,action:!1,isBlock:!1,isCustomMonth:!0,isPreventTimezone:!1,isTransformed:!1}),this.currentTimezoneDate=this.getCurrentTime(),this.activeCellsData={startTime:new Date(this.currentTimezoneDate),endTime:new Date(this.currentTimezoneDate),isAllDay:!1},this.activeEventData={event:void 0,element:void 0},this.getDefaultLocale(),this.localeObj=new e.L10n(this.getModuleName(),this.defaultLocale,this.locale),this.setCldrTimeFormat(),this.setCalendarMode(),this.eventsData=[],this.eventsProcessed=[],this.blockData=[],this.blockProcessed=[],this.resourceCollection=[],this.currentAction=null,this.selectedElements=[],this.activeEventTemplates=[],this.setViewOptions()},n.prototype.getDefaultLocale=function(){this.defaultLocale={day:"Day",week:"Week",workWeek:"Work Week",month:"Month",year:"Year",agenda:"Agenda",weekAgenda:"Week Agenda",workWeekAgenda:"Work Week Agenda",monthAgenda:"Month Agenda",today:"Today",noEvents:"No events",emptyContainer:"There are no events scheduled on this day.",allDay:"All day",start:"Start",end:"End",more:"more",close:"Close",cancel:"Cancel",noTitle:"(No Title)",delete:"Delete",deleteEvent:"Delete Event",deleteMultipleEvent:"Delete Multiple Events",selectedItems:"Items selected",deleteSeries:"Entire Series",edit:"Edit",editSeries:"Entire Series",editEvent:"Edit Event",createEvent:"Create",subject:"Subject",addTitle:"Add title",moreDetails:"More Details",moreEvents:"More Events",save:"Save",editContent:"How would you like to change the appointment in the series?",deleteContent:"Are you sure you want to delete this event?",deleteMultipleContent:"Are you sure you want to delete the selected events?",newEvent:"New Event",title:"Title",location:"Location",description:"Description",timezone:"Timezone",startTimezone:"Start Timezone",endTimezone:"End Timezone",repeat:"Repeat",saveButton:"Save",cancelButton:"Cancel",deleteButton:"Delete",recurrence:"Recurrence",wrongPattern:"The recurrence pattern is not valid.",seriesChangeAlert:"Do you want to cancel the changes made to specific instances of this series and match it to the whole series again?",createError:"The duration of the event must be shorter than how frequently it occurs. Shorten the duration, or change the recurrence pattern in the recurrence event editor.",sameDayAlert:"Two occurrences of the same event cannot occur on the same day.",occurenceAlert:"Cannot reschedule an occurrence of the recurring appointment if it skips over a later occurrence of the same appointment.",editRecurrence:"Edit Recurrence",recurringEvent:"Recurring Event",repeats:"Repeats",alert:"Alert",startEndError:"The selected end date occurs before the start date.",invalidDateError:"The entered date value is invalid.",blockAlert:"Events cannot be scheduled within the blocked time range.",overlapAlert:"Events cannot be scheduled during the chosen time as it overlaps with another event.",ok:"Ok",yes:"Yes",no:"No",of:"of",occurrence:"Occurrence",series:"Series",previous:"Previous",next:"Next",timelineDay:"Timeline Day",timelineWeek:"Timeline Week",timelineWorkWeek:"Timeline Work Week",timelineMonth:"Timeline Month",timelineYear:"Timeline Year",editFollowingEvent:"Following Events",deleteTitle:"Delete Event",editTitle:"Edit Event",beginFrom:"Begin From",endAt:"Ends At",expandAllDaySection:"Expand-all-day-section",collapseAllDaySection:"Collapse-all-day-section",searchTimezone:"Search Timezone",noRecords:"No records found"}},n.prototype.wireEvents=function(){e.EventHandler.add(window,"resize",this.onScheduleResize,this),e.EventHandler.add(window,"orientationchange",this.onScheduleResize,this),e.EventHandler.add(document,e.Browser.touchStartEvent,this.onDocumentClick,this),this.allowClipboard&&e.EventHandler.add(document,"paste",this.onDocumentPaste,this)},n.prototype.removeSelectedClass=function(){for(var t=this.getSelectedCells(),i=0,n=t;i<n.length;i++){n[i].removeAttribute("tabindex")}(0,e.removeClass)(t,Bt),this.keyboardInteractionModule&&this.keyboardInteractionModule.selectedCells.length>0&&(this.keyboardInteractionModule.selectedCells=[])},n.prototype.addSelectedClass=function(t,i,n){(0,e.addClass)(t,Bt),i&&(i.setAttribute("tabindex","0"),i.focus({preventScroll:n||!1}))},n.prototype.selectCell=function(e){this.removeSelectedClass(),this.addSelectedClass([e],e)},n.prototype.getAllDayRow=function(){return this.element.querySelector("."+Ze)},n.prototype.getContentTable=function(){return this.activeView.element.querySelector("."+Je+" tbody")},n.prototype.getTableRows=function(){return[].slice.call(this.element.querySelectorAll("."+Je+" tbody tr:not(."+Xn+")"))},n.prototype.getWorkCellElements=function(){return[].slice.call(this.element.querySelectorAll("."+$e))},n.prototype.getIndexOfDate=function(e,t){return e.map(Number).indexOf(+t)},n.prototype.isAllDayCell=function(e){return!(!(["Month","TimelineMonth","TimelineYear","MonthAgenda"].indexOf(this.currentView)>-1||e.classList.contains(Ke)||e.classList.contains(rt))&&this.activeViewOptions.timeScale.enable)||!!(this.activeView.isTimelineView()&&this.activeViewOptions.headerRows.length>0&&"Hour"!==this.activeViewOptions.headerRows.slice(-1)[0].option)},n.prototype.getDateFromElement=function(t){var i;if((0,e.isNullOrUndefined)(t)||(i=t.getAttribute("data-date")),!(0,e.isNullOrUndefined)(i)){var n=parseInt(i,10);return new Date(n)}},n.prototype.getTargetElement=function(e,t,i){var n,r=document.elementFromPoint(t,i);return r&&(n=r.closest(e)),n?[n]:null},n.prototype.getCellHeaderTemplate=function(){return this.cellHeaderTemplateFn},n.prototype.getDayHeaderTemplate=function(){return this.dayHeaderTemplateFn},n.prototype.getMonthHeaderTemplate=function(){return this.monthHeaderTemplateFn},n.prototype.getCellTemplate=function(){return this.cellTemplateFn},n.prototype.getDateHeaderTemplate=function(){return this.dateHeaderTemplateFn},n.prototype.getDateRangeTemplate=function(){return this.dateRangeTemplateFn},n.prototype.getMajorSlotTemplate=function(){return this.majorSlotTemplateFn},n.prototype.getMinorSlotTemplate=function(){return this.minorSlotTemplateFn},n.prototype.getAppointmentTemplate=function(){return this.appointmentTemplateFn},n.prototype.getEventTooltipTemplate=function(){return this.eventTooltipTemplateFn},n.prototype.getHeaderTooltipTemplate=function(){return this.headerTooltipTemplateFn},n.prototype.getEditorTemplate=function(){return this.editorTemplateFn},n.prototype.getEditorHeaderTemplate=function(){return this.editorHeaderTemplateFn},n.prototype.getEditorFooterTemplate=function(){return this.editorFooterTemplateFn},n.prototype.getQuickInfoTemplatesHeader=function(){return this.quickInfoTemplatesHeaderFn},n.prototype.getQuickInfoTemplatesContent=function(){return this.quickInfoTemplatesContentFn},n.prototype.getQuickInfoTemplatesFooter=function(){return this.quickInfoTemplatesFooterFn},n.prototype.getResourceHeaderTemplate=function(){return this.resourceHeaderTemplateFn},n.prototype.getHeaderIndentTemplate=function(){return this.headerIndentTemplateFn},n.prototype.getCssProperties=function(){return{border:this.enableRtl?"borderLeftWidth":"borderRightWidth",padding:this.enableRtl?"paddingLeft":"paddingRight",rtlBorder:this.enableRtl?"borderRightWidth":"borderLeftWidth",rtlPadding:this.enableRtl?"paddingRight":"paddingLeft"}},n.prototype.removeNewEventElement=function(){var t=this.element.querySelector("."+bi);(0,e.isNullOrUndefined)(t)||(0,e.remove)(t)},n.prototype.getStartEndTime=function(t){if(!(0,e.isNullOrUndefined)(t)&&""!==t){var i=ve(new Date(this.currentTimezoneDate)||this.getCurrentTime()),n=t.split(":");return 2===n.length&&i.setHours(parseInt(n[0],10),parseInt(n[1],10),0),i}return null},n.prototype.onDocumentClick=function(e){this.notify(Z,{event:e})},n.prototype.onDocumentPaste=function(e){this.notify(J,{event:e})},n.prototype.onScheduleResize=function(){if(!((0,e.isNullOrUndefined)(this.activeView)||(this.isAdaptive||He())&&document.activeElement&&(document.activeElement.classList.contains(Cn)||document.activeElement.classList.contains(dr))||this.uiStateValues.isTapHold))if(this.virtualScrollModule&&this.activeView.isTimelineView()&&this.virtualScrollModule.refreshLayout(),this.activeViewOptions.timeScale.enable&&this.activeView&&this.activeView.highlightCurrentTime(),this.quickPopup&&this.quickPopup.onClosePopup(),Ve(),"Month"===this.currentView||"Agenda"!==this.currentView&&"MonthAgenda"!==this.currentView&&!this.activeViewOptions.timeScale.enable||this.activeView.isTimelineView()){this.activeView.resetColWidth(),this.notify(Q,{cssProperties:this.getCssProperties(),isPreventScrollUpdate:!0});var t=!1;if(this.activeViewOptions.enableLazyLoading&&this.virtualScrollModule&&this.virtualScrollModule.isRemoteRefresh&&(t=this.virtualScrollModule.isRemoteRefresh,this.virtualScrollModule.isRemoteRefresh=!1),this.refreshEvents(t),this.virtualScrollModule&&!this.virtualScrollModule.enableTransition){var i=this.element.querySelector("."+yt),n=this.element.querySelector("."+ri);this.virtualScrollModule.enableTransition=!0,(0,e.addClass)([n,i],"e-transition")}}else this.notify(_,{})},n.prototype.templateParser=function(t){if(t)try{return"function"==typeof t?(0,e.compile)(t):document.querySelectorAll(t).length?(0,e.compile)(document.querySelector(t).innerHTML.trim()):(0,e.compile)(t)}catch(i){return(0,e.compile)(t)}},n.prototype.getSelectedCells=function(){return[].slice.call(this.element.querySelectorAll("."+Bt))},n.prototype.getAnnouncementString=function(e,t){var i;if(this.quickPopup&&this.activeViewOptions.group.resources.length>0){i=this.quickPopup.getResourceText({event:e},"event")+'"s event - '}var n=t||e[this.eventFields.subject]||this.eventSettings.fields.subject.default,r=e[this.eventFields.location]||this.eventSettings.fields.location.default,a="full",s=this.globalize.formatDate(e[this.eventFields.startTime],{type:"dateTime",skeleton:a,calendar:this.getCalendarMode()}),o=this.globalize.formatDate(e[this.eventFields.endTime],{type:"dateTime",skeleton:a,calendar:this.getCalendarMode()}),l=n+" "+this.localeObj.getConstant("beginFrom")+" "+s+" "+this.localeObj.getConstant("endAt")+" "+o;return i&&(l=i+" "+l),r&&""!==r&&(l=l+" "+this.localeObj.getConstant("location")+" "+r),e[this.eventFields.recurrenceRule]&&""!==e[this.eventFields.recurrenceRule]&&e[this.eventFields.id]===e[this.eventFields.recurrenceID]&&(l=l+" "+this.localeObj.getConstant("recurringEvent")),l},n.prototype.boundaryValidation=function(e,t){var i={left:!1,right:!1,top:!1,bottom:!1},n=this.element.querySelector("."+ri).getBoundingClientRect();return e<n.top+30+window.pageYOffset&&e>n.top+window.pageYOffset&&(i.top=!0),e>n.bottom-30+window.pageYOffset&&e<n.bottom+window.pageYOffset&&(i.bottom=!0),t<n.left+30+window.pageXOffset&&t>n.left+window.pageXOffset&&(i.left=!0),t>n.right-30+window.pageXOffset&&t<n.right+window.pageXOffset&&(i.right=!0),i},n.prototype.getWeekNumberContent=function(e){var t;if("FirstDay"===this.weekRule){var i=pe(e.slice(-1)[0],this.firstDayOfWeek);t=this.globalize.formatNumber(de(i))}else if("FirstFourDayWeek"===this.weekRule){var n=ue(r=le(e.slice(-1)[0],this.firstDayOfWeek),pe(e.slice(-1)[0],this.firstDayOfWeek));t=this.globalize.formatNumber(de(n))}else if("FirstFullWeek"===this.weekRule){var r=le(e.slice(-1)[0],this.firstDayOfWeek);t=this.globalize.formatNumber(de(r))}return t},n.prototype.renderHeaderIndentTemplate=function(t,i){if(this.activeViewOptions.headerIndentTemplate){var n=this.element.id+"_"+this.activeViewOptions.headerIndentTemplateName+"headerIndentTemplate",r=[].slice.call(this.getHeaderIndentTemplate()(t,this,"headerIndentTemplate",n,!1,void 0,void 0,this.root));(0,e.append)(r,i)}},n.prototype.isSpecificResourceEvents=function(){return this.activeViewOptions.group.resources.length>0&&!this.activeViewOptions.group.allowGroupEdit&&!this.rowAutoHeight&&!this.virtualScrollModule&&this.activeViewOptions.group.byGroupID},n.prototype.unWireEvents=function(){e.EventHandler.remove(window,"resize",this.onScheduleResize),e.EventHandler.remove(window,"orientationchange",this.onScheduleResize),e.EventHandler.remove(document,e.Browser.touchStartEvent,this.onDocumentClick),e.EventHandler.remove(document,"paste",this.onDocumentPaste)},n.prototype.getModuleName=function(){return"schedule"},n.prototype.getPersistData=function(){return this.addOnPersist(["currentView","selectedDate","scrollTop","scrollLeft","adaptiveGroupIndex"])},n.prototype.onPropertyChanged=function(t,i){if(!this.isReact||!(0,e.isNullOrUndefined)(this.activeView)){for(var n={isRefresh:!1,isResource:!1,isDate:!1,isView:!1,isLayout:!1,isDataManager:!1},r=0,a=Object.keys(t);r<a.length;r++){var s=a[r];switch(s){case"views":this.setViewOptions(),this.headerModule&&this.headerModule.updateItems(),n.isView=!0;break;case"currentView":n.isView=!0;break;case"minDate":case"maxDate":case"selectedDate":n.isDate=!0;break;case"dateFormat":this.activeViewOptions=this.getActiveViewOptions(),this.headerModule&&this.headerModule.updateDateRange();break;case"showHeaderBar":case"toolbarItems":this.destroyHeaderModule(),t.showHeaderBar&&(this.headerModule=new yr(this),this.headerModule.updateDateRange()),this.notify(Q,{cssProperties:this.getCssProperties()}),this.activeView.isTimelineView()&&this.refreshEvents(!1);break;case"workDays":JSON.stringify(i.workDays)!==JSON.stringify(t.workDays)&&(n.isLayout=!0);break;case"showWeekend":case"startHour":case"endHour":case"workHours":case"readonly":case"headerRows":case"showWeekNumber":case"rowAutoHeight":n.isLayout=!0;break;case"locale":case"calendarMode":this.globalize=new e.Internationalization(this.locale),this.localeObj=new e.L10n(this.getModuleName(),this.defaultLocale,this.locale),this.setCldrTimeFormat(),this.setCalendarMode(),n.isRefresh=!0;break;case"firstDayOfWeek":this.activeViewOptions.firstDayOfWeek=t.firstDayOfWeek,this.eventWindow&&this.eventWindow.refreshRecurrenceEditor(),n.isLayout=!0;break;case"showTimeIndicator":this.activeViewOptions.timeScale.enable&&this.activeView&&this.activeView.highlightCurrentTime();break;case"cellHeaderTemplate":this.activeViewOptions.cellHeaderTemplate=t.cellHeaderTemplate,this.cellHeaderTemplateFn=this.templateParser(this.activeViewOptions.cellHeaderTemplate),n.isLayout=!0;break;case"cellTemplate":this.activeViewOptions.cellTemplate=t.cellTemplate,this.cellTemplateFn=this.templateParser(this.activeViewOptions.cellTemplate),n.isLayout=!0;break;case"dateHeaderTemplate":this.activeViewOptions.dateHeaderTemplate=t.dateHeaderTemplate,this.dateHeaderTemplateFn=this.templateParser(this.activeViewOptions.dateHeaderTemplate),n.isLayout=!0;break;case"dateRangeTemplate":this.activeViewOptions.dateRangeTemplate=t.dateRangeTemplate,this.dateRangeTemplateFn=this.templateParser(this.activeViewOptions.dateRangeTemplate),this.headerModule&&this.headerModule.updateDateRange();break;case"dayHeaderTemplate":this.activeViewOptions.dayHeaderTemplate=t.dayHeaderTemplate,this.dayHeaderTemplateFn=this.templateParser(this.activeViewOptions.dayHeaderTemplate),n.isLayout=!0;break;case"monthHeaderTemplate":this.activeViewOptions.monthHeaderTemplate=t.monthHeaderTemplate,this.monthHeaderTemplateFn=this.templateParser(this.activeViewOptions.monthHeaderTemplate),n.isLayout=!0;break;case"resourceHeaderTemplate":this.activeViewOptions.resourceHeaderTemplate=t.resourceHeaderTemplate,this.resourceHeaderTemplateFn=this.templateParser(this.activeViewOptions.resourceHeaderTemplate),n.isLayout=!0;break;case"timezone":this.eventBase.timezonePropertyChange(i.timezone),this.headerModule&&this.headerModule.setCalendarTimezone();break;case"enableRtl":this.setRtlClass(),n.isRefresh=!0;break;default:this.extendedPropertyChange(s,t,i,n)}}this.propertyChangeAction(n)}},n.prototype.propertyChangeAction=function(t){t.isRefresh?this.refresh():t.isResource?this.initializeResources(!0):t.isView?this.changeView(this.currentView,null,!0):t.isDate?((0,e.isNullOrUndefined)(this.selectedDate)&&this.setProperties({selectedDate:this.getCurrentTime()},!0),this.changeDate(this.selectedDate)):t.isLayout?(this.activeCellsData=null,this.initializeView(this.currentView)):t.isDataManager&&this.crudModule&&(this.dragAndDropModule&&(this.dragAndDropModule.actionObj.action="",(0,e.removeClass)([this.element],Di)),this.crudModule.refreshDataManager())},n.prototype.allDayRowScrollUpdate=function(){var t=this.element.querySelector("."+it),i=this.element.querySelector("."+Ze);if("auto"!==this.height&&this.enableAllDayScroll)t.classList.contains(mr)&&(0,e.removeClass)([t],mr),this.eventBase.allDayExpandScroll(t);else if((0,e.addClass)([t],mr),t.classList.contains(vr)&&(0,e.removeClass)([t],vr),this.uiStateValues.expand){var n=[].slice.call(this.element.querySelectorAll("."+Ke));n[0].style.height=i.style.height?i.style.height:n[1].style.height}this.uiStateValues.expand||(i.style.height="")},n.prototype.extendedPropertyChange=function(t,i,n,r){switch(t){case"width":case"height":case"enableAllDayScroll":["Day","Week","WorkWeek"].indexOf(this.currentView)>-1&&this.allDayRowScrollUpdate(),this.notify(K,{module:"scroll",properties:{width:i.width,height:i.height}});break;case"cssClass":n.cssClass&&(0,e.removeClass)([this.element],n.cssClass.split(" ")),i.cssClass&&(0,e.addClass)([this.element],i.cssClass.split(" "));break;case"hideEmptyAgendaDays":case"agendaDaysCount":this.activeViewOptions=this.getActiveViewOptions(),r.isView=!0;break;case"eventSettings":this.onEventSettingsPropertyChanged(i.eventSettings,n.eventSettings,r);break;case"allowKeyboardInteraction":case"allowClipboard":this.keyboardInteractionModule&&(this.keyboardInteractionModule.destroy(),this.keyboardInteractionModule=null),(i.allowKeyboardInteraction||i.allowClipboard)&&(this.keyboardInteractionModule=new br(this));break;case"timezoneDataSource":this.eventWindow&&this.eventWindow.refresh();break;case"editorTemplate":(0,e.isNullOrUndefined)(this.editorTemplate)||(this.editorTemplateFn=this.templateParser(this.editorTemplate)),this.eventWindow&&this.eventWindow.setDialogContent();break;case"editorHeaderTemplate":(0,e.isNullOrUndefined)(this.editorHeaderTemplate)||(this.editorHeaderTemplateFn=this.templateParser(this.editorHeaderTemplate)),this.eventWindow&&this.eventWindow.setDialogHeader();break;case"editorFooterTemplate":(0,e.isNullOrUndefined)(this.editorFooterTemplate)||(this.editorFooterTemplateFn=this.templateParser(this.editorFooterTemplate)),this.eventWindow&&this.eventWindow.setDialogFooter();break;case"quickInfoTemplates":this.quickInfoTemplates.header&&(this.quickInfoTemplatesHeaderFn=this.templateParser(this.quickInfoTemplates.header)),this.quickInfoTemplates.content&&(this.quickInfoTemplatesContentFn=this.templateParser(this.quickInfoTemplates.content)),this.quickInfoTemplates.footer&&(this.quickInfoTemplatesFooterFn=this.templateParser(this.quickInfoTemplates.footer));break;case"group":this.onGroupSettingsPropertyChanged(i.group,n.group,r);break;case"resources":r.isResource=!0;break;case"timeScale":this.activeViewOptions.timeScale.interval=i.timeScale.interval||this.activeViewOptions.timeScale.interval,this.activeViewOptions.timeScale.slotCount=i.timeScale.slotCount||this.activeViewOptions.timeScale.slotCount,this.eventWindow&&this.eventWindow.refreshDateTimePicker(),r.isLayout=!0;break;case"allowDragAndDrop":case"allowResizing":case"eventDragArea":case"allowOverlap":this.refreshEvents(!1);break;case"weekRule":r.isLayout=!0;break;case"firstMonthOfYear":this.activeViewOptions.firstMonthOfYear=i.firstMonthOfYear,this.viewIndex=this.activeView.viewIndex,r.isLayout=!0;break;case"monthsCount":this.activeViewOptions.monthsCount=i.monthsCount,this.viewIndex=this.activeView.viewIndex,r.isLayout=!0;break;case"timeFormat":this.internalTimeFormat=i.timeFormat||this.activeViewOptions.timeFormat,this.eventWindow&&this.eventWindow.refreshDateTimePicker(),r.isLayout=!0;break;case"enableAdaptiveUI":this.showHeaderBar&&this.headerModule&&(this.destroyHeaderModule(),this.headerModule=new yr(this),this.headerModule.updateDateRange()),r.isLayout=!0;break;case"headerIndentTemplate":this.activeViewOptions.headerIndentTemplate=i.headerIndentTemplate,this.headerIndentTemplateFn=this.templateParser(this.activeViewOptions.headerIndentTemplate),r.isLayout=!0}},n.prototype.setRtlClass=function(){this.enableRtl?(0,e.addClass)([this.element],"e-rtl"):(0,e.removeClass)([this.element],"e-rtl")},n.prototype.onGroupSettingsPropertyChanged=function(e,t,i){for(var n=0,r=Object.keys(e);n<r.length;n++){"headerTooltipTemplate"===r[n]?this.headerTooltipTemplateFn=this.templateParser(e.headerTooltipTemplate):(i.isLayout=!0,this.eventWindow&&this.eventWindow.refresh())}},n.prototype.onEventSettingsPropertyChanged=function(e,t,i){for(var n=0,r=Object.keys(e);n<r.length;n++){switch(r[n]){case"dataSource":case"query":case"fields":case"includeFiltersInQuery":this.initializeDataModule(),i.isDataManager=!0;break;case"template":this.activeViewOptions.eventTemplate=e.template,this.appointmentTemplateFn=this.templateParser(this.activeViewOptions.eventTemplate),i.isDataManager=!0;break;case"enableTooltip":this.eventTooltip&&(this.eventTooltip.destroy(),this.eventTooltip=null),e.enableTooltip&&(this.eventTooltip=new Ua(this));break;case"tooltipTemplate":this.eventTooltipTemplateFn=this.templateParser(this.eventSettings.tooltipTemplate);break;case"resourceColorField":this.resourceBase&&this.resourceBase.setResourceCollection(),i.isDataManager=!0;break;case"editFollowingEvents":this.quickPopup&&this.quickPopup.refreshQuickDialog();break;case"allowAdding":case"allowEditing":case"allowDeleting":this.showHeaderBar&&this.headerModule&&this.headerModule.updateAddIcon(),this.eventWindow&&this.eventWindow.refresh();break;case"spannedEventPlacement":case"minimumEventDuration":case"enableMaxHeight":case"enableIndicator":this.refreshEvents(!1);break;case"ignoreWhitespace":i.isLayout=!0}}},n.prototype.destroyHeaderModule=function(){this.headerModule&&(this.headerModule.destroy(),this.headerModule=null)},n.prototype.destroyPopups=function(){this.quickPopup&&(this.quickPopup.destroy(),this.quickPopup=null),this.eventWindow&&(this.eventWindow.destroy(),this.eventWindow=null)},n.prototype.showSpinner=function(){(0,t.showSpinner)(this.element)},n.prototype.hideSpinner=function(){(0,t.hideSpinner)(this.element)},n.prototype.setWorkHours=function(t,i,n,r){var a;a=this.getWorkHourCells(t,i,n,r),(0,e.addClass)(a,et)},n.prototype.resetWorkHours=function(t,i,n,r){if(void 0===t&&(t=this.activeView.renderDates),t&&i&&n){var a=this.getWorkHourCells(t,i,n,r);(0,e.removeClass)(a,et)}else{var s=[].slice.call(this.element.querySelectorAll("."+et));(0,e.removeClass)(s,et)}},n.prototype.getWorkHourCells=function(t,i,n,r){if(["Agenda","MonthAgenda","Month","TimelineMonth"].indexOf(this.currentView)>-1)return[];var a=this.getStartEndTime(i),s=this.getStartEndTime(n),o=this.getContentTable();if((0,e.isNullOrUndefined)(a)||(0,e.isNullOrUndefined)(s)||!o)return[];a.setMilliseconds(0),s.setMilliseconds(0);var l=this.activeView.getStartHour();a<l&&(a=l);var p=this.activeView.getEndHour();s>p&&(s=p);for(var c=this.activeViewOptions.timeScale.interval*ne/this.activeViewOptions.timeScale.slotCount,h=(l.getTimezoneOffset()-a.getTimezoneOffset())*ne,d=Math.abs((l.getTimezoneOffset()-s.getTimezoneOffset())*ne),u=Math.round((a.getTime()-l.getTime()+h)/c),g=Math.ceil((s.getTime()-l.getTime()-d)/c),v=u,m=g,f=[],y=0,T=t;y<T.length;y++){var w=T[y];ve(w=this.getDateTime(w));var D=this.activeView.renderDates;(0,e.isNullOrUndefined)(r)||!this.resourceBase||this.activeView.isTimelineView()||(D=this.resourceBase.lastResourceLevel[parseInt(r.toString(),10)].renderDates);var b=this.getIndexOfDate(D,w);if(b>=0){if(this.activeView.isTimelineView()){var S=Math.round((p.getTime()-l.getTime())/c);u=v+b*S,g=m+b*S}for(var C=u;C<g;C++)if(this.activeView.isTimelineView()){var O=(0,e.isNullOrUndefined)(r)?0:r;f.push(o.rows[parseInt(O.toString(),10)].cells[parseInt(C.toString(),10)])}else if((0,e.isNullOrUndefined)(r))f.push(o.rows[parseInt(C.toString(),10)].cells[parseInt(b.toString(),10)]);else{var E="."+$e+'[data-group-index="'+r+'"]',x=[].slice.call(o.rows[parseInt(C.toString(),10)].querySelectorAll(E));f.push(x[parseInt(b.toString(),10)])}}}return f},n.prototype.getCellDetails=function(t){var i=t instanceof Array?t:[t],n=(0,e.getElement)(i[0]),r=(0,e.getElement)(i.slice(-1)[0]),a=this.getDateFromElement(n),s=this.getDateFromElement(r);if(!(0,e.isNullOrUndefined)(a)&&!(0,e.isNullOrUndefined)(s)){var o=this.activeView.isTimelineView()&&!(0,e.isNullOrUndefined)(r.getAttribute("colSpan"))&&this.headerRows.length>0,l=o?parseInt(r.getAttribute("colSpan"),10):1,p={startTime:a,endTime:s=!this.activeViewOptions.timeScale.enable||o||r.classList.contains(Ke)||r.classList.contains(rt)?ye(new Date(s.getTime()),l):this.activeView.getEndDateFromStartDate(s),isAllDay:this.isAllDayCell(n),element:t},c=n.getAttribute("data-group-index");return(0,e.isNullOrUndefined)(c)||(p.groupIndex=parseInt(c,10)),p}},n.prototype.getSelectedElements=function(){return this.keyboardInteractionModule&&this.keyboardInteractionModule.selectedCells.length>0?this.keyboardInteractionModule.selectedCells:this.getSelectedCells()},n.prototype.getResourceCollections=function(){return this.resourceCollection},n.prototype.setResourceCollections=function(e,t){void 0===t&&(t=!0),!t&&this.uiStateValues&&(this.uiStateValues.isPreventEventRefresh=!0),this.setProperties({resources:e},!1)},n.prototype.changeCurrentView=function(e,t){var i=this.getViewIndex(e),n=e.charAt(0).toLowerCase()+e.slice(1),r=this.viewOptions[""+n];r&&(i=this.viewCollections.indexOf(r[t||0])),-1!==i&&i!==this.viewIndex&&this.changeView(e,null,null,i)},n.prototype.getCurrentViewIndex=function(){return this.viewIndex},n.prototype.getResourcesByIndex=function(e){if(this.resourceBase&&this.resourceBase.lastResourceLevel){if(e<0||e>=this.resourceBase.lastResourceLevel.length)return;var t=this.resourceBase.lastResourceLevel[parseInt(e.toString(),10)],i={};return this.resourceBase.setResourceValues(i,e),{resource:t.resource,resourceData:t.resourceData,groupData:i}}},n.prototype.expandResource=function(e,t){this.activeView.isTimelineView()&&this.resourceBase&&this.resourceCollection.length>1&&this.resourceBase.resourceExpand(e,t,!1)},n.prototype.collapseResource=function(e,t){this.activeView.isTimelineView()&&this.resourceBase&&this.resourceCollection.length>1&&this.resourceBase.resourceExpand(e,t,!0)},n.prototype.scrollTo=function(t,i){this.currentView.indexOf("Agenda")<0&&(0,e.isNullOrUndefined)(this.element.querySelector(".e-work-cells"))||(this.activeView.scrollToDate&&(0,e.isNullOrUndefined)(t)&&i?this.activeView.scrollToDate(i):this.activeView.scrollToHour&&this.activeView.scrollToHour(t,i))},n.prototype.scrollToResource=function(e,t){this.resourceBase&&this.resourceBase.lastResourceLevel&&this.resourceBase.resourceScroll(e,t)},n.prototype.exportToICalendar=function(e,t){if(!this.iCalendarExportModule)throw console.warn('[WARNING] :: Module "ICalendarExport" is not available in Schedule component! You either misspelled the module name or forgot to load it.'),Error("Inject ICalendarExport module");this.iCalendarExportModule.initializeCalendarExport(e,t)},n.prototype.importICalendar=function(e){if(!this.iCalendarImportModule)throw console.warn('[WARNING] :: Module "ICalendarImport" is not available in Schedule component! You either misspelled the module name or forgot to load it.'),Error("Inject ICalendarImport module");this.iCalendarImportModule.initializeCalendarImport(e)},n.prototype.addEvent=function(e){this.crudModule.addEvent(e)},n.prototype.generateEventOccurrences=function(e,t){return this.eventBase?this.eventBase.generateOccurrence(e,t):[]},n.prototype.exportToExcel=function(e){if(!this.excelExportModule)throw console.warn('[WARNING] :: Module "ExcelExport" is not available in Schedule component! You either misspelled the module name or forgot to load it.'),Error("Inject ExcelExport module");this.excelExportModule.initializeExcelExport(e)},n.prototype.print=function(e){if(!this.printModule)throw console.warn('[WARNING] :: Module "Print" is not available in Schedule component! You either misspelled the module name or forgot to load it.'),Error("Inject Print module");this.printModule.print(e)},n.prototype.saveEvent=function(e,t){this.crudModule.saveEvent(e,t)},n.prototype.deleteEvent=function(e,t){this.crudModule.deleteEvent(e,t)},n.prototype.getEvents=function(e,t,i){var n=[];return n=i?this.eventBase.getProcessedEvents():this.eventsData,e&&(e=this.getDateTime(e)),t&&(t=this.getDateTime(t)),n=this.eventBase.filterEventsByRange(n,e,t)},n.prototype.getBlockEvents=function(e,t,i){var n=[];return n=i?this.eventBase.getProcessedEvents(this.blockData):this.blockData,e&&(e=this.getDateTime(e)),t&&(t=this.getDateTime(t)),n=this.eventBase.filterEventsByRange(n,e,t)},n.prototype.getOccurrencesByID=function(e){return this.eventBase.getOccurrencesByID(e)},n.prototype.getOccurrencesByRange=function(e,t){return e=this.getDateTime(e),t=this.getDateTime(t),this.eventBase.getOccurrencesByRange(e,t)},n.prototype.getCurrentViewDates=function(){return this.activeView?this.activeView.renderDates:[]},n.prototype.setRecurrenceEditor=function(e){this.eventWindow.setRecurrenceEditor(e)},n.prototype.getEventMaxID=function(){return this.eventBase.getEventMaxID()},n.prototype.getDeletedOccurrences=function(e){return this.eventBase.getDeletedOccurrences(e)},n.prototype.getCurrentViewEvents=function(){return this.eventsProcessed},n.prototype.refreshEvents=function(t){void 0===t&&(t=!0),t?(this.dragAndDropModule&&(this.dragAndDropModule.actionObj.action="",(0,e.removeClass)([this.element],Di)),this.crudModule.refreshDataManager()):(this.uiStateValues&&(this.uiStateValues.isPreventTimezone=!0),this.crudModule&&this.crudModule.refreshProcessedData(),this.uiStateValues&&(this.uiStateValues.isPreventTimezone=!1))},n.prototype.refreshTemplates=function(e){switch(e?this.resetTemplates([e]):this.resetTemplates(),e){case"eventTemplate":this.appointmentTemplateFn=this.templateParser(this.activeViewOptions.eventTemplate),this.refreshEvents(!1);break;case"dateHeaderTemplate":this.dateHeaderTemplateFn=this.templateParser(this.activeViewOptions.dateHeaderTemplate),this.activeView.refreshHeader();break;case"dateRangeTemplate":this.dateRangeTemplateFn=this.templateParser(this.activeViewOptions.dateRangeTemplate),this.headerModule&&this.headerModule.refresh();break;case"resourceHeaderTemplate":this.resourceHeaderTemplateFn=this.templateParser(this.activeViewOptions.resourceHeaderTemplate),this.activeView.isTimelineView()?this.activeView.refreshResourceHeader():this.activeView.refreshHeader();break;case"quickInfoTemplates":this.quickPopup&&(this.quickPopup.destroy(),this.quickPopup=null),this.quickPopup=new Fa(this),this.quickInfoTemplatesHeaderFn=this.templateParser(this.quickInfoTemplates.header),this.quickInfoTemplatesContentFn=this.templateParser(this.quickInfoTemplates.content),this.quickInfoTemplatesFooterFn=this.templateParser(this.quickInfoTemplates.footer);break;case"editorTemplate":this.destroyEditorWindow(),this.editorTemplateFn=this.templateParser(this.editorTemplate);break;case"editorHeaderTemplate":this.destroyEditorWindow(),this.editorHeaderTemplateFn=this.templateParser(this.editorHeaderTemplate);break;case"editorFooterTemplate":this.destroyEditorWindow(),this.editorFooterTemplateFn=this.templateParser(this.editorFooterTemplate);break;case"tooltipTemplate":case"headerTooltipTemplate":this.eventTooltip&&(this.eventTooltip.destroy(),this.eventTooltip=null),this.eventTooltip=new Ua(this),this.eventTooltipTemplateFn=this.templateParser(this.eventSettings.tooltipTemplate),this.headerTooltipTemplateFn=this.templateParser(this.activeViewOptions.group.headerTooltipTemplate);break;default:this.initializeView(this.currentView)}},n.prototype.refreshLayout=function(){this.onScheduleResize(),this.headerModule&&this.headerModule.refresh(),this.eventWindow&&this.eventWindow.refresh()},n.prototype.getEventDetails=function(t){var i=(t=(0,e.getElement)(t)).getAttribute("data-guid");return i?this.eventBase.getEventByGuid(i):{}},n.prototype.isSlotAvailable=function(t,i,n){var r,a,s=this,o=this.activeEventData.event;if(t instanceof Date||"string"==typeof t?(r=t,a=i):(o=t,r=t[this.eventFields.startTime],a=t[this.eventFields.endTime],this.resourceBase&&(n=this.eventBase.getGroupIndexFromEvent(t))),(0,e.isNullOrUndefined)(r)||(0,e.isNullOrUndefined)(a))return!0;r=this.getDateTime(r),a=this.getDateTime(a);var l=this.eventBase.filterEvents(r,a);return!(0,e.isNullOrUndefined)(n)&&this.resourceBase&&this.resourceBase.lastResourceLevel.length>0&&(l=this.eventBase.filterEventsByResource(this.resourceBase.lastResourceLevel[parseInt(n.toString(),10)],l)),o&&(l=o.Guid?l.filter((function(e){return e.Guid!==o.Guid})):l.filter((function(e){return e[s.eventFields.id]!==o[s.eventFields.id]}))),!(l.length>0)},n.prototype.copy=function(e){this.processCutCopyActions(e,!1)},n.prototype.cut=function(e){this.processCutCopyActions(e,!0)},n.prototype.paste=function(t){var i=this;if(this.allowClipboard&&this.allowKeyboardInteraction&&(t.classList.contains("e-work-cells")||t.classList.contains("e-all-day-cells"))){var n=new DataTransfer;(0,e.isNullOrUndefined)(navigator.clipboard)||navigator.clipboard.readText().then((function(e){n.setData("text/plain",e);var r=new ClipboardEvent("paste",{bubbles:!0,cancelable:!0});Object.defineProperty(r,"clipboardData",{value:n}),i.keyboardInteractionModule.pasteHandler(r,t)})).catch((function(e){throw e}))}},n.prototype.processCutCopyActions=function(e,t){var i=this;if(e&&this.allowClipboard&&this.allowKeyboardInteraction){var n=[];e.forEach((function(e){if(e.classList.contains(Xt)){var t=i.getEventDetails(e);t&&n.push(t)}})),n.length>0&&this.keyboardInteractionModule.processClipboardAction(t,n)}},n.prototype.openEditor=function(t,i,n,r){"Add"!==i||n?(t[this.eventFields.startTime]=this.getDateTime(t[this.eventFields.startTime]),t[this.eventFields.endTime]=this.getDateTime(t[this.eventFields.endTime])):(t.startTime=this.getDateTime(t.startTime),t.endTime=this.getDateTime(t.endTime),(0,e.isNullOrUndefined)(t.element)||(t.element=(0,e.getElement)(t.element))),this.currentAction=i,"Add"!==i&&(this.activeEventData.event=t),this.eventWindow.openEditor(t,i,n,r)},n.prototype.closeEditor=function(){this.eventWindow&&this.eventWindow.dialogClose()},n.prototype.openQuickInfoPopup=function(t){var i=this;if("Year"!==this.currentView&&!(0,e.isNullOrUndefined)(t))if((0,e.isNullOrUndefined)(t[this.eventFields.id])){if("Agenda"===this.currentView||"MonthAgenda"===this.currentView||(0,e.isNullOrUndefined)(this.activeView))return;var n={startTime:this.activeCellsData.startTime=this.getDateTime(t[this.eventFields.startTime]),endTime:this.activeCellsData.endTime=this.getDateTime(t[this.eventFields.endTime]),isAllDay:this.activeCellsData.isAllDay=!(0,e.isNullOrUndefined)(t[this.eventFields.isAllDay])&&t[this.eventFields.isAllDay]},a=this.activeView.getAdjustedDate(new Date(n.startTime));if(a){var s="."+$e+'[data-date="'+a.getTime()+'"]';this.activeViewOptions.group.resources.length>0&&!this.uiStateValues.isGroupAdaptive&&this.resourceBase&&this.eventBase&&(n.groupIndex=this.eventBase.getGroupIndexFromEvent(t),s="."+$e+'[data-date="'+a.getTime()+'"][data-group-index="'+n.groupIndex+'"]');var o=this.element.querySelector(s);o&&(o.focus(),n.element=o,this.notify(r,n))}}else{var l=this.getCurrentViewEvents().filter((function(e){return t[i.eventFields.id]===e[i.eventFields.id]}));if(l.length<=0)return;var p=l[0];if(t[this.eventFields.recurrenceRule]){var c=l.filter((function(e){return e[i.eventFields.startTime].getTime()===t[i.eventFields.startTime].getTime()}));c.length>0&&(p=c[0])}var h=this.element.querySelector('div[data-guid="'+p.Guid+'"]');h&&(this.eventBase.removeSelectedAppointmentClass(),this.eventBase.addSelectedAppointments([h],!1),this.activeEventData={event:p,element:h},"Agenda"!==this.currentView&&"MonthAgenda"!==this.currentView||(0,e.addClass)([this.activeEventData.element],li),this.notify(m,this.activeEventData))}},n.prototype.closeQuickInfoPopup=function(){this.quickPopup&&this.quickPopup.quickPopupHide(!0)},n.prototype.openOverlapAlert=function(e){var t=this;if(this.quickPopup){var i={type:"OverlapAlert",cancel:!1,element:this.quickPopup.quickDialog.element,data:e.data,overlapEvents:e.overlapEvents};this.trigger(D,i,(function(i){i.cancel||t.quickPopup.openValidationError("overlapAlert",e.data)}))}},n.prototype.closeOverlapAlert=function(){var e=this;if(this.quickPopup){var t={type:"OverlapAlert",cancel:!1,data:this.activeEventData.event,element:this.quickPopup.quickDialog.element};this.trigger(b,t,(function(t){t.cancel||e.quickPopup.quickDialog.hide()}))}},n.prototype.closeTooltip=function(){this.eventTooltip&&this.eventTooltip.close()},n.prototype.getDateRangeText=function(t){return(0,e.isNullOrUndefined)(t)&&0===t.length||!this.activeView?"":this.activeView.getDateRangeText(t[0],t)},n.prototype.getViewDates=function(e){if(void 0===e&&(e="Current"),!this.activeView)return[];switch(e){case"Previous":case"Next":return this.activeView.getRenderDates(void 0,this.activeView.getNextPreviousDate(e));case"Current":return this.getCurrentViewDates()}},n.prototype.selectResourceByIndex=function(e){this.resourceBase&&this.uiStateValues.isGroupAdaptive&&this.resourceBase.selectResourceByIndex(e)},n.prototype.getIndexFromResourceId=function(e,t){return this.resourceBase?this.resourceBase.getIndexFromResourceId(e,t):null},n.prototype.addResource=function(e,t,i){this.resourceBase.addResource(e,t,i)},n.prototype.removeResource=function(e,t){this.resourceBase.removeResource(e,t)},n.prototype.destroy=function(){this.eventTooltip&&(this.eventTooltip.destroy(),this.eventTooltip=null),this.destroyPopups(),this.hideSpinner(),this.unWireEvents(),this.destroyHeaderModule(),this.eventBase&&(this.eventBase.destroy(),this.eventBase=null),this.workCellAction&&(this.workCellAction.destroy(),this.workCellAction=null),this.inlineModule&&(this.inlineModule.destroy(),this.inlineModule=null),this.keyboardInteractionModule&&(this.keyboardInteractionModule.destroy(),this.keyboardInteractionModule=null),this.scrollModule&&(this.scrollModule.destroy(),this.scrollModule=null),this.printModule&&this.printModule.destroy(),this.activeView&&(this.resetTemplates(),this.activeView.removeEventListener(),this.activeView.destroy(),this.activeView=null),this.scheduleTouchModule&&(this.scheduleTouchModule.destroy(),this.scheduleTouchModule=null),this.crudModule&&(this.crudModule.destroy(),this.crudModule=null),this.dataModule&&(this.dataModule.destroy(),this.dataModule=null),i.prototype.destroy.call(this);for(var t=0,n=["dayModule","weekModule","workWeekModule","monthModule","monthAgendaModule","yearModule","agendaModule","timelineViewsModule","timelineMonthModule","timelineYearModule","resizeModule","dragAndDropModule","excelExportModule","printModule","iCalendarExportModule","iCalendarImportModule","tzModule","eventsData","eventsProcessed","blockData","blockProcessed","uiStateValues","viewCollections","viewOptions","defaultLocale","localeObj","selectedElements","resourceCollection","editorTitles","eventFields","activeViewOptions","activeEventData","activeCellsData","renderModule"];t<n.length;t++){this[""+n[t]]=null}Me(this.element);var r=[Fe,Ue,Be,ze];this.cssClass&&(r=r.concat(this.cssClass.split(" "))),(0,e.removeClass)([this.element],r)},zo([(0,e.Property)("auto")],n.prototype,"width",void 0),zo([(0,e.Property)("auto")],n.prototype,"height",void 0),zo([(0,e.Property)(!0)],n.prototype,"showHeaderBar",void 0),zo([(0,e.Property)(!0)],n.prototype,"showTimeIndicator",void 0),zo([(0,e.Property)(!0)],n.prototype,"allowSwiping",void 0),zo([(0,e.Property)(!0)],n.prototype,"allowOverlap",void 0),zo([(0,e.Property)(3)],n.prototype,"overscanCount",void 0),zo([(0,e.Collection)([],Bo)],n.prototype,"toolbarItems",void 0),zo([(0,e.Property)("Week")],n.prototype,"currentView",void 0),zo([(0,e.Property)(["Day","Week","WorkWeek","Month","Agenda"])],n.prototype,"views",void 0),zo([(0,e.Property)(new Date)],n.prototype,"selectedDate",void 0),zo([(0,e.Property)(new Date(1900,0,1))],n.prototype,"minDate",void 0),zo([(0,e.Property)(new Date(2099,11,31))],n.prototype,"maxDate",void 0),zo([(0,e.Property)()],n.prototype,"dateFormat",void 0),zo([(0,e.Property)("Gregorian")],n.prototype,"calendarMode",void 0),zo([(0,e.Property)(!0)],n.prototype,"showWeekend",void 0),zo([(0,e.Property)(0)],n.prototype,"firstDayOfWeek",void 0),zo([(0,e.Property)("FirstDay")],n.prototype,"weekRule",void 0),zo([(0,e.Property)([1,2,3,4,5])],n.prototype,"workDays",void 0),zo([(0,e.Property)(12)],n.prototype,"monthsCount",void 0),zo([(0,e.Property)("00:00")],n.prototype,"startHour",void 0),zo([(0,e.Property)("24:00")],n.prototype,"endHour",void 0),zo([(0,e.Property)(null)],n.prototype,"timeFormat",void 0),zo([(0,e.Property)(!0)],n.prototype,"enableHtmlSanitizer",void 0),zo([(0,e.Property)(!1)],n.prototype,"enableAllDayScroll",void 0),zo([(0,e.Property)(!1)],n.prototype,"enableAdaptiveUI",void 0),zo([(0,e.Property)(!0)],n.prototype,"allowResizing",void 0),zo([(0,e.Complex)({},ho)],n.prototype,"workHours",void 0),zo([(0,e.Complex)({},vo)],n.prototype,"timeScale",void 0),zo([(0,e.Property)(!0)],n.prototype,"allowKeyboardInteraction",void 0),zo([(0,e.Property)(!0)],n.prototype,"allowDragAndDrop",void 0),zo([(0,e.Property)()],n.prototype,"dateHeaderTemplate",void 0),zo([(0,e.Property)()],n.prototype,"dateRangeTemplate",void 0),zo([(0,e.Property)()],n.prototype,"cellHeaderTemplate",void 0),zo([(0,e.Property)()],n.prototype,"dayHeaderTemplate",void 0),zo([(0,e.Property)()],n.prototype,"monthHeaderTemplate",void 0),zo([(0,e.Property)()],n.prototype,"cellTemplate",void 0),zo([(0,e.Property)(!1)],n.prototype,"readonly",void 0),zo([(0,e.Property)(!0)],n.prototype,"showQuickInfo",void 0),zo([(0,e.Property)(!1)],n.prototype,"allowInline",void 0),zo([(0,e.Property)(!0)],n.prototype,"allowMultiCellSelection",void 0),zo([(0,e.Property)(!0)],n.prototype,"allowMultiRowSelection",void 0),zo([(0,e.Property)(!1)],n.prototype,"quickInfoOnSelectionEnd",void 0),zo([(0,e.Property)(!1)],n.prototype,"showWeekNumber",void 0),zo([(0,e.Property)(!1)],n.prototype,"rowAutoHeight",void 0),zo([(0,e.Property)(!1)],n.prototype,"allowMultiDrag",void 0),zo([(0,e.Property)(0)],n.prototype,"firstMonthOfYear",void 0),zo([(0,e.Property)()],n.prototype,"editorTemplate",void 0),zo([(0,e.Property)()],n.prototype,"editorHeaderTemplate",void 0),zo([(0,e.Property)()],n.prototype,"editorFooterTemplate",void 0),zo([(0,e.Complex)({},yo)],n.prototype,"quickInfoTemplates",void 0),zo([(0,e.Property)(7)],n.prototype,"agendaDaysCount",void 0),zo([(0,e.Property)(!0)],n.prototype,"hideEmptyAgendaDays",void 0),zo([(0,e.Property)(!0)],n.prototype,"enableRecurrenceValidation",void 0),zo([(0,e.Property)()],n.prototype,"timezone",void 0),zo([(0,e.Complex)({},ko)],n.prototype,"eventSettings",void 0),zo([(0,e.Property)(Vr)],n.prototype,"timezoneDataSource",void 0),zo([(0,e.Property)()],n.prototype,"resourceHeaderTemplate",void 0),zo([(0,e.Property)()],n.prototype,"headerIndentTemplate",void 0),zo([(0,e.Complex)({},Po)],n.prototype,"group",void 0),zo([(0,e.Collection)([],Lo)],n.prototype,"resources",void 0),zo([(0,e.Collection)([],Do)],n.prototype,"headerRows",void 0),zo([(0,e.Property)()],n.prototype,"cssClass",void 0),zo([(0,e.Property)(!1)],n.prototype,"allowClipboard",void 0),zo([(0,e.Property)()],n.prototype,"eventDragArea",void 0),zo([(0,e.Event)()],n.prototype,"created",void 0),zo([(0,e.Event)()],n.prototype,"destroyed",void 0),zo([(0,e.Event)()],n.prototype,"cellClick",void 0),zo([(0,e.Event)()],n.prototype,"cellDoubleClick",void 0),zo([(0,e.Event)()],n.prototype,"moreEventsClick",void 0),zo([(0,e.Event)()],n.prototype,"hover",void 0),zo([(0,e.Event)()],n.prototype,"select",void 0),zo([(0,e.Event)()],n.prototype,"actionBegin",void 0),zo([(0,e.Event)()],n.prototype,"actionComplete",void 0),zo([(0,e.Event)()],n.prototype,"actionFailure",void 0),zo([(0,e.Event)()],n.prototype,"navigating",void 0),zo([(0,e.Event)()],n.prototype,"renderCell",void 0),zo([(0,e.Event)()],n.prototype,"eventClick",void 0),zo([(0,e.Event)()],n.prototype,"eventDoubleClick",void 0),zo([(0,e.Event)()],n.prototype,"eventRendered",void 0),zo([(0,e.Event)()],n.prototype,"dataBinding",void 0),zo([(0,e.Event)()],n.prototype,"popupOpen",void 0),zo([(0,e.Event)()],n.prototype,"popupClose",void 0),zo([(0,e.Event)()],n.prototype,"dragStart",void 0),zo([(0,e.Event)()],n.prototype,"drag",void 0),zo([(0,e.Event)()],n.prototype,"dragStop",void 0),zo([(0,e.Event)()],n.prototype,"resizeStart",void 0),zo([(0,e.Event)()],n.prototype,"resizing",void 0),zo([(0,e.Event)()],n.prototype,"resizeStop",void 0),zo([(0,e.Event)()],n.prototype,"virtualScrollStart",void 0),zo([(0,e.Event)()],n.prototype,"virtualScrollStop",void 0),zo([(0,e.Event)()],n.prototype,"dataBound",void 0),zo([(0,e.Event)()],n.prototype,"beforePaste",void 0),zo([(0,e.Event)()],n.prototype,"beforePrint",void 0),zo([(0,e.Event)()],n.prototype,"excelExport",void 0),zo([(0,e.Event)()],n.prototype,"tooltipOpen",void 0),n=zo([e.NotifyPropertyChanges],n)}(e.Component),_o=function(){function t(e){this.daysVariation=0,this.parent=e,this.actionObj={X:0,Y:0,groupIndex:0,cellWidth:0,cellHeight:0,slotInterval:0,interval:0,actionIndex:0,cloneElement:[],originalElement:[],action:null,isAllDay:null,excludeSelectors:null,index:0,navigationInterval:null,scrollInterval:null},this.scrollArgs={element:null,width:0,height:0},this.resizeEdges={left:!1,right:!1,top:!1,bottom:!1},this.scrollEdges={left:!1,right:!1,top:!1,bottom:!1}}return t.prototype.getChangedData=function(t){var i=this,n=(0,e.extend)({},this.actionObj.event,null,!0);if(n[this.parent.eventFields.startTime]=this.actionObj.start,n[this.parent.eventFields.endTime]=this.actionObj.end,(0,e.isNullOrUndefined)(this.actionObj.isAllDay)||(n[this.parent.eventFields.isAllDay]=this.actionObj.isAllDay),this.parent.activeViewOptions.group.resources.length>0){var r=this.getOriginalElement(this.actionObj.element);if(r){var a=r.map((function(e){return parseInt(e.getAttribute("data-group-index"),10)}));if(-1===a.indexOf(this.actionObj.groupIndex)||!(0,e.isNullOrUndefined)(t)&&t.length>0){var s=parseInt(this.actionObj.clone.getAttribute("data-group-index"),10);(a=a.filter((function(e){return e!==s}))).push(this.actionObj.groupIndex),t&&t.length>0?t.forEach((function(e){i.parent.resourceBase.getResourceData(e,i.actionObj.groupIndex,a)})):this.parent.resourceBase.getResourceData(n,this.actionObj.groupIndex,a)}}}return n},t.prototype.saveChangedData=function(e,t){var i;void 0===t&&(t=!1),this.parent.activeEventData.event=this.actionObj.event,this.parent.currentAction="Save";var n=[e.data];t&&(n=e.selectedData);for(var r=0,a=n;r<a.length;r++){var s=a[r],o=!(this.parent.activeViewOptions.group.resources.length>0)||parseInt(this.actionObj.element.getAttribute("data-group-index"),10)===this.actionObj.groupIndex;if(+s[this.parent.eventFields.startTime]==+this.actionObj.event[this.parent.eventFields.startTime]&&+s[this.parent.eventFields.endTime]==+this.actionObj.event[this.parent.eventFields.endTime]&&o)return void(this.parent.crudModule.crudObj.isCrudAction=!1);if(s[this.parent.eventFields.recurrenceRule]){var l=s[this.parent.eventFields.recurrenceID]||s[this.parent.eventFields.id];if(s[this.parent.eventFields.id]===s[this.parent.eventFields.recurrenceID]&&(s[this.parent.eventFields.id]=this.parent.eventBase.getEventMaxID(),i="EditOccurrence"),this.parent.enableRecurrenceValidation&&this.parent.eventWindow.editOccurrenceValidation(l,s,this.actionObj.event))return}else i=null;(s[this.parent.eventFields.startTimezone]||s[this.parent.eventFields.endTimezone])&&this.parent.eventBase.timezoneConvert(s),this.parent.crudModule.saveEvent(s,i)}},t.prototype.calculateIntervalTime=function(e){var t=ve(e).getTime(),i=this.parent.activeView.getStartHour(),n=ne*this.actionObj.interval;return t+=(60*i.getHours()+i.getMinutes())*ne+1e3*i.getSeconds(),t+=Math.floor((e.getTime()-t)/n)*n,new Date(t)},t.prototype.getContentAreaDimension=function(){var e=this.parent.element.querySelector("."+ri),t=[].slice.call(e.querySelector("tr").children);this.parent.activeView.isTimelineView()||!(this.parent.activeViewOptions.group.resources.length>0)||this.parent.isAdaptive||this.parent.enableAdaptiveUI||this.parent.virtualScrollModule||(t=this.getResourceElements(t));var i=t[0].getBoundingClientRect(),n=t.slice(-1)[0].getBoundingClientRect();return{bottom:e.scrollHeight-5,left:this.parent.enableRtl?n.left:i.left,right:this.parent.enableRtl?i.right:n.right,top:0,leftOffset:this.parent.enableRtl?n.right:i.right,rightOffset:this.parent.enableRtl?i.left:n.left}},t.prototype.getIndex=function(e){var t=[].slice.call(this.parent.getContentTable().querySelector("tr").children),i={minIndex:0,maxIndex:t.length-1};if("resize"===this.actionObj.action&&this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&!this.parent.activeView.isTimelineView()){var n=this.getResourceElements(t);i.minIndex=n[0].cellIndex,i.maxIndex=n.slice(-1)[0].cellIndex}return e<i.minIndex&&(e=i.minIndex),e>i.maxIndex&&(e=i.maxIndex),e},t.prototype.updateTimePosition=function(t,i){for(var n=0,r=0,a=this.actionObj.cloneElement;r<a.length;r++){var s=a[r].querySelector("."+ti);if(s){var o=this.actionObj.start,l=this.actionObj.end;i&&i.length>0&&(o=i[parseInt(n.toString(),10)][this.parent.eventFields.startTime],l=i[parseInt(n.toString(),10)][this.parent.eventFields.endTime]),s.innerHTML=this.parent.getTimeString(o)+" - "+this.parent.getTimeString(l)}n++}if(this.parent.activeViewOptions.timeScale.enable&&this.parent.isAdaptive&&"Month"!==this.parent.currentView&&"TimelineMonth"!==this.parent.currentView){var p=this.parent.element.querySelector("."+Ci);if(!p){p=(0,e.createElement)("div",{className:Ci});var c=this.parent.activeView.isTimelineView()?it:Et;this.parent.element.querySelector("."+c).appendChild(p)}p.innerHTML=this.parent.getTimeString(t);var h=0;if(this.parent.activeView.isTimelineView())if(this.parent.enableRtl){var d=parseInt(this.actionObj.clone.style.right,10);h="drag"===this.actionObj.action||this.resizeEdges.left?d+this.actionObj.clone.offsetWidth:d,p.style.right=(0,e.formatUnit)(h)}else{var u=parseInt(this.actionObj.clone.style.left,10);h="drag"===this.actionObj.action||this.resizeEdges.left?u:u+this.actionObj.clone.offsetWidth,p.style.left=(0,e.formatUnit)(h)}else h="drag"===this.actionObj.action||this.resizeEdges.top?this.actionObj.clone.offsetTop:this.actionObj.clone.offsetTop+this.actionObj.clone.offsetHeight,p.style.top=(0,e.formatUnit)(h)}},t.prototype.getResourceElements=function(e){var t=this;return e.filter((function(e){return parseInt(e.getAttribute("data-group-index"),10)===t.actionObj.groupIndex}))},t.prototype.getOriginalElement=function(t){var i,n=t.getAttribute("data-guid");if(t.offsetParent&&t.offsetParent.classList.contains(tn)||this.parent.activeView.isTimelineView()||"resize"!==this.actionObj.action&&this.parent.virtualScrollModule)i=[].slice.call(this.parent.element.querySelectorAll('[data-guid="'+n+'"]'));else{var r=(0,e.closest)(t,"tr");r&&(i=[].slice.call(r.querySelectorAll('[data-guid="'+n+'"]')))}return i},t.prototype.createCloneElement=function(t){var i=document.createElement("div");i.appendChild(t.cloneNode(!0));var n=i.children[0],r=[Si];r.push("drag"===this.actionObj.action?Oi:xi),"Month"!==this.parent.currentView&&"TimelineMonth"!==this.parent.currentView||r.push("e-month-event"),(0,e.addClass)([n],r),(0,e.addClass)([t],Di),(0,e.isNullOrUndefined)(t.parentElement)||t.parentElement.appendChild(n),n.style.width=(0,e.formatUnit)(n.offsetWidth-2);var a=document.querySelector(this.parent.eventDragArea);return this.parent.eventDragArea&&"drag"===this.actionObj.action&&a&&a.appendChild(n),(0,e.setStyleAttribute)(n,{border:"0px"}),n},t.prototype.removeCloneElementClasses=function(){var t=this.actionObj.originalElement;"Month"!==this.parent.currentView&&"TimelineYear"!==this.parent.currentView&&"Day"!==this.parent.currentView&&"Week"!==this.parent.currentView&&"WorkWeek"!==this.parent.currentView||(t=[].slice.call(this.parent.element.querySelectorAll("."+Di))),(0,e.removeClass)(t,Di)},t.prototype.removeCloneElement=function(){this.actionObj.originalElement=[];for(var t=0,i=[].slice.call(this.parent.element.querySelectorAll(".e-dynamic-clone"));t<i.length;t++){var n=i[t];(0,e.remove)(n)}for(var r=0,a=this.actionObj.cloneElement;r<a.length;r++){var s=a[r];(0,e.isNullOrUndefined)(s.parentNode)||(0,e.remove)(s)}this.actionObj.cloneElement=[];var o=this.parent.element.querySelector("."+Ci);o&&(0,e.remove)(o)},t.prototype.getCursorElement=function(e){var t=this.parent.eventBase.getPageCoordinates(e);return document.elementFromPoint(t.clientX,t.clientY)},t.prototype.autoScroll=function(){var e=this.parent.element.querySelector("."+ri),t=e.offsetHeight<=e.scrollHeight,i=e.offsetWidth<=e.scrollWidth,n=t&&e.scrollTop>=0&&e.scrollTop+e.offsetHeight<=e.scrollHeight,r=i&&e.scrollLeft>=0&&e.scrollLeft+e.offsetWidth<=e.scrollWidth;if("resize"===this.actionObj.action&&this.scrollEdges.right&&e.scrollLeft+e.offsetWidth>e.scrollWidth){var a=[].slice.call(this.parent.getContentTable().querySelector("tr").children).length-1;r=Math.ceil((this.actionObj.clone.offsetLeft+this.actionObj.clone.offsetWidth)/this.actionObj.cellWidth)===a}n&&(this.scrollEdges.top||this.scrollEdges.bottom)&&(e.scrollTop+=this.scrollEdges.top?-this.actionObj.scroll.scrollBy:this.actionObj.scroll.scrollBy,"resize"===this.actionObj.action&&e.scrollHeight!==e.offsetHeight+e.scrollTop&&e.scrollTop>0&&(this.actionObj.Y+=this.scrollEdges.top?this.actionObj.scroll.scrollBy:-this.actionObj.scroll.scrollBy)),r&&(this.scrollEdges.left||this.scrollEdges.right)&&(e.scrollLeft+=this.scrollEdges.left?-this.actionObj.scroll.scrollBy:this.actionObj.scroll.scrollBy,"resize"===this.actionObj.action&&e.scrollWidth!==e.offsetWidth+e.scrollLeft&&e.scrollLeft>0&&(this.actionObj.X+=this.scrollEdges.left?this.actionObj.scroll.scrollBy:-this.actionObj.scroll.scrollBy))},t.prototype.autoScrollValidation=function(){if(!this.actionObj.scroll.enable)return!1;var e=this.parent.boundaryValidation(this.actionObj.pageY,this.actionObj.pageX);return this.scrollEdges=e,e.bottom||e.top||e.left||e.right},t.prototype.actionClass=function(t){"addClass"===t?(0,e.addClass)([this.parent.element],Di):(0,e.removeClass)([this.parent.element],Di)},t.prototype.updateScrollPosition=function(t){var i=this;this.scrollEventArgs=t,this.actionObj.scroll.enable&&(0,e.isNullOrUndefined)(this.actionObj.scrollInterval)&&(this.actionObj.scrollInterval=window.setInterval((function(){if(i.autoScrollValidation()&&!i.actionObj.clone.classList.contains(ji)){if(i.parent.activeView.isTimelineView()&&i.parent.activeViewOptions.group.resources.length>0&&i.actionObj.groupIndex<0)return;i.autoScroll(),"drag"===i.actionObj.action?i.parent.dragAndDropModule.updateDraggingDateTime(i.scrollEventArgs):i.parent.resizeModule.updateResizingDirection(i.scrollEventArgs)}}),this.actionObj.scroll.timeDelay))},t.prototype.updateOriginalElement=function(t){var i='[data-id="'+t.getAttribute("data-id")+'"]';this.parent.activeViewOptions.group.resources.length>0&&(i=i.concat('[data-group-index = "'+t.getAttribute("data-group-index")+'"]'));var n=[].slice.call(this.parent.element.querySelectorAll(i));(0,e.addClass)(n,Di);var r=[].slice.call(this.parent.element.querySelectorAll("."+Si));(0,e.removeClass)(r,Di)},t.prototype.getUpdatedEvent=function(e,t,i){var n=JSON.parse(JSON.stringify(i));return n[this.parent.eventFields.startTime]=e,n[this.parent.eventFields.endTime]=t,n},t.prototype.dynamicYearlyEventsRendering=function(t,i){if(void 0===i&&(i=!1),(0,e.isNullOrUndefined)(this.parent.eventDragArea)){var n,r=this.actionObj.cellWidth-7;if(i&&(this.resizeEdges.left||this.resizeEdges.right)&&(r=this.actionObj.cellWidth*t.count),!i&&"Horizontal"===this.parent.activeViewOptions.orientation&&0===this.parent.activeViewOptions.group.resources.length)(n=this.yearEvent.isSpannedEvent(t,t[this.parent.eventFields.startTime]))[this.parent.eventFields.startTime].getTime()===n[this.parent.eventFields.endTime].getTime()&&(n.isSpanned.count=1),r=n.isSpanned.count*this.actionObj.cellWidth;if(!i&&"Vertical"===this.parent.activeViewOptions.orientation&&0!==this.parent.activeViewOptions.group.resources.length)r=(n=this.yearEvent.isSpannedEvent(t,t[this.parent.eventFields.startTime])).isSpanned.count*this.actionObj.cellWidth;var a=this.createAppointmentElement(this.actionObj.groupIndex,t[this.parent.eventFields.subject]);a.setAttribute("drag","true"),(0,e.addClass)([a],Si),(0,e.setStyleAttribute)(a,{width:r+"px",border:"0px","pointer-events":"none",position:"absolute",overflow:"hidden",padding:"3px"}),""!==this.actionObj.clone.style.backgroundColor&&(0,e.setStyleAttribute)(a,{backgroundColor:this.actionObj.clone.style.backgroundColor});var s=ve(t[this.parent.eventFields.startTime]).getTime(),o="."+$e+'[data-date="'+s+'"]';this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&(o="."+$e+'[data-date="'+s+'"][data-group-index="'+this.actionObj.groupIndex+'"]');var l=this.parent.element.querySelector(o);if(!(0,e.isNullOrUndefined)(l)){if(i){var p=l.querySelector("."+ui),c=this.actionObj.cellHeight*t.count-(p?p.offsetHeight:0)-7;(this.resizeEdges.right||this.resizeEdges.left)&&(c=parseInt(this.actionObj.clone.style.height,10)),(0,e.setStyleAttribute)(a,{height:c+"px"})}this.renderDynamicElement(l,a,!0),this.actionObj.cloneElement.push(a)}}},t.prototype.renderDynamicElement=function(t,i,n){if(void 0===n&&(n=!1),t.querySelector("."+jt))t.querySelector("."+jt).appendChild(i);else{var r=(0,e.createElement)("div",{className:jt});r.appendChild(i),t.appendChild(r)}},t.prototype.createAppointmentElement=function(t,i){var n=(0,e.createElement)("div",{className:Xt,innerHTML:i});return this.parent.activeViewOptions.group.resources.length>0&&n.setAttribute("data-group-index",t.toString()),n},t.prototype.dynamicEventsRendering=function(t){var i=this;if((0,e.isNullOrUndefined)(this.parent.eventDragArea)){var n,r=this.parent.activeView.renderDates,a=[].slice.call(this.parent.element.querySelectorAll("."+$e)),s=this.parent.activeViewOptions.workDays;if(this.parent.activeViewOptions.group.resources.length>0){var o=(this.parent.virtualScrollModule&&this.parent.virtualScrollModule.isHorizontalScroll?this.parent.resourceBase.renderedResources:this.parent.resourceBase.lastResourceLevel).filter((function(e){return e.groupIndex===i.actionObj.groupIndex}));r=o[0].renderDates;var l="."+$e+'[data-group-index="'+this.actionObj.groupIndex+'"]';a=[].slice.call(this.parent.element.querySelectorAll(l)),s=o[0].workDays,n=o[0].groupOrder}if(this.monthEvent.dateRender=r,this.monthEvent.getSlotDates(s),this.resizeEdges.left||this.resizeEdges.right)for(var p=0,c=[].slice.call(this.parent.element.querySelectorAll("."+Si));p<c.length;p++){var h=c[p];(0,e.remove)(h)}for(var d=0,u=this.monthEvent.splitEvent(t,r);d<u.length;d++){var g=u[d],v=this.parent.getIndexOfDate(r,ve(g[this.monthEvent.fields.startTime])),m=g.data.count*this.actionObj.cellWidth-7,f=this.monthEvent.createAppointmentElement(g,this.actionObj.groupIndex,!0);f.setAttribute("drag","true"),(0,e.addClass)([f],Si),this.monthEvent.applyResourceColor(f,g,"backgroundColor",n),(0,e.setStyleAttribute)(f,{width:m+"px",border:"0px","pointer-events":"none"});var y=a[parseInt(v.toString(),10)];y&&(this.monthEvent.renderElement(y,f,!0),this.actionObj.cloneElement.push(f))}}},t.prototype.destroy=function(){!this.parent||this.parent&&this.parent.isDestroyed||(this.actionObj={},this.scrollArgs={},this.resizeEdges={left:!1,right:!1,top:!1,bottom:!1},this.scrollEdges={left:!1,right:!1,top:!1,bottom:!1})},t}(),Go=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Xo=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return Go(i,t),i.prototype.wireResizeEvent=function(t){for(var i=0,n=[].slice.call(t.querySelectorAll("."+Ei));i<n.length;i++){var r=n[i];e.EventHandler.add(r,e.Browser.touchStartEvent,this.resizeStart,this)}},i.prototype.resizeHelper=function(){if(this.parent.activeViewOptions.group.resources.length>0&&this.parent.activeViewOptions.group.allowGroupEdit)for(var e=0,t=this.actionObj.originalElement.length;e<t;e++){var i=this.createCloneElement(this.actionObj.originalElement[parseInt(e.toString(),10)]);this.actionObj.cloneElement[parseInt(e.toString(),10)]=i,this.actionObj.element===this.actionObj.originalElement[parseInt(e.toString(),10)]&&(this.actionObj.clone=i)}else this.actionObj.element&&(this.actionObj.clone=this.createCloneElement(this.actionObj.element)),this.actionObj.cloneElement=[this.actionObj.clone],this.actionObj.originalElement=[this.actionObj.element]},i.prototype.resizeStart=function(t){var i=this;if(!t||"touchstart"!==t.type||this.parent.uiStateValues.isTapHold&&(0,e.closest)(t.target,"."+Zt)){this.parent.eventBase.removeSelectedAppointmentClass(),this.actionObj.action="resize",this.actionObj.slotInterval=this.parent.activeViewOptions.timeScale.interval/this.parent.activeViewOptions.timeScale.slotCount,this.actionObj.interval=this.actionObj.slotInterval;var n=(0,e.closest)(t.target,"."+Ei);this.actionObj.element=(0,e.closest)(n,"."+Xt),this.actionObj.event=this.parent.eventBase.getEventByGuid(this.actionObj.element.getAttribute("data-guid"));var r=(0,e.extend)({},this.actionObj.event,null,!0),a={cancel:!1,data:r,element:this.actionObj.element,event:t,interval:this.actionObj.interval,scroll:{enable:!0,scrollBy:30,timeDelay:100}};this.parent.trigger(E,a,(function(a){if(!a.cancel){i.actionClass("addClass"),i.parent.uiStateValues.action=!0,i.resizeEdges={left:n.classList.contains(Vi),right:n.classList.contains(Ai),top:n.classList.contains(Ii),bottom:n.classList.contains(Mi)},i.actionObj.groupIndex=i.parent.uiStateValues.isGroupAdaptive?i.parent.uiStateValues.groupIndex:0;var s=i.parent.element.querySelector("."+$e);i.actionObj.cellWidth=i.parent.getElementWidth(s),i.actionObj.cellHeight=i.parent.getElementHeight(s);var o=i.parent.activeViewOptions.headerRows.map((function(e){return e.option}));if(i.parent.activeView.isTimelineView()&&o.length>0&&["Date","Hour"].indexOf(o.slice(-1)[0])<0){for(var l=i.parent.getContentTable().querySelector("tr"),p=0,c=0,h=[].slice.call(l.children);c<h.length;c++){var d=h[c];p+=parseInt(d.getAttribute("colspan"),10)}var u=l.getBoundingClientRect();i.actionObj.cellWidth=u.width/p,i.actionObj.cellHeight=u.height}var g=i.parent.eventBase.getPageCoordinates(t);i.actionObj.X=g.pageX,i.actionObj.Y=g.pageY,i.actionObj.groupIndex=parseInt(i.actionObj.element.getAttribute("data-group-index")||"0",10),i.actionObj.interval=a.interval,i.actionObj.scroll=a.scroll,i.actionObj.start=new Date(r[i.parent.eventFields.startTime].getTime()),i.actionObj.end=new Date(r[i.parent.eventFields.endTime].getTime()),i.actionObj.originalElement=i.getOriginalElement(i.actionObj.element),"Month"===i.parent.currentView&&(i.daysVariation=-1,i.monthEvent=new Ra(i.parent));var v=i.parent.element.querySelector("."+ri);if(i.scrollArgs={element:v,width:v.scrollWidth,height:v.scrollHeight},["Month","TimelineYear"].indexOf(i.parent.currentView)<0){var m=Math.round(i.scrollArgs.width/i.actionObj.cellWidth)*i.actionObj.cellWidth;i.scrollArgs.width=i.scrollArgs.width<m?m:i.scrollArgs.width}e.EventHandler.add(document,e.Browser.touchMoveEvent,i.resizing,i),e.EventHandler.add(document,e.Browser.touchEndEvent,i.resizeStop,i)}}))}},i.prototype.resizing=function(t){if(t&&"touchmove"===t.type&&t.preventDefault(),this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide(),0===this.parent.element.querySelectorAll("."+xi).length&&this.resizeHelper(),(0,e.isNullOrUndefined)(t.target)||!t.target.classList.contains(Qn)){var i=this.parent.eventBase.getPageCoordinates(t);if("Month"===this.parent.currentView||"TimelineYear"===this.parent.currentView){var n=document.documentElement,r=(window.pageXOffset||n.scrollLeft)-(n.clientLeft||0),a=(window.pageYOffset||n.scrollTop)-(n.clientTop||0);this.actionObj.pageX=i.pageX-r,this.actionObj.pageY=i.pageY-a}else this.actionObj.pageX=i.pageX,this.actionObj.pageY=i.pageY;this.updateScrollPosition(t),this.updateResizingDirection(t);var s={cancel:!1,data:(0,e.extend)({},this.actionObj.event,null,!0),element:this.actionObj.element,event:t,startTime:this.actionObj.start,endTime:this.actionObj.end};this.parent.group.resources.length>0&&(s.groupIndex=this.actionObj.groupIndex),this.parent.trigger(x,s)}},i.prototype.updateResizingDirection=function(t){if("Month"!==this.parent.currentView&&"TimelineYear"!==this.parent.currentView){var i=this.resizeValidation(t);if(this.resizeEdges.left){if(i){var n=this.getLeftRightStyles(t,!0);if(parseInt(n.width,10)<1)return;for(var r=0,a=this.actionObj.cloneElement;r<a.length;r++){var s=a[r];(0,e.setStyleAttribute)(s,n),(0,e.addClass)([s],Vi)}}this.horizontalResizing(!this.parent.enableRtl)}if(this.resizeEdges.right){if(i){var o=this.getLeftRightStyles(t,!1);if(parseInt(o.width,10)<1)return;for(var l=0,p=this.actionObj.cloneElement;l<p.length;l++){s=p[l];(0,e.setStyleAttribute)(s,o),(0,e.addClass)([s],Ai)}}this.horizontalResizing(this.parent.enableRtl)}if(this.resizeEdges.top){if(i){var c=this.getTopBottomStyles(t,!0);if(parseInt(c.height,10)<1)return;for(var h=0,d=this.actionObj.cloneElement;h<d.length;h++){s=d[h];(0,e.setStyleAttribute)(s,c),(0,e.addClass)([s],Ii)}}this.verticalResizing(!0)}if(this.resizeEdges.bottom){if(i){var u=this.getTopBottomStyles(t,!1);if(parseInt(u.height,10)<1)return;for(var g=0,v=this.actionObj.cloneElement;g<v.length;g++){s=v[g];(0,e.setStyleAttribute)(s,u),(0,e.addClass)([s],Mi)}}this.verticalResizing(!1)}}else this.monthResizing()},i.prototype.monthResizing=function(){if(this.removeCloneElement(),!(0,e.isNullOrUndefined)(this.actionObj.pageX)&&!(0,e.isNullOrUndefined)(this.actionObj.pageY)){var t=document.elementFromPoint(this.actionObj.pageX,this.actionObj.pageY);if(!(0,e.isNullOrUndefined)(t)){var i=this.parent.getDateFromElement(t),n=!(this.parent.activeViewOptions.group.resources.length>0)||parseInt(t.getAttribute("data-group-index"),10)===this.actionObj.groupIndex,r=new Date(this.actionObj.event[this.parent.eventFields.startTime].getTime()),a=new Date(this.actionObj.event[this.parent.eventFields.endTime].getTime());if(!this.parent.enableRtl&&this.resizeEdges.left||this.parent.enableRtl&&this.resizeEdges.right||this.resizeEdges.top?r=i:(!this.parent.enableRtl&&this.resizeEdges.right||this.parent.enableRtl&&this.resizeEdges.left||this.resizeEdges.bottom)&&(a=ye(i,1)),n&&r<a){this.actionObj.start=r,this.actionObj.end=a;var s=this.getUpdatedEvent(this.actionObj.start,this.actionObj.end,this.actionObj.event);"TimelineYear"===this.parent.currentView?this.yearEventsRendering(s):this.dynamicEventsRendering(s),this.updateOriginalElement(this.actionObj.clone)}}}},i.prototype.yearEventsRendering=function(t){for(var i=0,n=[].slice.call(this.parent.element.querySelectorAll("."+Si));i<n.length;i++){var r=n[i];(0,e.remove)(r)}var a=new Date(t[this.parent.eventFields.endTime]),s=0;0===this.parent.activeViewOptions.group.resources.length&&(s=this.getMonthDiff(t[this.parent.eventFields.startTime],ye(a,-1)));for(var o=0;o<=s;o++){var l=void 0;0===this.parent.activeViewOptions.group.resources.length?l=this.getEventCount(t,this.actionObj.start.getMonth()+o):(l=(0,e.extend)({},t,null,!0),a=this.resizeEdges.left||this.resizeEdges.right?ye(a,-1):a,l.count=this.getMonthDiff(t[this.parent.eventFields.startTime],a)+1),this.dynamicYearlyEventsRendering(l,!0)}},i.prototype.getMonthDiff=function(e,t){var i;return i=12*(t.getFullYear()-e.getFullYear()),i-=e.getMonth(),(i+=t.getMonth())<=0?0:i},i.prototype.getEventCount=function(t,i){var n=(0,e.extend)({},t,null,!0),r=n[this.parent.eventFields.startTime],a=n[this.parent.eventFields.endTime],s=new Date(this.parent.selectedDate.getFullYear(),i,1),o=ye(new Date(this.parent.selectedDate.getFullYear(),i+1,0),1),l=1;return r.getTime()<s.getTime()&&(n[this.parent.eventFields.startTime]=s),a.getTime()>o.getTime()&&(n[this.parent.eventFields.endTime]=o),0===this.parent.activeViewOptions.group.resources.length&&(l=Math.ceil((n[this.parent.eventFields.endTime].getTime()-n[this.parent.eventFields.startTime].getTime())/ie)),n.count=l,n},i.prototype.resizeStop=function(t){var i=this;e.EventHandler.remove(document,e.Browser.touchMoveEvent,this.resizing),e.EventHandler.remove(document,e.Browser.touchEndEvent,this.resizeStop),clearInterval(this.actionObj.scrollInterval),this.actionObj.scrollInterval=null,this.actionObj.action=null,this.removeCloneElementClasses(),this.removeCloneElement(),this.actionClass("removeClass"),this.parent.uiStateValues.action=this.parent.uiStateValues.isTapHold=!1;var n={cancel:!1,data:this.getChangedData(),element:this.actionObj.element,event:t};this.parent.trigger(V,n,(function(e){e.cancel||i.parent.eventBase.checkOverlap(e.data)||(i.parent.isSpecificResourceEvents()&&(i.parent.crudModule.crudObj.sourceEvent=[i.parent.resourceBase.lastResourceLevel[parseInt(e.element.getAttribute("data-group-index"),10)]],i.parent.crudModule.crudObj.targetEvent=i.parent.crudModule.crudObj.sourceEvent,i.parent.crudModule.crudObj.isCrudAction=!0),i.saveChangedData(e))}))},i.prototype.verticalResizing=function(t){var i=this.actionObj.clone.offsetTop;t||(i+=this.actionObj.clone.offsetHeight);var n=i/Math.round(this.actionObj.cellHeight)*this.actionObj.slotInterval,r=this.actionObj.clone.offsetParent;if(!(0,e.isNullOrUndefined)(r)){var a=ve(this.parent.getDateFromElement(r));a.setHours(this.parent.activeView.getStartHour().getHours()),a.setMinutes(n+this.parent.activeView.getStartHour().getMinutes()),t?this.actionObj.start=this.calculateIntervalTime(a):this.actionObj.end=this.calculateIntervalTime(a),this.updateTimePosition(a)}},i.prototype.horizontalResizing=function(t){var i,n=new Date(this.actionObj.event[this.parent.eventFields.startTime].getTime()),r=new Date(this.actionObj.event[this.parent.eventFields.endTime].getTime()),a=this.parent.currentView,s="TimelineMonth"===this.parent.currentView;if(this.parent.activeView.isTimelineView()){var o=this.parent.getContentTable().querySelector("tr");if(this.parent.activeViewOptions.headerRows.length>0){var l=this.parent.activeViewOptions.headerRows.map((function(e){return e.option}));a=l.slice(-1)[0],s&&"Hour"===a&&(a=l.slice(-2)[0]||"Month")}i=t?n:r;var p=0,c=[].slice.call(o.children),h=!1,d=this.actionObj.cellWidth/(this.parent.activeViewOptions.timeScale.interval/this.parent.activeViewOptions.timeScale.slotCount),u=parseFloat(this.parent.enableRtl?this.actionObj.clone.style.right:this.actionObj.clone.style.left);if(u=Math.round(u/d)*d,-1!==["Year","Month","Week","Date"].indexOf(a)){for(var g=0,v=0,m=c;v<m.length;v++){var f=m[v];g+=parseInt(f.getAttribute("colspan"),10)}var y=this.parent.enableRtl?parseInt(this.actionObj.clone.style.right,10):parseInt(this.actionObj.clone.style.left,10);y=Math.round(y/this.actionObj.cellWidth)*this.actionObj.cellWidth,t||(y+=this.parent.getElementWidth(this.actionObj.clone)-this.actionObj.cellWidth),p=s?Math.floor(y/Math.floor(this.parent.getElementWidth(o)/g)):Math.round(y/(this.parent.getElementWidth(o)/g)),h=(p=t?p:s?p+1:p)===c.length,p=p<0?0:p>=g?g-1:p}else{var T=this.actionObj.cellWidth;if(p=t?Math.round(u/this.actionObj.cellWidth):Math.ceil((u+(this.parent.getElementWidth(this.actionObj.clone)-T))/this.actionObj.cellWidth),this.parent.enableRtl){var w=Math.round(u/this.actionObj.cellWidth)*this.actionObj.cellWidth+(t?0:this.parent.getElementWidth(this.actionObj.clone)-this.actionObj.cellWidth);p=Math.floor(w/this.actionObj.cellWidth)}h=p===c.length,p=this.getIndex(p)}var D=void 0;if(D=-1!==["Year","Month","Week","Date"].indexOf(a)?new Date(this.parent.activeView.renderDates[parseInt(p.toString(),10)].getTime()):this.parent.getDateFromElement(o.children[parseInt(p.toString(),10)]),-1===["TimelineMonth","Year","Month","Week","Date"].indexOf(a)&&this.parent.activeViewOptions.timeScale.enable){t||(u+=this.parent.getElementWidth(this.actionObj.clone));var b=Math.floor(this.actionObj.slotInterval/this.actionObj.cellWidth*(u-Math.floor(u/this.actionObj.cellWidth)*this.actionObj.cellWidth));b=h||!t&&0===b?this.actionObj.slotInterval:b,i=new Date(D.getTime()),i=new Date(D.getTime()+b*ne),this.updateTimePosition(i)}else i=new Date(D.setHours(i.getHours(),i.getMinutes(),i.getSeconds()))}else{var S=(0,e.closest)(this.actionObj.clone,"td").cellIndex,C=Math.ceil((t?this.parent.getElementWidth(this.actionObj.element):0)/this.actionObj.cellWidth)*this.actionObj.cellWidth,O=(g=Math.ceil((this.parent.getElementWidth(this.actionObj.clone)-C)/this.actionObj.cellWidth),o=(0,e.closest)(this.actionObj.clone,"tr"),t?S-g:S+g-1);O=this.getIndex(O),i=this.parent.getDateFromElement(o.children[parseInt(O.toString(),10)]),t?i.setHours(n.getHours(),n.getMinutes(),n.getSeconds()):i.setHours(r.getHours(),r.getMinutes(),r.getSeconds())}var E=-1!==["TimelineMonth","Year","Month","Week","WorkWeek","Date","Day"].indexOf(a)||!this.parent.activeViewOptions.timeScale.enable;if(t)r.getTime()-i.getTime()<=0&&(i=E?ve(r):n),this.actionObj.start=E?i:this.calculateIntervalTime(i);else{var x=E&&0===i.getHours()&&0===i.getMinutes()?ye(i,1):i;E&&x.getTime()-n.getTime()<=0&&(x=ye(ve(n),1)),this.actionObj.end=E?x:this.calculateIntervalTime(x)}},i.prototype.getTopBottomStyles=function(t,i){var n=this.parent.element.querySelector("."+ri),r=this.actionObj.cellHeight/this.actionObj.slotInterval*this.actionObj.interval,a=i?this.actionObj.element.offsetHeight+(this.actionObj.Y-this.actionObj.pageY):this.actionObj.element.offsetHeight+(this.actionObj.pageY-this.actionObj.Y),s=i?this.actionObj.element.offsetTop-(this.actionObj.Y-this.actionObj.pageY):this.actionObj.clone.offsetTop;return a=s<0||this.actionObj.clone.offsetTop+this.actionObj.clone.offsetHeight>this.scrollArgs.height?this.actionObj.clone.offsetHeight:a,s=s<0?0:s,a=(s=i?Math.floor(s/r)*r:s)+a>=n.scrollHeight?n.scrollHeight-s:Math.ceil(a/r)*r,!i&&this.actionObj.clone.offsetTop+a>=this.parent.getContentTable().offsetHeight&&(a=this.parent.getContentTable().offsetHeight-this.actionObj.clone.offsetTop),{height:(0,e.formatUnit)(a<this.actionObj.cellHeight?Math.floor(a/r)*r:a),top:(0,e.formatUnit)(a<this.actionObj.cellHeight&&i?Math.ceil(s/r)*r:s),left:"0px",right:"0px",width:"100%"}},i.prototype.getLeftRightStyles=function(t,i){var n={},r=this.parent.activeView.isTimelineView(),a=["TimelineDay","TimelineWeek","TimelineWorkWeek"].indexOf(this.parent.currentView)>-1&&this.parent.activeViewOptions.timeScale.enable,s=this.actionObj.cellWidth/this.actionObj.slotInterval*this.actionObj.interval,o=i?this.actionObj.X-this.actionObj.pageX:this.actionObj.pageX-this.actionObj.X,l=r?Math.round(this.parent.getElementWidth(this.actionObj.element)/this.actionObj.cellWidth)*this.actionObj.cellWidth:"Month"===this.parent.currentView?this.parent.getElementWidth(this.actionObj.element):Math.ceil(this.parent.getElementWidth(this.actionObj.element)/this.actionObj.cellWidth)*this.actionObj.cellWidth,p=l+Math.ceil(o/this.actionObj.cellWidth)*this.actionObj.cellWidth,c=this.parent.enableRtl?parseInt(this.actionObj.element.style.right,10):this.actionObj.clone.offsetLeft;if(c=Math.round(c/s)*s,a){if(p=l+Math.ceil(o/s)*s,!i){var h=(+parseFloat(this.actionObj.element.style[this.parent.enableRtl?"right":"left"])).toFixed(1),d=Math.round(l/s)*s;h===c.toFixed(1)&&d===l||(p=Math.round((c+p)/s)*s-c)}this.actionObj.event[this.parent.eventFields.isAllDay]=!1}var u=!i&&p+this.actionObj.clone.offsetLeft>this.scrollArgs.width?this.parent.getElementWidth(this.actionObj.clone):(this.actionObj.cellWidth,p);if(this.parent.enableRtl){var g=r?parseInt(this.actionObj.element.style.right,10):-(p-this.actionObj.cellWidth);g=r?g:i||g>0?0:g,r&&!i&&(g=Math.round(g/s)*s,(g-=Math.ceil((this.actionObj.pageX-this.actionObj.X)/s)*s)<0&&(g=parseInt(this.actionObj.clone.style.right,10),u=parseInt(this.actionObj.clone.style.width,10))),g=g>=this.scrollArgs.width?this.scrollArgs.width-this.actionObj.cellWidth:g,n.right=(0,e.formatUnit)(g),u=u+g>this.scrollArgs.width?this.parent.getElementWidth(this.actionObj.clone):u}else{var v=i?this.actionObj.element.offsetLeft-(this.actionObj.X-this.actionObj.pageX):this.parent.enableRtl?this.actionObj.element.offsetLeft:0;r&&(v=i?v:parseInt(this.actionObj.clone.style.left,10),v=this.parent.enableRtl?i?v:this.actionObj.pageX<this.actionObj.X-this.parent.getElementWidth(this.actionObj.clone)?parseInt(this.actionObj.clone.style.right,10):v:i&&this.actionObj.pageX>this.actionObj.X+this.parent.getElementWidth(this.actionObj.clone)&&this.parent.getElementWidth(this.actionObj.clone)===this.actionObj.cellWidth?parseInt(this.actionObj.clone.style.left,10):v);var m=v;(v=r?a?i?this.actionObj.element.offsetLeft-Math.ceil((this.actionObj.element.offsetLeft-v)/s)*s:v:Math.floor(v/this.actionObj.cellWidth)*this.actionObj.cellWidth:Math.ceil(Math.abs(v)/this.actionObj.cellWidth)*this.actionObj.cellWidth)<0&&(r&&i&&v%s?(v=parseInt(this.actionObj.clone.style.left,10),u=parseInt(this.actionObj.clone.style.width,10)):(v=0,u=this.parent.getElementWidth(this.actionObj.clone)));var f=Math.ceil(this.parent.getElementWidth(this.actionObj.clone)/this.actionObj.cellWidth)*this.actionObj.cellWidth;i&&(n.left=(0,e.formatUnit)(r?v:i?m<0?-v:Math.ceil((l-f)/this.actionObj.cellWidth)*this.actionObj.cellWidth:v))}return n.width=(0,e.formatUnit)(u),n},i.prototype.resizeValidation=function(e){var t=this.parent.eventBase.getPageCoordinates(e),i=this.getContentAreaDimension(),n=this.parent.activeView.isTimelineView()&&this.parent.activeViewOptions.timeScale.enable,r=this.actionObj.cellWidth,a=!1;return this.resizeEdges.left&&(t.pageX<i.leftOffset&&t.pageX>=i.left&&n&&(r=0),a=t.pageX-r>=i.left),this.resizeEdges.right&&(t.pageX>i.rightOffset&&t.pageX<=i.right&&n&&(r=0),a=t.pageX+r<=i.right),this.resizeEdges.top&&(a=this.actionObj.clone.offsetTop>=i.top),this.resizeEdges.bottom&&(a=this.actionObj.clone.offsetTop+this.actionObj.clone.offsetHeight<=this.scrollArgs.height),a},i.prototype.getModuleName=function(){return"resize"},i}(_o),Qo=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ko=function(t){function i(e){var i=t.call(this,e,"day")||this;return i.isResource=!1,i}return Qo(i,t),i.prototype.renderAppointments=function(){this.parent.dragAndDropModule&&this.parent.dragAndDropModule.setDragArea(),this.fields=this.parent.eventFields;for(var t="Year"===this.parent.currentView?"."+$e+" ."+Xt:"."+jt+",."+Bi,i=0,n=[].slice.call(this.parent.element.querySelectorAll(t));i<n.length;i++){var r=n[i];(0,e.remove)(r)}this.renderedEvents=[],"Year"===this.parent.currentView?this.yearViewEvents():(this.removeCellHeight(),this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive?(this.isResource=!0,this.timelineResourceEvents()):this.timelineYearViewEvents()),this.parent.renderTemplates(),this.parent.notify(_,{})},i.prototype.yearViewEvents=function(){for(var t=this.getMonths(),i=0,n=t;i<n.length;i++)for(var r=n[i],a=".e-month-calendar:nth-child("+(t.indexOf(r)+1)+") td.e-work-cells",s=[].slice.call(this.parent.element.querySelectorAll(a)),o=new Date(this.parent.selectedDate.getFullYear(),r,1),l=this.parent.calendarUtil.getMonthStartDate(new Date(o.getTime())),p=this.parent.calendarUtil.getMonthEndDate(new Date(o.getTime())),c=le(l,this.parent.activeViewOptions.firstDayOfWeek),h=ye(pe(p,this.parent.activeViewOptions.firstDayOfWeek),1),d=0;c.getTime()<h.getTime();d++){var u=ve(new Date(c.getTime())),g=ye(new Date(u.getTime()),1);if(c=ye(new Date(c.getTime()),1),this.parent.isMinMaxDate(u))if(this.parent.eventBase.filterEvents(u,g).length>0){var v=s[parseInt(d.toString(),10)];v&&v.appendChild((0,e.createElement)("div",{className:Xt}))}}},i.prototype.timelineYearViewEvents=function(){var t=this,i=this.parent.element.querySelector("."+$e+":not(."+st+")");this.cellWidth=this.parent.getElementWidth(i),this.cellHeader=Ie(i.querySelector("."+ui));var n=this.parent.element.querySelector("."+vt);this.eventHeight=this.parent.getElementHeightFromClass(n,Xt);var r="."+hr+" tbody tr,."+Tt+" tbody tr,."+Je+" tbody tr";this.addCellHeight(r,this.eventHeight,2,this.cellHeader,this.moreIndicatorHeight);for(var a=[].slice.call(this.parent.element.querySelectorAll("."+Gt)),s=this.getMonths(),o=this.parent.activeViewOptions.group.resources.length>0&&this.parent.uiStateValues.isGroupAdaptive?this.parent.uiStateValues.groupIndex:void 0,l=0;l<s.length;l++){var p=a[parseInt(l.toString(),10)],c=l+1,h=(0,e.createElement)("div",{className:jt});p.appendChild(h);var d=new Date(this.parent.selectedDate.getFullYear(),s[parseInt(l.toString(),10)],1),u=new Date(d.getFullYear(),d.getMonth()+1,0),g=d.getDay(),v=[];for("Horizontal"===this.parent.activeViewOptions.orientation&&(this.renderedEvents=[]);d.getTime()<=u.getTime();){var m=void 0,f=void 0;if("Vertical"===this.parent.activeViewOptions.orientation){var y=a[parseInt(g.toString(),10)];c=g+1,(h=y.querySelector("."+jt))||(h=(0,e.createElement)("div",{className:jt}),y.appendChild(h)),this.parent.enableRtl?f=l*this.cellWidth:m=l*this.cellWidth}else this.parent.enableRtl?f=(g+d.getDate()-1)*this.cellWidth:m=(g+d.getDate()-1)*this.cellWidth;var T=this.parent.element.querySelector(".e-content-wrap tr:nth-child("+c+") td");this.cellHeight=T.offsetHeight;var w=ve(new Date(d.getTime())),D=ye(new Date(w.getTime()),1),b=void 0;this.parent.uiStateValues.isGroupAdaptive&&(b=this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]);var S=this.parent.eventBase.filterEvents(w,D,void 0,b);S=this.parent.eventBase.sortByDateTime(S);for(var C=function(t,i){var n=(0,e.extend)({},S[parseInt(t.toString(),10)],null,!0);O.updateSpannedEvents(n,w,D);var r=O.getIndex(w);n.Index=r;var a=O.cellHeader+O.eventHeight*(r+1)+2+O.moreIndicatorHeight,s=O.cellHeight-O.cellHeader-O.moreIndicatorHeight,p=Math.floor(s/(O.eventHeight+2)),c=O.parent.rowAutoHeight?1:O.parent.activeViewOptions.maxEventsPerRow,u=O.parent.activeViewOptions.maxEventsPerRow?i-c:i-p<=0?1:i-p;if("Horizontal"===O.parent.activeViewOptions.orientation){var y=O.renderedEvents.filter((function(e){return e.Guid===n.Guid})),b=v.filter((function(e){return e.Guid===n.Guid}));if(y.length>0&&y[0].MoreIndicator||b.length>0&&b[0].MoreIndicator){var C="Horizontal"===O.parent.activeViewOptions.orientation?l:g;return O.renderMoreIndicator(h,u,w,C,m,f,o),"continue"}if(y.length>0||b.length>0)return"continue"}var E=O.maxOrIndicator||r<c||O.cellHeight>a;if(O.parent.rowAutoHeight||E||O.cellHeight>a)O.renderEvent(h,n,l,m,f,d,g),(O.parent.rowAutoHeight||O.cellHeight>a)&&O.updateCellHeight(T,a),v.push(n);else{C="Horizontal"===O.parent.activeViewOptions.orientation?l:g;O.renderMoreIndicator(h,u,w,C,m,f,o),"Horizontal"===O.parent.activeViewOptions.orientation&&(n.MoreIndicator=!0,O.renderedEvents.push(n),v.push(n))}},O=this,E=0,x=S.length;E<x;E++)C(E,x);d=ye(new Date(d.getTime()),1),"Vertical"===this.parent.activeViewOptions.orientation&&(g++,this.renderedEvents=[])}}if(this.parent.rowAutoHeight&&"Vertical"===this.parent.activeViewOptions.orientation){var V=[].slice.call(this.parent.element.querySelectorAll("."+Gt)),A=[].slice.call(this.parent.element.querySelectorAll("."+Je+" tbody tr"));V.forEach((function(e,i){var n=[].slice.call(e.querySelectorAll("."+Xt)),r=A[parseInt(i.toString(),10)].offsetTop+t.cellHeader+2;n.forEach((function(e){var i=parseInt(e.getAttribute("data-index"),10);e.style.top=r+i*t.eventHeight+"px",e.removeAttribute("data-index")}))}))}},i.prototype.updateSpannedEvents=function(e,t,i){var n=this.isResource&&"Vertical"===this.parent.activeViewOptions.orientation||!this.isResource&&"Horizontal"===this.parent.activeViewOptions.orientation,r={isLeft:!0,isRight:!0,isBottom:!0,isTop:!0};t.getTime()<=e[this.fields.startTime].getTime()&&(n?r.isLeft=!1:r.isTop=!1),(i.getTime()>=e[this.fields.endTime].getTime()||n&&!this.isResource&&ye(i,-1).getMonth()===e[this.fields.endTime].getMonth()||n&&this.isResource&&i.getTime()<=e[this.fields.endTime].getTime())&&(n?r.isRight=!1:r.isBottom=!1),e.data=r},i.prototype.timelineResourceEvents=function(){var e=this,t=this.parent.element.querySelector("."+ri),i=t.offsetWidth>t.clientWidth,n=this.parent.element.querySelector("."+$e);this.cellWidth=this.parent.getElementWidth(n),this.cellHeader=0;var r=this.parent.element.querySelector("."+vt);this.eventHeight=this.parent.getElementHeightFromClass(r,Xt);var a="."+hr+" tbody tr,."+Tt+" tbody tr,."+Je+" tbody tr";this.addCellHeight(a,this.eventHeight,2,this.cellHeader,this.moreIndicatorHeight);var s=[].slice.call(this.parent.element.querySelectorAll("."+Gt)),o=this.parent.uiStateValues.isGroupAdaptive?[this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]]:this.parent.activeViewOptions.allowVirtualScrolling?this.parent.resourceBase.renderedResources:this.parent.resourceBase.lastResourceLevel,l=this.getMonths();if("Horizontal"===this.parent.activeViewOptions.orientation)for(var p=0;p<l.length;p++)for(var c=new Date(this.parent.selectedDate.getFullYear(),l[parseInt(p.toString(),10)],1),h=0,d=o.length;h<d;h++)this.renderedEvents=[],this.renderResourceEvent(s[parseInt(p.toString(),10)],o[parseInt(h.toString(),10)],p,h,c);else for(h=0,d=o.length;h<d;h++){this.renderedEvents=[];for(p=0;p<l.length;p++){c=new Date(this.parent.selectedDate.getFullYear(),l[parseInt(p.toString(),10)],1);this.renderResourceEvent(s[parseInt(h.toString(),10)],o[parseInt(h.toString(),10)],p,h,c)}}if(this.parent.rowAutoHeight&&!i&&t.offsetWidth>t.clientWidth){[].slice.call(this.parent.element.querySelectorAll("."+Xt)).forEach((function(e){e.style.removeProperty("left"),e.style.removeProperty("right")}));var u=[].slice.call(this.parent.element.querySelectorAll("."+Gt)),g=this.parent.element.querySelector("."+Je),v=[].slice.call(g.querySelectorAll("tbody tr"));u.forEach((function(t,i){var n=[].slice.call(t.children),r=v[parseInt(i.toString(),10)];n.forEach((function(t,i){var n=r.querySelector("td:nth-child("+(i+1)+")"),a=[].slice.call(t.children),s=e.parent.getElementWidth(n),o=n.offsetLeft;if(e.parent.enableRtl){var l=g.offsetWidth-o-n.offsetWidth;a.forEach((function(e){e.style.width=Math.floor(parseInt(e.style.width,10)/s)*s+"px",e.style.right=l+"px"}))}else a.forEach((function(e){e.style.width=Math.floor(parseInt(e.style.width,10)/s)*s+"px",e.style.left=o+"px"}))}))}))}},i.prototype.renderResourceEvent=function(t,i,n,r,a){var s=(0,e.createElement)("div",{className:jt});t.appendChild(s);var o=ye(he(new Date(a.getTime())),1),l=this.parent.eventBase.filterEvents(a,o,void 0,i),p="Vertical"===this.parent.activeViewOptions.orientation?r:n,c=this.parent.element.querySelector(".e-content-wrap tr:nth-child("+(p+1)+") td");this.cellHeight=c.offsetHeight,this.groupOrder=i.groupOrder;for(var h=[],d=function(t){var i=l[parseInt(t.toString(),10)],o=void 0,p=(0,e.extend)({},i,null,!0);if(u.parent.activeViewOptions.group.resources.length>0){var d=u.isSpannedEvent(p,a);o=u.getIndex(d[u.fields.startTime]),p.Index=o}else o=u.getIndex(p[u.fields.startTime]),p.Index=o;var g=u.cellHeader+u.eventHeight*(t+1)+2+u.moreIndicatorHeight,v="Vertical"===u.parent.activeViewOptions.orientation?n*u.cellWidth:r*u.cellWidth;if(!u.parent.isMinMaxDate(p[u.fields.startTime]))return{value:void 0};if("Vertical"===u.parent.activeViewOptions.orientation&&u.parent.activeViewOptions.group.resources.length>0){var m=u.renderedEvents.filter((function(e){return e.Guid===p.Guid})),f=h.filter((function(e){return e.Guid===p.Guid}));if(m.length>0||f.length>0)return"continue"}if(!(u.parent.rowAutoHeight||u.cellHeight>g)){var y="Horizontal"===u.parent.activeViewOptions.orientation?n:r;if(u.renderMoreIndicator(s,l.length-t,a,y,v,v,r),"Horizontal"===u.parent.activeViewOptions.orientation)for(var T=r;T<l.length;T++)u.renderedEvents.push((0,e.extend)({},l[parseInt(T.toString(),10)],{Index:o+T},!0));return"break"}u.renderEvent(s,p,n,v,v,a,r),u.updateCellHeight(c,g),h.push(p)},u=this,g=0;g<l.length;g++){var v=d(g);if("object"==typeof v)return v.value;if("break"===v)break}},i.prototype.renderEvent=function(t,i,n,r,a,s,o){var l,p,c=this,h=this.isSpannedEvent(i,s),d=this.createEventElement(h);if(1===h.isSpanned.count){var u=ye(h[this.fields.endTime],-1);h[this.fields.endTime]=u>h[this.fields.startTime]?u:h[this.fields.endTime]}if(!(h[this.fields.startTime]>h[this.fields.endTime])){"Horizontal"===this.parent.activeViewOptions.orientation?(p=n+1,h[this.fields.startTime].getTime()===h[this.fields.endTime].getTime()&&(h.isSpanned.count=1),l=h.isSpanned.count*this.cellWidth):(p=o+1,l=this.isResource?h.isSpanned.count*this.cellWidth:this.cellWidth);var g=this.parent.element.querySelector(".e-content-wrap tr:nth-child("+p+") td").offsetTop+this.cellHeader+this.eventHeight*h.Index+2;(0,e.setStyleAttribute)(d,{width:l+"px",height:this.eventHeight+"px",left:r+"px",right:a+"px",top:g+"px"}),!this.isResource&&this.parent.rowAutoHeight&&"Vertical"===this.parent.activeViewOptions.orientation&&d.setAttribute("data-index",h.Index.toString());var v={data:h,element:d,cancel:!1,type:"event"};this.parent.trigger(y,v,(function(i){i.cancel||(t.appendChild(d),c.wireAppointmentEvents(d,h),(c.parent.activeViewOptions.group.resources.length>0||"Vertical"===c.parent.activeViewOptions.orientation||(h.isSpanned.isRight||h.isSpanned.isLeft)&&"Horizontal"===c.parent.activeViewOptions.orientation||!h.isSpanned.isRight)&&c.renderedEvents.push((0,e.extend)({},h,null,!0)))}))}},i.prototype.renderMoreIndicator=function(t,i,n,r,a,s,o){if(0!==this.parent.activeViewOptions.group.resources.length||!t.querySelector('[data-start-date="'+n.getTime()+'"]')){var l;l=this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive?ye(he(new Date(n.getTime())),1):ye(new Date(n.getTime()),1);var p=this.getMoreIndicatorElement(i,n,l),c=this.parent.element.querySelector(".e-content-wrap tr:nth-child("+(r+1)+")").offsetTop+(this.cellHeight-this.moreIndicatorHeight);a=Math.floor(a/this.cellWidth)*this.cellWidth,s=Math.floor(s/this.cellWidth)*this.cellWidth,(0,e.setStyleAttribute)(p,{width:this.cellWidth+"px",left:a+"px",right:s+"px",top:c+"px"}),(0,e.isNullOrUndefined)(o)||p.setAttribute("data-group-index",o.toString()),t.appendChild(p),e.EventHandler.add(p,"click",this.moreIndicatorClick,this)}},i.prototype.createEventElement=function(t){var i=t[this.fields.subject]||this.parent.eventSettings.fields.subject.default||this.parent.localeObj.getConstant("addTitle"),n=(0,e.createElement)("div",{className:Xt,attrs:{"data-id":"Appointment_"+t[this.fields.id],"data-guid":t.Guid,role:"button",tabindex:"0","aria-disabled":this.parent.eventBase.getReadonlyAttribute(t),"aria-label":this.parent.getAnnouncementString(t)}});if(this.cssClass&&(0,e.addClass)([n],this.cssClass),t[this.fields.isReadonly]&&(0,e.addClass)([n],cr),this.parent.activeViewOptions.group.resources.length>0){var r=this.getGroupIndexFromEvent(t);n.setAttribute("data-group-index",r.toString())}var a=[],s=(0,e.extend)({},t,null,!0);if(this.parent.activeViewOptions.eventTemplate){var o=this.parent.element.id+"_"+this.parent.activeViewOptions.eventTemplateName+"eventTemplate";a=this.parent.getAppointmentTemplate()(s,this.parent,"eventTemplate",o,!1,void 0,void 0,this.parent.root)}else{var l=t[this.fields.location]||this.parent.eventSettings.fields.location.default||"",p=(0,e.createElement)("div",{className:Cn,innerHTML:i+(l?"; "+l:"")}),c=(0,e.createElement)("div",{className:ti+(this.parent.isAdaptive?" "+Ge:""),innerHTML:this.parent.getTimeString(s[this.fields.startTime])}),h=(0,e.createElement)("div",{className:ti+(this.parent.isAdaptive?" "+Ge:""),innerHTML:this.parent.getTimeString(s[this.fields.endTime])});(0,e.addClass)([p],"e-text-center"),t[this.fields.isAllDay]?a=[p]:s.isLeft||s.isRight?(s.isLeft||a.push(c),a.push(p),s.isRight||a.push(h)):a=[c,p,h]}var d=(0,e.createElement)("div",{className:Jt});return(0,e.append)(a,d),n.appendChild(d),this.parent.eventBase.renderSpannedIcon(n,t.isSpanned),this.renderResizeHandler(n,t.data,t[this.fields.isReadonly]),this.applyResourceColor(n,s,"backgroundColor",this.groupOrder),n},i.prototype.isSpannedEvent=function(t,i){var n=new Date(i.getFullYear(),i.getMonth(),1),r=ye(new Date(i.getFullYear(),i.getMonth()+1,0),1),a=(0,e.extend)({},t,null,!0),s=a[this.fields.startTime],o=a[this.fields.endTime],l={isLeft:!1,isRight:!1,count:1},p=new Date(this.parent.selectedDate.getFullYear(),this.parent.firstMonthOfYear,1),c=Te(p,this.parent.monthsCount);if(this.isResource&&this.updateSpannedEvents(t,n,r),"Vertical"===this.parent.activeViewOptions.orientation&&this.parent.activeViewOptions.group.resources.length>0){this.updateSpannedEventDetails(s,o,p,c,a,l);var h=a[this.fields.startTime],d=new Date(a[this.fields.endTime]-1);l.count=d.getMonth()-h.getMonth()+this.parent.monthsCount*(d.getFullYear()-h.getFullYear())+1}else if(this.updateSpannedEventDetails(s,o,n,r,a,l),0===this.parent.activeViewOptions.group.resources.length||this.parent.uiStateValues.isGroupAdaptive){var u=ve(a[this.fields.endTime]).getTime(),g=ve(a[this.fields.startTime]).getTime();(t[this.fields.isAllDay]&&u===t[this.fields.endTime].getTime()||l.isRight)&&(u=ye(new Date(u),-1).getTime()),l.count=Math.round((u-g)/ie)+1}return a.isSpanned=l,ve(s).getTime()<ve(this.parent.minDate).getTime()&&(a[this.fields.startTime]=this.parent.minDate),ve(o).getTime()>ve(this.parent.maxDate).getTime()&&(a[this.fields.endTime]=this.parent.maxDate),a},i.prototype.updateSpannedEventDetails=function(e,t,i,n,r,a){e.getTime()<i.getTime()&&(r[this.fields.startTime]=i,a.isLeft=!0),t.getTime()>n.getTime()&&(r[this.fields.endTime]=n,a.isRight=!0)},i.prototype.getOverlapEvents=function(e,t){var i,n,r=[];if(this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive){var a=this.parent.calendarUtil.getMonthStartDate(new Date(e.getTime())),s=ye(this.parent.calendarUtil.getMonthEndDate(new Date(e.getTime())),-1);i=ve(new Date(a.getTime())).getTime(),n=ve(new Date(s.getTime())).getTime()}else this.parent.rowAutoHeight?(i=ve(new Date(e.getTime())).getTime(),n=ye(ve(new Date(e.getTime())),1).getTime()):i=n=ve(new Date(e.getTime())).getTime();for(var o=0,l=t;o<l.length;o++){var p=l[o],c=new Date(p[this.fields.startTime].getTime()),h=new Date(p[this.fields.endTime].getTime()),d=p[this.fields.isAllDay]?ve(h).getTime()>i:ve(h).getTime()>=i;(ve(c).getTime()<=i&&d||ve(c).getTime()>=i&&ve(h).getTime()<=n||"Vertical"===this.parent.activeViewOptions.orientation&&ve(c).getTime()>=i&&ve(h).getTime()>=n)&&r.push(p)}return r},i.prototype.getMonths=function(){var e=this;return Array.apply(null,{length:this.parent.monthsCount}).map((function(t,i){return e.parent.firstMonthOfYear+i}))},i.prototype.removeCellHeight=function(){for(var e="."+hr+" tbody tr,."+Tt+" tbody tr,."+Je+" tbody tr",t=0,i=[].slice.call(this.element.querySelectorAll(e));t<i.length;t++){i[t].firstElementChild.style.height=""}},i.prototype.destroy=function(){t.prototype.destroy.call(this),this.parent=null},i}(Pa),Zo=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Jo=function(t){function i(){var e=null!==t&&t.apply(this,arguments)||this;return e.widthUptoCursorPoint=0,e.heightUptoCursorPoint=0,e.cursorPointIndex=0,e.isHeaderRows=!1,e.isTimelineDayProcess=!1,e.widthPerMinute=0,e.heightPerMinute=0,e.minDiff=0,e.isStepDragging=!1,e.isMorePopupOpened=!1,e.isAllDayDrag=!1,e.isMultiSelect=!1,e.multiData=[],e.updatedData=[],e.swagData=[],e.startTime=0,e.isAllDayTarget=!1,e.targetTd=null,e.isCursorAhead=!1,e.enableCurrentViewDrag=!1,e.isPreventMultiDrag=!1,e.slotsUptoCursor=-1,e.eleTop=0,e.distanceUptoCursor=0,e}return Zo(i,t),i.prototype.wireDragEvent=function(t){new e.Draggable(t,{abort:"."+Ei,clone:!0,isDragScroll:!0,enableTailMode:!!this.parent.eventDragArea,cursorAt:this.parent.eventDragArea?{left:-20,top:-20}:{left:0,top:0},dragArea:this.dragArea,dragStart:this.dragStart.bind(this),drag:this.drag.bind(this),dragStop:this.dragStop.bind(this),enableAutoScroll:!1,helper:this.dragHelper.bind(this),queryPositionInfo:this.dragPosition.bind(this)})},i.prototype.setDragArea=function(){var e=document.querySelector(this.parent.eventDragArea);this.dragArea=this.parent.eventDragArea&&e?e:this.parent.element.querySelector("."+Je)},i.prototype.dragHelper=function(t){var i=this;if(t.sender&&"touchmove"===t.sender.type&&(!this.parent.uiStateValues.isTapHold||!t.element.classList.contains(Zt)))return null;if(this.setDragActionDefaultValues(),this.actionObj.element=t.element,t.sender&&["Day","Week","WorkWeek"].indexOf(this.parent.currentView)>-1){var n=this.parent.eventBase.getPageCoordinates(t.sender);this.distanceUptoCursor=n.clientY-this.actionObj.element.getBoundingClientRect().top,this.eleTop=parseFloat(this.actionObj.element.style.top),this.slotsUptoCursor=-1}this.actionObj.action="drag";var r=[];return!this.parent.allowMultiDrag||(0,e.isNullOrUndefined)(this.parent.selectedElements)||0===this.parent.selectedElements.length||this.parent.selectedElements.length>0&&-1===this.parent.selectedElements.indexOf(this.actionObj.element)?r=[t.element]:(r=this.parent.selectedElements,this.isMultiSelect=!0),r.forEach((function(t){var n=i.createCloneElement(t);t.getAttribute("data-guid")===i.actionObj.element.getAttribute("data-guid")&&(i.actionObj.clone=n,i.parent.eventDragArea||"Month"===i.parent.currentView||!i.parent.activeViewOptions.timeScale.enable||i.parent.activeView.isTimelineView()||i.actionObj.element.classList.contains(ji)||(0,e.setStyleAttribute)(i.actionObj.clone,{cursor:"move",left:"0%",right:"0%",width:"100%"}),i.actionObj.clone.style.top=(0,e.formatUnit)(i.actionObj.element.offsetTop)),i.actionObj.cloneElement.push(n),i.actionObj.originalElement.push(t)})),this.actionObj.clone},i.prototype.dragPosition=function(t){if(this.parent.eventDragArea)return{left:t.left,top:t.top};var i,n=this.actionObj.cellHeight/this.actionObj.slotInterval*this.actionObj.interval,r=(0,e.formatUnit)(0);"Month"===this.parent.currentView&&(r=t.left),i=this.isStepDragging?Math.ceil(this.actionObj.clone.getBoundingClientRect().right)+this.actionObj.interval:this.actionObj.clone.getBoundingClientRect().right;var a,s=this.parent.element.querySelector("."+ri).getBoundingClientRect().right;if(!(this.parent.activeView.isTimelineView()&&"TimelineYear"!==this.parent.currentView&&!this.parent.enableRtl&&this.actionObj.pageX>i)||this.isMorePopupOpened||this.actionObj.pageX>s||(this.isCursorAhead=!0),this.parent.activeView.isTimelineView()&&(r=(0,e.formatUnit)(this.actionObj.clone.offsetLeft)),this.parent.activeView.isTimelineView()||!this.parent.timeScale.enable||!(0,e.isNullOrUndefined)(this.actionObj.clone.offsetParent)&&this.actionObj.clone.offsetParent.classList.contains(tn))a=(0,e.formatUnit)(this.actionObj.clone.offsetTop);else if("Month"===this.parent.currentView)a=(0,e.formatUnit)(0);else if(this.actionObj.clone.classList.contains(ji))a=(0,e.formatUnit)(this.parent.element.querySelector("."+Ze).offsetTop),(0,e.setStyleAttribute)(this.actionObj.clone,{width:(0,e.formatUnit)(Math.ceil(this.actionObj.clone.offsetWidth/this.actionObj.cellWidth)*this.actionObj.cellWidth),right:this.parent.enableRtl&&(0,e.formatUnit)(0)});else{this.actionObj.element.classList.contains(ji)&&!this.actionObj.clone.classList.contains(ji)&&(0,e.setStyleAttribute)(this.actionObj.clone,{height:(0,e.formatUnit)(this.actionObj.cellHeight),width:(0,e.formatUnit)(this.actionObj.cellWidth-1),pointerEvents:"none"});var o=parseInt(t.top,10);if(o=o<0?0:o,this.slotsUptoCursor<0){var l=Math.floor((this.eleTop+this.distanceUptoCursor)/n),p=Math.floor(this.eleTop/n);this.slotsUptoCursor=l-p}o=(Math.floor((o+this.distanceUptoCursor+1)/n)-this.slotsUptoCursor)*n,a=(0,e.formatUnit)(o<0?0:o);var c=this.parent.element.querySelector(".e-content-wrap").scrollHeight,h=parseInt(a,10)+this.actionObj.clone.offsetHeight;h>c&&(a=parseInt(a,10)-(h-c)+"px"),this.isPreventMultiDrag&&(a=(0,e.formatUnit)(this.actionObj.clone.offsetTop))}return{left:r,top:a}},i.prototype.setDragActionDefaultValues=function(){this.actionObj.action="drag",this.actionObj.isAllDay=null,this.actionObj.slotInterval=this.parent.activeViewOptions.timeScale.interval/this.parent.activeViewOptions.timeScale.slotCount,this.actionObj.interval=this.actionObj.slotInterval;var e=this.parent.element.querySelector("."+$e);this.actionObj.cellWidth=e.offsetWidth,this.actionObj.cellHeight=e.offsetHeight},i.prototype.dragStart=function(t){var i=this,n=this.actionObj.element.getAttribute("data-guid");this.actionObj.event=this.parent.eventBase.getEventByGuid(n);var r=(0,e.extend)({},this.actionObj.event,null,!0);(0,e.isNullOrUndefined)(r)||(this.startTime=r[this.parent.eventFields.startTime].getTime()),this.parent.allowMultiDrag||this.parent.eventBase.removeSelectedAppointmentClass();var a={cancel:!1,data:r,selectedData:this.getSelectedData(),event:t,excludeSelectors:null,element:this.actionObj.element,interval:this.actionObj.interval,navigation:{enable:!1,timeDelay:2e3},scroll:{enable:!0,scrollBy:30,timeDelay:100}};this.parent.trigger(S,a,(function(n){if(n.cancel||!(0,e.isNullOrUndefined)(i.actionObj.element)&&(0,e.isNullOrUndefined)(i.actionObj.element.parentElement)){var s=i.actionObj.element.ej2_instances[0];return(0,e.isNullOrUndefined)(s)||s.intDestroy(t.event),i.actionObj.action="",i.removeCloneElementClasses(),void i.removeCloneElement()}i.actionClass("addClass"),i.parent.uiStateValues.action=!0,i.actionObj.start=r[i.parent.eventFields.startTime],i.actionObj.end=r[i.parent.eventFields.endTime],i.actionObj.groupIndex=parseInt(i.actionObj.element.getAttribute("data-group-index")||"0",10),i.actionObj.interval=n.interval,i.actionObj.navigation=n.navigation,i.actionObj.scroll=n.scroll,i.enableCurrentViewDrag=a.dragWithinRange&&!a.navigation.enable&&i.parent.allowMultiDrag,i.actionObj.excludeSelectors=n.excludeSelectors;var o=i.parent.element.querySelector("."+ri);if(i.scrollArgs={element:o,width:o.scrollWidth,height:o.scrollHeight},i.widthPerMinute=i.actionObj.cellWidth/i.actionObj.slotInterval*i.actionObj.interval,i.heightPerMinute=i.actionObj.cellHeight/i.actionObj.slotInterval*i.actionObj.interval,i.widthUptoCursorPoint=0,i.heightUptoCursorPoint=0,i.cursorPointIndex=-1,i.isHeaderRows=!1,i.isTimelineDayProcess=!1,i.minDiff=0,i.isMorePopupOpened=!1,i.daysVariation=-1,i.isAllDayTarget=i.actionObj.clone.classList.contains(ji),(i.parent.activeView.isTimelineView()||!i.parent.timeScale.enable)&&"TimelineYear"!==i.parent.currentView){!(0,e.isNullOrUndefined)(i.actionObj.clone.offsetParent)&&i.actionObj.clone.offsetParent.classList.contains(tn)&&(i.isMorePopupOpened=!0),i.actionObj.pageX=t.event.pageX;var l=i.parent.activeViewOptions.headerRows;i.isHeaderRows=l.length>0&&"Hour"!==l[l.length-1].option&&"Date"!==l[l.length-1].option,i.isTimelineDayProcess=!i.parent.activeViewOptions.timeScale.enable||i.isHeaderRows||"TimelineMonth"===i.parent.currentView||l.length>0&&"Date"===l[l.length-1].option,i.isAllDayDrag=!i.isTimelineDayProcess&&r[i.parent.eventFields.isAllDay],i.isStepDragging=!i.isTimelineDayProcess&&!i.isAllDayDrag&&i.actionObj.slotInterval!==i.actionObj.interval,i.isTimelineDayProcess?i.timelineEventModule=new Pa(i.parent,"day"):i.timelineEventModule=new Pa(i.parent,"hour")}("TimelineYear"===i.parent.currentView&&(i.yearEvent=new Ko(i.parent)),"Month"===i.parent.currentView&&(i.startTime=ve(new Date(i.startTime)).getTime(),i.updateOriginalElement(i.actionObj.clone),i.monthEvent=new Ra(i.parent)),"Day"===i.parent.currentView||"Week"===i.parent.currentView||"WorkWeek"===i.parent.currentView)&&(i.verticalEvent=new Ma(i.parent),i.verticalEvent.initializeValues(),i.splitEvent(i.actionObj.event).forEach((function(t){var n='.e-day-wrapper[data-date="'+ve(t[i.parent.eventFields.startTime]).getTime()+'"]';i.parent.activeViewOptions.group.resources.length>0&&(n=n.concat('[data-group-index = "'+i.actionObj.groupIndex+'"]'));var r=i.parent.element.querySelector(n);if(r){var a=r.querySelector('[data-id="'+i.actionObj.clone.getAttribute("data-id")+'"]');a&&(0,e.addClass)([a],Di)}})))}))},i.prototype.getSelectedData=function(){if(this.isMultiSelect&&0===this.multiData.length&&this.parent.selectedElements.length>0)for(var t=0,i=this.parent.selectedElements;t<i.length;t++){var n=i[t].getAttribute("data-guid"),r=this.parent.eventBase.getEventByGuid(n);this.multiData.push((0,e.extend)({},r,null,!0))}return this.multiData},i.prototype.drag=function(t){if(t.event&&"touchmove"===t.event.type&&t.event.preventDefault(),this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide(!0),(0,e.isNullOrUndefined)(t.target)||!t.target.classList||!t.target.classList.contains(Qn)){var i=(0,e.extend)({},this.actionObj.event,null,!0),n=this.parent.eventBase.getPageCoordinates(t);if(this.actionObj.Y=this.actionObj.pageY=n.pageY,this.actionObj.X=this.actionObj.pageX=n.pageX,this.actionObj.target=t.target,this.widthUptoCursorPoint=0===this.widthUptoCursorPoint?Math.ceil(Math.abs(this.actionObj.clone.getBoundingClientRect().left-this.actionObj.X)/this.widthPerMinute)*this.widthPerMinute:this.widthUptoCursorPoint,this.widthUptoCursorPoint=this.isMorePopupOpened?this.actionObj.cellWidth:this.widthUptoCursorPoint,this.heightUptoCursorPoint=0===this.heightUptoCursorPoint?Math.ceil(Math.abs(this.actionObj.clone.getBoundingClientRect().top-this.actionObj.Y)/this.heightPerMinute)*this.heightPerMinute:this.heightUptoCursorPoint,["Day","Week","WorkWeek"].indexOf(this.parent.currentView)>-1&&(this.isAllDayDrag=this.parent.activeViewOptions.timeScale.enable?this.actionObj.clone.classList.contains(ji):this.actionObj.event[this.parent.eventFields.isAllDay]),this.isStepDragging&&0===this.minDiff&&this.calculateMinutesDiff(i),("Month"===this.parent.currentView||this.isAllDayDrag)&&this.daysVariation<0){var r=this.parent.getDateFromElement(this.actionObj.target);if((0,e.isNullOrUndefined)(r))this.daysVariation=0;else{var a=ve(r),s=ve(new Date(i[this.parent.eventFields.startTime].getTime()));this.daysVariation=(a.getTime()-s.getTime())/ie}}else this.daysVariation=0;if(this.parent.eventDragArea){var o=n.target;this.actionObj.clone.style.top=(0,e.formatUnit)(o.offsetTop),this.actionObj.clone.style.left=(0,e.formatUnit)(o.offsetLeft),(0,e.closest)(o,"."+Fe)?"Week"!==this.parent.currentView&&"WorkWeek"!==this.parent.currentView&&"Day"!==this.parent.currentView&&(this.actionObj.clone.style.width=(0,e.formatUnit)(this.actionObj.element.offsetWidth)):(this.actionObj.clone.style.height="",this.actionObj.clone.style.width="")}this.updateScrollPosition(t),this.updateNavigatingPosition(t),this.updateDraggingDateTime(t);var l={data:i,event:t,element:this.actionObj.element,startTime:this.actionObj.start,endTime:this.actionObj.end,selectedData:this.updatedData};this.parent.group.resources.length>0&&(l.groupIndex=this.actionObj.groupIndex),this.parent.trigger(C,l)}},i.prototype.calculateMinutesDiff=function(e){this.parent.enableRtl?this.minDiff=(this.actionObj.clone.offsetWidth-this.widthUptoCursorPoint)/this.widthPerMinute*this.actionObj.interval:this.minDiff=this.widthUptoCursorPoint/this.widthPerMinute*this.actionObj.interval;var t=e[this.parent.eventFields.startTime],i=De(this.parent.activeView.renderDates[0],this.parent.activeView.getStartHour(),this.parent.activeView.getEndHour());i.startHour.getTime()>t.getTime()&&(this.minDiff=this.minDiff+(i.startHour.getTime()-t.getTime())/ne)},i.prototype.dragStop=function(t){var i=this;if(this.isCursorAhead=!1,this.isPreventMultiDrag=!1,this.removeCloneElementClasses(),this.removeCloneElement(),clearInterval(this.actionObj.navigationInterval),this.actionObj.navigationInterval=null,clearInterval(this.actionObj.scrollInterval),this.actionObj.scrollInterval=null,this.actionClass("removeClass"),this.parent.uiStateValues.action=this.parent.uiStateValues.isTapHold=!1,!this.isAllowDrop(t)){var n=t.target.classList&&!t.target.classList.contains("e-work-cells")&&this.parent.cellTemplate?(0,e.closest)(t.target,".e-work-cells"):t.target,r={cancel:!1,data:this.getChangedData(this.updatedData),selectedData:this.updatedData,event:t,element:this.actionObj.element,target:n};this.actionObj.action=null,this.parent.trigger(O,r,(function(e){if(!e.cancel&&!i.parent.eventBase.checkOverlap(e.data)){if(i.parent.isSpecificResourceEvents()){i.parent.crudModule.crudObj.isCrudAction=!0,i.parent.crudModule.crudObj.sourceEvent=[i.parent.resourceBase.lastResourceLevel[parseInt(r.element.getAttribute("data-group-index"),10)]];var t=parseInt(r.target.getAttribute("data-group-index"),10)||i.actionObj.groupIndex;i.parent.crudModule.crudObj.targetEvent=[i.parent.resourceBase.lastResourceLevel[parseInt(t.toString(),10)]]}i.saveChangedData(e,i.isMultiSelect)}})),this.updatedData=[],this.multiData=[],this.isMultiSelect=!1,this.parent.selectedElements=[]}},i.prototype.updateNavigatingPosition=function(t){var i=this;if(this.actionObj.navigation.enable){var n=this.parent.getCurrentTime();(0,e.isNullOrUndefined)(this.actionObj.navigationInterval)&&(this.actionObj.navigationInterval=window.setInterval((function(){if(n){var e=i.parent.getCurrentTime().getSeconds(),r=n.getSeconds()+i.actionObj.navigation.timeDelay/1e3;(r=r>=60?r-60:r)===e&&(n=i.parent.getCurrentTime(),i.viewNavigation(t),i.updateDraggingDateTime(t))}}),this.actionObj.navigation.timeDelay))}},i.prototype.updateDraggingDateTime=function(t){!(0,e.isNullOrUndefined)(this.actionObj.clone.offsetParent)&&this.actionObj.clone.offsetParent.classList.contains(tn)?this.morePopupEventDragging(t):this.parent.activeView.isTimelineView()&&"TimelineYear"!==this.parent.currentView?(this.timelineEventModule.dateRender=this.parent.activeView.renderDates,this.timelineEventModule.cellWidth=this.actionObj.cellWidth,this.timelineEventModule.getSlotDates(),this.actionObj.cellWidth=this.isHeaderRows?this.timelineEventModule.cellWidth:this.parent.getElementWidth(this.parent.element.querySelector("."+$e)),this.calculateTimelineTime(t)):"Month"===this.parent.currentView||"TimelineYear"===this.parent.currentView?this.calculateVerticalDate(t):this.calculateVerticalTime(t)},i.prototype.navigationWrapper=function(){if(this.parent.activeView.isTimelineView()){var t=void 0;if(t=this.parent.activeViewOptions.group.resources.length>0?this.parent.element.querySelectorAll(".e-appointment-container:not(.e-hidden)").item(this.actionObj.index):this.parent.element.querySelector("."+Gt),!(0,e.isNullOrUndefined)(t)){var i=t.querySelector("."+jt);i||(i=(0,e.createElement)("div",{className:jt}),t.appendChild(i)),this.actionObj.cloneElement.forEach((function(e){i.appendChild(e)}))}}else if("Month"!==this.parent.currentView&&this.parent.timeScale.enable){var n=this.actionObj.clone.classList.contains(ji)?"."+Pi:"."+jt;if(this.parent.element.querySelectorAll(n).item(this.actionObj.index).appendChild(this.actionObj.clone),n==="."+Pi){var r=this.getAllDayEventHeight(),a=[].slice.call(this.parent.element.querySelectorAll("."+Ke+":first-child"));if(a[0].offsetHeight<r)for(var s=0,o=a;s<o.length;s++){o[s].style.height=(r+2)/12+"em"}this.actionObj.clone.style.height=(0,e.formatUnit)(r)}this.actionObj.height=parseInt(this.actionObj.clone.style.height,10)}else{var l=[].slice.call(this.parent.element.querySelectorAll("."+$e));this.actionObj.index=this.parent.activeView.renderDates.length<this.actionObj.index?this.parent.activeView.renderDates.length-1:this.actionObj.index;var p=l[this.actionObj.index].querySelector("."+jt);p||(p=(0,e.createElement)("div",{className:jt}),l[this.actionObj.index].appendChild(p)),p.appendChild(this.actionObj.clone)}},i.prototype.viewNavigation=function(t){var i,n=this.parent.element.querySelector("."+ri);n&&(!this.scrollEdges.top&&!this.scrollEdges.bottom||(0,e.closest)(this.actionObj.clone,"."+Pi))&&(0===n.scrollLeft&&Math.round(this.actionObj.X)<=Math.round(n.getBoundingClientRect().left+this.actionObj.cellWidth+window.pageXOffset)?i=this.parent.enableRtl?"Next":"Previous":Math.round(n.scrollLeft)+n.clientWidth===n.scrollWidth&&Math.round(this.actionObj.X)>=Math.round(n.getBoundingClientRect().right-this.actionObj.cellWidth+window.pageXOffset)&&(i=this.parent.enableRtl?"Previous":"Next"),i&&this.parent.changeDate(this.parent.activeView.getNextPreviousDate(i)))},i.prototype.morePopupEventDragging=function(t){if(!((0,e.isNullOrUndefined)(t.target)||t.target&&(0,e.isNullOrUndefined)((0,e.closest)(t.target,"td")))){var i=(0,e.extend)({},this.actionObj.event,null,!0),n=i[this.parent.eventFields.endTime].getTime()-i[this.parent.eventFields.startTime].getTime(),r=(0,e.closest)(t.target,"td");if("TimelineYear"!==this.parent.currentView||r.classList.contains($e)&&!r.classList.contains(st)){var a=this.parent.getDateFromElement(r),s=new Date(a.getTime());s.setMilliseconds(n),this.parent.activeViewOptions.group.resources.length>0&&(this.actionObj.groupIndex=parseInt(r.getAttribute("data-group-index"),10)),this.actionObj.start=new Date(a.getTime()),this.actionObj.end=new Date(s.getTime()),this.actionObj.clone.style.top=(0,e.formatUnit)(r.offsetParent.offsetTop),this.actionObj.clone.style.left=(0,e.formatUnit)(r.offsetLeft),this.actionObj.clone.style.width=(0,e.formatUnit)(r.offsetWidth);var o,l=r;if(this.parent.activeView.isTimelineView()){var p=(0,e.closest)(r,"tr").rowIndex;l=this.parent.element.querySelectorAll(".e-appointment-container").item(p)}(o=l.querySelector("."+jt))||(o=(0,e.createElement)("div",{className:jt}),l.appendChild(o)),this.appendCloneElement(o)}}},i.prototype.calculateVerticalTime=function(t){var i=this;if(!((0,e.isNullOrUndefined)(this.actionObj.target)||this.actionObj.target&&(0,e.isNullOrUndefined)((0,e.closest)(this.actionObj.target,"tr")))&&((0,e.isNullOrUndefined)((0,e.closest)(this.actionObj.target,"td"))||(0,e.closest)(this.actionObj.target,"td").classList.contains($e)||(0,e.closest)(this.actionObj.target,"td").classList.contains(Ke))){this.parent.activeViewOptions.timeScale.enable&&this.swapDragging(t);var n=this.parent.element.querySelector("."+ri),r=(0,e.extend)({},this.actionObj.event,null,!0),a=r[this.parent.eventFields.startTime],s=Re(r[this.parent.eventFields.endTime])-Re(a),o=Math.floor(parseInt(this.actionObj.clone.style.top,10)/this.actionObj.cellHeight)*this.actionObj.cellHeight;o=o<0?0:o,(this.scrollEdges.top||this.scrollEdges.bottom)&&(o=this.scrollEdges.top?n.scrollTop-this.heightUptoCursorPoint+this.actionObj.cellHeight+window.pageYOffset:n.scrollTop+n.offsetHeight-this.actionObj.clone.offsetHeight+window.pageYOffset+(this.actionObj.clone.offsetHeight-this.heightUptoCursorPoint),o=Math.round(o/this.actionObj.cellHeight)*this.actionObj.cellHeight,n.scrollTop>0&&o<n.scrollHeight&&(this.actionObj.clone.style.top=(0,e.formatUnit)(o)));var l,p,c=this.parent.activeViewOptions.timeScale.enable?o/this.actionObj.cellHeight:0,h=this.actionObj.cellHeight/this.actionObj.slotInterval,d=parseInt(this.actionObj.clone.style.top,10)-o;if(this.isAllDayDrag)l=this.parent.element.querySelector("."+Ze);else l=[].slice.call(this.parent.getContentTable().querySelectorAll("tr"))[parseInt(c.toString(),10)];(0,e.isNullOrUndefined)((0,e.closest)(this.actionObj.target,"td"))||!(0,e.closest)(this.actionObj.target,"td").classList.contains($e)&&!(0,e.closest)(this.actionObj.target,"td").classList.contains(Ke)||(p=(0,e.closest)(this.actionObj.target,"td").cellIndex);var u=(0,e.isNullOrUndefined)(p)?(0,e.closest)(this.actionObj.clone,"td").cellIndex:p;if(this.actionObj.index=u,!(0,e.isNullOrUndefined)(l)){var g,v,m=l.children[parseInt(u.toString(),10)];if(this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&(this.actionObj.groupIndex=parseInt(m.getAttribute("data-group-index"),10)),this.parent.activeViewOptions.timeScale.enable&&!this.isAllDayDrag)this.enableCurrentViewDrag&&0!==this.multiData.length||this.appendCloneElement(this.getEventWrapper(u)),(g=this.parent.getDateFromElement(m)).setMinutes(g.getMinutes()+d/h),v=new Date(g.getTime()),this.actionObj.element.classList.contains(ji)?v.setMinutes(v.getMinutes()+this.actionObj.slotInterval):v.setMilliseconds(s);else{(g=this.parent.getDateFromElement(m)).setDate(g.getDate()-this.daysVariation),g.setHours(a.getHours(),a.getMinutes(),a.getSeconds()),(v=new Date(g.getTime())).setMilliseconds(s),!this.actionObj.element.classList.contains(ji)&&this.actionObj.clone.classList.contains(ji)&&(v=ye(ve(v),1));var f=this.parent.activeViewOptions.group.byDate||this.parent.virtualScrollModule&&!this.parent.activeViewOptions.timeScale.enable?u:void 0;this.updateAllDayEvents(g,v,f)}this.actionObj.start=new Date(+g),this.actionObj.end=new Date(+v);for(var y=this.getUpdatedEvent(this.actionObj.start,this.actionObj.end,this.actionObj.event),T=0,w=[].slice.call(this.parent.element.querySelectorAll(".e-dynamic-clone"));T<w.length;T++){var D=w[T];(0,e.remove)(D)}if(this.multiData.length>0){if(this.isAllDayTarget&&this.isAllDayDrag&&!(0,e.isNullOrUndefined)(this.actionObj.isAllDay)&&!this.actionObj.isAllDay){var b=parseInt((0,e.closest)(this.actionObj.target,"td").getAttribute("data-date"),10);this.multiData.forEach((function(t){if(i.swagData.push((0,e.extend)({},t,null,!0)),t[i.parent.eventFields.isAllDay]){t[i.parent.eventFields.startTime]=new Date(t[i.parent.eventFields.startTime].getTime()+(b-i.startTime));var n=new Date(t[i.parent.eventFields.startTime]),r=new Date(n.setMinutes(n.getMinutes()+i.actionObj.slotInterval));t[i.parent.eventFields.endTime]=r,t[i.parent.eventFields.isAllDay]=!1}})),this.startTime=b}if(this.isAllDayTarget&&this.isAllDayDrag&&!(0,e.isNullOrUndefined)(this.actionObj.isAllDay)&&this.actionObj.isAllDay&&this.swagData.length>0){this.multiData=this.swagData,this.swagData=[];var S=(0,e.extend)({},this.actionObj.event,null,!0);this.startTime=S[this.parent.eventFields.startTime].getTime()}var C=y[this.parent.eventFields.startTime].getTime()-this.startTime;if(this.enableCurrentViewDrag)for(var O=this.getRenderedDates(),E=0;E<this.multiData.length;E++){var x=(0,e.extend)({},this.multiData[parseInt(E.toString(),10)],null,!0),V=new Date(x[this.parent.eventFields.startTime].getTime()+C);if((I=this.parent.getIndexOfDate(O,ve(V)))<0){this.isPreventMultiDrag=!0;break}this.isPreventMultiDrag=!1}if(!this.isPreventMultiDrag)for(var A=0;A<this.multiData.length;A++){var I;if(this.updatedData[parseInt(A.toString(),10)]=this.updateMultipleData(this.multiData[parseInt(A.toString(),10)],C),(I=this.getDayIndex(this.updatedData[parseInt(A.toString(),10)]))>=0){var M=this.updatedData[parseInt(A.toString(),10)][this.parent.eventFields.isAllDay];D=this.getEventWrapper(I,M);this.appendCloneElement(D,this.actionObj.cloneElement[parseInt(A.toString(),10)]),this.updateEventHeight(this.updatedData[parseInt(A.toString(),10)],A,I)}else(0,e.isNullOrUndefined)(this.actionObj.cloneElement[parseInt(A.toString(),10)].parentNode)||(0,e.remove)(this.actionObj.cloneElement[parseInt(A.toString(),10)])}}else this.updateEventHeight(y);this.updateTimePosition(this.actionObj.start,this.updatedData)}}},i.prototype.splitEvent=function(t){var i=this.parent.eventFields,n=[],r=t[i.startTime],a=t[i.endTime];if(ve(new Date(r.getTime()))<ve(new Date(a.getTime()))){for(var s=ve(new Date(r.getTime())),o=new Date(s.getTime()),l=0;s<new Date(a.getTime());l++){o=new Date(o.setDate(s.getDate()+1));var p=(0,e.extend)({},t,null,!0);p[i.startTime]=new Date(s),p[i.endTime]=new Date(o),s=new Date(s.setDate(s.getDate()+1)),n.push(p)}var c=n.length-1;n[0][i.startTime]=r,n[parseInt(c.toString(),10)][i.endTime]=a}else n.push(t);return n},i.prototype.updateMultipleData=function(t,i){var n=(0,e.extend)({},t,null,!0);!(0,e.isNullOrUndefined)(this.actionObj.isAllDay)&&this.parent.activeViewOptions.timeScale.enable&&(this.isAllDayTarget&&n[this.parent.eventFields.isAllDay]||!this.isAllDayTarget&&!n[this.parent.eventFields.isAllDay])&&(n[this.parent.eventFields.isAllDay]=this.actionObj.isAllDay);var r=n[this.parent.eventFields.endTime].getTime()-n[this.parent.eventFields.startTime].getTime();if(n[this.parent.eventFields.isAllDay]){var a=Math.ceil(i/864e5),s=Math.ceil(r/864e5),o=new Date(n[this.parent.eventFields.startTime]);n[this.parent.eventFields.startTime]=ve(new Date(o.setDate(o.getDate()+a))),n[this.parent.eventFields.endTime]=ye(n[this.parent.eventFields.startTime],s)}else n[this.parent.eventFields.startTime]=new Date(n[this.parent.eventFields.startTime].getTime()+i),n[this.parent.eventFields.endTime]=new Date(n[this.parent.eventFields.startTime].getTime()+r);return n},i.prototype.getDayIndex=function(t){var i=(0,e.extend)({},t,null,!0),n=ve(i[this.parent.eventFields.startTime]);if(this.parent.activeViewOptions.timeScale.enable&&!i[this.parent.eventFields.isAllDay]){var r=this.parent.activeView.getStartHour();n.setMilliseconds(r.getTime()-ve(r).getTime())}var a=n.getTime(),s="";return s="."+(this.parent.activeViewOptions.timeScale.enable&&i[this.parent.eventFields.isAllDay]?Pi:$e)+'[data-date="'+a+'"]',this.parent.activeViewOptions.group.resources.length>0&&(s=s+'[data-group-index="'+this.actionObj.groupIndex+'"]'),this.targetTd=this.parent.element.querySelector(s),(0,e.isNullOrUndefined)(this.targetTd)?-1:this.targetTd.cellIndex},i.prototype.updateEventHeight=function(t,i,n){this.verticalEvent.initializeValues();var r=this.verticalEvent.getStartCount();if(!this.parent.uiStateValues.isGroupAdaptive)for(var a=0;a<this.actionObj.groupIndex;a++)this.verticalEvent.dateRender[parseInt(a.toString(),10)]&&(r+=this.verticalEvent.dateRender[parseInt(a.toString(),10)].length);var s=this.parent.uiStateValues.isGroupAdaptive?r:this.actionObj.groupIndex;if(!(!this.parent.activeViewOptions.group.byDate||(0,e.isNullOrUndefined)(this.parent.getDateFromElement(this.actionObj.target)))||!this.parent.activeViewOptions.group.byDate){var o=-1,l=this.parent.activeViewOptions.group.byDate?this.parent.getIndexOfDate(this.verticalEvent.dateRender[parseInt(s.toString(),10)],ve(this.parent.getDateFromElement((0,e.isNullOrUndefined)(i)?this.actionObj.target:this.targetTd))):(0,e.isNullOrUndefined)(i)?this.actionObj.index-r:n-r,p=this.splitEvent(t),c=this.parent.eventBase.isAllDayAppointment(t)||p.length>2||"TimeSlot"!==this.parent.eventSettings.spannedEventPlacement?[t]:p;for(a=0;a<c.length;a++){if(a>0){var h='.e-day-wrapper[data-date="'+ve(c[parseInt(a.toString(),10)][this.parent.eventFields.startTime]).getTime()+'"]';this.parent.activeViewOptions.group.resources.length>0&&(h=h.concat('[data-group-index = "'+this.actionObj.groupIndex+'"]'));var d=this.parent.element.querySelector(h);d?(l+=1,o=d.cellIndex):l=-1}if(l>=0){var u=this.verticalEvent.isSpannedEvent(c[parseInt(a.toString(),10)],l,s),g=u[this.verticalEvent.fields.startTime],v=u[this.verticalEvent.fields.endTime],m=this.parent.activeViewOptions.timeScale.enable?this.verticalEvent.getHeight(g,v):this.actionObj.element.offsetHeight,f=this.parent.activeViewOptions.timeScale.enable?this.verticalEvent.getTopValue(g):this.actionObj.element.offsetTop;if((0,e.isNullOrUndefined)(i))0===a?(this.actionObj.clone.style.top=(0,e.formatUnit)(f),this.actionObj.clone.style.height=(0,e.formatUnit)(m)):this.renderSpannedEvents(u,o,f,m);else{var y=this.actionObj.cellWidth;if(t[this.parent.eventFields.isAllDay]){f=this.parent.element.querySelector("."+Ze).offsetTop,m=this.getAllDayEventHeight();var T=t[this.parent.eventFields.endTime].getTime()-t[this.parent.eventFields.startTime].getTime(),w=Math.ceil(T/864e5);w>=0&&(y=w*this.actionObj.cellWidth)}this.actionObj.cloneElement[parseInt(i.toString(),10)]&&(0===a?(this.actionObj.cloneElement[parseInt(i.toString(),10)].style.top=(0,e.formatUnit)(f),this.actionObj.cloneElement[parseInt(i.toString(),10)].style.height=(0,e.formatUnit)(m),this.actionObj.cloneElement[parseInt(i.toString(),10)].style.width=(0,e.formatUnit)(y),this.actionObj.cloneElement[parseInt(i.toString(),10)].style.left=(0,e.formatUnit)(0)):this.renderSpannedEvents(u,o,f,m))}}}}},i.prototype.renderSpannedEvents=function(t,i,n,r){if(t[this.parent.eventFields.startTime].getTime()!==t[this.parent.eventFields.endTime].getTime()){var a=this.verticalEvent.createAppointmentElement(t,!1,t.isSpanned,this.actionObj.groupIndex);(0,e.addClass)([a],[Si,"e-dynamic-clone"]),(0,e.setStyleAttribute)(a,{width:"100%",height:r+"px",top:n+"px",border:"0px"}),[].slice.call(this.parent.element.querySelectorAll("."+jt))[parseInt(i.toString(),10)].appendChild(a)}},i.prototype.getRenderedDates=function(){var e,t,i=this,n=this.parent.activeView.renderDates;((e=this.parent.eventBase.slots).push.apply(e,this.parent.activeView.renderDates.map((function(e){return+e}))),this.parent.activeViewOptions.group.resources.length>0)&&(this.parent.eventBase.slots=[],n=this.parent.resourceBase.lastResourceLevel.filter((function(e){return e.groupIndex===i.actionObj.groupIndex}))[0].renderDates,(t=this.parent.eventBase.slots).push.apply(t,n.map((function(e){return+e}))));return n},i.prototype.updateAllDayEvents=function(t,i,n){this.parent.eventBase.slots=[];var r=this.getUpdatedEvent(t,i,this.actionObj.event),a=this.getRenderedDates(),s=this.parent.eventBase.splitEvent(r,a),o='.e-all-day-cells[data-date="'+s[0][this.parent.eventFields.startTime].getTime()+'"]';this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&(o=o.concat('[data-group-index = "'+this.actionObj.groupIndex+'"]'));var l=[].slice.call(this.parent.element.querySelectorAll(o));if(l.length>0||!(0,e.isNullOrUndefined)(n)){var p=(0,e.isNullOrUndefined)(n)?l[0].cellIndex:n;this.appendCloneElement(this.getEventWrapper(p)),this.actionObj.clone.style.width=(0,e.formatUnit)(s[0].data.count*this.actionObj.cellWidth)}},i.prototype.swapDragging=function(t){if(!this.isPreventMultiDrag){var i=!(0,e.isNullOrUndefined)((0,e.closest)(this.actionObj.target,"td"))&&(0,e.closest)(this.actionObj.target,"td").cellIndex;if((0,e.closest)(this.actionObj.target,"."+it)&&!(0,e.closest)(this.actionObj.clone,"."+Pi)){(0,e.addClass)([this.actionObj.clone],ji),this.appendCloneElement(this.getEventWrapper(i)),this.actionObj.isAllDay=!0;var n=this.getAllDayEventHeight(),r=[].slice.call(this.parent.element.querySelectorAll("."+Ke+":first-child"));if(r[0].offsetHeight<n)for(var a=0,s=r;a<s.length;a++){s[a].style.height=(n+2)/12+"em"}(0,e.setStyleAttribute)(this.actionObj.clone,{width:(0,e.formatUnit)(this.actionObj.cellWidth),height:(0,e.formatUnit)(n),top:(0,e.formatUnit)(this.parent.element.querySelector("."+Ze).offsetTop)})}if((0,e.closest)(this.actionObj.target,"."+$e)&&!(0,e.closest)(this.actionObj.clone,"."+Lt)){(0,e.removeClass)([this.actionObj.clone],ji),this.appendCloneElement(this.getEventWrapper(i)),this.actionObj.isAllDay=!1;var o=0===this.actionObj.element.offsetHeight?this.actionObj.height:this.actionObj.element.offsetHeight;(0,e.setStyleAttribute)(this.actionObj.clone,{left:(0,e.formatUnit)(0),height:(0,e.formatUnit)(o),width:(0,e.formatUnit)(this.actionObj.cellWidth)})}}},i.prototype.calculateVerticalDate=function(t){if(!((0,e.isNullOrUndefined)(t.target)||t.target&&(0,e.isNullOrUndefined)((0,e.closest)(t.target,"tr"))||t.target&&"DIV"===t.target.tagName)){var i=(0,e.extend)({},this.actionObj.event,null,!0);(0,e.isNullOrUndefined)(this.parent.eventDragArea)&&this.removeCloneElement();var n=Re(i[this.parent.eventFields.endTime])-Re(i[this.parent.eventFields.startTime]),r=(0,e.closest)(this.actionObj.target,"td");if(!(0,e.isNullOrUndefined)(r)){var a=r.parentElement;this.actionObj.index=a.rowIndex*a.children.length+r.cellIndex,r=[].slice.call(this.parent.element.querySelectorAll("."+$e))[this.actionObj.index];var s=this.parent.getDateFromElement(r);if(!(0,e.isNullOrUndefined)(s)){this.parent.activeViewOptions.group.resources.length>0&&(this.actionObj.groupIndex=parseInt(r.getAttribute("data-group-index"),10));var o=new Date(s.setDate(s.getDate()-this.daysVariation)),l=new Date(o.getTime()),p=Re(i[this.parent.eventFields.startTime])-Re(ve(new Date(+i[this.parent.eventFields.startTime])));l.setMilliseconds(p);var c=new Date(l.getTime());c.setMilliseconds(n),this.actionObj.start=new Date(l.getTime()),this.actionObj.end=new Date(c.getTime())}}var h=this.getUpdatedEvent(this.actionObj.start,this.actionObj.end,this.actionObj.event);if((0,e.isNullOrUndefined)(this.parent.eventDragArea))for(var d=0,u=[].slice.call(this.parent.element.querySelectorAll("."+Si));d<u.length;d++){var g=u[d];(0,e.remove)(g)}if(this.multiData&&this.multiData.length>0){var v=ve(new Date(h[this.parent.eventFields.startTime]));p=v.getTime()-this.startTime;"TimelineYear"===this.parent.currentView&&this.parent.group.resources.length>0&&(p=12*(v.getFullYear()-new Date(this.startTime).getFullYear()),p-=new Date(this.startTime).getMonth(),p+=v.getMonth());for(var m=0;m<this.multiData.length;m++)this.updatedData[parseInt(m.toString(),10)]=this.updateMultipleVerticalDate(this.multiData[parseInt(m.toString(),10)],p),"TimelineYear"===this.parent.currentView?this.dynamicYearlyEventsRendering(this.updatedData[parseInt(m.toString(),10)]):this.dynamicEventsRendering(this.updatedData[parseInt(m.toString(),10)])}else"TimelineYear"===this.parent.currentView?this.dynamicYearlyEventsRendering(h):this.dynamicEventsRendering(h)}},i.prototype.updateMultipleVerticalDate=function(t,i){var n=(0,e.extend)({},t,null,!0),r=n[this.parent.eventFields.endTime].getTime()-n[this.parent.eventFields.startTime].getTime(),a=new Date(n[this.parent.eventFields.startTime]);if("TimelineYear"===this.parent.currentView&&this.parent.group.resources.length>0)n[this.parent.eventFields.startTime]=new Date(a.setMonth(a.getMonth()+i));else{var s=Math.ceil(i/ie);n[this.parent.eventFields.startTime]=new Date(a.setDate(a.getDate()+s))}return n[this.parent.eventFields.endTime]=new Date(n[this.parent.eventFields.startTime].getTime()+r),n},i.prototype.calculateTimelineTime=function(t){var i,n=(0,e.extend)({},this.actionObj.event,null,!0),r=Re(n[this.parent.eventFields.endTime])-Re(n[this.parent.eventFields.startTime]),a=this.parent.enableRtl?Math.abs(this.actionObj.clone.offsetLeft)-this.actionObj.clone.offsetWidth:parseInt(this.actionObj.clone.style.left,10);a=Math.round(a/this.actionObj.cellWidth)*this.actionObj.cellWidth,this.parent.enableRtl&&(i=Math.abs(parseInt(this.actionObj.clone.style.right,10)),this.actionObj.clone.style.right=(0,e.formatUnit)(i)),a=this.getOffsetValue(a,i);var s=this.getColumnIndex(a),o=this.parent.element.querySelector("."+ri),l=o.getBoundingClientRect().right,p=this.parent.activeView.isTimelineView()&&!this.parent.enableRtl&&this.actionObj.pageX>this.actionObj.clone.getBoundingClientRect().right&&!this.isMorePopupOpened&&!(this.actionObj.pageX>l),c=this.parent.eventDragArea?o.scrollLeft-o.offsetLeft:0;!this.isCursorAhead&&!p||this.isStepDragging||(this.isCursorAhead=!0);var h=Math.floor((this.actionObj.pageX-this.actionObj.clone.getBoundingClientRect().left+c)/this.actionObj.cellWidth);this.parent.enableRtl&&(h=Math.abs(Math.floor((this.actionObj.pageX-this.actionObj.clone.getBoundingClientRect().right)/this.actionObj.cellWidth))-1),this.cursorPointIndex<0&&this.cursorIndex(t,n,a,h);var d=this.parent.getContentTable().querySelector("tr"),u=this.getCursorCurrentIndex(s,h,d);u=u<0?0:u;var g=this.isHeaderRows?new Date(this.timelineEventModule.dateRender[parseInt(u.toString(),10)].getTime()):this.parent.getDateFromElement(d.children[parseInt(u.toString(),10)]);if(g=this.isAllDayDrag?ve(g):g,this.isStepDragging){var v=this.getWidthDiff(d,u);if(0!==v){var m=Math.ceil(v/this.widthPerMinute);if(g.setMinutes(g.getMinutes()+m*this.actionObj.interval),this.isCursorAhead||p)g.setMilliseconds(-r);else{g.setMinutes(g.getMinutes()-this.minDiff);var f=this.actionObj.interval*ne;m=Math.abs(g.getTime()-this.actionObj.start.getTime())/f;var y=Math.trunc(m);y!==m&&(m=y*f*(g>this.actionObj.start?1:-1),g=new Date(this.actionObj.start.getTime()+m))}}else g=this.actionObj.start}else if(!this.isCursorAhead&&!p||this.isAllDayDrag)g.setMinutes(g.getMinutes()-this.cursorPointIndex*(this.isTimelineDayProcess||this.isAllDayDrag?1440:this.actionObj.slotInterval));else{var T=this.isTimelineDayProcess||this.isAllDayDrag?1440:this.actionObj.slotInterval;g.setMinutes(g.getMinutes()+T),g.setMilliseconds(-r),g.getTime()===ve(g).getTime()&&0===g.getMinutes()&&0===r&&g.setMinutes(-T)}if(this.isStepDragging||(g=this.calculateIntervalTime(g)),this.isTimelineDayProcess||this.isAllDayDrag){var w=n[this.parent.eventFields.startTime];g.setHours(w.getHours(),w.getMinutes(),w.getSeconds())}if(this.parent.eventDragArea){var D=this.parent.getDateFromElement(t.target);if(!(0,e.isNullOrUndefined)(D))if(this.parent.activeViewOptions.timeScale.enable&&"TimelineMonth"!==this.parent.currentView)g=D;else{w=n[this.parent.eventFields.startTime];g=new Date(D.setHours(w.getHours(),w.getMinutes(),w.getSeconds()))}}var b=new Date(g.getTime());b.setMilliseconds(r);var S=[this.getUpdatedEvent(g,b,this.actionObj.event)];if(this.multiData.length>0){for(var C=S[0][this.parent.eventFields.startTime].getTime()-this.startTime,O=0;O<this.multiData.length;O++)this.updatedData[parseInt(O.toString(),10)]=this.updateMultipleData(this.multiData[parseInt(O.toString(),10)],C);S=this.updatedData}for(var E=0;E<S.length;E++){var x=this.multiData.length>0?this.actionObj.cloneElement[parseInt(E.toString(),10)]:this.actionObj.clone;if((0,e.isNullOrUndefined)(this.parent.eventDragArea)){var V=this.timelineEventModule.splitEvent(S[parseInt(E.toString(),10)],this.timelineEventModule.dateRender),A=V[0].data,I=this.timelineEventModule.getStartTime(V[0],A),M=this.timelineEventModule.getEndTime(V[0],A),k=this.timelineEventModule.getEventWidth(I,M,n[this.parent.eventFields.isAllDay],A.count),R=this.parent.getIndexOfDate(this.timelineEventModule.dateRender,ve(new Date(I.getTime())));R=R<0?0:R;var H=this.timelineEventModule.getPosition(I,M,n[this.parent.eventFields.isAllDay],R);this.parent.enableRtl?x.style.right=(0,e.formatUnit)(H):x.style.left=(0,e.formatUnit)(H),this.isMorePopupOpened||(x.style.width=(0,e.formatUnit)(k))}this.parent.activeViewOptions.group.resources.length>0&&this.calculateResourceGroupingPosition(t,x),this.actionObj.start=new Date(g.getTime()),this.actionObj.end=new Date(b.getTime()),this.updateTimePosition(this.actionObj.start,this.updatedData)}},i.prototype.getOffsetValue=function(t,i){if(this.scrollEdges.left||this.scrollEdges.right){var n=this.parent.element.querySelector("."+ri);this.parent.enableRtl?(i=n.offsetWidth-n.scrollLeft,this.scrollEdges.right?i=i-n.offsetWidth+this.actionObj.clone.offsetWidth-(this.actionObj.clone.offsetWidth-this.widthUptoCursorPoint):(i+=this.widthUptoCursorPoint)-this.widthUptoCursorPoint>=n.scrollWidth&&(this.actionObj.clone.style.width=(0,e.formatUnit)(this.actionObj.clone.offsetWidth-this.widthUptoCursorPoint+this.actionObj.cellWidth),i=n.scrollLeft-n.scrollWidth),(0,e.isNullOrUndefined)(this.parent.eventDragArea)&&(this.actionObj.clone.style.left=(0,e.formatUnit)(i))):(this.scrollEdges.left?(t=n.scrollLeft-this.widthUptoCursorPoint+this.actionObj.cellWidth,n.scrollLeft+n.offsetWidth>=n.offsetWidth?n.scrollLeft=n.scrollLeft-1:0===this.actionObj.clone.offsetLeft&&(t=n.scrollLeft)):t=n.scrollLeft+n.offsetWidth-this.actionObj.clone.offsetWidth+(this.actionObj.clone.offsetWidth-this.widthUptoCursorPoint),t=t<0?0:t,(0,e.isNullOrUndefined)(this.parent.eventDragArea)&&(this.actionObj.clone.style.left=(0,e.formatUnit)(t)))}return t},i.prototype.getWidthDiff=function(e,t){var i=this.scrollArgs.element.getBoundingClientRect();if(i.left<=this.actionObj.pageX&&i.right>=this.actionObj.pageX){var n=e.children[parseInt(t.toString(),10)].offsetLeft,r=this.actionObj.pageX-i.left;return this.parent.enableRtl?n+this.actionObj.cellWidth-(this.scrollArgs.element.scrollLeft+r):this.scrollArgs.element.scrollLeft+r-n}return 0},i.prototype.getColumnIndex=function(e){var t=Math.round(e/this.actionObj.cellWidth);return this.isHeaderRows?t:this.getIndex(t)},i.prototype.getCursorCurrentIndex=function(e,t,i){var n=e+t;if(this.isHeaderRows){var r=Math.floor(i.offsetWidth/this.actionObj.cellWidth);return n>r-1?r-1:n}return n>i.children.length-1?i.children.length-1:n},i.prototype.cursorIndex=function(t,i,n,r){var a=(0,e.closest)(t.target,".e-work-cells");if((0,e.isNullOrUndefined)(a)||this.isMorePopupOpened)this.cursorPointIndex=0;else{var s=this.parent.getDateFromElement(a);if(s=this.isAllDayDrag?ve(s):s,this.isHeaderRows){var o=Math.floor(n/this.actionObj.cellWidth);s=new Date(this.timelineEventModule.dateRender[o+r].getTime())}var l=s.getTime()-i[this.parent.eventFields.startTime].getTime();if(this.isTimelineDayProcess||this.isAllDayDrag)this.cursorPointIndex=Math.abs(Math.ceil(l/ie));else{var p=Math.floor(l/ne/(this.actionObj.slotInterval/this.actionObj.cellWidth));this.cursorPointIndex=Math.floor(p/this.actionObj.cellWidth),this.cursorPointIndex=this.cursorPointIndex<0?0:this.cursorPointIndex}}},i.prototype.calculateResourceGroupingPosition=function(t,i){var n=this.parent.element.querySelector("."+ri),r=[].slice.call(this.parent.element.querySelectorAll(".e-content-wrap .e-content-table tr:not(.e-hidden)")),a=se(n.querySelector("table"));a=(0,e.isNullOrUndefined)(a)?0:a;var s=this.parent.rowAutoHeight?~~(n.querySelector("table").offsetHeight/r.length):this.actionObj.cellHeight,o=Math.floor(Math.floor(this.actionObj.Y+(n.scrollTop-a-(window.scrollY||window.pageYOffset))-qe(n,this.parent.uiStateValues.isTransformed))/s);o=o<0?0:o>r.length-1?r.length-1:o,this.actionObj.index=o;var l=this.parent.element.querySelectorAll(".e-appointment-container:not(.e-hidden)").item(o),p=l.querySelector("."+jt);p||(p=(0,e.createElement)("div",{className:jt}),l.appendChild(p)),this.appendCloneElement(p,i);var c=(0,e.closest)(this.actionObj.target,"td");if(this.actionObj.groupIndex=c&&!isNaN(parseInt(c.getAttribute("data-group-index"),10))?parseInt(c.getAttribute("data-group-index"),10):this.actionObj.groupIndex,(0,e.isNullOrUndefined)(this.parent.eventDragArea)){var h=this.parent.getElementHeight(r[parseInt(o.toString(),10)])*o;if(this.parent.rowAutoHeight){var d=this.getCursorElement(t);d&&(h=d.classList.contains($e)?d.offsetTop:d.offsetParent&&d.offsetParent.classList.contains(Xt)?d.offsetParent.offsetTop:h)}i.style.top=(0,e.formatUnit)(h)}},i.prototype.appendCloneElement=function(t,i){void 0===i&&(i=null),i=(0,e.isNullOrUndefined)(i)?this.actionObj.clone:i;var n=document.querySelector(this.parent.eventDragArea);this.parent.eventDragArea&&n?n.appendChild(i):t.appendChild(i)},i.prototype.getEventWrapper=function(t,i){var n;if((0,e.isNullOrUndefined)(i)&&(i=this.actionObj.clone.classList.contains(ji)),this.parent.activeViewOptions.timeScale.enable){var r=i?"."+Pi:"."+jt;n=this.parent.element.querySelectorAll(r).item(t)}else{var a=this.parent.element.querySelectorAll("."+$e).item(t);(n=a.querySelector("."+jt))||(n=(0,e.createElement)("div",{className:jt}),a.appendChild(n))}return n},i.prototype.getAllDayEventHeight=function(){var t=(0,e.createElement)("div",{className:Xt});this.parent.element.querySelector("."+Pi).appendChild(t);var i=t.offsetHeight;return(0,e.remove)(t),i},i.prototype.isAllowDrop=function(e){if(!this.actionObj.excludeSelectors)return!1;for(var t=!1,i=0,n=this.actionObj.excludeSelectors.split(",");i<n.length;i++){var r=n[i];if(e.target.classList.contains(r)){t=!0;break}}return t},i.prototype.getModuleName=function(){return"dragAndDrop"},i}(_o),$o=function(){function t(e){this.previousNextAction="Next",this.parent=e}return t.prototype.isTimelineView=function(){return-1!==this.parent.currentView.indexOf("Timeline")},t.prototype.getContentRows=function(){return[]},t.prototype.refreshHeader=function(){},t.prototype.refreshResourceHeader=function(){var t=this.element.querySelector("."+Tt),i=Array.from(t.querySelectorAll("."+Ot));i.forEach((function(t){Array.from(t.children).forEach((function(t){t.classList.contains(bt)||t.classList.contains(St)||(0,e.remove)(t)}))}));var n=this.parent.resourceBase.renderedResources;if(!(0,e.isNullOrUndefined)(n)&&n.length>0)for(var r=0;r<i.length;r++){var a=i[parseInt(r.toString(),10)],s=n[parseInt(r.toString(),10)];!this.parent.activeView||(0,e.isNullOrUndefined)(a)||(0,e.isNullOrUndefined)(s)||parseInt(a.getAttribute("data-group-index"),10)!==s.groupIndex||this.parent.activeView.setResourceHeaderContent(a,s,ft)}this.parent.renderTemplates(),this.parent.notify(_,{})},t.prototype.getDayName=function(e){return this.parent.getDayNames("abbreviated")[e.getDay()]},t.prototype.getDate=function(e){return this.parent.globalize.formatDate(e,{format:"d",calendar:this.parent.getCalendarMode()})},t.prototype.getTime=function(e){return this.parent.isAdaptive?"HH:mm"===this.parent.activeViewOptions.timeFormat||"HH.mm"===this.parent.activeViewOptions.timeFormat?this.parent.globalize.formatDate(e,{format:"H",calendar:this.parent.getCalendarMode()}):this.parent.globalize.formatDate(e,{skeleton:"h",calendar:this.parent.getCalendarMode()}):this.parent.getTimeString(e)},t.prototype.getTimelineDate=function(e){return je(this.parent.globalize.formatDate(e,{skeleton:"MMMd",calendar:this.parent.getCalendarMode()})+", "+this.parent.getDayNames("wide")[e.getDay()],"multiple")},t.prototype.createEventTable=function(t){var i=(0,e.createElement)("div",{className:vt});return(0,e.append)(this.getEventRows(t),i),i},t.prototype.getEventRows=function(t){for(var i,n=[],r=0;r<t;r++)i=(0,e.createElement)("div",{className:Gt}),this.parent.resourceBase&&!this.parent.uiStateValues.isGroupAdaptive&&this.parent.resourceBase.renderedResources&&i.setAttribute("data-group-index",this.parent.resourceBase.renderedResources[parseInt(r.toString(),10)].groupIndex.toString()),n.push(i);return n},t.prototype.collapseRows=function(e){this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&(this.parent.resourceBase.hideResourceRows(e.querySelector("tbody")),this.parent.resourceBase.hideResourceRows(e.querySelector("."+vt)))},t.prototype.createTableLayout=function(t){var i=t||"",n=(0,e.createElement)("table",{className:Qe+" "+i}),r=(0,e.createElement)("tbody");return n.appendChild(r),n},t.prototype.setAriaAttributes=function(e){e.setAttribute("role","grid"),"Year"!==this.parent.currentView&&e.setAttribute("id",this.parent.element.id+"_table"),e.setAttribute("aria-label",this.getLabelText(this.parent.currentView))},t.prototype.createColGroup=function(t,i){if(!(0,e.isNullOrUndefined)(i)){var n=i.length;i[0]&&i[0].colSpan&&(n=i.map((function(e){return e.colSpan})).reduce((function(e,t){return e+t})));for(var r=(0,e.createElement)("colgroup"),a=0;a<n;a++)r.appendChild((0,e.createElement)("col"));(0,e.prepend)([r],t)}},t.prototype.getScrollXIndent=function(e){return e.offsetHeight-e.clientHeight>0?xe():0},t.prototype.scrollTopPanel=function(e){this.getDatesHeaderElement().firstElementChild.scrollLeft=e.scrollLeft},t.prototype.scrollHeaderLabels=function(t){for(var i=this.element.querySelector(".e-date-header-wrap table"),n=i.offsetWidth/i.querySelectorAll("colgroup col").length,r=function(i,r){for(var a,s=0,o=0,l=r?-t.scrollLeft:t.scrollLeft,p=0,c=i;p<c.length;p++){var h=c[p];if((o+=parseInt(h.getAttribute("colSpan"),10))>Math.floor(l/n)){a=h;break}s+=h.offsetWidth}(0,e.isNullOrUndefined)(a)||(a.children[0].style[r?"right":"left"]=l-s+"px")},a=0,s=[".e-header-year-cell",".e-header-month-cell",".e-header-week-cell",".e-header-cells"];a<s.length;a++){var o=s[a],l=[].slice.call(this.element.querySelectorAll(o));if(l.length>0){for(var p=0,c=l;p<c.length;p++){c[p].children[0].style[this.parent.enableRtl?"right":"left"]=""}r(l,this.parent.enableRtl)}}},t.prototype.addAttributes=function(t,i){t.template&&(0,e.append)(t.template,i),t.colSpan&&i.setAttribute("colspan",t.colSpan.toString()),t.className&&(0,e.addClass)([i],t.className)},t.prototype.getHeaderBarHeight=function(){var e=2;if(this.parent.headerModule&&(e+=Ie(this.parent.headerModule.getHeaderElement())),this.parent.uiStateValues.isGroupAdaptive){var t=this.parent.element.querySelector("."+Ut);t&&(e+=t.offsetHeight)}return e},t.prototype.renderPanel=function(t){t===ct?(0,e.prepend)([this.element],this.parent.element.querySelector("."+Xe)):this.parent.element.querySelector("."+Xe).appendChild(this.element)},t.prototype.setPanel=function(e){this.element=e},t.prototype.getPanel=function(){return this.element},t.prototype.getDatesHeaderElement=function(){return this.element.querySelector("."+nt)},t.prototype.getDateSlots=function(e,t){return[]},t.prototype.generateColumnLevels=function(){return[]},t.prototype.getColumnLevels=function(){return this.colLevels},t.prototype.highlightCurrentTime=function(){},t.prototype.getStartDate=function(){return this.renderDates[0]},t.prototype.getEndDate=function(){return this.renderDates[this.renderDates.length-1]},t.prototype.startDate=function(){return this.renderDates[0]},t.prototype.endDate=function(){return ye(this.renderDates[this.renderDates.length-1],1)},t.prototype.getStartHour=function(){var t=this.parent.getStartEndTime(this.parent.activeViewOptions.startHour);return(0,e.isNullOrUndefined)(t)&&(t=new Date(2e3,0,0,0)),t},t.prototype.getEndHour=function(){var t=this.parent.getStartEndTime(this.parent.activeViewOptions.endHour);return(0,e.isNullOrUndefined)(t)&&(t=new Date(2e3,0,0,0)),t},t.prototype.isCurrentDate=function(e){return e.setHours(0,0,0,0)===new Date(this.parent.currentTimezoneDate).setHours(0,0,0,0)},t.prototype.isCurrentMonth=function(e){return this.parent.activeViewOptions.displayDate||this.parent.activeViewOptions.numberOfWeeks>0?this.parent.activeView.getStartDate().getTime()<=this.parent.getCurrentTime().getTime()&&this.parent.activeView.getEndDate().getTime()>=this.parent.getCurrentTime().getTime():e.getFullYear()===this.parent.getCurrentTime().getFullYear()&&e.getMonth()===this.parent.getCurrentTime().getMonth()},t.prototype.isWorkDay=function(t,i){return void 0===i&&(i=this.parent.activeViewOptions.workDays),!(0,e.isNullOrUndefined)(i)&&i.indexOf(t.getDay())>=0},t.prototype.isWorkHour=function(t,i,n,r){return!(0,e.isNullOrUndefined)(i)&&!(0,e.isNullOrUndefined)(n)&&(i.setMilliseconds(0),n.setMilliseconds(0),ve(t).getTime()!==ve(i).getTime()&&(i=new Date(2e3,0,0,i.getHours(),i.getMinutes(),i.getMilliseconds()),n=new Date(2e3,0,0,n.getHours(),n.getMinutes(),n.getMilliseconds())),!(me(t)<me(i)||me(t)>=me(n)||!this.isWorkDay(t,r)))},t.prototype.getRenderDates=function(e,t){void 0===t&&(t=this.parent.selectedDate);var i=[];if("Week"===this.parent.currentView||"TimelineWeek"===this.parent.currentView)for(var n=le(ve(t),this.parent.activeViewOptions.firstDayOfWeek),r=0,a=ee*this.parent.activeViewOptions.interval;r<a;r++)(this.parent.activeViewOptions.showWeekend||this.isWorkDay(n,e))&&i.push(n),n=ye(n,1);else if("WorkWeek"===this.parent.currentView||"TimelineWorkWeek"===this.parent.currentView){n=le(ve(t),this.parent.activeViewOptions.firstDayOfWeek),r=0;for(var s=ee*this.parent.activeViewOptions.interval;r<s;r++)this.isWorkDay(n,e)&&i.push(n),n=ye(n,1)}else{var o="Agenda"===this.parent.currentView?this.parent.agendaDaysCount:this.parent.activeViewOptions.interval;n=ve(t);do{(this.parent.activeViewOptions.showWeekend||this.isWorkDay(n,e))&&i.push(n),n=ye(n,1)}while(o!==i.length)}return e||(this.renderDates=i),this.parent.headerModule&&this.parent.headerModule.previousNextIconHandler(),i},t.prototype.getNextPreviousDate=function(e){if(this.previousNextAction=e,"Day"===this.parent.currentView||"TimelineDay"===this.parent.currentView){if(this.parent.activeViewOptions.showWeekend){var t=this.parent.activeViewOptions.interval;return ye(this.parent.selectedDate,"Next"===e?t:-t)}var i=void 0;if("Next"===e)for(i=ye(this.renderDates.slice(-1)[0],1);!this.isWorkDay(i);)i=ye(i,1);else{i=ye(this.renderDates[0],-1);var n=0;do{this.isWorkDay(i)&&(n+=1),this.parent.activeViewOptions.interval!==n&&(i=ye(i,-1))}while(this.parent.activeViewOptions.interval!==n)}return i}var r="Next"===e?ee:-ee;return ye(this.parent.selectedDate,r*this.parent.activeViewOptions.interval)},t.prototype.formatViewLabel=function(e,t,i){var n={type:"date",skeleton:"full",calendar:this.parent.getCalendarMode()};return this.parent.localeObj.getConstant(e)+" "+this.parent.localeObj.getConstant("start")+" "+this.parent.globalize.formatDate(t,n)+" "+this.parent.localeObj.getConstant("endAt")+" "+this.parent.globalize.formatDate(i,n)},t.prototype.getLabelText=function(e){var t=e.charAt(0).toLowerCase()+e.substring(1);return"Year"===e||"TimelineYear"===e?this.formatViewLabel(t,this.parent.activeView.getStartDate(),this.parent.activeView.getEndDate()):this.renderDates.length>0?"Day"===this.parent.currentView||"TimelineDay"===this.parent.currentView?this.parent.localeObj.getConstant(t)+" of "+je(this.parent.globalize.formatDate(this.parent.selectedDate,{type:"date",skeleton:"full",calendar:this.parent.getCalendarMode()}),"single"):this.formatViewLabel(t,this.renderDates[0],this.renderDates[this.renderDates.length-1]):""},t.prototype.getDateRangeText=function(e,t){if(void 0===e&&(e=this.renderDates[0]),void 0===t&&(t=this.renderDates),this.parent.isAdaptive){var i=this.parent.activeViewOptions.dateFormat?this.parent.activeViewOptions.dateFormat:"MMMM y";return je(this.parent.globalize.formatDate(this.parent.selectedDate,{format:i,calendar:this.parent.getCalendarMode()}),"single")}return this.formatDateRange(e,t[t.length-1])},t.prototype.formatDateRange=function(t,i){var n,r=this.parent.globalize,a=this.parent.getCalendarMode();if(t===i&&(i=null),!(0,e.isNullOrUndefined)(this.parent.activeViewOptions.dateFormat)){return je(i?r.formatDate(t,{format:this.parent.activeViewOptions.dateFormat,calendar:a})+" - "+r.formatDate(i,{format:this.parent.activeViewOptions.dateFormat,calendar:a}):r.formatDate(t,{format:this.parent.activeViewOptions.dateFormat,calendar:a}),"multiple")}if(n=(0,e.isNullOrUndefined)(this.parent.locale)||"en"===this.parent.locale||"en-US"===this.parent.locale?(0,e.getValue)("dateFormats.long",(0,e.getDefaultDateObject)(a)):(0,e.getValue)("main."+this.parent.locale+".dates.calendars."+a+".dateFormats.long",e.cldrData),!i)return je(r.formatDate(t,{format:n,calendar:a}),"single");var s=n.trim().toLocaleLowerCase();return je("d"===s.substr(0,1)?t.getFullYear()===i.getFullYear()?t.getMonth()===i.getMonth()?r.formatDate(t,{format:"dd",calendar:a})+" - "+r.formatDate(i,{format:"dd MMMM yyyy",calendar:a}):r.formatDate(t,{format:"dd MMM",calendar:a})+" - "+r.formatDate(i,{format:"dd MMM yyyy",calendar:a}):r.formatDate(t,{format:"dd MMM yyyy",calendar:a})+" - "+r.formatDate(i,{format:"dd MMM yyyy",calendar:a}):"m"===s.substr(0,1)?t.getFullYear()===i.getFullYear()?t.getMonth()===i.getMonth()?r.formatDate(t,{format:"MMMM dd",calendar:a})+" - "+r.formatDate(i,{format:"dd, yyyy",calendar:a}):r.formatDate(t,{format:"MMM dd",calendar:a})+" - "+r.formatDate(i,{format:"MMM dd, yyyy",calendar:a}):r.formatDate(t,{format:"MMM dd, yyyy",calendar:a})+" - "+r.formatDate(i,{format:"MMM dd, yyyy",calendar:a}):r.formatDate(t,{format:n,calendar:a})+" - "+r.formatDate(i,{format:n,calendar:a}),"multiple")},t.prototype.getMobileDateElement=function(t,i){return(0,e.createElement)("div",{className:i,innerHTML:'<div class="e-m-date">'+this.parent.globalize.formatDate(t,{format:"d",calendar:this.parent.getCalendarMode()})+'</div><div class="e-m-day">'+je(this.parent.globalize.formatDate(t,{format:"E",calendar:this.parent.getCalendarMode()}),"single")+"</div>"})},t.prototype.setResourceHeaderContent=function(t,i,n){if(void 0===n&&(n=$i),this.parent.activeViewOptions.resourceHeaderTemplate){var r={resource:i.resource,resourceData:i.resourceData},a=this.parent.element.id+"_"+this.parent.activeViewOptions.resourceHeaderTemplateName+"resourceHeaderTemplate",s=[].slice.call(this.parent.getResourceHeaderTemplate()(r,this.parent,"resourceHeaderTemplate",a,!1,void 0,void 0,this.parent.root));(0,e.append)(s,t)}else{var o=(0,e.createElement)("div",{className:n});this.parent.sanitize(i.resourceData[i.resource.textField],o),t.appendChild(o)}},t.prototype.renderResourceMobileLayout=function(){this.parent.resourceBase.lastResourceLevel&&this.parent.resourceBase.lastResourceLevel.length<=0||(this.parent.resourceBase.renderResourceHeader(),this.parent.resourceBase.renderResourceTree())},t.prototype.addAutoHeightClass=function(t){!this.parent.uiStateValues.isGroupAdaptive&&this.parent.rowAutoHeight&&this.isTimelineView()&&this.parent.activeViewOptions.group.resources.length>0&&(0,e.addClass)([t],lr)},t.prototype.getColElements=function(){return[].slice.call(this.element.querySelectorAll("."+ri+" col, ."+it+" col"))},t.prototype.setColWidth=function(t){if(this.isTimelineView()){var i=this.getColElements(),n=this.element.querySelector("."+Je+" tbody"),r=this.parent.getElementWidth(n)/(i.length/2);if(t.offsetHeight!==t.clientHeight){var a=this.parent.element.querySelector("."+yt);(0,e.isNullOrUndefined)(a)||a.offsetHeight===t.clientHeight||(0,e.setStyleAttribute)(a,{height:(0,e.formatUnit)(t.clientHeight)})}var s="."+rt+",."+Vt+",.e-header-week-cell,.e-header-month-cell,.e-header-year-cell";[].slice.call(this.element.querySelectorAll(s)).forEach((function(t){var i=(0,e.isNullOrUndefined)(t.getAttribute("colspan"))?"1":t.getAttribute("colspan"),n=parseInt(i,10);(0,e.setStyleAttribute)(t,{width:(0,e.formatUnit)(r*n)})}))}},t.prototype.resetColWidth=function(){for(var e=0,t=this.getColElements();e<t.length;e++){t[e].style.width=""}},t.prototype.getContentAreaElement=function(){return this.element.querySelector("."+ri)},t.prototype.wireExpandCollapseIconEvents=function(){if(this.parent.resourceBase&&this.parent.resourceBase.resourceCollection.length>1)for(var t=0,i=[].slice.call(this.element.querySelectorAll("."+Ct));t<i.length;t++){var n=i[t];e.EventHandler.clearEvents(n),e.EventHandler.add(n,"click",this.parent.resourceBase.onTreeIconClick,this.parent.resourceBase)}},t.prototype.scrollToDate=function(t){if(-1!==["Month","TimelineMonth"].indexOf(this.parent.currentView)&&!(0,e.isNullOrUndefined)(t)){var i=this.getContentAreaElement(),n=new Date(ve(new Date(+t)).getTime()).getTime(),r=i.querySelector("."+$e+'[data-date="'+n+'"]');"Month"===this.parent.currentView&&r&&(i.scrollWidth>i.clientWidth&&(this.parent.enableRtl?i.scrollLeft=-(this.parent.getContentTable().offsetWidth-r.offsetLeft-r.offsetWidth):i.scrollLeft=r.offsetLeft),i.scrollTop=r.offsetTop),"TimelineMonth"===this.parent.currentView&&r&&(this.parent.enableRtl?i.scrollLeft=-(this.parent.getContentTable().offsetWidth-r.offsetLeft-r.offsetWidth):i.scrollLeft=r.offsetLeft)}},t.prototype.setPersistence=function(){if(this.parent.enablePersistence){var t=this.element.querySelector(".e-content-wrap");(0,e.isNullOrUndefined)(t)||(this.parent.scrollLeft=t.scrollLeft,this.parent.scrollTop=t.scrollTop)}},t.prototype.retainScrollPosition=function(){if(this.parent.enablePersistence){var t=this.parent.element.querySelector(".e-content-wrap");(0,e.isNullOrUndefined)(t)||(0,e.isNullOrUndefined)(this.parent.scrollLeft)||(0,e.isNullOrUndefined)(this.parent.scrollTop)||(t.scrollTop=this.parent.scrollTop,t.scrollLeft=this.parent.scrollLeft)}},t.prototype.getViewStartDate=function(){var e=this.renderDates[0];return this.parent.activeViewOptions.group.resources.length>0&&this.parent.resourceBase.lastResourceLevel.length>0&&(e=this.parent.resourceBase.getResourceRenderDates()[0]),e},t.prototype.getViewEndDate=function(){var e=ye(this.renderDates[this.renderDates.length-1],1);return this.parent.activeViewOptions.group.resources.length>0&&this.parent.resourceBase.lastResourceLevel.length>0&&(e=ye(this.parent.resourceBase.getResourceRenderDates().slice(-1)[0],1)),e},t.prototype.getAdjustedDate=function(e){return!this.parent.activeViewOptions.timeScale.enable||"Month"===this.parent.currentView||"TimelineYear"===this.parent.currentView&&0===this.parent.activeViewOptions.group.resources.length?new Date(e.setHours(0,0,0,0)):"TimelineYear"===this.parent.currentView&&this.parent.activeViewOptions.group.resources.length>0?(e.setHours(0,0,0,0),new Date(e.setDate(1))):null},t.prototype.resetColLevels=function(){this.parent.resourceBase.expandedResources=[];for(var e=this.parent.virtualScrollModule.getRenderedCount(),t=this.parent.activeViewOptions.group.byDate?this.colLevels[0]:this.parent.resourceBase.renderedResources,i=0,n=0;n<t.length&&!(i>=e);n++)i+=t[parseInt(n.toString(),10)].colSpan,this.parent.resourceBase.expandedResources.push(t[parseInt(n.toString(),10)]);this.parent.activeViewOptions.group.byDate?(this.colLevels[0]=this.parent.resourceBase.expandedResources,this.parent.virtualScrollModule.setRenderedDates(this.parent.resourceBase.expandedResources)):(this.colLevels[this.colLevels.length-2]=this.parent.resourceBase.expandedResources,this.parent.resourceBase.renderedResources=this.parent.resourceBase.expandedResources),"Month"!==this.parent.currentView&&(this.colLevels[this.colLevels.length-1]=this.colLevels[this.colLevels.length-1].slice(0,i),this.parent.resourceBase.expandedResources=this.colLevels[this.colLevels.length-1])},t.prototype.getGroupIndices=function(t){var i=[];return this.parent.virtualScrollModule&&this.parent.activeViewOptions.group.resources.length>0&&(t||this.parent.virtualScrollModule.existingDataCollection.length>0)&&!this.parent.uiStateValues.isGroupAdaptive&&(i=(t=(0,e.isNullOrUndefined)(t)?this.parent.virtualScrollModule.existingDataCollection:t).map((function(e){return e.groupIndex}))),i},t.prototype.destroy=function(){this.element&&this.element.parentNode&&(0,e.remove)(this.element),this.element=null,this.renderDates=null,this.colLevels=null},t}(),el=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),tl=function(t){function i(e){var i=t.call(this,e)||this;return i.viewClass="e-day-view",i.isInverseTableSelect=!0,i.baseCssClass="e-vertical-view",i.appointment=null,i}return el(i,t),i.prototype.getModuleName=function(){return"verticalView"},i.prototype.addEventListener=function(){this.parent.on(Q,this.scrollUiUpdate,this),this.parent.on(z,this.renderEvents,this)},i.prototype.removeEventListener=function(){this.parent&&(this.parent.off(Q,this.scrollUiUpdate),this.parent.off(z,this.renderEvents))},i.prototype.renderEvents=function(){this.appointment=this.parent.activeViewOptions.timeScale.enable?new Ma(this.parent):new Ra(this.parent),this.appointment.renderAppointments(),this.parent.notify(Y,{})},i.prototype.onContentScroll=function(t){this.parent.removeNewEventElement();var i=t.target;this.parent.notify(X,t),this.scrollLeftPanel(i),this.scrollTopPanel(i),this.parent.isAdaptive||(this.parent.uiStateValues.top=i.scrollTop),this.parent.uiStateValues.left=i.scrollLeft,(0,e.isNullOrUndefined)(this.parent.quickPopup)||this.parent.uiStateValues.isTapHold||this.parent.quickPopup.quickPopupHide(),this.setPersistence()},i.prototype.onAdaptiveMove=function(e){this.parent.uiStateValues.action&&e.preventDefault()},i.prototype.onAdaptiveScroll=function(e){this.parent&&!this.parent.isDestroyed&&(this.parent.removeNewEventElement(),this.parent.uiStateValues.top=e.target.scrollTop)},i.prototype.scrollLeftPanel=function(t){var i=this.getLeftPanelElement();(0,e.isNullOrUndefined)(i)||(i.scrollTop=t.scrollTop)},i.prototype.scrollUiUpdate=function(t){if(this.parent){var i=this.parent.element.querySelector("."+it),n=this.getHeaderBarHeight(),r=this.getLeftPanelElement(),a=this.getScrollableElement(),s=this.getDatesHeaderElement(),o=this.parent.element.offsetHeight-n-s.offsetHeight;this.setContentHeight(a,r,o),this.setColWidth(a);var l=xe();s.firstElementChild.style[t.cssProperties.rtlBorder]="",s.style[t.cssProperties.rtlPadding]="";var p=!this.parent.enableAllDayScroll||!(a.offsetWidth-a.clientWidth<=i.offsetWidth-i.clientWidth&&i.classList.contains("e-all-day-scroll"));a.offsetWidth-a.clientWidth>0&&p?(s.firstElementChild.style[t.cssProperties.border]=l>0?"1px":"0px",s.style[t.cssProperties.padding]=l>0?l-1+"px":"0px"):(s.firstElementChild.style[t.cssProperties.border]="",s.style[t.cssProperties.padding]=""),t.isPreventScrollUpdate||(this.parent.uiStateValues.isInitial?(this.parent.currentView.indexOf("Timeline")>-1&&(a.scrollTop=this.parent.uiStateValues.top),this.scrollToWorkHour(),this.parent.uiStateValues.isInitial=!1):(r&&(r.scrollTop=this.parent.uiStateValues.top),a.scrollTop=this.parent.uiStateValues.top,a.scrollLeft=this.parent.uiStateValues.left)),this.parent.activeViewOptions.timeScale.enable&&this.highlightCurrentTime(),this.retainScrollPosition(),(0,e.isNullOrUndefined)(r)||(0,e.isNullOrUndefined)(a)||r.scrollTop===a.scrollTop||(r.scrollTop=a.scrollTop)}},i.prototype.setContentHeight=function(t,i,n){this.parent.isAdaptive&&!this.isTimelineView()||(0,e.isNullOrUndefined)(i)||(i.style.height="auto"===this.parent.height?"auto":(0,e.formatUnit)(n-this.getScrollXIndent(t))),t.style.height="auto"===this.parent.height?"auto":(0,e.formatUnit)(n)},i.prototype.scrollToWorkHour=function(){if(this.parent.workHours.highlight){var e=this.element.querySelector("."+et);e&&(this.getScrollableElement().scrollTop=e.offsetTop,this.parent.uiStateValues.top=e.offsetTop,this.parent.uiStateValues.left=0)}},i.prototype.scrollToHour=function(t,i){var n=this.parent.getStartEndTime(t);if(!(0,e.isNullOrUndefined)(i)){var r=this.element.querySelector("."+rt+'[data-date="'+new Date(ve(i)).getTime()+'"]');if(r)if(this.parent.enableRtl){var a=this.element.querySelector("."+Je);this.getScrollableElement().scrollLeft=-(a.offsetWidth-r.offsetLeft-r.offsetWidth)}else this.getScrollableElement().scrollLeft=r.offsetLeft}(0,e.isNullOrUndefined)(n)||(this.getScrollableElement().scrollTop=this.getTopFromDateTime(n))},i.prototype.scrollToDate=function(e){this.scrollToHour(null,e)},i.prototype.generateColumnLevels=function(){var e=this.getDateSlots(this.renderDates,this.parent.activeViewOptions.workDays),t=[];if(this.parent.activeViewOptions.group.resources.length>0){if(t=this.parent.resourceBase.generateResourceLevels(e),this.parent.activeViewOptions.group.hideNonWorkingDays)for(;0===t[0].length;)this.parent.setProperties({selectedDate:this.parent.activeView.getNextPreviousDate(this.previousNextAction)},!0),this.parent.activeView.getRenderDates(),this.parent.headerModule&&(this.parent.headerModule.setCalendarDate(this.parent.selectedDate),this.parent.headerModule.updateDateRange()),e=this.getDateSlots(this.renderDates,this.parent.activeViewOptions.workDays),t=this.parent.resourceBase.generateResourceLevels(e);if(this.parent.uiStateValues.isGroupAdaptive&&this.parent.resourceBase.lastResourceLevel.length>0){var i=this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex],n=i.resourceData[i.resource.startHourField],r=i.resourceData[i.resource.endHourField];t=[this.getDateSlots(i.renderDates,i.workDays,n,r)]}}else t.push(e);return this.colLevels=t,t},i.prototype.getDateSlots=function(e,t,i,n){void 0===i&&(i=this.parent.workHours.start),void 0===n&&(n=this.parent.workHours.end);for(var r=[],a=this.parent.getStartEndTime(i),s=this.parent.getStartEndTime(n),o=0,l=e;o<l.length;o++){var p=l[o],c=[rt];this.isCurrentDate(p)&&c.push(ot),r.push({date:p,type:"dateHeader",className:c,colSpan:1,workDays:t,startHour:new Date(+a),endHour:new Date(+s)})}return r},i.prototype.isWorkHourRange=function(e){return this.getStartHour().getTime()<=e.getTime()&&this.getEndHour().getTime()>=e.getTime()},i.prototype.highlightCurrentTime=function(){var t=this;if(!(this.parent.activeViewOptions.headerRows.length>0&&"Hour"!==this.parent.activeViewOptions.headerRows.slice(-1)[0].option)){var i=this.parent.getCurrentTime();if(this.parent.showTimeIndicator&&this.isWorkHourRange(i))if(this.getCurrentTimeIndicatorIndex().length>0&&!(0,e.isNullOrUndefined)(this.element.querySelector("."+$e))){if(this.changeCurrentTimePosition(),(0,e.isNullOrUndefined)(this.currentTimeIndicatorTimer)){var n=ne-(1e3*i.getSeconds()+i.getMilliseconds());n<=ne-1e3&&window.setTimeout((function(){(0,e.isNullOrUndefined)(t.currentTimeIndicatorTimer)||(t.clearCurrentTimeIndicatorTimer(),t.changeCurrentTimePosition(),t.updateCurrentTimeIndicatorTimer())}),n),this.updateCurrentTimeIndicatorTimer()}}else this.clearCurrentTimeIndicatorTimer();else this.clearCurrentTimeIndicatorTimer()}},i.prototype.getCurrentTimeIndicatorIndex=function(){var t=[];if(!(0,e.isNullOrUndefined)(this.parent.resourceBase)&&this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive){var i=0,n=ve(this.parent.getCurrentTime());if(this.parent.virtualScrollModule&&this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.activeViewOptions.group.byDate)for(var r=0,a=this.parent.resourceBase.expandedResources;r<a.length;r++){ve((l=a[r]).date).getTime()===n.getTime()&&t.push(i),i+=1}else for(var s=0,o=this.parent.resourceBase.renderedResources;s<o.length;s++){var l=o[s];if((c=this.parent.getIndexOfDate(l.renderDates,n))>=0){var p=this.parent.activeViewOptions.group.byDate?this.parent.resourceBase.lastResourceLevel.length*c+i:i+c;t.push(p)}i+=this.parent.activeViewOptions.group.byDate?1:l.renderDates.length}}else{var c,h=this.parent.uiStateValues.isGroupAdaptive&&this.parent.resourceBase.lastResourceLevel.length>0?this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex].renderDates:this.renderDates;(c=this.parent.getIndexOfDate(h,ve(this.parent.getCurrentTime())))>=0&&t.push(c)}return t},i.prototype.clearCurrentTimeIndicatorTimer=function(){(0,e.isNullOrUndefined)(this.currentTimeIndicatorTimer)||(window.clearInterval(this.currentTimeIndicatorTimer),this.currentTimeIndicatorTimer=null,this.removeCurrentTimeIndicatorElements())},i.prototype.updateCurrentTimeIndicatorTimer=function(){var e=this;this.currentTimeIndicatorTimer=window.setInterval((function(){e.changeCurrentTimePosition()}),ne)},i.prototype.removeCurrentTimeIndicatorElements=function(){for(var t="."+kt+",."+Mt+",."+It,i=0,n=[].slice.call(this.element.querySelectorAll(t));i<n.length;i++){var r=n[i];(0,e.remove)(r)}},i.prototype.changeCurrentTimePosition=function(){if(!(!this.parent||this.parent&&this.parent.isDestroyed)){this.removeCurrentTimeIndicatorElements();var t=this.getCurrentTimeIndicatorIndex(),i=this.parent.getContentTable().rows[0],n=this.getTopFromDateTime(this.parent.getCurrentTime()),r=(0,e.formatUnit)(n),a=Math.floor(n/i.cells[0].offsetHeight),s=this.getLeftPanelElement(),o=[].slice.call(s.querySelectorAll("tr"));if(!(0,e.isNullOrUndefined)(a)&&!isNaN(a)&&a!==o.length){for(var l=[].slice.call(this.element.querySelectorAll("."+Pt)),p=0,c=t[0];p<c;p++)l[parseInt(p.toString(),10)].appendChild((0,e.createElement)("div",{className:kt,styles:"top:"+r}));for(var h=0,d=t;h<d.length;h++){var u=d[h];l.length>u&&l[parseInt(u.toString(),10)].appendChild((0,e.createElement)("div",{className:Mt,styles:"top:"+r}))}var g=(0,e.createElement)("div",{innerHTML:this.parent.getTimeString(this.parent.getCurrentTime()),className:It,styles:"top:"+r});a<=o.length&&((0,e.removeClass)(s.querySelectorAll("."+Rt),Rt),o[parseInt(a.toString(),10)]&&(0,e.addClass)([o[parseInt(a.toString(),10)].lastElementChild],Rt),(0,e.prepend)([g],s),g.style.top=(0,e.formatUnit)(g.offsetTop-g.offsetHeight/2))}}},i.prototype.getTopFromDateTime=function(e){var t=this.getStartEndHours(this.parent.activeViewOptions.startHour),i=this.getStartEndHours(this.parent.activeViewOptions.endHour),n=60*(e.getHours()-t.getHours())+(e.getMinutes()-t.getMinutes()),r=De(ve(new Date(e.getTime())),t,i),a=(r.endHour.getTime()-r.startHour.getTime())/ne,s=this.parent.activeViewOptions.timeScale.interval,o=0;return o=0===t.getHours()&&0===t.getMinutes()&&0===i.getHours()&&0===i.getMinutes()||1!==this.parent.activeViewOptions.timeScale.slotCount?s:s>a?a:s,n*this.getWorkCellHeight()*this.parent.activeViewOptions.timeScale.slotCount/o},i.prototype.getWorkCellHeight=function(){return parseFloat(this.parent.getElementHeight(this.element.querySelector("."+$e)).toFixed(2))},i.prototype.getTdContent=function(t,i,n){var r,a=(0,e.createElement)("div"),s="",o=this.parent.element.id+"_";switch(i){case"dateHeader":if(this.parent.activeViewOptions.dateHeaderTemplate){s="dateHeaderTemplate";var l={date:t,type:i},p=this.parent.activeViewOptions.dateHeaderTemplateName;r=[].slice.call(this.parent.getDateHeaderTemplate()(l,this.parent,s,o+p+s,!1,void 0,void 0,this.parent.root))}else a.innerHTML=this.parent.activeView.isTimelineView()?'<span class="e-header-date e-navigate">'+this.getTimelineDate(t)+"</span>":'<div class="e-header-day">'+je(this.getDayName(t),"single")+'</div><div class="e-header-date e-navigate" role="link">'+this.getDate(t)+"</div>",r=[].slice.call(a.childNodes);break;case"majorSlot":if(this.parent.activeViewOptions.timeScale.majorSlotTemplate){s="majorSlotTemplate";l={date:t,type:i};r=[].slice.call(this.parent.getMajorSlotTemplate()(l,this.parent,s,o+s,!1,void 0,void 0,this.parent.root))}else a.innerHTML="<span>"+this.getTime(t)+"</span>",r=[].slice.call(a.childNodes);break;case"minorSlot":if(this.parent.activeViewOptions.timeScale.minorSlotTemplate){s="minorSlotTemplate";l={date:t,type:i};r=[].slice.call(this.parent.getMinorSlotTemplate()(l,this.parent,s,o+s,!1,void 0,void 0,this.parent.root))}else r=[].slice.call(a.childNodes);break;case"alldayCells":if(this.parent.activeViewOptions.cellTemplate){p=this.parent.activeViewOptions.cellTemplateName;s="cellTemplate";l={date:t,type:i,groupIndex:n};r=[].slice.call(this.parent.getCellTemplate()(l,this.parent,s,o+p+s,!1,void 0,void 0,this.parent.root))}}return r},i.prototype.refreshHeader=function(){(0,e.remove)(this.element.querySelector("tbody tr")),this.renderHeader(),this.parent.notify(_,{});var t=this.element.querySelector("."+it);t&&(t.scrollLeft=this.parent.uiStateValues.left)},i.prototype.renderLayout=function(t){this.setPanel((0,e.createElement)("div",{className:ii}));var i=[this.baseCssClass,this.viewClass];i.push(t),this.parent.activeViewOptions.group.byDate&&i.push("e-by-date"),this.parent.activeViewOptions.timeScale.enable||(0,e.addClass)([this.element],["e-timescale-disable",this.viewClass]),this.parent.activeViewOptions.allowVirtualScrolling&&!this.parent.uiStateValues.isGroupAdaptive&&i.push(sr),this.parent.rowAutoHeight&&this.parent.eventSettings.ignoreWhitespace&&i.push(pr),this.renderPanel(t),(0,e.addClass)([this.element],i),this.element.appendChild(this.createTableLayout(ni)),this.element.querySelector("table").setAttribute("role","presentation"),this.colLevels=this.generateColumnLevels(),this.renderHeader(),this.renderContent(),this.parent.uiStateValues.isGroupAdaptive&&!this.parent.element.querySelector("."+qt)&&this.renderResourceMobileLayout(),this.parent.notify(_,{})},i.prototype.renderHeader=function(){var t=(0,e.createElement)("tr"),i=(0,e.createElement)("td");if(i.appendChild(this.renderDatesHeader()),this.parent.activeViewOptions.timeScale.enable){var n=(0,e.createElement)("td",{className:ut});n.appendChild(this.renderLeftIndent()),t.appendChild(n)}t.appendChild(i),(0,e.prepend)([t],this.element.querySelector("tbody"))},i.prototype.renderContent=function(){this.parent.activeViewOptions.group.resources.length>0&&(this.parent.resourceBase.renderedResources=(0,e.extend)([],this.parent.resourceBase.lastResourceLevel,null,!0));var t=(0,e.createElement)("tr"),i=(0,e.createElement)("td");if(this.parent.isAdaptive){i.setAttribute("colspan",this.parent.activeViewOptions.timeScale.enable?"2":"1");var n=(0,e.createElement)("div",{className:Ht});this.parent.activeViewOptions.timeScale.enable&&n.appendChild(this.renderTimeCells()),n.appendChild(this.renderContentArea()),i.appendChild(n),e.EventHandler.add(n,"scroll",this.onAdaptiveScroll,this),e.EventHandler.add(n,e.Browser.touchMoveEvent,this.onAdaptiveMove,this),t.appendChild(i)}else{var r=this.colLevels.slice(0);this.parent.virtualScrollModule&&this.resetColLevels();var a=this.renderContentArea();if(i.appendChild(a),this.parent.activeViewOptions.timeScale.enable){var s=(0,e.createElement)("td");s.appendChild(this.renderTimeCells()),t.appendChild(s)}t.appendChild(i),this.parent.virtualScrollModule&&(this.colLevels=r,this.parent.virtualScrollModule.renderVirtualTrack(a))}this.element.querySelector("tbody").appendChild(t)},i.prototype.renderLeftIndent=function(){for(var t,i=(0,e.createElement)("div",{className:gt}),n=this.createTableLayout(),r=(0,e.createElement)("tr"),a=this.colLevels.length,s=0;s<a;s++){var o=r.cloneNode(),l={className:[this.colLevels[parseInt(s.toString(),10)][0]&&this.colLevels[parseInt(s.toString(),10)][0].className[0]],type:"emptyCells"};if(this.parent.activeViewOptions.showWeekNumber&&-1!==l.className.indexOf(rt)){l.className.push(zt);var p=this.parent.getWeekNumberContent(this.renderDates);l.template=[(0,e.createElement)("span",{innerHTML:""+p,attrs:{title:this.parent.localeObj.getConstant("week")+" "+p}})]}t=this.createTd(l),this.parent.renderHeaderIndentTemplate(l,t),o.appendChild(t),n.querySelector("tbody").appendChild(o)}var c=r.cloneNode(),h=(0,e.createElement)("div",{attrs:{tabindex:"0",role:"button",title:this.parent.localeObj.getConstant("expandAllDaySection"),"aria-disabled":"false","aria-label":this.parent.localeObj.getConstant("expandAllDaySection")},className:qi+" "+Fi+" "+Ye+" "+Ge}),d={className:[Ke],type:"emptyCells"};return(t=this.createTd(d)).appendChild(h),this.parent.renderHeaderIndentTemplate(d,t),c.appendChild(t),n.querySelector("tbody").appendChild(c),i.appendChild(n),i},i.prototype.renderDatesHeader=function(){var t=(0,e.createElement)("div",{className:nt}),i=(0,e.createElement)("div",{className:it});t.appendChild(i);for(var n=this.createTableLayout(),r=(0,e.createElement)("tr",{className:Hi}),a=this.colLevels.length,s=this.colLevels[a-1],o=0;o<a;o++){for(var l=r.cloneNode(),p=this.colLevels[parseInt(o.toString(),10)],c=0;c<p.length;c++)l.appendChild(this.createTd(p[parseInt(c.toString(),10)]));n.querySelector("tbody").appendChild(l)}return this.createAllDayRow(n,s),this.createColGroup(n,s),i.appendChild(n),t},i.prototype.createAllDayRow=function(t,i){for(var n=(0,e.createElement)("tr",{className:Ze}),r=0;r<i.length;r++){var a=(0,e.extend)({},i[parseInt(r.toString(),10)]);a.className=[Ke],a.type="alldayCells";var s=this.createTd(a);s.setAttribute("data-date",a.date.getTime().toString()),(0,e.isNullOrUndefined)(a.groupIndex)?this.parent.uiStateValues.isGroupAdaptive&&s.setAttribute("data-group-index",""+this.parent.uiStateValues.groupIndex):s.setAttribute("data-group-index",""+a.groupIndex),this.wireCellEvents(s),n.appendChild(s)}t.querySelector("tbody").appendChild(n);var o=(0,e.createElement)("thead");o.appendChild(this.parent.eventBase.createEventWrapper("allDay")),(0,e.prepend)([o],t)},i.prototype.createTd=function(t){var i=(0,e.createElement)("td");if(this.addAttributes(t,i),t.date&&t.type){var n=this.getTdContent(t.date,t.type,t.groupIndex);n&&n.length&&(0,e.append)(n,i)}this.parent.isMinMaxDate(ve(new Date(""+t.date)))||(0,e.addClass)([i],Qn),"resourceHeader"===t.type&&this.setResourceHeaderContent(i,t),"dateHeader"===t.type&&t.className.indexOf(rt)>=0&&(i.setAttribute("data-date",t.date.getTime().toString()),(0,e.isNullOrUndefined)(t.groupIndex)||i.setAttribute("data-group-index",""+t.groupIndex),this.wireMouseEvents(i));var r={elementType:t.type,element:i,date:t.date,groupIndex:t.groupIndex};return this.parent.trigger(v,r),i},i.prototype.wireCellEvents=function(t){e.EventHandler.add(t,"mousedown",this.parent.workCellAction.cellMouseDown,this.parent.workCellAction),this.wireMouseEvents(t)},i.prototype.wireMouseEvents=function(t){e.EventHandler.add(t,"click",this.parent.workCellAction.cellClick,this.parent.workCellAction),this.parent.isAdaptive||e.EventHandler.add(t,"dblclick",this.parent.workCellAction.cellDblClick,this.parent.workCellAction)},i.prototype.renderTimeCells=function(){var t=this,i=(0,e.createElement)("div",{className:Et}),n=this.createTableLayout(),r=(0,e.createElement)("tr");return this.getTimeSlotRows((function(e){e.type=e.first?"majorSlot":"minorSlot",e.className=e.last?[xt,Vt]:[Vt];var i=r.cloneNode(),a={date:e.date,type:e.type,className:e.className};return i.appendChild(t.createTd(a)),n.querySelector("tbody").appendChild(i),e})),i.appendChild(n),i},i.prototype.renderContentArea=function(){var t=(0,e.createElement)("div",{className:ri}),i=this.createTableLayout(Je);return this.setAriaAttributes(i),this.addAutoHeightClass(i),this.renderContentTable(i),this.createColGroup(i,this.colLevels.slice(-1)[0]),t.appendChild(i),this.wireCellEvents(i.querySelector("tbody")),e.EventHandler.add(t,"scroll",this.onContentScroll,this),e.EventHandler.add(t,e.Browser.touchMoveEvent,this.onAdaptiveMove,this),t},i.prototype.renderContentTable=function(t){var i=t.querySelector("tbody");(0,e.append)(this.getContentRows(),i),this.renderContentTableHeader(t)},i.prototype.getContentRows=function(){var t=this,i=[],n=(0,e.createElement)("tr"),r=(0,e.createElement)("td"),a=this.getGroupIndices();return this.getTimeSlotRows((function(e){for(var s=n.cloneNode(),o=0,l=t.colLevels[t.colLevels.length-1];o<l.length;o++){var p=l[o],c=!0;if(t.parent.virtualScrollModule&&t.parent.activeViewOptions.group.resources.length>0&&a.indexOf(p.groupIndex)>-1&&(c=!1),c){var h=t.createContentTd(p,e,r);s.appendChild(h)}}return i.push(s),e})),i},i.prototype.createContentTd=function(t,i,n){var r=n.cloneNode();t.colSpan&&r.setAttribute("colspan",t.colSpan.toString());var a=this.getContentTdClass(i),s=ve(t.date);this.parent.isMinMaxDate(s)||a.push(Qn),s=new Date(s.setHours(i.date.getHours(),i.date.getMinutes(),i.date.getSeconds(),i.date.getMilliseconds()));var o="workCells";if(-1!==t.className.indexOf(Dt)&&(a.push(mt),o="resourceGroupCells"),this.parent.workHours.highlight&&(this.parent.activeViewOptions.timeScale.enable&&this.isWorkHour(s,t.startHour,t.endHour,t.workDays)||!this.parent.activeViewOptions.timeScale.enable&&this.isWorkDay(s,t.workDays))&&a.push(et),(0,e.addClass)([r],a),this.parent.activeViewOptions.cellTemplate){var l={date:s,type:o,groupIndex:t.groupIndex},p=this.parent.element.id+"_"+this.parent.activeViewOptions.cellTemplateName+"cellTemplate",c=[].slice.call(this.parent.getCellTemplate()(l,this.parent,"cellTemplate",p,!1,void 0,void 0,this.parent.root));(0,e.append)(c,r)}r.setAttribute("data-date",s.getTime().toString());var h="full";if(this.parent.activeViewOptions.timeScale.enable){var d=this.parent.globalize.formatDate(s,{type:"dateTime",skeleton:h,calendar:this.parent.getCalendarMode()}),u=this.parent.globalize.formatDate(this.getEndDateFromStartDate(s),{type:"dateTime",skeleton:h,calendar:this.parent.getCalendarMode()});r.setAttribute("aria-label",d+" "+this.parent.localeObj.getConstant("endAt")+" "+u)}else{var g=this.parent.globalize.formatDate(t.date,{skeleton:h,calendar:this.parent.getCalendarMode()});r.setAttribute("aria-label",g)}if(!(0,e.isNullOrUndefined)(t.groupIndex)||this.parent.uiStateValues.isGroupAdaptive){var m=this.parent.uiStateValues.isGroupAdaptive?this.parent.uiStateValues.groupIndex:t.groupIndex;r.setAttribute("data-group-index",""+m)}var f={elementType:o,element:r,date:s,groupIndex:t.groupIndex};return this.parent.trigger(v,f),r},i.prototype.getContentTdClass=function(e){return e.last?[$e]:[$e,At]},i.prototype.renderContentTableHeader=function(t){var i=(0,e.createElement)("thead");i.appendChild(this.parent.eventBase.createEventWrapper()),this.parent.activeViewOptions.timeScale.enable&&i.appendChild(this.parent.eventBase.createEventWrapper("timeIndicator")),(0,e.prepend)([i],t)},i.prototype.getScrollableElement=function(){return this.parent.isAdaptive&&!this.isTimelineView()?this.element.querySelector("."+Ht):this.getContentAreaElement()},i.prototype.getLeftPanelElement=function(){return this.element.querySelector("."+Et)},i.prototype.getEndDateFromStartDate=function(e){var t=this.parent.activeViewOptions.timeScale.interval*ne/this.parent.activeViewOptions.timeScale.slotCount,i=new Date(e.getTime());return i.setMilliseconds(i.getMilliseconds()+t),i},i.prototype.getStartEndHours=function(t){if(!(0,e.isNullOrUndefined)(t)&&""!==t){var i=new Date(2e3,0,0,0),n=t.split(":");return 2===n.length&&i.setHours(parseInt(n[0],10),parseInt(n[1],10),0),i}return new Date(2e3,0,0,0)},i.prototype.getTimeSlotRows=function(e){var t=[],i=this.getStartEndHours(this.parent.activeViewOptions.startHour),n=this.getStartEndHours(this.parent.activeViewOptions.endHour),r=this.parent.activeViewOptions.timeScale.interval*ne,a=r/this.parent.activeViewOptions.timeScale.slotCount,s=Math.round(ie/a),o=i.getTime(),l=n.getTime();if(o!==l){var p=i.getTimezoneOffset()!==n.getTimezoneOffset()?l-o-36e5:l-o;s=Math.round(p/a)}this.parent.activeViewOptions.timeScale.enable||(s=1);for(var c=this.parent.getStartEndTime(this.parent.workHours.start),h=this.parent.getStartEndTime(this.parent.workHours.end),d=0;d<s;d++){var u=new Date(o+a*d);if(ke(u)||new Date(o).getTimezoneOffset()!==u.getTimezoneOffset()){var g=new Date(o).getTimezoneOffset()-u.getTimezoneOffset();u=new Date(u.getTime()-6e4*g)}var v=d%(r/a),m={date:new Date(""+u),startHour:c,endHour:h,first:0===v,middle:v<this.parent.activeViewOptions.timeScale.slotCount-1,last:v===this.parent.activeViewOptions.timeScale.slotCount-1,type:""};e&&e(m),t.push(m)}return t},i.prototype.getAdjustedDate=function(e){if(!this.parent.activeViewOptions.timeScale.enable)return new Date(e.setHours(0,0,0,0));for(var t=this.getTimeSlotRows(),i=new Date(new Date(t[0].date.getTime()).setHours(e.getHours(),e.getMinutes(),e.getMilliseconds())),n=0;n<t.length;n++)if(t[parseInt(n.toString(),10)].date.getTime()>i.getTime())return e.setHours(t[n-1].date.getHours(),t[n-1].date.getMinutes(),t[n-1].date.getMilliseconds()),new Date(e);return null},i.prototype.destroy=function(){if(!(!this.parent||this.parent&&this.parent.isDestroyed)&&(this.clearCurrentTimeIndicatorTimer(),this.element)){this.appointment&&(this.appointment.destroy(),this.appointment=null);var i=this.getContentAreaElement();i&&(e.EventHandler.remove(i,"scroll",this.onContentScroll),e.EventHandler.remove(i,e.Browser.touchMoveEvent,this.onAdaptiveMove)),this.parent.resourceBase&&this.parent.resourceBase.destroy(),this.parent.scheduleTouchModule&&this.parent.scheduleTouchModule.resetValues(),t.prototype.destroy.call(this)}},i}($o),il=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),nl=function(e){function t(t){var i=e.call(this,t)||this;return i.viewClass="e-day-view",i}return il(t,e),t.prototype.getModuleName=function(){return"day"},t}(tl),rl=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),al=function(e){function t(t){var i=e.call(this,t)||this;return i.viewClass="e-week-view",i}return rl(t,e),t.prototype.startDate=function(){return this.getViewStartDate()},t.prototype.endDate=function(){return this.getViewEndDate()},t.prototype.getModuleName=function(){return"week"},t}(tl),sl=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ol=function(e){function t(t){var i=e.call(this,t)||this;return i.viewClass="e-work-week-view",i}return sl(t,e),t.prototype.startDate=function(){return this.getViewStartDate()},t.prototype.endDate=function(){return this.getViewEndDate()},t.prototype.getModuleName=function(){return"workWeek"},t}(tl),ll=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),pl=function(t){function i(e){var i=t.call(this,e)||this;return i.dayNameFormat="wide",i.viewClass="e-month-view",i.isInverseTableSelect=!1,i.monthEvent=null,i.monthDates={},i}return ll(i,t),i.prototype.addEventListener=function(){this.parent.on(Q,this.onScrollUIUpdate,this),this.parent.on(z,this.onDataReady,this),this.parent.on(r,this.onCellClick,this)},i.prototype.removeEventListener=function(){this.parent&&(this.parent.off(Q,this.onScrollUIUpdate),this.parent.off(z,this.onDataReady),this.parent.off(r,this.onCellClick))},i.prototype.onDataReady=function(e){this.monthEvent=new Ra(this.parent),this.monthEvent.renderAppointments(),this.parent.notify(Y,{})},i.prototype.onCellClick=function(e){},i.prototype.onContentScroll=function(e){this.parent.removeNewEventElement(),this.parent.notify(X,e),this.scrollTopPanel(e.target),this.scrollLeftPanel(e.target),this.parent.uiStateValues.top=e.target.scrollTop,this.parent.uiStateValues.left=e.target.scrollLeft,this.setPersistence()},i.prototype.scrollLeftPanel=function(e){var t=this.getLeftPanelElement();t&&(t.scrollTop=e.scrollTop)},i.prototype.getLeftPanelElement=function(){return this.element.querySelector("."+Wt)},i.prototype.onScrollUIUpdate=function(e){var t=this.getHeaderBarHeight(),i=this.getDatesHeaderElement(),n=this.getContentAreaElement(),r=this.parent.element.offsetHeight-t-i.offsetHeight,a=this.getLeftPanelElement();"auto"!==this.parent.height&&this.setContentHeight(n,a,r);var s=xe();if(i.firstElementChild.style[e.cssProperties.rtlBorder]="",i.style[e.cssProperties.rtlPadding]="",n.offsetWidth-n.clientWidth>0?(i.firstElementChild.style[e.cssProperties.border]=s>0?"1px":"0px",i.style[e.cssProperties.padding]=s>0?s-1+"px":"0px"):(i.firstElementChild.style[e.cssProperties.border]="",i.style[e.cssProperties.padding]=""),this.setColWidth(n),e.scrollPosition||!e.isPreventScrollUpdate&&"TimelineMonth"===this.parent.currentView){var o="TimelineMonth"===this.parent.currentView?this.parent.uiStateValues.top:e.scrollPosition.top;a&&(a.scrollTop=o),n.scrollTop=o,this.parent.uiStateValues.isInitial?(this.scrollToSelectedDate(),this.parent.uiStateValues.isInitial=!1):n.scrollLeft="TimelineMonth"===this.parent.currentView?this.parent.uiStateValues.left:e.scrollPosition.left}this.retainScrollPosition()},i.prototype.scrollToSelectedDate=function(){var t=new Date(this.parent.selectedDate);t.setHours(0,0,0,0);var i=this.element.querySelector("."+rt+'[data-date="'+t.getTime().toString()+'"]'),n=this.getContentAreaElement();(0,e.isNullOrUndefined)(i)?n.scrollLeft=0:n.scrollLeft=this.parent.enableRtl?-(this.parent.getContentTable().offsetWidth-i.offsetLeft-i.offsetWidth):i.offsetLeft,0===n.scrollLeft&&this.parent.uiStateValues.isInitial&&(this.parent.uiStateValues.left=0)},i.prototype.setContentHeight=function(t,i,n){t.style.height="auto","Month"===this.parent.currentView&&(t.style.height=(0,e.formatUnit)(n)),i&&("MonthAgenda"===this.parent.currentView&&(n=this.parent.activeViewOptions.interval>1?this.getContentAreaElement().firstElementChild.offsetHeight:this.element.querySelector("."+Je).offsetHeight),i.style.height="auto",i.style.height=(0,e.formatUnit)(n-this.getScrollXIndent(t)))},i.prototype.generateColumnLevels=function(){var e=[],t=this.getDateSlots(this.renderDates,this.parent.activeViewOptions.workDays);if(this.parent.activeViewOptions.group.resources.length>0){if(e=this.parent.resourceBase.generateResourceLevels(t),"MonthAgenda"===this.parent.currentView&&(e=[t]),this.parent.uiStateValues.isGroupAdaptive&&this.parent.resourceBase.lastResourceLevel.length>0){var i=this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex],n=this.getDateSlots(i.renderDates,i.workDays);if(this.parent.activeViewOptions.group.byDate&&this.parent.activeViewOptions.group.hideNonWorkingDays){var r=n.findIndex((function(e,t){return 0!==t&&e.date.getDay()===n[0].date.getDay()}));n=r>-1?n.slice(0,r):n}e=[n]}}else e.push(t);return this.colLevels=e,e},i.prototype.getDateSlots=function(e,t){for(var i=this.parent.activeViewOptions.showWeekend?ee:t.length,n=[],r=this.isCurrentMonth(this.parent.selectedDate),a=0;a<i;a++){var s=[rt],o=e.slice(0,i).map((function(e){return e.getDay()}));r&&o.indexOf(this.parent.currentTimezoneDate.getDay())===a&&s.push(ot),n.push({date:e[parseInt(a.toString(),10)],type:"monthDay",className:s,colSpan:1,workDays:t})}return n},i.prototype.getDayNameFormat=function(){return this.parent.isAdaptive||this.parent.activeViewOptions.group.resources.length>0?"abbreviated":"wide"},i.prototype.renderLayout=function(t){this.dayNameFormat=this.getDayNameFormat(),this.setPanel((0,e.createElement)("div",{className:ii}));var i=[this.viewClass];i.push(t),this.parent.activeViewOptions.group.byDate&&(i.push("e-by-date"),"Month"!==this.parent.currentView&&(this.parent.activeViewOptions.group.hideNonWorkingDays=!1)),this.parent.activeViewOptions.allowVirtualScrolling&&!this.parent.uiStateValues.isGroupAdaptive&&i.push(sr),this.parent.rowAutoHeight&&this.parent.eventSettings.ignoreWhitespace&&i.push(pr),(0,e.addClass)([this.element],i),this.renderPanel(t),this.element.appendChild(this.createTableLayout(ni)),this.element.querySelector("table").setAttribute("role","presentation"),this.colLevels=this.generateColumnLevels(),this.renderHeader(),this.renderContent();var n="MonthAgenda"===this.parent.currentView?this.parent.activeView.getPanel():this.parent.element;this.parent.uiStateValues.isGroupAdaptive&&!n.querySelector("."+qt)&&this.renderResourceMobileLayout(),this.parent.notify(_,{}),this.parent.uiStateValues.isCustomMonth&&(this.parent.uiStateValues.isCustomMonth=!1)},i.prototype.refreshHeader=function(){(0,e.remove)(this.element.querySelector("tbody tr")),this.renderHeader(),this.parent.notify(_,{});var t=this.element.querySelector("."+it),i=this.element.querySelector("."+ri);t&&(t.scrollLeft=this.parent.uiStateValues.left),i&&(i.scrollLeft=this.parent.uiStateValues.left)},i.prototype.wireCellEvents=function(t){e.EventHandler.add(t,"mousedown",this.parent.workCellAction.cellMouseDown,this.parent.workCellAction),e.EventHandler.add(t,"click",this.parent.workCellAction.cellClick,this.parent.workCellAction),this.parent.isAdaptive||e.EventHandler.add(t,"dblclick",this.parent.workCellAction.cellDblClick,this.parent.workCellAction)},i.prototype.renderHeader=function(){var t=(0,e.createElement)("tr");this.renderLeftIndent(t);var i=(0,e.createElement)("td");i.appendChild(this.renderDatesHeader()),t.appendChild(i),(0,e.prepend)([t],this.element.querySelector("tbody"))},i.prototype.renderLeftIndent=function(t){this.parent.activeViewOptions.showWeekNumber&&t.appendChild((0,e.createElement)("td",{className:"e-left-indent"}))},i.prototype.renderContent=function(){this.parent.activeViewOptions.group.resources.length>0&&(this.parent.resourceBase.renderedResources=(0,e.extend)([],this.parent.resourceBase.lastResourceLevel,null,!0));var t=(0,e.createElement)("tr");this.parent.activeViewOptions.showWeekNumber&&t.appendChild(this.renderWeekNumberContent());var i=(0,e.createElement)("td"),n=this.colLevels.slice(0);this.parent.virtualScrollModule&&this.resetColLevels();var r=(0,e.createElement)("div",{className:ri}),a=this.renderContentArea();if("Month"===this.parent.currentView)r.appendChild(a);else{var s=(0,e.createElement)("div",{className:Xe});s.appendChild(a),r.appendChild(s)}e.EventHandler.add(r,"scroll",this.onContentScroll,this),i.appendChild(r),t.appendChild(i),this.parent.virtualScrollModule&&(this.colLevels=n,this.parent.virtualScrollModule.renderVirtualTrack(r)),this.element.querySelector("tbody").appendChild(t),this.renderAppointmentContainer()},i.prototype.renderWeekNumberContent=function(){var t=this.renderDates.map((function(e){return new Date(+e)})),i=(0,e.createElement)("td"),n=(0,e.createElement)("div",{className:Wt});i.appendChild(n);var r=this.createTableLayout();n.appendChild(r);for(var a=this.parent.activeViewOptions.showWeekend?ee:this.parent.activeViewOptions.workDays.length,s=0,o=this.renderDates.length/a;s<o;s++){var l=t.splice(0,a),p=this.parent.getWeekNumberContent(l);r.querySelector("tbody").appendChild(this.createWeekNumberElement(p))}return i},i.prototype.renderAppointmentContainer=function(){},i.prototype.renderDatesHeader=function(){var t=(0,e.createElement)("div",{className:nt}),i=(0,e.createElement)("div",{className:it});t.appendChild(i);var n=this.createTableLayout();if("Month"===this.parent.currentView){var r=(0,e.createElement)("thead");r.appendChild((0,e.createElement)("tr")),(0,e.prepend)([r],n)}this.createColGroup(n,this.colLevels[this.colLevels.length-1]);for(var a=(0,e.createElement)("tr"),s=0;s<this.colLevels.length;s++){for(var o=this.colLevels[parseInt(s.toString(),10)],l=a.cloneNode(),p=0;p<o.length;p++){var c=o[parseInt(p.toString(),10)];l.appendChild(this.createHeaderCell(c))}n.querySelector("tbody").appendChild(l)}return i.appendChild(n),t},i.prototype.createHeaderCell=function(t){var i=(0,e.createElement)("td");if(this.addAttributes(t,i),"monthDay"===t.type){var n=(0,e.createElement)("span",{innerHTML:je(this.parent.getDayNames(this.dayNameFormat)[t.date.getDay()],"single")});i.appendChild(n)}if("resourceHeader"===t.type&&this.setResourceHeaderContent(i,t),"dateHeader"===t.type){if((0,e.addClass)([i],ui),i.setAttribute("data-date",t.date.getTime().toString()),this.parent.activeViewOptions.dateHeaderTemplate){var r={date:t.date,type:t.type},a=this.parent.element.id+"_"+this.parent.activeViewOptions.dateHeaderTemplateName+"dateHeaderTemplate",s=[].slice.call(this.parent.getDateHeaderTemplate()(r,this.parent,"dateHeaderTemplate",a,!1,void 0,void 0,this.parent.root));s&&s.length&&(0,e.append)(s,i)}else{n=(0,e.createElement)("span",{className:di});var o=this.parent.globalize.formatDate(t.date,{skeleton:"full",calendar:this.parent.getCalendarMode()});n.setAttribute("title",je(o,"multiple"));var l=!this.parent.calendarUtil.isMonthStart(t.date)||this.isCurrentDate(t.date)||this.parent.isAdaptive?this.parent.globalize.formatDate(t.date,{skeleton:"d",calendar:this.parent.getCalendarMode()}):this.parent.globalize.formatDate(t.date,{format:"MMM d",calendar:this.parent.getCalendarMode()});n.innerHTML=je(l,"single"),i.appendChild(n)}this.wireCellEvents(i)}var p={elementType:t.type,element:i,date:t.date,groupIndex:t.groupIndex};return this.parent.trigger(v,p),i},i.prototype.getContentSlots=function(){if(!this.colLevels[this.colLevels.length-1]||!this.colLevels[this.colLevels.length-1][0])return[];var e=[],t=function(t,i,n,r){var a={date:new Date(+i),groupIndex:n.groupIndex,workDays:n.workDays,type:"monthCells",className:r||[$e]};e[parseInt(t.toString(),10)]||(e[parseInt(t.toString(),10)]=[]),e[parseInt(t.toString(),10)].push(a)},i="MonthAgenda"!==this.parent.currentView&&this.parent.activeViewOptions.group.resources.length>0;if(!i||this.parent.uiStateValues.isGroupAdaptive||this.parent.activeViewOptions.group.byDate){u=this.renderDates.map((function(e){return new Date(+e)})),g=this.parent.activeViewOptions.showWeekend?ee:this.parent.activeViewOptions.workDays.length;var n=this.colLevels.slice(0,1)[0],r=this.renderDates.map(Number).indexOf(+n[0].date);for(v=0;v<this.renderDates.length/g;v++){m=u.splice(0,g);for(var a,s=r,o=function(e){var n=m[parseInt(s.toString(),10)];if(s++,i){var r=l.colLevels[l.colLevels.length-1],o=r.length/g,p=r.slice(0,o);if(l.parent.activeViewOptions.group.hideNonWorkingDays&&0===(p=r.filter((function(e){return e.date.getDay()===n.getDay()}))).length)return a=e-=1,"continue";for(var c=0;c<p.length;c++){var h=void 0;0!==c&&(h=[$e,"e-disable-date"]),t(v,n,p[parseInt(c.toString(),10)],h)}}else t(v,n,l.colLevels[l.colLevels.length-1][0]);a=e},l=this,p=r;p<this.colLevels[0].length+r&&p<m.length;p++)o(p),p=a}}else for(var c=0,h=this.colLevels[this.colLevels.length-2];c<h.length;c++)for(var d=h[c],u=d.renderDates.map((function(e){return new Date(+e)})),g=this.parent.activeViewOptions.showWeekend?ee:d.workDays.length,v=0;v<d.renderDates.length/g;v++)for(var m,f=0,y=m=u.splice(0,g);f<y.length;f++){var T=y[f];t(v,T,d)}return e},i.prototype.updateClassList=function(e){!this.isCustomMonth()&&this.isOtherMonth(e.date)&&e.className.push(st),this.parent.isMinMaxDate(e.date)||e.className.push(Qn),this.updateSelectedCellClass(e)},i.prototype.updateSelectedCellClass=function(e){},i.prototype.isOtherMonth=function(e){return e.getTime()<this.monthDates.start.getTime()||e.getTime()>this.monthDates.end.getTime()},i.prototype.renderContentArea=function(){var t=this.createTableLayout(Je);this.setAriaAttributes(t),this.addAutoHeightClass(t),"TimelineMonth"===this.parent.currentView&&this.createColGroup(t,this.colLevels[this.colLevels.length-1]);var i=new Date(this.parent.selectedDate.getTime());this.monthDates={start:this.parent.calendarUtil.firstDateOfMonth(i),end:this.parent.calendarUtil.lastDateOfMonth(Te(i,this.parent.activeViewOptions.interval-1))};var n=t.querySelector("tbody");return(0,e.append)(this.getContentRows(),n),this.wireCellEvents(n),t},i.prototype.getContentRows=function(){for(var t=[],i=(0,e.createElement)("tr"),n=(0,e.createElement)("td"),r=this.getContentSlots(),a="TimelineMonth"===this.parent.currentView?this.getGroupIndices():[],s=0;s<r.length;s++)if(!(a.length>0&&a.indexOf(r[parseInt(s.toString(),10)][0].groupIndex)>-1)){for(var o=i.cloneNode(),l=0;l<r[parseInt(s.toString(),10)].length;l++){var p=this.createContentTd(r[parseInt(s.toString(),10)][parseInt(l.toString(),10)],n);o.appendChild(p)}t.push(o)}return t},i.prototype.createContentTd=function(t,i){var n=i.cloneNode();t.colSpan&&n.setAttribute("colspan",t.colSpan.toString()),this.updateClassList(t);var r=t.type;if(-1!==t.className.indexOf(Dt)&&(t.className.push(mt),r="resourceGroupCells"),this.parent.workHours.highlight&&this.isWorkDay(t.date,t.workDays)&&t.className.push(at),this.isCurrentDate(t.date)&&t.className.push(lt),(0,e.addClass)([n],t.className),n.setAttribute("data-date",t.date.getTime().toString()),!(0,e.isNullOrUndefined)(t.groupIndex)||this.parent.uiStateValues.isGroupAdaptive){var a=this.parent.uiStateValues.isGroupAdaptive?this.parent.uiStateValues.groupIndex:t.groupIndex;n.setAttribute("data-group-index",""+a)}if(this.renderDateHeaderElement(t,n),this.parent.activeViewOptions.cellTemplate){var s={date:t.date,type:r,groupIndex:t.groupIndex},o=this.parent.element.id+"_"+this.parent.activeViewOptions.cellTemplateName+"cellTemplate",l=[].slice.call(this.parent.getCellTemplate()(s,this.parent,"cellTemplate",o,!1,void 0,void 0,this.parent.root));(0,e.append)(l,n)}var p={elementType:r,element:n,date:t.date,groupIndex:t.groupIndex};return this.parent.trigger(v,p),n},i.prototype.renderDateHeaderElement=function(t,i){if("TimelineMonth"!==this.parent.currentView){var n=(0,e.createElement)("div",{className:ui});if(this.parent.activeViewOptions.cellHeaderTemplate){var r={date:t.date,type:t.type,groupIndex:t.groupIndex},a=this.parent.element.id+"_"+this.parent.activeViewOptions.cellHeaderTemplateName+"cellHeaderTemplate",s=[].slice.call(this.parent.getCellHeaderTemplate()(r,this.parent,"cellHeaderTemplate",a,!1,void 0,void 0,this.parent.root));(0,e.append)(s,n)}else{var o=!this.parent.calendarUtil.isMonthStart(t.date)||this.isCurrentDate(t.date)||this.parent.isAdaptive?this.parent.globalize.formatDate(t.date,{skeleton:"d",calendar:this.parent.getCalendarMode()}):this.parent.globalize.formatDate(t.date,{format:"MMM d",calendar:this.parent.getCalendarMode()});n.innerHTML=je(o,"single")}if(i.appendChild(n),"month"===this.getModuleName()){(0,e.addClass)([n],di);var l=this.parent.globalize.formatDate(t.date,{skeleton:"full",calendar:this.parent.getCalendarMode()});i.setAttribute("aria-label",l)}}},i.prototype.getMonthStart=function(t){var i=le("Month"===this.parent.currentView&&!(0,e.isNullOrUndefined)(this.parent.activeViewOptions.displayDate)&&!this.parent.uiStateValues.isSwipeScroll&&(this.parent.uiStateValues.isCustomMonth||this.isCustomRange())?this.parent.activeViewOptions.displayDate:this.parent.uiStateValues.isCustomMonth||!this.parent.uiStateValues.isSwipeScroll&&this.isCustomRange()||!this.isCustomMonth()?this.parent.calendarUtil.firstDateOfMonth(t):t,this.parent.activeViewOptions.firstDayOfWeek);return new Date(i.getFullYear(),i.getMonth(),i.getDate())},i.prototype.getMonthEnd=function(e){if(this.isCustomMonth())return ye(this.getMonthStart(e),ee*(this.parent.activeViewOptions.numberOfWeeks>0?this.parent.activeViewOptions.numberOfWeeks:te)-1);var t=Te(e,this.parent.activeViewOptions.interval-1);return ye(le(this.parent.calendarUtil.lastDateOfMonth(t),this.parent.activeViewOptions.firstDayOfWeek),ee-1)},i.prototype.isCustomRange=function(){var e=this.parent.getCurrentViewDates();if(e&&e.length>0){var t=ve(this.parent.selectedDate).getTime(),i=le(e[e.length-1],this.parent.activeViewOptions.firstDayOfWeek);return!(t>=le(e[0],this.parent.activeViewOptions.firstDayOfWeek).getTime()&&t<=ye(i,6).getTime())}return!1},i.prototype.getRenderDates=function(e,t){void 0===t&&(t=this.parent.selectedDate);var i=[],n=ve(t),r=this.getMonthStart(n),a=this.getMonthEnd(n);do{(this.parent.activeViewOptions.showWeekend||this.isWorkDay(r,e))&&i.push(r),(r=ye(r,1)).getHours()>0&&(r=ve(r))}while(r.getTime()<=a.getTime());return e||(this.renderDates=i),this.parent.headerModule&&this.parent.headerModule.previousNextIconHandler(),i},i.prototype.getNextPreviousDate=function(e){if(this.isCustomMonth()){var t=this.parent.getCurrentViewDates();return ye(le("Next"===e?t[t.length-1]:t[0],this.parent.activeViewOptions.firstDayOfWeek),"Next"===e?ee:-(this.parent.activeViewOptions.numberOfWeeks>0?this.parent.activeViewOptions.numberOfWeeks:te)*ee)}return Te(this.parent.selectedDate,("Next"===e?1:-1)*this.parent.activeViewOptions.interval)},i.prototype.getStartDate=function(){return this.getMonthStart(this.parent.selectedDate)},i.prototype.getEndDate=function(){return this.getMonthEnd(this.parent.selectedDate)},i.prototype.getEndDateFromStartDate=function(e){return ye(new Date(e.getTime()),1)},i.prototype.getDateRangeText=function(t,i){if(void 0===t&&(t=this.parent.selectedDate),void 0===i&&(i=null),this.parent.isAdaptive||(0,e.isNullOrUndefined)(this.parent.activeViewOptions.dateFormat)){t=!(0,e.isNullOrUndefined)(i)&&i.length>6?i[6]:t;var n=void 0,r=!1;if(this.isCustomMonth()){var a=!(0,e.isNullOrUndefined)(i)&&i.length>0?i:this.parent.getCurrentViewDates();(r=a[0].getMonth()!==a[a.length-1].getMonth()||a[0].getFullYear()!==a[a.length-1].getFullYear())&&(t=a[0],n=a[a.length-1])}var s="Month"!==this.parent.currentView||!this.isCustomMonth();if(this.parent.activeViewOptions.interval>1&&s||r)return n=n||Te(he(t),this.parent.activeViewOptions.interval-1),t.getFullYear()===n.getFullYear()?je(this.parent.globalize.formatDate(t,{format:"MMMM",calendar:this.parent.getCalendarMode()})+" - "+this.parent.globalize.formatDate(n,{format:"MMMM ",calendar:this.parent.getCalendarMode()})+this.parent.globalize.formatDate(n,{skeleton:"y",calendar:this.parent.getCalendarMode()}),"single"):je(this.parent.globalize.formatDate(t,{format:"MMMM",calendar:this.parent.getCalendarMode()})+" "+t.getFullYear()+" - "+this.parent.globalize.formatDate(n,{format:"MMMM ",calendar:this.parent.getCalendarMode()})+this.parent.globalize.formatDate(n,{skeleton:"y",calendar:this.parent.getCalendarMode()}),"single");var o=this.parent.activeViewOptions.dateFormat?this.parent.activeViewOptions.dateFormat:"MMMM y";return je(this.parent.globalize.formatDate(t,{format:o,calendar:this.parent.getCalendarMode()}),"single")}return this.formatDateRange(!(0,e.isNullOrUndefined)(i)&&i.length>0?i[0]:this.parent.selectedDate)},i.prototype.getLabelText=function(e){var t=e.charAt(0).toLowerCase()+e.substring(1);return this.formatViewLabel(t,this.getStartDate(),this.getEndDate())},i.prototype.createWeekNumberElement=function(t){var i=(0,e.createElement)("tr"),n=(0,e.createElement)("td",{className:zt,attrs:{title:t?this.parent.localeObj.getConstant("week")+" "+t:""},innerHTML:t||""});i.appendChild(n);var r={elementType:"weekNumberCell",element:n};return this.parent.trigger(v,r),i},i.prototype.unWireEvents=function(){var t=this.element.querySelector("."+ri);t&&e.EventHandler.remove(t,"scroll",this.onContentScroll)},i.prototype.isCustomMonth=function(){return"Month"===this.parent.currentView&&(!(0,e.isNullOrUndefined)(this.parent.activeViewOptions.displayDate)||this.parent.activeViewOptions.numberOfWeeks>0)},i.prototype.getModuleName=function(){return"month"},i.prototype.destroy=function(){!this.parent||this.parent&&this.parent.isDestroyed||this.element&&(this.monthEvent&&(this.monthEvent.destroy(),this.monthEvent=null),this.unWireEvents(),this.parent.resourceBase&&this.parent.resourceBase.destroy(),this.parent.scheduleTouchModule&&this.parent.scheduleTouchModule.resetValues(),t.prototype.destroy.call(this))},i}($o),cl=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),hl=function(t){function i(e){var i=t.call(this,e)||this;return i.viewClass="e-year-view",i.isInverseTableSelect=!1,i.yearEventModule=null,i}return cl(i,t),i.prototype.getModuleName=function(){return"year"},i.prototype.renderLayout=function(t){this.parent.resourceBase&&this.parent.resourceBase.generateResourceLevels([{renderDates:this.parent.activeView.renderDates}]),this.setPanel((0,e.createElement)("div",{className:ii}));var i="Horizontal"===this.parent.activeViewOptions.orientation?"e-horizontal":"e-vertical";(0,e.addClass)([this.element],[this.viewClass,i,t]),this.renderPanel(t),this.parent.activeViewOptions.allowVirtualScrolling&&(0,e.addClass)([this.element],[sr]);var n=this.createTableLayout(ni);this.element.appendChild(n),this.element.querySelector("table").setAttribute("role","presentation");var r=n.querySelector("tbody");this.rowCount=this.getRowColumnCount("row"),this.columnCount=this.getRowColumnCount("column"),this.renderHeader(r),this.renderContent(r),"Year"!==this.parent.currentView&&this.parent.uiStateValues.isGroupAdaptive&&(this.generateColumnLevels(),this.renderResourceMobileLayout()),e.EventHandler.add(this.element.querySelector("."+ri),"scroll",this.onContentScroll,this),this.parent.notify(_,{})},i.prototype.renderHeader=function(e){},i.prototype.renderContent=function(t){var i=(0,e.createElement)("tr");t.appendChild(i);var n=(0,e.createElement)("td");i.appendChild(n),this.element.querySelector("tbody").appendChild(i);var r=(0,e.createElement)("div",{className:ri});n.appendChild(r);var a=this.createTableLayout("e-calendar-table");r.appendChild(a);var s=(0,e.createElement)("tr");a.querySelector("tbody").appendChild(s);var o=(0,e.createElement)("td");s.appendChild(o);var l=(0,e.createElement)("div",{className:"e-calendar-wrapper"});o.appendChild(l);for(var p=0,c=this.getMonths();p<c.length;p++){var h=c[p],d=new Date(this.parent.selectedDate.getFullYear(),h,1),u=(0,e.createElement)("div",{className:"e-month-calendar e-calendar",attrs:{"data-role":"calendar"}});u.appendChild(this.renderCalendarHeader(d)),u.appendChild(this.renderCalendarContent(d)),l.appendChild(u)}this.renderDates.splice(0,1)},i.prototype.renderCalendarHeader=function(t){var i=(0,e.createElement)("div",{className:"e-header e-month"}),n=(0,e.createElement)("div",{className:"e-day e-title"});if(this.parent.activeViewOptions.monthHeaderTemplate){var r={date:t,type:"monthHeader"};this.renderTemplates(this.parent.getMonthHeaderTemplate(),r,"monthHeaderTemplate",this.parent.activeViewOptions.monthHeaderTemplateName,n)}else n.innerHTML=this.getMonthName(t);return i.appendChild(n),this.parent.trigger(v,{elementType:"headerCells",element:n,date:t}),i},i.prototype.renderCalendarContent=function(t){var i=this.getMonthDates(t),n=(0,e.createElement)("div",{className:"e-content e-month"}),r=this.createTableLayout("e-calendar-table "+Je);n.appendChild(r),this.setAriaAttributes(r);var a=(0,e.createElement)("thead",{className:"e-week-header"}),s=(0,e.createElement)("tr"),o=le(ce(t),this.parent.activeViewOptions.firstDayOfWeek);this.parent.activeViewOptions.showWeekNumber&&s.appendChild((0,e.createElement)("th"));for(var l=0;l<ee;l++){if(this.parent.activeViewOptions.dayHeaderTemplate){var p=(0,e.createElement)("th"),c={date:o,type:"dayHeader"};this.renderTemplates(this.parent.getDayHeaderTemplate(),c,"dayHeaderTemplate",this.parent.activeViewOptions.dayHeaderTemplateName,p),s.appendChild(p)}else s.appendChild((0,e.createElement)("th",{innerHTML:this.parent.getDayNames("narrow")[o.getDay()]}));var h=new Date(o.getTime()+ie);o=h.getDate()===o.getDate()?ye(h,1):h}a.appendChild(s),(0,e.prepend)([a],r);for(var d=r.querySelector("tbody");i.length>0;){var u=i.splice(0,ee),g=(0,e.createElement)("tr");if(this.parent.activeViewOptions.showWeekNumber){var m=this.parent.getWeekNumberContent(u),f=(0,e.createElement)("td",{className:"e-week-number",attrs:{title:this.parent.localeObj.getConstant("week")+" "+m},innerHTML:m});g.appendChild(f),this.parent.trigger(v,{elementType:"weekNumberCells",element:f})}for(var y=0,T=u;y<T.length;y++){var w=T[y];f=(0,e.createElement)("td",{className:"e-cell "+$e,attrs:{"data-date":w.getTime().toString()}});if(this.parent.activeViewOptions.cellHeaderTemplate){c={date:w,type:"monthCells"};this.renderTemplates(this.parent.getCellHeaderTemplate(),c,"cellHeaderTemplate",this.parent.activeViewOptions.cellHeaderTemplateName,f)}else{var D=(0,e.createElement)("span",{className:"e-day",innerHTML:this.parent.globalize.formatDate(w,{skeleton:"d",calendar:this.parent.getCalendarMode()}),attrs:{title:this.parent.globalize.formatDate(w,{type:"date",skeleton:"full"})}});f.appendChild(D)}if(this.parent.activeViewOptions.cellTemplate){c={date:w,type:"monthCells"};this.renderTemplates(this.parent.getCellTemplate(),c,"cellTemplate",this.parent.activeViewOptions.cellTemplateName,f)}var b=[];t.getMonth()!==w.getMonth()&&(b.push(st),f.firstElementChild&&!this.parent.activeViewOptions.cellTemplate&&f.firstElementChild.setAttribute("aria-disabled","true")),this.isCurrentDate(w)&&t.getMonth()===w.getMonth()&&(b=b.concat(["e-today","e-selected"])),b.length>0&&(0,e.addClass)([f],b),g.appendChild(f),t.getMonth()===w.getMonth()&&this.renderDates.push(new Date(w)),this.parent.isMinMaxDate(w)?(e.EventHandler.add(f,"click",this.onCellClick,this),this.parent.isAdaptive||e.EventHandler.add(f,"dblclick",this.parent.workCellAction.cellDblClick,this.parent.workCellAction)):(0,e.addClass)([f],Qn),this.parent.trigger(v,{elementType:"workCells",element:f,date:w})}d.appendChild(g)}return n},i.prototype.createTableColGroup=function(t){for(var i=(0,e.createElement)("colgroup"),n=0;n<t;n++)i.appendChild((0,e.createElement)("col"));return i},i.prototype.getMonthName=function(e){return je(this.parent.globalize.formatDate(e,{format:this.parent.activeViewOptions.dateFormat||"MMMM y",calendar:this.parent.getCalendarMode()}),"multiple")},i.prototype.generateColumnLevels=function(){var e=[],t=this.getDateSlots([this.parent.selectedDate],this.parent.activeViewOptions.workDays);if(this.parent.activeViewOptions.group.resources.length>0){if(e=this.parent.resourceBase.generateResourceLevels(t),this.parent.uiStateValues.isGroupAdaptive){var i=this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex];e=[this.getDateSlots([this.parent.selectedDate],i.workDays)]}}else e.push(t);return e.pop(),this.colLevels=e,e},i.prototype.getDateSlots=function(e,t,i,n){return void 0===i&&(i=this.parent.workHours.start),void 0===n&&(n=this.parent.workHours.end),[{date:e[0],type:"dateHeader",className:[rt],colSpan:1,workDays:t,startHour:new Date(+this.parent.globalize.parseDate(i,{skeleton:"Hm"})),endHour:new Date(+this.parent.globalize.parseDate(n,{skeleton:"Hm"}))}]},i.prototype.getMonthDates=function(e){for(var t=le(ce(e),this.parent.activeViewOptions.firstDayOfWeek),i=ye(new Date(+t),6*ee),n=[],r=t;r.getTime()<i.getTime();r=ye(r,1))n.push(ve(new Date(r)));return n},i.prototype.getRowColumnCount=function(e){for(var t=this.getMonths(),i=this.parent.selectedDate.getFullYear(),n=[],r=0,a=t;r<a.length;r++){var s=a[r];n.push(new Date(i,s,1).getDay()+new Date(i,s+1,0).getDate())}var o=Math.max.apply(Math,n);return"row"===e?"Horizontal"===this.parent.activeViewOptions.orientation?t.length:o:"Horizontal"===this.parent.activeViewOptions.orientation?o:t.length},i.prototype.isCurrentDate=function(e){return ve(new Date).getTime()===ve(new Date(e.getTime())).getTime()},i.prototype.getMonths=function(){var e=this;return Array.apply(null,{length:this.parent.activeViewOptions.monthsCount}).map((function(t,i){return e.parent.firstMonthOfYear+i}))},i.prototype.renderTemplates=function(t,i,n,r,a){var s=this.parent.element.id+"_"+r+n,o=[].slice.call(t(i,this.parent,n,s,!1,void 0,void 0,this.parent.root));(0,e.append)(o,a)},i.prototype.onCellClick=function(t){var i=(0,e.closest)(t.target,"."+$e),n=this.parent.getDateFromElement(i);this.parent.activeCellsData=this.parent.getCellDetails(i);var a=n.getTime()<this.getStartDate().getTime();if(a||n.getTime()>this.getEndDate().getTime()){this.parent.changeDate(this.parent.activeView.getNextPreviousDate(a?"Previous":"Next"),t);var s=this.parent.activeCellsData.startTime.getTime(),o=s>=this.getStartDate().getTime()&&s<=this.getEndDate().getTime()?s:(a?this.getEndDate():this.getStartDate()).getTime(),l=this.parent.element.querySelector(":not(."+st+')[data-date="'+o+'"]');this.parent.selectCell(l),this.parent.activeCellsData=this.parent.getCellDetails(l)}else{var p=ye(new Date(n.getTime()),1),c={date:n,event:this.parent.eventBase.filterEvents(n,p),element:t.target};i.classList.contains(st)&&(i=this.parent.element.querySelector(":not(."+st+')[data-date="'+i.getAttribute("data-date")+'"]')),this.parent.activeCellsData=this.parent.getCellDetails(i);var h=(0,e.extend)(this.parent.activeCellsData,{cancel:!1,event:t,name:"cellClick"});this.parent.trigger(r,h),this.parent.quickPopup.moreEventClick(c,p)}},i.prototype.onContentScroll=function(e){var t=e.target,i=this.getDatesHeaderElement();this.parent.notify(X,e),i&&(i.firstElementChild.scrollLeft=t.scrollLeft);var n="."+hr+",."+yt,r=this.element.querySelector(n);r&&(r.scrollTop=t.scrollTop),this.parent.isAdaptive||(this.parent.uiStateValues.top=e.target.scrollTop),this.parent.uiStateValues.left=e.target.scrollLeft,this.setPersistence()},i.prototype.onScrollUiUpdate=function(t){var i=this.parent.element.offsetHeight-this.getHeaderBarHeight(),n=this.element.querySelector("."+nt);n&&(i-=n.offsetHeight);var r=this.element.querySelector("."+ri);if(r&&(r.style.height=(0,e.formatUnit)(i)),!this.parent.isAdaptive&&n){var a=xe();r.offsetWidth-r.clientWidth>0?(n.firstElementChild.style[t.cssProperties.border]=a>0?"1px":"0px",n.style[t.cssProperties.padding]=a>0?a-1+"px":"0px"):(n.firstElementChild.style[t.cssProperties.border]="",n.style[t.cssProperties.padding]="")}this.setColWidth(this.getContentAreaElement());var s="."+hr+",."+yt,o=this.element.querySelector(s);if(o){var l=r.scrollWidth>r.clientWidth;o.style.height=(0,e.formatUnit)(i-(l?17:0))}t.isPreventScrollUpdate||(this.parent.uiStateValues.isInitial?(this.parent.uiStateValues.isInitial=!1,this.parent.uiStateValues.top=this.parent.uiStateValues.left=0):(o&&(o.scrollTop=this.parent.uiStateValues.top),r.scrollTop=this.parent.uiStateValues.top,r.scrollLeft=this.parent.uiStateValues.left)),this.retainScrollPosition()},i.prototype.getStartDate=function(){return new Date(this.parent.selectedDate.getFullYear(),this.parent.firstMonthOfYear%12,1)},i.prototype.getEndDate=function(){return ye(Te(this.getStartDate(),this.parent.monthsCount),-1)},i.prototype.startDate=function(){return"Year"===this.parent.currentView?le(this.getStartDate(),this.parent.activeViewOptions.firstDayOfWeek):this.getStartDate()},i.prototype.endDate=function(){return"Year"===this.parent.currentView?ye(pe(this.getEndDate(),this.parent.activeViewOptions.firstDayOfWeek),1):ye(this.getEndDate(),1)},i.prototype.getEndDateFromStartDate=function(e){var t=new Date(e.getTime());return this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&(t=he(t)),ye(new Date(t.getTime()),1)},i.prototype.getNextPreviousDate=function(e){return we(this.parent.selectedDate,"Next"===e?1:-1)},i.prototype.getDateRangeText=function(t,i){void 0===t&&(t=this.parent.selectedDate),void 0===i&&(i=null);var n=!(0,e.isNullOrUndefined)(i)&&i.length>0,r=n?i[0]:this.getStartDate(),a=n?i[i.length-1]:this.getEndDate();return r.getFullYear()!==a.getFullYear()?this.parent.globalize.formatDate(r,{skeleton:"yMMM"})+" - "+this.parent.globalize.formatDate(a,{skeleton:"yMMM"}):this.parent.globalize.formatDate(n?i[0]:t,{skeleton:"y"})},i.prototype.addEventListener=function(){this.parent.on(Q,this.onScrollUiUpdate,this),this.parent.on(z,this.onDataReady,this)},i.prototype.removeEventListener=function(){this.parent&&(this.parent.off(Q,this.onScrollUiUpdate),this.parent.off(z,this.onDataReady))},i.prototype.onDataReady=function(e){this.yearEventModule=new Ko(this.parent),this.yearEventModule.renderAppointments(),this.parent.notify(Y,e)},i.prototype.scrollToDate=function(t){var i=+new Date(ve(t)),n=this.element.querySelector("."+$e+":not(."+st+')[data-date="'+i+'"]');n&&(n=(0,e.closest)(n,".e-month-calendar"),this.getContentAreaElement().scrollTop=n.offsetTop)},i.prototype.destroy=function(){if(!(!this.parent||this.parent&&this.parent.isDestroyed)&&this.element){var i=this.element.querySelector("."+ri);i&&e.EventHandler.remove(i,"scroll",this.onContentScroll),this.yearEventModule&&(this.yearEventModule.destroy(),this.yearEventModule=null),this.parent.resourceBase&&this.parent.resourceBase.destroy(),t.prototype.destroy.call(this)}},i}($o),dl=d(90),ul=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),gl=function(t){function i(e){return t.call(this,e)||this}return ul(i,t),i.prototype.createAgendaContentElement=function(t,i,n,r,a){var s,o=this,l=this.parent.eventFields;if("noEvents"===t){var p=[{subject:this.parent.localeObj.getConstant("noEvents")}];0===(s=dl.ListBase.createList(this.parent.createElement,p,{moduleName:"agenda",listClass:this.parent.activeView.viewClass,itemClass:this.parent.activeView.viewClass,template:'<div class="'+mi+'">'+this.parent.localeObj.getConstant("noEvents")+"</div>"})).querySelector(".e-agenda-item").children.length&&s.firstElementChild.appendChild((0,e.createElement)("div",{className:mi,innerHTML:this.parent.localeObj.getConstant("noEvents")}))}else{s=dl.ListBase.createList(this.parent.createElement,i,{moduleName:"agenda",listClass:this.parent.activeView.viewClass,itemClass:this.parent.activeView.viewClass}),[].slice.call(s.children).forEach((function(t,n){var s,p=(0,e.createElement)("div",{className:Xt,attrs:{"data-id":"Appointment_"+i[parseInt(n.toString(),10)][""+o.parent.eventFields.id],"data-guid":i[parseInt(n.toString(),10)].Guid,role:"button",tabindex:"0","aria-disabled":o.parent.eventBase.getReadonlyAttribute(i[parseInt(n.toString(),10)]),"aria-label":o.parent.getAnnouncementString(i[parseInt(n.toString(),10)])}});if((0,e.isNullOrUndefined)(a)||p.setAttribute("data-group-index",a.toString()),o.parent.eventBase.applyResourceColor(p,i[parseInt(n.toString(),10)],"borderColor",r),(0,e.isNullOrUndefined)(o.parent.activeViewOptions.eventTemplate))s=o.createAppointment(i[parseInt(n.toString(),10)]);else{(0,e.addClass)([p],"e-template");var c=o.parent.element.id+"_"+o.parent.activeViewOptions.eventTemplateName+"eventTemplate";if(s=o.parent.getAppointmentTemplate()(i[parseInt(n.toString(),10)],o.parent,"eventTemplate",c,!1,void 0,void 0,o.parent.root),!(0,e.isNullOrUndefined)(i[parseInt(n.toString(),10)][l.recurrenceRule])){var h=i[parseInt(n.toString(),10)][l.id]===i[parseInt(n.toString(),10)][l.recurrenceID]?ki:Ri;p.appendChild((0,e.createElement)("div",{className:Ye+" "+h}))}}(0,e.append)([].slice.call(s),p),Me(t),t.appendChild(p);var d={data:(0,e.extend)({},i[parseInt(n.toString(),10)],null,!0),element:t,cancel:!1};o.parent.trigger(y,d,(function(i){i.cancel&&(0,e.remove)(t)}))}))}return n.appendChild(s),("MonthAgenda"===this.parent.currentView&&this.parent.activeViewOptions.group.resources.length>0||"Agenda"===this.parent.currentView)&&(0,e.addClass)([n],gi),this.parent.renderTemplates(),n},i.prototype.createAppointment=function(t){var i=this.parent.eventFields,n=t[i.subject]||this.parent.eventSettings.fields.subject.default||this.parent.localeObj.getConstant("addTitle"),r=t[i.location]||this.parent.eventSettings.fields.location.default,a=(0,e.createElement)("div",{className:$t});(0,e.isNullOrUndefined)(r)||""===r||(n+=",");var s=(0,e.createElement)("div",{className:Cn});if(this.parent.sanitize(n,s),a.appendChild(s),!(0,e.isNullOrUndefined)(r)&&""!==r){var o=(0,e.createElement)("div",{className:On});this.parent.sanitize(r,o),a.appendChild(o)}if(!(0,e.isNullOrUndefined)(t[i.recurrenceRule])){var l=t[i.id]===t[i.recurrenceID]?ki:Ri;a.appendChild((0,e.createElement)("div",{className:Ye+" "+l}))}var p=t[i.startTime],c=t[i.endTime],h=t[i.isAllDay],d=this.parent.localeObj.getConstant("allDay"),u=this.parent.getTimeString(p)+" - "+this.parent.getTimeString(c);(0,e.isNullOrUndefined)(t.data)||(d=((c.getTimezoneOffset()!==p.getTimezoneOffset()?c.getTime()-p.getTime()+36e5:c.getTime()-p.getTime())/ie>=1?d:u)+" ("+this.parent.localeObj.getConstant("day")+" "+t.data.index+"/"+t.data.count+")");var g=!(0,e.isNullOrUndefined)(t.data)||h?d:u;return[a,(0,e.createElement)("div",{className:vi,innerHTML:g})]},i.prototype.processAgendaEvents=function(t){var i=[];if((0,e.isNullOrUndefined)(t))return i;for(var n=0,r=t;n<r.length;n++){var a=r[n],s=this.parent.eventBase.splitEventByDay(a);i=i.concat(s.length>1?s:a)}return i},i.prototype.wireEventActions=function(){for(var t=0,i=[].slice.call(this.parent.element.querySelectorAll("."+Xt));t<i.length;t++){var n=i[t];this.parent.eventBase.wireAppointmentEvents(n,this.parent.getEventDetails(n),!0)}for(var r=0,a=[].slice.call(this.parent.element.querySelectorAll(".e-m-date"));r<a.length;r++){n=a[r];e.EventHandler.add(n,"click",this.parent.agendaModule.dayNavigationClick,this)}},i.prototype.calculateResourceTableElement=function(t,i,n,r){if(void 0===r&&(r=null),(0,e.isNullOrUndefined)(this.parent.resourceBase.lastResourceLevel)){var a=this.getDateSlots(this.renderDates,this.parent.activeViewOptions.workDays);this.parent.resourceBase.generateResourceLevels(a)}for(var s=ye(new Date(n.getTime()),i),o=this.parent.activeViewOptions.group.byDate||"MonthAgenda"===this.parent.currentView?i:1,l=this.parent.resourceBase.resourceCollection,p=this.parent.resourceBase.lastResourceLevel,c=n,h=n,d=this.parent.activeViewOptions.showWeekend,u=0;u<o;u++){var g=[],v=[],m=0,f=void 0,y=void 0,T=ye(h,u);if("Agenda"===this.parent.currentView&&this.parent.activeViewOptions.group.byDate&&this.parent.activeViewOptions.allowVirtualScrolling&&!d&&!this.isWorkDay(T)){do{if((T=ye(T,1))>=r)break}while(!this.isWorkDay(T)||this.parent.eventBase.filterEvents(T,ye(T,1)).length<1);if(T>=r)break;h=ye(T,-u),s=ye(T,1)}var w=this.parent.activeViewOptions.group.byDate||"MonthAgenda"===this.parent.currentView?ye(T,1):s,D=this.parent.eventBase.filterEvents(T,w);if(D.length>0||!this.parent.hideEmptyAgendaDays||"MonthAgenda"===this.parent.currentView){for(var b=0;b<p.length;b++){i=this.parent.activeViewOptions.group.byDate&&"MonthAgenda"!==this.parent.currentView?1:i;var S=[];n=T;var C=this.parent.eventBase.filterEvents(n,s,D,p[parseInt(b.toString(),10)]);if(C.length>0||!this.parent.hideEmptyAgendaDays||"MonthAgenda"===this.parent.currentView)for(var O=0;O<i;O++){var E=this.parent.eventBase.filterEvents(n,ye(n,1),C,void 0);if(((d||!d&&(this.parent.group.byDate?this.isWorkDay(n):this.isWorkDay(n,p[parseInt(b.toString(),10)].workDays)))&&(E.length>0||!this.parent.hideEmptyAgendaDays)||"MonthAgenda"===this.parent.currentView)&&(S.push(E[0]),f={rowSpan:1,type:"eventColumn",resource:l[l.length-1],groupIndex:p[parseInt(b.toString(),10)].groupIndex,groupOrder:p[parseInt(b.toString(),10)].groupOrder,resourceData:p[parseInt(b.toString(),10)].resourceData,eventData:E,date:n},y={rowSpan:1,type:"dateColumn",resource:l[parseInt((l.length-1).toString(),10)],groupOrder:p[parseInt(b.toString(),10)].groupOrder,resourceData:p[parseInt(b.toString(),10)].resourceData,date:n},g[parseInt(m.toString(),10)]||(g[parseInt(m.toString(),10)]=[]),g[parseInt(m.toString(),10)].push(f),g[parseInt(m.toString(),10)].push(y),m++),(n=ye(n,1)).getTime()>=s.getTime()||this.parent.activeViewOptions.group.byDate||"MonthAgenda"===this.parent.currentView){if(S.length>0){g[g.length-1][1].cssClass=gi;var x={rowSpan:S.length,type:"resourceColumn",resource:l[parseInt((l.length-1).toString(),10)],groupOrder:p[parseInt(b.toString(),10)].groupOrder.slice(0,-1),resourceData:p[parseInt(b.toString(),10)].resourceData,groupIndex:g.length-S.length,className:[ei],date:n};g[parseInt((g.length-S.length).toString(),10)].push(x),v.push((0,e.extend)({},x,null,!0))}break}}}for(var V=l.slice(0,-1),A=[],I=0,M=0;M<V.length;M++){S=V[V.length-(M+1)].dataSource;for(var k=0;k<S.length;k++)for(var R=0,H=0;H<v.length;H++)v[parseInt(H.toString(),10)].groupOrder[V.length-(M+1)]===S[parseInt(k.toString(),10)][V[V.length-(M+1)].idField]&&(I+=v[parseInt(H.toString(),10)].rowSpan,A.push((0,e.extend)({},v[parseInt(H.toString(),10)],null,!0))),++R===v.length&&A.length>0&&(A[0].rowSpan=I,A[0].type="parentColumnLevel_"+(M+1),A[0].resource=V[V.length-(M+1)],A[0].resourceData=S[parseInt(k.toString(),10)],A[0].date=n,g[A[0].groupIndex].push(A[0]),A=[],I=0)}this.createResourceTableRow(g,t)}}0===this.parent.eventBase.filterEvents(c,s).length&&!this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.hideEmptyAgendaDays&&this.renderEmptyContent(t,c)},i.prototype.createResourceTableRow=function(t,i){var n,r,a,s=(0,e.createElement)("tr"),o=(0,e.createElement)("td"),l=0;if(this.parent.activeViewOptions.group.byDate||"MonthAgenda"===this.parent.currentView){for(var p=[],c=this.parent.resourceBase.resourceCollection.slice(0,-1),h=0;h<t.length;h++)p=p.concat(t[parseInt(h.toString(),10)]);a=c.length>0?"parentColumnLevel_"+c.length:"resourceColumn";for(var d=p.filter((function(e){return e.type===a})),u=0;u<d.length;u++)l+=d[parseInt(u.toString(),10)].rowSpan}for(var g=0;g<t.length;g++){n=s.cloneNode();for(var m=t[parseInt(g.toString(),10)].length-1;m>=0;m--){var f=t[parseInt(g.toString(),10)][parseInt(m.toString(),10)],y=o.cloneNode();if("dateColumn"===f.type){if(this.parent.activeViewOptions.group.byDate||"MonthAgenda"===this.parent.currentView){r=t[parseInt(g.toString(),10)][parseInt(m.toString(),10)];continue}y.setAttribute("data-date",f.date.getTime().toString()),y.appendChild(this.createDateHeaderElement(f.date));var T=[si,hi];f.cssClass&&T.push(f.cssClass),(0,e.addClass)([y],T),this.isCurrentDate(new Date(f.date.getTime()))&&(0,e.addClass)(y.childNodes,oi),n.appendChild(y)}else if("eventColumn"===f.type){for(var w=0===f.eventData.length?"noEvents":"data",D=0;D<n.childNodes.length;D++){var b=n.childNodes.item(D),S=b.classList.contains("e-resource-column")?P:j;this.parent.trigger(v,{elementType:S,element:b,date:f.date,groupIndex:f.groupIndex})}(y=this.createAgendaContentElement(w,f.eventData,y,f.groupOrder,f.groupIndex)).setAttribute("data-date",f.date.getTime().toString()),(this.parent.activeViewOptions.group.byDate||"MonthAgenda"===this.parent.currentView)&&(0,e.addClass)([y],[si,"e-day-padding"]),n.appendChild(y);var C=0===f.eventData.length?R:H;this.parent.trigger(v,{elementType:C,element:y,date:f.date,groupIndex:f.groupIndex})}else y.setAttribute("rowspan",f.rowSpan.toString()),(0,e.addClass)([y],"e-resource-column"),this.setResourceHeaderContent(y,f,f.className[0]),n.appendChild(y)}if(this.parent.activeViewOptions.group.byDate&&0===g&&"MonthAgenda"!==this.parent.currentView){(y=o.cloneNode()).setAttribute("data-date",r.date.getTime().toString()),y.setAttribute("rowspan",l.toString()),y.appendChild(this.createDateHeaderElement(r.date)),(0,e.addClass)([y],[si,hi,"e-date-border"]);var O=Se(this.parent.selectedDate.getTime(),r.date.getTime());if(n.setAttribute("data-row-index",O.toString()),this.parent.element.querySelector('.e-agenda-view tr[data-row-index="'+O+'"]'))break;n.insertBefore(y,n.childNodes[0])}i.appendChild(n)}},i.prototype.createDateHeaderElement=function(t){var i;if(this.parent.activeViewOptions.dateHeaderTemplate){i=(0,e.createElement)("div",{className:ci});var n={date:t,type:"dateHeader"},r=this.parent.element.id+"_"+this.parent.activeViewOptions.dateHeaderTemplateName+"dateHeaderTemplate",a=[].slice.call(this.parent.getDateHeaderTemplate()(n,this.parent,"dateHeaderTemplate",r,!1,void 0,void 0,this.parent.root));(0,e.append)(a,i)}else i=this.getMobileDateElement(t,ci);return i},i.prototype.renderEmptyContent=function(t,i,n){var r=this.createTableRowElement(i,"noEvents"),a=r.children[0],s=(0,e.createElement)("div",{className:"e-empty-event",innerHTML:this.parent.localeObj.getConstant("noEvents")});a.appendChild(s),t.appendChild(r),n&&this.parent.trigger(v,{elementType:R,element:a,date:i})},i.prototype.createTableRowElement=function(t,i){var n=Se(this.parent.selectedDate.getTime(),t.getTime()),r=(0,e.createElement)("tr",{attrs:{"data-row-index":n.toString()}}),a=(0,e.createElement)("td",{attrs:{class:"monthHeader"===i?pi:si,"aria-selected":"false","data-column-index":n.toString(),"data-date":t.getTime().toString()}}),s=a.cloneNode(),o=a.cloneNode();return r.appendChild(s),"noEvents"!==i&&r.appendChild(o),r},i.prototype.destroy=function(){t.prototype.destroy.call(this)},i}($o),vl=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ml=function(t){function i(e){var i=t.call(this,e)||this;return i.viewClass="e-agenda-view",i.isInverseTableSelect=!1,i.agendaDates={},i.virtualScrollTop=1,i}return vl(i,t),i.prototype.getModuleName=function(){return"agenda"},i.prototype.renderLayout=function(){this.agendaDates={},this.element=(0,e.createElement)("div",{className:ii}),(0,e.addClass)([this.element],this.viewClass),this.element.appendChild(this.createTableLayout(ni)),this.element.querySelector("table").setAttribute("role","presentation"),this.parent.element.querySelector("."+Xe).appendChild(this.element);var t=(0,e.createElement)("tr");this.element.querySelector("tbody").appendChild(t);var i=(0,e.createElement)("td");t.appendChild(i);var n=(0,e.createElement)("div",{className:ri});i.appendChild(n);var r=this.createTableLayout(Je);this.setAriaAttributes(r),n.appendChild(r);var a=r.querySelector("tbody"),s=ve(this.parent.selectedDate);this.renderEmptyContent(a,s),this.wireEvents(),this.parent.resourceBase&&this.parent.resourceBase.generateResourceLevels([{renderDates:this.parent.activeView.renderDates}]),this.parent.uiStateValues.isGroupAdaptive&&!this.parent.element.querySelector("."+qt)&&this.renderResourceMobileLayout(),this.parent.notify(_,{})},i.prototype.eventLoad=function(t){this.dataSource=(0,e.extend)([],this.parent.eventsData,null,!0);for(var i=0,n=this.parent.eventsData;i<n.length;i++){delete n[i].generatedDates}var r=this.parent.activeViewOptions.allowVirtualScrolling?t.processedData:this.parent.eventsProcessed;if(this.parent.uiStateValues.isGroupAdaptive){var a=this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex];this.dataSource=this.parent.eventBase.filterEventsByResource(a,this.dataSource),r=this.parent.eventBase.filterEventsByResource(a,r)}this.parent.eventsProcessed=this.processAgendaEvents(r);var s=ve(this.parent.selectedDate),o=this.element.querySelector("."+Je+" tbody");Me(o),this.renderInitialContent(o,s),this.wireEventActions(),(0,e.closest)(o,"."+ri).scrollTop=1,this.parent.notify(Y,{}),this.parent.activeViewOptions.allowVirtualScrolling||this.retainScrollPosition()},i.prototype.refreshEvent=function(t){for(var i=[],n=this.parent.eventFields,r=0,a=this.dataSource;r<a.length;r++){var s=a[r];(0,e.isNullOrUndefined)(s[n.recurrenceID])&&!(0,e.isNullOrUndefined)(s[n.recurrenceRule])&&!(0,e.isNullOrUndefined)(s.generatedDates)&&t>=s.generatedDates.end&&(i=i.concat(this.parent.eventBase.generateOccurrence(s,t)))}this.parent.eventsProcessed=this.parent.eventsProcessed.concat(this.processAgendaEvents(i))},i.prototype.refreshHeader=function(){var t=this.element.querySelector("."+Je+" tbody");this.parent.activeViewOptions.group.byDate?Me(t):(0,e.remove)(t.firstElementChild);var i=ve(this.parent.selectedDate),n=(0,e.createElement)("tbody"),r=new Date(i.getTime()),a=this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.hideEmptyAgendaDays?this.getEndDateFromStartDate(r):ye(r,this.parent.agendaDaysCount);this.renderContent(n,r,a),(0,e.append)([].slice.call(n.childNodes),t)},i.prototype.renderInitialContent=function(t,i){var n=(0,e.createElement)("tbody"),r=new Date(i.getTime()),a=this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.hideEmptyAgendaDays?this.getEndDateFromStartDate(r):ye(r,this.parent.agendaDaysCount);if(this.renderContent(n,r,a),(0,e.append)([].slice.call(n.childNodes),t),this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.hideEmptyAgendaDays&&this.parent.eventsData.length>0)for(var s=this.getContentAreaElement(),o=s.querySelector(".e-content-table");s.offsetWidth<=s.clientWidth&&!(this.parent.isAdaptive&&o.offsetHeight>=s.clientHeight);){var l=(0,e.createElement)("tbody");if(r=ye(a=r,-this.parent.agendaDaysCount),this.renderContent(l,r,a),(0,e.prepend)([].slice.call(l.childNodes),t),r<=this.parent.minDate)break}t.childNodes.length<=0&&this.renderEmptyContent(t,i,!0)},i.prototype.renderContent=function(t,i,n){var r,a=this.parent.eventFields,s=new Date(i.getTime()),o=this.appointmentFiltering(s,n);if(o.length>0&&this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.hideEmptyAgendaDays)if(this.parent.activeViewOptions.showWeekend||this.isAgendaWorkDay(o[0][a.startTime]))i=new Date(new Date(o[0][a.startTime].getTime()).setHours(0,0,0,0)),this.updateHeaderText(o[0][a.startTime]);else for(var l=0,p=o;l<p.length;l++){var c=p[l];if(this.isAgendaWorkDay(c[a.startTime])){i=new Date(new Date(c[a.startTime].getTime()).setHours(0,0,0,0)),this.updateHeaderText(c[a.startTime]);break}}if(!this.parent.hideEmptyAgendaDays||this.parent.agendaDaysCount>0&&o.length>0){if(this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive){var h=i;this.parent.activeViewOptions.group.byDate||(this.parent.activeViewOptions.allowVirtualScrolling=!1,h=s,this.parent.headerModule&&(this.parent.headerModule.updateDateRange(),this.parent.headerModule.updateHeaderItems("remove"))),this.calculateResourceTableElement(t,this.parent.agendaDaysCount,h,n)}else for(var d=0;d<this.parent.agendaDaysCount;d++){var u=this.createTableRowElement(i,"data"),g=this.element.querySelector('tr[data-row-index="'+ +u.dataset.rowIndex+'"]');if(g||!this.parent.activeViewOptions.showWeekend&&!this.isAgendaWorkDay(i)){if(i=ye(i,1),!g&&this.parent.activeViewOptions.allowVirtualScrolling&&d--,i.getTime()>n.getTime())break}else{var m=u.children[0],f=u.children[1],y=this.appointmentFiltering(i);if(y.length>0||!this.parent.hideEmptyAgendaDays&&0===y.length){var T=this.parent.hideEmptyAgendaDays||0!==y.length?"data":"noEvents";m.appendChild(this.createDateHeaderElement(i)),u.appendChild(m),this.parent.trigger(v,{elementType:j,element:m,date:i});var w=this.createAgendaContentElement(T,y,f);u.appendChild(w),w.querySelectorAll("li").length>0&&t.appendChild(u);var D=this.parent.hideEmptyAgendaDays||0!==y.length?H:R;this.parent.trigger(v,{elementType:D,element:w,date:i})}else this.parent.activeViewOptions.allowVirtualScrolling&&d--;if(this.isCurrentDate(new Date(i.getTime()))&&(0,e.addClass)(m.childNodes,oi),(i=ye(i,1)).getTime()>n.getTime())break}}r=new Date(i.getTime()-ie)}this.agendaDates={start:s,end:r}},i.prototype.isAgendaWorkDay=function(e){return this.parent.uiStateValues.isGroupAdaptive&&!this.parent.group.byDate?this.isWorkDay(e,this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex].workDays):this.isWorkDay(e)},i.prototype.agendaScrolling=function(e){this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide(),this.parent.activeViewOptions.allowVirtualScrolling&&this.virtualScrolling(e),this.parent.activeViewOptions.allowVirtualScrolling||this.setPersistence()},i.prototype.virtualScrolling=function(t){var i,n=t.target,r=n.scrollTop,a=n.scrollHeight,s=r+n.clientHeight,o=this.virtualScrollTop<r?"next":"previous",l=n.querySelector("tbody"),p=(0,e.createElement)("tbody"),c=this.getElementFromScrollerPosition(t),h=this.parent.getDateFromElement(c);if(0===r){if(i=this.getPreviousNextDate(ye(h,-1),o),this.appointmentFiltering(i.start,i.end).length>0||!this.parent.hideEmptyAgendaDays){this.renderContent(p,i.start,i.end),(0,e.prepend)([].slice.call(p.childNodes),l),this.wireEventActions();for(var d=0,u=l.children;d<u.length;d++)if(u[parseInt(d.toString(),10)].getAttribute("data-row-index")===c.getAttribute("data-column-index")){var g=u[parseInt(d.toString(),10)].offsetTop-this.element.querySelector(".e-agenda-item").offsetHeight;n.scrollTop=g;break}this.updateHeaderText(h)}}else s>=a-5?(i=this.getPreviousNextDate(ye(h,1),o),(this.appointmentFiltering(i.start,i.end).length>0||!this.parent.hideEmptyAgendaDays)&&(this.renderContent(p,i.start,i.end),(0,e.append)([].slice.call(p.childNodes),l),this.wireEventActions(),this.updateHeaderText(h))):this.updateHeaderText(h);this.virtualScrollTop=r;var v=this.parent.eventBase.getSelectedAppointments();v.length>0&&v[v.length-1].focus()},i.prototype.getElementFromScrollerPosition=function(t){var i,n,r=t.target,a=r.scrollTop,s=r.scrollHeight,o=a+r.clientHeight,l=[].slice.call(r.querySelectorAll(".e-agenda-item"));if(l.length>0)if(0===a)n=l[0],i=(0,e.closest)(n,"."+si);else if(o===s)n=l[l.length-1],i=(0,e.closest)(n,"."+si);else for(var p=0,c=l.length;p<c;p++)if((n=l[parseInt(p.toString(),10)]).getBoundingClientRect().top>=0){i=(0,e.closest)(n,"."+si);break}return i},i.prototype.updateHeaderText=function(e){this.parent.showHeaderBar&&this.parent.headerModule.updateDateRange(e)},i.prototype.getPreviousNextDate=function(e,t){var i=new Date(e.getTime()),n=this.getStartDateFromEndDate(e),r=this.getEndDateFromStartDate(e),a=0;do{if(this.parent.activeViewOptions.showWeekend||!this.parent.activeViewOptions.showWeekend&&this.isAgendaWorkDay(i))(this.appointmentFiltering(i).length>0||!this.parent.hideEmptyAgendaDays)&&a++;if((i=ye(i,"next"===t?1:-1))<n||i>r)break}while(a!==this.parent.agendaDaysCount);var s=ye(i,"next"===t?-1:1);return"next"===t?{start:e,end:ye(s,1)}:{start:s,end:ye(e,1)}},i.prototype.appointmentFiltering=function(t,i){var n,r;!(0,e.isNullOrUndefined)(t)&&(0,e.isNullOrUndefined)(i)?(n=ve(new Date(t.getTime())),r=ge(new Date(n.getTime()),ie)):(n=new Date(t.getTime()),r=new Date(i.getTime()));var a=this.parent.eventBase.filterEvents(n,r);return 0===a.length&&(this.refreshEvent(t),a=this.parent.eventBase.filterEvents(n,r)),a},i.prototype.getStartDateFromEndDate=function(e){var t,i=this.parent.eventFields;if(this.parent.eventsProcessed.length>0){var n=Math.min.apply(Math,this.parent.eventsProcessed.map((function(e){return e[i.startTime].getTime()})));t=this.parent.hideEmptyAgendaDays?new Date(n):this.parent.minDate}else t=this.parent.hideEmptyAgendaDays?Te(e,-1):this.parent.minDate;return ve(t)},i.prototype.getEndDateFromStartDate=function(e){var t,i=this.parent.eventFields;if(this.parent.eventsProcessed.length>0){var n=Math.max.apply(Math,this.parent.eventsProcessed.map((function(e){return e[i.endTime].getTime()})));t=this.parent.hideEmptyAgendaDays?new Date(n):this.parent.maxDate}else t=this.parent.hideEmptyAgendaDays?Te(e,1):this.parent.maxDate;return ve(ye(t,1))},i.prototype.getNextPreviousDate=function(e){var t="Next"===e?1:-1;return ye(this.parent.selectedDate,t)},i.prototype.startDate=function(){return ve(this.parent.selectedDate)},i.prototype.endDate=function(){return this.parent.activeViewOptions.allowVirtualScrolling?this.getEndDateFromStartDate(this.startDate()):ye(this.startDate(),this.parent.agendaDaysCount)},i.prototype.getDateRangeText=function(t){var i=this.parent.activeViewOptions.dateFormat?this.parent.activeViewOptions.dateFormat:"MMMM y";if(this.parent.activeViewOptions.allowVirtualScrolling||this.parent.isAdaptive){var n=(0,e.isNullOrUndefined)(t)?this.parent.selectedDate:t;return je(this.parent.globalize.formatDate(n,{format:i,calendar:this.parent.getCalendarMode()}),"multiple")}var r=this.parent.selectedDate,a=ye(r,this.parent.agendaDaysCount-1);return this.formatDateRange(r,a)},i.prototype.dayNavigationClick=function(t){var i=(0,e.closest)(t.currentTarget,"."+si),n=this.parent.getDateFromElement(i);(0,e.isNullOrUndefined)(n)||this.parent.isAdaptive||!this.parent.isMinMaxDate(n)||(this.parent.setProperties({selectedDate:n},!0),this.parent.changeView("Day",t))},i.prototype.wireEvents=function(){e.EventHandler.add(this.element.querySelector("."+ri),G,this.agendaScrolling,this)},i.prototype.unWireEvents=function(){e.EventHandler.remove(this.element.querySelector("."+ri),G,this.agendaScrolling);for(var t=0,i=[].slice.call(this.element.querySelectorAll(".e-m-date"));t<i.length;t++){var n=i[t];e.EventHandler.remove(n,"click",this.dayNavigationClick)}},i.prototype.addEventListener=function(){this.parent.on(Q,this.onAgendaScrollUiUpdate,this),this.parent.on(z,this.eventLoad,this)},i.prototype.removeEventListener=function(){this.parent&&(this.parent.off(Q,this.onAgendaScrollUiUpdate),this.parent.off(z,this.eventLoad))},i.prototype.onAgendaScrollUiUpdate=function(){var t=this.getHeaderBarHeight();this.parent.headerModule&&(this.parent.activeViewOptions.allowVirtualScrolling?this.parent.headerModule.updateHeaderItems("add"):this.parent.headerModule.updateHeaderItems("remove"));var i=this.element.querySelector("."+ri);"auto"!==this.parent.height&&(i.style.height=(0,e.formatUnit)(this.parent.element.offsetHeight-t))},i.prototype.scrollToDate=function(e){var t=new Date(+ve(e));if(this.parent.activeViewOptions.allowVirtualScrolling)(!this.parent.hideEmptyAgendaDays||this.parent.getEvents(t,ye(t,1),!0).length>0)&&this.parent.changeDate(t);else{var i=this.element.querySelector("."+si+'[data-date="'+t.getTime()+'"]');i&&(this.getContentAreaElement().scrollTop=i.offsetTop)}},i.prototype.destroy=function(){!this.parent||this.parent&&this.parent.isDestroyed||this.element&&(this.unWireEvents(),this.parent.resourceBase&&this.parent.resourceBase.destroy(),this.parent.headerModule&&this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.headerModule.updateHeaderItems("remove"),t.prototype.destroy.call(this))},i}(gl),fl=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),yl=function(t){function i(e){var i=t.call(this,e)||this;return i.dayNameFormat="narrow",i.viewClass="e-month-agenda-view",i.monthAgendaDate=new Date(""+e.selectedDate),i}return fl(i,t),i.prototype.getModuleName=function(){return"monthAgenda"},i.prototype.renderAppointmentContainer=function(){var t=this.getContentAreaElement(),i=(0,e.createElement)("div",{className:_t});t.appendChild(i);var n=(0,e.createElement)("div",{className:Yt});i.appendChild(n),this.appendAppContainer(n),this.setEventWrapperHeight()},i.prototype.getDayNameFormat=function(){return this.parent.isAdaptive?"narrow":"abbreviated"},i.prototype.updateSelectedCellClass=function(e){ve(e.date).getTime()===ve(new Date(""+this.parent.selectedDate)).getTime()&&e.className.push(Bt)},i.prototype.setEventWrapperHeight=function(){var t=(this.parent.headerModule?this.parent.headerModule.getHeaderElement().offsetHeight:0)+2,i=this.parent.element.querySelector("."+Ut);i&&(t+=i.offsetHeight);var n=this.getContentAreaElement().firstElementChild,r=this.element.querySelector("."+it),a=this.parent.element.offsetHeight-t-r.offsetHeight,s=this.parent.activeViewOptions.interval>1?Math.round(.8*a):n.offsetHeight,o=a-s,l=this.element.querySelector("."+_t),p=this.element.querySelector("."+Yt);"auto"!==this.parent.height&&(this.parent.activeViewOptions.interval>1&&(n.style.height=(0,e.formatUnit)(s),e.EventHandler.add(n,"scroll",this.onContentScroll,this)),l.style.height=p.style.height=(0,e.formatUnit)(o))},i.prototype.onDataReady=function(t){this.setEventWrapperHeight(),this.clearElements();var i=t.processedData;if(this.parent.uiStateValues.isGroupAdaptive){var n=this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex];i=this.parent.eventBase.filterEventsByResource(n,i)}this.agendaBase=this.getAgendaBase(),this.parent.eventsProcessed=this.agendaBase.processAgendaEvents(i);for(var r=0,a=0,s=this.renderDates;a<s.length;a++){var o=s[a],l=this.appointmentFiltering(o),p=this.element.querySelectorAll("."+$e)[parseInt(r.toString(),10)];l.length>0&&(p.querySelector("."+fi)||p.appendChild((0,e.createElement)("div",{className:fi})),o.getTime()===ve(new Date(this.monthAgendaDate.getTime())).getTime()&&this.onEventRender(l,o)),r++}this.parent.notify(Y,{})},i.prototype.onCellClick=function(e){this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide();var t=this.appointmentFiltering(e.startTime);this.onEventRender(t,e.startTime),this.parent.notify(Y,{}),this.monthAgendaDate=new Date(""+e.startTime),this.parent.setProperties({selectedDate:this.monthAgendaDate},!0)},i.prototype.onEventRender=function(t,i){this.agendaBase=this.getAgendaBase();var n=this.element.querySelector("."+Yt);if(Me(n),0===this.parent.activeViewOptions.group.resources.length||this.parent.uiStateValues.isGroupAdaptive)if(t.length>0){var r=(0,e.createElement)("div",{className:Gt});n.appendChild(this.agendaBase.createAgendaContentElement("data",t,r))}else this.appendAppContainer(n);else if(t.length>0){var a=this.createTableLayout(),s=a.querySelector("tbody");this.agendaBase.calculateResourceTableElement(s,1,i),a.appendChild(s),n.appendChild(a)}else this.appendAppContainer(n);this.agendaBase.wireEventActions()},i.prototype.appointmentFiltering=function(e){var t=ve(new Date(e.getTime())),i=ge(new Date(t.getTime()),ie);return this.parent.eventBase.filterEvents(t,i)},i.prototype.clearElements=function(){for(var t=0,i=[].slice.call(this.element.querySelectorAll("."+fi));t<i.length;t++){var n=i[t];(0,e.remove)(n)}this.appendAppContainer(this.element.querySelector("."+Yt))},i.prototype.appendAppContainer=function(t){var i=(0,e.createElement)("div",{className:Gt});(0,e.addClass)([i],mi),i.innerHTML=this.parent.localeObj.getConstant("noEvents"),Me(t),t.appendChild(i)},i.prototype.getNextPreviousDate=function(e){var t=this.parent.selectedDate,i="Next"===e?this.parent.activeViewOptions.interval:-this.parent.activeViewOptions.interval,n=Te(this.parent.selectedDate,i),r="Next"===e?2:0,a=new Date(t.getFullYear(),t.getMonth()+r,0).getDate(),s=a>=this.monthAgendaDate.getDate()?this.monthAgendaDate.getDate():a;return this.monthAgendaDate=new Date(n.getFullYear(),n.getMonth(),s),this.monthAgendaDate},i.prototype.getAgendaBase=function(){return this.agendaBase||new gl(this.parent)},i.prototype.destroy=function(){this.agendaBase&&(this.agendaBase.destroy(),this.agendaBase=null),t.prototype.destroy.call(this)},i}(pl),Tl=function(){function t(e,t){this.parent=e,this.renderDates=t}return t.prototype.groupByYear=function(e){for(var t={},i=0,n=e;i<n.length;i++){var r=n[i],a=r.getFullYear();t[parseInt(a.toString(),10)]=t[parseInt(a.toString(),10)]||[],t[parseInt(a.toString(),10)].push(r)}return t},t.prototype.groupByMonth=function(e){for(var t={},i=0,n=e;i<n.length;i++){var r=n[i],a=12*(r.getFullYear()-1970)+r.getMonth();t[parseInt(a.toString(),10)]=t[parseInt(a.toString(),10)]||[],t[parseInt(a.toString(),10)].push(r)}return t},t.prototype.groupByWeek=function(e){for(var t={},i=0,n=e;i<n.length;i++){var r=n[i],a=+new Date(1970,0,1),s=r.getTimezoneOffset()-new Date(1970,0,1).getTimezoneOffset(),o=Math.ceil(((+r-a-60*s*1e3)/ie+new Date(a).getDay()+1)/7);this.parent.activeViewOptions.firstDayOfWeek&&this.parent.activeViewOptions.firstDayOfWeek>new Date(+r).getDay()&&(o-=1),t[parseInt(o.toString(),10)]=t[parseInt(o.toString(),10)]||[],t[parseInt(o.toString(),10)].push(r)}return t},t.prototype.generateSlots=function(t,i,n,r,a){for(var s=this,o=function(e,t){return s.parent.globalize.formatDate(e,{format:t,calendar:s.parent.getCalendarMode()})},l=[],p=Object.keys(t),c=0;c<p.length;c++){var h=t[p[parseInt(c.toString(),10)]],d=void 0;if(n.template){var u={date:h[0],type:a},g=this.parent.element.id+"_headerRowTemplate";d=[].slice.call(this.parent.templateParser(n.template)(u,this.parent,"template",g,!1))}else{var v=void 0;switch(n.option){case"Year":v='<span class="e-header-year">'+o(h[0],"y")+"</span>";break;case"Month":v='<span class="e-header-month">'+je(o(h[0],"MMMM"),"single")+"</span>";break;case"Week":v='<span class="e-header-week">'+this.parent.getWeekNumberContent(h)+"</span>"}var m=(0,e.createElement)("div",{innerHTML:v});d=[].slice.call(m.childNodes)}l.push({date:h[0],type:a,className:[r],colSpan:h.length*i,template:d})}return l},t.prototype.generateColumnLevels=function(e,t){var i=[],n=this.parent.activeViewOptions.headerRows,r=1;"Hour"===n[n.length-1].option&&t.length>0&&(r=t.length/e.length);for(var a,s,o,l=[],p=0,c=n;p<c.length;p++){var h=c[p];switch(h.option){case"Year":a=this.groupByYear(this.renderDates),l=this.generateSlots(a,r,h,"e-header-year-cell","yearHeader"),i.push(l);break;case"Month":s=this.groupByMonth(this.renderDates),l=this.generateSlots(s,r,h,"e-header-month-cell","monthHeader"),i.push(l);break;case"Week":o=this.groupByWeek(this.renderDates),l=this.generateSlots(o,r,h,"e-header-week-cell","weekHeader"),i.push(l);break;case"Date":l=(l=e).map((function(e){return e.colSpan=r,e})),i.push(l);break;case"Hour":t.length>0&&i.push(t)}}return i},t}(),wl=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Dl=function(t){function i(e){var i=t.call(this,e)||this;return i.timelineAppointment=null,i.baseCssClass="e-timeline-view",i}return wl(i,t),i.prototype.getModuleName=function(){return"timelineViews"},i.prototype.getLeftPanelElement=function(){return this.element.querySelector("."+yt)},i.prototype.scrollTopPanel=function(e){t.prototype.scrollTopPanel.call(this,e),this.scrollHeaderLabels(e)},i.prototype.scrollToWorkHour=function(){var t=this.parent.getStartEndTime(this.parent.workHours.start),i=this.isWorkDay(this.parent.selectedDate)&&this.parent.workHours.highlight&&!(0,e.isNullOrUndefined)(t)?new Date(+this.parent.selectedDate).setHours(t.getHours(),t.getMinutes(),0,0):new Date(+this.parent.selectedDate).setHours(0,0,0,0),n='[data-date="'+new Date(i).getTime().toString()+'"]',r=this.element.querySelector(n);r&&(this.getContentAreaElement().scrollLeft=this.parent.enableRtl?-(this.parent.getContentTable().offsetWidth-r.offsetLeft-r.offsetWidth):r.offsetLeft)},i.prototype.scrollToHour=function(t,i){var n,r,a;if(i&&(r=this.parent.getIndexOfDate(this.renderDates,ve(i)))>=0&&(n=i,!(0,e.isNullOrUndefined)(t))){var s=t.split(":");2===s.length&&(n=new Date(i.setHours(parseInt(s[0],10),parseInt(s[1],10),0)))}(n=(0,e.isNullOrUndefined)(i)?this.parent.getStartEndTime(t):n,(0,e.isNullOrUndefined)(n))||(a=(0,e.isNullOrUndefined)(t)||!this.parent.activeViewOptions.timeScale.enable?r*this.parent.getElementWidth(this.element.querySelector(".e-work-cells")):(0,e.isNullOrUndefined)(i)?this.getLeftFromDateTime(null,n):this.getLeftFromDateTime([r],n),this.getScrollableElement().scrollLeft=this.parent.enableRtl?-a:a)},i.prototype.generateColumnLevels=function(){var e=[],t=this.getDateSlots(this.renderDates,this.parent.activeViewOptions.workDays);e.push(t),this.parent.activeViewOptions.group.resources.length>0&&this.parent.resourceBase.generateResourceLevels(t,!this.parent.uiStateValues.isGroupAdaptive);var i=[];(this.parent.activeViewOptions.timeScale.enable&&(i=this.generateTimeSlots(e[e.length-1]),e.push(i)),this.parent.activeViewOptions.headerRows.length>0)&&(e=new Tl(this.parent,this.renderDates).generateColumnLevels(t,i));return e},i.prototype.generateTimeSlots=function(t){for(var i=this,n=this.getTimeSlotRows((function(e){return e.type=e.first?"majorSlot":"minorSlot",e.className=e.first?[Vt]:[Vt,xt],e.workDays=i.parent.activeViewOptions.workDays,e})),r=[],a=0,s=t;a<s.length;a++){var o=s[a];o.colSpan=n.length;for(var l=0,p=(0,e.extend)([],n,null,!0);l<p.length;l++){var c=p[l],h=ve(new Date(""+o.date));c.date=ge(h,me(c.date)),r.push(c)}}return r},i.prototype.changeCurrentTimePosition=function(){if(!(!this.parent||this.parent&&this.parent.isDestroyed)){this.removeCurrentTimeIndicatorElements();var t=this.getCurrentTimeIndicatorIndex(),i=this.getLeftFromDateTime(t,this.parent.getCurrentTime()),n=this.element.querySelector("."+Je).offsetHeight,r=this.element.querySelector("."+it);if(this.element.querySelector("."+ri).appendChild((0,e.createElement)("div",{className:Mt,styles:(this.parent.enableRtl?"right":"left")+":"+(0,e.formatUnit)(i)+"; height:"+(0,e.formatUnit)(n)})),this.parent.virtualScrollModule){var a=this.parent.element.querySelector("."+Mt),s=this.parent.element.querySelector("."+ri+" table");(0,e.setStyleAttribute)(a,{transform:s.style.transform})}var o=(0,e.createElement)("div",{innerHTML:this.parent.getTimeString(this.parent.getCurrentTime()),className:It});r.appendChild(o),o.style[this.parent.enableRtl?"right":"left"]=(0,e.formatUnit)(i-o.offsetWidth/2)}},i.prototype.getLeftFromDateTime=function(t,i){var n=this.getStartHour(),r=this.getEndHour(),a=0,s=60*(i.getHours()-n.getHours())+(i.getMinutes()-n.getMinutes()),o=De(ve(new Date(i.getTime())),n,r),l=(o.endHour.getTime()-o.startHour.getTime())/ne,p=this.parent.activeViewOptions.timeScale.interval,c=0;if(c=0===n.getHours()&&0===n.getMinutes()&&0===r.getHours()&&0===r.getMinutes()||1!==this.parent.activeViewOptions.timeScale.slotCount?p:p>l?l:p,!(0,e.isNullOrUndefined)(t)&&0!==t[0]){var h=this.parent.activeView.colLevels.findIndex((function(e){return"dateHeader"===e[0].type}));if(this.parent.activeView.colLevels[parseInt(h.toString(),10)]&&this.parent.activeView.colLevels[parseInt(h.toString(),10)][0].colSpan)a=t[0]*this.parent.activeView.colLevels[parseInt(h.toString(),10)][0].colSpan*this.parent.getElementWidth(this.element.querySelector(".e-work-cells"));else{var d=this.getEndHour(),u=0===d.getHours()?24:d.getHours();s+=t[0]*(60*(u-n.getHours())+(d.getMinutes()-n.getMinutes()))}}return a+s*this.parent.getElementWidth(this.element.querySelector(".e-work-cells"))*this.parent.activeViewOptions.timeScale.slotCount/c},i.prototype.renderHeader=function(){var t=(0,e.createElement)("tr");this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&this.parent.resourceBase.renderResourceHeaderIndent(t);var i=(0,e.createElement)("td");i.appendChild(this.renderDatesHeader()),t.appendChild(i),(0,e.prepend)([t],this.element.querySelector("tbody"))},i.prototype.createAllDayRow=function(e,t){},i.prototype.getCurrentTimeIndicatorIndex=function(){var e=[],t=this.parent.getIndexOfDate(this.renderDates,ve(this.parent.getCurrentTime()));return t>=0&&e.push(t),e},i.prototype.renderContent=function(){var t=(0,e.createElement)("tr");if(this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive){var i=(0,e.createElement)("td");i.appendChild(this.parent.resourceBase.createResourceColumn()),t.appendChild(i)}var n=(0,e.createElement)("td"),r=this.renderContentArea();r.appendChild(this.createEventTable(this.getRowCount())),this.collapseRows(r),n.appendChild(r),t.appendChild(n),this.parent.virtualScrollModule&&this.parent.virtualScrollModule.renderVirtualTrack(r),this.element.querySelector("tbody").appendChild(t)},i.prototype.getRowCount=function(){return this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive?this.parent.resourceBase.renderedResources.length:1},i.prototype.getResourceTdData=function(e,t){var i=this.parent.resourceBase.renderedResources[parseInt(e.toString(),10)],n=i.resourceData[i.resource.startHourField]||this.parent.workHours.start,r=i.resourceData[i.resource.endHourField]||this.parent.workHours.end;return t.startHour=this.parent.getStartEndTime(n),t.endHour=this.parent.getStartEndTime(r),t.workDays=i.resourceData[i.resource.workDaysField]||this.parent.workDays,t.className=i.className,t.groupIndex=i.groupIndex,t.groupOrder=i.groupOrder,t},i.prototype.renderContentTable=function(t){var i=t.querySelector("tbody");(0,e.append)(this.getContentRows(),i)},i.prototype.getContentRows=function(){for(var t=[],i=(0,e.createElement)("tr"),n=(0,e.createElement)("td"),r=this.getRowCount(),a=this.getGroupIndices(),s=0;s<r;s++)if(!(a.length>0&&a.indexOf(this.parent.resourceBase.renderedResources[parseInt(s.toString(),10)].groupIndex)>-1)){for(var o=i.cloneNode(),l=0,p=this.colLevels[this.colLevels.length-1];l<p.length;l++){var c=p[l];this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&(c=this.getResourceTdData(s,c));var h=this.createContentTd(c,c,n);o.appendChild(h)}t.push(o)}return t},i.prototype.getContentTdClass=function(e){return e.first||!this.parent.activeViewOptions.timeScale.enable?[$e]:[$e,At]},i.prototype.renderEvents=function(){this.timelineAppointment=new Pa(this.parent,this.parent.activeViewOptions.timeScale.enable?"hour":"day"),this.timelineAppointment.renderAppointments(),this.parent.notify(Y,{})},i.prototype.getAdjustedDate=function(e){if(!this.parent.activeViewOptions.timeScale.enable)return new Date(e.setHours(0,0,0,0));for(var t=this.colLevels[this.colLevels.length-1],i=0;i<t.length;i++)if(t[parseInt(i.toString(),10)].date.getTime()>e.getTime())return t[i-1].date;return null},i.prototype.destroy=function(){!this.parent||this.parent&&this.parent.isDestroyed||(this.timelineAppointment&&(this.timelineAppointment.destroy(),this.timelineAppointment=null),t.prototype.destroy.call(this))},i}(tl),bl=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Sl=function(t){function i(e){var i=t.call(this,e)||this;return i.viewClass="e-timeline-month-view",i.isInverseTableSelect=!0,i.appointment=null,i}return bl(i,t),i.prototype.getModuleName=function(){return"timelineMonth"},i.prototype.onDataReady=function(){this.appointment=new Pa(this.parent,"day"),this.appointment.renderAppointments(),this.parent.notify(Y,{})},i.prototype.getLeftPanelElement=function(){return this.element.querySelector("."+yt)},i.prototype.scrollTopPanel=function(e){t.prototype.scrollTopPanel.call(this,e),this.scrollHeaderLabels(e)},i.prototype.setContentHeight=function(t,i,n){i&&(i.style.height=(0,e.formatUnit)(n-this.getScrollXIndent(t))),t.style.height=(0,e.formatUnit)(n)},i.prototype.getDateSlots=function(e,t){for(var i=[],n=0,r=e;n<r.length;n++){var a=r[n],s=[rt];this.isCurrentDate(a)&&s.push(ot),i.push({date:a,type:"dateHeader",className:s,colSpan:1,workDays:t})}return i},i.prototype.renderLeftIndent=function(e){this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&this.parent.resourceBase.renderResourceHeaderIndent(e)},i.prototype.renderContent=function(){var t=(0,e.createElement)("tr");if(this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive){var i=(0,e.createElement)("td");i.appendChild(this.parent.resourceBase.createResourceColumn()),t.appendChild(i)}var n=(0,e.createElement)("td");this.element.querySelector("tbody").appendChild(t);var r=(0,e.createElement)("div",{className:ri});r.appendChild(this.renderContentArea()),r.appendChild(this.createEventTable(this.getRowCount())),this.collapseRows(r),e.EventHandler.add(r,"scroll",this.onContentScroll,this),n.appendChild(r),this.parent.virtualScrollModule&&this.parent.virtualScrollModule.renderVirtualTrack(r),t.appendChild(n)},i.prototype.getRowCount=function(){return this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive?this.parent.resourceBase.renderedResources.length:1},i.prototype.getContentSlots=function(){for(var e=[],t=0;t<this.getRowCount();t++)for(var i=0,n=this.colLevels[this.colLevels.length-1];i<n.length;i++){var r=n[i];if(r.className=[$e],this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive){var a=this.parent.resourceBase.renderedResources[parseInt(t.toString(),10)];r.workDays=a.resourceData[a.resource.workDaysField]||this.parent.workDays,r.className=r.className.concat(a.className),r.groupIndex=a.groupIndex,r.groupOrder=a.groupOrder}var s={date:new Date(+r.date),colSpan:r.colSpan,groupIndex:r.groupIndex,workDays:r.workDays,type:"monthCells",className:r.className};e[parseInt(t.toString(),10)]||(e[parseInt(t.toString(),10)]=[]),e[parseInt(t.toString(),10)].push(s)}return e},i.prototype.updateClassList=function(e){this.parent.isMinMaxDate(e.date)||e.className.push(Qn)},i.prototype.unWireEvents=function(){e.EventHandler.remove(this.getContentAreaElement(),"scroll",this.onContentScroll)},i.prototype.getMonthStart=function(e){var t=this.parent.calendarUtil.firstDateOfMonth(ve(e));return new Date(t.getFullYear(),t.getMonth(),t.getDate())},i.prototype.getMonthEnd=function(e){var t=this.parent.calendarUtil.firstDateOfMonth(ve(e));return this.parent.calendarUtil.lastDateOfMonth(Te(new Date(+t),this.parent.activeViewOptions.interval-1))},i.prototype.generateColumnLevels=function(){var e=[],t=this.getDateSlots(this.renderDates,this.parent.activeViewOptions.workDays);e.push(t),this.parent.activeViewOptions.group.resources.length>0&&this.parent.resourceBase.generateResourceLevels(t,!this.parent.uiStateValues.isGroupAdaptive);this.parent.activeViewOptions.headerRows.length>0&&(e=new Tl(this.parent,this.renderDates).generateColumnLevels(t,[]));return this.colLevels=e,e},i.prototype.getAdjustedDate=function(e){for(var t=this.colLevels[this.colLevels.length-1],i=0;i<t.length;i++)if(t[parseInt(i.toString(),10)].date.getTime()>e.getTime())return t[i-1].date;return null},i.prototype.destroy=function(){if(!(!this.parent||this.parent&&this.parent.isDestroyed)){if(this.element){var i=this.element.querySelector("."+ri);i&&e.EventHandler.remove(i,"scroll",this.onContentScroll)}this.appointment&&(this.appointment.destroy(),this.appointment=null),t.prototype.destroy.call(this)}},i}(pl),Cl=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ol=function(t){function i(e){var i=t.call(this,e)||this;return i.viewClass="e-timeline-year-view",i.isInverseTableSelect=!0,i}return Cl(i,t),i.prototype.getModuleName=function(){return"timelineYear"},i.prototype.renderHeader=function(t){var i=(0,e.createElement)("tr");if(t.appendChild(i),"Vertical"===this.parent.activeViewOptions.orientation&&this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive)this.parent.resourceBase.renderResourceHeaderIndent(i);else{var n=(0,e.createElement)("td",{className:ut});i.appendChild(n),n.appendChild(this.renderResourceHeader(gt))}var r="Horizontal"===this.parent.activeViewOptions.orientation,a=this.parent.activeViewOptions.group.resources.length>0;this.isInverseTableSelect=!(r&&!a);var s=(0,e.createElement)("td");i.appendChild(s);var o=(0,e.createElement)("div",{className:nt});if(s.appendChild(o),"Horizontal"===this.parent.activeViewOptions.orientation&&this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive)o.appendChild(this.renderResourceHeader(it)),this.columnCount=this.colLevels.slice(-1)[0].length;else{var l=(0,e.createElement)("div",{className:it});o.appendChild(l);var p=this.createTableLayout();l.appendChild(p),p.appendChild(this.createTableColGroup(this.columnCount));var c=(0,e.createElement)("tr");p.querySelector("tbody").appendChild(c);for(var h=this.getMonths(),d=this.getMonthDates(new Date(this.parent.selectedDate.getFullYear(),h[0],1)),u=0;u<this.columnCount;u++){var g=new Date(this.parent.selectedDate.getFullYear(),h[parseInt(u.toString(),10)],1),m=(0,e.createElement)("td",{className:rt});"Horizontal"===this.parent.activeViewOptions.orientation?this.parent.dayHeaderTemplate?(0,e.append)(this.renderDayMonthHeaderTemplate(d[parseInt(u.toString(),10)],u,"dayHeaderTemplate"),m):m.innerHTML="<span>"+this.parent.getDayNames("abbreviated")[u%7]+"</span>":(this.parent.monthHeaderTemplate?(0,e.append)(this.renderDayMonthHeaderTemplate(g,h[parseInt(u.toString(),10)],"monthHeaderTemplate"),m):m.innerHTML="<span>"+this.getMonthName(g)+"</span>",m.setAttribute("data-date",g.getTime().toString())),c.appendChild(m),this.parent.trigger(v,{elementType:"headerCells",element:m})}}},i.prototype.renderResourceHeader=function(t){var i=(0,e.createElement)("div",{className:t}),n=this.createTableLayout();i.appendChild(n);var r=(0,e.createElement)("tr");if(this.parent.activeViewOptions.group.resources.length>0)this.colLevels=this.generateColumnLevels();else{var a=[{className:[rt],type:"headerCell"}];this.colLevels=[a]}for(var s=0,o=this.colLevels;s<o.length;s++){for(var l=o[s],p=r.cloneNode(),c=0,h=t===it?l:[l[0]];c<h.length;c++){var d=h[c],u=(0,e.createElement)("td");d.className&&(0,e.addClass)([u],d.className),t===it&&(d.template&&(0,e.append)(d.template,u),d.colSpan&&u.setAttribute("colspan",d.colSpan.toString()),d.groupIndex>-1&&u.setAttribute("data-group-index",d.groupIndex.toString()),this.setResourceHeaderContent(u,d)),t===gt&&this.parent.renderHeaderIndentTemplate(d,u);var g={elementType:d.type,element:u,date:d.date,groupIndex:d.groupIndex};this.parent.trigger(v,g),p.appendChild(u)}n.querySelector("tbody").appendChild(p)}return t===it&&n.appendChild(this.createTableColGroup(this.colLevels.slice(-1)[0].length)),i},i.prototype.renderContent=function(t){var i=(0,e.createElement)("tr");t.appendChild(i);var n,r=(0,e.createElement)("td"),a=(0,e.createElement)("td"),s=[];if("Vertical"===this.parent.activeViewOptions.orientation&&this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive)s.push(r),r.appendChild(this.parent.resourceBase.createResourceColumn()),this.rowCount=this.parent.resourceBase.renderedResources.length;else{s.push(r);var o=(0,e.createElement)("div",{className:hr});r.appendChild(o),o.appendChild(this.createTableLayout()),n=o.querySelector("tbody")}s.push(a),(0,e.append)(s,i);var l=(0,e.createElement)("div",{className:ri});a.appendChild(l);var p=this.createTableLayout(Je);this.setAriaAttributes(p),l.appendChild(p);var c=(0,e.createElement)("div",{className:vt});l.appendChild(c),this.parent.virtualScrollModule&&this.parent.virtualScrollModule.renderVirtualTrack(l);var h=p.querySelector("tbody");if(this.parent.rowAutoHeight){var d=[p],u=this.parent.element.querySelector("."+hr+" ."+Qe);u&&d.push(u),(0,e.addClass)(d,lr)}if(this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive){var g="Horizontal"===this.parent.activeViewOptions.orientation?this.colLevels.slice(-1)[0].length:this.columnCount;p.appendChild(this.createTableColGroup(g)),this.renderResourceContent(c,n,h)}else p.appendChild(this.createTableColGroup(this.columnCount)),this.renderDefaultContent(c,n,h)},i.prototype.renderDefaultContent=function(t,i,n){for(var r=this.getMonths(),a=this.getMonthDates(new Date(this.parent.selectedDate.getFullYear(),r[0],1)),s=0;s<this.rowCount;s++){t.appendChild((0,e.createElement)("div",{className:Gt}));var o=new Date(this.parent.selectedDate.getFullYear(),r[parseInt(s.toString(),10)],1),l=this.parent.calendarUtil.getMonthStartDate(new Date(o.getTime())),p=this.parent.calendarUtil.getMonthEndDate(new Date(o.getTime())),c=(0,e.createElement)("tr"),h=c.cloneNode();i.appendChild(h);var d=c.cloneNode();n.appendChild(d);var u=(0,e.createElement)("td",{className:pi});"Horizontal"===this.parent.activeViewOptions.orientation?(this.parent.monthHeaderTemplate?(0,e.append)(this.renderDayMonthHeaderTemplate(l,s,"monthHeaderTemplate"),u):u.innerHTML="<span>"+this.getMonthName(o)+"</span>",u.setAttribute("data-date",o.getTime().toString())):this.parent.dayHeaderTemplate?(0,e.append)(this.renderDayMonthHeaderTemplate(a[parseInt(s.toString(),10)],s,"dayHeaderTemplate"),u):u.innerHTML="<span>"+this.parent.getDayNames("abbreviated")[s%7]+"</span>",h.appendChild(u),this.parent.trigger(v,{elementType:"leftHeaderCells",element:u});for(var g=new Date(l.getTime()),m=0;m<this.columnCount;m++){var f=void 0;if("Vertical"===this.parent.activeViewOptions.orientation){o=new Date(this.parent.selectedDate.getFullYear(),r[parseInt(m.toString(),10)],1),l=this.parent.calendarUtil.getMonthStartDate(new Date(o.getTime())),p=this.parent.calendarUtil.getMonthEndDate(new Date(o.getTime()));var y=s-l.getDay()+1;g=new Date(this.parent.selectedDate.getFullYear(),r[parseInt(m.toString(),10)],y),f=y>0&&g.getTime()<p.getTime()}else f=m>=l.getDay()&&g.getTime()<p.getTime();var T=this.parent.globalize.formatDate(g,{skeleton:"full",calendar:this.parent.getCalendarMode()}),w=(0,e.createElement)("td",{className:$e,attrs:{"aria-label":T}});d.appendChild(w);var D=(0,e.createElement)("div",{className:ui+" "+di,innerHTML:f?this.parent.globalize.formatDate(g,{skeleton:"d",calendar:this.parent.getCalendarMode()}):""});if(f){var b=[w],S=[];this.parent.activeViewOptions.workDays.indexOf(g.getDay())>-1&&S.push(at),this.parent.isMinMaxDate(g)||(0,e.addClass)([w],Qn),this.isCurrentDate(g)&&(S.push(ot),"Horizontal"===this.parent.activeViewOptions.orientation?b.push(this.element.querySelector("."+rt+":nth-child("+(m+1)+")")):b.push(this.element.querySelectorAll("."+pi).item(s))),S.length>0&&(0,e.addClass)(b,S)}else(0,e.addClass)([w],st),this.parent.isMinMaxDate(g)||(0,e.addClass)([w],Qn);w.classList.contains(st)||(this.renderDates.push(new Date(g)),w.appendChild(D),f&&(w.setAttribute("data-date",g.getTime().toString()),this.wireEvents(w)),this.renderCellTemplate({date:g,type:"workCells"},w),this.parent.trigger(v,{elementType:"workCells",element:w,date:g}),f&&"Horizontal"===this.parent.activeViewOptions.orientation&&(g=ye(new Date(g.getTime()),1)))}}this.renderDates.splice(0,1)},i.prototype.getContentRows=function(){for(var t=[],i=this.getMonths(),n=this.getGroupIndices(),r=0;r<this.parent.resourceBase.renderedResources.length;r++){var a=void 0;if(!(this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&(a=this.parent.resourceBase.renderedResources[parseInt(r.toString(),10)],n.length>0&&n.indexOf(a.groupIndex)>-1))){var s=(0,e.createElement)("tr");t.push(s);for(var o=new Date(this.parent.selectedDate.getFullYear(),i[parseInt(r.toString(),10)],1),l=this.parent.calendarUtil.getMonthStartDate(new Date(o.getTime())),p=0;p<this.columnCount;p++){var c=[],h=a.groupIndex;(c=c.concat(a.className)).indexOf(Dt)>-1?c.push(mt):c.push(at),o=new Date(this.parent.selectedDate.getFullYear(),i[parseInt(p.toString(),10)],1),l=this.parent.calendarUtil.getMonthStartDate(new Date(o.getTime()));var d=(0,e.createElement)("td",{className:$e,attrs:{"aria-selected":"false","data-date":l.getTime().toString()}});(0,e.addClass)([d],c),d.setAttribute("data-group-index",h.toString()),this.renderCellTemplate({date:l,type:"resourceGroupCells",groupIndex:h},d),this.wireEvents(d),this.parent.trigger(v,{elementType:"resourceGroupCells",element:d,date:l}),s.appendChild(d)}}}return t},i.prototype.renderResourceContent=function(t,i,n){for(var r=this.getMonths(),a=0;a<this.rowCount;a++){t.appendChild((0,e.createElement)("div",{className:Gt}));var s=(0,e.createElement)("tr");n.appendChild(s);var o=void 0;"Vertical"===this.parent.activeViewOptions.orientation&&this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&(o=this.parent.resourceBase.renderedResources[parseInt(a.toString(),10)]);var l=new Date(this.parent.selectedDate.getFullYear(),r[parseInt(a.toString(),10)],1),p=this.parent.calendarUtil.getMonthStartDate(new Date(l.getTime()));if("Horizontal"===this.parent.activeViewOptions.orientation){var c=s.cloneNode();i.appendChild(c);var h=(0,e.createElement)("td",{className:pi,attrs:{"data-date":p.getTime().toString()}});this.parent.monthHeaderTemplate?(0,e.append)(this.renderDayMonthHeaderTemplate(l,a,"monthHeaderTemplate"),h):h.innerHTML="<span>"+this.getMonthName(l)+"</span>",c.appendChild(h)}for(var d=0;d<this.columnCount;d++){var u=[],g=void 0;"Vertical"===this.parent.activeViewOptions.orientation?(g=o.groupIndex,(u=u.concat(o.className)).indexOf(Dt)>-1?u.push(mt):u.push(at),l=new Date(this.parent.selectedDate.getFullYear(),r[parseInt(d.toString(),10)],1),p=this.parent.calendarUtil.getMonthStartDate(new Date(l.getTime()))):(g=this.colLevels.slice(-1)[0][parseInt(d.toString(),10)].groupIndex,u.push(at));var m=this.parent.globalize.formatDate(p,{type:"dateTime",skeleton:"full",calendar:this.parent.getCalendarMode()}),f=this.parent.globalize.formatDate(this.parent.calendarUtil.getMonthEndDate(new Date(l.getTime())),{type:"dateTime",skeleton:"full",calendar:this.parent.getCalendarMode()}),y=(0,e.createElement)("td",{className:$e,attrs:{"aria-selected":"false","data-date":p.getTime().toString(),"aria-label":m+" "+this.parent.localeObj.getConstant("endAt")+" "+f}});(0,e.addClass)([y],u),y.setAttribute("data-group-index",g.toString()),this.renderCellTemplate({date:p,type:"resourceGroupCells",groupIndex:g},y),this.wireEvents(y),s.appendChild(y),this.parent.trigger(v,{elementType:"resourceGroupCells",element:y,date:p})}}"Vertical"===this.parent.activeViewOptions.orientation&&this.collapseRows(this.parent.element.querySelector("."+ri))},i.prototype.renderDayMonthHeaderTemplate=function(e,t,i){var n={date:e,type:"dayHeaderTemplate"===i?"dayHeader":"monthHeader"},r="schedule_"+this.parent.activeViewOptions.dayHeaderTemplateName+"dayHeaderTemplate",a="schedule_"+this.parent.activeViewOptions.dayHeaderTemplateName+"monthHeaderTemplate";return"dayHeaderTemplate"===i?(n.day=this.parent.getDayNames("wide")[t%7],[].slice.call(this.parent.getDayHeaderTemplate()(n,this.parent,"dayHeaderTemplate",r,!1,void 0,void 0,this.parent.root))):[].slice.call(this.parent.getMonthHeaderTemplate()(n,this.parent,"monthHeaderTemplate",a,!1,void 0,void 0,this.parent.root))},i.prototype.renderCellTemplate=function(t,i){if(this.parent.activeViewOptions.cellTemplate&&!i.classList.contains(st)){var n={date:t.date,type:t.type};t.groupIndex&&(n.groupIndex=t.groupIndex);var r=this.parent.element.id+"_"+this.parent.activeViewOptions.cellTemplateName+"cellTemplate",a=[].slice.call(this.parent.getCellTemplate()(n,this.parent,"cellTemplate",r,!1,void 0,void 0,this.parent.root));(0,e.append)(a,i)}},i.prototype.scrollToDate=function(e){var t;t=null!==this.parent.activeViewOptions.group.resources&&this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive?+new Date(ve(ce(e))):+new Date(ve(e));var i=this.element.querySelector('[data-date="'+t+'"]');if(i){var n=this.getScrollableElement();if(this.parent.enableRtl){var r=this.element.querySelector("."+Je);n.scrollLeft=-(r.offsetWidth-i.offsetLeft-i.offsetWidth)}else n.scrollLeft=i.offsetLeft;n.scrollTop=i.offsetTop}},i.prototype.getScrollableElement=function(){return this.parent.isAdaptive&&!this.isTimelineView()?this.element.querySelector("."+Ht):this.getContentAreaElement()},i.prototype.wireEvents=function(t){e.EventHandler.add(t,"mousedown",this.parent.workCellAction.cellMouseDown,this.parent.workCellAction),e.EventHandler.add(t,"click",this.parent.workCellAction.cellClick,this.parent.workCellAction),this.parent.isAdaptive||e.EventHandler.add(t,"dblclick",this.parent.workCellAction.cellDblClick,this.parent.workCellAction)},i}(hl),El=function(){function t(e){this.parent=e}return t.prototype.initializeCalendarExport=function(e,t){var i=this.getCalendarString(e,t);this.download(i,e)},t.prototype.getCalendarString=function(t,i){var n=this,r=i||(0,e.extend)([],this.parent.eventsData,null,!0);r=this.parent.eventBase.sortByTime(r);var a=-1!==navigator.appVersion.indexOf("Win")?"\r\n":"\n",s=[],o=[],l=this.parent.timezone||this.parent.tzModule.getLocalTimezoneName(),p=this.parent.eventFields;return r.forEach((function(t){var i=t[p.id]||t.Guid||n.parent.eventBase.generateGuid(),c=[];if(t[p.recurrenceID]){var h=n.filterEvents(o,p.id,t[p.recurrenceID]);i=h.length>0?h[0].UID:i}if(!t[p.recurrenceID]&&t[p.recurrenceRule]&&t[p.recurrenceException]){var d=t[p.recurrenceException].split(",");n.filterEvents(r,p.recurrenceID,t[p.id]).forEach((function(e){c.push(Ea(e[p.startTime]))}));var u=d.filter((function(e){return-1===c.indexOf(e)}));t[p.recurrenceException]=u.length>0?u.join(",")+",":""}var g=t[p.startTimezone]||l,v=t[p.endTimezone]||l,m=!!t[p.isReadonly]&&t[p.isReadonly],f=["BEGIN:VEVENT","LOCATION:"+(t[p.location]||""),"SUMMARY:"+(t[p.subject]||""),"UID:"+i,"DESCRIPTION:"+(t[p.description]||""),"ISREADONLY:"+m,"END:VEVENT"];if(t[p.isAllDay]?(f.splice(4,0,"DTEND;VALUE=DATE:"+n.convertDateToString(t[p.endTime],!0)),f.splice(4,0,"DTSTART;VALUE=DATE:"+n.convertDateToString(t[p.startTime],!0))):t[p.isAllDay]||t[p.recurrenceRule]?(f.splice(4,0,'DTEND;TZID="'+v+'":'+n.convertDateToString(t[p.endTime])),f.splice(4,0,'DTSTART;TZID="'+g+'":'+n.convertDateToString(t[p.startTime]))):(f.splice(4,0,"DTEND:"+n.convertDateToString(t[p.endTime])),f.splice(4,0,"DTSTART:"+n.convertDateToString(t[p.startTime]))),t[p.recurrenceRule]&&f.splice(4,0,"RRULE:"+t[p.recurrenceRule]),t[p.recurrenceException]){d=t[p.recurrenceException].split(",");for(var y=0;y<d.length-1;y++)f.splice(5,0,"EXDATE:"+n.convertDateToString(kr(d[parseInt(y.toString(),10)]),t[p.isAllDay]))}t[p.recurrenceID]&&f.splice(4,0,'RECURRENCE-ID;TZID="'+g+'":'+n.convertDateToString(t[p.startTime],t[p.isAllDay]));var T=n.customFieldFilter(t,p);T.length>0&&T.forEach((function(e){return f.splice(4,0,e+":"+(t[""+e]||""))}));var w=(0,e.extend)({},t);w.UID=i,o.push(w),s.push(f.join(a))})),["BEGIN:VCALENDAR","PRODID:-//Syncfusion Inc//Scheduler//EN","VERSION:2.0","CALSCALE:GREGORIAN","METHOD:PUBLISH","X-WR-CALNAME:"+(t||"Calendar"),"X-WR-TIMEZONE:"+l].join(a)+a+s.join(a)+a+"END:VCALENDAR"},t.prototype.customFieldFilter=function(e,t){var i=Object.keys(t).map((function(e){return t[""+e]}));return Object.keys(e).filter((function(e){return-1===i.indexOf(e)&&"Guid"!==e}))},t.prototype.convertDateToString=function(e,t){var i=("0000"+e.getFullYear().toString()).slice(-4),n=("00"+(e.getMonth()+1).toString()).slice(-2),r=("00"+e.getDate().toString()).slice(-2),a=("00"+e.getHours().toString()).slice(-2),s=("00"+e.getMinutes().toString()).slice(-2),o=("00"+e.getSeconds().toString()).slice(-2);return t?i+n+r:i+n+r+"T"+a+s+o},t.prototype.download=function(e,t){var i=new Blob([e],{type:"data:text/calendar;charset=utf8"});if(t=(t||"Calendar")+".ics",navigator.msSaveBlob)navigator.msSaveBlob(i,t);else{var n=document.createElementNS("http://www.w3.org/1999/xhtml","a");n.download=t,n.href=URL.createObjectURL(i);var r=document.createEvent("MouseEvent");r.initEvent("click",!0,!0),n.dispatchEvent(r),setTimeout((function(){URL.revokeObjectURL(n.href),n.href=void 0}))}},t.prototype.filterEvents=function(e,t,i){return e.filter((function(e){return e[""+t]===i}))},t.prototype.getModuleName=function(){return"iCalendarExport"},t.prototype.destroy=function(){!this.parent||this.parent&&this.parent.isDestroyed||(this.parent=null)},t}(),xl=function(){function t(e){this.allDay=!1,this.parent=e}return t.prototype.initializeCalendarImport=function(e){var t=this;if(e&&e instanceof Blob){var i=new FileReader;i.onload=function(){var e=i.result;t.iCalendarParser(e)},i.readAsText(e,"UTF-8")}else e&&"string"==typeof e&&this.iCalendarParser(e)},t.prototype.iCalendarParser=function(t){var i,n,r={isEvent:!1,curEvent:null,id:this.parent.eventBase.getEventMaxID(),count:0,events:[],key:null},a=t.length,s=t.search(/[^ \t]/),o=s;do{0===(o=t.indexOf("\n",s)+1)?(o=a,n=0):n=o>1&&"\r"===t[o-2]?2:1;var l=t.charAt(s);" "===l||"\n"===l||"\t"===l?i+=t.slice(s+1,o-n):(i&&(r=this.updateEventData(i,r)),i=t.slice(s,o-n)),s=o}while(o!==a);(i=i.trim()).length&&(r=this.updateEventData(i,r));var p=(0,e.extend)([],r.events,null,!0);this.parent.addEvent(this.processOccurrence(p,r.id))},t.prototype.updateEventData=function(t,i){var n=this.parent.eventFields,r=i.id,a=i.events,s=i.isEvent,o=i.count,l=i.curEvent,p=i.key;if(s||"BEGIN:VEVENT"!==t||(s=!0,l={}),s&&"END:VEVENT"===t&&(s=!1,a.push(l),l=null),s){var c=t.indexOf(":"),h=t.substring(0,c).replace(/^\s\s*/,"").replace(/\s\s*$/,""),d=t.substring(c+1,t.length).replace(/^\s\s*/,"").replace(/\s\s*$/,"");if(-1!==t.indexOf("SUMMARY")&&(h="SUMMARY"),-1!==t.indexOf("DTSTART"))l[n.startTime]=this.dateParsing(t),l[n.isAllDay]=this.allDay,this.allDay=!1;else if(-1!==t.indexOf("DTEND"))l[n.endTime]=this.dateParsing(t);else if(-1!==t.indexOf("EXDATE"))d=Ea(this.dateParsing(t)),l[n.recurrenceException]=(0,e.isNullOrUndefined)(l[n.recurrenceException])?d:l[n.recurrenceException]+","+d;else if(-1!==t.indexOf("RECURRENCE-ID"))d=Ea(this.dateParsing(t)),l[n.recurrenceException]=d,l[n.recurrenceID]=d;else switch(p=h||p){case"BEGIN":break;case"UID":l[""+h]=d,"number"==typeof r?(l[n.id]=parseInt(d,10),isNaN(l[n.id])&&(l[n.id]=r+o,o++)):l[n.id]=d;break;case"SUMMARY":l[n.subject]=this.getFormattedString(d);break;case"LOCATION":l[n.location]=this.getFormattedString(d);break;case"DESCRIPTION":l[n.description]?l[n.description]=this.getFormattedString(l[n.description]+"\r\n"+d):l[n.description]=this.getFormattedString(d);break;case"ISREADONLY":l[n.isReadonly]=d.indexOf("true")>-1;break;case"RRULE":l[n.recurrenceRule]=d;break;default:if(this.parent.resourceCollection.length>0){var u=this.parent.resourceCollection.filter((function(e){return e.field===h}));l[""+h]=u.length>0&&"number"==typeof u[0].dataSource[0][u[0].idField]?parseInt(d,10):d}else l[""+h]=d}}return{isEvent:s,curEvent:l,id:r,count:o,events:a,key:p}},t.prototype.processOccurrence=function(t,i){var n=this,r=[],a="UID",s=this.parent.eventFields,o=[];return this.parent.eventsData.forEach((function(e){o.push(e[s.id])})),t.forEach((function(l){var p,c;if(l.hasOwnProperty(s.recurrenceID)||(p=l,c=l[s.id]),o.indexOf(l[s.id])<0){var h=t.filter((function(e){return e.UID===l[""+a]}));if(h.length>1&&(0,e.isNullOrUndefined)(l[s.recurrenceID])){c="number"==typeof i?i++:c;for(var d=0;d<h.length;d++)if(h[parseInt(d.toString(),10)].hasOwnProperty(s.recurrenceID)){var u=h[parseInt(d.toString(),10)][s.recurrenceID];h[parseInt(d.toString(),10)][s.id]="number"==typeof i?i++:n.parent.eventBase.generateGuid(),h[parseInt(d.toString(),10)][s.recurrenceID]=c,h[parseInt(d.toString(),10)][s.recurrenceException]=null,p[s.recurrenceException]=n.getExcludeDateString(p[s.recurrenceException],u),delete h[parseInt(d.toString(),10)][""+a],r.push(h[parseInt(d.toString(),10)])}delete p[""+a],p[s.id]=c,r.push(p)}else l.hasOwnProperty(s.recurrenceID)||(delete l[""+a],l[s.id]="number"==typeof i?i++:c,r.push(l))}})),r},t.prototype.getExcludeDateString=function(t,i){if((0,e.isNullOrUndefined)(t))return i;if((0,e.isNullOrUndefined)(i))return t;var n=t.split(",").map((function(e){return e.split("T")[0]})),r=i.split(",").map((function(e){return e.split("T")[0]}));return n.filter((function(e){return r.indexOf(e)>-1})).length>0?t:t+","+i},t.prototype.getFormattedString=function(e){return(e=e||"").replace(/\\\,/g,",").replace(/\\\;/g,";").replace(/\\[nN]/g,"\n").replace(/\\\\/g,"\\")},t.prototype.dateParsing=function(e){var t=e.split(":"),i=t[t.length-1],n=new Date(this.getFormattedString(i));if(e&&(e.indexOf("VALUE=DATE")>-1||e.indexOf("RECURRENCE-ID;TZID")>-1)){var r=/^(\d{4})(\d{2})(\d{2})$/.exec(i);null!==r&&(n=new Date(parseInt(r[1],10),parseInt(r[2],10)-1,parseInt(r[3],10))),e.indexOf("DTSTART")>-1&&(this.allDay=!0)}var a=/^(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2})(Z)?$/.exec(i);return null!==a&&(n="Z"===a[7]?new Date(Date.UTC(parseInt(a[1],10),parseInt(a[2],10)-1,parseInt(a[3],10),parseInt(a[4],10),parseInt(a[5],10),parseInt(a[6],10))):new Date(parseInt(a[1],10),parseInt(a[2],10)-1,parseInt(a[3],10),parseInt(a[4],10),parseInt(a[5],10),parseInt(a[6],10))),n},t.prototype.getModuleName=function(){return"iCalendarImport"},t.prototype.destroy=function(){!this.parent||this.parent&&this.parent.isDestroyed},t}(),Vl=d(437),Al=function(){function t(e){this.parent=e}return t.prototype.initializeExcelExport=function(t){void 0===t&&(t={});var i,n,r=this.getExportColumns(t),a=t.fileName||"Schedule",s=t.exportType||"xlsx",o=t.includeOccurrences||!1;(0,e.isNullOrUndefined)(t.separator)||","===t.separator||(i=t.separator),n=t.customData?o?this.parent.eventBase.getProcessedEvents(t.customData):t.customData:o?this.parent.eventsProcessed:this.parent.eventsData,this.processWorkbook(r,a,s,n,i)},t.prototype.processWorkbook=function(t,i,n,r,a){var s=this,o=[],l=[],p=[];t.forEach((function(e,t){o.push({index:t+1,width:"Id"===e.name?50:150})}));var c={fontSize:12,borders:{color:"#E0E0E0"},bold:!0};t.forEach((function(e,t){p.push({index:t+1,value:e.text,style:c})})),l.push({index:1,cells:p}),r.forEach((function(i,n){var r=[];t.forEach((function(t,n){var a={index:n+1,value:i[t.name]||""};if(t.name===s.parent.eventFields.startTime||t.name===s.parent.eventFields.endTime){a=(0,e.extend)({},a,{style:{fontSize:12,numberFormat:"m/d/yyyy h:mm a"}},!0)}r.push(a)})),l.push({index:n+2,cells:r})}));var h={cancel:!1,worksheets:[{columns:o,rows:l}]};this.parent.trigger(q,h,(function(e){e.cancel||new Vl.Workbook({worksheets:e.worksheets},n,s.parent.locale,void 0,a).save(i+"."+n)}))},t.prototype.getExportColumns=function(e){var t=this,i=e.fieldsInfo||[];0===i.length&&(e.fields||Object.keys(this.parent.eventFields).map((function(e){return t.parent.eventFields[""+e]}))).forEach((function(e){i.push({name:e,text:e})}));return i},t.prototype.getModuleName=function(){return"excelExport"},t.prototype.destroy=function(){this.parent=null},t}(),Il=function(){function t(e){this.parent=e}return t.prototype.print=function(t){(0,e.isNullOrUndefined)(t)?this.printScheduler():this.printSchedulerWithModel(t)},t.prototype.printScheduler=function(){var t=this,i=this.parent.element.cloneNode(!0);i.id=this.parent.element.id+"_print";var n={cancel:!1,printElement:i};this.parent.trigger(L,n,(function(n){if(!n.cancel){document.body.appendChild(i);for(var r="MonthAgenda"===t.parent.currentView?".e-appointment-wrap":".e-content-wrap",a=t.parent.element.querySelector(r),s="",o=0,l=[].slice.call(document.getElementsByTagName("head")[0].querySelectorAll("link, style"));o<l.length;o++){s+=l[o].outerHTML}var p=(0,e.createElement)("div");i.style.width=t.parent.element.offsetWidth+"px";var c=100*Math.round(parseInt(i.style.width,10)/100);p.appendChild(i);var h=window.open("","print","height=550,width="+c+",tabbar=no");h.document.write("<!DOCTYPE html><html><head>"+s+"</head><body>"+p.innerHTML+"<script>(function() { window.ready = true; })();<\/script></body></html>"),h.document.close(),h.focus(),setTimeout((function(){if(h.ready&&a){a.scrollLeft=a.scrollLeft,a.scrollTop=a.scrollTop;var e=h.document.querySelector(".e-date-header-wrap");e&&(e.scrollLeft=a.scrollLeft);var t=h.document.querySelector(".e-time-cells-wrap");t&&(t.scrollTop=a.scrollTop);var i=h.document.querySelector(r);i&&(i.scrollLeft=a.scrollLeft,i.scrollTop=a.scrollTop),h.print(),h.close()}}),500)}}))},t.prototype.printSchedulerWithModel=function(t){var i=this,n=(0,e.createElement)("div",{id:this.parent.element.id+"_print",className:"e-print-schedule"});document.body.appendChild(n),Yo.Inject(nl,al,ol,pl,ml,yl,Dl,Sl,hl,Ol),this.printInstance=new Yo(this.getPrintScheduleModel(t)),this.printInstance.isPrinting=!0,this.printInstance.registeredTemplate=this.parent.registeredTemplate,this.printInstance.root=this.parent.root?this.parent.root:this.parent,this.printInstance.appendTo(n);var r={cancel:!1,printElement:n};this.parent.trigger(L,r,(function(e){e.cancel?i.printCleanup():(i.printInstance.on(W,i.contentReady,i),i.printWindow=window.open("","print","height="+window.outerHeight+",width="+window.outerWidth+",tabbar=no"),i.printWindow.moveTo(0,0),i.printWindow.resizeTo(screen.availWidth,screen.availHeight))}))},t.prototype.getPrintScheduleModel=function(t){for(var i,n,r,a,s={},o=["cellHeaderTemplate","dayHeaderTemplate","monthHeaderTemplate","cellTemplate","dateHeaderTemplate","dateRangeTemplate","eventTemplate","resourceHeaderTemplate","headerIndentTemplate"],l=["actionBegin","actionComplete","actionFailure","created","dataBinding","dataBound","destroyed","eventRendered","moreEventsClick","navigating","popupOpen","popupClose","renderCell"],p=0,c=["agendaDaysCount","calendarMode","cssClass","currentView","dateFormat","enableRtl","endHour","eventSettings","firstDayOfWeek","firstMonthOfYear","group","height","locale","maxDate","minDate","readonly","resources","rowAutoHeight","selectedDate","showHeaderBar","showTimeIndicator","showWeekNumber","showWeekend","startHour","timeFormat","timeScale","timezone","views","width","workDays","workHours","dateHeaderTemplate","dateRangeTemplate","cellHeaderTemplate","dayHeaderTemplate","monthHeaderTemplate","cellTemplate","resourceHeaderTemplate","headerIndentTemplate","actionBegin","actionComplete","actionFailure","created","dataBinding","dataBound","destroyed","eventRendered","moreEventsClick","navigating","popupOpen","popupClose","renderCell"];p<c.length;p++){var h=c[p];switch(h){case"eventSettings":(i=Object.assign({},this.parent.eventSettings.properties)).dataSource=this.parent.eventsData;var d=(0,e.isNullOrUndefined)(t.eventSettings)||(0,e.isNullOrUndefined)(t.eventSettings.template)?i.template:t.eventSettings.template;i.template=this.parent.isAngular||"function"!=typeof d?d:null,s.eventSettings=i;break;case"group":(n=(0,e.isNullOrUndefined)(t.group)?this.parent.group:t.group).headerTooltipTemplate=null,s.group=n;break;case"timeScale":r=(0,e.isNullOrUndefined)(t.timeScale)?this.parent.timeScale:t.timeScale,this.parent.isAngular||(r.majorSlotTemplate="function"==typeof r.majorSlotTemplate?null:r.majorSlotTemplate,r.minorSlotTemplate="function"==typeof r.minorSlotTemplate?null:r.minorSlotTemplate),s.timeScale=r;break;case"views":if(a=(0,e.isNullOrUndefined)(t.views)?this.parent.views:t.views,!this.parent.isAngular&&a&&a.length>0&&"object"==typeof a[0])for(var u=function(t){o.forEach((function(i){(0,e.isNullOrUndefined)(t[""+i])||(t[""+i]="function"==typeof t[""+i]?null:t[""+i])}))},g=0,v=a;g<v.length;g++){u(v[g])}s.views=a;break;default:if(o.indexOf(h)>-1){s[""+h]=(0,e.isNullOrUndefined)(t[""+h])?this.parent.isAngular||"function"!=typeof this.parent[""+h]?this.parent[""+h]:null:this.parent.isAngular||"function"!=typeof t[""+h]?t[""+h]:null;break}if(l.indexOf(h)>-1){s[""+h]=t[""+h];break}s[""+h]=(0,e.isNullOrUndefined)(t[""+h])?this.parent[""+h]:t[""+h]}}return s},t.prototype.contentReady=function(){var t=this;this.printWindow=(0,e.print)(this.printInstance.element,this.printWindow),this.closePrintWindow(this.printWindow,!0),this.printWindow.onbeforeunload=function(){t.printCleanup()}},t.prototype.closePrintWindow=function(t,i){var n=this;if(e.Browser.isIos)var r=setInterval((function(){t.opener?t.close():(0,e.isNullOrUndefined)(t.opener)&&(i&&n.printCleanup(),clearInterval(r))}),500)},t.prototype.printCleanup=function(){this.printInstance&&(this.printInstance.off(W,this.contentReady),this.printInstance.element.remove(),this.printInstance.destroy(),this.printInstance=null),this.printWindow&&(this.printWindow.onbeforeunload=null,this.printWindow=null)},t.prototype.getModuleName=function(){return"print"},t.prototype.destroy=function(){this.parent=null},t}()})(),u})()));
|