{"version":3,"file":"Countdown.DAibD8bw.mjs","names":["React.useState","__esmMin","_e","p","c","init_jsx_runtime","init_npm_react_18_3_1","ce","useReducedMotion","motion","AnimatePresence","init_framer_motion_DhsWWWsN","init_framer_CN96F41L","ControlType","addPropertyControls","init_WeddingDetails","WEDDING","Countdown","labels","labelDays","labelHours","labelMinutes","labelSeconds","reduced","t","date","setV","f","left","id","serif","style","doneText","k","init_Countdown","d"],"sources":["https:/framerusercontent.com/modules/uGnbudselYI7L4lxGAzQ/05inUT6MJ2qFspORoQHb/Countdown.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{WEDDING}from\"https://framerusercontent.com/modules/ELhR981Rpylsw6sebC4B/t9gqNB2LLwQZ12Cb5XmC/WeddingDetails.js\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{AnimatePresence,motion,useReducedMotion}from\"framer-motion\";const left=t=>{const d=Math.max(0,t-Date.now());return{Days:Math.floor(d/864e5),Hours:Math.floor(d/36e5)%24,Minutes:Math.floor(d/6e4)%60,Seconds:Math.floor(d/1e3)%60,done:d<=0};};/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight auto\n */export default function Countdown({date,doneText,labelDays=\"Days\",labelHours=\"Hours\",labelMinutes=\"Minutes\",labelSeconds=\"Seconds\",style}){const labels={Days:labelDays,Hours:labelHours,Minutes:labelMinutes,Seconds:labelSeconds};const reduced=!!useReducedMotion();const t=new Date(date).getTime();const[v,setV]=React.useState(null);React.useEffect(()=>{const f=()=>setV(left(t));f();const id=setInterval(f,1e3);return()=>clearInterval(id);},[t]);const serif='\"Instrument Serif\", \"Times New Roman\", serif';if(v?.done)return /*#__PURE__*/_jsx(\"p\",{style:{...style,fontFamily:serif,fontSize:64,color:\"#FBF7EE\",margin:0},children:doneText});return /*#__PURE__*/_jsx(\"div\",{role:\"timer\",\"aria-label\":\"Time until the wedding\",style:{...style,display:\"grid\",gridTemplateColumns:\"repeat(auto-fit, minmax(130px, 1fr))\",gap:24},children:[\"Days\",\"Hours\",\"Minutes\",\"Seconds\"].map(k=>/*#__PURE__*/_jsxs(\"div\",{style:{borderTop:\"1px solid rgba(251,247,238,.2)\",paddingTop:16},children:[/*#__PURE__*/_jsx(\"div\",{\"aria-hidden\":k===\"Seconds\",style:{position:\"relative\",overflow:\"hidden\",height:\"1.05em\",fontFamily:serif,fontSize:\"clamp(64px, 10vw, 150px)\",lineHeight:1,letterSpacing:\"-0.03em\",color:\"#FBF7EE\"},children:/*#__PURE__*/_jsx(AnimatePresence,{initial:false,mode:\"popLayout\",children:/*#__PURE__*/_jsx(motion.span,{initial:reduced?false:{y:\"100%\",opacity:0},animate:{y:0,opacity:1},exit:reduced?undefined:{y:\"-100%\",opacity:0},transition:{duration:.55,ease:[.16,1,.3,1]},style:{display:\"inline-block\"},children:v?String(v[k]).padStart(2,\"0\"):\"00\"},v?v[k]:\"x\")})}),/*#__PURE__*/_jsx(\"div\",{style:{fontFamily:'\"Geist Mono\", ui-monospace, monospace',fontSize:12,letterSpacing:\"0.1em\",textTransform:\"uppercase\",color:\"#F2CC7E\",marginTop:12},children:labels[k]})]},k))});}Countdown.defaultProps={date:WEDDING.dateTime,doneText:\"We did it. Thank you for being there.\"};addPropertyControls(Countdown,{date:{type:ControlType.String,title:\"Date and time\",defaultValue:WEDDING.dateTime},doneText:{type:ControlType.String,title:\"After the day\",defaultValue:Countdown.defaultProps.doneText},labelDays:{type:ControlType.String,title:\"Days label\",defaultValue:\"Days\"},labelHours:{type:ControlType.String,title:\"Hours label\",defaultValue:\"Hours\"},labelMinutes:{type:ControlType.String,title:\"Minutes label\",defaultValue:\"Minutes\"},labelSeconds:{type:ControlType.String,title:\"Seconds label\",defaultValue:\"Seconds\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Countdown\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"fixed\",\"framerSupportedLayoutHeight\":\"auto\",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