import{i as f}from"./Bng-T5t5.js";import{d as v,a as _,r as m,e as b,aF as h,f as k,x as w,h as n,v as t,g as l,A as x,o as y,n as C,_ as N}from"./BxiWQxwE.js";const $={key:0,class:"store__address"},M=["aria-label"],T=v({__name:"address",props:{store:{type:Object,required:!0}},setup(e){const s=e,{$gtm:p,$messages:u}=_(),i=m(),r=m(!1),c=b(()=>{var o,a,d;return`https://www.google.com/maps/dir/?api=1&origin=&destination=DekaMarkt,+${(o=s.store)==null?void 0:o.street} ${(a=s.store)==null?void 0:a.houseNumber}, ${(d=s.store)==null?void 0:d.postalCode}`}),g=async()=>{var o,a;r.value=!0,p("stores.location_route",{location_name:(o=s.store)==null?void 0:o.name,location_id:(a=s.store)==null?void 0:a.storeId}),f(c.value)?(window.location.href=c.value,i.value=setTimeout(()=>{r.value=!1},3e3)):(await C(c.value,{open:{target:"_blank"},external:!0}),r.value=!1)};return h(()=>{i.value&&clearTimeout(i.value)}),(o,a)=>e.store?(y(),k("div",$,[n("h2",null,t(l(u)("stores.contact")),1),n("span",null,t(e.store.name)+" "+t(e.store.houseNumber),1),n("p",null,t(e.store.postalCode)+" "+t(e.store.city),1),n("p",null,t(e.store.phoneNumber),1),n("button",{type:"button",class:x(["button button--green",{loading:l(r)}]),"aria-label":l(u)("stores.showRoute"),onClick:g},t(l(u)("aria.googleMaps.showRoute")),11,M)])):w("",!0)}}),O=N(T,[["__scopeId","data-v-b270e5ac"]]);export{O as default};
