import { g as _sfc_main$1, f as __nuxt_component_0, a as _export_sfc } from "../server.mjs";
import { _ as __nuxt_component_1$1, a as __nuxt_component_2 } from "./GradientArrowLeftIcon-C3AVRIT6.js";
import _sfc_main$2 from "./EmptyState-CWK2sm1Q.js";
import { defineComponent, ref, computed, mergeProps, unref, withCtx, createTextVNode, toDisplayString, useSSRContext } from "vue";
import { ssrRenderAttrs, ssrInterpolate, ssrRenderList, ssrRenderClass, ssrRenderComponent, ssrRenderAttr } from "vue/server-renderer";
import "D:/marwa/front/webstdy-v2-frontend/node_modules/hookable/dist/index.mjs";
import "ofetch";
import "#internal/nuxt/paths";
import "D:/marwa/front/webstdy-v2-frontend/node_modules/unctx/dist/index.mjs";
import "D:/marwa/front/webstdy-v2-frontend/node_modules/h3/dist/index.mjs";
import "pinia";
import "D:/marwa/front/webstdy-v2-frontend/node_modules/defu/dist/defu.mjs";
import "@pinia/colada";
import "D:/marwa/front/webstdy-v2-frontend/node_modules/klona/dist/index.mjs";
import "vue-router";
import "D:/marwa/front/webstdy-v2-frontend/node_modules/radix3/dist/index.mjs";
import "D:/marwa/front/webstdy-v2-frontend/node_modules/cookie-es/dist/index.mjs";
import "D:/marwa/front/webstdy-v2-frontend/node_modules/destr/dist/index.mjs";
import "D:/marwa/front/webstdy-v2-frontend/node_modules/ohash/dist/index.mjs";
import "D:/marwa/front/webstdy-v2-frontend/node_modules/@unhead/vue/dist/index.mjs";
import "@vue/devtools-api";
import "@unhead/schema-org/vue";
import "scule";
import "deep-pick-omit";
import "@iconify/vue";
const visibleCount = 7;
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "StackedProductsCarouselMobile",
  __ssrInlineRender: true,
  props: {
    projects: {}
  },
  setup(__props) {
    const props = __props;
    const currentIndex = ref(0);
    ref(true);
    ref(3e3);
    const centerPosition = Math.ceil(visibleCount / 2);
    const visibleProjects = computed(() => {
      const total = props.projects.length;
      const ordered = [];
      for (let i = 0; i < visibleCount; i++) {
        const index = (currentIndex.value + i - Math.floor(visibleCount / 2) + total) % total;
        ordered.push(props.projects[index]);
      }
      return ordered;
    });
    const getCurrentProject = () => props.projects[currentIndex.value];
    return (_ctx, _push, _parent, _attrs) => {
      var _a, _b, _c;
      const _component_NuxtImg = _sfc_main$1;
      const _component_SvgGradientArrowRightIcon = __nuxt_component_1$1;
      const _component_SvgGradientArrowLeftIcon = __nuxt_component_2;
      const _component_NuxtLinkLocale = __nuxt_component_0;
      const _component_EmptyState = _sfc_main$2;
      if (props.projects && props.projects.length >= 7) {
        _push(`<div${ssrRenderAttrs(mergeProps({
          dir: "rtl",
          class: "gallery-wrapper"
        }, _attrs))} data-v-ab04d162><h3 class="project-title" data-v-ab04d162>${ssrInterpolate((_a = getCurrentProject()) == null ? void 0 : _a.title)}</h3><div class="gallery" data-v-ab04d162><div class="gallery-container" data-v-ab04d162><!--[-->`);
        ssrRenderList(unref(visibleProjects), (project, pos) => {
          _push(`<div class="${ssrRenderClass(["gallery-item", `gallery-item-${pos + 1}`])}" data-v-ab04d162><div class="image-wrapper" data-v-ab04d162>`);
          _push(ssrRenderComponent(_component_NuxtImg, {
            src: project.slider,
            alt: project.title,
            width: 275,
            height: 572,
            class: "gallery-image"
          }, null, _parent));
          _push(`<div class="${ssrRenderClass([{
            "inactive-overlay-visible": pos + 1 !== unref(centerPosition)
          }, "inactive-overlay"])}" data-v-ab04d162></div></div></div>`);
        });
        _push(`<!--]--><div class="gallery-controls" data-v-ab04d162><button${ssrRenderAttr("aria-label", _ctx.$t("ariaLabels.prevBtn"))} class="gallery-controls-button" data-v-ab04d162>`);
        _push(ssrRenderComponent(_component_SvgGradientArrowRightIcon, { class: "h-5 w-5" }, null, _parent));
        _push(`</button><button${ssrRenderAttr("aria-label", _ctx.$t("ariaLabels.nextBtn"))} class="gallery-controls-button" data-v-ab04d162>`);
        _push(ssrRenderComponent(_component_SvgGradientArrowLeftIcon, { class: "h-5 w-5" }, null, _parent));
        _push(`</button></div></div></div>`);
        if (getCurrentProject()) {
          _push(`<div class="project-description" data-v-ab04d162><p class="line-clamp-2" data-v-ab04d162>${ssrInterpolate((_b = getCurrentProject()) == null ? void 0 : _b.short_description)}</p>`);
          _push(ssrRenderComponent(_component_NuxtLinkLocale, {
            class: "ws-gradient-border mx-auto w-fit px-4 py-2",
            to: `/our-projects/${(_c = getCurrentProject()) == null ? void 0 : _c.slug}`
          }, {
            default: withCtx((_, _push2, _parent2, _scopeId) => {
              if (_push2) {
                _push2(`${ssrInterpolate(_ctx.$t("projectsHighlight.know-more-button"))}`);
              } else {
                return [
                  createTextVNode(toDisplayString(_ctx.$t("projectsHighlight.know-more-button")), 1)
                ];
              }
            }),
            _: 1
          }, _parent));
          _push(`</div>`);
        } else {
          _push(`<!---->`);
        }
        _push(`</div>`);
      } else if (props.projects && props.projects.length < 7) {
        _push(`<div${ssrRenderAttrs(_attrs)} data-v-ab04d162>`);
        _push(ssrRenderComponent(_component_EmptyState, {
          size: "100%",
          "custom-message": _ctx.$t("projectsCarousel.notEnoughMobileProjects")
        }, null, _parent));
        _push(`</div>`);
      } else {
        _push(`<!---->`);
      }
    };
  }
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
  const ssrContext = useSSRContext();
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/global/StackedProductsCarouselMobile.vue");
  return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
const __nuxt_component_1 = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-ab04d162"]]);
export {
  __nuxt_component_1 as default
};
//# sourceMappingURL=StackedProductsCarouselMobile-DKe-POM2.js.map
