1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3b4a8bc7-37e6-467d-9d04-731545df4d1a",e._sentryDebugIdIdentifier="sentry-dbid-3b4a8bc7-37e6-467d-9d04-731545df4d1a")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2639],{22639:function(e,t,r){r.r(t),r.d(t,{AudioVisualizer:function(){return h},LiveAudioVisualizer:function(){return c}});var n,a=r(67294),l={exports:{}},i={};l.exports=function(){if(n)return i;n=1;var e=Symbol.for("react.element"),t=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,l=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function u(t,n,a){var i,u={},s=null,c=null;for(i in void 0!==a&&(s=""+a),void 0!==n.key&&(s=""+n.key),void 0!==n.ref&&(c=n.ref),n)r.call(n,i)&&!o.hasOwnProperty(i)&&(u[i]=n[i]);if(t&&t.defaultProps)for(i in n=t.defaultProps)void 0===u[i]&&(u[i]=n[i]);return{$$typeof:e,type:t,key:s,ref:c,props:u,_owner:l.current}}return i.Fragment=t,i.jsx=u,i.jsxs=u,i}();var o=l.exports;let u=(e,t,r,n)=>{let a=t/(r+n),l=Math.floor(e.length/a);a>e.length&&(a=e.length,l=1);let i=[];for(let t=0;t<a;t++){let r=0;for(let n=0;n<l&&t*l+n<e.length;n++)r+=e[t*l+n];i.push(r/l)}return i},s=(e,t,r,n,a,l)=>{let i=t.height/2,o=t.getContext("2d");o&&(o.clearRect(0,0,t.width,t.height),"transparent"!==a&&(o.fillStyle=a,o.fillRect(0,0,t.width,t.height)),e.forEach((e,t)=>{o.fillStyle=l;let a=t*(r+n),u=i-e/2,s=e||1;o.beginPath(),o.roundRect?(o.roundRect(a,u,r,s,50),o.fill()):o.fillRect(a,u,r,s)}))},c=({mediaRecorder:e,width:t="100%",height:r="100%",barWidth:n=2,gap:l=1,backgroundColor:i="transparent",barColor:c="rgb(160, 198, 255)",fftSize:f=1024,maxDecibels:d=-10,minDecibels:h=-90,smoothingTimeConstant:g=.4})=>{let[m,b]=(0,a.useState)(),[y,p]=(0,a.useState)(),[w,_]=(0,a.useState)(),x=(0,a.useRef)(null);(0,a.useEffect)(()=>{if(!e.stream)return;let t=new AudioContext,r=t.createAnalyser();_(r),r.fftSize=f,r.minDecibels=h,r.maxDecibels=d,r.smoothingTimeConstant=g;let n=t.createMediaStreamSource(e.stream);return n.connect(r),b(t),p(n),()=>{n.disconnect(),r.disconnect(),"closed"!==t.state&&t.close()}},[e.stream]),(0,a.useEffect)(()=>{w&&"recording"===e.state&&R()},[w,e.state]);let R=(0,a.useCallback)(()=>{if(!w||!m)return;let t=new Uint8Array(null==w?void 0:w.frequencyBinCount);"recording"===e.state?(null==w||w.getByteFrequencyData(t),C(t),requestAnimationFrame(R)):"paused"===e.state?C(t):"inactive"===e.state&&"closed"!==m.state&&m.close()},[w,null==m?void 0:m.state]);(0,a.useEffect)(()=>()=>{m&&"closed"!==m.state&&m.close(),null==y||y.disconnect(),null==w||w.disconnect()},[]);let C=e=>{x.current&&s(u(e,x.current.width,n,l),x.current,n,l,i,c)};return o.jsx("canvas",{ref:x,width:t,height:r,style:{aspectRatio:"unset"}})},f=(e,t,r,n,a)=>{let l=e.getChannelData(0),i=r/(n+a),o=Math.floor(l.length/i),u=t/2,s=[],c=0;for(let t=0;t<i;t++){let r=[],n=0,a=[],i=0;for(let u=0;u<o&&t*o+u<e.length;u++){let e=l[t*o+u];e<=0&&(r.push(e),n++),e>0&&(a.push(e),i++)}let u=r.reduce((e,t)=>e+t,0)/n,f={max:a.reduce((e,t)=>e+t,0)/i,min:u};f.max>c&&(c=f.max),Math.abs(f.min)>c&&(c=Math.abs(f.min)),s.push(f)}if(.8*u>c*u){let e=.8*u/c;s=s.map(t=>({max:t.max*e,min:t.min*e}))}return s},d=(e,t,r,n,a,l,i,o=0,u=1)=>{let s=t.height/2,c=t.getContext("2d");if(!c)return;c.clearRect(0,0,t.width,t.height),"transparent"!==a&&(c.fillStyle=a,c.fillRect(0,0,t.width,t.height));let f=(o||0)/u;e.forEach((t,a)=>{let o=a/e.length;c.fillStyle=f>o&&i?i:l;let u=a*(r+n),d=s+t.min,h=s+t.max-d;c.beginPath(),c.roundRect?(c.roundRect(u,d,r,h,50),c.fill()):c.fillRect(u,d,r,h)})},h=(0,a.forwardRef)(({blob:e,width:t,height:r,barWidth:n=2,gap:l=1,currentTime:i,style:u,backgroundColor:s="transparent",barColor:c="rgb(184, 184, 184)",barPlayedColor:h="rgb(160, 198, 255)"},g)=>{let m=(0,a.useRef)(null),[b,y]=(0,a.useState)([]),[p,w]=(0,a.useState)(0);return(0,a.useImperativeHandle)(g,()=>m.current,[]),(0,a.useEffect)(()=>{(async()=>
1{if(!m.current)return;if(!e){d(Array.from({length:100},()=>({max:0,min:0})),m.current,n,l,s,c,h);return}let a=await e.arrayBuffer();await new AudioContext().decodeAudioData(a,e=>{if(!m.current)return;w(e.duration);let a=f(e,r,t,n,l);y(a),d(a,m.current,n,l,s,c,h)})})()},[e,m.current]),(0,a.useEffect)(()=>{m.current&&d(b,m.current,n,l,s,c,h,i,p)},[i,p]),o.jsx("canvas",{ref:m,width:t,height:r,style:{...u}})});h.displayName="AudioVisualizer"}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.