text: this.ej=this.ej||{},this.ej.schedule=function(e,t,i,n,r,a,s,o,l,c,p){"use strict";function d(e,i){var n=0,r=t.createElement("div",{className:i}).cloneNode();return r.style.visibility="hidden",r.style.position="absolute",e.appendChild(r),n=r.getBoundingClientRect().height,t.remove(r),n}function h(e){var t=getComputedStyle(e);return window.WebKitCSSMatrix?new WebKitCSSMatrix(t.webkitTransform).m42:0}function u(e,t){var i=new Date(e.getTime());return t=(t-i.getDay()-7)%7,new Date(i.setDate(i.getDate()+t))}function v(e,t){var i=u(e,t),n=new Date(i.getFullYear(),i.getMonth(),i.getDate()+6);return new Date(n.getTime())}function m(e){return new Date(e.getFullYear(),e.getMonth())}function g(e){return new Date(e.getFullYear(),e.getMonth()+1,0)}function f(e){var t=new Date(e.getFullYear(),0,1).valueOf(),i=(new Date(e.getFullYear(),e.getMonth(),e.getDate()).valueOf()-t+Ne)/Ne;return Math.ceil(i/7)}function y(e,t){var i=e.getTimezoneOffset(),n=new Date(e.getTime()+t),r=n.getTimezoneOffset()-i;return e.setTime(n.getTime()+r*Fe),e}function T(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function w(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 D(e,t){return Math.ceil((t.getTime()-e.getTime())/Ne)}function b(e,t){return e=new Date(""+e),new Date(e.setDate(e.getDate()+t))}function C(e,t){var i=(e=new Date(""+e)).getDate();return e.setDate(1),e.setMonth(e.getMonth()+t),e.setDate(Math.min(i,S(e))),e}function E(e,t){var i=(e=new Date(""+e)).getDate();return e.setDate(1),e.setFullYear(e.getFullYear()+t),e.setDate(Math.min(i,S(e))),e}function O(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=b(r,1):(r.setHours(i.getHours()),r.setMinutes(i.getMinutes()),r.setSeconds(i.getSeconds())),{startHour:n,endHour:r}}function S(e){return new Date(e.getFullYear(),e.getMonth()+1,0).getDate()}function x(e,t){var i=T(new Date(e)),n=T(new Date(t));return Math.round((n.getTime()-i.getTime())/Ne)}function k(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,"/"))}function A(){if(null!==Ue)return Ue;var e=t.createElement("div"),i=0;e.style.cssText="width:100px;height: 100px;overflow: scroll;position: absolute;top: -9999px;",document.body.appendChild(e);var n=devicePixelRatio?"1.10"===devicePixelRatio.toFixed(2)||devicePixelRatio<=1?Math.ceil(devicePixelRatio%1):Math.floor(devicePixelRatio%1):0;return i=e.offsetWidth-e.clientWidth-n|0,document.body.removeChild(e),Ue=i}function V(e,t,i,n,r){for(var a=0,s=e.length;a<s;a++)if(e[a][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[a][r.slice(-1)[0].groupIDField]))return a}return-1}function M(e){var t=getComputedStyle(e);return e.offsetHeight+(parseInt(t.marginTop,10)||0)+(parseInt(t.marginBottom,10)||0)}function R(e){for(var t=0,i=[].slice.call(e.children);t<i.length;t++){var n=i[t];n.classList.contains("blazor-template")||e.removeChild(n)}}function P(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 H(e){return t.isBlazor()?new Date(+e-6e4*e.getTimezoneOffset()):e}function j(e,i){if(t.isBlazor()){var n=t.extend({},e,null,!0);return n[i.startTime]=new Date(+e[i.startTime]-6e4*n[i.startTime].getTimezoneOffset()),n[i.endTime]=new Date(+e[i.endTime]-6e4*n[i.endTime].getTimezoneOffset()),n}return e}function I(e,i){switch(i){case"multiple":e=e.split(" ").map(function(e){return e.charAt(0).toLocaleUpperCase()+e.substring(1)}).join(" ");break;case"single":if(e[0]>="0"&&e[0]<="9"){var n=e.match(/[a-zA-Z]/);e=t.isNullOrUndefined(n)?e:e.slice(0,n.index)+e[n.index].toLocaleUpperCase()+e.slice(n.index+1)}e=e[0].toLocaleUpperCase()+e.slice(1)}return e}function q(e,i,n,r){void 0===r&&(r="Gregorian");var a,s,o=fe(e),l=i.getConstant(mt)+" ",c=r.toLowerCase();if("en"===n||"en-US"===n){var p=t.isBlazor()?"months.abbreviated":"months.stand-alone.abbreviated",d=t.isBlazor()?"days.abbreviated":"days.stand-alone.abbreviated";s=t.getValue(p,t.getDefaultDateObject(c)),a=t.getValue(d,t.getDefaultDateObject(c))}else{var p=t.isBlazor()?n+".dates.months.abbreviated":"main."+n+".dates.calendars."+c+".months.stand-alone.abbreviated",d=t.isBlazor()?n+".dates.days.abbreviated":"main."+n+".dates.calendars."+c+".days.stand-alone.abbreviated";s=t.getValue(p,t.cldrData),a=t.getValue(d,t.cldrData)}switch(o.interval>1&&(l+=o.interval+" "),o.freq){case"DAILY":l+=i.getConstant(ft);break;case"WEEKLY":l+=i.getConstant(yt)+" "+i.getConstant(vt)+" ",o.day.forEach(function(e,i){l+=I(t.getValue(Dt[e],a),"single"),l+=o.day.length-1===i?"":", "});break;case"MONTHLY":l+=i.getConstant(Tt)+" "+i.getConstant(vt)+" ",l+=L(o,a,i);break;case"YEARLY":l+=i.getConstant(wt)+" "+i.getConstant(vt)+" ",l+=I(t.getValue(o.month[0].toString(),s),"single")+" ",l+=L(o,a,i)}if(o.count)l+=", "+o.count+" "+i.getConstant(ut);else if(o.until){var h=o.until;l+=", "+i.getConstant(gt)+" "+h.getDate()+" "+I(t.getValue((h.getMonth()+1).toString(),s),"single")+" "+h.getFullYear()}return l}function L(e,i,n){var r="";if(e.monthDay.length)r+=e.monthDay[0];else if(e.day){var a=e.setPosition-1;r+=n.getConstant(ht[a>-1?a:ht.length-1])+" "+I(t.getValue(Dt[e.day[0]],i),"single")}return r}function B(e,i,n,r,a,s,o,l,c){void 0===a&&(a=dt),void 0===s&&(s=null),void 0===o&&(o="Gregorian"),void 0===l&&(l=null),void 0===c&&(c=null);var p,d=fe(i);Pe=xe(o);var h=[],u=new Date(e.getTime());Ve=[];var v=t.isNullOrUndefined(n)?[]:n.split(","),m=new st;if(v.forEach(function(e){var t=N(e);l&&c&&(t=m.convert(new Date(t.getTime()),l,c)),Ve.push(new Date(t.getTime()).setHours(0,0,0,0))}),d.recExceptionCount=t.isNullOrUndefined(d.count)?0:Ve.length,Re=s&&s>e&&!d.count?new Date(new Date(s.getTime()).setHours(0,0,0)):null,!d.until&&Re&&((p=new Date(Re.getTime())).setDate(Re.getDate()+a*d.interval),d.until=p),d.until&&e>d.until)return h;switch(Me=a,Oe(pt[r]),d.freq){case"DAILY":W(u,d.until,h,d);break;case"WEEKLY":z(u,d.until,h,d);break;case"MONTHLY":_(u,d.until,h,d);break;case"YEARLY":Y(u,d.until,h,d)}return h}function N(e){return new Date(e.substr(0,4)+"-"+e.substr(4,2)+"-"+e.substr(6,5)+":"+e.substr(11,2)+":"+e.substr(13))}function F(e,t){var i=new Date(t).setHours(0,0,0,0);-1===Ve.indexOf(i)&&(!Re||i>=Re.getTime())&&e.push(t)}function U(e,t){var i=Me;return t.count?i=t.count:t.until&&("DAILY"===t.freq||"WEEKLY"===t.freq?i=Math.floor((t.until.getTime()-e.getTime())/Ne)+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())/Ne)+1:1),"YEARLY"===t.freq&&(i=t.month.length>1?i*t.month.length:i))),i}function W(e,t,i,n){for(var r=new Date(e.getTime()),a=n.interval,s=U(e,n),o=n.day;ue(r,t)&&(!0,!(Se(r,n)&&(o.indexOf(pt[r.getDay()])>-1||0===o.length)&&(F(i,r.getTime()),s&&i.length+n.recExceptionCount>=s)));)r.setDate(r.getDate()+a)}function z(e,i,n,r){var a=new Date(e.getTime());r.day.length||r.day.push(pt[e.getDay()]);var s,o=r.interval,l=r.day,c=U(e,r),p=!0,d=[];if(l.length>1)for((t.isNullOrUndefined(r.wkst)||""===r.wkst)&&(r.wkst=ct[0]),s=pt.indexOf(r.wkst);ue(a,i);){var h=pt.indexOf(pt[a.getDay()])-s,u=b(b(a,-(h=-1===h?6:h)),6),v=new Date(a.getTime());for(T(u),T(v);u>=v&&(l.indexOf(pt[a.getDay()])>-1&&d.push([a.getTime()]),!(c&&n.length+r.recExceptionCount>=c));)a.setDate(a.getDate()+1),T(v=new Date(a.getTime()));if(a.setDate(a.getDate()-1),c&&n.length+r.recExceptionCount>=c)break;a.setDate(a.getDate()+1+7*(o-1)),se(d,p,e,i,n,r),d=[]}else{for(a=ge(e,r.day);ue(a,i)&&((p=Se(a,r))&&l.indexOf(pt[a.getDay()])>-1&&F(n,a.getTime()),!(c&&n.length+r.recExceptionCount>=c));)a.setDate(a.getDate()+7*o);se(d,p,e,i,n,r),d=[]}}function _(e,t,i,n){switch(n.month.length||n.day.length||n.monthDay.length?n.month.length>0&&!n.day.length&&!n.monthDay.length&&n.monthDay.push(e.getDate()):(n.monthDay.push(e.getDate()),"YEARLY"===n.freq&&n.month.push(e.getMonth()+1)),Ce(n)){case"day":switch(n.freq){case"MONTHLY":ie(e,t,i,n);break;case"YEARLY":ne(e,t,i,n)}break;case"both":case"date":switch(n.freq){case"MONTHLY":J(e,t,i,n);break;case"YEARLY":Z(e,t,i,n)}}}function Y(e,t,i,n){switch(X(n)){case"MONTH":_(e,t,i,n);break;case"WEEKNO":G(e,t,i,n);break;case"YEARDAY":Q(e,t,i,n)}}function G(e,i,n,r){for(var a,s,o,l,c,p=Pe.getYearLastDate(e,0),d=U(e,r),h=r.weekNo,u=[],v=r.day;ue(p,i);){s=6-ct.indexOf(pt[p.getDay()])+1;for(var m=0;m<h.length;m++)for(l=1===(o=(o=h[m])>0?o:53+o+1)?s:s+7*(o-1),c=1===o?s-7:s+7*(o-2);c<l;)a=new Date(p.getTime()+Ne*c),(0===v.length||v.indexOf(pt[a.getDay()])>-1)&&(t.isNullOrUndefined(r.setPosition)?pe(void 0,e,i,n,r,a.getTime()):u.push([a.getTime()])),c++;if(t.isNullOrUndefined(r.setPosition)||he(u,void 0,e,i,n,r),d&&n.length+r.recExceptionCount>=d)return;p=Pe.getYearLastDate(a,r.interval),u=[]}}function Q(e,i,n,r){for(var a,s,o=Pe.getYearLastDate(e,0),l=U(e,r),c=[],p=r.day;ue(o,i);){for(var d=0;d<r.yearDay.length;d++)s=r.yearDay[d],a=new Date(o.getTime()),s!==Pe.getLeapYearDaysCount()&&s!==-Pe.getLeapYearDaysCount()||Pe.isLeapYear(Pe.getFullYear(a),1)?(a.setDate(a.getDate()+(s<0?Pe.getYearDaysCount(a,1)+1+s:s)),(0===p.length||p.indexOf(pt[a.getDay()])>-1)&&(null==r.setPosition?pe(void 0,e,i,n,r,a.getTime()):c.push([a.getTime()]))):a.setDate(a.getDate()+1);if(t.isNullOrUndefined(r.setPosition)||he(c,void 0,e,i,n,r),l&&n.length+r.recExceptionCount>=l)return;o=Pe.getYearLastDate(a,r.interval),c=[]}}function X(e){return e.yearDay.length?"YEARDAY":e.weekNo.length?"WEEKNO":"MONTH"}function K(e,t){var i={monthCollection:[],index:0,tempDate:new Date(e.getTime()),mainDate:new Date(e.getTime()),expectedCount:U(e,t),monthInit:0,dateCollection:[]};return t.month.length&&Pe.setMonth(i.tempDate,t.month[0],i.tempDate.getDate()),i}function Z(e,t,i,n){if(n.month.length)return void J(e,t,i,n);var r,a=K(e,n);for(a.tempDate=a.mainDate=Pe.getMonthStartDate(a.tempDate);ue(a.tempDate,t);){for(r=new Date(a.tempDate.getTime());Pe.isSameYear(r,a.tempDate)&&a.expectedCount&&i.length+n.recExceptionCount<=a.expectedCount;){if(!(0===n.month.length||n.month.length>0&&!Pe.checkMonth(a.tempDate,n.month))){Pe.setValidDate(a.tempDate,1,1),a.tempDate=ge(a.tempDate,n.day);break}$(n,a,t,!1),a.beginDate=new Date(a.tempDate.getTime()),a.monthInit=ee(a.tempDate,n,a.monthInit,a.beginDate)}if(a.tempDate.setFullYear(r.getFullYear(),r.getMonth(),r.getDate()),se(a.dateCollection,a.state,e,t,i,n),Pe.isLastMonth(a.tempDate)&&(Pe.setValidDate(a.tempDate,1,1),a.tempDate=ge(a.tempDate,n.day)),a.expectedCount&&i.length+n.recExceptionCount>=a.expectedCount)return;a.tempDate.setFullYear(a.tempDate.getFullYear()+n.interval-1),a.tempDate=ge(a.tempDate,n.day),a.monthInit=ee(a.tempDate,n,a.monthInit,a.beginDate),a.dateCollection=[]}}function J(e,i,n,r){var a=K(e,r);if(a.tempDate=a.mainDate=Pe.getMonthStartDate(a.tempDate),!(("MONTHLY"===r.freq&&12===r.interval||"YEARLY"===r.freq)&&Pe.getMonthDaysCount(e)<r.monthDay[0]))for(;ue(a.tempDate,i);){if(a.beginDate=new Date(a.tempDate.getTime()),$(r,a,i,!0,e,n),t.isNullOrUndefined(r.setPosition)||he(a.dateCollection,a.state,e,i,n,r),a.expectedCount&&n.length+r.recExceptionCount>=a.expectedCount)return;a.monthInit=ee(a.tempDate,r,a.monthInit,a.beginDate),a.dateCollection=[]}}function $(e,i,n,r,a,s){for(var o=0;o<e.monthDay.length;o++){i.date=e.monthDay[o],i.tempDate=Pe.getMonthStartDate(i.tempDate);var l=Pe.getMonthDaysCount(i.tempDate);if(i.date=i.date>0?i.date:l+i.date+1,ye(i.tempDate,i.date,i.mainDate)&&i.date>0){if(Pe.setDate(i.tempDate,i.date),n&&i.tempDate>n)return;(0===e.day.length||e.day.indexOf(pt[i.tempDate.getDay()])>-1)&&(r&&t.isNullOrUndefined(e.setPosition)&&i.expectedCount&&s.length+e.recExceptionCount<i.expectedCount?pe(i.state,a,n,s,e,i.tempDate.getTime()):i.dateCollection.push([i.tempDate.getTime()]))}}}function ee(e,i,n,r,a){void 0===r&&(r=null);var s=r?r.getMonth():0,o=Pe.getMonthStartDate(e);return a=t.isNullOrUndefined(a)?i.interval:a,e.setFullYear(o.getFullYear()),e.setMonth(o.getMonth()),e.setDate(o.getDate()),i.month.length?(n++,n%=i.month.length,Pe.setMonth(e,i.month[n],1),0===n&&Pe.addYears(e,a,i.month[0])):(r&&r.getFullYear()<e.getFullYear()&&(s=e.getMonth()-1),Pe.setValidDate(e,a,1,s,r)),n}function te(e,i,n,r){var a=r.day,s=new Date(e.getTime());s=Pe.getMonthStartDate(s);var o,l,c=[],p=[],d=[],h=U(e,r),u=0;for(r.month.length&&Pe.setMonth(s,r.month[0],1),s=ge(s,r.day);ue(s,i)&&h&&n.length+r.recExceptionCount<h;){var v=new Date(s.getTime());if(a.map(function(e){return bt.test(e)}).indexOf(!0)>-1){for(var m=0;m<=a.length-1;m++){var g=a[m].match(Et),f=parseInt(g[0],10);for(s=new Date(s.getTime()),s=ge(s=Pe.getMonthStartDate(s),a),v.setFullYear(s.getFullYear(),s.getMonth(),s.getDate());Pe.isSameYear(v,s)&&Pe.isSameMonth(v,s);)g[g.length-1]===pt[v.getDay()]&&c.push([v.getTime()]),v.setDate(v.getDate()+1);if(v.setDate(v.getDate()-1),o=g[0].indexOf("-")>-1?c.length- -1*f:f-1,o=isNaN(o)?0:o,c.length>0&&(t.isNullOrUndefined(r.setPosition)?he(c,void 0,e,i,n,r,o):p=[ce(c,o,d)]),h&&n.length+r.recExceptionCount>=h)return;c=[]}t.isNullOrUndefined(r.setPosition)||(de(p,void 0,e,i,n,r),d=[]),u=ee(s,r,u,l),s=ge(s,r.day),c=[]}else{var y=[],T=Te(a);v.setFullYear(s.getFullYear(),s.getMonth(),s.getDate());var w=new Date(s.getTime());for(l=new Date(s.getTime());Pe.isSameMonth(w,s);)y.push(s.getTime()),a.indexOf(pt[s.getDay()])>-1&&(c.push(y),y=[]),s.setDate(s.getDate()+T[pt[s.getDay()]]);if(o=r.setPosition<1?c.length+r.setPosition:r.setPosition-1,t.isNullOrUndefined(r.setPosition)){o=0;for(var D=[],b=0;b<c.length;b++)for(var C=0;C<c[b].length;C++)D.push(c[b][C]);c=[D]}if(c.length>0&&he(c,void 0,e,i,n,r,o),h&&n.length+r.recExceptionCount>=h)return;u=ee(s,r,u,l),s=ge(s,r.day),c=[]}}}function ie(e,t,i,n){if(n.day.length>1)return void te(e,t,i,n);var r,a=new Date(e.getTime()),s=U(e,n),o=[],l=0;for(a=Pe.getMonthStartDate(a),n.month.length&&Pe.setMonth(a,n.month[0],1),a=ge(a,n.day);ue(a,t)&&s&&i.length+n.recExceptionCount<s;){r=new Date(a.getTime());for(var c=new Date(a.getTime());Pe.isSameMonth(a,c);)o.push([c.getTime()]),c.setDate(c.getDate()+7);le(o,e,t,i,n),l=ee(a,n,l,r),a=ge(a,n.day),o=[]}}function ne(e,i,n,r){var a=r.day,s=a.map(function(e){return bt.test(e)});if(a.length>1&&s.indexOf(!0)>-1)return void re(e,i,n,r);if(r.month.length&&1===a.length&&s.indexOf(!0)>-1)return void ie(e,i,n,r);var o,l=new Date(e.getTime()),c=U(e,r),p=r.interval,d=[];for(r.month.length&&Pe.setMonth(l,r.month[0],l.getDate()),t.isNullOrUndefined(r.setPosition)&&0===r.month.length&&0===r.weekNo.length&&l.setFullYear(e.getFullYear(),0,1),l=ge(l=Pe.getMonthStartDate(l),r.day);ue(l,i);){for(o=new Date(l.getTime());Pe.isSameYear(o,l)&&c&&n.length+r.recExceptionCount<=c;)for(o=new Date(l.getTime());Pe.isSameYear(o,l);){if(!(0===r.month.length||r.month.length>0&&!Pe.checkMonth(l,r.month))){Pe.setValidDate(l,1,1),l=ge(l,r.day);break}if(a.length>1){if(Pe.compareMonth(o,l)){Pe.setValidDate(l,1,1),l=ge(l,r.day);break}a.indexOf(pt[o.getDay()])>-1&&d.push([o.getTime()]),o.setDate(o.getDate()+1)}else{if(o.getFullYear()>l.getFullYear()){Pe.setValidDate(l,1,1),l=ge(l,r.day);break}var h=ve(a[0]);pt[o.getDay()]===h&&new Date(o.getFullYear(),o.getMonth(),0)>new Date(e.getFullYear())&&d.push([o.getTime()]),o.setDate(o.getDate()+7)}}if(l.setFullYear(o.getFullYear(),o.getMonth(),o.getDate()),le(d,e,i,n,r),Pe.isLastMonth(l)&&(Pe.setValidDate(l,1,1),l=ge(l,r.day)),l.setFullYear(l.getFullYear()+p-1),c&&n.length+r.recExceptionCount>=c)return;l=ge(l,r.day),d=[]}}function re(e,i,n,r){var a,s,o,l=r.day,c=U(e,r),p=new Date(e.getTime()),d=r.interval,h=[],u=[],v=0;p=Pe.getMonthStartDate(p);var m=[];for(r.month.length&&Pe.setMonth(p,r.month[0],1),p=ge(p,r.day);ue(p,i);){s=new Date(p.getTime());for(var g=0;g<=r.month.length;g++)for(var f=0;f<=l.length-1;f++){for(p=ge(p=Pe.getMonthStartDate(p),r.day),h=[];Pe.isSameYear(s,p)&&c&&n.length+r.recExceptionCount<=c;)for(;Pe.isSameYear(s,p);){if(s=new Date(p.getTime()),0===r.month.length||r.month.length>0&&r.month[g]===Pe.getMonth(s)){var y=l[f].match(Et),T=parseInt(y[0],10);for(o=new Date(p.getTime());Pe.isSameYear(o,p)&&Pe.isSameMonth(o,p);)y[y.length-1]===pt[o.getDay()]&&h.push([o.getTime()]),o.setDate(o.getDate()+1);o.setDate(o.getDate()-1),a=y[0].indexOf("-")>-1?h.length- -1*T:T-1,a=isNaN(a)?0:a}v=ee(p,r,v,void 0,1),p=ge(p,r.day)}if(p=0===f&&o?new Date(o.getTime()):new Date(s.getTime()),h.length>0&&(t.isNullOrUndefined(r.setPosition)?he(h,void 0,e,i,n,r,a):u=[ce(h,a,m)]),c&&n.length+r.recExceptionCount>=c)return}t.isNullOrUndefined(r.setPosition)||(de(u,void 0,e,i,n,r),m=[]),Pe.isLastMonth(p)?(Pe.setValidDate(p,1,1),p.setFullYear(p.getFullYear()+d-1)):p.setFullYear(p.getFullYear()+d),p=ge(p,r.day),r.month.length&&Pe.setMonth(p,r.month[0],p.getDate())}}function ae(e,t){var i,n={monthCollection:[],index:0};if(1===t.length){var r=t[0].match(Et),a=void 0;r.length>1?i=(a=parseInt(r[0],10))<1?e.length+a:a-1:(i=0,e=oe(e))}else i=0,e=oe(e);return n.monthCollection=e,n.index=i,n}function se(e,i,n,r,a,s){var o=s.setPosition<1?e.length+s.setPosition:s.setPosition-1;t.isNullOrUndefined(s.setPosition)&&(o=0,e=oe(e)),e.length>0&&he(e,i,n,r,a,s,o)}function oe(e){for(var t=[],i=0;i<e.length;i++)for(var n=0;n<e[i].length;n++)t.push(new Date(e[i][n]).getTime());return e=t.length>0?[t]:[]}function le(e,t,i,n,r){var a,s,o=[];e=(s=ae(e,r.day)).monthCollection,a=s.index,null!=r.setPosition?de([ce(e,a,o)],void 0,t,i,n,r):e.length>0&&he(e,void 0,t,i,n,r,a),o=[]}function ce(e,t,i){for(var n=0;n<e[t].length;n++)i.push(e[t][n]);return i}function pe(e,t,i,n,r,a){var s=U(t,r),o=new Date(a);e=Se(o,r),o>=t&&ue(o,i)&&e&&s&&n.length+r.recExceptionCount<s&&F(n,a)}function de(e,t,i,n,r,a){if(e.length>0)for(var s=0;s<e.length;s++){e[s].sort();var o=a.setPosition<1?e[s].length+a.setPosition:a.setPosition-1;pe(t,i,n,r,a,e[s][o])}}function he(e,i,n,r,a,s,o){if(e.length>0){e[o=t.isNullOrUndefined(o)?s.setPosition<1?e.length+s.setPosition:s.setPosition-1:o].sort();for(var l=0;l<e[o].length;l++)pe(i,n,r,a,s,e[o][l])}}function ue(e,t){return!t||e<=t}function ve(e){return e.replace(Ct,"")}function me(e,t){var i=[];return t.forEach(function(e){var t=e.match(Et);2===t.length?i.push(t[1]):i.push(t[0])}),-1===i.indexOf(pt[e])}function ge(e,t){var i,n=new Date(e.getTime());if(t.length>0){for(var r=[],a=0;a<=t.length-1;a++)i=ve(t[a]),r.push(i);if(-1===r.indexOf(pt[n.getDay()]))do{n.setDate(n.getDate()+1)}while(-1===r.indexOf(pt[n.getDay()]))}return n}function fe(e){var t,i={freq:null,interval:1,count:null,until:null,day:[],wkst:null,month:[],weekNo:[],monthDay:[],yearDay:[],setPosition:null,validRules:[]},n=[];if(e.split(";").forEach(function(e){switch((n=e.split("="))[0]){case"UNTIL":t=n[1],i.until=N(t);break;case"BYDAY":i.day=n[1].split(","),i.validRules.push(n[0]);break;case"BYMONTHDAY":i.monthDay=n[1].split(",").map(Number),i.validRules.push(n[0]);break;case"BYMONTH":i.month=n[1].split(",").map(Number),i.validRules.push(n[0]);break;case"BYYEARDAY":i.yearDay=n[1].split(",").map(Number),i.validRules.push(n[0]);break;case"BYWEEKNO":i.weekNo=n[1].split(",").map(Number),i.validRules.push(n[0]);break;case"INTERVAL":i.interval=parseInt(n[1],10);break;case"COUNT":i.count=parseInt(n[1],10);break;case"BYSETPOS":i.setPosition=parseInt(n[1],10)>4?-1:parseInt(n[1],10);break;case"FREQ":i.freq=n[1];break;case"WKST":i.wkst=n[1]}}),"MONTHLY"===i.freq&&0===i.monthDay.length){var r=i.validRules.indexOf("BYDAY");i.validRules.splice(r,1)}return i}function ye(e,t,i){return t<=Pe.getMonthDaysCount(e)&&e>=i}function Te(e){var t={};return e.forEach(function(i,n){if(n===e.length-1){for(var r=ct.indexOf(i),a=r;a%7!==ct.indexOf(e[0]);)a++;t[i]=a-r}else t[i]=ct.indexOf(e[n+1])-ct.indexOf(i)}),t}function we(e,t){var i,n=t.slice(0),r=Pe.getMonthDaysCount(e);for(i=n.shift();i;){if(i<0&&(i=i+r+1),i===e.getDate())return!1;i=n.shift()}return!0}function De(e,t){var i,n=t.slice(0),r=be(e);for(i=n.shift();i;){if(i<0&&(i=i+Pe.getYearDaysCount(e,0)+1),i===r)return!1;i=n.shift()}return!0}function be(e){lt[Pe.getFullYear(e)]||(lt[Pe.getFullYear(e)]=Pe.getYearLastDate(e,0));var t=lt[Pe.getFullYear(e)],i=e.getTime()-t.getTime();return Math.ceil(i/Ne)}function Ce(e){return e.monthDay.length&&!e.day.length?"date":!e.monthDay.length&&e.day.length?"day":"both"}function Ee(e){var t=e.shift();e.push(t)}function Oe(e){for(;ct[0]!==e;)Ee(ct)}function Se(e,t){var i=!0,n=t.day,r=t.month,a=Pe.getExpectedDays(e,t.monthDay),s=t.yearDay;return t.validRules.forEach(function(t){switch(t){case"BYDAY":me(e.getDay(),n)&&(i=!1);break;case"BYMONTH":Pe.checkMonth(e,r)&&(i=!1);break;case"BYMONTHDAY":we(e,a)&&(i=!1);break;case"BYYEARDAY":De(e,s)&&(i=!1)}}),i}function xe(e){return"Islamic"===e?new at:new rt}function ke(e){return[e.getUTCFullYear(),Ae(e.getUTCMonth()+1),Ae(e.getUTCDate()),"T",Ae(e.getUTCHours()),Ae(e.getUTCMinutes()),Ae(e.getUTCSeconds()),"Z"].join("")}function Ae(e){return("0"+e).slice(-2)}var Ve,Me,Re,Pe,He="actionBegin",je="renderCell",Ie="inlineClick",qe="data-ready",Le="content-ready",Be="scroll-ui-update",Ne=864e5,Fe=6e4,Ue=null,We="e-schedule",ze="e-icons",_e="e-table-container",Ye="e-content-table",Ge="e-popup-open",Qe="e-schedule-resource-toolbar-container",Xe="e-appointment-container",Ke="e-text-ellipsis",Ze="e-schedule-form",Je="e-schedule-event-tooltip",$e=function(){function e(e){this.parent=e,this.l10n=this.parent.localeObj,this.renderHeader(),this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.on("document-click",this.closeHeaderPopup,this)},e.prototype.removeEventListener=function(){this.parent.off("document-click",this.closeHeaderPopup)},e.prototype.closeHeaderPopup=function(e){var i=t.closest(e.event.target,".e-date-range,.e-header-popup,.e-day,.e-selected");t.isNullOrUndefined(i)&&this.hideHeaderPopup()},e.prototype.hideHeaderPopup=function(){this.headerPopup&&this.headerPopup.hide()},e.prototype.renderHeader=function(){this.element=t.createElement("div",{className:"e-schedule-toolbar-container"});var e=t.createElement("div",{className:"e-schedule-toolbar"});this.element.appendChild(e),this.parent.element.insertBefore(this.element,this.parent.element.firstElementChild),this.renderToolbar()},e.prototype.renderToolbar=function(){var e={requestType:"toolbarItemRendering",items:this.getItems()};t.isBlazor()||this.parent.trigger(He,e),this.toolbarObj=new n.Toolbar({items:e.items,overflowMode:"Popup",clicked:this.toolbarClickHandler.bind(this),enableRtl:this.parent.enableRtl,locale:this.parent.locale}),this.toolbarObj.isStringTemplate=!0,this.toolbarObj.appendTo(this.parent.element.querySelector(".e-schedule-toolbar"));var i=this.toolbarObj.element.querySelector(".e-prev");i&&i.firstElementChild.setAttribute("title",this.l10n.getConstant("previous"));var r=this.toolbarObj.element.querySelector(".e-next");r&&r.firstElementChild.setAttribute("title",this.l10n.getConstant("next")),this.updateActiveView(),t.isBlazor()||this.parent.trigger("actionComplete",{requestType:"toolBarItemRendered",items:this.toolbarObj.items})},e.prototype.updateItems=function(){if(this.toolbarObj){var e={requestType:"toolbarItemRendering",items:this.getItems()};t.isBlazor()||this.parent.trigger(He,e),this.toolbarObj.items=e.items,this.toolbarObj.dataBind(),t.isBlazor()||this.parent.trigger("actionComplete",{requestType:"toolBarItemRendered",items:this.toolbarObj.items})}},e.prototype.getPopUpRelativeElement=function(){return this.parent.isAdaptive?this.toolbarObj.element:this.element.querySelector(".e-date-range")},e.prototype.setDayOfWeek=function(e){this.headerCalendar&&(this.headerCalendar.firstDayOfWeek=e,this.headerCalendar.dataBind())},e.prototype.setCalendarDate=function(e){this.headerCalendar&&(this.headerCalendar.value=e,this.headerCalendar.dataBind())},e.prototype.setCalendarMinMaxDate=function(){this.headerCalendar&&(this.headerCalendar.min=this.parent.minDate,this.headerCalendar.max=this.parent.maxDate,this.headerCalendar.dataBind())},e.prototype.getCalendarView=function(){return["Month","MonthAgenda","TimelineMonth"].indexOf(this.parent.currentView)>-1?"Year":["Year","TimelineYear"].indexOf(this.parent.currentView)>-1?"Decade":"Month"},e.prototype.setCalendarView=function(){if(this.headerCalendar){var e=this.getCalendarView();this.headerCalendar.depth=e,this.headerCalendar.start=e,this.headerCalendar.refresh()}},e.prototype.updateActiveView=function(){var e=[].slice.call(this.toolbarObj.element.querySelectorAll(".e-views"));t.removeClass(e,["e-active-view"]),e.length>0&&e[this.parent.viewIndex]&&t.addClass([e[this.parent.viewIndex]],["e-active-view"])},e.prototype.updateDateRange=function(e){var t=this.toolbarObj.element.querySelector(".e-date-range");t&&(t.setAttribute("aria-label",e),t.querySelector(".e-tbar-btn-text").innerHTML=e,this.toolbarObj.refreshOverflow())},e.prototype.getDateRangeText=function(){return I(this.parent.globalize.formatDate(this.parent.selectedDate,{format:"MMMM y",calendar:this.parent.getCalendarMode()}),"single")},e.prototype.getItems=function(){var e=[],t=this.parent.isAdaptive;if(e.push({align:"Left",prefixIcon:"e-icon-prev",tooltipText:"Previous",overflow:"Show",cssClass:"e-prev",htmlAttributes:{"aria-label":"previous period",role:"navigation"}}),e.push({align:"Left",prefixIcon:"e-icon-next",tooltipText:"Next",overflow:"Show",cssClass:"e-next",htmlAttributes:{"aria-label":"next period",role:"navigation"}}),e.push({align:"Left",text:this.getDateRangeText(),suffixIcon:"e-icon-down-arrow",cssClass:"e-date-range",overflow:"Show",htmlAttributes:{"aria-atomic":"true","aria-live":"assertive","aria-label":"title",role:"navigation"}}),this.parent.isAdaptive?(e.push({align:"Right",showAlwaysInPopup:t,prefixIcon:"e-icon-add",text:this.l10n.getConstant("newEvent"),cssClass:"e-add",overflow:"Show"}),e.push({align:"Right",showAlwaysInPopup:t,prefixIcon:"e-icon-today",text:this.l10n.getConstant("today"),cssClass:"e-today",overflow:"Show"})):(e.push({align:"Right",showAlwaysInPopup:t,prefixIcon:"e-icon-day",text:this.l10n.getConstant("today"),cssClass:"e-today",overflow:"Show"}),this.parent.views.length>1&&e.push({align:"Right",type:"Separator",cssClass:"e-schedule-seperator"})),this.parent.views.length>1)for(var i=0,n=this.parent.views;i<n.length;i++){var r=n[i];e.push(this.getItemObject(r))}return e},e.prototype.getItemObject=function(e){var t,i;"string"==typeof e?(t=e.toLowerCase(),i=null):(t=e.option.toLowerCase(),i=e.displayName);var n,r=this.parent.isAdaptive;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:this.l10n.getConstant("agenda"),cssClass:"e-views e-agenda"};break;case"monthagenda":n={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-month-agenda",text: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},e.prototype.renderHeaderPopup=function(){var e=t.createElement("div",{className:"e-header-popup"}),n=t.createElement("div",{className:"e-header-calendar"});e.appendChild(n),this.element.appendChild(e),this.headerPopup=new i.Popup(e,{actionOnScroll:"hide",targetType:"relative",relateTo:this.getPopUpRelativeElement(),position:{X:"left",Y:"bottom"},enableRtl:this.parent.enableRtl}),this.headerPopup.isStringTemplate=!0;var a=this.getCalendarView();this.headerCalendar=new r.Calendar({value:this.parent.selectedDate,min:this.parent.minDate,max:this.parent.maxDate,firstDayOfWeek:this.parent.activeViewOptions.firstDayOfWeek,enableRtl:this.parent.enableRtl,locale:this.parent.locale,depth:a,start:a,calendarMode:this.parent.calendarMode,change:this.calendarChange.bind(this)}),this.headerCalendar.isStringTemplate=!0,this.headerCalendar.appendTo(n),this.headerPopup.hide()},e.prototype.calendarChange=function(e){e.value.getTime()!==this.parent.selectedDate.getTime()&&this.parent.changeDate(e.value),this.headerPopup.hide()},e.prototype.calculateViewIndex=function(e){var i=t.closest(e.originalEvent.target,".e-views");return[].slice.call(this.element.querySelectorAll(".e-views")).indexOf(i)},e.prototype.toolbarClickHandler=function(e){if(e.item){switch(e.item.cssClass.replace("e-views ","")){case"e-date-range":this.headerPopup||this.renderHeaderPopup(),this.headerPopup.element.classList.contains(Ge)?this.headerPopup.hide():this.headerPopup.show();break;case"e-day":this.parent.changeView("Day",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-week":this.parent.changeView("Week",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-work-week":this.parent.changeView("WorkWeek",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-month":this.parent.changeView("Month",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-year":this.parent.changeView("Year",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-agenda":this.parent.changeView("Agenda",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-month-agenda":this.parent.changeView("MonthAgenda",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-timeline-day":this.parent.changeView("TimelineDay",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-timeline-week":this.parent.changeView("TimelineWeek",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-timeline-work-week":this.parent.changeView("TimelineWorkWeek",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-timeline-month":this.parent.changeView("TimelineMonth",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-timeline-year":this.parent.changeView("TimelineYear",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-today":this.parent.isSelectedDate(T(this.parent.getCurrentTime()))||this.parent.changeDate(T(this.parent.getCurrentTime()),e.originalEvent);break;case"e-prev":this.parent.changeDate(this.parent.activeView.getNextPreviousDate("previous"),e.originalEvent);break;case"e-next":this.parent.changeDate(this.parent.activeView.getNextPreviousDate("next"),e.originalEvent);break;case"e-add":var i=void 0,n=this.parent.activeCellsData.startTime.getTime()===this.parent.activeCellsData.endTime.getTime();if(this.parent.activeCellsData&&!n)i=this.parent.activeCellsData;else{var r=this.parent.activeViewOptions.timeScale.interval,a=this.parent.activeViewOptions.timeScale.slotCount,s=r*Fe/a,o=new Date(this.parent.selectedDate.getTime()),l=this.parent.getCurrentTime();o.setHours(l.getHours(),Math.round(o.getMinutes()/s)*s,0),i={startTime:o,endTime:new Date(new Date(o.getTime()).setMilliseconds(o.getMilliseconds()+s)),isAllDay:!1}}this.parent.eventWindow.openEditor(t.extend(i,{cancel:!1,event:e.originalEvent}),"Add")}var c=this.toolbarObj.element.querySelector(".e-toolbar-pop");c&&"Input"!==e.item.type&&c.ej2_instances[0].hide({name:"SlideUp",duration:100})}},e.prototype.getHeaderElement=function(){return this.toolbarObj.element},e.prototype.updateHeaderItems=function(e){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"===e?t.addClass([i],"e-hidden"):t.removeClass([i],"e-hidden")),n&&("add"===e?t.addClass([n],"e-hidden"):t.removeClass([n],"e-hidden")),r&&("add"===e?t.addClass([r],Ke):t.removeClass([r],Ke))},e.prototype.previousNextIconHandler=function(){var e=this.parent.getCurrentViewDates(),i=this.toolbarObj.element.querySelector(".e-prev"),n=this.toolbarObj.element.querySelector(".e-next"),r=new Date(e[0].getTime()),a=new Date(e[e.length-1].getTime());"WorkWeek"!==this.parent.currentView&&"TimelineWorkWeek"!==this.parent.currentView||(a=b(r=u(T(this.parent.selectedDate),this.parent.firstDayOfWeek),7*this.parent.activeViewOptions.interval)),"Month"===this.parent.currentView&&(a=g(C(r=m(this.parent.selectedDate),this.parent.activeViewOptions.interval-1))),t.isNullOrUndefined(i)||this.toolbarObj.enableItems(i,r>this.parent.minDate),t.isNullOrUndefined(n)||this.toolbarObj.enableItems(n,a<this.parent.maxDate),this.setCalendarMinMaxDate()},e.prototype.getModuleName=function(){return"headerbar"},e.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(),t.remove(this.element),this.toolbarObj=null)},e}(),et=function(){function e(e){this.parent=e,this.addEventListener()}return e.prototype.getModuleName=function(){return"scroll"},e.prototype.setWidth=function(){this.parent.element.style.width=t.formatUnit(this.parent.width)},e.prototype.setHeight=function(){this.parent.element.style.height=t.formatUnit(this.parent.height)},e.prototype.addEventListener=function(){this.parent.on(Le,this.setDimensions,this),this.parent.on("ui-update",this.onPropertyChanged,this)},e.prototype.removeEventListener=function(){this.parent.off(Le,this.setDimensions),this.parent.off("ui-update",this.onPropertyChanged)},e.prototype.setDimensions=function(){this.setWidth(),this.setHeight();var e={cssProperties:this.parent.getCssProperties(),module:this.getModuleName()};this.parent.notify(Be,e)},e.prototype.onPropertyChanged=function(e){this.setDimensions()},e.prototype.destroy=function(){this.removeEventListener()},e}(),tt=function(){function e(e){this.parent=e,this.element=this.parent.element.querySelector("."+_e),this.touchObj=new t.Touch(this.element,{scroll:this.scrollHandler.bind(this),swipe:this.swipeHandler.bind(this),tapHold:this.tapHoldHandler.bind(this),swipeSettings:{swipeThresholdDistance:1}}),t.EventHandler.add(this.element,"transitionend",this.onTransitionEnd,this),this.touchLeftDirection=this.parent.enableRtl?"Right":"Left",this.touchRightDirection=this.parent.enableRtl?"Left":"Right"}return e.prototype.scrollHandler=function(e){if(!(t.isBlazor()||"Agenda"===this.parent.currentView||this.parent.uiStateValues.action||e.originalEvent&&(e.originalEvent.target.classList.contains("e-appointment")||t.closest(e.originalEvent.target,".e-appointment")))){if(this.timeStampStart||(this.timeStampStart=Date.now()),this.element.classList.contains("e-translate")&&this.onTransitionEnd(),"Left"===e.scrollDirection||"Right"===e.scrollDirection){var i={requestType:"dateNavigate",cancel:!1,event:e.originalEvent};if(this.parent.trigger(He,i),i.cancel)return;var n=this.element.querySelector(".e-content-wrap");if(n&&n.scrollWidth>n.clientWidth)return;this.isScrollTriggered=!0,e.originalEvent.preventDefault(),e.originalEvent.stopPropagation()}if(e.scrollDirection===this.touchLeftDirection){this.nextPanel||(this.renderPanel("e-next-panel","next"),this.nextPanel={element:this.parent.activeView.getPanel(),selectedDate:new Date(this.parent.selectedDate.getTime())},this.setDimensions(this.nextPanel.element));a=this.parent.enableRtl?e.distanceX:-e.distanceX;this.element.style.transform="translatex("+(this.getTranslateX(this.element)+a)+"px)"}else if(e.scrollDirection===this.touchRightDirection){var r=0;this.previousPanel||(this.renderPanel("e-previous-panel","previous"),this.previousPanel={element:this.parent.activeView.getPanel(),selectedDate:new Date(this.parent.selectedDate.getTime())},this.setDimensions(this.previousPanel.element),r=this.previousPanel.element.offsetWidth);var a=this.parent.enableRtl?r-e.distanceX:-r+e.distanceX;this.element.style.transform="translatex("+(this.getTranslateX(this.element)+a)+"px)"}}},e.prototype.swipeHandler=function(e){if(this.isScrollTriggered&&!this.parent.uiStateValues.action){this.isScrollTriggered=!1;var i="Left"===e.swipeDirection?this.parent.activeView.renderDates[0]:this.parent.activeView.renderDates.slice(-1)[0];if("Left"===e.swipeDirection&&i<this.parent.maxDate||"Right"===e.swipeDirection&&i>=this.parent.minDate){var n=Date.now()-this.timeStampStart,r=e.distanceX*(t.Browser.isDevice?6:1.66);r>n||e.distanceX>this.parent.element.offsetWidth/2?(this.swapPanels(e.swipeDirection),r>n&&e.distanceX>this.parent.element.offsetWidth/2&&(this.element.style.transitionDuration=r/n/10+"s"),this.confirmSwipe(e.swipeDirection)):this.cancelSwipe();var a={requestType:"dateNavigate",cancel:!1,event:e.originalEvent};this.parent.trigger("actionComplete",a)}else this.cancelSwipe();this.timeStampStart=null}},e.prototype.tapHoldHandler=function(e){var i=t.closest(e.originalEvent.target,".e-appointment");if(!t.isNullOrUndefined(i)&&this.parent.isAdaptive)return void this.parent.quickPopup.tapHoldEventPopup(e.originalEvent)},e.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())},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)},e.prototype.swapPanels=function(e){if(e===this.touchLeftDirection){t=this.nextPanel;this.nextPanel=this.currentPanel,this.currentPanel=t}else{var t=this.previousPanel;this.previousPanel=this.currentPanel,this.currentPanel=t}},e.prototype.confirmSwipe=function(e){var i=this,n={action:"date",cancel:!1,previousDate:e===this.touchLeftDirection?this.nextPanel.selectedDate:this.previousPanel.selectedDate,currentDate:this.currentPanel.selectedDate};this.parent.trigger("navigating",n,function(n){if(n.cancel)i.swapPanels(e),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?e===i.touchLeftDirection?i.previousPanel?i.previousPanel.element.offsetLeft:i.currentPanel.element.offsetWidth:0:e===i.touchLeftDirection?-i.currentPanel.element.offsetLeft:0,t.addClass([i.element],"e-translate"),i.element.style.transform="translatex("+r+"px)",i.parent.headerModule&&i.parent.headerModule.updateDateRange(i.parent.activeView.getDateRangeText()),i.parent.renderModule.refreshDataManager()}})},e.prototype.cancelSwipe=function(){this.parent.activeView.setPanel(this.currentPanel.element),this.parent.setProperties({selectedDate:this.currentPanel.selectedDate},!0),this.parent.activeView.getRenderDates(),this.parent.activeView.generateColumnLevels(),t.addClass([this.element],"e-translate");var e=this.previousPanel?this.previousPanel.element.offsetWidth:0;this.element.style.transform="translatex("+(this.parent.enableRtl?e:-this.currentPanel.element.offsetLeft)+"px)"},e.prototype.onTransitionEnd=function(){t.removeClass([this.element],"e-translate"),this.element.style.transitionDuration="",this.element.style.transform="",this.previousPanel&&(t.remove(this.previousPanel.element),this.previousPanel=null,t.removeClass([this.currentPanel.element],"e-previous-panel"),t.addClass([this.currentPanel.element],"e-current-panel")),this.nextPanel&&(t.remove(this.nextPanel.element),this.nextPanel=null,t.removeClass([this.currentPanel.element],"e-next-panel"),t.addClass([this.currentPanel.element],"e-current-panel")),this.currentPanel=null,this.parent.activeView.getPanel().style.width=""},e.prototype.getTranslateX=function(e){var t=window.getComputedStyle(e);return new WebKitCSSMatrix(t.webkitTransform).m41},e.prototype.setDimensions=function(e){e.style.width=this.parent.element.clientWidth+"px"},e.prototype.resetValues=function(){this.currentPanel=null,this.previousPanel=null,this.nextPanel=null,this.timeStampStart=null,this.element.style.transform="",t.isBlazor()||R(this.element),t.removeClass([this.element],"e-translate")},e.prototype.destroy=function(){this.touchObj.destroy(),t.EventHandler.remove(this.element,"transitionend",this.onTransitionEnd),this.resetValues()},e}(),it=function(){function e(e){this.selectedCells=[],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",home:"home",pageUp:"pageup",pageDown:"pagedown",tab:"tab",shiftTab:"shift+tab"},this.parent=e,this.parent.element.tabIndex=-1===this.parent.element.tabIndex?0:this.parent.element.tabIndex,this.keyboardModule=new t.KeyboardEvents(this.parent.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}),this.addEventListener()}return e.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":this.processDelete(e);break;case"escape":this.processEscape()}},e.prototype.addEventListener=function(){this.parent.on("cell-mouse-down",this.onCellMouseDown,this)},e.prototype.removeEventListener=function(){this.parent.off("cell-mouse-down",this.onCellMouseDown)},e.prototype.onCellMouseDown=function(e){if(!e.event.shiftKey&&(this.initialTarget=this.getClosestCell(e.event),!this.parent.activeViewOptions.readonly&&"MonthAgenda"!==this.parent.currentView&&this.initialTarget&&(e.event.target.classList.contains("e-work-cells")&&3!==e.event.which&&(this.parent.removeSelectedClass(),t.EventHandler.add(this.parent.getContentTable(),"mousemove",this.onMouseSelection,this),t.EventHandler.add(this.parent.getContentTable(),"mouseup",this.onMoveup,this)),e.event.target.classList.contains("e-all-day-cells")&&3!==e.event.which))){this.parent.removeSelectedClass();var i=this.parent.getAllDayRow();t.EventHandler.add(i,"mousemove",this.onMouseSelection,this),t.EventHandler.add(i,"mouseup",this.onMoveup,this)}},e.prototype.onMouseSelection=function(e){var i=[].slice.call(this.parent.element.querySelectorAll(".e-appointment"));t.addClass(i,"e-allow-select");var n=this.parent.boundaryValidation(e.pageY,e.pageX);if(n.bottom||n.top||n.left||n.right){var r=this.parent.element.querySelector(".e-content-wrap"),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?-e.target.offsetHeight:e.target.offsetHeight),s&&(n.left||n.right)&&(r.scrollLeft+=n.left?-e.target.offsetWidth:e.target.offsetWidth)}var o=this.getClosestCell(e);o&&this.selectCells(!0,o)},e.prototype.getClosestCell=function(e){return t.closest(e.target,".e-work-cells,.e-all-day-cells")},e.prototype.onMoveup=function(e){var i=this,n=[].slice.call(this.parent.element.querySelectorAll(".e-appointment"));if(t.removeClass(n,"e-allow-select"),e.target.classList.contains("e-work-cells")&&(t.EventHandler.remove(this.parent.getContentTable(),"mousemove",this.onMouseSelection),t.EventHandler.remove(this.parent.getContentTable(),"mouseup",this.onMoveup)),e.target.classList.contains("e-all-day-cells")){var r=this.parent.getAllDayRow();t.EventHandler.remove(r,"mousemove",this.onMouseSelection),t.EventHandler.remove(r,"mouseup",this.onMoveup)}if(!this.isPreventAction(e)){var a=t.closest(e.target,".e-work-cells,.e-all-day-cells,.e-header-cells");this.parent.activeCellsData=this.getSelectedElements(a);var s={};this.parent.eventWindow.convertToEventData(this.parent.activeCellsData,s);var o={data:s,element:this.parent.activeCellsData.element,event:e,requestType:"cellSelect",showQuickPopup:!1};this.parent.trigger("select",o,function(n){if(n.showQuickPopup||i.parent.quickInfoOnSelectionEnd){var r=t.extend(i.parent.activeCellsData,{cancel:!1,event:e,name:"cellClick"});i.parent.notify("cellClick",r)}})}},e.prototype.processEnter=function(e){if(!this.parent.activeViewOptions.readonly&&!this.isPreventAction(e)){var i=e.target;if(t.closest(i,".e-quick-popup-wrapper"))return void(i.classList.contains("e-event-details")||i.classList.contains("e-event-create")||i.classList.contains("e-event-edit")||i.classList.contains("e-event-delete")||i.classList.contains("e-close")?(i.click(),e.preventDefault()):i.classList.contains("e-subject")&&(this.parent.element.querySelector(".e-event-create").click(),e.preventDefault()));if(!i.classList.contains("e-work-cells")&&!i.classList.contains("e-all-day-cells"))return i.classList.contains("e-inline-subject")?void this.parent.inlineModule.inlineCrudActions(i):i.classList.contains("e-appointment")||i.classList.contains("e-more-event-close")||i.classList.contains("e-all-day-appointment-section")||i.classList.contains("e-more-indicator")?void i.click():i.classList.contains("e-header-date")?(this.parent.setScheduleProperties({selectedDate:this.parent.getDateFromElement(i)}),this.parent.changeView(this.parent.getNavigateView(),e),void this.processEscape()):void 0;this.parent.activeCellsData=this.getSelectedElements(i);var n=t.extend(this.parent.activeCellsData,{cancel:!1,event:e});if(this.parent.allowInline){var r={element:n.element,groupIndex:n.groupIndex,type:"Cell"};this.parent.notify(Ie,r)}else this.parent.notify("cellClick",n)}},e.prototype.getSelectedElements=function(e){var t;if(this.selectedCells.length>1&&e.classList.contains("e-selected-cell")){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},e.prototype.getCells=function(e,t,i){var n=this.parent.getContentTable(),r=[].slice.call(n.querySelectorAll("td")),a=n.rows.length,s=n.rows[0].cells.length;if(t.classList.contains("e-all-day-cells")){var o=this.parent.getAllDayRow();r=[].slice.call(o.cells),a=1,s=o.cells.length}var l=r.indexOf(t),c=r.indexOf(i),p=[];if(e){for(var d=0;d<s;d++)for(var h=0;h<a;h++)p.push(r[s*h+d]);l=p.indexOf(t),c=p.indexOf(i)}if(l>c){var u=l;l=c,c=u}return(e?p:r).slice(l,c+1)},e.prototype.focusFirstCell=function(){if("Agenda"===this.parent.currentView){var e=this.parent.getContentTable().querySelector(".e-agenda-cells");return e.setAttribute("tabindex","0"),void e.focus()}if(this.parent.eventBase.removeSelectedAppointmentClass(),this.parent.activeView.isTimelineView()){var t=this.parent.element.querySelector("."+Ye+" tr:not(.e-hidden) .e-work-cells:not(.e-resource-group-cells)");this.selectCells(!1,t)}else this.selectCells(!1,this.parent.getWorkCellElements()[0])},e.prototype.isInverseTableSelect=function(){return this.parent.activeView.isInverseTableSelect},e.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","Month","TimelineDay","TimelineWeek","TimelineWorkWeek","TimelineMonth"],s={element:t,requestType:"mousemove",allowMultipleRow:!0};this.parent.inlineModule.removeInlineAppointmentElement(),this.parent.trigger("select",s,function(e){(!e.allowMultipleRow||!i.parent.allowMultiRowSelection)&&a.indexOf(i.parent.currentView)>-1&&(n=n.parentElement.children[i.initialTarget.cellIndex]);var t=i.getCells(i.isInverseTableSelect(),i.initialTarget,n);if(i.parent.activeViewOptions.group.resources.length>0){r=i.initialTarget.getAttribute("data-group-index");for(var s=[],o=0,l=t;o<l.length;o++)(u=l[o]).getAttribute("data-group-index")===r&&s.push(u);t=s}if(i.parent.allowMultiCellSelection||(t=[i.initialTarget]),i.selectedCells=t,t.length>2&&!n.classList.contains("e-all-day-cells")){var c=i.getAllDayCells(t);if(i.parent.activeViewOptions.group.resources.length>0){for(var p=[],d=0,h=c;d<h.length;d++){var u=h[d];u.getAttribute("data-group-index")===r&&p.push(u)}c=p}t=t.concat(c)}n.getAttribute("data-group-index")!==r&&i.parent.activeViewOptions.group.resources.length>0&&(n=i.selectedCells[i.selectedCells.length-1]),i.parent.addSelectedClass(t,n)})}else this.initialTarget=n,this.selectedCells=[n],this.parent.addSelectedClass([n],n)},e.prototype.selectAppointment=function(e,i){var n=this.getAppointmentElements();if(!(n.length<0)){this.parent.eventBase.removeSelectedAppointmentClass();var r;if(i.classList.contains("e-appointment")){var a=n.indexOf(i);r=n[e?a-1:a+1]}else r=e?n[n.length-1]:n[0];r&&(this.parent.eventBase.addSelectedAppointments([r]),r.focus(),t.addClass([r],"e-active-appointment-agenda"))}},e.prototype.selectAppointmentElementFromWorkCell=function(e,t){var i=this;if(this.parent.eventBase.removeSelectedAppointmentClass(),this.parent.removeSelectedClass(),t.classList.contains("e-work-cells")||t.classList.contains("e-all-day-cells")){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),o[o.length-1].focus()}}},e.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()>=Ne?[].slice.call(t.cells).slice(i.cellIndex,n.cellIndex+1):[]},e.prototype.getAppointmentElements=function(){return[].slice.call(this.parent.element.querySelectorAll(".e-appointment"))},e.prototype.getAppointmentElementsByGuid=function(e){return[].slice.call(this.parent.element.querySelectorAll('div[data-guid="'+e+'"]'))},e.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[n])}),t},e.prototype.getWorkCellFromAppointmentElement=function(e){var t=this.parent.eventBase.getEventByGuid(e.getAttribute("data-guid"));return this.parent.eventBase.selectWorkCellByTime([t])},e.prototype.processViewNavigation=function(e){var t=parseInt(e.key,10)-1;if(t<this.parent.views.length){var i=this.parent.viewCollections[t].option;this.parent.changeView(i,e,void 0,t),this.parent.headerModule&&this.parent.headerModule.element.querySelector(".e-active-view button").focus()}},e.prototype.processUp=function(e,t){if(!t||!this.parent.activeView.isTimelineView()&&"MonthAgenda"!==this.parent.currentView){var i=e.target,n=this.parent.getSelectedElements(),r=this.parent.eventBase.getSelectedAppointments(),a=this.parent.element.querySelector(".e-more-popup-wrapper"),s=this.getQuickPopupElement();if(n.length>0&&!e.target.classList.contains("e-work-cells")&&(i=n[n.length-1]),r.length>0&&!a.classList.contains(Ge)&&!s.classList.contains(Ge)&&-1!==["Day","Week","WorkWeek","Month"].indexOf(this.parent.currentView)&&(i=this.getWorkCellFromAppointmentElement(r[r.length-1]),this.parent.eventBase.removeSelectedAppointmentClass()),i)if(i.classList.contains("e-work-cells")&&!this.parent.element.querySelector("."+Ge)){var o=this.parent.getTableRows(),l=o.indexOf(i.parentElement);l>0&&l<o.length&&this.selectCells(t,o[l-1].cells[i.cellIndex])}else"Agenda"!==this.parent.currentView&&"MonthAgenda"!==this.parent.currentView||this.selectAppointment(!0,i)}},e.prototype.processDown=function(e,t){if(!t||!this.parent.activeView.isTimelineView()&&"MonthAgenda"!==this.parent.currentView){var i=e.target,n=this.parent.getSelectedElements(),r=this.parent.eventBase.getSelectedAppointments(),a=this.parent.element.querySelector(".e-more-popup-wrapper"),s=this.getQuickPopupElement();n.length>0&&!e.target.classList.contains("e-work-cells")&&(i=n[n.length-1]),r.length>0&&!a.classList.contains(Ge)&&!s.classList.contains(Ge)&&-1!==["Day","Week","WorkWeek","Month"].indexOf(this.parent.currentView)&&(i=this.getWorkCellFromAppointmentElement(r[r.length-1]),this.parent.eventBase.removeSelectedAppointmentClass());var o=this.parent.getTableRows();if(i)if(i.classList.contains("e-work-cells")&&!this.parent.element.querySelector("."+Ge)){var l=o.indexOf(i.parentElement);l>=0&&l<o.length-1&&this.selectCells(t,o[l+1].cells[i.cellIndex])}else"Agenda"!==this.parent.currentView&&"MonthAgenda"!==this.parent.currentView||this.selectAppointment(!1,i)}},e.prototype.processLeftRight=function(e){var t=this.parent.getContentTable(),i=e.parentNode.sectionRowIndex;return{element:t,rowIndex:i,columnIndex:e.cellIndex,maxIndex:t.rows[i].cells.length}},e.prototype.getQuickPopupElement=function(){return(this.parent.isAdaptive?document.body:this.parent.element).querySelector(".e-quick-popup-wrapper")},e.prototype.isCancelLeftRightAction=function(e,t){if("Agenda"===this.parent.currentView||t&&"MonthAgenda"===this.parent.currentView)return!0;if(this.isPreventAction(e)&&t)return!0;var i=this.parent.element.querySelector(".e-more-popup-wrapper"),n=this.getQuickPopupElement();return!(!i.classList.contains(Ge)&&!n.classList.contains(Ge))},e.prototype.processRight=function(e,i){if(!this.isCancelLeftRightAction(e,i)){var n,r=this.parent.getSelectedElements(),a=this.parent.eventBase.getSelectedAppointments(),s=e.target;if(r.length>0&&!s.classList.contains("e-work-cells")&&!s.classList.contains("e-all-day-cells")&&(s=r[r.length-1]),!(a.length>0)||(s=this.getWorkCellFromAppointmentElement(a[a.length-1]),this.parent.eventBase.removeSelectedAppointmentClass(),s))if(s.classList.contains("e-work-cells")&&e.target.classList.contains("e-work-cells")){var o=this.processLeftRight(s);if(o.columnIndex>=0&&o.columnIndex<o.maxIndex-1)n=this.calculateNextPrevDate(s,o.element.rows[o.rowIndex].cells[s.cellIndex+1],"right"),t.isNullOrUndefined(n)||this.selectCells(i,n);else if(o.columnIndex===o.maxIndex-1)if(!this.isInverseTableSelect()&&o.rowIndex<o.element.rows.length-1)n=this.calculateNextPrevDate(s,o.element.rows[o.rowIndex+1].cells[0],"right"),t.isNullOrUndefined(n)||this.selectCells(i,n);else if(!i){var l=this.isInverseTableSelect()?o.rowIndex:0;this.parent.changeDate(this.parent.activeView.getNextPreviousDate("next"),e);var c=this.parent.getContentTable();this.selectCells(!1,c.rows[l].cells[0])}}else if(s.classList.contains("e-all-day-cells")){var p=s.cellIndex,d=this.parent.getAllDayRow(),h=d.cells.length;if(p>=0&&p<h-1)this.selectCells(i,d.cells[p+1]);else if(p===h-1&&!i){this.parent.changeDate(this.parent.activeView.getNextPreviousDate("next"),e);var u=this.parent.getAllDayRow();this.selectCells(!1,u.cells[0])}}}},e.prototype.processLeft=function(e,i){if(!this.isCancelLeftRightAction(e,i)){var n,r=e.target,a=this.parent.getSelectedElements();a.length>0&&!r.classList.contains("e-work-cells")&&!r.classList.contains("e-all-day-cells")&&(r=a[a.length-1]);var s=this.parent.eventBase.getSelectedAppointments();if(!(s.length>0)||(r=this.getWorkCellFromAppointmentElement(s[s.length-1]),this.parent.eventBase.removeSelectedAppointmentClass(),r))if(e.target.classList.contains("e-work-cells")&&r.classList.contains("e-work-cells")){var o=this.processLeftRight(r);if(o.columnIndex>0&&o.columnIndex<o.maxIndex)n=this.calculateNextPrevDate(r,o.element.rows[o.rowIndex].cells[r.cellIndex-1],"left"),t.isNullOrUndefined(n)||this.selectCells(i,n);else if(0===o.columnIndex)if(!this.isInverseTableSelect()&&o.rowIndex>0)n=this.calculateNextPrevDate(r,o.element.rows[o.rowIndex-1].cells[o.maxIndex-1],"left"),t.isNullOrUndefined(n)||this.selectCells(i,n);else if(!i){this.parent.changeDate(this.parent.activeView.getNextPreviousDate("previous"),e);var l=this.parent.getContentTable(),c=this.isInverseTableSelect()?o.rowIndex:l.rows.length-1;this.selectCells(!1,l.rows[c].cells[o.maxIndex-1])}}else if(r.classList.contains("e-all-day-cells")){var p=r.cellIndex,d=this.parent.getAllDayRow(),h=d.cells.length;if(p>0&&p<h)this.selectCells(i,d.cells[p-1]);else if(0===p&&!i){this.parent.changeDate(this.parent.activeView.getNextPreviousDate("previous"),e);var u=this.parent.getAllDayRow();this.selectCells(!1,u.cells[h-1])}}}},e.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="'+this.parent.getMsFromDate(a).toString()+'"][data-group-index="'+n+'"]'))[0]}return t},e.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"])'))},e.prototype.processTabOnPopup=function(e,i){var n=this,r=this.getFocusableElements(i),a=(r=r.filter(function(e){var t=n.parent.element.querySelector(".e-popup-footer");return t&&t.offsetParent?!(e.classList.contains("e-edit")||e.classList.contains("e-delete")):!(e.classList.contains("e-event-edit")||e.classList.contains("e-event-delete"))}))[0],s=r[r.length-1];t.isNullOrUndefined(s)||document.activeElement!==s||e.shiftKey||(e.preventDefault(),a.focus()),!t.isNullOrUndefined(a)&&document.activeElement===a&&e.shiftKey&&(e.preventDefault(),s.focus())},e.prototype.processTab=function(e,i){var n=e.target,r=t.closest(n,".e-quick-popup-wrapper,.e-more-popup-wrapper");if(r&&r.classList.contains(Ge))return r.classList.contains("e-more-popup-wrapper")&&this.parent.eventBase.removeSelectedAppointmentClass(),void this.processTabOnPopup(e,r);if(n.classList.contains(We))return void this.parent.eventBase.removeSelectedAppointmentClass();if(n.classList.contains("e-appointment")){var a=[].slice.call(this.parent.element.querySelectorAll(".e-appointment")),s=this.parent.eventBase.getSelectedAppointments();if(s.length>0&&(n=s[s.length-1]),this.parent.eventBase.removeSelectedAppointmentClass(),!i&&n.getAttribute("data-guid")===a[a.length-1].getAttribute("data-guid")||i&&n.getAttribute("data-guid")===a[0].getAttribute("data-guid"))return;return void("Agenda"!==this.parent.currentView&&"MonthAgenda"!==this.parent.currentView||(this.selectAppointment(i,n),e.preventDefault()))}var o=this.parent.getSelectedElements();return o.length>0&&!n.classList.contains("e-appointment")?(n=o[o.length-1],this.selectAppointmentElementFromWorkCell(i,n),void e.preventDefault()):void 0},e.prototype.processDelete=function(e){var i=document.activeElement;if("MonthAgenda"===this.parent.currentView){var n=this.parent.eventBase.getSelectedEvents().element;i=n&&t.isNullOrUndefined(n.length)?n:n[0]}if(i&&i.classList.contains("e-appointment")){if(t.addClass([i],"e-appointment-border"),this.parent.activeEventData=this.parent.eventBase.getSelectedEvents(),this.parent.activeViewOptions.readonly||i.classList.contains("e-read-only"))return;this.parent.quickPopup.deleteClick()}},e.prototype.processEscape=function(){this.parent.quickPopup.onClosePopup(),this.parent.quickPopup.morePopup.hide(),this.parent.headerModule&&this.parent.headerModule.hideHeaderPopup(),this.parent.inlineModule&&this.parent.inlineModule.removeInlineAppointmentElement()},e.prototype.isPreventAction=function(e){var i=t.closest(e.target,".e-resource-group-cells");return!(!this.parent.activeView.isTimelineView()||t.isNullOrUndefined(i))},e.prototype.getModuleName=function(){return"keyboard"},e.prototype.destroy=function(){this.removeEventListener(),this.keyboardModule.destroy()},e}(),nt=function(){function e(e,t){this.initDataManager(e,t)}return e.prototype.initDataManager=function(e,t){this.dataManager=e instanceof a.DataManager?e:new a.DataManager(e),this.query=t instanceof a.Query?t:new a.Query},e.prototype.generateQuery=function(e,t){var i=this.query.clone();return e&&i.addParams("StartDate",e.toISOString()),t&&i.addParams("EndDate",t.toISOString()),i},e.prototype.getData=function(e){return this.dataManager.executeQuery(e)},e}(),rt=function(){function e(){}return e.prototype.firstDateOfMonth=function(e){return new Date(e.getFullYear(),e.getMonth())},e.prototype.lastDateOfMonth=function(e){return new Date(e.getFullYear(),e.getMonth()+1,0)},e.prototype.isMonthStart=function(e){return 1===e.getDate()},e.prototype.getLeapYearDaysCount=function(){return 366},e.prototype.getYearDaysCount=function(e,t){return(e.getFullYear()+t)%4==0?366:365},e.prototype.getDate=function(e){return e.getDate()},e.prototype.getMonth=function(e){return e.getMonth()+1},e.prototype.getFullYear=function(e){return e.getFullYear()},e.prototype.getYearLastDate=function(e,t){return new Date(e.getFullYear()+t,0,0)},e.prototype.getMonthDaysCount=function(e){return this.lastDateOfMonth(e).getDate()},e.prototype.getMonthStartDate=function(e){return new Date(e.getFullYear(),e.getMonth(),1,e.getHours(),e.getMinutes())},e.prototype.getMonthEndDate=function(e){return e.setDate(1),new Date(e.setMonth(e.getMonth()+1))},e.prototype.getExpectedDays=function(e,t){return t},e.prototype.setDate=function(e,t){e.setDate(t)},e.prototype.setValidDate=function(e,i,n,r,a){t.isNullOrUndefined(a)?e.setMonth(e.getMonth()+i,n):e.setMonth((a?r:e.getMonth())+i)},e.prototype.setMonth=function(e,t,i){e.setFullYear(e.getFullYear()),e.setMonth(t-1),e.setDate(i)},e.prototype.addYears=function(e,t){e.setFullYear(e.getFullYear()+t)},e.prototype.isSameMonth=function(e,t){return e.getMonth()===t.getMonth()},e.prototype.checkMonth=function(e,t){return-1===t.indexOf(e.getMonth()+1)},e.prototype.compareMonth=function(e,t){return e.getMonth()>t.getMonth()},e.prototype.isSameYear=function(e,t){return e.getFullYear()===t.getFullYear()},e.prototype.isLastMonth=function(e){return 11===e.getMonth()},e.prototype.isLeapYear=function(e,t){return(e+t)%4==0},e}(),at=function(){function e(){}return e.prototype.firstDateOfMonth=function(e){var i=t.HijriParser.getHijriDate(e);return t.HijriParser.toGregorian(i.year,i.month,1)},e.prototype.lastDateOfMonth=function(e){var i=this.getHijriDate(e),n=t.HijriParser.toGregorian(i.year,i.month,this.getDaysInMonth(i.month,i.year)),r=new Date(n.getTime());new Date(r.setDate(r.getDate()+1));var a=this.getHijriDate(r);return i.month===a.month?r:(a=t.HijriParser.getHijriDate(n),i.month===a.month?n:new Date(n.setDate(n.getDate()-1)))},e.prototype.isMonthStart=function(e){return 1===this.getHijriDate(e).date},e.prototype.getLeapYearDaysCount=function(){return 355},e.prototype.getYearDaysCount=function(e,t){var i=this.getHijriDate(e);return this.isLeapYear(i.year,t)?355:354},e.prototype.getDate=function(e){return this.getHijriDate(e).date},e.prototype.getMonth=function(e){return this.getHijriDate(e).month},e.prototype.getFullYear=function(e){return this.getHijriDate(e).year},e.prototype.getYearLastDate=function(e,i){var n=t.HijriParser.getHijriDate(e);return t.HijriParser.toGregorian(n.year+i,1,0)},e.prototype.getMonthDaysCount=function(e){var t=this.lastDateOfMonth(e);return this.getHijriDate(t).date},e.prototype.getMonthStartDate=function(e){var t=this.firstDateOfMonth(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate(),e.getHours(),e.getMinutes())},e.prototype.getMonthEndDate=function(e){var t=this.lastDateOfMonth(e);return t.setDate(t.getDate()+1),new Date(t.setMonth(t.getMonth()))},e.prototype.getExpectedDays=function(e,i){for(var n=this.getHijriDate(e),r=[],a=0;a<i.length;a++){var s=t.HijriParser.toGregorian(n.year,n.month,i[a]);r.push(s.getDate())}return r},e.prototype.setDate=function(e,i){var n=t.HijriParser.getHijriDate(e),r=t.HijriParser.toGregorian(n.year,n.month,i);this.updateDateObj(e,r)},e.prototype.setValidDate=function(e,i,n,r,a){var s=t.isNullOrUndefined(a)?e:this.firstDateOfMonth(a),o=t.HijriParser.getHijriDate(s),l=t.HijriParser.toGregorian(o.year,o.month+i,n);this.updateDateObj(e,l)},e.prototype.setMonth=function(e,i,n){var r=t.HijriParser.getHijriDate(e),a=t.HijriParser.toGregorian(r.year,i,n);this.updateDateObj(e,a)},e.prototype.addYears=function(e,i,n){var r=t.HijriParser.getHijriDate(e),a=t.HijriParser.toGregorian(r.year+i,n,1);this.updateDateObj(e,a)},e.prototype.isSameMonth=function(e,t){var i=this.getHijriDate(e),n=this.getHijriDate(t);return i.month===n.month},e.prototype.checkMonth=function(e,t){var i=this.getHijriDate(e);return-1===t.indexOf(i.month)},e.prototype.compareMonth=function(e,t){var i=this.getHijriDate(e),n=this.getHijriDate(t);return i.month>n.month},e.prototype.isSameYear=function(e,t){var i=this.getHijriDate(e),n=this.getHijriDate(t);return i.year===n.year},e.prototype.isLastMonth=function(e){return 12===this.getHijriDate(e).month},e.prototype.updateDateObj=function(e,t){e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate())},e.prototype.isLeapYear=function(e,t){return(14+11*(e+t))%30<11},e.prototype.getDaysInMonth=function(e,t){var i=0;return i=29+(e+1)%2,11===e&&this.isLeapYear(t,0)&&i++,i},e.prototype.getHijriDate=function(e){return t.HijriParser.getHijriDate(e)},e}(),st=function(){function e(){}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-6e4*e.getTimezoneOffset())},e.prototype.getLocalTimezoneName=function(){return window.Intl?Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC":"UTC"},e}(),ot=[{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"}],lt={},ct=["SU","MO","TU","WE","TH","FR","SA"],pt=["SU","MO","TU","WE","TH","FR","SA"],dt=43,ht=["first","second","third","fourth","last"],ut="summaryTimes",vt="summaryOn",mt="every",gt="summaryUntil",ft="summaryDay",yt="summaryWeek",Tt="summaryMonth",wt="summaryYear",Dt={SU:"sun",MO:"mon",TU:"tue",WE:"wed",TH:"thu",FR:"fri",SA:"sat"},bt=/\d/,Ct=/[^A-Z]+/,Et=/[a-z]+|[^a-z]+/gi,Ot=function(){function e(e){this.slots=[],this.isDoubleTapped=!1,this.parent=e}return e.prototype.processData=function(e,i,n){var r=this,a=this.parent.activeView.startDate(),s=this.parent.activeView.endDate(),o=this.parent.eventFields,l=[],c=1,p=!1,d=this.parent.resourceBase?this.parent.resourceBase.resourceCollection:[];e.length>0&&t.isNullOrUndefined(e[0][o.id])&&(p=!0);for(var h=this,u=0,v=e;u<v.length;u++)!function(e){p&&(e[o.id]=c++),"string"==typeof e[o.startTime]&&(e[o.startTime]=k(e[o.startTime])),"string"==typeof e[o.endTime]&&(e[o.endTime]=k(e[o.endTime])),i?h.processTimezoneChange(e,n):e=h.processTimezone(e);for(var a=0;a<d.length;a++)null!==e[d[a].field]&&0!==e[d[a].field]||(e[d[a].field]=void 0);if(t.isNullOrUndefined(e[o.recurrenceRule])||""!==e[o.recurrenceRule]||(e[o.recurrenceRule]=null),t.isNullOrUndefined(e[o.recurrenceRule])||!t.isNullOrUndefined(e[o.recurrenceID])||h.parent.crudModule&&h.parent.crudModule.crudObj.isCrudAction)if(h.parent.crudModule&&h.parent.crudModule.crudObj.isCrudAction){var s=void 0,u=void 0;if(!t.isNullOrUndefined(e[o.recurrenceRule])&&t.isNullOrUndefined(e[o.recurrenceID])){s=h.generateOccurrence(e,null,n,!0);for(var v=0;v<s.length;v++)e=s[v],u=h.parent.eventsProcessed.filter(function(t){return t[r.parent.eventFields.startTime].getTime()-e[r.parent.eventFields.startTime].getTime()==0&&t[r.parent.eventFields.id]===e[r.parent.eventFields.id]}),e.Guid=u.length>0?u[0].Guid:h.generateGuid(),l.push(e)}else u=h.parent.eventsProcessed.filter(function(t){return t[r.parent.eventFields.id]===e[r.parent.eventFields.id]}),e.Guid=u.length>0?u[0].Guid:h.generateGuid(),l.push(e)}else e.Guid=h.generateGuid(),l.push(e);else l=l.concat(h.generateOccurrence(e,null,n,!0))}(v[u]);this.parent.eventsProcessed=[];var m=l.filter(function(e){return!e[r.parent.eventFields.isBlock]});this.parent.eventsProcessed=this.filterEvents(a,s,m);for(var g=l.filter(function(e){return e[r.parent.eventFields.isBlock]}),f=0,y=g.length;f<y;f++){var w=g[f];w[o.isAllDay]&&(w[o.startTime]=T(w[o.startTime]),w[o.endTime]=b(T(w[o.endTime]),1))}return this.parent.blockProcessed=g,m},e.prototype.getProcessedEvents=function(e){void 0===e&&(e=this.parent.eventsData);for(var i=[],n=0,r=e;n<r.length;n++){var a=r[n];!t.isNullOrUndefined(a[this.parent.eventFields.recurrenceRule])&&t.isNullOrUndefined(a[this.parent.eventFields.recurrenceID])?i=i.concat(this.generateOccurrence(a)):i.push(a)}return i},e.prototype.timezonePropertyChange=function(e){var t=this.processData(this.parent.eventsData,!0,e);this.parent.notify(qe,{processedData:t})},e.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)}},e.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)))},e.prototype.processTimezone=function(e,t){void 0===t&&(t=!1);var i=this.parent.eventFields;if(e[i.startTimezone]||e[i.endTimezone]){var n=e[i.startTimezone]||e[i.endTimezone],r=e[i.endTimezone]||e[i.startTimezone],a=this.parent.timezone;t?this.parent.timezone?(e[i.startTime]=this.parent.tzModule.convert(e[i.startTime],n,a),e[i.endTime]=this.parent.tzModule.convert(e[i.endTime],r,a),e[i.startTime]=this.parent.tzModule.remove(e[i.startTime],a),e[i.endTime]=this.parent.tzModule.remove(e[i.endTime],a)):(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,a),e[i.endTime]=this.parent.tzModule.convert(e[i.endTime],r,a)))}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},e.prototype.filterBlockEvents=function(e){var t,i=e[this.parent.eventFields.startTime],n=e[this.parent.eventFields.endTime];if(this.parent.activeViewOptions.group.resources.length>0){var r=this.getGroupIndexFromEvent(e);t=this.parent.resourceBase.lastResourceLevel[r]}return this.filterEvents(i,n,this.parent.blockProcessed,t)},e.prototype.filterEvents=function(e,t,i,n){void 0===i&&(i=this.parent.eventsProcessed);var r=this.parent.eventFields,s=new a.Predicate(r.startTime,"greaterthanorequal",e).and(new a.Predicate(r.endTime,"greaterthanorequal",e)).and(new a.Predicate(r.startTime,"lessthan",t)).or(new a.Predicate(r.startTime,"lessthanorequal",e).and(new a.Predicate(r.endTime,"greaterthan",e))),o=new a.DataManager({json:i}).executeLocal((new a.Query).where(s));return n&&(o=this.filterEventsByResource(n,o)),this.sortByTime(o)},e.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)},e.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[r].field]=e.groupOrder[r];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]})})},e.prototype.sortByTime=function(e){var t=this.parent.eventFields;return e.sort(function(e,i){var n=e[t.startTime],r=i[t.startTime];return n.getTime()-r.getTime()}),e},e.prototype.sortByDateTime=function(e){var t=this.parent.eventFields;return 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}),e},e.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},e.prototype.splitEventByDay=function(e){var i=this.parent.eventFields,n=[],r=e[i.startTime],a=e[i.endTime];if(T(new Date(r.getTime()))<T(new Date(a.getTime())))for(var s=new Date(r.getTime()),o=b(T(new Date(r.getTime())),1),l=0===a.getHours()&&0===a.getMinutes()?a:b(a,1),c=1,p=x(r.getTime(),l.getTime());o<=a;){var d=t.extend({},e);d[i.startTime]=s,d[i.endTime]=o,d.data={index:c,count:p},d.Guid=this.generateGuid(),d.isSpanned=!0,n.push(d),s=o,T(new Date(s.getTime())).getTime()===T(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=b(T(new Date(s.getTime())),1),c++}else n.push(e);return n},e.prototype.splitEvent=function(e,i){var n=this.parent.eventFields,r=T(new Date(e[n.startTime]+"")).getTime(),a=T(new Date(e[n.endTime]+"")).getTime();if(w(e[n.endTime])<=0){var s=b(T(new Date(e[n.endTime]+"")),-1).getTime();a=r>s?r:s}var o=r,l=a,c=[];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,d=0;d<this.slots.length;d++){var h=this.slots[d];if("WorkWeek"===this.parent.currentView||"TimelineWorkWeek"===this.parent.currentView||this.parent.activeViewOptions.group.byDate||this.parent.activeViewOptions.showWeekend){for(var u=[],v=0,m=h;v<m.length;v++){var g=m[v];u.push(new Date(g))}var f=this.getRenderedDates(u);if(!t.isNullOrUndefined(f)&&f.length>0){h=[];for(var y=0,D=f;y<D.length;y++){var C=D[y];h.push(C.getTime())}}}var E=h[0];if((p=p<=E&&a>=E?E:p)>a||E>a)break;if(!this.parent.activeViewOptions.group.byDate&&this.parent.activeViewOptions.showWeekend&&"WorkWeek"!==this.parent.currentView&&"TimelineWorkWeek"!==this.parent.currentView){var O=h.indexOf(p);if(-1!==O){var S=h.indexOf(a),x=-1!==S,k=(S=x?S:h.length-1)-O+1,A=h[O]!==o,V=h[S]!==l;if(c.push(this.cloneEventObject(e,h[O],h[S],k,A,V)),x)break}}else if(this.dateInRange(p,h[0],h[h.length-1])){for(var M=[],R=0;R<h.length;R++)this.dateInRange(h[R],o,l)&&M.push(h[R]);if(M.length>0)if(this.parent.activeViewOptions.group.byDate)for(var P=0,H=M;P<H.length;P++){var j=H[P];c.push(this.cloneEventObject(e,j,j,1,j!==o,j!==l))}else{var A=M[0]!==o,V=M[M.length-1]!==l;c.push(this.cloneEventObject(e,M[0],M[M.length-1],M.length,A,V))}}}}else c.push(this.cloneEventObject(e,r,a,1,!1,!1));return c},e.prototype.cloneEventObject=function(e,i,n,r,a,s){var o=this.parent.eventFields,l=t.extend({},e,null,!0),c={count:r,isLeft:a,isRight:s};return c[o.startTime]=e[o.startTime],c[o.endTime]=e[o.endTime],l.data=c,l[o.startTime]=new Date(i),l[o.endTime]=new Date(n),l},e.prototype.dateInRange=function(e,t,i){return t<=e&&e<=i},e.prototype.getSelectedEventElements=function(e){if(this.removeSelectedAppointmentClass(),this.parent.selectedElements.length<=0)this.parent.selectedElements.push(e);else if(this.parent.selectedElements.filter(function(t){return t.getAttribute("data-guid")===e.getAttribute("data-guid")}).length<=0)for(var t='div[data-guid="'+e.getAttribute("data-guid")+'"]',i=0,n=[].slice.call(this.parent.element.querySelectorAll(t));i<n.length;i++){var r=n[i];this.parent.selectedElements.push(r)}else{var a=this.parent.selectedElements.filter(function(t){return t.getAttribute("data-guid")!==e.getAttribute("data-guid")});this.parent.selectedElements=a}return e&&this.parent.selectedElements.length>0&&this.addSelectedAppointments(this.parent.selectedElements),this.parent.selectedElements},e.prototype.getSelectedEvents=function(){var e=this,t=[],i=[];return[].slice.call(this.parent.element.querySelectorAll(".e-appointment-border")).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]}},e.prototype.removeSelectedAppointmentClass=function(){for(var e=this.getSelectedAppointments(),i=0,n=e;i<n.length;i++)n[i].setAttribute("aria-selected","false");t.removeClass(e,"e-appointment-border"),"Agenda"!==this.parent.currentView&&"MonthAgenda"!==this.parent.currentView||t.removeClass(e,"e-active-appointment-agenda")},e.prototype.addSelectedAppointments=function(e){for(var i=0,n=e;i<n.length;i++)n[i].setAttribute("aria-selected","true");"MonthAgenda"!==this.parent.currentView&&this.parent.removeSelectedClass(),t.addClass(e,"e-appointment-border")},e.prototype.getSelectedAppointments=function(){return[].slice.call(this.parent.element.querySelectorAll(".e-appointment-border,.e-appointment:focus"))},e.prototype.focusElement=function(){if(!this.parent.eventWindow.dialogObject||!this.parent.eventWindow.dialogObject.visible){var e=this.parent.getSelectedElements();if(!(e.length>0)){var i=this.getSelectedAppointments();return i.length>0?void i[i.length-1].focus():void 0}if(this.parent.keyboardInteractionModule){var n=!t.isNullOrUndefined(this.parent.activeCellsData)&&this.parent.activeCellsData.element||e[e.length-1];this.parent.keyboardInteractionModule.selectCells(n instanceof Array,n)}}},e.prototype.selectWorkCellByTime=function(e){var t;if("Agenda"===this.parent.currentView||"MonthAgenda"===this.parent.currentView)return t;if(e.length>0){var i=e[e.length-1],n=i[this.parent.eventFields.startTime],r=new Date(+n).setMinutes(0,0,0),a=this.isAllDayAppointment(i);("Month"===this.parent.currentView||a)&&(r=new Date(+n).setHours(0,0,0,0));var s=void 0;s=a&&-1!==["Day","Week","WorkWeek"].indexOf(this.parent.currentView)?this.parent.getAllDayRow():this.parent.getContentTable();var o='[data-date="'+this.parent.getMsFromDate(new Date(r))+'"]';if(this.parent.activeViewOptions.group.resources.length>0&&(o+='[data-group-index="'+this.getGroupIndexFromEvent(i)+'"]'),t=s.querySelector(o))return this.parent.activeCellsData=this.parent.getCellDetails(t),this.parent.keyboardInteractionModule&&this.parent.keyboardInteractionModule.selectCells(!1,t),t}return t},e.prototype.getGroupIndexFromEvent=function(e){var t=this.parent.resourceCollection.slice(-1)[0].name,i=this.parent.resourceCollection.length-1,n=this.parent.resourceCollection.slice(-1)[0].field,r=e[n]instanceof Array?e[n][0]:e[n],a=this.parent.resourceCollection.filter(function(e,n){return e.name===t?(i=n,e):null})[0];if(i>0){var s=this.parent.resourceCollection[i-1].field;return this.parent.resourceBase.getIndexFromResourceId(r,t,a,e,s)}return this.parent.resourceBase.getIndexFromResourceId(r,t,a)},e.prototype.isAllDayAppointment=function(e){var t=this.parent.eventFields,i=e[t.isAllDay],n=(e[t.endTime].getTime()-e[t.startTime].getTime())/Ne>=1;return!(!i&&!n)},e.prototype.addEventListener=function(){this.parent.on("document-click",this.appointmentBorderRemove,this)},e.prototype.appointmentBorderRemove=function(e){var i=e.event.target;t.closest(i,".e-appointment")?"MonthAgenda"!==this.parent.currentView&&this.parent.removeSelectedClass():t.closest(i,"."+Ge)||this.removeSelectedAppointmentClass()},e.prototype.wireAppointmentEvents=function(e,i,n){void 0===n&&(n=!1);var r=!t.isNullOrUndefined(i)&&i[this.parent.eventFields.isReadonly];t.EventHandler.add(e,"click",this.eventClick,this),this.parent.isAdaptive||t.EventHandler.add(e,"touchstart",this.eventTouchClick,this),this.parent.isAdaptive||this.parent.activeViewOptions.readonly||r||t.EventHandler.add(e,"dblclick",this.eventDoubleClick,this),this.parent.activeViewOptions.readonly||r||n||(this.parent.resizeModule&&this.parent.resizeModule.wireResizeEvent(e),this.parent.dragAndDropModule&&this.parent.dragAndDropModule.wireDragEvent(e))},e.prototype.eventTouchClick=function(e){var t=this;setTimeout(function(){return t.isDoubleTapped=!1},250),e.preventDefault(),this.isDoubleTapped?this.eventDoubleClick(e):this.isDoubleTapped||(this.isDoubleTapped=!0,this.eventClick(e))},e.prototype.renderResizeHandler=function(e,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=t.createElement("div",{className:"e-event-resize"});switch(s){case"isLeft":i.isLeft||(o.appendChild(t.createElement("div",{className:"e-left-right-resize"})),t.addClass([o],this.parent.enableRtl?"e-right-handler":"e-left-handler"),t.prepend([o],e));break;case"isRight":i.isRight||(o.appendChild(t.createElement("div",{className:"e-left-right-resize"})),t.addClass([o],this.parent.enableRtl?"e-left-handler":"e-right-handler"),t.append([o],e));break;case"isTop":i.isTop||(o.appendChild(t.createElement("div",{className:"e-top-bottom-resize"})),t.addClass([o],"e-top-handler"),t.prepend([o],e));break;case"isBottom":i.isBottom||(o.appendChild(t.createElement("div",{className:"e-top-bottom-resize"})),t.addClass([o],"e-bottom-handler"),t.append([o],e))}}},e.prototype.eventClick=function(e){var i=this,n=e.target;if(!n.classList.contains("e-drag-clone")&&!n.classList.contains("e-resize-clone"))if(e.ctrlKey&&1===e.which&&this.parent.keyboardInteractionModule){this.parent.quickPopup.quickPopup.hide(),this.parent.selectedElements=[].slice.call(this.parent.element.querySelectorAll(".e-appointment-border"));var r=t.closest(e.target,".e-appointment");this.getSelectedEventElements(r),this.activeEventData(e,!1);var a={data:this.parent.activeEventData.event,element:this.parent.activeEventData.element,event:e,requestType:"eventSelect"};this.parent.trigger("select",a);o=t.extend(this.parent.activeEventData,{cancel:!1,originalEvent:e});this.parent.trigger("eventClick",o)}else{this.removeSelectedAppointmentClass(),this.activeEventData(e,!0);var s={data:this.parent.activeEventData.event,element:this.parent.activeEventData.element,event:e,requestType:"eventSelect"};this.parent.trigger("select",s);var o=t.extend(this.parent.activeEventData,{cancel:!1,originalEvent:e});this.parent.trigger("eventClick",o,function(e){if(t.isBlazor()){var n=i.parent.eventFields,r=e.event;r[n.startTime]=i.parent.getDateTime(r[n.startTime]),r[n.endTime]=i.parent.getDateTime(r[n.endTime]),e.element&&(e.element=t.getElement(e.element))}if(e.cancel)i.removeSelectedAppointmentClass(),i.parent.quickPopup&&i.parent.quickPopup.quickPopupHide();else if("Agenda"!==i.parent.currentView&&"MonthAgenda"!==i.parent.currentView||t.addClass([i.parent.activeEventData.element],"e-active-appointment-agenda"),i.parent.allowInline){var a={data:e.event,element:e.element,type:"Event"};i.parent.notify(Ie,a)}else i.parent.notify("eventClick",e)})}},e.prototype.eventDoubleClick=function(e){this.parent.quickPopup.quickPopupHide(!0),"touchstart"===e.type&&this.activeEventData(e,!0),this.removeSelectedAppointmentClass(),this.parent.activeEventData.element.classList.contains("e-inline-appointment")||this.parent.activeEventData.element.querySelector(".e-inline-subject")||(!t.isNullOrUndefined(this.parent.activeEventData.event)&&t.isNullOrUndefined(this.parent.activeEventData.event[this.parent.eventFields.recurrenceID])?this.parent.eventWindow.openEditor(this.parent.activeEventData.event,"Save"):(this.parent.currentAction="EditOccurrence",this.parent.quickPopup.openRecurrenceAlert()))},e.prototype.getEventByGuid=function(e){return this.parent.eventsProcessed.filter(function(t){return t.Guid===e})[0]},e.prototype.getEventById=function(e){var t=this;return this.parent.eventsData.filter(function(i){return i[t.parent.eventFields.id]===e})[0]},e.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)})},e.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"},e.prototype.getEventMaxID=function(e){var i=this;if(this.parent.eventsData.length<1&&this.parent.blockData.length<1)return 1;var n,r=this.getEventIDType();if("string"===r&&(n=this.generateGuid()),"number"===r){var a=this.parent.eventsData.concat(this.parent.blockData),s=Math.max.apply(Math,a.map(function(e){return e[i.parent.eventFields.id]}));n=(s=t.isNullOrUndefined(e)?s:s+e)+1}return n},e.prototype.activeEventData=function(e,i){var n=this,r=t.closest(e.target,".e-appointment"),a=r.getAttribute("data-guid");i&&(this.addSelectedAppointments([].slice.call(this.parent.element.querySelectorAll('div[data-guid="'+a+'"]'))),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}},e.prototype.generateOccurrence=function(e,i,n,r){var a=e[this.parent.eventFields.startTime],s=e[this.parent.eventFields.endTime],o=e[this.parent.eventFields.recurrenceRule],l=s.getTime()-a.getTime();i=new Date((i||this.parent.activeView.startDate()).getTime()-l);var c,p=e[this.parent.eventFields.recurrenceException];"Agenda"!==this.parent.currentView&&r&&(c=D(this.parent.activeView.startDate(),this.parent.activeView.endDate())+1);var d=this.parent.timezone||this.parent.tzModule.getLocalTimezoneName(),h=B(a,o,p,this.parent.activeViewOptions.firstDayOfWeek,c,i,this.parent.calendarMode,n,d);"Agenda"===this.parent.currentView&&-1===o.indexOf("COUNT")&&-1===o.indexOf("UNTIL")&&(t.isNullOrUndefined(e.generatedDates)?e.generatedDates={start:new Date(h[0]),end:new Date(h[h.length-1])}:(h[0]<e.generatedDates.start.getTime()&&(e.generatedDates.start=new Date(h[0])),h[h.length-1]>e.generatedDates.end.getTime()&&(e.generatedDates.end=new Date(h[h.length-1]))));for(var u=[],v=0,m=h;v<m.length;v++){var g=m[v],f=t.extend({},e,null,!0);f[this.parent.eventFields.startTime]=new Date(g),f[this.parent.eventFields.endTime]=new Date(new Date(g).setMilliseconds(l)),f[this.parent.eventFields.recurrenceID]=f[this.parent.eventFields.id],delete f[this.parent.eventFields.recurrenceException],delete f[this.parent.eventFields.followingID],f.Guid=this.generateGuid(),u.push(f)}return u},e.prototype.getParentEvent=function(e,i){void 0===i&&(i=!1);var n;do{(e=this.getFollowingEvent(e))&&(n=t.extend({},e,null,!0))}while(e&&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},e.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},e.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()},e.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()},e.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]})},e.prototype.getOccurrencesByID=function(e){for(var i=this.parent.eventFields,n=[],r=0,a=this.parent.eventsData.filter(function(t){return t[i.id]===e});r<a.length;r++){var s=a[r];t.isNullOrUndefined(s[i.recurrenceRule])||(n=n.concat(this.generateOccurrence(s)))}return n},e.prototype.getOccurrencesByRange=function(e,i){for(var n=this.parent.eventFields,r=[],a=0,s=this.parent.eventsData;a<s.length;a++){var o=s[a];t.isNullOrUndefined(o[n.recurrenceRule])||(r=r.concat(this.generateOccurrence(o)))}return r.filter(function(r){return r[n.startTime]>=e&&r[n.endTime]<=i&&!t.isNullOrUndefined(r[n.recurrenceID])})},e.prototype.getDeletedOccurrences=function(e){var i,n=this.parent.eventFields,r=[];if((i="string"==typeof e||"number"==typeof e?this.parent.eventsData.filter(function(t){return t[n.id]===e})[0]:t.extend({},e,null,!0))[n.recurrenceException])for(var a=i[n.recurrenceException].split(","),s=this,o=0,l=a.length;o<l;o++)!function(o,l){if(0===s.parent.eventsData.filter(function(e){return e[n.recurrenceID]===i[n.id]&&e[n.recurrenceException]===a[o]}).length){var c=N(a[o]),p=t.extend({},e,null,!0);p[n.recurrenceID]=i[n.id],delete p[n.followingID],p[n.recurrenceException]=a[o];var d=new Date(c.getTime()),h=i[n.endTime].getTime()-i[n.startTime].getTime(),u=new Date(d.getTime());u.setMilliseconds(h),p[n.startTime]=new Date(d.getTime()),p[n.endTime]=new Date(u.getTime()),r.push(p)}}(o);return r},e.prototype.applyResourceColor=function(e,i,n,r,a){if(this.parent.resourceBase){var s=this.parent.resourceBase.getResourceColor(i,r);s&&(e.style[n]=t.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))}},e.prototype.createBlockAppointmentElement=function(e,i){var n,r=e[this.parent.eventFields.subject]||this.parent.eventSettings.fields.subject.default,a=t.createElement("div",{className:"e-block-appointment",attrs:{"data-id":"Appointment_"+e[this.parent.eventFields.id],"aria-readonly":"true","aria-selected":"false"}});if(t.isNullOrUndefined(this.parent.activeViewOptions.eventTemplate))n=[t.createElement("div",{className:"e-subject",innerHTML:r})];else{var s=this.parent.element.id+"_"+this.parent.activeViewOptions.eventTemplateName+"eventTemplate",o=j(e,this.parent.eventFields);n=this.parent.getAppointmentTemplate()(o,this.parent,"eventTemplate",s,!1)}return t.append(n,a),this.setWrapperAttributes(a,i),a},e.prototype.setWrapperAttributes=function(e,i){t.isNullOrUndefined(this.cssClass)||t.addClass([e],this.cssClass),this.parent.activeViewOptions.group.resources.length>0&&e.setAttribute("data-group-index",i.toString())},e.prototype.getReadonlyAttribute=function(e){return(e[this.parent.eventFields.isReadonly]||this.parent.readonly).toString()},e.prototype.isBlockRange=function(e){for(var i=e instanceof Array?e:[e],n=!1,r=this.parent.eventFields,a=0,s=i;a<s.length;a++){var o=s[a],l=[];t.isNullOrUndefined(o[r.recurrenceRule])||!t.isNullOrUndefined(o[r.recurrenceID])&&o[r.id]!==o[r.recurrenceID]?l.push(o):l=this.generateOccurrence(o);for(var c=0,p=l;c<p.length;c++){var d=p[c];if(this.filterBlockEvents(d).length>0){n=!0;break}}}return this.parent.uiStateValues.isBlock=n,n},e.prototype.getFilterEventsList=function(e,t){return new a.DataManager(e).executeLocal((new a.Query).where(t))},e.prototype.getSeriesEvents=function(e,i){var n=this.parent.eventFields;i=t.isNullOrUndefined(i)?e[n.startTime]:i;var r,s,o,l=[],c=e[n.id],p=e[n.followingID],d="EditSeries"===this.parent.currentAction?"greaterthan":"greaterthanorequal";do{o=new a.Predicate(n.followingID,"equal",c).and(new a.Predicate(n.startTime,d,i)),r=(s=this.getFilterEventsList(this.parent.eventsData,o)).slice(-1)[0],t.isNullOrUndefined(r)||r[n.id]===p?p=null:(l.push(r),c=r[n.id],p=r[n.followingID])}while(1===s.length&&!t.isNullOrUndefined(r[n.followingID]));return l},e.prototype.getEditedOccurrences=function(e,t){for(var i,n=this.parent.eventFields,r=[],s=0,o=e;s<o.length;s++){var l=o[s],c=new a.Predicate(n.recurrenceID,"equal",l[n.id]).or(new a.Predicate(n.recurrenceID,"equal",l[n.followingID]).and(new a.Predicate(n.recurrenceID,"notequal",void 0)).and(new a.Predicate(n.recurrenceID,"notequal",null)));"EditFollowingEvents"!==this.parent.currentAction&&"DeleteFollowingEvents"!==this.parent.currentAction||(c=c.and(new a.Predicate(n.startTime,"greaterthanorequal",t))),i=this.getFilterEventsList(this.parent.eventsData,c),r=r.concat(i)}return r},e.prototype.getRenderedDates=function(e){var t,i=0,n=e.length;if(e[0]<this.parent.minDate&&e[e.length-1]>this.parent.maxDate){for(var r=0;r<e.length;r++)e[r].getTime()===this.parent.minDate.getTime()&&(i=r),e[r].getTime()===this.parent.maxDate.getTime()&&(n=r);t=e.filter(function(t){return t>=e[i]&&t<=e[n]})}return t},e.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},e}(),St=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])})(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)}}(),xt=function(e){function i(i){var n=e.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.parent.activeView.getStartHour(),n.endHour=n.parent.activeView.getEndHour(),n.element=n.parent.activeView.getPanel(),n.fields=n.parent.eventFields,n.animation=new t.Animation({progress:n.animationUiUpdate.bind(n)}),n.addEventListener(),n}return St(i,e),i.prototype.renderAppointments=function(){for(var e=[].slice.call(this.parent.element.querySelectorAll(".e-block-appointment,.e-appointment,.e-row-count-wrapper")),i=!(!this.parent.crudModule||!this.parent.crudModule.crudObj.isCrudAction),n=0,r=e;n<r.length;n++){var a=r[n];if(!i||a.classList.contains("e-all-day-appointment")||a.classList.contains("e-row-count-wrapper"))t.remove(a);else for(var s=parseInt(a.getAttribute("data-group-index"),10),o=0,l=this.parent.crudModule.crudObj.sourceEvent.length;o<l;o++)s!==this.parent.crudModule.crudObj.sourceEvent[o].groupIndex&&s!==this.parent.crudModule.crudObj.targetEvent[o].groupIndex||t.remove(a)}if(this.element.querySelector(".e-work-cells")&&(this.allDayElement=[].slice.call(this.element.querySelectorAll(".e-all-day-cells")),this.setAllDayRowHeight(0),0!==this.parent.eventsProcessed.length||0!==this.parent.blockProcessed.length)){var c=this.element.querySelector(".e-all-day-appointment-section");t.EventHandler.remove(c,"click",this.rowExpandCollapse),t.EventHandler.add(c,"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)}),t.removeClass(this.allDayElement,"e-animate"),this.slots.push(this.parent.activeView.renderDates.map(function(e){return+e})),this.renderEvents("allDayEvents")),this.parent.notify(Le,{}),t.addClass(this.allDayElement,"e-animate"),i&&(this.parent.crudModule.crudObj.isCrudAction=!1)}},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.cellHeight=parseFloat(this.element.querySelector(".e-content-wrap tbody tr").getBoundingClientRect().height.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[e]=this.resources[e].renderDates},i.prototype.getHeight=function(e,t){var i=(t.getTime()-e.getTime())/6e4*(this.cellHeight*this.slotCount)/this.interval;return i=i<=0?this.cellHeight:i},i.prototype.appendEvent=function(e,i,n,r){var a=[].slice.call(this.element.querySelectorAll(".e-appointment-wrapper"));this.parent.enableRtl?t.setStyleAttribute(i,{right:r}):t.setStyleAttribute(i,{left:r});var s=i.classList.contains("e-block-appointment")?"blockEvent":"event",o={data:t.extend({},e,null,!0),element:i,cancel:!1,type:s};this.parent.trigger("eventRendered",o,function(e){e.cancel||a[n].appendChild(i)})},i.prototype.processBlockEvents=function(){for(var e=0,t=0,i=this.getResourceList();t<i.length;t++)for(var n=i[t],r=this.dateRender[n],a=0,s=r.length;a<s;a++){for(var o=new Date(r[a].getTime()),l=b(r[a],1),c=0,p=this.filterEvents(o,l,this.parent.blockProcessed,this.resources[n]);c<p.length;c++){var d=p[c];this.parent.resourceBase&&this.setValues(d,n),this.renderBlockEvents(d,a,n,e),this.cssClass=null,this.groupOrder=null}e+=1}},i.prototype.renderBlockEvents=function(e,i,n,r){var a=this.isSpannedEvent(e,i,n),s=a[this.fields.startTime],o=a[this.fields.endTime],l=O(T(new Date(this.dateRender[n][i].getTime())),this.startHour,this.endHour);if(s<=o&&this.isValidEvent(e,s,o,l)){var c=void 0,p=void 0;if(a[this.fields.isAllDay]){var d=this.parent.element.querySelector(".e-content-wrap table");p=t.formatUnit(d.offsetHeight),c=t.formatUnit(0)}else p=t.formatUnit(this.getHeight(s,o)),c=t.formatUnit(this.getTopValue(s,i,n));var h=this.createBlockAppointmentElement(e,n);t.setStyleAttribute(h,{width:"100%",height:p,top:c});var u=this.parent.activeViewOptions.group.byDate?this.resources.length*i+n:r;this.appendEvent(e,h,u,"0px")}},i.prototype.renderEvents=function(e){t.removeClass(this.allDayElement,"e-animate");for(var i,n="allDayEvents"===e?this.sortByDateTime(this.allDayEvents):void 0,r=0,a=this,s=0,o=this.getResourceList();s<o.length;s++)!function(s){i=!0,a.parent.crudModule&&a.parent.crudModule.crudObj.isCrudAction&&"allDayEvents"!==e&&0===a.parent.crudModule.crudObj.sourceEvent.filter(function(e){return e.groupIndex===s}).length&&0===a.parent.crudModule.crudObj.targetEvent.filter(function(e){return e.groupIndex===s}).length&&(i=!1),a.slots=[];var o=a.dateRender[s],l=a.getRenderedDates(o)||o;a.slots.push(o.map(function(e){return+e}));for(var c=0,p=o.length;c<p&&o[c]<=l[l.length-1];c++){a.renderedEvents=[];var d=new Date(o[c].getTime()),h=b(o[c],1),u=a.filterEvents(d,h,n,a.resources[s]);if(i)for(var v=0,m=u;v<m.length;v++){var g=m[v];if(a.parent.resourceBase&&a.setValues(g,s),"allDayEvents"===e)a.renderAllDayEvents(g,c,s,r);else if(a.isAllDayAppointment(g))a.allDayEvents.push(t.extend({},g,null,!0));else{if(a.parent.eventSettings.enableMaxHeight&&a.getOverlapIndex(g,c,!1,s)>0)continue;a.renderNormalEvents(g,c,s,r)}a.cssClass=null,a.groupOrder=null}else for(var f=0,y=u;f<y.length;f++){var T=y[f];a.isAllDayAppointment(T)&&a.allDayEvents.push(t.extend({},T,null,!0))}r+=1}}(o[s])},i.prototype.setValues=function(e,t){this.parent.activeViewOptions.group.resources.length>0?(this.cssClass=this.resources[t].cssClass,this.groupOrder=this.resources[t].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(e,i,n,r){var a=this.parent.eventFields,s=e[a.subject]||this.parent.eventSettings.fields.subject.default,o=t.createElement("div",{className:"e-appointment",attrs:{"data-id":"Appointment_"+e[a.id],"data-guid":e.Guid,role:"button",tabindex:"0","aria-readonly":this.parent.eventBase.getReadonlyAttribute(e),"aria-selected":"false","aria-grabbed":"true","aria-label":this.parent.getAnnocementString(e)}});e[this.fields.isReadonly]&&t.addClass([o],"e-read-only");var l=t.createElement("div",{className:"e-appointment-details"});if(o.appendChild(l),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 p,d=n;if(t.isNullOrUndefined(this.parent.activeViewOptions.eventTemplate)){var h=t.createElement("div",{className:"e-subject",innerHTML:s});if(i)if(e[a.isAllDay])p=[h];else{p=[];var u=t.createElement("div",{className:"e-time"+(this.parent.isAdaptive?" e-disable":""),innerHTML:this.parent.getTimeString(e[a.startTime])}),v=t.createElement("div",{className:"e-time"+(this.parent.isAdaptive?" e-disable":""),innerHTML:this.parent.getTimeString(e[a.endTime])});t.addClass([h],"e-text-center"),d.isLeft||p.push(u),p.push(h),d.isRight||p.push(v)}else{var m=this.parent.getTimeString(e[a.startTime])+" - "+this.parent.getTimeString(e[a.endTime]);p=[h,t.createElement("div",{className:"e-time"+(this.parent.isAdaptive?" e-disable":""),innerHTML:m}),t.createElement("div",{className:"e-location",innerHTML:e[a.location]||this.parent.eventSettings.fields.location.default||""})]}}else{var g=this.parent.element.id+"_"+this.parent.activeViewOptions.eventTemplateName+"eventTemplate",f=j(e,this.parent.eventFields);p=this.parent.getAppointmentTemplate()(f,this.parent,"eventTemplate",g,!1)}if(t.append(p,l),!(this.parent.isAdaptive||t.isNullOrUndefined(e[a.recurrenceRule])&&t.isNullOrUndefined(e[a.recurrenceID]))){var y=e[a.id]===e[a.recurrenceID]?"e-recurrence-icon":"e-recurrence-edit-icon",T=t.createElement("div",{className:ze+" "+y});i?l.appendChild(T):o.appendChild(T)}return this.renderSpannedIcon(i?l:o,d),t.isNullOrUndefined(this.cssClass)||t.addClass([o],this.cssClass),this.applyResourceColor(o,e,"backgroundColor",this.groupOrder),this.renderResizeHandler(o,d,e[this.fields.isReadonly]),o},i.prototype.createMoreIndicator=function(e,i,n){var r=n+i,a=e[r];if(a.childElementCount<=0){var s=t.createElement("div",{className:"e-row-count-wrapper",id:"e-row-count-wrapper-"+r.toString()}),o=t.createElement("div",{className:"e-more-indicator",attrs:{tabindex:"0",role:"list","data-index":r.toString(),"data-count":"1"},innerHTML:"+1&nbsp;"+(this.parent.isAdaptive?"":this.parent.localeObj.getConstant("more"))});s.appendChild(o),a.appendChild(s),t.EventHandler.add(o,"click",this.rowExpandCollapse,this)}else{var l=a.querySelector(".e-more-indicator"),c=parseInt(l.getAttribute("data-count"),10)+1;l.setAttribute("data-count",c.toString()),l.innerHTML="+"+c+"&nbsp;"+(this.parent.isAdaptive?"":this.parent.localeObj.getConstant("more"))}},i.prototype.renderSpannedIcon=function(e,i){var n=t.createElement("div",{className:"e-indicator "+ze});if(i.isLeft){var r=n.cloneNode();t.addClass([r],"e-left-icon"),t.prepend([r],e)}if(i.isRight){var a=n.cloneNode();t.addClass([a],"e-right-icon"),t.append([a],e)}if(i.isTop){var s=n.cloneNode();t.addClass([s],"e-up-icon"),t.prepend([s],e)}if(i.isBottom){var o=n.cloneNode();t.addClass([o],"e-down-icon"),t.append([o],e)}},i.prototype.isSpannedEvent=function(e,i,n){var r=T(this.dateRender[n][i]),a=this.getRenderedDates(this.dateRender[n])||[r];0===a.filter(function(e){return e.getDay()===i}).length&&(r=T(a[0]));var s=this.parent.eventFields,o=O(r,this.startHour,this.endHour),l=t.extend({},e,null,!0);return l.isSpanned={isBottom:!1,isTop:!1},e[s.startTime].getTime()<o.startHour.getTime()&&(l[s.startTime]=o.startHour,l.isSpanned.isTop=!0),e[s.endTime].getTime()>o.endHour.getTime()&&(l[s.endTime]=o.endHour,l.isSpanned.isBottom=!0),l},i.prototype.renderAllDayEvents=function(e,i,n,r,a){var s=this,o=this.getRenderedDates(this.dateRender[n])||this.dateRender[n];this.parent.activeViewOptions.group.byDate&&(this.slots[0]=[this.dateRender[n][i].getTime()],o=[this.dateRender[n][i]]);var l=this.splitEvent(e,o)[0],c=this.element.querySelector(".e-all-day-cells:first-child"),p=c.offsetTop,d=new Date(l[this.parent.eventFields.startTime].getTime()),h=new Date(l[this.parent.eventFields.endTime].getTime()),u=0,v=1,m=o[0].getTime()<=d.getTime()&&b(o.slice(-1)[0],1).getTime()>=d.getTime();if(d<=h&&m){var g=[];if(this.renderedAllDayEvents[n]&&(g=this.renderedAllDayEvents[n].filter(function(t){return t.Guid===e.Guid}),this.parent.activeViewOptions.group.byDate&&(g=g.filter(function(e){return e[s.parent.eventFields.startTime]>=o[i]&&e[s.parent.eventFields.endTime]<=b(new Date(+o[i]),1)}))),0===g.length){var f=l.data.count,y=this.getOverlapIndex(l,i,!0,n);l.Index=y,this.allDayLevel=this.allDayLevel<y?y:this.allDayLevel;var T=l.data.isRight?0:"Day"===this.parent.currentView?4:7;f>=0&&(u=100*f-T),t.isNullOrUndefined(this.renderedAllDayEvents[n])&&(this.renderedAllDayEvents[n]=[]),this.renderedAllDayEvents[n].push(t.extend({},l,null,!0));var w,D=[].slice.call(this.element.querySelector(".e-all-day-row").children),C=this.parent.activeViewOptions.group.byDate?this.resources.length*i+n:r,E=this.element.querySelector(".e-all-day-appointment-wrapper:nth-child("+(C+1)+")");w=a?this.parent.inlineModule.createInlineAppointmentElement(e):this.createAppointmentElement(e,!0,l.data,n),t.addClass([w],"e-all-day-appointment");var O={data:e,element:w,cancel:!1};this.parent.trigger("eventRendered",O,function(i){if(!i.cancel){E.appendChild(w);var n=w.offsetHeight;if(v+=(0===y?p:p+y*n)+1,t.setStyleAttribute(w,{width:u+"%",top:t.formatUnit(v)}),y>1){s.moreEvents.push(w);for(var r=0,a=f;r<a;r++)s.createMoreIndicator(D,r,C)}c.setAttribute("data-count",s.allDayLevel.toString());var o=4+(!s.parent.uiStateValues.expand&&s.allDayLevel>2?3*n:(s.allDayLevel+1)*n);s.setAllDayRowHeight(o),s.addOrRemoveClass(),s.wireAppointmentEvents(w,e)}})}}},i.prototype.renderNormalEvents=function(e,i,n,r,a){var s=this.isSpannedEvent(e,i,n),o=s[this.fields.startTime],l=s[this.fields.endTime],c="0%",p=0,d=O(T(new Date(this.dateRender[n][i].getTime())),this.startHour,this.endHour),h=this.isValidEvent(e,o,l,d);if(o<=l&&h){var u=this.getHeight(o,l);o.getTime()>d.startHour.getTime()&&(p=this.getTopValue(o,i,n));var v=this.getOverlapIndex(s,i,!1,n);s.Index=v,this.overlapList.push(s),this.overlapList.length>1?(t.isNullOrUndefined(this.overlapEvents[v])&&(this.overlapEvents[v]=[]),this.overlapEvents[v].push(s)):(this.overlapEvents=[],this.overlapEvents.push([s]));var m={index:v,left:"0%",width:c=this.getEventWidth(),day:i,dayIndex:r,record:s,resource:n},g=this.adjustOverlapElements(m);c=g.appWidth,t.isNullOrUndefined(this.renderedEvents[n])&&(this.renderedEvents[n]=[]),this.renderedEvents[n].push(t.extend({},s,null,!0));var f=void 0;f=a?this.parent.inlineModule.createInlineAppointmentElement(e):this.createAppointmentElement(e,!1,s.isSpanned,n),t.setStyleAttribute(f,{width:this.parent.eventSettings.enableMaxHeight?"100%":g.appWidth,height:u+"px",top:p+"px"});var y=u-40-15*f.querySelectorAll(".e-indicator").length,w=f.querySelector(".e-subject");!this.parent.isAdaptive&&w&&(w.style.maxHeight=t.formatUnit(y));var D=this.parent.activeViewOptions.group.byDate?this.resources.length*i+n:r;this.appendEvent(e,f,D,g.appLeft),this.wireAppointmentEvents(f,e)}},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.getTopValue=function(e,t,i){var n=O(T(this.dateRender[i][t]),this.startHour,this.endHour).startHour;return(60*(e.getHours()-n.getHours())+(e.getMinutes()-n.getMinutes()))*this.cellHeight*this.slotCount/this.interval},i.prototype.getOverlapIndex=function(e,i,n,r){var a=this,s=this.parent.eventFields,o=[],l=-1;if(this.overlapEvents=[],n){if(!t.isNullOrUndefined(this.renderedAllDayEvents[r])){var c=T(new Date(this.dateRender[r][i].getTime()));o=this.renderedAllDayEvents[r].filter(function(e){return T(e[s.startTime]).getTime()<=c.getTime()&&T(e[s.endTime]).getTime()>=c.getTime()}),this.parent.activeViewOptions.group.resources.length>0&&(o=this.filterEventsByResource(this.resources[r],o))}}else{var p=t.isNullOrUndefined(this.renderedEvents[r])?[]:this.renderedEvents[r],d=[],h=e[s.startTime],u=e[s.endTime];this.overlapList=p.filter(function(e){return e[s.endTime]>h&&e[s.startTime]<u||e[s.startTime]>=u&&e[s.endTime]<=h}),this.parent.activeViewOptions.group.resources.length>0&&(this.overlapList=this.filterEventsByResource(this.resources[r],this.overlapList)),this.overlapList.forEach(function(e){var t=p.filter(function(t){return t[s.endTime]>=e[s.startTime]&&t[s.startTime]<=e[s.endTime]});a.parent.activeViewOptions.group.resources.length>0&&(t=a.filterEventsByResource(a.resources[r],t));var i=a.overlapList.filter(function(e){return-1===t.indexOf(e)});return d.concat(i)}),this.overlapList=this.overlapList.concat(d);for(var v=0,m=o=this.overlapList;v<m.length;v++){var g=m[v],f=g.Index;t.isNullOrUndefined(this.overlapEvents[f])?this.overlapEvents[f]=[g]:this.overlapEvents[f].push(g)}}if(o.length>0){var y=o.map(function(e){return e.Index});l=y.length>0?this.getSmallestMissingNumber(y):0}return-1===l?0:l},i.prototype.adjustOverlapElements=function(e){for(var i={appWidth:e.width,appLeft:e.left},n=0,r=this.overlapEvents.length;n<r;n++)if(!t.isNullOrUndefined(this.overlapEvents[n]))for(var a=0,s=this.overlapEvents[n].length;a<s;a++){var o=this.parent.activeViewOptions.group.byDate?this.resources.length*e.day+e.resource:e.dayIndex,l=this.element.querySelector("#e-appointment-wrapper-"+o);if(l.childElementCount>0){var c=this.overlapEvents[n][a].Guid;if(l.querySelectorAll('div[data-guid="'+c+'"]').length>0&&c!==e.record.Guid){var p=l.querySelector('div[data-guid="'+c+'"]');parseFloat(e.width)<=parseFloat(p.style.width)&&(this.parent.enableRtl?p.style.right=this.getEventLeft(e.width,n):p.style.left=this.getEventLeft(e.width,n),p.style.width=parseFloat(e.width)+"%",i.appWidth=p.style.width)}else{var d=e.width;t.isNullOrUndefined(this.overlapEvents[n-1])&&(d=this.getEventWidth()),i.appWidth=d,i.appLeft=this.getEventLeft(d,e.index)}}}return i},i.prototype.setAllDayRowHeight=function(e){for(var t=0,i=this.allDayElement;t<i.length;t++)i[t].style.height=e/12+"em";this.animation.animate(this.allDayElement[0])},i.prototype.addOrRemoveClass=function(){var e=this;this.moreEvents.filter(function(i){!e.parent.uiStateValues.expand&&e.allDayLevel>2?(t.addClass([i],"e-appointment-hide"),i.setAttribute("tabindex","-1")):(t.removeClass([i],"e-appointment-hide"),i.setAttribute("tabindex","0"))});var i=this.element.querySelector(".e-all-day-appointment-section");this.parent.uiStateValues.expand?(t.removeClass([i],"e-appointment-expand"),t.addClass([i],"e-appointment-collapse")):(t.removeClass([i],"e-appointment-collapse"),t.addClass([i],"e-appointment-expand")),this.allDayLevel>2?t.removeClass([i],"e-disable"):t.addClass([i],"e-disable"),[].slice.call(this.element.querySelectorAll(".e-row-count-wrapper")).filter(function(i){!e.parent.uiStateValues.expand&&e.allDayLevel>2?t.removeClass([i],"e-disable"):t.addClass([i],"e-disable")})},i.prototype.getEventHeight=function(){var e=t.createElement("div",{className:"e-appointment",styles:"visibility:hidden"});this.element.querySelector(".e-all-day-appointment-wrapper:first-child").appendChild(e);var i=e.offsetHeight;return t.remove(e),i},i.prototype.rowExpandCollapse=function(){var e=this.element.querySelector(".e-all-day-appointment-section");this.parent.uiStateValues.expand=e.classList.contains("e-appointment-expand");var t;this.parent.uiStateValues.expand?(e.setAttribute("title","Collapse-all-day-section"),e.setAttribute("aria-label","Collapse section"),t=(this.allDayLevel+1)*this.getEventHeight()+4):(e.setAttribute("title","Expand-all-day-section"),e.setAttribute("aria-label","Expand section"),t=3*this.getEventHeight()+4),this.setAllDayRowHeight(t),this.addOrRemoveClass(),this.animation.animate(e)},i.prototype.animationUiUpdate=function(){this.parent.notify(Le,{})},i}(Ot),kt=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])})(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)}}(),At=function(e){function i(t){var i=e.call(this,t)||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 kt(i,e),i.prototype.removeEventWarapper=function(e){if(e.length>0)for(var i=0,n=e="Month"===this.parent.currentView?e:[e[0]];i<n.length;i++){var r=n[i];!r.classList.contains("e-more-indicator")&&r.parentElement&&r.parentElement.parentNode&&t.remove(r.parentElement)}},i.prototype.renderAppointments=function(){var e=this.parent.element.querySelector(".e-content-wrap");this.parent.rowAutoHeight&&(this.parent.uiStateValues.top=e.scrollTop,this.parent.uiStateValues.left=e.scrollLeft);var i=[].slice.call(this.element.querySelectorAll(".e-appointment-wrapper"));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[n].groupIndex+'"]'));if(this.removeEventWarapper(a),this.parent.crudModule.crudObj.sourceEvent[n].groupIndex!==this.parent.crudModule.crudObj.targetEvent[n].groupIndex){var s=[].slice.call(this.element.querySelectorAll('.e-appointment-wrapper [data-group-index="'+this.parent.crudModule.crudObj.targetEvent[n].groupIndex+'"]'));this.removeEventWarapper(s)}}else for(var o=0,l=i;o<l.length;o++){var c=l[o];t.remove(c)}if(this.removeHeightProperty(Ye),this.element.querySelector(".e-work-cells")){this.eventHeight=d(this.element,"e-appointment");var p=e.scrollTop;if(this.parent.rowAutoHeight&&this.parent.virtualScrollModule&&!t.isNullOrUndefined(this.parent.currentAction)&&(e.scrollTop=e.scrollTop-1),this.parent.activeViewOptions.group.resources.length>0?this.renderResourceEvents():this.renderEventsHandler(this.parent.activeView.renderDates,this.parent.activeViewOptions.workDays),this.parent.rowAutoHeight){this.updateBlockElements();var h={cssProperties:this.parent.getCssProperties(),module:this.parent.getModuleName(),isPreventScrollUpdate:!0,scrollPosition:{left:this.parent.uiStateValues.left,top:this.parent.uiStateValues.top}};this.parent.virtualScrollModule&&(this.parent.currentAction?(e.scrollTop=p,this.parent.currentAction=null):this.parent.virtualScrollModule.updateVirtualScrollHeight()),this.parent.notify(Be,h)}}},i.prototype.renderEventsHandler=function(e,t,i){this.renderedEvents=[];var n,r,a=0;i?(a=i.groupIndex,this.cssClass=i.cssClass,this.groupOrder=i.groupOrder,n=this.parent.eventBase.filterEventsByResource(i,this.parent.eventsProcessed),r=this.parent.eventBase.filterEventsByResource(i,this.parent.blockProcessed),this.workCells=[].slice.call(this.element.querySelectorAll('.e-work-cells[data-group-index="'+a+'"]'))):(n=this.parent.eventsProcessed,r=this.parent.blockProcessed,this.workCells=[].slice.call(this.element.querySelectorAll(".e-work-cells"))),this.sortByDateTime(n),this.sortByDateTime(r);var s=this.workCells.slice(-1)[0].getBoundingClientRect();this.cellWidth=s.width,this.cellHeight=s.height,this.dateRender=e;var o=this.getRenderedDates(e);this.getSlotDates(t),this.processBlockEvents(r,a,i);for(var l=0,c=n;l<c.length;l++){var p=c[l];this.parent.resourceBase&&!i&&(this.cssClass=this.parent.resourceBase.getCssClass(p));for(var d=0,h=this.splitEvent(p,o||this.dateRender);d<h.length;d++){var u=h[d];if(this.maxHeight){var v="Month"===this.parent.currentView?u[this.fields.startTime]:this.getStartTime(u,u.data);if(this.getIndex(v)>0)continue}this.updateIndicatorIcon(u),this.renderEvents(u,a,n)}}this.cssClass=null,this.groupOrder=null},i.prototype.processBlockEvents=function(e,i,n){for(var r=0,a=e;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=t.extend({},s,null,!0),c=this.isSameDate(l[this.fields.startTime],l[this.fields.endTime]);if(l.isBlockIcon=c,!c&&w(l[this.fields.startTime])>0&&((p=t.extend({},s,null,!0))[this.fields.endTime]=b(T(new Date(s[this.fields.startTime]+"")),1),p.isBlockIcon=!0,l[this.fields.startTime]=p[this.fields.endTime],o.push(p)),!(c=this.isSameDate(l[this.fields.startTime],l[this.fields.endTime]))&&w(l[this.fields.endTime])>0){var p=t.extend({},s,null,!0);p[this.fields.startTime]=T(new Date(s[this.fields.endTime]+"")),p.isBlockIcon=!0,o.push(p),l[this.fields.endTime]=p[this.fields.startTime]}o.push(l)}for(var d=0,h=o;d<h.length;d++)for(var u=h[d],v=0,m=this.splitEvent(u,this.dateRender);v<m.length;v++){var g=m[v];this.renderBlockEvents(g,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(e,i,n){var r=e.data,a=this.getStartTime(e,r),s=this.getEndTime(e,r),o=this.parent.getIndexOfDate(this.dateRender,T(new Date(a.getTime())));if(!(o<0||a>s)){var l=this.getCellTd(o),c=this.getPosition(a,s,e[this.fields.isAllDay],o);if(n)this.renderBlockIndicator(l,c,i);else{var p=r.count,d=this.getEventWidth(a,s,e[this.fields.isAllDay],p);d=d<=0?this.cellWidth:d;var h=this.parent.enableRtl?0:c,u=this.parent.enableRtl?c:0;this.renderWrapperElement(l);var v=this.cellHeight-this.monthHeaderHeight,m=this.getRowTop(i),g=this.createBlockAppointmentElement(e,i);t.setStyleAttribute(g,{width:d+"px",height:v+"px",left:h+"px",right:u+"px",top:m+"px"}),this.renderEventElement(e,g,l)}}},i.prototype.renderBlockIndicator=function(e,i,n){var r=t.createElement("div",{className:"e-icons e-block-indicator"});t.isNullOrUndefined(e.querySelector(".e-block-indicator"))&&e.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[e]},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=O(e[this.fields.startTime],this.parent.activeView.getStartHour(),this.parent.activeView.getEndHour()),n=O(e[this.fields.endTime],this.parent.activeView.getStartHour(),this.parent.activeView.getEndHour());t.isLeft=t.isLeft||t[this.fields.startTime].getTime()<i.startHour.getTime(),t.isRight=t.isRight||t[this.fields.endTime].getTime()>n.endHour.getTime()}},i.prototype.renderResourceEvents=function(){var e=this.parent.uiStateValues.isGroupAdaptive?[this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]]:this.parent.resourceBase.lastResourceLevel;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[t];if(this.renderEventsHandler(n.renderDates,n.workDays,n),this.parent.crudModule.crudObj.sourceEvent[t].groupIndex!==this.parent.crudModule.crudObj.targetEvent[t].groupIndex){var r=this.parent.crudModule.crudObj.targetEvent[t];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?7:e.length;t.length>0;)this.slots.push(t.splice(0,i))},i.prototype.createAppointmentElement=function(e,i,n){void 0===n&&(n=!1);var r=e[this.fields.subject]||this.parent.eventSettings.fields.subject.default,a=t.createElement("div",{className:"e-appointment",attrs:{"data-id":"Appointment_"+e[this.fields.id],role:"button",tabindex:"0","aria-readonly":this.parent.eventBase.getReadonlyAttribute(e),"aria-selected":"false","aria-grabbed":"true","aria-label":this.parent.getAnnocementString(e.data,r)}});n||a.setAttribute("data-guid",e.Guid),t.isNullOrUndefined(this.cssClass)||t.addClass([a],this.cssClass),e[this.fields.isReadonly]&&t.addClass([a],"e-read-only");var s=t.createElement("div",{className:"e-appointment-details"});a.appendChild(s),this.parent.activeViewOptions.group.resources.length>0&&a.setAttribute("data-group-index",i.toString());var o,l=e.data,c=this.getEventData(e);if(t.isNullOrUndefined(this.parent.activeViewOptions.eventTemplate)){var p=e[this.fields.location]||this.parent.eventSettings.fields.location.default||"",d=t.createElement("div",{className:"e-subject",innerHTML:r+(p?";&nbsp"+p:"")}),h=t.createElement("div",{className:"e-time"+(this.parent.isAdaptive?" e-disable":""),innerHTML:this.parent.getTimeString(l[this.fields.startTime])}),u=t.createElement("div",{className:"e-time"+(this.parent.isAdaptive?" e-disable":""),innerHTML:this.parent.getTimeString(l[this.fields.endTime])});if("Month"===this.parent.currentView)e[this.fields.isAllDay]?(o=[d],t.addClass([d],"e-text-center")):l.count<=1&&!l.isLeft&&!l.isRight?o=[h,d]:(o=[],t.addClass([d],"e-text-center"),l.isLeft||o.push(h),o.push(d),l.isRight||o.push(u));else{var v=void 0;if(e[this.fields.isAllDay])v=[d,t.createElement("div",{className:"e-time",innerHTML:this.parent.localeObj.getConstant("allDay")})];else{var m=this.parent.getTimeString(l[this.fields.startTime])+" - "+this.parent.getTimeString(l[this.fields.endTime]);v=[d,t.createElement("div",{className:"e-time"+(this.parent.isAdaptive?" e-disable":""),innerHTML:m}),t.createElement("div",{className:"e-location",innerHTML:p})]}var g=t.createElement("div",{className:"e-inner-wrap"});t.append(v,g),o=[g]}}else{var f=this.parent.element.id+"_"+this.parent.activeViewOptions.eventTemplateName+"eventTemplate",y=j(c,this.parent.eventFields);o=this.parent.getAppointmentTemplate()(y,this.parent,"eventTemplate",f,!1)}return t.append(o,s),this.appendEventIcons(e,s),this.renderResizeHandler(a,e.data,e[this.fields.isReadonly]),a},i.prototype.appendEventIcons=function(e,i){var n=e.data;if(!t.isNullOrUndefined(e[this.fields.recurrenceRule])||!t.isNullOrUndefined(e[this.fields.recurrenceID])){var r=e[this.fields.id]===e[this.fields.recurrenceID]?"e-recurrence-icon":"e-recurrence-edit-icon";i.appendChild(t.createElement("div",{className:ze+" "+r+(this.parent.isAdaptive?" e-disable":"")}))}if(n.isLeft){var a=t.createElement("div",{className:"e-indicator e-icons e-left-icon"});t.prepend([a],i)}if(n.isRight){var s=t.createElement("div",{className:"e-indicator e-icons e-right-icon"});t.append([s],i)}},i.prototype.renderEvents=function(e,i,n){var r=e[this.fields.startTime],a=e[this.fields.endTime],s=this.parent.getIndexOfDate(this.dateRender,T(r));if(!(s<0||r.getTime()<this.parent.minDate.getTime()||a.getTime()>this.parent.maxDate.getTime())){var o=this.getIndex(r);e.Index=o;var l=this.eventHeight;this.renderedEvents.push(t.extend({},e,null,!0));var c=e.data.count;if(r.getTime()<=a.getTime()){var p=c*this.cellWidth-5,d=this.workCells[s],h=o*(l+0);this.renderWrapperElement(d);var u=this.monthHeaderHeight+(o+1)*(l+0)+this.moreIndicatorHeight,v=this.maxOrIndicator?o<1:this.cellHeight>u;if(this.parent.rowAutoHeight||v){var m=void 0;if(m=this.inlineValue?this.parent.inlineModule.createInlineAppointmentElement():this.createAppointmentElement(e,i),this.applyResourceColor(m,e,"backgroundColor",this.groupOrder),this.wireAppointmentEvents(m,e),t.setStyleAttribute(m,{width:p+"px",top:h+"px"}),this.renderEventElement(e,m,d),this.parent.rowAutoHeight){var g=d.parentElement.firstElementChild;this.updateCellHeight(g,u)}}else for(var f=0;f<c;f++){var y=this.workCells[s+f];if(y&&t.isNullOrUndefined(y.querySelector(".e-more-indicator"))){var w=new Date(this.dateRender[s+f].getTime()),D=b(this.dateRender[s+f],1),C=y.getAttribute("data-group-index"),E=this.getFilteredEvents(w,D,C),O=this.cellHeight-this.monthHeaderHeight-this.moreIndicatorHeight;l=this.withIndicator?O:l;var S=Math.floor(O/(l+0)),x=E.length-S<=0?1:E.length-S,k=this.getMoreIndicatorElement(x,w,D);t.isNullOrUndefined(C)||k.setAttribute("data-group-index",C),k.style.top=O+"px",k.style.width=y.offsetWidth-2+"px",this.renderElement(y,k),t.EventHandler.add(k,"click",this.moreIndicatorClick,this)}}}}},i.prototype.updateCellHeight=function(e,i){i>e.offsetHeight&&t.setStyleAttribute(e,{height:i+"px"})},i.prototype.updateBlockElements=function(){for(var e=0,i=[].slice.call(this.element.querySelectorAll(".e-block-appointment"));e<i.length;e++){var n=i[e],r=t.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(e,i,n,r){var a;if(t.isNullOrUndefined(n))a=this.filterEvents(e,i);else{var s=this.parent.resourceBase.lastResourceLevel[parseInt(n,10)];a=this.filterEvents(e,i,t.isNullOrUndefined(r)?void 0:r,s)}return a},i.prototype.getOverlapEvents=function(e,t){for(var i=[],n=0,r=t;n<r.length;n++){var a=r[n];T(a[this.fields.startTime]).getTime()<=T(e).getTime()&&T(a[this.fields.endTime]).getTime()>=T(e).getTime()&&i.push(a)}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(e){var i=this,n=t.closest(e.target,".e-more-indicator"),r=new Date(parseInt(n.getAttribute("data-start-date"),10)),a=new Date(parseInt(n.getAttribute("data-end-date"),10)),s=n.getAttribute("data-group-index"),o={cancel:!1,event:e,element:n,isPopupOpen:!0,startTime:r,endTime:a,viewName:this.parent.getNavigateView()};s&&(o.groupIndex=parseInt(s,10)),this.parent.trigger("moreEventsClick",o,function(n){if(t.isBlazor()&&(n.startTime=new Date(""+n.startTime),n.endTime=new Date(""+n.endTime),n.element=t.getElement(n.element)),!n.cancel)if(n.isPopupOpen){var o=i.getFilteredEvents(r,a,s),l={date:r,event:o,element:e.target};i.parent.quickPopup.moreEventClick(l,a,s)}else i.parent.setScheduleProperties({selectedDate:r}),i.parent.changeView(n.viewName,e)})},i.prototype.renderEventElement=function(e,t,i){var n=this,r=t.classList.contains("e-block-appointment")?"blockEvent":"event",a=t.classList.contains("e-appointment"),s={data:this.getEventData(e),element:t,cancel:!1,type:r};this.parent.trigger("eventRendered",s,function(e){e.cancel?n.renderedEvents.pop():n.renderElement(i,t,a)})},i.prototype.getEventData=function(e){var i=t.extend({},e,null,!0);return i[this.fields.startTime]=e.data[this.fields.startTime],i[this.fields.endTime]=e.data[this.fields.endTime],i},i.prototype.renderElement=function(e,i,n){if(void 0===n&&(n=!1),this.maxOrIndicator&&n&&this.setMaxEventHeight(i,e),e.querySelector(".e-appointment-wrapper"))e.querySelector(".e-appointment-wrapper").appendChild(i);else{var r=t.createElement("div",{className:"e-appointment-wrapper"});r.appendChild(i),e.appendChild(r)}},i.prototype.renderWrapperElement=function(e){var i=e.querySelector(".e-appointment-wrapper");if(t.isNullOrUndefined(i)){var n=t.createElement("div",{className:"e-appointment-wrapper"});e.appendChild(n),this.monthHeaderHeight=n.offsetTop-e.offsetTop}else this.monthHeaderHeight=i.offsetTop-e.offsetTop},i.prototype.getMoreIndicatorElement=function(e,i,n){return t.createElement("div",{className:"e-more-indicator",innerHTML:"+"+e+"&nbsp;"+(this.parent.isAdaptive?"":this.parent.localeObj.getConstant("more")),attrs:{tabindex:"0","data-start-date":i.getTime().toString(),"data-end-date":n.getTime().toString(),role:"list"}})},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(e,i){var n=M(i.querySelector(".e-date-header")),r=i.offsetHeight-n-(this.maxHeight?0:this.moreIndicatorHeight);t.setStyleAttribute(e,{height:r+"px","align-items":"center"})},i}(Ot),Vt=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])})(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)}}(),Mt=function(e){function i(t,i){var n=e.call(this,t)||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.renderType=i,n.eventContainers=[].slice.call(n.element.querySelectorAll("."+Xe));var r=[].slice.call(n.element.querySelectorAll("."+Ye+" tbody tr"));return n.dayLength=0===r.length?0:r[0].children.length,n.content=n.parent.element.querySelector("."+Ye),n}return Vt(i,e),i.prototype.getSlotDates=function(){this.slots=[],this.slots.push(this.parent.activeView.renderDates.map(function(e){return+e})),this.parent.headerRows.length>0&&"Hour"!==this.parent.headerRows[this.parent.headerRows.length-1].option?(this.renderType="day",this.cellWidth=this.content.offsetWidth/this.dateRender.length,this.slotsPerDay=1):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++)T((o=r[n])[this.fields.startTime]).getTime()<=T(new Date(e.getTime())).getTime()&&T(o[this.fields.endTime]).getTime()>=T(new Date(e.getTime())).getTime()&&i.push(o);else for(var a=0,s=t;a<s.length;a++){var o=s[a],l=o.data;l.trimStartTime.getTime()<=e.getTime()&&l.trimEndTime.getTime()>e.getTime()&&i.push(o)}return i},i.prototype.renderResourceEvents=function(){this.removeHeightProperty("e-resource-column-table");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[t];if(this.rowIndex=n.groupIndex,this.renderEventsHandler(this.parent.activeView.renderDates,this.parent.activeViewOptions.workDays,n),this.parent.crudModule.crudObj.sourceEvent[t].groupIndex!==this.parent.crudModule.crudObj.targetEvent[t].groupIndex){var r=this.parent.crudModule.crudObj.targetEvent[t];this.rowIndex=r.groupIndex,this.renderEventsHandler(this.parent.activeView.renderDates,this.parent.activeViewOptions.workDays,r)}}this.parent.crudModule.crudObj.isCrudAction=!1}else for(t=0;t<e.length;t++)this.rowIndex=t,this.renderEventsHandler(this.parent.activeView.renderDates,this.parent.activeViewOptions.workDays,e[t])},i.prototype.renderEvents=function(e,i,n){var r=e[this.fields.startTime],a=e[this.fields.endTime];if(!(r.getTime()<this.parent.minDate.getTime()||a.getTime()>this.parent.maxDate.getTime())){var s=e.data;if(r=this.getStartTime(e,s),a=this.getEndTime(e,s),this.day=this.parent.getIndexOfDate(this.dateRender,T(new Date(r.getTime()))),!(this.day<0)){var o=this.getCellTd(),l=this.getIndex(r);e.Index=l;var c=this.eventHeight,p=s.count,d=t.extend({},e,null,!0);d[this.fields.startTime]=s[this.fields.startTime],d[this.fields.endTime]=s[this.fields.endTime];var h=O(T(new Date(this.dateRender[this.day].getTime())),this.startHour,this.endHour),u=this.isValidEvent(d,r,a,h);if(r<=a&&u){var v=this.getEventWidth(r,a,e[this.fields.isAllDay],p);v="day"===this.renderType?v-2:v;var m=0,g=0,f=this.getPosition(r,a,e[this.fields.isAllDay],this.day);v=v<=0?this.cellWidth:v,this.renderedEvents.push(t.extend({},e,null,!0));var y=this.getRowTop(i),w=y+(this.maxHeight?0:2)+l*(c+2);m=this.parent.enableRtl?0:f,g=this.parent.enableRtl?f:0;var D=(l+1)*(c+2)+this.moreIndicatorHeight,C=this.maxOrIndicator?l<1:this.cellHeight>D;if(this.parent.rowAutoHeight||C){var E=void 0;if(E=t.isNullOrUndefined(this.inlineValue)?this.createAppointmentElement(e,i):this.parent.inlineModule.createInlineAppointmentElement(),this.applyResourceColor(E,e,"backgroundColor",this.groupOrder),t.setStyleAttribute(E,{width:v+"px",left:m+"px",right:g+"px",top:w+"px"}),this.wireAppointmentEvents(E,e),this.renderEventElement(e,E,o),this.parent.rowAutoHeight){var S=this.getFirstChild(i);this.updateCellHeight(S,D)}}else for(var x=0;x<p;x++){var k=o.querySelector(".e-more-indicator"),A=this.parent.enableRtl?g:m;if(A=Math.floor(A/this.cellWidth)*this.cellWidth,o&&t.isNullOrUndefined(k)||!this.isAlreadyAvail(A,o)){var V=this.interval/this.slotCount,M=new Date(this.dateRender[this.day+x].getTime()),R=b(this.dateRender[this.day+x],1),P=new Date(+r),H=new Date(P.setMinutes(Math.floor(P.getMinutes()/V)*V)),j=new Date(H.getTime()+6e4*V),I=void 0;this.parent.activeViewOptions.group.resources.length>0&&!t.isNullOrUndefined(i)&&(I=i.toString());var q=this.getFilterEvents(M,R,H,j,I,n),L=this.cellHeight-this.moreIndicatorHeight;c=this.withIndicator?L-2:c;var B=Math.floor(L/(c+2)),N=q.length-B<=0?1:q.length-B,F=void 0;F="day"===this.renderType?this.getMoreIndicatorElement(N,M,R):this.getMoreIndicatorElement(N,H,j),t.isNullOrUndefined(I)||F.setAttribute("data-group-index",I),F.style.top=y+L+"px",F.style.width=this.cellWidth+"px",F.style.left=Math.floor(m/this.cellWidth)*this.cellWidth+"px",F.style.right=Math.floor(g/this.cellWidth)*this.cellWidth+"px",this.renderElement(o,F),t.EventHandler.add(F,"click",this.moreIndicatorClick,this)}}}}}},i.prototype.updateCellHeight=function(e,i){if(i>e.offsetHeight){if(t.setStyleAttribute(e,{height:i+"px"}),this.parent.activeViewOptions.group.resources.length>0){var n=this.parent.element.querySelector('.e-resource-column-table tbody td[data-group-index="'+e.getAttribute("data-group-index")+'"]');n&&t.setStyleAttribute(n,{height:i+"px"})}var r=this.parent.element.querySelector(".e-month-header-wrapper table tr:nth-child("+(e.parentElement.rowIndex+1)+") td");r&&t.setStyleAttribute(r,{height:i+"px"})}},i.prototype.getFirstChild=function(e){var t="."+Ye+" 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(".e-block-appointment"));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=Math.round(i.offsetWidth/r.offsetWidth);i.style.width=r.offsetWidth*a+"px"}for(var s=0,o=[].slice.call(this.element.querySelectorAll(".e-block-indicator"));s<o.length;s++){var 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=O(i,this.startHour,this.endHour);return i=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=b(e,n),-1!==this.parent.getIndexOfDate(this.dateRender,T(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=O(i,this.startHour,this.endHour);return i=n.endHour.getTime()<=t[this.fields.endTime]?n.endHour:t[this.fields.endTime],t.trimEndTime=e[this.fields.isAllDay]?n.endHour:t[this.fields.endTime],i},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(t.getTime()-e.getTime())/6e4*(this.cellWidth*this.slotCount)/this.interval},i.prototype.getSpannedEventsWidth=function(e,t,i){var n,r,a=i*this.slotsPerDay*this.cellWidth,s=O(T(new Date(e.getTime())),this.startHour,this.endHour);if(n=this.getSameDayEventsWidth(s.startHour,e),-1===this.parent.getIndexOfDate(this.dateRender,T(new Date(t.getTime()))))r=0;else{var o=O(T(new Date(t.getTime())),this.startHour,this.endHour);r=this.getSameDayEventsWidth(t,o.endHour),r=this.slotsPerDay*this.cellWidth===r?0:r}var l=n+r;return a>l?a-l:r-n},i.prototype.isSameDay=function(e,t){return this.parent.getIndexOfDate(this.dateRender,T(new Date(e.getTime())))===this.parent.getIndexOfDate(this.dateRender,T(new Date(t.getTime())))},i.prototype.getAppointmentLeft=function(e,t,i){var n=this.isSameDay(t,e.startHour)?(t.getTime()-e.startHour.getTime())/(6e4*this.interval)*this.slotCount:0;return 0===i?n:Math.round((e.endHour.getTime()-e.startHour.getTime())/6e4/this.interval*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=O(T(new Date(this.dateRender[n].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.isAlreadyAvail=function(e,t){for(var i=[].slice.call(t.querySelectorAll(".e-more-indicator")),n=0;n<i.length;n++){var r=void 0;if(i&&(r=this.parent.enableRtl?i[n].style.right:i[n].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.activeViewOptions.group.resources.length>1||this.parent.virtualScrollModule||this.parent.rowAutoHeight?this.parent.element.querySelector('.e-content-wrap tbody td[data-group-index="'+e.toString()+'"]').offsetTop:this.cellHeight*e:0},i.prototype.getCellTd=function(){var e=this.parent.uiStateValues.isGroupAdaptive?0:this.rowIndex;return this.eventContainers[e]},i.prototype.renderBlockIndicator=function(e,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,e)))){var r=t.createElement("div",{className:"e-icons e-block-indicator"});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(e,r)}},i.prototype.setMaxEventHeight=function(e,i){t.setStyleAttribute(e,{height:this.cellHeight-(this.maxHeight?0:2)-(this.maxHeight?0:this.moreIndicatorHeight)+"px"})},i}(At),Rt=function(){function e(e){this.parent=e,this.parent.on(Ie,this.inlineEdit,this)}return e.prototype.inlineEdit=function(e){this.parent.quickPopup.quickPopupHide(),"Cell"===e.type?(this.removeInlineAppointmentElement(),this.cellEdit(e)):(this.parent.element.querySelector(".e-inline-subject")!==e.element.querySelector(".e-inline-subject")&&this.removeInlineAppointmentElement(),this.eventEdit(e))},e.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=T(new Date(""+t[this.parent.eventFields.startTime])).getTime(),a=T(new Date(""+t[this.parent.eventFields.endTime])).getTime(),s=e.groupIndex||0;if("Day"===this.parent.currentView||"Week"===this.parent.currentView||"WorkWeek"===this.parent.currentView){var o=t[this.parent.eventFields.startTime].getDay();this.createVerticalViewInline(t,o,s,i)}else"Month"===this.parent.currentView?this.createMonthViewInline(t,s,r,a):this.createTimelineViewInline(t,r,a,s);var l=this.parent.element.querySelector(".e-inline-subject");l&&l.focus()},e.prototype.eventEdit=function(e){var i,n=e.element.querySelector(".e-inline-subject");if(n)i=n.value;else{var r=e.element.querySelector(".e-subject"),a=e.element.querySelector(".e-time");if(i=r.innerText,n=t.createElement("input",{className:"e-inline-subject",attrs:{value:i}}),t.addClass([r],"e-disable"),t.closest(e.element,".e-more-popup-wrapper"))e.element.insertBefore(n,r);else if(["Agenda","MonthAgenda"].indexOf(this.parent.currentView)>-1){var s=e.element.querySelector(".e-subject-wrap");s.insertBefore(n,s.firstChild)}else{var o=["TimelineWeek","TimelineMonth"].indexOf(this.parent.currentView)>-1?".e-inner-wrap":".e-appointment-details";e.element.querySelector(o).insertBefore(n,a)}}n.focus(),n.setSelectionRange(i.length,i.length)},e.prototype.createVerticalViewInline=function(e,t,i,n){var r=this.getEventDaysCount(e),a=new xt(this.parent);a.initializeValues();var s=a.dateRender[i].map(function(e){return e.getDay()}).indexOf(t);if(r>=1){a.allDayElement=[].slice.call(this.parent.element.querySelectorAll(".e-all-day-cells")),a.slots.push(this.parent.activeView.renderDates.map(function(e){return+e}));var o=[].slice.call(this.parent.element.querySelectorAll(".e-all-day-appointment")),l=0;o.length>0&&(l=Math.floor(this.parent.element.querySelector(".e-all-day-row").getBoundingClientRect().height/o[0].offsetHeight)-1),a.allDayLevel=l,a.renderAllDayEvents(e,s,i,n,this.parent.allowInline)}else a.renderNormalEvents(e,s,i,n,this.parent.allowInline)},e.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 At(this.parent);s.dateRender=this.parent.activeView.renderDates,s.inlineValue=this.parent.allowInline;var o=this.parent.activeView.renderDates,l=this.parent.activeViewOptions.workDays,c=".e-work-cells";if(this.parent.activeViewOptions.group.resources.length>0){c+='[data-group-index="'+t+'"]';var p=this.parent.resourceBase.lastResourceLevel[t];o=p.renderDates,l=p.workDays}s.workCells=[].slice.call(this.parent.element.querySelectorAll(c)),s.cellWidth=s.workCells[0].offsetWidth,s.cellHeight=s.workCells[0].offsetHeight,s.eventHeight=d(this.parent.monthModule.element,"e-appointment"),s.getSlotDates(l);for(var h=s.getRenderedDates(o),u=0,v=s.splitEvent(a,h||o);u<v.length;u++){var m=v[u];s.renderEvents(m,t)}this.parent.element.querySelector(".e-inline-subject").focus()},e.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 Mt(this.parent,this.parent.activeViewOptions.timeScale.enable?"hour":"day");s.dateRender=this.parent.activeView.renderDates,s.eventContainers=[].slice.call(this.parent.element.querySelectorAll("."+Xe));var o=this.parent.element.querySelector(".e-work-cells");s.inlineValue=this.parent.allowInline,s.cellWidth=o.offsetWidth,s.cellHeight=o.offsetHeight;var l=0===this.parent.element.querySelectorAll("."+Ye+" tbody tr").length?0:this.parent.element.querySelectorAll("."+Ye+" tbody tr")[0].children.length;s.slotsPerDay=l/s.dateRender.length,s.eventHeight=d(s.element,"e-appointment"),s.renderEvents(a,n)},e.prototype.getEventDaysCount=function(e){var t=e[this.parent.eventFields.startTime],i=e[this.parent.eventFields.endTime];return Math.abs(i.getTime()-t.getTime())/Ne},e.prototype.generateEventData=function(e){var t=this.parent.element.querySelector(".e-inline-subject"),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},e.prototype.documentClick=function(){var e=this.parent.element.querySelector(".e-inline-subject");e&&""!==e.value&&this.inlineCrudActions(e)},e.prototype.inlineCrudActions=function(e){if(t.closest(e,".e-inline-appointment")){var i=this.generateEventData(e);this.parent.addEvent(i)}else{var n=t.closest(e,".e-appointment"),r=this.parent.getEventDetails(n);r[this.parent.eventFields.subject]=e.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()},e.prototype.createInlineAppointmentElement=function(e){var i=t.createElement("div",{className:"e-appointment e-inline-appointment"}),n=t.createElement("div",{className:"e-appointment-details"});i.appendChild(n);var r=t.createElement("input",{className:"e-inline-subject"});return n.appendChild(r),e&&this.parent.eventBase.applyResourceColor(i,e,"backgroundColor"),i},e.prototype.removeInlineAppointmentElement=function(){var e=[].slice.call(this.parent.element.querySelectorAll(".e-inline-appointment"));e.length>0&&e.forEach(function(e){return t.remove(e)});var i=this.parent.element.querySelector(".e-inline-subject");if(i){var n=t.closest(i,".e-appointment");t.removeClass([n.querySelector(".e-subject")],"e-disable"),t.remove(i)}},e.prototype.destroy=function(){this.parent.off(Ie,this.inlineEdit)},e}(),Pt=function(){function e(){}return e.prototype.renderFormValidator=function(e,t,i){var n=this;this.element=i,this.formObj=new o.FormValidator(e,{customPlacement:function(e,t){n.errorPlacement(e,t)},rules:t,validationComplete:function(e){n.validationComplete(e)},focusout:function(e){n.focusOut(e)}})},e.prototype.focusOut=function(e){var t=e.relatedTarget;t&&(t.classList.contains("e-dlg-closeicon-btn")||t.classList.contains("e-close")||t.classList.contains("e-all-day-cells")||t.classList.contains("e-header-cells")||t.classList.contains("e-event-details")||t.classList.contains("e-work-cells")||t.classList.contains("e-event-cancel"))?this.ignoreError=!0:this.ignoreError=!1},e.prototype.validationComplete=function(e){var t=this.element.querySelector("#"+e.inputName+"_Error");t&&(t.style.display="failure"===e.status?"":"none")},e.prototype.errorPlacement=function(e,t){var i=t.getAttribute("for");this.element.querySelector("#"+i+"_Error")||this.ignoreError||this.createTooltip(e,t,i,"")},e.prototype.createTooltip=function(e,i,n,r){var a,s,o=e.getBoundingClientRect();this.element.classList.contains("e-quick-popup-wrapper")?(a=this.element,s=this.element.getBoundingClientRect()):s=(a=this.element.querySelector(".e-schedule-dialog .e-dlg-content")).getBoundingClientRect();var l=t.createElement("div",{className:"e-tooltip-wrap e-popup e-schedule-error",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;"}),c=t.createElement("div",{className:"e-tip-content"});c.appendChild(i);var p=t.createElement("div",{className:"e-arrow-tip e-tip-top"});p.appendChild(t.createElement("div",{className:"e-arrow-tip-outer e-tip-top"})),p.appendChild(t.createElement("div",{className:"e-arrow-tip-inner e-tip-top"})),l.appendChild(c),l.appendChild(p),a.appendChild(l),l.style.left=parseInt(l.style.left,10)-l.offsetWidth/2+"px"},e.prototype.destroyToolTip=function(){if(this.element)for(var e=0,i=[].slice.call(this.element.querySelectorAll(".e-schedule-error"));e<i.length;e++){var n=i[e];t.remove(n)}this.formObj&&this.formObj.element&&this.formObj.reset()},e.prototype.destroy=function(){this.formObj&&this.formObj.element&&!this.formObj.isDestroyed&&this.formObj.destroy()},e}(),Ht=function(){function e(e){this.isMultipleEventSelect=!1,this.isCrudAction=!1,this.parent=e,this.l10n=this.parent.localeObj,this.fieldValidator=new Pt,this.render(),this.addEventListener()}return e.prototype.render=function(){this.renderQuickPopup(),this.renderMorePopup(),this.renderQuickDialog()},e.prototype.renderQuickPopup=function(){var e=t.createElement("div",{className:"e-quick-popup-wrapper e-popup-close"});this.parent.isAdaptive?(document.body.appendChild(e),t.addClass([e],"e-device")):this.parent.element.appendChild(e),this.quickPopup=new i.Popup(e,{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}),this.quickPopup.isStringTemplate=!0},e.prototype.renderMorePopup=function(){var e='<div class="e-more-event-popup"><div class="e-more-event-header"><div class="e-more-event-close" title="'+this.l10n.getConstant("close")+'" tabindex="0"></div><div class="e-more-event-date-header"><div class="e-header-day"></div><div class="e-header-date e-navigate" tabindex="0"></div></div></div></div>',n=t.createElement("div",{className:"e-more-popup-wrapper e-popup-close",innerHTML:e});this.parent.isAdaptive?(document.body.appendChild(n),t.addClass([n],"e-device")):this.parent.element.appendChild(n),this.morePopup=new i.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.isStringTemplate=!0;var r=this.morePopup.element.querySelector(".e-more-event-close");this.renderButton("e-round",ze+" e-close-icon",!1,r,this.closeClick),t.EventHandler.add(this.morePopup.element.querySelector(".e-header-date"),"click",this.navigationClick,this)},e.prototype.renderQuickDialog=function(){var e=[{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)};e.splice(1,0,n)}this.quickDialog=new i.Dialog({animationSettings:{effect:"Zoom"},buttons:e,cssClass:"e-quick-dialog",closeOnEscape:!0,enableRtl:this.parent.enableRtl,beforeClose:this.beforeQuickDialogClose.bind(this),isModal:!0,position:{X:"center",Y:"center"},showCloseIcon:!0,target:document.body,visible:!1,width:"auto"});var r=t.createElement("div",{id:this.parent.element.id+"QuickDialog"});this.parent.element.appendChild(r),this.quickDialog.appendTo(r),this.quickDialog.isStringTemplate=!0;var a=this.quickDialog.element.querySelector(".e-quick-alertok");a&&(a.setAttribute("aria-label",this.l10n.getConstant("occurrence")),a.setAttribute("aria-label",a.innerHTML));var s=this.quickDialog.element.querySelector(".e-quick-alertcancel");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"))},e.prototype.renderButton=function(e,i,n,r,a){var o=new s.Button({cssClass:e,disabled:n,enableRtl:this.parent.enableRtl,iconCss:i});o.appendTo(r),o.isStringTemplate=!0,t.EventHandler.add(r,"click",a,this)},e.prototype.quickDialogClass=function(e){var i=["e-quick-dialog-occurrence-event","e-quick-dialog-series-event","e-quick-dialog-delete","e-quick-dialog-cancel","e-quick-dialog-alert-btn","e-disable"],n=this.quickDialog.element.querySelector(".e-quick-alertok"),r=this.quickDialog.element.querySelector(".e-quick-alertcancel"),a=this.quickDialog.element.querySelector(".e-quick-alertfollowing");switch(t.removeClass([n,r],i),t.addClass([this.quickDialog.element.querySelector(".e-quick-dialog-cancel")],"e-disable"),this.parent.eventSettings.editFollowingEvents&&(t.addClass([a],"e-disable"),t.removeClass([this.quickDialog.element],"e-following-events-dialog")),e){case"Recurrence":t.addClass([n],"e-quick-dialog-occurrence-event"),t.addClass([r],"e-quick-dialog-series-event"),this.parent.eventSettings.editFollowingEvents&&(t.removeClass([a],"e-disable"),t.addClass([this.quickDialog.element],"e-following-events-dialog"),t.addClass([a],"e-quick-dialog-following-events"));break;case"Delete":t.addClass([n],"e-quick-dialog-delete"),t.addClass([r],"e-quick-dialog-cancel");break;case"Alert":t.addClass([n],["e-quick-alertok","e-quick-dialog-alert-btn"]),t.addClass([r],["e-quick-alertcancel","e-disable"])}},e.prototype.applyFormValidation=function(){var e=this.quickPopup.element.querySelector("."+Ze),t={};t[this.parent.eventSettings.fields.subject.name]=this.parent.eventSettings.fields.subject.validation,this.fieldValidator.renderFormValidator(e,t,this.quickPopup.element)},e.prototype.openRecurrenceAlert=function(){var e=this.quickDialog.element.querySelector(".e-quick-alertok");e&&(e.innerHTML=this.l10n.getConstant("Delete"===this.parent.currentAction?"deleteEvent":"editEvent"),e.setAttribute("aria-label",e.innerHTML));var i=this.quickDialog.element.querySelector(".e-quick-alertfollowing");i&&(i.innerHTML=this.l10n.getConstant("editFollowingEvent"),i.setAttribute("aria-label",i.innerHTML));var n=this.quickDialog.element.querySelector(".e-quick-alertcancel");n&&(n.innerHTML=this.l10n.getConstant("Delete"===this.parent.currentAction?"deleteSeries":"editSeries"),n.setAttribute("aria-label",n.innerHTML)),this.quickDialog.content=this.l10n.getConstant("editContent"),this.quickDialog.header=this.l10n.getConstant("Delete"===this.parent.currentAction?"deleteTitle":"editTitle"),this.quickDialogClass("Recurrence");var r=this.parent.activeEventData.event;if(this.parent.eventSettings.editFollowingEvents&&"EditOccurrence"===this.parent.currentAction&&!t.isNullOrUndefined(r[this.parent.eventFields.recurrenceID])&&r[this.parent.eventFields.recurrenceID]!==r[this.parent.eventFields.id]){var a=this.quickDialog.element.querySelector(".e-quick-alertfollowing");t.addClass([a],"e-disable")}this.showQuickDialog("RecurrenceAlert")},e.prototype.openRecurrenceValidationAlert=function(e){this.quickDialogClass("Alert");var i=this.quickDialog.element.querySelector(".e-quick-alertok");i.innerHTML=this.l10n.getConstant("ok"),i.setAttribute("aria-label",i.innerHTML);var n=this.quickDialog.element.querySelector(".e-quick-alertcancel");switch(n.innerHTML=this.l10n.getConstant("cancel"),n.setAttribute("aria-label",n.innerHTML),this.quickDialog.header=this.l10n.getConstant("alert"),e){case"wrongPattern":t.addClass([n],"e-disable"),this.quickDialog.content=this.l10n.getConstant("wrongPattern");break;case"createError":t.addClass([n],"e-disable"),this.quickDialog.content=this.l10n.getConstant("createError");break;case"sameDayAlert":t.addClass([n],"e-disable"),this.quickDialog.content=this.l10n.getConstant("sameDayAlert");break;case"seriesChangeAlert":var r=this.quickDialog.element.querySelector(".e-quick-dialog-cancel");t.removeClass([n,r],"e-disable"),this.quickDialog.content=this.l10n.getConstant("seriesChangeAlert"),i.innerHTML=this.l10n.getConstant("yes"),n.innerHTML=this.l10n.getConstant("no"),r.innerHTML=this.l10n.getConstant("cancel")}(!this.parent.enableRecurrenceValidation&&"wrongPattern"===e||this.parent.enableRecurrenceValidation)&&this.showQuickDialog("RecurrenceValidationAlert")},e.prototype.openDeleteAlert=function(){if(!this.parent.activeViewOptions.readonly){var e=this.quickDialog.element.querySelector(".e-quick-alertok");e&&(e.innerHTML=this.l10n.getConstant("delete"),e.setAttribute("aria-label",e.innerHTML));var t=this.quickDialog.element.querySelector(".e-quick-alertcancel");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")}},e.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(".e-quick-alertok");i&&(i.innerHTML=this.l10n.getConstant("ok"),i.setAttribute("aria-label",i.innerHTML));var n=this.quickDialog.element.querySelector(".e-quick-alertcancel");n&&(n.innerHTML=this.l10n.getConstant("cancel"),i.setAttribute("aria-label",n.innerHTML)),this.quickDialogClass("Alert"),this.showQuickDialog("ValidationAlert",t)},e.prototype.showQuickDialog=function(e,i){var n=this;this.quickDialog.dataBind();var r={type:e,cancel:!1,data:t.extend({},i||this.parent.activeEventData.event,null,!0),element:this.quickDialog.element};this.parent.trigger("popupOpen",r,function(e){e.cancel||n.quickDialog.show()})},e.prototype.createMoreEventList=function(e,i,n){var r=this,a=this.parent.eventFields,s=t.createElement("div",{className:"e-more-event-content"}),o=t.createElement("div",{className:"e-more-appointment-wrapper"});if(0===e.length)o=t.createElement("div",{className:"e-more-event-content",innerHTML:this.l10n.getConstant("emptyContainer")});else for(var l=this,c=0,p=e;c<p.length;c++)!function(e){var s=e[a.subject]||l.parent.eventSettings.fields.subject.default,c=t.createElement("div",{className:"e-appointment",attrs:{"data-id":""+e[a.id],"data-guid":e.Guid,role:"button",tabindex:"0","aria-readonly":l.parent.eventBase.getReadonlyAttribute(e),"aria-selected":"false","aria-grabbed":"true","aria-label":l.parent.getAnnocementString(e)}}),p=void 0;if(t.isNullOrUndefined(l.parent.activeViewOptions.eventTemplate))c.appendChild(t.createElement("div",{className:"e-subject",innerHTML:s}));else{var d=l.parent.element.id+"_"+l.parent.activeViewOptions.eventTemplateName+"eventTemplate",h=j(e,l.parent.eventFields);p=l.parent.getAppointmentTemplate()(h,l.parent,"eventTemplate",d,!1),t.append(p,c)}if(t.isNullOrUndefined(n)||c.setAttribute("data-group-index",n),!t.isNullOrUndefined(e[a.recurrenceRule])){var u=e[a.id]===e[a.recurrenceID]?"e-recurrence-icon":"e-recurrence-edit-icon";c.appendChild(t.createElement("div",{className:ze+" "+u}))}var v={data:t.extend({},e,null,!0),element:c,cancel:!1};l.parent.trigger("eventRendered",v,function(t){t.cancel||(o.appendChild(c),r.parent.eventBase.wireAppointmentEvents(c,e,r.parent.isAdaptive),r.parent.eventBase.applyResourceColor(c,e,"backgroundColor",i))})}(p[c]);return s.appendChild(o),s},e.prototype.tapHoldEventPopup=function(e){var i=t.closest(e.target,".e-appointment");this.isMultipleEventSelect=!1,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(!t.isNullOrUndefined(r)){var a=r[this.parent.eventFields.subject]||this.l10n.getConstant("noTitle"),s='<div class="e-multiple-event-popup"><div class="e-popup-header"><button class="e-close" title="'+this.l10n.getConstant("close")+'"></button><div class="e-subject">'+a+'</div><button class="e-edit" title="'+this.l10n.getConstant("edit")+'"></button><button class="e-delete" title="'+this.l10n.getConstant("delete")+'"></button></div></div>';this.quickPopup.element.innerHTML=s;var o=this.quickPopup.element.querySelector(".e-close");this.renderButton("e-flat e-round e-small",ze+" e-close-icon",!1,o,this.closeClick);var l=this.parent.activeViewOptions.readonly||r[this.parent.eventFields.isReadonly],c=this.quickPopup.element.querySelector(".e-edit");this.renderButton("e-flat e-round e-small",ze+" e-edit-icon",l,c,this.editClick);var p=this.quickPopup.element.querySelector(".e-delete");this.renderButton("e-flat e-round e-small",ze+" e-delete-icon",l,p,this.deleteClick),this.beforeQuickPopupOpen(i)}},e.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)},e.prototype.cellClick=function(e){var i=new Date(e.startTime.getTime());if(!this.parent.showQuickInfo||!this.parent.eventSettings.allowAdding||"MonthAgenda"===this.parent.currentView||this.isCellBlocked(e)||!this.parent.isMinMaxDate(new Date(i.setHours(0,0,0,0))))return void this.quickPopupHide();var n=e.event.target;if(this.parent.isAdaptive){this.quickPopupHide();var r=this.parent.element.querySelector(".e-new-event");t.isNullOrUndefined(r)&&(r=t.createElement("div",{className:"e-new-event",innerHTML:'<div class="e-title">+ '+this.l10n.getConstant("newEvent")+"</div>"}));var a=t.closest(n,".e-work-cells,.e-all-day-cells");return void(a&&a.appendChild(r))}var s=t.closest(n,".e-work-cells,.e-all-day-cells,.e-header-cells");if(!t.isNullOrUndefined(s)&&!n.classList.contains("e-more-indicator")){if(this.quickPopup.relateTo===s&&this.quickPopup.element.classList.contains(Ge)){var l=this.quickPopup.element.querySelector(".e-subject");return void(l&&l.focus())}this.resetQuickPopupTemplates();var c={};c[this.parent.eventFields.startTime]=this.parent.activeCellsData.startTime,c[this.parent.eventFields.endTime]=this.parent.activeCellsData.endTime,c[this.parent.eventFields.isAllDay]=this.parent.activeCellsData.isAllDay;var p=t.createElement("div",{className:"e-cell-popup"});p.appendChild(this.getPopupHeader("Cell",c)),p.appendChild(this.getPopupContent("Cell",e,c)),p.appendChild(this.getPopupFooter("Cell",c));var d=p.querySelector(".e-subject");d&&o.Input.createInput({element:d,properties:{placeholder:this.l10n.getConstant("addTitle")}}),t.isNullOrUndefined(this.parent.eventSettings.fields.subject.default)||(d.value=this.parent.eventSettings.fields.subject.default);var h=p.querySelector(".e-close");h&&this.renderButton("e-flat e-round e-small",ze+" e-close-icon",!1,h,this.popupClose);var u=p.querySelector(".e-event-details");u&&this.renderButton("e-flat","",!1,u,this.detailsClick);var v=p.querySelector(".e-event-create");v&&this.renderButton("e-flat e-primary","",this.parent.activeViewOptions.readonly,v,this.saveClick),this.quickPopup.content=p,this.quickPopup.dataBind(),this.applyFormValidation(),this.morePopup&&this.morePopup.hide(),this.quickPopup.relateTo=s,this.beforeQuickPopupOpen(s)}},e.prototype.isSameEventClick=function(e){if(this.quickPopup.relateTo===t.closest(e.element,".e-appointment")&&this.quickPopup.element.classList.contains(Ge)){var i=this.quickPopup.element.querySelector(".e-edit");if(i&&i.focus(),!this.parent.isAdaptive){var n=this.quickPopup.element.querySelector(".e-event-edit");n&&n.focus()}return!0}return!1},e.prototype.isQuickTemplate=function(e){return"Both"===this.parent.quickInfoTemplates.templateType||this.parent.quickInfoTemplates.templateType===e},e.prototype.eventClick=function(e){if(this.parent.eventTooltip&&this.parent.eventTooltip.close(),this.parent.showQuickInfo)if(this.parent.isAdaptive&&this.isMultipleEventSelect)this.updateTapHoldEventPopup(t.closest(e.element,".e-appointment"));else{if(this.isSameEventClick(e))return;this.resetQuickPopupTemplates();var i=e.event,n=t.createElement("div",{className:"e-event-popup"});n.appendChild(this.getPopupHeader("Event",i)),n.appendChild(this.getPopupContent("Event",e,i)),n.appendChild(this.getPopupFooter("Event",i));var r=this.parent.activeViewOptions.readonly||i[this.parent.eventFields.isReadonly],a=!this.parent.eventSettings.allowEditing||r,s=!this.parent.eventSettings.allowDeleting||r,o=n.querySelector(".e-edit"),l="e-flat e-round e-small";o&&this.renderButton(l,ze+" e-edit-icon",a,o,this.editClick);var c=n.querySelector(".e-delete");c&&this.renderButton(l,ze+" e-delete-icon",s,c,this.deleteClick);var p=n.querySelector(".e-close");p&&this.renderButton(l,ze+" e-close-icon",!1,p,this.popupClose);var d=n.querySelector(".e-event-edit");d&&this.renderButton("e-flat e-primary","",a,d,this.editClick);var h=n.querySelector(".e-event-delete");h&&this.renderButton("e-flat","",s,h,this.deleteClick),this.quickPopup.content=n,this.quickPopup.dataBind(),this.morePopup&&!t.closest(e.element,".e-more-appointment-wrapper")&&this.morePopup.hide(),this.quickPopup.relateTo=this.parent.isAdaptive?document.body:t.closest(e.element,".e-appointment"),this.beforeQuickPopupOpen(e.element)}},e.prototype.getPopupHeader=function(e,i){var n=t.createElement("div",{className:"e-popup-header"});if(this.isQuickTemplate(e)&&this.parent.quickInfoTemplates.header){var r=t.extend({},i,t.isBlazor()?{elementType:e.toLowerCase(),startTimeValue:H(i[this.parent.eventFields.startTime]),endTimeValue:H(i[this.parent.eventFields.endTime])}:{elementType:e.toLowerCase()},!0),a=this.parent.element.id,s=[].slice.call(this.parent.getQuickInfoTemplatesHeader()(r,this.parent,"header",a+"_headerTemplate",!1));t.append([].slice.call(s),n)}else{var o=void 0;switch(e){case"Cell":o='<div class="e-header-icon-wrapper"><button class="e-close" title="'+this.l10n.getConstant("close")+'"></button></div>';break;case"Event":var l=this.getFormattedString(i);o='<div class="e-header-icon-wrapper"><button class="e-edit e-icons" title="'+this.l10n.getConstant("edit")+'"></button><button class="e-delete e-icons" title="'+this.l10n.getConstant("delete")+'"></button><button class="e-close" title="'+this.l10n.getConstant("close")+'"></button></div><div class="e-subject-wrap"><div class="e-subject e-text-ellipsis" title="'+l.eventSubject+'">'+l.eventSubject+"</div></div >"}var c=t.createElement("div",{innerHTML:o});t.append([].slice.call(c.childNodes),n)}return n},e.prototype.getPopupContent=function(e,i,n){var r=t.createElement("div",{className:"e-popup-content"});if(this.isQuickTemplate(e)&&this.parent.quickInfoTemplates.content){var a=t.extend({},n,t.isBlazor()?{elementType:e.toLowerCase(),startTimeValue:H(n[this.parent.eventFields.startTime]),endTimeValue:H(n[this.parent.eventFields.endTime])}:{elementType:e.toLowerCase()},!0),s=this.parent.element.id,o=[].slice.call(this.parent.getQuickInfoTemplatesContent()(a,this.parent,"content",s+"_contentTemplate",!1));t.append([].slice.call(o),r)}else{var l=void 0,c=this.getResourceText(i,e.toLowerCase());switch(e){case"Cell":var p=this.getFormattedString(n);l='<table class="e-popup-table"><tbody><tr><td><form class="'+Ze+'" onsubmit="return false;"><input class="e-subject e-field" type="text" name="'+this.parent.eventFields.subject+'" /></form></td></tr><tr><td><div class="e-date-time"><div class="e-date-time-icon e-icons"></div><div class="e-date-time-details '+Ke+'">'+p.details+"</div></div>"+(this.parent.activeViewOptions.group.resources.length>0?'<div class="e-resource"><div class="e-resource-icon e-icons "></div><div class="e-resource-details e-text-ellipsis">'+c+"</div></div>":"")+"</td></tr></tbody></table>";break;case"Event":l='<div class="e-date-time"><div class="e-date-time-icon e-icons"></div><div class="e-date-time-wrapper e-text-ellipsis"><div class="e-date-time-details e-text-ellipsis">'+this.getFormattedString(n).details+"</div>",n[this.parent.eventFields.recurrenceRule]&&(l+='<div class="e-recurrence-summary e-text-ellipsis">'+this.getRecurrenceSummary(n)+"</div>"),l+="</div></div>",n[this.parent.eventFields.location]&&(l+='<div class="e-location"><div class="e-location-icon e-icons"></div><div class="e-location-details e-text-ellipsis">'+n[this.parent.eventFields.location]+"</div></div>"),(n[this.parent.eventFields.startTimezone]||n[this.parent.eventFields.endTimezone])&&(l+='<div class="e-time-zone"><div class="e-time-zone-icon e-icons"></div><div class="e-time-zone-details e-text-ellipsis">'+this.getTimezone(n)+"</div></div>"),n[this.parent.eventFields.description]&&(l+='<div class="e-description"><div class="e-description-icon e-icons"></div><div class="e-description-details e-text-ellipsis">'+n[this.parent.eventFields.description]+"</div></div>"),this.parent.resourceCollection.length>0&&(l+='<div class="e-resource"><div class="e-resource-icon e-icons"></div><div class="e-resource-details e-text-ellipsis">'+c+"</div></div>")}var d=t.createElement("div",{innerHTML:l});t.append([].slice.call(d.childNodes),r)}return r},e.prototype.getPopupFooter=function(e,i){var n=t.createElement("div",{className:"e-popup-footer"});if(this.isQuickTemplate(e)&&this.parent.quickInfoTemplates.footer){var r=t.extend({},i,t.isBlazor()?{elementType:e.toLowerCase(),startTimeValue:H(i[this.parent.eventFields.startTime]),endTimeValue:H(i[this.parent.eventFields.endTime])}:{elementType:e.toLowerCase()},!0),a=this.parent.element.id,s=[].slice.call(this.parent.getQuickInfoTemplatesFooter()(r,this.parent,"footer",a+"_footerTemplate",!1));t.append([].slice.call(s),n)}else{var o=void 0;switch(e){case"Cell":o='<button class="e-event-details e-text-ellipsis" title="'+this.l10n.getConstant("moreDetails")+'">'+this.l10n.getConstant("moreDetails")+'</button><button class="e-event-create e-text-ellipsis" title="'+this.l10n.getConstant("save")+'">'+this.l10n.getConstant("save")+"</button>";break;case"Event":o=this.parent.isAdaptive?"":'<button class="e-event-edit e-text-ellipsis" title="'+this.l10n.getConstant("edit")+'">'+this.l10n.getConstant("edit")+'</button><button class="e-event-delete e-text-ellipsis" title="'+this.l10n.getConstant("delete")+'">'+this.l10n.getConstant("delete")+"</button>"}var l=t.createElement("div",{innerHTML:o});t.append([].slice.call(l.childNodes),n)}return n},e.prototype.getResourceText=function(e,i){if(0===this.parent.resourceCollection.length)return null;var n="";if(0===this.parent.activeViewOptions.group.resources.length){for(var r=this.parent.resourceBase.resourceCollection.slice(-1)[0],a=r.dataSource,s=0,o=e.event,l=0,c=a.length;l<c;l++)a[l][r.idField]===o[r.field]&&(s=l);n=a[s][r.textField]}else if("event"===i){for(var p,o=e.event,a=void 0,l=this.parent.resourceBase.resourceCollection.length-1;l>=0;l--)if(a=o[this.parent.resourceBase.resourceCollection[l].field],!t.isNullOrUndefined(a)){p=this.parent.resourceBase.resourceCollection[l];break}Array.isArray(a)||(a=[a]);var d=[],h=p.dataSource;a.map(function(e){var t=V(h,p.idField,e),i=h[t][p.textField];i&&d.push(i)}),n=d.join(", ")}else{var u=e,v=t.isNullOrUndefined(u.groupIndex)?0:u.groupIndex,m=this.parent.resourceBase.lastResourceLevel[v];n=m.resourceData[m.resource.textField]}return n},e.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","MMMM d, y"),s=e[t.isAllDay]&&0===r.getHours()&&0===r.getMinutes()?this.getDateFormat(b(new Date(r.getTime()),-1),"long","MMMM d, y"):this.getDateFormat(r,"long","MMMM d, y"),o=this.parent.getTimeString(n),l=this.parent.getTimeString(r),c="",p=r.getDate()!==n.getDate()&&(r.getTime()-n.getTime())/36e5<24?1:0;return e[t.isAllDay]?(c=a+" ("+this.l10n.getConstant("allDay")+")",(r.getTime()-n.getTime())/Ne>1&&(c+="&nbsp;-&nbsp;"+s+" ("+this.l10n.getConstant("allDay")+")")):c=(r.getTime()-n.getTime())/Ne>=1||p>0?a+" ("+o+")&nbsp;-&nbsp;"+s+" ("+l+")":a+" ("+o+"&nbsp;-&nbsp;"+l+")",{eventSubject:i,details:c}},e.prototype.moreEventClick=function(e,i,n){var r=this;this.quickPopupHide(!0);var a=this.morePopup.element.querySelector(".e-more-event-content");a&&t.remove(a);var s=e.date.getTime().toString(),o=t.closest(e.element,".e-more-indicator,.e-work-cells"),l=this.parent.globalize.formatDate(e.date,{format:"E",calendar:this.parent.getCalendarMode()});this.morePopup.element.querySelector(".e-header-day").innerHTML=I(l,"single");var c=this.morePopup.element.querySelector(".e-header-date");c.innerHTML=this.getDateFormat(e.date,"d","d"),c.setAttribute("data-date",s),c.setAttribute("data-end-date",i.getTime().toString());var p;t.isNullOrUndefined(n)||(c.setAttribute("data-group-index",n),p=this.parent.resourceBase.lastResourceLevel[parseInt(n,10)].groupOrder);var d=this.createMoreEventList(e.event,p,n);if(this.morePopup.element.querySelector(".e-more-event-popup").appendChild(d),t.removeClass(this.morePopup.element.querySelector(".e-more-event-date-header").childNodes,"e-current-date"),T(e.date).getTime()===T(this.parent.getCurrentTime()).getTime()&&t.addClass(this.morePopup.element.querySelector(".e-more-event-date-header").childNodes,"e-current-date"),!this.parent.isAdaptive)if(-1!==this.parent.currentView.indexOf("Timeline")){var h=o.getAttribute("data-group-index"),u=new Date(parseInt(o.getAttribute("data-start-date"),10));u.setHours(u.getHours(),u.getMinutes(),0);var v=this.parent.getMsFromDate(u).toString();t.isNullOrUndefined(h)?this.morePopup.relateTo=this.parent.element.querySelector('.e-content-wrap tbody tr td[data-date="'+v+'"]'):this.morePopup.relateTo=this.parent.element.querySelector('.e-content-wrap tbody tr td[data-group-index="'+h+'"][data-date="'+v+'"]')}else this.morePopup.relateTo=t.closest(o,".e-work-cells");this.parent.updateEventTemplates();var m={type:"EventContainer",cancel:!1,element:this.morePopup.element};t.isBlazor()||(m.data=e),this.parent.trigger("popupOpen",m,function(e){e.cancel||r.morePopup.show()})},e.prototype.saveClick=function(){this.isCrudAction=!0,this.quickPopupHide()},e.prototype.detailsClick=function(){var e=this.quickPopup.element.querySelector(".e-subject");if(e&&""!==e.value)t.extend(this.parent.activeCellsData,{subject:e.value});this.isCrudAction=!1,this.fieldValidator.destroyToolTip(),this.quickPopupHide(),this.parent.eventWindow.openEditor(this.parent.activeCellsData,"Add")},e.prototype.editClick=function(){this.quickPopupHide(!0);var e=this.parent.activeEventData.event;this.parent.currentAction="EditSeries",t.isNullOrUndefined(e[this.parent.eventFields.recurrenceRule])?this.parent.eventWindow.openEditor(e,this.parent.currentAction):(this.parent.currentAction="EditOccurrence",this.openRecurrenceAlert())},e.prototype.deleteClick=function(){this.quickPopupHide(!0),this.parent.currentAction="Delete",this.parent.activeEventData.event[this.parent.eventFields.recurrenceRule]?this.openRecurrenceAlert():this.openDeleteAlert()},e.prototype.updateMoreEventContent=function(){if(!this.morePopup.element.classList.contains("e-popup-close")){var e=this.morePopup.element.querySelector(".e-more-event-content");e&&t.remove(e);var i,n,r=this.morePopup.element.querySelector(".e-header-date"),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");t.isNullOrUndefined(o)||(n=(i=this.parent.resourceBase.lastResourceLevel[parseInt(o,10)]).groupOrder);var l=this.parent.eventBase.filterEvents(a,s,this.parent.eventsProcessed,i),c=this.createMoreEventList(l,n,o);this.morePopup.element.querySelector(".e-more-event-popup").appendChild(c)}},e.prototype.closeClick=function(){this.quickPopupHide(),this.morePopup.hide()},e.prototype.dialogButtonClick=function(e){this.quickDialog.hide();var t=e.target,i=this.quickDialog.element.querySelector(".e-quick-alertcancel"),n=this.parent.activeEventData.event;if(t.classList.contains("e-quick-dialog-occurrence-event"))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("e-quick-dialog-following-events"))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("e-quick-dialog-series-event"))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("e-quick-dialog-delete")?this.parent.crudModule.deleteEvent(n,this.parent.currentAction):!i.classList.contains("e-disable")&&(t.classList.contains("e-quick-alertok")||t.classList.contains("e-quick-alertcancel")&&!i.classList.contains("e-quick-dialog-cancel"))&&(this.parent.uiStateValues.isIgnoreOccurrence=t.classList.contains("e-quick-alertcancel"),this.parent.eventWindow.eventSave(this.l10n.getConstant("ok")))},e.prototype.updateTapHoldEventPopup=function(e){var i=this.parent.eventBase.getSelectedEventElements(e);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+")&nbsp;"+this.l10n.getConstant("selectedItems");this.quickPopup.element.querySelector(".e-subject").innerHTML=r,i.length>1?t.addClass([this.quickPopup.element.querySelector(".e-edit-icon")],"e-hidden"):t.removeClass([this.quickPopup.element.querySelector(".e-edit-icon")],"e-hidden")}else this.parent.selectedElements=[],this.quickPopupHide()},e.prototype.getTimezone=function(e){var t="";return t+=e[this.parent.eventFields.startTimezone]||"",t+=""===t?"":" - ",t+=e[this.parent.eventFields.endTimezone]||""},e.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""},e.prototype.getDateFormat=function(e,i,n){return I(t.isBlazor()?this.parent.globalize.formatDate(e,{format:n,calendar:this.parent.getCalendarMode()}):this.parent.globalize.formatDate(e,{skeleton:i,calendar:this.parent.getCalendarMode()}),"single")},e.prototype.getDataFromTarget=function(e){if(e.classList.contains("e-appointment"))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},e.prototype.beforeQuickDialogClose=function(){var e=this,i={type:t.isNullOrUndefined(this.parent.activeEventData.event)?"ValidationAlert":t.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("popupClose",i,function(t){(t=e.serializingData(t)).cancel||e.parent.eventBase.focusElement()})},e.prototype.beforeQuickPopupOpen=function(e,n){var r=this;if(t.isBlazor()&&this.isQuickInfoTemplates()&&t.isNullOrUndefined(n))return void this.updateQuickPopupTemplates(e);var a=this.quickPopup.element.querySelector(".e-event-popup"),s=this.parent.isAdaptive?a?"ViewEventInfo":"EditEventInfo":"QuickInfo",o={type:s,cancel:!1,data:t.extend({},this.getDataFromTarget(e),null,!0),target:e,element:this.quickPopup.element};this.parent.trigger("popupOpen",o,function(n){if(n.cancel)r.quickPopupHide(),r.destroyButtons(),n.element.classList.contains(Ge)&&r.quickPopupClose(),r.resetQuickPopupTemplates(),R(r.quickPopup.element),r.isMultipleEventSelect=!1;else{var o=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=t.formatUnit("EditEventInfo"===s?65:window.innerHeight);else{r.quickPopup.offsetX=10,r.quickPopup.collision={X:r.parent.enableRtl?"flip":"none",Y:"fit"},r.quickPopup.position={X:r.parent.enableRtl?"left":"right",Y:"top"},r.quickPopup.dataBind(),r.quickPopup.refreshPosition(null,!0);var l=i.isCollide(r.quickPopup.element,r.parent.element);if(l.indexOf(r.parent.enableRtl?"left":"right")>-1&&(r.quickPopup.offsetX=-e.offsetWidth-10-r.quickPopup.element.offsetWidth,r.quickPopup.dataBind(),i.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())),r.parent.virtualScrollModule&&(l.indexOf("top")>-1||l.indexOf("bottom")>-1)){var c=h(r.parent.element.querySelector(".e-content-wrap table"));r.quickPopup.offsetY=c,r.quickPopup.dataBind()}}a&&r.applyEventColor(),r.quickPopup.element.style.display=o,r.quickPopup.dataBind(),r.quickPopup.show()}})},e.prototype.isQuickInfoTemplates=function(){return!t.isNullOrUndefined(this.parent.quickInfoTemplates.header||this.parent.quickInfoTemplates.content||this.parent.quickInfoTemplates.footer)},e.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(".e-popup-header"),n=this.quickPopup.element.querySelector(".e-popup-footer");n&&n.offsetParent&&(i=this.quickPopup.element.querySelector(".e-subject"))&&(i.style.borderLeftColor=t,t="rgba("+t.match(/\d+/g).join()+",0.3)"),i&&(i.style.backgroundColor=t)}},e.prototype.quickPopupOpen=function(){if(this.parent.isAdaptive)return void(this.quickPopup.element.style.top="0px");if(this.quickPopup.element.querySelector(".e-cell-popup")){var e=this.quickPopup.element.querySelector(".e-subject");e&&e.focus()}else{var t=this.quickPopup.element.querySelector(".e-event-edit");t&&t.focus();var i=this.quickPopup.element.querySelector(".e-edit");i&&i.focus()}},e.prototype.updateQuickPopupTemplates=function(e){var i=this,n={header:!this.parent.quickInfoTemplates.header,content:!this.parent.quickInfoTemplates.content,footer:!this.parent.quickInfoTemplates.footer};this.parent.quickInfoTemplates.header&&t.updateBlazorTemplate(this.parent.element.id+"_headerTemplate","HeaderTemplate",this.parent.quickInfoTemplates,null,function(){n.header=!0,i.quickPopupShow(n,e)}),this.parent.quickInfoTemplates.content&&t.updateBlazorTemplate(this.parent.element.id+"_contentTemplate","ContentTemplate",this.parent.quickInfoTemplates,null,function(){n.content=!0,i.quickPopupShow(n,e)}),this.parent.quickInfoTemplates.footer&&t.updateBlazorTemplate(this.parent.element.id+"_footerTemplate","FooterTemplate",this.parent.quickInfoTemplates,null,function(){n.footer=!0,i.quickPopupShow(n,e)})},e.prototype.quickPopupShow=function(e,t){e.header&&e.content&&e.footer&&this.beforeQuickPopupOpen(t,!0)},e.prototype.resetQuickPopupTemplates=function(){t.isBlazor()&&this.isQuickInfoTemplates()&&(t.removeClass([this.quickPopup.element],Ge),t.addClass([this.quickPopup.element],"e-popup-close"),this.parent.quickInfoTemplates.header&&t.resetBlazorTemplate(this.parent.element.id+"_headerTemplate","HeaderTemplate"),this.parent.quickInfoTemplates.content&&t.resetBlazorTemplate(this.parent.element.id+"_contentTemplate","ContentTemplate"),this.parent.quickInfoTemplates.footer&&t.resetBlazorTemplate(this.parent.element.id+"_footerTemplate","FooterTemplate"))},e.prototype.quickPopupClose=function(){this.resetQuickPopupTemplates(),this.parent.eventBase.focusElement(),this.quickPopup.relateTo="e-work-cells",this.fieldValidator.destroyToolTip(),this.quickPopup.element.querySelectorAll(".e-formvalidator").length&&this.fieldValidator.destroy(),this.destroyButtons(),R(this.quickPopup.element)},e.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=t.formatUnit(window.innerHeight));this.morePopup.element.querySelector(".e-header-date").focus(),this.morePopup.refreshPosition()},e.prototype.morePopupClose=function(){var e=this.parent.element.querySelector(".e-more-appointment-wrapper");e&&t.remove(e)},e.prototype.popupClose=function(){this.isCrudAction=!1,this.quickPopupHide(!0)},e.prototype.quickPopupHide=function(e){var t=this;if(this.quickPopup.element.classList.contains(Ge)){var i,n=this.quickPopup.element.querySelector(".e-cell-popup");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("e-quick-popup-wrapper");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(".e-event-popup"),l={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("popupClose",l,function(i){if(!(i=t.serializingData(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}})}},e.prototype.serializingData=function(e){if(t.isBlazor()){var i=this.parent.eventFields;if(e.data){var n=e.data;n[i.startTime]=this.parent.getDateTime(n[i.startTime]),n[i.endTime]=this.parent.getDateTime(n[i.endTime])}e.element&&(e.element=t.getElement(e.element)),e.target&&(e.target=t.getElement(e.target))}return e},e.prototype.navigationClick=function(e){var i=t.closest(e.target,".e-navigate");if(!t.isNullOrUndefined(i)){var n=this.parent.getDateFromElement(e.currentTarget);this.parent.isServerRenderer()&&(n=new Date(+n-6e4*n.getTimezoneOffset())),t.isNullOrUndefined(n)||(this.closeClick(),this.parent.setScheduleProperties({selectedDate:n}),this.parent.changeView(this.parent.getNavigateView(),e))}},e.prototype.documentClick=function(e){var i=e.event.target,n=".e-quick-popup-wrapper,.e-header-cells,.e-all-day-cells,.e-work-cells,.e-appointment,.e-popup",r=this.parent.element.querySelector(".e-quick-popup-wrapper");r&&r.childElementCount>0&&!t.closest(i,n)&&this.quickPopupHide();var a=this.parent.element.querySelector(".e-inline-subject");a&&a!==i&&this.parent.allowInline&&this.parent.inlineModule.documentClick(),t.closest(i,".e-appointment,.e-header-cells")&&this.parent.removeNewEventElement(),t.closest(i,n)||(this.quickPopupHide(),this.parent.removeNewEventElement()),t.closest(i,".e-more-popup-wrapper")||i.classList.contains("e-more-indicator")||t.closest(i,"."+Ge)||t.closest(i,".e-work-cells")||this.morePopup.hide()},e.prototype.onClosePopup=function(){this.quickPopupHide(),this.parent.eventBase.focusElement()},e.prototype.addEventListener=function(){this.parent.on("cellClick",this.cellClick,this),this.parent.on("eventClick",this.eventClick,this),this.parent.on("document-click",this.documentClick,this),this.parent.on(qe,this.updateMoreEventContent,this)},e.prototype.removeEventListner=function(){this.parent.off("cellClick",this.cellClick),this.parent.off("eventClick",this.eventClick),this.parent.off("document-click",this.documentClick),this.parent.off(qe,this.updateMoreEventContent)},e.prototype.destroyButtons=function(){for(var e=0,t=[].slice.call(this.quickPopup.element.querySelectorAll(".e-control.e-btn"));e<t.length;e++){var i=t[e].ej2_instances[0];i&&i.destroy()}},e.prototype.refreshQuickDialog=function(){this.quickDialog.element&&(this.quickDialog.destroy(),t.remove(this.quickDialog.element),this.quickDialog.element=null),this.renderQuickDialog()},e.prototype.refreshQuickPopup=function(){this.quickPopup.element&&(this.quickPopup.destroy(),t.remove(this.quickPopup.element),this.quickPopup.element=null),this.renderQuickPopup()},e.prototype.refreshMorePopup=function(){this.morePopup.element&&(this.morePopup.destroy(),t.remove(this.morePopup.element),this.morePopup.element=null),this.renderMorePopup()},e.prototype.destroy=function(){this.quickPopup.element.querySelectorAll(".e-formvalidator").length&&this.fieldValidator.destroy(),this.removeEventListner(),this.destroyButtons(),this.quickPopup.destroy(),t.remove(this.quickPopup.element),this.morePopup.destroy(),t.remove(this.morePopup.element),this.quickDialog.element&&(this.quickDialog.destroy(),t.remove(this.quickDialog.element),this.quickDialog.element=null)},e}(),jt=function(){function e(e){this.parent=e,this.tooltipObj=new i.Tooltip({content:"No title",position:"BottomRight",offsetY:10,mouseTrail:!this.parent.isAdaptive,showTipPointer:!1,cssClass:this.parent.cssClass+" "+Je,target:this.getTargets(),beforeRender:this.onBeforeRender.bind(this),enableRtl:this.parent.enableRtl}),t.isBlazor()&&(this.tooltipObj.beforeOpen=this.onBeforeOpen.bind(this),this.tooltipObj.beforeClose=this.onBeforeClose.bind(this),this.tooltipObj.animation={close:{effect:"None"}}),this.tooltipObj.appendTo(this.parent.element),this.tooltipObj.isStringTemplate=!0}return e.prototype.getTargets=function(){var e=[];return this.parent.activeViewOptions.group.headerTooltipTemplate&&e.push(".e-resource-cells"),this.parent.eventSettings.enableTooltip&&e.push(".e-appointment"),e.join(",")},e.prototype.onBeforeOpen=function(){if(this.parent.group.headerTooltipTemplate){e=this.parent.element.id+"_headerTooltipTemplate";t.updateBlazorTemplate(e,"HeaderTooltipTemplate",this.parent.group)}if(this.parent.eventSettings.tooltipTemplate){var e=this.parent.element.id+"_tooltipTemplate";t.updateBlazorTemplate(e,"TooltipTemplate",this.parent.eventSettings)}},e.prototype.onBeforeClose=function(){if(this.parent.group.headerTooltipTemplate){e=this.parent.element.id+"_headerTooltipTemplate";t.resetBlazorTemplate(e,"HeaderTooltipTemplate")}if(this.parent.eventSettings.tooltipTemplate){var e=this.parent.element.id+"_tooltipTemplate";t.resetBlazorTemplate(e,"TooltipTemplate")}},e.prototype.onBeforeRender=function(e){if(t.isNullOrUndefined(e.target.getAttribute("data-tooltip-id"))){if(e.target.classList.contains("e-resource-cells")&&this.parent.activeViewOptions.group.resources.length>0){var i=void 0;if(this.parent.activeView.isTimelineView()){var n=parseInt(e.target.getAttribute("data-group-index"),0);i=this.parent.resourceBase.lastResourceLevel[n]}else{var r=e.target.parentNode.sectionRowIndex,a=e.target.cellIndex;i=this.parent.activeView.getColumnLevels()[r][a]}var s={resource:i.resource,resourceData:i.resourceData},o=t.createElement("div"),l=this.parent.element.id+"_headerTooltipTemplate",c=[].slice.call(this.parent.getHeaderTooltipTemplate()(s,this.parent,"headerTooltipTemplate",l,!1));return t.append(c,o),void this.setContent(o)}var p=this.parent.eventBase.getEventByGuid(e.target.getAttribute("data-guid"));if(t.isNullOrUndefined(this.parent.eventSettings.tooltipTemplate)){var d=this.parent.globalize,h=this.parent.eventFields,u=new Date(""+p[h.startTime]),v=new Date(""+p[h.endTime]);v=0===v.getHours()&&0===v.getMinutes()?new Date(v.setMilliseconds(-1e3)):v;var m=T(new Date(""+u)),g=T(new Date(""+v)),f=p[h.subject]||this.parent.eventSettings.fields.subject.default,y=t.isNullOrUndefined(p[h.location])?"":p[h.location],w="",D="",b="";t.isBlazor()?(w=d.formatDate(u,{type:"date",format:"MMM d",calendar:this.parent.getCalendarMode()}),D=d.formatDate(u,{type:"date",format:"MMMM d, y",calendar:this.parent.getCalendarMode()}),b=d.formatDate(v,{type:"date",format:"MMMM d, y",calendar:this.parent.getCalendarMode()})):(w=d.formatDate(u,{type:"date",skeleton:"MMMd",calendar:this.parent.getCalendarMode()}),D=d.formatDate(u,{type:"date",skeleton:"medium",calendar:this.parent.getCalendarMode()}),b=d.formatDate(v,{type:"date",skeleton:"medium",calendar:this.parent.getCalendarMode()})),w=I(w,"single"),D=I(D,"single"),b=I(b,"single");var C=t.isBlazor()?"t":"short",E=d.formatDate(u,{type:"time",skeleton:C,calendar:this.parent.getCalendarMode()}),O=d.formatDate(v,{type:"time",skeleton:C,calendar:this.parent.getCalendarMode()}),S=void 0,x='<div><div class="e-subject">'+f+'</div><div class="e-location">'+y+'</div><div class="e-details">'+(S=m.getTime()===g.getTime()?I(S=t.isBlazor()?d.formatDate(u,{type:"date",format:"MMMM d, y",calendar:this.parent.getCalendarMode()}):d.formatDate(u,{type:"date",skeleton:"long",calendar:this.parent.getCalendarMode()}),"single"):m.getFullYear()===g.getFullYear()?w+" - "+b:D+" - "+b)+'</div><div class="e-all-day">'+(p[h.isAllDay]?this.parent.localeObj.getConstant("allDay"):E+" - "+O)+"</div></div>";this.setContent(x)}else{var o=t.createElement("div"),l=this.parent.element.id+"_tooltipTemplate",k=j(p,this.parent.eventFields),c=[].slice.call(this.parent.getEventTooltipTemplate()(k,this.parent,"tooltipTemplate",l,!1));t.append(c,o),this.setContent(o)}}},e.prototype.setContent=function(e){this.tooltipObj.setProperties({content:e},!0)},e.prototype.close=function(){this.tooltipObj.close()},e.prototype.destroy=function(){this.tooltipObj.destroy(),t.addClass([this.parent.element],"e-control"),this.tooltipObj=null},e}(),It=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])})(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)}}(),qt=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},Lt="e-input-wrapper",Bt="e-form-left",Nt="e-recurrence-count",Ft="e-hide-recurrence-element",Ut="e-primary",Wt={none:"",daily:"days",weekly:"weeks",monthly:"months",yearly:"years"},zt={sun:"SU",mon:"MO",tue:"TU",wed:"WE",thu:"TH",fri:"FR",sat:"SA"},_t=["e-days","e-non-week","e-end-on","e-interval","e-year-expander","e-month-expander"],Yt=["e-non-week"],Gt=["e-days","e-year-expander"],Qt=["e-days"],Xt=["e-days","e-non-week","e-year-expander","e-month-expander"],Kt=["e-end-on-date","e-end-on-count"],Zt=["e-end-on-date"],Jt=["e-end-on-count"],$t=function(e){function i(t,i){var n=e.call(this,t,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.calendarUtil=xe(n.calendarMode),n}return It(i,e),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 t.L10n(this.getModuleName(),this.defaultLocale,this.locale)},i.prototype.applyCustomClass=function(e){e&&t.addClass([this.element],e.split(" "))},i.prototype.initialize=function(){t.addClass([this.element],"e-"+this.getModuleName()),this.renderComponent(),t.isNullOrUndefined(this.value)||""===this.value?(t.isNullOrUndefined(this.repeatType.value)||(this.startState(this.repeatType.value.toString().toUpperCase(),"never",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(".e-days button")).forEach(function(e){return t.removeClass([e],["e-active",Ut])})},i.prototype.daySelection=function(e){this.resetDayButton();var i=[0,1,2,3,4,5,6];this.rotateArray(i,this.firstDayOfWeek);var n=this.element.querySelector('.e-days button[data-index="'+i.indexOf(e)+'"]');n&&t.addClass([n],["e-active",Ut])},i.prototype.rtlClass=function(e){e?t.addClass([this.element],"e-rtl"):t.removeClass([this.element],"e-rtl")},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:zt[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(e){var i=this;this.repeatType.setProperties({value:e});var n=this.element.querySelector(".e-end-on");switch("daily"===e?t.classList(n,[Bt],["e-form-right"]):t.classList(n,["e-form-right"],[Bt]),e){case"none":_t.forEach(function(e){return t.addClass([i.element.querySelector("."+e)],Ft)});break;case"weekly":Yt.forEach(function(e){return t.addClass([i.element.querySelector("."+e)],Ft)});break;case"monthly":Gt.forEach(function(e){return t.addClass([i.element.querySelector("."+e)],Ft)});break;case"yearly":Qt.forEach(function(e){return t.addClass([i.element.querySelector("."+e)],Ft)});break;case"daily":Xt.forEach(function(e){return t.addClass([i.element.querySelector("."+e)],Ft)})}},i.prototype.updateEndOnForm=function(e){var i=this;switch(this.endType.setProperties({value:e}),e){case"never":Kt.forEach(function(e){return t.addClass([i.element.querySelector("."+e)],Ft)});break;case"until":Jt.forEach(function(e){return t.addClass([i.element.querySelector("."+e)],Ft)});break;case"count":Zt.forEach(function(e){return t.addClass([i.element.querySelector("."+e)],Ft)})}},i.prototype.freshOnEndForm=function(){var e=this;Kt.forEach(function(i){var n=e.element.querySelector("."+i);n&&t.removeClass([n],Ft)})},i.prototype.showFormElement=function(){var e=this;_t.forEach(function(i){var n=e.element.querySelector("."+i);n&&t.removeClass([n],Ft)})},i.prototype.renderDropdowns=function(){var e=this,t=this;this.repeatType=new l.DropDownList({dataSource:this.getRepeatData(),floatLabelType:"Always",enableRtl:this.enableRtl,index:this.selectedType,fields:{text:"text",value:"value"},placeholder:this.localeObj.getConstant("repeat"),htmlAttributes:{title:this.localeObj.getConstant("repeat")},change:function(i){t.setProperties({selectedType:e.frequencies.indexOf(i.value)},!1),t.element.querySelector(".e-repeat-content").innerHTML=t.localeObj.getConstant(Wt[i.value]),t.showFormElement(),t.updateForm(i.value),t.resetFormValues(),t.triggerChangeEvent()}}),this.repeatType.appendTo(this.element.querySelector(".e-repeat-element")),this.endType=new l.DropDownList({dataSource:this.getEndData(),popupWidth:this.getPopupWidth(),enableRtl:this.enableRtl,index:1,fields:{text:"text",value:"value"},change:function(e){t.freshOnEndForm(),t.updateEndOnForm(e.value),t.resetFormValues(),t.triggerChangeEvent()}}),this.endType.appendTo(this.element.querySelector(".e-end-on-element"));var i=function(i){return new l.DropDownList({dataSource:i,popupWidth:e.getPopupWidth(),enableRtl:e.enableRtl,fields:{text:"text",value:"value"},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(".e-month-pos")),this.monthWeekDays=i(this.getDayData("wide")),this.monthWeekDays.appendTo(this.element.querySelector(".e-month-week")),this.monthValue=new l.DropDownList({dataSource:this.getMonthData(),fields:{text:"text",value:"value"},floatLabelType:"Always",enableRtl:this.enableRtl,index:7,change:function(e){t.resetFormValues(),t.triggerChangeEvent()}}),this.monthValue.appendTo(this.element.querySelector(".e-year-expander-element"))},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("e-repeat-interval")?(i.value=1,i.dataBind()):i.element.classList.contains(Nt)&&(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("e-repeat-interval")?1:n.element.classList.contains(Nt)?10:this.startDate.getDate(),n.value=n.value||r,n.dataBind()}}},i.prototype.getPopupWidth=function(){return t.Browser.isDevice?"100%":"auto"},i.prototype.renderDatePickers=function(){var e=this;this.untilDateObj=new r.DatePicker({firstDayOfWeek:this.firstDayOfWeek,enableRtl:this.enableRtl,locale:this.locale,min:this.minDate,max:this.maxDate,format:t.isNullOrUndefined(this.dateFormat)?this.getFormat("dateFormats"):this.dateFormat,change:function(t){t.value&&e.triggerChangeEvent()}}),this.untilDateObj.appendTo(this.element.querySelector(".e-until-date"))},i.prototype.getFormat=function(e){if(t.isBlazor())return"dateFormats"===e?t.IntlBase.compareBlazorDateFormats({skeleton:"d"},this.locale).format:t.IntlBase.compareBlazorDateFormats({skeleton:"t"},this.locale).format;return"en"===this.locale||"en-US"===this.locale?t.getValue(e+".short",t.getDefaultDateObject(this.getCalendarMode())):t.getValue("main."+this.locale+".dates.calendars."+this.getCalendarMode()+"."+e+".short",t.cldrData)},i.prototype.dayButtonRender=function(){for(var e=this,i=this,n=0,r=[].slice.call(this.element.querySelectorAll(".e-days button"));n<r.length;n++){var a=r[n],o=new s.Button({isToggle:!0,enableRtl:this.enableRtl},a);this.dayButtons.push(o),t.EventHandler.add(a,"click",function(n){var r=[].slice.call(e.element.querySelectorAll(".e-days button."+Ut)),a=n.target;a.classList.contains(Ut)?r.length>1&&(t.removeClass([a],Ut),i.triggerChangeEvent()):(t.addClass([a],Ut),i.triggerChangeEvent())})}},i.prototype.radioButtonRender=function(){var e=this;this.onMonthDay=new s.RadioButton({label:this.localeObj.getConstant("onDay"),enableRtl:this.enableRtl,name:"monthType",value:"day",change:function(t){e.resetFormValues(),e.triggerChangeEvent()}}),this.onMonthDay.appendTo(this.element.querySelector(".e-month-expander-element")),this.monthButtons.push(this.onMonthDay),this.onWeekDay=new s.RadioButton({label:"",name:"monthType",enableRtl:this.enableRtl,value:"daypos",change:function(t){e.resetFormValues(),e.triggerChangeEvent()}}),this.onWeekDay.appendTo(this.element.querySelector(".e-month-expander-wrapper")),this.monthButtons.push(this.onWeekDay)},i.prototype.numericTextboxRender=function(){var e=this;this.recurrenceCount=new o.NumericTextBox({value:10,format:"#",enableRtl:this.enableRtl,floatLabelType:"Always",min:1,max:999,change:function(t){e.triggerChangeEvent()}}),this.recurrenceCount.appendTo(this.element.querySelector("."+Nt)),this.monthDate=new o.NumericTextBox({value:1,format:"#",enableRtl:this.enableRtl,min:1,max:31,change:function(t){e.onMonthDay.setProperties({checked:!0}),e.triggerChangeEvent()}}),this.monthDate.appendTo(this.element.querySelector(".e-month-day")),this.repeatInterval=new o.NumericTextBox({value:1,format:"#",min:1,max:999,enableRtl:this.enableRtl,floatLabelType:"Always",placeholder:this.localeObj.getConstant("repeatEvery"),change:function(t){e.triggerChangeEvent()}}),this.repeatInterval.appendTo(this.element.querySelector(".e-repeat-interval"))},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["never","until","count"].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="none"===i?"never":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(e){t.isBlazor()&&"narrow"===e&&(e="short");var i,n=["sun","mon","tue","wed","thu","fri","sat"],r=[];if(this.rotateArray(n,this.firstDayOfWeek),"en"===this.locale||"en-US"===this.locale){a=t.isBlazor()?"days.":"days.stand-alone.";i=t.getValue(a+e,t.getDefaultDateObject(this.getCalendarMode()))}else{var a=t.isBlazor()?this.locale+".dates.days."+e:"main."+this.locale+".dates.calendars."+this.getCalendarMode()+".days.stand-alone."+e;i=t.getValue(a,t.cldrData)}for(var s=0,o=n;s<o.length;s++){var l=o[s],c=t.getValue(l,i);r.push({text:"narrow"===e?c:I(c,"single"),value:zt[l]})}return r},i.prototype.getMonthData=function(){var e,i=[];if("en"===this.locale||"en-US"===this.locale){n=t.isBlazor()?"months.wide":"months.stand-alone.wide";e=t.getValue(n,t.getDefaultDateObject(this.getCalendarMode()))}else{var n=t.isBlazor()?this.locale+".dates.months.wide":"main."+this.locale+".dates.calendars."+this.getCalendarMode()+".months.stand-alone.wide";e=t.getValue(n,t.cldrData)}for(var r=0,a=Object.keys(e);r<a.length;r++){var s=a[r];i.push({text:I(t.getValue(s,e),"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="e-input-wrapper e-form-left"><input type="text" tabindex="0" class="e-repeat-element"label="'+"e-repeat-element".substr(2)+'" /></div><div class="'+Lt+' e-interval e-form-right"><table  class="e-recurrence-table e-repeat-content-wrapper"><tr><td><input type="text" tabindex="0" class="e-repeat-interval"title="'+this.localeObj.getConstant("repeatEvery")+'" /></td><td><span class="e-repeat-content"></span></td></tr></table></div><div class="e-input-wrapper-side e-days '+Bt+'"><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="e-input-wrapper-side e-non-week '+Bt+'"><div class=e-month-expander-label>'+this.localeObj.getConstant("on")+'</div><div class="e-year-expander"><input class="e-year-expander-element" type="text" tabindex="0" title="'+this.localeObj.getConstant("yearExpander")+'"/></div><div class="e-month-expander"><table class="e-recurrence-table e-month-expand-wrapper"><tr><td><div class="'+Lt+' e-month-expander-checkbox-wrapper"><input class="e-month-expander-element"title="'+this.localeObj.getConstant("monthExpander")+'" type="radio"></div></td><td colspan="2"><div class="'+Lt+' e-monthday-element"><input type="text" tabindex="0" class="e-month-day"title="'+this.localeObj.getConstant("on")+'" /></div></td></tr><tr><td><div class="'+Lt+' e-month-expander-checkbox-wrapper" style="min-width: 30px;margin-bottom:18px;"><input class="e-month-expander-wrapper"title="'+this.localeObj.getConstant("monthExpander")+'" type="radio"></div></td><td><div class="'+Lt+' e-week-position" ><input type="text" tabindex="0" class="e-month-pos"title="'+this.localeObj.getConstant("monthPosition")+'" /></div></td><td><div class="'+Lt+'" style="min-width: 120px;"><input type="text" tabindex="0" class="e-month-week"title="'+this.localeObj.getConstant("monthWeek")+'" /></div></td></tr></table></div></div><div class="e-input-wrapper-side e-end-on e-form-right"><div class=e-end-on-label>'+this.localeObj.getConstant("end")+'</div><div class="'+Lt+' e-end-on-left"><input type="text" tabindex="0" class="e-end-on-element"title="'+this.localeObj.getConstant("end")+'" /></div><div class="'+Lt+' e-end-on-date" ><input type="text" tabindex="0" class="e-until-date"title="'+this.localeObj.getConstant("until")+'" /></div><div class="'+Lt+' e-end-on-count"><input type="text" tabindex="0" class="'+Nt+'"title="'+this.localeObj.getConstant("count")+'" /></div></div></div></div>'},i.prototype.getSelectedDaysData=function(){var e="BYDAY=",t=[].slice.call(this.element.querySelectorAll(".e-days button."+Ut)),i=["SU","MO","TU","WE","TH","FR","SA"];this.rotateArray(i,this.firstDayOfWeek);for(var n=0;n<t.length;n++)e+=i[parseInt(t[n].getAttribute("data-index"),10)]+(n===t.length-1?"":",");return e+";"},i.prototype.getSelectedMonthData=function(){return this.onWeekDay.checked?"BYDAY="+this.monthWeekDays.value+";BYSETPOS="+this.monthWeekPos.value+";":"BYMONTHDAY="+this.monthDate.value+";"},i.prototype.getIntervalData=function(){return"INTERVAL="+this.repeatInterval.value+";"},i.prototype.getEndOnCount=function(){return"COUNT="+this.recurrenceCount.value+";"},i.prototype.getYearMonthRuleData=function(){return"BYMONTH="+this.monthValue.value+";"},i.prototype.updateWeekButton=function(e){var t=["SU","MO","TU","WE","TH","FR","SA"];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[a])?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(zt);e<t.length;e++){var i=t[e];if(zt[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"until":this.untilDateObj.setProperties({value:this.ruleObject.until});break;case"count":this.recurrenceCount.setProperties({value:this.ruleObject.count})}switch(e){case"weekly":this.updateWeekButton(this.ruleObject.day);break;case"yearly":this.monthValue.setProperties({index:this.ruleObject.month[0]-1}),this.updateMonthUI();break;case"monthly":this.updateMonthUI()}},i.prototype.getUntilData=function(){return this.untilDateObj.value?"UNTIL="+ke(this.untilDateObj.value)+";":""},i.prototype.destroyComponents=function(){this.recurrenceCount.isDestroyed||this.recurrenceCount.destroy(),this.monthDate.isDestroyed||this.monthDate.destroy(),this.repeatInterval.isDestroyed||this.repeatInterval.destroy(),this.untilDateObj.isDestroyed||this.untilDateObj.destroy(),this.repeatType.isDestroyed||this.repeatType.destroy(),this.endType.isDestroyed||this.endType.destroy(),this.monthWeekPos.isDestroyed||this.monthWeekPos.destroy(),this.monthWeekDays.isDestroyed||this.monthWeekDays.destroy(),this.monthValue.isDestroyed||this.monthValue.destroy(),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("none","never",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 this.calendarMode.toLowerCase()},i.prototype.getRuleSummary=function(e){return void 0===e&&(e=this.getRecurrenceRule()),q(e,this.localeObj,this.locale,this.calendarMode)},i.prototype.getRecurrenceDates=function(e,i,n,r,a){return t.isBlazor()&&(e=new Date(""+e),a&&(a=new Date(""+a))),a=t.isNullOrUndefined(a)?this.startDate:a,B(e,i,n,this.firstDayOfWeek,r,a,this.calendarMode)},i.prototype.getRecurrenceRule=function(){var e="FREQ=";switch(this.repeatType.value){case"daily":e+="DAILY;";break;case"weekly":e+="WEEKLY;"+this.getSelectedDaysData();break;case"monthly":e+="MONTHLY;"+this.getSelectedMonthData();break;case"yearly":e+="YEARLY;"+this.getSelectedMonthData()+this.getYearMonthRuleData();break;case"none":return""}switch(e+=this.getIntervalData(),this.endType.value){case"until":e+=this.getUntilData();break;case"count":e+=this.getEndOnCount()}return e},i.prototype.setRecurrenceRule=function(e,i){if(void 0===i&&(i=this.startDate),t.isBlazor()&&(i=new Date(""+i)),!e)return void this.repeatType.setProperties({value:"none"});this.renderStatus=!1,this.ruleObject=fe(e);var n=this.ruleObject.count?"count":this.ruleObject.until?"until":"never";switch(this.ruleObject.freq){case"DAILY":this.startState("daily",n,i),this.updateUI("daily",n);break;case"WEEKLY":this.startState("weekly",n,i),this.updateUI("weekly",n);break;case"MONTHLY":this.startState("monthly",n,i),this.updateUI("monthly",n);break;case"YEARLY":this.startState("yearly",n,i),this.updateUI("yearly",n)}this.renderStatus=!0,this.triggerChangeEvent()},i.prototype.destroy=function(){this.destroyComponents(),e.prototype.destroy.call(this);var i=["e-"+this.getModuleName()];for(this.cssClass&&(i=i.concat(this.cssClass.split(" "))),t.removeClass([this.element],i);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(e,i){for(var n=0,r=Object.keys(e);n<r.length;n++)switch(r[n]){case"startDate":this.selectMonthDay(e.startDate),this.updateUntilDate(e.startDate),this.endType.setProperties({index:0});break;case"enableRtl":this.rtlClass(e.enableRtl);break;case"cssClass":i.cssClass&&t.removeClass([this.element],i.cssClass.split(" ")),e.cssClass&&t.addClass([this.element],e.cssClass.split(" "));break;case"selectedType":this.repeatType.setProperties({index:this.selectedType});break;case"minDate":this.untilDateObj.setProperties({minDate:this.minDate});break;case"maxDate":this.untilDateObj.setProperties({maxDate:this.maxDate});break;case"value":this.getRecurrenceRule()!==this.value&&this.setRecurrenceRule(this.value);break;case"calendarMode":this.calendarMode=e.calendarMode,this.calendarUtil=xe(e.calendarMode);break;case"locale":case"frequencies":case"firstDayOfWeek":this.refresh();break;case"dateFormat":this.untilDateObj.setProperties({format:e.dateFormat})}},qt([t.Property(["none","daily","weekly","monthly","yearly"])],i.prototype,"frequencies",void 0),qt([t.Property(0)],i.prototype,"firstDayOfWeek",void 0),qt([t.Property(new Date)],i.prototype,"startDate",void 0),qt([t.Property()],i.prototype,"dateFormat",void 0),qt([t.Property("Gregorian")],i.prototype,"calendarMode",void 0),qt([t.Property()],i.prototype,"cssClass",void 0),qt([t.Property()],i.prototype,"value",void 0),qt([t.Property(new Date(1900,0,1))],i.prototype,"minDate",void 0),qt([t.Property(new Date(2099,11,31))],i.prototype,"maxDate",void 0),qt([t.Property(0)],i.prototype,"selectedType",void 0),qt([t.Event()],i.prototype,"change",void 0),i=qt([t.NotifyPropertyChanges],i)}(t.Component),ei=function(){function e(e){this.parent=e,this.l10n=this.parent.localeObj,this.fields=this.parent.eventFields,this.eventWindowTime={startTime:new Date,endTime:new Date},this.fieldValidator=new Pt,this.renderEventWindow()}return e.prototype.renderEventWindow=function(){this.element=t.createElement("div",{id:this.parent.element.id+"_dialog_wrapper"}),this.parent.element.appendChild(this.element);var e={animationSettings:{effect:"Zoom"},content:this.getEventWindowContent(),cssClass:"e-schedule-dialog",enableRtl:this.parent.enableRtl,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?(e.cssClass="e-schedule-dialog e-device",e.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>'):(e.buttons=[{buttonModel:{content:this.l10n.getConstant("deleteButton"),cssClass:"e-event-delete",disabled:!this.parent.eventSettings.allowDeleting||this.parent.readonly},click:this.eventDelete.bind(this)},{buttonModel:{content:this.l10n.getConstant("saveButton"),cssClass:"e-primary e-event-save",isPrimary:!0,disabled:!this.parent.eventSettings.allowAdding||this.parent.readonly},click:this.eventSave.bind(this)},{buttonModel:{cssClass:"e-event-cancel",content:this.l10n.getConstant("cancelButton")},click:this.dialogClose.bind(this)}],e.header='<div class="e-title-text">'+this.l10n.getConstant("newEvent")+"</div>"),this.dialogObject=new i.Dialog(e,this.element),this.dialogObject.isStringTemplate=!0,this.dialogObject.element.querySelector(".e-dlg-closeicon-btn")&&this.dialogObject.element.querySelector(".e-dlg-closeicon-btn").setAttribute("title",this.l10n.getConstant("close")),t.addClass([this.element.parentElement],"e-schedule-dialog-container"),this.parent.isAdaptive&&(t.EventHandler.add(this.element.querySelector(".e-back-icon"),"click",this.dialogClose,this),t.EventHandler.add(this.element.querySelector(".e-save-icon"),"click",this.eventSave,this)),this.applyFormValidation()},e.prototype.updateEditorTemplate=function(){this.parent.editorTemplate&&t.updateBlazorTemplate(this.parent.element.id+"_editorTemplate","EditorTemplate",this.parent)},e.prototype.resetEditorTemplate=function(){this.parent.editorTemplate&&t.resetBlazorTemplate(this.parent.element.id+"_editorTemplate","EditorTemplate")},e.prototype.refresh=function(){this.destroy(),this.renderEventWindow()},e.prototype.refreshRecurrenceEditor=function(){if(this.recurrenceEditor){var e=this.recurrenceEditor.element;this.recurrenceEditor.destroy(),this.createRecurrenceEditor(e)}},e.prototype.setRecurrenceEditor=function(e){this.parent.editorTemplate&&(this.recurrenceEditor=e)},e.prototype.openEditor=function(e,i,n,r){if(this.parent.currentAction=i,this.parent.removeNewEventElement(),this.parent.quickPopup.quickPopupHide(!0),this.parent.inlineModule.removeInlineAppointmentElement(),"Add"===i){var a={};this.cellClickAction=!n,this.parent.activeCellsData=e;var s=e;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),e=a}switch(t.isNullOrUndefined(this.parent.editorTemplate)||this.renderFormElements(this.element.querySelector(".e-schedule-form"),e),!this.parent.isAdaptive&&t.isNullOrUndefined(this.parent.editorTemplate)&&t.removeClass([this.dialogObject.element.querySelector(".e-recurrenceeditor")],"e-disable"),this.recurrenceEditor&&(this.recurrenceEditor.firstDayOfWeek=this.parent.activeViewOptions.firstDayOfWeek),i){case"Add":this.onCellDetailsUpdate(e,r);break;case"Save":case"EditOccurrence":case"EditSeries":case"EditFollowingEvents":"EditOccurrence"===i&&!this.parent.isAdaptive&&t.isNullOrUndefined(this.parent.editorTemplate)&&t.addClass([this.dialogObject.element.querySelector(".e-recurrenceeditor")],"e-disable"),this.cellClickAction=!1,this.onEventDetailsUpdate(e)}},e.prototype.setDialogContent=function(){this.dialogObject.content=this.getEventWindowContent(),this.dialogObject.dataBind()},e.prototype.onBeforeOpen=function(e){var i=this,n={type:"Editor",data:this.eventData,cancel:!1,element:this.element,target:this.cellClickAction?this.parent.activeCellsData.element:this.parent.activeEventData.element};this.cellClickAction&&(n.duration=this.getSlotDuration());var r=this.getInstance("e-event-save");r&&(r.disabled=!(this.cellClickAction?this.parent.eventSettings.allowAdding:this.parent.eventSettings.allowEditing),r.dataBind());var s=this.getInstance("e-event-delete");s&&(s.disabled=!this.parent.eventSettings.allowDeleting,s.dataBind());var o=new a.Deferred;return this.parent.trigger("popupOpen",n,function(n){if(e.cancel=n.cancel,i.duration=i.cellClickAction?n.duration:null,i.refreshDateTimePicker(i.duration),i.cellClickAction&&n.duration!==i.getSlotDuration()&&t.isNullOrUndefined(i.parent.editorTemplate)){var r=i.getInstance("e-start"),a=i.getInstance("e-end");a.value=new Date(r.value.getTime()+Fe*n.duration),a.dataBind()}!t.isBlazor()&&i.parent.editorTemplate&&i.element.querySelector(".e-recurrenceeditor")&&!i.recurrenceEditor&&(i.recurrenceEditor=i.getInstance("e-recurrenceeditor")),o.resolve(e)}),o},e.prototype.onBeforeClose=function(e){var i=this;e.isInteracted&&(this.isCrudAction=!1);var n={type:"Editor",data:this.eventCrudData,cancel:!1,element:this.element,target:this.cellClickAction?this.parent.activeCellsData.element:this.parent.activeEventData.element},r=new a.Deferred;return this.parent.trigger("popupClose",n,function(n){if(t.isBlazor()){var a=i.parent.eventFields;if(n.data){var s=n.data;s[a.startTime]=i.parent.getDateTime(s[a.startTime]),s[a.endTime]=i.parent.getDateTime(s[a.endTime])}n.element&&(n.element=t.getElement(n.element)),n.target&&(n.target=t.getElement(n.target))}e.cancel=n.cancel,n.cancel||(i.resetEditorTemplate(),i.updateEditorTemplate(),i.isCrudAction&&(e.cancel=i.processCrudActions(n.data),i.isCrudAction=e.cancel),i.isCrudAction||(i.resetForm(),i.parent.eventBase.focusElement(),i.eventCrudData=null)),r.resolve(e)}),r},e.prototype.getEventWindowContent=function(){var e=t.createElement("div",{className:"e-form-container"}),i=t.createElement("form",{id:this.parent.element.id+"EditForm",className:Ze,attrs:{onsubmit:"return false;"}});return this.renderFormElements(i),e.appendChild(i),e},e.prototype.renderFormElements=function(e,i){if(t.isNullOrUndefined(this.parent.editorTemplate))e.appendChild(this.getDefaultEventWindowContent());else{if(i){this.recurrenceEditor&&(this.recurrenceEditor.destroy(),this.recurrenceEditor=null),this.destroyComponents();for(var n=0,r=[].slice.call(e.children);n<r.length;n++){var a=r[n];t.remove(a)}}if(!t.isBlazor()||t.isBlazor()&&i){var s=this.parent.element.id+"_editorTemplate",o=[].slice.call(this.parent.getEditorTemplate()(i||{},this.parent,"editorTemplate",s,!1));t.append(o,e),this.updateEditorTemplate()}}},e.prototype.getDefaultEventWindowContent=function(){var e=this.createDivElement("e-dialog-parent"),i=this.createDivElement("e-title-location-row");e.appendChild(i),i.appendChild(this.renderTextBox("e-subject")),i.querySelector(".e-subject").setAttribute("title",this.parent.editorTitles.subject),i.appendChild(this.renderTextBox("e-location")),i.querySelector(".e-location").setAttribute("title",this.parent.editorTitles.location);var n=this.createDivElement("e-start-end-row");e.appendChild(n),n.appendChild(this.renderDateTimePicker("e-start",this.onTimeChange.bind(this))),n.querySelector(".e-start").setAttribute("title",this.parent.editorTitles.startTime),n.appendChild(this.renderDateTimePicker("e-end")),n.querySelector(".e-end").setAttribute("title",this.parent.editorTitles.endTime);var r=this.createDivElement("e-all-day-time-zone-row");e.appendChild(r),r.appendChild(this.renderCheckBox("e-all-day")),r.appendChild(this.renderCheckBox("e-time-zone"));var a=this.createDivElement("e-time-zone-row");e.appendChild(a),a.appendChild(this.renderDropDown("e-start-time-zone")),a.appendChild(this.renderDropDown("e-end-time-zone"));var o=this.createDivElement("e-repeat-parent-row");e.appendChild(o);var l=this.renderCheckBox("e-repeat"),c=t.createElement("span",{className:"e-recurrence-container"}),p=t.createElement("button",{className:"e-recurrence-edit-button",attrs:{type:"button",title:this.l10n.getConstant("editRecurrence")}});if(this.buttonObj=new s.Button({iconCss:"e-recurrence-edit e-icons",cssClass:"e-medium "+this.parent.cssClass}),c.appendChild(p),this.buttonObj.appendTo(p),this.buttonObj.isStringTemplate=!0,l.appendChild(c),o.appendChild(l),this.parent.isAdaptive?t.EventHandler.add(p,"click",this.loadRecurrenceEditor,this):this.createRecurrenceEditor(e),this.parent.resourceCollection.length>0){for(var d=this.createDivElement("e-resources-row"),h=0,u=this.parent.resourceBase.resourceCollection;h<u.length;h++){var v=u[h];d.appendChild(this.renderResourceDetails(v))}e.appendChild(d)}var m=this.createDivElement("e-description-row");m.appendChild(this.renderTextBox("e-description")),m.querySelector(".e-description").setAttribute("title",this.parent.editorTitles.description),e.appendChild(m);var g=t.createElement("button",{attrs:{type:"hidden",title:"submit",style:"display:none"}});return e.appendChild(g),e},e.prototype.createRecurrenceEditor=function(e){var t=this.createDivElement();e.appendChild(t),this.recurrenceEditor=this.renderRecurrenceEditor(),this.recurrenceEditor.appendTo(t)},e.prototype.createDivElement=function(e){return t.createElement("div",{className:e})},e.prototype.createInputElement=function(e,i,n){return t.createElement(n||"input",{className:e,attrs:{type:"text",name:i,value:"",id:i,title:""===this.l10n.getConstant(i.charAt(0).toLowerCase()+i.slice(1))?i:this.l10n.getConstant(i.charAt(0).toLowerCase()+i.slice(1))}})},e.prototype.getSlotDuration=function(){return this.parent.activeViewOptions.timeScale.interval/this.parent.activeViewOptions.timeScale.slotCount},e.prototype.renderDateTimePicker=function(e,i){var n=this.createDivElement(e+"-container"),a=this.getFieldName(e),s=this.createInputElement(e+" e-field",a);n.appendChild(s);var o=new r.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",format:(t.isNullOrUndefined(this.parent.dateFormat)?this.getFormat("dateFormats"):this.parent.dateFormat)+" "+this.getFormat("timeFormats"),placeholder:this.getFieldLabel(e),step:this.getSlotDuration(),width:"100%"});return o.isStringTemplate=!0,o.appendTo(s),n},e.prototype.refreshDateTimePicker=function(e){for(var t=0,i=[].slice.call(this.element.querySelectorAll(".e-start,.e-end"));t<i.length;t++){var n=i[t].ej2_instances[0];n.firstDayOfWeek=this.parent.activeViewOptions.firstDayOfWeek,n.step=e||this.getSlotDuration(),n.dataBind()}},e.prototype.onTimeChange=function(){var e=this.getInstance("e-start");if(e.element.parentElement.classList.contains("e-input-focus")){var i=this.getInstance("e-end"),n=0;this.cellClickAction?(n=Fe*this.duration,this.eventWindowTime.startTime=e.value):n=this.eventData[this.fields.endTime].getTime()-this.eventData[this.fields.startTime].getTime();var r=t.isNullOrUndefined(e.value)?null:new Date(e.value.getTime()+n);this.cellClickAction&&(this.eventWindowTime.endTime=r),i.value=r,i.dataBind()}},e.prototype.renderResourceDetails=function(e){var t=e.field,i="e-"+t,n=e.title,r=this.createDivElement(i+"-container e-resources"),a=this.createInputElement(i+" e-field",t);r.appendChild(a);var s='<div class="e-resource-template"><div class="e-resource-color" style="background-color:${'+e.colorField+'}"></div><div class="e-resource-text">${'+e.textField+"}</div></div>";if(e.allowMultiple){var o=new l.MultiSelect({cssClass:this.parent.cssClass||"",dataSource:e.dataSource,change:this.onMultiselectResourceChange.bind(this),itemTemplate:s,fields:{text:e.textField,value:e.idField},htmlAttributes:{title:n,name:t},floatLabelType:"Always",placeholder:n,popupHeight:"230px",popupWidth:"447px",mode:"Box"});o.appendTo(a),o.isStringTemplate=!0}else{var c=new l.DropDownList({cssClass:this.parent.cssClass||"",change:this.onDropdownResourceChange.bind(this),dataSource:e.dataSource,enableRtl:this.parent.enableRtl,fields:{text:e.textField,value:e.idField},htmlAttributes:{title:n,name:t},floatLabelType:"Always",placeholder:n,popupHeight:"230px",popupWidth:"447px",itemTemplate:s});c.appendTo(a),c.isStringTemplate=!0}return r},e.prototype.renderDropDown=function(e){var t=this.getFieldName(e),i=this.createDivElement(e+"-container"),n=this.createInputElement(e+" e-field",t);i.appendChild(n);var r=new l.DropDownList({allowFiltering:!0,change:this.onTimezoneChange.bind(this),cssClass:this.parent.cssClass||"",dataSource:ot,enableRtl:this.parent.enableRtl,fields:{text:"Text",value:"Value"},filterBarPlaceholder:"Search Timezone",filtering:function(e){var t=new a.Query;t=""!==e.text?t.where("Text","contains",e.text,!0):t,e.updateData(ot,t)},htmlAttributes:{title:this.getFieldLabel(e),name:t},floatLabelType:"Always",placeholder:this.getFieldLabel(e),popupHeight:"230px"});return r.appendTo(n),r.isStringTemplate=!0,i},e.prototype.onMultiselectResourceChange=function(e){if(e.value&&this.parent.activeViewOptions.group.byGroupID&&!(this.parent.resourceCollection.length<=1))for(var t=this.parent.resourceBase.resourceCollection,i=e.element.getAttribute("name")||this.getColumnName(e.element),n=0;n<t.length;n++)if(t[n].field===i&&n<t.length-1){for(var r=this.createInstance(n),a=[],s=this,o=0;o<e.value.length;o++)!function(i){var r=t[n+1],o=r.dataSource.filter(function(t){return t[r.groupIDField]===e.value[i]})[0][t[n+1].groupIDField],l=s.filterDatasource(n,o);a=a.concat(l)}(o);r.dataSource=a,r.dataBind()}},e.prototype.createInstance=function(e){var t=this.parent.resourceBase.resourceCollection[e+1];return this.element.querySelector(".e-"+t.field).ej2_instances[0]},e.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[n].field===t){var r=this.createInstance(n),a=e.itemData[i[n].idField];r.dataSource=this.filterDatasource(n,a),r.dataBind();var s=r.dataSource[0][i[n+1].idField];r.value=i[n+1].allowMultiple?[s]:s,r.dataBind()}},e.prototype.filterDatasource=function(e,t){var i=this.parent.resourceBase.resourceCollection[e+1];return i.dataSource.filter(function(e){return e[i.groupIDField]===t})},e.prototype.onTimezoneChange=function(e){if((e.element.getAttribute("name")||this.getColumnName(e.element))===this.parent.eventFields.startTimezone){var t=this.getInstance("e-start-time-zone"),i=this.getInstance("e-end-time-zone");i.value=t.value,i.dataBind()}},e.prototype.renderCheckBox=function(e){var t=this.createDivElement(e+"-container"),i=this.getFieldName(e),n=this.createInputElement(e+" e-field",i);t.appendChild(n);var r=new s.CheckBox({change:this.onChange.bind(this),cssClass:e+" "+this.parent.cssClass,enableRtl:this.parent.enableRtl,label:this.getFieldLabel(e)});return r.appendTo(n),r.isStringTemplate=!0,n.setAttribute("name",i),"Repeat"===i&&(this.repeatStatus=r),t},e.prototype.renderTextBox=function(e){var t=this.createDivElement(e+"-container"),i=this.getFieldName(e),n="e-description"===e?"textarea":"input",r=this.createInputElement(e+" e-field",i,n);return t.appendChild(r),o.Input.createInput({element:r,floatLabelType:"Always",properties:{enableRtl:this.parent.enableRtl,placeholder:this.getFieldLabel(e)}}),t},e.prototype.getFieldName=function(e){var t="";switch(e){case"e-subject":t=this.fields.subject;break;case"e-location":t=this.fields.location;break;case"e-start":t=this.fields.startTime;break;case"e-end":t=this.fields.endTime;break;case"e-description":t=this.fields.description;break;case"e-all-day":t=this.fields.isAllDay;break;case"e-start-time-zone":t=this.fields.startTimezone;break;case"e-end-time-zone":t=this.fields.endTimezone;break;case"e-time-zone":t="Timezone";break;case"e-repeat":t="Repeat"}return t},e.prototype.getFieldLabel=function(e){var t="";switch(e){case"e-subject":t=this.parent.editorTitles.subject;break;case"e-location":t=this.parent.editorTitles.location;break;case"e-description":t=this.parent.editorTitles.description;break;case"e-start":t=this.parent.editorTitles.startTime;break;case"e-end":t=this.parent.editorTitles.endTime;break;case"e-start-time-zone":t=this.parent.editorTitles.startTimezone;break;case"e-end-time-zone":t=this.parent.editorTitles.endTimezone;break;case"e-repeat":t=this.parent.editorTitles.recurrenceRule;break;case"e-all-day":t=this.parent.editorTitles.isAllDay;break;case"e-time-zone":t=this.l10n.getConstant("timezone")}return t},e.prototype.onChange=function(e){var t=e.event.target;t.classList.contains("e-all-day")?this.onAllDayChange(e.checked):t.classList.contains("e-time-zone")?this.timezoneChangeStyle(e.checked):t.classList.contains("e-repeat")&&this.onRepeatChange(e.checked)},e.prototype.renderRepeatDialog=function(){var e=t.createElement("div");this.repeatDialogObject=new i.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,isModal:!0,cssClass:"e-recurrence-dialog",open:this.repeatOpenDialog.bind(this)}),this.element.appendChild(e),this.repeatDialogObject.appendTo(e),this.repeatDialogObject.isStringTemplate=!0,this.createRecurrenceEditor(this.repeatDialogObject.element.querySelector(".e-rec-editor"))},e.prototype.loadRecurrenceEditor=function(){this.repeatDialogObject.show(),this.recurrenceEditor&&this.repeatRule&&this.recurrenceEditor.setRecurrenceRule(this.repeatRule)},e.prototype.onRepeatChange=function(e){if(e)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(".e-recurrence-container");t.addClass([i],"e-hide")}},e.prototype.repeatSaveDialog=function(){this.repeatRule=this.recurrenceEditor.getRecurrenceRule();var e=this.element.querySelector(".e-recurrence-container");this.recurrenceEditor.getRecurrenceRule()?t.removeClass([e],"e-hide"):(t.addClass([e],"e-hide"),this.repeatStatus.setProperties({checked:!1})),this.updateRepeatLabel(this.repeatRule),this.closeRepeatDialog()},e.prototype.closeRepeatDialog=function(){this.repeatDialogObject.hide()},e.prototype.repeatCancelDialog=function(){this.closeRepeatDialog(),this.recurrenceEditor&&this.recurrenceEditor.setRecurrenceRule(this.repeatTempRule),this.repeatTempRule||this.repeatStatus.setProperties({checked:!1})},e.prototype.repeatOpenDialog=function(){this.repeatTempRule=this.recurrenceEditor.getRecurrenceRule()},e.prototype.onCellDetailsUpdate=function(e,i){if(this.parent.eventSettings.allowAdding){this.element.querySelector("."+Ze).removeAttribute("data-id"),this.element.querySelector(".e-title-text").innerHTML=this.l10n.getConstant("newEvent"),e.Timezone=!1,this.repeatStartDate=e[this.fields.startTime],this.repeatRule="",t.isNullOrUndefined(this.parent.eventSettings.fields.subject.default)||(e[this.fields.subject]=this.parent.eventSettings.fields.subject.default),t.isNullOrUndefined(this.parent.eventSettings.fields.location.default)||(e[this.fields.location]=this.parent.eventSettings.fields.location.default),t.isNullOrUndefined(this.parent.eventSettings.fields.description.default)||(e[this.fields.description]=this.parent.eventSettings.fields.description.default),this.showDetails(e),e[this.fields.recurrenceRule]&&this.recurrenceEditor&&(this.recurrenceEditor.setRecurrenceRule(e[this.fields.recurrenceRule],e[this.fields.startTime]),this.repeatRule=e[this.fields.recurrenceRule]);var n=this.element.querySelector(".e-event-delete");if(n&&t.addClass([n],"e-disable"),this.recurrenceEditor&&this.recurrenceEditor.setProperties({startDate:e[this.fields.startTime],selectedType:t.isNullOrUndefined(i)?t.isNullOrUndefined(e[this.fields.recurrenceRule])?0:this.recurrenceEditor.selectedType:i}),this.parent.isAdaptive&&t.isNullOrUndefined(this.parent.editorTemplate)){var r=this.element.querySelector(".e-recurrence-container");t.addClass([r],"e-hide"),this.updateRepeatLabel(this.repeatRule)}else{var a=this.element.querySelector(".e-event-save");this.disableButton(a,!1)}this.dialogObject.show()}},e.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)},e.prototype.applyFormValidation=function(){var e=function(e){return e&&Object.keys(e).length>0?e:void 0},t=this.element.querySelector("."+Ze),i={};i[this.parent.eventSettings.fields.subject.name]=e(this.parent.eventSettings.fields.subject.validation),i[this.parent.eventSettings.fields.location.name]=e(this.parent.eventSettings.fields.location.validation),i[this.parent.eventSettings.fields.startTime.name]=e(this.parent.eventSettings.fields.startTime.validation),i[this.parent.eventSettings.fields.endTime.name]=e(this.parent.eventSettings.fields.endTime.validation),i[this.parent.eventSettings.fields.description.name]=e(this.parent.eventSettings.fields.description.validation),this.fieldValidator.renderFormValidator(t,i,this.element)},e.prototype.showDetails=function(e){var i=t.extend({},e,null,!0);0===i[this.fields.endTime].getHours()&&0===i[this.fields.endTime].getMinutes()&&this.trimAllDay(i),this.eventData=i;for(var n=this.getFormElements("e-schedule-dialog"),r=Object.keys(i),a=0,s=n;a<s.length;a++){var o=s[a],l=o.name||this.getColumnName(o);t.isNullOrUndefined(l)||""===l||(-1!==r.indexOf(l)?this.setValueToElement(o,i[l]):this.setDefaultValueToElement(o))}if(t.isNullOrUndefined(this.parent.editorTemplate)){this.onAllDayChange(i[this.fields.isAllDay]);var c=this.getInstance("e-time-zone.e-field");t.isNullOrUndefined(i[this.fields.startTimezone])&&t.isNullOrUndefined(i[this.fields.endTimezone])||(c.checked=!0,c.dataBind()),this.timezoneChangeStyle(c.checked),delete i.Timezone}},e.prototype.getColumnName=function(e){var i=e.getAttribute("data-name")||"";if(""===i){var n=!1,r="";e.classList.contains("e-dropdownlist")?(r="e-ddl",n=!0):e.classList.contains("e-multiselect")?(r="e-multiselect",n=!0):e.classList.contains("e-datetimepicker")?r="e-datetimepicker":e.classList.contains("e-datepicker")?r="e-datepicker":e.classList.contains("e-checkbox")&&(r="e-checkbox");var a=n?"."+r+":not(.e-control)":"."+r,s=t.closest(e,a)||e.querySelector("."+r);if(s){var o=s.querySelector("[name]");o&&(i=o.name)}}return i},e.prototype.onAllDayChange=function(e){var i,n=this.getInstance("e-start"),r=this.getInstance("e-end"),a=this.element.querySelector(".e-time-zone-container");e?(i=t.isNullOrUndefined(this.parent.dateFormat)?this.getFormat("dateFormats"):this.parent.dateFormat,t.addClass(this.element.querySelectorAll(".e-time-icon"),"e-icon-disable"),t.addClass([a],"e-disable"),this.element.querySelector(".e-time-zone-row")&&t.removeClass([this.element.querySelector(".e-time-zone-row")],"e-enable"),n.format=r.format=i):(i=t.isNullOrUndefined(this.parent.dateFormat)?this.getFormat("dateFormats")+" "+this.getFormat("timeFormats"):this.parent.dateFormat+" "+this.getFormat("timeFormats"),t.removeClass(this.element.querySelectorAll(".e-time-icon"),"e-icon-disable"),t.removeClass([a],"e-disable"),this.element.querySelector(".e-checkbox-wrapper .e-time-zone").checked&&t.addClass([this.element.querySelector(".e-time-zone-row")],"e-enable"),n.format=r.format=i),this.cellClickAction&&this.updateDateTime(e,n,r),n.dataBind(),r.dataBind(),t.isNullOrUndefined(this.recurrenceEditor)||this.recurrenceEditor.updateRuleUntilDate(n.value)},e.prototype.updateDateTime=function(e,t,i){var n,r;if(e)if(n=T(new Date(this.eventWindowTime.startTime.getTime())),this.parent.activeCellsData.isAllDay){var a=b(new Date(this.eventWindowTime.endTime.getTime()),-1).getTime();r=+this.eventWindowTime.startTime>a?this.eventWindowTime.endTime:new Date(a)}else r=T(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(Fe*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()},e.prototype.getFormat=function(e){if(t.isBlazor())return"dateFormats"===e?t.IntlBase.compareBlazorDateFormats({skeleton:"d"},this.parent.locale).format:t.IntlBase.compareBlazorDateFormats({skeleton:"t"},this.parent.locale).format;return"en"===this.parent.locale||"en-US"===this.parent.locale?t.getValue(e+".short",t.getDefaultDateObject(this.parent.getCalendarMode())):t.getValue("main."+this.parent.locale+".dates.calendars."+this.parent.getCalendarMode()+"."+e+".short",t.cldrData)},e.prototype.onEventDetailsUpdate=function(e){if(this.parent.eventSettings.allowEditing){if(this.parent.isAdaptive||t.removeClass([this.element.querySelector(".e-event-delete")],"e-disable"),this.element.querySelector(".e-title-text").innerHTML=this.l10n.getConstant("editEvent"),this.element.querySelector("."+Ze).setAttribute("data-id",e[this.fields.id].toString()),t.isNullOrUndefined(this.parent.editorTemplate)){e=t.extend({},e,null,!0);var i=this.getInstance("e-time-zone.e-field"),n=void 0;e[this.fields.startTimezone]||e[this.fields.endTimezone]?(n=!0,this.parent.eventBase.timezoneConvert(e)):n=!1,e.Timezone=n,i.checked=n,i.dataBind()}if(this.showDetails(e),e[this.fields.recurrenceRule]&&this.recurrenceEditor?this.recurrenceEditor.setRecurrenceRule(e[this.fields.recurrenceRule],e[this.fields.startTime]):!this.parent.isAdaptive&&this.recurrenceEditor&&(this.recurrenceEditor.setProperties({startDate:e[this.fields.startTime]}),this.recurrenceEditor.setRecurrenceRule("")),this.repeatStartDate=e[this.fields.startTime],this.repeatRule="",e[this.fields.recurrenceRule]&&(this.recurrenceEditor&&this.recurrenceEditor.setRecurrenceRule(e[this.fields.recurrenceRule],e[this.fields.startTime]),this.repeatRule=e[this.fields.recurrenceRule]),this.parent.isAdaptive&&t.isNullOrUndefined(this.parent.editorTemplate)){var r=this.element.querySelector(".e-recurrence-container");e[this.fields.recurrenceRule]?(t.removeClass([r],"e-hide"),this.repeatStatus.setProperties({checked:!0})):(t.addClass([r],"e-hide"),this.repeatStatus.setProperties({checked:!1})),this.updateRepeatLabel(this.repeatRule)}var a=this.parent.readonly||e[this.fields.isReadonly];if(this.parent.isAdaptive){var s=this.element.querySelector(".e-save-icon");s&&(a?t.addClass([s],"e-icon-disable"):t.removeClass([s],"e-icon-disable"))}else{var o=this.element.querySelector(".e-event-save"),l=this.element.querySelector(".e-event-delete");this.disableButton(o,a),this.disableButton(l,a)}this.dialogObject.show()}},e.prototype.disableButton=function(e,t){e&&(e.ej2_instances[0].disabled=t)},e.prototype.renderRecurrenceEditor=function(){return new $t({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})},e.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})},e.prototype.dialogClose=function(){this.isCrudAction=!1,this.parent.activeEventData={event:void 0,element:void 0},this.parent.currentAction=null,this.dialogObject.hide()},e.prototype.resetForm=function(){this.fieldValidator.destroyToolTip(),this.resetFormFields(),this.parent.isAdaptive||!this.recurrenceEditor||this.recurrenceEditor.isDestroyed||this.recurrenceEditor.resetFields()},e.prototype.timezoneChangeStyle=function(e){var i=this.element.querySelector(".e-time-zone-row"),n=this.parent.tzModule.getLocalTimezoneName();if(e){t.addClass([i],"e-enable");var r=this.getInstance("e-start-time-zone"),a=this.getInstance("e-end-time-zone"),s=r.dataSource;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 t.removeClass([i],"e-enable")},e.prototype.resetFormFields=function(){for(var e=0,i=this.getFormElements("e-schedule-dialog");e<i.length;e++){var n=i[e],r=n.name||this.getColumnName(n);t.isNullOrUndefined(r)||""===r||this.setDefaultValueToElement(n)}},e.prototype.eventSave=function(e){var t=this.element.querySelector("."+Ze);if(!t||!t.classList.contains("e-formvalidator")||t.ej2_instances[0].validate()){var i=this.getEventDataFromEditor();this.processEventValidation(i.tempData,e)||(this.eventCrudData=i.eventData,this.isCrudAction=!0,this.dialogObject.hide())}},e.prototype.getEventDataFromEditor=function(){var e=t.extend({},this.getObjectFromFormData("e-schedule-dialog"));e.Timezone||(e[this.fields.startTimezone]=null,e[this.fields.endTimezone]=null),delete e.Timezone,delete e.Repeat,this.setDefaultValueToObject(e),e[this.fields.recurrenceRule]=this.recurrenceEditor?this.recurrenceEditor.getRecurrenceRule()||null:void 0;var i=t.extend({},e,null,!0);return e[this.fields.isAllDay]&&(e[this.fields.startTime]=t.isNullOrUndefined(e[this.fields.startTime])?null:T(new Date(e[this.fields.startTime].getTime())),e[this.fields.endTime]=t.isNullOrUndefined(e[this.fields.endTime])?null:b(T(new Date(e[this.fields.endTime].getTime())),1)),{eventData:e,tempData:i}},e.prototype.processEventValidation=function(e,i){var n;if(t.isNullOrUndefined(this.parent.editorTemplate)){if(!e[this.fields.startTime]||!e[this.fields.endTime])return this.parent.quickPopup.openValidationError("invalidDateError"),!0;if(e[this.fields.startTime]>e[this.fields.endTime])return this.parent.quickPopup.openValidationError("startEndError"),!0}if(this.recurrenceEditor&&this.recurrenceEditor.value&&""!==this.recurrenceEditor.value){var r=!0;if("seriesChangeAlert"===(n=this.recurrenceValidation(e[this.fields.startTime],e[this.fields.endTime],i))&&this.parent.uiStateValues.isIgnoreOccurrence&&(r=!1),!t.isNullOrUndefined(n)&&r&&(!this.parent.enableRecurrenceValidation&&"wrongPattern"===n||this.parent.enableRecurrenceValidation))return this.parent.quickPopup.openRecurrenceValidationAlert(n),!0}return!1},e.prototype.processCrudActions=function(e){var i=this;this.parent.uiStateValues.isBlock=!1;var n=this.getResourceData(e),r=(this.parent.activeViewOptions.group.resources.length>0||this.parent.resourceCollection.length>0)&&!this.parent.activeViewOptions.group.allowGroupEdit&&!t.isNullOrUndefined(n),a=this.getEventIdFromForm();if(t.isNullOrUndefined(a))this.parent.currentAction="Add",r?this.resourceSaveEvent(e,this.parent.currentAction):(e[this.fields.id]=this.parent.eventBase.getEventMaxID(),this.parent.addEvent(e));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((e=t.extend({},o,e))[this.fields.isReadonly])return!1;var l=void 0;if(!t.isNullOrUndefined(o[this.fields.recurrenceRule])){if(l=this.parent.currentAction,e.Guid=this.parent.activeEventData.event.Guid,"EditOccurrence"===this.parent.currentAction&&(e[this.fields.recurrenceID]?(s=e[this.fields.recurrenceID],l=null):(e[this.fields.id]=this.parent.eventBase.getEventMaxID(),e.Guid=this.parent.activeEventData.event.Guid),this.parent.enableRecurrenceValidation&&this.editOccurrenceValidation(s,e)))return this.parent.quickPopup.openRecurrenceValidationAlert("sameDayAlert"),!0;"EditSeries"===this.parent.currentAction||e[this.fields.id]!==o[this.fields.id]?e[this.fields.recurrenceID]=o[this.fields.id]:"EditFollowingEvents"===this.parent.currentAction&&(e[this.fields.id]=this.parent.eventBase.getEventMaxID(),e[this.fields.followingID]=o[this.fields.id])}r?this.resourceSaveEvent(e,"Save",l):this.parent.saveEvent(e,l)}return this.parent.uiStateValues.isBlock},e.prototype.getResourceData=function(e){var i=null;return!t.isNullOrUndefined(this.parent.resourceBase)&&!t.isNullOrUndefined(this.parent.resourceBase.resourceCollection)&&this.parent.resourceBase.resourceCollection.length>0&&(i=e[this.parent.resourceBase.resourceCollection.slice(-1)[0].field]),i},e.prototype.getObjectFromFormData=function(e){for(var i={},n=0,r=this.getFormElements(e);n<r.length;n++){var a=r[n],s=a.name||this.getColumnName(a);t.isNullOrUndefined(s)||""===s||(i[s]=this.getValueFromElement(a))}return i},e.prototype.setDefaultValueToObject=function(e){t.isNullOrUndefined(e[this.fields.subject])||(e[this.fields.subject]=e[this.fields.subject]||this.parent.eventSettings.fields.subject.default||this.l10n.getConstant("addTitle")),t.isNullOrUndefined(e[this.fields.location])||(e[this.fields.location]=e[this.fields.location]||this.parent.eventSettings.fields.location.default),t.isNullOrUndefined(e[this.fields.description])||(e[this.fields.description]=e[this.fields.description]||this.parent.eventSettings.fields.description.default)},e.prototype.recurrenceValidation=function(e,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)&&!t.isNullOrUndefined(o)){var c=o[this.parent.eventFields.startTime],p=this.parent.eventBase.getSeriesEvents(this.eventData,c);if(p.length>0)l=this.parent.eventBase.getEditedOccurrences(p,c);else{var d=this.parent.eventBase.getEventById(o[this.parent.eventFields.id]);l=this.parent.eventBase.getEditedOccurrences([d],c)}"EditSeries"!==this.parent.currentAction||t.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<e&&(r="wrongPattern"),t.isNullOrUndefined(r))switch(a.value.split(";")[0].split("=")[1]){case"DAILY":(i.getTime()-e.getTime())/36e5>=24*s&&(r="createError");break;case"WEEKLY":for(var h=a.value.split(";")[1].split("=")[1].split(","),u={SU:0,MO:1,TU:2,WE:3,TH:4,FR:5,SA:6},v=[],m=[],g=0;g<h.length*(s+1);g++)v[g]=h.length>g?u[h[g]]:v[g-h.length]+7*s;for(var f=v.sort(function(e,t){return e-t}),g=1;g<f.length;g++)m.push(f[g]-f[g-1]);((i.getTime()-e.getTime())/36e5>=24*Math.min.apply(Math,m)||t.isNullOrUndefined(s))&&(r="createError");break;case"MONTHLY":i.getTime()>=new Date(+e).setMonth(e.getMonth()+s)&&(r="createError");break;case"YEARLY":i.getTime()>=new Date(+e).setFullYear(e.getFullYear()+s)&&(r="createError")}}else i.getTime()>=new Date(+e).setMonth(e.getMonth()+s)&&(r="createError"),t.isNullOrUndefined(r)&&this.parent.quickPopup.quickDialog.hide();return r},e.prototype.getRecurrenceIndex=function(e,t){for(var i,n=0;n<e.length;n++)if(t[this.fields.startTime].valueOf()===e[n][this.fields.startTime].valueOf()){i=n;break}return i},e.prototype.trimAllDay=function(e){if(e[this.fields.isAllDay]){var t=b(new Date(+e[this.fields.endTime]),-1).getTime();e[this.fields.endTime]=+e[this.fields.startTime]>t?e[this.fields.endTime]:new Date(t)}},e.prototype.editOccurrenceValidation=function(e,i,n){var r=this;void 0===n&&(n=this.eventData);var a=this.parent.getOccurrencesByID(e);this.parent.eventsData.filter(function(t){return t[r.fields.recurrenceID]===e}).map(function(e){return a.push(t.extend({},e))}),i=t.extend({},i),this.trimAllDay(i);for(var s=0,o=a;s<o.length;s++){var l=o[s];this.trimAllDay(l)}this.parent.eventBase.sortByTime(a);var c=this.getRecurrenceIndex(a,n);if(t.isNullOrUndefined(c))return!1;if(0===c)return!t.isNullOrUndefined(a[c+1])&&!(new Date(+a[c+1][this.fields.startTime]).setHours(0,0,0,0)>new Date(+i[this.fields.endTime]).setHours(0,0,0,0));if(c===a.length-1){if(!(new Date(+a[c-1][this.fields.endTime]).setHours(0,0,0,0)<new Date(+i[this.fields.startTime]).setHours(0,0,0,0)))return!0}else if(!(new Date(+a[c-1][this.fields.endTime]).setHours(0,0,0,0)<new Date(+i[this.fields.startTime]).setHours(0,0,0,0)&&new Date(+a[c+1][this.fields.startTime]).setHours(0,0,0,0)>new Date(+i[this.fields.endTime]).setHours(0,0,0,0)))return!0;return!1},e.prototype.resourceSaveEvent=function(e,i,n){var r=this,a=this.parent.resourceBase.resourceCollection.slice(-1)[0],s=e[a.field];s=s instanceof Array?s:[s];for(var o=this.parent.resourceBase.lastResourceLevel,l=[],c=this,p=0;p<s.length;p++){var d=function(p){var d=t.extend({},e,null,!0);d[c.fields.id]=c.parent.eventBase.getEventMaxID();var h=[],u=function(){if("Save"===i&&p===s.length-1)if(h.length>0){h[0][r.fields.id]=e[r.fields.id];for(var t=1;t<h.length;t++)h[t][r.fields.id]=r.parent.eventBase.getEventMaxID(p),l.push(h[t]),r.parent.saveEvent(h[0],n)}else d[r.fields.id]=e[r.fields.id],r.parent.saveEvent(d,n);else if(h.length>0)for(var a=0;a<h.length;a++)h[a][r.fields.id]=r.parent.eventBase.getEventMaxID(a),l.push(h[a]);else d[r.fields.id]=r.parent.eventBase.getEventMaxID(p),l.push(d)};if(c.parent.activeViewOptions.group.byGroupID&&!t.isNullOrUndefined(o)){var v=a.dataSource,m=c.parent.resourceCollection,g=void 0;if((g=m.length>1?V(v,a.idField,s[p],d,m):V(v,a.idField,s[p]))<0)return{value:void 0};for(var f=v[g][a.groupIDField],y=o.filter(function(e){return e.resourceData[a.idField]===s[p]}).filter(function(e){return e.resourceData[a.groupIDField]===f})[0].groupOrder,T=0;T<c.parent.resourceBase.resourceCollection.length;T++){w=c.parent.resourceBase.resourceCollection[T].field;d[w]=y[T]instanceof Array?y[T][0]:y[T]}u()}else{for(g=0;g<c.parent.resourceBase.resourceCollection.length-1;g++){var w=c.parent.resourceBase.resourceCollection[g].field;if(d[w]instanceof Array&&d[w].length>1)for(var D=0;D<d[w].length;D++){var b=t.extend({},d,null,!0);b[w]=e[w][D],b[a.field]=s[p],h.push(b)}else if(0===h.length)d[w]=e[w]instanceof Array?e[w][0]:e[w],d[a.field]=s[p];else for(var C=0;C<h.length;C++)h[C][w]=e[w]instanceof Array?e[w][0]:e[w]}d[a.field]=s[p],u()}}(p);if("object"==typeof d)return d.value}if(l.length>0){for(var h=0,u=l;h<u.length;h++){var v=u[h];v[this.fields.recurrenceException]=null,v[this.fields.recurrenceID]=null}this.parent.addEvent(l)}},e.prototype.getEventIdFromForm=function(){return this.element.querySelector("."+Ze).getAttribute("data-id")},e.prototype.getFormElements=function(e){var i=[];if(i="e-schedule-dialog"===e?[].slice.call(this.element.querySelectorAll(".e-field")):[].slice.call(this.parent.element.querySelectorAll("."+e+" .e-field")),!t.isBlazor())return i;for(var n=[],r=0,a=i;r<a.length;r++){var s=a[r];s.classList.contains("e-control")?n.push(s):s.querySelector(".e-control")?n.push(s.querySelector(".e-control")):n.push(s)}return n},e.prototype.getValueFromElement=function(e){return e.classList.contains("e-datepicker")?e.ej2_instances[0].value:e.classList.contains("e-datetimepicker")?e.ej2_instances[0].value:e.classList.contains("e-dropdownlist")?e.ej2_instances[0].value:e.classList.contains("e-multiselect")?e.ej2_instances[0].value:e.classList.contains("e-checkbox")?e.ej2_instances[0].checked:"checkbox"===e.type?e.checked:t.SanitizeHtmlHelper.sanitize(e.value)},e.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("e-start")?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")){var i=e.ej2_instances[0];i.checked=t,i.dataBind()}else"checkbox"!==e.type?e.value=t||"":e.checked=t},e.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 e.classList.contains("e-dropdownlist")?((t=e.ej2_instances[0]).value=null,t.dataBind()):e.classList.contains("e-multiselect")?((t=e.ej2_instances[0]).value=[],t.dataBind()):e.classList.contains("e-checkbox")?((t=e.ej2_instances[0]).checked=!1,t.dataBind()):"checkbox"===e.type?e.checked=!1:e.value=""},e.prototype.getInstance=function(e){var t=this.element.querySelector("."+e);return t?t.ej2_instances[0]:null},e.prototype.eventDelete=function(){switch(this.parent.currentAction){case"EditOccurrence":var e=this.parent.eventFields;t.isNullOrUndefined(this.parent.activeEventData.event[e.recurrenceRule])?this.parent.currentAction="Delete":this.parent.currentAction="DeleteOccurrence";break;case"EditSeries":this.parent.currentAction="DeleteSeries";break;case"Save":this.parent.currentAction="Delete"}this.isCrudAction=!1,this.dialogObject.hide(),this.parent.quickPopup.openDeleteAlert()},e.prototype.getRecurrenceEditorInstance=function(){return this.parent.isAdaptive&&!this.repeatDialogObject&&this.renderRepeatDialog(),this.recurrenceEditor},e.prototype.destroyComponents=function(){for(var e=0,t=this.getFormElements("e-schedule-dialog");e<t.length;e++){var i=t[e],n=void 0;i.classList.contains("e-datetimepicker")?n=i.ej2_instances:i.classList.contains("e-datepicker")?n=i.ej2_instances:i.classList.contains("e-checkbox")?n=i.ej2_instances:i.classList.contains("e-dropdownlist")?n=i.ej2_instances:i.classList.contains("e-multiselect")&&(n=i.ej2_instances),n&&n[0]&&n[0].destroy()}this.buttonObj&&this.buttonObj.destroy()},e.prototype.destroy=function(){this.parent.isDestroyed||(this.resetEditorTemplate(),this.updateEditorTemplate()),this.recurrenceEditor&&this.recurrenceEditor.destroy(),this.destroyComponents(),this.fieldValidator.destroy(),this.repeatDialogObject&&(this.repeatDialogObject.destroy(),t.remove(this.repeatDialogObject.element)),this.dialogObject&&(this.dialogObject.destroy(),this.dialogObject=null),this.element&&(t.remove(this.element),this.element=null)},e}(),ti=function(){function e(e){this.translateY=0,this.itemSize=60,this.bufferCount=3,this.renderedLength=0,this.averageRowHeight=0,this.startIndex=0,this.isScrollHeightNull=!0,this.previousTop=0,this.parent=e,this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.isDestroyed||this.parent.on("virtual-scroll",this.virtualScrolling,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off("virtual-scroll",this.virtualScrolling)},e.prototype.getRenderedCount=function(){if(t.isBlazor()){var e=this.parent.element.querySelector("."+Ye);return this.renderedLength=e.querySelector("tbody").children.length,this.renderedLength}return this.setItemSize(),Math.ceil(this.parent.element.clientHeight/this.itemSize)+this.bufferCount},e.prototype.triggerScrolling=function(){this.parent.showSpinner();this.parent.interopAdaptor.invokeMethodAsync("OnContentUpdate",this.startIndex)},e.prototype.setTranslateValue=function(){var e=this.parent.element.querySelector(".e-resource-column-wrap"),t=this.parent.element.querySelector(".e-content-wrap"),i=this.parent.element.querySelector(".e-event-table"),n=this.parent.element.querySelector(".e-current-timeline");this.renderVirtualTrackHeight(t,e),this.setTranslate(e,t,i,n)},e.prototype.renderVirtualTrackHeight=function(e,i){if(this.parent.resourceBase.setExpandedResources(),this.isScrollHeightNull){var n=t.createElement("div",{className:"e-virtual-track"}),r=[].slice.call(i.querySelectorAll("table td")),a=parseInt(r[0].getAttribute("data-group-index"),10),s=parseInt(r[r.length-1].getAttribute("data-group-index"),10);this.parent.resourceBase.renderedResources=this.parent.resourceBase.expandedResources.slice(a,s+1),this.setItemSize(),n.style.height=this.parent.resourceBase.expandedResources.length*this.itemSize+"px",this.isScrollHeightNull=!1;var o=this.parent.element.querySelector(".e-virtual-track");t.isNullOrUndefined(o)||t.remove(o),e.appendChild(n)}},e.prototype.renderVirtualTrack=function(e){var i=t.createElement("div",{className:"e-virtual-track"});i.style.height=this.parent.resourceBase.expandedResources.length*this.itemSize+"px",e.appendChild(i)},e.prototype.updateVirtualScrollHeight=function(){var e=this.parent.element.querySelector(".e-virtual-track"),i=this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length-1].groupIndex;if(this.parent.resourceBase.renderedResources[this.parent.resourceBase.renderedResources.length-1].groupIndex!==i||t.isBlazor()){var n=this.parent.element.querySelector("."+Ye);this.renderedLength=n.querySelector("tbody").children.length,e.style.height=n.offsetHeight+(this.parent.resourceBase.expandedResources.length-this.renderedLength)*n.offsetHeight/this.renderedLength+"px"}else e.style.height="";this.averageRowHeight=e.offsetHeight/this.parent.resourceBase.expandedResources.length},e.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(".e-resource-column-wrap"),n=this.parent.element.querySelector(".e-content-wrap"),r=this.parent.element.querySelector(".e-event-table");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"}},e.prototype.setItemSize=function(){this.itemSize=d(this.parent.activeView.element,"e-work-cells")||this.itemSize},e.prototype.beforeInvoke=function(e,i,n,r){var a=this;t.isBlazor()&&(clearTimeout(this.timeValue),this.timeValue=setTimeout(function(){a.triggerScrolling()},250),this.setTranslate(e,i,n,r),this.previousTop=i.scrollTop)},e.prototype.virtualScrolling=function(){var e=this;this.parent.quickPopup.quickPopupHide(),this.parent.quickPopup.morePopup.hide();var i=this.parent.element.querySelector(".e-resource-column-wrap"),n=this.parent.element.querySelector(".e-content-wrap"),r=this.parent.element.querySelector(".e-event-table"),a=this.parent.element.querySelector(".e-current-timeline"),s=this.parent.element.querySelector("."+Ye);this.renderedLength=i.querySelector("tbody").children.length;var o=parseInt(i.querySelector("tbody td").getAttribute("data-group-index"),10),l=this.parent.rowAutoHeight?s.offsetHeight-n.offsetHeight:this.bufferCount*this.itemSize;t.addClass([n],"e-transition"),t.isBlazor()&&this.setItemSize();var c=[];n.scrollTop-this.translateY<0?(c=this.upScroll(n,o),this.beforeInvoke(i,n,r,a)):n.scrollTop-this.translateY>l&&(c=this.downScroll(n,o),this.previousTop!==n.scrollTop&&this.beforeInvoke(i,n,r,a)),t.isBlazor()||!t.isNullOrUndefined(c)&&c.length>0&&(this.parent.showSpinner(),this.updateContent(i,n,r,c),this.setTranslate(i,n,r,a),this.parent.notify(qe,{}),this.parent.dragAndDropModule&&"drag"===this.parent.dragAndDropModule.actionObj.action&&this.parent.dragAndDropModule.navigationWrapper(),window.clearTimeout(this.timeValue),this.timeValue=window.setTimeout(function(){e.parent.hideSpinner()},250))},e.prototype.upScroll=function(e,i){var n=0;n=t.isBlazor()?~~(e.scrollTop/this.itemSize):~~(e.scrollTop/this.itemSize)+Math.ceil(e.clientHeight/this.itemSize)-this.renderedLength,this.parent.rowAutoHeight&&(n=n>i?i-this.bufferCount:n),n=n>0?n:0;var r=this.getBufferCollection(n,n+this.renderedLength);if(this.parent.resourceBase.renderedResources=r,0===i)this.translateY=e.scrollTop;else{var a=this.parent.rowAutoHeight?this.averageRowHeight:this.itemSize;this.translateY=e.scrollTop-this.bufferCount*a>0?e.scrollTop-this.bufferCount*a:0}return t.isBlazor()&&(this.startIndex=n),r},e.prototype.downScroll=function(e,i){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 n=0,r=this.parent.rowAutoHeight?this.averageRowHeight:this.itemSize;t.isBlazor()?n=~~(e.scrollTop/r):(n=~~(e.scrollTop/this.itemSize),this.parent.rowAutoHeight&&(n=(n=~~((e.scrollTop-this.translateY)/this.averageRowHeight)+i)>i+this.bufferCount?n:i+this.bufferCount));var a=n+this.renderedLength;a=a>this.parent.resourceBase.expandedResources.length?n+(this.parent.resourceBase.expandedResources.length-n):a;var s=this.getBufferCollection(a-this.renderedLength,a);return this.translateY=e.scrollTop,t.isBlazor()&&(this.translateY>this.parent.resourceBase.expandedResources.length*r-this.renderedLength*r&&(this.translateY=this.parent.resourceBase.expandedResources.length*r-this.renderedLength*r),this.startIndex=a-this.renderedLength,this.parent.resourceBase.renderedResources=s),s},e.prototype.updateContent=function(e,i,n,r){for(var a=e.querySelector("tbody").children.length,s=0;s<a;s++)t.remove(e.querySelector("tbody tr")),t.remove(i.querySelector("tbody tr")),t.remove(n.querySelector("div"));this.parent.resourceBase.renderedResources=r;var o=this.parent.resourceBase.getContentRows(r),l=this.parent.activeView.getContentRows(),c=this.parent.activeView.getEventRows(r.length);t.append(o,e.querySelector("tbody")),t.append(l,i.querySelector("tbody")),t.append(c,n)},e.prototype.getBufferCollection=function(e,t){return this.parent.resourceBase.expandedResources.slice(e,t)},e.prototype.setTranslate=function(e,i,n,r){t.setStyleAttribute(e.querySelector("table"),{transform:"translateY("+this.translateY+"px)"}),t.setStyleAttribute(i.querySelector("table"),{transform:"translateY("+this.translateY+"px)"}),t.setStyleAttribute(n,{transform:"translateY("+this.translateY+"px)"}),t.isNullOrUndefined(r)||t.setStyleAttribute(r,{transform:"translateY("+this.translateY+"px)"})},e.prototype.destroy=function(){this.removeEventListener()},e}(),ii=function(){function e(e){this.parent=e}return e.prototype.render=function(e,t){void 0===t&&(t=!0),this.initializeLayout(e),t&&!this.parent.isServerRenderer()&&this.refreshDataManager()},e.prototype.initializeLayout=function(e){switch(this.parent.activeView&&(this.parent.activeView.removeEventListener(),this.parent.activeView.destroy()),e){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,this.parent.activeView.viewClass="e-timeline-day-view";break;case"TimelineWorkWeek":this.parent.activeView=this.parent.timelineViewsModule,this.parent.activeView.viewClass="e-timeline-work-week-view";break;case"TimelineWeek":this.parent.activeView=this.parent.timelineViewsModule,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(t.isNullOrUndefined(this.parent.activeView)){var i=this.parent.viewCollections[0].option;if(i)return this.parent.setScheduleProperties({currentView:i}),this.parent.onServerDataBind(),this.parent.headerModule&&(this.parent.headerModule.updateActiveView(),this.parent.headerModule.setCalendarView()),this.initializeLayout(i);throw Error("Inject required modules")}this.parent.activeView.viewIndex=this.parent.viewIndex,this.updateLabelText(e),this.parent.activeView.addEventListener(),this.parent.activeView.getRenderDates(),this.parent.uiStateValues.isGroupAdaptive=this.parent.isAdaptive&&this.parent.activeViewOptions.group.resources.length>0&&this.parent.activeViewOptions.group.enableCompactView,this.parent.virtualScrollModule&&(this.parent.virtualScrollModule.destroy(),this.parent.virtualScrollModule=null),-1!==this.parent.currentView.indexOf("Timeline")&&this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&(this.parent.virtualScrollModule=new ti(this.parent),this.parent.uiStateValues.top=0),this.updateHeader(),this.parent.activeView.renderLayout("e-current-panel"),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 jt(this.parent))},e.prototype.updateHeader=function(){this.parent.headerModule&&(this.parent.headerModule.setDayOfWeek(this.parent.activeViewOptions.firstDayOfWeek),this.parent.activeViewOptions.readonly?t.addClass([this.parent.element],"e-read-only"):this.parent.element.classList.contains("e-read-only")&&t.removeClass([this.parent.element],"e-read-only"),this.parent.headerModule.updateDateRange(this.parent.activeView.getDateRangeText()),this.parent.headerModule.updateHeaderItems("remove"))},e.prototype.updateLabelText=function(e){var t=this.parent.activeView.getLabelText(e);this.parent.element.setAttribute("role","main"),this.parent.element.setAttribute("aria-label",t)},e.prototype.refreshDataManager=function(){var e=this,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)})},e.prototype.dataManagerSuccess=function(e){var i=this;this.parent.isDestroyed||this.parent.trigger("dataBinding",e,function(e){var n=t.extend([],e.result,null,!0);if(t.isBlazor())for(var r=0,a=n;r<a.length;r++)delete a[r].BlazId;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]});var s=i.parent.eventBase.processData(n);i.parent.notify(qe,{processedData:s}),i.parent.dragAndDropModule&&"drag"===i.parent.dragAndDropModule.actionObj.action&&i.parent.dragAndDropModule.navigationWrapper(),i.parent.renderCompleted(),i.parent.trigger("dataBound",null,function(){return i.parent.hideSpinner()})})},e.prototype.dataManagerFailure=function(e){var i=this;this.parent.isDestroyed||this.parent.trigger("actionFailure",{error:t.isBlazor()?e.error?e.error.toString():e.toString():e},function(){return i.parent.hideSpinner()})},e}(),ni=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])})(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)}}(),ri=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},ai=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ni(i,e),ri([t.Property(!0)],i.prototype,"highlight",void 0),ri([t.Property("09:00")],i.prototype,"start",void 0),ri([t.Property("18:00")],i.prototype,"end",void 0),i}(t.ChildProperty),si=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])})(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)}}(),oi=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},li=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return si(i,e),oi([t.Property(!0)],i.prototype,"enable",void 0),oi([t.Property(60)],i.prototype,"interval",void 0),oi([t.Property(2)],i.prototype,"slotCount",void 0),oi([t.Property()],i.prototype,"minorSlotTemplate",void 0),oi([t.Property()],i.prototype,"majorSlotTemplate",void 0),i}(t.ChildProperty),ci=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])})(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)}}(),pi=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},di=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ci(i,e),pi([t.Property("Both")],i.prototype,"templateType",void 0),pi([t.Property()],i.prototype,"header",void 0),pi([t.Property()],i.prototype,"content",void 0),pi([t.Property()],i.prototype,"footer",void 0),i}(t.ChildProperty),hi=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])})(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)}}(),ui=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},vi=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return hi(i,e),ui([t.Property()],i.prototype,"option",void 0),ui([t.Property()],i.prototype,"template",void 0),i}(t.ChildProperty),mi=function(){function e(e){this.parent=e,this.crudObj={sourceEvent:null,targetEvent:null,isCrudAction:!1}}return e.prototype.getQuery=function(){var e=this.parent.activeView.startDate(),t=this.parent.activeView.endDate();return this.parent.dataModule.generateQuery(e,t)},e.prototype.getTable=function(){return this.parent.eventSettings.query?this.parent.eventSettings.query.clone().fromTable:null},e.prototype.refreshData=function(e){var i=this,n={requestType:e.requestType,cancel:!1,data:e.data,addedRecords:e.editParms.addedRecords,changedRecords:e.editParms.changedRecords,deletedRecords:e.editParms.deletedRecords};if(this.parent.dragAndDropModule&&this.parent.dragAndDropModule.actionObj&&this.parent.dragAndDropModule.actionObj.element&&(this.parent.dragAndDropModule.actionObj.element.style.display="none"),this.parent.resizeModule&&this.parent.resizeModule.actionObj&&this.parent.resizeModule.actionObj.element&&(this.parent.resizeModule.actionObj.element.style.display="none"),this.parent.activeViewOptions.group.resources.length>0&&!this.parent.activeViewOptions.group.allowGroupEdit&&!this.parent.rowAutoHeight&&!this.parent.virtualScrollModule&&this.parent.activeViewOptions.group.byGroupID&&("eventCreated"===e.requestType||"eventRemoved"===e.requestType)){this.crudObj.isCrudAction=!0,this.crudObj.sourceEvent=[];for(var r=this,a=0,s=e.data instanceof Array?e.data:"string"!=typeof e.data&&"number"!=typeof e.data||"eventRemoved"!==e.requestType?[e.data]:e.editParms.deletedRecords;a<s.length;a++)!function(i){r.crudObj.isCrudAction=!("eventRemoved"===e.requestType&&!t.isNullOrUndefined(i.parent));var n=r.parent.eventBase.getGroupIndexFromEvent(i);0===r.parent.crudModule.crudObj.sourceEvent.filter(function(e){return e.groupIndex===n}).length&&r.crudObj.isCrudAction&&r.crudObj.sourceEvent.push(r.parent.resourceBase.lastResourceLevel[n])}(s[a]);this.crudObj.targetEvent=this.crudObj.sourceEvent}this.parent.dataModule.dataManager.dataSource.offline?this.parent.trigger("actionComplete",n,function(e){e.cancel||i.parent.renderModule.refreshDataManager()}):e.promise.then(function(e){i.parent.isDestroyed||i.parent.trigger("actionComplete",n,function(e){e.cancel||i.parent.renderModule.refreshDataManager()})}).catch(function(e){i.parent.isDestroyed||i.parent.trigger("actionFailure",{error:t.isBlazor()?e.error.toString():e})})},e.prototype.addEvent=function(e){var i=this;if(this.parent.eventSettings.allowAdding){if(!this.isBlockEvent(e)&&this.parent.eventBase.isBlockRange(e))return void this.parent.quickPopup.openValidationError("blockAlert",e instanceof Array?[e]:e);var n=e instanceof Array?e:[e],r={requestType:"eventCreate",cancel:!1,addedRecords:n,changedRecords:[],deletedRecords:[]};t.isBlazor()||(r.data=n),this.parent.trigger(He,r,function(e){if(i.serializeData(e.addedRecords),!e.cancel){var t=i.parent.eventFields,n={addedRecords:[],changedRecords:[],deletedRecords:[]},r=void 0;if(e.addedRecords instanceof Array){for(var a=0,s=e.addedRecords;a<s.length;a++){var o=s[a];n.addedRecords.push(i.parent.eventBase.processTimezone(o,!0))}r=i.parent.dataModule.dataManager.saveChanges(n,t.id,i.getTable(),i.getQuery())}else{var l=i.parent.eventBase.processTimezone(e.addedRecords,!0);n.addedRecords.push(l),r=i.parent.dataModule.dataManager.insert(l,i.getTable(),i.getQuery())}var c={requestType:"eventCreated",cancel:!1,data:e.addedRecords,promise:r,editParms:n};i.refreshData(c)}})}},e.prototype.saveEvent=function(e,i){var n=this;if(this.parent.eventSettings.allowEditing){if("EditFollowingEvents"!==this.parent.currentAction&&!this.isBlockEvent(e)&&this.parent.eventBase.isBlockRange(e))return void this.parent.quickPopup.openValidationError("blockAlert",e instanceof Array?[e]:e);if(this.parent.currentAction=i,i)switch(i){case"EditOccurrence":this.processOccurrences(e,i);break;case"EditFollowingEvents":this.processFollowSeries(e,i);break;case"EditSeries":this.processEntireSeries(e,i)}else{var r={requestType:"eventChange",cancel:!1,addedRecords:[],changedRecords:e instanceof Array?e:[e],deletedRecords:[]};t.isBlazor()||(r.data=e),this.parent.trigger(He,r,function(e){if(n.serializeData(e.changedRecords),!e.cancel){var t=void 0,i=n.parent.eventFields,r={addedRecords:[],changedRecords:[],deletedRecords:[]};if(e.changedRecords instanceof Array){for(var a=0,s=e.changedRecords;a<s.length;a++){var o=s[a];r.changedRecords.push(n.parent.eventBase.processTimezone(o,!0))}t=n.parent.dataModule.dataManager.saveChanges(r,i.id,n.getTable(),n.getQuery())}else{var l=n.parent.eventBase.processTimezone(e.changedRecords,!0);r.changedRecords.push(l),t=n.parent.dataModule.dataManager.update(i.id,l,n.getTable(),n.getQuery())}var c={requestType:"eventChanged",cancel:!1,data:e.changedRecords,promise:t,editParms:r};n.refreshData(c)}})}}},e.prototype.deleteEvent=function(e,i){var n=this;if(this.parent.eventSettings.allowDeleting){this.parent.currentAction=i;var r=[];if(r="string"==typeof e||"number"==typeof e?this.parent.eventsData.filter(function(t){return t[n.parent.eventFields.id]===e}):e instanceof Array?e:[e],i)switch(i){case"Delete":this.processEventDelete(r);break;case"DeleteOccurrence":this.processOccurrences(r,i);break;case"DeleteFollowingEvents":this.processFollowSeries(r,i);break;case"DeleteSeries":this.processEntireSeries(r,i)}else{var a={requestType:"eventRemove",cancel:!1,addedRecords:[],changedRecords:[],deletedRecords:r};t.isBlazor()||(a.data=e),this.parent.trigger(He,a,function(e){if(n.serializeData(e.deletedRecords),!e.cancel){var t=void 0,i=n.parent.eventFields,r={addedRecords:[],changedRecords:[],deletedRecords:[]};e.deletedRecords.length>1?(r.deletedRecords=r.deletedRecords.concat(e.deletedRecords),t=n.parent.dataModule.dataManager.saveChanges(r,i.id,n.getTable(),n.getQuery())):(r.deletedRecords.push(e.deletedRecords[0]),t=n.parent.dataModule.dataManager.remove(i.id,e.deletedRecords[0],n.getTable(),n.getQuery())),n.parent.eventBase.selectWorkCellByTime(e.deletedRecords);var a={requestType:"eventRemoved",cancel:!1,data:e.deletedRecords,promise:t,editParms:r};n.refreshData(a)}})}}},e.prototype.processOccurrences=function(e,i){var n=this,r=[],a=!1;if(e instanceof Array)for(var s=0,o=e;s<o.length;s++){var l=o[s];r.push({occurrence:l,parent:this.getParentEvent(l)})}else r={occurrence:e,parent:this.getParentEvent(e)};var c=e instanceof Array?e:[e],p={requestType:"EditOccurrence"===i?"eventChange":"eventRemove",cancel:!1,addedRecords:[],changedRecords:c,deletedRecords:[]};t.isBlazor()||(p.data=r),this.parent.trigger(He,p,function(e){if(n.serializeData(e.changedRecords),!e.cancel){for(var t=n.parent.eventFields,s={addedRecords:[],changedRecords:[],deletedRecords:[]},o=r instanceof Array?r:[r],l=0,c=e.changedRecords.length;l<c;l++)!function(r,l){var c=e.changedRecords[r],p=o[r].parent,d=p[t.recurrenceException];switch(i){case"EditOccurrence":var h=n.parent.eventsProcessed.filter(function(e){return e.Guid===c.Guid})[0],u=n.excludeDateCheck(h[t.startTime],d);u!==p[t.recurrenceException]?(p[t.recurrenceException]=u,c[t.recurrenceException]=ke(h[t.startTime]),c[t.recurrenceID]=p[t.id],c[t.followingID]=null,s.changedRecords.push(n.parent.eventBase.processTimezone(p,!0)),s.addedRecords.push(n.parent.eventBase.processTimezone(c,!0))):s.changedRecords.push(n.parent.eventBase.processTimezone(c,!0));break;case"DeleteOccurrence":c[t.recurrenceException]||(p[t.recurrenceException]=n.excludeDateCheck(c[t.startTime],d),s.changedRecords.push(n.parent.eventBase.processTimezone(p,!0))),c[t.id]!==p[t.id]&&(s.deletedRecords.push(c),a=!0)}}(l);var p=n.parent.dataModule.dataManager.saveChanges(s,t.id,n.getTable(),n.getQuery());n.parent.eventBase.selectWorkCellByTime(e.changedRecords);var d={requestType:"EditOccurrence"===i?"eventChanged":"eventRemoved",cancel:!1,data:a?e.deletedRecords:e.changedRecords,promise:p,editParms:s};n.refreshData(d)}})},e.prototype.processFollowSeries=function(e,i){var n=this,r=[];if(e instanceof Array)for(var a=0,s=e;a<s.length;a++){var o=s[a];r.push({occurrence:o,parent:this.getParentEvent(o)})}else r={occurrence:e,parent:this.getParentEvent(e)};var l=e instanceof Array?e:[e],c={requestType:"EditFollowingEvents"===i?"eventChange":"eventRemove",cancel:!1,addedRecords:[],changedRecords:l,deletedRecords:[]};t.isBlazor()||(c.data=r),this.parent.trigger(He,c,function(e){if(n.serializeData(e.changedRecords),!e.cancel){for(var t=n.parent.eventFields,a={addedRecords:[],changedRecords:[],deletedRecords:[]},s=r instanceof Array?r:[r],o=0,l=e.changedRecords.length;o<l;o++)!function(r,o){var l=e.changedRecords[r],c=s[r].parent,p=n.parent.eventBase.getEventCollections(c,l);switch(i){case"EditFollowingEvents":n.processRecurrenceRule(c,l);var d=!n.parent.eventBase.isFollowingEvent(c,l);if(l[t.followingID]=d?null:c[t.id],l[t.recurrenceID]=null,a.addedRecords.push(n.parent.eventBase.processTimezone(l,!0)),a.changedRecords.push(n.parent.eventBase.processTimezone(c,!0)),!n.parent.uiStateValues.isIgnoreOccurrence){if(l[t.recurrenceException]=null,p.occurrence.length>0){var h=p.occurrence.slice(-1)[0][t.recurrenceRule];-1===h.indexOf("COUNT")&&(l[t.recurrenceRule]=h)}p.follow.length>0&&(l[t.recurrenceRule]=p.follow.slice(-1)[0][t.recurrenceRule],a.deletedRecords=a.deletedRecords.concat(p.follow)),d&&(p.occurrence=p.occurrence.filter(function(e){return e[t.recurrenceID]===l[t.id]})),a.deletedRecords=a.deletedRecords.concat(p.occurrence)}break;case"DeleteFollowingEvents":n.processRecurrenceRule(c,l[t.startTime]),a.changedRecords.push(n.parent.eventBase.processTimezone(c,!0)),a.deletedRecords=a.deletedRecords.concat(p.occurrence).concat(p.follow)}}(o);var c=n.parent.dataModule.dataManager.saveChanges(a,t.id,n.getTable(),n.getQuery());n.parent.eventBase.selectWorkCellByTime(e.changedRecords);var p={requestType:"EditFollowingEvents"===i?"eventChanged":"eventRemoved",cancel:!1,data:e.changedRecords,promise:c,editParms:a};n.refreshData(p)}})},e.prototype.processEntireSeries=function(e,i){var n=this,r=[],a=!1;if(e instanceof Array)for(var s=0,o=e;s<o.length;s++){var l=o[s];r.push(this.getParentEvent(l,!0))}else r=this.getParentEvent(e,!0);var c=e instanceof Array?e:[e],p={requestType:"EditSeries"===i?"eventChange":"eventRemove",cancel:!1,addedRecords:[],changedRecords:c,deletedRecords:[]};t.isBlazor()||(p.data=r),this.parent.trigger(He,p,function(e){if(n.serializeData(e.changedRecords),!e.cancel){for(var t=n.parent.eventFields,s={addedRecords:[],changedRecords:[],deletedRecords:[]},o=r instanceof Array?r:[r],l=0,c=e.changedRecords.length;l<c;l++)!function(r,l){var c=e.changedRecords[r],p=o[r],d=n.parent.eventBase.getEventCollections(p),h=d.follow.concat(d.occurrence);switch(i){case"EditSeries":if(c[t.startTime]>p[t.startTime]&&n.processRecurrenceRule(p,c),c[t.id]=p[t.id],c[t.recurrenceID]=null,c[t.followingID]=null,n.parent.uiStateValues.isIgnoreOccurrence&&c[t.recurrenceException]){var u=n.parent.eventsData.filter(function(e){return e[t.id]===c[t.id]});u.length>0&&(c[t.recurrenceRule]=u[0][t.recurrenceRule])}else c[t.recurrenceException]=null,s.deletedRecords=s.deletedRecords.concat(h);s.changedRecords.push(n.parent.eventBase.processTimezone(c,!0)),n.parent.uiStateValues.isIgnoreOccurrence=!1;break;case"DeleteSeries":s.deletedRecords=s.deletedRecords.concat(h.concat(p)),a=!0}}(l);var p=n.parent.dataModule.dataManager.saveChanges(s,t.id,n.getTable(),n.getQuery());n.parent.eventBase.selectWorkCellByTime(e.changedRecords);var d={requestType:"EditSeries"===i?"eventChanged":"eventRemoved",cancel:!1,data:a?e.deletedRecords:e.changedRecords,promise:p,editParms:s};n.refreshData(d)}})},e.prototype.processEventDelete=function(e){for(var i=this,n=[],r=0,a=e;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:e};t.isBlazor()||(o.data=n),this.parent.trigger(He,o,function(e){if(i.serializeData(e.deletedRecords),!e.cancel){for(var r=i.parent.eventFields,a={addedRecords:[],changedRecords:[],deletedRecords:[]},s=0,o=e.deletedRecords.length;s<o;s++)!function(s,o){var l=t.isNullOrUndefined(e.deletedRecords[s][i.parent.eventFields.recurrenceRule]);if(!l){var c=n[s].parent,p=a.changedRecords.filter(function(e){return e[r.id]===c[r.id]}),d=e.deletedRecords[s][r.startTime];if(p.length>0){var h=p[0];h[r.recurrenceException]=i.excludeDateCheck(d,h[r.recurrenceException])}else c[r.recurrenceException]=i.excludeDateCheck(d,c[r.recurrenceException]);0===p.length&&a.changedRecords.push(i.parent.eventBase.processTimezone(c,!0)),l=e.deletedRecords[s][r.id]!==c[r.id]}l&&a.deletedRecords.push(e.deletedRecords[s])}(s);var l=i.parent.dataModule.dataManager.saveChanges(a,r.id,i.getTable(),i.getQuery()),c={requestType:"eventRemoved",cancel:!1,data:e.deletedRecords,promise:l,editParms:a};i.refreshData(c)}})},e.prototype.serializeData=function(e){if(t.isBlazor())for(var i=this.parent.eventFields,n=0,r=e;n<r.length;n++){var a=r[n];a[i.startTime]=this.parent.getDateTime(a[i.startTime]),a[i.endTime]=this.parent.getDateTime(a[i.endTime])}},e.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},e.prototype.excludeDateCheck=function(e,i){var n=ke(e);return t.isNullOrUndefined(i)?i=n:-1===i.indexOf(n)&&(i=t.isNullOrUndefined(i)?n:i+","+n),i},e.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],s=e[n.startTime],o=B(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,b(new Date(i.getTime()),-1),!0)},e.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=ke(t),s=s.replace(s,"UNTIL="+l)),n+=s+";"}}return i&&-1===n.indexOf("UNTIL")&&(n+="UNTIL="+ke(t)),n},e.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},e}(),gi=function(){function e(e){this.parent=e,t.EventHandler.add(this.parent.element,"mouseover",this.onHover,this)}return e.prototype.cellMouseDown=function(e){this.isPreventAction(e)||this.parent.notify("cell-mouse-down",{event:e})},e.prototype.cellClick=function(e){var i=this;if(!this.isPreventAction(e)){var n=t.closest(e.target,".e-work-cells,.e-all-day-cells,.e-header-cells");if(!t.isNullOrUndefined(n)){if(!t.isNullOrUndefined(t.closest(e.target,".e-new-event")))return void this.parent.eventWindow.openEditor(this.parent.activeCellsData,"Add");var r=t.closest(e.target,".e-navigate"),a=this.parent.getNavigateView(),s=this.parent.currentView===a;if(t.isNullOrUndefined(r)||s||t.isNullOrUndefined(this.parent.viewOptions[a.charAt(0).toLowerCase()+a.slice(1)])){if(this.parent.activeViewOptions.readonly&&"MonthAgenda"!==this.parent.currentView)return void this.parent.quickPopup.quickPopupHide();if(this.parent.isAdaptive&&(e.target.classList.contains("e-more-indicator")||t.closest(e.target,".e-more-indicator")))return;var o=n.classList.contains("e-work-cells")||n.classList.contains("e-all-day-cells");if(o&&e.shiftKey&&1===e.which&&this.parent.keyboardInteractionModule)return void this.parent.keyboardInteractionModule.onMouseSelection(e);this.parent.activeCellsData=this.parent.getCellDetails(n);var l=t.extend(this.parent.activeCellsData,{cancel:!1,event:e,name:"cellClick"});this.parent.trigger("cellClick",l,function(t){if((t=i.serializingData(t,e)).cancel)i.parent.quickPopup&&i.parent.quickPopup.quickPopupHide();else if(o&&i.parent.selectCell(n),i.parent.allowInline){var r={element:t.element,groupIndex:t.groupIndex,type:"Cell"};i.parent.notify(Ie,r)}else i.parent.notify("cellClick",t)})}else{var c=this.parent.getDateFromElement(n);t.isNullOrUndefined(c)||this.parent.isAdaptive||!this.parent.isMinMaxDate(c)||(this.parent.setScheduleProperties({selectedDate:c}),this.parent.changeView(this.parent.getNavigateView(),e))}}}},e.prototype.cellDblClick=function(e){var i=this;if(!this.parent.activeViewOptions.readonly&&!this.isPreventAction(e)){var n=t.extend(this.parent.activeCellsData,{cancel:!1,event:e,name:"cellDoubleClick"});this.parent.trigger("cellDoubleClick",n,function(t){t=i.serializingData(t,e);var n=new Date(t.startTime.getTime());i.parent.isMinMaxDate(new Date(n.setHours(0,0,0,0)))&&(t.cancel||i.parent.eventWindow.openEditor(i.parent.activeCellsData,"Add"))})}},e.prototype.serializingData=function(e,i){return t.isBlazor()&&(e.startTime=this.parent.getDateTime(e.startTime),e.endTime=this.parent.getDateTime(e.endTime),e.element&&(e.element=t.getElement(e.element)),e.event&&(e.event=i)),e},e.prototype.onHover=function(e){var i=t.closest(e.target,".e-work-cells,.e-time-slots,.e-all-day-cells,.e-header-cells,.e-resource-cells,.e-appointment,.e-week-number,.e-month-header");if(i){var n={element:i,event:e};this.parent.trigger("hover",n)}},e.prototype.isPreventAction=function(e){if(t.closest(e.target,".e-navigate"))return!1;if(t.closest(e.target,".e-appointment-wrapper")&&!t.closest(e.target,".e-more-indicator"))return!0;var i=t.closest(e.target,".e-appointment,.e-resource-group-cells");return!t.isNullOrUndefined(i)||(i=t.closest(e.target,".e-header-cells"),!(!this.parent.activeView.isTimelineView()||t.isNullOrUndefined(i)))},e.prototype.destroy=function(){t.EventHandler.remove(this.parent.element,"mouseover",this.onHover)},e}(),fi=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])})(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)}}(),yi=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},Ti=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return fi(i,e),yi([t.Property()],i.prototype,"name",void 0),yi([t.Property()],i.prototype,"default",void 0),yi([t.Property()],i.prototype,"title",void 0),yi([t.Property({})],i.prototype,"validation",void 0),i}(t.ChildProperty),wi=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])})(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)}}(),Di=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},bi=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return wi(i,e),Di([t.Property("Id")],i.prototype,"id",void 0),Di([t.Property("IsBlock")],i.prototype,"isBlock",void 0),Di([t.Complex({name:"Subject"},Ti)],i.prototype,"subject",void 0),Di([t.Complex({name:"StartTime"},Ti)],i.prototype,"startTime",void 0),Di([t.Complex({name:"EndTime"},Ti)],i.prototype,"endTime",void 0),Di([t.Complex({name:"StartTimezone"},Ti)],i.prototype,"startTimezone",void 0),Di([t.Complex({name:"EndTimezone"},Ti)],i.prototype,"endTimezone",void 0),Di([t.Complex({name:"Location"},Ti)],i.prototype,"location",void 0),Di([t.Complex({name:"Description"},Ti)],i.prototype,"description",void 0),Di([t.Complex({name:"IsAllDay"},Ti)],i.prototype,"isAllDay",void 0),Di([t.Complex({name:"RecurrenceID"},Ti)],i.prototype,"recurrenceID",void 0),Di([t.Complex({name:"RecurrenceRule"},Ti)],i.prototype,"recurrenceRule",void 0),Di([t.Complex({name:"RecurrenceException"},Ti)],i.prototype,"recurrenceException",void 0),Di([t.Property("IsReadonly")],i.prototype,"isReadonly",void 0),Di([t.Property("FollowingID")],i.prototype,"followingID",void 0),i}(t.ChildProperty),Ci=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])})(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)}}(),Ei=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},Oi=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ci(i,e),Ei([t.Property()],i.prototype,"template",void 0),Ei([t.Property([])],i.prototype,"dataSource",void 0),Ei([t.Property()],i.prototype,"query",void 0),Ei([t.Complex({},bi)],i.prototype,"fields",void 0),Ei([t.Property(!1)],i.prototype,"enableTooltip",void 0),Ei([t.Property()],i.prototype,"tooltipTemplate",void 0),Ei([t.Property()],i.prototype,"resourceColorField",void 0),Ei([t.Property(!1)],i.prototype,"editFollowingEvents",void 0),Ei([t.Property(!0)],i.prototype,"allowAdding",void 0),Ei([t.Property(!0)],i.prototype,"allowEditing",void 0),Ei([t.Property(!0)],i.prototype,"allowDeleting",void 0),Ei([t.Property(!1)],i.prototype,"enableMaxHeight",void 0),Ei([t.Property(!1)],i.prototype,"enableIndicator",void 0),Ei([t.Property(!1)],i.prototype,"ignoreWhitespace",void 0),i}(t.ChildProperty),Si=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])})(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)}}(),xi=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},ki=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Si(i,e),xi([t.Property(!1)],i.prototype,"byDate",void 0),xi([t.Property(!0)],i.prototype,"byGroupID",void 0),xi([t.Property(!1)],i.prototype,"allowGroupEdit",void 0),xi([t.Property([])],i.prototype,"resources",void 0),xi([t.Property(!0)],i.prototype,"enableCompactView",void 0),xi([t.Property()],i.prototype,"headerTooltipTemplate",void 0),i}(t.ChildProperty),Ai=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])})(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)}}(),Vi=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},Mi=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ai(i,e),Vi([t.Property()],i.prototype,"field",void 0),Vi([t.Property()],i.prototype,"title",void 0),Vi([t.Property()],i.prototype,"name",void 0),Vi([t.Property(!1)],i.prototype,"allowMultiple",void 0),Vi([t.Property([])],i.prototype,"dataSource",void 0),Vi([t.Property()],i.prototype,"query",void 0),Vi([t.Property("Id")],i.prototype,"idField",void 0),Vi([t.Property("Text")],i.prototype,"textField",void 0),Vi([t.Property("Expanded")],i.prototype,"expandedField",void 0),Vi([t.Property("GroupID")],i.prototype,"groupIDField",void 0),Vi([t.Property("Color")],i.prototype,"colorField",void 0),Vi([t.Property("StartHour")],i.prototype,"startHourField",void 0),Vi([t.Property("EndHour")],i.prototype,"endHourField",void 0),Vi([t.Property("WorkDays")],i.prototype,"workDaysField",void 0),Vi([t.Property("CssClass")],i.prototype,"cssClassField",void 0),i}(t.ChildProperty),Ri=function(){function e(e){this.resourceCollection=[],this.leftPixel=25,this.parent=e}return e.prototype.renderResourceHeaderIndent=function(e){var i=t.createElement("td",{className:"e-resource-left-td"}),n=t.createElement("div",{className:"e-resource-text"});i.appendChild(n);var r={elementType:"emptyCells",element:i};this.parent.trigger(je,r),e.appendChild(i)},e.prototype.hideResourceRows=function(e){if(!(this.resourceCollection.length<=1||this.parent.virtualScrollModule))for(var i=this.lastResourceLevel.length,n=0;n<i;n++){var r=this.lastResourceLevel[n].resourceData,a=this.lastResourceLevel[n].resource;if("e-parent-node"===r.ClassName&&!r[a.expandedField]&&!t.isNullOrUndefined(r[a.expandedField])){var s=[].slice.call(e.children).slice(n+1,n+(parseInt(r.Count,0)+1));t.addClass(s,"e-hidden")}}},e.prototype.createResourceColumn=function(){var e=this.resourceCollection,i=t.createElement("div",{className:"e-resource-column-wrap"}),n=this.parent.activeView.createTableLayout("e-resource-column-table");!this.parent.uiStateValues.isGroupAdaptive&&this.parent.rowAutoHeight&&this.parent.activeView.isTimelineView()&&this.parent.activeViewOptions.group.resources.length>0&&t.addClass([n],"e-auto-height");var r=n.querySelector("tbody"),a=this.generateTreeData(!0);if(this.countCalculation(e.slice(0,-2),e.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 t.append(this.getContentRows(a),r),this.hideResourceRows(r),n.appendChild(r),i.appendChild(n),i},e.prototype.setRenderedResources=function(){var e=this.resourceCollection;this.generateTreeData(!0),this.countCalculation(e.slice(0,-2),e.slice(0,-1)),this.renderedResources=this.lastResourceLevel},e.prototype.setExpandedResources=function(){for(var e=[],i=0;i<this.lastResourceLevel.length;i++){var n=this.lastResourceLevel[i].resourceData,r=n.Count;e.push(this.lastResourceLevel[i]);var a=n[this.lastResourceLevel[i].resource.expandedField];!t.isNullOrUndefined(a)&&!a&&r>0&&(i+=r)}this.expandedResources=e},e.prototype.getContentRows=function(e){for(var i,n,r=[],a=this.resourceCollection,s=t.createElement("tr"),o=t.createElement("td"),l=0;l<e.length;l++){var c=o.cloneNode();if(n=V(a,"name",e[l].resource.name),n===a.length-1?(t.extend(e[l].resourceData,{ClassName:"e-child-node"}),this.renderedResources[l].className=["e-child-node"]):(t.extend(e[l].resourceData,{ClassName:"e-parent-node"}),this.renderedResources[l].className=["e-parent-node"]),i=n*this.leftPixel+"px","e-parent-node"===e[l].resourceData.ClassName&&!t.isNullOrUndefined(e[l].resourceData.Count)&&e[l].resourceData.Count>0){var p=void 0;p=e[l].resourceData[a[n].expandedField]||t.isNullOrUndefined(e[l].resourceData[a[n].expandedField])?"e-resource-collapse":"e-resource-expand";var d=t.createElement("div");t.addClass([d],["e-resource-tree-icon",p]),this.setMargin(d,i),c.appendChild(d),this.resourceCollection.length>1&&t.EventHandler.add(d,"click",this.onTreeIconClick,this)}this.parent.activeView.setResourceHeaderContent(c,e[l],"e-resource-text"),c.setAttribute("data-group-index",e[l].groupIndex.toString()),this.parent.activeViewOptions.resourceHeaderTemplate||this.setMargin(c.querySelector(".e-resource-text"),i);var h=["e-resource-cells",e[l].resourceData.ClassName];t.addClass([c],h);var u={elementType:"resourceHeader",element:c,groupIndex:e[l].groupIndex};this.parent.trigger(je,u);var v=s.cloneNode();v.appendChild(c),r.push(v)}return r},e.prototype.setMargin=function(e,t){this.parent.enableRtl?e.style.marginRight=t:e.style.marginLeft=t},e.prototype.countCalculation=function(e,i){for(var n,r=0;r<e.length;r++){for(var s=e[e.length-(r+1)].dataSource,o=0;o<s.length;o++){var l=0;n=this.parent.activeViewOptions.group.byGroupID?new a.DataManager(i[i.length-1].dataSource).executeLocal((new a.Query).where(i[i.length-1].groupIDField,"equal",s[o][e[e.length-(r+1)].idField])):i[i.length-1].dataSource;for(var c=0;c<n.length;c++)l+=parseInt(n[c].Count,0);l+=parseInt(s[o].Count,0),t.extend(s[o],{Count:l})}i=i.slice(0,-1)}},e.prototype.onTreeIconClick=function(e){var i=this;this.parent.eventTooltip&&this.parent.eventTooltip.close();var n,r=e.target,a=t.closest(r,".e-parent-node").parentElement,s=parseInt(a.children[0].getAttribute("data-group-index"),10),o={cancel:!1,event:e,groupIndex:s,requestType:r.classList.contains("e-resource-collapse")?"resourceCollapse":"resourceExpand"};this.parent.trigger(He,o,function(a){if(!a.cancel){r.classList.contains("e-resource-collapse")?(t.classList(r,["e-resource-expand"],["e-resource-collapse"]),n=!0):(t.classList(r,["e-resource-collapse"],["e-resource-expand"]),n=!1);for(var l=0,c=[].slice.call(i.parent.element.querySelectorAll(".e-appointment"));l<c.length;l++){var p=c[l];t.remove(p)}if(i.parent.virtualScrollModule){if(i.updateVirtualContent(s,n,e,r),t.isBlazor())return}else i.updateContent(s,n);var d={cssProperties:i.parent.getCssProperties(),module:"scroll"};i.parent.notify(Be,d),o={cancel:!1,event:e,groupIndex:s,requestType:r.classList.contains("e-resource-collapse")?"resourceExpanded":"resourceCollapsed"},i.parent.notify(qe,{}),i.parent.trigger("actionComplete",o)}})},e.prototype.updateContent=function(e,i){for(var n,r=[],a=[],s=[],o=this.lastResourceLevel[e].resourceData,l=[].slice.call(this.parent.element.querySelectorAll(".e-resource-column-wrap tr")),c=[].slice.call(this.parent.element.querySelectorAll(".e-content-wrap tbody tr")),p=[].slice.call(this.parent.element.querySelectorAll(".e-content-wrap ."+Xe)),d=0;d<o.Count;d++)r.push(l[e+d+1]),a.push(c[e+d+1]),s.push(p[e+d+1]);for(var h=this.lastResourceLevel,u=0;u<r.length;u++){var v=!0;if(n=r[u].children[0].classList.contains("e-parent-node"),h[e].resourceData[h[e].resource.expandedField]=!i,i)n&&(g=r[u].querySelector(".e-resource-tree-icon"))&&t.classList(g,["e-resource-expand"],["e-resource-collapse"]),r[u].classList.contains("e-hidden")||t.addClass([r[u],a[u],s[u]],"e-hidden");else{if(n){var m=r[u].rowIndex;if(h[m].resourceData[h[m].resource.expandedField]||t.isNullOrUndefined(h[m].resourceData[h[m].resource.expandedField])||(r.splice(u+1,parseInt(h[m].resourceData.Count,0)),a.splice(u+1,parseInt(h[m].resourceData.Count,0)),s.splice(u+1,parseInt(h[m].resourceData.Count,0)),v=!1),v){var g=r[u].querySelector(".e-resource-tree-icon");g&&t.classList(g,["e-resource-collapse"],["e-resource-expand"])}}r[u].classList.contains("e-hidden")&&t.removeClass([r[u],a[u],s[u]],"e-hidden")}}},e.prototype.updateVirtualContent=function(e,i,n,r){var a=this;if(t.isBlazor()){return void this.parent.interopAdaptor.invokeMethodAsync("UpdateVirtualContent",e,i).then(function(){a.lastResourceLevel[e].resourceData[a.lastResourceLevel[e].resource.expandedField]=!i,a.setExpandedResources();var s=a.parent.virtualScrollModule.getRenderedCount(),o=a.expandedResources.indexOf(a.renderedResources[0]);if(a.renderedResources=a.expandedResources.slice(o,o+s),a.renderedResources.length<s){var l=a.expandedResources.length-s;l=l>0?l:0,a.renderedResources=a.expandedResources.slice(l,a.expandedResources.length)}var c=a.parent.element.querySelector(".e-virtual-track");a.parent.virtualScrollModule.updateVirtualTrackHeight(c);var p=a.parent.element.querySelector(".e-current-timeline");t.isNullOrUndefined(p)||(p.style.height=a.parent.element.querySelector("."+Ye).offsetHeight+"px");var d={cssProperties:a.parent.getCssProperties(),module:"scroll"};a.parent.notify(Be,d);var h={cancel:!1,event:n,groupIndex:e,requestType:r.classList.contains("e-resource-collapse")?"resourceExpanded":"resourceCollapsed"};a.parent.notify(qe,{}),a.parent.trigger("actionComplete",h)})}this.lastResourceLevel[e].resourceData[this.lastResourceLevel[e].resource.expandedField]=!i,this.setExpandedResources();var s=this.parent.virtualScrollModule.getRenderedCount(),o=this.expandedResources.indexOf(this.renderedResources[0]);if(this.renderedResources=this.expandedResources.slice(o,o+s),this.renderedResources.length<s){var l=this.expandedResources.length-s;l=l>0?l:0,this.renderedResources=this.expandedResources.slice(l,this.expandedResources.length)}var c=this.parent.element.querySelector(".e-virtual-track");this.parent.virtualScrollModule.updateVirtualTrackHeight(c);var p=this.parent.element.querySelector(".e-resource-column-wrap table"),d=this.parent.element.querySelector(".e-content-wrap table"),h=this.parent.element.querySelector(".e-event-table");this.parent.virtualScrollModule.updateContent(p,d,h,this.renderedResources);var u=this.parent.element.querySelector(".e-current-timeline");t.isNullOrUndefined(u)||(u.style.height=this.parent.element.querySelector("."+Ye).offsetHeight+"px")},e.prototype.renderResourceHeader=function(){var e=t.createElement("div",{className:Qe});if(e.innerHTML='<div class="e-schedule-resource-toolbar"><div class="e-resource-menu"><div class="e-icons e-icon-menu"></div></div><div class="e-resource-level-title"></div></div>',"MonthAgenda"===this.parent.currentView){var i=this.parent.activeView.getPanel().querySelector(".e-content-wrap");i.insertBefore(e,i.querySelector(".e-wrapper-container"))}else this.parent.element.insertBefore(e,this.parent.element.querySelector("."+_e));this.renderResourceHeaderText(),t.EventHandler.add(e.querySelector(".e-icon-menu"),"click",this.menuClick,this)},e.prototype.renderResourceTree=function(){this.popupOverlay=t.createElement("div",{className:"e-resource-tree-popup-overlay"});var e=t.createElement("div",{className:"e-resource-tree-popup e-popup-close"});if("MonthAgenda"===this.parent.currentView){var r=this.parent.activeView.getPanel().querySelector(".e-wrapper-container");r.insertBefore(e,r.children[0]),r.appendChild(this.popupOverlay)}else this.parent.element.querySelector("."+_e).appendChild(e),this.parent.element.querySelector("."+_e).appendChild(this.popupOverlay);var a=t.createElement("div",{className:"e-resource-tree"});e.appendChild(a),this.treeViewObj=new n.TreeView({cssClass:this.parent.cssClass,enableRtl:this.parent.enableRtl,fields:{dataSource:[].slice.call(this.generateTreeData()),id:"resourceId",text:"resourceName",child:"resourceChild"},nodeTemplate:this.parent.resourceHeaderTemplate,nodeClicked:this.resourceClick.bind(this)}),this.treeViewObj.appendTo(a),this.treeViewObj.expandAll(),this.treePopup=new i.Popup(e,{targetType:"relative",actionOnScroll:"none",content:this.treeViewObj.element,enableRtl:this.parent.enableRtl,hideAnimation:{name:"SlideLeftOut",duration:500},showAnimation:{name:"SlideLeftIn",duration:500},viewPortElement:this.parent.element.querySelector("."+("MonthAgenda"===this.parent.currentView?"e-wrapper-container":_e))}),this.parent.on("document-click",this.documentClick,this)},e.prototype.generateTreeData=function(e){for(var i=this,n=[],r=[],a=0,s=this,o=0,l=this.resourceTreeLevel.length;o<l;o++)!function(o,l){var c=function(n,s,o){var l,p,d=i.resourceCollection[s];e?(p={type:"resourceHeader",resource:n.resource,resourceData:n.resourceData,groupIndex:a,groupOrder:n.groupOrder},r.push(p),a++):l={resourceId:o,resourceName:n.resourceData[d.textField],resource:n.resource,resourceData:n.resourceData},n.child.length>0&&!e&&(l.resourceChild=[]);for(var h=1,u=0,v=n.child;u<v.length;u++){var m=v[u];e?c(m,s+1,o+"-"+h):l.resourceChild.push(c(m,s+1,o+"-"+h)),h+=1}return e&&t.extend(p.resourceData,{Count:h-1}),l};e?c(s.resourceTreeLevel[o],0,(o+1).toString()):n.push(c(s.resourceTreeLevel[o],0,(o+1).toString()))}(o);return e?(this.lastResourceLevel=r,r):n},e.prototype.renderResourceHeaderText=function(){for(var e=this.lastResourceLevel[this.parent.uiStateValues.groupIndex],i=[],n=this,r=0,a=e.groupOrder.length;r<a;r++)!function(r,a){var s=n.resourceCollection[r],o=s.dataSource.filter(function(t){return t[s.idField]===e.groupOrder[r]}),l=t.createElement("div",{className:"e-resource-name",innerHTML:o[0][s.textField]});i.push(l);var c=t.createElement("div",{className:"e-icons e-icon-next"});i.push(c)}(r);i.pop();var s=("MonthAgenda"===this.parent.currentView?this.parent.activeView.getPanel():this.parent.element).querySelector(".e-resource-level-title");R(s);for(var o=0,l=i;o<l.length;o++){var c=l[o];s.appendChild(c)}1===this.lastResourceLevel.length&&t.addClass([this.parent.element.querySelector(".e-resource-menu")],"e-disable")},e.prototype.menuClick=function(e){if(this.parent.element.querySelector(".e-resource-tree-popup").classList.contains(Ge))this.treePopup.hide(),t.removeClass([this.popupOverlay],"e-enable");else{var i=[].slice.call(this.treeViewObj.element.querySelectorAll(".e-list-item:not(.e-has-child)"));t.removeClass(i,"e-active"),t.addClass([i[this.parent.uiStateValues.groupIndex]],"e-active"),this.treePopup.show(),t.addClass([this.popupOverlay],"e-enable")}},e.prototype.resourceClick=function(e){var i=this;if(!e.node.classList.contains("e-has-child")){this.treePopup.hide(),t.removeClass([this.popupOverlay],"e-enable");var n=[].slice.call(this.treeViewObj.element.querySelectorAll(".e-list-item:not(.e-has-child)"));if(this.parent.uiStateValues.groupIndex=n.indexOf(e.node),this.parent.isServerRenderer())this.parent.interopAdaptor.invokeMethodAsync("OnResourceClick",this.parent.uiStateValues.groupIndex).then(function(){if(!i.parent.isDestroyed){i.renderResourceHeaderText(),i.parent.activeView.serverRenderLayout();var e=i.parent.eventBase.processData(i.parent.eventsData);i.parent.notify(qe,{processedData:e})}}).catch(function(e){return i.parent.renderModule.dataManagerFailure(e)});else{this.parent.renderModule.render(this.parent.currentView,!1);var r=this.parent.eventBase.processData(this.parent.blockData.concat(this.parent.eventsData));this.parent.notify(qe,{processedData:r})}}e.event.preventDefault()},e.prototype.documentClick=function(e){if(!t.closest(e.event.target,".e-resource-tree-popup")){var i=this.parent.element.querySelector(".e-resource-tree-popup");i&&i.classList.contains(Ge)&&(this.treePopup.hide(),t.removeClass([this.popupOverlay],"e-enable"))}},e.prototype.bindResourcesData=function(e){var i=this;if(this.parent.showSpinner(),t.isBlazor())return void(!this.parent.isServerRenderer()&&this.parent.tempResourceCollection&&(this.parent.resourceCollection=this.parent.tempResourceCollection||[],this.refreshLayout(!1)));for(var n=[],r=0;r<this.parent.resources.length;r++){var a=new nt(this.parent.resources[r].dataSource,this.parent.resources[r].query);n.push(a.getData(a.generateQuery()))}Promise.all(n).then(function(t){return i.dataManagerSuccess(t,e)}).catch(function(e){return i.parent.renderModule.dataManagerFailure(e)})},e.prototype.dataManagerSuccess=function(e,t){if(!this.parent.isDestroyed){this.parent.resourceCollection=[];for(var i=0,n=e.length;i<n;i++){var r=this.parent.resources[i],a=this.getResourceModel(r,e[i].result);this.parent.resourceCollection.push(a)}this.refreshLayout(t)}},e.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}},e.prototype.refreshLayout=function(e){this.parent.uiStateValues.groupIndex=0,this.parent.renderElements(e)},e.prototype.setResourceCollection=function(){var e=[];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=V(this.parent.resourceCollection,"name",r);a>=0&&e.push(this.parent.resourceCollection[a])}else this.parent.resourceCollection.length>0&&(e=this.parent.resourceCollection);for(var s=0,o=0,l=e;o<l.length;o++){var r=l[o],c=this.getResourceModel(r);r.name===this.parent.eventSettings.resourceColorField&&(this.colorIndex=s),s++,this.resourceCollection.push(c)}t.isNullOrUndefined(this.colorIndex)&&(this.colorIndex=this.resourceCollection.length-1)},e.prototype.generateResourceLevels=function(e,t){var i=this,n=this.resourceCollection,r=[],a=[],s=function(t,n,o,l,c){var p=[],d=t[0];if(d){var h=void 0;if(l&&i.parent.activeViewOptions.group.byGroupID){var u=l[o.idField];h=d.dataSource.filter(function(e){return e[d.groupIDField]===u})}else h=d.dataSource;for(var v=0;v<h.length;v++){var m=[];c&&c.length>0&&(m=m.concat(c)),m.push(h[v][d.idField]);var g=s(t.slice(1),n+1,d,h[v],m);if(!(0===n&&0===g.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=h[v][d.workDaysField],D=h[v][d.startHourField],b=h[v][d.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 C=i.generateCustomHours(f,D,b,m);a=a.concat(C)}var E=h[v][d.cssClassField],O={type:"resourceHeader",className:["e-resource-cells"],resourceLevelIndex:n,groupOrder:m,resource:d,resourceData:h[v],colSpan:i.parent.activeViewOptions.group.byDate?1:f.length,renderDates:y,workDays:T,cssClass:E,child:g};p.push(O)}}return r[n]||(r[n]=[]),r[n].push(p),p}return[]};return this.resourceTreeLevel=s(n,0),t?[]:this.generateHeaderLevels(r,a,e)},e.prototype.generateCustomHours=function(e,i,n,r){for(var a=t.extend([],e,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},e.prototype.generateHeaderLevels=function(e,i,n){for(var r=[],a=e.length-1;a>=0;a--)for(var s=0,o=0,l=e[a];o<l.length;o++)for(var c=0,p=l[o];c<p.length;c++){var d=p[c];if(e[a+1]){for(var h=0,u=0,v=e[a+1][s];u<v.length;u++){var m=v[u];(!this.parent.activeViewOptions.group.byGroupID||this.parent.activeViewOptions.group.byGroupID&&m.resourceData[m.resource.groupIDField]===d.resourceData[d.resource.idField])&&(h+=m.colSpan)}d.colSpan=h}d.groupIndex=s,s++,r[d.resourceLevelIndex]=r[d.resourceLevelIndex]||[],r[d.resourceLevelIndex].push(d)}if(this.lastResourceLevel=r.slice(-1)[0]||[],!this.parent.activeViewOptions.group.byDate){for(var g=0,f=0,y=this.lastResourceLevel;f<y.length;f++)for(var T=y[f],a=0;a<T.colSpan;a++)i[g].groupIndex=T.groupIndex,g++;return r.push(i),r}for(var w=[],D=t.extend([],r,null,!0),b=0,C=0,E=D[0];C<E.length;C++)b+=E[C].colSpan;for(var O=[],S=0,x=n;S<x.length;S++){var k=x[S];k.colSpan=b,O.push(k);for(var A=t.extend([],D,null,!0),V=0,M=A.length;V<M;V++){if(V===A.length-1)for(var R=0,P=A[V];R<P.length;R++){var H=P[R];H.date=k.date,H.workDays=k.workDays,H.startHour=this.parent.getStartEndTime(H.resourceData[H.resource.startHourField])||k.startHour,H.endHour=this.parent.getStartEndTime(H.resourceData[H.resource.endHourField])||k.endHour}w[V]||(w[V]=[]),w[V]=w[V].concat(A[V])}}return w.unshift(O),w},e.prototype.setResourceValues=function(e,i){var n=this,r=function(t,i,r){n.resourceCollection[t].allowMultiple&&n.parent.activeViewOptions.group.allowGroupEdit?e[i]=[r]:e[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&&!t.isNullOrUndefined(i))for(var a=this.lastResourceLevel[i].groupOrder,s=0;s<this.resourceCollection.length;s++)r(s,this.resourceCollection[s].field,a[s]);else if(this.parent.resourceCollection.length>0)for(s=0;s<this.resourceCollection.length;s++){var o=this.resourceCollection[s].dataSource[0];o&&r(s,this.resourceCollection[s].field,o[this.resourceCollection[s].idField])}},e.prototype.getResourceColor=function(e,i){var n=!t.isNullOrUndefined(i)&&this.colorIndex>i.length-1?i.length-1:this.colorIndex,r=this.resourceCollection[n];if(!(t.isNullOrUndefined(i)&&this.parent.activeViewOptions.group.allowGroupEdit&&r.allowMultiple)){var a=t.isNullOrUndefined(i)?e[r.field]:i[n],s=this.filterData(r.dataSource,r.idField,a);return s.length>0?s[0][r.colorField]:void 0}},e.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}},e.prototype.getResourceRenderDates=function(){var e=function(e){return e.filter(function(e,t,i){return i.map(function(e){return e.getTime()}).indexOf(e.getTime())===t})}([].concat.apply([],this.lastResourceLevel.map(function(e){return e.renderDates})));return e.sort(function(e,t){return e.getTime()-t.getTime()}),e},e.prototype.filterData=function(e,t,i){return e.filter(function(e){return e[t]===i})},e.prototype.getResourceData=function(e,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[o].groupOrder,c=0,p=l.length;c<p;c++){var d=this.resourceCollection[c].field;t.isNullOrUndefined(r[d])&&(r[d]=[]),r[d].push(l[c])}e=t.extend(e,r)}else for(var c=0,h=this.resourceCollection.length;c<h;c++)e[this.resourceCollection[c].field]=this.lastResourceLevel[i].groupOrder[c]},e.prototype.addResource=function(e,t,i){for(var n=e instanceof Array?e:[e],r=0,s=this.parent.resourceCollection;r<s.length&&"break"!==function(e){if(e.name===t)return n.forEach(function(t,n){return new a.DataManager({json:e.dataSource}).insert(t,null,null,i+n)}),"break"}(s[r]);r++);this.refreshLayout(!0)},e.prototype.removeResource=function(e,t){for(var i=e instanceof Array?e:[e],n=0,r=this.parent.resourceCollection;n<r.length&&"break"!==function(e){if(e.name===t)return i.forEach(function(t){return new a.DataManager({json:e.dataSource}).remove(e.idField,t)}),"break"}(r[n]);n++);this.refreshLayout(!0)},e.prototype.getIndexFromResourceId=function(e,t,i,n,r){var a=i.dataSource.filter(function(t){return n&&t[i.idField]===e?t[i.groupIDField]===n[r]?t[i.idField]===e:null:t[i.idField]===e})[0];return this.lastResourceLevel.map(function(e){return e.resourceData}).indexOf(a)},e.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('.e-resource-column-wrap [data-group-index="'+r+'"] .e-resource-tree-icon');s&&(s.classList.contains("e-resource-expand")&&!i?s.click():s.classList.contains("e-resource-collapse")&&i&&s.click())},e.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(".e-content-wrap"),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(".e-virtual-track"),c=Math.round(l.offsetHeight/this.expandedResources.length);this.parent.rowAutoHeight&&(a.scrollTop=0,this.parent.virtualScrollModule.virtualScrolling()),a.scrollTop=s*c-(this.parent.virtualScrollModule.bufferCount-1)*c,this.parent.virtualScrollModule.virtualScrolling(),this.parent.rowAutoHeight?(p=this.parent.element.querySelector('.e-work-cells[data-group-index="'+s+'"]'))&&!p.parentElement.classList.contains("e-hidden")&&(a.scrollTop=a.scrollTop<p.offsetTop?p.offsetTop:a.scrollTop+p.offsetTop):a.scrollTop=s*c}else{var p=this.parent.element.querySelector('.e-work-cells[data-group-index="'+s+'"]');p&&!p.parentElement.classList.contains("e-hidden")&&(a.scrollTop=p.offsetTop)}}else{s=this.parent.activeViewOptions.group.byGroupID?r.dataSource.map(function(e){return e[r.idField]}).indexOf(e):this.getIndexFromResourceId(e,i,r);var d=this.parent.element.querySelector(".e-header-row:nth-child("+(n+1)+")"),h=[].slice.call(d.children).map(function(e){return e.offsetLeft});a.scrollLeft=h[s]}}},e.prototype.destroy=function(){this.parent.off("document-click",this.documentClick),this.treeViewObj&&(this.treeViewObj.destroy(),this.treeViewObj=null),this.treePopup&&(this.treePopup.destroy(),this.treePopup=null,t.remove(this.parent.element.querySelector(".e-resource-tree-popup")),t.remove(this.parent.element.querySelector(".e-resource-tree-popup-overlay")));var e=this.parent.element.querySelector("."+Qe);e&&t.remove(e)},e}(),Pi=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])})(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)}}(),Hi=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},ji=function(e){function n(t,i){return e.call(this,t,i)||this}return Pi(n,e),n.prototype.render=function(){t.isBlazor()&&this.interopAdaptor.invokeMethodAsync("SetAdaptive",this.isAdaptive);var e=[],n=[];if(e.push(We),this.enableRtl?e.push("e-rtl"):n.push("e-rtl"),this.isAdaptive?e.push("e-device"):n.push("e-device"),this.cssClass)for(var r=0,a=this.cssClass.split(" ");r<a.length;r++){var s=a[r];e.push(s)}t.classList(this.element,e,n),this.validateDate(),this.eventTooltipTemplateFn=this.templateParser(this.eventSettings.tooltipTemplate),this.editorTemplateFn=this.templateParser(this.editorTemplate),this.quickInfoTemplatesHeaderFn=this.templateParser(this.quickInfoTemplates.header),this.quickInfoTemplatesContentFn=this.templateParser(this.quickInfoTemplates.content),this.quickInfoTemplatesFooterFn=this.templateParser(this.quickInfoTemplates.footer),i.createSpinner({target:this.element}),this.scrollModule=new et(this),this.scrollModule.setWidth(),this.scrollModule.setHeight(),this.renderModule=new ii(this),this.eventBase=new Ot(this),this.workCellAction=new gi(this),this.allowKeyboardInteraction&&(this.keyboardInteractionModule=new it(this)),this.inlineModule=new Rt(this),this.initializeDataModule(),this.on(qe,this.resetEventTemplates,this),this.on("events-loaded",this.updateEventTemplates,this),this.renderTableContainer(),this.activeViewOptions=this.getActiveViewOptions(),this.initializeResources(),this.wireEvents()},n.prototype.renderTableContainer=function(){this.element.querySelector("."+_e)||this.element.appendChild(this.createElement("div",{className:_e}))},n.prototype.isServerRenderer=function(e){void 0===e&&(e=this.currentView);var i=["Day","Week","WorkWeek","Month","MonthAgenda","TimelineDay","TimelineWeek","TimelineWorkWeek","TimelineMonth"];return!(!t.isBlazor()||-1===i.indexOf(e))},n.prototype.renderCompleted=function(){this.renderComplete()},n.prototype.layoutReady=function(e,t,i){e&&e.length>0&&(t||i)&&(this.resourceCollection=e,this.resourceBase&&this.resourceBase.refreshLayout(i)),this.isServerRenderer()&&this.activeView&&(this.activeView.serverRenderLayout(),this.renderModule&&this.renderModule.refreshDataManager())},n.prototype.refreshLayout=function(e){this.uiStateValues.groupIndex=0,this.resourceCollection=e,this.renderElements(!0),this.layoutReady()},n.prototype.updateLayoutTemplates=function(){var e=this.views[this.viewIndex];if(!this.isServerRenderer(e.option)){if(this.cellHeaderTemplate&&t.updateBlazorTemplate(this.element.id+"_cellHeaderTemplate","CellHeaderTemplate",this),""!==this.activeViewOptions.cellHeaderTemplateName){n=this.element.id+"_"+this.activeViewOptions.cellHeaderTemplateName+"cellHeaderTemplate";t.updateBlazorTemplate(n,"CellHeaderTemplate",e)}if(this.dateHeaderTemplate&&t.updateBlazorTemplate(this.element.id+"_dateHeaderTemplate","DateHeaderTemplate",this),""!==this.activeViewOptions.dateHeaderTemplateName){var i="dateHeaderTemplate",n=this.element.id+"_"+this.activeViewOptions.dateHeaderTemplateName+i;t.updateBlazorTemplate(n,"DateHeaderTemplate",e)}if(this.cellTemplate&&t.updateBlazorTemplate(this.element.id+"_cellTemplate","CellTemplate",this),""!==this.activeViewOptions.cellTemplateName){n=this.element.id+"_"+this.activeViewOptions.cellTemplateName+"cellTemplate";t.updateBlazorTemplate(n,"CellTemplate",e)}if(this.resourceHeaderTemplate&&t.updateBlazorTemplate(this.element.id+"_resourceHeaderTemplate","ResourceHeaderTemplate",this),""!==this.activeViewOptions.resourceHeaderTemplateName){var i="resourceHeaderTemplate",n=this.element.id+"_"+this.activeViewOptions.resourceHeaderTemplateName+i;t.updateBlazorTemplate(n,"ResourceHeaderTemplate",e)}this.timeScale.minorSlotTemplate&&t.updateBlazorTemplate(this.element.id+"_minorSlotTemplate","MinorSlotTemplate",this.timeScale),this.timeScale.majorSlotTemplate&&t.updateBlazorTemplate(this.element.id+"_majorSlotTemplate","MajorSlotTemplate",this.timeScale)}},n.prototype.resetLayoutTemplates=function(){var e=this.viewCollections[this.activeView.viewIndex];if(!this.isServerRenderer(e.option)){if(this.cellHeaderTemplate&&t.resetBlazorTemplate(this.element.id+"_cellHeaderTemplate","CellHeaderTemplate"),""!==e.cellHeaderTemplate&&t.resetBlazorTemplate(this.element.id+"_"+e.cellHeaderTemplateName+"cellHeaderTemplate","CellHeaderTemplate"),this.dateHeaderTemplate&&t.resetBlazorTemplate(this.element.id+"_dateHeaderTemplate","DateHeaderTemplate"),""!==e.dateHeaderTemplateName&&t.resetBlazorTemplate(this.element.id+"_"+e.dateHeaderTemplateName+"dateHeaderTemplate","DateHeaderTemplate"),this.cellTemplate&&t.resetBlazorTemplate(this.element.id+"_cellTemplate","CellTemplate"),""!==e.cellTemplateName&&t.resetBlazorTemplate(this.element.id+"_"+e.cellTemplateName+"cellTemplate","CellTemplate"),this.resourceHeaderTemplate&&t.resetBlazorTemplate(this.element.id+"_resourceHeaderTemplate","ResourceHeaderTemplate"),""!==e.resourceHeaderTemplateName){t.resetBlazorTemplate(this.element.id+"_"+e.resourceHeaderTemplateName+"resourceHeaderTemplate","ResourceHeaderTemplate")}this.timeScale.minorSlotTemplate&&t.resetBlazorTemplate(this.element.id+"_minorSlotTemplate","MinorSlotTemplate"),this.timeScale.majorSlotTemplate&&t.resetBlazorTemplate(this.element.id+"_majorSlotTemplate","MajorSlotTemplate")}},n.prototype.updateEventTemplates=function(){var e=this.views[this.viewIndex],i=this.viewCollections[this.viewIndex];if(this.eventSettings.template&&t.updateBlazorTemplate(this.element.id+"_eventTemplate","Template",this.eventSettings,!1),""!==this.activeViewOptions.eventTemplateName){var n=this.element.id+"_"+this.activeViewOptions.eventTemplateName+"eventTemplate";t.updateBlazorTemplate(n,"EventTemplate",e,!1)}"Agenda"!==i.option&&"MonthAgenda"!==i.option&&"TimelineYear"!==i.option||this.updateLayoutTemplates()},n.prototype.resetEventTemplates=function(){var e=this.viewCollections[this.activeView.viewIndex];if(this.eventSettings.template&&(t.blazorTemplates[this.element.id+"_eventTemplate"]=[],t.updateBlazorTemplate(this.element.id+"_eventTemplate","Template",this.eventSettings)),""!==e.eventTemplateName){var i=this.element.id+"_"+e.eventTemplateName+"eventTemplate";t.blazorTemplates[i]=[],t.updateBlazorTemplate(i,"EventTemplate",this.views[this.activeView.viewIndex])}"Agenda"!==e.option&&"MonthAgenda"!==e.option&&"TimelineYear"!==e.option||this.resetLayoutTemplates()},n.prototype.initializeResources=function(e){void 0===e&&(e=!1),this.resources.length>0?(this.resourceBase=new Ri(this),this.resourceBase.bindResourcesData(e)):(this.resourceBase=null,this.resourceCollection=[],this.renderElements(e))},n.prototype.renderElements=function(e){if(e)return this.initializeView(this.currentView),void this.eventWindow.refresh();this.destroyHeaderModule(),this.showHeaderBar&&(this.headerModule=new $e(this)),this.renderTableContainer(),(t.Browser.isDevice||t.Browser.isTouch)&&(this.scheduleTouchModule=new tt(this)),this.initializeView(this.currentView),this.destroyPopups(),this.initializePopups()},n.prototype.validateDate=function(e){void 0===e&&(e=this.selectedDate);var t=e instanceof Date?new Date(e.getTime()):new Date(e),i=this.minDate instanceof Date?new Date(this.minDate.getTime()):new Date(this.minDate),n=this.maxDate instanceof Date?new Date(this.maxDate.getTime()):new Date(this.maxDate);if(!(i<=n))throw Error("minDate should be equal or less than maxDate");t<i&&(t=i),t>n&&(t=n),this.setScheduleProperties({selectedDate:new Date(""+t),minDate:new Date(""+i),maxDate:new Date(""+n)})},n.prototype.getViewIndex=function(e){for(var t=0;t<this.viewCollections.length;t++)if(this.viewCollections[t].option===e)return t;return-1},n.prototype.setViewOptions=function(e){void 0===e&&(e=!1),this.viewOptions={},this.viewCollections=[];var i,n,r=this.viewIndex,a=0;this.viewIndex=-1;for(var s=0,o=this.views;s<o.length;s++){var l=o[s],c="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 p=t.extend({option:i},c?l:{}),d=i.charAt(0).toLowerCase()+i.slice(1);p.cellHeaderTemplateName=p.cellHeaderTemplate?p.option:"",p.dateHeaderTemplateName=p.dateHeaderTemplate?p.option:"",p.cellTemplateName=p.cellTemplate?p.option:"",p.resourceHeaderTemplateName=p.resourceHeaderTemplate?p.option:"",p.eventTemplateName=p.eventTemplate?p.option:"",t.isNullOrUndefined(p.firstDayOfWeek)||0!==p.firstDayOfWeek||delete p.firstDayOfWeek,t.isNullOrUndefined(p.interval)||1!==p.interval||delete p.interval,this.viewCollections.push(p),t.isNullOrUndefined(this.viewOptions[d])?this.viewOptions[d]=[p]:this.viewOptions[d].push(p),a++}if(!e&&n&&(this.setScheduleProperties({currentView:n}),this.onServerDataBind()),-1===this.viewIndex){var h=this.getViewIndex(this.currentView);this.viewIndex="string"==typeof this.views[0]||t.isNullOrUndefined(r)||-1===r?-1===h?0:h:r}},n.prototype.onServerDataBind=function(){this.bulkChanges&&this.bulkChanges.selectedDate&&(this.bulkChanges.selectedDate=H(this.bulkChanges.selectedDate)),this.serverDataBind()},n.prototype.getActiveViewOptions=function(){var e={enable:this.timeScale.enable,interval:this.timeScale.interval,slotCount:this.timeScale.slotCount,majorSlotTemplate:this.timeScale.majorSlotTemplate,minorSlotTemplate:this.timeScale.minorSlotTemplate},i={byDate:this.group.byDate,byGroupID:this.group.byGroupID,allowGroupEdit:this.group.allowGroupEdit,resources:this.group.resources,headerTooltipTemplate:this.group.headerTooltipTemplate,enableCompactView:this.group.enableCompactView},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,cellHeaderTemplate:this.cellHeaderTemplate,cellTemplate:this.cellTemplate,eventTemplate:this.eventSettings.template,dateHeaderTemplate:this.dateHeaderTemplate,resourceHeaderTemplate:this.resourceHeaderTemplate,firstDayOfWeek:this.firstDayOfWeek,workDays:n,showWeekend:this.showWeekend,showWeekNumber:this.showWeekNumber,displayName:null,interval:1,timeScale:e,group:i,headerRows:this.headerRows,orientation:"Horizontal"},a=this.viewCollections[this.viewIndex],s=t.extend(r,a,void 0,!0);return 0!==this.firstDayOfWeek&&a.firstDayOfWeek&&this.firstDayOfWeek!==a.firstDayOfWeek&&(s.firstDayOfWeek=this.firstDayOfWeek),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 nt(this.eventSettings.dataSource,this.eventSettings.query),this.crudModule=new mi(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.cellTemplateFn=this.templateParser(this.activeViewOptions.cellTemplate),this.dateHeaderTemplateFn=this.templateParser(this.activeViewOptions.dateHeaderTemplate),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.headerTooltipTemplateFn=this.templateParser(this.activeViewOptions.group.headerTooltipTemplate)},n.prototype.initializePopups=function(){this.eventWindow=new ei(this),this.quickPopup=new Ht(this)},n.prototype.getDayNames=function(e){t.isBlazor()&&"narrow"===e&&(e="short");var i,n=[],r="";"en"===this.locale||"en-US"===this.locale?(r=t.isBlazor()?"days.":"days.stand-alone.",i=t.getValue(r+e,t.getDefaultDateObject(this.getCalendarMode()))):(r=t.isBlazor()?this.locale+".dates.days."+e:"main."+this.locale+".dates.calendars."+this.getCalendarMode()+".days.format."+e,i=t.getValue(r,t.cldrData));for(var a=0,s=Object.keys(i);a<s.length;a++){var o=s[a];n.push(t.getValue(o,i))}return n},n.prototype.setCldrTimeFormat=function(){if(t.isBlazor())return void(this.timeFormat=t.IntlBase.compareBlazorDateFormats({skeleton:"t"},this.locale).format);"en"===this.locale||"en-US"===this.locale?this.timeFormat=t.getValue("timeFormats.short",t.getDefaultDateObject(this.getCalendarMode())):this.timeFormat=t.getValue("main."+this.locale+".dates.calendars."+this.getCalendarMode()+".timeFormats.short",t.cldrData)},n.prototype.getCalendarMode=function(){return this.calendarMode.toLowerCase()},n.prototype.getTimeString=function(e){return this.globalize.formatDate(e,{format:this.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 at:this.calendarUtil=new rt},n.prototype.setScheduleProperties=function(e){this.allowServerDataBinding=!1,this.setProperties(e,!0),this.allowServerDataBinding=!0},n.prototype.changeView=function(e,i,n,r){var a=this;if(t.isNullOrUndefined(r)&&(r=this.getViewIndex(e)),!(!n&&r===this.viewIndex||r<0)){this.viewIndex=r,t.isBlazor()&&this.interopAdaptor.invokeMethodAsync("SetViewIndex",this.viewIndex);var s={requestType:"viewNavigate",cancel:!1,event:i};this.trigger(He,s,function(n){if(!n.cancel){var r={action:"view",cancel:!1,previousView:a.currentView,currentView:e,viewIndex:a.viewIndex};a.trigger("navigating",r,function(n){n.cancel||(a.viewIndex=n.viewIndex,a.setScheduleProperties({currentView:e}),a.headerModule&&(a.headerModule.updateActiveView(),a.headerModule.setCalendarDate(a.selectedDate),a.headerModule.setCalendarView()),a.initializeView(a.currentView),a.onServerDataBind(),a.animateLayout(),t.isBlazor()&&a.virtualScrollModule&&a.resetScrollTop(),s={requestType:"viewNavigate",cancel:!1,event:i},a.trigger("actionComplete",s))})}})}},n.prototype.changeDate=function(e,i){var n=this,r={requestType:"dateNavigate",cancel:!1,event:i};this.trigger(He,r,function(a){if(!a.cancel){var s={action:"date",cancel:!1,previousDate:n.selectedDate,currentDate:e};n.trigger("navigating",s,function(a){a.cancel||(n.uiStateValues.isInitial=!!n.activeView.isTimelineView()||n.uiStateValues.isInitial,n.validateDate(e),n.headerModule&&n.headerModule.setCalendarDate(e),n.initializeView(n.currentView),n.onServerDataBind(),n.animateLayout(),t.isBlazor()&&n.virtualScrollModule&&n.resetScrollTop(),r={requestType:"dateNavigate",cancel:!1,event:i},n.trigger("actionComplete",r))})}})},n.prototype.resetScrollTop=function(){var e=this.element.querySelector(".e-resource-column-wrap"),i=this.element.querySelector(".e-content-wrap");t.isNullOrUndefined(i)||(i.scrollTop=0),t.isNullOrUndefined(e)||(e.scrollTop=0)},n.prototype.isMinMaxDate=function(e){return void 0===e&&(e=this.selectedDate),e.getTime()>=this.minDate.getTime()&&e.getTime()<=this.maxDate.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(){if(this.timezone){var e=(new Date).getTimezoneOffset();return this.tzModule.convert(new Date,e,this.timezone)}return new Date},n.prototype.getNavigateView=function(){return this.activeView.isTimelineView()?"TimelineMonth"===this.currentView||"TimelineYear"===this.currentView?"TimelineDay":"Agenda":"Day"},n.prototype.animateLayout=function(){!t.isBlazor()&&this.activeView.element&&new t.Animation({duration:600,name:"FadeIn",timingFunction:"easeIn"}).animate(this.activeView.element)},n.prototype.requiredModules=function(){var e=[];this.setViewOptions(!0);for(var i=0,n=Object.keys(this.viewOptions);i<n.length;i++){var r=n[i];r="timelineDay"===r||"timelineWeek"===r||"timelineWorkWeek"===r?"timelineViews":r,e.push({member:r,args:[this]})}return this.allowDragAndDrop&&e.push({member:"dragAndDrop",args:[this]}),this.allowResizing&&e.push({member:"resize",args:[this]}),(!t.isBlazor()||t.isBlazor()&&this.isServerRendered&&this.allowExcelExport)&&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=t.Browser.isDevice,this.globalize=new t.Internationalization(this.locale),this.tzModule=new st,this.uiStateValues={expand:!1,isInitial:!0,left:0,top:0,isGroupAdaptive:!1,isIgnoreOccurrence:!1,groupIndex:0,action:!1,isBlock:!1},this.activeCellsData={startTime:this.getCurrentTime(),endTime:this.getCurrentTime(),isAllDay:!1},this.activeEventData={event:void 0,element:void 0},this.getDefaultLocale(),this.localeObj=new t.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.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",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.",editRecurrence:"Edit Recurrence",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.",ok:"Ok",yes:"Yes",no:"No",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"}},n.prototype.wireEvents=function(){t.EventHandler.add(window,"resize",this.onScheduleResize,this),t.EventHandler.add(window,"orientationchange",this.onScheduleResize,this),t.EventHandler.add(document,t.Browser.touchStartEvent,this.onDocumentClick,this)},n.prototype.removeSelectedClass=function(){for(var e=this.getSelectedElements(),i=0,n=e;i<n.length;i++){var r=n[i];r.setAttribute("aria-selected","false"),r.removeAttribute("tabindex")}t.removeClass(e,"e-selected-cell")},n.prototype.addSelectedClass=function(e,i){for(var n=0,r=e;n<r.length;n++)r[n].setAttribute("aria-selected","true");t.addClass(e,"e-selected-cell"),i&&(i.setAttribute("tabindex","0"),i.focus())},n.prototype.selectCell=function(e){this.removeSelectedClass(),this.addSelectedClass([e],e)},n.prototype.getAllDayRow=function(){return this.element.querySelector(".e-all-day-row")},n.prototype.getContentTable=function(){return this.activeView.element.querySelector("."+Ye+" tbody")},n.prototype.getTableRows=function(){return[].slice.call(this.element.querySelectorAll("."+Ye+" tbody tr:not(.e-hidden)"))},n.prototype.getWorkCellElements=function(){return[].slice.call(this.element.querySelectorAll(".e-work-cells"))},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("e-all-day-cells")||e.classList.contains("e-header-cells"))&&this.activeViewOptions.timeScale.enable)||!!(this.activeView.isTimelineView()&&this.activeViewOptions.headerRows.length>0&&"Hour"!==this.activeViewOptions.headerRows.slice(-1)[0].option)},n.prototype.getDateFromElement=function(e){var i=e.getAttribute("data-date");if(!t.isNullOrUndefined(i)){var n=parseInt(i,10),r=new Date(n);if(this.isServerRenderer()){var a=new Date(+r+6e4*r.getTimezoneOffset());return new Date(a.getTime()+6e4*(a.getTimezoneOffset()-r.getTimezoneOffset()))}return r}},n.prototype.getMsFromDate=function(e){return this.isServerRenderer()?new Date(+e-6e4*e.getTimezoneOffset()).getTime():e.getTime()},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.getCellTemplate=function(){return this.cellTemplateFn},n.prototype.getDateHeaderTemplate=function(){return this.dateHeaderTemplateFn},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.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.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 e=this.element.querySelector(".e-new-event");t.isNullOrUndefined(e)||t.remove(e)},n.prototype.getStartEndTime=function(e){if(!t.isNullOrUndefined(e)&&""!==e){var i=T(this.getCurrentTime()),n=e.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("document-click",{event:e})},n.prototype.onScheduleResize=function(){this.quickPopup&&this.quickPopup.onClosePopup(),("Month"===this.currentView||"Agenda"!==this.currentView&&"MonthAgenda"!==this.currentView&&!this.activeViewOptions.timeScale.enable||this.activeView.isTimelineView())&&(this.activeView.resetColWidth(),this.notify(Be,{cssProperties:this.getCssProperties(),isPreventScrollUpdate:!0}),this.notify(qe,{}))},n.prototype.templateParser=function(e){if(e)try{if(document.querySelectorAll(e).length)return t.compile(document.querySelector(e).innerHTML.trim())}catch(i){return t.compile(e)}},n.prototype.getAnnocementString=function(e,i){var n=i||e[this.eventFields.subject]||this.eventSettings.fields.subject.default,r=t.isBlazor()?"F":"full",a=this.globalize.formatDate(e[this.eventFields.startTime],{type:"dateTime",skeleton:r,calendar:this.getCalendarMode()}),s=this.globalize.formatDate(e[this.eventFields.endTime],{type:"dateTime",skeleton:r,calendar:this.getCalendarMode()});return n+" "+this.localeObj.getConstant("beginFrom")+" "+a+" "+this.localeObj.getConstant("endAt")+" "+s},n.prototype.boundaryValidation=function(e,t){var i={left:!1,right:!1,top:!1,bottom:!1},n=this.element.querySelector(".e-content-wrap").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.unwireEvents=function(){t.EventHandler.remove(window,"resize",this.onScheduleResize),t.EventHandler.remove(window,"orientationchange",this.onScheduleResize),t.EventHandler.remove(document,t.Browser.touchStartEvent,this.onDocumentClick)},n.prototype.getModuleName=function(){return"schedule"},n.prototype.getPersistData=function(){return this.addOnPersist(["currentView","selectedDate"])},n.prototype.onPropertyChanged=function(e,i){for(var n={isRefresh:!1,isResource:!1,isDate:!1,isView:!1,isLayout:!1,isDataManager:!1},r=0,a=Object.keys(e);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(this.activeView.getDateRangeText());break;case"showHeaderBar":this.destroyHeaderModule(),e.showHeaderBar&&(this.headerModule=new $e(this),this.headerModule.updateDateRange(this.activeView.getDateRangeText())),this.notify(Be,{cssProperties:this.getCssProperties()}),this.activeView.isTimelineView()&&this.notify(qe,{});break;case"showWeekend":case"workDays":case"startHour":case"endHour":case"workHours":case"readonly":case"headerRows":case"showWeekNumber":n.isLayout=!0;break;case"locale":case"calendarMode":this.globalize=new t.Internationalization(this.locale),this.localeObj=new t.L10n(this.getModuleName(),this.defaultLocale,this.locale),this.setCldrTimeFormat(),this.setCalendarMode(),n.isRefresh=!0;break;case"firstDayOfWeek":this.activeViewOptions.firstDayOfWeek=e.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=e.cellHeaderTemplate,this.cellHeaderTemplateFn=this.templateParser(this.activeViewOptions.cellHeaderTemplate),n.isLayout=!0;break;case"cellTemplate":this.activeViewOptions.cellTemplate=e.cellTemplate,this.cellTemplateFn=this.templateParser(this.activeViewOptions.cellTemplate),n.isLayout=!0;break;case"dateHeaderTemplate":this.activeViewOptions.dateHeaderTemplate=e.dateHeaderTemplate,this.dateHeaderTemplateFn=this.templateParser(this.activeViewOptions.dateHeaderTemplate),n.isLayout=!0;break;case"resourceHeaderTemplate":this.activeViewOptions.resourceHeaderTemplate=e.resourceHeaderTemplate,this.resourceHeaderTemplateFn=this.templateParser(this.activeViewOptions.resourceHeaderTemplate),n.isLayout=!0;break;case"timezone":this.eventBase.timezonePropertyChange(i.timezone);break;case"enableRtl":this.setRtlClass(),n.isRefresh=!0;break;case"rowAutoHeight":n.isLayout=!0;break;default:this.extendedPropertyChange(s,e,i,n)}}this.propertyChangeAction(n)},n.prototype.propertyChangeAction=function(e){e.isRefresh?this.refresh():e.isResource?this.initializeResources(!0):e.isView?this.changeView(this.currentView,null,!0):e.isDate?this.changeDate(this.selectedDate):e.isLayout?this.initializeView(this.currentView):e.isDataManager&&this.renderModule&&(this.dragAndDropModule&&(this.dragAndDropModule.actionObj.action="",t.removeClass([this.element],"e-event-action")),this.renderModule.refreshDataManager())},n.prototype.extendedPropertyChange=function(e,i,n,r){switch(e){case"width":case"height":this.notify("ui-update",{module:"scroll",properties:{width:i.width,height:i.height}});break;case"cssClass":n.cssClass&&t.removeClass([this.element],n.cssClass.split(" ")),i.cssClass&&t.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":this.keyboardInteractionModule&&(this.keyboardInteractionModule.destroy(),this.keyboardInteractionModule=null),i.allowKeyboardInteraction&&(this.keyboardInteractionModule=new it(this));break;case"editorTemplate":t.isNullOrUndefined(this.editorTemplate)||(this.editorTemplateFn=this.templateParser(this.editorTemplate)),this.eventWindow&&this.eventWindow.setDialogContent();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":this.notify(qe,{processedData:this.eventBase.processData(this.eventsData)});break;case"eventDragArea":this.notify(qe,{})}},n.prototype.setRtlClass=function(){this.enableRtl?t.addClass([this.element],"e-rtl"):t.removeClass([this.element],"e-rtl")},n.prototype.refresh=function(){this.isServerRenderer()?(this.setEditorTitles(),this.destroyHeaderModule(),this.showHeaderBar&&(this.headerModule=new $e(this),this.renderModule.updateHeader()),this.destroyPopups(),this.initializePopups(),this.notify(Be,{cssProperties:this.getCssProperties()}),this.notify(qe,{})):(this.tempResourceCollection=this.resourceCollection,e.prototype.refresh.call(this),this.tempResourceCollection=null)},n.prototype.onGroupSettingsPropertyChanged=function(e,t,i){for(var n=0,r=Object.keys(e);n<r.length;n++){var a=r[n];"headerTooltipTemplate"===a?this.headerTooltipTemplateFn=this.templateParser(e[a]):(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":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 jt(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.eventWindow&&this.eventWindow.refresh();break;case"enableMaxHeight":case"enableIndicator":this.notify(qe,{processedData:this.eventBase.processData(this.eventsData)});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(){i.showSpinner(this.element)},n.prototype.hideSpinner=function(){i.hideSpinner(this.element)},n.prototype.setWorkHours=function(e,i,n,r){var a=[];a=this.getWorkHourCells(e,i,n,r),t.addClass(a,"e-work-hours")},n.prototype.resetWorkHours=function(e,i,n,r){if(void 0===e&&(e=this.activeView.renderDates),e&&i&&n){var a=this.getWorkHourCells(e,i,n,r);t.removeClass(a,"e-work-hours")}else{var s=[].slice.call(this.element.querySelectorAll(".e-work-hours"));t.removeClass(s,"e-work-hours")}},n.prototype.getWorkHourCells=function(e,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(t.isNullOrUndefined(a)||t.isNullOrUndefined(s)||!o)return[];a.setMilliseconds(0),s.setMilliseconds(0);var l=this.activeView.getStartHour();a<l&&(a=l);var c=this.activeView.getEndHour();s>c&&(s=c);for(var p=this.activeViewOptions.timeScale.interval*Fe/this.activeViewOptions.timeScale.slotCount,d=Math.round((a.getTime()-l.getTime())/p),h=Math.ceil((s.getTime()-l.getTime())/p),u=d,v=h,m=[],g=0,f=e;g<f.length;g++){var y=f[g];T(y=this.getDateTime(y));var w=this.activeView.renderDates;t.isNullOrUndefined(r)||!this.resourceBase||this.activeView.isTimelineView()||(w=this.resourceBase.lastResourceLevel[r].renderDates);var D=this.getIndexOfDate(w,y);if(D>=0){if(this.activeView.isTimelineView()){var b=Math.round((c.getTime()-l.getTime())/p);d=u+D*b,h=v+D*b}for(var C=d;C<h;C++)if(this.activeView.isTimelineView()){var E=t.isNullOrUndefined(r)?0:r;m.push(o.rows[E].cells[C])}else if(t.isNullOrUndefined(r))m.push(o.rows[C].cells[D]);else{var O=[].slice.call(o.rows[C].querySelectorAll('.e-work-cells[data-group-index="'+r+'"]'));m.push(O[D])}}}return m},n.prototype.getCellDetails=function(e){var i=e instanceof Array?e:[e],n=t.getElement(i[0]),r=t.getElement(i.slice(-1)[0]),a=this.getDateFromElement(n),s=this.getDateFromElement(r);if(!t.isNullOrUndefined(a)&&!t.isNullOrUndefined(s)){var o=this.activeView.isTimelineView()&&!t.isNullOrUndefined(r.getAttribute("colSpan"))&&this.headerRows.length>0,l=o?parseInt(r.getAttribute("colSpan"),10):1,c={startTime:a,endTime:s=!this.activeViewOptions.timeScale.enable||o||r.classList.contains("e-all-day-cells")||r.classList.contains("e-header-cells")?b(new Date(s.getTime()),l):this.activeView.getEndDateFromStartDate(s),isAllDay:this.isAllDayCell(n),element:t.isBlazor()?n:e},p=n.getAttribute("data-group-index");return t.isNullOrUndefined(p)||(c.groupIndex=parseInt(p,10)),c}},n.prototype.getSelectedElements=function(){return[].slice.call(this.element.querySelectorAll(".e-selected-cell"))},n.prototype.getResourceCollections=function(){return this.resourceCollection},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.getResourcesByIndex=function(e){if(this.resourceBase&&this.resourceBase.lastResourceLevel){if(e<0||e>=this.resourceBase.lastResourceLevel.length)return;var t=this.resourceBase.lastResourceLevel[e],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(e,i){this.activeView.scrollToDate&&t.isNullOrUndefined(e)&&i?this.activeView.scrollToDate(i):this.activeView.scrollToHour&&this.activeView.scrollToHour(e,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 Error("Inject ICalendarExport module");this.iCalendarExportModule.initializeCalendarExport(e,t)},n.prototype.importICalendar=function(e){if(!this.iCalendarImportModule)throw Error("Inject ICalendarImport module");this.iCalendarImportModule.initializeCalendarImport(e)},n.prototype.addEvent=function(e){this.crudModule.addEvent(e)},n.prototype.exportToExcel=function(e){if(!this.excelExportModule)throw Error("Inject ExcelExport module");this.excelExportModule.initializeExcelExport(e||{})},n.prototype.print=function(){if(!this.printModule)throw Error("Inject Print module");this.printModule.printScheduler()},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(){this.dragAndDropModule&&(this.dragAndDropModule.actionObj.action="",t.removeClass([this.element],"e-event-action")),this.renderModule.refreshDataManager()},n.prototype.getEventDetails=function(e){var i=(e=t.getElement(e)).getAttribute("data-guid");return i?this.eventBase.getEventByGuid(i):{}},n.prototype.isSlotAvailable=function(e,i,n){var r,a,s=this,o=this.activeEventData.event;if(e instanceof Date||"string"==typeof e?(r=e,a=i):(o=e,r=e[this.eventFields.startTime],a=e[this.eventFields.endTime],this.resourceBase&&(n=this.eventBase.getGroupIndexFromEvent(e))),t.isNullOrUndefined(r)||t.isNullOrUndefined(a))return!0;r=this.getDateTime(r),a=this.getDateTime(a);var l=this.eventBase.filterEvents(r,a);return!t.isNullOrUndefined(n)&&this.resourceBase&&this.resourceBase.lastResourceLevel.length>0&&(l=this.eventBase.filterEventsByResource(this.resourceBase.lastResourceLevel[n],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.openEditor=function(e,i,n,r){"Add"!==i||n?(e[this.eventFields.startTime]=this.getDateTime(e[this.eventFields.startTime]),e[this.eventFields.endTime]=this.getDateTime(e[this.eventFields.endTime])):(e.startTime=this.getDateTime(e.startTime),e.endTime=this.getDateTime(e.endTime),t.isNullOrUndefined(e.element)||(e.element=t.getElement(e.element))),this.currentAction=i,"Add"!==i&&(this.activeEventData.event=e),this.eventWindow.openEditor(e,i,n,r)},n.prototype.closeEditor=function(){this.eventWindow&&this.eventWindow.dialogClose()},n.prototype.closeQuickInfoPopup=function(){this.quickPopup&&this.quickPopup.quickPopupHide(!0)},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(){t.isBlazor()&&(this.isDestroyed=!0),this.eventTooltip&&(this.eventTooltip.destroy(),this.eventTooltip=null),this.destroyPopups(),this.unwireEvents(),this.destroyHeaderModule(),this.workCellAction.destroy(),this.inlineModule.destroy(),this.keyboardInteractionModule&&this.keyboardInteractionModule.destroy(),this.scrollModule&&(this.scrollModule.destroy(),this.scrollModule=null),this.activeView&&(this.activeView.removeEventListener(),this.activeView.destroy(),this.activeView=null),this.scheduleTouchModule&&(this.scheduleTouchModule.destroy(),this.scheduleTouchModule=null),e.prototype.destroy.call(this),R(this.element);var i=[We];this.cssClass&&(i=i.concat(this.cssClass.split(" "))),t.removeClass([this.element],i)},Hi([t.Property("auto")],n.prototype,"width",void 0),Hi([t.Property("auto")],n.prototype,"height",void 0),Hi([t.Property(!0)],n.prototype,"showHeaderBar",void 0),Hi([t.Property(!0)],n.prototype,"showTimeIndicator",void 0),Hi([t.Property("Week")],n.prototype,"currentView",void 0),Hi([t.Property(["Day","Week","WorkWeek","Month","Agenda"])],n.prototype,"views",void 0),Hi([t.Property(new Date)],n.prototype,"selectedDate",void 0),Hi([t.Property(new Date(1900,0,1))],n.prototype,"minDate",void 0),Hi([t.Property(new Date(2099,11,31))],n.prototype,"maxDate",void 0),Hi([t.Property()],n.prototype,"dateFormat",void 0),Hi([t.Property("Gregorian")],n.prototype,"calendarMode",void 0),Hi([t.Property(!0)],n.prototype,"showWeekend",void 0),Hi([t.Property(0)],n.prototype,"firstDayOfWeek",void 0),Hi([t.Property([1,2,3,4,5])],n.prototype,"workDays",void 0),Hi([t.Property("00:00")],n.prototype,"startHour",void 0),Hi([t.Property("24:00")],n.prototype,"endHour",void 0),Hi([t.Property(!0)],n.prototype,"allowResizing",void 0),Hi([t.Complex({},ai)],n.prototype,"workHours",void 0),Hi([t.Complex({},li)],n.prototype,"timeScale",void 0),Hi([t.Property(!0)],n.prototype,"allowKeyboardInteraction",void 0),Hi([t.Property(!0)],n.prototype,"allowDragAndDrop",void 0),Hi([t.Property()],n.prototype,"dateHeaderTemplate",void 0),Hi([t.Property()],n.prototype,"cellHeaderTemplate",void 0),Hi([t.Property()],n.prototype,"cellTemplate",void 0),Hi([t.Property(!1)],n.prototype,"readonly",void 0),Hi([t.Property(!0)],n.prototype,"showQuickInfo",void 0),Hi([t.Property(!1)],n.prototype,"allowInline",void 0),Hi([t.Property(!0)],n.prototype,"allowMultiCellSelection",void 0),Hi([t.Property(!0)],n.prototype,"allowMultiRowSelection",void 0),Hi([t.Property(!1)],n.prototype,"quickInfoOnSelectionEnd",void 0),Hi([t.Property(!1)],n.prototype,"showWeekNumber",void 0),Hi([t.Property(!1)],n.prototype,"rowAutoHeight",void 0),Hi([t.Property()],n.prototype,"editorTemplate",void 0),Hi([t.Complex({},di)],n.prototype,"quickInfoTemplates",void 0),Hi([t.Property(7)],n.prototype,"agendaDaysCount",void 0),Hi([t.Property(!0)],n.prototype,"hideEmptyAgendaDays",void 0),Hi([t.Property(!0)],n.prototype,"enableRecurrenceValidation",void 0),Hi([t.Property()],n.prototype,"timezone",void 0),Hi([t.Complex({},Oi)],n.prototype,"eventSettings",void 0),Hi([t.Property()],n.prototype,"resourceHeaderTemplate",void 0),Hi([t.Complex({},ki)],n.prototype,"group",void 0),Hi([t.Collection([],Mi)],n.prototype,"resources",void 0),Hi([t.Collection([],vi)],n.prototype,"headerRows",void 0),Hi([t.Property()],n.prototype,"cssClass",void 0),Hi([t.Property()],n.prototype,"eventDragArea",void 0),Hi([t.Event()],n.prototype,"created",void 0),Hi([t.Event()],n.prototype,"destroyed",void 0),Hi([t.Event()],n.prototype,"cellClick",void 0),Hi([t.Event()],n.prototype,"cellDoubleClick",void 0),Hi([t.Event()],n.prototype,"moreEventsClick",void 0),Hi([t.Event()],n.prototype,"hover",void 0),Hi([t.Event()],n.prototype,"select",void 0),Hi([t.Event()],n.prototype,"actionBegin",void 0),Hi([t.Event()],n.prototype,"actionComplete",void 0),Hi([t.Event()],n.prototype,"actionFailure",void 0),Hi([t.Event()],n.prototype,"navigating",void 0),Hi([t.Event()],n.prototype,"renderCell",void 0),Hi([t.Event()],n.prototype,"eventClick",void 0),Hi([t.Event()],n.prototype,"eventRendered",void 0),Hi([t.Event()],n.prototype,"dataBinding",void 0),Hi([t.Event()],n.prototype,"popupOpen",void 0),Hi([t.Event()],n.prototype,"popupClose",void 0),Hi([t.Event()],n.prototype,"dragStart",void 0),Hi([t.Event()],n.prototype,"drag",void 0),Hi([t.Event()],n.prototype,"dragStop",void 0),Hi([t.Event()],n.prototype,"resizeStart",void 0),Hi([t.Event()],n.prototype,"resizing",void 0),Hi([t.Event()],n.prototype,"resizeStop",void 0),Hi([t.Event()],n.prototype,"dataBound",void 0),n=Hi([t.NotifyPropertyChanges],n)}(t.Component),Ii=function(){function e(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 e.prototype.getChangedData=function(){var e=t.extend({},this.actionObj.event,null,!0);if(e[this.parent.eventFields.startTime]=this.actionObj.start,e[this.parent.eventFields.endTime]=this.actionObj.end,t.isNullOrUndefined(this.actionObj.isAllDay)||(e[this.parent.eventFields.isAllDay]=this.actionObj.isAllDay),this.parent.activeViewOptions.group.resources.length>0){var i=this.getOriginalElement(this.actionObj.element).map(function(e){return parseInt(e.getAttribute("data-group-index"),10)});if(-1===i.indexOf(this.actionObj.groupIndex)){var n=parseInt(this.actionObj.clone.getAttribute("data-group-index"),10);(i=i.filter(function(e){return e!==n})).push(this.actionObj.groupIndex),this.parent.resourceBase.getResourceData(e,this.actionObj.groupIndex,i)}}return e},e.prototype.saveChangedData=function(e){this.parent.activeEventData.event=this.actionObj.event,this.parent.currentAction="Save",t.isBlazor()&&(e.data[this.parent.eventFields.startTime]=this.parent.getDateTime(e.data[this.parent.eventFields.startTime]),e.data[this.parent.eventFields.endTime]=this.parent.getDateTime(e.data[this.parent.eventFields.endTime]));var i=e.data,n=!(this.parent.activeViewOptions.group.resources.length>0)||parseInt(this.actionObj.element.getAttribute("data-group-index"),10)===this.actionObj.groupIndex;if(+i[this.parent.eventFields.startTime]!=+this.actionObj.event[this.parent.eventFields.startTime]||+i[this.parent.eventFields.endTime]!=+this.actionObj.event[this.parent.eventFields.endTime]||!n){var r;if(i[this.parent.eventFields.recurrenceRule]){var a=i[this.parent.eventFields.recurrenceID]||i[this.parent.eventFields.id];if(i[this.parent.eventFields.id]===i[this.parent.eventFields.recurrenceID]&&(i[this.parent.eventFields.id]=this.parent.eventBase.getEventMaxID(),r="EditOccurrence"),this.parent.enableRecurrenceValidation&&this.parent.eventWindow.editOccurrenceValidation(a,i,this.actionObj.event))return void this.parent.quickPopup.openRecurrenceValidationAlert("sameDayAlert")}(i[this.parent.eventFields.startTimezone]||i[this.parent.eventFields.endTimezone])&&this.parent.eventBase.timezoneConvert(i),this.parent.crudModule.saveEvent(i,r)}},e.prototype.calculateIntervalTime=function(e){var t=new Date(+e);return t.setMinutes(Math.floor(t.getMinutes()/this.actionObj.interval)*this.actionObj.interval),t},e.prototype.getContentAreaDimension=function(){var e=this.parent.element.querySelector(".e-content-wrap"),t=[].slice.call(e.querySelector("tr").children);!this.parent.activeView.isTimelineView()&&this.parent.activeViewOptions.group.resources.length>0&&!this.parent.isAdaptive&&(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}},e.prototype.getPageCoordinates=function(e){var t=e.event;return t&&t.changedTouches?t.changedTouches[0]:e.changedTouches?e.changedTouches[0]:t||e},e.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},e.prototype.updateTimePosition=function(e){for(var i=0,n=this.actionObj.cloneElement;i<n.length;i++){var r=n[i].querySelector(".e-time");r&&(r.innerHTML=this.parent.getTimeString(this.actionObj.start)+" - "+this.parent.getTimeString(this.actionObj.end))}if(this.parent.activeViewOptions.timeScale.enable&&this.parent.isAdaptive&&"Month"!==this.parent.currentView&&"TimelineMonth"!==this.parent.currentView){var a=this.parent.element.querySelector(".e-clone-time-indicator");if(!a){a=t.createElement("div",{className:"e-clone-time-indicator"});var s=this.parent.activeView.isTimelineView()?"e-date-header-wrap":"e-time-cells-wrap";this.parent.element.querySelector("."+s).appendChild(a)}a.innerHTML=this.parent.getTimeString(e);var o=0;if(this.parent.activeView.isTimelineView())if(this.parent.enableRtl){var l=parseInt(this.actionObj.clone.style.right,10);o="drag"===this.actionObj.action||this.resizeEdges.left?l+this.actionObj.clone.offsetWidth:l,a.style.right=t.formatUnit(o)}else{var c=parseInt(this.actionObj.clone.style.left,10);o="drag"===this.actionObj.action||this.resizeEdges.left?c:c+this.actionObj.clone.offsetWidth,a.style.left=t.formatUnit(o)}else o="drag"===this.actionObj.action||this.resizeEdges.top?this.actionObj.clone.offsetTop:this.actionObj.clone.offsetTop+this.actionObj.clone.offsetHeight,a.style.top=t.formatUnit(o)}},e.prototype.getResourceElements=function(e){var t=this;return e.filter(function(e){return parseInt(e.getAttribute("data-group-index"),10)===t.actionObj.groupIndex})},e.prototype.getOriginalElement=function(e){var i,n=e.getAttribute("data-guid");if(e.offsetParent&&e.offsetParent.classList.contains("e-more-event-popup")||this.parent.activeView.isTimelineView())i=[].slice.call(this.parent.element.querySelectorAll('[data-guid="'+n+'"]'));else{var r=t.closest(e,"tr");i=[].slice.call(r.querySelectorAll('[data-guid="'+n+'"]'))}return i},e.prototype.createCloneElement=function(e){var i=t.createElement("div",{innerHTML:e.outerHTML}).children[0],n=["e-schedule-event-clone"];return n.push("drag"===this.actionObj.action?"e-drag-clone":"e-resize-clone"),"Month"!==this.parent.currentView&&"TimelineMonth"!==this.parent.currentView||n.push("e-month-event"),t.addClass([i],n),t.addClass([e],"e-event-action"),t.isNullOrUndefined(e.parentElement)||e.parentElement.appendChild(i),i.style.width=t.formatUnit(i.offsetWidth-2),this.parent.eventDragArea&&"drag"===this.actionObj.action&&document.querySelector(this.parent.eventDragArea).appendChild(i),t.setStyleAttribute(i,{border:"0px"}),i},e.prototype.removeCloneElementClasses=function(){var e=this.actionObj.originalElement;"Month"===this.parent.currentView&&(e=[].slice.call(this.parent.element.querySelectorAll(".e-event-action"))),t.removeClass(e,"e-event-action")},e.prototype.removeCloneElement=function(){this.actionObj.originalElement=[];for(var e=0,i=this.actionObj.cloneElement;e<i.length;e++){var n=i[e];t.isNullOrUndefined(n.parentNode)||t.remove(n)}this.actionObj.cloneElement=[];var r=this.parent.element.querySelector(".e-clone-time-indicator");r&&t.remove(r)},e.prototype.getCursorElement=function(e){var t=this.getPageCoordinates(e);return document.elementFromPoint(t.clientX,t.clientY)},e.prototype.autoScroll=function(){var e=this.parent.element.querySelector(".e-content-wrap"),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;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))},e.prototype.autoScrollValidation=function(e){if(!this.actionObj.scroll.enable)return!1;var t=this.parent.boundaryValidation(this.actionObj.pageY,this.actionObj.pageX);return this.scrollEdges=t,t.bottom||t.top||t.left||t.right},e.prototype.actionClass=function(e){"addClass"===e?t.addClass([this.parent.element],"e-event-action"):t.removeClass([this.parent.element],"e-event-action")},e.prototype.updateScrollPosition=function(e){var i=this;this.actionObj.scroll.enable&&t.isNullOrUndefined(this.actionObj.scrollInterval)&&(this.actionObj.scrollInterval=window.setInterval(function(){if(i.autoScrollValidation(e)&&!i.actionObj.clone.classList.contains("e-all-day-appointment")){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(e):i.parent.resizeModule.updateResizingDirection(e)}},this.actionObj.scroll.timeDelay))},e.prototype.updateOriginalElement=function(e){var i='[data-id="'+e.getAttribute("data-id")+'"]';this.parent.activeViewOptions.group.resources.length>0&&(i=i.concat('[data-group-index = "'+e.getAttribute("data-group-index")+'"]'));var n=[].slice.call(this.parent.element.querySelectorAll(i));t.addClass(n,"e-event-action");var r=[].slice.call(this.parent.element.querySelectorAll(".e-schedule-event-clone"));t.removeClass(r,"e-event-action")},e.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},e.prototype.dynamicEventsRendering=function(e){var i,n=this,r=this.parent.activeView.renderDates,a=[].slice.call(this.parent.element.querySelectorAll(".e-work-cells")),s=this.parent.activeViewOptions.workDays;if(this.parent.activeViewOptions.group.resources.length>0){var o=this.parent.resourceBase.lastResourceLevel.filter(function(e){return e.groupIndex===n.actionObj.groupIndex});r=o[0].renderDates;var l='.e-work-cells[data-group-index="'+this.actionObj.groupIndex+'"]';a=[].slice.call(this.parent.element.querySelectorAll(l)),s=o[0].workDays,i=o[0].groupOrder}this.monthEvent.dateRender=r,this.monthEvent.getSlotDates(s);for(var c=0,p=[].slice.call(this.parent.element.querySelectorAll(".e-schedule-event-clone"));c<p.length;c++){var d=p[c];t.remove(d)}for(var h=0,u=this.monthEvent.splitEvent(e,r);h<u.length;h++){var v=u[h],m=this.parent.getIndexOfDate(r,T(v[this.monthEvent.fields.startTime])),g=v.data.count*this.actionObj.cellWidth-7,f=this.monthEvent.createAppointmentElement(v,this.actionObj.groupIndex,!0);f.setAttribute("drag","true"),t.addClass([f],"e-schedule-event-clone"),this.monthEvent.applyResourceColor(f,v,"backgroundColor",i),t.setStyleAttribute(f,{width:g+"px",border:"0px","pointer-events":"none"});var y=a[m];this.monthEvent.renderElement(y,f,!0),this.actionObj.cloneElement.push(f)}},e.prototype.destroy=function(){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})},e}(),qi=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])})(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)}}(),Li=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return qi(i,e),i.prototype.wireResizeEvent=function(e){for(var i=0,n=[].slice.call(e.querySelectorAll(".e-event-resize"));i<n.length;i++){var r=n[i];t.EventHandler.add(r,t.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[e]);this.actionObj.cloneElement[e]=i,this.actionObj.element===this.actionObj.originalElement[e]&&(this.actionObj.clone=i)}else this.actionObj.clone=this.createCloneElement(this.actionObj.element),this.actionObj.cloneElement=[this.actionObj.clone],this.actionObj.originalElement=[this.actionObj.element]},i.prototype.resizeStart=function(e){var i=this;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=t.closest(e.target,".e-event-resize");this.actionObj.element=t.closest(n,".e-appointment"),this.actionObj.event=this.parent.eventBase.getEventByGuid(this.actionObj.element.getAttribute("data-guid"));var r=t.extend({},this.actionObj.event,null,!0),a={cancel:!1,data:r,element:this.actionObj.element,event:e,interval:this.actionObj.interval,scroll:{enable:!0,scrollBy:30,timeDelay:100}};this.parent.trigger("resizeStart",a,function(a){if(!a.cancel){t.isBlazor()&&(a.element&&(a.element=t.getElement(a.element)),a.data[i.parent.eventFields.startTime]=i.parent.getDateTime(a.data[i.parent.eventFields.startTime]),a.data[i.parent.eventFields.endTime]=i.parent.getDateTime(a.data[i.parent.eventFields.endTime])),i.actionClass("addClass"),i.parent.uiStateValues.action=!0,i.resizeEdges={left:n.classList.contains("e-left-handler"),right:n.classList.contains("e-right-handler"),top:n.classList.contains("e-top-handler"),bottom:n.classList.contains("e-bottom-handler")},i.actionObj.groupIndex=i.parent.uiStateValues.isGroupAdaptive?i.parent.uiStateValues.groupIndex:0;var s=i.parent.element.querySelector(".e-work-cells");i.actionObj.cellWidth=s.offsetWidth,i.actionObj.cellHeight=s.offsetHeight;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"),c=0,p=0,d=[].slice.call(l.children);p<d.length;p++){var h=d[p];c+=parseInt(h.getAttribute("colspan"),10)}i.actionObj.cellWidth=l.offsetWidth/c,i.actionObj.cellHeight=l.offsetHeight}var u=i.getPageCoordinates(e);i.actionObj.X=u.pageX,i.actionObj.Y=u.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 At(i.parent));var v=i.parent.element.querySelector(".e-content-wrap");i.scrollArgs={element:v,width:v.scrollWidth,height:v.scrollHeight},t.EventHandler.add(document,t.Browser.touchMoveEvent,i.resizing,i),t.EventHandler.add(document,t.Browser.touchEndEvent,i.resizeStop,i)}})},i.prototype.resizing=function(e){if(this.parent.quickPopup.quickPopupHide(),0===this.parent.element.querySelectorAll(".e-resize-clone").length&&this.resizeHelper(),t.isNullOrUndefined(e.target)||!e.target.classList.contains("e-disable-dates")){var i=this.getPageCoordinates(e);this.actionObj.pageX=i.pageX,this.actionObj.pageY=i.pageY,this.updateScrollPosition(e),this.updateResizingDirection(e);var n={cancel:!1,data:t.extend({},this.actionObj.event,null,!0),element:this.actionObj.element,event:e,startTime:this.actionObj.start,endTime:this.actionObj.end};this.parent.group.resources.length>0&&(n.groupIndex=this.actionObj.groupIndex),this.parent.trigger("resizing",n)}},i.prototype.updateResizingDirection=function(e){if("Month"===this.parent.currentView)return void this.monthResizing();var i=this.resizeValidation(e);if(this.resizeEdges.left){if(i)for(var n=this.getLeftRightStyles(e,!0),r=0,a=this.actionObj.cloneElement;r<a.length;r++){m=a[r];t.setStyleAttribute(m,n),t.addClass([m],"e-left-handler")}this.horizontalResizing(!this.parent.enableRtl)}if(this.resizeEdges.right){if(i)for(var s=this.getLeftRightStyles(e,!1),o=0,l=this.actionObj.cloneElement;o<l.length;o++){m=l[o];t.setStyleAttribute(m,s),t.addClass([m],"e-right-handler")}this.horizontalResizing(this.parent.enableRtl)}if(this.resizeEdges.top){if(i)for(var c=this.getTopBottomStyles(e,!0),p=0,d=this.actionObj.cloneElement;p<d.length;p++){m=d[p];t.setStyleAttribute(m,c),t.addClass([m],"e-top-handler")}this.verticalResizing(!0)}if(this.resizeEdges.bottom){if(i)for(var h=this.getTopBottomStyles(e,!1),u=0,v=this.actionObj.cloneElement;u<v.length;u++){var m=v[u];t.setStyleAttribute(m,h),t.addClass([m],"e-bottom-handler")}this.verticalResizing(!1)}},i.prototype.monthResizing=function(){this.removeCloneElement();var e=document.elementFromPoint(this.actionObj.pageX,this.actionObj.pageY);if(!t.isNullOrUndefined(e)){var i=this.parent.getDateFromElement(e),n=!(this.parent.activeViewOptions.group.resources.length>0)||parseInt(e.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?r=i:(!this.parent.enableRtl&&this.resizeEdges.right||this.parent.enableRtl&&this.resizeEdges.left)&&(a=b(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);this.dynamicEventsRendering(s),this.updateOriginalElement(this.actionObj.clone)}}},i.prototype.resizeStop=function(e){var i=this;t.EventHandler.remove(document,t.Browser.touchMoveEvent,this.resizing),t.EventHandler.remove(document,t.Browser.touchEndEvent,this.resizeStop),clearInterval(this.actionObj.scrollInterval),this.actionObj.scrollInterval=null,this.removeCloneElementClasses(),this.removeCloneElement(),this.actionClass("removeClass"),this.parent.uiStateValues.action=!1;var n={cancel:!1,data:this.getChangedData(),element:this.actionObj.element,event:e};this.parent.trigger("resizeStop",n,function(e){e.cancel||(i.parent.activeViewOptions.group.resources.length>0&&!i.parent.rowAutoHeight&&!i.parent.activeViewOptions.group.allowGroupEdit&&!i.parent.virtualScrollModule&&i.parent.activeViewOptions.group.byGroupID&&(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(e){var i=this.actionObj.clone.offsetTop;e||(i+=this.actionObj.clone.offsetHeight);var n=i/this.actionObj.cellHeight*this.actionObj.slotInterval,r=this.actionObj.clone.offsetParent;if(!t.isNullOrUndefined(r)){var a=T(this.parent.getDateFromElement(r));a.setHours(this.parent.activeView.getStartHour().getHours()),a.setMinutes(n+this.parent.activeView.getStartHour().getMinutes()),e?this.actionObj.start=this.calculateIntervalTime(a):this.actionObj.end=this.calculateIntervalTime(a),this.updateTimePosition(a)}},i.prototype.horizontalResizing=function(e){var i,n=new Date(this.actionObj.event[this.parent.eventFields.startTime].getTime()),r=new Date(this.actionObj.event[this.parent.eventFields.endTime].getTime());if(this.parent.activeView.isTimelineView()){var a=this.parent.getContentTable().querySelector("tr"),s=this.parent.currentView;if(this.parent.activeViewOptions.headerRows.length>0){var o=this.parent.activeViewOptions.headerRows.map(function(e){return e.option});s=o.slice(-1)[0],"TimelineMonth"===this.parent.currentView&&"Hour"===s&&(s=o.slice(-2)[0]||"Month")}i=e?n:r;var l=0,c=[].slice.call(a.children),p=!1;if(-1!==["Year","Month","Week","Date"].indexOf(s)){for(var d=0,h=0,u=c;h<u.length;h++){var v=u[h];d+=parseInt(v.getAttribute("colspan"),10)}T=this.parent.enableRtl?parseInt(this.actionObj.clone.style.right,10):parseInt(this.actionObj.clone.style.left,10);e||(T+=this.actionObj.clone.offsetWidth-this.actionObj.cellWidth),l=Math.floor(T/Math.floor(a.offsetWidth/d)),p=(l=e?l:"TimelineMonth"===this.parent.currentView?l+1:l)===c.length,l=l<0?0:l>=d?d-1:l}else{var m=this.actionObj.cellWidth;if(l=e?Math.floor(this.actionObj.clone.offsetLeft/this.actionObj.cellWidth):Math.ceil((this.actionObj.clone.offsetLeft+(this.actionObj.clone.offsetWidth-m))/this.actionObj.cellWidth),this.parent.enableRtl){var g=0;("TimelineMonth"===s||!this.parent.activeViewOptions.timeScale.enable&&"TimelineMonth"!==this.parent.currentView)&&(g=this.actionObj.cellWidth);var f=Math.floor(parseInt(this.actionObj.clone.style.right,10)/this.actionObj.cellWidth)*this.actionObj.cellWidth+(e?0:this.actionObj.clone.offsetWidth-g);l=Math.floor(f/this.actionObj.cellWidth)}p=l===c.length,l=this.getIndex(l)}var y=void 0;if(y=-1!==["Year","Month","Week","Date"].indexOf(s)?new Date(this.parent.activeView.renderDates[l].getTime()):this.parent.getDateFromElement(a.children[l]),-1===["TimelineMonth","Year","Month","Week","Date"].indexOf(s)&&this.parent.activeViewOptions.timeScale.enable){var T=this.parent.enableRtl?parseFloat(this.actionObj.clone.style.right):parseFloat(this.actionObj.clone.style.left);e||(T+=this.actionObj.clone.offsetWidth);var w=Math.ceil(this.actionObj.slotInterval/this.actionObj.cellWidth*(T-Math.floor(T/this.actionObj.cellWidth)*this.actionObj.cellWidth));w=p||!e&&0===w?this.actionObj.slotInterval:w,(i=new Date(y.getTime())).setMinutes(i.getMinutes()+w),this.updateTimePosition(i)}else i=new Date(y.setHours(i.getHours(),i.getMinutes(),i.getSeconds()))}else{var D=t.closest(this.actionObj.clone,"td").cellIndex,C=Math.ceil((e?this.actionObj.element.offsetWidth:0)/this.actionObj.cellWidth)*this.actionObj.cellWidth,d=Math.ceil((this.actionObj.clone.offsetWidth-C)/this.actionObj.cellWidth),a=t.closest(this.actionObj.clone,"tr"),E=e?D-d:D+d-1;E=this.getIndex(E),i=this.parent.getDateFromElement(a.children[E]),e?i.setHours(n.getHours(),n.getMinutes(),n.getSeconds()):i.setHours(r.getHours(),r.getMinutes(),r.getSeconds())}if(e)this.actionObj.event[this.parent.eventFields.endTime].getTime()-i.getTime()<=0&&(i=new Date(this.actionObj.event[this.parent.eventFields.startTime].getTime())),this.actionObj.start=this.parent.activeViewOptions.timeScale.enable?this.calculateIntervalTime(i):i;else{var O=["TimelineDay","TimelineWeek","TimelineWorkWeek"].indexOf(this.parent.currentView)>-1&&this.parent.activeViewOptions.timeScale.enable||0!==i.getHours()||0!==i.getMinutes()?i:b(i,1);this.actionObj.end=this.parent.activeViewOptions.timeScale.enable&&"Month"!==this.parent.currentView?this.calculateIntervalTime(O):O}},i.prototype.getTopBottomStyles=function(e,i){var n=this.parent.element.querySelector(".e-content-wrap"),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.offsetHeight:this.actionObj.clone.offsetTop+this.actionObj.clone.offsetHeight>this.scrollArgs.height?this.actionObj.clone.offsetHeight:a,s=s<0?0:s,a=(s=Math.floor(s/r)*r)+a>=n.scrollHeight?n.scrollHeight-s:Math.ceil(a/r)*r,{height:t.formatUnit(a<this.actionObj.cellHeight?this.actionObj.cellHeight:a),top:t.formatUnit(a<this.actionObj.cellHeight&&i?this.actionObj.clone.offsetTop:s),left:"0px",right:"0px",width:"100%"}},i.prototype.getLeftRightStyles=function(e,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?this.actionObj.element.offsetWidth/this.actionObj.cellWidth*this.actionObj.cellWidth:"Month"===this.parent.currentView?this.actionObj.element.offsetWidth:Math.ceil(this.actionObj.element.offsetWidth/this.actionObj.cellWidth)*this.actionObj.cellWidth,c=l+Math.ceil(o/this.actionObj.cellWidth)*this.actionObj.cellWidth,p=this.parent.enableRtl?parseInt(this.actionObj.element.style.right,10):this.actionObj.clone.offsetLeft;a&&(c=l+Math.ceil(o/s)*s,c=Math.ceil((p+c)/s)*s-p,this.actionObj.event[this.parent.eventFields.isAllDay]=!1);var d=!i&&c+this.actionObj.clone.offsetLeft>this.scrollArgs.width?this.actionObj.clone.offsetWidth:c<this.actionObj.cellWidth?this.actionObj.cellWidth:c;if(this.parent.enableRtl){var h=r?parseInt(this.actionObj.element.style.right,10):-(c-this.actionObj.cellWidth);h=r?h:i?0:h>0?0:h,r&&!i&&(h=(h=Math.ceil((this.actionObj.element.offsetLeft+(this.actionObj.element.offsetWidth+(this.actionObj.pageX-this.actionObj.X)))/s)*s)<0?Math.abs(h):-h),h=h>=this.scrollArgs.width?this.scrollArgs.width-this.actionObj.cellWidth:h,n.right=t.formatUnit(h),d=d+h>this.scrollArgs.width?this.actionObj.clone.offsetWidth:d}else{var u=i?this.actionObj.element.offsetLeft-(this.actionObj.X-this.actionObj.pageX):this.parent.enableRtl?this.actionObj.element.offsetLeft:0;r&&(u=i?u:parseInt(this.actionObj.clone.style.left,10),u=this.parent.enableRtl?i?u:this.actionObj.pageX<this.actionObj.X-this.actionObj.clone.offsetWidth?parseInt(this.actionObj.clone.style.right,10):u:i&&this.actionObj.pageX>this.actionObj.X+this.actionObj.clone.offsetWidth&&this.actionObj.clone.offsetWidth===this.actionObj.cellWidth?parseInt(this.actionObj.clone.style.left,10):u);var v=u;(u=r?a?i?Math.floor(u/s)*s:u:Math.floor(u/this.actionObj.cellWidth)*this.actionObj.cellWidth:Math.ceil(Math.abs(u)/this.actionObj.cellWidth)*this.actionObj.cellWidth)<0&&(u=0,d=this.actionObj.clone.offsetWidth);var m=Math.ceil(this.actionObj.clone.offsetWidth/this.actionObj.cellWidth)*this.actionObj.cellWidth;i&&(n.left=t.formatUnit(r?u:i?v<0?-u:Math.ceil((l-m)/this.actionObj.cellWidth)*this.actionObj.cellWidth:u))}return n.width=t.formatUnit(d),n},i.prototype.resizeValidation=function(e){var t=this.getPageCoordinates(e),i=this.getContentAreaDimension(),n=!1;return this.resizeEdges.left&&(n=t.pageX-this.actionObj.cellWidth>=i.left),this.resizeEdges.right&&(n=t.pageX+this.actionObj.cellWidth<=i.right),this.resizeEdges.top&&(n=this.actionObj.clone.offsetTop>=i.top),this.resizeEdges.bottom&&(n=this.actionObj.clone.offsetTop+this.actionObj.clone.offsetHeight<=this.scrollArgs.height),n},i.prototype.getModuleName=function(){return"resize"},i}(Ii),Bi=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])})(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)}}(),Ni=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.widthUptoCursorPoint=0,t.heightUptoCursorPoint=0,t.cursorPointIndex=0,t.isHeaderRows=!1,t.isTimelineDayProcess=!1,t.widthPerMinute=0,t.heightPerMinute=0,t.minDiff=0,t.isStepDragging=!1,t.isMorePopupOpened=!1,t.isAllDayDrag=!1,t}return Bi(i,e),i.prototype.wireDragEvent=function(e){var i=new t.Draggable(e,{abort:".e-event-resize",clone:!0,isDragScroll:!0,enableTapHold:this.parent.isAdaptive,enableTailMode:!!this.parent.eventDragArea,cursorAt:this.parent.eventDragArea?{left:-20,top:-20}:{left:0,top:0},dragArea:this.parent.eventDragArea?document.querySelector(this.parent.eventDragArea):this.parent.element.querySelector("."+Ye),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.enableTapHold&&t.Browser.isDevice&&t.Browser.isTouch||t.EventHandler.remove(e,"touchstart",i.initialize)},i.prototype.dragHelper=function(e){return this.setDragActionDefaultValues(),this.actionObj.element=e.element,this.actionObj.action="drag",this.actionObj.clone=this.createCloneElement(this.actionObj.element),this.parent.eventDragArea||"Month"===this.parent.currentView||!this.parent.timeScale.enable||this.parent.activeView.isTimelineView()||this.actionObj.element.classList.contains("e-all-day-appointment")||t.setStyleAttribute(this.actionObj.clone,{cursor:"move",left:"0%",right:"0%",width:"100%"}),this.actionObj.clone.style.top=t.formatUnit(this.actionObj.element.offsetTop),this.actionObj.cloneElement=[this.actionObj.clone],this.actionObj.originalElement=[this.actionObj.element],this.actionObj.clone},i.prototype.dragPosition=function(e){if(this.parent.eventDragArea)return{left:e.left,top:e.top};var i=this.actionObj.cellHeight/this.actionObj.slotInterval*this.actionObj.interval,n=t.formatUnit(0);"Month"===this.parent.currentView&&(n=e.left),this.parent.activeView.isTimelineView()&&(n=t.formatUnit(this.actionObj.clone.offsetLeft));var r;if(this.parent.activeView.isTimelineView()||!this.parent.timeScale.enable||!t.isNullOrUndefined(this.actionObj.clone.offsetParent)&&this.actionObj.clone.offsetParent.classList.contains("e-more-event-popup"))r=t.formatUnit(this.actionObj.clone.offsetTop);else if("Month"===this.parent.currentView)r=t.formatUnit(0);else if(this.actionObj.clone.classList.contains("e-all-day-appointment"))r=t.formatUnit(this.parent.element.querySelector(".e-all-day-row").offsetTop),t.setStyleAttribute(this.actionObj.clone,{width:t.formatUnit(Math.ceil(this.actionObj.clone.offsetWidth/this.actionObj.cellWidth)*this.actionObj.cellWidth),right:this.parent.enableRtl&&t.formatUnit(0)});else{this.actionObj.element.classList.contains("e-all-day-appointment")&&!this.actionObj.clone.classList.contains("e-all-day-appointment")&&t.setStyleAttribute(this.actionObj.clone,{height:t.formatUnit(this.actionObj.cellHeight),width:t.formatUnit(this.actionObj.cellWidth-1),pointerEvents:"none"});var a=parseInt(e.top,10);a=a<0?0:a,r=t.formatUnit(Math.ceil(a/i)*i);var s=this.parent.element.querySelector(".e-content-wrap").scrollHeight,o=parseInt(r,10)+this.actionObj.clone.offsetHeight;o>s&&(r=parseInt(r,10)-(o-s)+"px")}return{left:n,top:r}},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-work-cells");this.actionObj.cellWidth=e.offsetWidth,this.actionObj.cellHeight=e.offsetHeight},i.prototype.dragStart=function(e){var i=this,n=this.actionObj.element.getAttribute("data-guid");this.actionObj.event=this.parent.eventBase.getEventByGuid(n);var r=t.extend({},this.actionObj.event,null,!0),a={cancel:!1,data:r,event:e,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("dragStart",a,function(n){if(n.cancel||!t.isNullOrUndefined(i.actionObj.element)&&t.isNullOrUndefined(i.actionObj.element.parentElement)){var a=i.actionObj.element.ej2_instances[0];return t.isNullOrUndefined(a)||a.intDestroy(e.event),i.actionObj.action="",i.removeCloneElementClasses(),void i.removeCloneElement()}t.isBlazor()&&(e.bindEvents(e.dragElement),n.element&&(n.element=t.getElement(n.element)),n.data[i.parent.eventFields.startTime]=i.parent.getDateTime(n.data[i.parent.eventFields.startTime]),n.data[i.parent.eventFields.endTime]=i.parent.getDateTime(n.data[i.parent.eventFields.endTime])),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.actionObj.excludeSelectors=n.excludeSelectors;var s=i.parent.element.querySelector(".e-content-wrap");if(i.scrollArgs={element:s,width:s.scrollWidth,height:s.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.parent.activeView.isTimelineView()||!i.parent.timeScale.enable){!t.isNullOrUndefined(i.actionObj.clone.offsetParent)&&i.actionObj.clone.offsetParent.classList.contains("e-more-event-popup")&&(i.isMorePopupOpened=!0);var o=i.parent.activeViewOptions.headerRows;i.isHeaderRows=o.length>0&&"Hour"!==o[o.length-1].option&&"Date"!==o[o.length-1].option,i.isTimelineDayProcess=!i.parent.activeViewOptions.timeScale.enable||i.isHeaderRows||"TimelineMonth"===i.parent.currentView||o.length>0&&"Date"===o[o.length-1].option,i.isStepDragging=!i.isTimelineDayProcess&&i.actionObj.slotInterval!==i.actionObj.interval,i.isTimelineDayProcess?i.timelineEventModule=new Mt(i.parent,"day"):i.timelineEventModule=new Mt(i.parent,"hour")}"Month"===i.parent.currentView&&(i.updateOriginalElement(i.actionObj.clone),i.monthEvent=new At(i.parent)),"Day"!==i.parent.currentView&&"Week"!==i.parent.currentView&&"WorkWeek"!==i.parent.currentView||(i.verticalEvent=new xt(i.parent))})},i.prototype.drag=function(e){if(this.parent.quickPopup.quickPopupHide(!0),t.isNullOrUndefined(e.target)||!e.target.classList.contains("e-disable-dates")){var i=t.extend({},this.actionObj.event,null,!0),n=this.getPageCoordinates(e);if(this.actionObj.Y=this.actionObj.pageY=n.pageY,this.actionObj.X=this.actionObj.pageX=n.pageX,this.actionObj.target=e.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,this.isAllDayDrag=this.parent.activeViewOptions.timeScale.enable?this.actionObj.clone.classList.contains("e-all-day-appointment"):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(t.isNullOrUndefined(r))this.daysVariation=0;else{var a=T(r),s=T(new Date(i[this.parent.eventFields.startTime].getTime()));this.daysVariation=(a.getTime()-s.getTime())/Ne}}else this.daysVariation=0;if(this.parent.eventDragArea){var o=n.target;this.actionObj.clone.style.top=t.formatUnit(o.offsetTop),this.actionObj.clone.style.left=t.formatUnit(o.offsetLeft),t.closest(o,"."+We)?"Week"!==this.parent.currentView&&"WorkWeek"!==this.parent.currentView&&"Day"!==this.parent.currentView&&(this.actionObj.clone.style.width=t.formatUnit(this.actionObj.element.offsetWidth)):(this.actionObj.clone.style.height="",this.actionObj.clone.style.width="")}this.updateScrollPosition(e),this.updateNavigatingPosition(e),this.updateDraggingDateTime(e);var l={data:i,event:e,element:this.actionObj.element,startTime:this.actionObj.start,endTime:this.actionObj.end};this.parent.group.resources.length>0&&(l.groupIndex=this.actionObj.groupIndex),this.parent.trigger("drag",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=O(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())/Fe)},i.prototype.dragStop=function(e){var t=this;if(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=!1,this.actionObj.action=null,!this.isAllowDrop(e)){var i={cancel:!1,data:this.getChangedData(),event:e,element:this.actionObj.element,target:e.target};this.parent.trigger("dragStop",i,function(e){e.cancel||(t.parent.activeViewOptions.group.resources.length>0&&!t.parent.activeViewOptions.group.allowGroupEdit&&!t.parent.rowAutoHeight&&!t.parent.virtualScrollModule&&t.parent.activeViewOptions.group.byGroupID&&(t.parent.crudModule.crudObj.isCrudAction=!0,t.parent.crudModule.crudObj.sourceEvent=[t.parent.resourceBase.lastResourceLevel[parseInt(i.element.getAttribute("data-group-index"),10)]],t.parent.crudModule.crudObj.targetEvent=[t.parent.resourceBase.lastResourceLevel[parseInt(i.target.getAttribute("data-group-index"),10)]]),t.saveChangedData(e))})}},i.prototype.updateNavigatingPosition=function(e){var i=this;if(this.actionObj.navigation.enable){var n=this.parent.getCurrentTime();t.isNullOrUndefined(this.actionObj.navigationInterval)&&(this.actionObj.navigationInterval=window.setInterval(function(){if(n){var t=i.parent.getCurrentTime().getSeconds(),r=n.getSeconds()+i.actionObj.navigation.timeDelay/1e3;(r=r>=60?r-60:r)===t&&(n=i.parent.getCurrentTime(),i.viewNavigation(e),i.updateDraggingDateTime(e))}},this.actionObj.navigation.timeDelay))}},i.prototype.updateDraggingDateTime=function(e){!t.isNullOrUndefined(this.actionObj.clone.offsetParent)&&this.actionObj.clone.offsetParent.classList.contains("e-more-event-popup")?this.morePopupEventDragging(e):this.parent.activeView.isTimelineView()?(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.actionObj.cellWidth,this.calculateTimelineTime(e)):"Month"===this.parent.currentView?this.calculateVerticalDate(e):this.calculateVerticalTime(e)},i.prototype.navigationWrapper=function(){if(this.parent.activeView.isTimelineView()){var e=void 0,i=(e=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("."+Xe)).querySelector(".e-appointment-wrapper");i||(i=t.createElement("div",{className:"e-appointment-wrapper"}),e.appendChild(i)),i.appendChild(this.actionObj.clone)}else if("Month"!==this.parent.currentView&&this.parent.timeScale.enable){var n=this.actionObj.clone.classList.contains("e-all-day-appointment")?".e-all-day-appointment-wrapper":".e-appointment-wrapper";if(this.parent.element.querySelectorAll(n).item(this.actionObj.index).appendChild(this.actionObj.clone),".e-all-day-appointment-wrapper"===n){var r=this.getAllDayEventHeight(),a=[].slice.call(this.parent.element.querySelectorAll(".e-all-day-cells: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=t.formatUnit(r)}this.actionObj.height=parseInt(this.actionObj.clone.style.height,0)}else{var l=[].slice.call(this.parent.element.querySelectorAll(".e-work-cells"));this.actionObj.index=this.parent.activeView.renderDates.length<this.actionObj.index?this.parent.activeView.renderDates.length-1:this.actionObj.index;var c=l[this.actionObj.index].querySelector(".e-appointment-wrapper");c||(c=t.createElement("div",{className:"e-appointment-wrapper"}),l[this.actionObj.index].appendChild(c)),c.appendChild(this.actionObj.clone)}},i.prototype.viewNavigation=function(e){var i,n=this.parent.element.querySelector(".e-content-wrap");n&&(!this.scrollEdges.top&&!this.scrollEdges.bottom||t.closest(this.actionObj.clone,".e-all-day-appointment-wrapper"))&&(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(e){if(!(t.isNullOrUndefined(e.target)||e.target&&t.isNullOrUndefined(t.closest(e.target,"td")))){var i=t.extend({},this.actionObj.event,null,!0),n=i[this.parent.eventFields.endTime].getTime()-i[this.parent.eventFields.startTime].getTime(),r=t.closest(e.target,"td"),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=t.formatUnit(r.offsetParent.offsetTop),this.actionObj.clone.style.left=t.formatUnit(r.offsetLeft),this.actionObj.clone.style.width=t.formatUnit(r.offsetWidth);var o,l=r;if(this.parent.activeView.isTimelineView()){var c=t.closest(r,"tr").rowIndex;l=this.parent.element.querySelectorAll(".e-appointment-container").item(c)}(o=l.querySelector(".e-appointment-wrapper"))||(o=t.createElement("div",{className:"e-appointment-wrapper"}),l.appendChild(o)),this.appendCloneElement(o)}},i.prototype.calculateVerticalTime=function(e){if(!(t.isNullOrUndefined(this.actionObj.target)||this.actionObj.target&&t.isNullOrUndefined(t.closest(this.actionObj.target,"tr"))||!t.closest(this.actionObj.target,"td").classList.contains("e-work-cells")&&!t.closest(this.actionObj.target,"td").classList.contains("e-all-day-cells"))){this.parent.activeViewOptions.timeScale.enable&&this.swapDragging(e);var i=this.parent.element.querySelector(".e-content-wrap"),n=t.extend({},this.actionObj.event,null,!0),r=n[this.parent.eventFields.startTime],a=n[this.parent.eventFields.endTime].getTime()-r.getTime(),s=Math.floor(parseInt(this.actionObj.clone.style.top,10)/this.actionObj.cellHeight)*this.actionObj.cellHeight;s=s<0?0:s,(this.scrollEdges.top||this.scrollEdges.bottom)&&(s=this.scrollEdges.top?i.scrollTop-this.heightUptoCursorPoint+this.actionObj.cellHeight:i.scrollTop+i.offsetHeight-this.actionObj.clone.offsetHeight+(this.actionObj.clone.offsetHeight-this.heightUptoCursorPoint),s=Math.round(s/this.actionObj.cellHeight)*this.actionObj.cellHeight,this.actionObj.clone.style.top=t.formatUnit(s));var o,l=s/this.actionObj.cellHeight,c=this.actionObj.cellHeight/this.actionObj.slotInterval,p=parseInt(this.actionObj.clone.style.top,10)-s;o=this.isAllDayDrag?this.parent.element.querySelector(".e-all-day-row"):[].slice.call(this.parent.getContentTable().querySelectorAll("tr"))[l];var d;(t.closest(this.actionObj.target,"td").classList.contains("e-work-cells")||t.closest(this.actionObj.target,"td").classList.contains("e-all-day-cells"))&&(d=t.closest(this.actionObj.target,"td").cellIndex);var h=t.isNullOrUndefined(d)?t.closest(this.actionObj.clone,"td").cellIndex:d;if(this.actionObj.index=h,!t.isNullOrUndefined(o)){var u=o.children[h];this.parent.activeViewOptions.group.resources.length>0&&(this.actionObj.groupIndex=parseInt(u.getAttribute("data-group-index"),10));var v,m;this.parent.activeViewOptions.timeScale.enable&&!this.isAllDayDrag?(this.appendCloneElement(this.getEventWrapper(h)),(v=this.parent.getDateFromElement(u)).setMinutes(v.getMinutes()+p/c),m=new Date(v.getTime()),this.actionObj.element.classList.contains("e-all-day-appointment")?m.setMinutes(m.getMinutes()+this.actionObj.slotInterval):m.setMilliseconds(a)):((v=this.parent.getDateFromElement(u)).setDate(v.getDate()-this.daysVariation),v.setHours(r.getHours(),r.getMinutes(),r.getSeconds()),(m=new Date(v.getTime())).setMilliseconds(a),!this.actionObj.element.classList.contains("e-all-day-appointment")&&this.actionObj.clone.classList.contains("e-all-day-appointment")&&(m=b(T(m),1)),this.updateAllDayEvents(v,m,this.parent.activeViewOptions.group.byDate?h:void 0)),this.actionObj.start=new Date(+v),this.actionObj.end=new Date(+m);var g=this.getUpdatedEvent(this.actionObj.start,this.actionObj.end,this.actionObj.event);this.updateEventHeight(g),this.updateTimePosition(this.actionObj.start)}}},i.prototype.updateEventHeight=function(e){this.verticalEvent.initializeValues();for(var i=0,n=0;n<this.actionObj.groupIndex;n++)i+=this.verticalEvent.dateRender[n].length;var r=this.parent.activeViewOptions.group.byDate?this.parent.getIndexOfDate(this.verticalEvent.dateRender[this.actionObj.groupIndex],T(this.parent.getDateFromElement(this.actionObj.target))):this.actionObj.index-i,a=this.verticalEvent.isSpannedEvent(e,r,this.actionObj.groupIndex),s=a[this.verticalEvent.fields.startTime],o=a[this.verticalEvent.fields.endTime],l=0,c=this.verticalEvent.getHeight(s,o);l=this.verticalEvent.getTopValue(s,r,this.actionObj.groupIndex),this.actionObj.clone.style.top=t.formatUnit(l),this.actionObj.clone.style.height=t.formatUnit(c)},i.prototype.updateAllDayEvents=function(e,i,n){var r=this;this.parent.eventBase.slots=[];var a=this.getUpdatedEvent(e,i,this.actionObj.event),s=this.parent.activeView.renderDates;this.parent.eventBase.slots.push(this.parent.activeView.renderDates.map(function(e){return+e})),this.parent.activeViewOptions.group.resources.length>0&&(this.parent.eventBase.slots=[],s=this.parent.resourceBase.lastResourceLevel.filter(function(e){return e.groupIndex===r.actionObj.groupIndex})[0].renderDates,this.parent.eventBase.slots.push(s.map(function(e){return+e})));var o=this.parent.eventBase.splitEvent(a,s),l='.e-all-day-cells[data-date="'+this.parent.getMsFromDate(o[0][this.parent.eventFields.startTime])+'"]';this.parent.activeViewOptions.group.resources.length>0&&(l=l.concat('[data-group-index = "'+this.actionObj.groupIndex+'"]'));var c=[].slice.call(this.parent.element.querySelectorAll(l));if(c.length>0||!t.isNullOrUndefined(n)){var p=t.isNullOrUndefined(n)?c[0].cellIndex:n;this.appendCloneElement(this.getEventWrapper(p)),this.actionObj.clone.style.width=t.formatUnit(o[0].data.count*this.actionObj.cellWidth)}},i.prototype.swapDragging=function(e){var i=t.closest(this.actionObj.target,"td").cellIndex;if(t.closest(this.actionObj.target,".e-date-header-wrap")&&!t.closest(this.actionObj.clone,".e-all-day-appointment-wrapper")){t.addClass([this.actionObj.clone],"e-all-day-appointment"),this.appendCloneElement(this.getEventWrapper(i)),this.actionObj.isAllDay=!0;var n=this.getAllDayEventHeight(),r=[].slice.call(this.parent.element.querySelectorAll(".e-all-day-cells: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";t.setStyleAttribute(this.actionObj.clone,{width:t.formatUnit(this.actionObj.cellWidth),height:t.formatUnit(n),top:t.formatUnit(this.parent.element.querySelector(".e-all-day-row").offsetTop)})}if(t.closest(this.actionObj.target,".e-work-cells")&&!t.closest(this.actionObj.clone,".e-day-wrapper")){t.removeClass([this.actionObj.clone],"e-all-day-appointment"),this.appendCloneElement(this.getEventWrapper(i)),this.actionObj.isAllDay=!1;var o=0===this.actionObj.element.offsetHeight?this.actionObj.height:this.actionObj.element.offsetHeight;t.setStyleAttribute(this.actionObj.clone,{left:t.formatUnit(0),height:t.formatUnit(o),width:t.formatUnit(this.actionObj.cellWidth)})}},i.prototype.calculateVerticalDate=function(e){if(!(t.isNullOrUndefined(e.target)||e.target&&t.isNullOrUndefined(t.closest(e.target,"tr"))||e.target&&"DIV"===e.target.tagName)){this.removeCloneElement();var i=t.extend({},this.actionObj.event,null,!0),n=i[this.parent.eventFields.endTime].getTime()-i[this.parent.eventFields.startTime].getTime(),r=t.closest(this.actionObj.target,"td");if(!t.isNullOrUndefined(r)){var a=r.parentElement;this.actionObj.index=a.rowIndex*a.children.length+r.cellIndex,r=[].slice.call(this.parent.element.querySelectorAll(".e-work-cells"))[this.actionObj.index];var s=this.parent.getDateFromElement(r);if(!t.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()),c=new Date(l.getTime()),p=i[this.parent.eventFields.startTime].getTime()-T(new Date(+i[this.parent.eventFields.startTime])).getTime();l=new Date(l.getTime()+p),c=new Date(l.getTime()+n),this.actionObj.start=new Date(l.getTime()),this.actionObj.end=new Date(c.getTime())}}var d=this.getUpdatedEvent(this.actionObj.start,this.actionObj.end,this.actionObj.event);this.dynamicEventsRendering(d)}},i.prototype.calculateTimelineTime=function(e){var i=t.extend({},this.actionObj.event,null,!0),n=i[this.parent.eventFields.endTime].getTime()-i[this.parent.eventFields.startTime].getTime(),r=this.parent.enableRtl?Math.abs(this.actionObj.clone.offsetLeft)-this.actionObj.clone.offsetWidth:parseInt(this.actionObj.clone.style.left,10);r=Math.floor(r/this.actionObj.cellWidth)*this.actionObj.cellWidth;var a;this.parent.enableRtl&&(a=Math.abs(parseInt(this.actionObj.clone.style.right,10)),this.actionObj.clone.style.right=t.formatUnit(a)),r=this.getOffsetValue(r,a);var s=this.getColumnIndex(r),o=Math.floor((this.actionObj.pageX-this.actionObj.clone.getBoundingClientRect().left)/this.actionObj.cellWidth);this.parent.enableRtl&&(o=Math.abs(Math.floor((this.actionObj.pageX-this.actionObj.clone.getBoundingClientRect().right)/this.actionObj.cellWidth))-1),this.cursorPointIndex<0&&this.cursorIndex(e,i,r,o);var l=this.parent.getContentTable().querySelector("tr"),c=this.getCursorCurrentIndex(s,o,l);c=c<0?0:c;var p=this.isHeaderRows?new Date(this.timelineEventModule.dateRender[c].getTime()):this.parent.getDateFromElement(l.children[c]);if(this.isStepDragging){var d=this.getWidthDiff(l,c);if(0!==d){var h=Math.round(d/this.widthPerMinute);p.setMinutes(p.getMinutes()+h*this.actionObj.interval),p.setMinutes(p.getMinutes()-this.minDiff)}else p=this.actionObj.start}else p.setMinutes(p.getMinutes()-this.cursorPointIndex*(this.isTimelineDayProcess?1440:this.actionObj.slotInterval));if(p=this.calculateIntervalTime(p),this.isTimelineDayProcess){var u=i[this.parent.eventFields.startTime];p.setHours(u.getHours(),u.getMinutes(),u.getSeconds())}var v=new Date(p.getTime());v.setMilliseconds(n);var m=this.getUpdatedEvent(p,v,this.actionObj.event),g=this.timelineEventModule.splitEvent(m,this.timelineEventModule.dateRender),f=g[0].data,y=this.timelineEventModule.getStartTime(g[0],f),w=this.timelineEventModule.getEndTime(g[0],f),D=this.timelineEventModule.getEventWidth(y,w,i[this.parent.eventFields.isAllDay],f.count),b=this.parent.getIndexOfDate(this.timelineEventModule.dateRender,T(new Date(y.getTime())));b=b<0?0:b;var C=this.timelineEventModule.getPosition(y,w,i[this.parent.eventFields.isAllDay],b);this.parent.enableRtl?this.actionObj.clone.style.right=t.formatUnit(C):this.actionObj.clone.style.left=t.formatUnit(C),this.isMorePopupOpened||(this.actionObj.clone.style.width=t.formatUnit(D)),this.parent.activeViewOptions.group.resources.length>0&&this.calculateResourceGroupingPosition(e),this.actionObj.start=new Date(p.getTime()),this.actionObj.end=new Date(v.getTime()),this.updateTimePosition(this.actionObj.start)},i.prototype.getOffsetValue=function(e,i){if(this.scrollEdges.left||this.scrollEdges.right){var n=this.parent.element.querySelector(".e-content-wrap");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=t.formatUnit(this.actionObj.clone.offsetWidth-this.widthUptoCursorPoint+this.actionObj.cellWidth),i=n.scrollLeft-n.scrollWidth),this.actionObj.clone.style.left=t.formatUnit(i)):(this.scrollEdges.left?(e=n.scrollLeft-this.widthUptoCursorPoint+this.actionObj.cellWidth,n.scrollLeft+n.offsetWidth>=n.offsetWidth?n.scrollLeft=n.scrollLeft-1:0===this.actionObj.clone.offsetLeft&&(e=n.scrollLeft)):e=n.scrollLeft+n.offsetWidth-this.actionObj.clone.offsetWidth+(this.actionObj.clone.offsetWidth-this.widthUptoCursorPoint),e=e<0?0:e,this.actionObj.clone.style.left=t.formatUnit(e))}return e},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[t].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.floor(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(e,i,n,r){var a=t.closest(e.target,".e-work-cells");if(t.isNullOrUndefined(a)||this.isMorePopupOpened)this.cursorPointIndex=0;else{var s=this.parent.getDateFromElement(a);if(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.cursorPointIndex=Math.abs(Math.ceil(l/Ne));else{var c=Math.floor(l/Fe/(this.actionObj.slotInterval/this.actionObj.cellWidth));this.cursorPointIndex=Math.floor(c/this.actionObj.cellWidth),this.cursorPointIndex=this.cursorPointIndex<0?0:this.cursorPointIndex}}},i.prototype.calculateResourceGroupingPosition=function(e){var i=this.parent.element.querySelector(".e-content-wrap"),n=[].slice.call(this.parent.element.querySelectorAll(".e-content-wrap .e-content-table tr:not(.e-hidden)")),r=h(i.querySelector("table"));r=t.isNullOrUndefined(r)?0:r;var a=this.parent.rowAutoHeight?~~(i.querySelector("table").offsetHeight/n.length):this.actionObj.cellHeight,s=Math.floor(Math.floor(this.actionObj.Y+(i.scrollTop-r-window.scrollY)-i.getBoundingClientRect().top)/a);s=s<0?0:s>n.length-1?n.length-1:s,this.actionObj.index=s;var o=this.parent.element.querySelectorAll(".e-appointment-container:not(.e-hidden)").item(s),l=o.querySelector(".e-appointment-wrapper");l||(l=t.createElement("div",{className:"e-appointment-wrapper"}),o.appendChild(l)),this.appendCloneElement(l);var c=t.closest(e.target,"td");this.actionObj.groupIndex=c&&!isNaN(parseInt(c.getAttribute("data-group-index"),10))?parseInt(c.getAttribute("data-group-index"),10):this.actionObj.groupIndex;var p=n[s].offsetTop;if(this.parent.rowAutoHeight){var d=this.getCursorElement(e);d&&(p=d.classList.contains("e-work-cells")?d.offsetTop:d.offsetParent.classList.contains("e-appointment")?d.offsetParent.offsetTop:p)}this.actionObj.clone.style.top=t.formatUnit(p)},i.prototype.appendCloneElement=function(e){this.parent.eventDragArea?document.querySelector(this.parent.eventDragArea).appendChild(this.actionObj.clone):e.appendChild(this.actionObj.clone)},i.prototype.getEventWrapper=function(e){var i,n=this.actionObj.clone.classList.contains("e-all-day-appointment");if(this.parent.activeViewOptions.timeScale.enable){var r=n?".e-all-day-appointment-wrapper":".e-appointment-wrapper";i=this.parent.element.querySelectorAll(r).item(e)}else{var a=this.parent.element.querySelectorAll(".e-work-cells").item(e);(i=a.querySelector(".e-appointment-wrapper"))||(i=t.createElement("div",{className:"e-appointment-wrapper"}),a.appendChild(i))}return i},i.prototype.getAllDayEventHeight=function(){var e=t.createElement("div",{className:"e-appointment"});this.parent.element.querySelector(".e-all-day-appointment-wrapper").appendChild(e);var i=e.offsetHeight;return t.remove(e),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}(Ii);!function(e){e.getDayName=function(e,t){return e.getDayNames("abbreviated")[t.getDay()]},e.getDate=function(e,t){return e.globalize.formatDate(t,{format:"d",calendar:e.getCalendarMode()})},e.getTime=function(e,i){return e.isAdaptive?"HH:mm"===e.timeFormat||"HH.mm"===e.timeFormat?e.globalize.formatDate(i,{format:"H",calendar:e.getCalendarMode()}):t.isBlazor()?e.globalize.formatDate(i,{format:"h",calendar:e.getCalendarMode()}):e.globalize.formatDate(i,{skeleton:"h",calendar:e.getCalendarMode()}):e.getTimeString(i)},e.getTimelineDate=function(e,i){var n=t.isBlazor()?"M":"MMMd";return I(e.globalize.formatDate(i,{skeleton:n,calendar:e.getCalendarMode()})+", "+e.getDayNames("wide")[i.getDay()],"multiple")}}(e.ViewHelper||(e.ViewHelper={}));var Fi=function(){function e(e){this.parent=e}return e.prototype.isTimelineView=function(){return-1!==this.parent.currentView.indexOf("Timeline")},e.prototype.getContentRows=function(){return[]},e.prototype.serverRenderLayout=function(){},e.prototype.createEventTable=function(e){var i=t.createElement("div",{className:"e-event-table"});return t.append(this.getEventRows(e),i),i},e.prototype.getEventRows=function(e){for(var i,n=[],r=0;r<e;r++)i=t.createElement("div",{className:Xe}),this.parent.resourceBase&&!this.parent.uiStateValues.isGroupAdaptive&&this.parent.resourceBase.renderedResources&&i.setAttribute("data-group-index",this.parent.resourceBase.renderedResources[r].groupIndex.toString()),n.push(i);return n},e.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(".e-event-table")))},e.prototype.createTableLayout=function(e){var i=e||"",n=t.createElement("table",{className:"e-schedule-table "+i}),r=t.createElement("tbody");return n.appendChild(r),n},e.prototype.createColGroup=function(e,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=t.createElement("colgroup"),a=0;a<n;a++)r.appendChild(t.createElement("col"));t.prepend([r],e)},e.prototype.getScrollXIndent=function(e){return e.offsetHeight-e.clientHeight>0?A():0},e.prototype.scrollTopPanel=function(e){this.getDatesHeaderElement().firstElementChild.scrollLeft=e.scrollLeft},e.prototype.scrollHeaderLabels=function(e){for(var t=this.element.querySelector(".e-date-header-wrap table"),i=t.offsetWidth/t.querySelectorAll("colgroup col").length,n=0,r=[".e-header-year-cell",".e-header-month-cell",".e-header-week-cell",".e-header-cells"];n<r.length;n++){var a=r[n],s=[].slice.call(this.element.querySelectorAll(a));if(s.length>0){for(var o=0,l=s;o<l.length;o++)l[o].children[0].style[this.parent.enableRtl?"right":"left"]="";!function(t,n){for(var r,a=0,s=0,o=n?e.scrollWidth-e.offsetWidth-e.scrollLeft:e.scrollLeft,l=0,c=t;l<c.length;l++){var p=c[l];if((s+=parseInt(p.getAttribute("colSpan"),10))>Math.floor(o/i)){r=p;break}a+=p.offsetWidth}r.children[0].style[n?"right":"left"]=o-a+"px"}(s,this.parent.enableRtl)}}},e.prototype.addAttributes=function(e,i){e.template&&t.append(e.template,i),e.colSpan&&i.setAttribute("colspan",e.colSpan.toString()),e.className&&t.addClass([i],e.className)},e.prototype.getHeaderBarHeight=function(){var e=2;if(this.parent.headerModule&&(e+=M(this.parent.headerModule.getHeaderElement())),this.parent.uiStateValues.isGroupAdaptive){var t=this.parent.element.querySelector(".e-schedule-resource-toolbar");t&&(e+=t.offsetHeight)}return e},e.prototype.renderPanel=function(e){"e-previous-panel"===e||t.isBlazor()?t.prepend([this.element],this.parent.element.querySelector("."+_e)):this.parent.element.querySelector("."+_e).appendChild(this.element)},e.prototype.setPanel=function(e){this.element=e},e.prototype.getPanel=function(){return this.element},e.prototype.getDatesHeaderElement=function(){return this.element.querySelector(".e-date-header-container")},e.prototype.getDateSlots=function(e,t){return[]},e.prototype.generateColumnLevels=function(){return[]},e.prototype.getColumnLevels=function(){return this.colLevels},e.prototype.highlightCurrentTime=function(){},e.prototype.startDate=function(){return this.renderDates[0]},e.prototype.endDate=function(){return b(this.renderDates[this.renderDates.length-1],1)},e.prototype.getStartHour=function(){var e=this.parent.getStartEndTime(this.parent.activeViewOptions.startHour);return t.isNullOrUndefined(e)&&(e=new Date(2e3,0,0,0)),e},e.prototype.getEndHour=function(){var e=this.parent.getStartEndTime(this.parent.activeViewOptions.endHour);return t.isNullOrUndefined(e)&&(e=new Date(2e3,0,0,0)),e},e.prototype.isCurrentDate=function(e){return e.setHours(0,0,0,0)===this.parent.getCurrentTime().setHours(0,0,0,0)},e.prototype.isCurrentMonth=function(e){return e.getFullYear()===this.parent.getCurrentTime().getFullYear()&&e.getMonth()===this.parent.getCurrentTime().getMonth()},e.prototype.isWorkDay=function(e,t){return void 0===t&&(t=this.parent.activeViewOptions.workDays),t.indexOf(e.getDay())>=0},e.prototype.isWorkHour=function(e,i,n,r){return!t.isNullOrUndefined(i)&&!t.isNullOrUndefined(n)&&(i.setMilliseconds(0),n.setMilliseconds(0),!(w(e)<w(i)||w(e)>=w(n)||!this.isWorkDay(e,r)))},e.prototype.getRenderDates=function(e){var t=[];if("Week"===this.parent.currentView||"TimelineWeek"===this.parent.currentView)for(var i=u(T(this.parent.selectedDate),this.parent.activeViewOptions.firstDayOfWeek),n=0,r=7*this.parent.activeViewOptions.interval;n<r;n++)this.parent.activeViewOptions.showWeekend?t.push(i):this.isWorkDay(i,e)&&t.push(i),i=b(i,1);else if("WorkWeek"===this.parent.currentView||"TimelineWorkWeek"===this.parent.currentView)for(var i=u(T(this.parent.selectedDate),this.parent.activeViewOptions.firstDayOfWeek),n=0,a=7*this.parent.activeViewOptions.interval;n<a;n++)this.isWorkDay(i,e)&&t.push(i),i=b(i,1);else{i=T(this.parent.selectedDate);do{this.parent.activeViewOptions.showWeekend?t.push(i):this.isWorkDay(i,e)&&t.push(i),i=b(i,1)}while(this.parent.activeViewOptions.interval!==t.length)}return e||(this.renderDates=t),this.parent.headerModule&&this.parent.headerModule.previousNextIconHandler(),t},e.prototype.getNextPreviousDate=function(e){if("Day"===this.parent.currentView||"TimelineDay"===this.parent.currentView){if(this.parent.activeViewOptions.showWeekend){var t=this.parent.activeViewOptions.interval;return b(this.parent.selectedDate,"next"===e?t:-t)}var i=void 0;if("next"===e)for(i=b(this.renderDates.slice(-1)[0],1);!this.isWorkDay(i);)i=b(i,1);else{i=b(this.renderDates[0],-1);var n=0;do{this.isWorkDay(i)&&(n+=1),this.parent.activeViewOptions.interval!==n&&(i=b(i,-1))}while(this.parent.activeViewOptions.interval!==n)}return i}var r="next"===e?7:-7;return b(this.parent.selectedDate,r*this.parent.activeViewOptions.interval)},e.prototype.getLabelText=function(e){var i=e.charAt(0).toLowerCase()+e.substring(1);return this.parent.localeObj.getConstant(i)+" of "+I(t.isBlazor()?this.parent.globalize.formatDate(this.parent.selectedDate,{skeleton:"D",calendar:this.parent.getCalendarMode()}):this.parent.globalize.formatDate(this.parent.selectedDate,{skeleton:"long",calendar:this.parent.getCalendarMode()}),"single")},e.prototype.getDateRangeText=function(){if(this.parent.isAdaptive){var e=this.parent.activeViewOptions.dateFormat?this.parent.activeViewOptions.dateFormat:"MMMM y";return I(this.parent.globalize.formatDate(this.parent.selectedDate,{format:e,calendar:this.parent.getCalendarMode()}),"single")}return this.formatDateRange(this.renderDates[0],this.renderDates[this.renderDates.length-1])},e.prototype.formatDateRange=function(e,i){var n=this.parent.globalize,r=this.parent.getCalendarMode();if(e===i&&(i=null),!t.isNullOrUndefined(this.parent.activeViewOptions.dateFormat)){var a="";return i?(a=n.formatDate(e,{format:this.parent.activeViewOptions.dateFormat,calendar:r})+" - "+n.formatDate(i,{format:this.parent.activeViewOptions.dateFormat,calendar:r}),I(a,"multiple")):(a=n.formatDate(e,{format:this.parent.activeViewOptions.dateFormat,calendar:r}),I(a,"multiple"))}var s,o;if(o=t.isBlazor()?"MMMM d, y":"en"===this.parent.locale||"en-US"===this.parent.locale?t.getValue("dateFormats.long",t.getDefaultDateObject(r)):t.getValue("main."+this.parent.locale+".dates.calendars."+r+".dateFormats.long",t.cldrData),!i)return I(n.formatDate(e,{format:o,calendar:r}),"single");var l=o.trim().toLocaleLowerCase();return s="d"===l.substr(0,1)?e.getFullYear()===i.getFullYear()?e.getMonth()===i.getMonth()?n.formatDate(e,{format:"dd",calendar:r})+" - "+n.formatDate(i,{format:"dd MMMM yyyy",calendar:r}):n.formatDate(e,{format:"dd MMM",calendar:r})+" - "+n.formatDate(i,{format:"dd MMM yyyy",calendar:r}):n.formatDate(e,{format:"dd MMM yyyy",calendar:r})+" - "+n.formatDate(i,{format:"dd MMM yyyy",calendar:r}):"m"===l.substr(0,1)?e.getFullYear()===i.getFullYear()?e.getMonth()===i.getMonth()?n.formatDate(e,{format:"MMMM dd",calendar:r})+" - "+n.formatDate(i,{format:"dd, yyyy",calendar:r}):n.formatDate(e,{format:"MMM dd",calendar:r})+" - "+n.formatDate(i,{format:"MMM dd, yyyy",calendar:r}):n.formatDate(e,{format:"MMM dd, yyyy",calendar:r})+" - "+n.formatDate(i,{format:"MMM dd, yyyy",calendar:r}):n.formatDate(e,{format:o,calendar:r})+" - "+n.formatDate(i,{format:o,calendar:r}),I(s,"multiple")},e.prototype.getMobileDateElement=function(e,i){return t.createElement("div",{className:i,innerHTML:'<div class="e-m-date">'+this.parent.globalize.formatDate(e,{format:"d",calendar:this.parent.getCalendarMode()})+'</div><div class="e-m-day">'+I(this.parent.globalize.formatDate(e,{format:"E",calendar:this.parent.getCalendarMode()}),"single")+"</div>"})},e.prototype.setResourceHeaderContent=function(e,i,n){if(void 0===n&&(n=Ke),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));t.append(s,e)}else e.appendChild(t.createElement("div",{className:n,innerHTML:i.resourceData[i.resource.textField]}))},e.prototype.renderResourceMobileLayout=function(){this.parent.resourceBase.lastResourceLevel&&this.parent.resourceBase.lastResourceLevel.length<=0||(this.parent.resourceBase.renderResourceHeader(),this.parent.resourceBase.renderResourceTree())},e.prototype.addAutoHeightClass=function(e){!this.parent.uiStateValues.isGroupAdaptive&&this.parent.rowAutoHeight&&this.isTimelineView()&&this.parent.activeViewOptions.group.resources.length>0&&t.addClass([e],"e-auto-height")},e.prototype.getColElements=function(){return[].slice.call(this.element.querySelectorAll(".e-content-wrap col, .e-date-header-wrap col"))},e.prototype.setColWidth=function(e){if(this.isTimelineView()){var i=this.getColElements(),n=this.element.querySelector("."+Ye+" tbody"),r=Math.ceil(n.offsetWidth/(i.length/2));if(i.forEach(function(e){return t.setStyleAttribute(e,{width:t.formatUnit(r)})}),e.offsetHeight!==e.clientHeight){var a=this.parent.element.querySelector(".e-resource-column-wrap");t.isNullOrUndefined(a)||t.setStyleAttribute(a,{height:t.formatUnit(e.clientHeight)})}}},e.prototype.resetColWidth=function(){for(var e=0,t=this.getColElements();e<t.length;e++)t[e].style.width=""},e.prototype.getContentAreaElement=function(){return this.element.querySelector(".e-content-wrap")},e.prototype.wireExpandCollapseIconEvents=function(){if(this.parent.resourceBase&&this.parent.resourceBase.resourceCollection.length>1)for(var e=0,i=[].slice.call(this.element.querySelectorAll(".e-resource-tree-icon"));e<i.length;e++){var n=i[e];t.EventHandler.clearEvents(n),t.EventHandler.add(n,"click",this.parent.resourceBase.onTreeIconClick,this.parent.resourceBase)}},e.prototype.scrollToDate=function(e){if(-1!==["Month","TimelineMonth"].indexOf(this.parent.currentView)&&!t.isNullOrUndefined(e)){var i=this.getContentAreaElement(),n=this.parent.getMsFromDate(new Date(T(new Date(+e)).getTime())),r=i.querySelector('.e-work-cells[data-date="'+n+'"]');"Month"===this.parent.currentView&&r&&(i.scrollTop=r.offsetTop),"TimelineMonth"===this.parent.currentView&&r&&(i.scrollLeft=r.offsetLeft)}},e}(),Ui=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])})(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)}}(),Wi=function(i){function n(e){var t=i.call(this,e)||this;return t.viewClass="e-day-view",t.isInverseTableSelect=!0,t.baseCssClass="e-vertical-view",t}return Ui(n,i),n.prototype.addEventListener=function(){this.parent.on(Be,this.scrollUiUpdate,this),this.parent.on(qe,this.renderEvents,this)},n.prototype.removeEventListener=function(){this.parent.off(Be,this.scrollUiUpdate),this.parent.off(qe,this.renderEvents)},n.prototype.renderEvents=function(){if(this.parent.activeViewOptions.timeScale.enable)(e=new xt(this.parent)).renderAppointments();else{var e=new At(this.parent);e.renderAppointments()}this.parent.notify("events-loaded",{})},n.prototype.onContentScroll=function(e){this.parent.removeNewEventElement();var i=e.target;this.parent.notify("virtual-scroll",e),this.scrollLeftPanel(i),this.scrollTopPanel(i),this.parent.isAdaptive||(this.parent.uiStateValues.top=i.scrollTop),this.parent.uiStateValues.left=i.scrollLeft,t.isNullOrUndefined(this.parent.quickPopup)||this.parent.quickPopup.quickPopupHide()},n.prototype.onApaptiveMove=function(e){this.parent.uiStateValues.action&&e.preventDefault()},n.prototype.onApaptiveScroll=function(e){this.parent.removeNewEventElement(),this.parent.uiStateValues.top=e.target.scrollTop},n.prototype.scrollLeftPanel=function(e){var i=this.getLeftPanelElement();t.isNullOrUndefined(i)||(i.scrollTop=e.scrollTop)},n.prototype.scrollUiUpdate=function(e){var t=this.getHeaderBarHeight(),i=this.getLeftPanelElement(),n=this.getScrollableElement(),r=this.getDatesHeaderElement(),a=this.parent.element.offsetHeight-t-r.offsetHeight;this.setColWidth(n),this.setContentHeight(n,i,a);var s=A();r.firstElementChild.style[e.cssProperties.rtlBorder]="",r.style[e.cssProperties.rtlPadding]="",n.offsetWidth-n.clientWidth>0?(r.firstElementChild.style[e.cssProperties.border]=s>0?"1px":"0px",r.style[e.cssProperties.padding]=s>0?s-1+"px":"0px"):(r.firstElementChild.style[e.cssProperties.border]="",r.style[e.cssProperties.padding]=""),e.isPreventScrollUpdate||(this.parent.uiStateValues.isInitial?(this.scrollToWorkHour(),this.parent.uiStateValues.isInitial=!1):(i&&(i.scrollTop=this.parent.uiStateValues.top),n.scrollTop=this.parent.uiStateValues.top,n.scrollLeft=this.parent.uiStateValues.left)),this.parent.activeViewOptions.timeScale.enable&&this.highlightCurrentTime()},n.prototype.setContentHeight=function(e,i,n){!this.parent.isAdaptive||this.isTimelineView()||this.parent.isServerRenderer()?(t.isNullOrUndefined(i)||(i.style.height="auto"===this.parent.height?"auto":t.formatUnit(n-this.getScrollXIndent(e))),e.style.height="auto"===this.parent.height?"auto":t.formatUnit(n)):e.style.height="auto"===this.parent.height?"auto":t.formatUnit(n)},n.prototype.scrollToWorkHour=function(){if(this.parent.workHours.highlight){var e=this.element.querySelector(".e-work-hours");e&&(this.getScrollableElement().scrollTop=e.offsetTop,this.parent.uiStateValues.top=e.offsetTop,this.parent.uiStateValues.left=0)}},n.prototype.scrollToHour=function(e,i){var n=this.parent.getStartEndTime(e);!t.isNullOrUndefined(n)&&t.isNullOrUndefined(i)&&(this.getScrollableElement().scrollTop=this.getTopFromDateTime(n))},n.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.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},n.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 c=l[o],p=["e-header-cells"];this.isCurrentDate(c)&&p.push("e-current-day"),r.push({date:c,type:"dateHeader",className:p,colSpan:1,workDays:t,startHour:new Date(+a),endHour:new Date(+s)})}return r},n.prototype.isWorkHourRange=function(e){return this.getStartHour().getTime()<=e.getTime()&&this.getEndHour().getTime()>=e.getTime()},n.prototype.highlightCurrentTime=function(){var e=this;if(!(this.parent.activeViewOptions.headerRows.length>0&&"Hour"!==this.parent.activeViewOptions.headerRows.slice(-1)[0].option)){if(this.parent.isServerRenderer()){var i=[].slice.call(this.element.querySelectorAll(".e-current-day"));i.length>0&&t.removeClass(i,"e-current-day");for(var n='.e-date-header[data-date="'+H(new Date((new Date).setHours(0,0,0,0))).getTime().toString()+'"]',r=0,a=i=[].slice.call(this.element.querySelectorAll(n));r<a.length;r++){var s=a[r];t.addClass([s],"e-current-day")}}this.parent.showTimeIndicator&&this.isWorkHourRange(this.parent.getCurrentTime())&&this.getCurrentTimeIndicatorIndex().length>0?([].slice.call(this.element.querySelectorAll(".e-work-cells")).length>0&&this.changeCurrentTimePosition(),t.isNullOrUndefined(this.currentTimeIndicatorTimer)&&(this.currentTimeIndicatorTimer=window.setInterval(function(){e.changeCurrentTimePosition()},Fe))):this.clearCurrentTimeIndicatorTimer()}},n.prototype.getCurrentTimeIndicatorIndex=function(){var e=[];if(!t.isNullOrUndefined(this.parent.resourceBase)&&this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive)for(var i=0,n=0,r=this.parent.resourceBase.lastResourceLevel;n<r.length;n++){var a=r[n];if((l=this.parent.getIndexOfDate(a.renderDates,T(this.parent.getCurrentTime())))>=0){var s=this.parent.activeViewOptions.group.byDate?this.parent.resourceBase.lastResourceLevel.length*l+i:i+l;e.push(s)}i+=this.parent.activeViewOptions.group.byDate?1:a.renderDates.length}else{var o=this.parent.uiStateValues.isGroupAdaptive&&this.parent.resourceBase.lastResourceLevel.length>0?this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex].renderDates:this.renderDates,l=this.parent.getIndexOfDate(o,T(this.parent.getCurrentTime()));l>=0&&e.push(l)}return e},n.prototype.clearCurrentTimeIndicatorTimer=function(){t.isNullOrUndefined(this.currentTimeIndicatorTimer)||(window.clearInterval(this.currentTimeIndicatorTimer),this.currentTimeIndicatorTimer=null,this.removeCurrentTimeIndicatorElements())},n.prototype.removeCurrentTimeIndicatorElements=function(){for(var e=0,i=[].slice.call(this.element.querySelectorAll(".e-previous-timeline,.e-current-timeline,.e-current-time"));e<i.length;e++){var n=i[e];t.remove(n)}},n.prototype.changeCurrentTimePosition=function(){if(!this.parent.isDestroyed){this.removeCurrentTimeIndicatorElements();var e=this.getCurrentTimeIndicatorIndex(),i=this.parent.getContentTable().rows[0],n=this.getTopFromDateTime(this.parent.getCurrentTime()),r=t.formatUnit(n),a=Math.floor(n/i.cells[0].offsetHeight);if(!t.isNullOrUndefined(a)&&!isNaN(a)){for(var s=[].slice.call(this.element.querySelectorAll(".e-timeline-wrapper")),o=0,l=e[0];o<l;o++)s[o].appendChild(t.createElement("div",{className:"e-previous-timeline",styles:"top:"+r}));for(var c=0,p=e;c<p.length;c++)s[p[c]].appendChild(t.createElement("div",{className:"e-current-timeline",styles:"top:"+r}));var d=t.createElement("div",{innerHTML:this.parent.getTimeString(this.parent.getCurrentTime()),className:"e-current-time",styles:"top:"+r}),h=this.getLeftPanelElement(),u=[].slice.call(h.querySelectorAll("tr"));a<=u.length&&(t.removeClass(h.querySelectorAll(".e-hide-childs"),"e-hide-childs"),t.addClass([u[a].lastElementChild],"e-hide-childs"),t.prepend([d],h),d.style.top=t.formatUnit(d.offsetTop-d.offsetHeight/2))}}},n.prototype.getTopFromDateTime=function(e){var t=this.getStartHour();return(60*(e.getHours()-t.getHours())+(e.getMinutes()-t.getMinutes()))*this.getWorkCellHeight()*this.parent.activeViewOptions.timeScale.slotCount/this.parent.activeViewOptions.timeScale.interval},n.prototype.getWorkCellHeight=function(){return this.element.querySelector(".e-work-cells").offsetHeight},n.prototype.getTdContent=function(i,n,r){var a,s=t.createElement("div"),o="",l=this.parent.element.id+"_",c=H(i);switch(n){case"dateHeader":if(this.parent.activeViewOptions.dateHeaderTemplate){o="dateHeaderTemplate";var p={date:c,type:n},d=this.parent.activeViewOptions.dateHeaderTemplateName;a=[].slice.call(this.parent.getDateHeaderTemplate()(p,this.parent,o,l+d+o,!1))}else s.innerHTML=this.parent.activeView.isTimelineView()?'<span class="e-header-date e-navigate">'+e.ViewHelper.getTimelineDate(this.parent,i)+"</span>":'<div class="e-header-day">'+I(e.ViewHelper.getDayName(this.parent,i),"single")+'</div><div class="e-header-date e-navigate" role="link">'+e.ViewHelper.getDate(this.parent,i)+"</div>",a=[].slice.call(s.childNodes);break;case"majorSlot":if(this.parent.activeViewOptions.timeScale.majorSlotTemplate){o="majorSlotTemplate";p={date:c,type:n};a=[].slice.call(this.parent.getMajorSlotTemplate()(p,this.parent,o,l+o,!1))}else s.innerHTML="<span>"+e.ViewHelper.getTime(this.parent,i)+"</span>",a=[].slice.call(s.childNodes);break;case"minorSlot":if(this.parent.activeViewOptions.timeScale.minorSlotTemplate){o="minorSlotTemplate";p={date:c,type:n};a=[].slice.call(this.parent.getMinorSlotTemplate()(p,this.parent,o,l+o,!1))}else s.innerHTML="&nbsp;",a=[].slice.call(s.childNodes);break;case"alldayCells":if(this.parent.activeViewOptions.cellTemplate){d=this.parent.activeViewOptions.cellTemplateName;o="cellTemplate";p={date:c,type:n,groupIndex:r};a=[].slice.call(this.parent.getCellTemplate()(p,this.parent,o,l+d+o,!1))}}return a},n.prototype.serverRenderLayout=function(){this.setPanel(this.parent.element.querySelector(".e-table-wrap")),this.parent.uiStateValues.isGroupAdaptive&&!this.parent.element.querySelector("."+Qe)&&this.renderResourceMobileLayout();for(var e=0,i=[].slice.call(this.element.querySelectorAll(".e-date-header-wrap td.e-header-cells"));e<i.length;e++){a=i[e];t.EventHandler.clearEvents(a),this.wireMouseEvents(a)}for(var n=0,r=[].slice.call(this.element.querySelectorAll(".e-date-header-wrap td.e-all-day-cells"));n<r.length;n++){var a=r[n];t.EventHandler.clearEvents(a),this.wireCellEvents(a)}this.parent.virtualScrollModule&&this.parent.virtualScrollModule.setTranslateValue();var s=this.element.querySelector(".e-content-wrap"),o=this.element.querySelector("."+Ye+" tbody");t.EventHandler.clearEvents(o),this.wireCellEvents(o),t.EventHandler.clearEvents(s),t.EventHandler.add(s,"scroll",this.onContentScroll,this),t.EventHandler.add(s,t.Browser.touchMoveEvent,this.onApaptiveMove,this),this.wireExpandCollapseIconEvents(),this.parent.notify(Le,{})},n.prototype.renderLayout=function(e){if(this.parent.isServerRenderer())return this.colLevels=this.generateColumnLevels(),void(this.parent.resourceBase&&this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&this.parent.activeView.isTimelineView()&&this.parent.resourceBase.setRenderedResources());this.setPanel(t.createElement("div",{className:"e-table-wrap"}));var i=[this.baseCssClass,this.viewClass];i.push(e),this.parent.activeViewOptions.group.byDate&&i.push("e-by-date"),this.parent.activeViewOptions.timeScale.enable||t.addClass([this.element],["e-timescale-disable",this.viewClass]),this.parent.activeViewOptions.allowVirtualScrolling&&i.push("e-virtual-scroll"),this.parent.eventSettings.ignoreWhitespace&&i.push("e-ignore-whitespace"),this.renderPanel(e),t.addClass([this.element],i),this.element.appendChild(this.createTableLayout("e-outer-table")),this.element.querySelector("table").setAttribute("role","presentation"),this.colLevels=this.generateColumnLevels(),this.renderHeader(),this.renderContent(),this.parent.uiStateValues.isGroupAdaptive&&!this.parent.element.querySelector("."+Qe)&&this.renderResourceMobileLayout(),this.parent.notify(Le,{}),this.parent.updateLayoutTemplates()},n.prototype.renderHeader=function(){var e=t.createElement("tr"),i=t.createElement("td");if(i.appendChild(this.renderDatesHeader()),this.parent.activeViewOptions.timeScale.enable){var n=t.createElement("td",{className:"e-left-indent"});n.appendChild(this.renderLeftIndent()),e.appendChild(n)}e.appendChild(i),t.prepend([e],this.element.querySelector("tbody"))},n.prototype.renderContent=function(){var e=t.createElement("tr"),i=t.createElement("td");if(this.parent.isAdaptive){i.setAttribute("colspan",this.parent.activeViewOptions.timeScale.enable?"2":"1");var n=t.createElement("div",{className:"e-scroll-container"});this.parent.activeViewOptions.timeScale.enable&&n.appendChild(this.renderTimeCells()),n.appendChild(this.renderContentArea()),i.appendChild(n),t.EventHandler.add(n,"scroll",this.onApaptiveScroll,this),t.EventHandler.add(n,t.Browser.touchMoveEvent,this.onApaptiveMove,this),e.appendChild(i)}else{if(i.appendChild(this.renderContentArea()),this.parent.activeViewOptions.timeScale.enable){var r=t.createElement("td");r.appendChild(this.renderTimeCells()),e.appendChild(r)}e.appendChild(i)}this.element.querySelector("tbody").appendChild(e)},n.prototype.renderLeftIndent=function(){for(var e=t.createElement("div",{className:"e-left-indent-wrap"}),i=this.createTableLayout(),n=t.createElement("tr"),r=this.colLevels.length,a=0;a<r;a++){var s=n.cloneNode(),o={className:[this.colLevels[a][0]&&this.colLevels[a][0].className[0]],type:"emptyCells"};if(this.parent.activeViewOptions.showWeekNumber&&-1!==o.className.indexOf("e-header-cells")){o.className.push("e-week-number");var l=v(this.renderDates.slice(-1)[0],this.parent.firstDayOfWeek),c=f("Day"===this.parent.currentView?l:this.renderDates.slice(-1)[0]);o.template=[t.createElement("span",{innerHTML:""+c,attrs:{title:this.parent.localeObj.getConstant("week")+" "+c}})]}s.appendChild(this.createTd(o)),i.querySelector("tbody").appendChild(s)}var p=n.cloneNode(),d=t.createElement("div",{attrs:{tabindex:"0",role:"list",title:"Expand-all-day-section","aria-disabled":"false","aria-label":"Expand section"},className:"e-all-day-appointment-section e-appointment-expand e-icons e-disable"}),h={className:["e-all-day-cells"],type:"emptyCells"},u=this.createTd(h);return u.appendChild(d),p.appendChild(u),i.querySelector("tbody").appendChild(p),e.appendChild(i),e},n.prototype.renderDatesHeader=function(){var e=t.createElement("div",{className:"e-date-header-container"}),i=t.createElement("div",{className:"e-date-header-wrap"});e.appendChild(i);var n=this.createTableLayout(),r=t.createElement("tr"),a=this.colLevels.length,s=this.colLevels[a-1];this.createColGroup(n,s);for(var o=0;o<a;o++){var l=r.cloneNode();t.addClass([l],"e-header-row");for(var c=this.colLevels[o],p=0;p<c.length;p++)l.appendChild(this.createTd(c[p]));n.querySelector("tbody").appendChild(l)}return this.createAllDayRow(n,s),i.appendChild(n),e},n.prototype.createAllDayRow=function(e,i){var n=t.createElement("tr");t.addClass([n],"e-all-day-row");for(var r=0;r<i.length;r++){var a=t.extend({},i[r]);a.className=["e-all-day-cells"],a.type="alldayCells";var s=this.createTd(a);s.setAttribute("data-date",a.date.getTime().toString()),t.isNullOrUndefined(a.groupIndex)||s.setAttribute("data-group-index",""+a.groupIndex),this.wireCellEvents(s),n.appendChild(s)}e.querySelector("tbody").appendChild(n);var o=t.createElement("thead");o.appendChild(this.createEventWrapper("allDay")),t.prepend([o],e)},n.prototype.createTd=function(e){var i=t.createElement("td");if(this.addAttributes(e,i),e.date&&e.type){var n=this.getTdContent(e.date,e.type,e.groupIndex);n&&n.length&&t.append(n,i)}this.parent.isMinMaxDate(T(new Date(""+e.date)))||t.addClass([i],"e-disable-dates"),"resourceHeader"===e.type&&this.setResourceHeaderContent(i,e),"dateHeader"===e.type&&e.className.indexOf("e-header-cells")>=0&&(i.setAttribute("data-date",e.date.getTime().toString()),t.isNullOrUndefined(e.groupIndex)||i.setAttribute("data-group-index",""+e.groupIndex),this.wireMouseEvents(i));var r={elementType:e.type,element:i,date:e.date,groupIndex:e.groupIndex};return this.parent.trigger(je,r),i},n.prototype.wireCellEvents=function(e){t.EventHandler.add(e,"mousedown",this.parent.workCellAction.cellMouseDown,this.parent.workCellAction),this.wireMouseEvents(e)},n.prototype.wireMouseEvents=function(e){t.EventHandler.add(e,"click",this.parent.workCellAction.cellClick,this.parent.workCellAction),this.parent.isAdaptive||t.EventHandler.add(e,"dblclick",this.parent.workCellAction.cellDblClick,this.parent.workCellAction)},n.prototype.renderTimeCells=function(){var e=this,i=t.createElement("div",{className:"e-time-cells-wrap"}),n=this.createTableLayout(),r=t.createElement("tr"),a=function(t){t.type=t.first?"majorSlot":"minorSlot",t.className=t.last?["e-time-cells","e-time-slots"]:["e-time-slots"];var i=r.cloneNode(),a={date:t.date,type:t.type,className:t.className};return i.appendChild(e.createTd(a)),n.querySelector("tbody").appendChild(i),t};return this.getTimeSlotRows(a),i.appendChild(n),i},n.prototype.renderContentArea=function(){var e=t.createElement("div",{className:"e-content-wrap"}),i=this.createTableLayout(Ye);return this.addAutoHeightClass(i),this.createColGroup(i,this.colLevels.slice(-1)[0]),this.renderContentTable(i),e.appendChild(i),this.wireCellEvents(i.querySelector("tbody")),t.EventHandler.add(e,"scroll",this.onContentScroll,this),t.EventHandler.add(e,t.Browser.touchMoveEvent,this.onApaptiveMove,this),e},n.prototype.renderContentTable=function(e){var i=this,n=t.createElement("tr",{attrs:{role:"row"}}),r=t.createElement("td",{attrs:{role:"gridcell","aria-selected":"false"}}),a=e.querySelector("tbody"),s=function(e){for(var t=n.cloneNode(),s=0,o=i.colLevels[i.colLevels.length-1];s<o.length;s++){var l=o[s],c=i.createContentTd(l,e,r);t.appendChild(c)}return a.appendChild(t),e};this.getTimeSlotRows(s),this.renderContentTableHeader(e)},n.prototype.createContentTd=function(e,i,n){var r=n.cloneNode();e.colSpan&&r.setAttribute("colspan",e.colSpan.toString());var a=this.getContentTdClass(i);this.parent.isMinMaxDate(T(new Date(""+e.date)))||a.push("e-disable-dates");var s=T(new Date(""+e.date));y(s,w(i.date));var o="workCells";if(-1!==e.className.indexOf("e-parent-node")&&(a.push("e-resource-group-cells"),o="resourceGroupCells"),this.parent.workHours.highlight&&(this.parent.activeViewOptions.timeScale.enable&&this.isWorkHour(s,e.startHour,e.endHour,e.workDays)||!this.parent.activeViewOptions.timeScale.enable&&this.isWorkDay(s,e.workDays))&&a.push("e-work-hours"),t.addClass([r],a),this.parent.activeViewOptions.cellTemplate){var l={date:H(s),type:o,groupIndex:e.groupIndex},c=this.parent.element.id+"_"+this.parent.activeViewOptions.cellTemplateName+"cellTemplate",p=[].slice.call(this.parent.getCellTemplate()(l,this.parent,"cellTemplate",c,!1));t.append(p,r)}if(r.setAttribute("data-date",s.getTime().toString()),!t.isNullOrUndefined(e.groupIndex)||this.parent.uiStateValues.isGroupAdaptive){var d=this.parent.uiStateValues.isGroupAdaptive?this.parent.uiStateValues.groupIndex:e.groupIndex;r.setAttribute("data-group-index",""+d)}var h={elementType:o,element:r,date:s,groupIndex:e.groupIndex};return this.parent.trigger(je,h),r},n.prototype.getContentTdClass=function(e){return e.last?["e-work-cells"]:["e-work-cells","e-alternate-cells"]},n.prototype.renderContentTableHeader=function(e){var i=t.createElement("thead");i.appendChild(this.createEventWrapper()),this.parent.activeViewOptions.timeScale.enable&&i.appendChild(this.createEventWrapper("timeIndicator")),t.prepend([i],e)},n.prototype.createEventWrapper=function(e){void 0===e&&(e="");for(var i=t.createElement("tr"),n=this.colLevels.slice(-1)[0],r=0,a=n.length;r<a;r++){var s=n[r],o=t.createElement("td",{className:"allDay"===e?"e-all-day-appointment-wrapper":"timeIndicator"===e?"e-timeline-wrapper":"e-day-wrapper",attrs:{"data-date":s.date.getTime().toString()}});if(t.isNullOrUndefined(s.groupIndex)||o.setAttribute("data-group-index",s.groupIndex.toString()),""===e){var l=t.createElement("div",{id:"e-appointment-wrapper-"+r.toString(),className:"e-appointment-wrapper"});o.appendChild(l)}i.appendChild(o)}return i},n.prototype.getScrollableElement=function(){return!this.parent.isAdaptive||this.isTimelineView()||this.parent.isServerRenderer()?this.getContentAreaElement():this.element.querySelector(".e-scroll-container")},n.prototype.getLeftPanelElement=function(){return this.element.querySelector(".e-time-cells-wrap")},n.prototype.getEndDateFromStartDate=function(e){var t=this.parent.activeViewOptions.timeScale.interval*Fe/this.parent.activeViewOptions.timeScale.slotCount,i=new Date(e.getTime());return i.setMilliseconds(i.getMilliseconds()+t),i},n.prototype.getTimeSlotRows=function(e){var t=[],i=this.getStartHour(),n=this.getEndHour(),r=this.parent.activeViewOptions.timeScale.interval*Fe,a=r/this.parent.activeViewOptions.timeScale.slotCount,s=Math.round(Ne/a),o=i.getTime(),l=n.getTime();o!==l&&(s=Math.abs(l-o)/a-(new Date(l).getTimezoneOffset()-new Date(o).getTimezoneOffset())/(60/this.parent.activeViewOptions.timeScale.slotCount)),this.parent.activeViewOptions.timeScale.enable||(s=1);for(var c=this.parent.getStartEndTime(this.parent.workHours.start),p=this.parent.getStartEndTime(this.parent.workHours.end),d=0;d<s;d++){var h=new Date(o+a*d);if(P(h)||new Date(o).getTimezoneOffset()!==h.getTimezoneOffset()){var u=new Date(o).getTimezoneOffset()-h.getTimezoneOffset();h=new Date(h.getTime()-6e4*u)}var v=d%(r/a),m={date:new Date(""+h),startHour:c,endHour:p,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},n.prototype.getModuleName=function(){return"verticalView"},n.prototype.destroy=function(){if(!this.parent.isDestroyed&&(this.clearCurrentTimeIndicatorTimer(),this.element)){var e=this.getContentAreaElement();if(e&&t.EventHandler.remove(e,"scroll",this.onContentScroll),this.parent.resourceBase&&this.parent.resourceBase.destroy(),t.isBlazor()){var i=this.parent.viewCollections[this.viewIndex].option;this.parent.isServerRenderer(i)?("Agenda"!==this.parent.currentView&&"TimelineYear"!==this.parent.currentView||(this.element.style.display="none"),this.parent.resetEventTemplates()):(this.parent.resetLayoutTemplates(),this.parent.resetEventTemplates(),t.remove(this.element))}else t.remove(this.element);this.element=null,this.parent.scheduleTouchModule&&this.parent.scheduleTouchModule.resetValues()}},n}(Fi),zi=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])})(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)}}(),_i=function(e){function t(t){var i=e.call(this,t)||this;return i.viewClass="e-day-view",i}return zi(t,e),t.prototype.getModuleName=function(){return"day"},t}(Wi),Yi=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])})(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)}}(),Gi=function(e){function t(t){var i=e.call(this,t)||this;return i.viewClass="e-week-view",i}return Yi(t,e),t.prototype.getModuleName=function(){return"week"},t}(Wi),Qi=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])})(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)}}(),Xi=function(e){function t(t){var i=e.call(this,t)||this;return i.viewClass="e-work-week-view",i}return Qi(t,e),t.prototype.startDate=function(){var e=this.renderDates[0];return this.parent.activeViewOptions.group.resources.length>0&&(e=this.parent.resourceBase.getResourceRenderDates()[0]),e},t.prototype.endDate=function(){var e=b(this.renderDates[this.renderDates.length-1],1);return this.parent.activeViewOptions.group.resources.length>0&&(e=b(this.parent.resourceBase.getResourceRenderDates().slice(-1)[0],1)),e},t.prototype.getModuleName=function(){return"workWeek"},t}(Wi),Ki=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])})(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)}}(),Zi=function(e){function i(t){var i=e.call(this,t)||this;return i.dayNameFormat="wide",i.viewClass="e-month-view",i.isInverseTableSelect=!1,i.monthDates={},i}return Ki(i,e),i.prototype.addEventListener=function(){this.parent.on(Be,this.onScrollUIUpdate,this),this.parent.on(qe,this.onDataReady,this),this.parent.on("cellClick",this.onCellClick,this)},i.prototype.removeEventListener=function(){this.parent.off(Be,this.onScrollUIUpdate),this.parent.off(qe,this.onDataReady),this.parent.off("cellClick",this.onCellClick)},i.prototype.onDataReady=function(e){new At(this.parent).renderAppointments(),this.parent.notify("events-loaded",{})},i.prototype.onCellClick=function(e){},i.prototype.onContentScroll=function(e){this.parent.removeNewEventElement(),this.parent.notify("virtual-scroll",e),this.scrollTopPanel(e.target),this.scrollLeftPanel(e.target)},i.prototype.scrollLeftPanel=function(e){var t=this.getLeftPanelElement();t&&(t.scrollTop=e.scrollTop)},i.prototype.getLeftPanelElement=function(){return this.element.querySelector(".e-week-number-wrapper")},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();this.setContentHeight(n,a,r);var s=A();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)a&&(a.scrollTop=e.scrollPosition.top),n.scrollTop=e.scrollPosition.top,n.scrollLeft=e.scrollPosition.left;else{var o=document.querySelector('.e-header-cells[data-date="'+this.parent.getMsFromDate(this.parent.selectedDate)+'"]');n.scrollLeft=null!==o?o.offsetLeft:0}},i.prototype.setContentHeight=function(e,i,n){e.style.height="auto","Month"===this.parent.currentView&&(e.style.height=t.formatUnit(n)),i&&("MonthAgenda"===this.parent.currentView&&(n=this.element.querySelector("."+Ye).offsetHeight),i.style.height="auto",i.style.height=t.formatUnit(n-this.getScrollXIndent(e)))},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];e=[this.getDateSlots(i.renderDates,i.workDays)]}}else e.push(t);return this.colLevels=e,e},i.prototype.getDateSlots=function(e,t){for(var i=this.parent.activeViewOptions.showWeekend?7:t.length,n=[],r=0;r<i;r++){var a=["e-header-cells"],s=e.slice(0,i).map(function(e){return e.getDay()});this.isCurrentMonth(this.parent.selectedDate)&&s.indexOf(this.parent.getCurrentTime().getDay())===r&&a.push("e-current-day"),n.push({date:e[r],type:"monthDay",className:a,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.serverRenderLayout=function(){var e=[].slice.call(this.parent.element.querySelectorAll(".e-current-day"));e.length>0&&t.removeClass(e,"e-current-day");var i=H(new Date((new Date).setHours(0,0,0,0))),n='.e-work-cells[data-date="'+i.getTime().toString()+'"]';if("Month"===this.parent.currentView||"MonthAgenda"===this.parent.currentView){(e=[].slice.call(this.parent.element.querySelectorAll(".e-current-date"))).length>0&&t.removeClass(e,"e-current-date");for(var r=0,a=c=[].slice.call(this.parent.element.querySelectorAll(n));r<a.length;r++){var s=a[r],o=s.cellIndex,l=[].slice.call(this.parent.element.querySelectorAll(".e-header-cells"))[o];t.addClass([s],"e-current-date"),t.addClass([l],"e-current-day")}}if("TimelineMonth"===this.parent.currentView){var c=this.parent.element.querySelector('.e-header-cells[data-date="'+i.getTime().toString()+'"]');t.isNullOrUndefined(c)||t.addClass([c],"e-current-day")}this.setPanel(this.parent.element.querySelector(".e-table-wrap"));for(var p="MonthAgenda"===this.parent.currentView?this.parent.activeView.getPanel():this.parent.element,d=0,h=[].slice.call(this.element.querySelectorAll(".e-date-header-wrap td.e-header-cells"));d<h.length;d++){var u=h[d];t.EventHandler.clearEvents(u),this.wireCellEvents(u)}var v=this.element.querySelector("."+Ye+" tbody");t.EventHandler.clearEvents(v),this.wireCellEvents(v),this.parent.virtualScrollModule&&this.parent.virtualScrollModule.setTranslateValue();var m=this.element.querySelector(".e-content-wrap");t.EventHandler.clearEvents(m),t.EventHandler.add(m,"scroll",this.onContentScroll,this),this.wireExpandCollapseIconEvents(),this.renderAppointmentContainer(),this.parent.uiStateValues.isGroupAdaptive&&!p.querySelector("."+Qe)&&this.renderResourceMobileLayout(),this.parent.notify(Le,{})},i.prototype.renderLayout=function(e){if(this.dayNameFormat=this.getDayNameFormat(),this.parent.isServerRenderer())return this.colLevels=this.generateColumnLevels(),void(this.parent.activeView.isTimelineView()&&this.parent.resourceBase&&this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&this.parent.resourceBase.setRenderedResources());this.setPanel(t.createElement("div",{className:"e-table-wrap"}));var i=[this.viewClass];i.push(e),this.parent.activeViewOptions.group.byDate&&i.push("e-by-date"),this.parent.activeViewOptions.allowVirtualScrolling&&i.push("e-virtual-scroll"),this.parent.eventSettings.ignoreWhitespace&&i.push("e-ignore-whitespace"),t.addClass([this.element],i),this.renderPanel(e),this.element.appendChild(this.createTableLayout("e-outer-table")),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("."+Qe)&&this.renderResourceMobileLayout(),this.parent.notify(Le,{}),this.parent.updateLayoutTemplates()},i.prototype.wireCellEvents=function(e){t.EventHandler.add(e,"mousedown",this.parent.workCellAction.cellMouseDown,this.parent.workCellAction),t.EventHandler.add(e,"click",this.parent.workCellAction.cellClick,this.parent.workCellAction),this.parent.isAdaptive||t.EventHandler.add(e,"dblclick",this.parent.workCellAction.cellDblClick,this.parent.workCellAction)},i.prototype.renderHeader=function(){var e=t.createElement("tr");this.renderLeftIndent(e);var i=t.createElement("td");i.appendChild(this.renderDatesHeader()),e.appendChild(i),t.prepend([e],this.element.querySelector("tbody"))},i.prototype.renderLeftIndent=function(e){this.parent.activeViewOptions.showWeekNumber&&e.appendChild(t.createElement("td",{className:"e-left-indent"}))},i.prototype.renderContent=function(){var e=t.createElement("tr");this.parent.activeViewOptions.showWeekNumber&&e.appendChild(this.renderWeekNumberContent());var i=t.createElement("td"),n=t.createElement("div",{className:"e-content-wrap"}),r=this.renderContentArea();if("Month"===this.parent.currentView)n.appendChild(r);else{var a=t.createElement("div",{className:_e});a.appendChild(r),n.appendChild(a)}t.EventHandler.add(n,"scroll",this.onContentScroll,this),i.appendChild(n),e.appendChild(i),this.element.querySelector("tbody").appendChild(e),this.renderAppointmentContainer()},i.prototype.renderWeekNumberContent=function(){var e=this.renderDates.map(function(e){return new Date(+e)}),i=t.createElement("td"),n=t.createElement("div",{className:"e-week-number-wrapper"});i.appendChild(n);var r=this.createTableLayout();n.appendChild(r);for(var a=this.parent.activeViewOptions.showWeekend?7:this.parent.activeViewOptions.workDays.length,s=0,o=this.renderDates.length/a;s<o;s++){var l=f(e.splice(0,a).slice(-1)[0]).toString();r.querySelector("tbody").appendChild(this.createWeekNumberElement(l))}return i},i.prototype.renderAppointmentContainer=function(){},i.prototype.renderDatesHeader=function(){var e=t.createElement("div",{className:"e-date-header-container"}),i=t.createElement("div",{className:"e-date-header-wrap"});e.appendChild(i);var n=this.createTableLayout();this.createColGroup(n,this.colLevels[this.colLevels.length-1]);for(var r=t.createElement("tr"),a=0;a<this.colLevels.length;a++){for(var s=this.colLevels[a],o=r.cloneNode(),l=0;l<s.length;l++){var c=s[l];o.appendChild(this.createHeaderCell(c))}n.querySelector("tbody").appendChild(o)}return i.appendChild(n),e},i.prototype.createHeaderCell=function(e){var i=t.createElement("td");if(this.addAttributes(e,i),"monthDay"===e.type){s=t.createElement("span",{innerHTML:I(this.parent.getDayNames(this.dayNameFormat)[e.date.getDay()],"single")});i.appendChild(s)}if("resourceHeader"===e.type&&this.setResourceHeaderContent(i,e),"dateHeader"===e.type){if(t.addClass([i],"e-date-header"),i.setAttribute("data-date",e.date.getTime().toString()),this.parent.activeViewOptions.dateHeaderTemplate){var n={date:H(e.date),type:e.type},r=this.parent.element.id+"_"+this.parent.activeViewOptions.dateHeaderTemplateName+"dateHeaderTemplate",a=[].slice.call(this.parent.getDateHeaderTemplate()(n,this.parent,"dateHeaderTemplate",r,!1));a&&a.length&&t.append(a,i)}else{var s=t.createElement("span",{className:"e-navigate"}),o=t.isBlazor()?"D":"full",l=this.parent.globalize.formatDate(e.date,{skeleton:o,calendar:this.parent.getCalendarMode()});s.setAttribute("title",I(l,"multiple"));var c=!this.parent.calendarUtil.isMonthStart(e.date)||this.isCurrentDate(e.date)||this.parent.isAdaptive?t.isBlazor()?this.parent.globalize.formatDate(e.date,{format:"d",calendar:this.parent.getCalendarMode()}):this.parent.globalize.formatDate(e.date,{skeleton:"d",calendar:this.parent.getCalendarMode()}):this.parent.globalize.formatDate(e.date,{format:"MMM d",calendar:this.parent.getCalendarMode()});s.innerHTML=I(c,"single"),i.appendChild(s)}this.wireCellEvents(i)}var p={elementType:e.type,element:i,date:e.date,groupIndex:e.groupIndex};return t.isBlazor()||this.parent.trigger(je,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-work-cells"]};e[t]||(e[t]=[]),e[t].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)for(var n=this.renderDates.map(function(e){return new Date(+e)}),r=this.parent.activeViewOptions.showWeekend?7:this.parent.activeViewOptions.workDays.length,a=0;a<this.renderDates.length/r;a++)for(var s=n.splice(0,r),o=0,l=s;o<l.length;o++){var c=l[o];if(i)for(var p=this.colLevels[this.colLevels.length-1],d=p.slice(0,p.length/r),h=0;h<d.length;h++){var u=void 0;0!==h&&(u=["e-work-cells","e-disable-date"]),t(a,c,d[h],u)}else t(a,c,this.colLevels[this.colLevels.length-1][0])}else for(var v=0,m=this.colLevels[this.colLevels.length-2];v<m.length;v++)for(var g=m[v],n=g.renderDates.map(function(e){return new Date(+e)}),r=this.parent.activeViewOptions.showWeekend?7:g.workDays.length,a=0;a<g.renderDates.length/r;a++)for(var f=0,y=s=n.splice(0,r);f<y.length;f++)t(a,c=y[f],g);return e},i.prototype.updateClassList=function(e){this.isOtherMonth(e.date)&&e.className.push("e-other-month"),this.parent.isMinMaxDate(e.date)||e.className.push("e-disable-dates"),"MonthAgenda"===this.parent.currentView&&this.parent.isSelectedDate(e.date)&&e.className.push("e-selected-cell")},i.prototype.isOtherMonth=function(e){return e.getTime()<this.monthDates.start.getTime()||e.getTime()>this.monthDates.end.getTime()},i.prototype.renderContentArea=function(){var e=this.createTableLayout(Ye);this.addAutoHeightClass(e),"TimelineMonth"===this.parent.currentView&&this.createColGroup(e,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(C(i,this.parent.activeViewOptions.interval-1))};var n=e.querySelector("tbody");return t.append(this.getContentRows(),n),this.wireCellEvents(n),e},i.prototype.getContentRows=function(){for(var e=[],i=t.createElement("tr",{attrs:{role:"row"}}),n=t.createElement("td",{attrs:{role:"gridcell","aria-selected":"false"}}),r=this.getContentSlots(),a=0;a<r.length;a++){for(var s=i.cloneNode(),o=0;o<r[a].length;o++){var l=this.createContentTd(r[a][o],n);s.appendChild(l)}e.push(s)}return e},i.prototype.createContentTd=function(e,i){var n=i.cloneNode();e.colSpan&&n.setAttribute("colspan",e.colSpan.toString()),this.updateClassList(e);var r=e.type;if(-1!==e.className.indexOf("e-parent-node")&&(e.className.push("e-resource-group-cells"),r="resourceGroupCells"),this.parent.workHours.highlight&&this.isWorkDay(e.date,e.workDays)&&e.className.push("e-work-days"),this.isCurrentDate(e.date)&&e.className.push("e-current-date"),t.addClass([n],e.className),n.setAttribute("data-date",e.date.getTime().toString()),!t.isNullOrUndefined(e.groupIndex)||this.parent.uiStateValues.isGroupAdaptive){var a=this.parent.uiStateValues.isGroupAdaptive?this.parent.uiStateValues.groupIndex:e.groupIndex;n.setAttribute("data-group-index",""+a)}if(this.renderDateHeaderElement(e,n),this.parent.activeViewOptions.cellTemplate){var s={date:H(e.date),type:r,groupIndex:e.groupIndex},o=this.parent.element.id+"_"+this.parent.activeViewOptions.cellTemplateName+"cellTemplate",l=[].slice.call(this.parent.getCellTemplate()(s,this.parent,"cellTemplate",o,!1));t.append(l,n)}var c={elementType:r,element:n,date:e.date,groupIndex:e.groupIndex};return t.isBlazor()||this.parent.trigger(je,c),n},i.prototype.renderDateHeaderElement=function(e,i){if("TimelineMonth"!==this.parent.currentView){var n=t.createElement("div",{className:"e-date-header"});if(this.parent.activeViewOptions.cellHeaderTemplate){var r={date:H(e.date),type:e.type,groupIndex:e.groupIndex},a=this.parent.element.id+"_"+this.parent.activeViewOptions.cellHeaderTemplateName+"cellHeaderTemplate",s=[].slice.call(this.parent.getCellHeaderTemplate()(r,this.parent,"cellHeaderTemplate",a,!1));t.append(s,n)}else{var o=!this.parent.calendarUtil.isMonthStart(e.date)||this.isCurrentDate(e.date)||this.parent.isAdaptive?t.isBlazor()?this.parent.globalize.formatDate(e.date,{format:"d",calendar:this.parent.getCalendarMode()}):this.parent.globalize.formatDate(e.date,{skeleton:"d",calendar:this.parent.getCalendarMode()}):this.parent.globalize.formatDate(e.date,{format:"MMM d",calendar:this.parent.getCalendarMode()});n.innerHTML=I(o,"single")}if(i.appendChild(n),"month"===this.getModuleName()){t.addClass([n],"e-navigate");var l=t.isBlazor()?"D":"full",c=this.parent.globalize.formatDate(e.date,{skeleton:l,calendar:this.parent.getCalendarMode()});n.setAttribute("aria-label",c)}}},i.prototype.getMonthStart=function(e){var t=u(this.parent.calendarUtil.firstDateOfMonth(e),this.parent.activeViewOptions.firstDayOfWeek);return new Date(t.getFullYear(),t.getMonth(),t.getDate())},i.prototype.getMonthEnd=function(e){var t=C(e,this.parent.activeViewOptions.interval-1);return b(u(this.parent.calendarUtil.lastDateOfMonth(t),this.parent.activeViewOptions.firstDayOfWeek),6)},i.prototype.getRenderDates=function(e){var t=[],i=T(this.parent.selectedDate),n=this.getMonthStart(i),r=this.getMonthEnd(i);do{this.parent.activeViewOptions.showWeekend?t.push(n):this.isWorkDay(n,e)&&t.push(n),n=b(n,1)}while(n.getTime()<=r.getTime());return e||(this.renderDates=t),this.parent.headerModule&&this.parent.headerModule.previousNextIconHandler(),t},i.prototype.getNextPreviousDate=function(e){return"next"===e?C(this.parent.selectedDate,this.parent.activeViewOptions.interval):C(this.parent.selectedDate,-this.parent.activeViewOptions.interval)},i.prototype.getEndDateFromStartDate=function(e){return b(new Date(e.getTime()),1)},i.prototype.getDateRangeText=function(){if(this.parent.isAdaptive||t.isNullOrUndefined(this.parent.activeViewOptions.dateFormat)){if(this.parent.activeViewOptions.interval>1){var e=C(g(this.parent.selectedDate),this.parent.activeViewOptions.interval-1);return this.parent.selectedDate.getFullYear()===e.getFullYear()?I(this.parent.globalize.formatDate(this.parent.selectedDate,{format:"MMMM",calendar:this.parent.getCalendarMode()})+" - "+this.parent.globalize.formatDate(e,{format:"MMMM ",calendar:this.parent.getCalendarMode()})+e.getFullYear(),"single"):I(this.parent.globalize.formatDate(this.parent.selectedDate,{format:"MMMM",calendar:this.parent.getCalendarMode()})+" "+this.parent.selectedDate.getFullYear()+" - "+this.parent.globalize.formatDate(e,{format:"MMMM ",calendar:this.parent.getCalendarMode()})+e.getFullYear(),"single")}var i=this.parent.activeViewOptions.dateFormat?this.parent.activeViewOptions.dateFormat:"MMMM y";return I(this.parent.globalize.formatDate(this.parent.selectedDate,{format:i,calendar:this.parent.getCalendarMode()}),"single")}return this.formatDateRange(this.parent.selectedDate)},i.prototype.getLabelText=function(e){return this.parent.localeObj.getConstant(e)+" of "+I(this.parent.globalize.formatDate(this.parent.selectedDate,{format:"MMMM y",calendar:this.parent.getCalendarMode()}),"single")},i.prototype.createWeekNumberElement=function(e){var i=t.createElement("tr"),n=t.createElement("td",{className:"e-week-number",attrs:{title:e?this.parent.localeObj.getConstant("week")+" "+e:""},innerHTML:e||""});i.appendChild(n);var r={elementType:"weekNumberCell",element:n};return t.isBlazor()||this.parent.trigger(je,r),i},i.prototype.unwireEvents=function(){},i.prototype.getModuleName=function(){return"month"},i.prototype.destroy=function(){if(!this.parent.isDestroyed&&this.element){if(this.unwireEvents(),this.parent.resourceBase&&this.parent.resourceBase.destroy(),t.isBlazor()){var e=this.parent.viewCollections[this.viewIndex].option;this.parent.isServerRenderer(e)?(-1===["Month","MonthAgenda","TimelineMonth"].indexOf(this.parent.currentView)&&(this.element.style.display="none"),this.parent.resetEventTemplates()):(this.parent.resetLayoutTemplates(),this.parent.resetEventTemplates(),t.remove(this.element))}else t.remove(this.element);this.element=null,this.parent.scheduleTouchModule&&this.parent.scheduleTouchModule.resetValues()}},i}(Fi),Ji=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])})(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)}}(),$i=function(e){function i(t){return e.call(this,t,"day")||this}return Ji(i,e),i.prototype.renderAppointments=function(){this.fields=this.parent.eventFields;for(var e=0,i=[].slice.call(this.parent.element.querySelectorAll(".e-appointment-wrapper,.e-more-indicator"));e<i.length;e++){var n=i[e];t.remove(n)}this.renderedEvents=[],"Year"===this.parent.currentView?this.yearViewEvents():(this.removeCellHeight(),this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive?this.timelineResourceEvents():this.timelineYearViewEvents()),this.parent.notify(Le,{})},i.prototype.yearViewEvents=function(){for(var e=0;e<12;e++)for(var i=".e-month-calendar:nth-child("+(e+1)+") td.e-work-cells",n=[].slice.call(this.parent.element.querySelectorAll(i)),r=new Date(this.parent.selectedDate.getFullYear(),e,this.parent.selectedDate.getDate()),a=this.parent.calendarUtil.getMonthStartDate(new Date(r.getTime())),s=this.parent.calendarUtil.getMonthEndDate(new Date(r.getTime())),o=u(a,this.parent.firstDayOfWeek),l=b(v(s,this.parent.firstDayOfWeek),1),c=0;o.getTime()<l.getTime();c++){var p=T(new Date(o.getTime())),d=b(new Date(p.getTime()),1);if(this.parent.eventBase.filterEvents(p,d).length>0){var h=n[c];h&&h.appendChild(t.createElement("div",{className:"e-appointment"}))}o=b(new Date(o.getTime()),1)}},i.prototype.timelineYearViewEvents=function(){var e=this.parent.element.querySelector(".e-work-cells");this.cellWidth=e.offsetWidth,this.cellHeader=M(e.querySelector(".e-date-header"));var i=this.parent.element.querySelector(".e-event-table");this.eventHeight=d(i,"e-appointment");for(var n=[].slice.call(this.parent.element.querySelectorAll("."+Xe)),r=0;r<12;r++){var a=n[r],s=r+1,o=t.createElement("div",{className:"e-appointment-wrapper"});a.appendChild(o);for(var l=new Date(this.parent.selectedDate.getFullYear(),r,1),c=new Date(l.getFullYear(),l.getMonth()+1,0),p=l.getDay(),h=[];l.getTime()<=c.getTime();){var u=void 0,v=void 0;if("Vertical"===this.parent.activeViewOptions.orientation){var m=n[p];s=p+1;var g=m.querySelector(".e-appointment-wrapper");g||(g=t.createElement("div",{className:"e-appointment-wrapper"}),m.appendChild(g)),this.parent.enableRtl?v=r*this.cellWidth:u=r*this.cellWidth}else this.parent.enableRtl?v=(p+l.getDate()-1)*this.cellWidth:u=(p+l.getDate()-1)*this.cellWidth;var f=this.parent.element.querySelector(".e-content-wrap tr:nth-child("+s+") td");this.cellHeight=f.offsetHeight;var y=T(new Date(l.getTime())),w=b(new Date(y.getTime()),1),D=void 0;this.parent.uiStateValues.isGroupAdaptive&&(D=this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]);for(var C=this.parent.eventBase.filterEvents(y,w,void 0,D),E=this,O=0,S=C.length;O<S&&"break"!==function(e,i){var n=t.extend({},C[e],null,!0),a=E.getIndex(n[E.fields.startTime]);n.Index=a;var s=E.cellHeader+E.eventHeight*(e+1)+2+E.moreIndicatorHeight;if("Horizontal"===E.parent.activeViewOptions.orientation){var l=E.renderedEvents.filter(function(e){return e.Guid===n.Guid}),c=h.filter(function(e){return e.Guid===n.Guid});if(l.length>0||c.length>0)return"continue"}if(!(E.parent.rowAutoHeight&&"Horizontal"===E.parent.activeViewOptions.orientation||E.cellHeight>s)){var d="Horizontal"===E.parent.activeViewOptions.orientation?r:p;if(E.renderMoreIndicatior(o,i-e,y,d,u,v),"Horizontal"===E.parent.activeViewOptions.orientation)for(var m=e;m<C.length;m++){var g=t.extend({},C[m],{Index:a+m},!0);E.renderedEvents.push(g),h.push(n)}return"break"}E.renderEvent(o,n,r,u,v,p),E.updateCellHeight(f,s),h.push(n)}(O,S);O++);l=b(new Date(l.getTime()),1),"Vertical"===this.parent.activeViewOptions.orientation&&(p++,this.renderedEvents=[])}}},i.prototype.timelineResourceEvents=function(){var e=this.parent.element.querySelector(".e-work-cells");this.cellWidth=e.offsetWidth,this.cellHeader=0;var t=this.parent.element.querySelector(".e-event-table");this.eventHeight=d(t,"e-appointment");var i=[].slice.call(this.parent.element.querySelectorAll("."+Xe)),n=this.parent.uiStateValues.isGroupAdaptive?[this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]]:this.parent.resourceBase.lastResourceLevel;if("Horizontal"===this.parent.activeViewOptions.orientation)for(s=0;s<12;s++)for(var r=0,a=n.length;r<a;r++)this.renderedEvents=[],this.renderResourceEvent(i[r],n[r],s,r);else for(var r=0,a=n.length;r<a;r++){this.renderedEvents=[];for(var s=0;s<12;s++)this.renderResourceEvent(i[r],n[r],s,r)}},i.prototype.renderResourceEvent=function(e,i,n,r){var a=t.createElement("div",{className:"e-appointment-wrapper"});e.appendChild(a);var s=m(new Date(this.parent.selectedDate.getFullYear(),n,1)),o=b(g(new Date(s.getTime())),1),l=this.parent.eventBase.filterEvents(s,o,void 0,i),c="Vertical"===this.parent.activeViewOptions.orientation?r:n,p=this.parent.element.querySelector(".e-content-wrap tr:nth-child("+(c+1)+") td");this.cellHeight=p.offsetHeight;for(var d=0;d<l.length;d++){var h=l[d],u=t.extend({},h,null,!0),v=this.getIndex(u[this.fields.startTime]);u.Index=v;var f=this.cellHeader+this.eventHeight*(d+1)+2+this.moreIndicatorHeight,y="Vertical"===this.parent.activeViewOptions.orientation?n*this.cellWidth:r*this.cellWidth;if(!(this.parent.rowAutoHeight||this.cellHeight>f)){var T="Horizontal"===this.parent.activeViewOptions.orientation?n:r;if(this.renderMoreIndicatior(a,l.length-d,s,T,y,y,r),"Horizontal"===this.parent.activeViewOptions.orientation)for(var w=r;w<l.length;w++){var D=t.extend({},l[w],{Index:v+w},!0);this.renderedEvents.push(D)}break}this.renderEvent(a,u,n,y,y,r),this.updateCellHeight(p,f)}},i.prototype.renderEvent=function(e,i,n,r,a,s){var o,l,c=this,p=this.isSpannedEvent(i,n),d=this.createEventElement(p);p[this.fields.isAllDay]&&(p[this.fields.endTime]=new Date(p[this.fields.startTime].getTime())),"Horizontal"===this.parent.activeViewOptions.orientation?(l=n+1,o=p.isSpanned.count*this.cellWidth):(l=s+1,o=this.cellWidth);var h=this.parent.element.querySelector(".e-content-wrap tr:nth-child("+l+") td").offsetTop+this.cellHeader+this.eventHeight*p.Index+2;t.setStyleAttribute(d,{width:o+"px",height:this.eventHeight+"px",left:r+"px",right:a+"px",top:h+"px"});var u={data:p,element:d,cancel:!1,type:"event"};this.parent.trigger("eventRendered",u,function(i){i.cancel||(e.appendChild(d),c.wireAppointmentEvents(d,p,!0),p.isSpanned.isRight||c.renderedEvents.push(t.extend({},p,null,!0)))})},i.prototype.renderMoreIndicatior=function(e,i,n,r,a,s,o){var l=b(new Date(n.getTime()),1),c=this.getMoreIndicatorElement(i,n,l),p=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,t.setStyleAttribute(c,{width:this.cellWidth+"px",left:a+"px",right:s+"px",top:p+"px"}),t.isNullOrUndefined(o)||c.setAttribute("data-group-index",o.toString()),e.appendChild(c),t.EventHandler.add(c,"click",this.moreIndicatorClick,this)},i.prototype.createEventElement=function(e){var i=e[this.fields.subject]||this.parent.eventSettings.fields.subject.default,n=t.createElement("div",{className:"e-appointment",attrs:{"data-id":"Appointment_"+e[this.fields.id],"data-guid":e.Guid,role:"button",tabindex:"0","aria-readonly":this.parent.eventBase.getReadonlyAttribute(e),"aria-selected":"false","aria-grabbed":"true","aria-label":this.parent.getAnnocementString(e)}});if(this.cssClass&&t.addClass([n],this.cssClass),e[this.fields.isReadonly]&&t.addClass([n],"e-read-only"),this.parent.activeViewOptions.group.resources.length>0){var r=this.getGroupIndexFromEvent(e);n.setAttribute("data-group-index",r.toString())}var a=[],s=t.extend({},e,null,!0);if(this.parent.activeViewOptions.eventTemplate){var o=this.parent.element.id+"_"+this.parent.activeViewOptions.eventTemplateName+"eventTemplate",l=j(s,this.parent.eventFields);a=this.parent.getAppointmentTemplate()(l,this.parent,"eventTemplate",o,!1)}else{var c=e[this.fields.location]||this.parent.eventSettings.fields.location.default||"",p=t.createElement("div",{className:"e-subject",innerHTML:i+(c?";&nbsp"+c:"")}),d=t.createElement("div",{className:"e-time"+(this.parent.isAdaptive?" e-disable":""),innerHTML:this.parent.getTimeString(s[this.fields.startTime])}),h=t.createElement("div",{className:"e-time"+(this.parent.isAdaptive?" e-disable":""),innerHTML:this.parent.getTimeString(s[this.fields.endTime])});t.addClass([p],"e-text-center"),e[this.fields.isAllDay]?a=[p]:s.isLeft||s.isRight?(s.isLeft||a.push(d),a.push(p),s.isRight||a.push(h)):a=[d,p,h]}var u=t.createElement("div",{className:"e-appointment-details"});return t.append(a,u),n.appendChild(u),this.applyResourceColor(n,s,"backgroundColor",this.groupOrder),n},i.prototype.isSpannedEvent=function(e,i){var n=new Date(this.parent.selectedDate.getFullYear(),i,1),r=b(new Date(this.parent.selectedDate.getFullYear(),i+1,0),1),a=t.extend({},e,null,!0),s=a[this.fields.startTime],o=a[this.fields.endTime],l={isLeft:!1,isRight:!1,count:1};return s.getTime()<n.getTime()&&(a[this.fields.startTime]=n,l.isLeft=!0),o.getTime()>r.getTime()&&(a[this.fields.endTime]=r,l.isRight=!0),0===this.parent.activeViewOptions.group.resources.length&&(l.count=Math.ceil((a[this.fields.endTime].getTime()-a[this.fields.startTime].getTime())/Ne)),a.isSpanned=l,a},i.prototype.getOverlapEvents=function(e,t){for(var i=[],n=0,r=t;n<r.length;n++){var a=r[n],s=new Date(a[this.fields.startTime].getTime()),o=new Date(a[this.fields.endTime].getTime());T(s).getTime()<=T(new Date(e.getTime())).getTime()&&T(o).getTime()>=T(new Date(e.getTime())).getTime()&&i.push(a)}return i},i.prototype.removeCellHeight=function(){for(var e=".e-month-header-wrapper tbody tr,.e-resource-column-table tbody tr,."+Ye+" tbody tr",t=0,i=[].slice.call(this.element.querySelectorAll(e));t<i.length;t++)i[t].firstElementChild.style.height=""},i}(Mt),en=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])})(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)}}(),tn=function(e){function i(t){var i=e.call(this,t)||this;return i.viewClass="e-year-view",i.isInverseTableSelect=!1,i}return en(i,e),i.prototype.renderLayout=function(e){this.parent.resourceBase&&this.parent.resourceBase.generateResourceLevels([{renderDates:this.parent.activeView.renderDates}]),this.setPanel(t.createElement("div",{className:"e-table-wrap"}));var i="Horizontal"===this.parent.activeViewOptions.orientation?"e-horizontal":"e-vertical";t.addClass([this.element],[this.viewClass,i,e]),this.renderPanel(e);var n=this.createTableLayout("e-outer-table");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()),this.wireEvents(this.element.querySelector(".e-content-wrap"),"scroll"),this.parent.notify(Le,{})},i.prototype.renderHeader=function(e){},i.prototype.renderContent=function(e){var i=t.createElement("tr");e.appendChild(i);var n=t.createElement("td");i.appendChild(n),this.element.querySelector("tbody").appendChild(i);var r=t.createElement("div",{className:"e-content-wrap"});n.appendChild(r);var a=this.createTableLayout("e-calendar-table");r.appendChild(a);var s=t.createElement("tr");a.querySelector("tbody").appendChild(s);var o=t.createElement("td");s.appendChild(o);var l=t.createElement("div",{className:"e-calendar-wrapper"});o.appendChild(l);for(var c=0,p=Array.apply(null,{length:12}).map(function(e,t){return t});c<p.length;c++){var d=p[c],h=new Date(this.parent.selectedDate.getFullYear(),d,this.parent.selectedDate.getDate()),u=t.createElement("div",{className:"e-month-calendar e-calendar",attrs:{"data-role":"calendar"}});u.appendChild(this.renderCalendarHeader(h)),u.appendChild(this.renderCalendarContent(h)),l.appendChild(u)}},i.prototype.renderCalendarHeader=function(e){var i=t.createElement("div",{className:"e-header e-month"}),n=t.createElement("div",{className:"e-day e-title",innerHTML:this.getMonthName(e)});return i.appendChild(n),this.parent.trigger(je,{elementType:"headerCells",element:n,date:e}),i},i.prototype.renderCalendarContent=function(e){var i=this.getMonthDates(e),n=t.createElement("div",{className:"e-content e-month"}),r=this.createTableLayout("e-calendar-table "+Ye);n.appendChild(r);var a=t.createElement("thead",{className:"e-week-header"}),s=t.createElement("tr"),o=u(m(e),this.parent.firstDayOfWeek);this.parent.activeViewOptions.showWeekNumber&&s.appendChild(t.createElement("th"));for(var l=0;l<7;l++)s.appendChild(t.createElement("th",{innerHTML:this.parent.getDayNames("narrow")[o.getDay()]})),o=new Date(o.getTime()+Ne);a.appendChild(s),t.prepend([a],r);for(var c=r.querySelector("tbody");i.length>0;){var p=i.splice(0,7),d=t.createElement("tr",{attrs:{role:"row"}});if(this.parent.activeViewOptions.showWeekNumber){var h=f(p.slice(-1)[0]),v=t.createElement("td",{className:"e-week-number",attrs:{role:"gridcell",title:"Week "+h},innerHTML:h.toString()});d.appendChild(v),this.parent.trigger(je,{elementType:"weekNumberCells",element:v})}for(var g=0,y=p;g<y.length;g++){var T=y[g];(v=t.createElement("td",{className:"e-cell e-work-cells",attrs:{role:"gridcell","aria-selected":"false","data-date":T.getTime().toString()}})).appendChild(t.createElement("span",{className:"e-day",innerHTML:T.getDate().toString()}));var w=[];e.getMonth()!==T.getMonth()&&w.push("e-other-month"),this.isCurrentDate(T)&&e.getMonth()===T.getMonth()&&(w=w.concat(["e-today","e-selected"])),w.length>0&&t.addClass([v],w),d.appendChild(v),this.wireEvents(v,"cell"),this.parent.trigger(je,{elementType:"workCells",element:v,date:T})}c.appendChild(d)}return n},i.prototype.createTableColGroup=function(e){for(var i=t.createElement("colgroup"),n=0;n<e;n++)i.appendChild(t.createElement("col"));return i},i.prototype.getMonthName=function(e){return I(this.parent.globalize.formatDate(e,{format:this.parent.activeViewOptions.dateFormat||"MMMM",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,i,n,r){return void 0===n&&(n=this.parent.workHours.start),void 0===r&&(r=this.parent.workHours.end),[{date:e[0],type:"dateHeader",className:["e-header-cells"],colSpan:1,workDays:i,startHour:new Date(+this.parent.globalize.parseDate(n,t.isBlazor()?{skeleton:"t"}:{skeleton:"Hm"})),endHour:new Date(+this.parent.globalize.parseDate(r,t.isBlazor()?{skeleton:"t"}:{skeleton:"Hm"}))}]},i.prototype.getMonthDates=function(e){for(var t=u(m(e),this.parent.firstDayOfWeek),i=b(new Date(+t),42),n=[],r=t.getTime();r<i.getTime();r+=Ne)n.push(T(new Date(r)));return n},i.prototype.getRowColumnCount=function(e){for(var t=this.parent.selectedDate.getFullYear(),i=[],n=0;n<12;n++)i.push(new Date(t,n,1).getDay()+new Date(t,n+1,0).getDate());var r,a=Math.max.apply(Math,i);return"row"===e?(r="Horizontal"===this.parent.activeViewOptions.orientation?12:a,this.parent.activeViewOptions.timeScale.enable||"Vertical"!==this.parent.activeViewOptions.orientation||(r=1)):r="Horizontal"===this.parent.activeViewOptions.orientation?a:12,r},i.prototype.isCurrentDate=function(e){return T(new Date).getTime()===T(new Date(e.getTime())).getTime()},i.prototype.onCellClick=function(e){var i=t.closest(e.target,".e-work-cells"),n=this.parent.getDateFromElement(i),r=b(new Date(n.getTime()),1),a={date:n,event:this.parent.eventBase.filterEvents(n,r),element:e.target};this.parent.quickPopup.moreEventClick(a,new Date)},i.prototype.onContentScroll=function(e){var t=e.target,i=this.getDatesHeaderElement();i&&(i.firstElementChild.scrollLeft=t.scrollLeft);var n=this.element.querySelector(".e-month-header-wrapper,.e-resource-column-wrap");n&&(n.scrollTop=t.scrollTop)},i.prototype.onScrollUiUpdate=function(e){var i=this.parent.element.offsetHeight-this.getHeaderBarHeight(),n=this.element.querySelector(".e-date-header-container");n&&(i-=n.offsetHeight);var r=this.element.querySelector(".e-content-wrap");r&&(r.style.height=t.formatUnit(i));var a=this.element.querySelector(".e-month-header-wrapper,.e-resource-column-wrap");if(a&&(a.style.height=t.formatUnit(i-this.getScrollXIndent(r))),!this.parent.isAdaptive&&n){var s=A();r.offsetWidth-r.clientWidth>0?(n.firstElementChild.style[e.cssProperties.border]=s>0?"1px":"0px",n.style[e.cssProperties.padding]=s>0?s-1+"px":"0px"):(n.firstElementChild.style[e.cssProperties.border]="",n.style[e.cssProperties.padding]="")}this.setColWidth(this.getContentAreaElement())},i.prototype.startDate=function(){return u(new Date(this.parent.selectedDate.getFullYear(),0,1),this.parent.firstDayOfWeek)},i.prototype.endDate=function(){return b(v(new Date(this.parent.selectedDate.getFullYear(),11,31),this.parent.firstDayOfWeek),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=g(t)),b(new Date(t.getTime()),1)},i.prototype.getNextPreviousDate=function(e){return E(this.parent.selectedDate,"next"===e?1:-1)},i.prototype.getDateRangeText=function(){return this.parent.globalize.formatDate(this.parent.selectedDate,t.isBlazor()?{format:"yyyy"}:{skeleton:"y"})},i.prototype.addEventListener=function(){this.parent.on(Be,this.onScrollUiUpdate,this),this.parent.on(qe,this.onDataReady,this)},i.prototype.removeEventListener=function(){this.parent.off(Be,this.onScrollUiUpdate),this.parent.off(qe,this.onDataReady)},i.prototype.onDataReady=function(e){new $i(this.parent).renderAppointments(),this.parent.notify("events-loaded",e)},i.prototype.wireEvents=function(e,i){"cell"===i?"TimelineYear"!==this.parent.currentView?t.EventHandler.add(e,"click",this.onCellClick,this):(t.EventHandler.add(e,"click",this.parent.workCellAction.cellClick,this.parent.workCellAction),this.parent.isAdaptive||t.EventHandler.add(e,"dblclick",this.parent.workCellAction.cellDblClick,this.parent.workCellAction)):t.EventHandler.add(e,"scroll",this.onContentScroll,this)},i.prototype.getModuleName=function(){return"year"},i.prototype.destroy=function(){this.parent.isDestroyed||this.element&&(this.parent.resourceBase&&this.parent.resourceBase.destroy(),t.isBlazor()&&(this.parent.resetLayoutTemplates(),this.parent.resetEventTemplates()),t.remove(this.element),this.element=null)},i}(Fi),nn=function(){function e(e){this.parent=e,this.viewBase=new Fi(e)}return e.prototype.createAgendaContentElement=function(e,i,n,r,a){var s,o=this.parent.eventFields;if("noEvents"===e){var l=[{subject:this.parent.localeObj.getConstant("noEvents")}];s=c.ListBase.createList(this.parent.createElement,l,{moduleName:"agenda",listClass:this.parent.activeView.viewClass,itemClass:this.parent.activeView.viewClass,template:"<div class=e-no-event>${subject}</div>"})}else{s=c.ListBase.createList(this.parent.createElement,i,{moduleName:"agenda",listClass:this.parent.activeView.viewClass,itemClass:this.parent.activeView.viewClass});for(var p=this,d=0,h=i.length;d<h;d++)!function(e,n){var l=t.createElement("div",{className:"e-appointment",attrs:{"data-id":"Appointment_"+i[e][p.parent.eventFields.id],"data-guid":i[e].Guid,role:"button",tabindex:"0","aria-readonly":p.parent.eventBase.getReadonlyAttribute(i[e]),"aria-selected":"false","aria-grabbed":"true","aria-label":p.parent.getAnnocementString(i[e])}});t.isNullOrUndefined(a)||l.setAttribute("data-group-index",a.toString()),p.parent.eventBase.applyResourceColor(l,i[e],"borderColor",r);var c=void 0;if(t.isNullOrUndefined(p.parent.activeViewOptions.eventTemplate))c=p.createAppointment(i[e]);else{t.addClass([l],"e-template");var d=p.parent.element.id+"_"+p.parent.activeViewOptions.eventTemplateName+"eventTemplate",h=j(i[e],p.parent.eventFields);if(c=p.parent.getAppointmentTemplate()(h,p.parent,"eventTemplate",d,!1),!t.isNullOrUndefined(i[e][o.recurrenceRule])){var u=i[e][o.id]===i[e][o.recurrenceID]?"e-recurrence-icon":"e-recurrence-edit-icon";l.appendChild(t.createElement("div",{className:ze+" "+u}))}}t.append([].slice.call(c),l),R(s.children[e]),s.children[e].appendChild(l);var v={data:t.extend({},i[e],null,!0),element:s.children[e],cancel:!1};p.parent.trigger("eventRendered",v,function(i){i.cancel&&t.remove(s.children[e])})}(d)}return n.appendChild(s),("MonthAgenda"===this.parent.currentView&&this.parent.activeViewOptions.group.resources.length>0||"Agenda"===this.parent.currentView)&&t.addClass([n],"e-day-border"),n},e.prototype.createAppointment=function(e){var i=this.parent.eventFields,n=e[i.subject]||this.parent.eventSettings.fields.subject.default,r=e[i.location]||this.parent.eventSettings.fields.location.default,a=t.createElement("div",{className:"e-subject-wrap"});if(t.isNullOrUndefined(r)||""===r||(n+=","),a.appendChild(t.createElement("div",{className:"e-subject",innerHTML:n})),t.isNullOrUndefined(r)||""===r||a.appendChild(t.createElement("div",{className:"e-location",innerHTML:r})),!t.isNullOrUndefined(e[i.recurrenceRule])){var s=e[i.id]===e[i.recurrenceID]?"e-recurrence-icon":"e-recurrence-edit-icon";a.appendChild(t.createElement("div",{className:ze+" "+s}))}var o=e[i.startTime],l=e[i.endTime],c=e[i.isAllDay],p=this.parent.localeObj.getConstant("allDay"),d=this.parent.getTimeString(o)+" - "+this.parent.getTimeString(l);t.isNullOrUndefined(e.data)||(p=((l.getTimezoneOffset()!==o.getTimezoneOffset()?l.getTime()-o.getTime()+36e5:l.getTime()-o.getTime())/Ne>=1?p:d)+" ("+this.parent.localeObj.getConstant("day")+" "+e.data.index+"/"+e.data.count+")");var h=!t.isNullOrUndefined(e.data)||c?p:d;return[a,t.createElement("div",{className:"e-date-time",innerHTML:h})]},e.prototype.processAgendaEvents=function(e){var i=[];if(t.isNullOrUndefined(e))return i;for(var n=0,r=e;n<r.length;n++){var a=r[n],s=this.parent.eventBase.splitEventByDay(a);i=i.concat(s.length>1?s:a)}return i},e.prototype.wireEventActions=function(){for(var e=0,i=[].slice.call(this.parent.element.querySelectorAll(".e-appointment"));e<i.length;e++){a=i[e];this.parent.eventBase.wireAppointmentEvents(a,null,!0)}for(var n=0,r=[].slice.call(this.parent.element.querySelectorAll(".e-m-date"));n<r.length;n++){var a=r[n];t.EventHandler.add(a,"click",this.parent.agendaModule.dayNavigationClick,this)}},e.prototype.calculateResourceTableElement=function(e,i,n){if(t.isNullOrUndefined(this.parent.resourceBase.lastResourceLevel)){var r=this.viewBase.getDateSlots(this.viewBase.renderDates,this.parent.activeViewOptions.workDays);this.parent.resourceBase.generateResourceLevels(r)}for(var a=b(new Date(n.getTime()),i),s=this.parent.activeViewOptions.group.byDate||"MonthAgenda"===this.parent.currentView?i:1,o=this.parent.resourceBase.resourceCollection,l=this.parent.resourceBase.lastResourceLevel,c=n,p=0;p<s;p++){var d=[],h=[],u=0,v=void 0,m=void 0,g=b(c,p),f=this.parent.activeViewOptions.group.byDate||"MonthAgenda"===this.parent.currentView?b(g,1):a,y=this.parent.eventBase.filterEvents(g,f);if(y.length>0||!this.parent.hideEmptyAgendaDays||"MonthAgenda"===this.parent.currentView){for(var T=0;T<l.length;T++){i=this.parent.activeViewOptions.group.byDate&&"MonthAgenda"!==this.parent.currentView?1:i;A=[];n=g;var w=this.parent.eventBase.filterEvents(n,a,y,l[T]);if(w.length>0||!this.parent.hideEmptyAgendaDays||"MonthAgenda"===this.parent.currentView)for(var D=0;D<i;D++){var C=this.parent.eventBase.filterEvents(n,b(n,1),w,void 0);if((C.length>0||!this.parent.hideEmptyAgendaDays||"MonthAgenda"===this.parent.currentView)&&(A.push(C[0]),v={rowSpan:1,type:"eventColumn",resource:o[o.length-1],groupIndex:l[T].groupIndex,groupOrder:l[T].groupOrder,resourceData:l[T].resourceData,eventData:C,date:n},m={rowSpan:1,type:"dateColumn",resource:o[o.length-1],groupOrder:l[T].groupOrder,resourceData:l[T].resourceData,date:n},d[u]||(d[u]=[]),d[u].push(v),d[u].push(m),u++),(n=b(n,1)).getTime()>=a.getTime()||this.parent.activeViewOptions.group.byDate||"MonthAgenda"===this.parent.currentView){d[d.length-1][1].cssClass="e-day-border";var E={rowSpan:A.length,type:"resourceColumn",resource:o[o.length-1],groupOrder:l[T].groupOrder.slice(0,-1),resourceData:l[T].resourceData,groupIndex:d.length-A.length,className:["e-resource-name"],date:n};d[d.length-A.length].push(E),h.push(t.extend({},E,null,!0));break}}}for(var O=o.slice(0,-1),S=[],x=0,k=0;k<O.length;k++)for(var A=O[O.length-(k+1)].dataSource,V=0;V<A.length;V++)for(var M=0,R=0;R<h.length;R++)h[R].groupOrder[O.length-(k+1)]===A[V][O[O.length-(k+1)].idField]&&(x+=h[R].rowSpan,S.push(t.extend({},h[R],null,!0))),++M===h.length&&S.length>0&&(S[0].rowSpan=x,S[0].type="parentColumnLevel_"+(k+1),S[0].resource=O[O.length-(k+1)],S[0].resourceData=A[V],S[0].date=n,d[S[0].groupIndex].push(S[0]),S=[],x=0);this.createResourceTableRow(d,e)}}0===this.parent.eventBase.filterEvents(c,a).length&&!this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.hideEmptyAgendaDays&&this.renderEmptyContent(e,c)},e.prototype.createResourceTableRow=function(e,i){var n,r,a,s=t.createElement("tr",{attrs:{role:"row"}}),o=t.createElement("td",{attrs:{role:"gridcell","aria-selected":"false"}}),l=0;if(this.parent.activeViewOptions.group.byDate||"MonthAgenda"===this.parent.currentView){for(var c=[],p=this.parent.resourceBase.resourceCollection.slice(0,-1),d=0;d<e.length;d++)c=c.concat(e[d]);a=p.length>0?"parentColumnLevel_"+p.length:"resourceColumn";for(var h=c.filter(function(e){return e.type===a}),u=0;u<h.length;u++)l+=h[u].rowSpan}for(var v=0;v<e.length;v++){n=s.cloneNode();for(var m=e[v].length-1;m>=0;m--){var g=e[v][m],f=o.cloneNode();if("dateColumn"===g.type){if(this.parent.activeViewOptions.group.byDate||"MonthAgenda"===this.parent.currentView){r=e[v][m];continue}f.setAttribute("data-date",g.date.getTime().toString()),f.appendChild(this.createDateHeaderElement(g.date));var y=["e-agenda-cells","e-date-column"];g.cssClass&&y.push(g.cssClass),t.addClass([f],y),n.appendChild(f)}else if("eventColumn"===g.type){var T=0===g.eventData.length?"noEvents":"data";(f=this.createAgendaContentElement(T,g.eventData,f,g.groupOrder,g.groupIndex)).setAttribute("data-date",g.date.getTime().toString()),(this.parent.activeViewOptions.group.byDate||"MonthAgenda"===this.parent.currentView)&&t.addClass([f],["e-agenda-cells","e-day-padding"]),n.appendChild(f)}else f.setAttribute("rowspan",g.rowSpan.toString()),t.addClass([f],"e-resource-column"),this.viewBase.setResourceHeaderContent(f,g,g.className[0]),n.appendChild(f)}if(this.parent.activeViewOptions.group.byDate&&0===v&&"MonthAgenda"!==this.parent.currentView){(f=o.cloneNode()).setAttribute("data-date",r.date.getTime().toString()),f.setAttribute("rowspan",l.toString()),f.appendChild(this.createDateHeaderElement(r.date)),t.addClass([f],["e-agenda-cells","e-date-column","e-date-border"]);var w=x(this.parent.selectedDate.getTime(),r.date.getTime());if(n.setAttribute("aria-rowindex",w.toString()),this.parent.element.querySelector('.e-agenda-view tr[aria-rowindex="'+w+'"]'))break;n.insertBefore(f,n.childNodes[0])}i.appendChild(n)}},e.prototype.createDateHeaderElement=function(e){var i;if(this.parent.activeViewOptions.dateHeaderTemplate){i=t.createElement("div",{className:"e-day-date-header"});var n={date:H(e),type:"dateHeader"},r=this.parent.element.id+"_"+this.parent.activeViewOptions.dateHeaderTemplateName+"dateHeaderTemplate",a=[].slice.call(this.parent.getDateHeaderTemplate()(n,this.parent,"dateHeaderTemplate",r,!1));t.append(a,i)}else i=this.viewBase.getMobileDateElement(e,"e-day-date-header");return i},e.prototype.renderEmptyContent=function(e,i){var n=this.createTableRowElement(i,"noEvents"),r=n.children[0],a=t.createElement("div",{className:"e-empty-event",innerHTML:this.parent.localeObj.getConstant("noEvents")});r.appendChild(a),e.appendChild(n)},e.prototype.createTableRowElement=function(e,i){var n=x(this.parent.selectedDate.getTime(),e.getTime()),r=t.createElement("tr",{attrs:{role:"row","aria-rowindex":n.toString()}}),a=t.createElement("td",{attrs:{class:"monthHeader"===i?"e-month-header":"e-agenda-cells",role:"gridcell","aria-selected":"false","aria-colindex":n.toString(),"data-date":e.getTime().toString()}}),s=a.cloneNode(),o=a.cloneNode();return r.appendChild(s),"noEvents"!==i&&r.appendChild(o),r},e}(),rn=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])})(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)}}(),an=function(e){function i(t){var i=e.call(this,t)||this;return i.viewClass="e-agenda-view",i.isInverseTableSelect=!1,i.agendaDates={},i.virtualScrollTop=1,i.agendaBase=new nn(t),i}return rn(i,e),i.prototype.getModuleName=function(){return"agenda"},i.prototype.renderLayout=function(){this.agendaDates={},this.element=t.createElement("div",{className:"e-table-wrap"}),t.addClass([this.element],this.viewClass),this.element.appendChild(this.createTableLayout("e-outer-table")),this.element.querySelector("table").setAttribute("role","presentation"),this.parent.element.querySelector("."+_e).appendChild(this.element);var e=t.createElement("tr");this.element.querySelector("tbody").appendChild(e);var i=t.createElement("td");e.appendChild(i);var n=t.createElement("div",{className:"e-content-wrap"});i.appendChild(n);var r=this.createTableLayout(Ye);n.appendChild(r);var a=r.querySelector("tbody"),s=T(this.parent.selectedDate);this.agendaBase.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("."+Qe)&&this.renderResourceMobileLayout(),this.parent.notify(Le,{})},i.prototype.eventLoad=function(e){this.dataSource=t.extend([],this.parent.eventsData,null,!0);for(var i=0,n=this.parent.eventsData;i<n.length;i++)delete n[i].generatedDates;var r=e.processedData;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.agendaBase.processAgendaEvents(r);var s=T(this.parent.selectedDate),o=this.element.querySelector("."+Ye+" tbody");R(o),this.renderInitialContent(o,s),this.agendaBase.wireEventActions(),t.closest(o,".e-content-wrap").scrollTop=1,this.parent.notify("events-loaded",{})},i.prototype.refreshEvent=function(e){for(var i=[],n=0,r=this.dataSource;n<r.length;n++){var a=r[n],s=this.parent.eventFields,o=a;t.isNullOrUndefined(o[s.recurrenceID])&&!t.isNullOrUndefined(o[s.recurrenceRule])&&!t.isNullOrUndefined(o.generatedDates)&&e>=o.generatedDates.end&&(i=i.concat(this.parent.eventBase.generateOccurrence(o,e)))}this.parent.eventsProcessed=this.parent.eventsProcessed.concat(this.agendaBase.processAgendaEvents(i))},i.prototype.renderInitialContent=function(e,i){var n=t.createElement("tbody"),r=new Date(i.getTime()),a=this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.hideEmptyAgendaDays?this.getEndDateFromStartDate(r):b(r,this.parent.agendaDaysCount);if(this.renderContent(n,r,a),t.append([].slice.call(n.childNodes),e),this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.hideEmptyAgendaDays&&this.parent.eventsData.length>0)for(var s=this.getContentAreaElement();s.offsetWidth<=s.clientWidth;){var o=t.createElement("tbody");if(a=r,r=b(a,-this.parent.agendaDaysCount),this.renderContent(o,r,a),t.prepend([].slice.call(o.childNodes),e),r<=this.parent.minDate)break}e.childNodes.length<=0&&this.agendaBase.renderEmptyContent(e,i)},i.prototype.renderContent=function(e,i,n){var r=this.parent.eventFields,a=new Date(i.getTime()),s=this.appointmentFiltering(a,n);if(s.length>0&&this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.hideEmptyAgendaDays){var o=s;i=o[0][r.startTime],i=new Date(new Date(i.getTime()).setHours(0,0,0,0)),this.updateHeaderText(o[0][r.startTime])}var l;if(!this.parent.hideEmptyAgendaDays||this.parent.agendaDaysCount>0&&s.length>0){if(this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive){var c=i;this.parent.activeViewOptions.group.byDate||(this.parent.activeViewOptions.allowVirtualScrolling=!1,c=a,this.parent.headerModule&&(this.parent.headerModule.updateDateRange(this.parent.activeView.getDateRangeText()),this.parent.headerModule.updateHeaderItems("remove"))),this.agendaBase.calculateResourceTableElement(e,this.parent.agendaDaysCount,c)}else for(var p=0;p<this.parent.agendaDaysCount;p++){var d=[];d=this.appointmentFiltering(i);var h=this.agendaBase.createTableRowElement(i,"data");if(!this.element.querySelector('tr[aria-rowindex="'+parseInt(h.getAttribute("aria-rowindex"),10)+'"]')){var u=h.children[0],v=h.children[1];if(d.length>0||!this.parent.hideEmptyAgendaDays&&0===d.length){var m=this.parent.hideEmptyAgendaDays||0!==d.length?"data":"noEvents";u.appendChild(this.agendaBase.createDateHeaderElement(i)),h.appendChild(u);var g=this.agendaBase.createAgendaContentElement(m,d,v);h.appendChild(g),g.querySelectorAll("li").length>0&&e.appendChild(h)}else this.parent.activeViewOptions.allowVirtualScrolling&&p--;if(this.isCurrentDate(new Date(i.getTime()))&&t.addClass(u.childNodes,"e-current-day"),(i=b(i,1)).getTime()>n.getTime())break}}l=new Date(i.getTime()-Ne)}this.agendaDates={start:a,end:l}},i.prototype.agendaScrolling=function(e){this.parent.quickPopup.quickPopupHide(),this.parent.activeViewOptions.allowVirtualScrolling&&this.virtualScrolling(e)},i.prototype.virtualScrolling=function(e){var i,n=e.target,r=n.scrollTop,a=n.scrollHeight,s=r+n.clientHeight,o=this.virtualScrollTop<r?"next":"previous",l=n.querySelector("tbody"),c=t.createElement("tbody"),p=this.getElementFromScrollerPosition(e,o),d=this.parent.getDateFromElement(p);if(0===r){if(i=this.getPreviousNextDate(b(d,-1),o),this.appointmentFiltering(i.start,i.end).length>0||!this.parent.hideEmptyAgendaDays){this.renderContent(c,i.start,i.end),t.prepend([].slice.call(c.childNodes),l),this.agendaBase.wireEventActions();for(var h=0,u=l.children;h<u.length;h++)if(u[h].getAttribute("aria-rowindex")===p.getAttribute("aria-colindex")){var v=u[h].offsetTop-this.element.querySelector(".e-agenda-item").offsetHeight;n.scrollTop=v;break}this.updateHeaderText(d)}}else s===a?(i=this.getPreviousNextDate(b(d,1),o),(this.appointmentFiltering(i.start,i.end).length>0||!this.parent.hideEmptyAgendaDays)&&(this.renderContent(c,i.start,i.end),t.append([].slice.call(c.childNodes),l),this.agendaBase.wireEventActions(),this.updateHeaderText(d))):this.updateHeaderText(d);this.virtualScrollTop=r;var m=this.parent.eventBase.getSelectedAppointments();m.length>0&&m[m.length-1].focus()},i.prototype.getElementFromScrollerPosition=function(e,i){var n,r,a=e.target,s=a.scrollTop,o=a.scrollHeight,l=s+a.clientHeight,c=[].slice.call(a.querySelectorAll(".e-agenda-item"));if(c.length>0)if(0===s)r=c[0],n=t.closest(r,".e-agenda-cells");else if(l===o)r=c[c.length-1],n=t.closest(r,".e-agenda-cells");else for(var p=0,d=c.length;p<d;p++)if(r=c[p],r.getBoundingClientRect().top>=0){n=t.closest(r,".e-agenda-cells");break}return n},i.prototype.updateHeaderText=function(e){this.parent.showHeaderBar&&this.parent.headerModule.updateDateRange(this.getDateRangeText(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.appointmentFiltering(i).length>0||!this.parent.hideEmptyAgendaDays)&&a++,(i=b(i,"next"===t?1:-1))<n||i>r)break}while(a!==this.parent.agendaDaysCount);var s=b(i,"next"===t?-1:1);return"next"===t?{start:e,end:b(s,1)}:{start:s,end:b(e,1)}},i.prototype.appointmentFiltering=function(e,i){var n,r;!t.isNullOrUndefined(e)&&t.isNullOrUndefined(i)?(n=T(new Date(e.getTime())),r=y(new Date(n.getTime()),Ne)):(n=new Date(e.getTime()),r=new Date(i.getTime()));var a=this.parent.eventBase.filterEvents(n,r);return 0===a.length&&(this.refreshEvent(e),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?C(e,-1):this.parent.minDate;return T(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?C(e,1):this.parent.maxDate;return T(b(t,1))},i.prototype.getNextPreviousDate=function(e){var t="next"===e?1:-1;return b(this.parent.selectedDate,t)},i.prototype.startDate=function(){return T(this.parent.selectedDate)},i.prototype.endDate=function(){return this.parent.activeViewOptions.allowVirtualScrolling?this.getEndDateFromStartDate(this.startDate()):b(this.startDate(),this.parent.agendaDaysCount)},i.prototype.getDateRangeText=function(e){var i=this.parent.activeViewOptions.dateFormat?this.parent.activeViewOptions.dateFormat:"MMMM y";if(this.parent.activeViewOptions.allowVirtualScrolling||this.parent.isAdaptive){var n=t.isNullOrUndefined(e)?this.parent.selectedDate:e;return I(this.parent.globalize.formatDate(n,{format:i,calendar:this.parent.getCalendarMode()}),"multiple")}var r=this.parent.selectedDate,a=b(r,this.parent.agendaDaysCount-1);return this.formatDateRange(r,a)},i.prototype.dayNavigationClick=function(e){var i=this.parent.getDateFromElement(t.closest(e.currentTarget,".e-agenda-cells"));t.isNullOrUndefined(i)||this.parent.isAdaptive||!this.parent.isMinMaxDate(i)||(this.parent.setScheduleProperties({selectedDate:i}),this.parent.changeView("Day",e))},i.prototype.wireEvents=function(){t.EventHandler.add(this.element.querySelector(".e-content-wrap"),"scroll",this.agendaScrolling,this)},i.prototype.unWireEvents=function(){t.EventHandler.remove(this.element.querySelector(".e-content-wrap"),"scroll",this.agendaScrolling);for(var e=0,i=[].slice.call(this.element.querySelectorAll(".e-m-date"));e<i.length;e++){var n=i[e];t.EventHandler.remove(n,"click",this.dayNavigationClick)}},i.prototype.addEventListener=function(){this.parent.on(Be,this.onAgendaScrollUiUpdate,this),this.parent.on(qe,this.eventLoad,this)},i.prototype.removeEventListener=function(){this.parent.off(Be,this.onAgendaScrollUiUpdate),this.parent.off(qe,this.eventLoad)},i.prototype.onAgendaScrollUiUpdate=function(){var e=this.getHeaderBarHeight();this.parent.headerModule&&(this.parent.activeViewOptions.allowVirtualScrolling?this.parent.headerModule.updateHeaderItems("add"):this.parent.headerModule.updateHeaderItems("remove")),this.element.querySelector(".e-content-wrap").style.height=t.formatUnit(this.parent.element.offsetHeight-e)},i.prototype.destroy=function(){this.parent.isDestroyed||this.element&&(this.unWireEvents(),this.parent.resourceBase&&this.parent.resourceBase.destroy(),t.isBlazor()&&(this.parent.resetLayoutTemplates(),this.parent.resetEventTemplates()),t.remove(this.element),this.element=null,this.parent.headerModule&&this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.headerModule.updateHeaderItems("remove"))},i}(Fi),sn=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])})(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)}}(),on=function(e){function i(t){var i=e.call(this,t)||this;return i.dayNameFormat="narrow",i.viewClass="e-month-agenda-view",i.agendaDates={},i.agendaBase=new nn(t),i.monthAgendaDate=new Date(""+t.selectedDate),i}return sn(i,e),i.prototype.renderAppointmentContainer=function(){if(this.parent.isServerRenderer())return void this.setEventWrapperHeight();var e=this.getContentAreaElement(),i=t.createElement("div",{className:"e-wrapper-container"});e.appendChild(i);var n=t.createElement("div",{className:"e-appointment-wrap"});i.appendChild(n),this.appendAppContainer(n),this.setEventWrapperHeight()},i.prototype.getDayNameFormat=function(){return this.parent.isAdaptive?"narrow":"abbreviated"},i.prototype.setEventWrapperHeight=function(){var e=(this.parent.headerModule?this.parent.headerModule.getHeaderElement().offsetHeight:0)+2,i=this.parent.element.querySelector(".e-schedule-resource-toolbar");i&&(e+=i.offsetHeight);var n=this.getContentAreaElement().firstElementChild,r=this.element.querySelector(".e-date-header-wrap"),a=this.parent.element.offsetHeight-e-r.offsetHeight-n.offsetHeight,s=this.element.querySelector(".e-wrapper-container"),o=this.element.querySelector(".e-appointment-wrap");s.style.height=o.style.height=t.formatUnit(a)},i.prototype.onDataReady=function(e){this.setEventWrapperHeight(),this.clearElements();var i=e.processedData;if(this.parent.uiStateValues.isGroupAdaptive){var n=this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex];i=this.parent.eventBase.filterEventsByResource(n,i)}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),c=this.element.querySelectorAll(".e-work-cells")[r];l.length>0&&(c.querySelector(".e-appointment-indicator")||c.appendChild(t.createElement("div",{className:"e-appointment-indicator"})),o.getTime()===T(new Date(this.monthAgendaDate.getTime())).getTime()&&this.onEventRender(l,o)),r++}this.parent.notify("events-loaded",{})},i.prototype.onCellClick=function(e){this.parent.quickPopup.quickPopupHide();var t=this.appointmentFiltering(e.startTime);this.parent.resetEventTemplates(),this.onEventRender(t,e.startTime),this.parent.notify("events-loaded",{}),this.monthAgendaDate=new Date(""+e.startTime)},i.prototype.onEventRender=function(e,i){var n=this.element.querySelector(".e-appointment-wrap");if(R(n),0===this.parent.activeViewOptions.group.resources.length||this.parent.uiStateValues.isGroupAdaptive)if(e.length>0){var r=t.createElement("div",{className:Xe});n.appendChild(this.agendaBase.createAgendaContentElement("data",e,r))}else this.appendAppContainer(n);else if(e.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=T(new Date(e.getTime())),i=y(new Date(t.getTime()),Ne);return this.parent.eventBase.filterEvents(t,i)},i.prototype.clearElements=function(){for(var e=0,i=[].slice.call(this.element.querySelectorAll(".e-appointment-indicator"));e<i.length;e++){var n=i[e];t.remove(n)}this.appendAppContainer(this.element.querySelector(".e-appointment-wrap"))},i.prototype.appendAppContainer=function(e){var i=t.createElement("div",{className:Xe});t.addClass([i],"e-no-event"),i.innerHTML=this.parent.localeObj.getConstant("noEvents"),R(e),e.appendChild(i)},i.prototype.getNextPreviousDate=function(e){var t=this.parent.selectedDate,i="next"===e?this.parent.activeViewOptions.interval:-this.parent.activeViewOptions.interval,n=C(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.getModuleName=function(){return"monthAgenda"},i}(Zi),ln=function(){function e(e,t){this.parent=e,this.renderDates=t}return e.prototype.groupByYear=function(e){for(var t={},i=0,n=e;i<n.length;i++){var r=n[i],a=r.getFullYear();t[a]=t[a]||[],t[a].push(r)}return t},e.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[a]=t[a]||[],t[a].push(r)}return t},e.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)/Ne+new Date(a).getDay()+1)/7);this.parent.firstDayOfWeek&&this.parent.firstDayOfWeek>new Date(+r).getDay()&&(o-=1),t[o]=t[o]||[],t[o].push(r)}return t},e.prototype.generateSlots=function(e,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=[],c=Object.keys(e),p=0;p<c.length;p++){var d=e[c[p]],h=void 0;if(n.template){var u={date:d[0],type:a};h=[].slice.call(this.parent.templateParser(n.template)(u))}else{var m=void 0;switch(n.option){case"Year":m='<span class="e-header-year">'+o(d[0],"y")+"</span>";break;case"Month":m='<span class="e-header-month">'+I(o(d[0],"MMMM"),"single")+"</span>";break;case"Week":var g=v(d.slice(-1)[0],this.parent.firstDayOfWeek);"TimelineMonth"===this.parent.currentView&&(g=v(d.slice(-1)[0],0)),m='<span class="e-header-week">'+f(g)+"</span>"}var y=t.createElement("div",{innerHTML:m});h=[].slice.call(y.childNodes)}l.push({date:d[0],type:a,className:[r],colSpan:d.length*i,template:h})}return l},e.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=0,o=n;s<o.length;s++){var l=o[s];switch(l.option){case"Year":var c=this.groupByYear(this.renderDates);a=this.generateSlots(c,r,l,"e-header-year-cell","yearHeader"),i.push(a);break;case"Month":var p=this.groupByMonth(this.renderDates);a=this.generateSlots(p,r,l,"e-header-month-cell","monthHeader"),i.push(a);break;case"Week":var d=this.groupByWeek(this.renderDates);a=this.generateSlots(d,r,l,"e-header-week-cell","weekHeader"),i.push(a);break;case"Date":a=(a=e).map(function(e){return e.colSpan=r,e}),i.push(a);break;case"Hour":t.length>0&&i.push(t)}}return i},e}(),cn=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])})(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)}}(),pn=function(e){function i(t){var i=e.call(this,t)||this;return i.baseCssClass="e-timeline-view",i}return cn(i,e),i.prototype.getLeftPanelElement=function(){return this.element.querySelector(".e-resource-column-wrap")},i.prototype.scrollTopPanel=function(t){e.prototype.scrollTopPanel.call(this,t),this.scrollHeaderLabels(t)},i.prototype.scrollToWorkHour=function(){var e=this.parent.getStartEndTime(this.parent.workHours.start),i=this.isWorkDay(this.parent.selectedDate)&&this.parent.workHours.highlight&&!t.isNullOrUndefined(e)?new Date(+this.parent.selectedDate).setHours(e.getHours(),e.getMinutes(),0,0):new Date(+this.parent.selectedDate).setHours(0,0,0,0),n='[data-date="'+this.parent.getMsFromDate(new Date(i))+'"]',r=this.element.querySelector(n);r&&(this.getScrollableElement().scrollLeft=r.offsetLeft)},i.prototype.scrollToHour=function(e,i){var n,r;if(i&&(r=this.parent.getIndexOfDate(this.renderDates,T(i)))>=0){var a=e.split(":");2===a.length&&(n=new Date(i.setHours(parseInt(a[0],10),parseInt(a[1],10),0)))}n=t.isNullOrUndefined(i)?this.parent.getStartEndTime(e):n,t.isNullOrUndefined(n)||(this.getScrollableElement().scrollLeft=t.isNullOrUndefined(i)?this.getLeftFromDateTime(null,n):this.getLeftFromDateTime([r],n))},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=[];return this.parent.activeViewOptions.timeScale.enable&&(i=this.generateTimeSlots(e[e.length-1]),e.push(i)),this.parent.activeViewOptions.headerRows.length>0&&(e=new ln(this.parent,this.renderDates).generateColumnLevels(t,i)),e},i.prototype.generateTimeSlots=function(e){for(var i=this,n=function(e){return e.type=e.first?"majorSlot":"minorSlot",e.className=e.first?["e-time-slots"]:["e-time-slots","e-time-cells"],e.workDays=i.parent.activeViewOptions.workDays,e},r=this.getTimeSlotRows(n),a=[],s=0,o=e;s<o.length;s++){var l=o[s];l.colSpan=r.length;for(var c=0,p=t.extend([],r,null,!0);c<p.length;c++){var d=p[c],h=T(new Date(""+l.date));d.date=y(h,w(d.date)),a.push(d)}}return a},i.prototype.changeCurrentTimePosition=function(){if(!this.parent.isDestroyed){this.removeCurrentTimeIndicatorElements();var e=this.getCurrentTimeIndicatorIndex(),i=this.getLeftFromDateTime(e,this.parent.getCurrentTime()),n=this.element.querySelector("."+Ye).offsetHeight,r=this.element.querySelector(".e-date-header-wrap");if(this.element.querySelector(".e-content-wrap").appendChild(t.createElement("div",{className:"e-current-timeline",styles:(this.parent.enableRtl?"right":"left")+":"+t.formatUnit(i)+"; height:"+t.formatUnit(n)})),this.parent.virtualScrollModule){var a=this.parent.element.querySelector(".e-current-timeline"),s=this.parent.element.querySelector(".e-content-wrap table");t.setStyleAttribute(a,{transform:s.style.transform})}var o=t.createElement("div",{innerHTML:this.parent.getTimeString(this.parent.getCurrentTime()),className:"e-current-time"});r.appendChild(o),o.style[this.parent.enableRtl?"right":"left"]=t.formatUnit(i-o.offsetWidth/2)}},i.prototype.getLeftFromDateTime=function(e,i){var n=this.getStartHour(),r=this.getEndHour(),a=0,s=60*(i.getHours()-n.getHours())+(i.getMinutes()-n.getMinutes());if(!t.isNullOrUndefined(e)){var o=0===r.getHours()?24:r.getHours();0!==e[0]&&(a=e[0]*(60*(o-n.getHours()))+(r.getMinutes()-n.getMinutes())),s=a+s}return s*this.getWorkCellWidth()*this.parent.activeViewOptions.timeScale.slotCount/this.parent.activeViewOptions.timeScale.interval},i.prototype.getWorkCellWidth=function(){return this.element.querySelector(".e-work-cells").getBoundingClientRect().width},i.prototype.renderHeader=function(){var e=t.createElement("tr");this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&this.parent.resourceBase.renderResourceHeaderIndent(e);var i=t.createElement("td");i.appendChild(this.renderDatesHeader()),e.appendChild(i),t.prepend([e],this.element.querySelector("tbody"))},i.prototype.createAllDayRow=function(e,t){},i.prototype.getCurrentTimeIndicatorIndex=function(){var e=[],t=this.parent.getIndexOfDate(this.renderDates,T(this.parent.getCurrentTime()));return t>=0&&e.push(t),e},i.prototype.renderContent=function(){var e=t.createElement("tr");if(this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive){var i=t.createElement("td");i.appendChild(this.parent.resourceBase.createResourceColumn()),e.appendChild(i)}var n=t.createElement("td"),r=this.renderContentArea();r.appendChild(this.createEventTable(this.getRowCount())),this.collapseRows(r),n.appendChild(r),e.appendChild(n),this.parent.virtualScrollModule&&this.parent.virtualScrollModule.renderVirtualTrack(r),this.element.querySelector("tbody").appendChild(e)},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[e],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(e){var i=e.querySelector("tbody");t.append(this.getContentRows(),i)},i.prototype.getContentRows=function(){for(var e=[],i=t.createElement("tr",{attrs:{role:"row"}}),n=t.createElement("td",{attrs:{role:"gridcell","aria-selected":"false"}}),r=this.getRowCount(),a=0;a<r;a++){for(var s=i.cloneNode(),o=0,l=this.colLevels[this.colLevels.length-1];o<l.length;o++){var c=l[o];this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&(c=this.getResourceTdData(a,c));var p=this.createContentTd(c,c,n);s.appendChild(p)}e.push(s)}return e},i.prototype.getContentTdClass=function(e){return e.first||!this.parent.activeViewOptions.timeScale.enable?["e-work-cells"]:["e-work-cells","e-alternate-cells"]},i.prototype.renderEvents=function(){if(this.parent.activeViewOptions.timeScale.enable)(e=new Mt(this.parent,"hour")).renderAppointments();else{var e=new Mt(this.parent,"day");e.renderAppointments()}this.parent.notify("events-loaded",{})},i.prototype.getModuleName=function(){return"timelineViews"},i}(Wi),dn=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])})(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)}}(),hn=function(e){function i(t){var i=e.call(this,t)||this;return i.viewClass="e-timeline-month-view",i.isInverseTableSelect=!0,i}return dn(i,e),i.prototype.getModuleName=function(){return"timelineMonth"},i.prototype.onDataReady=function(e){new Mt(this.parent,"day").renderAppointments(),this.parent.notify("events-loaded",{})},i.prototype.getLeftPanelElement=function(){return this.element.querySelector(".e-resource-column-wrap")},i.prototype.scrollTopPanel=function(t){e.prototype.scrollTopPanel.call(this,t),this.scrollHeaderLabels(t)},i.prototype.setContentHeight=function(e,i,n){i&&(i.style.height=t.formatUnit(n-this.getScrollXIndent(e))),e.style.height=t.formatUnit(n)},i.prototype.getDateSlots=function(e,t){for(var i=[],n=0,r=e;n<r.length;n++){var a=r[n],s=["e-header-cells"];this.isCurrentDate(a)&&s.push("e-current-day"),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 e=t.createElement("tr");if(this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive){var i=t.createElement("td");i.appendChild(this.parent.resourceBase.createResourceColumn()),e.appendChild(i)}var n=t.createElement("td");this.element.querySelector("tbody").appendChild(e);var r=t.createElement("div",{className:"e-content-wrap"});r.appendChild(this.renderContentArea()),r.appendChild(this.createEventTable(this.getRowCount())),this.collapseRows(r),t.EventHandler.add(r,"scroll",this.onContentScroll,this),n.appendChild(r),this.parent.virtualScrollModule&&this.parent.virtualScrollModule.renderVirtualTrack(r),e.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-work-cells"],this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive){var a=this.parent.resourceBase.renderedResources[t];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[t]||(e[t]=[]),e[t].push(s)}return e},i.prototype.updateClassList=function(e){this.parent.isMinMaxDate(e.date)||e.className.push("e-disable-dates")},i.prototype.unwireEvents=function(){t.EventHandler.remove(this.getContentAreaElement(),"scroll",this.onContentScroll)},i.prototype.getMonthStart=function(e){var t=this.parent.calendarUtil.firstDateOfMonth(T(e));return new Date(t.getFullYear(),t.getMonth(),t.getDate())},i.prototype.getMonthEnd=function(e){var t=this.parent.calendarUtil.firstDateOfMonth(T(e));return this.parent.calendarUtil.lastDateOfMonth(C(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);var i=[];return this.parent.activeViewOptions.headerRows.length>0&&(e=new ln(this.parent,this.renderDates).generateColumnLevels(t,i)),this.colLevels=e,e},i}(Zi),un=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])})(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)}}(),vn=function(e){function i(t){var i=e.call(this,t)||this;return i.viewClass="e-timeline-year-view",i.isInverseTableSelect=!0,i}return un(i,e),i.prototype.getModuleName=function(){return"timelineYear"},i.prototype.renderHeader=function(e){var i=t.createElement("tr");if(e.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=t.createElement("td",{className:"e-left-indent"});i.appendChild(n),n.appendChild(this.renderResourceHeader("e-left-indent-wrap"))}var r=t.createElement("td");i.appendChild(r);var a=t.createElement("div",{className:"e-date-header-container"});if(r.appendChild(a),"Horizontal"===this.parent.activeViewOptions.orientation&&this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive)a.appendChild(this.renderResourceHeader("e-date-header-wrap")),this.columnCount=this.colLevels.slice(-1)[0].length;else{var s=t.createElement("div",{className:"e-date-header-wrap"});a.appendChild(s);var o=this.createTableLayout();s.appendChild(o),o.appendChild(this.createTableColGroup(this.columnCount));var l=t.createElement("tr");o.querySelector("tbody").appendChild(l);for(var c=0;c<this.columnCount;c++){var p=t.createElement("td",{className:"e-header-cells"});if("Horizontal"===this.parent.activeViewOptions.orientation)p.innerHTML="<span>"+this.parent.getDayNames("abbreviated")[c%7]+"</span>";else{var d=new Date(this.parent.selectedDate.getFullYear(),c,1);p.innerHTML="<span>"+this.getMonthName(d)+"</span>",p.setAttribute("data-date",d.getTime().toString())}l.appendChild(p),this.parent.trigger(je,{elementType:"headerCells",element:p})}}},i.prototype.renderResourceHeader=function(e){var i=t.createElement("div",{className:e}),n=this.createTableLayout();i.appendChild(n);var r=t.createElement("tr");if(this.parent.activeViewOptions.group.resources.length>0)this.colLevels=this.generateColumnLevels();else{var a=[{className:["e-header-cells"],type:"headerCell"}];this.colLevels=[a]}for(var s=0,o=this.colLevels;s<o.length;s++){for(var l=o[s],c=r.cloneNode(),p=0,d="e-date-header-wrap"===e?l:[l[0]];p<d.length;p++){var h=d[p],u=t.createElement("td");h.className&&t.addClass([u],h.className),"e-date-header-wrap"===e&&(h.template&&t.append(h.template,u),h.colSpan&&u.setAttribute("colspan",h.colSpan.toString()),this.setResourceHeaderContent(u,h));var v={elementType:h.type,element:u,date:h.date,groupIndex:h.groupIndex};this.parent.trigger(je,v),c.appendChild(u)}n.querySelector("tbody").appendChild(c)}return"e-date-header-wrap"===e&&n.appendChild(this.createTableColGroup(this.colLevels.slice(-1)[0].length)),i},i.prototype.renderContent=function(e){var i=t.createElement("tr");e.appendChild(i);var n,r=t.createElement("td"),a=t.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.lastResourceLevel.length;else{s.push(r);var o=t.createElement("div",{className:"e-month-header-wrapper"});r.appendChild(o),o.appendChild(this.createTableLayout()),n=o.querySelector("tbody")}s.push(a),t.append(s,i);var l=t.createElement("div",{className:"e-content-wrap"});a.appendChild(l);var c=this.createTableLayout(Ye);l.appendChild(c);var p=t.createElement("div",{className:"e-event-table"});l.appendChild(p);var d=c.querySelector("tbody");if(this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive){this.parent.rowAutoHeight&&t.addClass([c],"e-auto-height");var h="Horizontal"===this.parent.activeViewOptions.orientation?this.colLevels.slice(-1)[0].length:12;c.appendChild(this.createTableColGroup(h)),this.renderResourceContent(p,n,d)}else c.appendChild(this.createTableColGroup(this.columnCount)),this.renderDefaultContent(p,n,d)},i.prototype.renderDefaultContent=function(e,i,n){for(var r=0;r<this.rowCount;r++){e.appendChild(t.createElement("div",{className:Xe}));var a=new Date(this.parent.selectedDate.getFullYear(),r,1),s=this.parent.calendarUtil.getMonthStartDate(new Date(a.getTime())),o=this.parent.calendarUtil.getMonthEndDate(new Date(a.getTime())),l=t.createElement("tr",{attrs:{role:"row"}}),c=l.cloneNode();i.appendChild(c);var p=l.cloneNode();n.appendChild(p);var d=t.createElement("td",{className:"e-month-header",attrs:{role:"gridcell"}});"Horizontal"===this.parent.activeViewOptions.orientation?(d.setAttribute("data-date",a.getTime().toString()),d.innerHTML="<span>"+this.getMonthName(a)+"</span>"):d.innerHTML="<span>"+this.parent.getDayNames("abbreviated")[r%7]+"</span>",c.appendChild(d),this.parent.trigger(je,{elementType:"leftHeaderCells",element:d});for(var h=new Date(s.getTime()),u=0;u<this.columnCount;u++){var v=void 0;if("Vertical"===this.parent.activeViewOptions.orientation){a=new Date(this.parent.selectedDate.getFullYear(),u,1),s=this.parent.calendarUtil.getMonthStartDate(new Date(a.getTime())),o=this.parent.calendarUtil.getMonthEndDate(new Date(a.getTime()));var m=r-s.getDay()+1;h=new Date(this.parent.selectedDate.getFullYear(),u,m),v=m>0&&h.getTime()<o.getTime()}else v=u>=s.getDay()&&h.getTime()<o.getTime();var g=t.createElement("td",{className:"e-work-cells",attrs:{role:"gridcell","aria-selected":"false"}});p.appendChild(g);var f=t.createElement("div",{className:"e-date-header e-navigate",innerHTML:v?h.getDate().toString():""}),y=t.isBlazor()?"D":"full",T=this.parent.globalize.formatDate(h,{skeleton:y,calendar:this.parent.getCalendarMode()});if(f.setAttribute("aria-label",T),v){var w=[g],D=[];this.parent.activeViewOptions.workDays.indexOf(h.getDay())>-1&&D.push("e-work-days"),this.isCurrentDate(h)&&(D.push("e-current-day"),"Horizontal"===this.parent.activeViewOptions.orientation?w.push(this.element.querySelector(".e-header-cells:nth-child("+(u+1)+")")):w.push(this.element.querySelectorAll(".e-month-header").item(r))),D.length>0&&t.addClass(w,D)}else t.addClass([g],"e-other-month");g.appendChild(f),v&&(g.setAttribute("data-date",h.getTime().toString()),this.wireEvents(g,"cell"),"Horizontal"===this.parent.activeViewOptions.orientation&&(h=b(new Date(h.getTime()),1))),this.renderCellTemplate({date:h,type:"workCells"},g),this.parent.trigger(je,{elementType:"workCells",element:g,date:h})}}},i.prototype.renderResourceContent=function(e,i,n){for(var r=0;r<this.rowCount;r++){e.appendChild(t.createElement("div",{className:Xe}));var a=t.createElement("tr",{attrs:{role:"row"}});n.appendChild(a);var s=void 0;this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&(s=this.parent.resourceBase.lastResourceLevel[r]);var o=new Date(this.parent.selectedDate.getFullYear(),r,1),l=this.parent.calendarUtil.getMonthStartDate(new Date(o.getTime()));if("Horizontal"===this.parent.activeViewOptions.orientation){var c=a.cloneNode();i.appendChild(c);var p=t.createElement("td",{className:"e-month-header",innerHTML:"<span>"+this.getMonthName(o)+"</span>",attrs:{role:"gridcell","data-date":l.getTime().toString()}});c.appendChild(p)}for(var d=0;d<this.columnCount;d++){var h=[],u=r;"Vertical"===this.parent.activeViewOptions.orientation?((h=h.concat(s.className)).indexOf("e-parent-node")>-1?h.push("e-resource-group-cells"):h.push("e-work-days"),o=new Date(this.parent.selectedDate.getFullYear(),d,1),l=this.parent.calendarUtil.getMonthStartDate(new Date(o.getTime()))):(u=this.colLevels.slice(-1)[0][d].groupIndex,h.push("e-work-days"));var v=t.createElement("td",{className:"e-work-cells",attrs:{role:"gridcell","aria-selected":"false","data-date":l.getTime().toString()}});t.addClass([v],h),v.setAttribute("data-group-index",u.toString()),this.renderCellTemplate({date:l,type:"workCells",groupIndex:u},v),this.wireEvents(v,"cell"),a.appendChild(v),this.parent.trigger(je,{elementType:"workCells",element:v,date:l})}}"Vertical"===this.parent.activeViewOptions.orientation&&this.collapseRows(this.parent.element.querySelector(".e-content-wrap"))},i.prototype.renderCellTemplate=function(e,i){if(this.parent.activeViewOptions.cellTemplate){var n={date:H(e.date),type:e.type};e.groupIndex&&(n.groupIndex=e.groupIndex);var r=this.parent.element.id+"_"+this.parent.activeViewOptions.cellTemplateName+"cellTemplate",a=[].slice.call(this.parent.getCellTemplate()(n,this.parent,"cellTemplate",r,!1));t.append(a,i)}},i}(tn),mn=function(){function e(e){this.parent=e}return e.prototype.initializeCalendarExport=function(e,i){var n=this,r=i||t.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(),c=this.parent.eventFields;r.forEach(function(e){var i=n.parent.eventBase.generateGuid(),p=[];if(e[c.recurrenceID]&&(i=n.filterEvents(o,c.id,e[c.recurrenceID])[0].UID),!e[c.recurrenceID]&&e[c.recurrenceRule]&&e[c.recurrenceException]){var d=void 0,h=e[c.recurrenceException].split(",");n.filterEvents(r,c.recurrenceID,e[c.id]).forEach(function(e){p.push(ke(e[c.startTime]))}),d=h.filter(function(e){return-1===p.indexOf(e)}),e[c.recurrenceException]=d.length>0?d.join(",")+",":""}var u=e[c.startTimezone]||l,v=e[c.endTimezone]||l,m=["BEGIN:VEVENT","LOCATION:"+(e[c.location]||""),"SUMMARY:"+(e[c.subject]||""),"UID:"+i,"DESCRIPTION:"+(e[c.description]||""),"END:VEVENT"];if(e[c.isAllDay]?(m.splice(4,0,"DTEND;VALUE=DATE:"+n.convertDateToString(e[c.endTime],!0)),m.splice(4,0,"DTSTART;VALUE=DATE:"+n.convertDateToString(e[c.startTime],!0))):e[c.isAllDay]||e[c.recurrenceRule]?(m.splice(4,0,'DTEND;TZID="'+v+'":'+n.convertDateToString(e[c.endTime])),m.splice(4,0,'DTSTART;TZID="'+u+'":'+n.convertDateToString(e[c.startTime]))):(m.splice(4,0,"DTEND:"+n.convertDateToString(e[c.endTime])),m.splice(4,0,"DTSTART:"+n.convertDateToString(e[c.startTime]))),e[c.recurrenceRule]&&m.splice(4,0,"RRULE:"+e[c.recurrenceRule]),e[c.recurrenceException])for(var h=e[c.recurrenceException].split(","),g=0;g<h.length-1;g++)m.splice(5,0,"EXDATE:"+n.convertDateToString(N(h[g]),e[c.isAllDay]));e[c.recurrenceID]&&m.splice(4,0,'RECURRENCE-ID;TZID="'+u+'":'+n.convertDateToString(e[c.startTime],e[c.isAllDay]));var f=n.customFieldFilter(e,c);f.length>0&&f.forEach(function(t){return m.splice(4,0,t+":"+(e[t]||""))});var y=t.extend({},e);y.UID=i,o.push(y),s.push(m.join(a))});var p=["BEGIN:VCALENDAR","PRODID:-//Syncfusion Inc//Scheduler//EN","VERSION:2.0","CALSCALE:GREGORIAN","METHOD:PUBLISH","X-WR-CALNAME:"+(e||"Calendar"),"X-WR-TIMEZONE:"+l].join(a)+a+s.join(a)+a+"END:VCALENDAR";this.download(p,e)},e.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})},e.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},e.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})}},e.prototype.filterEvents=function(e,t,i){return e.filter(function(e){return e[t]===i})},e.prototype.getModuleName=function(){return"iCalendarExport"},e.prototype.destroy=function(){this.parent.isDestroyed||(this.parent=null)},e}(),gn=function(){function e(e){this.allDay=!1,this.parent=e}return e.prototype.initializeCalendarImport=function(e){var t=this;if(e&&e instanceof Blob){var i=new FileReader;i.onload=function(e){var n=i.result;t.iCalendarParser(n)},i.readAsText(e,"ISO-8859-8")}else e&&"string"==typeof e&&this.iCalendarParser(e)},e.prototype.iCalendarParser=function(e){var i=this,n=this.parent.eventFields,r=[],a=e.replace(new RegExp("\\r","g"),"").split("\n"),s=!1,o=null,l=this.parent.eventBase.getEventMaxID();a.forEach(function(e){var a,c,p;if(s||"BEGIN:VEVENT"!==e||(s=!0,o={}),s&&"END:VEVENT"===e&&(s=!1,r.push(o),o=null),s)if(a=e.indexOf(":"),c=e.substr(0,a).replace(/^\s\s*/,"").replace(/\s\s*$/,""),p=e.substr(a+1,e.length-(a+1)).replace(/^\s\s*/,"").replace(/\s\s*$/,""),-1!==e.indexOf("SUMMARY")&&(c="SUMMARY"),-1!==e.indexOf("DTSTART"))o[n.startTime]=i.dateParsing(e),o[n.isAllDay]=i.allDay,i.allDay=!1;else if(-1!==e.indexOf("DTEND"))o[n.endTime]=i.dateParsing(e);else if(-1!==e.indexOf("EXDATE"))p=ke(i.dateParsing(e)),o[n.recurrenceException]=t.isNullOrUndefined(o[n.recurrenceException])?p:o[n.recurrenceException]+","+p;else if(-1!==e.indexOf("RECURRENCE-ID"))p=ke(i.dateParsing(e)),o[n.recurrenceException]=p,o[n.recurrenceID]=p;else switch(c){case"BEGIN":break;case"UID":o.UID=p,o[n.id]=l++;break;case"SUMMARY":o[n.subject]=p;break;case"LOCATION":o[n.location]=p;break;case"DESCRIPTION":o[n.description]=p;break;case"RRULE":o[n.recurrenceRule]=p;break;default:o[c]=p}});var c=t.extend([],r,null,!0);this.parent.addEvent(this.processOccurrence(c))},e.prototype.processOccurrence=function(e){var i=[],n=this.parent.eventFields;return e.forEach(function(r){var a,s;r.hasOwnProperty(n.recurrenceID)||(a=r,s=r[n.id]);var o=e.filter(function(e){return e.UID===r.UID});if(o.length>1&&t.isNullOrUndefined(r[n.recurrenceID])){for(var l=0;l<o.length;l++)if(o[l].hasOwnProperty(n.recurrenceID)){var c=o[l][n.recurrenceID];o[l][n.recurrenceID]=s,o[l][n.recurrenceException]=null,a[n.recurrenceException]=t.isNullOrUndefined(a[n.recurrenceException])?c:a[n.recurrenceException]+","+c,i.push(o[l])}i.push(a)}else r.hasOwnProperty(n.recurrenceID)||i.push(r)}),i},e.prototype.getDateString=function(e){return(e=e||"").replace(/\\\,/g,",").replace(/\\\;/g,";").replace(/\\[nN]/g,"\n").replace(/\\\\/g,"\\")},e.prototype.dateParsing=function(e){var t=e.match(/([^':;]+)((?:;(?:[^':;]+)(?:=(?:(?:'[^']*')|(?:[^':;]+))))*):(.*)/).slice(1),i=t[t.length-1],n=new Date(this.getDateString(i));if(e&&e.indexOf("VALUE=DATE")>-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},e.prototype.getModuleName=function(){return"iCalendarImport"},e.prototype.destroy=function(){this.parent.isDestroyed},e}(),fn=function(){function e(e){this.parent=e}return e.prototype.initializeExcelExport=function(e){var t,i=this,n=e.fields||Object.keys(this.parent.eventFields).map(function(e){return i.parent.eventFields[e]}),r=e.fileName||"Schedule",a=e.exportType||"xlsx",s=e.includeOccurrences||!1;t=e.customData?s?this.parent.eventBase.getProcessedEvents(e.customData):e.customData:s?this.parent.eventsProcessed:this.parent.eventsData,this.processWorkbook(n,r,a,t)},e.prototype.processWorkbook=function(e,i,n,r){var a=this,s=[],o=[],l=[];e.forEach(function(e,t){return s.push({index:t+1,width:"Id"===e?20:150})});var c={fontSize:12,borders:{color:"#E0E0E0"},bold:!0};e.forEach(function(e,t){return l.push({index:t+1,value:e,style:c})}),o.push({index:1,cells:l});for(var d=2,h=0,u=r;h<u.length;h++)!function(i){var n=[];e.forEach(function(e,r){var s={index:r+1,value:i[e]||""};if(e===a.parent.eventFields.startTime||e===a.parent.eventFields.endTime){var o={fontSize:12,numberFormat:"m/d/yyyy h:mm AM/PM"};s=t.extend({},s,{style:o},!0)}n.push(s)}),o.push({index:d,cells:n}),d++}(u[h]);var v=[{columns:s,rows:o}];new p.Workbook({worksheets:v},n,this.parent.locale).save(i+"."+n)},e.prototype.getModuleName=function(){return"excelExport"},e.prototype.destroy=function(){this.parent=null},e}(),yn=function(){function e(e){this.parent=e}return e.prototype.printScheduler=function(){var e=this.parent.element.cloneNode(!0);e.id=this.parent.element.id+"_print",document.body.appendChild(e);var t=this.getScrollableElement(this.parent.element);this.print(e,t.scrollTop,t.scrollLeft)},e.prototype.getScrollableElement=function(e){return"MonthAgenda"===this.parent.currentView?e.querySelector(".e-appointment-wrap"):e.querySelector(".e-content-wrap")},e.prototype.print=function(e,i,n){for(var r=this,a=[].slice.call(document.getElementsByTagName("head")[0].querySelectorAll("link, style")),s="",o=0,l=a.length;o<l;o++)s+=a[o].outerHTML;var c=t.createElement("div");e.style.width=this.parent.element.offsetWidth+"px";var p=100*Math.round(parseInt(e.style.width,10)/100);c.appendChild(e);var d=window.open("","print","height=550,width="+p+",tabbar=no");d.document.write("<!DOCTYPE html> <html><head>"+s+"</head><body>"+c.innerHTML+"<script> (function() { window.ready = true; })(); <\/script></body></html>"),d.document.close(),d.focus(),setTimeout(function(){d.ready&&(r.scrolledScheduler(d,i,n),d.print(),d.close())},500)},e.prototype.scrolledScheduler=function(e,t,i){var n=this.getScrollableElement(e.document.body);n.scrollLeft=i,n.scrollTop=t;var r=e.document.querySelector(".e-date-header-wrap");this.parent.activeView.isTimelineView()&&(r.scrollLeft=i),"Day"!==this.parent.currentView&&"Week"!==this.parent.currentView&&"WorkWeek"!==this.parent.currentView||(e.document.querySelector(".e-time-cells-wrap").scrollTop=t,r.scrollLeft=i),"Month"===this.parent.currentView&&(r.scrollLeft=i)},e.prototype.getModuleName=function(){return"print"},e.prototype.destroy=function(){this.parent=null},e}();return ji.Inject(_i,Gi,Xi,Zi,tn,an,on,pn,hn,vn,Li,Ni,fn,mn,gn,yn),e.Schedule=ji,e.cellClick="cellClick",e.cellDoubleClick="cellDoubleClick",e.moreEventsClick="moreEventsClick",e.select="select",e.hover="hover",e.actionBegin=He,e.actionComplete="actionComplete",e.actionFailure="actionFailure",e.navigating="navigating",e.renderCell=je,e.eventClick="eventClick",e.eventRendered="eventRendered",e.dataBinding="dataBinding",e.dataBound="dataBound",e.popupOpen="popupOpen",e.popupClose="popupClose",e.dragStart="dragStart",e.drag="drag",e.dragStop="dragStop",e.resizeStart="resizeStart",e.resizing="resizing",e.resizeStop="resizeStop",e.inlineClick=Ie,e.initialLoad="initial-load",e.initialEnd="initial-end",e.dataReady=qe,e.eventsLoaded="events-loaded",e.contentReady=Le,e.scroll="scroll",e.virtualScroll="virtual-scroll",e.scrollUiUpdate=Be,e.uiUpdate="ui-update",e.documentClick="document-click",e.cellMouseDown="cell-mouse-down",e.WEEK_LENGTH=7,e.MS_PER_DAY=Ne,e.MS_PER_MINUTE=Fe,e.getElementHeightFromClass=d,e.getTranslateY=h,e.getWeekFirstDate=u,e.getWeekLastDate=v,e.firstDateOfMonth=m,e.lastDateOfMonth=g,e.getWeekNumber=f,e.setTime=y,e.resetTime=T,e.getDateInMs=w,e.getDateCount=D,e.addDays=b,e.addMonths=C,e.addYears=E,e.getStartEndHours=O,e.getMaxDays=S,e.getDaysCount=x,e.getDateFromString=k,e.getScrollBarWidth=A,e.findIndexInData=V,e.getOuterHeight=M,e.removeChildren=R,e.isDaylightSavingTime=P,e.addLocalOffset=H,e.addLocalOffsetToEvent=j,e.capitalizeFirstWord=I,e.Resize=Li,e.DragAndDrop=Ni,e.HeaderRenderer=$e,e.ViewBase=Fi,e.Day=_i,e.Week=Gi,e.WorkWeek=Xi,e.Month=Zi,e.Year=tn,e.Agenda=an,e.MonthAgenda=on,e.TimelineViews=pn,e.TimelineMonth=hn,e.TimelineYear=vn,e.Timezone=st,e.timezoneData=ot,e.ICalendarExport=mn,e.ICalendarImport=gn,e.ExcelExport=fn,e.Print=yn,e.RecurrenceEditor=$t,e.generateSummary=q,e.generate=B,e.getDateFromRecurrenceDateString=N,e.extractObjectFromRule=fe,e.getCalendarUtil=xe,e.getRecurrenceStringFromDate=ke,e.Gregorian=rt,e.Islamic=at,e}({},ej.base,ej.popups,ej.navigations,ej.calendars,ej.data,ej.buttons,ej.inputs,ej.dropdowns,ej.lists,ej.excelexport),this.ejs=ej;
  //# sourceMappingURL=ej2-schedule.min.js.map
  