import{d as E,r as v,s as V,h as z,i as T,a as l,b as w,e,t as g,F,A as G,u as k,f as r,w as D,v as H,o as c,L as C,X as R,z as U,j as X}from"./m2W8DxR4.js";import{_ as q,a as J}from"./XVpmYxmA.js";import{_ as K}from"./CUZc3WDI.js";import{s as O}from"./x_rD_Ya3.js";import"./ByXNX2C_.js";const Q={key:0,dir:"rtl",class:"gallery-wrapper"},W={class:"project-title"},Y={class:"gallery"},Z={class:"image-wrapper"},tt={class:"gallery-controls"},et=["aria-label"],ot=["aria-label"],st={key:0,class:"project-description"},nt={class:"line-clamp-2"},at={key:1},h=7,lt=E({__name:"StackedProductsCarouselMobile",props:{projects:{}},setup(P){const t=P,s=v(0),I=v(!0),$=v(3e3);let n=null;const L=Math.ceil(h/2),M=V(()=>{const o=t.projects.length,d=[];for(let a=0;a<h;a++){const p=(s.value+a-Math.floor(h/2)+o)%o;d.push(t.projects[p])}return d}),i=()=>t.projects[s.value],N=()=>{s.value=(s.value-1+t.projects.length)%t.projects.length},y=()=>{s.value=(s.value+1)%t.projects.length},u=()=>{I.value&&!n&&(n=O(y,$.value))},_=()=>{n!==null&&(clearInterval(n),n=null)};return z(()=>{u(),document.addEventListener("visibilitychange",()=>{document.hidden?_():u()})}),T(_),(o,d)=>{var f,b,j;const a=R,p=q,B=J,A=H,S=K;return t.projects&&t.projects.length>=7?(c(),l("div",Q,[e("h3",W,g((f=i())==null?void 0:f.title),1),e("div",Y,[e("div",{class:"gallery-container",onMouseenter:_,onMouseleave:u},[(c(!0),l(F,null,G(k(M),(m,x)=>(c(),l("div",{key:m.id,class:C(["gallery-item",`gallery-item-${x+1}`])},[e("div",Z,[r(a,{src:m.slider,alt:m.title,width:275,height:572,class:"gallery-image"},null,8,["src","alt"]),e("div",{class:C(["inactive-overlay",{"inactive-overlay-visible":x+1!==k(L)}])},null,2)])],2))),128)),e("div",tt,[e("button",{"aria-label":o.$t("ariaLabels.prevBtn"),class:"gallery-controls-button",onClick:N},[r(p,{class:"h-5 w-5"})],8,et),e("button",{"aria-label":o.$t("ariaLabels.nextBtn"),class:"gallery-controls-button",onClick:y},[r(B,{class:"h-5 w-5"})],8,ot)])],32)]),i()?(c(),l("div",st,[e("p",nt,g((b=i())==null?void 0:b.short_description),1),r(A,{class:"ws-gradient-border mx-auto w-fit px-4 py-2",to:`/our-projects/${(j=i())==null?void 0:j.slug}`},{default:D(()=>[U(g(o.$t("projectsHighlight.know-more-button")),1)]),_:1},8,["to"])])):w("",!0)])):t.projects&&t.projects.length<7?(c(),l("div",at,[r(S,{size:"100%","custom-message":o.$t("projectsCarousel.notEnoughMobileProjects")},null,8,["custom-message"])])):w("",!0)}}}),dt=X(lt,[["__scopeId","data-v-ab04d162"]]);export{dt as default};
