{"version":3,"file":"Download_button.BmnPlDlF.mjs","names":[],"sources":["https:/framerusercontent.com/modules/5DTMMRPRpOJIWFQ8dM2s/m1G04Ytltn3LsmRgfaAt/Download_button.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";import{motion}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function Download(props){const[bloblUrl,setBlobUrl]=useState(null);const[isHovered,setIsHovered]=useState(false);const{fileName,title,tint,hoverTint,style,file,radius,topLeftRadius,topRightRadius,bottomRightRadius,bottomLeftRadius,isMixedRadius=false,stylePadding,topLeftPadding,topRightPadding,bottomRightPadding,bottomLeftPadding,isMixedPadding=false,font}=props;const borderRadius=isMixedRadius?`${topLeftRadius}px ${topRightRadius}px ${bottomRightRadius}px ${bottomLeftRadius}px`:`${radius}px`;const padding=isMixedPadding?`${topLeftPadding}px ${topRightPadding}px ${bottomRightPadding}px ${bottomLeftPadding}px`:`${stylePadding}px`;const handleClick=async()=>{const response=await fetch(props.file);const blob=await response.blob();const blobUrl=URL.createObjectURL(blob);setBlobUrl(blobUrl);};useEffect(()=>{handleClick();},[]);return /*#__PURE__*/_jsx(motion.div,{style:{...style,...containerStyle},children:/*#__PURE__*/_jsx(motion.div,{style:{borderRadius,padding,backgroundColor:isHovered?hoverTint:tint,fontSize:font.size,fontWeight:font.weight,color:font.color,fontFamily:\"Europa-Bold Bold\",overflow:\"visible\",width:\"100%\",textAlign:\"center\"},onHoverStart:()=>setIsHovered(true),onHoverEnd:()=>setIsHovered(false),animate:{backgroundColor:isHovered?hoverTint:tint},transition:{duration:.3,ease:\"easeInOut\"},children:/*#__PURE__*/_jsx(\"a\",{href:bloblUrl,style:{textDecoration:\"none\",color:font.color,textAlign:\"center\"},download:fileName,children:title})})});}addPropertyControls(Download,{fileName:{type:ControlType.String,defaultValue:\"File\"},tint:{title:\"Background Color\",type:ControlType.Color,defaultValue:\"#242424\"},hoverTint:{// New property control for hover color\ntitle:\"Hover Background Color\",type:ControlType.Color,defaultValue:\"#1a1a1a\"},title:{title:\"Label\",type:ControlType.String,defaultValue:\"Download!\"},font:{type:ControlType.Object,controls:{fontFace:{type:ControlType.String,defaultValue:\"Inter\"},size:{type:ControlType.Number,defaultValue:18},color:{type:ControlType.Color,defaultValue:\"#fff\"},weight:{type:ControlType.Enum,defaultValue:\"bold\",options:[\"normal\",\"bold\",\"bolder\",\"lighter\"]}}},file:{title:\"File\",type:ControlType.File,allowedFileTypes:[]},radius:{type:ControlType.FusedNumber,title:\"Radius\",defaultValue:8,toggleKey:\"isMixedRadius\",toggleTitles:[\"All\",\"Individual\"],valueKeys:[\"topLeftRadius\",\"topRightRadius\",\"bottomRightRadius\",\"bottomLeftRadius\"],valueLabels:[\"T\",\"R\",\"B\",\"L\"],min:0},stylePadding:{type:ControlType.FusedNumber,title:\"Padding\",defaultValue:16,toggleKey:\"isMixedPadding\",toggleTitles:[\"All\",\"Individual\"],valueKeys:[\"topLeftPadding\",\"topRightPadding\",\"bottomRightPadding\",\"bottomLeftPadding\"],valueLabels:[\"T\",\"R\",\"B\",\"L\"],min:0}});const containerStyle={display:\"flex\",justifyContent:\"center\",alignItems:\"center\",overflow:\"visible\",width:\"100%\"};\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Download\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Download_button.map"],"mappings":"0VAGG,SAAwB,EAAS,EAAM,CAAC,GAAK,CAAC,EAAS,EAAW,CAAC,EAAS,KAAK,CAAM,CAAC,EAAU,EAAa,CAAC,GAAS,EAAM,CAAM,CAAC,WAAS,QAAM,OAAK,YAAU,QAAM,OAAK,SAAO,gBAAc,iBAAe,oBAAkB,mBAAi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