{"version":3,"file":"DownloadButton_1.BXIOo7bd.mjs","names":["useRef","useState","useCallback"],"sources":["https:/framerusercontent.com/modules/n8WKcMCsafq414Sf4oXg/85E1rdStyEQzif50yvmN/DownloadButton_1.js"],"sourcesContent":["// Download button that triggers a file download and redirects after 1 second\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useCallback,useRef,useEffect,useState}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";/**\n * Download Button\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function DownloadButton(props){const{label,background,color,borderRadius,font,icon,iconColor,hoverBackground,style,downloadUrl=\"https://dub.sh/download-drime-mac\",redirectUrl=\"/next-mac\"}=props;const timeoutRef=useRef(null);const[isHover,setIsHover]=useState(false);const handleClick=useCallback(()=>{if(typeof window!==\"undefined\"){window.open(downloadUrl,\"_blank\");timeoutRef.current=window.setTimeout(()=>{window.location.assign(redirectUrl);},1e3);}},[downloadUrl,redirectUrl]);// Clean up timeout if unmounted\nuseEffect(()=>{return()=>{if(timeoutRef.current){clearTimeout(timeoutRef.current);}};},[]);if(RenderTarget.current()===RenderTarget.thumbnail)return null;return /*#__PURE__*/_jsxs(\"button\",{type:\"button\",style:{...style,background:isHover?hoverBackground:background,color,border:\"none\",borderRadius,padding:\"12px 28px\",fontWeight:600,cursor:\"pointer\",outline:\"none\",display:\"flex\",alignItems:\"center\",gap:10,...font,transition:\"background 0.15s, color 0.15s\"},onClick:handleClick,\"aria-label\":label,onMouseEnter:()=>setIsHover(true),onMouseLeave:()=>setIsHover(false),children:[props.customIconFile&&props.customIconFile.length>0?/*#__PURE__*/_jsx(\"span\",{style:{display:\"flex\",alignItems:\"center\",marginRight:6},children:/*#__PURE__*/_jsx(\"img\",{src:props.customIconFile,alt:\"icon\",style:{width:18,height:18,objectFit:\"contain\",display:\"block\"}})}):icon!==\"none\"&&/*#__PURE__*/_jsxs(\"span\",{style:{display:\"flex\",alignItems:\"center\",marginRight:6},children:[icon===\"download\"&&/*#__PURE__*/_jsxs(\"svg\",{width:\"18\",height:\"18\",viewBox:\"0 0 20 20\",fill:\"none\",\"aria-hidden\":\"true\",children:[/*#__PURE__*/_jsx(\"path\",{d:\"M10 3v10m0 0l-4-4m4 4l4-4\",stroke:iconColor,strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\"}),/*#__PURE__*/_jsx(\"rect\",{x:\"4\",y:\"15\",width:\"12\",height:\"2\",rx:\"1\",fill:iconColor})]}),icon===\"arrow\"&&/*#__PURE__*/_jsx(\"svg\",{width:\"18\",height:\"18\",viewBox:\"0 0 20 20\",fill:\"none\",\"aria-hidden\":\"true\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M5 10h10m0 0l-4-4m4 4l-4 4\",stroke:iconColor,strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\"})}),icon===\"windows\"&&/*#__PURE__*/_jsxs(\"svg\",{width:\"16\",height:\"16\",viewBox:\"0 0 16 16\",fill:\"none\",\"aria-hidden\":\"true\",children:[/*#__PURE__*/_jsx(\"rect\",{x:\"1.5\",y:\"2\",width:\"5.5\",height:\"5.5\",rx:\"1\",fill:iconColor}),/*#__PURE__*/_jsx(\"rect\",{x:\"9\",y:\"2\",width:\"5.5\",height:\"5.5\",rx:\"1\",fill:iconColor}),/*#__PURE__*/_jsx(\"rect\",{x:\"1.5\",y:\"9\",width:\"5.5\",height:\"5.5\",rx:\"1\",fill:iconColor}),/*#__PURE__*/_jsx(\"rect\",{x:\"9\",y:\"9\",width:\"5.5\",height:\"5.5\",rx:\"1\",fill:iconColor})]}),icon===\"mac\"&&/*#__PURE__*/_jsxs(\"svg\",{width:\"16\",height:\"16\",viewBox:\"0 0 16 16\",fill:\"none\",\"aria-hidden\":\"true\",children:[/*#__PURE__*/_jsx(\"ellipse\",{cx:\"8\",cy:\"10.5\",rx:\"5.5\",ry:\"4.5\",fill:iconColor}),/*#__PURE__*/_jsx(\"rect\",{x:\"6.5\",y:\"2\",width:\"3\",height:\"5\",rx:\"1.5\",fill:iconColor})]})]}),label]});}addPropertyControls(DownloadButton,{label:{type:ControlType.String,title:\"Label\",defaultValue:\"Download for Windows\"},background:{type:ControlType.Color,title:\"Background\",defaultValue:\"#222\"},color:{type:ControlType.Color,title:\"Text Color\",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:{fontSize:\"16px\",variant:\"Semibold\",letterSpacing:\"-0.01em\",lineHeight:\"1.2em\"}},icon:{type:ControlType.Enum,title:\"Icon\",options:[\"none\",\"download\",\"arrow\",\"windows\",\"mac\"],optionTitles:[\"None\",\"Download\",\"Arrow\",\"Windows\",\"Mac\"],defaultValue:\"download\"},iconColor:{type:ControlType.Color,title:\"Icon Color\",defaultValue:\"#fff\",hidden:({icon})=>icon===\"none\"},hoverBackground:{type:ControlType.Color,title:\"Hover Background\",defaultValue:\"#444\"},customIconFile:{type:ControlType.File,allowedFileTypes:[\"svg\",\"png\",\"jpg\",\"jpeg\",\"webp\"],title:\"Custom Icon\",description:\"Upload SVG or PNG/JPG icon\"},downloadUrl:{type:ControlType.String,title:\"Download URL\",defaultValue:\"https://dub.sh/download-drime-mac\"},redirectUrl:{type:ControlType.String,title:\"Redirect URL\",defaultValue:\"/next-mac\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"DownloadButton\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"auto\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./DownloadButton_1.map"],"mappings":"2NAMG,SAAwB,EAAe,EAAM,CAAC,GAAK,CAAC,QAAM,aAAW,QAAM,eAAa,OAAK,OAAK,YAAU,kBAAgB,QAAM,cAAY,oCAAo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