{"version":3,"file":"CopyEmail.DsZLyRaA.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/EiBeiCpei4gTc7ttx8rF/fEEySOuVrM2YFxFwOjKz/CopyEmail.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{motion,AnimatePresence}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";import{useState,useEffect}from\"react\";/**\n * @framerDisableUnlink\n * @framerIntrinsicWidth 400\n * @framerIntrinsicHeight 50\n * @framerSupportedLayoutWidth any\n */export default function CopyEmail(props){const{email=\"intro@aprello.se\",copyMessage=\"kopierat\",textColor=\"rgba(255, 255, 255, 0.8)\",messageColor=\"rgba(255, 255, 255, 0.8)\",messageBackground=\"#373737\",transparent=false,font}=props;const[showMessage,setShowMessage]=useState(false);const[mousePosition,setMousePosition]=useState({x:0,y:0});useEffect(()=>{const handleMouseMove=e=>{setMousePosition({x:e.clientX,y:e.clientY});};window.addEventListener(\"mousemove\",handleMouseMove);return()=>window.removeEventListener(\"mousemove\",handleMouseMove);},[]);const handleCopy=async()=>{try{await navigator.clipboard.writeText(email);setShowMessage(true);setTimeout(()=>setShowMessage(false),1150);}catch(err){console.error(\"Failed to copy:\",err);}};const styles={wrapper:{display:\"flex\",gap:\"8px\",alignItems:\"flex-start\"},copyButton:{cursor:\"pointer\",padding:7,borderRadius:\"4.667px\",backgroundColor:transparent?\"transparent\":\"#373737\",border:transparent?\"0.5px solid #000\":\"unset\",height:\"28px\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},mailToWrapper:{color:transparent?\"#141414\":textColor,textDecoration:\"none\",lineHeight:\"140%\",letterSpacing:\"0.16px\",borderRadius:8,display:\"flex\",padding:\"12px 24px\",justifyContent:\"center\",alignItems:\"center\",backgroundColor:transparent?\"transparent\":\"#373737\",border:transparent?\"0.5px solid #000\":\"unset\",gap:\"10px\",fontSize:(font===null||font===void 0?void 0:font.fontSize)||\"16px\",fontFamily:(font===null||font===void 0?void 0:font.family)||'\"ABC Monument Grotesk Edu Regular\", \"ABC Monument Grotesk Edu Regular Placeholder\", sans-serif',...font}};return /*#__PURE__*/_jsxs(\"div\",{style:styles.wrapper,children:[/*#__PURE__*/_jsx(\"a\",{href:`mailto:${email}`,style:styles.mailToWrapper,children:email}),/*#__PURE__*/_jsx(\"button\",{onClick:handleCopy,style:styles.copyButton,children:/*#__PURE__*/_jsxs(\"svg\",{xmlns:\"http://www.w3.org/2000/svg\",width:\"14\",height:\"14\",viewBox:\"0 0 14 14\",fill:\"none\",children:[/*#__PURE__*/_jsx(\"g\",{\"clip-path\":\"url(#clip0_827_6040)\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M9.33332 0.583496H1.16666V9.91683H2.33332V1.75016H9.33332V0.583496ZM12.25 2.91683H3.49999V13.4168H12.25V2.91683ZM11.0833 12.2502H4.66666V4.0835H11.0833V12.2502Z\",fill:transparent?\"black\":\"white\",\"fill-opacity\":\"0.8\"})}),/*#__PURE__*/_jsx(\"defs\",{children:/*#__PURE__*/_jsx(\"clipPath\",{id:\"clip0_827_6040\",children:/*#__PURE__*/_jsx(\"rect\",{width:\"14\",height:\"14\",fill:\"white\"})})})]})}),/*#__PURE__*/_jsx(AnimatePresence,{children:showMessage&&/*#__PURE__*/_jsx(motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{duration:.3,ease:[.4,0,.2,1]},style:{position:\"fixed\",left:mousePosition.x+10,top:mousePosition.y-30,background:messageBackground,color:messageColor,padding:\"6px 10px\",borderRadius:\"4px\",pointerEvents:\"none\",zIndex:1e3,fontSize:\"14px\"},children:copyMessage})})]});}CopyEmail.defaultProps={email:\"intro@aprello.se\",copyMessage:\"kopierat\",textColor:\"rgba(255, 255, 255, 0.80)\",messageColor:\"rgba(255, 255, 255, 0.80)\",messageBackground:\"#373737\",transparent:false,font:{family:'\"ABC Monument Grotesk Edu Regular\", \"ABC Monument Grotesk Edu Regular Placeholder\", sans-serif',fontSize:16,lineHeight:\"140%\"}};addPropertyControls(CopyEmail,{email:{type:ControlType.String,title:\"Email\"},copyMessage:{type:ControlType.String,title:\"Copy Message\"},textColor:{type:ControlType.Color,title:\"Text Color\"},messageColor:{type:ControlType.Color,title:\"Message Text Color\"},messageBackground:{type:ControlType.Color,title:\"Message Background\"},transparent:{type:ControlType.Boolean,title:\"Transparent Mode\",defaultValue:false},font:{type:ControlType.Font,controls:\"extended\",title:\"Font\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CopyEmail\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\",\"framerIntrinsicHeight\":\"50\",\"framerDisableUnlink\":\"* @framerIntrinsicWidth 400\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CopyEmail.map"],"mappings":"gQAKG,SAAwB,EAAU,EAAM,CAAC,GAAK,CAAC,QAAM,mBAAmB,cAAY,WAAW,YAAU,2BAA2B,eAAa,2BAA2B,oBAAkB,UAAU,cAAY,GAAM,QAAM,EAAW,CAAC,EAAY,GAAgBA,EAAS,GAAM,CAAM,CAAC,EAAc,GAAkBA,EAAS,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,MAAc,CAAC,IAAM,EAAgB,GAAG,CAAC,EAAiB,CAAC,EAAE,EAAE,QAAQ,EAAE,EAAE,QAAQ,CAAC,EAAwD,OAArD,EAAO,iBAAiB,YAAY,EAAgB,KAAW,EAAO,oBAAoB,YAAY,EAAgB,EAAG,EAAE,CAAC,CAAC,IAAM,EAAW,SAAS,CAAC,GAAG,CAAC,MAAM,EAAU,UAAU,UAAU,EAAM,CAAC,EAAe,GAAK,CAAC,eAAe,EAAe,GAAM,CAAC,KAAK,OAAQ,EAAI,CAAC,QAAQ,MAAM,kBAAkB,EAAI,GAAU,EAAO,CAAC,QAAQ,CAAC,QAAQ,OAAO,IAAI,MAAM,WAAW,aAAa,C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