{"version":3,"file":"CopyButton.CzQvwbMs.mjs","names":["useRef","useState","_Fragment","__esmMin","init_ssg_sandbox_shims","navigator","window","l","_e","p","c","init_jsx_runtime","ce","init_npm_react_18_3_1","de","init_framer_DcGZRLrs","addPropertyControls","ControlType","announce","live","text","CopyButton","props","inner","label","accent","isLight","color","ref","swap","setSwap","lockW","setLockW","timer","copy","ok","value","hold","r","s","BRACKET_CSS","MONO","size","init_CopyButton","m"],"sources":["https:/framerusercontent.com/modules/vE17KylfPLlRbJHzlSzL/xf9sxbDpu1sl4jG9XgQk/CopyButton.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useEffect,useRef,useState}from\"react\";const MONO='\"Martian Mono\", MartianMono, ui-monospace, SFMono-Regular, Menlo, monospace';// Shared bracket-button motion (same as BracketButton / A11yKit).\nconst BRACKET_CSS=`\n.wbb{display:inline-flex;align-items:baseline;white-space:pre;cursor:pointer;-webkit-tap-highlight-color:transparent;}\n.wbb .wbb-l,.wbb .wbb-r,.wbb .wbb-ar{display:inline-block;transition:transform 220ms cubic-bezier(.2,.7,.2,1);}\n@media (hover:hover){\n.wbb:hover .wbb-l,.wbb.is-hover .wbb-l{transform:translateX(-4px);}\n.wbb:hover .wbb-r,.wbb.is-hover .wbb-r{transform:translateX(4px);}\n.wbb:hover .wbb-ar,.wbb.is-hover .wbb-ar{transform:translateY(3px);}\n}\n.wbb:focus-visible .wbb-l{transform:translateX(-4px);}\n.wbb:focus-visible .wbb-r{transform:translateX(4px);}\n.wbb:focus-visible .wbb-ar{transform:translateY(3px);}\n.wbb:active .wbb-l,.wbb.is-press .wbb-l{transform:translateX(2px);transition-duration:90ms;}\n.wbb:active .wbb-r,.wbb.is-press .wbb-r{transform:translateX(-2px);transition-duration:90ms;}\n@media (prefers-reduced-motion: reduce){\n.wbb .wbb-l,.wbb .wbb-r,.wbb .wbb-ar{transition:none !important;transform:none !important;}\n}\n`;function announce(text){let live=document.getElementById(\"wbb-live\");if(!live){live=document.createElement(\"div\");live.id=\"wbb-live\";live.setAttribute(\"aria-live\",\"polite\");live.style.cssText=\"position:absolute;left:0;top:0;font-size:1px;line-height:1px;white-space:nowrap;clip:rect(0 0 0 0);clip-path:inset(50%);pointer-events:none;border:0;\";document.body.appendChild(live);}live.textContent=\"\";setTimeout(()=>{if(live)live.textContent=text;},30);}// Light label (dark footer) gets Vermilion, dark label gets Vermilion Text.\nconst isLight=c=>{const m=/rgba?\\(\\s*(\\d+)[,\\s]+(\\d+)[,\\s]+(\\d+)/.exec(String(c||\"\"))||[];if(!m.length)return/#fff|white/i.test(String(c));return .299*+m[1]+.587*+m[2]+.114*+m[3]>150;};/**\n * Small mono [ COPY ] button. Click copies the value; the label becomes\n * \"COPIED ✓\" in Vermilion for 1.5s with the width locked. If the clipboard\n * is refused, the value is selected and the label reads \"PRESS ⌘C\".\n *\n * @framerIntrinsicWidth 90\n * @framerIntrinsicHeight 16\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function CopyButton(props){const{value=\"liia.arslanova.work@gmail.com\",label=\"[ COPY ]\",color=\"#FFFFFF\",size=12}=props;const inner=String(label).replace(/^\\s*\\[\\s*/,\"\").replace(/\\s*\\]\\s*$/,\"\");const accent=isLight(color)?\"#F2541B\":\"#C93D0C\";const ref=useRef(null);const[swap,setSwap]=useState(null);const[lockW,setLockW]=useState(null);const timer=useRef(null);useEffect(()=>()=>clearTimeout(timer.current),[]);async function copy(){if(ref.current)setLockW(ref.current.getBoundingClientRect().width);let ok=true;try{await navigator.clipboard.writeText(value);}catch(e){ok=false;try{let hold=document.getElementById(\"wbb-copy-hold\");if(!hold){hold=document.createElement(\"span\");hold.id=\"wbb-copy-hold\";hold.style.cssText=\"position:fixed;left:-9999px;top:0;white-space:pre;\";document.body.appendChild(hold);}hold.textContent=value;const r=document.createRange();r.selectNodeContents(hold);const s=window.getSelection();s?.removeAllRanges();s?.addRange(r);}catch(e2){}}setSwap(ok?\"COPIED ✓\":\"PRESS ⌘C\");announce(ok?\"Email copied\":\"Press Command C to copy the email\");clearTimeout(timer.current);timer.current=setTimeout(()=>{setSwap(null);setLockW(null);},1500);}return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"style\",{dangerouslySetInnerHTML:{__html:BRACKET_CSS}}),/*#__PURE__*/_jsxs(\"button\",{ref:ref,type:\"button\",className:\"wbb\",onClick:copy,\"aria-label\":swap?undefined:`Copy ${value}`,style:{background:\"none\",border:0,padding:0,margin:0,justifyContent:\"center\",width:lockW||undefined,overflow:\"visible\",userSelect:\"none\",fontFamily:MONO,fontWeight:600,fontSize:size,lineHeight:\"1.2em\",letterSpacing:\"-0.05em\",textTransform:\"uppercase\",color:swap?accent:color,opacity:swap?1:.6,transition:\"opacity 0.2s ease, color 0.2s ease\"},children:[/*#__PURE__*/_jsx(\"span\",{className:\"wbb-l\",\"aria-hidden\":\"true\",children:\"[\"}),/*#__PURE__*/_jsx(\"span\",{className:\"wbb-lb\",children:` ${swap||inner} `}),/*#__PURE__*/_jsx(\"span\",{className:\"wbb-r\",\"aria-hidden\":\"true\",children:\"]\"})]})]});}addPropertyControls(CopyButton,{value:{type:ControlType.String,title:\"Value\",defaultValue:\"liia.arslanova.work@gmail.com\"},label:{type:ControlType.String,title:\"Label\",defaultValue:\"[ COPY ]\"},color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#FFFFFF\"},size:{type:ControlType.Number,title:\"Size\",defaultValue:12,min:8,max:24,step:1}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CopyButton\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"16\",\"framerSupportedLayoutWidth\":\"auto\",\"framerSupportedLayoutHeight\":\"auto\",\"framerIntrinsicWidth\":\"90\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Cop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