@progress/kendo-ui
Version:
This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.
1 lines • 88.8 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("kendo.dropdownlist.js"),require("kendo.editable.js"),require("kendo.multiselect.js"),require("kendo.window.js"),require("kendo.datetimepicker.js"),require("kendo.scheduler.recurrence.js"),require("kendo.scheduler.view.js"),require("kendo.scheduler.dayview.js"),require("kendo.scheduler.agendaview.js"),require("kendo.scheduler.monthview.js"),require("kendo.scheduler.timelineview.js"),require("kendo.scheduler.yearview.js"),require("kendo.dialog.js"),require("kendo.pane.js"),require("kendo.pdf.js"),require("kendo.switch.js"),require("kendo.toolbar.js"),require("kendo.html.button.js"),require("kendo.icons.js")):"function"==typeof define&&define.amd?define(["exports","kendo.dropdownlist.min","kendo.editable.min","kendo.multiselect.min","kendo.window.min","kendo.datetimepicker.min","kendo.scheduler.recurrence.min","kendo.scheduler.view.min","kendo.scheduler.dayview.min","kendo.scheduler.agendaview.min","kendo.scheduler.monthview.min","kendo.scheduler.timelineview.min","kendo.scheduler.yearview.min","kendo.dialog.min","kendo.pane.min","kendo.pdf.min","kendo.switch.min","kendo.toolbar.min","kendo.html.button.min","kendo.icons.min"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).kendo=e.kendo||{},e.kendo._globals=e.kendo._globals||{},e.kendo._globals.Scheduler={}))}(this,(function(e){!function(e,t){var i=window.kendo,n=i.date,a=n.MS_PER_DAY,r=n.getDate,o=i.date.getMilliseconds,s=i.recurrence,l=i.htmlEncode,d=i.keys,c=i.ui,u=c.Widget,p=c.DataBoundWidget,h="string",v=c.Popup,f=c.Calendar,m=i.data.DataSource,g=e.isPlainObject,_=e.extend,w=Object.prototype.toString,b=Array.isArray,k=".kendoScheduler",y="click",T="mousedown",z=i.support.pointers?"pointerdown":"touchstart",D=i.support.pointers?"pointermove":"touchmove",S=i.support.pointers?"pointerup":"touchend",x=i.support.mousemove,E="change",C="progress",R="error",V="cancel",M="remove",P="resetSeries",O="save",F="edit",H="disabled",A="k-focus",B=/(?:value:start|value:end)(?:,|$)/,I="(min-width: 1024px)",W=r(new Date),N=",",L=/\;/g,$="recurrenceException",q="Do you want to edit only this event occurrence or the whole series?",j=({className:e,attr:t,text:n,icon:a,fillMode:r,themeColor:o})=>i.html.renderButton(`<button type="button" class="${e}" ${t}>${n}</button>`,{icon:a,fillMode:r,themeColor:o}),U=i.template((({label:e,views:t,type:i})=>`<select aria-label="${e}" class="k-picker k-dropdown-list k-dropdown ${i}">`+Object.keys(t).map((e=>`<option value="${e}">${t[e].title}</option>`)).join("")+"</select>")),K={pdf:{name:"pdf",type:"button",icon:"file-pdf",attributes:{class:"k-pdf"}},pdfMobile:{name:"pdf",type:"button",icon:"file-pdf",showText:"overflow",attributes:{class:"k-pdf"}},today:{name:"today",type:"button",attributes:{"ref-nav-today":""}},previous:{name:"previous",type:"button",icon:"caret-alt-left",showText:"overflow",attributes:{"ref-nav-prev":""},groupClass:"k-scheduler-navigation"},next:{name:"next",type:"button",icon:"caret-alt-right",showText:"overflow",attributes:{"ref-nav-next":""},groupClass:"k-scheduler-navigation"},current:{name:"current",type:"button",icon:"calendar",fillMode:"flat",text:"placeholder",attributes:{"aria-live":"polite",class:"k-nav-current"}},search:{template:`<span class="k-scheduler-search k-textbox k-input k-input-md k-rounded-md k-input-solid"><input tabindex="-1" autocomplete="off" class="k-input-inner k-scheduler-search-input k-input-inner" /><span class="k-input-suffix">${i.ui.icon("search")}</span></span>`},refresh:{name:"refresh",type:"button",icon:"arrow-rotate-cw",showText:"overflow",attributes:{class:"k-scheduler-refresh"}},create:{name:"create",type:"button",icon:"plus",attributes:{class:"k-create-event"}},calendar:{name:"calendar",type:"button",icon:"calendar",attributes:{class:"k-nav-calendar"}},previousMobile:{name:"previous",type:"button",icon:"chevron-left",showText:"overflow",attributes:{"ref-nav-prev":""},groupClass:"k-scheduler-navigation"},nextMobile:{name:"next",type:"button",icon:"chevron-right",showText:"overflow",attributes:{"ref-nav-next":""},groupClass:"k-scheduler-navigation"},currentMobile:{template:'<span class="k-scheduler-navigation"><span class="k-nav-current"><span class="k-m-date-format"></span><span class="k-y-date-format"></span></span></span>'},view:{name:"view",type:"button",togglable:!0,group:"views"}},Y=[["today","previous","next"],"current",{type:"spacer"}],Q=[["calendar"],{type:"spacer"}],J=["previousMobile",{type:"spacer"},"currentMobile",{type:"spacer"},"nextMobile"];function X(e,t){return t=t||"",e.startTimezone&&(t=e.startTimezone,e.endTimezone&&(t+=" | "+e.endTimezone)),t}function G(e,t){var n=t.timezone;n&&(e[i.attr("timezone")]=n)}function Z(e,t){var n=t.model.fields[t.field].validation;if(n){var a=n.validDateValidator;a&&g(a)&&a.message&&(e[i.attr("validDate-msg")]=a.message)}}function ee(e,t){var n=t.model.fields[t.field].validation;if(n){var a=n.dateCompare;a&&g(a)&&a.message&&(e[i.attr("dateCompare-msg")]=a.message)}}function te(e,t,n,a){var r,o,s,l,d;for(o=0,s=(e=e||[]).length;o<s;o++)l=(r=e[o]).start?r.start.getTimezoneOffset():null,d=r.start?r.end.getTimezoneOffset():null,a?r.startTimezone||r.endTimezone?n?(r.start=i.timezone.convert(r.start,r.startTimezone||r.endTimezone,n),r.end=i.timezone.convert(r.end,r.endTimezone||r.startTimezone,n),r.start=i.timezone[t](r.start,n),r.end=i.timezone[t](r.end,n)):(r.start=i.timezone[t](r.start,r.startTimezone||r.endTimezone),r.end=i.timezone[t](r.end,r.endTimezone||r.startTimezone)):n&&(r.start=i.timezone[t](r.start,n),r.end=i.timezone[t](r.end,n)):r.startTimezone||r.endTimezone?(r.start=i.timezone[t](r.start,r.startTimezone||r.endTimezone),r.end=i.timezone[t](r.end,r.endTimezone||r.startTimezone),n&&(r.start=i.timezone.convert(r.start,r.startTimezone||r.endTimezone,n),r.end=i.timezone.convert(r.end,r.endTimezone||r.startTimezone,n))):n&&(r.start=i.timezone[t](r.start,n),r.end=i.timezone[t](r.end,n)),a&&delete r.uid,"remove"===t&&r.start&&l&&l!==r.start.getTimezoneOffset()&&(r.start=new Date(r.start.getTime()+6e4*(l-r.start.getTimezoneOffset()))),"remove"===t&&r.end&&d&&d!==r.end.getTimezoneOffset()&&(r.end=new Date(r.end.getTime()+6e4*(d-r.end.getTimezoneOffset())));return e}function ie(e,t){for(var i,n=e.length,a=0;a<n;a++)if((i=e[a]).uid===t)return i}var ne=i.Class.extend({init:function(e,t){var n=e.timezone;this.reader=t,t.model&&(this.model=t.model),this.timezone=n,this.data=function(e,t){return function(i){return te(i=e(i),"apply",t),i||[]}}(this.data.bind(this),n),this.serialize=function(e,t){return function(n){return n&&("[object Array]"===w.call(n)||n instanceof i.data.ObservableArray||(n=[n])),te(n,"remove",t,!0),(n=e(n))||[]}}(this.serialize.bind(this),n)},errors:function(e){return this.reader.errors(e)},parse:function(e){return this.reader.parse(e)},data:function(e){return this.reader.data(e)},total:function(e){return this.reader.total(e)},groups:function(e){return this.reader.groups(e)},aggregates:function(e){return this.reader.aggregates(e)},serialize:function(e){return this.reader.serialize(e)}});function ae(e,t,n){return e=n?i.timezone.convert(e,t,n):i.timezone.remove(e,t)}function re(e){if(e.filter("[name=start]").length&&e.filter("[title=Start]").length||e.filter("[name=end]").length&&e.filter("[title=End]").length||e.filter(".k-recur-until").length){var t=i.widgetInstance(e,i.ui);return t?!!i.parseDate(e.val(),t.options.format)&&t.value():!!i.parseDate(e.val())}return!0}var oe=i.data.Model.define({init:function(e){var t=this;i.data.Model.fn.init.call(t,e),t._defaultId=t.defaults[t.idField]},_time:function(e){var t=this[e],n="_"+e+"Time";return this[n]?this[n]-i.date.toUtcTime(i.date.getDate(t)):o(t)},_date:function(e){var t="_"+e+"Time";return this[t]?this[t]-this._time(e):i.date.getDate(this[e])},clone:function(t,i){var n=this.uid,a=new this.constructor(e.extend({},this.toJSON(),t));return i||(a.uid=n),a},duration:function(){var e=this.end,t=this.start,n=(e.getTimezoneOffset()-t.getTimezoneOffset())*i.date.MS_PER_MINUTE;return e-t-n},expand:function(e,t,i){return s?s.expand(this,e,t,i):[this]},update:function(e){for(var t in e)this.set(t,e[t]);this._startTime&&this.set("_startTime",i.date.toUtcTime(this.start)),this._endTime&&this.set("_endTime",i.date.toUtcTime(this.end))},isMultiDay:function(){return this.isAllDay||this.duration()>=i.date.MS_PER_DAY},isException:function(){return!this.isNew()&&this.recurrenceId},isOccurrence:function(){return this.isNew()&&this.recurrenceId},isRecurring:function(){return!(!this.recurrenceRule&&!this.recurrenceId)},isRecurrenceHead:function(){return!(!this.id||!this.recurrenceRule)},toOccurrence:function(t){return(t=e.extend(t,{recurrenceException:null,recurrenceRule:null,recurrenceId:this.id||this.recurrenceId}))[this.idField]=this.defaults[this.idField],this.clone(t,!0)},toJSON:function(){var e=i.data.Model.fn.toJSON.call(this);return e.uid=this.uid,delete e._startTime,delete e._endTime,e},shouldSerialize:function(e){return i.data.Model.fn.shouldSerialize.call(this,e)&&"_defaultId"!==e},set:function(e,t){var n=this.isAllDay||!1;if(i.data.Model.fn.set.call(this,e,t),"isAllDay"==e&&t!=n){var r=i.date.getDate(this.start),o=new Date(this.end),s=i.date.getMilliseconds(o);0===s&&t&&(s=a),this.set("start",r),!0===t?(i.date.setTime(o,-s),o<r&&(o=r)):i.date.setTime(o,a-s),this.set("end",o)}},id:"id",fields:{id:{type:"number"},title:{defaultValue:"",type:"string"},start:{type:"date",validation:{required:!0,validDate:{value:re}}},startTimezone:{type:"string"},end:{type:"date",validation:{required:!0,validDate:{value:re},dateCompare:{value:function(e){if(e.filter("[name=end]").length){var t=e.closest(".k-scheduler-edit-form"),n=t.find("[name=start]:visible"),a=t.find("[name=end]:visible");if(a[0]&&n[0]){var r,o,s=i.widgetInstance(n,i.ui),l=i.widgetInstance(a,i.ui),d=t.data("kendoEditable"),c=d?d.options.model:null;if(s&&l?(r=s.value(),o=l.value()):(r=i.parseDate(n.val()),o=i.parseDate(a.val())),r&&o){if(c){var u=n.attr(i.attr("timezone")),p=c.startTimezone,h=c.endTimezone;p=p||h,h=h||p,p&&(r=ae(r,p,u),o=ae(o,h,u))}return r<=o}}}return!0}}}},endTimezone:{type:"string"},recurrenceRule:{defaultValue:"",type:"string",validation:{validDate:{value:re},untilDateCompare:{value:function(e){var t,n,a,r;return!(e.filter(".k-recur-until").length&&(t=i.widgetInstance(e,i.ui).value(),(n=e.closest(".k-scheduler-edit-form").find("[name=start]:visible"))[0]&&(a=(r=i.widgetInstance(n,i.ui))?r.value():i.parseDate(n.val()))&&t))||a<=t}}}},recurrenceException:{defaultValue:"",type:"string"},isAllDay:{type:"boolean",defaultValue:!1},description:{type:"string"}}}),se=m.extend({init:function(e){m.fn.init.call(this,_(!0,{},{schema:{modelBase:oe,model:oe}},e)),this.reader=new ne(this.options.schema,this.reader)},expand:function(e,t){var n,r=this.view(),o={};return e&&t&&(n=t.getTimezoneOffset(),(t=new Date(t.getTime()+a-1)).getTimezoneOffset()!==n&&(t=i.timezone.apply(t,n)),o={logic:"or",filters:[{logic:"and",filters:[{field:"start",operator:"gte",value:e},{field:"end",operator:"gte",value:e},{field:"start",operator:"lte",value:t}]},{logic:"and",filters:[{field:"start",operator:"lte",value:new Date(e.getTime()+a-1)},{field:"end",operator:"gte",value:e}]}]},r=new i.data.Query(function(e,t,i,n){for(var a=e.length,r=[],o=0;o<a;o++)r=r.concat(e[o].expand(t,i,n));return r}(r,e,t,this.reader.timezone)).filter(o).toArray()),r},cancelChanges:function(e){e&&e.isOccurrence()&&this._removeExceptionDate(e),m.fn.cancelChanges.call(this,e)},insert:function(e,t){if(t){if(!(t instanceof oe)){var i=t;(t=this._createNewModel()).accept(i)}return(!this._pushCreated&&t.isRecurrenceHead()||t.recurrenceId)&&(t=t.recurrenceId?t:t.toOccurrence(),this._addExceptionDate(t)),m.fn.insert.call(this,e,t)}},pushCreate:function(e){this._pushCreated=!0,m.fn.pushCreate.call(this,e),this._pushCreated=!1},remove:function(e){return e.isRecurrenceHead()?this._removeExceptions(e):e.isRecurring()&&this._addExceptionDate(e),m.fn.remove.call(this,e)},_removeExceptions:function(e){for(var t=this.data().slice(0),i=t.shift(),n=e.id;i;)i.recurrenceId===n&&m.fn.remove.call(this,i),i=t.shift();e.set($,"")},_removeExceptionDate:function(e){if(e.recurrenceId){var t=this.get(e.recurrenceId);if(t){var i=e.defaults.start,n=new RegExp("(\\,?)"+s.toExceptionString(i,this.reader.timezone)),a=(t.recurrenceException||"").replace(L,N).replace(/\,$/,"");n.test(a)||(i=e.start,n=new RegExp("(\\,?)"+s.toExceptionString(i,this.reader.timezone))),t.set($,a.replace(n,""))}}},_addExceptionDate:function(e){var t=e.start,i=this.reader.timezone,n=this.get(e.recurrenceId),a=(n.recurrenceException||"").replace(L,N).replace(/\,$/,"");if(!s.isException(a,t,i)){var r=s.toExceptionString(t,i);e.defaults.start=t,n.set($,a+(a&&r?N:"")+r)}}});se.create=function(e){(b(e)||e instanceof i.data.ObservableArray)&&(e={data:e});var t=e||{},n=t.data;if(t.data=n,!(t instanceof se)&&t instanceof i.data.DataSource)throw new Error("Incorrect DataSource type. Only SchedulerDataSource instances are supported");return t instanceof se?t:new se(t)},_(!0,i.data,{SchedulerDataSource:se,SchedulerDataReader:ne,SchedulerEvent:oe});var le={update:{text:"Save",className:"k-button-solid-primary k-scheduler-update"},canceledit:{text:"Cancel",className:"k-scheduler-cancel"},destroy:{text:"Delete",icon:"trash",imageClass:"k-i-trash",className:"k-button-solid-primary k-scheduler-delete",iconClass:"k-icon"}};function de(t){var i=ce(t.model,t.field);return function(t,n){e('<textarea name="description" class="k-input-inner" title="'+n.title+'"/>').attr(i).appendTo(t).wrap('<span class="k-input k-textarea k-input-solid k-input-md k-rounded-md"></span>')}}function ce(t,n){var a,r,o=(t.fields||t)[n],s=["url","email","number","date","boolean"],l=o?o.validation:{},d=i.attr("type"),c=e.inArray,u={};for(a in l)r=l[a],c(a,s)>=0?u[d]=a:i.isFunction(r)||(u[a]=g(r)?r.value||a:r),u[i.attr(a+"-msg")]=r.message;return u}function ue(e,i,n,a){var r,o=e.value(),s=Array.isArray(o);r=s?JSON.parse(JSON.stringify(o)):[o.toString()],e.dataSource.data().forEach((function(o){if(null===o[n]||o[n]===t||o[n]==i)o.set(H,!1);else{var l=o.get(a);o.set(H,!0),(r.indexOf(l)>=0||r.indexOf(l.toString())>=0)&&(s?r.splice(r.indexOf(l),1):(e.value(null),e.trigger(E)))}})),s&&r.length<o.length&&(e.value(r),e.trigger(E))}function pe(e,t,n,a){var r=e.closest(".k-edit-form-container").find("[data-"+i.ns+"bind='value:"+a+"']"),o=r.getKendoDropDownList();o?o.bind(E,(function(e){var i=e.sender.value();ue(t,i,n.dataParentValueField,n.dataValueField)})):r.on(E,(function(e){var i=e.target.value;ue(t,i,n.dataParentValueField,n.dataValueField)}))}function he(e,n,a){var r,o=n.find("option"),s=n.val(),l=Array.isArray(s);r=l?JSON.parse(JSON.stringify(s)):[s],e.dataSource.view().forEach((function(s,d){var c=i.getter(e.dataParentValueField)(s);if(null===c||c===t||c==a)o[d].removeAttribute(H);else{o[d].setAttribute(H,H);var u=""+s.get(e.dataValueField);r.indexOf(u)>=0&&(l?r.splice(r.indexOf(u),1):(n.val(null),n.trigger(E)))}})),l&&r.length<s.length&&(n.val(r),n.trigger(E))}function ve(e,t){var n=e.end.getTime()-e.start.getTime(),a=new Date(e.start.getTime());i.date.setTime(a,t);var r=new Date(a.getTime());return i.date.setTime(r,n,!0),{start:a,end:r}}var fe={mobile:{dateRange:function(t,n){var a={name:n.field,title:n.title},r=n.model.isAllDay,o=i.attr("validate")+"='"+!r+"'",s=i.attr("validate")+"='"+!!r+"'";G(a,n),Z(a,n),ee(a,n),e('<input type="datetime-local" required '+i.attr("type")+'="datetime-local" '+i.attr("bind")+'="value:'+n.field+', invisible:isAllDay" '+o+"/>").attr(a).appendTo(t),e('<input type="date" required '+i.attr("type")+'="date" '+i.attr("bind")+'="value:'+n.field+',visible:isAllDay" '+s+"/>").attr(a).appendTo(t),e("<span "+i.attr("for")+'="'+n.field+'" class="k-invalid-msg"/>').hide().appendTo(t)},timezonePopUp:function(t,n){var a=X(n.model,n.messages.noTimezone);e('<span class="k-timezone-label"></span>').text(a).appendTo(t),e(i.ui.icon("arrow-chevron-right")).appendTo(t),t.closest("li.k-item label").on(y,n.click)},timezone:function(t,n){e('<div class="k-mobiletimezoneeditor" '+i.attr("bind")+'="value:'+n.field+'" />').attr({name:n.field}).appendTo(t).kendoMobileTimezoneEditor({optionLabel:n.noTimezone})},recurrence:function(t,n){e("<div "+i.attr("bind")+'="value:'+n.field+'" />').attr({name:n.field}).appendTo(t).kendoMobileRecurrenceEditor({start:n.model.start,timezone:n.timezone,messages:n.messages,pane:n.pane,value:n.model[n.field]})},description:de,multipleResources:function(t,n,a){var r=ce(n,t.field);return function(o){for(var s="",l=t.dataSource.view(),d=0,c=l.length;d<c;d++)s+=i.format('<option value="{0}">{1}</option>',i.getter(t.dataValueField)(l[d]),i.getter(t.dataTextField)(l[d]));var u=e(i.format('<select aria-labelledby="'+t.field+'_label" data-{0}bind="value:{1}" multiple="multiple">{2}</select>',i.ns,t.field,s)).appendTo(o).attr(r);a&&setTimeout((function(){var e=o.closest(".k-stretched-view").find("[data-"+i.ns+"bind='value:"+a+"']"),r=n[a];he(t,u,r),e.on(E,(function(e){var i=e.target.value;he(t,u,i)}))}))}},resources:function(t,n,a){var r=ce(n,t.field);return function(o){for(var s="",l=t.dataSource.view(),d=0,c=l.length;d<c;d++)s+=i.format('<option value="{0}">{1}</option>',i.getter(t.dataValueField)(l[d]),i.getter(t.dataTextField)(l[d]));var u=e(i.format('<select aria-labelledby="'+t.field+'_label" data-{0}bind="value:{1}">{2}</select>',i.ns,t.field,s)).appendTo(o).attr(r);a&&setTimeout((function(){var e=o.closest(".k-stretched-view").find("[data-"+i.ns+"bind='value:"+a+"']"),r=n[a];he(t,u,r),e.on(E,(function(e){var i=e.target.value;he(t,u,i)}))}))}},isAllDay:function(t,n){e('<input type="checkbox" data-role="switch"'+i.attr("bind")+'="value:'+n.field+'" />').appendTo(t)}},desktop:{dateRange:function(t,n){var a={name:n.field,title:n.title},r=n.model.isAllDay,o=i.attr("validate")+"='"+!r+"' ",s=i.attr("validate")+"='"+!!r+"' ";G(a,n),Z(a,n),ee(a,n),e('<input type="text" required '+i.attr("type")+'="date" '+i.attr("role")+'="datetimepicker" '+i.attr("bind")+'="value:'+n.field+',invisible:isAllDay" '+o+"/>").attr(a).appendTo(t),e('<input type="text" required '+i.attr("type")+'="date" '+i.attr("role")+'="datepicker" '+i.attr("bind")+'="value:'+n.field+',visible:isAllDay" '+s+"/>").attr(a).appendTo(t),e("<span "+i.attr("bind")+'="text: '+n.field+'Timezone"></span>').appendTo(t),"end"===n.field&&e("<span "+i.attr("bind")+'="text: startTimezone, invisible: endTimezone"></span>').appendTo(t),e("<span "+i.attr("for")+'="'+n.field+'" class="k-invalid-msg"/>').hide().appendTo(t)},timezonePopUp:function(t,i){e('<a href="#" class="k-button k-button-md k-rounded-md k-button-solid k-button-solid-base" data-bind="invisible:isAllDay"><span class="k-button-text">'+i.messages.timezoneEditorButton+"</span></a>").on(y,i.click).appendTo(t)},timezone:function(n,a){var r=a.visible||a.visible===t;e("<div "+i.attr("bind")+'="value:'+a.field+'" />').attr({name:a.field}).toggle(r).appendTo(n).kendoTimezoneEditor({optionLabel:a.noTimezone,title:a.title})},recurrence:function(t,n){e("<div "+i.attr("bind")+'="value:'+n.field+'" />').attr({name:n.field}).appendTo(t).kendoRecurrenceEditor({start:n.model.start,timezone:n.timezone,messages:n.messages})},description:de,multipleResources:function(t,n,a){var r=ce(n,t.field);return function(o){var s;a&&setTimeout((function(){ue(s,n[a],t.dataParentValueField,t.dataValueField),pe(o,s,t,a)})),s=e(i.format('<select aria-labelledby="'+t.field+'_label" data-{0}bind="value:{1}">',i.ns,t.field)).appendTo(o).attr(r).kendoMultiSelect({dataTextField:t.dataTextField,dataValueField:t.dataValueField,dataSource:t.dataSource.data(),valuePrimitive:t.valuePrimitive,itemTemplate:e=>`<span ${e.disabled?"data-disabled":""}><span class="k-scheduler-mark" ${i.attr("style-background-color")}="${e[t.dataColorField]||"none"}"></span>${e[t.dataTextField]}</span>`,tagTemplate:e=>`<span class="k-scheduler-mark" ${i.attr("style-background-color")}="${e[t.dataColorField]||"none"}"></span>${e[t.dataTextField]}`,select:function(e){e.dataItem&&e.dataItem.disabled&&e.preventDefault()},dataBound:function(e){let t=e.sender.list.find("li");for(let e=0;e<t.length;e++){let i=t.eq(e);i.find("[data-disabled]").length>0&&i.addClass("k-disabled")}}}).data("kendoMultiSelect")}},resources:function(t,n,a){var r=ce(n,t.field);return function(o){var s;a&&setTimeout((function(){ue(s,n[a],t.dataParentValueField,t.dataValueField),pe(o,s,t,a)})),s=e(i.format('<select aria-labelledby="'+t.field+'_label" data-{0}bind="value:{1}" title="'+n.title+'">',i.ns,t.field)).appendTo(o).attr(r).kendoDropDownList({dataTextField:t.dataTextField,dataValueField:t.dataValueField,dataSource:t.dataSource.data(),valuePrimitive:t.valuePrimitive,optionLabel:"None",template:e=>`<span ${e.disabled?"data-disabled":""}><span class="k-scheduler-mark" ${i.attr("style-background-color")}="${e[t.dataColorField]||"none"}"></span>${e[t.dataTextField]}</span>`,select:function(e){e.dataItem&&e.dataItem.disabled&&e.preventDefault()},dataBound:function(e){let t=e.sender.list.find("li");for(let e=0;e<t.length;e++){var i=t.eq(e);i.find("[data-disabled]").length>0&&i.addClass("k-disabled")}}}).data("kendoDropDownList")}},isAllDay:function(t,n){e('<input type="checkbox" data-role="checkbox"'+i.attr("bind")+'="value:'+n.field+'" data-label="'+n.title+'" />').attr({id:n.field,name:n.field,title:n.title?n.title:n.field}).appendTo(t)}}},me=i.Observable.extend({init:function(e,t){i.Observable.fn.init.call(this),this.element=e,this.options=_(!0,{},this.options,t),this.createButton=this.options.createButton,this.toggleDateValidationHandler=this._toggleDateValidation.bind(this)},_toggleDateValidation:function(t){if("isAllDay"==t.field){var n,a,r,o=this.container,s=this.editable.options.model.isAllDay,l=i.attr("bind");o.find("["+l+"*=end],["+l+"*=start]").each((function(){n=e(this),B.test(n.attr(l))&&(a=n.is("["+i.attr("role")+"=datetimepicker],[type*=datetime]"),r=s!==a,n.attr(i.attr("validate"),r.toString()))}))}},fields:function(e,t){var n=this,a=n.options.messages,r=n.options.timezone,o=[{field:"title",title:a.editor.title},{field:"start",title:a.editor.start,editor:e.dateRange,timezone:r},{field:"end",title:a.editor.end,editor:e.dateRange,timezone:r},{field:"isAllDay",title:a.editor.allDayEvent,editor:e.isAllDay}],s=function(e){return!!e[u.dataParentValueField]};i.timezone.windows_zones&&(o.push({field:"timezone",title:a.editor.timezone,editor:e.timezonePopUp,click:function(e){e.preventDefault(),n._initTimezoneEditor(t,this)},messages:a.editor,model:t}),o.push({field:"startTimezone",title:a.editor.startTimezone,editor:e.timezone,noTimezone:a.editor.noTimezone}),o.push({field:"endTimezone",title:a.editor.endTimezone,editor:e.timezone,noTimezone:a.editor.noTimezone})),t.recurrenceId||o.push({field:"recurrenceRule",title:a.editor.repeat,editor:e.recurrence,timezone:r,messages:a.recurrenceEditor,pane:this.pane}),"description"in t&&o.push({field:"description",title:a.editor.description,editor:e.description({model:t,field:"description"})});for(var l=0;l<this.options.resources.length;l++){var d,c,u=this.options.resources[l];u.dataSource.view().some(s)&&(d=this.options.resources[l-1])&&(c=d.field),o.push({field:u.field,title:u.title,editor:u.multiple?e.multipleResources(u,t,c):e.resources(u,t,c)})}return o},end:function(){return this.editable.end()},_buildDesktopEditTemplate:function(t,n,a){var r=this.options.messages;const o=`<div class="k-popup-edit-form k-scheduler-edit-form k-scheduler-timezones" ${i.attr("style-display")}="none"><div class="k-form"><div class="k-form-field"><div class="k-form-field-wrap">`+i.html.renderCheckBox(e('<input class="k-timezone-toggle"/>'),{label:r.editor.separateTimezones})+"</div></div>",s=e=>!t.editable||t.editable(e)?`<div ${i.attr("container-for")}="${e}" class="k-form-field-wrap"></div>`:`<div class="k-form-field-wrap">${e&&i.getter(e)(t)||""}</div>`;return'<div class="k-form">'+n.map((e=>{const i=e.field,n=e.title,r=t.fields[i];return(!t.editable||t.editable(i))&&a.push(e),("startTimezone"===i?o:"")+(r&&"boolean"===r.type?`<div class="k-form-field">${s(i)}</div>`:`<div class="k-form-field"><label class="k-label k-form-label" for="${i}" id="${i}_label">${n||i||""}</label>${s(i)}</div>`)+("endTimezone"===i?this._createEndTimezoneButton():"")})).join("")+"</div>"},_buildMobileEditTemplate:function(e,t,n){var a=this.options.messages;const r=`<div class="k-popup-edit-form k-scheduler-edit-form k-scheduler-timezones" ${i.attr("style-display")}="none"><ul class="k-listgroup k-listgroup-flush"><li class="k-item k-listgroup-item"><label class="k-label k-listgroup-form-row"><span class="k-item-title k-listgroup-form-row">`+l(a.editor.separateTimezones)+'</span><span class="k-listgroup-form-field-wrapper"><input class="k-timezone-toggle" data-role="switch" type="checkbox" /></span></label></li>';return'<ul class="k-listgroup k-listgroup-flush">'+t.map((t=>{const a=t.field;return(!e.editable||e.editable(a))&&n.push(t),("timezone"===a||"recurrenceRule"===a?'</ul><ul class="k-listgroup k-listgroup-flush">':"")+("startTimezone"===a?r:"")+(t=>{const n=t.field,a=t.title;let r;return r=!e.editable||e.editable(n)?("timezone"===n?'<label class="k-label k-listgroup-form-row" data-bind="css: { k-disabled: isAllDay }">':'<label class="k-label k-listgroup-form-row">')+`<span class="k-item-title k-listgroup-form-field-label">${a||n||""}</span>`+`<div class="k-listgroup-form-field-wrapper" ${i.attr("container-for")}="${n}"></div>`:`<li class="k-item k-listgroup-item"><label class="k-label k-no-click k-listgroup-form-row"><span class="k-item-title k-listgroup-form-field-label">${a||n||""}</span><span class="k-no-editor k-listgroup-form-field-wrapper">${n&&i.getter(n)(e)||""}</span>`,'<li class="k-item k-listgroup-item">'+r+"</label></li>"})(t)+("recurrenceRule"===a?'</ul><ul class="k-listgroup k-listgroup-flush">':"")+("endTimezone"===a?"</ul></div>":"")})).join("")+"</ul>"},_buildEditTemplate:function(e,t,n,a){var r=_({},i.Template,this.options.templateSettings),o=this.options.editable.template,s="";return o?(typeof o===h&&(o=i.unescape(o)),s+=i.template(o,r)(e)):s+=a?'<div data-role="content">'+this._buildMobileEditTemplate(e,t,n)+"</div>":this._buildDesktopEditTemplate(e,t,n),s},_createEndTimezoneButton:function(){return"</ul></div>"},_revertTimezones:function(e){e.set("startTimezone",this._startTimezone),e.set("endTimezone",this._endTimezone),delete this._startTimezone,delete this._endTimezone}}),ge=me.extend({init:function(){me.fn.init.apply(this,arguments),this.pane=i.Pane.wrap(this.element,{viewEngine:{viewOptions:{renderOnInit:!0,wrap:!1,wrapInSections:!0,detachOnHide:!1,detachOnDestroy:!1}}}),this.pane.element.parent().css("height",this.options.height),this.view=this.pane.view()},options:{animations:{left:"slide",right:"slide:right"}},destroy:function(){this.close(),this.unbind(),this.pane.destroy()},_initTimezoneEditor:function(t){var n=this,a=n.pane,r=n.options.messages,o=n.timezoneView,s=o?o.content.find(".k-scheduler-timezones"):n.container.find(".k-scheduler-timezones"),d=s.find("input.k-timezone-toggle").data("kendoSwitch"),c=s.find("li.k-item:not(.k-zonepicker)").last();if(n._startTimezone=t.startTimezone||"",n._endTimezone=t.endTimezone||"",!o){var u='<div data-role="view" class="k-popup-edit-form k-scheduler-edit-form"><div data-role="header" class="k-appbar k-appbar-primary">'+i.html.renderButton(`<button class="k-header-cancel k-scheduler-cancel" title="${r.cancel}" aria-label="${r.cancel}"></button>`,{fillMode:"flat",icon:"chevron-left"})+'<span class="k-spacer"></span>'+`<span>${l(r.editor.timezoneTitle)}</span><span class="k-spacer"></span>`+l(r.editor.timezoneTitle)+i.html.renderButton(`<button class="k-header-done k-scheduler-update" title="${r.save}" aria-label="${r.save}"></button>`,{fillMode:"flat",icon:"check"})+'</div><div data-role="content"></div>';this.timezoneView=o=a.append(u),o.contentElement.append(s.show()),o.element.on(y+k,".k-scheduler-cancel, .k-scheduler-update",(function(i){i.preventDefault(),i.stopPropagation(),e(this).hasClass("k-scheduler-cancel")&&n._revertTimezones(t);var o=n._editPane,s=X(t,r.editor.noTimezone);o.content.find(".k-timezone-label").text(s),a.navigate(o,n.options.animations.right)})),d.bind(E,(function(e){c.toggle(e.checked),t.set("endTimezone","")})),t.bind(E,(function(e){if("startTimezone"===e.field){var i=t.startTimezone;d.enable(i),i||(c.hide(),t.set("endTimezone",""),d.value(!1))}}))}d.value(!!t.endTimezone),d.enable(!!t.startTimezone),t.endTimezone?c.show():c.hide(),a.navigate(o,n.options.animations.left)},showDialog:function(t){var i=t.buttons.map((function(e){return{text:e.text,action:e.click}}));i.push({text:this.options.messages.cancel,primary:!0}),e("<div />").appendTo(document.body).kendoDialog({close:function(){this.destroy()},modal:{preventScroll:!0},closable:!1,title:!1,content:t.text,actions:i})},editEvent:function(t){var n=this.pane,a="",r=this.options.messages,o=r.save,s=r.destroy,d=r.cancel,c=r.editor.editorTitle,u=r.resetSeries;a+='<div data-role="view" class="k-popup-edit-form k-scheduler-edit-form"'+i.attr("uid")+'="'+t.uid+'"><div data-role="header" class="k-appbar k-appbar-primary">'+i.html.renderButton(`<button class="k-header-cancel k-scheduler-cancel" title="${d}" aria-label="${d}"></button>`,{fillMode:"flat",icon:"chevron-left"})+'<span class="k-spacer"></span>'+`<span>${l(c)}</span><span class="k-spacer"></span>`+i.html.renderButton(`<button class="k-header-done k-scheduler-update" title="${o}" aria-label="${o}"></button>`,{fillMode:"flat",icon:"check"})+"</div>";var p=this.fields(fe.mobile,t),h=this,v=[];a+=this._buildEditTemplate(t,p,v,!0),a+="</div>";var f=n.append(a);if(!t.isNew()&&this.options.editable&&!1!==this.options.editable.destroy&&t.isRecurrenceHead()&&t.recurrenceException){var m='<ul class="k-edit-buttons k-listgroup k-listgroup-flush"><li class="k-item k-listgroup-item"><span class="k-scheduler-resetSeries k-link k-label" aria-label="'+u+'">'+u+"</span></li></ul>";f.contentElement.append(m)}if(!t.isNew()&&this.options.editable&&!1!==this.options.editable.destroy){var g='<ul class="k-edit-buttons k-listgroup k-listgroup-flush"><li class="k-item k-listgroup-item"><span class="k-scheduler-delete k-link k-label" aria-label="'+s+'">'+s+"</span></li></ul>";f.contentElement.append(g)}this._editPane=f;var _=this.container=f.element;return this.editable=_.kendoEditable({fields:v,model:t,clearContainer:!1,target:h.options.target,validateOnBlur:!0}).data("kendoEditable"),this.trigger("edit",{container:_,model:t})?this.trigger("cancel",{container:_,model:t}):(_.on(y+k,"a.k-scheduler-edit, .k-scheduler-cancel, .k-scheduler-update, span.k-scheduler-delete, span.k-scheduler-resetSeries",(function(i){i.preventDefault(),i.stopPropagation();var a=e(this);if(a.hasClass("k-scheduler-edit"))n.navigate(this._editPane,h.options.animations.right);else{var r="cancel";a.hasClass("k-scheduler-update")?r="save":a.hasClass("k-scheduler-delete")?r="remove":a.hasClass("k-scheduler-resetSeries")&&(r=P),h.trigger(r,{container:_,model:t})}})),n.navigate(f,h.options.animations.left),t.bind(E,h.toggleDateValidationHandler)),this.editable},_views:function(){return this.pane.element.find(i.roleSelector("view")).not(this.view.element)},close:function(){if(this.container){this.pane.navigate("",this.options.animations.right);for(var e,t=this._views(),i=0,n=t.length;i<n;i++)(e=t.eq(i).data("kendoView"))&&e.purge();t.remove(),this.container=null,this.editable&&(this.editable.options.model.unbind(E,this.toggleDateValidationHandler),this.editable.destroy(),this.editable=null),this.timezoneView=null}}}),_e=me.extend({destroy:function(){this.close(),this.unbind()},editEvent:function(t){var n,a,r,o=this,s=o.options.editable,l="<div "+i.attr("uid")+'="'+t.uid+'" class="k-popup-edit-form k-scheduler-edit-form"><div class="k-edit-form-container">',d=o.options.messages,c=d.save,u=d.cancel,p=d.destroy,h=d.resetSeries,v=this.fields(fe.desktop,t),f=[];l+=this._buildEditTemplate(t,v,f,!1);var m=g(s)?s.window:{};l+='<div class="k-edit-buttons">',l+=this.createButton({name:"update",text:c,attr:r,icon:"save"})+this.createButton({name:"canceledit",text:u,attr:r,icon:"cancel-outline"}),!t.isNew()&&!1!==s.destroy&&t.isRecurrenceHead()&&t.recurrenceException&&(l+=this.createButton({name:"resetSeries",text:h,attr:r})),t.isNew()&&!t.isRecurring()||!1===s.destroy||(l+='<span class="k-spacer"></span>'+this.createButton({name:"delete",text:p,attr:r,icon:"trash",fillMode:"flat",themeColor:"primary"})),n=e(l+="</div></div></div>"),i.applyStylesFromKendoAttributes(n,["display"]);var w=this.container=n.appendTo(o.element).eq(0).kendoWindow(_({modal:!0,resizable:!1,draggable:!0,title:d.editor.editorTitle,visible:!1,close:function(e){e.userTriggered&&o.trigger(V,{container:w,model:t})&&e.preventDefault()}},m));for(var b in o.editable=w.kendoEditable({fields:f,model:t,clearContainer:!1,validateOnBlur:!0,target:o.options.target}).data("kendoEditable"),f)"recurrenceRule"!==f[b].field&&(a=f[b].field,w.find("[name='"+a+"']").attr("aria-labelledby",a+"_label")),"isAllDay"===f[b].field&&w.find("label[for='"+a+"']").attr("id",a+"_label");return o.trigger(F,{container:w,model:t})?o.trigger(V,{container:w,model:t}):(s.window&&s.window.position?w.data("kendoWindow").open():w.data("kendoWindow").center().open(),w.on(y+k,"button.k-scheduler-cancel",(function(e){e.preventDefault(),e.stopPropagation(),o.trigger(V,{container:w,model:t})})),w.on(y+k,"button.k-scheduler-update",(function(e){e.preventDefault(),e.stopPropagation(),o.trigger("save",{container:w,model:t})})),w.on(y+k,"button.k-scheduler-delete",(function(e){e.preventDefault(),e.stopPropagation(),o.trigger(M,{container:w,model:t})})),w.on(y+k,"button.k-scheduler-resetSeries",(function(e){e.preventDefault(),e.stopPropagation(),o.trigger(P,{container:w,model:t})})),i.cycleForm(w),t.bind(E,o.toggleDateValidationHandler)),o.editable},close:function(){var e=this,t=function(){e.editable&&(e.editable.options.model.unbind(E,e.toggleDateValidationHandler),e.editable.destroy(),e.editable=null,e.container=null),e.popup&&(e.popup.destroy(),e.popup=null)};e.editable?(e._timezonePopup&&e._timezonePopup.data("kendoWindow")&&(e._timezonePopup.data("kendoWindow").destroy(),e._timezonePopup=null),e.container.is(":visible")?e.container.data("kendoWindow").bind("deactivate",t).close():t()):t()},_createEndTimezoneButton:function(){var e=this.options.messages,t="";return t+='<div class="k-edit-buttons">',t+=this.createButton({name:"savetimezone",icon:"save",themeColor:"primary",text:e.save})+this.createButton({name:"canceltimezone",icon:"cancel-outline",text:e.cancel}),t+="</div></div></div>"},showDialog:function(t){var n=i.format("<div class='k-popup-edit-form'><div class='k-edit-form-container'><p class='k-popup-message'>{0}</p>",t.text);n+='<div class="k-edit-buttons">';for(var a=0;a<t.buttons.length;a++)n+=this.createButton(t.buttons[a]);n+="</div></div></div>";var r=this.element;this.popup&&this.popup.destroy();var o=this.popup=e(n).appendTo(r).eq(0).on(y,".k-button",(function(i){i.preventDefault(),o.close();var n=e(i.currentTarget).index();t.buttons[n].click()})).kendoWindow({modal:!0,resizable:!1,draggable:!1,title:t.title,visible:!1,close:function(){this.destroy(),r.trigger("focus")}}).getKendoWindow();o.center().open()},_initTimezoneEditor:function(e,t){var i,n=this,a=n.container.find(".k-scheduler-timezones"),r=a.find("input.k-timezone-toggle"),o=a.find(".k-form-field").last(),s=a.find(".k-scheduler-savetimezone"),l=a.find(".k-scheduler-canceltimezone"),d=n._timezonePopup,c=function(t){if("startTimezone"===t.field){var i=e.startTimezone;r.prop(H,!i),i||(o.hide(),e.set("endTimezone",""),r.prop("checked",!1))}};n._startTimezone=e.startTimezone,n._endTimezone=e.endTimezone,d||(n._timezonePopup=d=a.kendoWindow({modal:!0,resizable:!1,draggable:!0,title:n.options.messages.editor.timezoneEditorTitle,visible:!1,close:function(i){e.unbind(E,c),i.userTriggered&&n._revertTimezones(e),t&&t.focus()}}),r.on(y,(function(){o.toggle(r.prop("checked")),e.set("endTimezone","")})),s.on(y,(function(e){e.preventDefault(),i.close()})),l.on(y,(function(t){t.preventDefault(),n._revertTimezones(e),i.close()})),e.bind(E,c)),r.prop("checked",e.endTimezone).prop(H,!e.startTimezone),e.endTimezone?o.show():o.hide(),(i=d.data("kendoWindow")).center().open()}}),we=p.extend({init:function(t,n){var a=this;u.fn.init.call(a,t,n),a.options.views&&a.options.views.length||(a.options.views=["day","week"]),a.resources=[],a._initModel(),a._wrapper(),a.options.selectable&&a._tabindex(),a._views(),a._toolbar(),a._dataSource(),a._resources(),a._resizeHandler=function(){a.resize()},a.wrapper.on(T+k+" selectstart"+k,(function(t){var i=e(t.target);i.is(":kendoFocusable")||0!==i.closest(".k-button").length||t.preventDefault()})),a.options.editable&&!1!==a.options.editable.resize&&a._resizable(),a._movable(),a._bindResize(),a.options.messages&&a.options.messages.recurrence&&(s.options=a.options.messages.recurrence),a._navigation(),a._selectable(),a._touchHandlers(),a._ariaId=i.guid(),a._createEditor(),a.mediaQueryList=i.mediaQuery(I),a.mediaQueryList.onChange(a._onMediaChange.bind(a)),a.toolbar.find(".k-scheduler-views").children().removeClass("k-button-rectangle"),a._showWatermarkOverlay&&a._showWatermarkOverlay(a.element[0])},_onMediaChange:function(e){var t=this,i=t._selectedView,n=t.toolbar,a=n.getKendoToolBar();e.matches?(a.hide(n.find(".k-views-dropdown")),a.show(n.find(".k-views-dropdown").parent().next(".k-button-group"))):(a.show(n.find(".k-views-dropdown")),a.hide(n.find(".k-views-dropdown").parent().next(".k-button-group"))),t._model.set("formattedDate",e.matches?i.dateForTitle():i.shortDateForTitle())},_bindResize:function(){e(window).on("resize"+k,this._resizeHandler)},_unbindResize:function(){e(window).off("resize"+k,this._resizeHandler)},dataItems:function(){var i,n,a=this.items(),r=this._data,o=e.map(a,(function(t){return e(t).attr("data-uid")})),s={},l=o.length;for(i=0;i<l;i++)s[o[i]]=null;var d=r.length;for(i=0;i<d;i++){var c=r[i];s[c.uid]!==t&&(s[c.uid]=c)}var u=[];for(n in s)u.push(s[n]);return u},_isMobile:function(){var e=this.options;return!0===e.mobile&&i.support.mobileOS||"phone"===e.mobile||"tablet"===e.mobile},_isTouch:function(e){return/touch/.test(e.type)||e.originalEvent&&/touch/.test(e.originalEvent.pointerType)},_isInverseColor:function(e){return e.hasClass("k-event-inverse")},_groupsByResource:function(e,t,n,a,r){n||(n=[]);var o=e[0];if(o){for(var s,l=o.dataSource.view(),d=0,c=0;c<l.length;c++){var u=i.getter(o.dataValueField)(l[c]),p=t+d+c;(s=this._groupsByResource(e.slice(1),p,n,u,o.field))[o.field]=u,d=s.groupIndex,r&&a&&(s[r]=a),1===e.length&&(s.groupIndex=t+c,n.push(s))}return s}return{}},data:function(){return this._data},select:function(e){var n,a=this,o=a.view(),s=a._selection,l=o.groups;if(e===t){var d,c=o._selectedSlots;return s?(s&&s.events&&(d=a._selectedEvents()),{start:s.start,end:s.end,events:d,slots:c,resources:o._resourceBySlot(s)}):[]}if(!e)return a._selection=null,a._old=null,void o.clearSelection();if(Array.isArray(e)&&(e={events:e.splice(0)}),e.resources){var u,p=[],h=[];for(u in o.groupedResources&&a._groupsByResource(o.groupedResources,0,h),e.resources)p.push({field:u,operator:"eq",value:e.resources[u]});n=new i.data.Query(h).filter(p).toArray()}if(e.events&&e.events.length)return a._selectEvents(e.events,n),void a._select();if(l&&e.start&&e.end){var v,f,m=r(o._startDate),g=i.date.addDays(r(o._endDate),1);e.start<g&&m<=e.end&&((v=n&&n.length?l[n[0].groupIndex]:l[0]).timeSlotCollectionCount()||(e.isAllDay=!0),(f=v.ranges(e.start,e.end,e.isAllDay,!1)).length&&(a._selection={start:i.timezone.toLocalDate(f[0].start.start),end:i.timezone.toLocalDate(f[f.length-1].end.end),groupIndex:f[0].start.groupIndex,index:f[0].start.index,isAllDay:f[0].start.isDaySlot,events:[]},a._select()))}},_selectEvents:function(e,t){var n,a=this,r=a.view(),o=r.groups,s=e.length,l=t&&t.length,d=a._ctrlKey;for(a._ctrlKey=!0,n=0;n<s;n++)if(o&&l){for(var c=o[t[0].groupIndex],u=[],p=c.timeSlotCollectionCount(),h=c.daySlotCollectionCount(),v=0;v<p;v++)u=u.concat(c.getTimeSlotCollection(v).events());for(var f=0;f<h;f++)u=u.concat(c.getDaySlotCollection(f).events());(u=new i.data.Query(u).filter({field:e=>e.element[0].getAttribute("data-uid"),operator:"eq",value:e[n]}).toArray())[0]&&a._createSelection(u[0].element)}else{var m=r.element.find(i.format(".k-event[data-uid={0}], .k-task[data-uid={0}]",e[n]));m.length&&a._createSelection(m[0])}a._ctrlKey=d},_touchHandlers:function(){var e,t,n,a,r,o=this,s=o.wrapper,l=o._touchMove.bind(o);s.on(z+k,".k-scheduler-header-all-day td, .k-scheduler-content td, .k-event",(function(i){var n=o.wrapper.find(".k-scheduler-content");o._isTouch(i)&&(n.stop(!0,!1),o._touchPosX=e=o._tapPosition(i,"X"),o._touchPosY=t=o._tapPosition(i,"Y"),o._userTouched=!0,o.view()._scrolling=!1,r=Date.now(),s.on(D+k,".k-scheduler-header-all-day td, .k-scheduler-content td, .k-event",l))})),s.on("contextmenu"+k,".k-scheduler-header-all-day td, .k-scheduler-content td, .k-event",(function(e){o._preventFocus=!0})),s.on(S+k,".k-scheduler-header-all-day td, .k-scheduler-content td, .k-event",(function(d){if(o._isTouch(d)){var c=Date.now()-r,u=o.wrapper.find(".k-scheduler-content"),p=-o._amplitude*(3e3/c);n=o._tapPosition(d,"X"),a=o._tapPosition(d,"Y"),o._dragging||(o.options.selectable&&(Math.abs(n-e)<=10||Math.abs(a-t)<=10)&&o._mouseDownSelection(d),!i.support.kineticScrollNeeded&&c<200&&Math.abs(n-e)>10&&u.animate({scrollTop:u[0].scrollTop+p}),s.off(D+k,".k-scheduler-header-all-day td, .k-scheduler-content td",l))}}))},_navigation:function(){var e=this,t=e.wrapper;t.on("focus"+k,(function(){var i=e._selection;setTimeout((function(){e._preventFocus?e._preventFocus=!1:(i&&!(i.events.length>0&&0===t.find("[data-uid='"+i.events[0]+"']").length)||e._userTouched||e._mouseDown?e._mouseDown=!1:e._initialFocus(),e._select())}),300)})),t.on("focusout"+k,(function(){e._ctrlKey=e._shiftKey=!1})),t.on("keydown"+k,e._keydown.bind(e)),t.on("keyup"+k,(function(t){e._ctrlKey=t.ctrlKey,e._shiftKey=t.shiftKey}))},_selectable:function(){var e=this,t=e.wrapper;if(e.options.selectable){t.on(T+k,".k-scheduler-header-all-day td, .k-scheduler-content td, .k-event, .k-scheduler-body td .k-link",(function(t){e._isTouch(t)||e._mouseDownSelection(t)}));var i=e._mouseMove.bind(e);t.on(T+k,".k-scheduler-header-all-day td, .k-scheduler-content td",(function(n){var a=n.which,r=n.button,o=a&&3===a||r&&2==r;e._isTouch(n)||o||t.on(x+k,".k-scheduler-header-all-day td, .k-scheduler-content td",i)})),t.on("mouseup"+k+" mousecancel"+k,(function(){t.off(x+k,".k-scheduler-header-all-day td, .k-scheduler-content td",i)}))}},_mouseDownSelection:function(t){var n=t.which,a=t.button;n&&3===n||a&&2==a||(t.ctrlKey&&(this._ctrlKey=t.ctrlKey),t.shiftKey&&(this._shiftKey=t.shiftKey),this._mouseDown=!0,this._createSelection(t.currentTarget),e(t.currentTarget).hasClass("k-event")&&(this._selection.eventElement=t.currentTarget)),"year"!==this.view().name&&i._activeElement()!==this.wrapper.get(0)?i.focusElement(this.wrapper):this._select(),this.toolbar&&this.toolbar.find("."+A).removeClass(A)},_selectFirstSlot:function(){var e,t=this.wrapper.find(".k-scheduler-header-all-day").find("td").first(),i=this.wrapper.find(".k-scheduler-content").find("td").first();e=t.length>0?t:i.length>0?i:this.wrapper.find(".k-scheduler-body").find(".k-link").first(),this._createSelection(e)},_firstEvent:function(){var e,t,i,n=this.wrapper.find(".k-scheduler-header-wrap .k-event, .k-task").first(),a=this.wrapper.find(".k-scheduler-content .k-event").first();return n.length>0?a.length>0?(t=this.occurrenceByUid(n.data("uid")),i=this.occurrenceByUid(a.data("uid")),e=t.start<=i.start?n:a):e=n:a&&(e=a),e},_initialFocus:function(){var e=this._firstEvent();this.options.selectable?e&&e.length>0?(this._createSelection(e),this._selection.eventElement=e[0]):this._selectFirstSlot():this.toolbar&&0===this.toolbar.find("."+A).length?this._focusToolbar():this.toolbar&&this.toolbar.find("."+A).removeClass(A)},_select:function(){const t=this,i=t.view(),n=t.wrapper,a=t._selection,r=t._old?t._old.selection:null,o=t._old?t._old.eventsLength:null;let s=i.current();if(a&&(s&&(s.removeAttribute("id"),n.removeAttr("aria-activedescendant")),i.select(a),t._selection.eventElement=null,s=i.current(),s)){s.setAttribute("id",t._ariaId),n.attr("aria-activedescendant",t._ariaId);const u=t._old?t._old.selectionStart.getTime():null,p=t._old?t._old.selectionEnd.getTime():null,h=a.start.getTime()!==u||a.end.getTime()!==p;if(r!==s||a.events&&o!==a.events.length||h){var l=e(s).data("uid");if(t._old&&l&&l===e(t._old.selection).data("uid")&&a.events&&t._old.eventsLength===a.events.length)return;var d=t._selectedEvents(),c=i._selectedSlots;t._old={selection:s,eventsLength:d.length,selectionStart:a.start,selectionEnd:a.end},t.trigger(E,{start:a.start,end:a.end,events:d,slots:c,resources:i._resourceBySlot(a)})}}},_selectedEvents:function(){for(var e,t=this._selection.events,i=t.length,n=0,a=[];n<i;n++)(e=this.occurrenceByUid(t[n]))&&a.push(e);return a},_tapPosition:function(e,t){return/touch/.test(e.type)?(e.originalEvent||e).changedTouches[0]["page"+t]:e["page"+t]},_touchMove:function(e){var t=this,n=t.wrapper.find(".k-scheduler-content"),a=n[0].scrollHeight>n[0].clientHeight,r=n[0].scrollWidth>n[0].clientWidth,o=t._tapPosition(e,"Y"),s=t._tapPosition(e,"X"),l=n[0].scrollTop-Math.round(o-t._touchPosY),d=n[0].scrollLeft-Math.round(s-t._touchPosX),c=a&&Math.abs(o-t._touchPosY)>10,u=r&&Math.abs(o-t._touchPosY)>10;t._dragging||i.support.kineticScrollNeeded||!t._isTouch(e)||(c||u)&&(t._amplitude=Math.round(o-t._touchPosY),t._touchPosY=o,t._touchPosX=s,n.animate({scrollTop:l,scrollLeft:d},0),t.view()._scrolling=!0)},_mouseMove:function(t){var i=this;clearTimeout(i._moveTimer),i._isTouch(t)||(i._moveTimer=setTimeout((function(){var n=i.view(),a=i._selection;if(a){var r=n.selectionByElement(e(t.currentTarget));if(r&&a.groupIndex===r.groupIndex){var o=r.startDate(),s=r.endDate();o>=a.end?a.backward=!1:s<=a.start&&(a.backward=!0),a.backward?a.start=o:a.end=s,i._select()}}}),5))},_viewByIndex:function(e){var t,i=this.views;for(t in i){if(!e)return t;e--}},_keydownToolbar:function(e){var t=e.keyCode;return e.altKey&&t===d.DOWN&&this.toolbar.find(".k-nav-current").hasClass(A)?(this._showCalendar(),void e.preventDefault()):t===d.DOWN?("year"===this._selectedViewName?this.view().calendar.focus():document.activeElement!==this.element[0]&&this.element.focus(),void e.preventDefault()):void 0},_keydownView:function(e){var t,n,a,r=e.keyCode,o=16===r||18===r||17===r||91===r||92===r,s=this._selection,l=this.view(),c=l.options.editable,u=[d.LEFT,d.RIGHT,d.UP,d.DOWN],p=i.support.isRtl(this.element);o||s&&(r===d.ENTER?s.events.length&&c&&!1!==c.update&&this.editEvent(s.events[0]):r!==d.DELETE&&r!==d.BACKSPACE||!1===c||!1===c.destroy?u.indexOf(r)>-1?(t=r===d.UP||r===d.LEFT&&!p||r===d.RIGHT&&p,l.moveToEvent(s,t)&&(this._select(),document.activeElement!==this.element[0]&&this.element.trigger("focus"),e.preventDefault())):r!==d.HOME&&r!==d.END||(e.preventDefault(),n=this.view().content.eq(0),a=r===d.HOME?n.find(".k-scheduler-table td").first():n.find(".k-scheduler-table td").last(),this.view()._scrollTo(a[0],n[0])):this.removeEvent(s.events[0]))},_keydownShortcut:function(e){var t=new Date,a=this.options.timezone,r=this.view().options.editable;if(66===e&&this.view().toggleFullDay)this.view().toggleFullDay();else if(67===e&&r&&!1!==r.create)this.addEvent(_({},{start:this.date(),end:this.date()}));else if(84===e){if(a){var o=i.timezone.offset(t,a);n=i.timezone.convert(t,t.getTimezoneOffset(),o)}else n=t;this.trigger("navigate",{view:this._selectedViewName,action:"today",date:n})||this.date(n)}},_keydownYearView:function(e){var t=this.view(),i=this._selection,n=e.keyCode;n!==d.TAB&&(n===d.F10?(this._focusToolbar(),e.preventDefault()):(this.toolbar.find("."+A).removeClass(A),t.calendar.focus()),i&&this._adjustSelectedDate(),e.preventDefault())},_keydownAgendaView:function(e){var t,i,n=e.keyCode,a=this.view(),r=this._selection;a.move(r,n)?(e.preventDefault(),this.toolbar.find("."+A).removeClass(A),this._select()):n!==d.HOME&&n!==d.END||(e.preventDefault(),t=this.view().content.eq(0),i=n===d.HOME?t.find(".k-scheduler-table td").first():t.find(".k-scheduler-table td").last(),this.view()._scrollTo(i[0],t[0]))},_keydownChangeView:function(e){var t,i=e-49;-1===i&&(i=9),(t=this._viewByIndex(i))&&!this.trigger("navigate",{view:t,action:"changeView",date:this.date()})&&this.view(t)},_keydownChangeDate:function(e){var t=i.support.isRtl(this.element),a=t&&e===d.LEFT||!t&&e===d.RIGHT?"next":"previous";n="next"===a?this.view().nextDate():this.view().previousDate(),this.trigger("navigate",{view:this._selectedViewName,action:a,date:n})||(this.date(n),this._initialFocus(),this._select())},_keydown:function(t){var i=t.keyCode,n=e(t.target).closest(".k-toolbar").length>0,a=t.altKey;if(this._ctrlKey=t.ctrlKey,this._shiftKey=t.shiftKey,i===d.ESC&&this.popup&&this.popup.visible())return this.popup.close(),void t.preventDefault();if(i!==d.LEFT&&i!==d.RIGHT||!this._shiftKey)if(a&&i>=48&&i<=57)this._keydownChangeView(i);else if([66,67,84].indexOf(i)>-1)e(t.target).hasClass("k-scheduler-search-input")||this._keydownShortcut(i);else if(n)this._keydownToolbar(t);else{if("year"===this._selectedViewName)return void this._keydownYearView(t);if(i===d.F10)return this._focusToolbar(),void t.preventDefault();if("agenda"===this._selectedViewName)return void this._keydownAgendaView(t);this._keydownView(t)}else this._keydownChangeDate(i)},_focusToolbar:function(){this.toolbar.find("[tabindex=0]").first().trigger("focus").addClass(A)},_createSelection:function(t){var n,a,r=this._selection;(t=e(t)).is(".k-event")&&(n=t.attr(i.attr("uid")),r&&-1!==r.events.indexOf(n)&&!this._ctrlKey)||(r&&(this._ctrlKey||this._shiftKey)||(r=this._selection={events:[],groupIndex:0}),(a=this.view().selectionB