{"version":3,"file":"Button_3.XFNXeSrt.mjs","names":[],"sources":["https:/framerusercontent.com/modules/jD50qqPkA9Q4LmQWkxmF/MmHq2jbGCLmT8LrXI7JK/Button_3.js"],"sourcesContent":["\"use client\";import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";export default function Page(){const[address,setAddress]=useState(\"Add address\");const[pickupTime,setPickupTime]=useState(\"Tonight\");const styles={body:{display:\"flex\",alignItems:\"center\",justifyContent:\"center\",width:\"100%\"},container:{display:\"flex\",alignItems:\"center\",justifyContent:\"space-between\",backgroundColor:\"white\",padding:\"4px 4px\",borderRadius:\"9999px\",boxShadow:\"0px 0px 5px rgba(0, 0, 0, 0.1)\",overflow:\"hidden\",width:\"100%\",margin:\"auto\"},contentGroup:{display:\"flex\",alignItems:\"center\",gap:\"24px\",flex:\"1\",minWidth:\"0\",overflow:\"hidden\"},pickupSection:{marginLeft:\"16px\"},whereSection:{flex:\"1\",minWidth:\"0\"},sectionTitle:{fontSize:\"18px\",fontWeight:\"bold\",color:\"#1a202c\"},pickupText:{color:\"#4a5568\",fontWeight:\"light\"},addressText:{color:\"#4a5568\",fontWeight:\"light\",whiteSpace:\"nowrap\",overflow:\"hidden\",textOverflow:\"ellipsis\"},divider:{height:\"48px\",width:\"1px\",backgroundColor:\"#e2e8f0\",flexShrink:\"0\"},button:{background:\"linear-gradient(to right, #333333, #000000)\",borderRadius:\"9999px\",padding:\"16px\",cursor:\"pointer\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",flexShrink:\"0\"},arrow:{height:\"24px\",width:\"24px\",color:\"white\"}};useEffect(()=>{try{// Try to get address from cookie\nconst getCookie=name=>{const cookies=document.cookie.split(\";\");for(let i=0;i<cookies.length;i++){const cookie=cookies[i].trim();if(cookie.startsWith(name+\"=\")){return decodeURIComponent(cookie.substring(name.length+1));}}return undefined;};const addressCookie=getCookie(\"user_address\");if(addressCookie){setAddress(addressCookie);}else if(window.location.hostname===\"app.joinchoreless.com\"){// If on subdomain and no cookie, check localStorage as fallback\nconst savedAddress=localStorage.getItem(\"address\");if(savedAddress){// If found in localStorage, set it as a cookie for cross-domain access\ndocument.cookie=\"user_address=\"+encodeURIComponent(savedAddress)+\"; domain=.joinchoreless.com; path=/; max-age=86400\";setAddress(savedAddress.split(\",\")[0]);}}// Set pickup time based on current hour\nconst currentHour=new Date().getHours();if(currentHour>=21){// 9 PM or later\nsetPickupTime(\"Tomorrow\");}else{setPickupTime(\"Tonight\");}}catch(error){console.error(\"Error in useEffect:\",error);}},[]);return /*#__PURE__*/_jsx(\"div\",{style:styles.body,children:/*#__PURE__*/_jsxs(\"div\",{style:styles.container,onClick:()=>window.location.href=\"https://app.joinchoreless.com/book\",children:[/*#__PURE__*/_jsxs(\"div\",{style:styles.contentGroup,children:[/*#__PURE__*/_jsxs(\"div\",{style:styles.pickupSection,children:[/*#__PURE__*/_jsx(\"div\",{style:styles.sectionTitle,children:\"Pickup\"}),/*#__PURE__*/_jsx(\"div\",{style:styles.pickupText,children:pickupTime})]}),/*#__PURE__*/_jsx(\"div\",{style:styles.divider}),/*#__PURE__*/_jsxs(\"div\",{style:styles.whereSection,children:[/*#__PURE__*/_jsx(\"div\",{style:styles.sectionTitle,children:\"Where\"}),/*#__PURE__*/_jsx(\"div\",{style:styles.addressText,children:address})]})]}),/*#__PURE__*/_jsx(\"div\",{style:styles.button,children:/*#__PURE__*/_jsx(\"svg\",{xmlns:\"http://www.w3.org/2000/svg\",style:styles.arrow,fill:\"none\",viewBox:\"0 0 24 24\",stroke:\"currentColor\",children:/*#__PURE__*/_jsx(\"path\",{strokeLinecap:\"round\",strokeLinejoin:\"round\",strokeWidth:2,d:\"M14 5l7 7m0 0l-7 7m7-7H3\"})})})]})});}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Page\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sour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