1import R from"./Cj75xKPk.js";import D from"./DtDmeJ2z.js";import{eR as E,m as g,d as x,b as $,k as A,c as u,o as w,p as B,g as N,q as T,j as a,a as O,s as h,i as I,y,$ as k,P as C}from"./DQM39uDX.js";import{e as M}from"./18j-wRjb.js";import{R as G}from"./ZMt00yuo.js";import"./5N-lnMGR.js";import"./qAG6p-HO.js";import"./DMjquUbV.js";import"./CakEfQ_i.js";import"./D_p0C4oE.js";import"./SaSj47Qg.js";import"./DBpqvHB_.js";import"./Dvfy4vOh.js";import"./DH4SEjIy.js";import"./Byo0LGEp.js";import"./DZiXZHzj.js";import"./Bkn6PGI1.js";import"./DBFofL9w.js";import"./Du4oow_A.js";import"./DEVyxonu.js";import"./DSxm6jZD.js";import"./JJoLBmx9.js";import"./D-JM3t2A.js";function J(){const m=(r,e)=>{if(!e||!("recipeListsV2"in e))return e;if(!e?.recipeListsV2?.items?.length)return r;const o=r?.recipeListsV2?.items?.[0],t=e.recipeListsV2.items[0];if(!o||!t)return e;const c=o.items?.recipeListItems||[],p=t.items?.recipeListItems||[],d=[...c,...p];return{recipeListsV2:{...e.recipeListsV2,items:[{...t,items:{...t.items,recipeListItems:d}}]}}};return{getFavoriteRecipeList:()=>{const{error:r,onError:e,onResult:o,load:t,loading:c,fetchMore:p,refetch:d}=E(void 0,{fetchPolicy:"network-only"}),f=g(null),v=g(null);e(i=>{console.error("FavoriteRecipes query error:",JSON.stringify(i))});const s=(i=1)=>t(void 0,{size:24,page:i});return o(({data:i})=>{if(!i?.recipeListsV2?.items?.length)return;const n=i.recipeListsV2.items[0];v.value=n.items.paginationInfo,f.value=n}),{error:r,result:f,loading:c,load:s,fetchMore:async i=>await p({variables:{size:24,page:i},updateQuery:(n,{fetchMoreResult:_})=>_?m(n,_):n}),paginationInfo:v,refetch:d}},DEFAULT_PAGINATION_LIMIT:24}}const U=x({__name:"RecipeListDetail",setup(b){const{isAuthenticated:m}=$(),{getFavoriteRecipeList:l}=J(),{result:r,load:e,loading:o,error:t,fetchMore:c,paginationInfo:p,refetch:d}=l(),f=A(),v=u(()=>f.locale.value===M.nl_be?"/nl-be":""),s=g(1),L=u(()=>!!t.value&&!r.value),i=u(()=>!o.value&&!L.value&&(!r.value||r.value.totalRecipes===0)),n=u(()=>!!p.value?.hasNextPage),_=async()=>{o.value||!n.value||(s.value+=1,await c(s.value))},P=async()=>{s.value=1,await e(s.value)},V=async()=>{s.value=1,await d()};return w(()=>{B(()=>m.value,async F=>{F&&(s.value=1,await e(s.value))},{immediate:!0})}),(F,q)=>(N(),T(G,{"is-loading":a(o),"has-error":a(L),"is-empty":a(i),"recipe-list":a(r),"has-more":a(n),"redirect-url":`${a(v)}/recepten/favorieten`,refetch:V,"list-id":a(r)?.id,onFetchMore:_,onRetry:P},null,8,["is-loading","has-error","is-empty","recipe-list","has-more","redirect-url","list-id"]))}}),z=x({__name:"index",setup(b){O({title:"Favoriete recepten",meta:[{name:"robots",content:"noindex, nofollow"}]});const m=A(),l=u(()=>m.locale.value===M.nl_be?"/nl-be":""),r=`${l.value}/recepten/favorieten`,e=u(()=>[{title:"Recepten",url:`${l.value}/recepten`},{title:"Favoriete recepten",url:`${l.value}/recepten/favorieten/categorieen`},{title:"Je favoriete recepten",url:r}]);return(o,t)=>{const c=R,p=D;return N(),T(a(k),{class:"recipe-list-detail-page"},{default:h(()=>[I(c,{breadcrumbs:a(e),class:"breadcrumbs"},null,8,["breadcrumbs"]),I(p,{"heading-props":{h1:!0,strong:!0},"data-testid":"recipe-list-page-title",class:"header"},{"app-title":h(()=>t[0]||(t[0]=[y(" Je favoriete recepten ")])),default:h(()=>t[1]||(t[1]=[y(" Je favoriete recepten ")])),_:1}),I(U)]),_:1})}}}),fe=C(z,[["__scopeId","data-v-1bb2a67f"]]);export{fe 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.