;(function($,_,undefined){"use strict";ips.controller.register('downloads.front.view.changeLog',{initialize:function(){this.on('menuItemSelected',this.changeVersion);this.setup();this.on(window,'historychange:downloads.front.view.changeLog',this.stateChange);},setup:function(){ips.utils.history.replaceState({controller:'changelog'},'downloads.front.view.changeLog',window.location.href);},changeVersion:function(e,data){data.originalEvent.preventDefault();var url=data.menuElem.find('[data-ipsMenuValue="'+data.selectedItemID+'"] > a').attr('href');ips.utils.history.pushState({controller:'changelog',version:data.selectedItemID},'downloads.front.view.changeLog',url);this._loadVersion(url,data.menuElem.find('[data-ipsMenuValue="'+data.selectedItemID+'"]').attr('data-changelogTitle'));},stateChange:function(){const state=ips.utils.history.getState('downloads.front.view.changeLog')
if(!state||!Object.keys(state).length){return;}
let item;if(state.version){item=$('#elChangelog_menu').find('[data-ipsMenuValue="'+state.version+'"]');}else{item=$('#elChangelog_menu').find('[data-ipsMenuValue]').first();}
this._loadVersion(item.find('a').attr('href'),item.attr('data-ipsMenuValue'));},_loadVersion:function(url,versionTitle){var self=this;this.scope.find('[data-role="versionTitle"]').text(versionTitle);this.scope.find('[data-role="changeLogData"]').css({height:this.scope.find('[data-role="changeLogData"]').height()+'px'}).addClass('ipsLoading').html('');ips.getAjax()(url).done(function(response){self.scope.find('[data-role="changeLogData"]').html(response).removeClass('ipsLoading').css({height:'auto'});ips.utils.lazyLoad.loadContent(self.scope.find('[data-role="changeLogData"]'));}).fail(function(jqXHR,textStatus,errorThrown){window.location=url;});}});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('downloads.front.view.download',{initialize:function(){this.on('click','[data-action="dialogClose"]',this.closeDialog);this.on('click','[data-action="selectFile"]',this.selectFile);this.on('click','[data-action="download"]',this.doDownload);},selectFile:function(e){var url=$(e.currentTarget).attr('href');var self=this;e.preventDefault();this.scope.html('').css({height:'250px'}).addClass('ipsLoading');ips.getAjax()(url).done(function(response){self.scope.html(response).css({height:'auto'}).removeClass('ipsLoading');}).fail(function(jqXHR,textStatus,errorThrown){window.location=url;});},closeDialog:function(e){e.preventDefault();this._closeDialog($(e.currentTarget).attr('href'));},_closeDialog:function(href){if(this.scope.closest('.ipsDialog').length){this.scope.closest('.ipsDialog').trigger('closeDialog');}else{window.location=href;}},doDownload:function(e){var that=this;if($(e.currentTarget).attr('data-wait')){e.preventDefault();ips.getAjax()($(e.currentTarget).attr('href')).done(function(response){$(e.currentTarget).trigger('ipsDataLayerSync');var secondsRemaining=response.download-response.currentTime;$(e.currentTarget).hide().siblings().find('[data-role="downloadCounter"]').html(secondsRemaining).end().end().siblings('[data-role="downloadCounterContainer"]').removeClass('ipsHide');var interval=setInterval(function(){secondsRemaining--;$(e.currentTarget).siblings().find('[data-role="downloadCounter"]').html(secondsRemaining);if(secondsRemaining===0){clearInterval(interval);window.location=$(e.currentTarget).attr('href');that.scope.closest('.ipsDialog').trigger('closeDialog');}},1000);}).fail(function(){window.location=$(e.currentTarget).attr('href');})}
else
{this.scope.closest('.ipsDialog').trigger('closeDialog');}}});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('downloads.front.view.subscribe',{ajaxObj:null,initialize:function(){this.on('click','[data-action="subscribe"]',this.toggle);},toggle:function(e){e.preventDefault();var self=this;var clicked=$(e.currentTarget);clicked.addClass('ipsFaded ipsFaded_more');ips.getAjax()(clicked.attr('href')).done(function(response){if(!response.error){if(response=='unsubscribed'){clicked.removeClass('ipsButton_primary');clicked.addClass('ipsButton_link');clicked.text(ips.getString('file_subscribe'));}
else
{clicked.addClass('ipsButton_primary');clicked.removeClass('ipsButton_link');clicked.text(ips.getString('file_unsubscribe'));}}}).always(function(){clicked.removeClass('ipsFaded ipsFaded_more');});}});}(jQuery,_));;