{"version":3,"file":"ProductGallery.CB6Gc71f.mjs","names":["useState","startTransition","__esmMin","te","_e","p","c","init_jsx_runtime","init_npm_react_18_3_1","motion","AnimatePresence","init_framer_motion_DhsWWWsN","addPropertyControls","init_framer_DKgW_P28","ControlType","ProductGallery","props","selectedIndex","setSelectedIndex","hoveredIndex","setHoveredIndex","hasImages","images","safeSelectedIndex","selectedImage","handleThumbnailClick","index","getOptimizedThumbnailUrl","src","url","optimizedSize","size","shadowStyle","shadowIntensity","style","useFixedSize","containerHeight","transitionDuration","imageObjectFit","thumbnailGap","isActive","isHovered","optimizedSrc","image","thumbnailSize","activeBorderWidth","activeBorderColor","hoverOpacity","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,SAAwBe,EAAe,EAAM,CAAC,GAAK,CAAC,SAAO,CAAC,EAAE,gBAAc,eAAa,eAAa,kBAAgB,oBAAkB,oBAAkB,eAAa,qBAAmB,eAAa,kBAAgB,iBAAe,SAAOC,EAAW,CAACC,EAAcC,GAAkBlB,EAAS,CAAC,EAAO,CAACmB,EAAaC,GAAiBpB,EAAS,IAAI,EACnVqB,EAAUC,GAAQA,EAAO,OAAO,EAAQC,EAAkBF,GAAWJ,EAAcK,EAAO,OAAOL,EAAc,EAAQO,EAAcH,EAAUC,EAAOC,GAAmB,KAAWE,EAAqB,GAAO,CAACtB,MAAoBe,EAAiBQ,CAAK,CAAC,CAAE,EAC9PC,GAA0B,EAAI,IAAO,CAAC,GAAG,CAACC,EAAI,MAAM,GAC1D,GAAGA,EAAI,SAAS,uBAAuB,EAAE,CAAC,IAAMC,EAAI,IAAI,IAAID,CAAG,EACzDE,EAAc,KAAK,KAAKC,EAAK,CAAC,EACC,OADCF,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,OAAOD,CAAI,EAAQI,EAAY,KAAKC,EAAgB,KAAKA,EAAgB,EAAE,mBAAmBA,EAAgB,IAAI,GACoF,OAA9PZ,EAAkR,gBAA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