'use client';
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),Carousel=require("../../../carousel-v3/components/root/Carousel.js"),CarouselItem=require("../../../carousel-v3/components/item/CarouselItem.js"),NextImage=require("../../../image/components/NextImage.js");require("../../../modal/components/confirm.js");var Modal=require("../../../modal/components/Modal.js"),React=require("react"),productFeaturedImage=require("./common/productFeaturedImage.js");const ProductImagesLightBox=({builderPropUID:e,productImages:t,open:o,imageRatio:s,onHandleClose:i})=>{let l=core.useFeaturedImageGlobal(),r=React.useMemo(()=>{let e=t?.findIndex(e=>e.id===l?.id);return e&&e>0?e:0},[t,l]),a={desktop:t&&t.length>1,mobile:t&&t?.length>1,tablet:t&&t?.length>1},d={desktop:!1,mobile:!1,tablet:!1};return jsxRuntime.jsx(Modal.default,{setting:{open:o},styles:{width:"80%"},closeOnClickOutside:!0,onClose:()=>i(),disableIframeClickEvent:!0,contentClass:"mobile:!gp-w-[100%] gp-px-2",children:jsxRuntime.jsx(Carousel.default,{setting:{loop:d,slidesToShow:{desktop:1,tablet:1,mobile:1},defaultCurrentSlider:r,dot:{desktop:!0,mobile:!0,tablet:!0},dotStyle:{desktop:"outside",mobile:"outside",tablet:"outside"},dotColor:{desktop:"#E2E2E2",mobile:"#E2E2E2",tablet:"#E2E2E2"},dotActiveColor:{desktop:"#121212",mobile:"#121212",tablet:"#121212"},controlOverContent:{desktop:!0,mobile:!0,tablet:!0},arrow:a},styles:{sizeSetting:{desktop:{height:"80vh"},tablet:{height:"80vh"},mobile:{height:"60vh"}}},moveToIdx:r,hiddenDotWhenOnlyOne:!0,isHiddenArrowWhenDisabled:!0,builderProps:{uid:e},children:t?.map(t=>jsxRuntime.jsx(CarouselItem.default,{className:`gem-slider-item gem-slider-item-${e} gp-flex gp-items-center gp-justify-center gp-px-4`,children:jsxRuntime.jsx(NextImage.default,{src:productFeaturedImage.isFeatureMedia(t?.contentType)?t?.previewImage:t?.src,width:t?.width,height:t?.height,alt:t?.alt,"content-type":t?.contentType,setting:{aspectRatio:s},className:core.cls("gp-h-full gp-w-full gp-object-contain")},t?.id)},t?.id))})})};exports.default=ProductImagesLightBox;
