PageSourceSearch

https://m.seesaw.land/lib/fullcalendar-4.4.0/packages/daygrid/main.js

js seesaw.land collected 2026-10-02 02:00:13 UTC 81,999 bytes, 1,668 lines download raw bytes

1/*!
2FullCalendar Day Grid Plugin v4.4.0
3Docs & License: https://fullcalendar.io/
4(c) 2019 Adam Shaw
5*/
6
7(function (global, factory) {
8    typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@fullcalendar/core')) :
9    typeof define === 'function' && define.amd ? define(['exports', '@fullcalendar/core'], factory) :
10    (global = global || self, factory(global.FullCalendarDayGrid = {}, global.FullCalendar));
11}(this, function (exports, core) { 'use strict';
12
13    /*! *****************************************************************************
14    Copyright (c) Microsoft Corporation. All rights reserved.
15    Licensed under the Apache License, Version 2.0 (the "License"); you may not use
16    this file except in compliance with the License. You may obtain a copy of the
17    License at http://www.apache.org/licenses/LICENSE-2.0
18
19    THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
20    KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
21    WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
22    MERCHANTABLITY OR NON-INFRINGEMENT.
23
24    See the Apache Version 2.0 License for specific language governing permissions
25    and limitations under the License.
26    ***************************************************************************** */
27    /* global Reflect, Promise */
28
29    var extendStatics = function(d, b) {
30        extendStatics = Object.setPrototypeOf ||
31            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
32            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
33        return extendStatics(d, b);
34    };
35
36    function __extends(d, b) {
37        extendStatics(d, b);
38        function __() { this.constructor = d; }
39        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
40    }
41
42    var __assign = function() {
43        __assign = Object.assign || function __assign(t) {
44            for (var s, i = 1, n = arguments.length; i < n; i++) {
45                s = arguments[i];
46                for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
47            }
48            return t;
49        };
50        return __assign.apply(this, arguments);
51    };
52
53    var DayGridDateProfileGenerator = /** @class */ (function (_super) {
54        __extends(DayGridDateProfileGenerator, _super);
55        function DayGridDateProfileGenerator() {
56            return _super !== null && _super.apply(this, arguments) || this;
57        }
58        // Computes the date range that will be rendered.
59        DayGridDateProfileGenerator.prototype.buildRenderRange = function (currentRange, currentRangeUnit, isRangeAllDay) {
60            var dateEnv = this.dateEnv;
61            var renderRange = _super.prototype.buildRenderRange.call(this, currentRange, currentRangeUnit, isRangeAllDay);
62            var start = renderRange.start;
63            var end = renderRange.end;
64            var endOfWeek;
65            // year and month views should be aligned with weeks. this is already done for week
66            if (/^(year|month)$/.test(currentRangeUnit)) {
67                start = dateEnv.startOfWeek(start);
68                // make end-of-week if not already
69                endOfWeek = dateEnv.startOfWeek(end);
70                if (endOfWeek.valueOf() !== end.valueOf()) {
71                    end = core.addWeeks(endOfWeek, 1);
72                }
73            }
74            // ensure 6 weeks
75            if (this.options.monthMode &&
76                this.options.fixedWeekCount) {
77                var rowCnt = Math.ceil(// could be partial weeks due to hiddenDays
78                core.diffWeeks(start, end));
79                end = core.addWeeks(end, 6 - rowCnt);
80            }
81            return { start: start, end: end };
82        };
83        return DayGridDateProfileGenerator;
84    }(core.DateProfileGenerator));
85
86    /* A rectangular panel that is absolutely positioned over other content
87    ------------------------------------------------------------------------------------------------------------------------
88    Options:
89      - className (string)
90      - content (HTML string, element, or element array)
91      - parentEl
92      - top
93      - left
94      - right (the x coord of where the right edge should be. not a "CSS" right)
95      - autoHide (boolean)
96      - show (callback)
97      - hide (callback)
98    */
99    var Popover = /** @class */ (function () {
100        function Popover(options) {
101            var _this = this;
102            this.isHidden = true;
103            this.margin = 10; // the space required between the popover and the edges of the scroll container
104            // Triggered when the user clicks *anywhere* in the document, for the autoHide feature
105            this.documentMousedown = function (ev) {
106                // only hide the popover if the click happened outside the popover
107                if (_this.el && !_this.el.contains(ev.target)) {
108                    _this.hide();
109                }
110            };
111            this.options = options;
112        }
113        // Shows the popover on the specified position. Renders it if not already
114        Popover.prototype.show = function () {
115            if (this.isHidden) {
116                if (!this.el) {
117                    this.render();
118                }
119                this.el.style.display = '';
120                this.position();
121                this.isHidden = false;
122                this.trigger('show');
123            }
124        };
125        // Hides the popover, through CSS, but does not remove it from the DOM
126        Popover.prototype.hide = function () {
127            if (!this.isHidden) {
128                this.el.style.display = 'none';
129                this.isHidden = true;
130                this.trigger('hide');
131            }
132        };
133        // Creates `this.el` and renders content inside of it
134        Popover.prototype.render = function () {
135            var _this = this;
136            var options = this.options;
137            var el = this.el = core.createElement('div', {
138                className: 'fc-popover ' + (options.className || ''),
139                style: {
140                    top: '0',
141                    left: '0'
142                }
143            });
144            if (typeof options.content === 'function') {
145                options.content(el);
146            }
147            options.parentEl.appendChild(el);
148            // when a click happens on anything inside with a 'fc-close' className, hide the popover
149            core.listenBySelector(el, 'click', '.fc-close', function (ev) {
150                _this.hide();
151            });
152            if (options.autoHide) {
153                document.addEventListener('mousedown', this.documentMousedown);
154            }
155        };
156        // Hides and unregisters any handlers
157        Popover.prototype.destroy = function () {
158            this.hide();
159            if (this.el) {
160                core.removeElement(this.el);
161                this.el = null;
162            }
163            document.removeEventListener('mousedown', this.documentMousedown);
164        };
165        // Positions the popover optimally, using the top/left/right options
166        Popover.prototype.position = function () {
167            var options = this.options;
168            var el = this.el;
169            var elDims = el.getBoundingClientRect(); // only used for width,height
170            var origin = core.computeRect(el.offsetParent);
171            var clippingRect = core.computeClippingRect(options.parentEl);
172            var top; // the "position" (not "offset") values for the popover
173            var left; //
174            // compute top and left
175            top = options.top || 0;
176            if (options.left !== undefined) {
177                left = options.left;
178            }
179            else if (options.right !== undefined) {
180                left = options.right - elDims.width; // derive the left value from the right value
181            }
182            else {
183                left = 0;
184            }
185            // constrain to the view port. if constrained by two edges, give precedence to top/left
186            top = Math.min(top, clippingRect.bottom - elDims.height - this.margin);
187            top = Math.max(top, clippingRect.top + this.margin);
188            left = Math.min(left, clippingRect.right - elDims.width - this.margin);
189            left = Math.max(left, clippingRect.left + this.margin);
190            core.applyStyle(el, {
191                top: top - origin.top,
192                left: left - origin.left
193            });
194        };
195        // Triggers a callback. Calls a function in the option hash of the same name.
196        // Arguments beyond the first `name` are forwarded on.
197        // TODO: better code reuse for this. Repeat code
198        // can kill this???
199        Popover.prototype.trigger = function (name) {
200            if (this.options[name]) {
201                this.options[name].apply(this, Array.prototype.slice.call(arguments, 1));
202            }
203        };
204        return Popover;
205    }());
206
207    /* Event-rendering methods for the DayGrid class
208    ----------------------------------------------------------------------------------------------------------------------*/
209    // "Simple" is bad a name. has nothing to do with SimpleDayGrid
210    var SimpleDayGridEventRenderer = /** @class */ (function (_super) {
211        __extends(SimpleDayGridEventRenderer, _super);
212        function SimpleDayGridEventRenderer() {
213            return _super !== null && _super.apply(this, arguments) || this;
214        }
215        // Builds the HTML to be used for the default element for an individual segment
216        SimpleDayGridEventRenderer.prototype.renderSegHtml = function (seg, mirrorInfo) {
217            var context = this.context;
218            var eventRange = seg.eventRange;
219            var eventDef = eventRange.def;
220            var eventUi = eventRange.ui;
221            var allDay = eventDef.allDay;
222            var isDraggable = core.computeEventDraggable(context, eventDef, eventUi);
223            var isResizableFromStart = allDay && seg.isStart && core.computeEventStartResizable(context, eventDef, eventUi);
224            var isResizableFromEnd = allDay && seg.isEnd && core.computeEventEndResizable(context, eventDef, eventUi);
225            var classes = this.getSegClasses(seg, isDraggable, isResizableFromStart || isResizableFromEnd, mirrorInfo);
226            var skinCss = core.cssToStr(this.getSkinCss(eventUi));
227            var timeHtml = '';
228            var timeText;
229            var titleHtml;
230            classes.unshift('fc-day-grid-event', 'fc-h-event');
231            // Only display a timed events time if it is the starting segment
232            if (seg.isStart) {
233                timeText = this.getTimeText(eventRange);
234                if (timeText) {
235                    timeHtml = '<span class="fc-time">' + core.htmlEscape(timeText) + '</span>';
236                }
237            }
238            titleHtml =
239                '<span class="fc-title">' +
240                    (core.htmlEscape(eventDef.title || '') || '&nbsp;') + // we always want one line of height
241                    '</span>';
242            return '<a class="' + classes.join(' ') + '"' +
243                (eventDef.url ?
244                    ' href="' + core.htmlEscape(eventDef.url) + '"' :
245                    '') +
246                (skinCss ?
247                    ' style="' + skinCss + '"' :
248                    '') +
249                '>' +
250                '<div class="fc-content">' +
251                (context.options.dir === 'rtl' ?
252                    titleHtml + ' ' + timeHtml : // put a natural space in between
253                    timeHtml + ' ' + titleHtml //
254                ) +
255                '</div>' +
256                (isResizableFromStart ?
257                    '<div class="fc-resizer fc-start-resizer"></div>' :
258                    '') +
259                (isResizableFromEnd ?
260                    '<div class="fc-resizer fc-end-resizer"></div>' :
261                    '') +
262                '</a>';
263        };
264        // Computes a default event time formatting string if `eventTimeFormat` is not explicitly defined
265        SimpleDayGridEventRenderer.prototype.computeEventTimeFormat = function () {
266            return {
267                hour: 'numeric',
268                minute: '2-digit',
269                omitZeroMinute: true,
270                meridiem: 'narrow'
271            };
272        };
273        SimpleDayGridEventRenderer.prototype.computeDisplayEventEnd = function () {
274            return false; // TODO: somehow consider the originating DayGrid's column count
275        };
276        return SimpleDayGridEventRenderer;
277    }(core.FgEventRenderer));
278
279    /* Event-rendering methods for the DayGrid class
280    ----------------------------------------------------------------------------------------------------------------------*/
281    var DayGridEventRenderer = /** @class */ (function (_super) {
282        __extends(DayGridEventRenderer, _super);
283        function DayGridEventRenderer(dayGrid) {
284            var _this = _super.call(this) || this;
285            _this.dayGrid = dayGrid;
286            return _this;
287        }
288        // Renders the given foreground event segments onto the grid
289        DayGridEventRenderer.prototype.attachSegs = function (segs, mirrorInfo) {
290            var rowStructs = this.rowStructs = this.renderSegRows(segs);
291            // append to each row's content skeleton
292            this.dayGrid.rowEls.forEach(function (rowNode, i) {
293                rowNode.querySelector('.fc-content-skeleton > table').appendChild(rowStructs[i].tbodyEl);
294            });
295            // removes the "more.." events popover
296            if (!mirrorInfo) {
297                this.dayGrid.removeSegPopover();
298            }
299        };
300        // Unrenders all currently rendered foreground event segments
301        DayGridEventRenderer.prototype.detachSegs = function () {
302            var rowStructs = this.rowStructs || [];
303            var rowStruct;
304            while ((rowStruct = rowStructs.pop())) {
305                core.removeElement(rowStruct.tbodyEl);
306            }
307            this.rowStructs = null;
308        };
309        // Uses the given events array to generate <tbody> elements that should be appended to each row's content skeleton.
310        // Returns an array of rowStruct objects (see the bottom of `renderSegRow`).
311        // PRECONDITION: each segment shoud already have a rendered and assigned `.el`
312        DayGridEventRenderer.prototype.renderSegRows = function (segs) {
313            var rowStructs = [];
314            var segRows;
315            var row;
316            segRows = this.groupSegRows(segs); // group into nested arrays
317            // iterate each row of segment groupings
318            for (row = 0; row < segRows.length; row++) {
319                rowStructs.push(this.renderSegRow(row, segRows[row]));
320            }
321            return rowStructs;
322        };
323        // Given a row # and an array of segments all in the same row, render a <tbody> element, a skeleton that contains
324        // the segments. Returns object with a bunch of internal data about how the render was calculated.
325        // NOTE: modifies rowSegs
326        DayGridEventRenderer.prototype.renderSegRow = function (row, rowSegs) {
327            var isRtl = this.context.isRtl;
328            var dayGrid = this.dayGrid;
329            var colCnt = dayGrid.colCnt;
330            var segLevels = this.buildSegLevels(rowSegs); // group into sub-arrays of levels
331            var levelCnt = Math.max(1, segLevels.length); // ensure at least one level
332            var tbody = document.createElement('tbody');
333            var segMatrix = []; // lookup for which segments are rendered into which level+col cells
334            var cellMatrix = []; // lookup for all <td> elements of the level+col matrix
335            var loneCellMatrix = []; // lookup for <td> elements that only take up a single column
336            var i;
337            var levelSegs;
338            var col;
339            var tr;
340            var j;
341            var seg;
342            var td;
343            // populates empty cells from the current column (`col`) to `endCol`
344            function emptyCellsUntil(endCol) {
345                while (col < endCol) {
346                    // try to grab a cell from the level above and extend its rowspan. otherwise, create a fresh cell
347                    td = (loneCellMatrix[i - 1] || [])[col];
348                    if (td) {
349                        td.rowSpan = (td.rowSpan || 1) + 1;
350                    }
351                    else {
352                        td = document.createElement('td');
353                        tr.appendChild(td);
354                    }
355                    cellMatrix[i][col] = td;
356                    loneCellMatrix[i][col] = td;
357                    col++;
358                }
359            }
360            for (i = 0; i < levelCnt; i++) { // iterate through all levels
361                levelSegs = segLevels[i];
362                col = 0;
363                tr = document.createElement('tr');
364                segMatrix.push([]);
365                cellMatrix.push([]);
366                loneCellMatrix.push([]);
367                // levelCnt might be 1 even though there are no actual levels. protect against this.
368                // this single empty row is useful for styling.
369                if (levelSegs) {
370                    for (j = 0; j < levelSegs.length; j++) { // iterate through segments in level
371                        seg = levelSegs[j];
372                        var leftCol = isRtl ? (colCnt - 1 - seg.lastCol) : seg.firstCol;
373                        var rightCol = isRtl ? (colCnt - 1 - seg.firstCol) : seg.lastCol;
374                        emptyCellsUntil(leftCol);
375                        // create a container that occupies or more columns. append the event element.
376                        td = core.createElement('td', { className: 'fc-event-container' }, seg.el);
377                        if (leftCol !== rightCol) {
378                            td.colSpan = rightCol - leftCol + 1;
379                        }
380                        else { // a single-column segment
381                            loneCellMatrix[i][col] = td;
382                        }
383                        while (col <= rightCol) {
384                            cellMatrix[i][col] = td;
385                            segMatrix[i][col] = seg;
386                            col++;
387                        }
388                        tr.appendChild(td);
389                    }
390                }
391                emptyCellsUntil(colCnt); // finish off the row
392                var introHtml = dayGrid.renderProps.renderIntroHtml();
393                if (introHtml) {
394                    if (isRtl) {
395                        core.appendToElement(tr, introHtml);
396                    }
397                    else {
398                        core.prependToElement(tr, introHtml);
399                    }
400                }
401                tbody.appendChild(tr);
402            }
403            return {
404                row: row,
405                tbodyEl: tbody,
406                cellMatrix: cellMatrix,
407                segMatrix: segMatrix,
408                segLevels: segLevels,
409                segs: rowSegs
410            };
411        };
412        // Stacks a flat array of segments, which are all assumed to be in the same row, into subarrays of vertical levels.
413        // NOTE: modifies segs
414        DayGridEventRenderer.prototype.buildSegLevels = function (segs) {
415            var isRtl = this.context.isRtl;
416            var colCnt = this.dayGrid.colCnt;
417            var levels = [];
418            var i;
419            var seg;
420            var j;
421            // Give preference to elements with certain criteria, so they have
422            // a chance to be closer to the top.
423            segs = this.sortEventSegs(segs);
424            for (i = 0; i < segs.length; i++) {
425                seg = segs[i];
426                // loop through levels, starting with the topmost, until the segment doesn't collide with other segments
427                for (j = 0; j < levels.length; j++) {
428                    if (!isDaySegCollision(seg, levels[j])) {
429                        break;
430                    }
431                }
432                // `j` now holds the desired subrow index
433                seg.level = j;
434                seg.leftCol = isRtl ? (colCnt - 1 - seg.lastCol) : seg.firstCol; // for sorting only
435                seg.rightCol = isRtl ? (colCnt - 1 - seg.firstCol) : seg.lastCol // for sorting only
436                ;
437                (levels[j] || (levels[j] = [])).push(seg);
438            }
439            // order segments left-to-right. very important if calendar is RTL
440            for (j = 0; j < levels.length; j++) {
441                levels[j].sort(compareDaySegCols);
442            }
443            return levels;
444        };
445        // Given a flat array of segments, return an array of sub-arrays, grouped by each segment's row
446        DayGridEventRenderer.prototype.groupSegRows = function (segs) {
447            var segRows = [];
448            var i;
449            for (i = 0; i < this.dayGrid.rowCnt; i++) {
450                segRows.push([]);
451            }
452            for (i = 0; i < segs.length; i++) {
453                segRows[segs[i].row].push(segs[i]);
454            }
455            return segRows;
456        };
457        // Computes a default `displayEventEnd` value if one is not expliclty defined
458        DayGridEventRenderer.prototype.computeDisplayEventEnd = function () {
459            return this.dayGrid.colCnt === 1; // we'll likely have space if there's only one day
460        };
461        return DayGridEventRenderer;
462    }(SimpleDayGridEventRenderer));
463    // Computes whether two segments' columns collide. They are assumed to be in the same row.
464    function isDaySegCollision(seg, otherSegs) {
465        var i;
466        var otherSeg;
467        for (i = 0; i < otherSegs.length; i++) {
468            otherSeg = otherSegs[i];
469            if (otherSeg.firstCol <= seg.lastCol &&
470                otherSeg.lastCol >= seg.firstCol) {
471                return true;
472            }
473        }
474        return false;
475    }
476    // A cmp function for determining the leftmost event
477    function compareDaySegCols(a, b) {
478        return a.leftCol - b.leftCol;
479    }
480
481    var DayGridMirrorRenderer = /** @class */ (function (_super) {
482        __extends(DayGridMirrorRenderer, _super);
483        function DayGridMirrorRenderer() {
484            return _super !== null && _super.apply(this, arguments) || this;
485        }
486        DayGridMirrorRenderer.prototype.attachSegs = function (segs, mirrorInfo) {
487            var sourceSeg = mirrorInfo.sourceSeg;
488            var rowStructs = this.rowStructs = this.renderSegRows(segs);
489            // inject each new event skeleton into each associated row
490            this.dayGrid.rowEls.forEach(function (rowNode, row) {
491                var skeletonEl = core.htmlToElement('<div class="fc-mirror-skeleton"><table></table></div>'); // will be absolutely positioned
492                var skeletonTopEl;
493                var skeletonTop;
494                // If there is an original segment, match the top position. Otherwise, put it at the row's top level
495                if (sourceSeg && sourceSeg.row === row) {
496                    skeletonTopEl = sourceSeg.el;
497                }
498                else {
499                    skeletonTopEl = rowNode.querySelector('.fc-content-skeleton tbody');
500                    if (!skeletonTopEl) { // when no events
501                        skeletonTopEl = rowNode.querySelector('.fc-content-skeleton table');
502                    }
503                }
504                skeletonTop = skeletonTopEl.getBoundingClientRect().top -
505                    rowNode.getBoundingClientRect().top; // the offsetParent origin
506                skeletonEl.style.top = skeletonTop + 'px';
507                skeletonEl.querySelector('table').appendChild(rowStructs[row].tbodyEl);
508                rowNode.appendChild(skeletonEl);
509            });
510        };
511        return DayGridMirrorRenderer;
512    }(DayGridEventRenderer));
513
514    var EMPTY_CELL_HTML = '<td style="pointer-events:none"></td>';
515    var DayGridFillRenderer = /** @class */ (function (_super) {
516        __extends(DayGridFillRenderer, _super);
517        function DayGridFillRenderer(dayGrid) {
518            var _this = _super.call(this) || this;
519            _this.fillSegTag = 'td'; // override the default tag name
520            _this.dayGrid = dayGrid;
521            return _this;
522        }
523        DayGridFillRenderer.prototype.renderSegs = function (type, context, segs) {
524            // don't render timed background events
525            if (type === 'bgEvent') {
526                segs = segs.filter(function (seg) {
527                    return seg.eventRange.def.allDay;
528                });
529            }
530            _super.prototype.renderSegs.call(this, type, context, segs);
531        };
532        DayGridFillRenderer.prototype.attachSegs = function (type, segs) {
533            var els = [];
534            var i;
535            var seg;
536            var skeletonEl;
537            for (i = 0; i < segs.length; i++) {
538                seg = segs[i];
539                skeletonEl = this.renderFillRow(type, seg);
540                this.dayGrid.rowEls[seg.row].appendChild(skeletonEl);
541                els.push(skeletonEl);
542            }
543            return els;
544        };
545        // Generates the HTML needed for one row of a fill. Requires the seg's el to be rendered.
546        DayGridFillRenderer.prototype.renderFillRow = function (type, seg) {
547            var dayGrid = this.dayGrid;
548            var isRtl = this.context.isRtl;
549            var colCnt = dayGrid.colCnt;
550            var leftCol = isRtl ? (colCnt - 1 - seg.lastCol) : seg.firstCol;
551            var rightCol = isRtl ? (colCnt - 1 - seg.firstCol) : seg.lastCol;
552            var startCol = leftCol;
553            var endCol = rightCol + 1;
554            var className;
555            var skeletonEl;
556            var trEl;
557            if (type === 'businessHours') {
558                className = 'bgevent';
559            }
560            else {
561                className = type.toLowerCase();
562            }
563            skeletonEl = core.htmlToElement('<div class="fc-' + className + '-skeleton">' +
564                '<table><tr></tr></table>' +
565                '</div>');
566            trEl = skeletonEl.getElementsByTagName('tr')[0];
567            if (startCol > 0) {
568                core.appendToElement(trEl, 
569                // will create (startCol + 1) td's
570                new Array(startCol + 1).join(EMPTY_CELL_HTML));
571            }
572            seg.el.colSpan = endCol - startCol;
573            trEl.appendChild(seg.el);
574            if (endCol < colCnt) {
575                core.appendToElement(trEl, 
576                // will create (colCnt - endCol) td's
577                new Array(colCnt - endCol + 1).join(EMPTY_CELL_HTML));
578            }
579            var introHtml = dayGrid.renderProps.renderIntroHtml();
580            if (introHtml) {
581                if (isRtl) {
582                    core.appendToElement(trEl, introHtml);
583                }
584                else {
585                    core.prependToElement(trEl, introHtml);
586                }
587            }
588            return skeletonEl;
589        };
590        return DayGridFillRenderer;
591    }(core.FillRenderer));
592
593    var DayTile = /** @class */ (function (_super) {
594        __extends(DayTile, _super);
595        function DayTile(el) {
596            var _this = _super.call(this, el) || this;
597            var eventRenderer = _this.eventRenderer = new DayTileEventRenderer(_this);
598            var renderFrame = _this.renderFrame = core.memoizeRendering(_this._renderFrame);
599            _this.renderFgEvents = core.memoizeRendering(eventRenderer.renderSegs.bind(eventRenderer), eventRenderer.unrender.bind(eventRenderer), [renderFrame]);
600            _this.renderEventSelection = core.memoizeRendering(eventRenderer.selectByInstanceId.bind(eventRenderer), eventRenderer.unselectByInstanceId.bind(eventRenderer), [_this.renderFgEvents]);
601            _this.renderEventDrag = core.memoizeRendering(eventRenderer.hideByHash.bind(eventRenderer), eventRenderer.showByHash.bind(eventRenderer), [renderFrame]);
602            _this.renderEventResize = core.memoizeRendering(eventRenderer.hideByHash.bind(eventRenderer), eventRenderer.showByHash.bind(eventRenderer), [renderFrame]);
603            return _this;
604        }
605        DayTile.prototype.firstContext = function (context) {
606            context.calendar.registerInteractiveComponent(this, {
607                el: this.el,
608                useEventCenter: false
609            });
610        };
611        DayTile.prototype.render = function (props, context) {
612            this.renderFrame(props.date);
613            this.renderFgEvents(context, props.fgSegs);
614            this.renderEventSelection(props.eventSelection);
615            this.renderEventDrag(props.eventDragInstances);
616            this.renderEventResize(props.eventResizeInstances);
617        };
618        DayTile.prototype.destroy = function () {
619            _super.prototype.destroy.call(this);
620            this.renderFrame.unrender(); // should unrender everything else
621            this.context.calendar.unregisterInteractiveComponent(this);
622        };
623        DayTile.prototype._renderFrame = function (date) {
624            var _a = this.context, theme = _a.theme, dateEnv = _a.dateEnv, options = _a.options;
625            var title = dateEnv.format(date, core.createFormatter(options.dayPopoverFormat) // TODO: cache
626            );
627            this.el.innerHTML =
628                '<div class="fc-header ' + theme.getClass('popoverHeader') + '">' +
629                    '<span class="fc-title">' +
630                    core.htmlEscape(title) +
631                    '</span>' +
632                    '<span class="fc-close ' + theme.getIconClass('close') + '"></span>' +
633                    '</div>' +
634                    '<div class="fc-body ' + theme.getClass('popoverContent') + '">' +
635                    '<div class="fc-event-container"></div>' +
636                    '</div>';
637            this.segContainerEl = this.el.querySelector('.fc-event-container');
638        };
639        DayTile.prototype.queryHit = function (positionLeft, positionTop, elWidth, elHeight) {
640            var date = this.props.date; // HACK
641            if (positionLeft < elWidth && positionTop < elHeight) {
642                return {
643                    component: this,
644                    dateSpan: {
645                        allDay: true,
646                        range: { start: date, end: core.addDays(date, 1) }
647                    },
648                    dayEl: this.el,
649                    rect: {
650                        left: 0,
651                        top: 0,
652                        right: elWidth,
653                        bottom: elHeight
654                    },
655                    layer: 1
656                };
657            }
658        };
659        return DayTile;
660    }(core.DateComponent));
661    var DayTileEventRenderer = /** @class */ (function (_super) {
662        __extends(DayTileEventRenderer, _super);
663        function DayTileEventRenderer(dayTile) {
664            var _this = _super.call(this) || this;
665            _this.dayTile = dayTile;
666            return _this;
667        }
668        DayTileEventRenderer.prototype.attachSegs = function (segs) {
669            for (var _i = 0, segs_1 = segs; _i < segs_1.length; _i++) {
670                var seg = segs_1[_i];
671                this.dayTile.segContainerEl.appendChild(seg.el);
672            }
673        };
674        DayTileEventRenderer.prototype.detachSegs = function (segs) {
675            for (var _i = 0, segs_2 = segs; _i < segs_2.length; _i++) {
676                var seg = segs_2[_i];
677                core.removeElement(seg.el);
678            }
679        };
680        return DayTileEventRenderer;
681    }(SimpleDayGridEventRenderer));
682
683    var DayBgRow = /** @class */ (function () {
684        function DayBgRow(context) {
685            this.context = context;
686        }
687        DayBgRow.prototype.renderHtml = function (props) {
688            var parts = [];
689            if (props.renderIntroHtml) {
690                parts.push(props.renderIntroHtml());
691            }
692            for (var _i = 0, _a = props.cells; _i < _a.length; _i++) {
693                var cell = _a[_i];
694                parts.push(renderCellHtml(cell.date, props.dateProfile, this.context, cell.htmlAttrs));
695            }
696            if (!props.cells.length) {
697                parts.push('<td class="fc-day ' + this.context.theme.getClass('widgetContent') + '"></td>');
698            }
699            if (this.context.options.dir === 'rtl') {
700                parts.reverse();
701            }
702            return '<tr>' + parts.join('') + '</tr>';
703        };
704        return DayBgRow;
705    }());
706    function renderCellHtml(date, dateProfile, context, otherAttrs) {
707        var dateEnv = context.dateEnv, theme = context.theme;
708        var isDateValid = core.rangeContainsMarker(dateProfile.activeRange, date); // TODO: called too frequently. cache somehow.
709        var classes = core.getDayClasses(date, dateProfile, context);
710        classes.unshift('fc-day', theme.getClass('widgetContent'));
711        return '<td class="' + classes.join(' ') + '"' +
712            (isDateValid ?
713                ' data-date="' + dateEnv.formatIso(date, { omitTime: true }) + '"' :
714                '') +
715            (otherAttrs ?
716                ' ' + otherAttrs :
717                '') +
718            '></td>';
719    }
720
721    var DAY_NUM_FORMAT = core.createFormatter({ day: 'numeric' });
722    var WEEK_NUM_FORMAT = core.createFormatter({ week: 'numeric' });
723    var DayGrid = /** @class */ (function (_super) {
724        __extends(DayGrid, _super);
725        function DayGrid(el, renderProps) {
726            var _this = _super.call(this, el) || this;
727            _this.bottomCoordPadding = 0; // hack for extending the hit area for the last row of the coordinate grid
728            _this.isCellSizesDirty = false;
729            _this.renderProps = renderProps;
730            var eventRenderer = _this.eventRenderer = new DayGridEventRenderer(_this);
731            var fillRenderer = _this.fillRenderer = new DayGridFillRenderer(_this);
732            _this.mirrorRenderer = new DayGridMirrorRenderer(_this);
733            var renderCells = _this.renderCells = core.memoizeRendering(_this._renderCells, _this._unrenderCells);
734            _this.renderBusinessHours = core.memoizeRendering(fillRenderer.renderSegs.bind(fillRenderer, 'businessHours'), fillRenderer.unrender.bind(fillRenderer, 'businessHours'), [renderCells]);
735            _this.renderDateSelection = core.memoizeRendering(fillRenderer.renderSegs.bind(fillRenderer, 'highlight'), fillRenderer.unrender.bind(fillRenderer, 'highlight'), [renderCells]);
736            _this.renderBgEvents = core.memoizeRendering(fillRenderer.renderSegs.bind(fillRenderer, 'bgEvent'), fillRenderer.unrender.bind(fillRenderer, 'bgEvent'), [renderCells]);
737            _this.renderFgEvents = core.memoizeRendering(eventRenderer.renderSegs.bind(eventRenderer), eventRenderer.unrender.bind(eventRenderer), [renderCells]);
738            _this.renderEventSelection = core.memoizeRendering(eventRenderer.selectByInstanceId.bind(eventRenderer), eventRenderer.unselectByInstanceId.bind(eventRenderer), [_this.renderFgEvents]);
739            _this.renderEventDrag = core.memoizeRendering(_this._renderEventDrag, _this._unrenderEventDrag, [renderCells]);
740            _this.renderEventResize = core.memoizeRendering(_this._renderEventResize, _this._unrenderEventResize, [renderCells]);
741            return _this;
742        }
743        DayGrid.prototype.render = function (props, context) {
744            var cells = props.cells;
745            this.rowCnt = cells.length;
746            this.colCnt = cells[0].length;
747            this.renderCells(cells, props.isRigid);
748            this.renderBusinessHours(context, props.businessHourSegs);
749            this.renderDateSelection(context, props.dateSelectionSegs);
750            this.renderBgEvents(context, props.bgEventSegs);
751            this.renderFgEvents(context, props.fgEventSegs);
752            this.renderEventSelection(props.eventSelection);
753            this.renderEventDrag(props.eventDrag);
754            this.renderEventResize(props.eventResize);
755            if (this.segPopoverTile) {
756                this.updateSegPopoverTile();
757            }
758        };
759        DayGrid.prototype.destroy = function () {
760            _super.prototype.destroy.call(this);
761            this.renderCells.unrender(); // will unrender everything else
762        };
763        DayGrid.prototype.getCellRange = function (row, col) {
764            var start = this.props.cells[row][col].date;
765            var end = core.addDays(start, 1);
766            return { start: start, end: end };
767        };
768        DayGrid.prototype.updateSegPopoverTile = function (date, segs) {
769            var ownProps = this.props;
770            this.segPopoverTile.receiveProps({
771                date: date || this.segPopoverTile.props.date,
772                fgSegs: segs || this.segPopoverTile.props.fgSegs,
773                eventSelection: ownProps.eventSelection,
774                eventDragInstances: ownProps.eventDrag ? ownProps.eventDrag.affectedInstances : null,
775                eventResizeInstances: ownProps.eventResize ? ownProps.eventResize.affectedInstances : null
776            }, this.context);
777        };
778        /* Date Rendering
779        ------------------------------------------------------------------------------------------------------------------*/
780        DayGrid.prototype._renderCells = function (cells, isRigid) {
781            var _a = this.context, calendar = _a.calendar, view = _a.view, isRtl = _a.isRtl, dateEnv = _a.dateEnv;
782            var _b = this, rowCnt = _b.rowCnt, colCnt = _b.colCnt;
783            var html = '';
784            var row;
785            var col;
786            for (row = 0; row < rowCnt; row++) {
787                html += this.renderDayRowHtml(row, isRigid);
788            }
789            this.el.innerHTML = html;
790            this.rowEls = core.findElements(this.el, '.fc-row');
791            this.cellEls = core.findElements(this.el, '.fc-day, .fc-disabled-day');
792            if (isRtl) {
793                this.cellEls.reverse();
794            }
795            this.rowPositions = new core.PositionCache(this.el, this.rowEls, false, true // vertical
796            );
797            this.colPositions = new core.PositionCache(this.el, this.cellEls.slice(0, colCnt), // only the first row
798            true, false // horizontal
799            );
800            // trigger dayRender with each cell's element
801            for (row = 0; row < rowCnt; row++) {
802                for (col = 0; col < colCnt; col++) {
803                    calendar.publiclyTrigger('dayRender', [
804                        {
805                            date: dateEnv.toDate(cells[row][col].date),
806                            el: this.getCellEl(row, col),
807                            view: view
808                        }
809                    ]);
810                }
811            }
812            this.isCellSizesDirty = true;
813        };
814        DayGrid.prototype._unrenderCells = function () {
815            this.removeSegPopover();
816        };
817        // Generates the HTML for a single row, which is a div that wraps a table.
818        // `row` is the row number.
819        DayGrid.prototype.renderDayRowHtml = function (row, isRigid) {
820            var theme = this.context.theme;
821            var classes = ['fc-row', 'fc-week', theme.getClass('dayRow')];
822            if (isRigid) {
823                classes.push('fc-rigid');
824            }
825            var bgRow = new DayBgRow(this.context);
826            return '' +
827                '<div class="' + classes.join(' ') + '">' +
828                '<div class="fc-bg">' +
829                '<table class="' + theme.getClass('tableGrid') + '">' +
830                bgRow.renderHtml({
831                    cells: this.props.cells[row],
832                    dateProfile: this.props.dateProfile,
833                    renderIntroHtml: this.renderProps.renderBgIntroHtml
834                }) +
835                '</table>' +
836                '</div>' +
837                '<div class="fc-content-skeleton">' +
838                '<table>' +
839                (this.getIsNumbersVisible() ?
840                    '<thead>' +
841                        this.renderNumberTrHtml(row) +
842                        '</thead>' :
843                    '') +
844                '</table>' +
845                '</div>' +
846                '</div>';
847        };
848        DayGrid.prototype.getIsNumbersVisible = function () {
849            return this.getIsDayNumbersVisible() ||
850                this.renderProps.cellWeekNumbersVisible ||
851                this.renderProps.colWeekNumbersVisible;
852        };
853        DayGrid.prototype.getIsDayNumbersVisible = function () {
854            return this.rowCnt > 1;
855        };
856        /* Grid Number Rendering
857        ------------------------------------------------------------------------------------------------------------------*/
858        DayGrid.prototype.renderNumberTrHtml = function (row) {
859            var isRtl = this.context.isRtl;
860            var intro = this.renderProps.renderNumberIntroHtml(row, this);
861            return '' +
862                '<tr>' +
863                (isRtl ? '' : intro) +
864                this.renderNumberCellsHtml(row) +
865                (isRtl ? intro : '') +
866                '</tr>';
867        };
868        DayGrid.prototype.renderNumberCellsHtml = function (row) {
869            var htmls = [];
870            var col;
871            var date;
872            for (col = 0; col < this.colCnt; col++) {
873                date = this.props.cells[row][col].date;
874                htmls.push(this.renderNumberCellHtml(date));
875            }
876            if (this.context.isRtl) {
877                htmls.reverse();
878            }
879            return htmls.join('');
880        };
881        // Generates the HTML for the <td>s of the "number" row in the DayGrid's content skeleton.
882        // The number row will only exist if either day numbers or week numbers are turned on.
883        DayGrid.prototype.renderNumberCellHtml = function (date) {
884            var _a = this.context, dateEnv = _a.dateEnv, options = _a.options;
885            var html = '';
886            var isDateValid = core.rangeContainsMarker(this.props.dateProfile.activeRange, date); // TODO: called too frequently. cache somehow.
887            var isDayNumberVisible = this.getIsDayNumbersVisible() && isDateValid;
888            var classes;
889            var weekCalcFirstDow;
890            if (!isDayNumberVisible && !this.renderProps.cellWeekNumbersVisible) {
891                // no numbers in day cell (week number must be along the side)
892                return '<td></td>'; //  will create an empty space above events :(
893            }
894            classes = core.getDayClasses(date, this.props.dateProfile, this.context);
895            classes.unshift('fc-day-top');
896            if (this.renderProps.cellWeekNumbersVisible) {
897                weekCalcFirstDow = dateEnv.weekDow;
898            }
899            html += '<td class="' + classes.join(' ') + '"' +
900                (isDateValid ?
901                    ' data-date="' + dateEnv.formatIso(date, { omitTime: true }) + '"' :
902                    '') +
903                '>';
904            if (this.renderProps.cellWeekNumbersVisible && (date.getUTCDay() === weekCalcFirstDow)) {
905                html += core.buildGotoAnchorHtml(options, dateEnv, { date: date, type: 'week' }, { 'class': 'fc-week-number' }, dateEnv.format(date, WEEK_NUM_FORMAT) // inner HTML
906                );
907            }
908            if (isDayNumberVisible) {
909                html += core.buildGotoAnchorHtml(options, dateEnv, date, { 'class': 'fc-day-number' }, dateEnv.format(date, DAY_NUM_FORMAT) // inner HTML
910                );
911            }
912            html += '</td>';
913            return html;
914        };
915        /* Sizing
916        ------------------------------------------------------------------------------------------------------------------*/
917        DayGrid.prototype.updateSize = function (isResize) {
918            var calendar = this.context.calendar;
919            var _a = this, fillRenderer = _a.fillRenderer, eventRenderer = _a.eventRenderer, mirrorRenderer = _a.mirrorRenderer;
920            if (isResize ||
921                this.isCellSizesDirty ||
922                calendar.isEventsUpdated // hack
923            ) {
924                this.buildPositionCaches();
925                this.isCellSizesDirty = false;
926            }
927            fillRenderer.computeSizes(isResize);
928            eventRenderer.computeSizes(isResize);
929            mirrorRenderer.computeSizes(isResize);
930            fillRenderer.assignSizes(isResize);
931            eventRenderer.assignSizes(isResize);
932            mirrorRenderer.assignSizes(isResize);
933        };
934        DayGrid.prototype.buildPositionCaches = function () {
935            this.buildColPositions();
936            this.buildRowPositions();
937        };
938        DayGrid.prototype.buildColPositions = function () {
939            this.colPositions.build();
940        };
941        DayGrid.prototype.buildRowPositions = function () {
942            this.rowPositions.build();
943            this.rowPositions.bottoms[this.rowCnt - 1] += this.bottomCoordPadding; // hack
944        };
945        /* Hit System
946        ------------------------------------------------------------------------------------------------------------------*/
947        DayGrid.prototype.positionToHit = function (leftPosition, topPosition) {
948            var _a = this, colPositions = _a.colPositions, rowPositions = _a.rowPositions;
949            var col = colPositions.leftToIndex(leftPosition);
950            var row = rowPositions.topToIndex(topPosition);
951            if (row != null && col != null) {
952                return {
953                    row: row,
954                    col: col,
955                    dateSpan: {
956                        range: this.getCellRange(row, col),
957                        allDay: true
958                    },
959                    dayEl: this.getCellEl(row, col),
960                    relativeRect: {
961                        left: colPositions.lefts[col],
962                        right: colPositions.rights[col],
963                        top: rowPositions.tops[row],
964                        bottom: rowPositions.bottoms[row]
965                    }
966                };
967            }
968        };
969        /* Cell System
970        ------------------------------------------------------------------------------------------------------------------*/
971        // FYI: the first column is the leftmost column, regardless of date
972        DayGrid.prototype.getCellEl = function (row, col) {
973            return this.cellEls[row * this.colCnt + col];
974        };
975        /* Event Drag Visualization
976        ------------------------------------------------------------------------------------------------------------------*/
977        DayGrid.prototype._renderEventDrag = function (state) {
978            if (state) {
979                this.eventRenderer.hideByHash(state.affectedInstances);
980                this.fillRenderer.renderSegs('highlight', this.context, state.segs);
981            }
982        };
983        DayGrid.prototype._unrenderEventDrag = function (state) {
984            if (state) {
985                this.eventRenderer.showByHash(state.affectedInstances);
986                this.fillRenderer.unrender('highlight', this.context);
987            }
988        };
989        /* Event Resize Visualization
990        ------------------------------------------------------------------------------------------------------------------*/
991        DayGrid.prototype._renderEventResize = function (state) {
992            if (state) {
993                this.eventRenderer.hideByHash(state.affectedInstances);
994                this.fillRenderer.renderSegs('highlight', this.context, state.segs);
995                this.mirrorRenderer.renderSegs(this.context, state.segs, { isResizing: true, sourceSeg: state.sourceSeg });
996            }
997        };
998        DayGrid.prototype._unrenderEventResize = function (state) {
999            if (state) {
1000                this.eventRenderer.showByHash(state.affectedInstances);
1001                this.fillRenderer.unrender('highlight', this.context);
1002                this.mirrorRenderer.unrender(this.context, state.segs, { isResizing: true, sourceSeg: state.sourceSeg });
1003            }
1004        };
1005        /* More+ Link Popover
1006        ------------------------------------------------------------------------------------------------------------------*/
1007        DayGrid.prototype.removeSegPopover = function () {
1008            if (this.segPopover) {
1009                this.segPopover.hide(); // in handler, will call segPopover's removeElement
1010            }
1011        };
1012        // Limits the number of "levels" (vertically stacking layers of events) for each row of the grid.
1013        // `levelLimit` can be false (don't limit), a number, or true (should be computed).
1014        DayGrid.prototype.limitRows = function (levelLimit) {
1015            var rowStructs = this.eventRenderer.rowStructs || [];
1016            var row; // row #
1017            var rowLevelLimit;
1018            for (row = 0; row < rowStructs.length; row++) {
1019                this.unlimitRow(row);
1020                if (!levelLimit) {
1021                    rowLevelLimit = false;
1022                }
1023                else if (typeof levelLimit === 'number') {
1024                    rowLevelLimit = levelLimit;
1025                }
1026                else {
1027                    rowLevelLimit = this.computeRowLevelLimit(row);
1028                }
1029                if (rowLevelLimit !== false) {
1030                    this.limitRow(row, rowLevelLimit);
1031                }
1032            }
1033        };
1034        // Computes the number of levels a row will accomodate without going outside its bounds.
1035        // Assumes the row is "rigid" (maintains a constant height regardless of what is inside).
1036        // `row` is the row number.
1037        DayGrid.prototype.computeRowLevelLimit = function (row) {
1038            var rowEl = this.rowEls[row]; // the containing "fake" row div
1039            var rowBottom = rowEl.getBoundingClientRect().bottom; // relative to viewport!
1040            var trEls = core.findChildren(this.eventRenderer.rowStructs[row].tbodyEl);
1041            var i;
1042            var trEl;
1043            // Reveal one level <tr> at a time and stop when we find one out of bounds
1044            for (i = 0; i < trEls.length; i++) {
1045                trEl = trEls[i];
1046                trEl.classList.remove('fc-limited'); // reset to original state (reveal)
1047                if (trEl.getBoundingClientRect().bottom > rowBottom) {
1048                    return i;
1049                }
1050            }
1051            return false; // should not limit at all
1052        };
1053        // Limits the given grid row to the maximum number of levels and injects "more" links if necessary.
1054        // `row` is the row number.
1055        // `levelLimit` is a number for the maximum (inclusive) number of levels allowed.
1056        DayGrid.prototype.limitRow = function (row, levelLimit) {
1057            var _this = this;
1058            var colCnt = this.colCnt;
1059            var isRtl = this.context.isRtl;
1060            var rowStruct = this.eventRenderer.rowStructs[row];
1061            var moreNodes = []; // array of "more" <a> links and <td> DOM nodes
1062            var col = 0; // col #, left-to-right (not chronologically)
1063            var levelSegs; // array of segment objects in the last allowable level, ordered left-to-right
1064            var cellMatrix; // a matrix (by level, then column) of all <td> elements in the row
1065            var limitedNodes; // array of temporarily hidden level <tr> and segment <td> DOM nodes
1066            var i;
1067            var seg;
1068            var segsBelow; // array of segment objects below `seg` in the current `col`
1069            var totalSegsBelow; // total number of segments below `seg` in any of the columns `seg` occupies
1070            var colSegsBelow; // array of segment arrays, below seg, one for each column (offset from segs's first column)
1071            var td;
1072            var rowSpan;
1073            var segMoreNodes; // array of "more" <td> cells that will stand-in for the current seg's cell
1074            var j;
1075            var moreTd;
1076            var moreWrap;
1077            var moreLink;
1078            // Iterates through empty level cells and places "more" links inside if need be
1079            var emptyCellsUntil = function (endCol) {
1080                while (col < endCol) {
1081                    segsBelow = _this.getCellSegs(row, col, levelLimit);
1082                    if (segsBelow.length) {
1083                        td = cellMatrix[levelLimit - 1][col];
1084                        moreLink = _this.renderMoreLink(row, col, segsBelow);
1085                        moreWrap = core.createElement('div', null, moreLink);
1086                        td.appendChild(moreWrap);
1087                        moreNodes.push(moreWrap);
1088                    }
1089                    col++;
1090                }
1091            };
1092            if (levelLimit && levelLimit < rowStruct.segLevels.length) { // is it actually over the limit?
1093                levelSegs = rowStruct.segLevels[levelLimit - 1];
1094                cellMatrix = rowStruct.cellMatrix;
1095                limitedNodes = core.findChildren(rowStruct.tbodyEl).slice(levelLimit); // get level <tr> elements past the limit
1096                limitedNodes.forEach(function (node) {
1097                    node.classList.add('fc-limited'); // hide elements and get a simple DOM-nodes array
1098                });
1099                // iterate though segments in the last allowable level
1100                for (i = 0; i < levelSegs.length; i++) {
1101                    seg = levelSegs[i];
1102                    var leftCol = isRtl ? (colCnt - 1 - seg.lastCol) : seg.firstCol;
1103                    var rightCol = isRtl ? (colCnt - 1 - seg.firstCol) : seg.lastCol;
1104                    emptyCellsUntil(leftCol); // process empty cells before the segment
1105                    // determine *all* segments below `seg` that occupy the same columns
1106                    colSegsBelow = [];
1107                    totalSegsBelow = 0;
1108                    while (col <= rightCol) {
1109                        segsBelow = this.getCellSegs(row, col, levelLimit);
1110                        colSegsBelow.push(segsBelow);
1111                        totalSegsBelow += segsBelow.length;
1112                        col++;
1113                    }
1114                    if (totalSegsBelow) { // do we need to replace this segment with one or many "more" links?
1115                        td = cellMatrix[levelLimit - 1][leftCol]; // the segment's parent cell
1116                        rowSpan = td.rowSpan || 1;
1117                        segMoreNodes = [];
1118                        // make a replacement <td> for each column the segment occupies. will be one for each colspan
1119                        for (j = 0; j < colSegsBelow.length; j++) {
1120                            moreTd = core.createElement('td', { className: 'fc-more-cell', rowSpan: rowSpan });
1121                            segsBelow = colSegsBelow[j];
1122                            moreLink = this.renderMoreLink(row, leftCol + j, [seg].concat(segsBelow) // count seg as hidden too
1123                            );
1124                            moreWrap = core.createElement('div', null, moreLink);
1125                            moreTd.appendChild(moreWrap);
1126                            segMoreNodes.push(moreTd);
1127                            moreNodes.push(moreTd);
1128                        }
1129                        td.classList.add('fc-limited');
1130                        core.insertAfterElement(td, segMoreNodes);
1131                        limitedNodes.push(td);
1132                    }
1133                }
1134                emptyCellsUntil(this.colCnt); // finish off the level
1135                rowStruct.moreEls = moreNodes; // for easy undoing later
1136                rowStruct.limitedEls = limitedNodes; // for easy undoing later
1137            }
1138        };
1139        // Reveals all levels and removes all "more"-related elements for a grid's row.
1140        // `row` is a row number.
1141        DayGrid.prototype.unlimitRow = function (row) {
1142            var rowStruct = this.eventRenderer.rowStructs[row];
1143            if (rowStruct.moreEls) {
1144                rowStruct.moreEls.forEach(core.removeElement);
1145                rowStruct.moreEls = null;
1146            }
1147            if (rowStruct.limitedEls) {
1148                rowStruct.limitedEls.forEach(function (limitedEl) {
1149                    limitedEl.classList.remove('fc-limited');
1150                });
1151                rowStruct.limitedEls = null;
1152            }
1153        };
1154        // Renders an <a> element that represents hidden event element for a cell.
1155        // Responsible for attaching click handler as well.
1156        DayGrid.prototype.renderMoreLink = function (row, col, hiddenSegs) {
1157            var _this = this;
1158            var _a = this.context, calendar = _a.calendar, view = _a.view, dateEnv = _a.dateEnv, options = _a.options, isRtl = _a.isRtl;
1159            var a = core.createElement('a', { className: 'fc-more' });
1160            a.innerText = this.getMoreLinkText(hiddenSegs.length);
1161            a.addEventListener('click', function (ev) {
1162                var clickOption = options.eventLimitClick;
1163                var _col = isRtl ? _this.colCnt - col - 1 : col; // HACK: props.cells has different dir system?
1164                var date = _this.props.cells[row][_col].date;
1165                var moreEl = ev.currentTarget;
1166                var dayEl = _this.getCellEl(row, col);
1167                var allSegs = _this.getCellSegs(row, col);
1168                // rescope the segments to be within the cell's date
1169                var reslicedAllSegs = _this.resliceDaySegs(allSegs, date);
1170                var reslicedHiddenSegs = _this.resliceDaySegs(hiddenSegs, date);
1171                if (typeof clickOption === 'function') {
1172                    // the returned value can be an atomic option
1173                    clickOption = calendar.publiclyTrigger('eventLimitClick', [
1174                        {
1175                            date: dateEnv.toDate(date),
1176                            allDay: true,
1177                            dayEl: dayEl,
1178                            moreEl: moreEl,
1179                            segs: reslicedAllSegs,
1180                            hiddenSegs: reslicedHiddenSegs,
1181                            jsEvent: ev,
1182                            view: view
1183                        }
1184                    ]);
1185                }
1186                if (clickOption === 'popover') {
1187                    _this.showSegPopover(row, col, moreEl, reslicedAllSegs);
1188                }
1189                else if (typeof clickOption === 'string') { // a view name
1190                    calendar.zoomTo(date, clickOption);
1191                }
1192            });
1193            return a;
1194        };
1195        // Reveals the popover that displays all events within a cell
1196        DayGrid.prototype.showSegPopover = function (row, col, moreLink, segs) {
1197            var _this = this;
1198            var _a = this.context, calendar = _a.calendar, view = _a.view, theme = _a.theme, isRtl = _a.isRtl;
1199            var _col = isRtl ? this.colCnt - col - 1 : col; // HACK: props.cells has different dir system?
1200            var moreWrap = moreLink.parentNode; // the <div> wrapper around the <a>
1201            var topEl; // the element we want to match the top coordinate of
1202            var options;
1203            if (this.rowCnt === 1) {
1204                topEl = view.el; // will cause the popover to cover any sort of header
1205            }
1206            else {
1207                topEl = this.rowEls[row]; // will align with top of row
1208            }
1209            options = {
1210                className: 'fc-more-popover ' + theme.getClass('popover'),
1211                parentEl: view.el,
1212                top: core.computeRect(topEl).top,
1213                autoHide: true,
1214                content: function (el) {
1215                    _this.segPopoverTile = new DayTile(el);
1216                    _this.updateSegPopoverTile(_this.props.cells[row][_col].date, segs);
1217                },
1218                hide: function () {
1219                    _this.segPopoverTile.destroy();
1220                    _this.segPopoverTile = null;
1221                    _this.segPopover.destroy();
1222                    _this.segPopover = null;
1223                }
1224            };
1225            // Determine horizontal coordinate.
1226            // We use the moreWrap instead of the <td> to avoid border confusion.
1227            if (isRtl) {
1228                options.right = core.computeRect(moreWrap).right + 1; // +1 to be over cell border
1229            }
1230            else {
1231                options.left = core.computeRect(moreWrap).left - 1; // -1 to be over cell border
1232            }
1233            this.segPopover = new Popover(options);
1234            this.segPopover.show();
1235            calendar.releaseAfterSizingTriggers(); // hack for eventPositioned
1236        };
1237        // Given the events within an array of segment objects, reslice them to be in a single day
1238        DayGrid.prototype.resliceDaySegs = function (segs, dayDate) {
1239            var dayStart = dayDate;
1240            var dayEnd = core.addDays(dayStart, 1);
1241            var dayRange = { start: dayStart, end: dayEnd };
1242            var newSegs = [];
1243            for (var _i = 0, segs_1 = segs; _i < segs_1.length; _i++) {
1244                var seg = segs_1[_i];
1245                var eventRange = seg.eventRange;
1246                var origRange = eventRange.range;
1247                var slicedRange = core.intersectRanges(origRange, dayRange);
1248                if (slicedRange) {
1249                    newSegs.push(__assign({}, seg, { eventRange: {
1250                            def: eventRange.def,
1251                            ui: __assign({}, eventRange.ui, { durationEditable: false }),
1252                            instance: eventRange.instance,
1253                            range: slicedRange
1254                        }, isStart: seg.isStart && slicedRange.start.valueOf() === origRange.start.valueOf(), isEnd: seg.isEnd && slicedRange.end.valueOf() === origRange.end.valueOf() }));
1255                }
1256            }
1257            return newSegs;
1258        };
1259        // Generates the text that should be inside a "more" link, given the number of events it represents
1260        DayGrid.prototype.getMoreLinkText = function (num) {
1261            var opt = this.context.options.eventLimitText;
1262            if (typeof opt === 'function') {
1263                return opt(num);
1264            }
1265            else {
1266                return '+' + num + ' ' + opt;
1267            }
1268        };
1269        // Returns segments within a given cell.
1270        // If `startLevel` is specified, returns only events including and below that level. Otherwise returns all segs.
1271        DayGrid.prototype.getCellSegs = function (row, col, startLevel) {
1272            var segMatrix = this.eventRenderer.rowStructs[row].segMatrix;
1273            var level = startLevel || 0;
1274            var segs = [];
1275            var seg;
1276            while (level < segMatrix.length) {
1277                seg = segMatrix[level][col];
1278                if (seg) {
1279                    segs.push(seg);
1280                }
1281                level++;
1282            }
1283            return segs;
1284        };
1285        return DayGrid;
1286    }(core.DateComponent));
1287
1288    var WEEK_NUM_FORMAT$1 = core.createFormatter({ week: 'numeric' });
1289    /* An abstract class for the daygrid views, as well as month view. Renders one or more rows of day cells.
1290    ----------------------------------------------------------------------------------------------------------------------*/
1291    // It is a manager for a DayGrid subcomponent, which does most of the heavy lifting.
1292    // It is responsible for managing width/height.
1293    var AbstractDayGridView = /** @class */ (function (_super) {
1294        __extends(AbstractDayGridView, _super);
1295        function AbstractDayGridView() {
1296            var _this = _super !== null && _super.apply(this, arguments) || this;
1297            _this.processOptions = core.memoize(_this._processOptions);
1298            _this.renderSkeleton = core.memoizeRendering(_this._renderSkeleton, _this._unrenderSkeleton);
1299            /* Header Rendering
1300            ------------------------------------------------------------------------------------------------------------------*/
1301            // Generates the HTML that will go before the day-of week header cells
1302            _this.renderHeadIntroHtml = function () {
1303                var _a = _this.context, theme = _a.theme, options = _a.options;
1304                if (_this.colWeekNumbersVisible) {
1305                    return '' +
1306                        '<th class="fc-week-number ' + theme.getClass('widgetHeader') + '" ' + _this.weekNumberStyleAttr() + '>' +
1307                        '<span>' + // needed for matchCellWidths
1308                        core.htmlEscape(options.weekLabel) +
1309                        '</span>' +
1310                        '</th>';
1311                }
1312                return '';
1313            };
1314            /* Day Grid Rendering
1315            ------------------------------------------------------------------------------------------------------------------*/
1316            // Generates the HTML that will go before content-skeleton cells that display the day/week numbers
1317            _this.renderDayGridNumberIntroHtml = function (row, dayGrid) {
1318                var _a = _this.context, options = _a.options, dateEnv = _a.dateEnv;
1319                var weekStart = dayGrid.props.cells[row][0].date;
1320                if (_this.colWeekNumbersVisible) {
1321                    return '' +
1322                        '<td class="fc-week-number" ' + _this.weekNumberStyleAttr() + '>' +
1323                        core.buildGotoAnchorHtml(// aside from link, important for matchCellWidths
1324                        options, dateEnv, { date: weekStart, type: 'week', forceOff: dayGrid.colCnt === 1 }, dateEnv.format(weekStart, WEEK_NUM_FORMAT$1) // inner HTML
1325                        ) +
1326                        '</td>';
1327                }
1328                return '';
1329            };
1330            // Generates the HTML that goes before the day bg cells for each day-row
1331            _this.renderDayGridBgIntroHtml = function () {
1332                var theme = _this.context.theme;
1333                if (_this.colWeekNumbersVisible) {
1334                    return '<td class="fc-week-number ' + theme.getClass('widgetContent') + '" ' + _this.weekNumberStyleAttr() + '></td>';
1335                }
1336                return '';
1337            };
1338            // Generates the HTML that goes before every other type of row generated by DayGrid.
1339            // Affects mirror-skeleton and highlight-skeleton rows.
1340            _this.renderDayGridIntroHtml = function () {
1341                if (_this.colWeekNumbersVisible) {
1342                    return '<td class="fc-week-number" ' + _this.weekNumberStyleAttr() + '></td>';
1343                }
1344                return '';
1345            };
1346            return _this;
1347        }
1348        AbstractDayGridView.prototype._processOptions = function (options) {
1349            if (options.weekNumbers) {
1350                if (options.weekNumbersWithinDays) {
1351                    this.cellWeekNumbersVisible = true;
1352                    this.colWeekNumbersVisible = false;
1353                }
1354                else {
1355                    this.cellWeekNumbersVisible = false;
1356                    this.colWeekNumbersVisible = true;
1357                }
1358            }
1359            else {
1360                this.colWeekNumbersVisible = false;
1361                this.cellWeekNumbersVisible = false;
1362            }
1363        };
1364        AbstractDayGridView.prototype.render = function (props, context) {
1365            _super.prototype.render.call(this, props, context);
1366            this.processOptions(context.options);
1367            this.renderSkeleton(context);
1368        };
1369        AbstractDayGridView.prototype.destroy = function () {
1370            _super.prototype.destroy.call(this);
1371            this.renderSkeleton.unrender();
1372        };
1373        AbstractDayGridView.prototype._renderSkeleton = function (context) {
1374            this.el.classList.add('fc-dayGrid-view');
1375            this.el.innerHTML = this.renderSkeletonHtml();
1376            this.scroller = new core.ScrollComponent('hidden', // overflow x
1377            'auto' // overflow y
1378            );
1379            var dayGridContainerEl = this.scroller.el;
1380            this.el.querySelector('.fc-body > tr > td').appendChild(dayGridContainerEl);
1381            dayGridContainerEl.classList.add('fc-day-grid-container');
1382            var dayGridEl = core.createElement('div', { className: 'fc-day-grid' });
1383            dayGridContainerEl.appendChild(dayGridEl);
1384            this.dayGrid = new DayGrid(dayGridEl, {
1385                renderNumberIntroHtml: this.renderDayGridNumberIntroHtml,
1386                renderBgIntroHtml: this.renderDayGridBgIntroHtml,
1387                renderIntroHtml: this.renderDayGridIntroHtml,
1388                colWeekNumbersVisible: this.colWeekNumbersVisible,
1389                cellWeekNumbersVisible: this.cellWeekNumbersVisible
1390            });
1391        };
1392        AbstractDayGridView.prototype._unrenderSkeleton = function () {
1393            this.el.classList.remove('fc-dayGrid-view');
1394            this.dayGrid.destroy();
1395            this.scroller.destroy();
1396        };
1397        // Builds the HTML skeleton for the view.
1398        // The day-grid component will render inside of a container defined by this HTML.
1399        AbstractDayGridView.prototype.renderSkeletonHtml = function () {
1400            var _a = this.context, theme = _a.theme, options = _a.options;
1401            return '' +
1402                '<table class="' + theme.getClass('tableGrid') + '">' +
1403                (options.columnHeader ?
1404                    '<thead class="fc-head">' +
1405                        '<tr>' +
1406                        '<td class="fc-head-container ' + theme.getClass('widgetHeader') + '">&nbsp;</td>' +
1407                        '</tr>' +
1408                        '</thead>' :
1409                    '') +
1410                '<tbody class="fc-body">' +
1411                '<tr>' +
1412                '<td class="' + theme.getClass('widgetContent') + '"></td>' +
1413                '</tr>' +
1414                '</tbody>' +
1415                '</table>';
1416        };
1417        // Generates an HTML attribute string for setting the width of the week number column, if it is known
1418        AbstractDayGridView.prototype.weekNumberStyleAttr = function () {
1419            if (this.weekNumberWidth != null) {
1420                return 'style="width:' + this.weekNumberWidth + 'px"';
1421            }
1422            return '';
1423        };
1424        // Determines whether each row should have a constant height
1425        AbstractDayGridView.prototype.hasRigidRows = function () {
1426            var eventLimit = this.context.options.eventLimit;
1427            return eventLimit && typeof eventLimit !== 'number';
1428        };
1429        /* Dimensions
1430        ------------------------------------------------------------------------------------------------------------------*/
1431        AbstractDayGridView.prototype.updateSize = function (isResize, viewHeight, isAuto) {
1432            _super.prototype.updateSize.call(this, isResize, viewHeight, isAuto); // will call updateBaseSize. important that executes first
1433            this.dayGrid.updateSize(isResize);
1434        };
1435        // Refreshes the horizontal dimensions of the view
1436        AbstractDayGridView.prototype.updateBaseSize = function (isResize, viewHeight, isAuto) {
1437            var dayGrid = this.dayGrid;
1438            var eventLimit = this.context.options.eventLimit;
1439            var headRowEl = this.header ? this.header.el : null; // HACK
1440            var scrollerHeight;
1441            var scrollbarWidths;
1442            // hack to give the view some height prior to dayGrid's columns being rendered
1443            // TODO: separate setting height from scroller VS dayGrid.
1444            if (!dayGrid.rowEls) {
1445                if (!isAuto) {
1446                    scrollerHeight = this.computeScrollerHeight(viewHeight);
1447                    this.scroller.setHeight(scrollerHeight);
1448                }
1449                return;
1450            }
1451            if (this.colWeekNumbersVisible) {
1452                // Make sure all week number cells running down the side have the same width.
1453                this.weekNumberWidth = core.matchCellWidths(core.findElements(this.el, '.fc-week-number'));
1454            }
1455            // reset all heights to be natural
1456            this.scroller.clear();
1457            if (headRowEl) {
1458                core.uncompensateScroll(headRowEl);
1459            }
1460            dayGrid.removeSegPopover(); // kill the "more" popover if displayed
1461            // is the event limit a constant level number?
1462            if (eventLimit && typeof eventLimit === 'number') {
1463                dayGrid.limitRows(eventLimit); // limit the levels first so the height can redistribute after
1464            }
1465            // distribute the height to the rows
1466            // (viewHeight is a "recommended" value if isAuto)
1467            scrollerHeight = this.computeScrollerHeight(viewHeight);
1468            this.setGridHeight(scrollerHeight, isAuto);
1469            // is the event limit dynamically calculated?
1470            if (eventLimit && typeof eventLimit !== 'number') {
1471                dayGrid.limitRows(eventLimit); // limit the levels after the grid's row heights have been set
1472            }
1473            if (!isAuto) { // should we force dimensions of the scroll container?
1474                this.scroller.setHeight(scrollerHeight);
1475                scrollbarWidths = this.scroller.getScrollbarWidths();
1476                if (scrollbarWidths.left || scrollbarWidths.right) { // using scrollbars?
1477                    if (headRowEl) {
1478                        core.compensateScroll(headRowEl, scrollbarWidths);
1479                    }
1480                    // doing the scrollbar compensation might have created text overflow which created more height. redo
1481                    scrollerHeight = this.computeScrollerHeight(viewHeight);
1482                    this.scroller.setHeight(scrollerHeight);
1483                }
1484                // guarantees the same scrollbar widths
1485                this.scroller.lockOverflow(scrollbarWidths);
1486            }
1487        };
1488        // given a desired total height of the view, returns what the height of the scroller should be
1489        AbstractDayGridView.prototype.computeScrollerHeight = function (viewHeight) {
1490            return viewHeight -
1491                core.subtractInnerElHeight(this.el, this.scroller.el); // everything that's NOT the scroller
1492        };
1493        // Sets the height of just the DayGrid component in this view
1494        AbstractDayGridView.prototype.setGridHeight = function (height, isAuto) {
1495            if (this.context.options.monthMode) {
1496                // if auto, make the height of each row the height that it would be if there were 6 weeks
1497                if (isAuto) {
1498                    height *= this.dayGrid.rowCnt / 6;
1499                }
1500                core.distributeHeight(this.dayGrid.rowEls, height, !isAuto); // if auto, don't compensate for height-hogging rows
1501            }
1502            else {
1503                if (isAuto) {
1504                    core.undistributeHeight(this.dayGrid.rowEls); // let the rows be their natural height with no expanding
1505                }
1506                else {
1507                    core.distributeHeight(this.dayGrid.rowEls, height, true); // true = compensate for height-hogging rows
1508                }
1509            }
1510        };
1511        /* Scroll
1512        ------------------------------------------------------------------------------------------------------------------*/
1513        AbstractDayGridView.prototype.computeDateScroll = function (duration) {
1514            return { top: 0 };
1515        };
1516        AbstractDayGridView.prototype.queryDateScroll = function () {
1517            return { top: this.scroller.getScrollTop() };
1518        };
1519        AbstractDayGridView.prototype.applyDateScroll = function (scroll) {
1520            if (scroll.top !== undefined) {
1521                this.scroller.setScrollTop(scroll.top);
1522            }
1523        };
1524        return AbstractDayGridView;
1525    }(core.View));
1526    AbstractDayGridView.prototype.dateProfileGeneratorClass = DayGridDateProfileGenerator;
1527
1528    var SimpleDayGrid = /** @class */ (function (_super) {
1529        __extends(SimpleDayGrid, _super);
1530        function SimpleDayGrid(dayGrid) {
1531            var _this = _super.call(this, dayGrid.el) || this;
1532            _this.slicer = new DayGridSlicer();
1533            _this.dayGrid = dayGrid;
1534            return _this;
1535        }
1536        SimpleDayGrid.prototype.firstContext = function (context) {
1537            context.calendar.registerInteractiveComponent(this, { el: this.dayGrid.el });
1538        };
1539        SimpleDayGrid.prototype.destroy = function () {
1540            _super.prototype.destroy.call(this);
1541            this.context.calendar.unregisterInteractiveComponent(this);
1542        };
1543        SimpleDayGrid.prototype.render = function (props, context) {
1544            var dayGrid = this.dayGrid;
1545            var dateProfile = props.dateProfile, dayTable = props.dayTable;
1546            dayGrid.receiveProps(__assign({}, this.slicer.sliceProps(props, dateProfile, props.nextDayThreshold, context.calendar, dayGrid, dayTable), { dateProfile: dateProfile, cells: dayTable.cells, isRigid: props.isRigid }), context);
1547        };
1548        SimpleDayGrid.prototype.buildPositionCaches = function () {
1549            this.dayGrid.buildPositionCaches();
1550        };
1551        SimpleDayGrid.prototype.queryHit = function (positionLeft, positionTop) {
1552            var rawHit = this.dayGrid.positionToHit(positionLeft, positionTop);
1553            if (rawHit) {
1554                return {
1555                    component: this.dayGrid,
1556                    dateSpan: rawHit.dateSpan,
1557                    dayEl: rawHit.dayEl,
1558                    rect: {
1559                        left: rawHit.relativeRect.left,
1560                        right: rawHit.relativeRect.right,
1561                        top: rawHit.relativeRect.top,
1562                        bottom: rawHit.relativeRect.bottom
1563                    },
1564                    layer: 0
1565                };
1566            }
1567        };
1568        return SimpleDayGrid;
1569    }(core.DateComponent));
1570    var DayGridSlicer = /** @class */ (function (_super) {
1571        __extends(DayGridSlicer, _super);
1572        function DayGridSlicer() {
1573            return _super !== null && _super.apply(this, arguments) || this;
1574        }
1575        DayGridSlicer.prototype.sliceRange = function (dateRange, dayTable) {
1576            return dayTable.sliceRange(dateRange);
1577        };
1578        return DayGridSlicer;
1579    }(core.Slicer));
1580
1581    var DayGridView = /** @class */ (function (_super) {
1582        __extends(DayGridView, _super);
1583        function DayGridView() {
1584            var _this = _super !== null && _super.apply(this, arguments) || this;
1585            _this.buildDayTable = core.memoize(buildDayTable);
1586            return _this;
1587        }
1588        DayGridView.prototype.render = function (props, context) {
1589            _super.prototype.render.call(this, props, context); // will call _renderSkeleton/_unrenderSkeleton
1590            var dateProfile = this.props.dateProfile;
1591            var dayTable = this.dayTable =
1592                this.buildDayTable(dateProfile, props.dateProfileGenerator);
1593            if (this.header) {
1594                this.header.receiveProps({
1595                    dateProfile: dateProfile,
1596                    dates: dayTable.headerDates,
1597                    datesRepDistinctDays: dayTable.rowCnt === 1,
1598                    renderIntroHtml: this.renderHeadIntroHtml
1599                }, context);
1600            }
1601            this.simpleDayGrid.receiveProps({
1602                dateProfile: dateProfile,
1603                dayTable: dayTable,
1604                businessHours: props.businessHours,
1605                dateSelection: props.dateSelection,
1606                eventStore: props.eventStore,
1607                eventUiBases: props.eventUiBases,
1608                eventSelection: props.eventSelection,
1609                eventDrag: props.eventDrag,
1610                eventResize: props.eventResize,
1611                isRigid: this.hasRigidRows(),
1612                nextDayThreshold: this.context.nextDayThreshold
1613            }, context);
1614        };
1615        DayGridView.prototype._renderSkeleton = function (context) {
1616            _super.prototype._renderSkeleton.call(this, context);
1617            if (context.options.columnHeader) {
1618                this.header = new core.DayHeader(this.el.querySelector('.fc-head-container'));
1619            }
1620            this.simpleDayGrid = new SimpleDayGrid(this.dayGrid);
1621        };
1622        DayGridView.prototype._unrenderSkeleton = function () {
1623            _super.prototype._unrenderSkeleton.call(this);
1624            if (this.header) {
1625                this.header.destroy();
1626            }
1627            this.simpleDayGrid.destroy();
1628        };
1629        return DayGridView;
1630    }(AbstractDayGridView));
1631    function buildDayTable(dateProfile, dateProfileGenerator) {
1632        var daySeries = new core.DaySeries(dateProfile.renderRange, dateProfileGenerator);
1633        return new core.DayTable(daySeries, /year|month|week/.test(dateProfile.currentRangeUnit));
1634    }
1635
1636    var main = core.createPlugin({
1637        defaultView: 'dayGridMonth',
1638        views: {
1639            dayGrid: DayGridView,
1640            dayGridDay: {
1641                type: 'dayGrid',
1642                duration: { days: 1 }
1643            },
1644            dayGridWeek: {
1645                type: 'dayGrid',
1646                duration: { weeks: 1 }
1647            },
1648            dayGridMonth: {
1649                type: 'dayGrid',
1650                duration: { months: 1 },
1651                monthMode: true,
1652                fixedWeekCount: true
1653            }
1654        }
1655    });
1656
1657    exports.AbstractDayGridView = AbstractDayGridView;
1658    exports.DayBgRow = DayBgRow;
1659    exports.DayGrid = DayGrid;
1660    exports.DayGridSlicer = DayGridSlicer;
1661    exports.DayGridView = DayGridView;
1662    exports.SimpleDayGrid = SimpleDayGrid;
1663    exports.buildBasicDayTable = buildDayTable;
1664    exports.default = main;
1665
1666    Object.defineProperty(exports, '__esModule', { value: true });
1667
1668}));

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.