"use strict";exports.id=339,exports.ids=[339],exports.modules={30339:(e,o,s)=>{s.a(e,async(e,a)=>{try{s.d(o,{LV:()=>useFollowedShops,NT:()=>useTopShops,Uu:()=>useFollowedShopsProducts});var t=s(61175),u=s(77649),r=s(54574),n=s(11163),p=e([r]);function useTopShops(e,o){let{locale:s}=(0,n.useRouter)(),a={...e,language:s},{data:p,isLoading:l,error:g,fetchNextPage:i,hasNextPage:d,isFetching:c,isFetchingNextPage:P}=(0,t.useInfiniteQuery)([u.P.TOP_SHOPS,a],({queryKey:e,pageParam:o})=>r.Z.shops.top(Object.assign({},e[1],o)),{...o,getNextPageParam:({current_page:e,last_page:o})=>o>e&&{page:e+1}});return{shops:p?.pages.flatMap(e=>e.data)??[],isLoading:l,error:g,hasNextPage:d,isFetching:c,isLoadingMore:P,loadMore:function(){i()}}}function useFollowedShops(e,o){let{data:s,isLoading:a,error:n,fetchNextPage:p,hasNextPage:l,isFetching:g,isFetchingNextPage:i}=(0,t.useInfiniteQuery)([u.P.FOLLOWED_SHOPS,e],({queryKey:e,pageParam:o})=>r.Z.follow.shops(Object.assign({},e[1],o)),{...o,getNextPageParam:({current_page:e,last_page:o})=>o>e&&{page:e+1}});return{shops:s?.pages.flatMap(e=>e.data)??[],paginatorInfo:Array.isArray(s?.pages)?s?.pages[s.pages.length-1]:null,isLoading:a,error:n,hasNextPage:l,isFetching:g,isLoadingMore:i,loadMore:function(){p()}}}function useFollowedShopsProducts(e){let{locale:o}=(0,n.useRouter)(),s={...e,language:o},{data:a,isLoading:p,error:l}=(0,t.useQuery)([u.P.FOLLOWED_SHOPS_PRODUCTS,s],({queryKey:e})=>r.Z.follow.followedShopProducts(Object.assign({},e[1])));return{products:a??[],isLoading:p,error:l}}r=(p.then?(await p)():p)[0],a()}catch(e){a(e)}})}};