import{jsxs as r,jsx as e,Fragment as o}from"react/jsx-runtime";import{Check as i,Copy as n}from"lucide-react";import{useState as t}from"react";import{styled as c}from"styled-components";let l=c.button`
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 0.5rem;

  && {
    color: var(--privy-color-foreground);
    font-weight: 500;
  }

  svg {
    width: 0.875rem;
    height: 0.875rem;
  }
`,a=c.span`
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  color: var(--privy-color-foreground-2);
`,s=c(i)`
  color: var(--privy-color-icon-success);
  flex-shrink: 0;
`,d=c(n)`
  color: var(--privy-color-icon-muted);
  flex-shrink: 0;
`;function m({children:o,iconOnly:i,value:n,hideCopyIcon:c,iconSize:m=14,...p}){let[h,u]=t(!1);/*#__PURE__*/return r(l,{...p,onClick:()=>{navigator.clipboard.writeText(n||("string"==typeof o?o:"")).catch(console.error),u(!0),setTimeout((()=>u(!1)),1500)},children:[o," ",h?/*#__PURE__*/r(a,{children:[/*#__PURE__*/e(s,{size:m})," ",!i&&"Copied"]}):!c&&/*#__PURE__*/e(d,{size:m})]})}const p=({value:i,includeChildren:n,children:c,...m})=>{let[p,h]=t(!1),u=()=>{navigator.clipboard.writeText(i).catch(console.error),h(!0),setTimeout((()=>h(!1)),1500)};/*#__PURE__*/return r(o,{children:[n?/*#__PURE__*/e(l,{...m,onClick:u,children:c}):/*#__PURE__*/e(o,{children:c}),/*#__PURE__*/e(l,{...m,onClick:u,children:p?/*#__PURE__*/e(a,{children:/*#__PURE__*/e(s,{})}):/*#__PURE__*/e(d,{})})]})};export{m as C,p as a};
//# sourceMappingURL=CopyableText-ChtfBWx4.mjs.map
