PageSourceSearch

https://www.fazergroup.com/dist/assets/LocationMap.DDxMdV31.js

js fazergroup.com collected 2026-10-02 11:05:18 UTC 3,051 bytes, 6 lines download raw bytes

1import{d as N,u as z,o as S,M as G,O as v,a as b,e as w,b as C,C as U,j as Z,n as P,h as $,Q as j,H as _}from"./main.DfDvl5jK.js";import{h as k,b as O,l as V,m as q,r as E}from"./locationMapHelpers.BkZFicZQ.js";const y=(s,r)=>{const l=`
2    <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" fill="${s}" stroke="${r}" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
3      <path d="M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z"/>
4      <circle cx="12" cy="10" r="3" fill="${r}"/>
5    </svg>
6  `,n=document.createElement("img");return n.src=`data:image/svg+xml;charset=UTF-8,${encodeURIComponent(l)}`,n.width=32,n.height=32,n.style.maxWidth="none",n.style.display="block",n},F=(s,r,l,n)=>{s.replaceChildren(r?y(n,l):y(l,n)),s.zIndex=r?999:null},R={class:"w-full"},H={key:0,class:"bg-secondary text-secondary flex aspect-square w-full items-center justify-center text-sm"},Q=15,W=16,L=40,X=N({__name:"LocationMap",props:{locations:{},openCityGroup:{},selectedLocationId:{}},emits:["marker-clicked"],setup(s,{emit:r}){const l=r,n=s,c=_(null),d=_(!1),{t:x}=z();let o=null,u=null,m=null,p="--palette-bg-primary-solid",f="--palette-bg-primary";const i=new Map,M=()=>{i.forEach(e=>e.map=null),i.clear()},I=()=>{M();const e=u;!e||!o||n.locations.forEach(t=>{if(!k(t)||t.contentId==null)return;const a=new e({position:{lat:t.latitude,lng:t.longitude},map:o,title:t.title,gmpClickable:!0});a.replaceChildren(y(p,f)),a.addEventListener("gmpclick",()=>l("marker-clicked",t)),i.set(t.contentId,a)})},g=e=>{i.forEach((t,a)=>{F(t,a===e,p,f)})},B=e=>{if(!o)return;const t=e.locations?.filter(k)??[];if(!t.length)return;if(t.length===1){o.panTo({lat:t[0].latitude,lng:t[0].longitude}),o.setZoom(Q);return}const a=O(t);a&&o.fitBounds(a,L)},T=e=>{!o||!k(e)||(o.panTo({lat:e.latitude,lng:e.longitude}),o.setZoom(W))},h=()=>{if(!o)return;const e=O(n.locations);e&&o.fitBounds(e,L)},A=async()=>{if(await V(),!c.value)return;const e=c.value,t=q?.trim()||"DEMO_MAP_ID",[{Map:a},{AdvancedMarkerElement:D}]=await Promise.all([google.maps.importLibrary("maps"),google.maps.importLibrary("marker")]);u=D,p=E(e,"--palette-bg-primary-solid"),f=E(e,"--palette-bg-primary"),o=new a(e,{center:{lat:0,lng:0},zoom:2,mapTypeControl:!1,mapId:t}),m=new ResizeObserver(()=>{o&&google.maps.event.trigger(o,"resize")}),m.observe(e),I(),setTimeout(()=>{h(),g(n.selectedLocationId)},100)};return S(async()=>{try{await A()}catch(e){console.error("Google Maps failed to load",e),d.value=!0}}),G(()=>{m?.disconnect(),M(),o=null,u=null}),v(()=>n.locations,async()=>{o&&(I(),setTimeout(()=>{h(),g(n.selectedLocationId)},50))},{deep:!0}),v(()=>n.openCityGroup,async(e,t)=>{o&&(e?B(e):t&&h())}),v(()=>n.selectedLocationId,e=>{if(!o||(g(e),e==null))return;const t=n.locations.find(a=>a.contentId===e);t&&T(t)}),(e,t)=>(b(),w("div",R,[d.value?(b(),w("div",H,[C("p",null,U(Z(x)("/locationfinder/map-load-error")),1)])):P("",!0),$(C("div",{ref_key:"mapContainer",ref:c,class:"aspect-square w-full"},null,512),[[j,!d.value]])]))}});export{X as default};

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.