import{_ as a}from"./BFGD5nxj.js";import{_ as s}from"./COeR2CVx.js";import{_ as e}from"./XH89fbpA.js";import{_ as r}from"./CFg7FNs1.js";import{a as o,h as l,i as t,b as i,P as d}from"./u7I9BgvO.js";import{c as u,f as n,A as m,u as c,L as p,M as v,H as g,$ as y,G as h,O as k,V as j,x as f,W as q}from"./BCDZ6bul.js";import"./Dux3niWr.js";import"./XQnr5WFw.js";import"./mqjJGHgV.js";const _={key:0,class:"container my-10"},w={key:1,class:"my-10 container"},V={key:0},x={class:"grid mt-6 lg:mt-14 grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-y-8 gap-x-4"},$={class:"mt-10"},b={key:1},D={__name:"search",setup(D){var L;const O=o().$axios,P=l(),T=u(+(null==(L=P.query)?void 0:L.page)||1),{data:A,status:E}=t("search",(()=>{var a,s;return O.get("search",{params:{keyword:null==(a=P.query)?void 0:a.keyword,page:null==(s=P.query)?void 0:s.page}}).then((a=>a.data)).catch((a=>a.response))}),{watch:[()=>{var a;return null==(a=P.query)?void 0:a.keyword},()=>{var a;return null==(a=P.query)?void 0:a.page}]}),{t:F}=i(),M=n((()=>{var a,s;return[{name:F("NAV.home"),to:"/"},{name:F("TITLES.search"),to:"",disabled:!0},{name:null==(a=P.query)?void 0:a.keyword,to:`/search?keyword=${null==(s=P.query)?void 0:s.keyword}`}]}));return(o,l)=>{var t,i,u,n;const D=a,L=s,O=e,P=m("VPagination"),F=r;return"pending"===c(E)?(p(),v("div",_,[g(D)])):"success"===c(E)?(p(),v("div",w,[g(L,{"data-aos":"fade-right",items:c(M)},null,8,["items"]),(null==(i=null==(t=c(A))?void 0:t.data)?void 0:i.length)?(p(),v("div",V,[y("div",x,[(p(!0),v(h,null,k(null==(u=c(A))?void 0:u.data,(a=>(p(),j(O,{key:a.id,product:a},null,8,["product"])))),128))]),y("div",$,[g(P,{modelValue:c(T),"onUpdate:modelValue":[l[0]||(l[0]=a=>f(T)?T.value=a:null),l[1]||(l[1]=a=>o.$router.push({query:Object.assign({},(o._.provides[d]||o.$route).query,{page:a})}))],pages:null==(n=c(A))?void 0:n.meta.last_page,"range-size":1,"active-color":"#DCEDFF"},null,8,["modelValue","pages"])])])):(p(),v("div",b,[g(F,{class:"!min-h-[35vh]"})]))])):q("",!0)}}};export{D as default};
