{"version":3,"file":"Download_button.BTpgZndG.mjs","names":["useState"],"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,GAAYA,EAAS,KAAK,CAAM,CAAC,EAAU,GAAcA,EAAS,GAAM,CAAM,CAAC,WAAS,QAAM,OAAK,YAAU,QAAM,OAAK,SAAO,gBAAc,iBAAe,oBAAkB,mBAAiB,gBAA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