1"use strict";(self.webpackChunkwp_store_locator=self.webpackChunkwp_store_locator||[]).push([["frontend/js/maps/wpsl-osm-js"],{9307(e,t,r){r.d(t,{F:()=>m});var o=r(3825),a=r(2210),n=r(979),i=r(7190),s=r(8279),l=r(7184),c=r(6533),u=r(3008),p=r(5260);function d(e){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d(e)}var m={geocoding:{allowedQueryTypes:["street","city","county","state","country","postcode"],getLatLng:function(){var e=this,t=jQuery("#wpsl-search-input").val().trim(),r="postcode"===a.$.api.types?"postcode":"";c.R.add();var o=s.$.current(function(){return!0});u.B.getResponse(t,r,function(t){if(o())if(null===t||jQuery.isEmptyObject(t)){c.R.remove();var r={userNotice:wpslLabels.noResults};l.L.maybeShowResponseText(r)}else if(!1===t.success&&t.userNotice){c.R.remove();var a={userNotice:wpslLabels[t.userNotice]||t.userNotice};l.L.maybeShowResponseText(a)}else if(t[0])e.processResponse(t);else{c.R.remove();var n={userNotice:wpslLabels.noResults};l.L.maybeShowResponseText(n)}})},processResponse:function(e){var t=e[0],r={lat:t.lat,lng:t.lon};a.O.skipReverseGeocode=!0,r=i._.search.maybeGetFullSearchData(r,t),r=i._.search.processGeocodeResponse(r,e),s.$.prepare(r)},reverse:function(e,t){var r,a;"object"===d(e.latLng)&&"function"==typeof e.latLng.lat?(r=e.latLng.lat(),a=e.latLng.lng()):(r=e.lat,a=e.lng);var n={format:"json",lat:r,lon:a,addressdetails:"1"};o.UJ.osm.geocode(wp.hooks.applyFilters("wpslGeocodeParam",n),function(r){void 0!==r.lat&&r.lat&&void 0!==r.lon&&r.lon?(e=l.L.reverseGeocodeFinished(e,r),t(e)):l.L.reverseGeocodeFailed(e,r,t)})},filterResponse:function(e,t){var r,o=["suburb","town","city","village"],a={};if("object"===d(e[0])&&(e=e[0]),t)switch(t){case"country":a.countryCode=e.address.country_code,a.country=e.address.country;break;case"formatted_address":for(var n=["city","village","town"],i={road:"",house_number:"",postcode:"",location:"",country:""},s=0,l=Object.keys(e.address);s<l.length;s++){var c=l[s];!i.location&&n.includes(c)&&(i.location=e.address[c]),i.hasOwnProperty(c)&&(i[c]=e.address[c])}i.house_number&&(i.road=i.road+" "+i.house_number,i.house_number="");for(var u=[],p=0,m=["road","house_number","postcode","location","country"];p<m.length;p++){var f=m[p];""!==i[f]&&u.push(i[f])}u&&(u=u.join(", ")),a.location=u;break;case"city":var v=o.reverse();jQuery.each(v,function(t){if(void 0!==e.address[v[t]])return a.location=e.address[v[t]],!1});break;case"zip":void 0!==e.address.postcode&&(a.zip=e.address.postcode)}else"administrative"==e.type&&"boundary"==e.category&&(jQuery.each(o,function(t){if(void 0!==e.address[o[t]])return r=!0,!1}),void 0===r&&(void 0!==e.address.state&&(a.fullSearch={type:"state"},a.fullSearch.query=jQuery("#wpsl-search-input").val()),void 0===e.address.state&&(a.fullSearch={type:"country"},a.fullSearch.query=jQuery("#wpsl-search-input").val()+","+e.address.country_code)));return wp.hooks.applyFilters("wpslFilterResponse",a)},buildAddressString:function(e,t){var r=[];return jQuery.each(t,function(o){"string"==typeof e[t[o]]&&r.push(e[t[o]])}),r.join(", ")}},directions:{storeId:"",bounds:[],focusedStoreId:null,init:function(e){e()},show:function(e){var t,r,o=a.O.maps[0],n=p.S.layer,s=p.S.active[0]||[],l=[];this.storeId=i._.results.getClickedElemID(e),this.focusedStoreId=this.storeId,jQuery(".wpsl-api-message").remove(),o.removeLayer(n),a.O.directions.active=!0,i._.directions.setShapesVisible(!1),jQuery("#wpsl-map").addClass("wpsl-directions-active"),p.S.init(),a.O.viewport={center:o.getCenter(),zoomLevel:o.getZoom()},jQuery.each(s,function(e){if(0!==s[e].options.storeId||void 0!==t&&""!==t?s[e].options.storeId===m.directions.storeId&&(r=p.S.latLng[0][e],l.push(r),p.S.layer.addLayer(s[e])):(t=p.S.latLng[0][e],l.push(t)),t&&r)return!1}),p.S.active[0]&&p.S.active[0][0]&&(p.S.layer.addLayer(p.S.active[0][0]),p.S.active[0][0].dragging.disable()),p.S.restoreActiveMarkers(),i._.directions.checkRouteCoordinates(t,r),wp.hooks.doAction("wpslShowDirections",t,r)},calcRoute:function(e,t){var r=wp.hooks.applyFilters("wpslOsmPathOptions",""),s=wp.hooks.applyFilters("wpslOsmDirectionsApiParams",{action:"osm_directions",start:e[1]+","+e[0],end:t[1]+","+t[0]}),u="";jQuery("#wpsl-stores li .wpsl-error").remove(),this.bounds=[],jQuery("#wpsl-direction-detail
1s").show(),jQuery("#wpsl-stores, #wpsl-result-filters").hide(),c.R.add("loadingDirections","#wpsl-direction-details ul"),o.UJ.osm.directions(s,function(e){if(c.R.remove(),void 0!==e.routes&&e.routes){var t=e.routes[0];if(m.directions.bounds.push([e.bbox[1],e.bbox[0]]),m.directions.bounds.push([e.bbox[3],e.bbox[2]]),a.O.maps[0].fitBounds(m.directions.bounds,{padding:[35,35]}),t.geometry){var o=L.Polyline.fromEncoded(t.geometry);jQuery.isEmptyObject(r)||o.setStyle(r),o.addTo(a.O.maps[0])}if(t.segments&&t.segments[0].steps.length>0){jQuery.each(t.segments[0].steps,function(e){u=u+"<li><div class='wpsl-direction-index'>"+(e+1)+".</div><div class='wpsl-direction-txt'>"+n.J.escapeHtml(t.segments[0].steps[e].instruction)+"</div><div class='wpsl-direction-distance'>"+i._.formatDirectionsDistance(t.segments[0].steps[e].distance.toFixed(2),"km")+"</div></li>"});var s=i._.formatDirectionsDistance(t.segments[0].distance.toFixed(2),"km"),p=i._.formatDirectionsDuration(t.segments[0].duration);jQuery("#wpsl-direction-details ul").empty().append(u).before(i._.formatDirectionsHeader(s,p)).after("<p class='wpsl-direction-after'>"+n.J.escapeHtml(e.metadata.attribution)+"</p>"),i._.directions.maybeAdjustViewport()}i._.directions.focusBackButton(),i._.directions.styling.init()}else if(404==e.status)e.userNotice=wpslLabels.noDirectionsFoundMessage,l.L.maybeShowResponseText(e,"directions");else{var d={status:e.status,responseJSON:e};l.L.maybeShowResponseText(d,"directions")}})},restoreResults:function(){var e=a.O.maps[0],t=p.S.active[0]||[],r={markers:t,map:e};this.removePolyline(),e.removeLayer(p.S.layer),a.$.markers.skipStart&&t[0]&&0===t[0].options.storeId&&t[0].remove(),i._.map.restoreMapState(),i._.results.sharedRestoreSteps(),p.S.init(r),null!==this.focusedStoreId&&(jQuery.each(t,function(e,t){if(t.options.storeId===m.directions.focusedStoreId){var r=t.getElement();return r&&r.focus(),!1}}),this.focusedStoreId=null)},removePolyline:function(){var e=a.O.maps[0];jQuery.each(e._layers,function(t){e._layers[t]._wpslShape||"object"===d(e._layers[t]._path)&&e.removeLayer(e._layers[t])})}}}},3008(e,t,r){r.d(t,{B:()=>a});var o=r(2210),a={getResponse:function(e,t,r){if(o.$.skipNominatimCache)r({});else{var a={action:"nominatim_search",q:e};t&&(a.type=t),"string"==typeof o.$.api.regions&&(a.country_codes=o.$.api.regions),jQuery.ajax({type:"GET",data:a,dataType:"json",url:o.$.search.ajaxurl,success:function(e){r(e)}})}}}},8619(e,t,r){r.d(t,{p:()=>i});var o=r(2210),a=r(7190),n=r(9307),i={actions:function(e){this.closeOnEscKey(),a._.results.maybeShowZoomOption(o.O.maps[0]),jQuery(".wpsl-info-actions a").off("click").on("click",function(t){var r=o.$.map.autoZoomLevel;return jQuery(this).hasClass("wpsl-directions")?!(!o.$.search.directionRedirect&&("osm"!==o.$.api.provider&&"stadia"!==o.$.api.provider||o.$.api.hasValidRouteKey))||(t.stopImmediatePropagation(),a._.directions.scrollToTop(),n.F.directions.show(jQuery(this)),!1):jQuery(this).hasClass("wpsl-zoom-here")?(t.stopImmediatePropagation(),o.O.maps[0].setView(e,r),!1):void 0})},closeOnEscKey:function(){var e=o.O.maps[0];jQuery(document).off("keyup.wpslOsmEsc").on("keyup.wpslOsmEsc",function(t){27===t.keyCode&&e&&e.closePopup()})}}},861(e,t,r){r.d(t,{T:()=>p});var o=r(2210),a=r(7190),n=r(9996),i=r(6285),s=r(7530),l=r(5260),c=r(8673);function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}var p={create:function(e,t){var r,s,p,d,m=o.$.map.zoomLevel;l.S.currentMapIndex=t,void 0===l.S.active[t]&&(l.S.active[t]=[],l.S.latLng[t]=[],l.S.current[t]="");var f=a._.getMapSettings(t);
1(d=Number(f.zoomLevel))!==m&&(o.$.map.autoZoomLevel=d);var v=window["wpslMap_"+t],y=v&&"object"===u(v.shortCode)&&v.shortCode.tileLayer?v.shortCode.tileLayer:null,h=y||o.$.api.tileLayer,g="vector"===h.type||h.options?h.options.maxZoom:void 0,b=wp.hooks.applyFilters("wpslMapOptions",{mapId:e,options:{center:[f.startLatLng.lat,f.startLatLng.lng],zoom:m,zoomControl:0,scrollWheelZoom:f.scrollWheel,maxZoom:g}},e,t);if(o.O.maps[t]=L.map(b.mapId,b.options),o.O.maps[t]._wpslClusterEnabled="wpsl-map"===e?!!o.$.markers.markerClusters:!!(null!==(r=window["wpslMap_"+t])&&void 0!==r&&null!==(r=r.shortCode)&&void 0!==r&&r.cluster||o.$.markers.markerClusters),c.n.render(o.O.maps[t],f),"vector"===h.type&&void 0!==L.maplibreGL&&function(){try{var e=document.createElement("canvas");return!(!window.WebGLRenderingContext||!e.getContext("webgl")&&!e.getContext("experimental-webgl"))}catch(e){return!1}}()){var w=L.maplibreGL({style:h.style,attribution:h.options.attribution,maxZoom:h.options.maxZoom}),k=!1,S=!1;w.addTo(o.O.maps[t]),o.O.tileLayer=w;var _=w.getMaplibreMap?w.getMaplibreMap():null;_&&(_.once("load",function(){k=!0}),_.on("error",function(){k||S||(S=!0,o.O.maps[t].removeLayer(w),o.O.tileLayer=L.tileLayer(h.fallback.urlTemplate,h.fallback.options).addTo(o.O.maps[t]))}))}else{var O="vector"===h.type?h.fallback:h;o.O.tileLayer=L.tileLayer(O.urlTemplate,O.options).addTo(o.O.maps[t])}var A=["left","right"].includes(f.controlPosition)?f.controlPosition:"right";if(L.control.zoom({position:"top"+A}).addTo(o.O.maps[t]),o.O.maps[t].whenReady(function(){var e=o.O.maps[t].getContainer(),r=document.querySelector(".wpsl-skip-to-results");r&&e&&!e.contains(r)&&e.insertBefore(r,e.firstChild)}),s={markers:"",map:o.O.maps[t]},l.S.init(s),jQuery("#wpsl-map.wpsl-canvas-osm, #wpsl-map.wpsl-canvas-stadia").length&&n.n.prepareWpsl(),a._.map.wpslMapLocationsExist(t)){var M=window["wpslMap_"+t];p=M.locations,l.S.latLng[t].length=0;var x=a._.markers.clusteringActive(o.O.maps[t]);x&&(l.S.layer=new L.markerClusterGroup(wp.hooks.applyFilters("wpslMarkerClusterGroup",o.$.markers.cluster))),jQuery.each(p,function(e){l.S.add(p[e],o.O.maps[t])}),x&&l.S.layer&&o.O.maps[t].addLayer(l.S.layer),o.$.map.fitBounds&&l.S.fitBounds(l.S.latLng[t],o.O.maps[t]),i.O.bindExpandingHours()}"wpsl-map"===e?l.S.storeLocator={layer:l.S.layer,mapIndex:t}:l.S.storeLocator&&(l.S.layer=l.S.storeLocator.layer,l.S.currentMapIndex=l.S.storeLocator.mapIndex),this.mapControlIcons()},mapControlIcons:function(){o.O.maps[0].whenReady(function(){jQuery(".leaflet-container").append(o.$.map.controls),s.U.bindMapControlIcons()})},attachBoundsChangedListener:function(e,t){e.once("load moveend",function(r){e.getZoom()>t&&e.setZoom(t)})},invalidateSize:function(e){if(e=e||0,void 0!==o.O.maps[e]){o.O.maps[e].invalidateSize();var t=l.S.pendingFit[e];t&&o.O.maps[e].getSize().x&&o.O.maps[e].getSize().y&&(delete l.S.pendingFit[e],l.S.fitBounds(t.bounds,t.mapObj,jQuery.extend({},t.options||{},{animate:!1})))}}}},5260(e,t,r){r.d(t,{S:()=>f});var o=r(2210),a=r(979),n=r(7190),i=r(8279),s=r(8619),l=r(9307),c=r(861);function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}var p=!1,d=!1;function m(){return p&&!d}var f={active:{},latLng:{},current:{},cluster:"",startLocation:"",layer:"",currentMapIndex:0,_bounceMarker:null,_hiddenMarker:null,_bounceFrame:null,pendingFit:{},_startMarker:null,checkSetup:function(e){if("object"===u(e))for(var t in e)e.hasOwnProperty(t)&&jQuery.isEmptyObject(e[t])&&"map"===t&&(e[t]=o.O.maps[0]);else e={markers:"",map:o.O.maps[0]};return e},init:function(e){if(e=this.checkSetup(e),n._.markers.clusteringActive(e.map)&&"object"===u(o.O.directions)&&!o.O.directions.active){var t=wp.hooks.applyFilters("wpslMarkerClusterGroup",o.$.markers.cluster);this.layer=new L.markerClusterGroup(t);var r=function(t,r,o){t&&(t.setAttribute("tabindex","0"),t.setAttribute("role","button"),t.setAttribute("aria-label",wpslLabels.clusterTitle.replace("%d",r)),o&&(t.setAttribute("data-lat",o.lat),t.setAttribute("data-lng",o.lng)),t._wpslKeydownAttached||(t._wpslKeydownAttached=!0,t.addEventListener("keydown",function(r){if("Enter"===r.key||" "===r.key||"Space"===r.code){r.preventDefault(),r.stopPropagation();var o=NaN,a=NaN;if(f.layer&&f.layer._featureGroup&&f.layer._featureGroup._layers)for(var n in f.layer._featureGroup._layers){var i=f.layer._featureGroup._layers[n];if(i&&"function"==typeof i.getElement&&i.getElement()===t){var s=i.getLatLng();o=s.lat,a=s.lng;break}}t.click(),f.layer&&"function"==typeof f.layer.once&&f.layer.once("animationend",function(){setTimeout(function(){var t=document.querySelectorAll(".leaflet-marker-icon");if(0!==t.length)if(isNaN(o)||isNaN(a)||!e.map)t[0].focus();else{var r=e.map.latLngToContainerPoint([o,a]),n=e.map.getContainer().getBoundingClientRect(),i=null,s=1/0;t.forEach(function(e){var t=e.getBoundingClientRect(),o=t.left-n.left+t.width/2,a=t.top-n.top+t.height/2,l=Math.sqrt(Math.pow(o-r.x,2)+Math.pow(a-r.y,2));l<s&&(s=l,i=e)}),i&&i.focus()}},50)})}})))};this.layer.on("clusteradd",function(e){var t=e.layer.getElement(),o=e.layer.getLatLng(),a=e.layer.getChildCount();r(t,a,o)}),this.layer.addTo(e.map),e.markers&&this.layer.addLayers(e.markers);var a=e.map.getContainer();if(a&&"undefined"!=typeof MutationObserver){a._wpslClusterObserver&&a._wpslClusterObserver.disconnect();var i=new MutationObserver(function(e){e.forEach(function(e){e.addedNodes.forEac
1h(function(e){if(1===e.nodeType&&e.classList&&e.classList.contains("marker-cluster")){var t=e.textContent||"?";r(e,t,null)}if(e.querySelectorAll){var o=e.querySelectorAll(".marker-cluster");o.length>0&&o.forEach(function(e){var t=e.textContent||"?";r(e,t,null)})}})})});i.observe(a,{childList:!0,subtree:!0}),a._wpslClusterObserver=i}}else this.layer=new L.LayerGroup(e.markers),this.layer.addTo(e.map);var s=e.map,l=s?s.getContainer():null;l&&!l._wpslFocusCenteringInitialized&&(l._wpslFocusCenteringInitialized=!0,document.body.hasAttribute("data-wpsl-focus-modality-init")||(document.body.setAttribute("data-wpsl-focus-modality-init","true"),document.addEventListener("keydown",function(e){("Tab"===e.key||e.key&&0===e.key.indexOf("Arrow"))&&(p=!0)},!0),["mousedown","pointerdown","touchstart"].forEach(function(e){document.addEventListener(e,function(){p=!1},!0)})),l.addEventListener("focus",function(e){var t=e.target,r=t&&t.classList.contains("leaflet-marker-icon"),o=t&&t.classList.contains("marker-cluster");if(r||o){var a,n;if(t.hasAttribute("data-lat")&&t.hasAttribute("data-lng")&&(a=parseFloat(t.getAttribute("data-lat")),n=parseFloat(t.getAttribute("data-lng"))),o&&f.layer&&f.layer._featureGroup){var i=f.layer._featureGroup;for(var c in i._layers){var u=i._layers[c];if(u&&"function"==typeof u.getElement&&u.getElement()===t){var p=u.getLatLng();a=p.lat,n=p.lng;break}}}if((isNaN(a)||isNaN(n))&&s){var d=t.getBoundingClientRect(),v=l.getBoundingClientRect(),y=d.left-v.left+d.width/2,h=d.top-v.top+d.height/2,g=s.containerPointToLatLng(L.point(y,h));a=g.lat,n=g.lng}!isNaN(a)&&!isNaN(n)&&s&&m()&&s.panTo([a,n])}},!0)),document.body.hasAttribute("data-wpsl-arrow-nav-initialized")||(document.body.setAttribute("data-wpsl-arrow-nav-initialized","true"),document.addEventListener("keydown",function(e){var t=document.activeElement;if(t&&t.classList.contains("leaflet-marker-icon")&&!t.classList.contains("marker-cluster")&&("ArrowUp"===e.key||"ArrowDown"===e.key)){e.preventDefault();var r=document.querySelectorAll('.leaflet-marker-icon[tabindex="0"]:not(.marker-cluster)'),o=Array.from(r),a=o.indexOf(t);if(-1!==a)o["ArrowDown"===e.key?(a+1)%o.length:(a-1+o.length)%o.length].focus()}}))},add:function(e,t){e.latLng&&("function"==typeof e.latLng.lat?(e.lat=e.latLng.lat(),e.lng=e.latLng.lng()):(e.lat=e.latLng.lat,e.lng=e.latLng.lng)),e=wp.hooks.applyFilters("wpslMarkerData",n._.markers.setProperties(e));var r=n._.markers.startVisibility(e);if(!isNaN(parseFloat(e.lat))&&!isNaN(parseFloat(e.lng))){var a=this.getIconProps(e.markerUrl),l={clickable:!!r,icon:L.icon(wp.hooks.applyFilters("wpslMapIcon",a)),title:n._.decodeHtmlEntity(e.store),alt:n._.decodeHtmlEntity(e.store),draggable:e.draggable,storeId:e.id};o.$.markers.startOnTop&&(l.zIndexOffset=0===e.id?1e3:0);var c=L.marker([Number(e.lat),Number(e.lng)],wp.hooks.applyFilters("wpslMarker",l));e.categoryMarkerUrlActive&&(c.options.categoryMarkerUrlActive=e.categoryMarkerUrlActive),e.locationMarkerUrlActive&&(c.options.locationMarkerUrlActive=e.locationMarkerUrlActive),0===e.id&&c.once("add",function(){var e=this.getElement();e&&e.setAttribute("tabindex","-1")}),0!==e.id?c.bindPopup(function(){return n._.template.getInfoWindowTemplate(e)},wp.hooks.applyFilters("wpslPopupOptions",{minWidth:150,maxWidth:360})):r&&c.bindPopup(e.store);var p,v=this.currentMapIndex,y=null,h=null,g=c.getPopup();if(g&&g.on("remove",function(){f.restoreActiveMarkers(v),document.querySelectorAll(".leaflet-marker-icon").forEach(function(e){"0"!==e.getAttribute("data-store-id")?e.setAttribute("tabindex","0"):e.setAttribute("tabindex","-1")});var e=document.querySelector(".leaflet-popup");e&&e.querySelectorAll("a[href], button").forEach(function(e){e._wpslKeydownHandlers&&(e._wpslKeydownHandlers.forEach(function(t){e.removeEventListener("keydown",t)}),delete e._wpslKeydownHandlers)});y&&(d=!0,y.focus(),d=!1,y=null)}),c.on("popupopen",function(){f.restoreActiveMarkers(v),n._.markers.maybeSetActivemarker(e.id,!(!e.locationMarkerUrlActive&&!e.categoryMarkerUrlActive))&&f.setActive(c,e,v),y=c.getElement(),h=n._.popup.hardRepaintOnSettle(t,function(){return document.querySelector(".leaflet-popup")}),document.querySelectorAll(".leaflet-marker-icon").forEach(function(e){e.setAttribute("tabindex","-1")}),setTimeout(function(){var e=document.querySelector(".leaflet-popup"),t=document.querySelector(".leaflet-popup-close-button");if(e&&t){t.hasAttribute("tabindex")||t.setAttribute("tabindex","0"),e.querySelectorAll(".leaflet-popup-content a").forEach(function(e){e.hasAttribute("tabindex")||e.setAttribute("tabindex","0")});var r=Array.from(e.querySelectorAll(".leaflet-popup-content a[href]")),o=r[0];o?o.focus():t.focus();var a=function(e){"Escape"!==e.key?"Tab"===e.key&&e.shiftKey&&(e.preventDefault(),t.focus()):c.closePopup()},n=function(e){"Escape"===e.key&&c.closePopup()};o&&(o.addEventListener("keydown",a),o._wpslKeydownHandlers||(o._wpslKeydownHandlers=[]),o._wpslKeydownHandlers.push(a)),t.addEventListener("keydown",n),t._wpslKeydownHandlers||(t._wpslKeydownHandlers=[]),t._wpslKeydownHandlers.push(n),r.forEach(function(e,t){t>0&&(e.addEventListener("keydown",n),e._wpslKeydownHandlers||(e._wpslKeydownHandlers=[]),e._wpslKeydownHandlers.push(n))})}},100),s.p.actions(c.getLatLng())}),c.on("popupclose",function(){h&&(h(),h=null);var e=o.O.markers.focusSourceElement;e&&document.body.contains(e)?setTimeout(function(){document.body.contains(e)&&(e.hasAttribute("tabindex")||e.setAttribute("tabindex","0"),e.scrollIntoView({behavior:"smooth",block:"nearest"}),e.focus()),o.O.markers.focusSourceElement=null},50):setTimeout(function(){var e=c.getElement();e&&document.body.contains(e)&&e.focus(),o.O.markers.focusSourceElement=null},50)}),this.active[v].push(c),r&&this.latLng[v].push([e.lat,e.lng]),0===e.id&&(this.startLocation={lat:Number(e.lat),lng:Number(e.lng)}),r){var b=this.layer&&"function"==typeof this.layer.getVisibleParent&&"object"===u(o.$.markers.cluster)&&o.$.markers.cluster.excludeStartMarker;if(0===e.id&&b){var w=o.O.maps[this.currentMapIndex];c.addTo(w),this._startMarker=c}else this.layer.addLayer(c);var k=function(){setTimeout(function(){var t=c.getElement();if(t){0!==e.id?t.setAttribute("tabindex","0"):t.setAttribute("tabindex","-1");var r=c.getLatLng();if(t.setAttribute("data-lat",r.lat),t.setAttribute("data-lng",r.lng),t.setAttribute("data-store-id",c.options.storeId),c._panOnFocus&&(c._panOnFocus=function(){}),t._wpslKeydownAttached)return;t._wpslKeydownAttached=!0,t.addEventListener("focus",function(){var e=o.O.maps[v];if(e&&m()){var t=o.$.ux.keyboardFocusMinZoom||6;e.getZoom()<t?e.setView(c.getLatLng(),t):e.panTo(c.getLatLng())}}),t.addEventListener("keydown",function(e){"Enter"!==e.key&&" "!==e.key&&"Space"!==e.code||(e.preventDefault(),e.stopPropagation(),c.isPopupOpen()?c.closePopup():t.click())})}},100)};k(),c.on("add",k),c.on("click",function(){if(null===o.O.markers.focusSourceElement||void 0===o.O.markers.focusSourceElement){var t=c.getElement();t&&(o.O.markers.focusSourceElement=t)}s.p.actions(this.getLatLng()),f.restoreActiveMarkers(v),n._.markers.maybeSetActivemarker(e.id,!(!e.locationMarkerUrlActive&&!e.categoryMarkerUrlActive))&&f.setActive(c,e,v),wp.hooks.doAction("wpslMarkerClicked",c,e,o.O.maps[v])})}if(e.draggable)c.on("dragend",function(t){p=this.getLatLng(),o.O.setSearchInput=!0,f.removeAll(),f.add(this.getLatLng(),o.O.maps[0]),n._.map.setCenter(this.getLatLng()),e.lat=this.getLatLng().lat,e.lng=this.getLatLng().lng,p.markerDragged=!0,o.O.provider.api.geocoding.reverse(p,i.$.current(function(){i.$.run(e)}))})}},getIconProps:function(e){var t=e.replace("@2x",""),r=n._.markers.getCustomMarkerGeometry(t);
1return wp.hooks.applyFilters("wpslMapIcon",{iconUrl:t,iconSize:r?[r.width,r.height]:Object.values(o.$.markers.scaledSize),iconAnchor:r?r.anchor:Object.values(o.$.markers.iconAnchor),popupAnchor:r?r.popupAnchor:Object.values(o.$.markers.popupAnchor)})},setActive:function(e,t,r){var i,s=n._.markers.getSettings();this.restoreActiveMarkers(r),void 0===o.O.restoreActiveMarker&&(o.O.restoreActiveMarker={}),o.O.restoreActiveMarker[r]={id:e.options.storeId,iconUrl:e.options.icon.options.iconUrl},i=t&&t.locationMarkerUrlActive?t.locationMarkerUrlActive:t&&t.categoryMarkerUrlActive?t.categoryMarkerUrlActive:n._.markers.resolveMarkerSrc(o.$.markers.active,s.url);var l=this.getIconProps(i),c=L.Icon.extend({options:l});e.setIcon(new c),a.J.reanchorLeafletPopup(e),this.current[r]=e},restoreActiveMarkers:function(e){if(void 0===e&&(e=this.currentMapIndex),"object"===u(o.O.restoreActiveMarker)&&"object"===u(o.O.restoreActiveMarker[e])&&void 0!==this.active[e]){var t=this;jQuery.each(this.active[e],function(r){if(o.O.restoreActiveMarker[e].id===t.active[e][r].options.storeId){var n=t.getIconProps(o.O.restoreActiveMarker[e].iconUrl),i=L.Icon.extend({options:n});t.active[e][r].setIcon(new i),a.J.reanchorLeafletPopup(t.active[e][r])}})}},removeAll:function(){var e=this.currentMapIndex;l.F.directions.removePolyline(),this.layer&&"function"==typeof this.layer.eachLayer&&this.layer.eachLayer(function(e){e&&"function"==typeof e.closePopup&&e.closePopup()});var t=o.O.maps[e];t&&"function"==typeof t.closePopup&&t.closePopup(),this._startMarker&&(this._startMarker.remove(),this._startMarker=null),this.layer.clearLayers(),void 0!==this.latLng[e]&&(this.latLng[e].length=0),void 0!==this.active[e]&&(this.active[e].length=0),this.startLocation=null,o.O.markers.focusSourceElement=null;var r=document.querySelector(".wpsl-canvas-"+(o.$&&o.$.map&&o.$.map.provider?o.$.map.provider:"osm"));r&&"function"==typeof r._wpslResetFocusState&&r._wpslResetFocusState(),document.activeElement&&r&&r.contains(document.activeElement)&&document.activeElement.blur()},fitBounds:function(e,t,r){t=n._.getMapObj(t);var a=this.currentMapIndex;if(void 0===e)e=this.latLng[a]||[];else if(void 0!==o.O.maps){var i=o.O.maps.indexOf(t);-1!==i&&(a=i)}var s=t.getSize();if(s.x&&s.y){delete this.pendingFit[a],c.T.attachBoundsChangedListener(t,o.$.map.autoZoomLevel);var l=jQuery.extend({padding:[50,50]},r||{});t.fitBounds(e,l)}else this.pendingFit[a]={bounds:e,mapObj:t,options:r}},getStartCoordinates:function(){var e=this.currentMapIndex;return void 0!==this.active[e]&&void 0!==this.active[e][0]?this.active[e][0].getLatLng():{lat:o.$.map.startLatLng.lat,lng:o.$.map.startLatLng.lng}},showSelection:function(e,t){var r=this.currentMapIndex,a=[];if(void 0!==this.active[r]){var n=this;jQuery.each(this.active[r],function(t){-1!==jQuery.inArray(n.active[r][t].options.storeId,e)?(n.active[r][t].addTo(o.O.maps[r]),a.push(n.active[r][t].getLatLng())):n.active[r][t].remove()})}this.fitBounds(a),t()},bounce:function(e,t){var r=this.currentMapIndex,a=o.O.maps[r];if(this._bounceFrame&&(cancelAnimationFrame(this._bounceFrame),this._bounceFrame=null),this._bounceMarker&&(a.removeLayer(this._bounceMarker),this._bounceMarker=null),this._hiddenMarker&&(this._hiddenMarker.setOpacity(1),this._hiddenMarker=null),"start"===t&&void 0!==this.active[r]){for(var n=null,i=0,s=this.active[r].length;i<s;i++)if(this.active[r][i].options.storeId===e){n=this.active[r][i];break}if(n&&n.getElement()){var l=n.options.icon.options,c=l.iconSize,u=n.getLatLng(),p=L.divIcon({className:"wpsl-marker-bounce",iconSize:c,iconAnchor:l.iconAnchor,html:'<img src="'+l.iconUrl+'" style="width:'+c[0]+"px;height:"+c[1]+'px;" alt="">'});this._bounceMarker=L.marker(u,{icon:p,interactive:!1,keyboard:!1,zIndexOffset:2e3}).addTo(a),n.setOpacity(0),this._hiddenMarker=n;var d=this,m=o.$.markers.bounceHeight||12,f=o.$.markers.bouncePeriod||500,v="undefined"!=typeof performance?performance.now():Date.now(),y=function(e){var t=-Math.abs(Math.sin((e-v)/f*Math.PI))*m,r=a.latLngToContainerPoint(u);r.y+=t,d._bounceMarker.setLatLng(a.containerPointToLatLng(r)),d._bounceFrame=requestAnimationFrame(y)};d._bounceFrame=requestAnimationFrame(y)}}},checkMouseOverEvent:function(){"bounce"===o.$.ux.markerEffect&&(jQuery("#wpsl-stores").on("mouseenter","li",function(e){var t=jQuery(e.currentTarget).data("store-id");this.setActiveOnHover(t),this.bounce(t,"start")}.bind(this)),jQuery("#wpsl-stores").on("mouseleave","li",function(e){var t=jQuery(e.currentTarget).data("store-id");this.bounce(t,"stop"),this.restoreActiveMarkers(this.currentMapIndex)}.bind(this)))},setActiveOnHover:function(e){var t=this.currentMapIndex;if(void 0!==this.active[t])for(var r=0,o=this.active[t].length;r<o;r++)if(this.active[t][r].options.storeId===e){var a=this.active[t][r],i=!(!a.options.locationMarkerUrlActive&&!a.options.categoryMarkerUrlActive);if(!n._.markers.maybeSetActivemarker(e,i))return;var s=i?{locationMarkerUrlActive:a.options.locationMarkerUrlActive,categoryMarkerUrlActive:a.options.categoryMarkerUrlActive}:null;this.setActive(a,s,t);break}},triggerClick:function(e){var t=this.currentMapIndex;if(void 0!==this.active[t])for(var r=this.active[t].length,o=0;o<r;o++){var a=this.active[t][o];if(a.options.storeId===e){n._.map.setCenter(a.getLatLng()),a.fire("click");break}}}}},9775(e,t,r){r.d(t,{$:()=>i});var o=r(2210),a=r(5260);function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}var i={activeMarkers:function(){var e=a.S.currentMapIndex;return a.S.active[e]?a.S.active[e].length:0},collectStatsData:function(e){var t="object"===n(e[0])?e[0]:e,r=["city","town","village","state","country"],a={};"object"===n(t)&&jQuery.each(r,function(e){"string"==typeof t.address[r[e]]&&("state"===r[e]?a.region=t.address[r[e]]:"city"===r[e]||"village"===r[e]||"town"===r[e]?a.location=t.address[r[e]]:a[r[e]]=t.address[r[e]])}),o.O.statistics=wp.hooks.applyFilters("wpslStatsData",a,e)}}},8673(e,t,r){r.d(t,{n:()=>l});var o=r(3478),a=new WeakMap;function n(e){return/^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i.test(String(e))?String(e):"#cc3333"}function i(e){var t=parseFloat(e);return isNaN(t)?.4:Math.min(1,Math.max(0,t))}function s(e){return[e[1],e[0]]}var l={render:function(e,t){var r="undefined"!=typeof wpslSettings?wpslSettings.mapShapes:null;if(e&&r&&r.features&&r.features.length&&(!t||!1!==t.shapes)){var l=[];
1a.set(e,l),r.features.forEach(function(t){try{var r,a=t&&t.properties?t.properties:{},c=t&&t.geometry?t.geometry:{},u=function(e,t){var r,o,a=!!e.fill&&!function(e,t){return"polyline"===(e&&e.shape_type)||"LineString"===(t&&t.type)}(e,t);return{color:n(e.stroke_color),weight:(r=e.stroke_width,o=parseInt(r,10),isNaN(o)||o<0?2:o),fillColor:n(e.fill_color),fill:a,fillOpacity:a?i(e.fill_opacity):0}}(a,c);(r="circle"===a.shape_type?L.circle(s(c.coordinates),Object.assign({radius:a.radius},u)):"polyline"===a.shape_type?L.polyline(c.coordinates.map(s),u):L.polygon(c.coordinates.map(function(e){return e.map(s)}),u))._wpslShape=!0;var p=(0,o.G)(a.message);p&&r.bindPopup(p),r.addTo(e),l.push(r)}catch(e){console.warn("WPSL: skipped invalid map shape",t,e)}})}},hide:function(e){var t=a.get(e);t&&t.forEach(function(t){e.removeLayer(t)})},show:function(e){var t=a.get(e);t&&t.forEach(function(t){t.addTo(e)})}}},6614(e,t,r){r.r(t),r.d(t,{osm:()=>f});var o=r(2210),a=r(7190),n=r(7530),i=r(861),s=r(5260),l=r(8619),c=r(9307),u=r(3008),p=r(9775),d=r(8673);function m(e){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},m(e)}var f={self:null,map:i.T,markers:s.S,infoWindow:l.p,api:c.F,geocodeCache:u.B,search:p.$,shapes:d.n,init:function(){this.self=this,o.O.markers.latLng={},o.O.markers.layer="",o.O.markers.currentMapIndex=0,this.extendHelpers(),o.$.search.directionRedirect||n.U.bindRemoveDirections()},templateHelpers:{createDirectionsUrl:function(e){var t=parseFloat(e.lat),r=parseFloat(e.lng);if(isNaN(t)||isNaN(r))return console.warn("createDirectionsUrl: Invalid coordinates detected:",e.lat,e.lng),"#";var o=a._.directions.getOriginCoords("latlng"),n=t+","+r,i="https://www.openstreetmap.org/directions?from="+a._.template.rfc3986EncodeURIComponent(o)+"&to="+a._.template.rfc3986EncodeURIComponent(n);return wp.hooks.applyFilters("wpslDirectionsUrl",i)}},extendHelpers:function(){a._.map.getWpslMapShortcodeSettings=function(){return["zoomLevel","scrollWheel","controlPosition","shapes"]},a._.map.restoreMapState=function(){o.O.maps[0].setView(o.O.viewport.center,o.O.viewport.zoomLevel)},a._.map.setCenter=function(e){var t;void 0===e&&(e=s.S.getStartCoordinates()),void 0!==e.getLatLng&&"object"===m(e.getLatLng())&&(e=e.getLatLng()),t=L.latLng(e.lat,e.lng);var r=o.O.maps[0].getZoom();o.O.maps[0].setView(t,r,{animate:!1})},a._.map.setZoom=function(e){void 0===e.map&&(e.map=o.O.maps[0]),e.map.setZoom(e.zoom)},a._.map.viewportChanged=function(e){var t=!1;return e.map.getCenter().lat===e.viewport.center.lat&&e.map.getCenter().lng===e.viewport.center.lng&&e.map.getZoom()===e.viewport.zoomLevel||(t=!0),t},a._.map.setViewport=function(e,t){e.once("moveend zoomend",function(r){o.O.viewport={center:e.getCenter(),zoomLevel:e.getZoom()},t()})}}}},3478(e,t,r){function o(e){var t=String(e).trim();return/^https?:\/\/[^\s"'<>]+$/i.test(t)?t:""}function a(e){if("string"!=typeof e||""===e)return"";var t=String(e??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");return(t=(t=(t=t.replace(/\[url=([^\]]+)\]([\s\S]*?)\[\/url\]/gi,function(e,t,r){var a=o(t);return a?'<a href="'+a+'" rel="nofollow noopener">'+r+"</a>":e})).replace(/\[url\]([\s\S]*?)\[\/url\]/gi,function(e,t){var r=o(t);return r?'<a href="'+r+'" rel="nofollow noopener">'+r+"</a>":e})).replace(/\[b\]([\s\S]*?)\[\/b\]/gi,"<strong>$1</strong>").replace(/\[i\]([\s\S]*?)\[\/i\]/gi,"<em>$1</em>").replace(/\[u\]([\s\S]*?)\[\/u\]/gi,"<u>$1</u>").replace(/\[br\]/gi,"<br>")).replace(/\r\n|\r|\n/g,"<br>")}r.d(t,{G:()=>a})}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.