'use client';
import{jsxs as e,jsx as r}from"react/jsx-runtime";import{useEffect as o}from"react";import{postPurchaseSpacing as t}from"../../../../common/helper.js";import{createClass as s,createStyle as m}from"@gem-sdk/system";import{ArrowPostPurchase as a}from"./Arrow.js";import{CarouselPostPurchase as i}from"./CarouselPostPurchase.js";import{useCarousel as n}from"../../../hooks/useCarousel.js";import{getImageListClass as p}from"../../../common/classes.js";import{getImageListStyle as c}from"../../../common/styles.js";let CarouselWrapperPostPurchase=({styles:l,setting:u,productImages:h,objectFit:d="cover",aspectRatio:f,itemPerSlide:j=1,spacing:v,navigation:g="none",vertical:P=!1,border:y="none",idxActive:x})=>{let C={...l,...u},{layoutType:b}=C||{},{setMoveToIdx:k,setMaxIdx:w}=n(),N=t[v||"none"]??"0px",R="one-col"===b,W=s(p()),A=m(c({gap:N,vertical:P}));return o(()=>{let e=h.length-Number(j||0);w(e)},[h.length,j,w]),o(()=>{(x||0===x)&&1===j&&k(x)},[x,j,k]),e("div",{className:W,style:A,children:[r(a,{type:"prev",navigation:g,vertical:P,hidden:R}),r(i,{productImages:h,itemPerRow:j,border:y,aspectRatio:f,objectFit:d,vertical:P}),r(a,{type:"next",navigation:g,vertical:P,hidden:R})]})};export{CarouselWrapperPostPurchase};
