import{r as t,j as e}from"./@radix-CFOkMR_E.js";import{x as d,y as C,E as u,G as m}from"./index-DK1ynKjA.js";import{S as f}from"./copy-BXNk6BjL.js";const x=r=>t.createElement("svg",{viewBox:"0 0 24 24",fill:"black",xmlns:"http://www.w3.org/2000/svg",...r},t.createElement("g",{id:"refresh-cw-01"},t.createElement("path",{id:"Icon (Stroke)",fillRule:"evenodd",clipRule:"evenodd",d:"M2 12C2 6.47715 6.47715 2 12 2C14.7624 2 17.2648 3.12139 19.0735 4.93138C19.7132 5.57146 20.3981 6.36248 21 7.09444V4C21 3.44772 21.4477 3 22 3C22.5523 3 23 3.44772 23 4V10C23 10.5523 22.5523 11 22 11H16C15.4477 11 15 10.5523 15 10C15 9.44772 15.4477 9 16 9H19.9692C19.277 8.13128 18.4165 7.10335 17.6588 6.34511C16.2098 4.89514 14.2104 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20C15.6457 20 18.7243 17.5605 19.6874 14.2227C19.8406 13.6921 20.3948 13.3861 20.9255 13.5392C21.4561 13.6923 21.7622 14.2466 21.609 14.7773C20.4055 18.9481 16.5605 22 12 22C6.47715 22 2 17.5228 2 12Z"}))),y=x;function w({copyText:r,isVisible:s,copyTitle:n}){const i=t.useRef(null),[l,a]=t.useState(!1),p=s?n:"Copy to Clipboard",c=()=>{navigator.clipboard&&(navigator.clipboard.writeText(r),a(!0),setTimeout(()=>{a(!1)},2e3))};return e.jsx(d,{children:e.jsxs(C,{delayDuration:200,children:[e.jsxs(u,{className:`${s?"":"invisible  opacity-0 group-hover/copybutton:opacity-100"}  h-4 w-4 rounded-sm  p-0.25 transition-all
					duration-200 hover:bg-theme-surface-primary active:bg-neutral-300 group-hover/copybutton:visible `,onClick:o=>{o.preventDefault(),c()},ref:i,children:[e.jsx("span",{className:"sr-only",children:"Copy to Clipboard"}),e.jsx(f,{className:`${s?"h-5 w-5":"h-3 w-3"} pointer-events-none  fill-theme-text-tertiary`})]}),e.jsx(m,{onPointerDownOutside:o=>{o.currentTarget===i.current&&o.preventDefault()},className:"z-50 rounded-md bg-theme-text-primary px-3 py-2 text-text-xs text-theme-text-negative shadow-lg",sideOffset:5,children:l?"Copied!":p})]})})}export{w as C,y as R};
