"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("@gem-sdk/core"),o=require("react"),s=require("../../common/common.js"),r=require("../../../../../image/components/NextImage.js"),a=require("../lightbox/ButtonOpenLightBox.js"),i=require("./MediaIcon.js"),l=require("./ProductFeatureVideo.js"),c=require("../../common/productFeaturedImage.js"),n=require("../../common/hoverAction.js"),u=require("../../composables/getProductImagesClassName.js"),d=require("../../composables/getProductImagesStyles.js"),m=require("../../hooks/useProductGalleryGrid.js"),g=o.memo(o=>{let{builderPropUID:g,productImages:p,onHandleClick:y,activeIndexFromFeatureImage:h,children:v,isHiddenInteraction:j,...x}=o,{isDisplay:f,shapeByLayout:q,imageActiveIndex:I,enableOpenLightBox:M,isEnableBorderActive:R,filteredProductImages:T}=m.useProductGalleryGrid(o),w=t.useCurrentDevice(),{isEditMode:b}=t.useRenderMode(),E=t.getResponsiveValueByScreen(x.position,w)||"",N=["one-col","two-col"].includes(E),P="bottom-center"===E,{galleryGridWrapperClasses:F,galleryItemClasses:O}=u.getProductImagesClassName(x),{galleryGridStyles:A,galleryGridItemStyles:B}=d.getProductImagesStyles(x),C=P?"none":x.galleryHoverEffect;return e.jsx(e.Fragment,{children:f&&e.jsxs("div",{"data-slot":"children","data-id":g,className:F,style:A,"gp-data-hidden":`${j}`,children:[T?.map((o,u)=>{let d=u===I,m=c.isFeatureMedia(o.contentType)?o.previewImage:o.src,p=!b&&N&&!M&&["VIDEO","EXTERNAL_VIDEO"].includes(o?.contentType||"");return e.jsxs("div",{"aria-hidden":!0,className:O(`gp-gallery-image-item gem-slider-item-${g} ${d&&R?"gem-slider-item-active":""}`),onClick:()=>y(o?.id||"",M),style:B,onMouseMove:e=>n.handleMouseMove(e,{hoverEffect:C,zoom:x.galleryZoom,zoomType:x.galleryZoomType}),onMouseOut:e=>n.handleMouseOut(e),"data-border":d&&x?.borderActive?"active":"deactive",children:[p?e.jsx(l.default,{type:o?.contentType,url:o?.src??"",thumbnail:o?.previewImage,aspectRatio:s.getAspectRatio(q)}):e.jsxs(e.Fragment,{children:[e.jsx(r.default,{src:m,width:o?.width,height:o?.height,alt:o?.alt,setting:{aspectRatio:s.getAspectRatio(q),layout:x?.layout},style:{width:"100%",height:"100%"}},o?.id),e.jsx(i.default,{contentType:o?.contentType||""})]}),x?.galleryHoverEffect!=="none"&&!c.isFeatureMedia(o?.contentType)&&e.jsx(r.default,{src:m,width:o?.width,height:o?.height,alt:o?.alt,setting:{layout:x.layout,aspectRatio:s.getAspectRatio(q)},className:t.cls("hover-image !gp-max-w-none",c.getZoomImageClass())}),x?.galleryHoverEffect=="zoom"&&x?.galleryZoomType=="glasses"&&["one-col","two-col"].includes(t.getResponsiveValueByScreen(x.position,w)||"")&&!c.isFeatureMedia(o?.contentType)&&e.jsx("div",{className:t.cls(c.getZoomLenClass(),"room-len"),style:{...t.makeStyle({bgi:`url("${o?.src}")`})}}),t.getResponsiveValueByScreen(x?.clickOpenLightBox,w)&&e.jsx(a.default,{})]},o?.id)}),v]})})});exports.default=g;
