{"version":3,"file":"FileDownloadButton.D60frLDo.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/hcSHXe8COGYvegLWWZnI/Ey7ruWEayAOBCF3E888q/FileDownloadButton.js"],"sourcesContent":["import{jsx as _jsx}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{file=\"https://framerusercontent.com/assets/MLWPbW1dUQawJLhhun3dBwpgJak.mp4\",fileName,text,fill,fontColor,hoverFill,hoverFontColor,font,paddingIsMixed,paddingTopLeft,paddingTopRight,paddingBottomRight,paddingBottomLeft,padding,radiusIsMixed,radiusTopLeft,radiusTopRight,radiusBottomRight,radiusBottomLeft,radius,pointerCursor,effects,style}=props;const[blobUrl,setBlobUrl]=useState(null);const initializeBlob=async()=>{if(!file)return;const response=await fetch(file);const blob=await response.blob();const blobUrl=URL.createObjectURL(blob);setBlobUrl(blobUrl);};useEffect(()=>{initializeBlob();},[file]);let button=/*#__PURE__*/_jsx(\"a\",{href:blobUrl,download:fileName,style:{backgroundColor:fill,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",width:\"max-content\",textDecoration:\"none\",userSelect:\"none\",color:fontColor,cursor:pointerCursor?\"pointer\":\"auto\",padding:paddingIsMixed?`${paddingTopLeft}px ${paddingTopRight}px ${paddingBottomRight}px ${paddingBottomLeft}px`:`${padding}px`,borderRadius:radiusIsMixed?`${radiusTopLeft}px ${radiusTopRight}px ${radiusBottomRight}px ${radiusBottomLeft}px`:`${radius}px`,//border: `1px solid rgba(22,26,30,.15)`,\ntransition:\"background-color 0.2s ease, color 0.2s ease\",...font,...style},onMouseEnter:e=>{if(hoverFill)e.currentTarget.style.backgroundColor=hoverFill;if(hoverFontColor)e.currentTarget.style.color=hoverFontColor;},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=fill;e.currentTarget.style.color=fontColor;},children:text});let buttonLayer=button;if(effects){buttonLayer=/*#__PURE__*/_jsx(motion.div,{whileHover:{scale:effects.hoverScale},whileTap:{scale:effects.pressScale},initial:false,transition:effects.transition,style:{...style},children:button});}return buttonLayer;}FileDownloadButton.displayName=\"Boton Descargar Archivo\";const effectsDefault={hoverScale:1.1,pressScale:.9};addPropertyControls(FileDownloadButton,{file:{title:\"File\",type:ControlType.File,allowedFileTypes:[]},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\"},hoverFill:{type:ControlType.Color,defaultValue:\"#D4D4D4\",optional:true,title:\"Hover Fill\"},hoverFontColor:{type:ControlType.Color,defaultValue:\"#000\",optional:true,title:\"Hover Font Color\"},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},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\":{\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FileDownloadButton.map"],"mappings":"kOAGG,SAAwB,EAAmB,EAAM,CAAC,GAAK,CAAC,OAAK,uEAAuE,WAAS,OAAK,OAAK,YAAU,YAAU,iBAAe,OAAK,iBAAe,iBAAe,kBAAgB,qBAAmB,oBAAkB,UAAQ,gBAAc,gBAAc,iBAAe,oBAAkB,mBAAiB,SAAO,gBAAc,UAAQ,SAAO,EAAW,CAAC,EAAQ,GAAYA,EAAS,KAAK,CAAO,EAAe,SAAS,CAAC,GAAG,CAAC,EAAK,OAAwC,IAAM,EAAK,MAA7B,MAAM,MAAM,EAAK,EAA2B,MAAM,CAAyC,EAA1B,IAAI,gBAAgB,EAAK,CAAoB,EAAG,MAAc,CAAC,GAAgB,EAAG,CAAC,EAAK,CAAC,CAAC,IAAI,EAAoB,EAAK,IAAI,CAAC,KAAK,EAAQ,SAAS,EAAS,MAAM,CAAC,gBAAgB,EAAK,QAAQ,OAAO,WAAW,SAAS,eAAe,SAAS,MAAM,cAAc,eAAe,OAAO,WAAW,OAAO,MAAM,EAAU,OAAO,EAAc,UAAU,OAAO,QAAQ,EAAe,GAAG,EAAe,KAAK,EAAgB,KAAK,EAAmB,KAAK,EAAkB,IAAI,GAAG,EAAQ,IAAI,aAAa,EAAc,GAAG,EAAc,KAAK,EAAe,KAAK,EAAkB,KAAK,EAAiB,IAAI,GAAG,EAAO,IAC5pC,WAAW,8CAA8C,GAAG,EAAK,GAAG,EAAM,CAAC,aAAa,GAAG,CAAI,IAAU,EAAE,cAAc,MAAM,gBAAgB,GAAa,IAAe,EAAE,cAAc,MAAM,MAAM,IAAiB,aAAa,GAAG,CAAC,EAAE,cAAc,MAAM,gBAAgB,EAAK,EAAE,cAAc,MAAM,MAAM,GAAY,SAAS,E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