{"version":3,"file":"Array2d.BiFTRDqp.mjs","names":["React.useState","React.useRef"],"sources":["https:/framerusercontent.com/modules/0NdzBKii5W3mKL3dV7fd/OmL8Nx5kvjukyOl84ks8/Array2d.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerDisableUnlink\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerIntrinsicWidth 600\n * @framerSupportedLayoutHeight any-prefer-fixed\n * @framerIntrinsicHeight 400\n */export default function ImageList(props){const{richText,displayMode,gridColumns,imageSpacing,heightMode,rowWidthMode,fixedRowWidth,imagePadding,imageCornerRadius,backgroundCornerRadius,imageBackgroundColor,enableLightbox,lightboxMaxWidth}=props;const[imageSrcs,setImageSrcs]=React.useState([]);const containerRef=React.useRef(null);const[containerHeight,setContainerHeight]=React.useState(\"auto\");const[lightboxImage,setLightboxImage]=React.useState(null);React.useEffect(()=>{const extractImages=element=>{const images=[];const searchForImages=element=>{if(element.props&&element.props.children){React.Children.forEach(element.props.children,child=>{if(typeof child===\"object\"&&child.type===\"img\"){images.push(child.props.src);}else if(child.props&&child.props.children){searchForImages(child);}});}};searchForImages(element);return images;};if(richText&&richText.props&&Array.isArray(richText.props.children)){const images=extractImages(richText);setImageSrcs(images);}},[richText]);React.useEffect(()=>{const updateHeight=()=>{if(containerRef.current){const height=containerRef.current.scrollHeight;setContainerHeight(`${height}px`);}};updateHeight();const resizeObserver=new ResizeObserver(updateHeight);if(containerRef.current){resizeObserver.observe(containerRef.current);}return()=>{if(containerRef.current){resizeObserver.unobserve(containerRef.current);}};},[imageSrcs,displayMode,gridColumns,imageSpacing,heightMode,rowWidthMode,fixedRowWidth,imagePadding,imageCornerRadius,backgroundCornerRadius,imageBackgroundColor]);const openLightbox=src=>{if(enableLightbox){setLightboxImage(src);}};const closeLightbox=()=>{setLightboxImage(null);};const getContainerStyle=()=>{const baseStyle={display:displayMode===\"grid\"?\"grid\":\"flex\",gap:`${imageSpacing}px`,width:\"100%\"};switch(displayMode){case\"row\":return{...baseStyle,flexDirection:\"row\",flexWrap:\"nowrap\",overflowX:\"auto\"};case\"column\":return{...baseStyle,flexDirection:\"column\"};case\"grid\":return{...baseStyle,gridTemplateColumns:`repeat(${gridColumns}, 1fr)`};default:return baseStyle;}};const getImageStyle=()=>{const baseStyle={flexShrink:0,borderRadius:`${imageCornerRadius}px`,cursor:enableLightbox?\"zoom-in\":\"default\"};switch(heightMode){case\"fit\":return{...baseStyle,width:\"100%\",height:\"auto\",objectFit:\"contain\"};case\"fill\":return{...baseStyle,width:\"100%\",height:\"100%\",objectFit:\"cover\"};case\"stretch\":return{...baseStyle,width:\"100%\",height:\"100%\",objectFit:\"fill\"};default:return{...baseStyle,width:\"100%\",height:\"auto\",objectFit:\"contain\"};}};const getImageContainerStyle=()=>{const baseStyle={padding:`${imagePadding}px`,backgroundColor:imagePadding>0?imageBackgroundColor:\"transparent\",borderRadius:imagePadding>0?`${backgroundCornerRadius}px`:\"0\",overflow:\"hidden\"};if(displayMode===\"row\"){if(rowWidthMode===\"fixed\"){return{...baseStyle,flexShrink:0,width:`${fixedRowWidth}px`};}else{// \"fill\" mode\nreturn{...baseStyle,flexGrow:1,flexShrink:1,flexBasis:0};}}return baseStyle;};const Lightbox=({src,onClose})=>/*#__PURE__*/_jsx(\"div\",{style:{position:\"fixed\",top:0,left:0,right:0,bottom:0,backgroundColor:\"rgba(0, 0, 0, 0.8)\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\",zIndex:1e3},onClick:onClose,children:/*#__PURE__*/_jsx(\"img\",{src:src,style:{maxWidth:`min(${lightboxMaxWidth}px, 90%)`,maxHeight:\"90vh\",objectFit:\"contain\",borderRadius:`${imageCornerRadius}px`},onClick:e=>e.stopPropagation()})});return /*#__PURE__*/_jsxs(\"div\",{style:{width:\"100%\",height:containerHeight,overflow:\"hidden\"},children:[/*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:{width:\"100%\"},children:/*#__PURE__*/_jsx(\"div\",{style:getContainerStyle(),children:imageSrcs.map((src,index)=>/*#__PURE__*/_jsx(\"div\",{style:getImageContainerStyle(),onClick:()=>openLightbox(src),children:/*#__PURE__*/_jsx(\"img\",{src:src,style:getImageStyle()})},index))})}),lightboxImage&&/*#__PURE__*/_jsx(Lightbox,{src:lightboxImage,onClose:closeLightbox})]});}ImageList.defaultProps={richText:null,displayMode:\"row\",gridColumns:3,imageSpacing:10,heightMode:\"fit\",rowWidthMode:\"fill\",fixedRowWidth:200,imagePadding:0,imageCornerRadius:0,backgroundCornerRadius:0,imageBackgroundColor:\"transparent\",enableLightbox:false,lightboxMaxWidth:1e3};addPropertyControls(ImageList,{richText:{type:ControlType.RichText,title:\"Rich Text\"},displayMode:{type:ControlType.Enum,title:\"Display Mode\",options:[\"row\",\"column\",\"grid\"],optionTitles:[\"Row\",\"Column\",\"Grid\"]},gridColumns:{type:ControlType.Number,title:\"Grid Columns\",min:1,max:10,step:1,hidden:props=>props.displayMode!==\"grid\"},imageSpacing:{type:ControlType.Number,title:\"Image Spacing\",min:0},heightMode:{type:ControlType.Enum,title:\"Height Mode\",options:[\"fit\",\"fill\",\"stretch\"],optionTitles:[\"Fit\",\"Fill\",\"Stretch\"]},rowWidthMode:{type:ControlType.Enum,title:\"Row Width Mode\",options:[\"fill\",\"fixed\"],optionTitles:[\"Fill\",\"Fixed\"],hidden:props=>props.displayMode!==\"row\"},fixedRowWidth:{type:ControlType.Number,title:\"Fixed Row Width\",min:50,max:4e3,step:1,hidden:props=>props.displayMode!==\"row\"||props.rowWidthMode!==\"fixed\"},imagePadding:{type:ControlType.Number,title:\"Image Padding\",min:0,max:100,step:1},imageCornerRadius:{type:ControlType.Number,title:\"Image Corner Radius\",min:0,max:100,step:1},backgroundCornerRadius:{type:ControlType.Number,title:\"Background Corner Radius\",min:0,max:100,step:1,hidden:props=>props.imagePadding===0},imageBackgroundColor:{type:ControlType.Color,title:\"Image Background Color\",hidden:props=>props.imagePadding===0},enableLightbox:{type:ControlType.Boolean,title:\"Enable Lightbox\",description:\"1.2\\n[via SegmentUI](https://www.segmentUI.com)\"},lightboxMaxWidth:{type:ControlType.Number,title:\"Lightbox Max Width\",min:200,max:4e3,step:1,hidden:props=>!props.enableLightbox}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ImageList\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"400\",\"framerDisableUnlink\":\"*\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"600\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Array2d.map"],"mappings":"4LAOG,SAAwB,EAAU,EAAM,CAAC,GAAK,CAAC,WAAS,cAAY,cAAY,eAAa,aAAW,eAAa,gBAAc,eAAa,oBAAkB,yBAAuB,uBAAqB,iBAAe,oBAAkB,EAAW,CAAC,EAAU,GAAcA,EAAe,CAAC,CAAC,EAAQ,EAAaC,EAAa,IAAI,EAAO,CAAC,EAAgB,GAAoBD,EAAe,MAAM,EAAO,CAAC,EAAc,GAAkBA,EAAe,IAAI,EAAE,MAAoB,CAAC,IAAM,EAAc,GAAS,CAAC,IAAM,EAAO,CAAC,EAAQ,EAAgB,GAAS,CAAI,EAAQ,OAAO,EAAQ,MAAM,UAAU,EAAe,QAAQ,EAAQ,MAAM,SAAS,GAAO,CAAI,OAAO,GAAQ,UAAU,EAAM,OAAO,MAAO,EAAO,KAAK,EAAM,MAAM,GAAG,EAAW,EAAM,OAAO,EAAM,MAAM,UAAU,EAAgB,CAAK,CAAG,CAAC,CAAG,EAA2B,OAAzB,EAAgB,CAAO,EAAS,CAAO,EAAE,GAAG,GAAU,EAAS,OAAO,MAAM,QAAQ,EAAS,MAAM,QAAQ,EAAE,CAAC,IAAM,EAAO,EAAc,CAAQ,EAAE,EA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