import { defineComponent, mergeProps, unref, withCtx, createTextVNode, createVNode, toDisplayString, useSSRContext } from "vue";
import { ssrRenderAttrs, ssrInterpolate, ssrRenderComponent, ssrRenderList, ssrRenderAttr } from "vue/server-renderer";
import { Link } from "@inertiajs/vue3";
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "ProductList5",
  __ssrInlineRender: true,
  props: {
    status: {},
    component_id: {},
    data: {}
  },
  setup(__props) {
    const props = __props;
    let productColumn1 = null;
    let productColumn2 = null;
    let productColumn3 = null;
    if (props.data.product_list.products != void 0 && props.data.product_list.products.length > 0) {
      productColumn1 = props.data.product_list.products.slice(0, 3);
      productColumn2 = props.data.product_list.products.slice(3, 4);
      productColumn3 = props.data.product_list.products.slice(4);
    }
    return (_ctx, _push, _parent, _attrs) => {
      var _a, _b, _c;
      _push(`<div${ssrRenderAttrs(mergeProps({
        id: "component-" + _ctx.component_id,
        class: { container: true, readonly: _ctx.status == "dev" },
        style: "margin-top:" + ((_a = _ctx.data.style) == null ? void 0 : _a.margin.top) + "px; margin-bottom:" + (((_b = _ctx.data.style) == null ? void 0 : _b.margin.bottom) != null ? (_c = _ctx.data.style) == null ? void 0 : _c.margin.bottom : 20) + "px;"
      }, _attrs))}><div class="single-product-slider"><div class="row"><div class="col-12 mb-2"><div class="single-product-slider--header d-flex align-items-end justify-content-between mb-2 mt-2"><div class="d-flex align-items-center"><div class="related-product-title lts-05">${ssrInterpolate(_ctx.data.product_list.label != null ? _ctx.data.product_list.label : _ctx.$t("messages.sentence.not_set"))}</div></div>`);
      _push(ssrRenderComponent(unref(Link), {
        class: "product-list-header--more bg-primary badge text-white shadow-primary fs-8 lts-05 el-center",
        href: _ctx.route("main.products.index", _ctx.data.product_list.archive)
      }, {
        default: withCtx((_, _push2, _parent2, _scopeId) => {
          if (_push2) {
            _push2(`${ssrInterpolate(_ctx.$t("messages.word.more"))} <i class="ri-arrow-left-s-line ms-1"${_scopeId}></i>`);
          } else {
            return [
              createTextVNode(toDisplayString(_ctx.$t("messages.word.more")) + " ", 1),
              createVNode("i", { class: "ri-arrow-left-s-line ms-1" })
            ];
          }
        }),
        _: 1
      }, _parent));
      _push(`</div></div>`);
      if (_ctx.data.product_list.products != void 0 && _ctx.data.product_list.products.length > 0) {
        _push(`<div class="col-12 product-grid-box"><div><div class="row"><div class="col-lg-3 col-md-6 col-12 multiple"><div class="row"><!--[-->`);
        ssrRenderList(unref(productColumn1), (product) => {
          _push(`<div class="col-12"><div class="card"><div class="card-body"><div class="product-thumbnail"><img${ssrRenderAttr("src", product.get_images[0]["link"])}${ssrRenderAttr("alt", product.title)} loading="lazy"></div><div class="product-body"><h3 class="product-title">`);
          _push(ssrRenderComponent(unref(Link), {
            href: _ctx.route("main.products.show", product.slug)
          }, {
            default: withCtx((_, _push2, _parent2, _scopeId) => {
              if (_push2) {
                _push2(`${ssrInterpolate(product.title)}`);
              } else {
                return [
                  createTextVNode(toDisplayString(product.title), 1)
                ];
              }
            }),
            _: 2
          }, _parent));
          _push(`</h3><div class="product-footer d-flex justify-content-between pb-2"><div class="d-flex flex-row align-items-end"><span class="product-rating-average">${ssrInterpolate(product.comments_info.rating == "0" ? "-" : product.comments_info.rating)} <i class="ri-star-fill"></i></span></div>`);
          if (!product.in_stock_status) {
            _push(`<div class="d-flex flex-column justify-content-end"><span class="product-price-now lts-05 fs-8">${ssrInterpolate(_ctx.$t("messages.sentence.inventory_inquiry"))}</span></div>`);
          } else if (product.inventory) {
            _push(`<!--[-->`);
            if (product.best_normal_price.discount_price != null) {
              _push(`<div class="d-flex flex-column justify-content-end"><div class="d-flex justify-content-end mb-1"><div class="discount-percent bg-secondary shadow-1 me-2">${ssrInterpolate(product.best_normal_price.percent)}<i class="ri-percent-fill"></i></div><span class="product-price-old lts-05">${ssrInterpolate(product.best_normal_price.price)}</span></div><span class="product-price-now lts-05">${ssrInterpolate(product.best_normal_price.discount_price)} <span class="unit unit-sm"></span></span></div>`);
            } else {
              _push(`<div class="d-flex flex-column justify-content-end"><span class="product-price-now lts-05">${ssrInterpolate(product.best_normal_price.price)} <span class="unit unit-sm"></span></span></div>`);
            }
            _push(`<!--]-->`);
          } else {
            _push(`<div class="d-flex flex-column justify-content-end"><span class="product-price-now lts-05 fs-8">${ssrInterpolate(_ctx.$t("messages.word.non_existent"))}</span></div>`);
          }
          _push(`</div></div>`);
          _push(ssrRenderComponent(unref(Link), {
            class: "product--link",
            href: _ctx.route("main.products.show", product.slug)
          }, null, _parent));
          _push(`</div></div></div>`);
        });
        _push(`<!--]--></div></div><div class="col-lg-3 col-md-6 col-12 single"><div class="row"><!--[-->`);
        ssrRenderList(unref(productColumn2), (product) => {
          _push(`<div class="col-12"><div class="card"><div class="card-body"><div class="product-thumbnail"><img${ssrRenderAttr("src", product.get_images[0]["link"])}${ssrRenderAttr("alt", product.title)} loading="lazy"></div><div class="product-body"><h3 class="product-title">`);
          _push(ssrRenderComponent(unref(Link), {
            href: _ctx.route("main.products.show", product.slug)
          }, {
            default: withCtx((_, _push2, _parent2, _scopeId) => {
              if (_push2) {
                _push2(`${ssrInterpolate(product.title)}`);
              } else {
                return [
                  createTextVNode(toDisplayString(product.title), 1)
                ];
              }
            }),
            _: 2
          }, _parent));
          _push(`</h3><div class="product-footer d-flex justify-content-between pb-2"><div class="d-flex flex-row align-items-end"><span class="product-rating-average">${ssrInterpolate(product.comments_info.rating == "0" ? "-" : product.comments_info.rating)} <i class="ri-star-fill"></i></span></div>`);
          if (!product.in_stock_status) {
            _push(`<div class="d-flex flex-column justify-content-end"><span class="product-price-now lts-05 fs-8">${ssrInterpolate(_ctx.$t("messages.sentence.inventory_inquiry"))}</span></div>`);
          } else if (product.inventory) {
            _push(`<!--[-->`);
            if (product.best_normal_price.discount_price != null) {
              _push(`<div class="d-flex flex-column justify-content-end"><div class="d-flex justify-content-end mb-1"><div class="discount-percent bg-secondary shadow-1 me-2">${ssrInterpolate(product.best_normal_price.percent)}<i class="ri-percent-fill"></i></div><span class="product-price-old lts-05">${ssrInterpolate(product.best_normal_price.price)}</span></div><span class="product-price-now lts-05">${ssrInterpolate(product.best_normal_price.discount_price)} <span class="unit"></span></span></div>`);
            } else {
              _push(`<div class="d-flex flex-column justify-content-end"><span class="product-price-now lts-05">${ssrInterpolate(product.best_normal_price.price)} <span class="unit"></span></span></div>`);
            }
            _push(`<!--]-->`);
          } else {
            _push(`<div class="d-flex flex-column justify-content-end"><span class="product-price-now lts-05 fs-8">${ssrInterpolate(_ctx.$t("messages.word.non_existent"))}</span></div>`);
          }
          _push(`</div></div>`);
          _push(ssrRenderComponent(unref(Link), {
            class: "product--link",
            href: _ctx.route("main.products.show", product.slug)
          }, null, _parent));
          _push(`</div></div></div>`);
        });
        _push(`<!--]--></div></div><div class="col-lg-6 col-md-12 col-12 multiple"><div class="row"><!--[-->`);
        ssrRenderList(unref(productColumn3), (product) => {
          _push(`<div class="col-sm-6 col-12"><div class="card"><div class="card-body"><div class="product-thumbnail"><img${ssrRenderAttr("src", product.get_images[0]["link"])}${ssrRenderAttr("alt", product.title)} loading="lazy"></div><div class="product-body"><h3 class="product-title">`);
          _push(ssrRenderComponent(unref(Link), {
            href: _ctx.route("main.products.show", product.slug)
          }, {
            default: withCtx((_, _push2, _parent2, _scopeId) => {
              if (_push2) {
                _push2(`${ssrInterpolate(product.title)}`);
              } else {
                return [
                  createTextVNode(toDisplayString(product.title), 1)
                ];
              }
            }),
            _: 2
          }, _parent));
          _push(`</h3><div class="product-footer d-flex justify-content-between pb-2"><div class="d-flex flex-row align-items-end"><span class="product-rating-average">${ssrInterpolate(product.comments_info.rating == "0" ? "-" : product.comments_info.rating)} <i class="ri-star-fill"></i></span></div>`);
          if (!product.in_stock_status) {
            _push(`<div class="d-flex flex-column justify-content-end"><span class="product-price-now lts-05 fs-8">${ssrInterpolate(_ctx.$t("messages.sentence.inventory_inquiry"))}</span></div>`);
          } else if (product.inventory) {
            _push(`<!--[-->`);
            if (product.best_normal_price.discount_price != null) {
              _push(`<div class="d-flex flex-column justify-content-end"><div class="d-flex justify-content-end mb-1"><div class="discount-percent bg-secondary shadow-1 me-2">${ssrInterpolate(product.best_normal_price.percent)}<i class="ri-percent-fill"></i></div><span class="product-price-old lts-05">${ssrInterpolate(product.best_normal_price.price)}</span></div><span class="product-price-now lts-05">${ssrInterpolate(product.best_normal_price.discount_price)} <span class="unit unit-sm"></span></span></div>`);
            } else {
              _push(`<div class="d-flex flex-column justify-content-end"><span class="product-price-now lts-05">${ssrInterpolate(product.best_normal_price.price)} <span class="unit unit-sm"></span></span></div>`);
            }
            _push(`<!--]-->`);
          } else {
            _push(`<div class="d-flex flex-column justify-content-end"><span class="product-price-now lts-05 fs-8">${ssrInterpolate(_ctx.$t("messages.word.non_existent"))}</span></div>`);
          }
          _push(`</div></div>`);
          _push(ssrRenderComponent(unref(Link), {
            class: "product--link",
            href: _ctx.route("main.products.show", product.slug)
          }, null, _parent));
          _push(`</div></div></div>`);
        });
        _push(`<!--]--></div></div></div></div></div>`);
      } else {
        _push(`<div class="col-12 product-grid-box"><div><div class="row"><div class="col-lg-3 col-md-6 col-12 multiple"><div class="row"><!--[-->`);
        ssrRenderList(new Array(3), (p) => {
          _push(`<div class="col-12"><div class="card"><div class="card-body"><div class="product-thumbnail"><img${ssrRenderAttr("src", _ctx.$page.props.appUrl + "/img/temp/pre-load-product.png")} alt="محصول" loading="lazy"></div><div class="product-body"><h3 class="product-title"><a href="#" class="sk sk-text">لورم ایپسوم متن ساختگی</a></h3><div class="product-footer d-flex justify-content-between"><div class="d-flex flex-row align-items-end"><span class="product-rating-average"><span class="sk sk-text-sm d-inline-block">4.9</span> <i class="ri-star-fill"></i></span></div><div class="d-flex flex-column justify-content-end"><span class="product-price-now lts-05"><span class="sk sk-text-sm">900,000</span> <span class="unit"></span></span></div></div></div></div></div></div>`);
        });
        _push(`<!--]--></div></div><div class="col-lg-3 col-md-6 col-12 single"><div class="row"><!--[-->`);
        ssrRenderList(new Array(1), (p) => {
          _push(`<div class="col-12"><div class="card"><div class="card-body d-flex justify-content-between"><div class="product-thumbnail"><img${ssrRenderAttr("src", _ctx.$page.props.appUrl + "/img/temp/pre-load-product.png")} alt="محصول" loading="lazy"></div><div class="product-body"><h3 class="product-title"><a href="#" class="sk sk-text">لورم ایپسوم متن ساختگی</a></h3><div class="product-footer d-flex justify-content-between mb-4"><div class="d-flex flex-row align-items-end"><span class="product-rating-average"><span class="sk sk-text-sm d-inline-block">4.9</span> <i class="ri-star-fill"></i></span></div><div class="d-flex flex-column justify-content-end"><span class="product-price-now lts-05"><span class="sk sk-text-sm">900,000</span> <span class="unit"></span></span></div></div></div></div></div></div>`);
        });
        _push(`<!--]--></div></div><div class="col-lg-6 col-md-12 col-12 multiple"><div class="row"><!--[-->`);
        ssrRenderList(new Array(6), (p) => {
          _push(`<div class="col-sm-6 col-12"><div class="card"><div class="card-body"><div class="product-thumbnail"><img${ssrRenderAttr("src", _ctx.$page.props.appUrl + "/img/temp/pre-load-product.png")} alt="محصول" loading="lazy"></div><div class="product-body"><h3 class="product-title"><a href="#" class="sk sk-text">لورم ایپسوم متن ساختگی</a></h3><div class="product-footer d-flex justify-content-between"><div class="d-flex flex-row align-items-end"><span class="product-rating-average"><span class="sk sk-text-sm d-inline-block">4.9</span> <i class="ri-star-fill"></i></span></div><div class="d-flex flex-column justify-content-end"><span class="product-price-now lts-05"><span class="sk sk-text-sm">900,000</span> <span class="unit"></span></span></div></div></div></div></div></div>`);
        });
        _push(`<!--]--></div></div></div></div></div>`);
      }
      _push(`</div></div></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/Lists/Products/ProductList5.vue");
  return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export {
  _sfc_main as default
};
