tribe.events=tribe.events||{},tribe.events.views=tribe.events.views||{},tribe.events.views.weekDaySelector={},function(e,t){"use strict";var n=e(document);t.selectors={daySelectorDay:'[data-js="tribe-events-pro-week-day-selector-day"]',daySelectorDayActiveClass:".tribe-events-pro-week-day-selector__day--active",mobileEventsDayActiveClass:".tribe-events-pro-week-mobile-events__day--active"},t.setOpenTabA11yAttrs=function(e,t){e.attr("aria-selected","true"),t.attr("aria-hidden","false")},t.setCloseTabA11yAttrs=function(e,t){e.attr("aria-selected","false"),t.attr("aria-hidden","true")},t.getEventCountLabel=function(e){return window.wp.i18n?0===e?window.wp.i18n.__("No events","tribe-events-calendar-pro"):window.wp.i18n.sprintf(/* translators: %d is the number of events on this day */
window.wp.i18n._n("%d event","%d events",e,"tribe-events-calendar-pro"),e):0===e?"No events":1===e?"1 event":e+" events"},t.openDay=function(e,n){if(e.attr("aria-controls")){t.setOpenTabA11yAttrs(e,n),n.css("display","block");var a=n.find(".tribe-events-pro-week-mobile-events__event").length,s=t.getEventCountLabel(a);n.attr("tabindex")||n.attr("tabindex","-1"),n.attr("aria-label",s),setTimeout((function(){n.focus()}),0)}e.addClass(t.selectors.daySelectorDayActiveClass.className()),n.addClass(t.selectors.mobileEventsDayActiveClass.className())},t.closeDay=function(e,n){e.attr("aria-controls")&&(t.setCloseTabA11yAttrs(e,n),n.css("display","")),e.removeClass(t.selectors.daySelectorDayActiveClass.className()),n.removeClass(t.selectors.mobileEventsDayActiveClass.className())},t.closeAllDays=function(n){n.find(t.selectors.daySelectorDay).each((function(a,s){var i=e(s),r=i.attr("aria-controls"),o=e("");r&&(o=n.find("#"+r)),t.closeDay(i,o)}))},t.handleClick=function(n){var a=n.data.container,s=e(n.data.target),i=s.attr("aria-controls"),r=e("");i&&(r=a.find("#"+i)),t.closeAllDays(a),t.openDay(s,r)},t.deinitDaySelector=function(n){n.find(t.selectors.daySelector).find(t.selectors.daySelectorDay).each((function(n,a){e(a).off("click",t.handleClick)}))},t.initDaySelector=function(n){n.find(t.selectors.daySelectorDay).each((function(a,s){e(s).on("click",{target:s,container:n},t.handleClick)}))},t.deinit=function(e,n,a){var s=e.data.container;t.deinitDaySelector(s),s.off("beforeAjaxSuccess.tribeEvents",t.deinit)},t.init=function(e,n,a,s){"week"!==s.slug&&"widget-week"!==s.slug||(t.initDaySelector(a),a.on("beforeAjaxSuccess.tribeEvents",{container:a},t.deinit))},t.ready=function(){n.on("afterSetup.tribeEvents",tribe.events.views.manager.selectors.container,t.init)},e(t.ready)}(jQuery,tribe.events.views.weekDaySelector),window.tec=window.tec||{},window.tec.eventsPro=window.tec.eventsPro||{},window.tec.eventsPro.views=window.tec.eventsPro.views||{},window.tec.eventsPro.views.weekDaySelector={};