{"version":3,"sources":["kendo.scheduler.view.js"],"names":["f","define","kendo","ui","scheduler","$","levels","values","key","collect","depth","level","idx","result","length","push","cellspacing","support","cssBorderSpacing","table","tableRows","className","trim","join","allDayTable","timesHeader","columnLevelCount","allDaySlot","rowCount","text","datesHeader","columnLevels","columnCount","columnIndex","columnLevelIndex","th","colspan","column","allDayTableRows","lastLevel","td","cellContent","dateTableRows","times","rowLevels","rowIndex","rowLevelIndex","rowspan","rows","Array","split","rowHeaderRows","allDay","content","scrollbar","scrollbarWidth","collidingEvents","elements","start","end","index","startIndex","overlaps","endIndex","rangeIndex","eventsForSlot","eventElement","slotStart","slotEnd","event","events","createColumns","eventElements","_createColumns","createRows","eventRange","j","columnLength","endOverlaps","columns","createDateLayoutConfiguration","name","dates","inner","configuration","each","item","obj","minorTicks","createLayoutConfiguration","resources","template","data","dataIndex","resource","dataSource","view","htmlEncode","getter","dataTextField","color","dataColorField","field","title","value","dataValueField","slice","groupEqFilter","isArray","ObservableArray","addSelectedState","cell","replace","selectedStateRegExp","Color","window","Widget","outerHeight","_outerHeight","keys","NS","math","Math","HINT","ResourceView","Class","extend","init","isRtl","this","_index","_timeSlotCollections","_daySlotCollections","_isRtl","addTimeSlotCollection","startDate","endDate","_addCollection","addDaySlotCollection","collections","collection","SlotCollection","timeSlotCollectionCount","daySlotCollectionCount","daySlotByPosition","x","y","byDate","_slotByPosition","timeSlotByPosition","collectionIndex","slotIndex","slot","width","height","nextSlot","horizontalEnd","verticalEnd","count","at","offsetWidth","offsetHeight","offsetLeft","offsetTop","refresh","timeSlotRanges","startTime","endTime","_startSlot","inRange","_endSlot","first","last","_continuousRange","TimeSlotRange","daySlotRanges","isAllDay","date","MS_PER_DAY","DaySlotRange","range","head","tail","startSlot","endSlot","ranges","slotRanges","isDay","_startTime","toUtcTime","_endTime","undefined","isMultiDay","_startCollection","startInRange","_endCollection","endInRange","_getCollections","continuousSlot","reverse","pad","isDaySlot","firstSlot","lastSlot","upSlot","keepCollection","groupByDateVertically","that","moveToDaySlot","isFirstCell","_verticalSlot","downSlot","moveToTimeSlot","leftSlot","_horizontalSlot","rightSlot","step","swapCollection","_collection","multiday","time","slotByStartDate","slotByEndDate","getSlotCollection","getTimeSlotCollection","getDaySlotCollection","SlotRange","options","innerHeight","addEvent","outerRect","snap","_rect","property","top","bottom","left","right","startOffset","startSlotDuration","endOffset","endSlotDuration","element","round","innerRect","innerWidth","groupIndex","_slots","_events","_start","_end","_groupIndex","_collectionIndex","allday","addTimeSlot","isHorizontal","TimeSlot","addDaySlot","eventCount","DaySlot","Slot","clientWidth","clientHeight","timezone","toLocalDate","fn","apply","arguments","offsetX","rtl","offset","duration","difference","floor","children","firstChildHeight","firstChildTop","Date","SchedulerView","call","_normalizeOptions","_scrollbar","_resizeHint","_moveHint","_cellId","guid","_resourcesForGroups","_selectedSlots","setMilliseconds","workDayStart","workDayEnd","_isMobile","mobile","mobileOS","_isMobilePhoneView","tablet","_addResourceView","resourceView","groups","dateForTitle","format","selectedDateFormat","shortDateForTitle","selectedShortDateFormat","_changeGroup","selection","previous","method","_isGroupedByDate","_changeDate","group","_changeGroupContinuously","_changeViewPeriod","_horizontalSlots","multiple","tempSlot","horizontalRange","isVertical","_isVerticallyGrouped","_normalizeHorizontalSelection","_getNextHorizontalRange","_continuousSlot","_verticalSlots","verticalRange","_normalizeVerticalSelection","_getNextVerticalRange","constrainSelection","move","shift","slots","backward","handled","verticalByDate","DOWN","UP","_updateDirection","LEFT","RIGHT","moveToEventInGroup","selectedEvents","prev","found","_continuousEvents","inArray","uid","moveToEvent","allEvents","uniqueAllEvents","sortedEvents","eventIndex","_getAllEvents","_getUniqueEvents","_getSortedEvents","_getNextEventIndexBySlot","_getStartIdx","_getSelectedSlot","current","candidate","_current","has","_scrollTo","select","clearSelection","_selectEvents","_selectSlots","i","eventStartDate","tempIndex","slotStartDate","getDate","getTime","selectedEventIndex","concat","exists","sort","second","firstStartDate","secondStartDate","setAttribute","groupEvents","add","addClass","attr","addDays","_resourceValue","valuePrimitive","_resourceBySlot","resourceIndex","setter","groupedResources","total","_createResizeHint","css","_removeResizeHint","remove","_removeMoveHint","container","elementOffset","elementOffsetDir","containerScroll","scrollTop","containerOffsetDir","bottomDistance","_shouldInverseResourceColor","resourceColorIsDark","isDark","currentColor","currentColorIsDark","_eventTmpl","wrapper","tmpl","settings","Template","templateSettings","paramName","html","type","state","storage","proxy","eventResources","eventResource","resourceColor","get","createLayout","layout","allDayIndex","splice","find","append","_topSection","_bottomSection","_scroller","refreshLayout","datesHeaderRows","isSchedulerHeightSet","contentDiv","timesTable","toolbar","headerHeight","paddingDirection","eq","footer","el","initialHeight","newHeight","style","kineticScrollNeeded","parseInt","removeClass","wrap","parent","touchScroller","bind","scrollLeft","avoidScrolling","e","target","closest","movable","_touchScroller","scrollElement","sender","groupIdx","groupLength","_createDateLayout","_createColumnsLayout","_groupOrientation","orientation","_createRowsLayout","selectionByElement","removeAttr","destroy","calendarInfo","getCulture","calendars","standard","prevGroupSlot","nextGroupSlot","_eventOptionsForMove","_updateEventForResize","_updateEventForSelection","re","processor","parts","channels","formats","resolveColor","process","exec","r","g","b","normalizeByte","prototype","charAt","substr","toLowerCase","namedColors","isNaN","percBrightness","sqrt","brightnessValue","aqua","azure","beige","black","blue","brown","coral","cyan","darkblue","darkcyan","darkgray","darkgreen","darkorange","darkred","dimgray","fuchsia","gold","goldenrod","gray","green","greenyellow","indigo","ivory","khaki","lightblue","lightgrey","lightgreen","lightpink","lightyellow","lime","limegreen","linen","magenta","maroon","mediumblue","navy","olive","orange","orangered","orchid","pink","plum","purple","red","royalblue","salmon","silver","skyblue","slateblue","slategray","snow","steelblue","tan","teal","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen","jQuery","amd","a1","a2","a3"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;CAwBC,SAAUA,EAAGC,QACVA,OAAO,wBAAyB,cAAeD,IACjD,WA44DE,MAn4DAE,OAAMC,GAAGC,aACR,SAAUC,GAEP,QA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SACXC,IAAK,SACLC,KAAM,SACNC,OAAQ,SACRC,UAAW,SACXC,OAAQ,SACRC,MAAO,SACPC,MAAO,SACPC,WAAY,SACZC,OAAQ,SACRC,YAAa,UA+Fbnc,EAAsB,sBAI1B5G,EAAEyH,OAAO3H,EAAGmR,eACR/M,cAAeA,EACfG,WAAYA,EACZV,WAAYA,EACZR,gBAAiBA,EACjBmD,cAAeA,KAErBQ,OAAOjH,MAAMmjB,QACRlc,OAAOjH,OACE,kBAAVD,SAAwBA,OAAOqjB,IAAMrjB,OAAS,SAAUsjB,EAAIC,EAAIC,IACrEA,GAAMD","file":"kendo.scheduler.view.min.js","sourcesContent":["/*!\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n*/\n(function (f, define) {\n define('kendo.scheduler.view', ['kendo.core'], f);\n}(function () {\n var __meta__ = {\n id: 'scheduler.view',\n name: 'Scheduler View',\n category: 'web',\n description: 'The Scheduler Common View',\n depends: ['core'],\n hidden: true\n };\n kendo.ui.scheduler = {};\n (function ($) {\n var kendo = window.kendo, ui = kendo.ui, Widget = ui.Widget, outerHeight = kendo._outerHeight, keys = kendo.keys, NS = '.kendoSchedulerView', math = Math;\n function levels(values, key) {\n var result = [];\n function collect(depth, values) {\n values = values[key];\n if (values) {\n var level = result[depth] = result[depth] || [];\n for (var idx = 0; idx < values.length; idx++) {\n level.push(values[idx]);\n collect(depth + 1, values[idx]);\n }\n }\n }\n collect(0, values);\n return result;\n }\n function cellspacing() {\n if (kendo.support.cssBorderSpacing) {\n return '';\n }\n return 'cellspacing=\"0\"';\n }\n function table(tableRows, className) {\n if (!tableRows.length) {\n return '';\n }\n return '' + '' + tableRows.join('') + '' + '
';\n }\n function allDayTable(tableRows, className) {\n if (!tableRows.length) {\n return '';\n }\n return '
' + table(tableRows, className) + '
';\n }\n function timesHeader(columnLevelCount, allDaySlot, rowCount) {\n var tableRows = [];\n if (rowCount > 0) {\n for (var idx = 0; idx < columnLevelCount; idx++) {\n tableRows.push(' ');\n }\n }\n if (allDaySlot) {\n tableRows.push('' + allDaySlot.text + '');\n }\n if (rowCount < 1) {\n return $();\n }\n return $('
' + table(tableRows) + '
');\n }\n function datesHeader(columnLevels, columnCount, allDaySlot) {\n var dateTableRows = [];\n var columnIndex;\n for (var columnLevelIndex = 0; columnLevelIndex < columnLevels.length; columnLevelIndex++) {\n var level = columnLevels[columnLevelIndex];\n var th = [];\n var colspan = columnCount / level.length;\n for (columnIndex = 0; columnIndex < level.length; columnIndex++) {\n var column = level[columnIndex];\n th.push('' + column.text + '');\n }\n dateTableRows.push(th.join(''));\n }\n var allDayTableRows = [];\n if (allDaySlot) {\n var lastLevel = columnLevels[columnLevels.length - 1];\n var td = [];\n var cellContent = allDaySlot.cellContent;\n for (columnIndex = 0; columnIndex < lastLevel.length; columnIndex++) {\n td.push('' + (cellContent ? cellContent(columnIndex) : ' ') + '');\n }\n allDayTableRows.push(td.join(''));\n }\n return $('
' + '
' + table(dateTableRows) + allDayTable(allDayTableRows, 'k-scheduler-header-all-day') + '
' + '
');\n }\n function times(rowLevels, rowCount) {\n var rows = new Array(rowCount).join().split(',');\n var rowHeaderRows = [];\n var rowIndex;\n for (var rowLevelIndex = 0; rowLevelIndex < rowLevels.length; rowLevelIndex++) {\n var level = rowLevels[rowLevelIndex];\n var rowspan = rowCount / level.length;\n var className;\n for (rowIndex = 0; rowIndex < level.length; rowIndex++) {\n className = level[rowIndex].className || '';\n if (level[rowIndex].allDay) {\n className = 'k-scheduler-times-all-day';\n }\n rows[rowspan * rowIndex] += '' + level[rowIndex].text + '';\n }\n }\n for (rowIndex = 0; rowIndex < rowCount; rowIndex++) {\n rowHeaderRows.push(rows[rowIndex]);\n }\n if (rowCount < 1) {\n return $();\n }\n return $('
' + table(rowHeaderRows) + '
');\n }\n function content() {\n return $('
' + '' + '');\n }\n var HINT = '
' + '
' + '
' + '
' + '
' + '
' + '
';\n var ResourceView = kendo.Class.extend({\n init: function (index, isRtl) {\n this._index = index;\n this._timeSlotCollections = [];\n this._daySlotCollections = [];\n this._isRtl = isRtl;\n },\n addTimeSlotCollection: function (startDate, endDate) {\n return this._addCollection(startDate, endDate, this._timeSlotCollections);\n },\n addDaySlotCollection: function (startDate, endDate) {\n return this._addCollection(startDate, endDate, this._daySlotCollections);\n },\n _addCollection: function (startDate, endDate, collections) {\n var collection = new SlotCollection(startDate, endDate, this._index, collections.length);\n collections.push(collection);\n return collection;\n },\n timeSlotCollectionCount: function () {\n return this._timeSlotCollections.length;\n },\n daySlotCollectionCount: function () {\n return this._daySlotCollections.length;\n },\n daySlotByPosition: function (x, y, byDate) {\n return this._slotByPosition(x, y, this._daySlotCollections, byDate);\n },\n timeSlotByPosition: function (x, y, byDate) {\n return this._slotByPosition(x, y, this._timeSlotCollections, byDate);\n },\n _slotByPosition: function (x, y, collections, byDate) {\n for (var collectionIndex = 0; collectionIndex < collections.length; collectionIndex++) {\n var collection = collections[collectionIndex];\n for (var slotIndex = 0; slotIndex < collection.count(); slotIndex++) {\n var slot = collection.at(slotIndex);\n var width = slot.offsetWidth;\n var height = slot.offsetHeight;\n var nextSlot;\n var horizontalEnd = slot.offsetLeft + width;\n var verticalEnd = slot.offsetTop + height;\n if (!byDate) {\n nextSlot = collection.at(slotIndex + 1);\n }\n if (nextSlot) {\n if (nextSlot.offsetLeft != slot.offsetLeft) {\n if (this._isRtl) {\n horizontalEnd = slot.offsetLeft + (slot.offsetLeft - nextSlot.offsetLeft);\n } else {\n horizontalEnd = nextSlot.offsetLeft;\n }\n } else {\n verticalEnd = nextSlot.offsetTop;\n }\n }\n if (x >= slot.offsetLeft && x < horizontalEnd && y >= slot.offsetTop && y < verticalEnd) {\n return slot;\n }\n }\n }\n },\n refresh: function () {\n var collectionIndex;\n for (collectionIndex = 0; collectionIndex < this._daySlotCollections.length; collectionIndex++) {\n this._daySlotCollections[collectionIndex].refresh();\n }\n for (collectionIndex = 0; collectionIndex < this._timeSlotCollections.length; collectionIndex++) {\n this._timeSlotCollections[collectionIndex].refresh();\n }\n },\n timeSlotRanges: function (startTime, endTime) {\n var collections = this._timeSlotCollections;\n var start = this._startSlot(startTime, collections);\n if (!start.inRange && startTime >= start.slot.end) {\n start = null;\n }\n var end = start;\n if (startTime < endTime) {\n end = this._endSlot(endTime, collections);\n }\n if (end && !end.inRange && endTime <= end.slot.start) {\n end = null;\n }\n if (start === null && end === null) {\n return [];\n }\n if (start === null) {\n start = {\n inRange: true,\n slot: collections[end.slot.collectionIndex].first()\n };\n }\n if (end === null) {\n end = {\n inRange: true,\n slot: collections[start.slot.collectionIndex].last()\n };\n }\n return this._continuousRange(TimeSlotRange, collections, start, end);\n },\n daySlotRanges: function (startTime, endTime, isAllDay) {\n var collections = this._daySlotCollections;\n var start = this._startSlot(startTime, collections, isAllDay);\n if (!start.inRange && startTime >= start.slot.end) {\n start = null;\n }\n var end = start;\n if (startTime < endTime) {\n end = this._endSlot(endTime, collections, isAllDay);\n }\n if (end && !end.inRange && endTime <= end.slot.start) {\n end = null;\n }\n if (start === null && end === null) {\n return [];\n }\n if (start === null) {\n do {\n startTime += kendo.date.MS_PER_DAY;\n start = this._startSlot(startTime, collections, isAllDay);\n } while (!start.inRange && startTime >= start.slot.end);\n }\n if (end === null) {\n do {\n endTime -= kendo.date.MS_PER_DAY;\n end = this._endSlot(endTime, collections, isAllDay);\n } while (!end.inRange && endTime <= end.slot.start);\n }\n return this._continuousRange(DaySlotRange, collections, start, end);\n },\n _continuousRange: function (range, collections, start, end) {\n var startSlot = start.slot;\n var endSlot = end.slot;\n var startIndex = startSlot.collectionIndex;\n var endIndex = endSlot.collectionIndex;\n var ranges = [];\n for (var collectionIndex = startIndex; collectionIndex <= endIndex; collectionIndex++) {\n var collection = collections[collectionIndex];\n var first = collection.first();\n var last = collection.last();\n var head = false;\n var tail = false;\n if (collectionIndex == startIndex) {\n tail = !start.inRange;\n }\n if (collectionIndex == endIndex) {\n head = !end.inRange;\n }\n if (first.start < startSlot.start) {\n first = startSlot;\n }\n if (last.start > endSlot.start) {\n last = endSlot;\n }\n if (startIndex < endIndex) {\n if (collectionIndex == startIndex) {\n head = true;\n } else if (collectionIndex == endIndex) {\n tail = true;\n } else {\n head = tail = true;\n }\n }\n ranges.push(new range({\n start: first,\n end: last,\n collection: collection,\n head: head,\n tail: tail\n }));\n }\n return ranges;\n },\n slotRanges: function (event, isDay) {\n var startTime = event._startTime || kendo.date.toUtcTime(event.start);\n var endTime = event._endTime || kendo.date.toUtcTime(event.end);\n if (isDay === undefined) {\n isDay = event.isMultiDay();\n }\n if (isDay) {\n return this.daySlotRanges(startTime, endTime, event.isAllDay);\n }\n return this.timeSlotRanges(startTime, endTime);\n },\n ranges: function (startTime, endTime, isDay, isAllDay) {\n if (typeof startTime != 'number') {\n startTime = kendo.date.toUtcTime(startTime);\n }\n if (typeof endTime != 'number') {\n endTime = kendo.date.toUtcTime(endTime);\n }\n if (isDay) {\n return this.daySlotRanges(startTime, endTime, isAllDay);\n }\n return this.timeSlotRanges(startTime, endTime);\n },\n _startCollection: function (date, collections) {\n for (var collectionIndex = 0; collectionIndex < collections.length; collectionIndex++) {\n var collection = collections[collectionIndex];\n if (collection.startInRange(date)) {\n return collection;\n }\n }\n return null;\n },\n _endCollection: function (date, collections, isAllDay) {\n for (var collectionIndex = 0; collectionIndex < collections.length; collectionIndex++) {\n var collection = collections[collectionIndex];\n if (collection.endInRange(date, isAllDay)) {\n return collection;\n }\n }\n return null;\n },\n _getCollections: function (isDay) {\n return isDay ? this._daySlotCollections : this._timeSlotCollections;\n },\n continuousSlot: function (slot, reverse) {\n var pad = reverse ? -1 : 1;\n var collections = this._getCollections(slot.isDaySlot);\n var collection = collections[slot.collectionIndex + pad];\n return collection ? collection[reverse ? 'last' : 'first']() : undefined;\n },\n firstSlot: function () {\n var collections = this._getCollections(this.daySlotCollectionCount());\n return collections[0].first();\n },\n lastSlot: function () {\n var collections = this._getCollections(this.daySlotCollectionCount());\n return collections[collections.length - 1].last();\n },\n upSlot: function (slot, keepCollection, groupByDateVertically) {\n var that = this;\n var moveToDaySlot = function (isDaySlot, collectionIndex, index) {\n var isFirstCell = index === 0;\n if (!keepCollection && !isDaySlot && isFirstCell && that.daySlotCollectionCount()) {\n return that._daySlotCollections[0].at(collectionIndex);\n }\n };\n if (!this.timeSlotCollectionCount()) {\n keepCollection = true;\n }\n return this._verticalSlot(slot, -1, moveToDaySlot, groupByDateVertically);\n },\n downSlot: function (slot, keepCollection, groupByDateVertically) {\n var that = this;\n var moveToTimeSlot = function (isDaySlot, collectionIndex, index) {\n if (!keepCollection && isDaySlot && that.timeSlotCollectionCount()) {\n return that._timeSlotCollections[index].at(0);\n }\n };\n if (!this.timeSlotCollectionCount()) {\n keepCollection = true;\n }\n return this._verticalSlot(slot, 1, moveToTimeSlot, groupByDateVertically);\n },\n leftSlot: function (slot, groupByDateVertically) {\n return this._horizontalSlot(slot, -1, groupByDateVertically);\n },\n rightSlot: function (slot, groupByDateVertically) {\n return this._horizontalSlot(slot, 1, groupByDateVertically);\n },\n _horizontalSlot: function (slot, step, groupByDateVertically) {\n var index = slot.index;\n var isDaySlot = slot.isDaySlot;\n var collectionIndex = slot.collectionIndex;\n var collections = this._getCollections(isDaySlot);\n isDaySlot = groupByDateVertically ? false : isDaySlot;\n if (isDaySlot) {\n index += step;\n } else {\n collectionIndex += step;\n }\n var collection = collections[collectionIndex];\n return collection ? collection.at(index) : undefined;\n },\n _verticalSlot: function (slot, step, swapCollection, groupByDateVertically) {\n var index = slot.index;\n var isDaySlot = slot.isDaySlot;\n var collectionIndex = slot.collectionIndex;\n var collections = this._getCollections(isDaySlot);\n slot = swapCollection(isDaySlot, collectionIndex, index);\n if (slot) {\n return slot;\n }\n isDaySlot = groupByDateVertically ? false : isDaySlot;\n if (isDaySlot) {\n collectionIndex += step;\n } else {\n index += step;\n }\n var collection = collections[collectionIndex];\n return collection ? collection.at(index) : undefined;\n },\n _collection: function (index, multiday) {\n var collections = multiday ? this._daySlotCollections : this._timeSlotCollections;\n return collections[index];\n },\n _startSlot: function (time, collections, isAllDay) {\n var collection = this._startCollection(time, collections);\n var inRange = true;\n if (!collection) {\n collection = collections[0];\n inRange = false;\n }\n var slot = collection.slotByStartDate(time, isAllDay);\n if (!slot) {\n slot = collection.first();\n inRange = false;\n }\n return {\n slot: slot,\n inRange: inRange\n };\n },\n _endSlot: function (time, collections, isAllDay) {\n var collection = this._endCollection(time, collections, isAllDay);\n var inRange = true;\n if (!collection) {\n collection = collections[collections.length - 1];\n inRange = false;\n }\n var slot = collection.slotByEndDate(time, isAllDay);\n if (!slot) {\n slot = collection.last();\n inRange = false;\n }\n return {\n slot: slot,\n inRange: inRange\n };\n },\n getSlotCollection: function (index, isDay) {\n return this[isDay ? 'getDaySlotCollection' : 'getTimeSlotCollection'](index);\n },\n getTimeSlotCollection: function (index) {\n return this._timeSlotCollections[index];\n },\n getDaySlotCollection: function (index) {\n return this._daySlotCollections[index];\n }\n });\n var SlotRange = kendo.Class.extend({\n init: function (options) {\n $.extend(this, options);\n },\n innerHeight: function () {\n var collection = this.collection;\n var startIndex = this.start.index;\n var endIndex = this.end.index;\n var result = 0;\n for (var slotIndex = startIndex; slotIndex <= endIndex; slotIndex++) {\n result += collection.at(slotIndex).offsetHeight;\n }\n return result;\n },\n events: function () {\n return this.collection.events();\n },\n addEvent: function (event) {\n this.events().push(event);\n },\n startSlot: function () {\n if (this.start.offsetLeft > this.end.offsetLeft) {\n return this.end;\n }\n return this.start;\n },\n endSlot: function () {\n if (this.start.offsetLeft > this.end.offsetLeft) {\n return this.start;\n }\n return this.end;\n }\n });\n var TimeSlotRange = SlotRange.extend({\n innerHeight: function () {\n var collection = this.collection;\n var startIndex = this.start.index;\n var endIndex = this.end.index;\n var result = 0;\n for (var slotIndex = startIndex; slotIndex <= endIndex; slotIndex++) {\n result += collection.at(slotIndex).offsetHeight;\n }\n return result;\n },\n outerRect: function (start, end, snap) {\n return this._rect('offset', start, end, snap);\n },\n _rect: function (property, start, end, snap) {\n var top;\n var bottom;\n var left;\n var right;\n var startSlot = this.start;\n var endSlot = this.end;\n var isRtl = kendo.support.isRtl(startSlot.element);\n if (typeof start != 'number') {\n start = kendo.date.toUtcTime(start);\n }\n if (typeof end != 'number') {\n end = kendo.date.toUtcTime(end);\n }\n if (snap) {\n top = startSlot.offsetTop;\n bottom = endSlot.offsetTop + endSlot[property + 'Height'];\n if (isRtl) {\n left = endSlot.offsetLeft;\n right = startSlot.offsetLeft + startSlot[property + 'Width'];\n } else {\n left = startSlot.offsetLeft;\n right = endSlot.offsetLeft + endSlot[property + 'Width'];\n }\n } else {\n var startOffset = start - startSlot.start;\n if (startOffset < 0) {\n startOffset = 0;\n }\n var startSlotDuration = startSlot.end - startSlot.start;\n top = startSlot.offsetTop + startSlot[property + 'Height'] * startOffset / startSlotDuration;\n var endOffset = endSlot.end - end;\n if (endOffset < 0) {\n endOffset = 0;\n }\n var endSlotDuration = endSlot.end - endSlot.start;\n bottom = endSlot.offsetTop + endSlot[property + 'Height'] - endSlot[property + 'Height'] * endOffset / endSlotDuration;\n if (isRtl) {\n left = Math.round(endSlot.offsetLeft + endSlot[property + 'Width'] * endOffset / endSlotDuration);\n right = Math.round(startSlot.offsetLeft + startSlot[property + 'Width'] - startSlot[property + 'Width'] * startOffset / startSlotDuration);\n } else {\n left = Math.round(startSlot.offsetLeft + startSlot[property + 'Width'] * startOffset / startSlotDuration);\n right = Math.round(endSlot.offsetLeft + endSlot[property + 'Width'] - endSlot[property + 'Width'] * endOffset / endSlotDuration);\n }\n }\n return {\n top: top,\n bottom: bottom,\n left: left === 0 ? left : left + 1,\n right: right\n };\n },\n innerRect: function (start, end, snap) {\n return this._rect('client', start, end, snap);\n }\n });\n var DaySlotRange = SlotRange.extend({\n innerWidth: function () {\n var collection = this.collection;\n var startIndex = this.start.index;\n var endIndex = this.end.index;\n var result = 0;\n var width = startIndex !== endIndex ? 'offsetWidth' : 'clientWidth';\n for (var slotIndex = startIndex; slotIndex <= endIndex; slotIndex++) {\n result += collection.at(slotIndex)[width];\n }\n return result;\n }\n });\n var SlotCollection = kendo.Class.extend({\n init: function (startDate, endDate, groupIndex, collectionIndex) {\n this._slots = [];\n this._events = [];\n this._start = kendo.date.toUtcTime(startDate);\n this._end = kendo.date.toUtcTime(endDate);\n this._groupIndex = groupIndex;\n this._collectionIndex = collectionIndex;\n },\n refresh: function () {\n for (var slotIndex = 0; slotIndex < this._slots.length; slotIndex++) {\n this._slots[slotIndex].refresh();\n }\n },\n startInRange: function (date) {\n return this._start <= date && date < this._end;\n },\n endInRange: function (date, isAllDay) {\n var end = isAllDay ? date < this._end : date <= this._end;\n return this._start <= date && end;\n },\n slotByStartDate: function (date) {\n var time = date;\n if (typeof time != 'number') {\n time = kendo.date.toUtcTime(date);\n }\n for (var slotIndex = 0; slotIndex < this._slots.length; slotIndex++) {\n var slot = this._slots[slotIndex];\n if (slot.startInRange(time)) {\n return slot;\n }\n }\n return null;\n },\n slotByEndDate: function (date, allday) {\n var time = date;\n if (typeof time != 'number') {\n time = kendo.date.toUtcTime(date);\n }\n if (allday) {\n return this.slotByStartDate(date, false);\n }\n for (var slotIndex = 0; slotIndex < this._slots.length; slotIndex++) {\n var slot = this._slots[slotIndex];\n if (slot.endInRange(time)) {\n return slot;\n }\n }\n return null;\n },\n count: function () {\n return this._slots.length;\n },\n events: function () {\n return this._events;\n },\n addTimeSlot: function (element, start, end, isHorizontal) {\n var slot = new TimeSlot(element, start, end, this._groupIndex, this._collectionIndex, this._slots.length, isHorizontal);\n this._slots.push(slot);\n },\n addDaySlot: function (element, start, end, eventCount) {\n var slot = new DaySlot(element, start, end, this._groupIndex, this._collectionIndex, this._slots.length, eventCount);\n this._slots.push(slot);\n },\n first: function () {\n return this._slots[0];\n },\n last: function () {\n return this._slots[this._slots.length - 1];\n },\n at: function (index) {\n return this._slots[index];\n }\n });\n var Slot = kendo.Class.extend({\n init: function (element, start, end, groupIndex, collectionIndex, index) {\n this.element = element;\n this.clientWidth = element.clientWidth;\n this.clientHeight = element.clientHeight;\n this.offsetWidth = element.offsetWidth;\n this.offsetHeight = element.offsetHeight;\n this.offsetTop = element.offsetTop;\n this.offsetLeft = element.offsetLeft;\n this.start = start;\n this.end = end;\n this.element = element;\n this.groupIndex = groupIndex;\n this.collectionIndex = collectionIndex;\n this.index = index;\n this.isDaySlot = false;\n },\n refresh: function () {\n var element = this.element;\n this.clientWidth = element.clientWidth;\n this.clientHeight = element.clientHeight;\n this.offsetWidth = element.offsetWidth;\n this.offsetHeight = element.offsetHeight;\n this.offsetTop = element.offsetTop;\n this.offsetLeft = element.offsetLeft;\n },\n startDate: function () {\n return kendo.timezone.toLocalDate(this.start);\n },\n endDate: function () {\n return kendo.timezone.toLocalDate(this.end);\n },\n startInRange: function (date) {\n return this.start <= date && date < this.end;\n },\n endInRange: function (date) {\n return this.start < date && date <= this.end;\n },\n startOffset: function () {\n return this.start;\n },\n endOffset: function () {\n return this.end;\n }\n });\n var TimeSlot = Slot.extend({\n init: function (element, start, end, groupIndex, collectionIndex, index, isHorizontal) {\n Slot.fn.init.apply(this, arguments);\n this.isHorizontal = isHorizontal ? true : false;\n },\n offsetX: function (rtl, offset) {\n if (rtl) {\n return this.offsetLeft + offset;\n } else {\n return this.offsetLeft + offset;\n }\n },\n startInRange: function (date) {\n return this.start <= date && date < this.end;\n },\n endInRange: function (date) {\n return this.start < date && date <= this.end;\n },\n startOffset: function (x, y, snap) {\n if (snap) {\n return this.start;\n }\n var offset = $(this.element).offset();\n var duration = this.end - this.start;\n var difference;\n var time;\n if (this.isHorizontal) {\n var isRtl = kendo.support.isRtl(this.element);\n difference = x - offset.left;\n time = Math.floor(duration * (difference / this.offsetWidth));\n if (isRtl) {\n return this.start + duration - time;\n }\n } else {\n difference = y - offset.top;\n time = Math.floor(duration * (difference / this.offsetHeight));\n }\n return this.start + time;\n },\n endOffset: function (x, y, snap) {\n if (snap) {\n return this.end;\n }\n var offset = $(this.element).offset();\n var duration = this.end - this.start;\n var difference;\n var time;\n if (this.isHorizontal) {\n var isRtl = kendo.support.isRtl(this.element);\n difference = x - offset.left;\n time = Math.floor(duration * (difference / this.offsetWidth));\n if (isRtl) {\n return this.start + duration - time;\n }\n } else {\n difference = y - offset.top;\n time = Math.floor(duration * (difference / this.offsetHeight));\n }\n return this.start + time;\n }\n });\n var DaySlot = Slot.extend({\n init: function (element, start, end, groupIndex, collectionIndex, index, eventCount) {\n Slot.fn.init.apply(this, arguments);\n this.eventCount = eventCount;\n this.isDaySlot = true;\n if (this.element.children.length) {\n this.firstChildHeight = this.element.children[0].offsetHeight + 3;\n this.firstChildTop = this.element.children[0].offsetTop;\n } else {\n this.firstChildHeight = 3;\n this.firstChildTop = 0;\n }\n },\n startDate: function () {\n var date = new Date(this.start);\n return kendo.timezone.apply(date, 'Etc/UTC');\n },\n endDate: function () {\n var date = new Date(this.end);\n return kendo.timezone.apply(date, 'Etc/UTC');\n },\n startInRange: function (date) {\n return this.start <= date && date < this.end;\n },\n endInRange: function (date) {\n return this.start < date && date <= this.end;\n }\n });\n var scrollbarWidth;\n function scrollbar() {\n scrollbarWidth = scrollbarWidth ? scrollbarWidth : kendo.support.scrollbar();\n return scrollbarWidth;\n }\n kendo.ui.SchedulerView = Widget.extend({\n init: function (element, options) {\n Widget.fn.init.call(this, element, options);\n this._normalizeOptions();\n this._scrollbar = scrollbar();\n this._isRtl = kendo.support.isRtl(element);\n this._resizeHint = $();\n this._moveHint = $();\n this._cellId = kendo.guid();\n this._resourcesForGroups();\n this._selectedSlots = [];\n },\n _normalizeOptions: function () {\n var options = this.options;\n if (options.startTime) {\n options.startTime.setMilliseconds(0);\n }\n if (options.endTime) {\n options.endTime.setMilliseconds(0);\n }\n if (options.workDayStart) {\n options.workDayStart.setMilliseconds(0);\n }\n if (options.workDayEnd) {\n options.workDayEnd.setMilliseconds(0);\n }\n },\n _isMobile: function () {\n var options = this.options;\n return options.mobile === true && kendo.support.mobileOS || options.mobile === 'phone' || options.mobile === 'tablet';\n },\n _isMobilePhoneView: function () {\n var options = this.options;\n return options.mobile === true && kendo.support.mobileOS && !kendo.support.mobileOS.tablet || options.mobile === 'phone';\n },\n _addResourceView: function () {\n var resourceView = new ResourceView(this.groups.length, this._isRtl);\n this.groups.push(resourceView);\n return resourceView;\n },\n dateForTitle: function () {\n return kendo.format(this.options.selectedDateFormat, this.startDate(), this.endDate());\n },\n shortDateForTitle: function () {\n return kendo.format(this.options.selectedShortDateFormat, this.startDate(), this.endDate());\n },\n _changeGroup: function (selection, previous) {\n var method = previous ? 'prevGroupSlot' : 'nextGroupSlot';\n var slot = this[method](selection.start, selection.groupIndex, selection.isAllDay);\n if (slot) {\n selection.groupIndex += previous ? -1 : 1;\n }\n if (this._isGroupedByDate() && !slot) {\n selection.groupIndex = previous ? this.groups.length - 1 : 0;\n }\n return slot;\n },\n _changeDate: function (selection, slot, previous) {\n var group = this.groups[selection.groupIndex];\n var collections, index;\n if (previous) {\n collections = group._getCollections(false);\n index = group.daySlotCollectionCount() ? slot.index - 1 : slot.collectionIndex - 1;\n if (index >= 0) {\n return collections[index]._slots[collections[index]._slots.length - 1];\n }\n } else {\n collections = group._getCollections(group.daySlotCollectionCount());\n index = group.daySlotCollectionCount() ? 0 : slot.collectionIndex + 1;\n var slotIndex = group.daySlotCollectionCount() ? slot.collectionIndex + 1 : 0;\n if (collections[index] && collections[index]._slots[slotIndex]) {\n return collections[index]._slots[slotIndex];\n }\n }\n },\n _changeGroupContinuously: function () {\n return null;\n },\n _changeViewPeriod: function () {\n return false;\n },\n _horizontalSlots: function (selection, ranges, multiple, reverse) {\n var method = reverse ? 'leftSlot' : 'rightSlot';\n var horizontalRange = {\n startSlot: ranges[0].start,\n endSlot: ranges[ranges.length - 1].end\n };\n var group = this.groups[selection.groupIndex];\n var isVertical = this._isVerticallyGrouped();\n if (!multiple) {\n var slot = this._normalizeHorizontalSelection(selection, ranges, reverse);\n if (slot) {\n horizontalRange.startSlot = horizontalRange.endSlot = slot;\n }\n }\n if (this._isGroupedByDate() && !multiple) {\n var tempSlot = this._changeGroup(selection, reverse);\n if (!tempSlot) {\n horizontalRange = this._getNextHorizontalRange(group, method, horizontalRange);\n } else {\n horizontalRange.startSlot = horizontalRange.endSlot = tempSlot;\n }\n } else {\n horizontalRange.startSlot = group[method](horizontalRange.startSlot);\n horizontalRange.endSlot = group[method](horizontalRange.endSlot);\n if (!multiple && !isVertical && (!horizontalRange.startSlot || !horizontalRange.endSlot)) {\n horizontalRange.startSlot = horizontalRange.endSlot = this._changeGroup(selection, reverse);\n }\n }\n var continuousSlot;\n if ((!horizontalRange.startSlot || !horizontalRange.endSlot) && !this._isGroupedByDate()) {\n continuousSlot = this._continuousSlot(selection, ranges, reverse);\n continuousSlot = this._changeGroupContinuously(selection, continuousSlot, multiple, reverse);\n if (continuousSlot) {\n horizontalRange.startSlot = horizontalRange.endSlot = continuousSlot;\n }\n }\n return horizontalRange;\n },\n _getNextHorizontalRange: function (group, method, horizontalRange) {\n if (!this._isVerticallyGrouped()) {\n horizontalRange.startSlot = group[method](horizontalRange.startSlot);\n horizontalRange.endSlot = group[method](horizontalRange.endSlot);\n }\n return horizontalRange;\n },\n _verticalSlots: function (selection, ranges, multiple, reverse) {\n var group = this.groups[selection.groupIndex];\n var slot;\n var verticalRange = {\n startSlot: ranges[0].start,\n endSlot: ranges[ranges.length - 1].end\n };\n if (!multiple) {\n slot = this._normalizeVerticalSelection(selection, ranges, reverse);\n if (slot) {\n verticalRange.startSlot = verticalRange.endSlot = slot;\n }\n }\n var method = reverse ? 'upSlot' : 'downSlot';\n verticalRange = this._getNextVerticalRange(group, method, verticalRange, multiple);\n if (!multiple && this._isVerticallyGrouped() && (!verticalRange.startSlot || !verticalRange.endSlot)) {\n if (this._isGroupedByDate()) {\n verticalRange.startSlot = verticalRange.endSlot = this._changeDate(selection, slot, reverse);\n } else {\n verticalRange.startSlot = verticalRange.endSlot = this._changeGroup(selection, reverse);\n }\n }\n return verticalRange;\n },\n _getNextVerticalRange: function (group, method, verticalRange, multiple) {\n verticalRange.startSlot = group[method](verticalRange.startSlot, multiple);\n verticalRange.endSlot = group[method](verticalRange.endSlot, multiple);\n return verticalRange;\n },\n _normalizeHorizontalSelection: function () {\n return null;\n },\n _normalizeVerticalSelection: function (selection, ranges, reverse) {\n var slot;\n if (reverse) {\n slot = ranges[0].start;\n } else {\n slot = ranges[ranges.length - 1].end;\n }\n return slot;\n },\n _continuousSlot: function () {\n return null;\n },\n constrainSelection: function (selection) {\n var group = this.groups[0];\n var slot;\n if (!this.inRange(selection)) {\n slot = group.firstSlot();\n selection.isAllDay = slot.isDaySlot;\n selection.start = slot.startDate();\n selection.end = slot.endDate();\n } else {\n if (!group.daySlotCollectionCount()) {\n selection.isAllDay = false;\n } else if (!group.timeSlotCollectionCount()) {\n selection.isAllDay = true;\n }\n }\n if (!this.groups[selection.groupIndex]) {\n selection.groupIndex = 0;\n }\n },\n move: function (selection, key, shift) {\n var handled = false;\n var group = this.groups[selection.groupIndex];\n var verticalByDate = this._isGroupedByDate() && this._isVerticallyGrouped();\n if (!group.timeSlotCollectionCount()) {\n selection.isAllDay = true;\n }\n var ranges = group.ranges(selection.start, selection.end, selection.isAllDay, false);\n var startSlot, endSlot, reverse, slots;\n if (key === keys.DOWN || key === keys.UP) {\n handled = true;\n reverse = key === keys.UP;\n this._updateDirection(selection, ranges, shift, reverse, true);\n slots = this._verticalSlots(selection, ranges, shift, reverse);\n if (!slots.startSlot && !shift && this._changeViewPeriod(selection, reverse, !verticalByDate)) {\n return handled;\n }\n } else if (key === keys.LEFT || key === keys.RIGHT) {\n handled = true;\n reverse = key === keys.LEFT;\n this._updateDirection(selection, ranges, shift, reverse, false);\n slots = this._horizontalSlots(selection, ranges, shift, reverse);\n if (!slots.startSlot && !shift && this._changeViewPeriod(selection, reverse, verticalByDate)) {\n return handled;\n }\n }\n if (handled) {\n startSlot = slots.startSlot;\n endSlot = slots.endSlot;\n if (shift) {\n var backward = selection.backward;\n if (backward && startSlot) {\n selection.start = startSlot.startDate();\n } else if (!backward && endSlot) {\n selection.end = endSlot.endDate();\n }\n } else if (startSlot && endSlot) {\n selection.isAllDay = startSlot.isDaySlot;\n selection.start = startSlot.startDate();\n selection.end = endSlot.endDate();\n }\n selection.events = [];\n }\n return handled;\n },\n moveToEventInGroup: function (group, slot, selectedEvents, prev) {\n var events = group._continuousEvents || [];\n var found, event;\n var pad = prev ? -1 : 1;\n var length = events.length;\n var idx = prev ? length - 1 : 0;\n while (idx < length && idx > -1) {\n event = events[idx];\n if (!prev && event.start.startDate() >= slot.startDate() || prev && event.start.startDate() <= slot.startDate()) {\n if (selectedEvents.length) {\n event = events[idx + pad];\n }\n if (event && $.inArray(event.uid, selectedEvents) === -1) {\n found = !!event;\n break;\n }\n }\n idx += pad;\n }\n return event;\n },\n moveToEvent: function (selection, prev) {\n var groupIndex = selection.groupIndex;\n var group = this.groups[groupIndex];\n var slot = group.ranges(selection.start, selection.end, selection.isAllDay, false)[0].start;\n var length = this.groups.length;\n var pad = prev ? -1 : 1;\n var events = selection.events;\n var event;\n if (this._isGroupedByDate()) {\n var allEvents = this._getAllEvents();\n var uniqueAllEvents = this._getUniqueEvents(allEvents);\n var sortedEvents = this._getSortedEvents(uniqueAllEvents);\n if (events.length === 0) {\n var eventIndex = this._getNextEventIndexBySlot(slot, sortedEvents, groupIndex);\n if (prev) {\n eventIndex--;\n }\n event = sortedEvents[eventIndex];\n } else {\n var idx = this._getStartIdx(events, sortedEvents);\n while (idx < sortedEvents.length && idx > -1) {\n if (events.length > 0) {\n slot = this._getSelectedSlot(slot, sortedEvents, event, idx, pad, prev);\n }\n if (!slot) {\n break;\n }\n if (!prev && sortedEvents[idx].start.startDate() >= slot.startDate() || prev && sortedEvents[idx].start.startDate() <= slot.startDate()) {\n if (events[0] != sortedEvents[idx].uid) {\n event = sortedEvents[idx];\n break;\n }\n }\n idx += pad;\n }\n }\n } else {\n while (groupIndex < length && groupIndex > -1) {\n event = this.moveToEventInGroup(group, slot, events, prev);\n groupIndex += pad;\n group = this.groups[groupIndex];\n if (!group || event) {\n break;\n }\n events = [];\n if (prev) {\n slot = group.lastSlot();\n } else {\n slot = group.firstSlot(true);\n }\n }\n }\n if (event) {\n selection.events = [event.uid];\n selection.start = event.start.startDate();\n selection.end = event.end.endDate();\n selection.isAllDay = event.start.isDaySlot;\n selection.groupIndex = event.start.groupIndex;\n }\n return !!event;\n },\n current: function (candidate) {\n if (candidate !== undefined) {\n this._current = candidate;\n if (this.content.has(candidate)) {\n this._scrollTo(candidate, this.content[0]);\n }\n } else {\n return this._current;\n }\n },\n select: function (selection) {\n this.clearSelection();\n if (!this._selectEvents(selection)) {\n this._selectSlots(selection);\n }\n },\n _getNextEventIndexBySlot: function (slot, sortedEvents, groupIndex) {\n var tempIndex = 0;\n var slotStartDate = kendo.date.getDate(slot.startDate());\n for (var i = 0; i < sortedEvents.length; i++) {\n var eventStartDate = kendo.date.getDate(sortedEvents[i].start.startDate());\n if (slotStartDate > eventStartDate) {\n tempIndex++;\n continue;\n }\n if (slotStartDate.getTime() === eventStartDate.getTime() && groupIndex > sortedEvents[i].start.groupIndex) {\n tempIndex++;\n continue;\n }\n if (slotStartDate.getTime() === eventStartDate.getTime() && groupIndex >= sortedEvents[i].start.groupIndex && slot.startDate() > sortedEvents[i].start.startDate()) {\n tempIndex++;\n continue;\n }\n break;\n }\n return tempIndex;\n },\n _getSelectedSlot: function (slot, sortedEvents, event, idx, pad, prev) {\n if (sortedEvents[idx + pad] && sortedEvents[idx].start.groupIndex !== sortedEvents[idx + pad].start.groupIndex) {\n var groupIndex = sortedEvents[idx + pad].start.groupIndex;\n var group = this.groups[groupIndex];\n if (!group || event) {\n slot = null;\n }\n if (prev) {\n slot = group.lastSlot();\n } else {\n slot = group.firstSlot(true);\n }\n }\n return slot;\n },\n _getStartIdx: function (events, sortedEvents) {\n var selectedEventIndex = 0;\n $.each(sortedEvents, function () {\n if (this.uid === events[0]) {\n return false;\n }\n selectedEventIndex++;\n });\n return selectedEventIndex;\n },\n _getAllEvents: function () {\n var allEvents = [];\n var groups = this.groups;\n for (var idx = 0; idx < groups.length; idx++) {\n if (groups[idx]._continuousEvents) {\n allEvents = allEvents.concat(groups[idx]._continuousEvents);\n }\n }\n return allEvents;\n },\n _getUniqueEvents: function (allEvents) {\n var uniqueAllEvents = [];\n for (var i = 0; i < allEvents.length; i++) {\n var exists = false;\n for (var j = 0; j < uniqueAllEvents.length; j++) {\n if (allEvents[i].uid === uniqueAllEvents[j].uid) {\n exists = true;\n break;\n }\n }\n if (!exists) {\n uniqueAllEvents.push(allEvents[i]);\n }\n }\n return uniqueAllEvents;\n },\n _getSortedEvents: function (uniqueAllEvents) {\n return uniqueAllEvents.sort(function (first, second) {\n var firstStartDate = first.start.startDate();\n var secondStartDate = second.start.startDate();\n var result = kendo.date.getDate(firstStartDate) - kendo.date.getDate(secondStartDate);\n if (result === 0) {\n result = first.start.groupIndex - second.start.groupIndex;\n }\n if (result === 0) {\n result = firstStartDate.getTime() - secondStartDate.getTime();\n }\n if (result === 0) {\n if (first.start.isDaySlot && !second.start.isDaySlot) {\n result = -1;\n }\n if (!first.start.isDaySlot && second.start.isDaySlot) {\n result = 1;\n }\n }\n if (result === 0) {\n result = $(first.element).index() - $(second.element).index();\n }\n return result;\n });\n },\n _selectSlots: function (selection) {\n var isAllDay = selection.isAllDay;\n var group = this.groups[selection.groupIndex];\n if (!group.timeSlotCollectionCount()) {\n isAllDay = true;\n }\n this._selectedSlots = [];\n var ranges = group.ranges(selection.start, selection.end, isAllDay, false);\n var element;\n var slot;\n for (var rangeIndex = 0; rangeIndex < ranges.length; rangeIndex++) {\n var range = ranges[rangeIndex];\n var collection = range.collection;\n for (var slotIndex = range.start.index; slotIndex <= range.end.index; slotIndex++) {\n slot = collection.at(slotIndex);\n element = slot.element;\n element.setAttribute('aria-selected', true);\n addSelectedState(element);\n this._selectedSlots.push({\n start: slot.startDate(),\n end: slot.endDate(),\n element: element\n });\n }\n }\n if (selection.backward) {\n element = ranges[0].start.element;\n }\n this.current(element);\n },\n _selectEvents: function (selection) {\n var found = false;\n var events = selection.events;\n var groupEvents = this.groups[selection.groupIndex]._continuousEvents || [];\n var idx, length = groupEvents.length;\n if (!events[0] || !groupEvents[0]) {\n return found;\n }\n var result = $();\n selection.events = [];\n for (idx = 0; idx < length; idx++) {\n if ($.inArray(groupEvents[idx].uid, events) > -1) {\n result = result.add(groupEvents[idx].element);\n selection.events.push(groupEvents[idx].uid);\n }\n }\n if (result[0]) {\n result.addClass('k-state-selected').attr('aria-selected', true);\n this.current(result.last()[0]);\n this._selectedSlots = [];\n found = true;\n }\n return found;\n },\n inRange: function (options) {\n var startDate = this.startDate();\n var endDate = kendo.date.addDays(this.endDate(), 1);\n var start = options.start;\n var end = options.end;\n return startDate <= start && start < endDate && startDate < end && end <= endDate;\n },\n _resourceValue: function (resource, item) {\n if (resource.valuePrimitive) {\n item = kendo.getter(resource.dataValueField)(item);\n }\n return item;\n },\n _resourceBySlot: function (slot) {\n var resources = this.groupedResources;\n var result = {};\n if (resources.length) {\n var resourceIndex = slot.groupIndex;\n for (var idx = resources.length - 1; idx >= 0; idx--) {\n var resource = resources[idx];\n var value = this._resourceValue(resource, resource.dataSource.view()[resourceIndex % resource.dataSource.total()]);\n if (resource.multiple) {\n value = [value];\n }\n var setter = kendo.setter(resource.field);\n setter(result, value);\n resourceIndex = Math.floor(resourceIndex / resource.dataSource.total());\n }\n }\n return result;\n },\n _createResizeHint: function (left, top, width, height) {\n return $(HINT).css({\n left: left,\n top: top,\n width: width,\n height: height\n });\n },\n _removeResizeHint: function () {\n this._resizeHint.remove();\n this._resizeHint = $();\n },\n _removeMoveHint: function () {\n this._moveHint.remove();\n this._moveHint = $();\n },\n _scrollTo: function (element, container) {\n var elementOffset = element.offsetTop, elementOffsetDir = element.offsetHeight, containerScroll = container.scrollTop, containerOffsetDir = container.clientHeight, bottomDistance = elementOffset + elementOffsetDir, result = 0;\n if (containerScroll > elementOffset) {\n result = elementOffset;\n } else if (bottomDistance > containerScroll + containerOffsetDir) {\n if (elementOffsetDir <= containerOffsetDir) {\n result = bottomDistance - containerOffsetDir;\n } else {\n result = elementOffset;\n }\n } else {\n result = containerScroll;\n }\n container.scrollTop = result;\n },\n _shouldInverseResourceColor: function (resource) {\n var resourceColorIsDark = new Color(resource.color).isDark();\n var currentColor = this.element.css('color');\n var currentColorIsDark = new Color(currentColor).isDark();\n return resourceColorIsDark == currentColorIsDark;\n },\n _eventTmpl: function (template, wrapper) {\n var options = this.options, settings = $.extend({}, kendo.Template, options.templateSettings), paramName = settings.paramName, html = '', type = typeof template, state = {\n storage: {},\n count: 0\n };\n if (type === 'function') {\n state.storage['tmpl' + state.count] = template;\n html += '#=this.tmpl' + state.count + '(' + paramName + ')#';\n state.count++;\n } else if (type === 'string') {\n html += template;\n }\n var tmpl = kendo.template(kendo.format(wrapper, html), settings);\n if (state.count > 0) {\n tmpl = $.proxy(tmpl, state.storage);\n }\n return tmpl;\n },\n eventResources: function (event) {\n var resources = [], options = this.options;\n if (!options.resources) {\n return resources;\n }\n for (var idx = 0; idx < options.resources.length; idx++) {\n var resource = options.resources[idx];\n var field = resource.field;\n var eventResources = kendo.getter(field)(event);\n if (eventResources == null) {\n continue;\n }\n if (!resource.multiple) {\n eventResources = [eventResources];\n }\n var data = resource.dataSource.view();\n for (var resourceIndex = 0; resourceIndex < eventResources.length; resourceIndex++) {\n var eventResource = null;\n var value = eventResources[resourceIndex];\n if (!resource.valuePrimitive) {\n value = kendo.getter(resource.dataValueField)(value);\n }\n for (var dataIndex = 0; dataIndex < data.length; dataIndex++) {\n if (data[dataIndex].get(resource.dataValueField) == value) {\n eventResource = data[dataIndex];\n break;\n }\n }\n if (eventResource !== null) {\n var resourceColor = kendo.getter(resource.dataColorField)(eventResource);\n resources.push({\n field: resource.field,\n title: resource.title,\n name: resource.name,\n text: kendo.getter(resource.dataTextField)(eventResource),\n value: value,\n color: resourceColor\n });\n }\n }\n }\n return resources;\n },\n createLayout: function (layout) {\n var allDayIndex = -1;\n if (!layout.rows) {\n layout.rows = [];\n }\n for (var idx = 0; idx < layout.rows.length; idx++) {\n if (layout.rows[idx].allDay) {\n allDayIndex = idx;\n break;\n }\n }\n var allDaySlot = layout.rows[allDayIndex];\n if (allDayIndex >= 0) {\n layout.rows.splice(allDayIndex, 1);\n }\n var columnLevels = this.columnLevels = levels(layout, 'columns');\n var rowLevels = this.rowLevels = levels(layout, 'rows');\n this.table = $('
');\n var rowCount = rowLevels[rowLevels.length - 1].length;\n this.table.find('tbody:first').append(this._topSection(columnLevels, allDaySlot, rowCount));\n this.table.find('tbody:first').append(this._bottomSection(columnLevels, rowLevels, rowCount));\n this.element.append(this.table);\n this._scroller();\n },\n refreshLayout: function () {\n var that = this, toolbar = that.element.find('>.k-scheduler-toolbar'), height = that.element.innerHeight(), scrollbar = this._scrollbar, headerHeight = 0, paddingDirection = this._isRtl ? 'left' : 'right';\n for (var idx = 0; idx < toolbar.length; idx++) {\n height -= outerHeight(toolbar.eq(idx));\n }\n if (that.datesHeader) {\n headerHeight = outerHeight(that.datesHeader);\n }\n if (that.timesHeader && outerHeight(that.timesHeader) > headerHeight) {\n headerHeight = outerHeight(that.timesHeader);\n }\n if (that.datesHeader && that.timesHeader) {\n var datesHeaderRows = that.datesHeader.find('table:first tr');\n that.timesHeader.find('tr').height(function (index) {\n $(this).height(datesHeaderRows.eq(index).height());\n });\n }\n if (headerHeight) {\n height -= headerHeight;\n }\n if (that.footer) {\n height -= outerHeight(that.footer);\n }\n var isSchedulerHeightSet = function (el) {\n var initialHeight, newHeight;\n if (el[0].style.height) {\n return true;\n } else {\n initialHeight = el.height();\n }\n el.height('auto');\n newHeight = el.height();\n if (initialHeight != newHeight) {\n el.height('');\n return true;\n }\n el.height('');\n return false;\n };\n var contentDiv = that.content[0], scrollbarWidth = !kendo.support.kineticScrollNeeded ? scrollbar : 0;\n if (isSchedulerHeightSet(that.element)) {\n if (height > scrollbar * 2) {\n that.content.height(height);\n } else {\n that.content.height(scrollbar * 2 + 1);\n }\n that.times.height(contentDiv.clientHeight);\n var timesTable = that.times.find('table');\n if (timesTable.length) {\n timesTable.height(that.content.find('table')[0].clientHeight);\n }\n }\n if (contentDiv.offsetWidth - contentDiv.clientWidth > 0) {\n that.table.addClass('k-scrollbar-v');\n that.datesHeader.css('padding-' + paddingDirection, scrollbarWidth - parseInt(that.datesHeader.children().css('border-' + paddingDirection + '-width'), 10));\n } else {\n that.datesHeader.css('padding-' + paddingDirection, '');\n }\n if (contentDiv.offsetHeight - contentDiv.clientHeight > 0 || contentDiv.clientHeight > that.content.children('.k-scheduler-table').height()) {\n that.table.addClass('k-scrollbar-h');\n } else {\n that.table.removeClass('k-scrollbar-h');\n }\n },\n _topSection: function (columnLevels, allDaySlot, rowCount) {\n this.timesHeader = timesHeader(columnLevels.length, allDaySlot, rowCount);\n var columnCount = columnLevels[columnLevels.length - 1].length;\n this.datesHeader = datesHeader(columnLevels, columnCount, allDaySlot);\n return $('').append(this.timesHeader.add(this.datesHeader).wrap('').parent());\n },\n _bottomSection: function (columnLevels, rowLevels, rowCount) {\n this.times = times(rowLevels, rowCount);\n this.content = content(columnLevels[columnLevels.length - 1], rowLevels[rowLevels.length - 1]);\n return $('').append(this.times.add(this.content).wrap('').parent());\n },\n _scroller: function () {\n var that = this;\n this.content.bind('scroll' + NS, function () {\n that.datesHeader.find('>.k-scheduler-header-wrap').scrollLeft(this.scrollLeft);\n that.times.scrollTop(this.scrollTop);\n });\n var touchScroller = kendo.touchScroller(this.content, {\n avoidScrolling: function (e) {\n return $(e.event.target).closest('.k-event.k-event-active').length > 0;\n }\n });\n if (touchScroller && touchScroller.movable) {\n this._touchScroller = touchScroller;\n this.content = touchScroller.scrollElement;\n touchScroller.movable.bind('change', function (e) {\n that.datesHeader.find('>.k-scheduler-header-wrap').scrollLeft(-e.sender.x);\n that.times.scrollTop(-e.sender.y);\n });\n }\n },\n _resourcesForGroups: function () {\n var result = [];\n var groups = this.options.group;\n var resources = this.options.resources;\n groups = groups && groups.resources ? groups.resources : [];\n if (resources && groups.length) {\n for (var idx = 0, length = resources.length; idx < length; idx++) {\n for (var groupIdx = 0, groupLength = groups.length; groupIdx < groupLength; groupIdx++) {\n if (resources[idx].name === groups[groupIdx]) {\n result.push(resources[idx]);\n }\n }\n }\n }\n this.groupedResources = result;\n },\n _createDateLayout: function (dates, inner, times) {\n return createDateLayoutConfiguration('rows', dates, inner, times);\n },\n _createColumnsLayout: function (resources, inner, template, dates, times) {\n return createLayoutConfiguration('columns', resources, inner, template, dates, times);\n },\n _groupOrientation: function () {\n var groups = this.options.group;\n return groups && groups.resources ? groups.orientation : 'horizontal';\n },\n _isGroupedByDate: function () {\n return this.options.group && this.options.group.date;\n },\n _isVerticallyGrouped: function () {\n return this.groupedResources.length && this._groupOrientation() === 'vertical';\n },\n _createRowsLayout: function (resources, inner, template, dates) {\n return createLayoutConfiguration('rows', resources, inner, template, dates);\n },\n selectionByElement: function () {\n return null;\n },\n clearSelection: function () {\n this.content.find('.k-state-selected').removeAttr('id').attr('aria-selected', false).removeClass('k-state-selected');\n },\n destroy: function () {\n var that = this;\n Widget.fn.destroy.call(this);\n if (that.table) {\n kendo.destroy(that.table);\n that.table.remove();\n }\n that.groups = null;\n that.table = null;\n that.content = null;\n that.times = null;\n that.datesHeader = null;\n that.timesHeader = null;\n that.footer = null;\n that._resizeHint = null;\n that._moveHint = null;\n },\n calendarInfo: function () {\n return kendo.getCulture().calendars.standard;\n },\n prevGroupSlot: function (date, groupIndex, isDay) {\n var collection;\n var group = this.groups[groupIndex];\n var slot = group.ranges(date, date, isDay, false)[0].start;\n if (groupIndex <= 0) {\n return;\n }\n if (this._isGroupedByDate()) {\n return slot;\n }\n if (this._isVerticallyGrouped()) {\n if (!group.timeSlotCollectionCount()) {\n collection = group._collection(group.daySlotCollectionCount() - 1, true);\n return collection.at(slot.index);\n } else {\n collection = group._collection(isDay ? slot.index : slot.collectionIndex, false);\n return collection.last();\n }\n } else {\n if (!group.timeSlotCollectionCount()) {\n collection = group._collection(slot.collectionIndex, true);\n return collection.last();\n } else {\n collection = group._collection(isDay ? 0 : group.timeSlotCollectionCount() - 1, isDay);\n return isDay ? collection.last() : collection.at(slot.index);\n }\n }\n },\n nextGroupSlot: function (date, groupIndex, isDay) {\n var collection;\n var group = this.groups[groupIndex];\n var slot = group.ranges(date, date, isDay, false)[0].start;\n var daySlotCollectionCount;\n if (groupIndex >= this.groups.length - 1) {\n return;\n }\n if (this._isGroupedByDate()) {\n return slot;\n }\n if (this._isVerticallyGrouped()) {\n if (!group.timeSlotCollectionCount()) {\n collection = group._collection(0, true);\n return collection.at(slot.index);\n } else {\n daySlotCollectionCount = group.daySlotCollectionCount();\n collection = group._collection(daySlotCollectionCount ? 0 : slot.collectionIndex, daySlotCollectionCount);\n return isDay ? collection.first() : collection.at(slot.collectionIndex);\n }\n } else {\n if (!group.timeSlotCollectionCount()) {\n collection = group._collection(slot.collectionIndex, true);\n return collection.first();\n } else {\n collection = group._collection(0, isDay);\n return isDay ? collection.first() : collection.at(slot.index);\n }\n }\n },\n _eventOptionsForMove: function () {\n return {};\n },\n _updateEventForResize: function () {\n return;\n },\n _updateEventForSelection: function (event) {\n return event;\n }\n });\n function collidingEvents(elements, start, end) {\n var idx, index, startIndex, overlaps, endIndex;\n for (idx = elements.length - 1; idx >= 0; idx--) {\n index = rangeIndex(elements[idx]);\n startIndex = index.start;\n endIndex = index.end;\n overlaps = startIndex <= start && endIndex >= start;\n if (overlaps || startIndex >= start && endIndex <= end || start <= startIndex && end >= startIndex) {\n if (startIndex < start) {\n start = startIndex;\n }\n if (endIndex > end) {\n end = endIndex;\n }\n }\n }\n return eventsForSlot(elements, start, end);\n }\n function rangeIndex(eventElement) {\n return {\n start: eventElement.start,\n end: eventElement.end\n };\n }\n function eventsForSlot(elements, slotStart, slotEnd) {\n var events = [];\n for (var idx = 0; idx < elements.length; idx++) {\n var event = rangeIndex(elements[idx]);\n if (event.start < slotStart && event.end > slotStart || event.start >= slotStart && event.end <= slotEnd) {\n events.push(elements[idx]);\n }\n }\n return events;\n }\n function createColumns(eventElements) {\n return _createColumns(eventElements);\n }\n function createRows(eventElements) {\n return _createColumns(eventElements);\n }\n var Color = function (value) {\n var color = this, formats = Color.formats, re, processor, parts, i, channels;\n if (arguments.length === 1) {\n value = color.resolveColor(value);\n for (i = 0; i < formats.length; i++) {\n re = formats[i].re;\n processor = formats[i].process;\n parts = re.exec(value);\n if (parts) {\n channels = processor(parts);\n color.r = channels[0];\n color.g = channels[1];\n color.b = channels[2];\n }\n }\n } else {\n color.r = arguments[0];\n color.g = arguments[1];\n color.b = arguments[2];\n }\n color.r = color.normalizeByte(color.r);\n color.g = color.normalizeByte(color.g);\n color.b = color.normalizeByte(color.b);\n };\n Color.prototype = {\n resolveColor: function (value) {\n value = value || '#000';\n if (value.charAt(0) == '#') {\n value = value.substr(1, 6);\n }\n value = value.replace(/ /g, '');\n value = value.toLowerCase();\n value = Color.namedColors[value] || value;\n return value;\n },\n normalizeByte: function (value) {\n return value < 0 || isNaN(value) ? 0 : value > 255 ? 255 : value;\n },\n percBrightness: function () {\n var color = this;\n return math.sqrt(0.241 * color.r * color.r + 0.691 * color.g * color.g + 0.068 * color.b * color.b);\n },\n isDark: function () {\n var color = this;\n var brightnessValue = color.percBrightness();\n return brightnessValue < 180;\n }\n };\n Color.formats = [\n {\n re: /^rgb\\((\\d{1,3}),\\s*(\\d{1,3}),\\s*(\\d{1,3})\\)$/,\n process: function (parts) {\n return [\n parseInt(parts[1], 10),\n parseInt(parts[2], 10),\n parseInt(parts[3], 10)\n ];\n }\n },\n {\n re: /^(\\w{2})(\\w{2})(\\w{2})$/,\n process: function (parts) {\n return [\n parseInt(parts[1], 16),\n parseInt(parts[2], 16),\n parseInt(parts[3], 16)\n ];\n }\n },\n {\n re: /^(\\w{1})(\\w{1})(\\w{1})$/,\n process: function (parts) {\n return [\n parseInt(parts[1] + parts[1], 16),\n parseInt(parts[2] + parts[2], 16),\n parseInt(parts[3] + parts[3], 16)\n ];\n }\n }\n ];\n Color.namedColors = {\n aqua: '00ffff',\n azure: 'f0ffff',\n beige: 'f5f5dc',\n black: '000000',\n blue: '0000ff',\n brown: 'a52a2a',\n coral: 'ff7f50',\n cyan: '00ffff',\n darkblue: '00008b',\n darkcyan: '008b8b',\n darkgray: 'a9a9a9',\n darkgreen: '006400',\n darkorange: 'ff8c00',\n darkred: '8b0000',\n dimgray: '696969',\n fuchsia: 'ff00ff',\n gold: 'ffd700',\n goldenrod: 'daa520',\n gray: '808080',\n green: '008000',\n greenyellow: 'adff2f',\n indigo: '4b0082',\n ivory: 'fffff0',\n khaki: 'f0e68c',\n lightblue: 'add8e6',\n lightgrey: 'd3d3d3',\n lightgreen: '90ee90',\n lightpink: 'ffb6c1',\n lightyellow: 'ffffe0',\n lime: '00ff00',\n limegreen: '32cd32',\n linen: 'faf0e6',\n magenta: 'ff00ff',\n maroon: '800000',\n mediumblue: '0000cd',\n navy: '000080',\n olive: '808000',\n orange: 'ffa500',\n orangered: 'ff4500',\n orchid: 'da70d6',\n pink: 'ffc0cb',\n plum: 'dda0dd',\n purple: '800080',\n red: 'ff0000',\n royalblue: '4169e1',\n salmon: 'fa8072',\n silver: 'c0c0c0',\n skyblue: '87ceeb',\n slateblue: '6a5acd',\n slategray: '708090',\n snow: 'fffafa',\n steelblue: '4682b4',\n tan: 'd2b48c',\n teal: '008080',\n tomato: 'ff6347',\n turquoise: '40e0d0',\n violet: 'ee82ee',\n wheat: 'f5deb3',\n white: 'ffffff',\n whitesmoke: 'f5f5f5',\n yellow: 'ffff00',\n yellowgreen: '9acd32'\n };\n function _createColumns(eventElements) {\n var columns = [];\n for (var idx = 0; idx < eventElements.length; idx++) {\n var event = eventElements[idx];\n var eventRange = rangeIndex(event);\n var column = null;\n for (var j = 0, columnLength = columns.length; j < columnLength; j++) {\n var endOverlaps = eventRange.start > columns[j].end;\n if (eventRange.start < columns[j].start || endOverlaps) {\n column = columns[j];\n if (column.end < eventRange.end) {\n column.end = eventRange.end;\n }\n break;\n }\n }\n if (!column) {\n column = {\n start: eventRange.start,\n end: eventRange.end,\n events: []\n };\n columns.push(column);\n }\n column.events.push(event);\n }\n return columns;\n }\n function createDateLayoutConfiguration(name, dates, inner, times) {\n var configuration = [];\n $.each(dates, function (index, item) {\n var className = item.className ? 'k-slot-cell ' + item.className : 'k-slot-cell';\n var obj = {\n text: item.text,\n className: className\n };\n if (times && !item.minorTicks) {\n obj[name] = createDateLayoutConfiguration(name, item.columns, inner, times);\n } else {\n obj[name] = inner;\n }\n configuration.push(obj);\n });\n return configuration;\n }\n function createLayoutConfiguration(name, resources, inner, template, dates, times) {\n var resource = resources[0];\n var configuration = [];\n if (resource) {\n if (dates && inner) {\n $.each(dates, function (index, item) {\n if (times && !item.minorTicks) {\n item[name] = createLayoutConfiguration(name, resources, item.columns, template, item.columns, times);\n } else {\n item[name] = createLayoutConfiguration(name, resources, null, template);\n }\n });\n configuration = dates;\n } else {\n var data = resource.dataSource.view();\n for (var dataIndex = 0; dataIndex < data.length; dataIndex++) {\n var obj = {\n text: template({\n text: kendo.htmlEncode(kendo.getter(resource.dataTextField)(data[dataIndex])),\n color: kendo.getter(resource.dataColorField)(data[dataIndex]),\n field: resource.field,\n title: resource.title,\n name: resource.name,\n value: kendo.getter(resource.dataValueField)(data[dataIndex])\n }),\n className: 'k-slot-cell'\n };\n obj[name] = createLayoutConfiguration(name, resources.slice(1), inner, template);\n configuration.push(obj);\n }\n }\n return configuration;\n }\n return inner;\n }\n function groupEqFilter(value) {\n return function (item) {\n if ($.isArray(item) || item instanceof kendo.data.ObservableArray) {\n for (var idx = 0; idx < item.length; idx++) {\n if (item[idx] == value) {\n return true;\n }\n }\n return false;\n }\n return item == value;\n };\n }\n var selectedStateRegExp = /\\s*k-state-selected/;\n function addSelectedState(cell) {\n cell.className = cell.className.replace(selectedStateRegExp, '') + ' k-state-selected';\n }\n $.extend(ui.SchedulerView, {\n createColumns: createColumns,\n createRows: createRows,\n rangeIndex: rangeIndex,\n collidingEvents: collidingEvents,\n groupEqFilter: groupEqFilter\n });\n }(window.kendo.jQuery));\n return window.kendo;\n}, typeof define == 'function' && define.amd ? define : function (a1, a2, a3) {\n (a3 || a2)();\n}));"],"sourceRoot":"/source/"}