"remove"in Element.prototype||(Element.prototype.remove=function(){this.parentNode&&this.parentNode.removeChild(this)}),mapboxgl.accessToken="pk.eyJ1IjoicmljaHRvbmFsIiwiYSI6ImNrb2xvN2R5azA2YWkycW5yc2o4ZDBlejEifQ.I2ebtMKBHEzbzukcHpsCLw";const mapContainer=document.getElementById("locationMap"),map=new mapboxgl.Map({container:"locationMap",style:"mapbox://styles/mapbox/light-v10",center:[-98.138577,38.339018],zoom:2,scrollZoom:!1});var geocoderSearchParams,location_states={},layerIDs=[],clickedlocationId=null,clickedLocation=null;function mapSetPointer(){map.getCanvas().style.cursor="pointer"}function mapRemovePointer(){map.getCanvas().style.cursor=""}function cleanLocationJson(e){var t=e.map((function(e){return e.properties.loc_id})),o=locations.features.filter((function(e){return t.indexOf(e.properties.loc_id)>=0}));if(geocoderSearchParams&&"region"===geocoderSearchParams.place_type[0]){var a=geocoderSearchParams.properties.short_code.replace("US-","");o=locations.features.filter((function(e){return t.indexOf(e.properties.loc_id)>=0&&e.properties.state===a}))}return o}function getBbox(e,t){var o=new mapboxgl.LngLat(t.coordinates[0],t.coordinates[1]),a=new mapboxgl.LngLatBounds(o,o);for(let t of e)a.extend([t.geometry.coordinates[0],t.geometry.coordinates[1]]);return a}function buildLocationList(e){var t=document.getElementById("locationListings");t.innerHTML="";var o=document.querySelector(".no-locations"),a=document.getElementById("numLocations"),n=a.querySelector(".locTotal");if(e){e.forEach((function(e,o){var a=t.appendChild(document.createElement("li"));a.className="item",buildLocationDetails(e,a)})),o.classList.add("d-none");var r=1===e.length?" Result":" Results";n.textContent=e.length+r,a.classList.remove("invisible")}else o.classList.remove("d-none"),n.textContent="0 Results",a.classList.remove("invisible")}function buildLocationDetails(e,t){var o=e.properties,a=o.distance,n=t.appendChild(document.createElement("h3"));n.className="title-location",n.textContent=o.title;var r=n.appendChild(document.createElement("small"));r.className="d-block";var i="Showroom"===o.type?"Tonal Showroom":"Nordstrom Partnership Location";if(r.textContent=i,void 0!==a){var s=t.appendChild(document.createElement("p"));s.className="location-distance",s.textContent="<"+a.toFixed(1)+" mi"}var l=t.appendChild(document.createElement("div"));l.className="location-deets",l.innerHTML='

'+o.address+"
"+o.city+", "+o.state+" "+o.postalCode+"

";var c=getOpenClosed(o),d=c.status,p=c.status_text;if(d){var u=l.appendChild(document.createElement("p"));u.className="location-hours","closed"===d?u.classList.add("location-closed"):"closing-soon"===d?u.classList.add("location-closing"):u.classList.add("location-open"),u.innerHTML=p}var m=l.appendChild(document.createElement("a"));m.href=o.url,m.textContent="Book Now",m.className="link-border",m.addEventListener("click",(function(){rudderanalytics.track("Location Search - Store Location",{location:o.title,"page url":jQuery(e).attr("href"),device:device,destination:o.url})}))}function flyTolocation(e){map.flyTo({center:e.geometry.coordinates,zoom:13}),map.once("moveend","places",(function(e){map.flyTo({center:e.features[0].geometry.coordinates,zoom:15})}))}function createPopUp(e){var t=document.getElementsByClassName("mapboxgl-popup");t[0]&&t[0].remove(),new mapboxgl.Popup({anchor:"top",closeOnClick:!1,className:"text-dark with-results",maxWidth:"313px"}).setLngLat(e.geometry.coordinates).setHTML('

'+e.properties.title+'

'+e.properties.address+"
"+e.properties.city+"
"+e.properties.state+" "+e.properties.postalCode+'

More Info
').addTo(map).on("close",(function(t){clickedlocationId=e.id,map.setFeatureState({source:"places",id:clickedlocationId},{clicked:!1})}));var o=jQuery("#locationMap").find(".btn");o.map((function(t){o[t].addEventListener("click",(function(){const a=bsGetContainer("#locationMap");rudderanalytics.track("Clicked Marketing CTA",{type:"button",location:e.properties.title,"page url":jQuery(location).attr("href"),destination:jQuery(o[t]).attr("href"),device:device,"site section":a.section})}))}))}function getUniqueFeatures(e,t){var o={};return e.filter((function(e){return!o[e.properties[t]]&&(o[e.properties[t]]=!0,!0)}))}function getOpenClosed(e){var t,o,a=e.timezone,n=e.open;if(""!==a){t="closed",o="Closed";var r=new Date,i=new Date(r.toLocaleString("en-US",{timeZone:a})),s=i.getDay(),l=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][s],c=Object.values(e.hours),d=c[s].open,p=c[s].close;!0!==n&&(t="closed",o="Temporarily Closed");var u=e.url.split("/");if(!0!==n&&"boston-seaport"===u[4])o="Coming Soon";else if("closed"===d||"closed"===p)o="Closed • Closed on "+l+"s";else{var m=p.split(":")[0],f=m>12?m-12:m,g=m>=12?"PM":"AM",y=parseInt(i.getHours()),v=y+":"+i.getMinutes(),h=m>y?m-y:0;v>=d&&vOpen • Closes at "+f+" "+g),h>0&&h<=1&&(t="closing-soon",o="Closing Soon • Closes at "+f+" "+g)}}return{status:t,status_text:o}}locations.features.forEach((function(e){location_states[e.properties.state]=e.properties.state_full;var t=e.properties.type;if(""!=t){var o="layer"+t;-1===layerIDs.indexOf(o)&&layerIDs.push(o)}})),map.on("load",(function(e){const t=window.device;map.addSource("places",{type:"geojson",data:locations});for(let e of layerIDs){var o=e.replace("layer","");map.getLayer(e)||map.addLayer({id:e,type:"circle",source:"places",filter:["==","type",o],paint:{"circle-color":["case",["boolean",["feature-state","clicked"],!1],"#413939","#11DDC4"],"circle-radius":["interpolate",["linear"],["zoom"],5,5,11,10],"circle-stroke-width":1,"circle-stroke-color":"#fff"}}),map.on("click",e,(function(e){e.features.length>0&&(null!==clickedlocationId&&map.setFeatureState({source:"places",id:clickedlocationId},{clicked:!1}),clickedLocation=e.features[0],clickedlocationId=e.features[0].id,map.setFeatureState({source:"places",id:clickedlocationId},{clicked:!0}),rudderanalytics.track("Clicked Location Point On Map",{type:"button",location:e.features[0].properties.title,"page url":jQuery(location).attr("href"),device:t}),flyTolocation(e.features[0]))})),map.on("mouseenter",e,mapSetPointer),map.on("mouseleave",e,mapRemovePointer)}var a=new mapboxgl.NavigationControl;map.addControl(a,"top-right"),map.addControl(new mapboxgl.GeolocateControl({positionOptions:{enableHighAccuracy:!0},trackUserLocation:!0}),"bottom-right");var n=new MapboxGeocoder({accessToken:mapboxgl.accessToken,countries:"US",mapboxgl:mapboxgl,marker:!1,placeholder:"Enter city or zip",types:"postcode, place, region"}),r=document.getElementById("geocoder");r.appendChild(n.onAdd(map));var i=r.querySelector(".mapboxgl-ctrl-geocoder--input");i.setAttribute("autocomplete","new-locationsearch");var s=null;n.on("result",(function(e){null!==s&&s.remove(),mapContainer.classList.contains("no-results")&&mapContainer.classList.remove("no-results");var o=e.result.geometry;rudderanalytics.track("Location Search",{location:e.result.place_name,"page url":jQuery(location).attr("href"),device:t});var a,n={units:"miles"};if(locations.features.forEach((function(e){Object.defineProperty(e.properties,"distance",{value:turf.distance(o,e.geometry,n),writable:!0,enumerable:!0,configurable:!0})})),locations.features.sort((function(e,t){return e.properties.distance>t.properties.distance?1:e.properties.distanceNo results found for '"+c+"'").addTo(map),mapContainer.classList.add("no-results"),s.on("close",(function(e){mapContainer.classList.remove("no-results")})),l.classList.remove("d-none")}else{l.classList.add("d-none");var d=getBbox(a,o);map.fitBounds(d,{padding:100})}ww1?(t.stopImmediatePropagation(),map.dragPan.enable()):map.dragPan.disable())})),window.queryMaponChange=function(e){var t=getUniqueFeatures(map.queryRenderedFeatures({layers:layerIDs}),"loc_id");t.length?("all"!==e&&(t=t.filter((function(t){return t.properties.type===e}))),buildLocationList(cleanLocationJson(t))):buildLocationList()};var dropdownFilterMenu=document.getElementById("dropdownFilterMenu"),dropdownFilterBtns=dropdownFilterMenu.querySelectorAll("button");dropdownFilterBtns.forEach((function(e){e.addEventListener("click",(function(){var e=this.dataset.type;dropdownFilterBtns.forEach((function(e){e.classList.remove("active")})),this.classList.add("active");for(let t of layerIDs)"all"!==e?map.setLayoutProperty(t,"visibility",t.includes(e)?"visible":"none"):map.setLayoutProperty(t,"visibility","visible");setTimeout((function(){queryMaponChange(e)}),100)}))})),jQuery((function(e){e(".overlay-full").on("show.bs.collapse",(function(t){e("body").addClass("overlay-open")})),e(".overlay-full").on("shown.bs.collapse",(function(e){var t=e.target,o=t.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),a=o[0];a.focus();var n=o[o.length-1];t.addEventListener("keydown",(function(e){("Tab"===e.key||9===e.keyCode)&&(e.shiftKey?document.activeElement===a&&(n.focus(),e.preventDefault()):document.activeElement===n&&(a.focus(),e.preventDefault()))}))})),e("#locationStates").on("hide.bs.collapse",(function(t){e("body").removeClass("overlay-open"),t.target.blur()})),e('button[data-target="#locationStates"]').on("click",(function(t){rudderanalytics.track("Location Selected Tonal Directory",{"page url":e(location).attr("href"),device:device})})),e("#dropdownFilterMenu").on("show.bs.collapse",(function(e){e.target.parentElement.querySelector('[data-target="#dropdownFilterMenu"]').textContent="Filter –"})),e("#dropdownFilterMenu").on("hide.bs.collapse",(function(e){e.target.parentElement.querySelector('[data-target="#dropdownFilterMenu"]').textContent="Filter +"}))}));var toggleResultsBtn=document.querySelectorAll(".nav-results-toggle button");toggleResultsBtn.forEach((function(e){e.addEventListener("click",(function(){var e=document.getElementById(this.dataset.target),t=document.getElementById(this.dataset.hide),o=[],a=this.parentNode.parentNode.firstElementChild;do{a!=this&&o.push(a.firstElementChild)}while(a=a.nextElementSibling);o.forEach((function(e){e.ariaExpanded=!1})),this.ariaExpanded=!0,e.classList.contains("show")||e.classList.add("show"),t&&t.classList.contains("show")&&t.classList.remove("show")}))}));; !function(t){var n={};function r(e){if(n[e])return n[e].exports;var o=n[e]={i:e,l:!1,exports:{}};return t[e].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=t,r.c=n,r.d=function(t,n,e){r.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:e})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,n){if(1&n&&(t=r(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var e=Object.create(null);if(r.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var o in t)r.d(e,o,function(n){return t[n]}.bind(null,o));return e},r.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(n,"a",n),n},r.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},r.p="/dist/",r(r.s=121)}([function(t,n,r){var e=r(30),o=r(2),i=r(39),u=r(6).f;t.exports=function(t){var n=e.Symbol||(e.Symbol={});o(n,t)||u(n,t,{value:i.f(t)})}},function(t,n,r){(function(n){var r=function(t){return t&&t.Math==Math&&t};t.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n&&n)||Function("return this")()}).call(this,r(69))},function(t,n){var r={}.hasOwnProperty;t.exports=function(t,n){return r.call(t,n)}},function(t,n,r){var e=r(1),o=r(28),i=r(2),u=r(29),c=r(36),f=r(53),a=o("wks"),s=e.Symbol,l=f?s:s&&s.withoutSetter||u;t.exports=function(t){return i(a,t)||(c&&i(s,t)?a[t]=s[t]:a[t]=l("Symbol."+t)),a[t]}},function(t,n){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,n){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,n,r){var e=r(9),o=r(45),i=r(11),u=r(15),c=Object.defineProperty;n.f=e?c:function(t,n,r){if(i(t),n=u(n,!0),i(r),o)try{return c(t,n,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(t[n]=r.value),t}},,function(t,n,r){var e=r(9),o=r(6),i=r(12);t.exports=e?function(t,n,r){return o.f(t,n,i(1,r))}:function(t,n,r){return t[n]=r,t}},function(t,n,r){var e=r(4);t.exports=!e((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},function(t,n,r){var e=r(44),o=r(26);t.exports=function(t){return e(o(t))}},function(t,n,r){var e=r(5);t.exports=function(t){if(!e(t))throw TypeError(String(t)+" is not an object");return t}},function(t,n){t.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},function(t,n,r){var e=r(6).f,o=r(2),i=r(3)("toStringTag");t.exports=function(t,n,r){t&&!o(t=r?t:t.prototype,i)&&e(t,i,{configurable:!0,value:n})}},function(t,n,r){var e=r(1),o=r(24).f,i=r(8),u=r(16),c=r(27),f=r(49),a=r(74);t.exports=function(t,n){var r,s,l,p,v,y=t.target,d=t.global,h=t.stat;if(r=d?e:h?e[y]||c(y,{}):(e[y]||{}).prototype)for(s in n){if(p=n[s],l=t.noTargetGet?(v=o(r,s))&&v.value:r[s],!a(d?s:y+(h?".":"#")+s,t.forced)&&void 0!==l){if(typeof p==typeof l)continue;f(p,l)}(t.sham||l&&l.sham)&&i(p,"sham",!0),u(r,s,p,t)}}},function(t,n,r){var e=r(5);t.exports=function(t,n){if(!e(t))return t;var r,o;if(n&&"function"==typeof(r=t.toString)&&!e(o=r.call(t)))return o;if("function"==typeof(r=t.valueOf)&&!e(o=r.call(t)))return o;if(!n&&"function"==typeof(r=t.toString)&&!e(o=r.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,n,r){var e=r(1),o=r(8),i=r(2),u=r(27),c=r(47),f=r(17),a=f.get,s=f.enforce,l=String(String).split("String");(t.exports=function(t,n,r,c){var f=!!c&&!!c.unsafe,a=!!c&&!!c.enumerable,p=!!c&&!!c.noTargetGet;"function"==typeof r&&("string"!=typeof n||i(r,"name")||o(r,"name",n),s(r).source=l.join("string"==typeof n?n:"")),t!==e?(f?!p&&t[n]&&(a=!0):delete t[n],a?t[n]=r:o(t,n,r)):a?t[n]=r:u(n,r)})(Function.prototype,"toString",(function(){return"function"==typeof this&&a(this).source||c(this)}))},function(t,n,r){var e,o,i,u=r(70),c=r(1),f=r(5),a=r(8),s=r(2),l=r(18),p=r(20),v=c.WeakMap;if(u){var y=new v,d=y.get,h=y.has,g=y.set;e=function(t,n){return g.call(y,t,n),n},o=function(t){return d.call(y,t)||{}},i=function(t){return h.call(y,t)}}else{var b=l("state");p[b]=!0,e=function(t,n){return a(t,b,n),n},o=function(t){return s(t,b)?t[b]:{}},i=function(t){return s(t,b)}}t.exports={set:e,get:o,has:i,enforce:function(t){return i(t)?o(t):e(t,{})},getterFor:function(t){return function(n){var r;if(!f(n)||(r=o(n)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return r}}}},function(t,n,r){var e=r(28),o=r(29),i=e("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},function(t,n){t.exports=!1},function(t,n){t.exports={}},function(t,n,r){var e=r(30),o=r(1),i=function(t){return"function"==typeof t?t:void 0};t.exports=function(t,n){return arguments.length<2?i(e[t])||i(o[t]):e[t]&&e[t][n]||o[t]&&o[t][n]}},function(t,n,r){var e=r(26);t.exports=function(t){return Object(e(t))}},,function(t,n,r){var e=r(9),o=r(43),i=r(12),u=r(10),c=r(15),f=r(2),a=r(45),s=Object.getOwnPropertyDescriptor;n.f=e?s:function(t,n){if(t=u(t),n=c(n,!0),a)try{return s(t,n)}catch(t){}if(f(t,n))return i(!o.f.call(t,n),t[n])}},function(t,n){var r={}.toString;t.exports=function(t){return r.call(t).slice(8,-1)}},function(t,n){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,n,r){var e=r(1),o=r(8);t.exports=function(t,n){try{o(e,t,n)}catch(r){e[t]=n}return n}},function(t,n,r){var e=r(19),o=r(48);(t.exports=function(t,n){return o[t]||(o[t]=void 0!==n?n:{})})("versions",[]).push({version:"3.6.4",mode:e?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},function(t,n){var r=0,e=Math.random();t.exports=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++r+e).toString(36)}},function(t,n,r){var e=r(1);t.exports=e},function(t,n,r){var e=r(50),o=r(34).concat("length","prototype");n.f=Object.getOwnPropertyNames||function(t){return e(t,o)}},function(t,n,r){var e=r(33),o=Math.min;t.exports=function(t){return t>0?o(e(t),9007199254740991):0}},function(t,n){var r=Math.ceil,e=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?e:r)(t)}},function(t,n){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(t,n,r){var e=r(25);t.exports=Array.isArray||function(t){return"Array"==e(t)}},function(t,n,r){var e=r(4);t.exports=!!Object.getOwnPropertySymbols&&!e((function(){return!String(Symbol())}))},function(t,n,r){var e={};e[r(3)("toStringTag")]="z",t.exports="[object z]"===String(e)},function(t,n,r){var e,o=r(11),i=r(82),u=r(34),c=r(20),f=r(83),a=r(46),s=r(18),l=s("IE_PROTO"),p=function(){},v=function(t){return"