var sogetiApp=angular.module("sogetiApp",["hmTouchEvents","ngAnimate","ngCookies","pasvaz.bindonce","underscore","angularMoment"]).config([function(){}]);sogetiApp.directive("cookieMessage",["sogetiCookieService","$timeout",function(n,t){return{restrict:"A",link:function(i,r){t(function(){n.get()||r.slideDown(50)})}}}]);sogetiApp.directive("cookieWarningCloseButton",["sogetiCookieService",function(n){return{restrict:"A",link:function(t,i){i.bind("click",function(){n.set(!0);i.slideUp(50)})}}}]);sogetiApp.directive("hoverIntent",["$timeout",function(n){return{restrict:"A",link:function(t,i,r){var u;u=void 0;i.bind("mouseenter",function(i){var f;f=t.$eval(r.hoverIntentDelay);f==="undefined"&&(f=500);u=n(function(){t.$eval(r.hoverIntent,{$event:i})},f)});i.bind("mouseleave",function(){n.cancel(u)})}}}]);sogetiApp.controller("menuCtrl",["$scope","$http",function(n,t){var i;i={};n.selected=[];n.mobileSelected=[];n.showMobileMenu=!1;n.getDesktopData=function(i,r){t.get("/api/desktop/"+i+"/"+r).success(function(t){n.menuData=t})};n.toggleMobileMenu=function(){n.showMobileMenu=!n.showMobileMenu};n.toggleVisibility=function(t,i,r){n.showThirdLevel=i;n.selected[t.Level]=n.isOn(t)?{}:t;r.stopPropagation()};n.toggleMobileVisibility=function(t,i){n.mobileSelected[t.Level]=n.isMobileOn(t)?{}:t;i.stopPropagation()};n.thirdVisibility=function(t,i){n.showThirdLevel=!0;n.selected[t.Level]=t;n.selectedChildren=t.Children;n.selectedSubmenu=t;i.stopPropagation()};n.isOn=function(t){return n.selected[t.Level]===t};n.isMobileOn=function(t){return n.mobileSelected[t.Level]===t}}]);sogetiApp.directive("resizable",["$window",function(n){return function(t){return t.initializeWindowSize=function(){t.windowHeight=n.innerHeight;t.windowWidth=n.innerWidth},t.initializeWindowSize(),angular.element(n).bind("resize",function(){t.initializeWindowSize();t.$apply()})}}]);sogetiApp.factory("sogetiCookieService",["$cookieStore",function(){var n="sogetiCookieWarning";return{set:function(t){localStorage.setItem(n,t)},get:function(){return localStorage.getItem(n)}}}]);sogetiApp.controller("tagCtrl",["$scope","$http","$filter","$location","_","amMoment",function(n,t,i,r,u,f){"use strict";var o,c=1024,l=function(){return r.search()},s=30,e,h;n.hideDate=!1;n.showCountry=!1;n.showContentType=!1;n.showServiceArea=!1;n.showSector=!1;n.filterObject={};n.showMenus={};n.showMobile=!1;n.language="";n.toggleDropDown=function(t){n.hideAll(t);n.showMenus[t]=!n.showMenus[t]};n.zeroFilter=function(t){n.filterObject[t]=undefined};n.toggleMobileDropDown=function(){n.showMobile=!n.showMobile};n.hideAll=function(t){for(var i in n.showMenus)n.showMenus.hasOwnProperty(i)&&i!==t&&(n.showMenus[i]=!1)};n.noFilters=function(){n.filterIt();n.hideAll()};n.getTagData=function(i,r,u,e){var s="/tag/taglist/"+i;f.changeLanguage(i);n.reverseOrder=e;u&&(s=s+"/"+u);t.get(s).success(function(t){o=t.Tags;n.numberOfTags=t.TagCount;n.availCountries=t.AvailCountries;n.availServiceAreas=t.AvailServiceAreas;n.availContentTypes=t.AvailContentTypes;n.availSectors=t.AvailSectors;n.countriesTitle=t.CountriesTitle;n.contentTypesTitle=t.ContentTypesTitle;n.serviceAreaTitle=t.ServiceAreaTitle;n.sectorsTitle=t.SectorsTitle;n.showAllTitle=t.ShowAllTitle;n.hideDate=t.HideDate;n.filterTitle=t.FilterTitle;n.filterIt(r,null,null,null)}).error(function(t,i){n.errorMessage="Fail! "+i;n.data=t})};n.filterIt=function(t,r,f,c){var l;n.reverseOrder===undefined&&(n.reverseOrder=!0);r&&(s=r);h=c?c:moment().add(100,"y");e=f?f:moment().add(-100,"y");l="";n.hideAll();t?angular.extend(n.filterObject,t):n.filterObject={};var a=function(n){var t=moment(n.Date),i=moment(e);return t.isAfter(i)||t.isSame(i)},v=i("filter")(o,n.filterObject),y=i("filter")(v,a),p=i("limitTo")(y,s);n.data=i("orderBy")(p,"Date",n.reverseOrder);n.showMobile=!1;t&&t.Countries&&(l=u.findWhere(n.availCountries,{Value:t.Countries}),l&&(n.currentCountryName=l.Key));t&&t.ContentTypes&&(l=u.findWhere(n.availContentTypes,{Value:t.ContentTypes}),l&&(n.currentContentTypeName=l.Key));t&&t.ServiceAreas&&(l=u.findWhere(n.availServiceAreas,{Value:t.ServiceAreas}),l&&(n.currentServiceAreaName=l.Key));t&&t.Sectors&&(l=u.findWhere(n.availSectors,{Value:t.Sectors}),l&&(n.currentSectorName=l.Key))};n.getFrontFilterMenu=function(){return $(window).width()>c?"/Static/templates/desktopFilterMenu.html":"/Static/templates/mobileFilterMenu.html"}}])