var VM;(function(n){function i(n,t){for(var i=window,r=(n||"").split(".");i&&r.length;)i=i[r.shift()];return typeof i=="function"?i:(t.push(n),Function.constructor.apply(null,t))}function u(n){return n==="GET"||n==="POST"}function o(n,t){u(t)||n.setRequestHeader("X-HTTP-Method-Override",t)}function s(t,i,r){var u;r.indexOf("application/x-javascript")===-1&&(u=(t.getAttribute("data-ajax-mode")||"").toUpperCase(),n(t.getAttribute("data-ajax-update")).each(function(t,r){var f;switch(u){case"BEFORE":f=r.firstChild;n("
").html(i).contents().each(function(){r.insertBefore(this,f)});break;case"AFTER":n("
").html(i).contents().each(function(){r.appendChild(this)});break;case"REPLACE-WITH":n(r).replaceWith(i);break;default:n(r).html(i)}}))}function f(t,r){var e,h,f,c;(e=t.getAttribute("data-ajax-confirm"),!e||window.confirm(e))&&(h=n(t.getAttribute("data-ajax-loading")),c=parseInt(t.getAttribute("data-ajax-loading-duration"),10)||0,n.extend(r,{type:t.getAttribute("data-ajax-method")||undefined,url:t.getAttribute("data-ajax-url")||undefined,cache:!!t.getAttribute("data-ajax-cache"),beforeSend:function(n){var r;return o(n,f),r=i(t.getAttribute("data-ajax-begin"),["xhr"]).apply(t,arguments),r!==!1&&h.show(c),r},complete:function(){h.hide(c);i(t.getAttribute("data-ajax-complete"),["xhr","status"]).apply(t,arguments)},success:function(n,r,u){s(t,n,u.getResponseHeader("Content-Type")||"text/html");i(t.getAttribute("data-ajax-success"),["data","status","xhr"]).apply(t,arguments)},error:function(){i(t.getAttribute("data-ajax-failure"),["xhr","status","error"]).apply(t,arguments)}}),r.data.push({name:"X-Requested-With",value:"XMLHttpRequest"}),f=r.type.toUpperCase(),u(f)||(r.type="POST",r.data.push({name:"X-HTTP-Method-Override",value:f})),n.ajax(r))}function h(t){var i=n(t).data(e);return!i||!i.validate||i.validate()}var t="unobtrusiveAjaxClick",r="unobtrusiveAjaxClickTarget",e="unobtrusiveValidation";n(document).on("click","a[data-ajax=true]",function(n){n.preventDefault();f(this,{url:this.href,type:"GET",data:[]})});n(document).on("click","form[data-ajax=true] input[type=image]",function(i){var r=i.target.name,u=n(i.target),f=n(u.parents("form")[0]),e=u.offset();f.data(t,[{name:r+".x",value:Math.round(i.pageX-e.left)},{name:r+".y",value:Math.round(i.pageY-e.top)}]);setTimeout(function(){f.removeData(t)},0)});n(document).on("click","form[data-ajax=true] :submit",function(i){var f=i.currentTarget.name,e=n(i.target),u=n(e.parents("form")[0]);u.data(t,f?[{name:f,value:i.currentTarget.value}]:[]);u.data(r,e);setTimeout(function(){u.removeData(t);u.removeData(r)},0)});n(document).on("submit","form[data-ajax=true]",function(i){var e=n(this).data(t)||[],u=n(this).data(r),o=u&&u.hasClass("cancel");(i.preventDefault(),o||h(this))&&f(this,{url:this.action,type:this.method||"GET",data:e.concat(n(this).serializeArray())})})})(jQuery),function(n){n.fn.mapper=function(i){var u=n.extend({locationSelector:".mapper-location",extendedLocationSelector:".mapper-location-extended",latSelector:".mapper-lat",lngSelector:".mapper-lng",mapSelector:".mapper-map",geoSearchSelector:".mapper-geo-search",geoMapSelector:".mapper-geo-map",geoCurrentSelector:".mapper-geo-current",geoFieldsSelector:".mapper-geo-fields",geoRemoveSelector:".mapper-geo-remove"},i),r=new t(u,new google.maps.Geocoder);return this.each(function(){var t=n(this);t.on("click",r.settings.geoCurrentSelector,function(){r.getCurrentLocation(t)});t.on("click",r.settings.geoMapSelector,function(){r.toggleMap(t)});t.on("click",r.settings.geoSearchSelector,function(){r.findAddress(t)});t.on("click",r.settings.geoFieldsSelector,function(){r.findAddressFields(t,n(this))});t.on("click",r.settings.geoRemoveSelector,function(){r.removeLocation(t)});t.on("keypress",r.settings.locationSelector,function(n){n.which===13&&(n.preventDefault(),r.findAddress(t))})})};var t=function(n,t){this.settings=n;this.geocoder=t};t.prototype.initializeMap=function(n,t){var r=this,u={zoom:14,center:t},f=n.find(this.settings.mapSelector),i=new google.maps.Map(f[0],u);return n.data("mapper-map",i),google.maps.event.addListener(i,"click",function(t){r.setLocation(n,t.latLng)}),i};t.prototype.getStartingLatLng=function(t){var i=(t.find(this.settings.locationSelector).val()||"").split(",");return i.length===2?new google.maps.LatLng(n.trim(parseFloat(i[0])),parseFloat(n.trim(i[1]))):new google.maps.LatLng(49.4058667,-94.1154454)};t.prototype.getCurrentLocation=function(n){var t=this;navigator.geolocation?navigator.geolocation.getCurrentPosition(function(i){t.setLocation(n,new google.maps.LatLng(i.coords.latitude,i.coords.longitude))},function(){}):alert("Your browser does not support geolocation services.")};t.prototype.removeLocation=function(n){n.find(this.settings.mapSelector).addClass("hidden");this.setMarker(n,null);this.setField(n,null)};t.prototype.toggleMap=function(n){var t=n.find(this.settings.mapSelector);t.hasClass("hidden")?this.setLocation(n):t.addClass("hidden")};t.prototype.getMap=function(n){var t=n.data("mapper-map");return t||(t=this.initializeMap(n,this.getStartingLatLng(n))),t};t.prototype.setMarker=function(n,t){var i=n.data("mapper-marker");return i&&i.setMap(null),t&&(i=new google.maps.Marker({map:this.getMap(n),position:t}),n.data("mapper-marker",i)),i};t.prototype.findAddress=function(n){this.geocodeAddress(n,n.find(this.settings.locationSelector).val())};t.prototype.findAddressFields=function(t,i){for(var u=i.data("fields").split(","),f="",r=0;rn.types.includes("sublocality")?!0:n.types.includes("locality")?!0:n.types.includes("administrative_area_level_1")?!0:!1).map(n=>n.long_name);n.val(i.join(", "))}}(jQuery);VM=VM||{};VM.LinkManager={initialized:null,$links:null,$form:null,init:function(){this.initialized=!0;this.$links=$("#link-list").on("click",".link-delete",this.onLinkDelete);this.$form=this.$links.closest("form");$("#link-add").click(this.onLinkAdd);this.checkVisibility();this.excludeOptions()},excludeOptions:function(){for(var t=(this.$links.attr("data-exclude")||"").split(","),n=0;n tr").length;this.$links.toggleClass("hidden",n<=1)}};$(function(){VM.LinkManager.initialized!=!0&&VM.LinkManager.init()});VM=VM||{};VM.Category={$catList:null,init:function(){VM.$body.find(".toggle").removeClass("hidden").click(this.onToggle);var n=$("#advs-form");n.length&&(n.hasClass("nocollapse")?$("[aria-controls='advs-form']").find(".caret").addClass("opened"):n.addClass("hidden"))},onToggle:function(n){var t,i,r;n.preventDefault();t=$(this);t.hasClass("caret")&&(t=t.closest(".toggle"));window.setTimeout(function(){t.addClass("ga-off")},100);i=$("#"+t.attr("aria-controls"));$(".toggle .opened").length>0&&(t.addClass("clicked"),$(".toggle .caret.opened").each(function(){var n=$(this).closest(".toggle"),t,i;n.hasClass("clicked")||(t=$(this),i=$("#"+n.attr("aria-controls")),t.removeClass("opened"),n.attr("aria-expanded","false"),i.addClass("hidden").removeClass("hidden-mobile"))}),t.removeClass("clicked"));i.length&&(r=t.find(".caret"),i.css("display")==="none"?(i.removeClass("hidden").removeClass("hidden-mobile"),r.addClass("opened"),t.attr("aria-expanded","true")):(i.addClass("hidden").removeClass("hidden-mobile"),r.removeClass("opened"),t.attr("aria-expanded","false")),i.hasClass("nowoc")||i.toggleClass("woc"))}};$(function(){VM.Category.init();window.onclick=function(n){var t=$(n.target);t.hasClass("toggle")||t.parent().hasClass("toggle")||$(".woc").addClass("hidden").removeClass("woc").each(function(){$("[aria-controls='"+this.id+"']").find(".caret").removeClass("opened")})}});VM=VM||{};VM.AddressAutocomplete=function(n,t,i){var u,r;this.$field=n;this.$container=t;this.callback=i;this.autocomplete=new google.maps.places.Autocomplete(n[0]);n.data("restrict")&&(u=n.data("restrict").split(","),this.autocomplete.setComponentRestrictions({country:u}));this.autocomplete.setTypes(["geocode"]);setTimeout(function(){n.attr("autocomplete","disabled")},300);r=this;this.autocomplete.addListener("place_changed",function(){r.onAddressChanged(r.callback)})};VM.AddressAutocomplete.prototype.onAddressChanged=function(n){var t=this.autocomplete.getPlace(),i=$("
"+t.adr_address+"<\/div>"),r=this.getAutocompleteName(t.address_components,"administrative_area_level_1","long_name"),u=this.getAutocompleteName(t.address_components,"administrative_area_level_1","short_name"),f=this.getAutocompleteName(t.address_components,"country","long_name");this.$field.val(i.find(".street-address").text());this.$container.find(".address-city").val(i.find(".locality").text());this.$container.find(".address-postal").val(i.find(".postal-code").text());this.$container.find(".address-provinceid").find("option[value='"+u+"']").prop("selected",!0);this.$container.find(".address-province").val(r);this.$container.find(".address-countryid").find("option:contains('"+f+"')").prop("selected",!0);this.$container.find(".address-lat").val(t.geometry.location.lat());this.$container.find(".address-lng").val(t.geometry.location.lng());this.$container.find(".mapper-location").val(t.geometry.location.lat()+", "+t.geometry.location.lng());typeof n=="function"&&n(this.$container)};VM.AddressAutocomplete.prototype.getAutocompleteName=function(n,t,i){for(var u,f,r=0;r1&&$(".confirm-location-delete").removeClass("hidden");var n=$(this).closest(".card-body"),u=n.data("id"),s=n.find("h3").data("name"),h=n.find(".phone").html(),c=n.find(".tollfree").html(),l=n.find(".address").html(),a=n.find(".address2").html(),v=n.find(".city").html(),y=n.find(".province").html(),p=n.find(".postal").html(),f=n.data("lat"),e=n.data("lng"),i=[];for(n.find(".hour-row").each(function(){i.push({day:$(this).data("day"),hours:$(this).data("hours")})}),$("#newLocation_LocationId").val(u),$(".confirm-location-delete").data("locationid",u),$("#newLocation_Name").val(s),$("#newLocation_Phone").val(h),$("#newLocation_TollFree").val(c),$("#newLocation_Address").val(l),$("#newLocation_Address2").val(a),$("#newLocation_City").val(v),$("#newLocation_Province").val(y),$("#newLocation_Postal").val(p),$(".mapper-map").addClass("hidden"),f!=""&&e!=""?$("#newLocation_Location").val(f+", "+e):$("#newLocation_Location").val(""),$(".hours-list .hour-added").remove(),t=0;t()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/)||(n.addClass("field-validation-error"),t.prop("disabled",!1).removeClass("loading"))},onSuccessUpgradeRequest:function(){$("#upgrade-email").val("");VM.Ajax.toast("Your request was sent successfully.","success")},onReportClick:function(){var n=VM.BusinessManager.reportBaseUrl+encodeURIComponent($.trim($(this).data("name"))+'"}'),t='

Report: '+$(this).data("name")+'<\/h2>