{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/BF8Bc0aqiAdes35J18wI/lpvb2rGfAoDMZ6nyDNQO/download.js"],
  "sourcesContent": ["import{jsx as _jsx}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}=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__*/_jsx(motion.div,{onTap:downloadFile,style:{display:\"flex\",alignItems:\"center\",justifyContent:\"center\",margin:10,padding:\"10px 30px\",borderRadius:8,backgroundColor:tint,color:\"white\",fontSize:\"1em\",fontWeight:\"bold\",width:\"100%\",height:\"100%\",textAlign:\"center\"},whileHover:{scale:1.09},children:title})});}Download.defaultProps={tint:\"#09F\",title:\"Download Budget 2024 Highlights\",downloadFileName:\"\"};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:\"\"}});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\":\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AAK,iBAAiB,CAAC,CAAC,EAAE,iBAAiB,CAAC,MAAM,qBAAqB,KAAKA,EAAY,OAAO,aAAa,EAAE,CAAC,CAAC,EAAE,IAAMF,EAAe,CAAC,QAAQ,OAAO,eAAe,SAAS,WAAW,SAAS,SAAS,QAAQ,EAAE,SAASJ,EAAmBH,EAAI,CAA0C,IAAMU,EAA9B,mBAAmBV,CAAG,EAAyB,MAAM,GAAG,EAAE,OAAOU,EAAMA,EAAM,OAAO,CAAC,CAAE",
  "names": ["init_ssg_sandbox_shims", "Download", "props", "title", "tint", "style", "file", "downloadFileName", "downloadFile", "response", "blob", "url", "window", "link", "getFileNameFromUrl", "error", "p", "motion", "containerStyle", "addPropertyControls", "ControlType", "parts"]
}
