{"version":3,"file":"CountdownTimer.C4NmJBED.mjs","names":["useState","_Fragment"],"sources":["https:/framerusercontent.com/modules/3LHarmJzPbGQiGAtAaj1/xz6Wrkrd0l9yQQk5rbWj/CountdownTimer.js"],"sourcesContent":["// Make countdown icons bigger by increasing the number font size and icon size\nimport{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useEffect,useState,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Countdown Timer with Large Icons\n *\n * @framerIntrinsicWidth 900\n * @framerIntrinsicHeight 320\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function CountdownTimer(props){const{targetDate,language=\"lt\",showDays,showHours,showMinutes,showSeconds,textColor,numberFont,labelFont,style,columnBackground,columnRadius,columnSpacing,columnShadow,columnWidth,columnHeight,showDivider,dividerWidth,dividerHeight,dividerColor,border}=props;const[timeLeft,setTimeLeft]=useState(getTimeLeft(targetDate));useEffect(()=>{const interval=setInterval(()=>{startTransition(()=>setTimeLeft(getTimeLeft(targetDate)));},1e3);return()=>clearInterval(interval);},[targetDate]);function getTimeLeft(dateString){const now=new Date;const target=new Date(dateString);let diff=Math.max(0,target.getTime()-now.getTime());const days=Math.floor(diff/(1e3*60*60*24));diff-=days*1e3*60*60*24;const hours=Math.floor(diff/(1e3*60*60));diff-=hours*1e3*60*60;const minutes=Math.floor(diff/(1e3*60));diff-=minutes*1e3*60;const seconds=Math.floor(diff/1e3);return{days,hours,minutes,seconds};}const columnsArr=[];const labels=language===\"lt/en\"?{days:\"dienos/days\",hours:\"valandos/hours\",minutes:\"minutės/minutes\",seconds:\"sekundės/seconds\"}:language===\"en\"?{days:\"days\",hours:\"hours\",minutes:\"minutes\",seconds:\"seconds\"}:{days:\"dienos\",hours:\"valandos\",minutes:\"minutės\",seconds:\"sekundės\"};if(showDays)columnsArr.push({label:labels.days,value:timeLeft.days});if(showHours)columnsArr.push({label:labels.hours,value:timeLeft.hours});if(showMinutes)columnsArr.push({label:labels.minutes,value:timeLeft.minutes});if(showSeconds)columnsArr.push({label:labels.seconds,value:timeLeft.seconds});return /*#__PURE__*/_jsx(\"div\",{style:{...style,display:\"flex\",flexDirection:\"row\",alignItems:\"center\",justifyContent:\"center\",color:textColor,gap:columnSpacing,textAlign:\"center\",flexWrap:\"wrap\",width:\"100%\",boxSizing:\"border-box\",maxWidth:600,maxHeight:160,padding:0},children:columnsArr.map((col,i)=>/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",display:\"flex\",flexDirection:\"column\",alignItems:\"center\",justifyContent:\"center\",width:columnWidth+\"px\",height:columnHeight+\"px\",minWidth:32,minHeight:32,background:columnBackground,borderRadius:columnRadius,boxShadow:columnShadow,overflow:\"hidden\",textAlign:\"center\",flex:`0 0 auto`,boxSizing:\"border-box\",border:border&&border.borderWidth>0?border:\"none\",...border&&border.borderWidth>0?{borderWidth:border.borderWidth||1,borderStyle:border.borderStyle||\"solid\",borderColor:border.borderColor||\"#000000\",borderTopWidth:border.borderTopWidth,borderLeftWidth:border.borderLeftWidth,borderRightWidth:border.borderRightWidth,borderBottomWidth:border.borderBottomWidth}:{},transition:\"all 0.3s ease-in-out\"},children:[/*#__PURE__*/_jsx(\"span\",{style:{fontSize:(numberFont?.fontSize||32)*1.5,fontWeight:numberFont?.variant===\"Bold\"?700:400,color:textColor,lineHeight:numberFont?.lineHeight||\"1em\",letterSpacing:numberFont?.letterSpacing||\"-0.01em\",...numberFont,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",gap:8},children:String(col.value).padStart(2,\"0\")}),/*#__PURE__*/_jsx(\"span\",{style:{...labelFont,textTransform:\"lowercase\",opacity:.7,marginTop:4,width:\"100%\",display:\"block\",textAlign:\"center\",color:textColor,fontSize:(labelFont?.fontSize||12)*1.1,fontWeight:labelFont?.variant===\"Medium\"?500:400,lineHeight:labelFont?.lineHeight||\"1.2em\",letterSpacing:labelFont?.letterSpacing||\"-0.01em\"},children:col.label})]},col.label),showDivider&&i<columnsArr.length-1&&/*#__PURE__*/_jsx(\"div\",{style:{width:dividerWidth+\"px\",height:dividerHeight+\"px\",backgroundColor:dividerColor,flex:\"0 0 auto\"}})]}))});}addPropertyControls(CountdownTimer,{targetDate:{type:ControlType.Date,title:\"Target Date\",displayTime:true,defaultValue:new Date(Date.now()+864e5).toISOString()},language:{type:ControlType.Enum,title:\"Language\",options:[\"lt\",\"en\",\"lt/en\"],optionTitles:[\"Lithuanian\",\"English\",\"Lithuanian/English\"],defaultValue:\"lt\",displaySegmentedControl:true},showDays:{type:ControlType.Boolean,title:\"Show Days\",defaultValue:true},showHours:{type:ControlType.Boolean,title:\"Show Hours\",defaultValue:true},showMinutes:{type:ControlType.Boolean,title:\"Show Minutes\",defaultValue:true},showSeconds:{type:ControlType.Boolean,title:\"Show Seconds\",defaultValue:true},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},numberFont:{type:ControlType.Font,title:\"Number Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:120,variant:\"Bold\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"}},labelFont:{type:ControlType.Font,title:\"Label Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:36,variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.2em\"}},columnBackground:{type:ControlType.Color,title:\"Background\",defaultValue:\"#F5F5F5\"},columnWidth:{type:ControlType.Number,title:\"Width\",defaultValue:120,min:32,max:512},columnHeight:{type:ControlType.Number,title:\"Height\",defaultValue:120,min:32,max:512},columnShadow:{type:ControlType.BoxShadow},columnRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:12,min:0,max:128},columnSpacing:{type:ControlType.Number,title:\"Spacing\",defaultValue:24,min:0,max:128},showDivider:{type:ControlType.Boolean,title:\"Show Divider\",defaultValue:false},dividerWidth:{type:ControlType.Number,title:\"Width\",defaultValue:2,min:1,max:20,hidden:({showDivider})=>!showDivider},dividerHeight:{type:ControlType.Number,title:\"Height\",defaultValue:56,min:10,max:200,hidden:({showDivider})=>!showDivider},dividerColor:{type:ControlType.Color,title:\"Color\",defaultValue:\"#CCCCCC\",hidden:({showDivider})=>!showDivider},border:{type:ControlType.Border,title:\"Border\",defaultValue:{borderWidth:0,borderStyle:\"solid\",borderColor:\"#000000\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CountdownTimer\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"320\",\"framerIntrinsicWidth\":\"900\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CountdownTimer.map"],"mappings":"iMASG,SAAwB,EAAe,EAAM,CAAC,GAAK,CAAC,aAAW,WAAS,KAAK,WAAS,YAAU,cAAY,cAAY,YAAU,aAAW,YAAU,QAAM,mBAAiB,eAAa,gBAAc,eAAa,cAAY,eAAa,cAAY,eAAa,gBAAc,eAAa,UAAQ,EAAW,CAAC,EAAS,GAAaA,EAAS,EAAY,EAAW,CAAC,CAAC,MAAc,CAAC,IAAM,EAAS,gBAAgB,CAAC,MAAoB,EAAY,EAAY,EAAW,CAAC,CAAC,EAAG,IAAI,CAAC,UAAU,cAAc,EAAS,EAAG,CAAC,EAAW,CAAC,CAAC,SAAS,EAAY,EAAW,CAAC,IAAM,EAAI,IAAI,KAAW,EAAO,IAAI,KAAK,EAAW,CAAK,EAAK,KAAK,IAAI,EAAE,EAAO,SAAS,CAAC,EAAI,SAAS,CAAC,CAAO,EAAK,KAAK,MAAM,GAAM,IAAI,GAAG,GAAG,IAAI,CAAC,GAAM,EAAK,IAAI,GAAG,GAAG,GAAG,IAAM,EAAM,KAAK,MAAM,GAAM,IAAI,GAAG,IAAI,CAAC,GAAM,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