var __awaiter,__generator,__extends,TIPS;(function(n){function t(n){return[0,20,10,30,40,50,60,70,75,80,90,92,95,100].indexOf(n)}n.RoadClosureTypePriority=t})(TIPS||(TIPS={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(n){var i,r,t,o,s,h;this._points=[];this._index=0;for(var u=0,c=n.length,f=0,e=0;u<c;){r=0;t=0;do i=n.charCodeAt(u++)-63,t|=(i&31)<<r,r+=5;while(i>=32);o=(t&1)!=0?~(t>>1):t>>1;f+=o;r=0;t=0;do i=n.charCodeAt(u++)-63,t|=(i&31)<<r,r+=5;while(i>=32);s=(t&1)!=0?~(t>>1):t>>1;e+=s;h={LatX:f/1e5,LngY:e/1e5};this._points.push(h)}}return n.prototype.GetNextPoint=function(){if(this._index>this._points.length-1)throw new Error("Decoded too many points");return this._points[this._index++]},n.prototype.GetNPoints=function(n){if(n<=0)throw new Error("Num points must be positive: "+n);if(this._index+n-1>this._points.length-1)throw new Error("Decoded too many points");var t=this._points.slice(this._index,this._index+n);return this._index+=n,t},n}();n.GeometryDecoder=t})(t=n.Data||(n.Data={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={})),function(n){var t;(function(n){var t;(function(n){var t,i;(function(n){n[n.Polyline=0]="Polyline";n[n.Polygon=1]="Polygon";n[n.Circle=2]="Circle"})(t=n.ShapeType||(n.ShapeType={})),function(n){n[n.Ended=0]="Ended";n[n.Active=1]="Active";n[n.Future=2]="Future"}(i=n.CapitalProjectsStatus||(n.CapitalProjectsStatus={}))})(t=n.Data||(n.Data={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={})),function(n){var t;(function(t){var i;(function(t){var i=function(){function t(){this._issueLocationTypeNames={};this._entitySubTypeNames={}}return t.prototype.UpdateData=function(n){this._issueLocationTypeNames=n.IssueLocationTypeNames;this._entitySubTypeNames=n.EntitySubTypeNames},t.prototype.GetLocaleString=function(n){if(!n)throw new Error("Localization is null");return n.hasOwnProperty(INJECTED_SETTINGS.locale)&&!!n[INJECTED_SETTINGS.locale]&&n[INJECTED_SETTINGS.locale].length>0?n[INJECTED_SETTINGS.locale]:n[t.DEFAULT_LOCALE]},t.prototype.GetEnglishString=function(n){if(!n.hasOwnProperty(t.DEFAULT_LOCALE))throw new Error("Localization is null, does not contain "+t.DEFAULT_LOCALE);return n[t.DEFAULT_LOCALE]},t.prototype.GetLocationTypeNameById=function(n){return n?this._issueLocationTypeNames.hasOwnProperty(n)?this.GetLocaleString(this._issueLocationTypeNames[n]):null:null},t.prototype.GetEntitySubTypeNameById=function(n){return n?this._entitySubTypeNames.hasOwnProperty(n)?this.GetLocaleString(this._entitySubTypeNames[n]):null:null},t.prototype.GetRoadClosureTypeName=function(t){switch(t){case 70:return n.Framework.Settings.Resources.TextRoadClosureType.AlternatingTraffic;case 50:return n.Framework.Settings.Resources.TextRoadClosureType.BikeLane;case 10:return n.Framework.Settings.Resources.TextRoadClosureType.Detour;case 90:return n.Framework.Settings.Resources.TextRoadClosureType.FullClosureEmergencyAccessUnspecified;case 100:return n.Framework.Settings.Resources.TextRoadClosureType.FullClosureNoEmergencyAccess;case 92:return n.Framework.Settings.Resources.TextRoadClosureType.FullClosureWithEmergencyAccess;case 95:return n.Framework.Settings.Resources.TextRoadClosureType.IntermittentFullClosure;case 60:return n.Framework.Settings.Resources.TextRoadClosureType.LaneClosure;case 80:return n.Framework.Settings.Resources.TextRoadClosureType.LocalTrafficOnly;case 20:return n.Framework.Settings.Resources.TextRoadClosureType.NoClosure;case 75:return n.Framework.Settings.Resources.TextRoadClosureType.OneWay;case 30:return n.Framework.Settings.Resources.TextRoadClosureType.Shoulder;case 40:return n.Framework.Settings.Resources.TextRoadClosureType.Sidewalk;case 0:default:return n.Framework.Settings.Resources.TextRoadClosureType.Unknown}},t.DEFAULT_LOCALE="en-us",t}();t.LocalizationManager=i})(i=t.Data||(t.Data={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={})),function(n){var t;(function(t){var i;(function(i){var r=function(){function r(n,t,i,r){if(this._spriteService=i,this._localizationManager=r,this._xhr=null,this._dataUpdatedListeners=[],this._lastGeneratedUtcTicks=null,t<=0)throw new Error("Interval millis must be positive: "+t);if(!n||n.length===0)throw new Error("Json data url not specified");if(!i)throw new Error("Spriteservice is null");if(!r)throw new Error("LocalizationManager is null");this._intervalMillis=t;this._jsonDataUrl=n}return r.prototype.AddDataUpdatedListener=function(n){if(!n)throw new Error("listener is null");this._dataUpdatedListeners.push(n)},r.prototype.OnNewData=function(r){var u=this,e,f;r.GeneratedUtcTicks!==this._lastGeneratedUtcTicks&&(this._lastGeneratedUtcTicks=r.GeneratedUtcTicks,this._localizationManager.UpdateData(r),f=new i.GeometryDecoder(r.CoordsEncoded),r.Issues.forEach(function(i){var l;if(i.kind="IIssue",i.Geometry.length?(l=i.Geometry.map(function(t){return{prio:n.RoadClosureTypePriority(t.MarkerInfo.RoadClosureType),rct:t.MarkerInfo.RoadClosureType}}).reduce(function(n,t){return n.prio>t.prio?n:t}).rct,i.TableViewInfo.maxRoadClosureType=l):i.TableViewInfo.maxRoadClosureType=0,i.Geometry.forEach(function(t,r){t.path=f.GetNPoints(t.NumPoints);t.MarkerInfo.markerLocation=n.Utilities.GetIssueShapeMarkerLocation(t);t.parentIssue=i;t.idxInParent=r;t.kind="IShape"}),i.Geometry.length){var e=i.Geometry[0].path[0],o=e.LatX,s=e.LatX,h=e.LngY,c=e.LngY;i.Geometry.forEach(function(n){n.path.forEach(function(n){o=Math.min(n.LatX,o);s=Math.max(n.LatX,s);h=Math.min(n.LngY,h);c=Math.max(n.LngY,c)})});i.boundingBox=new n.Common.BoundingBox(o,s,h,c)}i.divisionName=r.DivisionNames[i.DivisionId.toString()];i.Source&&(i.Source.toLowerCase().endsWith(" - roads")?i.Source=i.Source.substring(0,i.Source.length-8):i.Source.toLowerCase().endsWith("roads")&&(i.Source=i.Source.substring(0,i.Source.length-5)));i._sourceKey=(i.Source||t.Settings.Resources.TextIssueOther).toLowerCase();i.TableViewInfo.IconClass&&(i.TableViewInfo.iconInfo=u._spriteService.GetMapIconForSprite(i.TableViewInfo.IconClass));i.TableViewInfo.maxRoadClosureType!=0&&(i.TableViewInfo.maxRoadClosureTypeInfo=u._spriteService.GetRoadClosureOverlayIcon(i.TableViewInfo.maxRoadClosureType));i.TableViewInfo.issueTypeString=u._localizationManager.GetEntitySubTypeNameById(i.TableViewInfo.IssueTypeId)}),r.Entities.forEach(function(n){if(n.kind="IEntity",n.position=f.GetNextPoint(),n.iconInfo=u._spriteService.GetMapIconForSprite(n.IconClass),n.divisionName=r.DivisionNames[n.DivisionId.toString()],n.Source&&(n.Source.toLowerCase().endsWith(" - roads")?n.Source=n.Source.substring(0,n.Source.length-8):n.Source.toLowerCase().endsWith("roads")&&(n.Source=n.Source.substring(0,n.Source.length-5))),n._sourceKey=(n.Source||t.Settings.Resources.TextIssueOther).toLowerCase(),n.EntityType===2){var i=n;i.CurrentMessageText=i.CurrentMessageText.trim()}}),(e=r.TravelTimePaths)===null||e===void 0?void 0:e.forEach(function(t){t.geometry=f.GetNPoints(t.NumPoints);t.popupAnchor=n.Utilities.GetPathMidpoint(t.geometry);var i=t.geometry[t.geometry.length-1],r=t.geometry[0],u=(i.LatX-r.LatX)/180,e=(i.LngY-r.LngY)/360;if(t.Forward.directionStr=Math.abs(e)<Math.abs(u)?u>0?"NB":"SB":e>0?"EB":"WB",t.Backward)switch(t.Forward.directionStr){case"NB":t.Backward.directionStr="SB";break;case"SB":t.Backward.directionStr="NB";break;case"EB":t.Backward.directionStr="WB";break;case"WB":t.Backward.directionStr="EB"}}),r.CoordsEncoded=null,this._dataUpdatedListeners.forEach(function(n){return n(r)}));setTimeout(this.RequestNewData.bind(this),this._intervalMillis)},r.prototype.RequestNewData=function(){var n=this;this._xhr=$.ajax({cache:!1,url:this._jsonDataUrl,success:function(t){return n.OnNewData(JSON.parse(t))}.bind(this),error:function(n,t){throw new Error(t);}})},r.prototype.Run=function(){console.debug("Updater running");this.RequestNewData()},r}();i.Updater=r})(i=t.Data||(t.Data={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={})),function(n){var t;(function(t){var i;(function(t){var i;(function(t){var i=function(){function t(){var t=this;this._inputData={issues:[],entities:[],travelTimePaths:[]};this._filterLambda=function(){return!0};this._pathsEnabled=!1;this._mapDataChangedListeners=[];this._tableDataChangedListeners=[];this.Update=n.Utilities.Debounce(function(){var i=t.GetMapFilteredItems(),n;t._mapDataChangedListeners.forEach(function(n){return n(i)});n=t.GetTableFilteredItems();t._tableDataChangedListeners.forEach(function(t){return t(n)})},50,!1)}return t.prototype.AddMapDataListener=function(n){if(!n)throw new Error("Listener is null");return this._mapDataChangedListeners.push(n),this},t.prototype.AddTableDataListener=function(n){if(!n)throw new Error("listener is null");return this._tableDataChangedListeners.push(n),this},t.prototype.UpdateData=function(n){if(!n)throw new Error("new data is null");this._inputData={entities:n.Entities,issues:n.Issues,travelTimePaths:n.TravelTimePaths};this.Update()},t.prototype.UpdateFilterConfig=function(n){if(!n)throw new Error("Filter config is null");this._filterLambda=n;this.Update()},t.prototype.UpdateTravelTimePaths=function(n){this._pathsEnabled=n;this.Update()},t.prototype.GetMapFilteredItems=function(){var t=this,n={visibleEntities:[],visibleIssueShapes:{},visibleTravelTimePaths:[],hiddenEntities:[],hiddenIssueShapes:{},hiddenTravelTimePaths:[]};return this._inputData.issues.filter(this._filterLambda).forEach(function(i){var r=i.Geometry.filter(t._filterLambda),u=i.Geometry.filter(function(n){return!t._filterLambda(n)}),f,e;r.length>0&&(n.visibleIssueShapes.hasOwnProperty(i.IssueId)||(n.visibleIssueShapes[i.IssueId]=[]),f=n.visibleIssueShapes[i.IssueId],r.forEach(function(n){return f.push(n)}));u.length>0&&(n.hiddenIssueShapes.hasOwnProperty(i.IssueId)||(n.hiddenIssueShapes[i.IssueId]=[]),e=n.hiddenIssueShapes[i.IssueId],u.forEach(function(n){return e.push(n)}))}),this._inputData.issues.filter(function(n){return!t._filterLambda(n)}).forEach(function(t){n.hiddenIssueShapes.hasOwnProperty(t.IssueId)||(n.hiddenIssueShapes[t.IssueId]=[]);t.Geometry.forEach(function(i){return n.hiddenIssueShapes[t.IssueId].push(i)})}),n.visibleEntities=this._inputData.entities.filter(this._filterLambda),n.hiddenEntities=this._inputData.entities.filter(function(n){return!t._filterLambda(n)}),this._pathsEnabled?n.visibleTravelTimePaths=this._inputData.travelTimePaths:n.hiddenTravelTimePaths=this._inputData.travelTimePaths,n},t.prototype.GetTableFilteredItems=function(){return{entities:this._inputData.entities.filter(this._filterLambda),issues:this._inputData.issues.filter(this._filterLambda)}},t}();t.FilterController=i})(i=t.Filter||(t.Filter={}))})(i=t.DisplayLogic||(t.DisplayLogic={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={})),function(n){var t;(function(t){var i;(function(t){var i;(function(t){var i=function(){function t(n,t){if(this._mapService=n,this._clusterer=t,this._dataItems={visibleEntities:[],visibleIssueShapes:{},hiddenEntities:[],hiddenIssueShapes:{},hiddenTravelTimePaths:[],visibleTravelTimePaths:[]},!n)throw new Error("Map service is null");}return t.prototype.OnActiveItemsChanged=function(n){this._dataItems=n;this._clusterer.ClearCache();this._mapService.Reset();this.Update()},t.prototype.OnZoomChanged=function(){this._clusterer&&this.Update()},t.prototype.Update=function(){var t=[],i,r,n;for(i in this._dataItems.visibleIssueShapes)this._dataItems.visibleIssueShapes.hasOwnProperty(i)&&this._dataItems.visibleIssueShapes[i].forEach(function(n){t.push({obj:n,type:"i",p:n.MarkerInfo.markerLocation})});this._dataItems.visibleEntities.forEach(function(n){t.push({obj:n,type:"e",p:n.position})});r=this._mapService.GetMap().GetZoom();n=this._clusterer.Cluster(t,r);n.travelTimePaths=this._dataItems.visibleTravelTimePaths;n.zoom=r;this._mapService.UpdateMapData(n)},t.Cluster=function(t,i,r){var e={zoom:null,clusterMarkers:[],singleIssues:[],singleEntities:[],travelTimePaths:[]},o,u;if(t.length===0)return e;var h=-90,c=-180,l=90-h,a=180-c,f={},v=function(n,t){var i=Math.floor(n*t);return i>=t&&(i=t-1),i},w=function(n){return{LatX:v((n.LatX-h)/l,r),LngY:v((n.LngY-c)/a,i)}},y=function(n,t){return{LatX:n/r*l+h,LngY:t/i*a+c}};t.forEach(function(n){var i=w(n.p),t=i.LatX+"|"+i.LngY;f.hasOwnProperty(t)||(f[t]=[]);f[t].push(n)});for(o in f)if(f.hasOwnProperty(o))if(u=f[o],u.length===1)u[0].type==="i"?e.singleIssues.push(u[0].obj):e.singleEntities.push(u[0].obj);else{var s=o.split("|").map(function(n){return parseInt(n)}),b=y(s[0],s[1]),k=y(s[0]+1,s[1]+1),p=n.Common.BoundingBox.FromMinMax(b,k),d={id:o,entities:u.filter(function(n){return n.type==="e"}).map(function(n){return n.obj}),issueShapes:u.filter(function(n){return n.type==="i"}).map(function(n){return n.obj}),location:p.GetCentre(),coveredRegion:p};e.clusterMarkers.push(d)}return e},t}();t.MapDisplayLogic=i})(i=t.Map||(t.Map={}))})(i=t.DisplayLogic||(t.DisplayLogic={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(n,t){if(this._table=n,this._map=t,this._inputData={entities:[],issues:[]},!this._table)throw new Error("Table is null");if(!this._map)throw new Error("Map is null");}return n.prototype.OnActiveItemsChanged=function(n){this._inputData=n;this.UpdateOutput(this._map.GetBoundsLatLng())},n.prototype.UpdateOutput=function(n){var t={entities:this._inputData.entities.filter(function(t){return n.ContainsPoint(t.position)}),issues:this._inputData.issues.filter(function(t){return!!t.boundingBox&&n.Intersects(t.boundingBox)})};this._table.UpdateData(t)},n}();n.TableDisplayLogic=t})(t=n.DisplayLogic||(n.DisplayLogic={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={}));__awaiter=this&&this.__awaiter||function(n,t,i,r){function u(n){return n instanceof i?n:new i(function(t){t(n)})}return new(i||(i=Promise))(function(i,f){function o(n){try{e(r.next(n))}catch(t){f(t)}}function s(n){try{e(r["throw"](n))}catch(t){f(t)}}function e(n){n.done?i(n.value):u(n.value).then(o,s)}e((r=r.apply(n,t||[])).next())})};__generator=this&&this.__generator||function(n,t){function o(n){return function(t){return s([n,t])}}function s(e){if(f)throw new TypeError("Generator is already executing.");while(r)try{if(f=1,u&&(i=e[0]&2?u["return"]:e[0]?u["throw"]||((i=u["return"])&&i.call(u),0):u.next)&&!(i=i.call(u,e[1])).done)return i;(u=0,i)&&(e=[e[0]&2,i.value]);switch(e[0]){case 0:case 1:i=e;break;case 4:return r.label++,{value:e[1],done:!1};case 5:r.label++;u=e[1];e=[0];continue;case 7:e=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(e[0]===6||e[0]===2)){r=0;continue}if(e[0]===3&&(!i||e[1]>i[0]&&e[1]<i[3])){r.label=e[1];break}if(e[0]===6&&r.label<i[1]){r.label=i[1];i=e;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(e);break}i[2]&&r.ops.pop();r.trys.pop();continue}e=t.call(n,r)}catch(o){e=[6,o];u=0}finally{f=i=0}if(e[0]&5)throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},f,u,i,e;return e={next:o(0),"throw":o(1),"return":o(2)},typeof Symbol=="function"&&(e[Symbol.iterator]=function(){return this}),e},function(n){var t;(function(t){var i;(function(i){var r=this,u=function(){return __awaiter(r,void 0,void 0,function(){var r,d,y,o,g,f,s,c,p,u,nt,e,tt,w,b,l,k,a,h,it,rt,v;return __generator(this,function(ut){switch(ut.label){case 0:return r=new n.Common.Map.MapGoogle($("#MapContainer")),d=new n.Common.Table.TableDt($("#table"),t.Settings.InjectedSettings.showEntitiesInTable),y=new n.Common.Map.Popup.PopupControllerGoogle(r),r.SetPopupController(y),o=new t.Data.LocalizationManager,g=new i.MapInitializer(r),g.Initialize(),t.UI.SidebarToggle.InitializeSidebar(r),f=new t.Sprite.SpriteServiceCache(new t.Sprite.SpriteService("./Sprites/Get?fileName=",!1)),[4,f.Initialize()];case 1:ut.sent();s=new t.DisplayLogic.TableDisplayLogic(d,r);console.debug("Using dynamic data directory: "+t.Settings.InjectedSettings.dynamicDataDir);c=t.Settings.InjectedSettings.dynamicDataDir+"jsonData.txt";p=t.Settings.InjectedSettings.installationType.toLowerCase();switch(p){case"durham":u=new n.Configurations.DurhamTrafficWatchConfiguration(c,o,f,r,s);break;case"m511":u=new n.Configurations.M511Configuration(c,o,f,r,s);break;case"ogra":u=new n.Configurations.OGRAConfiguration(c,r,o,f,s);break;case"capitalprojects":u=new n.Configurations.CapitalProjectsConfiguration(c,o,f,r,s);break;default:throw new Error("Unknown installation type: "+p);}nt=$("#SidebarDynamic");e=new t.DisplayLogic.Filter.FilterController;u.AddOverlaysChangedListener(function(){return null});tt=t.Settings.InjectedSettings.refreshPeriodSeconds*1e3;w=new t.Data.Updater(u.GetJsonDataUrl(),tt,f,o);b=new t.Map.MapService(r,f,o,y);l=new t.DisplayLogic.Map.MapDisplayLogic(b,u.GetClusterer());k=!1;w.AddDataUpdatedListener(function(n){u.PopulateSidebar(nt,n).then(function(){b.Reset();e.UpdateFilterConfig(u.GetFilterLambda());e.UpdateData(n);k||(console.debug("Config bound to filter"),u.AddFilterChangedListener(e.UpdateFilterConfig.bind(e)),u.AddTravelTimePathsChangedListener(function(n){return e.UpdateTravelTimePaths(n)}),k=!0)})});e.AddMapDataListener(l.OnActiveItemsChanged.bind(l));e.AddTableDataListener(s.OnActiveItemsChanged.bind(s));r.AddZoomChangedListener(l.OnZoomChanged.bind(l));a=u.GetEmbedController();h=n.Utilities.Debounce(a.UpdateEmbedLink.bind(a),200,!1);r.AddCentreChangedListener(h);r.AddZoomChangedListener(h);u.AddStateChangedListener(h);$("#EmbedViewBtn").on("show.bs.modal shown.bs.modal",h);return setTimeout(h,1e3),it=n.Utilities.GetUrlParameter("sidebarHidden")==="true",it&&t.UI.SidebarToggle.CloseSidebar(),w.Run(),setTimeout(function(){return location.reload()},72e5),n.Utilities.IsInIFrame()&&(rt=$('\n\t\t\t\t<a href="'+(window.location.origin+window.location.pathname)+'"\n\t\t\t\t\ttarget="_blank">\n\t\t\t\t\t<span>'+t.Settings.Resources.TextViewFullSite+"<\/span>\n\t\t\t\t\t<i class='fa fa-external-link'><\/i>\n\t\t\t\t<\/a>").attr({id:"IFrameViewFullSiteLink"}).insertAfter($("#LogoContainerFloating")),v=n.Utilities.Debounce(function(){var n=a.GenerateViewStateParams({MapViewSettings:!0,SidebarSettings:!0}),t=window.location.origin+window.location.pathname+"?"+n.map(function(n){return n.key+"="+n.value}).join("&");rt.attr("href",t)},200,!1),r.AddCentreChangedListener(v),r.AddZoomChangedListener(v),u.AddStateChangedListener(v)),[2]}})})};$(u)})(i=t.Init||(t.Init={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={})),function(n){var t;(function(t){var i;(function(i){var r=function(){function i(n){if(this._map=n,!n)throw new Error("Map is null");}return i.ValidatePoint=function(n){return!!n&&i.ValidateLat(n.LatX)&&i.ValidateLng(n.LngY)},i.ValidateLat=function(n){return!isNaN(n)&&n>=-90&&n<=90},i.ValidateLng=function(n){return!isNaN(n)&&n>=-180&&n<=180},i.ValidateZoom=function(n){return!isNaN(n)&&n>=0&&n<=25},i.prototype.CacheZoom=function(t){n.Utilities.SetCacheParameter("zoom",t.toString())},i.prototype.CacheCentre=function(t){if(!t){console.error("centre is null");return}if(!i.ValidatePoint(t)){console.warn("centre is invalid");return}n.Utilities.SetCacheParameter("centre",JSON.stringify(t))},i.prototype.Initialize=function(){var u=null,r=null,e=parseFloat(n.Utilities.GetUrlParameter("lat")),o=parseFloat(n.Utilities.GetUrlParameter("lng")),f;if(e&&o&&i.ValidateLat(e)&&i.ValidateLng(o)&&(u={LatX:e,LngY:o}),r=parseInt(n.Utilities.GetUrlParameter("zoom")),i.ValidateZoom(r)||(r=null),!u&&!!n.Utilities.GetCacheParameter("centre"))try{f=JSON.parse(n.Utilities.GetCacheParameter("centre"));!!f&&i.ValidatePoint(f)&&(u=f)}finally{}r===null&&(r=parseInt(n.Utilities.GetCacheParameter("zoom")),i.ValidateZoom(r)||(r=null));u||(u={LatX:t.Settings.InjectedSettings.defaultLat,LngY:t.Settings.InjectedSettings.defaultLng});r===null&&(r=t.Settings.InjectedSettings.defaultZoom);this._map.PanTo(u);this._map.SetZoom(r);this.CacheZoom(r);this.CacheCentre(u);this._map.AddZoomChangedListener(this.CacheZoom.bind(this));this._map.AddCentreChangedListener(n.Utilities.Debounce(this.CacheCentre.bind(this),120,!1))},i}();i.MapInitializer=r})(i=t.Init||(t.Init={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={})),function(n){var t;(function(t){var i;(function(i){var r=function(){function i(n,t,r,u){if(this._map=n,this._spriteService=t,this._localizationManager=r,this._popupController=u,this._entities={},this._issueMarkers={},this._issuesGeom={},this._travelTimePaths={},this._clusters={},this._visibleClusters=[],this._selectedUnderlayHandler=null,!n)throw new Error("Map is null");if(!t)throw new Error("spriteService is null");if(!r)throw new Error("localization manager is null");if(!u)throw new Error("PopupController is null");this._travelTimeWindowLayer=this._map.CreateLayer(i.TRAVEL_TIME_WINDOW_LAYER_KEY,12);this._overlayLayer=this._map.CreateLayer(i.ICON_OVERLAY_LAYER_KEY,12);this._iconLayer=this._map.CreateLayer(i.ICON_LAYER_KEY,11);this._clusterLayer=this._map.CreateLayer(i.CLUSTER_LAYER_KEY,10);this._polylineLayer=this._map.CreateLayer(i.POLYLINE_LAYER_KEY,9);this._geometryLayer=this._map.CreateLayer(i.GEOMETRY_LAYER_KEY,8);this._underlayLayer=this._map.CreateLayer(i.UNDERLAY_LAYER_KEY,7)}return i.prototype.Reset=function(){console.debug("Resetting map service");this._overlayLayer.Reset();this._iconLayer.Reset();this._clusterLayer.Reset();this._polylineLayer.Reset();this._geometryLayer.Reset();this._underlayLayer.Reset();this._travelTimeWindowLayer.Reset();this._entities={};this._issueMarkers={};this._issuesGeom={};this._clusters={};this._visibleClusters=[];this._travelTimePaths={}},i.prototype.GetMap=function(){return this._map},i.prototype.ShowSelectedUnderlay=function(n){this._selectedUnderlayHandler=this._underlayLayer.AddMarker({icon:this._spriteService.GetSelectedUnderlayIcon(),fixedSizePx:t.Settings.InjectedSettings.iconFixedWidthPx*2,position:n,popupRenderer:null})},i.prototype.HideSelectedUnderlay=function(){var n;(n=this._selectedUnderlayHandler)===null||n===void 0?void 0:n.Delete();this._selectedUnderlayHandler=null},i.prototype.UpdateMapData=function(n){var u=this,e=Date.now(),i,t,r,f;for(i in this._entities)this._entities.hasOwnProperty(i)&&this._entities[i].Hide();for(t in this._issueMarkers)this._issueMarkers.hasOwnProperty(t)&&this._issueMarkers[t].forEach(function(n){return n.Hide()});for(t in this._issuesGeom)this._issuesGeom.hasOwnProperty(t)&&this._issuesGeom[t].forEach(function(n){return n.Hide()});this._visibleClusters.forEach(function(n){return n.Hide()});for(r in this._travelTimePaths)this._travelTimePaths.hasOwnProperty(r)&&this._travelTimePaths[r].forEach(function(n){return n.Hide()});n.singleEntities.forEach(this.DrawEntity.bind(this));n.singleIssues.forEach(this.DrawIssueShapeMarker.bind(this));n.singleIssues.forEach(this.DrawIssueShapeGeometry.bind(this));n.clusterMarkers.forEach(function(t){return u.DrawClusterMarker(n.zoom,t)});n.travelTimePaths.forEach(function(n,t){return u.DrawTravelTimePath(t,n)});f=Date.now();console.debug("update time: "+(f.valueOf()-e.valueOf())+" ms")},i.prototype.DrawEntity=function(n){this._entities.hasOwnProperty(n.EntityId)?this._entities[n.EntityId].Show():this.AddEntity(n)},i.prototype.DrawIssueShapeMarker=function(n){var t=i.GetIssueKey(n);this._issueMarkers.hasOwnProperty(t)?this._issueMarkers[t].forEach(function(n){return n.Show()}):this.AddIssueMarker(n)},i.prototype.DrawIssueShapeGeometry=function(n){var t=i.GetIssueKey(n);this._issuesGeom.hasOwnProperty(t)?this._issuesGeom[t].forEach(function(n){return n.Show()}):this.AddIssueShapeGeometry(n)},i.prototype.DrawTravelTimePath=function(r,u){var f,e,o;this._travelTimePaths.hasOwnProperty(r)?this._travelTimePaths[r].forEach(function(n){return n.Show()}):(this._travelTimePaths[r]=[],e=t.Popup.Utilities.GetPopupRendererForTravelTime(u,this),o=this._polylineLayer.AddPolyline({path:u.geometry,strokeColor:(f=u.Color)!==null&&f!==void 0?f:"#8800ff",strokeOpacity:.5,strokeStyle:n.Common.LineType.Solid,strokeThickness:10,popupRenderer:e}),this._travelTimePaths[r].push(o),t.Settings.InjectedSettings.installationType=="durham"&&this._travelTimePaths[r].push(this._iconLayer.AddMarker({icon:this._spriteService.GetMapIconForSprite(i.TRAVEL_TIME_MARKER_SPRITE),position:u.popupAnchor,popupRenderer:e,fixedSizePx:t.Settings.InjectedSettings.iconFixedWidthPx})))},i.prototype.DrawClusterMarker=function(i,r){var a=this,s,h,c,o,f,e,l;if(this._clusters[i]||(this._clusters[i]={}),o=this._clusters[i],o[r.id]||(o[r.id]=[]),f=o[r.id],f.length>0)f.forEach(function(n){return n.Show()});else{e=null;r.issueShapes.length===1?e=r.issueShapes[0].MarkerInfo.RoadClosureType:r.issueShapes.length>1&&(e=r.issueShapes.map(function(n){return n.MarkerInfo.RoadClosureType}).reduce(function(t,i){return n.RoadClosureTypePriority(t)<n.RoadClosureTypePriority(i)?i:t}));var y=!((s=r.entities)===null||s===void 0?void 0:s.length)&&!r.issueShapes.some(function(n){return!n.parentIssue.Planned}),p=!((h=r.entities)===null||h===void 0?void 0:h.length)&&t.Settings.InjectedSettings.installationType.toLowerCase()=="capitalprojects"&&!r.issueShapes.some(function(n){return n.parentIssue.CapitalProjectsStatus!=t.Data.CapitalProjectsStatus.Ended}),v=t.Popup.Utilities.GetPopupRendererForCluster(r,this._map,this._localizationManager,this._popupController,this._spriteService,this),u=this._clusterLayer.AddMarker({position:r.location,icon:this._spriteService.GetClusterIcon(r),popupRenderer:v,fixedSizePx:t.Settings.InjectedSettings.iconFixedWidthPx});f.push(u);this._visibleClusters.push(u);l=!0;((c=r.entities)===null||c===void 0?void 0:c.length)||r.issueShapes.some(function(n){return n.parentIssue.IssueId!=r.issueShapes[0].parentIssue.IssueId})||(l=!1);l&&(u=this._underlayLayer.AddMarker({position:r.location,popupRenderer:v,icon:this._spriteService.GetClusterUnderlayIcon(r),fixedSizePx:t.Settings.InjectedSettings.iconFixedWidthPx*1.5}),f.push(u),this._visibleClusters.push(u));e!=null&&this._spriteService.GetRoadClosureOverlayIcon(e)&&(u=this._overlayLayer.AddMarker({position:r.location,icon:this._spriteService.GetRoadClosureOverlayIcon(e),fixedSizePx:t.Settings.InjectedSettings.iconFixedWidthPx,popupRenderer:null}),f.push(u),this._visibleClusters.push(u));y&&(u=this._overlayLayer.AddMarker({position:r.location,icon:this._spriteService.GetPlannedOverlayIcon(),fixedSizePx:t.Settings.InjectedSettings.iconFixedWidthPx,popupRenderer:null}),f.push(u),this._visibleClusters.push(u));p&&(u=this._overlayLayer.AddMarker({position:r.location,icon:this._spriteService.GetPastOverlayIcon(),fixedSizePx:t.Settings.InjectedSettings.iconFixedWidthPx,popupRenderer:null}),f.push(u),this._visibleClusters.push(u));r.issueShapes.forEach(function(n){u=a.AddIssueShapeGeometry(n);u&&(f.push(u),a._visibleClusters.push(u))})}},i.prototype.AddEntity=function(n){var i=this._iconLayer.AddMarker({position:n.position,icon:this._spriteService.GetMapIconForSprite(n.IconClass),popupRenderer:t.Popup.Utilities.GetPopupRendererForEntity(n,this),fixedSizePx:t.Settings.InjectedSettings.iconFixedWidthPx});this._entities[n.EntityId]=i},i.prototype.AddIssueMarker=function(n){var r=i.GetIssueKey(n),u,e,f;this._issueMarkers.hasOwnProperty(r)||(this._issueMarkers[r]=[]);u=n.MarkerInfo.markerLocation;e=t.Popup.Utilities.GetPopupRendererForIssueShape(n,this._localizationManager,this._spriteService,this);this._issueMarkers[r].push(this._iconLayer.AddMarker({icon:this._spriteService.GetMapIconForSprite(n.MarkerInfo.IconClass),position:u,popupRenderer:e,fixedSizePx:t.Settings.InjectedSettings.iconFixedWidthPx}));n.parentIssue.Planned&&this._issueMarkers[r].push(this._overlayLayer.AddMarker({icon:this._spriteService.GetPlannedOverlayIcon(),position:u,popupRenderer:null,fixedSizePx:t.Settings.InjectedSettings.iconFixedWidthPx}));t.Settings.InjectedSettings.installationType.toLowerCase()=="capitalprojects"&&n.parentIssue.CapitalProjectsStatus==t.Data.CapitalProjectsStatus.Ended&&this._issueMarkers[r].push(this._overlayLayer.AddMarker({icon:this._spriteService.GetPastOverlayIcon(),position:u,popupRenderer:null,fixedSizePx:t.Settings.InjectedSettings.iconFixedWidthPx}));n.MarkerInfo.RoadClosureType!=0&&(f=this._spriteService.GetRoadClosureOverlayIcon(n.MarkerInfo.RoadClosureType),f&&this._issueMarkers[r].push(this._overlayLayer.AddMarker({icon:f,position:u,popupRenderer:null,fixedSizePx:t.Settings.InjectedSettings.iconFixedWidthPx})))},i.prototype.AddIssueShapeGeometry=function(n){var f=i.GetIssueKey(n),r,u;if(this._issuesGeom.hasOwnProperty(f)||(this._issuesGeom[f]=[]),r=t.Popup.Utilities.GetPopupRendererForIssueShape(n,this._localizationManager,this._spriteService,this),n.Type==t.Data.ShapeType.Circle)return this.AddIssueCircle(n,r);if(n.NumPoints===1)return null;switch(n.Type){case t.Data.ShapeType.Polygon:u=this._geometryLayer.AddPolygon({fillColor:n.Color,fillOpacity:n.FillOpacity,strokeColor:n.Color,strokeOpacity:n.LineOpacity,strokeThickness:n.LineThickness,strokeStyle:n.LineType,popupRenderer:r,path:n.path});break;case t.Data.ShapeType.Polyline:u=this._polylineLayer.AddPolyline({path:n.path,strokeColor:n.Color,strokeOpacity:n.LineOpacity,strokeStyle:n.LineType,strokeThickness:n.LineThickness,popupRenderer:r});break;default:throw new Error("Invalid/Unknown shape type: "+n.Type);}return this._issuesGeom[f].push(u),u},i.prototype.AddIssueCircle=function(n,t){var u=i.GetIssueKey(n),r=this._geometryLayer.AddCircle({centre:n.path[0],fillColor:n.Color,fillOpacity:n.FillOpacity,radiusMetres:n.RadiusMetres,strokeColor:n.Color,strokeOpacity:n.LineOpacity,strokeStyle:n.LineType,strokeThickness:n.LineThickness,popupRenderer:t});return this._issuesGeom[u].push(r),r},i.GetIssueKey=function(n){return n.parentIssue.IssueId+"|"+n.idxInParent.toString()},i.ICON_OVERLAY_LAYER_KEY="icon_overlays",i.UNDERLAY_LAYER_KEY="underlays",i.ICON_LAYER_KEY="icons",i.GEOMETRY_LAYER_KEY="geometry",i.POLYLINE_LAYER_KEY="polylines",i.CLUSTER_LAYER_KEY="clusters",i.TRAVEL_TIME_WINDOW_LAYER_KEY="tt-windows",i.TRAVEL_TIME_MARKER_SPRITE="spriteTimeSmallIcon",i}();i.MapService=r})(i=t.Map||(t.Map={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(n){if(this._map=n,this._visible=!1,this._layer=null,!n)throw new Error("Map is null");}return n.prototype.Show=function(){this._visible||(this._layer||(this._layer=new google.maps.TrafficLayer),this._layer.setMap(this._map.GetGMap()),this._visible=!0)},n.prototype.Hide=function(){this._visible&&(this._layer.setMap(null),this._visible=!1)},n}();n.GoogleTrafficOverlay=t})(t=n.Overlay||(n.Overlay={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={}));__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){var i=function(n){function t(t,i){var r=n.call(this,t.position)||this;if(r._mapService=i,!t)throw new Error("Camera is null");return r._entity=t,r.OnPopupClickedAction=function(){return i.ShowSelectedUnderlay(r.GetPopupLocation())},r.OnPopupClosedAction=function(){return i.HideSelectedUnderlay()},r}return __extends(t,n),t.prototype.GetPopupContentInternal=function(){var n=this._entity.ImageUrl;return n+=this._entity.ImageUrl.indexOf("?")===-1?"?salt="+(new Date).getTime():"&salt="+(new Date).getTime(),'<img src="'+n+'" style="width:100%"><\/img>'},t}(n.Common.Map.Popup.PopupRenderer);t.CameraPopupRenderer=i})(i=t.Popup||(t.Popup={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(n,t){var i=this;if(this._cluster=n,this._map=t,this.OnPopupClickedOverrideAction=function(){i._map.SetBounds(i._cluster.coveredRegion)},!n)throw new Error("Cluster is null");if(!t)throw new Error("Map is null");}return n.prototype.GetPopupContent=function(){return null},n.prototype.GetPopupLocation=function(){return null},n}();n.ClusterPopupRenderer=t})(t=n.Popup||(n.Popup={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={}));__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){var i=function(n){function t(t,i){var r=n.call(this,t.position)||this;if(r._mapService=i,!t)throw new Error("Cms is null");return r._entity=t,r.OnPopupClickedAction=function(){return i.ShowSelectedUnderlay(r.GetPopupLocation())},r.OnPopupClosedAction=function(){return i.HideSelectedUnderlay()},r}return __extends(t,n),t.prototype.GetPopupContentInternal=function(){var n;return((n=this._entity.CurrentMessageText)===null||n===void 0?void 0:n.length)?'<p class="popup-cms-message">'+this._entity.CurrentMessageText+"<\/p>":'<p class="popup-cms-message">(No message posted)<\/p>'},t}(n.Common.Map.Popup.PopupRenderer);t.CmsPopupRenderer=i})(i=t.Popup||(t.Popup={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={}));__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){var r=function(i){function r(n,t,r,u){var f=i.call(this,n.MarkerInfo.markerLocation)||this;if(f._issueShape=n,f._localizationManager=t,f._spriteService=r,f._mapService=u,f.locationTypeOmitList=["Issue Location"],!t)throw new Error("LocalizationManager is null");if(!r)throw new Error("Sprite service is null");return f._issueShape=n,f._localizationManager=t,f.OnPopupClickedAction=function(){return u.ShowSelectedUnderlay(f.GetPopupLocation())},f.OnPopupClosedAction=function(){return u.HideSelectedUnderlay()},f}return __extends(r,i),r.prototype.GetPopupContentInternal=function(){var i=this._issueShape.parentIssue.Description,c=this._issueShape.parentIssue.Source,e=null,u,s,r,f,h;!this._issueShape.MarkerInfo.LocationTypeId||(u=this._localizationManager.GetLocationTypeNameById(this._issueShape.MarkerInfo.LocationTypeId),u&&this.locationTypeOmitList.filter(function(n){return n==u}).length==0&&(e='<span class="issuelocationtype">('+u+")<\/span>"));var o=$("<div>"),v=this._issueShape.MarkerInfo.RoadClosureType!=0?': <span class="closuretype">'+this._localizationManager.GetRoadClosureTypeName(this._issueShape.MarkerInfo.RoadClosureType)+"<\/span>":"",l=$('\n\t\t\t<div class="popover-title">\n\t\t\t\t<div class="text">\n\t\t\t\t\t<span class="issuetype">\n\t\t\t\t\t\t'+this._issueShape.parentIssue.TableViewInfo.issueTypeString+"\n\t\t\t\t\t<\/span>\n\t\t\t\t\t"+(e?e:"")+"\n\t\t\t\t\t"+v+'\n\t\t\t\t<\/div>\n\t\t\t\t<div class="popup-title-icon">\n\t\t\t\t<\/div>\n\t\t\t<\/div>'),a=$(".popup-title-icon",l);return n.Utilities.AddIconClassProperties(a,this._spriteService.GetMapIconForSprite(this._issueShape.MarkerInfo.IconClass),!0,32),this._issueShape.MarkerInfo.RoadClosureType!=0&&(s=$("<span><\/span>"),n.Utilities.AddIconClassProperties(s,this._spriteService.GetRoadClosureOverlayIcon(this._issueShape.MarkerInfo.RoadClosureType),!0,32),a.append(s)),o.append(l),r=$('<div class="popover">'),this._issueShape.MarkerInfo.LocationName&&r.append('\n\t\t\t\t\t<div class="popover-section locationname">\n\t\t\t\t\t\t<span><b>'+t.Settings.Resources.TextIssueLocation+":<\/b> "+this._issueShape.MarkerInfo.LocationName+"<\/span>\n\t\t\t\t\t<\/div>"),(i.ProposedStartTimeUtcEpochMillis||i.ProposedEndTimeUtcEpochMillis)&&(f=$('<div class="popover-time-frame popover-section">'),i.ProposedStartTimeUtcEpochMillis&&f.append('\n\t\t\t\t\t\t<div class="popover-time-starts">\n\t\t\t\t\t\t\t<strong>'+t.Settings.Resources.TextIssueStarts+":<\/strong>\n\t\t\t\t\t\t\t<span>"+n.Utilities.DateTimeUtcEpochMillisecondsToLocal(i.ProposedStartTimeUtcEpochMillis)+"<\/span>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t"),i.ProposedEndTimeUtcEpochMillis&&f.append('\n\t\t\t\t\t\t<div class="popover-time-ends">\n\t\t\t\t\t\t\t<strong>'+t.Settings.Resources.TextIssueEnds+":<\/strong>\n\t\t\t\t\t\t\t<span>"+n.Utilities.DateTimeUtcEpochMillisecondsToLocal(i.ProposedEndTimeUtcEpochMillis)+"<\/span>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t"),r.append(f)),i.BaseDescription&&r.append('<div class="popover-section">'+i.BaseDescription+"<\/div>"),i.Files&&i.Files.length>0&&(h=$('<div class="popover-section">'),h.append(i.Files.map(function(n){var t="";return n.FileDesc&&(t+='<span class="file-description">'+n.FileDesc+"<\/span>"),t+('<a href="'+n.FilePath+'" target="_blank">'+n.FileName+"<\/a>")}).join("<\/br>")),r.append(h)),c&&r.append('\n\t\t\t\t\t<div class="popover-section">\n\t\t\t\t\t\t<strong>'+t.Settings.Resources.TextIssueSource+"<\/strong>: "+c+"\n\t\t\t\t\t<\/div>\n\t\t\t\t"),i.ContactInfo&&r.append('\n\t\t\t\t\t<div class="popover-section">\n\t\t\t\t\t\t<strong>'+t.Settings.Resources.TextIssueContactInfo+"<\/strong>: "+i.ContactInfo+"\n\t\t\t\t\t<\/div>\n\t\t\t\t"),i.ManagementUrl&&r.append('\n\t\t\t\t\t<div class="popover-section">\n\t\t\t\t\t\t<strong>'+t.Settings.Resources.TextIssueWebsite+'<\/strong>\n\t\t\t\t\t\t<a href="'+i.ManagementUrl+'" target="_blank">'+i.ManagementUrl+"<\/a>\n\t\t\t\t\t<\/div>\n\t\t\t\t"),o.append(r),o[0]},r}(n.Common.Map.Popup.PopupRenderer);i.IssuePopupRenderer=r})(i=t.Popup||(t.Popup={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={})),function(n){var t;(function(t){var i;(function(i){var r=function(){function r(n,t,i,r,u){if(this._samePointMarker=n,this._localizationManager=t,this._popupController=i,this._spriteService=r,this._mapService=u,this.OnPopupClickedOverrideAction=null,!n)throw new Error("Same point marker is null");if(!t)throw new Error("Localization manager is null");if(!i)throw new Error("PopupController is null");if(!r)throw new Error("Sprite service is null");if(!u)throw new Error("Map service is null");}return r.prototype.GetPopupContent=function(){var r=this,u=$("<div><\/div>");return u.addClass("same-point-popup-btn-list"),this._samePointMarker.issueShapes.forEach(function(f){var s=f.parentIssue.TableViewInfo.issueTypeString,c,o,e,h,l;f.MarkerInfo.RoadClosureType!=0&&(s+=" - "+r._localizationManager.GetRoadClosureTypeName(f.MarkerInfo.RoadClosureType));!f.MarkerInfo.LocationTypeId||(c=r._localizationManager.GetLocationTypeNameById(f.MarkerInfo.LocationTypeId),s+=" - "+c);o="";f.parentIssue.Description.ProposedStartTimeUtcEpochMillis&&(o=n.Utilities.DateTimeUtcEpochMillisecondsToLocal(f.parentIssue.Description.ProposedStartTimeUtcEpochMillis));f.parentIssue.Description.ProposedEndTimeUtcEpochMillis&&f.parentIssue.Description.ProposedStartTimeUtcEpochMillis&&(o+=" - "+n.Utilities.DateTimeUtcEpochMillisecondsToLocal(f.parentIssue.Description.ProposedEndTimeUtcEpochMillis));e=[r._spriteService.GetMapIconForSprite(f.MarkerInfo.IconClass)];f.parentIssue.Planned&&e.push(r._spriteService.GetPlannedOverlayIcon());t.Settings.InjectedSettings.installationType.toLowerCase()=="capitalprojects"&&f.parentIssue.CapitalProjectsStatus==t.Data.CapitalProjectsStatus.Ended&&e.push(r._spriteService.GetPastOverlayIcon());f.MarkerInfo.RoadClosureType&&e.push(r._spriteService.GetRoadClosureOverlayIcon(f.MarkerInfo.RoadClosureType));h=r.CreateRow(s,e,o);l=i.Utilities.GetPopupRendererForIssueShape(f,r._localizationManager,r._spriteService,r._mapService);h.click(function(){return r._popupController.SetActivePopup(l)});u.append(h)}),this._samePointMarker.entities.forEach(function(t){var f=r.CreateRow(n.Utilities.EntityTypeToDisplayString(t.EntityType)+" - "+t.Location,[r._spriteService.GetMapIconForSprite(t.IconClass)],null),e=i.Utilities.GetPopupRendererForEntity(t,r._mapService);f.click(function(){return r._popupController.SetActivePopup(e)});u.append(f)}),u[0]},r.prototype.CreateRow=function(i,r,u){var e=$('<div class="same-point-marker-popup-row"><\/div>'),f=$('<span class="same-point-marker-popup-icon"><\/span>'),o=$('<div class="same-point-marker-popup-text">\n\t\t\t\t\t\t\t\t<span>'+i+'<span>\n\t\t\t\t\t\t\t\t<span class="same-point-marker-date-text">'+(u||"")+"<\/span>\n\t\t\t\t\t\t\t<\/div>");return r===null||r===void 0?void 0:r.forEach(function(i){var r=$("<span><\/span>");n.Utilities.AddIconClassProperties(r,i,!0,t.Settings.InjectedSettings.iconFixedWidthPx);f.append(r)}),f.css("width",t.Settings.InjectedSettings.iconFixedWidthPx),f.css("height",t.Settings.InjectedSettings.iconFixedWidthPx),e.append(f).append(o),e},r.prototype.GetPopupLocation=function(){return this._samePointMarker.location},r}();i.SamePointPopupRenderer=r})(i=t.Popup||(t.Popup={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={}));__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){var i=function(t){function i(n,i){var r=t.call(this,n.popupAnchor)||this;if(r._mapService=i,!n)throw new Error("Travel Time Path is null");return r._path=n,r.OnPopupClickedAction=function(){return i.ShowSelectedUnderlay(r.GetPopupLocation())},r.OnPopupClosedAction=function(){return i.HideSelectedUnderlay()},r}return __extends(i,t),i.prototype.GetPopupContentInternal=function(){var u=function(t){var o=$("<tr>").addClass("popover-travel-time-speed-row"),r,s,u,f,e,h,i;return t.CurrentTravelTimeSeconds?(s=t.CurrentTravelTimeSeconds-t.IdealTravelTimeSeconds,r=t.CurrentTravelTimeSeconds>t.IdealTravelTimeSeconds+30?n.Utilities.TravelTimeToDisplayString(s).addClass("slow"):$("<span>None<\/span>").addClass("fast")):r=n.Utilities.TravelTimeToDisplayString(null),u=$('\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<div class="current-time">\n\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/td>'),$(".current-time",u).append(n.Utilities.TravelTimeToDisplayString(t.CurrentTravelTimeSeconds)),f=$('\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<div class="ideal-time"><\/div>\n\t\t\t\t\t\t<\/td>'),$(".ideal-time",f).append(n.Utilities.TravelTimeToDisplayString(t.IdealTravelTimeSeconds).addClass("fast")),e=$('\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<div class="delay-time"><\/div>\n\t\t\t\t\t\t<\/td>'),$(".delay-time",e).append(r),h=t.DescOverride||t.MainStreetName+" from "+t.FromStreetName+" to "+t.ToStreetName,i=$('<td><div class="tt-info-hover fa fa-info"><\/div><span class="tt-dir-content">'+t.directionStr+'<\/span><div class="tt-hover-content">'+h+"<\/div><\/td>"),$(".tt-info-hover",i).hover(function(){$(".tt-hover-content",i).show()},function(){$(".tt-hover-content",i).hide()}),o.append(i).append(u).append(f).append(e),o[0]},f=$("<div>"),i=$("<div>").addClass("popover"),e=$("<div>").addClass("travel-time-title").append("<span>"+(this._path.TitleOverride||this._path.Forward.MainStreetName)+"<\/span>").appendTo(i),t,r;return f.append(i),t=$("<table class='travel-time-popup-speed-table'>"),t.append("\n\t\t\t\t\t<thead>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Direction<\/td>\n\t\t\t\t\t\t\t<td>Current<\/td>\n\t\t\t\t\t\t\t<td>Ideal<\/td>\n\t\t\t\t\t\t\t<td>Delay<\/td>\n\t\t\t\t\t\t<\/tr>\n\t\t\t\t\t<\/thead>"),r=$("<tbody>").appendTo(t),r.append(u(this._path.Forward)),this._path.Backward&&r.append(u(this._path.Backward)),i.append(t),f.html()},i}(n.Common.Map.Popup.PopupRenderer);t.TravelTimePathPopupRenderer=i})(i=t.Popup||(t.Popup={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={})),function(n){var t;(function(n){var t;(function(n){var t;(function(t){function i(t,i){switch(t.EntityType){case 3:return new n.CameraPopupRenderer(t,i);case 2:return new n.CmsPopupRenderer(t,i);default:throw new Error("Entity type unknown or not implemented: "+t.EntityType);}}function r(t,i,r,u){return new n.IssuePopupRenderer(t,i,r,u)}function u(t,i,r,u,f,e){if(!t)throw new Error("cluster is null");var o=t;return o&&o.kind==="ISamePointMarker"?new n.SamePointPopupRenderer(o,r,u,f,e):new n.SamePointPopupRenderer(t,r,u,f,e)}function f(t,i){return new n.TravelTimePathPopupRenderer(t,i)}t.GetPopupRendererForEntity=i;t.GetPopupRendererForIssueShape=r;t.GetPopupRendererForCluster=u;t.GetPopupRendererForTravelTime=f})(t=n.Utilities||(n.Utilities={}))})(t=n.Popup||(n.Popup={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={})),function(n){var t;(function(t){var i;(function(t){var i=function(){function t(i,r,u){if(u===void 0&&(u=t.$EmbedContainer),this._map=i,this._config=r,this._$embedContainer=u,!i)throw new Error("Map is null");if(!r)throw new Error("Sidebar state method is null");if(!((u===null||u===void 0?void 0:u.length)>0))throw new Error("Embed container is null");$("#EmbedComponentContainer input").change(this.UpdateEmbedLink.bind(this));t.$CopyToClipboard.on("click keyup",function(i){(i.type==="click"||i.which===13)&&(n.Utilities.CopyElementTextToClipboard(t.$EmbedContainer.find("#EmbedLink")),$("#EmbedLinkCopiedPopup").show().delay(1e3).fadeOut("slow"))})}return Object.defineProperty(t,"$EmbedContainer",{get:function(){return $("#EmbedContainer")},enumerable:!0,configurable:!0}),Object.defineProperty(t,"$HideSidebar",{get:function(){return $("#Embed_HideSidebar")},enumerable:!0,configurable:!0}),Object.defineProperty(t,"$SidebarState",{get:function(){return $("#Embed_SidebarState")},enumerable:!0,configurable:!0}),Object.defineProperty(t,"$UrlOnly",{get:function(){return $("#Embed_UrlOnly")},enumerable:!0,configurable:!0}),Object.defineProperty(t,"$CopyToClipboard",{get:function(){return $("#EmbedCopyToClipboardBtn")},enumerable:!0,configurable:!0}),t.prototype.UpdateEmbedLink=function(){var n=this.GetMetaSettings(),t=this.GenerateEmbedIFrame(n);this._$embedContainer.find("#EmbedLink").text(t)},t.prototype.GetMetaSettings=function(){return{MapViewSettings:!0,SidebarSettings:t.$SidebarState.is(":checked")}},t.prototype.GenerateViewStateParams=function(n){var i=[],r;return n.MapViewSettings&&(r=this._map.GetCentre(),i.push({key:"lat",value:r.LatX.toString()}),i.push({key:"lng",value:r.LngY.toString()}),i.push({key:"zoom",value:this._map.GetZoom().toString()})),n.SidebarSettings&&i.push({key:"sidebarState",value:this._config.GetSidebarStateBase64()}),t.$HideSidebar.is(":checked")&&i.push({key:"sidebarHidden",value:"true"}),this.GetCustomParams().forEach(function(n){return i.push(n)}),i},t.prototype.GenerateEmbedSourceUrl=function(t){return n.Utilities.GetRootUrl()+"?"+t.map(function(n){return n.key+"="+n.value}).join("&")},t.prototype.GenerateEmbedIFrame=function(n){var r=this.GenerateViewStateParams(n),i=this.GenerateEmbedSourceUrl(r);return t.$UrlOnly.is(":checked")?i:'<iframe width="600" height="400" src="'+i+'"><\/iframe>'},t}();t.EmbedController=i})(i=t.Settings||(t.Settings={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={})),function(n){var t;(function(n){var t;(function(n){n.InjectedSettings=INJECTED_SETTINGS})(t=n.Settings||(n.Settings={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={})),function(n){var t;(function(n){var t;(function(n){n.Resources=RESOURCES})(t=n.Settings||(n.Settings={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(){this.$Container=null;this._stateChangedListeners=[]}return n.prototype.AddStateChangedListener=function(n){if(!n)throw new Error("Listener is null");this._stateChangedListeners.push(n)},n.prototype.OnStateChanged=function(){this._stateChangedListeners.forEach(function(n){return n()})},n.prototype.SubscribeToChildStateChanges=function(){var n=this;this.Children.forEach(function(t){return t.AddStateChangedListener(n.OnStateChanged.bind(n))})},n}();n.SidebarElement=t})(t=n.Sidebar||(n.Sidebar={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={}));__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(n){var t;(function(t){var i=function(t){function i(n,i){i===void 0&&(i=!0);var r=t.call(this)||this;return r._id=n,r._enabled=i,r}return __extends(i,t),Object.defineProperty(i.prototype,"Id",{get:function(){return this._id},enumerable:!0,configurable:!0}),i.prototype.OnAppended=function(){n.UI.A11y.OnActivate(this.$Container,this.Toggle.bind(this));this.AddDOM();this.UpdateUI()},i.prototype.ExecuteChange=function(){this.UpdateUI();this.OnStateChanged()},Object.defineProperty(i.prototype,"IsEnabled",{get:function(){return this._enabled},enumerable:!0,configurable:!0}),i.prototype.Enable=function(){this._enabled=!0;this.ExecuteChange()},i.prototype.Disable=function(){this._enabled=!1;this.ExecuteChange()},i.prototype.Toggle=function(){this._enabled=!this._enabled;this.ExecuteChange()},i}(t.SidebarElement);t.SidebarToggleButton=i})(t=n.Sidebar||(n.Sidebar={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={}));__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(n){var t;(function(t){var i=function(t){function i(n,i,r){var u=t.call(this)||this;if(u.Id=n,u._content=i,u.TriggerEvent=r,!r)throw new Error("Trigger event is null");return u}return __extends(i,t),i.prototype.Trigger=function(){this.TriggerEvent()},i.prototype.OnAppended=function(){var t=$('<div class="sidebar-btn sidebar-trigger-button" tabindex="0">\n\t\t\t\t<\/div>');t.append($(this._content));n.UI.A11y.OnActivate(this.$Container,this.Trigger.bind(this));this.$Container.append(t)},i.prototype.UpdateUI=function(){throw new Error("Method not implemented.");},Object.defineProperty(i.prototype,"Children",{get:function(){return[]},enumerable:!0,configurable:!0}),i}(t.SidebarElement);t.SidebarTriggerButton=i})(t=n.Sidebar||(n.Sidebar={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={}));__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(n){var t;(function(n){var t=function(n){function t(t,i){var r=this,u=function(){r.ShowModal()};return r=n.call(this,t,"<span>"+i+"<\/span>",u)||this}return __extends(t,n),t.prototype.OnAppended=function(){n.prototype.OnAppended.call(this);this.$Container.find(".sidebar-btn").addClass("sidebar-footer-text-btn")},t.prototype.ShowModal=function(){$("#"+this.ModalId).modal("show")},t}(n.SidebarTriggerButton);n.SidebarFooterModalButton=t})(t=n.Sidebar||(n.Sidebar={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={}));__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){var r=function(i){function r(n,t,r){var u=i.call(this,n)||this;return u._label=t,u._icon=r,u._removeBottomMargin=!1,t||console.warn("Button has no label"),u}return __extends(r,i),Object.defineProperty(r.prototype,"Children",{get:function(){return[]},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"faCurrentClass",{get:function(){return this.IsEnabled?r.FA_ENABLED_CLASS:r.FA_DISABLED_CLASS},enumerable:!0,configurable:!0}),r.prototype.AddDOM=function(){var i=$('<div tabindex="0" class="sidebar-btn sidebar-toggle-button-default \n\t\t\t\t\t\tsidebar-toggle-button-default-'+(this.IsEnabled?"enabled":"disabled")+'">\n\t\t\t\t\t<span class="sidebar-btn-check"><img width="16" height="16" src="'+t.Settings.InjectedSettings.checkSvgContentPath+'" aria-hidden="true"/><\/span>\n\t\t\t\t\t<span class="sidebar-btn-icon"><\/span>\n\t\t\t\t\t<span class="sidebar-btn-label">'+this._label+"<\/span>\n\t\t\t\t<\/div>");this.$Container.append(i);this._icon?n.Utilities.AddIconClassProperties(i.children(".sidebar-btn-icon"),this._icon,!0,24):i.children(".sidebar-btn-icon").remove()},r.prototype.UpdateUI=function(){if(this.$Container){var n=this.$Container.children().first();this._removeBottomMargin&&n.css("margin-bottom","0");this.IsEnabled?(n.removeClass("sidebar-toggle-button-default-disabled").addClass("sidebar-toggle-button-default-enabled"),n.find("i.fa").removeClass(r.FA_DISABLED_CLASS).addClass(r.FA_ENABLED_CLASS)):(n.removeClass("sidebar-toggle-button-default-enabled").addClass("sidebar-toggle-button-default-disabled"),n.find("i.fa").removeClass(r.FA_ENABLED_CLASS).addClass(r.FA_DISABLED_CLASS))}},r.prototype.RemoveMarginBelow=function(){this._removeBottomMargin=!0;this.$Container&&this.UpdateUI()},r.FA_ENABLED_CLASS="fa-check-square",r.FA_DISABLED_CLASS="fa-square-o",r}(i.SidebarToggleButton);i.SidebarToggleButtonDefault=r})(i=t.Sidebar||(t.Sidebar={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={}));__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(n){var t;(function(n){var t=function(t){function i(i,r,u,f){var e=t.call(this)||this;return e.activeBtn=null,e.futureBtn=null,e.state={Active:i,Future:r},e.activeBtn=new n.SidebarTimeButton(u),e.futureBtn=new n.SidebarTimeButton(f,!0),e}return __extends(i,t),Object.defineProperty(i.prototype,"IsActiveEnabled",{get:function(){return this.activeBtn.IsEnabled},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"IsFutureEnabled",{get:function(){return this.futureBtn.IsEnabled},enumerable:!0,configurable:!0}),i.prototype.OnAppended=function(){var n=this;this.$Container.addClass("sidebar-time-selector");this.Children.forEach(function(t){t.$Container=$("<div>");n.$Container.append(t.$Container)});this.Children.forEach(function(n){return n.OnAppended()});this.state.Active||this.activeBtn.Disable();this.state.Future||this.futureBtn.Disable()},i.prototype.UpdateUI=function(){this.Children.forEach(function(n){return n.UpdateUI()})},Object.defineProperty(i.prototype,"Children",{get:function(){return[this.activeBtn,this.futureBtn]},enumerable:!0,configurable:!0}),i}(n.SidebarElement);n.SidebarTimeSelectorDefault=t})(t=n.Sidebar||(n.Sidebar={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={}));__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(n){var t;(function(n){var t=function(n){function t(){var t=n!==null&&n.apply(this,arguments)||this;return t._children=[],t}return __extends(t,n),t.prototype.Append=function(n){this._children.push(n)},t.prototype.OnAppended=function(){var n=this;this.$Container.addClass("sidebar-body");this._children.forEach(function(t){t.$Container=$("<div>");n.$Container.append(t.$Container);t.OnAppended()});this.SubscribeToChildStateChanges()},t.prototype.UpdateUI=function(){this._children.forEach(function(n){return n.UpdateUI()})},Object.defineProperty(t.prototype,"Children",{get:function(){return this._children},enumerable:!0,configurable:!0}),t}(n.SidebarElement);n.SidebarBody=t})(t=n.Sidebar||(n.Sidebar={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={}));__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(n){var t;(function(t){var i=function(t){function i(n){var i=t.call(this)||this;return i._label=n,i._onTriggeredCallbacks=[],i}return __extends(i,t),i.prototype.AddDOM=function(){this.$Container.text(this._label).addClass("sidebar-button-list-master-toggle-button").attr("tabindex",0)},i.prototype.OnAppended=function(){var t=this;n.UI.A11y.OnActivate(this.$Container,function(){t._onTriggeredCallbacks.forEach(function(n){return n()})});this.AddDOM();this.UpdateUI()},i.prototype.UpdateUI=function(){this._enabled?this.$Container.removeClass("disabled").attr("tabindex",0):this.$Container.addClass("disabled").attr("tabindex",-1)},i.prototype.Enable=function(){this._enabled=!0;this.UpdateUI()},i.prototype.Disable=function(){this._enabled=!1;this.UpdateUI()},Object.defineProperty(i.prototype,"Children",{get:function(){return[]},enumerable:!0,configurable:!0}),i.prototype.OnTriggered=function(n){this._onTriggeredCallbacks.push(n)},i}(t.SidebarElement),r=function(t){function r(n,i){var r=t.call(this)||this;return r.headerText=n,r._buttons=i,r._isAllSelected=!1,r._isNoneSelected=!1,r._buttons.forEach(function(n){return n.AddStateChangedListener(r.UpdateUI.bind(r))}),r.AddStateChangedListener(r.UpdateUI.bind(r)),r.UpdateState(),r}return __extends(r,t),Object.defineProperty(r.prototype,"Children",{get:function(){return[this._$allBtn,this._$noneBtn]},enumerable:!0,configurable:!0}),r.prototype.AddDOM=function(){var t=new n.Sidebar.SidebarHeading(this.headerText),i;t.$Container=$("<span>");t.OnAppended();i=$("<div>").addClass("sidebar-button-list-selector");this.$Container.addClass("sidebar-button-list-header-section").append(t.$Container).append(i.append(this._$allBtn.$Container).append($("<span>/<\/span>").css("margin","0px 3px")).append(this._$noneBtn.$Container))},r.prototype.OnAppended=function(){this._$allBtn=new i(n.Settings.Resources.TextAll);this._$noneBtn=new i(n.Settings.Resources.TextNone);this._$allBtn.$Container=$("<span>");this._$noneBtn.$Container=$("<span>");this._$allBtn.OnAppended();this._$noneBtn.OnAppended();this.AddDOM();this._$allBtn.OnTriggered(this.OnViewAllClick.bind(this));this._$noneBtn.OnTriggered(this.OnViewNoneClick.bind(this));this.UpdateUI()},r.prototype.UpdateUI=function(){this.UpdateState();this._isAllSelected?this._$allBtn.Disable():this._$allBtn.Enable();this._isNoneSelected?this._$noneBtn.Disable():this._$noneBtn.Enable()},r.prototype.OnViewAllClick=function(){this.UpdateState();this._buttons.forEach(function(n){return n.Enable()})},r.prototype.OnViewNoneClick=function(){this.UpdateState();this._buttons.forEach(function(n){return n.Disable()})},r.prototype.UpdateState=function(){this._isAllSelected=this._buttons.every(function(n){return n.IsEnabled});this._isNoneSelected=this._buttons.every(function(n){return!n.IsEnabled})},r}(t.SidebarElement),u=function(n){function t(t,i){var r=n.call(this)||this;return r.Buttons=t,r._options=i,r._master=null,r.SubscribeToChildStateChanges(),r}return __extends(t,n),Object.defineProperty(t.prototype,"Children",{get:function(){return this.Buttons},enumerable:!0,configurable:!0}),t.prototype.OnAppended=function(){var n=this;if(this._options.AddMasterToggle){if(!this._options.MasterToggleHeaderText)throw new Error("MasterToggleHeadeText is null when a master toggle is provided");this._master=new r(this._options.MasterToggleHeaderText,this.Buttons);this._master.$Container=$("<div><\/div>");this.$Container.append(this._master.$Container);this._master.OnAppended()}this.Buttons.forEach(function(t){t.$Container=$("<div><\/div>");n.$Container.append(t.$Container)});this.Buttons.forEach(function(n){return n.OnAppended()})},t.prototype.GetEnabledButtons=function(){return this.Buttons.filter(function(n){return n.IsEnabled})},t.prototype.GetDisabledButtons=function(){return this.Buttons.filter(function(n){return!n.IsEnabled})},t.prototype.UpdateUI=function(){this._master&&this._master.UpdateUI();this.Buttons.forEach(function(n){return n.UpdateUI()})},t}(t.SidebarElement);t.SidebarButtonList=u})(t=n.Sidebar||(n.Sidebar={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={}));__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(n){var t;(function(n){var t=function(n){function t(t,i){i===void 0&&(i=!1);var r=n.call(this,"sidebar-time-btn-"+t,t,null)||this;return r._last=i,r}return __extends(t,n),t.prototype.OnAppended=function(){n.prototype.OnAppended.call(this);this._last&&this.$Container.find(".sidebar-btn").css("margin-bottom","0")},t}(n.SidebarToggleButtonDefault),i;n.SidebarCapitalProjectsTimeButton=t;i=function(n){function i(i,r,u,f,e,o){var s=n.call(this,i,r,f,e)||this;return s._endedBtn=null,s.state.Ended=u,s.activeBtn=new t(f),s.futureBtn=new t(e),s._endedBtn=new t(o,!0),s.SubscribeToChildStateChanges(),s}return __extends(i,n),Object.defineProperty(i.prototype,"IsEndedEnabled",{get:function(){return this._endedBtn.IsEnabled},enumerable:!0,configurable:!0}),i.prototype.OnAppended=function(){n.prototype.OnAppended.call(this);this.state.Ended||this._endedBtn.Disable()},Object.defineProperty(i.prototype,"Children",{get:function(){return[this.activeBtn,this.futureBtn,this._endedBtn]},enumerable:!0,configurable:!0}),i}(n.SidebarTimeSelectorDefault);n.SidebarCapitalProjectsTimeSelector=i})(t=n.Sidebar||(n.Sidebar={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={}));__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){var r=function(i){function r(){return i.call(this,"sidebarShowLegendModalButton",t.Settings.Resources.TextShowLegend)||this}return __extends(r,i),Object.defineProperty(r.prototype,"ModalId",{get:function(){return"IconLegendModal"},enumerable:!0,configurable:!0}),r.prototype.OnAppended=function(){i.prototype.OnAppended.call(this);this.$Container.find(".sidebar-btn").prop("id","ShowLegendBtn")},Object.defineProperty(r,"$Modal",{get:function(){return $("#IconLegendModal")},enumerable:!0,configurable:!0}),Object.defineProperty(r,"$DynamicContent",{get:function(){return $("#IconLegendModalDynamicContent")},enumerable:!0,configurable:!0}),r.ReduceLabels=function(n,i){if(n.toLowerCase()!=="spriteissueicon")return i.reduce(function(n,t){return n+" / "+t});var r=t.Settings.Resources.TextIssueOther;return r+" ("+i.filter(function(n){return n.toLowerCase()!==r.toLowerCase()}).reduce(function(n,t){return n+" / "+t})+")"},r.UpdateLegendContent=function(i,u){var o=this,e=this.$DynamicContent,f;e.empty();f=$("<table>");i.forEach(function(t){var i=$("<td><span/><\/td>"),o=$("<td><span>"+r.ReduceLabels(t.iconClass,t.labels)+"<\/span><\/td >"),e;i.find("span").addClass("legend-modal-icon");e=$("<tr>");e.append(i).append(o);n.Utilities.AddIconClassProperties(i.find("span"),u.GetMapIconForSprite(t.iconClass),!0,32);f.append(e)});e.append("<h3>All Icons<\/h3>").append(f);t.UI.A11y.OnActivate($("#IconLegendModalCloseBtn").off("click"),function(){return o.$Modal.modal("toggle")})},r}(i.SidebarFooterModalButton);i.SidebarDurhamShowLegendModalButton=r})(i=t.Sidebar||(t.Sidebar={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(){this.$Container=null;this._stateChangedListeners=[]}return n.prototype.AddStateChangedListener=function(n){if(!n)throw new Error("Listener is null");this._stateChangedListeners.push(n)},n.prototype.OnStateChanged=function(){this._stateChangedListeners.forEach(function(n){return n()})},n.prototype.SubscribeToChildStateChanges=function(){var n=this;this.Children.forEach(function(t){return t.AddStateChangedListener(n.OnStateChanged.bind(n))})},n}();n.SidebarElement=t})(t=n.Sidebar||(n.Sidebar={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={}));__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(n){var t;(function(t){var i=function(t){function i(){return t.call(this,"embed-trigger-btn",n.Settings.Resources.TextEmbed)||this}return __extends(i,t),i.prototype.OnAppended=function(){t.prototype.OnAppended.call(this);this.$Container.attr("id","EmbedTriggerButton")},Object.defineProperty(i.prototype,"ModalId",{get:function(){return"EmbedModal"},enumerable:!0,configurable:!0}),i}(t.SidebarFooterModalButton);t.SidebarEmbedTriggerButton=i})(t=n.Sidebar||(n.Sidebar={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={}));__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(n){var t;(function(n){var t=function(n){function t(t){var i=n.call(this)||this;return i._children=t,i}return __extends(t,n),t.prototype.OnAppended=function(){var n=this;this.$Container.addClass("sidebar-footer");this._children.forEach(function(t){t.$Container=$("<div>");n.$Container.append(t.$Container);t.OnAppended()});this.SubscribeToChildStateChanges()},t.prototype.UpdateUI=function(){var n=this;this.Children.forEach(function(){return n.UpdateUI()})},Object.defineProperty(t.prototype,"Children",{get:function(){return this._children},enumerable:!0,configurable:!0}),t}(n.SidebarElement);n.SidebarFooter=t})(t=n.Sidebar||(n.Sidebar={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={}));__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(n){var t;(function(n){var t=function(n){function t(t,i){var r=n.call(this)||this;return r._labelText=t,r._url=i,r}return __extends(t,n),t.prototype.UpdateUI=function(){},Object.defineProperty(t.prototype,"Children",{get:function(){return[]},enumerable:!0,configurable:!0}),t.prototype.OnAppended=function(){var n=$("<a>").addClass("sidebar-btn").addClass("sidebar-footer-text-btn").attr("href",this._url).attr("target","_blank").text(this._labelText);this.$Container.append(n)},t}(n.SidebarElement);n.SidebarFooterLinkButton=t})(t=n.Sidebar||(n.Sidebar={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={}));__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(n){var t;(function(n){var t=function(n){function t(t,i){var r=this,u=function(){r.ShowModal()};return r=n.call(this,t,"<span>"+i+"<\/span>",u)||this}return __extends(t,n),t.prototype.OnAppended=function(){n.prototype.OnAppended.call(this);this.$Container.find(".sidebar-btn").addClass("sidebar-footer-text-btn")},t.prototype.ShowModal=function(){$("#"+this.ModalId).modal("show")},t}(n.SidebarTriggerButton);n.SidebarFooterModalButton=t})(t=n.Sidebar||(n.Sidebar={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={}));__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(n){var t;(function(n){var t=function(n){function t(t){var i=n.call(this)||this;return i._text=t,i}return __extends(t,n),t.prototype.OnAppended=function(){this.$Container.append('<span class="sidebar-heading">'+this._text+"<\/span>")},t.prototype.UpdateUI=function(){},Object.defineProperty(t.prototype,"Children",{get:function(){return[]},enumerable:!0,configurable:!0}),t}(n.SidebarElement);n.SidebarHeading=t})(t=n.Sidebar||(n.Sidebar={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={}));__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(n){var t;(function(n){var t=function(n){function t(t){var i=n.call(this)||this;return i._margin=t,i}return __extends(t,n),t.prototype.OnAppended=function(){var n=$('<hr class="sidebar-horizontal"/>');this._margin&&n.css({"margin-top":this._margin,"margin-bottom":this._margin});this.$Container.append(n)},t.prototype.UpdateUI=function(){},Object.defineProperty(t.prototype,"Children",{get:function(){return[]},enumerable:!0,configurable:!0}),t}(n.SidebarElement);n.SidebarHorizontalLine=t})(t=n.Sidebar||(n.Sidebar={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={}));__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(n){var t;(function(n){var t=function(n){function t(t){var i=n.call(this)||this;if(i._options=t,!t)throw new Error("options is null");return i}return __extends(t,n),Object.defineProperty(t.prototype,"Children",{get:function(){return[]},enumerable:!0,configurable:!0}),t.prototype.UpdateUI=function(){},t.prototype.MakeImg=function(){var t=$('<img class="sidebar-img" alt="Logo" src="'+this._options.imageUrl+'" tabindex="0"/>'),n;return this._options.linkUrl?(n=$('<a href="'+this._options.linkUrl+'" style="display: flex; justify-content: center;"><\/a>'),n.append(t),n):t},t.prototype.OnAppended=function(){this.$Container.append(this.MakeImg())},t}(n.SidebarElement);n.SidebarImage=t})(t=n.Sidebar||(n.Sidebar={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={}));__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(n){var t;(function(t){var i=function(i){function r(){var t=i!==null&&i.apply(this,arguments)||this;return t._currentlySelectedLocaleId=n.Settings.InjectedSettings.locale,t}return __extends(r,i),r.prototype.ChangeLang=function(n){window.location.href="./?language="+n},r.prototype.OnAppended=function(){var i=this;this._langBtns=n.Settings.InjectedSettings.locales.map(function(n){var r="";return n[0].toLowerCase()===i._currentlySelectedLocaleId.toLowerCase()&&(r="selected"),new t.SidebarTriggerButton(n[0],'<span class="lang-option '+r+'">'+n[1]+"<\/span>",function(){return i.ChangeLang(n[0])})});this.$Container.attr("id","SidebarLanguageSelector");this._langBtns.forEach(function(n,t){n.$Container=$("<div><\/div>");i.$Container.append(n.$Container);t!=i._langBtns.length-1&&i.$Container.append("<span class='lang-divider'>|<\/span>")});this._langBtns.forEach(function(n){return n.OnAppended()})},r.prototype.UpdateUI=function(){this._langBtns.forEach(function(n){return n.UpdateUI()})},Object.defineProperty(r.prototype,"Children",{get:function(){return this._langBtns},enumerable:!0,configurable:!0}),r}(t.SidebarElement);t.SidebarLanguageSelector=i})(t=n.Sidebar||(n.Sidebar={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={}));__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){var r=function(i){function r(){return i.call(this,"sidebarShowLegendModalButton",t.Settings.Resources.TextShowLegend)||this}return __extends(r,i),Object.defineProperty(r.prototype,"ModalId",{get:function(){return"IconLegendModal"},enumerable:!0,configurable:!0}),r.prototype.OnAppended=function(){i.prototype.OnAppended.call(this);this.$Container.find(".sidebar-btn").prop("id","ShowLegendBtn")},Object.defineProperty(r,"$Modal",{get:function(){return $("#IconLegendModal")},enumerable:!0,configurable:!0}),Object.defineProperty(r,"$DynamicContent",{get:function(){return $("#IconLegendModalDynamicContent")},enumerable:!0,configurable:!0}),r.ReduceLabels=function(n,i){if(n.toLowerCase()!=="spriteissueicon")return i.reduce(function(n,t){return n+" / "+t});var r=t.Settings.Resources.TextIssueOther,u=i.filter(function(n){return n!=null&&n.toLowerCase()!==r.toLowerCase()});return u.length?r+" ("+i.reduce(function(n,t){return n+" / "+t})+")":r},r.UpdateLegendContent=function(i,u,f){var c=this,o=this.$DynamicContent,h,e,s;o.empty();h=function(){if(!u.hasOwnProperty(e))return"continue";var t=$("<table>"),i=e,s=u[e];s.forEach(function(i){var u=$("<td><span/><\/td>"),o=$("<td><span><\/span><\/td>"),e;o.text(r.ReduceLabels(i.iconClass,i.labels));u.find("span").addClass("legend-modal-icon");e=$("<tr>");e.append(u).append(o);n.Utilities.AddIconClassProperties(u.find("span"),f.GetMapIconForSprite(i.iconClass),!0,32);t.append(e)});o.append("<h3>"+i+"<\/h3>").append(t)};for(e in u)h();s=$("<table>");i.forEach(function(t){var i=$("<td><span/><\/td>"),e=$("<td><span>"+r.ReduceLabels(t.iconClass,t.labels)+"<\/span><\/td >"),u;i.find("span").addClass("legend-modal-icon");u=$("<tr>");u.append(i).append(e);n.Utilities.AddIconClassProperties(i.find("span"),f.GetMapIconForSprite(t.iconClass),!0,32);s.append(u)});o.append("<h3>"+t.Settings.Resources.TextAllIcons+"<\/h3>").append(s);t.UI.A11y.OnActivate($("#IconLegendModalCloseBtn").off("click"),function(){return c.$Modal.modal("toggle")})},r}(i.SidebarFooterModalButton);i.SidebarM511ShowLegendModalButton=r})(i=t.Sidebar||(t.Sidebar={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={}));__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(n){var t;(function(t){var i=function(t){function i(){return t.call(this,"privacy-statement-trigger",n.Settings.Resources.TextPrivacyStatement)||this}return __extends(i,t),i.prototype.OnAppended=function(){t.prototype.OnAppended.call(this);this.$Container.find(".sidebar-btn").css("margin-bottom","0")},Object.defineProperty(i.prototype,"ModalId",{get:function(){return"privacyModal"},enumerable:!0,configurable:!0}),i}(t.SidebarFooterModalButton);t.SidebarPrivacyStatementTriggerButton=i})(t=n.Sidebar||(n.Sidebar={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={}));__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(n){var t;(function(n){var t=function(n){function t(t){var i=n.call(this)||this;if(i._elements=[],!t||t.length===0)throw new Error("Sidebar element not found");return i.$Container=t,i}return __extends(t,n),Object.defineProperty(t.prototype,"Children",{get:function(){return this._elements},enumerable:!0,configurable:!0}),t.prototype.Append=function(n){if(!n)throw new Error("element is null");return this._elements.push(n),this},t.prototype.OnAppended=function(){var n=this;if(!this.$Container)throw new Error("");this._elements.forEach(function(t){t.$Container=$("<div><\/div>");n.$Container.append(t.$Container)});this._elements.forEach(function(n){return n.OnAppended()});this.SubscribeToChildStateChanges()},t.prototype.UpdateUI=function(){this._elements.forEach(function(n){return n.UpdateUI()})},t}(n.SidebarElement);n.SidebarRoot=t})(t=n.Sidebar||(n.Sidebar={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={}));__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(n){var t;(function(t){var i=function(t){function i(n){var i=t.call(this)||this;if(i._options=n,i._hidden=!1,!n)throw new Error("options is null");return i._options.Collapsible&&i._options.StartCollapsed&&(i._hidden=!0),i.SubscribeToChildStateChanges(),i}return __extends(i,t),Object.defineProperty(i.prototype,"Children",{get:function(){return this._options.Children},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"IsCollapsed",{get:function(){return this._hidden},enumerable:!0,configurable:!0}),i.prototype.Hide=function(){this._hidden=!0;this.ExecuteCollapsedChange()},i.prototype.Show=function(){this._hidden=!1;this.ExecuteCollapsedChange()},i.prototype.ExecuteCollapsedChange=function(){this.OnStateChanged();this.UpdateUI()},i.prototype.Toggle=function(){this._hidden?this.Show():this.Hide()},i.prototype.OnAppended=function(){var t=this;this._$titleContainer=$('<div \n\t\t\t\t\tclass="sidebar-section-title \n\t\t\t\t\t\t'+(this._options.Collapsible?"sidebar-btn":"")+'"\n\t\t\t\t\ttabindex="0">\n\t\t\t\t<\/div>');!this._options.Title||this._$titleContainer.append('<h5 style="margin: 0;">'+this._options.Title+"<\/h5>");this.$Container.append(this._$titleContainer);this._options.Collapsible&&n.UI.A11y.OnActivate(this._$titleContainer,this.Toggle.bind(this));this._$childrenContainer=$('<div class="sidebar-section-content"><\/div>');this.$Container.append(this._$childrenContainer);this._options.Children.forEach(function(n){n.$Container=$("<div><\/div>");t._$childrenContainer.append(n.$Container)});this._options.Children.forEach(function(n){return n.OnAppended()});this.UpdateUI()},i.prototype.UpdateUI=function(){this._hidden?this._$childrenContainer.hide():this._$childrenContainer.show()},i}(t.SidebarElement);t.SidebarSection=i})(t=n.Sidebar||(n.Sidebar={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={}));__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(n){var t;(function(t){var i=function(t){function i(n,r){var u=t.call(this,"switch_view",i._$table.is(":visible"))||this;if(u._tableLogic=n,u._map=r,!n)throw new Error("Table logic is null");return u}return __extends(i,t),Object.defineProperty(i.prototype,"_isTableView",{get:function(){return this.IsEnabled},enumerable:!0,configurable:!0}),i.prototype.AddDOM=function(){this.$Container.append('<div id="SwitchViewButton" role="button">\n\t\t\t\t\t<span id="SwitchViewMapText">'+n.Settings.Resources.TextViewMap+'<\/span>\n\t\t\t\t\t<img tabindex="0" id="SwitchViewIcon" alt="'+n.Settings.Resources.TextViewTable+'" src="'+n.Settings.InjectedSettings.sliderSvgContentPath+'"/>\n\t\t\t\t\t<span id="SwitchViewTableText">'+n.Settings.Resources.TextViewTable+"<\/span>\n\t\t\t\t<\/div>")},i.prototype.UpdateUI=function(){var u=this,t=this.$Container.find("#SwitchViewIcon"),r;this._isTableView?(i._$map.hide(),i._$table.show(),t.css("transform","scaleX(-1)"),t.attr("alt",n.Settings.Resources.TextViewMap),r=this._map.GetBoundsLatLng(),setTimeout(function(){return u._tableLogic.UpdateOutput(r)},0)):(i._$map.show(),i._$table.hide(),t.css("transform","scaleX(1)"),t.attr("alt",n.Settings.Resources.TextViewTable))},Object.defineProperty(i.prototype,"Children",{get:function(){return[]},enumerable:!0,configurable:!0}),i._$map=$("#municipal511_main_content"),i._$table=$("#municipal511_table"),i}(t.SidebarToggleButton);t.SidebarSwitchViewButton=i})(t=n.Sidebar||(n.Sidebar={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={}));__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(n){var t;(function(n){var i=function(n){function t(t,i){i===void 0&&(i=!1);var r=n.call(this,"sidebar-time-btn-"+t,t,null)||this;return r._last=i,r.Other=null,r}return __extends(t,n),t.prototype.OnAppended=function(){n.prototype.OnAppended.call(this);this._last&&this.$Container.find(".sidebar-btn").css("margin-bottom","0")},t.prototype.Enable=function(){n.prototype.Enable.call(this)},t.prototype.Disable=function(){n.prototype.Disable.call(this);this.Other.IsEnabled||this.Other.Enable()},t.prototype.Toggle=function(){n.prototype.Toggle.call(this);this.IsEnabled||this.Other.IsEnabled||this.Other.Enable()},Object.defineProperty(t.prototype,"Children",{get:function(){return[]},enumerable:!0,configurable:!0}),t}(n.SidebarToggleButtonDefault),t;n.SidebarTimeButton=i;t=function(n){function t(t,i,r,u){var f=n.call(this,t,i,r,u)||this;return f.activeBtn.Other=f.futureBtn,f.futureBtn.Other=f.activeBtn,f.SubscribeToChildStateChanges(),f}return __extends(t,n),t}(n.SidebarTimeSelectorDefault);n.SidebarTimeSelector=t})(t=n.Sidebar||(n.Sidebar={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={}));__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(n){var t;(function(n){var t=function(t){function i(i,r,u,f){var e=t.call(this)||this;return e.activeBtn=null,e.futureBtn=null,e.state={Active:i,Future:r},e.activeBtn=new n.SidebarTimeButton(u),e.futureBtn=new n.SidebarTimeButton(f,!0),e}return __extends(i,t),Object.defineProperty(i.prototype,"IsActiveEnabled",{get:function(){return this.activeBtn.IsEnabled},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"IsFutureEnabled",{get:function(){return this.futureBtn.IsEnabled},enumerable:!0,configurable:!0}),i.prototype.OnAppended=function(){var n=this;this.$Container.addClass("sidebar-time-selector");this.Children.forEach(function(t){t.$Container=$("<div>");n.$Container.append(t.$Container)});this.Children.forEach(function(n){return n.OnAppended()});this.state.Active||this.activeBtn.Disable();this.state.Future||this.futureBtn.Disable()},i.prototype.UpdateUI=function(){this.Children.forEach(function(n){return n.UpdateUI()})},Object.defineProperty(i.prototype,"Children",{get:function(){return[this.activeBtn,this.futureBtn]},enumerable:!0,configurable:!0}),i}(n.SidebarElement);n.SidebarTimeSelectorDefault=t})(t=n.Sidebar||(n.Sidebar={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={}));__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(n){var t;(function(t){var i=function(t){function i(n,i){i===void 0&&(i=!0);var r=t.call(this)||this;return r._id=n,r._enabled=i,r}return __extends(i,t),Object.defineProperty(i.prototype,"Id",{get:function(){return this._id},enumerable:!0,configurable:!0}),i.prototype.OnAppended=function(){n.UI.A11y.OnActivate(this.$Container,this.Toggle.bind(this));this.AddDOM();this.UpdateUI()},i.prototype.ExecuteChange=function(){this.UpdateUI();this.OnStateChanged()},Object.defineProperty(i.prototype,"IsEnabled",{get:function(){return this._enabled},enumerable:!0,configurable:!0}),i.prototype.Enable=function(){this._enabled=!0;this.ExecuteChange()},i.prototype.Disable=function(){this._enabled=!1;this.ExecuteChange()},i.prototype.Toggle=function(){this._enabled=!this._enabled;this.ExecuteChange()},i}(t.SidebarElement);t.SidebarToggleButton=i})(t=n.Sidebar||(n.Sidebar={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={}));__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){var r=function(i){function r(n,t,r){var u=i.call(this,n)||this;return u._label=t,u._icon=r,u._removeBottomMargin=!1,t||console.warn("Button has no label"),u}return __extends(r,i),Object.defineProperty(r.prototype,"Children",{get:function(){return[]},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"faCurrentClass",{get:function(){return this.IsEnabled?r.FA_ENABLED_CLASS:r.FA_DISABLED_CLASS},enumerable:!0,configurable:!0}),r.prototype.AddDOM=function(){var i=$('<div tabindex="0" class="sidebar-btn sidebar-toggle-button-default \n\t\t\t\t\t\tsidebar-toggle-button-default-'+(this.IsEnabled?"enabled":"disabled")+'">\n\t\t\t\t\t<span class="sidebar-btn-check"><img width="16" height="16" src="'+t.Settings.InjectedSettings.checkSvgContentPath+'" aria-hidden="true"/><\/span>\n\t\t\t\t\t<span class="sidebar-btn-icon"><\/span>\n\t\t\t\t\t<span class="sidebar-btn-label">'+this._label+"<\/span>\n\t\t\t\t<\/div>");this.$Container.append(i);this._icon?n.Utilities.AddIconClassProperties(i.children(".sidebar-btn-icon"),this._icon,!0,24):i.children(".sidebar-btn-icon").remove()},r.prototype.UpdateUI=function(){if(this.$Container){var n=this.$Container.children().first();this._removeBottomMargin&&n.css("margin-bottom","0");this.IsEnabled?(n.removeClass("sidebar-toggle-button-default-disabled").addClass("sidebar-toggle-button-default-enabled"),n.find("i.fa").removeClass(r.FA_DISABLED_CLASS).addClass(r.FA_ENABLED_CLASS)):(n.removeClass("sidebar-toggle-button-default-enabled").addClass("sidebar-toggle-button-default-disabled"),n.find("i.fa").removeClass(r.FA_ENABLED_CLASS).addClass(r.FA_DISABLED_CLASS))}},r.prototype.RemoveMarginBelow=function(){this._removeBottomMargin=!0;this.$Container&&this.UpdateUI()},r.FA_ENABLED_CLASS="fa-check-square",r.FA_DISABLED_CLASS="fa-square-o",r}(i.SidebarToggleButton);i.SidebarToggleButtonDefault=r})(i=t.Sidebar||(t.Sidebar={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={}));__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(n){var t;(function(t){var i=function(t){function i(){return t.call(this,"tou-trigger",n.Settings.Resources.TextTermsOfUse)||this}return __extends(i,t),Object.defineProperty(i.prototype,"ModalId",{get:function(){return"termsModal"},enumerable:!0,configurable:!0}),i}(t.SidebarFooterModalButton);t.SidebarTouTriggerButton=i})(t=n.Sidebar||(n.Sidebar={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={}));__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(n){var t;(function(t){var i=function(t){function i(n,i,r){var u=t.call(this)||this;if(u.Id=n,u._content=i,u.TriggerEvent=r,!r)throw new Error("Trigger event is null");return u}return __extends(i,t),i.prototype.Trigger=function(){this.TriggerEvent()},i.prototype.OnAppended=function(){var t=$('<div class="sidebar-btn sidebar-trigger-button" tabindex="0">\n\t\t\t\t<\/div>');t.append($(this._content));n.UI.A11y.OnActivate(this.$Container,this.Trigger.bind(this));this.$Container.append(t)},i.prototype.UpdateUI=function(){throw new Error("Method not implemented.");},Object.defineProperty(i.prototype,"Children",{get:function(){return[]},enumerable:!0,configurable:!0}),i}(t.SidebarElement);t.SidebarTriggerButton=i})(t=n.Sidebar||(n.Sidebar={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={}));__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(n){var t;(function(n){var t=function(n){function t(t){var i=n.call(this)||this;return i._size=t,i}return __extends(t,n),t.prototype.OnAppended=function(){this.$Container.css({height:this._size+"px"})},t.prototype.UpdateUI=function(){},Object.defineProperty(t.prototype,"Children",{get:function(){return[]},enumerable:!0,configurable:!0}),t}(n.SidebarElement);n.SidebarWhitespace=t})(t=n.Sidebar||(n.Sidebar={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(n,t){this._filePrefix=n;this._staticMode=t}return n.prototype.Initialize=function(){var n=this,t=$.ajax({url:"./Sprites/Get?fileName=spritesheet.json",type:"GET"});return t.done(function(t){try{n._data=JSON.parse(t)}catch(i){n._data=t}}).fail(function(){throw new Error("Could not download spritesheet");}),t},n.prototype.GetClusterIcon=function(n){if(n.issueShapes.length>0)return this.GetMapIconForSprite(n.issueShapes[0].MarkerInfo.IconClass);if(n.entities.length>0)return this.GetMapIconForSprite(n.entities[0].IconClass);throw new Error("Nothing available for cluster marker: "+n);},n.prototype.GetClusterUnderlayIcon=function(){return{anchorPointOnImage:{LatX:128,LngY:128},size:{Height:256,Width:256},spriteOrigin:{LatX:0,LngY:0},spriteSheetSize:{Height:256,Width:256},spriteSheetUrl:"./Content/Images/ClusterUnderlay.png"}},n.prototype.GetSelectedUnderlayIcon=function(){return{anchorPointOnImage:{LatX:128,LngY:128},size:{Height:256,Width:256},spriteOrigin:{LatX:0,LngY:0},spriteSheetSize:{Height:256,Width:256},spriteSheetUrl:"./Content/Images/SelectedUnderlay.png"}},n.prototype.GetRoadClosureOverlayIcon=function(n){var t=null;switch(n){case 70:t="AlternatingTraffic";break;case 50:t="BikeLane";break;case 10:t="Detour";break;case 90:case 92:t="WithEmergencyAccess";break;case 100:t="NoEmergencyAccess";break;case 95:t="Delay";break;case 60:t="Lane";break;case 40:t="Sidewalk";break;case 80:t="WithLocalAccess";break;case 75:t="OneWay";break;default:return null}return{anchorPointOnImage:{LatX:16,LngY:16},size:{Height:32,Width:32},spriteOrigin:{LatX:0,LngY:0},spriteSheetSize:{Height:32,Width:32},spriteSheetUrl:"./Content/Images/RoadClosureOverlay/OverlayRoadClosure"+t+".png"}},n.prototype.GetClusterNumberIcon=function(n){var t=n>9?"":n.toString();return{anchorPointOnImage:{LatX:16,LngY:16},size:{Width:32,Height:32},spriteOrigin:{LatX:0,LngY:0},spriteSheetSize:{Height:32,Width:32},spriteSheetUrl:"./Content/Images/IssueOverlay/OverlayCluster"+t+"Icon.png"}},n.prototype.GetPlannedOverlayIcon=function(){return{anchorPointOnImage:{LatX:16,LngY:16},size:{Width:32,Height:32},spriteOrigin:{LatX:0,LngY:0},spriteSheetSize:{Width:32,Height:32},spriteSheetUrl:"./Content/Images/OverlayPlannedIcon.png"}},n.prototype.GetPastOverlayIcon=function(){return{anchorPointOnImage:{LatX:16,LngY:16},size:{Width:32,Height:32},spriteOrigin:{LatX:0,LngY:0},spriteSheetSize:{Width:32,Height:32},spriteSheetUrl:"./Content/Images/OverlayPastIcon_QuarterCorner.png"}},n.prototype.GetMapIconForSprite=function(n){var i,t;if(!n)throw new Error("Null spriteid");for(i=0;i<this._data.Icons.length;i++)if(this._data.Icons[i].C===n)return t=this._data.Icons[i],{anchorPointOnImage:{LatX:t.W/2,LngY:t.H/2},size:{Height:t.H,Width:t.W},spriteOrigin:{LatX:t.X,LngY:t.Y},spriteSheetSize:{Width:this._data.FileSizes[t.F][0],Height:this._data.FileSizes[t.F][1]},spriteSheetUrl:this._filePrefix+this._data.FileNames[t.F]};return null},n}();n.SpriteService=t})(t=n.Sprite||(n.Sprite={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(n){if(this._sprites={},!n)throw new Error("innerspriteservice is null");this._innerSpriteService=n}return n.prototype.Initialize=function(){return this._innerSpriteService.Initialize()},n.prototype.GetClusterUnderlayIcon=function(n){return this._innerSpriteService.GetClusterUnderlayIcon(n)},n.prototype.GetClusterIcon=function(n){return this._innerSpriteService.GetClusterIcon(n)},n.prototype.GetSelectedUnderlayIcon=function(){return this._innerSpriteService.GetSelectedUnderlayIcon()},n.prototype.GetClusterNumberIcon=function(n){return this._innerSpriteService.GetClusterNumberIcon(n)},n.prototype.GetPlannedOverlayIcon=function(){return this._innerSpriteService.GetPlannedOverlayIcon()},n.prototype.GetPastOverlayIcon=function(){return this._innerSpriteService.GetPastOverlayIcon()},n.prototype.GetRoadClosureOverlayIcon=function(n){return this._innerSpriteService.GetRoadClosureOverlayIcon(n)},n.prototype.GetMapIconForSprite=function(n){if(this._sprites.hasOwnProperty(n))return this._sprites[n];var t=this.GetSpriteInfo(n);if(!t)throw new Error("Could not load sprite: "+n);return this._sprites[n]=t,t},n.prototype.GetSpriteInfo=function(n){return this._innerSpriteService.GetMapIconForSprite(n)},n}();n.SpriteServiceCache=t})(t=n.Sprite||(n.Sprite={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){function t(n,t){n.on("click keydown touch",function(n){(n.type=="click"||n.type=="touch"||n.which==13||n.which==32)&&t(n)});return n}n.OnActivate=t})(t=n.A11y||(n.A11y={}))})(t=n.UI||(n.UI={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={})),function(n){var t;(function(n){var t;(function(n){var t;(function(t){function h(t){if(!t)throw new Error("Map is null");if(s=t,i=$(".sidebar-toggle-btn"),r=$("#municipal511_sidebar"),u=$("#LogoContainerFloating"),!(i===null||i===void 0?void 0:i.length))throw new Error("sidebar btn not found");if(!(r===null||r===void 0?void 0:r.length))throw new Error("sidebar not found");if(!u.length)throw new Error("logo floating not found");n.A11y.OnActivate(i,function(){var n=r.hasClass("sidebar-closed");n?e():f()})}function f(){i.find("img").addClass("closed");r.addClass("sidebar-closed");u.removeClass("sidebar-btn-hidden");$("#MainContent").removeClass("sidebar-open");o()}function e(){i.find("img").removeClass("closed");r.removeClass("sidebar-closed");$("#MainContent").addClass("sidebar-open");u.addClass("sidebar-btn-hidden");o()}function o(){}var i,r,u,s;t.InitializeSidebar=h;t.CloseSidebar=f;t.OpenSidebar=e})(t=n.SidebarToggle||(n.SidebarToggle={}))})(t=n.UI||(n.UI={}))})(t=n.Framework||(n.Framework={}))}(TIPS||(TIPS={}))