1/*! QiuAssets Tuesday, June 2nd, 2026, 3:43:55 PM */ 2 3"use strict";var modules=["qiu.constants","ngComboDatePicker","ui.select","ui.router","ap.fotorama","Tabs","Content","Store","Trivia","Weather","Fixture","Header","Forms","Forms2","Slideshow","LoadMore","Results","ACResults","Scope.safeApply","ngSanitize","angularMoment","angular.filter","toastr","formly","ui.bootstrap","dropzone","Main","base64","ngResource","Events","CustomTabs","angulartics","angulartics.google.tagmanager","pascalprecht.translate","iso.directives","satellizer","mightyDatepicker","tooltipster","com.2fdevs.videogular","com.2fdevs.videogular.plugins.controls","com.2fdevs.videogular.plugins.buffering","com.2fdevs.videogular.plugins.overlayplay","com.2fdevs.videogular.plugins.poster","com.2fdevs.videogular.plugins.hls","info.vietnamcode.nampnq.videogular.plugins.youtube","ngTagsInput","oc.lazyLoad","fayzaan.gRecaptcha.v3","ngImgCrop","pdfjsViewer","rzSlider","ngCookies","jshor.angular-addtocalendar","ja.qr","angularjs-crypto","ui.slider","ngEmbed","Media","MediaGalleries","Overlay","Templates","Custom","Custom2","Custom3","Mediahub"];var appModules=[];angular.forEach(modules,function(moduleName){try{angular.module(moduleName)}catch(e){angular.module(moduleName,[])}appModules.push(moduleName)});var App=angular.module("App",appModules).config(["$provide",function($provide){return $provide.decorator("$rootScope",["$delegate",function($delegate){$delegate.safeApply=function(fn){var phase=$delegate.$$phase;if(phase==="$apply"||phase==="$digest"){if(fn&&typeof fn==="function"){fn()}}else{$delegate.$apply(fn)}};return $delegate}])}]);App.value("system_language","en");App.value("require_authentication",false);App.value("not_authentication_redirect_url",false);App.value("idCheck",false);App.value("auth_url",false);App.value("auth_url_logged",false);App.value("no_auth_url",false);App.value("auth_api",false);App.value("googleClientId",false);App.value("facebookAppId",false);App.value("stripePublishableKey",false);App.value("auth_version",false);App.value("loginRedirectURL",false);App.value("logoutRedirect",false);App.value("cookiesBarV2",false);App.value("defaultTimezone",false);App.value("requestBaseUrl",false);App.value("preloadLinks",false);App.value("preloadLinksMessage",false);App.value("socialLoginInline",false);App.value("socialRedirect",false);App.value("ga4",false);App.value("pathSettings",false);App.value("customDisabled",false);App.value("noLoginOverlay",false);App.config(["$locationProvider","$authProvider",function($locationProvider,$authProvider){$authProvider.httpInterceptor=true;$authProvider.withCredentials=true;$authProvider.authHeader="Authorization";$authProvider.authToken="Bearer";$authProvider.storageType="cookies";if(window.history&&window.history.pushState){$locationProvider.html5Mode({enabled:true,requireBase:false,rewriteLinks:false})}}]).config(["$compileProvider",function($compileProvider){$compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|ftp|file|tel|mailto|magazine|javascript):/)}]).config(["$httpProvider","COMMON",function($httpProvider,COMMON){if(!angular.isUndefined(COMMON.URL_API)){$httpProvider.defaults.useXDomain=true;delete $httpProvider.defaults.headers.common["X-Requested-With"]}if(!angular.isUndefined(COMMON.BASE_URL)){$httpProvider.interceptors.push(function($q){return{request:function(config){if(!angular.isUndefined(COMMON.URL_API)&&config.url.substring(0,4)=="http"){}else{config.url=COMMON.BASE_URL+config.url}return config||$q.when(config)}}})}}]).run(function($rootScope,$sce,amMoment,system_language,defaultTimezone,COMMON,$compile,$timeout,CommonFactory){$rootScope.jsonData=[];$rootScope.modalOpened="";amMoment.changeLocale(system_language.substr(0,2));if(defaultTimezone){amMoment.changeTimezone(defaultTimezone)}else if(COMMON.DEFAULT_TIMEZONE){amMoment.changeTimezone(COMMON.DEFAULT_TIMEZONE)}$rootScope.trustedHtml=function(plainText){return $sce.trustAsHtml(plainText)};$rootScope.setModalData=function(data){$rootScope.modalData=data};$rootScope.overlay=document.querySelector(".md-overlay");$rootScope.openModal=function(modalName,modalClass,modalMessage,modalEmit,modalButtons,modalBody,cleanBody){var modal=document.querySelector("#"+modalName);if(!modal){modalName="modal-general";
3modal=document.querySelector("#modal-general")}var closeEl=document.querySelector(".md-show");if(closeEl){classie.remove(document.querySelector(".md-show"),"md-show")}function removeModalHandler(){angular.element("body").removeClass("md-overlay-opened");classie.remove(modal,"md-show");$timeout(function(){$rootScope.modalOpened=""});angular.element(document.querySelector("#"+modalName+" .md-close")).unbind("click");if(modalEmit){$rootScope.$emit("site:modal-close-"+modalEmit)}}classie.add(modal,"md-show");angular.element("body").addClass("md-overlay-opened");$rootScope.modalOpened=modalName;$rootScope.overlay.removeEventListener("click",removeModalHandler);$rootScope.overlay.addEventListener("click",removeModalHandler);classie.remove(modal,"message-ok");classie.remove(modal,"message-error");if(modalClass==1){classie.add(modal,"message-ok")}else if(modalClass==2){classie.add(modal,"message-error")}if(modalMessage){angular.element(document.querySelector("#"+modalName+" .md-header-title")).html(modalMessage)}if(modalBody){angular.element(document.querySelector("#"+modalName+" .md-body")).html(modalBody);$compile(angular.element(document.querySelector("#"+modalName+" .md-body")))($rootScope)}else if(cleanBody){angular.element(document.querySelector("#"+modalName+" .md-body")).html("")}if(modalButtons){angular.element(document.querySelector("#"+modalName+" .modal-btn1")).unbind("click");angular.element(document.querySelector("#"+modalName+" .modal-btn2")).unbind("click");angular.element(document.querySelector("#"+modalName+" .modal-btn1")).bind("click",function(e){$rootScope.$emit("site:modal-btn1-"+modalButtons)});angular.element(document.querySelector("#"+modalName+" .modal-btn2")).bind("click",function(e){$rootScope.$emit("site:modal-btn2-"+modalButtons)})}var closeButton=angular.element(document.querySelector("#"+modalName+" .md-close")).bind("click",function(e){removeModalHandler()});$rootScope.gaEvent("event","openModal",{modal:modalName})};$rootScope.closeModal=function(modalName){var modalEl=document.querySelector("#"+modalName);classie.remove(modalEl,"md-show");angular.element("body").removeClass("md-overlay-opened");$timeout(function(){$rootScope.modalOpened=""})};$rootScope.openModalClass=function(modalName,modalClass,modalMessage,modalEmit,modalButtons,modalBody,cleanBody){$rootScope.openModal(modalName,modalClass,modalMessage,modalEmit,modalButtons,modalBody,cleanBody)};$rootScope.checkIsMobile=function(){return CommonFactory.isMobile()}});App.config(function($translateProvider){$translateProvider.useSanitizeValueStrategy(null);$translateProvider.translations("en",{LANG_EN:"english",LANG_ES:"spanish",PASSWORDS_DONT_MATCH:"Passwords do not match.",PASSWORD_STRENGTH_ERROR:"Password too weak: 10+ chars, 3 of 4 types (a-z, A-Z, 0-9, symbol), no 3 identical in a row.",PASSWORD_CANNOT_EMPTY:"Password can not be empty",SHIPPING_UNKNOWN:"unknown",STRIPE_MESSAGES:{incorrect_number:"El número de la tarjeta es incorrecto",invalid_number:"El número de la tarjeta no es válido.",invalid_expiry_month:"El mes de expiración de la tarjeta es inválido.",invalid_expiry_year:"El año de la tarjeta es inválido.",invalid_cvc:"El número CVC de la tarjeta es inválido.",expired_card:"La tarjeta está expirada.",incorrect_cvc:"El CVC de la tarjeta es incorrecto.",incorrect_zip:"El código postal es incorrecto.",card_declined:"La tarjeta ha sido denegada.",missing:"There is no card on a customer that is being charged.",processing_error:"Hubo un error mientras procesabamos el pago.",rate_limit:"An error occurred due to requests hitting the API too quickly. Please let us know if you're consistently running into this error."}});$translateProvider.translations("es",{LANG_EN:"ingles",LANG_ES:"español",PASSWORDS_DONT_MATCH:"Las contraseñas no coinciden.",PASSWORD_STRENGTH_ERROR:"Password débil: 10+ caracteres, 3 de 4 tipos (a-z, A-Z, 0-9, sÃmbolo), sin 3 caracteres iguales seguidos.",PASSWORD_CANNOT_EMPTY:"El password no puede estar vacÃo.",SHIPPING_UNKNOWN:"desconocido",STRIPE_MESSAGES:{incorrect_number:"El número de la tarjeta es incorrecto",invali
3d_number:"El número de la tarjeta no es válido.",invalid_expiry_month:"El mes de expiración de la tarjeta es inválido.",invalid_expiry_year:"El año de la tarjeta es inválido.",invalid_cvc:"El número CVC de la tarjeta es inválido.",expired_card:"La tarjeta está expirada.",incorrect_cvc:"El CVC de la tarjeta es incorrecto.",incorrect_zip:"El código postal es incorrecto.",card_declined:"La tarjeta ha sido denegada.",missing:"There is no card on a customer that is being charged.",processing_error:"Hubo un error mientras procesabamos el pago.",rate_limit:"An error occurred due to requests hitting the API too quickly. Please let us know if you're consistently running into this error."}});$translateProvider.translations("fr",{LANG_EN:"anglais",LANG_ES:"espagnol",PASSWORDS_DONT_MATCH:"Les mots de passe ne correspondent pas.",PASSWORD_STRENGTH_ERROR:"Mot de passe trop faible : 10+ caractères, 3 types sur 4 (a-z, A-Z, 0-9, symbole), pas 3 caractères identiques à la suite.",PASSWORD_CANNOT_EMPTY:"Le mot de passe ne peut pas être vide",SHIPPING_UNKNOWN:"unknown",STRIPE_MESSAGES:{incorrect_number:"El número de la tarjeta es incorrecto",invalid_number:"El número de la tarjeta no es válido.",invalid_expiry_month:"El mes de expiración de la tarjeta es inválido.",invalid_expiry_year:"El año de la tarjeta es inválido.",invalid_cvc:"El número CVC de la tarjeta es inválido.",expired_card:"La tarjeta está expirada.",incorrect_cvc:"El CVC de la tarjeta es incorrecto.",incorrect_zip:"El código postal es incorrecto.",card_declined:"La tarjeta ha sido denegada.",missing:"There is no card on a customer that is being charged.",processing_error:"Hubo un error mientras procesabamos el pago.",rate_limit:"An error occurred due to requests hitting the API too quickly. Please let us know if you're consistently running into this error."}});$translateProvider.preferredLanguage("en")});"use strict";angular.module("ACResults",["services.HttpService","directives.spinner","directives.resizables","ngSanitize"]).controller("ACResultsController",["$scope","$filter","HttpService","$window","$sce",function($scope,$filter,HttpService,$window,$sce){var searchContains=function(string,substr){return string.indexOf(substr)!=-1};$scope.init=function(url){var _starter=function(){$scope.index=0;$scope.data=[];$scope.page=1;$scope.results=[];$scope.pagedItemsLoaded=[];$scope.pagedItemsLoadedPreload=[];$scope.imageLocations=[];$scope.more=false;$scope.moreLoad=false;$scope.status_bar="";$scope.isLoading=true;$scope.noOverall=true;$scope.isSuccessful=false;$scope.percentLoaded=0;$scope.preloader=false};$scope.safeApply(_starter());$scope.per_page=999;$scope.url=url;$scope.items=[];$scope.competitors=[];$scope.races=[];$scope.overall=[];$scope.tabs=[];HttpService.getDataUrl($scope.url).then(function(response){angular.forEach(response.data,function(event){angular.forEach(event.competitors,function(competitor){$scope.competitors[competitor.competitorid]=competitor});angular.forEach(event.regattaresults.total,function(overall){overall["venue"]=event.title;overall["teamName"]=$scope.competitors[overall.competitorid].name;overall["teamShort"]=$scope.competitors[overall.competitorid].abbr;overall["teamCountry"]=$scope.competitors[overall.competitorid].country;overall["teamImg"]=$scope.competitors[overall.competitorid].media;overall["teamUrl"]=$scope.competitors[overall.competitorid].link;$scope.overall.push(overall)});angular.forEach(event.regattaresults.races,function(race){if(angular.isUndefined($scope.races[event.title])){$scope.races[event.title]=[]}if(!searchContains($scope.races[event.title],race.name)){$scope.races[event.title].push(race.name)}angular.forEach(race.competitors,function(item){item["venue"]=event.title;item["race"]=race.name;item["teamName"]=$scope.competitors[item.competitorid].name;item["teamShort"]=$scope.competitors[item.competitorid].abbr;item["teamCountry"]=$scope.competitors[item.competitorid].country;item["teamImg"]=$scope.competitors[item.competitorid].media;item["teamUrl"]=$scope.competitors[item.competitorid].link;$scope.items.push(item)})});if(event.regattaresults.races.length>0){$scope.tabs.push(event.title)}});$scope.filterClass=$scope.tabs[0];$scope.filterClassRaces=$scope.races[$scope.tabs[0]][0];$scope.search()});$scope.setFilterClass=function(filterClass){$scope.filterClass=filterClass;if(!angular.isUndefined($scope.races[filterClass])){$scope.filterClassRaces=$scope.races[filterClass][0]}else{$scope.filterClassRaces="";$scope.tabsRaces=[]}$scope.safeApply(_starter());$scope.search();return false};$scope.setFilterClassRaces=function(filterClassRaces){$scope.filterClassRaces=filterClassRaces;
3$scope.safeApply(_starter());$scope.search();return false};$scope.search=function(){$scope.filteredItems=$filter("filter")($scope.items,function(item){var x=false;if(!angular.isUndefined($scope.query)){angular.forEach($scope.searchFields,function(attr){if(searchMatch(item[attr],$scope.query)){x=true}})}else{x=true}return x});$scope.filteredTabs=$filter("filter")($scope.races[$scope.filterClass],function(tab){var x=false;$scope.tabsRaces=[];angular.forEach($scope.races[$scope.filterClass],function(raceName){$scope.tabsRaces.push(raceName)})});if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterClass)&&$scope.filterClass.length>0){$scope.data=$filter("filter")($scope.filteredItems,function(item){if(searchContains(item.venue,$scope.filterClass)){if(item.race==$scope.filterClassRaces){return true}}return false})}$scope.filteredOverall=$filter("filter")($scope.overall,function(item){if(searchContains(item.venue,$scope.filterClass)){return true}return false});$scope.loadData()};$scope.trustSrc=function(src){return $sce.trustAsResourceUrl(src)};$scope.loadData=function(){$scope.loadedRace=$scope.data;if($scope.filteredOverall.length>0){$scope.noOverall=false}$scope.loadedOverall=$scope.filteredOverall;$scope.safeApply(function(){$scope.isLoading=false})};$scope.windowOpen=function(url,title,options){$window.open(url,title,options)};$scope.show_more=function(){$scope.page+=1;$scope.loadData()};$scope.show_more_Infinite=function(){$scope.page++;$scope.loadData()};$scope.has_more=function(){return $scope.more}};$scope.initHome=function(url,eventId){var _starter=function(){$scope.index=0;$scope.data=[];$scope.page=1;$scope.results=[];$scope.pagedItemsLoaded=[];$scope.pagedItemsLoadedPreload=[];$scope.imageLocations=[];$scope.more=false;$scope.moreLoad=false;$scope.status_bar="";$scope.isLoading=true;$scope.noOverall=true;$scope.isSuccessful=false;$scope.percentLoaded=0;$scope.preloader=false};$scope.safeApply(_starter());$scope.per_page=999;$scope.url=url;$scope.eventId=eventId;$scope.items=[];$scope.competitors=[];$scope.event=[];$scope.overall=[];$scope.tabs=[];HttpService.getDataUrl($scope.url).then(function(response){angular.forEach(response.data,function(event){angular.forEach(event.competitors,function(competitor){$scope.competitors[competitor.competitorid]=competitor});if(event.regattaid==$scope.eventId){var i=0;angular.forEach(event.regattaresults.total,function(overall){if(i<3){overall["venue"]=event.title;overall["teamName"]=$scope.competitors[overall.competitorid].name;overall["teamShort"]=$scope.competitors[overall.competitorid].abbr;overall["teamCountry"]=$scope.competitors[overall.competitorid].country;overall["teamImg"]=$scope.competitors[overall.competitorid].media;overall["teamUrl"]=$scope.competitors[overall.competitorid].link;$scope.event.push(overall)}i++})}else if(event.regattaid==999){angular.forEach(event.regattaresults.total,function(overall){overall["venue"]=event.title;overall["teamName"]=$scope.competitors[overall.competitorid].name;overall["teamShort"]=$scope.competitors[overall.competitorid].abbr;overall["teamCountry"]=$scope.competitors[overall.competitorid].country;overall["teamImg"]=$scope.competitors[overall.competitorid].media;overall["teamUrl"]=$scope.competitors[overall.competitorid].link;overall["teamSkipper"]=$scope.competitors[overall.competitorid].skipper;overall["teamStatus"]=$scope.competitors[overall.competitorid].status;overall["teamBoat"]=$scope.competitors[overall.competitorid].boat;overall["teamColor"]=$scope.competitors[overall.competitorid].color;$scope.overall.push(overall)})}});$scope.search()});$scope.search=function(){$scope.filteredItems=$filter("filter")($scope.items,function(item){var x=false;if(!angular.isUndefined($scope.query)){angular.forEach($scope.searchFields,function(attr){if(searchMatch(item[attr],$scope.query)){x=true}})}else{x=true}return x});$scope.loadData()};$scope.trustSrc=function(src){return $sce.trustAsResourceUrl(src)};$scope.loadData=function(){$scope.loadedEvent=$scope.event;if($scope.event.length>0){$scope.noOverall=false}$scope.loadedOverall=$scope.overall;
3$scope.safeApply(function(){$scope.isLoading=false})};$scope.windowOpen=function(url,title,options){$window.open(url,title,options)};$scope.show_more=function(){$scope.page+=1;$scope.loadData()};$scope.show_more_Infinite=function(){$scope.page++;$scope.loadData()};$scope.has_more=function(){return $scope.more}}}]);"use strict";angular.module("Content",["services.HttpService","directives.spinner","directives.resizables","ngSanitize","Scope.safeApply"]).controller("ContentController",["$scope","$http","$filter","HttpService","$window","$location","preloader","$timeout","$rootScope","CommonFactory","$compile","$base64","COMMON",function($scope,$http,$filter,HttpService,$window,$location,preloader,$timeout,$rootScope,CommonFactory,$compile,$base64,COMMON){var searchMatch=function(haystack,needle){if(!needle){return true}if(angular.isUndefined(haystack)){return false}return haystack.toLowerCase().indexOf(needle.toLowerCase())!==-1};var searchContains=function(string,substr){if(angular.isUndefined(string)){return false}else{if(string){return string.indexOf(substr)!=-1}else{return false}}};var searchContainsComma=function(string,substr){var i=0;var retVar=false;var exp=string.split(",");for(i=0;i<exp.length;i++){if(exp[i]==substr){retVar=true}}return retVar};var searchContainsSpace=function(string,substr){var i=0;var retVar=false;var exp=string.split(" ");for(i=0;i<exp.length;i++){if(exp[i]==substr){retVar=true}}return retVar};var searchDate=function(string,filterBy){string=string.substr(0,10);var nowDate=moment().utc().format("YYYY-MM-DD");if(filterBy=="="){if(string==nowDate){return true}}else if(filterBy==">"){if(string>nowDate){return true}}else if(filterBy==">="){if(string>=nowDate){return true}}else if(filterBy=="<"){if(string<nowDate){return true}}else if(filterBy=="<="){if(string<=nowDate){return true}}return false};$scope.getHashParams=function(){var urlParams={};var hashLoad=$location.hash();if(hashLoad){var hashParams=hashLoad.split("&");angular.forEach(hashParams,function(h){var h2=h.split("=");if(h2.length==2){urlParams[h2[0]]=h2[1]}else{urlParams[h2[0]]=true}})}return urlParams};$scope.setHashParams=function(params){var hash="";angular.forEach(params,function(val,key){hash+=key+"="+val+"&"});if(hash.substr(-1,1)=="&"){hash=hash.substr(0,hash.length-1)}$location.hash(hash)};$scope.itemsPrevNext=function(url,currentItem,sortBy){$scope.encodedUrl=url;$scope.currentItem=currentItem;$scope.sortBy=sortBy;$scope.allItems=[];$scope.prevItem="";$scope.nextItem="";$scope.urlDecoded=[];try{$scope.urlDecoded=angular.fromJson($base64.decode($scope.encodedUrl))}catch(e){}if(!angular.isUndefined($scope.urlDecoded.url)){HttpService.getDataUrl($scope.urlDecoded.url,[]).then(function(response){$scope.allItems=response.data;$scope.orderedItems=$filter("orderBy")($scope.allItems,$scope.sortBy,true);var currIndex=$scope.orderedItems.indexOf($filter("filter")($scope.orderedItems,{id:$scope.currentItem},true)[0]);if(currIndex>-1){$scope.safeApply(function(){if(!angular.isUndefined($scope.orderedItems[currIndex-1])){$scope.prevItem=$scope.orderedItems[currIndex-1];$scope.prevItem.mediaShow="";if(angular.isUndefined($scope.prevItem.media)||!$scope.prevItem.media||$scope.prevItem.media.length<1){$scope.prevItem.extraClass+=" no-img"}else{if(CommonFactory.isMobile()&&$scope.prevItem.mediaMobile!=false){$scope.prevItem.mediaShow=$scope.prevItem.mediaMobile}else{$scope.prevItem.mediaShow=$scope.prevItem.media}}}if(!angular.isUndefined($scope.orderedItems[currIndex+1])){$scope.nextItem=$scope.orderedItems[currIndex+1];$scope.nextItem.mediaShow="";if(angular.isUndefined($scope.nextItem.media)||!$scope.nextItem.media||$scope.nextItem.media.length<1){$scope.nextItem.extraClass+=" no-img"}else{if(CommonFactory.isMobile()&&$scope.nextItem.mediaMobile!=false){$scope.nextItem.mediaShow=$scope.nextItem.mediaMobile}else{$scope.nextItem.mediaShow=$scope.nextItem.media}}}})}})}};$scope.init=function(dataOrUrl,idData,imageDefault,extra){$scope.dataOrUrl=dataOrUrl;$scope.isLoading=true;$scope.errorLoading=false;$scope.idData=idData?idData:"idData";$scope.imageDefault=imageDefault?imageDefault:"/images/no-image.jpg";$scope.media=$scope.media?$scope.media:$scope.imageDefault;$scope.data={};$scope.isUrl=false;$scope.searchFields=["title","short_text"];var searchTimeout;$scope.$watch("itemSearch",function(newVal,oldVal){if(newVal!==oldVal){if(searchTimeout){$timeout.cancel(searchTimeout)}var delay=!newVal||newVal===""?300:150;searchTimeout=$timeout(function(){var resultsCount=0;var noResults=angular.element(".no-results-container");var li=angular.element(".content-angular-news-item");for(var i=0;i<li.length;i++){if($scope.filterClass&&$scope.filterClass!=="all"){if(li[i].classList.contains($scope.filterClass)){li[i].style.display="list-item";resultsCount++}else{li[i].style.display="none"}}else{li[i].style.display="list-item";resultsCount++}}if(noResults.length>0){noResults[0].style.display=resultsCount===0||li.length===0?"block":"none"}},delay)}});
3$scope.scrollTo=function(dataslide,plus){if($scope.noFirstScroll){$scope.noFirstScroll=false;return}if(!angular.isUndefined($rootScope.disableOtherScrolls)){return}plus=plus?plus:0;if(document.getElementById(dataslide)){$("html,body").animate({scrollTop:$("#"+dataslide).offset().top-plus},700,"")}};$scope.starter=function(){$scope.page=1;$scope.noResults=false;try{var decodedData=$base64.decode($scope.dataOrUrl);try{$scope.data=angular.fromJson(decodedData);for(let key in $scope.data){if(key!="items"&&key!="tabs"&&key!="main_title"){$scope.data.items.map(x=>{if(x[key]){for(let id in x[key]){var group=$scope.data[key].find(x=>x.id==id);if(group){x[key][id]=group.name}else{delete x[key][id]}}}return x})}}}catch(e){$scope.isUrl=true}}catch(e){$scope.isUrl=true}if(!$scope.isUrl&&angular.isUndefined($scope.data.feed)){$scope.isLoading=false;return}$http.get($scope.data.feed).success(function(data,status,headers,config){if(status!=200){$timeout(function(){$scope.isLoading=false;$scope.errorLoading=true});return}$scope.isLoading=false;$scope.data=data}).error(function(data,status,headers,config){})};if($(".pull-to-refresh").length){PullToRefresh.init({mainElement:"#content",shouldPullToRefresh:function(){if($("#content")[0].scrollTop==0){return true}else{return false}},onRefresh:$scope.starter()})}$scope.setFilterClass=function(filterClass,urlAll,maintainFilters,$event){$scope.itemSearch="";var resultsCount=0;var noResults=angular.element(".no-results-container");var container=angular.element("#content-"+$scope.idData);if($event){$event.preventDefault()}if($scope.filterClass&&filterClass){$rootScope.gaEvent("event","filterClass",{filter:filterClass})}$scope.scrollTo($scope.scrollId,"");$scope.filterMain=false;$scope.filterDate=false;$scope.filterTag=false;$scope.filterClass=filterClass;$scope.filterClass2=maintainFilters?$scope.filterClass2:false;$scope.filterClass3=maintainFilters?$scope.filterClass3:false;$timeout(function(){angular.element("#"+$scope.idData+' .tab a[data-tab!="'+filterClass+'"]').removeClass("active");angular.element("#"+$scope.idData+' .tab a[data-tab="'+filterClass+'"]').addClass("active");container.fadeOut("fast",function(){if(filterClass!=undefined){var li=angular.element(".content-angular-news-item");for(var i=0;i<li.length;i++){if(li[i].classList.contains(filterClass)){li[i].style.display="list-item";resultsCount++}else{li[i].style.display="none"}}if(resultsCount==0){noResults[0].style.display="block"}else{noResults[0].style.display="none"}}else{li.style.display="list-item";noResults[0].style.display="none";for(var i=0;i<li.length;i++){li[i].style.display="list-item"}if(noResults.length>0){noResults[0].style.display="none"}}$("html,body,#content").animate({scrollTop:0},700,"");container.fadeIn("fast")})});return false};$scope.setFilterDefault=function(filterData,urlAll,a1,$event){angular.element(".no-results-container")[0].style.display="none";$scope.itemSearch="";var noResults=angular.element(".no-results-container");if(noResults.length>0){noResults[0].style.display="none"}if($event){$event.preventDefault()}if(!angular.isUndefined($scope.onRenderHeaderCountry)){delete $scope.onRenderHeaderCountry;var hashParams=$scope.getHashParams();delete hashParams["country"];$scope.setHashParams(hashParams)}if(!angular.isUndefined($scope.onRenderHeaderTimeZone)){delete $scope.onRenderHeaderTimeZone;var hashParams=$scope.getHashParams();delete hashParams["timeZone"];$scope.setHashParams(hashParams)}$scope.scrollTo($scope.scrollId,"");$scope.filteredSubsection="";$scope.filterMain=true;$scope.filterTag=false;$scope.filterDate=false;$scope.filterClass=false;$scope.filterClass2=false;$scope.filterClass3=false;angular.element("#"+$scope.idData+" .tab a.active").removeClass("active");angular.element("#"+$scope.idData+" .tab a:first").addClass("active");$scope.setHashParams({});if(angular.isUndefined(COMMON.DISABLE_FADES)){angular.element("#content-"+$scope.idData).fadeOut("fast",function(){var li=angular.element(".content-angular-news-item");for(var i=0;i<li.length;i++){li[i].style.display="list-item"}$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).fadeIn("fast")})}else{angular.element("#content-"+$scope.idData).hide(function(){var li=angular.element(".content-angular-news-item");for(var i=0;i<li.length;i++){li[i].style.display="list-item"}$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).show()})}$("html,body,#content").animate({scrollTop:0},700,"");return false};$scope.search=function(){$scope.filteredItems=$filter("filter")($scope.items,function(item){var x=false;if(!angular.isUndefined($scope.query)){angular.forEach($scope.searchFields,function(attr){if(searchMatch(item[attr],$scope.query)){x=true}})}else{x=true}return x});console.log($scope.items);console.log($scope.filteredItems);if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterAlways)&&$scope.filterAlways.length>0){console.log("IF 1");$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){if(searchContains(item[$scope.filterAlwaysField],$scope.filterAlways)){return true}return false})}if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterDateAlways)&&$scope.filterDateAlways.length>0){console.log("IF 2");$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){if(searchDate(item.datefilter,$scope.filterDateAlways)){return true}return false})}if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterDate)&&$scope.filterDate.length>0){console.log("IF 3");$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){if(searchDate(item.datefilter,$scope.filterDate)){return true}return false})}if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterClass)&&$scope.filterClass.length>0){console.log("IF 4");$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){if(searchContainsSpace(item.class,$scope.filterClass)){return true}return false})}if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterClass2)&&$scope.filterClass2.length>0){console.log("IF 5");$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){if(searchContainsSpace(item.class2,$scope.filterClass2)){return true}return false})}if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterClass3)&&$scope.filterClass3.length>0){console.log("IF 6");$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){if(searchContainsSpace(item.class3,$scope.filterClass3)){return true}return false})}if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterSlider)&&$scope.filterSlider.length>0){console.log("IF 7");$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){if(searchContains(item.slider_name,$scope.filterSlider)){return true}return false})}if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterTag)&&$scope.filterTag.length>0){console.log("IF 8");$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){if(searchContainsComma(item.tags,$scope.filterTag)){return true}return false})}if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterMain)&&$scope.filterMain==true){console.log("IF 9");$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){if(!angular.isUndefined(item.main)){return true}return false})}$scope.currentPage=0;$scope.paginatorPages=[];for(var i=1;i<=$scope.totalPages;i++){$scope.paginatorPages.push(i)}if($scope.simplePaginator){if($scope.filteredSearch){$scope.paginatorPage=1;$scope.currentPage=1;$scope.goToPage(1);$scope.filteredSearch=false}else{var hashParams=$scope.getHashParams();if(!angular.isUndefined(hashParams.page)){$scope.paginatorPage=hashParams.page*1;$scope.currentPage=hashParams.page*1}else{$scope.paginatorPage=1;$scope.currentPage=1}}}else{}if($scope.load==true){$scope.load=false}};$scope.groupToPages=function(){$scope.pagedItems=[];$scope.currentPage++;$scope.imageLocations=[];for(;$scope.index<$scope.itemsPerPage*$scope.page;$scope.index++){$scope.moreLoad=$scope.filteredItems.length>$scope.index;if($scope.moreLoad==false)break;$scope.filteredItems[$scope.index].extraClass=$scope.filteredItems[$scope.index].class;if(!angular.isUndefined($scope.filteredItems[$scope.index].class2)){$scope.filteredItems[$scope.index].extraClass+=" "+$scope.filteredItems[$scope.index].class2}if(!angular.isUndefined($scope.filteredItems[$scope.index].class3)){$scope.filteredItems[$scope.index].extraClass+=" "+$scope.filteredItems[$scope.index].class3}if(!angular.isUndefined($scope.filteredItems[$scope.index].premium)){$scope.filteredItems[$scope.index].extraClass+=" "+$scope.filteredItems[$scope.index].premium}$scope.filteredItems[$scope.index].mediaShow=$scope.imageDefault;if(angular.isUndefined($scope.filteredItems[$scope.index].media)||!$scope.filteredItems[$scope.index].media||$scope.filteredItems[$scope.index].media.length<1){if(angular.isUndefined($scope.filteredItems[$scope.index].mediaForce)||$scope.filteredItems[$scope.index].mediaForce.length<1){$scope.filteredItems[$scope.index].extraClass+=" no-img"}}else{if(CommonFactory.isMobile()&&$scope.filteredItems[$scope.index].mediaMobile!=false){$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].mediaMobile}else{$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].media}$scope["imageLocations"].push($scope.filteredItems[$scope.index].media);if($scope.filterMain&&$scope.index<1){if(CommonFactory.isMobile()&&$scope.filteredItems[$scope.index].mediaMobile!=false){$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].mediaMobile}else if($scope.filteredItems[$scope.index].mediaFirst.length>0){$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].mediaFirst}else{$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].media}$scope["imageLocations"].push($scope.filteredItems[$scope.index].mediaFirst)}}if(!angular.isUndefined($scope.filteredItems[$scope.index].media2)){if(CommonFactory.isMobile()&&$scope.filteredItems[$scope.index].mediaMobile2!=false){$scope.filteredItems[$scope.index].mediaShow2=$scope.filteredItems[$scope.index].mediaMobile2}else{$scope.filteredItems[$scope.index].mediaShow2=$scope.filteredItems[$scope.index].media2}$scope["imageLocations"].push($scope.filteredItems[$scope.index].media2)}if(!angular.isUndefined($scope.filteredItems[$scope.index].pages)&&$scope.filteredItems[$scope.index].pages.length>0){if(CommonFactory.isMobile()&&$scope.filteredItems[$scope.index].mediaMobile!=false){$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].pages[0].medium}else{$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].pages[0].medium}$scope["imageLocations"].push($scope.filteredItems[$scope.index].pages[0].medium);if($scope.filterMain&&$scope.index<1){$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].pages[0].medium;$scope["imageLocations"].push($scope.filteredItems[$scope.index].pages[0].medium)}}if(!angular.isUndefined($scope.filteredItems[$scope.index].mediaForce)&&$scope.filteredItems[$scope.index].mediaForce){$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].mediaForce;delete $scope.filteredItems[$scope.index].mediaForce}$scope.pagedItems.push($scope.filteredItems[$scope.index]);if(!angular.isUndefined($scope.filteredItems[$scope.index].media)&&$scope.filteredItems[$scope.index].media){if($scope["filteredItems"][$scope["index"]].media[0]!==null){$scope["imageLocations"].push($scope["filteredItems"][$scope["index"]].media)}}}$scope.safeApply(function(){angular.forEach($scope.pagedItems,function(item){$scope.s
3afeApply(function(){$scope.pagedItemsLoadedPreload.push(item)})});$scope.isLoading=false;$scope.isSuccessful=true;$scope.percentLoaded=0;if($scope.page==1){$scope.viewNext()}else if($scope.historyDirection<1&&$scope.page<=sessionStorage.getItem("currentPage")){if($scope.page==sessionStorage.getItem("currentPage")*1){var currentItems=($scope.page-1)*$scope.itemsPerPage;var newTop="";$timeout(function(){try{newTop=$("#"+$scope.idData+" li:nth-child("+currentItems+")").offset().top;$("html,body").animate({scrollTop:newTop},0,"")}catch(e){}},1e3)}$scope.viewNext()}if(angular.isUndefined(COMMON.DISABLE_FADES)){angular.element("#content-"+$scope.idData).fadeIn("fast")}else{angular.element("#content-"+$scope.idData).show()}})};$scope.openArticle=function(item){$rootScope.currentArticle=item;$rootScope.gaEvent("event","openArticle",{article:item.title});$rootScope.openModalClass("modal-"+$scope.idData,"","","modal-"+$scope.idData);angular.element("#modal-"+$scope.idData).addClass("overlay-"+$scope.idData);$rootScope.$on("site:modal-close-modal-"+$scope.idData,function(){$timeout(function(){if(angular.element("#modal-"+$scope.idData+" .fotorama").length){angular.element("#modal-"+$scope.idData+" .fotorama").data("fotorama").destroy()}$rootScope.currentArticle={};angular.element("#modal-"+$scope.idData).removeClass("overlay-"+$scope.idData)})});$rootScope.currentArticle.showVideoPlayer=false;$timeout(function(){if(angular.element("#modal-"+$scope.idData+" .fotorama").length){angular.element("#modal-"+$scope.idData+" .fotorama").fotorama()}else if(!angular.isUndefined($rootScope.currentArticle.media)){if($rootScope.currentArticle.media.length==1&&$rootScope.currentArticle.media[0].type=="video"){$rootScope.currentArticle.media[0].videoData=$scope.findVideoId($rootScope.currentArticle.media[0].video);var showMediaElementControls=true;if($rootScope.currentArticle.media[0].videoData){$rootScope.currentArticle.media[0].videoType="video/"+$rootScope.currentArticle.media[0].videoData.type;showMediaElementControls=false}else{$rootScope.currentArticle.media[0].videoType="video/mp4"}$rootScope.currentArticle.media[0].videoType=!$rootScope.currentArticle.media[0].videoData?"video/mp4":"video/"+$rootScope.currentArticle.media[0].videoData.type;$timeout(function(){$rootScope.currentArticle.showVideoPlayer=true;if($rootScope.currentArticle.media[0].type=="video"){$timeout(function(){var idVideo=document.querySelector("#modal-current-article .video-player-container video").id;var width=$("#modal-current-article .video-player-container").width();var height=$("#modal-current-article .video-player-container").width()*9/16;$("#modal-current-article .video-player-container").height(height);new MediaElementPlayer(idVideo,{volume:100,pauseOtherPlayers:false,alwaysShowControls:showMediaElementControls,width:width,height:height,youtube:{iv_load_policy:3,modestbranding:0,autoplay:1,controls:!showMediaElementControls,showinfo:0,wmode:"opaque",branding:0,autohide:1,playsinline:1},success:function(mediaElement,domObject){$("#"+idVideo+" iframe").width("100%").height("100%")}})})}},500)}else if($rootScope.currentArticle.media.length>1&&$rootScope.currentArticle.media[1].type=="video"){$rootScope.currentArticle.media[1].videoData=$scope.findVideoId($rootScope.currentArticle.media[1].video);var showMediaElementControls=true;if($rootScope.currentArticle.media[1].videoData){$rootScope.currentArticle.media[1].videoType="video/"+$rootScope.currentArticle.media[1].videoData.type;showMediaElementControls=false}else{$rootScope.currentArticle.media[1].videoType="video/mp4"}$rootScope.currentArticle.media[1].videoType=!$rootScope.currentArticle.media[1].videoData?"video/mp4":"video/"+$rootScope.currentArticle.media[1].videoData.type;$timeout(function(){$rootScope.currentArticle.showVideoPlayer=true;if($rootScope.currentArticle.media[1].type=="video"){$timeout(function(){var idVideo=document.querySelector("#modal-current-article .video-player-container video").id;var width=$("#modal-current-article .video-player-container").width();var height=$("#modal-current-article .video-player-container").width()*9/16;
3$("#modal-current-article .video-player-container").height(height);new MediaElementPlayer(idVideo,{volume:100,pauseOtherPlayers:false,alwaysShowControls:showMediaElementControls,width:width,height:height,youtube:{iv_load_policy:3,modestbranding:0,autoplay:1,controls:!showMediaElementControls,showinfo:0,wmode:"opaque",branding:0,autohide:1,playsinline:1},success:function(mediaElement,domObject){$("#"+idVideo+" iframe").width("100%").height("100%")}})})}},500)}}},500)};$scope.starter()};$scope.initOld=function(url,per_page,imageDefault,idData,scrollId,firstAction,filterId,groupFilters,searchParams,onRenderAction,fotoramaId,owlSlider,noMain,contentIframe,groupSubsectionsClass,noPageRemember,simplePaginator,jsonTabs,groupBy,parentFilter,oneItemActionField,filterHash,sliderConfig){$scope.idData=idData;$scope.scrollId=scrollId;$scope.firstAction=firstAction;$scope.fieldsByType=["class","class2","class3"];$scope.imageDefault=imageDefault;$scope.onSocial=false;$scope.onRenderAction=onRenderAction;$scope.onRenderHeaderAction="";$scope.fotoramaId=fotoramaId;$scope.owlSlider=owlSlider;$scope.contentIframe=contentIframe;$scope.groupSubsectionsClass=groupSubsectionsClass;$scope.noPageRemember=noPageRemember;$scope.tabsSubsections={};$scope.filteredSubsection="";$scope.filterId=filterId;$scope.allGroups=groupFilters;$scope.searchParams=searchParams;$scope.searchFields=["title","short_text"];$scope.searchParam="";$scope.contentIframeHtml="";$scope.groupFilters=[];$scope.axnLoaded={};$scope.jsonTabs=jsonTabs;$scope.simplePaginator=simplePaginator;$scope.groupBy=groupBy;$scope.parentFilter=parentFilter;$scope.oneItemActionField=oneItemActionField;$scope.filterHash=filterHash;$scope.sliderConfig=sliderConfig;$scope.extraTabsCurrentHash={};if(!angular.isUndefined($scope.allGroups)){var allGroups=$scope.allGroups.split("|");angular.forEach(allGroups,function(data){var groupsData=data.split(",");$scope.groupFilters.push(groupsData)})}$scope.itemsPerPage=per_page;if($scope.itemsPerPage==9999||$scope.noPageRemember){$scope.noHashPages=true}$scope.url=url;if($scope.searchParams){$scope.url+="?txt="+$location.search()["txt"];$scope.searchParam=$location.search()["txt"]}$scope.page=1;$scope.totalPages=1;$scope.firstLoad=true;$scope.filterMain=false;if(!$scope.filterId&&!noMain){$scope.filterMain=true}$scope.filterDate=false;$scope.filterDateAlways=false;$scope.filterTag=false;$scope.filterClass=false;$scope.filterClass2=false;$scope.filterClass3=false;$scope.filterSlider=false;$scope.filterAlways=false;$scope.filterAlwaysField=false;$scope.allFilters={};$scope.searchFilter="";$scope.extraTabs=[];$scope.noHashLoad=false;$scope.noFirstScroll=false;$scope.starter=function(){$scope.index=0;$scope.data=[];$scope.page=1;$scope.results=[];$scope.pagedItemsLoaded=[];$scope.pagedItemsLoadedPreload=[];$scope.imageLocations=[];$scope.more=true;$scope.moreLoad=false;$scope.status_bar="";if($scope.owlSlider){if($scope.hasOwlSlider){$("#"+$scope.idData+" .more-items-list").owlCarousel("destroy");$("#"+$scope.idData+" .more-items-list").removeClass("owl-carousel owl-theme")}else{var owlAPi;$scope.ready=function($api){owlAPi=$api}}}$scope.isLoading=true;$scope.noresults=false;$scope.isSuccessful=false;$scope.percentLoaded=0;$scope.preloader=false;$scope.$on("ngRepeatFinished",function(){if($scope.fotoramaId){setTimeout(function(){var $fotoramaDiv=$($scope.fotoramaId);$fotoramaDiv.fotorama()},1500)}if(!angular.isUndefined($scope.onRenderHeaderCountry)){var hashParams=$scope.getHashParams();hashParams["country"]=$scope.onRenderHeaderCountry;$scope.setHashParams(hashParams)}if(!angular.isUndefined($scope.onRenderHeaderTimeZone)){var hashParams=$scope.getHashParams();hashParams["timeZone"]=$scope.onRenderHeaderTimeZone;$scope.setHashParams(hashParams)}if($scope.onRenderAction){if(typeof window[$scope.onRenderAction.replace("()","")]=="function"){$timeout(function(){eval($scope.onRenderAction)})}if($scope.owlSlider){$scope.hasOwlSlider=true}}})};$scope.initData=function(onFinishLoad){var params=[];HttpService.getDataUrl($scope.url,params).then(function(response,headers){if(response.headers("qiu-viewer-country")){$scope.onRenderHeaderCountry=response.headers("qiu-viewer-country")}if(response.headers("qiu-viewer-time-zone")){$scope.onRenderHeaderTimeZone=response.headers("qiu-viewer-time-zone")}$scope.safeApply(function(){if(!angular.isUndefined(response.data.data)){try{var decodedData=$base64.decode(response.data.data);try{response.data=angular.fromJson(decodedData)}
3catch(e){console.log("decoded data not valid(2)")}}catch(e){console.log("decoded data not valid")}}$scope.items=[];if(!angular.isUndefined(response.data.filters)){$scope.allFilters=response.data.filters}if(!angular.isUndefined(response.data.items)){var responseItems=response.data.items}else{var responseItems=response.data}if($scope.groupSubsectionsClass){angular.forEach(responseItems,function(item){if(angular.isUndefined(item.show_dropdown)){if(item.class&&angular.isUndefined($scope.tabsSubsections[item.class])){$scope.tabsSubsections[item.class]={slug:item.class,name:item.subsection}}}else{if(angular.isUndefined($scope.tabsSubsectionsSelect)){$scope.tabsSubsectionsSelect={}}if(item.class&&angular.isUndefined($scope.tabsSubsections[item.class])){$scope.tabsSubsectionsSelect[item.class]={slug:item.class,class:item.class.toLowerCase(),name:item.subsection}}}})}if($scope.contentIframe){var hashLoad=$location.hash();if(hashLoad){var hashData=hashLoad.split("_");if(hashData.length==2){angular.forEach(responseItems,function(item){if(item.id==hashData[0]){$scope.contentIframeHtml=item[$scope.contentIframe]}})}}$scope.isLoading=false}else{angular.forEach(responseItems,function(item){if($scope.filterId){if(item.id!=$scope.filterId){$scope.items.push(item)}}else if($scope.groupBy){$scope.items.push(item)}else{if($scope.firstAction&&$scope.firstAction.substr(0,5)=="CLASS"){if(item.class==$scope.firstAction.substr(5)){$scope.items.push(item)}}else if($scope.firstAction&&$scope.firstAction=="HASHCODE"){$scope.noHashLoad=true;if(item.code==$scope.getHashParams().code){$scope.items.push(item)}}else{$scope.items.push(item)}}});if($scope.firstAction){$scope.noFirstScroll=true;if($scope.firstAction&&$scope.firstAction=="DATENOW"){$scope.setFilterDateNow("",">=",true)}else if($scope.firstAction.substr(0,6)=="always"){$scope.setFilterAlways("",$scope.firstAction)}else if($scope.firstAction.substr(0,4)=="date"){$scope.setFilterDate($scope.firstAction.substr(5))}else if($scope.firstAction&&$scope.firstAction.substr(0,4)=="NONE"){$scope.search()}else if($scope.firstAction&&$scope.firstAction.substr(0,3)=="TAG"){$scope.filterTag=$scope.firstAction.substr(3);$scope.search()}else if($scope.firstAction&&$scope.firstAction.substr(0,5)=="CLASS"){$scope.search()}else if($scope.firstAction&&$scope.firstAction=="HASHCODE"){$scope.search()}else if($scope.firstAction&&$scope.firstAction.substr(0,7)=="_CLASS2"){$scope.setFilterClass2($scope.firstAction.substr(7))}else if($scope.firstAction&&$scope.firstAction.substr(0,7)=="_CLASS3"){$scope.setFilterClass3($scope.firstAction.substr(7))}else if($scope.firstAction&&$scope.firstAction=="_COUNTRYHASH"){var hashParams=$scope.getHashParams();if(!angular.isUndefined(hashParams["country"])&&hashParams["country"].length>0){$scope.filterSelectSubsection("",hashParams["country"]);if(!angular.isUndefined(hashParams["timeZone"])&&hashParams["timeZone"].length>0){$scope.filterSelectSubsection("",hashParams["timeZone"])}}else{$scope.search()}}else if($scope.firstAction&&$scope.firstAction.substr(0,6)=="_CLASS"){if($scope.firstAction.substr(6,6)=="PARENT"){var parentId=$scope.firstAction.substr(12);if(!angular.isUndefined($rootScope.parentFilters)&&!angular.isUndefined($rootScope.parentFilters[parentId])){$scope.items=$filter("filter")($scope.items,{id:$rootScope.parentFilters[parentId].id},function(item,filterId){return item!=filterId});$scope.setFilterClass($rootScope.parentFilters[parentId].filter)}else{$scope.search()}}else{$scope.setFilterClass($scope.firstAction.substr(6))}}else if($scope.firstAction.substr(0,1)=="_"){var axn=$scope.firstAction.substr(1);if(angular.isUndefined($scope.axnLoaded[axn])){$scope.axnLoaded[axn]=true;$scope[axn]()}$scope.search()}else{$scope.search()}}else{$scope.search()}var hashLoad=$location.hash();if(hashLoad.indexOf("=")==-1){if(!$scope.noHashLoad&&hashLoad&&!$scope.simplePaginator){setTimeout(function(){if($(".tab ."+hashLoad).length>0){$(".tab ."+hashLoad).click()}else if($('.tab [data-tab="'+hashLoad+'"]').length>0){$('.tab [data-tab="'+hashLoad+'"]').click()}},500)}}if(onFinishLoad){$scope[onFinishLoad]()}if($scope.sliderConfig){$scope.filterSlider="";$scope.sliderOptions={};try{$scope.sliderOptions=angular.fromJson($base64.decode($scope.sliderConfig))}catch(e){}if(!angular.isUndefined($scope.sliderOptions.stepsArray)){$scope.sliderItems=$scope.sliderOptions.stepsArray}else{$scope.filteredArray=$filter("unique")($scope.items,"slider_name");$scope.filteredArray2=$filter("orderBy")($scope.filteredArray,"slider_sort");$scope.sliderItems=[{value:""}];angular.forEach($scope.filteredArray2,function(sortedItem){if(sortedItem.slider_name){$scope.sliderItems.push({value:sortedItem.slider_name})}})}$scope.slider={options:{stepsArray:$scope.sliderItems,onChange:function(sliderId,modelValue,highValue,pointerType){$scope.setFilterSlider(modelValue,"",true)}}};$scope.sliderLoaded=true}}})})};if(jsonTabs){HttpService.getDataUrl($scope.jsonTabs,[]).then(function(response){var hashParams=$scope.getHashParams();angular.forEach(response.data,function(tabs,key){if(key!="items"){var watchHash=false;var newTab={name:key,items:[]};angular.forEach(tabs,function(tab){if(!angular.isUndefined(tab.hash)&&!angular.isUndefined(hashParams[newTab.name])){if(tab.hash==hashParams[newTab.name]){$scope.url=tab.url;newTab.current=tab.name}}else{if(tab.default==1){$scope.url=tab.url;newTab.current=tab.name}}var newItem={name:tab.name,filter:tab.filter,url:tab.url,class:tab.class};if(!angular.isUndefined(tab.hash)){newItem.hash=tab.hash;watchHash=true}newTab.items.push(newItem)});if(!newTab.current){angular.forEach(newTab.items,function(tab){if(tab.default==1){$scope.url=tab.url;newTab.current=tab.name}})}$scope.extraTabs.push(newTab)}});
3$scope.safeApply($scope.starter());$scope.initData()})}else{$scope.safeApply($scope.starter());$scope.initData()}$scope.tabAction=function(tab,parentTab){if(!angular.isUndefined(tab.filter)){if(tab.filter=="feed"){$scope.isLoading=true;if(parentTab){parentTab.current=tab.name;if(tab.hash){var hashParams=$scope.getHashParams();hashParams[parentTab.name]=tab.hash;$scope.setHashParams(hashParams)}}$scope.url=tab.url;$scope.filteredItems=[];$scope.safeApply($scope.starter());$timeout(function(){$scope.initData()},500)}}};$scope.historyDirection=1;if(!$scope.noPageRemember){if(sessionStorage.getItem("stateLastShown")){if(sessionStorage.getItem("stateLastShown")*1==window.history.length-1){$scope.historyDirection=-1}else{sessionStorage.setItem("stateLastShown",window.history.length)}}else{$scope.historyDirection=window.history.length;sessionStorage.setItem("currentPage",1);sessionStorage.setItem("stateLastShown",window.history.length)}}$scope.search=function(){$scope.filteredItems=$filter("filter")($scope.items,function(item){var x=false;if(!angular.isUndefined($scope.query)){angular.forEach($scope.searchFields,function(attr){if(searchMatch(item[attr],$scope.query)){x=true}})}else{x=true}return x});if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterAlways)&&$scope.filterAlways.length>0){$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){if(searchContains(item[$scope.filterAlwaysField],$scope.filterAlways)){return true}return false})}if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterDateAlways)&&$scope.filterDateAlways.length>0){$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){if(searchDate(item.datefilter,$scope.filterDateAlways)){return true}return false})}if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterDate)&&$scope.filterDate.length>0){$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){if(searchDate(item.datefilter,$scope.filterDate)){return true}return false})}if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterClass)&&$scope.filterClass.length>0){$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){if(searchContainsSpace(item.class,$scope.filterClass)){return true}return false})}if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterClass2)&&$scope.filterClass2.length>0){$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){if(searchContainsSpace(item.class2,$scope.filterClass2)){return true}return false})}if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterClass3)&&$scope.filterClass3.length>0){$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){if(searchContainsSpace(item.class3,$scope.filterClass3)){return true}return false})}if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterSlider)&&$scope.filterSlider.length>0){$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){if(searchContains(item.slider_name,$scope.filterSlider)){return true}return false})}if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterTag)&&$scope.filterTag.length>0){$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){if(searchContainsComma(item.tags,$scope.filterTag)){return true}return false})}if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterMain)&&$scope.filterMain==true){$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){if(!angular.isUndefined(item.main)){return true}return false})}$scope.currentPage=0;$scope.totalPages=Math.ceil($scope.filteredItems.length/($scope.itemsPerPage*1));$scope.paginatorPages=[];for(var i=1;i<=$scope.totalPages;i++){$scope.paginatorPages.push(i)}if($scope.simplePaginator){if($scope.filteredSearch){$scope.paginatorPage=1;$scope.currentPage=1;$scope.goToPage(1);$scope.filteredSearch=false}else{var hashParams=$scope.getHashParams();if(!angular.isUndefined(hashParams.page)){$scope.paginatorPage=hashParams.page*1;$scope.currentPage=hashParams.page*1}else{$scope.paginatorPage=1;$scope.currentPage=1}}}else{if($scope.filteredItems&&$scope.filteredItems.length==0){if($scope.filterTag.length>0){if(!angular.isUndefined($scope["urlLoadTag"+$scope.filterTag])&&angular.isUndefined($scope["filterLoadTag"+$scope.filterTag])){$scope.preloadNextItems(1)}
3else{$scope.safeApply(function(){$scope.isLoading=false;$scope.isSuccessful=true;$scope.more=false;$scope.noresults=true})}}else{if(!angular.isUndefined($scope["urlLoad"+$scope.filterClass])&&angular.isUndefined($scope["filterLoad"+$scope.filterClass])||!angular.isUndefined($scope["urlLoad"+$scope.filterClass2])&&angular.isUndefined($scope["filterLoad"+$scope.filterClass2])){$scope.preloadNextItems(1)}else{$scope.safeApply(function(){$scope.isLoading=false;$scope.isSuccessful=true;$scope.more=false;$scope.noresults=true})}}}else if($scope.filteredItems){$scope.groupToPages()}}if($scope.load==true){$scope.load=false}};$scope.loadData=function(){$scope.currentPage++;$scope.search()};$scope.loadCurrentPage=function(){$scope.index=($scope.currentPage-1)*$scope.itemsPerPage;$scope.pagedItemsLoaded=[];$scope.imageLocations=[];for(;$scope.index<$scope.itemsPerPage*$scope.currentPage;$scope.index++){if(!angular.isUndefined($scope.filteredItems[$scope.index])){$scope.filteredItems[$scope.index].extraClass=$scope.filteredItems[$scope.index].class;if(!angular.isUndefined($scope.filteredItems[$scope.index].class2)){$scope.filteredItems[$scope.index].extraClass+=" "+$scope.filteredItems[$scope.index].class2}if(!angular.isUndefined($scope.filteredItems[$scope.index].class3)){$scope.filteredItems[$scope.index].extraClass+=" "+$scope.filteredItems[$scope.index].class3}if(!angular.isUndefined($scope.filteredItems[$scope.index].premium)){$scope.filteredItems[$scope.index].extraClass+=" "+$scope.filteredItems[$scope.index].premium}$scope.filteredItems[$scope.index].mediaShow=$scope.imageDefault;if(angular.isUndefined($scope.filteredItems[$scope.index].media)||!$scope.filteredItems[$scope.index].media||$scope.filteredItems[$scope.index].media.length<1){if(angular.isUndefined($scope.filteredItems[$scope.index].mediaForce)||$scope.filteredItems[$scope.index].mediaForce.length<1){$scope.filteredItems[$scope.index].extraClass+=" no-img"}}else{if(CommonFactory.isMobile()&&$scope.filteredItems[$scope.index].mediaMobile!=false){$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].mediaMobile}else{$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].media}$scope["imageLocations"].push($scope.filteredItems[$scope.index].media);if($scope.filterMain&&$scope.index<1){if(CommonFactory.isMobile()&&$scope.filteredItems[$scope.index].mediaMobile!=false){$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].mediaMobile}else if($scope.filteredItems[$scope.index].mediaFirst.length>0){$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].mediaFirst}else{$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].media}$scope["imageLocations"].push($scope.filteredItems[$scope.index].mediaFirst)}}if(!angular.isUndefined($scope.filteredItems[$scope.index].media2)){if(CommonFactory.isMobile()&&$scope.filteredItems[$scope.index].mediaMobile2!=false){$scope.filteredItems[$scope.index].mediaShow2=$scope.filteredItems[$scope.index].mediaMobile2}else{$scope.filteredItems[$scope.index].mediaShow2=$scope.filteredItems[$scope.index].media2}$scope["imageLocations"].push($scope.filteredItems[$scope.index].media2)}if(!angular.isUndefined($scope.filteredItems[$scope.index].pages)&&$scope.filteredItems[$scope.index].pages.length>0){if(CommonFactory.isMobile()&&$scope.filteredItems[$scope.index].mediaMobile!=false){$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].pages[0].medium}else{$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].pages[0].medium}$scope["imageLocations"].push($scope.filteredItems[$scope.index].pages[0].medium);if($scope.filterMain&&$scope.index<1){$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].pages[0].medium;$scope["imageLocations"].push($scope.filteredItems[$scope.index].pages[0].medium)}}if(!angular.isUndefined($scope.filteredItems[$scope.index].mediaForce)&&$scope.filteredItems[$scope.index].mediaForce){$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].mediaForce;delete $scope.filteredItems[$scope.index].mediaForce}$scope.pagedItemsLoaded.push($scope.filteredItems[$scope.index])}}};$scope.groupToPages=function(){$scope.pagedItems=[];$scope.currentPage++;$scope.imageLocations=[];for(;$scope.index<$scope.itemsPerPage*$scope.page;$scope.index++){$scope.moreLoad=$scope.filteredItems.length>$scope.index;if($scope.moreLoad==false)break;$scope.filteredItems[$scope.index].extraClass=$scope.filteredItems[$scope.index].class;if(!angular.isUndefined($scope.filteredItems[$scope.index].class2)){$scope.filteredItems[$scope.index].extraClass+=" "+$scope.filteredItems[$scope.index].class2}if(!angular.isUndefined($scope.filteredItems[$scope.index].class3)){$scope.filteredItems[$scope.index].extraClass+=" "+$scope.filteredItems[$scope.index].class3}if(!angular.isUndefined($scope.filteredItems[$scope.index].premium)){$scope.filteredItems[$scope.index].extraClass+=" "+$scope.filteredItems[$scope.index].premium}$scope.filteredItems[$scope.index].mediaShow=$scope.imageDefault;if(angular.isUndefined($scope.filteredItems[$scope.index].media)||!$scope.filteredItems[$scope.index].media||$scope.filteredItems[$scope.index].media.length<1){if(angular.isUndefined($scope.filteredItems[$scope.index].mediaForce)||$scope.filteredItems[$scope.index].mediaForce.length<1){$scope.filteredItems[$scope.index].extraClass+=" no-img"}}else{if(CommonFactory.isMobile()&&$scope.filteredItems[$scope.index].mediaMobile!=false){$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].mediaMobile}else{$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].media}$scope["imageLocations"].push($scope.filteredItems[$scope.index].media);if($scope.filterMain&&$scope.index<1){if(CommonFactory.isMobile()&&$scope.filteredItems[$scope.index].mediaMobile!=false){$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].mediaMobile}else if($scope.filteredItems[$scope.index].mediaFirst.length>0){$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].mediaFirst}else{$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].media}$scope["imageLocations"].push($scope.filteredItems[$scope.index].mediaFirst)}}if(!angular.isUndefined($scope.filteredItems[$scope.index].media2)){if(CommonFactory.isMobile()&&$scope.filteredItems[$scope.index].mediaMobile2!=false){$scope.filteredItems[$scope.index].mediaShow2=$scope.filteredItems[$scope.index].mediaMobile2}else{$scope.filteredItems[$scope.index].mediaShow2=$scope.filteredItems[$scope.index].media2}$scope["imageLocations"].push($scope.filteredItems[$scope.index].media2)}if(!angular.isUndefined($scope.filteredItems[$scope.index].pages)&&$scope.filteredItems[$scope.index].pages.length>0){if(CommonFactory.isMobile()&&$scope.filteredItems[$scope.index].mediaMobile!=false){$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].pages[0].medium}else{$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].pages[0].medium}$scope["imageLocations"].push($scope.filteredItems[$scope.index].pages[0].medium);if($scope.filterMain&&$scope.index<1){$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].pages[0].medium;$scope["imageLocations"].push($scope.filteredItems[$scope.index].pages[0].medium)}}if(!angular.isUndefined($scope.filteredItems[$scope.index].mediaForce)&&$scope.filteredItems[$scope.index].mediaForce){$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].mediaForce;delete $scope.filteredItems[$scope.index].mediaForce}$scope.pagedItems.push($scope.filteredItems[$scope.index]);if(!angular.isUndefined($scope.filteredItems[$scope.index].media)&&$scope.filteredItems[$scope.index].media){if($scope["filteredItems"][$scope["index"]].media[0]!==null){$scope["imageLocations"].push($scope["filteredItems"][$scope["index"]].media)}}}$scope.safeApply(function(){angular.forEach($scope.pagedItems,function(item){$scope.s
3afeApply(function(){$scope.pagedItemsLoadedPreload.push(item)})});$scope.isLoading=false;$scope.isSuccessful=true;$scope.percentLoaded=0;if($scope.page==1){$scope.viewNext()}else if($scope.historyDirection<1&&$scope.page<=sessionStorage.getItem("currentPage")){if($scope.page==sessionStorage.getItem("currentPage")*1){var currentItems=($scope.page-1)*$scope.itemsPerPage;var newTop="";$timeout(function(){try{newTop=$("#"+$scope.idData+" li:nth-child("+currentItems+")").offset().top;$("html,body").animate({scrollTop:newTop},0,"")}catch(e){}},1e3)}$scope.viewNext()}if(angular.isUndefined(COMMON.DISABLE_FADES)){angular.element("#content-"+$scope.idData).fadeIn("fast")}else{angular.element("#content-"+$scope.idData).show()}})};$scope.preload=function(imageLocations){preloader.preloadImages(imageLocations).then(function handleResolve(imageLocations){$scope.isLoading=false;$scope.isSuccessful=true;angular.forEach($scope.resultsPage,function(item){$scope.safeApply(function(){$scope.results.push(item)})});$scope.more=$scope.moreLoad;$scope.percentLoaded=0},function handleReject(imageLocation){$scope.isLoading=false;$scope.isSuccessful=false},function handleNotify(event){$scope.percentLoaded=event.percent})};$scope.windowOpen=function(url,title,options){$window.open(url,title,options)};$scope.preloadNextItems=function(noResults){if(!$scope.noPageRemember&&($scope.historyDirection==1||$scope.page>=sessionStorage.getItem("currentPage"))){sessionStorage.setItem("currentPage",$scope.page)}$scope.page+=1;if($scope.firstLoad){$scope.firstLoad=false;$scope.isLoading=true;$scope.safeApply($scope.loadData())}
3else{if($scope.filterMain==true){$scope.safeApply($scope.loadData())}else if(!angular.isUndefined($scope.filterTag)&&$scope.filterTag.length>0){if(!angular.isUndefined($scope["urlLoadTag"+$scope.filterTag])){if(!angular.isUndefined($scope["filterLoadTag"+$scope.filterTag])){$scope.safeApply($scope.loadData())}else{$scope["filterLoadTag"+$scope.filterTag]=$scope["urlLoadTag"+$scope.filterTag];$scope.safeApply($scope.preloadNextTabTag(noResults))}}else{$scope.safeApply($scope.loadData())}}else{if(!angular.isUndefined($scope["urlLoad"+$scope.filterClass])){if(!angular.isUndefined($scope["filterLoad"+$scope.filterClass])){$scope.safeApply($scope.loadData())}else{$scope["filterLoad"+$scope.filterClass]=$scope["urlLoad"+$scope.filterClass];$scope.safeApply($scope.preloadNextTab(noResults))}}else if(!angular.isUndefined($scope["urlLoad"+$scope.filterClass2])){if(!angular.isUndefined($scope["filterLoad"+$scope.filterClass2])){$scope.safeApply($scope.loadData())}else{$scope["filterLoad"+$scope.filterClass2]=$scope["urlLoad"+$scope.filterClass2];$scope.safeApply($scope.preloadNextTab(noResults))}}else{$scope.safeApply($scope.loadData())}}}};$scope.viewNext=function(){angular.forEach($scope.pagedItems,function(item){$scope.s
3afeApply(function(){$scope.pagedItemsLoaded.push(item)})});$scope.preloader=true;if($scope.oneItemActionField&&$scope.filteredItems.length==1&&!angular.isUndefined($scope.filteredItems[0][$scope.oneItemActionField])){}else{$scope.safeApply($scope.preloadNextItems())}if($scope.pagedItems.length==0){$scope.more=false;$scope.isLoading=false}};$scope.show_more=function(){$scope.viewNext()};$scope.pagePrev=function(){if($scope.paginatorPage>1){$scope.paginatorPage--}};$scope.pageNext=function(){if($scope.paginatorPage<$scope.totalPages){$scope.paginatorPage++}};$scope.goToPage=function(newPage){if(newPage>0&&newPage<=$scope.totalPages){$scope.isLoading=true;$scope.currentPage=newPage;$scope.safeApply(function(){$scope.loadCurrentPage()});if(!$scope.noHashPages){var hashParams=$scope.getHashParams();if(newPage==1){if(!angular.isUndefined(hashParams.page)){delete hashParams.page}}else{hashParams.page=newPage}$scope.setHashParams(hashParams)}if(!$scope.firstLoad){$scope.scrollTo($scope.idData,"")}$scope.firstLoad=false;$scope.isLoading=false}};$scope.$watch("paginatorPage",function(newPage){$scope.goToPage(newPage)});$rootScope.$on("site:hashChanged",function(){if(!$scope.noHashPages){var hashParams=$scope.getHashParams();if(angular.isUndefined(hashParams.page)){hashParams.page=1}if($scope.paginatorPage!=hashParams.page){$scope.paginatorPage=hashParams.page;$scope.goToPage(hashParams.page)}}});$scope.nextPage=function(){if($scope.currentPage<$scope.pagedItems.length-1){$scope.currentPage++}};$scope.show_more_Infinite=function(){$scope.page++;$scope.loadData()};$scope.has_more=function(){return $scope.more};$scope.countByFilter=function(){$scope.filteredTotal=$filter("filter")($scope.items,function(item){var x=false;if(!angular.isUndefined($scope.query)){angular.forEach($scope.searchFields,function(attr){if(searchMatch(item[attr],$scope.query)){x=true}})}else{x=true}return x});if(!angular.isUndefined($scope.filteredTotal)&&!angular.isUndefined($scope.filterDate)&&$scope.filterDate.length>0){$scope.filteredTotal=$filter("filter")($scope.filteredItems,function(item){if(searchDate(item.datefilter,$scope.filterDate)){return true}return false})}if(!angular.isUndefined($scope.filteredTotal)&&!angular.isUndefined($scope.filterClass)&&$scope.filterClass.length>0){$scope.filteredTotal=$filter("filter")($scope.filteredTotal,function(item){if(searchContains(item.class,$scope.filterClass)){return true}return false})}if(!angular.isUndefined($scope.filteredTotal)&&!angular.isUndefined($scope.filterTag)&&$scope.filterTag.length>0){$scope.filteredTotal=$filter("filter")($scope.filteredTotal,function(item){if(searchContainsComma(item.tags,$scope.filterTag)){return true}return false})}if(!angular.isUndefined($scope.filteredTotal)&&!angular.isUndefined($scope.filterClass2)&&$scope.filterClass2.length>0){$scope.filteredTotal=$filter("filter")($scope.filteredTotal,function(item){if(searchContains(item.class2,$scope.filterClass2)){return true}return false})}if(!angular.isUndefined($scope.filteredTotal)&&!angular.isUndefined($scope.filterClass3)&&$scope.filterClass3.length>0){$scope.filteredTotal=$filter("filter")($scope.filteredTotal,function(item){if(searchContains(item.class3,$scope.filterClass3)){return true}return false})}if(!angular.isUndefined($scope.filteredTotal)&&!angular.isUndefined($scope.filterSlider)&&$scope.filterSlider.length>0){$scope.filteredTotal=$filter("filter")($scope.filteredTotal,function(item){if(searchContains(item.slider_name,$scope.filterSlider)){return true}return false})}};$scope.preloadNextTab=function(noResults){$scope.countByFilter();var classItem=$scope.filterClass;if(angular.isUndefined($scope["filterLoad"+$scope.filterClass])&&!angular.isUndefined($scope["filterLoad"+$scope.filterClass2])){classItem=$scope.filterClass2}if(angular.isUndefined($scope["filterLoaded"+classItem])){HttpService.getDataUrl($scope["filterLoad"+classItem],"").then(function(response){$scope.safeApply(function(){if(response.data.length==$scope.filteredTotal.length){if(noResults){$scope.safeApply(function(){$scope.isLoading=false;$scope.isSuccessful=true;$scope.more=false;$scope.noresults=true})}
3else{$scope.safeApply(function(){$scope.more=false;$scope.isLoading=false})}}else{for(var i=0;i<response.data.length;i++){if(i>=$scope.filteredTotal.length||response.data[i].id!=$scope.filteredTotal[i].id){if($scope.firstAction&&$scope.firstAction.substr(0,5)=="CLASS"){if(response.data[i].class==$scope.firstAction.substr(5)){$scope.items.push(response.data[i])}}else{$scope.items.push(response.data[i])}}}$timeout(function(){if($scope.firstAction&&$scope.firstAction.substr(0,4)=="SORT"){$scope.items=$filter("orderBy")($scope.items,$scope.firstAction.substr(4),true)}if($scope.filteredTotal.length<$scope.itemsPerPage){$scope.safeApply($scope.starter());$scope.search()}else{$scope.loadData()}})}})})}};$scope.preloadNextTabTag=function(noResults){$scope.countByFilter();if(angular.isUndefined($scope["filterLoadedTag"+$scope.filterTag])){HttpService.getDataUrl($scope["filterLoadTag"+$scope.filterTag],"").then(function(response){$scope.safeApply(function(){$scope["filterLoadedTag"+$scope.filterTag]=true;if(response.data.length==$scope.filteredTotal.length){if(noResults){$scope.safeApply(function(){$scope.isLoading=false;$scope.isSuccessful=true;$scope.more=false;$scope.noresults=true})}else{$scope.safeApply(function(){$scope.more=false;$scope.isLoading=false})}}else{var i2=0;for(var i=0;i<response.data.length;i++){if(i2>=$scope.filteredTotal.length){if($scope.firstAction&&$scope.firstAction.substr(0,5)=="CLASS"){if(response.data[i].class==$scope.firstAction.substr(5)){$scope.items.push(response.data[i]);i2++}}else{$scope.items.push(response.data[i]);i2++}}}
3if($scope.filteredTotal.length<$scope.itemsPerPage){$scope.safeApply($scope.starter());$scope.search()}else{$scope.loadData()}}})})}};$scope.setFilterLink=function(url,blank){window.location.href=url};$scope.setFilterDefault=function(filterData,urlAll,a1,$event){if($event){$event.preventDefault()}if(!angular.isUndefined($scope.onRenderHeaderCountry)){delete $scope.onRenderHeaderCountry;var hashParams=$scope.getHashParams();delete hashParams["country"];$scope.setHashParams(hashParams)}if(!angular.isUndefined($scope.onRenderHeaderTimeZone)){delete $scope.onRenderHeaderTimeZone;var hashParams=$scope.getHashParams();delete hashParams["timeZone"];$scope.setHashParams(hashParams)}$scope.scrollTo($scope.scrollId,"");$scope.filteredSubsection="";$scope.filterMain=true;$scope.filterTag=false;$scope.filterDate=false;$scope.filterClass=false;$scope.filterClass2=false;$scope.filterClass3=false;angular.element("#"+$scope.idData+" .tab a.active").removeClass("active");angular.element("#"+$scope.idData+" .tab a:first").addClass("active");$scope.setHashParams({});if(angular.isUndefined(COMMON.DISABLE_FADES)){angular.element("#content-"+$scope.idData).fadeOut("fast",function(){$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).fadeIn("fast")})}else{angular.element("#content-"+$scope.idData).hide(function(){$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).show()})}return false};$scope.filterSelectSubsection=function(tab,slug){if(!tab&&slug){if(angular.isUndefined($scope.tabsSubsectionsSelect)||angular.isUndefined($scope.tabsSubsectionsSelect[slug])){return}tab=$scope.tabsSubsectionsSelect[slug]}$scope.filteredSubsection=tab;$scope.setFilterTag(tab.slug,"",1);angular.element("#"+$scope.idData+" .tab.subsections-select").addClass("hide-hover");angular.element("#"+$scope.idData+" .tab a.active").removeClass("active");angular.element("#"+$scope.idData+" .tab.subsections-select a:first").addClass("active");$timeout(function(){angular.element("#"+$scope.idData+" .tab.subsections-select").removeClass("hide-hover");$scope.noFirstScroll=false},500)};$scope.setFilterClass=function(filterClass,urlAll,maintainFilters,$event){if($event){$event.preventDefault()}if($scope.filterClass&&filterClass){$rootScope.gaEvent("event","filterClass",{filter:filterClass})}$scope.scrollTo($scope.scrollId,"");$scope.filterMain=false;$scope.filterDate=false;$scope.filterTag=false;$scope.filterClass=filterClass;$scope.filterClass2=maintainFilters?$scope.filterClass2:false;$scope.filterClass3=maintainFilters?$scope.filterClass3:false;$timeout(function(){angular.element("#"+$scope.idData+' .tab a[data-tab!="'+filterClass+'"]').removeClass("active");angular.element("#"+$scope.idData+' .tab a[data-tab="'+filterClass+'"]').addClass("active");if(angular.isUndefined(COMMON.DISABLE_FADES)){angular.element("#content-"+$scope.idData).fadeOut("fast",function(){if(urlAll){if(filterClass){$scope["urlLoad"+filterClass]=urlAll}}$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).fadeIn("fast")})}else{angular.element("#content-"+$scope.idData).hide(function(){if(urlAll){if(filterClass){$scope["urlLoad"+filterClass]=urlAll}}$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).show()})}});return false};$scope.setFilterClass2=function(filterClass,urlAll,maintainFilters,$event){if($event){$event.preventDefault()}if($scope.filterClass2&&filterClass){$rootScope.gaEvent("event","filterClass2",{filter:filterClass})}$scope.scrollTo($scope.scrollId,"");$scope.filterMain=false;$scope.filterDate=false;$scope.filterTag=false;$scope.filterClass=maintainFilters?$scope.filterClass:false;$scope.filterClass2=filterClass;$scope.filterClass3=maintainFilters?$scope.filterClass3:false;angular.element("#"+$scope.idData+' .tab a[data-tab!="'+filterClass+'"]').removeClass("active");angular.element("#"+$scope.idData+' .tab a[data-tab="'+filterClass+'"]').addClass("active");if(angular.isUndefined(COMMON.DISABLE_FADES)){angular.element("#content-"+$scope.idData).fadeOut("fast",function(){if(urlAll){if(filterClass){$scope["urlLoad"+filterClass]=urlAll}}$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).fadeIn("fast")})}else{angular.element("#content-"+$scope.idData).hide(function(){if(urlAll){if(filterClass){$scope["urlLoad"+filterClass]=urlAll}}$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).show()})}return false};$scope.setFilterClass3=function(filterClass,urlAll,maintainFilters,$event){if($event){$event.preventDefault()}if($scope.filterClass3&&filterClass){$rootScope.gaEvent("event","filterClass3",{filter:filterClass})}$scope.scrollTo($scope.scrollId,"");$scope.filterMain=false;$scope.filterDate=false;$scope.filterTag=false;$scope.filterClass=false;$scope.filterClass2=false;$scope.filterClass3=filterClass;angular.element("#"+$scope.idData+' .tab a[data-tab!="'+filterClass+'"]').removeClass("active");angular.element("#"+$scope.idData+' .tab a[data-tab="'+filterClass+'"]').addClass("active");if(angular.isUndefined(COMMON.DISABLE_FADES)){angular.element("#content-"+$scope.idData).fadeOut("fast",function(){if(urlAll){if(filterClass){$scope["urlLoad"+filterClass]=urlAll}}$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).fadeIn("fast")})}else{angular.element("#content-"+$scope.idData).hide(function(){if(urlAll){if(filterClass){$scope["urlLoad"+filterClass]=urlAll}}$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).show()})}$rootScope.gaEvent("event","filterClass3",{filter:filterClass});return false};$scope.setFilterSlider=function(filterSlider,urlAll,maintainFilters,$event){if($event){$event.preventDefault()}$scope.scrollTo($scope.scrollId,"");$scope.filterMain=false;$scope.filterDate=false;$scope.filterTag=false;$scope.filterClass=maintainFilters?$scope.filterClass:false;$scope.filterClass2=maintainFilters?$scope.filterClass2:false;$scope.filterClass3=maintainFilters?$scope.filterClass3:false;$scope.filterSlider=filterSlider;if(angular.isUndefined(COMMON.DISABLE_FADES)){angular.element("#content-"+$scope.idData).fadeOut("fast",function(){if(urlAll){if(filterClass){$scope["urlLoad"+filterClass]=urlAll}}$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).fadeIn("fast")})}else{angular.element("#content-"+$scope.idData).hide(function(){if(urlAll){if(filterClass){$scope["urlLoad"+filterClass]=urlAll}}$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).show()})}return false};$scope.checkSearch=function(){if(!angular.isUndefined($scope.searchCheck)){$timeout.cancel($scope.searchCheck)}$scope.searchCheck=$timeout(function(){if(angular.isUndefined($scope.searchFilter)){$scope.setFilterSearch("")}},300)};$scope.setSearch=function(maintainFilters,maintainDate,clearFilters){var elm=angular.element(event.srcElement);if(event.keyCode==13){$scope.setFilterSearch(elm[0].value)}else{if(!angular.isUndefined($scope.timeoutSearch)){$timeout.cancel($scope.timeoutSearch)}$scope.timeoutSearch=$timeout(function(){if(elm[0].value.length<1){if(!angular.isUndefined($scope.timeoutSearch2)){$timeout.cancel($scope.timeoutSearch2)}$scope.timeoutSearch2=$timeout(function(){$scope.setFilterSearch("")},300)}else if(elm[0].value.length>2&&elm[0].value!=$scope.query){if(!angular.isUndefined($scope.timeoutSearch2)){$timeout.cancel($scope.timeoutSearch2)}$scope.timeoutSearch2=$timeout(function(){$scope.setFilterSearch(elm[0].value)},300)}},200)}};$scope.setFilterSearch=function(filterSearch){$scope.filterMain=false;$scope.filterDate=false;$scope.filterTag=false;$scope.filterClass=false;$scope.filterClass2=false;$scope.filterClass3=false;if(!filterSearch){$scope.query=undefined}else{$scope.query=filterSearch}$scope.filteredSearch=true;angular.element("#"+$scope.idData+" .tab a.active").removeClass("active");angular.element("#"+$scope.idData+" .tab:first-child a").addClass("active");if(angular.isUndefined(COMMON.DISABLE_FADES)){angular.element("#content-"+$scope.idData).fadeOut("fast",function(){$scope.s
3afeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).fadeIn("fast")})}else{angular.element("#content-"+$scope.idData).hide(function(){$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).show()})}return false};$scope.setFilterAlways=function($event,filterAlways){var checkedbox=false;if($event){var checkbox=$event.target;checkedbox=checkbox.checked}else{var checkedbox=true}$scope.scrollTo($scope.scrollId,"");$scope.filterAlways=false;$scope.filterAlwaysField=false;if(checkedbox==true){var exp=filterAlways.split(",");$scope.filterAlwaysField=exp[2];if(typeof exp[3]!="undefined"&&exp[3]=="user"){if($rootScope.currentUser[exp[1]]){$scope.filterAlways=$rootScope.currentUser[exp[1]]}}else{$scope.filterAlways=exp[1]}}if(angular.isUndefined(COMMON.DISABLE_FADES)){angular.element("#content-"+$scope.idData).fadeOut("fast",function(){$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).fadeIn("fast")})}else{angular.element("#content-"+$scope.idData).hide(function(){$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).show()})}return false};$scope.setFilterTag=function(filterTag,urlAll,noReset){if(!noReset&&!angular.isUndefined($scope.onRenderHeaderCountry)){delete $scope.onRenderHeaderCountry;var hashParams=$scope.getHashParams();delete hashParams["country"];$scope.setHashParams(hashParams)}if(!noReset&&!angular.isUndefined($scope.onRenderHeaderTimeZone)){delete $scope.onRenderHeaderTimeZone;var hashParams=$scope.getHashParams();delete hashParams["timeZone"];$scope.setHashParams(hashParams)}$scope.filterMain=false;$scope.filterDate=false;$scope.filterTag=filterTag;$scope.filterClass=false;$scope.filterClass2=false;$scope.filterClass3=false;if(angular.isUndefined(COMMON.DISABLE_FADES)){angular.element("#content-"+$scope.idData).fadeOut("fast",function(){if(urlAll){if(filterTag){$scope["urlLoadTag"+filterTag]=urlAll}}$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).fadeIn("fast")})}else{angular.element("#content-"+$scope.idData).hide(function(){if(urlAll){if(filterTag){$scope["urlLoadTag"+filterTag]=urlAll}}$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).show()})}return false};$scope.setFilterDate=function(filterDate,urlAll){$scope.filterMain=false;$scope.filterTag=false;$scope.filterClass=false;$scope.filterDate=filterDate;$scope.filterClass2=false;$scope.filterClass3=false;if(angular.isUndefined(COMMON.DISABLE_FADES)){angular.element("#content-"+$scope.idData).fadeOut("fast",function(){if(urlAll){if(filterClass){$scope["urlLoad"+filterClass]=urlAll}$scope.countByFilter();if($scope.filteredTotal.length<$scope.itemsPerPage){$scope["filterLoad"+filterClass]=urlAll;$scope.preloadNextTab()}}$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).fadeIn("fast")})}else{angular.element("#content-"+$scope.idData).hide(function(){if(urlAll){if(filterClass){$scope["urlLoad"+filterClass]=urlAll}$scope.countByFilter();if($scope.filteredTotal.length<$scope.itemsPerPage){$scope["filterLoad"+filterClass]=urlAll;$scope.preloadNextTab()}}$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).show()})}return false};$scope.setFilterDateNow=function($event,filterDateNow,force){var checkedbox=false;if($event){var checkbox=$event.target;if($scope.firstAction&&$scope.firstAction=="DATENOW"){if(checkbox.checked){checkedbox=false}else{checkedbox=true}}else{checkedbox=checkbox.checked}}else{var checkedbox=true}$scope.scrollTo($scope.scrollId,"");$scope.filterMain=false;$scope.filterDateAlways=false;if(checkedbox==true){$scope.filterDateAlways=filterDateNow}if(angular.isUndefined(COMMON.DISABLE_FADES)){angular.element("#content-"+$scope.idData).fadeOut("fast",function(){$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).fadeIn("fast")})}else{angular.element("#content-"+$scope.idData).hide(function(){$scope.s
3afeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).show()})}return false};$scope.scrollTo=function(dataslide,plus){if($scope.noFirstScroll){$scope.noFirstScroll=false;return}if(!angular.isUndefined($rootScope.disableOtherScrolls)){return}plus=plus?plus:0;if(document.getElementById(dataslide)){$("html,body").animate({scrollTop:$("#"+dataslide).offset().top-plus},700,"")}};$scope.show_plus=function(item){if(angular.isUndefined(item.show_plus)){item.show_plus=true}else if(item.show_plus==true){item.show_plus=false}else{item.show_plus=true}};$scope.show_hide_text=function(item){if(angular.isUndefined(item.show_text)){item.show_text=true}else if(item.show_text==true){item.show_text=false}else{item.show_text=true}};$scope.get_plus_icon=function(item){var icon="icon-plus";if(!angular.isUndefined(item.show_plus)&&item.show_plus==true){icon="icon-minus"}return icon};$scope.groupFilter=function(item){var itemIndex=$scope.pagedItemsLoaded.indexOf(item);var ok=false;angular.forEach($scope.groupFilters,function(el,key){if(el[0]-1==itemIndex){item.groupItemNumber=key+1;item.idx=itemIndex;ok=item}});return ok};$scope.showGroupByIndex=function(groupItem,item){};$scope.groupFilterItems=function(item){var returnItems=[];var idxFrom="";var idxTo="";var itemIndex=$scope.pagedItemsLoaded.indexOf(item);angular.forEach($scope.groupFilters,function(el){if(el[0]-1==itemIndex){idxFrom=itemIndex+1;idxTo=el[1]}});if(idxFrom&&idxTo){var ix=1;angular.forEach($scope.items,function(item,idx){if(idx+1>=idxFrom&&idx+1<=idxTo){item.itemNumber=ix;ix++;returnItems.push(item)}})}return returnItems};$scope.groupByFilterItems=function(filterItem){var returnItems=[];angular.forEach($scope.filteredItems,function(item){if(item[$scope.groupBy]==filterItem[$scope.groupBy]){returnItems.push(item)}});return returnItems};$scope.groupFilterItemsByIdGroup=function(groupId){var returnItems=[];var idxFrom="";var idxTo="";angular.forEach($scope.groupFilters,function(el,key){if(key+1==groupId){idxFrom=el[0];idxTo=el[1]}});if(idxFrom&&idxTo){var ix=1;angular.forEach($scope.items,function(item,idx){if(idx+1>=idxFrom&&idx+1<=idxTo){item.itemNumber=ix;ix++;returnItems.push(item)}})}return returnItems};$scope.getAllGroups=function(addGroups){var allGroups=[];var lastGroup="";angular.forEach($scope.groupFilters,function(el,key){lastGroup=(key+1)*1;allGroups.push(lastGroup)});if(addGroups){for(var i=0;i<addGroups;i++){lastGroup=lastGroup+1;allGroups.push(lastGroup)}}return allGroups};$scope.getIndex=function(item){return $scope.pagedItemsLoaded.indexOf(item)};$scope.owlReloadOnFirstPage=function(){var owl=$($scope.scrollId+" .owl-carousel");console.log("owl");var owlParams=angular.fromJson(owl.attr("owl-properties"));owl.owlCarousel(owlParams);owl.on("changed.owl.carousel",function(e){var total=e.relatedTarget.items().length-1;var current=e.item.index;var currentIndex=e.item.index-e.relatedTarget._clones.length/2;if(currentIndex==total){var src=$(e.target).find(".owl-item").eq(currentIndex);$timeout(function(){owl.trigger("next.owl.carousel",1e3)},1e3)}if(currentIndex<1){$scope.newItems=[];HttpService.getDataUrl($scope.url,[]).then(function(response){$scope.safeApply(function(){if(!angular.isUndefined(response.data.filters)){$scope.allFilters=response.data.filters}if(!angular.isUndefined(response.data.items)){var responseItems=response.data.items}else{var responseItems=response.data}if(!angular.isUndefined(responseItems[1])&&$scope.items[1]){if(responseItems[1].id!=$scope.items[1].id&&responseItems[10].id!=$scope.items[10].id){angular.forEach(responseItems,function(item){$scope.newItems.push(item)});$timeout(function(){$scope.items=$scope.newItems},1e3)}}})})}})};$scope.openModalPreview=function(contentHtml){$rootScope.previewContentHtml=contentHtml;$rootScope.openModalClass("modal-general","","","","","<content-preview width=\"'100%'\" height=\"'500'\"></content-preview>")};if($scope.filterHash){$rootScope.$on("site:hashChanged",function(evt,opt){var oldParam="";var newParam="";var oldHash=$scope.parseParams(opt.oldURL.replace(/[^#]+(#.+)/,"$1").substring(1).split("&"));var newHash=$scope.parseParams(opt.newURL.replace(/[^#]+(#.+)/,"$1").substring(1).split("&"));var splitFilter=$scope.filterHash.split("|");if(splitFilter.length>=1){angular.forEach(splitFilter,function(filt){if(!angular.isUndefined(oldHash[filt])){oldParam=oldHash[filt]}if(!angular.isUndefined(newHash[filt])){newParam=newHash[filt]}if(oldParam!=newParam){if(filt=="date"){$scope.setFilterClass3(newParam)}else if(filt=="class2"){$scope.setFilterClass2(newParam)}else if(filt=="country"){if(newParam){$scope.filterSelectSubsection("",newParam)}}else if($scope.extraTabs.length>0){angular.forEach($scope.extraTabs,function(extraTab){if(extraTab.name==splitFilter[0]&&extraTab.items.length>0){angular.forEach(extraTab.items,function(tab){if(tab.hash==newParam){$scope.tabAction(tab)}})}})}}})}else{if(!angular.isUndefined(oldHash[$scope.filterHash])){oldParam=oldHash[$scope.filterHash]}if(!angular.isUndefined(newHash[$scope.filterHash])){newParam=newHash[$scope.filterHash]}if(oldParam!=newParam){if($scope.filterHash=="date"){$scope.setFilterClass3(newParam)}else if($scope.extraTabs.length>0){angular.forEach($scope.extraTabs,function(extraTab){if(extraTab.name==splitFilter[0]&&extraTab.items.length>0){angular.forEach(extraTab.items,function(tab){if(tab.hash==newParam){$scope.tabAction(tab)}})}})}}}})}$scope.parseParams=function(params){var paramsArray={};angular.forEach(params,function(h){var h2=h.split("=");if(h2.length==2){paramsArray[h2[0]]=h2[1]}else{paramsArray[h2[0]]=true}});return paramsArray};$rootScope.currentArticleVideoAPIReady=function(API){$rootScope.currentArticleVideoAPI=API};$scope.openArticle=function(item){$rootScope.currentArticle=item.data;$rootScope.gaEvent("event","openArticle",{article:item.title});
3$rootScope.openModalClass("modal-current-article","","","modal-current-article");angular.element("#modal-current-article").addClass("overlay-"+$scope.idData);$rootScope.$on("site:modal-close-modal-current-article",function(){$timeout(function(){if(angular.element("#modal-current-article .fotorama").length){angular.element("#modal-current-article .fotorama").data("fotorama").destroy()}$rootScope.currentArticle={};angular.element("#modal-current-article").removeClass("overlay-"+$scope.idData)})});$rootScope.currentArticle.showVideoPlayer=false;$timeout(function(){if(angular.element("#modal-current-article .fotorama").length){angular.element("#modal-current-article .fotorama").fotorama()}else if(!angular.isUndefined($rootScope.currentArticle.media)){if($rootScope.currentArticle.media.length==1&&$rootScope.currentArticle.media[0].type=="video"){$rootScope.currentArticle.media[0].videoData=$scope.findVideoId($rootScope.currentArticle.media[0].video);var showMediaElementControls=true;if($rootScope.currentArticle.media[0].videoData){$rootScope.currentArticle.media[0].videoType="video/"+$rootScope.currentArticle.media[0].videoData.type;showMediaElementControls=false}else{$rootScope.currentArticle.media[0].videoType="video/mp4"}$rootScope.currentArticle.media[0].videoType=!$rootScope.currentArticle.media[0].videoData?"video/mp4":"video/"+$rootScope.currentArticle.media[0].videoData.type;$timeout(function(){$rootScope.currentArticle.showVideoPlayer=true;if($rootScope.currentArticle.media[0].type=="video"){$timeout(function(){var idVideo=document.querySelector("#modal-current-article .video-player-container video").id;var width=$("#modal-current-article .video-player-container").width();var height=$("#modal-current-article .video-player-container").width()*9/16;$("#modal-current-article .video-player-container").height(height);new MediaElementPlayer(idVideo,{volume:100,pauseOtherPlayers:false,alwaysShowControls:showMediaElementControls,width:width,height:height,youtube:{iv_load_policy:3,modestbranding:0,autoplay:1,controls:!showMediaElementControls,showinfo:0,wmode:"opaque",branding:0,autohide:1,playsinline:1},success:function(mediaElement,domObject){$("#"+idVideo+" iframe").width("100%").height("100%")}})})}},500)}else if($rootScope.currentArticle.media.length>1&&$rootScope.currentArticle.media[1].type=="video"){$rootScope.currentArticle.media[1].videoData=$scope.findVideoId($rootScope.currentArticle.media[1].video);var showMediaElementControls=true;if($rootScope.currentArticle.media[1].videoData){$rootScope.currentArticle.media[1].videoType="video/"+$rootScope.currentArticle.media[1].videoData.type;showMediaElementControls=false}else{$rootScope.currentArticle.media[1].videoType="video/mp4"}$rootScope.currentArticle.media[1].videoType=!$rootScope.currentArticle.media[1].videoData?"video/mp4":"video/"+$rootScope.currentArticle.media[1].videoData.type;$timeout(function(){$rootScope.currentArticle.showVideoPlayer=true;if($rootScope.currentArticle.media[1].type=="video"){$timeout(function(){var idVideo=document.querySelector("#modal-current-article .video-player-container video").id;var width=$("#modal-current-article .video-player-container").width();var height=$("#modal-current-article .video-player-container").width()*9/16;$("#modal-current-article .video-player-container").height(height);new MediaElementPlayer(idVideo,{volume:100,pauseOtherPlayers:false,alwaysShowControls:showMediaElementControls,width:width,height:height,youtube:{iv_load_policy:3,modestbranding:0,autoplay:1,controls:!showMediaElementControls,showinfo:0,wmode:"opaque",branding:0,autohide:1,playsinline:1},success:function(mediaElement,domObject){$("#"+idVideo+" iframe").width("100%").height("100%")}})})}},500)}}},500)};$scope.getProtocol=function(){$scope.getProtocol.p=$scope.getProtocol.p||(location.protocol==="https:"?"https://":"http://");return $scope.getProtocol.p};$scope.parseHref=function(href){var a=document.createElement("a");a.href=href;return a};$scope.findVideoId=function(href,forceVideo){if(typeof href!=="string")return href;var href=$scope.parseHref(href);var id,type;if(href.host.match(/youtube\.com/)&&href.search){id=href.search.split("v=")[1];if(id){var ampersandPosition=id.indexOf("&");if(ampersandPosition!==-1){id=id.substring(0,ampersandPosition)}type="youtube"}else{id=href.pathname.split("embed/")[1];if(id){type="youtube"}}}else if(href.host.match(/youtube\.com|youtu\.be/)){id=href.pathname.replace(/^\/(embed\/|v\/)?/,"").replace(/\/.*/,"");type="youtube"}else if(href.host.match(/vimeo\.com/)){type="vimeo";id=href.pathname.replace(/^\/(video\/)?/,"").replace(/\/.*/,"")}if((!id||!type)&&forceVideo){id=href.href;type="custom"}return id?{id:id,type:type,s:href.search.replace(/^\?/,""),p:$scope.getProtocol()}:false}};$rootScope.openItemOverlay=function(modalId,item){$timeout(function(){$rootScope.overlayData=item;$rootScope.openModalClass(modalId,"","","","","","",1);$timeout(function(){if(angular.element("#"+modalId+" videogular").length){angular.element("#"+modalId+" videogular vg-media").height(angular.element("#"+modalId+" videogular vg-media").width()*9/16)}})})};$rootScope.openItemIdOverlay=function(modalId,itemId){var itemResults=$filter("filter")($scope.items,{id:itemId},true);if(itemResults.length==1){$rootScope.openItemOverlay(modalId,itemResults[0])}};$scope.initLayoutTabs=function(){$scope.currentTab="";$scope.showTab=function(tab,hash){$scope.currentTab=tab;$rootScope.gaEvent("event","showTab",{tab:hash})};
3$scope.safeApply(function(){$scope.currentTab=1});$scope.$watch("currentTab",function(newTab){if(typeof window["mainTabChange"]=="function"){mainTabChange(newTab)}})}}]);"use strict";function collectResetOnHideFields(fields,result){result=result||[];angular.forEach(fields,function(field){if(!field)return;var resetOnHide=field.data&&field.data.resetOnHide;if(field.key&&field.hideExpression&&resetOnHide===true){result.push(field)}if(field.fieldGroup){collectResetOnHideFields(field.fieldGroup,result)}if(field.repeatSection&&field.repeatSection.templateOptions){collectResetOnHideFields(field.repeatSection.templateOptions.fields,result)}});return result}function setupResetOnHideWatchers($scope,model,fields){var resetFields=collectResetOnHideFields(fields);angular.forEach(resetFields,function(field){$scope.$watch(function(){return $scope.$eval(field.hideExpression,{model:model})},function(isHidden,wasHidden){if(isHidden&&!wasHidden){var keys=field.key.split(".");var modelRef=model;for(var i=0;i<keys.length-1;i++){if(!modelRef[keys[i]])return;modelRef=modelRef[keys[i]]}modelRef[keys[keys.length-1]]=undefined}})})}angular.module("dropzone",[]).directive("dropzone",function(){return function(scope,element,attrs){var config,dropzone;config=scope.to;dropzone=new Dropzone(element[0],config.options);angular.forEach(config.eventHandlers,function(handler,event){dropzone.on(event,function(file,v2,v3){eval(handler)})})}});angular.module("Forms",["services.HttpService","directives.spinner","directives.resizables","ngSanitize","Scope.safeApply","formly","formlyBootstrap","dropzone","base64","passStrengthService"],function config(formlyConfigProvider){var unique=1;formlyConfigProvider.setWrapper([{template:["<formly-transclude></formly-transclude>",'<div class="validation"',' ng-if="showError"',' ng-messages="fc.$error">',' <div ng-message="{{::name}}" ng-repeat="(name, message) in ::options.validation.messages">'," {{message(fc.$viewValue, fc.$modelValue, this)}}"," </div>","</div>"].join(" ")},{name:"panel",template:' <div class="panel panel-primary"> <div class="panel-heading px-nested-panel-heading clearfix"> <strong class="control-label" ng-if="options.templateOptions.label"> {{options.templateOptions.label}} </strong> </div> <div class="panel-body px-nested-panel-body"> <formly-transclude></formly-transclude> </div> </div>'}]);formlyConfigProvider.setType([{name:"separator",template:'<div class="separator {{options.templateOptions.field}}" dynamic="options.templateOptions.label"></div>'},{name:"userImage",template:'<div class="user-image {{options.templateOptions.field}}"><div class="images-preview"><div class="dz-image-preview"><span class="preview"><img ng-src="{{currentUser.avatarImage}}"></span></div></div></div>',controller:["$scope","$rootScope",function controller($scope,$rootScope){$scope.currentUser=$rootScope.currentUser}]},{name:"dropzone",template:'<div dropzone="dropzoneConfig" class="drop-zone" ng-model="model[options.key]" ng-if="!to.disabled"> <div class="dz-message needsclick" dynamic="options.templateOptions.placeholder"></div> </div>',wrapper:["bootstrapLabel","bootstrapHasError"]},{name:"recaptcha3",template:""},{name:"ui-select-single",template:'<div class="form-group "><div><label class="control-label ">{{options.templateOptions.label}}</label> <ui-select data-ng-model="model[options.key]" ng-disabled="{{to.disabled}}" theme="bootstrap"> <ui-select-match placeholder="{{options.templateOptions.placeholder}}">{{$select.selected[to.labelProp]}}</ui-select-match> <ui-select-choices repeat="option in to.options" data-refresh="to.refresh(to, $select.search, options)" refresh-delay="{{to.refreshDelay}}"> <div ng-bind-html="option[to.labelProp]">{{to.labelProp}}</div> <div><small>{{option.geometry.location.lat}}, {{option.geometry.location.lng}}</small></div> </ui-select-choices> </ui-select> </div></div>'},{name:"comboDatepicker",template:` <div class="form-group ">\n <div class="controls">\n <label class="control-label " ng-if="options.templateOptions.label">
3\n <span ng-bind-html="options.templateOptions.label" ng-if="!options.templateOptions.tooltip"></span>\n <span ng-bind-html="options.templateOptions.label" \n tooltip-placement="top-left" \n uib-tooltip-html="'{{options.templateOptions.tooltip}}'" \n ng-if="to.tooltip">\n </span>\n \n <span class="fld-require" ng-if="options.templateOptions.required">*</span>\n </label> {{to.placeholderSelects}}\n <ng-combo-date-picker theme="bootstrap" ng-model="model[options.key]" ng-year-order="{{to.yearOrder}}" ng-min-date="{{to.minDate}}" ng-max-date="{{to.maxDate}}" ng-order="{{to.dateOrder}}" ng-placeholder="{{to.placeholderOptions}}" ng-months="{{to.months}}" ng-disabled="{{to.disabled}}"></ng-combo-date-picker> </div>\n </div>`},{name:"select-search",template:'<div class="form-group "><div><label class="control-label " ng-if="options.templateOptions.label"><span ng-bind-html="options.templateOptions.label" ng-if="!options.templateOptions.tooltip"></span><span ng-bind-html="options.templateOptions.label" tooltip-placement="top-left" uib-tooltip-html="\'{{options.templateOptions.tooltip}}\'" ng-if="to.tooltip"></span>\n <span class="fld-require" ng-if="options.templateOptions.required">*</span></label> <ui-select data-ng-model="model[options.key]" ng-disabled="{{to.disabled}}" theme="bootstrap"> <ui-select-match placeholder="{{options.templateOptions.placeholder}}">{{$select.selected[to.labelProp]}}</ui-select-match> <ui-select-choices repeat="option in to.options" data-refresh="to.refresh(to, $select.search, options)" refresh-delay="{{to.refreshDelay}}"> <div ng-bind-html="option[to.labelProp]">{{to.labelProp}}</div> </ui-select-choices> </ui-select> </div></div>'},{name:"select-group-search",template:'<div class="form-group "><div><label class="control-label ">{{options.templateOptions.label}}</label> <ui-select data-ng-model="model[options.key]" ng-disabled="{{to.disabled}}" theme="bootstrap"> <ui-select-match allow-clear="{{to.allowClear}}" placeholder="{{options.templateOptions.placeholder}}">{{$select.selected[[to.labelProp]]}}</ui-select-match> <ui-select-choices group-by="to.groupProp" repeat="option in to.options | filter: $select.search"> <div ng-bind-html="option[to.labelProp] | highlight: $select.search"></div> </ui-select-choices> </ui-select> </div></div>'},{name:"single-suggest",template:'<div class="form-group "><span><label class="control-label " ng-if="options.templateOptions.label"><span ng-bind-html="options.templateOptions.label" ng-if="!options.templateOptions.tooltip"></span><span ng-bind-html="options.templateOptions.label" tooltip-placement="top-left" uib-tooltip-html="\'{{options.templateOptions.tooltip}}\'" ng-if="to.tooltip"></span>\n <span class="fld-require" ng-if="options.templateOptions.required">*</span></label> <ui-select data-ng-model="model[options.key]" ng-disabled="{{to.disabled}}" theme="bootstrap"> <ui-select-match placeholder="{{options.templateOptions.placeholder}}">{{$select.selected[to.labelProp]}}</ui-select-match> <ui-select-choices repeat="option in to.options" data-refresh="to.refresh(to, $select.search, options)" refresh-delay="{{to.refreshDelay}}" minimum-input-length="{{to.minimumInputLength}}" ui-disable-choice="!option[\'success\'] || option[\'title\']"> <div ng-if="option[\'title\']" ng-bind-html="option[\'title\']"></div> <div ng-if="!option[\'title\']" ng-bind-html="option[to.labelProp]">{{to.labelProp}}</div>
3 <span ng-if="!option[\'title\']" ng-class="option[\'success\'] ? \'ok\' : \'error\'" ng-bind-html="option[\'message\']"></span> </ui-select-choices> </ui-select> </div></div>',apiCheck:function apiCheck(check){return{templateOptions:{options:check.arrayOf(check.object),labelProp:check.string.optional,valueProp:check.string.optional}}},defaultOptions:{noFormControl:false,ngModelAttrs:{required:{attribute:"",bound:""}}},controller:["$scope",function controller($scope){var to=$scope.to;var opts=$scope.options;$scope.$watch("to.options",function optionsWatcher(newOptionsValues){if(newOptionsValues.length==1){setModel(opts.key)}});function setModel(){$scope.model[opts.key]=to.options[0]}}]},{name:"image-crop",template:'<div class="form-control form-drop-files"> <div class="cropArea"> <img-crop image="myImage" result-image="myCroppedImage"></img-crop> </div><input type="file" ng-model="model[options.key]" ng-class="{\'has-image\': myImage}"/> <div style="margin-bottom:20px;"> <button type="button" class="btn btn-sm btn-danger" ng-click="resetImage()" ng-if="myImage">X</button> </div> </div>',wrapper:["bootstrapLabel","bootstrapHasError"],defaultOptions:{noFormControl:false,ngModelAttrs:{required:{attribute:"",bound:""}}},apiCheck:function apiCheck(check){return{templateOptions:{label:check.string.optional,required:check.bool.optional,labelSrOnly:check.bool.optional}}},controller:["$scope","$timeout",function controller($scope,$timeout){var to=$scope.to;var opts=$scope.options;$scope.myImage="";$scope.compressedImage="";$scope.myCroppedImage="";var handleFileSelect=function(evt){var file=evt.currentTarget.files[0];var reader=new FileReader;reader.onload=function(evt){$scope.$apply(function($scope){$scope.myImage=evt.target.result})};reader.readAsDataURL(file)};$timeout(function(){angular.element(document.getElementById($scope.id)).on("change",handleFileSelect)},500);$scope.resetImage=function resetImage(){angular.element(document.getElementById($scope.id)).val(null);$scope.myImage="";$scope.compressedImage="";$scope.myCroppedImage="";$timeout(function(){$scope.model[opts.key]="";if($scope.to.required){$scope.fc.$setValidity("required",true)}})};var compressImage=function compressImage(src,newX,newY){return new Promise(function(res,rej){var img=new Image;img.src=src;img.onload=function(){var elem=document.createElement("canvas");elem.width=newX;elem.height=newY;var ctx=elem.getContext("2d");ctx.drawImage(img,0,0,newX,newY);var data=ctx.canvas.toDataURL();res(data)};img.onerror=function(error){return rej(error)}})};$scope.$watch("myCroppedImage",function(img){if(img.length>2e3){compressImage(img,1e3,1e3).then(function(compressed){$timeout(function(){$scope.model[opts.key]=compressed;if($scope.to.required){$scope.fc.$setValidity("required",true)}})})}});function checkValidity(expressionValue){var valid;if($scope.to.required){var isValid=false;valid=$scope.model[opts.key]&&$scope.model[opts.key].length>0?true:false;$scope.fc.$setValidity("required",valid)}}if($scope.to.required){var unwatchFormControl=$scope.$watch("fc",function(newValue){if(!newValue){return}checkValidity(true);unwatchFormControl()})}}]},{name:"multiCheckTexts",template:'<div class="radio-group"> <div class="checkbox" ng-if="to.noneFirst" > <label> <input type="checkbox" id="{{id + \'_\'+ $index}}" ng-model="multiCheckbox.noCheck" ng-change="multiCheckbox.all()"> {{to.noneFirst}} </label> </div> <div ng-repeat="(key, option) in to.options" class="checkbox"> <label> <input type="checkbox" id="{{id + \'_\'+ $index}}" ng-model="multiCheckbox.checked[$index]" ng-change="multiCheckbox.change($index)"> {{option[to.labelProp || \'name\']}} </label> <textarea class="form-control" ng-model="multiCheckbox.checkedtext[key]" ng-change="multiCheckbox.specify()" ng-if="multiCheckbox.checked[$index]" placeholder="{{option[to.labelProp || \'placeholder\']}}"></textarea> </div> <div class="checkbox" ng-if="to.none" > <label> <input type="checkbox" id="{{id + \'_\'+ $index}}" ng-model="multiCheckbox.noCheck" ng-change="multiCheckbox.all()"> {{to.none}} </label> </div> </div>',wrapper:["bootstrapLabel","bootstrapHasError"],apiCheck:function apiCheck(check){return{templateOptions:{options:check.arrayOf(check.object),labelProp:check.string.optional,valueProp:check.string.optional}}},defaultOptions:{noFormControl:false,ngModelAttrs:{required:{attribute:"",bound:""}}},controller:["$scope",function controller($scope){var to=$scope.to;var opts=$scope.options;$scope.multiCheckbox={checked:[],checkedtext:[],noCheck:false,change:setModel,specify:setSpecify,all:setAll};$scope.$watch("model",function modelWatcher(newModelValue){var modelValue,valueProp;if(Object.keys(newModelValue).length){modelValue=newModelValue[opts.key];$scope.$watch("to.options",function optionsWatcher(newOptionsValues){if(newOptionsValues&&Array.isArray(newOptionsValues)&&Array.isArray(modelValue)){valueProp=to.valueProp||"value";for(var index=0;
3index<newOptionsValues.length;index++){$scope.multiCheckbox.checked[index]=modelValue.indexOf(newOptionsValues[index][valueProp])!==-1;$scope.multiCheckbox.checkedtext[index]=""}var hasData=false;for(var index=0;index<modelValue.length;index++){for(var idx=0;idx<newOptionsValues.length;idx++){if(newOptionsValues[idx][valueProp]==modelValue[index]){if(!angular.isUndefined($scope.multiCheckbox.checkedtext[idx])){$scope.multiCheckbox.checkedtext[idx]=modelValue[index+1]}}}if(!angular.isObject(modelValue[index])&&modelValue[index].substr(-4,4)=="none"){$scope.multiCheckbox.noCheck=true}}}})}},true);function checkValidity(expressionValue){var valid;if($scope.to.required){var isValid=false;if(angular.isArray($scope.model[opts.key])&&$scope.model[opts.key].length>0){isValid=true;for(var index=0;index<$scope.model[opts.key].length;index++){if($scope.model[opts.key][index].length==0){isValid=false}}}valid=(isValid||$scope.multiCheckbox.noCheck)&&expressionValue;$scope.fc[0].$setValidity("required",valid)}}function setAll(){if($scope.multiCheckbox.noCheck==true){$scope.model[opts.key]=[];$scope.model[opts.key].push(to.noneKey);$scope.multiCheckbox.checked=[]}else{$scope.model[opts.key]=[]}$scope.fc[0].$setTouched();checkValidity(true)}function setModel(idx){$scope.model[opts.key]=[];angular.forEach($scope.multiCheckbox.checked,function(checkbox,index){if(checkbox){$scope.multiCheckbox.noCheck=false;$scope.model[opts.key].push(to.options[index][to.valueProp||"value"]);if(!angular.isUndefined($scope.multiCheckbox.checkedtext[index])){$scope.model[opts.key].push($scope.multiCheckbox.checkedtext[index])}}});$scope.fc[0].$setTouched();checkValidity(true);if($scope.to.onChange){$scope.to.onChange()}}function setSpecify(){$scope.model[opts.key]=[];angular.forEach($scope.multiCheckbox.checked,function(checkbox,index){if(checkbox){$scope.model[opts.key].push(to.options[index][to.valueProp||"value"]);if(!angular.isUndefined($scope.multiCheckbox.checkedtext[index])){$scope.model[opts.key].push($scope.multiCheckbox.checkedtext[index])}}});$scope.fc[0].$setTouched();checkValidity(true);if($scope.to.onChange){$scope.to.onChange()}}if(opts.expressionProperties&&opts.expressionProperties["templateOptions.required"]){$scope.$watch(function(){return $scope.to.required},function(newValue){checkValidity(newValue)})}if($scope.to.required){var unwatchFormControl=$scope.$watch("fc",function(newValue){if(!newValue){return}checkValidity(true);unwatchFormControl()})}}]},{name:"multiCheckRadios",template:'<div class="radio-group"> <div class="checkbox" ng-if="to.noneFirst" > <label> <input type="checkbox" id="{{id + \'_\'+ $index}}" ng-model="multiCheckbox.noCheck" ng-change="multiCheckbox.all()"> {{to.noneFirst}} </label> </div> <div ng-repeat="(key, option) in to.options" class="checkbox" ng-init="parentIndex = $index"> <label> <input type="checkbox" id="{{id + \'_\'+ $index}}" ng-model="multiCheckbox.checked[$index]" ng-change="multiCheckbox.change($index)"> {{option[to.labelProp || \'name\']}} </label> <div ng-repeat="(key, option) in to.suboptions" ng-class="{ \'radio\': !to.inline, \'radio-inline\': to.inline }" ng-if="multiCheckbox.checked[$parent.$index] && !multiCheckbox.other[$parent.$index]"> <label> <input type="radio" id="{{id + \'_\'+ parentIndex + \'_\'+$index}}" name="{{id + \'_\'+ parentIndex}}" ng-value="option[to.valueProp || \'value\']" ng-model="multiCheckbox.checkedRadio[parentIndex]" ng-change="multiCheckbox.changeRadio(parentIndex)"> {{option[to.labelProp || \'name\']}} </label> </div> <textarea class="form-control" ng-model="multiCheckbox.checkedText[parentIndex]" ng-change="multiCheckbox.change(parentIndex)" ng-if="multiCheckbox.checked[parentIndex] && multiCheckbox.other[parentIndex]" placeholder="{{option[to.labelProp || \'placeholder\']}}"></textarea> </div> <div class="checkbox" ng-if="to.none" > <label> <input type="checkbox" id="{{id + \'_\'+ $index}}" ng-model="multiCheckbox.noCheck" ng-change="multiCheckbox.all()"> {{to.none}} </label> </div> </div>',wrapper:["bootstrapLabel","bootstrapHasError"],apiCheck:function apiCheck(check){return{templateOptions:{options:check.arrayOf(check.object),labelProp:check.string.optional,valueProp:check.string.optional}}},defaultOptions:{noFormControl:false,ngModelAttrs:{required:{attribute:"",bound:""}}},controller:["$scope",function controller($scope){var to=$scope.to;var opts=$scope.options;$scope.multiCheckbox={checked:[],checkedRadio:[],checkedText:[],noCheck:false,change:setModel,changeRadio:setModel,changeText:setModel,all:setAll,other:[]};$scope.$watch("model",function modelWatcher(newModelValue){var modelValue,valueProp;if(Object.keys(newModelValue).length){modelValue=newModelValue[opts.key];$scope.$watch("to.options",function optionsWatcher(newOptionsValues){if(newOptionsValues&&Array.isArray(newOptionsValues)&&Array.isArray(modelValue)){valueProp=to.valueProp||"value";for(var index=0;
3index<newOptionsValues.length;index++){$scope.multiCheckbox.checked[index]=modelValue.indexOf(newOptionsValues[index][valueProp])!==-1;$scope.multiCheckbox.checkedRadio[index]="";$scope.multiCheckbox.checkedText[index]=""}for(var index=0;index<modelValue.length;index++){for(var idx=0;idx<newOptionsValues.length;idx++){if(newOptionsValues[idx][valueProp]==modelValue[index]){if(modelValue[index].substr(-5,5)=="other"){if(!angular.isUndefined($scope.multiCheckbox.checkedText[idx])){$scope.multiCheckbox.checkedText[idx]=modelValue[index+1]}$scope.multiCheckbox.other[idx]=true}else{if(!angular.isUndefined($scope.multiCheckbox.checkedRadio[idx])){$scope.multiCheckbox.checkedRadio[idx]=modelValue[index+1]}}}}if(!angular.isObject(modelValue[index])&&modelValue[index].substr(-4,4)=="none"){$scope.multiCheckbox.noCheck=true}}}})}},true);function checkValidity(expressionValue){var valid;if($scope.to.required){var isValid=false;if(angular.isArray($scope.model[opts.key])&&$scope.model[opts.key].length>0){isValid=true;for(var index=0;index<$scope.model[opts.key].length;index++){if($scope.model[opts.key][index].length==0){isValid=false}}}valid=(isValid||$scope.multiCheckbox.noCheck)&&expressionValue;$scope.fc[0].$setValidity("required",valid)}}function setAll(){if($scope.multiCheckbox.noCheck==true){$scope.model[opts.key]=[];$scope.model[opts.key].push(to.noneKey);$scope.multiCheckbox.checked=[]}else{$scope.model[opts.key]=[]}$scope.fc[0].$setTouched();checkValidity(true)}function setModel(idx){$scope.model[opts.key]=[];$scope.multiCheckbox.other[idx]=false;angular.forEach($scope.multiCheckbox.checked,function(checkbox,index){if(checkbox){$scope.multiCheckbox.noCheck=false;$scope.model[opts.key].push(to.options[index][to.valueProp||"value"]);if(to.options[index][to.valueProp||"value"].substr(-5,5)=="other"){if(!angular.isUndefined($scope.multiCheckbox.checkedText[index])){$scope.model[opts.key].push($scope.multiCheckbox.checkedText[index])}}else{if(!angular.isUndefined($scope.multiCheckbox.checkedRadio[index])){$scope.model[opts.key].push($scope.multiCheckbox.checkedRadio[index])}}}});if(to.options[idx][to.valueProp||"value"].substr(-5,5)=="other"){$scope.multiCheckbox.other[idx]=true}$scope.fc[0].$setTouched();checkValidity(true);if($scope.to.onChange){$scope.to.onChange()}}if(opts.expressionProperties&&opts.expressionProperties["templateOptions.required"]){$scope.$watch(function(){return $scope.to.required},function(newValue){checkValidity(newValue)})}if($scope.to.required){var unwatchFormControl=$scope.$watch("fc",function(newValue){if(!newValue){return}checkValidity(true);unwatchFormControl()})}}]},{name:"repeatSection",template:'<div> \x3c!--loop through each element in model array--\x3e <div class="{{hideRepeat}}"> <div class="repeatsection" ng-repeat="element in model[options.key]" ng-init="fields = copyFields(to.fields)" ng-disabled="to.disabled"> <formly-form fields="fields" model="element" form="form"> </formly-form> <div style="margin-bottom:20px;"> <button type="button" class="btn btn-sm btn-danger" ng-click="model[options.key].splice($index, 1)" ng-if="!to.disabled"> Remove </button> </div> <hr> </div> <p class="AddNewButton"> <button type="button" class="button-remove btn btn-primary" ng-click="addNew()" ng-if="!to.disabled">{{to.btnText}}</button> </p> </div>',controller:function($scope){$scope.formOptions={formState:$scope.formState};$scope.addNew=addNew;$scope.copyFields=copyFields;function copyFields(fields){fields=angular.copy(fields);addRandomIds(fields);return fields}function addNew(){$scope.model[$scope.options.key]=$scope.model[$scope.options.key]||[];var repeatsection=$scope.model[$scope.options.key];var lastSection=repeatsection[repeatsection.length-1];var newsection={};repeatsection.push(newsection)}function addRandomIds(fields){unique++;angular.forEach(fields,function(field,index){if(field.fieldGroup){addRandomIds(field.fieldGroup);return}if(field.templateOptions&&field.templateOptions.fields){addRandomIds(field.templateOptions.fields)}field.id=field.id||field.key+"_"+index+"_"+unique+getRandomInt(0,9999)}
3)}function getRandomInt(min,max){return Math.floor(Math.random()*(max-min))+min}}},{name:"extendedSelect",template:'<div class="form-group"> <div ng-if="!to.groupProp"> <ui-select data-ng-model="model[options.key]" ng-disabled="{{to.disabled}}" theme="bootstrap"> <ui-select-match allow-clear="{{to.allowClear}}" placeholder="{{options.templateOptions.placeholder}}">{{$select.selected[[to.labelProp]]}}</ui-select-match> <ui-select-choices repeat="option in to.options | filter: $select.search"> <div ng-bind-html="option[to.labelProp] | highlight: $select.search"></div> </ui-select-choices> </ui-select> </div> <div ng-if="to.groupProp"> <ui-select data-ng-model="model[options.key]" ng-disabled="{{to.disabled}}" theme="bootstrap"> <ui-select-match allow-clear="{{to.allowClear}}" placeholder="{{options.templateOptions.placeholder}}">{{$select.selected[[to.labelProp]]}}</ui-select-match> <ui-select-choices group-by="to.groupProp" repeat="option in to.options | filter: $select.search"> <div ng-bind-html="option[to.labelProp] | highlight: $select.search"></div> </ui-select-choices> </ui-select> </div> </div>',wrapper:["bootstrapLabel","bootstrapHasError"],controller:["$scope","HttpService",function controller($scope,HttpService){if($scope.to.optionsUrl){var params=[];HttpService.getDataUrl($scope.to.optionsUrl,params).then(function(response){let data=response.data;$scope.allOptions=data[$scope.to.optionsHolder];$scope.to.options=data[$scope.to.optionsHolder];if($scope.to.optionsDependency){filterAllOptionsByDependency();addDependencyWatcher()}})}function filterAllOptionsByDependency(){let od=$scope.to.optionsDependency;$scope.to.options=$scope.allOptions.filter(opt=>opt[od.key]==$scope.model[od.dependentKey][od.dependentProperty])}function addDependencyWatcher(){let od=$scope.to.optionsDependency;$scope.$watch("model."+od.dependentKey,function(newVal,oldVal){if(newVal!==oldVal)filterAllOptionsByDependency()})}}],defaultOptions(options){if(!options.templateOptions.optionsUrl){let ngOptions=options.templateOptions.ngOptions||`option[to.valueProp || 'value'] as option[to.labelProp || 'name'] group by option[to.groupProp || 'group'] for option in to.options`;return{ngModelAttrs:{[ngOptions]:{value:options.templateOptions.optionsAttr||"ng-options"}}}}},apiCheck:check=>({templateOptions:{options:check.arrayOf(check.object),optionsAttr:check.string.optional,labelProp:check.string.optional,valueProp:check.string.optional,groupProp:check.string.optional}})}])}).directive("formlyErrorSummary",function(){return{scope:{},bindToController:{form:"=",fields:"="},template:'<div class="formly-error-summary"> <div ng-repeat="field in vm.fields" ng-if="field.formControl.$invalid" ng-class="{\'color-success\': field.formControl.$valid, \'color-error\': field.formControl.$invalid}"> <i class="glyphicon glyphicon-{{field.formControl.$invalid ? \'remove\' : \'ok\'}}"></i> <span ng-if="field.templateOptions.errorField">{{field.templateOptions.errorField}}</span> <span ng-if="!field.templateOptions.errorField && field.templateOptions.label">{{field.templateOptions.label}}</span> <span ng-if="!field.templateOptions.label && !field.templateOptions.errorField">{{field.templateOptions.placeholder}}</span> </div> </div>',controllerAs:"vm",controller:function(){var vm=this;vm.getErrorAsList=getErrorAsList;function getErrorAsList(field){return Object.keys(field.formControl.$error).map(function(error){return error}).join(", ")}}}}).run(function(formlyConfig){var attributes=["date-disabled","custom-class","show-weeks","starting-day","init-date","min-mode","max-mode","format-day","format-month","format-year","format-day-header","format-day-title","format-month-title","year-range","shortcut-propagation","datepicker-popup","show-button-bar","current-text","clear-text","close-text","close-on-date-selection","datepicker-append-to-body"];var bindings=["datepicker-mode","min-date","max-date"];var ngModelAttrs={};angular.forEach(attributes,function(attr){ngModelAttrs[camelize(attr)]={attribute:attr}});angular.forEach(bindings,function(binding){ngModelAttrs[camelize(binding)]={bound:binding}});formlyConfig.setType({name:"datepicker",template:'<p class="input-group"> <input type="text" id="{{::id}}" name="{{::id}}" ng-model="model[options.key]" ng-model-options="{timezone: \'utc\'}" class="form-control dtp" ng-click="datepicker.open($event)" uib-datepicker-popup="{{to.datepickerOptions.format}}" is-open="datepicker.opened" datepicker-options="to.datepickerOptions" />
3 <span class="input-group-btn"> <button type="button" class="btn btn-default" ng-click="datepicker.open($event)" ng-disabled="to.disabled"><i class="glyphicon glyphicon-calendar"></i></button> </span> </p>',wrapper:["bootstrapLabel","bootstrapHasError"],defaultOptions:{ngModelAttrs:ngModelAttrs,templateOptions:{datepickerOptions:{format:"dd/MM/yyyy",initDate:new Date,startingDay:1}}},controller:["$scope",function($scope){$scope.datepicker={};$scope.datepicker.opened=false;$scope.datepicker.open=function($event){$scope.datepicker.opened=!$scope.datepicker.opened}}]});function camelize(string){string=string.replace(/[\-_\s]+(.)?/g,function(match,chr){return chr?chr.toUpperCase():""});return string.replace(/^([A-Z])/,function(match,chr){return chr?chr.toLowerCase():""})}}).run(function run(formlyValidationMessages){}).controller("FormsController",["$scope","$filter","HttpService","$window","$location","preloader","$timeout","$rootScope","CommonFactory","formlyVersion","$base64","$http","passwordStrength","gRecaptcha","COMMON","sessionService",function($scope,$filter,HttpService,$window,$location,preloader,$timeout,$rootScope,CommonFactory,formlyVersion,$base64,$http,passwordStrength,gRecaptcha,COMMON,sessionService){var vm=this;vm.model={};vm.media={};vm.formLoaded=false;$scope.dropzoneConfig={options:{url:"/api/files",maxFilesize:100,paramName:"uploadfile",maxThumbnailFilesize:5,autoProcessQueue:false,maxFiles:1},eventHandlers:{sending:function(file,xhr,formData){},success:function(file,response){},maxfilesexceeded:function(file){this.removeFile(file)},addedfile:function(file){vm.model.flag=file.name;$scope.$digest()}}};$scope.initOnAction=function(formURL,actionName){$rootScope.$on(actionName,function(){if(!vm.formLoaded){$scope.init(formURL)}})};$scope.init=function(formURL,submitURL,extraParams,formId,extraKey,extraVal,useHashToken,parentToken,viewOnly,confirmByCode){$scope.myImage="";$scope.myCroppedImage="";var handleFileSelect=function(evt){var file=evt.currentTarget.files[0];var reader=new FileReader;reader.onload=function(evt){$scope.$apply(function($scope){$scope.myImage=evt.target.result})};reader.readAsDataURL(file)};angular.element(document.querySelector("#fileInput")).on("change",handleFileSelect);$scope.formId=formId;$rootScope.extraFormParams=extraParams;$rootScope.formExtraParams=extraParams;var params=[];$scope.DZ={};$scope.media={};if(formURL){$scope.formURL=formURL}if(extraKey&&!angular.isUndefined($rootScope[extraVal])){$scope.formURL+="?"+extraKey+"="+$rootScope[extraVal]}$scope.message="";$scope.loading=false;$scope.formSaved=false;$scope.formSuccess="";vm.viewOnly=viewOnly;vm.error=false;vm.main_title="";vm.text="";vm.text_finished="";vm.submit_url="";vm.submit_text="";vm.submit2_text="";vm.fields=[];vm.loadingText="";vm.defaultErrorText="";vm.showReset="";vm.originalFields=[];vm.requiredFields=[];vm.disabledForm="";vm.messageClass="";vm.uploadingMedia="";vm.autoSave="";vm.recaptchaPublicKey="";vm.recaptchaAction="";vm.recaptchaResponse="";vm.socialModel={};vm.confirmationCode=confirmByCode?true:false;vm.confirmationCodeToken="";vm.confirmationCodeHide=false;vm.loadingConfirmation=false;vm.showConfirmationCode=false;vm.messageConfirmation="";vm.messageConfirmationClass="";vm.preRegistrationToken="";vm.preRegistrationWatch=false;vm.otpInput={type:CommonFactory.isMobile()?"number":"text",onDone:function(value){vm.confirmationCode=value;vm.confirmCode()},onChange:function(value){}};vm.author={name:"Mueva el volante",url:"http://mueva.eu"};vm.env={angularVersion:angular.version.full,formlyVersion:formlyVersion};vm.reloadFields=function(){vm.loading=true;$timeout(function(){vm.loading=false})};vm.socialWatch="";$rootScope.$watch("postMessages.form",function(newMessage){vm.socialWatch=newMessage?true:false});$rootScope.$watch("socialToken",function(socialToken){if(socialToken){$scope.processSocialToken(socialToken)}});$scope.processSocialToken=function(socialToken){if(!vm.fields.length){$timeout(function(){$scope.processSocialToken(socialToken)},1e3)}else{sessionService.restoreSocial({socialToken:socialToken}).then(function(response){if(response.token){vm.socialWatch=true;$scope.processMessage({data:{type:"social-login",token:socialToken,u:response.token}})}else{}},function(response){})}};$rootScope.$watch("preRegistrationToken",function(preToken){if(preToken){console.log("preToken",preToken);$scope.processPreRegistration(preToken)}});$scope.processPreRegistration=function(preToken){if(!vm.fields.length){$t
3imeout(function(){$scope.processPreRegistration(preToken)},1e3)}else{vm.preRegistrationWatch=true;$scope.processMessage({data:{type:"pre-login",token:preToken.token,u:preToken.u}})}};$scope.processMessage=function(message){if(vm.socialWatch&&(!angular.isUndefined(message.data.type)&&message.data.type=="social-login")){vm.socialToken=message.data.token;try{var socialUser=angular.fromJson($base64.decode(message.data.u))}catch(e){vm.socialWatch="";return}angular.forEach(socialUser,function(val,key){if(val){if(vm.preRegistrationToken&&key=="email"){}else{vm.socialModel[key]=val;vm.model[key]=val}for(var i=vm.fields.length-1;i>=0;i--){if(!angular.isUndefined(vm.fields[i])&&vm.fields[i].key==key){if(vm.fields[i].key=="email"){vm.fields[i].templateOptions.disabled=true}vm.fields[i].className+=" social-completed"}else if(vm.fields[i].key=="password"||vm.fields[i].templateOptions&&vm.fields[i].templateOptions.type=="password"){vm.fields.splice(i,1)}}}});$timeout(function(){vm.reloadFields();vm.socialWatch="";vm.preRegistrationWatch=""})}if(vm.preRegistrationWatch&&(!angular.isUndefined(message.data.type)&&message.data.type=="pre-login")){vm.preRegistrationToken=message.data.token;try{var socialUser=angular.fromJson($base64.decode(message.data.u))}catch(e){vm.preRegistrationWatch="";return}angular.forEach(socialUser,function(val,key){if(val){vm.socialModel[key]=val;vm.model[key]=val;for(var i=vm.fields.length-1;i>=0;i--){if(!angular.isUndefined(vm.fields[i])&&vm.fields[i].key==key){if(vm.fields[i].key=="email"){vm.fields[i].templateOptions.disabled=true}}}}});$timeout(function(){vm.reloadFields();vm.socialWatch="";vm.preRegistrationWatch=""})}};window.addEventListener("message",function(message){$scope.processMessage(message)});$scope.initUserHash=function(){const hash=window.location.hash.replace(/^#/,"");const plainHash=/^[a-zA-Z0-9]+={0,2}$/.test(hash)?hash:null;const tokenHash=hash.startsWith("setup-token=")?hash.split("=")[1]:null;const hashValue=plainHash||tokenHash||null;$http.post($scope.formURL,{token:hashValue,offerOthers:vm.offerOthers}).success(function(data,status,headers,config){if(!angular.isUndefined(data.instantMessage)){vm.model={};$scope.message=data.instantMessage;vm.messageClass="message-success";$scope.formSaved=true;$scope.loading=false}else{$scope.processFormData({data:data})}}).error(function(data,status,headers,config){console.log("error")})};$scope.initFormData=function(params){HttpService.getDataUrl($scope.formURL,params).then(function(response){$scope.processFormData(response)})};if(useHashToken){$scope.initUserHash()}else{$scope.initFormData(params)}$scope.processFormData=function(response){vm.model={preModel:true};$timeout(function(){vm.model={};if(!angular.isUndefined(response.data.model)){vm.model=angular.fromJson($base64.decode(response.data.model))}if($rootScope.formExtraParams){angular.extend(vm.model,$rootScope.formExtraParams)}var hash=$location.hash();if(hash&&hash.indexOf("=")!==-1&&!useHashToken){var hashParts=hash.split("&");angular.forEach(hashParts,function(part){var keyValue=part.split("=");if(keyValue.length===2){var key=keyValue[0];var value=decodeURIComponent(keyValue[1]);var formattedValue=value.replace(/_/g," ").replace(/\b\w/g,function(l){return l.toUpperCase()});vm.model[key]=formattedValue}})}vm.main_title=response.data.main_title;vm.main_title_social=!angular.isUndefined(response.data.main_title_social)?response.data.main_title_social:response.data.main_title;vm.text=response.data.text;vm.submit_url=response.data.submit_url;if(response.data.submit_text){vm.submit_text=response.data.submit_text}else{vm.disabledForm=true}if(!angular.isUndefined(response.data.submit2_text)){vm.submit2_text=response.data.submit2_text}if(response.data.article.show){$(response.data.article.show).show();$(response.data.article.show).removeClass("hidden")}if(response.data.article.cleartab){$(response.data.article.cleartab).remove();$(".tab:first a").click()}vm.fields=angular.fromJson($base64.decode(response.data.fields));setupResetOnHideWatchers($scope,vm.model,vm.fields);angular.forEach(vm.fields,function(field){if(!angular.isUndefined(field.templateOptions.required)&&field.templateOptions.required){field.templateOptions.requiredOriginal=field.templateOptions.required}if(!angular.isUndefined(field.templateOptions.hideFromLoggedUsers)&&field.templateOptions.hideFromLoggedUsers){field.hide=$rootScope.currentUser;field.templateOptions.required=false}if(!angular.isUndefined(field.templateOptions.disableForLoggedUsers)&&field.templateOptions.disableForLoggedUsers){field.templateOptions.disabled=$rootScope.currentUser;field.templateOptions.required=false}if(field.templateOptions.type=="users_group"&&vm.model.hasOwnProperty(field.key)){let selectedUserGroups=field.templateOptions.options.filter(o=>vm.model[field.key].includes(o.value));delete vm.model[field.key];if(selectedUserGroups.length>0){switch(field.type){case"select":if(selectedUserGroups.length===1){vm.model[field.key]=selectedUserGroups[0].value}break;case"multiCheckbox":vm.model[field.key]=selectedUserGroups.map(g=>g.value);break;default:break}}else if(field.defaultValue){vm.model[field.key]=field.defaultValue}}});if(!angular.isUndefined(response.data.currentLang)){vm.currentLang=response.data.currentLang}if(!angular.isUndefined(response.data.success_message)){vm.successMessage=response.data.success_message}vm.loadingText=response.data.loading_text;if(!angular.isUndefined(response.data.default_error)){vm.defaultErrorText=response.data.default_error}vm.showReset=response.data.show_reset;vm.originalFields=angular.copy(vm.fields);if(!angular.isUndefined(response.data.autosave)){vm.autoSave=setInterval(function(){$scope.s
3aveForm(1)},3e4)}if(!angular.isUndefined(response.data.recaptcha)){vm.recaptchaType=response.data.recaptcha.split("|");if(vm.recaptchaType[0]==3){vm.recaptchaAction=angular.isUndefined(vm.recaptchaType[1])?"registration":vm.recaptchaType[1];vm.recaptchaPublicKey=COMMON.RECAPTCHA_PUBLIC;gRecaptcha.initialize({key:vm.recaptchaPublicKey})}}setTimeout(function(){angular.forEach(vm.fields,function(field){if(field.key==="password_repeat"){field.validators=field.validators||{};field.validators.passwordMatch={expression:function($viewValue,$modelValue,scope){var value=$modelValue||$viewValue;return value===scope.model.password},message:function($viewValue,$modelValue,scope){return"Passwords must match"}}}if(field.type=="dropzone"){if($("."+field.className+" .drop-zone").length>0){var cName=field.className;$scope.DZ[cName]=Dropzone.forElement("."+field.className+" .drop-zone");if(!$scope.DZ[cName].options.originalUrl){$scope.DZ[cName].options.originalUrl=$scope.DZ[cName].options.url;$scope.DZ[cName].options.parallelUploads=1;$scope.DZ[cName].options.autoProcessQueue=false;$scope.DZ[cName].options.url=function(files){console.log("Resolving URL for file:",files[0].name);if(this.file_urls&&this.file_urls.length>0){var file=files[0];var index=this.getAcceptedFiles().indexOf(file);console.log("File index:",index,"URL:",this.file_urls[index]);if(index!==-1&&this.file_urls[index]){return this.file_urls[index]}}console.warn("Fallback to originalUrl for:",files[0].name);return this.options.originalUrl}}vm.checkDropzoneErrors=function(){var hasErrors=false;if($scope.DZ){angular.forEach($scope.DZ,function(dzInstance){if(dzInstance){if(dzInstance.getRejectedFiles&&dzInstance.getRejectedFiles().length>0){hasErrors=true}if(dzInstance.getFilesWithStatus&&dzInstance.getFilesWithStatus(Dropzone.ERROR).length>0){hasErrors=true}}})}if(vm.form&&vm.form.$setValidity){vm.form.$setValidity("dropzoneError",!hasErrors)}else if($scope.form&&$scope.form.$setValidity){$scope.form.$setValidity("dropzoneError",!hasErrors)}};$scope.DZ[cName].on("addedfile",function(file){$timeout(function(){vm.checkDropzoneErrors();if($scope.DZ[cName]){var validFiles=$scope.DZ[cName].files.filter(function(f){return f.status!==Dropzone.ERROR&&f.status!==Dropzone.CANCELED});if(validFiles.length===0){delete vm.model[cName];delete vm.model[field.key]}else{vm.model[field.key]=[];vm.model[cName]=[];angular.forEach(validFiles,function(f){var fileData={filename:f.name,size:f.size,uuid:f.upload&&f.upload.uuid?f.upload.uuid:f.name};vm.model[field.key].push(fileData);if(field.key!==cName){vm.model[cName].push(fileData)}})}}},500)});$scope.DZ[cName].on("removedfile",function(file){vm.checkDropzoneErrors();$timeout(function(){if($scope.DZ[cName]){console.log("RemovedFile check:","Accepted:",$scope.DZ[cName].getAcceptedFiles().length,"Queued:",$scope.DZ[cName].getQueuedFiles().length,"Uploading:",$scope.DZ[cName].getUploadingFiles().length);var validFiles=$scope.DZ[cName].files.filter(function(f){return f.status!==Dropzone.ERROR&&f.status!==Dropzone.CANCELED});if(validFiles.length===0){delete vm.model[cName];delete vm.model[field.key]}else{vm.model[field.key]=[];vm.model[cName]=[];angular.forEach(validFiles,function(f){var fileData={filename:f.name,size:f.size,uuid:f.upload&&f.upload.uuid?f.upload.uuid:f.name};vm.model[field.key].push(fileData);if(field.key!==cName){vm.model[cName].push(fileData)}})}}},500)});$scope.DZ[cName].on("error",function(file){vm.checkDropzoneErrors()});$scope.DZ[cName].on("complete",function(file){console.log("Complete event for:",file.name,"Status:",file.status);if($scope.DZ[cName]&&$scope.DZ[cName].getQueuedFiles().length>0){if(vm.uploadingMedia){console.log("Processing next file in queue...");$scope.DZ[cName].processQueue()}}});$scope.DZ[cName].on("queuecomplete",function(){console.log("Queue complete. All files processed.");vm.uploadingMedia=false;$scope.startDropzoneUpload()})}else{var cName=field.className;const observer=new MutationObserver(mutationsList=>{for(let mutation of mutationsList){if(mutation.type==="childList"){mutation.addedNodes.forEach(element=>{if($(element).hasClass("drop-zone")&&$(element).attr("dropzone")!==undefined&&!$scope.DZ[cName]&&document.querySelector("."+field.className+" .drop-zone")){setTimeout(()=>{$scope.DZ[cName]=Dropzone.forElement("."+field.className+" .drop-zone");if(!$scope.DZ[cName].options.originalUrl){$scope.DZ[cName].options.originalUrl=$scope.DZ[cName].options.url;$scope.DZ[cName].options.parallelUploads=1;$scope.DZ[cName].options.autoProcessQueue=false;$scope.DZ[cName].options.url=function(files){console.log("Resolving URL for file (Mutation):",files[0].name);if(this.file_urls&&this.file_urls.length>0){var file=files[0];var index=this.getAcceptedFiles().indexOf(file);console.log("File index (Mutation):",index,"URL:",this.file_urls[index]);if(index!==-1&&this.file_urls[index]){return this.file_urls[index]}}console.warn("Fallback to originalUrl (Mutation) for:",files[0].name);return this.options.originalUrl}}$scope.DZ[cName].on("addedfile",function(file){$timeout(()=>{vm.checkDropzoneErrors();if($scope.DZ[cName]){var validFiles=$scope.DZ[cName].files.filter(function(f){return f.status!==Dropzone.ERROR&&f.status!==Dropzone.CANCELED});if(validFiles.length===0){delete vm.model[cName];delete vm.model[field.key]}else{vm.model[field.key]=[];vm.model[cName]=[];angular.forEach(validFiles,function(f){var fileData={filename:f.name,size:f.size,uuid:f.upload&&f.upload.uuid?f.upload.uuid:f.name};vm.model[field.key].push(fileData);if(field.key!==cName){vm.model[cName].push(fileData)}})}}},500)});$scope.DZ[cName].on("removedfile",function(file){vm.checkDropzoneErrors();$timeout(()=>{if($scope.DZ[cName]){console.log("RemovedFile (Mutation) check:","Accepted:",$scope.DZ[cName].getAcceptedFiles().length,"Queued:",$scope.DZ[cName].getQueuedFiles().length,"Uploading:",$scope.DZ[cName].getUploadingFiles().length);var validFiles=$scope.DZ[cName].files.filter(function(f){return f.status!==Dropzone.ERROR&&f.status!==Dropzone.CANCELED});if(validFiles.length===0){delete vm.model[cName];delete vm.model[field.key]}else{vm.model[field.key]=[];vm.model[cName]=[];angular.forEach(validFiles,function(f){var fileData={filename:f.name,size:f.size,uuid:f.upload&&f.upload.uuid?f.upload.uuid:f.name};vm.model[field.key].push(fileData);if(field.key!==cName){vm.model[cName].push(fileData)}})}}},500)});$scope.DZ[cName].on("error",function(file){vm.checkDropzoneErrors()});$scope.DZ[cName].on("complete",function(file){console.log("Complete event for:",file.name,"Status:",file.status);if($scope.DZ[cName]&&$scope.DZ[cName].getQueuedFiles().length>0){if(vm.uploadingMedia){console.log("Processing next file in queue...");$scope.DZ[cName].processQueue()}}});$scope.DZ[cName].on("queuecomplete",function(){console.log("Queue complete. All files processed.");vm.uploadingMedia=false;$scope.startDropzoneUpload()})},500)}})}}});const targetNode=document.body;const config={childList:true,subtree:true};observer.observe(targetNode,config)}}})},1e3)},500)};$scope.startDropzoneUpload=function(force){if(force){vm.uploadingMedia=false}console.log("Starting Dropzone upload check...");angular.forEach($scope.DZ,function(val,key){if(!vm.uploadingMedia){if(val&&typeof val.getQueuedFiles==="function"){var queued=val.getQueuedFiles().length;console.log("Checking queue for key:",key,"Queued:",queued);if(queued>0){console.log("Starting queue processing for",key);vm.uploadingMedia=true;val.processQueue()}}else{console.warn("Invalid Dropzone instance for key:",key)}}})};$scope.clearAllDropzones=function(){angular.forEach(vm.fields,function(field){if(field.type=="dropzone"){var cName=field.className;$scope.DZ[cName]=Dropzone.forElement("."+field.className+" .drop-zone");$scope.DZ[cName].removeAllFiles()}})};
3$scope.saveForm=function(autoSave){if(autoSave){$http.post(vm.submit_url,{autosave:1,data:JSON.stringify(vm.model)}).success(function(data,status,headers,config){}).error(function(data,status,headers,config){})}else if(vm.recaptchaPublicKey&&vm.recaptchaAction&&!vm.recaptchaResponse){gRecaptcha.execute({action:vm.recaptchaAction}).then(function(token){vm.recaptchaResponse=token;$scope.saveForm()})}else{if(!angular.isUndefined(vm.autoSave)){clearInterval(vm.autoSave)}vm.error=false;angular.forEach(vm.requiredFields,function(field){if(angular.isUndefined(vm.model[field])){vm.error=true}});if(vm.error){console.log("mandatory-error")}else{var modelToSend=angular.copy(vm.model);angular.forEach(vm.fields,function(field){if(field.templateOptions.type=="tel"&&!angular.isUndefined(field.data)&&!angular.isUndefined(field.data.countryCode)){var telNumber=field.data.countryCode.dialCode+modelToSend[field.key];var num="+"+telNumber.match(/\d+/g).join("");modelToSend[field.key]=num}});var sendParams={data:JSON.stringify(modelToSend),media:JSON.stringify($scope.media)};if(!angular.isUndefined($rootScope.formExtraParams)){sendParams.extra=$rootScope.formExtraParams}if(useHashToken){sendParams.token=$location.hash()}if(parentToken&&!angular.isUndefined($rootScope.formsData)&&!angular.isUndefined($rootScope.formsData[parentToken])&&!angular.isUndefined($rootScope.formsData[parentToken].token)){sendParams.token=$rootScope.formsData[parentToken].token}if(vm.recaptchaResponse){sendParams.recaptchaResponse=vm.recaptchaResponse}
3if(!angular.isUndefined(vm.socialToken)){sendParams.socialToken=vm.socialToken}if(!angular.isUndefined(vm.preRegistrationToken)){sendParams.preRegistrationToken=vm.preRegistrationToken}$http.post(vm.submit_url,sendParams).success(function(data,status,headers,config){if(data.success==true){$scope.formSuccess=data;if(Object.keys($scope.DZ).length>0&&!angular.isUndefined(data.payload.extra.dropzone)){var hasFiles=false;angular.forEach(data.payload.extra.dropzone,function(val,key){if(!angular.isUndefined($scope.DZ[key])){$scope.DZ[key].file_urls=val;var queuedCount=$scope.DZ[key].getQueuedFiles().length;console.log("SaveForm check for",key,"Queued:",queuedCount);if(queuedCount>0){hasFiles=true}}});if(hasFiles){vm.uploadingMedia=true;$timeout(function(){$scope.startDropzoneUpload(true)},500)}}vm.successForm()}else{if(!data){data={payload:{overlay_message:"Form PHP error"}}}else if(!data.payload){if(typeof data=="string"){data={payload:{overlay_message:"Form PHP error"}}}else{data.payload={overlay_message:"Form PHP error"}}}else if(!data.payload.overlay_message){data.payload.overlay_message="Form PHP error"}if(!angular.isUndefined(data.payload.overlay_message)&&data.payload.overlay_message.length<1){$rootScope.openModalClass("modal-messages",2,data.payload.overlay_message)}$scope.message=data.payload.message;vm.messageClass="message-error";$scope.loading=false;$scope.formSaved=true}}).error(function(data,status,headers,config){$scope.message=data.payload.message;vm.messageClass="message-error";$scope.loading=false;$scope.formSaved=true});setTimeout(function(){if(!$scope.formSaved){vm.messageClass="message-error";$scope.loading=false;$scope.message=vm.defaultErrorText}},3e4)}}};vm.successForm=function(){if(!vm.uploadingMedia){var data=$scope.formSuccess;if(!angular.isUndefined(data.payload.finished_message)&&data.payload.finished_message.length!=0){vm.text_finished=data.payload.finished_message;$rootScope.openModalClass("modal-messages",1,data.payload.finished_message)}if(!angular.isUndefined(data.payload.overlay_message)){$rootScope.openModalClass("modal-messages",1,data.payload.overlay_message)}$rootScope.$emit("site:form"+$scope.formId+"Saved");if(!angular.isUndefined($rootScope.postConfirmMessage)&&$rootScope.postConfirmMessage!==false){$scope.message=$rootScope.postConfirmMessage}else{$scope.message=data.payload.message}vm.messageClass="message-success";$scope.formSaved=true;$scope.loading=false;if(data.payload.clearForm){var scrollY=$window.pageYOffset||0;var body=document.body;body.style.position="fixed";body.style.top="-"+scrollY+"px";body.style.left="0";body.style.right="0";vm.fields=[];vm.main_title="";vm.main_title_social="";$timeout(function(){body.style.position="";body.style.top="";body.style.left="";body.style.right="";$window.scrollTo(0,scrollY);var section=document.getElementById($scope.formId);if(section){var header=document.querySelector("#header");var offset=header?header.offsetHeight:0;$window.scrollTo(0,section.offsetTop-offset)}})}if(data.payload.finishAction){eval(data.payload.finishAction)}if(data.payload.reloadPage){setTimeout(function(){location.reload()},500)}if(data.payload.reloadForm){setTimeout(function(){if(useHashToken){$scope.initUserHash()}else{console.log("reloadForm");$scope.initFormData([])}},500)}if(data.payload.redirectPage){if(data.payload.loginToken){sessionService.setToken(data.payload.loginToken)}setTimeout(function(){location.href=data.payload.redirectPage},1e3)}if(data.payload.token){if(angular.isUndefined($rootScope.formsData)){$rootScope.formsData={}}$rootScope.formsData[$scope.formId]={token:data.payload.token}}if(data.payload.extraData){if(angular.isUndefined($rootScope.formsData[$scope.formId])){$rootScope.formsData[$scope.formId]={}}angular.forEach(data.payload.extraData,function(val,key){$rootScope.formsData[$scope.formId][key]=val})}if(!angular.isUndefined(data.payload.confirmationToken)){vm.showConfirmationCode=true;vm.confirmationCodeToken=data.payload.confirmationToken}$rootScope.$emit("FORM_REGISTER_COMPLETED")}else{$timeout(function(){vm.successForm()},1e3)}};vm.onSubmit=function onSubmit(){vm.uploadingMedia=false;$scope.message=vm.loadingText;$scope.loading=true;vm.messageClass="message-info";if(vm.form.$valid){angular.forEach(vm.fields,function(field){if(!angular.isUndefined(field.templateOptions)&&!angular.isUndefined(field.templateOptions.required)&&field.templateOptions.required==true){vm.requiredFields.push(field.key)}if(field.type=="dropzone"&&document.querySelector("."+field.className+" .drop-zone")){var cName=field.className;if(!$scope.DZ[cName]){try{$scope.DZ[cName]=Dropzone.forElement("."+field.className+" .drop-zone")}catch(e){console.warn("Could not get Dropzone instance for",cName)}}if($scope.DZ[cName]){if($scope.DZ[cName].getAcceptedFiles().length>0){vm.model[field.key]=[];vm.model[cName]=vm.model[cName]||[];angular.forEach($scope.DZ[cName].getAcceptedFiles(),function(f){var fileData={filename:f.name,size:f.size,uuid:f.upload.uuid};vm.model[field.key].push(fileData);if(field.key!==cName){vm.model[cName].push(fileData)}})}}}});
3$scope.saveForm()}else{vm.errorMessage="error-message"}};vm.confirmCode=function(){if(vm.confirmationCode.length==6){vm.loadingConfirmation=true;$http.post(vm.submit_url,{action:"confirmCode",token:vm.confirmationCodeToken,code:vm.confirmationCode}).success(function(data,status,headers,config){if(data.success==true){$scope.message="";vm.messageConfirmation=data.payload.message;vm.messageConfirmationClass="message-success";vm.confirmationCodeHide=true;if(data.token){$rootScope.$emit("site:loginFromForm",data.token)}$rootScope.$emit("site:form"+$scope.formId+"Confirmed")}else{vm.messageConfirmation=data.payload.message;vm.messageConfirmationClass="message-error"}vm.loadingConfirmation=false}).error(function(data,status,headers,config){vm.messageConfirmation="unknown_error";vm.messageConfirmationClass="message-error";vm.loadingConfirmation=false});$timeout(function(){$scope.loading=false},5e3)}}};$scope.validateEmail=function(apiURL,successMessage,currentLang){$scope.success=false;$scope.error=false;$scope.message="";$scope.loading=true;$scope.apiUrl=apiURL;$scope.hasMessage=false;$scope.successMessage=angular.fromJson($base64.decode(successMessage));$scope.currentLang=currentLang;var params={locale:currentLang,token:decodeURIComponent($location.search()["token"])};$http.post($scope.apiUrl,params).success(function(data,status,headers,config){if(data.success==true){$scope.loading=false;if(data.message){$scope.message=data.message}else{$scope.message=$scope.successMessage}$scope.success=true;$scope.error=false}else{$scope.loading=false;$scope.message=data.message;$scope.success=false;$scope.error=true}}).error(function(data,status,headers,config){$scope.loading=false;$scope.message=data.detail;$scope.success=false;$scope.error=true})};$scope.initInvitationSend=function(configEnc,groups,confirmURL,confirmTemplate,successText){try{$scope.config=angular.fromJson($base64.decode(configEnc))}catch(e){console.log("ERROR PARSING URL")}$scope.shareByEmail=function(emails){var emailArrays=emails.split(",");var pathArray=window.location.pathname.split("/");var idFromSection=pathArray[2].split("_")[0];var params={emails:[],sectionId:$scope.config.id_section,idFromSection:idFromSection,articleURL:window.location.href};var validEmail=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;angular.forEach(emailArrays,function(email){email=email.replace(/\s+/g,"");if(validEmail.test(email)){params.emails.push(email)}});$http.post($scope.config.url,params).success(function(data,status,headers,config){if(data.success=true){var message="Invitation successfully sent.";if(data.emails.ignored&&data.emails.ignored.length){var emails="";angular.forEach(data.emails.ignored,function(email,index){emails=emails+email;if(index!=0){emails=emails+", "}});message=message+" There was an error with the next emails: "+emails}$("body").append(`\n <div id="share-by-email-toast-event" style="position: fixed; bottom: 15px; width: 100%; display: flex; z-index: 9999999; justify-content: center;">\n <p style="background-color: green; padding: 5px 20px; border-radius: 100px; color: #fff; font-size: 20px;">`+message+`</p>\n </div>\n `)}else{$("body").append(`\n <div id="share-by-email-toast-event" style="position: fixed; bottom: 15px; width: 100%; display: flex; z-index: 9999999; justify-content: center;">\n <p style="background-color: red; padding: 5px 20px; border-radius: 100px; color: #fff; font-size: 20px;">Something goes wrong</p>\n </div>\n `)}setTimeout(()=>{$("#share-by-email-toast-event").remove()},5e3)}).error(function(data,status,headers,config){});$rootScope.closeModal("modal-share-by-email")}}}]);"use strict";
3angular.module("Header",["services.HttpService","directives.spinner","directives.resizables","ngSanitize","Scope.safeApply","ngRepeatUtils"]).controller("HeaderController",["$scope","$filter","HttpService","$window","$location","preloader","$timeout","$rootScope","CommonFactory","$base64","cookiesBarV2",function($scope,$filter,HttpService,$window,$location,preloader,$timeout,$rootScope,CommonFactory,$base64,cookiesBarV2){$scope.init=function(url){$scope.url=url;$scope.menuItems=[];$scope.menuItemsSecondary=[];$scope.socialLinks=[];$scope.siteLangs=[];$scope.currentLang="";$scope.widgetsItems=[];$scope.footerWidgets=[];$scope.widgetsZones=[];$scope.tagsItems=[];$scope.data=[];$scope.extraItems={};$scope.extraWidgets=[];$rootScope.headerData={};$rootScope.footerData=[];$rootScope.extraWidgets=[];$rootScope.widgetsZones={};HttpService.getDataUrl($scope.url,[]).then(function(response){$scope.safeApply(function(){$scope.data=response.data;if(!angular.isUndefined($scope.data.menu)){angular.forEach($scope.data.menu,function(menuItem){$scope.menuItems.push(menuItem)})}$rootScope.headerData.menuItems=$scope.menuItems;if(!angular.isUndefined($scope.data.menuSecondary)){angular.forEach($scope.data.menuSecondary,function(menuItem){$scope.menuItemsSecondary.push(menuItem)});$rootScope.headerData.menuItemsSecondary=$scope.menuItemsSecondary}if(!angular.isUndefined($scope.data.social)){angular.forEach($scope.data.social,function(socialLink){$scope.socialLinks.push(socialLink)});$rootScope.headerData.socialLinks=$scope.socialLinks}if(!angular.isUndefined($scope.data.languages)&&!angular.isUndefined($scope.data.languages.all)){angular.forEach($scope.data.languages.all,function(langs){$scope.siteLangs.push(langs)});$rootScope.headerData.siteLangs=$scope.siteLangs}if(!angular.isUndefined($scope.data.languages)&&!angular.isUndefined($scope.data.languages.current)){$scope.currentLang=$scope.data.languages.current;$rootScope.headerData.currentLang=$scope.currentLang}if(!angular.isUndefined($scope.data.widgets)){angular.forEach($scope.data.widgets,function(menuWidget){$scope.widgetsItems.push(menuWidget)});$rootScope.headerData.widgetsItems=$scope.widgetsItems}
3if(!angular.isUndefined($scope.data.footerWidgets)){angular.forEach($scope.data.footerWidgets,function(menuWidget){$scope.footerWidgets.push(menuWidget)});$rootScope.footerWidgets=$scope.footerWidgets}if(!angular.isUndefined($scope.data.cookies)){$rootScope.cookiesData=$scope.data.cookies}if(!angular.isUndefined($scope.data.widgetsZones)){angular.forEach($scope.data.widgetsZones,function(wZones,widgetType){if(angular.isUndefined($scope.widgetsZones[widgetType])){$scope.widgetsZones[widgetType]={}}angular.forEach(wZones,function(w,wZone){if(angular.isUndefined($scope.widgetsZones[widgetType][wZone])){$scope.widgetsZones[widgetType][wZone]=[]}angular.forEach(w,function(widget){$scope.widgetsZones[widgetType][wZone].push(widget)})})});$rootScope.widgetsZones=$scope.widgetsZones}if(!angular.isUndefined($scope.data.extraData)){angular.forEach($scope.data.extraData,function(extraData,extraName){try{$scope.extraItems[extraName]=JSON.parse(extraData)}catch(e){}});$rootScope.headerData.extraItems=$scope.extraItems}if(!angular.isUndefined($scope.data.extraWidgets)){angular.forEach($scope.data.extraWidgets,function(extraData,extraName){if(angular.isUndefined($scope.extraWidgets)){$scope.extraWidgets={}}if(angular.isUndefined($scope.extraWidgets[extraName])){$scope.extraWidgets[extraName]=[]}angular.forEach(extraData,function(widgetData){$scope.extraWidgets[extraName].push(widgetData)});$scope.extraWidgets[extraName]=$scope.extraWidgets[extraName].join("")});$rootScope.extraWidgets=$scope.extraWidgets}if(!angular.isUndefined($scope.data.tags)){angular.forEach($scope.data.tags,function(menuWidget){$scope.tagsItems.push(menuWidget)})}if($scope.data.redirectByLanguage){var currentUrl=window.location.origin+window.location.pathname+window.location.search;var browserLanguage=window.navigator.language||window.navigator.userLanguage;const languageCookie=$scope.getCookie("userSelectedLanguage");let newUrl="";if(languageCookie){if(currentUrl.indexOf(`/${languageCookie}/`===-1)){newUrl=$scope.changeURL(languageCookie)}}else{switch(browserLanguage){case"en-US":newUrl=$scope.changeURL("en");break;default:newUrl=$scope.changeURL("es");break}}if(currentUrl!=newUrl){$window.location.href=newUrl}}})});var menuWidgetsScripts=function(){angular.forEach($scope.data.widgetsScripts,function(widgetScript){if(!angular.isUndefined(widgetScript.container)){if(widgetScript.type=="countdown"){setTimeout(function(){$scope.setCountdown(widgetScript)},1e3)}}else if(angular.isUndefined(widgetScript.type)){setTimeout(function(){eval(widgetScript)},3e3)}})};$rootScope.$on("site:widgetsScripts",function(){menuWidgetsScripts()});$scope.menuWidgetsLoaded=function(){if(typeof window["menuFinishLoad"]!=="undefined"&&$.isFunction(window["menuFinishLoad"])){eval("menuFinishLoad()")}menuWidgetsScripts()};$scope.setCountdown=function(d){var dateTo=moment.utc(d.date_to+" "+d.UTC,"YYYY-MM-DD HH:mm Z");var dateToCountDown=new Date(Date.UTC(dateTo.format("YYYY"),dateTo.format("MM")-1,dateTo.format("DD"),dateTo.format("HH"),dateTo.format("mm"),dateTo.format("ss")));if(d.slide_message.length>0){$(d.container+" .countdown-text").html("...");$(".headers-widgets .countdown-fotorama").append('<div class="countdown-text"><div class="countdown-date"><strong>'+d.slide_message+"</strong></div></div>");$(".headers-widgets .countdown-fotorama").attr("data-autoplay","true");$(".headers-widgets .countdown-fotorama").attr("data-ratio","200/84");$(".headers-widgets .countdown-fotorama").attr("data-nav","false");$(".headers-widgets .countdown-fotorama").attr("data-arrows","false");$(".headers-widgets .countdown-fotorama").attr("data-click","false");$(".headers-widgets .countdown-fotorama").attr("data-swipe","false");$(".headers-widgets .countdown-fotorama").attr("data-transition","crossfade");$(".headers-widgets .countdown-fotorama").fotorama();$(d.container+" .countdown-text:first").countdown({until:dateToCountDown,compact:true,expiryText:'<div class="over">'+d.message+"</div>",layout:d.layout,alwaysExpire:true})}else{var cConfig={compact:true,expiryText:'<div class="over">'+d.message+"</div>",layout:d.layout,alwaysExpire:true};if(!angular.isUndefined(d.format)){cConfig.format=d.format}if(!moment(dateToCountDown).utc().isAfter(moment().utc())&&!angular.isUndefined(d.enable_countup)&&d.enable_countup){$(d.container+" .countdown-text").countdown(angular.merge(cConfig,{since:dateToCountDown}))}else{$(d.container+" .countdown-text").countdown(angular.merge(cConfig,{until:dateToCountDown}))}}};$scope.showResMenu=function(windowWidth,hideSubMenu){var statusMenu=false;if(windowWidth>=768){statusMenu=true}else if(windowWidth<768){statusMenu=!hideSubMenu}return statusMenu}};$scope.getCookie=function(name){const cookies=document.cookie.split(";");for(let i=0;i<cookies.length;
3i++){const cookie=cookies[i].trim();if(cookie.startsWith(name+"=")){return cookie.substring(name.length+1)}}return null};$scope.initCountdown=function(countdownConfig){try{var d=angular.fromJson($base64.decode(countdownConfig))}catch(e){console.log("error",e);return}var dateTo=moment.utc(d.date_to+" "+d.UTC,"YYYY-MM-DD HH:mm Z");var dateToCountDown=new Date(Date.UTC(dateTo.format("YYYY"),dateTo.format("MM")-1,dateTo.format("DD"),dateTo.format("HH"),dateTo.format("mm"),dateTo.format("ss")));if(d.slide_message.length>0){$(d.container+" .countdown-text").html("...");$(".headers-widgets .countdown-fotorama").append('<div class="countdown-text"><div class="countdown-date"><strong>'+d.slide_message+"</strong></div></div>");$(".headers-widgets .countdown-fotorama").attr("data-autoplay","true");$(".headers-widgets .countdown-fotorama").attr("data-ratio","200/84");$(".headers-widgets .countdown-fotorama").attr("data-nav","false");$(".headers-widgets .countdown-fotorama").attr("data-arrows","false");$(".headers-widgets .countdown-fotorama").attr("data-click","false");$(".headers-widgets .countdown-fotorama").attr("data-swipe","false");$(".headers-widgets .countdown-fotorama").attr("data-transition","crossfade");$(".headers-widgets .countdown-fotorama").fotorama();var cConfig={until:dateToCountDown,compact:true,expiryText:"",layout:d.layout,alwaysExpire:true};if(d.onExpiry){cConfig.onExpiry=function(){eval(d.onExpiry)}}else{cConfig.expiryText='<div class="over">'+d.expiryText+"</div>"}$(d.container+" .countdown-text:first").countdown(cConfig)}else{var cConfig={compact:true,expiryText:"",layout:d.layout,alwaysExpire:true};if(d.onExpiry){cConfig.onExpiry=function(){eval(d.onExpiry)}}else{cConfig.expiryText='<div class="over">'+d.expiryText+"</div>"}if(!angular.isUndefined(d.format)){cConfig.format=d.format}if(!moment(dateToCountDown).utc().isAfter(moment().utc())&&!angular.isUndefined(d.enable_countup)&&d.enable_countup){cConfig.since=dateToCountDown}else{cConfig.until=dateToCountDown}$(d.container+" .countdown-text").countdown(cConfig)}};$scope.changePageLanguage=function(item){const newUrl=$scope.changeURL(item.name.toLowerCase());const date=new Date;date.setFullYear(date.getFullYear()+100);const expires="expires="+date.toUTCString();document.cookie="userSelectedLanguage="+item.name.toLowerCase()+";"+expires+";path=/";$window.location.href=newUrl};$scope.changeURL=function(lang){let url=window.location.href;let languages=$scope.siteLangs.map(x=>x.name.toLowerCase());if($scope.currentLang){languages.push($scope.currentLang.name.toLowerCase())}let foundLanguage=false;const urlObj=new URL(url);const baseUrl=urlObj.origin;let path=urlObj.pathname;
3languages.forEach(language=>{if(path.startsWith(`/${language}/`)){path=path.replace(`/${language}/`,`/${lang}/`);foundLanguage=true}});if(!foundLanguage){if(!path||path==="/"){path="/home"}path=`/${lang}${path}`}const newUrl=`${baseUrl}${path}${urlObj.search}${urlObj.hash}`;return newUrl}}]);"use strict";angular.module("LoadMore",["services.HttpService","directives.spinner","directives.resizables","ngSanitize","directives.repeatComplete","Scope.safeApply"]).controller("LoadMoreController",["$scope","$filter","HttpService","$window","preloader","$timeout","$rootScope","CommonFactory","$interval",function($scope,$filter,HttpService,$window,preloader,$timeout,$rootScope,CommonFactory,$interval){var searchMatch=function(haystack,needle){if(!needle){return true}return haystack.toLowerCase().indexOf(needle.toLowerCase())!==-1};var searchContains=function(string,substr){return string.indexOf(substr)!=-1};$scope.init=function(url,per_page,view_more,noImageDefault,fotorama,onRenderAction,reloadTimeoutSec,elementId){$scope.elementId=elementId;$scope.fieldsByType=["class"];$scope.imageDefault=noImageDefault;$scope.fotorama=fotorama;$scope.onSocial=false;$scope.alreadyLoadedSocial=false;$scope.onRenderAction=onRenderAction;$scope.reloadTimeoutSec=reloadTimeoutSec;$scope.itemsPerPage=per_page;$scope.url=url;$scope.page=1;$scope.firstLoad=true;$scope.starter=function(){$scope.index=0;$scope.data=[];$scope.page=1;$scope.results=[];$scope.pagedItemsLoaded=[];$scope.pagedItemsLoadedPreload=[];$scope.imageLocations=[];$scope.more=view_more;$scope.more=true;$scope.moreLoad=false;$scope.status_bar="";$scope.isLoading=true;$scope.isSuccessful=false;$scope.percentLoaded=0;$scope.preloader=false;$scope.$on("ngRepeatFinished",function(){if($scope.onRenderAction){eval($scope.onRenderAction)}})};$scope.safeApply($scope.starter());var params=[];HttpService.getDataUrl($scope.url,params).then(function(response){$scope.safeApply(function(){$scope.items=response.data;$scope.allItems=angular.copy($scope.items);$scope.search();if($scope.reloadTimeoutSec){$scope.intervalReload=$interval(function(){$scope.reloadTimeout()},$scope.reloadTimeoutSec*1e3)}})});$scope.reloadTimeout=function(){HttpService.getDataUrl($scope.url,params).then(function(response){$scope.newAllItems=[];$scope.safeApply(function(){if(!angular.isUndefined(response.data)){if(!angular.equals($scope.allItems,response.data)){var idx=$("#"+$scope.elementId+" .more-items-list div.active").index();if(idx!=-1){$("#"+$scope.elementId+" .more-items-list").owlCarousel("destroy")}$scope.safeApply($scope.starter());$scope.items=response.data;$scope.allItems=angular.copy($scope.items);$scope.search()}}})})};$scope.search=function(){$scope.filteredItems=$filter("filter")($scope.items,function(item){var x=false;if(!angular.isUndefined($scope.query)){angular.forEach($scope.searchFields,function(attr){if(searchMatch(item[attr],$scope.query)){x=true}})}else{x=true}return x});$scope.currentPage=0;if($scope.filteredItems.length==0){$scope.noresults=true}else{$scope.groupToPages()}if($scope.load==true){$scope.load=false}};$scope.loadData=function(){$scope.currentPage++;$scope.search()};$scope.groupToPages=function(){$scope.isLoading=true;$scope.pagedItems=[];$scope.currentPage++;$scope.imageLocations=[];for(;$scope.index<$scope.itemsPerPage*$scope.page;$scope.index++){$scope.moreLoad=$scope.filteredItems.length>$scope.index;if($scope.moreLoad==false)break;$scope.pagedItems.push($scope.filteredItems[$scope.index]);if(!angular.isUndefined($scope.filteredItems[$scope.index].media)&&!angular.isUndefined($scope.filteredItems[$scope.index].media[0])&&typeof $scope.filteredItems[$scope.index].media[0]!=="undefined"&&$scope.filteredItems[$scope.index].media[0]!==null){if(CommonFactory.isMobile()&&!angular.isUndefined($scope.filteredItems[$scope.index].media[0].mobile)){$scope.filteredItems[$scope.index].image=$scope.filteredItems[$scope.index].media[0].mobile}else{$scope.filteredItems[$scope.index].image=$scope.filteredItems[$scope.index].media[0].thumbnail}}}$scope.safeApply(function(){angular.forEach($scope.pagedItems,function(item){$scope.s
3afeApply(function(){$scope.pagedItemsLoadedPreload.push(item)})});$scope.isLoading=false;$scope.isSuccessful=true;$scope.percentLoaded=0;if($scope.page==1){$scope.viewNext()}})};$scope.preload=function(imageLocations){preloader.preloadImages(imageLocations).then(function handleResolve(imageLocations){$scope.isLoading=false;$scope.isSuccessful=true;angular.forEach($scope.resultsPage,function(item){$scope.safeApply(function(){$scope.results.push(item)})});$scope.more=$scope.moreLoad;$scope.percentLoaded=0},function handleReject(imageLocation){$scope.isLoading=false;$scope.isSuccessful=false},function handleNotify(event){$scope.percentLoaded=event.percent})};$scope.windowOpen=function(url,title,options){$window.open(url,title,options)};$scope.preloadNextItems=function(){$scope.page+=1;if($scope.firstLoad){$scope.firstLoad=false;$scope.isLoading=true;$scope.safeApply(function(){$scope.loadData()})}else{$scope.safeApply($scope.loadData())}};$scope.viewNext=function(){angular.forEach($scope.pagedItems,function(item){$scope.safeApply(function(){$scope.pagedItemsLoaded.push(item)})});$scope.preloader=true;$scope.safeApply($scope.preloadNextItems());if($scope.pagedItems.length==0){$scope.more=false;$scope.isLoading=false}};$scope.show_more=function(){$scope.viewNext()};$scope.nextPage=function(){if($scope.currentPage<$scope.pagedItems.length-1){$scope.currentPage++}};$scope.show_more_Infinite=function(){$scope.page++;$scope.loadData()};$scope.has_more=function(){return $scope.more;if(!angular.isUndefined($scope.filteredItems)){if($scope.currentPage<$scope.filteredItems.length-1){return true}}else{return false}};$scope.viewSocial=function(args){if($scope.onSocial)return true;$scope.onSocial=true;console.log("social true");if(!$scope.alreadyLoadedSocial){$scope.alreadyLoadedSocial=true;$rootScope.safeApply($rootScope.$emit("initSocialStream",args))}else{$rootScope.$emit("onSocialStream",true)}$scope.safeApply(goToByScroll("home-tool-bar",0))};$scope.setFilterClass=function(filterClass){if($scope.onSocial){$scope.onSocial=false;$rootScope.$emit("onSocialStream",false)}goToByScroll("home-tool-bar",0);$scope.filterClass=filterClass;$scope.safeApply($scope.starter());$scope.search();return false};$scope.show_plus=function(item){if(angular.isUndefined(item.show_plus)){item.show_plus=true}else if(item.show_plus==true){item.show_plus=false}else{item.show_plus=true}};$scope.get_plus_icon=function(item){var icon="fa-plus-square-o";if(!angular.isUndefined(item.show_plus)&&item.show_plus==true){icon="fa-minus-square-o "}return icon};$scope.doSomething=function(fotoramaId){var $fotoramaDiv=angular.element("#"+fotoramaId+" ul");$fotoramaDiv.fotorama()}}}]);"use strict";angular.module("Mailing",["services.HttpService","directives.spinner","directives.resizables","ngSanitize","Scope.safeApply"]).controller("MailingController",["$scope","$filter","$http","HttpService","$window","$location","preloader","$timeout","$rootScope","CommonFactory","$base64","require_authentication","$compile","$sce",function($scope,$filter,$http,HttpService,$window,$location,preloader,$timeout,$rootScope,CommonFactory,$base64,require_authentication,$compile,$sce){$scope.actionsUrl="/api/subscriptions";$scope.getHashParams=function(){var urlParams={};var hashLoad=$location.hash();if(hashLoad){var hashParams=hashLoad.split("&");angular.forEach(hashParams,function(h){var h2=h.split("=");if(h2.length==2){urlParams[h2[0]]=h2[1]}else{urlParams[h2[0]]=true}})}return urlParams};$scope.init=function(){console.log($scope.getHashParams())}}]);"use strict";App.run(function($rootScope,$http,$timeout,$base64,pathSettings){$rootScope.configLoaded=false;if(!pathSettings){console.log("Not pathSettings");return}console.log("pathSettings",pathSettings);$http.get(pathSettings).then(function(results){if(results.status!=200){console.log("config error")}else{$rootScope.configLoaded=true;console.log("result",results);if(!angular.isUndefined(results.data.validGroups)){$rootScope.currentPathValidGroups=[];try{$rootScope.currentPathValidGroups=angular.fromJson($base64.decode(results.data.validGroups))}catch(e){console.log("ERROR PARSING VALID GROUPS");return}}}});$rootScope.userHasValidGroups=function(){if(!$rootScope.configLoaded){return false}var hasAccess=false;angular.forEach($rootScope.currentPathValidGroups,function(group){if($rootScope.currentUser.groups.indexOf(group.toString())>-1){hasAccess=true}});return hasAccess};$rootScope.userNotHasValidGroups=function(){if(!$rootScope.configLoaded){return false}var hasAccess=true;angular.forEach($rootScope.currentPathValidGroups,function(group){if($rootScope.currentUser.groups.indexOf(group.toString())>-1){hasAccess=false}});return hasAccess}});angular.module("Main",["services.HttpService","ngRepeatUtils","services.Common"]).controller("MainController",["$http","$rootScope","$scope","$
3window","$timeout","$filter","$document","$interval","toastr","sessionService","$resource","require_authentication","not_authentication_redirect_url","auth_url","system_language","$translate","googleClientId","facebookAppId","auth_api","loginRedirectURL","logoutRedirect","$location","stripePublishableKey","passwordStrength","cookiesBarV2","preloadLinks","preloadLinksMessage","$compile","$cookies","HttpService","$analytics","preloader","COMMON","socialLoginInline","socialRedirect","hashParams","ga4","qiuAnalytics","CommonFactory","$base64","noLoginOverlay",function($http,$rootScope,$scope,$window,$timeout,$filter,$document,$interval,toastr,sessionService,$resource,require_authentication,not_authentication_redirect_url,auth_url,system_language,$translate,googleClientId,facebookAppId,auth_api,loginRedirectURL,logoutRedirect,$location,stripePublishableKey,passwordStrength,cookiesBarV2,preloadLinks,preloadLinksMessage,$compile,$cookies,HttpService,$analytics,preloader,COMMON,socialLoginInline,socialRedirect,hashParams,ga4,qiuAnalytics,CommonFactory,$base64,noLoginOverlay){$scope.loading=true;$scope.forgot=false;$scope.modalSignup=false;$scope.menuItems=[];$rootScope.currentUser=false;$rootScope.logoutRedirect="";$rootScope.loginRedirect="";$rootScope.loadingAccount=true;$scope.userChecked=false;$scope.cookiesBarV2=cookiesBarV2;$scope.showFacebookLogin=false;$rootScope.postMessages={};$scope.setSocialToken=false;$scope.defaultHeaderJson="";$scope.loginStatus=0;$rootScope.$on("site:loginRequired",function(){angular.element($document).ready(function(){})});$rootScope.$on("site:loginFromForm",function(event,userToken){angular.element($document).ready(function(){sessionService.setToken(userToken);$rootScope.$emit("site:userLoggedIn");sessionService.log({action:"SuccesfullLogin",extra:{url:window.location.href}}).then(function(){var domainHostname=window.location.hostname.replace(/^[^.]+\./g,"");if(domainHostname=="cloudfront.net"||domainHostname=="fiaformulae.com"){domainHostname=window.location.hostname}var expiryDate=new Date;expiryDate.setMonth(expiryDate.getMonth()+1);document.cookie="qiuTimer="+(new Date).getTime()+";expires="+expiryDate.toGMTString()+";path=/;Secure;SameSite=None;domain="+domainHostname});useCredentials()})});$rootScope.$on("site:userLogged",function(){angular.element(document.querySelector("body")).addClass("user-loggedin");angular.element(document).ready(function(){$scope.checkUserToken()});$rootScope.$emit("site:userUpdate")});$rootScope.$on("site:userLoggedOut",function(){angular.element(document.querySelector("body")).removeClass("user-loggedin");if(typeof window["loginLogoutReload"]=="function"){loginLogoutReload(1)}$timeout(function(){if(require_authentication){window.location=$rootScope.logoutRedirect}else if(logoutRedirect){if($location.path()!=logoutRedirect){if(preloadLinksMessage){if(typeof window["animationOnPageStart"]=="function"){animationOnPageStart(logoutRedirect)}}else if(logoutRedirect=="#"&&preloadLinks){$scope.onReadyRun()}else{window.location=logoutRedirect}}else{$scope.onReadyRun()}}else if(!angular.isUndefined($rootScope.logoutRedirect)&&$rootScope.logoutRedirect){if(preloadLinksMessage){if(typeof window["animationOnPageStart"]=="function"){animationOnPageStart($rootScope.logoutRedirect)}}else{window.location=$rootScope.logoutRedirect}}},500);angular.element(document).ready(function(){});$rootScope.$emit("site:userUpdate")});$rootScope.$on("site:userLoggedIn",function(){angular.element(document.querySelector("body")).addClass("user-loggedin");angular.element(document.querySelector("body")).removeClass("md-overlay-opened");if(typeof window["loginLogoutReload"]=="function"){loginLogoutReload()}if(!angular.isUndefined($rootScope.loggedMessage)&&$rootScope.loggedMessage){$rootScope.userLoggedMessageShow=true}var storedRedirect=window.localStorage.getItem("return_url");if(storedRedirect){$rootScope.loginRedirect=storedRedirect;window.localStorage.removeItem("return_url")}if($rootScope.loginRedirect){if(preloadLinksMessage){if(typeof window["animationOnPageStart"]=="function"){animationOnPageStart($rootScope.loginRedirect)}}else{if(!angular.isUndefined($rootScope.loggedMessage)&&$rootScope.loggedMessage){if(noLoginOverlay&&loginRedirectURL){var redir=window.location.protocol+"//"+window.location.host+loginRedirectURL;console.log("redirect",redir);$window.location.href=redir}else{$rootScope.$on("site:modal-close-loggedIn",function(){window.location=$rootScope.loginRedirect})}}else{window.location=$rootScope.loginRedirect}}}else{if(require_authentication){window.location="/"}else if(loginRedirectURL){if($location.path()!=loginRedirectURL){$timeout(function(){if(loginRedirectURL=="##"){if(!angular.isUndefined($rootScope.loggedMessage)&&$rootScope.loggedMessage){$rootScope.$on("site:modal-close-loggedIn",function(){window.location.reload()})}else{var currentUrl=window.location.origin+window.location.pathname+window.location.search;$window.location.href=currentUrl}}else{if(preloadLinksMessage){if(typeof window["animationOnPageStart"]=="function"){animationOnPageStart(loginRedirectURL)}}else{if(!angular.isUndefined($rootScope.loggedMessage)&&$rootScope.loggedMessage){if(noLoginOverlay&&loginRedirectURL){var redir=window.location.protocol+"//"+window.location.host+loginRedirectURL;console.log("redirect",redir);$window.location.href=redir}else{$rootScope.$on("site:modal-close-loggedIn",function(){window.location=loginRedirectURL})}}else{window.location=loginRedirectURL}}}},500)}else{$timeout(function(){if(loginRedirectURL=="##"){if(!angular.isUndefined($rootScope.loggedMessage)&&$rootScope.loggedMessage){$rootScope.$on("site:modal-close-loggedIn",function(){window.location.reload()})}else{window.location.reload()}}else{$rootScope.renderFotoramaFrame()}},500)}}else{$scope.onReadyRun()}}angular.element(document).ready(function(){})});function findGAId(){var gtmScript=document.querySelector('script[src*="googletagmanager.com/gtm.js?id="]');if(gtmScript){var gtmIdMatch=gtmScript.src.match(/googletagmanager\.com\/gtm\.js\?id=(GTM-\w+)/);
3if(gtmIdMatch){return gtmIdMatch[1]}}var gtagScript=document.querySelector('script[src*="www.googletagmanager.com/gtag/js?id="]');if(gtagScript){var gtagIdMatch=gtagScript.src.match(/www\.googletagmanager\.com\/gtag\/js\?id=(G-.+)/);if(gtagIdMatch){return gtagIdMatch[1]}}console.log("Neither GTM nor gtag.js were found on the page.");return null}function removeGAIfQiuprev(){var url=window.location.href;if(url.includes("qiuprev")){var gaId=findGAId();if(gaId){window["ga-disable-"+gaId]=true}else{console.log("GA ID could not be found")}}}removeGAIfQiuprev();$rootScope.$on("site:userUpdate",function(){$rootScope.currentUser=sessionService.getUser()});window.addEventListener("hashchange",function(opt){$rootScope.$emit("site:hashChanged",opt)},false);$rootScope.updateUserData=function(){var token=$cookies.get("token");if(token){sessionService.authenticate().then(function(){var token=$cookies.get("token");if(token==sessionService.user.token){var domainHostname=window.location.hostname.replace(/^[^.]+\./g,"");if(domainHostname=="cloudfront.net"||domainHostname=="fiaformulae.com"){domainHostname=window.location.hostname}var expiryDate=new Date;expiryDate.setMonth(expiryDate.getMonth()+1);document.cookie="uData="+JSON.stringify(sessionService.user)+";expires="+expiryDate.toGMTString()+";path=/;Secure;SameSite=None;domain="+domainHostname;useCredentials()}else{removeCredentials()}},function(){$scope.closeAlert(0)})}};$scope.nativeShare=function(article){console.log("article",article);if(navigator.share){console.log("navigator share...");navigator.share({title:article.title,text:article.short_text,url:article.url}).then(()=>{console.log("Thanks for sharing!")}).catch(error=>{console.error("Error sharing:",error)})}else if(typeof window["AndroidJS"]=="object"){console.log("android share...");AndroidJS.share(article.title,article.short_text,article.url)}};
3$scope.gaEvent=function(gaCategory,gaType,eventParams){if(ga4){var eventType=gaType?gaType:ga4;window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments)}$timeout(function(){gtag(gaCategory,eventType,eventParams);qiuAnalytics.event({event:gaType,extra:eventParams})})}};$rootScope.gaEvent=$scope.gaEvent;$scope.getHashParams=function(){var urlParams={};var hashLoad=$location.hash();if(hashLoad){var hashParams=hashLoad.split("&");angular.forEach(hashParams,function(h){var h2=h.split("=");if(h2.length==2){urlParams[h2[0]]=h2[1]}else{urlParams[h2[0]]=true}})}return urlParams};$scope.redirect=function(url){window.location.href=url};$scope.currentLanguage=function(){if(!$scope.navigatorLang){var lang=window.navigator.languages?window.navigator.languages[0]:null;lang=lang||window.navigator.language||window.navigator.browserLanguage||window.navigator.userLanguage;if(lang.indexOf("-")!==-1)lang=lang.split("-")[0];if(lang.indexOf("_")!==-1)lang=lang.split("_")[0];if(!lang){lang="en"}$scope.navigatorLang=lang}return $scope.navigatorLang};var initVars=function(){$scope.loading=false;$scope.responseSignUpRequest=false;$scope.errorSessions=false;$scope.modalsessionerror=false;$scope.sessions=[];$scope.alerts=[];$scope.someFocusVariable=true;$scope.user={username:"",password:""};$scope.usersignup={email:"",name:"",password:"",repeatpassword:"",agreedTOS:false};var hashParams=$scope.getHashParams();if(!angular.isUndefined(hashParams.next)){$rootScope.loginRedirect=hashParams.next}$translate.use(system_language.substr(0,2))};var initCookies=function(){if($scope.cookiesBarV2){$rootScope.$watch("cookiesData",function(cookiesData){if(!angular.isUndefined(cookiesData)){qiukies.updateDialogProperty("header-container","content",cookiesData.title);qiukies.updateDialogProperty("body-text-content","content",cookiesData.text);qiukies.updateDialogProperty("review-button","content",cookiesData.review);qiukies.updateDialogProperty("close-button","content",cookiesData.close);var domainHostname=window.location.hostname.replace(/^[^.]+\./g,"");if(domainHostname=="cloudfront.net"||domainHostname=="fiaformulae.com"){domainHostname=window.location.hostname}var expiryDate=new Date;expiryDate.setMonth(expiryDate.getMonth()+1);document.cookie="qiukies-groups="+JSON.stringify(cookiesData.groups)+";expires="+expiryDate.toGMTString()+";path=/;Secure;SameSite=None;domain="+domainHostname;if(cookiesData.groups.length>0){qiukies.removeAvoided()}angular.forEach(cookiesData.groups,function(group){qiukies.registerGroup(group.type,group.name,group.description,false);qiukies.registerURL(group.type,group.restrictions)});qiukies.start()}})}};function authenticateSession(){if(auth_api){var urlParams=$scope.getHashParams();if(sessionService.tokenExists()){var token=sessionService.getToken();if(token&&sessionService.isAuthenticated()){$rootScope.$emit("site:userLogged")}else if(token&&!$scope.alreadyCheckedProfile){$scope.alreadyCheckedProfile=true;sessionService.profile().then(function(e){sessionService.setUser(e.user);authenticateSession()})}}else if(!angular.isUndefined(urlParams.token)&&socialLoginInline){const loginUserGroups=$window.sessionStorage.getItem("loginUserGroups");var socialOptions={socialToken:angular.copy(urlParams.token),userGroups:loginUserGroups?loginUserGroups.split(","):[]};delete urlParams["token"];hashParams.setHashParams(urlParams);sessionService.authenticateSocial(socialOptions).then(function(response){if(response.token){$scope.alerts=[];sessionService.setToken(response.token);if(!angular.isUndefined(response.redirect)){$rootScope.loginRedirect=response.redirect}else if(loginRedirectURL){$rootScope.loginRedirect=loginRedirectURL}$rootScope.$emit("site:userLoggedIn");sessionService.log({action:"SuccesfullLogin",extra:{url:window.location.href}}).then(function(){var domainHostname=window.location.hostname.replace(/^[^.]+\./g,"");if(domainHostname=="cloudfront.net"||domainHostname=="fiaformulae.com"){domainHostname=window.location.hostname}var expiryDate=new Date;expiryDate.setMonth(expiryDate.getMonth()+1);document.cookie="qiuTimer="+(new Date).getTime()+";expires="+expiryDate.toGMTString()+";path=/;Secure;SameSite=None;domain="+domainHostname});$scope.setSocialToken=socialOptions.socialToken;useCredentials()}else{if($window.location.hostname==="mediahub.americascup.com"){$window.sessionStorage.setItem("socialToken",socialOptions.socialToken);if(auth_url){window.location=auth_url}else{$window.location.href="/login#register"}}else{$scope.loading=false;$rootScope.$emit("site:loginRequired");$scope.alerts.push({type:"danger",msg:response.detail});$timeout(function(){$scope.alerts=[]},2e3);$rootScope.socialToken=socialOptions.socialToken;if(window.location.host.includes("runtag")||window.location.host.includes("fotorun")||window.location.host.includes("fotografix")||window.location.host.includes("fotopy")||window.location.host.includes("fotocarrera")||window.location.host.includes("photodigitalone")){$rootScope.openModal("modal-register-overlay");$("#social-login").hide();return}}}},function(response){$scope.loading=false;$rootScope.$emit("site:loginRequired");$rootScope.socialToken=socialOptions.socialToken;$scope.alerts.push({type:"danger",msg:response.detail});$timeout(function(){$scope.alerts=[]},2e3)})}else if(require_authentication&¬_authentication_redirect_url){if($("#content").length){$("#content").html("")}window.location.href=not_authentication_redirect_url+"#next="+window.location.pathname}else if(require_authentication&&!not_authentication_redirect_url){$timeout(function(){$scope.openModalClass("modal-signin")},1e3)}}else{var token=$cookies.get("token");var updateUser=1;if(token&&updateUser){sessionService.authenticate().then(function(){var token=$cookies.get("token");if(token==sessionService.user.token){var domainHostname=window.location.hostname.replace(/^[^.]+\./g,"");if(domainHostname=="cloudfront.net"||domainHostname=="fiaformulae.com"){domainHostname=window.location.hostname}var expiryDate=new Date;expiryDate.setMonth(expiryDate.getMonth()+1);document.cookie="uData="+JSON.stringify(sessionService.user)+";expires="+expiryDate.toGMTString()+";path=/;Secure;SameSite=None; domain="+domainHostname;useCredentials()}else{if(require_authentication&&auth_url){window.location=auth_url}removeCredentials()}},function(){if(require_authentication&&auth_url){window.location=auth_url}$scope.closeAlert(0)})}else if(token){useCredentials()}else{sessionService.authenticate().then(function(){if(sessionService.user.token){var domainHostname=window.location.hostname.replace(/^[^.]+\./g,"");if(domainHostname=="cloudfront.net"||domainHostname=="fiaformulae.com"){domainHostname=window.location.hostname}var token=sessionService.user.token;var expiryDate=new Date;expiryDate.setMonth(expiryDate.getMonth()+1);document.cookie="token="+sessionService.user.token+";expires="+expiryDate.toGMTString()+";path=/;Secure;SameSite=None;domain="+domainHostname;document.cookie="uData="+JSON.stringify(sessionService.user)+";expires="+expiryDate.toGMTString()+";path=/;Secure;SameSite=None;domain="+domainHostname;useCredentials()}},function(){if(require_authentication&&auth_url){window.location=auth_url}$scope.closeAlert(0)});if(require_authentication&&auth_url){window.location=auth_url}}}}function useCredentials(){if(auth_api){useCredentialsv2()}else{var lang=window.navigator.languages?window.navigator.languages[0]:null;lang=lang||window.navigator.language||window.navigator.browserLanguage||window.navigator.userLanguage;if(lang.indexOf("-")!==-1)lang=lang.split("-")[0];if(lang.indexOf("_")!==-1)lang=lang.split("_")[0];sessionService.set("language",lang);var token=$cookies.get("token");var userData=$cookies.get("uData");$rootScope.loadingAccount=false;$rootScope.currentUser=JSON.parse(userData);$rootScope.$emit("site:userLogged");$rootScope.userLogged=true}}function removeCredentials(){if(auth_api){sessionService.clearAuthentication();$timeout(function(){$rootScope.$emit("site:userLoggedOut")},500)}else{sessionService.logout().then(function(response){$scope.alerts=[];if(response.success==true){if(response.redirect){$rootScope.logoutRedirect=response.redirect}$cookies.remove("satellizer_token");$cookies.remove("token");$cookies.remove("uData");$rootScope.currentUser=false;$rootScope.userLogged=false;$rootScope.$emit("site:userLoggedOut")}else{$cookies.remove("satellizer_token");$cookies.remove("token");$cookies.remove("uData");$rootScope.currentUser=false;$rootScope.userLogged=false;$rootScope.$emit("site:userLoggedOut")}},function(){$cookies.remove("satellizer_token");$cookies.remove("token");$cookies.remove("uData");$rootScope.currentUser=false;$rootScope.userLogged=false;$rootScope.$emit("site:userLoggedOut")})}}function loginSession(loginOptions){if(auth_api){loginSessionv2(loginOptions)}else{$scope.alerts=[];sessionService.login(loginOptions).then(function(response){$scope.alerts=[];if(response.success==true){var domainHostname=window.location.hostname.replace(/^[^.]+\./g,"");if(domainHostname=="cloudfront.net"||domainHostname=="fiaformulae.com"){domainHostname=window.location.hostname}var expiryDate=new Date;expiryDate.setMonth(expiryDate.getMonth()+1);document.cookie="token="+sessionService.user.token+";expires="+expiryDate.toGMTString()+";path=/;Secure;SameSite=None;domain="+domainHostname;document.cookie="uData="+JSON.stringify(sessionService.user)+";expires="+expiryDate.toGMTString()+";path=/;Secure;SameSite=None;domain="+domainHostname;if(!angular.isUndefined(sessionService.user.profile)&&!angular.isUndefined(sessionService.user.finished)){if(!sessionService.user.finished){$rootScope.loginRedirect=sessionService.user.profile}}$scope.loadingAccount=false;$scope.loading=false;$scope.destroy("modal-signin");$rootScope.$emit("site:userLoggedIn");useCredentials()}else{$scope.loading=false;$scope.loadingAccount=false;$scope.alerts.push({type:"danger",msg:response.payload.message})}},function(){$scope.loadingAccount=false;$rootScope.$emit("site:loginRequired");$scope.alerts.push({type:"danger",msg:"Invalid credentials!"})})}}var _generatePassword=function(len){var length=len?len:10;var string="abcdefghijklnopqrstuvwxyz";var numeric="0123456789";var punctuation="!@#$%^&*()_+~`|}{[]:;?><,./-=";var password="";var character="";var crunch=true;while(password.length<length){var entity1=Math.ceil(string.length*Math.random()*Math.random());var entity2=Math.ceil(numeric.length*Math.random()*Math.random());var entity3=Math.ceil(punctuation.length*Math.random()*Math.random());var hold=string.charAt(entity1);
3hold=entity1%2==0?hold.toUpperCase():hold;character+=hold;character+=numeric.charAt(entity2);character+=punctuation.charAt(entity3);password=character}return password};var loginSuccess=function(user){$scope.safeApply(function(){$rootScope.currentUser=$scope.user})};var converttoBlob=function(){var img=document.getElementById("imgInp");var canvas=document.createElement("canvas");var ctx=canvas.getContext("2d");canvas.width=img.width;canvas.height=img.height;ctx.drawImage(img,0,0);var dataUrl=canvas.toDataURL("image/png");var blob=dataUriToBlob(dataUrl);var form=new FormData;var xhr=new XMLHttpRequest;xhr.open("POST","/some/url",true);xhr.onreadystatechange=function(){if(xhr.readyState==4){if(xhr.status==200){alert("Success: "+xhr.responseText)}else{alert("Error submitting image: "+xhr.status)}}};form.append("param1","value1");form.append("param2","value2");form.append("theFile",blob);xhr.send(form);function dataUriToBlob(dataURI){var byteString;if(dataURI.split(",")[0].indexOf("base64")>=0){byteString=atob(dataURI.split(",")[1])}else{byteString=unescape(dataURI.split(",")[1])}var mimeString=dataURI.split(",")[0].split(":")[1].split(";")[0];var array=[];for(var i=0;i<byteString.length;i++){array.push(byteString.charCodeAt(i))}return new Blob([new Uint8Array(array)],{type:mimeString})}};$scope.destroy=function(id,reload){$("#"+id).removeClass("md-show");$("#"+id+" .md-preview-media").html("");$("body").removeClass("md-overlay-opened");$timeout(function(){$scope.safeApply(function(){initVars()})},0);if(reload)$window.location.reload()};$scope.openModalClass=function(modalName,modalClass){$rootScope.openModal(modalName,modalClass)};$scope.logOut=function(form){sessionService.log({action:"LoggedOut"}).then(function(){removeCredentials();let URL=window.location.href;if(URL.indexOf("validate-admin-users")!=-1){window.location.href=URL}}).catch(function(resp){removeCredentials()})};$scope.logIn=function(form){if(auth_api){$scope.logInv2(form)}else{$scope.loading=true;$scope.errorMessage=null;$scope.alerts=[];if(!(form.username&&form.password)){$scope.closeAlert(0);$scope.alerts.push({type:"danger",msg:"Please supply a username and password"});$scope.loading=false;$timeout(function(){$scope.$apply()});return}var validEmail=$filter("email")(form.username);if(validEmail){var options={username:form.username,password:form.password}}else{var options={username:form.username,password:form.password}}loginSession(options)}};$scope.closeAlert=function(index){$scope.alerts.splice(index,1)};$scope.onSuccessSocial=function(socialOptions){sessionService.authenticateSocial(socialOptions).then(function(response){if(response.success==true){var expiryDate=new Date;expiryDate.setMonth(expiryDate.getMonth()+1);var domainHostname=window.location.hostname.replace(/^[^.]+\./g,"");if(domainHostname=="cloudfront.net"||domainHostname=="fiaformulae.com"){domainHostname=window.location.hostname}document.cookie="token="+sessionService.user.token+";expires="+expiryDate.toGMTString()+";path=/;Secure;SameSite=None;domain="+domainHostname;document.cookie="uData="+JSON.stringify(sessionService.user)+";expires="+expiryDate.toGMTString()+";path=/;Secure;SameSite=None;domain="+domainHostname;if(!angular.isUndefined(sessionService.user.profile)&&!angular.isUndefined(sessionService.user.finished)){if(!sessionService.user.finished){$rootScope.loginRedirect=sessionService.user.profile}}$scope.loadingAccount=false;$scope.loading=false;$scope.destroy("modal-signin");$rootScope.$emit("site:userLoggedIn");useCredentials()}else{$scope.loading=false;$rootScope.$emit("site:loginRequired");$scope.alerts.push({type:"danger",msg:response.data.detail})}},function(err){$scope.loading=false;console.log(err)})};$scope.authenticateSocial=function(socialOptions){sessionService.authenticateSocial(socialOptions).then(function(response){$scope.alerts=[];sessionService.setToken(response.token);if(!angular.isUndefined(response.redirect)){$rootScope.loginRedirect=response.redirect}$rootScope.$emit("site:userLoggedIn");sessionService.log({action:"SuccesfullLogin",extra:{url:window.location.href}}).then(function(){var domainHostname=window.location.hostname.replace(/^[^.]+\./g,"");if(domainHostname=="cloudfront.net"||domainHostname=="fiaformulae.com"){domainHostname=window.location.hostname}var expiryDate=new Date;expiryDate.setMonth(expiryDate.getMonth()+1);document.cookie="qiuTimer="+(new Date).getTime()+";expires="+expiryDate.toGMTString()+";path=/;Secure;SameSite=None;domain="+domainHostname});useCredentials()},function(response){$scope.loading=false;$rootScope.$emit("site:loginRequired");$scope.alerts.push({type:"danger",msg:response.detail})})};$scope.onFailureSocial=function(error_message){console.log(error_message);$scope.loading=false};$window.openQiukies=function(){$scope.openModal("modal-qiukies")};$window.closeQiukies=function(){$scope.closeModal("modal-qiukies")};$window.facebookStart=function(){$(".facebook-signin").removeClass("ng-hide");FB.init({appId:facebookAppId,xfbml:true,version:"v3.0"});$(".facebook-signin").on("click",function(){$scope.loading=true;FB.login(function(response){$scope.FacebookStatusChange(response)},{scope:"email,public_profile",return_scopes:true})})};$scope.FacebookStatusChange=function(response){if(response.status==="connected"){$scope.authenticateSocial(response)}else if(response.status==="not_authorized"){$scope.onFailureSocial("not-authorized")}else{$scope.onFailureSocial("not-logged-in")}};$window.googleStart=function(){gapi.load("auth2",function(){var auth2=gapi.auth2.init({client_id:googleClientId,scope:"profile email",cookie_policy:"none"});$(".google-signin").each(function(){var elementId=$(this).attr("id");var element=document.getElementById(elementId);auth2.attachClickHandler(element,{},function(googleUser){$scope.loading=true;var authResponse=googleUser.getAuthResponse();const loginUserGroups=$window.sessionStorage.getItem("loginUserGroups");var socialOptions={service:"google",token:authResponse.id_token,userGroups:loginUserGroups?loginUserGroups.split(","):[]};$scope.onSuccessSocial(socialOptions)},function(error){console.log(error);$scope.onFailureSocial("not-authorized")})});setTimeout(function(){$(".google-signin2").each(function(){$(this).attr("id","google-signin2");var elementId="google-signin2";var element=document.getElementById(elementId);auth2.attachClickHandler(element,{},function(googleUser){$scope.loading=true;var authResponse=googleUser.getAuthResponse();const loginUserGroups=$window.sessionStorage.getItem("loginUserGroups");var socialOptions={service:"google",token:authResponse.id_token,userGroups:loginUserGroups?loginUserGroups.split(","):[]};var profile=googleUser.getBasicProfile();$scope.onSuccessSocial(socialOptions)},function(error){console.log(error);$scope.onFailureSocial("not-authorized")})})},1e3)})};$scope.checkUserOrLogin=function(){if($rootScope.currentUser.isAccountAuthenticated){return true}else{if(!$scope.noAutoModal){$scope.noAutoModal=true;openWhenNotLogged()}return false}};function openWhenNotLogged(){$timeout(function(){if(!$scope.checkUserOrLogin()){$scope.openModalClass("modal-signin")}},1e3)}function useCredentialsv2(){sessionService.profile().then(function(response){$scope.userChecked=true;$scope.alerts=[];sessionService.setUser(response.user);if($rootScope.userLoggedMessageShow&&!angular.isUndefined(response.user.extra)&&!angular.isUndefined(response.user.extra.loggedMessage)&&response.user.extra.loggedMessage.length>
30){$("#modal-general .md-body").html(response.user.extra.loggedMessage);$rootScope.openModal("modal-general","","","loggedIn");$rootScope.userLoggedMessageShow=false}var storedRedirect=window.localStorage.getItem("return_url");if(storedRedirect){window.localStorage.removeItem("return_url");$window.location.href=storedRedirect}else if($rootScope.loginRedirect){$window.location.href=$rootScope.loginRedirect}else if(noLoginOverlay&&loginRedirectURL){var redir=window.location.protocol+"//"+window.location.host+loginRedirectURL;console.log("redirect",redir);$window.location.href=redir}else if(window.location.pathname.indexOf("/login")!==-1){$window.location.href=loginRedirectURL&&loginRedirectURL!=="##"?loginRedirectURL:"/"}else{location.reload()}},function(response){$scope.loadingAccount=false;$rootScope.$emit("site:loginRequired");$scope.alerts.push({type:"danger",msg:response.data.detail});$timeout(function(){$scope.alerts=[]},4e3);if($scope.setSocialToken){$rootScope.socialToken=$scope.setSocialToken}})}function loginSessionv2(loginOptions){$scope.alerts=[];sessionService.loginv2(loginOptions).then(function(response){$scope.alerts=[];sessionService.setToken(response.token);$rootScope.$emit("site:userLoggedIn");sessionService.log({action:"SuccesfullLogin",extra:{url:window.location.href}}).then(function(){var domainHostname=window.location.hostname.replace(/^[^.]+\./g,"");var URL=window.location.href;if(domainHostname=="cloudfront.net"||domainHostname=="fiaformulae.com"){domainHostname=window.location.hostname}var expiryDate=new Date;expiryDate.setMonth(expiryDate.getMonth()+1);document.cookie="qiuTimer="+(new Date).getTime()+";expires="+expiryDate.toGMTString()+";path=/;Secure;SameSite=None;domain="+domainHostname;if(URL.indexOf("validate-admin-users")!=-1){window.location.href=URL}});useCredentials()},function(response){$scope.loading=false;$rootScope.$emit("site:loginRequired");$scope.alerts.push({type:"danger",msg:response.data.detail});$timeout(function(){$scope.alerts=[]},5e3)})}$scope.verificateEmail=function(form,forceCreateAndLogin=false){sessionService.checkEmail({email:form.username}).then(function(response){$scope.loginStatus=response.verification_code;switch(response.verification_code){case 1:if(forceCreateAndLogin){sessionService.signup({withoutPassword:true,email:form.username}).then(function(response){if(response.success){sessionService.setToken(response.token);authenticateSession();$rootScope.closeModal("modal-signin")}});break}$rootScope.closeModal("modal-signin");$scope.loginStatus=0;$rootScope.openModal("modal-register-overlay");break;case 2:$scope.loginStatus=0;$scope.magicLogin.email=form.username;$rootScope.closeModal("modal-signin");$rootScope.openModal("modal-magic-login");$scope.magicLoginSend();break;case 7:break}})};$scope.verifyEmailAuth0=function(form){sessionService.verifyEmailAuth0(form.username).then(function(response){form.isAuth0=true;$scope.loginStatus=response.verification_code;switch(response.verification_code){case 1:$rootScope.closeModal("modal-signin");$scope.loginStatus=0;$rootScope.openModal("modal-register-overlay");break;case 3:break}})};$scope.changeEmailUser=function(){$scope.loginStatus=0;$scope.user.username=""};$scope.logInv2=function(form){$scope.loading=true;$scope.errorMessage=null;$scope.alerts=[];if(!(form.username&&form.password)){$scope.closeAlert(0);$scope.alerts.push({type:"danger",msg:"Please supply a username and password"});$scope.loading=false;$timeout(function(){$scope.$apply()});return}var validEmail=$filter("email")(form.username);if(validEmail){var options={email:form.username,password:form.password}}else{var options={email:form.username,password:form.password}}if(form.isAuth0){options.isAuth0=true}loginSession(options)};$scope.loadFinished=function(emitName){if(emitName){$rootScope.$emit("site:"+emitName)}};$scope.forgotSend=function(form){$scope.forgotSent=false;$scope.loadingForgot=true;$scope.errorMessage=null;$scope.alerts=[];if(!form.username){$scope.closeAlert(0);$scope.alerts.push({type:"danger",msg:"Please supply a username and password"});$scope.loading=false;$timeout(function(){$scope.$apply()});return}var validEmail=$filter("email")(form.username);var options={email:form.username};sessionService.forgot(options).then(function(response){$scope.alerts=[];$scope.loadingForgot=false;$scope.forgotSent=true;$timeout(function(){$scope.forgotSent=false},15e3)},function(response){$scope.loadingForgot=false;$scope.alerts.push({type:"danger",msg:response.data.detail})})};$scope.magicLogin={loading:false,error:false,message:false,expired:false,sent:false,email:"",code:"",token:"",countdown:0,showConfirmationCode:false,otpInput:{}};$scope.magicLoginSend=function(){$scope.magicLogin.sent=false;$scope.magicLogin.loading=true;$scope.magicLogin.error=false;$scope.magicLogin.message=false;sessionService.magicLoginRequest({email:$scope.magicLogin.email}).then(function(response){$scope.magicLogin.otpInput={type:CommonFactory.isMobile()?"number":"text",onDone:function(value){$scope.magicLogin.code=value;$scope.magicLoginConfirm()},onChange:function(value){}};$timeout(function(){$scope.magicLogin.showConfirmationCode=true});$scope.magicLogin.loading=false;$scope.magicLogin.error=!response.success;$scope.magicLogin.message=response.message;$scope.magicLogin.token=response.payload.token;$scope.magicLogin.countdown=600;$scope.magicLogin.onTimeout=function(){$scope.magicLogin.countdown--;if($scope.magicLogin.countdown>0){$timeout($scope.magicLogin.onTimeout,1e3)}else{$scope.magicLogin={loading:false,error:false,message:false,expired:true,sent:false,email:"",code:"",token:"",countdown:0,showConfirmationCode:false}}};$timeout($scope.magicLogin.onTimeout,1e3)},function(response){$scope.magicLogin.loading=false;$scope.magicLogin.error=true;$scope.magicLogin.message=response.message})};$scope.magicLoginByNumberEvent={loading:false,error:false,message:false,expired:false,sent:false,email:"",code:"",token:"",countdown:0,showConfirmationCode:false,otpInput:{}};$scope.magicLoginByNumberEventSend=function(){$scope.magicLoginByNumberEvent.
3sent=false;$scope.magicLoginByNumberEvent.loading=true;$scope.magicLoginByNumberEvent.error=false;$scope.magicLoginByNumberEvent.message=false;sessionService.magicLoginRequest({number:$scope.magicLoginByNumberEvent.number,event:$scope.magicLoginByNumberEvent.event}).then(function(response){$scope.magicLoginByNumberEvent.otpInput={type:CommonFactory.isMobile()?"number":"text",onDone:function(value){$scope.magicLoginByNumberEvent.code=value;$scope.magicLoginByNumberEventConfirm()},onChange:function(value){}};$timeout(function(){$scope.magicLoginByNumberEvent.showConfirmationCode=true});$scope.magicLoginByNumberEvent.loading=false;$scope.magicLoginByNumberEvent.error=!response.success;$scope.magicLoginByNumberEvent.message=response.message;$scope.magicLoginByNumberEvent.token=response.payload.token;$scope.magicLoginByNumberEvent.countdown=600;$scope.magicLoginByNumberEvent.onTimeout=function(){$scope.magicLoginByNumberEvent.countdown--;if($scope.magicLoginByNumberEvent.countdown>0){$timeout($scope.magicLoginByNumberEvent.onTimeout,1e3)}else{$scope.magicLoginByNumberEvent={loading:false,error:false,message:false,expired:true,sent:false,email:"",code:"",token:"",countdown:0,showConfirmationCode:false}}};$timeout($scope.magicLoginByNumberEvent.onTimeout,1e3)},function(response){$scope.magicLoginByNumberEvent.loading=false;$scope.magicLoginByNumberEvent.error=true;$scope.magicLoginByNumberEvent.message=response.message})};$scope.magicLoginConfirm=function(){sessionService.magicLogin({code:$scope.magicLogin.code,token:$scope.magicLogin.token}).then(function(response){sessionService.setToken(response.token);$rootScope.$emit("site:userLoggedIn");sessionService.log({action:"SuccesfullLogin",extra:{url:window.location.href}}).then(function(){var domainHostname=window.location.hostname.replace(/^[^.]+\./g,"");if(domainHostname=="cloudfront.net"||domainHostname=="fiaformulae.com"){domainHostname=window.location.hostname}var expiryDate=new Date;expiryDate.setMonth(expiryDate.getMonth()+1);document.cookie="qiuTimer="+(new Date).getTime()+";expires="+expiryDate.toGMTString()+";path=/;Secure;SameSite=None;domain="+domainHostname});$scope.magicLogin={loading:false,error:false,message:false,expired:false,sent:false,email:"",code:"",token:"",countdown:0,showConfirmationCode:false};$rootScope.closeModal("modal-magic-login");useCredentials()},function(response){$scope.magicLogin.loading=false;$scope.magicLogin.error=true;$scope.magicLogin.message=response.message})};$scope.magicLoginByNumberEventConfirm=function(){sessionService.magicLogin({code:$scope.magicLoginByNumberEvent.code,token:$scope.magicLoginByNumberEvent.token}).then(function(response){sessionService.setToken(response.token);$rootScope.$emit("site:userLoggedIn");sessionService.log({action:"SuccesfullLogin",extra:{url:window.location.href}}).then(function(){var domainHostname=window.location.hostname.replace(/^[^.]+\./g,"");if(domainHostname=="cloudfront.net"||domainHostname=="fiaformulae.com"){domainHostname=window.location.hostname}var expiryDate=new Date;expiryDate.setMonth(expiryDate.getMonth()+1);document.cookie="qiuTimer="+(new Date).getTime()+";expires="+expiryDate.toGMTString()+";path=/;Secure;SameSite=None;domain="+domainHostname});$scope.magicLoginByNumberEvent={loading:false,error:false,message:false,expired:false,sent:false,email:"",code:"",token:"",countdown:0,showConfirmationCode:false};$rootScope.closeModal("modal-magic-login");useCredentials()},function(response){$scope.magicLoginByNumberEvent.loading=false;$scope.magicLoginByNumberEvent.error=true;$scope.magicLoginByNumberEvent.message=response.message})};$scope.forgotConfirmSend=function(form){$scope.message="";$scope.forgotConfirmed=false;$scope.loadingForgot=true;$scope.errorForgot=false;if(!form.password){$scope.message=$translate.instant("PASSWORD_CANNOT_EMPTY");$scope.errorForgot=true;$scope.loadingForgot=false;return}var pStrength=passwordStrength.calculate(form.password,COMMON.SECURITY_LEVEL);if(form.password!=form.password2){$scope.message=$translate.instant("PASSWORDS_DONT_MATCH");$scope.errorForgot=true;$scope.loadingForgot=false;return}if(pStrength<20){$scope.message=$translate.instant("PASSWORD_STRENGTH_ERROR");$scope.errorForgot=true;$scope.loadingForgot=false;return}var options={password:form.password,token:decodeURIComponent($location.search()["token"])};if(form.isAuth0){options.isAuth0=true}sessionService.forgotConfirm(options).then(function(response){$scope.forgotConfirmed=true;$scope.loadingForgot=false},function(response){$scope.errorForgot=true;$scope.loadingForgot=false;$scope.message=response.data.detail})};$scope.changeLanguage=function(lang){$translate.use(lang);system_language=lang};
3initVars();initCookies();authenticateSession();$rootScope.renderFotoramaFrame=function(){var allFrames=document.querySelectorAll("section:not(.ng-hide):not(.renderonfinished) .fotorama__stage__frame");angular.forEach(allFrames,function(fFrame){var elem=angular.element(fFrame);$compile(elem.contents())($scope)})};$rootScope.openUrl=function(url){console.log("open url: "+url);if(typeof webkit!="undefined"&&typeof webkit.messageHandlers.qiuApp=="object"){webkit.messageHandlers.qiuApp.postMessage(angular.toJson({type:"openExternal",url:url}))}else{window.open(url)}};$rootScope.userAuthenticated=function(groupId,notGroupId){var ret=false;if($rootScope.currentUser&&$rootScope.currentUser.isAccountAuthenticated&&$rootScope.currentUser.groups){var hasGroupId=groupId!==undefined&&groupId!==null&&groupId!=="";var hasNotGroupId=notGroupId!==undefined&¬GroupId!==null&¬GroupId!=="";if(hasGroupId){var groupIds=angular.isArray(groupId)?groupId:[groupId];angular.forEach(groupIds,function(id){for(var i=0;i<$rootScope.currentUser.groups.length;i++){if($rootScope.currentUser.groups[i]==id){ret=true;break}}})}else if(hasNotGroupId){var notGroupIds=angular.isArray(notGroupId)?notGroupId:[notGroupId];var foundAny=false;angular.forEach(notGroupIds,function(id){for(var i=0;i<$rootScope.currentUser.groups.length;i++){if($rootScope.currentUser.groups[i]==id){foundAny=true;break}}});if(!foundAny){ret=true}}else{ret=true}}return ret};$rootScope.hasUsersPermissions=function(encodedUsersGroupsPermissions,encodedUsersPermissions){var ret=false;if($rootScope.currentUser.isAccountAuthenticated){if(encodedUsersGroupsPermissions){let usersGroupsPermissions=angular.fromJson($base64.decode(encodedUsersGroupsPermissions));if(angular.isArray(usersGroupsPermissions)){usersGroupsPermissions.forEach(group=>{if(group.hasOwnProperty("id_group")&&$rootScope.currentUser.groups.indexOf(group.id_group.toString())>-1){ret=true}})}}if(encodedUsersPermissions){let usersPermissions=angular.fromJson($base64.decode(encodedUsersPermissions));if(angular.isArray(usersPermissions)){usersPermissions.forEach(user=>{if(user.hasOwnProperty("email")&&user.email===$rootScope.currentUser.email){ret=true}if(user.hasOwnProperty("id_user")&&user.id_user.toString()===$rootScope.currentUser.id.toString()){ret=true}})}}}return ret};$scope.setFilterParent=function(filterKey,filterData,filterId){if(angular.isUndefined($rootScope.parentFilters)){$rootScope.parentFilters={}}$rootScope.parentFilters[filterKey]={filter:filterData,id:filterId}};$scope.loginSocial=function(url,provider,messageType){if(!messageType){messageType="form"}$rootScope.postMessages[messageType]=true;if(socialLoginInline){if(preloadLinksMessage){if(typeof window["animationOnPageStart"]=="function"){animationOnPageStart()}}var redirectLink=socialRedirect?socialRedirect+"&path="+$location.path():$location.path();window.top.location.href=url+"/"+provider+"?redirect="+redirectLink}else{var left=(window.innerWidth-650)/2;var top=(window.innerHeight-800)/4;window.open(url+"/"+provider,"authWindow","width=650,height=800,scrollbars=yes,top="+top+", left="+left)}};$rootScope.$watch("postMessages.login",function(newMessage){$scope.popSocial=newMessage?true:false});$scope.initAuth0=function(){$rootScope.$watch("modalOpened",function(newModal){if(newModal=="modal-signin"){$timeout(function(){$(".btn-auth0").click()},1e3)}})};$scope.initDynamicLogin=function(userGroups){if($scope._unregRegisterCompleted){$scope._unregRegisterCompleted();$scope._unregRegisterCompleted=null}$scope._unregRegisterCompleted=$rootScope.$on("FORM_REGISTER_COMPLETED",function(){$scope.dynamicChangeLoginStatus(99)});$scope.$on("$destroy",function(){if($scope._unregRegisterCompleted){$scope._unregRegisterCompleted();$scope._unregRegisterCompleted=null}});$scope.loginUserGroups="";if(userGroups&&userGroups!=""){$scope.loginUserGroups=userGroups;$window.sessionStorage.setItem("loginUserGroups",userGroups)}$scope.dynamicChangeLoginStatus=function(loginStatus){$scope.loginStatus=loginStatus};$scope.dynamicVerificateEmail=function(form){sessionService.checkEmail({email:form.username,userGroups:$scope.loginUserGroups}).then(function(response){$scope.loginStatus=response.verification_code;switch(response.verification_code){case 3:break;case 8:break;case 9:break;default:if(response.token){let tokenObj={};try{const decoded=$base64.decode(response.token);tokenObj=JSON.parse(decoded)}catch(e){console.warn("Invalid preRegistration token format",e)}$rootScope.preRegistrationToken={};let user={email:form.username};if(tokenObj.firstname)user.firstname=tokenObj.firstname;if(tokenObj.lastname)user.lastname=tokenObj.lastname;if(tokenObj.country)user.country=tokenObj.country;$rootScope.preRegistrationToken.u=$base64.encode(JSON.stringify(user))}$scope.dynamicChangeLoginStatus(5);break}})};$scope.dynamicChangeEmailUser=function(){$scope.user.username="";$scope.dynamicChangeLoginStatus(0)};if($location.hash()==="register"){const socialToken=$window.sessionStorage.getItem("socialToken");sessionService.restoreSocial({socialToken:socialToken}).then(function(response){let socialUserData=angular.fromJson($base64.decode(response.token));$rootScope.socialToken=socialToken;$scope.user.username=socialUserData.email;$scope.dynamicChangeLoginStatus(5)})}};window.addEventListener("message",function(message){if($scope.popSocial&&(!angular.isUndefined(message.data.type)&&message.data.type=="social-login")){const loginUserGroups=$window.sessionStorage.getItem("loginUserGroups");var socialOptions={socialToken:message.data.token,userGroups:loginUserGroups?loginUserGroups.split(","):[]};let socialMessage=message;sessionService.authenticateSocial(socialOptions).then(function(response){if(response.token){$scope.alerts=[];sessionService.setToken(response.token);if(!angular.isUndefined(response.redirect)){$rootScope.loginRedirect=response.redirect}$rootScope.$emit("site:userLoggedIn");sessionService.log({action:"SuccesfullLogin",extra:{url:window.location.href}}).then(function(){var domainHostname=window.location.hostname.replace(/^[^.]+\./g,"");if(domainHostname=="cloudfront.net"||domainHostname=="fiaformulae.com"){domainHostname=window.location.hostname}var expiryDate=new Date;expiryDate.setMonth(expiryDate.getMonth()+1);document.cookie="qiuTimer="+(new Date).getTime()+";expires="+expiryDate.toGMTString()+";path=/;Secure;SameSite=None;domain="+domainHostname});useCredentials()}else{if(window.location.host.includes("runtag")||window.location.host.includes("fotorun")||window.location.host.includes("fotografix")||window.location.host.includes("fotopy")||window.location.host.includes("fotocarrera")||window.location.host.includes("photodigitalone")){$rootScope.openModal("modal-register-overlay");$rootScope.$emit("runtag:processSocialLoginNotExists",socialMessage);return}$scope.loading=false;$rootScope.$emit("site:loginRequired");$scope.alerts.push({type:"danger",msg:response.detail})}},function(response){$scope.loading=false;$rootScope.$emit("site:loginRequired");$scope.alerts.push({type:"danger",msg:response.detail})})}});$scope.checkUserToken=function(){if(!$scope.userChecked){sessionService.profile().then(function(response){sessionService.setUser(response.user);$scope.userChecked=true;if(!angular.isUndefined(response.user.aToken)){qiuAnalytics.setToken(response.user.aToken.t);qiuAnalytics.setEndpoint(response.user.aToken.u);qiuAnalytics.connect()}if(response.user.id_user){$rootScope.gaEvent("config","",{cookie_flags:"max-age=7200;secure;samesite=none",user_id:response.user.id_user})}var qiuTimer=$cookies.get("qiuTimer");var currentTime=(new Date).getTime();var difference=(currentTime-qiuTimer)/1e3;if(difference>3600){sessionService.log({action:"LoadIn",extra:{url:window.location.href}}).then(function(e){var domainHostname=window.location.hostname.replace(/^[^.]+\./g,"");if(domainHostname=="cloudfront.net"||domainHostname=="fiaformulae.com"){domainHostname=window.location.hostname}var expiryDate=new Date;expiryDate.setMonth(expiryDate.getMonth()+1);document.cookie="qiuTimer="+(new Date).getTime()+";expires="+expiryDate.toGMTString()+";path=/;Secure;SameSite=None;domain="+domainHostname})}if(typeof window["userCheckedFinished"]!=="undefined"&&$.isFunction(window["userCheckedFinished"])){eval("userCheckedFinished()")}},function(response){$scope.logOut()})}};$rootScope.$watch("reloadProfile",function(reloadProfile){if(reloadProfile){$scope.userChecked=false;$scope.checkUserToken();$rootScope.reloadProfile=false}});
3var urlParams=$scope.getHashParams();$scope.safeApply(function(){$rootScope.showMediacenterDefault=Object.keys(urlParams).length?false:true});$rootScope.$on("site:hashChanged",function(a){var urlParams=$scope.getHashParams();if(!angular.isUndefined(urlParams.gallery)||!angular.isUndefined(urlParams.gallery)||!angular.isUndefined(urlParams.tags)||!angular.isUndefined(urlParams.id)){$rootScope.showMediacenterDefault=false}else{$rootScope.showMediacenterDefault=true}});$scope.onReadyRun=function(){$timeout(function(){if(typeof window["runOnReady"]=="function"){runOnReady()}$timeout(function(){if(typeof window["runWidgets"]=="object"){angular.forEach(window["runWidgets"],function(idWidget){eval(window["startWidget"+idWidget]())})}$rootScope.renderFotoramaFrame()},500);$timeout(function(){if(typeof window["runWidgets"]=="object"){angular.forEach(window["runWidgets"],function(idWidget){eval(window["startWidget"+idWidget]())})}$rootScope.renderFotoramaFrame()},2e3)});$rootScope.$emit("site:widgetsScripts")};$scope.currentPath="";if(preloadLinks){$scope.defaultHeaderJson=$("header").attr("ng-init").replace("init('","").replace("')","");$scope.preloadData=function(allImg=[],bodyClass="",pathName=""){if(!allImg||allImg.length==0){$timeout(function(){$scope.showPreloaded(bodyClass,pathName)},1e3);return}var preloadingTime=0;if(allImg.length>=1){console.log("preloadingImages");$scope.imagesPreloaded=false;var intervalLoading=setInterval(function(){preloadingTime++;if(preloadingTime==1){$(".loading-container-page").removeClass("off");$(".loading-container-page video").trigger("play")}},800);preloader.preloadImages(allImg).then(function(){$scope.imagesPreloaded=true;clearInterval(intervalLoading);$(".loading-container-page").addClass("off");$timeout(function(){$scope.showPreloaded(bodyClass,pathName)},1e3)},function(){},function(a){})}};$scope.$watch(function(){return $location.path()},function(newPath){if($scope.currentPath&&newPath!=$scope.currentPath){$scope.loadUrl({href:newPath,pathname:newPath})}});$scope.showPreloaded=function(bodyClass="",pathName=""){if(typeof window["runOnReady"]=="function"){if(bodyClass){$("body").attr("class",bodyClass);if(sessionService.isAuthenticated()){angular.element(document.querySelector("body")).addClass("user-loggedin")}}if(pathName){$scope.mainContent=$scope.htmlToReplace}$scope.onReadyRun()}if(pathName){if(typeof window["animationOnPageEnd"]=="function"){$("#content").scrollTop(0);animationOnPageEnd()}$analytics.pageTrack(pathName)}};$scope.loadUrl=function(eventTarget){if(eventTarget&&eventTarget.href){$("#content .countdown-text").countdown("destroy");var replaceTimeout=0;if(typeof window["animationOnPageStart"]=="function"){replaceTimeout=animationOnPageStart(eventTarget.pathname);if(!replaceTimeout){replaceTimeout=0}}var modalToClose=document.querySelector(".md-modal.md-show")?document.querySelector(".md-modal.md-show").getAttribute("id"):"";if(modalToClose){$rootScope.closeModal(modalToClose)}if(!preloadLinksMessage){HttpService.getDataUrl(eventTarget.pathname,[]).then(function(resp){var bodyClass=resp.data.match(/body\sclass=['|"]([^'|"]*)['|"]/)[1];var pageTitle=resp.data.match(/<title\b[^>]*>([\s\S]*?)<\/title>/);var headerUrl=$(resp.data).find("header").attr("ng-init").replace("init('","").replace("')","");if(headerUrl!=$scope.defaultHeaderJson){$scope.defaultHeaderJson=headerUrl;window.location.href=eventTarget.pathname;return}var div=document.createElement("div");div.innerHTML=resp.data;$scope.htmlToReplace=div.querySelector("#content").innerHTML;var regexp=/<script\b[^>]*>([\s\S]*?)<\/script>/gm;$($scope.htmlToReplace.match(regexp)).each(function(idx,item){$scope.htmlToReplace=$scope.htmlToReplace.replace(item,"")});var regexpScripts=/<script type="text\/javascript">([\s\S]*?)<\/script>/gm;$(resp.data.match(regexpScripts)).each(function(idx,item){$scope.htmlToReplace+=item});var regexpTemplates=/<script type="text\/ng-template" \b[^>]*>([\s\S]*?)<\/script>/gm;$(resp.data.match(regexpTemplates)).each(function(idx,item){$scope.htmlToReplace+=item});var regexpTitle=/<title\b[^>]*>([\s\S]*?)<\/title>/gm;$timeout(function(){var allImages=$scope.htmlToReplace.match(/(http)?s?:?(\/\/[^"']*\.(?:png|jpg|jpeg|gif|svg))/g);$location.path(eventTarget.pathname);$scope.currentPath=eventTarget.pathname;if(!angular.isUndefined(eventTarget.hash)&&eventTarget.hash){$location.hash(eventTarget.hash.substring(1))}else{$location.hash("")}$scope.preloadData(allImages,bodyClass,eventTarget.pathname);document.title=$(pageTitle)[1]},replaceTimeout)}).catch(function(resp){console.log("error 404");if(typeof window["animationOnPageEnd"]=="function"){animationOnPageEnd()}})}}};$scope.preloadData();$document.on("click",function(event){if(event.target.href||!event.target.href&&(event.target.offsetParent!=null&&event.target.offsetParent.href)||!event.target.href&&(event.target.offsetParent==null||!event.target.offsetParent.href)&&(event.target.parentElement&&event.target.parentElement.href)){var eventTarget=event.target.href?event.target:event.target.offsetParent;if(angular.isUndefined(eventTarget.href)||!eventTarget.href){eventTarget=event.target.parentElement}if(eventTarget.host!=$location.host()){if(preloadLinksMessage){if(typeof window["animationOnPageStart"]=="function"){animationOnPageStart(eventTarget.pathname)}}if(COMMON.EXTERNAL_LINKS_CHECK){if(typeof webkit!="undefined"&&typeof webkit.messageHandlers.qiuApp=="object"){webkit.messageHandlers.qiuApp.postMessage(
3angular.toJson({type:"openExternal",url:eventTarget.href}))}else if(typeof window["AndroidJS"]=="object"&&typeof window["AndroidJS"]["openExternal"]=="function"){AndroidJS.openExternal(eventTarget.href)}else{parent.postMessage({type:"loadExternal",url:eventTarget.href},"*")}event.preventDefault()}return}if($location.path()==eventTarget.pathname){if($location.hash()==eventTarget.hash){event.preventDefault()}return}var urlPaths=eventTarget.pathname.split("/");var ignorePaths=["files","original","images","videos","audios"];if(ignorePaths.indexOf(urlPaths[1])>-1){return}window["runWidgets"]=[];event.preventDefault();$scope.loadUrl(eventTarget)}})}angular.element($document).ready(function(){$scope.onReadyRun()})}]);"use strict";angular.module("Media",["services.HttpService","directives.spinner","directives.resizables","ngSanitize","Scope.safeApply"]).controller("MediaController",["$scope","$filter","$http","HttpService","$window","$location","preloader","$timeout","$rootScope","CommonFactory","$base64","require_authentication","system_language","$compile","$sce","$cookies","$analytics","$translate",function($scope,$filter,$http,HttpService,$window,$location,preloader,$timeout,$rootScope,CommonFactory,$base64,require_authentication,system_language,$compile,$sce,$cookies,$analytics,$translate){$scope.actionsUrl="/api/actions";$rootScope.currentEvent="";$scope.loadEvent=true;$scope.lightBoxes=[];$scope.currentLightBox="";$scope.lightboxError=false;$scope.lightboxNew=false;$scope.model={};$scope.typeHits={image:0,video:0,file:0,audio:0};$scope.fieldsToSearch="0";$scope.tagsToSearch=[];$scope.eSearch={searchKey:"MEDIACENTER",searchParam:"",searchTag:[],searchPage:"",searchPageFrom:"",searchTotalResults:"",searchResults:"",searchNoResults:"",query:"",searched:false,currentOptions:"",showBox:false};$scope.setASearch=function(event,advancedSearch,selectAllFields,exactMatchOnOff,excludeOnOff,byDatesOnOff,excludeInput,dateFromInput,dateToInput,useTagShouldSearch){$scope.eSearch.searchPage=1;$scope.eSearch.searchPageFrom=0;$scope.eSearch.searchTag=[];if(event.keyCode==13){$scope.eSearch.searchParam=$scope.eSearch.query;$scope.advancedSearchNow(advancedSearch,selectAllFields,exactMatchOnOff,excludeOnOff,byDatesOnOff,excludeInput,dateFromInput,dateToInput,useTagShouldSearch)}else{}};$scope.searchAdvanced=function(searchParams){$http.post($scope.actionsUrl,searchParams).success(function(resp){let totalHits=resp.hits.total.hasOwnProperty("value")?resp.hits.total.value:resp.hits.total;if(totalHits>0){$scope.eSearch.searchTotalResults=totalHits;$scope.eSearch.searchTotalPages=Math.ceil(totalHits/$scope.itemsPerPage);if($scope.eSearch.searchPage==1){$scope.eSearch.searchResults=[];if(totalHits>$scope.itemsPerPage){$scope.more=true;$scope.eventSelected=true}else{$scope.more=false}}angular.forEach(resp.hits.hits,function(item){var mediaData=angular.fromJson(item._source.jsonData);var fileExt="";if(mediaData.filename){var fileSplit=mediaData.filename.split(".");if(fileSplit.length>1){fileExt=fileSplit[fileSplit.length-1]}}var newItem={title:item._source.title?item._source.title:mediaData.filename,title2:"",extraClass:mediaData.media_type,class:mediaData.media_type,datefilter:item._source.date,description:item._source.description,extension:fileExt,fileSize:mediaData.fileSize,id:mediaData.id,media:{source:item._source.url_preview?item._source.url_preview:item._source.url,thumb:item._source.media_lo?item._source.media_lo:item._source.media_med,view:item._source.media_med},media_type:item._source.type,tags:"",top_type:"",tagsArray:item._source.tags,photographer:mediaData.photographer,owner:mediaData.owner,galleries:mediaData.galleries,duration:mediaData.duration};$scope.eSearch.searchResults.push(newItem)});if($scope.eSearch.searchResults.length==totalHits){$scope.more=false}if(resp.aggregations&&resp.aggregations.types){$scope.typeHits={};for(var i=0;i<resp.aggregations.types.buckets.length;i++){var type=resp.aggregations.types.buckets[i];$scope.typeHits[type.key]=type.doc_count}for(type in $scope.typeHits){if($scope.typeHits[type]>0){$scope.filteredAdvancedSearch.push(type);if(!$("#type-hit-"+type).hasClass("active")){$("#type-hit-"+type).addClass("active")}}}delete $scope.advancedSearchParams.aggs}}else{$scope.eSearch.searchResults=[];$scope.eSearch.searchTotalResults=0}if($scope.eSearch.searchPage==1){$scope.scrollTo($scope.scrollId,"")}$scope.isLoading=false}).error(function(response){console.log("ERR",response);$scope.isLoading=false})};$scope.formatTimeSecondsMinutes=function(seconds){var minutes=Math.floor(seconds/60);var remainingSeconds=seconds%60;return minutes+"m "+remainingSeconds+"s"};$scope.getAllTags=function(){$http.post($scope.actionsUrl,{action:"GetAllTags"}).success(function(data,status,headers,config){$scope.allTags=data.tags;$scope.tagsTypes=data.tagsTypes;$scope.filteredTags=[];angular.forEach(data.tagsTypes,function(type){$scope.filteredTags[type.name]=$scope.allTags.filter(item=>item.id_type==type.id_type);$scope.filteredTags[type.name]=$scope.filteredTags[type.name].sort((a,b)=>a.tag_name.localeCompare(b.tag_name))});var container=$("#tagsGroup");angular.forEach($scope.tagsTypes,function(type){container.append(`\n <div class="as-tags-group">\n <div class="as-item-title">\n <i class="ion `+type.icon+`"></i>\n `+type.name+`\n </div>\n <ul id="tags-container-`+type.id_type+`">\n </ul>\n </div>`)});for(var type in $scope.filteredTags){var fullType=$scope.tagsTypes.find(x=>x.name==type);var container=$("#tags-container-"+fullType.id_type);$scope.filteredTags[type].forEach(tag=>{container.append(`\n <li id="tag-`+tag.id_tag+`" class="as-tag"><a>`+tag.tag_name+`</a></li>`);let listenerTag=$("#tag-"+tag.id_tag);if(listenerTag.length>0){listenerTag[0].addEventListener("click",function(){$scope.addTagToSearch(tag.id_tag)})}})}}).error(function(data,status,headers,config){})};$scope.addTagToSearch=function(id_tag){var itemToDelete=$scope.tagsToSearch.find(item=>item.id_tag==id_tag);if(itemToDelete){if(itemToDelete.id_type){$("#tag-"+id_tag).removeClass("active")}$scope.tagsToSearch=$scope.tagsToSearch.filter(item=>item.id_tag!==itemToDelete.id_tag)}else{for(var tag of $scope.allTags){if(id_tag==tag.id_tag){if(tag.id_type){$("#tag-"+id_tag).addClass("active")}$scope.tagsToSearch.push(tag)}}}};$scope.resetModalLightBoxConfig=function(){$scope.checkMediaLightBoxesUpdated={}};$scope.resetAdvancedSearch=function(){angular.forEach($scope.tagsToSearch,function(tag){$("#tag-"+tag.id_tag).removeClass("active")});$scope.tagsToSearch=[]};$scope.advancedSearchNow=function(advancedSearch,fieldToSearch,exactMatchOnOff,excludeOnOff,byDatesOnOff,excludeInput,dateFromInput,dateToInput,useTagShouldSearch){$scope.filteredAdvancedSearch=[];$scope.selection=[];$scope.changeView("search");if($scope.eSearch.currentOptions!="inGallery"){$scope.currentGallery=$scope.allGalleries[0];var hashParams=$scope.getHashParams();delete hashParams.gallery;$scope.setHashParams(hashParams)}if(angular.isArray($scope.allGalleries)&&$scope.allGalleries.length>0){var galleriesToSearch=$scope.allGalleries.map(x=>{return x.id})}else if(angular.isArray($scope.widgets)&&$scope.widgets.length>0){}var searchParams={action:"search",page:$scope.eSearch.searchPageFrom,size:$scope.itemsPerPage,key:$scope.eSearch.searchKey,g:$scope.eSearch.currentOptions=="inGallery"?$scope.currentGallery.id:galleriesToSearch,q:advancedSearch,q_exact:exactMatchOnOff,sort:{field:"date",order:"desc"}};if($scope.tagsToSearch.length>0){if(useTagShouldSearch){searchParams.tagShould=[];for(var tag of $scope.tagsToSearch){searchParams.tagShould.push(tag.tag_name)}}else{searchParams.t=[];for(var tag of $scope.tagsToSearch){searchParams.t.push(tag.tag_name)}}}if(byDatesOnOff){searchParams.datetime_from=dateFromInput;dateToInput.setHours(24,59,59);searchParams.datetime_to=dateToInput}if(excludeOnOff){searchParams.q_exclude=excludeInput}if($scope.selectedFilter){searchParams.type=$scope.selectedFilter}if(fieldToSearch){switch(fieldToSearch){case"filename":var field=["search3"];break;case"caption":var field=["search2"];break;case"photographer":var field=["search4"];break;case"owner":var field=["search4"];break;default:var field=[];break}searchParams.q_fields=field}$scope.isLoading=true;$scope.eSearch.searchNoResults=false;$scope.advancedSearchParams=searchParams;$scope.updateHashWithSearchParams({q:searchParams.q,q_fields:searchParams.q_fields,q_exact:searchParams.q_exact,excludeOnOff:excludeOnOff,byDatesOnOff:byDatesOnOff,q_exclude:searchParams.q_exclude,datetime_from:searchParams.datetime_from,datetime_to:searchParams.datetime_to,tagShould:searchParams.tagShould});$scope.searchAdvanced(searchParams)};$scope.updateHashWithSearchParams=function(params){const urlParam
3s=new URLSearchParams;for(const key in params){if(params[key]===undefined)continue;if(Array.isArray(params[key])){params[key].forEach(value=>urlParams.append(key,value))}else if(typeof params[key]==="object"&&!(params[key]instanceof Date)){for(const subKey in params[key]){if(params[key][subKey]!==undefined){urlParams.append(`${key}.${subKey}`,params[key][subKey])}}}else{const value=params[key]instanceof Date?params[key].toISOString():params[key];urlParams.append(key,value)}}window.location.hash=`#${urlParams.toString()}`};$scope.loadSearchFromHash=function(){var hash=window.location.hash||"";if(!hash)return;var allowedKeys=["q","q_fields","q_exact","excludeOnOff","byDatesOnOff","q_exclude","datetime_from","datetime_to","useTagShouldSearch"];var shouldHandle=allowedKeys.some(function(k){return hash.indexOf(k+"=")!==-1});if(!shouldHandle)return;var hashParams=new URLSearchParams(hash.substring(1));var sp={};hashParams.forEach(function(value,key){if(key.indexOf(".")!==-1){var parts=key.split(".");var mainKey=parts[0];var subKey=parts[1];if(!sp[mainKey])sp[mainKey]={};sp[mainKey][subKey]=value}else{sp[key]=value}});sp.q_exact=sp.q_exact==="true";sp.excludeOnOff=sp.excludeOnOff==="true";sp.byDatesOnOff=sp.byDatesOnOff==="true";if(sp.datetime_from)sp.datetime_from=new Date(sp.datetime_from);if(sp.datetime_to)sp.datetime_to=new Date(sp.datetime_to);$scope.advancedSearchNow(sp.q,sp.q_fields,sp.q_exact,sp.excludeOnOff,sp.byDatesOnOff,sp.q_exclude,sp.datetime_from,sp.datetime_to,sp.useTagShouldSearch)};angular.element(document).ready(function(){setTimeout(function(){$scope.loadSearchFromHash()},1e3)});angular.element(document).ready(function(){setTimeout(()=>{$scope.loadSearchFromHash()},1e3)});$scope.toggleTypeItem=function(key){$scope.isLoading=true;if($("#type-hit-"+key).hasClass("active")){var divTypeHit=$(".filters-container div.active");if(divTypeHit.length<2){$("#type-hit-"+key).addClass("animation");setTimeout(function(){$("#type-hit-"+key).removeClass("animation")},1e3);return}$("#type-hit-"+key).removeClass("active");$scope.filteredAdvancedSearch=$scope.filteredAdvancedSearch.filter(item=>item!==key)}else{$("#type-hit-"+key).addClass("active");$scope.filteredAdvancedSearch.push(key)}$scope.advancedSearchParams.typeShould=$scope.filteredAdvancedSearch;$scope.advancedSearchParams.page=1;$scope.eSearch.searchPage=1;$scope.eSearch.searchPageFrom=$scope.itemsPerPage*$scope.eSearch.searchPage;$scope.searchAdvanced($scope.advancedSearchParams)};$rootScope.$on("site:hashChanged",function(){$scope.setCurrentEvent()});$scope.getVideoPreload=function(){var userAgent=navigator.userAgent||navigator.vendor||window.opera;if(/windows phone/i.test(userAgent)){return"metadata"}if(/android/i.test(userAgent)){return"none"}if(/iPad|iPhone|iPod/.test(userAgent)&&!window.MSStream){return"metadata"}if(userAgent.toLowerCase().indexOf("safari/")>-1){return"metadata"}return"metadata"};$scope.initVideo=function(elementId,videoId,isYoutube,autoPlay,features=["playpause","volume"]){$scope.videoPreload=$scope.getVideoPreload();function onSuccessVideo(mediaElement,domObject){var videoRatio=16/9;var width=$("#"+elementId+videoId+" .background").width();var height=$("#"+elementId+videoId+" .background").height();var pHeight="";var pWidth="";if(width/videoRatio<height){pWidth=Math.ceil(height*videoRatio);$("#video-"+videoId).children().width(pWidth).height(height).css({left:(width-pWidth)/2,top:0})}else{pHeight=Math.ceil(width/videoRatio);$("#video-"+videoId).children().width(width).height(pHeight).css({left:0,top:(height-pHeight)/2})}if(autoPlay){mediaElement.load();mediaElement.play()}}var meParams={startVolume:autoPlay?0:50,pauseOtherPlayers:false,alwaysShowControls:false,features:features,success:onSuccessVideo};if(isYoutube){meParams.youtube={iv_load_policy:3,modestbranding:0,autoplay:autoPlay,controls:0,showinfo:0,wmode:"opaque",branding:0,autohide:0,playsinline:1,loop:1}}$timeout(function(){$scope.currentVideoPlayer=new MediaElement("video-"+videoId,meParams)})};$scope.initGrid=function(gridId){$scope.gridId=gridId;$scope.viewType="grid";$scope.showGrid=function(){$scope.viewType="grid"};$scope.showSlide=function(){$scope.viewType="slide";$timeout(function(){angular.element("#slideshow-gallery-"+$scope.gridId).fotorama()})};$scope.openSlideItem=function(idx){$scope.viewType="slide";$timeout(function(){angular.element("#slideshow-gallery-"+$scope.gridId).fotorama({startindex:id
3x})})}};$scope.initVideoBackground=function(elementId,videoId,features=["playpause","volume"]){$scope.videoPreload=$scope.getVideoPreload();$timeout(function(){$scope.currentVideoPlayer=new MediaElement("video-"+videoId,{startVolume:0,pauseOtherPlayers:false,alwaysShowControls:false,features:features,youtube:{iv_load_policy:3,modestbranding:0,autoplay:1,controls:0,showinfo:0,wmode:"opaque",branding:0,autohide:0,playsinline:1,loop:1},success:function(mediaElement,domObject){var videoRatio=16/9;var width=$("#"+elementId+" .bg-vid").width();var height=$("#"+elementId+" .bg-vid").height();var pHeight="";var pWidth="";if(width/videoRatio<height){pWidth=Math.ceil(height*videoRatio);$(domObject).children().width(pWidth).height(height).css({left:(width-pWidth)/2,top:0})}else{pHeight=Math.ceil(width/videoRatio);$(domObject).children().width(width).height(pHeight).css({left:0,top:(height-pHeight)/2})}var pHeight=Math.ceil(width/(16/9));mediaElement.load();mediaElement.play()}})})};$scope.videoSync=function(){if(!$scope.videoPaused){angular.forEach($scope.allVideos,function(v,idx){var videoId=v.videoId;if(!$scope.isMobile()){if($scope.hasMouseOver){$("#video-"+videoId+"-thumb").trigger("play")}else{$("#video-"+videoId+"-thumb").trigger("pause")}}if(idx!=$scope.currentVideoIdx){$("#video-"+videoId).trigger("pause")}else{$("#video-"+videoId).trigger("play")}})}};$scope.initVideoSlider=function(elementId,videosEncoded,features=["playpause","volume","fullscreen"],isMobile){$scope.elementId=elementId;$scope.successVideos=0;$scope.currentVideoIdx=0;$scope.playIntervalStart="";$scope.playInterval="";$scope.syncInterval="";$scope.defaultMuted=CommonFactory.isMobile()?true:false;$scope.currentMuted=$scope.defaultMuted;$scope.showClickUnmute=true;$scope.videoPaused=false;$scope.hasMouseOver=false;$scope.noHideOverlay=true;$scope.noShowOverlay=false;$scope.isMobile=isMobile?function(){return true}:CommonFactory.isMobile;$scope.$on("ngRepeatFinished",function(){$("#video-slide .video-slideshow-main").addClass("owl-carousel owl-theme").owlCarousel({nav:false,navText:["",""],loop:false,items:1,stagePadding:0,dots:false,smartSpeed:0}).on("change.owl.carousel",function(event){$scope.currentVideoIdx=event.property.value;$scope.videoSync()});angular.forEach($scope.allVideos,function(v,idx){var autoplay=idx?1:0;var videoId=v.videoId;var width=$("#video-"+videoId).width();var height=$("#video-"+videoId).height();new MediaElementPlayer("video-"+videoId,{startVolume:$scope.currentMuted?0:100,pauseOtherPlayers:false,alwaysShowControls:true,features:features,youtube:{iv_load_policy:3,modestbranding:0,autoplay:autoplay,controls:0,showinfo:0,wmode:"opaque",branding:0,autohide:0,playsinline:1,loop:1,mute:$scope.currentMuted},success:function(mediaElement,domObject){var videoRatio=16/9;var pHeight="";var pWidth="";if(width/videoRatio<height){pWidth=Math.ceil(height*videoRatio);$("#video-"+videoId).children().width(pWidth).height(height).css({left:(width-pWidth)/2,top:0})}else{pHeight=Math.ceil(width/videoRatio);$("#video-"+videoId).children().width(width).height(pHeight).css({left:0,top:(height-pHeight)/2})}mediaElement.load();mediaElement.play();mediaElement.pause();if(!$scope.currentMuted){mediaElement.setMuted(0);mediaElement.setVolume(100)}else{mediaElement.setMuted(1)}$scope.successVideos++;$scope.$watch("currentMuted",function(newVal){if(idx==$scope.currentVideoIdx){if(!newVal){mediaElement.setMuted(0);mediaElement.setVolume(100)}else{mediaElement.setMuted(1)}}});$scope.$watch("videoPaused",function(newVal){if(idx==$scope.currentVideoIdx){if(newVal){mediaElement.pause()}else{mediaElement.play()}}})}});var width=$("#video-"+videoId+"-thumb").width();var height=$("#video-"+videoId+"-thumb").height();if($scope.isMobile()){$(".main-video:eq(0)").addClass("active")}else{new MediaElementPlayer("video-"+videoId+"-thumb",{startVolume:0,pauseOtherPlayers:false,alwaysShowControls:false,features:features,youtube:{iv_load_policy:3,modestbranding:0,autoplay:0,controls:0,showinfo:0,wmode:"opaque",branding:0,autohide:0,playsinline:1,loop:1,mute:1},success:function(mediaElement,domObject){var videoRatio=16/9;var pHeight="";var pWidth="";if(width/videoRatio<height){pWidth=Math.ceil(height*videoRatio);$("#video-"+videoId+"-thumb").children().width(pWidth).height(height).css({left:(width-pWidth)/2,top:0})}else{pHeight=Math.ceil(width/videoRatio);$("#video-"+videoId+"-thumb").children().width(width).height(pHeight).css({left:0,top:(height-pHeight)/2})}mediaElement.load();mediaElement.play();mediaElement.pause();$(".main-video:eq(0)").addClass("active");$(".video-slide-item:eq(0)").addClass("active");$scope.successVideos++;$scope.$watch("videoPaused",function(newVal){if(newVal){mediaElement.pause()}else{mediaElement.play()}})}})}})});var owlAPi;$scope.ready=function($api){owlAPi=$api};$scope.allVideos=angular.fromJson($base64.decode(videosEncoded));$scope.$watch("successVideos",function(newVal){var totalVideos=$scope.allVideos.length*2;if($scope.isMobile()){totalVideos=$scope.allVideos.length}if(newVal==totalVideos){$scope.videoSliderVideoSelect(0);$timeout(function(){if(!$scope.hasMouseOver){angular.element("#"+$scope.elementId+" .video-container").removeClass("hover")}},3e3)}});document.addEventListener("fullscreenchange",function(){$scope.exitHandler()});document.addEventListener("webkitfullscreenchange",function(){$scope.exitHandler()});document.addEventListener("mozfullscreenchange",function(){$scope.exitHandler()});document.addEventListener("MSFullscreenChange",function(){$scope.exitHandler()});$scope.exitHandler=function(){if(!document.webkitIsFullScreen&&!document.mozFullScreen&&!document.msFullscreenElement){angular.element("#"+$scope.elementId).removeClass("fullscreen")}};$scope.toggleFullscreen=function(){var elem=document.getElementById($scope.elementId);if(document.webkitFullscreenElement){document.webkitCancelFullScreen()}else{if(CommonFactory.isMobile()){angular.forEach($scope.allVideos,function(v,idx){var videoId=v.videoId;if(idx==$scope.currentVideoIdx){angular.element("#player-container"+videoId+" .mejs__fullscreen-button button").click()}})}else{elem.webkitRequestFullScreen()}elem.classList.add("fullscreen")}};$scope.closeOverlay=function(){if($scope.noHideOverlay){return}$scope.noShowOverlayTimeout();angular.element("#"+$scope.elementId+" .video-container").removeClass("hover")};$scope.noHideOverlayTimeout=function(){$scope.noHideOverlay=true;$timeout(function(){$scope.noHideOverlay=false},2e3)};$scope.noShowOverlayTimeout=function(){$scope.noShowOverlay=true;$timeout(function(){$scope.noShowOverlay=false},2e3)};$scope.mouseMoveOut=function(evt){if(!$scope.noHideOverlay){angular.element(evt.currentTarget).removeClass("hover")}};
3$scope.mouseMoveOver=function(evt){if(!$scope.hasMouseOver){if(!$scope.isMobile()){angular.forEach($scope.allVideos,function(v,idx){var videoId=v.videoId;$("#video-"+videoId+"-thumb").trigger("setCurrentTime")[0].setCurrentTime(999999999)})}}$scope.hasMouseOver=true;$scope.videoSync();if(!$scope.noShowOverlay){angular.element(evt.currentTarget).addClass("hover")}if(!angular.isUndefined($scope.overTimeout)){$timeout.cancel($scope.overTimeout)}$scope.overTimeout=$timeout(function(){if($scope.noHideOverlay){return}angular.element(evt.currentTarget).removeClass("hover");$scope.hasMouseOver=false;$scope.videoSync();if(!$scope.isMobile()){angular.forEach($scope.allVideos,function(v,idx){$("#video-"+v.videoId+"-thumb").trigger("pause")})}},2e3)};$scope.toggleMute=function(force){$scope.showClickUnmute=false;if(force){$scope.currentMuted=false;return}$scope.currentMuted=!$scope.currentMuted};$scope.togglePlay=function(){$scope.videoPaused=!$scope.videoPaused};$scope.videoSliderVideoSelect=function(idx){$(".video-slide-item").removeClass("active");$(".main-video").removeClass("active");$(".main-video:eq("+idx+")").addClass("active");$(".video-slide-item:eq("+idx+")").addClass("active");if(!$scope.noHideOverlay){$(".video-container").removeClass("hover")}$scope.currentVideoIdx=idx;angular.forEach($scope.allVideos,function(v,idx){var videoId=v.videoId;if(idx==$scope.currentVideoIdx){$("#video-"+videoId).trigger("setCurrentTime")[0].setCurrentTime(999999999);if(!$scope.currentMuted){$("#video-"+videoId).trigger("setMuted")[0].setMuted(0);$("#video-"+videoId).trigger("setMuted")[0].setVolume(100)}else{$("#video-"+videoId).trigger("setMuted")[0].setMuted(1)}}});$scope.videoSync();$scope.closeOverlay()};$scope.noHideOverlayTimeout()};$scope.setCurrentEvent=function(){var urlParams=$scope.getHashParams();if(!angular.isUndefined(urlParams.event)&&urlParams.event!=$rootScope.currentEvent){$scope.loadEvent=true;$rootScope.currentEvent=urlParams.event;var expiryDate=new Date;expiryDate.setMonth(expiryDate.getMonth()+1);document.cookie="event="+urlParams.event+";expires="+expiryDate.toGMTString()+";path=/;Secure;SameSite=None";$scope.$apply()}if(!angular.isUndefined(urlParams.id)){$scope.currentItemId=urlParams.id}};$scope.getHashParams=function(){var urlParams={};var hashLoad=$location.hash();if(hashLoad){var hashParams=hashLoad.split("&");angular.forEach(hashParams,function(h){var h2=h.split("=");if(h2.length==2){urlParams[h2[0]]=h2[1]}else{urlParams[h2[0]]=true}})}return urlParams};$scope.setHashParams=function(params){var hash="";angular.forEach(params,function(val,key){hash+=key+"="+val+"&"});if(hash.substr(-1,1)=="&"){hash=hash.substr(0,hash.length-1)}$location.hash(hash)};$timeout(function(){$scope.setCurrentEvent()});$scope.urlToGo="";var searchMatch=function(haystack,needle){if(!needle){return true}if(angular.isString(haystack)){return haystack.toLowerCase().indexOf(needle.toLowerCase())!==-1}else{return false}};var searchContains=function(string,substr){if(angular.isUndefined(string)){return false}else{return string.indexOf(substr)!=-1}};var searchContainsComma=function(string,substr){var i=0;var retVar=false;var exp=string.split(",");for(i=0;i<exp.length;i++){if(exp[i]==substr){retVar=true}}return retVar};var searchDate=function(string,filterBy){var nowDate=moment().utc().format("YYYY-MM-DD");string=string.substr(0,10);var filterBy2=filterBy.split(",");if(filterBy2.length==2){filterBy=filterBy2[0];nowDate=filterBy2[1]}if(filterBy=="="){if(string==nowDate){return true}}else if(filterBy==">"){if(string>nowDate){return true}}else if(filterBy==">="){if(string>=nowDate){return true}}else if(filterBy=="<"){if(string<nowDate){return true}}else if(filterBy=="<="){if(string<=nowDate){return true}}return false};$scope.init=function(url,per_page,imageDefault,idData,scrollId,firstAction,filterId,groupFilters,searchParams,onRenderAction,fotoramaId,addSeparatorFromField,noEvents,noFavorites,searchKey){$timeout(function(){$scope.scrollTo()});$scope.noEvents=noEvents;$rootScope.$on("site:hashChanged",function(){var urlParams=$scope.getHashParams();if(!$scope.noEvents&&(!angular.isUndefined(urlParams.event)&&urlParam
3s.event!=$rootScope.currentEvent)){$scope.changeEvent()}if(!angular.isUndefined(urlParams.id)&&(angular.isUndefined($scope.currentItem)||urlParams.id!=$scope.currentItem.id)){$scope.setCurrentItemFromId()}else if(angular.isUndefined(urlParams.id)&&!angular.isUndefined($scope.currentItem)){$scope.closeMediaItem()}});var urlDecode=angular.fromJson($base64.decode(url));if(!angular.isUndefined(urlDecode.actions)&&urlDecode.actions.length>0){$scope.actionsUrl=urlDecode.actions}$scope.idData=idData;$scope.scrollId=scrollId;$scope.firstAction=firstAction;$scope.fieldsByType=["class","class2","class3"];$scope.imageDefault=imageDefault;$scope.onSocial=false;$scope.onRenderAction=onRenderAction;$scope.fotoramaId=fotoramaId;$scope.filterId=filterId;$scope.allGroups=groupFilters;$scope.searchParams=searchParams;$scope.addSeparatorFromField=addSeparatorFromField;$scope.searchParam="";$scope.groupFilters=[];$scope.menuPre=[];$scope.menuMid=[];$scope.menuPost=[];$scope.currentModalData={};$scope.videoAPI=null;$scope.filtersCollapse={};$scope.sortType="";$scope.sortReverse=false;$scope.searchColumn="";$scope.itemsPerPage=per_page;$scope.hasFilter=false;$scope.noFavorites=noFavorites;$scope.filtersShowing=angular.element("body").hasClass("hidden-related")?false:true;$scope.lightboxShowing=false;if(searchKey){$scope.eSearch.searchKey=searchKey}var params=[];$scope.loadDataFromJson=function(){if($scope.url&&$scope.loadEvent){$scope.loadEvent=false;$scope.items=[];$scope.allFilters=[];$scope.downloadOptions=[];$scope.eventData=undefined;HttpService.getDataUrl($scope.url,params).then(function(response){$scope.safeApply(function(){if(!angular.isUndefined(response.data.filters)){$scope.allFilters=response.data.filters}if(!angular.isUndefined(response.data.event)){$scope.eventData=response.data.event}if(!angular.isUndefined(response.data.downloadOptions)){$scope.downloadOptions=response.data.downloadOptions}if(!angular.isUndefined(response.data.menuPre)){$scope.menuPre=response.data.menuPre}if(!angular.isUndefined(response.data.menuMid)){$scope.menuMid=response.data.menuMid}if(!angular.isUndefined(response.data.menuPost)){$scope.menuPost=response.data.menuPost}if(!angular.isUndefined(response.data.items)){var responseItems=response.data.items}else{var responseItems=response.data}angular.forEach(responseItems,function(item){if($scope.filterId){if(item.id!=$scope.filterId){$scope.items.push(item)}}else{if($scope.firstAction&&$scope.firstAction.substr(0,5)=="CLASS"){if(item.class==$scope.firstAction.substr(5)){$scope.items.push(item)}}else{$scope.items.push(item)}}});if($scope.currentItemId){$scope.setCurrentItemFromId()}if(CommonFactory.isMobile()){$scope.hideFilters()}$scope.getLightBox();$scope.getAllTags();if($scope.firstAction){if($scope.firstAction&&$scope.firstAction=="DATENOW"){$scope.setFilterDateNow("",">=",true)}else if($scope.firstAction.substr(0,6)=="always"){$scope.setFilterAlways("",$scope.firstAction)}else if($scope.firstAction.substr(0,4)=="date"){$scope.setFilterDate($scope.firstAction.substr(5))}else if($scope.firstAction&&$scope.firstAction.substr(0,4)=="NONE"){$scope.search()}else if($scope.firstAction&&$scope.firstAction.substr(0,5)=="CLASS"){$scope.search()}}else{$scope.search()}})}).catch(function(error){console.error("Error fetching data: ",error);if(error.status===403||error.status===401){$scope.isLoading=false}})}else{$scope.isLoading=false;$scope.noEvent=true}};$scope.changeEvent=function(){var urlDecode=angular.fromJson($base64.decode(url));$scope.tempUrl=urlDecode.url;if($rootScope.currentEvent){$scope.url=$scope.tempUrl.replace("-----",$rootScope.currentEvent)}else{$scope.url=$scope.tempUrl}$scope.noEvent=$scope.noEvents;$scope.page=1;$scope.firstLoad=true;$scope.filterSearch=false;if($scope.filterId){$scope.filterMain=false}else{$scope.filterMain=true}$scope.filterDate=false;$scope.filterDate2=false;$scope.filterDateAlways=false;$scope.filterTag=false;$scope.filterClass=false;$scope.filterClass2=false;$scope.filterClass3=false;$scope.filterAlways=false;$scope.filterAlwaysField=false;$scope.dateOptions={showWeeks:false,appendToBody:false};$scope.dateFrom={opened:false,value:"",watched:false};$scope.dateTo={opened:false,value:"",watched:false};$scope.starter()};
3$scope.starter=function(){$scope.index=0;$scope.data=[];$scope.page=1;$scope.results=[];$scope.pagedItemsLoaded=[];$scope.pagedItemsLoadedPreload=[];$scope.imageLocations=[];$scope.more=true;$scope.moreLoad=false;$scope.status_bar="";$scope.isLoading=true;$scope.noresults=false;$scope.isSuccessful=false;$scope.percentLoaded=0;$scope.preloader=false;$scope.$on("ngRepeatFinished",function(){if($scope.fotoramaId){setTimeout(function(){var $fotoramaDiv=$($scope.fotoramaId);$fotoramaDiv.fotorama()},1500)}if($scope.onRenderAction){eval($scope.onRenderAction)}});if(require_authentication){if($rootScope.userAuthenticated&&$rootScope.userAuthenticated()){$scope.loadDataFromJson()}else{$rootScope.$on("auth:loadFinished",function(){$scope.loadDataFromJson()})}}else{$scope.loadDataFromJson()}};$scope.initLightBox=function(lightBox,toPage){angular.element("#content-"+$scope.idData).fadeOut("fast");angular.element(".main-view").addClass("hidden");angular.element(".details-view").addClass("hidden");angular.element(".lightbox-view").removeClass("hidden");$scope.moreLightBox=true;$scope.moreLoadLightBox=false;$scope.indexLightBox=0;$scope.pageLightBox=1;$scope.pagedLightBoxLoaded=[];$scope.firstLoadLightBox=true;$scope.indexLightBox=0;$scope.pageLightBox=1;$scope.pagedLightBoxLoaded=[];$scope.pagedLightBoxLoadedPreload=[];$scope.currentPageLightBox=0;$scope.currentLightBox=lightBox;$scope.filteredLightBox=$scope.currentLightBox.data;$scope.toPage=0;if(toPage){$scope.toPage=toPage}$scope.loadDataLightBox()};$scope.nextLightBox=function(){$scope.pageLightBox+=1;$scope.loadDataLightBox()};$scope.closeLightBox=function(){angular.element(".details-view").addClass("hidden");angular.element(".lightbox-view").addClass("hidden");angular.element(".main-view").removeClass("hidden");$scope.currentLightBox=""};$scope.loadDataLightBox2=function(){$scope.currentPageLightBox=0;$scope.loadDataLightBox()};$scope.loadDataLightBox=function(){$scope.pagedLightBox=[];$scope.currentPageLightBox++;for(;$scope.indexLightBox<$scope.itemsPerPage*$scope.pageLightBox;$scope.indexLightBox++){$scope.moreLoadLightBox=$scope.filteredLightBox.length>$scope.indexLightBox;if($scope.moreLoadLightBox==false){break}$scope.pagedLightBox.push($scope.filteredLightBox[$scope.indexLightBox])}$scope.safeApply(function(){$scope.isSuccessful=true;$scope.percentLoaded=0;if($scope.pageLightBox==1){$scope.viewNextLightBox()}else if($scope.pageLightBox<$scope.toPage){$scope.viewNextLightBox()}angular.element("#content-"+$scope.idData).fadeIn("fast");$scope.isLoading=false})};$scope.safeApply($scope.changeEvent());$scope.search=function(){$scope.filteredItems=$filter("filter")($scope.items,function(item){var x=false;if(!angular.isUndefined($scope.query)){angular.forEach(item,function(val,attr){if(searchMatch(item[attr],$scope.query)){x=true}})}else{x=true}return x});if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterAlways)&&$scope.filterAlways.length>0){$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){if(searchContains(item[$scope.filterAlwaysField],$scope.filterAlways)){return true}return false})}if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterDateAlways)&&$scope.filterDateAlways.length>0){$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){if(searchDate(item.datefilter,$scope.filterDateAlways)){return true}return false})}if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterDate)&&$scope.filterDate.length>0){$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){if(searchDate(item.datefilter,$scope.filterDate)){return true}return false})}if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterDate2)&&$scope.filterDate2.length>0){$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){if(searchDate(item.datefilter,$scope.filterDate2)){return true}return false})}if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterClass)&&$scope.filterClass.length>0){$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){if(searchContains(item.class,$scope.filterClass)){return true}return false})}if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterTag)&&$scope.filterTag.length>0){$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){if(searchContainsComma(item.tags,$scope.filterTag)){return true}return false})}if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterMain)&&$scope.filterMain==true){$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){if(!angular.isUndefined(item.main)){return true}return false})}$scope.currentPage=0;if($scope.filteredItems.length==0){if($scope.filterTag.length>0){if(!angular.isUndefined($scope["urlLoadTag"+$scope.filterTag])&&angular.isUndefined($scope["filterLoadTag"+$scope.filterTag])){$scope.preloadNextItems(1)}
3else{$scope.safeApply(function(){$scope.isSuccessful=true;$scope.more=false;$scope.noresults=true;$scope.isLoading=false})}}else{if(!angular.isUndefined($scope["urlLoad"+$scope.filterClass])&&angular.isUndefined($scope["filterLoad"+$scope.filterClass])){$scope.preloadNextItems(1)}else{$scope.safeApply(function(){$scope.isSuccessful=true;$scope.more=false;$scope.noresults=true;$scope.isLoading=false})}}}else{$scope.groupToPages()}if($scope.load==true){$scope.load=false}};$scope.loadData=function(){$scope.currentPage++;$scope.search()};$scope.groupToPages=function(){$scope.pagedItems=[];$scope.currentPage++;$scope.imageLocations=[];for(;$scope.index<$scope.itemsPerPage*$scope.page;$scope.index++){$scope.moreLoad=$scope.filteredItems.length>$scope.index;if($scope.moreLoad==false){break}if(angular.isUndefined($scope.filteredItems[$scope.index].allMedia)){$scope.filteredItems[$scope.index].allMedia=[];if(!angular.isUndefined($scope.filteredItems[$scope.index].media)){angular.copy($scope.filteredItems[$scope.index].media,$scope.filteredItems[$scope.index].allMedia)}}$scope.filteredItems[$scope.index].extraClass=$scope.filteredItems[$scope.index].class;if(!angular.isUndefined($scope.filteredItems[$scope.index].class2)){$scope.filteredItems[$scope.index].extraClass+=" "+$scope.filteredItems[$scope.index].class2}if(!angular.isUndefined($scope.filteredItems[$scope.index].class3)){$scope.filteredItems[$scope.index].extraClass+=" "+$scope.filteredItems[$scope.index].class3}if(!angular.isUndefined($scope.filteredItems[$scope.index].premium)){$scope.filteredItems[$scope.index].extraClass+=" "+$scope.filteredItems[$scope.index].premium}$scope.filteredItems[$scope.index].mediaShow=$scope.imageDefault;if($scope.filteredItems[$scope.index].media&&angular.isArray($scope.filteredItems[$scope.index].media)&&$scope.filteredItems[$scope.index].media.length>0){$scope.filteredItems[$scope.index].media=$scope.filteredItems[$scope.index].media[0]}if(angular.isUndefined($scope.filteredItems[$scope.index].media)||!$scope.filteredItems[$scope.index].media||$scope.filteredItems[$scope.index].media.length<1){$scope.filteredItems[$scope.index].extraClass+=" no-img"}else{if(CommonFactory.isMobile()&&$scope.filteredItems[$scope.index].mediaMobile!=false){$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].mediaMobile}else{$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].media}$scope["imageLocations"].push($scope.filteredItems[$scope.index].media);if($scope.filterMain&&$scope.index<1){if(CommonFactory.isMobile()&&$scope.filteredItems[$scope.index].mediaMobile!=false){$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].mediaMobile}else if(!angular.isUndefined($scope.filteredItems[$scope.index].mediaFirst)&&$scope.filteredItems[$scope.index].mediaFirst.length>0){$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].mediaFirst}else{$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].media}$scope["imageLocations"].push($scope.filteredItems[$scope.index].mediaFirst)}}if(!angular.isUndefined($scope.filteredItems[$scope.index].media2)){if(CommonFactory.isMobile()&&$scope.filteredItems[$scope.index].mediaMobile2!=false){$scope.filteredItems[$scope.index].mediaShow2=$scope.filteredItems[$scope.index].mediaMobile2}else{$scope.filteredItems[$scope.index].mediaShow2=$scope.filteredItems[$scope.index].media2}$scope["imageLocations"].push($scope.filteredItems[$scope.index].media2)}if(!angular.isUndefined($scope.filteredItems[$scope.index].pages)&&$scope.filteredItems[$scope.index].pages.length>0){if(CommonFactory.isMobile()&&$scope.filteredItems[$scope.index].mediaMobile!=false){$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].pages[0].medium}else{$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].pages[0].medium}$scope["imageLocations"].push($scope.filteredItems[$scope.index].pages[0].medium);if($scope.filterMain&&$scope.index<1){$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].pages[0].medium;$scope["imageLocations"].push($scope.filteredItems[$scope.index].pages[0].medium)}}if(!angular.isUndefined($scope.filteredItems[$scope.index].mediaVideo)){if(angular.isObject($scope.filteredItems[$scope.index].mediaVideo)){$scope.filteredItems[$scope.index].mediaVideoMulti=true}}$scope.pagedItems.push($scope.filteredItems[$scope.index]);if(!angular.isUndefined($scope.filteredItems[$scope.index].media)&&$scope.filteredItems[$scope.index].media){if($scope["filteredItems"][$scope["index"]].media[0]!==null){$scope["imageLocations"].push($scope["filteredItems"][$scope["index"]].media)}}}$scope.safeApply(function(){angular.forEach($scope.pagedItems,function(item){$scope.s
3afeApply(function(){$scope.pagedItemsLoadedPreload.push(item)})});$scope.isSuccessful=true;$scope.percentLoaded=0;if($scope.page==1){$scope.viewNext()}else{}angular.element("#content-"+$scope.idData).fadeIn("fast");$scope.isLoading=false})};$scope.preload=function(imageLocations){preloader.preloadImages(imageLocations).then(function handleResolve(imageLocations){$scope.isSuccessful=true;angular.forEach($scope.resultsPage,function(item){$scope.safeApply(function(){$scope.results.push(item)})});$scope.more=$scope.moreLoad;$scope.percentLoaded=0;$scope.isLoading=false},function handleReject(imageLocation){$scope.isLoading=false;$scope.isSuccessful=false},function handleNotify(event){$scope.percentLoaded=event.percent})};$scope.windowOpen=function(url,title,options){$window.open(url,title,options)};$scope.preloadNextItems=function(noResults){$scope.page+=1;if($scope.firstLoad){$scope.firstLoad=false;$scope.isLoading=true;$scope.safeApply($scope.loadData())}else{if($scope.filterMain==true){$scope.safeApply($scope.loadData())}else if($scope.filterTag.length>0){if(!angular.isUndefined($scope["urlLoadTag"+$scope.filterTag])){if(!angular.isUndefined($scope["filterLoadTag"+$scope.filterTag])){$scope.safeApply($scope.loadData())}else{$scope["filterLoadTag"+$scope.filterTag]=$scope["urlLoadTag"+$scope.filterTag];$scope.safeApply($scope.preloadNextTabTag(noResults))}}else{$scope.safeApply($scope.loadData())}}else{if(!angular.isUndefined($scope["urlLoad"+$scope.filterClass])){if(!angular.isUndefined($scope["filterLoad"+$scope.filterClass])){$scope.safeApply($scope.loadData())}else{$scope["filterLoad"+$scope.filterClass]=$scope["urlLoad"+$scope.filterClass];$scope.safeApply($scope.preloadNextTab(noResults))}}else{$scope.safeApply($scope.loadData())}}}};$scope.preloadNextLightBox=function(noResults){$scope.pageLightBox+=1;if($scope.firstLoadLightBox){$scope.firstLoadLightBox=false;$scope.isLoading=true;$scope.safeApply($scope.loadDataLightBox2())}else{$scope.safeApply($scope.loadDataLightBox2())}};$scope.viewNext=function(){angular.forEach($scope.pagedItems,function(item){$scope.s
3afeApply(function(){if($scope.addSeparatorFromField){if($scope.addSeparatorFromField=="date"){if($scope.pagedItemsLoaded.length>1){var parentItem=$scope.items[$scope.pagedItemsLoaded.length-1];if(item.date.substring(0,10)!=$scope.pagedItemsLoaded[$scope.pagedItemsLoaded.length-1].date.substring(0,10)){$scope.pagedItemsLoaded.push({id:Math.random(),extraClass:"date",date:item.date})}}else{$scope.pagedItemsLoaded.push({id:Math.random(),extraClass:"date",date:item.date})}$scope.pagedItemsLoaded.push(item)}}else{$scope.pagedItemsLoaded.push(item)}})});$scope.preloader=true;$scope.safeApply($scope.preloadNextItems());if($scope.pagedItems.length==0){$scope.more=false;$scope.isLoading=false}};$scope.viewNextLightBox=function(){angular.forEach($scope.pagedLightBox,function(item){$scope.safeApply(function(){$scope.pagedLightBoxLoaded.push(item)})});$scope.preloader=true;$scope.safeApply($scope.preloadNextLightBox());if($scope.pagedLightBox.length==0){$scope.moreLightBox=false;$scope.isLoading=false}};$scope.show_more=function(){$scope.viewNext()};$scope.show_moreLightBox=function(){$scope.viewNextLightBox()};$scope.nextPage=function(){if($scope.currentPage<$scope.pagedItems.length-1){$scope.currentPage++}};$scope.show_more_Infinite=function(){$scope.page++;$scope.loadData()};$scope.has_more=function(){return $scope.more};$scope.has_moreLightBox=function(){return $scope.moreLightBox};$scope.countByFilter=function(){$scope.filteredTotal=$filter("filter")($scope.items,function(item){var x=false;if(!angular.isUndefined($scope.query)){angular.forEach($scope.searchFields,function(attr){if(searchMatch(item[attr],$scope.query)){x=true}})}else{x=true}return x});if(!angular.isUndefined($scope.filteredTotal)&&!angular.isUndefined($scope.filterDate)&&$scope.filterDate.length>0){$scope.filteredTotal=$filter("filter")($scope.filteredItems,function(item){if(searchDate(item.datefilter,$scope.filterDate)){return true}return false})}if(!angular.isUndefined($scope.filteredTotal)&&!angular.isUndefined($scope.filterDate2)&&$scope.filterDate2.length>0){$scope.filteredTotal=$filter("filter")($scope.filteredItems,function(item){if(searchDate(item.datefilter,$scope.filterDate2)){return true}return false})}if(!angular.isUndefined($scope.filteredTotal)&&!angular.isUndefined($scope.filterClass)&&$scope.filterClass.length>0){$scope.filteredTotal=$filter("filter")($scope.filteredTotal,function(item){if(searchContains(item.class,$scope.filterClass)){return true}return false})}if(!angular.isUndefined($scope.filteredTotal)&&!angular.isUndefined($scope.filterTag)&&$scope.filterTag.length>0){$scope.filteredTotal=$filter("filter")($scope.filteredTotal,function(item){if(searchContainsComma(item.tags,$scope.filterTag)){return true}return false})}if(!angular.isUndefined($scope.filteredTotal)&&!angular.isUndefined($scope.filterClass2)&&$scope.filterClass2.length>0){$scope.filteredTotal=$filter("filter")($scope.filteredTotal,function(item){if(searchContains(item.class2,$scope.filterClass2)){return true}return false})}if(!angular.isUndefined($scope.filteredTotal)&&!angular.isUndefined($scope.filterClass3)&&$scope.filterClass3.length>0){$scope.filteredTotal=$filter("filter")($scope.filteredTotal,function(item){if(searchContains(item.class3,$scope.filterClass3)){return true}return false})}};$scope.preloadNextTab=function(noResults){$scope.countByFilter();if(angular.isUndefined($scope["filterLoaded"+$scope.filterClass])){HttpService.getDataUrl($scope["filterLoad"+$scope.filterClass],"").then(function(response){$scope.safeApply(function(){$scope["filterLoaded"+$scope.filterClass]=true;if(response.data.length==$scope.filteredTotal.length){if(noResults){$scope.safeApply(function(){$scope.isLoading=false;$scope.isSuccessful=true;$scope.more=false;$scope.noresults=true})}else{$scope.safeApply(function(){$scope.more=false;$scope.isLoading=false})}}else{var i2=0;for(var i=0;i<response.data.length;i++){if(i2>=$scope.filteredTotal.length){if($scope.firstAction&&$scope.firstAction.substr(0,5)=="CLASS"){if(response.data[i].class==$scope.firstAction.substr(5)){$scope.items.push(response.data[i]);i2++}}else{$scope.items.push(response.data[i]);i2++}}else{i2++}}
3if($scope.filteredTotal.length<$scope.itemsPerPage){$scope.safeApply($scope.starter());$scope.search()}else{$scope.loadData()}}})})}};$scope.preloadNextTabTag=function(noResults){$scope.countByFilter();if(angular.isUndefined($scope["filterLoadedTag"+$scope.filterTag])){HttpService.getDataUrl($scope["filterLoadTag"+$scope.filterTag],"").then(function(response){$scope.safeApply(function(){$scope["filterLoadedTag"+$scope.filterTag]=true;if(response.data.length==$scope.filteredTotal.length){if(noResults){$scope.safeApply(function(){$scope.isLoading=false;$scope.isSuccessful=true;$scope.more=false;$scope.noresults=true})}else{$scope.safeApply(function(){$scope.more=false;$scope.isLoading=false})}}else{var i2=0;for(var i=0;i<response.data.length;i++){if(i2>=$scope.filteredTotal.length){if($scope.firstAction&&$scope.firstAction.substr(0,5)=="CLASS"){if(response.data[i].class==$scope.firstAction.substr(5)){$scope.items.push(response.data[i]);i2++}}else{$scope.items.push(response.data[i]);i2++}}}if($scope.filteredTotal.length<$scope.itemsPerPage){$scope.s
3afeApply($scope.starter());$scope.search()}else{$scope.loadData()}}})})}};$scope.setFilterDefault=function(filterData,urlAll){$scope.scrollTo($scope.scrollId,"");$scope.filterMain=true;$scope.filterTag=false;$scope.filterDate=false;$scope.filterDate2=false;$scope.filterClass=false;$scope.filterClass2=false;$scope.filterClass3=false;angular.element("#content-"+$scope.idData).fadeOut("fast",function(){$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).fadeIn("fast")});return false};$scope.setFilterClass=function(filterClass,urlAll,maintainTag){if(angular.element("#content-"+$scope.idData+"-tabs").length){angular.element("#content-"+$scope.idData+"-tabs .items-tab").fadeOut("fast")}$scope.filterMain=false;$scope.filterDate=false;$scope.filterDate2=false;if(!maintainTag){$scope.filterTag=false}$scope.filterClass=filterClass;$scope.filterClass2=false;$scope.filterClass3=false;if(!filterClass){$scope.showFilters()}else{$scope.hasFilter=true;if(CommonFactory.isMobile()){$scope.hideFilters()}}angular.element("#content-"+$scope.idData).fadeOut("fast",function(){if(urlAll){if(filterClass){$scope["urlLoad"+filterClass]=urlAll}}$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).fadeIn("fast")});$scope.scrollTo($scope.idData,"");return false};$scope.setFilterSearch=function(filterSearch,maintainFilters,maintainDate){if(filterSearch){$scope.query=filterSearch;$scope.hasFilter=true}else{delete $scope.query}$scope.filterMain=false;if(!maintainDate){$scope.filterDate=false}if(!maintainFilters){$scope.filterTag=false;$scope.filterClass=false;$scope.filterClass2=false;$scope.filterClass3=false}angular.element("#content-"+$scope.idData).fadeOut("fast",function(){$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).fadeIn("fast")});$scope.scrollTo($scope.idData,"");return false};$scope.setFilterAlways=function($event,filterAlways){var checkedbox=false;if($event){var checkbox=$event.target;checkedbox=checkbox.checked}else{var checkedbox=true}$scope.scrollTo($scope.scrollId,"");$scope.filterAlways=false;$scope.filterAlwaysField=false;if(checkedbox==true){var exp=filterAlways.split(",");$scope.filterAlwaysField=exp[2];if(typeof exp[3]!="undefined"&&exp[3]=="user"){if($rootScope.currentUser[exp[1]]){$scope.filterAlways=$rootScope.currentUser[exp[1]]}}else{$scope.filterAlways=exp[1]}}angular.element("#content-"+$scope.idData).fadeOut("fast",function(){$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).fadeIn("fast")});return false};$scope.setFilterTag=function(filterTag,urlAll,maintainClass,slug,treeOpen){if(treeOpen){angular.forEach(treeOpen,function(itemId){$scope.filtersCollapse[itemId]=true})}if(angular.element("#content-"+$scope.idData+"-tabs").length){angular.element("#content-"+$scope.idData+"-tabs .items-tab").fadeOut("fast")}$scope.filterMain=false;$scope.filterDate=false;$scope.filterDate2=false;if(filterTag){$scope.filterTag=filterTag;$scope.hasFilter=true;if(CommonFactory.isMobile()){$scope.hideFilters()}}else{$scope.filterTag=false;$scope.showFilters()}if(!maintainClass){$scope.filterClass=false;$scope.filterClass2=false;$scope.filterClass3=false}if(slug){$location.hash(slug)}angular.element("#content-"+$scope.idData).fadeOut("fast",function(){if(urlAll){if(filterTag){$scope["urlLoadTag"+filterTag]=urlAll}}$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).fadeIn("fast")});$scope.scrollTo($scope.idData,"");return false};$scope.setFilterTab=function(tabName,showContent,filterContent,resetFilterTab){angular.element("#content-"+$scope.idData+"-tabs .items-tab").hide();angular.element("#content-"+$scope.idData).hide();if(resetFilterTab){$scope.setFilterTag("","",1)}if(showContent==1){if(!filterContent){$scope.setFilterClass("","",1);angular.element("#content-"+$scope.idData).fadeIn("fast")}else{$scope.setFilterClass(filterContent,"",1)}angular.element("#content-"+$scope.idData+"-no-results").fadeIn("fast")}if(angular.element("#content-"+$scope.idData+"-tabs .items-tab."+tabName).length){angular.element("#content-"+$scope.idData+"-tabs").fadeIn("fast");angular.element("#content-"+$scope.idData+"-tabs .items-tab."+tabName).fadeIn("fast")}$scope.scrollTo($scope.idData,"");$scope.hasFilter=true;return false};$scope.setFilterDate=function(filterDate,urlAll){$scope.filterMain=false;$scope.filterTag=false;$scope.filterDate=filterDate;$scope.filterDate2=$scope.filterDate2;$scope.filterClass=false;$scope.filterClass2=false;$scope.filterClass3=false;angular.element("#content-"+$scope.idData).fadeOut("fast",function(){if(urlAll){if(filterClass){$scope["urlLoad"+filterClass]=urlAll}$scope.countByFilter();if($scope.filteredTotal.length<$scope.itemsPerPage){$scope["filterLoad"+filterClass]=urlAll;$scope.preloadNextTab()}}$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).fadeIn("fast")});$scope.scrollTo($scope.idData,"");$scope.hasFilter=true;return false};$scope.setFilterDate2=function(filterDate2,urlAll){$scope.filterMain=false;$scope.filterTag=false;$scope.filterDate=$scope.filterDate;$scope.filterDate2=filterDate2;$scope.filterClass=false;$scope.filterClass2=false;$scope.filterClass3=false;angular.element("#content-"+$scope.idData).fadeOut("fast",function(){if(urlAll){if(filterClass){$scope["urlLoad"+filterClass]=urlAll}$scope.countByFilter();if($scope.filteredTotal.length<$scope.itemsPerPage){$scope["filterLoad"+filterClass]=urlAll;$scope.preloadNextTab()}}$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).fadeIn("fast")});$scope.scrollTo($scope.idData,"");$scope.hasFilter=true;return false};$scope.setFilterDateNow=function($event,filterDateNow,force){var checkedbox=false;if($event){var checkbox=$event.target;if($scope.firstAction&&$scope.firstAction=="DATENOW"){if(checkbox.checked){checkedbox=false}else{checkedbox=true}}else{checkedbox=checkbox.checked}}else{var checkedbox=true}$scope.scrollTo($scope.scrollId,"");$scope.filterMain=false;$scope.filterDateAlways=false;if(checkedbox==true){$scope.filterDateAlways=filterDateNow}angular.element("#content-"+$scope.idData).fadeOut("fast",function(){$scope.s
3afeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).fadeIn("fast")});return false};$scope.scrollTo=function(dataslide,plus){angular.element("html,body").animate({scrollTop:0},500)};$scope.show_plus=function(item){if(angular.isUndefined(item.show_plus)){item.show_plus=true}else if(item.show_plus==true){item.show_plus=false}else{item.show_plus=true}};$scope.show_hide_text=function(item){if(angular.isUndefined(item.show_text)){item.show_text=true}else if(item.show_text==true){item.show_text=false}else{item.show_text=true}};$scope.get_plus_icon=function(item){var icon="icon-plus";if(!angular.isUndefined(item.show_plus)&&item.show_plus==true){icon="icon-minus"}return icon};$scope.groupFilter=function(item){var itemIndex=$scope.pagedItemsLoaded.indexOf(item);var ok=false;angular.forEach($scope.groupFilters,function(el,key){if(el[0]-1==itemIndex){item.groupItemNumber=key+1;item.idx=itemIndex;ok=item}});return ok};$scope.setSearch=function(maintainFilters,maintainDate,clearFilters){if(!maintainFilters&&!maintainDate){$scope.clearFilters()}var elm=angular.element(event.srcElement);if(event.keyCode==13){$scope.setFilterSearch(elm[0].value,maintainFilters,maintainDate)}else{setTimeout(function(){if(elm[0].value.length<1){setTimeout(function(){$scope.setFilterSearch("",maintainFilters,maintainDate)},300)}else if(elm[0].value.length>2&&elm[0].value!=$scope.query){setTimeout(function(){$scope.setFilterSearch(elm[0].value,maintainFilters,maintainDate)},300)}},200)}};$scope.setDateFrom=function(newDate){if(newDate){var dateNew=newDate.toISOString().substring(0,10);$scope.setFilterDate(">=,"+dateNew)}};$scope.setDateTo=function(newDate){if(newDate){var dateNew=newDate.toISOString().substring(0,10);$scope.setFilterDate2("<=,"+dateNew)}};$scope.clearFilters=function(all){angular.element("#content-"+$scope.idData+"-tabs .items-tab").hide();$scope.dateFrom.value="";$scope.dateTo.value="";$(".filters-select").removeClass("active");$(".filters-input").val("");$(".filters-default").addClass("active");if(all){$(".filter-input-search").val("");$scope.setFilterSearch("")}$scope.hasFilter=false};$scope.showGroupByIndex=function(groupItem,item){};$scope.groupFilterItems=function(item){var returnItems=[];var idxFrom="";var idxTo="";var itemIndex=$scope.pagedItemsLoaded.indexOf(item);angular.forEach($scope.groupFilters,function(el){if(el[0]-1==itemIndex){idxFrom=itemIndex+1;idxTo=el[1]}});if(idxFrom&&idxTo){var ix=1;angular.forEach($scope.items,function(item,idx){if(idx+1>=idxFrom&&idx+1<=idxTo){item.itemNumber=ix;ix++;returnItems.push(item)}})}return returnItems};$scope.getIndex=function(item){return $scope.pagedItemsLoaded.indexOf(item)};$scope.openMediaItemInOverlay=function(item,overlayName){$("#"+overlayName+" .item-info-icon i").removeAttr("class").attr("class","");$("#"+overlayName+" .item-info-icon i").addClass("UIcon");$("#"+overlayName+" .item-info-icon i").addClass("UIcon-"+item.media_type);$("#"+overlayName+" .md-item-title").html(item.title);$("#"+overlayName+" .md-item-info").removeAttr("class").attr("class","").addClass("md-item-info");$("#"+overlayName+" .md-item-info").addClass("file-"+item.extension);$("#"+overlayName+" .item-info-type").html(item.extension);$("#"+overlayName+" .item-info-size").html(item.filesize);if(item.class==1){$("#"+overlayName+" .md-preview-media").html('<img src="'+item.media.thumb+'" class="item-img">')}else if(item.class==2){if(item.media.embed){var mediaFile=item.media.embed}else{var mediaFile=item.media.source}if(mediaFile.substr(-3,3)=="mp4"){$("#"+overlayName+" .md-preview-media").html('<video width="100%" controls controlsList="nodownload"> <source src="'+mediaFile+'" type="video/mp4"></video>')}else{$("#"+overlayName+" .md-preview-media").html('<iframe width="100%" height="100%" src="'+mediaFile+'"> </iframe>')}}$("#"+overlayName+" .md-preview-link a").attr("href",item.media.source);$rootScope.$on("site:modal-close-preview",function(){$timeout(function(){$("#modal-preview .md-preview-media").html("")},0)});$rootScope.openModal(overlayName,"","","preview")};$scope.destroy=function(id,reload){$("#"+id).removeClass("md-show");$("#"+id+" .md-preview-media").html("");
3$timeout(function(){$scope.safeApply(function(){initVars()})},0);if(reload){$window.location.reload()}};$scope.dateFromOpen=function(){if(!$scope.dateFrom.watched){$scope.$watch("dateFrom.value",function(newDate){$scope.dateFrom.watched=true;$scope.setDateFrom(newDate)})}$scope.dateFrom.opened=true};$scope.dateToOpen=function(){if(!$scope.dateTo.watched){$scope.$watch("dateTo.value",function(newDate){$scope.dateTo.watched=true;$scope.setDateTo(newDate)})}$scope.dateTo.opened=true};$scope.imgBackgroundOverlay=function(item){var returnArray={};var returnImg="";if(!angular.isUndefined(item.extraClass)){if(searchContains(item.extraClass,"overlay")||searchContains(item.extraClass,"large")||angular.element("#angular-news").hasClass("galleries")){if(CommonFactory.isMobile()){returnImg=item.mediaMobile}else{if(searchContains(item.extraClass,"large")||angular.element("#angular-news").hasClass("galleries")){returnImg=item.media}else{returnImg=item.mediaExtra}}}}if(returnImg){returnArray={"background-image":"url("+returnImg+")"}}return returnArray};$scope.showHideFilters=function(){angular.element("body").toggleClass("hidden-related");angular.element(".show-hide-filters").toggleClass("open");return false};$scope.showFilters=function(){angular.element("body").removeClass("hidden-related");angular.element(".show-hide-filters").removeClass("open");return false};$scope.hideFilters=function(){angular.element("body").addClass("hidden-related");angular.element(".show-hide-filters").addClass("open");return false};$scope.showEvents=function(){$rootScope.currentEvent="";$scope.currentItem=undefined;$location.hash("");$scope.showFilters();return false};$scope.isFiltered=function(itemId){if(!angular.isUndefined($scope.filtersCollapse[itemId])&&$scope.filtersCollapse[itemId]){return true}else{return false}};$scope.toggleCollapse=function(itemId){if(!angular.isUndefined($scope.filtersCollapse[itemId])&&$scope.filtersCollapse[itemId]){$scope.filtersCollapse[itemId]=false}else{$scope.filtersCollapse[itemId]=true}};$scope.toggleFilterColumn=function(){if(!$scope.filtersShowing){angular.element("body").removeClass("hidden-related")}else{angular.element("body").addClass("hidden-related")}$scope.filtersShowing=!$scope.filtersShowing};$scope.toggleLightbox=function(){if(!$scope.lightboxShowing){angular.element("body").removeClass("hidden-related")}else{angular.element("body").addClass("hidden-related")}$scope.lightboxShowing=!$scope.lightboxShowing};$scope.openMediaItem=function(item){$scope.currentItem=item;angular.element(".main-view").addClass("hidden");angular.element(".lightbox-view").addClass("hidden");angular.element(".details-view").removeClass("hidden");var hashParams=$scope.getHashParams();hashParams.id=item.id;$scope.setHashParams(hashParams);$scope.getMediaDownloadOptions(item);$scope.setVideoConfig(item);$scope.scrollTo($scope.idData,"")};$scope.formatFileSize=function(fileSizeInKiloBytes){if(fileSizeInKiloBytes<1024*1024){return(fileSizeInKiloBytes/1024).toFixed(1)+" MB"}else{return(fileSizeInKiloBytes/(1024*1024)).toFixed(1)+" GB"}};$scope.closeMediaItem=function(){angular.element(".details-view").addClass("hidden");if($scope.currentLightBox){angular.element(".lightbox-view").removeClass("hidden")}else{angular.element(".main-view").removeClass("hidden")}$scope.selectLightBox=undefined;var hashParams=$scope.getHashParams();delete hashParams.id;$scope.setHashParams(hashParams);$scope.currentItem=undefined};$scope.showLightBox=function(item){$scope.model.lightBoxName="";if(item){$scope.currentItem=item}$rootScope.openModal("modal-lightbox")};$scope.createLightBox=function(){$scope.lightboxError=false;if($scope.model.lightBoxName.length>1){$http.post($scope.actionsUrl,{action:"NewLightBox",name:$scope.model.lightBoxName}).success(function(data,status,headers,config){var lightBoxData={id:data.id,data:[]};$scope.addToLightBox(lightBoxData);$scope.model.lightBoxName=""}).error(function(data,status,headers,config){})}else{$scope.lightboxError=true}};$scope.checkMediaInLightBox=function(lightBox,selectedItem){var ret="";var hasMedia=false;var currItem=$scope.currentItem;if(selectedItem){currItem=selectedItem}
3if(currItem){angular.forEach(lightBox.data,function(i){if(!hasMedia){if(i.id==currItem.id){hasMedia=true}}});if(hasMedia){ret="active"}}return ret};$scope.checkMediaInLightBoxes=function(item){var ret="";var hasMedia=false;angular.forEach($scope.lightBoxes,function(lightBox){if(!hasMedia){angular.forEach(lightBox.data,function(i){if(!hasMedia){if(item){if(i.id==item.id){hasMedia=true}}else{if(i.id==$scope.currentItem.id){hasMedia=true}}}})}});if(hasMedia){ret="active"}return ret};$scope.getLightBox=function(){if(!$scope.noFavorites){$http.post($scope.actionsUrl,{action:"LightBox"}).success(function(data,status,headers,config){$scope.lightBoxes=data;if($scope.editLightBox){$scope.editLightBox=false}}).error(function(data,status,headers,config){if($scope.editLightBox){$scope.editLightBox=false}})}};$scope.openLightBox=function(item){$scope.initLightBox(item);$scope.scrollTo($scope.idData,"")};$scope.addToLightBox=function(item){$scope.editLightBox=true;if(!$scope.checkMediaInLightBox(item)){item.data.push($scope.currentItem);$http.post($scope.actionsUrl,{action:"UpdateLightBox",id:item.id,data:item.data}).success(function(data,status,headers,config){$scope.getLightBox()}).error(function(data,status,headers,config){$scope.editLightBox=false;console.log("ERR",data)})}else{console.log("already in lightbox")}};$scope.removeFromLightBox=function(item){var newData=[];angular.forEach(item.data,function(media){if(media.id!=$scope.currentItem.id){newData.push(media)}});item.data=newData;$http.post($scope.actionsUrl,{action:"UpdateLightBox",id:item.id,data:item.data}).success(function(data,status,headers,config){$scope.getLightBox();if($scope.currentLightBox.id==item.id){$scope.initLightBox(item,$scope.pageLightBox)}}).error(function(data,status,headers,config){console.log("ERR",data)})};$scope.getMediaDownloadOptions=function(item){if(item.class==1){$scope.downloadOptionsShow=$scope.downloadOptions}else{$http.post($scope.actionsUrl,{action:"DownloadOptions",id:item.id,restrictions:$scope.mediacenterRestrictions||[]}).success(function(data,status,headers,config){$scope.downloadOptionsShow=data}).error(function(data,status,headers,config){})}};$scope.downloadMedia=function(item,crop,modalId,_skipTerms){if(angular.isUndefined(item.downloadData)||angular.isUndefined(item.downloadData.loading[crop.id])&&angular.isUndefined(item.downloadData.error[crop.id])){var params={action:"Download",id:item.id};if(crop){params.crop=crop.id}if(angular.isUndefined(item.downloadData)){item.downloadData={loading:{},error:{}}}item.downloadData.loading[crop.id]=true;$http.post($scope.actionsUrl,params).success(function(data,status,headers,config){if(data.success==true){$scope.fileURL=data.signedUrl;$window.location.href=data.signedUrl;item.downloadData.loading[crop.id]=true;delete item.downloadData.loading[crop.id]}else{item.downloadData.error[crop.id]=true;delete item.downloadData.loading[crop.id]}}).error(function(data,status,headers,config){item.downloadData.error[crop.id]=true;delete item.downloadData.loading[crop.id]})}};$scope.setVideoConfig=function(item){if($scope.currentItem.class==2){var videoSource=[{src:$scope.currentItem.media.source,type:"video/mp4"}];$scope.configvideo={preload:"none",autoPlay:false,sources:videoSource,plugins:{controls:{autoHide:true,autoHideTime:5e3}}}}}};$scope.changeImage=function(dir,item,key){var mediaArray=$scope.items;if($scope.eSearch&&$scope.eSearch.searchResults.length>0){mediaArray=$scope.eSearch.searchResults}if(key==undefined){key="latest"}var position=mediaArray.findIndex(x=>x.id==item.id);switch(dir){case"prev":if(mediaArray[position-1]){$scope.currentItem=mediaArray[position-1]}else{$scope.currentItem=mediaArray[mediaArray.length-1]}break;case"next":if(mediaArray[position+1]){$scope.currentItem=mediaArray[position+1]}else{if($scope.has_moreWidget(key)){$scope.show_moreWidget(key);$scope.changeImage(dir,item,key)}else{$scope.currentItem=mediaArray[0]}}break}var hash=window.location.hash.split("id=");window.location.hash=hash[0]+"id="+$scope.currentItem.id};$scope.initIconicSearch=function(){var vm=this;vm.debug={};vm.galleriesRaw=[];vm.galleriesTree=[];vm.galleriesById={};vm.galleryItems=[];vm.mediaItems=[];vm.searchedItems=[];vm.currentItems=[];vm.pagination=null;vm.selectedMedia=null;vm.activeBreadcrumbs=[];vm.filterGallery="";vm.filterYear="";vm.filterTag="";vm.searchQuery="";var filterLabels={filterGallery:"Gallery",filterYear:"Year",filterTag:"Tag"};vm.updateBreadcrumb=function(){vm.activeBreadcrumbs=[];if(vm.filterGallery){vm.activeBreadcrumbs.push({key:"Gallery",label:filterLabels.filterGallery,value:vm.filterGallery})}if(vm.filterYear){vm.activeBreadcrumbs.push({key:"Year",label:filterLabels.filterYear,value:vm.filterYear})}if(vm.filterTag){vm.activeBreadcrumbs.push({key:"Tag",label:filterLabels.filterTag,value:vm.filterTag})}};vm.removeBreadcrumb=function(crumb){vm[crumb.key]="";vm.updateBreadcrumb()};vm.performSearch=function(page){var gallerySlug=vm.filterGallery?vm.filterGallery:"all-images";var pageNum=page||1;var url="https://l5l242ujak.execute-api.us-east-1.amazonaws.com/prod/en/mediacentre/image-library/gallery/"+gallerySlug+"?page="+pageNum;$http.get(url).then(function(resp){console.log(resp)}).catch(function(err){console.error(err)})}};$scope.initGalleries=function(url,per_page,imageDefault,idData,scrollId,firstAction,filterId,groupFilters,searchParams,onRenderAction,fotoramaId,addSeparatorFromField,noFavorites,searchKey,hasDivisions,disableOtherScrolls,directDownload,eventToListen,useTagShouldSearch,globalMimirItemUrl,restrictions,individualMimirItemUrl,downloadLimitMax,downloadLimitUserGroup,termsAndConditionsAtDownload,disableThisScrolls){$translate.use(system_language.substr(0,2));$scope.termsAndConditionsAtDownload=termsAndConditionsAtDownload;$scope.downloadTermsAccepted=false;$scope.mediacenterRestrictions=restrictions;$scope.directDownload=directDownload;if(disableOtherScrolls){$rootScope.disableOtherScrolls=1}$scope.disableThisScrolls=disableThisScrolls;
3$rootScope.$on("site:hashChanged",function(a){var urlParams=$scope.getHashParams();console.log("[MediaController] site:hashChanged triggered. urlParams:",urlParams);if(!angular.isUndefined(urlParams.id)&&(angular.isUndefined($scope.currentItem)||urlParams.id!=$scope.currentItem.id)){$scope.setCurrentItemFromId()}else if(angular.isUndefined(urlParams.id)&&!angular.isUndefined($scope.currentItem)){$scope.closeMediaItem()}$scope.safeApply(function(){if(!angular.isUndefined(urlParams.gallery)&&urlParams.gallery!=$scope.currentGallery.id&&angular.isArray($scope.allGalleries)){var currGal=$scope.allGalleries.filter(function(g){return g.id==urlParams.gallery});if(currGal.length>0){$scope.openGallery(currGal[0])}}else if(angular.isUndefined(urlParams.gallery)&&angular.isArray($scope.allGalleries)&&$scope.allGalleries.length>0){if(!$scope.currentGallery||$scope.currentGallery.id!=$scope.allGalleries[0].id){if(!$scope.allGalleries[0].hasChilds){$scope.openGallery($scope.allGalleries[0])}else{$scope.firstGallery="";$scope.currentGallery=$scope.allGalleries[0];$scope.changeView("gallery");$scope.isLoading=false}}}})});var urlDecode=angular.fromJson($base64.decode(url));if(!angular.isUndefined(urlDecode.actions)&&urlDecode.actions.length>0){$scope.actionsUrl=urlDecode.actions;console.log("$scope.actionsUrl",$scope.actionsUrl)}$scope.isLoading=true;$scope.eventSelected=false;$scope.encodedUrl=url;$scope.allGalleries=[];$scope.currentGallery="";$scope.previewView="";$scope.currentView="main";$scope.viewsHistory=[];$scope.idData=idData;$scope.scrollId=scrollId;$scope.firstAction=firstAction;$scope.fieldsByType=["class","class2","class3"];$scope.imageDefault=imageDefault;$scope.onSocial=false;$scope.onRenderAction=onRenderAction;$scope.fotoramaId=fotoramaId;$scope.filterId=filterId;$scope.hideDownloads=false;$scope.allGroups=groupFilters;$scope.searchParams=searchParams;$scope.addSeparatorFromField=addSeparatorFromField;$scope.searchParam="";$scope.groupFilters=[];$scope.currentModalData={};$scope.videoAPI=null;$scope.filtersCollapse={};$scope.sortType="";$scope.sortReverse=false;$scope.searchColumn="";$scope.itemsPerPage=per_page||15;$scope.itemsPerPageWidgets=per_page||15;$scope.hasFilter=false;$scope.noFavorites=noFavorites;$scope.hasDivisions=hasDivisions;$scope.selection=[];$scope.widgets={};$scope.isPDF=false;$scope.filtersShowing=angular.element("body").hasClass("hidden-related")?false:true;$scope.lightboxShowing=false;$scope.checkMediaLightBoxesUpdated={};$scope.eventToListen=eventToListen;$scope.useTagShouldSearch=useTagShouldSearch;$scope.globalMimirItemUrl=globalMimirItemUrl;$scope.individualMimirItemUrl=individualMimirItemUrl;$scope.sendTo={recipients:"",invalidEmail:false};$scope.selectionTotalSize=0;if(searchKey){$scope.eSearch.searchKey=searchKey}var params=[];$scope.setFeaturedTagID=function(ID){$scope.featuredTagID=ID};$scope.loadDataFromJson=function(){console.log("[MediaController] loadDataFromJson called. currentGallery:",$scope.currentGallery?$scope.currentGallery.id:null,"feed:",$scope.currentGallery?$scope.currentGallery.feed:null,"loadEvent:",$scope.loadEvent);if($scope.currentGallery.feed&&$scope.loadEvent){$scope.eSearchClean();$scope.loadEvent=false;$scope.items=[];$scope.featuredImages=[];$scope.allFilters=[];HttpService.getDataUrl($scope.currentGallery.feed,params).then(function(response){$scope.safeApply(function(){if(!angular.isUndefined(response.data.filters)){$scope.allFilters=response.data.filters?response.data.filters:[]}if(!angular.isUndefined(response.data.items)){var responseItems=response.data.items}else{var responseItems=response.data}angular.forEach(responseItems,function(item){if($scope.filterId){if(item.id!=$scope.filterId){$scope.items.push(item)}}else{if($scope.firstAction&&$scope.firstAction.substr(0,5)=="CLASS"){if(item.class==$scope.firstAction.substr(5)){$scope.items.push(item)}}else{$scope.items.push(item)}}if(item.tags&&item.tags.includes($scope.featuredTagID)){if($scope.featuredImages.length<10){$scope.featuredImages.push(item)}}});var hashParams=$scope.getHashParams();if(!angular.isUndefined(hashParams.id)){$scope.currentItemId=hashParams.id;$scope.setCurrentItemFromId()}if(CommonFactory.isMobile()){$scope.hideFilters()}if($scope.firstAction){if($scope.firstAction&&$scope.firstAction=="DATENOW"){$scope.setFilterDateNow("",">=",true)}else if($scope.firstAction.substr(0,6)=="always"){$scope.setFilterAlways("",$scope.firstAction)}else if($scope.firstAction.substr(0,4)=="date"){$scope.setFilterDate($scope.firstAction.substr(5))}else if($scope.firstAction&&$scope.firstAction.substr(0,4)=="NONE"){$scope.search()}else if($scope.firstAction&&$scope.firstAction.substr(0,5)=="CLASS"){$scope.search()}}else{$scope.search()}})}).catch(function(error){console.error("Error fetching data: ",error);$scope.isLoading=false})}else{$scope.isLoading=false;$scope.noEvent=true}};$scope.hideDownloadsForRestrictedUsers=function(){if($rootScope.currentUser.groups&&$scope.mediacenterRestrictions&&$scope.mediacenterRestrictions.length>0){$scope.hideDownloads=$scope.mediacenterRestrictions.some(restriction=>$rootScope.currentUser.groups.includes(restriction.group));if($scope.hideDownloads){$(".downloads-container .actions-menu .ion-md-cloud-download").hide();$(".downloads-container .actions-menu .ion-md-download").hide()}}else{console.log("No restrictions defined")}};$scope.hideDownloadsForRestrictedUsers();
3$scope.addSubGalleriesToList=function(gallery,list,allGalleries,isMainLevel){let subGalleries=gallery.galleries;for(let index=0;index<subGalleries.length;index++){if(!isMainLevel){let inList=list.find(item=>item.id==subGalleries[index].id);if(!inList){for(let g=0;g<allGalleries.length;g++){const element=allGalleries[g];if(element.id==subGalleries[index].id){list.push(element)}}}}if(subGalleries[index].galleries&&subGalleries[index].galleries.length>0){$scope.addSubGalleriesToList(subGalleries[index],list,allGalleries,false)}}return list};$scope.startGalleries=function(){var urlDecode=angular.fromJson($base64.decode($scope.encodedUrl));$scope.galleriesUrl=urlDecode.url;const noCache=urlDecode.hasOwnProperty("noCache")&&urlDecode.noCache===true;$scope.getAllTags();if($scope.galleriesUrl){$scope.eSearchClean();$scope.allGalleries=[];$scope.downloadOptions=[];$scope.eventData=undefined;const url=$scope.galleriesUrl+(noCache?"?ts="+Date.now():"");HttpService.getDataUrl(url,params).then(function(response){$scope.safeApply(function(){if(!angular.isUndefined(response.data.event)){$scope.eventData=response.data.event}if(!angular.isUndefined(response.data.downloadOptions)){if(angular.isUndefined(response.data.cropPermissions)){$scope.downloadOptions=response.data.downloadOptions}else{$scope.downloadOptions=$scope.getCropsByPermissions(response.data)}}if(!angular.isUndefined(response.data.menuPre)){$scope.menuPre=response.data.menuPre}if(!angular.isUndefined(response.data.menuMid)){$scope.menuMid=response.data.menuMid}if(!angular.isUndefined(response.data.menuPost)){$scope.menuPost=response.data.menuPost}if(!angular.isUndefined(response.data.widgets)){$scope.widgets=response.data.widgets}if(!angular.isUndefined(response.data.galleries)&&response.data.galleries.length>0){if($scope.hasDivisions){angular.forEach(response.data.galleries,function(gallery){if(gallery.total==0){return}var hasDivision=false;angular.forEach(gallery.divisions,function(gDivision){angular.forEach($rootScope.currentUser.groups,function(uGroup){if(gDivision==uGroup){hasDivision=true}})});if(hasDivision){let inList=$scope.allGalleries.find(item=>item.id==gallery.id);if(!inList){$scope.allGalleries.push(gallery)}if(gallery.galleries&&gallery.galleries.length>0){$scope.addSubGalleriesToList(gallery,$scope.allGalleries,response.data.galleries,true)}}})}else if(!angular.isUndefined(response.data.galleries[0].permissions)){angular.forEach(response.data.galleries,function(gallery){if(gallery.total==0){return}var hasPermission=false;if(gallery.permissions==null){hasPermission=true}else{var permissions=angular.fromJson($base64.decode(gallery.permissions));if(!angular.isUndefined(permissions.user_groups)){angular.forEach(permissions.user_groups,function(uGroup){if($rootScope.userAuthenticated(uGroup)){hasPermission=true}})}}if(hasPermission){$scope.allGalleries.push(gallery)}})}else{$scope.allGalleries=response.data.galleries}}else if(!angular.isUndefined(response.data.widgets)&&response.data.widgets.length==1&&!angular.isUndefined(response.data.widgets[0].items)&&response.data.widgets[0].items.length>0){let currentItems=response.data.widgets[0].items;var hashParams=$scope.getHashParams();if(!angular.isUndefined(hashParams.id)&&angular.isUndefined(hashParams.gallery)){let item=currentItems.find(x=>x.id==hashParams.id);if(item){$scope.openMediaItem(item)}}}else{$scope.allGalleries=response.data}if($scope.allGalleries.length>0){$scope.getLightBox();var hashParams=$scope.getHashParams();var openedGallery=false;console.log("[MediaController] startGalleries JSON loaded. allGalleries count:",$scope.allGalleries.length,"hashParams:",hashParams);if(!angular.isUndefined(hashParams.gallery)&&angular.isArray($scope.allGalleries)){var currGal=$scope.allGalleries.filter(function(g){return g.id==hashParams.gallery});if(currGal.length>0){openedGallery=true;$scope.openGallery(currGal[0])}}if(!openedGallery){if($scope.allGalleries.length>0&&!$scope.allGalleries[0].hasChilds){$scope.openGallery($scope.allGalleries[0])}else{$scope.firstGallery="";$scope.currentGallery=$scope.allGalleries[0];$scope.changeView("gallery");$scope.isLoading=false}}if(!angular.isUndefined(hashParams.id)&&angular.isUndefined(hashParams.gallery)){var idMedia=hashParams.id;$timeout(function(){$scope.eSearch.searchParam=idMedia;$scope.searchES(idMedia)},1e3)}}else if($scope.allGalleries.length==0){$scope.firstGallery="";$scope.isLoading=false}$scope.paginateWidgets()})})}else{if($scope.eventToListen){$rootScope.$on("site:"+$scope.eventToListen,function(e,data){if(!angular.isUndefined(data.url)){urlDecode.url=data.url;$scope.encodedUrl=$base64.encode(angular.toJson(urlDecode));$timeout(function(){$scope.startGalleries()})}})}$scope.isLoading=false;$scope.noEvent=true}};$scope.openGallery=function(gallery){console.log("[MediaController] openGallery called for gallery id:",gallery?gallery.id:null,"feed:",gallery?gallery.feed:null);if(gallery.name==="MEDIA CENTRE"&&window.location.hostname==="mediacentre.e1series.com"){window.location.href="/mediacentre";return}else{$scope.isExternalGallery=gallery.is_external;$scope.selection=[];$scope.changeView("gallery");$scope.eSearchClean();$scope.eventSelected=false;$scope.currentGallery=gallery;if(!$scope.disableThisScrolls){$scope.scrollTo($scope.scrollId,"",100,0)}var hashParams=$scope.getHashParams();hashParams.gallery=gallery.id;if(!angular.isUndefined(hashParams.tags)){delete hashParams.tags}$scope.setHashParams(hashParams);$analytics.eventTrack("category",{category:$scope.idData,label:"#"+gallery.id+" - "+gallery.name});if($scope.currentGallery.feed){$scope.changeView("mediaList");$scope.eventSelected=true;$scope.changeEvent();
3$scope.safeApply(function(){$scope.eSearch.currentOptions="inGallery"})}else{$scope.isLoading=false}}};$scope.galleriesTree=function(){var breadCrumb=[];if($scope.currentGallery){breadCrumb.push($scope.currentGallery);$scope.treeParent(breadCrumb,$scope.currentGallery.parent)}$scope.breadcrubLength=breadCrumb.length;return breadCrumb};$scope.treeParent=function(breadCrumb,idGallery){if(idGallery){var parentGal=$scope.allGalleries.filter(function(g){return g.id==idGallery});if(parentGal.length>0){breadCrumb.unshift(parentGal[0]);$scope.treeParent(breadCrumb,parentGal[0].parent)}}return breadCrumb};$scope.changeEvent=function(){console.log("[MediaController] changeEvent called.");$scope.eSearchClean();$scope.loadEvent=true;$scope.currentItemId="";$scope.url=$scope.currentGallery.feed;$scope.noEvent=$scope.noEvents;$scope.page=1;$scope.filterSearch=false;if($scope.filterId){$scope.filterMain=false}else{$scope.filterMain=true}$scope.filterDate=false;$scope.filterDate2=false;$scope.filterDateAlways=false;$scope.filterTag=false;$scope.filterClass=false;$scope.filterClass2=false;$scope.filterClass3=false;$scope.filterAlways=false;$scope.filterAlwaysField=false;$scope.dateOptions={showWeeks:false,appendToBody:false};$scope.dateFrom={opened:false,value:"",watched:false};$scope.dateTo={opened:false,value:"",watched:false};$scope.starter()};$scope.starter=function(){console.log("[MediaController] starter called. require_authentication:",require_authentication,"userAuthenticated:",$rootScope.userAuthenticated?$rootScope.userAuthenticated():false);$scope.index=0;$scope.data=[];$scope.page=1;$scope.results=[];$scope.pagedItemsLoaded=[];$scope.pagedItemsLoadedPreload=[];$scope.imageLocations=[];$scope.more=true;$scope.moreLoad=false;$scope.status_bar="";$scope.isLoading=true;$scope.noresults=false;$scope.isSuccessful=false;$scope.percentLoaded=0;$scope.preloader=false;$scope.$on("ngRepeatFinished",function(){if($scope.fotoramaId){setTimeout(function(){var $fotoramaDiv=$($scope.fotoramaId);$fotoramaDiv.fotorama()},1500)}if($scope.onRenderAction){eval($scope.onRenderAction)}});if(require_authentication){if($rootScope.userAuthenticated&&$rootScope.userAuthenticated()){$scope.loadDataFromJson()}else{$rootScope.$on("auth:loadFinished",function(){$scope.loadDataFromJson()})}}else{$scope.loadDataFromJson()}};$scope.initLightBox=function(lightBox,toPage){angular.element("#content-"+$scope.idData).fadeOut("fast");angular.element(".main-view").addClass("hidden");angular.element(".details-view").addClass("hidden");angular.element(".lightbox-view").removeClass("hidden");$scope.moreLightBox=true;$scope.moreLoadLightBox=false;$scope.indexLightBox=0;$scope.pageLightBox=1;$scope.pagedLightBoxLoaded=[];$scope.firstLoadLightBox=true;$scope.indexLightBox=0;$scope.pageLightBox=1;$scope.pagedLightBoxLoaded=[];$scope.pagedLightBoxLoadedPreload=[];$scope.currentPageLightBox=0;$scope.currentLightBox=lightBox;$scope.filteredLightBox=$scope.currentLightBox.data;$scope.toPage=0;if(toPage){$scope.toPage=toPage}$scope.loadDataLightBox()};$scope.nextLightBox=function(){$scope.pageLightBox+=1;$scope.loadDataLightBox()};$scope.closeLightBox=function(){angular.element(".details-view").addClass("hidden");angular.element(".lightbox-view").addClass("hidden");angular.element(".main-view").removeClass("hidden");$scope.currentLightBox="";$scope.changeView();$scope.selection=[]};$scope.loadDataLightBox2=function(){$scope.currentPageLightBox=0;$scope.loadDataLightBox()};$scope.loadDataLightBox=function(){$scope.pagedLightBox=[];$scope.currentPageLightBox++;for(;$scope.indexLightBox<$scope.itemsPerPage*$scope.pageLightBox;$scope.indexLightBox++){$scope.moreLoadLightBox=$scope.filteredLightBox.length>$scope.indexLightBox;if($scope.moreLoadLightBox==false){break}$scope.pagedLightBox.push($scope.filteredLightBox[$scope.indexLightBox])}$scope.safeApply(function(){$scope.isSuccessful=true;$scope.percentLoaded=0;if($scope.pageLightBox==1){$scope.viewNextLightBox()}else if($scope.pageLightBox<$scope.toPage){$scope.viewNextLightBox()}angular.element("#content-"+$scope.idData).fadeIn("fast");$scope.isLoading=false})};
3$scope.loadDataWidget2=function(widgetKey){$scope.currentPageWidget[widgetKey]=0;$scope.loadDataWidget(widgetKey)};$scope.loadDataWidget=function(widgetKey){$scope.pagedWidget[widgetKey]=[];$scope.currentPageWidget[widgetKey]++;for(;$scope.indexWidget[widgetKey]<$scope.itemsPerPageWidgets*$scope.pageWidget[widgetKey];$scope.indexWidget[widgetKey]++){$scope.moreLoadWidget[widgetKey]=$scope.filteredWidget[widgetKey].length>$scope.indexWidget[widgetKey];if($scope.moreLoadWidget[widgetKey]==false){break}$scope.pagedWidget[widgetKey].push($scope.filteredWidget[widgetKey][$scope.indexWidget[widgetKey]])}$scope.safeApply(function(){$scope.isSuccessful=true;$scope.percentLoaded=0;if($scope.pageWidget[widgetKey]==1){$scope.viewNextWidget(widgetKey)}else if($scope.pageWidget[widgetKey]<$scope.toPageWidget[widgetKey]){$scope.viewNextWidget(widgetKey)}$scope.isLoading=false})};$scope.search=function(){$scope.filteredItems=$filter("filter")($scope.items,function(item){var x=false;if(!angular.isUndefined($scope.query)){angular.forEach(item,function(val,attr){if(searchMatch(item[attr],$scope.query)){x=true}})}else{x=true}return x});if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterAlways)&&$scope.filterAlways.length>0){$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){if(searchContains(item[$scope.filterAlwaysField],$scope.filterAlways)){return true}return false})}if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterDateAlways)&&$scope.filterDateAlways.length>0){$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){if(searchDate(item.datefilter,$scope.filterDateAlways)){return true}return false})}if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterDate)&&$scope.filterDate.length>0){$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){if(searchDate(item.datefilter,$scope.filterDate)){return true}return false})}if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterDate2)&&$scope.filterDate2.length>0){$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){if(searchDate(item.datefilter,$scope.filterDate2)){return true}return false})}if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterClass)&&$scope.filterClass.length>0){$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){if(searchContains(item.class,$scope.filterClass)){return true}return false})}if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterTag)&&$scope.filterTag.length>0){$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){if(searchContainsComma(item.tags,$scope.filterTag)){return true}return false})}if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterMain)&&$scope.filterMain==true){$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){if(!angular.isUndefined(item.main)){return true}return false})}$scope.currentPage=0;if($scope.filteredItems.length==0){if($scope.filterTag.length>0){if(!angular.isUndefined($scope["urlLoadTag"+$scope.filterTag])&&angular.isUndefined($scope["filterLoadTag"+$scope.filterTag])){$scope.preloadNextItems(1)}else{$scope.safeApply(function(){$scope.isLoading=false;$scope.isSuccessful=true;$scope.more=false;$scope.noresults=true})}}else{if(!angular.isUndefined($scope["urlLoad"+$scope.filterClass])&&angular.isUndefined($scope["filterLoad"+$scope.filterClass])){$scope.preloadNextItems(1)}else{$scope.safeApply(function(){$scope.isLoading=false;$scope.isSuccessful=true;$scope.more=false;$scope.noresults=true})}}}else{$scope.groupToPages()}if($scope.load==true){$scope.load=false}};$scope.loadData=function(){$scope.currentPage++;$scope.search()};$scope.groupToPages=function(){$scope.pagedItems=[];$scope.currentPage++;$scope.imageLocations=[];for(;$scope.index<$scope.itemsPerPage*$scope.page;$scope.index++){$scope.moreLoad=$scope.filteredItems.length>$scope.index;if($scope.moreLoad==false){break}if(angular.isUndefined($scope.filteredItems[$scope.index].allMedia)){$scope.filteredItems[$scope.index].allMedia=[];if(!angular.isUndefined($scope.filteredItems[$scope.index].media)){angular.copy($scope.filteredItems[$scope.index].media,$scope.filteredItems[$scope.index].allMedia)}}$scope.filteredItems[$scope.index].extraClass=$scope.filteredItems[$scope.index].class;if(!angular.isUndefined($scope.filteredItems[$scope.index].class2)){$scope.filteredItems[$scope.index].extraClass+=" "+$scope.filteredItems[$scope.index].class2}if(!angular.isUndefined($scope.filteredItems[$scope.index].class3)){$scope.filteredItems[$scope.index].extraClass+=" "+$scope.filteredItems[$scope.index].class3}if(!angular.isUndefined($scope.filteredItems[$scope.index].premium)){$scope.filteredItems[$scope.index].extraClass+=" "+$scope.filteredItems[$scope.index].premium}$scope.filteredItems[$scope.index].mediaShow=$scope.imageDefault;if($scope.filteredItems[$scope.index].media&&angular.isArray($scope.filteredItems[$scope.index].media)&&$scope.filteredItems[$scope.index].media.length>0){$scope.filteredItems[$scope.index].media=$scope.filteredItems[$scope.index].media[0]}if(angular.isUndefined($scope.filteredItems[$scope.index].media)||!$scope.filteredItems[$scope.index].media||$scope.filteredItems[$scope.index].media.length<1){$scope.filteredItems[$scope.index].extraClass+=" no-img"}else{if(CommonFactory.isMobile()&&$scope.filteredItems[$scope.index].mediaMobile!=false){$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].mediaMobile}else{$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].media}$scope["imageLocations"].push($scope.filteredItems[$scope.index].media);if($scope.filterMain&&$scope.index<1){if(CommonFactory.isMobile()&&$scope.filteredItems[$scope.index].mediaMobile!=false){$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].mediaMobile}else if(!angular.isUndefined($scope.filteredItems[$scope.index].mediaFirst)&&$scope.filteredItems[$scope.index].mediaFirst.length>0){$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].mediaFirst}else{$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].media}$scope["imageLocations"].push($scope.filteredItems[$scope.index].mediaFirst)}}if(!angular.isUndefined($scope.filteredItems[$scope.index].media2)){if(CommonFactory.isMobile()&&$scope.filteredItems[$scope.index].mediaMobile2!=false){$scope.filteredItems[$scope.index].mediaShow2=$scope.filteredItems[$scope.index].mediaMobile2}else{$scope.filteredItems[$scope.index].mediaShow2=$scope.filteredItems[$scope.index].media2}$scope["imageLocations"].push($scope.filteredItems[$scope.index].media2)}if(!angular.isUndefined($scope.filteredItems[$scope.index].pages)&&$scope.filteredItems[$scope.index].pages.length>0){if(CommonFactory.isMobile()&&$scope.filteredItems[$scope.index].mediaMobile!=false){$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].pages[0].medium}else{$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].pages[0].medium}$scope["imageLocations"].push($scope.filteredItems[$scope.index].pages[0].medium);if($scope.filterMain&&$scope.index<1){$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].pages[0].medium;$scope["imageLocations"].push($scope.filteredItems[$scope.index].pages[0].medium)}}if(!angular.isUndefined($scope.filteredItems[$scope.index].tags)&&$scope.filteredItems[$scope.index].tags.length>0){$scope.filteredItems[$scope.index].tagsArray=[];var itemTags=$scope.filteredItems[$scope.index].tags.split(",");angular.forEach(itemTags,function(t){var tagAdd=$filter("filter")($scope.allFilters,{id:t},true);if(tagAdd.length>0){$scope.filteredItems[$scope.index].tagsArray.push(tagAdd[0].name)}})}if(!angular.isUndefined($scope.filteredItems[$scope.index].mediaVideo)){if(angular.isObject($scope.filteredItems[$scope.index].mediaVideo)){$scope.filteredItems[$scope.index].mediaVideoMulti=true}}$scope.pagedItems.push($scope.filteredItems[$scope.index]);if(!angular.isUndefined($scope.filteredItems[$scope.index].media)&&$scope.filteredItems[$scope.index].media){if($scope["filteredItems"][$scope["index"]].media[0]!==null){$scope["imageLocations"].push($scope["filteredItems"][$scope["index"]].media)}}}$scope.safeApply(function(){angular.forEach($scope.pagedItems,function(item){$scope.s
3afeApply(function(){$scope.pagedItemsLoadedPreload.push(item)})});$scope.isSuccessful=true;$scope.percentLoaded=0;if($scope.page==1){$scope.viewNext()}else{}angular.element("#content-"+$scope.idData).fadeIn("fast");$scope.isLoading=false})};$scope.preload=function(imageLocations){preloader.preloadImages(imageLocations).then(function handleResolve(imageLocations){$scope.isSuccessful=true;angular.forEach($scope.resultsPage,function(item){$scope.safeApply(function(){$scope.results.push(item)})});$scope.more=$scope.moreLoad;$scope.percentLoaded=0;$scope.isLoading=false},function handleReject(imageLocation){$scope.isLoading=false;$scope.isSuccessful=false},function handleNotify(event){$scope.percentLoaded=event.percent})};$scope.windowOpen=function(url,title,options){$window.open(url,title,options)};$scope.preloadNextItems=function(noResults){$scope.page+=1;if($scope.firstLoad){$scope.firstLoad=false;$scope.isLoading=true;$scope.safeApply($scope.loadData())}else{if($scope.filterMain==true){$scope.safeApply($scope.loadData())}else if($scope.filterTag.length>0){if(!angular.isUndefined($scope["urlLoadTag"+$scope.filterTag])){if(!angular.isUndefined($scope["filterLoadTag"+$scope.filterTag])){$scope.safeApply($scope.loadData())}else{$scope["filterLoadTag"+$scope.filterTag]=$scope["urlLoadTag"+$scope.filterTag];$scope.safeApply($scope.preloadNextTabTag(noResults))}}else{$scope.safeApply($scope.loadData())}}else{if(!angular.isUndefined($scope["urlLoad"+$scope.filterClass])){if(!angular.isUndefined($scope["filterLoad"+$scope.filterClass])){$scope.safeApply($scope.loadData())}else{$scope["filterLoad"+$scope.filterClass]=$scope["urlLoad"+$scope.filterClass];$scope.safeApply($scope.preloadNextTab(noResults))}}else{$scope.safeApply($scope.loadData())}}}};$scope.preloadNextLightBox=function(noResults){$scope.pageLightBox+=1;if($scope.firstLoadLightBox){$scope.firstLoadLightBox=false;$scope.isLoading=true;$scope.safeApply($scope.loadDataLightBox2())}else{$scope.safeApply($scope.loadDataLightBox2())}};$scope.preloadNextWidget=function(widgetKey){$scope.pageWidget[widgetKey]+=1;if($scope.firstLoadWidget[widgetKey]){$scope.firstLoadWidget[widgetKey]=false;$scope.isLoading=true;$scope.safeApply($scope.loadDataWidget2(widgetKey))}else{$scope.safeApply($scope.loadDataWidget2(widgetKey))}};$scope.viewNext=function(){angular.forEach($scope.pagedItems,function(item){$scope.s
3afeApply(function(){if($scope.addSeparatorFromField){if($scope.addSeparatorFromField=="date"){if($scope.pagedItemsLoaded.length>1){var parentItem=$scope.items[$scope.pagedItemsLoaded.length-1];if(item.date.substring(0,10)!=$scope.pagedItemsLoaded[$scope.pagedItemsLoaded.length-1].date.substring(0,10)){$scope.pagedItemsLoaded.push({id:Math.random(),extraClass:"date",date:item.date})}}else{$scope.pagedItemsLoaded.push({id:Math.random(),extraClass:"date",date:item.date})}$scope.pagedItemsLoaded.push(item)}}else{$scope.pagedItemsLoaded.push(item)}})});$scope.preloader=true;$scope.safeApply($scope.preloadNextItems());if($scope.pagedItems.length==0){$scope.more=false;$scope.isLoading=false}};$scope.viewNextLightBox=function(){angular.forEach($scope.pagedLightBox,function(item){$scope.safeApply(function(){$scope.pagedLightBoxLoaded.push(item)})});$scope.preloader=true;$scope.safeApply($scope.preloadNextLightBox());if($scope.pagedLightBox.length==0){$scope.moreLightBox=false;$scope.isLoading=false}};$scope.viewNextWidget=function(widgetKey){angular.forEach($scope.pagedWidget[widgetKey],function(item){$scope.s
3afeApply(function(){$scope.pagedWidgetLoaded[widgetKey].push(item)})});$scope.safeApply($scope.preloadNextWidget(widgetKey));if($scope.pagedWidget[widgetKey].length==0){$scope.moreWidget[widgetKey]=false}};$scope.show_more=function(){if($scope.currentView=="search"){if($scope.eSearch.searchTotalPages>$scope.eSearch.searchPage){$scope.eSearch.searchPageFrom=$scope.itemsPerPage*$scope.eSearch.searchPage;$scope.eSearch.searchPage++;if($scope.advancedSearchParams){$scope.advancedSearchParams.page=$scope.eSearch.searchPageFrom;$scope.searchAdvanced($scope.advancedSearchParams)}else{$scope.searchES()}}return}$scope.viewNext()};$scope.show_moreLightBox=function(){$scope.viewNextLightBox()};$scope.show_moreWidget=function(key){$scope.viewNextWidget(key)};$scope.nextPage=function(){if($scope.currentPage<$scope.pagedItems.length-1){$scope.currentPage++}};$scope.show_more_Infinite=function(){$scope.page++;$scope.loadData()};$scope.has_more=function(){return $scope.more};$scope.has_moreLightBox=function(){return $scope.moreLightBox};$scope.has_moreWidget=function(key){return $scope.moreWidget[key]};$scope.countByFilter=function(){$scope.filteredTotal=$filter("filter")($scope.items,function(item){var x=false;if(!angular.isUndefined($scope.query)){angular.forEach($scope.searchFields,function(attr){if(searchMatch(item[attr],$scope.query)){x=true}})}else{x=true}return x});if(!angular.isUndefined($scope.filteredTotal)&&!angular.isUndefined($scope.filterDate)&&$scope.filterDate.length>0){$scope.filteredTotal=$filter("filter")($scope.filteredItems,function(item){if(searchDate(item.datefilter,$scope.filterDate)){return true}return false})}if(!angular.isUndefined($scope.filteredTotal)&&!angular.isUndefined($scope.filterDate2)&&$scope.filterDate2.length>0){$scope.filteredTotal=$filter("filter")($scope.filteredItems,function(item){if(searchDate(item.datefilter,$scope.filterDate2)){return true}return false})}if(!angular.isUndefined($scope.filteredTotal)&&!angular.isUndefined($scope.filterClass)&&$scope.filterClass.length>0){$scope.filteredTotal=$filter("filter")($scope.filteredTotal,function(item){if(searchContains(item.class,$scope.filterClass)){return true}return false})}if(!angular.isUndefined($scope.filteredTotal)&&!angular.isUndefined($scope.filterTag)&&$scope.filterTag.length>0){$scope.filteredTotal=$filter("filter")($scope.filteredTotal,function(item){if(searchContainsComma(item.tags,$scope.filterTag)){return true}return false})}if(!angular.isUndefined($scope.filteredTotal)&&!angular.isUndefined($scope.filterClass2)&&$scope.filterClass2.length>0){$scope.filteredTotal=$filter("filter")($scope.filteredTotal,function(item){if(searchContains(item.class2,$scope.filterClass2)){return true}return false})}if(!angular.isUndefined($scope.filteredTotal)&&!angular.isUndefined($scope.filterClass3)&&$scope.filterClass3.length>0){$scope.filteredTotal=$filter("filter")($scope.filteredTotal,function(item){if(searchContains(item.class3,$scope.filterClass3)){return true}return false})}};$scope.preloadNextTab=function(noResults){$scope.countByFilter();if(angular.isUndefined($scope["filterLoaded"+$scope.filterClass])){HttpService.getDataUrl($scope["filterLoad"+$scope.filterClass],"").then(function(response){$scope.safeApply(function(){$scope["filterLoaded"+$scope.filterClass]=true;if(response.data.length==$scope.filteredTotal.length){if(noResults){$scope.safeApply(function(){$scope.isLoading=false;$scope.isSuccessful=true;$scope.more=false;$scope.noresults=true})}else{$scope.safeApply(function(){$scope.more=false;$scope.isLoading=false})}}else{var i2=0;for(var i=0;i<response.data.length;i++){if(i2>=$scope.filteredTotal.length){if($scope.firstAction&&$scope.firstAction.substr(0,5)=="CLASS"){if(response.data[i].class==$scope.firstAction.substr(5)){$scope.items.push(response.data[i]);i2++}}else{$scope.items.push(response.data[i]);i2++}}else{i2++}}
3if($scope.filteredTotal.length<$scope.itemsPerPage){$scope.safeApply($scope.starter());$scope.search()}else{$scope.loadData()}}})})}};$scope.preloadNextTabTag=function(noResults){$scope.countByFilter();if(angular.isUndefined($scope["filterLoadedTag"+$scope.filterTag])){HttpService.getDataUrl($scope["filterLoadTag"+$scope.filterTag],"").then(function(response){$scope.safeApply(function(){$scope["filterLoadedTag"+$scope.filterTag]=true;if(response.data.length==$scope.filteredTotal.length){if(noResults){$scope.safeApply(function(){$scope.isLoading=false;$scope.isSuccessful=true;$scope.more=false;$scope.noresults=true})}else{$scope.safeApply(function(){$scope.more=false;$scope.isLoading=false})}}else{var i2=0;for(var i=0;i<response.data.length;i++){if(i2>=$scope.filteredTotal.length){if($scope.firstAction&&$scope.firstAction.substr(0,5)=="CLASS"){if(response.data[i].class==$scope.firstAction.substr(5)){$scope.items.push(response.data[i]);i2++}}else{$scope.items.push(response.data[i]);i2++}}}if($scope.filteredTotal.length<$scope.itemsPerPage){$scope.s
3afeApply($scope.starter());$scope.search()}else{$scope.loadData()}}})})}};$scope.setFilterDefault=function(filterData,urlAll){$scope.scrollTo($scope.scrollId,"");$scope.filterMain=true;$scope.filterTag=false;$scope.filterDate=false;$scope.filterDate2=false;$scope.filterClass=false;$scope.filterClass2=false;$scope.filterClass3=false;angular.element("#content-"+$scope.idData).fadeOut("fast",function(){$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).fadeIn("fast")});return false};$scope.setFilterClass=function(filterClass,urlAll,maintainTag){if(angular.element("#content-"+$scope.idData+"-tabs").length){angular.element("#content-"+$scope.idData+"-tabs .items-tab").fadeOut("fast")}$scope.filterMain=false;$scope.filterDate=false;$scope.filterDate2=false;if(!maintainTag){$scope.filterTag=false}$scope.filterClass=filterClass;$scope.filterClass2=false;$scope.filterClass3=false;if(!filterClass){$scope.showFilters()}else{$scope.hasFilter=true;if(CommonFactory.isMobile()){$scope.hideFilters()}}angular.element("#content-"+$scope.idData).fadeOut("fast",function(){if(urlAll){if(filterClass){$scope["urlLoad"+filterClass]=urlAll}}$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).fadeIn("fast")});$scope.scrollTo($scope.idData,"");return false};$scope.setFilterSearch=function(filterSearch,maintainFilters,maintainDate){if(filterSearch){$scope.query=filterSearch;$scope.hasFilter=true}else{delete $scope.query}$scope.filterMain=false;if(!maintainDate){$scope.filterDate=false}if(!maintainFilters){$scope.filterTag=false;$scope.filterClass=false;$scope.filterClass2=false;$scope.filterClass3=false}angular.element("#content-"+$scope.idData).fadeOut("fast",function(){$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).fadeIn("fast")});$scope.scrollTo($scope.idData,"");return false};$scope.setFilterAlways=function($event,filterAlways){var checkedbox=false;if($event){var checkbox=$event.target;checkedbox=checkbox.checked}else{var checkedbox=true}$scope.scrollTo($scope.scrollId,"");$scope.filterAlways=false;$scope.filterAlwaysField=false;if(checkedbox==true){var exp=filterAlways.split(",");$scope.filterAlwaysField=exp[2];if(typeof exp[3]!="undefined"&&exp[3]=="user"){if($rootScope.currentUser[exp[1]]){$scope.filterAlways=$rootScope.currentUser[exp[1]]}}else{$scope.filterAlways=exp[1]}}angular.element("#content-"+$scope.idData).fadeOut("fast",function(){$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).fadeIn("fast")});return false};$scope.setFilterTagByName=function(tagName,urlAll,maintainClass,slug,treeOpen){angular.forEach($scope.allFilters,function(tag){if(tag.name==tagName){$scope.closeMediaItem();$scope.setFilterTag(tag.id,urlAll,maintainClass,slug,treeOpen)}})};$scope.setFilterTag=function(filterTag,urlAll,maintainClass,slug,treeOpen){if(treeOpen){angular.forEach(treeOpen,function(itemId){$scope.filtersCollapse[itemId]=true})}if(angular.element("#content-"+$scope.idData+"-tabs").length){angular.element("#content-"+$scope.idData+"-tabs .items-tab").fadeOut("fast")}$scope.filterMain=false;$scope.filterDate=false;$scope.filterDate2=false;if(filterTag){$scope.filterTag=filterTag;$scope.hasFilter=true;if(CommonFactory.isMobile()){$scope.hideFilters()}}else{$scope.filterTag=false;$scope.showFilters()}if(!maintainClass){$scope.filterClass=false;$scope.filterClass2=false;$scope.filterClass3=false}if(slug){$location.hash(slug)}angular.element("#content-"+$scope.idData).fadeOut("fast",function(){if(urlAll){if(filterTag){$scope["urlLoadTag"+filterTag]=urlAll}}$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).fadeIn("fast")});$scope.scrollTo($scope.idData,"");return false};$scope.setFilterTab=function(tabName,showContent,filterContent,resetFilterTab){angular.element("#content-"+$scope.idData+"-tabs .items-tab").hide();angular.element("#content-"+$scope.idData).hide();if(resetFilterTab){$scope.setFilterTag("","",1)}if(showContent==1){if(!filterContent){$scope.setFilterClass("","",1);angular.element("#content-"+$scope.idData).fadeIn("fast")}else{$scope.setFilterClass(filterContent,"",1)}angular.element("#content-"+$scope.idData+"-no-results").fadeIn("fast")}if(angular.element("#content-"+$scope.idData+"-tabs .items-tab."+tabName).length){angular.element("#content-"+$scope.idData+"-tabs").fadeIn("fast");angular.element("#content-"+$scope.idData+"-tabs .items-tab."+tabName).fadeIn("fast")}$scope.scrollTo($scope.idData,"");$scope.hasFilter=true;return false};$scope.setFilterDate=function(filterDate,urlAll){$scope.filterMain=false;$scope.filterTag=false;$scope.filterDate=filterDate;$scope.filterDate2=$scope.filterDate2;$scope.filterClass=false;$scope.filterClass2=false;$scope.filterClass3=false;angular.element("#content-"+$scope.idData).fadeOut("fast",function(){if(urlAll){if(filterClass){$scope["urlLoad"+filterClass]=urlAll}$scope.countByFilter();if($scope.filteredTotal.length<$scope.itemsPerPage){$scope["filterLoad"+filterClass]=urlAll;$scope.preloadNextTab()}}$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).fadeIn("fast")});$scope.scrollTo($scope.idData,"");$scope.hasFilter=true;return false};$scope.setFilterDate2=function(filterDate2,urlAll){$scope.filterMain=false;$scope.filterTag=false;$scope.filterDate=$scope.filterDate;$scope.filterDate2=filterDate2;$scope.filterClass=false;$scope.filterClass2=false;$scope.filterClass3=false;angular.element("#content-"+$scope.idData).fadeOut("fast",function(){if(urlAll){if(filterClass){$scope["urlLoad"+filterClass]=urlAll}$scope.countByFilter();if($scope.filteredTotal.length<$scope.itemsPerPage){$scope["filterLoad"+filterClass]=urlAll;$scope.preloadNextTab()}}$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).fadeIn("fast")});$scope.scrollTo($scope.idData,"");$scope.hasFilter=true;return false};$scope.setFilterDateNow=function($event,filterDateNow,force){var checkedbox=false;if($event){var checkbox=$event.target;if($scope.firstAction&&$scope.firstAction=="DATENOW"){if(checkbox.checked){checkedbox=false}else{checkedbox=true}}else{checkedbox=checkbox.checked}}else{var checkedbox=true}$scope.scrollTo($scope.scrollId,"");$scope.filterMain=false;$scope.filterDateAlways=false;if(checkedbox==true){$scope.filterDateAlways=filterDateNow}angular.element("#content-"+$scope.idData).fadeOut("fast",function(){$scope.s
3afeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).fadeIn("fast")});return false};$scope.scrollTo=function(dataslide,plus,newSpeed,newScroll){var speed=500;if(newSpeed!=undefined){speed=newSpeed}var id=dataslide||$scope.idData;var $el=$("#"+id);if(!$el.length)return;var computedScroll=$el.offset().top-$("header").height()*2;var useOverride=newScroll!==undefined&&newScroll!==null;if(useOverride){if(newScroll===0){var elemTop=$el.offset().top;var tolerance=2;if(elemTop<=tolerance){computedScroll=0}}else{computedScroll=newScroll}}if(computedScroll<0)computedScroll=0;$timeout(function(){angular.element("html,body").stop(true).animate({scrollTop:computedScroll},speed)})};$scope.show_plus=function(item){if(angular.isUndefined(item.show_plus)){item.show_plus=true}else if(item.show_plus==true){item.show_plus=false}else{item.show_plus=true}};$scope.show_hide_text=function(item){if(angular.isUndefined(item.show_text)){item.show_text=true}else if(item.show_text==true){item.show_text=false}else{item.show_text=true}};$scope.get_plus_icon=function(item){var icon="icon-plus";if(!angular.isUndefined(item.show_plus)&&item.show_plus==true){icon="icon-minus"}return icon};$scope.groupFilter=function(item){var itemIndex=$scope.pagedItemsLoaded.indexOf(item);var ok=false;angular.forEach($scope.groupFilters,function(el,key){if(el[0]-1==itemIndex){item.groupItemNumber=key+1;item.idx=itemIndex;ok=item}});return ok};$scope.setSearch=function(maintainFilters,maintainDate,clearFilters){if(!maintainFilters&&!maintainDate){$scope.clearFilters()}var elm=angular.element(event.srcElement);if(event.keyCode==13){$scope.setFilterSearch(elm[0].value,maintainFilters,maintainDate)}else{setTimeout(function(){if(elm[0].value.length<1){setTimeout(function(){$scope.setFilterSearch("",maintainFilters,maintainDate)},300)}else if(elm[0].value.length>2&&elm[0].value!=$scope.query){setTimeout(function(){$scope.setFilterSearch(elm[0].value,maintainFilters,maintainDate)},300)}},200)}};$scope.setDateFrom=function(newDate){if(newDate){var dateNew=newDate.toISOString().substring(0,10);$scope.setFilterDate(">=,"+dateNew)}};$scope.setDateTo=function(newDate){if(newDate){var dateNew=newDate.toISOString().substring(0,10);$scope.setFilterDate2("<=,"+dateNew)}};$scope.clearFilters=function(all){$scope.eSearchClean();angular.element("#content-"+$scope.idData+"-tabs .items-tab").hide();$scope.dateFrom.value="";$scope.dateTo.value="";$(".filters-select").removeClass("active");$(".filters-input").val("");$(".filters-default").addClass("active");if(all){$(".filter-input-search").val("");$scope.setFilterSearch("")}$scope.hasFilter=false};$scope.showGroupByIndex=function(groupItem,item){};$scope.groupFilterItems=function(item){var returnItems=[];var idxFrom="";var idxTo="";var itemIndex=$scope.pagedItemsLoaded.indexOf(item);angular.forEach($scope.groupFilters,function(el){if(el[0]-1==itemIndex){idxFrom=itemIndex+1;idxTo=el[1]}});if(idxFrom&&idxTo){var ix=1;angular.forEach($scope.items,function(item,idx){if(idx+1>=idxFrom&&idx+1<=idxTo){item.itemNumber=ix;ix++;returnItems.push(item)}})}return returnItems};$scope.getIndex=function(item){return $scope.pagedItemsLoaded.indexOf(item)};$scope.openMediaItemInOverlay=function(item,overlayName){$("#"+overlayName+" .item-info-icon i").removeAttr("class").attr("class","");$("#"+overlayName+" .item-info-icon i").addClass("UIcon");$("#"+overlayName+" .item-info-icon i").addClass("UIcon-"+item.media_type);$("#"+overlayName+" .md-item-title").html(item.title);$("#"+overlayName+" .md-item-info").removeAttr("class").attr("class","").addClass("md-item-info");$("#"+overlayName+" .md-item-info").addClass("file-"+item.extension);$("#"+overlayName+" .item-info-type").html(item.extension);$("#"+overlayName+" .item-info-size").html(item.filesize);if(item.class==1){$("#"+overlayName+" .md-preview-media").html('<img src="'+item.media.thumb+'" class="item-img">')}else if(item.class==2){if(item.media.embed){var mediaFile=item.media.embed}else{var mediaFile=item.media.source}if(mediaFile.substr(-3,3)=="mp4"){$("#"+overlayName+" .md-preview-media").html('<video width="100%" controls controlsList="nodownload"> <source src="'+mediaFile+'" type="video/mp4"></video>')}
3else{$("#"+overlayName+" .md-preview-media").html('<iframe width="100%" height="100%" src="'+mediaFile+'"> </iframe>')}}$("#"+overlayName+" .md-preview-link a").attr("href",item.media.source);$rootScope.$on("site:modal-close-preview",function(){$timeout(function(){$("#modal-preview .md-preview-media").html("")},0)});$rootScope.openModal(overlayName,"","","preview")};$scope.destroy=function(id,reload){$("#"+id).removeClass("md-show");$("#"+id+" .md-preview-media").html("");$timeout(function(){$scope.safeApply(function(){initVars()})},0);if(reload){$window.location.reload()}};$scope.dateFromOpen=function(){if(!$scope.dateFrom.watched){$scope.$watch("dateFrom.value",function(newDate){$scope.dateFrom.watched=true;$scope.setDateFrom(newDate)})}$scope.dateFrom.opened=true};$scope.dateToOpen=function(){if(!$scope.dateTo.watched){$scope.$watch("dateTo.value",function(newDate){$scope.dateTo.watched=true;$scope.setDateTo(newDate)})}$scope.dateTo.opened=true};$scope.imgBackgroundOverlay=function(item){var returnArray={};var returnImg="";if(!angular.isUndefined(item.extraClass)){if(searchContains(item.extraClass,"overlay")||searchContains(item.extraClass,"large")||angular.element("#angular-news").hasClass("galleries")){if(CommonFactory.isMobile()){returnImg=item.mediaMobile}else{if(searchContains(item.extraClass,"large")||angular.element("#angular-news").hasClass("galleries")){returnImg=item.media}else{returnImg=item.mediaExtra}}}}if(returnImg){returnArray={"background-image":"url("+returnImg+")"}}return returnArray};$scope.showHideFilters=function(){angular.element("body").toggleClass("hidden-related");angular.element(".show-hide-filters").toggleClass("open");return false};$scope.showFilters=function(){angular.element("body").removeClass("hidden-related");angular.element(".show-hide-filters").removeClass("open");return false};$scope.hideFilters=function(){angular.element("body").addClass("hidden-related");angular.element(".show-hide-filters").addClass("open");return false};$scope.showEvents=function(){$rootScope.currentEvent="";$scope.currentItem=undefined;$location.hash("");$scope.showFilters();return false};$scope.isFiltered=function(itemId){if(!angular.isUndefined($scope.filtersCollapse[itemId])&&$scope.filtersCollapse[itemId]){return true}else{return false}};$scope.toggleCollapse=function(itemId){if(!angular.isUndefined($scope.filtersCollapse[itemId])&&$scope.filtersCollapse[itemId]){$scope.filtersCollapse[itemId]=false}else{$scope.filtersCollapse[itemId]=true}};$scope.toggleFilterColumn=function(){$scope.lightboxShowing=false;if(!$scope.filtersShowing){angular.element("body").removeClass("hidden-related")}else{angular.element("body").addClass("hidden-related")}$scope.filtersShowing=!$scope.filtersShowing};$scope.toggleLightbox=function(){if(!$scope.lightboxShowing){angular.element("body").removeClass("hidden-related")}else{angular.element("body").addClass("hidden-related")}$scope.filtersShowing=false;$scope.lightboxShowing=!$scope.lightboxShowing};$scope.remoteApiRequest=function(url,item){return HttpService.getDataUrl(url).then(function(response){if(!response.data.success){console.log("Error getting remote api item",response.data.payload);return Promise.reject()}if(response.data.payload.proxy){let nameParts=[];if(response.data.payload.mediaWidth&&response.data.payload.mediaHeight){nameParts.push(response.data.payload.mediaWidth+" x "+response.data.payload.mediaHeight)}nameParts.push("mp4");let name=nameParts.join(" / ");item.media.source=response.data.payload.proxy;let previewFormat={id:"preview",name:name,description:"Preview",width:"",height:"",size:response.data.payload.proxySize/1024,url:response.data.payload.proxy};$scope.downloadOptionsShow.push(previewFormat)}if(response.data.payload.highRes){let name="";let nameParts=[];if(response.data.payload.mediaWidth&&response.data.payload.mediaHeight){nameParts.push(response.data.payload.mediaWidth+" x "+response.data.payload.mediaHeight)}if(response.data.payload.mediaType){nameParts.push(response.data.payload.mediaType.split("/").pop())}if(nameParts.length>0){name=nameParts.join(" / ")}let originalFormat={id:"original",name:name,description:"Original",width:"",height:"",size:response.data.payload.mediaSize/1024,url:response.data.payload.highRes};$scope.downloadOptionsShow.push(originalFormat)}if(response.data.payload.ffprobeOutputUrl){console.log("ffprobeOutputUrl",response.data.payload.ffprobeOutputUrl)}if(response.data.payload.transcodingState){item.transcodingState=response.data.payload.transcodingState}if(response.data.payload.liveRecording&&$scope.downloadOptionsShow.length==0&&response.data.payload.transcodingState!="progressing"&&response.data.payload.transcodingState!="initiated"){item.unavailableLiveStream=true}if(response.data.payload.mediaWidth&&response.data.payload.mediaHeight&&response.data.payload.mediaWidth<response.data.payload.mediaHeight){$scope.mediaVertical=true}else{$scope.mediaVertical=false}if(response.data.payload.metadata&&response.data.payload.metadata.formData){if(response.data.payload.metadata.formData.Ke
3ywords){item.tags=response.data.payload.metadata.formData.Keywords}if(response.data.payload.metadata.formData.Copyright){item.photographer=response.data.payload.metadata.formData.Copyright}if(response.data.payload.metadata.formData.Description){item.description=response.data.payload.metadata.formData.Description}}return Promise.resolve()})};$scope.openMediaItem=function(item){let promise=Promise.resolve();if(item.is_external&&$scope.isExternalGallery&&$scope.individualMimirItemUrl){$scope.downloadOptionsShow=[];let url=$scope.individualMimirItemUrl+"?id_item="+item.id;promise=$scope.remoteApiRequest(url,item)}else if($scope.globalMimirItemUrl){$scope.downloadOptionsShow=[];let url=$scope.globalMimirItemUrl+"?id_item="+item.id;promise=$scope.remoteApiRequest(url,item)}promise.then(function(){$scope.previewScroll=window.scrollY;if(!angular.isUndefined(item.url)&&item.url){window.location.href=item.url;return}if(window.location.hostname==="mediahub.americascup.com"&&(window.location.pathname.indexOf("home")>=0||window.location.pathname=="/")&&$scope.globalMimirItemUrl){window.location.href="/video#id="+item.id;return}if($scope.directDownload){$scope.downloadMedia(item,{id:"original"});return}$scope.previewItem=angular.copy($scope.currentItem);$scope.isPDF=false;$scope.showTrimVideo=false;var hashParams=$scope.getHashParams();if(!angular.isUndefined(hashParams.tags)){delete hashParams.tags}if(item.extension=="pdf"){$scope.currentFile=$sce.trustAsResourceUrl(item.media.source);$scope.isPDF=true}if(!angular.isUndefined(item.type)){if(item.type=="tags"){hashParams.tags=item.tags;$scope.setHashParams(hashParams);$scope.tagESearch(item.tags);return}}if(!angular.isUndefined(item.tags)&&typeof item.tags=="string"&&item.tags.length>0&&$scope.allTags){item.tagsArray=[];var itemTags=item.tags.split(",");angular.forEach(itemTags,function(t){var tagAdd=$filter("filter")($scope.allTags,{id_tag:t},true);if(tagAdd.length>0){item.tagsArray.push(tagAdd[0].tag_name)}else if(item.is_external&&typeof t==="string"){item.tagsArray.push(t.trim())}})}$scope.currentItem=item;angular.element(".main-view").addClass("hidden");angular.element(".lightbox-view").addClass("hidden");angular.element(".details-view").removeClass("hidden");hashParams.id=item.id;$scope.setHashParams(hashParams);if(!$scope.globalMimirItemUrl&&!($scope.isExternalGallery&&$scope.individualMimirItemUrl&&item.is_external)){$scope.getMediaDownloadOptions(item)}$scope.setVideoConfig(item);$scope.scrollTo($scope.idData,"");$scope.changeView("media");$scope.resizeVideoYt();$analytics.eventTrack("item-preview",{category:$scope.idData,label:"#"+item.id+" - "+item.title})})};$scope.formatFileSize=function(fileSizeInKiloBytes){if(fileSizeInKiloBytes<1024*1024){return(fileSizeInKiloBytes/1024).toFixed(1)+" MB"}else{return(fileSizeInKiloBytes/(1024*1024)).toFixed(1)+" GB"}};$scope.closeMediaItem=function(){if($scope.previewItem){$scope.openMediaItem($scope.previewItem);$scope.previewItem="";return}$scope.previewItem="";if($scope.currentView=="media"){$scope.changeView()}angular.element(".details-view").addClass("hidden");if($scope.currentLightBox){angular.element(".lightbox-view").removeClass("hidden")}else{angular.element(".main-view").removeClass("hidden")}$scope.selectLightBox=undefined;var hashParams=$scope.getHashParams();delete hashParams.id;$scope.setHashParams(hashParams);$scope.currentItem=undefined;if($scope.previewScroll){angular.element("html,body").animate({scrollTop:$scope.previewScroll},500)}$scope.previewScroll=0};$scope.showLightBox=function(item){$scope.model.lightBoxName="";if(item){$scope.currentItem=item}$scope.lightboxNew=false;$rootScope.openModal("modal-lightbox")};$scope.openNewLightbox=function(continueAdd){$scope.lightboxContinue=continueAdd;$rootScope.openModal("modal-lightbox-create")};$scope.openNewLightboxNew=function(){$scope.lightboxNew=true;$scope.lightboxContinue=false};$scope.openNewLightboxNewModal=function(continueAdd){$scope.lightboxContinue=continueAdd;$scope.lightboxNew=true};$scope.closeNewLightboxNew=function(){$scope.lightboxNew=false;$scope.model.lightBoxName=""};$scope.createLightBoxNew=function(){$scope.lightboxError=false;if($scope.model.lightBoxName.length>1){$http.post($scope.actionsUrl,{action:"NewLightBox",name:$scope.model.lightBoxName}).success(function(data,status,headers,config){if($scope.lightboxContinue){var lightBoxData={id:data.id,data:[]};$scope.addToLightBox(lightBoxData);$scope.getLightBox()}$scope.getLightBox();$scope.model.lightBoxName="";$scope.lightboxNew=false}).error(function(data,status,headers,config){})}else{$scope.lightboxError=true}};$scope.createLightBox=function(){$scope.lightboxError=false;if($scope.model.lightBoxName.length>1){$http.post($scope.actionsUrl,{action:"NewLightBox",name:$scope.model.lightBoxName}).success(function(data,status,headers,config){if($scope.lightboxContinue){var lightBoxData={id:data.id,data:[]};$scope.addToLightBox(lightBoxData);$rootScope.openModal("modal-lightbox");$scope.getLightBox()}$scope.model.lightBoxName="";$scope.lightboxNew=false}).error(function(data,status,headers,config){})}else{$scope.lightboxError=true}};$scope.checkMediaInLightBox=function(lightBox,mediaId){var ret="";var hasMedia=false;if(!mediaId){if($scope.currentItem){var mediaId=$scope.currentItem.id}}
3if(mediaId){angular.forEach(lightBox.data,function(i){if(!hasMedia){if(i.id==mediaId){hasMedia=true}}});if(hasMedia){ret="active"}}return ret};$scope.checkMediaInLightBoxes=function(item){var ret="";var hasMedia=false;angular.forEach($scope.lightBoxes,function(lightBox){if(!hasMedia){if(lightBox.owner){angular.forEach(lightBox.data,function(i){if(!hasMedia){if(item){if(i.id==item.id){hasMedia=true}}else{if(i.id==$scope.currentItem.id){hasMedia=true}}}})}}});if(hasMedia){ret="active"}return ret};$scope.getLightBox=function(){if(!$scope.noFavorites){$http.post($scope.actionsUrl,{action:"LightBox"}).success(function(data,status,headers,config){$scope.lightBoxes=data;if($scope.currentLightBox){angular.forEach($scope.lightBoxes,function(item){if($scope.currentLightBox.id==item.id){$timeout(function(){$scope.initLightBox(item,$scope.pageLightBox)})}})}if($scope.editLightBox){$scope.editLightBox=false}}).error(function(data,status,headers,config){if($scope.editLightBox){$scope.editLightBox=false}})}};$scope.openLightBox=function(item){$scope.selection=[];$scope.changeView("lightBox");$scope.initLightBox(item);$scope.scrollTo($scope.idData,"")};$scope.addToLightBox=function(item){$scope.editLightBox=true;if($scope.selection.length>0){return $scope.addToLightBoxBatch(item)}if($scope.currentItem){if(!$scope.checkMediaInLightBox(item)){item.data.push($scope.currentItem);$http.post($scope.actionsUrl,{action:"UpdateLightBox",id:item.id,data:item.data,media:$scope.currentItem.id}).success(function(data,status,headers,config){$scope.getLightBox()}).error(function(data,status,headers,config){$scope.editLightBox=false;console.log("ERR",data)})}else{console.log("already in lightbox")}}else{console.log("empty lightbox created")}};$scope.copyToMyLightboxes=function(lightbox){var copyParams={action:"CopyToMyLightboxes",name:lightbox.name,media:lightbox.data.map(x=>{return x.id})};$http.post($scope.actionsUrl,copyParams).success(function(data,status,headers,config){$scope.getLightBox()}).error(function(data,status,headers,config){})};$scope.shareLightBox=function(item,idUserGroup,groupStatus){$scope.lightboxToShare=item;$scope.groupInfo={idUserGroup:idUserGroup,groupStatus:groupStatus};if($scope.shareResults){$scope.shareResults=""}$rootScope.openModal("modal-lightbox-share")};$scope.sendShareLightBox=function(shareEmails){var mailsArr=[];mailsArr=shareEmails.split(",");$http.post($scope.actionsUrl,{action:"ShareLightBox",lightboxID:$scope.lightboxToShare.id,emailUsers:mailsArr,id_user_group:$scope.groupInfo.idUserGroup,status:$scope.groupInfo.groupStatus}).success(function(data,status,headers,config){var correctUsers=mailsArr;angular.forEach(data.invalidUsers,function(user){correctUsers=correctUsers.filter(item=>item!==user)});angular.forEach(data.notRegistered,function(user){correctUsers=correctUsers.filter(item=>item!==user)});angular.forEach(data.alreadyIn,function(user){correctUsers=correctUsers.filter(item=>item!==user)});data.correctUsers=correctUsers;$scope.shareResults=data;$scope.lightBoxes.map(x=>{if(x.id==$scope.lightboxToShare.id){x.users=x.users.concat(correctUsers)}return x})}).error(function(data,status,headers,config){console.error(data,status)});shareEmails=""};$scope.deleteUserToShare=function(userToDelete){$http.post($scope.actionsUrl,{action:"DeleteUserToShare",lightboxID:$scope.lightboxToShare.id,deletedUser:userToDelete}).success(function(data,status,headers,config){$scope.lightboxToShare.users=$scope.lightboxToShare.users.filter(item=>item!==userToDelete);$scope.lightBoxes.map(x=>{if(x.id==$scope.lightboxToShare.id){x.users=x.users.filter(item=>item!==userToDelete)}return x});if($scope.shareResults&&$scope.shareResults.correctUsers){$scope.shareResults.correctUsers=$scope.shareResults.correctUsers.filter(item=>item!==userToDelete)}}).error(function(data,status,headers,config){console.log("ERR",data)})};$scope.showSharedUsers=function(){$rootScope.openModal("modal-shared-users")};$scope.startEditLightBox=function(item){item.editing=true;$scope.editLightBoxName=item.name};$scope.saveEditLightbox=function(item){item.editing=false;$http.post($scope.actionsUrl,{action:"EditNameLightBox",name:item.name,id:item.id}).success(function(data,status,headers,config){}).error(function(data,status,headers,config){})};$scope.cancelEditLightbox=function(item){item.editing=false;item.name=$scope.editLightBoxName};$scope.openModalDeleteLightBox=function(item){$scope.itemToDelete=item;$rootScope.openModal("modal-lightbox-delete")};$scope.deleteLightBox=function(){$http.post($scope.actionsUrl,{action:"DeleteLightBox",id:$scope.itemToDelete.id}).success(function(data,status,headers,config){for(var i=0;i<$scope.lightBoxes;i++){if($scope.lightBoxes[i].id==$scope.itemToDelete.id){$scope.lightBoxes.splice(i,1)}}$scope.getLightBox()}).error(function(data,status,headers,config){console.log("ERR",data)});$scope.closeModalData("modal-lightbox-delete")};$rootScope.$on("site:modal-close-modal-lightbox",function(){$scope.checkMediaLightBoxesUpdated={}});$scope.addToLightBoxBatch=function(item){var mediaBatch=[];angular.forEach($scope.selection,function(media){if(!$scope.checkMediaInLightBox(item,media)){switch($scope.currentView){case"lightBox":var mediaData=$filter("filter")($scope.pagedLightBoxLoaded,{id:media},true);break;case"search":var mediaData=$filter("filter")($scope.eSearch.searchResults,{id:media},true);break;default:var mediaData=$filter("filter")($scope.pagedItemsLoaded,{id:media},true);break}if(mediaData.length){mediaBatch.push(media);item.data.push(mediaData[0])}}});$http.post($scope.actionsUrl,{action:"UpdateLightBoxBatch",id:item.id,data:item.data,mediaBatch:mediaBatch}).success(function(data,status,headers,config){$scope.getLightBox();if(angular.isUndefined($scope.checkMediaLightBoxesUpdated[item.id])){$scope.checkMediaLightBoxesUpdated[item.id]=false}$scope.checkMediaLightBoxesUpdated[item.id]=!$scope.checkMediaLightBoxesUpdated[item.id]}).error(function(data,status,headers,config){console.log("ERR",data)})};$scope.removeFromLightBox=function(item){$scope.editLightBox=true;if(angular.isUndefined($scope.currentItem)){return}$http.post($scope.actionsUrl,{action:"UpdateLightBox",id:item.id,media:$scope.currentItem.id,remove:true}).success(function(data,status,headers,config){$scope.getLightBox()}).error(function(data,status,headers,config){$scope.editLightBox=false;console.log("ERR",data)})};$scope.getMediaDownloadOptions=function(item){if(item.class==1){$scope.downloadOptionsShow=$scope.downloadOptions}else{$http.post($scope.actionsUrl,{action:"DownloadOptions",id:item.id,restrictions:$scope.mediacenterRestrictions||[]}).success(function(data,status,headers,config){$scope.downloadOptionsShow=data}).error(function(data,status,headers,config){})}};
3$scope.downloadMedia=function(item,crop,modalId,_skipTerms){if(!_skipTerms&&$scope.termsAndConditionsAtDownload){$scope.downloadTermsAccepted=false;$scope.pendingDownload={item:item,crop:crop};$rootScope.openModalClass(modalId);setTimeout(function(){var modalEl=document.getElementById(modalId);if(!modalEl)return;var confirmBtn=modalEl.querySelector("#download-terms-confirm");if(!confirmBtn)return;confirmBtn.onclick=null;confirmBtn.onclick=function(){if(confirmBtn.disabled)return;$rootScope.closeModal(modalId);$scope.$applyAsync(function(){var pd=$scope.pendingDownload||{item:item,crop:crop};$scope.downloadMedia(pd.item,pd.crop,modalId,true)})}},0);return}if($scope.globalMimirItemUrl||$scope.individualMimirItemUrl&&$scope.isExternalGallery&&item.is_external){if(item.class===4){for(let i=0;i<$scope.downloadOptionsShow.length;i++){const crop=$scope.downloadOptionsShow[i];if(crop.id=="original"){$scope.fileURL=crop.url;$window.location.href=crop.url;item.downloadData.loading[crop.id]=true}}}else{$scope.fileURL=crop.url;$window.location.href=crop.url;item.downloadData.loading[crop.id]=true}delete item.downloadData.loading[crop.id];$analytics.eventTrack("item-download",{category:$scope.idData,label:"#"+item.id+" - "+item.title+" (crop #"+crop.id+")"});return}if(angular.isUndefined(item.downloadData)||angular.isUndefined(item.downloadData.loading[crop.id])&&angular.isUndefined(item.downloadData.error[crop.id])){var params={action:"Download",id:item.id};if(downloadLimitMax&&downloadLimitUserGroup){params.config={"Download Limit Max":downloadLimitMax,"Download Limit User Group":downloadLimitUserGroup}}if(crop){params.crop=crop.id}if(angular.isUndefined(item.downloadData)){item.downloadData={loading:{},error:{}}}item.downloadData.loading[crop.id]=true;$http.post($scope.actionsUrl,params).success(function(data,status,headers,config){if(data.success==true){$scope.fileURL=data.signedUrl;$window.location.href=data.signedUrl;item.downloadData.loading[crop.id]=true;delete item.downloadData.loading[crop.id];$analytics.eventTrack("item-download",{category:$scope.idData,label:"#"+item.id+" - "+item.title+" (crop #"+crop.id+")"})}else if(!angular.isUndefined(data.payload.modal)&&data.payload.modal==true){if(!angular.isUndefined(data.payload.confirmAction)){$rootScope.openModalClass("modal-cancel-confirm",2,"Archive","","",$translate.instant(data.payload.message),"");let modal=document.getElementById("modal-cancel-confirm");if(modal){let confirm=modal.querySelector("#confirmButton");let cancel=modal.querySelector("#cancelButton");if(angular.isUndefined(data.payload.data.mediaId)){data.payload.data.mediaId=item.id}confirm.onclick=function(){$scope[data.payload.confirmAction](data.payload.data)};cancel.onclick=function(){$rootScope.closeModal("modal-cancel-confirm")}}}else{$rootScope.openModalClass("modal-messages",2,"","","",data.payload.message)}if(!angular.isUndefined(data.payload.available)){$scope.downloadOptionsShow=data.payload.available}delete item.downloadData.loading[crop.id]}else{item.downloadData.error[crop.id]=true;delete item.downloadData.loading[crop.id]}}).error(function(data,status,headers,config){item.downloadData.error[crop.id]=true;delete item.downloadData.loading[crop.id]})}};$scope.callToArchive=function(data){if(data){let url="https://eo9f0q15jj.execute-api.eu-central-1.amazonaws.com/prd/restore_file";let filename=data.fileName;let id=data.mediaId;switch(data.mediaType){case"1":filename=`images/m${id}_${filename}`;break;case"2":filename=`videos/m${id}_${filename}`;break}let params={file_name:filename,user_id:parseInt(data.userId),link:window.location.href};$http.put(url,params).success(function(data){$rootScope.closeModal("modal-cancel-confirm");$rootScope.openModalClass("modal-messages",2,"","","",$translate.instant("archive-restore-successful"))}).error(function(error){$rootScope.closeModal("modal-cancel-confirm");console.error("Archive error:",error)})}};$scope.setVideoConfig=function(item){if($scope.currentItem.class==2){var videoSource=[{src:$scope.currentItem.media.source,type:"video/mp4"}];$scope.configvideo={preload:"none",autoPlay:false,sources:videoSource,plugins:{controls:{autoHide:true,autoHideTime:5e3}}}}};$scope.searchES=function(idMedia){delete $scope.advancedSearchParams;if($scope.eSearch.searchParam.length>=2||$scope.eSearch.searchTag.length>0){$scope.selection=[];$scope.changeView("search");if(!idMedia){$scope.closeMediaItem()}if(!idMedia&&$scope.eSearch.currentOptions!="inGallery"){$scope.currentGallery=$scope.allGalleries[0];var hashParams=$scope.getHashParams();delete hashParams.gallery;$scope.setHashParams(hashParams)}$scope.eSearch.searched=true;if(angular.isArray($scope.allGalleries)&&$scope.allGalleries.length>0){var galleriesToSearch=$scope.allGalleries.map(x=>{return x.id})}else if(angular.isArray($scope.widgets)&&$scope.widgets.length>0){}var searchParams={action:"search",g:$scope.eSearch.currentOptions=="inGallery"?$scope.currentGallery.id:galleriesToSearch,page:$scope.eSearch.searchPageFrom,size:$scope.itemsPerPage};
3if($scope.useTagShouldSearch){searchParams.tagShould=$scope.eSearch.searchTag}else{searchParams.t=$scope.eSearch.searchTag}if(idMedia){searchParams.id="m_"+idMedia}else{searchParams.q=$scope.eSearch.searchParam;searchParams.key=$scope.eSearch.searchKey}if($scope.selectedFilter){searchParams.type=$scope.selectedFilter}$scope.isLoading=true;$scope.eSearch.searchNoResults=false;$http.post($scope.actionsUrl,searchParams).success(function(resp){console.log("resp",resp);let totalHits=resp.hits.total.hasOwnProperty("value")?resp.hits.total.value:resp.hits.total;if(totalHits>0){$scope.eSearch.searchTotalResults=totalHits;$scope.eSearch.searchTotalPages=Math.ceil(totalHits/$scope.itemsPerPage);if($scope.eSearch.searchPage==1){$scope.eSearch.searchResults=[];if(totalHits>$scope.itemsPerPage){$scope.more=true;$scope.eventSelected=true}else{$scope.more=false}}angular.forEach(resp.hits.hits,function(item){var mediaData=angular.fromJson(item._source.jsonData);var fileExt="";if(mediaData.filename){var fileSplit=mediaData.filename.split(".");if(fileSplit.length>1){fileExt=fileSplit[fileSplit.length-1]}}var newItem={title:item._source.title?item._source.title:mediaData.filename,title2:"",extraClass:mediaData.media_type,class:mediaData.media_type,datefilter:item._source.date,description:item._source.description,extension:fileExt,fileSize:mediaData.fileSize,id:mediaData.id,media:{source:$scope.constructMediaUrl(item._source.url_preview?item._source.url_preview:item._source.url),thumb:$scope.constructMediaUrl(item._source.media_lo?item._source.media_lo:item._source.media_med),view:$scope.constructMediaUrl(item._source.media_med)},media_type:item._source.type,tags:"",top_type:"",tagsArray:item._source.tags,photographer:mediaData.photographer,owner:mediaData.owner,galleries:mediaData.galleries,duration:mediaData.duration,is_external:item._source.is_external};$scope.eSearch.searchResults.push(newItem)});if($scope.eSearch.searchResults.length==totalHits){$scope.more=false}}else{$scope.eSearch.searchResults=[];$scope.eSearch.searchTotalResults=0}if($scope.eSearch.searchPage==1){$scope.scrollTo($scope.scrollId,"")}if(idMedia){angular.forEach($scope.eSearch.searchResults,function(item){if(item.id==$scope.currentItemId){$scope.currentItemId="";$scope.openMediaItem(item)}})}$scope.isLoading=false}).error(function(response){console.log("ERR",response);$scope.isLoading=false})}};$scope.constructMediaUrl=function(url){let ret=url;if(ret.includes("fiaformulae-media.s3.amazonaws")){ret=ret.replace("fiaformulae-media.s3.amazonaws","mediacdn.fiaformulae")}return ret};$scope.setESearch=function(event,click){$scope.eSearch.searchPage=1;$scope.eSearch.searchPageFrom=0;$scope.eSearch.searchTag=[];if(event.keyCode==13||click){$scope.eSearch.searchParam=$scope.eSearch.query;$scope.searchES()}else{}};$scope.toggleSearch=function(){$scope.eSearch.showBox=$scope.eSearch.showBox?false:true};$scope.tagESearch=function(tag){$scope.eSearch.searchPage=1;$scope.eSearch.searchPageFrom=0;$scope.eSearch.searchParam="";var tagSplit=tag.split(",");if(tagSplit.length>1){$scope.eSearch.searchTag=tagSplit}else{$scope.eSearch.searchTag=[];$scope.eSearch.searchTag.push(tag)}$scope.searchES()};$scope.eSearchClean=function(){$scope.selection=[];$scope.eSearch.searchResults=[];$scope.eSearch.searchTag="";$scope.eSearch.searchParam="";$scope.eSearch.query="";$scope.eSearch.currentOptions="";$scope.eSearch.searched=false;if($scope.currentView=="search"){$scope.changeView()}};$scope.downloadItems=function(){var width=0;var crop=undefined;angular.forEach($scope.downloadOptions,function(x){if(x.width>width){crop=x}});$scope.selectionTotalSize=0;switch($scope.currentView){case"lightBox":angular.forEach($scope.pagedLightBoxLoaded,function(item){if($scope.selection.indexOf(item.id)!=-1){$scope.selectionTotalSize+=item.fileSize*1}});$scope.selectionTotalSize=Math.round($scope.selectionTotalSize/1024);break;case"search":angular.forEach($scope.eSearch.searchResults,function(item){if($scope.selection.indexOf(item.id)!=-1){$scope.selectionTotalSize+=item.fileSize*1}});$scope.selectionTotalSize=Math.round($scope.selectionTotalSize/1024);break;default:angular.forEach($scope.pagedItemsLoaded,function(item){if($scope.selection.indexOf(item.id)!=-1){$scope.selectionTotalSize+=item.fileSize*1}});$scope.selectionTotalSize=Math.round($scope.selectionTotalSize/1024);break}$scope.sendTo.recipients=[];if($rootScope.currentUser.isAccountAuthenticated){$scope.sendTo.recipients.push($rootScope.currentUser.email)}if($scope.selection.length==1){$("body").append(`\n <div id="download-toast-event" style="position: fixed; bottom: 15px; width: 100%; display: flex; z-index: 9999999; justify-content: center;">\n <p style="background-color: green; padding: 5px 20px; border-radius: 100px; color: #fff; font-size: 20px;">Your download is in process. It can take a few minutes to complete.</p>\n </div>\n `)}else{$("body").append(`\n <div id="download-toast-event" style="position: fixed; bottom: 15px; width: 100%; display: flex; z-index: 9999999; justify-content: center;">\n <p style="background-color: green; padding: 5px 20px; border-radius: 100px; color: #fff; font-size: 20px;">Your download is in process. It can take a few minutes to complete. Please note that you need to allow multiple downloads on your browser.</p>\n </div>\n `)}setTimeout(()=>{$("#download-toast-event").remove()},5e3);angular.forEach($scope.selection,function(item,index){setTimeout(()=>{switch($scope.currentView){case"lightbox":case"lightBox":var itemToSend=$scope.pagedLightBoxLoaded.find(x=>x.id==item);break;case"search":var itemToSend=$scope.eSearch.searchResults.find(x=>x.id==item);break;default:var itemToSend=$scope.pagedItemsLoaded.find(x=>x.id==item);break}switch(itemToSend.media_type){case"video":$http.post($scope.actionsUrl,{action:"DownloadOptions",id:itemToSend.id,restrictions:$scope.mediacenterRestrictions||[]}).success(function(data,status,headers,config){width=0;angular.forEach(data,function(x){if(x.width>width){crop=x}});$scope.downloadMedia(itemToSend,crop)}).error(function(data,status,headers,config){console.error(data)});break;default:$scope.downloadMedia(itemToSend,crop);break}},1e3*index)})};$scope.openDownloadShare=function(){$scope.selectionTotalSize=0;if($scope.currentView=="lightBox"){angular.forEach($scope.pagedLightBoxLoaded,function(item){if($scope.selection.indexOf(item.id)!=-1){$scope.selectionTotalSize+=item.fileSize*1}});$scope.selectionTotalSize=Math.round($scope.selectionTotalSize/1024)}else if($scope.currentView=="mediaList"){angular.forEach($scope.pagedItemsLoaded,function(item){if($scope.selection.indexOf(item.id)!=-1){$scope.selectionTotalSize+=item.fileSize*1}});$scope.selectionTotalSize=Math.round($scope.selectionTotalSize/1024)}$scope.sendTo.recipients=[];if($rootScope.currentUser.isAccountAuthenticated){$scope.sendTo.recipients.push($rootScope.currentUser.email)}$rootScope.openModalClass("modal-download-share")};$scope.showVideoTrim=function(){$scope.showTrimVideo=!$scope.showTrimVideo};$scope.toggleSelection=function(item,event){if(event.shiftKey){event.preventDefault()}var idx=$scope.selection.indexOf(item.id);if(idx>-1){$scope.selection.splice(idx,1)}else{$scope.selection.push(item.id)}};$scope.selectAll=function(){if($scope.currentView=="lightBox"){if(!$scope.areAllSelected()){angular.forEach($scope.pagedLightBoxLoaded,function(item){$scope.selection.push(item.id)})}else{$scope.selection=[]}}else if($scope.currentView=="mediaList"){if(!$scope.areAllSelected()){angular.forEach($scope.pagedItemsLoaded,function(item){if($scope.selection.indexOf(item.id)==-1){$scope.selection.push(item.id)}})}else{$scope.selection=[]}}else if($scope.currentView=="search"){if(!$scope.areAllSelected()){angular.forEach($scope.eSearch.searchResults,function(item){if($scope.selection.indexOf(item.id)==-1){$scope.selection.push(item.id)}})}else{$scope.selection=[]}}};$scope.areAllSelected=function(){var allItemsCount=0;
3if($scope.currentView=="lightBox"){allItemsCount=$scope.pagedLightBoxLoaded.length}else if($scope.currentView=="mediaList"){allItemsCount=$scope.pagedItemsLoaded.length}else if($scope.currentView=="search"){allItemsCount=$scope.eSearch.searchResults.length}return allItemsCount==$scope.selection.length?true:false};$scope.changeView=function(newView){console.log("newView",newView);if(!newView){if($scope.currentView=="search"&&!$scope.eSearch.searched){$scope.previewView="";if($scope.eventSelected){$scope.currentView="mediaList"}else{$scope.currentView="gallery"}}else{var curView=$scope.currentView;if($scope.previewView=="media"&&angular.isUndefined($scope.currentItem)){if($scope.eventSelected){$scope.currentView="mediaList"}else{$scope.currentView="gallery"}}else{$scope.currentView=angular.copy($scope.previewView)}$scope.previewView=curView}}else if(newView!=$scope.currentView){$scope.previewView=angular.copy($scope.currentView);$scope.currentView=newView;console.log("$scope.currentView",$scope.currentView)}};$scope.sendMedia=function(){$scope.downloadError="";$scope.sendTo.error=false;$scope.sendTo.success=false;$scope.sendTo.showMessage="";if($scope.sendTo.recipients.length>=1){$scope.isLoading=true;var params={action:"sendMediaZip",items:$scope.selection,emails:[]};angular.forEach($scope.sendTo.recipients,function(em){if(!angular.isUndefined(em.text)){params.emails.push(em.text)}else if(em.length>5){params.emails.push(em)}});$http.post($scope.actionsUrl,params).success(function(data,status,headers,config){$scope.sendTo.showMessage=data.payload.message;if(data.success==true){$scope.sendTo.success=true}else{$scope.sendTo.error=true}$scope.isLoading=false}).error(function(data,status,headers,config){$scope.sendTo.showMessage=data.payload.message;$scope.sendTo.error=true;$scope.isLoading=false})}};$scope.$watch("eSearch.query",function(q){if(!q){$timeout(function(){$scope.eSearchClean()},300)}});$scope.paginateWidgets=function(){$scope.pagedWidget={};$scope.indexWidget={};$scope.currentPageWidget={};$scope.moreLoadWidget={};$scope.filteredWidget={};$scope.pageWidget={};$scope.toPageWidget={};$scope.moreWidget={};$scope.pagedWidgetLoaded={};$scope.firstLoadWidget={};$scope.pagedWidgetLoaded={};$scope.pagedWidgetLoadedPreload={};angular.forEach($scope.widgets,function(widget){$scope.moreWidget[widget.key]=true;$scope.moreLoadWidget[widget.key]=false;$scope.indexWidget[widget.key]=0;$scope.pageWidget[widget.key]=1;$scope.pagedWidgetLoaded[widget.key]=[];$scope.firstLoadWidget[widget.key]=true;$scope.indexWidget[widget.key]=0;$scope.pageWidget[widget.key]=1;$scope.pagedWidgetLoaded[widget.key]=[];$scope.pagedWidgetLoadedPreload[widget.key]=[];$scope.currentPageWidget[widget.key]=0;$scope.toPageWidget[widget.key]=0;$scope.filteredWidget[widget.key]=widget.items;$scope.loadDataWidget(widget.key)})};$scope.trimInit=function(start,end,title){$scope.trimClipsMarks=[];$scope.loadingClips=true;$scope.trimProcessing=true;$http.post($scope.actionsUrl,{action:"Clips",id:$scope.currentItem.id}).success(function(data,status,headers,config){$scope.trimClipsMarks=data;$scope.loadingClips=false;$scope.trimProcessing=false}).error(function(data,status,headers,config){$scope.loadingClips=false;$scope.trimProcessing=false})};$scope.trimOpenClip=function(clip){$scope.windowOpen(clip.url,"_blank")};$scope.trimCreateMark=function(start,end,title){$scope.trimProcessing=true;$http.post($scope.actionsUrl,{action:"CreateMarkVideo",id:$scope.currentItem.id,start:start,end:end,title:title}).success(function(data,status,headers,config){$scope.trimInit()}).error(function(data,status,headers,config){})};$scope.trimCreateClip=function(start,end,title){$scope.trimProcessing=true;$http.post($scope.actionsUrl,{action:"CreateClipVideo",id:$scope.currentItem.id,start:start,end:end,title:title}).success(function(data,status,headers,config){$scope.trimInit()}).error(function(data,status,headers,config){})};$scope.getCropsByPermissions=function(data){var returnCrops=[];var permissions=angular.fromJson($base64.decode(data.cropPermissions));angular.forEach(data.downloadOptions,function(crop){if(angular.isUndefined(permissions[crop.id])){returnCrops.push(crop)}else{var addCrop=false;angular.forEach(permissions[crop.id],function(group){if($rootScope.userAuthenticated(group)){addCrop=true}});if(addCrop){returnCrops.push(crop)}}});return returnCrops};
3$scope.safeApply($scope.startGalleries())};$scope.setCurrentItemFromId=function(){if(angular.isArray($scope.items)&&$scope.items.length>0){angular.forEach($scope.items,function(item){if(item.id==$scope.currentItemId){$scope.currentItemId="";$scope.openMediaItem(item)}})}else if(angular.isArray($scope.widgets)&&$scope.widgets.length>0){var foundItem=null;angular.forEach($scope.widgets,function(widget){if(foundItem)return;if(angular.isArray(widget.items)&&widget.items.length>0){var image=widget.items.find(function(x){return x.id==$scope.currentItemId});if(image){foundItem=angular.copy(image)}}});if(foundItem){if(angular.isUndefined($scope.currentItem)||$scope.currentItem.id!=foundItem.id){var idMedia=foundItem.id;$timeout(function(){$scope.eSearch.searchParam=idMedia;$scope.searchES(idMedia)},1e3)}}}};$rootScope.onPlayerReady=function(API){$rootScope.playerAPI=API};$rootScope.onCompleteVideo=function(){};$scope.closeModalData=function(modalName,modalEmit){if(modalEmit){$rootScope.$emit("site:modal-close-"+modalEmit)}else{$scope.currentModalData=""}if($rootScope.playerAPI){$rootScope.playerAPI.stop()}var modalEl=document.querySelector("#"+modalName);classie.remove(modalEl,"md-show")};$scope.maxHeightModal=function(){var h=window.innerHeight;var h2=h*80/100;return{"max-height":h2}};$scope.modalAction=function(action){if(action=="goToUrl"){if($scope.urlToGo){location.href=$scope.urlToGo}else{location.href=$scope.currentModalData.url}}};$scope.resizeVideoYt=function(){$timeout(function(){var playerContainer=$("vg-media");var w=playerContainer.width();var h=parseInt(w*1*9/16);playerContainer.height(h-1);var playerContainer2=$("#ytplayer");var w2=playerContainer2.width();var h2=parseInt(w2*1*9/16);playerContainer2.height(h2-1)})};$scope.vidPlayerReady=function(API){$scope.videoAPI=API};$scope.vidStop=function(){$scope.videoAPI.pause();return true};$scope.autoLinker=function(text){return Autolinker.link(text)};$scope.initTree=function(urlEncoded,imageDefault,scrollId,onRenderAction,absolutePath,openLevels){$scope.isLoading=true;$scope.encodedUrl=urlEncoded;$scope.urlDecoded="";$scope.allFolders=[];$scope.currentFolder="";$scope.currentView="main";$scope.viewsHistory=[];$scope.openedFolders={};$scope.scrollId=scrollId;$scope.imageDefault=imageDefault;$scope.onRenderAction=onRenderAction;$scope.absolutePath=absolutePath?absolutePath:"";$scope.openLevels=openLevels?openLevels:0;$rootScope.$on("site:hashChanged",function(a){var urlParams=$scope.getHashParams();if(!angular.isUndefined(urlParams.id)&&(angular.isUndefined($scope.currentItem)||urlParams.id!=$scope.currentItem.id)){$scope.setCurrentItemFromId()}else if(angular.isUndefined(urlParams.id)&&!angular.isUndefined($scope.currentItem)){$scope.closeMediaItem()}$scope.safeApply(function(){if(!angular.isUndefined(urlParams.folder)&&urlParams.folder!=$scope.currentFolder.id){if(!angular.isUndefined($scope.allFolders[urlParams.folder])){$scope.openGallery($scope.allFolders[urlParams.folder])}}})});$scope.scrollTo=function(dataslide,plus,newSpeed){var speed=500;if(newSpeed){speed=newSpeed}angular.element("html,body").animate({scrollTop:0},speed)};$scope.init=function(){$timeout(function(){$scope.scrollTo()});$scope.urlDecoded=angular.fromJson($base64.decode($scope.encodedUrl));if(!angular.isUndefined($scope.urlDecoded.actions)&&$scope.urlDecoded.actions.length>0){$scope.actionsUrl=$scope.urlDecoded.actions}$scope.loadData()};$scope.loadData=function(){if(!angular.isUndefined($scope.urlDecoded.url)){$http.get($scope.urlDecoded.url).then(function(results){if(!angular.isUndefined(results.data.folders[0])&&!angular.isUndefined(results.data.folders[0].children)){$scope.allFolders=results.data.folders[0];angular.forEach($scope.allFolders.children,function(folder){folder.parent="initial"});$scope.allFolders=$filter("orderBy")($scope.allFolders.children,"sort",true);if($scope.openLevels>0){if(!angular.isUndefined($scope.allFolders[0])){$scope.allFolders[0].opened=true;if($scope.openLevels>1){if(!angular.isUndefined($scope.allFolders[0].children)){var firstChildren=$filter("orderBy")($scope.allFolders[0].children,"sort",true);firstChildren[0].opened=true}}}}$scope.expandedFolders=[];for(var i=0;i<$scope.allFolders.length;i++){$scope.searchFeeds($scope.allFolders[i])}}if(window.location.hash){let hashIds=window.location.hash.slice(1).split("_");let folderId=hashIds[0];let itemId=hashIds[1];$scope.searchHashItem(folderId,itemId,$scope.allFolders)}else{$scope.isLoading=false}})}};$scope.searchHashItem=function(folderId,itemId,folders){angular.forEach(folders,function(folder){if(folder.hasChilds){$scope.searchHashItem(folderId,itemId,folder.children)}else if(folder.id==folderId){$http.get($scope.absolutePath+folder.feed).then(function(results){var item=results.data.items.find(x=>x.id==itemId);item.parentFolder=folder.id;$scope.openItem(item);$scope.isLoading=false});$scope.createRoute(folder.id,$scope.allFolders,[])}})};$scope.createRoute=function(idFolder,allFolders,route){angular.forEach(allFolders,function(folder){if(folder.id==idFolder){route.unshift(folder);if(folder.parent=="initial"){angular.forEach(route,function(folder){$scope.openFolder(folder)})}else{$scope.createRoute(folder.parent,$scope.allFolders,route)}}else if(folder.hasChilds){$scope.createRoute(idFolder,folder.children,route)}})};$scope.searchFeeds=function(child){if(child.children&&child.children.length){for(var i=0;i<child.children.length;i++){$scope.searchFeeds(child.children[i])}}else if(child.feed.length>0){$http.get(child.feed).then(function(feedRes){for(var j=0;j<feedRes.data.items.length;j++){$scope.expandedFolders.push(feedRes.data.items[j])}})}};$scope.loadFolder=function(folder){$http.get($scope.absolutePath+folder.feed).then(function(results){angular.forEach(results.data.items,function(item){item.parentFolder=folder.id});folder.items=results.data.items;folder.itemsLoading=false;folder.itemsLoaded=true})};$scope.openItem=function(item){$scope.isPDF=false;if(!angular.isUndefined(item.url)){$scope.currentFile=$sce.trustAsResourceUrl(item.url);$scope.currentFileType=item.media_type;$scope.currentFileExtension=item.extension;$scope.currentFileEmbed=$sce.trustAsHtml(item.embed);if(item.extension=="pdf"){$scope.isPDF=true}else{$timeout(function(){$("#itemShow").attr("src",item.url);const image=document.getElementById("itemShow");let scale=1;let lastScale=1;let posX=0;let posY=0;let lastX=0;let lastY=0;let startX=0;let startY=0;let initialDistance=0;image.addEventListener("touchstart",function(e){if(e.touches.length===2){initialDistance=getDistance(e.touches[0],e.touches[1]);lastScale=scale}else if(e.touches.length===1){startX=e.touches[0].clientX-lastX;startY=e.touches[0].clientY-lastY}},{passive:false});image.addEventListener("touchmove",function(e){e.preventDefault();if(e.touches.length===2){const currentDistance=getDistance(e.touches[0],e.touches[1]);scale=lastScale*(currentDistance/initialDistance);scale=Math.max(.5,Math.min(scale,4))}else if(e.touches.length===1){posX=e.touches[0].clientX-startX;posY=e.touches[0].clientY-startY}updateTransform()},{passive:false});image.addEventListener("touchend",function(e){lastX=posX;lastY=posY;if(e.touches.length<2){lastScale=scale}});function updateTransform(){image.style.transform=`translate(${posX}px, ${posY}px) scale(${scale})`}function getDistance(touch1,touch2){const dx=touch2.clientX-touch1.clientX;const dy=touch2.clientY-touch1.clientY;return Math.hypot(dx,dy)}})}}else if(!angular.isUndefined(item.media)&&!angular.isUndefined(item.media.view)){$scope.currentFile=$sce.trustAsResourceUrl(item.media.view);$timeout(function(){$("#itemShow").attr("src",item.media.view)})}window.location.hash="#"+item.parentFolder+"_"+item.id};$scope.getNavStyle=function(scroll){if(scroll>
3100)return"pdf-controls fixed";else return"pdf-controls"};$scope.closeItem=function(){$scope.currentFile=false;$timeout(function(){$("#itemShow").attr("src","")})};$scope.openFolder=function(folder){$scope.toggleFolder(folder);if(folder.feed){if(angular.isUndefined(folder.itemsLoaded)){folder.itemsLoading=true;folder.items=[];$scope.loadFolder(folder)}}};$scope.toggleFolder=function(folder){if(angular.isUndefined(folder.opened)||!folder.opened){folder.opened=true}else{folder.opened=false}};$scope.shareFile=function(){var aux=document.createElement("input");aux.setAttribute("value",window.location.href);document.body.appendChild(aux);aux.select();document.execCommand("copy");document.body.removeChild(aux);var css=document.createElement("style");var estilo=document.createTextNode('#aviso {color: #FFF; position:fixed; z-index: 9999999; bottom: 50px; left:50%; transform: translate(-50%, 0);padding: 10px 20px; background: var(--lightblue);border-radius: 8px;font-family: "Cera Ocean";}');css.appendChild(estilo);document.head.appendChild(css);var aviso=document.createElement("div");aviso.setAttribute("id","aviso");var contenido=document.createTextNode("URL copied to clipboard");aviso.appendChild(contenido);document.body.appendChild(aviso);window.load=setTimeout("document.body.removeChild(aviso)",2e3)};$scope.init()}}]);"use strict";angular.module("MediaGalleries",["services.HttpService","directives.spinner","directives.resizables","ngSanitize","Scope.safeApply"]).controller("MediaGalleriesController",["$scope","$filter","$http","HttpService","$window","$location","preloader","$timeout","$rootScope","CommonFactory","$base64","require_authentication","system_language","$compile","$sce","$cookies",function($scope,$filter,$http,HttpService,$window,$location,preloader,$timeout,$rootScope,CommonFactory,$base64,require_authentication,system_language,$compile,$sce,$cookies){$scope.actionsUrl="/api/actions";$rootScope.currentEvent="";$scope.loadEvent=true;$scope.model={};$scope.urlToGo="";$rootScope.$on("site:hashChanged",function(){$scope.setCurrentEvent()});$scope.setCurrentEvent=function(){var urlParams=$scope.getHashParams();if(!angular.isUndefined(urlParams.event)&&urlParams.event!=$rootScope.currentEvent){$scope.loadEvent=true;$rootScope.currentEvent=urlParams.event;var expiryDate=new Date;expiryDate.setMonth(expiryDate.getMonth()+1);document.cookie="event="+urlParams.event+";expires="+expiryDate.toGMTString()+";path=/;Secure;SameSite=None";$scope.$apply()}if(!angular.isUndefined(urlParams.id)){$scope.currentItemId=urlParams.id}};$timeout(function(){$scope.setCurrentEvent()});$scope.getHashParams=function(){var urlParams={};var hashLoad=$location.hash();if(hashLoad){var hashParams=hashLoad.split("&");angular.forEach(hashParams,function(h){var h2=h.split("=");if(h2.length==2){urlParams[h2[0]]=h2[1]}else{urlParams[h2[0]]=true}})}return urlParams};$scope.setHashParams=function(params){var hash="";angular.forEach(params,function(val,key){hash+=key+"="+val+"&"});if(hash.substr(-1,1)=="&"){hash=hash.substr(0,hash.length-1)}$location.hash(hash)};$scope.searchMatch=function(haystack,needle){if(!needle){return true}if(angular.isString(haystack)){return haystack.toLowerCase().indexOf(needle.toLowerCase())!==-1}else{return false}};$scope.searchContains=function(string,substr){if(angular.isUndefined(string)){return false}else{return string.indexOf(substr)!=-1}};$scope.searchContainsComma=function(string,substr){var i=0;var retVar=false;var exp=string.split(",");for(i=0;i<exp.length;i++){if(exp[i]==substr){retVar=true}}return retVar};$scope.searchDate=function(string,filterBy){var nowDate=moment().utc().format("YYYY-MM-DD");string=string.substr(0,10);var filterBy2=filterBy.split(",");if(filterBy2.length==2){filterBy=filterBy2[0];nowDate=filterBy2[1]}if(filterBy=="="){if(string==nowDate){return true}}else if(filterBy==">"){if(string>nowDate){return true}}else if(filterBy==">="){if(string>=nowDate){return true}}else if(filterBy=="<"){if(string<nowDate){return true}}else if(filterBy=="<="){if(string<=nowDate){return true}}return false};$scope.init=function(url,per_page,imageDefault,idData,scrollId,firstAction,filterId,onRenderAction,fotoramaId,autoPlay){$scope.autoPlay=autoPlay;$timeout(function(){$scope.scrollTo()});
3$rootScope.$on("site:hashChanged",function(a){var urlParams=$scope.getHashParams();if(!angular.isUndefined(urlParams.id)&&(angular.isUndefined($scope.currentItem)||urlParams.id!=$scope.currentItem.id)){$scope.setCurrentItemFromId()}else if(angular.isUndefined(urlParams.id)&&!angular.isUndefined($scope.currentItem)){$scope.closeMediaItem()}$scope.safeApply(function(){if(!angular.isUndefined(urlParams.gallery)&&urlParams.gallery!=$scope.currentGallery.id){var currGal=$filter("filter")($scope.allGalleries,{id:urlParams.gallery},true);if(currGal.length>0){$scope.openGallery(currGal[0])}}})});var urlDecode=angular.fromJson($base64.decode(url));if(!angular.isUndefined(urlDecode.actions)&&urlDecode.actions.length>0){$scope.actionsUrl=urlDecode.actions}$scope.isLoading=true;$scope.eventSelected=false;$scope.encodedUrl=url;$scope.allGalleries=[];$scope.currentGallery="";$scope.previewView="";$scope.currentView="main";$scope.viewsHistory=[];$scope.idData=idData;$scope.scrollId=scrollId;$scope.firstAction=firstAction;$scope.fieldsByType=["class","class2","class3"];$scope.imageDefault=imageDefault;$scope.onSocial=false;$scope.onRenderAction=onRenderAction;$scope.fotoramaId=fotoramaId;$scope.filterId=filterId;$scope.searchParam="";$scope.currentModalData={};$scope.videoAPI=null;$scope.filtersCollapse={};$scope.sortType="";$scope.sortReverse=false;$scope.searchColumn="";$scope.itemsPerPage=per_page;$scope.hasFotorama=false;$scope.fotoramaElement=angular.element($scope.fotoramaId);var params=[];$scope.loadDataFromJson=function(){if($scope.currentGallery.feed&&$scope.loadEvent){$scope.loadEvent=false;$scope.items=[];$scope.allFilters=[];HttpService.getDataUrl($scope.currentGallery.feed,params).then(function(response){$scope.safeApply(function(){if(!angular.isUndefined(response.data.filters)){$scope.allFilters=response.data.filters}if(!angular.isUndefined(response.data.items)){var responseItems=response.data.items}else{var responseItems=response.data}angular.forEach(responseItems,function(item){item.datavideo="";if(!angular.isUndefined(item.media.source)){item.datavideo='data-video="{{item.media.source}}"'}if($scope.filterId){if(item.id!=$scope.filterId){$scope.items.push(item)}}else{if($scope.firstAction&&$scope.firstAction.substr(0,5)=="CLASS"){if(item.class==$scope.firstAction.substr(5)){$scope.items.push(item)}}else{$scope.items.push(item)}}});var hashParams=$scope.getHashParams();if(!angular.isUndefined(hashParams.id)){$scope.currentItemId=hashParams.id;$scope.setCurrentItemFromId()}if(CommonFactory.isMobile()){$scope.hideFilters()}if($scope.firstAction){if($scope.firstAction&&$scope.firstAction=="DATENOW"){$scope.setFilterDateNow("",">=",true)}else if($scope.firstAction.substr(0,6)=="always"){$scope.setFilterAlways("",$scope.firstAction)}else if($scope.firstAction.substr(0,4)=="date"){$scope.setFilterDate($scope.firstAction.substr(5))}else if($scope.firstAction&&$scope.firstAction.substr(0,4)=="NONE"){$scope.search()}else if($scope.firstAction&&$scope.firstAction.substr(0,5)=="CLASS"){$scope.search()}}else{$scope.search()}})})}else{$scope.isLoading=false;$scope.noEvent=true}};$scope.startGalleries=function(){var urlDecode=angular.fromJson($base64.decode($scope.encodedUrl));$scope.galleriesUrl=urlDecode.url;if($scope.galleriesUrl){$scope.allGalleries=[];$scope.downloadOptions=[];$scope.eventData=undefined;HttpService.getDataUrl($scope.galleriesUrl,params).then(function(response){$scope.safeApply(function(){if(!angular.isUndefined(response.data.galleries)){$scope.allGalleries=response.data.galleries}else{$scope.allGalleries=response.data}var hashParams=$scope.getHashParams();var openedGallery=false;if(!angular.isUndefined(hashParams.gallery)){var currGal=$filter("filter")($scope.allGalleries,{id:hashParams.gallery},true);if(currGal.length>0){openedGallery=true;$scope.openGallery(currGal[0])}}if(!openedGallery){if($scope.allGalleries.length>0&&!$scope.allGalleries[0].hasChilds){$scope.openGallery($scope.allGalleries[0])}else{$scope.firstGallery="";$scope.currentGallery=$scope.allGalleries[0];$scope.changeView("gallery");$scope.isLoading=false}}})})}else{$scope.isLoading=false;$scope.noEvent=true}};$scope.openGallery=function(gallery){if($scope.hasFotorama){$scope.fotoramaElement.data("fotorama").destroy();$scope.fotoramaElement.html('<a href="{{item.media.view}}" data-video="{{item.media.source}}" data-caption="{{item.description}}" ng-repeat="item in pagedItemsLoaded" on-finish-render><img ng-src="{{item.media.thumb}}"></a>');$compile($scope.fotoramaElement.contents())($scope);$scope.hasFotorama=false}$scope.selection=[];$scope.changeView("gallery");$scope.isLoading=true;$scope.eventSelected=false;$scope.currentGallery=gallery;$scope.scrollTo($scope.scrollId,"",100);var hashParams=$scope.getHashParams();hashParams.gallery=gallery.id;$scope.setHashParams(hashParams);if($scope.currentGallery.feed){$scope.changeView("mediaList");$scope.eventSelected=true;$scope.changeEvent()}else{$scope.isLoading=false}};$scope.galleriesTree=function(){var breadCrumb=[];
3if($scope.currentGallery){breadCrumb.push($scope.currentGallery);$scope.treeParent(breadCrumb,$scope.currentGallery.parent)}$scope.breadcrubLength=breadCrumb.length;return breadCrumb};$scope.treeParent=function(breadCrumb,idGallery){if(idGallery){var parentGal=$filter("filter")($scope.allGalleries,{id:idGallery},true);if(parentGal.length>0){breadCrumb.unshift(parentGal[0]);$scope.treeParent(breadCrumb,parentGal[0].parent)}}return breadCrumb};$scope.changeEvent=function(){$scope.loadEvent=true;$scope.currentItemId="";$scope.url=$scope.currentGallery.feed;$scope.noEvent=$scope.noEvents;$scope.page=1;$scope.filterSearch=false;if($scope.filterId){$scope.filterMain=false}else{$scope.filterMain=true}$scope.filterDate=false;$scope.filterDate2=false;$scope.filterDateAlways=false;$scope.filterTag=false;$scope.filterClass=false;$scope.filterClass2=false;$scope.filterClass3=false;$scope.filterAlways=false;$scope.filterAlwaysField=false;$scope.dateOptions={showWeeks:false,appendToBody:false};$scope.dateFrom={opened:false,value:"",watched:false};$scope.dateTo={opened:false,value:"",watched:false};$scope.starter()};$scope.starter=function(){$scope.index=0;$scope.data=[];$scope.page=1;$scope.results=[];$scope.pagedItemsLoaded=[];$scope.pagedItemsLoadedPreload=[];$scope.imageLocations=[];$scope.more=true;$scope.moreLoad=false;$scope.status_bar="";$scope.isLoading=true;$scope.noresults=false;$scope.isSuccessful=false;$scope.percentLoaded=0;$scope.preloader=false;$scope.$on("ngRepeatFinished",function(){if($scope.fotoramaId){if(!$scope.hasFotorama){setTimeout(function(){$scope.fotoramaElement.fotorama();$scope.hasFotorama=true},200)}}if($scope.onRenderAction){eval($scope.onRenderAction)}});$scope.loadDataFromJson()};$scope.search=function(){$scope.filteredItems=$filter("filter")($scope.items,function(item){var x=false;if(!angular.isUndefined($scope.query)){angular.forEach(item,function(val,attr){if($scope.searchMatch(item[attr],$scope.query)){x=true}})}else{x=true}return x});if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterAlways)&&$scope.filterAlways.length>0){$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){if($scope.searchContains(item[$scope.filterAlwaysField],$scope.filterAlways)){return true}return false})}if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterDateAlways)&&$scope.filterDateAlways.length>0){$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){if($scope.searchDate(item.datefilter,$scope.filterDateAlways)){return true}return false})}if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterDate)&&$scope.filterDate.length>0){$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){if($scope.searchDate(item.datefilter,$scope.filterDate)){return true}return false})}if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterDate2)&&$scope.filterDate2.length>0){$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){if($scope.searchDate(item.datefilter,$scope.filterDate2)){return true}return false})}if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterClass)&&$scope.filterClass.length>0){$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){if($scope.searchContains(item.class,$scope.filterClass)){return true}return false})}if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterTag)&&$scope.filterTag.length>0){$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){if($scope.searchContainsComma(item.tags,$scope.filterTag)){return true}return false})}if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterMain)&&$scope.filterMain==true){$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){if(!angular.isUndefined(item.main)){return true}return false})}$scope.currentPage=0;if($scope.filteredItems.length==0){if($scope.filterTag.length>0){if(!angular.isUndefined($scope["urlLoadTag"+$scope.filterTag])&&angular.isUndefined($scope["filterLoadTag"+$scope.filterTag])){$scope.preloadNextItems(1)}
3else{$scope.safeApply(function(){$scope.isLoading=false;$scope.isSuccessful=true;$scope.more=false;$scope.noresults=true})}}else{if(!angular.isUndefined($scope["urlLoad"+$scope.filterClass])&&angular.isUndefined($scope["filterLoad"+$scope.filterClass])){$scope.preloadNextItems(1)}else{$scope.safeApply(function(){$scope.isLoading=false;$scope.isSuccessful=true;$scope.more=false;$scope.noresults=true})}}}else{$scope.groupToPages()}if($scope.load==true){$scope.load=false}};$scope.loadData=function(){$scope.currentPage++;$scope.search()};$scope.groupToPages=function(){$scope.pagedItems=[];$scope.currentPage++;$scope.imageLocations=[];for(;$scope.index<$scope.itemsPerPage*$scope.page;$scope.index++){$scope.moreLoad=$scope.filteredItems.length>$scope.index;if($scope.moreLoad==false){break}if(angular.isUndefined($scope.filteredItems[$scope.index].allMedia)){$scope.filteredItems[$scope.index].allMedia=[];if(!angular.isUndefined($scope.filteredItems[$scope.index].media)){angular.copy($scope.filteredItems[$scope.index].media,$scope.filteredItems[$scope.index].allMedia)}}$scope.filteredItems[$scope.index].extraClass=$scope.filteredItems[$scope.index].class;if(!angular.isUndefined($scope.filteredItems[$scope.index].class2)){$scope.filteredItems[$scope.index].extraClass+=" "+$scope.filteredItems[$scope.index].class2}if(!angular.isUndefined($scope.filteredItems[$scope.index].class3)){$scope.filteredItems[$scope.index].extraClass+=" "+$scope.filteredItems[$scope.index].class3}if(!angular.isUndefined($scope.filteredItems[$scope.index].premium)){$scope.filteredItems[$scope.index].extraClass+=" "+$scope.filteredItems[$scope.index].premium}$scope.filteredItems[$scope.index].mediaShow=$scope.imageDefault;if($scope.filteredItems[$scope.index].media&&angular.isArray($scope.filteredItems[$scope.index].media)&&$scope.filteredItems[$scope.index].media.length>0){$scope.filteredItems[$scope.index].media=$scope.filteredItems[$scope.index].media[0]}if(angular.isUndefined($scope.filteredItems[$scope.index].media)||!$scope.filteredItems[$scope.index].media||$scope.filteredItems[$scope.index].media.length<1){$scope.filteredItems[$scope.index].extraClass+=" no-img"}else{if(CommonFactory.isMobile()&&$scope.filteredItems[$scope.index].mediaMobile!=false){$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].mediaMobile}else{$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].media}$scope["imageLocations"].push($scope.filteredItems[$scope.index].media);if($scope.filterMain&&$scope.index<1){if(CommonFactory.isMobile()&&$scope.filteredItems[$scope.index].mediaMobile!=false){$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].mediaMobile}else if(!angular.isUndefined($scope.filteredItems[$scope.index].mediaFirst)&&$scope.filteredItems[$scope.index].mediaFirst.length>0){$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].mediaFirst}else{$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].media}$scope["imageLocations"].push($scope.filteredItems[$scope.index].mediaFirst)}}if(!angular.isUndefined($scope.filteredItems[$scope.index].media2)){if(CommonFactory.isMobile()&&$scope.filteredItems[$scope.index].mediaMobile2!=false){$scope.filteredItems[$scope.index].mediaShow2=$scope.filteredItems[$scope.index].mediaMobile2}else{$scope.filteredItems[$scope.index].mediaShow2=$scope.filteredItems[$scope.index].media2}$scope["imageLocations"].push($scope.filteredItems[$scope.index].media2)}if(!angular.isUndefined($scope.filteredItems[$scope.index].pages)&&$scope.filteredItems[$scope.index].pages.length>0){if(CommonFactory.isMobile()&&$scope.filteredItems[$scope.index].mediaMobile!=false){$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].pages[0].medium}else{$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].pages[0].medium}$scope["imageLocations"].push($scope.filteredItems[$scope.index].pages[0].medium);if($scope.filterMain&&$scope.index<1){$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].pages[0].medium;$scope["imageLocations"].push($scope.filteredItems[$scope.index].pages[0].medium)}}if(!angular.isUndefined($scope.filteredItems[$scope.index].tags)&&$scope.filteredItems[$scope.index].tags.length>0){$scope.filteredItems[$scope.index].tagsArray=[];var itemTags=$scope.filteredItems[$scope.index].tags.split(",");angular.forEach(itemTags,function(t){var tagAdd=$filter("filter")($scope.allFilters,{id:t},true);if(tagAdd){$scope.filteredItems[$scope.index].tagsArray.push(tagAdd[0].name)}})}if(!angular.isUndefined($scope.filteredItems[$scope.index].mediaVideo)){if(angular.isObject($scope.filteredItems[$scope.index].mediaVideo)){$scope.filteredItems[$scope.index].mediaVideoMulti=true}}$scope.pagedItems.push($scope.filteredItems[$scope.index]);if(!angular.isUndefined($scope.filteredItems[$scope.index].media)&&$scope.filteredItems[$scope.index].media){if($scope["filteredItems"][$scope["index"]].media[0]!==null){$scope["imageLocations"].push($scope["filteredItems"][$scope["index"]].media)}}}$scope.safeApply(function(){angular.forEach($scope.pagedItems,function(item){$scope.s
3afeApply(function(){$scope.pagedItemsLoadedPreload.push(item)})});$scope.isLoading=false;$scope.isSuccessful=true;$scope.percentLoaded=0;if($scope.page==1){$scope.viewNext()}else{}angular.element("#content-"+$scope.idData).fadeIn("fast")})};$scope.preload=function(imageLocations){preloader.preloadImages(imageLocations).then(function handleResolve(imageLocations){$scope.isLoading=false;$scope.isSuccessful=true;angular.forEach($scope.resultsPage,function(item){$scope.safeApply(function(){$scope.results.push(item)})});$scope.more=$scope.moreLoad;$scope.percentLoaded=0},function handleReject(imageLocation){$scope.isLoading=false;$scope.isSuccessful=false},function handleNotify(event){$scope.percentLoaded=event.percent})};$scope.windowOpen=function(url,title,options){$window.open(url,title,options)};$scope.preloadNextItems=function(noResults){$scope.page+=1;if($scope.firstLoad){$scope.firstLoad=false;$scope.isLoading=true;$scope.safeApply($scope.loadData())}else{if($scope.filterMain==true){$scope.safeApply($scope.loadData())}else if($scope.filterTag.length>0){if(!angular.isUndefined($scope["urlLoadTag"+$scope.filterTag])){if(!angular.isUndefined($scope["filterLoadTag"+$scope.filterTag])){$scope.safeApply($scope.loadData())}else{$scope["filterLoadTag"+$scope.filterTag]=$scope["urlLoadTag"+$scope.filterTag];$scope.safeApply($scope.preloadNextTabTag(noResults))}}else{$scope.safeApply($scope.loadData())}}else{if(!angular.isUndefined($scope["urlLoad"+$scope.filterClass])){if(!angular.isUndefined($scope["filterLoad"+$scope.filterClass])){$scope.safeApply($scope.loadData())}else{$scope["filterLoad"+$scope.filterClass]=$scope["urlLoad"+$scope.filterClass];$scope.safeApply($scope.preloadNextTab(noResults))}}else{$scope.safeApply($scope.loadData())}}}};$scope.viewNext=function(){angular.forEach($scope.pagedItems,function(item){$scope.s
3afeApply(function(){if($scope.addSeparatorFromField){if($scope.addSeparatorFromField=="date"){if($scope.pagedItemsLoaded.length>1){var parentItem=$scope.items[$scope.pagedItemsLoaded.length-1];if(item.date.substring(0,10)!=$scope.pagedItemsLoaded[$scope.pagedItemsLoaded.length-1].date.substring(0,10)){$scope.pagedItemsLoaded.push({id:Math.random(),extraClass:"date",date:item.date})}}else{$scope.pagedItemsLoaded.push({id:Math.random(),extraClass:"date",date:item.date})}$scope.pagedItemsLoaded.push(item)}}else{$scope.pagedItemsLoaded.push(item)}})});$scope.preloader=true;$scope.safeApply($scope.preloadNextItems());if($scope.pagedItems.length==0){$scope.more=false;$scope.isLoading=false}};$scope.show_more=function(){$scope.viewNext()};$scope.nextPage=function(){if($scope.currentPage<$scope.pagedItems.length-1){$scope.currentPage++}};$scope.show_more_Infinite=function(){$scope.page++;$scope.loadData()};$scope.has_more=function(){return $scope.more};$scope.countByFilter=function(){$scope.filteredTotal=$filter("filter")($scope.items,function(item){var x=false;if(!angular.isUndefined($scope.query)){angular.forEach($scope.searchFields,function(attr){if($scope.searchMatch(item[attr],$scope.query)){x=true}})}else{x=true}return x});if(!angular.isUndefined($scope.filteredTotal)&&!angular.isUndefined($scope.filterDate)&&$scope.filterDate.length>0){$scope.filteredTotal=$filter("filter")($scope.filteredItems,function(item){if($scope.searchDate(item.datefilter,$scope.filterDate)){return true}return false})}if(!angular.isUndefined($scope.filteredTotal)&&!angular.isUndefined($scope.filterDate2)&&$scope.filterDate2.length>0){$scope.filteredTotal=$filter("filter")($scope.filteredItems,function(item){if($scope.searchDate(item.datefilter,$scope.filterDate2)){return true}return false})}if(!angular.isUndefined($scope.filteredTotal)&&!angular.isUndefined($scope.filterClass)&&$scope.filterClass.length>0){$scope.filteredTotal=$filter("filter")($scope.filteredTotal,function(item){if($scope.searchContains(item.class,$scope.filterClass)){return true}return false})}if(!angular.isUndefined($scope.filteredTotal)&&!angular.isUndefined($scope.filterTag)&&$scope.filterTag.length>0){$scope.filteredTotal=$filter("filter")($scope.filteredTotal,function(item){if($scope.searchContainsComma(item.tags,$scope.filterTag)){return true}return false})}if(!angular.isUndefined($scope.filteredTotal)&&!angular.isUndefined($scope.filterClass2)&&$scope.filterClass2.length>0){$scope.filteredTotal=$filter("filter")($scope.filteredTotal,function(item){if($scope.searchContains(item.class2,$scope.filterClass2)){return true}return false})}if(!angular.isUndefined($scope.filteredTotal)&&!angular.isUndefined($scope.filterClass3)&&$scope.filterClass3.length>0){$scope.filteredTotal=$filter("filter")($scope.filteredTotal,function(item){if($scope.searchContains(item.class3,$scope.filterClass3)){return true}return false})}};$scope.preloadNextTab=function(noResults){$scope.countByFilter();if(angular.isUndefined($scope["filterLoaded"+$scope.filterClass])){HttpService.getDataUrl($scope["filterLoad"+$scope.filterClass],"").then(function(response){$scope.safeApply(function(){$scope["filterLoaded"+$scope.filterClass]=true;if(response.data.length==$scope.filteredTotal.length){if(noResults){$scope.safeApply(function(){$scope.isLoading=false;$scope.isSuccessful=true;$scope.more=false;$scope.noresults=true})}else{$scope.safeApply(function(){$scope.more=false;$scope.isLoading=false})}}else{var i2=0;for(var i=0;i<response.data.length;i++){if(i2>=$scope.filteredTotal.length){if($scope.firstAction&&$scope.firstAction.substr(0,5)=="CLASS"){if(response.data[i].class==$scope.firstAction.substr(5)){$scope.items.push(response.data[i]);i2++}}else{$scope.items.push(response.data[i]);i2++}}else{i2++}}
3if($scope.filteredTotal.length<$scope.itemsPerPage){$scope.safeApply($scope.starter());$scope.search()}else{$scope.loadData()}}})})}};$scope.preloadNextTabTag=function(noResults){$scope.countByFilter();if(angular.isUndefined($scope["filterLoadedTag"+$scope.filterTag])){HttpService.getDataUrl($scope["filterLoadTag"+$scope.filterTag],"").then(function(response){$scope.safeApply(function(){$scope["filterLoadedTag"+$scope.filterTag]=true;if(response.data.length==$scope.filteredTotal.length){if(noResults){$scope.safeApply(function(){$scope.isLoading=false;$scope.isSuccessful=true;$scope.more=false;$scope.noresults=true})}else{$scope.safeApply(function(){$scope.more=false;$scope.isLoading=false})}}else{var i2=0;for(var i=0;i<response.data.length;i++){if(i2>=$scope.filteredTotal.length){if($scope.firstAction&&$scope.firstAction.substr(0,5)=="CLASS"){if(response.data[i].class==$scope.firstAction.substr(5)){$scope.items.push(response.data[i]);i2++}}else{$scope.items.push(response.data[i]);i2++}}}if($scope.filteredTotal.length<$scope.itemsPerPage){$scope.s
3afeApply($scope.starter());$scope.search()}else{$scope.loadData()}}})})}};$scope.setFilterDefault=function(filterData,urlAll){$scope.scrollTo($scope.scrollId,"");$scope.filterMain=true;$scope.filterTag=false;$scope.filterDate=false;$scope.filterDate2=false;$scope.filterClass=false;$scope.filterClass2=false;$scope.filterClass3=false;angular.element("#content-"+$scope.idData).fadeOut("fast",function(){$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).fadeIn("fast")});return false};$scope.setFilterClass=function(filterClass,urlAll,maintainTag){if(angular.element("#content-"+$scope.idData+"-tabs").length){angular.element("#content-"+$scope.idData+"-tabs .items-tab").fadeOut("fast")}$scope.filterMain=false;$scope.filterDate=false;$scope.filterDate2=false;if(!maintainTag){$scope.filterTag=false}$scope.filterClass=filterClass;$scope.filterClass2=false;$scope.filterClass3=false;if(!filterClass){$scope.showFilters()}else{$scope.hasFilter=true;if(CommonFactory.isMobile()){$scope.hideFilters()}}angular.element("#content-"+$scope.idData).fadeOut("fast",function(){if(urlAll){if(filterClass){$scope["urlLoad"+filterClass]=urlAll}}$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).fadeIn("fast")});$scope.scrollTo($scope.idData,"");return false};$scope.setFilterSearch=function(filterSearch,maintainFilters,maintainDate){if(filterSearch){$scope.query=filterSearch;$scope.hasFilter=true}else{delete $scope.query}$scope.filterMain=false;if(!maintainDate){$scope.filterDate=false}if(!maintainFilters){$scope.filterTag=false;$scope.filterClass=false;$scope.filterClass2=false;$scope.filterClass3=false}angular.element("#content-"+$scope.idData).fadeOut("fast",function(){$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).fadeIn("fast")});$scope.scrollTo($scope.idData,"");return false};$scope.setFilterAlways=function($event,filterAlways){var checkedbox=false;if($event){var checkbox=$event.target;checkedbox=checkbox.checked}else{var checkedbox=true}$scope.scrollTo($scope.scrollId,"");$scope.filterAlways=false;$scope.filterAlwaysField=false;if(checkedbox==true){var exp=filterAlways.split(",");$scope.filterAlwaysField=exp[2];if(typeof exp[3]!="undefined"&&exp[3]=="user"){if($rootScope.currentUser[exp[1]]){$scope.filterAlways=$rootScope.currentUser[exp[1]]}}else{$scope.filterAlways=exp[1]}}angular.element("#content-"+$scope.idData).fadeOut("fast",function(){$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).fadeIn("fast")});return false};$scope.setFilterTagByName=function(tagName,urlAll,maintainClass,slug,treeOpen){angular.forEach($scope.allFilters,function(tag){if(tag.name==tagName){$scope.closeMediaItem();$scope.setFilterTag(tag.id,urlAll,maintainClass,slug,treeOpen)}})};$scope.setFilterTag=function(filterTag,urlAll,maintainClass,slug,treeOpen){if(treeOpen){angular.forEach(treeOpen,function(itemId){$scope.filtersCollapse[itemId]=true})}if(angular.element("#content-"+$scope.idData+"-tabs").length){angular.element("#content-"+$scope.idData+"-tabs .items-tab").fadeOut("fast")}$scope.filterMain=false;$scope.filterDate=false;$scope.filterDate2=false;if(filterTag){$scope.filterTag=filterTag;$scope.hasFilter=true;if(CommonFactory.isMobile()){$scope.hideFilters()}}else{$scope.filterTag=false;$scope.showFilters()}if(!maintainClass){$scope.filterClass=false;$scope.filterClass2=false;$scope.filterClass3=false}if(slug){$location.hash(slug)}angular.element("#content-"+$scope.idData).fadeOut("fast",function(){if(urlAll){if(filterTag){$scope["urlLoadTag"+filterTag]=urlAll}}$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).fadeIn("fast")});$scope.scrollTo($scope.idData,"");return false};$scope.setFilterTab=function(tabName,showContent,filterContent,resetFilterTab){angular.element("#content-"+$scope.idData+"-tabs .items-tab").hide();angular.element("#content-"+$scope.idData).hide();if(resetFilterTab){$scope.setFilterTag("","",1)}if(showContent==1){if(!filterContent){$scope.setFilterClass("","",1);angular.element("#content-"+$scope.idData).fadeIn("fast")}else{$scope.setFilterClass(filterContent,"",1)}angular.element("#content-"+$scope.idData+"-no-results").fadeIn("fast")}if(angular.element("#content-"+$scope.idData+"-tabs .items-tab."+tabName).length){angular.element("#content-"+$scope.idData+"-tabs").fadeIn("fast");angular.element("#content-"+$scope.idData+"-tabs .items-tab."+tabName).fadeIn("fast")}$scope.scrollTo($scope.idData,"");$scope.hasFilter=true;return false};$scope.setFilterDate=function(filterDate,urlAll){$scope.filterMain=false;$scope.filterTag=false;$scope.filterDate=filterDate;$scope.filterDate2=$scope.filterDate2;$scope.filterClass=false;$scope.filterClass2=false;$scope.filterClass3=false;angular.element("#content-"+$scope.idData).fadeOut("fast",function(){if(urlAll){if(filterClass){$scope["urlLoad"+filterClass]=urlAll}$scope.countByFilter();if($scope.filteredTotal.length<$scope.itemsPerPage){$scope["filterLoad"+filterClass]=urlAll;$scope.preloadNextTab()}}$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).fadeIn("fast")});$scope.scrollTo($scope.idData,"");$scope.hasFilter=true;return false};$scope.setFilterDate2=function(filterDate2,urlAll){$scope.filterMain=false;$scope.filterTag=false;$scope.filterDate=$scope.filterDate;$scope.filterDate2=filterDate2;$scope.filterClass=false;$scope.filterClass2=false;$scope.filterClass3=false;angular.element("#content-"+$scope.idData).fadeOut("fast",function(){if(urlAll){if(filterClass){$scope["urlLoad"+filterClass]=urlAll}$scope.countByFilter();if($scope.filteredTotal.length<$scope.itemsPerPage){$scope["filterLoad"+filterClass]=urlAll;$scope.preloadNextTab()}}$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).fadeIn("fast")});$scope.scrollTo($scope.idData,"");$scope.hasFilter=true;return false};$scope.setFilterDateNow=function($event,filterDateNow,force){var checkedbox=false;if($event){var checkbox=$event.target;if($scope.firstAction&&$scope.firstAction=="DATENOW"){if(checkbox.checked){checkedbox=false}else{checkedbox=true}}else{checkedbox=checkbox.checked}}else{var checkedbox=true}$scope.scrollTo($scope.scrollId,"");$scope.filterMain=false;$scope.filterDateAlways=false;if(checkedbox==true){$scope.filterDateAlways=filterDateNow}angular.element("#content-"+$scope.idData).fadeOut("fast",function(){$scope.s
3afeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).fadeIn("fast")});return false};$scope.scrollTo=function(dataslide,plus,newSpeed){var speed=500;if(newSpeed){speed=newSpeed}angular.element("html,body").animate({scrollTop:0},speed)};$scope.show_plus=function(item){if(angular.isUndefined(item.show_plus)){item.show_plus=true}else if(item.show_plus==true){item.show_plus=false}else{item.show_plus=true}};$scope.show_hide_text=function(item){if(angular.isUndefined(item.show_text)){item.show_text=true}else if(item.show_text==true){item.show_text=false}else{item.show_text=true}};$scope.get_plus_icon=function(item){var icon="icon-plus";if(!angular.isUndefined(item.show_plus)&&item.show_plus==true){icon="icon-minus"}return icon};$scope.setSearch=function(maintainFilters,maintainDate,clearFilters){if(!maintainFilters&&!maintainDate){$scope.clearFilters()}var elm=angular.element(event.srcElement);if(event.keyCode==13){$scope.setFilterSearch(elm[0].value,maintainFilters,maintainDate)}else{setTimeout(function(){if(elm[0].value.length<1){setTimeout(function(){$scope.setFilterSearch("",maintainFilters,maintainDate)},300)}else if(elm[0].value.length>2&&elm[0].value!=$scope.query){setTimeout(function(){$scope.setFilterSearch(elm[0].value,maintainFilters,maintainDate)},300)}},200)}};$scope.setDateFrom=function(newDate){if(newDate){var dateNew=newDate.toISOString().substring(0,10);$scope.setFilterDate(">=,"+dateNew)}};$scope.setDateTo=function(newDate){if(newDate){var dateNew=newDate.toISOString().substring(0,10);$scope.setFilterDate2("<=,"+dateNew)}};$scope.clearFilters=function(all){angular.element("#content-"+$scope.idData+"-tabs .items-tab").hide();$scope.dateFrom.value="";$scope.dateTo.value="";$(".filters-select").removeClass("active");$(".filters-input").val("");$(".filters-default").addClass("active");if(all){$(".filter-input-search").val("");$scope.setFilterSearch("")}$scope.hasFilter=false};$scope.showGroupByIndex=function(groupItem,item){};$scope.getIndex=function(item){return $scope.pagedItemsLoaded.indexOf(item)};$scope.openMediaItemInOverlay=function(item,overlayName){$("#"+overlayName+" .item-info-icon i").removeAttr("class").attr("class","");$("#"+overlayName+" .item-info-icon i").addClass("UIcon");$("#"+overlayName+" .item-info-icon i").addClass("UIcon-"+item.media_type);$("#"+overlayName+" .md-item-title").html(item.title);$("#"+overlayName+" .md-item-info").removeAttr("class").attr("class","").addClass("md-item-info");$("#"+overlayName+" .md-item-info").addClass("file-"+item.extension);$("#"+overlayName+" .item-info-type").html(item.extension);$("#"+overlayName+" .item-info-size").html(item.filesize);if(item.class==1){$("#"+overlayName+" .md-preview-media").html('<img src="'+item.media.thumb+'" class="item-img">')}else if(item.class==2){if(item.media.embed){var mediaFile=item.media.embed}else{var mediaFile=item.media.source}if(mediaFile.substr(-3,3)=="mp4"){$("#"+overlayName+" .md-preview-media").html('<video width="100%" controls controlsList="nodownload"> <source src="'+mediaFile+'" type="video/mp4"></video>')}else{$("#"+overlayName+" .md-preview-media").html('<iframe width="100%" height="100%" src="'+mediaFile+'"> </iframe>')}}$("#"+overlayName+" .md-preview-link a").attr("href",item.media.source);$rootScope.$on("site:modal-close-preview",function(){$timeout(function(){$("#modal-preview .md-preview-media").html("")},0)});$rootScope.openModal(overlayName,"","","preview")};$scope.destroy=function(id,reload){$("#"+id).removeClass("md-show");$("#"+id+" .md-preview-media").html("");$timeout(function(){$scope.safeApply(function(){initVars()})},0);if(reload){$window.location.reload()}};$scope.dateFromOpen=function(){if(!$scope.dateFrom.watched){$scope.$watch("dateFrom.value",function(newDate){$scope.dateFrom.watched=true;$scope.setDateFrom(newDate)})}$scope.dateFrom.opened=true};$scope.dateToOpen=function(){if(!$scope.dateTo.watched){$scope.$watch("dateTo.value",function(newDate){$scope.dateTo.watched=true;$scope.setDateTo(newDate)})}$scope.dateTo.opened=true};$scope.imgBackgroundOverlay=function(item){var returnArray={};var returnImg="";if(!angular.isUndefined(item.extraClass)){if($scope.searchContains(item.extraClass,"overlay")||$scope.searchContains(item.extraClass,"large")||angular.element("#angular-news").hasClass("galleries")){if(CommonFactory.isMobile()){returnImg=item.mediaMobile}else{if($scope.searchContains(item.extraClass,"large")||angular.element("#angular-news").hasClass("galleries")){returnImg=item.media}else{returnImg=item.mediaExtra}}}}if(returnImg){returnArray={"background-image":"url("+returnImg+")"}}return returnArray};$scope.showHideFilters=function(){angular.element("body").toggleClass("hidden-related");
3angular.element(".show-hide-filters").toggleClass("open");return false};$scope.showFilters=function(){angular.element("body").removeClass("hidden-related");angular.element(".show-hide-filters").removeClass("open");return false};$scope.hideFilters=function(){angular.element("body").addClass("hidden-related");angular.element(".show-hide-filters").addClass("open");return false};$scope.isFiltered=function(itemId){if(!angular.isUndefined($scope.filtersCollapse[itemId])&&$scope.filtersCollapse[itemId]){return true}else{return false}};$scope.toggleCollapse=function(itemId){if(!angular.isUndefined($scope.filtersCollapse[itemId])&&$scope.filtersCollapse[itemId]){$scope.filtersCollapse[itemId]=false}else{$scope.filtersCollapse[itemId]=true}};$scope.toggleFilterColumn=function(){if(angular.element("body").hasClass("hidden-related")){angular.element("body").removeClass("hidden-related")}else{angular.element("body").addClass("hidden-related")}};$scope.openMediaItem=function(item){$scope.currentItem=item;angular.element(".main-view").addClass("hidden");angular.element(".details-view").removeClass("hidden");var hashParams=$scope.getHashParams();hashParams.id=item.id;$scope.setHashParams(hashParams);$scope.setVideoConfig(item);$scope.scrollTo($scope.idData,"");$scope.changeView("media");$scope.resizeVideoYt()};$scope.closeMediaItem=function(){if($scope.currentView=="media"){$scope.changeView()}angular.element(".details-view").addClass("hidden");angular.element(".main-view").removeClass("hidden");var hashParams=$scope.getHashParams();delete hashParams.id;$scope.setHashParams(hashParams);$scope.currentItem=undefined};$scope.setVideoConfig=function(item){if($scope.currentItem.class==2){var videoSource=[{src:$scope.currentItem.media.source,type:"video/mp4"}];$scope.configvideo={preload:"none",autoPlay:$scope.autoPlay,sources:videoSource,plugins:{controls:{autoHide:true,autoHideTime:5e3}},yt:"rel=0;showinfo=0;autoplay="+$scope.autoPlay};if($scope.currentItem.extension=="fileextension_yt"&&$scope.autoPlay){$scope.configvideo.autoPlay=false}}};$scope.changeView=function(newView){if(!newView){if($scope.currentView=="search"&&!$scope.eSearch.searched){$scope.previewView="";if($scope.eventSelected){$scope.currentView="mediaList"}else{$scope.currentView="gallery"}}else{var curView=$scope.currentView;$scope.currentView=angular.copy($scope.previewView);$scope.previewView=curView}}else if(newView!=$scope.currentView){$scope.previewView=angular.copy($scope.currentView);$scope.currentView=newView}};$scope.safeApply($scope.startGalleries())};$scope.setCurrentItemFromId=function(){angular.forEach($scope.items,function(item){if(item.id==$scope.currentItemId){$scope.currentItemId="";$scope.openMediaItem(item)}})};$rootScope.onPlayerReady=function(API){$rootScope.playerAPI=API};$rootScope.onCompleteVideo=function(){};$scope.closeModalData=function(modalName,modalEmit){if(modalEmit){$rootScope.$emit("site:modal-close-"+modalEmit)}else{$scope.currentModalData=""}if($rootScope.playerAPI){$rootScope.playerAPI.stop()}var modalEl=document.querySelector("#"+modalName);classie.remove(modalEl,"md-show")};$scope.maxHeightModal=function(){var h=window.innerHeight;var h2=h*80/100;return{"max-height":h2}};$scope.modalAction=function(action){if(action=="goToUrl"){if($scope.urlToGo){location.href=$scope.urlToGo}else{location.href=$scope.currentModalData.url}}};$scope.resizeVideoYt=function(){$timeout(function(){var playerContainer=$("vg-media");var w=playerContainer.width();var h=parseInt(w*1*9/16);playerContainer.height(h-1);var playerContainer2=$("#ytplayer");var w2=playerContainer2.width();var h2=parseInt(w2*1*9/16);playerContainer2.height(h2-1)})};$scope.vidPlayerReady=function(API){$scope.videoAPI=API};$scope.vidStop=function(){$scope.videoAPI.pause();return true};$scope.autoLinker=function(text){return Autolinker.link(text)}}]);angular.module("Mediahub").controller("MediahubController",function($http,$scope,$q,$rootScope,$resource,$sce,$timeout,$location,$cookies){var vm=this;vm.debug={};vm.galleriesRaw=[];vm.galleriesTree=[];vm.galleriesById={};vm.galleryItems=[];vm.mediaItems=[];vm.searchedItems=null;vm.currentItems=[];vm.pagination=null;vm.cursorHistory={};vm.selectedMedia=null;vm.mimirClips=[];vm.isLoadingClips=false;vm.activeBreadcrumbs=[];vm.filterYear="";vm.filterTag="";vm.tags={};vm.selectedTags={};vm.excludedTags={};vm.searchQuery="";vm.activeSearchQuery="";vm.filterMediaType="";vm.mediaTypes={label:"Media Type",options:[{id:1,name:"Images"},{id:2,name:"Videos"},{id:3,name:"Audios"},{id:4,name:"Files"}],isOpen:false};vm.currentType="all";vm.showSidebar=true;vm.showFilters=false;vm.galleryViewMode="tree";vm.cardViewPath=[];vm.cardViewGalleries=[];vm.isLoadMore=false;vm.loadingMore=false;vm.selection=[];vm.authToken=null;vm.filtersDirty=false;vm.batchJobs=[];vm.downloadTermsAccepted=false;vm.pendingDownload=null;vm.lastAppliedSearchQuery="";vm.lastAppliedFilterTag="";vm.lastAppliedSelectedTags={};vm.lastAppliedExcludedTags={};vm.lastAppliedFilterMediaType="";vm.lastAppliedFilterYear="";$scope.$watch(function(){return vm.canUpdateSearch()},function(newVal){vm.filtersDirty=!!newVal});vm.resultsPerPageOptions=[10,20,50,100,200];vm.resultsPerPageOptionsOpen=false;vm.changeResultsPerPage=function(){vm.isLoading=true;if(vm.searchedItems){vm.performSearch(1)}else if(vm.selectedGallery){vm.selectGallery(vm.selectedGallery,1)}else{vm.listMedia()}};var filterLabels={filterYear:"Year",filterMediaType:"Type"};vm.init=function(base64){vm.cfg=JSON.parse(atob(base64));vm.widgetId=vm.cfg.widgetId||"default";if(vm.cfg.enableFilters&&vm.cfg.filtersOpenByDefault){vm.showFilters=true}vm.cfg.hideSortInfo=!!vm.cfg.hideSortInfo;vm.cfg.hideResultsPerPage=!!vm.cfg.hideResultsPerPage;vm.cfg.hideSortOptions=!!vm.cfg.hideSortOptions;vm.cfg.hideSortDirection=!!vm.cfg.hideSortDirection;console.log("Mediahub Config:",vm.cfg);if(vm.cfg.resultsPerPageOptions&&typeof vm.cfg.resultsPerPageOptions==="string"&&vm.cfg.resultsPerPageOptions.trim()!==""){console.log("Parsing custom results per page options:",vm.cfg.resultsPerPageOptions);var customOptions=vm.cfg.resultsPerPageOptions.split("|").map(function(o){return parseInt(o.trim(),10)}).filter(function(o){return!isNaN(o)});if(customOptions.length>0){console.log("Custom options parsed:",customOptions);vm.resultsPerPageOptions=customOptions}}var unbindCloseListener=$rootScope.$on("site:modal-close-mediahub-preview-"+vm.widgetId,function(){vm.selectedMedia=null;$location.search("media_id",null);vm.stopClipsPolling();if(!$scope.$$phase)$scope.$apply()});$scope.$on("$destroy",function(){if(unbindCloseListener)unbindCloseListener();vm.stopClipsPolling()});vm.resultsPerPage=vm.cfg.resultsPerPage||0;vm.sortField="dateUploaded";vm.sortDir="DESC";console.log("$rootScope.currentUser",$rootScope.currentUser);console.log("vm.cfg",vm.cfg);vm.isLoadMore=vm.cfg.paginationType==="Load More";vm.tags=vm.cfg.tags||{};vm.selectedTags={};vm.excludedTags={};vm.isLoading=true;vm.getAuthToken().then(function(response){vm.authToken=response.token}).finally(function(){_finishInit()});function _finishInit(){var apiUrl=vm.cfg.apiUrl||"";var tenant=vm.cfg.apiTenant||"";var headers=getCommonHeaders();var galleriesEndpoint=apiUrl+"/galleries";if(vm.cfg.mainGallery&&parseInt(vm.cfg.mainGallery,10)>0){galleriesEndpoint=apiUrl+"/galleries/"+vm.cfg.mainGallery+"/children?recursive=true"}vm.resourceListGalleries=$resource(galleriesEndpoint,{},{get:{method:"GET",headers:headers},save:{method:"POST",headers:headers}});vm.resourceListMedia=$resource(apiUrl+"/media",{},{get:{method:"GET",headers:headers}});if(vm.cfg.defaultTags&&angular.isArray(vm.cfg.defaultTags)&&vm.cfg.defaultTags.length>0){vm.filterTag=vm.cfg.defaultTags[0];vm.lastAppliedFilterTag=vm.filterTag}if(vm.cfg.galleryType==="Grid galleries"){vm.galleryViewMode="cards"}else{vm.galleryViewMode="tree"}function deepCleanse(data){if(!data||!vm.cfg.cleansingMap)return data;if(typeof data==="string"){var cleansed=data;
3Object.keys(vm.cfg.cleansingMap).forEach(function(target){var replacement=vm.cfg.cleansingMap[target];cleansed=cleansed.split(target).join(replacement)});return cleansed}if(Array.isArray(data)){return data.map(function(item){return deepCleanse(item)})}if(typeof data==="object"){var cleansedObj={};Object.keys(data).forEach(function(key){cleansedObj[key]=deepCleanse(data[key])});return cleansedObj}return data}if(vm.cfg.latestOptions==="Videos"){vm.currentType="video"}else if(vm.cfg.latestOptions==="None"){vm.currentType="all"}else{vm.currentType="image"}var initPromises=[];if(!vm.cfg.hideLayout){initPromises.push(vm.listMedia());if(vm.cfg.galleryType!=="No galleries"){initPromises.push(vm.listGalleries())}}$q.all(initPromises).finally(function(){vm.isLoading=false;var searchParams=$location.search();if(searchParams.gallery_id&&vm.cfg.galleryType!=="No galleries"){var checkGalleriesLoaded=function(){if(vm.galleriesById&&vm.galleriesById[searchParams.gallery_id]){vm.selectGallery(vm.galleriesById[searchParams.gallery_id])}else if(!vm.isLoading){$timeout(checkGalleriesLoaded,100)}};checkGalleriesLoaded()}if(searchParams.media_id){var checkMediaLoaded=function(){var allItems=(vm.mediaItems||[]).concat(vm.galleryItems||[]).concat(vm.searchedItems||[]);var media=allItems.find(function(m){return m&&m.id==searchParams.media_id});if(media){vm.openMedia(media)}else if(vm.isLoading){$timeout(checkMediaLoaded,200)}else{$http.get(apiUrl+"/media/"+searchParams.media_id,{headers:getCommonHeaders()}).then(function(response){if(response.data&&response.data.success&&response.data.data){var fullMedia=normalizeMediaItem(deepCleanse(response.data.data));vm.openMedia(fullMedia)}})}};checkMediaLoaded()}})}};function getCommonHeaders(){var tenant=vm.cfg&&vm.cfg.apiTenant?vm.cfg.apiTenant:"";var headers={"X-Tenant":tenant};if(vm.authToken){headers["X-Auth-Token"]=vm.authToken}return headers}vm.openMedia=function(media){vm.selectedMedia=null;$timeout(function(){vm.selectedMedia=angular.copy(media);var initialIsMimir=media.externalSource==="mimir"||media.raw&&media.raw.imageUrl&&media.raw.imageUrl.indexOf("mimir")!==-1;if(initialIsMimir)vm.selectedMedia.externalSource="mimir";vm.selectedMedia.videoUrl=media.videoUrl||(initialIsMimir&&media.raw&&media.raw.previewUrl?$sce.trustAsResourceUrl(media.raw.previewUrl):null);vm.selectedMedia.isLoadingDetails=true;if(media.source==="iconik"){vm.selectedMedia.isLoadingDetails=false;if(media.source==="iconik"&&media.mediaType!="image"&&media.proxyUrl){vm.getIconikProxy(media).then(function(download_url){if(download_url&&vm.selectedMedia){vm.selectedMedia.videoUrl=$sce.trustAsResourceUrl(download_url)}})}}else{var detailsParams={headers:getCommonHeaders()};if(vm.isMimir(media)){detailsParams.params={refreshExternal:true}}$http.get(vm.cfg.apiUrl+"/media/"+media.id,detailsParams).then(function(response){if(response.data&&response.data.success&&response.data.data){var rawData=deepCleanse(response.data.data);var fullMedia=normalizeMediaItem(rawData);if(vm.selectedMedia.previewUrl&&fullMedia.previewUrl){fullMedia.previewUrl=vm.selectedMedia.previewUrl}angular.extend(vm.selectedMedia,fullMedia);var isDocument=fullMedia.extension&&["DOC","DOCX","PDF","XLS","XLSX","PPT","PPTX","ZIP","RAR","7Z"].indexOf(fullMedia.extension.toUpperCase())>-1;if(fullMedia.previewUrl&&!isDocument){if(fullMedia.mediaType==="video"||fullMedia.largeUrl&&fullMedia.largeUrl.toLowerCase().indexOf("mimir")!==-1){vm.selectedMedia.mediaType="video";vm.selectedMedia.videoUrl=$sce.trustAsResourceUrl(fullMedia.previewUrl)}}var isMimir=fullMedia.largeUrl&&fullMedia.largeUrl.toLowerCase().indexOf("mimir")!==-1||vm.selectedMedia&&vm.selectedMedia.externalSource==="mimir";if((fullMedia.mediaType==="video"||isMimir)&&!isDocument){vm.selectedMedia.mediaType="video";if(isMimir){vm.selectedMedia.externalSource="mimir";var parentFileId=fullMedia.externalId||fullMedia.raw&&fullMedia.raw.externalId||fullMedia.id;vm.startClipsPolling(parentFileId)}vm.selectedMedia.duration=0;vm.segmentState={start:0,end:0,startMin:"00",startSec:"00",endMin:"00",endSec:"00"};if(!vm.selectedMedia.videoUrl){if(fullMedia.largeUrl&&!fullMedia.isUnsupportedVideo){vm.selectedMedia.videoUrl=$sce.trustAsResourceUrl(fullMedia.largeUrl)}else if(fullMedia.isUnsupportedVideo){vm.selectedMedia.videoUrl=null;console.log("Mediahub: Unsupported video format. Disabling player and showing thumbnail.")}}$timeout(function(){var video=document.getElementById("mh-video-player");if(video){var onMetadata=function(){$scope.$apply(function(){vm.selectedMedia.duration=video.duration;$timeout(function(){vm.segmentState.end=video.duration;vm.updateInputsFromSegment()},50)});video.removeEventListener("loadedmetadata",onMetadata)};var onTimeUpdate=function(){if(vm.selectedMedia&&vm.selectedMedia.externalSource==="mimir"&&vm.segmentState){if(video.currentTime>=vm.segmentState.end){video.pause();video.currentTime=vm.segmentState.end;$scope.$apply()}}};video.addEventListener("loadedmetadata",onMetadata);video.addEventListener("timeupdate",onTimeUpdate);if(video.duration&&video.duration>0)onMetadata();var unbindModal=$rootScope.$on("modalClosed",function(){if(video){video.removeEventListener("timeupdate",onTimeUpdate)}unbindModal()})}},500)}console.log("vm.selectedMedia final state:",vm.selectedMedia)}}).catch(function(err){console.error("Error fetching media details:",err)}).finally(function(){if(vm.selectedMedia)vm.selectedMedia.isLoadingDetails=false})}$rootScope.openModal("modal-preview-mediahub-"+vm.widgetId,null,null,"mediahub-preview-"+vm.widgetId)});$location.search("media_id",media.id)};vm.pad2=function(n){return(n<10?"0":"")+n};vm.formatTime=function(seconds){if(!seconds||isNaN(seconds))return"00:00";var min=Math.floor(seconds/60);var sec=Math.floor(seconds%60);return vm.pad2(min)+":"+vm.pad2(sec)};vm.updateInputsFromSegment=function(){vm.segmentState.startMin=vm.pad2(Math.floor(vm.segmentState.start/60));vm.segmentState.startSec=vm.pad2(Math.floor(vm.segmentState.start%60));vm.segmentState.endMin=vm.pad2(Math.floor(vm.segmentState.end/60));vm.segmentState.endSec=vm.pad2(Math.floor(vm.segmentState.end%60))};vm.updateSegmentFromInputs=function(){var startMin=parseInt(vm.segmentState.startMin,10)||0;var startSec=parseInt(vm.segmentState.startSec,10)||0;var endMin=parseInt(vm.segmentState.endMin,10)||0;var endSec=parseInt(vm.segmentState.endSec,10)||0;vm.segmentState.start=startMin*60+startSec;vm.segmentState.end=endMin*60+endSec;if(vm.selectedMedia&&vm.selectedMedia.duration){if(vm.segmentState.start<0)vm.segmentState.start=0;if(vm.segmentState.end>vm.selectedMedia.duration)vm.segmentState.end=vm.selectedMedia.duration}var video=document.getElementById("mh-video-player");if(video){video.currentTime=vm.segmentState.start;video.pause()}};vm.onSegmentSliderChange=function(type){var start=parseFloat(vm.segmentState.start);var end=parseFloat(vm.segmentState.end);if(type==="start"&&start>end){vm.segmentState.start=end}else if(type==="end"&&end<start){vm.segmentState.end=start}vm.updateInputsFromSegment();var video=document.getElementById("mh-video-player");if(video){video.currentTime=type==="start"?vm.segmentState.start:vm.segmentState.end;video.pause()}};vm.getSegmentHighlightStyle=function(){if(!vm.selectedMedia||!vm.selectedMedia.duration)return{};var left=vm.segmentState.start/vm.selectedMedia.duration*100;var width=(vm.segmentState.end-vm.segmentState.start)/vm.selectedMedia.duration*100;return{left:left+"%",width:width+"%"}};vm.previewSegment=function(){var video=document.getElementById("mh-video-player");if(video){video.currentTime=vm.segmentState.start;video.play()}};vm.getIconikProxy=function(media){if(!vm.cfg||!vm.cfg.iconikUrl||!media.proxyUrl)return $q.resolve(null);var baseUrl=vm.cfg.iconikUrl;var url=baseUrl;if(url.slice(-1)==="/"&&media.proxyUrl.slice(0,1)==="/"){url=url.slice(0,-1)}else if(url.slice(-1)!=="/"&&media.proxyUrl.slice(0,1)!=="/"){url+="/"}var finalUrl=url+media.proxyUrl;return performXhr("GET",finalUrl,null).then(function(response){response=deepCleanse(response);console.log("Iconik Proxy Response:",response);if(response&&(response.downloadUrl||response.download_url)){return response.downloadUrl||response.download_url}return null}).catch(function(err){console.error("Error fetching iconik proxy:",err);return null})};vm.changeType=function(type){if(vm.cfg.hideLayout)return;vm.selectedGallery=null;vm.searchedItems=null;resetItems();$location.search("gallery_id",null);vm.currentType=type;vm.listMedia()};vm.applySort=function(){if(vm.searchedItems){vm.performSearch()}else if(vm.selectedGallery){vm.selectGallery(vm.selectedGallery)}else{vm.listMedia()}};vm.toggleSort=function(){vm.sortDir=vm.sortDir==="DESC"?"ASC":"DESC";vm.applySort()};vm.listMedia=function(){vm.isLoading=true;vm.cursorHistory={};var p1=vm.cfg&&vm.cfg.vertexUrl?vm.listVertex(1,vm.currentType):$q.resolve([]);var p2=vm.cfg&&vm.cfg.iconikUrl?vm.listIconik(1,vm.currentType):$q.resolve([]);var p3=vm.cfg&&vm.cfg.apiUrl?vm.listApi(1,vm.currentType):$q.resolve({items:[]});return $q.all([p1,p2,p3]).then(function(results){var vertexItems=results[0]||[];var iconikItems=results[1]||[];var apiData=results[2]||{items:[]};var apiItems=apiData.items||[];vm.mediaItems=vertexItems.concat(iconikItems).concat(apiItems);console.log("vm.mediaItems",vm.mediaItems);vm.pagination=null;vm.updateCurrentItems()}).finally(function(){vm.isLoading=false})};vm.listVertex=function(page){return $q.resolve([])};vm.listIconik=function(page,type){if(!vm.cfg||!vm.cfg.iconikUrl)return $q.resolve([]);page=page||1;var pageSize=vm.resultsPerPage;var baseUrl=vm.cfg.iconikUrl;var params=[];if(page)params.push("page="+page);if(pageSize)params.push("per_page="+pageSize);if(type!=="all"&&type!==""){var iconikType=type;if(type===1||type==="image")iconikType="image";else if(type===2||type==="video")iconikType="video";else if(type===3||type==="audio")iconikType="audio";else if(type===4||type==="file")iconikType="other";params.push("type="+iconikType)}params.push("sort="+(vm.sortField==="fileDate"?"date_created":"name"));params.push("order="+(vm.sortDir?vm.sortDir.toLowerCase():"desc"));var url=baseUrl+"search?"+params.join("&");return performXhr("GET",url,null).then(function(response){response=deepCleanse(response);console.log("Iconik List Media Response:",response);var items=response.items||[];
3return items.map(normalizeIconikSearchItem).filter(Boolean)}).catch(function(err){console.error("Iconik search error",err);return[]})};vm.listApi=function(page,type){if(!vm.resourceListMedia)return $q.resolve([]);page=page||1;var params={page:page,sortDir:vm.sortDir,sortField:vm.sortField};if(vm.resultsPerPage>0){params.resultsPerPage=vm.resultsPerPage}var targetGalleryId=vm.cfg&&vm.cfg.mainGallery?vm.cfg.mainGallery:null;if(type!=="all"&&type!==""){if(type==="video"||type===2){params.mediaType=2;if(vm.cfg&&vm.cfg.latestVideosGallery&&parseInt(vm.cfg.latestVideosGallery,10)>0){targetGalleryId=vm.cfg.latestVideosGallery}}else if(type==="audio"||type===3)params.mediaType=3;else if(type==="file"||type===4)params.mediaType=4;else{params.mediaType=1;if(vm.cfg&&vm.cfg.latestPhotosGallery&&parseInt(vm.cfg.latestPhotosGallery,10)>0){targetGalleryId=vm.cfg.latestPhotosGallery}}}if(targetGalleryId&&parseInt(targetGalleryId,10)>0){params.galleryId=targetGalleryId}if(page>1){var token=vm.cursorHistory[page]||(vm.pagination?vm.pagination.nextCursor||vm.pagination.cursor:null);if(token)params.cursor=token}var mediaPromise=vm.resourceListMedia.get(params).$promise;var feedsPromise=$q.resolve({data:[]});if(vm.cfg&&vm.cfg.apiUrl&&targetGalleryId&&parseInt(targetGalleryId,10)>0&&page===1){var feedsUrl=vm.cfg.apiUrl+"/feeds/gallery/"+targetGalleryId;feedsPromise=$http.get(feedsUrl,{headers:getCommonHeaders()}).catch(function(err){console.warn("API /feeds/gallery/"+targetGalleryId+" error",err);return{data:[]}})}return $q.all([mediaPromise,feedsPromise]).then(function(results){var mediaResponse=deepCleanse(results[0]);var feedsResponse=deepCleanse(results[1]);console.log("API List Media Response:",mediaResponse);console.log("API List Feeds Response:",feedsResponse);var mediaItemsData=mediaResponse.data||mediaResponse.items||mediaResponse.results||(Array.isArray(mediaResponse)?mediaResponse:[]);var feedsItemsData=feedsResponse.data&&feedsResponse.data.data?feedsResponse.data.data:feedsResponse.data&&feedsResponse.data.items?feedsResponse.data.items:Array.isArray(feedsResponse.data)?feedsResponse.data:[];var combinedItems=[];if(Array.isArray(mediaItemsData))combinedItems=combinedItems.concat(mediaItemsData);var mappedItems=combinedItems.map(normalizeMediaItem).filter(Boolean);var pag=mediaResponse.pagination||mediaResponse;var currentPage=pag.page||page||1;var nToken=pag.nextCursor||pag.cursor;if(nToken)vm.cursorHistory[currentPage+1]=nToken;var hasTotal=pag.totalItems!==undefined||pag.total_items!==undefined||pag.total!==undefined;var totalItems=pag.totalItems||pag.total_items||pag.total||mediaItemsData.length;var rpp=pag.resultsPerPage||pag.results_per_page||vm.resultsPerPage||0;return{items:mappedItems,pagination:hasTotal||pag.hasNextPage||pag.hasNext?{totalItems:totalItems,totalPages:pag.totalPages||pag.total_pages||(rpp>0?Math.ceil(totalItems/rpp):1)||1,page:pag.page||1,hasNext:pag.hasNextPage||pag.hasNext,hasPrev:pag.hasPreviousPage||pag.hasPrev,nextCursor:pag.nextCursor||pag.cursor,cursor:pag.nextCursor||pag.cursor}:null}}).catch(function(err){console.error("API media list error",err);return{items:[],pagination:null}})};vm.listGalleries=function(){if(!vm.resourceListGalleries||!vm.cfg.apiUrl)return;vm.isLoading=true;var standardGalleriesPromise=vm.resourceListGalleries.get({resultsPerPage:1e3}).$promise;var feedsUrl=vm.cfg.apiUrl+"/feeds/libraries";var feedsGalleriesPromise=$http.get(feedsUrl,{headers:getCommonHeaders()}).then(function(res){return res.data&&res.data.data?res.data.data:res.data&&res.data.items?res.data.items:Array.isArray(res.data)?res.data:[]}).catch(function(err){console.warn("Error fetching feeds libraries:",err);return[]});return $q.all([standardGalleriesPromise,feedsGalleriesPromise]).then(function(results){var response=deepCleanse(results[0]);var feedsData=deepCleanse(results[1]);console.log("Galleries API Response:",response);console.log("Feeds API Response:",feedsData);var data=response.data&&response.data.items?response.data.items:response.data||response.items||response.results||(Array.isArray(response)?response:[]);if(!Array.isArray(data))data=[];var combinedGalleries=data.concat(feedsData);
3vm.galleriesRaw=combinedGalleries.map(normalizeGallery).filter(Boolean);var coverPromises=[];vm.galleriesRaw.forEach(function(g){if(g.coverId&&!g.cover_url){var apiUrl=vm.cfg.apiUrl||"";var p=$http.get(apiUrl+"/media/"+g.coverId,{headers:getCommonHeaders()}).then(function(response){if(response.data&&response.data.success&&response.data.data){var media=normalizeMediaItem(deepCleanse(response.data.data));g.cover_url=media.thumbUrl||media.largeUrl||""}}).catch(function(err){console.warn("Error fetching gallery cover:",err)});coverPromises.push(p)}});return $q.all(coverPromises).then(function(){var treeData=buildGalleryTree(vm.galleriesRaw);vm.galleriesTree=treeData.roots;vm.galleriesById=treeData.byId;vm.cardViewPath=[];vm.cardViewGalleries=vm.galleriesTree})}).catch(function(err){console.error("Error fetching galleries:",err)}).finally(function(){vm.isLoading=false})};vm.navigateCardGallery=function(gallery){var node=vm.galleriesById[gallery.id]||gallery;vm.selectGallery(node);if(node.children&&node.children.length){if(vm.cardViewPath.length===0||vm.cardViewPath[vm.cardViewPath.length-1].id!==node.id){vm.cardViewPath.push(node)}vm.cardViewGalleries=node.children}$timeout(function(){var element=document.querySelector(".mh-preview-body");var header=document.querySelector("#header");if(element){var headerHeight=header?header.offsetHeight:0;var elementPosition=element.getBoundingClientRect().top+window.pageYOffset;var offsetPosition=elementPosition-headerHeight;if(typeof $!=="undefined"){$("html, body").stop(true).animate({scrollTop:offsetPosition},500)}else{window.scrollTo({top:offsetPosition,behavior:"smooth"})}}},500)};vm.cardBreadcrumbNavigate=function(index){if(index===-1){vm.cardViewPath=[];vm.cardViewGalleries=vm.galleriesTree;vm.selectedGallery=null;vm.searchedItems=null;resetItems();$location.search("gallery_id",null);vm.isLoading=true;document.body.classList.remove("in-search");vm.listMedia().finally(function(){vm.isLoading=false})}else{var node=vm.cardViewPath[index];vm.cardViewPath=vm.cardViewPath.slice(0,index+1);vm.cardViewGalleries=node.children}};function expandParents(nodeId){if(!vm.galleriesById)return;var node=vm.galleriesById[nodeId];while(node&&node.parentId){var parent=vm.galleriesById[node.parentId];if(parent){parent.expanded=true;node=parent}else{break}}}function reconstructCardPath(nodeId){if(!vm.galleriesById)return[];var path=[];var current=vm.galleriesById[nodeId];while(current&¤t.parentId&&vm.galleriesById[current.parentId]){var parent=vm.galleriesById[current.parentId];path.unshift(parent);current=parent}return path}vm.selectGallery=function(node,page){if(!node||!vm.resourceListMedia||vm.cfg.hideLayout)return;page=page||1;if(page===1||vm.selectedGallery!==node){vm.cursorHistory={}}resetItems();vm.selectedGallery=node;vm.filterGallery=node.name;vm.searchedItems=null;expandParents(node.id);if(vm.galleryViewMode==="cards"&&(!vm.cardViewPath||vm.cardViewPath.length===0)){vm.cardViewPath=reconstructCardPath(node.id);if(node.children&&node.children.length>0){vm.cardViewGalleries=node.children}}vm.isLoading=true;var params={galleryId:node.id,page:page,sortDir:vm.sortDir,sortField:vm.sortField};if(vm.resultsPerPage>0){params.resultsPerPage=vm.resultsPerPage}if(vm.currentType&&vm.currentType!=="all"&&vm.currentType!==""){if(vm.currentType==="video"||vm.currentType===2)params.mediaType=2;else if(vm.currentType==="audio"||vm.currentType===3)params.mediaType=3;else if(vm.currentType==="file"||vm.currentType===4)params.mediaType=4;else params.mediaType=1}if(page>1){var token=vm.cursorHistory[page]||(vm.pagination?vm.pagination.nextCursor||vm.pagination.cursor:null);if(token)params.cursor=token}var mediaPromise=vm.resourceListMedia.get(params).$promise;var feedsPromise=$q.resolve({data:[]});if(vm.cfg&&vm.cfg.apiUrl&&page===1){var feedsUrl=vm.cfg.apiUrl+"/feeds/gallery/"+node.id;feedsPromise=$http.get(feedsUrl,{headers:getCommonHeaders()}).catch(function(err){console.warn("API /feeds/gallery/"+node.id+" error",err);return{data:[]}})}$q.all([mediaPromise,feedsPromise]).then(function(results){var response=deepCleanse(results[0]);var feedsResponse=deepCleanse(results[1]);console.log("Gallery Media Response:",response);console.log("Gallery Feeds Response:",feedsResponse);var mediaData=response.data||response.items||response.results||(Array.isArray(response)?response:[]);var feedsData=feedsResponse.data&&feedsResponse.data.data?feedsResponse.data.data:feedsResponse.data&&feedsResponse.data.items?feedsResponse.data.items:Array.isArray(feedsResponse.data)?feedsResponse.data:[];var combinedItems=[];if(Array.isArray(mediaData))combinedItems=combinedItems.concat(mediaData);
3var newItems=combinedItems.map(normalizeMediaItem).filter(Boolean);if(vm.isLoadMore&&page>1){vm.galleryItems=vm.galleryItems.concat(newItems)}else{vm.galleryItems=newItems}var pag=response.pagination||response;var currentPage=pag.page||page||1;var nToken=pag.nextCursor||pag.cursor;if(nToken)vm.cursorHistory[currentPage+1]=nToken;var hasTotal=pag.totalItems!==undefined||pag.total_items!==undefined||pag.total!==undefined;var totalItems=pag.totalItems||pag.total_items||pag.total||mediaData.length;if(hasTotal||pag.hasNextPage||pag.hasNext){var rpp=pag.resultsPerPage||pag.results_per_page||vm.resultsPerPage||0;vm.pagination={totalItems:totalItems,totalPages:pag.totalPages||pag.total_pages||(rpp>0?Math.ceil(totalItems/rpp):1)||1,page:pag.page||page||1,hasNext:pag.hasNextPage||pag.hasNext,hasPrev:pag.hasPreviousPage||pag.hasPrev,nextCursor:pag.nextCursor||pag.cursor,cursor:pag.nextCursor||pag.cursor}}else{vm.pagination={totalItems:totalItems,totalPages:1,page:page||1,hasNext:false,hasPrev:false}}vm.updateBreadcrumb();vm.updateCurrentItems();if(page===1&&vm.galleryItems.length>0){$timeout(function(){var element=document.querySelector(".mh-preview-body");var header=document.querySelector("#header");if(element){var headerHeight=header?header.offsetHeight:0;var elementPosition=element.getBoundingClientRect().top+window.pageYOffset;var offsetPosition=elementPosition-headerHeight;if(typeof $!=="undefined"){$("html, body").stop(true).animate({scrollTop:offsetPosition},500)}else{window.scrollTo({top:offsetPosition,behavior:"smooth"})}}},500)}$location.search("gallery_id",node.id)}).catch(function(err){console.error("Error fetching gallery media:",err)}).finally(function(){vm.isLoading=false;vm.loadingMore=false})};vm.exitSearch=function(){document.body.classList.remove("in-search");vm.searchedItems=null;vm.searchQuery="";vm.activeSearchQuery="";vm.filterMediaType="";vm.showFilters=!!(vm.cfg&&vm.cfg.enableFilters&&vm.cfg.filtersOpenByDefault);vm.filterYear="";vm.filterTag="";if(vm.cfg.defaultTags&&vm.cfg.defaultTags.length>0){vm.filterTag=vm.cfg.defaultTags[0]}vm.activeBreadcrumbs=[];vm.pagination=null;vm.lastAppliedSearchQuery="";vm.lastAppliedFilterTag=vm.filterTag;vm.lastAppliedSelectedTags={};vm.lastAppliedExcludedTags={};vm.lastAppliedFilterMediaType="";vm.lastAppliedFilterYear="";vm.selectedTags={};vm.excludedTags={};vm.filtersDirty=false;vm.updateBreadcrumb();vm.listMedia().finally(function(){vm.updateCurrentItems()})};vm.performSearch=function(page){if(vm.cfg.hideSearch)return $q.resolve({items:[]});var query=(vm.searchQuery||"").toLowerCase().trim();var hasFilters=false;if(vm.filterTag&&Array.isArray(vm.filterTag.values)&&vm.filterTag.values.length>0)hasFilters=true;angular.forEach(vm.selectedTags,function(tagIds){if(Array.isArray(tagIds)&&tagIds.length>0)hasFilters=true});if(vm.filterYear||vm.filterMediaType)hasFilters=true;if(!query&&!hasFilters){if(vm.searchedItems&&vm.searchedItems.length>0){vm.exitSearch()}return $q.resolve({items:[]})}document.body.classList.add("in-search");vm.activeSearchQuery=vm.searchQuery;vm.lastAppliedSearchQuery=vm.searchQuery;vm.lastAppliedFilterTag=angular.copy(vm.filterTag);vm.lastAppliedSelectedTags=angular.copy(vm.selectedTags);vm.lastAppliedExcludedTags=angular.copy(vm.excludedTags);vm.lastAppliedFilterMediaType=vm.filterMediaType;vm.lastAppliedFilterYear=vm.filterYear;vm.filtersDirty=false;page=page||1;if(page===1){vm.cursorHistory={};resetItems();vm.searchedItems=[]}vm.isLoading=!(vm.isLoadMore&&page>1);var useVertex=vm.cfg&&vm.cfg.vertexUrl;var useIconik=vm.cfg&&vm.cfg.iconikUrl;var p1=useVertex?vm.vertexSearch(query,vm.resultsPerPage,page>1&&vm.pagination?vm.pagination.nextPageToken:null):$q.resolve({items:[]});var p2=useIconik?vm.iconikSearch(query,page):$q.resolve({items:[]});var p3=!useVertex&&!useIconik&&vm.cfg&&vm.cfg.apiUrl?vm.apiSearch(query,page):$q.resolve({items:[]});$q.all([p1,p2,p3]).then(function(results){var vertexData=results[0]||{items:[],pagination:{}};var vertexItems=vertexData.items||[];var iconikData=results[1]||{items:[],pagination:{}};var iconikItems=iconikData.items||[];var apiData=results[2]||{items:[],pagination:{}};var apiItems=apiData.items||[];var newItems=vertexItems.concat(iconikItems).concat(apiItems);if(vm.isLoadMore&&page>1){vm.searchedItems=vm.searchedItems.concat(newItems)}else{vm.searchedItems=newItems}var apiPag=apiData.pagination||{};if(iconikData.pagination&&(iconikData.pagination.totalItems!==undefined||iconikData.pagination.total_items!==undefined)){vm.pagination={totalItems:iconikData.pagination.totalItems||iconikData.pagination.total_items||0,totalPages:iconikData.pagination.totalPages||iconikData.pagination.total_pages||1,page:iconikData.pagination.page||1,hasNext:iconikData.pagination.hasNext||iconikData.pagination.has_next||false,hasPrev:iconikData.pagination.hasPrev||iconikData.pagination.has_prev||false};if(!vm.pagination.totalPages&&vm.pagination.totalItems){vm.pagination.totalPages=(vm.resultsPerPage>0?Math.ceil(vm.pagination.totalItems/vm.resultsPerPage):1)||1}}else if(apiPag.totalItems!==undefined||apiPag.total_items!==undefined){var rpp=apiPag.resultsPerPage||apiPag.results_per_page||vm.resultsPerPage||0;vm.pagination={totalItems:apiPag.totalItems||apiPag.total_items||0,totalPages:apiPag.totalPages||apiPag.total_pages||(rpp>0?Math.ceil((apiPag.totalItems||apiPag.total_items)/rpp):1)||1,page:apiPag.page||1,hasNext:apiPag.hasNext||apiPag.has_next||false,hasPrev:apiPag.hasPrev||apiPag.has_prev||false,nextCursor:apiPag.nextCursor||apiPag.cursor,cursor:apiPag.nextCursor||apiPag.cursor}}else if(vertexData.pagination&&(vertexData.pagination.totalItems!==undefined||vertexData.pagination.total_items!==undefined||vertexData.pagination.nextPageToken)){var totalVItems=vertexData.pagination.totalItems||vertexData.pagination.total_items||0;vm.pagination={totalItems:totalVItems,totalPages:(vm.resultsPerPage>0?Math.ceil(totalVItems/vm.resultsPerPage):1)||1,page:page,hasNext:(vm.resultsPerPage>0?page*vm.resultsPerPage<totalVItems:false)||!!vertexData.pagination.nextPageToken,hasPrev:page>1,nextPageToken:vertexData.pagination.nextPageToken}}else{vm.pagination={totalItems:vm.searchedItems.length,totalPages:1,page:1,hasNext:false,hasPrev:false}}vm.updateCurrentItems()}).finally(function(){vm.isLoading=false;vm.loadingMore=false})};vm.goToPage=function(page){if(page<1||vm.pagination&&page>vm.pagination.totalPages)return;var isSearch=false;if(vm.searchedItems!==null){isSearch=true;vm.performSearch(page)}else if(vm.selectedGallery){vm.selectGallery(vm.selectedGallery,page)}else{isSearch=true;vm.performSearch(page)}if(!vm.isLoadMore&&!isSearch){$timeout(function(){var element=document.querySelector(".mh-preview-body");var header=document.querySelector("#header");if(element){var headerHeight=header?header.offsetHeight:0;var elementPosition=element.getBoundingClientRect().top+window.pageYOffset;var offsetPosition=elementPosition-headerHeight;if(typeof $!=="undefined"){$("html, body").stop(true).animate({scrollTop:offsetPosition},500)}else{window.scrollTo({top:offsetPosition,behavior:"smooth"})}}},500)}};vm.loadMore=function(){if(!vm.pagination||!vm.pagination.hasNext)return;vm.loadingMore=true;vm.goToPage(vm.pagination.page+1)};vm.toggleNode=function(node,$event){if($event&&$event.stopPropagation)$event.stopPropagation();node.expanded=!node.expanded};vm.allExpanded=false;vm.toggleAllExpanded=function(){vm.allExpanded=!vm.allExpanded;
3function walk(nodes){nodes.forEach(function(n){n.expanded=vm.allExpanded;if(n.children&&n.children.length)walk(n.children)})}walk(vm.galleriesTree)};vm.isMimir=function(media){if(!media)return false;return media.externalSource==="mimir"||media.raw&&media.raw.externalSource==="mimir"||media.raw&&media.raw.imageUrl&&media.raw.imageUrl.indexOf("mimir")!==-1};vm.toggleSelection=function(item,$event){if($event)$event.stopPropagation();var idx=vm.selection.indexOf(item.id);if(idx===-1){vm.selection.push(item.id)}else{vm.selection.splice(idx,1)}};vm.isSelected=function(item){return vm.selection.indexOf(item.id)>-1};vm.selectAll=function(){if(vm.areAllSelected()){vm.selection=[]}else{vm.selection=vm.currentItems.map(function(m){return m.id})}};vm.areAllSelected=function(){return vm.currentItems&&vm.currentItems.length>0&&vm.currentItems.every(function(m){return vm.selection.indexOf(m.id)>-1})};vm.showLightBox=function(item,$event){if($event)$event.stopPropagation();console.log("showLightBox",item)};vm.openDownloadShare=function(){console.log("openDownloadShare",vm.selection)};vm.isAdmin=function(){if(!$rootScope.currentUser||!Array.isArray($rootScope.currentUser.groups))return false;if(!vm.cfg||!vm.cfg.adminGroupId)return false;var adminGroups=String(vm.cfg.adminGroupId).split(",").map(function(id){return id.trim()});return $rootScope.currentUser.groups.some(function(ug){return adminGroups.indexOf(String(ug))!==-1})};vm.hasMimirClips=function(){if(!vm.cfg||!vm.cfg.mimirClipsGroups)return true;if(!$rootScope.currentUser||!Array.isArray($rootScope.currentUser.groups))return false;var mimirClipsGroups=String(vm.cfg.mimirClipsGroups).split(",").map(function(id){return id.trim()});return $rootScope.currentUser.groups.some(function(ug){return mimirClipsGroups.indexOf(String(ug))!==-1})};vm.getAvailableFormats=function(type){if(!vm.cfg||!vm.cfg.groupsPermissions||!$rootScope.currentUser||!$rootScope.currentUser.groups)return[];var matchingGroups=vm.cfg.groupsPermissions.filter(function(pg){return $rootScope.currentUser.groups.some(function(ug){return ug==pg.id_group})});if(matchingGroups.length===0)return[];var bestGroup=matchingGroups.reduce(function(prev,current){return prev.level>current.level?prev:current});if(!bestGroup||!bestGroup.settings)return[];var typeKey=type==="video"?"video":"image";var settings=bestGroup.settings[typeKey];if(!settings||!Array.isArray(settings.formats))return[];var formats=angular.copy(settings.formats);if(vm.canDownloadFormat({mediaType:type},{format:"original"})){formats.push({name:"Original File",format:"original"})}var unique={};return formats.filter(function(f){var key=(f.name||f.format||"").toLowerCase();if(!key||unique[key])return false;unique[key]=true;return true})};vm.downloadItems=function(){if(!vm.selection||vm.selection.length===0)return;console.log("Mediahub: fetching details for multiple download:",vm.selection.length);vm.isLoading=true;var apiUrl=vm.cfg.apiUrl||"";var detailPromises=vm.selection.map(function(id){return $http.get(apiUrl+"/media/"+id,{headers:getCommonHeaders()}).then(function(res){if(res.data&&res.data.success&&res.data.data){return normalizeMediaItem(deepCleanse(res.data.data))}return null}).catch(function(err){console.error("Error fetching media details for id "+id+":",err);return null})});$q.all(detailPromises).then(function(results){vm.selectedMediaDetails=(results||[]).filter(Boolean);if(vm.selectedMediaDetails.length===0){console.error("Mediahub: No valid media details fetched.");return}var hasMimirItems=vm.selectedMediaDetails.some(vm.isMimir);if(vm.cfg.termsAtDownload&&!vm.downloadTermsAccepted&&hasMimirItems){vm.pendingDownload={type:"bulk",items:vm.selectedMediaDetails};vm.currentTermsAndConditions=vm.getTermsAndConditions();if(vm.currentTermsAndConditions){vm.trustedTermsAndConditions=$sce.trustAsHtml(vm.currentTermsAndConditions)}var videoElems=document.getElementsByTagName("video");for(var i=0;i<videoElems.length;i++){videoElems[i].pause()}$rootScope.openModal("modal-download-terms-"+vm.widgetId);return}vm.downloadTermsAccepted=false;if(vm.selectedMediaDetails.length>1){vm.downloadZip();return}vm.hasPhotosSelected=vm.selectedMediaDetails.some(function(m){return!m.mediaType||m.mediaType==="image"||m.mediaType===1});vm.hasVideosSelected=vm.selectedMediaDetails.some(function(m){return m.mediaType==="video"||m.mediaType===2});var resolveFormats=function(type){var formatsMap={};var isVideo=type==="video";var relevantMedia=vm.selectedMediaDetails.filter(function(m){var mIsVideo=m.mediaType==="video"||m.mediaType===2;return isVideo?mIsVideo:!mIsVideo});
3relevantMedia.forEach(function(media){if(media.formats&&Array.isArray(media.formats)){media.formats.forEach(function(f){if(vm.canDownloadFormat(media,f)){var key=(f.name||f.format||"Standard").toLowerCase();if(!formatsMap[key]){formatsMap[key]=f}}})}var hasOriginal=formatsMap["original"]||formatsMap["original file"];if(!hasOriginal&&vm.canDownloadFormat(media,{format:"original"})){formatsMap["original file"]={name:"Original File",format:"original"}}});return Object.values(formatsMap)};vm.availablePhotoFormats=vm.hasPhotosSelected?resolveFormats("image"):[];vm.availableVideoFormats=vm.hasVideosSelected?resolveFormats("video"):[];if(vm.hasPhotosSelected&&vm.availablePhotoFormats.length===0){vm.availablePhotoFormats=vm.getAvailableFormats("image")}if(vm.hasVideosSelected&&vm.availableVideoFormats.length===0){vm.availableVideoFormats=vm.getAvailableFormats("video")}vm.selectedPhotoFormat=vm.availablePhotoFormats.length>0?vm.availablePhotoFormats[vm.availablePhotoFormats.length-1]:null;vm.selectedVideoFormat=vm.availableVideoFormats.length>0?vm.availableVideoFormats[vm.availableVideoFormats.length-1]:null;$rootScope.openModal("modal-download-selector-"+vm.widgetId)}).finally(function(){vm.isLoading=false})};vm.downloadZip=function(){var d=new Date;var dateStr=d.getFullYear()+"-"+("0"+(d.getMonth()+1)).slice(-2)+"-"+("0"+d.getDate()).slice(-2);var numItems=vm.selectedMediaDetails.length;var baseName="descarga";if(vm.selectedGallery&&vm.selectedGallery.name){baseName=vm.selectedGallery.name}else if(vm.cfg&&vm.cfg.widgetId){baseName=vm.cfg.widgetId}baseName=baseName.toString().replace(/[^a-zA-Z0-9_-]/g,"_");var zipFileName=baseName+"_"+numItems+"_"+dateStr+".zip";var ids=vm.selectedMediaDetails.map(function(m){return m.id});var userId=$rootScope.currentUser&&$rootScope.currentUser.id?$rootScope.currentUser.id:null;var batchBody={ids:ids,zipFileName:zipFileName,user_id:userId};console.log("Mediahub: calling batch-download endpoint with body:",batchBody);var job={jobId:null,status:"pending",itemCount:ids.length,processedCount:0,zipFileName:zipFileName,downloadUrl:null};vm.batchJobs.push(job);vm.downloadTermsAccepted=false;vm.selection=[];var MAX_ATTEMPTS=60;var POLL_INTERVAL=3e3;function schedulePoll(job,attempts){if(attempts>=MAX_ATTEMPTS){job.status="failed";if(!$scope.$$phase)$scope.$apply();return}$timeout(function(){$http.get(vm.cfg.apiUrl+"/media/batch-download/"+job.jobId,{headers:getCommonHeaders()}).then(function(res){var jobData=res.data&&res.data.data;if(jobData){job.status=jobData.status||job.status;job.processedCount=jobData.processedCount||jobData.itemCount||job.processedCount;job.downloadUrl=jobData.downloadUrl||job.downloadUrl}if(job.status==="complete"&&job.downloadUrl){window.open(job.downloadUrl,"_blank")}else if(job.status!=="failed"&&job.status!=="error"){schedulePoll(job,attempts+1)}}).catch(function(){schedulePoll(job,attempts+1)})},POLL_INTERVAL)}$http.post(vm.cfg.apiUrl+"/media/batch-download",batchBody,{headers:getCommonHeaders()}).then(function(res){var jobData=res.data&&res.data.data;if(!jobData||!jobData.jobId){job.status="failed";console.error("Mediahub: invalid batch-download response:",res.data);return}job.jobId=jobData.jobId;job.status=jobData.status||"pending";job.itemCount=jobData.itemCount||ids.length;schedulePoll(job,0)}).catch(function(err){job.status="failed";console.error("Mediahub: batch-download error:",err)})};vm.downloadBatchJob=function(job){if(job&&job.downloadUrl){window.open(job.downloadUrl,"_blank")}};vm.dismissBatchJob=function(job){var idx=vm.batchJobs.indexOf(job);if(idx!==-1){vm.batchJobs.splice(idx,1)}};vm.confirmMultipleDownload=function(){console.log("Mediahub: starting multiple download with selected formats");$rootScope.closeModal("modal-download-selector-"+vm.widgetId);angular.forEach(vm.selectedMediaDetails,function(media){var isVideo=media.mediaType==="video"||media.mediaType===2;var targetFormat=isVideo?vm.selectedVideoFormat:vm.selectedPhotoFormat;vm.downloadMedia(media,targetFormat)})};vm.closeModal=function(id){$rootScope.closeModal(id)};vm.acceptTermsAndContinue=function(){if(!vm.downloadTermsAccepted)return;vm.closeModal("modal-download-terms-"+vm.widgetId);if(vm.pendingDownload){if(vm.pendingDownload.type==="single"){vm.downloadMedia(vm.pen
3dingDownload.media,vm.pendingDownload.format)}else if(vm.pendingDownload.type==="bulk"){vm.downloadItems()}vm.pendingDownload=null}};vm.canDownloadFormat=function(media,format){if(!media||!format)return false;if(format.download_enabled===false)return false;if(format.format==="original"&&(media.download_enabled===false||media.raw&&media.raw.download_enabled===false))return false;if(!format.download_enabled&&format.format!=="original")return false;if(!vm.cfg||!vm.cfg.groupsPermissions||!Array.isArray(vm.cfg.groupsPermissions)||vm.cfg.groupsPermissions.length===0)return true;if(!$rootScope.currentUser||!Array.isArray($rootScope.currentUser.groups))return false;var matchingGroups=vm.cfg.groupsPermissions.filter(function(pg){return $rootScope.currentUser.groups.some(function(ug){return ug==pg.id_group||ug==pg.id_group})});if(matchingGroups.length===0)return false;var bestGroup=matchingGroups.reduce(function(prev,current){return prev.level>current.level?prev:current});if(!bestGroup||!bestGroup.settings)return false;var typeKey=media.mediaType==="video"?"video":"image";var settings=bestGroup.settings[typeKey];if(!settings||!Array.isArray(settings.formats))return false;return settings.formats.some(function(f){if(format.format_id&&f.format_id){return f.format_id==format.format_id}var fmtName=(format.format||format.name||"").toLowerCase();var fName=(f.format||f.name||"").toLowerCase();if(fName==="original"&&fmtName==="preview")return true;return fName&&fmtName&&fName===fmtName})};vm.hasAnyDownloadableFormat=function(media){if(!media)return false;if(vm.canDownloadFormat(media,{format:"original"}))return true;if(media.formats&&Array.isArray(media.formats)){return media.formats.some(function(f){return vm.canDownloadFormat(media,f)})}return false};vm.getTermsAndConditions=function(){if(!vm.cfg||!vm.cfg.groupsTermsAndConditions||!Array.isArray(vm.cfg.groupsTermsAndConditions)||vm.cfg.groupsTermsAndConditions.length===0){return null}if(!$rootScope.currentUser||!Array.isArray($rootScope.currentUser.groups))return null;var matchingGroups=vm.cfg.groupsTermsAndConditions.filter(function(tcGroup){return $rootScope.currentUser.groups.some(function(gPerm){return gPerm==tcGroup.id_group})});if(matchingGroups.length===0)return null;var bestGroup=matchingGroups.reduce(function(prev,current){return prev.level>current.level?prev:current});return bestGroup.termsAndConditions};vm.downloadMedia=function(media,format,$event,isRetry){if($event){$event.preventDefault();$event.stopPropagation()}if(!media)return;if(!isRetry&&vm.cfg.termsAtDownload&&!vm.downloadTermsAccepted&&vm.isMimir(media)){vm.pendingDownload={type:"single",media:media,format:format};vm.currentTermsAndConditions=vm.getTermsAndConditions();if(vm.currentTermsAndConditions){vm.trustedTermsAndConditions=$sce.trustAsHtml(vm.currentTermsAndConditions)}var videoElems=document.getElementsByTagName("video");for(var i=0;i<videoElems.length;i++){videoElems[i].pause()}$rootScope.openModal("modal-download-terms-"+vm.widgetId);return}vm.downloadTermsAccepted=false;
3function VM_TRIGGER_DIRECT_DOWNLOAD(url,name){console.log("Mediahub: Triggering direct browser download for:",url,"with name:",name);var isBlob=url.indexOf("blob:")===0;var isSignedUrl=url.indexOf("X-Amz-Signature")!==-1||url.indexOf("Signature=")!==-1;var dlUrl=url;if(!isSignedUrl&&!isBlob&&url.indexOf("response-content-disposition")===-1){dlUrl=url+(url.indexOf("?")>-1?"&":"?")+"download=1&response-content-disposition=attachment"}var a=document.createElement("a");a.style.display="none";a.href=dlUrl;if(name){a.setAttribute("download",name);a.download=name}if(!isBlob&&!isSignedUrl){var iframeId="download-iframe-container";var iframe=document.getElementById(iframeId);if(!iframe){iframe=document.createElement("iframe");iframe.id=iframeId;iframe.name=iframeId;iframe.style.display="none";document.body.appendChild(iframe)}a.target=iframeId}else{a.target="_self"}document.body.appendChild(a);a.click();setTimeout(function(){if(a.parentNode)document.body.removeChild(a)},1e3)}var urlToDownload=null;var isMimir=vm.isMimir(media);var externalId=media.externalId||media.raw&&media.raw.externalId;var isImageOrVideo=media.mediaType===1||media.mediaType==="image"||media.mediaType===2||media.mediaType==="video";var isMimirNeedDetails=isMimir&&(!media.raw||!media.raw.download_url&&!media.raw.downloadUrl);if(!isRetry&&!format&&!media.isGeneratedClip&&(isImageOrVideo||isMimirNeedDetails)&&vm.cfg&&vm.cfg.apiUrl&&media.source!=="iconik"&&media.source!=="vertex"){console.log("Mediahub: fetching full details for media:",media.id);return $http.get(vm.cfg.apiUrl+"/media/"+media.id,{headers:getCommonHeaders()}).then(function(response){if(response.data&&response.data.success&&response.data.data){var fullMedia=normalizeMediaItem(deepCleanse(response.data.data));angular.extend(media,fullMedia);return vm.downloadMedia(media,null,null,true)}})}var targetObject=format||media;function performXhrDownload(urlToDownload,isRetryUrl){console.log("Mediahub: Starting direct download via XHR:",urlToDownload);var xhr=new XMLHttpRequest;xhr.open("GET",urlToDownload,true);xhr.responseType="blob";if(urlToDownload.indexOf(vm.cfg.apiUrl)===0){var headers=getCommonHeaders();for(var key in headers){if(headers.hasOwnProperty(key)){xhr.setRequestHeader(key,headers[key])}}}xhr.onload=function(){console.log("DEBUG: XHR status:",this.status,"size:",this.response.size);if(this.status!==200||this.response.size<1e4){var fbOrigUrl=media.imageUrl||media.url||media.raw&&(media.raw.imageUrl||media.raw.url);var fallbackUrl=fbOrigUrl?buildMediaUrl(fbOrigUrl,media):null;if(!isRetryUrl&&urlToDownload!==fallbackUrl&&fallbackUrl){return vm.downloadMedia(media,{format:"original",url:fallbackUrl},null,true)}window.open(urlToDownload,"_blank");finish();return}var blob=this.response;var blobUrl=window.URL.createObjectURL(blob);var filename=media.originalFileName||media.original_file_name||media.filename||media.fileName||"media_"+media.id+".jpg";filename=filename.replace(/[^a-z0-9_\-\.]/gi,"_");if(format&&(format.format==="preview"||format.name==="Preview")&&(media.mediaType===2||media.mediaType==="video")){filename=filename.replace(/\.[^/.]+$/,"")+"_preview.mp4"}else{if(filename.indexOf(".")===-1&&media.extension){filename+="."+media.extension.toLowerCase()}else if(filename.indexOf(".")===-1){filename+=media.mediaType===2||media.mediaType==="video"?".mp4":".jpg"}}VM_TRIGGER_DIRECT_DOWNLOAD(blobUrl,filename);setTimeout(function(){window.URL.revokeObjectURL(blobUrl);finish()},1e4)};xhr.onerror=function(){window.open(urlToDownload,"_blank");finish()};function finish(){targetObject.isDownloading=false;if(!$scope.$$phase)$scope.$apply()}xhr.send()}if(isMimir){var urlToDownload=null;if(!format){if(isMimir||media.mediaType!==1&&media.mediaType!=="video"){format={format:"original"}}else{var candidates=(media.formats||[]).slice();var origUrl=media.imageUrl||media.url||media.raw&&(media.raw.imageUrl||media.raw.url);if(origUrl){candidates.push({format:"original",width:99999,url:origUrl})}var allowed=candidates.filter(function(f){return vm.canDownloadFormat(media,f)});if(allowed.length>0){allowed.sort(function(a,b){return(b.width||0)-(a.width||0)});format=allowed[0]}}}if(format){if(format.url)urlToDownload=buildMediaUrl(format.url,media);else if(format.format==="original"||format.format_id==="original"){var originalUrl=media.imageUrl||media.url||media.raw&&(media.raw.imageUrl||media.raw.url);if(originalUrl)urlToDownload=buildMediaUrl(originalUrl,media)}else if(format.file_name)urlToDownload=buildMediaUrl(format.file_name,media)}if(!urlToDownload){var fallbackOrigUrl=media.imageUrl||media.url||media.raw&&(media.raw.imageUrl||media.raw.url);if(fallbackOrigUrl)urlToDownload=buildMediaUrl(fallbackOrigUrl,media)}if(!urlToDownload&&media.largeUrl)urlToDownload=buildMediaUrl(media.largeUrl,media);if(!urlToDownload){console.warn("Mediahub: No authorized download format found.");return}if(!isRetry){registerDownloadAnalytics(media,format)}performXhrDownload(urlToDownload,isRetry)}else{targetObject.isDownloading=true;var formatParam="original";if(format&&format.format){formatParam=format.format}else if(format&&format.format_id){formatParam=format.format_id}var downloadApiUrl=vm.cfg.apiUrl+"/media/"+media.id+"/download?format="+formatParam;$http.get(downloadApiUrl,{headers:getCommonHeaders()}).then(function(response){var url=null;if(response.data&&response.data.success&&response.data.data&&response.data.data.downloadUrl){url=response.data.data.downloadUrl}if(!url){console.error("No downloadUrl found in download API response:",response.data);targetObject.isDownloading=false;return}if(!isRetry){registerDownloadAnalytics(media,format)}performXhrDownload(url,isRetry)}).catch(function(err){console.error("Error fetching download URL:",err);targetObject.isDownloading=false})}};function buildGalleryTree(items){var byId={};var roots=[];
3items.forEach(function(g){byId[g.id]={id:g.id,name:g.name,description:g.description,parentId:g.parentId,onoff:g.onoff,is_external:g.is_external,created_at:g.created_at,updated_at:g.updated_at,cover_url:g.cover_url||"",media_count:g.media_count||0,permissions:g.permissions||[],children:[],expanded:false}});Object.keys(byId).forEach(function(id){var node=byId[id];if(node.parentId&&byId[node.parentId]){byId[node.parentId].children.push(node)}else{roots.push(node)}});return{roots:roots,byId:byId}}function pickFormat(formats,preferredIds){if(!Array.isArray(formats)||!formats.length)return null;if(Array.isArray(preferredIds)){for(var i=0;i<preferredIds.length;i++){var found=formats.find(function(f){return f.format_id===preferredIds[i]&&f.status===1});if(found)return found}}var ok=formats.filter(function(f){return f.status===1});if(!ok.length)return null;ok.sort(function(a,b){return(b.width||0)-(a.width||0)});return ok[0]}function buildMediaUrl(relativeOrAbsoluteUrl,item){if(!relativeOrAbsoluteUrl)return"";if(/^https?:\/\//i.test(relativeOrAbsoluteUrl))return relativeOrAbsoluteUrl;var base=vm.cfg&&vm.cfg.mediaBase?vm.cfg.mediaBase:"";if(!base&&item){var sampleUrl=item.imageUrl||item.previewUrl||item.raw&&(item.raw.imageUrl||item.raw.previewUrl);if(sampleUrl&&/^https?:\/\//i.test(sampleUrl)){try{var urlObj=new URL(sampleUrl);base=urlObj.origin}catch(e){console.warn("Mediahub: Failed to extract base from sample URL:",sampleUrl)}}}if(base&&base.endsWith("/"))base=base.slice(0,-1);var path=relativeOrAbsoluteUrl.indexOf("/")===0?relativeOrAbsoluteUrl.slice(1):relativeOrAbsoluteUrl;return base?base+"/"+path:relativeOrAbsoluteUrl}function extractExtension(str){if(!str)return"";var clean=str.split("?")[0].split("#")[0];var dot=clean.lastIndexOf(".");if(dot===-1)return"";return clean.substring(dot+1).toUpperCase()}function normalizeGallery(item){if(!item||item.onoff===0||item.onoff==="0")return null;return{id:item.id,name:item.name||item.title||"Gallery #"+item.id,description:item.description||"",parentId:item.parentId||null,onoff:item.onoff,is_external:item.is_external,created_at:item.created_at,updated_at:item.updated_at,cover_url:item.cover_url||item.coverUrl||item.cover||item.thumbnail||"",coverId:item.coverId||item.cover_id||null,media_count:item.media_count||item.count||0,permissions:item.permissions||[]}}function parseApiDate(dateStr){if(!dateStr)return"";if(dateStr instanceof Date)return dateStr;var date=new Date(String(dateStr).replace(" ","T"));if(isNaN(date.getTime()))return dateStr;return date}function normalizeMediaItem(item){var formats=item.formats;if(typeof formats==="string"){try{formats=JSON.parse(formats)}catch(e){formats=[];var str=item.formats.trim();if(str.indexOf("[{")===0&&str.slice(-2)==="}]"){var itemsStr=str.substring(1,str.length-1);var parts=itemsStr.split(/},\s*{/);for(var i=0;i<parts.length;i++){var part=parts[i].replace(/^{|}$/g,"");var formatObj={};var kvRegex=/([a-zA-Z0-9_]+)=({[^}]*}|[^,}]+)/g;var match;while((match=kvRegex.exec(part))!==null){var key=match[1];var val=match[2].trim();if(val==="null")val=null;else if(val==="true")val=true;else if(val==="false")val=false;else if(!isNaN(Number(val))&&val!=="")val=Number(val);formatObj[key]=val}if(Object.keys(formatObj).length>0){formats.push(formatObj)}}}}}var tags=[];if(item.tags){if(Array.isArray(item.tags)){tags=item.tags}else if(typeof item.tags==="string"){tags=item.tags.split(",").map(function(t){return t.trim()})}}var thumbIds=[];if(vm.cfg&&vm.cfg.thumbnailCropformat){thumbIds.push(parseInt(vm.cfg.thumbnailCropformat,10))}thumbIds.push(1001);var largeIds=[];if(vm.cfg&&vm.cfg.previewCropformat){largeIds.push(parseInt(vm.cfg.previewCropformat,10))}largeIds.push(11013);var thumb=pickFormat(formats,thumbIds);var large=pickFormat(formats,largeIds);var baseFilename=item.originalFileName||item.original_file_name||item.filename||item.fileName||"";var filename=baseFilename;if(vm.cfg&&vm.cfg.fileNameFieldToShow&&item[vm.cfg.fileNameFieldToShow]){var customName=item[vm.cfg.fileNameFieldToShow];var origExt=extractExtension(baseFilename);var customExt=extractExtension(customName);filename=customName;if(!customExt&&origExt){filename+="."+origExt.toLowerCase()}}var rawDate=item.date_uploaded||item.dateUploaded||"";var dateUploaded=parseApiDate(rawDate);var mediaType=item.mediaType||item.media_type||1;var videoUrl=null;var thumbUrl=thumb?buildMediaUrl(thumb.url):item.thumbnailUrl?buildMediaUrl(item.thumbnailUrl):buildMediaUrl(thumb?thumb.url:"");var largeUrl=item.download_url||item.downloadUrl||(large?buildMediaUrl(large.url):item.previewUrl?buildMediaUrl(item.previewUrl):buildMediaUrl(thumb?thumb.url:""));var extension=item.extension||extractExtension(filename);if(!extension&&item.imageUrl)extension=extractExtension(item.imageUrl);if(!extension&&item.previewUrl)extension=extractExtension(item.previewUrl);if(!extension&&item.url)extension=extractExtension(item.url);var isDocument=extension&&["DOC","DOCX","PDF","XLS","XLSX","PPT","PPTX","ZIP","RAR","7Z"].indexOf(extension.toUpperCase())>-1;if(!isDocument&&(mediaType===2||mediaType==="2"||mediaType==="video"||item.imageUrl&&item.imageUrl.toLowerCase().indexOf("mimir")!==-1)){mediaType="video";if(item.previewUrl){videoUrl=$sce.trustAsResourceUrl(item.previewUrl)}}var isUnsupportedVideo=false;if((mediaType==="video"||mediaType===2||mediaType==="2")&&extension&&extension.toUpperCase()==="MXF"){var hasPlayableMP4=item.imageUrl&&item.imageUrl.toLowerCase().indexOf(".mp4")!==-1||item.previewUrl&&item.previewUrl.toLowerCase().indexOf(".mp4")!==-1;
3if(!hasPlayableMP4){isUnsupportedVideo=true;console.log("Mediahub: Detected unsupported video format (MXF) with no MP4 proxy for media:",item.id)}}var normalizedFormats=(formats||[]).map(function(f){if(typeof f.download_enabled==="undefined"){f.download_enabled=true}return f});var parsedPreviewUrl=item.previewUrl?buildMediaUrl(item.previewUrl):item.preview_url?buildMediaUrl(item.preview_url):null;if((item.externalSource==="mimir"||item.imageUrl&&item.imageUrl.toLowerCase().indexOf("mimir")!==-1)&&parsedPreviewUrl){var hasPreview=normalizedFormats.some(function(f){return f.format&&f.format.toLowerCase()==="preview"||f.name&&f.name.toLowerCase()==="preview"});if(!hasPreview){normalizedFormats.push({name:"Preview",format:"preview",url:parsedPreviewUrl,width:1280,height:720,download_enabled:true})}}return{raw:item,id:item.id,title:item.title||filename||"Media #"+item.id,caption:item.caption||"",date_uploaded:dateUploaded,mediaType:mediaType,filename:filename,originalName:item.originalName||item.original_name||item.originalFileName||"",extension:extension?extension.toUpperCase():"",isUnsupportedVideo:isUnsupportedVideo,thumbUrl:thumbUrl,largeUrl:largeUrl,previewUrl:item.previewUrl?buildMediaUrl(item.previewUrl):item.preview_url?buildMediaUrl(item.preview_url):null,videoUrl:videoUrl,formats:normalizedFormats,tags:tags,galleryIds:item.galleryIds||[],photographer:item.photographer||"",owner:item.owner||""}}function performXhr(method,url,data,headers){var deferred=$q.defer();var xhr=new XMLHttpRequest;xhr.addEventListener("readystatechange",function(){if(this.readyState===4){$scope.$apply(function(){if(xhr.status>=200&&xhr.status<300){try{var response=typeof xhr.response==="string"?JSON.parse(xhr.responseText):xhr.response;deferred.resolve(response)}catch(e){console.error("Error parsing response from "+url,e);vm.debug.searchError={message:"Error parsing JSON",error:e};deferred.reject(e)}}else{console.error("Request failed: "+url,xhr.status,xhr.responseText);vm.debug.searchError={status:xhr.status,data:xhr.responseText};deferred.reject({status:xhr.status,data:xhr.responseText})}})}});xhr.open(method,url);if(data&&method==="POST"){xhr.setRequestHeader("Content-Type","application/json")}if(headers){angular.forEach(headers,function(value,key){xhr.setRequestHeader(key,value)})}if(data){xhr.send(data)}else{xhr.send()}return deferred.promise}function normalizeVertexSearchItem(item){if(!item)return null;var title=item.title||item.caption||"Media #"+item.id;var baseFilename=item.file_name||item.fileName||item.title||"Media #"+item.id;var filename=baseFilename;if(vm.cfg&&vm.cfg.fileNameFieldToShow&&item[vm.cfg.fileNameFieldToShow]){var customName=item[vm.cfg.fileNameFieldToShow];var origExt=extractExtension(baseFilename);var customExt=extractExtension(customName);filename=customName;if(!customExt&&origExt){filename+="."+origExt.toLowerCase()}}var url=item.image_url||item.url||item.uri||"";var extension=item.extension||extractExtension(filename)||extractExtension(url)||extractExtension(item.preview_url);var isImageExtension=extension&&["JPG","JPEG","PNG","GIF","WEBP","SVG"].indexOf(extension.toUpperCase())>-1;var mType="image";var mediaTypeRaw=item.media_type||item.mediaType||1;var contentTypeRaw=item.content_type||item.contentType||"";if(mediaTypeRaw===2||mediaTypeRaw==="2"||mediaTypeRaw==="video"||typeof contentTypeRaw==="string"&&contentTypeRaw.indexOf("video")>-1){mType="video"}var thumbUrl=item.thumbnail_url||(isImageExtension?url:"");var largeUrl=item.preview_url||url;return{raw:item,id:item.id,title:title,caption:item.caption||"",date_uploaded:parseApiDate(item.available_time),mediaType:mType,filename:filename,originalName:item.originalName||item.original_name||"",extension:extension?extension.toUpperCase():"",photographer:item.photographer||"",tags:item.tags||[],thumbUrl:buildMediaUrl(thumbUrl),largeUrl:buildMediaUrl(largeUrl),previewUrl:item.preview_url?buildMediaUrl(item.preview_url):null,formats:[],source:"vertex",download_enabled:typeof item.download_enabled!=="undefined"?item.download_enabled:true}}function normalizeIconikSearchItem(item){if(!item)return null;var title=item.title||item.description||"Media #"+item.id;var tags=[];if(item.tags){if(Array.isArray(item.tags)){tags=item.tags}
3else if(typeof item.tags==="string"){tags=item.tags.split(",").map(function(t){return t.trim()}).filter(Boolean)}}function buildIconikUrl(url){if(!url)return"";if(/^https?:\/\//i.test(url))return url;var base=vm.cfg&&vm.cfg.iconikUrl?vm.cfg.iconikUrl:"";if(base&&base.endsWith("/"))base=base.slice(0,-1);var path=url&&url.startsWith("/")?url.slice(1):url;return base?base+"/"+path:url}var thumb=item.media&&item.media.thumb?item.media.thumb:"";var view=item.media&&item.media.view?item.media.view:thumb;var mType=item.mediaType||item.media_type||(item.object_type==="video"?"video":"image");var baseFilename=item.title2||item.title||"";var filename=baseFilename;if(vm.cfg&&vm.cfg.fileNameFieldToShow&&item[vm.cfg.fileNameFieldToShow]){var customName=item[vm.cfg.fileNameFieldToShow];var origExt=extractExtension(baseFilename);var customExt=extractExtension(customName);filename=customName;if(!customExt&&origExt){filename+="."+origExt.toLowerCase()}}var formats=(item.downloadFormats||[]).map(function(f){if(typeof f.download_enabled==="undefined"){f.download_enabled=true}f.url=buildIconikUrl(f.downloadUrl||f.url);f.width=f.width?parseInt(f.width,10):0;f.height=f.height?parseInt(f.height,10):0;if(f.label)f.name=f.label;return f});return{raw:item,id:item.id,title:title,caption:item.description||"",date_uploaded:parseApiDate(item.dateFilter||item.datefilter),mediaType:mType,filename:filename,originalName:item.originalName||item.original_name||"",extension:(item.extension||extractExtension(item.title)||extractExtension(thumb)||extractExtension(view)||"").toUpperCase(),photographer:item.photographer||"",owner:item.owner||"",tags:tags,thumbUrl:buildIconikUrl(thumb),largeUrl:buildIconikUrl(view),previewUrl:buildIconikUrl(view),formats:formats,proxyUrl:item.proxyUrl||item.proxy_url,source:"iconik",download_enabled:typeof item.download_enabled!=="undefined"?item.download_enabled:true}}vm.updateCurrentItems=function(){if(vm.searchedItems&&vm.searchedItems.length>0){vm.currentItems=vm.searchedItems}else if(vm.galleryItems&&vm.galleryItems.length>0){vm.currentItems=vm.galleryItems}else{vm.currentItems=vm.mediaItems||[]}console.log("vm.currentItems",vm.currentItems)};vm.hasPrevMedia=function(){if(!vm.selectedMedia||!vm.currentItems||vm.currentItems.length<=1)return false;var index=vm.currentItems.findIndex(function(m){return m.id==vm.selectedMedia.id});return index>0};vm.hasNextMedia=function(){if(!vm.selectedMedia||!vm.currentItems||vm.currentItems.length<=1)return false;var index=vm.currentItems.findIndex(function(m){return m.id==vm.selectedMedia.id});return index>-1&&index<vm.currentItems.length-1};vm.prevMedia=function(){if(!vm.hasPrevMedia())return;var index=vm.currentItems.findIndex(function(m){return m.id==vm.selectedMedia.id});vm.openMedia(vm.currentItems[index-1])};vm.nextMedia=function(){if(!vm.hasNextMedia())return;var index=vm.currentItems.findIndex(function(m){return m.id==vm.selectedMedia.id});vm.openMedia(vm.currentItems[index+1])};vm.updateBreadcrumb=function(){vm.activeBreadcrumbs=[];if(vm.filterYear){vm.activeBreadcrumbs.push({key:"filterYear",label:filterLabels.filterYear,value:vm.filterYear})}if(vm.filterMediaType){var typeObj=vm.mediaTypes.options.find(function(o){return o.id==vm.filterMediaType});vm.activeBreadcrumbs.push({key:"filterMediaType",label:filterLabels.filterMediaType,value:typeObj?typeObj.name:vm.filterMediaType})}angular.forEach(vm.selectedTags,function(tagIds,typeName){if(Array.isArray(tagIds)){tagIds.forEach(function(tagId){var tagList=vm.tags[typeName]||[];var tagNode=tagList.find(function(t){return t.id==tagId});if(tagNode){vm.activeBreadcrumbs.push({key:"tag_"+typeName+"_"+tagId,label:typeName,value:tagNode.name,typeName:typeName,tagId:tagId,isExcluded:!!vm.excludedTags[tagId]})}})}})};vm.toggleTag=function(typeName,tagId){if(!vm.selectedTags[typeName])vm.selectedTags[typeName]=[];var index=vm.selectedTags[typeName].indexOf(tagId);if(index>-1){vm.selectedTags[typeName].splice(index,1)}else{vm.selectedTags[typeName].push(tagId)}vm.filtersDirty=true;vm.updateBreadcrumb()};vm.isTagSelected=function(typeName,tagId){return vm.selectedTags[typeName]&&vm.selectedTags[typeName].indexOf(tagId)>-1};vm.toggleDropdown=function(tagItems,$event){if($event)$event.stopPropagation();var currentState=!!tagItems.isOpen;vm.closeAllDropdowns();tagItems.isOpen=!currentState};vm.closeAllDropdowns=function(){angular.forEach(vm.tags,function(items){items.isOpen=false});vm.mediaTypes.isOpen=false;if(vm.galleryTypeOptions)vm.galleryTypeOptions.isOpen=false};vm.toggleFilters=function(){vm.showFilters=!vm.showFilters;if(!vm.showFilters){vm.closeAllDropdowns()}};vm.toggleExcludeTag=function(tagId){vm.excludedTags[tagId]=!vm.excludedTags[tagId];vm.filtersDirty=true;vm.updateBreadcrumb()};vm.removeAllFilters=function(){vm.selectedTags={};vm.excludedTags={};vm.filterMediaType="";vm.filtersDirty=true;vm.updateBreadcrumb()};vm.removeBreadcrumb=function(crumb){if(crumb.tagId&&crumb.typeName){vm.toggleTag(crumb.typeName,crumb.tagId)}else{vm[crumb.key]="";vm.filtersDirty=true}vm.updateBreadcrumb()};vm.applyFilters=function(){vm.filtersDirty=false;vm.performSearch()};vm.canUpdateSearch=function(){var queryChanged=vm.searchQuery!==vm.lastAppliedSearchQuery;var filterTagChanged=!angular.equals(vm.filterTag,vm.lastAppliedFilterTag);var selectedTagsChanged=!angular.equals(vm.selectedTags,vm.lastAppliedSelectedTags);var excludedTagsChanged=!angular.equals(vm.excludedTags,vm.lastAppliedExcludedTags);var mediaTypeChanged=vm.filterMediaType!==vm.lastAppliedFilterMediaType;var yearChanged=vm.filterYear!==vm.lastAppliedFilterYear;return queryChanged||filterTagChanged||selectedTagsChanged||excludedTagsChanged||mediaTypeChanged||yearChanged};
3function gatherTagAndDescendants(tag,names){if(!tag)return;names.push(tag.name);if(tag.children&&tag.children.length){tag.children.forEach(function(child){gatherTagAndDescendants(child,names)})}}function findTagById(tagList,id){for(var i=0;i<tagList.length;i++){var tag=tagList[i];if(tag.id==id)return tag;if(tag.children&&tag.children.length){var found=findTagById(tag.children,id);if(found)return found}}return null}vm.vertexSearch=function(query,pageSize,nextPageToken){if(!vm.cfg||!vm.cfg.vertexUrl)return $q.resolve({items:[]});pageSize=pageSize||0;var url=vm.cfg.vertexUrl;var defaultIncludedNames=[];var defaultExcludedNames=[];if(vm.filterTag&&Array.isArray(vm.filterTag.values)){vm.filterTag.values.forEach(function(val){if(val.charAt(0)==="!"){defaultExcludedNames.push(val.substring(1).trim().toLowerCase())}else{defaultIncludedNames.push(val.trim().toLowerCase())}})}var manualIncludedNames=[];var manualExcludedNames=[];angular.forEach(vm.selectedTags,function(tagIds,typeName){if(Array.isArray(tagIds)){var tagList=vm.tags[typeName]||[];tagIds.forEach(function(tagId){var tagNode=findTagById(tagList,tagId);if(tagNode){var names=[];gatherTagAndDescendants(tagNode,names);var lowerNames=names.map(function(n){return(n||"").toLowerCase()});if(vm.excludedTags[tagId]){manualExcludedNames=manualExcludedNames.c
3oncat(lowerNames)}else{manualIncludedNames=manualIncludedNames.concat(lowerNames)}}})}});var filterParts=[];if(defaultIncludedNames.length>0){var quoted=defaultIncludedNames.map(function(n){return'"'+n+'"'});filterParts.push("tags: ANY("+quoted.join(", ")+")")}if(defaultExcludedNames.length>0){var quoted=defaultExcludedNames.map(function(n){return'"'+n+'"'});filterParts.push("NOT tags: ANY("+quoted.join(", ")+")")}if(manualIncludedNames.length>0){var quoted=manualIncludedNames.map(function(n){return'"'+n+'"'});filterParts.push("tags: ANY("+quoted.join(", ")+")")}if(manualExcludedNames.length>0){var quoted=manualExcludedNames.map(function(n){return'"'+n+'"'});filterParts.push("NOT tags: ANY("+quoted.join(", ")+")")}if(!query&&filterParts.length===0){return $q.resolve({items:[]})}var data={query:query||""};if(pageSize>0){data.pageSize=pageSize+2}if(nextPageToken){data.nextPageToken=nextPageToken}if(filterParts.length>0){data.filter=filterParts.join(" AND ")}if(vm.filterMediaType){var typeFilter="media_type = "+vm.filterMediaType;data.filter=data.filter?data.filter+" AND "+typeFilter:typeFilter}var headers={};if(vm.authToken){headers["X-Auth-Token"]=vm.authToken}return performXhr("POST",url,JSON.stringify(data),headers).then(function(response){console.log("Vertex Search Response:",response);var items=response.results||[];return{items:items.map(normalizeVertexSearchItem).filter(Boolean),pagination:{totalItems:response.totalSize||0,nextPageToken:response.nextPageToken}}}).catch(function(err){console.error("Vertex search error",err);return{items:[]}})};vm.iconikSearch=function(query,page){if(!vm.cfg||!vm.cfg.iconikUrl)return $q.resolve({items:[]});page=page||1;var pageSize=vm.resultsPerPage||0;var baseUrl=vm.cfg.iconikUrl;var params=[];if(query)params.push("q="+encodeURIComponent(query));if(page)params.push("page="+page);if(pageSize>0)params.push("per_page="+pageSize);var mediaTypeMapping={1:"image",2:"video",3:"audio",4:"other"};var iconikType=mediaTypeMapping[vm.filterMediaType];if(iconikType){params.push("type="+iconikType)}else if(!vm.filterMediaType&&!query&&!allTags.length){params.push("type=image")}var allTags=[];if(vm.filterTag&&Array.isArray(vm.filterTag.values)){vm.filterTag.values.forEach(function(val){if(val.charAt(0)==="!"){allTags.push("-"+val.substring(1).trim())}else{allTags.push(val.trim())}})}angular.forEach(vm.selectedTags,function(tagIds,typeName){if(Array.isArray(tagIds)){var tagList=vm.tags[typeName]||[];tagIds.forEach(function(tagId){var tagNode=findTagById(tagList,tagId);if(tagNode){var names=[];gatherTagAndDescendants(tagNode,names);names.forEach(function(tagName){if(vm.excludedTags[tagId]){tagName="-"+tagName}allTags.push(tagName)})}})}});if(allTags.length){params.push("tags="+encodeURIComponent(allTags.join(",")))}if(!query&&!allTags.length&&!vm.filterMediaType){return $q.resolve({items:[]})}var url=baseUrl+"search?"+params.join("&");return performXhr("GET",url,null).then(function(response){var data=deepCleanse(response);console.log("Iconik Search Response:",data);var items=data.items||[];var pagination=data.pagination||{};return{items:items.map(normalizeIconikSearchItem).filter(Boolean),pagination:{page:pagination.page,perPage:pagination.perPage||pagination.per_page,totalItems:pagination.totalItems!==undefined?pagination.totalItems:pagination.total_items,totalPages:pagination.totalPages!==undefined?pagination.totalPages:pagination.total_pages,hasNext:pagination.hasNext!==undefined?pagination.hasNext:pagination.has_next,hasPrev:pagination.hasPrev!==undefined?pagination.hasPrev:pagination.has_prev}}}).catch(function(err){console.error("Iconik search error",err);return{items:[]}})};vm.apiSearch=function(query,page){if(!query&&!vm.filterTag||!vm.cfg||!vm.cfg.apiUrl)return $q.resolve({items:[]});page=page||1;var params={q:query||"*",page:page,sortDir:vm.sortDir,sortField:vm.sortField};if(vm.resultsPerPage>0){params.resultsPerPage=vm.resultsPerPage}if(vm.filterTag&&Array.isArray(vm.filterTag.values)){params.tags=vm.filterTag.values.join(",")}if(page>1){var token=vm.cursorHistory[page]||(vm.pagination?vm.pagination.nextCursor||vm.pagination.cursor:null);if(token)params.cursor=token}return vm.resourceListMedia.get(params).$promise.then(function(response){response=deepCleanse(response);console.log("API Search Response:",response);var items=response.data||response.items||response.results||(Array.isArray(response)?response:[]);var pag=response.pagination||response;var currentPage=pag.page||page||1;var nToken=pag.nextCursor||pag.cursor;if(nToken)vm.cursorHistory[currentPage+1]=nToken;var hasTotal=pag.totalItems!==undefined||pag.total_items!==undefined||pag.total!==undefined;
3return{items:items.map(normalizeMediaItem).filter(Boolean),pagination:hasTotal||pag.hasNextPage||pag.hasNext?{totalItems:pag.totalItems||pag.total_items||pag.total||items.length,totalPages:pag.totalPages||pag.total_pages||((pag.resultsPerPage||pag.results_per_page||vm.resultsPerPage)>0?Math.ceil((pag.totalItems||pag.total_items||pag.total)/(pag.resultsPerPage||pag.results_per_page||vm.resultsPerPage)):1),page:pag.page||page||1,hasNext:pag.hasNextPage||pag.hasNext,hasPrev:pag.hasPreviousPage||pag.hasPrev,nextCursor:pag.nextCursor||pag.cursor,cursor:pag.nextCursor||pag.cursor}:null}}).catch(function(err){console.error("API search error",err);return{items:[]}})};vm.getAuthToken=function(){var token=$cookies.get("satellizer_token");var url="/api/auth/token";var headers={Authorization:"Bearer "+token};return $http.get(url,{headers:headers}).then(function(response){return response.data}).catch(function(err){console.error("Error fetching auth token",err);return $q.reject(err)})};function registerDownloadAnalytics(media,format){if(!vm.cfg||!vm.cfg.apiUrl)return;var isVideo=media.mediaType==="video"||media.mediaType==2;var isPhoto=media.mediaType==="image"||media.mediaType==1||media.mediaType==="photo";var action=isVideo?"download_video":"download_photo";var mediaTypeId=isVideo?2:isPhoto?1:3;var formatId=format?format.format_id||format.formatId||format.id||"0":"0";if(typeof formatId==="number"&&isNaN(formatId)){formatId="0"}var payload={user_id:$rootScope.currentUser&&$rootScope.currentUser.id?parseInt($rootScope.currentUser.id,10):0,action:action,media_id:media.id?parseInt(media.id,10):0,file_name:(media.orignalFileName||media.original_file_name||media.filename||media.fileName||"file.jpg").toString(),title:(media.title||"Untitled").toString(),media_type:mediaTypeId,format_id:formatId&&!isNaN(parseInt(formatId,10))?parseInt(formatId,10):0,name:$rootScope.currentUser&&$rootScope.currentUser.name?$rootScope.currentUser.name.toString():"Guest",email:$rootScope.currentUser&&$rootScope.currentUser.email?$rootScope.currentUser.email.toString():"[email protected]"};console.log("DEBUG: Analytics payload:",payload);$http.post(vm.cfg.apiUrl+"/analytics",payload,{headers:getCommonHeaders()}).catch(function(err){console.warn("DEBUG: Analytics tracking failed. Status:",err.status);console.warn("DEBUG: Analytics error body:",err.data||"No data")})}vm.createSubclip=function(options){if(!vm.selectedMedia||!vm.segmentState)return;vm.isProcessingSubclip=true;var payload={mimir_payload:{itemId:vm.selectedMedia.externalId||vm.selectedMedia.raw&&vm.selectedMedia.raw.externalId||vm.selectedMedia.id,operationType:"subclip",operationParams:{targetMimirFolderId:vm.cfg.mimirClipsFolder,startTime:Math.floor(vm.segmentState.start*1e3),endTime:Math.floor(vm.segmentState.end*1e3),fileName:"subclip_"+(vm.selectedMedia.filename||"video.mp4"),dstStorageId:vm.cfg.subclipStorageId||"storage-123",shouldCreateVisibleItem:true,strategy:{type:"cutter"},itemCreationRequest:{metadata:{formId:"default",formData:{default_title:"Subclip: "+(vm.selectedMedia.title||"Untitled"),default_description:"Subclip from "+(vm.selectedMedia.title||"original video"),default_mediaCreatedOn:(new Date).toISOString()}},visibleTo:{level:"selected_groups",groups:vm.cfg.subclipGroups||["marketing_team"]}}},forced:false},id_user:$rootScope.currentUser&&$rootScope.currentUser.id?parseInt($rootScope.currentUser.id,10):0};var requestTime=new Date;$http.post(vm.cfg.apiUrl+"/mimir/process",payload,{headers:getCommonHeaders()}).then(function(response){console.log("Subclip process started:",response.data);var parentFileId=vm.selectedMedia.externalId||vm.selectedMedia.raw&&vm.selectedMedia.raw.externalId||vm.selectedMedia.id;var targetClipId=response.data?response.data.clip_id||response.data.id||response.data.data&&(response.data.data.clip_id||response.data.data.id):null;vm.startClipsPolling(parentFileId,targetClipId,requestTime)}).catch(function(err){console.error("Error starting subclip process:",err)}).finally(function(){vm.isProcessingSubclip=false})};var clipsPollPromise=null;vm.startClipsPolling=function(parentFileId,targetClipId,requestTime,pollCount){vm.stopClipsPolling();if(!vm.selectedMedia)return;var currentParentId=vm.selectedMedia.externalId||vm.selectedMedia.raw&&vm.selectedMedia.raw.externalId||vm.selectedMedia.id;if(currentParentId!==parentFileId)return;vm.isLoadingClips=true;pollCount=pollCount||0;$http.get(vm.cfg.apiUrl+"/mimir/clips",{headers:getCommonHeaders(),params:{parent_file_id:parentFileId,id_user:$rootScope.currentUser&&$rootScope.currentUser.id?parseInt($rootScope.currentUser.id,10):0}}).then(function(response){var items=response.data&&response.data.items?response.data.items:Array.isArray(response.data)?response.data:[];vm.mimirClips=items;var shouldKeepPolling=false;for(var k=0;k<items.length;k++){if(!items[k].finished_at&&!items[k].failed_at){shouldKeepPolling=true;break}}if(targetClipId||requestTime){if(pollCount<60){var targetClip=null;if(targetClipId){for(var i=0;i<items.length;i++){if(items[i].clip_id===targetClipId){targetClip=items[i];break}}}else if(requestTime){var reqMs=new Date(requestTime).getTime();var newestStartedMs=0;for(var j=0;j<items.length;j++){var startedMs=new Date(items[j].started_at).getTime();if(startedMs>=reqMs-15e3){if(startedMs>newestStartedMs){newestStartedMs=startedMs;targetClip=items[j]}}}}
3if(targetClip){if(!targetClip.finished_at&&!targetClip.failed_at){shouldKeepPolling=true}else if(targetClip.finished_at){vm.downloadClip(targetClip);targetClipId=null;requestTime=null}else if(targetClip.failed_at){targetClipId=null;requestTime=null}}else{shouldKeepPolling=true}}else{targetClipId=null;requestTime=null}}if(shouldKeepPolling&&vm.selectedMedia){clipsPollPromise=$timeout(function(){vm.startClipsPolling(parentFileId,targetClipId,requestTime,pollCount+1)},5e3)}}).catch(function(err){console.error("Error fetching Mimir clips:",err)}).finally(function(){vm.isLoadingClips=false})};vm.stopClipsPolling=function(){if(clipsPollPromise){$timeout.cancel(clipsPollPromise);clipsPollPromise=null}};vm.downloadClip=function(clip,$event){if($event){$event.preventDefault();$event.stopPropagation()}var extId=clip?clip.external_id||clip.clip_id:null;if(!extId)return;clip.isDownloading=true;$http.get(vm.cfg.apiUrl+"/mimir/items/"+extId,{headers:getCommonHeaders()}).then(function(res){var item=res.data;if(item&&item.success&&item.data){item=item.data}else if(item&&item.item){item=item.item}if(!item){console.error("No Mimir item details returned for clip download");return}if(item.highRes){item.download_url=item.highRes;item.downloadUrl=item.highRes;item.imageUrl=item.highRes;item.url=item.highRes}var normalized=normalizeMediaItem(deepCleanse(item));normalized.externalSource="mimir";normalized.isGeneratedClip=true;vm.downloadMedia(normalized)}).catch(function(err){console.error("Error downloading Mimir clip:",err)}).finally(function(){clip.isDownloading=false})};function resetItems(){console.log("Items reset");vm.galleryItems=[];vm.searchedItems=null;vm.mediaItems=[]}function deepCleanse(data){if(!data||!vm.cfg||!vm.cfg.cleansingMap)return data;if(typeof data==="string"){var cleansed=data;Object.keys(vm.cfg.cleansingMap).forEach(function(target){cleansed=cleansed.split(target).join(vm.cfg.cleansingMap[target])});return cleansed}if(Array.isArray(data)){return data.map(deepCleanse)}if(typeof data==="object"&&data!==null){if(data.hasOwnProperty("$promise")||data.hasOwnProperty("$resolved")){return data}var cleansedObj={};Object.keys(data).forEach(function(key){cleansedObj[key]=deepCleanse(data[key])});return cleansedObj}return data}});"use strict";angular.module("Overlay",["services.HttpService","directives.spinner","directives.resizables","ngSanitize","Scope.safeApply"]).controller("OverlayController",["$scope","$filter","HttpService","$window","$location","preloader","$timeout","$rootScope","CommonFactory","$compile","$base64",function($scope,$filter,HttpService,$window,$location,preloader,$timeout,$rootScope,CommonFactory,$compile,$base64){$rootScope.$watch("overlayData",function(overlayData){if(overlayData){$scope.currentItem=overlayData;var videoSource=[{src:overlayData.mediaVideo,type:"video/mp4"}];$scope.configvideo={preload:"none",sources:videoSource,plugins:{controls:{autoHide:true,autoHideTime:5e3}}};if($scope.currentItem.gal){$timeout(function(){var $fotoramaDiv=$(".overlay-fotorama .fotoramas");$fotoramaDiv.fotorama()})}}else{$scope.configvideo=""}});$scope.closeModal=function(modalId){$rootScope.overlayData="";$rootScope.closeModal(modalId)};$scope.maxHeightModal=function(){var h=window.innerHeight;var h2=h*80/100;return{"max-height":h2}};$scope.resizeVideoYt=function(){$timeout(function(){var playerContainer=$("vg-media");var w=playerContainer.width();var h=parseInt(w*1*9/16);playerContainer.height(h-1);var playerContainer2=$("#ytplayer");var w2=playerContainer2.width();var h2=parseInt(w2*1*9/16);playerContainer2.height(h2-1)})};$scope.vidPlayerReady=function(API){$scope.videoAPI=API};$scope.vidStop=function(){$scope.videoAPI.pause();return true}}]);"use strict";angular.module("Results",["services.HttpService"]).controller("ResultsController",["$scope","$filter","HttpService","$window","$sce",function($scope,$filter,HttpService,$window,$sce){var searchContains=function(string,substr){return string.indexOf(substr)!=-1};$scope.init=function(url,overallRace){var _starter=function(){$scope.index=0;$scope.data=[];$scope.page=1;$scope.results=[];$scope.pagedItemsLoaded=[];$scope.pagedItemsLoadedPreload=[];$scope.imageLocations=[];$scope.more=false;$scope.moreLoad=false;$scope.status_bar="";$scope.isLoading=true;$scope.noOverall=true;$scope.isSuccessful=false;$scope.percentLoaded=0;$scope.preloader=false};_starter();$scope.per_page=999;$scope.url=url;$scope.overallRace=overallRace;$scope.items=[];$scope.competitors=[];$scope.races=[];$scope.overall=[];$scope.events=[];$scope.eventsData=[];$scope.classes=[];$scope.eventClasses=[];$scope.eventRaces=[];HttpService.getDataUrl($scope.url).then(function(response){angular.forEach(response.data,function(event){$scope.eventRaces=[];var eventData={eventName:event.title,eventRaces:[],eventClasses:$scope.eventClasses[event.title]};angular.forEach(event.competitors,function(competitor){$scope.competitors[competitor.competitorid]=competitor});console.log(event.eventresults);angular.forEach(event.eventresults.totals,function(totalData){angular.forEach(totalData.results,function(overall){overall["event"]=event.title;overall["class"]=totalData.class;overall["teamName"]=$scope.competitors[overall.competitorid].name;overall["teamShort"]=$scope.competitors[overall.competitorid].abbr;overall["teamCountry"]=$scope.competitors[overall.competitorid].country;overall["teamImg"]=$scope.competitors[overall.competitorid].media;overall["teamUrl"]=$scope.competitors[overall.competitorid].link;overall["teamExtra"]=[];if(!angular.isUndefined($scope.competitors[overall.competitorid].extra)){angular.forEach($scope.competitors[overall.competitorid].extra,function(extraData,extraField){overall["teamExtra"][extraField]=extraData})}$scope.competitors[overall.competitorid]["total"]=overall.points;$scope.overall.push(overall);if($scope.overallRace){overall["race"]=$scope.overallRace;$scope.items.push(overall)}})});angular.forEach(event.eventresults.races,function(race){if(eventData.eventRaces.indexOf(race.race)==-1){eventData.eventRaces.push(race.race)}if(angular.isUndefined($scope.races[event.title])){$scope.races[event.title]=[]}if(angular.isUndefined($scope.races[event.title][race.class])){$scope.races[event.title][race.class]=[]}if(!searchContains($scope.races[event.title][race.class],race.name)){$scope.races[event.title][race.class].push(race.name)}angular.forEach(race.competitors,function(item){item["event"]=event.title;item["race"]=race.name;item["class"]=race.class;item["teamName"]=$scope.competitors[item.competitorid].name;item["teamShort"]=$scope.competitors[item.competitorid].abbr;item["teamCountry"]=$scope.competitors[item.competitorid].country;item["teamImg"]=$scope.competitors[item.competitorid].media;item["teamUrl"]=$scope.competitors[item.competitorid].link;item["teamExtra"]=[];if(!angular.isUndefined($scope.competitors[item.competitorid].extra)){angular.forEach($scope.competitors[item.competitorid].extra,function(extraData,extraField){item["teamExtra"][extraField]=extraData})}item["total"]=$scope.competitors[item.competitorid].total;$scope.items.push(item)})});angular.forEach(event.classes,function(eventClass){if(angular.isUndefined($scope.eventClasses[event.title])){$scope.eventClasses[event.title]=[]}$scope.eventClasses[event.title].push(eventClass);if($scope.overallRace){if(!searchContains($scope.races[event.title][eventClass],$scope.overallRace)){$scope.races[event.title][eventClass].push($scope.overallRace)}}});angular.forEach($scope.eventRaces,function(race){eventData.eventRaces.push(race)});eventData.eventClasses=$scope.eventClasses[event.title];$scope.eventsData.push(eventData);$scope.events.push(event.title)});$scope.filterEvent=$scope.events[0];$scope.classes=$scope.eventClasses[$scope.filterEvent];$scope.filterClass=$scope.classes[0];$scope.filterClassRaces=$scope.races[$scope.filterEvent][$scope.filterClass][0];$scope.search()});$scope.setFilterClass=function(filterClass){$scope.filterClass=filterClass;if(!angular.isUndefined($scope.races[$scope.filterEvent][filterClass])){$scope.filterClassRaces=$scope.races[$scope.filterEvent][filterClass][0]}else{$scope.filterClassRaces="";$scope.tabsRaces=[]}_starter();$scope.search();return false};$scope.setFilterEvent=function(filterEvent){$scope.filterEvent=filterEvent;console.log($scope.filterEvent);if(!angular.isUndefined($scope.races[$scope.filterEvent])){$scope.classes=$scope.eventClasses[$scope.filterEvent];$scope.filterClass=$scope.classes[0];$scope.filterClassRaces=$scope.races[$scope.filterEvent][$scope.filterClass][0]}else{$scope.classes=[];$scope.filterClass="";$scope.filterClassRaces="";$scope.tabsRaces=[]}_starter();$scope.search();return false};$scope.setFilterClassRaces=function(filterClassRaces){$scope.filterClassRaces=filterClassRaces;_starter();$scope.search();return false};
3$scope.setFilterByEventClassRace=function(event,eventClass,eventRace){$scope.event=event;$scope.eventClass=eventClass;$scope.eventRace=eventRace;$scope.filteredData=$filter("filter")($scope.items,function(item){var x=false;if(!angular.isUndefined($scope.query)){angular.forEach($scope.searchFields,function(attr){if(searchMatch(item[attr],$scope.query)){x=true}})}else{x=true}return x});if(!angular.isUndefined($scope.filteredData)&&!angular.isUndefined($scope.event)&&$scope.event.length>0){$scope.filteredData=$filter("filter")($scope.filteredData,function(item){if(searchContains(item.event,$scope.event)){return true}return false})}if(!angular.isUndefined($scope.filteredData)&&!angular.isUndefined($scope.eventClass)&&$scope.eventClass.length>0){$scope.filteredData=$filter("filter")($scope.filteredData,function(item){if(searchContains(item.class,$scope.eventClass)){return true}return false})}if(!angular.isUndefined($scope.filteredData)&&!angular.isUndefined($scope.eventRace)&&$scope.eventRace.length>0){$scope.filteredData=$filter("filter")($scope.filteredData,function(item){if(searchContains(item.race,$scope.eventRace)){return true}return false})}return false};$scope.search=function(){$scope.filteredItems=$filter("filter")($scope.items,function(item){var x=false;if(!angular.isUndefined($scope.query)){angular.forEach($scope.searchFields,function(attr){if(searchMatch(item[attr],$scope.query)){x=true}})}else{x=true}return x});$scope.filteredTabs=$filter("filter")($scope.races[$scope.filterEvent][$scope.filterClass],function(tab){var x=false;$scope.tabsRaces=[];angular.forEach($scope.races[$scope.filterEvent][$scope.filterClass],function(raceName){$scope.tabsRaces.push(raceName)})});if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterEvent)&&$scope.filterEvent.length>0){$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){if(searchContains(item.event,$scope.filterEvent)){return true}return false})}if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterClass)&&$scope.filterClass.length>0){$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){if(searchContains(item.class,$scope.filterClass)){return true}return false})}if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterClassRaces)&&$scope.filterClassRaces.length>0){$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){if(searchContains(item.race,$scope.filterClassRaces)){return true}return false})}$scope.filteredOverall=$filter("filter")($scope.overall,function(item){if(searchContains(item.event,$scope.filterEvent)){if(searchContains(item.class,$scope.filterClass)){return true}}return false});$scope.loadData()};$scope.trustSrc=function(src){return $sce.trustAsResourceUrl(src)};$scope.loadData=function(){$scope.loadedRace=$scope.filteredItems;if($scope.filteredOverall.length>0){$scope.noOverall=false}$scope.loadedOverall=$scope.filteredOverall;$scope.isLoading=false};$scope.windowOpen=function(url,title,options){$window.open(url,title,options)};$scope.show_more=function(){$scope.page+=1;$scope.loadData()};$scope.show_more_Infinite=function(){$scope.page++;$scope.loadData()};$scope.has_more=function(){return $scope.more}}}]);"use strict";angular.module("Slideshow",["services.HttpService","directives.spinner","directives.resizables","ngSanitize","Scope.safeApply"]).controller("SlideshowController",["$scope","$filter","HttpService","$window","preloader","$timeout","$rootScope","CommonFactory",function($scope,$filter,HttpService,$window,preloader,$timeout,$rootScope,CommonFactory){var searchMatch=function(haystack,needle){if(!needle){return true}return haystack.toLowerCase().indexOf(needle.toLowerCase())!==-1};var searchContains=function(string,substr){return string.indexOf(substr)!=-1};var searchDate=function(string,filterBy){string=string.substr(0,10);var nowDate=moment().utc().format("YYYY-MM-DD");if(filterBy=="="){if(string==nowDate){return true}}else if(filterBy==">"){if(string>nowDate){return true}}else if(filterBy==">="){if(string>=nowDate){return true}}else if(filterBy=="<"){if(string<nowDate){return true}}else if(filterBy=="<="){if(string<=nowDate){return true}}return false};
3$scope.init=function(url,slideId,filterDefault,noSlide,onRenderAction){$scope.itemsPerPage=50;$scope.url=url;$scope.filterDefault=filterDefault;$scope.slideId=slideId;$scope.noSlide=noSlide;$scope.onRenderAction=onRenderAction;$scope.page=1;$scope.firstLoad=true;$scope.filterClass=false;$scope.filterClass2=false;$scope.filterClass3=false;$scope.clickItem=function(axn){if(typeof $scope[axn]=="function"){$timeout(function(){$scope[axn]()})}else if(axn.substring(0,1)=="/"||axn.substring(0,4)=="http"){$timeout(function(){window.location=axn})}};$scope.starter=function(){$scope.index=0;$scope.data=[];$scope.page=1;$scope.results=[];$scope.pagedItemsLoaded=[];$scope.pagedItemsLoadedPreload=[];$scope.imageLocations=[];$scope.more=true;$scope.moreLoad=false;$scope.status_bar="";$scope.isLoading=true;$scope.noresults=false;$scope.isSuccessful=false;$scope.percentLoaded=0;$scope.preloader=false;$scope.$on("ngRepeatFinished",function(){if(!$scope.noSlide){$("#"+$scope.slideId+" .slides").fotorama();$(window).resize(function(){$scope.centerBox()});$("#"+$scope.slideId+" .slides").on("fotorama:show",function(e,fotorama){$scope.centerBox()});$scope.initVideoBackground();$("#"+$scope.slideId+" .slides").on("fotorama:load",function(e,fotorama){$scope.centerBox();if($scope.onRenderAction){var funcName=$scope.onRenderAction.replace("()","");$timeout(function(){if(typeof window[funcName]=="function"){eval(funcName)}else if(typeof $scope[funcName]=="function"){$scope[funcName]()}},900)}});$scope.videoAutoplay=function(){if(!angular.isUndefined($scope.autoplayMedia)){return}$scope.autoplayMedia=[];$("#"+$scope.slideId+" .slides video").each(function(){if($(this).parent().prop("tagName")=="MEDIAELEMENTWRAPPER"){return}var player=new MediaElement(this,{startVolume:0,pauseOtherPlayers:false,alwaysShowControls:false,width:"100%",features:[],youtube:{iv_load_policy:3,modestbranding:0,autoplay:1,controls:0,showinfo:0,wmode:"opaque",branding:0,autohide:0,playsinline:1,loop:1,mute:1},success:function(mediaElement,domObject){}});$scope.autoplayMedia.push(player)});$timeout(function(){angular.forEach($scope.autoplayMedia,function(a,b){if(a.id==$("#video-autoplay-"+$scope.slideId+"-"+$scope.currentSlide).attr("id")){a.play()}else{a.pause()}})})};$("#"+$scope.slideId+" .slides").on("fotorama:showend",function(e,fotorama){if(fotorama.activeIndex!=$scope.currentSlide){$("#"+$scope.slideId+" .slides video").each(function(){if($(this).parent().prop("tagName")=="MEDIAELEMENTWRAPPER"){return}else{var player=new MediaElement(this,{startVolume:0,pauseOtherPlayers:false,alwaysShowControls:false,width:"100%",features:[],youtube:{iv_load_policy:3,modestbranding:0,autoplay:1,controls:0,showinfo:0,wmode:"opaque",branding:0,autohide:0,playsinline:1,loop:1,mute:1},success:function(mediaElement,domObject){var videoRatio=9/16;var pHeight="";$(mediaElement).width("100%");$(mediaElement).children().width("100%");setTimeout(function(){var h=$(mediaElement).width()*videoRatio;$(mediaElement).children().height(h)})}});$scope.autoplayMedia.push(player)}});if(!angular.isUndefined($scope.autoplayMedia)){$timeout(function(){var videoRatio=9/16;angular.forEach($scope.autoplayMedia,function(a,b){if(a.id==$("#video-autoplay-"+$scope.slideId+"-"+$scope.currentSlide).attr("id")){$("#"+a.id).width("100%");$("#"+a.id).children().width("100%");setTimeout(function(){var h=$("#"+a.id).width()*videoRatio;$("#"+a.id).children().height(h)});a.play()}else{a.pause()}})})}if($("#YTPlayer-"+$scope.slideId+"-"+$scope.currentSlide).length&&typeof $("#YTPlayer-"+$scope.slideId+"-"+$scope.currentSlide).data("ytPlayer")!="undefined"){$("#YTPlayer-"+$scope.slideId+"-"+$scope.currentSlide).data("ytPlayer").player.pauseVideo()}$scope.currentSlide=fotorama.activeIndex;if($("#YTPlayer-"+$scope.slideId+"-"+$scope.currentSlide).length&&typeof $("#YTPlayer-"+$scope.slideId+"-"+$scope.currentSlide).data("ytPlayer")!="undefined"){$("#YTPlayer-"+$scope.slideId+"-"+$scope.currentSlide).data("ytPlayer").player.playVideo()}}});$("#"+$scope.slideId+" .slides").on("fotorama:load",function(e,fotorama){$scope.currentSlide=fotorama.activeIndex});$scope.centerBox();if($scope.onRenderAction){var funcName=$scope.onRenderAction.replace("()","");$timeout(function(){if(typeof window[funcName]=="function"){eval(funcName)}else if(typeof $scope[funcName]=="function"){$scope[funcName]()}},900)}$(window).resize(function(){if($scope.onRenderAction){var funcName=$scope.onRenderAction.replace("()","");$timeout(function(){if(typeof window[funcName]=="function"){eval(funcName)}else if(typeof $scope[funcName]=="function"){$scope[funcName]()}},900)}});$("#"+$scope.slideId+" .slide").removeClass("ng-cloak")}else if($("#"+$scope.slideId+" .bg-vid").length){var dataID=$("#"+$scope.slideId+" .bg-vid .YTPlayer").attr("video-id");if(dataID!=false){var showControls=0;if(!angular.isUndefined($("#"+$scope.slideId+" .bg-vid .YTPlayer").attr("data-show-controls"))){showControls=$("#"+$scope.slideId+" .bg-vid .YTPlayer").attr("data-show-controls")?1:0}setTimeout(function(){$("#"+$scope.slideId+" .bg-vid .YTPlayer").YTPlayer({fitToBackgroun
3d:true,videoId:dataID,width:$("#"+$scope.slideId+" .bg-vid .YTPlayer").width(),playerVars:{iv_load_policy:3,modestbranding:0,autoplay:1,controls:showControls,showinfo:0,wmode:"opaque",branding:0,autohide:0,playsinline:1},callback:function(){var player=$("#"+$scope.slideId+" .bg-vid .YTPlayer").data("ytPlayer").player;setTimeout(function(){$("#"+$scope.slideId+" .bg-vid .YTPlayer").addClass("active")},1e3)}})},700)}var dataImg=$("#"+$scope.slideId+" .bg-vid .YTPlayer").attr("data-img");$("#"+$scope.slideId+" .bg-vid .YTPlayer .top-image-container").css("background","url("+dataImg+") no-repeat transparent ")}})};$scope.initVideoBackground=function(){$("#"+$scope.slideId+" .YTPlayer").each(function(index){var itemId=$(this).attr("id");var dataID=$(this).attr("video-id");var showControls=0;if(!angular.isUndefined($("#"+itemId).attr("data-show-controls"))){showControls=$("#"+itemId).attr("data-show-controls")?1:0}$timeout(function(){$("#"+itemId).YTPlayer({fitToBackground:true,videoId:dataID,width:$("#"+itemId).width(),playerVars:{iv_load_policy:3,modestbranding:0,autoplay:1,controls:showControls,showinfo:0,wmode:"opaque",branding:0,autohide:0,playsinline:1},callback:function(){var player=$("#"+itemId).data("ytPlayer").player;if(index>0){player.pauseVideo()}}})})})};$scope.showVideo=function(){$("#"+$scope.slideId+" .bg-vid").addClass("show-video");var ytPlayer=$("#"+$scope.slideId+" .bg-vid .YTPlayer").data("ytPlayer").player;$timeout(function(){ytPlayer.unMute()})};$scope.safeApply($scope.starter());var params=[];HttpService.getDataUrl($scope.url,params).then(function(response){$scope.safeApply(function(){$scope.items=[];angular.forEach(response.data,function(item){if($scope.filterDefault){if(item.filter_class==$scope.filterDefault){$scope.items.push(item)}}else{$scope.items.push(item)}});$scope.search()})});$scope.search=function(){$scope.filteredItems=$filter("filter")($scope.items,function(item){var x=false;if(!angular.isUndefined($scope.query)){angular.forEach($scope.searchFields,function(attr){if(searchMatch(item[attr],$scope.query)){x=true}})}else{x=true}return x});$scope.currentPage=0;if($scope.filteredItems.length==0){$scope.safeApply(function(){$scope.isLoading=false;$scope.isSuccessful=true;$scope.more=false;$scope.noresults=true})}else{$scope.groupToPages()}if($scope.load==true){$scope.load=false}};$scope.loadData=function(){$scope.currentPage++;$scope.search()};$scope.groupToPages=function(){$scope.currentPage++;$scope.pagedItems=[];$scope.imageLocations=[];for(;$scope.index<$scope.itemsPerPage*$scope.page;$scope.index++){$scope.moreLoad=$scope.filteredItems.length>$scope.index;if($scope.moreLoad==false)break;$scope.filteredItems[$scope.index].extraClass="";if(!angular.isUndefined($scope.filteredItems[$scope.index].class)){$scope.filteredItems[$scope.index].extraClass=$scope.filteredItems[$scope.index].class}if(!angular.isUndefined($scope.filteredItems[$scope.index].class2)){$scope.filteredItems[$scope.index].extraClass+=" "+$scope.filteredItems[$scope.index].class2}if(!angular.isUndefined($scope.filteredItems[$scope.index].text_position)){$scope.filteredItems[$scope.index].extraClass+=" topstory-text-"+$scope.filteredItems[$scope.index].text_position+"-box"}if(!angular.isUndefined($scope.filteredItems[$scope.index].premium)){$scope.filteredItems[$scope.index].extraClass+=" "+$scope.filteredItems[$scope.index].premium}if(CommonFactory.isMobile()&&!angular.isUndefined($scope.filteredItems[$scope.index].title_mobile)){$scope.filteredItems[$scope.index].title=$scope.filteredItems[$scope.index].title_mobile}if($scope.filteredItems[$scope.index].media.length<1){$scope.filteredItems[$scope.index].extraClass+=" no-img"}else{if(CommonFactory.isMobile()&&$scope.filteredItems[$scope.index].mediaMobile!=false){$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].mediaMobile}else{$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].media}$scope["imageLocations"].push($scope.filteredItems[$scope.index].media)}if(!angular.isUndefined($scope.filteredItems[$scope.index].media2)){if(CommonFactory.isMobile()&&$scope.filteredItems[$scope.index].mediaMobile2!=false){$scope.filteredItems[$scope.index].mediaShow2=$scope.filteredItems[$scope.index].mediaMobile2}else{$scope.filteredItems[$scope.index].mediaShow2=$scope.filteredItems[$scope.index].media2}$scope["imageLocations"].push($scope.filteredItems[$scope.index].media2)}$scope.pagedItems.push($scope.filteredItems[$scope.index]);if($scope["filteredItems"][$scope["index"]].media[0]!==null){$scope["imageLocations"].push($scope["filteredItems"][$scope["index"]].media)}}$scope.safeApply(function(){angular.forEach($scope.pagedItems,function(item){$scope.s
3afeApply(function(){$scope.pagedItemsLoadedPreload.push(item)})});$scope.isLoading=false;$scope.isSuccessful=true;$scope.percentLoaded=0;if($scope.page==1){$scope.viewNext()}angular.element("#content-"+$scope.idData).fadeIn("fast")})};$scope.preload=function(imageLocations){preloader.preloadImages(imageLocations).then(function handleResolve(imageLocations){$scope.isLoading=false;$scope.isSuccessful=true;angular.forEach($scope.resultsPage,function(item){$scope.safeApply(function(){$scope.results.push(item)})});$scope.more=$scope.moreLoad;$scope.percentLoaded=0},function handleReject(imageLocation){$scope.isLoading=false;$scope.isSuccessful=false},function handleNotify(event){$scope.percentLoaded=event.percent})};$scope.preloadNextItems=function(noResults){$scope.page+=1;if($scope.firstLoad){$scope.firstLoad=false;$scope.isLoading=true;$scope.safeApply($scope.loadData())}else{$scope.safeApply($scope.loadData())}};$scope.viewNext=function(){angular.forEach($scope.pagedItems,function(item){$scope.safeApply(function(){$scope.pagedItemsLoaded.push(item)})});$scope.preloader=true;$scope.safeApply($scope.preloadNextItems());if($scope.pagedItems.length==0){$scope.more=false;$scope.isLoading=false}};$scope.centerBox=function(){setTimeout(function(){var fIndex=$("#"+$scope.slideId+" .slides").data("fotorama").activeFrame.html;if(fIndex){if($(fIndex).hasClass("center-box")){var slideContentHeight=$(fIndex).find("div.slide-content").height();$(fIndex).find("div.slide-content").css("margin-top",(slideContentHeight-slideContentHeight*2)/2)}}},100)}}}]);"use strict";angular.module("Tabs",["services.HttpService","directives.spinner","directives.resizables","ngSanitize","Scope.safeApply"]).controller("TabsController",["$scope","$filter","HttpService","$window","$location","preloader","$timeout","$interval","$rootScope","CommonFactory","$compile","$base64","COMMON",function($scope,$filter,HttpService,$window,$location,preloader,$timeout,$interval,$rootScope,CommonFactory,$compile,$base64,COMMON){var searchMatch=function(haystack,needle){if(!needle){return true}if(angular.isUndefined(haystack)){return false}return haystack.toLowerCase().indexOf(needle.toLowerCase())!==-1};var searchContains=function(string,substr){if(angular.isUndefined(string)){return false}else{if(string){return string.indexOf(substr)!=-1}else{return false}}};var searchContainsComma=function(string,substr){var i=0;var retVar=false;var exp=string.split(",");for(i=0;i<exp.length;i++){if(exp[i]==substr){retVar=true}}return retVar};var searchContainsSpace=function(string,substr){var i=0;var retVar=false;var exp=string.split(" ");for(i=0;i<exp.length;i++){if(exp[i]==substr){retVar=true}}for(i=0;i<exp.length;i++){if(exp[i]==substr){retVar=true}}return retVar};var searchDate=function(string,filterBy){string=string.substr(0,10);var nowDate=moment().utc().format("YYYY-MM-DD");if(filterBy=="="){if(string==nowDate){return true}}else if(filterBy==">"){if(string>nowDate){return true}}else if(filterBy==">="){if(string>=nowDate){return true}}else if(filterBy=="<"){if(string<nowDate){return true}}else if(filterBy=="<="){if(string<=nowDate){return true}}return false};$scope.getHashParams=function(){var urlParams={};var hashLoad=$location.hash();if(hashLoad){var hashParams=hashLoad.split("&");angular.forEach(hashParams,function(h){var h2=h.split("=");if(h2.length==2){urlParams[h2[0]]=h2[1]}else{urlParams[h2[0]]=true}})}return urlParams};$scope.setHashParams=function(params){var hash="";angular.forEach(params,function(val,key){hash+=key+"="+val+"&"});if(hash.substr(-1,1)=="&"){hash=hash.substr(0,hash.length-1)}$location.hash(hash)};$scope.itemsPrevNext=function(url,currentItem,sortBy){$scope.encodedUrl=url;$scope.currentItem=currentItem;$scope.sortBy=sortBy;$scope.allItems=[];$scope.prevItem="";$scope.nextItem="";$scope.urlDecoded=[];try{$scope.urlDecoded=angular.fromJson($base64.decode($scope.encodedUrl))}catch(e){}if(!angular.isUndefined($scope.urlDecoded.url)){HttpService.getDataUrl($scope.urlDecoded.url,[]).then(function(response){$scope.allItems=response.data;$scope.orderedItems=$filter("orderBy")($scope.allItems,$scope.sortBy,true);var currIndex=$scope.orderedItems.indexOf($filter("filter")($scope.orderedItems,{id:$scope.currentItem},true)[0]);if(currIndex>
3-1){$scope.safeApply(function(){if(!angular.isUndefined($scope.orderedItems[currIndex-1])){$scope.prevItem=$scope.orderedItems[currIndex-1];$scope.prevItem.mediaShow="";if(angular.isUndefined($scope.prevItem.media)||!$scope.prevItem.media||$scope.prevItem.media.length<1){$scope.prevItem.extraClass+=" no-img"}else{if(CommonFactory.isMobile()&&$scope.prevItem.mediaMobile!=false){$scope.prevItem.mediaShow=$scope.prevItem.mediaMobile}else{$scope.prevItem.mediaShow=$scope.prevItem.media}}}if(!angular.isUndefined($scope.orderedItems[currIndex+1])){$scope.nextItem=$scope.orderedItems[currIndex+1];$scope.nextItem.mediaShow="";if(angular.isUndefined($scope.nextItem.media)||!$scope.nextItem.media||$scope.nextItem.media.length<1){$scope.nextItem.extraClass+=" no-img"}else{if(CommonFactory.isMobile()&&$scope.nextItem.mediaMobile!=false){$scope.nextItem.mediaShow=$scope.nextItem.mediaMobile}else{$scope.nextItem.mediaShow=$scope.nextItem.media}}}})}})}};$scope.startYTPlayer=function(container){$(".YTPlayer",container).each(function(){var YTcontainer=$(this);var dataImg=YTcontainer.attr("data-img");YTcontainer.find(".top-image-container").css("background","url("+dataImg+") no-repeat transparent ");var dataID=YTcontainer.attr("video-id");var dataIDMobile=YTcontainer.attr("video-id-mobile");if(dataIDMobile!=undefined&&$(window).width()<=767){dataID=dataIDMobile}if(dataID!=undefined){setTimeout(function(){if(YTcontainer.data("ytPlayer")==undefined){YTcontainer.YTPlayer({fitToBackground:true,playOnlyIfVisible:true,videoId:dataID,playerVars:{iv_load_policy:3,modestbranding:0,autoplay:1,controls:0,showinfo:0,wmode:"opaque",branding:0,autohide:0,playsinline:1},width:$(".YTPlayer").width(),callback:function(){setTimeout(function(){$(".YTPlayer").addClass("active")},1e3)}})}},700)}})};$scope.videoHoverAngularTabs=function(){var container=document.querySelectorAll(".more-items-item");if(container.length){for(var i=0;i<container.length;i++){var video=container[i].getElementsByClassName("hover-video");var YTvideo=container[i].getElementsByClassName("YTPlayer");if(video&&video.length&&YTvideo.length==0){container[i].onmouseenter=$scope.liOnHover;container[i].onmouseleave=$scope.liHideHover}if(YTvideo&&YTvideo.length){$scope.startYTPlayer(container[i]);container[i].onmouseenter=$scope.liOnHoverYT;container[i].onmouseleave=$scope.liHideHoverYT}}}};$scope.videoHoverMoreItems=function(){var container=$(".more-items-item");if(container.length){for(var i=0;i<container.length;i++){var video=container[i].getElementsByTagName("video");var YTvideo=container[i].getElementsByClassName("YTPlayer");if(video&&video.length&&YTvideo.length==0){container[i].onmouseenter=$scope.liOnHover;container[i].onmouseleave=$scope.liHideHover}if(YTvideo&&YTvideo.length){$scope.startYTPlayer()}}}};$scope.liOnHover=function(e){$("video",this).get(0).play()};$scope.liOnHoverYT=function(e){console.log($(".YTPlayer",this))};$scope.liHideHover=function(e){$("video",this).get(0).pause();$("video",this).get(0).currentTime=0};$scope.liHideHoverYT=function(e){};$scope.getYTID=function(link){var ID=link.substring(link.indexOf("=")+1);return ID};$scope.initSchedule=function(url,filter,defaultTab,orderTab){$scope.loadedTabs={};$scope.selectedTab=undefined;$scope.orderTab=orderTab;var params=[];HttpService.getDataUrl(url,params).then(function(response){var items=response.data;angular.forEach(items,function(item){var filterValue=item[filter];if(!$scope.loadedTabs[filterValue]){$scope.loadedTabs[filterValue]=[]}$scope.loadedTabs[filterValue].push(item)});if(orderTab){Object.keys($scope.loadedTabs).forEach(tab=>{$scope.loadedTabs[tab].sort($scope.sortTabs)})}if(defaultTab){switch(defaultTab){case"getToday":var today=new Date;var tab=1;var selectedTab=undefined;angular.forEach($scope.loadedTabs,function(value,key){var tabDate=$scope.parseCustomDate(key);if(tab==1&&today<tabDate){selectedTab=key}else if(tab==$scope.loadedTabs.length&&today>tabDate){selectedTab=key}else if(today==tabDate){selectedTab=key}tab++});if(selectedTab){$scope.changeTab(selectedTab)}else{$scope.changeTab()}break;default:$scope.changeTab(defaultTab);break}}else{$scope.changeTab()}}).catch(function(error){console.error("Error:",error)});$scope.setLocalTimeZone=function(item,value){const stringDate=item[value];if(stringDate){const parts=stringDate.split(/[- :]/);
3const utcDate=new Date(Date.UTC(parts[0],parts[1]-1,parts[2],parts[3],parts[4],parts[5]));const hours=utcDate.getHours();const minutes=utcDate.getMinutes();const formattedTime=`${String(hours).padStart(2,"0")}:${String(minutes).padStart(2,"0")}`;return formattedTime}return undefined};$scope.sortTabs=function(a,b){return a[$scope.orderTab]-b[$scope.orderTab]};$scope.changeTab=function(tab){if(tab){$scope.loadedItems=$scope.loadedTabs[tab];$scope.selectedTab=tab}else{$scope.loadedItems=$scope.loadedTabs[0];$scope.selectedTab=Object.keys($scope.loadedTabs[0])}};$scope.parseCustomDate=function(inputDate){const months=["january","february","march","april","may","june","july","august","september","october","november","december"];const parts=inputDate.split(" ");if(parts.length!==2){return null}const day=parseInt(parts[0],10);const monthIndex=months.findIndex(month=>month===parts[1].toLowerCase());if(day<1||day>31||monthIndex===-1){return null}const date=new Date;date.setDate(day);date.setMonth(monthIndex);return date}};$scope.init=function(url,per_page,imageDefault,idData,scrollId,firstAction,filterId,groupFilters,searchParams,onRenderAction,fotoramaId,owlSlider,noMain,contentIframe,groupSubsectionsClass,noPageRemember,simplePaginator,jsonTabs,groupBy,parentFilter,oneItemActionField,filterHash,sliderConfig,dynamicTabsField,scrollpx,lambdaJson,interval,filterByCountry,requestId){if(interval){$interval(function(){$scope.reloadInterval()},interval*60*1e3)}$scope.filterByCountry=filterByCountry;$scope.idData=idData;$scope.scrollPlus=scrollpx?scrollpx:$("body.fixed-header #header").height();$scope.scrollId=scrollId;$scope.firstAction=firstAction;$scope.fieldsByType=["class","class2","class3"];$scope.imageDefault=imageDefault;$scope.onSocial=false;$scope.onRenderAction=onRenderAction;$scope.onRenderHeaderAction="";$scope.fotoramaId=fotoramaId;$scope.owlSlider=owlSlider;$scope.contentIframe=contentIframe;$scope.groupSubsectionsClass=groupSubsectionsClass;$scope.noPageRemember=noPageRemember;$scope.tabsSubsections={};$scope.filteredSubsection="";$scope.filterId=filterId;$scope.allGroups=groupFilters;$scope.searchParams=searchParams;$scope.searchFields=["title","short_text","numero"];$scope.searchParam="";$scope.contentIframeHtml="";$scope.groupFilters=[];$scope.axnLoaded={};$scope.jsonTabs=jsonTabs;$scope.simplePaginator=simplePaginator;$scope.groupBy=groupBy;$scope.parentFilter=parentFilter;$scope.oneItemActionField=oneItemActionField;$scope.filterHash=filterHash;$scope.sliderConfig=sliderConfig;$scope.dynamicTabsField=dynamicTabsField;$scope.dynamicTabsClass=[];$scope.extraTabsCurrentHash={};$scope.window=$window;$scope.requestId=requestId;if(!angular.isUndefined($scope.allGroups)){var allGroups=$scope.allGroups.split("|");angular.forEach(allGroups,function(data){var groupsData=data.split(",");$scope.groupFilters.push(groupsData)})}$scope.itemsPerPage=per_page;if($scope.itemsPerPage==9999||$scope.itemsPerPage=="9999"||$scope.noPageRemember){$scope.noHashPages=true}$scope.url=url;$scope.lambdaJson=lambdaJson;if($scope.searchParams){$scope.url+="?txt="+$location.search()["txt"];$scope.searchParam=$location.search()["txt"]}$scope.page=1;$scope.totalPages=1;$scope.firstLoad=true;$scope.filterMain=false;if(!$scope.filterId&&!noMain){$scope.filterMain=true}$scope.filterDate=false;$scope.filterDateAlways=false;$scope.filterTag=false;$scope.filterCustom=false;$scope.multipleFilter=[];$scope.filterClass=false;$scope.filterClass2=false;$scope.filterClass3=false;$scope.filterSlider=false;$scope.filterAlways=false;$scope.filterAlwaysField=false;$scope.allFilters={};$scope.searchFilter="";$scope.extraTabs=[];$scope.noHashLoad=false;$scope.noFirstScroll=false;$scope.setItemMediaShow=function(item){item.mediaShow=$scope.imageDefault;if(angular.isUndefined(item.media)||!item.media||item.media.length<1){if(angular.isUndefined(item.mediaForce)||item.mediaForce.length<1){if(item.extraClass&&!item.extraClass.includes("no-img")){item.extraClass+=" no-img"}}}else{if(CommonFactory.isMobile()&&item.mediaMobile!=false){item.mediaShow=item.mediaMobile}else{item.mediaShow=item.media}}if(!angular.isUndefined(item.media2)){if(CommonFactory.isMobile()&&item.mediaMobile2!=false){item.mediaShow2=item.mediaMobile2}else{item.mediaShow2=item.media2}}if(!angular.isUndefined(item.pages)&&item.pages.length>0){item.mediaShow=item.pages[0].medium}if(!angular.isUndefined(item.mediaForce)&&item.mediaForce){item.mediaShow=item.mediaForce;delete item.mediaForce}}
3;$scope.reloadInterval=function(){HttpService.getDataUrl($scope.url,[]).then(function(response){$scope.safeApply(function(){if(!response||!response.data){return}if(!angular.isUndefined(response.data.data)){try{var decodedData=$base64.decode(response.data.data);try{response.data=angular.fromJson(decodedData)}catch(e){console.log("decoded data not valid(2)")}}catch(e){console.log("decoded data not valid")}}if(!angular.isUndefined(response.data.hits)){response.data=response.data.hits.hits;angular.forEach(response.data,(item,index)=>{response.data[index]=item._source})}if(!angular.isUndefined(response.data.filters)){$scope.allFilters=response.data.filters}var responseItems=[];if(!angular.isUndefined(response.data.items)){responseItems=response.data.items}else{responseItems=response.data}if(!angular.isArray(responseItems)){return}angular.forEach(responseItems,function(item){Object.keys(item).forEach(key=>{if(typeof item[key]==="string"&&item[key].includes("fiaformulae-media.s3.amazonaws")){item[key]=item[key].replace("fiaformulae-media.s3.amazonaws","mediacdn.fiaformulae")}})});var responseItemIds={};angular.forEach(responseItems,function(item){if(item&&item.id!==undefined&&item.id!==null){responseItemIds[item.id]=true}if(item.dataMultipleMedia&&item.dataMultipleMedia["0"]&&item.dataMultipleMedia["0"].length>0){const transformedMedia=item.dataMultipleMedia["0"].map(mediaItem=>{const thumbnailValue=mediaItem.thumbnail;return{...mediaItem,media:thumbnailValue,mediaFirst:thumbnailValue,mediaMobile:thumbnailValue,mediaShow:thumbnailValue}});var hasExisting=item.id!==undefined&&item.id!==null&&$scope.items.some(existingItem=>existingItem.id===item.id);if(!hasExisting){transformedMedia.forEach(mediaItem=>{$scope.pagedItemsLoaded.push(mediaItem)})}else{transformedMedia.forEach(mediaItem=>{if(!$scope.pagedItemsLoaded.some(existingMedia=>existingMedia.title===mediaItem.title)){$scope.pagedItemsLoaded.push(mediaItem)}})}}else{let shouldAddItem=false;if($scope.filterByCountry){if(item.class=="ALL"){$scope.defaultCountryItem=item}if($scope.onRenderHeaderCountry){if(item.class==$scope.onRenderHeaderCountry){shouldAddItem=true}}else{shouldAddItem=true}}else{shouldAddItem=true}if(shouldAddItem){var existingItem=item.id!==undefined&&item.id!==null?$scope.items.find(x=>x.id===item.id):null;if(existingItem){angular.extend(existingItem,item);$scope.setItemMediaShow(existingItem)}else{item.extraClass=item.class;if(!angular.isUndefined(item.class2)){item.extraClass+=" "+item.class2}if(!angular.isUndefined(item.class3)){item.extraClass+=" "+item.class3}if(!angular.isUndefined(item.premium)){item.extraClass+=" "+item.premium}$scope.setItemMediaShow(item);$scope.items.push(item);$scope.pagedItemsLoaded.push(item)}}}});$scope.items=$scope.items.filter(existingItem=>!existingItem.id||responseItemIds[existingItem.id]);$scope.pagedItemsLoaded=$scope.pagedItemsLoaded.filter(existingItem=>!existingItem.id||responseItemIds[existingItem.id]);var responseItemOrder={};responseItems.forEach(function(item,index){if(item&&item.id!==undefined&&item.id!==null){responseItemOrder[item.id]=index}});var sortFunction=function(a,b){var indexA=a&&a.id!==undefined&&a.id!==null?responseItemOrder[a.id]:undefined;var indexB=b&&b.id!==undefined&&b.id!==null?responseItemOrder[b.id]:undefined;if(indexA===undefined&&indexB===undefined)return 0;if(indexA===undefined)return 1;if(indexB===undefined)return-1;return indexA-indexB};$scope.pagedItemsLoaded.sort(sortFunction);$scope.items.sort(sortFunction);if(angular.isArray($scope.filteredItems)){$scope.filteredItems.sort(sortFunction)}})})};$scope.isItemActive=function(item){let ret=false;if(item.time&&item.date_to){let currentTime=(new Date).getTime();let startTime=Date.parse(item.time+"Z");let endTime=Date.parse(item.date_to+"Z");ret=currentTime>startTime&¤tTime<endTime}return ret};$scope.isItemPast=function(item){let ret=false;if(item.time&&item.date_to){let currentTime=(new Date).getTime();let endTime=Date.parse(item.date_to+"Z");ret=currentTime>endTime}return ret};$scope.starter=function(){$scope.index=0;$scope.data=[];$scope.page=1;$scope.results=[];$scope.pagedItemsLoaded=[];$scope.pagedItemsLoadedPreload=[];$scope.imageLocations=[];$scope.more=true;$scope.moreLoad=false;$scope.status_bar="";if($scope.owlSlider){if($scope.hasOwlSlider){$("#"+$scope.idData+" .more-items-list").owlCarousel("destroy");$("#"+$scope.idData+" .more-items-list").removeClass("owl-carousel owl-theme")}else{var owlAPi;$scope.ready=function($api){owlAPi=$api}}}$scope.isLoading=true;$scope.noresults=false;$scope.isSuccessful=false;$scope.percentLoaded=0;$scope.preloader=false;$scope.$on("ngRepeatFinished",function(){if($scope.fotoramaId){setTimeout(function(){var $fotoramaDiv=$($scope.fotoramaId);$fotoramaDiv.fotorama()},1500)}if(!angular.isUndefined($scope.onRenderHeaderCountry)&&!$scope.filterByCountry){window.localStorage.setItem("country",$scope.onRenderHeaderCountry)}if(!angular.isUndefined($scope.onRenderHeaderTimeZone)&&!$scope.filterByCountry){window.localStorage.setItem("timeZone",$scope.onRenderHeaderTimeZone)}if($scope.onRenderAction){if(typeof window[$scope.onRenderAction.replace("()","")]=="function"){$timeout(function(){eval($scope.onRenderAction)})}if($scope.owlSlider){$scope.hasOwlSlider=true}}$scope.videoHoverAngularTabs()})};$scope.initData=function(onFinishLoad){if($scope.dynamicTabsField){$scope.dynamicTabsClass=[]}var params=[];HttpService.getDataUrl($scope.url,params).then(function(response,headers){if(response.headers("qiu-viewer-country")){$scope.onRenderHeaderCountry=response.headers("qiu-viewer-country")}if(response.headers("qiu-viewer-time-zone")){$scope.onRenderHeaderTimeZone=response.headers("qiu-viewer-time-zone")}$scope.safeApply(function(){if(!angular.isUndefined(response.data.data)){try{var decodedData=$base64.decode(response.data.data);try{response.data=angular.fromJson(decodedData)}
3catch(e){console.log("decoded data not valid(2)")}}catch(e){console.log("decoded data not valid")}}if(!angular.isUndefined(response.data.hits)){response.data=response.data.hits.hits;angular.forEach(response.data,(item,index)=>{response.data[index]=item._source})}$scope.items=[];if(!angular.isUndefined(response.data.filters)){$scope.allFilters=response.data.filters}if(!angular.isUndefined(response.data.items)){var responseItems=response.data.items}else{var responseItems=response.data}angular.forEach(responseItems,function(item){Object.keys(item).forEach(key=>{if(typeof item[key]==="string"&&item[key].includes("fiaformulae-media.s3.amazonaws")){item[key]=item[key].replace("fiaformulae-media.s3.amazonaws","mediacdn.fiaformulae")}})});if($scope.groupSubsectionsClass){angular.forEach(responseItems,function(item){if(angular.isUndefined(item.show_dropdown)){if(item.class&&angular.isUndefined($scope.tabsSubsections[item.class])){$scope.tabsSubsections[item.class]={slug:item.class,name:item.subsection}}}else{if(angular.isUndefined($scope.tabsSubsectionsSelect)){$scope.tabsSubsectionsSelect={}}if(item.class&&angular.isUndefined($scope.tabsSubsections[item.class])){$scope.tabsSubsectionsSelect[item.class]={slug:item.class,class:item.class.toLowerCase(),name:item.subsection};if(item.timezone){$scope.tabsSubsectionsSelect[item.class].timezone=item.timezone}}}})}if($scope.contentIframe){if($scope.requestId!=="false"&&$scope.requestId!==""){angular.forEach(responseItems,function(item){if(item.id==$scope.requestId){$scope.contentIframeHtml=item[$scope.contentIframe]}})}else{var hashLoad=$location.hash();if(hashLoad){var hashData=hashLoad.split("_");if(hashData.length==2){angular.forEach(responseItems,function(item){if(item.id==hashData[0]){$scope.contentIframeHtml=item[$scope.contentIframe]}})}}}$scope.isLoading=false}else{angular.forEach(responseItems,function(item){if($scope.filterId){if(item.id!=$scope.filterId){$scope.items.push(item)}}else if($scope.groupBy){$scope.items.push(item)}else{if($scope.firstAction&&$scope.firstAction.substr(0,5)=="CLASS"){if(item.class==$scope.firstAction.substr(5)){$scope.items.push(item)}else if(item.player&&item.player.teams&&item.player.teams.length>0&&item.player.teams[0].id_teams==$scope.firstAction.substr(5)){$scope.items.push(item)}}else if($scope.firstAction&&$scope.firstAction=="HASHCODE"){$scope.noHashLoad=true;if(item.code==$scope.getHashParams().code){$scope.items.push(item)}}else{$scope.items.push(item)}}});if($scope.firstAction){$scope.noFirstScroll=true;if($scope.firstAction&&$scope.firstAction=="DATENOW"){$scope.setFilterDateNow("",">=",true)}else if($scope.firstAction.substr(0,6)=="always"){$scope.setFilterAlways("",$scope.firstAction)}else if($scope.firstAction.substr(0,4)=="date"){$scope.setFilterDate($scope.firstAction.substr(5))}else if($scope.firstAction&&$scope.firstAction.substr(0,4)=="NONE"){$scope.search()}else if($scope.firstAction&&$scope.firstAction.substr(0,3)=="TAG"){$scope.filterTag=$scope.firstAction.substr(3);$scope.search()}else if($scope.firstAction&&$scope.firstAction.substr(0,5)=="CLASS"){$scope.search()}else if($scope.firstAction&&$scope.firstAction=="HASHCODE"){$scope.search()}else if($scope.firstAction&&$scope.firstAction.substr(0,12)=="FILTERCUSTOM"){$scope.setFilterCustom($scope.firstAction.substr(12),"",true);$scope.search()}else if($scope.firstAction&&$scope.firstAction.substr(0,17)=="HASHCLASSREQUIRED"){var expAction=$scope.firstAction.substr(17).split(";");var className=expAction[0];var hashParams=$scope.getHashParams();if(!angular.isUndefined(hashParams[className])&&hashParams[className].length>0){$scope.setFilterCustom(hashParams[className],"",true);$scope.search();if(expAction.length>1&&expAction[1].substr(0,10)=="_TABSFIELD"){$scope.dynamicTabsClass=[];$timeout(function(){var itemsFiltered=$filter("filter")($scope.items,{class:hashParams[className]},true);var dynamicTabs=$filter("unique")(itemsFiltered,$scope.dynamicTabsField);angular.forEach(dynamicTabs,function(item){if(item.class2){$scope.dynamicTabsClass.push({tabFilter:item.class2,name:item[$scope.dynamicTabsField]})}});if($scope.dynamicTabsClass.length){if(expAction[2]){var tab=$scope.dynamicTabsClass[expAction[2]-1]}else{var tab=$scope.dynamicTabsClass[0]}$timeout(function(){$scope.setFilterClass2(tab.tabFilter)})}},500)}}}else if($scope.firstAction&&$scope.firstAction.substr(0,7)=="_CLASS2"){$scope.setFilterClass2($scope.firstAction.substr(7))}else if($scope.firstAction&&$scope.firstAction.substr(0,7)=="_CLASS3"){$scope.setFilterClass3($scope.firstAction.substr(7))}else if($scope.firstAction&&$scope.firstAction=="_COUNTRYHASH"){var localCountry=window.localStorage.getItem("country");if(!localCountry&&$scope.onRenderHeaderCountry){localCountry=$scope.onRenderHeaderCountry;window.localStorage.setItem("country",localCountry)}if(localCountry&&localCountry.length>0){$scope.filterSelectSubsection("",localCountry);var localTimeZone=window.localStorage.getItem("timeZone");if(!localTimeZone&&$scope.onRenderHeaderTimeZone){localTimeZone=$scope.onRenderHeaderTimeZone;window.localStorage.setItem("timeZone",localTimeZone)}if(localTimeZone&&localTimeZone.length>0){$scope.filterSelectSubsection("",localTimeZone)}}else{$scope.search()}}else if($scope.firstAction&&$scope.firstAction.substr(0,10)=="_TABSFIELD"){if(!$scope.dynamicTabsClass.length){$scope.search()}else{if($scope.firstAction.substr(10)=="last"){var tab=$scope.dynamicTabsClass[$scope.dynamicTabsClass.length-1]}else{var tab=$scope.dynamicTabsClass[0]}$timeout(function(){$scope.setFilterClass2(tab.tabFilter)})}}else if($scope.firstAction&&$scope.firstAction.substr(0,6)=="_CLASS"){if($scope.firstAction.substr(6,6)=="PARENT"){var parentId=$scope.firstAction.substr(12);if(!angular.isUndefined($rootScope.parentFilters)&&!angular.isUndefined($rootScope.parentFilters[parentId])){$scope.items=$filter("filter")($scope.items,{id:$rootScope.parentFilters[parentId].id},function(item,filterId){return item!=filterId});$scope.setFilterClass($rootScope.parentFilters[parentId].filter)}else{$scope.search()}}else{$scope.setFilterClass($scope.firstAction.substr(6))}}else if($scope.firstAction.substr(0,1)=="_"){var axn=$scope.firstAction.substr(1);if(angular.isUndefined($scope.axnLoaded[axn])){$scope.axnLoaded[axn]=true;$scope[axn]()}$scope.search()}else{$scope.search()}}else{$scope.search()}var hashLoad=$location.hash();if(hashLoad.indexOf("=")==-1){if(!$scope.noHashLoad&&hashLoad&&!$scope.simplePaginator){setTimeout(function(){if($(".tab ."+hashLoad).length>0){$(".tab ."+hashLoad).click()}else if($('.tab [data-tab="'+hashLoad+'"]').length>0){$('.tab [data-tab="'+hashLoad+'"]').click()}},500)}}if(onFinishLoad){$scope[onFinishLoad]()}if($scope.sliderConfig){$scope.filterSlider="";$scope.sliderOptions={};try{$scope.sliderOptions=angular.fromJson($base64.decode($scope.sliderConfig))}catch(e){}if(!angular.isUndefined($scope.sliderOptions.stepsArray)){$scope.sliderItems=$scope.sliderOptions.stepsArray}else{$scope.filteredArray=$filter("unique")($scope.items,"slider_name");$scope.filteredArray2=$filter("orderBy")($scope.filteredArray,"slider_sort");$scope.sliderItems=[{value:""}];angular.forEach($scope.filteredArray2,function(sortedItem){if(sortedItem.slider_name){$scope.sliderItems.push({value:sortedItem.slider_name})}})}$scope.slider={options:{stepsArray:$scope.sliderItems,onChange:function(sliderId,modelValue,highValue,pointerType){$scope.setFilterSlider(modelValue,"",true)}}};$scope.sliderLoaded=true}}});if($scope.lambdaJson){$scope.resetSearchButton()}})};$scope.checkDate=function(item,groupBy){const dateStr=item[groupBy];const parsed=new Date(dateStr);if(isNaN(parsed)){return dateStr}if(item.time){const utcString=item.time.replace(" ","T")+"Z";const timeDate=new Date(utcString);if(!isNaN(timeDate)){return timeDate.toLocaleDateString("es-ES",{day:"2-digit",month:"short",year:"numeric"})}}return dateStr};$scope.initFilters=function(){var filters=[];for(var filter in $scope.activeFilters){if($scope.activeFilters[filter]){filters.push(filter)}}var filteredItems=$scope.filteredTotal.filter(item=>{var x=true;for(var i=0;i<filters.length;i++){if(item[filters[i]]!=$scope.activeFilters[filters[i]]){x=false}}return x});$scope.filteredItems=filteredItems;
3$scope.groupToPages()};if(jsonTabs){HttpService.getDataUrl($scope.jsonTabs,[]).then(function(response){var hashParams=$scope.getHashParams();angular.forEach(response.data,function(tabs,key){if(key!="items"){var watchHash=false;var newTab={name:key,items:[]};angular.forEach(tabs,function(tab){if(!angular.isUndefined(tab.hash)&&!angular.isUndefined(hashParams[newTab.name])){if(tab.hash==hashParams[newTab.name]){$scope.url=tab.url;newTab.current=tab.name}}else{if(tab.default==1){$scope.url=tab.url;newTab.current=tab.name}}var newItem={name:tab.name,filter:tab.filter,url:tab.url,class:tab.class};if(!angular.isUndefined(tab.hash)){newItem.hash=tab.hash;watchHash=true}newTab.items.push(newItem)});if(!newTab.current){angular.forEach(newTab.items,function(tab){if(tab.default==1){$scope.url=tab.url;newTab.current=tab.name}})}$scope.extraTabs.push(newTab)}});$scope.safeApply($scope.starter());$scope.initData()})}else{$scope.safeApply($scope.starter());$scope.initData()}$scope.extraTabChange=function(tab,parentTab){if(!angular.isUndefined(tab.filter)){if(tab.filter=="feed"){$scope.isLoading=true;if(parentTab){parentTab.current=tab.name;if(tab.hash){var hashParams=$scope.getHashParams();hashParams[parentTab.name]=tab.hash;$scope.setHashParams(hashParams)}else{$timeout(function(){$scope.initData()},500)}}$scope.url=tab.url;$scope.filteredItems=[];$scope.safeApply($scope.starter())}}};$scope.tabAction=function(tab,parentTab){if(!angular.isUndefined(tab.filter)){if(tab.filter=="feed"){$scope.isLoading=true;if(parentTab){parentTab.current=tab.name;if(tab.hash){var hashParams=$scope.getHashParams();hashParams[parentTab.name]=tab.hash;$scope.setHashParams(hashParams)}}$scope.url=tab.url;$scope.filteredItems=[];$scope.safeApply($scope.starter());$timeout(function(){$scope.initData()},500)}}};$scope.historyDirection=1;if(!$scope.noPageRemember){if(sessionStorage.getItem("stateLastShown")){if(sessionStorage.getItem("stateLastShown")*1==window.history.length-1){$scope.historyDirection=-1}else{sessionStorage.setItem("stateLastShown",window.history.length)}}else{$scope.historyDirection=window.history.length;sessionStorage.setItem("currentPage",1);sessionStorage.setItem("stateLastShown",window.history.length)}}$scope.search=function(){$scope.filteredItems=$filter("filter")($scope.items,function(item){var x=false;if(!angular.isUndefined($scope.query)){angular.forEach($scope.searchFields,function(attr){if(searchMatch(item[attr],$scope.query)){x=true}})}else{x=true}return x});if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterAlways)&&$scope.filterAlways.length>0){$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){if(searchContains(item[$scope.filterAlwaysField],$scope.filterAlways)){return true}return false})}if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterDateAlways)&&$scope.filterDateAlways.length>0){$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){if(searchDate(item.datefilter,$scope.filterDateAlways)){return true}return false})}if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterDate)&&$scope.filterDate.length>0){$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){if(searchDate(item.datefilter,$scope.filterDate)){return true}return false})}if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterCustom)&&$scope.filterCustom.length>0){$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){return $rootScope.tabsCustomFilter(item,$scope.filterCustom)})}if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.multipleFilter)&&Object.keys($scope.multipleFilter).length>0){$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){var fetch=0;var count=0;Object.keys($scope.multipleFilter).forEach(filter=>{count++;if(item.class.indexOf($scope.multipleFilter[filter])!=-1){fetch++}});if(fetch==count){return true}else{return false}})}if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterClass)&&$scope.filterClass.length>0){$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){if(item.class&&searchContainsSpace(item.class,$scope.filterClass)){return true}return false})}if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterClass2)&&$scope.filterClass2.length>0){$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){if(item.class2&&searchContainsSpace(item.class2,$scope.filterClass2)){return true}return false})}if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterClass3)&&$scope.filterClass3.length>0){$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){if(item.class3&&searchContainsSpace(item.class3,$scope.filterClass3)){return true}return false})}if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterSlider)&&$scope.filterSlider.length>0){$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){if(searchContains(item.slider_name,$scope.filterSlider)){return true}return false})}if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterTag)&&$scope.filterTag.length>0){$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){if(item.tags&&searchContainsComma(item.tags,$scope.filterTag)){return true}return false})}if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterMain)&&$scope.filterMain==true){$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){if(!angular.isUndefined(item.main)){return true}return false})}if($scope.oneItemActionField&&$scope.filteredItems.length==1&&!angular.isUndefined($scope.filteredItems[0][$scope.oneItemActionField])){eval($scope.filteredItems[0][$scope.oneItemActionField])}$scope.currentPage=0;if(angular.isUndefined($scope.filteredItems)){return}$scope.totalPages=Math.ceil($scope.filteredItems.length/($scope.itemsPerPage*1));$scope.paginatorPages=[];for(var i=1;i<=$scope.totalPages;i++){$scope.paginatorPages.push(i)}if($scope.simplePaginator){if($scope.filteredSearch){$scope.paginatorPage=1;$scope.currentPage=1;$scope.goToPage(1);$scope.filteredSearch=false}else{var hashParams=$scope.getHashParams();if(!angular.isUndefined(hashParams.page)){$scope.paginatorPage=hashParams.page*1;$scope.currentPage=hashParams.page*1}else{$scope.paginatorPage=1;$scope.currentPage=1}}}else{if($scope.filteredItems&&$scope.filteredItems.length==0){if($scope.filterTag.length>0){if(!angular.isUndefined($scope["urlLoadTag"+$scope.filterTag])&&angular.isUndefined($scope["filterLoadTag"+$scope.filterTag])){$scope.preloadNextItems(1)}
3else{$scope.safeApply(function(){$scope.isLoading=false;$scope.isSuccessful=true;$scope.more=false;$scope.noresults=true})}}else{if(!angular.isUndefined($scope["urlLoad"+$scope.filterClass])&&angular.isUndefined($scope["filterLoad"+$scope.filterClass])||!angular.isUndefined($scope["urlLoad"+$scope.filterClass2])&&angular.isUndefined($scope["filterLoad"+$scope.filterClass2])){$scope.preloadNextItems(1)}else{$scope.safeApply(function(){$scope.isLoading=false;$scope.isSuccessful=true;$scope.more=false;$scope.noresults=true})}}}else if($scope.filteredItems){$scope.groupToPages()}}if($scope.load==true){$scope.load=false}};$scope.loadData=function(){$scope.currentPage++;$scope.search()};$scope.loadCurrentPage=function(){$scope.index=($scope.currentPage-1)*$scope.itemsPerPage;$scope.pagedItemsLoaded=[];$scope.imageLocations=[];if(angular.isUndefined($scope.filteredItems))return;for(;$scope.index<$scope.itemsPerPage*$scope.currentPage;$scope.index++){if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filteredItems[$scope.index])){$scope.filteredItems[$scope.index].extraClass=$scope.filteredItems[$scope.index].class;if(!angular.isUndefined($scope.filteredItems[$scope.index].class2)){$scope.filteredItems[$scope.index].extraClass+=" "+$scope.filteredItems[$scope.index].class2}if(!angular.isUndefined($scope.filteredItems[$scope.index].class3)){$scope.filteredItems[$scope.index].extraClass+=" "+$scope.filteredItems[$scope.index].class3}if(!angular.isUndefined($scope.filteredItems[$scope.index].premium)){$scope.filteredItems[$scope.index].extraClass+=" "+$scope.filteredItems[$scope.index].premium}$scope.filteredItems[$scope.index].mediaShow=$scope.imageDefault;if(angular.isUndefined($scope.filteredItems[$scope.index].media)||!$scope.filteredItems[$scope.index].media||$scope.filteredItems[$scope.index].media.length<1){if(angular.isUndefined($scope.filteredItems[$scope.index].mediaForce)||$scope.filteredItems[$scope.index].mediaForce.length<1){$scope.filteredItems[$scope.index].extraClass+=" no-img"}}else{if(CommonFactory.isMobile()&&$scope.filteredItems[$scope.index].mediaMobile!=false){$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].mediaMobile}else{$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].media}$scope["imageLocations"].push($scope.filteredItems[$scope.index].media);if($scope.filterMain&&$scope.index<1){if(CommonFactory.isMobile()&&$scope.filteredItems[$scope.index].mediaMobile!=false){$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].mediaMobile}else if($scope.filteredItems[$scope.index].mediaFirst&&$scope.filteredItems[$scope.index].mediaFirst.length>0){$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].mediaFirst}else{$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].media}$scope["imageLocations"].push($scope.filteredItems[$scope.index].mediaFirst)}}if(!angular.isUndefined($scope.filteredItems[$scope.index].media2)){if(CommonFactory.isMobile()&&$scope.filteredItems[$scope.index].mediaMobile2!=false){$scope.filteredItems[$scope.index].mediaShow2=$scope.filteredItems[$scope.index].mediaMobile2}else{$scope.filteredItems[$scope.index].mediaShow2=$scope.filteredItems[$scope.index].media2}$scope["imageLocations"].push($scope.filteredItems[$scope.index].media2)}if(!angular.isUndefined($scope.filteredItems[$scope.index].pages)&&$scope.filteredItems[$scope.index].pages.length>0){if(CommonFactory.isMobile()&&$scope.filteredItems[$scope.index].mediaMobile!=false){$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].pages[0].medium}else{$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].pages[0].medium}$scope["imageLocations"].push($scope.filteredItems[$scope.index].pages[0].medium);if($scope.filterMain&&$scope.index<1){$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].pages[0].medium;$scope["imageLocations"].push($scope.filteredItems[$scope.index].pages[0].medium)}}if(!angular.isUndefined($scope.filteredItems[$scope.index].mediaForce)&&$scope.filteredItems[$scope.index].mediaForce){$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].mediaForce;delete $scope.filteredItems[$scope.index].mediaForce}$scope.pagedItemsLoaded.push($scope.filteredItems[$scope.index])}}console.log("$scope.pagedItemsLoaded 1",$scope.pagedItemsLoaded)};$scope.groupToPages=function(){$scope.pagedItems=[];$scope.currentPage++;$scope.imageLocations=[];for(;$scope.index<$scope.itemsPerPage*$scope.page;$scope.index++){$scope.moreLoad=$scope.filteredItems.length>$scope.index;if($scope.moreLoad==false)break;$scope.filteredItems[$scope.index].extraClass=$scope.filteredItems[$scope.index].class;if(!angular.isUndefined($scope.filteredItems[$scope.index].class2)){$scope.filteredItems[$scope.index].extraClass+=" "+$scope.filteredItems[$scope.index].class2}if(!angular.isUndefined($scope.filteredItems[$scope.index].class3)){$scope.filteredItems[$scope.index].extraClass+=" "+$scope.filteredItems[$scope.index].class3}if(!angular.isUndefined($scope.filteredItems[$scope.index].premium)){$scope.filteredItems[$scope.index].extraClass+=" "+$scope.filteredItems[$scope.index].premium}$scope.filteredItems[$scope.index].mediaShow=$scope.imageDefault;if(angular.isUndefined($scope.filteredItems[$scope.index].media)||!$scope.filteredItems[$scope.index].media||$scope.filteredItems[$scope.index].media.length<1){if(angular.isUndefined($scope.filteredItems[$scope.index].mediaForce)||$scope.filteredItems[$scope.index].mediaForce.length<1){$scope.filteredItems[$scope.index].extraClass+=" no-img"}}else{if(CommonFactory.isMobile()&&$scope.filteredItems[$scope.index].mediaMobile!=false){$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].mediaMobile}else{$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].media}$scope["imageLocations"].push($scope.filteredItems[$scope.index].media);if($scope.filterMain&&$scope.index<1){if(CommonFactory.isMobile()&&$scope.filteredItems[$scope.index].mediaMobile!=false){$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].mediaMobile}else if($scope.filteredItems[$scope.index].mediaFirst&&$scope.filteredItems[$scope.index].mediaFirst.length>0){$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].mediaFirst}else{$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].media}$scope["imageLocations"].push($scope.filteredItems[$scope.index].mediaFirst)}}if(!angular.isUndefined($scope.filteredItems[$scope.index].media2)){if(CommonFactory.isMobile()&&$scope.filteredItems[$scope.index].mediaMobile2!=false){$scope.filteredItems[$scope.index].mediaShow2=$scope.filteredItems[$scope.index].mediaMobile2}else{$scope.filteredItems[$scope.index].mediaShow2=$scope.filteredItems[$scope.index].media2}$scope["imageLocations"].push($scope.filteredItems[$scope.index].media2)}if(!angular.isUndefined($scope.filteredItems[$scope.index].pages)&&$scope.filteredItems[$scope.index].pages.length>0){if(CommonFactory.isMobile()&&$scope.filteredItems[$scope.index].mediaMobile!=false){$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].pages[0].medium}else{$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].pages[0].medium}$scope["imageLocations"].push($scope.filteredItems[$scope.index].pages[0].medium);if($scope.filterMain&&$scope.index<1){$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].pages[0].medium;$scope["imageLocations"].push($scope.filteredItems[$scope.index].pages[0].medium)}}if(!angular.isUndefined($scope.filteredItems[$scope.index].mediaForce)&&$scope.filteredItems[$scope.index].mediaForce){$scope.filteredItems[$scope.index].mediaShow=$scope.filteredItems[$scope.index].mediaForce;delete $scope.filteredItems[$scope.index].mediaForce}$scope.pagedItems.push($scope.filteredItems[$scope.index]);if(!angular.isUndefined($scope.filteredItems[$scope.index].media)&&$scope.filteredItems[$scope.index].media){if($scope["filteredItems"][$scope["index"]].media[0]!==null){$scope["imageLocations"].push($scope["filteredItems"][$scope["index"]].media)}}}$scope.safeApply(function(){angular.forEach($scope.pagedItems,function(item){$scope.s
3afeApply(function(){$scope.pagedItemsLoadedPreload.push(item)})});$scope.isLoading=false;$scope.isSuccessful=true;$scope.percentLoaded=0;if($scope.page==1){$scope.viewNext()}else if($scope.historyDirection<1&&$scope.page<=sessionStorage.getItem("currentPage")){if($scope.page==sessionStorage.getItem("currentPage")*1){var currentItems=($scope.page-1)*$scope.itemsPerPage;var newTop="";$timeout(function(){try{newTop=$("#"+$scope.idData+" li:nth-child("+currentItems+")").offset().top;$("html,body").animate({scrollTop:newTop},0,"")}catch(e){}},1e3)}$scope.viewNext()}if(angular.isUndefined(COMMON.DISABLE_FADES)){angular.element("#content-"+$scope.idData).fadeIn("fast")}else{angular.element("#content-"+$scope.idData).show()}})};$scope.preload=function(imageLocations){preloader.preloadImages(imageLocations).then(function handleResolve(imageLocations){$scope.isLoading=false;$scope.isSuccessful=true;angular.forEach($scope.resultsPage,function(item){$scope.safeApply(function(){$scope.results.push(item)})});$scope.more=$scope.moreLoad;$scope.percentLoaded=0},function handleReject(imageLocation){$scope.isLoading=false;$scope.isSuccessful=false},function handleNotify(event){$scope.percentLoaded=event.percent})};$scope.windowOpen=function(url,title,options){$window.open(url,title,options)};$scope.preloadNextItems=function(noResults){if(!$scope.noPageRemember&&($scope.historyDirection==1||$scope.page>=sessionStorage.getItem("currentPage"))){sessionStorage.setItem("currentPage",$scope.page)}$scope.page+=1;if($scope.firstLoad){$scope.firstLoad=false;$scope.isLoading=true;$scope.safeApply($scope.loadData())}
3else{if($scope.filterMain==true){$scope.safeApply($scope.loadData())}else if(!angular.isUndefined($scope.filterTag)&&$scope.filterTag.length>0){if(!angular.isUndefined($scope["urlLoadTag"+$scope.filterTag])){if(!angular.isUndefined($scope["filterLoadTag"+$scope.filterTag])){$scope.safeApply($scope.loadData())}else{$scope["filterLoadTag"+$scope.filterTag]=$scope["urlLoadTag"+$scope.filterTag];$scope.safeApply($scope.preloadNextTabTag(noResults))}}else{$scope.safeApply($scope.loadData())}}else{if(!angular.isUndefined($scope["urlLoad"+$scope.filterClass])){if(!angular.isUndefined($scope["filterLoad"+$scope.filterClass])){$scope.safeApply($scope.loadData())}else{$scope["filterLoad"+$scope.filterClass]=$scope["urlLoad"+$scope.filterClass];$scope.safeApply($scope.preloadNextTab(noResults))}}else if(!angular.isUndefined($scope["urlLoad"+$scope.filterClass2])){if(!angular.isUndefined($scope["filterLoad"+$scope.filterClass2])){$scope.safeApply($scope.loadData())}else{$scope["filterLoad"+$scope.filterClass2]=$scope["urlLoad"+$scope.filterClass2];$scope.safeApply($scope.preloadNextTab(noResults))}}else{$scope.safeApply($scope.loadData())}}}};$scope.viewNext=function(){console.log("$scope.pagedItems",$scope.pagedItems);angular.forEach($scope.pagedItems,function(item){if(item.id_parent){let parentItem=$scope.pagedItems.find(x=>x.id===item.id_parent);if(parentItem){if(!parentItem.children){parentItem.children=[]}parentItem.children.push(item);return}}console.log("item",item);$scope.safeApply(function(){if(item.dataMultipleMedia&&item.dataMultipleMedia["0"]&&item.dataMultipleMedia["0"].length>0){const transformedMedia=item.dataMultipleMedia["0"].map(mediaItem=>{const thumbnailValue=mediaItem.thumbnail;return{...mediaItem,media:thumbnailValue,mediaFirst:thumbnailValue,mediaMobile:thumbnailValue,mediaShow:thumbnailValue}});$scope.pagedItemsLoaded=$scope.pagedItemsLoaded.concat(transformedMedia);console.log("$scope.pagedItemsLoaded 2",$scope.pagedItemsLoaded)}else{if($scope.filterByCountry){if(item.class=="ALL"){$scope.defaultCountryItem=item}if($scope.onRenderHeaderCountry){if(item.class==$scope.onRenderHeaderCountry){$scope.pagedItemsLoaded.push(item)}}else{$scope.pagedItemsLoaded.push(item)}}else{$scope.pagedItemsLoaded.push(item)}console.log("$scope.pagedItemsLoaded 3",$scope.pagedItemsLoaded)}})});if($scope.filterByCountry&&$scope.pagedItemsLoaded.length===0&&$scope.defaultCountryItem){$scope.s
3afeApply(function(){$scope.pagedItemsLoaded.push($scope.defaultCountryItem);console.log("$scope.pagedItemsLoaded 4",$scope.pagedItemsLoaded)})}$scope.preloader=true;if($scope.oneItemActionField&&$scope.filteredItems.length==1&&!angular.isUndefined($scope.filteredItems[0][$scope.oneItemActionField])){}else{if(!window.location.href.includes("how-to-watch")){$scope.safeApply($scope.preloadNextItems())}}if($scope.pagedItems.length==0){$scope.more=false;$scope.isLoading=false}};$scope.show_more=function(){$scope.viewNext()};$scope.pagePrev=function(){if($scope.paginatorPage>1){$scope.paginatorPage--}};$scope.pageNext=function(){if($scope.paginatorPage<$scope.totalPages){$scope.paginatorPage++}};$scope.goToPage=function(newPage){if(newPage>0&&newPage<=$scope.totalPages){$scope.isLoading=true;$scope.currentPage=newPage;$scope.safeApply(function(){$scope.loadCurrentPage()});if(!$scope.noHashPages){var hashParams=$scope.getHashParams();if(newPage==1){if(!angular.isUndefined(hashParams.page)){delete hashParams.page}}else{hashParams.page=newPage}$scope.setHashParams(hashParams)}if(!$scope.firstLoad){$scope.scrollTo($scope.idData,"")}$scope.firstLoad=false;$scope.isLoading=false}};$scope.$watch("paginatorPage",function(newPage){$scope.goToPage(newPage)});$rootScope.$on("site:hashChanged",function(){if(!$scope.noHashPages){var hashParams=$scope.getHashParams();if(angular.isUndefined(hashParams.page)){hashParams.page=1}if($scope.paginatorPage!=hashParams.page){$scope.paginatorPage=hashParams.page;$scope.goToPage(hashParams.page)}}});$scope.nextPage=function(){if($scope.currentPage<$scope.pagedItems.length-1){$scope.currentPage++}};$scope.show_more_Infinite=function(){$scope.page++;$scope.loadData()};$scope.has_more=function(){return $scope.more};$scope.setFilter=function(filter,value){$scope.starter();$scope.countByFilter();if(!$scope.activeFilters){$scope.activeFilters={}}if(value){$scope.activeFilters[filter]=value;$scope.initFilters()}else{$scope.activeFilters[filter]=false;$scope.initFilters()}};$scope.countByFilter=function(){$scope.filteredTotal=$filter("filter")($scope.items,function(item){var x=false;if(!angular.isUndefined($scope.query)){angular.forEach($scope.searchFields,function(attr){if(searchMatch(item[attr],$scope.query)){x=true}})}else{x=true}return x});if(!angular.isUndefined($scope.filteredTotal)&&!angular.isUndefined($scope.filterDate)&&$scope.filterDate.length>0){$scope.filteredTotal=$filter("filter")($scope.filteredItems,function(item){if(searchDate(item.datefilter,$scope.filterDate)){return true}return false})}if(!angular.isUndefined($scope.filteredItems)&&!angular.isUndefined($scope.filterCustom)&&$scope.filterCustom.length>0){$scope.filteredItems=$filter("filter")($scope.filteredItems,function(item){return $rootScope.tabsCustomFilter(item.class,$scope.filterClass)})}if(!angular.isUndefined($scope.filteredTotal)&&!angular.isUndefined($scope.filterClass)&&$scope.filterClass.length>0){$scope.filteredTotal=$filter("filter")($scope.filteredTotal,function(item){if(searchContains(item.class,$scope.filterClass)){return true}return false})}if(!angular.isUndefined($scope.filteredTotal)&&!angular.isUndefined($scope.filterTag)&&$scope.filterTag.length>0){$scope.filteredTotal=$filter("filter")($scope.filteredTotal,function(item){if(item.tags&&searchContainsComma(item.tags,$scope.filterTag)){return true}return false})}if(!angular.isUndefined($scope.filteredTotal)&&!angular.isUndefined($scope.filterClass2)&&$scope.filterClass2.length>0){$scope.filteredTotal=$filter("filter")($scope.filteredTotal,function(item){if(searchContains(item.class2,$scope.filterClass2)){return true}return false})}if(!angular.isUndefined($scope.filteredTotal)&&!angular.isUndefined($scope.filterClass3)&&$scope.filterClass3.length>0){$scope.filteredTotal=$filter("filter")($scope.filteredTotal,function(item){if(searchContains(item.class3,$scope.filterClass3)){return true}return false})}if(!angular.isUndefined($scope.filteredTotal)&&!angular.isUndefined($scope.filterSlider)&&$scope.filterSlider.length>0){$scope.filteredTotal=$filter("filter")($scope.filteredTotal,function(item){if(searchContains(item.slider_name,$scope.filterSlider)){return true}return false})}};$scope.preloadNextTab=function(noResults){$scope.countByFilter();var classItem=$scope.filterClass;if(angular.isUndefined($scope["filterLoad"+$scope.filterClass])&&!angular.isUndefined($scope["filterLoad"+$scope.filterClass2])){classItem=$scope.filterClass2}if(angular.isUndefined($scope["filterLoaded"+classItem])){HttpService.getDataUrl($scope["filterLoad"+classItem],"").then(function(response){$scope.s
3afeApply(function(){if(response.data.length==$scope.filteredTotal.length){if(noResults){$scope.safeApply(function(){$scope.isLoading=false;$scope.isSuccessful=true;$scope.more=false;$scope.noresults=true})}else{$scope.safeApply(function(){$scope.more=false;$scope.isLoading=false})}}else{for(var i=0;i<response.data.length;i++){if(i>=$scope.filteredTotal.length||response.data[i].id!=$scope.filteredTotal[i].id){if($scope.firstAction&&$scope.firstAction.substr(0,5)=="CLASS"){if(response.data[i].class==$scope.firstAction.substr(5)){$scope.items.push(response.data[i])}}else{$scope.items.push(response.data[i])}}}$timeout(function(){if($scope.firstAction&&$scope.firstAction.substr(0,4)=="SORT"){$scope.items=$filter("orderBy")($scope.items,$scope.firstAction.substr(4),true)}if($scope.filteredTotal.length<$scope.itemsPerPage){$scope.safeApply($scope.starter());$scope.search()}else{$scope.loadData()}})}})})}};$scope.preloadNextTabTag=function(noResults){$scope.countByFilter();if(angular.isUndefined($scope["filterLoadedTag"+$scope.filterTag])){HttpService.getDataUrl($scope["filterLoadTag"+$scope.filterTag],"").then(function(response){$scope.safeApply(function(){$scope["filterLoadedTag"+$scope.filterTag]=true;if(response.data.length==$scope.filteredTotal.length){if(noResults){$scope.safeApply(function(){$scope.isLoading=false;$scope.isSuccessful=true;$scope.more=false;$scope.noresults=true})}else{$scope.safeApply(function(){$scope.more=false;$scope.isLoading=false})}}else{var i2=0;for(var i=0;i<response.data.length;i++){if(i2>=$scope.filteredTotal.length){if($scope.firstAction&&$scope.firstAction.substr(0,5)=="CLASS"){if(response.data[i].class==$scope.firstAction.substr(5)){$scope.items.push(response.data[i]);i2++}}else{$scope.items.push(response.data[i]);i2++}}}
3if($scope.filteredTotal.length<$scope.itemsPerPage){$scope.safeApply($scope.starter());$scope.search()}else{$scope.loadData()}}})})}};$scope.checkCountryModalAndAddListener=function(){var modal=document.getElementById("modal-country-select");if(modal&&modal.classList.contains("md-show")){angular.element(document).on("click",function(event){if(!modal.contains(event.target)){modal.classList.remove("md-show");angular.element(document).off("click")}else if(modal.contains(event.target)){angular.element(document).off("click")}})}else{return}};$scope.setFilterLink=function(url,blank){window.location.href=url};$scope.openChild=function(url,$event){$event.stopPropagation();window.location.href=url};$scope.setFilterDefault=function(filterData,urlAll,a1,$event,nosearch){if($event){$event.preventDefault()}var currentScrollPosition=window.scrollY||document.documentElement.scrollTop;if(!angular.isUndefined($scope.onRenderHeaderCountry)&&!$scope.filterByCountry){delete $scope.onRenderHeaderCountry;window.localStorage.removeItem("country")}if(!angular.isUndefined($scope.onRenderHeaderTimeZone)&&!$scope.filterByCountry){delete $scope.onRenderHeaderTimeZone;window.localStorage.removeItem("timeZone")}$scope.filterMain=true;$scope.filteredSubsection="";$scope.filterTag=false;$scope.filterDate=false;$scope.multipleFilter=[];$scope.filterClass=false;$scope.filterClass2=false;$scope.filterClass3=false;angular.element("#"+$scope.idData+" .tab a.active").removeClass("active");angular.element("#"+$scope.idData+" .tab a:first").addClass("active");setTimeout(()=>{$scope.checkCountryModalAndAddListener()},100);$scope.setHashParams({});if(angular.isUndefined(COMMON.DISABLE_FADES)){angular.element("#content-"+$scope.idData).fadeOut("fast",function(){$scope.safeApply($scope.starter());if(!nosearch){$scope.search()}angular.element("#content-"+$scope.idData).fadeIn("fast")})}else{angular.element("#content-"+$scope.idData).hide(function(){$scope.safeApply($scope.starter());if(!nosearch){$scope.search()}angular.element("#content-"+$scope.idData).show()})}setTimeout(()=>{window.scrollTo(0,currentScrollPosition)},0);return false};$scope.filterSelectSubsection=function(tab,slug){if(!tab&&slug){if(angular.isUndefined($scope.tabsSubsectionsSelect)||angular.isUndefined($scope.tabsSubsectionsSelect[slug])){return}tab=$scope.tabsSubsectionsSelect[slug]}if(tab.timezone){$rootScope.timeZones=tab.timezone;$rootScope.selectedTimeZone=tab.timezone[0];$rootScope.itemTimeZone=tab.timezone[0].value}$scope.filteredSubsection=tab;$scope.setFilterTag(tab.slug,"",1);angular.element("#"+$scope.idData+" .tab.subsections-select").addClass("hide-hover");angular.element("#"+$scope.idData+" .tab a.active").removeClass("active");angular.element("#"+$scope.idData+" .tab.subsections-select a:first").addClass("active");$timeout(function(){angular.element("#"+$scope.idData+" .tab.subsections-select").removeClass("hide-hover");$scope.noFirstScroll=false},500)};$scope.setFilterCustom=function(filterClass,urlAll,maintainFilters,$event){if($event){$event.preventDefault()}if($scope.filterClass&&filterClass){$rootScope.gaEvent("event","filterCustom",{filter:filterClass})}$scope.scrollTo($scope.scrollId,"");$scope.filterMain=false;$scope.filterDate=false;$scope.filterTag=false;$scope.filterCustom=filterClass;$scope.filterClass=maintainFilters&&maintainFilters.length?$scope.filterClass:false;$scope.filterClass2=maintainFilters?$scope.filterClass2:false;$scope.filterClass3=maintainFilters?$scope.filterClass3:false;$timeout(function(){angular.element("#"+$scope.idData+' .tab a[data-tab!="'+filterClass+'"]').removeClass("active");angular.element("#"+$scope.idData+' .tab a[data-tab="'+filterClass+'"]').addClass("active");if(angular.isUndefined(COMMON.DISABLE_FADES)){angular.element("#content-"+$scope.idData).fadeOut("fast",function(){if(urlAll){if(filterClass){$scope["urlLoad"+filterClass]=urlAll}}$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).fadeIn("fast")})}else{angular.element("#content-"+$scope.idData).hide(function(){if(urlAll){if(filterClass){$scope["urlLoad"+filterClass]=urlAll}}$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).show()})}});return false};$rootScope.setTimeZoneVar=function(time){var parts=time.split(/[- :]/);var timeDate=new Date(parts[0],parts[1]-1,parts[2],parts[3],parts[4],parts[5]);timeDate.setUTCHours(parts[3]);timeDate.setUTCMinutes(parts[4]);if($rootScope.selectedTimeZone){const options={timeZone:$rootScope.selectedTimeZone.value,hour12:false,hour:"2-digit",minute:"2-digit"};const stringDate=timeDate.toLocaleTimeString("en-US",options);return stringDate}else{const hours=(timeDate.getHours()<10?"0":"")+timeDate.getHours();const minutes=(timeDate.getMinutes()<10?"0":"")+timeDate.getMinutes();return hours+":"+minutes}};$rootScope.changeTimeZone=function(timeZoneValue){var timeZone=$rootScope.timeZones.find(x=>x.value==timeZoneValue);$rootScope.selectedTimeZone=timeZone;$rootScope.setTimeZoneHash(timeZone)};$scope.setFilterClass=function(filterClass,urlAll,maintainFilters,$event){if($event){$event.preventDefault()}$scope.scrollTo($scope.scrollId,"");$scope.filterMain=false;$scope.filterDate=false;$scope.filterTag=false;$scope.filterCustom=false;$scope.filterClass=filterClass;$scope.filterClass2=maintainFilters?$scope.filterClass2:false;$scope.filterClass3=maintainFilters?$scope.filterClass3:false;$timeout(function(){angular.element("#"+$scope.idData+' .tab a[data-tab!="'+filterClass+'"]').removeClass("active");angular.element("#"+$scope.idData+' .tab a[data-tab="'+filterClass+'"]').addClass("active");if(angular.isUndefined(COMMON.DISABLE_FADES)){angular.element("#content-"+$scope.idData).fadeOut("fast",function(){if(urlAll){if(filterClass){$scope["urlLoad"+filterClass]=urlAll}}$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).fadeIn("fast")})}else{angular.element("#content-"+$scope.idData).hide(function(){if(urlAll){if(filterClass){$scope["urlLoad"+filterClass]=urlAll}}$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).show()})}});$scope.activeFilters={};return false};$scope.setMultipleFilter=function(filterClass,urlAll,maintainTag,parentList){if(parentList=="latest"){$scope.setFilterDefault();return}$scope.pagedItems=[];$scope.page=[];$scope.showNoResults=false;if(angular.element("#content-"+$scope.idData+"-tabs").length){angular.element("#content-"+$scope.idData+"-tabs .items-tab").fadeOut("fast")}$scope.filterMain=false;$scope.filterDate=false;$scope.filterDate2=false;if(!maintainTag){$scope.filterTag=false}$scope.multipleFilter[parentList]=filterClass;$scope.filterClass=false;$scope.filterClass2=false;$scope.filterClass3=false;angular.element("#content-"+$scope.idData).fadeOut("fast",function(){if(urlAll){if(filterClass){$scope["urlLoad"+filterClass]=urlAll}}$scope.safeApply($scope.starter());$scope.loadDayData();$scope.setMultipleMenu();angular.element("#content-"+$scope.idData).fadeIn("fast")});return false};$scope.setMultipleMenu=function(){Object.keys($scope.multipleFilter).forEach(filter=>{var newTitle=$scope.multipleFilter[filter].split("-").join(" ").toUpperCase();if(!$("li.tab."+filter).hasClass("active")){$("li.tab."+filter).addClass("active");$("li.tab."+filter+">a>span").html(newTitle)}})};$scope.setFilterClass2=function(filterClass,urlAll,maintainFilters,$event){if($event){$event.preventDefault()}if($scope.filterClass2&&filterClass){$rootScope.gaEvent("event","filterClass2",{filter:filterClass})}$scope.scrollTo($scope.scrollId,"");$scope.filterMain=false;$scope.filterDate=false;$scope.filterTag=false;$scope.filterCustom=false;$scope.filterClass=maintainFilters?$scope.filterClass:false;$scope.filterClass2=filterClass;$scope.filterClass3=maintainFilters?$scope.filterClass3:false;angular.element("#"+$scope.idData+' .tab a[data-tab!="'+filterClass+'"]').removeClass("active");angular.element("#"+$scope.idData+' .tab a[data-tab="'+filterClass+'"]').addClass("active");if(angular.isUndefined(COMMON.DISABLE_FADES)){angular.element("#content-"+$scope.idData).fadeOut("fast",function(){if(urlAll){if(filterClass){$scope["urlLoad"+filterClass]=urlAll}}$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).fadeIn("fast")})}else{angular.element("#content-"+$scope.idData).hide(function(){if(urlAll){if(filterClass){$scope["urlLoad"+filterClass]=urlAll}}$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).show()})}return false};$scope.setFilterClass3=function(filterClass,urlAll,maintainFilters,$event){if($event){$event.preventDefault()}if($scope.filterClass3&&filterClass){$rootScope.gaEvent("event","filterClass3",{filter:filterClass})}$scope.scrollTo($scope.scrollId,"");$scope.filterMain=false;$scope.filterDate=false;$scope.filterTag=false;$scope.filterCustom=false;$scope.filterClass=false;$scope.filterClass2=false;$scope.filterClass3=filterClass;angular.element("#"+$scope.idData+' .tab a[data-tab!="'+filterClass+'"]').removeClass("active");angular.element("#"+$scope.idData+' .tab a[data-tab="'+filterClass+'"]').addClass("active");if(angular.isUndefined(COMMON.DISABLE_FADES)){angular.element("#content-"+$scope.idData).fadeOut("fast",function(){if(urlAll){if(filterClass){$scope["urlLoad"+filterClass]=urlAll}}$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).fadeIn("fast")})}else{angular.element("#content-"+$scope.idData).hide(function(){if(urlAll){if(filterClass){$scope["urlLoad"+filterClass]=urlAll}}$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).show()})}$rootScope.gaEvent("event","filterClass3",{filter:filterClass});return false};$scope.setFilterSlider=function(filterSlider,urlAll,maintainFilters,$event){if($event){$event.preventDefault()}$scope.scrollTo($scope.scrollId,"");$scope.filterMain=false;$scope.filterDate=false;$scope.filterTag=false;$scope.filterCustom=false;$scope.filterClass=maintainFilters?$scope.filterClass:false;$scope.filterClass2=maintainFilters?$scope.filterClass2:false;$scope.filterClass3=maintainFilters?$scope.filterClass3:false;$scope.filterSlider=filterSlider;if(angular.isUndefined(COMMON.DISABLE_FADES)){angular.element("#content-"+$scope.idData).fadeOut("fast",function(){if(urlAll){if(filterClass){$scope["urlLoad"+filterClass]=urlAll}}$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).fadeIn("fast")})}else{angular.element("#content-"+$scope.idData).hide(function(){if(urlAll){if(filterClass){$scope["urlLoad"+filterClass]=urlAll}}$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).show()})}return false};$scope.checkSearch=function(){if(!angular.isUndefined($scope.searchCheck)){$timeout.cancel($scope.searchCheck)}$scope.searchCheck=$timeout(function(){if(angular.isUndefined($scope.searchFilter)){$scope.setFilterSearch("")}},300)};$scope.setLambdaSearch=function(){var elm=angular.element(event.srcElement);var query=elm[0].value;if(event.keyCode==13&&query.length>2){$scope.isLoading=true;var params={q:query,key:"NEWS",size:999};HttpService.postDataUrl($scope.lambdaJson,params).then(function(response){$scope.items=response.data;if($scope.filterClass){$scope.setFilterClass($scope.filterClass)}else{$scope.setFilterDefault()}})}};$scope.resetSearchButton=function(){$scope.searchFilter="";$scope.items=[];$scope.setFilterDefault("","","","",true)};$scope.setSearch=function(maintainFilters,maintainDate,clearFilters){var elm=angular.element(event.srcElement);if(event.keyCode==13){$scope.setFilterSearch(elm[0].value)}else{if(!angular.isUndefined($scope.timeoutSearch)){$timeout.cancel($scope.timeoutSearch)}$scope.timeoutSearch=$timeout(function(){if(elm[0].value.length<1){if(!angular.isUndefined($scope.timeoutSearch2)){$timeout.cancel($scope.timeoutSearch2)}$scope.timeoutSearch2=$timeout(function(){$scope.setFilterSearch("")},300)}else if(elm[0].value.length>2&&elm[0].value!=$scope.query){if(!angular.isUndefined($scope.timeoutSearch2)){$timeout.cancel($scope.timeoutSearch2)}$scope.timeoutSearch2=$timeout(function(){$scope.setFilterSearch(elm[0].value)},300)}},200)}};$scope.setFilterSearch=function(filterSearch){$scope.filterMain=false;$scope.filterDate=false;$scope.filterTag=false;$scope.filterClass=false;$scope.filterClass2=false;$scope.filterClass3=false;if(!filterSearch){$scope.query=undefined}else{$scope.query=filterSearch}$scope.filteredSearch=true;angular.element("#"+$scope.idData+" .tab a.active").removeClass("active");angular.element("#"+$scope.idData+" .tab:first-child a").addClass("active");if(angular.isUndefined(COMMON.DISABLE_FADES)){angular.element("#content-"+$scope.idData).fadeOut("fast",function(){$scope.s
3afeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).fadeIn("fast")})}else{angular.element("#content-"+$scope.idData).hide(function(){$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).show()})}return false};$scope.setFilterAlways=function($event,filterAlways){var checkedbox=false;if($event){var checkbox=$event.target;checkedbox=checkbox.checked}else{var checkedbox=true}$scope.scrollTo($scope.scrollId,"");$scope.filterAlways=false;$scope.filterAlwaysField=false;if(checkedbox==true){var exp=filterAlways.split(",");$scope.filterAlwaysField=exp[2];if(typeof exp[3]!="undefined"&&exp[3]=="user"){if($rootScope.currentUser[exp[1]]){$scope.filterAlways=$rootScope.currentUser[exp[1]]}}else{$scope.filterAlways=exp[1]}}if(angular.isUndefined(COMMON.DISABLE_FADES)){angular.element("#content-"+$scope.idData).fadeOut("fast",function(){$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).fadeIn("fast")})}else{angular.element("#content-"+$scope.idData).hide(function(){$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).show()})}return false};$scope.setFilterTag=function(filterTag,urlAll,noReset){if(!noReset&&!angular.isUndefined($scope.onRenderHeaderCountry)&&!$scope.filterByCountry){delete $scope.onRenderHeaderCountry;window.localStorage.removeItem("country")}if(!noReset&&!angular.isUndefined($scope.onRenderHeaderTimeZone)&&!$scope.filterByCountry){delete $scope.onRenderHeaderTimeZone;window.localStorage.removeItem("timeZone")}$scope.scrollTo($scope.scrollId,"");$scope.filterMain=false;$scope.filterDate=false;$scope.filterTag=filterTag;$scope.filterCustom=false;$scope.filterClass=false;$scope.filterClass2=false;$scope.filterClass3=false;angular.element("#"+$scope.idData+' .tab a[data-tab!="'+filterTag+'"]').removeClass("active");angular.element("#"+$scope.idData+' .tab a[data-tab="'+filterTag+'"]').addClass("active");if(angular.isUndefined(COMMON.DISABLE_FADES)){angular.element("#content-"+$scope.idData).fadeOut("fast",function(){if(urlAll){if(filterTag){$scope["urlLoadTag"+filterTag]=urlAll}}$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).fadeIn("fast")})}else{angular.element("#content-"+$scope.idData).hide(function(){if(urlAll){if(filterTag){$scope["urlLoadTag"+filterTag]=urlAll}}$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).show()})}return false};$scope.setFilterDate=function(filterDate,urlAll){$scope.filterMain=false;$scope.filterTag=false;$scope.filterClass=false;$scope.filterDate=filterDate;$scope.filterClass2=false;$scope.filterClass3=false;if(angular.isUndefined(COMMON.DISABLE_FADES)){angular.element("#content-"+$scope.idData).fadeOut("fast",function(){if(urlAll){if(filterClass){$scope["urlLoad"+filterClass]=urlAll}$scope.countByFilter();if($scope.filteredTotal.length<$scope.itemsPerPage){$scope["filterLoad"+filterClass]=urlAll;$scope.preloadNextTab()}}$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).fadeIn("fast")})}else{angular.element("#content-"+$scope.idData).hide(function(){if(urlAll){if(filterClass){$scope["urlLoad"+filterClass]=urlAll}$scope.countByFilter();if($scope.filteredTotal.length<$scope.itemsPerPage){$scope["filterLoad"+filterClass]=urlAll;$scope.preloadNextTab()}}$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).show()})}return false};$scope.setFilterDateNow=function($event,filterDateNow,force){var checkedbox=false;if($event){var checkbox=$event.target;if($scope.firstAction&&$scope.firstAction=="DATENOW"){if(checkbox.checked){checkedbox=false}else{checkedbox=true}}else{checkedbox=checkbox.checked}}else{var checkedbox=true}$scope.scrollTo($scope.scrollId,"");$scope.filterMain=false;$scope.filterDateAlways=false;if(checkedbox==true){$scope.filterDateAlways=filterDateNow}if(angular.isUndefined(COMMON.DISABLE_FADES)){angular.element("#content-"+$scope.idData).fadeOut("fast",function(){$scope.s
3afeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).fadeIn("fast")})}else{angular.element("#content-"+$scope.idData).hide(function(){$scope.safeApply($scope.starter());$scope.search();angular.element("#content-"+$scope.idData).show()})}return false};$scope.scrollTo=function(dataslide,plus){if($scope.noFirstScroll){$scope.noFirstScroll=false;return}if(!angular.isUndefined($rootScope.disableOtherScrolls)){return}if(!plus){plus=$scope.scrollPlus}plus=plus?plus:0;if(document.getElementById(dataslide)){if(screen.width<1024&&document.getElementById("content")){$("#content").animate({scrollTop:$("#"+dataslide).offset().top-plus},700,"")}else{$("html,body").animate({scrollTop:$("#"+dataslide).offset().top-plus},700,"")}}};$scope.show_plus=function(item){if(angular.isUndefined(item.show_plus)){item.show_plus=true}else if(item.show_plus==true){item.show_plus=false}else{item.show_plus=true}};$scope.show_hide_text=function(item){if(angular.isUndefined(item.show_text)){item.show_text=true}else if(item.show_text==true){item.show_text=false}else{item.show_text=true}};$scope.get_plus_icon=function(item){var icon="icon-plus";if(!angular.isUndefined(item.show_plus)&&item.show_plus==true){icon="icon-minus"}return icon};$scope.groupFilter=function(item){var itemIndex=$scope.pagedItemsLoaded.indexOf(item);var ok=false;angular.forEach($scope.groupFilters,function(el,key){if(el[0]-1==itemIndex){item.groupItemNumber=key+1;item.idx=itemIndex;ok=item}});return ok};$scope.showGroupByIndex=function(groupItem,item){};$scope.groupFilterItems=function(item){var returnItems=[];var idxFrom="";var idxTo="";var itemIndex=$scope.pagedItemsLoaded.indexOf(item);angular.forEach($scope.groupFilters,function(el){if(el[0]-1==itemIndex){idxFrom=itemIndex+1;idxTo=el[1]}});if(idxFrom&&idxTo){var ix=1;angular.forEach($scope.items,function(item,idx){if(idx+1>=idxFrom&&idx+1<=idxTo){item.itemNumber=ix;ix++;returnItems.push(item)}})}return returnItems};$scope.groupByFilterItems=function(filterItem){var returnItems=[];angular.forEach($scope.filteredItems,function(item){if(item[$scope.groupBy]==filterItem[$scope.groupBy]){returnItems.push(item)}});return returnItems};$scope.groupFilterItemsByIdGroup=function(groupId){var returnItems=[];var idxFrom="";var idxTo="";angular.forEach($scope.groupFilters,function(el,key){if(key+1==groupId){idxFrom=el[0];idxTo=el[1]}});if(idxFrom&&idxTo){var ix=1;angular.forEach($scope.items,function(item,idx){if(idx+1>=idxFrom&&idx+1<=idxTo){item.itemNumber=ix;ix++;returnItems.push(item)}})}return returnItems};$scope.getAllGroups=function(addGroups){var allGroups=[];var lastGroup="";angular.forEach($scope.groupFilters,function(el,key){lastGroup=(key+1)*1;allGroups.push(lastGroup)});if(addGroups){for(var i=0;i<addGroups;i++){lastGroup=lastGroup+1;allGroups.push(lastGroup)}}return allGroups};$scope.getIndex=function(item){return $scope.pagedItemsLoaded.indexOf(item)};$scope.owlReloadOnFirstPage=function(){var owl=$($scope.scrollId+" .owl-carousel");var owlParams=angular.fromJson(owl.attr("owl-properties"));owl.owlCarousel(owlParams);owl.on("changed.owl.carousel",function(e){var total=e.relatedTarget.items().length-1;var current=e.item.index;var currentIndex=e.item.index-e.relatedTarget._clones.length/2;if(currentIndex==total){var src=$(e.target).find(".owl-item").eq(currentIndex);$timeout(function(){owl.trigger("next.owl.carousel",1e3)},1e3)}if(currentIndex<1){$scope.newItems=[];HttpService.getDataUrl($scope.url,[]).then(function(response){$scope.safeApply(function(){if(!angular.isUndefined(response.data.filters)){$scope.allFilters=response.data.filters}if(!angular.isUndefined(response.data.items)){var responseItems=response.data.items}else{var responseItems=response.data}if(!angular.isUndefined(responseItems[1])&&$scope.items[1]){if(responseItems[1].id!=$scope.items[1].id&&responseItems[10].id!=$scope.items[10].id){angular.forEach(responseItems,function(item){$scope.newItems.push(item)});$timeout(function(){$scope.items=$scope.newItems},1e3)}}})})}})};$scope.openModalPreview=function(contentHtml){$rootScope.previewContentHtml=contentHtml;$rootScope.openModalClass("modal-general","","","","","<content-preview width=\"'100%'\" height=\"'500'\"></content-preview>")};if($scope.filterHash){$rootScope.$on("site:hashChanged",function(evt,opt){var oldParam="";var newParam="";var oldHash=$scope.parseParams(opt.oldURL.replace(/[^#]+(#.+)/,"$1").substring(1).split("&"));var newHash=$scope.parseParams(opt.newURL.replace(/[^#]+(#.+)/,"$1").substring(1).split("&"));var splitFilter=$scope.filterHash.split("|");if(splitFilter.length>=1){angular.forEach(splitFilter,function(filt){if(!angular.isUndefined(oldHash[filt])){oldParam=oldHash[filt]}if(!angular.isUndefined(newHash[filt])){newParam=newHash[filt]}if(oldParam!=newParam){if(filt=="date"){$scope.setFilterClass3(newParam)}else if(filt=="event"){$scope.setFilterCustom(newParam,"",true);if($scope.firstAction&&$scope.firstAction.substr(0,17)=="HASHCLASSREQUIRED"){var expAction=$scope.firstAction.substr(17).split(";");if(expAction.length>1&&expAction[1]=="_TABSFIELD"){$scope.dynamicTabsClass=[];$timeout(function(){var itemsFiltered=$filter("filter")($scope.items,{class:newParam},true);var dynamicTabs=$filter("unique")(itemsFiltered,$scope.dynamicTabsField);angular.forEach(dynamicTabs,function(item){if(item.class2){$scope.dynamicTabsClass.push({tabFilter:item.class2,name:item[$scope.dynamicTabsField]})}});if($scope.dynamicTabsClass.length){if(expAction[1].substr(10)=="last"){var tab=$scope.dynamicTabsClass[$scope.dynamicTabsClass.length-1]}else{var tab=$scope.dynamicTabsClass[0]}$timeout(function(){$scope.setFilterClass2(tab.tabFilter,"",true)})}},500)}}}else if(filt=="class2"){$scope.setFilterClass2(newParam)}else if($scope.extraTabs.length>0){angular.forEach($scope.extraTabs,function(extraTab){if(extraTab.name==splitFilter[0]&&extraTab.items.length>0){angular.forEach(extraTab.items,function(tab){if(tab.hash==newParam){$scope.tabAction(tab)}})}})}}})}else{if(!angular.isUndefined(oldHash[$scope.filterHash])){oldParam=oldHash[$scope.filterHash]}if(!angular.isUndefined(newHash[$scope.filterHash])){newParam=newHash[$scope.filterHash]}if(oldParam!=newParam){if($scope.filterHash=="date"){$scope.setFilterClass3(newParam)}else if($scope.extraTabs.length>0){angular.forEach($scope.extraTabs,function(extraTab){if(extraTab.name==splitFilter[0]&&extraTab.items.length>0){angular.forEach(extraTab.items,function(tab){if(tab.hash==newParam){$scope.tabAction(tab)}})}})}}}})}$scope.parseParams=function(params){var paramsArray={};angular.forEach(params,function(h){var h2=h.split("=");if(h2.length==2){paramsArray[h2[0]]=h2[1]}else{paramsArray[h2[0]]=true}});return paramsArray};$rootScope.currentArticleVideoAPIReady=function(API){$rootScope.currentArticleVideoAPI=API};$scope.openArticle=function(item){switch(item.class){case"media":$window.location.href=item.url;break;case"galleries":$window.location.href=item.url;break;default:$rootScope.currentArticle=item.data;$rootScope.gaEvent("event","openArticle",{article:item.title});
3$rootScope.openModalClass("modal-current-article","","","modal-current-article");angular.element("#modal-current-article").addClass("overlay-"+$scope.idData);$rootScope.$on("site:modal-close-modal-current-article",function(){$timeout(function(){if(angular.element("#modal-current-article .fotorama").length&&angular.element("#modal-current-article .fotorama").data("fotorama")){angular.element("#modal-current-article .fotorama").data("fotorama").destroy()}$rootScope.currentArticle={};angular.element("#modal-current-article").removeClass("overlay-"+$scope.idData)})});$rootScope.currentArticle.showVideoPlayer=false;$timeout(function(){if(angular.element("#modal-current-article .fotorama").length){angular.element("#modal-current-article .fotorama").fotorama()}else if(!angular.isUndefined($rootScope.currentArticle.media)){if($rootScope.currentArticle.media.length==1&&$rootScope.currentArticle.media[0].type=="video"){$rootScope.currentArticle.media[0].videoData=$scope.findVideoId($rootScope.currentArticle.media[0].video);var showMediaElementControls=true;if($rootScope.currentArticle.media[0].videoData){$rootScope.currentArticle.media[0].videoType="video/"+$rootScope.currentArticle.media[0].videoData.type;showMediaElementControls=false}else{$rootScope.currentArticle.media[0].videoType="video/mp4"}$rootScope.currentArticle.media[0].videoType=!$rootScope.currentArticle.media[0].videoData?"video/mp4":"video/"+$rootScope.currentArticle.media[0].videoData.type;$timeout(function(){$rootScope.currentArticle.showVideoPlayer=true;if($rootScope.currentArticle.media[0].type=="video"){$timeout(function(){var idVideo=document.querySelector("#modal-current-article .video-player-container video").id;var width=$("#modal-current-article .video-player-container").width();var height=$("#modal-current-article .video-player-container").width()*9/16;$("#modal-current-article .video-player-container").height(height);new MediaElementPlayer(idVideo,{volume:100,pauseOtherPlayers:false,alwaysShowControls:showMediaElementControls,width:width,height:height,youtube:{iv_load_policy:3,modestbranding:0,autoplay:1,controls:!showMediaElementControls,showinfo:0,wmode:"opaque",branding:0,autohide:1,playsinline:1},success:function(mediaElement,domObject){$("#"+idVideo+" iframe").width("100%").height("100%")}})})}},500)}else if($rootScope.currentArticle.media.length>1&&$rootScope.currentArticle.media[1].type=="video"){$rootScope.currentArticle.media[1].videoData=$scope.findVideoId($rootScope.currentArticle.media[1].video);var showMediaElementControls=true;if($rootScope.currentArticle.media[1].videoData){$rootScope.currentArticle.media[1].videoType="video/"+$rootScope.currentArticle.media[1].videoData.type;showMediaElementControls=false}else{$rootScope.currentArticle.media[1].videoType="video/mp4"}$rootScope.currentArticle.media[1].videoType=!$rootScope.currentArticle.media[1].videoData?"video/mp4":"video/"+$rootScope.currentArticle.media[1].videoData.type;$timeout(function(){$rootScope.currentArticle.showVideoPlayer=true;if($rootScope.currentArticle.media[1].type=="video"){$timeout(function(){var idVideo=document.querySelector("#modal-current-article .video-player-container video").id;var width=$("#modal-current-article .video-player-container").width();var height=$("#modal-current-article .video-player-container").width()*9/16;$("#modal-current-article .video-player-container").height(height);new MediaElementPlayer(idVideo,{volume:100,pauseOtherPlayers:false,alwaysShowControls:showMediaElementControls,width:width,height:height,youtube:{iv_load_policy:3,modestbranding:0,autoplay:1,controls:!showMediaElementControls,showinfo:0,wmode:"opaque",branding:0,autohide:1,playsinline:1},success:function(mediaElement,domObject){$("#"+idVideo+" iframe").width("100%").height("100%")}})})}},500)}}$('a[href^="http"]').click(function(){$(this).attr("target","_blank")})},500);break}};$scope.getProtocol=function(){$scope.getProtocol.p=$scope.getProtocol.p||(location.protocol==="https:"?"https://":"http://");return $scope.getProtocol.p};$scope.parseHref=function(href){var a=document.createElement("a");a.href=href;return a};$scope.findVideoId=function(href,forceVideo){if(typeof href!=="string")return href;var href=$scope.parseHref(href);var id,type;if(href.host.match(/youtube\.com/)&&href.search){id=href.search.split("v=")[1];if(id){var ampersandPosition=id.indexOf("&");if(ampersandPosition!==-1){id=id.substring(0,ampersandPosition)}type="youtube"}else{id=href.pathname.split("embed/")[1];if(id){type="youtube"}}}else if(href.host.match(/youtube\.com|youtu\.be/)){id=href.pathname.replace(/^\/(embed\/|v\/)?/,"").replace(/\/.*/,"");type="youtube"}else if(href.host.match(/vimeo\.com/)){type="vimeo";id=href.pathname.replace(/^\/(video\/)?/,"").replace(/\/.*/,"")}if((!id||!type)&&forceVideo){id=href.href;type="custom"}return id?{id:id,type:type,s:href.search.replace(/^\?/,""),p:$scope.getProtocol()}:false}};$rootScope.openItemOverlay=function(modalId,item){$timeout(function(){$rootScope.overlayData=item;$rootScope.openModalClass(modalId,"","","","","","",1);$timeout(function(){if(angular.element("#"+modalId+" videogular").length){angular.element("#"+modalId+" videogular vg-media").height(angular.element("#"+modalId+" videogular vg-media").width()*9/16)}})})};$rootScope.openItemIdOverlay=function(modalId,itemId){var itemResults=$filter("filter")($scope.items,{id:itemId},true);if(itemResults.length==1){$rootScope.openItemOverlay(modalId,itemResults[0])}};$scope.initLayoutTabs=function(){$scope.currentTab="";$scope.showTab=function(tab,hash,scrollOnDesktop,scrollOnMobile,functionOnClick){$scope.currentTab=tab;$rootScope.gaEvent("event","showTab",{tab:hash});var shouldScroll=false;
3if(scrollOnDesktop&&!CommonFactory.isMobile()){shouldScroll=true}if(scrollOnMobile&&CommonFactory.isMobile()){shouldScroll=true}if(shouldScroll){$timeout(function(){if($(".full-content.zone-tab-"+tab).length>0){$("html,body").animate({scrollTop:$(".full-content.zone-tab-"+tab).offset().top-$("#header").height()*2},300,"")}},500)}if(functionOnClick){$timeout(function(){tabsLayoutAction()})}};$scope.showTabCustom=function(tab,hash,scrollOnDesktop,scrollOnMobile,functionOnClick,headerHeight){$scope.currentTab=tab;$rootScope.gaEvent("event","showTab",{tab:hash});var shouldScroll=false;if(scrollOnDesktop&&!CommonFactory.isMobile()){shouldScroll=true}if(scrollOnMobile&&CommonFactory.isMobile()){shouldScroll=true}if(shouldScroll){$timeout(function(){if($(".full-content.zone-tab-"+tab).length>0){$("html,body").animate({scrollTop:$(".full-content.zone-tab-"+tab).offset().top-headerHeight},300,"")}},500)}if(functionOnClick){$timeout(function(){tabsLayoutAction()})}};$scope.safeApply(function(){$scope.currentTab=1});$scope.$watch("currentTab",function(newTab){if(typeof window["mainTabChange"]=="function"){mainTabChange(newTab)}})}}]);"use strict";angular.module("Templates",["services.HttpService","directives.spinner","directives.resizables","ngSanitize","Scope.safeApply","ngRepeatUtils"]).controller("TemplatesWebController",["$scope","$filter","HttpService","$window","$location","preloader","$timeout","$rootScope","CommonFactory","$base64","cookiesBarV2",function($scope,$filter,HttpService,$window,$location,preloader,$timeout,$rootScope,CommonFactory,$base64,cookiesBarV2){$scope.initTemplates=function(items){let jsonItems=JSON.parse($base64.decode(items));$scope.templatesArray=jsonItems}}]);App.filter("yesNo",function(){return function(boolean){return boolean?"Yes":"No"}});App.directive("contentPreview",["$timeout","$rootScope",function($timeout,$rootScope){return{restrict:"E",replace:true,scope:{html:"=",width:"=",height:"="},template:"<iframe></iframe>",link:function postLink(scope,iframe,attrs){scope.insertHtml=function(html){if(angular.isUndefined(html)){html=angular.copy($rootScope.previewContentHtml);$rootScope.previewContentHtml=undefined}iframe[0].contentWindow.document.open();iframe[0].contentWindow.document.write(html);iframe[0].contentWindow.document.close()};scope.setWidth=function(width){iframe[0].width=width};scope.setHeight=function(height){iframe[0].height=height};$timeout(function(){scope.$watch(function(){return scope.html},scope.insertHtml);scope.$watch(function(){return scope.width},scope.setWidth);scope.$watch(function(){return scope.height},scope.setHeight)})}}}]);App.directive("delayedModel",function(){return{scope:{model:"=delayedModel"},link:function(scope,element,attrs){element.val(scope.model);scope.$watch("model",function(newVal,oldVal){if(newVal!==oldVal){element.val(scope.model)}});var timeout;element.on("keyup paste search",function(){clearTimeout(timeout);timeout=setTimeout(function(){scope.model=element[0].value;element.val(scope.model);scope.$apply()},attrs.delay||500)})}}});App.directive("dynamic",function($compile,$timeout){return{restrict:"A",replace:true,link:function postLink(scope,element,attrs){scope.$watch(attrs.dynamic,function(html){if(!angular.isUndefined(html)){element.html(html);$compile(element.contents())(scope)}scope.callFunc=function(func){if(typeof window[func.split("(")[0]]=="function"){eval(func)}}})}}});App.directive("focusMe",function($timeout,$parse){return{link:function(scope,element,attrs){var model=$parse(attrs.focusMe);scope.$watch(model,function(value){console.log("value=",value);if(value===true){$timeout(function(){element[0].focus()})}});element.bind("blur",function(){console.log("blur");scope.$apply(model.assign(scope,false))})}}});App.directive("focusInput",function($parse,$timeout){return{scope:{},restrict:"A",link:function(scope,element,attrs){scope.$watch(function(){return element.attr("class")},function(newValue,oldValue){if(newValue!==oldValue){if(element.hasClass("md-show")){console.log("class has changed to: "+element.hasClass("md-show"));$timeout(function(){element.find("input").focus();console.log(element.find("input").attr("name"))})}}})}}});App.directive("focus",function($timeout,$parse){return{restrict:"A",link:function(scope,element,attrs){console.log(element);$timeout(function(){element[0].focus()});scope.$watch(attrs.focus,function(newValue,oldValue){if(newValue){element[0].focus()}});element.bind("blur",function(e){$timeout(function(){console.log("blur");
3scope.$apply(attrs.focus+"=false")},0)});element.bind("focus",function(e){$timeout(function(){console.log("focus");scope.$apply(attrs.focus+"=true")},0)})}}});App.directive("image",function(){return{restrict:"E",replace:true,scope:{key:"=?",src:"=",dataid:"=",dataalt:"=",errsrc:"=",accept:"&"},template:'<img ng-src="{{src | httpSFilter}}" err-src="{{errsrc}}" alt="{{dataalt}}" /></a>',controller:function($scope,$element,$attrs){$scope.click=function(){$scope.accept()}}}});App.directive("imageonload",function(COMMON){return{restrict:"A",link:function(scope,element,attrs){element.on("load",function(){if(angular.isUndefined(COMMON.DISABLE_FADES)){element.fadeIn()}else{element.show()}element.removeClass("spinner-hide");element.addClass("show spinner-show");element.parent().find(".spinner").remove()});scope.$watch("ngSrc",function(){element.css("display","none");element.addClass("hide spinner-hide");element.parent().append('<div class="loading-container spinner"><i class="icon-loading"></i></div>')},function(value){if(!value){element.attr("src",attrs.errSrc)}});element.bind("error",function(){element.attr("src",attrs.errSrc)})}}});App.directive("errSrc",function(){return{restrict:"A",link:function(scope,element,attrs){if(attrs.ngSrc===""||attrs.ngSrc===undefined){element.attr("src",attrs.errSrc)}element.bind("error",function(){console.log("error");element.attr("src",attrs.errSrc)})}}});App.directive("imageonloadcontrol",function(){return{restrict:"A",link:function(scope,element,attrs){if(attrs.ngSrc===""||attrs.ngSrc===undefined){element.attr("src",attrs.noSrc)}else{element.on("load",function(){});scope.$watch("ngSrc",function(){},function(value){console.log(value);if(!value){element.attr("src",attrs.errSrc)}});element.bind("error",function(){element.attr("src",attrs.errSrc)})}}}});App.directive("loginbtn",function($compile,$rootScope){return{restrict:"A",replace:true,scope:{datamodal:"="},link:function postLink(scope,element,attrs){function openModal(html2,el){$rootScope.openModal(scope.datamodal)}scope.$watch("scope.datamodal",function(html){element.on("click",openModal)})}}});App.directive("isotope",function(){var NGREPEAT_SOURCE_RE="\x3c!-- ngRepeat: ((.*) in ((.*?)( track by (.*))?)) --\x3e";return{compile:function(element,attrs){var $brick=element.children();var type=$brick.prop("tagName");var itemSelector=type+":not([class$='-leave-active'])";return function(scope,element,attrs){var containerWidth=$("#container").outerWidth();var gutter=0;if(attrs.gutter){gutter=attrs.gutter}var options=angular.extend({layoutMode:"masonry",sortBy:"original-order",itemSelector:attrs.itemselector,transitionDuration:"0.4s",masonry:{columnWidth:parseInt(attrs.widthselector),gutter:parseInt(gutter)},stamp:attrs.stampselector},scope.$eval(attrs.isotope));if(!options.model){var ngRepeatMatch=element.html().match(NGREPEAT_SOURCE_RE);if(ngRepeatMatch){options.model=ngRepeatMatch[3]}}element.addClass("isotope");setTimeout(function(){if(!attrs.imagesloaded){element.isotope(options)}else{element.isotope(options)}element.on("$destroy",function(){element.isotope("destroy")});if(options.model){scope.$apply(function(){scope.$watchCollection(options.model,function(_new,_old){if(!attrs.imagesloaded){if(_new==_old)return;setTimeout(function(){element.isotope("reloadItems").isotope()})}else{var img=element.find("img");img.on("load",function(){element.isotope("reloadItems").isotope()})}setTimeout(function(){})})})}})}}}});App.directive("masonry",function(){var NGREPEAT_SOURCE_RE="\x3c!-- ngRepeat: ((.*) in ((.*?)( track by (.*))?)) --\x3e";return{compile:function(element,attrs){var $brick=element.children();var type=$brick.prop("tagName");var itemSelector=type+":not([class$='-leave-active'])";return function(scope,element,attrs){containerWidth=$("#container").outerWidth();var options=angular.extend({itemSelector:itemSelector,isAnimated:true,columnWidth:function(containerWidth){return containerWidth/20},containerStyle:{position:"relative"},animationOptions:{duration:0},cornerStampSelector:".stamp",gutterWidth:0,isResizable:true},scope.$eval(attrs.masonry));if(!options.model){var ngRepeatMatch=element.html().match(NGREPEAT_SOURCE_RE);if(ngRepeatMatch){options.model=ngRepeatMatch[3]}}element.addClass("masonry");setTimeout(function(){element.masonry(options);element.on("$destroy",function(){element.masonry("destroy")});if(options.model){scope.$apply(function(){scope.$watchCollection(options.model,function(_new,_old){if(_new==_old)return;setTimeout(function(){element.masonry("reload")})})})}})}}}});App.directive("mediaPlayer",function($compile,$rootScope){return{restrict:"A",replace:true,link:function postLink(scope,element,attrs){scope.customClass="vp"+Math.round(Math.random()*(999999-999)+999);scope.meOptions={forceLive:false,features:["playpause","current","progress","tracks","volume","fullscreen"],vrIsStereo:false};scope.generateVideoHtml=function(config,attrs){var params={class:attrs.class?scope.customClass+" "+attrs.class:scope.customClass+" video-player mejs-ted",width:angular.isUndefined(attrs.width)?"700":attrs.width,height:angular.isUndefined(attrs.height)?"400":attrs.height};var videoHtml='<video width="'+params.width+'" height="'+params.height+'" class="'+params.class+'"';if(!angular.isUndefined(config.poster)){videoHtml+=' poster="'+config.poster+'" '}
3if(!angular.isUndefined(config.autoplay)&&config.autoplay){videoHtml+=" autoplay "}if(!angular.isUndefined(config.preload)){videoHtml+=' preload="'+config.preload+'" '}angular.forEach(config.extra,function(data,key){videoHtml+=" data-"+key+'="'+data+'" '});videoHtml+=">";angular.forEach(config.sources,function(src){videoHtml+='<source type="'+src.type+'" src="'+src.src+'"/>'});videoHtml+="</video>";return videoHtml};scope.applyConfig=function(config){if(!angular.isUndefined(config.isLive)&&config.isLive){scope.meOptions.forceLive=true}if(!angular.isUndefined(config.enableCast)&&config.enableCast){scope.meOptions.features.push("chromecast")}if(!angular.isUndefined(config.isVr)&&config.isVr){scope.meOptions.features.push("vrview");scope.meOptions.vrIsStereo=false}if(!angular.isUndefined(config.startAt)&&config.startAt){scope.meOptions.success=function(mediaElement,domObject){mediaElement.setCurrentTime(config.startAt)}}};scope.$watch(attrs.config,function(config){scope.applyConfig(config);element.html(scope.generateVideoHtml(config,attrs));$compile(element.contents())(scope);angular.element("."+scope.customClass).mediaelementplayer(scope.meOptions)})}}});App.directive("myMethod",function(){return{restrict:"A",scope:{method:"&"}
3,link:function(scope,element,attrs){var expressionHandler=scope.method();var id="123";$(element).click(function(e,rowid){expressionHandler(id)})}}});App.directive("a",function(){return{restrict:"E",link:function(scope,elem,attrs){if(!attrs.target){var modelName="_self";attrs.$set("target",modelName)}}}});App.directive("call",function(){return{restrict:"E",replace:true,scope:{key:"=?",src:"=",dataid:"=",dataalt:"=",errsrc:"=",accept:"&"},template:'<a ng-href="{{key}}" data-id="{{dataid}}" x-ng-click="click()"><img ng-src="{{src}}" err-src="{{errsrc}}" alt="{{dataalt}}" /></a>',controller:function($scope,$element,$attrs){$scope.click=function(){$scope.accept()}}}});App.directive("ngBindHtmlUnsafe",["$sce",function($sce){return{scope:{ngBindHtmlUnsafe:"="},template:"<div ng-bind-html='trustedHtml'></div>",link:function($scope,iElm,iAttrs,controller){$scope.updateView=function(){$scope.trustedHtml=$sce.trustAsHtml($scope.ngBindHtmlUnsafe)};$scope.$watch("ngBindHtmlUnsafe",function(newVal,oldVal){$scope.updateView(newVal)})}}}]);App.directive("ngEnter",function(){return function(scope,element,attrs){element.bind("keydown",function(e){if(e.which===13){if(!e.shiftKey){scope.$apply(function(){scope.$eval(attrs.ngEnter,{e:e})});e.preventDefault()}}})}});App.directive("ngSocialLink",function($compile){return{restrict:"A",replace:true,scope:{ngSocialLink:"="},link:function postLink(scope,element,attrs){scope.$watch("scope.ngSocialLink",function(html){element.on("click",function(){var wWidth=626;var wHeight=436;if(scope.ngSocialLink.width){wWidth=scope.ngSocialLink.width}if(scope.ngSocialLink.height){wHeight=scope.ngSocialLink.height}console.log(wWidth,wHeight);if(scope.ngSocialLink.social=="facebook"){window.open("https://www.facebook.com/sharer/sharer.php?u="+encodeURIComponent(scope.ngSocialLink.url),"","width="+wWidth+",height="+wHeight)}else if(scope.ngSocialLink.social=="twitter"){window.open("https://twitter.com/share?url="+encodeURIComponent(scope.ngSocialLink.url)+"&text="+encodeURIComponent(scope.ngSocialLink.title),"","width="+wWidth+",height="+wHeight)}else if(scope.ngSocialLink.social=="linkedin"){window.open("http://www.linkedin.com/shareArticle?mini=true&url="+encodeURIComponent(scope.ngSocialLink.url),"","menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height="+wWidth+",width="+wHeight)}else if(scope.ngSocialLink.social=="mail"){location.href="mailto:?subject="+encodeURIComponent(scope.ngSocialLink.title)+"&body="+encodeURIComponent(scope.ngSocialLink.url)}})})}}});(function(e){if("function"==typeof bootstrap)bootstrap("ng-time-relative",e);else if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else if("undefined"!=typeof ses){if(!ses.ok())return;ses.makeNgTimeRelative=e}else"undefined"!=typeof window?window.ngTimeRelative=e():global.ngTimeRelative=e()})(function(){var define,ses,bootstrap,module,exports;return function(e,t,n){function i(n,s){if(!t[n]){if(!e[n]){var o=typeof require=="function"&&require;if(!s&&o)return o(n,!0);if(r)return r(n,!0);throw new Error("Cannot find module '"+n+"'")}var u=t[n]={exports:{}};e[n][0](function(t){var r=e[n][1][t];return i(r?r:t)},u,u.exports)}return t[n].exports}var r=typeof require=="function"&&require;for(var s=0;s<n.length;s++)i(n[s]);return i}({1:[function(require,module,exports){"use strict";exports=module.exports=function(module){module.constant("timeRelativeConfig",{calendar:{en:{lastDay:"[Yesterday], LT",sameDay:"[Today], LT",nextDay:"[Tomorrow], LT",lastWeek:"dddd, LT",nextWeek:"[Next] dddd, LT",sameElse:"LL"},es:{lastDay:"[Ayer], LT",sameDay:"[Hoy], LT",nextDay:"[Mañana], LT",lastWeek:"dddd, LT",nextWeek:"[Próximo] dddd, LT",sameElse:"LL"},fr:{lastDay:"[Hier], LT",sameDay:"[Aujourd'hui], LT",nextDay:"[Matin], LT",lastWeek:"dddd, LT",nextWeek:"[Suivant] dddd, LT",sameElse:"LL"}}}).directive("format",["$timeout","moment",directiveFormat]).directive("relative",["$timeout","moment",directive]).run(["moment","timeRelativeConfig",function(moment,timeRelativeConfig){angular.forEach(timeRelativeConfig.calendar,function(translation,lang){moment.locale(lang,{c
3alendar:translation})})}])};exports.directive=directive;exports.directiveFormat=directive;if(angular){var mod=angular.module("timeRelative",[]);if(typeof moment!=="undefined"){mod.constant("moment",moment)}exports(mod)}function directiveFormat($timeout,moment){return{restrict:"AC",scope:{datetime:"@"},link:function(scope,element,attrs){var timeout;var MONTH_NAMES=new Array("January","February","March","April","May","June","July","August","September","October","November","December","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");var DAY_NAMES=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sun","Mon","Tue","Wed","Thu","Fri","Sat");function LZ(x){return(x<0||x>9?"":"0")+x}function isDate(val,format){var date=getDateFromFormat(val,format);if(date==0){return false}return true}function compareDates(date1,dateformat1,date2,dateformat2){var d1=getDateFromFormat(date1,dateformat1);var d2=getDateFromFormat(date2,dateformat2);if(d1==0||d2==0){return-1}else if(d1>d2){return 1}return 0}function formatDate(date,format){format=format+"";var result="";var i_format=0;var c="";var token="";var y=date.getYear()+"";var M=date.getMonth()+1;var d=date.getDate();var E=date.getDay();var H=date.getHours();var m=date.getMinutes();var s=date.getSeconds();var yyyy,yy,MMM,MM,dd,hh,h,mm,ss,ampm,HH,H,KK,K,kk,k;var value=new Object;if(y.length<4){y=""+(y-0+1900)}value["y"]=""+y;value["yyyy"]=y;value["yy"]=y.substring(2,4);value["M"]=M;value["MM"]=LZ(M);value["MMM"]=MONTH_NAMES[M-1];value["NNN"]=MONTH_NAMES[M+11];value["d"]=d;value["dd"]=LZ(d);value["E"]=DAY_NAMES[E+7];value["EE"]=DAY_NAMES[E];value["H"]=H;value["HH"]=LZ(H);if(H==0){value["h"]=12}else if(H>12){value["h"]=H-12}else{value["h"]=H}value["hh"]=LZ(value["h"]);if(H>11){value["K"]=H-12}else{value["K"]=H}value["k"]=H+1;value["KK"]=LZ(value["K"]);value["kk"]=LZ(value["k"]);if(H>11){value["a"]="PM"}else{value["a"]="AM"}value["m"]=m;value["mm"]=LZ(m);value["s"]=s;value["ss"]=LZ(s);while(i_format<format.length){c=format.charAt(i_format);token="";while(format.charAt(i_format)==c&&i_format<format.length){token+=format.charAt(i_format++)}if(value[token]!=null){result=result+value[token]}else{result=result+token}}return result}function _isInteger(val){var digits="1234567890";for(var i=0;i<val.length;i++){if(digits.indexOf(val.charAt(i))==-1){return false}}return true}function _getInt(str,i,minlength,maxlength){for(var x=maxlength;x>=minlength;x--){var token=str.substring(i,i+x);if(token.length<minlength){return null}if(_isInteger(token)){return token}}return null}function getDateFromFormat(val,format){val=val+"";format=format+"";var i_val=0;var i_format=0;var c="";var token="";var token2="";var x,y;var now=new Date;var year=now.getYear();var month=now.getMonth()+1;var date=1;var hh=now.getHours();var mm=now.getMinutes();var ss=now.getSeconds();var ampm="";while(i_format<format.length){c=format.charAt(i_format);token="";while(format.charAt(i_format)==c&&i_format<format.length){token+=format.charAt(i_format++)}if(token=="yyyy"||token=="yy"||token=="y"){if(token=="yyyy"){x=4;y=4}if(token=="yy"){x=2;y=2}if(token=="y"){x=2;y=4}year=_getInt(val,i_val,x,y);if(year==null){return 0}i_val+=year.length;if(year.length==2){if(year>70){year=1900+(year-0)}else{year=2e3+(year-0)}}}else if(token=="MMM"||token=="NNN"){month=0;for(var i=0;i<MONTH_NAMES.length;i++){var month_name=MONTH_NAMES[i];if(val.substring(i_val,i_val+month_name.length).toLowerCase()==month_name.toLowerCase()){if(token=="MMM"||token=="NNN"&&i>11){month=i+1;if(month>12){month-=12}i_val+=month_name.length;break}}}if(month<1||month>12){return 0}}else if(token=="EE"||token=="E"){for(var i=0;i<DAY_NAMES.length;i++){var day_name=DAY_NAMES[i];if(val.substring(i_val,i_val+day_name.length).toLowerCase()==day_name.toLowerCase()){i_val+=day_name.length;break}}}else if(token=="MM"||token=="M"){month=_getInt(val,i_val,token.length,2);if(month==null||month<1||month>12){return 0}i_val+=month.length}else if(token=="dd"||token=="d"){date=_getInt(val,i_val,token.length,2);if(date==null||date<1||date>31){return 0}i_val+=date.length}else if(token=="hh"||token=="h"){hh=_getInt(val,i_val,token.length,2);if(hh==null||hh<1||hh>12){return 0}i_val+=hh.length}else if(token=="HH"||token=="H"){hh=_getInt(val,i_val,token.length,2);if(hh==null||hh<0||hh>23){return 0}i_val+=hh.length}else if(token=="KK"||token=="K"){hh=_getInt(val,i_val,token.length,2);if(hh==null||hh<0||hh>11){return 0}i_val+=hh.length}else if(token=="kk"||token=="k"){hh=_getInt(val,i_val,token.length,2);if(hh==null||hh<1||hh>24){return 0}i_val+=hh.length;hh--}else if(token=="mm"||token=="m"){mm=_getInt(val,i_val,token.length,2);if(mm==null||mm<0||mm>59){return 0}i_val+=mm.length}else if(token=="ss"||token=="s"){ss=_getInt(val,i_val,token.length,2);if(ss==null||ss<0||ss>59){return 0}i_val+=ss.length}else if(token=="a"){if(val.substring(i_val,i_val+2).toLowerCase()=="am"){ampm="AM"}else if(val.substring(i_val,i_val+2).toLowerCase()=="pm"){ampm="PM"}else{return 0}i_val+=2}else{if(val.substring(i_val,i_val+token.length)!=token){return 0}else{i_val+=token.length}}}if(i_val!=val.length){return 0}if(month==2){if(year%4==0&&year%100!=0||year%400==0){if(date>29){return 0}}else{if(date>28){return 0}}}if(month==4||month==6||month==9||month==11){if(date>30){return 0}}if(hh<12&&m=="PM"){hh=hh-0+12}else if(hh>11&&m=="AM"){hh-=12}var newdate=new Date(year,month-1,date,hh,mm,ss);return newdate.getTime()}function parseDate(val){var preferEuro=arguments.length==2?arguments[1]:false;var generalFormats=new Array("y-M-d","MMM d, y","MMM d,y","y-MMM-d","d-MMM-y","MMM d");
3var monthFirst=new Array("M/d/y","M-d-y","M.d.y","MMM-d","M/d","M-d");var dateFirst=new Array("d/M/y","d-M-y","d.M.y","d-MMM","d/M","d-M");var checkList=new Array("generalFormats",preferEuro?"dateFirst":"monthFirst",preferEuro?"monthFirst":"dateFirst");var d=null;for(var i=0;i<checkList.length;i++){var l=window[checkList[i]];for(var j=0;j<l.length;j++){d=getDateFromFormat(val,l[j]);if(d!=0){return new Date(d)}}}return null}function stringToDate(_date,_format,_delimiter){var formatLowerCase=_format.toLowerCase();var formatItems=formatLowerCase.split(_delimiter);var dateItems=_date.split(_delimiter);var monthIndex=formatItems.indexOf("mm");var dayIndex=formatItems.indexOf("dd");var yearIndex=formatItems.indexOf("yyyy");var month=parseInt(dateItems[monthIndex]);month-=1;var formatedDate=new Date(dateItems[yearIndex],month,dateItems[dayIndex]);return formatedDate}scope.$watch("datetime",function(dateString){$timeout.cancel(timeout);var log="log"in attrs;if(!dateString)return"";var withoutHour=dateString.indexOf("_")<9?true:false,minutesPos=dateString.substring(12,14),dateString=dateString.replace(/_/g,"1");var dateJs=new Date(getDateFromFormat(dateString,"dd/mm/yy HH:m:s"));var date=moment(dateJs);if(!date)return"";var to=function(){return moment(attrs.to)};var withoutSuffix="withoutSuffix"in attrs;var etaTime="eta"in attrs;if(log){console.log(withoutHour);console.log(dateString);console.log(dateJs);console.log("date",date)}if(!attrs.title)element.attr("title",date.format("LLLL"));function updateTime(){if(etaTime){var day=date.format("D");var month=date.format("MMM");var hour=date.format("HH");var minutes=date.format("mm");var texthour="";if(minutes>0&&(minutes!=11||!isNaN(minutesPos))&&date.format("HHms")!=111111){texthour=", "+date.format("HH")+":"+minutes+'<span class="unit"> UTC</span>'}else if(date.format("HHms")!=111111){texthour=", "+date.format("HH")+'<span class="unit">h UTC</span>'}element.html(day+'<span class="unit"> '+month+"</span>"+texthour)}else{element.text(date.format("LLLL"))}}function diffString(a,b){if(Math.abs(a.clone().startOf("day").diff(b,"days",true))<1)return a.from(b,withoutSuffix);else return a.calendar(b)}function updateLater(){updateTime();timeout=$timeout(function(){updateLater()},nextUpdateIn())}function nextUpdateIn(){var delta=Math.abs(moment().diff(date));if(delta<45e3)return 45e3-delta;if(delta<9e4)return 9e4-delta;if(delta<45*6e4)return 6e4-(delta+3e4)%6e4;return 366e4-delta%36e5}element.bind("$destroy",function(){$timeout.cancel(timeout)});updateLater()})}}}function directive($timeout,moment){return{restrict:"AC",scope:{datetime:"@"},link:function(scope,element,attrs){var timeout;scope.$watch("datetime",function(dateString){$timeout.cancel(timeout);if(!dateString)return"";var date=moment(dateString);if(!date)return"";var to=function(){return moment(attrs.to)};var withoutSuffix="withoutSuffix"in attrs;if(!attrs.title)element.attr("title",date.format("LLLL"));function updateTime(){element.text(diffString(date,to()))}function diffString(a,b){if(Math.abs(a.clone().startOf("day").diff(b,"days",true))<1)return a.from(b,withoutSuffix);else return a.calendar(b)}function updateLater(){updateTime();timeout=$timeout(function(){updateLater()},nextUpdateIn())}function nextUpdateIn(){var delta=Math.abs(moment().diff(date));if(delta<45e3)return 45e3-delta;if(delta<9e4)return 9e4-delta;if(delta<45*6e4)return 6e4-(delta+3e4)%6e4;return 366e4-delta%36e5}element.bind("$destroy",function(){$timeout.cancel(timeout)});updateLater()})}}}},{}]},{},[1])});angular.module("ngRepeatUtils",[]).directive("ngRepeatEndWatch",function(){return{restrict:"A",scope:{},link:function(scope,element,attrs){if(attrs.ngRepeat){if(scope.$parent.$last){if(attrs.ngRepeatEndWatch!==""){if(typeof scope.$parent.$parent[attrs.ngRepeatEndWatch]==="function"){if(!angular.isUndefined(attrs.ngRepeatEndWatchParam)){scope.$parent.$parent[attrs.ngRepeatEndWatch](attrs.ngRepeatEndWatchParam)}else{scope.$parent.$parent[attrs.ngRepeatEndWatch]()}}else{scope.$parent.$parent[attrs.ngRepeatEndWatch]=true}}else{scope.$parent.$parent.ngRepeatEnd=true}}}else{throw"ngRepeatEndWatch: `ngRepeat` Directive required to use this Directive"}}}});App.directive("onFinishRenderRep",function(){return{restrict:"A",link:function(scope,element,attr){if(scope.$last===true){element.ready(function(){scope.FinishRepeat()})}}}});App.directive("onFinishRender",function($timeout){return{restrict:"A",link:function(scope,element,attr){if(scope.$last===true){$timeout(function(){if(!(typeof attr.onFinishRender=="undefined")&&attr.onFinishRender.length>1){eval(attr.onFinishRender)}scope.$emit("ngRepeatFinished")})}}}});App.directive("otpInput",["$timeout",function($timeout){return{restrict:"A",scope:{options:"="},template:"<div>"+"<input type='{{type}}' ng-repeat=\"c in characters\" autocomplete='off' ng-paste='onPaste($index,$event)' ng-keyup='onKeyUp($index,$event)' ng-keydown='onKeyDown($index,$event)' ng-model='c.value' id='otpInput{{c.index}}' name='otpInput{{c.index}}' ng-style=\"style\" placeholder=\"{{placeholder}}\" maxlength=\"1\" />\n"+"</div>",link:function($scope,elem){var size=parseInt($scope.options.size)||6;var width=100/(size+1);var margin=width/size;var tmp=[],elementArr=[];var DEFAULT_COLOR="#6f6d6d";var randomNumber=Math.floor(Math.random()*1e4)+100;
3$scope.style={"margin-right":margin+"%",border:"2px solid","border-radius":"0",display:"inline-block",width:width+"%","text-align":"center",padding:"5px 0px",outline:"none","box-shadow":"none",background:"transparent","border-color":$scope.options.style&&$scope.options.style.lineColor?$scope.options.style.lineColor:DEFAULT_COLOR,color:$scope.options.style&&$scope.options.style.color?$scope.options.style.color:DEFAULT_COLOR,"font-size":$scope.options.style&&$scope.options.style.fontSize?scope.options.style.fontSize:"20px"};$scope.isPasting=false;$scope.type=$scope.options.type?$scope.options.type:"number";$scope.placeholder=$scope.options.placeholder&&$scope.options.placeholder.length===1?$scope.options.placeholder:"";$scope.setOtpValue=function(){$scope.options.value="";var done=true;angular.forEach($scope.characters,function(v,k){if((v.value+"").length!==1){done=false;return false}$scope.options.value=$scope.options.value+v.value});if(done){if(typeof $scope.options.onDone==="function"){$scope.options.onDone($scope.options.value)}}};$scope.onPaste=function(index,event){if(index<1&&typeof event.originalEvent.clipboardData!=="undefined"){var pastedData=event.originalEvent.clipboardData.getData("text/plain");if(pastedData.length==size){$scope.isPasting=true;$scope.options.value=pastedData;for(var i=0;i<size;i++){$scope.characters[i].value=pastedData.substring(i,i+1)}if(typeof $scope.options.onDone==="function"){$scope.options.onDone($scope.options.value)}setTimeout(function(){$scope.isPasting=false},100)}}};$scope.onKeyUp=function(index,e){if($scope.isPasting){return}var key=e.keyCode||e.which;var old=$scope.options.value;$scope.setOtpValue();if(($scope.characters[index].value+"").length>0&&key!==8&&index!=size-1){$timeout(function(){elementArr[index+1][0].focus()})}if(typeof $scope.options.onChange==="function"&&old!==$scope.options.value){$scope.options.onChange($scope.options.value)}};$scope.onKeyDown=function(index,e){if($scope.isPasting){return}var key=e.keyCode||e.which;if(key===8&&$scope.characters[index].value+""===""&&index!==0){$timeout(function(){elementArr[index-1][0].focus()})}};for(var i=0;i<size;i++){tmp.push({index:randomNumber+"-"+i,value:""})}$scope.characters=tmp;$timeout(function(){for(var i=0;i<size;i++){elementArr.push(angular.element(document.querySelector("#otpInput"+randomNumber+"-"+i)))}})}}}]);angular.module("angular-owl-carousel-2",[]);(function(app){function OwlController(){this.owlApi={}}OwlController.prototype.init=function(){this.owlApi=arguments[0]};OwlController.prototype.getApi=function(){var self=this;return{trigger:function(){self.owlApi.trigger.apply(self.owlApi,arguments)}}};var owlProperties=["items","margin","loop","center","mouseDrag","touchDrag","pullDrag","freeDrag","stagePadding","merge","mergeFit","autoWidth","autoHeight","startPosition","URLhashListener","nav","rewind","navText","navElement","slideBy","dots","dotsEach","dotData","lazyLoad","lazyContent","autoplay","autoplayTimeout","autoplayHoverPause","smartSpeed","fluidSpeed","autoplaySpeed","navSpeed","dotsSpeed","dragEndSpeed","callbacks","responsive","responsiveRefreshRate","responsiveBaseElement","video","videoHeight","videoWidth","animateIn","animateInClass","animateOutClass","animateOut","fallbackEasing","info","nestedItemSelector","itemElement","stageElement","navContainer","dotsContainer","refreshClass","loadingClass","loadedClass","rtlClass","dragClass","grabClass","stageClass","stageOuterClass","navContainerClass","navClass","controlsClass","dotClass","dotsClass","autoHeightClass","responsiveClass","onInitialize","onInitialized","onResize","onResized","onRefresh","onRefreshed","onDrag","onDragged","onTranslate","onTranslated","onChange","onChanged","onLoadLazy","onLoadedLazy","onStopVideo","onPlayVideo"];app.directive("ngOwlCarousel",["$timeout","$log",function($timeout,$log){return{restrict:"E",link:link,scope:{owlItems:"=",owlProperties:"=",owlReady:"&"},controller:OwlController,transclude:true,template:'<div class="owl-carousel" data-ng-transclude></div>'};function link($scope,$element,$attr,owlCtrl){var options=buildProperties($scope.owlProperties),initial=true,owlCarouselClassName=".owl-carousel",owlCarousel=null;$scope.$watch("owlItems",function(){try{destroyOwl()}catch(e){}if($scope.owlItems instanceof Array){initOwl()}},true);function buildProperties(props){var build={};if(props){for(var key in props){if(owlProperties.indexOf(key)>=0){build[key]=props[key]}else{$log.warn("unknown property : "+key)}}}return build}function initOwl(){$timeout(function(){owlCarousel=$element.find(owlCarouselClassName).owlCarousel(options);owlCtrl.init(owlCarousel);if(angular.isDefined($scope.owlReady)){$scope.owlReady({$api:owlCtrl.getApi()})}})}function destroyOwl(){owlCarousel.owlCarousel("destroy");$element.find(".owl-stage").remove()}}}])})(App);var rcSubmitDirective={rcSubmit:["$parse",function($parse){return{restrict:"A",require:["rcSubmit","?form"],controller:["$scope",function($scope){this.attempted=false;var formController=null;this.setAttempted=function(){this.attempted=true};this.setFormController=function(controller){formController=controller};this.needsAttention=function(fieldModelController){if(!formController)return false;
3if(fieldModelController){return fieldModelController.$invalid&&(fieldModelController.$dirty||this.attempted)}else{return formController&&formController.$invalid&&(formController.$dirty||this.attempted)}}}],compile:function(cElement,cAttributes,transclude){return{pre:function(scope,formElement,attributes,controllers){var submitController=controllers[0];var formController=controllers.length>1?controllers[1]:null;submitController.setFormController(formController);scope.rc=scope.rc||{};scope.rc[attributes.name]=submitController},post:function(scope,formElement,attributes,controllers){var submitController=controllers[0];var formController=controllers.length>1?controllers[1]:null;var fn=$parse(attributes.rcSubmit);formElement.bind("submit",function(event){submitController.setAttempted();if(!scope.$$phase)scope.$apply();if(!formController.$valid)return false;scope.$apply(function(){fn(scope,{$event:event})})})}}}}}]};angular.module("directives.repeatComplete",[]).directive("repeatComplete",function($rootScope){var uuid=0;function compile(tElement,tAttributes){var id=++uuid;tElement.attr("repeat-complete-id",id);tElement.removeAttr("repeat-complete");var completeExpression=tAttributes.repeatComplete;var parent=tElement.parent();var parentScope=parent.scope()||$rootScope;var unbindWatcher=parentScope.$watch(function(){console.info("Digest running.");var lastItem=parent.children("*[ repeat-complete-id = '"+id+"' ]:last");if(!lastItem.length){return}var itemScope=lastItem.scope();if(itemScope.$last){unbindWatcher();itemScope.$eval(completeExpression)}})}return{compile:compile,priority:1001,restrict:"A"}});"use strict";angular.module("directives.resizables",[]).directive("imgFitWidth",function($window){return{replace:true,scope:{key:"=",src:"=",dataid:"=",errsrc:"=",accept:"&"},template:'<img ng-src="{{src}}" err-src="{{errsrc}}" />',restrict:"EA",link:function postLink(scope,element,attrs){var container=element.find("div");var parent=element.parent();var img=element;scope.onResizeFunction=function(){scope.__ImgHeight=img.height();scope.__ImgWidth=img.width();scope.__cWidth=element.width();scope.__cHeight=element.width()*9/16;scope.__pHeight=parent.height();element.css("overflow","hidden");img.css("width",scope.__cWidth)};img.bind("load",function(e){img.unbind("load");w=parseInt(element.css("width"));wP=parseInt(parent.css("width"));img.css("width","100%");console.log("width: "+element[0].naturalWidth+" - height: "+element[0].naturalHeight);if(w<wP+10){scope.onResizeFunction()}});angular.element($window).bind("resize",function(){if(element[0].naturalWidth<element[0].naturalHeight){scope.onResizeFunction()}scope.$apply()})}}}).directive("imgcover",function($window){return{replace:true,scope:{key:"=",src:"=",dataid:"=",errsrc:"=",accept:"&"},template:'<div class="container-cover" data-id="{{dataid}}" x-ng-click="click()"><img ng-src="{{src}}" err-src="{{errsrc}}" /></div>',restrict:"EA",link:function postLink(scope,element,attrs){var container=element.find("div");var img=element.find("img");scope.onResizeFunction=function(){scope.__ImgHeight=img.height();scope.__ImgWidth=img.width();scope.__cWidth=element.width();scope.__cHeight=element.width()*9/16;element.css("height",scope.__cHeight);element.css("overflow","hidden");img.css("width",scope.__cWidth);img.css("margin-top",(scope.__cHeight-scope.__ImgHeight)/2);img.css("margin-left",(scope.__cWidth-scope.__ImgWidth)/2)};img.bind("load",function(e){img.unbind("load");w=parseInt(element.css("width"));h=parseInt(w*1*300/300);img.css("width",w);scope.onResizeFunction()});scope.onResizeFunction();angular.element($window).bind("resize",function(){scope.onResizeFunction();scope.$apply()})}}}).directive("imgcrop",function($window){return{replace:true,scope:{key:"=",ng_src:"=",dataid:"=",errsrc:"=",style:"=",accept:"&"},template:'<div class="container-cover" data-id="{{dataid}}" x-ng-click="click()"><img ng-src="{{ng_src}}" err-src="{{errsrc}}" /></div>',restrict:"EA",link:function postLink(scope,element,attrs){var container=element.find("div");var img=element.find("img");scope.onResizeFunction=function(){scope.__ImgHeight=img.height();
3scope.__ImgWidth=img.width();scope.__cWidth=element.width();scope.__cHeight=element.width()*9/16;element.css("height",scope.__cHeight);img.css("width",scope.__cWidth);img.css("margin-top",(scope.__cHeight-scope.__ImgHeight)/2);img.css("margin-left",(scope.__cWidth-scope.__ImgWidth)/2)};img.bind("load",function(e){img.unbind("load");w=parseInt(element.css("width"));h=parseInt(w*1*300/300);img.css("width",w);scope.onResizeFunction()});scope.onResizeFunction();angular.element($window).bind("resize",function(){scope.onResizeFunction();scope.$apply()})}}}).directive("resize",["$parse",function($parse){return{link:function(scope,elm,attrs){var imagePercent,width,height;imagePercent=$parse(attrs.imagePercent)(scope);imageWidth=$parse(attrs.imageWidth)(scope);imageHeight=$parse(attrs.imageHeight)(scope);elm.bind("load",function(e){elm.unbind("load");w=parseInt(elm.css("width"));h=parseInt(w*1*imageHeight/imageWidth);elm.css("height",h)})}}}]).directive("imgCropped",function(){return{restrict:"E",replace:true,scope:{src:"@",selected:"&"},link:function(scope,element,attr){var myImg;var clear=function(){if(myImg){myImg.next().remove();myImg.remove();myImg=undefined}};scope.$watch("src",function(nv){clear();if(nv){element.after("<img />");myImg=element.next();myImg.attr("src",nv);$(myImg).Jcrop({trackDocument:true,onSelect:function(x){scope.$apply(function(){scope.selected({cords:x})})},aspectRatio:1},function(){var bounds=this.getBounds();boundx=bounds[0];boundy=bounds[1]})}});scope.$on("$destroy",clear)}}}).directive("imageResize",["$parse",function($parse){return{link:function(scope,elm,attrs){var imagePercent;imagePercent=$parse(attrs.imagePercent)(scope);elm.bind("load",function(e){elm.unbind("load");var canvas,ctx,neededHeight,neededWidth;neededHeight=elm[0].naturalHeight*imagePercent/100;neededWidth=elm[0].naturalWidth*imagePercent/100;canvas=document.createElement("canvas");canvas.width=neededWidth;canvas.height=neededHeight;ctx=canvas.getContext("2d");ctx.drawImage(elm[0],0,0,neededWidth,neededHeight);elm.attr("src",canvas.toDataURL("image/jpeg"))})}}}]);"use strict";angular.module("directives.spinner",[]).factory("httpInterceptor",["$q","$rootScope","$location",function($q,$rootScope,$location){var numLoadings;numLoadings=void 0;numLoadings=0;return{request:function(config){numLoadings++;if(config.url.indexOf("headerData")==-1)$rootScope.$broadcast("loader_show");return config||$q.when(config)},response:function(response){if(--numLoadings===0){$rootScope.$broadcast("loader_hide")}return response||$q.when(response)},responseError:function(response){if(!--numLoadings){$rootScope.$broadcast("loader_hide")}return $q.reject(response)}}}]).config(function($httpProvider){$httpProvider.interceptors.push("httpInterceptor")}).directive("spinner",function(){return{restrict:"A",replace:false,link:function($scope,element,attrs){$scope.$on("loader_show",function(){return element.show()});return $scope.$on("loader_hide",function(){return element.hide()})}}});App.directive("tienClndr",function(){return{restrict:"E",transclude:true,replace:true,scope:{clndr:"=tienClndrObject",events:"=tienEvents"},template:'<div><div class="clndr_container"></div></div>',controller:function($scope,$element,$attrs,$transclude){return $transclude(function(clone,scope){var render;$element.append(clone);render=function(data){angular.extend(scope,data)};$scope.clndr=$($element).find(".clndr_container").clndr({render:render,weekOffset:1,daysOfTheWeek:["D","L","M","M","J","V","S"],clickEvents:{click:function(target){if(!$(target.element).hasClass("inactive")){console.log("You picked a valid date!")}else{console.log("That date is outside of the range.")}},nextMonth:function(month){console.log("Month click.")},previousMonth:function(month){},nextYear:function(month){},previousYear:function(month){},onMonthChange:function(month){},onYearChange:function(month){},today:function(month){}}});$scope.clndr.setEvents(angular.copy($scope.events));return $scope.clndr})}}});(function(angular){angular.module("tooltipster",[]).directive("tooltipTitle",function(){return{restrict:"A",scope:{tooltipTitle:"@",tooltipTitleVariable:"=",tooltipOptions:"="},link:function(scope,element,attrs){var isTooltipDynamicVariable=scope.tooltipTitleVariable!==undefined;if(!scope.tooltipTitle&&!isTooltipDynamicVariable){return}var tooltipOptions=scope.tooltipOptions||{};var message=scope.tooltipTitle;if(isTooltipDynamicVariable){message=scope.tooltipTitleVariable;scope.$watch("tooltipTitleVariable",function(value){element.tooltipster("content",value);if(!value){element.tooltipster("disable")}else{element.tooltipster("enable")}})}tooltipOptions.content=message;element.tooltipster(tooltipOptions);scope.$on("$destroy",function(){try{element.tooltipster("destroy")}catch(e){}})}}})})(angular);App.factory("uiDatepickerAPI",function(){return{dateFrom:null,status:null,message:null,setdateFrom:function(dateFrom){this.dateFrom=dateFrom},success:function(msg){console.log("success");this.status="success";this.message=msg},error:function(msg){this.status="error";this.message=msg},clear:function(){this.status=null;this.message=null;dateFrom:null}}});App.directive("uiDatepicker",function($compile,$parse){return{restrict:"E",replace:true,transclude:false,controller:function($scope,$element,uiDatepickerAPI){$scope.show=false;$scope.api=uiDatepickerAPI;$scope.$watch("api.dateFrom",goToDate);$scope.hide=function(){$scope.show=false;$scope.api.clear()};function goToDate(){$element.datepicker("setDate",new Date($scope.api.dateFrom));$element.datepicker("refresh")}},compile:function(element,attrs,uiDatepickerAPI){var html="<div id='"+attrs.id+"' class='"+attrs["class"]+"'></div>";var newElem=$(html);element.replaceWith(newElem);Number.prototype.padZero=function(len){var s=String(this),c="0";len=len||2;while(s.length<len)s=c+s;return s};return function(scope,element,attrs,controller,uiDatepickerAPI){var searchEventsOnDay=function(events,date){var exists=false;angular.forEach(events,function(value,index){if(value===date){exists=true}});return exists};var processChange=function(date){scope.$apply(function(scope){scope[attrs.dayCallback](moment(date))})};var events=[];element.datepicker({inline:true,showOtherMonths:false,dayNamesMin:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],onSelect:processChange,beforeShowDay:function(date){var current_day=[(date.getMonth()+1).padZero(),date.getDate().padZero(),date.getFullYear()].join("-");if(searchEventsOnDay(events,current_day)){return[true,"ui-datepicker-has-event",""]}else{return[true,"",""]}},onChangeMonthYear:function(year,month,inst){var _date=month+"/"+1+"/"+year;if(attrs.monthCallback){scope[attrs.monthCallback](moment(_date))}}});if(attrs.eventSource){scope.$watch(attrs.eventSource,function(val){events=val;element.datepicker("refresh")})}}}}});App.directive("uiTree",function(){return{template:'<ul class="uiTree"><ui-tree-node ng-repeat="node in tree"></ui-tree-node></ul>',replace:true,transclude:true,restrict:"E",scope:{tree:"=ngModel",attrNodeId:"@",loadFn:"=",expandTo:"=",selectedId:"="},controller:function($scope,$element,$attrs){$scope.loadFnName=$attrs.loadFn;if($scope.$parent.loadFn)$scope.loadFn=$scope.$parent.loadFn;if($scope.expandTo&&$scope.expandTo.length){$scope.expansionNodes=angular.copy($scope.expandTo);var arrExpandTo=$scope.expansionNodes.split(",");$scope.nextExpandTo=arrExpandTo.shift();$scope.expansionNodes=arrExpandTo.join(",")}}}}).directive("uiTreeNode",["$compile","$timeout",function($compile,$timeout){return{restrict:"E",replace:true,template:"<li>"+'<div class="node" data-node-id="{{ nodeId() }}">'+'<a class="icon" ng-click="toggleNode(nodeId())"">CC</a>'+'<a ng-hide="selectedId" ng-href="#/assets/{{ nodeId() }}">{{ node.name }}</a>'+'<span ng-show="selectedId" ng-class="css()" ng-click="setSelected(node)">'+"{{ node.name }}</span>"+"</div>"+"</li>",link:function(scope,elm,attrs){scope.nodeId=function(node){var localNode=node||scope.node;return localNode[scope.attrNodeId]};scope.toggleNode=function(nodeId){var isVisible=elm.children(".uiTree:visible").length>0;var childrenTree=elm.children(".uiTree");
3if(isVisible){scope.$emit("nodeCollapsed",nodeId)}else if(nodeId){scope.$emit("nodeExpanded",nodeId)}if(!isVisible&&scope.loadFn&&childrenTree.length===0){var callback=function(arrChildren){scope.node.children=arrChildren;scope.appendChildren();elm.find("a.icon i").show();elm.find("a.icon img").remove();scope.toggleNode()};var promiseOrNodes=scope.loadFn(nodeId,callback);if(promiseOrNodes&&promiseOrNodes.then){promiseOrNodes.then(callback)}else{$timeout(function(){callback(promiseOrNodes)},0)}elm.find("a.icon i").hide();var imgUrl="http://www.efsa.europa.eu/efsa_rep/repository/images/ajax-loader.gif";elm.find("a.icon").append('<img src="'+imgUrl+'" width="18" height="18">')}else{childrenTree.toggle(!isVisible);elm.find("a.icon i").toggleClass("icon-chevron-right");elm.find("a.icon i").toggleClass("icon-chevron-down")}};scope.appendChildren=function(){var childrenHtml='<ui-tree ng-model="node.children" attr-node-id="'+scope.attrNodeId+'"';if(scope.loadFn){childrenHtml+=' load-fn="'+scope.loadFnName+'"'}if(scope.expansionNodes){childrenHtml
3+=' expand-to="expansionNodes"'}if(scope.selectedId){childrenHtml+=' selected-id="selectedId"'}childrenHtml+=' style="display: none"></ui-tree>';return elm.append($compile(childrenHtml)(scope))};scope.css=function(){return{nodeLabel:true,selected:scope.selectedId&&scope.nodeId()===scope.selectedId}};scope.setSelected=function(node){scope.$emit("nodeSelected",node)};scope.$on("selectNode",function(event,node){scope.selectedId=scope.nodeId(node)});if(scope.node.hasChildren){elm.find("a.icon").append('<i class="icon-chevron-right"></i>')}if(scope.nextExpandTo&&scope.nodeId()==parseInt(scope.nextExpandTo,10)){scope.toggleNode(scope.nodeId())}}}}]);App.directive("videoTrim",["$sce","$rootScope","$filter",function($sce,$rootScope,$filter){"use strict";return{templateUrl:"videoTrim/template",restrict:"E",link:function(scope,element,attrs){scope.$watch("clipsMarks",function(data){if(!angular.isUndefined(data.marks)){scope.tags=data.marks;console.log("update tags",scope.tags)}});if(typeof scope.onInit=="function"){scope.onInit()}scope.tags=[];scope.subtitles=[];if(!angular.isUndefined(scope.item.subtitles)){var itemSubtitles=angular.fromJson(scope.item.subtitles);angular.forEach(itemSubtitles,function(subtitle,index){scope.subtitles.push({id:index,url:$sce.trustAsResourceUrl(subtitle.src),label:subtitle.label,lang:subtitle.lang})})}scope.audios=[];if(angular.isUndefined(scope.item.audios)){var allAudios=$filter("filter")(scope.item.children,{class:"3"},true);if(allAudios.length>0){angular.forEach(allAudios,function(audio,index){scope.audios.push({value:(index+1).toString(),url:$sce.trustAsResourceUrl(audio.media.view),name:audio.title})})}}if(scope.subtitles.length>0){$.get(scope.subtitles[0].url,function(data){scope.subtitleLines=data.split("\n\n");scope.subtitleLines=scope.subtitleLines.map(x=>{x=x.split("\n");x.shift();let time=x.shift();return{timestart:time.split("--\x3e")[0],timeend:time.split("--\x3e")[1],lines:x}})})}scope.url=scope.item.media.source;var offset=30;scope.zoom=false;var mediaElementPlayer;scope.currentTrackAudio="";scope.currentUrl="";if(scope.audios.length>0){scope.currentTrackAudio=scope.audios[0].value;scope.currentUrl=scope.audios[0].url}setTimeout(()=>{scope.audio=document.getElementById("myaudio");scope.changedValue=(track=>{var selectAudio=scope.audios.find(x=>x.value==track);scope.currentUrl=selectAudio.url;scope.currentTrackAudio=selectAudio.value;scope.audio.pause();scope.audio.load();scope.audio.oncanplaythrough=scope.audio.play()});var player=new MediaElementPlayer("vp-m3u8",{startVolume:1,alwaysShowControls:true,defaultQuality:"auto",features:["playpause","current","progress","duration","tracks","volume","fullscreen"],success:(mediaElement,domObject)=>{var interval=0;scope.start=0;mediaElementPlayer=mediaElement;mediaElement.play();scope.syncAudio(mediaElement,scope.audio);mediaElement.addEventListener("loadedmetadata",e=>{scope.$apply(()=>{console.log("loadMetaData");scope.end=mediaElement.getDuration();scope.current=scope.start;scope.currentPercent=scope.start;scope.duration=scope.end})});mediaElement.addEventListener("progress",e=>{scope.$apply(()=>{scope.duration=mediaElement.getDuration();if(!scope.touched){scope.end=scope.duration}})});mediaElement.addEventListener("timeupdate",e=>{scope.$apply(()=>{scope.current=mediaElement.getCurrentTime();scope.currentPercent=scope.current/(scope.end-scope.start)*100;if(scope.current<scope.start){scope.current=scope.start}if(scope.current>scope.end&&scope.playingclip){if(mediaElement.paused===false){mediaElement.pause();scope.playingclip=false}}})},false);mediaElement.addEventListener("captionschange",e=>{scope.$apply(()=>{scope.changeSubtitle(e.detail.caption.srclang)})},false);scope.onTrimChange=function(){scope.touched=true;scope.playingclip=false;mediaElement.pause()};scope.$watch("start",function(num){if(num!==undefined&&!scope.clickIn){if(interval){window.clearInterval(interval)}interval=window.setTimeout(function(){mediaElement.setCurrentTime(scope.start)},300)}});scope.$watch("end",function(num){if(scope.touched&&!scope.clickIn){if(num!==undefined){if(interval){window.clearInterval(interval)}interval=window.setTimeout(function(){mediaElement.setCurrentTime(scope.end)},300)}}});scope.$watch("startZoom",function(num){if(num!==undefined){scope.start=scope.originalStart-offset+num}});scope.$watch("endZoom",function(num){if(num!==undefined){scope.end=scope.start+scope.endZoom-scope.startZoom}});scope.$watch("tracks",function(data){console.log(data)})}});$rootScope.$on("EDIT_CLIP_WINDOW",function(event,data){mediaElementPlayer.setVolume(data.volume)})});scope.syncAudio=function(video,audio){let updateCounter=0;video.addEventListener("timeupdate",e=>
3{if(updateCounter===2e3){audio.currentTime=video.currentTime}if(!audio.currentTime||Math.abs(scope.current-audio.currentTime)>.3){audio.currentTime=video.currentTime}updateCounter++});video.addEventListener("seeked",e=>{console.log("seeked");audio.currentTime=video.currentTime;if(!video.paused){audio.play();console.log("audio play")}});video.addEventListener("play",e=>{console.log("play");audio.currentTime=video.currentTime;if(!video.paused){audio.play();console.log("audio play")}});video.addEventListener("pause",e=>{console.log("pause");audio.pause()});video.addEventListener("waiting",e=>{console.log("waiting");audio.pause()});video.addEventListener("canplaythrough",e=>{console.log("canplaythrough");audio.currentTime=video.currentTime;if(!video.paused){audio.play();console.log("audio play")}});let updateCounterAudio=0;audio.addEventListener("timeupdate",e=>{if(updateCounterAudio===2e3){video.currentTime=audio.currentTime}updateCounterAudio++})};scope.onCreateClip=function(){if(scope.startInput!=undefined&&scope.endInput!=undefined){scope.start=parseInt(scope.startInput.split(":")[0])*60*60+parseInt(scope.startInput.split(":")[1])*60+parseInt(scope.startInput.split(":")[2]);scope.end=parseInt(scope.endInput.split(":")[0])*60*60+parseInt(scope.endInput.split(":")[1])*60+parseInt(scope.endInput.split(":")[2])}scope.onEmitCreate({start:parseInt(scope.start),end:parseInt(scope.end)});mediaElementPlayer.pause();scope.audio.pause()};scope.onCreateClipApi=function(title,edit,create){if(scope.startInput!=undefined&&scope.endInput!=undefined){if(create){scope.onEmitCreateApi({title:title,start:scope.startInput,end:scope.endInput})}else{scope.onEmitCreateMark({title:title,start:scope.startInput,end:scope.endInput})}scope.start=parseInt(scope.startInput.split(":")[0])*60*60+parseInt(scope.startInput.split(":")[1])*60+parseInt(scope.startInput.split(":")[2]);scope.end=parseInt(scope.endInput.split(":")[0])*60*60+parseInt(scope.endInput.split(":")[1])*60+parseInt(scope.endInput.split(":")[2])}else{var formatstart=new Date(parseInt(scope.start)*1e3).toISOString().substr(11,8);var formatend=new Date(parseInt(scope.end)*1e3).toISOString().substr(11,8);if(create){scope.onEmitCreateApi({title:title,start:formatstart,end:formatend})}else{scope.onEmitCreateMark({title:title,start:formatstart,end:formatend})}mediaElementPlayer.pause();scope.audio.pause()}};scope.onTitleWindow=function(ev,create){scope.onCreateClipApi("test title",false,create)};scope.getFormatTime=function(seconds){if(seconds){return new Date(parseInt(seconds)*1e3).toISOString().substr(11,8)}else{return""}};scope.changeSubtitle=function(lang){angular.forEach(scope.subtitles,function(item){if(item.lang==lang){$.get(item.url,function(data){scope.subtitleLines=data.split("\n\n");scope.subtitleLines=scope.subtitleLines.map(x=>{x=x.split("\n");x.shift();let time=x.shift();return{timestart:time.split("--\x3e")[0],timeend:time.split("--\x3e")[1],lines:x}})})}})};scope.gotoSubtitles=function(item){let seg=item.timestart.split(":").reverse();let time=parseFloat(seg[0]);time+=parseFloat(seg[1])*60;time+=parseFloat(seg[2])*60*60;mediaElementPlayer.setCurrentTime(time)};scope.goto=function(seconds){scope.clickedIn=false;scope.clickedOut=false;mediaElementPlayer.setCurrentTime(mediaElementPlayer.getCurrentTime()-seconds);scope.start=mediaElementPlayer.getCurrentTime();scope.end=mediaElementPlayer.getCurrentTime()+seconds;scope.startInput=new Date(parseInt(scope.start)*1e3).toISOString().substr(11,8);scope.endInput=new Date(parseInt(scope.end)*1e3).toISOString().substr(11,8);scope.touched=true};scope.gototag=function(start,end){var startsplited=start.split(":");var endsplited=end.split(":");var startSeconds=parseInt(startsplited[0])*60*60+parseInt(startsplited[1])*60+parseInt(startsplited[2]);var endSeconds=parseInt(endsplited[0])*60*60+parseInt(endsplited[1])*60+parseInt(endsplited[2]);mediaElementPlayer.setCurrentTime(startSeconds);scope.start=startSeconds;scope.end=endSeconds;scope.startInput=new Date(parseInt(scope.start)*1e3).toISOString().substr(11,8);scope.endInput=new Date(parseInt(scope.end)*1e3).toISOString().substr(11,8);scope.touched=true;scope.clickedIn=true;scope.clickedOut=true};scope.revto=function(seconds){mediaElementPlayer.setCurrentTime(mediaElementPlayer.getCurrentTime()-seconds);mediaElementPlayer.play();scope.audio.play()};scope.revclickIn=function(seconds){scope.start=scope.start-seconds;scope.startInput=new Date(parseInt(scope.start)*1e3).toISOString().substr(11,8)};scope.forwardclickIn=function(seconds){scope.start=scope.start+seconds;scope.startInput=new Date(parseInt(scope.start)*1e3).toISOString().substr(11,8)};scope.revclickOut=function(seconds){scope.end=scope.end-seconds;scope.endInput=new Date(parseInt(scope.end)*1e3).toISOString().substr(11,8)};scope.forwardclickOut=function(seconds){scope.end=scope.end+seconds;scope.endInput=new Date(parseInt(scope.end)*1e3).toISOString().substr(11,8)};scope.isDisabledCreate=function(){const duration=scope.end-scope.start;return duration>300};scope.clickIn=function(){scope.end=mediaElementPlayer.getDuration();scope.start=mediaElementPlayer.getCurrentTime();scope.startInput=new Date(parseInt(scope.start)*1e3).toISOString().substr(11,8);scope.clickedIn=true};scope.clickOut=function(){scope.end=mediaElementPlayer.getCurrentTime();scope.endInput=new Date(parseInt(scope.end)*1e3).toISOString().substr(11,8);scope.clickedOut=true;scope.touched=true};scope.playClip=function(){scope.playingclip=true;mediaElementPlayer.setCurrentTime(scope.start);mediaElementPlayer.play();scope.audio.play()};scope.toggleZoom=function(){if(!scope.zoom){scope.originalStart=scope.start;scope.originalEnd=scope.end;scope.startZoom=offset;scope.endZoom=scope.end-scope.start+offset}scope.zoom=!scope.zoom};scope.getDuration=function(){return scope.originalEnd-scope.originalStart+offset*2};scope.gotoLive=function(){mediaElementPlayer.setCurrentTime(mediaElementPlayer.getDuration());scope.touched=true};scope.$on("$destroy",function(){mediaElementPlayer.remove();var videos=document.getElementsByTagName("video");for(var i=0,total=videos.length;i<total;i++){videos[i].parentNode.removeChild(videos[i])}})},scope:{item:"=",showEditor:"=",clipsMarks:"=",trimProcessing:"=",onEmitCreateApi:"&",onEmitCreateMark:"&",onInit:"&"}}}]);"use strict";angular.module("scroll",[]).directive("whenScrolled",function($window,$document){return function(scope,elm,attr){var raw=elm[0];angular.element($window).bind("scroll",function(){var bodyHeight=$document[0].body.clientHeight;var body=angular.element(document).find("body")})}});App.directive("windowSize",function($window){return function(scope,element){var w=angular.element($window);scope.getWindowDimensions=function(){return{h:w.height(),w:w.width()}};scope.$watch(scope.getWindowDimensions,function(newValue,oldValue){scope.windowHeight=newValue.h;scope.windowWidth=newValue.w;scope.style=function(){return{height:newValue.h-100+"px",width:newValue.w-100+"px"}}},true);w.bind("resize",function(){scope.$apply()})}});App.directive("youtube",function($sce,$window){return{restrict:"EA",scope:{ytcode:"=",ytsrc:"=",ytwidth:"=",ytheight:"=",ytframeborder:"="},replace:true,template:'<iframe frameborder="{{ytframeborder}}" width="100%" height="{{ytheight}}" src="{{urlsrc}}" allowfullscreen></iframe>',link:function(scope,element){var paramOptions;scope.$watch("ytsrc",function(newVal){if(newVal){scope.urlsrc=$sce.trustAsResourceUrl(newVal)}});scope.$watch("code",function(newVal){if(newVal){scope.urlsrc=$sce.trustAsResourceUrl("http://www.youtube.com/embed/"+newVal)}});scope.onResizeFunction=function(){scope.__cWidth=element.width();scope.__cHeight=element.width()*9/16;element.css("height",scope.__cHeight)};scope.onResizeFunction();angular.element($window).bind("resize",function(){scope.onResizeFunction();scope.$apply()})}}});App.factory("CommonFactory",["$http","$timeout",function($http,$timeout){var factory={};factory.isMobile=function(){var check=false;
3(function(a){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4)))check=true})(navigator.userAgent||navigator.vendor||window.opera);return check};return factory}]);(function(module){var fileReader=function($q,$log){var onLoad=function(reader,deferred,scope){return function(){scope.$apply(function(){deferred.resolve(reader.result)})}};var onError=function(reader,deferred,scope){return function(){scope.$apply(function(){deferred.reject(reader.result)})}};var onProgress=function(reader,scope){return function(event){scope.$broadcast("fileProgress",{total:event.total,loaded:event.loaded})}};var getReader=function(deferred,scope){var reader=new FileReader;reader.onload=onLoad(reader,deferred,scope);reader.onerror=onError(reader,deferred,scope);reader.onprogress=onProgress(reader,scope);return reader};var readAsDataURL=function(file,scope){var deferred=$q.defer();var reader=getReader(deferred,scope);reader.readAsDataURL(file);return deferred.promise};return{readAsDataUrl:readAsDataURL}};module.factory("fileReader",["$q","$log",fileReader])})(angular.module("App"));(function(){var CONFIG,module,__hasProp={}.hasOwnProperty,__bind=function(fn,me){return function(){return fn.apply(me,arguments)}},__slice=[].slice,__extends=function(child,parent){for(var key in parent){if(__hasProp.call(parent,key))child[key]=parent[key]}function ctor(){this.constructor=child}ctor.prototype=parent.prototype;child.prototype=new ctor;child.__super__=parent.prototype;return child};App.factory("persist",function($q,$window){var persist,store;store=$window.localStorage;return persist={get:function(keys){var key,result,_i,_len;if(!angular.isArray(keys)){keys=[keys]}result={};for(_i=0,_len=keys.length;_i<_len;_i++){key=keys[_i];if(store.key(key)){result[key]=store.getItem(key)}else{result[key]=void 0}}return result},set:function(obj){var key,val;for(key in obj){if(!__hasProp.call(obj,key))continue;val=obj[key];store.setItem(key,val)}return true},remove:function(keys){var key,_i,_len;if(!angular.isArray(keys)){keys=[keys]}for(_i=0,_len=keys.length;_i<_len;_i++){key=keys[_i];localStorage.removeItem(key)}return true}}})}).call(this);App.factory("preloader",function($q,$rootScope){function Preloader(imageLocations){this.imageLocations=imageLocations;this.imageCount=this.imageLocations.length;this.loadCount=0;this.errorCount=0;this.states={PENDING:1,LOADING:2,RESOLVED:3,REJECTED:4};this.state=this.states.PENDING;this.deferred=$q.defer();this.promise=this.deferred.promise}Preloader.preloadImages=function(imageLocations){var preloader=new Preloader(imageLocations);return preloader.load()};Preloader.prototype={constructor:Preloader,isInitiated:function isInitiated(){return this.state!==this.states.PENDING},isRejected:function isRejected(){return this.state===this.states.REJECTED},isResolved:function isResolved(){return this.state===this.states.RESOLVED},load:function load(){if(this.isInitiated()){return this.promise}this.state=this.states.LOADING;
3for(var i=0;i<this.imageCount;i++){this.loadImageLocation(this.imageLocations[i])}return this.promise},handleImageError:function handleImageError(imageLocation){this.errorCount++;this.loadCount++;if(this.isRejected()){return}this.state=this.states.REJECTED;this.deferred.reject(imageLocation)},handleImageLoad:function handleImageLoad(imageLocation){this.loadCount++;if(this.isRejected()){return}this.deferred.notify({percent:Math.ceil(this.loadCount/this.imageCount*100),imageLocation:imageLocation});if(this.loadCount===this.imageCount){this.state=this.states.RESOLVED;this.deferred.resolve(this.imageLocations)}},loadImageLocation:function loadImageLocation(imageLocation){var preloader=this;var image=$(new Image).load(function(event){$rootScope.safeApply(function(){preloader.handleImageLoad(event.target.src);preloader=image=event=null})}).error(function(event){$rootScope.safeApply(function(){preloader.handleImageLoad(event.target.src);preloader=image=event=null})}).prop("src",imageLocation)}};return Preloader});"use strict";App.filter("amTimezoneGlobal",["amMoment","angularMomentConfig","$log",function(amMoment,angularMomentConfig,$log){function amTimezoneGlobal(value){var aMoment=amMoment.preprocessDate(moment.utc(value));if(angularMomentConfig.timezone){return aMoment.tz(angularMomentConfig.timezone)}else{return aMoment}}return amTimezoneGlobal}]);"use strict";App.filter("capitalizeFirstLetter",function(){return function(input){return!!input?input.charAt(0).toUpperCase():""}});App.filter("nospace",function(){return function(value){return!value?"":value.replace(/ /g,"")}});App.filter("httpSFilter",function(){return function(input){if(input){return input.replace("http://","https://")}}});App.filter("with",function(){return function(items,field){var result={};angular.forEach(items,function(value,key){if(!value.hasOwnProperty(field)){result[key]=value}});return result}});App.filter("millisecondsFormat",function($filter){return function(milliseconds){return $filter("date")(new Date(0,0,0).setMilliseconds(milliseconds),"mm:ss.sss")}});App.filter("email",function(){var validateEmail=function(email){var re=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return re.test(email)};return function(input){return validateEmail(input)}});"use strict";App.filter("encodeURIComponent",function(){return window.encodeURIComponent});App.filter("domain",function(){return function(input){var matches,output="",urls=/\w+:\/\/([\w|\.]+)/;matches=urls.exec(input);if(matches!==null){output=matches[1]}return output}});"use strict";App.filter("floor",function(){return function(input){return Math.floor(input)}});App.filter("getById",function(){return function(input,id){var i=0,len=input.length;for(;i<len;i++){if(+input[i].id==+id){return input[i]}}return null}}).filter("getByProperty",function(){return function(propertyName,propertyValue,collection){var i=0,len=collection.length;for(;i<len;i++){if(collection[i][propertyName]==+propertyValue){return collection[i]}}return null}});"use strict";App.filter("tel",function(){return function(phoneNumber){if(!phoneNumber)return phoneNumber;return formatLocal("US",phoneNumber)}});App.filter("selectedTags",function(){return function(results,tags){return results.filter(function(item){if(tags.length===0)return true;for(var i in item.tags){if(tags.indexOf(item.tags[i])!=-1){console.log("encontrado");return true}}return false})}});App.filter("currentSession",function(){return function(sessions){var type;var sessionsFilterArray=[];angular.forEach(sessions,function(session){type=session.type;console.log(type);if(type==="THIS_DEVICE"){sessionsFilterArray.push(session)}console.log(session)});return sessionsFilterArray}}).filter("allSession",[function(){return function(input,param){var ret=[];if(!angular.isDefined(param))param=true;angular.forEach(input,function(v){if(angular.isDefined(v.active)&&v.active===param){ret.push(v)}});return ret}}]);(function(){"use strict";App.filter("slugify",Filter);function Filter(){return function(input,normalize){if(!input)return;if(normalize){input=input.normalize("NFD").replace(/\p{Diacritic}/gu,"")}var slug=input.toLowerCase().trim();slug=slug.replace(/[^a-z0-9\s-]/g," ");slug=slug.replace(/[\s-]+/g,"-");return slug}}})();"use strict";
3App.filter("tag",function(){return function(items,allTags){if(typeof items!="undefined"&&allTags.length>0){var tagId="";var out=[];var multiTags=allTags.split(",");if(allTags.length>1){for(var i=0;i<items.length;i++){var addItem="";var exp=items[i].tags.split(",");for(var z=0;z<allTags.length;z++){tagId=allTags[z];for(var x=0;x<exp.length;x++){if(exp[x].indexOf(tagId)!=-1){addItem=true}}}if(addItem){out.push(items[i])}}}else{tagId=allTags[0];for(var i=0;i<items.length;i++){var exp=items[i].tags.split(",");for(var x=0;x<exp.length;x++){if(exp[x].indexOf(tagId)!=-1){out.push(items[i])}}}}return out}else{return items}}});"use strict";App.filter("truncate",function(){return function(text,length,end){if(isNaN(length))length=10;if(end===undefined)end="...";if(text.length<=length||text.length-end.length<=length){return text}else{return String(text).substring(0,length-end.length)+end}}});App.filter("trustAsHtml",["$sce",function($sce){return function(val){return $sce.trustAsHtml(val)}}]);App.filter("trustAsResourceUrl",["$sce",function($sce){return function(val){return $sce.trustAsResourceUrl(val)}}]);"use strict";App.filter("unique",function(){return function(items,filterOn){if(filterOn===false){return items}if((filterOn||angular.isUndefined(filterOn))&&angular.isArray(items)){var hashCheck={},newItems=[];var extractValueToCompare=function(item){if(angular.isObject(item)&&angular.isString(filterOn)){return item[filterOn]}else{return item}};angular.forEach(items,function(item){var valueToCheck,isDuplicate=false;for(var i=0;i<newItems.length;i++){if(angular.equals(extractValueToCompare(newItems[i]),extractValueToCompare(item))){isDuplicate=true;break}}if(!isDuplicate){newItems.push(item)}});items=newItems}return items}});"use strict";App.filter("uniqueField",function(){return function(arr,field){var o={},r=[];angular.forEach(arr,function(item){var itemField=item[field];if(field=="datetime"){itemField=moment.utc(item[field]).local().format("YYYY-MM-DD")}if(angular.isUndefined(o[itemField])){o[itemField]=item}});angular.forEach(o,function(item){r.push(item)});return r}});angular.module("ac.logger",[]).provider("Logger",[function(){var isEnabled=true;this.enabled=function(_isEnabled){isEnabled=!!_isEnabled};var that=this;this.$get=["$log","$location",function($log,$location){var Logger=function(context){this.context=context};Logger.getInstance=function(context){return new Logger(context)};Logger.supplant=function(str,o){return str.replace(/\{([^{}]*)\}/g,function(a,b){var r=o[b];return typeof r==="string"||typeof r==="number"?r:a})};Logger.getFormattedTimestamp=function(date){return Logger.supplant("{0}:{1}:{2}:{3}",[date.getHours(),date.getMinutes(),date.getSeconds(),date.getMilliseconds()])};Logger.prototype={_log:function(originalFn,args){var appdebug=$location.search().debugger;if(appdebug=="muevalogger"){that.enabled(true)}if(!isEnabled){return}var now=Logger.getFormattedTimestamp(new Date);var message="",supplantData=[];switch(args.length){case 1:message=Logger.supplant("{0} - {1}: {2}",[now,this.context,args[0]]);break;case 3:supplantData=args[2];message=Logger.supplant("{0} - {1}::{2}('{3}')",[now,this.context,args[0],args[1]]);break;case 2:if(typeof args[1]==="string"){message=Logger.supplant("{0} - {1}::{2}('{3}')",[now,this.context,args[0],args[1]])}else{supplantData=args[1];message=Logger.supplant("{0} - {1}: {2}",[now,this.context,args[0]])}break}$log[originalFn].call(null,Logger.supplant(message,supplantData))},log:function(){this._log("log",arguments)},info:function(){this._log("info",arguments)},warn:function(){this._log("warn",arguments)},debug:function(){this._log("debug",arguments)},error:function(){this._log("error",arguments)}};return Logger}]}]);(function(ng,app){"use strict";app.service("sessionService",SessionService);function SessionService($q,$resource,$window,$rootScope,system_language,COMMON,$base64,auth_api,$http,$cookies){function authenticateSocial(socialOptions){var deferred=$q.defer();var params={};if(!angular.isUndefined(socialOptions.socialToken)){params.socialToken=socialOptions.socialToken}else{params.signed_request=socialOptions.authResponse.signedRequest}if(!angular.isUndefined(socialOptions.userGroups)){params.userGroups=socialOptions.userGroups}$http({method:"POST",url:"/api/login-social",headers:{"Content-Type":"application/x-www-form-urlencoded"},transformRequest:function(obj){var str=[];for(var p in obj)str.push(encodeURIComponent(p)+"="+encodeURIComponent(obj[p]));return str.join("&")},data:params}).success(function(response){deferred.resolve(response)}).error(function(response){deferred.reject(response)});return deferred.promise}function restoreSocial(socialOptions){var deferred=$q.defer();var params={};$http({method:"POST",url:"/api/auth-social",headers:{"Content-Type":"application/x-www-form-urlencoded"},transformRequest:function(obj){var str=[];for(var p in obj)str.push(encodeURIComponent(p)+"="+encodeURIComponent(obj[p]));return str.join("&")},data:socialOptions}).success(function(response){deferred.resolve(response)}).error(function(response){deferred.reject(response)});return deferred.promise}function authenticate(){var deferred=$q.defer();resource.get({},function(response){if(response.success==true){ng.extend(user,response.payload.account);user.isAccountAuthenticated=response.success;deferred.resolve(response)}},function(){deferred.reject()});return deferred.promise}function login(loginOptions){var loginResource=$resource("/api/login",loginOptions,{getUser:{method:"GET"}});var deferred=$q.defer();loginResource.get({},function(response){if(response.success==true){ng.extend(user,response.payload.account);user.isAccountAuthenticated=response.success}deferred.resolve(response)},function(){deferred.reject()});return deferred.promise}function checkEmail(email){var checkEmailResource=$resource(COMMON.URL_API+"/api/auth/verify-email",{},{post:{method:"POST"}});var deferred=$q.defer();checkEmailResource.post(email,function(response){deferred.resolve(response)},function(response){deferred.reject(response)});return deferred.promise}function verifyEmailAuth0(email){var checkEmailResource=$resource(COMMON.URL_API+"/api/auth0/verify-email",{},{post:{method:"POST"}});var deferred=$q.defer();checkEmailResource.post({email:email},function(response){deferred.resolve(response)},function(response){deferred.reject(response)});return deferred.promise}function loginv2(loginOptions){if(loginOptions.isAuth0){var path="/api/auth0/login"}else{var path="/api/auth/login"}var loginv2Resource=$resource(COMMON.URL_API+path,{},{post:{method:"POST",format:"json"}});var deferred=$q.defer();loginv2Resource.post({locale:system_language.substr(0,2),email:loginOptions.email,password:loginOptions.password},function(response){if(response.success==true){ng.extend(user,response.payload.account);user.isAccountAuthenticated=response.success}deferred.resolve(response)},function(response){deferred.reject(response)});return deferred.promise}function forgot(forgotOptions){var forgotResource=$resource(COMMON.URL_API+"/api/auth/request_password_reset",{},{post:{method:"POST",format:"json"}});var deferred=$q.defer();forgotResource.post({locale:system_language.substr(0,2),email:forgotOptions.email},function(response){if(response.success==true){ng.extend(user,response.payload.account);user.isAccountAuthenticated=response.success}deferred.resolve(response)},function(response){deferred.reject(response)});return deferred.promise}function magicLoginRequest(options){var forgotResource=$resource(COMMON.URL_API+"/api/auth/request_magic_login",{},{post:{method:"POST",format:"json"}});var deferred=$q.defer();forgotResource.post({locale:system_language.substr(0,2),email:options.email,number:options.number,event:options.event},function(response){if(response.success==true){ng.extend(user,response.payload.account)}deferred.resolve(response)},function(response){deferred.reject(response)});return deferred.promise}function signup(payload){var signupResource=$resource(COMMON.URL_API+"/api/auth/signup",{},{post:{method:"POST",format:"json"}});var deferred=$q.defer();signupResource.post(payload,function(response){deferred.resolve(response)},function(response){deferred.reject(response)});return deferred.promise}function forgotConfirm(forgotOptions){if(forgotOptions.isAuth0){var path="/api/auth0/password_reset"}else{var path="/api/auth/password_reset"}var forgotConfirmResource=$resource(COMMON.URL_API+path,{},{post:{method:"POST",format:"json"}});var deferred=$q.defer();forgotConfirmResource.post({locale:system_language.substr(0,2),password:forgotOptions.password,token:forgotOptions.token},function(response){if(response.success==true){ng.extend(user,response.payload.account);user.isAccountAuthenticated=response.success}deferred.resolve(response)},function(response){deferred.reject(response)});return deferred.promise}function magicLogin(options){var forgotConfirmResource=$resource(COMMON.URL_API+"/api/auth/magic_login",{},{post:{method:"POST",format:"json"}});var deferred=$q.defer();forgotConfirmResource.post({locale:system_language.substr(0,2),otp:options.code,token:options.token},function(response){if(response.success==true){ng.extend(user,response.payload.account);user.isAccountAuthenticated=response.success}deferred.resolve(response)},function(response){deferred.reject(response)});return deferred.promise}function profile(loginOptions){var profileResource=$resource(COMMON.URL_API+"/api/user/profile",{},{get:{method:"GET",format:"json"}});var deferred=$q.defer();profileResource.get({locale:system_language.substr(0,2)},function(response){if(response.success==true){console.log("response",response);ng.extend(user,response.payload.account);user.isAccountAuthenticated=response.success}deferred.resolve(response)},function(response){deferred.reject(response)});return deferred.promise}function log(logParams){var logResource=$resource(COMMON.URL_API+"/api/log",{},{post:{method:"POST",format:"json"}});var deferred=$q.defer();logResource.post(logParams,function(response){deferred.resolve(response)},function(response){deferred.reject(response)});return deferred.promise}function logout(){var loginResource=$resource("/api/logout",{},{getUser:{method:"GET"}});var deferred=$q.defer();loginResource.get({},function(response){if(response.success==true){user.isAccountAuthenticated=false}deferred.resolve(response)},function(){deferred.reject()});return deferred.promise}function getDataKey(key){return"session__"+key}function isAuthenticated(){getUser();return user.isAccountAuthenticated}function set(key,value){var localKey=getDataKey(key);return data[localKey]=value}
3function update(){resource.get({},function(response){ng.extend(user,response.account);ng.extend(subscription,response.subscription);user.initials=userService.getInitials(user.name);user.hasSystemAvatar=userService.isSystemAvatar(user.avatarID)})}function get(key,defaultValue){var localKey=getDataKey(key);if(data.hasOwnProperty(localKey)){return data[localKey]}else if(!ng.isUndefined(defaultValue)){data[localKey]=defaultValue;return defaultValue}}function setUser(userData){user.name=userData.firstname;user.id=userData.id_user;user.email=userData.email;user.isAccountAuthenticated=true;user.groups=userData.userGroups;user.userParams=userData.userParams;user.galleries=userData.mediaGalleries;if(!angular.isUndefined(userData.extraData)){user.extraData=userData.extraData}var domainHostname=window.location.hostname.replace(/^[^.]+\./g,"");if(domainHostname=="cloudfront.net"||domainHostname=="fiaformulae.com"){domainHostname=window.location.hostname}var expiryDate=new Date;expiryDate.setMonth(expiryDate.getMonth()+1);var uDataEnc=$base64.encode(angular.toJson(user));document.cookie="uData="+uDataEnc+";expires="+expiryDate.toGMTString()+";path=/;Secure;SameSite=None;domain="+domainHostname;window.localStorage.setItem("uData",uDataEnc)}function getUser(){var userData=$cookies.get("uData");if(userData){try{user=angular.fromJson($base64.decode(userData))}catch(e){logout()}}else if(window.localStorage.getItem("uData")){userData=window.localStorage.getItem("uData");try{user=angular.fromJson($base64.decode(userData))}catch(e){logout()}}else if(!auth_api){return false}return user}function clearUser(){user={id:0,name:"",hasSystemAvatar:true,avatarImage:"",email:"",groups:[],isAccountAuthenticated:false};var domainHostname=window.location.hostname.replace(/^[^.]+\./g,"");if(domainHostname=="cloudfront.net"||domainHostname=="fiaformulae.com"){domainHostname=window.location.hostname}angular.forEach($cookies.getAll(),function(c,k){if(k=="uData"){$cookies.remove(k);document.cookie=k+"=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;domain="+domainHostname}});if(window.localStorage.getItem("uData")){window.localStorage.removeItem("uData")}}function tokenExists(){var token=$cookies.get("satellizer_token");if(token){return true}else{return false}}function setToken(token){var expiryDate=new Date;expiryDate.setMonth(expiryDate.getMonth()+1);var domainHostname=window.location.hostname.replace(/^[^.]+\./g,"");if(domainHostname=="cloudfront.net"||domainHostname=="fiaformulae.com"){domainHostname=window.location.hostname}document.cookie="satellizer_token="+token+";expires="+expiryDate.toGMTString()+";path=/;Secure;SameSite=None;domain="+domainHostname}function getToken(){var token=$cookies.get("satellizer_token");return token}function clearAuthentication(){var domainHostname=window.location.hostname.replace(/^[^.]+\./g,"");if(domainHostname=="cloudfront.net"||domainHostname=="fiaformulae.com"){domainHostname=window.location.hostname}angular.forEach($cookies.getAll(),function(c,k){if(k=="token"||k=="satellizer_token"||k=="qiuTimer"){$cookies.remove(k);var expiryDate=new Date;expiryDate.setMonth(expiryDate.getMonth()-1);document.cookie=k+"=;expires="+expiryDate.toGMTString()+";path=/;domain="+domainHostname}});clearUser()}var site_operative={};var modulecontent=[];var resource=$resource(COMMON.URL_API+"/api/login-check",{},{getUser:{method:"GET"}});var user={id:0,name:"",hasSystemAvatar:true,avatarImage:"",email:"",isAccountAuthenticated:false};var subscription={};var domains=[];var data={};return{authenticate:authenticate,authenticateSocial:authenticateSocial,restoreSocial:restoreSocial,signup:signup,login:login,loginv2:loginv2,verifyEmailAuth0:verifyEmailAuth0,checkEmail:checkEmail,forgot:forgot,forgotConfirm:forgotConfirm,magicLoginRequest:magicLoginRequest,magicLogin:magicLogin,profile:profile,log:log,logout:logout,get:get,isAuthenticated:isAuthenticated,set:set,update:update,setUser:setUser,getUser:getUser,clearUser:clearUser,clearAuthentication:clearAuthentication,tokenExists:tokenExists,setToken:setToken,getToken:getToken,subscription:subscription,user:user,site_operative:site_operative,modulecontent:modulecontent,domains:domains}}})(angular,App);"use strict";var servicesCommon=angular.module("services.Common",[]);servicesCommon.service("dateService",[function($q,$rootScope){this._getNow=function(){if(!Date.now){Date.now=function(){return+new Date}}else{return Date.now()}}}]);(function(ng,app){"use strict";app.service("hashParams",hashParams);function hashParams($location){function getHashParams(){var urlParam
3s={};var hashLoad=$location.hash();if(hashLoad){var hashParams=hashLoad.split("&");angular.forEach(hashParams,function(h){var h2=h.split("=");if(h2.length==2){urlParams[h2[0]]=h2[1]}else{urlParams[h2[0]]=true}})}return urlParams}function getHashParam(param){var params=getHashParams();if(!angular.isUndefined(params[param])){return params[param]}return false}function setHashParams(params){var hash="";angular.forEach(params,function(val,key){hash+=key+"="+val+"&"});if(hash.substr(-1,1)=="&"){hash=hash.substr(0,hash.length-1)}if(hash===""){history.replaceState(null,null,window.location.pathname+window.location.search)}else{$location.hash(hash)}}return{getHashParams:getHashParams,setHashParams:setHashParams,getHashParam:getHashParam}}})(angular,App);"use strict";angular.module("services.HttpService",[]).factory("HttpService",["$http",function($http){return{getDataUrl:function(url,params){return $http.get(url)},postDataUrl:function(url,params){return $http.post(url,params)}}}]);"use strict";angular.module("passStrengthService",[]).factory("passwordStrength",function($base64,COMMON){return{calculate:function(password,securityLevel){var strength=0,strength_modifiers=["uppercaseCharacters","lowercaseCharacters","numbers","symbols","requirements","dictionary"],i=0;if(securityLevel==2){strength_modifiers=["uppercaseCharacters","lowercaseCharacters","numbers","requirements","dictionary"]}else if(securityLevel==3){strength_modifiers=["uppercaseCharacters","lowercaseCharacters","requirements","dictionary"]}if(password===undefined){return undefined}password=password.replace(/\s+/g,"");if(password===""){return undefined}if(password.length<10){return 0}for(i=0;i!==strength_modifiers.length;i++){var pMod=this[strength_modifiers[i]](password);strength+=pMod}return this.bounds(strength)},characters:function(password){return password.length*4},uppercaseCharacters:function(password){var matches,count;if(COMMON.SECURITY_LEVEL<3){password=password.substring(1,password.length)}matches=password.match(/[A-Z]/g);count=matches===null?0:matches.length;if(count===0){return 0}return(password.length-count)*2},lowercaseCharacters:function(password){var matches,count;matches=password.match(/[a-z]/g);count=matches===null?0:matches.length;if(count===0){return 0}return(password.length-count)*2},numbers:function(password){var matches,count;matches=password.match(/[\d]/g);count=matches===null?0:matches.length;return count===password.length?0:count*2},symbols:function(password){var matches,count;matches=password.match(/[^\w]/g);count=matches===null?0:matches.length;return count*4},middleNumbersOrSymbols:function(password){var matches,count;password=password.substring(1,password.length-1);matches=password.match(/([^\w]|[\d])/g);count=matches===null?0:matches.length;return count*2},requirements:function(password){var requirements_matched=1,regex_array=[/[A-Z]/g,/[a-z]/g,/[0-9]/g,/[^\w]/g],i,pLength=10,minMatch=4,returnMultiply=2;if(COMMON.SECURITY_LEVEL>=2){pLength=6;minMatch=1;returnMultiply=3}if(password.length<pLength){return 0}if(/(.)\1\1/.test(password)){return 0}for(i=0;i<regex_array.length;i++){if(regex_array[i].test(password)){requirements_matched++}}return requirements_matched>=minMatch?requirements_matched*returnMultiply:0},lettersOnly:function(password){var regex=/^[A-Za-z]*$/,match=regex.test(password);return match?-password.length:0},numbersOnly:function(password){var regex=/^[0-9]*$/,match=regex.test(password);return match?-password.length:0},repeatCharacters:function(password){var password_characters=password.split(""),deduction=0,repeated_characters=0,unique_characters=0,character_exists=false,a,b;for(a=0;a<password_characters.length;a++){character_exists=false;for(b=0;b<password_characters.length;b++){if(password_characters[a]===password_characters[b]&&a!==b){character_exists=true;deduction+=Math.abs(password_characters.length/(b-a))}}if(character_exists){repeated_characters++;unique_characters=password_characters.length-repeated_characters;deduction=unique_characters?Math.ceil(deduction/unique_characters):Math.ceil(deduction)}}return-deduction},consecutiveUppercaseCharacters:function(password){var regex=/[A-Z]{2,}/g,count=this.consecutiveCount(password,regex);return-(count*2)},consecutiveLowercaseCharacters:function(password){var regex=/[a-z]{2,}/g,count=this.consecutiveCount(password,regex);return-(count*2)},consecutiveNumbers:function(password){var regex=/[0-9]{2,}/g,count=this.consecutiveCount(password,regex);return-(count*2)},consecutiveCount:function(password,regex){var matches,i,count=0;matches=password.match(regex);matches=matches===null?[]:matches;for(i=0;i<matches.length;i++){count+=matches[i].length-1}return count},sequentialCharacters:function(password){var characters="abcdefghijklmnopqrstuvwxyz"+"qwertzuiopasdfghjklyxcvbnm"+"qwertyuiopasdfghjklzxcvbnm"+"4bcd3f6h1jklmn0pqr57uvwxyz",count=this.sequentialCount(password,characters);return-(count*6)},sequentialNumbers:function(password){var characters="01234567890",count=this.sequentialCount(password,characters);return-(count*6)},sequentialSymbols:function(password){var characters=")!@#$%^&*()-+",count=this.sequentialCount(password,characters);return-(count*2)},sequentialCount:function(password,characters){var s,character_triplet,reverse_character_triplet,count=0;for(s=0;s<characters.length-2;s++){character_triplet=characters.substring(s,s+3);reverse_character_triplet=character_triplet.split("").reverse().join("");if(password.toLowerCase().indexOf(character_triplet)!==-1){count++}if(password.toLowerCase().indexOf(reverse_character_triplet)!==-1){count++}}return count},dictionary:function(password){var common_passwords_enc="cGFzc3dvcmQsMTIzNDU2LDEyMzQ1Njc4LDEyMzQscXdlcnR5LDEyMzQ1LGRyYWdvbixwdXNzeSxiYXNlYmFsbCxmb290YmFsbCxsZXRtZWluLG1vbmtleSw2OTY5NjksYWJjMTIzLG11c3RhbmcsbWljaGFlbCxzaGFkb3csbWFzdGVyLGplbm5pZmVyLDExMTExMSwyMDAwLGpvcmRhbixzdXBlcm1hbixoYXJsZXksMTIzNDU2NyxmdWNrbWUsaHVudGVyLGZ1Y2t5b3UsdHJ1c3RubzEscmFuZ2VyLGJ1c3Rlcix0aG9tYXMsdGlnZ2VyLHJvYmVydCxzb2NjZXIsZnVjayxiYXRtYW4sdGVzdCxwYXNzLGtpbGxlcixob2NrZXksZ2VvcmdlLGNoYXJsaWUsYW5kcmV3LG1pY2hlbGxlLGxvdmUsc3Vuc2hpbmUsamVzc2ljYSxhc3N
3ob2xlLDY5NjkscGVwcGVyLGRhbmllbCxhY2Nlc3MsMTIzNDU2Nzg5LDY1NDMyMSxqb3NodWEsbWFnZ2llLHN0YXJ3YXJzLHNpbHZlcix3aWxsaWFtLGRhbGxhcyx5YW5rZWVzLDEyMzEyMyxhc2hsZXksNjY2NjY2LGhlbGxvLGFtYW5kYSxvcmFuZ2UsYml0ZW1lLGZyZWVkb20sY29tcHV0ZXIsc2V4eSx0aHVuZGVyLG5pY29sZSxnaW5nZXIsaGVhdGhlcixoYW1tZXIsc3VtbWVyLGNvcnZldHRlLHRheWxvcixmdWNrZXIsYXVzdGluLDExMTEsbWVybGluLG1hdHRoZXcsMTIxMjEyLGdvbGZlcixjaGVlc2UscHJpbmNlc3MsbWFydGluLGNoZWxzZWEscGF0cmljayxyaWNoYXJkLGRpYW1vbmQseWVsbG93LGJpZ2RvZyxzZWNyZXQsYXNkZmdoLHNwYXJreSxjb3dib3ksY2FtY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LG5vcmZvbGssYnJlbnQxLGJvb3lhaCxib290bGVnLGJ1Y2thcm9vLGJ1bGxzMjMsYnVsbHMxLGJvb3BlcixoZXJldGljLGljZWN1YmUsaGVsbG5vLGhvdW5kcyxob25leWRldyxob290ZXJzMSxob2VzLGhvd2llLGhldm5tNCxodWdvaHVnbyxlaWdodHksZXBzb24sZXZhbmdlbGksZWVlZWUxLGV5cGhlZA==";var common_passwords=$base64.decode(common_passwords_enc);return common_passwords.indexOf(password)!==-1?-999:0},bounds:function(strength){if(strength<0){strength=0}if(strength>100){strength=100}return strength}}});(function(ng,app){"use strict";app.service("qiuAnalytics",qiuAnalytics);function qiuAnalytics($rootScope,$timeout,$interval,$base64,$window){var endpoint="";var intervalPing="";var token="";var wss="";var isFocused=true;function connect(){$window.onfocus=function(){isFocused=true;$rootScope.$apply()};$window.onblur=function(){isFocused=false;$rootScope.$apply()};wss=new WebSocket(endpoint);wss.onopen=(e=>{wss.send(angular.toJson({action:"authuser",userToken:token}));$timeout(function(){event({event:"load-in"});intervalPing=$interval(function(){wss.send(angular.toJson({action:isFocused?"ping":"pong"}))},3e4)},500)});wss.onerror=(e=>{console.log("err",e)})}function event(params){if(token&¶ms.event){params=angular.merge({action:"event",host:window.location.hostname,pathName:window.location.pathname,event:""},params);console.log("qa",params);wss.send(angular.toJson(params))}}function setEndpoint(encEndpoint){endpoint=$base64.decode(encEndpoint)}function setToken(userToken){token=userToken}return{connect:connect,event:event,setEndpoint:setEndpoint,setToken:setToken,endpoint:endpoint,token:token,wss:wss}}})(angular,App);"use strict";angular.module("qiu.constants",[]).constant("COMMON",{URL_API:"",DEFAULT_TIMEZONE:"Europe/Madrid",SECURITY_LEVEL:1,RECAPTCHA_PUBLIC:"6LfYbLkUAAAAABWgOpgAY4IURbpAllpAqQDVHFEn"});
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.