{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/tzGWH5vcjIpSrgfeVUFs/sgdLFDdby9nJF5E1K94A/DownloadButton.js"],
  "sourcesContent": ["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";import{motion}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";const onHoverStyle={scale:1.05,cursor:\"pointer\"};const spring={type:\"spring\",stiffness:300,damping:30};/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function Download(props){const[blobUrl,setBlobUrl]=useState(null);const{fileName,tint,style,file,radius,topLeftRadius,topRightRadius,bottomRightRadius,bottomLeftRadius,isMixedRadius=false,stylePadding,topLeftPadding,topRightPadding,bottomRightPadding,bottomLeftPadding,isMixedPadding=false,font,icon,title,showLabel=true,showIcon=true,iconSize=30}=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:tint,overflow:\"visible\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},whileHover:onHoverStyle,transition:{type:\"spring\",stiffness:500,damping:30},children:/*#__PURE__*/_jsxs(\"a\",{href:blobUrl,style:{textDecoration:\"none\",display:\"flex\",alignItems:\"center\"},download:fileName,children:[showIcon&&icon&&/*#__PURE__*/_jsx(\"img\",{src:icon,alt:\"icon\",style:{width:iconSize,height:iconSize}}),showLabel&&/*#__PURE__*/_jsxs(_Fragment,{children:[showIcon&&/*#__PURE__*/_jsx(\"div\",{style:{width:8}}),\" \",/*#__PURE__*/_jsx(\"span\",{style:{color:font.color,fontSize:font.size,fontWeight:font.weight,fontFamily:`'${font.fontFace}'`,whiteSpace:\"nowrap\"},children:title})]})]})})});}addPropertyControls(Download,{// Reorder the controls as requested\nshowLabel:{type:ControlType.Boolean,title:\"Show Label\",defaultValue:true},title:{title:\"Label\",type:ControlType.String,defaultValue:\"Download!\"},showIcon:{type:ControlType.Boolean,title:\"Show Icon\",defaultValue:true},icon:{type:ControlType.Image,title:\"Icon\"},iconSize:{type:ControlType.Number,title:\"Icon Size\",defaultValue:24,min:10,max:100},file:{title:\"File\",type:ControlType.File,allowedFileTypes:[]},fileName:{type:ControlType.String,defaultValue:\"File\"},tint:{title:\"Background Color\",type:ControlType.Color,defaultValue:\"#242424\"},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\"]}}},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\"};\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Download\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any\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AAS,CAAC,SAAS,CAAC,KAAKA,EAAY,OAAO,aAAa,OAAO,EAAE,KAAK,CAAC,KAAKA,EAAY,OAAO,aAAa,EAAE,EAAE,MAAM,CAAC,KAAKA,EAAY,MAAM,aAAa,MAAM,EAAE,OAAO,CAAC,KAAKA,EAAY,KAAK,aAAa,OAAO,QAAQ,CAAC,SAAS,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,KAAKA,EAAY,YAAY,MAAM,SAAS,aAAa,EAAE,UAAU,gBAAgB,aAAa,CAAC,MAAM,YAAY,EAAE,UAAU,CAAC,gBAAgB,iBAAiB,oBAAoB,kBAAkB,EAAE,YAAY,CAAC,IAAI,IAAI,IAAI,GAAG,EAAE,IAAI,CAAC,EAAE,aAAa,CAAC,KAAKA,EAAY,YAAY,MAAM,UAAU,aAAa,GAAG,UAAU,iBAAiB,aAAa,CAAC,MAAM,YAAY,EAAE,UAAU,CAAC,iBAAiB,kBAAkB,qBAAqB,mBAAmB,EAAE,YAAY,CAAC,IAAI,IAAI,IAAI,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAML,EAAe,CAAC,QAAQ,OAAO,eAAe,SAAS,WAAW,SAAS,SAAS,SAAS",
  "names": ["onHoverStyle", "Download", "props", "blobUrl", "setBlobUrl", "ye", "fileName", "tint", "style", "file", "radius", "topLeftRadius", "topRightRadius", "bottomRightRadius", "bottomLeftRadius", "isMixedRadius", "stylePadding", "topLeftPadding", "topRightPadding", "bottomRightPadding", "bottomLeftPadding", "isMixedPadding", "font", "icon", "title", "showLabel", "showIcon", "iconSize", "borderRadius", "padding", "handleClick", "blob", "ue", "p", "motion", "containerStyle", "onHoverStyle", "u", "l", "addPropertyControls", "ControlType"]
}
