console.log("about to load the app");var app=angular.module("micApp",["ngRoute","ngSanitize","ui.bootstrap"]);console.log("got the app ready to go");app.service("passArticleData",function(){this.articleId=0;this.ebMonth=0;this.ebYear=0});app.config(["$routeProvider",function(n){console.log("in the ajs routing");n.caseInsensitiveMatch=!0;n.when("/",{templateUrl:"/home/home",resolve:{myUrl:["$route",function(n){return n.current.templateUrl}]}}).when("/join",{templateUrl:"/home/join"}).when("/market-expansion",{templateUrl:"/home/marketExpansion"}).when("/gov-relations",{templateUrl:"/home/govRelations"}).when("/statistics",{templateUrl:"/home/statistics"}).when("/events-aimexpo",{templateUrl:"/home/eventsAimexpo"}).when("/news-release",{templateUrl:"/home/newsRelease"}).when("/about-us",{templateUrl:"/home/aboutUs"}).when("/mission",{templateUrl:"/home/home"}).when("/history",{templateUrl:"/home/history"}).when("/commitees",{templateUrl:"/home/home"}).when("/board",{templateUrl:"/home/board"}).when("/executive",{templateUrl:"/home/executive"}).when("/mic-staff",{templateUrl:"/home/micStaff"}).when("/career",{templateUrl:"/home/career"}).when("/job1",{templateUrl:"/home/job1"}).when("/job2",{templateUrl:"/home/home"}).when("/job3",{templateUrl:"/home/job3"}).when("/job4",{templateUrl:"/home/job4"}).when("/job5",{templateUrl:"/home/job5"}).when("/job6",{templateUrl:"/home/job6"}).when("/job7",{templateUrl:"/home/job7"}).when("/mic-members",{templateUrl:"/home/micMembers"}).when("/benefits",{templateUrl:"/home/benefits"}).when("/motorcyleorg",{templateUrl:"/home/motorcyleorg"}).when("/faq",{templateUrl:"/home/faq"}).when("/dues",{templateUrl:"/home/dues"}).when("/why-join",{templateUrl:"/home/whyJoin"}).when("/Who-are",{templateUrl:"/home/WhoAre"}).when("/advancement",{templateUrl:"/home/advancement"}).when("/eligibility",{templateUrl:"/home/eligibility"}).when("/application",{templateUrl:"/home/application"}).when("/arra",{templateUrl:"/home/home"}).when("/technical",{templateUrl:"/home/technical"}).when("/actioncenter/:id?",{cache:!1,templateUrl:function(n){return n.id?"/home/ActionCenter?Id="+n.id:"/home/ActionCenter"}}).when("/events-symposium",{templateUrl:"/home/eventsSymposium"}).when("/events-fly-in",{templateUrl:"/home/eventsFlyIn"}).when("/executive-brief",{templateUrl:"/home/executiveBrief"}).when("/news-media-support",{templateUrl:"/home/newsMediaSupport"}).when("/RideReport/",{templateUrl:"/home/RideReportNews"}).when("/RideReport/:id",{cache:!1,templateUrl:function(n){return"/home/RideReportView?Id="+n.id}}).when("/resource-store",{templateUrl:"/home/resourceStore"}).when("/resources",{templateUrl:"/home/resources"}).when("/contact",{templateUrl:"/home/contact"}).when("/terms",{templateUrl:"/home/terms"}).when("/privacy",{templateUrl:"/home/privacy"}).when("/newsArticle",{templateUrl:"/home/newsLanding"}).when("/ebDetail",{templateUrl:"/home/ebDetail"}).when("/ebArticle",{templateUrl:"/home/ebLanding"}).when("/events-fly-in-details",{templateUrl:"/home/eventsFlyInDetail"}).when("/retailOutletDrawingRules",{templateUrl:"/home/retailOutletDrawingRules"}).when("/MIC_Buying_Selling_Used_Motorcycle_Guide-PDF",{templateUrl:"/home/MICBuyingSellingUsedMotorcyclePrintable"}).when("/MIC_Buying_Selling_Used_Motorcycle_Guide_Mobile-PDF",{templateUrl:"/home/MICBuyingSellingUsedMotorcycleMobile"}).when("/covid",{templateUrl:"/home/covid"}).when("/bToBResources",{templateUrl:"/home/bToBResources"}).when("/ridershipToolkit",{templateUrl:"/home/ridershipToolkit"}).when("/rideWithUs",{templateUrl:"/home/rideWithUs"}).when("/MCESDrawing",{templateUrl:"/home/MCESDrawing"}).when("/McRidingSurvey",{templateUrl:"/home/McRidingSurvey"}).when("/MCAMSurvey",{templateUrl:"/home/MCAMSurvey"}).when("/MICDealerSurvey",{templateUrl:"/home/MICDealerSurvey"}).when("/RideWithUsSurvey",{templateUrl:"/home/RideWithUsSurvey"}).when("/RideReportAdvertising",{templateUrl:"/home/RideReportAdvertising"}).when("/EconMap",{templateUrl:"/home/EconMap"}).when("/panelterms",{templateUrl:"/home/panelterms"})}]);console.log("got the routing ready to rip");app.run(["$rootScope","$location","$window",function(n,t,i){console.log("in the location run function");n.$watch(function(){return t.path()},function(n){console.log("url has changed: "+n);i.ga("send","pageview",{page:t.url()})})}]);app.controller("mainController",["$scope","$rootScope","$location",function(n,t,i){console.log("the main controller has loaded");t.modalOpen=!1;t.membershipTelephone="(949) 727-4211";n.date=new Date;n.$on("$routeChangeSuccess",function(){n.isHomepage=i.$$path==="/"?!0:!0})}]);app.controller("highlightController",["$scope","$http",function(n,t){console.log("we are ready to highlight");t.post("https://news.motoassoc.org/Home/highlightList",{headers:{"Content-Type":"application/json"}}).success(function(t){console.log("got the highlight list back");console.log(t);n.highlightArticles=t}).error(function(n){console.log("failed to get the highlight list");console.log(n)})}]);app.controller("featureController",["$scope","$http",function(n,t){console.log("we are ready to feature");t.post("https://news.motoassoc.org/Home/featureList",{headers:{"Content-Type":"application/json"}}).success(function(t){console.log("got the feature list back");console.log(t);n.featureArticles=t}).error(function(n){console.log("failed to get the feature list");console.log(n)})}]);app.controller("trendingController",["$scope","$http","passArticleData","$location",function(n,t,i,r){console.log("we're ready to trend!");var u={articleTypeId:201,privateArticle:0,count:6};console.log("criteria set, ready to get the list");console.log(u);t.post("https://news.motoassoc.org/Home/articleList",JSON.stringify(u),{headers:{"Content-Type":"application/json"}}).success(function(t){console.log("got the article list back");console.log(t);n.articleList=t}).error(function(){console.log("failed to get the article list")});n.selectArticle=function(n){i.articleId=n;r.url("/newsArticle")}}]);app.controller("newsReleaseController",["$scope","$http","passArticleData","$location",function(n,t,i,r){console.log("we're ready to pull news!");var u={articleTypeId:201,privateArticle:0,count:100};console.log("criteria set, ready to get the list");console.log(u);t.post("https://news.motoassoc.org/Home/articleList",JSON.stringify(u),{headers:{"Content-Type":"application/json"}}).success(function(t){console.log("got the article list back");console.log(t);n.articleList=t}).error(function(){console.log("failed to get the article list")});n.selectArticle=function(n){i.articleId=n.articleId;i.noHtmlTitle=n.title;r.url("/newsArticle")}}]);app.controller("ebTopController",["$scope","$http","passArticleData","$location",function(n,t,i,r){console.log("top level EB page loading!");n.selectArticle=function(n){i.articleId=n;r.url("/ebArticle")};n.ebDrilldown=function(n,t){i.ebMonth=n;i.ebYear=t;r.url("/ebDetail")};n.ebList=function(){t.post("/home/ebList",{headers:{"Content-Type":"application/json"}}).success(function(t){console.log("got the article list back");console.log(t);n.ebListArray=t}).error(function(){console.log("failed to get the article list")})};n.ebList()}]);app.controller("ebDetailController",["$scope","$http","passArticleData","$location",function(n,t,i,r){console.log("detail level EB page loading!");console.log("month:"+i.ebMonth);console.log("year:"+i.ebYear);(i.ebMonth===undefined||i.ebMonth===0)&&r.url("/executive-brief");(i.ebYear===undefined||i.ebYear===0)&&r.url("/executive-brief");var u={month:i.ebMonth,year:i.ebYear};console.log("criteria set, ready to get the list");console.log(u);t.post("https://news.motoassoc.org/Home/ebDetail",JSON.stringify(u),{headers:{"Content-Type":"application/json"}}).success(function(t){console.log("got the eb list back");console.log(t);n.articleList=t}).error(function(){console.log("failed to get the eb list")});n.selectArticle=function(n){console.log("show the articleId:"+n);i.articleId=n;r.url("/ebArticle")}}]);app.controller("advocacyController",["$scope","$http","passArticleData","$location",function(n,t,i,r){console.log("we're ready to pull advocacy articles!");var u={articleTypeId:102,privateArticle:0,count:7};console.log("criteria set, ready to get the list");console.log(u);t.post("https://news.motoassoc.org/Home/articleList",JSON.stringify(u),{headers:{"Content-Type":"application/json"}}).success(function(t){console.log("got the article list back");console.log(t);n.articleList=t}).error(function(){console.log("failed to get the article list")});n.selectEbArticle=function(n){i.articleId=n;r.url("/ebArticle")}}]);app.controller("newsLandingController",["$scope","$http","passArticleData","$location","$sce",function(n,t,i,r,u){var f,e;console.log("we're ready to pull a news article!");n.getQsValue=function(){var n=r.absUrl().substring(r.absUrl().indexOf("#")+1);return n.indexOf("?")>0?(n=n.substring(n.indexOf("?")+1),n.indexOf("articleId")>=0?(n=n.substring(n.indexOf("articleId")+10),n.indexOf("&")>0&&(n=parseInt(n.substring(0,n.indexOf("&"))))):n=0):n=0,n};(i.articleId===undefined||i.articleId===0)&&(f=n.getQsValue(),f>0?i.articleId=f:r.url("/news-release"));e={articleId:i.articleId};console.log("criteria");console.log(e);t.post("https://news.motoassoc.org/Home/newsArticleData",JSON.stringify(e),{headers:{"Content-Type":"application/json"}}).success(function(t){console.log("got the article data back");console.log(t);n.article=t;t.noHtmlTitle=t.noHtmlTitle===undefined?t.title:t.noHtmlTitle;console.log("article title:"+n.article.title);n.bodyText=u.trustAsHtml(n.article.body)}).error(function(){console.log("failed to get the article data")});n.back=function(){r.url("/news-release")}}]);app.controller("ridereportController",["$scope","$location",function(n,t){n.back=function(){t.url("/RideReport")}}]);app.controller("ebLandingController",["$scope","$http","passArticleData","$location",function(n,t,i,r){console.log("we're ready to pull an EB article!");console.log("articleId:"+i.articleId);(i.articleId===undefined||i.articleId===0)&&r.url("/executive-brief");var u={articleId:i.articleId};console.log("criteria");console.log(u);t.post("https://news.motoassoc.org/Home/newsArticleData",JSON.stringify(u),{headers:{"Content-Type":"application/json"}}).success(function(t){console.log("got the article data back");console.log(t);n.article=t;console.log("article title:"+n.article.Title)}).error(function(){console.log("failed to get the article data")})}]);app.controller("ridershipToolkitController",["$scope","$http","$rootScope","$location","$uibModal","$log","$document",function(n,t,i,r,u){function o(){t.post("/RidershipToolkit/GetToolkitTypes",JSON.stringify({"":""}),f).success(function(t){n.toolkitTypes=t}).error(function(){console.log("failed to get the Toolkit Types")})}function e(){i.modalInstance.close();i.modalOpen=!1;i.imageList=[];i.imageTitleList=[];i.previews=[]}var f={headers:{"Content-Type":"application/json"}};i.imageList=[];i.imageTitleList=[];o();n.previewImages=function(n,r){function s(){t.post("/RidershipToolkit/GetTypeImages",JSON.stringify(o),f).success(function(n){i.previews=n}).error(function(){console.log("failed to get the article data")})}var e=angular.element(document.getElementById("galleryModal")),o={typeId:n,categoryId:r};i.modalInstance=u.open({animation:!0,ariaLabelledBy:"modal-title",ariaDescribedBy:"modal-body",templateUrl:"galleryModal.html",backdrop:"static",controller:s(),appendTo:e});i.modalOpen=!0};i.toggleSelection=function(n){var r=n.IsSelected=!n.IsSelected,t;r?(i.imageList.push(n.ImageId),i.imageTitleList.push(n.AlternateText)):i.imageList.length&&(t=i.imageList.indexOf(n.ImageId),t>=0&&(i.imageList.splice(t,1),i.imageTitleList.splice(t,1)))};i.downloadZip=function(){console.log("@downloadZip",i.imageList);console.log("@imageTitleList",i.imageTitleList);var n={imageIds:i.imageList};i.imageList.forEach(function(n,t){dataLayer.push({event:"fileDownload",file:i.imageTitleList[t]+" ("+n+")"})});t.post("/RidershipToolkit/BundleSelectedImages",JSON.stringify(n),f).success(function(n){n&&(window.location.href=n,e())}).error(function(){console.log("failed to build zip")})};i.cancel=function(){e()}}])