{"version":3,"file":"FileUploader.BZ42MNs1.mjs","names":[],"sources":["https:/framerusercontent.com/modules/sjulcv0tXnD8aNMOMH2P/3KjQWQNNfIetLaFYvTIq/FileUploader.js"],"sourcesContent":["// Download file component with upload and filename control\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";/**\n * FileUploader\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight fixed\n */function FileUploader(props){const{fileUrl=\"https://framerusercontent.com/assets/MLWPbW1dUQawJLhhun3dBwpgJak.mp4\",fileName=\"downloaded-file\",buttonLabel,style,font,buttonColor,buttonTextColor,borderRadius}=props;// Remove upload state and input\nconst downloadUrl=fileUrl;// Extract file extension from URL\nconst getFileExtension=url=>{const pathname=url.split(\"?\")[0]// Remove query params\n;const parts=pathname.split(\".\");return parts.length>1?parts[parts.length-1]:\"\";};const fileExtension=getFileExtension(fileUrl);const downloadName=fileExtension&&!fileName.includes(\".\")?`${fileName}.${fileExtension}`:fileName||\"downloaded-file\";return /*#__PURE__*/_jsx(\"div\",{style:{...style,width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",position:\"relative\"},children:/*#__PURE__*/_jsx(\"a\",{href:downloadUrl,download:downloadName,style:{width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",background:buttonColor,color:buttonTextColor,border:\"none\",borderRadius,cursor:\"pointer\",textAlign:\"center\",textDecoration:\"none\",...font},tabIndex:0,\"aria-label\":`Download ${downloadName}`,onClick:e=>{e.preventDefault();if(typeof window!==\"undefined\"){fetch(downloadUrl).then(resp=>resp.blob()).then(blob=>{const url=window.URL.createObjectURL(blob);const link=document.createElement(\"a\");link.href=url;link.download=downloadName;document.body.appendChild(link);link.click();document.body.removeChild(link);window.URL.revokeObjectURL(url);});}},children:buttonLabel})});}addPropertyControls(FileUploader,{fileUrl:{type:ControlType.File,allowedFileTypes:[\"jpg\",\"jpeg\",\"png\",\"gif\",\"webp\",\"svg\",\"pdf\",\"doc\",\"docx\",\"txt\",\"mp4\",\"webm\",\"mov\",\"mp3\",\"wav\",\"ogg\"]},fileName:{type:ControlType.String,title:\"File Name\",defaultValue:\"downloaded-file\",placeholder:\"Set file name...\"},buttonLabel:{type:ControlType.String,title:\"Button Label\",defaultValue:\"Upload File\"},buttonColor:{type:ControlType.Color,title:\"Button Color\",defaultValue:\"#111111\"},buttonTextColor:{type:ControlType.Color,title:\"Button Text\",defaultValue:\"#fff\"},borderRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:8,min:0,max:32},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{variant:\"Medium\",fontSize:\"15px\",letterSpacing:\"-0.01em\",lineHeight:\"1.3em\"}}});export default FileUploader;\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FileUploader\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FileUploader.map"],"mappings":"0KAMG,SAAS,EAAa,EAAM,CAAC,GAAK,CAAC,UAAQ,uEAAuE,WAAS,kBAAkB,cAAY,QAAM,OAAK,cAAY,kBAAgB,gBAAc,EAC3M,EAAY,EAEsE,GADjE,GAAK,CAC3B,IAAM,EADqC,EAAI,MAAM,IAAI,CAAC,GACrC,MAAM,IAAI,CAAC,OAAO,EAAM,OAAO,EAAE,EAAM,EAAM,OAAO,GAAG,KAA0C,EAAQ,CAAO,EAAa,GAAe,CAAC,EAAS,SAAS,IAAI,CAAC,GAAG,EAAS,GAAG,IAAgB,GAAU,kBAAkB,OAAoB,EAAK,MAAM,CAAC,MAAM,CAAC,GAAG,EAAM,MAAM,OAAO,OAAO,OAAO,QAAQ,OAAO,WAAW,SAAS,eAAe,SAAS,SAA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