import { defineComponent, onMounted, inject, ref, onUnmounted, watch, mergeProps, unref, withCtx, createTextVNode, toDisplayString, createBlock, openBlock, createVNode, createCommentVNode, useSSRContext } from "vue";
import { ssrRenderAttrs, ssrRenderStyle, ssrRenderAttr, ssrRenderList, ssrRenderComponent, ssrInterpolate, ssrRenderClass, ssrIncludeBooleanAttr } from "vue/server-renderer";
import { u as useNumberFormat } from "./useNumberFormat-BUoWzkrL.js";
import { usePage, router, useForm, Link } from "@inertiajs/vue3";
import axios from "axios";
import $ from "jquery";
import Debounce from "lodash/debounce.js";
import Swiper from "swiper";
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "HeaderType5",
  __ssrInlineRender: true,
  props: {
    status: {}
  },
  setup(__props) {
    let Bootstrap = null;
    onMounted(() => {
      if (typeof window !== "undefined") {
        Bootstrap = inject("bootstrap");
      }
    });
    const dark = ref(usePage().props.dark);
    if (typeof window !== "undefined") {
      if (dark.value) {
        $("body").attr("id", "dark");
      } else {
        $("body").attr("id", "light");
      }
    }
    const searchContainerStatus = ref(false);
    const searchContainerElement = ref(null);
    const handleClickOutside = (event) => {
      const target = event.target;
      const isSearchClicked = target instanceof Element && target.closest(".user-helper--search");
      if (searchContainerElement.value && !searchContainerElement.value.contains(target) && !isSearchClicked) {
        searchContainerStatus.value = false;
      }
    };
    onMounted(() => {
      document.addEventListener("click", handleClickOutside);
    });
    onUnmounted(() => {
      document.removeEventListener("click", handleClickOutside);
    });
    router.on("start", () => {
      searchContainerStatus.value = false;
    });
    const searchProductSwiper = () => {
      new Swiper(".swiper-history-product-list", {
        slidesPerView: "auto",
        spaceBetween: 10,
        loop: false,
        navigation: {
          nextEl: ".history-product-list .slider-next",
          prevEl: ".history-product-list .slider-prev"
        },
        observer: true
      });
    };
    const search = ref();
    useForm({
      search: search.value
    });
    const categories = ref([]);
    const products = ref([]);
    watch(
      search,
      Debounce((value) => {
        axios.post(route("main.search"), {
          keyword: value
        }).then(function(response) {
          categories.value = response.data.categories;
          products.value = response.data.products;
          searchProductSwiper();
        }).catch(function(error) {
          searchProductSwiper();
        });
        if (value == null || value.length == 0) {
          categories.value = [];
          products.value = [];
          searchProductSwiper();
        }
      }, 300)
    );
    onMounted(() => {
      searchProductSwiper();
    });
    const closeSearchDropdown = () => {
      $(".search-field").each((i, obj) => {
        new Bootstrap.Dropdown(obj).hide();
      });
    };
    onMounted(() => {
      if (usePage().props.template.get_top_banner.desktop.image != null) {
        $("body").addClass("sticky-header-with-top-banner");
      } else {
        $("body").addClass("sticky-header");
      }
      $(window).on("scroll", function() {
        let scrollPosition = $(window).scrollTop();
        if (scrollPosition > 60) {
          $(".header-five").addClass("header-sticky");
        }
        if (scrollPosition < 20) {
          $(".header-five").removeClass("header-sticky");
        }
      });
    });
    const hoveredCategory = ref(null);
    const chunkCategories = (categories2, columns) => {
      const chunkSize = Math.ceil(categories2.length / columns);
      const chunks = [];
      for (let i = 0; i < categories2.length; i += chunkSize) {
        chunks.push(categories2.slice(i, i + chunkSize));
      }
      return chunks;
    };
    onMounted(() => {
      var _a;
      if (((_a = usePage().props.categories) == null ? void 0 : _a.length) > 0) {
        hoveredCategory.value = usePage().props.categories[0].id;
      }
    });
    return (_ctx, _push, _parent, _attrs) => {
      var _a, _b, _c;
      _push(`<div${ssrRenderAttrs(mergeProps({
        class: { "header-five": true, "header-five-sticky": _ctx.status != "dev", readonly: _ctx.status == "dev" }
      }, _attrs))}>`);
      if (_ctx.status != "dev" && !_ctx.$page.props.currentRouteName.includes("cart") && !_ctx.$page.props.currentRouteName.includes("prefactor") && !_ctx.$page.props.currentRouteName.includes("user.orders.sales_factor") && !_ctx.$page.props.currentRouteName.includes("admin.orders.sales_factor")) {
        _push(`<!--[-->`);
        if (_ctx.$page.props.template.get_top_banner.desktop.image != null) {
          _push(`<div style="${ssrRenderStyle({ "font-size": "0px !important" })}" class="top-banner-section d-md-block d-none"><a${ssrRenderAttr("href", _ctx.$page.props.template.get_top_banner.link != null ? _ctx.$page.props.template.get_top_banner.link : "/")}><img${ssrRenderAttr("src", _ctx.$page.props.template.get_top_banner.desktop.image)}${ssrRenderAttr("alt", _ctx.$page.props.template.get_top_banner.desktop.alt)} class="w-100"></a></div>`);
        } else {
          _push(`<!---->`);
        }
        if (_ctx.$page.props.template.get_top_banner.mobile.image != null) {
          _push(`<div style="${ssrRenderStyle({ "font-size": "0px !important" })}" class="top-banner-section d-md-none"><a${ssrRenderAttr("href", _ctx.$page.props.template.get_top_banner.link != null ? _ctx.$page.props.template.get_top_banner.link : "/")}><img${ssrRenderAttr("src", _ctx.$page.props.template.get_top_banner.mobile.image)}${ssrRenderAttr("alt", _ctx.$page.props.template.get_top_banner.mobile.alt)} class="w-100"></a></div>`);
        } else {
          _push(`<!---->`);
        }
        _push(`<!--]-->`);
      } else {
        _push(`<!---->`);
      }
      _push(`<header class="page-header mb-0"><div class="container"><div class="header-section d-flex align-items-center justify-content-between mt-3 pb-3"><div class="d-flex align-items-center">`);
      if (_ctx.$page.props.menu.header_main != null) {
        _push(`<div class="navigation-container dropdown d-md-none d-block"><a class="navigation-container--icon el-center shadow-1" href="javascript:void(0)" role="button" data-bs-toggle="dropdown" aria-expanded="false"><i class="ri-menu-3-line"></i></a><ul class="dropdown-menu shadow-1"><!--[-->`);
        ssrRenderList(_ctx.$page.props.menu.header_main.get_items, (item, index) => {
          _push(`<li class="nav-item">`);
          if (item.type == "internal") {
            _push(ssrRenderComponent(unref(Link), {
              class: "dropdown-item lts-05",
              href: item.link,
              prefetch: _ctx.$page.props.prefetch.status,
              "cache-for": _ctx.$page.props.prefetch.delay
            }, {
              default: withCtx((_, _push2, _parent2, _scopeId) => {
                if (_push2) {
                  _push2(`${ssrInterpolate(item.name)}`);
                } else {
                  return [
                    createTextVNode(toDisplayString(item.name), 1)
                  ];
                }
              }),
              _: 2
            }, _parent));
          } else {
            _push(`<!---->`);
          }
          if (item.type == "external") {
            _push(`<a class="dropdown-item lts-05"${ssrRenderAttr("href", item.link)} target="_blank">${ssrInterpolate(item.name)}</a>`);
          } else {
            _push(`<!---->`);
          }
          _push(`</li>`);
        });
        _push(`<!--]--></ul></div>`);
      } else {
        _push(`<!---->`);
      }
      _push(`<div class="logo-container">`);
      _push(ssrRenderComponent(unref(Link), {
        class: "logo",
        href: _ctx.$page.props.appUrl
      }, {
        default: withCtx((_, _push2, _parent2, _scopeId) => {
          if (_push2) {
            if (_ctx.$page.props.appLogo != null) {
              _push2(`<img${ssrRenderAttr("src", dark.value ? _ctx.$page.props.appLogoDark : _ctx.$page.props.appLogo)}${ssrRenderAttr("alt", _ctx.$page.props.appFullName)}${_scopeId}>`);
            } else {
              _push2(`<span${_scopeId}>${ssrInterpolate(_ctx.$t("messages.word.logo"))}</span>`);
            }
          } else {
            return [
              _ctx.$page.props.appLogo != null ? (openBlock(), createBlock("img", {
                key: 0,
                src: dark.value ? _ctx.$page.props.appLogoDark : _ctx.$page.props.appLogo,
                alt: _ctx.$page.props.appFullName
              }, null, 8, ["src", "alt"])) : (openBlock(), createBlock("span", { key: 1 }, toDisplayString(_ctx.$t("messages.word.logo")), 1))
            ];
          }
        }),
        _: 1
      }, _parent));
      _push(`</div><div class="border-between-logo-nav d-md-flex d-none mx-4"></div>`);
      if (((_c = (_b = (_a = _ctx.$page.props.template) == null ? void 0 : _a.get_options) == null ? void 0 : _b.style) == null ? void 0 : _c.header_categories_style) == "megamenu") {
        _push(`<div class="mega-menu me-4">`);
        _push(ssrRenderComponent(unref(Link), {
          class: "mega-menu-title",
          href: _ctx.route("main.products.index")
        }, {
          default: withCtx((_, _push2, _parent2, _scopeId) => {
            if (_push2) {
              _push2(`<i class="ri-menu-4-line"${_scopeId}></i> ${ssrInterpolate(_ctx.$t("messages.word.categories"))}`);
            } else {
              return [
                createVNode("i", { class: "ri-menu-4-line" }),
                createTextVNode(" " + toDisplayString(_ctx.$t("messages.word.categories")), 1)
              ];
            }
          }),
          _: 1
        }, _parent));
        if (_ctx.$page.props.categories != null) {
          _push(`<div class="mega-menu-items"><div class="mega-menu-items-scrollable"><ul><!--[-->`);
          ssrRenderList(_ctx.$page.props.categories, (categoryLevel1) => {
            var _a2;
            _push(`<li class="${ssrRenderClass([{ active: hoveredCategory.value === categoryLevel1.id }, "mega-menu-item"])}">`);
            _push(ssrRenderComponent(unref(Link), {
              href: _ctx.route("main.products.index"),
              data: { cat: categoryLevel1.slug },
              class: "parent-item"
            }, {
              default: withCtx((_, _push2, _parent2, _scopeId) => {
                if (_push2) {
                  _push2(`${ssrInterpolate(categoryLevel1.title)}`);
                } else {
                  return [
                    createTextVNode(toDisplayString(categoryLevel1.title), 1)
                  ];
                }
              }),
              _: 2
            }, _parent));
            if (((_a2 = categoryLevel1.childs) == null ? void 0 : _a2.length) > 0 && hoveredCategory.value === categoryLevel1.id) {
              _push(`<div class="mega-submenu shadow-1"><div class="mega-submenu-columns"><!--[-->`);
              ssrRenderList(chunkCategories(categoryLevel1.childs, 3), (chunk, index) => {
                _push(`<ul class="mega-submenu-column"><!--[-->`);
                ssrRenderList(chunk, (categoryLevel2) => {
                  var _a3;
                  _push(`<li class="mega-submenu-item">`);
                  _push(ssrRenderComponent(unref(Link), {
                    href: _ctx.route("main.products.index"),
                    data: { cat: categoryLevel2.slug },
                    class: "parent-item"
                  }, {
                    default: withCtx((_, _push2, _parent2, _scopeId) => {
                      if (_push2) {
                        _push2(`${ssrInterpolate(categoryLevel2.title)}`);
                      } else {
                        return [
                          createTextVNode(toDisplayString(categoryLevel2.title), 1)
                        ];
                      }
                    }),
                    _: 2
                  }, _parent));
                  if (((_a3 = categoryLevel2.childs) == null ? void 0 : _a3.length) > 0) {
                    _push(`<ul class="mega-submenu-final"><!--[-->`);
                    ssrRenderList(categoryLevel2.childs, (categoryLevel3) => {
                      _push(`<li class="mega-submenu-final-item">`);
                      _push(ssrRenderComponent(unref(Link), {
                        href: _ctx.route("main.products.index"),
                        data: { cat: categoryLevel3.slug }
                      }, {
                        default: withCtx((_, _push2, _parent2, _scopeId) => {
                          if (_push2) {
                            _push2(`${ssrInterpolate(categoryLevel3.title)}`);
                          } else {
                            return [
                              createTextVNode(toDisplayString(categoryLevel3.title), 1)
                            ];
                          }
                        }),
                        _: 2
                      }, _parent));
                      _push(`</li>`);
                    });
                    _push(`<!--]--></ul>`);
                  } else {
                    _push(`<!---->`);
                  }
                  _push(`</li>`);
                });
                _push(`<!--]--></ul>`);
              });
              _push(`<!--]--></div></div>`);
            } else {
              _push(`<!---->`);
            }
            _push(`</li>`);
          });
          _push(`<!--]--></ul></div></div>`);
        } else {
          _push(`<!---->`);
        }
        _push(`</div>`);
      } else {
        _push(`<div class="vertical-menu me-4">`);
        _push(ssrRenderComponent(unref(Link), {
          class: "vertical-menu-title",
          href: _ctx.route("main.products.index")
        }, {
          default: withCtx((_, _push2, _parent2, _scopeId) => {
            if (_push2) {
              _push2(`<i class="ri-menu-4-line"${_scopeId}></i> ${ssrInterpolate(_ctx.$t("messages.word.categories"))}`);
            } else {
              return [
                createVNode("i", { class: "ri-menu-4-line" }),
                createTextVNode(" " + toDisplayString(_ctx.$t("messages.word.categories")), 1)
              ];
            }
          }),
          _: 1
        }, _parent));
        if (_ctx.$page.props.categories != null) {
          _push(`<div class="vertical-menu-items shadow-1"><ul><!--[-->`);
          ssrRenderList(_ctx.$page.props.categories, (categoryLevel1) => {
            _push(`<li class="vertical-menu-item">`);
            _push(ssrRenderComponent(unref(Link), {
              href: _ctx.route("main.products.index"),
              data: { cat: categoryLevel1.slug },
              class: categoryLevel1.childs != null && categoryLevel1.childs.length > 0 ? "with-child" : ""
            }, {
              default: withCtx((_, _push2, _parent2, _scopeId) => {
                if (_push2) {
                  _push2(`${ssrInterpolate(categoryLevel1.title)}`);
                } else {
                  return [
                    createTextVNode(toDisplayString(categoryLevel1.title), 1)
                  ];
                }
              }),
              _: 2
            }, _parent));
            if (categoryLevel1.childs != null && categoryLevel1.childs.length > 0) {
              _push(`<div class="mega-menu-items shadow-1"><ul><!--[-->`);
              ssrRenderList(categoryLevel1.childs, (categoryLevel2) => {
                _push(`<li class="mega-menu-item">`);
                _push(ssrRenderComponent(unref(Link), {
                  href: _ctx.route("main.products.index"),
                  data: { cat: categoryLevel2.slug },
                  class: categoryLevel2.childs != null && categoryLevel2.childs.length > 0 ? "with-child" : ""
                }, {
                  default: withCtx((_, _push2, _parent2, _scopeId) => {
                    if (_push2) {
                      _push2(`${ssrInterpolate(categoryLevel2.title)}`);
                    } else {
                      return [
                        createTextVNode(toDisplayString(categoryLevel2.title), 1)
                      ];
                    }
                  }),
                  _: 2
                }, _parent));
                if (categoryLevel2.childs != null && categoryLevel2.childs.length > 0) {
                  _push(`<div class="mega-menu-final-items shadow-1"><ul><!--[-->`);
                  ssrRenderList(categoryLevel2.childs, (categoryLevel3) => {
                    _push(`<li class="mega-menu-final-item">`);
                    _push(ssrRenderComponent(unref(Link), {
                      href: _ctx.route("main.products.index"),
                      data: { cat: categoryLevel3.slug }
                    }, {
                      default: withCtx((_, _push2, _parent2, _scopeId) => {
                        if (_push2) {
                          _push2(`${ssrInterpolate(categoryLevel3.title)}`);
                        } else {
                          return [
                            createTextVNode(toDisplayString(categoryLevel3.title), 1)
                          ];
                        }
                      }),
                      _: 2
                    }, _parent));
                    _push(`</li>`);
                  });
                  _push(`<!--]--></ul></div>`);
                } else {
                  _push(`<!---->`);
                }
                _push(`</li>`);
              });
              _push(`<!--]--></ul></div>`);
            } else {
              _push(`<!---->`);
            }
            _push(`</li>`);
          });
          _push(`<!--]--></ul></div>`);
        } else {
          _push(`<!---->`);
        }
        _push(`</div>`);
      }
      if (_ctx.$page.props.menu.header_main != null) {
        _push(`<ul class="nav flex-grow-1 d-md-flex d-none"><!--[-->`);
        ssrRenderList(_ctx.$page.props.menu.header_main.get_items, (item, index) => {
          _push(`<li class="nav-item">`);
          if (item.type == "internal") {
            _push(ssrRenderComponent(unref(Link), {
              class: "nav-link lts-05",
              href: item.link,
              prefetch: _ctx.$page.props.prefetch.status,
              "cache-for": _ctx.$page.props.prefetch.delay
            }, {
              default: withCtx((_, _push2, _parent2, _scopeId) => {
                if (_push2) {
                  _push2(`${ssrInterpolate(item.name)}`);
                } else {
                  return [
                    createTextVNode(toDisplayString(item.name), 1)
                  ];
                }
              }),
              _: 2
            }, _parent));
          } else {
            _push(`<!---->`);
          }
          if (item.type == "external") {
            _push(`<a class="nav-link lts-05"${ssrRenderAttr("href", item.link)} target="_blank">${ssrInterpolate(item.name)}</a>`);
          } else {
            _push(`<!---->`);
          }
          _push(`</li>`);
        });
        _push(`<!--]--></ul>`);
      } else {
        _push(`<!---->`);
      }
      _push(`</div><div class="col-md-2 d-flex justify-content-end align-items-center"><div class="d-inline-flex justify-content-end align-items-center user-helpers"><div class="user-helper user-helper--day-night-switch"><button><i class="${ssrRenderClass(dark.value ? "ri-sun-line" : "ri-moon-line")}"></i></button></div><div class="user-helper user-helper--search"><a href="javascript:void(0)"><i class="ri-search-line"></i></a></div>`);
      if (_ctx.$page.props.auth.user != null) {
        _push(`<div class="user-helper user-helper--notification">`);
        _push(ssrRenderComponent(unref(Link), {
          href: _ctx.route("user.notifications.index")
        }, {
          default: withCtx((_, _push2, _parent2, _scopeId) => {
            if (_push2) {
              _push2(`<i class="ri-notification-2-fill"${_scopeId}></i>`);
              if (_ctx.$page.props.notificationCount > 0) {
                _push2(`<div class="notif-badage"${_scopeId}></div>`);
              } else {
                _push2(`<!---->`);
              }
            } else {
              return [
                createVNode("i", { class: "ri-notification-2-fill" }),
                _ctx.$page.props.notificationCount > 0 ? (openBlock(), createBlock("div", {
                  key: 0,
                  class: "notif-badage"
                })) : createCommentVNode("", true)
              ];
            }
          }),
          _: 1
        }, _parent));
        _push(`</div>`);
      } else {
        _push(`<!---->`);
      }
      _push(`<div class="user-helper user-helper--user-account el-center me-0">`);
      if (_ctx.$page.props.auth.user != null) {
        _push(ssrRenderComponent(unref(Link), {
          class: "user-helper--user-account-link el-center",
          href: _ctx.route("user.dashboard")
        }, {
          default: withCtx((_, _push2, _parent2, _scopeId) => {
            if (_push2) {
              _push2(`<i class="ri-user-6-fill"${_scopeId}></i>`);
            } else {
              return [
                createVNode("i", { class: "ri-user-6-fill" })
              ];
            }
          }),
          _: 1
        }, _parent));
      } else {
        _push(ssrRenderComponent(unref(Link), {
          class: "user-helper--user-account-link el-center",
          href: _ctx.route("login")
        }, {
          default: withCtx((_, _push2, _parent2, _scopeId) => {
            if (_push2) {
              _push2(`<i class="ri-user-6-fill"${_scopeId}></i>`);
            } else {
              return [
                createVNode("i", { class: "ri-user-6-fill" })
              ];
            }
          }),
          _: 1
        }, _parent));
      }
      if (_ctx.$page.props.auth.user != null) {
        _push(`<div class="user-helper--user-account-dropdown shadow-smooth-1"><div class="user-helper--user-account-dropdown--header"><div class="d-flex align-items-center"><div class="profile-avatar me-3"><img${ssrRenderAttr("src", _ctx.$page.props.auth.user.get_avatar)}${ssrRenderAttr("alt", _ctx.$page.props.auth.user.get_name)}></div><div class="profile-info">`);
        _push(ssrRenderComponent(unref(Link), {
          href: _ctx.route("user.dashboard"),
          class: "text-decoration-none text-dark fw-bold mb-2"
        }, {
          default: withCtx((_, _push2, _parent2, _scopeId) => {
            if (_push2) {
              _push2(`${ssrInterpolate(_ctx.$page.props.auth.user.get_name)}`);
            } else {
              return [
                createTextVNode(toDisplayString(_ctx.$page.props.auth.user.get_name), 1)
              ];
            }
          }),
          _: 1
        }, _parent));
        _push(`<div class="text-muted fs-7 fw-normal">${ssrInterpolate(_ctx.$page.props.auth.user.phone)}</div></div></div><div class="wallet-options"><div><span class="wallet-options--key">${ssrInterpolate(_ctx.$t("messages.word.wallet"))}</span><span class="wallet-options--value lts-05 text-dark fw-bold">${ssrInterpolate(_ctx.$page.props.auth.user.wallet.get_formatted_amount)} <span class="unit unit-sm"></span></span></div>`);
        _push(ssrRenderComponent(unref(Link), {
          href: _ctx.route("user.wallet.index"),
          class: "wallet-options--charge"
        }, {
          default: withCtx((_, _push2, _parent2, _scopeId) => {
            if (_push2) {
              _push2(`${ssrInterpolate(_ctx.$t("messages.sentence.charge_wallet_question"))}`);
            } else {
              return [
                createTextVNode(toDisplayString(_ctx.$t("messages.sentence.charge_wallet_question")), 1)
              ];
            }
          }),
          _: 1
        }, _parent));
        _push(`</div></div><div class="user-helper--user-account-dropdown--content"><ul class="nav nav-items-with-icon flex-column"><li class="nav-item">`);
        _push(ssrRenderComponent(unref(Link), {
          class: "nav-link lts-05",
          href: _ctx.route("user.dashboard")
        }, {
          default: withCtx((_, _push2, _parent2, _scopeId) => {
            if (_push2) {
              _push2(`<i class="nav-link-icon ri-home-8-line"${_scopeId}></i>${ssrInterpolate(_ctx.$t("messages.word.dashboard"))}`);
            } else {
              return [
                createVNode("i", { class: "nav-link-icon ri-home-8-line" }),
                createTextVNode(toDisplayString(_ctx.$t("messages.word.dashboard")), 1)
              ];
            }
          }),
          _: 1
        }, _parent));
        _push(`</li>`);
        if (_ctx.$page.props.auth.user.seller) {
          _push(`<li class="nav-item">`);
          _push(ssrRenderComponent(unref(Link), {
            class: "nav-link lts-05",
            href: _ctx.route("seller.dashboard")
          }, {
            default: withCtx((_, _push2, _parent2, _scopeId) => {
              if (_push2) {
                _push2(`<i class="nav-link-icon ri-store-2-line"${_scopeId}></i>${ssrInterpolate(_ctx.$t("messages.sentence.seller_dashboard"))}`);
              } else {
                return [
                  createVNode("i", { class: "nav-link-icon ri-store-2-line" }),
                  createTextVNode(toDisplayString(_ctx.$t("messages.sentence.seller_dashboard")), 1)
                ];
              }
            }),
            _: 1
          }, _parent));
          _push(`</li>`);
        } else {
          _push(`<!---->`);
        }
        _push(`<li class="nav-item">`);
        _push(ssrRenderComponent(unref(Link), {
          class: "nav-link lts-05",
          href: _ctx.route("user.profile.edit")
        }, {
          default: withCtx((_, _push2, _parent2, _scopeId) => {
            if (_push2) {
              _push2(`<i class="nav-link-icon ri-profile-line"${_scopeId}></i>${ssrInterpolate(_ctx.$t("messages.sentence.edit_profile"))}`);
            } else {
              return [
                createVNode("i", { class: "nav-link-icon ri-profile-line" }),
                createTextVNode(toDisplayString(_ctx.$t("messages.sentence.edit_profile")), 1)
              ];
            }
          }),
          _: 1
        }, _parent));
        _push(`</li><li class="nav-item">`);
        _push(ssrRenderComponent(unref(Link), {
          class: "nav-link lts-05",
          href: _ctx.route("user.orders.index")
        }, {
          default: withCtx((_, _push2, _parent2, _scopeId) => {
            if (_push2) {
              _push2(`<i class="nav-link-icon ri-file-list-3-line"${_scopeId}></i>${ssrInterpolate(_ctx.$t("messages.word.my_orders"))}`);
            } else {
              return [
                createVNode("i", { class: "nav-link-icon ri-file-list-3-line" }),
                createTextVNode(toDisplayString(_ctx.$t("messages.word.my_orders")), 1)
              ];
            }
          }),
          _: 1
        }, _parent));
        _push(`</li><li class="nav-item">`);
        _push(ssrRenderComponent(unref(Link), {
          class: "nav-link lts-05",
          href: _ctx.route("user.tickets.index")
        }, {
          default: withCtx((_, _push2, _parent2, _scopeId) => {
            if (_push2) {
              _push2(`<i class="nav-link-icon ri-message-line"${_scopeId}></i>${ssrInterpolate(_ctx.$t("messages.word.tickets"))}`);
            } else {
              return [
                createVNode("i", { class: "nav-link-icon ri-message-line" }),
                createTextVNode(toDisplayString(_ctx.$t("messages.word.tickets")), 1)
              ];
            }
          }),
          _: 1
        }, _parent));
        _push(`</li><li class="nav-item">`);
        _push(ssrRenderComponent(unref(Link), {
          href: _ctx.route("logout"),
          method: "post",
          type: "submit",
          as: "button",
          class: "nav-link"
        }, {
          default: withCtx((_, _push2, _parent2, _scopeId) => {
            if (_push2) {
              _push2(`<i class="nav-link-icon ri-logout-box-r-line"${_scopeId}></i> ${ssrInterpolate(_ctx.$t("messages.word.logout"))}`);
            } else {
              return [
                createVNode("i", { class: "nav-link-icon ri-logout-box-r-line" }),
                createTextVNode(" " + toDisplayString(_ctx.$t("messages.word.logout")), 1)
              ];
            }
          }),
          _: 1
        }, _parent));
        _push(`</li></ul></div></div>`);
      } else {
        _push(`<!---->`);
      }
      _push(`</div><div class="user-helper user-helper--shoping-cart el-center">`);
      _push(ssrRenderComponent(unref(Link), {
        class: "user-helper--shoping-cart-link btn btn-primary lts-05",
        href: _ctx.route("cart")
      }, {
        default: withCtx((_, _push2, _parent2, _scopeId) => {
          if (_push2) {
            _push2(`<i class="ri-shopping-basket-line"${_scopeId}></i><div class="count-badage el-center"${_scopeId}><span${_scopeId}>${ssrInterpolate(_ctx.$page.props.cart.items.length)}</span></div>`);
          } else {
            return [
              createVNode("i", { class: "ri-shopping-basket-line" }),
              createVNode("div", { class: "count-badage el-center" }, [
                createVNode("span", null, toDisplayString(_ctx.$page.props.cart.items.length), 1)
              ])
            ];
          }
        }),
        _: 1
      }, _parent));
      if (_ctx.$page.props.cart.items.length > 0) {
        _push(`<div class="user-helper--shoping-cart-dropdown shadow-smooth-1"><div class="user-helper--shoping-cart-dropdown--header">`);
        _push(ssrRenderComponent(unref(Link), {
          class: "lts-05",
          href: _ctx.route("cart")
        }, {
          default: withCtx((_, _push2, _parent2, _scopeId) => {
            if (_push2) {
              _push2(`${ssrInterpolate(_ctx.$t("messages.sentence.show_cart"))} <i class="ri-arrow-left-s-line"${_scopeId}></i>`);
            } else {
              return [
                createTextVNode(toDisplayString(_ctx.$t("messages.sentence.show_cart")) + " ", 1),
                createVNode("i", { class: "ri-arrow-left-s-line" })
              ];
            }
          }),
          _: 1
        }, _parent));
        _push(`<span>${ssrInterpolate(unref(useNumberFormat)(_ctx.$page.props.cart.items.length))} ${ssrInterpolate(_ctx.$t("messages.word.ware"))}</span></div><div class="simplebar-container user-helper--shoping-cart-dropdown--product"><!--[-->`);
        ssrRenderList(_ctx.$page.props.cart.items, (item) => {
          _push(`<div class="shoping-cart-product"><div class="shoping-cart-product-thumbnail">`);
          _push(ssrRenderComponent(unref(Link), {
            href: _ctx.route("main.products.show", item.product.slug)
          }, {
            default: withCtx((_, _push2, _parent2, _scopeId) => {
              if (_push2) {
                _push2(`<img${ssrRenderAttr("src", item.product.get_images[0]["link"])}${ssrRenderAttr("alt", item.product.title)} loading="lazy"${_scopeId}>`);
              } else {
                return [
                  createVNode("img", {
                    src: item.product.get_images[0]["link"],
                    alt: item.product.title,
                    loading: "lazy"
                  }, null, 8, ["src", "alt"])
                ];
              }
            }),
            _: 2
          }, _parent));
          _push(`</div><div class="shoping-cart-product-detail"><div class="shoping-cart-product-title">`);
          _push(ssrRenderComponent(unref(Link), {
            class: "lts-05",
            href: _ctx.route("main.products.show", item.product.slug)
          }, {
            default: withCtx((_, _push2, _parent2, _scopeId) => {
              if (_push2) {
                _push2(`${ssrInterpolate(item.product.title)}`);
              } else {
                return [
                  createTextVNode(toDisplayString(item.product.title), 1)
                ];
              }
            }),
            _: 2
          }, _parent));
          _push(`</div><div class="shoping-cart-product-purchase-info"><div class="shoping-cart-product-meta"><span class="fs-9 lts-05">${ssrInterpolate(_ctx.$t("messages.word.count"))}: ${ssrInterpolate(unref(useNumberFormat)(item.count))}</span></div><div class="shoping-cart-product-price">${ssrInterpolate(unref(useNumberFormat)(item.price))} <span class="unit unit-sm"></span></div></div><button class="shoping-cart-product-remove" type="submit"></button></div></div>`);
        });
        _push(`<!--]--></div><div class="user-helper--shoping-cart-dropdown--footer"><div><span class="fs-8">${ssrInterpolate(_ctx.$t("messages.sentence.cart_total_pay_price"))}:</span><span class="fw-bold">${ssrInterpolate(unref(useNumberFormat)(_ctx.$page.props.cart.total_price))} <span class="unit"></span></span></div>`);
        _push(ssrRenderComponent(unref(Link), {
          href: _ctx.route("cart"),
          class: "btn btn-primary"
        }, {
          default: withCtx((_, _push2, _parent2, _scopeId) => {
            if (_push2) {
              _push2(`${ssrInterpolate(_ctx.$t("messages.sentence.complete_order"))}`);
            } else {
              return [
                createTextVNode(toDisplayString(_ctx.$t("messages.sentence.complete_order")), 1)
              ];
            }
          }),
          _: 1
        }, _parent));
        _push(`</div></div>`);
      } else {
        _push(`<!---->`);
      }
      _push(`</div></div></div></div><div style="${ssrRenderStyle(searchContainerStatus.value ? null : { display: "none" })}" class="search-container"><div class="container"><form method="get"><div class="search-dropdown dropdown"><input${ssrRenderAttr("value", search.value)} type="text" class="form-control search-field shadow-1 lts-05" name="search"${ssrRenderAttr("placeholder", _ctx.$t("messages.sentence.global_search") + " ...")} autocomplete="off" aria-expanded="false" data-bs-toggle="dropdown" data-bs-auto-close="outside"${ssrIncludeBooleanAttr(_ctx.status == "dev") ? " disabled" : ""}><div class="dropdown-menu dropdown-top shadow-1">`);
      if (categories.value.length > 0 || products.value.length > 0) {
        _push(`<div class="search-result history"><div class="title link lts-05 mb-3">${ssrInterpolate(_ctx.$t("messages.sentence.show_all_result"))} <i class="ri-arrow-left-s-line"></i></div>`);
        if (categories.value.length > 0) {
          _push(`<div class="history-search"><div class="title lts-05 mb-2"><i class="ri-list-check-2 me-2"></i> ${ssrInterpolate(_ctx.$t("messages.word.categories"))}</div><ul class="similar-search mb-3"><!--[-->`);
          ssrRenderList(categories.value, (category) => {
            _push(`<li>`);
            _push(ssrRenderComponent(unref(Link), {
              href: _ctx.route("main.products.index"),
              data: { cat: category.slug },
              onClick: closeSearchDropdown
            }, {
              default: withCtx((_, _push2, _parent2, _scopeId) => {
                if (_push2) {
                  _push2(`${ssrInterpolate(category.title)}`);
                } else {
                  return [
                    createTextVNode(toDisplayString(category.title), 1)
                  ];
                }
              }),
              _: 2
            }, _parent));
            _push(`</li>`);
          });
          _push(`<!--]--></ul></div>`);
        } else {
          _push(`<!---->`);
        }
        if (categories.value.length > 0 && products.value.length > 0) {
          _push(`<hr class="mb-3">`);
        } else {
          _push(`<!---->`);
        }
        if (products.value.length > 0) {
          _push(`<div class="search-product-list"><div class="title lts-05 mb-3"><i class="ri-instance-line me-2"></i> ${ssrInterpolate(_ctx.$t("messages.word.products"))}</div><ul><!--[-->`);
          ssrRenderList(products.value, (product) => {
            _push(`<li><div class="sm-product-container"><img${ssrRenderAttr("src", product.get_images[0]["link"])}${ssrRenderAttr("alt", product.title)} loading="lazy"><div><h4>`);
            _push(ssrRenderComponent(unref(Link), {
              href: _ctx.route("main.products.show", product.slug),
              onClick: closeSearchDropdown
            }, {
              default: withCtx((_, _push2, _parent2, _scopeId) => {
                if (_push2) {
                  _push2(`${ssrInterpolate(product.title)}`);
                } else {
                  return [
                    createTextVNode(toDisplayString(product.title), 1)
                  ];
                }
              }),
              _: 2
            }, _parent));
            _push(`</h4>`);
            if (!product.in_stock_status) {
              _push(`<span>${ssrInterpolate(_ctx.$t("messages.sentence.inventory_inquiry"))}</span>`);
            } else if (product.inventory) {
              _push(`<span>${ssrInterpolate(unref(useNumberFormat)(product.best_price))} <span class="unit unit-sm"></span></span>`);
            } else {
              _push(`<span>${ssrInterpolate(_ctx.$t("messages.word.non_existent"))}</span>`);
            }
            _push(`</div></div></li>`);
          });
          _push(`<!--]--></ul></div>`);
        } else {
          _push(`<!---->`);
        }
        _push(`</div>`);
      } else if (_ctx.$page.props.ui.header.most_viewed_products_of_week.length > 0) {
        _push(`<div class="history"><div class="title lts-05 mb-2"><i class="ri-eye-line me-2"></i> ${ssrInterpolate(_ctx.$t("messages.sentence.most_viewed_products_of_week"))}</div><div class="history-product-list"><div class="swiper swiper-history-product-list"><div class="swiper-wrapper"><!--[-->`);
        ssrRenderList(_ctx.$page.props.ui.header.most_viewed_products_of_week, (product) => {
          _push(`<div class="swiper-slide"><div class="sm-product-container"><img${ssrRenderAttr("src", product.get_images[0]["link"])}${ssrRenderAttr("alt", product.title)} loading="lazy"><div><h4>`);
          _push(ssrRenderComponent(unref(Link), {
            href: _ctx.route("main.products.show", product.slug),
            onClick: closeSearchDropdown
          }, {
            default: withCtx((_, _push2, _parent2, _scopeId) => {
              if (_push2) {
                _push2(`${ssrInterpolate(product.title)}`);
              } else {
                return [
                  createTextVNode(toDisplayString(product.title), 1)
                ];
              }
            }),
            _: 2
          }, _parent));
          _push(`</h4>`);
          if (!product.in_stock_status) {
            _push(`<span>${ssrInterpolate(_ctx.$t("messages.sentence.inventory_inquiry"))}</span>`);
          } else if (product.inventory) {
            _push(`<span>${ssrInterpolate(unref(useNumberFormat)(product.best_price))} <span class="unit unit-sm"></span></span>`);
          } else {
            _push(`<span>${ssrInterpolate(_ctx.$t("messages.word.non_existent"))}</span>`);
          }
          _push(`</div></div></div>`);
        });
        _push(`<!--]--></div></div><div class="pagination-slider slider-next shadow-primary"><i class="ri-arrow-left-s-line"></i></div><div class="pagination-slider slider-prev shadow-primary"><i class="ri-arrow-right-s-line"></i></div></div><hr><div class="history-search">`);
        if (_ctx.$page.props.ui.header.last_search_list != null) {
          _push(`<div class="title lts-05 mb-2"><i class="ri-history-fill me-2"></i> ${ssrInterpolate(_ctx.$t("messages.sentence.your_search_history"))}</div>`);
        } else {
          _push(`<!---->`);
        }
        if (_ctx.$page.props.ui.header.last_search_list != null) {
          _push(`<ul class="similar-search mb-3"><!--[-->`);
          ssrRenderList(_ctx.$page.props.ui.header.last_search_list, (search2, index) => {
            _push(`<li>`);
            _push(ssrRenderComponent(unref(Link), {
              href: _ctx.route("main.products.index"),
              data: { search: search2 },
              onClick: closeSearchDropdown
            }, {
              default: withCtx((_, _push2, _parent2, _scopeId) => {
                if (_push2) {
                  _push2(`${ssrInterpolate(search2)}`);
                } else {
                  return [
                    createTextVNode(toDisplayString(search2), 1)
                  ];
                }
              }),
              _: 2
            }, _parent));
            _push(`</li>`);
          });
          _push(`<!--]--></ul>`);
        } else {
          _push(`<!---->`);
        }
        if (_ctx.$page.props.ui.header.most_repeated_search != null) {
          _push(`<div class="title lts-05 mb-2"><i class="ri-fire-line me-2 text-warning"></i> ${ssrInterpolate(_ctx.$t("messages.sentence.most_searches"))}</div>`);
        } else {
          _push(`<!---->`);
        }
        if (_ctx.$page.props.ui.header.most_repeated_search != null) {
          _push(`<ul class="similar-search"><!--[-->`);
          ssrRenderList(_ctx.$page.props.ui.header.most_repeated_search, (search2, index) => {
            _push(`<li>`);
            _push(ssrRenderComponent(unref(Link), {
              href: _ctx.route("main.products.index"),
              data: { search: search2.keyword },
              onClick: closeSearchDropdown
            }, {
              default: withCtx((_, _push2, _parent2, _scopeId) => {
                if (_push2) {
                  _push2(`${ssrInterpolate(search2.keyword)}`);
                } else {
                  return [
                    createTextVNode(toDisplayString(search2.keyword), 1)
                  ];
                }
              }),
              _: 2
            }, _parent));
            _push(`</li>`);
          });
          _push(`<!--]--></ul>`);
        } else {
          _push(`<!---->`);
        }
        _push(`</div></div>`);
      } else {
        _push(`<!---->`);
      }
      _push(`</div></div>`);
      _push(ssrRenderComponent(unref(Link), {
        href: _ctx.route("main.products.index"),
        as: "button",
        type: "button",
        class: "btn search-button--popular-search lts-1"
      }, {
        default: withCtx((_, _push2, _parent2, _scopeId) => {
          if (_push2) {
            _push2(`${ssrInterpolate(_ctx.$t("messages.sentence.product_archive"))} <i class="ri-arrow-left-s-line"${_scopeId}></i>`);
          } else {
            return [
              createTextVNode(toDisplayString(_ctx.$t("messages.sentence.product_archive")) + " ", 1),
              createVNode("i", { class: "ri-arrow-left-s-line" })
            ];
          }
        }),
        _: 1
      }, _parent));
      _push(`<button type="submit" class="btn search-button--icon lts-1"><i class="ri-search-2-line"></i></button></form></div></div></div></header></div>`);
    };
  }
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
  const ssrContext = useSSRContext();
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("resources/js/Components/Main/UI/Header/HeaderType5.vue");
  return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export {
  _sfc_main as default
};
