import { d } from './Skeleton-BBJiWBrY.mjs';
import { mergeProps, ref, computed, resolveComponent, unref, isRef, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrRenderComponent, ssrRenderList } from 'vue/server-renderer';
import { d as uf, a as Qt, h as Ma, i as wn, b as Qs } from './server.mjs';
import { d as d$1 } from './breadcrumb-gjE702oE.mjs';
import { $ } from './ProductCard-Ce2XP_sg.mjs';
import { a } from './NoData-DiE8X5YK.mjs';
import '../_/nitro.mjs';
import 'node:http';
import 'node:https';
import 'node:fs';
import 'node:url';
import 'node:path';
import 'unhead';
import '@unhead/shared';
import 'vue-router';
import 'vue-rate';
import 'date-fns';
import '@hennge/vue3-pagination';
import 'axios';
import 'vue-social-sharing';
import './SvgIcon-BKMVrGmr.mjs';
import './star-mqjJGHgV.mjs';

const y = {};
const f = y.setup;
y.setup = (s2, a2) => {
  const e2 = useSSRContext();
  return (e2.modules || (e2.modules = /* @__PURE__ */ new Set())).add("components/Shared/SearchSkelton.vue"), f ? f(s2, a2) : undefined;
};
const k = uf(y, [["ssrRender", function(l2, e2, r2, d2) {
  const o2 = d;
  e2(`<div${ssrRenderAttrs(mergeProps({ class: "my-10" }, d2))}>`), e2(ssrRenderComponent(o2, { class: "h-[16px] w-[200px] mb-6 lg:mb-14" }, null, r2)), e2('<div class="flex-1 space-y-10 lg:col-span-9"><div class="grid grid-cols-1 xs:grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-y-8 gap-x-4"><div class="space-y-4">'), e2(ssrRenderComponent(o2, { class: "h-[300px] w-[100%] rounded-md" }, null, r2)), e2(ssrRenderComponent(o2, { class: "h-[14px] w-[70%]" }, null, r2)), e2(ssrRenderComponent(o2, { class: "h-[14px] w-[40%]" }, null, r2)), e2(ssrRenderComponent(o2, { class: "h-[14px] w-[50%]" }, null, r2)), e2('</div><div class="space-y-4">'), e2(ssrRenderComponent(o2, { class: "h-[300px] w-[100%] rounded-md" }, null, r2)), e2(ssrRenderComponent(o2, { class: "h-[14px] w-[70%]" }, null, r2)), e2(ssrRenderComponent(o2, { class: "h-[14px] w-[40%]" }, null, r2)), e2(ssrRenderComponent(o2, { class: "h-[14px] w-[50%]" }, null, r2)), e2('</div><div class="space-y-4">'), e2(ssrRenderComponent(o2, { class: "h-[300px] w-[100%] rounded-md" }, null, r2)), e2(ssrRenderComponent(o2, { class: "h-[14px] w-[70%]" }, null, r2)), e2(ssrRenderComponent(o2, { class: "h-[14px] w-[40%]" }, null, r2)), e2(ssrRenderComponent(o2, { class: "h-[14px] w-[50%]" }, null, r2)), e2('</div><div class="space-y-4">'), e2(ssrRenderComponent(o2, { class: "h-[300px] w-[100%] rounded-md" }, null, r2)), e2(ssrRenderComponent(o2, { class: "h-[14px] w-[70%]" }, null, r2)), e2(ssrRenderComponent(o2, { class: "h-[14px] w-[40%]" }, null, r2)), e2(ssrRenderComponent(o2, { class: "h-[14px] w-[50%]" }, null, r2)), e2('</div><div class="space-y-4">'), e2(ssrRenderComponent(o2, { class: "h-[300px] w-[100%] rounded-md" }, null, r2)), e2(ssrRenderComponent(o2, { class: "h-[14px] w-[70%]" }, null, r2)), e2(ssrRenderComponent(o2, { class: "h-[14px] w-[40%]" }, null, r2)), e2(ssrRenderComponent(o2, { class: "h-[14px] w-[50%]" }, null, r2)), e2('</div><div class="space-y-4">'), e2(ssrRenderComponent(o2, { class: "h-[300px] w-[100%] rounded-md" }, null, r2)), e2(ssrRenderComponent(o2, { class: "h-[14px] w-[70%]" }, null, r2)), e2(ssrRenderComponent(o2, { class: "h-[14px] w-[40%]" }, null, r2)), e2(ssrRenderComponent(o2, { class: "h-[14px] w-[50%]" }, null, r2)), e2('</div><div class="space-y-4">'), e2(ssrRenderComponent(o2, { class: "h-[300px] w-[100%] rounded-md" }, null, r2)), e2(ssrRenderComponent(o2, { class: "h-[14px] w-[70%]" }, null, r2)), e2(ssrRenderComponent(o2, { class: "h-[14px] w-[40%]" }, null, r2)), e2(ssrRenderComponent(o2, { class: "h-[14px] w-[50%]" }, null, r2)), e2('</div><div class="space-y-4">'), e2(ssrRenderComponent(o2, { class: "h-[300px] w-[100%] rounded-md" }, null, r2)), e2(ssrRenderComponent(o2, { class: "h-[14px] w-[70%]" }, null, r2)), e2(ssrRenderComponent(o2, { class: "h-[14px] w-[40%]" }, null, r2)), e2(ssrRenderComponent(o2, { class: "h-[14px] w-[50%]" }, null, r2)), e2('</div></div><div class="mt-10 flex justify-center gap-4">'), e2(ssrRenderComponent(o2, { class: "h-[30px] w-[60px]" }, null, r2)), e2(ssrRenderComponent(o2, { class: "h-[30px] w-[60px]" }, null, r2)), e2(ssrRenderComponent(o2, { class: "h-[30px] w-[60px]" }, null, r2)), e2("</div></div></div>");
}]]), j = { __name: "search", __ssrInlineRender: true, setup(s2) {
  var l2;
  const p2 = Qt().$axios, y2 = Ma(), f2 = ref(+(null == (l2 = y2.query) ? undefined : l2.page) || 1), { data: j2, status: q2 } = wn("search", () => {
    var s3, l3;
    return p2.get("search", { params: { keyword: null == (s3 = y2.query) ? undefined : s3.keyword, page: null == (l3 = y2.query) ? undefined : l3.page } }).then((s4) => s4.data).catch((s4) => s4.response);
  }, { watch: [() => {
    var s3;
    return null == (s3 = y2.query) ? undefined : s3.keyword;
  }, () => {
    var s3;
    return null == (s3 = y2.query) ? undefined : s3.page;
  }] }), { t: _ } = Qs(), b = computed(() => {
    var s3, l3;
    return [{ name: _("NAV.home"), to: "/" }, { name: _("TITLES.search"), to: "", disabled: true }, { name: null == (s3 = y2.query) ? undefined : s3.keyword, to: `/search?keyword=${null == (l3 = y2.query) ? undefined : l3.keyword}` }];
  });
  return (s3, l3, e2, r2) => {
    var p3, t2, m2, v2;
    const h2 = k, y3 = d$1, _2 = $, S = resolveComponent("VPagination"), $$1 = a;
    "pending" === unref(q2) ? (l3(`<div${ssrRenderAttrs(mergeProps({ class: "container my-10" }, r2))}>`), l3(ssrRenderComponent(h2, null, null, e2)), l3("</div>")) : "success" === unref(q2) ? (l3(`<div${ssrRenderAttrs(mergeProps({ class: "my-10 container" }, r2))}>`), l3(ssrRenderComponent(y3, { "data-aos": "fade-right", items: unref(b) }, null, e2)), (null == (t2 = null == (p3 = unref(j2)) ? undefined : p3.data) ? undefined : t2.length) ? (l3('<div><div class="grid grid-cols-1 mt-6 lg:mt-14 xs:grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-y-8 gap-x-4"><!--[-->'), ssrRenderList(null == (m2 = unref(j2)) ? undefined : m2.data, (s4) => {
      l3(ssrRenderComponent(_2, { key: s4.id, product: s4 }, null, e2));
    }), l3('<!--]--></div><div class="mt-10">'), l3(ssrRenderComponent(S, { modelValue: unref(f2), "onUpdate:modelValue": [(s4) => isRef(f2) ? f2.value = s4 : null, (l4) => s3.$router.push({ query: Object.assign({}, s3.$route.query, { page: l4 }) })], pages: null == (v2 = unref(j2)) ? undefined : v2.meta.last_page, "range-size": 1, "active-color": "#DCEDFF" }, null, e2)), l3("</div></div>")) : (l3("<div>"), l3(ssrRenderComponent($$1, { class: "!min-h-[35vh]" }, null, e2)), l3("</div>")), l3("</div>")) : l3("<!---->");
  };
} }, q = j.setup;
j.setup = (s2, a2) => {
  const e2 = useSSRContext();
  return (e2.modules || (e2.modules = /* @__PURE__ */ new Set())).add("pages/search.vue"), q ? q(s2, a2) : undefined;
};

export { j as default };
//# sourceMappingURL=search-lsSb__b3.mjs.map
