{"version":3,"file":"OrderCountdown.CPMqDLsd.mjs","names":["useState","__esmMin","window","init_npm_react_18_3_1","init_ssg_sandbox_shims","ce","init_jsx_runtime","c","p","_e","init_framer_BisrWwwE","addPropertyControls","ControlType","left","end","deadline","ms","OrderCountdown","props","t","setT","tick","i","sans","v","ink","closedText","box","tile","n","muted","l","label","init_OrderCountdown"],"sources":["https:/framerusercontent.com/modules/NyabYjcgn1SKxbJOEdXL/Wz80HUih5rqHibLuOs9s/OrderCountdown.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";function left(deadline){const end=new Date(deadline).getTime();if(!deadline||isNaN(end))return null;const ms=Math.max(0,end-Date.now());return{done:ms<=0,d:Math.floor(ms/864e5),h:Math.floor(ms/36e5)%24,m:Math.floor(ms/6e4)%60};}/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function OrderCountdown(props){const{deadline=\"2026-12-13T18:00:00.000Z\",label=\"Christmas orders close in\",closedText=\"Christmas orders are closed. Call the shop and we will do our best.\",ink=\"#F5F0E8\",muted=\"#D2B26A\",tile=\"rgba(245,240,232,0.08)\"}=props;const[t,setT]=useState(null);useEffect(()=>{const tick=()=>setT(left(deadline));tick();const i=window.setInterval(tick,2e4);return()=>window.clearInterval(i);},[deadline]);const sans='\"Inter\", system-ui, sans-serif',serif='\"Cormorant Garamond\", Georgia, serif';const v=t||left(deadline)||{done:false,d:0,h:0,m:0};if(v.done)return /*#__PURE__*/_jsx(\"div\",{role:\"status\",style:{...props.style,font:`500 16px/1.5 ${sans}`,color:ink,maxWidth:420},children:closedText});const box=(n,l)=>/*#__PURE__*/_jsxs(\"div\",{style:{background:tile,borderRadius:4,padding:\"16px 8px 14px\",width:86,flexShrink:1,minWidth:0,textAlign:\"center\"},children:[/*#__PURE__*/_jsx(\"div\",{suppressHydrationWarning:true,style:{font:`500 48px/1 ${serif}`,color:ink,fontVariantNumeric:\"lining-nums tabular-nums\"},children:String(n).padStart(2,\"0\")}),/*#__PURE__*/_jsx(\"div\",{style:{font:`600 10px/1.3 ${sans}`,letterSpacing:\"0.12em\",textTransform:\"uppercase\",color:muted,marginTop:8},children:l})]});return /*#__PURE__*/_jsxs(\"div\",{role:\"timer\",\"aria-label\":`${label} ${v.d} days ${v.h} hours ${v.m} minutes`,style:{...props.style,display:\"flex\",flexDirection:\"column\",gap:14},children:[/*#__PURE__*/_jsx(\"div\",{style:{font:`600 11px/1.3 ${sans}`,letterSpacing:\"0.18em\",textTransform:\"uppercase\",color:muted},children:label}),/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",gap:10},children:[box(v.d,\"Days\"),box(v.h,\"Hours\"),box(v.m,\"Minutes\")]})]});}addPropertyControls(OrderCountdown,{deadline:{type:ControlType.Date,title:\"Deadline\",defaultValue:\"2026-12-13T18:00:00.000Z\"},label:{type:ControlType.String,title:\"Label\",defaultValue:\"Christmas orders close in\"},closedText:{type:ControlType.String,title:\"When closed\",displayTextArea:true,defaultValue:\"Christmas orders are closed. Call the shop and we will do our best.\"},ink:{type:ControlType.Color,title:\"Numbers\",defaultValue:\"#F5F0E8\"},muted:{type:ControlType.Color,title:\"Labels\",defaultValue:\"#D2B26A\"},tile:{type:ControlType.Color,title:\"Tiles\",defaultValue:\"rgba(245,240,232,0.08)\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"OrderCountdown\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"auto\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./OrderCountdown.map"],"mappings":"A,sMAAmJ,SAASa,EAAK,EAAS,CAAC,IAAMC,EAAI,IAAI,KAAKC,CAAQ,CAAC,CAAC,QAAQ,EAAE,GAAG,CAACA,GAAU,MAAMD,CAAG,EAAE,OA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