import j from"./9mcJnkzw.js";import{d as R,a as T,u as D,a3 as F,e as $,f as u,x as v,g as e,h as M,i as _,B as g,v as f,z as O,F as I,y as S,C as L,a0 as z,o as s,n as A,t as E,bp as U,bq as W,br as G,bl as H,_ as J}from"./BxiWQxwE.js";const K={class:"container"},Q={key:0,class:"breadcrumbs"},X=["aria-label","data-breadcrumb-item","data-footer-navigation-item"],Y={key:0,class:"breadcrumbs__last"},Z={key:1},ee={key:1,class:"breadcrumbs__mobile"},ae=R({__name:"breadcrumbs",props:{lastBreadCrumb:{type:Object,required:!1,default:null}},setup(N){const{$messages:c}=T(),l=D(),q=F(),k=N,P=async()=>window.history.length>1?q.back():await A("/"),C={meer:"/recepten",recepten:"/meer/recepten/recepten"},V=(a,b,p)=>{var r;const n=((r=y(a))==null?void 0:r.toLowerCase())??"";if(C[n])return C[n];const t=b.length>1?`/${b.slice(0,p+1).join("/")}`:`/${a}`;return t.includes("/boodschappen")&&!t.includes("/boodschappenlijsten")?t.replace("boodschappen","producten"):t},i=$(()=>{if(l.path==="/")return[];const a=l.path.split("/").slice(1,l.path.length-1),b=a.map((t,r)=>{const m=y(t);return{to:V(t,a,r),label:m}});b.unshift({to:"/",label:c("menuItems.home")??""});const n=b.filter((t,r,m)=>r===m.findIndex(o=>o.to===t.to)).filter(t=>!/^\d+$/.test(t.label??""));return k.lastBreadCrumb&&n.splice(-1,1,{to:l.fullPath,label:k.lastBreadCrumb.name}),n}),y=a=>l.params.search===a?W(a):a.toLowerCase()==="volgende-week"?c("offers.nextWeek"):a.toLowerCase()==="boodschappen"?c("navigation.header.products"):decodeURIComponent(G(a)),d=$(()=>i.value[i.value.length-2]);return(a,b)=>{var m;const p=j,n=z,t=H,r=U;return s(),u("div",K,[a.$device.isDesktopOrTablet&&e(i)&&e(i).length>0?(s(),u("div",Q,[M("button",{class:"breadcrumbs--back",type:"button","aria-label":e(c)("menuItems.back"),"data-breadcrumb-item":e(c)("menuItems.back"),"data-footer-navigation-item":e(c)("menuItems.back"),"data-footer-navigation-position":"0",onClick:O(P,["prevent"])},[_(p),g(" "+f(e(c)("menuItems.back")),1)],8,X),(s(!0),u(I,null,S(e(i),(o,h)=>{var w,x,B;return s(),u(I,{key:o.to},[h===((w=e(i))==null?void 0:w.length)-1?(s(),u("span",Y,f(o.label),1)):(s(),u("span",Z,[_(n,{to:o.to,alt:o.label,"aria-label":o.label,"data-breadcrumb-navigation":e(l).path.split("/")[1],"data-footer-navigation-item":(x=o.label)==null?void 0:x.replace("&","en"),"data-footer-navigation-pos":h+1},{default:L(()=>[g(f(o.label),1)]),_:2},1032,["to","alt","aria-label","data-breadcrumb-navigation","data-footer-navigation-item","data-footer-navigation-pos"]),h<((B=e(i))==null?void 0:B.length)-1?(s(),E(t,{key:0})):v("",!0)]))],64)}),128))])):v("",!0),a.$device.isMobile&&e(d)?(s(),u("div",ee,[_(n,{to:e(d).to,alt:e(d).label,"aria-label":e(d).label,"data-breadcrumb-navigation":e(l).path.split("/")[1],"data-footer-navigation-item":(m=e(d).label)==null?void 0:m.replace("&","en"),"data-footer-navigation-pos":1},{default:L(()=>[_(r),g(" "+f(e(d).label),1)]),_:1},8,["to","alt","aria-label","data-breadcrumb-navigation","data-footer-navigation-item"])])):v("",!0)])}}}),ne=J(ae,[["__scopeId","data-v-69461f6b"]]);export{ne as default};
