var __extends,Mrwa;(function(n){var t=function(){function n(){}return n.IsMobile=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform),n.IsSmallMobile=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&$(window).width()<736,n.SiteRelativePath="",n.SiteAbsolutePath="",n.ReleaseVersion="",n.ArcGisMapServerUrl="",n.AgolOAuth="true",n.AppInsightsActive=!1,n.CachingIsAvailable=function(){var n="test";try{return localStorage.setItem(n,n),localStorage.removeItem(n),!0}catch(t){return!1}},n}();n.Settings=t})(Mrwa||(Mrwa={})),function(n){var t=function(){function t(){}return t.Initialise=function(){$.notifyDefaults({type:"mrwa-default",delay:3e3,template:'<div data-notify="container" class="col-xs-12 col-md-2 alert alert-{0}" role="alert"><button type="button" aria-hidden="true" class="close" data-notify="dismiss">×<\/button><div data-notify="title"><i data-notify="icon"><\/i> {1}<\/div><div style="font-size:14px; padding-left: 20px; margin-top:5px" data-notify="message">{2}<\/div><div class="progress" data-notify="progressbar"><div class="progress-bar progress-bar-{0}" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%;"><\/div><\/div><a href="{3}" target="{4}" data-notify="url"><\/a><\/div>',newest_on_top:!0,allow_dismiss:!0,showProgressbar:!1,placement:{from:"bottom",align:"right"},offset:{x:10,y:n.Settings.IsMobile?60:120}})},t.Error=function(n,t){return $.notify({icon:"fa fa-warning",title:n,message:t},{type:"mrwa-error",delay:0})},t.WarningWithUrl=function(n,t,i){return $.notify({icon:"fa fa-warning",title:n,message:t,url:i,target:"_blank"},{type:"mrwa-warning",delay:0})},t.Info=function(n,t){return $.notify({icon:"fa fa-spinner fa-spin",title:n,message:t},{type:"info",delay:0})},t}();n.Notifications=t}(Mrwa||(Mrwa={})),function(n){var t;(function(n){var t,i,r,u,f,e;(function(n){n[n.TravelDateFilterControl=0]="TravelDateFilterControl";n[n.TripTravelDateFilterControl=1]="TripTravelDateFilterControl";n[n.FeatureFilterSearchControl=2]="FeatureFilterSearchControl";n[n.MapBounds=3]="MapBounds";n[n.FeatureGroup=4]="FeatureGroup"})(t=n.FilteredBy||(n.FilteredBy={})),function(n){n[n.Alert=0]="Alert";n[n.Closed=1]="Closed";n[n.RestrictedVehicleType=2]="RestrictedVehicleType";n[n.OpenWithConditions=3]="OpenWithConditions";n[n.Detour=4]="Detour"}(i=n.AlertTypes||(n.AlertTypes={})),function(n){n[n.Closed=0]="Closed";n[n.RestrictedVehicleType=1]="RestrictedVehicleType";n[n.OpenWithConditions=2]="OpenWithConditions";n[n.Detour=3]="Detour"}(r=n.RoadClosureLineTypes||(n.RoadClosureLineTypes={})),function(n){n[n.OvernightStopping=0]="OvernightStopping";n[n.LightVehicleParking=1]="LightVehicleParking";n[n.HeavyVehicleParking=2]="HeavyVehicleParking";n[n.Toilets=3]="Toilets";n[n.AccessibleToilets=4]="AccessibleToilets";n[n.InformationBay=5]="InformationBay";n[n.PicnicFacilities=6]="PicnicFacilities";n[n.Roadhouse=7]="Roadhouse";n[n.Bin=8]="Bin";n[n.EffluentDumpSite=9]="EffluentDumpSite";n[n.Other=10]="Other"}(u=n.RestAreaTypes||(n.RestAreaTypes={})),function(n){n[n.Alerts=0]="Alerts";n[n.TrafficSignalOutages=1]="TrafficSignalOutages";n[n.Roadworks=2]="Roadworks";n[n.Events=3]="Events";n[n.Cameras=4]="Cameras";n[n.RestArea=5]="RestArea";n[n.ClosedRoadPoints=6]="ClosedRoadPoints";n[n.RoadsOpenedWithVehicleRestrictionPoints=7]="RoadsOpenedWithVehicleRestrictionPoints";n[n.RoadsOpenedWithConditionPoints=8]="RoadsOpenedWithConditionPoints";n[n.DetourPoints=9]="DetourPoints";n[n.Unknown=10]="Unknown"}(f=n.FeaturePointGroupTypes||(n.FeaturePointGroupTypes={})),function(n){n[n.ClosedRoadLines=0]="ClosedRoadLines";n[n.RoadsOpenedWithVehicleRestrictionLines=1]="RoadsOpenedWithVehicleRestrictionLines";n[n.RoadsOpenedWithConditionLines=2]="RoadsOpenedWithConditionLines";n[n.DetourLines=3]="DetourLines";n[n.Unknown=4]="Unknown"}(e=n.FeatureLineGroupTypes||(n.FeatureLineGroupTypes={}))})(t=n.Enums||(n.Enums={}))}(Mrwa||(Mrwa={})),function(n){var t;(function(t){var i=function(){function t(n){var t=this;this.Id=ko.observable();this.GlobalId=ko.observable("");this.Description=ko.observable("");this.Road=ko.observable("");this.Suburb=ko.observable("");this.Region=ko.observable("");this.TrafficImpact=ko.observable("");this.LastUpdated=ko.observable(null);this.LastUpdatedString=ko.pureComputed(function(){return t.LastUpdated()==null?"No data available":"Updated "+t.LastUpdated().fromNow()});this.Type=ko.observable("");this.Location=ko.observable("");this.GoogleFeature=ko.observable();this.ParentFeaturePointGroup=ko.observable();this.IsVisible=ko.observable(!0);this.FilteredBy=ko.observableArray([]);this.StartDate=ko.observable(moment());this.StartDateString=ko.pureComputed(function(){return t.StartDate().format("DD/MM/YYYY HH:mm:ss")});this.EndDate=ko.observable(moment());this.EndDateString=ko.pureComputed(function(){return t.EndDate().format("DD/MM/YYYY HH:mm:ss")});this.Id(n.id);this.GlobalId(n.globalId);this.Description(n.description);this.Road(n.road);this.Suburb(n.suburb);this.Region(n.region);this.TrafficImpact(n.trafficImpact);this.LastUpdated(n.lastUpdated);this.Type(n.type);this.Location(n.location);this.GoogleFeature(n.googleFeature);this.ParentFeaturePointGroup(n.parentFeaturePointGroup);this.StartDate(n.startDate);this.EndDate(n.endDate)}return t.prototype.GetProperties=function(){return{Id:this.Id(),GlobalId:this.GlobalId(),Description:this.Description(),Road:this.Road(),Suburb:this.Suburb(),Region:this.Region(),TrafficImpact:this.TrafficImpact(),LastUpdated:this.LastUpdated(),Type:this.Type(),Location:this.Location(),StartDate:this.StartDate(),EndDate:this.EndDate()}},t.prototype.AddFilter=function(t){this.FilteredBy.indexOf(t)<0&&(this.FilteredBy.push(t),n.ArcGisService.getInstance().DataLayerCluster().remove(this.GoogleFeature()),this.IsVisible(!1))},t.prototype.RemoveFilter=function(t){this.FilteredBy.remove(t);this.FilteredBy().length===0&&(n.ArcGisService.getInstance().DataLayerCluster().add(this.GoogleFeature()),this.IsVisible(!0))},t.prototype.RemoveFromMap=function(){this.GoogleFeature().setMap(null)},t.prototype.Click=function(){var t=this.GoogleFeature().getGeometry().get();google.maps.event.trigger(n.ArcGisService.getInstance().DataLayerCluster()._dataLayer,"click",{latLng:t,feature:this.GoogleFeature(),zoomIn:16})},t.prototype.ClickWithZoom=function(t){var i=this.GoogleFeature().getGeometry().get();google.maps.event.trigger(n.ArcGisService.getInstance().DataLayerCluster()._dataLayer,"click",{latLng:i,feature:this.GoogleFeature(),zoomIn:t})},t.prototype.IsFeatureInCluster=function(){return this.GoogleFeature().getProperty("in_cluster")},t.GetFeatureData=function(n,t,i,r){i===void 0&&(i=!1);r===void 0&&(r="DD/MM/YYYY HH:mm:ss");var u=n.getProperty(t);return u==null?null:i&&r==null?moment.utc(u):i?moment(u,r):u},t.GetUrlFeatureData=function(n,t){var i=n.getProperty(t);return i?(i.indexOf("http")<0&&(i="https://"+i),i):""},t}();t.Feature=i})(t=n.Models||(n.Models={}))}(Mrwa||(Mrwa={})),function(n){var t;(function(n){var t=function(){function n(n){var t=this;this.Id=ko.observable();this.Description=ko.observable("");this.Road=ko.observable("");this.Suburb=ko.observable("");this.Region=ko.observable("");this.TrafficImpact=ko.observable("");this.LastUpdated=ko.observable(null);this.LastUpdatedString=ko.pureComputed(function(){return t.LastUpdated()==null?"No data available":"Updated "+t.LastUpdated().fromNow()});this.Type=ko.observable("");this.Location=ko.observable("");this.GoogleFeature=ko.observable();this.ParentFeatureLineGroup=ko.observable();this.IsVisible=ko.observable(!0);this.FilteredBy=ko.observableArray([]);this.StartDate=ko.observable(moment());this.StartDateString=ko.pureComputed(function(){return t.StartDate().format("DD/MM/YYYY HH:mm:ss")});this.EndDate=ko.observable(moment());this.EndDateString=ko.pureComputed(function(){return t.EndDate().format("DD/MM/YYYY HH:mm:ss")});this.Id(n.id);this.Description(n.description);this.Road(n.road);this.Suburb(n.suburb);this.Region(n.region);this.TrafficImpact(n.trafficImpact);this.LastUpdated(n.lastUpdated);this.Type(n.type);this.Location(n.location);this.GoogleFeature(n.googleFeature);this.ParentFeatureLineGroup(n.parentFeatureLineGroup);this.StartDate(n.startDate);this.EndDate(n.endDate)}return n.prototype.GetProperties=function(){return{Id:this.Id(),Description:this.Description(),Road:this.Road(),Suburb:this.Suburb(),Region:this.Region(),TrafficImpact:this.TrafficImpact(),LastUpdated:this.LastUpdated(),Type:this.Type(),Location:this.Location(),StartDate:this.StartDate(),EndDate:this.EndDate()}},n.prototype.RemoveFromMap=function(){this.GoogleFeature().setMap(null)},n.prototype.Click=function(){var n=null;n=this.GoogleFeature().getGeometry().get();google.maps.event.trigger(this.ParentFeatureLineGroup().DataLayer,"click",{latLng:n,feature:this.GoogleFeature(),zoomIn:!0})},n.GetFeatureData=function(n,t,i,r){i===void 0&&(i=!1);r===void 0&&(r="DD/MM/YYYY HH:mm:ss");var u=n.getProperty(t);return u==null?null:i&&r==null?moment.utc(u):i?moment(u,r):u},n.GetUrlFeatureData=function(n,t){var i=n.getProperty(t);return i?(i.indexOf("http")<0&&(i="https://"+i),i):""},n}();n.LineFeature=t})(t=n.Models||(n.Models={}))}(Mrwa||(Mrwa={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var i=function(t){function i(n,i){var r=t.call(this,n)||this;return r.AlertType=ko.observable(),r.SeeMoreUrl=ko.observable(""),r.AlertType(i.alertType),r.SeeMoreUrl(i.seeMoreUrl),r}return __extends(i,t),i.MapFrom=function(n,t,r){var u=this.GetFeatureData(n,"Location");return new i({id:this.GetFeatureData(n,"FID"),globalId:this.GetFeatureData(n,"GlobalID"),description:u,road:this.GetFeatureData(n,"Road"),suburb:this.GetFeatureData(n,"Suburb"),region:this.GetFeatureData(n,"Region"),trafficImpact:this.GetFeatureData(n,"TrafficImp"),lastUpdated:this.GetFeatureData(n,"UpdateDate",!0),googleFeature:n,parentFeaturePointGroup:t,startDate:null,endDate:null,type:this.GetFeatureData(n,"IncidentTy"),location:u},{alertType:r,seeMoreUrl:this.GetUrlFeatureData(n,"SeeMoreUrl")})},i.InfoWindow=function(t,i){i===void 0&&(i=!1);var u=[t.Road(),t.Suburb()].filter(function(n){return n}).join(", "),f=t.SeeMoreUrl()?'<div class="row infowindow-row">\n                            <div class="col-xs-12 infowindow-value"><a target="_blank" href="'+t.SeeMoreUrl()+'">Find out more<\/a><\/div>\n                        <\/div>':"",e=i?"":'<div class="row infowindow-row copyLinkWrapper">                                                        \n                            <div class="col-xs-12 infowindow-value copyLinkTextDiv"><span class="copyLinkText"><\/span> <span class="text-success copiedText">Copied!<\/span><\/div>\n                            <div class="col-xs-12 infowindow-value text-success">\n                                <button class="btn btn-primary copyBtn">Copy Link<\/button>\n                            <\/div>\n                        <\/div>',r=t.GetProperties();return r.AlertType=t.AlertType(),n.AppInsightsService.TrackEvent("Mrwa.Models.Incident.InfoWindow",r),$('<div class="custom-content">\n                    <div class="custom-header">\n                        <div class="custom-header-btns">\n                            <div class="font-btn font-dec">-<\/div>\n                            <div class="font-btn font-inc">+<\/div>\n                        <\/div>\n                        <img align="left" src="'+t.ParentFeaturePointGroup().IconCircleUrl()+'" class="infobox-icon img-responsive"/>\n                        <div class="header">\n                            <div class="headerText">'+t.Type()+'<\/div>\n                            <div class="headerSmall">'+u+'<\/div>\n                        <\/div>\n                    <\/div>\n                    <div class="custom-body">\n                        <div class="row infowindow-row">\n                            <div class="col-xs-12 infowindow-value">'+t.Location()+'<\/div>\n                        <\/div>\n                        <div class="row infowindow-row">\n                            <div class="col-xs-12 infowindow-value">'+t.TrafficImpact()+"<\/div>\n                        <\/div>\n                        "+f+"\n                        "+e+'\n                        <div class="row infowindow-row-last">\n                            <div class="col-xs-12 popupBtn">\n                                '+(i?"":'<button class="btn btn-primary share">Share&nbsp;<i class="fa fa-share-alt"><\/i><\/button>')+'\n                                <button class="btn btn-primary '+(i?"map":"zoom")+'">'+(i?"View on Map":"Zoom")+'&nbsp;<i class="fa fa-'+(i?"map":"search")+'"><\/i><\/button>\n                            <\/div>\n                        <\/div>\n                    <\/div>\n                    <div class="custom-footer">\n                        No condition change since '+(t.LastUpdated()!=null?t.LastUpdated().format("hh:mm a ddd, DD MMMM YYYY"):"")+"\n                    <\/div>\n                <\/div>")[0]},i}(t.Feature);t.Incident=i})(t=n.Models||(n.Models={}))}(Mrwa||(Mrwa={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var i=function(t){function i(n,i){var r=t.call(this,n)||this;return r.Intersection=ko.observable(""),r.Status=ko.observable(""),r.Intersection(i.intersection),r.Status(i.status),r}return __extends(i,t),i.MapFrom=function(n,t){var r=this.GetFeatureData(n,"Intersecti");return new i({id:this.GetFeatureData(n,"FID"),globalId:this.GetFeatureData(n,"GlobalID"),description:r,road:this.GetFeatureData(n,"Road"),suburb:this.GetFeatureData(n,"Suburb"),region:this.GetFeatureData(n,"Region"),trafficImpact:null,lastUpdated:this.GetFeatureData(n,"EntryDate",!0),googleFeature:n,parentFeaturePointGroup:t,startDate:null,endDate:null,type:"Traffic Signal Outage",location:null},{intersection:r,status:this.GetFeatureData(n,"SignalStat")})},i.InfoWindow=function(t,i){i===void 0&&(i=!1);var u=i?"":'<div class="row infowindow-row copyLinkWrapper">                                                        \n                            <div class="col-xs-12 infowindow-value copyLinkTextDiv"><span class="copyLinkText"><\/span> <span class="text-success copiedText">Copied!<\/span><\/div>\n                            <div class="col-xs-12 infowindow-value text-success">\n                                <button class="btn btn-primary copyBtn">Copy Link<\/button>\n                            <\/div>\n                        <\/div>',r=t.GetProperties();return r.Intersection=t.Intersection(),r.Status=t.Status(),n.AppInsightsService.TrackEvent("Mrwa.Models.TrafficSignal.InfoWindow",r),$('<div class="custom-content">\n                    <div class="custom-header">\n                        <div class="custom-header-btns">\n                            <div class="font-btn font-dec">-<\/div>\n                            <div class="font-btn font-inc">+<\/div>\n                        <\/div>\n                        <img align="left" src="'+t.ParentFeaturePointGroup().IconCircleUrl()+'" class="infobox-icon img-responsive"/>\n                        <div class="header">\n                            <div class="headerText">'+t.Type()+'<\/div>\n                            <div class="headerSmall">'+t.Intersection()+", "+t.Suburb()+'<\/div>\n                        <\/div>\n                    <\/div>\n                    <div class="custom-body">\n                        <div class="row infowindow-row">\n                            <div class="col-xs-12 infowindow-key">Status<\/div>\n                            <div class="col-xs-12 infowindow-value">'+t.Status()+'<\/div>\n                        <\/div>\n                        <div class="row infowindow-row">\n                            <div class="col-xs-12 infowindow-key">Location<\/div>\n                            <div class="col-xs-12 infowindow-value">'+t.Intersection()+'<\/div>\n                        <\/div>\n                        <div class="row infowindow-row">\n                            <div class="col-xs-12 infowindow-key">Suburb<\/div>\n                            <div class="col-xs-12 infowindow-value">'+t.Suburb()+"<\/div>\n                        <\/div>\n                        "+u+'\n                        <div class="row infowindow-row-last">\n                            <div class="col-xs-12 popupBtn">\n                                '+(i?"":'<button class="btn btn-primary share">Share&nbsp;<i class="fa fa-share-alt"><\/i><\/button>')+'\n                                <button class="btn btn-primary '+(i?"map":"zoom")+'">'+(i?"View on Map":"Zoom")+'&nbsp;<i class="fa fa-'+(i?"map":"search")+'"><\/i><\/button>\n                            <\/div>\n                        <\/div>\n                    <\/div>\n                    <div class="custom-footer">\n                        No condition change since '+(t.LastUpdated()!=null?t.LastUpdated().format("hh:mm a ddd, DD MMMM YYYY"):"")+"\n                    <\/div>\n                <\/div>")[0]},i}(t.Feature);t.TrafficSignal=i})(t=n.Models||(n.Models={}))}(Mrwa||(Mrwa={})),function(n){var t;(function(n){var t=function(){function n(n,t,i){this.Tooltip=ko.observable("");this.ImgAlt=ko.observable("");this.IconImg=ko.observable("");this.Tooltip(n);this.IconImg(t);this.ImgAlt(i)}return n}();n.RestAreaAmenity=t})(t=n.Models||(n.Models={}))}(Mrwa||(Mrwa={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var i=function(i){function r(n,t){var r=i.call(this,n)||this;return r.RestAreaType=ko.observableArray([]),r.RestAreaName=ko.observable(),r.Stay24Hour=ko.observable(),r.HasInfoBoard=ko.observable(),r.HasConstructedShelter=ko.observable(),r.NumberOfBins=ko.observable(),r.NumberOfToilets=ko.observable(),r.HasAccessibleToilets=ko.observable(),r.NumberOfTables=ko.observable(),r.HasAccessibleTables=ko.observable(),r.HasEffluentDumpSite=ko.observable(),r.Amenities=ko.observableArray([]),r.AmenitiesText=ko.observableArray([]),r.ViewableBy=ko.observableArray([]),r.RestAreaName(t.restAreaName),r.Stay24Hour(t.stay24hour),r.HasInfoBoard(t.hasInfoBoard),r.HasConstructedShelter(t.hasConstructedShelter),r.NumberOfBins(t.numberOfBins),r.NumberOfToilets(t.numberOfToilets),r.HasAccessibleToilets(t.hasAccessibleToilets),r.NumberOfTables(t.numberOfTables),r.HasAccessibleTables(t.hasAccessibleTables),r.HasEffluentDumpSite(t.hasEffluentDumpSite),r}return __extends(r,i),r.prototype.AddViewable=function(t){this.ViewableBy.indexOf(t)<0&&(this.ViewableBy.push(t),this.IsVisible()===!1&&(n.ArcGisService.getInstance().DataLayerCluster().add(this.GoogleFeature()),this.IsVisible(!0)))},r.prototype.RemoveViewable=function(t){this.ViewableBy.remove(t);this.ViewableBy().length===0&&(n.ArcGisService.getInstance().DataLayerCluster().remove(this.GoogleFeature()),this.IsVisible(!1))},r.GetAllAmenities=function(i){var r=[];return i.RestAreaType().indexOf(n.Enums.RestAreaTypes.OvernightStopping)>=0&&r.push(new t.RestAreaAmenity("24 Hr Rest Area","24HourRestArea-Circle.svg","24 Hr Rest Area")),i.RestAreaType().indexOf(n.Enums.RestAreaTypes.Bin)>=0&&r.push(new t.RestAreaAmenity("Bins are present","Bins-Circle.svg","Bin")),i.RestAreaType().indexOf(n.Enums.RestAreaTypes.InformationBay)>=0&&r.push(new t.RestAreaAmenity("An information board is present","Information-Circle.svg","Information Board")),i.NumberOfTables()>0&&r.push(new t.RestAreaAmenity("A table is present","PicnicArea-Circle.svg","Tables")),i.RestAreaType().indexOf(n.Enums.RestAreaTypes.AccessibleToilets)>=0&&r.push(new t.RestAreaAmenity("An accessible toilet is present","AccessibleToilets-Circle.svg","Accessible Toilet")),i.RestAreaType().indexOf(n.Enums.RestAreaTypes.Toilets)>=0&&r.push(new t.RestAreaAmenity("A toilet is present","Toilets-Circle.svg","Toilet")),i.RestAreaType().indexOf(n.Enums.RestAreaTypes.Roadhouse)>=0&&r.push(new t.RestAreaAmenity("Roadhouse","Roadhouse-Circle.svg","Roadhouse")),i.RestAreaType().indexOf(n.Enums.RestAreaTypes.EffluentDumpSite)>=0&&r.push(new t.RestAreaAmenity("Effluent Dump Site","EffluentDumpSite-Circle.svg","Effluent Dump Site")),i.RestAreaType().indexOf(n.Enums.RestAreaTypes.LightVehicleParking)>=0&&r.push(new t.RestAreaAmenity("Light Vehicle Parking","LightVehicle-Circle.svg","Light Vehicle Parking")),i.RestAreaType().indexOf(n.Enums.RestAreaTypes.HeavyVehicleParking)>=0&&r.push(new t.RestAreaAmenity("Heavy Vehicle Parking","HeavyVehicle-Circle.svg","Heavy Vehicle Parking")),r},r.MapFrom=function(n,i){var f=t.Feature.GetFeatureData(n,"COMMON_USAGE_NAME"),e=t.Feature.GetFeatureData(n,"REST_AREA_TYPE"),u=new r({id:t.Feature.GetFeatureData(n,"OBJECTID"),globalId:t.Feature.GetFeatureData(n,"OBJECTID"),description:e+" - "+f,road:f,suburb:t.Feature.GetFeatureData(n,"LG_NAME"),region:t.Feature.GetFeatureData(n,"RA_NAME"),trafficImpact:null,lastUpdated:t.Feature.GetFeatureData(n,"EntryDate",!0),googleFeature:n,parentFeaturePointGroup:i,startDate:null,endDate:null,type:e,location:null},{restAreaName:t.Feature.GetFeatureData(n,"REST_AREA_NAME"),stay24hour:t.Feature.GetFeatureData(n,"STAY_24_HOUR")==="Yes",hasInfoBoard:t.Feature.GetFeatureData(n,"INFORMATION_BOARD")==="Yes",hasConstructedShelter:t.Feature.GetFeatureData(n,"CONSTRUCTED_SHELTER")==="Yes",numberOfBins:t.Feature.GetFeatureData(n,"NUMBER_OF_BINS"),numberOfToilets:t.Feature.GetFeatureData(n,"NUMBER_OF_TOILETS"),hasAccessibleToilets:t.Feature.GetFeatureData(n,"ACCESSIBLE_TOILETS")==="Yes",numberOfTables:t.Feature.GetFeatureData(n,"NUMBER_OF_TABLES"),hasAccessibleTables:t.Feature.GetFeatureData(n,"ACCESSIBLE_TABLES")==="Yes",hasEffluentDumpSite:t.Feature.GetFeatureData(n,"EFFLUENT_DUMP_SITE")==="Yes"}),o;return u.RestAreaType(r.GetRestAreaType(u)),u.Amenities(r.GetAllAmenities(u)),o=$.map(u.Amenities(),function(n){return n.Tooltip()}),u.AmenitiesText(o),u},r.GetRestAreaType=function(t){var i=[];return t.Stay24Hour()&&i.push(n.Enums.RestAreaTypes.OvernightStopping),t.Type()==="Minor Rest Area"&&i.push(n.Enums.RestAreaTypes.LightVehicleParking),t.NumberOfToilets()>0&&t.HasAccessibleToilets()&&i.push(n.Enums.RestAreaTypes.AccessibleToilets),t.NumberOfToilets()>0&&i.push(n.Enums.RestAreaTypes.Toilets),t.Type()==="Heavy Vehicle Rest Area"&&i.push(n.Enums.RestAreaTypes.HeavyVehicleParking),t.HasInfoBoard()&&i.push(n.Enums.RestAreaTypes.InformationBay),(t.NumberOfTables()>0||t.HasConstructedShelter())&&i.push(n.Enums.RestAreaTypes.PicnicFacilities),t.Type()==="Roadhouse"&&i.push(n.Enums.RestAreaTypes.Roadhouse),t.HasEffluentDumpSite()&&i.push(n.Enums.RestAreaTypes.EffluentDumpSite),t.NumberOfBins()>0&&i.push(n.Enums.RestAreaTypes.Bin),i.length===0&&i.push(n.Enums.RestAreaTypes.Other),i},r.InfoWindowAmenityNames=function(t){var i="<div class='amenContainer'>";return $.each(t,function(t,r){var u='<div class="amenItem"><img src=\''+n.Settings.SiteRelativePath+"Content/images/RestAreaIcons/"+r.IconImg()+"' alt='"+r.ImgAlt()+'\' class=\'amenity-icon\' data-toggle="tooltip" data-placement="bottom" data-container="body" title=\''+r.Tooltip()+"' /> "+r.ImgAlt()+"<\/div>";i+=u}),i+="<\/div>"},r.InfoWindow=function(t,i){i===void 0&&(i=!1);var f=t.Amenities().length<=0?"No amenities at this "+t.Type():"",e=[t.Road(),t.Suburb()].filter(function(n){return n}).join(", "),o=t.RestAreaName()!=null?t.RestAreaName():"Rest Area",s=i?"":'<div class="row infowindow-row copyLinkWrapper">                                                        \n                            <div class="col-xs-12 infowindow-value copyLinkTextDiv"><span class="copyLinkText"><\/span> <span class="text-success copiedText">Copied!<\/span><\/div>\n                            <div class="col-xs-12 infowindow-value text-success">\n                                <button class="btn btn-primary copyBtn">Copy Link<\/button>\n                            <\/div>\n                        <\/div>',u=t.GetProperties();return u.Type=t.Type(),u.RestAreaName=t.RestAreaName(),n.AppInsightsService.TrackEvent("Mrwa.Models.RestArea.InfoWindow",u),$('<div class="custom-content">\n                    <div class="custom-header">\n                        <div class="custom-header-btns">\n                            <div class="font-btn font-dec">-<\/div>\n                            <div class="font-btn font-inc">+<\/div>\n                        <\/div>\n                        <img align="left" src="'+t.ParentFeaturePointGroup().IconCircleUrl()+'" class="infobox-icon img-responsive"/>\n                        <div class="header">\n                            <div class="headerText">'+o+'<\/div>\n                            <div class="headerSmall">'+e+'<\/div>\n                        <\/div>\n                    <\/div>\n                    <div class="custom-body">\n                        <div class="row infowindow-row">\n                            <div class="col-xs-12 infowindow-key">Amenities<\/div>\n                            <div class="col-xs-12 infowindow-value">'+r.InfoWindowAmenityNames(t.Amenities())+"<\/div>\n                        <\/div>\n                        "+f+"\n                        "+s+'\n                        <div class="row infowindow-row-last">\n                            <div class="col-xs-12 popupBtn">\n                                '+(i?"":'<button class="btn btn-primary share">Share&nbsp;<i class="fa fa-share-alt"><\/i><\/button>')+'\n                                <button class="btn btn-primary '+(i?"map":"zoom")+'">'+(i?"View on Map":"Zoom")+'&nbsp;<i class="fa fa-'+(i?"map":"search")+'"><\/i><\/button>\n                            <\/div>\n                        <\/div>\n                    <\/div>\n                <\/div>')[0]},r}(t.Feature);t.RestArea=i})(t=n.Models||(n.Models={}))}(Mrwa||(Mrwa={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var i=function(t){function i(n,i){var r=t.call(this,n)||this;return r.SeeMoreName=ko.observable(""),r.SeeMoreUrl=ko.observable(""),r.SeeMoreName(i.seeMoreName),r.SeeMoreUrl(i.seeMoreUrl),r}return __extends(i,t),i.MapFrom=function(n,t){return new i({id:this.GetFeatureData(n,"FID"),globalId:this.GetFeatureData(n,"GlobalID"),description:this.GetFeatureData(n,"Descriptio"),road:this.GetFeatureData(n,"Road"),suburb:this.GetFeatureData(n,"Suburb"),region:this.GetFeatureData(n,"Region"),trafficImpact:this.GetFeatureData(n,"TrafficImp"),lastUpdated:this.GetFeatureData(n,"EntryDate",!0),googleFeature:n,parentFeaturePointGroup:t,startDate:this.GetFeatureData(n,"DateStarte",!0),endDate:this.GetFeatureData(n,"EstimatedC",!0),type:this.GetFeatureData(n,"WorkType"),location:null},{seeMoreName:this.GetFeatureData(n,"SeeMoreName"),seeMoreUrl:this.GetUrlFeatureData(n,"SeeMoreUrl")})},i.InfoWindow=function(t,i){i===void 0&&(i=!1);var f=[t.Road(),t.Suburb()].filter(function(n){return n}).join(", "),r=t.StartDate(),u=t.EndDate(),e=r!=null?r.format("hh:mm a"):"No data",o=u!=null?u.format("hh:mm a"):"No data",s=r!=null?r.format("ddd, DD MMM YYYY"):"No data",h=u!=null?u.format("ddd, DD MMM YYYY"):"No data",c=t.SeeMoreUrl()?'<div class="row infowindow-row">\n                            <div class="col-xs-12 infowindow-value"><a target="_blank" href="'+t.SeeMoreUrl()+'">Find out more<\/a><\/div>\n                        <\/div>':"",l=i?"":'<div class="row infowindow-row copyLinkWrapper">                                                        \n                            <div class="col-xs-12 infowindow-value copyLinkTextDiv"><span class="copyLinkText"><\/span> <span class="text-success copiedText">Copied!<\/span><\/div>\n                            <div class="col-xs-12 infowindow-value text-success">\n                                <button class="btn btn-primary copyBtn">Copy Link<\/button>\n                            <\/div>\n                        <\/div>',a=t.GetProperties();return n.AppInsightsService.TrackEvent("Mrwa.Models.RoadWork.InfoWindow",a),$('<div class="custom-content">\n                    <div class="custom-header">\n                        <div class="custom-header-btns">\n                            <div class="font-btn font-dec">-<\/div>\n                            <div class="font-btn font-inc">+<\/div>\n                        <\/div>\n                        <img align="left" src="'+t.ParentFeaturePointGroup().IconCircleUrl()+'" class="infobox-icon img-responsive"/>\n                        <div class="header">\n                            <div class="headerText">'+t.Type()+'<\/div>\n                            <div class="headerSmall">'+f+'<\/div>\n                        <\/div>\n                    <\/div>\n                    <div class="custom-body">\n                        <div class="row">\n                            <div class="col-xs-6 infowindow-key">From <span>'+e+'<\/span><\/div>\n                            <div class="col-xs-6 infowindow-key">To <span>'+o+'<\/span><\/div>\n                        <\/div>\n                        <div class="row infowindow-row">\n                            <div class="col-xs-6 infowindow-value">'+s+'<\/div>\n                            <div class="col-xs-6 infowindow-value">'+h+'<\/div>\n                        <\/div>\n                        <div class="row infowindow-row">\n                            <div class="col-xs-12 infowindow-value">'+t.Description()+'<\/div>\n                        <\/div>\n                        <div class="row infowindow-row">\n                            <div class="col-xs-12 infowindow-value">'+t.TrafficImpact()+"<\/div>\n                        <\/div>\n                        "+c+"\n                        "+l+'\n                        <div class="row infowindow-row-last">\n                            <div class="col-xs-12 popupBtn">\n                                '+(i?"":'<button class="btn btn-primary share">Share&nbsp;<i class="fa fa-share-alt"><\/i><\/button>')+'\n                                <button class="btn btn-primary '+(i?"map":"zoom")+'">'+(i?"View on Map":"Zoom")+'&nbsp;<i class="fa fa-'+(i?"map":"search")+'"><\/i><\/button>\n                            <\/div>\n                        <\/div>\n                    <\/div>\n                    <div class="custom-footer">\n                        Last updated '+(t.LastUpdated()!=null?t.LastUpdated().format("hh:mm a ddd, DD MMMM YYYY"):"")+"\n                    <\/div>\n                <\/div>")[0]},i}(t.Feature);t.RoadWork=i})(t=n.Models||(n.Models={}))}(Mrwa||(Mrwa={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var i=function(t){function i(n,i){var r=t.call(this,n)||this;return r.EventDetails=ko.observable(""),r.SeeMoreName=ko.observable(""),r.SeeMoreUrl=ko.observable(""),r.EventDetails(i.eventDetails),r.SeeMoreName(i.seeMoreName),r.SeeMoreUrl(i.seeMoreUrl),r}return __extends(i,t),i.MapFrom=function(n,t){return new i({id:this.GetFeatureData(n,"FID"),globalId:this.GetFeatureData(n,"GlobalID"),description:this.GetFeatureData(n,"EventName"),road:this.GetFeatureData(n,"LocalRoadN"),suburb:this.GetFeatureData(n,"Suburb"),region:this.GetFeatureData(n,"Region"),trafficImpact:this.GetFeatureData(n,"TrafficImp"),lastUpdated:this.GetFeatureData(n,"EntryDate",!0),googleFeature:n,parentFeaturePointGroup:t,startDate:this.GetFeatureData(n,"DateTimeSt",!0),endDate:this.GetFeatureData(n,"DateTimeEn",!0),type:this.GetFeatureData(n,"EventType"),location:null},{eventDetails:this.GetFeatureData(n,"EventDescr"),seeMoreName:this.GetFeatureData(n,"SeeMoreName"),seeMoreUrl:this.GetUrlFeatureData(n,"SeeMoreUrl")})},i.InfoWindow=function(t,i){i===void 0&&(i=!1);var e=[t.Road(),t.Suburb()].filter(function(n){return n}).join(", "),r=t.StartDate(),u=t.EndDate(),o=r!=null?r.format("hh:mm a"):"No data",s=u!=null?u.format("hh:mm a"):"No data",h=r!=null?r.format("ddd, DD MMM YYYY"):"No data",c=u!=null?u.format("ddd, DD MMM YYYY"):"No data",l=t.SeeMoreUrl()?'<div class="row infowindow-row">\n                            <div class="col-xs-12 infowindow-value"><a target="_blank" href="'+t.SeeMoreUrl()+'">Find out more<\/a><\/div>\n                        <\/div>':"",a=i?"":'<div class="row infowindow-row copyLinkWrapper">                                                        \n                            <div class="col-xs-12 infowindow-value copyLinkTextDiv"><span class="copyLinkText"><\/span> <span class="text-success copiedText">Copied!<\/span><\/div>\n                            <div class="col-xs-12 infowindow-value text-success">\n                                <button class="btn btn-primary copyBtn">Copy Link<\/button>\n                            <\/div>\n                        <\/div>',f=t.GetProperties();return f.EventDetails=t.EventDetails(),n.AppInsightsService.TrackEvent("Mrwa.Models.Event.InfoWindow",f),$('<div class="custom-content">\n                    <div class="custom-header">\n                        <div class="custom-header-btns">\n                            <div class="font-btn font-dec">-<\/div>\n                            <div class="font-btn font-inc">+<\/div>\n                        <\/div>\n                        <img align="left" src="'+t.ParentFeaturePointGroup().IconCircleUrl()+'" class="infobox-icon img-responsive"/>\n                        <div class="header">\n                            <div class="headerText">'+t.Description()+'<\/div>\n                            <div class="headerSmall">'+e+'<\/div>\n                        <\/div>\n                    <\/div>\n                    <div class="custom-body">\n                       <div class="row">\n                            <div class="col-xs-6 infowindow-key">From <span>'+o+'<\/span><\/div>\n                            <div class="col-xs-6 infowindow-key">To <span>'+s+'<\/span><\/div>\n                        <\/div>\n                        <div class="row infowindow-row">\n                            <div class="col-xs-6 infowindow-value">'+h+'<\/div>\n                            <div class="col-xs-6 infowindow-value">'+c+'<\/div>\n                        <\/div>\n                        <div class="row infowindow-row">\n                            <div class="col-xs-12 infowindow-value">'+t.EventDetails()+"<\/div>\n                        <\/div>\n                        "+l+"\n                        "+a+'\n                        <div class="row infowindow-row-last">\n                            <div class="col-xs-12 popupBtn">\n                                '+(i?"":'<button class="btn btn-primary share">Share&nbsp;<i class="fa fa-share-alt"><\/i><\/button>')+'\n                                <button class="btn btn-primary '+(i?"map":"zoom")+'">'+(i?"View on Map":"Zoom")+'&nbsp;<i class="fa fa-'+(i?"map":"search")+'"><\/i><\/button>\n                            <\/div>\n                        <\/div>\n                    <\/div>\n                    <div class="custom-footer">\n                        Last updated '+(t.LastUpdated()!=null?t.LastUpdated().format("hh:mm a ddd, DD MMMM YYYY"):"")+"\n                    <\/div>\n                <\/div>")[0]},i}(t.Feature);t.Event=i})(t=n.Models||(n.Models={}))}(Mrwa||(Mrwa={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var i=function(t){function i(n,i){var r=t.call(this,n)||this;return r.Direction=ko.observable(""),r.ImageUrl=ko.observable(""),r.CameraOffline=ko.observable(!1),r.Direction(i.direction),r.ImageUrl(i.imageUrl),r}return __extends(i,t),i.MapFrom=function(n,t){var r={},u;return r.N="North",r.S="South",r.E="East",r.W="West",r.NE="North East",r.NW="North West",r.SE="South East",r.SW="South West",u=new i({id:this.GetFeatureData(n,"OBJECTID"),globalId:this.GetFeatureData(n,"OBJECTID"),description:this.GetFeatureData(n,"Title"),road:this.GetFeatureData(n,"Road"),suburb:this.GetFeatureData(n,"Suburb"),region:this.GetFeatureData(n,"Region"),trafficImpact:null,lastUpdated:this.GetFeatureData(n,"LastUpdated",!0,null),googleFeature:n,parentFeaturePointGroup:t,startDate:null,endDate:null,type:"Camera",location:null},{direction:r[this.GetFeatureData(n,"Direction")],imageUrl:this.GetFeatureData(n,"camerahref")}),(u.LastUpdated()==null||moment().diff(moment(u.LastUpdated().format("hh:mm a ddd, DD MMMM YYYY"),"hh:mm a ddd, DD MMMM YYYY"),"minutes")>15)&&u.CameraOffline(!0),u},i.InfoWindow=function(t,i){i===void 0&&(i=!1);var f=[t.Road(),t.Suburb()].filter(function(n){return n}).join(", "),r=t.CameraOffline(),e=r?"camera-offline":"camera-online",o=r?"text-danger":"text-success",s=r?"../Content/images/camera_off_image.svg":t.ImageUrl(),h=r?"Camera Offline":t.Description(),c=r?"Camera Offline":"Camera Online",l=t.LastUpdated()!=null?t.LastUpdated().format("hh:mm a ddd, DD MMMM YYYY"):"",a=i?"":'<div class="row infowindow-row copyLinkWrapper">                                                        \n                            <div class="col-xs-12 infowindow-value copyLinkTextDiv"><span class="copyLinkText"><\/span> <span class="text-success copiedText">Copied!<\/span><\/div>\n                            <div class="col-xs-12 infowindow-value text-success">\n                                <button class="btn btn-primary copyBtn">Copy Link<\/button>\n                            <\/div>\n                        <\/div>',u=t.GetProperties();return u.IsCamOffline=r,u.Direction=t.Direction(),u.ImageUrl=t.ImageUrl(),n.AppInsightsService.TrackEvent("Mrwa.Models.Camera.InfoWindow",u),$('<div class="custom-content">\n                    <div class="custom-header">\n                        <div class="custom-header-btns">\n                            <div class="font-btn font-dec">-<\/div>\n                            <div class="font-btn font-inc">+<\/div>\n                        <\/div>\n                        <img align="left" src="'+t.ParentFeaturePointGroup().IconCircleUrl()+'" class="infobox-icon img-responsive"/>\n                        <div class="header">\n                            <div class="headerText">'+t.Type()+'<\/div>\n                            <div class="headerSmall">'+f+'<\/div>\n                        <\/div>\n                    <\/div>\n                    <div class="custom-body">\n                        <div class="row infowindow-row">\n                            <div class="col-xs-12">\n                                <img class=\'img-responsive '+e+"' src='"+s+"' alt='"+h+'\' />\n                            <\/div>\n                        <\/div>\n                        <div class="row infowindow-row">\n                            <div class="col-xs-12 infowindow-key '+o+'"><i class="fa fa-circle"><\/i> '+c+'<\/div>\n                        <\/div>\n                        <div class="row infowindow-row">\n                            <div class="col-xs-12 infowindow-key">Direction <span>'+t.Direction()+"<\/span><\/div>\n                        <\/div>  \n                        "+a+'\n                        <div class="row infowindow-row-last">\n                            <div class="col-xs-12 popupBtn">\n                                '+(i?"":'<button class="btn btn-primary share">Share&nbsp;<i class="fa fa-share-alt"><\/i><\/button>')+'\n                                <button class="btn btn-primary '+(i?"map":"zoom")+'">'+(i?"View on Map":"Zoom")+'&nbsp;<i class="fa fa-'+(i?"map":"search")+'"><\/i><\/button>\n                            <\/div>\n                        <\/div>\n                    <\/div>\n                    <div class="custom-footer">\n                        Last updated '+l+"\n                    <\/div>\n                <\/div>")[0]},i}(t.Feature);t.Camera=i})(t=n.Models||(n.Models={}))}(Mrwa||(Mrwa={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var i=function(t){function i(n,i){var r=t.call(this,n)||this;return r.RoadClosureType=ko.observable(),r.SeeMoreUrl=ko.observable(""),r.RoadClosureType(i.roadClosureType),r.SeeMoreUrl(i.seeMoreUrl),r}return __extends(i,t),i.MapFrom=function(n,t,r){var u=this.GetFeatureData(n,"Location");return new i({id:this.GetFeatureData(n,"FID"),description:u,road:this.GetFeatureData(n,"Road"),suburb:this.GetFeatureData(n,"Suburb"),region:this.GetFeatureData(n,"Region"),trafficImpact:this.GetFeatureData(n,"TrafficImp"),lastUpdated:this.GetFeatureData(n,"UpdateDate",!0),googleFeature:n,parentFeatureLineGroup:t,startDate:null,endDate:null,type:this.GetFeatureData(n,"IncidentTy"),location:u},{roadClosureType:r,seeMoreUrl:this.GetUrlFeatureData(n,"SeeMoreUrl")})},i.InfoWindow=function(t){var r=[t.Road(),t.Suburb()].filter(function(n){return n}).join(", "),u=t.SeeMoreUrl()?'<div class="row infowindow-row">\n                            <div class="col-xs-12 infowindow-value"><a target="_blank" href="'+t.SeeMoreUrl()+'">Find out more<\/a><\/div>\n                        <\/div>':"",i=t.GetProperties();return i.RoadClosureType=t.RoadClosureType(),n.AppInsightsService.TrackEvent("Mrwa.Models.RoadClosureLine.InfoWindow",i),$('<div class="custom-content">\n                    <div class="custom-header">\n                        <div class="custom-header-btns">\n                            <div class="font-btn font-dec">-<\/div>\n                            <div class="font-btn font-inc">+<\/div>\n                        <\/div>\n                        <img align="left" src="'+t.ParentFeatureLineGroup().IconCircleUrl()+'" class="infobox-icon img-responsive"/>\n                        <div class="header">\n                            <div class="headerText">'+t.Type()+'<\/div>\n                            <div class="headerSmall">'+r+'<\/div>\n                        <\/div>\n                    <\/div>\n                    <div class="custom-body">\n                        <div class="row infowindow-row">\n                            <div class="col-xs-12 infowindow-value">'+t.Location()+'<\/div>\n                        <\/div>\n                        <div class="row infowindow-row">\n                            <div class="col-xs-12 infowindow-value">'+t.TrafficImpact()+"<\/div>\n                        <\/div>\n                        "+u+'\n                        <div class="row infowindow-row copyLinkWrapper">                                                        \n                            <div class="col-xs-12 infowindow-value copyLinkTextDiv"><span class="copyLinkText"><\/span> <span class="text-success copiedText">Copied!<\/span><\/div>\n                            <div class="col-xs-12 infowindow-value text-success">\n                                <button class="btn btn-primary copyBtn">Copy Link<\/button>\n                            <\/div>\n                        <\/div>\n                        <div class="row infowindow-row-last">\n                            <div class="col-xs-12 popupBtn">\n                                <button class="btn btn-primary share">Share&nbsp;<i class="fa fa-share-alt"><\/i><\/button>\n                                <button class="btn btn-primary zoom">Zoom&nbsp;<i class="fa fa-search"><\/i><\/button>\n                            <\/div>\n                        <\/div>\n                    <\/div>\n                    <div class="custom-footer">\n                        No condition change since '+(t.LastUpdated()!=null?t.LastUpdated().format("hh:mm a ddd, DD MMMM YYYY"):"")+"\n                    <\/div>\n                <\/div>")[0]},i}(t.LineFeature);t.RoadClosureLine=i})(t=n.Models||(n.Models={}))}(Mrwa||(Mrwa={})),function(n){var t;(function(t){var i=function(){function i(t){var i=this;this.LayerId=ko.observable();this.LayerName=ko.observable("");this.DisplayName=ko.observable("");this.Type=ko.observable();this.IconUrl=ko.observable("");this.IconCircleUrl=ko.observable("");this.Features=ko.observableArray([]);this.IsAllFeaturesVisible=ko.observable(!0);this.IsOpen=ko.observable(!1);this.ExpandByDefault=ko.observable(!1);this.DisplayOrder=ko.observable(0);this.IsDateFilterable=ko.observable(!1);this.ShowOnRoute=ko.observable(!1);this.HasLastUpdatedTime=ko.observable(!1);this.CanHide=ko.observable(!0);this.HideByDefault=ko.observable(!0);this.UseMrwa=ko.observable(!1);this.EnableCaching=ko.observable(!0);this.CacheDurationSec=ko.observable(120);this.NumVisibleFeatures=ko.pureComputed(function(){return $.grep(i.Features(),function(n){return n.IsVisible()}).length});this.DisplayStatus=ko.pureComputed(function(){if(i.Features().length===0)switch(i.Type()){case n.Enums.FeaturePointGroupTypes.Alerts:return"No current alerts";case n.Enums.FeaturePointGroupTypes.TrafficSignalOutages:return"No current traffic signal outages";case n.Enums.FeaturePointGroupTypes.Roadworks:return"No current roadworks";case n.Enums.FeaturePointGroupTypes.Events:return"No current events";case n.Enums.FeaturePointGroupTypes.ClosedRoadPoints:return"No current closed roads";case n.Enums.FeaturePointGroupTypes.DetourPoints:return"No current detours";case n.Enums.FeaturePointGroupTypes.RoadsOpenedWithVehicleRestrictionPoints:return"No current specific vehicle restrictions on roads";case n.Enums.FeaturePointGroupTypes.RoadsOpenedWithConditionPoints:return"No current cautions on roads";default:return"none to display"}return"Displaying "+i.NumVisibleFeatures()+" of "+i.Features().length});this.IconUrlPng=ko.pureComputed(function(){return i.IconUrl().replace(".svg",".png")});this.filteredFeatures=ko.observableArray([]);this.LayerId(t.id);this.LayerName(t.name);this.DisplayName(t.displayName);this.IconUrl(t.iconUrl);this.IconCircleUrl(t.iconCircleUrl);this.ExpandByDefault(t.expandByDefault);this.IsOpen(t.expandByDefault);this.DisplayOrder(t.displayOrder);this.IsDateFilterable(t.isDateFilterable);this.ShowOnRoute(t.showOnRoute);this.HasLastUpdatedTime(t.hasLastUpdatedTime);this.Type(t.type);this.CanHide(t.canHide);this.HideByDefault(t.hideByDefault);this.UseMrwa(t.useMrwa);this.EnableCaching(t.enableCaching);this.CacheDurationSec(t.cacheDurationSec)}return i.prototype.LoadFeatures=function(){var t=this;this.Features.removeAll();n.ArcGisService.getInstance().DataLayerCluster().forEach(function(i){var r,u;i.getProperty("FeaturePointGroupType")===t.Type()&&(r=t.getMrwaFeature(i),r.ParentFeaturePointGroup().Type()!==n.Enums.FeaturePointGroupTypes.TrafficSignalOutages||(u=r,u.Status()!=="Dwell"&&u.Status()!=="On Generator"&&u.Status()!=="Normal"&&u.Status()!=="Not Functioning"))&&(r.Region()==null||r.Region().toLowerCase()!=="toc")&&t.Features.push(r)});this.HasLastUpdatedTime()&&this.Features.sort(function(n,t){return moment.utc(t.LastUpdated()).diff(moment.utc(n.LastUpdated()))})},i.prototype.GetAllVisibleFeatures=function(){return $.grep(this.Features(),function(n){return n.IsVisible()})},i.prototype.ShowHideAllFeatures=function(t,i){var r=this;this.IsAllFeaturesVisible(!this.IsAllFeaturesVisible());$.each(this.Features(),function(t,i){var u,f;r.IsAllFeaturesVisible()?(r.Type()===n.Enums.FeaturePointGroupTypes.RestArea?(u=i,u.RestAreaType().forEach(function(t){t!==n.Enums.RestAreaTypes.Other&&u.AddViewable(t)})):i.RemoveFilter(n.Enums.FilteredBy.FeatureGroup),r.filteredFeatures.remove(i)):(r.Type()===n.Enums.FeaturePointGroupTypes.RestArea?(f=i,f.RestAreaType().forEach(function(n){f.RemoveViewable(n)})):i.AddFilter(n.Enums.FilteredBy.FeatureGroup),r.filteredFeatures().indexOf(i)<0&&r.filteredFeatures.push(i))});n.ArcGisService.getInstance().DataLayerCluster().redraw();i!=null&&i.stopPropagation()},i.prototype.ShowAllFeatures=function(){var t=this;this.IsAllFeaturesVisible(!0);$.each(this.Features(),function(i,r){r.RemoveFilter(n.Enums.FilteredBy.FeatureGroup);t.filteredFeatures.remove(r)});event!=null&&event.stopPropagation();n.ArcGisService.getInstance().DataLayerCluster().redraw()},i.prototype.HideAllFeatures=function(){var t=this;this.IsAllFeaturesVisible(!1);$.each(this.Features(),function(i,r){r.AddFilter(n.Enums.FilteredBy.FeatureGroup);t.filteredFeatures().indexOf(r)<0&&t.filteredFeatures.push(r)});event!=null&&event.stopPropagation();n.ArcGisService.getInstance().DataLayerCluster().redraw()},i.prototype.ToggleCollapsable=function(){this.NumVisibleFeatures()!==0&&(this.IsOpen()?($("#"+this.LayerName()+"Cluster").collapse("hide"),this.IsOpen(!1)):($("#"+this.LayerName()+"Cluster").collapse("show"),this.IsOpen(!0)))},i.prototype.GetFeatureById=function(n){var t=this.Features().filter(function(t){return t.Id()===n});if(t.length>0)return t[0]},i.prototype.GetInfoWindowFor=function(i){var r,u,f,e,o,s;switch(this.Type()){case n.Enums.FeaturePointGroupTypes.Alerts:case n.Enums.FeaturePointGroupTypes.DetourPoints:case n.Enums.FeaturePointGroupTypes.ClosedRoadPoints:case n.Enums.FeaturePointGroupTypes.RoadsOpenedWithVehicleRestrictionPoints:case n.Enums.FeaturePointGroupTypes.RoadsOpenedWithConditionPoints:return r=this.GetFeatureById(i.getProperty("FID")),t.Incident.InfoWindow(r);case n.Enums.FeaturePointGroupTypes.TrafficSignalOutages:return u=this.GetFeatureById(i.getProperty("FID")),t.TrafficSignal.InfoWindow(u);case n.Enums.FeaturePointGroupTypes.RestArea:return f=this.GetFeatureById(i.getProperty("OBJECTID")),t.RestArea.InfoWindow(f);case n.Enums.FeaturePointGroupTypes.Events:return e=this.GetFeatureById(i.getProperty("FID")),t.Event.InfoWindow(e);case n.Enums.FeaturePointGroupTypes.Cameras:return o=this.GetFeatureById(i.getProperty("OBJECTID")),t.Camera.InfoWindow(o);case n.Enums.FeaturePointGroupTypes.Roadworks:return s=this.GetFeatureById(i.getProperty("FID")),t.RoadWork.InfoWindow(s);default:return $("<div>Could not identity entity<\/div>")[0]}},i.prototype.getMrwaFeature=function(i){switch(this.Type()){case n.Enums.FeaturePointGroupTypes.Alerts:return t.Incident.MapFrom(i,this,n.Enums.AlertTypes.Alert);case n.Enums.FeaturePointGroupTypes.DetourPoints:return t.Incident.MapFrom(i,this,n.Enums.AlertTypes.Detour);case n.Enums.FeaturePointGroupTypes.ClosedRoadPoints:return t.Incident.MapFrom(i,this,n.Enums.AlertTypes.Closed);case n.Enums.FeaturePointGroupTypes.RoadsOpenedWithVehicleRestrictionPoints:return t.Incident.MapFrom(i,this,n.Enums.AlertTypes.RestrictedVehicleType);case n.Enums.FeaturePointGroupTypes.RoadsOpenedWithConditionPoints:return t.Incident.MapFrom(i,this,n.Enums.AlertTypes.OpenWithConditions);case n.Enums.FeaturePointGroupTypes.TrafficSignalOutages:return t.TrafficSignal.MapFrom(i,this);case n.Enums.FeaturePointGroupTypes.RestArea:return t.RestArea.MapFrom(i,this);case n.Enums.FeaturePointGroupTypes.Roadworks:return t.RoadWork.MapFrom(i,this);case n.Enums.FeaturePointGroupTypes.Events:return t.Event.MapFrom(i,this);case n.Enums.FeaturePointGroupTypes.Cameras:return t.Camera.MapFrom(i,this);default:return null}},i}();t.FeaturePointGroup=i})(t=n.Models||(n.Models={}))}(Mrwa||(Mrwa={})),function(n){var t;(function(t){var i=function(){function i(n){this.LayerId=ko.observable();this.LayerName=ko.observable("");this.DisplayName=ko.observable("");this.Type=ko.observable();this.IconCircleUrl=ko.observable("");this.IconUrl=ko.observable("");this.Features=ko.observableArray([]);this.DisplayOrder=ko.observable(0);this.ShowOnRoute=ko.observable(!1);this.StrokeColour=ko.observable("black");this.EnableCaching=ko.observable(!0);this.CacheDurationSec=ko.observable(120);this.DataLayer=new google.maps.Data;this.LayerId(n.id);this.LayerName(n.name);this.DisplayName(n.displayName);this.IconCircleUrl(n.iconCircleUrl);this.IconUrl(n.iconUrl);this.DisplayOrder(n.displayOrder);this.ShowOnRoute(n.showOnRoute);this.StrokeColour(n.strokeColour);this.Type(n.type);this.EnableCaching(n.enableCaching);this.CacheDurationSec(n.cacheDurationSec)}return i.prototype.LoadFeatures=function(){var n=this;this.Features.removeAll();this.DataLayer.forEach(function(t){var i=n.getMrwaFeature(t);(i.Region()==null||i.Region().toLowerCase()!=="toc")&&n.Features.push(i)})},i.prototype.SetupFeatureLineGroupDataLayer=function(){this.DataLayer.setMap(n.Map.getInstance().GoogleMap);google.maps.event.clearListeners(this.DataLayer,"click");this.DataLayer.addListener("click",function(t){var i,r,u,f;(n.Settings.IsMobile&&n.LeftPanel.getInstance().IsOpen()&&n.LeftPanel.getInstance().Toggle(),i=-1,r=t.feature.getProperty("FeatureLineGroupType"),r===n.Enums.FeatureLineGroupTypes.ClosedRoadLines?i=n.Enums.FeaturePointGroupTypes.ClosedRoadPoints:r===n.Enums.FeatureLineGroupTypes.DetourLines?i=n.Enums.FeaturePointGroupTypes.DetourPoints:r===n.Enums.FeatureLineGroupTypes.RoadsOpenedWithConditionLines?i=n.Enums.FeaturePointGroupTypes.RoadsOpenedWithConditionPoints:r===n.Enums.FeatureLineGroupTypes.RoadsOpenedWithVehicleRestrictionLines&&(i=n.Enums.FeaturePointGroupTypes.RoadsOpenedWithVehicleRestrictionPoints),u=n.ArcGisService.getInstance().GetFeaturePointByTypeAndLocation(i,t.feature.getProperty("Location")),u.IsFeatureInCluster())||(f=n.ArcGisService.getInstance().GetFeatureLineGroupByType(t.feature.getProperty("FeatureLineGroupType")),n.Map.getInstance().ToggleInfoWindowForLineFeature(t,f))})},i.prototype.GetFeatureById=function(n){var t=this.Features().filter(function(t){return t.Id()===n});if(t.length>0)return t[0]},i.prototype.GetInfoWindowFor=function(i){switch(this.Type()){case n.Enums.FeatureLineGroupTypes.ClosedRoadLines:case n.Enums.FeatureLineGroupTypes.RoadsOpenedWithVehicleRestrictionLines:case n.Enums.FeatureLineGroupTypes.RoadsOpenedWithConditionLines:case n.Enums.FeatureLineGroupTypes.DetourLines:var r=this.GetFeatureById(i.getProperty("FID"));return t.RoadClosureLine.InfoWindow(r);default:return $("<div>Could not identity entity<\/div>")[0]}},i.prototype.getMrwaFeature=function(i){switch(this.Type()){case n.Enums.FeatureLineGroupTypes.ClosedRoadLines:return t.RoadClosureLine.MapFrom(i,this,n.Enums.RoadClosureLineTypes.Closed);case n.Enums.FeatureLineGroupTypes.RoadsOpenedWithVehicleRestrictionLines:return t.RoadClosureLine.MapFrom(i,this,n.Enums.RoadClosureLineTypes.RestrictedVehicleType);case n.Enums.FeatureLineGroupTypes.RoadsOpenedWithConditionLines:return t.RoadClosureLine.MapFrom(i,this,n.Enums.RoadClosureLineTypes.OpenWithConditions);case n.Enums.FeatureLineGroupTypes.DetourLines:return t.RoadClosureLine.MapFrom(i,this,n.Enums.RoadClosureLineTypes.Detour);default:return null}},i}();t.FeatureLineGroup=i})(t=n.Models||(n.Models={}))}(Mrwa||(Mrwa={})),function(n){var t=function(){function t(n,t){this.dataLayer=new google.maps.Data;this.Id=n.Id;this.Name=n.Name;this.HighlightQuery=n.HighlightQuery;this.StrokeColour=n.StrokeColour;this.FillColour=n.FillColour;this.featureServerParent=t;this.Name==="Biosecurity Boundaraies"?this.dataLayer.setStyle({clickable:!0,visible:!0,fillColor:this.FillColour,fillOpacity:.2,strokeColor:this.StrokeColour,strokeOpacity:0,strokeWeight:2,zIndex:999}):this.dataLayer.setStyle({clickable:!0,visible:!0,fillColor:this.FillColour,fillOpacity:.3,strokeColor:this.StrokeColour,strokeOpacity:.5,strokeWeight:2})}return t.prototype.Load=function(){var r=this,t,i;n.Settings.CachingIsAvailable()?(t=this.Name+"-"+this.Id,i=n.CacheService.getInstance().Get(t),i?this.processResponse(i):$.ajax(this.featureServerParent.Url+"/"+this.Id+"/query",{method:"POST",data:{f:"pgeojson",where:this.HighlightQuery,outSr:4326,outFields:"*",geometryType:"esriGeometryPolygon"}}).done(function(i){var u=JSON.parse(i);n.CacheService.getInstance().Set(t,u,3600);r.processResponse(u)}).fail(function(n){console.error(n)})):$.ajax(this.featureServerParent.Url+"/"+this.Id+"/query",{method:"POST",data:{f:"pgeojson",where:this.HighlightQuery,outSr:4326,outFields:"*",geometryType:"esriGeometryPolygon"}}).done(function(n){var t=JSON.parse(n);r.processResponse(t)}).fail(function(n){console.error(n)})},t.prototype.processResponse=function(t){var i=this;this.dataLayer.addGeoJson(t);this.dataLayer.setMap(n.Map.getInstance().GoogleMap);google.maps.event.clearListeners(this.dataLayer,"click");google.maps.event.addListener(this.dataLayer,"click",function(t){var r,u;n.Map.getInstance().GetInfoWindow().isOpen()&&n.Map.getInstance().GetInfoWindow().destroy();i.Name==="Biosecurity Boundaraies"?(r=n.BioSecurityBoundry.FromFeature(t.feature),n.Map.getInstance().GetInfoWindow().setContent(n.BioSecurityBoundry.InfoWindow(r))):i.Name==="Regional Boundaraies"&&(u=n.RegionalBoundry.FromFeature(t.feature),n.Map.getInstance().GetInfoWindow().setContent(n.RegionalBoundry.InfoWindow(u)));n.Map.getInstance().GetInfoWindow().setPosition(t.latLng);n.Map.getInstance().GoToPointNoZoom(t.latLng);n.Map.getInstance().GetInfoWindow().open()})},t}();n.FeatureLayer=t}(Mrwa||(Mrwa={})),function(n){var t=function(){function n(n,t){this.Id=n;this.Name=t}return n.FromFeature=function(t){return new n(t.getProperty("FID"),t.getProperty("Name"))},n.InfoWindow=function(n){return n.Name==="Kimberley Biosecurity Area"?$('<div class="custom-content">\n                    <div class="custom-header">\n                    <img align="left" src="/Content/images/Alert_circle.svg" class="infobox-icon img-responsive"/>\n                        <h2>Kimberley Travel Restrictions<\/h2>\n                    <\/div>\n                    <div class="custom-body">\n                        <div class="row infowindow-row-last">\n                            <div class="col-xs-12">Travel is permitted within the Kimberley local government area. Restricted access to the Biosecurity area and Remote Aboriginal communities remain in place.<br/><br/>For more information read the <a target=\'_blank\' href=\'https://www.wa.gov.au/organisation/department-of-the-premier-and-cabinet/covid-19-coronavirus-travel-restrictions-within-the-kimberley-region\'>Travel restrictions within the Kimberley region<\/a> on the WA Government website.<\/div>\n                        <\/div>\n                    <\/div>\n                    <div class="custom-footer">\n                    <\/div>\n                <\/div>')[0]:n.Name==="East Pilbara Biosecurity Area"?$('<div class="custom-content">\n                    <div class="custom-header">\n                    <img align="left" src="/Content/images/Alert_circle.svg" class="infobox-icon img-responsive"/>\n                        <h2>Pilbara Travel Restrictions<\/h2>\n                    <\/div>\n                    <div class="custom-body">\n                        <div class="row infowindow-row-last">\n                            <div class="col-xs-12">Travel is permitted within the Pilbara local government area. Restricted access to the Biosecurity area and Remote Aboriginal communities remain in place.<br/><br/>For more information read the <a target=\'_blank\' href=\'https://www.wa.gov.au/organisation/department-of-the-premier-and-cabinet/covid-19-coronavirus-remote-aboriginal-communities-restrictions-entering\'>Remote Aboriginal communities - restrictions on entering<\/a> on the WA Government website.<\/div>\n                        <\/div>\n                    <\/div>\n                    <div class="custom-footer">\n                    <\/div>\n                <\/div>')[0]:n.Name==="Ngaanyatjarraku Biosecurity Area"?$('<div class="custom-content">\n                    <div class="custom-header">\n                    <img align="left" src="/Content/images/Alert_circle.svg" class="infobox-icon img-responsive"/>\n                        <h2>Goldfields-Esperance Travel Restrictions<\/h2>\n                    <\/div>\n                    <div class="custom-body">\n                        <div class="row infowindow-row-last">\n                            <div class="col-xs-12">Travel is permitted within the Goldfields-Esperance local government area. Restricted access to the Biosecurity area and Remote Aboriginal communities remain in place.<br/><br/>For more information read the <a target=\'_blank\' href=\'https://www.wa.gov.au/organisation/department-of-the-premier-and-cabinet/covid-19-coronavirus-remote-aboriginal-communities-restrictions-entering\'>Remote Aboriginal communities - restrictions on entering<\/a> on the WA Government website.<\/div>\n                        <\/div>\n                    <\/div>\n                    <div class="custom-footer">\n                    <\/div>\n                <\/div>')[0]:$('<div class="custom-content">\n                    <div class="custom-header">\n                    <img align="left" src="/Content/images/Alert_circle.svg" class="infobox-icon img-responsive"/>\n                        <h2>Biosecurity restrictions<\/h2>\n                    <\/div>\n                    <div class="custom-body">\n                        <div class="row infowindow-row-last">\n                            <div class="col-xs-12">Restrictions in place for accessing the Kimberley and remote Aboriginal communities.<br/><br/>For more information visit <a target=\'_blank\' href=\'https://www.wa.gov.au/organisation/department-of-the-premier-and-cabinet/restrictions-access-the-kimberley-and-remote-aboriginal-communities\'>https://www.wa.gov.au/organisation/department-of-the-premier-and-cabinet/restrictions-access-the-kimberley-and-remote-aboriginal-communities<\/a> or call 138 138.<\/div>\n                        <\/div>\n                    <\/div>\n                    <div class="custom-footer">\n                        \n                    <\/div>\n                <\/div>')[0]},n}();n.BioSecurityBoundry=t}(Mrwa||(Mrwa={})),function(n){var t=function(){function n(n,t){this.Id=n;this.Name=t}return n.FromFeature=function(t){return new n(t.getProperty("FID"),t.getProperty("region"))},n.InfoWindow=function(){return $('<div class="custom-content">\n                    <div class="custom-header">\n                    <img align="left" src="/Content/images/Alert_circle.svg" class="infobox-icon img-responsive"/>\n                        <h2>Border Restrictions<\/h2>\n                    <\/div>\n                    <div class="custom-body">\n                        <div class="row infowindow-row-last">\n                            <div class="col-xs-12">The Perth metropolitan area and the Peel and South West regions are in lockdown.<br/><br/>Learn more about the restrictions on the <a target=\'_blank\' href=\'https://www.wa.gov.au/government/announcements/perth-metro-peel-and-south-west-enter-hard-lockdown\'>WA Government website<\/a>.<\/div>\n                        <\/div>\n                    <\/div>\n                    <div class="custom-footer">\n                    <\/div>\n                <\/div>')[0]},n}();n.RegionalBoundry=t}(Mrwa||(Mrwa={})),function(n){var t=function(){function t(n){this.featureLayers=[];this.Url=n}return t.prototype.Load=function(t){var i=this;$.each(t,function(t,r){if(r.Enabled){var u=new n.FeatureLayer({Id:parseInt(r.Id),Name:r.Name,HighlightQuery:r.HighlightQuery,StrokeColour:r.StrokeColour,FillColour:r.FillColour},i);u.Load();i.featureLayers.push(u)}})},t}();n.FeatureServer=t}(Mrwa||(Mrwa={})),function(n){var t=function(){function n(){}return n.prototype.Get=function(n){return cacheJS.get(n)},n.prototype.Set=function(n,t,i){cacheJS.set(n,t,i,null)},n.getInstance=function(){return n.instance||(n.instance=new n),n.instance},n}();n.CacheService=t}(Mrwa||(Mrwa={})),function(n){var t=function(){function t(){this.IsInitialising=ko.observable(!0);this.DataLayerCluster=ko.observable();this.featurePointGroups=ko.observableArray([]);this.featureLineGroups=ko.observableArray([]);this.rawAgolFeaturePointGroups=[];this.rawMrwaFeaturePointGroups=[];this.rawFeatureLineGroups=[];this.promises=[]}return t.prototype.Initialise=function(){var t=this;this.IsInitialising(!0);$(".mainsection").LoadingOverlay("show",{});n.Notifications.Initialise();this.SetupDataClusterLayer();this.rawAgolFeaturePointGroups=$.grep(n.Settings.FeaturePointGroups,function(n){return n.LoadByDefault===!0&&n.UseMrwa===!1});this.rawMrwaFeaturePointGroups=$.grep(n.Settings.FeaturePointGroups,function(n){return n.LoadByDefault===!0&&n.UseMrwa===!0});this.rawFeatureLineGroups=n.Settings.FeatureLineGroups;this.LoadAgolFeaturePointGroups(function(){t.SortAgolFeaturePointGroupsByDisplayOrder();t.IsInitialising(!1)});this.LoadMrwaFeaturePointGroups(function(){});this.LoadFeatureLineGroups(function(){t.SortFeatureLineGroupsByDisplayOrder()})},t.prototype.GetAgolFeaturePointGroups=function(){return $.grep(this.featurePointGroups(),function(n){return n.UseMrwa()===!1})},t.prototype.GetMrwaFeaturePointGroups=function(){return $.grep(this.featurePointGroups(),function(n){return n.UseMrwa()===!0})},t.prototype.GetAlertFeaturePointGroups=function(){return $.grep(this.featurePointGroups(),function(t){return t.Type()!==n.Enums.FeaturePointGroupTypes.Cameras&&t.Type()!==n.Enums.FeaturePointGroupTypes.RestArea})},t.prototype.GetAlertFeaturePointGroupsThatCanHide=function(){return $.grep(this.featurePointGroups(),function(t){return t.Type()!==n.Enums.FeaturePointGroupTypes.Cameras&&t.Type()!==n.Enums.FeaturePointGroupTypes.RestArea&&t.CanHide()})},t.prototype.GetPoiFeaturePointGroups=function(){return $.grep(this.featurePointGroups(),function(t){return t.Type()===n.Enums.FeaturePointGroupTypes.Cameras})},t.prototype.GetRestAreaFeaturePointGroups=function(){return $.grep(this.featurePointGroups(),function(t){return t.Type()===n.Enums.FeaturePointGroupTypes.RestArea})},t.prototype.GetAllFeaturePointGroups=function(){return this.featurePointGroups()},t.prototype.GetAllFeatureLineGroups=function(){return this.featureLineGroups()},t.prototype.GetFeaturePointGroupByType=function(n){return $.grep(this.featurePointGroups(),function(t){return t.Type()===n})[0]},t.prototype.GetFeaturePointByTypeAndId=function(t,i){var r=this.GetFeaturePointGroupByType(t);return r?$.grep(r.Features(),function(r){return(t===n.Enums.FeaturePointGroupTypes.Cameras||t===n.Enums.FeaturePointGroupTypes.RestArea)&&(i=parseInt(i)),r.GlobalId()===i})[0]:null},t.prototype.GetFeaturePointByTypeAndLocation=function(n,t){var i=this.GetFeaturePointGroupByType(n);return i?$.grep(i.Features(),function(n){return n.Location()===t})[0]:null},t.prototype.GetFeatureLineGroupByType=function(n){return $.grep(this.featureLineGroups(),function(t){return t.Type()===n})[0]},t.prototype.RemoveAllFeaturePointGroups=function(){this.DataLayerCluster().setVisible(!1);google.maps.event.clearListeners(this.DataLayerCluster()._dataLayer,"click");this.featurePointGroups.removeAll()},t.prototype.RemoveAllFeatureLineGroups=function(){this.featureLineGroups().forEach(function(n){google.maps.event.clearListeners(n.DataLayer,"click");n.DataLayer.setMap(null)});this.featureLineGroups.removeAll()},t.prototype.SetupDataClusterLayer=function(){var t=this;this.DataLayerCluster(new DataLayerClusterer({maxZoom:16,imagePath:n.Settings.SiteRelativePath+"Content/images/ClusterIcons/m"}));this.DataLayerCluster().setStyle(function(n){var i=t.GetFeaturePointGroupByType(n.getProperty("FeaturePointGroupType"));return{icon:{url:i.IconUrlPng(),scaledSize:new google.maps.Size(37,50,"px","px")},title:i.DisplayName()}})},t.prototype.LoadAgolFeaturePointGroups=function(t){var i=this,r;n.Settings.AgolOAuth?(r={url:"/Agol/GetAgolToken"},$.ajax(r).done(function(r){var u=JSON.parse(r);$.each(i.rawAgolFeaturePointGroups,function(t,r){var f=n.Settings.ArcGisMapServerUrl+"/"+r.Query+"&token="+u.access_token;i.loadFeaturePointGroup(r,f,null)});$.when.apply($,i.promises).then(function(){t!=null&&t()},function(){t!=null&&t()})})):($.each(this.rawAgolFeaturePointGroups,function(t,r){var u=n.Settings.ArcGisMapServerUrl+"/"+r.Query;i.loadFeaturePointGroup(r,u,null)}),$.when.apply($,this.promises).then(function(){t!=null&&t()},function(){t!=null&&t()}))},t.prototype.LoadMrwaFeaturePointGroups=function(t){var i=this;$.each(this.rawMrwaFeaturePointGroups,function(t,r){var u=n.Settings.ArcGisMrwaMapServerUrl+"/"+r.Query;i.loadFeaturePointGroup(r,u,null)});$.when.apply($,this.promises).then(function(){t!=null&&t()},function(){t!=null&&t()})},t.prototype.LoadFeatureLineGroups=function(t){var i=this,r;n.Settings.AgolOAuth?(r={url:"/Agol/GetAgolToken"},$.ajax(r).done(function(r){var u=JSON.parse(r);$.each(i.rawFeatureLineGroups,function(t,r){var f=n.Settings.ArcGisMapServerUrl+"/"+r.Query+"&token="+u.access_token;i.loadFeatureLineGroup(r,f,null)});$.when.apply($,i.promises).then(function(){t!=null&&t()},function(){t!=null&&t()})})):($.each(this.rawFeatureLineGroups,function(t,r){var u=n.Settings.ArcGisMapServerUrl+"/"+r.Query;i.loadFeatureLineGroup(r,u,null)}),$.when.apply($,this.promises).then(function(){t!=null&&t()},function(){t!=null&&t()}))},t.GetFeatureMarkerUrl=function(t){var i=t.getProperty("GlobalID");return(t.getProperty("FeaturePointGroupType")==n.Enums.FeaturePointGroupTypes.RestArea||t.getProperty("FeaturePointGroupType")==n.Enums.FeaturePointGroupTypes.Cameras)&&(i=t.getProperty("OBJECTID")),n.Settings.SiteAbsolutePath+"?t="+t.getProperty("FeaturePointGroupType")+"&id="+i},t.prototype.loadFeaturePointGroup=function(t,i,r){var f=this,u=this.featurePointGroups().filter(function(n){return n.LayerName()===t.Name})[0],e,o;u==null&&(u=new n.Models.FeaturePointGroup({id:t.Id,name:t.Name,displayName:t.DisplayName,iconUrl:n.Settings.SiteRelativePath+t.IconUrl,iconCircleUrl:n.Settings.SiteRelativePath+t.IconCircleUrl,expandByDefault:t.ExpandByDefault,displayOrder:t.DisplayOrder,isDateFilterable:t.IsDateFilterable,showOnRoute:t.ShowOnRoute,hasLastUpdatedTime:t.HasLastUpdatedTime,type:this.getFeaturePointGroupType(t.Name),canHide:t.CanHide,hideByDefault:t.HideByDefault,useMrwa:t.UseMrwa,enableCaching:t.EnableCaching,cacheDurationSec:t.CacheDurationSec,loadByDefault:t.LoadByDefault,query:i}),this.featurePointGroups.push(u));n.Settings.CachingIsAvailable()&&u.EnableCaching()?(e=u.LayerName()+"-"+u.LayerId(),o=n.CacheService.getInstance().Get(e),o?this.processFeaturePointGroupJson(o,u,r):this.promises.push($.ajax(i,{type:"GET",cache:!1,dataType:"json",timeout:1e4}).done(function(t){n.CacheService.getInstance().Set(e,t,u.CacheDurationSec());f.processFeaturePointGroupJson(t,u,r)}).fail(function(){f.featurePointGroups.remove(u);console.error("Could not load "+u.LayerName())}))):this.promises.push($.ajax(i,{type:"GET",cache:!1,dataType:"json",timeout:1e4}).done(function(n){f.processFeaturePointGroupJson(n,u,r)}).fail(function(){f.featurePointGroups.remove(u);console.error("Could not load "+u.LayerName())}))},t.prototype.loadFeatureLineGroup=function(t,i,r){var f=this,u=this.featureLineGroups().filter(function(n){return n.LayerName()===t.Name})[0],e,o;u==null&&(u=new n.Models.FeatureLineGroup({id:t.Id,name:t.Name,displayName:t.DisplayName,iconCircleUrl:n.Settings.SiteRelativePath+t.IconCircleUrl,iconUrl:n.Settings.SiteRelativePath+t.IconUrl,displayOrder:t.DisplayOrder,showOnRoute:t.ShowOnRoute,type:this.getFeatureLineGroupType(t.Name),enableCaching:t.EnableCaching,cacheDurationSec:t.CacheDurationSec,query:i,strokeColour:t.StrokeColour}),u.DataLayer.setStyle({clickable:!0,visible:!0,strokeColor:u.StrokeColour(),strokeWeight:6,zIndex:999}),this.featureLineGroups.push(u));n.Settings.CachingIsAvailable()&&u.EnableCaching()?(e=u.LayerName()+"-"+u.LayerId(),o=n.CacheService.getInstance().Get(e),o?this.processFeatureLineGroupJson(o,u,r):this.promises.push($.ajax(i,{type:"GET",cache:!1,dataType:"json",timeout:1e4}).done(function(t){n.CacheService.getInstance().Set(e,t,u.CacheDurationSec());f.processFeatureLineGroupJson(t,u,r)}).fail(function(){f.featureLineGroups.remove(u);console.error("Could not load "+u.LayerName())}))):this.promises.push($.ajax(i,{type:"GET",cache:!1,dataType:"json",timeout:1e4}).done(function(n){f.processFeatureLineGroupJson(n,u,r)}).fail(function(){f.featureLineGroups.remove(u);console.error("Could not load "+u.LayerName())}))},t.prototype.processFeaturePointGroupJson=function(t,i,r){if(t.error!=null)return n.Notifications.Error("Unexpected Error","An unexpected error has occurred"),!1;$.each(t.features,function(n,t){t.properties.FeaturePointGroupType=i.Type()});this.DataLayerCluster().addGeoJson(t);i.LoadFeatures();i.HideByDefault()&&i.ShowHideAllFeatures(null,null);r!=null&&r(i)},t.prototype.processFeatureLineGroupJson=function(t,i,r){if(t.error!=null)return n.Notifications.Error("Unexpected Error","An unexpected error has occurred"),!1;$.each(t.features,function(n,t){t.properties.FeatureLineGroupType=i.Type()});i.DataLayer.addGeoJson(t);i.LoadFeatures();r!=null&&r(i)},t.prototype.SortAgolFeaturePointGroupsByDisplayOrder=function(){this.GetAgolFeaturePointGroups().sort(function(n,t){return n.DisplayOrder()-t.DisplayOrder()})},t.prototype.SortFeatureLineGroupsByDisplayOrder=function(){this.GetAllFeatureLineGroups().sort(function(n,t){return n.DisplayOrder()-t.DisplayOrder()})},t.prototype.getFeaturePointGroupType=function(t){switch(t){case"Alerts":return n.Enums.FeaturePointGroupTypes.Alerts;case"TrafficSignalOutages":return n.Enums.FeaturePointGroupTypes.TrafficSignalOutages;case"Roadworks":return n.Enums.FeaturePointGroupTypes.Roadworks;case"Events":return n.Enums.FeaturePointGroupTypes.Events;case"Cameras":return n.Enums.FeaturePointGroupTypes.Cameras;case"RestAreas":return n.Enums.FeaturePointGroupTypes.RestArea;case"ClosedRoadPoints":return n.Enums.FeaturePointGroupTypes.ClosedRoadPoints;case"RoadsOpenedWithVehicleRestrictionPoints":return n.Enums.FeaturePointGroupTypes.RoadsOpenedWithVehicleRestrictionPoints;case"RoadsOpenedWithConditionPoints":return n.Enums.FeaturePointGroupTypes.RoadsOpenedWithConditionPoints;case"DetourPoints":return n.Enums.FeaturePointGroupTypes.DetourPoints;default:return n.Enums.FeaturePointGroupTypes.Unknown}},t.prototype.getFeatureLineGroupType=function(t){switch(t){case"ClosedRoadLines":return n.Enums.FeatureLineGroupTypes.ClosedRoadLines;case"RoadsOpenedWithVehicleRestrictionLines":return n.Enums.FeatureLineGroupTypes.RoadsOpenedWithVehicleRestrictionLines;case"RoadsOpenedWithConditionLines":return n.Enums.FeatureLineGroupTypes.RoadsOpenedWithConditionLines;case"DetourLines":return n.Enums.FeatureLineGroupTypes.DetourLines;default:return n.Enums.FeatureLineGroupTypes.Unknown}},t.getInstance=function(){return t.instance||(t.instance=new t),t.instance},t}();n.ArcGisService=t}(Mrwa||(Mrwa={})),function(n){var t=function(){function t(){}return t.TrackEvent=function(t,i){(i===void 0&&(i=null),n.Settings.AppInsightsActive!=!1)&&(i?appInsights.trackEvent({name:t,properties:i}):appInsights.trackEvent({name:t}))},t.TrackMetric=function(t,i){n.Settings.AppInsightsActive!=!1&&appInsights.trackMetric(t,i)},t}();n.AppInsightsService=t}(Mrwa||(Mrwa={}))