{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/DKVhtKF5mUzNR0u65b23/BNpE1EAZVR4dqJtaiCMT/Download_button.js"],
  "sourcesContent": ["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{motion}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";// Learn more: https://www.framer.com/docs/guides/overrides/\n// By Vinaykumar C (www.linkedin.com/in/vinay-sc)\nexport default function Download(props){const{title,tint,style,file,downloadFileName,fontFamily,fontWeight,fontSize,color,paddingTop,paddingRight,paddingBottom,paddingLeft,borderRadius,icon,iconSize}=props;const downloadFile=()=>{fetch(file).then(response=>response.blob()).then(blob=>{const url=window.URL.createObjectURL(blob);const link=document.createElement(\"a\");link.href=url;link.download=downloadFileName||getFileNameFromUrl(file)||\"download\";document.body.appendChild(link);link.click();document.body.removeChild(link);window.URL.revokeObjectURL(url);}).catch(error=>{console.error(\"Error downloading the file:\",error);});};return /*#__PURE__*/_jsx(motion.div,{style:{...style,...containerStyle},children:/*#__PURE__*/_jsxs(motion.div,{onTap:downloadFile,style:{margin:0,paddingTop:paddingTop,paddingRight:paddingRight,paddingBottom:paddingBottom,paddingLeft:paddingLeft,borderRadius:borderRadius,backgroundColor:tint,color:color,fontSize:`${fontSize}pt`,fontWeight:fontWeight,fontFamily:fontFamily,lineHeight:\"1em\",display:\"inline-flex\",justifyContent:\"center\",alignItems:\"center\",width:\"auto\",height:\"auto\",whiteSpace:\"nowrap\",boxSizing:\"border-box\",cursor:\"pointer\",gap:\"8px\"},children:[icon&&/*#__PURE__*/_jsx(\"img\",{src:icon,alt:\"Icon\",style:{width:iconSize,height:iconSize}}),title]})});}Download.defaultProps={tint:\"#09F\",title:\"Download\",downloadFileName:\"\",fontFamily:\"Inter, sans-serif\",fontWeight:\"bold\",fontSize:24,color:\"white\",paddingTop:12,paddingRight:12,paddingBottom:12,paddingLeft:12,borderRadius:20,iconSize:24};addPropertyControls(Download,{tint:{title:\"Tint\",type:ControlType.Color},title:{title:\"Label\",type:ControlType.String},file:{title:\"File\",type:ControlType.File,allowedFileTypes:[]},downloadFileName:{title:\"Download File Name\",type:ControlType.String,defaultValue:\"\"},fontFamily:{title:\"Font Family\",type:ControlType.String,defaultValue:\"Inter, sans-serif\"},fontWeight:{title:\"Font Weight\",type:ControlType.String,defaultValue:\"bold\"},fontSize:{title:\"Font Size (pt)\",type:ControlType.Number,defaultValue:24},color:{title:\"Font Color\",type:ControlType.Color,defaultValue:\"white\"},paddingTop:{title:\"Padding Top\",type:ControlType.Number,defaultValue:12},paddingRight:{title:\"Padding Right\",type:ControlType.Number,defaultValue:12},paddingBottom:{title:\"Padding Bottom\",type:ControlType.Number,defaultValue:12},paddingLeft:{title:\"Padding Left\",type:ControlType.Number,defaultValue:12},borderRadius:{title:\"Border Radius\",type:ControlType.Number,defaultValue:20},icon:{title:\"Icon\",type:ControlType.Image},iconSize:{title:\"Icon Size\",type:ControlType.Number,defaultValue:24}});const containerStyle={display:\"flex\",justifyContent:\"center\",alignItems:\"center\",overflow:\"hidden\"};function getFileNameFromUrl(url){const decodedUrl=decodeURIComponent(url);const parts=decodedUrl.split(\"/\");return parts[parts.length-1];}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Download\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Download_button.map"],
  "mappings": "gJAEe,SAARA,EAA0BC,EAAM,CAAC,GAAK,CAAC,MAAAC,EAAM,KAAAC,EAAK,MAAAC,EAAM,KAAAC,EAAK,iBAAAC,EAAiB,WAAAC,EAAW,WAAAC,EAAW,SAAAC,EAAS,MAAAC,EAAM,WAAAC,EAAW,aAAAC,EAAa,cAAAC,EAAc,YAAAC,EAAY,aAAAC,EAAa,KAAAC,EAAK,SAAAC,CAAQ,EAAEhB,EAAYiB,EAAa,IAAI,CAAC,MAAMb,CAAI,EAAE,KAAKc,GAA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+B,EAAY,KAAK,EAAE,MAAM,CAAC,MAAM,QAAQ,KAAKA,EAAY,MAAM,EAAE,KAAK,CAAC,MAAM,OAAO,KAAKA,EAAY,KAAK,iBAAiB,CAAC,CAAC,EAAE,iBAAiB,CAAC,MAAM,qBAAqB,KAAKA,EAAY,OAAO,aAAa,EAAE,EAAE,WAAW,CAAC,MAAM,cAAc,KAAKA,EAAY,OAAO,aAAa,mBAAmB,EAAE,WAAW,CAAC,MAAM,cAAc,KAAKA,EAAY,OAAO,aAAa,MAAM,EAAE,SAAS,CAAC,MAAM,iBAAiB,KAAKA,EAAY,OAAO,aAAa,EAAE,EAAE,MAAM,CAAC,MAAM,aAAa,KAAKA,EAAY,MAAM,aAAa,OAAO,EAAE,WAAW,CAAC,MAAM,cAAc,KAAKA,EAAY,OAAO,aAAa,EAAE,EAAE,aAAa,CAAC,MAAM,gBAAgB,KAAKA,EAAY,OAAO,aAAa,EAAE,EAAE,cAAc,CAAC,MAAM,iBAAiB,KAAKA,EAAY,OAAO,aAAa,EAAE,EAAE,YAAY,CAAC,MAAM,eAAe,KAAKA,EAAY,OAAO,aAAa,EAAE,EAAE,aAAa,CAAC,MAAM,gBAAgB,KAAKA,EAAY,OAAO,aAAa,EAAE,EAAE,KAAK,CAAC,MAAM,OAAO,KAAKA,EAAY,KAAK,EAAE,SAAS,CAAC,MAAM,YAAY,KAAKA,EAAY,OAAO,aAAa,EAAE,CAAC,CAAC,EAAE,IAAMH,EAAe,CAAC,QAAQ,OAAO,eAAe,SAAS,WAAW,SAAS,SAAS,QAAQ,EAAE,SAASJ,EAAmBH,EAAI,CAA0C,IAAMW,EAA9B,mBAAmBX,CAAG,EAAyB,MAAM,GAAG,EAAE,OAAOW,EAAMA,EAAM,OAAO,CAAC,CAAE",
  "names": ["Download", "props", "title", "tint", "style", "file", "downloadFileName", "fontFamily", "fontWeight", "fontSize", "color", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft", "borderRadius", "icon", "iconSize", "downloadFile", "response", "blob", "url", "window", "link", "getFileNameFromUrl", "error", "p", "motion", "containerStyle", "u", "addPropertyControls", "ControlType", "parts"]
}
