{"version":3,"file":"ProductGallery.BM6jiEx3.mjs","names":["useState","startTransition","_jsx","_jsxs","__esmMin","te","_e","p","c","init_jsx_runtime","init_npm_react_18_3_1","addPropertyControls","init_framer_BWzg2IRg","ControlType","motion","AnimatePresence","init_framer_motion_1EwlFBEG","ProductGallery","props","images","thumbnailSize","thumbnailGap","borderRadius","shadowIntensity","activeBorderColor","activeBorderWidth","hoverOpacity","transitionDuration","useFixedSize","containerHeight","imageObjectFit","style","selectedIndex","setSelectedIndex","hoveredIndex","setHoveredIndex","hasImages","safeSelectedIndex","selectedImage","handleThumbnailClick","index","getOptimizedThumbnailUrl","src","size","url","optimizedSize","shadowStyle","image","isActive","isHovered","optimizedSrc","init_ProductGallery"],"sources":["https:/framerusercontent.com/modules/Ksdjod1TcAjKWTG4gbvf/XOLg9mVfO9TIHss8VEbE/ProductGallery.js"],"sourcesContent":["// Responsive product gallery component for e-commerce product page with vertical thumbnails on left, main image on right, smooth transitions, and mobile-friendly horizontal scrolling\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{motion,AnimatePresence}from\"framer-motion\";/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function ProductGallery(props){const{images=[],thumbnailSize,thumbnailGap,borderRadius,shadowIntensity,activeBorderColor,activeBorderWidth,hoverOpacity,transitionDuration,useFixedSize,containerHeight,imageObjectFit,style}=props;const[selectedIndex,setSelectedIndex]=useState(0);const[hoveredIndex,setHoveredIndex]=useState(null);// Safety check: ensure we have images and selectedIndex is valid\nconst hasImages=images&&images.length>0;const safeSelectedIndex=hasImages&&selectedIndex<images.length?selectedIndex:0;const selectedImage=hasImages?images[safeSelectedIndex]:null;const handleThumbnailClick=index=>{startTransition(()=>setSelectedIndex(index));};// Helper function to generate optimized thumbnail URL\nconst getOptimizedThumbnailUrl=(src,size)=>{if(!src)return\"\";// For Framer images, add size parameters for optimization\nif(src.includes(\"framerusercontent.com\")){const url=new URL(src);// Request image at 2x thumbnail size for retina displays\nconst optimizedSize=Math.ceil(size*2);url.searchParams.set(\"width\",optimizedSize.toString());url.searchParams.set(\"height\",optimizedSize.toString());url.searchParams.set(\"fit\",\"crop\");// Add quality parameter for compression (60-80 is good for thumbnails)\nurl.searchParams.set(\"quality\",\"70\");return url.toString();}return src;};const shadowStyle=`0 ${shadowIntensity}px ${shadowIntensity*2}px rgba(0, 0, 0, ${shadowIntensity*.02})`;// If no images, show placeholder\nif(!hasImages){return /*#__PURE__*/_jsx(\"div\",{style:{...style,width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",backgroundColor:\"#f8f8f8\",borderRadius,color:\"#999\",fontSize:14},children:\"Add images to display gallery\"});}return /*#__PURE__*/_jsxs(\"div\",{style:{...style,width:\"100%\",height:\"100%\",display:\"flex\",flexDirection:\"column\",gap:24,padding:0,position:\"relative\"},children:[/*#__PURE__*/_jsx(\"style\",{children:`\n          @media (max-width: 768px) {\n            .thumbnails-container {\n              overflow-x: auto !important;\n              overflow-y: hidden !important;\n              padding-bottom: 8px;\n            }\n            .thumbnails-container::-webkit-scrollbar {\n              height: 4px;\n            }\n            .thumbnails-container::-webkit-scrollbar-track {\n              background: #f1f1f1;\n              border-radius: 2px;\n            }\n            .thumbnails-container::-webkit-scrollbar-thumb {\n              background: #888;\n              border-radius: 2px;\n            }\n            .thumbnails-container::-webkit-scrollbar-thumb:hover {\n              background: #555;\n            }\n          }\n        `}),/*#__PURE__*/_jsxs(\"div\",{className:\"product-gallery-container\",style:{display:\"flex\",flexDirection:\"column\",gap:24,width:\"100%\",height:\"100%\"},children:[/*#__PURE__*/_jsx(\"div\",{style:{flex:useFixedSize?\"0 0 auto\":1,height:useFixedSize?containerHeight:\"auto\",position:\"relative\",borderRadius,overflow:\"hidden\",boxShadow:shadowStyle,backgroundColor:\"#f8f8f8\",minHeight:useFixedSize?containerHeight:300,display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},children:selectedImage&&/*#__PURE__*/_jsx(AnimatePresence,{mode:\"wait\",children:/*#__PURE__*/_jsx(motion.img,{src:selectedImage.src,srcSet:selectedImage.srcSet,alt:selectedImage.alt||\"Product image\",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:transitionDuration},style:{width:useFixedSize?\"100%\":\"fit-content\",height:useFixedSize?\"100%\":\"fit-content\",maxWidth:useFixedSize?\"100%\":\"100%\",maxHeight:useFixedSize?\"100%\":\"100%\",objectFit:useFixedSize?imageObjectFit:\"contain\",display:\"block\",borderRadius}},safeSelectedIndex)})}),/*#__PURE__*/_jsx(\"div\",{className:\"thumbnails-container\",style:{display:\"flex\",flexDirection:\"row\",gap:thumbnailGap,overflowX:\"auto\",overflowY:\"hidden\",width:\"100%\",scrollbarWidth:\"thin\",scrollbarColor:\"#888 #f1f1f1\"},children:images.map((image,index)=>{const isActive=index===safeSelectedIndex;const isHovered=index===hoveredIndex;const optimizedSrc=getOptimizedThumbnailUrl(image?.src||\"\",thumbnailSize);return /*#__PURE__*/_jsx(\"button\",{onClick:()=>handleThumbnailClick(index),onMouseEnter:()=>startTransition(()=>setHoveredIndex(index)),onMouseLeave:()=>startTransition(()=>setHoveredIndex(null)),style:{width:thumbnailSize,height:thumbnailSize,minWidth:thumbnailSize,minHeight:thumbnailSize,borderRadius,overflow:\"hidden\",cursor:\"pointer\",border:isActive?`${activeBorderWidth}px solid ${activeBorderColor}`:`${activeBorderWidth}px solid transparent`,boxShadow:shadowStyle,transition:`all ${transitionDuration}s ease`,opacity:isHovered&&!isActive?hoverOpacity:1,padding:0,background:\"transparent\",position:\"relative\"},\"aria-label\":`View ${image?.alt||\"product image\"}`,\"aria-pressed\":isActive,children:/*#__PURE__*/_jsx(\"img\",{src:optimizedSrc,alt:image?.alt||\"Product image\",style:{width:\"100%\",height:\"100%\",objectFit:\"cover\",display:\"block\"}})},index);})})]})]});}addPropertyControls(ProductGallery,{images:{type:ControlType.Array,control:{type:ControlType.ResponsiveImage},defaultValue:[{src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Product view 1\"},{src:\"https://framerusercontent.com/images/aNsAT3jCvt4zglbWCUoFe33Q.jpg\",alt:\"Product view 2\"},{src:\"https://framerusercontent.com/images/BYnxEV1zjYb9bhWh1IwBZ1ZoS60.jpg\",alt:\"Product view 3\"},{src:\"https://framerusercontent.com/images/2uTNEj5aTl2K3NJaEFWMbnrA.jpg\",alt:\"Product view 4\"},{src:\"https://framerusercontent.com/images/f9RiWoNpmlCMqVRIHz8l8wYfeI.jpg\",alt:\"Product view 5\"},{src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Product view 6\"}],maxCount:12},useFixedSize:{type:ControlType.Boolean,title:\"Fixed Size\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"},containerHeight:{type:ControlType.Number,title:\"Container Height\",defaultValue:500,min:200,max:1e3,step:10,unit:\"px\",hidden:({useFixedSize})=>!useFixedSize},imageObjectFit:{type:ControlType.Enum,title:\"Image Fit\",options:[\"contain\",\"cover\"],optionTitles:[\"Contain\",\"Cover\"],defaultValue:\"contain\",displaySegmentedControl:true,hidden:({useFixedSize})=>!useFixedSize},thumbnailSize:{type:ControlType.Number,title:\"Thumbnail Size\",defaultValue:80,min:50,max:150,step:5,unit:\"px\"},thumbnailGap:{type:ControlType.Number,title:\"Thumbnail Gap\",defaultValue:12,min:4,max:32,step:2,unit:\"px\"},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:8,min:0,max:32,step:1,unit:\"px\"},shadowIntensity:{type:ControlType.Number,title:\"Shadow Intensity\",defaultValue:4,min:0,max:20,step:1},activeBorderColor:{type:ControlType.Color,title:\"Active Border\",defaultValue:\"#000000\"},activeBorderWidth:{type:ControlType.Number,title:\"Border Width\",defaultValue:2,min:1,max:6,step:1,unit:\"px\"},hoverOpacity:{type:ControlType.Number,title:\"Hover Opacity\",defaultValue:.7,min:.3,max:1,step:.1},transitionDuration:{type:ControlType.Number,title:\"Transition Speed\",defaultValue:.3,min:.1,max:1,step:.1,unit:\"s\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ProductGallery\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any\",\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ProductGallery.map"],"mappings":"A,gPAIG,SAAwBiB,EAAeC,EAAM,CAAC,GAAK,CAACC,SAAO,CAAC,EAAEC,gBAAcC,eAAaC,eAAaC,kBAAgBC,oBAAkBC,oBAAkBC,eAAaC,qBAAmBC,eAAaC,kBAAgBC,iBAAeC,SAAOb,EAAW,CAACc,EAAcC,GAAkBjC,EAAS,CAAC,EAAO,CAACkC,EAAaC,GAAiBnC,EAAS,IAAI,EACnVoC,EAAUjB,GAAQA,EAAO,OAAO,EAAQkB,EAAkBD,GAAWJ,EAAcb,EAAO,OAAOa,EAAc,EAAQM,EAAcF,EAAUjB,EAAOkB,GAAmB,KAAWE,EAAqBC,GAAO,CAACvC,MAAoBgC,EAAiBO,CAAK,CAAC,CAAE,EAC9PC,GAA0BC,EAAIC,IAAO,CAAC,GAAG,CAACD,EAAI,MAAM,GAC1D,GAAGA,EAAI,SAAS,uBAAuB,EAAE,CAAC,IAAME,EAAI,IAAI,IAAIF,CAAG,EACzDG,EAAc,KAAK,KAAKF,EAAK,CAAC,EACC,OADCC,EAAI,aAAa,IAAI,QAAQC,EAAc,SAAS,CAAC,EAAED,EAAI,aAAa,IAAI,SAASC,EAAc,SAAS,CAAC,EAAED,EAAI,aAAa,IAAI,MAAM,MAAM,EACtLA,EAAI,aAAa,IAAI,UAAU,IAAI,EAASA,EAAI,SAAS,CAAE,CAAC,OAAOF,CAAI,EAAQI,EAAY,KAAKvB,EAAgB,KAAKA,EAAgB,EAAE,mB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