!function(t){const e=t.params,n=(document.querySelector.bind(document),(t,e)=>e.split(".").reduce((t,e)=>t&&t[e],t)),i=()=>null,s=t=>null===t||t===undefined?"":t,o="wc/store/checkout";function a(t){window.wp&&window.wp.data&&window.wp.data.dispatch&&window.wc&&window.wc.wcBlocksData&&window.wp.data.dispatch(window.wc.wcBlocksData.CHECKOUT_STORE_KEY).__internalSetExtensionData("woocommerce/order-attribution",t,!0)}function r(){return"undefined"!=typeof sbjs}function c(){if(window.wp&&window.wp.data&&"function"==typeof window.wp.data.subscribe){const e=window.wp.data.subscribe(function(){e(),a(t.getAttributionData())},o)}}t.getAttributionData=function(){const s=e.allowTracking&&r()?n:i,o=r()?sbjs.get:{},a=Object.entries(t.fields).map(([t,e])=>[t,s(o,e)]);return Object.fromEntries(a)},t.setOrderTracking=function(n){if(e.allowTracking=n,n){if(!r())return;sbjs.init({lifetime:Number(e.lifetime),session_length:Number(e.session),base64:Boolean(e.base64),timezone_offset:"0"})}else!function(){const t=window.location.hostname;["sbjs_current","sbjs_current_add","sbjs_first","sbjs_first_add","sbjs_session","sbjs_udata","sbjs_migrations","sbjs_promo"].forEach(e=>{document.cookie=`${e}=; path=/; max-age=-999; domain=.${t};`})}();const i=t.getAttributionData();!function(t){for(const e of document.querySelectorAll("wc-order-attribution-inputs"))e.values=t}(i),a(i)},t.setOrderTracking(e.allowTracking),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",c):c(),window.customElements.define("wc-order-attribution-inputs",class extends HTMLElement{constructor(){if(super(),this._fieldNames=Object.keys(t.fields),this.hasOwnProperty("_values")){let t=this.values;delete this.values,this.values=t||{}}}connectedCallback(){this.innerHTML="";const t=new DocumentFragment;for(const n of this._fieldNames){const i=document.createElement("input");i.type="hidden",i.name=`${e.prefix}${n}`,i.value=s(this.values&&this.values[n]||""),t.appendChild(i)}this.appendChild(t)}set values(t){if(this._values=t,this.isConnected)for(const t of this._fieldNames){const n=this.querySelector(`input[name="${e.prefix}${t}"]`);n?n.value=s(this.values[t]):console.warn(`Field "${t}" not found. `+"Most likely, the '<wc-order-attribution-inputs>' element was manipulated.")}}get values(){return this._values}})}(window.wc_order_attribution);;
;function initMap(){var e=new google.maps.LatLngBounds,m=new google.maps.InfoWindow,f=new google.maps.Map(document.getElementById("dealerMap"),{zoom:4});let h=[];for(let d=0,g=dealers.length;d<g;d++){var k=new google.maps.Marker({title:dealers[d].title,position:{lat:parseFloat(dealers[d].lat),lng:parseFloat(dealers[d].lng)},map:f});e.extend(k.position);google.maps.event.addListener(k,"click",function(c,a){return function(){let b="";dealers[a].image&&(b+='<img src="'+dealers[a].image+'" style="width:100%">');
b+='<h3 style="margin-top: 5px">'+dealers[a].title+"</h3>";b+="<p><strong>Address</strong><br/>"+dealers[a].address+"</p>";""!=dealers[a].phone&&(b+='<p><strong>Phone</strong><br/><a href="tel:'+dealers[a].phone+'">'+dealers[a].phone+"</a></p>");""!=dealers[a].email&&(b+='<p><strong>Email</strong><br/><a href="mailto:'+dealers[a].email+'">'+dealers[a].email+"</a></p>");""!=dealers[a].website&&(b+='<p><strong>Website</strong><br/><a href="'+dealers[a].website+'" target="_blank">'+dealers[a].website+
"</a></p>");m.setContent(b);m.open(f,c)}}(k,d));h.push(k)}f.fitBounds(e);e=document.getElementById("searchDealerLocation");let l=new google.maps.places.SearchBox(e);f.addListener("bounds_changed",function(){l.setBounds(f.getBounds())});l.addListener("places_changed",function(){var d=l.getPlaces();if(0!=d.length){var g=new google.maps.LatLngBounds;d.forEach(function(c){if(c.geometry){c.geometry.viewport?g.union(c.geometry.viewport):g.extend(c.geometry.location);c=c.geometry.location;var a=[],b=-1;
for(i=0;i<h.length;i++){var n=google.maps.geometry.spherical.computeDistanceBetween(h[i].position,c);a[i]=n;if(-1==b||n<a[b])b=i}c=-1==b?!1:h[b];c&&g.extend(c.position)}else console.log("Returned place contains no geometry")});f.fitBounds(g)}})}document.addEventListener("DOMContentLoaded",function(){let e=document.createElement("script");e.src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCfFQj82nXHu_-BN2RrA1Tvh9gjfr_t-Kw&callback=initMap&libraries=places,geometry";document.head.appendChild(e)});
;