1 ?\n ' colspan=\"' + colspan + '\"' :\n '') +\n (otherAttrs ?\n ' ' + otherAttrs :\n '') +\n '>' +\n (isDateValid ?\n // don't make a link if the heading could represent multiple days, or if there's only one day (forceOff)\n buildGotoAnchorHtml(view, { date: dateMarker, forceOff: !datesRepDistinctDays || colCnt === 1 }, innerHtml) :\n // if not valid, display text, but no link\n innerHtml) +\n '
';\n }\n\n var DayHeader = /** @class */ (function (_super) {\n __extends(DayHeader, _super);\n function DayHeader(context, parentEl) {\n var _this = _super.call(this, context) || this;\n parentEl.innerHTML = ''; // because might be nbsp\n parentEl.appendChild(_this.el = htmlToElement('
' +\n '
' +\n '' +\n '
' +\n '
'));\n _this.thead = _this.el.querySelector('thead');\n return _this;\n }\n DayHeader.prototype.destroy = function () {\n removeElement(this.el);\n };\n DayHeader.prototype.render = function (props) {\n var dates = props.dates, datesRepDistinctDays = props.datesRepDistinctDays;\n var parts = [];\n if (props.renderIntroHtml) {\n parts.push(props.renderIntroHtml());\n }\n var colHeadFormat = createFormatter(this.opt('columnHeaderFormat') ||\n computeFallbackHeaderFormat(datesRepDistinctDays, dates.length));\n for (var _i = 0, dates_1 = dates; _i < dates_1.length; _i++) {\n var date = dates_1[_i];\n parts.push(renderDateCell(date, props.dateProfile, datesRepDistinctDays, dates.length, colHeadFormat, this.context));\n }\n if (this.isRtl) {\n parts.reverse();\n }\n this.thead.innerHTML = '
' + parts.join('') + '
';\n };\n return DayHeader;\n }(Component));\n\n var DaySeries = /** @class */ (function () {\n function DaySeries(range, dateProfileGenerator) {\n var date = range.start;\n var end = range.end;\n var indices = [];\n var dates = [];\n var dayIndex = -1;\n while (date < end) { // loop each day from start to end\n if (dateProfileGenerator.isHiddenDay(date)) {\n indices.push(dayIndex + 0.5); // mark that it's between indices\n }\n else {\n dayIndex++;\n indices.push(dayIndex);\n dates.push(date);\n }\n date = addDays(date, 1);\n }\n this.dates = dates;\n this.indices = indices;\n this.cnt = dates.length;\n }\n DaySeries.prototype.sliceRange = function (range) {\n var firstIndex = this.getDateDayIndex(range.start); // inclusive first index\n var lastIndex = this.getDateDayIndex(addDays(range.end, -1)); // inclusive last index\n var clippedFirstIndex = Math.max(0, firstIndex);\n var clippedLastIndex = Math.min(this.cnt - 1, lastIndex);\n // deal with in-between indices\n clippedFirstIndex = Math.ceil(clippedFirstIndex); // in-between starts round to next cell\n clippedLastIndex = Math.floor(clippedLastIndex); // in-between ends round to prev cell\n if (clippedFirstIndex <= clippedLastIndex) {\n return {\n firstIndex: clippedFirstIndex,\n lastIndex: clippedLastIndex,\n isStart: firstIndex === clippedFirstIndex,\n isEnd: lastIndex === clippedLastIndex\n };\n }\n else {\n return null;\n }\n };\n // Given a date, returns its chronolocial cell-index from the first cell of the grid.\n // If the date lies between cells (because of hiddenDays), returns a floating-point value between offsets.\n // If before the first offset, returns a negative number.\n // If after the last offset, returns an offset past the last cell offset.\n // Only works for *start* dates of cells. Will not work for exclusive end dates for cells.\n DaySeries.prototype.getDateDayIndex = function (date) {\n var indices = this.indices;\n var dayOffset = Math.floor(diffDays(this.dates[0], date));\n if (dayOffset < 0) {\n return indices[0] - 1;\n }\n else if (dayOffset >= indices.length) {\n return indices[indices.length - 1] + 1;\n }\n else {\n return indices[dayOffset];\n }\n };\n return DaySeries;\n }());\n\n var DayTable = /** @class */ (function () {\n function DayTable(daySeries, breakOnWeeks) {\n var dates = daySeries.dates;\n var daysPerRow;\n var firstDay;\n var rowCnt;\n if (breakOnWeeks) {\n // count columns until the day-of-week repeats\n firstDay = dates[0].getUTCDay();\n for (daysPerRow = 1; daysPerRow < dates.length; daysPerRow++) {\n if (dates[daysPerRow].getUTCDay() === firstDay) {\n break;\n }\n }\n rowCnt = Math.ceil(dates.length / daysPerRow);\n }\n else {\n rowCnt = 1;\n daysPerRow = dates.length;\n }\n this.rowCnt = rowCnt;\n this.colCnt = daysPerRow;\n this.daySeries = daySeries;\n this.cells = this.buildCells();\n this.headerDates = this.buildHeaderDates();\n }\n DayTable.prototype.buildCells = function () {\n var rows = [];\n for (var row = 0; row < this.rowCnt; row++) {\n var cells = [];\n for (var col = 0; col < this.colCnt; col++) {\n cells.push(this.buildCell(row, col));\n }\n rows.push(cells);\n }\n return rows;\n };\n DayTable.prototype.buildCell = function (row, col) {\n return {\n date: this.daySeries.dates[row * this.colCnt + col]\n };\n };\n DayTable.prototype.buildHeaderDates = function () {\n var dates = [];\n for (var col = 0; col < this.colCnt; col++) {\n dates.push(this.cells[0][col].date);\n }\n return dates;\n };\n DayTable.prototype.sliceRange = function (range) {\n var colCnt = this.colCnt;\n var seriesSeg = this.daySeries.sliceRange(range);\n var segs = [];\n if (seriesSeg) {\n var firstIndex = seriesSeg.firstIndex, lastIndex = seriesSeg.lastIndex;\n var index = firstIndex;\n while (index <= lastIndex) {\n var row = Math.floor(index / colCnt);\n var nextIndex = Math.min((row + 1) * colCnt, lastIndex + 1);\n segs.push({\n row: row,\n firstCol: index % colCnt,\n lastCol: (nextIndex - 1) % colCnt,\n isStart: seriesSeg.isStart && index === firstIndex,\n isEnd: seriesSeg.isEnd && (nextIndex - 1) === lastIndex\n });\n index = nextIndex;\n }\n }\n return segs;\n };\n return DayTable;\n }());\n\n var Slicer = /** @class */ (function () {\n function Slicer() {\n this.sliceBusinessHours = memoize(this._sliceBusinessHours);\n this.sliceDateSelection = memoize(this._sliceDateSpan);\n this.sliceEventStore = memoize(this._sliceEventStore);\n this.sliceEventDrag = memoize(this._sliceInteraction);\n this.sliceEventResize = memoize(this._sliceInteraction);\n }\n Slicer.prototype.sliceProps = function (props, dateProfile, nextDayThreshold, component) {\n var extraArgs = [];\n for (var _i = 4; _i < arguments.length; _i++) {\n extraArgs[_i - 4] = arguments[_i];\n }\n var eventUiBases = props.eventUiBases;\n var eventSegs = this.sliceEventStore.apply(this, [props.eventStore, eventUiBases, dateProfile, nextDayThreshold, component].concat(extraArgs));\n return {\n dateSelectionSegs: this.sliceDateSelection.apply(this, [props.dateSelection, eventUiBases, component].concat(extraArgs)),\n businessHourSegs: this.sliceBusinessHours.apply(this, [props.businessHours, dateProfile, nextDayThreshold, component].concat(extraArgs)),\n fgEventSegs: eventSegs.fg,\n bgEventSegs: eventSegs.bg,\n eventDrag: this.sliceEventDrag.apply(this, [props.eventDrag, eventUiBases, dateProfile, nextDayThreshold, component].concat(extraArgs)),\n eventResize: this.sliceEventResize.apply(this, [props.eventResize, eventUiBases, dateProfile, nextDayThreshold, component].concat(extraArgs)),\n eventSelection: props.eventSelection\n }; // TODO: give interactionSegs?\n };\n Slicer.prototype.sliceNowDate = function (// does not memoize\n date, component) {\n var extraArgs = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n extraArgs[_i - 2] = arguments[_i];\n }\n return this._sliceDateSpan.apply(this, [{ range: { start: date, end: addMs(date, 1) }, allDay: false },\n {},\n component].concat(extraArgs));\n };\n Slicer.prototype._sliceBusinessHours = function (businessHours, dateProfile, nextDayThreshold, component) {\n var extraArgs = [];\n for (var _i = 4; _i < arguments.length; _i++) {\n extraArgs[_i - 4] = arguments[_i];\n }\n if (!businessHours) {\n return [];\n }\n return this._sliceEventStore.apply(this, [expandRecurring(businessHours, computeActiveRange(dateProfile, Boolean(nextDayThreshold)), component.calendar),\n {},\n dateProfile,\n nextDayThreshold,\n component].concat(extraArgs)).bg;\n };\n Slicer.prototype._sliceEventStore = function (eventStore, eventUiBases, dateProfile, nextDayThreshold, component) {\n var extraArgs = [];\n for (var _i = 5; _i < arguments.length; _i++) {\n extraArgs[_i - 5] = arguments[_i];\n }\n if (eventStore) {\n var rangeRes = sliceEventStore(eventStore, eventUiBases, computeActiveRange(dateProfile, Boolean(nextDayThreshold)), nextDayThreshold);\n return {\n bg: this.sliceEventRanges(rangeRes.bg, component, extraArgs),\n fg: this.sliceEventRanges(rangeRes.fg, component, extraArgs)\n };\n }\n else {\n return { bg: [], fg: [] };\n }\n };\n Slicer.prototype._sliceInteraction = function (interaction, eventUiBases, dateProfile, nextDayThreshold, component) {\n var extraArgs = [];\n for (var _i = 5; _i < arguments.length; _i++) {\n extraArgs[_i - 5] = arguments[_i];\n }\n if (!interaction) {\n return null;\n }\n var rangeRes = sliceEventStore(interaction.mutatedEvents, eventUiBases, computeActiveRange(dateProfile, Boolean(nextDayThreshold)), nextDayThreshold);\n return {\n segs: this.sliceEventRanges(rangeRes.fg, component, extraArgs),\n affectedInstances: interaction.affectedEvents.instances,\n isEvent: interaction.isEvent,\n sourceSeg: interaction.origSeg\n };\n };\n Slicer.prototype._sliceDateSpan = function (dateSpan, eventUiBases, component) {\n var extraArgs = [];\n for (var _i = 3; _i < arguments.length; _i++) {\n extraArgs[_i - 3] = arguments[_i];\n }\n if (!dateSpan) {\n return [];\n }\n var eventRange = fabricateEventRange(dateSpan, eventUiBases, component.calendar);\n var segs = this.sliceRange.apply(this, [dateSpan.range].concat(extraArgs));\n for (var _a = 0, segs_1 = segs; _a < segs_1.length; _a++) {\n var seg = segs_1[_a];\n seg.component = component;\n seg.eventRange = eventRange;\n }\n return segs;\n };\n /*\n \"complete\" seg means it has component and eventRange\n */\n Slicer.prototype.sliceEventRanges = function (eventRanges, component, // TODO: kill\n extraArgs) {\n var segs = [];\n for (var _i = 0, eventRanges_1 = eventRanges; _i < eventRanges_1.length; _i++) {\n var eventRange = eventRanges_1[_i];\n segs.push.apply(segs, this.sliceEventRange(eventRange, component, extraArgs));\n }\n return segs;\n };\n /*\n \"complete\" seg means it has component and eventRange\n */\n Slicer.prototype.sliceEventRange = function (eventRange, component, // TODO: kill\n extraArgs) {\n var segs = this.sliceRange.apply(this, [eventRange.range].concat(extraArgs));\n for (var _i = 0, segs_2 = segs; _i < segs_2.length; _i++) {\n var seg = segs_2[_i];\n seg.component = component;\n seg.eventRange = eventRange;\n seg.isStart = eventRange.isStart && seg.isStart;\n seg.isEnd = eventRange.isEnd && seg.isEnd;\n }\n return segs;\n };\n return Slicer;\n }());\n /*\n for incorporating minTime/maxTime if appropriate\n TODO: should be part of DateProfile!\n TimelineDateProfile already does this btw\n */\n function computeActiveRange(dateProfile, isComponentAllDay) {\n var range = dateProfile.activeRange;\n if (isComponentAllDay) {\n return range;\n }\n return {\n start: addMs(range.start, dateProfile.minTime.milliseconds),\n end: addMs(range.end, dateProfile.maxTime.milliseconds - 864e5) // 864e5 = ms in a day\n };\n }\n\n // exports\n // --------------------------------------------------------------------------------------------------\n var version = '4.3.1';\n\n exports.Calendar = Calendar;\n exports.Component = Component;\n exports.DateComponent = DateComponent;\n exports.DateEnv = DateEnv;\n exports.DateProfileGenerator = DateProfileGenerator;\n exports.DayHeader = DayHeader;\n exports.DaySeries = DaySeries;\n exports.DayTable = DayTable;\n exports.ElementDragging = ElementDragging;\n exports.ElementScrollController = ElementScrollController;\n exports.EmitterMixin = EmitterMixin;\n exports.EventApi = EventApi;\n exports.FgEventRenderer = FgEventRenderer;\n exports.FillRenderer = FillRenderer;\n exports.Interaction = Interaction;\n exports.Mixin = Mixin;\n exports.NamedTimeZoneImpl = NamedTimeZoneImpl;\n exports.PositionCache = PositionCache;\n exports.ScrollComponent = ScrollComponent;\n exports.ScrollController = ScrollController;\n exports.Slicer = Slicer;\n exports.Splitter = Splitter;\n exports.Theme = Theme;\n exports.View = View;\n exports.WindowScrollController = WindowScrollController;\n exports.addDays = addDays;\n exports.addDurations = addDurations;\n exports.addMs = addMs;\n exports.addWeeks = addWeeks;\n exports.allowContextMenu = allowContextMenu;\n exports.allowSelection = allowSelection;\n exports.appendToElement = appendToElement;\n exports.applyAll = applyAll;\n exports.applyMutationToEventStore = applyMutationToEventStore;\n exports.applyStyle = applyStyle;\n exports.applyStyleProp = applyStyleProp;\n exports.asRoughMinutes = asRoughMinutes;\n exports.asRoughMs = asRoughMs;\n exports.asRoughSeconds = asRoughSeconds;\n exports.buildGotoAnchorHtml = buildGotoAnchorHtml;\n exports.buildSegCompareObj = buildSegCompareObj;\n exports.capitaliseFirstLetter = capitaliseFirstLetter;\n exports.combineEventUis = combineEventUis;\n exports.compareByFieldSpec = compareByFieldSpec;\n exports.compareByFieldSpecs = compareByFieldSpecs;\n exports.compareNumbers = compareNumbers;\n exports.compensateScroll = compensateScroll;\n exports.computeClippingRect = computeClippingRect;\n exports.computeEdges = computeEdges;\n exports.computeFallbackHeaderFormat = computeFallbackHeaderFormat;\n exports.computeHeightAndMargins = computeHeightAndMargins;\n exports.computeInnerRect = computeInnerRect;\n exports.computeRect = computeRect;\n exports.computeVisibleDayRange = computeVisibleDayRange;\n exports.config = config;\n exports.constrainPoint = constrainPoint;\n exports.createDuration = createDuration;\n exports.createElement = createElement;\n exports.createEmptyEventStore = createEmptyEventStore;\n exports.createEventInstance = createEventInstance;\n exports.createFormatter = createFormatter;\n exports.createPlugin = createPlugin;\n exports.cssToStr = cssToStr;\n exports.debounce = debounce;\n exports.diffDates = diffDates;\n exports.diffDayAndTime = diffDayAndTime;\n exports.diffDays = diffDays;\n exports.diffPoints = diffPoints;\n exports.diffWeeks = diffWeeks;\n exports.diffWholeDays = diffWholeDays;\n exports.diffWholeWeeks = diffWholeWeeks;\n exports.disableCursor = disableCursor;\n exports.distributeHeight = distributeHeight;\n exports.elementClosest = elementClosest;\n exports.elementMatches = elementMatches;\n exports.enableCursor = enableCursor;\n exports.eventTupleToStore = eventTupleToStore;\n exports.filterEventStoreDefs = filterEventStoreDefs;\n exports.filterHash = filterHash;\n exports.findChildren = findChildren;\n exports.findElements = findElements;\n exports.flexibleCompare = flexibleCompare;\n exports.forceClassName = forceClassName;\n exports.formatDate = formatDate;\n exports.formatIsoTimeString = formatIsoTimeString;\n exports.formatRange = formatRange;\n exports.getAllDayHtml = getAllDayHtml;\n exports.getClippingParents = getClippingParents;\n exports.getDayClasses = getDayClasses;\n exports.getElSeg = getElSeg;\n exports.getRectCenter = getRectCenter;\n exports.getRelevantEvents = getRelevantEvents;\n exports.globalDefaults = globalDefaults;\n exports.greatestDurationDenominator = greatestDurationDenominator;\n exports.hasBgRendering = hasBgRendering;\n exports.htmlEscape = htmlEscape;\n exports.htmlToElement = htmlToElement;\n exports.insertAfterElement = insertAfterElement;\n exports.interactionSettingsStore = interactionSettingsStore;\n exports.interactionSettingsToStore = interactionSettingsToStore;\n exports.intersectRanges = intersectRanges;\n exports.intersectRects = intersectRects;\n exports.isArraysEqual = isArraysEqual;\n exports.isDateSpansEqual = isDateSpansEqual;\n exports.isInt = isInt;\n exports.isInteractionValid = isInteractionValid;\n exports.isMultiDayRange = isMultiDayRange;\n exports.isPropsEqual = isPropsEqual;\n exports.isPropsValid = isPropsValid;\n exports.isSingleDay = isSingleDay;\n exports.isValidDate = isValidDate;\n exports.listenBySelector = listenBySelector;\n exports.mapHash = mapHash;\n exports.matchCellWidths = matchCellWidths;\n exports.memoize = memoize;\n exports.memoizeOutput = memoizeOutput;\n exports.memoizeRendering = memoizeRendering;\n exports.mergeEventStores = mergeEventStores;\n exports.multiplyDuration = multiplyDuration;\n exports.padStart = padStart;\n exports.parseBusinessHours = parseBusinessHours;\n exports.parseDragMeta = parseDragMeta;\n exports.parseEventDef = parseEventDef;\n exports.parseFieldSpecs = parseFieldSpecs;\n exports.parseMarker = parse;\n exports.pointInsideRect = pointInsideRect;\n exports.prependToElement = prependToElement;\n exports.preventContextMenu = preventContextMenu;\n exports.preventDefault = preventDefault;\n exports.preventSelection = preventSelection;\n exports.processScopedUiProps = processScopedUiProps;\n exports.rangeContainsMarker = rangeContainsMarker;\n exports.rangeContainsRange = rangeContainsRange;\n exports.rangesEqual = rangesEqual;\n exports.rangesIntersect = rangesIntersect;\n exports.refineProps = refineProps;\n exports.removeElement = removeElement;\n exports.removeExact = removeExact;\n exports.renderDateCell = renderDateCell;\n exports.requestJson = requestJson;\n exports.sliceEventStore = sliceEventStore;\n exports.startOfDay = startOfDay;\n exports.subtractInnerElHeight = subtractInnerElHeight;\n exports.translateRect = translateRect;\n exports.uncompensateScroll = uncompensateScroll;\n exports.undistributeHeight = undistributeHeight;\n exports.unpromisify = unpromisify;\n exports.version = version;\n exports.whenTransitionDone = whenTransitionDone;\n exports.wholeDivideDurations = wholeDivideDurations;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n}));\n","/*!\nFullCalendar Day Grid Plugin v4.3.0\nDocs & License: https://fullcalendar.io/\n(c) 2019 Adam Shaw\n*/\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@fullcalendar/core')) :\n typeof define === 'function' && define.amd ? define(['exports', '@fullcalendar/core'], factory) :\n (global = global || self, factory(global.FullCalendarDayGrid = {}, global.FullCalendar));\n}(this, function (exports, core) { 'use strict';\n\n /*! *****************************************************************************\r\n Copyright (c) Microsoft Corporation. All rights reserved.\r\n Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\n this file except in compliance with the License. You may obtain a copy of the\r\n License at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\n THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\n WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\n MERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\n See the Apache Version 2.0 License for specific language governing permissions\r\n and limitations under the License.\r\n ***************************************************************************** */\r\n /* global Reflect, Promise */\r\n\r\n var extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n };\r\n\r\n function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n }\r\n\r\n var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n };\n\n var DayGridDateProfileGenerator = /** @class */ (function (_super) {\n __extends(DayGridDateProfileGenerator, _super);\n function DayGridDateProfileGenerator() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n // Computes the date range that will be rendered.\n DayGridDateProfileGenerator.prototype.buildRenderRange = function (currentRange, currentRangeUnit, isRangeAllDay) {\n var dateEnv = this.dateEnv;\n var renderRange = _super.prototype.buildRenderRange.call(this, currentRange, currentRangeUnit, isRangeAllDay);\n var start = renderRange.start;\n var end = renderRange.end;\n var endOfWeek;\n // year and month views should be aligned with weeks. this is already done for week\n if (/^(year|month)$/.test(currentRangeUnit)) {\n start = dateEnv.startOfWeek(start);\n // make end-of-week if not already\n endOfWeek = dateEnv.startOfWeek(end);\n if (endOfWeek.valueOf() !== end.valueOf()) {\n end = core.addWeeks(endOfWeek, 1);\n }\n }\n // ensure 6 weeks\n if (this.options.monthMode &&\n this.options.fixedWeekCount) {\n var rowCnt = Math.ceil(// could be partial weeks due to hiddenDays\n core.diffWeeks(start, end));\n end = core.addWeeks(end, 6 - rowCnt);\n }\n return { start: start, end: end };\n };\n return DayGridDateProfileGenerator;\n }(core.DateProfileGenerator));\n\n /* A rectangular panel that is absolutely positioned over other content\n ------------------------------------------------------------------------------------------------------------------------\n Options:\n - className (string)\n - content (HTML string, element, or element array)\n - parentEl\n - top\n - left\n - right (the x coord of where the right edge should be. not a \"CSS\" right)\n - autoHide (boolean)\n - show (callback)\n - hide (callback)\n */\n var Popover = /** @class */ (function () {\n function Popover(options) {\n var _this = this;\n this.isHidden = true;\n this.margin = 10; // the space required between the popover and the edges of the scroll container\n // Triggered when the user clicks *anywhere* in the document, for the autoHide feature\n this.documentMousedown = function (ev) {\n // only hide the popover if the click happened outside the popover\n if (_this.el && !_this.el.contains(ev.target)) {\n _this.hide();\n }\n };\n this.options = options;\n }\n // Shows the popover on the specified position. Renders it if not already\n Popover.prototype.show = function () {\n if (this.isHidden) {\n if (!this.el) {\n this.render();\n }\n this.el.style.display = '';\n this.position();\n this.isHidden = false;\n this.trigger('show');\n }\n };\n // Hides the popover, through CSS, but does not remove it from the DOM\n Popover.prototype.hide = function () {\n if (!this.isHidden) {\n this.el.style.display = 'none';\n this.isHidden = true;\n this.trigger('hide');\n }\n };\n // Creates `this.el` and renders content inside of it\n Popover.prototype.render = function () {\n var _this = this;\n var options = this.options;\n var el = this.el = core.createElement('div', {\n className: 'fc-popover ' + (options.className || ''),\n style: {\n top: '0',\n left: '0'\n }\n });\n if (typeof options.content === 'function') {\n options.content(el);\n }\n options.parentEl.appendChild(el);\n // when a click happens on anything inside with a 'fc-close' className, hide the popover\n core.listenBySelector(el, 'click', '.fc-close', function (ev) {\n _this.hide();\n });\n if (options.autoHide) {\n document.addEventListener('mousedown', this.documentMousedown);\n }\n };\n // Hides and unregisters any handlers\n Popover.prototype.destroy = function () {\n this.hide();\n if (this.el) {\n core.removeElement(this.el);\n this.el = null;\n }\n document.removeEventListener('mousedown', this.documentMousedown);\n };\n // Positions the popover optimally, using the top/left/right options\n Popover.prototype.position = function () {\n var options = this.options;\n var el = this.el;\n var elDims = el.getBoundingClientRect(); // only used for width,height\n var origin = core.computeRect(el.offsetParent);\n var clippingRect = core.computeClippingRect(options.parentEl);\n var top; // the \"position\" (not \"offset\") values for the popover\n var left; //\n // compute top and left\n top = options.top || 0;\n if (options.left !== undefined) {\n left = options.left;\n }\n else if (options.right !== undefined) {\n left = options.right - elDims.width; // derive the left value from the right value\n }\n else {\n left = 0;\n }\n // constrain to the view port. if constrained by two edges, give precedence to top/left\n top = Math.min(top, clippingRect.bottom - elDims.height - this.margin);\n top = Math.max(top, clippingRect.top + this.margin);\n left = Math.min(left, clippingRect.right - elDims.width - this.margin);\n left = Math.max(left, clippingRect.left + this.margin);\n core.applyStyle(el, {\n top: top - origin.top,\n left: left - origin.left\n });\n };\n // Triggers a callback. Calls a function in the option hash of the same name.\n // Arguments beyond the first `name` are forwarded on.\n // TODO: better code reuse for this. Repeat code\n // can kill this???\n Popover.prototype.trigger = function (name) {\n if (this.options[name]) {\n this.options[name].apply(this, Array.prototype.slice.call(arguments, 1));\n }\n };\n return Popover;\n }());\n\n /* Event-rendering methods for the DayGrid class\n ----------------------------------------------------------------------------------------------------------------------*/\n // \"Simple\" is bad a name. has nothing to do with SimpleDayGrid\n var SimpleDayGridEventRenderer = /** @class */ (function (_super) {\n __extends(SimpleDayGridEventRenderer, _super);\n function SimpleDayGridEventRenderer() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n // Builds the HTML to be used for the default element for an individual segment\n SimpleDayGridEventRenderer.prototype.renderSegHtml = function (seg, mirrorInfo) {\n var _a = this.context, view = _a.view, options = _a.options;\n var eventRange = seg.eventRange;\n var eventDef = eventRange.def;\n var eventUi = eventRange.ui;\n var allDay = eventDef.allDay;\n var isDraggable = view.computeEventDraggable(eventDef, eventUi);\n var isResizableFromStart = allDay && seg.isStart && view.computeEventStartResizable(eventDef, eventUi);\n var isResizableFromEnd = allDay && seg.isEnd && view.computeEventEndResizable(eventDef, eventUi);\n var classes = this.getSegClasses(seg, isDraggable, isResizableFromStart || isResizableFromEnd, mirrorInfo);\n var skinCss = core.cssToStr(this.getSkinCss(eventUi));\n var timeHtml = '';\n var timeText;\n var titleHtml;\n classes.unshift('fc-day-grid-event', 'fc-h-event');\n // Only display a timed events time if it is the starting segment\n if (seg.isStart) {\n timeText = this.getTimeText(eventRange);\n if (timeText) {\n timeHtml = '' + core.htmlEscape(timeText) + '';\n }\n }\n titleHtml =\n '' +\n (core.htmlEscape(eventDef.title || '') || ' ') + // we always want one line of height\n '';\n return '' +\n '
' +\n (isResizableFromStart ?\n '' :\n '') +\n (isResizableFromEnd ?\n '' :\n '') +\n '';\n };\n // Computes a default event time formatting string if `eventTimeFormat` is not explicitly defined\n SimpleDayGridEventRenderer.prototype.computeEventTimeFormat = function () {\n return {\n hour: 'numeric',\n minute: '2-digit',\n omitZeroMinute: true,\n meridiem: 'narrow'\n };\n };\n SimpleDayGridEventRenderer.prototype.computeDisplayEventEnd = function () {\n return false; // TODO: somehow consider the originating DayGrid's column count\n };\n return SimpleDayGridEventRenderer;\n }(core.FgEventRenderer));\n\n /* Event-rendering methods for the DayGrid class\n ----------------------------------------------------------------------------------------------------------------------*/\n var DayGridEventRenderer = /** @class */ (function (_super) {\n __extends(DayGridEventRenderer, _super);\n function DayGridEventRenderer(dayGrid) {\n var _this = _super.call(this, dayGrid.context) || this;\n _this.dayGrid = dayGrid;\n return _this;\n }\n // Renders the given foreground event segments onto the grid\n DayGridEventRenderer.prototype.attachSegs = function (segs, mirrorInfo) {\n var rowStructs = this.rowStructs = this.renderSegRows(segs);\n // append to each row's content skeleton\n this.dayGrid.rowEls.forEach(function (rowNode, i) {\n rowNode.querySelector('.fc-content-skeleton > table').appendChild(rowStructs[i].tbodyEl);\n });\n // removes the \"more..\" events popover\n if (!mirrorInfo) {\n this.dayGrid.removeSegPopover();\n }\n };\n // Unrenders all currently rendered foreground event segments\n DayGridEventRenderer.prototype.detachSegs = function () {\n var rowStructs = this.rowStructs || [];\n var rowStruct;\n while ((rowStruct = rowStructs.pop())) {\n core.removeElement(rowStruct.tbodyEl);\n }\n this.rowStructs = null;\n };\n // Uses the given events array to generate elements that should be appended to each row's content skeleton.\n // Returns an array of rowStruct objects (see the bottom of `renderSegRow`).\n // PRECONDITION: each segment shoud already have a rendered and assigned `.el`\n DayGridEventRenderer.prototype.renderSegRows = function (segs) {\n var rowStructs = [];\n var segRows;\n var row;\n segRows = this.groupSegRows(segs); // group into nested arrays\n // iterate each row of segment groupings\n for (row = 0; row < segRows.length; row++) {\n rowStructs.push(this.renderSegRow(row, segRows[row]));\n }\n return rowStructs;\n };\n // Given a row # and an array of segments all in the same row, render a element, a skeleton that contains\n // the segments. Returns object with a bunch of internal data about how the render was calculated.\n // NOTE: modifies rowSegs\n DayGridEventRenderer.prototype.renderSegRow = function (row, rowSegs) {\n var dayGrid = this.dayGrid;\n var colCnt = dayGrid.colCnt, isRtl = dayGrid.isRtl;\n var segLevels = this.buildSegLevels(rowSegs); // group into sub-arrays of levels\n var levelCnt = Math.max(1, segLevels.length); // ensure at least one level\n var tbody = document.createElement('tbody');\n var segMatrix = []; // lookup for which segments are rendered into which level+col cells\n var cellMatrix = []; // lookup for all
elements of the level+col matrix\n var loneCellMatrix = []; // lookup for
elements that only take up a single column\n var i;\n var levelSegs;\n var col;\n var tr;\n var j;\n var seg;\n var td;\n // populates empty cells from the current column (`col`) to `endCol`\n function emptyCellsUntil(endCol) {\n while (col < endCol) {\n // try to grab a cell from the level above and extend its rowspan. otherwise, create a fresh cell\n td = (loneCellMatrix[i - 1] || [])[col];\n if (td) {\n td.rowSpan = (td.rowSpan || 1) + 1;\n }\n else {\n td = document.createElement('td');\n tr.appendChild(td);\n }\n cellMatrix[i][col] = td;\n loneCellMatrix[i][col] = td;\n col++;\n }\n }\n for (i = 0; i < levelCnt; i++) { // iterate through all levels\n levelSegs = segLevels[i];\n col = 0;\n tr = document.createElement('tr');\n segMatrix.push([]);\n cellMatrix.push([]);\n loneCellMatrix.push([]);\n // levelCnt might be 1 even though there are no actual levels. protect against this.\n // this single empty row is useful for styling.\n if (levelSegs) {\n for (j = 0; j < levelSegs.length; j++) { // iterate through segments in level\n seg = levelSegs[j];\n var leftCol = isRtl ? (colCnt - 1 - seg.lastCol) : seg.firstCol;\n var rightCol = isRtl ? (colCnt - 1 - seg.firstCol) : seg.lastCol;\n emptyCellsUntil(leftCol);\n // create a container that occupies or more columns. append the event element.\n td = core.createElement('td', { className: 'fc-event-container' }, seg.el);\n if (leftCol !== rightCol) {\n td.colSpan = rightCol - leftCol + 1;\n }\n else { // a single-column segment\n loneCellMatrix[i][col] = td;\n }\n while (col <= rightCol) {\n cellMatrix[i][col] = td;\n segMatrix[i][col] = seg;\n col++;\n }\n tr.appendChild(td);\n }\n }\n emptyCellsUntil(colCnt); // finish off the row\n var introHtml = dayGrid.renderProps.renderIntroHtml();\n if (introHtml) {\n if (dayGrid.isRtl) {\n core.appendToElement(tr, introHtml);\n }\n else {\n core.prependToElement(tr, introHtml);\n }\n }\n tbody.appendChild(tr);\n }\n return {\n row: row,\n tbodyEl: tbody,\n cellMatrix: cellMatrix,\n segMatrix: segMatrix,\n segLevels: segLevels,\n segs: rowSegs\n };\n };\n // Stacks a flat array of segments, which are all assumed to be in the same row, into subarrays of vertical levels.\n // NOTE: modifies segs\n DayGridEventRenderer.prototype.buildSegLevels = function (segs) {\n var _a = this.dayGrid, isRtl = _a.isRtl, colCnt = _a.colCnt;\n var levels = [];\n var i;\n var seg;\n var j;\n // Give preference to elements with certain criteria, so they have\n // a chance to be closer to the top.\n segs = this.sortEventSegs(segs);\n for (i = 0; i < segs.length; i++) {\n seg = segs[i];\n // loop through levels, starting with the topmost, until the segment doesn't collide with other segments\n for (j = 0; j < levels.length; j++) {\n if (!isDaySegCollision(seg, levels[j])) {\n break;\n }\n }\n // `j` now holds the desired subrow index\n seg.level = j;\n seg.leftCol = isRtl ? (colCnt - 1 - seg.lastCol) : seg.firstCol; // for sorting only\n seg.rightCol = isRtl ? (colCnt - 1 - seg.firstCol) : seg.lastCol // for sorting only\n ;\n (levels[j] || (levels[j] = [])).push(seg);\n }\n // order segments left-to-right. very important if calendar is RTL\n for (j = 0; j < levels.length; j++) {\n levels[j].sort(compareDaySegCols);\n }\n return levels;\n };\n // Given a flat array of segments, return an array of sub-arrays, grouped by each segment's row\n DayGridEventRenderer.prototype.groupSegRows = function (segs) {\n var segRows = [];\n var i;\n for (i = 0; i < this.dayGrid.rowCnt; i++) {\n segRows.push([]);\n }\n for (i = 0; i < segs.length; i++) {\n segRows[segs[i].row].push(segs[i]);\n }\n return segRows;\n };\n // Computes a default `displayEventEnd` value if one is not expliclty defined\n DayGridEventRenderer.prototype.computeDisplayEventEnd = function () {\n return this.dayGrid.colCnt === 1; // we'll likely have space if there's only one day\n };\n return DayGridEventRenderer;\n }(SimpleDayGridEventRenderer));\n // Computes whether two segments' columns collide. They are assumed to be in the same row.\n function isDaySegCollision(seg, otherSegs) {\n var i;\n var otherSeg;\n for (i = 0; i < otherSegs.length; i++) {\n otherSeg = otherSegs[i];\n if (otherSeg.firstCol <= seg.lastCol &&\n otherSeg.lastCol >= seg.firstCol) {\n return true;\n }\n }\n return false;\n }\n // A cmp function for determining the leftmost event\n function compareDaySegCols(a, b) {\n return a.leftCol - b.leftCol;\n }\n\n var DayGridMirrorRenderer = /** @class */ (function (_super) {\n __extends(DayGridMirrorRenderer, _super);\n function DayGridMirrorRenderer() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n DayGridMirrorRenderer.prototype.attachSegs = function (segs, mirrorInfo) {\n var sourceSeg = mirrorInfo.sourceSeg;\n var rowStructs = this.rowStructs = this.renderSegRows(segs);\n // inject each new event skeleton into each associated row\n this.dayGrid.rowEls.forEach(function (rowNode, row) {\n var skeletonEl = core.htmlToElement('
'); // will be absolutely positioned\n var skeletonTopEl;\n var skeletonTop;\n // If there is an original segment, match the top position. Otherwise, put it at the row's top level\n if (sourceSeg && sourceSeg.row === row) {\n skeletonTopEl = sourceSeg.el;\n }\n else {\n skeletonTopEl = rowNode.querySelector('.fc-content-skeleton tbody');\n if (!skeletonTopEl) { // when no events\n skeletonTopEl = rowNode.querySelector('.fc-content-skeleton table');\n }\n }\n skeletonTop = skeletonTopEl.getBoundingClientRect().top -\n rowNode.getBoundingClientRect().top; // the offsetParent origin\n skeletonEl.style.top = skeletonTop + 'px';\n skeletonEl.querySelector('table').appendChild(rowStructs[row].tbodyEl);\n rowNode.appendChild(skeletonEl);\n });\n };\n return DayGridMirrorRenderer;\n }(DayGridEventRenderer));\n\n var EMPTY_CELL_HTML = '
';\n var DayGridFillRenderer = /** @class */ (function (_super) {\n __extends(DayGridFillRenderer, _super);\n function DayGridFillRenderer(dayGrid) {\n var _this = _super.call(this, dayGrid.context) || this;\n _this.fillSegTag = 'td'; // override the default tag name\n _this.dayGrid = dayGrid;\n return _this;\n }\n DayGridFillRenderer.prototype.renderSegs = function (type, segs) {\n // don't render timed background events\n if (type === 'bgEvent') {\n segs = segs.filter(function (seg) {\n return seg.eventRange.def.allDay;\n });\n }\n _super.prototype.renderSegs.call(this, type, segs);\n };\n DayGridFillRenderer.prototype.attachSegs = function (type, segs) {\n var els = [];\n var i;\n var seg;\n var skeletonEl;\n for (i = 0; i < segs.length; i++) {\n seg = segs[i];\n skeletonEl = this.renderFillRow(type, seg);\n this.dayGrid.rowEls[seg.row].appendChild(skeletonEl);\n els.push(skeletonEl);\n }\n return els;\n };\n // Generates the HTML needed for one row of a fill. Requires the seg's el to be rendered.\n DayGridFillRenderer.prototype.renderFillRow = function (type, seg) {\n var dayGrid = this.dayGrid;\n var colCnt = dayGrid.colCnt, isRtl = dayGrid.isRtl;\n var leftCol = isRtl ? (colCnt - 1 - seg.lastCol) : seg.firstCol;\n var rightCol = isRtl ? (colCnt - 1 - seg.firstCol) : seg.lastCol;\n var startCol = leftCol;\n var endCol = rightCol + 1;\n var className;\n var skeletonEl;\n var trEl;\n if (type === 'businessHours') {\n className = 'bgevent';\n }\n else {\n className = type.toLowerCase();\n }\n skeletonEl = core.htmlToElement('
' +\n '
' +\n '
');\n trEl = skeletonEl.getElementsByTagName('tr')[0];\n if (startCol > 0) {\n core.appendToElement(trEl, \n // will create (startCol + 1) td's\n new Array(startCol + 1).join(EMPTY_CELL_HTML));\n }\n seg.el.colSpan = endCol - startCol;\n trEl.appendChild(seg.el);\n if (endCol < colCnt) {\n core.appendToElement(trEl, \n // will create (colCnt - endCol) td's\n new Array(colCnt - endCol + 1).join(EMPTY_CELL_HTML));\n }\n var introHtml = dayGrid.renderProps.renderIntroHtml();\n if (introHtml) {\n if (dayGrid.isRtl) {\n core.appendToElement(trEl, introHtml);\n }\n else {\n core.prependToElement(trEl, introHtml);\n }\n }\n return skeletonEl;\n };\n return DayGridFillRenderer;\n }(core.FillRenderer));\n\n var DayTile = /** @class */ (function (_super) {\n __extends(DayTile, _super);\n function DayTile(context, el) {\n var _this = _super.call(this, context, el) || this;\n var eventRenderer = _this.eventRenderer = new DayTileEventRenderer(_this);\n var renderFrame = _this.renderFrame = core.memoizeRendering(_this._renderFrame);\n _this.renderFgEvents = core.memoizeRendering(eventRenderer.renderSegs.bind(eventRenderer), eventRenderer.unrender.bind(eventRenderer), [renderFrame]);\n _this.renderEventSelection = core.memoizeRendering(eventRenderer.selectByInstanceId.bind(eventRenderer), eventRenderer.unselectByInstanceId.bind(eventRenderer), [_this.renderFgEvents]);\n _this.renderEventDrag = core.memoizeRendering(eventRenderer.hideByHash.bind(eventRenderer), eventRenderer.showByHash.bind(eventRenderer), [renderFrame]);\n _this.renderEventResize = core.memoizeRendering(eventRenderer.hideByHash.bind(eventRenderer), eventRenderer.showByHash.bind(eventRenderer), [renderFrame]);\n context.calendar.registerInteractiveComponent(_this, {\n el: _this.el,\n useEventCenter: false\n });\n return _this;\n }\n DayTile.prototype.render = function (props) {\n this.renderFrame(props.date);\n this.renderFgEvents(props.fgSegs);\n this.renderEventSelection(props.eventSelection);\n this.renderEventDrag(props.eventDragInstances);\n this.renderEventResize(props.eventResizeInstances);\n };\n DayTile.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n this.renderFrame.unrender(); // should unrender everything else\n this.calendar.unregisterInteractiveComponent(this);\n };\n DayTile.prototype._renderFrame = function (date) {\n var _a = this, theme = _a.theme, dateEnv = _a.dateEnv;\n var title = dateEnv.format(date, core.createFormatter(this.opt('dayPopoverFormat')) // TODO: cache\n );\n this.el.innerHTML =\n '
';\n };\n DayGrid.prototype.renderNumberCellsHtml = function (row) {\n var htmls = [];\n var col;\n var date;\n for (col = 0; col < this.colCnt; col++) {\n date = this.props.cells[row][col].date;\n htmls.push(this.renderNumberCellHtml(date));\n }\n if (this.isRtl) {\n htmls.reverse();\n }\n return htmls.join('');\n };\n // Generates the HTML for the
s of the \"number\" row in the DayGrid's content skeleton.\n // The number row will only exist if either day numbers or week numbers are turned on.\n DayGrid.prototype.renderNumberCellHtml = function (date) {\n var _a = this, view = _a.view, dateEnv = _a.dateEnv;\n var html = '';\n var isDateValid = core.rangeContainsMarker(this.props.dateProfile.activeRange, date); // TODO: called too frequently. cache somehow.\n var isDayNumberVisible = this.getIsDayNumbersVisible() && isDateValid;\n var classes;\n var weekCalcFirstDow;\n if (!isDayNumberVisible && !this.renderProps.cellWeekNumbersVisible) {\n // no numbers in day cell (week number must be along the side)\n return '
'; // will create an empty space above events :(\n }\n classes = core.getDayClasses(date, this.props.dateProfile, this.context);\n classes.unshift('fc-day-top');\n if (this.renderProps.cellWeekNumbersVisible) {\n weekCalcFirstDow = dateEnv.weekDow;\n }\n html += '
';\n if (this.renderProps.cellWeekNumbersVisible && (date.getUTCDay() === weekCalcFirstDow)) {\n html += core.buildGotoAnchorHtml(view, { date: date, type: 'week' }, { 'class': 'fc-week-number' }, dateEnv.format(date, WEEK_NUM_FORMAT) // inner HTML\n );\n }\n if (isDayNumberVisible) {\n html += core.buildGotoAnchorHtml(view, date, { 'class': 'fc-day-number' }, dateEnv.format(date, DAY_NUM_FORMAT) // inner HTML\n );\n }\n html += '
';\n return html;\n };\n /* Sizing\n ------------------------------------------------------------------------------------------------------------------*/\n DayGrid.prototype.updateSize = function (isResize) {\n var _a = this, fillRenderer = _a.fillRenderer, eventRenderer = _a.eventRenderer, mirrorRenderer = _a.mirrorRenderer;\n if (isResize ||\n this.isCellSizesDirty ||\n this.view.calendar.isEventsUpdated // hack\n ) {\n this.buildPositionCaches();\n this.isCellSizesDirty = false;\n }\n fillRenderer.computeSizes(isResize);\n eventRenderer.computeSizes(isResize);\n mirrorRenderer.computeSizes(isResize);\n fillRenderer.assignSizes(isResize);\n eventRenderer.assignSizes(isResize);\n mirrorRenderer.assignSizes(isResize);\n };\n DayGrid.prototype.buildPositionCaches = function () {\n this.buildColPositions();\n this.buildRowPositions();\n };\n DayGrid.prototype.buildColPositions = function () {\n this.colPositions.build();\n };\n DayGrid.prototype.buildRowPositions = function () {\n this.rowPositions.build();\n this.rowPositions.bottoms[this.rowCnt - 1] += this.bottomCoordPadding; // hack\n };\n /* Hit System\n ------------------------------------------------------------------------------------------------------------------*/\n DayGrid.prototype.positionToHit = function (leftPosition, topPosition) {\n var _a = this, colPositions = _a.colPositions, rowPositions = _a.rowPositions;\n var col = colPositions.leftToIndex(leftPosition);\n var row = rowPositions.topToIndex(topPosition);\n if (row != null && col != null) {\n return {\n row: row,\n col: col,\n dateSpan: {\n range: this.getCellRange(row, col),\n allDay: true\n },\n dayEl: this.getCellEl(row, col),\n relativeRect: {\n left: colPositions.lefts[col],\n right: colPositions.rights[col],\n top: rowPositions.tops[row],\n bottom: rowPositions.bottoms[row]\n }\n };\n }\n };\n /* Cell System\n ------------------------------------------------------------------------------------------------------------------*/\n // FYI: the first column is the leftmost column, regardless of date\n DayGrid.prototype.getCellEl = function (row, col) {\n return this.cellEls[row * this.colCnt + col];\n };\n /* Event Drag Visualization\n ------------------------------------------------------------------------------------------------------------------*/\n DayGrid.prototype._renderEventDrag = function (state) {\n if (state) {\n this.eventRenderer.hideByHash(state.affectedInstances);\n this.fillRenderer.renderSegs('highlight', state.segs);\n }\n };\n DayGrid.prototype._unrenderEventDrag = function (state) {\n if (state) {\n this.eventRenderer.showByHash(state.affectedInstances);\n this.fillRenderer.unrender('highlight');\n }\n };\n /* Event Resize Visualization\n ------------------------------------------------------------------------------------------------------------------*/\n DayGrid.prototype._renderEventResize = function (state) {\n if (state) {\n this.eventRenderer.hideByHash(state.affectedInstances);\n this.fillRenderer.renderSegs('highlight', state.segs);\n this.mirrorRenderer.renderSegs(state.segs, { isResizing: true, sourceSeg: state.sourceSeg });\n }\n };\n DayGrid.prototype._unrenderEventResize = function (state) {\n if (state) {\n this.eventRenderer.showByHash(state.affectedInstances);\n this.fillRenderer.unrender('highlight');\n this.mirrorRenderer.unrender(state.segs, { isResizing: true, sourceSeg: state.sourceSeg });\n }\n };\n /* More+ Link Popover\n ------------------------------------------------------------------------------------------------------------------*/\n DayGrid.prototype.removeSegPopover = function () {\n if (this.segPopover) {\n this.segPopover.hide(); // in handler, will call segPopover's removeElement\n }\n };\n // Limits the number of \"levels\" (vertically stacking layers of events) for each row of the grid.\n // `levelLimit` can be false (don't limit), a number, or true (should be computed).\n DayGrid.prototype.limitRows = function (levelLimit) {\n var rowStructs = this.eventRenderer.rowStructs || [];\n var row; // row #\n var rowLevelLimit;\n for (row = 0; row < rowStructs.length; row++) {\n this.unlimitRow(row);\n if (!levelLimit) {\n rowLevelLimit = false;\n }\n else if (typeof levelLimit === 'number') {\n rowLevelLimit = levelLimit;\n }\n else {\n rowLevelLimit = this.computeRowLevelLimit(row);\n }\n if (rowLevelLimit !== false) {\n this.limitRow(row, rowLevelLimit);\n }\n }\n };\n // Computes the number of levels a row will accomodate without going outside its bounds.\n // Assumes the row is \"rigid\" (maintains a constant height regardless of what is inside).\n // `row` is the row number.\n DayGrid.prototype.computeRowLevelLimit = function (row) {\n var rowEl = this.rowEls[row]; // the containing \"fake\" row div\n var rowBottom = rowEl.getBoundingClientRect().bottom; // relative to viewport!\n var trEls = core.findChildren(this.eventRenderer.rowStructs[row].tbodyEl);\n var i;\n var trEl;\n // Reveal one level
at a time and stop when we find one out of bounds\n for (i = 0; i < trEls.length; i++) {\n trEl = trEls[i];\n trEl.classList.remove('fc-limited'); // reset to original state (reveal)\n if (trEl.getBoundingClientRect().bottom > rowBottom) {\n return i;\n }\n }\n return false; // should not limit at all\n };\n // Limits the given grid row to the maximum number of levels and injects \"more\" links if necessary.\n // `row` is the row number.\n // `levelLimit` is a number for the maximum (inclusive) number of levels allowed.\n DayGrid.prototype.limitRow = function (row, levelLimit) {\n var _this = this;\n var _a = this, colCnt = _a.colCnt, isRtl = _a.isRtl;\n var rowStruct = this.eventRenderer.rowStructs[row];\n var moreNodes = []; // array of \"more\" links and
DOM nodes\n var col = 0; // col #, left-to-right (not chronologically)\n var levelSegs; // array of segment objects in the last allowable level, ordered left-to-right\n var cellMatrix; // a matrix (by level, then column) of all
elements in the row\n var limitedNodes; // array of temporarily hidden level
and segment
DOM nodes\n var i;\n var seg;\n var segsBelow; // array of segment objects below `seg` in the current `col`\n var totalSegsBelow; // total number of segments below `seg` in any of the columns `seg` occupies\n var colSegsBelow; // array of segment arrays, below seg, one for each column (offset from segs's first column)\n var td;\n var rowSpan;\n var segMoreNodes; // array of \"more\"
cells that will stand-in for the current seg's cell\n var j;\n var moreTd;\n var moreWrap;\n var moreLink;\n // Iterates through empty level cells and places \"more\" links inside if need be\n var emptyCellsUntil = function (endCol) {\n while (col < endCol) {\n segsBelow = _this.getCellSegs(row, col, levelLimit);\n if (segsBelow.length) {\n td = cellMatrix[levelLimit - 1][col];\n moreLink = _this.renderMoreLink(row, col, segsBelow);\n moreWrap = core.createElement('div', null, moreLink);\n td.appendChild(moreWrap);\n moreNodes.push(moreWrap);\n }\n col++;\n }\n };\n if (levelLimit && levelLimit < rowStruct.segLevels.length) { // is it actually over the limit?\n levelSegs = rowStruct.segLevels[levelLimit - 1];\n cellMatrix = rowStruct.cellMatrix;\n limitedNodes = core.findChildren(rowStruct.tbodyEl).slice(levelLimit); // get level
elements past the limit\n limitedNodes.forEach(function (node) {\n node.classList.add('fc-limited'); // hide elements and get a simple DOM-nodes array\n });\n // iterate though segments in the last allowable level\n for (i = 0; i < levelSegs.length; i++) {\n seg = levelSegs[i];\n var leftCol = isRtl ? (colCnt - 1 - seg.lastCol) : seg.firstCol;\n var rightCol = isRtl ? (colCnt - 1 - seg.firstCol) : seg.lastCol;\n emptyCellsUntil(leftCol); // process empty cells before the segment\n // determine *all* segments below `seg` that occupy the same columns\n colSegsBelow = [];\n totalSegsBelow = 0;\n while (col <= rightCol) {\n segsBelow = this.getCellSegs(row, col, levelLimit);\n colSegsBelow.push(segsBelow);\n totalSegsBelow += segsBelow.length;\n col++;\n }\n if (totalSegsBelow) { // do we need to replace this segment with one or many \"more\" links?\n td = cellMatrix[levelLimit - 1][leftCol]; // the segment's parent cell\n rowSpan = td.rowSpan || 1;\n segMoreNodes = [];\n // make a replacement
to avoid border confusion.\n if (this.isRtl) {\n options.right = core.computeRect(moreWrap).right + 1; // +1 to be over cell border\n }\n else {\n options.left = core.computeRect(moreWrap).left - 1; // -1 to be over cell border\n }\n this.segPopover = new Popover(options);\n this.segPopover.show();\n calendar.releaseAfterSizingTriggers(); // hack for eventPositioned\n };\n // Given the events within an array of segment objects, reslice them to be in a single day\n DayGrid.prototype.resliceDaySegs = function (segs, dayDate) {\n var dayStart = dayDate;\n var dayEnd = core.addDays(dayStart, 1);\n var dayRange = { start: dayStart, end: dayEnd };\n var newSegs = [];\n for (var _i = 0, segs_1 = segs; _i < segs_1.length; _i++) {\n var seg = segs_1[_i];\n var eventRange = seg.eventRange;\n var origRange = eventRange.range;\n var slicedRange = core.intersectRanges(origRange, dayRange);\n if (slicedRange) {\n newSegs.push(__assign({}, seg, { eventRange: {\n def: eventRange.def,\n ui: __assign({}, eventRange.ui, { durationEditable: false }),\n instance: eventRange.instance,\n range: slicedRange\n }, isStart: seg.isStart && slicedRange.start.valueOf() === origRange.start.valueOf(), isEnd: seg.isEnd && slicedRange.end.valueOf() === origRange.end.valueOf() }));\n }\n }\n return newSegs;\n };\n // Generates the text that should be inside a \"more\" link, given the number of events it represents\n DayGrid.prototype.getMoreLinkText = function (num) {\n var opt = this.opt('eventLimitText');\n if (typeof opt === 'function') {\n return opt(num);\n }\n else {\n return '+' + num + ' ' + opt;\n }\n };\n // Returns segments within a given cell.\n // If `startLevel` is specified, returns only events including and below that level. Otherwise returns all segs.\n DayGrid.prototype.getCellSegs = function (row, col, startLevel) {\n var segMatrix = this.eventRenderer.rowStructs[row].segMatrix;\n var level = startLevel || 0;\n var segs = [];\n var seg;\n while (level < segMatrix.length) {\n seg = segMatrix[level][col];\n if (seg) {\n segs.push(seg);\n }\n level++;\n }\n return segs;\n };\n return DayGrid;\n }(core.DateComponent));\n\n var WEEK_NUM_FORMAT$1 = core.createFormatter({ week: 'numeric' });\n /* An abstract class for the daygrid views, as well as month view. Renders one or more rows of day cells.\n ----------------------------------------------------------------------------------------------------------------------*/\n // It is a manager for a DayGrid subcomponent, which does most of the heavy lifting.\n // It is responsible for managing width/height.\n var DayGridView = /** @class */ (function (_super) {\n __extends(DayGridView, _super);\n function DayGridView(context, viewSpec, dateProfileGenerator, parentEl) {\n var _this = _super.call(this, context, viewSpec, dateProfileGenerator, parentEl) || this;\n /* Header Rendering\n ------------------------------------------------------------------------------------------------------------------*/\n // Generates the HTML that will go before the day-of week header cells\n _this.renderHeadIntroHtml = function () {\n var theme = _this.theme;\n if (_this.colWeekNumbersVisible) {\n return '' +\n '
';\n }\n return '';\n };\n /* Day Grid Rendering\n ------------------------------------------------------------------------------------------------------------------*/\n // Generates the HTML that will go before content-skeleton cells that display the day/week numbers\n _this.renderDayGridNumberIntroHtml = function (row, dayGrid) {\n var dateEnv = _this.dateEnv;\n var weekStart = dayGrid.props.cells[row][0].date;\n if (_this.colWeekNumbersVisible) {\n return '' +\n '
' +\n core.buildGotoAnchorHtml(// aside from link, important for matchCellWidths\n _this, { date: weekStart, type: 'week', forceOff: dayGrid.colCnt === 1 }, dateEnv.format(weekStart, WEEK_NUM_FORMAT$1) // inner HTML\n ) +\n '
';\n }\n return '';\n };\n // Generates the HTML that goes before the day bg cells for each day-row\n _this.renderDayGridBgIntroHtml = function () {\n var theme = _this.theme;\n if (_this.colWeekNumbersVisible) {\n return '
';\n }\n return '';\n };\n // Generates the HTML that goes before every other type of row generated by DayGrid.\n // Affects mirror-skeleton and highlight-skeleton rows.\n _this.renderDayGridIntroHtml = function () {\n if (_this.colWeekNumbersVisible) {\n return '
';\n }\n return '';\n };\n _this.el.classList.add('fc-dayGrid-view');\n _this.el.innerHTML = _this.renderSkeletonHtml();\n _this.scroller = new core.ScrollComponent('hidden', // overflow x\n 'auto' // overflow y\n );\n var dayGridContainerEl = _this.scroller.el;\n _this.el.querySelector('.fc-body > tr > td').appendChild(dayGridContainerEl);\n dayGridContainerEl.classList.add('fc-day-grid-container');\n var dayGridEl = core.createElement('div', { className: 'fc-day-grid' });\n dayGridContainerEl.appendChild(dayGridEl);\n var cellWeekNumbersVisible;\n if (_this.opt('weekNumbers')) {\n if (_this.opt('weekNumbersWithinDays')) {\n cellWeekNumbersVisible = true;\n _this.colWeekNumbersVisible = false;\n }\n else {\n cellWeekNumbersVisible = false;\n _this.colWeekNumbersVisible = true;\n }\n }\n else {\n _this.colWeekNumbersVisible = false;\n cellWeekNumbersVisible = false;\n }\n _this.dayGrid = new DayGrid(_this.context, dayGridEl, {\n renderNumberIntroHtml: _this.renderDayGridNumberIntroHtml,\n renderBgIntroHtml: _this.renderDayGridBgIntroHtml,\n renderIntroHtml: _this.renderDayGridIntroHtml,\n colWeekNumbersVisible: _this.colWeekNumbersVisible,\n cellWeekNumbersVisible: cellWeekNumbersVisible\n });\n return _this;\n }\n DayGridView.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n this.dayGrid.destroy();\n this.scroller.destroy();\n };\n // Builds the HTML skeleton for the view.\n // The day-grid component will render inside of a container defined by this HTML.\n DayGridView.prototype.renderSkeletonHtml = function () {\n var theme = this.theme;\n return '' +\n '
' +\n (this.opt('columnHeader') ?\n '' +\n '
' +\n '
' +\n '
' +\n '' :\n '') +\n '' +\n '
' +\n '
' +\n '
' +\n '' +\n '
';\n };\n // Generates an HTML attribute string for setting the width of the week number column, if it is known\n DayGridView.prototype.weekNumberStyleAttr = function () {\n if (this.weekNumberWidth != null) {\n return 'style=\"width:' + this.weekNumberWidth + 'px\"';\n }\n return '';\n };\n // Determines whether each row should have a constant height\n DayGridView.prototype.hasRigidRows = function () {\n var eventLimit = this.opt('eventLimit');\n return eventLimit && typeof eventLimit !== 'number';\n };\n /* Dimensions\n ------------------------------------------------------------------------------------------------------------------*/\n DayGridView.prototype.updateSize = function (isResize, viewHeight, isAuto) {\n _super.prototype.updateSize.call(this, isResize, viewHeight, isAuto); // will call updateBaseSize. important that executes first\n this.dayGrid.updateSize(isResize);\n };\n // Refreshes the horizontal dimensions of the view\n DayGridView.prototype.updateBaseSize = function (isResize, viewHeight, isAuto) {\n var dayGrid = this.dayGrid;\n var eventLimit = this.opt('eventLimit');\n var headRowEl = this.header ? this.header.el : null; // HACK\n var scrollerHeight;\n var scrollbarWidths;\n // hack to give the view some height prior to dayGrid's columns being rendered\n // TODO: separate setting height from scroller VS dayGrid.\n if (!dayGrid.rowEls) {\n if (!isAuto) {\n scrollerHeight = this.computeScrollerHeight(viewHeight);\n this.scroller.setHeight(scrollerHeight);\n }\n return;\n }\n if (this.colWeekNumbersVisible) {\n // Make sure all week number cells running down the side have the same width.\n this.weekNumberWidth = core.matchCellWidths(core.findElements(this.el, '.fc-week-number'));\n }\n // reset all heights to be natural\n this.scroller.clear();\n if (headRowEl) {\n core.uncompensateScroll(headRowEl);\n }\n dayGrid.removeSegPopover(); // kill the \"more\" popover if displayed\n // is the event limit a constant level number?\n if (eventLimit && typeof eventLimit === 'number') {\n dayGrid.limitRows(eventLimit); // limit the levels first so the height can redistribute after\n }\n // distribute the height to the rows\n // (viewHeight is a \"recommended\" value if isAuto)\n scrollerHeight = this.computeScrollerHeight(viewHeight);\n this.setGridHeight(scrollerHeight, isAuto);\n // is the event limit dynamically calculated?\n if (eventLimit && typeof eventLimit !== 'number') {\n dayGrid.limitRows(eventLimit); // limit the levels after the grid's row heights have been set\n }\n if (!isAuto) { // should we force dimensions of the scroll container?\n this.scroller.setHeight(scrollerHeight);\n scrollbarWidths = this.scroller.getScrollbarWidths();\n if (scrollbarWidths.left || scrollbarWidths.right) { // using scrollbars?\n if (headRowEl) {\n core.compensateScroll(headRowEl, scrollbarWidths);\n }\n // doing the scrollbar compensation might have created text overflow which created more height. redo\n scrollerHeight = this.computeScrollerHeight(viewHeight);\n this.scroller.setHeight(scrollerHeight);\n }\n // guarantees the same scrollbar widths\n this.scroller.lockOverflow(scrollbarWidths);\n }\n };\n // given a desired total height of the view, returns what the height of the scroller should be\n DayGridView.prototype.computeScrollerHeight = function (viewHeight) {\n return viewHeight -\n core.subtractInnerElHeight(this.el, this.scroller.el); // everything that's NOT the scroller\n };\n // Sets the height of just the DayGrid component in this view\n DayGridView.prototype.setGridHeight = function (height, isAuto) {\n if (this.opt('monthMode')) {\n // if auto, make the height of each row the height that it would be if there were 6 weeks\n if (isAuto) {\n height *= this.dayGrid.rowCnt / 6;\n }\n core.distributeHeight(this.dayGrid.rowEls, height, !isAuto); // if auto, don't compensate for height-hogging rows\n }\n else {\n if (isAuto) {\n core.undistributeHeight(this.dayGrid.rowEls); // let the rows be their natural height with no expanding\n }\n else {\n core.distributeHeight(this.dayGrid.rowEls, height, true); // true = compensate for height-hogging rows\n }\n }\n };\n /* Scroll\n ------------------------------------------------------------------------------------------------------------------*/\n DayGridView.prototype.computeDateScroll = function (duration) {\n return { top: 0 };\n };\n DayGridView.prototype.queryDateScroll = function () {\n return { top: this.scroller.getScrollTop() };\n };\n DayGridView.prototype.applyDateScroll = function (scroll) {\n if (scroll.top !== undefined) {\n this.scroller.setScrollTop(scroll.top);\n }\n };\n return DayGridView;\n }(core.View));\n DayGridView.prototype.dateProfileGeneratorClass = DayGridDateProfileGenerator;\n\n var SimpleDayGrid = /** @class */ (function (_super) {\n __extends(SimpleDayGrid, _super);\n function SimpleDayGrid(context, dayGrid) {\n var _this = _super.call(this, context, dayGrid.el) || this;\n _this.slicer = new DayGridSlicer();\n _this.dayGrid = dayGrid;\n context.calendar.registerInteractiveComponent(_this, { el: _this.dayGrid.el });\n return _this;\n }\n SimpleDayGrid.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n this.calendar.unregisterInteractiveComponent(this);\n };\n SimpleDayGrid.prototype.render = function (props) {\n var dayGrid = this.dayGrid;\n var dateProfile = props.dateProfile, dayTable = props.dayTable;\n dayGrid.receiveProps(__assign({}, this.slicer.sliceProps(props, dateProfile, props.nextDayThreshold, dayGrid, dayTable), { dateProfile: dateProfile, cells: dayTable.cells, isRigid: props.isRigid }));\n };\n SimpleDayGrid.prototype.buildPositionCaches = function () {\n this.dayGrid.buildPositionCaches();\n };\n SimpleDayGrid.prototype.queryHit = function (positionLeft, positionTop) {\n var rawHit = this.dayGrid.positionToHit(positionLeft, positionTop);\n if (rawHit) {\n return {\n component: this.dayGrid,\n dateSpan: rawHit.dateSpan,\n dayEl: rawHit.dayEl,\n rect: {\n left: rawHit.relativeRect.left,\n right: rawHit.relativeRect.right,\n top: rawHit.relativeRect.top,\n bottom: rawHit.relativeRect.bottom\n },\n layer: 0\n };\n }\n };\n return SimpleDayGrid;\n }(core.DateComponent));\n var DayGridSlicer = /** @class */ (function (_super) {\n __extends(DayGridSlicer, _super);\n function DayGridSlicer() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n DayGridSlicer.prototype.sliceRange = function (dateRange, dayTable) {\n return dayTable.sliceRange(dateRange);\n };\n return DayGridSlicer;\n }(core.Slicer));\n\n var DayGridView$1 = /** @class */ (function (_super) {\n __extends(DayGridView, _super);\n function DayGridView(_context, viewSpec, dateProfileGenerator, parentEl) {\n var _this = _super.call(this, _context, viewSpec, dateProfileGenerator, parentEl) || this;\n _this.buildDayTable = core.memoize(buildDayTable);\n if (_this.opt('columnHeader')) {\n _this.header = new core.DayHeader(_this.context, _this.el.querySelector('.fc-head-container'));\n }\n _this.simpleDayGrid = new SimpleDayGrid(_this.context, _this.dayGrid);\n return _this;\n }\n DayGridView.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n if (this.header) {\n this.header.destroy();\n }\n this.simpleDayGrid.destroy();\n };\n DayGridView.prototype.render = function (props) {\n _super.prototype.render.call(this, props);\n var dateProfile = this.props.dateProfile;\n var dayTable = this.dayTable =\n this.buildDayTable(dateProfile, this.dateProfileGenerator);\n if (this.header) {\n this.header.receiveProps({\n dateProfile: dateProfile,\n dates: dayTable.headerDates,\n datesRepDistinctDays: dayTable.rowCnt === 1,\n renderIntroHtml: this.renderHeadIntroHtml\n });\n }\n this.simpleDayGrid.receiveProps({\n dateProfile: dateProfile,\n dayTable: dayTable,\n businessHours: props.businessHours,\n dateSelection: props.dateSelection,\n eventStore: props.eventStore,\n eventUiBases: props.eventUiBases,\n eventSelection: props.eventSelection,\n eventDrag: props.eventDrag,\n eventResize: props.eventResize,\n isRigid: this.hasRigidRows(),\n nextDayThreshold: this.nextDayThreshold\n });\n };\n return DayGridView;\n }(DayGridView));\n function buildDayTable(dateProfile, dateProfileGenerator) {\n var daySeries = new core.DaySeries(dateProfile.renderRange, dateProfileGenerator);\n return new core.DayTable(daySeries, /year|month|week/.test(dateProfile.currentRangeUnit));\n }\n\n var main = core.createPlugin({\n defaultView: 'dayGridMonth',\n views: {\n dayGrid: DayGridView$1,\n dayGridDay: {\n type: 'dayGrid',\n duration: { days: 1 }\n },\n dayGridWeek: {\n type: 'dayGrid',\n duration: { weeks: 1 }\n },\n dayGridMonth: {\n type: 'dayGrid',\n duration: { months: 1 },\n monthMode: true,\n fixedWeekCount: true\n }\n }\n });\n\n exports.AbstractDayGridView = DayGridView;\n exports.DayBgRow = DayBgRow;\n exports.DayGrid = DayGrid;\n exports.DayGridSlicer = DayGridSlicer;\n exports.DayGridView = DayGridView$1;\n exports.SimpleDayGrid = SimpleDayGrid;\n exports.buildBasicDayTable = buildDayTable;\n exports.default = main;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n}));\n","/*!\nFullCalendar List View Plugin v4.3.0\nDocs & License: https://fullcalendar.io/\n(c) 2019 Adam Shaw\n*/\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@fullcalendar/core')) :\n typeof define === 'function' && define.amd ? define(['exports', '@fullcalendar/core'], factory) :\n (global = global || self, factory(global.FullCalendarList = {}, global.FullCalendar));\n}(this, function (exports, core) { 'use strict';\n\n /*! *****************************************************************************\r\n Copyright (c) Microsoft Corporation. All rights reserved.\r\n Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\n this file except in compliance with the License. You may obtain a copy of the\r\n License at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\n THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\n WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\n MERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\n See the Apache Version 2.0 License for specific language governing permissions\r\n and limitations under the License.\r\n ***************************************************************************** */\r\n /* global Reflect, Promise */\r\n\r\n var extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n };\r\n\r\n function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n }\n\n var ListEventRenderer = /** @class */ (function (_super) {\n __extends(ListEventRenderer, _super);\n function ListEventRenderer(listView) {\n var _this = _super.call(this, listView.context) || this;\n _this.listView = listView;\n return _this;\n }\n ListEventRenderer.prototype.attachSegs = function (segs) {\n if (!segs.length) {\n this.listView.renderEmptyMessage();\n }\n else {\n this.listView.renderSegList(segs);\n }\n };\n ListEventRenderer.prototype.detachSegs = function () {\n };\n // generates the HTML for a single event row\n ListEventRenderer.prototype.renderSegHtml = function (seg) {\n var _a = this.context, view = _a.view, theme = _a.theme;\n var eventRange = seg.eventRange;\n var eventDef = eventRange.def;\n var eventInstance = eventRange.instance;\n var eventUi = eventRange.ui;\n var url = eventDef.url;\n var classes = ['fc-list-item'].concat(eventUi.classNames);\n var bgColor = eventUi.backgroundColor;\n var timeHtml;\n if (eventDef.allDay) {\n timeHtml = core.getAllDayHtml(view);\n }\n else if (core.isMultiDayRange(eventRange.range)) {\n if (seg.isStart) {\n timeHtml = core.htmlEscape(this._getTimeText(eventInstance.range.start, seg.end, false // allDay\n ));\n }\n else if (seg.isEnd) {\n timeHtml = core.htmlEscape(this._getTimeText(seg.start, eventInstance.range.end, false // allDay\n ));\n }\n else { // inner segment that lasts the whole day\n timeHtml = core.getAllDayHtml(view);\n }\n }\n else {\n // Display the normal time text for the *event's* times\n timeHtml = core.htmlEscape(this.getTimeText(eventRange));\n }\n if (url) {\n classes.push('fc-has-url');\n }\n return '
';\n };\n // called by ListEventRenderer\n ListView.prototype.renderSegList = function (allSegs) {\n var segsByDay = this.groupSegsByDay(allSegs); // sparse array\n var dayIndex;\n var daySegs;\n var i;\n var tableEl = core.htmlToElement('
');\n var tbodyEl = tableEl.querySelector('tbody');\n for (dayIndex = 0; dayIndex < segsByDay.length; dayIndex++) {\n daySegs = segsByDay[dayIndex];\n if (daySegs) { // sparse array, so might be undefined\n // append a day header\n tbodyEl.appendChild(this.buildDayHeaderRow(this.dayDates[dayIndex]));\n daySegs = this.eventRenderer.sortEventSegs(daySegs);\n for (i = 0; i < daySegs.length; i++) {\n tbodyEl.appendChild(daySegs[i].el); // append event row\n }\n }\n }\n this.contentEl.innerHTML = '';\n this.contentEl.appendChild(tableEl);\n };\n // Returns a sparse array of arrays, segs grouped by their dayIndex\n ListView.prototype.groupSegsByDay = function (segs) {\n var segsByDay = []; // sparse array\n var i;\n var seg;\n for (i = 0; i < segs.length; i++) {\n seg = segs[i];\n (segsByDay[seg.dayIndex] || (segsByDay[seg.dayIndex] = []))\n .push(seg);\n }\n return segsByDay;\n };\n // generates the HTML for the day headers that live amongst the event rows\n ListView.prototype.buildDayHeaderRow = function (dayDate) {\n var dateEnv = this.dateEnv;\n var mainFormat = core.createFormatter(this.opt('listDayFormat')); // TODO: cache\n var altFormat = core.createFormatter(this.opt('listDayAltFormat')); // TODO: cache\n return core.createElement('tr', {\n className: 'fc-list-heading',\n 'data-date': dateEnv.formatIso(dayDate, { omitTime: true })\n }, '
');\n };\n return ListView;\n }(core.View));\n ListView.prototype.fgSegSelector = '.fc-list-item'; // which elements accept event actions\n function computeDateVars(dateProfile) {\n var dayStart = core.startOfDay(dateProfile.renderRange.start);\n var viewEnd = dateProfile.renderRange.end;\n var dayDates = [];\n var dayRanges = [];\n while (dayStart < viewEnd) {\n dayDates.push(dayStart);\n dayRanges.push({\n start: dayStart,\n end: core.addDays(dayStart, 1)\n });\n dayStart = core.addDays(dayStart, 1);\n }\n return { dayDates: dayDates, dayRanges: dayRanges };\n }\n\n var main = core.createPlugin({\n views: {\n list: {\n class: ListView,\n buttonTextKey: 'list',\n listDayFormat: { month: 'long', day: 'numeric', year: 'numeric' } // like \"January 1, 2016\"\n },\n listDay: {\n type: 'list',\n duration: { days: 1 },\n listDayFormat: { weekday: 'long' } // day-of-week is all we need. full date is probably in header\n },\n listWeek: {\n type: 'list',\n duration: { weeks: 1 },\n listDayFormat: { weekday: 'long' },\n listDayAltFormat: { month: 'long', day: 'numeric', year: 'numeric' }\n },\n listMonth: {\n type: 'list',\n duration: { month: 1 },\n listDayAltFormat: { weekday: 'long' } // day-of-week is nice-to-have\n },\n listYear: {\n type: 'list',\n duration: { year: 1 },\n listDayAltFormat: { weekday: 'long' } // day-of-week is nice-to-have\n }\n }\n });\n\n exports.ListView = ListView;\n exports.default = main;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n}));\n","/*!\nFullCalendar Time Grid Plugin v4.3.0\nDocs & License: https://fullcalendar.io/\n(c) 2019 Adam Shaw\n*/\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@fullcalendar/core'), require('@fullcalendar/daygrid')) :\n typeof define === 'function' && define.amd ? define(['exports', '@fullcalendar/core', '@fullcalendar/daygrid'], factory) :\n (global = global || self, factory(global.FullCalendarTimeGrid = {}, global.FullCalendar, global.FullCalendarDayGrid));\n}(this, function (exports, core, daygrid) { 'use strict';\n\n /*! *****************************************************************************\r\n Copyright (c) Microsoft Corporation. All rights reserved.\r\n Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\n this file except in compliance with the License. You may obtain a copy of the\r\n License at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\n THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\n WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\n MERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\n See the Apache Version 2.0 License for specific language governing permissions\r\n and limitations under the License.\r\n ***************************************************************************** */\r\n /* global Reflect, Promise */\r\n\r\n var extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n };\r\n\r\n function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n }\r\n\r\n var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n };\n\n /*\n Only handles foreground segs.\n Does not own rendering. Use for low-level util methods by TimeGrid.\n */\n var TimeGridEventRenderer = /** @class */ (function (_super) {\n __extends(TimeGridEventRenderer, _super);\n function TimeGridEventRenderer(timeGrid) {\n var _this = _super.call(this, timeGrid.context) || this;\n _this.timeGrid = timeGrid;\n _this.fullTimeFormat = core.createFormatter({\n hour: 'numeric',\n minute: '2-digit',\n separator: _this.context.options.defaultRangeSeparator\n });\n return _this;\n }\n // Given an array of foreground segments, render a DOM element for each, computes position,\n // and attaches to the column inner-container elements.\n TimeGridEventRenderer.prototype.attachSegs = function (segs, mirrorInfo) {\n var segsByCol = this.timeGrid.groupSegsByCol(segs);\n // order the segs within each column\n // TODO: have groupSegsByCol do this?\n for (var col = 0; col < segsByCol.length; col++) {\n segsByCol[col] = this.sortEventSegs(segsByCol[col]);\n }\n this.segsByCol = segsByCol;\n this.timeGrid.attachSegsByCol(segsByCol, this.timeGrid.fgContainerEls);\n };\n TimeGridEventRenderer.prototype.detachSegs = function (segs) {\n segs.forEach(function (seg) {\n core.removeElement(seg.el);\n });\n this.segsByCol = null;\n };\n TimeGridEventRenderer.prototype.computeSegSizes = function (allSegs) {\n var _a = this, timeGrid = _a.timeGrid, segsByCol = _a.segsByCol;\n var colCnt = timeGrid.colCnt;\n timeGrid.computeSegVerticals(allSegs); // horizontals relies on this\n if (segsByCol) {\n for (var col = 0; col < colCnt; col++) {\n this.computeSegHorizontals(segsByCol[col]); // compute horizontal coordinates, z-index's, and reorder the array\n }\n }\n };\n TimeGridEventRenderer.prototype.assignSegSizes = function (allSegs) {\n var _a = this, timeGrid = _a.timeGrid, segsByCol = _a.segsByCol;\n var colCnt = timeGrid.colCnt;\n timeGrid.assignSegVerticals(allSegs); // horizontals relies on this\n if (segsByCol) {\n for (var col = 0; col < colCnt; col++) {\n this.assignSegCss(segsByCol[col]);\n }\n }\n };\n // Computes a default event time formatting string if `eventTimeFormat` is not explicitly defined\n TimeGridEventRenderer.prototype.computeEventTimeFormat = function () {\n return {\n hour: 'numeric',\n minute: '2-digit',\n meridiem: false\n };\n };\n // Computes a default `displayEventEnd` value if one is not expliclty defined\n TimeGridEventRenderer.prototype.computeDisplayEventEnd = function () {\n return true;\n };\n // Renders the HTML for a single event segment's default rendering\n TimeGridEventRenderer.prototype.renderSegHtml = function (seg, mirrorInfo) {\n var view = this.context.view;\n var eventRange = seg.eventRange;\n var eventDef = eventRange.def;\n var eventUi = eventRange.ui;\n var allDay = eventDef.allDay;\n var isDraggable = view.computeEventDraggable(eventDef, eventUi);\n var isResizableFromStart = seg.isStart && view.computeEventStartResizable(eventDef, eventUi);\n var isResizableFromEnd = seg.isEnd && view.computeEventEndResizable(eventDef, eventUi);\n var classes = this.getSegClasses(seg, isDraggable, isResizableFromStart || isResizableFromEnd, mirrorInfo);\n var skinCss = core.cssToStr(this.getSkinCss(eventUi));\n var timeText;\n var fullTimeText; // more verbose time text. for the print stylesheet\n var startTimeText; // just the start time text\n classes.unshift('fc-time-grid-event');\n // if the event appears to span more than one day...\n if (core.isMultiDayRange(eventRange.range)) {\n // Don't display time text on segments that run entirely through a day.\n // That would appear as midnight-midnight and would look dumb.\n // Otherwise, display the time text for the *segment's* times (like 6pm-midnight or midnight-10am)\n if (seg.isStart || seg.isEnd) {\n var unzonedStart = seg.start;\n var unzonedEnd = seg.end;\n timeText = this._getTimeText(unzonedStart, unzonedEnd, allDay); // TODO: give the timezones\n fullTimeText = this._getTimeText(unzonedStart, unzonedEnd, allDay, this.fullTimeFormat);\n startTimeText = this._getTimeText(unzonedStart, unzonedEnd, allDay, null, false); // displayEnd=false\n }\n }\n else {\n // Display the normal time text for the *event's* times\n timeText = this.getTimeText(eventRange);\n fullTimeText = this.getTimeText(eventRange, this.fullTimeFormat);\n startTimeText = this.getTimeText(eventRange, null, false); // displayEnd=false\n }\n return '' +\n '
' +\n /* TODO: write CSS for this\n (isResizableFromStart ?\n '' :\n ''\n ) +\n */\n (isResizableFromEnd ?\n '' :\n '') +\n '';\n };\n // Given an array of segments that are all in the same column, sets the backwardCoord and forwardCoord on each.\n // Assumed the segs are already ordered.\n // NOTE: Also reorders the given array by date!\n TimeGridEventRenderer.prototype.computeSegHorizontals = function (segs) {\n var levels;\n var level0;\n var i;\n levels = buildSlotSegLevels(segs);\n computeForwardSlotSegs(levels);\n if ((level0 = levels[0])) {\n for (i = 0; i < level0.length; i++) {\n computeSlotSegPressures(level0[i]);\n }\n for (i = 0; i < level0.length; i++) {\n this.computeSegForwardBack(level0[i], 0, 0);\n }\n }\n };\n // Calculate seg.forwardCoord and seg.backwardCoord for the segment, where both values range\n // from 0 to 1. If the calendar is left-to-right, the seg.backwardCoord maps to \"left\" and\n // seg.forwardCoord maps to \"right\" (via percentage). Vice-versa if the calendar is right-to-left.\n //\n // The segment might be part of a \"series\", which means consecutive segments with the same pressure\n // who's width is unknown until an edge has been hit. `seriesBackwardPressure` is the number of\n // segments behind this one in the current series, and `seriesBackwardCoord` is the starting\n // coordinate of the first segment in the series.\n TimeGridEventRenderer.prototype.computeSegForwardBack = function (seg, seriesBackwardPressure, seriesBackwardCoord) {\n var forwardSegs = seg.forwardSegs;\n var i;\n if (seg.forwardCoord === undefined) { // not already computed\n if (!forwardSegs.length) {\n // if there are no forward segments, this segment should butt up against the edge\n seg.forwardCoord = 1;\n }\n else {\n // sort highest pressure first\n this.sortForwardSegs(forwardSegs);\n // this segment's forwardCoord will be calculated from the backwardCoord of the\n // highest-pressure forward segment.\n this.computeSegForwardBack(forwardSegs[0], seriesBackwardPressure + 1, seriesBackwardCoord);\n seg.forwardCoord = forwardSegs[0].backwardCoord;\n }\n // calculate the backwardCoord from the forwardCoord. consider the series\n seg.backwardCoord = seg.forwardCoord -\n (seg.forwardCoord - seriesBackwardCoord) / // available width for series\n (seriesBackwardPressure + 1); // # of segments in the series\n // use this segment's coordinates to computed the coordinates of the less-pressurized\n // forward segments\n for (i = 0; i < forwardSegs.length; i++) {\n this.computeSegForwardBack(forwardSegs[i], 0, seg.forwardCoord);\n }\n }\n };\n TimeGridEventRenderer.prototype.sortForwardSegs = function (forwardSegs) {\n var objs = forwardSegs.map(buildTimeGridSegCompareObj);\n var specs = [\n // put higher-pressure first\n { field: 'forwardPressure', order: -1 },\n // put segments that are closer to initial edge first (and favor ones with no coords yet)\n { field: 'backwardCoord', order: 1 }\n ].concat(this.context.view.eventOrderSpecs);\n objs.sort(function (obj0, obj1) {\n return core.compareByFieldSpecs(obj0, obj1, specs);\n });\n return objs.map(function (c) {\n return c._seg;\n });\n };\n // Given foreground event segments that have already had their position coordinates computed,\n // assigns position-related CSS values to their elements.\n TimeGridEventRenderer.prototype.assignSegCss = function (segs) {\n for (var _i = 0, segs_1 = segs; _i < segs_1.length; _i++) {\n var seg = segs_1[_i];\n core.applyStyle(seg.el, this.generateSegCss(seg));\n if (seg.level > 0) {\n seg.el.classList.add('fc-time-grid-event-inset');\n }\n // if the event is short that the title will be cut off,\n // attach a className that condenses the title into the time area.\n if (seg.eventRange.def.title && seg.bottom - seg.top < 30) {\n seg.el.classList.add('fc-short'); // TODO: \"condensed\" is a better name\n }\n }\n };\n // Generates an object with CSS properties/values that should be applied to an event segment element.\n // Contains important positioning-related properties that should be applied to any event element, customized or not.\n TimeGridEventRenderer.prototype.generateSegCss = function (seg) {\n var shouldOverlap = this.context.options.slotEventOverlap;\n var backwardCoord = seg.backwardCoord; // the left side if LTR. the right side if RTL. floating-point\n var forwardCoord = seg.forwardCoord; // the right side if LTR. the left side if RTL. floating-point\n var props = this.timeGrid.generateSegVerticalCss(seg); // get top/bottom first\n var isRtl = this.timeGrid.isRtl;\n var left; // amount of space from left edge, a fraction of the total width\n var right; // amount of space from right edge, a fraction of the total width\n if (shouldOverlap) {\n // double the width, but don't go beyond the maximum forward coordinate (1.0)\n forwardCoord = Math.min(1, backwardCoord + (forwardCoord - backwardCoord) * 2);\n }\n if (isRtl) {\n left = 1 - forwardCoord;\n right = backwardCoord;\n }\n else {\n left = backwardCoord;\n right = 1 - forwardCoord;\n }\n props.zIndex = seg.level + 1; // convert from 0-base to 1-based\n props.left = left * 100 + '%';\n props.right = right * 100 + '%';\n if (shouldOverlap && seg.forwardPressure) {\n // add padding to the edge so that forward stacked events don't cover the resizer's icon\n props[isRtl ? 'marginLeft' : 'marginRight'] = 10 * 2; // 10 is a guesstimate of the icon's width\n }\n return props;\n };\n return TimeGridEventRenderer;\n }(core.FgEventRenderer));\n // Builds an array of segments \"levels\". The first level will be the leftmost tier of segments if the calendar is\n // left-to-right, or the rightmost if the calendar is right-to-left. Assumes the segments are already ordered by date.\n function buildSlotSegLevels(segs) {\n var levels = [];\n var i;\n var seg;\n var j;\n for (i = 0; i < segs.length; i++) {\n seg = segs[i];\n // go through all the levels and stop on the first level where there are no collisions\n for (j = 0; j < levels.length; j++) {\n if (!computeSlotSegCollisions(seg, levels[j]).length) {\n break;\n }\n }\n seg.level = j;\n (levels[j] || (levels[j] = [])).push(seg);\n }\n return levels;\n }\n // For every segment, figure out the other segments that are in subsequent\n // levels that also occupy the same vertical space. Accumulate in seg.forwardSegs\n function computeForwardSlotSegs(levels) {\n var i;\n var level;\n var j;\n var seg;\n var k;\n for (i = 0; i < levels.length; i++) {\n level = levels[i];\n for (j = 0; j < level.length; j++) {\n seg = level[j];\n seg.forwardSegs = [];\n for (k = i + 1; k < levels.length; k++) {\n computeSlotSegCollisions(seg, levels[k], seg.forwardSegs);\n }\n }\n }\n }\n // Figure out which path forward (via seg.forwardSegs) results in the longest path until\n // the furthest edge is reached. The number of segments in this path will be seg.forwardPressure\n function computeSlotSegPressures(seg) {\n var forwardSegs = seg.forwardSegs;\n var forwardPressure = 0;\n var i;\n var forwardSeg;\n if (seg.forwardPressure === undefined) { // not already computed\n for (i = 0; i < forwardSegs.length; i++) {\n forwardSeg = forwardSegs[i];\n // figure out the child's maximum forward path\n computeSlotSegPressures(forwardSeg);\n // either use the existing maximum, or use the child's forward pressure\n // plus one (for the forwardSeg itself)\n forwardPressure = Math.max(forwardPressure, 1 + forwardSeg.forwardPressure);\n }\n seg.forwardPressure = forwardPressure;\n }\n }\n // Find all the segments in `otherSegs` that vertically collide with `seg`.\n // Append into an optionally-supplied `results` array and return.\n function computeSlotSegCollisions(seg, otherSegs, results) {\n if (results === void 0) { results = []; }\n for (var i = 0; i < otherSegs.length; i++) {\n if (isSlotSegCollision(seg, otherSegs[i])) {\n results.push(otherSegs[i]);\n }\n }\n return results;\n }\n // Do these segments occupy the same vertical space?\n function isSlotSegCollision(seg1, seg2) {\n return seg1.bottom > seg2.top && seg1.top < seg2.bottom;\n }\n function buildTimeGridSegCompareObj(seg) {\n var obj = core.buildSegCompareObj(seg);\n obj.forwardPressure = seg.forwardPressure;\n obj.backwardCoord = seg.backwardCoord;\n return obj;\n }\n\n var TimeGridMirrorRenderer = /** @class */ (function (_super) {\n __extends(TimeGridMirrorRenderer, _super);\n function TimeGridMirrorRenderer() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n TimeGridMirrorRenderer.prototype.attachSegs = function (segs, mirrorInfo) {\n this.segsByCol = this.timeGrid.groupSegsByCol(segs);\n this.timeGrid.attachSegsByCol(this.segsByCol, this.timeGrid.mirrorContainerEls);\n this.sourceSeg = mirrorInfo.sourceSeg;\n };\n TimeGridMirrorRenderer.prototype.generateSegCss = function (seg) {\n var props = _super.prototype.generateSegCss.call(this, seg);\n var sourceSeg = this.sourceSeg;\n if (sourceSeg && sourceSeg.col === seg.col) {\n var sourceSegProps = _super.prototype.generateSegCss.call(this, sourceSeg);\n props.left = sourceSegProps.left;\n props.right = sourceSegProps.right;\n props.marginLeft = sourceSegProps.marginLeft;\n props.marginRight = sourceSegProps.marginRight;\n }\n return props;\n };\n return TimeGridMirrorRenderer;\n }(TimeGridEventRenderer));\n\n var TimeGridFillRenderer = /** @class */ (function (_super) {\n __extends(TimeGridFillRenderer, _super);\n function TimeGridFillRenderer(timeGrid) {\n var _this = _super.call(this, timeGrid.context) || this;\n _this.timeGrid = timeGrid;\n return _this;\n }\n TimeGridFillRenderer.prototype.attachSegs = function (type, segs) {\n var timeGrid = this.timeGrid;\n var containerEls;\n // TODO: more efficient lookup\n if (type === 'bgEvent') {\n containerEls = timeGrid.bgContainerEls;\n }\n else if (type === 'businessHours') {\n containerEls = timeGrid.businessContainerEls;\n }\n else if (type === 'highlight') {\n containerEls = timeGrid.highlightContainerEls;\n }\n timeGrid.attachSegsByCol(timeGrid.groupSegsByCol(segs), containerEls);\n return segs.map(function (seg) {\n return seg.el;\n });\n };\n TimeGridFillRenderer.prototype.computeSegSizes = function (segs) {\n this.timeGrid.computeSegVerticals(segs);\n };\n TimeGridFillRenderer.prototype.assignSegSizes = function (segs) {\n this.timeGrid.assignSegVerticals(segs);\n };\n return TimeGridFillRenderer;\n }(core.FillRenderer));\n\n /* A component that renders one or more columns of vertical time slots\n ----------------------------------------------------------------------------------------------------------------------*/\n // potential nice values for the slot-duration and interval-duration\n // from largest to smallest\n var AGENDA_STOCK_SUB_DURATIONS = [\n { hours: 1 },\n { minutes: 30 },\n { minutes: 15 },\n { seconds: 30 },\n { seconds: 15 }\n ];\n var TimeGrid = /** @class */ (function (_super) {\n __extends(TimeGrid, _super);\n function TimeGrid(context, el, renderProps) {\n var _this = _super.call(this, context, el) || this;\n _this.isSlatSizesDirty = false;\n _this.isColSizesDirty = false;\n _this.renderSlats = core.memoizeRendering(_this._renderSlats);\n var eventRenderer = _this.eventRenderer = new TimeGridEventRenderer(_this);\n var fillRenderer = _this.fillRenderer = new TimeGridFillRenderer(_this);\n _this.mirrorRenderer = new TimeGridMirrorRenderer(_this);\n var renderColumns = _this.renderColumns = core.memoizeRendering(_this._renderColumns, _this._unrenderColumns);\n _this.renderBusinessHours = core.memoizeRendering(fillRenderer.renderSegs.bind(fillRenderer, 'businessHours'), fillRenderer.unrender.bind(fillRenderer, 'businessHours'), [renderColumns]);\n _this.renderDateSelection = core.memoizeRendering(_this._renderDateSelection, _this._unrenderDateSelection, [renderColumns]);\n _this.renderFgEvents = core.memoizeRendering(eventRenderer.renderSegs.bind(eventRenderer), eventRenderer.unrender.bind(eventRenderer), [renderColumns]);\n _this.renderBgEvents = core.memoizeRendering(fillRenderer.renderSegs.bind(fillRenderer, 'bgEvent'), fillRenderer.unrender.bind(fillRenderer, 'bgEvent'), [renderColumns]);\n _this.renderEventSelection = core.memoizeRendering(eventRenderer.selectByInstanceId.bind(eventRenderer), eventRenderer.unselectByInstanceId.bind(eventRenderer), [_this.renderFgEvents]);\n _this.renderEventDrag = core.memoizeRendering(_this._renderEventDrag, _this._unrenderEventDrag, [renderColumns]);\n _this.renderEventResize = core.memoizeRendering(_this._renderEventResize, _this._unrenderEventResize, [renderColumns]);\n _this.processOptions();\n el.innerHTML =\n '' +\n '' +\n '';\n _this.rootBgContainerEl = el.querySelector('.fc-bg');\n _this.slatContainerEl = el.querySelector('.fc-slats');\n _this.bottomRuleEl = el.querySelector('.fc-divider');\n _this.renderProps = renderProps;\n return _this;\n }\n /* Options\n ------------------------------------------------------------------------------------------------------------------*/\n // Parses various options into properties of this object\n TimeGrid.prototype.processOptions = function () {\n var slotDuration = this.opt('slotDuration');\n var snapDuration = this.opt('snapDuration');\n var snapsPerSlot;\n var input;\n slotDuration = core.createDuration(slotDuration);\n snapDuration = snapDuration ? core.createDuration(snapDuration) : slotDuration;\n snapsPerSlot = core.wholeDivideDurations(slotDuration, snapDuration);\n if (snapsPerSlot === null) {\n snapDuration = slotDuration;\n snapsPerSlot = 1;\n // TODO: say warning?\n }\n this.slotDuration = slotDuration;\n this.snapDuration = snapDuration;\n this.snapsPerSlot = snapsPerSlot;\n // might be an array value (for TimelineView).\n // if so, getting the most granular entry (the last one probably).\n input = this.opt('slotLabelFormat');\n if (Array.isArray(input)) {\n input = input[input.length - 1];\n }\n this.labelFormat = core.createFormatter(input || {\n hour: 'numeric',\n minute: '2-digit',\n omitZeroMinute: true,\n meridiem: 'short'\n });\n input = this.opt('slotLabelInterval');\n this.labelInterval = input ?\n core.createDuration(input) :\n this.computeLabelInterval(slotDuration);\n };\n // Computes an automatic value for slotLabelInterval\n TimeGrid.prototype.computeLabelInterval = function (slotDuration) {\n var i;\n var labelInterval;\n var slotsPerLabel;\n // find the smallest stock label interval that results in more than one slots-per-label\n for (i = AGENDA_STOCK_SUB_DURATIONS.length - 1; i >= 0; i--) {\n labelInterval = core.createDuration(AGENDA_STOCK_SUB_DURATIONS[i]);\n slotsPerLabel = core.wholeDivideDurations(labelInterval, slotDuration);\n if (slotsPerLabel !== null && slotsPerLabel > 1) {\n return labelInterval;\n }\n }\n return slotDuration; // fall back\n };\n /* Rendering\n ------------------------------------------------------------------------------------------------------------------*/\n TimeGrid.prototype.render = function (props) {\n var cells = props.cells;\n this.colCnt = cells.length;\n this.renderSlats(props.dateProfile);\n this.renderColumns(props.cells, props.dateProfile);\n this.renderBusinessHours(props.businessHourSegs);\n this.renderDateSelection(props.dateSelectionSegs);\n this.renderFgEvents(props.fgEventSegs);\n this.renderBgEvents(props.bgEventSegs);\n this.renderEventSelection(props.eventSelection);\n this.renderEventDrag(props.eventDrag);\n this.renderEventResize(props.eventResize);\n };\n TimeGrid.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n // should unrender everything else too\n this.renderSlats.unrender();\n this.renderColumns.unrender();\n };\n TimeGrid.prototype.updateSize = function (isResize) {\n var _a = this, fillRenderer = _a.fillRenderer, eventRenderer = _a.eventRenderer, mirrorRenderer = _a.mirrorRenderer;\n if (isResize || this.isSlatSizesDirty) {\n this.buildSlatPositions();\n this.isSlatSizesDirty = false;\n }\n if (isResize || this.isColSizesDirty) {\n this.buildColPositions();\n this.isColSizesDirty = false;\n }\n fillRenderer.computeSizes(isResize);\n eventRenderer.computeSizes(isResize);\n mirrorRenderer.computeSizes(isResize);\n fillRenderer.assignSizes(isResize);\n eventRenderer.assignSizes(isResize);\n mirrorRenderer.assignSizes(isResize);\n };\n TimeGrid.prototype._renderSlats = function (dateProfile) {\n var theme = this.theme;\n this.slatContainerEl.innerHTML =\n '
' +\n this.renderSlatRowHtml(dateProfile) +\n '
';\n this.slatEls = core.findElements(this.slatContainerEl, 'tr');\n this.slatPositions = new core.PositionCache(this.el, this.slatEls, false, true // vertical\n );\n this.isSlatSizesDirty = true;\n };\n // Generates the HTML for the horizontal \"slats\" that run width-wise. Has a time axis on a side. Depends on RTL.\n TimeGrid.prototype.renderSlatRowHtml = function (dateProfile) {\n var _a = this, dateEnv = _a.dateEnv, theme = _a.theme, isRtl = _a.isRtl;\n var html = '';\n var dayStart = core.startOfDay(dateProfile.renderRange.start);\n var slotTime = dateProfile.minTime;\n var slotIterator = core.createDuration(0);\n var slotDate; // will be on the view's first day, but we only care about its time\n var isLabeled;\n var axisHtml;\n // Calculate the time for each slot\n while (core.asRoughMs(slotTime) < core.asRoughMs(dateProfile.maxTime)) {\n slotDate = dateEnv.add(dayStart, slotTime);\n isLabeled = core.wholeDivideDurations(slotIterator, this.labelInterval) !== null;\n axisHtml =\n '
';\n this.colEls = core.findElements(this.el, '.fc-day, .fc-disabled-day');\n for (var col = 0; col < this.colCnt; col++) {\n this.publiclyTrigger('dayRender', [\n {\n date: dateEnv.toDate(cells[col].date),\n el: this.colEls[col],\n view: view\n }\n ]);\n }\n if (this.isRtl) {\n this.colEls.reverse();\n }\n this.colPositions = new core.PositionCache(this.el, this.colEls, true, // horizontal\n false);\n this.renderContentSkeleton();\n this.isColSizesDirty = true;\n };\n TimeGrid.prototype._unrenderColumns = function () {\n this.unrenderContentSkeleton();\n };\n /* Content Skeleton\n ------------------------------------------------------------------------------------------------------------------*/\n // Renders the DOM that the view's content will live in\n TimeGrid.prototype.renderContentSkeleton = function () {\n var parts = [];\n var skeletonEl;\n parts.push(this.renderProps.renderIntroHtml());\n for (var i = 0; i < this.colCnt; i++) {\n parts.push('
');\n this.colContainerEls = core.findElements(skeletonEl, '.fc-content-col');\n this.mirrorContainerEls = core.findElements(skeletonEl, '.fc-mirror-container');\n this.fgContainerEls = core.findElements(skeletonEl, '.fc-event-container:not(.fc-mirror-container)');\n this.bgContainerEls = core.findElements(skeletonEl, '.fc-bgevent-container');\n this.highlightContainerEls = core.findElements(skeletonEl, '.fc-highlight-container');\n this.businessContainerEls = core.findElements(skeletonEl, '.fc-business-container');\n if (this.isRtl) {\n this.colContainerEls.reverse();\n this.mirrorContainerEls.reverse();\n this.fgContainerEls.reverse();\n this.bgContainerEls.reverse();\n this.highlightContainerEls.reverse();\n this.businessContainerEls.reverse();\n }\n this.el.appendChild(skeletonEl);\n };\n TimeGrid.prototype.unrenderContentSkeleton = function () {\n core.removeElement(this.contentSkeletonEl);\n };\n // Given a flat array of segments, return an array of sub-arrays, grouped by each segment's col\n TimeGrid.prototype.groupSegsByCol = function (segs) {\n var segsByCol = [];\n var i;\n for (i = 0; i < this.colCnt; i++) {\n segsByCol.push([]);\n }\n for (i = 0; i < segs.length; i++) {\n segsByCol[segs[i].col].push(segs[i]);\n }\n return segsByCol;\n };\n // Given segments grouped by column, insert the segments' elements into a parallel array of container\n // elements, each living within a column.\n TimeGrid.prototype.attachSegsByCol = function (segsByCol, containerEls) {\n var col;\n var segs;\n var i;\n for (col = 0; col < this.colCnt; col++) { // iterate each column grouping\n segs = segsByCol[col];\n for (i = 0; i < segs.length; i++) {\n containerEls[col].appendChild(segs[i].el);\n }\n }\n };\n /* Now Indicator\n ------------------------------------------------------------------------------------------------------------------*/\n TimeGrid.prototype.getNowIndicatorUnit = function () {\n return 'minute'; // will refresh on the minute\n };\n TimeGrid.prototype.renderNowIndicator = function (segs, date) {\n // HACK: if date columns not ready for some reason (scheduler)\n if (!this.colContainerEls) {\n return;\n }\n var top = this.computeDateTop(date);\n var nodes = [];\n var i;\n // render lines within the columns\n for (i = 0; i < segs.length; i++) {\n var lineEl = core.createElement('div', { className: 'fc-now-indicator fc-now-indicator-line' });\n lineEl.style.top = top + 'px';\n this.colContainerEls[segs[i].col].appendChild(lineEl);\n nodes.push(lineEl);\n }\n // render an arrow over the axis\n if (segs.length > 0) { // is the current time in view?\n var arrowEl = core.createElement('div', { className: 'fc-now-indicator fc-now-indicator-arrow' });\n arrowEl.style.top = top + 'px';\n this.contentSkeletonEl.appendChild(arrowEl);\n nodes.push(arrowEl);\n }\n this.nowIndicatorEls = nodes;\n };\n TimeGrid.prototype.unrenderNowIndicator = function () {\n if (this.nowIndicatorEls) {\n this.nowIndicatorEls.forEach(core.removeElement);\n this.nowIndicatorEls = null;\n }\n };\n /* Coordinates\n ------------------------------------------------------------------------------------------------------------------*/\n TimeGrid.prototype.getTotalSlatHeight = function () {\n return this.slatContainerEl.getBoundingClientRect().height;\n };\n // Computes the top coordinate, relative to the bounds of the grid, of the given date.\n // A `startOfDayDate` must be given for avoiding ambiguity over how to treat midnight.\n TimeGrid.prototype.computeDateTop = function (when, startOfDayDate) {\n if (!startOfDayDate) {\n startOfDayDate = core.startOfDay(when);\n }\n return this.computeTimeTop(core.createDuration(when.valueOf() - startOfDayDate.valueOf()));\n };\n // Computes the top coordinate, relative to the bounds of the grid, of the given time (a Duration).\n TimeGrid.prototype.computeTimeTop = function (duration) {\n var len = this.slatEls.length;\n var dateProfile = this.props.dateProfile;\n var slatCoverage = (duration.milliseconds - core.asRoughMs(dateProfile.minTime)) / core.asRoughMs(this.slotDuration); // floating-point value of # of slots covered\n var slatIndex;\n var slatRemainder;\n // compute a floating-point number for how many slats should be progressed through.\n // from 0 to number of slats (inclusive)\n // constrained because minTime/maxTime might be customized.\n slatCoverage = Math.max(0, slatCoverage);\n slatCoverage = Math.min(len, slatCoverage);\n // an integer index of the furthest whole slat\n // from 0 to number slats (*exclusive*, so len-1)\n slatIndex = Math.floor(slatCoverage);\n slatIndex = Math.min(slatIndex, len - 1);\n // how much further through the slatIndex slat (from 0.0-1.0) must be covered in addition.\n // could be 1.0 if slatCoverage is covering *all* the slots\n slatRemainder = slatCoverage - slatIndex;\n return this.slatPositions.tops[slatIndex] +\n this.slatPositions.getHeight(slatIndex) * slatRemainder;\n };\n // For each segment in an array, computes and assigns its top and bottom properties\n TimeGrid.prototype.computeSegVerticals = function (segs) {\n var eventMinHeight = this.opt('timeGridEventMinHeight');\n var i;\n var seg;\n var dayDate;\n for (i = 0; i < segs.length; i++) {\n seg = segs[i];\n dayDate = this.props.cells[seg.col].date;\n seg.top = this.computeDateTop(seg.start, dayDate);\n seg.bottom = Math.max(seg.top + eventMinHeight, this.computeDateTop(seg.end, dayDate));\n }\n };\n // Given segments that already have their top/bottom properties computed, applies those values to\n // the segments' elements.\n TimeGrid.prototype.assignSegVerticals = function (segs) {\n var i;\n var seg;\n for (i = 0; i < segs.length; i++) {\n seg = segs[i];\n core.applyStyle(seg.el, this.generateSegVerticalCss(seg));\n }\n };\n // Generates an object with CSS properties for the top/bottom coordinates of a segment element\n TimeGrid.prototype.generateSegVerticalCss = function (seg) {\n return {\n top: seg.top,\n bottom: -seg.bottom // flipped because needs to be space beyond bottom edge of event container\n };\n };\n /* Sizing\n ------------------------------------------------------------------------------------------------------------------*/\n TimeGrid.prototype.buildPositionCaches = function () {\n this.buildColPositions();\n this.buildSlatPositions();\n };\n TimeGrid.prototype.buildColPositions = function () {\n this.colPositions.build();\n };\n TimeGrid.prototype.buildSlatPositions = function () {\n this.slatPositions.build();\n };\n /* Hit System\n ------------------------------------------------------------------------------------------------------------------*/\n TimeGrid.prototype.positionToHit = function (positionLeft, positionTop) {\n var _a = this, dateEnv = _a.dateEnv, snapsPerSlot = _a.snapsPerSlot, slatPositions = _a.slatPositions, colPositions = _a.colPositions;\n var colIndex = colPositions.leftToIndex(positionLeft);\n var slatIndex = slatPositions.topToIndex(positionTop);\n if (colIndex != null && slatIndex != null) {\n var slatTop = slatPositions.tops[slatIndex];\n var slatHeight = slatPositions.getHeight(slatIndex);\n var partial = (positionTop - slatTop) / slatHeight; // floating point number between 0 and 1\n var localSnapIndex = Math.floor(partial * snapsPerSlot); // the snap # relative to start of slat\n var snapIndex = slatIndex * snapsPerSlot + localSnapIndex;\n var dayDate = this.props.cells[colIndex].date;\n var time = core.addDurations(this.props.dateProfile.minTime, core.multiplyDuration(this.snapDuration, snapIndex));\n var start = dateEnv.add(dayDate, time);\n var end = dateEnv.add(start, this.snapDuration);\n return {\n col: colIndex,\n dateSpan: {\n range: { start: start, end: end },\n allDay: false\n },\n dayEl: this.colEls[colIndex],\n relativeRect: {\n left: colPositions.lefts[colIndex],\n right: colPositions.rights[colIndex],\n top: slatTop,\n bottom: slatTop + slatHeight\n }\n };\n }\n };\n /* Event Drag Visualization\n ------------------------------------------------------------------------------------------------------------------*/\n TimeGrid.prototype._renderEventDrag = function (state) {\n if (state) {\n this.eventRenderer.hideByHash(state.affectedInstances);\n if (state.isEvent) {\n this.mirrorRenderer.renderSegs(state.segs, { isDragging: true, sourceSeg: state.sourceSeg });\n }\n else {\n this.fillRenderer.renderSegs('highlight', state.segs);\n }\n }\n };\n TimeGrid.prototype._unrenderEventDrag = function (state) {\n if (state) {\n this.eventRenderer.showByHash(state.affectedInstances);\n this.mirrorRenderer.unrender(state.segs, { isDragging: true, sourceSeg: state.sourceSeg });\n this.fillRenderer.unrender('highlight');\n }\n };\n /* Event Resize Visualization\n ------------------------------------------------------------------------------------------------------------------*/\n TimeGrid.prototype._renderEventResize = function (state) {\n if (state) {\n this.eventRenderer.hideByHash(state.affectedInstances);\n this.mirrorRenderer.renderSegs(state.segs, { isResizing: true, sourceSeg: state.sourceSeg });\n }\n };\n TimeGrid.prototype._unrenderEventResize = function (state) {\n if (state) {\n this.eventRenderer.showByHash(state.affectedInstances);\n this.mirrorRenderer.unrender(state.segs, { isResizing: true, sourceSeg: state.sourceSeg });\n }\n };\n /* Selection\n ------------------------------------------------------------------------------------------------------------------*/\n // Renders a visual indication of a selection. Overrides the default, which was to simply render a highlight.\n TimeGrid.prototype._renderDateSelection = function (segs) {\n if (segs) {\n if (this.opt('selectMirror')) {\n this.mirrorRenderer.renderSegs(segs, { isSelecting: true });\n }\n else {\n this.fillRenderer.renderSegs('highlight', segs);\n }\n }\n };\n TimeGrid.prototype._unrenderDateSelection = function (segs) {\n this.mirrorRenderer.unrender(segs, { isSelecting: true });\n this.fillRenderer.unrender('highlight');\n };\n return TimeGrid;\n }(core.DateComponent));\n\n var AllDaySplitter = /** @class */ (function (_super) {\n __extends(AllDaySplitter, _super);\n function AllDaySplitter() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n AllDaySplitter.prototype.getKeyInfo = function () {\n return {\n allDay: {},\n timed: {}\n };\n };\n AllDaySplitter.prototype.getKeysForDateSpan = function (dateSpan) {\n if (dateSpan.allDay) {\n return ['allDay'];\n }\n else {\n return ['timed'];\n }\n };\n AllDaySplitter.prototype.getKeysForEventDef = function (eventDef) {\n if (!eventDef.allDay) {\n return ['timed'];\n }\n else if (core.hasBgRendering(eventDef)) {\n return ['timed', 'allDay'];\n }\n else {\n return ['allDay'];\n }\n };\n return AllDaySplitter;\n }(core.Splitter));\n\n var TIMEGRID_ALL_DAY_EVENT_LIMIT = 5;\n var WEEK_HEADER_FORMAT = core.createFormatter({ week: 'short' });\n /* An abstract class for all timegrid-related views. Displays one more columns with time slots running vertically.\n ----------------------------------------------------------------------------------------------------------------------*/\n // Is a manager for the TimeGrid subcomponent and possibly the DayGrid subcomponent (if allDaySlot is on).\n // Responsible for managing width/height.\n var TimeGridView = /** @class */ (function (_super) {\n __extends(TimeGridView, _super);\n function TimeGridView(context, viewSpec, dateProfileGenerator, parentEl) {\n var _this = _super.call(this, context, viewSpec, dateProfileGenerator, parentEl) || this;\n _this.splitter = new AllDaySplitter();\n /* Header Render Methods\n ------------------------------------------------------------------------------------------------------------------*/\n // Generates the HTML that will go before the day-of week header cells\n _this.renderHeadIntroHtml = function () {\n var _a = _this, theme = _a.theme, dateEnv = _a.dateEnv;\n var range = _this.props.dateProfile.renderRange;\n var dayCnt = core.diffDays(range.start, range.end);\n var weekText;\n if (_this.opt('weekNumbers')) {\n weekText = dateEnv.format(range.start, WEEK_HEADER_FORMAT);\n return '' +\n '
' +\n core.buildGotoAnchorHtml(// aside from link, important for matchCellWidths\n _this, { date: range.start, type: 'week', forceOff: dayCnt > 1 }, core.htmlEscape(weekText) // inner HTML\n ) +\n '
';\n }\n else {\n return '
';\n }\n };\n /* Time Grid Render Methods\n ------------------------------------------------------------------------------------------------------------------*/\n // Generates the HTML that goes before the bg of the TimeGrid slot area. Long vertical column.\n _this.renderTimeGridBgIntroHtml = function () {\n var theme = _this.theme;\n return '
';\n };\n // Generates the HTML that goes before all other types of cells.\n // Affects content-skeleton, mirror-skeleton, highlight-skeleton for both the time-grid and day-grid.\n _this.renderTimeGridIntroHtml = function () {\n return '
';\n };\n /* Day Grid Render Methods\n ------------------------------------------------------------------------------------------------------------------*/\n // Generates the HTML that goes before the all-day cells\n _this.renderDayGridBgIntroHtml = function () {\n var theme = _this.theme;\n return '' +\n '
';\n };\n // Generates the HTML that goes before all other types of cells.\n // Affects content-skeleton, mirror-skeleton, highlight-skeleton for both the time-grid and day-grid.\n _this.renderDayGridIntroHtml = function () {\n return '
';\n };\n _this.el.classList.add('fc-timeGrid-view');\n _this.el.innerHTML = _this.renderSkeletonHtml();\n _this.scroller = new core.ScrollComponent('hidden', // overflow x\n 'auto' // overflow y\n );\n var timeGridWrapEl = _this.scroller.el;\n _this.el.querySelector('.fc-body > tr > td').appendChild(timeGridWrapEl);\n timeGridWrapEl.classList.add('fc-time-grid-container');\n var timeGridEl = core.createElement('div', { className: 'fc-time-grid' });\n timeGridWrapEl.appendChild(timeGridEl);\n _this.timeGrid = new TimeGrid(_this.context, timeGridEl, {\n renderBgIntroHtml: _this.renderTimeGridBgIntroHtml,\n renderIntroHtml: _this.renderTimeGridIntroHtml\n });\n if (_this.opt('allDaySlot')) { // should we display the \"all-day\" area?\n _this.dayGrid = new daygrid.DayGrid(// the all-day subcomponent of this view\n _this.context, _this.el.querySelector('.fc-day-grid'), {\n renderNumberIntroHtml: _this.renderDayGridIntroHtml,\n renderBgIntroHtml: _this.renderDayGridBgIntroHtml,\n renderIntroHtml: _this.renderDayGridIntroHtml,\n colWeekNumbersVisible: false,\n cellWeekNumbersVisible: false\n });\n // have the day-grid extend it's coordinate area over the dividing the two grids\n var dividerEl = _this.el.querySelector('.fc-divider');\n _this.dayGrid.bottomCoordPadding = dividerEl.getBoundingClientRect().height;\n }\n return _this;\n }\n TimeGridView.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n this.timeGrid.destroy();\n if (this.dayGrid) {\n this.dayGrid.destroy();\n }\n this.scroller.destroy();\n };\n /* Rendering\n ------------------------------------------------------------------------------------------------------------------*/\n // Builds the HTML skeleton for the view.\n // The day-grid and time-grid components will render inside containers defined by this HTML.\n TimeGridView.prototype.renderSkeletonHtml = function () {\n var theme = this.theme;\n return '' +\n '