PageSourceSearch

https://chicagothemusical.com/wp-content/plugins/limelight-calendar/public/app.js?ver=1790260192

js chicagothemusical.com collected 2026-09-24 19:00:08 UTC 25,836 bytes, 659 lines download raw bytes

1(function () {
2    'use strict';
3
4    const daysOfTheWeek = type => {
5      let days;
6      switch (type) {
7        case 'ddd':
8          days = ['S<span>un</span>', 'M<span>on</span>', 'T<span>ue</span>', 'W<span>ed</span>', 'T<span>hu</span>', 'F<span>ri</span>', 'S<span>at</span>'];
9          break;
10        case 'dd':
11          days = ['Su', 'M', 'Tu', 'W', 'Th', 'F', 'Sa'];
12          break;
13        case 'd':
14          days = ['S', 'M', 'T', 'W', 'T', 'F', 'S'];
15          break;
16        default:
17          days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
18          break;
19      }
20      return days;
21    };
22
23    const months = type => {
24      let months;
25      switch (type) {
26        case 'mmm':
27          months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
28          break;
29        case 'm':
30          months = ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'];
31          break;
32        default:
33          months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
34          break;
35      }
36      return months;
37    };
38
39    const renderFormattedDate = (theDate, dateFormat) => {
40      let j = theDate.getDate();
41      let m = theDate.getMonth() + 1; // because January is 0 in the array
42
43      let formattedDate = "";
44      switch (dateFormat) {
45        case "month_day":
46          var monthnames = months('mmm');
47          formattedDate = monthnames[m] + " " + j;
48          break;
49        case "month_day_dash":
50          formattedDate = m + "/" + j;
51          break;
52        case "month_day_dot":
53          formattedDate = m + "." + j;
54          break;
55        default:
56          // case "day"
57          formattedDate = j;
58          break;
59      }
60      return formattedDate;
61    };
62    const renderFormattedMonth = theDate => {
63      let formatMonthName = limelight.data.monthname_date_format;
64      const monthNumber = parseInt(theDate.split('-')[1]); // -1 to coincide with month array
65
66      let formatDate = "";
67      switch (formatMonthName) {
68        case "month_full":
69          formatDate = `${months()[monthNumber - 1]}`;
70          break;
71        case "month_full_year":
72          formatDate = `${months()[monthNumber - 1]} ${theDate.split('-')[0]}`;
73          break;
74        case "mon_year":
75          formatDate = `${months('mmm')[monthNumber - 1]} ${theDate.split('-')[0]}`;
76          break;
77        default:
78          // case "mon"
79          formatDate = `${months('mmm')[monthNumber - 1]}`;
80          break;
81      }
82      return formatDate;
83    };
84
85    /*
86     * Generate the label slug, so everyone thinks it is the same.
87     * @author Aaron Hodge Silver
88     */
89    const generateLabelSlug = label => {
90      var stringtouse;
91      if (label.label_slug) {
92        stringtouse = label.label_slug;
93      } else if (label.label_title) {
94        stringtouse = label.label_title;
95      } else {
96        stringtouse = label;
97      }
98      stringtouse = stringtouse.replace(/[^a-zA-Z0-9\s-]/g, '');
99      return stringtouse.toLowerCase().replace(/\s+/g, '-');
100    };
101
102    /*
103     * Decide which label-related classes belong on this performance.
104     * @author Aaron Hodge Silver
105     */
106    const generateLabelClass = perf => {
107      let labelclass = '';
108      let remaining = String(perf.remaining_tickets || '');
109
110      // assigning labels based on remaining ticket numbers
111      if (limelight.data.ticket_based_labels.length > 0 && remaining.length > 0) {
112        // Sort a copy (not the original) by max_tickets_remaining (smallest first)
113        let sortedLabels = [...limelight.data.ticket_based_labels].sort((a, b) => parseInt(a.max_tickets_remaining) - parseInt(b.max_tickets_remaining));
114
115        // Find the first item with max_tickets_remaining greater than remaining_tickets
116        let selectedLabel = sortedLabels.find(item => parseInt(item.max_tickets_remaining) > parseInt(remaining));
117        if (selectedLabel) {
118          labelclass += ' event-time--' + generateLabelSlug(selectedLabel);
119        }
120      }
121      // manual label is applied alongside ticket-based (not as fallback)
122      if (perf.label && String(perf.label).length > 0) {
123        labelclass += ' event-time--' + generateLabelSlug(perf.label);
124      }
125      return labelclass;
126    };
127
128    /*
129     * After the calendar has rendered, remove some labels from the legend.
130     * Remove those that should only show if there's at least one matching performance, if there aren't any.
131     * @author Aaron Hodge Silver
132     */
133    const removeLabels = () => {
134      let matchFilters = [];
135      limelight.data.labels.filter(item => {
136        if (item.display_legend == "match") {
137          matchFilters.push(item);
138          return;
139        }
140        return;
141      });
142      matchFilters.forEach(label => {
143        var slug = generateLabelSlug(label);
144        var any_of_these = document.querySelector(".event-time--" + slug);
145        if (!any_of_these) {
146          var labelsToRemove = document.querySelectorAll(".calendar__legend-each-" + slug);
147          labelsToRemove.forEach(element => element.remove());
148        }
149      });
150    };
151
152    const dateIsDark = (thisDate, allShowPerformances) => {
153      let d = thisDate.getDate();
154      let m = thisDate.getMonth() + 1;
155      let y = thisDate.getFullYear();
156      let formattedMonth = m > 9 ? m : '0' + m;
157      let formattedDay = d > 9 ? d : '0' + d;
158      let performanceOperator = y + '-' + formattedMonth + '-' + formattedDay;
159      var dayIsDark = true;
160      allShowPerformances.filter(showPerformance => {
161        if (showPerformance.date === performanceOperator) {
162          dayIsDark = false;
163        }
164      });
165      return dayIsDark;
166    };
167    const renderPerformanceLink = (thisPerformance, allShowPerformances) => {
168      let performanceLink = '';
169      let selectedPerformances = [];
170      let d = thisPerformance.getDate();
171      let m = thisPerformance.getMonth() + 1;
172      let y = thisPerformance.getFullYear();
173      let formattedMonth = m > 9 ? m : '0' + m;
174      let formattedDay = d > 9 ? d : '0' + d;
175      let performanceOperator = y + '-' + formattedMonth + '-' + formattedDay;
176      allShowPerformances.filter(showPerformance => {
177        if (showPerformance.date === performanceOperator) {
178          selectedPerformances.push(showPerformance);
179        }
180      });
181      if (selectedPerformances && selectedPerformances.length > 0) {
182        const sorter = (a, b) => {
183          let first = a.time.split(':')[0];
184          let last = b.time.split(':')[0];
185          return first - last;
186        };
187        selectedPerformances.sort(sorter);
188        for (let index = 0; index < selectedPerformances.length; index++) {
189          const perf = selectedPerformances[index];
190          if (perf.time && perf.url) {
191            var match = perf.time.match(/^(\d+):(\d{2})([ap]m)$/i);
192
193            // Extracting components
194            let perfHour = match[1];
195            let perfMins = match[2];
196            let perfAMPM = match[3];
197
198            // Appointed Classes
199            let performanceClasses = 'event-time';
200            performanceClasses += ' event-time--' + perf.date;
201            performanceClasses += generateLabelClass(perf);
202            performanceLink += `
203					<a class="${performanceClasses}" href="${perf.url}" target="_blank">
204						${`<span class="eth">${perfHour}</span>` + `<span class="etm${perfMins !== '00' ? ' not00' : ''}">:${perfMins}</span>` + `<span class="etampm">${perfAMPM}</span>`}
205					</a>
206				`;
207          }
208        }
209      }
210      return performanceLink;
211    };
212
213    /*
214     * Create the HTML for the legend, with color-coded boxes.
215     * @author Aaron Hodge Silver
216     */
217
218    const renderLegend = () => {
219      let calLegend = "";
220      let calStyle = "";
221      let legendLabels = [];
222
223      // Manually-managed labels first
224      if (limelight.data.labels) {
225        limelight.data.labels.filter(item => {
226          if (item.display_legend != "never") {
227            legendLabels.push(item);
228            return;
229          }
230          return;
231        });
232      }
233      // Ticket Amount-based labels second (so their CSS colors take precedence)
234      if (limelight.data.ticket_based_labels) {
235        limelight.data.ticket_based_labels.filter(item => {
236          legendLabels.push(item);
237          return;
238        });
239      }
240      if (legendLabels.length > 0) {
241        calLegend += '<section class="calendar__legend" aria-label="Labels legend">';
242        calStyle += '<style type="text/css">';
243        legendLabels.forEach(label => {
244          var hex = label.label_color.toLowerCase().slice(1);
245          var slug = generateLabelSlug(label);
246          calLegend += '<div class="calendar__legend-each calendar__legend-each-' + slug + '">';
247          calLegend += '<div class="calendar__legend-color calendar__legend-color--' + slug + '"></div>';
248          calLegend += '<div class="calendar__legend-text"><div id="best-available-box">' + label.label_title + "</div></div>";
249          calLegend += "</div>";
250          calStyle += ".rpm-calendar .calendar__legend-color--" + slug + "::before { background-color: #" + hex + "; }";
251          if (label.max_tickets_remaining) {
252            calStyle += "a.event-time.event-time--" + slug + " { color: #" + hex + "; border: 2px solid #" + hex + "; border-radius: 4px; padding: 2px 8px; }";
253          } else {
254            calStyle += "a.event-time.event-time--" + slug + " { color: #" + hex + "; }";
255          }
256        });
257        calLegend += "</section>";
258        calStyle += "</style>";
259      }
260      return calLegend + calStyle;
261    };
262
263    const renderWeekly = calendar => {
264      let performances = limelight.performances;
265      let calText = '';
266      let weeklyNumberDays = limelight.data.weekly_shown_days ?? 7;
267      let todayDate = new Date();
268      let startCustom = false;
269      let weekday = daysOfTheWeek('ddd');
270
271      // If user selects start date && before today
272      let commence = todayDate <= startCustom ? startCustom : todayDate;
273      let thisDay = new Date(commence);
274
275      // Display the legend
276      if (calendar.dataset.layout == 'legend_top') {
277        calText += `<div class="calendar__header calendar__header--weekly">${renderLegend()}</div>`;
278      }
279
280      // Generates weekday names
281      calText += '<div class="calendar__grid-container">';
282      calText += '<div class="days">';
283      for (let i = thisDay.getDay(); i < thisDay.getDay() + 7; i++) {
284        let the_day = i;
285        if (the_day > 6) {
286          the_day = the_day - 7;
287        }
288        calText += '<div class="day">' + weekday[the_day] + '</div>';
289      }
290      calText += '</div>';
291
292      // Generates Day
293      calText += '<div class="calendar__grid">';
294      for (let j = 0; j < weeklyNumberDays; j++) {
295        const newDate = new Date(thisDay);
296        let thisRenderedDate = new Date(newDate.setDate(newDate.getDate() + j));
297        calText += `<div class="day-box day-box--perf">
298				<div class="day-box-inner">
299					<div class="box-date">
300						<time>
301							${renderFormattedDate(thisRenderedDate, limelight.data.weekly_date_format)}
302						</time>
303					</div>
304					<div class="performance-holder">
305						${renderPerformanceLink(thisRenderedDate, performances)}
306					</div>
307				</div>
308            </div>`;
309      }
310      calText += '</div</div>'; // end .grid and end .grid-container
311
312      // Display the legend
313      if (calendar.dataset.layout == 'legend_bottom') {
314        calText += `<div class="calendar__footer calendar__footer--weekly">${renderLegend()}</div>`;
315      }
316      calendar.innerHTML += calText;
317      calText = '';
318    };
319
320    const monthlyDates = (month, performances, today) => {
321      let yyyy = month.split('-')[0];
322      let mm = month.split('-')[1];
323      const daysInMonth = (year, month) => new Date(year, month, 0).getDate();
324      let daysThisMonth = daysInMonth(yyyy, mm);
325      let dayBlocks = '';
326
327      // Loop to render blocks
328      for (let index = 0; index < daysThisMonth; index++) {
329        const numberedDay = index + 1;
330        const fullPerformanceDate = yyyy + '-' + mm + '-' + (numberedDay > 9 ? numberedDay : '0' + numberedDay);
331        let tempDate = new Date(Date.UTC(yyyy, mm - 1, numberedDay));
332        const thisRenderedDate = new Date(tempDate.getTime() + tempDate.getTimezoneOffset() * 60000); // this is how we correct for the time zone problem April 1, 2024
333        thisRenderedDate.setHours(23);
334        thisRenderedDate.setMinutes(59);
335        thisRenderedDate.setSeconds(59);
336
337        // add classes
338        var dayboxclasses = 'day-box';
339        if (thisRenderedDate < today) {
340          dayboxclasses += ' day-box-past';
341        } else if (dateIsDark(thisRenderedDate, performances)) {
342          dayboxclasses += ' day-box-dark';
343        }
344        dayBlocks += `<div class="` + dayboxclasses + `" data-performance-date="${fullPerformanceDate}"><div class="day-box-inner">`;
345        dayBlocks += `<div class="box-date">${renderFormattedDate(thisRenderedDate, limelight.data.monthly_date_format)}</div>`;
346        if (thisRenderedDate >= today) {
347          dayBlocks += `<div class="performance-holder">${renderPerformanceLink(thisRenderedDate, performances)}</div>`;
348        } else {
349          dayBlocks += `<div class="performance-holder performance-holder--empty"></div>`;
350        }
351        dayBlocks += `</div></div>`;
352      }
353      return dayBlocks;
354    };
355
356    const offsetDays = (month, direction = 'before') => {
357      if (direction === 'before') {
358        let offset = new Date(month.split('-')[0], parseInt(month.split('-')[1] - 1), 1).getDay();
359        let before = ''; // setup blank days before first day of month
360        for (var f = 0; f < offset; f++) {
361          before += `<div class="day-box offset"><div class="day-box-inner"></div></div>`;
362        }
363        return before;
364      }
365      if (direction === 'after') {
366        let totalDays = new Date(month.split('-')[0], parseInt(month.split('-')[1]), 1).getDate();
367        let offset = new Date(month.split('-')[0], parseInt(month.split('-')[1]), totalDays).getDay();
368        let after = ''; // setup blank days after last day of month
369        for (var t = offset; t > 0 && t < 7; t++) {
370          after += `<div class="day-box offset"><div class="day-box-inner"></div></div>`;
371        }
372        return after;
373      }
374    };
375
376    const tapAction = window.ontouchstart === null ? 'touchstart' : 'click';
377    const doNavigation = (cal, vp) => {
378      let calendar_months = cal.querySelectorAll('.calendar__month');
379      let viewDesktop = 2; // Amount of cal per view on desktop
380      let viewMobile = 1; // Amount of cal per view on mobile
381      let currentView = viewMobile;
382
383      // Add Class for 1 month view
384      cal.classList.add('calendar--1m');
385      if (vp && window.innerWidth > vp) {
386        currentView = viewDesktop;
387        cal.classList.remove('calendar--1m');
388      }
389      if (calendar_months && calendar_months.length > currentView) {
390        for (let index = 0; index < calendar_months.length; index++) {
391          const calendar_month = calendar_months[index];
392          const prev_month = index - 1;
393          const next_month = index + 1;
394          let isFirst = prev_month <= -1;
395          let isLast = next_month === calendar_months.length;
396          let prevButton = calendar_month.querySelector('.calendar__nav--prev');
397          let nextButton = calendar_month.querySelector('.calendar__nav--next');
398          prevButton.disabled = false;
399          nextButton.disabled = false;
400          isFirst ? prevButton.disabled = true : null;
401          isLast ? nextButton.disabled = true : null;
402          prevButton.addEventListener(tapAction, () => {
403            // Resets and remove all active classes
404            calendar_months.forEach(cm => {
405              cm.classList.remove('calendar__month--active');
406            });
407
408            // Adds active classes
409            calendar_months[prev_month].classList.add('calendar__month--active');
410            if (currentView > 1) {
411              calendar_months[prev_month + 1].classList.add('calendar__month--active');
412            }
413            cleanup_first_second();
414          });
415          nextButton.addEventListener(tapAction, () => {
416            // Resets and remove all active classes
417            calendar_months.forEach(cm => {
418              cm.classList.remove('calendar__month--active');
419            });
420            if (calendar_months[next_month]) {
421              calendar_months[next_month].classList.add('calendar__month--active');
422            }
423            if (currentView > 1) {
424              calendar_months[next_month - 1].classList.add('calendar__month--active');
425            }
426            cleanup_first_second();
427          });
428        }
429      }
430    };
431    const cleanup_first_second = () => {
432      // remove all first/second
433      $('.calendar--twomonth .calendar__month').removeClass('first').removeClass('second');
434      // identify first and second
435      $('.calendar--twomonth .calendar__month--active:first').addClass('first');
436      $('.calendar--twomonth .calendar__month--active:eq(1)').addClass('second');
437    };
438
439    const renderHeader = (month, calendar) => {
440      let headHTML = ``;
441      headHTML += `<div class="calendar__header">`;
442      headHTML += `	<nav class="calendar__nav-container">`;
443      headHTML += `		<button class="calendar__nav calendar__nav--prev"><span class="screen-reader-text">Previous</span><span class="arrow"></span></button>`;
444      headHTML += `		<h3>${renderFormattedMonth(month)}</h3>`;
445      headHTML += `		<button class="calendar__nav calendar__nav--next"><span class="screen-reader-text">Next</span><span class="arrow"></span></button>`;
446      headHTML += `	</nav>`;
447      // Display the legend
448      if (calendar.dataset.type !== 'twomonth' && calendar.dataset.layout == 'legend_top') {
449        headHTML += renderLegend();
450      }
451      headHTML += `</div>`;
452      return headHTML;
453    };
454    const renderFooter = calendar => {
455      let footHTML = ``;
456      // Display the legend
457      if (calendar.dataset.layout == 'legend_bottom') {
458        footHTML += `<div class="calendar__footer">`;
459        footHTML += renderLegend();
460        footHTML += `</div>`;
461      }
462      return footHTML;
463    };
464
465    let monthly_view_count$1 = 1,
466      monthlyHTML$1 = '',
467      dd_html$1 = '',
468      today$1 = new Date(),
469      joinPerformancesByYearMonth$1 = [];
470    const renderMonthly = calendar => {
471      let performances = limelight.performances;
472      // Loops all performances
473      for (let di = 0; di < performances.length; di++) {
474        const todayYear = today$1.getFullYear();
475        const todayMonthRaw = today$1.getMonth() + 1;
476        const todayMonth = todayMonthRaw > 9 ? todayMonthRaw : '0' + todayMonthRaw;
477        const todayOperator = todayYear + '-' + todayMonth;
478        let performanceYear = performances[di].date.split('-')[0];
479        let performanceMonth = performances[di].date.split('-')[1];
480        let performanceMonthYear = performanceYear + '-' + performanceMonth;
481        joinPerformancesByYearMonth$1.indexOf(performanceMonthYear) === -1 && todayOperator <= performanceMonthYear ? joinPerformancesByYearMonth$1.push(performanceMonthYear) : null;
482      }
483
484      // Reverse order of peformances by month
485      joinPerformancesByYearMonth$1.reverse();
486      daysOfTheWeek('ddd').forEach(d => {
487        if (d) {
488          dd_html$1 += `<div class="calendar__day">${d}</div>`;
489        }
490      });
491      calendar.innerHTML = '';
492
493      // Render Months
494      for (let index = 0;
494 index < joinPerformancesByYearMonth$1.length; index++) {
495        const monthcount = index + 1;
496        const month = joinPerformancesByYearMonth$1[index];
497        let isActive = monthcount > monthly_view_count$1 ? false : true;
498        // if a starting month has been specified, decide based on that
499        if (calendar.dataset.start_month) {
500          isActive = calendar.dataset.start_month == month ? true : false;
501        }
502        monthlyHTML$1 += `
503            <div class="calendar__month ${isActive ? 'calendar__month--active' : ''}">
504                ${renderHeader(month, calendar)}
505                <div class="calendar__grid-container">
506                    <div class="days">
507                      ${dd_html$1 ?? ''}
508                    </div>
509                    <div class="calendar__grid">
510                        ${offsetDays(month, 'before')}
511                        ${monthlyDates(month, performances, today$1)}
512                        ${offsetDays(month, 'after')}
513                    </div>
514                </div>
515                ${renderFooter(calendar)}
516            </div>`;
517      }
518      calendar.innerHTML = monthlyHTML$1;
519      doNavigation(calendar, null);
520    };
521
522    /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
523      let monthly_view_count,
524      viewBreakpoint = 768,
525      monthlyHTML = '',
526      dd_html = '',
527      today = new Date(),
528      joinPerformancesByYearMonth = [];
529    const renderTwoMonth = calendar => {
530      // mobile = 0; desktop = 1;
531      window.innerWidth > viewBreakpoint ? monthly_view_count = 1 : monthly_view_count = 0;
532      createTwoMonthCalender(calendar);
533
534      // Rerun on resize        
535      // window.addEventListener('resize', () => {
536      // 	if (!screenSizeInit) {
537      // 		window.innerWidth > viewBreakpoint ? monthly_view_count = 1 : monthly_view_count = 0;
538      // 	}
539      // });
540    };
541
542    const createTwoMonthCalender = calendar => {
543      let performances = limelight.performances;
544
545      /* ----------------------*/
546      /** SET UP PERFORMANCES **/
547
548      // Loop all perforamces
549      for (let di = 0; di < performances.length; di++) {
550        const todayYear = today.getFullYear();
551        const todayMonthRaw = today.getMonth() + 1;
552        const todayMonth = todayMonthRaw > 9 ? todayMonthRaw : '0' + todayMonthRaw;
553        const todayOperator = todayYear + '-' + todayMonth;
554        let performanceYear = performances[di].date.split('-')[0];
555        let performanceMonth = performances[di].date.split('-')[1];
556        let performanceMonthYear = performanceYear + '-' + performanceMonth;
557
558        // Calculates performances by month
559        joinPerformancesByYearMonth.indexOf(performanceMonthYear) === -1 && todayOperator <= performanceMonthYear ? joinPerformancesByYearMonth.push(performanceMonthYear) : null;
560      }
561
562      // Reverse order of peformances by month
563      joinPerformancesByYearMonth.reverse();
564
565      /* ----------------------------------*/
566      /** PREPARE HTML FOR ALL THE MONTHS **/
567
568      daysOfTheWeek('ddd').forEach(d => {
569        if (d) {
570          dd_html += `<div class="calendar__day">${d}</div>`;
571        }
572      });
573
574      // Render Month into a string
575      for (let index = 0; index < joinPerformancesByYearMonth.length; index++) {
576        const month = joinPerformancesByYearMonth[index];
577        let isActive;
578
579        // if a starting month has been specified, decide "active" based on that (this month plus next)
580        if (calendar.dataset.start_month) {
581          let [year, tempmonth] = month.split('-').map(Number);
582          if (tempmonth === 1) {
583            year -= 1;
584            tempmonth = 12;
585          } else {
586            tempmonth -= 1;
587          }
588          const prevMonth = year + '-' + tempmonth.toString().padStart(2, '0');
589
590          // is this the start month? OR was the previous month the start month (and we're in desktop width)?
591          if (calendar.dataset.start_month == month || window.innerWidth > viewBreakpoint && calendar.dataset.start_month == prevMonth) {
592            isActive = true;
593          } else {
594            isActive = false;
595          }
596        } else {
597          isActive = index > monthly_view_count ? false : true;
598        }
599        monthlyHTML += `
600            <div class="calendar__month ${isActive ? 'calendar__month--active' : ''}">
601                ${renderHeader(month, calendar)}
602                <div class="calendar__grid-container">
603                    <div class="days">
604                      ${dd_html ?? ''}
605                    </div>
606                    <div class="calendar__grid">
607                        ${offsetDays(month, 'before')}
608                        ${monthlyDates(month, performances, today)}
609                        ${offsetDays(month, 'after')}
610                    </div>
611                </div>
612            </div>`;
613      }
614
615      /* ----------------------*/
616      /** PUT ALL THE HTML TOGETHER **/
617
618      calendar.innerHTML = '';
619
620      // Lengend at the top?
621      if (calendar.dataset.layout == 'legend_top') {
622        calendar.innerHTML += renderLegend();
623      }
624      calendar.innerHTML += '<div class="months_container">' + monthlyHTML + '</div>';
625      calendar.innerHTML += renderFooter(calendar);
626      doNavigation(calendar, viewBreakpoint);
627      cleanup_first_second();
628    };
629
630    window.addEventListener("DOMContentLoaded", e => {
631      $ = jQuery.noConflict();
632      const calendars = document.querySelectorAll('.rpm-calendar .calendar');
633      if (calendars && calendars.length > 0) {
634        let performances = limelight.performances;
635        if (performances && performances.length) {
636          try {
637            calendars.forEach(calendar => {
638              switch (calendar.dataset.type) {
639                case 'weekly':
640                  renderWeekly(calendar);
641                  break;
642                case 'twomonth':
643                  renderTwoMonth(calendar);
644                  break;
645                default:
646                  renderMonthly(calendar);
647                  break;
648              }
649              removeLabels();
650            });
651          } catch (error) {
652            console.error(error);
653          }
654        }
655      }
656    });
657
658})();
659//# sourceMappingURL=app.js.map

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.