UNPKG

@syncfusion/ej2-schedule

Version:

Flexible scheduling library with more built-in features and enhanced customization options similar to outlook and google calendar, allowing the users to plan and manage their appointments with efficient data-binding support.

10 lines 756 kB
/*! * filename: ej2-schedule.min.js * version : 31.1.17 * Copyright Syncfusion Inc. 2001 - 2024. All rights reserved. * Use of this code is subject to the terms of our license. * A copy of the current license can be obtained at any time by e-mailing * licensing@syncfusion.com. Any infringement will be prosecuted under * applicable laws. */ !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:()=>yl,DEFAULT_WEEKS:()=>te,Day:()=>al,DragAndDrop:()=>el,ExcelExport:()=>Ml,Gregorian:()=>xr,HeaderRenderer:()=>wr,ICalendarExport:()=>Vl,ICalendarImport:()=>Al,Islamic:()=>Vr,MS_PER_DAY:()=>ie,MS_PER_MINUTE:()=>ne,Month:()=>hl,MonthAgenda:()=>wl,Print:()=>kl,RecurrenceEditor:()=>ro,Resize:()=>Ko,Schedule:()=>Go,TimelineMonth:()=>Ol,TimelineViews:()=>Sl,TimelineYear:()=>xl,Timezone:()=>Ar,ViewBase:()=>tl,WEEK_LENGTH:()=>ee,Week:()=>ol,WorkWeek:()=>pl,Year:()=>ul,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:()=>ea,findIndexInData:()=>Ae,firstDateOfMonth:()=>ce,generate:()=>Rr,generateSummary:()=>Mr,getCalendarUtil:()=>sa,getDateCount:()=>fe,getDateFromRecurrenceDateString:()=>Hr,getDateFromString:()=>Ce,getDateInMs:()=>me,getDaysCount:()=>Se,getElementHeight:()=>Le,getElementHeightFromClass:()=>re,getElementTop:()=>qe,getElementWidth:()=>Ne,getElementWidthFromClass:()=>ae,getMaxDays:()=>be,getOuterHeight:()=>Ie,getRecurrenceStringFromDate:()=>Va,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:()=>Ir,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",cn="e-quick-dialog-occurrence-event",hn="e-quick-dialog-series-event",dn="e-quick-dialog-following-events",un="e-following-events-dialog",gn="e-quick-dialog-delete",vn="e-quick-dialog-cancel",mn="e-quick-alertok",fn="e-quick-alertcancel",yn="e-quick-alertfollowing",Tn="e-quick-dialog-alert-btn",wn="e-schedule-dialog",Dn="e-schedule-form",bn="e-all-day",Sn="e-time-zone",Cn="e-repeat",On="e-subject",En="e-location",xn="e-location-details",Vn="e-start",An="e-end",In="e-description",Mn="e-description-details",kn="e-time-zone-row",Rn="e-start-time-zone",Hn="e-end-time-zone",Pn="e-save-icon",jn="e-event-cancel",Nn="e-event-save",Ln="e-title-text",qn="e-icon-disable",Fn="e-edit",Un="e-edit-icon",Bn="e-delete",Wn="e-delete-icon",zn="e-close",Yn="e-close-icon",_n="e-schedule-error",Gn="e-tooltip-hidden",Xn="e-animate",Qn="e-hidden",Kn="e-disable-dates",Zn="e-quick-popup-wrapper",Jn="e-resource-menu",$n="e-icon-menu",er="e-resource-level-title",tr="e-resource-tree-popup-overlay",ir="e-resource-tree-popup",nr="e-resource",rr="e-resource-icon",ar="e-resource-details",sr="e-date-time-icon",or="e-virtual-scroll",lr="e-icon-disable",pr="e-auto-height",cr="e-ignore-whitespace",hr="e-read-only",dr="e-month-header-wrapper",ur="e-inline-subject",gr="e-inline-appointment",vr="e-inline-edit",mr="e-scroll-hidden",fr="e-all-day-scroll",yr="e-all-day-auto",Tr=function(){return Tr=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},Tr.apply(this,arguments)},wr=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),a=this.parent.element.querySelector(".e-toolbar-pop");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")&&a&&a.classList.contains(tt)){(0,e.removeClass)([r],mr);var s=this.element.querySelector(".e-toolbar-pop");if(!(0,e.isNullOrUndefined)(s)){var o=s.ej2_instances[0];!o||!(0,e.isNullOrUndefined)(n)&&n.classList.contains("e-hor-nav")&&s.classList.contains(tt)||o.hide()}}else(0,e.addClass)([r],mr);(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],Qn):(0,e.addClass)([t],Qn))},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(Tr({},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(Tr({},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(Tr({},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(Tr({},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(Tr({},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(Tr({},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],Qn):(0,e.removeClass)([i],Qn)),n&&("add"===t?(0,e.addClass)([n],Qn):(0,e.removeClass)([n],Qn)),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}(),Dr=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}(),br=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(){var t=this;if(this.parent.activeView.setPanel(this.currentPanel.element),this.parent.setProperties({selectedDate:this.currentPanel.selectedDate},!0),this.parent.activeView.renderDates=this.currentPanel.renderDates,this.parent.activeViewOptions.group.resources.length>0&&this.parent.resourceBase.lastResourceLevel.length>0){var i=this.parent.resourceBase.resourceCollection[0].workDaysField;this.parent.resourceBase.lastResourceLevel.forEach(function(e){if(i){var n=e[i],r=Array.isArray(n)&&(!t.parent.showWeekend||"WorkWeek"===t.parent.currentView);e.renderDates=r?t.calculateResourceSpecificDates(e,i):t.currentPanel.renderDates}else e.renderDates=t.currentPanel.renderDates})}this.parent.activeView.colLevels=this.currentPanel.colLevels,(0,e.addClass)([this.element],dt);var n=this.previousPanel?this.previousPanel.element.offsetWidth:0;this.element.style.transform="translatex("+(this.parent.enableRtl?n:-this.currentPanel.element.offsetLeft)+"px)"},t.prototype.calculateResourceSpecificDates=function(e,t){var i=[],n=e[t];return this.currentPanel.renderDates.forEach(function(e){Array.isArray(n)&&-1!==n.indexOf(e.getDay())&&i.push(e)}),i},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}(),Sr=function(){return Sr=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},Sr.apply(this,arguments)},Cr=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){var t=e.target;if(!("home"===e.action&&t&&["INPUT","TEXTAREA","SELECT"].indexOf(t.tagName)>-1&&t.closest(".e-quick-popup-wrapper")))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":(e.ctrlKey||e.metaKey)&&this.processClipboardAction(!0,void 0,e);break;case"copy":case"cmdCopy":(e.ctrlKey||e.metaKey)&&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);if(l){var 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