"use strict";const e=require("react/jsx-runtime"),C=require("react"),S=require("@mui/icons-material/ContentCopy"),j=require("@mui/icons-material/Check"),q=require("@mui/material/IconButton"),b=require("@mui/material/CircularProgress"),a=require("./types.cjs");function l({children:n,color:t="neutral",emphasis:c,size:o="sm",shape:r="rounded",loading:s=!1,disabled:i,onClick:x,title:y,sx:u,...h}){const f=a.toMuiColor(t),B=a.toMuiSize(o),d={xs:24,sm:32,md:40,lg:48,xl:56},p={xs:14,sm:18,md:22,lg:26,xl:30};return e.jsx(q,{color:f,size:B,disabled:i||s,onClick:x,title:y,sx:{borderRadius:a.toBorderRadius(r),width:d[o],height:d[o],fontSize:p[o],...typeof u=="object"&&!Array.isArray(u)?u:{}},...h,children:s?e.jsx(b,{size:p[o]-4,color:"inherit"}):n})}l.displayName="IconButton";function m({value:n,size:t="sm",label:c}){const[o,r]=C.useState(!1),s=C.useCallback(()=>{navigator.clipboard.writeText(n).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})},[n]),i=t==="xs"?12:t==="sm"?14:t==="md"?16:18;return e.jsx(l,{size:t,color:o?"success":"neutral",onClick:s,"aria-label":c??(o?"Copied":"Copy to clipboard"),title:c??(o?"Copied!":"Copy"),children:o?e.jsx(j,{sx:{fontSize:i}}):e.jsx(S,{sx:{fontSize:i}})})}m.displayName="CopyButton";exports.CopyButton=m;exports.IconButton=l;
