PageSourceSearch

https://savemart.com/build/_shared/chunk-RH6GSQ4L.js

js savemart.com collected 2026-09-24 20:04:27 UTC 4,548 bytes, 1 lines download raw bytes

1import{a as Y}from"/build/_shared/chunk-TBVCURYZ.js";import{j as T}from"/build/_shared/chunk-D7PKK72C.js";import{f as B}from"/build/_shared/chunk-HGY3FHMJ.js";import{A as $,x as E,z as D}from"/build/_shared/chunk-ZSEETMYI.js";import{i as G,r as R}from"/build/_shared/chunk-BTADOTLT.js";import{a as F}from"/build/_shared/chunk-G3QUQOKW.js";import{a as W}from"/build/_shared/chunk-F3RAJA4O.js";import{e as V}from"/build/_shared/chunk-O3BUCIVF.js";var i=V(W()),K=V(Y());var N="/build/_assets/filledMapMarker-LFQWXYQS.svg";var O="/build/_assets/mapMarker-A3OSN7TS.svg";var U="/build/_assets/selectedStoreIcon-5JIKCC5E.svg";$();var P="/build/_assets/styles-ER2EG5TF.css";var j="/build/_assets/radar-LVXSVZB2.css";var A=V(F()),X=()=>[{rel:"stylesheet",href:j},{rel:"stylesheet",href:P}],i1=({assets:m,isSelectedStore:l,marker:g,onMarkerClick:p,store:f})=>{var h,x,q,M,k,n,w,b,a,r,o,c;let t=(q=(x=(h=m==null?void 0:m.assets)==null?void 0:h.data)==null?void 0:x[0])==null?void 0:q.attributes,u=(n=(k=(M=t==null?void 0:t.map_marker_icon_selected)==null?void 0:M.data)==null?void 0:k.attributes.url)!=null?n:N,y=(a=(b=(w=t==null?void 0:t.map_maker_icon_unselected)==null?void 0:w.data)==null?void 0:b.attributes.url)!=null?a:O,e=(c=(o=(r=t==null?void 0:t.map_marker_icon_selected_store)==null?void 0:r.data)==null?void 0:o.attributes.url)!=null?c:U;return(0,A.jsx)("img",{...l?{tabIndex:0,role:"button"}:null,srcSet:l?e:g.key===(f==null?void 0:f.storeId)?u:y,onClick:()=>p(g),onKeyDown:s=>{s.key==="Enter"&&p(g)},alt:g.title,role:"presentation",loading:"lazy",tabIndex:0})},L=m=>{switch(m){case 25:return 8.35;case 50:return 7.35;default:return 4}},n1=({center:m,nearByStores:l,onMapChangeCenter:g,onMarkerClick:p,store:f})=>{let{user:t}=T(),u=D(t==null?void 0:t.store),{assets:y}=B(),e=(0,i.useRef)(null),v=(0,i.useRef)(null),h=R(),[x]=G(),q=(0,i.useCallback)(a=>{if(p){let r=l==null?void 0:l.find(o=>o.storeId===a.key);r&&p(r)}},[l,p]),M=()=>{p(void 0)},k=(0,i.useCallback)(()=>{if(E(t==null?void 0:t.store)){let c=l==null?void 0:l.find(s=>s.storeId===E(t==null?void 0:t.store));if(c)return{lng:c.location.longitude,lat:c.location.latitude}}if((l==null?void 0:l.length)>0)return{lng:l[0].location.longitude,lat:l[0].location.latitude};let a=new URLSearchParams(window.location.search),r=a.get("lat"),o=a.get("lng");return r&&o?{lat:Number(r),lng:Number(o)}:m},[m,l,t==null?void 0:t.store]),n=(0,i.useMemo)(()=>l==null?void 0:l.map(a=>({key:a.storeId,number:a.storeId,position:{lat:a.location.latitude,lng:a.location.longitude},title:a.displayName})),[l]),w=(0,i.useCallback)(()=>{if(e.current&&(e.current.clearMarkers(),(n==null?void 0:n.length)>0))for(let a of n){let r=u===a.number,o=document.createElement("div");(0,K.createRoot)(o).render((0,A.jsx)(i1,{isSelectedStore:r,onMarkerClick:q,marker:a,store:f,assets:y})),v.current.ui.marker({element:o}).setLngLat([a.position.lng,a.position.lat]).addTo(e.current)}},[n,v,e,y,q,f,u]),b=(0,i.useCallback)(()=>{let a=Number(x.get("miles"));return a&&!isNaN(a)?a:l||u?25:0},[l,u,x]);return(0,i.useEffect)(()=>{(async()=>{var r,o,c,s,_,S;let a=(c=(o=(r=h==null?void 0:h[0])==null?void 0:r.data)==null?void 0:o.publicEnvs)==null?void 0:c.radarApiKey;if(e.current&&w(),!e.current&&a){v.current=(await import("/build/_shared/radar-JTDJJQR3.js")).default;let Z=(await import("/build/_shared/maplibre-gl-VUQJMSZO.js")).default;v.current.initialize(a);let I=k(),Q=b();e.current=v.current.ui.map({container:"map",style:"radar-default-v1",center:[I.lng,I.lat],zoom:L(Q)}),(s=e.current)==null||s.on("load",()=>{var C;if(w(),(n==null?void 0:n.length)>0){let d=new Z.LngLatBounds;n.map(z=>({lng:z.position.lng,lat:z.position.lat})).forEach(z=>{d.extend(new Z.LngLat(z.lng,z.lat))}),(C=e.current)==null||C.fitBounds(d,{padding:20})}}),(_=e.current)==null||_.on("dragend",C=>{var d;e.current&&g((d=e.current)==null?void 0:d.getCenter())}),(S=e.current)==null||S.on("zoomend",C=>{var d,H;e.current&&((d=C.originalEvent)==null?void 0:d.type)==="wheel"&&g((H=e.current)==null?void 0:H.getCenter())})}})()},[k,h,b,g,w,n]),(0,i.useEffect)(()=>{if(E(t==null?void 0:t.store)&&(l==null?void 0:l.length)>0){let a=l==null?void 0:l.find(r=>r.storeId===E(t==null?void 0:t.store));p(a)}else p(void 0)},[l,t==null?void 0:t.store,p]),(0,i.useEffect)(()=>{var c,s;let a=b(),r=(c=e.current)==null?void 0:c.getZoom(),o=L(a);r!==o&&((s=e.current)==null||s.setZoom(L(a)))},[b]),(0,A.jsx)("div",{id:"map","data-testid":"map",style:{width:"100%",height:"100%"},onClick:M})},J=n1;var y1=J;var c1=()=>[...X()],H1=c1;export{y1 as a,c1 as b,H1 as c};

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.