{"version":3,"file":"FileDownloadButton.BGykMABb.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/loh2euoSljqnuXY927ed/N41GFyBYf0R04VWuwvHH/FileDownloadButton.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{motion}from\"framer-motion\";import{useState,useEffect}from\"react\";/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function FileDownloadButton(props){const[blobUrl,setBlobUrl]=useState(null);const initializeBlob=async()=>{const response=await fetch(props.file);const blob=await response.blob();const blobUrl=URL.createObjectURL(blob);setBlobUrl(blobUrl);};useEffect(()=>{initializeBlob();},[]);let button=/*#__PURE__*/_jsxs(\"a\",{href:blobUrl,download:props.fileName,style:{backgroundColor:props.fill,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",width:\"max-content\",textDecoration:\"none\",userSelect:\"none\",color:props.fontColor,cursor:props.pointerCursor?\"pointer\":\"auto\",padding:props.paddingIsMixed?`${props.paddingTopLeft}px ${props.paddingTopRight}px ${props.paddingBottomRight}px ${props.paddingBottomLeft}px`:`${props.padding}px`,borderRadius:props.radiusIsMixed?`${props.radiusTopLeft}px ${props.radiusTopRight}px ${props.radiusBottomRight}px ${props.radiusBottomLeft}px`:`${props.radius}px`,...props.font,...props.style},children:[props.icon&&/*#__PURE__*/_jsx(\"img\",{src:props.icon,alt:\"Download Icon\",style:{width:props.iconSize,height:props.iconSize,marginRight:props.iconSpacing}}),props.text]});let buttonLayer=button;if(props.effects){buttonLayer=/*#__PURE__*/_jsx(motion.div,{whileHover:{scale:props.effects.hoverScale},whileTap:{scale:props.effects.pressScale},initial:false,transition:props.effects.transition,style:{...props.style},children:button});}return buttonLayer;}FileDownloadButton.displayName=\"File Download Button\";const effectsDefault={hoverScale:1.1,pressScale:.9};addPropertyControls(FileDownloadButton,{file:{type:ControlType.File,allowedFileTypes:[],description:\"Up to 50MB\"},fileName:{type:ControlType.String,placeholder:\"File\"},text:{type:ControlType.String,defaultValue:\"Download\"},fill:{type:ControlType.Color,defaultValue:\"#EDEDED\",optional:true},fontColor:{type:ControlType.Color,defaultValue:\"#000\"},font:{type:\"font\",controls:\"extended\"},padding:{type:ControlType.FusedNumber,defaultValue:12,toggleKey:\"paddingIsMixed\",toggleTitles:[\"All\",\"Individual\"],valueKeys:[\"paddingTopLeft\",\"paddingTopRight\",\"paddingBottomRight\",\"paddingBottomLeft\"],valueLabels:[\"T\",\"R\",\"B\",\"L\"],min:0},radius:{type:ControlType.FusedNumber,defaultValue:8,toggleKey:\"radiusIsMixed\",toggleTitles:[\"All\",\"Individual\"],valueKeys:[\"radiusTopLeft\",\"radiusTopRight\",\"radiusBottomRight\",\"radiusBottomLeft\"],valueLabels:[\"TL\",\"TR\",\"BR\",\"BL\"],min:0},pointerCursor:{type:ControlType.Boolean,defaultValue:true},icon:{type:ControlType.Image,title:\"Icon\",description:\"Upload an icon image\"},iconSize:{type:ControlType.Number,title:\"Icon Size\",defaultValue:16,min:8,max:48},iconSpacing:{type:ControlType.Number,title:\"Icon Spacing\",defaultValue:8,min:0,max:24},effects:{type:ControlType.Object,defaultValue:effectsDefault,optional:true,buttonTitle:\"Hover & Press\",icon:\"effect\",controls:{hoverScale:{type:ControlType.Number,defaultValue:effectsDefault.hoverScale,min:0,step:.01,displayStepper:true},pressScale:{type:ControlType.Number,defaultValue:effectsDefault.pressScale,min:0,step:.01,displayStepper:true},transition:{type:ControlType.Transition}}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FileDownloadButton\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\",\"framerSupportedLayoutHeight\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FileDownloadButton.map"],"mappings":"yOAGG,SAAwB,EAAmB,EAAM,CAAC,GAAK,CAAC,EAAQ,GAAYA,EAAS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