import{_ as m,at as p,o as S}from"./index-bc1cd1f7.js";import{p as f,c as _,d as h}from"./Main-5e1e6212.js";import{P as C}from"./ProductCard-a724df0f.js";import{b5 as g,bm as i,e as n,bn as d,bf as o,g as N,bh as b,N as l,l as v}from"./vendor-d15da3cb.js";import"./tendor-09c4e69c.js";const w={components:{TCSlider:p,ProductCard:C},data(){return{loading:!1}},computed:{...S(f),sliderPerView(){const{xs:e,sm:t,md:r}=g();return e.value?2:t.value||r.value?6:8}},methods:{onReachEnd(e){let t={pageIndex:e,pageSize:20};this.getMostSales(t)},getMostSales(e){this.productsStore.isNextByMostSales&&this.productsStore.actions.fetchMostSales(e)}},mounted(){this.getMostSales()},unmounted(){this.productsStore.isNextByMostSales=!0,this.productsStore.mostSales=[]}},x={class:"section-title"};function M(e,t,r,P,V,a){const c=i("ProductCard"),u=i("TCSlider");return n(),d(h,{class:"mb-6"},{default:o(()=>[e.productsStore.mostSales.length>0?(n(),d(_,{key:0,cols:"12"},{default:o(()=>[N("div",x,b(e.$t("BEST_SELLERS")),1),l(u,{"space-between":16,"per-view":a.sliderPerView,items:e.productsStore.mostSales,onReachEnd:t[0]||(t[0]=s=>a.onReachEnd(s))},{default:o(({item:s})=>[l(c,{item:s},null,8,["item"])]),_:1},8,["per-view","items"])]),_:1})):v("",!0)]),_:1})}const $=m(w,[["render",M]]);export{$ as default};