"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),r=require("react"),i=require("lucide-react");exports.default=function(n){var a=n.amplitude,s=n.variant,l=n.isActive,o=n.className,c=void 0===o?"":o,u=n.onClick,d=n.disabled,m=void 0!==d&&d,h=n.isConnecting,f=r.useState(Array(40).fill(4)),p=f[0],x=f[1],b=r.useRef(null),g=function(){var e=Math.min(Math.max(a,0),1),t=Math.max(e,.2),r=Array(40).fill(0).map(function(e,r){var i=Math.sin(r+Date.now()/100)+.5*Math.random();return 5+9*Math.abs(i)*t});x(r),b.current=requestAnimationFrame(g)};r.useEffect(function(){return l?b.current=requestAnimationFrame(g):(x(Array(40).fill(4)),b.current&&cancelAnimationFrame(b.current)),function(){b.current&&cancelAnimationFrame(b.current)}},[l,a]);var v=l?"#364152":"#D0D4DB",y="microphone"===s?l||h?i.Mic:i.MicOff:l?i.Volume2:i.VolumeOff;return t.jsxs("div",e.__assign({className:c,style:{position:"relative",height:"3rem",zIndex:50,width:"100%",overflow:"hidden",display:"flex",alignItems:"center"}},{children:[t.jsx("div",e.__assign({style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",height:"2rem",gap:"0.25rem"}},{children:p.map(function(e,r){return t.jsx("div",{style:{flexShrink:0,width:"4px",borderRadius:"9999px",transition:"all 100ms",backgroundColor:v,height:"".concat(e,"px"),opacity:l?1:.4}},r)})})),t.jsx("button",e.__assign({onClick:u,disabled:m,"aria-label":"".concat(s," button"),style:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",width:"2rem",height:"2rem",borderRadius:"9999px",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 200ms",backgroundColor:"white",border:"1px solid ".concat(v),cursor:m?"not-allowed":"pointer"}},{children:t.jsx(y,{color:v,className:h?"animate-spin":"",style:{width:"1.25rem",height:"1.25rem"}})}))]}))};
//# sourceMappingURL=AudioWaveform.js.map
