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