{"version":3,"file":"CopyEmailButton.BF9H-AAL.mjs","names":["useState","__esmMin","init_npm_react_18_3_1","init_ssg_sandbox_shims","navigator","window","_e","p","c","init_jsx_runtime","ce","init_framer_DDfsYcI0","addPropertyControls","ControlType","copyEmail","email","previousFocus","field","CopyEmailButton","feedback","setFeedback","timeout","handleClick","style","neutral","showAddress","ink","hidden","init_CopyEmailButton"],"sources":["https:/framerusercontent.com/modules/STu6TE4fPo2SvHTSsGBW/VGwdMgVYH7F1eoFfrCLO/CopyEmailButton.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";const ink=\"var(--token-769b2b36-b762-451a-9ad9-f333c17dfad0, #1c1c1c)\";const neutral=\"var(--token-80a5c892-ed04-4b2e-a4af-83b00717f2e1, #545454)\";const hidden={position:\"absolute\",width:1,height:1,overflow:\"hidden\",clipPath:\"inset(50%)\",whiteSpace:\"nowrap\"};async function copyEmail(email){try{if(navigator.clipboard?.writeText){await navigator.clipboard.writeText(email);return;}}catch{// A preview frame can restrict the Clipboard API.\n}const previousFocus=document.activeElement;const field=document.createElement(\"textarea\");field.value=email;field.readOnly=true;Object.assign(field.style,{position:\"fixed\",top:\"0\",left:\"0\",opacity:\"0\",pointerEvents:\"none\",fontSize:\"16px\"});document.body.appendChild(field);try{field.focus({preventScroll:true});field.select();if(!document.execCommand(\"copy\"))throw new Error(\"Copy unavailable\");}finally{field.remove();if(previousFocus instanceof HTMLElement)previousFocus.focus({preventScroll:true});}}/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n * @framerIntrinsicWidth 328\n * @framerIntrinsicHeight 44\n */export default function CopyEmailButton({email=\"\",showAddress=true,style}){const[feedback,setFeedback]=useState(null);useEffect(()=>{if(!feedback)return;const timeout=window.setTimeout(()=>setFeedback(null),2e3);return()=>window.clearTimeout(timeout);},[feedback]);async function handleClick(){try{await copyEmail(email);setFeedback({copied:true});}catch{setFeedback({copied:false});}}return /*#__PURE__*/_jsxs(\"div\",{style:{display:\"inline-flex\",alignItems:\"center\",justifyContent:\"center\",flexWrap:\"wrap\",gap:\"0 6px\",position:\"relative\",fontFamily:'Onest, \"Onest Placeholder\", sans-serif',fontSize:\"1.05rem\",fontWeight:600,letterSpacing:\"-0.02em\",lineHeight:1.4,fontFeatureSettings:'\"blwf\", \"cv03\", \"cv04\", \"cv09\", \"cv11\"',whiteSpace:\"nowrap\",...style},children:[/*#__PURE__*/_jsx(\"span\",{style:{color:neutral},children:\"Let's chat!\"}),showAddress&&/*#__PURE__*/_jsxs(\"button\",{type:\"button\",onClick:handleClick,\"aria-label\":\"Copy email address \"+email,title:\"Copy email address\",style:{display:\"inline-grid\",alignItems:\"center\",minHeight:44,border:0,padding:0,background:\"transparent\",color:ink,cursor:\"pointer\",font:\"inherit\",fontFeatureSettings:\"inherit\",letterSpacing:\"inherit\",textAlign:\"left\",whiteSpace:\"inherit\"},children:[/*#__PURE__*/_jsx(\"span\",{style:{gridArea:\"1 / 1\",visibility:feedback?\"hidden\":undefined},children:email}),feedback&&/*#__PURE__*/_jsx(\"span\",{style:{gridArea:\"1 / 1\"},children:feedback.copied?\"Email copied!\":\"Try again\"})]}),/*#__PURE__*/_jsx(\"span\",{role:\"status\",style:hidden,children:feedback?feedback.copied?\"Email address copied.\":\"Could not copy the email address.\":\"\"})]});}addPropertyControls(CopyEmailButton,{email:{type:ControlType.String,title:\"Email\",defaultValue:\"\"},showAddress:{type:ControlType.Boolean,title:\"Show address\",defaultValue:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CopyEmailButton\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"328\",\"framerSupportedLayoutWidth\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerIntrinsicHeight\":\"44\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMapp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