;(function($,_,undefined){"use strict";ips.controller.register('calendar.front.venue.main',{_ajaxObj:null,initialize:function(){this.on('click','[data-action="changeView"]',this.changeView);this.on(window,'historychange:venueView',this.stateChange);this.setup();},setup:function(){ips.utils.history.pushState({controller:'venueView'},'venueView',window.location.href);},changeView:function(e){e.preventDefault();ips.utils.history.pushState({controller:'venueView'},'venueView',$(e.currentTarget).attr('href'));document.title=$(e.currentTarget).attr('title');},stateChange:function(){const data=ips.utils.history.getState('venueView')||{},url=window.location.href
if(data.controller!=='venueView'){return;}
ips.utils.analytics.trackPageView(url);this._updateView(url)},_updateView:function(url){if(this._ajaxObj&&_.isFunction(this._ajaxObj.abort)){this._ajaxObj.abort();}
this._setLoading(true);this._ajaxObj=ips.getAjax()(url,{showLoading:true}).done(response=>{console.log(response);this.scope.html(response);$(document).trigger('contentChange',[self.scope]);}).always(()=>{this._setLoading(false);});},_setLoading:function(state){if(state){this.scope.animate({opacity:"0.6"},'fast');}else{this.scope.animate({opacity:"1"},'fast');}}});}(jQuery,_));;