{"version":3,"file":"CountdownRedirect.CeBSfLPn.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/67Agad0fsgt6A5RfKEwb/s5nZUnxGetSv9phFD7pm/CountdownRedirect.js"],"sourcesContent":["// Countdown timer that automatically counts from 5 to 0 and redirects to a specified URL\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState,startTransition}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";/**\n * Countdown Redirect\n *\n * @framerIntrinsicWidth 300\n * @framerIntrinsicHeight 200\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function CountdownRedirect(props){const{startNumber,redirectUrl,backgroundColor,textColor,numberFont,labelFont,label,showLabel,style}=props;const[count,setCount]=useState(startNumber);const isCanvas=RenderTarget.current()===RenderTarget.canvas;useEffect(()=>{if(typeof window===\"undefined\")return;if(count>0){const timer=setTimeout(()=>{startTransition(()=>setCount(count-1));},1e3);return()=>clearTimeout(timer);}else if(!isCanvas){const redirectTimer=setTimeout(()=>{if(redirectUrl){window.location.href=redirectUrl;}},500);return()=>clearTimeout(redirectTimer);}},[count,redirectUrl,isCanvas]);return /*#__PURE__*/_jsxs(\"div\",{style:{...style,position:\"relative\",width:\"100%\",height:\"100%\",backgroundColor,display:\"flex\",flexDirection:\"column\",alignItems:\"center\",justifyContent:\"center\",gap:16,overflow:\"hidden\"},children:[/*#__PURE__*/_jsx(\"div\",{style:{...numberFont,color:textColor,userSelect:\"none\"},children:count}),showLabel&&/*#__PURE__*/_jsx(\"div\",{style:{...labelFont,color:textColor,userSelect:\"none\"},children:label})]});}addPropertyControls(CountdownRedirect,{startNumber:{type:ControlType.Number,title:\"Start Number\",defaultValue:5,min:1,max:60,step:1,displayStepper:true},redirectUrl:{type:ControlType.String,title:\"Redirect URL\",defaultValue:\"https://www.framer.com\",placeholder:\"https://example.com\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},numberFont:{type:ControlType.Font,title:\"Number Font\",defaultValue:{fontSize:\"80px\",variant:\"Bold\",letterSpacing:\"-0.04em\",lineHeight:\"1em\"},controls:\"extended\",defaultFontType:\"sans-serif\"},showLabel:{type:ControlType.Boolean,title:\"Show Label\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},label:{type:ControlType.String,title:\"Label Text\",defaultValue:\"Redirecionando...\",hidden:({showLabel})=>!showLabel},labelFont:{type:ControlType.Font,title:\"Label Font\",defaultValue:{fontSize:\"22px\",variant:\"Semibold\",letterSpacing:\"-0.01em\",lineHeight:\"1.2em\"},controls:\"extended\",defaultFontType:\"sans-serif\",hidden:({showLabel})=>!showLabel}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CountdownRedirect\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"300\",\"framerIntrinsicHeight\":\"200\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CountdownRedirect.map"],"mappings":"oNASG,SAAwB,EAAkB,EAAM,CAAC,GAAK,CAAC,cAAY,cAAY,kBAAgB,YAAU,aAAW,YAAU,QAAM,YAAU,SAAO,EAAW,CAAC,EAAM,GAAUA,EAAS,EAAY,CAAO,EAAS,EAAa,SAAS,GAAG,EAAa,OAAwW,OAAjW,MAAc,CAAI,GAAO,IAAS,OAAmB,IAAG,EAAM,EAAE,CAAC,IAAM,EAAM,eAAe,CAAC,MAAoB,EAAS,EAAM,EAAE,CAAC,EAAG,IAAI,CAAC,UAAU,aAAa,EAAM,SAAU,CAAC,EAAS,CAAC,IAAM,EAAc,eAAe,CAAI,IAAa,EAAO,SAAS,KAAK,IAAe,IAAI,CAAC,UAAU,a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