!function(){"use strict";angular.module("indicators",[])}(),function(){"use strict";angular.module("indicators.template",[])}(),function(){"use strict";angular.module("underscore",[]).factory("underscore",["$window",function(t){return t._}])}(),function(){"use strict";angular.module("indicators.basket",[])}(),function(){"use strict";angular.module("indicators.chart",[])}(),function(){"use strict";angular.module("filters",[])}(),function(){"use strict";angular.module("indicators.map",[])}(),function(){"use strict";angular.module("indicators.search",[])}(),$(function(){"use strict";angular.module("indicators").factory("IndicatorFactory",["$http",function(t){function e(e){return void 0!==e?t.get("/api/indicators/visibility/"+e):t.get("/api/indicators")}function n(){return t.get("/api/indicators/geos")}function i(e,n,i){return t.get("/api/indicators/chart?geography="+e+"&concept="+n+"&adjustment="+(i||""))}return{fetchIndicators:e,fetchGeos:n,fetchChart:i}}])}()),$(function(){"use strict";angular.module("indicators.basket").factory("BasketFactory",["$http","$rootScope",function(t,e){function n(e){return t({method:"POST",url:"/store/cart_handler.ashx",headers:{"Content-Type":"application/x-www-form-urlencoded"},data:$.param({cmd:6,pid:"m_"+e})}).then(o)}function i(e){return t({method:"POST",url:"/store/cart_handler.ashx",headers:{"Content-Type":"application/x-www-form-urlencoded"},data:$.param({cmd:1,pid:"m_"+e})}).then(o)}function r(){return t.post("/account/cartcount")}function o(){return t.get("/api/basket").then(function(t){a.items=t.data.listItems,e.$broadcast("basket-retrieved")})}var a={addSeries:n,removeSeries:i,getItemCount:r,getItems:o,items:[{pid:"PPsI.IUSA"}]};return a}])}()),$(function(){"use strict";angular.module("indicators.basket").directive("basketItem",[function(){return{restrict:"E",scope:{mnemonic:"@",price:"@"},templateUrl:"basket/basketItem.html",controller:"BasketCtrl"}}])}()),$(function(){"use strict";angular.module("indicators.basket").directive("checkOut",[function(){return{restrict:"E",templateUrl:"basket/checkout.html",controller:"CheckoutCtrl"}}])}()),$(function(){"use strict";angular.module("indicators.search").directive("indicatorSearch",[function(){return{restrict:"E",templateUrl:"search/search.html",controller:"SearchCtrl"}}])}()),$(function(){"use strict";angular.module("filters").filter("hyphenate",[function(){return function(t){var e=/\s+/g;return t.replace(e,"-").trim()}}])}()),$(function(){"use strict";angular.module("filters").filter("pluck",["underscore",function(t){return function(e,n){return t.pluck(e,n)}}])}()),$(function(){"use strict";angular.module("filters").filter("splitTermsFilter",["$filter",function(t){return function(e,n,i,r){var o=/\./g;if(n=n||"",n=n.replace(o," "),void 0!==i&&n.length<i)return e;if(!n||0===n.length)return e;var a=n.split(" "),c=[];return a.forEach(function(n){if(n&&n.length)if(r){var i=t("filter")(e,n);e=i.length||!i.length&&!c.length?i:e,i.length&&c.push(n)}else e=t("filter")(e,n)}),e}}])}()),$(function(){"use strict";angular.module("filters").filter("startFrom",[function(){return function(t,e){return e=+e,e<0?input:t.slice(e)}}])}()),$(function(){"use strict";angular.module("filters").filter("unique",["$filter","underscore",function(t,e){return function(t,n,i){if(n===!1)return t;if((n||angular.isUndefined(n))&&angular.isArray(t)){var r=[],o=function(t){return angular.isObject(t)&&angular.isString(n)?t[n]:t};angular.forEach(t,function(t){for(var e=!1,n=0;n<r.length;n++)if(angular.equals(o(r[n]),o(t))){e=!0;break}e||r.push(t)}),t=r}return i&&(t=e.pluck(t,n)),t}}])}()),$(function(){"use strict";angular.module("filters").filter("visibility",["underscore",function(t){return function(e,n,i){return e=t.filter(e,function(t){var e=i?~t.concept.visibility:t.concept.visibility;return 0!=(e&n)})}}])}()),$(function(){"use strict";angular.module("indicators.basket").controller("BasketCtrl",["$scope","$filter","$rootScope","BasketFactory",function(t,e,n,i){function r(){t.price<a?t.listPrice=void 0:Number(t.price)===a?t.listPrice="Free<br/>":t.listPrice=t.price}function o(){var n=e("filter")(i.items,{pid:c}).length>0;n?t.button={styles:["btn-default"],text:"Remove From Cart",disabled:!1,action:l}:t.price<a?t.button={styles:["btn-danger"],text:"Not Available For Purchase",disabled:!0,action:function(){}}:t.button={styles:["btn-secondary","action-request","btn-buy"],text:"Add To Cart",disabled:!1,action:s}}var a=0,c=t.mnemonic,s=function(){i.addSeries(c).then(function(t){n.$broadcast("basket-modified")})},l=function(){i.removeSeries(c).then(function(t){n.$broadcast("basket-modified")})};t.$on("basket-retrieved",function(){o()}),i.getItems().then(function(){o(),r()})}])}()),$(function(){"use strict";angular.module("indicators.basket").controller("CheckoutCtrl",["$scope","BasketFactory",function(t,e){function n(){e.getItemCount().then(function(e){t.cartcount=e.data.count})}t.cartcount,t.$on("basket-modified",n),n()}])}()),$(function(){"use strict";angular.module("indicators.chart").controller("ChartCtrl",["IndicatorFactory","$window",function(t,e){var n=e.location.pathname.split("/");t.fetchChart(n[1],n[2],n[3]).then(function(t){var e=t.data;if(e.xAxisLabels.length>1){Highcharts.setOptions({lang:{thousandsSep:","}});Highcharts.chart("chart",{credits:{enabled:!1},chart:{zoomType:"xy"},title:{text:""},subtitle:{text:""},xAxis:[{categories:e.xAxisLabels,crosshair:!0}],yAxis:[{minRange:3,labels:{format:"{value:,.0f}",style:{color:e.firstYAxis.color}},title:{text:e.firstYAxis.title,style:{color:e.firstYAxis.color}}},{minRange:3,title:{text:e.secondYAxis.title,style:{color:e.secondYAxis.color}},labels:{format:"{value}%",style:{color:e.secondYAxis.color}},opposite:!0}],tooltip:{shared:!0},legend:{enabled:!1,layout:"vertical",align:"left",x:580,verticalAlign:"top",y:50,floating:!0,backgroundColor:Highcharts.theme&&Highcharts.theme.legendBackgroundColor||"#FFFFFF"},series:[{color:e.secondYAxis.color,name:e.secondYAxis.title,type:e.secondYAxis.type,data:e.secondYAxis.values,yAxis:1,tooltip:{valueSuffix:e.secondYAxis.Unit}},{negativeColor:"#be0f34",color:e.firstYAxis.color,connectNulls:!0,zoneAxis:"x",zones:e.zones,name:e.firstYAxis.unit,type:e.firstYAxis.type,data:e.firstYAxis.values,tooltip:{valueSuffix:""}}]})}})}])}()),$(function(){"use strict";angular.module("indicators.map").controller("WorldMapCtrl",["IndicatorFactory",function(t){t.fetchGeos().then(function(t){var e=t.data;$("#world").highcharts("Map",{title:{text:""},mapNavigation:{enabled:!0,buttonOptions:{verticalAlign:"bottom"}},chart:{backgroundColor:"#f2f2f2"},xAxis:{minPadding:.025},yAxis:{minPadding:.025},legend:{enabled:!1},tooltip:{borderWidth:0,shadow:!0,useHTML:!0,padding:10,headerFormat:void 0,pointFormat:'<span class="center sprite sprite-{point.flag}"></span><span>{point.title}</span>'},credits:{enabled:!1},series:[{color:"#B4B4B7",borderColor:"#999999",cursor:"pointer",data:e,mapData:Highcharts.maps["custom/world-highres"],joinBy:["iso-a3","geoCode"],dataLabels:{enabled:!0,formatter:function(){return this.point.name}},states:{hover:{color:"#0089C7"}},point:{events:{click:function(t){window.location="/"+t.point.url+"/indicators"}}}}]})})}])}()),$(function(){"use strict";angular.module("indicators.search").controller("SearchCtrl",["$scope","$filter","$window","underscore","IndicatorFactory",function(t,e,n,i,r){var o=[],a=[];t.indicators=[],t.geos=[],t.concepts=[];var c={NOWHERE:0,MENU:1,CONCEPT:2,GEOGRAPHY:4,INDICATOR:8,RELATED:16,CALENDAR:32};c.LOW=c.RELATED|c.INDICATOR,c.EVERYWHERE=~c.NOWHERE,t.range=function(t,e){var n,i;for(n=[],e||(e=t,t=0),i=t;i<e;i++)n.push(i);return n},r.fetchIndicators(c.EVERYWHERE).then(function(r){var s=i.chain(r.data).map(function(t){return i.omit(t,"free","chartTemplate")}).value();t.visibility=c,t.indicators=s,o=i.chain(s).pluck("geography").value(),a=i.chain(s).pluck("concept").filter(function(t){return 0!=(t.visibility&c.CONCEPT)}).value(),t.geos=e("unique")(o,"geoCode"),t.concepts=e("unique")(a,"mnemonic"),t.googleSearch=function(t,e){var i=13;void 0==e?n.location="/indicators/search?q="+t:e.keyCode===i&&(n.location="/indicators/search?q="+t)}})}])}()),function(){"use strict";angular.module("indicatorApp",["indicators","indicators.template","indicators.search","indicators.basket","indicators.chart","indicators.map","filters","ngSanitize","underscore"])}(),angular.module("indicators.template").run(["$templateCache",function(t){t.put("/basket/basketItem.html",'<a title="{{button.text}}" href="javascript:void(0)" ng-click="button.action()" class="pull-right btn" ng-disabled="button.disabled" ng-class="button.styles">\n    <span ng-switch="price <= 0">\n        <span ng-switch-when="true" ng-bind-html="listPrice"></span>\n        <span ng-switch-when="false">{{listPrice | currency : \'$\': 2}}<br></span>\n    </span>\n    {{button.text}}\n</a>\n'),t.put("/basket/checkout.html",'<a href="/store/checkout-cart.aspx" title="Check Out" ng-if="cartcount > 0" class="btn btn-default" style="color:black;margin-top:10px">\n\n    <span class="h5" ng-bind-html="cartcount">\n    </span> Item(s) <br class="hidden-xs">\n\n    <span class="hidden-xs">View Cart</span>\n</a>'),t.put("/search/search.html",'<div>\n    <div class="search row visible-xs visible-sm">\n        <div class="col-xs-1"></div>\n        <div class="col-xs-11">\n            <div class="row">\n                <div class="search-input-group">\n\n                    <input ng-model="searchTerm" type="search" class="form-control-search" placeholder="What are you looking for?" ng-keyup="googleSearch(searchTerm, $event)" id="searchBox">\n                    <div><a ng-click="googleSearch(searchTerm)" class="btn btn-secondary form-btn-search"></a></div>\n                </div>\n            </div>\n        </div>\n    </div>\n    <div id="search" class="search-hidden visible-lg visible-md">\n        <a href="#" class="search-link pull-right hidden-xs" style="font-size:48px; display:block;color:#1e1d1e;padding-right:30px">&times;</a>\n        <div class="search row">\n            <div class="col-md-3"></div>\n            <div class="col-md-6">\n                <div class="row">\n                    <div class="search-input-group">\n\n                        <input ng-model="searchTerm" type="search" class="form-control-search" placeholder="What are you looking for?" ng-keyup="googleSearch(searchTerm, $event)" id="searchBox">\n                        <div><a ng-click="googleSearch(searchTerm)" class="btn btn-secondary form-btn-search"></a></div>\n                    </div>\n                </div>\n\n                <div class="row">\n\n                    <!-- Countries per search Term-->\n                    <div class="col-md-12" ng-show="searchTerm && gView.length > 1">\n                        <div class="row">\n                            <div class="col-md-12 h4">Countries</div>\n                            <div id="onne" class="col-md-3 col-sm-4 col-xs-6" style="padding-bottom:5px" ng-repeat="geo in gView = (geos | splitTermsFilter:searchTerm) | orderBy : [\'rank\',\'title\'] track by geo.geoCode">\n                                <a title="{{geo.title}}" href="/{{geo.titleURL}}/indicators">\n                                    <i class="sprite sprite-{{geo.geoCode}}"></i>\n                                    {{geo.title}}\n                                </a>\n                            </div>\n                        </div>\n                    </div>\n                    <br>\n\n                    <!-- Indicators per search Term-->\n                    <div class="col-md-12" ng-show="searchTerm && cView.length > 1 ">\n                        <div class="row">\n                            <div class="col-md-12 h4">Indicators</div>\n                            <div class="col-md-3 col-xs-6" style="padding-bottom:5px" ng-repeat="con in cView =(concepts | splitTermsFilter:searchTerm) | orderBy : \'title\' track by con.mnemonic">\n                                <a title="{{con.title}}" href="/indicators/{{con.titleURL}}">{{con.title}}</a>\n                            </div>\n                        </div>\n                    </div>\n\n                    <!-- Indicators per  Geography per Search Term-->\n                    <div class="col-md-12" ng-if="searchTerm && !cView.length && !gView.length">\n                        <span ng-show="!iView.length" class="h4">&nbsp;</span>\n                        <div class="row" style="padding: 10px 0" ng-repeat="geo in iView = (indicators | splitTermsFilter:searchTerm:undefined:true) | pluck : \'geography\' | unique : \'geoCode\' | orderBy : [\'rank\',\'title\'] | limitTo : 20 track by geo.geoCode">\n                            <div class="col-md-3">\n                                <table>\n                                    <tr>\n                                        <th class="sprite sprite-{{geo.geoCode}}"></th>\n                                        <th class="h4">{{geo.title}}</th>\n                                    </tr>\n                                </table><br>\n                            </div>\n                            <div class="col-md-9">\n                                <div class="row" ng-repeat="con in iView | filter : geo.title | pluck : \'concept\' | unique : \'category\' ">\n\n                                    <h5>{{con.category| uppercase}}</h5>\n\n                                    <div class="col-sm-6" style="padding-bottom:5px" ng-repeat="ind in anyIndicators = ( iView | filter : geo.title | visibility: visibility.CONCEPT | filter : {concept: {category: con.category}} ) track by $index">\n                                        <a title="{{ind.geography.title}}: {{ind.concept.title}}" href="/{{ind.geography.titleURL}}/{{ind.concept.titleURL}}">\n                                            {{ind.concept.title}}\n                                        </a>\n                                    </div>\n                                    <!--<div class="col-sm-6" style="padding-bottom:5px;"\n                                           ng-repeat="cat in anyCategories= (iView | filter :{ geography: {title: geo.title}} | visibility: visibility.CONCEPT:true | filter : {concept: {category: con.category}} | pluck : \'concept\' | unique: \'subCategory\')  track by $index">\n                                        <a title="{{geo.title}}: {{cat.subCategory}}" href="/{{geo.titleURL}}/{{cat.category | hyphenate | lowercase}}/{{cat.subCategoryURL}}">\n                                            {{cat.subCategory}}\n                                        </a>\n                                    </div>-->\n                                </div>\n                            </div>\n                        </div>\n                    </div>\n\n                    <!-- Concepts for a particular geography per search term-->\n                    <div class="col-md-12" ng-if="searchTerm && (gView.length <=1)">\n                        <div ng-repeat="geo in gView | orderBy : \'rank\' | limitTo : 20">\n                            <table>\n                                <tr>\n                                    <th class="sprite sprite-{{geo.geoCode}}"></th>\n                                    <th class="h4"><a title="{{geo.title}} Indicators" href="/{{geo.titleURL}}/indicators">{{geo.title}}</a></th>\n                                </tr>\n                            </table><br>\n                            <div class="row" ng-repeat="con in xView = (indicators | splitTermsFilter:searchTerm:undefined:true | filter : geo.geoCode) | filter : geo.title | pluck : \'concept\' | unique : \'category\'">\n                                <div class="col-md-12">\n\n                                    <h5>{{con.category| uppercase}}</h5>\n\n                                </div>\n                                <div class="col-md-4" style="padding-bottom:5px" ng-repeat="ind in anyIndicators = (xView | visibility: visibility.CONCEPT | filter : {concept: {category: con.category}} | orderBy : \'concept.title\') track by $index">\n                                    <a title="{{ind.geography.title}}: {{ind.concept.title}}" href="/{{ind.geography.titleURL}}/{{ind.concept.titleURL}}">\n                                        {{ind.concept.title}}\n                                    </a>\n                                </div>\n                                <!--<div class="col-sm-4" style="padding-bottom:5px;"\n                                       ng-repeat="cat in anyCategories= (xView | visibility: visibility.CONCEPT: true | filter : {concept: {category: con.category}}  | pluck : \'concept\' | unique: \'subCategory\')  track by $index">\n                                    <a title="{{geo.title}}: {{cat.subCategory}}" href="/{{geo.titleURL}}/{{cat.category | hyphenate | lowercase}}/{{cat.subCategoryURL}}">\n                                        {{cat.subCategory}}\n                                    </a>\n                                </div>-->\n                            </div>\n                        </div>\n                    </div>\n\n                    <!-- Geographies for a particular concept per Search Term -->\n                    <div class="col-md-12" ng-if="searchTerm && (cView.length <=1)">\n                        <ul class="list-unstyled" ng-repeat="concept in cView">\n                            <li class="h4"><a title="{{concept.title}}" href="/indicators/{{concept.titleURL}}">{{concept.title}}</a></li>\n                            <li>\n                                <div class="row">\n                                    <div class="col-md-3 col-sm-4 col-xs-6" ng-repeat="ind in indicators | splitTermsFilter:searchTerm :undefined:true | filter: concept.mnemonic :true | visibility: visibility.CONCEPT  | orderBy : [\'geography.rank\',\'geography.title\'] track by ind.concept.mnemonic + ind.geography.geoCode ">\n                                        <a title="{{ind.geography.title}}: {{ind.concept.title}}" href="/{{ind.geography.titleURL}}/{{ind.concept.titleURL}}">\n                                            {{ind.geography.title}}\n                                        </a>\n                                    </div>\n                                </div>\n                            </li>\n                        </ul>\n                    </div>\n                </div>\n            </div>\n            <div class="col-md-3"></div>\n        </div>\n    </div>\n</div>')}]);
