window.loadBlockerApi=window.loadBlockerApi||new function(){var o=[],i=null;this.showSpinner=function(n){n=n||"noId",-1==$.inArray(n,o)&&o.push(n),i=i||bootbox.dialog({message:"<i class='far fa-spinner fa-spin fa-3x fa-fw'></i><span class='sr-only'>"+resources.Loading+"</span>",closeButton:!1,className:"loadingModal",show:!0})},this.hideSpinner=function(e){e=e||"noId",0==(o=jQuery.grep(o,function(n){return n!=e})).length&&i&&(i.modal("hide"),i=null)},this.manualRemove=function(n){n=document.querySelector(n);n.style.visibility="hidden",n.nextElementSibling.remove(),n.remove(),i=null}};
var AjaxCache=function(){var e={},u=new Hashtable,i=(e.Remove=function(e){u.remove(e)},e.Get=function(n,e,t,a){var r,c=$.Deferred(),o=(r=n,(o=u.get(r))?(new Date).getTime()<o.cacheTTL?o.data:(u.remove(r),null):null);return!a&&o?c=o:(r=c,u.put(n,new i(r,e)),$.ajax(t).done(function(e){c.resolve(e),$(document).trigger("layerIconsUpdated",[n,e])}).fail(c.reject)),c.promise()},function(e,n){var t={};return t.data=e,t.cacheTTL=(new Date).getTime()+6e4*n,t});return e};
!function(m,d){let u;function C(e,o){var a,t='"'+e+'":';for(a of o.split(","))if(a.trim().startsWith(t))return"true"===a.trim().substring(t.length).replace(/[`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi,"");return null}function g(e,o,a){MapComp.centerTo(e,o,a)}m(".setToRegion").on("click",function(){var e=m(this).val().split(",");MapComp.map.panTo(new google.maps.LatLng(e[0],e[1])),MapComp.map.setZoom(parseInt(e[2]))});m("#layerSelection button").on("click",function(){var e=m(this).find("i");!0===e.hasClass("fa-minus-circle")?(e.removeClass("fa-minus-circle"),e.addClass("fa-plus-circle")):(e.addClass("fa-minus-circle"),e.removeClass("fa-plus-circle"))}),m(document).on("MapResize",function(){"object"==typeof google&&"object"==typeof google.maps&&google.maps.event.trigger(MapComp.map,"resize")}),m(".myRouteBtn").on("click",function(e,o){Modernizr.mq("(min-width: 993px)")&&!MapComp.data.appUI.locationBtn.is(":visible")&&(MapComp.data.appUI.locationBtn.removeClass("shiftLeft"),MapComp.data.appUI.locationBtn.show()),m(".sideBarGroup, #sideBar").show(),null==o&&m("#RoutesTab > a").trigger("click"),m(".mapPage .sideBarColContainer").show(),m(".mobileLocationBar").hide(),o&&o.skipPtBSetup||(m("#endLocationText").val(""),m("#endLocationText").focusout(),MapComp.isGoogle?(o=document.querySelector("gmp-place-autocomplete"))&&o.shadowRoot&&(o=o.shadowRoot.querySelector("input"))&&(o=o.value,m("#endLocationText").val(o)):0<(o=m("#mapLocation").val()).length&&m("#endLocationText").val(o),m("#endLocationText").focusout(),m("#startLocationText").focus())}),m(".UIControls .directions").on("click",function(e,o){m(".mobileFirst .mobileSetting").hide(),m(".showSideBar").hide();var a=m("#mapLocation").val();0<a.length&&m("#endLocationText").val(a),m(".sideBarGroup").show(),m("#sideBar").show(),null==o&&m("#RoutesTab > a").trigger("click"),m("#startLocationText").focus(),m(".mapPage .sideBarColContainer").show(),m(".mobileLocationBar").hide(),m("#routingResults").is(":visible")&&m(document).trigger("checkEventOnRoutePlanner")}),m(".UIControls .openInfoTab").on("click",function(){m(".mobileFirst .mobileSetting").hide(),m(".sideBarGroup").show(),m("#sideBar").show(),m(".showSideBar").hide(),m(".mobileLocationBar").hide(),m(".mapPage .sideBarColContainer").show(),m("#AlertsTab > a").trigger("click")}),m(".clearLocateBtn").on("click",function(){m(this).hide(),MapComp.data.appUI.mapLocationMarker&&(m(document).trigger("clearAutoCompleteText"),MapComp.data.appUI.mapLocationMarker.setVisible(!1)),MapComp.isLibre&&(m("#mapLocation").val(""),MapComp.clearLocationMarker())}),m(".closeSettings").on("click",function(){m(".mobileFirst .mobileSetting").hide(),m("#layerSelection").hide()}),m(".myCamerasContainer .fa-times, .myCam").on("click",function(){var e;""===resources.MobileCamBtnLink?(e=m(".myCamerasGroup")).is(":visible")?e.hide():(d.DisplayMyCameras(),e.show()):d.location.href=d.location.origin+resources.MobileCamBtnLink}),m("#setCurrentLocation").click(function(e){return d.GetUserGeolocation(function(e){MapComp.data.appUI.mapLocationMarker&&MapComp.data.appUI.mapLocationMarker.setVisible(!1),m(document).trigger("removeMyLocationMarker"),MapComp.setUserLocation(e)}),e.preventDefault(),!1}),m(".navbar-toggle").on("click",function(){m(".myCamerasGroup").is(":visible")&&m(".UIControls .myCam").trigger("click")}),m(document).on("ChangeCursorToWait",function(){MapComp.isGoogle?MapComp.map.setOptions({draggableCursor:"wait"}):MapComp.map.getCanvas().style.cursor="wait"}),m(document).on("ChangeCursorToDefault",function(){MapComp.isGoogle?MapComp.map.setOptions({draggableCursor:""}):MapComp.map.getCanvas().style.cursor=""}),m(document).on("hideLocationMarker",function(){MapComp.hideLocationMarker()}),d.$mapping={init:function(e,t){MapComp.isGoogle&&!MapComp.isRcr&&(MapComp.methods.appUI.appResize=new AppResize);var o=0<m(".ersLogo").length,a=0<m("#wtaMap").length,i=URI().hasQuery("mode","trucker");m(document).trigger("adjustHeightTriggered"),MapComp.data.appUI.isMobileFirst="True"==resources.MobileFirst,MapComp.methods.appLayout.positionCustomControls(MapComp.data.appUI.isMobileFirst,o,a),MapComp.data.appUI.hideLayer=e.HideLayer,e.DefaultZoom=MapComp.methods.appUI.adjustDefaultZoom(e.DefaultZoom);let p=MapComp.methods.appUI.setMapOptions(e);URI().hasQuery("maponly","true")&&(p.disableDefaultUI=!0,m(".legend-container").hide()),MapComp.callback.mapDoneLoading=()=>{"undefined"!=typeof specialEvent&&specialEvent.method.setLegend(),MapComp.appHelper=new AppHelper(MapComp.map,e,MapComp.methods.layerInfo.get()),"undefined"!=typeof specialEvent&&specialEvent.method.getAppHelper(MapComp.appHelper),u={center:g,map:MapComp.map,layerSelectorClosed:MapComp.appHelper.layerSelectorClosed,tileManager:MapComp.appHelper.tileManager,appHelper:MapComp.appHelper},MapComp.appHelper.appCookie.SetMap({zoom:p.zoom,mapType:MapComp.library}),d.SetUserRegion=function(e,o){var a;e&&(a=[e[0],e[1]],u.center(a,parseInt(e[2]),o))},Modernizr.mq("(min-width: 993px)")&&"true"===resources.MapLegendDisplayByDefault&&m(".legend-toggle").trigger("click"),UserCameras=new CameraLocater(u),m(document).trigger("appInitComplete",[u,e]),t&&t(u);var o=m(".layerSelection .toggleButton");for(let e=0;e<o.length+2;e++){var a=".panel-collapse."+e;0<m(a).length&&!m(a).hasClass("in")&&m(a+" input[type=checkbox]").is(":checked")&&(m(a).addClass("in"),m(a).parent().find(".fa-plus-circle").removeClass("fa-plus-circle").addClass("fa-minus-circle"))}""!==resources.StateOutline&&MapComp.addStateOutline()},MapComp.isDarkMode=!(!Cookies.get("mapClrMode")||"dark"!==Cookies.get("mapClrMode"));var n={...p,idTag:MapComp.data.appUI.mapContainerId,bounds:[[e.RoutingModel.MapBottomLeftBounds.Longitude,e.RoutingModel.MapBottomLeftBounds.Latitude],[e.RoutingModel.MapTopRightBounds.Longitude,e.RoutingModel.MapTopRightBounds.Latitude]],mapDoneLoading:MapComp.callback.mapDoneLoading,maptypeid_changed:MapComp.maptypeid_changed,isDarkMode:MapComp.isDarkMode},i=(MapComp.mountMap(n),MapComp[MapComp.library].posMountSetup({options:e,isERS:o,isWta:a,isTruckerModeQuery:i}),"True"==resources.EnableNearby511Kml&&!o&!a&&(n={clickable:!0,suppressInfoWindows:!0,preserveViewport:!0,map:MapComp.map},i=Cookies.get("_culture"),MapComp.setNearbyKml({culture:i,url:URI(resources.Nearby511Kml).addSearch("t",roundDate(moment(),5).unix()).addSearch("lang",i).toString(),kmlOptions:n})),navigator.userAgent.toLowerCase());MapComp.data.appUI.isTablet=/(ipad|tablet|(android(?!.*mobile))|(windows(?!.*phone)(.*touch))|kindle|playbook|silk|(puffin(?!.*(IP|AP|WP))))/.test(i),MapComp.methods.appUI.windowResize(),MapComp.EventAddDomListener(d,"resize",MapComp.methods.appUI.windowResize),MapComp.isGoogle&&MapComp.methods.streetView();let r=!1,s=!1,l;n=m("#avoidTollsCheckBox"),n&&(null!=(l=Cookies.get("map"))&&(r=C("AvoidTolls",l)),n.attr("checked",r)),i=m("#avoidFerriesCheckBox"),i&&(null!=(l=Cookies.get("map"))&&(s=C("AvoidFerries",l)),i.attr("checked",s)),Modernizr.mq("(max-width: 992px)")?MapComp.data.appUI.isMobileFirst&&"#:MyRoutes"==d.location.hash.substr(0)&&m(".UIControls .directions").click():"true"===resources.OpenDesktopRoutePlannerDefault.toLowerCase()||"#:MyRoutes"==d.location.hash.substr(0)||-1!==d.location.hash.indexOf("#route")?m(".myRouteBtn").trigger("click",{skipPtBSetup:!0}):(MapComp.data.appUI.locationBtn.hide(),m("#sideBar").hide()),n=getMobileOs();"unknown"!=n&&(m(".printRoute").hide(),"iOS"==n&&m(".twitter.newsContent").addClass("isIos"),"Android"==n)&&m("#ersRegion-Combobox .bs-searchbox, #mobileErsRegion-Combobox .bs-searchbox").hide();{var c=m("body").hasClass("mobileFirst")&&0<!m(".ersLogo").length;isWta=0<m("#wtaMap").length,"True"==resources.EnableLocationSearchBar&&MapComp.methods.appUI.locationSearchBar(),Modernizr.mq("(max-width: 992px)")&&c&&!isWta&&(MapComp.methods.appUI.locationSearchBar(),m(".myCamerasContainer").appendTo(".myCamerasGroup"),m("footer").hide())}MapComp.methods.appUI.showLegendToggleBtn(a,o),MapComp.data.appUI.isTruckerMode=resources.EnableTruckerMode,"True"==MapComp.data.appUI.isTruckerMode&&(Cookies.get("_truckerMode")?MapComp.methods.truckMode.showTruckerModeIndicator(!0):MapComp.methods.truckMode.showTruckerModeIndicator(!1)),0<m("#routeOptions-toggle input[type='checkbox']:checked").length&&0==m("#routeOptions-toggle.in").length&&m("#routeOptions").click(),m(".clearAll").click(function(){MapComp.methods.clearAllLegendLayers()})},map:function(){return MapComp.map}}}($,window),$(window).on("load",function(){$("body").hasClass("mobileFirst")&&0<!$(".ersLogo").length&&$(".featureModal").on("shown.bs.modal",function(){$(".bootbox").is(":visible")&&$(".featureModal").modal("hide")})}),$(document).on("show.bs.modal",".modal",function(){const e=1062+10*$(".modal:visible").length;$(this).css("z-index",e),setTimeout(()=>$(".modal-backdrop").not(".modal-stack").css("z-index",e-1).addClass("modal-stack"))});
var AppCookie=function(e,o){var t={},r={selectedLayers:null,prevZoom:null,prevLatLng:null,mapView:null,prevMapType:null};let n="map";"undefined"!=typeof specialEvent&&(n=window.location.pathname.replaceAll("/","").toLowerCase());function a(){var e=JSON.stringify(r);Cookies.set(n,e,{expires:365,path:"/"})}return getCookie=function(){var e=Cookies.get(n);return r=e?JSON.parse(e):r},t.getCookie=getCookie,t.SetLayer=function(o,e){e&&-1==r.selectedLayers.indexOf(o)?r.selectedLayers.push(o):e||(r.selectedLayers=$.grep(r.selectedLayers,function(e){return e!=o})),a()},t.SetMap=function({latitude:e,longitude:o,zoom:t,mapType:n}){e&&o&&(r.prevLatLng=[e,o]),t&&(r.prevZoom=t),r.mapView=moment.utc(),n&&(r.prevMapType=n),a()},t.RestoreCheckboxes=function(e,o){var t=document.querySelector("#layerSelection"),t=Array.from(t.querySelectorAll("input[data-isenabledwhenrefresh='True']"),e=>e.dataset.layerid),n=r.selectedLayers||[];[...new Set([...t,...n])].filter(Boolean).forEach(e),o&&o()},$("#avoidTollsCheckBox").on("change",function(){var e=$("#avoidTollsCheckBox").is(":checked");r.AvoidTolls=e,a()}),$("#avoidFerriesCheckBox").on("change",function(){var e=$("#avoidFerriesCheckBox").is(":checked");r.AvoidFerries=e,a()}),function(){r=this.getCookie(),null===(r="undefined"!=typeof specialEvent?specialEvent.method.setCookieSelectedLayers(r):r).selectedLayers&&(r.selectedLayers=[]),"undefined"==typeof specialEvent&&(r.selectedLayers=e.SelectedLayers)}(),t};
var AppEventBinding=function(r){var c=768,e=($(document).on("appInitComplete",()=>{var e=new URL(window.location),e=new URLSearchParams(e.search);e.has("hiderouteplanner")&&"true"===e.get("hiderouteplanner")?$(".hideSideBar").click():e.has("hiderouteplanner")&&"true"!==e.get("hiderouteplanner")&&$(".showSideBar").click(),e.has("hidelegend")&&"true"===e.get("hidelegend")?$("#layerSelection").hide():e.has("hidelegend")&&"true"!==e.get("hidelegend")&&$("#layerSelection").show()}),function(){var e=$("#layerSelection");$("input[type='checkbox']",e).bind("click.layerSelectorCheckboxes_desktopMode",function(){r.layerToggled($(this).attr("data-layerid"),!1)})}),t=function(){var e=$("#layerSelection");$("input[type='checkbox']",e).on("change.layerSelectorCheckboxes_mobileMode",function(){r.layerToggled($(this).attr("data-layerid"),!1)})},o=function(e,t){var o,a=0<$(".ersLogo").length,a=0<$(".mobileFirst").length&&!a,i=0<$(".wtaPage").length,l=$(window).outerWidth(),n=$("#layerSelection");"none"==n.css("display")?((c="768"!==resources.ScreenWidthERSLegend?parseInt(resources.ScreenWidthERSLegend):c)<l?(n.attr("class","layerSelection"),$("#legend-container").append(n.detach()),$(".mobileSetting").show()):a?($(".mobileFirst .mobileSetting").show(),n.attr("class","layerSelection"),$("#legend-container").append(n.detach()),i?$(".mobileSetting").addClass("show"):(l=$(".legend-container").outerHeight()+20,adjustLegendHeight(l))):(n.attr("class","layerSelectionModal"),o=n.detach(),bootbox.mapPageDialog({message:" ",animate:!1,closeButton:!1,buttons:{main:{label:resources.OK,className:"btn-info",container:".map-container",callback:function(){t.trigger("click"),$("#legend-container").append(o),r.layerSelectorClosed(!0)}}}}),bootbox.setDialogToJqueryObj(o.show())),"block"==$(".mapFiltersContainer").css("display")&&$(".layerSelection").addClass("expand"),n.show(),e.preventDefault()):(e.preventDefault(),n.hide(),a&&0===$("#embedmap").length&&window.innerWidth<992&&$(".mobileFirst .mobileSetting").hide(),i&&$(".mobileSetting").removeClass("show"))},a=$(".locationBtn");let l=(e,t)=>{e=Array.from(e.querySelectorAll("label>input"));t?e.forEach((e,t)=>{(!e.checked&&0===t||0<t&&e.checked)&&e.click()}):e.forEach(e=>{e.checked&&e.click()})};$(".hideSideBar").click(function(){$(".mapPage .sideBarColContainer").hide(),$(".guideIcon").hide(),$(".mapColContainer").toggleClass("full"),0<a.length&&a.addClass("shiftLeft"),$(".showSideBar").show(100),r.resizeMap()}),$(".showSideBar").click(function(){$(".showSideBar").hide(100),0<a.length&&a.removeClass("shiftLeft"),$(".mapPage .sideBarColContainer").show(),$(".guideIcon").show(),$(".mapColContainer").toggleClass("full"),r.resizeMap()}),$(".closeSideBar, .locationBtn").on("click",function(){$(document).trigger("clearUserRouteTrigger"),0<a.length&&(a.hide(),a.removeClass("shiftLeft")),$(".showSideBar").hide(),$(".mapPage .sideBarColContainer").hide(),$(".mapColContainer").toggleClass("full"),$(".mobileLocationBar, .myRouteBtn").show(),$("#mapLocation").val("").focus(),r.resizeMap()});var i=$(".legend-toggle"),n=$(".settingToggle"),n=($(window).outerWidth()>c?e():t(),$(i).on("click",function(e){o(e,i)}),$(n).on("click",function(e){o(e,null)}),n=$("#layerSelection"),$("input[type='checkbox'][data-layerid]",n).bind("click.layerSelectorCheckboxes_cookie",function(){r.appCookie.SetLayer($(this).attr("data-layerid"),$(this).is(":checked"))}),MapComp.updateMapCookie({setMapZoomAndCenterCookie:e=>{r.appCookie.SetMap({latitude:e.lat,longitude:e.lng,zoom:e.zoom,mapType:e.mapType})},map:r.map}),document.querySelector("#layerSelection").querySelectorAll("input[type='checkbox'][data-icon],input[type='checkbox'][data-feedurl],input[type='checkbox'][data-tileurlformat],input[type='checkbox'][data-vectortileurlformat]").forEach(function(e){var t=e.dataset.layerid;let i=document.querySelector("ul#"+t+"-children");i&&e.addEventListener("change",function(){var e=this.checked,t=this.dataset.dontselectchildlayers;if(null!=t&&"true"===t.toLowerCase())l(i,e);else for(var o of i.children){o=o.querySelector("label>input");(e&&!o.checked||!e&&o.checked)&&o.click()}var a,t=i.querySelectorAll("li>label>input");i.hidden=!0;for(a of t)e?"True"==a.dataset.visible&&(a.hidden=!1,i.hidden=!1):a.hidden=!0})}),$("#embedmap")),e=$("#accessServicesMap");0<!n.length&&0<!e.length?r.appCookie.RestoreCheckboxes(function(e){var t=document.querySelector("#layerSelection").querySelector("input[type='checkbox'][data-layerid='"+e+"']:not(:disabled)");t&&(t.checked=!0,t.dispatchEvent(new Event("change"))),0<$("ul#"+e+"-children").children(":visible").length&&$("ul#"+e+"-children").toggle(!0)},function(){r.layerSelectorClosed(!0)}):r.layerSelectorClosed(!0)};
let AppHelper=function(u,e,t){let E=t.iconDetails,F=t.apiUrls,d=t.tooltipBaseUrls,H=t.tooltipRegular,m=t.tooltipSize,f=t.feed,B=t.tile,V=t.vectorTile,s=t.icon,c=new Hashtable,o,n,a,j=!1,G=e=>{j=e},p,g,y,h,M,N=(MapComp.isGoogle&&(M=new google.maps.InfoWindow({maxWidth:365})),'<div id="infoWindowLoading">'+resources.Loading+"</div>"),C,w={},U,_,v={},k,K,L,r="undefined"!=typeof DataLakeManager;function Y(e){$("input[type='checkbox'][data-layerid]","#layerSelection").each(function(e,t){q($(t).attr("data-layerid"),!0)}),ee(e,!0)}function q(a,r){let e=$("#layerSelection");function t(e,t,o){if(e=$(e),c.containsKey(a)||c.put(a,!1),e.is(":checked")){if(0==c.get(a)){if(c.put(a,!0),t(),e.attr("data-conflicts")){var n=e.attr("data-conflicts").split(",");for(let e=0;e<n.length;e++)$("input[type='checkbox'][data-layerid='"+n[e]+"']:checked",$("#layerSelection")).click()}r||"undefined"==typeof ga||ga("send","event","MapLayer",a),$(document).trigger("mapLayerToggle",[a,!0])}}else 1==c.get(a)&&(c.put(a,!1),o(),$(document).trigger("mapLayerToggle",[a,!1]))}var o;let n=$('input[type="checkbox"][data-layerid="'+a+'"]',e),i="true"===n[0].dataset.hasmapicons,l="true"===n[0].dataset.polylinetooltip;0<n.length&&(o=n[0].parentNode.parentNode.parentNode,n[0].checked)&&o.classList.contains("TopLegendSection")&&"none"===o.style.display&&(o.style.display="block",document.getElementById("LegendTopCheckbox").checked=!0),n.is("[data-datalakeid]")?t(n[0],function(){var e={layerId:$(n[0]).data("layerid"),datalakeid:$(n[0]).data("datalakeid"),layerIdUrl:$(n[0]).data("datalakeidurl"),itemUrl:$(n[0]).data("item-url"),iconUrl:$(n[0]).data("icon-url"),apiKey:$(n[0]).data("key"),title:$(n[0]).data("title"),icon:$(n[0]).data("iconurl"),tooltipId:$(n[0]).data("tooltipid"),anchorSize:{width:$(n[0]).data("iconanchorwidth"),height:$(n[0]).data("iconanchorheight")},tooltipMaxWidth:$(n[0]).data("maxwidth")};L.addLayer(e),r||L.refreshLayer(a)},function(){L.deleteLayer($(n[0]).data("layerid"))}):n.is('[data-polyline="true"]')?t(n[0],function(){y.AddPolylineLayer(a,[],$(n[0]).data("polylineopacity"),$(n[0]).data("polylineweight"),$(n[0]).data("polylinezindex"),0,20,function(t,e,o){I(a,o,e).done(function(e){e=MapComp.setLayerPolylines({data:e,layerId:a,polylineTooltip:l});t(e,l)})},v[a],!!n.is("[data-icon]")),$(document).on("layerRefreshed-polylineManager."+a,function(e,t){t==a&&($(document).off("layerRefreshed-polylineManager."+a),i)&&(p.AddIconLayer(a,[],I,function(a,r){let i=Z(a,r);return r.polyline&&(i[0].addListener("marker-clustered",function(e){var t,o=y.GetPolylines(a);for(t in o){var n=o[t];if(n.sourceData.id==r.itemId){i[0].clustered&&(1==i.count||i[1]?.clustered)?(n.gMapLine.setMap(null),n.gMapLine.canDraw=!1):(n.gMapLine.setMap(u),n.gMapLine.canDraw=!0);break}}}),1<i.count)&&i[1].addListener("marker-clustered",function(e){var t,o=y.GetPolylines(a);for(t in o){var n=o[t];if(n.sourceData.id==r.itemId){i[0].clustered&&i[1].clustered?(n.gMapLine.setMap(null),n.gMapLine.canDraw=!1):(n.gMapLine.setMap(u),n.gMapLine.canDraw=!0);break}}}),i},v[a],s[a]),p.RefreshLayer(a).done(p.Redraw))}),y.RefreshLayer(a),$("#legend-icon-"+a,e).toggle(!0)},function(){y.RemovePolylineLayer(a),p.RemoveIconLayer(a),r||p.Redraw(),$(document).off("layerRefreshed-polylineManager."+a),$("#legend-icon-"+a,e).toggle(!1),a==k&&W()}):i?t(n[0],function(){p.AddIconLayer(a,[],I,Z,v[a],s[a]),r||p.RefreshLayer(a).done(p.Redraw),$("#legend-icon-"+a,e).toggle(!0)},function(){0==T.indexOf(a)&&(T=""),p.RemoveIconLayer(a),$("#legend-icon-"+a,e).toggle(!1),r||p.Redraw(),a==k&&W()}):n.is("[data-feedurl]")?t(n[0],function(){h.AddLayer(a,f[a]),$("#legend-feed-"+a,e).toggle(!0)},function(){a==k&&(D()||CTVars.tooltipOpen)&&W(),h.RemoveLayer(a),$("#legend-feed-"+a,e).toggle(!1)}):n.is("[data-tileurlformat]")?t(n[0],function(){g.AddTileLayer(a,B[a]),$("#legend-tile-"+a,e).toggle(!0)},function(){g.RemoveTileLayer(a),a==k&&(D()||CTVars.tooltipOpen)&&W(),$("#legend-tile-"+a,e).toggle(!1)}):n.is("[data-vectortileurlformat]")&&t(n[0],function(){vectorTileManager.AddTileLayer(a,V[a]),$("#legend-tile-"+a,e).toggle(!0)},function(){vectorTileManager.RemoveTileLayer(a),a==k&&(D()||CTVars.tooltipOpen)&&W(),$("#legend-tile-"+a,e).toggle(!1)})}function J(e,t){return t.icon.json?JSON.parse(t.icon.json):t.icon?{url:(t=t.icon).url,size:new google.maps.Size(t.size[0],t.size[1]),anchor:new google.maps.Point(t.anchor[0],t.anchor[1]),origin:new google.maps.Point(t.origin[0],t.origin[1]),scaledSize:new google.maps.Size(t.size[0],t.size[1])}:E[e]}let I=function(e,t,o){var n={type:"GET",url:F[e],dataType:"json",timeout:3e4,tryCount:0,retryLimit:3,error:function(e,t,o){"timeout"==t&&(this.tryCount++,this.tryCount<=this.retryLimit)&&$.ajax(this)}};return null!=o&&(n.type="POST",n.data=JSON.stringify(o.getFilter()),n.contentType="application/json",n.url+="?time="+$.now()),a.Get(e,.5,n,t)},Z=function(a,r){var e,t=new google.maps.LatLng(r.location[0],r.location[1]),t=[gMarkers.buildMarker({mapIconItem:r,position:t})],o=(null!=r.secondarylocation&&(e=new google.maps.LatLng(r.secondarylocation[0],r.secondarylocation[1]),t.push(gMarkers.buildMarker({mapIconItem:r,position:e}))),J(a,r));for(const i of t)o&&gMarkers.setIcon(i,o),google.maps.event.addListener(i,"spider_format",function(e){var t,o=J(a,r),n=e==OverlappingMarkerSpiderfier.markerStatus.SPIDERFIED?o.url:e==OverlappingMarkerSpiderfier.markerStatus.SPIDERFIABLE?null==(n=o.url)?null:(t=(n=n.split("/")).splice(n.length-1,1)[0],n.join("/")+"/plus/"+t):e==OverlappingMarkerSpiderfier.markerStatus.UNSPIDERFIABLE?o.url:null;o&&(o.url=n,gMarkers.setIcon(i,o))}),""!=d[a]&&(function(o,n,a){google.maps.event.addListener(o,"spider_click",function(e){let t=true;if(resources.TooltipDisplayOnHover==="true")if(l)t=false;else{l=true;setTimeout(()=>{l=false},500)}if(t){S(a,n.itemId,o);$(document).trigger("marker-click",[w,a,n.itemId,o])}})}(i,r,a),"true"===resources.TooltipDisplayOnHover)&&!function(t){google.maps.event.addListener(t,"mouseover",function(e){b=setTimeout(function(){google.maps.event.trigger(t,"click")},500)}),google.maps.event.addListener(t,"mouseout",function(){if(b)clearTimeout(b)})}(i);return t},l=!1,b,i=null,T="",S=function(o,e,n,a,r){if($('input[type="checkbox"][data-layerid="'+o+'"]',$("#layerSelection")).is("[data-datalakeid]"))L.showInfoWindow(o,e);else{let t=o+e;var i,l;D()&&t===T||($(document).trigger("closeDraggableWindow"),D()&&W(),T=t,"True"==resources.CctvEnableVideo&&$(document).trigger("CallRemoveVideo"),X(),$(document).trigger("cameraImagesClearIntervals"),i=Cookies.get("_culture")?Cookies.get("_culture"):"",i=URI.expand(d[o],{layerId:o,id:e,lang:i}).toString(),l=$(window).width()<768,isRegular="true"==H[o]&&!l,O(N,n,!0,a,o,!1,void 0,r||void 0),$(document).trigger("ShowInfoWindow",[w,o,e,n,a]),$.ajax({url:i,success:function(e){T==t&&O(e,n,!1,a,o,!isRegular,void 0,r||void 0)}}))}},R=new CenterTooltip(u),x=e=>{var t;MapComp.isDatalake?(t=document.getElementById("draggableBorder"))&&MapComp.centerTooltipCheck(t):R.run(e)},Q=(R.startTriggers(),window.centerTooltip=R,$(document).on("info-content-trigger",(e,t,o,n)=>{t===resources.MessageSignsLayerId&&Q(),void 0!==o&&(-1==o.indexOf("cctvImage")&&-1==o.indexOf("cctvCameraCarousel")||$(document).trigger("cameraImagesInitialized",[T]),-1!=o.indexOf("data-convert-from-utc"))&&$(document).trigger("update-time-to-locale");t=$("#detourCollapse");t[0]&&arrowDirection.setTooltip(t[0]),applyDetourArrowIcon(),x(n)}),$(document).on("center-tooltip",()=>{x()}),$(document).on("update-time-to-locale",function(){$("[data-type='time']").each(function(e,t){var t=$(t),o=t.html(),o=moment.utc(o).local().format("M/D/YYYY h:mm A");t.html(o)})}),function(){clearInterval(i),1<$(".msgContent div").length&&(i=setInterval(function(){var t=$(".msgContent").children(),o=t.length;let n=!1;for(let e=0;e<o;e++)if($(t[e]).hasClass("hide")){if(1==n){$(t[e]).toggleClass("hide"),n=!1;break}}else $(t[e]).toggleClass("hide"),n=!0;1==n&&$(t[0]).toggleClass("hide")},2500))}),X=function(){clearInterval(i),i=null},ee=(MapComp.isGoogle&&google.maps.event.addListener(M,"closeclick",function(){W(),R.tooltipClosed()}),$(document).on("layer-changed",function(e,t){"MyCameras"==t&&(a.Remove(t),r)&&L.updateLayer(t,u.getBounds()),p.RefreshLayer(t,!0).done(p.Redraw),y.RefreshLayer(t,!0)}),function(e,t){e||loadBlockerApi.showSpinner("refreshMapData");let o=0;$(document).on("markerClustererRepainted.appHelper layersRefreshed-polylineManager.appHelper",function(){2==++o&&(loadBlockerApi.hideSpinner("refreshMapData"),$(document).unbind("markerClustererRepainted.appHelper layersRefreshed-polylineManager.appHelper"))}),$(document).on("layersRefreshed-iconManager.appHelper",function(){p.Redraw(),$(document).unbind("layersRefreshed-iconManager.appHelper")}),p.RefreshLayers(),y.RefreshLayers(),r&&re(),t||g.RefreshLayers(),t||vectorTileManager.RefreshLayers(),h.Refresh(f)}),te=function(e){e||loadBlockerApi.showSpinner("repaintMap");let t=0;$(document).on("mapChangedFinished-polylineManager.appHelper markerClustererRepainted.appHelper",function(){2==++t&&(loadBlockerApi.hideSpinner("repaintMap"),$(document).unbind("mapChangedFinished-polylineManager.appHelper markerClustererRepainted.appHelper"))}),p.MapChanged(),p.Redraw(),y.MapChanged()};let oe=function(){return!bootbox.isOpen()&&!j},D=function(){return!!M.getMap()};const ne=new DOMParser;MapComp.callback.showTooltipContent=(e,t,o)=>{e=ne.parseFromString(e,"text/html");CTVars.tooltipOpen&&R.closeTooltip(),CTVars.tooltipContainer=e.getElementsByTagName("body")[0].firstChild,document.getElementById("map-canvas").appendChild(CTVars.tooltipContainer),R.tooltipOpened(t,CTVars.tooltipContainer,o),MapComp.startMonitoringMapMoves()};function O(o,n,a,r,i,l,d,s){if(R.tooltipOpened(),l&&(l=!0,document.querySelector(".closeDraggableWindow"))&&""!==o&&$(document).trigger("closeDraggableWindow"),(k=i)&&""!==o){var c="iOS"==getMobileOs();let e=m[i]&&0<m[i].length?parseInt(m[i]):365;var p,g,c=992<$(window).width()&&!c;let t=M;if(f[i]&&f[i].tooltipsize&&(e=parseInt(f[i].tooltipsize),s=30),l&&c?(M.close(),p=CreateDraggableInfoWindow(C,s),g=null!=n?n:new google.maps.Marker({position:r}),(C=new p(u,g,i,o,e,function(){o&&""!=o&&$(document).trigger("info-content-trigger",[i,o])},s)).position=g.position,C.content=o,t=C):(google.maps.event.addListenerOnce(M,"domready",function(){o&&(a?x(t):$(document).trigger("info-content-trigger",[i,o,t]))}),M.setContent(o)),bootbox.setDialogContent(o),$(".bootbox").one("hidden.bs.modal",function(){$(document).trigger("info-window-close")}),$(document).trigger("info-content-trigger",[i,o]),t.maxWidth=e,a)c?(n||d?l?(M.close(),t.position=null!=r?r:n.position):M.setOptions({position:r,pixelOffset:{height:0}}):(s=s||{height:-32},M.setOptions({position:r,pixelOffset:s})),n&&n.latLngs?(M.setOptions({position:new google.maps.LatLng(n.defaultPosition.lat(),n.defaultPosition.lng())}),M.open(u)):l||($(document).trigger("closeDraggableWindow"),M.open(u,n)),i===resources.MessageSignsLayerId&&$(document).trigger("MsgSignMapTooltipTriggered")):bootbox.isOpen()||bootbox.mapPageDialog({message:o,animate:!1,buttons:{main:{label:resources.OK,className:"btn-info"}}});else if(D()){let e=$(".map-tooltip table img:not(.agencyLogo)"),t=T;e.length?e.on("load",function(){t==T&&(M.open(u,n),e.off("load"))}):M.open(u,n)}else l||o&&""!=o&&$(document).trigger("info-content-trigger",[i,o])}}let P=null,W=(MapComp.callback.setMapTooltip=t=>{k=t.layer,CTVars.markerPoint=t.latLng;var e=Cookies.get("_culture")?Cookies.get("_culture"):"en",e=t.url||URI.expand(d[t.layer],{layerId:t.layer,id:t.id,lang:e}).toString(),o="iOS"==getMobileOs();let n=992<$(window).width()&&!o,a;n?(a=m[t.layer]&&0<m[t.layer].length?parseInt(m[t.layer]):365,o=MapComp.setFinalTooltipContent(`<div style="text-align: center;">${resources.Loading}</div>`,400),MapComp.callback.showTooltipContent(o,t.location),R.run()):(bootbox.closeMapPageDialog(),bootbox.setDialogContent(`<div style="text-align: center;">${resources.Loading}</div>`)),P=$.ajax({url:e,beforeSend:function(){null!=P&&P.abort()},success:function(e){n?(e=MapComp.setFinalTooltipContent(e,a),MapComp.callback.showTooltipContent(e,t.location)):bootbox.isOpen()||bootbox.mapPageDialog({message:e,animate:!1,buttons:{main:{label:resources.OK,className:"btn-info"}}}),$(document).trigger("info-content-trigger",[t.layer,e]),$(document).trigger("ShowInfoWindow",[t.ShowInfoWindow,t.layer,t.id])}}),$(document).trigger("marker-click",[void 0,t.layer,t.id])},function(){MapComp.isLibre&&(R.closeTooltipClick(),MapComp.removeEventShapes()),"True"==resources.CctvEnableVideo&&$(document).trigger("CallRemoveVideo"),$(document).trigger("closeDraggableWindow"),MapComp.isGoogle&&M.close(),T="",$(document).trigger("info-window-close"),R.tooltipClosed()});$(document).on("callCloseInfoWindow",W);w.map=u,w.resizeMap=function(){MapComp.isGoogle&&google.maps.event.trigger(u,"resize")},w.isLayerIdChecked=function(e){return $('input[type="checkbox"][data-layerId="'+e+'"]').is(":checked")},w.layerSelectorClosed=Y,w.layerToggled=q,w.showInfoWindow=O,w.showInfoWindowForItem=S,w.closeInfoWindow=W,w.clearInfoWindowId=function(){T=""},w.centerTooltip=R;var ae=t.filterData;for(A in ae){var z,A=ae[A];"True"==A.hasFilter&&"undefined"!=typeof FilterDataTableParams&&((z=new FilterDataTableParams(1,0,25,!0,null)).search=new FilterDataTableSearchParam,z.search.objValue=null,z.search.regex=!1,z.search.searchOnColumn=!1,z.search.value=null,z.order[0]=new FilterDataTableOrderParam,z.order[0].column=0,z.order[0].dir="asc",(z=new ColumnFilters("map-filter-div",A.layerId,"List/UniqueColumnValuesForErsEvents/{typeId}",z)).initListColumnFilters(),v[A.layerId]=z)}var re=function(){$("input[type='checkbox'][data-layerid]:checked","#layerSelection").each(function(e,t){L.refreshLayer($(t).data("layerid"))})};MapComp.isGoogle&&(K=new OverlappingMarkerSpiderfier(u,{markersWontMove:!1,markersWontHide:!1,keepSpiderfied:!0,nearbyDistance:10}),n={maxZoom:e.ClustererModel.MaximumZoom,minimumClusterSize:e.ClustererModel.MinimumClusterSize,gridSize:e.ClustererModel.GridSize,title:resources.AClusterOfIcons,imagePath:"/Content/images/markerClustererPlus/m"},o=new MarkerClusterer(u,[],n,K),r&&(L=new DataLakeManager(u,o),w.dataLakeManager=L),o.setCalculator(function(e,t){let o=0;e=e.length.toString();let n=e;for(;0!==n;)n=parseInt(n/10,10),o++;return 3==o&&(o=2),resources.MarkererIndexOveride&&(o=resources.MarkererIndexOveride),{text:e,index:o=Math.min(o,t),title:""}})),a=new AjaxCache,p=new IconManager(u,o),w.iconManager=p,g=new TileManager(u,w),w.tileManager=g,vectorTileManager=new VectorTileManager(u,w),w.vectorTileManager=vectorTileManager,y=new PolylineManager(u,w.showInfoWindowForItem),$(document).trigger("polylineManagerReady-appHelper",[y,S]),h=new KmlManager(u,w),w.kmlManager=h,_=new AppCookie(e,function(){let e=$("input[type='checkbox'][data-layerid]",$("#layerSelection"));return $.makeArray(e.map(function(){return $(this).attr("data-layerid")}))}()),U=new AppEventBinding((w.appCookie=_,w.layerSelectorClosed=Y,w));{let t={timer:null,refreshData:!1},e=function(e){e&&(t.refreshData=e),clearTimeout(t.timer),t.timer=setTimeout(function(){(t.refreshData?ee:te)(!0),t.timer=null,t.refreshData=!1},300)};setInterval(function(){oe()&&e(!0)},61e3),MapComp.setMapEvents({closeInfoWindow:W,delayRefresh:e,setMapBeingDragged:G,noPanOffEarth:noPanOffEarth,map:u})}return $(document).trigger("appHelperInitComplete"),w};
var setupSlickCarousel=function(t){t.each(function(){this.dataset.lazy=this.dataset.lazy+"?t="+roundDateToDuration(moment().startOf("second"),moment.duration(1),"floor").unix()});var a,e=$(t).closest(".cctvCameraCarousel");return $(e).hasClass("slick-initialized")?Modernizr.mq("(max-width: 992px)")&&0<(a=$(".bootbox-body .map-tooltip").outerWidth()-10)&&($(".bootbox-body .slick-initialized, .bootbox-body .slick-slide").css("width",a+"px"),$(e).slick("setPosition")):($(e).slick({dots:!0,arrows:!0,autoplay:!0,lazyLoad:"ondemand",autoplaySpeed:1e4,accessibility:!0,infinite:!1}),$(e).on("beforeChange",function(t,a,e,i){a=$(a.$slides.get(i)),i=$("img",a);"true"==i.attr("data-needsrefresh")&&i[0].hasAttribute("src")&&(i.attr("src",URI(i.attr("src")).hash((new Date).getTime())),i.attr("data-needsrefresh","false"))})),$(t).removeClass("carouselCctvImage"),$(e)},setUpImageSlide=function(t,a){0<t.$slides.length&&((a=(t=$("img",$(t.$slides.get(a)))).data("title"))?($("#myCameraTitle").text(a),a=t.data("id"),$("#myCameraLocation").show(),$("#myCameraLocation").attr("href","#camera-"+a)):$("#myCameraLocation").hide(),t.attr("data-lazy",URI(t.data("url")).hash((new Date).getTime())),0<(a=t.data("refresh-rate")))&&setInterval(function(t){t=$("#"+t);t.attr("src",URI(t.data("url")).hash((new Date).getTime()))},a,t.attr("id"))};
"use strict";let UserCameras=null;class LatLng{}class CameraLocater{constructor(e){this.avoidZoom=!1,this.appPublicApi=e,this.map=this.appPublicApi.map,this.centerTooltip=e.appHelper.centerTooltip,$(document).on("hashChanged-urlHash",(e,a)=>{var t,i=urlHash.hash();this.oldHash===i?this.sameHash=!0:(this.oldHash=i,this.sameHash=!1),i&&0==i.toLowerCase().lastIndexOf("camera-",0)?(t=decodeURIComponent(this.getUrlHashAsId()))&&this.zoomToCamera(t,"Camera","Cameras"):i&&-1<i.indexOf("-")&&(MapComp.isLibre&&CTVars.tooltipOpen&&this.centerTooltip.closeTooltipClick(),/datalake_/i.test(i)&&!this.sameHash?(t=i.substr(i.indexOf(":")+1).split(","),this.zoomToDataLakeObject(i.substring(i.lastIndexOf("_")+1,i.indexOf(":")),i.substr(0,i.indexOf("_")),{lat:t[0],lon:t[1]})):this.zoomToObject(this.getUrlHashAsId(),i.split("-")[0]))})}zoomToDataLakeObject(t,i,e){e=new google.maps.LatLng(e.lat,e.lon),this.map.panTo(e),992<$(window).width()?this.map.setZoom(13):this.map.setZoom(17),e=$("input[type='checkbox'][data-layerid=\""+i+'"]',$("#layerSelection"));e.is(":checked")?this.appPublicApi.appHelper.dataLakeManager.refreshLayer(i):this.setupObjectLayer(e,i),$(document).on("datalake-layer-refresh-"+i,(e,a)=>{1==a.filter(e=>e.id==t).length&&(this.appPublicApi.appHelper.dataLakeManager.showInfoWindow(i,t),$(document).off("datalake-layer-refresh-"+i))})}setupObjectLayer(e,a){var e=e.attr("data-parent");e&&((e=$("input[type='checkbox'][data-layerid=\""+e+'"]',$("#layerSelection"))).click(),"True"!==e.attr("data-dontselectchildlayers"))||$("input[type='checkbox'][data-layerid=\""+a+'"]',$("#layerSelection")).click()}zoomToObject(i,o,l=!0){var e=$("input[type='checkbox'][data-layerid=\""+o+'"]',$("#layerSelection"));e.is(":checked")||"True"===e.attr("data-ischild")&&(e=document.querySelector('[data-layerId="'+o+'"]').parentElement.parentElement.parentElement?.id?.split("-")[0],(e=$("input[type='checkbox'][data-layerid=\""+e+'"]',$("#layerSelection"))).click(),"True"!==e.attr("data-dontselectchildlayers"))||$("input[type='checkbox'][data-layerid=\""+o+'"]',$("#layerSelection")).click(),MapComp.isLibre&&bootbox.closeMapPageDialog(),this.appPublicApi.appHelper.iconManager.RefreshLayer(o,!0),$(document).on("layerIconsUpdated",(e,a,t)=>{a==o&&(i=decodeURIComponent(i),1==(t=t.item2.filter(function(e){return e.itemId==i})).length?(l&&!this.avoidZoom?MapComp.layerIconsUpdated({this:this,layer:a,id:t[0].itemId,lng:t[0].location[0],lat:t[0].location[1],title:i}):(this.avoidZoom=!0,setTimeout(()=>{this.avoidZoom=!1},500)),$(document).off("layerIconsUpdated")):0==t.length&&$(document).trigger("closeDraggableWindow"))})}zoomToCamera(a,t,i){$.ajax("/"+t+"/GetLatLng?id="+a,{type:"POST"}).done(e=>{e&&null!=e.latitude&&null!=e.longitude&&(MapComp.zoomToCameraLocation({this:this,layer:i,hash:urlHash?.hash,controller:t,lat:e.latitude,lng:e.longitude,id:a}),$("input[type='checkbox'][data-layerid=\""+i+'"]',$("#layerSelection")).is(":checked")||($("input[type='checkbox'][data-layerid=\""+i+'"]',$("#layerSelection")).click(),this.appPublicApi.appHelper.layerToggled(i,!1)))})}getUrlHashAsId(){let e=urlHash.hash();return e=e.substring(e.indexOf("-")+1)}setUrlHashAsObjectId(e,a){let t="{0}-{1}".replace("{0}",a||"");t=t.replace("{1}",e||""),urlHash.hash(t)}}
$(function(){var o=[],C=[];function d(e,i,t,o,d,n,a,l){let r=e+"-video";e=document.getElementById(d);let c=e.getAttribute("data-videourl");var s,u,m,h,v,p,y,f,g,V,d=e.getAttribute("data-videoauth");let w=e.getAttribute("data-streamtype"),I=e.getAttribute("data-camera-id");"true"!==d&&c&&""!=c?E(e,i,t,o,r,c,w,n,a,l):(d=I,s=e,u=i,m=t,h=o,v=r,p=c,y=w,f=n,g=a,V=l,$.ajax("/Camera/GetVideoUrl?imageId="+d,{type:"GET",cache:!1}).done(function(e){"object"==typeof e?$.ajax(resources.CameraVideoUrl,{type:"POST",cache:!1,data:JSON.stringify(e),contentType:"application/json"}).done(function(e){E(s,u,m,h,v,p+e,y,f,g,V)}):E(s,u,m,h,v,e,y,f,g,V)}),"True"==resources.EnableVideoUrlRefresh&&(C[r]=setInterval(function(){var e,i,t,o,d,n;e=I,i=r,t=c,o=a,d=l,n=w,$.ajax("/Camera/GetVideoUrl?imageId="+e,{type:"GET",cache:!1}).done(function(e){"object"==typeof e?$.ajax(resources.CameraVideoUrl,{type:"POST",cache:!1,data:JSON.stringify(e),contentType:"application/json"}).done(function(e){T(i,t+e,o,d,n)}):T(i,e,o,d,n)})},6e4)))}function T(e,i,t,o,d){var n=document.getElementById(e);n?videojs(n,{width:t,height:o}).src({src:i,type:d}):C[e]&&(clearInterval(C[e]),C[e]=null)}function E(i,e,t,o,d,n,a,l,r,c){n='<video id="'+d+'" class="video-js vjs-default-skin" preload="auto" autoplay data-setup=\'{ "controls": true }\'>\t<source src="'+n+'" type="'+a+'" /> \n\t\t<p class="vjs-no-js"> To view this video please enable JavaScript, and consider upgrading to a web browser that supports HTML5 video</p>\n</video>';videojs.addLanguage("en",{"No compatible source was found for this media.":window.resources.IE8ErrorMessage}),i.appendChild(jQuery.parseHTML(n)[0]);let s,u=videojs(document.getElementById(d),{width:r,height:c});$(i).children("div.video-js").css({width:r+"px",height:c+"px"}),function e(){if(null!=u&&null==document.getElementById(d)){try{u.dispose(),C[d]&&(clearInterval(C[d]),C[d]=null)}catch(e){}u=null}null!=u&&setTimeout(function(){e()},5e3)}(),this.errorFunction=function(){videoElement=document.getElementById(d);var e=videojs(videoElement);4==!e.error().code&&(e.dispose(),e="<img src='"+resources.CctvVideoCustomErrorImage+"' style='display:block;width:100%'>",i.appendChild(jQuery.parseHTML(e)[0]))},resources.CctvVideoCustomErrorImage&&u.on("error",errorFunction),s=document.getElementById(e);let m=$(l)[0],h=$(l).next()[0];v()&&((a=$(".child div[id='"+i.id+"']")).length<2&&$(a).html($(i).children()),s=$(".child img[id='"+e+"']")[0],m=$(".child button[id='"+t+"']")[0],h=$(".child button[id='"+o+"']")[0]),s.style.display="none",m.style.display="none",h.style.display="inline",$(l).parent().prevUntil("video-js").children().css({width:r+"px"});{n=u.el_;let e=0;n.addEventListener("mouseout",function(){0<window.scrollY&&(e=window.scrollY),0===window.scrollY&&window.scrollTo(0,e)}),n.addEventListener("mouseover",function(){0<window.scrollY&&(e=window.scrollY)})}u.on("fullscreenchange",()=>{u.isFullscreen_||$(document).trigger("exitFullScreenVideo")})}function n(e,i,t,o,d,n){e=document.getElementById(e+"-video");let a=document.getElementById(i),l=$(n).prev()[0],r=$(n)[0];v()&&(a=$(".child img[id='"+i+"']")[0],l=$(".child button[id='"+t+"']")[0],r=$(".child button[id='"+o+"']")[0]),null!=e&&videojs(e).dispose();for(var c=document.getElementById(d);c.firstChild;)c.removeChild(c.firstChild);a.style.display="block",l.style.display="inline",r.style.display="none"}function a(e){e=$(e+".slick-initialized");void 0!==e&&0<e.length&&e.slick("slickSetOption","autoplay",!1).slick("slickPause")}function l(e){e=$(e+".slick-initialized");void 0!==e&&0<e.length&&e.slick("slickSetOption","autoplay",!0).slick("slickPlay")}function v(){return 0<$(".child .cctvImage").length}$(document).on("click",".showVideo",function(t){if(!(t.detail&&1<t.detail)&&"undefined"!=typeof videojs){a(".cctvCameraCarousel");t=$(this).parent().parent().find(".cctvImage");let e=t.width();t=t.height();let i=$(this).data("camera-id");null==e&&(e=parseInt(resources.CamTooltipMaxWidth)),d(i,i+"img","showVideo-"+i,"hideVideo-"+i,i+"-videoContainer",this,e,t),"True"==resources.EnableVideoTimeout&&(clearTimeout(o[i]),o[i]=setTimeout(function(){var e;e=i,l(".cctvCameraCarousel"),document.getElementById(e+"-video")&&n(e,e+"img","showVideo-"+e,"hideVideo-"+e,e+"-videoContainer",$(document).find("[id='hideVideo-"+e+"']"))},parseInt(resources.VideoTimeoutInMilliseconds)))}}),$(document).on("click",".hideVideo",function(){var e;"undefined"!=typeof videojs&&(l(".cctvCameraCarousel"),e=$(this).data("camera-id"),"True"==resources.EnableVideoTimeout&&(clearTimeout(o[e]),o[e]=null),C[e+"-video"]&&(clearInterval(C[e+"-video"]),C[e+"-video"]=null),n(e,e+"img","showVideo-"+e,"hideVideo-"+e,e+"-videoContainer",this))}),$(document).on("click",".showMyVideo",function(e){if(!(e.detail&&1<e.detail)&&"undefined"!=typeof videojs){a(".cameraCarousel");var e=$(this).parent().parent().find(".myCamImg"),t=e.width(),e=e.height();let i=$(this).data("camera-id");d(i+"my","carouselId-"+i,"showMyVideo-"+i,"hideMyVideo-"+i,i+"-myVideoContainer",this,t,e),"True"==resources.EnableVideoTimeout&&(clearTimeout(o[i]),o[i]=setTimeout(function(){var e;e=i,l(".cameraCarousel"),document.getElementById(e+"-video")&&n(e,e+"img","showVideo-"+e,"hideVideo-"+e,e+"-videoContainer",$(document).find("[id='hideVideo-"+e+"']"))},parseInt(resources.VideoTimeoutInMilliseconds)))}}),$(document).on("click",".hideMyVideo",function(){var e;"undefined"!=typeof videojs&&(l(".cameraCarousel"),e=$(this).data("camera-id"),"True"==resources.EnableVideoTimeout&&(clearTimeout(o[e]),o[e]=null),C[e+"-video"]&&(clearInterval(C[e+"-video"]),C[e+"-video"]=null),n(e+"my","carouselId-"+e,"showMyVideo-"+e,"hideMyVideo-"+e,e+"-myVideoContainer",this))}),$(document).on("CallRemoveVideo",function(){var e=$(".map-tooltip video");0<e.length&&$(e).each(function(){var e=$(this).parent().attr("id");videojs(document.getElementById(e)).dispose()});if(0<C.length)for(var i=0;i<C.length;i++)C[i]&&clearInterval(C[i])})});
window.CTVars={isErs:void 0,map:void 0,mapBounds:void 0,mapBottom:void 0,mapTop:void 0,tooltip:void 0,infoWindowObj:void 0,firstImage:void 0,imagesAlreadyLoaded:[],draggedMap:!1,contentHeightAdjusted:!1,externalPanListener:void 0,externalPanDone:!0,tooltipOpen:!1,firstMove:void 0,panByNotBusy:!0,widthAdjusted:void 0,widthHasIncreased:void 0,maxTooltipWidth:450,tooltipContainer:void 0,tooltipInitialPosition:{top:0,left:0},tooltipPos:{x:0,y:0},markerPoint:[],closeBtn:void 0};class CenterTooltip{constructor(t){CTVars.map=t,CTVars.isErs=0<$(".ersMode").length,MapComp.callback.closeTooltip=()=>{this.closeTooltip()}}startTriggers(){MapComp.isGoogle&&CTVars.map.addListener("dragend",()=>{CTVars.draggedMap=!0})}adjustTooltipScroll(){centerTooltip.scrollTooltipMoreInfoIntoView(),centerTooltip.panBy();var t,e,o=document.getElementById("draggableBorder");CTVars.widthHasIncreased&&o&&(t=o.querySelector(".row .event"),e=CTVars.mapBottom-CTVars.mapTop,t)&&t.scrollHeight!==o.scrollHeight+20&&t.scrollHeight<e&&(o.style.height=t.scrollHeight+20+"px"),MapComp.updateTooltipOffsetWithLine(o)}externalPanCheck(){CTVars.externalPanDone=!1,MapComp.isLibre&&MapComp.map.on("idle",MapComp.moveDone),MapComp.isGoogle&&(CTVars.externalPanListener=CTVars.map.addListener("idle",this.externalPanEvent.bind(this)))}externalPanEvent(){CTVars.externalPanListener&&CTVars.externalPanListener.instance&&(google.maps.event.removeListener(CTVars.externalPanListener),CTVars.externalPanListener=void 0,CTVars.externalPanDone=!0)}run(t){CTVars.panByNotBusy&&CTVars.externalPanDone&&CTVars.tooltipOpen?(this.resetRun(t),this.doFirstMove()):CTVars.tooltipOpen&&setTimeout(()=>{this.run()},100)}resetRun(t){CTVars.draggedMap=!1,CTVars.panByNotBusy=!0,CTVars.firstMove=!0,CTVars.widthHasIncreased=!1,CTVars.firstImage=void 0,CTVars.contentHeightAdjusted=!1,CTVars.firstImage&&CTVars.firstImage.removeEventListener("load",this.imageLoadedEvent.bind(this)),CTVars.tooltip=void 0,CTVars.infoWindowObj=t}tooltipClosed(){CTVars.tooltipOpen=!1}tooltipOpened(t,e,o){CTVars.tooltipOpen=!0,MapComp.isLibre&&e&&t&&(this.styleTooltip(t,e,o?.yOffset),MapComp.setupTooltipDrag({tooltip:e}),this.setupCloseTooltipBtn(),location.hash?.startsWith("#camera-"))&&history.replaceState(null,"","/map#Camera")}styleTooltip(t,e,o){e.style.visibility="visible",e.style.top=t.y-35+(o||0)+"px",e.style.left=t.x+"px",e.style.left=t.x+"px",e.style.bottom="unset"}setupCloseTooltipBtn(){CTVars.closeBtn=CTVars.tooltipContainer.querySelector(".closeDraggableWindow"),CTVars.closeBtn.addEventListener("click",this.closeTooltipClick.bind(this))}closeTooltipClick(){this.closeTooltip(),CTVars.closeBtn?.removeEventListener("click",this.closeTooltipClick.bind(this))}closeTooltip(){CTVars.tooltipContainer&&CTVars.tooltipContainer.parentNode&&CTVars.tooltipContainer.parentNode.removeChild(CTVars.tooltipContainer),MapComp.disableTooltipDrag(),MapComp.deleteTooltipLine(),MapComp.stopMonitoringMapMoves(),MapComp.removeEventShapes(),CTVars.tooltipOpen=!1,MapComp.data.moveToshowTooltip.tooltipYoffset=0}doFirstMove(){this.setupImageLoadEvent(),this.setupTabEvent(),this.setTooltipScrolling(),this.panBy()}setTooltipScrolling(){CTVars.tooltip.dom&&CTVars.tooltip.isDraggable&&(CTVars.tooltip.dom.addEventListener("mouseover",()=>{CTVars.tooltip.dom.focus(),MapComp.isLibre||CTVars.map.set("scrollwheel",!1)}),CTVars.tooltip.dom.addEventListener("mouseout",()=>{MapComp.isLibre||CTVars.map.set("scrollwheel",!0)}))}imageLoadedEvent(){CTVars.firstImage&&(CTVars.firstImage.id&&-1===CTVars.imagesAlreadyLoaded.indexOf(CTVars.firstImage.id)&&CTVars.imagesAlreadyLoaded.push(CTVars.firstImage.id),CTVars.firstImage.removeEventListener("load",this.imageLoadedEvent.bind(this))),this.tryToPanBy()}panByEvent(){CTVars.panByListener&&CTVars.panByListener.instance&&(google.maps.event.removeListener(CTVars.panByListener),CTVars.panByListener=void 0,CTVars.panByNotBusy=!0,CTVars.firstMove)&&(CTVars.firstMove=!1,this.panBy())}tryToPanBy(){CTVars.panByNotBusy?this.panBy():setTimeout(()=>{this.tryToPanBy()},50)}panBy(){var t,e;this.setTooltip(),CTVars.tooltip.dom&&CTVars.tooltip.measures&&!CTVars.tooltip.insideBootbox&&CTVars.panByNotBusy&&(this.setMapBounds(),this.adjustTooltipSize(),this.setTooltip(),t=this.yTooltipMove(),e=this.xTooltipMove(),MapComp.isLibre&&MapComp.centerTooltip({panBy:[e,t],markerPoint:CTVars.markerPoint}),0!==e||0!==t?(CTVars.panByNotBusy=!1,MapComp.isGoogle&&(CTVars.panByListener=CTVars.map.addListener("idle",this.panByEvent.bind(this)),CTVars.map.panBy(e,t),this.adjustTooltipTop())):CTVars.firstMove&&!MapComp.isLibre&&(CTVars.firstMove=!1,this.panBy()))}adjustTooltipSize(){var e=document.getElementById("draggableBorder");if(e){var t=Math.round(e.scrollHeight);Math.round(e.getBoundingClientRect().height);if(t<CTVars.mapBottom-CTVars.mapTop?(e.style.height="unset",e.style.maxHeight="unset",e.style.overflowY="hidden",document.querySelector(".closeDraggableWindow").style.right="3px"):(e.style.height=CTVars.mapBottom-CTVars.mapTop+"px",e.style.maxHeight="unset",e.style.overflowY="auto",document.querySelector(".closeDraggableWindow").style.right="11px",CTVars.tooltip.hasSingleImg||CTVars.tooltip.hasSlickSlider||this.adjustTooltipWidth(),CTVars.tooltip.weatherForecast&&(t=document.querySelector(".draggableWindow"),o=CTVars.tooltip.dom.querySelector(".largeScreen table"),t)&&o&&(a=o.getBoundingClientRect().width,o.style.width=a+"px",t.style.width=a+55+"px")),CTVars.widthHasIncreased){let t=e.querySelector(".row .event");var o=(t=(t=null===t?e.querySelector(".map-tooltip"):t)||e.querySelector(".draggable-tooltip")).getBoundingClientRect().height;t&&t.scrollHeight!==e.scrollHeight+10&&o<CTVars.mapBottom-CTVars.mapTop&&!CTVars.contentHeightAdjusted&&(e.style.height=t.scrollHeight+10+"px",CTVars.contentHeightAdjusted=!0,setTimeout(()=>{this.tryToPanBy()}))}this.trimExcessTabHeight(e),CTVars.tooltip.hasInfoToggle&&$(document).on("tooltip-info-toggled",this.adjustTooltipScroll)}else CTVars.tooltip.hasSingleImg||CTVars.tooltip.hasSlickSlider||!MapComp.isGoogle||(t=document.querySelector(".gm-style-iw-d"))&&t.scrollHeight>t.clientHeight&&CTVars.infoWindowObj&&CTVars.infoWindowObj.maxWidth!==this.maxTooltipWidth&&(CTVars.widthAdjusted=CTVars.map.addListener("idle",this.googlewidthAdjustedEvent.bind(this)),CTVars.infoWindowObj.maxWidth=this.maxTooltipWidth);var a=document.querySelector(".draggableWindowContainer");a&&(a.style.visibility="visible")}trimExcessTabHeight(t){var e;0<CTVars.tooltip.dom.querySelectorAll(".nav-tabs a").length&&(e=CTVars.tooltip.dom.querySelector(".map-tooltip").getBoundingClientRect().height)<CTVars.mapBottom-CTVars.mapTop&&(t.style.height=e+15+"px")}googlewidthAdjustedEvent(){CTVars.widthAdjusted&&CTVars.widthAdjusted.instance&&(google.maps.event.removeListener(CTVars.widthAdjusted),CTVars.widthAdjusted=void 0,CTVars.draggedMap)&&this.panBy()}adjustTooltipWidth(){var t=document.querySelector(".draggableWindowContainer");t.getBoundingClientRect().width<this.maxTooltipWidth&&(t.style.width=this.maxTooltipWidth+"px",CTVars.widthHasIncreased=!0,(t=document.getElementById("draggableBorder")).scrollHeight===t.clientHeight)&&(document.querySelector(".closeDraggableWindow").style.right="3px")}setupImageLoadEvent(){var t,e;this.setTooltip(),CTVars.tooltip.dom&&CTVars.tooltip.measures&&(CTVars.tooltip.hasSlickSlider||CTVars.tooltip.hasSingleImg||CTVars.tooltip.weatherForecast)&&(CTVars.tooltip.dom.querySelector(".slick-slide")&&(CTVars.firstImage=CTVars.tooltip.dom.querySelector(".slick-slide").querySelector("img:not(.agencyLogo)")),t=CTVars.tooltip.dom.querySelector(".cctvCameraCarousel "),CTVars.firstImage||(CTVars.firstImage=CTVars.tooltip.dom.querySelector(".cctvImage")),CTVars.firstImage||(e=CTVars.tooltip.dom.querySelector(".largeScreen").getElementsByTagName("img"),CTVars.firstImage=e[e.length-1]),CTVars.firstImage&&-1===CTVars.imagesAlreadyLoaded.indexOf(CTVars.firstImage.id)||t)&&(MapComp.isGoogle&&CTVars.firstImage.addEventListener("load",this.imageLoadedEvent.bind(this)),MapComp.isLibre)&&CTVars.firstImage.addEventListener("load",this.imageLoadedEvent.bind(this),{once:!0})}setMapBounds(){CTVars.mapBounds=document.getElementById("map-canvas").getBoundingClientRect(),CTVars.mapBottom=CTVars.mapBounds.bottom-100,CTVars.mapTop=CTVars.mapBounds.top+60+(CTVars.isErs?25:0)}setTooltip(){let t=document.querySelector(".draggableWindow"),e=!0,o=!1,a=!1,s={},i=!1,r=!1,l=!1;var n=document.querySelector(".bootbox");let p=!1;n&&n.querySelector(".map-tooltip")&&(p=!0),t||(t=(t=document.querySelector(".map-tooltip"))&&t.parentElement.parentElement,e=!1),t||(t=document.querySelector(".gm-style-iw"),e=!1),t&&(t.querySelector(".slick-slider")&&(o=!0),e?(n=document.querySelector("#draggableBorder")).scrollHeight>n.clientHeight&&(a=!0):t.scrollHeight>t.clientHeight&&(a=!0),t.querySelector(".cctvImage")&&(i=!0),s=t.getBoundingClientRect(),t.querySelector(".weatherForecast")&&(r=!0),t.querySelector("#toggleDetourText")||t.querySelector(".tooltip-comments"))&&(l=!0),CTVars.tooltip={dom:t,isDraggable:e,hasSlickSlider:o,hasScroll:a,measures:s,insideBootbox:p,hasSingleImg:i,weatherForecast:r,hasInfoToggle:l}}setupTabEvent(){var t;CTVars.tooltip&&CTVars.tooltip.dom&&(t=CTVars.tooltip.dom.querySelectorAll(".nav-tabs a"))&&$(t).on("shown.bs.tab",()=>{this.panBy()})}yTooltipMove(){let t=0;var e;return CTVars.firstMove&&!MapComp.isLibre||(CTVars.mapTop>CTVars.tooltip.measures.top?(t=CTVars.tooltip.measures.top-CTVars.mapTop,MapComp.data.tooltipLine?.lineDrawn&&(t+=MapComp.methods.tooltipLine.getHeight()),e=CTVars.mapBottom-CTVars.mapTop,-1*t>e&&(t=-1*e)):CTVars.mapBottom<CTVars.tooltip.measures.bottom&&(t=CTVars.tooltip.measures.bottom-CTVars.mapBottom+(CTVars.tooltip.isDraggable?0:10),e=CTVars.tooltip.measures.top-t,CTVars.mapTop>e)&&(t=0,CTVars.tooltip.hasScroll||CTVars.tooltip.isDraggable||(e=CTVars.tooltip.dom.parentElement.parentElement.getBoundingClientRect(),t=e.top-CTVars.mapTop))),t}xTooltipMove(){let t=0;var e=CTVars.tooltip.isDraggable;let o=!1,a;0<$(".col-md-12.mapColContainer").length?(s=$("#sideBarColContainer"))&&s.is(":visible")?(o=!0,a=s[0].getBoundingClientRect(),CTVars.tooltip.measures.left<a.right&&(t=-1*(a.right-CTVars.tooltip.measures.left+(e?10:20)))):CTVars.tooltip.measures.left<0&&(t=CTVars.tooltip.measures.left-CTVars.mapBounds.left+(e?-10:-25)):CTVars.tooltip.measures.left<CTVars.mapBounds.left&&(t=CTVars.tooltip.measures.left-CTVars.mapBounds.left+(e?-10:-25));var s=$("#layerSelection"),i=s&&s.is(":visible");let r;return i?(r=s[0].getBoundingClientRect(),CTVars.tooltip.measures.right>r.left&&(t=-1*(r.left-CTVars.tooltip.measures.right-(e?10:25)))):CTVars.tooltip.measures.right>CTVars.mapBounds.right&&(t=CTVars.tooltip.measures.right-CTVars.mapBounds.right-(e?-10:-25)+("TOP_CENTER"===resources.MapControlPos?0:50)),t=i&&o&&(s=a.x+a.width,e=r.x,!CTVars.firstMove)&&e-s<CTVars.tooltip.measures.width?0:t}scrollTooltipMoreInfoIntoView(){let t=document.getElementById("toggleDetourText");t=t||document.getElementById("toggleComment");var e,o=document.getElementById("draggableBorder");let a=o?!0:!1;this.setMapBounds(),a&&((e=document.getElementById("detourCollapse"))&&(e.classList.contains("in")?o.scrollHeight<CTVars.mapBottom-CTVars.mapTop?(o.style.height=o.scrollHeight+"px",o.style.maxHeight="unset"):(o.style.height=CTVars.mapBottom-CTVars.mapTop+"px",o.style.maxHeight="unset",e=t.getBoundingClientRect().top-o.getBoundingClientRect().top,o.scroll({top:e,left:0,behavior:"smooth"})):(o.removeAttribute("style"),this.adjustTooltipSize())),e=document.getElementById("lastUserComment"))&&("none"!==e.style.display?(e=e.getBoundingClientRect().bottom-o.getBoundingClientRect().top,o.scroll({top:e,left:0,behavior:"smooth"})):(o.removeAttribute("style"),this.adjustTooltipSize()))}clickInsideTooltip(t,e){if(!CTVars.tooltip||!CTVars.tooltipOpen)return!1;this.setTooltip();var o=CTVars.tooltip.measures,t=t>o.x&&t<o.x+o.width,e=e>o.y&&e<o.y+o.height;return t&&e}adjustTooltipTop(){var t,e=document.getElementById("draggableBorder");e&&e.scrollHeight>e.clientHeight&&0<document.getElementsByClassName("ersMode").length&&!e.querySelector("#draggableHeader")&&((t=document.createElement("div")).className="tooltipWhiteStrip",t.id="draggableHeader",e.prepend(t))}}
class ContextMenu{constructor(t,e){this.onTouchStart=t=>{this.touchTimer||(this.touchTimer=setTimeout(()=>this.onRightClick(t),600))},this.onTouchEnd=t=>{this.touchTimer&&(clearTimeout(this.touchTimer),this.touchTimer=null,(MapComp.isGoogle?t.domEvent:t).preventDefault())},this.onDragStart=()=>{this.touchTimer&&(clearTimeout(this.touchTimer),this.touchTimer=null)},this.onRightClick=t=>{this.touchTimer=null,this.contextMenu.hide();let e,i,s;s=MapComp.isLibre?(centerTooltip.closeTooltip(),e=t.point.x,i=t.point.y,t.lngLat):(e=t.pixel.x,i=t.pixel.y,{lat:t.latLng.lat(),lng:t.latLng.lng()}),this.helper.populateMenu(this.contextMenu,e,i,s,this.displayMenu),$(document).trigger("closeDraggableWindow")},this.displayMenu=(t,e,i,s)=>{this.contextMenu.empty(),this.contextMenu.append(t),this.contextMenu.append('<li class="divider"><a href="#resetMarkers" class="list-group-item"><i class="far fa-redo"></i>'+resources.StartOver+'</a></li><li><a href="#zoomIn" class="list-group-item"><i class="far fa-plus"></i>'+resources.ZoomIn+'</a></li><li><a href="#zoomOut" class="list-group-item"><i class="far fa-minus"></i>'+resources.ZoomOut+'</a></li><li><a href="#centerMap" class="list-group-item"><i class="far fa-compress-alt"></i>'+resources.CenterHere+"</a></li>"),this.setUpMenuEventHandlers(s);t=$(MapComp.getMapDiv());e>t.width()-this.contextMenu.width()&&(e-=this.contextMenu.width()),i>t.height()-this.contextMenu.height()&&(i-=this.contextMenu.height()),this.contextMenu.css({top:i,left:e}).fadeIn(300)},this.AddWaypointToContextMenu=t=>{this.helper.AddWaypointToContextMenu(t)},this.setUpMenuEventHandlers=s=>{this.contextMenu.find("a").click(t=>{t.preventDefault(),e=("FONT"===t.target.tagName?t.target.parentElement.parentElement.getAttribute("href"):$(t.target).attr("href")).substr(1);var e,i=this.possiblyParseInt(e);if(null!=i)this.helper.doAction(this.contextMenu,t,i);else switch(this.contextMenu.fadeOut(75),e){case"resetMarkers":this.helper.resetMarkers(this.contextMenu);break;case"zoomIn":MapComp.zoomInToLocation({location:MapComp.helpers.getLatLng(s)});break;case"zoomOut":MapComp.zoomOutToLocation({location:MapComp.helpers.getLatLng(s)});break;case"centerMap":MapComp.centerMapToLocation({location:MapComp.helpers.getLatLng(s)})}}),this.helper.setupEventHandlers(this.contextMenu)},this.possiblyParseInt=t=>{try{var e=parseInt(t);return isNaN(e)?null:e}catch(t){return null}},this.helper=e,this.contextMenu=$(document.createElement("ul")).attr("id","contextMenu"),this.contextMenu.bind("contextmenu",function(){return!1}),MapComp.setContextMenuListeners(this,t)}}
var CreateDraggableInfoWindow=function(r,t){var l,c,s,g,d,u,m,h=0,p={};function o(t,e,o,n,i){e.addEventListener(n,function(e){null==(e.changedTouches?e.changedTouches.item(t.touchTracker):null)&&"touchcancel"==e.type||google.maps.event.trigger(o,i,e)})}function n(e){var t,o,n=p.that,i=p.container,a=(p.target,e.changedTouches?e.changedTouches.item(n.touchTracker):null);null==a&&"touchmove"==e.type||(null!=a&&0==$(document.elementFromPoint(a.pageX,a.pageY)).parents(".draggableWindow").length&&google.maps.event.trigger(i,"touchend",e),e.preventDefault(),t=(i=n.get("origin")).changedTouches?i.changedTouches.item(n.touchTracker):null,o="touchmove"==e.type?t.clientX-a.clientX:i.clientX-e.clientX,t="touchmove"==e.type?t.clientY-a.clientY:i.clientY-e.clientY,a=n.getProjection().fromLatLngToDivPixel(n.get("position")),i=n.getProjection().fromDivPixelToLatLng(new google.maps.Point(a.x-o,a.y-t)),n.set("origin",e),n.set("position",i),n.draw(),o=n,(a=l)&&r&&(o=o.getProjection().fromDivPixelToLatLng(new google.maps.Point(g.x-h,g.y-40)),a=[gMarkers.getPosition(a),o],c.setPath(a)))}function i(t,o,e){o.addEventListener(e,function(e){-1!=e.target.className.indexOf("closeDraggableWindow")?($(document).trigger("callCloseInfoWindow"),document.getElementsByTagName("body")[0].style.userSelect="unset"):(e.stopPropagation(),"draggableBorder"!==e.target.getAttribute("id")&&"draggableHeader"!=e.target.getAttribute("id")||(document.getElementsByTagName("body")[0].style.userSelect="none",t.set("origin",e),e.changedTouches&&(t.touchTracker=e.changedTouches[0].identifier),m=t.get("map").getDiv(),p={that:t,target:m,container:o},m.addEventListener("mousemove",n),m.addEventListener("touchmove",n)))}),google.maps.event.addListener(d,"click",function(e){CTVars.tooltipOpen&&e.stop()})}function a(t,e,o){e.addEventListener(o,function(e){document.getElementsByTagName("body")[0].style.userSelect="unset",null==(e.changedTouches?e.changedTouches.item(t.touchTracker):null)&&"touchend"==e.type||(t.touchTracker=null,m&&(m.removeEventListener("mousemove",n),m.removeEventListener("touchmove",n)))})}$(document).on("closeDraggableWindow",function(){d&&(d.set("scrollwheel",!0),d.gestureHandling="greedy"),"True"==resources.CctvEnableVideo&&$(document).trigger("CallRemoveVideo"),r&&null!=r.container&&r.onRemove(),$(document).trigger("info-window-close"),$(document).off("closeDraggableWindow"),$(document).off("tooltip-info-toggled")});let e=["customMapCtrl","gm-svpc","gmnoprint","layerSelection","sideBarColContainer"];function v(){e.forEach(e=>{Array.from(document.getElementsByClassName(e)).forEach(e=>{e.addEventListener("mouseover",()=>{m&&(m.removeEventListener("mousemove",n),m.removeEventListener("touchmove",n),document.getElementsByTagName("body")[0].style.userSelect="unset")})})})}function f(e,t,o){"function"==typeof draw&&(this.draw=draw),this.setValues({position:t,container:null,content:o,map:e})}return(f.prototype=new google.maps.OverlayView).onAdd=function(){var e=document.createElement("div"),t=(that=this,$(e).ready(s),this.get("content"));if(void 0!==t.nodeName)e.appendChild(t);else{if("string"!=typeof t)return;e.innerHTML=t}e.style.position="absolute";var t=t.indexOf("infoWindowLoading");google.maps.OverlayView.preventMapHitsAndGesturesFrom(e),-1==t&&(o(that,this.get("map").getDiv(),e,"touchcancel","touchend"),o(that,this.get("map").getDiv(),e,"mouseleave","mouseup"),i(that,e,"touchstart"),i(that,e,"mousedown"),i(that,e,"contextmenu"),v(that),that,t="mouseenter",e.addEventListener(t,function(e){d.gestureHandling="none"}),that,t="mouseleave",e.addEventListener(t,function(e){d.gestureHandling="greedy"})),a(that,e,"touchend"),a(that,e,"mouseup"),this.set("container",e),this.getPanes().floatPane.appendChild(e),g=that.getProjection().fromLatLngToDivPixel(that.get("position")),latLng=that.getProjection().fromDivPixelToLatLng(new google.maps.Point(g.x,g.y))},f.prototype.draw=function(){g=this.getProjection().fromLatLngToDivPixel(this.get("position"));var e=this.get("container");e&&(e.style.left=g.x+"px",e.style.top=g.y+(t&&"number"==typeof t?t:0)+"px")},f.prototype.onRemove=function(){var e,t=this.get("container");t&&t.parentNode&&((e=t.querySelector("#"+u))&&(e.style.display="none",document.querySelector("#map-canvas").appendChild(e)),t.parentNode.removeChild(t),this.set("container",null)),$(document).trigger("closeGoogleWindow"),c&&c.setMap(null)},function(e,t,o,n,i,a){u=o,l=t,d=e,s=a,-1===n.indexOf("infoWindowLoading")&&(n=n.replace('map-tooltip"','map-tooltip draggable-tooltip"')),o='<div class="draggableWindowContainer" style="width: '+i+'px;"><div class="draggableWindow">'+(n=(n="<div id='draggableBorder' class='tooltipPadding'>".concat(n)).concat("</div>"))+'<button class="fal fa-times closeDraggableWindow" aria-label="Close"></button></div></div>',r=new f(e,gMarkers.getPosition(l),o),c=new google.maps.Polyline({strokeColor:"#999",strokeOpacity:1,strokeWeight:2,map:e}),$("#contextMenu").hide(),m=e.getDiv()}};
var Hashtable=function(h){var c,y,l="function",e="string";return"undefined"==typeof encodeURIComponent||Array.prototype.splice===h||Object.prototype.hasOwnProperty===h?null:(c=t("key"),y=t("value"),g.prototype={getEqualityFunction:function(t){return typeof t.equals==l?n:r},getEntryForKey:u(1),getEntryAndIndexForKey:u(2),removeEntryForKey:function(t){t=this.getEntryAndIndexForKey(t);return t?(this.entries.splice(t[0],1),t[1]):null},addEntry:function(t,n){this.entries.push([t,n])},keys:o(0),values:o(1),getEntries:function(t){for(var n=t.length,e=0,r=this.entries,i=r.length;e<i;++e)t[n+e]=r[e].slice(0)},containsKey:u(0),containsValue:function(t){for(var n=this.entries,e=n.length;e--;)if(t===n[e][1])return!0;return!1}},(s.prototype={each:function(t){for(var n,e=this.entries(),r=e.length;r--;)t((n=e[r])[0],n[1])},equals:function(t){var n,e,r,i=this.size();if(i!=t.size())return!1;for(n=this.keys();i--;)if(e=n[i],null===(r=t.get(e))||r!==this.get(e))return!1;return!0},putAll:function(t,n){for(var e,r,i,u=t.entries(),o=u.length,s=typeof n==l;o--;)e=(r=u[o])[0],r=r[1],s&&(i=this.get(e))&&(r=n(e,i,r)),this.put(e,r)},clone:function(){var t=new s(this.properties);return t.putAll(this),t}}).toQueryString=function(){for(var t,n=this.entries(),e=n.length,r=[];e--;)t=n[e],r[e]=encodeURIComponent(i(t[0]))+"="+encodeURIComponent(i(t[1]));return r.join("&")},s);function i(t){return typeof t==e?t:""+t}function p(t){var n;return typeof t==e?t:typeof t.hashCode==l?typeof(n=t.hashCode())==e?n:p(n):i(t)}function n(t,n){return t.equals(n)}function r(t,n){return typeof n.equals==l?n.equals(t):t===n}function t(n){return function(t){if(null===t)throw new Error("null is not a valid "+n);if(t===h)throw new Error(n+" must not be undefined")}}function g(t,n,e,r){this[0]=t,this.entries=[],this.addEntry(n,e),null!==r&&(this.getEqualityFunction=function(){return r})}function u(i){return function(t){for(var n,e=this.entries.length,r=this.getEqualityFunction(t);e--;)if(r(t,(n=this.entries[e])[0]))switch(i){case 0:return!0;case 1:return n;case 2:return[e,n[1]]}return!1}}function o(u){return function(t){for(var n=t.length,e=0,r=this.entries,i=r.length;e<i;++e)t[n+e]=r[e][u]}}function v(t,n){t=t[n];return t&&t instanceof g?t:null}function s(){var o=[],s={},l={replaceDuplicateKey:!0,hashCode:p,equals:null},t=arguments[0],n=arguments[1];if(n!==h)l.hashCode=t,l.equals=n;else if(t!==h){var e,r=l,i=t;for(e in i)i.hasOwnProperty(e)&&(r[e]=i[e])}function u(e){return function(){for(var t=[],n=o.length;n--;)o[n][e](t);return t}}var f=l.hashCode,a=l.equals;this.properties=l,this.put=function(t,n){c(t),y(n);var e,r=f(t),i=null,u=v(s,r);return u?(e=u.getEntryForKey(t))?(l.replaceDuplicateKey&&(e[0]=t),i=e[1],e[1]=n):u.addEntry(t,n):(u=new g(r,t,n,a),o.push(u),s[r]=u),i},this.get=function(t){c(t);var n=f(t),n=v(s,n);if(n){n=n.getEntryForKey(t);if(n)return n[1]}return null},this.containsKey=function(t){c(t);var n=f(t),n=v(s,n);return!!n&&n.containsKey(t)},this.containsValue=function(t){y(t);for(var n=o.length;n--;)if(o[n].containsValue(t))return!0;return!1},this.clear=function(){o.length=0,s={}},this.isEmpty=function(){return!o.length};this.keys=u("keys"),this.values=u("values"),this.entries=u("getEntries"),this.remove=function(t){c(t);var n=f(t),e=null,r=v(s,n);return r&&null!==(e=r.removeEntryForKey(t))&&0==r.entries.length&&(t=function(t,n){for(var e=t.length;e--;)if(n===t[e][0])return e;return null}(o,n),o.splice(t,1),delete s[n]),e},this.size=function(){for(var t=0,n=o.length;n--;)t+=o[n].entries.length;return t}}}();
let IconManager=function(t,s){var e={};let c=[],d=new MapFctns,u=(e.AddIconLayer=function(e,r,n,o,a,i){if(-1!=u(e))throw"layerid is already active.";n=new IconLayer(e,r,n,o,a,i);c.push(n),MapComp.isGoogle&&n.MapChanged(t,d,s),$(document).trigger("layerAdded-iconManager",[e,r])},e.RemoveIconLayer=function(e){MapComp.isLibre&&MapComp.removeMarkersOrLines({layer:e});e=u(e);-1!=e&&(c[e].Delete(s),c.splice(e,1))},e.GetIconLayer=function(e){e=u(e);if(-1!=e)return c[e]},e.RefreshLayers=function(){let e=c.length,r=0;if(e)for(var n in c)c[n].RefreshLayer(t,d,s).done(function(){++r==e&&$(document).trigger("layersRefreshed-iconManager")});else $(document).trigger("layersRefreshed-iconManager")},e.RefreshLayer=function(e,r){var e=u(e);return-1!=e?c[e].RefreshLayer(t,d,s,r):((e=jQuery.Deferred()).resolve(),e.promise())},e.MapChanged=function(){for(var e in c)c[e].MapChanged(t,d,s);$(document).trigger("mapChangedFinished-iconManager")},e.Redraw=function(){MapComp.isGoogle&&(s.repaint(),$(document).trigger("markerClustererRepainted"))},function(e){for(var r in c)if(c[r].layerId===e)return r;return-1});return e},IconLayer=function(y,e,i,M,t,r){var n={};n.layerId=y;let h=new Hashtable,s=!1,v=e.item2,C=e.item1,I=0,k=22,o=(r&&(r.minZoom&&(I=r.minZoom),r.maxZoom)&&(k=r.maxZoom),n.RefreshLayer=function(r,n,o,e){let a=jQuery.Deferred();return i(y,e,t).done(function(e){s||(MapComp.isGoogle&&(v=e.item2,C=e.item1,c(r,n,o)),MapComp.isLibre&&MapComp.addMarkersOrLines({data:e,layerId:y}))}).always(function(e){$(document).trigger("layerRefreshed-iconManager."+y,[y,e]),a.resolve()}),a.promise()},n.MapChanged=function(e,r,n){c(e,r,n)},n.Delete=function(e){s=!0,o(e),$(document).trigger("layerDeleted-iconManager",[y])},n.GetIcons=function(){var e,r=[];for(e of h.keys()){var n=h.get(e);r.push(n.gmapsMarkers)}return r.flat()},function(e){if(!MapComp.isLibre){var r,n=h.keys(),o=new Array;for(r of n){var a=h.get(r);1==a.status&&(o.push(a.gmapsMarkers),a.status=0)}e.removeMarkers(o.flat(),!0)}}),c=function(e,r,n){var o,a=new Array,i=new Array,t={},s={},c=r.GetMapBoundsObject(e),d=e.getZoom();for(o in v){v[o]=(u=v[o],l=C,u.merged||(l.url&&!u.icon.url&&(u.icon.url=l.url),!l.json||u.icon.json&&"{"==u.icon.json[0]||(u.icon.json=l.json.replace("{jsondata}",u.icon.json)),u.zindex=l.zindex,void 0===u.icon.anchor&&(u.icon.anchor=l.anchor),void 0===u.icon.origin&&(u.icon.origin=l.origin),void 0===u.icon.size&&(u.icon.size=l.size),u.merged=!0),u);var u,l=y+"-"+v[o].type+"-"+v[o].itemId+"-"+v[o].icon.url+"-"+v[o].location[0]+"-"+v[o].location[1];t[l]=1,d<I||d>k||!L(v[o],c,r)||(s[l]=1,h.get(l))||(u=new IconItem(v[o],M(y,v[o])),h.put(l,u))}var f,m=h.keys();for(f in m){var g=m[f],p=h.get(g);0==p.status?t[g]?s[g]&&(p.status=1,a.push(p.gmapsMarkers)):h.remove(g):t[g]?s[g]||(p.status=0,i.push(p.gmapsMarkers)):(i.push(p.gmapsMarkers),h.remove(g))}n.removeMarkers(i.flat(),!0),n.addMarkers(a.flat(),!0),0<h.values().length&&$(document).trigger("layerRefreshed-iconsAdded."+y,[y,a])},L=function(e,r,n){return e.secondarylocation?n.CoordinateIsContained(e.location[0],e.location[1],r)||n.CoordinateIsContained(e.secondarylocation[0],e.secondarylocation[1],r):n.CoordinateIsContained(e.location[0],e.location[1],r)};return n},IconItem=function(e,r){var n={};return n.icon=e,n.gmapsMarkers=r,n.status=0,n};
var KmlManager=function(map,appHelper){var publicItem={},layers=new Hashtable;return publicItem.AddLayer=function(layerId,config){var kmlOptions,url,cacheTime,kmlLayer,layer;layers.get(layerId)||("Kml"==config.type?MapComp.isLibre?MapComp.addKmlLayer({layerId:layerId,config:config}):(kmlOptions={clickable:config.clickable,suppressInfoWindows:!0,preserveViewport:!0,map:map},config.url&&(url=URI(config.url),cacheTime=5,0<config.cacheTime&&(cacheTime=config.cacheTime/60),url.addSearch("t",roundDateToDuration(moment(),moment.duration(cacheTime,"minutes"),"floor").unix()),url.addSearch("lang",Cookies.get("_culture")).toString(),kmlLayer=new google.maps.KmlLayer(url.toString(),kmlOptions),config.suppressInfoWindow||kmlLayer.addListener("click",function(l){if(!l.domEvent||!appHelper.centerTooltip.clickInsideTooltip(l.domEvent.x,l.domEvent.y)){let e=l.featureData.description;var a="<div>"===e.slice(0,5)&&"</div>"===e.slice(e.length-6,e.length);e="<div class='map-tooltip'>"+(e=a?e.slice(0,4)+" class='kmlTooltip'"+e.slice(4,e.length):e)+"</div>",appHelper.showInfoWindow(e,null,!0,l.latLng,layerId,!0,!1,l.pixelOffset)}}),layers.put(layerId,kmlLayer))):"GeoJson"==config.type&&(MapComp.isLibre?console.log("TODO: add map libre GeoJson layer"):(layer=new google.maps.Data,layer.loadGeoJson(config.url),config.styleOptions&&layer.setStyle(JSON.parse(config.styleOptions)),layer.setMap(map),layers.put(layerId,layer),config.suppressInfoWindow||layer.addListener("click",function(event){appHelper.showInfoWindow(eval("`"+config.infoWindowTemplate+"`"),null,!0,event.latLng,null,!0,!0)}))))},publicItem.RemoveLayer=function(e){MapComp.isLibre?MapComp.removeKmlLayer({layerId:e}):layers.get(e)&&(layers.get(e).setMap(null),layers.remove(e))},publicItem.GetLayer=function(e){return layers.get(e)},publicItem.Refresh=function(e){for(var l=[...layers.keys()],a=0;a<l.length;a++)publicItem.RemoveLayer(l[a]);for(a=0;a<l.length;a++)publicItem.AddLayer(l[a],e[l[a]])},publicItem};
let MapFctns=function(){if(MapFctns.instance)return MapFctns.instance;let a={};function l(e){var e=e.split(","),t=[];if(MapComp.isGoogle)for(var o of e){o=o.trim().split(" "),o=new google.maps.LatLng(o[1],o[0]);t.push(o)}else for(var n of e){n=n.trim().split(" ");t.push([parseFloat(n[0]),parseFloat(n[1])])}return t}return a.CoordinateIsContained=function(e,t,o){return o.contains(new google.maps.LatLng(e,t))},a.GetMapBoundsObject=function(e){return e.getBounds()},a.GetMapSwLatLng=function(e){return e.getBounds().getSouthWest()},a.GetMapSpanLatLng=function(e){return e.getBounds().toSpan()},a.GetPoiShapesFromWKT=function(t,o){if(""!=t){let e=[];var n=[],r=/\(([^()]+)\)/g;if(-1!==t.indexOf("POLYGON")||-1!==t.indexOf("MULTIPOLYGON"))return a.GetPolygonFromWKT(t);for(;results=r.exec(t);)n.push(l(results[1]));if(-1!==t.indexOf("LINESTRING")||-1!==t.indexOf("MULTILINESTRING"))for(const s of n)e=MapComp.setEventPolyline(s,e,o);else if(-1!==t.indexOf("POINT"))for(const i of n)e=MapComp.setEventPoint(e,i);return e}},a.GetPolygonFromWKT=function(n){if(""!=n){let e=[],t=!1;-1!==n.indexOf("MULTIPOLYGON")&&(t=!0,n=n.substring(n.indexOf("(")+1,n.length-1));var r=/\)\)(\s?,\s?)\(\(/g,s=/\(([^()]+)\)/g,i=[];let o;if(t){let e=0;for(;o=r.exec(n);){var a=[],g=n.substring(e,o.index+2);for(e=o.index+2;o=s.exec(g);)a.push(l(o[1]));i.push(a)}for(rings=[],polygonWKT=n.substring(e);o=s.exec(polygonWKT);)rings.push(l(o[1]))}else for(rings=[];o=s.exec(n);)rings.push(l(o[1]));i.push(rings);for(const f of i)e=MapComp.setEventPolygons({paths:f,strokeColor:resources.EventPolygonStrokeColor,strokeOpacity:resources.EventPolygonStrokeOpacity,strokeWeight:resources.EventPolygonStrokeWeight,fillColor:resources.EventPolygonFillColor,fillOpacity:resources.EventPolygonFillOpacity},e);return e}},a.getPolygonBounds=function(e){var t,o=new google.maps.LatLngBounds;for(t of e){var n=t.getPaths();for(let e=0;e<n.getLength();e++){var r=n.getAt(e);for(let e=0;e<r.getLength();e++){var s=r.getAt(e);o.extend(s)}}}return o},a.fitMapToRoute=function(e,t){MapComp.fitMapToBound(e,t)},MapFctns.instance=a};
function getMobileOs(){var n=navigator.userAgent||navigator.vendor||window.opera;return/windows phone/i.test(n)?"Windows Phone":/android/i.test(n)?"Android":["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document?"iOS":"unknown"}
var noPanOffEarth=function(g){var o=new google.maps.LatLngBounds(new google.maps.LatLng(-75.05113,-180),new google.maps.LatLng(75.05113,180));google.maps.event.addListener(g,"center_changed",function(){var n,a,e,t;t=g.getCenter(),t=new google.maps.LatLng(t.lat(),t.lng(),!1),o.contains(t)||(n=t.lng(),t=t.lat(),(a=o.getNorthEast().lat())<(t=t<(e=o.getSouthWest().lat())?e:t)&&(t=a),g.panTo(new google.maps.LatLng(t,n)))})};
var PolylineManager=function(u,y){var e={},d=[],c=new MapFctns,g=(e.AddPolylineLayer=function(e,n,r,a,i,o,l,t,f,s){if(-1!=g(e))throw"layerid is already active.";e=new PolylineLayer(e,n,r,a,i,o,l,t,f,s,y);d.push(e),e.MapChanged(u,c)},e.GetPolylines=function(e){for(var n=0;n<d.length;n++)if(d[n].layerId==e)return d[n].layerPolyLines()},e.RemovePolylineLayer=function(e){e=g(e);-1!=e&&(d[e].Delete(),d.splice(e,1))},e.RefreshLayers=function(e){var n=0,r=0;if(d.length)for(var a in $(document).on("layerRefreshed-polylineManager.internal",function(){++r==n&&($(document).trigger("layersRefreshed-polylineManager"),$(document).unbind("layerRefreshed-polylineManager.internal"))}),n=d.length,d)d[a].RefreshLayer(u,c,e);else $(document).trigger("layersRefreshed-polylineManager")},e.RefreshLayer=function(e,n){for(var r in d){r=d[r];if(r.layerId==e)return void r.RefreshLayer(u,c,n)}},e.MapChanged=function(){if(MapComp.isGoogle)for(var e in d)d[e].MapChanged(u,c);$(document).trigger("mapChangedFinished-polylineManager")},function(e){for(var n in d)if(d[n].layerId===e)return n;return-1});return e},PolylineLayer=function(o,l,t,f,s,u,y,n,i,e,d){var c={},g=!1,p=null;function h(e){for(var n in oldPolylines=p,p=[],l){var r,a={strokeColor:l[n].lineColor,strokeOpacity:null==l[n].icons?t:0,strokeWeight:f,zIndex:s,map:null,path:l[n].decodedPoints,icons:l[n].icons},i=new google.maps.Polyline(a);for(r in e&&google.maps.event.addListener(i,"click",function(n){return e=>{d(o,n,null,e.latLng,20)}}(l[n].id)),i.canDraw=!0,oldPolylines)l[n].id==oldPolylines[r].sourceData.id&&(i.canDraw=oldPolylines[r].gMapLine.canDraw);p.push({gMapLine:i,sourceData:l[n]})}$(document).trigger("polylineLayer-polylinesBuilt",[o,p])}c.layerId=o,h(),c.layerPolyLines=function(){return p},c.RefreshLayer=function(r,a,e){n(function(e,n){g||(l=e,M(),h(n),c.MapChanged(r,a)),$(document).trigger("layerRefreshed-polylineManager",[o])},i,e)},c.MapChanged=function(e,n){if(!MapComp.isLibre){var r=e.getZoom();if(y<r||r<u)for(var a in p)p[a].gMapLine.setMap(null);else{var i=n.GetMapBoundsObject(e);for(a in p){var o,l=p[a].gMapLine,t=!1,f=l.getPath().getArray();for(o in f){var s=f[o];if(n.CoordinateIsContained(s.lat(),s.lng(),i)){t=!0;break}}l.setMap(t&&l.canDraw?e:null)}}}},c.Delete=function(){g=!0,M()};var M=function(){for(var e in p)p[e].gMapLine.setMap(null)};return c};
var cctvIntervalIds=[],cctvPictures=[],activeSliders=[],cctvRefreshInterval=2e3;$(function(){function r(){for(var e=0;e<cctvIntervalIds.length;e++)clearInterval(cctvIntervalIds[e]);if(cctvIntervalIds=[],document.getElementById("map-canvas")){for(e=0;e<activeSliders.length;e++)void 0!==activeSliders[e]&&activeSliders[e].slick("unslick");activeSliders=[]}}$(document).on("cameraImagesInitialized",function(e,t){r(),$(".carouselCctvImage").each(function(e){activeSliders.push(setupSlickCarousel($(this)))}),$(".cctvImage").one("load",function(){var e=$(this).prev(),e=(e.hasClass("agencyLogo")&&e.show(),$("button.showVideo")),t=0<$(".camTooltip").length||0<$(".myCamTooltip").length;e&&0<e.length&&"True"==resources.StartVideoOnDisplay&&t&&e[0].click()}).each(function(){this.complete&&$(this).trigger("load")}),$(".cctvCameraCarousel").hasClass("setVisibility")&&$(".cctvCameraCarousel").removeClass("setVisibility");var a={},s=[];$(".cctvImage").each(function(){var e=$(this).attr("data-refresh-rate");e&&!a[e]&&0<e&&(s.push(e),a[e]=!0)});for(var c=0;c<s.length;c++)cctvIntervalIds.push(setInterval(function(e){$('.cctvImage[data-refresh-rate="'+e+'"]').each(function(){0!=$(this).parents(".slick-slide").length&&!$(this).parents(".slick-slide").hasClass("slick-active")||null==$(this).attr("src")||$(this).attr("src",URI($(this).attr("src")).search("t="+roundDateToDuration(moment().startOf("second"),moment.duration(parseInt(e)),"floor").unix())),0<$(this).parents(".slick-slide").length&&!$(this).parents(".slick-slide").hasClass("slick-active")&&$(this).attr("data-needsrefresh","true")})},s[c],s[c]));{let e=document.querySelector(".map-tooltip");(e=(e=(e=(e=e||document.querySelector("#cctvTable tbody"))||document.querySelector("#myCctvTable tbody"))||document.querySelector("#eventTable tbody"))||document.querySelector(".list-page tbody"))&&$(document).trigger("setup-fullscreen-img-modal",[e,t])}}),$(document).on("cameraImagesClearIntervals",function(){r()})});
var TileManager=function(s,y){var e,t,i={},a=((new Date).getTime(),null),m={},g=null,h=null,n=(i.AddTileLayer=function(a,r){if(MapComp.isLibre)MapComp.AddTileLayer({layerId:a,...r});else{if(0<p(a).length)throw"layerid is already active.";var e,n=new TileLayer(a,r.urlFormat,r.tooltipUrlFormat,r.animationFrames,r.cache),t=new TileOverlayMapType({name:a,getTileUrl:function(e,t,i,a){var n=s.getZoom();return n>r.maxZoom||n<r.minZoom?null:e.getTileUrl(t.x,t.y,i,a)},tileSize:new google.maps.Size(256,256),isPng:!0,opacity:r.opacity,startingFrame:r.startingFrame,startPlaying:r.startPlaying},n,r.animationFrames);if(r.tooltipUrlFormat&&(e=google.maps.event.addListener(s,"click",function(e){var t,i;e.domEvent&&y.centerTooltip.clickInsideTooltip(e.domEvent.x,e.domEvent.y)||(t=e.latLng.lat(),i=e.latLng.lng(),(e=s.getZoom())<=r.maxZoom&&e>=r.minZoom&&$.ajax(n.getTooltipUrl(t,i,e)).done(function(e){y.showInfoWindow(e,null,!0,new google.maps.LatLng(t,i),a,!0,!0),y.centerTooltip.run()}))}),m[a]=e),""!=r.highwayFill||""!=r.highwayStroke){var i=s.get("styles")||[],l=!1,o=!1;if(0!=i.length)for(style in i)if("road.highway"==i[style].featureType&&"geometry.fill"==i[style].elementType){for(styler in i[style].stylers)void 0!==i[style].stylers[styler].color&&(g=i[style].stylers[styler].color,i[style].stylers[styler].color=r.highwayFill,l=!0);l||(i[style].stylers.push({color:r.highwayFill}),l=!0)}else if("road.highway"==i[style].featureType&&"geometry.stroke"==i[style].elementType){for(styler in i[style].stylers)void 0!==i[style].stylers[styler].color&&(h=i[style].stylers[styler].color,i[style].stylers[styler].color=r.highwayStroke,o=!0);o||(tyles[style].stylers.push({color:r.highwayStroke}),o=!0)}l||i.push({featureType:"road.highway",elementType:"geometry.fill",stylers:[{color:r.highwayFill}]}),o||i.push({featureType:"road.highway",elementType:"geometry.stroke",stylers:[{color:r.highwayStroke}]}),s.setOptions({styles:i})}0<=r.zlevel?s.overlayMapTypes.insertAt(0,t):s.overlayMapTypes.push(t)}},i.RemoveTileLayer=function(e){if(MapComp.isLibre)MapComp.RemoveTileLayer({layerId:e});else{var t=p(e);if(0<=t.length)for(var i=0;i<t.length;i++)s.overlayMapTypes.getArray()[t[0]].clearAnimationTimer(),s.overlayMapTypes.removeAt(t[0]);var a=s.get("styles");for(style in a)if("road.highway"==a[style].featureType&&"geometry.fill"==a[style].elementType)for(styler in a[style].stylers)a[style].stylers[styler].color&&(a[style].stylers[styler].color=g);else if("road.highway"==a[style].featureType&&"geometry.stroke"==a[style].elementType)for(styler in a[style].stylers)a[style].stylers[styler].color&&(a[style].stylers[styler].color=h);s.setOptions({styles:a}),m[e]&&(google.maps.event.removeListener(m[e]),m[e]=null)}},i.RefreshLayers=function(){e=(new Date).getTime(),(null==a||a<e)&&n()},function(){if(MapComp.isLibre)MapComp.refreshTiles();else for(var e=s.overlayMapTypes.getArray(),t=0;t<e.length;t++){var i=e[t];i.isTileOverlayMapType&&null===i.animationTimer&&i.refreshTiles(!1)}}),p=function(e){for(var t=s.overlayMapTypes.getArray(),i=[],a=0;a<t.length;a++)t[a].name==e&&t[a].isTileOverlayMapType&&i.push(a);return i};return MapComp.isLibre||(t=function(){a=(new Date).getTime()},google.maps.event.addListener(s,"bounds_changed",t),google.maps.event.addListener(s,"zoom_changed",t)),i},TileLayer=function(e,t,i,a,n){var r={},l=t,o=i,s=a;return r.layerId=e,r.getTileUrl=function(e,t,i,a){e=URI.expand(l,{x:e,y:t,z:i});return 0<s?e.addSearch("frame",a):n?e.addSearch("t",moment().startOf("minute").unix()):e.addSearch("tmTime",moment().unix()),e.toString()},r.getTooltipUrl=function(e,t,i){return URI.expand(o,{lat:e,lng:t,z:i}).toString()},r},TileOverlayMapType=function(e,t,i){var o={};if(this.isTileOverlayMapType=!0,this.name=e.name,this.getTileUrl=e.getTileUrl,this.tileSize=e.tileSize,this.isPng=e.isPng,this.tileLayer=t,this.animationCounter=e.startingFrame,this.animationFrames=i,this.opacity=e.opacity,this.startPlaying=e.startPlaying,this.animationTimer=null,this.isAnimating=!1,this.getTile=function(e,t,i){var a,n=this.getTileUrl(this.tileLayer,e,t,this.animationCounter),r="x_"+e.x+"_y_"+e.y+"_zoom_"+t,l=i.createElement("div");return l.style.backgroundPosition="center center",l.style.backgroundRepeat="no-repeat",l.style.height=this.tileSize.height+"px",l.style.width=this.tileSize.width+"px",l.style.opacity=this.opacity,l.tileId=r,l.coord=e,l.zoom=t,l.timestamp=new Date,o[r]=l,n&&((a=new Image).onload=function(){l.style.backgroundImage="url("+n+")",a.onload=null,a=null},a.src=n,0<this.animationFrames)&&(l.img=a),l},this.refreshTiles=function(e){if(0!=e&&0<this.animationFrames){var t=!0;for(const[r,n]of Object.entries(o))if(void 0===n.img||!n.img.complete){t=!1;break}if(this.isAnimating||!t)return;this.animationCounter=(this.animationCounter+1)%this.animationFrames,this.isAnimating=!0}for(var i in o){var a,n=o[i],i=this.getTileUrl(this.tileLayer,n.coord,n.zoom,this.animationCounter);i&&((a=new Image).onload=function(e,t,i){return function(){t.style.backgroundImage="url("+i+")",e.onload=null,e=null}}(a,n,i),a.src=i,0<this.animationFrames)&&(n.img=a)}this.isAnimating=!1},this.getOpacity=function(){return this.opacity},this.releaseTile=function(e){o[e.tileId]&&e.timestamp==o[e.tileId].timestamp&&delete o[e.tileId]},this.clearAnimationTimer=function(){null!=this.animationTimer&&(window.clearInterval(this.animationTimer),this.animationTimer=null,$(document).off("animation-toggle-"+this.name))},0<this.animationFrames){var a=this;const n=parseInt(window.resources.WeatherRadarFramesAnimation);this.startPlaying?a.animationTimer=window.setInterval(function(){a.refreshTiles(),$(document).trigger("animation-update-"+a.name,[a.animationCounter])},n):$(document).trigger("timerbox-update-"+a.name,[a.animationCounter]),$(document).on("animation-toggle-"+a.name,function(e,t){"pause"==t&&a.animationTimer?(window.clearInterval(a.animationTimer),a.animationTimer=null):"play"==t&&(a.animationTimer=window.setInterval(function(){a.refreshTiles(),$(document).trigger("animation-update-"+a.name,[a.animationCounter])},n))})}};
"use strict";class UrlHash{constructor(){this.hashEvent="hashchange.urlHash",this.hashChangeHandler=()=>{$(document).trigger("hashChanged-urlHash",[this.hash()])},this.whileWeSetHashHandler=()=>{$(window).off(this.hashEvent),$(window).on(this.hashEvent,this.hashChangeHandler)},this.setWhileWeSetHashHandler=()=>{$(window).off(this.hashEvent),$(window).on(this.hashEvent,this.whileWeSetHashHandler)},this.clearHash=()=>{this.setWhileWeSetHashHandler(),window.location.hash="route"},this.hash=(h,s)=>{var a=window.location.hash.substr(1);return h&&a!=h&&(this.setWhileWeSetHashHandler(),s?window.location.replace(h):window.location.hash=h),a},$._data(window,"events").hashchange||$(window).on(this.hashEvent,this.hashChangeHandler)}}let urlHash=new UrlHash;
let UserGeolocation=function(n,i,o,a,l){function t(t){navigator&&navigator.geolocation&&navigator.geolocation.getCurrentPosition?navigator.geolocation.getCurrentPosition(function(o){o=MapComp.latLng(o.coords.latitude,o.coords.longitude);t(o)}):t(null)}let c={};return c.AttemptToSetLocationWithUsersGeolocation=function(e,o){c.GetUserGeolocation(function(o){var t;o&&(MapComp.isGoogle?(t=n.GetCustomSimplePlace("",null,o.lat(),o.lng(),!1),i.SetLocationByGeo(e,t),a.panTo(o)):(t=n.GetCustomSimplePlace("",null,o[1],o[0],!1),i.SetLocationByGeo(e,t),MapComp.clearLocationMarker(),MapComp.methods.zoom.flyTo(17,o,3)))})},c.AttemptToSetWaypointWithUsersGeolocation=function(e){c.GetUserGeolocation(function(o){var t;o&&(MapComp.isGoogle?(t=n.GetCustomSimplePlace("",null,o.lat(),o.lng(),!1),i.SetLocationByGeo(null,t,!0,e),a.panTo(o)):(t=n.GetCustomSimplePlace("",null,o[1],o[0],!1),i.SetLocationByGeo(null,t,!0,e),MapComp.methods.zoom.flyTo(17,o,3)))})},window.SetUserRegion=function(o,t){var e;o&&(e=[o[0],o[1]],l.center(e,parseInt(o[2]),t))},window.GetUserGeolocation=function(o){t(o)},c.GetUserGeolocation=function(o){t(o)},c};
//dependent on URI.js.

var VectorTileManager = function (map, appHelper) {
    let publicItem = {};

    //For restorying styling
    //var oldFill = null;
    //var oldStroke = null;

    publicItem.AddTileLayer = function (layerId, tileConfig) {

        //make sure layer doesnt exist already.
        if (MapComp.getIndexOfLayerId(layerId).length > 0) {
            throw 'layerid is already active.';
        }
        var styles = window.vectorStyles[layerId];
        var clickHandler = null;
        if (tileConfig.tooltipUrlFormat) {
            clickHandler = (layerId, feature, lat, lng, markerLocation) => {
                let uri = URI.expand(tileConfig.tooltipUrlFormat, { id: feature.wtaId }).toString();

                MapComp.vectorTileClick({
                    uri,
                    content,
                    lat, lng,
                    layerId, appHelper,
                    markerLocation,
                    feature
                });

            };
        }
        MapComp.AddVectorLayer(
            layerId,
            tileConfig.urlFormat,
            styles,
            window.zoomWidths,
            tileConfig.zlevel,
            parseInt(tileConfig.maxZoom),
            clickHandler,
            tileConfig.showHighlights
        );
    };

    publicItem.RemoveTileLayer = function (layerId) {
        MapComp.RemoveVectorTileLayer(layerId);
    };

    //causes all tile layers to refresh.
    publicItem.RefreshLayers = function () {
        MapComp.forceVectorTilesRefresh();
    };

    var init = function () {
    };

    init();

    return publicItem;
};
let WaypointManager=function(u,e,o,d){let g={},m=[{selector:"#startLocationText"},{selector:"#endLocationText"}];async function a(t,e,n,o){function a(){n?g.setWaypoint(e,o,!0):g.setLocation(t,e,!0)}e?.name?a():await MapComp.updateSimplePlace(e,t=>{e=t,a()})}function l(a,t){let n=0==a,r=a==m.length-1,i=g;var e=m[a].marker,l=r?"B":"W",l=n?"A":l,[c,o]=MapComp.latLngVals(t),c=f(((new Date).getTime()+1e9*(c+o)).toString());let s,p={width:25,height:35};if(n?s="/Content/Images/Green-A.png":r?(s="/Content/Images/Red-B-New.png",$(document).trigger("hideLocationMarker")):(s=MapComp.isLibre?"/Content/Images/waypoint.png":{path:google.maps.SymbolPath.CIRCLE,scale:4,fillColor:"#ffffff",fillOpacity:1},p={width:15,height:15,imageFit:"contain"}),e)MapComp.methods.routeMarkers.update({map:u,marker:e,latLng:t,iconUrl:s});else{let o=MapComp.methods.routeMarkers.create({map:MapComp.map,hash:c,index:a,zIndex:-98,draggable:!0,id:c,icon:s,position:t,letter:l,isWaypoint:!(n||r),title:n||r?"":resources.ClickToRemove,dragEnd:n||r?async t=>{g.clearLoationsWithoutPoints();var[t,e]=MapComp.latLngVals(t.latLng),t={point:{latitude:t,longitude:e}};await i.getNameForSimplePlace(t,function(t){var e=m[n?0:m.length-1].marker!==o;g.setLocation(e?r:n,t,!0),CTVars.markerDragEnded=!0,m[0].point&&m[m.length-1].point&&"True"!==resources.AutoGenerateDriveRoute&&(0<$("#transitRouteResults").children().length&&0<$("#routeTabContent").children().length||0<$("#transitRouteResults").children().length?d.calculateRoute():"True"!==resources.AutoGenerateDriveRoute&&d.calculateRoute("drive"))}),MapComp.isLibre&&(MapComp.data.routeMarkers.clickedRouteMarker=!1)}:async t=>{loadBlockerApi.showSpinner("getNearestLocations"),g.clearLoationsWithoutPoints();let e=a;for(let t=1;t<m.length;++t)if(m[t].marker===o){e=t;break}var[t,n]=MapComp.latLngVals(t.latLng),t={point:{latitude:t,longitude:n}};await i.getNameForSimplePlace(t,function(t){h(e,t,!0),d.calculateRoute(),loadBlockerApi.hideSpinner("getNearestLocations")}),MapComp.isLibre&&(MapComp.data.routeMarkers.clickedRouteMarker=!1)},clickWaypoint:n||r?void 0:function(){g.ClearWaypoint(a,o,!0),d.redrawWaypoints(!1)},...p});m[a].marker=o,m[a].hash=c}}function t(t){t.hash=null,t.marker=null,t.poiId=null,t.point=null,t.simplePlace=null,t.text=null}g.setMarker=l,g.getNameForSimplePlace=async function(t,e){await MapComp.updateSimplePlace(t,e)};let h=function(t,e,n){var o=0===t,a=t===m.length-1,r=0===(r=t)?"A":r===m.length-1?"B":"W",o=(e.letter=r,e.point&&l(t,MapComp.latLng(e.point.latitude,e.point.longitude)),n&&(r=a,n=t,a=e,$(o?"#startLocationText":r?"#endLocationText":"#waypointText-"+n).val(a.nameDirection||a.name)),m[t].point=e,0<$("body.mobileFirst").length);Modernizr.mq("(max-width: 992px)")&&o&&m[0].point&&m[m.length-1].point&&$(".mobileLocationBar .directions").trigger("click")},f=function(e){let n=0;for(let t=0;t<e.length;t++)n=~~((n<<5)-n+e.charCodeAt(t));return n};g.ClearWaypoint=function(t,e,n){if("lookupGMarker"===e&&(e=m[t].marker),g.getLocationsTextFromUI(),!(0===t||t===m.length-1)||e&&null!==e.hash){t=function(t,e){if(e&&null!==e.hash)for(let t=0;t<m.length;t++)if(m[t].hash===e.hash)return t;return t}(t,e);if(null!==t){m.splice(t,1),g.updateTransitBtnState(),d.redrawWaypoints();for(let t=1;t<m.length-1;t++)m[t].selector="#waypointText-"+t;e&&(MapComp.methods.routeMarkers.clear({marker:e}),n)&&d.calculateRoute()}}},g.updateTransitBtnState=function(){m.length<3?($("#generateTransitRouteBtn").prop("disabled",!1),$("#generateDriveTransitRouteBtn").prop("disabled",!1),$("#generateWalkOnlyRouteBtn").prop("disabled",!1),$("#generateBicycleOnlyRouteBtn").prop("disabled",!1)):($("#generateTransitRouteBtn").prop("disabled",!0),$("#generateDriveTransitRouteBtn").prop("disabled",!0),$("#generateWalkOnlyRouteBtn").prop("disabled",!0),$("#generateBicycleOnlyRouteBtn").prop("disabled",!0))};return g.clearAll=function(){g.clearMarkers(),m=[m[0],m[m.length-1]],t(m[0]),t(m[1]),$("#startLocationText").val(""),$("#endLocationText").val(""),$("#waypoints").html(""),o.AddWaypointToContextMenu(!1),g.updateTransitBtnState()},g.clearMarkers=function(){MapComp.methods.routeMarkers.removeAll(m)},g.removeWaypoints=function(){g.clearMarkers(),m=[m[0],m[m.length-1]],g.updateTransitBtnState()},g.getLocationArray=function(){g.getLocationsTextFromUI();var t=m.map(t=>e.GetLocationDetails(t));return Promise.all(t).then(t=>t)},g.setLocation=function(t,e,n){h(t?0:m.length-1,e,n),m[0].point&&m[m.length-1].point?(o.AddWaypointToContextMenu(!0),"True"===resources.AutoGenerateDriveRoute&&d.calculateRoute()):o.AddWaypointToContextMenu(!1),$(document).trigger("removeMyLocationMarker")},g.setWaypoint=function(t,e,n,o,a){var r,i;g.updateTransitBtnState(),r=t,i=e,n=n,o=o,MapComp.isGoogle&&(r.letter="W"),o?(m[i].marker&&MapComp.methods.routeMarkers.clear(m[i]),m[i]={point:r,text:r.name,selector:"#waypointText-"+i}):g.addWaypoint(i,r),n&&$("#waypointText-"+i).val(r.nameDirection||r.name),"True"!==resources.AutoGenerateDriveRoute||a||d.calculateRoute(),t.point&&l(e,MapComp.latLng(t.point.latitude,t.point.longitude))},g.SetLocationByGeo=a,g.setDetails=function(){for(let t=0;t<m.length;++t)m[t].point&&h(t,m[t].point,!0)},g.setStartEndPoint=function(t,e){g.clearAll(),h(0,t,!0),h(m.length-1,e,!0)},g.setAllLocations=function(e){g.setStartEndPoint(e[0],e[e.length-1]);for(let t=1;t<e.length-1;++t)g.setWaypoint(e[t],t,null,null,!0);for(let t=0;t<e.length;++t)m[t].text||(m[t].text=e[t].nameDirection||e[t].name)},g.swapStartEnd=function(){m.reverse(),g.resetSelectors()},g.resetSelectors=function(){m[0].selector="#startLocationText";for(let t=1;t<m.length;t++)m[t].selector="#waypointText-"+t;m[m.length-1].selector="#endLocationText"},g.getLocations=function(){return m},g.adjustMarker=function(t,e,n){e=MapComp.latLng(e,n);l(t,e)},g.addWaypoint=function(t,e){var n={selector:"#waypointText-"+t};e&&(n.point=e,n.text=e.name),m.splice(t,0,n),g.updateTransitBtnState(),g.resetSelectors()},g.getLocationsTextFromUI=function(){m.forEach(t=>{var e=$(t.selector).val();t.text=null!=e?e:t.text})},g.clearLoationsWithoutPoints=function(){var e=[m[0]];for(let t=1;t<m.length-1;t++)m[t].point&&e.push(m[t]);e.push(m[m.length-1]),m=e,g.resetSelectors()},$(document).on("locationSelected-contextMenu",function(t,e,n){var o;"waypoint"==e?(o=m.length-1,d.AddWaypointToPlanner("",!0),a(null,n,!0,o)):a(0==e.indexOf("from"),n)}),$(document).on("locationSelected-autocomplete",function(t,e){var n=m.findIndex(t=>t.selector===e.selector);n<0||(e.selector.startsWith("#waypoint")?(existingWaypoint=!!m[n]?.hash,g.setWaypoint(e.point,n,existingWaypoint,!0)):g.setLocation(0===n,e.point,!0))}),g};
class CitizenReporter{constructor(){this.addReport=(t,o)=>{$.ajax("/wta/wtaoptions",{data:{id:t,modalType:"CitizenReport"}}).done(function(e){e=bootbox.dialog({title:o,message:e,closeButton:!1,className:"wtaContentModel crStatus",buttons:{save:{label:resources.Save,className:"btn-primary bootboxSave",callback:function(){var e=[];$(".wtaOptionsParent select",this).each(function(){$.each($.makeArray($(this).val()),function(){e.push({Id:this})})}),$.ajax("/wta/addCitizenReport",{type:"POST",data:{data:{id:t,statuses:e}}}).done(function(e){bootbox.alert(resources.CitizenReporterReportSubmited,null)}).fail(function(){bootbox.alert(resources.CitizenReporterReportFailed,null)})}},cancel:{label:resources.Cancel,className:"btn-primary"}}});$(".selectpicker",e).selectpicker({noneSelectedText:resources.NoneSelected,selectedTextFormat:"count > 3"})}).fail(function(){bootbox.alert(resources.ErrorLoadingWtaContent,null)})}}}let citizenReporter=new CitizenReporter;
!function(r){var d;r.fn.printThis=function(e){d=r.extend({},r.fn.printThis.defaults,e);var t,n,i=this instanceof jQuery?this:r(this),e="printThis-"+(new Date).getTime(),a=(window.location.hostname!==document.domain&&navigator.userAgent.match(/msie/i)?(t='javascript:document.write("<head><script>document.domain=\\"'+document.domain+'\\";<\/script></head><body></body>")',(n=document.createElement("iframe")).name="printIframe",n.id=e,n.className="MSIE",document.body.appendChild(n),n.src=t):r("<iframe id='"+e+"' name='printIframe' />").appendTo("body"),r("#"+e));d.debug||a.css({position:"absolute",width:"0px",height:"0px",left:"-600px",top:"-600px"}),setTimeout(function(){var e,o=a.contents(),n=o.find("head"),t=o.find("body");n.append('<base href="'+document.location.protocol+"//"+document.location.host+'">'),d.importCSS&&r("link[rel=stylesheet]").each(function(){var e,t=r(this).attr("href");t&&(e=r(this).attr("media")||"all",n.append("<link type='text/css' rel='stylesheet' href='"+t+"' media='"+e+"'>"))}),d.importStyle&&r("style").each(function(){r(this).clone().appendTo(n)}),d.pageTitle&&n.append("<title>"+d.pageTitle+"</title>"),d.loadCSS&&(r.isArray(d.loadCSS)?jQuery.each(d.loadCSS,function(e,t){n.append("<link type='text/css' rel='stylesheet' href='"+this+"'>")}):n.append("<link type='text/css' rel='stylesheet' href='"+d.loadCSS+"'>")),d.header&&t.append(d.header),d.printContainer?t.append(i.outer()):i.each(function(){t.append(r(this).html())}),d.formValues&&((e=i.find("input")).length&&e.each(function(){var e=r(this),t=r(this).attr("name"),n=e.is(":checkbox")||e.is(":radio"),i=o.find('input[name="'+t+'"]'),a=e.val();n?e.is(":checked")&&(e.is(":checkbox")?i.attr("checked","checked"):e.is(":radio")&&o.find('input[name="'+t+'"][value='+a+"]").attr("checked","checked")):i.val(a)}),(e=i.find("select")).length&&e.each(function(){var e=r(this),t=r(this).attr("name"),e=e.val();o.find('select[name="'+t+'"]').val(e)}),(e=i.find("textarea")).length)&&e.each(function(){var e=r(this),t=r(this).attr("name"),e=e.val();o.find('textarea[name="'+t+'"]').val(e)}),d.removeInline&&(r.isFunction(r.removeAttr)?o.find("body *").removeAttr("style"):o.find("body *").attr("style","")),setTimeout(function(){a.hasClass("MSIE")?(window.frames.printIframe.focus(),n.append("<script>  window.print(); <\/script>")):(a[0].contentWindow.focus(),a[0].contentWindow.print()),d.debug||setTimeout(function(){a.remove()},1e3)},d.printDelay)},333)},r.fn.printThis.defaults={debug:!1,importCSS:!0,importStyle:!1,printContainer:!0,loadCSS:"",pageTitle:"",removeInline:!1,printDelay:333,header:null,formValues:!0},jQuery.fn.outer=function(){return r(r("<div></div>").html(this.clone())).html()}}(jQuery);
!function(i){"function"==typeof define&&define.amd?define(["jquery"],i):"undefined"!=typeof exports?module.exports=i(require("jquery")):i(jQuery)}(function(i){var t,s=window.Slick||{};(s=(t=0,function s(e,o){var n,l=this;l.defaults={accessibility:!0,adaptiveHeight:!1,appendArrows:i(e),appendDots:i(e),arrows:!0,asNavFor:null,prevArrow:'<button class="slick-prev" type="button">Previous</button>',nextArrow:'<button class="slick-next" type="button">Next</button>',autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",customPaging:function(t,s){return i('<button type="button" />').text(s+1)},dots:!1,dotsClass:"slick-dots",draggable:!0,easing:"linear",edgeFriction:.35,fade:!1,focusOnSelect:!1,focusOnChange:!1,infinite:!0,initialSlide:0,lazyLoad:"ondemand",mobileFirst:!1,pauseOnHover:!0,pauseOnFocus:!0,pauseOnDotsHover:!1,respondTo:"window",responsive:null,rows:1,rtl:!1,slide:"",slidesPerRow:1,slidesToShow:1,slidesToScroll:1,speed:500,swipe:!0,swipeToSlide:!1,touchMove:!0,touchThreshold:5,useCSS:!0,useTransform:!0,variableWidth:!1,vertical:!1,verticalSwiping:!1,waitForAnimate:!0,zIndex:1e3},l.initials={animating:!1,dragging:!1,autoPlayTimer:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,$dots:null,listWidth:null,listHeight:null,loadIndex:0,$nextArrow:null,$prevArrow:null,scrolling:!1,slideCount:null,slideWidth:null,$slideTrack:null,$slides:null,sliding:!1,slideOffset:0,swipeLeft:null,swiping:!1,$list:null,touchObject:{},transformsEnabled:!1,unslicked:!1},i.extend(l,l.initials),l.activeBreakpoint=null,l.animType=null,l.animProp=null,l.breakpoints=[],l.breakpointSettings=[],l.cssTransitions=!1,l.focussed=!1,l.interrupted=!1,l.hidden="hidden",l.paused=!0,l.positionProp=null,l.respondTo=null,l.rowCount=1,l.shouldClick=!0,l.$slider=i(e),l.$slidesCache=null,l.transformType=null,l.transitionType=null,l.visibilityChange="visibilitychange",l.windowWidth=0,l.windowTimer=null,n=i(e).data("slick")||{},l.options=i.extend({},l.defaults,o,n),l.currentSlide=l.options.initialSlide,l.originalSettings=l.options,void 0!==document.mozHidden?(l.hidden="mozHidden",l.visibilityChange="mozvisibilitychange"):void 0!==document.webkitHidden&&(l.hidden="webkitHidden",l.visibilityChange="webkitvisibilitychange"),l.autoPlay=i.proxy(l.autoPlay,l),l.autoPlayClear=i.proxy(l.autoPlayClear,l),l.autoPlayIterator=i.proxy(l.autoPlayIterator,l),l.changeSlide=i.proxy(l.changeSlide,l),l.clickHandler=i.proxy(l.clickHandler,l),l.selectHandler=i.proxy(l.selectHandler,l),l.setPosition=i.proxy(l.setPosition,l),l.swipeHandler=i.proxy(l.swipeHandler,l),l.dragHandler=i.proxy(l.dragHandler,l),l.keyHandler=i.proxy(l.keyHandler,l),l.instanceUid=t++,l.htmlExpr=/^(?:\s*(<[\w\W]+>)[^>]*)$/,l.registerBreakpoints(),l.init(!0)})).prototype.activateADA=function(){this.$slideTrack.find(".slick-active").attr({"aria-hidden":"false"}).find("a, input, button, select").attr({tabindex:"0"})},s.prototype.addSlide=s.prototype.slickAdd=function(t,s,e){var o=this;if("boolean"==typeof s)e=s,s=null;else if(s<0||s>=o.slideCount)return!1;o.unload(),"number"==typeof s?0===s&&0===o.$slides.length?i(t).appendTo(o.$slideTrack):e?i(t).insertBefore(o.$slides.eq(s)):i(t).insertAfter(o.$slides.eq(s)):!0===e?i(t).prependTo(o.$slideTrack):i(t).appendTo(o.$slideTrack),o.$slides=o.$slideTrack.children(this.options.slide),o.$slideTrack.children(this.options.slide).detach(),o.$slideTrack.append(o.$slides),o.$slides.each(function(t,s){i(s).attr("data-slick-index",t)}),o.$slidesCache=o.$slides,o.reinit()},s.prototype.animateHeight=function(){if(1===this.options.slidesToShow&&!0===this.options.adaptiveHeight&&!1===this.options.vertical){var i=this.$slides.eq(this.currentSlide).outerHeight(!0);this.$list.animate({height:i},this.options.speed)}},s.prototype.animateSlide=function(t,s){var e={},o=this;o.animateHeight(),!0===o.options.rtl&&!1===o.options.vertical&&(t=-t),!1===o.transformsEnabled?!1===o.options.vertical?o.$slideTrack.animate({left:t},o.options.speed,o.options.easing,s):o.$slideTrack.animate({top:t},o.options.speed,o.options.easing,s):!1===o.cssTransitions?(!0===o.options.rtl&&(o.currentLeft=-o.currentLeft),i({animStart:o.currentLeft}).animate({animStart:t},{duration:o.options.speed,easing:o.options.easing,step:function(i){i=Math.ceil(i),!1===o.options.vertical?(e[o.animType]="translate("+i+"px, 0px)",o.$slideTrack.css(e)):(e[o.animType]="translate(0px,"+i+"px)",o.$slideTrack.css(e))},complete:function(){s&&s.call()}})):(o.applyTransition(),t=Math.ceil(t),!1===o.options.vertical?e[o.animType]="translate3d("+t+"px, 0px, 0px)":e[o.animType]="translate3d(0px,"+t+"px, 0px)",o.$slideTrack.css(e),s&&setTimeout(function(){o.disableTransition(),s.call()},o.options.speed))},s.prototype.getNavTarget=function(){var t=this.options.asNavFor;return t&&null!==t&&(t=i(t).not(this.$slider)),t},s.prototype.asNavFor=function(t){var s=this.getNavTarget();null!==s&&"object"==typeof s&&s.each(function(){var s=i(this).slick("getSlick");s.unslicked||s.slideHandler(t,!0)})},s.prototype.applyTransition=function(i){var t=this,s={};!1===t.options.fade?s[t.transitionType]=t.transformType+" "+t.options.speed+"ms "+t.options.cssEase:s[t.transitionType]="opacity "+t.options.speed+"ms "+t.options.cssEase,!1===t.options.fade?t.$slideTrack.css(s):t.$slides.eq(i).css(s)},s.prototype.autoPlay=function(){var i=this;i.autoPlayClear(),i.slideCount>i.options.slidesToShow&&(i.autoPlayTimer=setInterval(i.autoPlayIterator,i.options.autoplaySpeed))},s.prototype.autoPlayClear=function(){this.autoPlayTimer&&clearInterval(this.autoPlayTimer)},s.prototype.autoPlayIterator=function(){var i=this,t=i.currentSlide+i.options.slidesToScroll;i.paused||i.interrupted||i.focussed||(!1===i.options.infinite&&(1===i.direction&&i.currentSlide+1===i.slideCount-1?i.direction=0:0===i.direction&&(t=i.currentSlide-i.options.slidesToScroll,i.currentSlide-1==0&&(i.direction=1))),i.slideHandler(t))},s.prototype.buildArrows=function(){var t=this;!0===t.options.arrows&&(t.$prevArrow=i(t.options.prevArrow).addClass("slick-arrow"),t.$nextArrow=i(t.options.nextArrow).addClass("slick-arrow"),t.slideCount>t.options.slidesToShow?(t.$prevArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),t.$nextArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),t.htmlExpr.test(t.options.prevArrow)&&t.$prevArrow.prependTo(t.options.appendArrows),t.htmlExpr.test(t.options.nextArrow)&&t.$nextArrow.appendTo(t.options.appendArrows),!0!==t.options.infinite&&t.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true")):t.$prevArrow.add(t.$nextArrow).addClass("slick-hidden").attr({"aria-disabled":"true",tabindex:"-1"}))},s.prototype.buildDots=function(){var t,s,e=this;if(!0===e.options.dots&&e.slideCount>e.options.slidesToShow){for(e.$slider.addClass("slick-dotted"),s=i("<ul />").addClass(e.options.dotsClass),t=0;t<=e.getDotCount();t+=1)s.append(i("<li />").append(e.options.customPaging.call(this,e,t)));e.$dots=s.appendTo(e.options.appendDots),e.$dots.find("li").first().addClass("slick-active")}},s.prototype.buildOut=function(){var t=this;t.$slides=t.$slider.children(t.options.slide+":not(.slick-cloned)").addClass("slick-slide"),t.slideCount=t.$slides.length,t.$slides.each(function(t,s){i(s).attr("data-slick-index",t).data("originalStyling",i(s).attr("style")||"")}),t.$slider.addClass("slick-slider"),t.$slideTrack=0===t.slideCount?i('<div class="slick-track"/>').appendTo(t.$slider):t.$slides.wrapAll('<div class="slick-track"/>').parent(),t.$list=t.$slideTrack.wrap('<div class="slick-list"/>').parent(),t.$slideTrack.css("opacity",0),(!0===t.options.centerMode||!0===t.options.swipeToSlide)&&(t.options.slidesToScroll=1),i("img[data-lazy]",t.$slider).not("[src]").addClass("slick-loading"),t.setupInfinite(),t.buildArrows(),t.buildDots(),t.updateDots(),t.setSlideClasses("number"==typeof t.currentSlide?t.currentSlide:0),!0===t.options.draggable&&t.$list.addClass("draggable")},s.prototype.buildRows=function(){var i,t,s,e,o,n,l;if(e=document.createDocumentFragment(),n=this.$slider.children(),this.options.rows>0){for(i=0,l=this.options.slidesPerRow*this.options.rows,o=Math.ceil(n.length/l);i<o;i++){var r=document.createElement("div");for(t=0;t<this.options.rows;t++){var d=document.createElement("div");for(s=0;s<this.options.slidesPerRow;s++){var a=i*l+(t*this.options.slidesPerRow+s);n.get(a)&&d.appendChild(n.get(a))}r.appendChild(d)}e.appendChild(r)}this.$slider.empty().append(e),this.$slider.children().children().children().css({width:100/this.options.slidesPerRow+"%",display:"inline-block"})}},s.prototype.checkResponsive=function(t,s){var e,o,n,l=this,r=!1,d=l.$slider.width(),a=window.innerWidth||i(window).width();if("window"===l.respondTo?n=a:"slider"===l.respondTo?n=d:"min"===l.respondTo&&(n=Math.min(a,d)),l.options.responsive&&l.options.responsive.length&&null!==l.options.responsive){for(e in o=null,l.breakpoints)l.breakpoints.hasOwnProperty(e)&&(!1===l.originalSettings.mobileFirst?n<l.breakpoints[e]&&(o=l.breakpoints[e]):n>l.breakpoints[e]&&(o=l.breakpoints[e]));null!==o?null!==l.activeBreakpoint?(o!==l.activeBreakpoint||s)&&(l.activeBreakpoint=o,"unslick"===l.breakpointSettings[o]?l.unslick(o):(l.options=i.extend({},l.originalSettings,l.breakpointSettings[o]),!0===t&&(l.currentSlide=l.options.initialSlide),l.refresh(t)),r=o):(l.activeBreakpoint=o,"unslick"===l.breakpointSettings[o]?l.unslick(o):(l.options=i.extend({},l.originalSettings,l.breakpointSettings[o]),!0===t&&(l.currentSlide=l.options.initialSlide),l.refresh(t)),r=o):null!==l.activeBreakpoint&&(l.activeBreakpoint=null,l.options=l.originalSettings,!0===t&&(l.currentSlide=l.options.initialSlide),l.refresh(t),r=o),t||!1===r||l.$slider.trigger("breakpoint",[l,r])}},s.prototype.changeSlide=function(t,s){var e,o,n,l=i(t.currentTarget);switch(l.is("a")&&t.preventDefault(),l.is("li")||(l=l.closest("li")),e=(n=this.slideCount%this.options.slidesToScroll!=0)?0:(this.slideCount-this.currentSlide)%this.options.slidesToScroll,t.data.message){case"previous":o=0===e?this.options.slidesToScroll:this.options.slidesToShow-e,this.slideCount>this.options.slidesToShow&&this.slideHandler(this.currentSlide-o,!1,s);break;case"next":o=0===e?this.options.slidesToScroll:e,this.slideCount>this.options.slidesToShow&&this.slideHandler(this.currentSlide+o,!1,s);break;case"index":var r=0===t.data.index?0:t.data.index||l.index()*this.options.slidesToScroll;this.slideHandler(this.checkNavigable(r),!1,s),l.children().trigger("focus");break;default:return}},s.prototype.checkNavigable=function(i){var t,s;if(t=this.getNavigableIndexes(),s=0,i>t[t.length-1])i=t[t.length-1];else for(var e in t){if(i<t[e]){i=s;break}s=t[e]}return i},s.prototype.cleanUpEvents=function(){this.options.dots&&null!==this.$dots&&(i("li",this.$dots).off("click.slick",this.changeSlide).off("mouseenter.slick",i.proxy(this.interrupt,this,!0)).off("mouseleave.slick",i.proxy(this.interrupt,this,!1)),!0===this.options.accessibility&&this.$dots.off("keydown.slick",this.keyHandler)),this.$slider.off("focus.slick blur.slick"),!0===this.options.arrows&&this.slideCount>this.options.slidesToShow&&(this.$prevArrow&&this.$prevArrow.off("click.slick",this.changeSlide),this.$nextArrow&&this.$nextArrow.off("click.slick",this.changeSlide),!0===this.options.accessibility&&(this.$prevArrow&&this.$prevArrow.off("keydown.slick",this.keyHandler),this.$nextArrow&&this.$nextArrow.off("keydown.slick",this.keyHandler))),this.$list.off("touchstart.slick mousedown.slick",this.swipeHandler),this.$list.off("touchmove.slick mousemove.slick",this.swipeHandler),this.$list.off("touchend.slick mouseup.slick",this.swipeHandler),this.$list.off("touchcancel.slick mouseleave.slick",this.swipeHandler),this.$list.off("click.slick",this.clickHandler),i(document).off(this.visibilityChange,this.visibility),this.cleanUpSlideEvents(),!0===this.options.accessibility&&this.$list.off("keydown.slick",this.keyHandler),!0===this.options.focusOnSelect&&i(this.$slideTrack).children().off("click.slick",this.selectHandler),i(window).off("orientationchange.slick.slick-"+this.instanceUid,this.orientationChange),i(window).off("resize.slick.slick-"+this.instanceUid,this.resize),i("[draggable!=true]",this.$slideTrack).off("dragstart",this.preventDefault),i(window).off("load.slick.slick-"+this.instanceUid,this.setPosition)},s.prototype.cleanUpSlideEvents=function(){this.$list.off("mouseenter.slick",i.proxy(this.interrupt,this,!0)),this.$list.off("mouseleave.slick",i.proxy(this.interrupt,this,!1))},s.prototype.cleanUpRows=function(){var i;this.options.rows>0&&((i=this.$slides.children().children()).removeAttr("style"),this.$slider.empty().append(i))},s.prototype.clickHandler=function(i){!1===this.shouldClick&&(i.stopImmediatePropagation(),i.stopPropagation(),i.preventDefault())},s.prototype.destroy=function(t){var s=this;s.autoPlayClear(),s.touchObject={},s.cleanUpEvents(),i(".slick-cloned",s.$slider).detach(),s.$dots&&s.$dots.remove(),s.$prevArrow&&s.$prevArrow.length&&(s.$prevArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),s.htmlExpr.test(s.options.prevArrow)&&s.$prevArrow.remove()),s.$nextArrow&&s.$nextArrow.length&&(s.$nextArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),s.htmlExpr.test(s.options.nextArrow)&&s.$nextArrow.remove()),s.$slides&&(s.$slides.removeClass("slick-slide slick-active slick-center slick-visible slick-current").removeAttr("aria-hidden").removeAttr("data-slick-index").each(function(){i(this).attr("style",i(this).data("originalStyling"))}),s.$slideTrack.children(this.options.slide).detach(),s.$slideTrack.detach(),s.$list.detach(),s.$slider.append(s.$slides)),s.cleanUpRows(),s.$slider.removeClass("slick-slider"),s.$slider.removeClass("slick-initialized"),s.$slider.removeClass("slick-dotted"),s.unslicked=!0,t||s.$slider.trigger("destroy",[s])},s.prototype.disableTransition=function(i){var t=this,s={};s[t.transitionType]="",!1===t.options.fade?t.$slideTrack.css(s):t.$slides.eq(i).css(s)},s.prototype.fadeSlide=function(i,t){var s=this;!1===s.cssTransitions?(s.$slides.eq(i).css({zIndex:s.options.zIndex}),s.$slides.eq(i).animate({opacity:1},s.options.speed,s.options.easing,t)):(s.applyTransition(i),s.$slides.eq(i).css({opacity:1,zIndex:s.options.zIndex}),t&&setTimeout(function(){s.disableTransition(i),t.call()},s.options.speed))},s.prototype.fadeSlideOut=function(i){!1===this.cssTransitions?this.$slides.eq(i).animate({opacity:0,zIndex:this.options.zIndex-2},this.options.speed,this.options.easing):(this.applyTransition(i),this.$slides.eq(i).css({opacity:0,zIndex:this.options.zIndex-2}))},s.prototype.filterSlides=s.prototype.slickFilter=function(i){var t=this;null!==i&&(t.$slidesCache=t.$slides,t.unload(),t.$slideTrack.children(this.options.slide).detach(),t.$slidesCache.filter(i).appendTo(t.$slideTrack),t.reinit())},s.prototype.focusHandler=function(){var t=this;t.$slider.off("focus.slick blur.slick").on("focus.slick","*",function(s){var e=i(this);setTimeout(function(){t.options.pauseOnFocus&&e.is(":focus")&&(t.focussed=!0,t.autoPlay())},0)}).on("blur.slick","*",function(s){i(this),t.options.pauseOnFocus&&(t.focussed=!1,t.autoPlay())})},s.prototype.getCurrent=s.prototype.slickCurrentSlide=function(){return this.currentSlide},s.prototype.getDotCount=function(){var i=0,t=0,s=0;if(!0===this.options.infinite){if(this.slideCount<=this.options.slidesToShow)++s;else for(;i<this.slideCount;)++s,i=t+this.options.slidesToScroll,t+=this.options.slidesToScroll<=this.options.slidesToShow?this.options.slidesToScroll:this.options.slidesToShow}else if(!0===this.options.centerMode)s=this.slideCount;else if(this.options.asNavFor)for(;i<this.slideCount;)++s,i=t+this.options.slidesToScroll,t+=this.options.slidesToScroll<=this.options.slidesToShow?this.options.slidesToScroll:this.options.slidesToShow;else s=1+Math.ceil((this.slideCount-this.options.slidesToShow)/this.options.slidesToScroll);return s-1},s.prototype.getLeft=function(i){var t,s,e,o,n=this,l=0;return n.slideOffset=0,s=n.$slides.first().outerHeight(!0),!0===n.options.infinite?(n.slideCount>n.options.slidesToShow&&(n.slideOffset=-(n.slideWidth*n.options.slidesToShow*1),o=-1,!0===n.options.vertical&&!0===n.options.centerMode&&(2===n.options.slidesToShow?o=-1.5:1===n.options.slidesToShow&&(o=-2)),l=s*n.options.slidesToShow*o),n.slideCount%n.options.slidesToScroll!=0&&i+n.options.slidesToScroll>n.slideCount&&n.slideCount>n.options.slidesToShow&&(i>n.slideCount?(n.slideOffset=-((n.options.slidesToShow-(i-n.slideCount))*n.slideWidth*1),l=-((n.options.slidesToShow-(i-n.slideCount))*s*1)):(n.slideOffset=-(n.slideCount%n.options.slidesToScroll*n.slideWidth*1),l=-(n.slideCount%n.options.slidesToScroll*s*1)))):i+n.options.slidesToShow>n.slideCount&&(n.slideOffset=(i+n.options.slidesToShow-n.slideCount)*n.slideWidth,l=(i+n.options.slidesToShow-n.slideCount)*s),n.slideCount<=n.options.slidesToShow&&(n.slideOffset=0,l=0),!0===n.options.centerMode&&n.slideCount<=n.options.slidesToShow?n.slideOffset=n.slideWidth*Math.floor(n.options.slidesToShow)/2-n.slideWidth*n.slideCount/2:!0===n.options.centerMode&&!0===n.options.infinite?n.slideOffset+=n.slideWidth*Math.floor(n.options.slidesToShow/2)-n.slideWidth:!0===n.options.centerMode&&(n.slideOffset=0,n.slideOffset+=n.slideWidth*Math.floor(n.options.slidesToShow/2)),t=!1===n.options.vertical?-(i*n.slideWidth*1)+n.slideOffset:-(i*s*1)+l,!0===n.options.variableWidth&&(e=n.slideCount<=n.options.slidesToShow||!1===n.options.infinite?n.$slideTrack.children(".slick-slide").eq(i):n.$slideTrack.children(".slick-slide").eq(i+n.options.slidesToShow),t=!0===n.options.rtl?e[0]?-((n.$slideTrack.width()-e[0].offsetLeft-e.width())*1):0:e[0]?-1*e[0].offsetLeft:0,!0===n.options.centerMode&&(e=n.slideCount<=n.options.slidesToShow||!1===n.options.infinite?n.$slideTrack.children(".slick-slide").eq(i):n.$slideTrack.children(".slick-slide").eq(i+n.options.slidesToShow+1),t=!0===n.options.rtl?e[0]?-((n.$slideTrack.width()-e[0].offsetLeft-e.width())*1):0:e[0]?-1*e[0].offsetLeft:0,t+=(n.$list.width()-e.outerWidth())/2)),t},s.prototype.getOption=s.prototype.slickGetOption=function(i){return this.options[i]},s.prototype.getNavigableIndexes=function(){var i,t=0,s=0,e=[];for(!1===this.options.infinite?i=this.slideCount:(t=-1*this.options.slidesToScroll,s=-1*this.options.slidesToScroll,i=2*this.slideCount);t<i;)e.push(t),t=s+this.options.slidesToScroll,s+=this.options.slidesToScroll<=this.options.slidesToShow?this.options.slidesToScroll:this.options.slidesToShow;return e},s.prototype.getSlick=function(){return this},s.prototype.getSlideCount=function(){var t,s,e,o,n=this;return(o=!0===n.options.centerMode?Math.floor(n.$list.width()/2):0,e=-1*n.swipeLeft+o,!0===n.options.swipeToSlide)?(n.$slideTrack.find(".slick-slide").each(function(t,o){var l,r,d;if(l=i(o).outerWidth(),r=o.offsetLeft,!0!==n.options.centerMode&&(r+=l/2),e<(d=r+l))return s=o,!1}),t=Math.abs(i(s).attr("data-slick-index")-n.currentSlide)||1):n.options.slidesToScroll},s.prototype.goTo=s.prototype.slickGoTo=function(i,t){this.changeSlide({data:{message:"index",index:parseInt(i)}},t)},s.prototype.init=function(t){var s=this;i(s.$slider).hasClass("slick-initialized")||(i(s.$slider).addClass("slick-initialized"),s.buildRows(),s.buildOut(),s.setProps(),s.startLoad(),s.loadSlider(),s.initializeEvents(),s.updateArrows(),s.updateDots(),s.checkResponsive(!0),s.focusHandler()),t&&s.$slider.trigger("init",[s]),!0===s.options.accessibility&&s.initADA(),s.options.autoplay&&(s.paused=!1,s.autoPlay())},s.prototype.initADA=function(){var t=this,s=Math.ceil(t.slideCount/t.options.slidesToShow),e=t.getNavigableIndexes().filter(function(i){return i>=0&&i<t.slideCount});t.$slides.add(t.$slideTrack.find(".slick-cloned")).attr({"aria-hidden":"true",tabindex:"-1"}).find("a, input, button, select").attr({tabindex:"-1"}),null!==t.$dots&&(t.$slides.not(t.$slideTrack.find(".slick-cloned")).each(function(s){var o=e.indexOf(s);if(i(this).attr({role:"tabpanel",id:"slick-slide"+t.instanceUid+s,tabindex:-1}),-1!==o){var n="slick-slide-control"+t.instanceUid+o;i("#"+n).length&&i(this).attr({"aria-describedby":n})}}),t.$dots.attr("role","tablist").find("li").each(function(o){var n=e[o];i(this).attr({role:"presentation"}),i(this).find("button").first().attr({role:"tab",id:"slick-slide-control"+t.instanceUid+o,"aria-controls":"slick-slide"+t.instanceUid+n,"aria-label":o+1+" of "+s,"aria-selected":null,tabindex:"-1"})}).eq(t.currentSlide).find("button").attr({"aria-selected":"true",tabindex:"0"}).end());for(var o=t.currentSlide,n=o+t.options.slidesToShow;o<n;o++)t.options.focusOnChange?t.$slides.eq(o).attr({tabindex:"0"}):t.$slides.eq(o).removeAttr("tabindex");t.activateADA()},s.prototype.initArrowEvents=function(){!0===this.options.arrows&&this.slideCount>this.options.slidesToShow&&(this.$prevArrow.off("click.slick").on("click.slick",{message:"previous"},this.changeSlide),this.$nextArrow.off("click.slick").on("click.slick",{message:"next"},this.changeSlide),!0===this.options.accessibility&&(this.$prevArrow.on("keydown.slick",this.keyHandler),this.$nextArrow.on("keydown.slick",this.keyHandler)))},s.prototype.initDotEvents=function(){!0===this.options.dots&&this.slideCount>this.options.slidesToShow&&(i("li",this.$dots).on("click.slick",{message:"index"},this.changeSlide),!0===this.options.accessibility&&this.$dots.on("keydown.slick",this.keyHandler)),!0===this.options.dots&&!0===this.options.pauseOnDotsHover&&this.slideCount>this.options.slidesToShow&&i("li",this.$dots).on("mouseenter.slick",i.proxy(this.interrupt,this,!0)).on("mouseleave.slick",i.proxy(this.interrupt,this,!1))},s.prototype.initSlideEvents=function(){this.options.pauseOnHover&&(this.$list.on("mouseenter.slick",i.proxy(this.interrupt,this,!0)),this.$list.on("mouseleave.slick",i.proxy(this.interrupt,this,!1)))},s.prototype.initializeEvents=function(){this.initArrowEvents(),this.initDotEvents(),this.initSlideEvents(),this.$list.on("touchstart.slick mousedown.slick",{action:"start"},this.swipeHandler),this.$list.on("touchmove.slick mousemove.slick",{action:"move"},this.swipeHandler),this.$list.on("touchend.slick mouseup.slick",{action:"end"},this.swipeHandler),this.$list.on("touchcancel.slick mouseleave.slick",{action:"end"},this.swipeHandler),this.$list.on("click.slick",this.clickHandler),i(document).on(this.visibilityChange,i.proxy(this.visibility,this)),!0===this.options.accessibility&&this.$list.on("keydown.slick",this.keyHandler),!0===this.options.focusOnSelect&&i(this.$slideTrack).children().on("click.slick",this.selectHandler),i(window).on("orientationchange.slick.slick-"+this.instanceUid,i.proxy(this.orientationChange,this)),i(window).on("resize.slick.slick-"+this.instanceUid,i.proxy(this.resize,this)),i("[draggable!=true]",this.$slideTrack).on("dragstart",this.preventDefault),i(window).on("load.slick.slick-"+this.instanceUid,this.setPosition),i(this.setPosition)},s.prototype.initUI=function(){!0===this.options.arrows&&this.slideCount>this.options.slidesToShow&&(this.$prevArrow.show(),this.$nextArrow.show()),!0===this.options.dots&&this.slideCount>this.options.slidesToShow&&this.$dots.show()},s.prototype.keyHandler=function(i){i.target.tagName.match("TEXTAREA|INPUT|SELECT")||(37===i.keyCode&&!0===this.options.accessibility?this.changeSlide({data:{message:!0===this.options.rtl?"next":"previous"}}):39===i.keyCode&&!0===this.options.accessibility&&this.changeSlide({data:{message:!0===this.options.rtl?"previous":"next"}}))},s.prototype.lazyLoad=function(){var t,s,e,o,n=this;function l(t){i("img[data-lazy]",t).each(function(){var t=i(this),s=i(this).attr("data-lazy"),e=i(this).attr("data-srcset"),o=i(this).attr("data-srcloaded"),l=i(this).attr("data-sizes")||n.$slider.attr("data-sizes");o||(t.attr("data-srcloaded","true"),t.animate({opacity:0},100,function(){e&&(t.attr("srcset",e),l&&t.attr("sizes",l)),t.attr("src",s).animate({opacity:1},200,function(){t.removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading")}),n.$slider.trigger("lazyLoaded",[n,t,s])}))})}if(!0===n.options.centerMode?!0===n.options.infinite?o=(e=n.currentSlide+(n.options.slidesToShow/2+1))+n.options.slidesToShow+2:(e=Math.max(0,n.currentSlide-(n.options.slidesToShow/2+1)),o=2+(n.options.slidesToShow/2+1)+n.currentSlide):(o=Math.ceil((e=n.options.infinite?n.options.slidesToShow+n.currentSlide:n.currentSlide)+n.options.slidesToShow),!0===n.options.fade&&(e>0&&e--,o<=n.slideCount&&o++)),t=n.$slider.find(".slick-slide").slice(e,o),"anticipated"===n.options.lazyLoad)for(var r=e-1,d=o,a=n.$slider.find(".slick-slide"),c=0;c<n.options.slidesToScroll;c++)r<0&&(r=n.slideCount-1),t=(t=t.add(a.eq(r))).add(a.eq(d)),r--,d++;l(t),n.slideCount<=n.options.slidesToShow?l(s=n.$slider.find(".slick-slide")):n.currentSlide>=n.slideCount-n.options.slidesToShow?l(s=n.$slider.find(".slick-cloned").slice(0,n.options.slidesToShow)):0===n.currentSlide&&l(s=n.$slider.find(".slick-cloned").slice(-1*n.options.slidesToShow))},s.prototype.loadSlider=function(){this.setPosition(),this.$slideTrack.css({opacity:1}),this.$slider.removeClass("slick-loading"),this.initUI(),"progressive"===this.options.lazyLoad&&this.progressiveLazyLoad()},s.prototype.next=s.prototype.slickNext=function(){this.changeSlide({data:{message:"next"}})},s.prototype.orientationChange=function(){this.checkResponsive(),this.setPosition()},s.prototype.pause=s.prototype.slickPause=function(){var i=this;i.autoPlayClear(),i.paused=!0},s.prototype.play=s.prototype.slickPlay=function(){var i=this;i.autoPlay(),i.options.autoplay=!0,i.paused=!1,i.focussed=!1,i.interrupted=!1},s.prototype.postSlide=function(t){var s=this;!s.unslicked&&(s.$slider.trigger("afterChange",[s,t]),s.animating=!1,s.slideCount>s.options.slidesToShow&&s.setPosition(),s.swipeLeft=null,s.options.autoplay&&s.autoPlay(),!0===s.options.accessibility&&(s.initADA(),s.options.focusOnChange))&&i(s.$slides.get(s.currentSlide)).attr("tabindex",0).focus()},s.prototype.prev=s.prototype.slickPrev=function(){this.changeSlide({data:{message:"previous"}})},s.prototype.preventDefault=function(i){i.preventDefault()},s.prototype.progressiveLazyLoad=function(t){t=t||1;var s,e,o,n,l,r=this,d=i("img[data-lazy]",r.$slider);d.length?(e=(s=d.first()).attr("data-lazy"),o=s.attr("data-srcset"),n=s.attr("data-sizes")||r.$slider.attr("data-sizes"),(l=document.createElement("img")).onload=function(){o&&(s.attr("srcset",o),n&&s.attr("sizes",n)),s.attr("src",e).removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading"),!0===r.options.adaptiveHeight&&r.setPosition(),r.$slider.trigger("lazyLoaded",[r,s,e]),r.progressiveLazyLoad()},l.onerror=function(){t<3?setTimeout(function(){r.progressiveLazyLoad(t+1)},500):(s.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),r.$slider.trigger("lazyLoadError",[r,s,e]),r.progressiveLazyLoad())},l.src=e):r.$slider.trigger("allImagesLoaded",[r])},s.prototype.refresh=function(t){var s,e,o=this;e=o.slideCount-o.options.slidesToShow,!o.options.infinite&&o.currentSlide>e&&(o.currentSlide=e),o.slideCount<=o.options.slidesToShow&&(o.currentSlide=0),s=o.currentSlide,o.destroy(!0),i.extend(o,o.initials,{currentSlide:s}),o.init(),t||o.changeSlide({data:{message:"index",index:s}},!1)},s.prototype.registerBreakpoints=function(){var t,s,e,o=this,n=o.options.responsive||null;if("array"===i.type(n)&&n.length){for(t in o.respondTo=o.options.respondTo||"window",n)if(e=o.breakpoints.length-1,n.hasOwnProperty(t)){for(s=n[t].breakpoint;e>=0;)o.breakpoints[e]&&o.breakpoints[e]===s&&o.breakpoints.splice(e,1),e--;o.breakpoints.push(s),o.breakpointSettings[s]=n[t].settings}o.breakpoints.sort(function(i,t){return o.options.mobileFirst?i-t:t-i})}},s.prototype.reinit=function(){var t=this;t.$slides=t.$slideTrack.children(t.options.slide).addClass("slick-slide"),t.slideCount=t.$slides.length,t.currentSlide>=t.slideCount&&0!==t.currentSlide&&(t.currentSlide=t.currentSlide-t.options.slidesToScroll),t.slideCount<=t.options.slidesToShow&&(t.currentSlide=0),t.registerBreakpoints(),t.setProps(),t.setupInfinite(),t.buildArrows(),t.updateArrows(),t.initArrowEvents(),t.buildDots(),t.updateDots(),t.initDotEvents(),t.cleanUpSlideEvents(),t.initSlideEvents(),t.checkResponsive(!1,!0),!0===t.options.focusOnSelect&&i(t.$slideTrack).children().on("click.slick",t.selectHandler),t.setSlideClasses("number"==typeof t.currentSlide?t.currentSlide:0),t.setPosition(),t.focusHandler(),t.paused=!t.options.autoplay,t.autoPlay(),t.$slider.trigger("reInit",[t])},s.prototype.resize=function(){var t=this;i(window).width()!==t.windowWidth&&(clearTimeout(t.windowDelay),t.windowDelay=window.setTimeout(function(){t.windowWidth=i(window).width(),t.checkResponsive(),t.unslicked||t.setPosition()},50))},s.prototype.removeSlide=s.prototype.slickRemove=function(i,t,s){var e=this;if(i="boolean"==typeof i?!0===(t=i)?0:e.slideCount-1:!0===t?--i:i,e.slideCount<1||i<0||i>e.slideCount-1)return!1;e.unload(),!0===s?e.$slideTrack.children().remove():e.$slideTrack.children(this.options.slide).eq(i).remove(),e.$slides=e.$slideTrack.children(this.options.slide),e.$slideTrack.children(this.options.slide).detach(),e.$slideTrack.append(e.$slides),e.$slidesCache=e.$slides,e.reinit()},s.prototype.setCSS=function(i){var t,s,e=this,o={};!0===e.options.rtl&&(i=-i),t="left"==e.positionProp?Math.ceil(i)+"px":"0px",s="top"==e.positionProp?Math.ceil(i)+"px":"0px",o[e.positionProp]=i,!1===e.transformsEnabled?e.$slideTrack.css(o):(o={},!1===e.cssTransitions?(o[e.animType]="translate("+t+", "+s+")",e.$slideTrack.css(o)):(o[e.animType]="translate3d("+t+", "+s+", 0px)",e.$slideTrack.css(o)))},s.prototype.setDimensions=function(){var i=this;!1===i.options.vertical?!0===i.options.centerMode&&i.$list.css({padding:"0px "+i.options.centerPadding}):(i.$list.height(i.$slides.first().outerHeight(!0)*i.options.slidesToShow),!0===i.options.centerMode&&i.$list.css({padding:i.options.centerPadding+" 0px"})),i.listWidth=i.$list.width(),i.listHeight=i.$list.height(),!1===i.options.vertical&&!1===i.options.variableWidth?(i.slideWidth=Math.ceil(i.listWidth/i.options.slidesToShow),i.$slideTrack.width(Math.ceil(i.slideWidth*i.$slideTrack.children(".slick-slide").length))):!0===i.options.variableWidth?i.$slideTrack.width(5e3*i.slideCount):(i.slideWidth=Math.ceil(i.listWidth),i.$slideTrack.height(Math.ceil(i.$slides.first().outerHeight(!0)*i.$slideTrack.children(".slick-slide").length)));var t=i.$slides.first().outerWidth(!0)-i.$slides.first().width();!1===i.options.variableWidth&&i.$slideTrack.children(".slick-slide").width(i.slideWidth-t)},s.prototype.setFade=function(){var t,s=this;s.$slides.each(function(e,o){t=-(s.slideWidth*e*1),!0===s.options.rtl?i(o).css({position:"relative",right:t,top:0,zIndex:s.options.zIndex-2,opacity:0}):i(o).css({position:"relative",left:t,top:0,zIndex:s.options.zIndex-2,opacity:0})}),s.$slides.eq(s.currentSlide).css({zIndex:s.options.zIndex-1,opacity:1})},s.prototype.setHeight=function(){if(1===this.options.slidesToShow&&!0===this.options.adaptiveHeight&&!1===this.options.vertical){var i=this.$slides.eq(this.currentSlide).outerHeight(!0);this.$list.css("height",i)}},s.prototype.setOption=s.prototype.slickSetOption=function(){var t,s,e,o,n,l=this,r=!1;if("object"===i.type(arguments[0])?(e=arguments[0],r=arguments[1],n="multiple"):"string"===i.type(arguments[0])&&(e=arguments[0],o=arguments[1],r=arguments[2],"responsive"===arguments[0]&&"array"===i.type(arguments[1])?n="responsive":void 0!==arguments[1]&&(n="single")),"single"===n)l.options[e]=o;else if("multiple"===n)i.each(e,function(i,t){l.options[i]=t});else if("responsive"===n)for(s in o)if("array"!==i.type(l.options.responsive))l.options.responsive=[o[s]];else{for(t=l.options.responsive.length-1;t>=0;)l.options.responsive[t].breakpoint===o[s].breakpoint&&l.options.responsive.splice(t,1),t--;l.options.responsive.push(o[s])}r&&(l.unload(),l.reinit())},s.prototype.setPosition=function(){this.setDimensions(),this.setHeight(),!1===this.options.fade?this.setCSS(this.getLeft(this.currentSlide)):this.setFade(),this.$slider.trigger("setPosition",[this])},s.prototype.setProps=function(){var i=this,t=document.body.style;i.positionProp=!0===i.options.vertical?"top":"left","top"===i.positionProp?i.$slider.addClass("slick-vertical"):i.$slider.removeClass("slick-vertical"),(void 0!==t.WebkitTransition||void 0!==t.MozTransition||void 0!==t.msTransition)&&!0===i.options.useCSS&&(i.cssTransitions=!0),i.options.fade&&("number"==typeof i.options.zIndex?i.options.zIndex<3&&(i.options.zIndex=3):i.options.zIndex=i.defaults.zIndex),void 0!==t.OTransform&&(i.animType="OTransform",i.transformType="-o-transform",i.transitionType="OTransition",void 0===t.perspectiveProperty&&void 0===t.webkitPerspective&&(i.animType=!1)),void 0!==t.MozTransform&&(i.animType="MozTransform",i.transformType="-moz-transform",i.transitionType="MozTransition",void 0===t.perspectiveProperty&&void 0===t.MozPerspective&&(i.animType=!1)),void 0!==t.webkitTransform&&(i.animType="webkitTransform",i.transformType="-webkit-transform",i.transitionType="webkitTransition",void 0===t.perspectiveProperty&&void 0===t.webkitPerspective&&(i.animType=!1)),void 0!==t.msTransform&&(i.animType="msTransform",i.transformType="-ms-transform",i.transitionType="msTransition",void 0===t.msTransform&&(i.animType=!1)),void 0!==t.transform&&!1!==i.animType&&(i.animType="transform",i.transformType="transform",i.transitionType="transition"),i.transformsEnabled=i.options.useTransform&&null!==i.animType&&!1!==i.animType},s.prototype.setSlideClasses=function(i){var t,s,e,o;if(s=this.$slider.find(".slick-slide").removeClass("slick-active slick-center slick-current").attr("aria-hidden","true"),this.$slides.eq(i).addClass("slick-current"),!0===this.options.centerMode){var n=this.options.slidesToShow%2==0?1:0;t=Math.floor(this.options.slidesToShow/2),!0===this.options.infinite&&(i>=t&&i<=this.slideCount-1-t?this.$slides.slice(i-t+n,i+t+1).addClass("slick-active").attr("aria-hidden","false"):(e=this.options.slidesToShow+i,s.slice(e-t+1+n,e+t+2).addClass("slick-active").attr("aria-hidden","false")),0===i?s.eq(s.length-1-this.options.slidesToShow).addClass("slick-center"):i===this.slideCount-1&&s.eq(this.options.slidesToShow).addClass("slick-center")),this.$slides.eq(i).addClass("slick-center")}else i>=0&&i<=this.slideCount-this.options.slidesToShow?this.$slides.slice(i,i+this.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"):s.length<=this.options.slidesToShow?s.addClass("slick-active").attr("aria-hidden","false"):(o=this.slideCount%this.options.slidesToShow,e=!0===this.options.infinite?this.options.slidesToShow+i:i,this.options.slidesToShow==this.options.slidesToScroll&&this.slideCount-i<this.options.slidesToShow?s.slice(e-(this.options.slidesToShow-o),e+o).addClass("slick-active").attr("aria-hidden","false"):s.slice(e,e+this.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"));("ondemand"===this.options.lazyLoad||"anticipated"===this.options.lazyLoad)&&this.lazyLoad()},s.prototype.setupInfinite=function(){var t,s,e,o=this;if(!0===o.options.fade&&(o.options.centerMode=!1),!0===o.options.infinite&&!1===o.options.fade&&(s=null,o.slideCount>o.options.slidesToShow)){for(e=!0===o.options.centerMode?o.options.slidesToShow+1:o.options.slidesToShow,t=o.slideCount;t>o.slideCount-e;t-=1)s=t-1,i(o.$slides[s]).clone(!0).attr("id","").attr("data-slick-index",s-o.slideCount).prependTo(o.$slideTrack).addClass("slick-cloned");for(t=0;t<e+o.slideCount;t+=1)s=t,i(o.$slides[s]).clone(!0).attr("id","").attr("data-slick-index",s+o.slideCount).appendTo(o.$slideTrack).addClass("slick-cloned");o.$slideTrack.find(".slick-cloned").find("[id]").each(function(){i(this).attr("id","")})}},s.prototype.interrupt=function(i){var t=this;i||t.autoPlay(),t.interrupted=i},s.prototype.selectHandler=function(t){var s=parseInt((i(t.target).is(".slick-slide")?i(t.target):i(t.target).parents(".slick-slide")).attr("data-slick-index"));if(s||(s=0),this.slideCount<=this.options.slidesToShow){this.slideHandler(s,!1,!0);return}this.slideHandler(s)},s.prototype.slideHandler=function(i,t,s){var e,o,n,l,r,d=null,a=this;if(t=t||!1,(!0!==a.animating||!0!==a.options.waitForAnimate)&&(!0!==a.options.fade||a.currentSlide!==i)){if(!1===t&&a.asNavFor(i),e=i,d=a.getLeft(e),l=a.getLeft(a.currentSlide),a.currentLeft=null===a.swipeLeft?l:a.swipeLeft,!1===a.options.infinite&&!1===a.options.centerMode&&(i<0||i>a.getDotCount()*a.options.slidesToScroll)||!1===a.options.infinite&&!0===a.options.centerMode&&(i<0||i>a.slideCount-a.options.slidesToScroll)){!1===a.options.fade&&(e=a.currentSlide,!0!==s&&a.slideCount>a.options.slidesToShow?a.animateSlide(l,function(){a.postSlide(e)}):a.postSlide(e));return}if(a.options.autoplay&&clearInterval(a.autoPlayTimer),o=e<0?a.slideCount%a.options.slidesToScroll!=0?a.slideCount-a.slideCount%a.options.slidesToScroll:a.slideCount+e:e>=a.slideCount?a.slideCount%a.options.slidesToScroll!=0?0:e-a.slideCount:e,a.animating=!0,a.$slider.trigger("beforeChange",[a,a.currentSlide,o]),n=a.currentSlide,a.currentSlide=o,a.setSlideClasses(a.currentSlide),a.options.asNavFor&&(r=(r=a.getNavTarget()).slick("getSlick")).slideCount<=r.options.slidesToShow&&r.setSlideClasses(a.currentSlide),a.updateDots(),a.updateArrows(),!0===a.options.fade){!0!==s?(a.fadeSlideOut(n),a.fadeSlide(o,function(){a.postSlide(o)})):a.postSlide(o),a.animateHeight();return}!0!==s&&a.slideCount>a.options.slidesToShow?a.animateSlide(d,function(){a.postSlide(o)}):a.postSlide(o)}},s.prototype.startLoad=function(){!0===this.options.arrows&&this.slideCount>this.options.slidesToShow&&(this.$prevArrow.hide(),this.$nextArrow.hide()),!0===this.options.dots&&this.slideCount>this.options.slidesToShow&&this.$dots.hide(),this.$slider.addClass("slick-loading")},s.prototype.swipeDirection=function(){var i,t,s,e;return(i=this.touchObject.startX-this.touchObject.curX,(e=Math.round(180*(s=Math.atan2(t=this.touchObject.startY-this.touchObject.curY,i))/Math.PI))<0&&(e=360-Math.abs(e)),e<=45&&e>=0||e<=360&&e>=315)?!1===this.options.rtl?"left":"right":e>=135&&e<=225?!1===this.options.rtl?"right":"left":!0===this.options.verticalSwiping?e>=35&&e<=135?"down":"up":"vertical"},s.prototype.swipeEnd=function(i){var t,s,e=this;if(e.dragging=!1,e.swiping=!1,e.scrolling)return e.scrolling=!1,!1;if(e.interrupted=!1,e.shouldClick=!(e.touchObject.swipeLength>10),void 0===e.touchObject.curX)return!1;if(!0===e.touchObject.edgeHit&&e.$slider.trigger("edge",[e,e.swipeDirection()]),e.touchObject.swipeLength>=e.touchObject.minSwipe){switch(s=e.swipeDirection()){case"left":case"down":t=e.options.swipeToSlide?e.checkNavigable(e.currentSlide+e.getSlideCount()):e.currentSlide+e.getSlideCount(),e.currentDirection=0;break;case"right":case"up":t=e.options.swipeToSlide?e.checkNavigable(e.currentSlide-e.getSlideCount()):e.currentSlide-e.getSlideCount(),e.currentDirection=1}"vertical"!=s&&(e.slideHandler(t),e.touchObject={},e.$slider.trigger("swipe",[e,s]))}else e.touchObject.startX!==e.touchObject.curX&&(e.slideHandler(e.currentSlide),e.touchObject={})},s.prototype.swipeHandler=function(i){var t=this;if(!1!==t.options.swipe&&(!("ontouchend"in document)||!1!==t.options.swipe)){if(!1!==t.options.draggable||-1===i.type.indexOf("mouse"))switch(t.touchObject.fingerCount=i.originalEvent&&void 0!==i.originalEvent.touches?i.originalEvent.touches.length:1,t.touchObject.minSwipe=t.listWidth/t.options.touchThreshold,!0===t.options.verticalSwiping&&(t.touchObject.minSwipe=t.listHeight/t.options.touchThreshold),i.data.action){case"start":t.swipeStart(i);break;case"move":t.swipeMove(i);break;case"end":t.swipeEnd(i)}}},s.prototype.swipeMove=function(i){var t,s,e,o,n,l,r=this;return n=void 0!==i.originalEvent?i.originalEvent.touches:null,!!r.dragging&&!r.scrolling&&(!n||1===n.length)&&((t=r.getLeft(r.currentSlide),r.touchObject.curX=void 0!==n?n[0].pageX:i.clientX,r.touchObject.curY=void 0!==n?n[0].pageY:i.clientY,r.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(r.touchObject.curX-r.touchObject.startX,2))),l=Math.round(Math.sqrt(Math.pow(r.touchObject.curY-r.touchObject.startY,2))),r.options.verticalSwiping||r.swiping||!(l>4))?(!0===r.options.verticalSwiping&&(r.touchObject.swipeLength=l),s=r.swipeDirection(),void 0!==i.originalEvent&&r.touchObject.swipeLength>4&&(r.swiping=!0,i.preventDefault()),o=(!1===r.options.rtl?1:-1)*(r.touchObject.curX>r.touchObject.startX?1:-1),!0===r.options.verticalSwiping&&(o=r.touchObject.curY>r.touchObject.startY?1:-1),e=r.touchObject.swipeLength,r.touchObject.edgeHit=!1,!1===r.options.infinite&&(0===r.currentSlide&&"right"===s||r.currentSlide>=r.getDotCount()&&"left"===s)&&(e=r.touchObject.swipeLength*r.options.edgeFriction,r.touchObject.edgeHit=!0),!1===r.options.vertical?r.swipeLeft=t+e*o:r.swipeLeft=t+e*(r.$list.height()/r.listWidth)*o,!0===r.options.verticalSwiping&&(r.swipeLeft=t+e*o),!0!==r.options.fade&&!1!==r.options.touchMove&&(!0===r.animating?(r.swipeLeft=null,!1):void r.setCSS(r.swipeLeft))):(r.scrolling=!0,!1))},s.prototype.swipeStart=function(i){var t,s=this;if(s.interrupted=!0,1!==s.touchObject.fingerCount||s.slideCount<=s.options.slidesToShow)return s.touchObject={},!1;void 0!==i.originalEvent&&void 0!==i.originalEvent.touches&&(t=i.originalEvent.touches[0]),s.touchObject.startX=s.touchObject.curX=void 0!==t?t.pageX:i.clientX,s.touchObject.startY=s.touchObject.curY=void 0!==t?t.pageY:i.clientY,s.dragging=!0},s.prototype.unfilterSlides=s.prototype.slickUnfilter=function(){null!==this.$slidesCache&&(this.unload(),this.$slideTrack.children(this.options.slide).detach(),this.$slidesCache.appendTo(this.$slideTrack),this.reinit())},s.prototype.unload=function(){i(".slick-cloned",this.$slider).remove(),this.$dots&&this.$dots.remove(),this.$prevArrow&&this.htmlExpr.test(this.options.prevArrow)&&this.$prevArrow.remove(),this.$nextArrow&&this.htmlExpr.test(this.options.nextArrow)&&this.$nextArrow.remove(),this.$slides.removeClass("slick-slide slick-active slick-visible slick-current").attr("aria-hidden","true").css("width","")},s.prototype.unslick=function(i){this.$slider.trigger("unslick",[this,i]),this.destroy()},s.prototype.updateArrows=function(){var i;i=Math.floor(this.options.slidesToShow/2),!0===this.options.arrows&&this.slideCount>this.options.slidesToShow&&!this.options.infinite&&(this.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false"),this.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false"),0===this.currentSlide?(this.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true"),this.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false")):this.currentSlide>=this.slideCount-this.options.slidesToShow&&!1===this.options.centerMode?(this.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),this.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")):this.currentSlide>=this.slideCount-1&&!0===this.options.centerMode&&(this.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),this.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")))},s.prototype.updateDots=function(){null!==this.$dots&&(this.$dots.find("li").removeClass("slick-active").end(),this.$dots.find("li").eq(Math.floor(this.currentSlide/this.options.slidesToScroll)).addClass("slick-active"))},s.prototype.visibility=function(){var i=this;i.options.autoplay&&(document[i.hidden]?i.interrupted=!0:i.interrupted=!1)},i.fn.slick=function(){var i,t,e=this,o=arguments[0],n=Array.prototype.slice.call(arguments,1),l=e.length;for(i=0;i<l;i++)if("object"==typeof o||void 0===o?e[i].slick=new s(e[i],o):t=e[i].slick[o].apply(e[i].slick,n),void 0!==t)return t;return e}});
!function(t,e){"object"==typeof module&&module.exports?module.exports=e(require("./punycode"),require("./IPv6"),require("./SecondLevelDomains")):"function"==typeof define&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],e):t.URI=e(t.punycode,t.IPv6,t.SecondLevelDomains,t)}(this,function(o,e,u,r){function d(t,e){var r=1<=arguments.length;if(!(this instanceof d))return r?2<=arguments.length?new d(t,e):new d(t):new d;if(void 0===t){if(r)throw new TypeError("undefined is not a valid argument for URI");t="undefined"!=typeof location?location.href+"":""}if(null===t&&r)throw new TypeError("null is not a valid argument for URI");return this.href(t),void 0!==e?this.absoluteTo(e):this}function s(t){return t.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function i(t){return void 0===t?"Undefined":String(Object.prototype.toString.call(t)).slice(8,-1)}function h(t){return"Array"===i(t)}function a(t,e){var r={};if("RegExp"===i(e))r=null;else if(h(e))for(var n=0,s=e.length;n<s;n++)r[e[n]]=!0;else r[e]=!0;for(n=0,s=t.length;n<s;n++)(r&&void 0!==r[t[n]]||!r&&e.test(t[n]))&&(t.splice(n,1),s--,n--);return t}function p(t,e){if(h(e)){for(var r=0,n=e.length;r<n;r++)if(!p(t,e[r]))return!1;return!0}var s=i(e),r=0;for(n=t.length;r<n;r++)if("RegExp"===s){if("string"==typeof t[r]&&t[r].match(e))return!0}else if(t[r]===e)return!0;return!1}function c(t,e){if(!h(t)||!h(e)||t.length!==e.length)return!1;t.sort(),e.sort();for(var r=0,n=t.length;r<n;r++)if(t[r]!==e[r])return!1;return!0}function l(t){return t.replace(/^\/+|\/+$/g,"")}function n(t){return escape(t)}function f(t){return encodeURIComponent(t).replace(/[!'()*]/g,n).replace(/\*/g,"%2A")}function t(r){return function(t,e){return void 0===t?this._parts[r]||"":(this._parts[r]=t||null,this.build(!e),this)}}function m(r,n){return function(t,e){return void 0===t?this._parts[r]||"":(null!==t&&(t+="").charAt(0)===n&&(t=t.substring(1)),this._parts[r]=t,this.build(!e),this)}}function g(r,n){return function(e){try{return d[n](e+"").replace(d.characters[r][n].expression,function(t){return d.characters[r][n].map[t]})}catch(t){return e}}}var _,y=r&&r.URI,v=(d.version="1.19.7",d.prototype),b=Object.prototype.hasOwnProperty,w=(d._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:d.preventInvalidHostname,duplicateQueryParameters:d.duplicateQueryParameters,escapeQuerySpace:d.escapeQuerySpace}},d.preventInvalidHostname=!1,d.duplicateQueryParameters=!1,d.escapeQuerySpace=!0,d.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,d.idn_expression=/[^a-z0-9\._-]/i,d.punycode_expression=/(xn--)/i,d.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,d.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,d.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?\u00ab\u00bb\u201c\u201d\u2018\u2019]))/gi,d.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?\u00ab\u00bb\u201c\u201d\u201e\u2018\u2019]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},d.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},d.hostProtocols=["http","https"],d.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,d.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},d.getDomAttribute=function(t){if(t&&t.nodeName){var e=t.nodeName.toLowerCase();if("input"!==e||"image"===t.type)return d.domAttributes[e]}},d.encode=f,d.decode=decodeURIComponent,d.iso8859=function(){d.encode=escape,d.decode=unescape},d.unicode=function(){d.encode=f,d.decode=decodeURIComponent},d.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/gi,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/gi,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/gi,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},d.encodeQuery=function(t,e){t=d.encode(t+"");return(e=void 0===e?d.escapeQuerySpace:e)?t.replace(/%20/g,"+"):t},d.decodeQuery=function(e,t){e+="",void 0===t&&(t=d.escapeQuerySpace);try{return d.decode(t?e.replace(/\+/g,"%20"):e)}catch(t){return e}},{encode:"encode",decode:"decode"});for(_ in w)d[_+"PathSegment"]=g("pathname",w[_]),d[_+"UrnPathSegment"]=g("urnpath",w[_]);d.decodePath=(w=function(s,a,i){return function(t){for(var e=i?function(t){return d[a](d[i](t))}:d[a],r=0,n=(t=(t+"").split(s)).length;r<n;r++)t[r]=e(t[r]);return t.join(s)}})("/","decodePathSegment"),d.decodeUrnPath=w(":","decodeUrnPathSegment"),d.recodePath=w("/","encodePathSegment","decode"),d.recodeUrnPath=w(":","encodeUrnPathSegment","decode"),d.encodeReserved=g("reserved","encode"),d.parse=function(t,e){e=e||{preventInvalidHostname:d.preventInvalidHostname};var r=t.indexOf("#");return-1<r&&(e.fragment=t.substring(r+1)||null,t=t.substring(0,r)),-1<(r=t.indexOf("?"))&&(e.query=t.substring(r+1)||null,t=t.substring(0,r)),"//"===(t=t.replace(/^(https?|ftp|wss?)?:[/\\]*/,"$1://")).substring(0,2)?(e.protocol=null,t=t.substring(2),t=d.parseAuthority(t,e)):-1<(r=t.indexOf(":"))&&(e.protocol=t.substring(0,r)||null,e.protocol&&!e.protocol.match(d.protocol_expression)?e.protocol=void 0:"//"===t.substring(r+1,r+3).replace(/\\/g,"/")?(t=t.substring(r+3),t=d.parseAuthority(t,e)):(t=t.substring(r+1),e.urn=!0)),e.path=t,e},d.parseHost=function(t,e){var r,n,s=(t=(t=t||"").replace(/\\/g,"/")).indexOf("/");return-1===s&&(s=t.length),"["===t.charAt(0)?(r=t.indexOf("]"),e.hostname=t.substring(1,r)||null,e.port=t.substring(r+2,s)||null,"/"===e.port&&(e.port=null)):(n=t.indexOf(":"),r=t.indexOf("/"),-1!==(n=t.indexOf(":",n+1))&&(-1===r||n<r)?(e.hostname=t.substring(0,s)||null,e.port=null):(r=t.substring(0,s).split(":"),e.hostname=r[0]||null,e.port=r[1]||null)),e.hostname&&"/"!==t.substring(s).charAt(0)&&(s++,t="/"+t),e.preventInvalidHostname&&d.ensureValidHostname(e.hostname,e.protocol),e.port&&d.ensureValidPort(e.port),t.substring(s)||"/"},d.parseAuthority=function(t,e){return t=d.parseUserinfo(t,e),d.parseHost(t,e)},d.parseUserinfo=function(t,e){var r=t,n=(t=-1!==t.indexOf("\\")?t.replace(/\\/g,"/"):t).indexOf("/"),s=t.lastIndexOf("@",-1<n?n:t.length-1);return-1<s&&(-1===n||s<n)?(n=t.substring(0,s).split(":"),e.username=n[0]?d.decode(n[0]):null,n.shift(),e.password=n[0]?d.decode(n.join(":")):null,t=r.substring(s+1)):(e.username=null,e.password=null),t},d.parseQuery=function(t,e){if(!t)return{};if(!(t=t.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,"")))return{};for(var r,n,s={},a=t.split("&"),i=a.length,o=0;o<i;o++)r=a[o].split("="),n=d.decodeQuery(r.shift(),e),r=r.length?d.decodeQuery(r.join("="),e):null,"__proto__"!==n&&(b.call(s,n)?("string"!=typeof s[n]&&null!==s[n]||(s[n]=[s[n]]),s[n].push(r)):s[n]=r);return s},d.build=function(t){var e="",r=!1;return t.protocol&&(e+=t.protocol+":"),t.urn||!e&&!t.hostname||(e+="//",r=!0),e+=d.buildAuthority(t)||"","string"==typeof t.path&&("/"!==t.path.charAt(0)&&r&&(e+="/"),e+=t.path),"string"==typeof t.query&&t.query&&(e+="?"+t.query),"string"==typeof t.fragment&&t.fragment&&(e+="#"+t.fragment),e},d.buildHost=function(t){var e="";return t.hostname?(e=d.ip6_expression.test(t.hostname)?e+("["+t.hostname)+"]":e+t.hostname,t.port&&(e+=":"+t.port),e):""},d.buildAuthority=function(t){return d.buildUserinfo(t)+d.buildHost(t)},d.buildUserinfo=function(t){var e="";return t.username&&(e+=d.encode(t.username)),t.password&&(e+=":"+d.encode(t.password)),e&&(e+="@"),e},d.buildQuery=function(t,e,r){var n,s="";for(n in t)if("__proto__"!==n&&b.call(t,n))if(h(t[n]))for(var a={},i=0,o=t[n].length;i<o;i++)void 0!==t[n][i]&&void 0===a[t[n][i]+""]&&(s+="&"+d.buildQueryParameter(n,t[n][i],r),!0!==e)&&(a[t[n][i]+""]=!0);else void 0!==t[n]&&(s+="&"+d.buildQueryParameter(n,t[n],r));return s.substring(1)},d.buildQueryParameter=function(t,e,r){return d.encodeQuery(t,r)+(null!==e?"="+d.encodeQuery(e,r):"")},d.addQuery=function(t,e,r){if("object"==typeof e)for(var n in e)b.call(e,n)&&d.addQuery(t,n,e[n]);else{if("string"!=typeof e)throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");void 0===t[e]?t[e]=r:("string"==typeof t[e]&&(t[e]=[t[e]]),h(r)||(r=[r]),t[e]=(t[e]||[]).concat(r))}},d.setQuery=function(t,e,r){if("object"==typeof e)for(var n in e)b.call(e,n)&&d.setQuery(t,n,e[n]);else{if("string"!=typeof e)throw new TypeError("URI.setQuery() accepts an object, string as the name parameter");t[e]=void 0===r?null:r}},d.removeQuery=function(t,e,r){if(h(e))for(r=0,n=e.length;r<n;r++)t[e[r]]=void 0;else if("RegExp"===i(e))for(var n in t)e.test(n)&&(t[n]=void 0);else if("object"==typeof e)for(n in e)b.call(e,n)&&d.removeQuery(t,n,e[n]);else{if("string"!=typeof e)throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter");void 0!==r?"RegExp"===i(r)?!h(t[e])&&r.test(t[e])?t[e]=void 0:t[e]=a(t[e],r):t[e]!==String(r)||h(r)&&1!==r.length?h(t[e])&&(t[e]=a(t[e],r)):t[e]=void 0:t[e]=void 0}},d.hasQuery=function(t,e,r,n){switch(i(e)){case"String":break;case"RegExp":for(var s in t)if(b.call(t,s)&&e.test(s)&&(void 0===r||d.hasQuery(t,s,r)))return!0;return!1;case"Object":for(var a in e)if(b.call(e,a)&&!d.hasQuery(t,a,e[a]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(i(r)){case"Undefined":return e in t;case"Boolean":return r===(t=!(h(t[e])?!t[e].length:!t[e]));case"Function":return!!r(t[e],e,t);case"Array":return!!h(t[e])&&(n?p:c)(t[e],r);case"RegExp":return h(t[e])?!!n&&p(t[e],r):!(!t[e]||!t[e].match(r));case"Number":r=String(r);case"String":return h(t[e])?!!n&&p(t[e],r):t[e]===r;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},d.joinPaths=function(){for(var t=[],e=[],r=0,n=0;n<arguments.length;n++){var s=new d(arguments[n]);t.push(s);for(var s=s.segment(),a=0;a<s.length;a++)"string"==typeof s[a]&&e.push(s[a]),s[a]&&r++}return e.length&&r?(e=new d("").segment(e),""!==t[0].path()&&"/"!==t[0].path().slice(0,1)||e.path("/"+e.path()),e.normalize()):new d("")},d.commonPath=function(t,e){for(var r=Math.min(t.length,e.length),n=0;n<r;n++)if(t.charAt(n)!==e.charAt(n)){n--;break}return n<1?t.charAt(0)===e.charAt(0)&&"/"===t.charAt(0)?"/":"":("/"===t.charAt(n)&&"/"===e.charAt(n)||(n=t.substring(0,n).lastIndexOf("/")),t.substring(0,n+1))},d.withinString=function(t,e,r){var n=(r=r||{}).start||d.findUri.start,s=r.end||d.findUri.end,a=r.trim||d.findUri.trim,i=r.parens||d.findUri.parens,o=/[a-z0-9-]=["']?$/i;for(n.lastIndex=0;;){var h=n.exec(t);if(!h)break;var u=h.index;if(r.ignoreHtml){var p=t.slice(Math.max(u-3,0),u);if(p&&o.test(p))continue}for(var c=u+t.slice(u).search(s),p=t.slice(u,c),c=-1;;){var l=i.exec(p);if(!l)break;c=Math.max(c,l.index+l[0].length)}(p=-1<c?p.slice(0,c)+p.slice(c).replace(a,""):p.replace(a,"")).length<=h[0].length||r.ignore&&r.ignore.test(p)||(void 0===(h=e(p,u,c=u+p.length,t))?n.lastIndex=c:(h=String(h),t=t.slice(0,u)+h+t.slice(c),n.lastIndex=u+h.length))}return n.lastIndex=0,t},d.ensureValidHostname=function(t,e){var r=!!t,n=!1;if((n=e?p(d.hostProtocols,e):n)&&!r)throw new TypeError("Hostname cannot be empty, if protocol is "+e);if(t&&t.match(d.invalid_hostname_characters)){if(!o)throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(o.toASCII(t).match(d.invalid_hostname_characters))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_]')}},d.ensureValidPort=function(t){if(t){var e=Number(t);if(!(/^[0-9]+$/.test(e)&&0<e&&e<65536))throw new TypeError('Port "'+t+'" is not a valid port')}},d.noConflict=function(t){return t?(t={URI:this.noConflict()},r.URITemplate&&"function"==typeof r.URITemplate.noConflict&&(t.URITemplate=r.URITemplate.noConflict()),r.IPv6&&"function"==typeof r.IPv6.noConflict&&(t.IPv6=r.IPv6.noConflict()),r.SecondLevelDomains&&"function"==typeof r.SecondLevelDomains.noConflict&&(t.SecondLevelDomains=r.SecondLevelDomains.noConflict()),t):(r.URI===this&&(r.URI=y),this)},v.build=function(t){return!0===t?this._deferred_build=!0:void 0!==t&&!this._deferred_build||(this._string=d.build(this._parts),this._deferred_build=!1),this},v.clone=function(){return new d(this)},v.valueOf=v.toString=function(){return this.build(!1)._string},v.protocol=t("protocol"),v.username=t("username"),v.password=t("password"),v.hostname=t("hostname"),v.port=t("port"),v.query=m("query","?"),v.fragment=m("fragment","#"),v.search=function(t,e){t=this.query(t,e);return"string"==typeof t&&t.length?"?"+t:t},v.hash=function(t,e){t=this.fragment(t,e);return"string"==typeof t&&t.length?"#"+t:t},v.pathname=function(t,e){var r;return void 0===t||!0===t?(r=this._parts.path||(this._parts.hostname?"/":""),t?(this._parts.urn?d.decodeUrnPath:d.decodePath)(r):r):(this._parts.path=this._parts.urn?t?d.recodeUrnPath(t):"":t?d.recodePath(t):"/",this.build(!e),this)},v.path=v.pathname,v.href=function(t,e){if(void 0===t)return this.toString();this._string="",this._parts=d._parts();var r=t instanceof d,n="object"==typeof t&&(t.hostname||t.path||t.pathname);if(t.nodeName&&(t=t[n=d.getDomAttribute(t)]||"",n=!1),"string"==typeof(t=!r&&n&&void 0!==t.pathname?t.toString():t)||t instanceof String)this._parts=d.parse(String(t),this._parts);else{if(!r&&!n)throw new TypeError("invalid input");for(var s in r=r?t._parts:t)"query"!==s&&b.call(this._parts,s)&&(this._parts[s]=r[s]);r.query&&this.query(r.query,!1)}return this.build(!e),this},v.is=function(t){var e=!1,r=!1,n=!1,s=!1,a=!1,i=!1,o=!1,h=!this._parts.urn;switch(this._parts.hostname&&(h=!1,r=d.ip4_expression.test(this._parts.hostname),n=d.ip6_expression.test(this._parts.hostname),a=(s=!(e=r||n))&&u&&u.has(this._parts.hostname),i=s&&d.idn_expression.test(this._parts.hostname),o=s&&d.punycode_expression.test(this._parts.hostname)),t.toLowerCase()){case"relative":return h;case"absolute":return!h;case"domain":case"name":return s;case"sld":return a;case"ip":return e;case"ip4":case"ipv4":case"inet4":return r;case"ip6":case"ipv6":case"inet6":return n;case"idn":return i;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return o}return null};var x=v.protocol,A=v.port,Q=v.hostname,I=(v.protocol=function(t,e){if(t&&!(t=t.replace(/:(\/\/)?$/,"")).match(d.protocol_expression))throw new TypeError('Protocol "'+t+"\" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]");return x.call(this,t,e)},v.scheme=v.protocol,v.port=function(t,e){return this._parts.urn?void 0===t?"":this:(void 0!==t&&(t=0===t?null:t)&&(":"===(t+="").charAt(0)&&(t=t.substring(1)),d.ensureValidPort(t)),A.call(this,t,e))},v.hostname=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0!==t){var r={preventInvalidHostname:this._parts.preventInvalidHostname};if("/"!==d.parseHost(t,r))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-]');t=r.hostname,this._parts.preventInvalidHostname&&d.ensureValidHostname(t,this._parts.protocol)}return Q.call(this,t,e)},v.origin=function(t,e){var r;return this._parts.urn?void 0===t?"":this:void 0===t?(r=this.protocol(),this.authority()?(r?r+"://":"")+this.authority():""):(r=d(t),this.protocol(r.protocol()).authority(r.authority()).build(!e),this)},v.host=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t)return this._parts.hostname?d.buildHost(this._parts):"";if("/"!==d.parseHost(t,this._parts))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-]');return this.build(!e),this},v.authority=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t)return this._parts.hostname?d.buildAuthority(this._parts):"";if("/"!==d.parseAuthority(t,this._parts))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-]');return this.build(!e),this},v.userinfo=function(t,e){var r;return this._parts.urn?void 0===t?"":this:void 0===t?(r=d.buildUserinfo(this._parts))&&r.substring(0,r.length-1):("@"!==t[t.length-1]&&(t+="@"),d.parseUserinfo(t,this._parts),this.build(!e),this)},v.resource=function(t,e){return void 0===t?this.path()+this.search()+this.hash():(t=d.parse(t),this._parts.path=t.path,this._parts.query=t.query,this._parts.fragment=t.fragment,this.build(!e),this)},v.subdomain=function(t,e){if(this._parts.urn)return void 0===t?"":this;var r;if(void 0===t)return this._parts.hostname&&!this.is("IP")&&(r=this._parts.hostname.length-this.domain().length-1,this._parts.hostname.substring(0,r))||"";if(r=this._parts.hostname.length-this.domain().length,r=this._parts.hostname.substring(0,r),r=new RegExp("^"+s(r)),t&&"."!==t.charAt(t.length-1)&&(t+="."),-1!==t.indexOf(":"))throw new TypeError("Domains cannot contain colons");return t&&d.ensureValidHostname(t,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(r,t),this.build(!e),this},v.domain=function(t,e){if(this._parts.urn)return void 0===t?"":this;var r;if("boolean"==typeof t&&(e=t,t=void 0),void 0===t)return!this._parts.hostname||this.is("IP")?"":(r=this._parts.hostname.match(/\./g))&&r.length<2?this._parts.hostname:(r=this._parts.hostname.length-this.tld(e).length-1,r=this._parts.hostname.lastIndexOf(".",r-1)+1,this._parts.hostname.substring(r)||"");if(!t)throw new TypeError("cannot set domain empty");if(-1!==t.indexOf(":"))throw new TypeError("Domains cannot contain colons");return d.ensureValidHostname(t,this._parts.protocol),!this._parts.hostname||this.is("IP")?this._parts.hostname=t:(r=new RegExp(s(this.domain())+"$"),this._parts.hostname=this._parts.hostname.replace(r,t)),this.build(!e),this},v.tld=function(t,e){if(this._parts.urn)return void 0===t?"":this;var r;if("boolean"==typeof t&&(e=t,t=void 0),void 0===t)return!this._parts.hostname||this.is("IP")?"":(r=this._parts.hostname.lastIndexOf("."),r=this._parts.hostname.substring(r+1),!0!==e&&u&&u.list[r.toLowerCase()]&&u.get(this._parts.hostname)||r);if(!t)throw new TypeError("cannot set TLD empty");if(t.match(/[^a-zA-Z0-9-]/)){if(!u||!u.is(t))throw new TypeError('TLD "'+t+'" contains characters other than [A-Z0-9]')}else if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");return r=new RegExp(s(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(r,t),this.build(!e),this},v.directory=function(t,e){var r;return this._parts.urn?void 0===t?"":this:void 0===t||!0===t?this._parts.path||this._parts.hostname?"/"===this._parts.path?"/":(r=this._parts.path.length-this.filename().length-1,r=this._parts.path.substring(0,r)||(this._parts.hostname?"/":""),t?d.decodePath(r):r):"":(r=this._parts.path.length-this.filename().length,r=this._parts.path.substring(0,r),r=new RegExp("^"+s(r)),this.is("relative")||"/"!==(t=t||"/").charAt(0)&&(t="/"+t),t&&"/"!==t.charAt(t.length-1)&&(t+="/"),t=d.recodePath(t),this._parts.path=this._parts.path.replace(r,t),this.build(!e),this)},v.filename=function(t,e){if(this._parts.urn)return void 0===t?"":this;var r;if("string"!=typeof t)return this._parts.path&&"/"!==this._parts.path?(r=this._parts.path.lastIndexOf("/"),r=this._parts.path.substring(r+1),t?d.decodePathSegment(r):r):"";r=!1,(t="/"===t.charAt(0)?t.substring(1):t).match(/\.?\//)&&(r=!0);var n=new RegExp(s(this.filename())+"$");return t=d.recodePath(t),this._parts.path=this._parts.path.replace(n,t),r?this.normalizePath(e):this.build(!e),this},v.suffix=function(t,e){if(this._parts.urn)return void 0===t?"":this;var r,n;if(void 0===t||!0===t)return!this._parts.path||"/"===this._parts.path||-1===(n=(r=this.filename()).lastIndexOf("."))?"":(r=r.substring(n+1),r=/^[a-z0-9%]+$/i.test(r)?r:"",t?d.decodePathSegment(r):r);if("."===t.charAt(0)&&(t=t.substring(1)),r=this.suffix())n=t?new RegExp(s(r)+"$"):new RegExp(s("."+r)+"$");else{if(!t)return this;this._parts.path+="."+d.recodePath(t)}return n&&(t=d.recodePath(t),this._parts.path=this._parts.path.replace(n,t)),this.build(!e),this},v.segment=function(t,e,r){var n=this._parts.urn?":":"/",s="/"===(a=this.path()).substring(0,1),a=a.split(n);if(void 0!==t&&"number"!=typeof t&&(r=e,e=t,t=void 0),void 0!==t&&"number"!=typeof t)throw Error('Bad segment "'+t+'", must be 0-based integer');if(s&&a.shift(),t<0&&(t=Math.max(a.length+t,0)),void 0===e)return void 0===t?a:a[t];if(null===t||void 0===a[t])if(h(e)){a=[],t=0;for(var i=e.length;t<i;t++)(e[t].length||a.length&&a[a.length-1].length)&&(a.length&&!a[a.length-1].length&&a.pop(),a.push(l(e[t])))}else!e&&"string"!=typeof e||(e=l(e),""===a[a.length-1]?a[a.length-1]=e:a.push(e));else e?a[t]=l(e):a.splice(t,1);return s&&a.unshift(""),this.path(a.join(n),r)},v.segmentCoded=function(t,e,r){if("number"!=typeof t&&(r=e,e=t,t=void 0),void 0===e){if(h(t=this.segment(t,e,r)))for(var n=0,s=t.length;n<s;n++)t[n]=d.decode(t[n]);else t=void 0!==t?d.decode(t):void 0;return t}if(h(e))for(n=0,s=e.length;n<s;n++)e[n]=d.encode(e[n]);else e="string"==typeof e||e instanceof String?d.encode(e):e;return this.segment(t,e,r)},v.query);return v.query=function(t,e){var r,n;return!0===t?d.parseQuery(this._parts.query,this._parts.escapeQuerySpace):"function"==typeof t?(r=d.parseQuery(this._parts.query,this._parts.escapeQuerySpace),n=t.call(this,r),this._parts.query=d.buildQuery(n||r,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!e),this):void 0!==t&&"string"!=typeof t?(this._parts.query=d.buildQuery(t,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!e),this):I.call(this,t,e)},v.setQuery=function(t,e,r){var n=d.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("string"==typeof t||t instanceof String)n[t]=void 0!==e?e:null;else{if("object"!=typeof t)throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");for(var s in t)b.call(t,s)&&(n[s]=t[s])}return this._parts.query=d.buildQuery(n,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!(r="string"!=typeof t?e:r)),this},v.addQuery=function(t,e,r){var n=d.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return d.addQuery(n,t,void 0===e?null:e),this._parts.query=d.buildQuery(n,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!(r="string"!=typeof t?e:r)),this},v.removeQuery=function(t,e,r){var n=d.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return d.removeQuery(n,t,e),this._parts.query=d.buildQuery(n,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!(r="string"!=typeof t?e:r)),this},v.hasQuery=function(t,e,r){var n=d.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return d.hasQuery(n,t,e,r)},v.setSearch=v.setQuery,v.addSearch=v.addQuery,v.removeSearch=v.removeQuery,v.hasSearch=v.hasQuery,v.normalize=function(){return(this._parts.urn?this.normalizeProtocol(!1):this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1)).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},v.normalizeProtocol=function(t){return"string"==typeof this._parts.protocol&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!t)),this},v.normalizeHostname=function(t){return this._parts.hostname&&(this.is("IDN")&&o?this._parts.hostname=o.toASCII(this._parts.hostname):this.is("IPv6")&&e&&(this._parts.hostname=e.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!t)),this},v.normalizePort=function(t){return"string"==typeof this._parts.protocol&&this._parts.port===d.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!t)),this},v.normalizePath=function(t){if(r=this._parts.path)if(this._parts.urn)this._parts.path=d.recodeUrnPath(this._parts.path),this.build(!t);else if("/"!==this._parts.path){var e,r,n="";for("/"!==(r=d.recodePath(r)).charAt(0)&&(e=!0,r="/"+r),"/.."!==r.slice(-3)&&"/."!==r.slice(-2)||(r+="/"),r=r.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),e&&(n=(n=r.substring(1).match(/^(\.\.\/)+/)||"")&&n[0]);;){var s,a=r.search(/\/\.\.(\/|$)/);if(-1===a)break;0===a?r=r.substring(3):(-1===(s=r.substring(0,a).lastIndexOf("/"))&&(s=a),r=r.substring(0,s)+r.substring(a+3))}e&&this.is("relative")&&(r=n+r.substring(1)),this._parts.path=r,this.build(!t)}return this},v.normalizePathname=v.normalizePath,v.normalizeQuery=function(t){return"string"==typeof this._parts.query&&(this._parts.query.length?this.query(d.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!t)),this},v.normalizeFragment=function(t){return this._parts.fragment||(this._parts.fragment=null,this.build(!t)),this},v.normalizeSearch=v.normalizeQuery,v.normalizeHash=v.normalizeFragment,v.iso8859=function(){var t=d.encode,e=d.decode;d.encode=escape,d.decode=decodeURIComponent;try{this.normalize()}finally{d.encode=t,d.decode=e}return this},v.unicode=function(){var t=d.encode,e=d.decode;d.encode=f,d.decode=unescape;try{this.normalize()}finally{d.encode=t,d.decode=e}return this},v.readable=function(){var t=this.clone(),e=(t.username("").password("").normalize(),"");if(t._parts.protocol&&(e+=t._parts.protocol+"://"),t._parts.hostname&&(t.is("punycode")&&o?(e+=o.toUnicode(t._parts.hostname),t._parts.port&&(e+=":"+t._parts.port)):e+=t.host()),t._parts.hostname&&t._parts.path&&"/"!==t._parts.path.charAt(0)&&(e+="/"),e+=t.path(!0),t._parts.query){for(var r="",n=0,s=t._parts.query.split("&"),a=s.length;n<a;n++){var i=(s[n]||"").split("=");r+="&"+d.decodeQuery(i[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),void 0!==i[1]&&(r+="="+d.decodeQuery(i[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}e+="?"+r.substring(1)}return e+d.decodeQuery(t.hash(),!0)},v.absoluteTo=function(t){var e,r,n=this.clone(),s=["protocol","username","password","hostname","port"];if(this._parts.urn)throw Error("URNs do not have any generally defined hierarchical components");if(t instanceof d||(t=new d(t)),!n._parts.protocol&&(n._parts.protocol=t._parts.protocol,!this._parts.hostname)){for(e=0;r=s[e];e++)n._parts[r]=t._parts[r];n._parts.path?(".."===n._parts.path.substring(-2)&&(n._parts.path+="/"),"/"!==n.path().charAt(0)&&(s=(s=t.directory())||(0===t.path().indexOf("/")?"/":""),n._parts.path=(s?s+"/":"")+n._parts.path,n.normalizePath())):(n._parts.path=t._parts.path,n._parts.query||(n._parts.query=t._parts.query)),n.build()}return n},v.relativeTo=function(t){var e=this.clone().normalize();if(e._parts.urn)throw Error("URNs do not have any generally defined hierarchical components");t=new d(t).normalize();var r=e._parts,n=t._parts,s=e.path();if(t=t.path(),"/"!==s.charAt(0))throw Error("URI is already relative");if("/"!==t.charAt(0))throw Error("Cannot calculate a URI relative to another relative URI");return r.protocol===n.protocol&&(r.protocol=null),r.username===n.username&&r.password===n.password&&null===r.protocol&&null===r.username&&null===r.password&&r.hostname===n.hostname&&r.port===n.port&&(r.hostname=null,r.port=null,s===t?r.path="":(s=d.commonPath(s,t))&&(n=n.path.substring(s.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../"),r.path=n+r.path.substring(s.length)||"./")),e.build()},v.equals=function(t){var e,r=this.clone(),n=new d(t);if(t={},r.normalize(),n.normalize(),r.toString()!==n.toString()){var s=r.query(),a=n.query();if(r.query(""),n.query(""),r.toString()!==n.toString()||s.length!==a.length)return!1;for(e in r=d.parseQuery(s,this._parts.escapeQuerySpace),a=d.parseQuery(a,this._parts.escapeQuerySpace),r)if(b.call(r,e)){if(h(r[e])){if(!c(r[e],a[e]))return!1}else if(r[e]!==a[e])return!1;t[e]=!0}for(e in a)if(b.call(a,e)&&!t[e])return!1}return!0},v.preventInvalidHostname=function(t){return this._parts.preventInvalidHostname=!!t,this},v.duplicateQueryParameters=function(t){return this._parts.duplicateQueryParameters=!!t,this},v.escapeQuerySpace=function(t){return this._parts.escapeQuerySpace=!!t,this},d}),function(t,e){"object"==typeof module&&module.exports?module.exports=e(require("./URI")):"function"==typeof define&&define.amd?define(["./URI"],e):t.URITemplate=e(t.URI,t)}(this,function(d,t){function f(t){return f._cache[t]||(this instanceof f?(this.expression=t,f._cache[t]=this):new f(t))}function a(t){this.data=t,this.cache={}}var e=t&&t.URITemplate,s=Object.prototype.hasOwnProperty,r=f.prototype,m={"":{prefix:"",separator:",",named:!1,empty_name_separator:!1,encode:"encode"},"+":{prefix:"",separator:",",named:!1,empty_name_separator:!1,encode:"encodeReserved"},"#":{prefix:"#",separator:",",named:!1,empty_name_separator:!1,encode:"encodeReserved"},".":{prefix:".",separator:".",named:!1,empty_name_separator:!1,encode:"encode"},"/":{prefix:"/",separator:"/",named:!1,empty_name_separator:!1,encode:"encode"},";":{prefix:";",separator:";",named:!0,empty_name_separator:!1,encode:"encode"},"?":{prefix:"?",separator:"&",named:!0,empty_name_separator:!0,encode:"encode"},"&":{prefix:"&",separator:"&",named:!0,empty_name_separator:!0,encode:"encode"}};return f._cache={},f.EXPRESSION_PATTERN=/\{([^a-zA-Z0-9%_]?)([^\}]+)(\}|$)/g,f.VARIABLE_PATTERN=/^([^*:.](?:\.?[^*:.])*)((\*)|:(\d+))?$/,f.VARIABLE_NAME_PATTERN=/[^a-zA-Z0-9%_.]/,f.LITERAL_PATTERN=/[<>{}"`^| \\]/,f.expand=function(t,e,r){for(var n,s=m[t.operator],a=s.named?"Named":"Unnamed",i=(t=t.variables,[]),o=0;n=t[o];o++){var h=e.get(n.name);if(0===h.type&&r&&r.strict)throw Error('Missing expansion value for variable "'+n.name+'"');if(h.val.length){if(1<h.type&&n.maxlength)throw Error('Invalid expression: Prefix modifier not applicable to variable "'+n.name+'"');i.push(f["expand"+a](h,s,n.explode,n.explode&&s.separator||",",n.maxlength,n.name))}else h.type&&i.push("")}return i.length?s.prefix+i.join(s.separator):""},f.expandNamed=function(t,e,r,n,s,a){for(var i,o="",h=e.encode,u=(e=e.empty_name_separator,!t[h].length),p=2===t.type?"":d[h](a),c=0,l=t.val.length;c<l;c++)s?(i=d[h](t.val[c][1].substring(0,s)),2===t.type&&(p=d[h](t.val[c][0].substring(0,s)))):u?(i=d[h](t.val[c][1]),2===t.type?(p=d[h](t.val[c][0]),t[h].push([p,i])):t[h].push([void 0,i])):(i=t[h][c][1],2===t.type&&(p=t[h][c][0])),o&&(o+=n),r?o+=p+(e||i?"=":"")+i:(c||(o+=d[h](a)+(e||i?"=":"")),2===t.type&&(o+=p+","),o+=i);return o},f.expandUnnamed=function(t,e,r,n,s){for(var a,i="",o=e.encode,h=(e=e.empty_name_separator,!t[o].length),u=0,p=t.val.length;u<p;u++)s?a=d[o](t.val[u][1].substring(0,s)):h?(a=d[o](t.val[u][1]),t[o].push([2===t.type?d[o](t.val[u][0]):void 0,a])):a=t[o][u][1],i&&(i+=n),2===t.type&&(i+=s?d[o](t.val[u][0].substring(0,s)):t[o][u][0],i=r?i+(e||a?"=":""):i+","),i+=a;return i},f.noConflict=function(){return t.URITemplate===f&&(t.URITemplate=e),f},r.expand=function(t,e){var r="";this.parts&&this.parts.length||this.parse(),t instanceof a||(t=new a(t));for(var n=0,s=this.parts.length;n<s;n++)r+="string"==typeof this.parts[n]?this.parts[n]:f.expand(this.parts[n],t,e);return r},r.parse=function(){function t(t){if(t.match(a))throw Error('Invalid Literal "'+t+'"');return t}var e=this.expression,r=f.EXPRESSION_PATTERN,n=f.VARIABLE_PATTERN,s=f.VARIABLE_NAME_PATTERN,a=f.LITERAL_PATTERN,i=[],o=0;for(r.lastIndex=0;;){var h=r.exec(e);if(null===h){i.push(t(e.substring(o)));break}if(i.push(t(e.substring(o,h.index))),o=h.index+h[0].length,!m[h[1]])throw Error('Unknown Operator "'+h[1]+'" in "'+h[0]+'"');if(!h[3])throw Error('Unclosed Expression "'+h[0]+'"');for(var u=h[2].split(","),p=0,c=u.length;p<c;p++){var l=u[p].match(n);if(null===l)throw Error('Invalid Variable "'+u[p]+'" in "'+h[0]+'"');if(l[1].match(s))throw Error('Invalid Variable Name "'+l[1]+'" in "'+h[0]+'"');u[p]={name:l[1],explode:!!l[3],maxlength:l[4]&&parseInt(l[4],10)}}if(!u.length)throw Error('Expression Missing Variable(s) "'+h[0]+'"');i.push({expression:h[0],operator:h[1],variables:u})}return i.length||i.push(t(e)),this.parts=i,this},a.prototype.get=function(t){var e=this.data,r={type:0,val:[],encode:[],encodeReserved:[]};if(void 0!==this.cache[t])return this.cache[t];if(this.cache[t]=r,null!=(e="[object Function]"===String(Object.prototype.toString.call(e))?e(t):"[object Function]"===String(Object.prototype.toString.call(e[t]))?e[t](t):e[t]))if("[object Array]"===String(Object.prototype.toString.call(e))){var n=0;for(t=e.length;n<t;n++)void 0!==e[n]&&null!==e[n]&&r.val.push([void 0,String(e[n])]);r.val.length&&(r.type=3)}else if("[object Object]"===String(Object.prototype.toString.call(e))){for(n in e)s.call(e,n)&&void 0!==e[n]&&null!==e[n]&&r.val.push([n,String(e[n])]);r.val.length&&(r.type=2)}else r.type=1,r.val.push([void 0,String(e)]);return r},d.expand=function(t,e){t=new f(t).expand(e);return new d(t)},f}),function(t,e){"object"==typeof module&&module.exports?module.exports=e(require("jquery"),require("./URI")):"function"==typeof define&&define.amd?define(["jquery","./URI"],e):e(t.jQuery,t.URI)}(this,function(n,a){function s(t){return t.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function i(t){var e=t.nodeName.toLowerCase();if("input"!==e||"image"===t.type)return a.domAttributes[e]}function o(t,e){var r;return!(!i(t)||!e||!(e=e.match(p))||!e[5]&&":"!==e[2]&&!u[e[2]])&&(t=n(t).uri(),e[5]?t.is(e[5]):":"===e[2]?(r=e[1].toLowerCase()+":",!!u[r]&&u[r](t,e[4])):(r=e[1].toLowerCase(),!!h[r]&&u[e[2]](t[r](),e[4],r)))}function r(t,e){return n(t).uri().href(e).toString()}var h={},u={"=":function(t,e){return t===e},"^=":function(t,e){return!!(t+"").match(new RegExp("^"+s(e),"i"))},"$=":function(t,e){return!!(t+"").match(new RegExp(s(e)+"$","i"))},"*=":function(t,e,r){return"directory"===r&&(t+="/"),!!(t+"").match(new RegExp(s(e),"i"))},"equals:":function(t,e){return t.equals(e)},"is:":function(t,e){return t.is(e)}},p=(n.each("origin authority directory domain filename fragment hash host hostname href password path pathname port protocol query resource scheme search subdomain suffix tld username".split(" "),function(t,e){var r;h[e]=!0,n.attrHooks["uri:"+e]=(r=e,{get:function(t){return n(t).uri()[r]()},set:function(t,e){return n(t).uri()[r](e),e}})}),n.each(["src","href","action","uri","cite"],function(t,e){n.attrHooks[e]={set:r}}),n.attrHooks.uri.get=function(t){return n(t).uri()},n.fn.uri=function(t){var e=this.first(),r=e.get(0),n=i(r);if(!n)throw Error('Element "'+r.nodeName+'" does not have either property: href, src, action, cite');if(void 0!==t){var s=e.data("uri");if(s)return s.href(t);t instanceof a||(t=a(t||""))}else{if(t=e.data("uri"))return t;t=a(e.attr(n)||"")}return t._dom_element=r,t._dom_attribute=n,t.normalize(),e.data("uri",t),t},a.prototype.build=function(t){return this._dom_element?(this._string=a.build(this._parts),this._deferred_build=!1,this._dom_element.setAttribute(this._dom_attribute,this._string),this._dom_element[this._dom_attribute]=this._string):!0===t?this._deferred_build=!0:void 0!==t&&!this._deferred_build||(this._string=a.build(this._parts),this._deferred_build=!1),this},/^([a-zA-Z]+)\s*([\^\$*]?=|:)\s*(['"]?)(.+)\3|^\s*([a-zA-Z0-9]+)\s*$/),t=n.expr.createPseudo?n.expr.createPseudo(function(e){return function(t){return o(t,e)}}):function(t,e,r){return o(t,r[3])};return n.expr[":"].uri=t,n});
$(".quickSaveForRouteAlert").on("click",function(){var e=$("#subscriberRouteName").attr("data-subscriberRouteId"),o=$("#quickRouteNotificationModal #subscriberRouteName").text(),i=0<$(".mapPage").length;$.ajax("/My511/SaveQuickRouteAlert",{data:{routeId:e,routeName:o},type:"POST"}).done(function(){i?AlertHelper.addAlertText(AlertType.Success,window.resources.AlertSavedSuccessfully+" "+window.resources.ViewLinkOnAlertSavedSuccessfully,7e3):window.location.href="/my511"}).fail(function(){AlertHelper.addAlertText(AlertType.Error,window.resources.AlertFailedToSave,7e3)})}),$("#hideSimplifyRouteNotification").on("change",function(){$(this).is(":checked")?Cookies.set("_hideSimplifyRouteNotificationModal",!0):Cookies.remove("_hideSimplifyRouteNotificationModal")}),$("#hideRouteNotification").on("change",function(){$(this).is(":checked")?Cookies.set("_hideRouteNotificationModal",!0):Cookies.remove("_hideRouteNotificationModal")});
