import { u } from './SearchSkelton-Ny94V-hi.mjs';
import { v } from './breadcrumb-DGU_YuMK.mjs';
import { $ } from './ProductCard-BWoG9xpD.mjs';
import { a } from './NoData-IIg4-CUc.mjs';
import { ref, computed, resolveComponent, unref, mergeProps, isRef, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrRenderComponent, ssrRenderList } from 'vue/server-renderer';
import { u as Qt, i as Ma, a as Ts, d as gs } from './server.mjs';
import './Skeleton-DfjdyTna.mjs';
import './SvgIcon-YE_5uJaI.mjs';
import './star-mqjJGHgV.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';

const x = { __name: "search", __ssrInlineRender: true, setup(u2) {
  var x2;
  const f2 = Qt().$axios, k = Ma(), j = ref(+(null == (x2 = k.query) ? undefined : x2.page) || 1), { data: q, status: w } = Ts("search", () => {
    var e2, r2;
    return f2.get("search", { params: { keyword: null == (e2 = k.query) ? undefined : e2.keyword, page: null == (r2 = k.query) ? undefined : r2.page } }).then((e3) => e3.data).catch((e3) => e3.response);
  }, { watch: [() => {
    var e2;
    return null == (e2 = k.query) ? undefined : e2.keyword;
  }, () => {
    var e2;
    return null == (e2 = k.query) ? undefined : e2.page;
  }] }), { t: _ } = gs(), S = computed(() => {
    var e2, r2;
    return [{ name: _("NAV.home"), to: "/" }, { name: _("TITLES.search"), to: "", disabled: true }, { name: null == (e2 = k.query) ? undefined : e2.keyword, to: `/search?keyword=${null == (r2 = k.query) ? undefined : r2.keyword}` }];
  });
  return (t2, i2, u3, c2) => {
    var g2, h2, y2, x3;
    const f3 = u, k2 = v, _2 = $, $$1 = resolveComponent("VPagination"), b = a;
    "pending" === unref(w) ? (i2(`<div${ssrRenderAttrs(mergeProps({ class: "container my-10" }, c2))}>`), i2(ssrRenderComponent(f3, null, null, u3)), i2("</div>")) : "success" === unref(w) ? (i2(`<div${ssrRenderAttrs(mergeProps({ class: "my-10 container" }, c2))}>`), i2(ssrRenderComponent(k2, { "data-aos": "fade-right", items: unref(S) }, null, u3)), (null == (h2 = null == (g2 = unref(q)) ? undefined : g2.data) ? undefined : h2.length) ? (i2('<div><div 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-2.5"><!--[-->'), ssrRenderList(null == (y2 = unref(q)) ? undefined : y2.data, (e2) => {
      i2(ssrRenderComponent(_2, { key: e2.id, product: e2 }, null, u3));
    }), i2('<!--]--></div><div class="mt-10">'), i2(ssrRenderComponent($$1, { modelValue: unref(j), "onUpdate:modelValue": [(e2) => isRef(j) ? j.value = e2 : null, (e2) => t2.$router.push({ query: Object.assign({}, t2.$route.query, { page: e2 }) })], pages: null == (x3 = unref(q)) ? undefined : x3.meta.last_page, "range-size": 1, "active-color": "#DCEDFF" }, null, u3)), i2("</div></div>")) : (i2("<div>"), i2(ssrRenderComponent(b, { class: "!min-h-[35vh]" }, null, u3)), i2("</div>")), i2("</div>")) : i2("<!---->");
  };
} }, f = x.setup;
x.setup = (e2, r2) => {
  const o2 = useSSRContext();
  return (o2.modules || (o2.modules = /* @__PURE__ */ new Set())).add("pages/search.vue"), f ? f(e2, r2) : undefined;
};

export { x as default };
//# sourceMappingURL=search-BJp11wnD.mjs.map
