var Enums,__extends,RoadsReporting,Core;(function(n){var t;(function(n){n.EnvironmentEnum={Development:{id:0,name:"Development",description:"Development Build",group:"",hidden:!1},Test:{id:1,name:"Test",description:"Test Build",group:"",hidden:!1},PREPROD:{id:2,name:"PREPROD",description:"PreProd Build",group:"",hidden:!1},Production:{id:3,name:"Production",description:"Production Build",group:"",hidden:!1},LocalDev:{id:4,name:"LocalDev",description:"Local Development Build",group:"",hidden:!1},Unknown:{id:5,name:"Unknown",description:"Unknown Build",group:"",hidden:!1}}})(t=n.Environment||(n.Environment={}))})(Enums||(Enums={})),function(n){var t;(function(n){n.FeedbackMediaTypes={DIPLWebsite:{id:0,name:"DIPLWebsite",description:"DIPL Website",group:"",hidden:!1},Radio:{id:1,name:"Radio",description:"Radio",group:"",hidden:!1},Poster:{id:2,name:"Poster",description:"Poster",group:"",hidden:!1},WordOfMouth:{id:3,name:"WordOfMouth",description:"Word of Mouth",group:"",hidden:!1},Other:{id:4,name:"Other",description:"Other",group:"",hidden:!1}};n.FeedbackVehicleType={Domestic:{id:0,name:"Domestic",description:"Domestic Vehicle",group:"",hidden:!1},Heavy:{id:1,name:"Heavy",description:"Heavy Vehicle",group:"",hidden:!1}};n.FeedbackWebsiteUseTypes={Business:{id:0,name:"Business",description:"Business",group:"",hidden:!1},Recreation:{id:1,name:"Recreation",description:"Recreation",group:"",hidden:!1},Both:{id:2,name:"Both",description:"Business & Recreation",group:"",hidden:!1}}})(t=n.Feedback||(n.Feedback={}))}(Enums||(Enums={})),function(n){var t;(function(n){n.MapIconType={closed:{id:0,name:"closed",description:"",group:"",hidden:!1},surface:{id:1,name:"surface",description:"",group:"",hidden:!1},impassable:{id:2,name:"impassable",description:"",group:"",hidden:!1},traffic:{id:3,name:"traffic",description:"",group:"",hidden:!1},weight:{id:4,name:"weight",description:"",group:"",hidden:!1}}})(t=n.Map||(n.Map={}))}(Enums||(Enums={})),function(n){var t;(function(n){n.ObstructionDuration={T:{id:0,name:"T",description:"Temporary",group:"",hidden:!1},P:{id:1,name:"P",description:"Permanent",group:"",hidden:!1}};n.ObstructionStatusEnum={MIGRATIONS:{id:0,name:"MIGRATIONS",description:"Migrations",group:"",hidden:!1},CURRENT:{id:1,name:"CURRENT",description:"Current",group:"",hidden:!1},ADD_AWAITING_APPROVAL:{id:2,name:"ADD_AWAITING_APPROVAL",description:"Newly Added, Awaiting Approval",group:"",hidden:!1},UPDATE_AWAITING_APPROVAL:{id:3,name:"UPDATE_AWAITING_APPROVAL",description:"Updated, Awaiting Approval",group:"",hidden:!1},FINALISED:{id:4,name:"FINALISED",description:"Finalised",group:"",hidden:!1}}})(t=n.Obstruction||(n.Obstruction={}))}(Enums||(Enums={})),function(n){var t;(function(n){n.RimsActionType={U:{id:0,name:"U",description:"Update",group:"",hidden:!1},C:{id:1,name:"C",description:"Correct",group:"",hidden:!1}};n.RimsCodeTypeEnum={C_OBSTRUCTION:{id:0,name:"C_OBSTRUCTION",description:"",group:"",hidden:!1},C_RESTRICTION:{id:1,name:"C_RESTRICTION",description:"",group:"",hidden:!1}}})(t=n.Rims||(n.Rims={}))}(Enums||(Enums={})),function(n){var t;(function(n){n.TerminologyGroups={TypesOfRestrictions:{id:0,name:"TypesOfRestrictions",description:"Types of Restrictions",group:"",hidden:!1},DetailsOfRestrictions:{id:1,name:"DetailsOfRestrictions",description:"Details of Restrictions",group:"",hidden:!1},SurfaceCondition:{id:2,name:"SurfaceCondition",description:"Surface Condition",group:"",hidden:!1},RoadTypes:{id:3,name:"RoadTypes",description:"Road Types",group:"",hidden:!1}}})(t=n.Terminology||(n.Terminology={}))}(Enums||(Enums={})),function(){"use strict"}(Core||(Core={})),function(n){"use strict";var t=function(){function n(){var n=this;this.clone=function(t){return n.cloneObject(t)};this.cloneObject=function(t){var i,r;if(t===null||typeof t!="object")return t;if(t instanceof Date)return new Date(t.getTime());i=t.constructor();i==null&&(i=JSON.parse(JSON.stringify(t)));for(r in t)i[r]=n.cloneObject(t[r]);return i}}return n}();n.ObjectUtilities=t}(Core||(Core={})),function(n){"use strict";var i=function(){function n(n,i,r,u){var f=this;this.$http=n;this.objectUtilities=i;this.$location=r;this.notificationsService=u;this.deleteResource=function(n,t,i){t===void 0&&(t=!1);i===void 0&&(i=!1);f.notificationsService.suppressNext(!1);var r=t?f.genericPromiseErrorHandler:null;return f.$http({method:"POST",url:n,data:null,doNotBlock:i}).then(function(n){return n.data},r)};this.genericPromiseErrorHandler=function(n,i){var r=new t;switch(n.status){case 403:r.message=n.data||n.statusText;r.name="Forbidden";break;case 404:r.message=n.data||n.statusText;r.name="NotFound";break;case 409:r.message=n.data||n.statusText;r.name="AlreadyExists";break;case 422:r.message=n.data||n.statusText;r.name="Validation";break;case 423:r.message=n.data||n.statusText;r.name="Locked";r.data=n.data;break;case 417:r.message=n.data||n.statusText;r.name="";break;default:r.message=n.status+" "+(n.data||n.statusText);r.name="Unknown";i=i||"Remote operation failed: "}f.notificationsService.error(r.message);throw r;}}return n.prototype.getRawData=function(n,t,i){t===void 0&&(t=!1);i===void 0&&(i=!1);this.notificationsService.suppressNext(!1);n=n.indexOf("?")!=-1?n+"&unique="+(new Date).getTime():n+"?unique="+(new Date).getTime();var r=t?this.genericPromiseErrorHandler:null;return this.$http({method:"GET",url:n,doNotBlock:i}).then(function(n){return n.data},r)},n.prototype.postRawData=function(n,t,i,r){i===void 0&&(i=!1);r===void 0&&(r=!1);this.notificationsService.suppressNext(!1);var u=i?this.genericPromiseErrorHandler:null,f=this.objectUtilities.clone(t);return this.$http({method:"POST",url:n,data:f,doNotBlock:r}).then(function(n){return n.data},u)},n}(),t;n.ServiceBase=i;t=function(){function n(){}return n}();n.ServerError=t}(Core||(Core={})),function(n){var t=function(){function n(){}return n.ConfigureRoutes=function(n){this.SetupSharedRoutes(n);this.SetupHomeRoutes(n);this.SetupMapRoutes(n);this.SetupReportsRoutes(n);this.SetupInformationRoutes(n)},n.SetupHomeRoutes=function(t){t.state("home",{url:"/home",views:{"main-body@":{controller:RoadsReporting.Controllers.HomeController,templateUrl:n.path_home+"home.html"}},ncyBreadcrumb:{label:"Home"},data:{pageTitle:"Roads Reporting - Home"}})},n.SetupSharedRoutes=function(t){t.state("not-found",{url:"/not-found/{target}",views:{"main-body@":{controller:RoadsReporting.Controllers.ErrorController,templateUrl:n.path_shared+"error-not-found.html"}},ncyBreadcrumb:{label:"Page Not Found"},data:{pageTitle:"Roads Reporting - Page Not Found"}})},n.SetupMapRoutes=function(t){t.state("road-map",{url:"/road-map",views:{"main-body@":{controller:RoadsReporting.Controllers.RoadMapController,templateUrl:n.path_map+"road-map.html"}},params:{obstrId:null,region:null},ncyBreadcrumb:{label:"Road Map"},data:{pageTitle:"Roads Reporting - Road Map"}})},n.SetupReportsRoutes=function(t){t.state("road-reports",{url:"/road-reports",views:{"main-body":{controller:RoadsReporting.Controllers.RoadReportsController,templateUrl:n.path_reports+"road-reports.html"}},ncyBreadcrumb:{label:"Road Reports"},data:{pageTitle:"Roads Reporting - Road Reports"}});t.state("major-roads",{url:"/road-reports/:roadName",views:{"main-body":{controller:RoadsReporting.Controllers.RoadReportsController,templateUrl:n.path_reports+"road-reports.html"}},ncyBreadcrumb:{label:"Road Reports"},data:{pageTitle:"Roads Reporting - Road Reports"}})},n.SetupInformationRoutes=function(t){t.state("information",{url:"/information",views:{"main-body@":{controller:RoadsReporting.Controllers.InformationController,templateUrl:n.path_information+"information.html"}},ncyBreadcrumb:{label:"Information"},data:{pageTitle:"Roads Reporting - Information"}});t.state("information.terminology",{url:"/terminology",views:{"main-body@":{controller:RoadsReporting.Controllers.TerminologyController,templateUrl:n.path_information+"terminology.html"}},params:{selectedTerm:null},ncyBreadcrumb:{label:"Terminology"},data:{pageTitle:"Roads Reporting - Terminology"}});t.state("information.interstate",{url:"/interstate",views:{"main-body@":{controller:RoadsReporting.Controllers.InterstateController,templateUrl:n.path_information+"interstate.html"}},ncyBreadcrumb:{label:"Interstate Websites"},data:{pageTitle:"Roads Reporting - Interstate Websites"}});t.state("information.announcements",{url:"/announcements",views:{"main-body@":{controller:RoadsReporting.Controllers.AnnouncementsController,templateUrl:n.path_information+"announcements.html"}},params:{emergencyOnly:null},ncyBreadcrumb:{label:"Announcements"},data:{pageTitle:"Roads Reporting - Announcements"}});t.state("information.error-report",{url:"/report-an-issue",views:{"main-body@":{controller:RoadsReporting.Controllers.ErrorReportController,templateUrl:n.path_information+"error-report.html"}},ncyBreadcrumb:{label:"Report a Website Error"},data:{pageTitle:"Roads Reporting - Report a Website Error"}});t.state("information.parks",{url:"/national_parks",views:{"main-body@":{controller:RoadsReporting.Controllers.NationalParksController,templateUrl:n.path_information+"parks.html"}},ncyBreadcrumb:{label:"National Parks"},data:{pageTitle:"Roads Reporting - National Parks"}});t.state("information.terms-conditions",{url:"/terms-conditions",views:{"main-body@":{controller:RoadsReporting.Controllers.TermsConditionsController,templateUrl:n.path_information+"terms-conditions.html"}},ncyBreadcrumb:{label:"Terms and Conditions"},params:{target:null},data:{pageTitle:"Roads Reporting - Terms and Conditions"}})},n.path_base="Modules/RoadsReporting/",n.path_home=n.path_base+"Home/Templates/",n.path_map=n.path_base+"Road_Map/Templates/",n.path_reports=n.path_base+"Road_Reports/Templates/",n.path_information=n.path_base+"Information/Templates/",n.path_shared=n.path_base+"Shared/Templates/",n}();n.RouteConfiguration=t}(Core||(Core={})),function(n){var t=function(){function t(){}return t.ConfigureApp=function(n){var t=this;n.config(["$stateProvider","$urlRouterProvider","$locationProvider","blockUIConfig","$mdThemingProvider","$mdDateLocaleProvider",function(n,i,r,u,f,e){t.SetupMaterialTheme(f,e);t.SetupBlockUI(u);t.SetupRouting(i,n);r.html5Mode(!0)}])},t.ConfigureAppRun=function(n){n.run(["$rootScope","$location","$state","settings","navigationService",function(n,t,i,r,u){n.$on("$stateChangeStart",function(t,i){i.title&&(n.pageTitle=i.title)});n.$on("$stateChangeSuccess",function(n,t){u.currentState=u.getState(t.name)})}])},t.ConfigureAppAnalytics=function(n){var t=this;try{angular.module("angular-google-analytics");n.requires.push("angular-google-analytics");n.config(["AnalyticsProvider",function(n){t.SetupAnalytics(n)}]);n.run(["$rootScope","$location","Analytics","navigationService",function(n,t,i,r){n.$on("$stateChangeSuccess",function(n,u){r.currentState=r.getState(u.name);i.trackPage(t.path(),u.data.pageTitle)})}])}catch(i){console.error("Google Analytics is being blocked in your browser.")}},t.SetupMaterialTheme=function(n,t){n.definePalette("rrPalette",{"50":"edcac4","100":"e2a69d","200":"d68276","300":"ca5f4e","400":"b14535","500":"8e382a","600":"762e23","700":"62271d","800":"62271d","900":"3b1712",A100:"e07b6c",A200:"eee",A400:"d75642",A700:"e24d36",contrastDefaultColor:"light",contrastDarkColors:["50","100","200","300","400","A100"],contrastLightColors:undefined});n.theme("default").primaryPalette("rrPalette").accentPalette("rrPalette");t.parseDate=function(n){var t=moment(n);return t.isValid()?t.toDate():null};t.formatDate=function(n){var t=moment(n);return t.isValid()?t.format("DD/MM/YYYY"):""}},t.SetupBlockUI=function(n){n.template="<div class='block-ui-overlay'><\/div>";n.template+="<div class='block-ui-message-container' aria-atomic='true' aria-live='assertive'>";n.template+="<div class='block-ui-message ng-binding' ng-class='$_blockUiMessageClass'><span class='fa fa-refresh fa-spin fa-lg'><\/span> Please wait...<\/div>";n.template+="<\/div>";n.template+="<\/div>";n.requestFilter=function(n){return!n.doNotBlock}},t.SetupAnalytics=function(n){n.setAccount("UA-100718210-1");n.trackPages(!1);n.trackUrlParams(!1)},t.SetupRouting=function(t,i){t.otherwise(function(n,t){var r=n.get("$state"),i=t.path().toLowerCase(),u;i=="/"?r.go("home"):i!="/error"&&(u=i.substring(1),r.go("not-found",{target:u}))});n.RouteConfiguration.ConfigureRoutes(i)},t}();n.AppConfiguration=t}(Core||(Core={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(t){var r=function(t){function i(n,i){var r=this;t.call(this,n,i);this.on("mouseout",function(){r.removeArea()});this.on("remove",function(){r.removeArea()})}return __extends(i,t),i.prototype.removeArea=function(){this.focused||(this.path!=null&&this.endMarker!=null&&(this.path.remove(),this.endMarker.remove(),this.customPaths!=null&&this.customPaths.length>0&&this.customPaths.forEach(function(n){n.remove()})),this.visible=!1)},i.prototype.showArea=function(n){this.path!=null&&this.endMarker!=null&&(this.visible||this.focused)&&(n.addLayer(this.path),n.addLayer(this.endMarker),this.customPaths!=null&&this.customPaths.length>0&&this.customPaths.forEach(function(t){n.addLayer(t)}),this.visible=!0)},i.prototype.hideArea=function(n){this.path!=null&&this.endMarker!=null&&(n.removeLayer(this.path),n.removeLayer(this.endMarker),this.customPaths!=null&&this.customPaths.length>0&&this.customPaths.forEach(function(t){n.removeLayer(t)}),this.visible=!1)},i.prototype.updateArea=function(n,t,i,r){r===void 0&&(r=null);this.path!=null&&this.endMarker!=null&&(i.removeLayer(this.endMarker),i.removeLayer(this.path));this.endMarker=t;this.path=n;r!=null&&this.customPaths!=null&&this.customPaths.length>0&&this.customPaths.forEach(function(n){i.removeLayer(n)});(this.visible||this.focused)&&this.showArea(i)},i.prototype.displayCustomPaths=function(t){this.customPaths!=null&&this.customPaths.length>0&&this.customPaths.forEach(function(i){i.setStyle(n.Utilities.ObstructionConfiguration.pathStyling);t.addLayer(i)})},i.prototype.refresh=function(n){this.endMarker.remove();this.path.remove();n.addLayer(this.endMarker);n.addLayer(this.path)},i.prototype.clearArea=function(n){this.path!=null&&this.endMarker!=null&&(n.removeLayer(this.path),n.removeLayer(this.endMarker),this.customPaths!=null&&this.customPaths.length>0&&this.customPaths.forEach(function(t){n.removeLayer(t)}),this.visible=!1);this.path=null;this.endMarker=null;this.customPaths=[]},i}(L.Marker),i;t.DataMarker=r;i=function(n){function t(){n.apply(this,arguments)}return __extends(t,n),t.prototype.getParent=function(){return this.getParentFunction()},t}(L.Marker);t.EndMarker=i})(t=n.Classes||(n.Classes={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(n){var t=function(){function n(){this.center=null;this.zoom=0}return n}();n.MapViewLocation=t})(t=n.Classes||(n.Classes={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(n){var t=function(){function n(){}return n}();n.MarkerLayerCollection=t})(t=n.Classes||(n.Classes={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(n){var t=function(){function n(){}return n}();n.MarkerTypeObject=t})(t=n.Classes||(n.Classes={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(n){var t=function(){function n(){}return n}();n.ObstructionLocation=t})(t=n.Classes||(n.Classes={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(n){var t=function(){function n(){}return n}();n.ObstructionPath=t})(t=n.Classes||(n.Classes={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(n){var t=function(){function n(n,t){this.useDefaultErrorHandler=n;this.doNotBlock=t}return n}();n.ServiceOptions=t})(t=n.Classes||(n.Classes={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(n){var i=function(){function n(n){n!=null&&n.term!=null&&(this.searchTerm=n.term)}return n.prototype.showGroup=function(n){var i=this,t=!1;return n.items.forEach(function(n){i.showTerm(n)&&(t=!0)}),t},n.prototype.showTerm=function(n){if(n!=null&&this.searchTerm!=null&&n.term!=null&&this.searchTerm.trim()!=""){var t=n.term.toLowerCase(),i=this.searchTerm.toLowerCase();return t.indexOf(i)!=-1?(n.visible=!0,!0):(n.visible=!1,!1)}return n.visible=!0,!0},n}(),t;n.TerminologyFilter=i;t=function(){function n(n,t){this.value=n;this.visible=t}return n.prototype.toggleVisible=function(){this.visible=!this.visible},n}();n.TerminologyFilterItem=t})(t=n.Classes||(n.Classes={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(n){var t=function(){function n(n,t,i){t===void 0&&(t=[]);i===void 0&&(i=!0);this.groupName=n;this.items=t;this.visible=i}return n.prototype.toggleVisible=function(){this.visible=!this.visible},n.prototype.getFirstCharArray=function(){var n=[];return this.items.forEach(function(t){n.push(t.firstChar)}),n},n}();n.TerminologyGroup=t})(t=n.Classes||(n.Classes={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(n){var t=function(){function n(n,t,i,r,u,f){u===void 0&&(u=!0);f===void 0&&(f=null);this.termId=n;this.term=t;this.description=i;this.firstChar=t.charAt(0);this.termGroup=r;this.symbolUrl=f;this.visible=u}return n}();n.TerminologyTerm=t})(t=n.Classes||(n.Classes={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(n){var t=function(){function n(n,t,i,r){var u=this;this.$scope=n;this.modalHead=t;this.modalBody=i;this.$mdDialog=r;this.ok=function(){u.$mdDialog.hide(!0)};this.cancel=function(){u.$mdDialog.cancel()};n.vm=this}return n.$inject=["$scope","modalHead","modalBody","$mdDialog"],n}();n.ConfirmModalController=t})(t=n.Controllers||(n.Controllers={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(n){var t=function(){function n(n,t,i,r,u){var f=this;this.$scope=n;this.$state=t;this.$mdDialog=i;this.broadcasts=r;this.announcementDataService=u;this.viewBroadcasts=function(){f.$state.go("information.announcements");f.$mdDialog.cancel()};this.cancel=function(){f.$mdDialog.cancel()};n.vm=this}return n.$inject=["$scope","$state","$mdDialog","broadcasts","announcementDataService"],n}();n.EmergencyBroadcastModalController=t})(t=n.Controllers||(n.Controllers={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(n){var t=function(){function n(n,t){this.$scope=n;this.$state=t}return n.prototype.viewMap=function(){this.$state.go("road-map",{obstrId:null,region:null})},n.prototype.goTo=function(n){this.$state.go(n)},n.$inject=["$scope","$state"],n}();n.ErrorController=t})(t=n.Controllers||(n.Controllers={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(t){var i=function(){function t(n,t,i,r){var u=this;this.$scope=n;this.$timeout=t;this.vcRecaptcha=i;this.$mdDialog=r;this.maxTextLength=500;this.feedback={id:null,dateReceived:null,overallRating:3,locateRestrictionsRating:3,interpretRestrictionsRating:3,recommendRating:3,usedPreviousWebsite:null,heardOfWebsite:null,heardOfWebsiteOther:null,useOfWebsite:null,vehicleType:null,comment:null,recaptcha:null,signature:null};this.recaptchaLoaded=!1;this.recaptchaId=null;this.feedbackPoorGoodSliderOptions={showTicksValues:!0,showSelectionBar:!0,showOnlyLegend:!0,stepsArray:[{value:1,legend:"Poor"},{value:2,legend:""},{value:3,legend:"Average"},{value:4,legend:""},{value:5,legend:"Good"}]};this.feedbackLowHighSliderOptions={showTicksValues:!0,showSelectionBar:!0,showOnlyLegend:!0,stepsArray:[{value:1,legend:"Low"},{value:2,legend:""},{value:3,legend:"Average"},{value:4,legend:""},{value:5,legend:"High"}]};this.ok=function(){u.$scope.feedbackForm.$valid&&(u.$scope.feedbackForm.$setSubmitted(),u.$mdDialog.hide({feedback:u.feedback,recaptcha:u.recaptchaResponse}),u.vcRecaptcha.reload(u.recaptchaId))};this.cancel=function(){u.$mdDialog.cancel()};n.vm=this;this.setupDropdown();this.$timeout(function(){u.feedback.overallRating=3;u.feedback.interpretRestrictionsRating=3;u.feedback.locateRestrictionsRating=3;u.feedback.recommendRating=3;n.$broadcast("reCalcViewDimensions")})}return t.prototype.setupDropdown=function(){var r=n.Utilities.EnumUtilities.toDropDownList(Enums.Feedback.FeedbackMediaTypes),t,i;this.mediaTypeOptions={dataSource:r,valuePrimitive:!0,dataTextField:"name",dataValueField:"value"};t=n.Utilities.EnumUtilities.toDropDownList(Enums.Feedback.FeedbackWebsiteUseTypes);this.websiteUseOptions={dataSource:t,valuePrimitive:!0,dataTextField:"name",dataValueField:"value"};i=n.Utilities.EnumUtilities.toDropDownList(Enums.Feedback.FeedbackVehicleType);this.vehicleTypeOptions={dataSource:i,valuePrimitive:!0,dataTextField:"name",dataValueField:"value"}},t.prototype.getCharacterCount=function(n){return n!=null?n.length:0},t.prototype.updateRecaptcha=function(n){var t=this;this.recaptchaId=n;this.$timeout(function(){t.recaptchaLoaded=!0},600)},t.prototype.resetValue=function(n){n=null},t.$inject=["$scope","$timeout","vcRecaptchaService","$mdDialog"],t}();t.FeedbackModalController=i})(t=n.Controllers||(n.Controllers={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(t){var i=function(){function t(t,i,r){this.settings=t;this.mapService=i;this.notificationsService=r;this.leafletDefault=n.Utilities.LeafletConfiguration.leafletDefaultFactory();this.leafletCenter=n.Utilities.LeafletConfiguration.leafletCenterFactory();this.leaflet={height:"100%",width:"100%"};n.Utilities.ClusterUtils.clusterLayers=n.Utilities.ClusterUtils.getClusterLayers();n.Utilities.MarkerUtils.resetMarkerConfig()}return t.prototype.setupMap=function(){var t=this;return new Promise(function(i){t.mapService.getMap().then(function(r){n.Utilities.ClusterUtils.tearDownMap(t.mapService.leafletMap);t.setupMapDragInteraction(r);n.Utilities.LeafletConfiguration.currentTileLayer=n.Utilities.LeafletConfiguration.getTileLayer(t.settings.mapServerAddress,!0);n.Utilities.LeafletConfiguration.currentTileLayer.addTo(t.mapService.leafletMap);n.Utilities.LeafletConfiguration.currentTileLayer.on("tileerror",function(i){t.mapService.updateErrors({error:i.error.message,recorded:moment().toDate()});t.mapService.tileErrors.length>100&&(t.mapService.leafletMap.removeLayer(n.Utilities.LeafletConfiguration.currentTileLayer),n.Utilities.LeafletConfiguration.currentTileLayer=n.Utilities.LeafletConfiguration.getTileLayer(n.Utilities.LeafletConfiguration.osmMapServer,!1),n.Utilities.LeafletConfiguration.currentTileLayer.addTo(t.mapService.leafletMap))});i(r)},function(i){i.data!=null?t.notificationsService.error(i.data):t.notificationsService.error(n.Utilities.AppConfiguration.defaultError)})})},t.prototype.setupLayers=function(){this.mapService.leafletMap.addLayer(n.Utilities.ClusterUtils.clusterLayers.surfaceLayer);this.mapService.leafletMap.addLayer(n.Utilities.ClusterUtils.clusterLayers.impassableLayer);this.mapService.leafletMap.addLayer(n.Utilities.ClusterUtils.clusterLayers.trafficLayer);this.mapService.leafletMap.addLayer(n.Utilities.ClusterUtils.clusterLayers.weightLayer);this.mapService.leafletMap.addLayer(n.Utilities.ClusterUtils.clusterLayers.roadClosedLayer)},t.maxZoomLayer=[],t.clustered=!0,t}();t.MapOrientatedController=i})(t=n.Controllers||(n.Controllers={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(n){var i=function(){function n(n,t){var i=this;this.$window=n;this.selectivePrintService=t;this.restrict="E";this.scope={};this.TemplateStringsArray='<div class="print-section"><\/div>';this.link=function(n,t){n.elementsToPrint=i.selectivePrintService.elementsToPrint;n.$watch(function(){return n.elementsToPrint.length},function(r){r>0&&(n.elementsToPrint.forEach(function(n){var i=document.getElementById(n),r=i.cloneNode(!0);t.get(0).appendChild(r)}),i.$window.print(),t.get(0).innerHTML="",n.elementsToPrint.length=0)})}}return n.factory=function(){var t=function(t,i){return new n(t,i)};return t.$inject=["$window","selectivePrintService"],t},n}(),t;n.SelectivePrintDirective=i;t=function(){function n(){this.elementsToPrint=[]}return n.prototype.printElement=function(n){this.elementsToPrint.push(n)},n}();n.SelectivePrintService=t})(t=n.Directives||(n.Directives={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(t){var i=function(){function t(t){var i=this;this.defaultErrorMessageResolver=t;this.restrict="A";this.require="ngModel";this.scope={dateRangeValidatorStart:"=",kendoModel:"="};this.link=function(n,t,r,u){u!=null&&(u.$validators.dateRangeValidator=function(t){if(t==null||t=="")return!0;var r=i.dateUtils.validateDate(t);return r?(n.kendoModel=i.dateUtils.toDate(t),n.rangeStartDate!=null&&n.rangeStartDate!="")?(i.defaultErrorMessageResolver.getErrorMessages().then(function(n){n.dateRangeValidator="End date cannot be before the start date."}),i.dateUtils.validateDateEnd(n.rangeStartDate,t)):!0:(i.defaultErrorMessageResolver.getErrorMessages().then(function(n){n.dateRangeValidator="Please enter a valid date."}),!1)},n.$watch("dateRangeValidatorStart",function(t){n.rangeStartDate=t;u.$validate()}))};this.dateUtils=new n.Utilities.DateUtilities;t.getErrorMessages().then(function(n){n.dateRangeValidator="End date cannot be before the start date."})}return t.factory=function(){var n=function(n){return new t(n)};return n.$inject=["defaultErrorMessageResolver"],n},t}();t.DateRangeValidator=i})(t=n.Directives||(n.Directives={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(t){var i=function(){function t(t){var i=this;this.defaultErrorMessageResolver=t;this.restrict="A";this.require="ngModel";this.scope={allowNulls:"=",kendoModel:"="};this.link=function(n,t,r,u){u!=null&&(u.$validators.dateValidator=function(t){var r,u;return n.allowNulls&&(t==null||t=="")?!0:(r=i.dateUtils.validateDate(t),r&&(u=i.dateUtils.toDate(t),u!=null&&(n.kendoModel=u)),r)})};this.dateUtils=new n.Utilities.DateUtilities;t.getErrorMessages().then(function(n){n.dateValidator="Please enter a valid date."})}return t.factory=function(){var n=function(n){return new t(n)};return n.$inject=["defaultErrorMessageResolver"],n},t}();t.DateValidator=i})(t=n.Directives||(n.Directives={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(n){function t(){return function(n){return n==!0?"Yes":"No"}}n.BoolToYesNo=t})(t=n.Filters||(n.Filters={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(n){function t(){return function(n){return n==null?null:new Date(n)}}n.ParseDateFilter=t})(t=n.Filters||(n.Filters={}))}(RoadsReporting||(RoadsReporting={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t=function(n){function t(t,i,r,u){n.call(this,t,i,r,u);this.$http=t;this.objectUtilities=i;this.$location=r;this.notificationsService=u}return __extends(t,n),t.prototype.getEmergencyAnnouncements=function(){return this.getRawData("api/Announcement/GetEmergencyAnnouncements",!1,!0)},t.prototype.getAnnouncementsPaged=function(n){return this.postRawData("api/Announcement/GetAnnouncementsPaged",n,!1,!1)},t.$inject=["$http","objectUtilities","$location","notificationsService"],t}(Core.ServiceBase);n.AnnouncementDataService=t})(t=n.Services||(n.Services={}))}(RoadsReporting||(RoadsReporting={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t=function(n){function t(t,i,r,u){n.call(this,t,i,r,u);this.$http=t;this.objectUtilities=i;this.$location=r;this.notificationsService=u}return __extends(t,n),t.prototype.getAllCodeTable=function(){return this.getRawData("api/CodeTable/GetAllCodeTable")},t.prototype.getObstructionById=function(n){return this.getRawData("api/CodeTable/GetObstructionById/"+n)},t.prototype.getRestrictionById=function(n){return this.getRawData("api/CodeTable/GetRestrictionById/"+n)},t.$inject=["$http","objectUtilities","$location","notificationsService"],t}(Core.ServiceBase);n.CodeTableDataService=t})(t=n.Services||(n.Services={}))}(RoadsReporting||(RoadsReporting={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t=function(n){function t(t,i,r,u){n.call(this,t,i,r,u);this.$http=t;this.objectUtilities=i;this.$location=r;this.notificationsService=u;this.path="api/MapIcon/"}return __extends(t,n),t.prototype.getAll=function(){return this.getRawData(this.path+"GetAll",!1,!0)},t.prototype.update=function(n){return this.postRawData(this.path+"Update",n)},t.$inject=["$http","objectUtilities","$location","notificationsService"],t}(Core.ServiceBase);n.MapIconDataService=t})(t=n.Services||(n.Services={}))}(RoadsReporting||(RoadsReporting={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t=function(n){function t(t,i,r,u){n.call(this,t,i,r,u);this.$http=t;this.objectUtilities=i;this.$location=r;this.notificationsService=u}return __extends(t,n),t.prototype.getAllObstructions=function(){return this.getRawData("api/Obstruction/GetAllCurrentObstructions",!1,!1)},t.prototype.getAllCurrentObstructionsBySearch=function(n){return this.postRawData("api/Obstruction/GetAllCurrentObstructionsBySearch",n,!1,!1)},t.prototype.getAllObstructionsPaged=function(n){return this.postRawData("api/Obstruction/GetAllCurrentObstructionsPaged",n)},t.prototype.getOtherMajorRoadsObstruction=function(n){return this.postRawData("api/Obstruction/getMajorRoadsObstruction/",n)},t.$inject=["$http","objectUtilities","$location","notificationsService"],t}(Core.ServiceBase);n.ObstructionDataService=t})(t=n.Services||(n.Services={}))}(RoadsReporting||(RoadsReporting={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t=function(n){function t(t,i,r,u){n.call(this,t,i,r,u);this.$http=t;this.objectUtilities=i;this.$location=r;this.notificationsService=u}return __extends(t,n),t.prototype.getPathBetweenPoints=function(n,t){return this.postRawData("api/Road/GetPathBetweenPoints",n,!1,t.doNotBlock)},t.prototype.getRoadNameById=function(n){return this.getRawData("api/Road/GetRoadNameById/"+n.toString(),!1,!0)},t.prototype.searchNtRoads=function(n){return this.postRawData("api/Road/SearchNtRoads",n,!1,!0)},t.$inject=["$http","objectUtilities","$location","notificationsService"],t}(Core.ServiceBase);n.RoadDataService=t})(t=n.Services||(n.Services={}))}(RoadsReporting||(RoadsReporting={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t=function(n){function t(t,i,r,u){n.call(this,t,i,r,u);this.$http=t;this.objectUtilities=i;this.$location=r;this.notificationsService=u}return __extends(t,n),t.prototype.getAllRoadRegionNames=function(){return this.getRawData("api/RoadRegion/GetAllRoadRegionNames",!1,!0)},t.prototype.getAllRoadRegions=function(){return this.getRawData("api/RoadRegion/GetAllRoadRegions")},t.prototype.getRoadRegionByName=function(n){return this.getRawData("api/RoadRegion/GetRoadRegionByName/"+n)},t.$inject=["$http","objectUtilities","$location","notificationsService"],t}(Core.ServiceBase);n.RoadRegionDataService=t})(t=n.Services||(n.Services={}))}(RoadsReporting||(RoadsReporting={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t=function(n){function t(t,i,r,u){n.call(this,t,i,r,u);this.$http=t;this.objectUtilities=i;this.$location=r;this.notificationsService=u}return __extends(t,n),t.prototype.getAllTerminology=function(){return this.getRawData("api/Terminology/GetAllTerminology")},t.prototype.getAllTerminologyGrouped=function(){return this.getRawData("api/Terminology/GetAllTerminologyGrouped")},t.prototype.getTerminologyByTerm=function(n){return this.getRawData("api/Terminology/GetTerminologyByTerm/"+n)},t.$inject=["$http","objectUtilities","$location","notificationsService"],t}(Core.ServiceBase);n.TerminologyDataService=t})(t=n.Services||(n.Services={}))}(RoadsReporting||(RoadsReporting={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t=function(n){function t(t,i,r,u){n.call(this,t,i,r,u);this.$http=t;this.objectUtilities=i;this.$location=r;this.notificationsService=u}return __extends(t,n),t.prototype.AddFeedback=function(n){return this.postRawData("api/UserFeedback/AddFeedback/",n)},t.prototype.SendErrorReport=function(n){return this.postRawData("api/UserFeedback/AddErrorReport",n)},t.$inject=["$http","objectUtilities","$location","notificationsService"],t}(Core.ServiceBase);n.UserFeedbackDataService=t})(t=n.Services||(n.Services={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(n){var t=function(){function n(){}return n.prototype.addItem=function(n,t){var i=JSON.stringify(n);sessionStorage.setItem(t,i)},n.prototype.getItem=function(n){var t=sessionStorage.getItem(n);return t==null?null:JSON.parse(t)},n.prototype.removeItem=function(n){sessionStorage.removeItem(n)},n.prototype.clear=function(){sessionStorage.clear()},n}();n.BrowserStorageService=t})(t=n.Services||(n.Services={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(t){var i;(function(t){var i=function(){function t(n,t,i,r,u){this.$mdDialog=n;this.vcRecaptcha=t;this.notificationsService=i;this.userFeedbackDataService=r;this.$mdSidenav=u;this.modalOpen=!1;this.showFeedbackForm=!1;this.showFeedbackFormInit=!1;this.recaptchaLoaded=!1;this.recaptchaId=null;this.maxTextLength=500;this.feedback={id:null,dateReceived:null,overallRating:3,locateRestrictionsRating:3,interpretRestrictionsRating:3,recommendRating:3,usedPreviousWebsite:null,heardOfWebsite:null,heardOfWebsiteOther:null,useOfWebsite:null,vehicleType:null,comment:null,recaptcha:null,signature:null}}return t.prototype.toggleFeedbackForm=function(t){var i=this;this.modalOpen||(this.$mdSidenav("mainNav").close(),this.modalOpen=!0,this.$mdDialog.show({controller:n.Controllers.FeedbackModalController,templateUrl:Core.RouteConfiguration.path_shared+"feedback-modal.html",parent:angular.element(document.body),targetEvent:t,clickOutsideToClose:!0,fullscreen:!0}).then(function(n){n!=null&&(i.feedback=n.feedback,i.recaptchaResponse=n.recaptcha,i.sendFeedback());i.vcRecaptcha.reload(i.recaptchaId);i.modalOpen=!1},function(){i.modalOpen=!1}))},t.prototype.sendFeedback=function(){var n=this,t={recaptchaData:this.recaptchaResponse};this.feedback.recaptcha=t;this.feedback.heardOfWebsite!=Enums.Feedback.FeedbackMediaTypes.Other.name&&(this.feedback.heardOfWebsiteOther=null);this.userFeedbackDataService.AddFeedback(this.feedback).then(function(t){t.succeed?(n.notificationsService.success(t.message),n.feedback.overallRating=3,n.feedback.locateRestrictionsRating=3,n.feedback.interpretRestrictionsRating=3,n.feedback.recommendRating=3,n.feedback.usedPreviousWebsite=null,n.feedback.heardOfWebsite=null,n.feedback.heardOfWebsiteOther=null,n.feedback.useOfWebsite=null,n.feedback.vehicleType=null,n.feedback.comment=null,n.recaptchaResponse=null,n.showFeedbackForm=!1,n.vcRecaptcha.reload(n.recaptchaId)):(n.notificationsService.error(t.message),t.errors.length>0&&n.notificationsService.error(t.errors.join("; ")),n.vcRecaptcha.reload(n.recaptchaId))},function(t){n.notificationsService.error(t.data)})},t.$inject=["$mdDialog","vcRecaptchaService","notificationsService","userFeedbackDataService","$mdSidenav"],t}();t.FeedbackService=i})(i=t.Services||(t.Services={}))})(t=n.Shared||(n.Shared={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(t){var i;(function(t){var i=function(){function t(n,t){this.codetableDataService=n;this.notificationsService=t;this.restrictionTypes=[];this.obstructionTypes=[]}return t.prototype.getState=function(n){if(n.indexOf(".")!=-1){var t=n.split(".");return t[0]}return n},t.prototype.getCodes=function(){var n=this;if(this.restrictionTypes.length>0&&this.obstructionTypes.length>0)return[this.restrictionTypes,this.obstructionTypes];this.getCodeTableDescriptions().then(function(){return[n.restrictionTypes,n.obstructionTypes]},function(t){n.notificationsService.error(t)})},t.prototype.getCodeTableDescriptions=function(){var t=this;return new Promise(function(i,r){t.codetableDataService.getAllCodeTable().then(function(n){t.restrictionTypes.length=0;t.obstructionTypes.length=0;n.forEach(function(n){n.codeType.trim()==Enums.Rims.RimsCodeTypeEnum.C_RESTRICTION.name?t.restrictionTypes.push(n):n.codeType.trim()==Enums.Rims.RimsCodeTypeEnum.C_OBSTRUCTION.name&&t.obstructionTypes.push(n)});i(!0)},function(t){t.data!=null?r(t.data):r(n.Utilities.AppConfiguration.defaultError)})})},t.$inject=["codetableDataService","notificationsService"],t}();t.NavigationService=i})(i=t.Services||(t.Services={}))})(t=n.Shared||(n.Shared={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(n){var t=function(){function n(n,t,i,r){this.settings=n;this.$window=t;this.$timeout=i;this.$mdSidenav=r;this.scope=null;this.state=2;this.previousState=null;this.visible=!0;this.minimumSizeToShow=960;this.maximumSizeToShow=960;this.smallScreen=!1;this.sidebarFocused=!1}return n.prototype.setupSidebar=function(n,t,i){var r=this;t===void 0&&(t=null);i===void 0&&(i=null);this.scope=n;this.resetSidebarVariables();t!=null&&(this.minimumSizeToShow=t);i!=null&&(this.maximumSizeToShow=i);this.$window.innerWidth<this.minimumSizeToShow&&(this.visible=!1,this.smallScreen=!0);this.$window.onresize=function(){var n=r.$window.innerWidth;r.displaySidebarForWindow(n)}},n.prototype.registerPagingFunction=function(n){this.pagingFunction=n},n.prototype.callPagingFunction=function(){this.pagingFunction!=null&&this.pagingFunction()},n.prototype.resetSidebarVariables=function(){this.state=2;this.pagingFunction=null},n.prototype.setSidebarState=function(n){this.previousState=this.visible?this.state:-1;this.$mdSidenav(this.sidebarReference).open();this.state=n},n.prototype.toggleVisibility=function(){this.visible?this.$mdSidenav(this.sidebarReference).close():this.$mdSidenav(this.sidebarReference).open();this.sidebarFocused=!1},n.prototype.mobileCloseSidebar=function(){return this.smallScreen&&!this.sidebarFocused},n.prototype.setSidebarFocused=function(n){this.sidebarFocused=n;this.scope.$$phase||this.scope.$apply()},n.prototype.displaySidebarForWindow=function(n){this.smallScreen=n<this.minimumSizeToShow?!0:!1;this.scope.$$phase||this.scope.$apply()},n}();n.SidebarServiceBase=t})(t=n.Services||(n.Services={}))}(RoadsReporting||(RoadsReporting={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(t){var i=function(t){function i(i,r,u,f){t.call(this,i,r,u,f);this.settings=i;this.$window=r;this.$timeout=u;this.$mdSidenav=f;this.mapDataLoading=!1;this.mapSearchFilter={obstructionTypes:[],restrictionTypes:[]};this.filtering={pins:!1,search:!1};this.markerPins=n.Utilities.MarkerUtils.getAllMarkerPins();this.regionPolygons={};this.regionNames=[]}return __extends(i,t),i.$inject=["settings","$window","$timeout","$mdSidenav"],i}(t.SidebarServiceBase);t.SidebarServiceDefault=i})(t=n.Services||(n.Services={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(n){var t=function(){function n(n,t){this.$rootScope=n;this.settings=t;this.subscribers=[];this.signalrActions=["obstructionUpdated","obstructionAdded","obstructionDeleted","obstructionApproved","announcementAdded","announcementUpdated","announcementDeleted","termAdded","termUpdated","termDeleted"];this.connection=null;this.proxy=null;this.setupConnection()}return n.prototype.setupConnection=function(){this.connection=$.hubConnection();this.proxy=this.connection.createHubProxy("roadsReportingHub");this.registerListeners();this.connection.start()},n.prototype.registerListeners=function(){var n=this;this.signalrActions.forEach(function(t){n.proxy.on(t,function(i){n.subscribers.forEach(function(n){n.signalrAction==t&&n.callback(i)})})})},n.prototype.registerAutoTearDown=function(n,t,i){n.$on("$stateChangeStart",function(n,r,u,f){f.name==t&&i()})},n.prototype.subscribe=function(n,t,i){this.subscribers.push({name:n,signalrAction:t,callback:i})},n.prototype.unsubscribe=function(n){var t=-1;this.subscribers.some(function(i,r){if(i.name==n)return t=r,!0});t!=-1&&this.subscribers.splice(t,1)},n.prototype.getProxy=function(){return this.proxy},n.prototype.getConnection=function(){return this.connection},n.$inject=["$rootScope","settings"],n}();n.SignalrService=t})(t=n.Services||(n.Services={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(n){this.toastr=n;this._suppressNext=!1}return n.prototype.suppressNext=function(n){n===void 0&&(n=!0);this._suppressNext=n},n.prototype.success=function(n,t,i,r){r===void 0&&(r=!0);$(".toast").hide();this._suppressNext||(i!=null?this.toastr.success(n,t,{preventDuplicates:r,onclick:i}):this.toastr.success(n,t,{preventDuplicates:r}));this._suppressNext=!1},n.prototype.information=function(n,t,i,r){r===void 0&&(r=!0);$(".toast").hide();this._suppressNext||(i!=null?this.toastr.info(n,t,{preventDuplicates:r,onclick:i}):this.toastr.info(n,t,{preventDuplicates:r}));this._suppressNext=!1},n.prototype.error=function(n,t,i,r){r===void 0&&(r=!0);$(".toast").hide();this._suppressNext||(i!=null?this.toastr.error(n,t,{onclick:i,timeOut:15e3,allowHtml:!0,preventDuplicates:r}):this.toastr.error(n,t,{timeOut:15e3,allowHtml:!0,preventDuplicates:r}));this._suppressNext=!1},n.prototype.warning=function(n,t,i,r){r===void 0&&(r=!0);$(".toast").hide();this._suppressNext||(i!=null?this.toastr.warning(n,t,{preventDuplicates:r,onclick:i}):this.toastr.warning(n,t,{preventDuplicates:r}));this._suppressNext=!1},n.$inject=["toastr"],n}();n.Toastr=t})(t=n.Services||(n.Services={}))})(t=n.Shared||(n.Shared={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(n){var t=function(){function n(){}return n.getPageSizes=function(){return this.pageSizes},n.getDisclaimer=function(){return this.disclaimer},n.defaultError="Failed to retrieve data.",n.applicationColor="#B04534",n.majorRoads=["Barkly Highway","Stuart Highway","Victoria Highway","Other Major Roads"],n.disclaimer="The reporting on road conditions is intended as a guide only.                                    Road conditions may change rapidly, the Northern Territory of Australia gives no warranty or assurance of the accuracy of                                    this report and accepts no direct or indirect liability for reliance on the report.",n.pageSizes=[{value:5,label:"Page Size: 5"},{value:10,label:"Page Size: 10"},{value:15,label:"Page Size: 15"},{value:20,label:"Page Size: 20"},{value:50,label:"Page Size: 50"},{value:100,label:"Page Size: 100"},],n.regionLocations=[{name:"Top End",location:[-12.94336,131.95399],zoom:8},{name:"Katherine",location:[-16.07584,132.77719],zoom:8},{name:"Barkly",location:[-19.2823,135.06169],zoom:8},{name:"Central Australia",location:[-23.18006,132.95584],zoom:8}],n}();n.AppConfiguration=t})(t=n.Utilities||(n.Utilities={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(n){var t=function(){function t(){}return t.tearDownMap=function(t){var r=n.ClusterUtils.clusterLayers,u,i;if(r!=null)for(u in r)i=n.ClusterUtils.clusterLayers[u],i.clearLayers(),t.removeLayer(i)},t.newCluster=function(){var t=this;return L.markerClusterGroup({spiderfyOnMaxZoom:!0,showCoverageOnHover:!1,maxClusterRadius:200,iconCreateFunction:function(i){var r=i.getAllChildMarkers(),u=r[0],f=n.MarkerConfiguration.markerConfig[u.iconType].color,e=n.MarkerConfiguration.markerConfig[u.iconType].zIndex;return L.divIcon({className:"",html:t.clusterStyleFactory(f,e,r.length)})}})},t.getClusterLayers=function(){return{roadClosedLayer:n.ClusterUtils.newCluster(),surfaceLayer:n.ClusterUtils.newCluster(),impassableLayer:n.ClusterUtils.newCluster(),trafficLayer:n.ClusterUtils.newCluster(),weightLayer:n.ClusterUtils.newCluster()}},t.clusterStyleFactory=function(n,t,i){return'<div class="leaflet-cluster text-center" style="background-color: '+n+"; z-index: "+t+'"><div class="leaflet-cluster-text"><b>'+i+"<\/b><\/div><\/div>"},t.clusterLayers=null,t}();n.ClusterUtils=t})(t=n.Utilities||(n.Utilities={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(n){var t=function(){function n(){this.dateFormats=[{format:"D/M/YY",separator:"/"},{format:"D-M-YY",separator:"-"},{format:"DD/M/YY",separator:"/"},{format:"DD-M-YY",separator:"-"},{format:"D/MM/YY",separator:"/"},{format:"D-MM-YY",separator:"-"},{format:"DD/MM/YY",separator:"/"},{format:"DD-MM-YY",separator:"-"},{format:"DD/MM/YYYY",separator:"/"},{format:"DD-MM-YYYY",separator:"-"},{format:"DD/M/YYYY",separator:"/"},{format:"DD-M-YYYY",separator:"-"},{format:"D/MM/YYYY",separator:"/"},{format:"D-MM-YYYY",separator:"-"},{format:"D/M/YYYY",separator:"/"},{format:"D-M-YYYY",separator:"-"},{format:"DD/MM/YYYY HH:mm",separator:"/"},{format:"DD-MM-YYYY HH:mm",separator:"-"},{format:"MM/DD/YYYY HH:mm:ss",separator:"/"},{format:"MM-DD-YYYY HH:mm:ss",separator:"-"},{format:"YYYY/MM/DD HH:mm:ss",separator:"/"},{format:"YYYY-MM-DD HH:mm:ss",separator:"-"}]}return n.prototype.regulateDateFormat=function(n){var t=null;return n!=null&&(n instanceof Date?t=moment(n):typeof n=="string"&&(t=this.tryConvertDateString(n)),t!=null)?this.formatToServer(t):n},n.prototype.toDate=function(n){if(n!=null){if(n instanceof Date)return n;if(typeof n=="string"){var t=this.tryConvertDateString(n);if(t!=null)return t.toDate()}return null}},n.prototype.validateDate=function(n){if(n instanceof Date)return!0;if(typeof n=="string"){var t=this.tryConvertDateString(n);if(t!=null)return t.isValid()}return!1},n.prototype.validateDateEnd=function(n,t){var r=this.toDate(t),i=this.toDate(n);return i!=null&&(t==null||r>i)?!0:!1},n.prototype.formatToServer=function(n){return n.format("YYYY-MM-DD HH:mm:ss")},n.prototype.tryConvertDateString=function(n){var i=this,r=n.trim().length,t=null;return this.dateFormats.some(function(u){if(r==u.format.length&&i.checkDateParts(n,u.separator)){var f=moment(n,u.format);if(f.isValid())return t=f,!0}}),t},n.prototype.checkDateParts=function(n,t){var i=n.split(t);return i.length>2&&i[0].trim()!=""&&i[1].trim()!=""&&i[2].trim()!=""?!0:!1},n}();n.DateUtilities=t})(t=n.Utilities||(n.Utilities={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(n){var t=function(){function n(){}return n.getNames=function(n){var i=this.getObjValues(n),t=[];return i.forEach(function(n){t.push(n.name)}),t},n.getDescriptions=function(n){var i=this.getObjValues(n),t=[];return i.forEach(function(n){t.push(n.description)}),t},n.toDropDownList=function(n){var i=this.getObjValues(n),t=[];return i.forEach(function(n){t.push({name:n.description,value:n.name})}),t},n.getValues=function(t){var r=n.getObjValues(t),i=[];return r.forEach(function(t){var r=n.getObjValues(t).filter(function(n){return typeof n=="number"});i=i.concat(r)}),i},n.getObjValues=function(n){return Object.keys(n).map(function(t){return n[t]})},n}();n.EnumUtilities=t})(t=n.Utilities||(n.Utilities={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(n){var t=function(){function t(){}return t.convertGeomToPolygon=function(t){var r=new Wkt.Wkt,i;return r.read(t.geometry),i=r.toObject(),i.setStyle({color:n.AppConfiguration.applicationColor}),i.bindPopup(t.name,{closeButton:!1}),i},t.convertGeomToPoly=function(n){try{var i=new Wkt.Wkt,t=Terraformer.WKT.parse(n);return L.geoJSON(t,{pmIgnore:!1})}catch(r){return null}},t.toGeoJson=function(n){var t,i,r,u;return n instanceof L.Polygon?(t=n,t.toGeoJSON()):n instanceof L.Polyline?(i=n,i.toGeoJSON()):n instanceof L.Marker?(r=n,r.toGeoJSON()):n instanceof L.Circle?(u=n,u.toGeoJSON()):null},t}();n.GeometryUtilities=t})(t=n.Utilities||(n.Utilities={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(n){var t=function(){function t(){}return t.getTileLayer=function(n,t){return t?L.tileLayer.wms(n,{layers:"osm",format:"image/jpeg",crs:L.CRS.EPSG3857,detectRetina:!0}):L.tileLayer(n,{attribution:'&copy; <a href="http://osm.org/copyright">OpenStreetMap<\/a> contributors',detectRetina:!0})},t.getMaxBounds=function(){return L.latLngBounds([-89.981557606466168,-180],[89.993461795388754,180])},t.leafletDefaultFactory=function(){return{tileLayer:"",minZoom:4,zoomControl:!1}},t.leafletCenterFactory=function(){return{lat:-18.270159,lng:133.728986,zoom:6}},t.leafletDisclaimerFactory=function(){return L.controlCredits({image:"./Content/images/layers.png",link:"#/information/terms-conditions#disclaimer",text:n.AppConfiguration.getDisclaimer()})},t.osmMapServer="http://{s}.tile.osm.org/{z}/{x}/{y}.png",t}();n.LeafletConfiguration=t})(t=n.Utilities||(n.Utilities={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(n){var t=function(){function n(){}return n.imgPrefix="Content/images/markers/",n.defaultMarkerOptions={size:[30,52],anchor:[15,52]},n.focusedMarkerOptions={size:[35,61],anchor:[17,61]},n.newMarker={imgUrl:"marker-new.png"},n.markerConfig={closed:{icon:"Road Closed",color:"#272727",blockStyle:{"background-color":"#eaeaea","border-top":"1px solid #272727"},imgUrl:"marker-closed.png",symbolUrl:"symbol-closed.png",isVisible:!0,layer:"roadClosedLayer",type:Enums.Map.MapIconType.closed.name,zIndex:10,description:"Temporary closure of the road where passage of motor vehicles is not permitted. Barriers are in place and penalties shall be applied to drivers ignoring the road closure."},surface:{icon:"Road Surface Hazard",color:"#65408d",blockStyle:{"background-color":"#eefbed","border-top":"1px solid #9cca9c"},imgUrl:"marker-surface.png",symbolUrl:"symbol-surface.png",isVisible:!0,layer:"surfaceLayer",type:Enums.Map.MapIconType.surface.name,zIndex:0,description:"The condition of the road surface may change along the length of the road, and following road maintenance activities. Wet weather may also cause a localised change in road condition."},impassable:{icon:"Impassable",color:"#c70000",blockStyle:{"background-color":"#fff1ee","border-top":"1px solid #ca4d30"},imgUrl:"marker-impassable.png",symbolUrl:"symbol-impassable.png",isVisible:!0,layer:"impassableLayer",type:Enums.Map.MapIconType.impassable.name,zIndex:1,description:"Access along the section of road is affected by flooding or other obstructions. Road conditions are likely to change rapidly and may present an extreme hazard. Persons should not attempt to use/access the road."},traffic:{icon:"Changed Traffic Conditions",color:"#ff8204",blockStyle:{"background-color":"#ffe2e2","border-top":"1px solid #ea1818"},imgUrl:"marker-traffic.png",symbolUrl:"symbol-traffic.png",isVisible:!0,layer:"trafficLayer",type:Enums.Map.MapIconType.traffic.name,zIndex:0,description:"A temporary or permanent change to traffic conditions. For Example, a new posted speed limit, roundabout or duplication of the road carriageway."},weight:{icon:"Weight and or Vehicle Type Restriction",color:"#6f6f6f",blockStyle:{"background-color":"#fff3e4","border-top":"1px solid #e08f28"},imgUrl:"marker-weight.png",symbolUrl:"symbol-weight.png",isVisible:!0,layer:"weightLayer",type:Enums.Map.MapIconType.weight.name,zIndex:5,description:"A restriction placed on heavy vehicles to control axle group loads and/or vehicle size to protect the road during adverse conditions."}},n}();n.MarkerConfiguration=t})(t=n.Utilities||(n.Utilities={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(t){var i=function(){function i(){}return i.defaultIconFactory=function(n,i){return i===void 0&&(i=null),L.icon({iconUrl:t.MarkerUtils.getMarkerIcon(n,i),iconSize:t.MarkerConfiguration.defaultMarkerOptions.size,iconAnchor:t.MarkerConfiguration.defaultMarkerOptions.anchor})},i.focusedIconFactory=function(n,i){return i===void 0&&(i=null),L.icon({iconUrl:t.MarkerUtils.getMarkerIcon(n,i),iconSize:t.MarkerConfiguration.focusedMarkerOptions.size,iconAnchor:t.MarkerConfiguration.focusedMarkerOptions.anchor})},i.newIconFactory=function(){return L.icon({iconUrl:t.MarkerUtils.getNewMarkerIcon(),iconSize:t.MarkerConfiguration.focusedMarkerOptions.size,iconAnchor:t.MarkerConfiguration.focusedMarkerOptions.anchor})},i.endPathIconFactory=function(t){var i=new n.Classes.EndMarker(L.latLng(t.data.endPoint[0],t.data.endPoint[1]),{icon:L.divIcon({className:"",html:'<div class="leaflet-end-point"><\/div>'})});return i.getParent=function(){return t},i},i.dataMarkerFactory=function(i,r){var f=t.ObstructionUtils.getObstructionType(i,r),e=t.MarkerConfiguration.markerConfig[f].layer,o=t.MarkerConfiguration.markerConfig[f].symbolUrl,s=t.MarkerConfiguration.markerConfig[f].icon,h=t.MarkerConfiguration.markerConfig[f].zIndex,c={icon:this.defaultIconFactory(null,f)},u=new n.Classes.DataMarker(L.latLng(i.startPoint[0],i.startPoint[1]),c);return u.data=i,u.layerName=e,u.iconUrl=o,u.iconName=s,u.iconType=f,u.blockStyle=t.MarkerConfiguration.markerConfig[f].blockStyle,u.setZIndexOffset(h),i.geometries.length>0&&(u.customPaths=[],i.geometries.forEach(function(n){var i=t.GeometryUtilities.convertGeomToPoly(n);i!=null&&(i.setStyle(t.ObstructionConfiguration.pathStyling),u.customPaths.push(i))})),u},i.newDataMarkerFactory=function(t){var r={icon:this.newIconFactory()},i=new n.Classes.DataMarker(L.latLng(t.startPoint[0],t.startPoint[1]),r);return i.data=t,i},i}();t.MarkerFactories=i})(t=n.Utilities||(n.Utilities={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(t){var i=function(){function i(){}return i.getMarkerIcon=function(n,i){return i===void 0&&(i=null),i==null&&(i=n.iconType),t.MarkerConfiguration.imgPrefix+t.MarkerConfiguration.markerConfig[i].imgUrl},i.getNewMarkerIcon=function(){return t.MarkerConfiguration.imgPrefix+t.MarkerConfiguration.newMarker.imgUrl},i.getAllMarkerPins=function(){var n=[],i;for(i in t.MarkerConfiguration.markerConfig)n.push(t.MarkerConfiguration.markerConfig[i]);return n},i.getMarkerByRecordId=function(t,i,r){var u=null,f;for(f in i)if(i[f].eachLayer(function(t){if(t instanceof n.Classes.DataMarker)t.data.recordId==r&&(u=t);else if(t instanceof L.MarkerCluster){var i=t.getAllChildMarkers();i.forEach(function(n){n.data.recordId==r&&(u=t)})}}),u!=null)break;return u},i.getVisibleMarkers=function(i,r,u,f){var o=this,e,s;f===void 0&&(f=!1);e=[];u!=null&&(f||this.mapContainsMarker(i,u))&&(u.toolTip=t.ObstructionUtils.getObstructionTooltip(u.data),e.push(u));for(s in r)r[s].eachLayer(function(r){if(r instanceof n.Classes.DataMarker)(f||o.mapContainsMarker(i,r))&&r.iconUrl!=null&&o.isVisible(r.iconType)&&(r.toolTip=t.ObstructionUtils.getObstructionTooltip(r.data),e.push(r));else if(r instanceof L.MarkerCluster){var u=r.getAllChildMarkers();u.forEach(function(n){if(f||o.mapContainsMarker(i,n)){var r=n;r.iconUrl!=null&&o.isVisible(r.iconType)&&(r.toolTip=t.ObstructionUtils.getObstructionTooltip(r.data),e.push(r))}})}});return e=t.ObstructionUtils.sortObstructionFeatureList(e)},i.getMarkerById=function(t,i){var r=null,u;for(u in t)t[u].eachLayer(function(t){if(t instanceof n.Classes.DataMarker){if(t.data.recordId==i)return r=t}else if(t instanceof L.MarkerCluster){var u=t.getAllChildMarkers();u.forEach(function(n){var t=n;if(t.data.recordId==i)return r=t})}});return r},i.resetMarkerConfig=function(){for(var n in t.MarkerConfiguration.markerConfig)t.MarkerConfiguration.markerConfig[n].isVisible=!0},i.addDataMarkerToMap=function(n,t){t.addLayer(n)},i.removeDataMarkerFromMap=function(n,t){t.removeLayer(n)},i.updateMarkerRoad=function(n,t){n.data.road=t.road;n.data.roadName=t.roadName},i.updateMarkerStartPosition=function(n,t){this.updateMarkerRoad(n,t);n.data.prpFrom=t.prp;n.data.distanceFrom=t.distance;n.data.startPoint=[t.lat,t.lng]},i.updateMarkerEndPosition=function(n,t){this.updateMarkerRoad(n,t);n.data.prpTo=t.prp;n.data.distanceTo=t.distance;n.data.endPoint=[t.lat,t.lng]},i.moveMarkerToPosition=function(n,t){n.setLatLng(t)},i.declusterMarkers=function(n,i){var r,f,u;for(r in t.ClusterUtils.clusterLayers)f=t.ClusterUtils.clusterLayers[r].getLayers(),u=L.layerGroup(f),n.push(u),i.removeLayer(t.ClusterUtils.clusterLayers[r]),u.addTo(i);return n},i.reclusterMarkers=function(n,i){var r=0,u;for(u in t.ClusterUtils.clusterLayers)i.removeLayer(n[r]),i.addLayer(t.ClusterUtils.clusterLayers[u]),r++;return n.length=0,n},i.mapContainsMarker=function(n,t){return n.getBounds().contains(t.getLatLng())},i.isVisible=function(n){return t.MarkerConfiguration.markerConfig[n].isVisible},i}();t.MarkerUtils=i})(t=n.Utilities||(n.Utilities={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(n){var t=function(){function t(){}return t.getTypeGroups=function(){return[{groupName:"closed",group:this.closedGroup},{groupName:"surface",group:this.surfaceGroup},{groupName:"impassable",group:this.impassableGroup},{groupName:"traffic",group:this.trafficGroup},{groupName:"weight",group:this.vehicleGroup},]},t.getTypeGroupsObject=function(){return{closed:this.closedGroup,surface:this.surfaceGroup,impassable:this.impassableGroup,traffic:this.trafficGroup,vehicle:this.vehicleGroup}},t.getHardType=function(t){var i="surface",r=n.ObstructionConfiguration.getTypeGroups();return r.forEach(function(n){n.group.indexOf(t)!=-1&&(i=n.groupName)}),i},t.closedGroup=["road closed"],t.surfaceGroup=["4wd only","high clearance only","high clearance 4wd only","with caution","smoke harzard","smoke hazard","fire hazard"],t.impassableGroup=["impassable"],t.trafficGroup=["detour","lane closure"],t.vehicleGroup=["weight and or vehicle type restriction"],t.pathStyling={color:"#222",weight:2,opacity:.8,smoothFactor:1},t}();n.ObstructionConfiguration=t})(t=n.Utilities||(n.Utilities={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(n){var t=function(){function t(){}return t.defaultPathFactory=function(t){var i=angular.copy(n.ObstructionConfiguration.pathStyling);return i.pmIgnore=!0,L.polyline(t,i)},t.obstructionPathRequestFactory=function(n){return{roadId:n.road,prpFrom:n.prpFrom,distanceFrom:n.distanceFrom,prpTo:n.prpTo,distanceTo:n.distanceTo,lane:n.lane}},t.getObstructionType=function(t,i){var o=this,h=t.obstructionType.toLowerCase(),s=t.restrictionType.toLowerCase(),u=null,r=null,f=null,e;return(i.forEach(function(t){var i;t.mappedObstructionTypes.length>0&&(i=o.checkMappedTypes(h,t.mappedObstructionTypes,t),i!=null&&(f=i));t.mappedRestrictionTypes.length>0&&(i=o.checkMappedTypes(s,t.mappedRestrictionTypes,t),i!=null&&(r=i));t.default&&(u=t.iconRef);n.MarkerConfiguration.markerConfig[t.iconRef].icon=t.name;n.MarkerConfiguration.markerConfig[t.iconRef].zIndex=t.priority;n.MarkerConfiguration.markerConfig[t.iconRef].description=t.description}),r==Enums.Map.MapIconType.closed.name)?r:f!=null?f:r!=null?r:u!=null?u:(e=n.ObstructionConfiguration.getHardType(s),e!=null?e:Enums.Map.MapIconType.surface.name)},t.checkMappedTypes=function(n,t,i){var r=null;return t.some(function(t){if(t.description.toLowerCase().trim()==n)return r=i.iconRef,!0}),r},t.getRestrictionType=function(t){return n.MarkerConfiguration.markerConfig[t].icon},t.getObstructionTooltip=function(n){var t=n.restrictionType.toLowerCase();return t=="road closed"?"Road closed due to "+n.obstructionType:t=="impassable"?"Road impassable due to "+n.obstructionType:t=="lane closure"?"Lane closed due to "+n.obstructionType:t=="with caution"?n.obstructionType+" proceed with caution":t=="detour"?"Detour due to "+n.obstructionType:t.indexOf("high clearance")!=-1?n.restrictionType+" due to "+n.obstructionType:n.obstructionType},t.setTooltipDescriptions=function(t,i){var r=i;return r.typeTooltip=n.TerminologyUtils.getTooltipDescription(t,i.restrictionType),r.detailsTooltip=n.TerminologyUtils.getTooltipDescription(t,i.obstructionType),r},t.sortObstructionList=function(n){return n.length>1&&n.sort(function(n,t){return n.roadName<t.roadName?-1:1}),n},t.sortObstructionFeatureList=function(n){return n.length>1&&n.sort(function(n,t){return n.data.roadName<t.data.roadName?-1:1}),n},t.validComment=function(n){return n==null||n==""||n=="-"||n==" "?!1:!0},t.updateObstructionPath=function(t,i,r,u){var f=this;return new Promise(function(e,o){var s=n.ObstructionUtils.obstructionPathRequestFactory(t.data);f.roadDataService.getPathBetweenPoints(s,r).then(function(f){var s,c,h;f.succeed?(s=n.MarkerFactories.endPathIconFactory(t),s.setZIndexOffset(-200),c=f.response.centrelinePoints,h=n.ObstructionUtils.defaultPathFactory(c),t.updateArea(h,s,i),u!=null&&(s.dragging.enable(),u(s)),e([h,s])):r.useDefaultErrorHandler&&o(f.message)})})},t.drawPath=function(n,t,i){n.focused?n.showArea(i):n.visible&&n.showArea(i)},t.drawObstructionPath=function(n,t,i,r){var u=this;return new Promise(function(f){var e=!1;n.endMarker&&(r!=null&&r(n.endMarker),u.drawPath(n,[n.path,n.endMarker],t),e=!0,f(!0));e||n.pullingData||(n.pullingData=!0,u.updateObstructionPath(n,t,i,r).then(function(i){u.drawPath(n,i,t);n.pullingData=!1;f(!0)},function(){n.pullingData=!1;f(!1)}))})},t.getAutoCompleteOptions=function(){var n=this;return{valuePrimitive:!0,filter:"startswith",dataSource:new kendo.data.DataSource({type:"json",serverFiltering:!0,transport:{read:function(t){var i={roadName:t.data.filter.filters[0].value};n.roadDataService.searchNtRoads(i).then(function(n){t.success(n.response)})}}})}},t}();n.ObstructionUtils=t})(t=n.Utilities||(n.Utilities={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(n){var t=function(){function n(){}return n.getTerminologyByTerm=function(n,t){if(n!=null)for(var i=0;i<n.length;i++)if(n[i].term===t)return n[i]},n.getTooltipDescription=function(n,t){if(n!=null)for(var i=0;i<n.length;i++)if(n[i].term.toLowerCase()==t.toLowerCase())return n[i].description},n}();n.TerminologyUtils=t})(t=n.Utilities||(n.Utilities={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(t){var i=function(){function t(t,i,r,u,f,e,o,s,h,c,l,a,v){this.$scope=t;this.$state=i;this.$timeout=r;this.$window=u;this.$mdDialog=f;this.$mdSidenav=e;this.settings=o;this.signalrService=s;this.browserStorageService=h;this.announcementDataService=c;this.roadRegionDataService=l;this.notificationsService=a;this.feedbackService=v;this.majorRoads=n.Utilities.AppConfiguration.majorRoads;this.regionLocations=n.Utilities.AppConfiguration.regionLocations;this.disclaimer=n.Utilities.AppConfiguration.getDisclaimer();this.mobileDevice=!1;this.tryCount=0;this.broadcast=null;this.marqueeLoaded=!1;t.vm=this;this.setupWindowWatcher();this.setupSignalrCallbacks()}return t.prototype.toggleSidenav=function(n){this.$mdSidenav(n).toggle()},t.prototype.setupWindowWatcher=function(){var n=this;this.$window.onresize=function(){var t=n.$window.innerWidth;n.checkWindowBounds(t)};this.$timeout(function(){var t=n.$window.innerWidth;n.checkWindowBounds(t);n.getEmergencyBroadcast()})},t.prototype.checkWindowBounds=function(n){this.mobileDevice=n<768?!0:!1;this.$scope.$$phase||this.$scope.$apply()},t.prototype.setupSignalrCallbacks=function(){var n=this;this.signalrService.subscribe("home-announcement-added","announcementAdded",function(){n.getEmergencyBroadcast()});this.signalrService.subscribe("home-announcement-updated","announcementUpdated",function(t){n.broadcasts.some(function(i,r){if(i.id==t.id)return t.emergency?(i.title=t.title,i.content=t.content):n.broadcasts.splice(r,1),!0});n.$scope.$$phase||n.$scope.$apply()});this.signalrService.subscribe("home-announcement-deleted","announcementDeleted",function(t){n.broadcasts.some(function(i,r){if(i.id==t.id)return n.broadcasts.splice(r,1),!0});n.$scope.$$phase||n.$scope.$apply()});this.signalrService.registerAutoTearDown(this.$scope,"home",function(){n.tearDownSignalr()})},t.prototype.tearDownSignalr=function(){this.signalrService.unsubscribe("home-announcement-added");this.signalrService.unsubscribe("home-announcement-updated");this.signalrService.unsubscribe("home-announcement-deleted")},t.prototype.getEmergencyBroadcast=function(){var t=this;this.mobileDevice&&this.announcementDataService.getEmergencyAnnouncements().then(function(n){t.broadcasts=n;t.setupEmergencyPopup()},function(i){i.data!=null?t.notificationsService.error(i.data):t.notificationsService.error(n.Utilities.AppConfiguration.defaultError)})},t.prototype.viewBroadcasts=function(){this.$state.go("information.announcements")},t.prototype.showBroadcast=function(n){return this.broadcast!=null&&this.broadcast!=" "?n=="mobile"?this.mobileDevice:!this.mobileDevice:!1},t.prototype.showEnvWarning=function(){return this.settings.environment.indexOf(Enums.Environment.EnvironmentEnum.Test.name)!=-1},t.prototype.showEmergencyPopup=function(){this.$mdDialog.show({controller:n.Controllers.EmergencyBroadcastModalController,templateUrl:Core.RouteConfiguration.path_shared+"emergency-broadcast-modal.html",parent:angular.element(document.body),clickOutsideToClose:!0,fullscreen:!1,locals:{broadcasts:this.broadcasts}})},t.prototype.setupEmergencyPopup=function(){var n=this.browserStorageService.getItem("emergency-popup-shown");n!=null&&n||this.mobileDevice||this.broadcasts.length>0&&this.showEmergencyPopup();this.browserStorageService.addItem(!0,"emergency-popup-shown")},t.$inject=["$scope","$state","$timeout","$window","$mdDialog","$mdSidenav","settings","signalrService","browserStorageService","announcementDataService","roadRegionDataService","notificationsService","feedbackService"],t}();t.HomeController=i})(t=n.Controllers||(n.Controllers={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(t){var i=function(){function t(t,i,r,u,f,e,o,s,h,c,l,a){this.$scope=t;this.$state=i;this.$timeout=r;this.$mdDialog=u;this.settings=f;this.notificationsService=e;this.signalrService=o;this.announcementDataService=s;this.roadDataService=h;this.$mdSidenav=c;this.navigationService=l;this.feedbackService=a;this.feedbackPoorGoodSliderOptions={showTicksValues:!0,showSelectionBar:!0,showOnlyLegend:!0,stepsArray:[{value:1,legend:"Poor"},{value:2,legend:""},{value:3,legend:"Average"},{value:4,legend:""},{value:5,legend:"Good"}]};this.feedbackLowHighSliderOptions={showTicksValues:!0,showSelectionBar:!0,showOnlyLegend:!0,stepsArray:[{value:1,legend:"Low"},{value:2,legend:""},{value:3,legend:"Average"},{value:4,legend:""},{value:5,legend:"High"}]};t.vm=this;this.navigationService.currentState=this.$state.current.name;n.Utilities.ObstructionUtils.roadDataService=this.roadDataService;this.setupSignalrCallbacks();this.getEmergencyBroadcast();this.navigationService.getCodeTableDescriptions()}return t.prototype.toggleSidenav=function(n){this.$mdSidenav(n).toggle()},t.prototype.openMenu=function(n,t){n.open(t)},t.prototype.setupSignalrCallbacks=function(){var n=this;this.signalrService.subscribe("nav-announcement-added","announcementAdded",function(t){t.emergency&&n.getEmergencyBroadcast().then(function(){n.showEmergencyPopup()})});this.signalrService.subscribe("nav-announcement-updated","announcementUpdated",function(t){n.broadcasts.some(function(i,r){if(i.id==t.id)return t.emergency||(n.notificationsService.information("The following emergency warning has ended: "+t.title),n.broadcasts.splice(r,1)),n.notificationsService.warning("The following emergency warning has been updated: "+t.title),!0});n.$scope.$$phase||n.$scope.$apply()});this.signalrService.subscribe("nav-announcement-deleted","announcementDeleted",function(t){n.broadcasts.some(function(i,r){if(i.id==t.id)return n.notificationsService.information("The following emergency warning has ended: "+t.title),n.broadcasts.splice(r,1),!0});n.$scope.$$phase||n.$scope.$apply()})},t.prototype.tearDownSignalr=function(){this.signalrService.unsubscribe("nav-announcement-added");this.signalrService.unsubscribe("nav-announcement-updated");this.signalrService.unsubscribe("nav-announcement-deleted")},t.prototype.viewMap=function(){this.$mdSidenav("mainNav").close();this.$state.go("road-map",{obstrId:null,region:null})},t.prototype.goTo=function(n){this.$mdSidenav("mainNav").close();this.$state.go(n)},t.prototype.showFaults=function(){var n=this,t=this.navigationService.currentState;this.$timeout(function(){n.navigationService.currentState=t;n.$scope.$$phase||n.$scope.$apply()})},t.prototype.getBroadcastsMessage=function(){if(this.broadcasts)return this.broadcasts.length>1?this.broadcasts.length+" Emergency Broadcasts":"1 Emergency Broadcast"},t.prototype.getLinkActive=function(n){return this.$state.includes(n)},t.prototype.getCharacterCount=function(n){return n!=null?n.length:0},t.prototype.showEnvWarning=function(){return this.settings.environment.indexOf(Enums.Environment.EnvironmentEnum.Production.name)==-1},t.prototype.getEnvWarning=function(){return this.settings.environment+" Build"},t.prototype.viewBroadcasts=function(){this.$state.go("information.announcements")},t.prototype.getEmergencyBroadcast=function(){var t=this;return new Promise(function(i,r){t.announcementDataService.getEmergencyAnnouncements().then(function(n){t.broadcasts=n;i(!0)},function(i){i.data!=null?t.notificationsService.error(i.data):t.notificationsService.error(n.Utilities.AppConfiguration.defaultError);r(!1)})})},t.prototype.showEmergencyPopup=function(){this.$mdDialog.show({controller:n.Controllers.EmergencyBroadcastModalController,templateUrl:Core.RouteConfiguration.path_shared+"emergency-broadcast-modal.html",parent:angular.element(document.body),clickOutsideToClose:!0,fullscreen:!1,locals:{broadcasts:this.broadcasts}})},t.$inject=["$scope","$state","$timeout","$mdDialog","settings","notificationsService","signalrService","announcementDataService","roadDataService","$mdSidenav","navigationService","feedbackService"],t}();t.NavigationController=i})(t=n.Controllers||(n.Controllers={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(t){var i=function(){function t(t,i,r,u,f){this.$scope=t;this.$mdSidenav=i;this.mapService=r;this.sidebarService=u;this.roadRegionDataService=f;this.regionLocations=n.Utilities.AppConfiguration.regionLocations;this.markerPins=n.Utilities.MarkerUtils.getAllMarkerPins();this.tryCount=0;t.vm=this}return t.prototype.toggleSidenav=function(n){this.$mdSidenav(n).toggle()},t.prototype.zoomToRegion=function(n){this.sidebarService.zoomToRegion(n.name)},t.prototype.showAllMarkerTypes=function(){this.sidebarService.showAllMarkerTypes()},t.prototype.hideAllMarkerTypes=function(){this.sidebarService.hideAllMarkerTypes()},t.prototype.filterMapPins=function(n){this.sidebarService.filterMapPins(n)},t.$inject=["$scope","$mdSidenav","mapService","mapSidebarService","roadRegionDataService"],t}();t.MapFiltersController=i})(t=n.Controllers||(n.Controllers={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(t){var i=function(){function t(t,i,r,u,f,e,o,s,h){this.$scope=t;this.$state=i;this.$mdSidenav=r;this.mapService=u;this.sidebarService=f;this.terminologyDataService=e;this.notificationsService=o;this.roadDataService=s;this.navigationService=h;this.dateUtils=new n.Utilities.DateUtilities;this.obstructionTypes=[];this.restrictionTypes=[];t.vm=this;this.getCodeTableDescriptions();this.getTerminology()}return t.prototype.toggleSidenav=function(n){this.$mdSidenav(n).toggle()},t.prototype.getCodeTableDescriptions=function(){var n=this.navigationService.getCodes();this.restrictionTypes=n[0];this.obstructionTypes=n[1]},t.prototype.getTerminology=function(){var t=this;this.terminologyDataService.getAllTerminology().then(function(n){t.terminologyList=n},function(i){i.data!=null?t.notificationsService.error(i.data):t.notificationsService.error(n.Utilities.AppConfiguration.defaultError)})},t.prototype.searchRoadName=function(n){var t=this;return new Promise(function(i){var r={roadName:n};t.roadDataService.searchNtRoads(r).then(function(n){i(n.response)})})},t.prototype.searchMap=function(){this.sidebarService.filtering.search=!0;n.Utilities.ClusterUtils.tearDownMap(this.mapService.leafletMap);this.mapService.buildSearchFunction();this.sidebarService.showAllMarkerTypes();this.sidebarService.smallScreen?this.sidebarService.visible=!1:this.sidebarService.setSidebarState(2)},t.prototype.resetFilter=function(t){this.sidebarService.filtering.search=!1;this.sidebarService.filtering.pins=!1;this.sidebarService.resetMapSearchFilter();t.$setPristine();n.Utilities.MarkerUtils.resetMarkerConfig();n.Utilities.ClusterUtils.tearDownMap(this.mapService.leafletMap);this.mapService.buildAllDataMarkers();this.sidebarService.smallScreen&&(this.sidebarService.visible=!1)},t.prototype.toolTipExists=function(n){return n!=null?!0:!1},t.prototype.getTerminologyByTerm=function(t){return n.Utilities.TerminologyUtils.getTerminologyByTerm(this.terminologyList,t)},t.prototype.viewTooltipTerminology=function(n){this.$state.go("information.terminology",{selectedTerm:this.getTerminologyByTerm(n)})},t.$inject=["$scope","$state","$mdSidenav","mapService","mapSidebarService","terminologyDataService","notificationsService","roadDataService","navigationService"],t}();t.MapObstructionDetailsController=i})(t=n.Controllers||(n.Controllers={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(t){var i=function(){function t(n,t,i,r){this.$scope=n;this.$mdSidenav=t;this.mapService=i;this.sidebarService=r;this.tooltipClicked=!1;n.vm=this}return t.prototype.preventEvent=function(){this.tooltipClicked=!0},t.prototype.focusObstruction=function(n){this.tooltipClicked||this.sidebarService.focusObstruction(n);this.tooltipClicked=!1},t.prototype.toggleSidenav=function(n){this.$mdSidenav(n).toggle()},t.prototype.filterBySearch=function(){this.sidebarService.visibleMarkers=n.Utilities.MarkerUtils.getVisibleMarkers(this.mapService.leafletMap,n.Utilities.ClusterUtils.clusterLayers,this.sidebarService.selectedMarker)},t.prototype.resetMapView=function(){this.sidebarService.resetMapView()},t.prototype.getTrimmedComment=function(t){var i=t.locationComment;return(n.Utilities.ObstructionUtils.validComment(i)||(i=t.comment),(i.length<=4||!n.Utilities.ObstructionUtils.validComment(i))&&(i=n.Utilities.ObstructionUtils.getObstructionTooltip(t)),i.length<60)?i:i.slice(0,60)+"..."},t.prototype.checkMapEmpty=function(n){return n!=null&&!this.sidebarService.mapDataLoading&&n.length<1?!0:!1},t.$inject=["$scope","$mdSidenav","mapService","mapSidebarService"],t}();t.MapObstructionListController=i})(t=n.Controllers||(n.Controllers={}))}(RoadsReporting||(RoadsReporting={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(t){var i=function(t){function i(i,r,u,f,e,o,s,h,c,l,a,v,y,p,w,b,k){var d=this;t.call(this,c,l,a);this.$scope=i;this.$element=r;this.$stateParams=u;this.$mdDialog=f;this.$timeout=e;this.$window=o;this.$mdMedia=s;this.$mdSidenav=h;this.settings=c;this.mapService=l;this.notificationsService=a;this.sidebarService=v;this.obstructionDataService=y;this.selectivePrintService=p;this.browserStorageService=w;this.signalrService=b;this.terminologyDataService=k;this.speedDialOpen=!1;this.printlayer=[];this.printConfig={selectionActive:!1,printing:!1,areaSelect:null};this.panelItems={filter:{controller:n.Controllers.MapFiltersController,template:Core.RouteConfiguration.path_map+"map-filters-panel.html"},list:{controller:n.Controllers.MapObstructionListController,template:Core.RouteConfiguration.path_map+"map-obstruction-list-panel.html"},detail:{controller:n.Controllers.MapObstructionDetailsController,template:Core.RouteConfiguration.path_map+"map-obstruction-details-panel.html"}};this.finishedPrinting=function(){d.leaflet.width="100%";d.leaflet.height="100%";n.Utilities.MarkerUtils.reclusterMarkers(d.printlayer,d.mapService.leafletMap);d.mapService.leafletMap.setView(d.sidebarService.previousMapPosition.center,d.sidebarService.previousMapPosition.zoom);d.sidebarService.previousMapPosition.center=null;d.printConfig.printing=!1;d.printConfig.selectionActive=!1};i.vm=this;this.sidebarService.resetMapVariables();this.sidebarService.setupSidebar(i);this.sidebarService.setPreviousMapPosition({center:null,zoom:0});this.setupSignalrCallbacks();this.setup()}return __extends(i,t),i.prototype.toggleSidenav=function(n){this.$mdSidenav(n).toggle()},i.prototype.setup=function(){var n=this;this.sidebarService.mapDataLoading=!0;this.setupMap().then(function(){n.configureMap();n.setupTerminology().then(function(){n.buildDataMarkers()})});this.setupDisclaimer()},i.prototype.setupTerminology=function(){var t=this;return new Promise(function(i){t.terminologyDataService.getAllTerminology().then(function(n){t.terminologyList=n;i(!0)},function(r){r.data!=null?t.notificationsService.error(r.data):t.notificationsService.error(n.Utilities.AppConfiguration.defaultError);i(!1)})})},i.prototype.configureMap=function(){var n=this;this.mapService.registerBuildAllFunction(function(){n.buildDataMarkers()});this.mapService.registerBuildSearchFunction(function(){n.buildDataMarkersBySearch()})},i.prototype.setupSignalrCallbacks=function(){var n=this;this.signalrService.subscribe("map-obstruction-added","obstructionAdded",function(t){n.addUpdateMarkerById(t)});this.signalrService.subscribe("map-obstruction-updated","obstructionUpdated",function(t){t.obstruction.status==Enums.Obstruction.ObstructionStatusEnum.ADD_AWAITING_APPROVAL.name||t.obstruction.status==Enums.Obstruction.ObstructionStatusEnum.UPDATE_AWAITING_APPROVAL.name?n.removeMarkerById(t):n.addUpdateMarkerById(t)});this.signalrService.subscribe("map-obstruction-deleted","obstructionDeleted",function(t){n.removeMarkerById(t)});this.signalrService.registerAutoTearDown(this.$scope,"road-map",function(){n.tearDownSignalr()})},i.prototype.buildDataMarkers=function(){var t=this;return new Promise(function(i){var r=new n.Classes.ServiceOptions(!1,!0);t.obstructionDataService.getAllObstructions(r).then(function(r){t.$stateParams.region!=null&&t.sidebarService.zoomToRegion(t.$stateParams.region);t.generateMarkers(r);t.setupLayers();t.sidebarService.visibleMarkers=n.Utilities.MarkerUtils.getVisibleMarkers(t.mapService.leafletMap,n.Utilities.ClusterUtils.clusterLayers,t.sidebarService.selectedMarker);t.sidebarService.selectedMarker!=null&&(t.sidebarService.focusObstruction(t.sidebarService.selectedMarker,!0,!0),t.sidebarService.visible=t.sidebarService.smallScreen?!1:!0);t.sidebarService.mapDataLoading=!1;i(!0)},function(r){r.data!=null?(t.notificationsService.error(r.data),t.sidebarService.mapDataLoading=!1):(t.notificationsService.error(n.Utilities.AppConfiguration.defaultError),t.sidebarService.mapDataLoading=!1);i(!1)})})},i.prototype.buildDataMarkersBySearch=function(){var t=this,i=new n.Classes.ServiceOptions(!1,!0);this.obstructionDataService.getAllCurrentObstructionsBySearch(this.sidebarService.mapSearchFilter,i).then(function(i){t.generateMarkers(i);t.setupLayers();t.sidebarService.visibleMarkers=n.Utilities.MarkerUtils.getVisibleMarkers(t.mapService.leafletMap,n.Utilities.ClusterUtils.clusterLayers,t.sidebarService.selectedMarker,!0)},function(i){i.data!=null?t.notificationsService.error(i.data):t.notificationsService.error(n.Utilities.AppConfiguration.defaultError)})},i.prototype.generateMarkers=function(t){var i=this;t.forEach(function(t){var r=n.Utilities.MarkerFactories.dataMarkerFactory(t,i.mapService.mapIconTypes),u;n.Utilities.ObstructionUtils.setTooltipDescriptions(i.terminologyList,r.data);i.addDataMarkerInteractions(r);u=n.Utilities.ClusterUtils.clusterLayers[r.layerName];u.addLayer(r);t.recordId===i.$stateParams.obstrId&&(i.sidebarService.selectedMarker=r)})},i.prototype.tearDownSignalr=function(){this.signalrService.unsubscribe("map-obstruction-added");this.signalrService.unsubscribe("map-obstruction-approve");this.signalrService.unsubscribe("map-obstruction-updated");this.signalrService.unsubscribe("map-obstruction-deleted")},i.prototype.displayInfoNotification=function(n,t){n.actionType==Enums.Rims.RimsActionType.U.name&&this.notificationsService.information(t)},i.prototype.displayWarningNotification=function(n,t){n.actionType==Enums.Rims.RimsActionType.U.name&&this.notificationsService.warning(t)},i.prototype.addUpdateMarkerById=function(t){var i,r;this.sidebarService.selectedMarker!=null&&this.sidebarService.selectedMarker.data.recordId==t.obstruction.recordId?(this.sidebarService.selectedMarker.data=t.obstruction,this.sidebarService.selectedMarker.clearArea(this.mapService.leafletMap),this.updateCustomPaths(t.obstruction,this.sidebarService.selectedMarker),this.sidebarService.selectedMarker.setLatLng(t.obstruction.startPoint),this.sidebarService.focusObstruction(this.sidebarService.selectedMarker,!1,!0),this.displayWarningNotification(t,"The obstruction you are viewing has been updated.")):(i=n.Utilities.MarkerUtils.getMarkerById(n.Utilities.ClusterUtils.clusterLayers,t.obstruction.recordId),i!=null?(i.data=t.obstruction,i.clearArea(this.mapService.leafletMap),this.updateCustomPaths(t.obstruction,i),i.setLatLng(t.obstruction.startPoint),this.displayInfoNotification(t,"An obstruction has been updated.")):(r=n.Utilities.MarkerFactories.dataMarkerFactory(t.obstruction,this.mapService.mapIconTypes),this.addDataMarkerInteractions(r),n.Utilities.ClusterUtils.clusterLayers[r.layerName].addLayer(r),this.sidebarService.visibleMarkers=n.Utilities.MarkerUtils.getVisibleMarkers(this.mapService.leafletMap,n.Utilities.ClusterUtils.clusterLayers,this.sidebarService.selectedMarker),this.displayInfoNotification(t,"An obstruction has been added to the map.")))},i.prototype.updateCustomPaths=function(t,i){t.geometries.length>0&&(i.customPaths=[],t.geometries.forEach(function(t){var r=n.Utilities.GeometryUtilities.convertGeomToPoly(t);r.setStyle(n.Utilities.ObstructionConfiguration.pathStyling);i.customPaths.push(r)}))},i.prototype.removeMarkerById=function(t){var r=t.obstruction.recordId,i=null,u;this.sidebarService.selectedMarker!=null&&this.sidebarService.selectedMarker.data.recordId==r?(i=this.sidebarService.selectedMarker,this.sidebarService.unFocusMarker(),this.displayWarningNotification(t,"The obstruction you were viewing has been removed.")):(i=n.Utilities.MarkerUtils.getMarkerById(n.Utilities.ClusterUtils.clusterLayers,r),this.displayInfoNotification(t,"An obstruction was removed from the map."));i!=null&&(u=n.Utilities.ClusterUtils.clusterLayers[i.layerName],u.removeLayer(i))},i.prototype.getFilterWarningText=function(){var n="";return this.sidebarService.smallScreen?n="Some obstructions filtered":(this.isSearchFiltered()&&(n+="Search results"),this.isSearchFiltered()&&this.isPinFiltered()&&(n+=" and "),this.isPinFiltered()&&(n+="1 or more filters")),n},i.prototype.resetMapFilters=function(){var t=this,i=null;this.sidebarService.selectedMarker!=null&&(i=this.sidebarService.selectedMarker.data.recordId);this.sidebarService.filtering.pins=!1;this.sidebarService.filtering.search=!1;this.sidebarService.resetMapVariables();n.Utilities.ClusterUtils.tearDownMap(this.mapService.leafletMap);this.buildDataMarkers().then(function(){if(t.configureMap(),i!=null){var r=n.Utilities.MarkerUtils.getMarkerByRecordId(t.mapService.leafletMap,n.Utilities.ClusterUtils.clusterLayers,i);t.sidebarService.focusObstruction(r,!1,!0)}})},i.prototype.showDisclaimer=function(){this.$mdDialog.show({controller:n.Controllers.ConfirmModalController,templateUrl:Core.RouteConfiguration.path_shared+"disclaimer-modal.html",parent:angular.element(document.body),clickOutsideToClose:!0,fullscreen:!1,locals:{modalHead:"DISCLAIMER",modalBody:n.Utilities.AppConfiguration.getDisclaimer()}})},i.prototype.setupDisclaimer=function(){var n=this.browserStorageService.getItem("disclaimer-popup-shown");n!=null&&n||this.showDisclaimer();this.browserStorageService.addItem(!0,"disclaimer-popup-shown")},i.prototype.showFilterActiveNotice=function(){return(this.isPinFiltered()||this.isSearchFiltered())&&!this.printConfig.selectionActive?!0:!1},i.prototype.isPinFiltered=function(){return this.sidebarService.filtering.pins},i.prototype.isSearchFiltered=function(){return this.sidebarService.filtering.search},i.prototype.showPrintButton=function(){return this.printConfig.selectionActive==!1&&this.printConfig.printing==!1},i.prototype.showPrintControls=function(){return this.printConfig.selectionActive==!0&&this.printConfig.printing==!1},i.prototype.displayPrintSelect=function(){n.Utilities.MarkerUtils.declusterMarkers(this.printlayer,this.mapService.leafletMap);this.printConfig.selectionActive=!0;this.printConfig.areaSelect=L.areaSelect({width:600,height:400,keepAspectRatio:!0});this.printConfig.areaSelect.addTo(this.mapService.leafletMap)},i.prototype.cancelPrintSelect=function(){this.printConfig.areaSelect.remove();n.Utilities.MarkerUtils.reclusterMarkers(this.printlayer,this.mapService.leafletMap);this.resetMapFilters();this.printConfig.selectionActive=!1},i.prototype.printMap=function(){var n=this;this.printConfig.areaSelect.remove();this.printConfig.printing=!0;this.sidebarService.previousMapPosition.center=this.mapService.leafletMap.getCenter();this.sidebarService.previousMapPosition.zoom=this.mapService.leafletMap.getZoom();this.leaflet.width="1100px";this.leaflet.height="750px";this.mapService.leafletMap.addOneTimeEventListener("zoomend",function(){n.printConfig.printing&&(n.$timeout(function(){n.selectivePrintService.printElement("leafletContainer")},1500),n.$timeout(function(){n.finishedPrinting()},2e3))});this.mapService.leafletMap.flyToBounds(this.printConfig.areaSelect.getBounds())},i.prototype.setupMapDragInteraction=function(t){var i=this;t.on("click",function(){i.sidebarService.smallScreen||i.sidebarService.selectedMarker!=null&&i.sidebarService.unFocusObstruction()});t.on("moveend",function(){i.sidebarService.visibleMarkers.length=0;i.sidebarService.visibleMarkers=n.Utilities.MarkerUtils.getVisibleMarkers(t,n.Utilities.ClusterUtils.clusterLayers,i.sidebarService.selectedMarker,i.sidebarService.filtering.search)})},i.prototype.addDataMarkerInteractions=function(t){var i=this;t.on("click",function(n){var t=n.target;i.sidebarService.selectedMarker!=null&&i.sidebarService.selectedMarker.data.obstructionId!=t.data.obstructionId||i.sidebarService.selectedMarker==null?i.sidebarService.focusObstruction(t,!1):i.sidebarService.visible=!0});if(!this.sidebarService.smallScreen)t.on("mouseover",function(t){var i=t.target,u=t.target._map,r;i.visible=!0;r=new n.Classes.ServiceOptions(!1,!0);n.Utilities.ObstructionUtils.drawObstructionPath(i,u,r)})},i.$inject=["$scope","$element","$stateParams","$mdDialog","$timeout","$window","$mdMedia","$mdSidenav","settings","mapService","notificationsService","mapSidebarService","obstructionDataService","selectivePrintService","browserStorageService","signalrService","terminologyDataService"],i}(t.MapOrientatedController);t.RoadMapController=i})(t=n.Controllers||(n.Controllers={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(t){var i=function(){function t(n,t){this.leafletData=n;this.mapIconService=t;this.tileErrors=[]}return t.prototype.getMap=function(){var t=this;return new Promise(function(i){t.mapIconService.getAll().then(function(r){t.mapIconTypes=r;t.leafletData.getMap().then(function(r){t.leafletMap=r;t.leafletMap.setMaxBounds(n.Utilities.LeafletConfiguration.getMaxBounds());t.leafletMap.on("drag",function(){t.leafletMap.panInsideBounds(n.Utilities.LeafletConfiguration.getMaxBounds(),{animate:!0})});i(r)})})})},t.prototype.updateErrors=function(n){n===void 0&&(n=null);n!=null&&this.tileErrors.push(n);var t=[];this.tileErrors.forEach(function(n){var r=moment().toDate(),i=moment().diff(n.recorded,"minutes");i<2&&t.push(n)});this.tileErrors=t},t.prototype.registerBuildAllFunction=function(n){this.buildAllFunc=n},t.prototype.registerBuildSearchFunction=function(n){this.buildSearchFunc=n},t.prototype.registerResetFunction=function(n){this.resetFunc=n},t.prototype.buildAllDataMarkers=function(){this.buildAllFunc()},t.prototype.buildSearchFunction=function(){this.buildSearchFunc()},t.prototype.resetDataMarkers=function(n){this.resetFunc(n)},t.$inject=["leafletData","mapIconDataService"],t}();t.MapService=i})(t=n.Services||(n.Services={}))}(RoadsReporting||(RoadsReporting={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(t){var i=function(t){function i(i,r,u,f,e,o){t.call(this,i,r,u,f);this.settings=i;this.$window=r;this.$timeout=u;this.$mdSidenav=f;this.mapService=e;this.roadRegionDataService=o;this.mapDataLoading=!1;this.mapSearchFilter={obstructionTypes:[],restrictionTypes:[]};this.filtering={pins:!1,search:!1};this.markerPins=n.Utilities.MarkerUtils.getAllMarkerPins();this.regionPolygons={};this.regionNames=[];this.sidebarReference="rm-sidebar"}return __extends(i,t),i.prototype.resetMapView=function(){var t=n.Utilities.LeafletConfiguration.leafletCenterFactory();this.mapService.leafletMap.flyTo([t.lat,t.lng],t.zoom)},i.prototype.resetMapSearchFilter=function(){this.mapSearchFilter={obstructionTypes:[],restrictionTypes:[]};this.filtering.pins=!1;this.filtering.search=!1},i.prototype.resetMapVariables=function(){this.smallScreen||(this.visible=!0);this.selectedMarker!=null&&this.unFocusMarker();this.selectedMarker=null;this.visibleMarkers=[];this.resetMapSearchFilter();this.showAllMarkerTypes();this.regionNames.length!=0&&this.regionNames.forEach(function(n){n.isVisible=!1})},i.prototype.setPreviousMapPosition=function(n){this.previousMapPosition=n},i.prototype.setVisibleMarkers=function(n){this.visibleMarkers=n},i.prototype.focusObstruction=function(t,i,r){if(i===void 0&&(i=!0),r===void 0&&(r=!1),i&&this.zoomToMarker(t),this.selectedMarker==null||this.selectedMarker.data.recordId!=t.data.recordId||r){this.unFocusMarker();this.focusMarker(t);var u=new n.Classes.ServiceOptions(!1,!0);n.Utilities.ObstructionUtils.drawObstructionPath(t,this.mapService.leafletMap,u)}this.previousState=this.visible?this.state:-1;this.setSidebarState(3)},i.prototype.focusMarker=function(t){t.focused=!0;this.selectedMarker=t;n.Utilities.ClusterUtils.clusterLayers[t.layerName].removeLayer(t);this.selectedMarker.setIcon(n.Utilities.MarkerFactories.focusedIconFactory(this.selectedMarker));this.selectedMarker.setZIndexOffset(1e3);this.mapService.leafletMap.addLayer(this.selectedMarker)},i.prototype.unFocusObstruction=function(){this.previousMapPosition.center!=null&&(this.mapService.leafletMap.flyTo(this.previousMapPosition.center,this.previousMapPosition.zoom),this.previousMapPosition.center=null);this.unFocusMarker();this.smallScreen?this.previousState!=2?this.toggleVisibility():(this.state=this.previousState,this.previousState=null,this.visibleMarkers=n.Utilities.MarkerUtils.getVisibleMarkers(this.mapService.leafletMap,n.Utilities.ClusterUtils.clusterLayers,this.selectedMarker,this.filtering.search)):this.previousState!=null&&(this.previousState==-1?this.toggleVisibility():(this.state=this.previousState,this.previousState=null,this.visibleMarkers=n.Utilities.MarkerUtils.getVisibleMarkers(this.mapService.leafletMap,n.Utilities.ClusterUtils.clusterLayers,this.selectedMarker,this.filtering.search)))},i.prototype.unFocusMarker=function(){if(this.selectedMarker!=null){this.selectedMarker.focused=!1;this.selectedMarker.hideArea(this.mapService.leafletMap);this.mapService.leafletMap.removeLayer(this.selectedMarker);this.selectedMarker.setIcon(n.Utilities.MarkerFactories.defaultIconFactory(this.selectedMarker));var t=n.Utilities.MarkerConfiguration.markerConfig[this.selectedMarker.iconType].zIndex;this.selectedMarker.setZIndexOffset(t);n.Utilities.ClusterUtils.clusterLayers[this.selectedMarker.layerName].addLayer(this.selectedMarker);this.selectedMarker=null}},i.prototype.zoomToMarker=function(n){this.previousMapPosition.center=this.mapService.leafletMap.getCenter();this.previousMapPosition.zoom=this.mapService.leafletMap.getZoom();var t=this.getMarkerBounds(n);this.mapService.leafletMap.flyTo(t.center,t.zoom)},i.prototype.getRegionByName=function(t){var i=this;return new Promise(function(r){i.roadRegionDataService.getRoadRegionByName(t).then(function(u){var f=n.Utilities.GeometryUtilities.convertGeomToPolygon(u.response);i.regionPolygons[t]=f;r(u.response)})})},i.prototype.zoomToRegion=function(t){var i=this;n.Utilities.AppConfiguration.regionLocations.forEach(function(n){n.name==t&&i.mapService.leafletMap.flyTo([n.location[0],n.location[1]],n.zoom)})},i.prototype.drawRegion=function(n){n.isVisible?this.mapService.leafletMap.removeLayer(this.regionPolygons[n.name]):this.mapService.leafletMap.addLayer(this.regionPolygons[n.name]);n.isVisible=!n.isVisible},i.prototype.showAllMarkerTypes=function(){var n=this;this.markerPins.forEach(function(t){t.isVisible||n.filterMapPins(t)})},i.prototype.hideAllMarkerTypes=function(){var n=this;this.markerPins.forEach(function(t){t.isVisible&&n.filterMapPins(t)})},i.prototype.filterMapPins=function(t){var r=!1,i;for(t.isVisible=!t.isVisible,i=0;i<this.markerPins.length;i++)this.markerPins[i].isVisible?this.mapService.leafletMap.addLayer(n.Utilities.ClusterUtils.clusterLayers[this.markerPins[i].layer]):(r=!0,this.mapService.leafletMap.removeLayer(n.Utilities.ClusterUtils.clusterLayers[this.markerPins[i].layer]));this.filtering.pins=r?!0:!1;this.visibleMarkers=n.Utilities.MarkerUtils.getVisibleMarkers(this.mapService.leafletMap,n.Utilities.ClusterUtils.clusterLayers,this.selectedMarker)},i.prototype.getMarkerBounds=function(n){var i=L.latLngBounds([[n.data.startPoint[0],n.data.startPoint[1]],[n.data.endPoint[0],n.data.endPoint[1]]]),t=this.mapService.leafletMap.getBoundsZoom(i)-1,r=this.mapService.leafletMap.project(i.getSouthWest(),t),u=this.mapService.leafletMap.project(i.getNorthEast(),t),f=this.mapService.leafletMap.unproject(r.add(u).divideBy(2),t);return{center:f,zoom:t}},i.$inject=["settings","$window","$timeout","$mdSidenav","mapService","roadRegionDataService"],i}(t.SidebarServiceBase);t.SidebarServiceMap=i})(t=n.Services||(n.Services={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(n){var t=function(){function n(n,t,i,r,u){this.$scope=n;this.$mdSidenav=t;this.sidebarService=i;this.roadDataService=r;this.navigationService=u;this.obstructionTypes=[];this.restrictionTypes=[];n.vm=this;this.getCodeTableDescriptions();this.sidebarService.sidebarFocused=!0}return n.prototype.toggleSidenav=function(n){this.$mdSidenav(n).toggle()},n.prototype.getCodeTableDescriptions=function(){var n=this.navigationService.getCodes();this.restrictionTypes=n[0];this.obstructionTypes=n[1]},n.prototype.searchRoadName=function(n){var t=this;return new Promise(function(i){var r={roadName:n};t.roadDataService.searchNtRoads(r).then(function(n){i(n.response)})})},n.prototype.filterResults=function(){this.sidebarService.searchingRoadReports=!0;this.sidebarService.smallScreen&&(this.sidebarService.visible=!1,this.$mdSidenav("rr-sidebar").close());this.sidebarService.callPagingFunction()},n.prototype.resetFilter=function(n){this.sidebarService.resetReportsPagingFilter();n.$setPristine();this.sidebarService.smallScreen&&(this.sidebarService.visible=!1,this.$mdSidenav("rr-sidebar").close());this.sidebarService.callPagingFunction()},n.$inject=["$scope","$mdSidenav","reportSidebarService","roadDataService","navigationService"],n}();n.ReportsFilterController=t})(t=n.Controllers||(n.Controllers={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(n){var t=function(){function n(n,t,i){this.$scope=n;this.$mdSidenav=t;this.sidebarService=i;n.vm=this;this.sidebarService.sidebarFocused=!1}return n.prototype.toggleSidenav=function(n){this.$mdSidenav(n).toggle()},n.prototype.getHeaderText=function(){return this.sidebarService.selectedMajorRoad?this.sidebarService.selectedMajorRoad:"All Roads"},n.$inject=["$scope","$mdSidenav","reportSidebarService"],n}();n.ReportsRoadsController=t})(t=n.Controllers||(n.Controllers={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(n){var t=function(){function n(n,t,i,r){this.$scope=n;this.$mdSidenav=t;this.sidebarService=i;this.browserStorageService=r;n.vm=this;this.sidebarService.sidebarFocused=!1}return n.prototype.toggleSidenav=function(n){this.$mdSidenav(n).toggle()},n.prototype.isSort=function(n,t){return this.sidebarService.roadReportsFilter.orderColumn==n&&this.sidebarService.roadReportsFilter.orderDirection==t},n.prototype.sortList=function(n,t){t===void 0&&(t=!1);this.sidebarService.roadReportsFilter.orderColumn=n;this.sidebarService.roadReportsFilter.orderDirection="desc";t&&(this.sidebarService.roadReportsFilter.orderDirection="asc");this.updateSavedSettings(n,this.sidebarService.roadReportsFilter.orderDirection);this.sidebarService.callPagingFunction();this.sidebarService.smallScreen&&(this.sidebarService.visible=!1)},n.prototype.updateSavedSettings=function(n,t){this.browserStorageService.getItem("report-sorting-config")!=null&&this.browserStorageService.removeItem("report-sorting-config");this.browserStorageService.addItem({col:n,dir:t},"report-sorting-config")},n.$inject=["$scope","$mdSidenav","reportSidebarService","browserStorageService"],n}();n.ReportsSortingController=t})(t=n.Controllers||(n.Controllers={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(t){var i=function(){function t(t,i,r,u,f,e,o,s,h,c,l,a,v,y,p,w,b){var k=this;this.$scope=t;this.$document=i;this.$state=r;this.$stateParams=u;this.$q=f;this.$mdDialog=e;this.$mdSidenav=o;this.$mdMedia=s;this.$timeout=h;this.$window=c;this.sidebarService=l;this.obstructionDataService=a;this.signalrService=v;this.notificationsService=y;this.terminologyDataService=p;this.mapIconService=w;this.browserStorageService=b;this.firstLoad=!0;this.speedDialOpen=!1;this.dateUtils=new n.Utilities.DateUtilities;this.disclaimer=n.Utilities.AppConfiguration.getDisclaimer();this.pageSizes=n.Utilities.AppConfiguration.pageSizes;this.retrievingData=!1;this.errorMessage=!1;this.showSidebar=!1;this.totalRecords=0;this.maxPaginationSize=4;this.roadDataSet=[];this.panelItems={filter:{controller:n.Controllers.ReportsFilterController,template:Core.RouteConfiguration.path_reports+"reports-filters-panel.html"},roads:{controller:n.Controllers.ReportsRoadsController,template:Core.RouteConfiguration.path_reports+"reports-roads-panel.html"},sort:{controller:n.Controllers.ReportsSortingController,template:Core.RouteConfiguration.path_reports+"reports-sorting-panel.html"}};this.getRoadData=function(t){k.regulateDates();k.getSortingConfig();k.retrievingData=!0;t==null?k.obstructionDataService.getAllObstructionsPaged(k.sidebarService.roadReportsFilter).then(function(n){k.setupRoadData(n);k.showSidebar=!0;k.retrievingData=!1},function(t){t.data!=null?k.notificationsService.error(t.data):k.notificationsService.error(n.Utilities.AppConfiguration.defaultError);k.retrievingData=!1}):(k.sidebarService.roadReportsFilter.majorRoadName=t,k.obstructionDataService.getOtherMajorRoadsObstruction(k.sidebarService.roadReportsFilter).then(function(n){k.setupRoadData(n);k.showSidebar=!0;k.retrievingData=!1},function(t){t.data!=null?k.notificationsService.error(t.data):k.notificationsService.error(n.Utilities.AppConfiguration.defaultError);k.retrievingData=!1}))};t.vm=this;this.sidebarService.setupSidebar(t,1800);this.sidebarService.resetReportsVariables();this.sidebarService.selectedMajorRoad=this.$stateParams.roadName;this.sidebarService.registerPagingFunction(function(){k.pageChanged()});this.setupSignalrCallbacks();this.setupData(this.sidebarService.selectedMajorRoad);this.setupDisclaimer()}return t.prototype.toggleSidenav=function(n){this.$mdSidenav(n).toggle()},t.prototype.displayInfoNotification=function(n,t){n.actionType==Enums.Rims.RimsActionType.U.name&&this.notificationsService.information(t)},t.prototype.setupSignalrCallbacks=function(){var n=this;this.signalrService.subscribe("list-obstruction-added","obstructionAdded",function(t){n.displayInfoNotification(t,"An obstruction was added to the list. Sort by 'Most Recent' to see the latest obstructions.");n.pageChanged()});this.signalrService.subscribe("list-obstruction-updated","obstructionUpdated",function(t){n.displayInfoNotification(t,"An obstruction has been updated. Sort by 'Most Recent' to see the latest obstructions.");n.pageChanged()});this.signalrService.subscribe("list-obstruction-deleted","obstructionDeleted",function(t){n.displayInfoNotification(t,"Obstructions were removed from the list.");n.pageChanged()});this.signalrService.registerAutoTearDown(this.$scope,"road-reports",function(){n.tearDownSignalr()})},t.prototype.tearDownSignalr=function(){this.signalrService.unsubscribe("list-obstruction-added");this.signalrService.unsubscribe("list-obstruction-approve");this.signalrService.unsubscribe("list-obstruction-updated");this.signalrService.unsubscribe("list-obstruction-deleted")},t.prototype.setupData=function(n){var t=this;this.retrievingData=!0;this.$q.all([this.setupTerminology(),this.getIcons()]).then(function(i){t.iconTypes=i[1];t.getRoadData(n)})},t.prototype.getIcons=function(){var n=this.$q.defer();return this.mapIconService.getAll().then(function(t){n.resolve(t)}),n.promise},t.prototype.setupTerminology=function(){var t=this,i=this.$q.defer();return this.terminologyDataService.getAllTerminology().then(function(n){t.terminologyList=n;i.resolve(!0)},function(r){r.data!=null?t.notificationsService.error(r.data):t.notificationsService.error(n.Utilities.AppConfiguration.defaultError);i.resolve(!1)}),i.promise},t.prototype.getHeaderText=function(){return this.sidebarService.searchingRoadReports?this.sidebarService.selectedMajorRoad?this.sidebarService.selectedMajorRoad+" (Search Results)":"All Roads (Search Results)":this.sidebarService.selectedMajorRoad?this.sidebarService.selectedMajorRoad:"All Roads"},t.prototype.getNoResultsMessage=function(){var n="all roads";return(this.sidebarService.selectedMajorRoad!=null&&(n=this.sidebarService.selectedMajorRoad),this.sidebarService.searchingRoadReports)?"No obstructions found matching the search criteria.":"No obstructions found for "+n+"."},t.prototype.getCommentText=function(n){return n.comment},t.prototype.getObstructionHeader=function(t){return n.Utilities.MarkerConfiguration.markerConfig[t.iconType].icon},t.prototype.sortOrder=function(){this.$scope.sortOrder="T_ROAD"},t.prototype.pageChanged=function(){this.getRoadData(this.sidebarService.selectedMajorRoad);var n=this.$document.find("#report-top").offset().top;this.$document.find("#report-content-panel").scrollTop(n-10)},t.prototype.filterData=function(){this.displayErrorMsg()},t.prototype.displayErrorMsg=function(){this.roadDataSet.length<1&&(this.errorMessage=!0)},t.prototype.getObstructionSymbol=function(t){return n.Utilities.MarkerConfiguration.imgPrefix+n.Utilities.MarkerConfiguration.markerConfig[t.iconType].symbolUrl},t.prototype.viewOnMap=function(n,t){n.stopPropagation();this.$state.go("road-map",{obstrId:t})},t.prototype.resetRoadReportList=function(){this.$stateParams.roadName!=null?this.firstLoad?this.getRoadData(this.$stateParams.roadName):this.$state.go("road-reports"):(this.sidebarService.resetReportsVariables(),this.getRoadData(null))},t.prototype.showPagination=function(){return this.totalRecords<=100&&this.sidebarService.roadReportsFilter.pageSize>=100?!1:this.totalRecords<this.sidebarService.roadReportsFilter.pageSize?!1:!0},t.prototype.showFilterActiveNotice=function(){return this.sidebarService.searchingRoadReports},t.prototype.showDisclaimer=function(){this.$mdDialog.show({controller:n.Controllers.ConfirmModalController,templateUrl:Core.RouteConfiguration.path_shared+"disclaimer-modal.html",parent:angular.element(document.body),clickOutsideToClose:!0,fullscreen:!1,locals:{modalHead:"DISCLAIMER",modalBody:n.Utilities.AppConfiguration.getDisclaimer()}})},t.prototype.setupDisclaimer=function(){var n=this.browserStorageService.getItem("disclaimer-popup-shown");n!=null&&n||this.showDisclaimer();this.browserStorageService.addItem(!0,"disclaimer-popup-shown")},t.prototype.getSortingConfig=function(){var n=this.browserStorageService.getItem("report-sorting-config");n!=null&&(this.sidebarService.roadReportsFilter.orderColumn=n.col,this.sidebarService.roadReportsFilter.orderDirection=n.dir)},t.prototype.setupRoadData=function(t){var i=this;this.roadDataSet.length=0;t.data.forEach(function(t){var r=n.Utilities.ObstructionUtils.setTooltipDescriptions(i.terminologyList,t);r.iconType=n.Utilities.ObstructionUtils.getObstructionType(t,i.iconTypes);i.roadDataSet.push(r)});this.totalRecords=t.total;this.filterData();this.firstLoad&&(this.resetRoadReportList(),this.firstLoad=!1,this.$scope.$$phase||this.$scope.$apply())},t.prototype.regulateDates=function(){this.sidebarService.roadReportsFilter.startDateFrom=this.dateUtils.regulateDateFormat(this.sidebarService.roadReportsFilter.startDateFrom);this.sidebarService.roadReportsFilter.startDateTo=this.dateUtils.regulateDateFormat(this.sidebarService.roadReportsFilter.startDateTo);this.sidebarService.roadReportsFilter.endDateFrom=this.dateUtils.regulateDateFormat(this.sidebarService.roadReportsFilter.endDateFrom);this.sidebarService.roadReportsFilter.endDateTo=this.dateUtils.regulateDateFormat(this.sidebarService.roadReportsFilter.endDateTo);this.sidebarService.roadReportsFilter.lastUpdatedDateFrom=this.dateUtils.regulateDateFormat(this.sidebarService.roadReportsFilter.lastUpdatedDateFrom);this.sidebarService.roadReportsFilter.lastUpdatedDateTo=this.dateUtils.regulateDateFormat(this.sidebarService.roadReportsFilter.lastUpdatedDateTo)},t.prototype.downloadReport=function(){window.open("api/Obstruction/GetObstructionsReportPdf","_blank","")},t.prototype.getTerminologyByTerm=function(t){return n.Utilities.TerminologyUtils.getTerminologyByTerm(this.terminologyList,t)},t.prototype.toolTipExists=function(n){return n!=null?!0:!1},t.prototype.viewTooltipTerminology=function(n){this.$state.go("information.terminology",{selectedTerm:this.getTerminologyByTerm(n)})},t.$inject=["$scope","$document","$state","$stateParams","$q","$mdDialog","$mdSidenav","$mdMedia","$timeout","$window","reportSidebarService","obstructionDataService","signalrService","notificationsService","terminologyDataService","mapIconDataService","browserStorageService"],t}();t.RoadReportsController=i})(t=n.Controllers||(n.Controllers={}))}(RoadsReporting||(RoadsReporting={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t=function(n){function t(t,i,r,u,f,e){n.call(this,t,i,r,u);this.settings=t;this.$window=i;this.$timeout=r;this.$mdSidenav=u;this.mapService=f;this.roadRegionDataService=e;this.selectedMajorRoad=null;this.searchingRoadReports=!1;this.roadReportsFilter={page:1,pageSize:10,orderColumn:"T_ROAD",orderDirection:"asc",obstructionTypes:[],restrictionTypes:[]};this.sidebarReference="rr-sidebar"}return __extends(t,n),t.prototype.resetReportsVariables=function(){this.selectedMajorRoad=null;this.resetReportsPagingFilter()},t.prototype.resetReportsPagingFilter=function(){this.searchingRoadReports=!1;this.roadReportsFilter={page:1,pageSize:10,orderColumn:"T_ROAD",orderDirection:"asc",obstructionTypes:[],restrictionTypes:[]}},t.prototype.getSearchTerm=function(){return this.roadReportsFilter.roadName},t.$inject=["settings","$window","$timeout","$mdSidenav","mapService","roadRegionDataService"],t}(n.SidebarServiceBase);n.SidebarServiceReport=t})(t=n.Services||(n.Services={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(t){var i=function(){function t(t,i,r,u,f,e,o,s,h,c,l,a){this.$scope=t;this.$state=i;this.$stateParams=r;this.$sce=u;this.$window=f;this.$timeout=e;this.$mdMedia=o;this.$mdSidenav=s;this.sidebarService=h;this.signalrService=c;this.announcementDataService=l;this.notificationsService=a;this.firstLoad=!0;this.speedDialOpen=!1;this.dateUtils=new n.Utilities.DateUtilities;this.pageSizes=n.Utilities.AppConfiguration.getPageSizes();this.isFiltering=!1;this.retrievingData=!0;this.totalRecords=0;this.maxPaginationSize=5;this.broadcasts=[];this.announcements=[];this.cachedFilter={page:1,pageSize:5,orderColumn:"PostedDate",orderDirection:"desc",dateFrom:null,dateTo:null,tags:null,emergencyOnly:!1,internalOnly:!1,title:null,dateField:"PostedDate"};t.vm=this;this.sidebarService.sidebarReference="ann-sidebar";this.setupFilters();this.setupSignalrCallbacks();this.sidebarService.setupSidebar(t,1800);this.getEmergencyBroadcasts();this.getAnnouncements()}return t.prototype.toggleSidenav=function(n){this.$mdSidenav(n).toggle()},t.prototype.setupFilters=function(){this.$stateParams.emergencyOnly!=null&&this.$stateParams.emergencyOnly&&(this.cachedFilter.emergencyOnly=!0)},t.prototype.setupSignalrCallbacks=function(){var n=this;this.signalrService.subscribe("ann-announcement-added","announcementAdded",function(t){n.updateAnnouncements(t)});this.signalrService.subscribe("ann-announcement-updated","announcementUpdated",function(t){n.updateAnnouncements(t)});this.signalrService.subscribe("ann-announcement-deleted","announcementDeleted",function(t){n.updateAnnouncements(t)});this.signalrService.registerAutoTearDown(this.$scope,"information.announcements",function(){n.tearDownSignalr()})},t.prototype.updateAnnouncements=function(n){n.emergency?this.getEmergencyBroadcasts():this.pageChanged()},t.prototype.tearDownSignalr=function(){this.signalrService.unsubscribe("ann-announcement-added");this.signalrService.unsubscribe("ann-announcement-updated");this.signalrService.unsubscribe("ann-announcement-deleted")},t.prototype.getDate=function(n){return moment(n).format("DD MMMM YYYY, h:mm a")},t.prototype.getPostedDateTooltip=function(n){var t="<div><b>Posted Date<\/b> <br/>"+moment(n.postedDate).format("DD MMMM YYYY, h:mm a")+"<br/><br/><b>Last Updated<\/b>  <br/>"+moment(n.lastUpdatedTime).format("DD MMMM YYYY, h:mm a")+"<\/div>";return this.$sce.trustAsHtml(t)},t.prototype.getScheduledDateTooltip=function(n){var t="<div><b>Scheduled Date<\/b> <br/>"+moment(n.scheduledDate).format("DD MMMM YYYY, h:mm a")+"<br/><br/><b>Expected Duration<\/b> <br/>"+n.expectedDuration+"<\/div>";return this.$sce.trustAsHtml(t)},t.prototype.getTagsTooltip=function(n){var t="<div><b>Tags<\/b> <br/>"+n.tags;return this.$sce.trustAsHtml(t)},t.prototype.filter=function(){this.pageChanged();this.isFiltering=!0},t.prototype.showPagination=function(){return this.totalRecords<=100&&this.cachedFilter.pageSize>=100?!1:this.totalRecords<=this.cachedFilter.pageSize?!1:!0},t.prototype.pageChanged=function(){this.sidebarService.smallScreen&&this.$mdSidenav("ann-sidebar").close();this.getAnnouncements()},t.prototype.resetFilter=function(){this.cachedFilter={page:1,pageSize:5,orderColumn:"PostedDate",orderDirection:"desc",dateFrom:null,dateTo:null,tags:null,title:null,emergencyOnly:null,internalOnly:!1,dateField:"PostedDate"};this.pageChanged();this.isFiltering=!1},t.prototype.goToMap=function(){this.$state.go("road-map")},t.prototype.showFilterActiveNotice=function(){return this.isFiltering},t.prototype.getEmergencyBroadcasts=function(){var n=this;this.emergencyTooltip=this.$sce.trustAsHtml("<div><b>Emergency Broadcast<\/b><br/>This is an announcement of significant importance<\/div>");this.announcementDataService.getEmergencyAnnouncements().then(function(t){var i=t;i.forEach(function(t){t.postedDateToolTip=n.getPostedDateTooltip(t)});n.broadcasts=i})},t.prototype.getAnnouncements=function(){var t=this;this.announcementDataService.getAnnouncementsPaged(this.cachedFilter).then(function(n){t.announcements.length=0;var i=n.data;t.totalRecords=n.total;i.forEach(function(n){n.postedDateToolTip=t.getPostedDateTooltip(n);n.scheduledDateToolTip=t.getScheduledDateTooltip(n);n.tagsTooltip=t.getTagsTooltip(n);n.emergency||t.announcements.push(n)});t.firstLoad&&(t.resetFilter(),t.firstLoad=!1,t.$scope.$$phase||t.$scope.$apply());t.retrievingData=!1},function(i){i.data!=null?t.notificationsService.error(i.data):t.notificationsService.error(n.Utilities.AppConfiguration.defaultError)})},t.$inject=["$scope","$state","$stateParams","$sce","$window","$timeout","$mdMedia","$mdSidenav","defaultSidebarService","signalrService","announcementDataService","notificationsService"],t}();t.AnnouncementsController=i})(t=n.Controllers||(n.Controllers={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(t){var i=function(){function t(n,t,i,r,u,f){this.$scope=n;this.$timeout=t;this.$mdSidenav=i;this.userFeedbackDataService=r;this.notificationsService=u;this.vcRecaptcha=f;this.showHints=!0;this.maxTextLength=500;this.recaptchaLoaded=!1;this.recaptchaId=null;this.errorReport={contactName:"",contactEmail:"",affectedPage:"",errorType:"",issue:"",dateReceived:null,recaptcha:null,signature:null};n.vm=this}return t.prototype.toggleSidenav=function(n){this.$mdSidenav(n).toggle()},t.prototype.resetErrorReport=function(n){this.errorReport={contactName:"",contactEmail:"",affectedPage:"",errorType:"",issue:"",dateReceived:null,recaptcha:null,signature:null};n.$setPristine();n.$setUntouched();this.showHints=!0},t.prototype.updateRecaptcha=function(n){var t=this;this.recaptchaId=n;this.$timeout(function(){t.recaptchaLoaded=!0},600)},t.prototype.getCharacterCount=function(n){return n!=null?n.length:0},t.prototype.sendErrorReport=function(t){var i=this,r;t.$valid?(this.showHints=!0,t.$setSubmitted(),r={recaptchaData:this.recaptchaResponse},this.errorReport.recaptcha=r,this.userFeedbackDataService.SendErrorReport(this.errorReport).then(function(n){n.succeed?(i.notificationsService.success(n.message),i.resetErrorReport(t)):(i.recaptchaResponse=null,i.notificationsService.error(n.message));i.recaptchaResponse=null;i.vcRecaptcha.reload(i.recaptchaId)},function(t){t.data!=null?i.notificationsService.error(t.data):i.notificationsService.error(n.Utilities.AppConfiguration.defaultError);i.recaptchaResponse=null;i.vcRecaptcha.reload(i.recaptchaId)})):this.showHints=!1},t.$inject=["$scope","$timeout","$mdSidenav","userFeedbackDataService","notificationsService","vcRecaptchaService"],t}();t.ErrorReportController=i})(t=n.Controllers||(n.Controllers={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(n){var t=function(){function n(n,t){this.$scope=n;this.$mdSidenav=t;n.vm=this}return n.prototype.toggleSidenav=function(n){this.$mdSidenav(n).toggle()},n.$inject=["$scope","$mdSidenav"],n}();n.InformationController=t})(t=n.Controllers||(n.Controllers={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(n){var t=function(){function n(n,t){this.$scope=n;this.$mdSidenav=t;n.vm=this}return n.prototype.toggleSidenav=function(n){this.$mdSidenav(n).toggle()},n.$inject=["$scope","$mdSidenav"],n}();n.InterstateController=t})(t=n.Controllers||(n.Controllers={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(n){var t=function(){function n(n,t){this.$scope=n;this.$mdSidenav=t;n.vm=this}return n.prototype.toggleSidenav=function(n){this.$mdSidenav(n).toggle()},n.$inject=["$scope","$mdSidenav"],n}();n.NationalParksController=t})(t=n.Controllers||(n.Controllers={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(t){var i=function(){function t(t,i,r,u,f,e,o,s,h){this.$scope=t;this.$stateParams=i;this.$window=r;this.$timeout=u;this.$mdSidenav=f;this.terminologyDataService=e;this.mapIconService=o;this.signalrService=s;this.notificationsService=h;this.markerPins=n.Utilities.MarkerUtils.getAllMarkerPins();this.terminologyDataSet=[];this.selectedTerm=null;t.vm=this;this.selectedTerm=this.$stateParams.selectedTerm;this.setupSignalrCallbacks();this.getTerminology()}return t.prototype.toggleSidenav=function(n){this.$mdSidenav(n).toggle()},t.prototype.setupSignalrCallbacks=function(){var t=this;this.signalrService.subscribe("terminology-term-added","termAdded",function(i){t.terminologyDataSet.some(function(r){if(r.groupName==i.termGroup)return r.items.push(new n.Classes.TerminologyTerm(i.id,i.term,i.description,i.termGroup,!0)),t.$scope.$$phase||t.$scope.$apply(),!0})});this.signalrService.subscribe("terminology-term-updated","termUpdated",function(n){t.terminologyDataSet.some(function(i){if(i.groupName==n.termGroup)return i.items.some(function(i){if(i.termId==n.id)return i=n,t.$scope.$$phase||t.$scope.$apply(),!0}),!0})});this.signalrService.subscribe("terminology-term-deleted","termDeleted",function(n){t.terminologyDataSet.some(function(i){if(i.groupName==n.termGroup)return i.items.some(function(r,u){if(r.termId==n.id)return i.items.splice(u,1),t.$scope.$$phase||t.$scope.$apply(),!0}),!0})});this.signalrService.registerAutoTearDown(this.$scope,"information.terminology",function(){t.tearDownSignalr()})},t.prototype.tearDownSignalr=function(){this.signalrService.unsubscribe("terminology-term-added");this.signalrService.unsubscribe("terminology-term-updated");this.signalrService.unsubscribe("terminology-term-deleted")},t.prototype.getTerminology=function(){var t=this;this.termFilter=new n.Classes.TerminologyFilter(this.selectedTerm);this.terminologyDataSet.push(new n.Classes.TerminologyGroup("Website Icons"));this.mapIconService.getAll().then(function(i){i.forEach(function(i,r){var u=n.Utilities.MarkerConfiguration.markerConfig[i.iconRef].symbolUrl,f=new n.Classes.TerminologyTerm(r,i.name,i.description,"Website Icons",!0,u);t.terminologyDataSet[0].items.push(f)})});this.terminologyDataService.getAllTerminologyGrouped().then(function(i){i.response.forEach(function(i){t.terminologyDataSet.push(new n.Classes.TerminologyGroup(i[0].termGroup));i.forEach(function(i){var r=new n.Classes.TerminologyTerm(i.id,i.term,i.description,i.termGroup,!0);t.terminologyDataSet[t.terminologyDataSet.length-1].items.push(r)})})},function(i){i.data!=null?t.notificationsService.error(i.data):t.notificationsService.error(n.Utilities.AppConfiguration.defaultError)})},t.$inject=["$scope","$stateParams","$window","$timeout","$mdSidenav","terminologyDataService","mapIconDataService","signalrService","notificationsService"],t}();t.TerminologyController=i})(t=n.Controllers||(n.Controllers={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t;(function(n){var t=function(){function n(n,t,i,r,u,f){this.$scope=n;this.$location=t;this.$window=i;this.$anchorScroll=r;this.$stateParams=u;this.$mdSidenav=f;n.vm=this;this.$stateParams.target!=null&&this.scrollinfo(this.$stateParams.target)}return n.prototype.toggleSidenav=function(n){this.$mdSidenav(n).toggle()},n.prototype.scrollinfo=function(n){this.$location.hash(n);this.$anchorScroll.yOffset=this.$window.innerWidth<776?55:155;this.$anchorScroll()},n.$inject=["$scope","$location","$window","$anchorScroll","$stateParams","$mdSidenav"],n}();n.TermsConditionsController=t})(t=n.Controllers||(n.Controllers={}))}(RoadsReporting||(RoadsReporting={})),function(n){var t=function(){function t(){this.ngApp=angular.module("myApp",["ui.router","ngMaterial","ngAnimate","ngMessages","ngAria","toastr","blockUI","ui.bootstrap","nemLogging","ui-leaflet","ncy-angular-breadcrumb","ngPageTitle","vcRecaptcha","updateMeta"]);this.ngApp.constant("settings",appSettings);this.MapControllers();this.MapServices();this.MapDirectives();this.MapFilters();n.AppConfiguration.ConfigureApp(this.ngApp);n.AppConfiguration.ConfigureAppRun(this.ngApp);n.AppConfiguration.ConfigureAppAnalytics(this.ngApp)}return t.prototype.MapControllers=function(){this.ngApp.controller("navigationController",RoadsReporting.Controllers.NavigationController)},t.prototype.MapServices=function(){this.ngApp.service("notificationsService",RoadsReporting.Shared.Services.Toastr);this.ngApp.service("objectUtilities",n.ObjectUtilities);this.ngApp.service("serviceBase",n.ServiceBase);this.ngApp.service("roadDataService",RoadsReporting.Services.RoadDataService);this.ngApp.service("obstructionDataService",RoadsReporting.Services.ObstructionDataService);this.ngApp.service("codetableDataService",RoadsReporting.Services.CodeTableDataService);this.ngApp.service("terminologyDataService",RoadsReporting.Services.TerminologyDataService);this.ngApp.service("roadRegionDataService",RoadsReporting.Services.RoadRegionDataService);this.ngApp.service("userFeedbackDataService",RoadsReporting.Services.UserFeedbackDataService);this.ngApp.service("announcementDataService",RoadsReporting.Services.AnnouncementDataService);this.ngApp.service("browserStorageService",RoadsReporting.Services.BrowserStorageService);this.ngApp.service("signalrService",RoadsReporting.Services.SignalrService);this.ngApp.service("mapService",RoadsReporting.Services.MapService);this.ngApp.service("selectivePrintService",RoadsReporting.Directives.SelectivePrintService);this.ngApp.service("defaultSidebarService",RoadsReporting.Services.SidebarServiceDefault);this.ngApp.service("mapSidebarService",RoadsReporting.Services.SidebarServiceMap);this.ngApp.service("reportSidebarService",RoadsReporting.Services.SidebarServiceReport);this.ngApp.service("navigationService",RoadsReporting.Shared.Services.NavigationService);this.ngApp.service("feedbackService",RoadsReporting.Shared.Services.FeedbackService);this.ngApp.service("mapIconDataService",RoadsReporting.Services.MapIconDataService)},t.prototype.MapDirectives=function(){this.ngApp.directive("selectivePrint",RoadsReporting.Directives.SelectivePrintDirective.factory())},t.prototype.MapFilters=function(){this.ngApp.filter("parseDate",RoadsReporting.Filters.ParseDateFilter);this.ngApp.filter("boolToYesNo",RoadsReporting.Filters.BoolToYesNo)},t}();n.MainApp=t;new n.MainApp}(Core||(Core={}))