(window.webpackJsonp=window.webpackJsonp||[]).push([[3,4],{CRLx:function(t,e,i){t.exports=i.p+"human.6fb2e30fed0928058a1eb808a1b1d93c.mp3"},JRdx:function(t,e,i){"use strict";i.r(e);i("myKR");var s,n=i("nJx4"),a=document.querySelector(".play-btn"),r=new n.a(void 0,a);a.addEventListener("click",function(){if(a.classList.contains("playing"))a.classList.remove("playing"),a.innerHTML='click to play <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" class="icon" viewBox="0 0 1024 1024" version="1.1" p-id="1980" width="18" height="18"><defs><style type="text/css"/></defs><path d="M785.916 378.115C621.622 289.254 522.65 200.413 358.355 111.53 194.06 22.643 111.93 67.101 111.93 244.802v533.194c0 177.75 82.151 222.18 246.425 133.341 164.295-88.93 263.266-177.75 427.56-266.611 164.273-88.862 164.273-177.772 0-266.611z m0 0" p-id="1981" fill="#d84e3c"/></svg>',s&&r.pause();else{if(a.classList.add("playing"),a.innerHTML='click to stop <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" class="icon" viewBox="0 0 1024 1024" version="1.1" width="18" height="18"><defs><style type="text/css"/></defs><path d="M352 958H160c-53 0-96-43-96-96V158c0-53 43-96 96-96h192c53 0 96 43 96 96v704c0 53-43 96-96 96z m608-96V158c0-53-43-96-96-96h-192c-53 0-96 43-96 96v704c0 53 43 96 96 96h192c53 0 96-43 96-96z" fill="#f0f0f0" p-id="2916"/></svg>',!s){s=!0;var t=document.createElement("audio");t.crossOrigin="anonymous",t.src=i("CRLx"),r.setAudio(t,2)}r.play()}})},goMK:function(t,e,i){t.exports=i.p+"summer.fdd3aba5140cd0f10965772ae9da64b5.mp3"},myKR:function(t,e,i){},nJx4:function(t,e,i){"use strict";var n=i("tjUo");function a(t,e){for(var i=0;i<e.length;i++){var s=e[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,s.key,s)}}var v=function(){function s(t,e,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),this.x=t,this.y=e,this.w=i,this.opacity=.3,this.smoother=.3}var t,e,i;return t=s,(e=[{key:"update",value:function(t){var e=this.smoother,i=this.lastF,s=.3+.7*(void 0!==i?i:t)/255,n=.3+.7*t/255;this.opacity=e*s+(1-e)*n,this.lastF=t}},{key:"draw",value:function(t){var e=this.opacity,i=this.x,s=this.y,n=this.w,a=n/2;t.fillStyle="hsla(".concat(360*e,", 50%, 50%, ").concat(e,")"),t.beginPath(),t.arc(i+a,s+a,n*e/2,0,2*Math.PI),t.closePath(),t.fill()}}])&&a(t.prototype,e),i&&a(t,i),s}();function s(t,e){for(var i=0;i<e.length;i++){var s=e[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,s.key,s)}}var r=function(){function n(t,e,i,s){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),this.x=t,this.y=e,this.w=i,this.h=s,this.bottom=s+e,this.opacity=.3,this.smoother=0}var t,e,i;return t=n,(e=[{key:"update",value:function(t){var e=this.smoother,i=this.last,s=.05+.95*(void 0!==i?i:t)/255,n=.05+.95*t/255;this.opacity=e*s+(1-e)*n,this.last=t}},{key:"draw",value:function(t){var e=this.opacity,i=this.x,s=this.w,n=this.h,a=this.bottom-n*e;t.fillStyle="hsla(4, ".concat(80*e,"%, 51%, ").concat(e,")"),t.beginPath(),t.rect(i,a,s,n*e),t.closePath(),t.fill()}}])&&s(t.prototype,e),i&&s(t,i),n}();function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function h(t,e){for(var i=0;i<e.length;i++){var s=e[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,s.key,s)}}var u=function(){function n(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n);var i=window.getComputedStyle(t),s=this.ratio=window.devicePixelRatio||1;t.width=parseFloat(i.width,10)*s,t.height=parseFloat(i.height,10)*s,this.ctx=t.getContext("2d"),this.ctx.fillStyle="rgba(255,255,255,0.5)",this.ctx.lineJoin="round",this.ctx.lineWidth=20,this.canvas=t,this.targets=[],this.draw=this.draw.bind(this),e?1===e?this.initSquares():"object"===o(e)&&(this.target=e):this.initBars()}var t,e,i;return t=n,(e=[{key:"initBars",value:function(){for(var t=this.canvas,e=(t.width-405-5)/81,i=t.height-300,s=0;s<81;s++){var n=e*s+5*(s+1);this.targets.push(new r(n,i,e,300))}this.draw()}},{key:"initSquares",value:function(){for(var t=40*this.ratio,e=Math.floor(4.5),i=this.canvas,s=i.width,n=i.height,a=Math.min(Math.min(s,n)/15,t),r=1.5*a*e+(s-13*a)/2,o=1.5*a*e+(n-13*a)/2,h=0;h<e;h++){var u=r+1.5*a*h,c=o+1.5*a*h;this.targets.push(new v(u,c,a)),u+=1.5*a,this.targets.push(new v(u,c,a));for(var l=1;l<=2*h+1;l++)c-=1.5*a,this.targets.push(new v(u,c,a));for(var f=1;f<=2*h+2;f++)u-=1.5*a,this.targets.push(new v(u,c,a));for(var d=1;d<=2*h+2;d++)c+=1.5*a,this.targets.push(new v(u,c,a));for(var y=1;y<=2*h+1;y++)u+=1.5*a,this.targets.push(new v(u,c,a));h===e-1&&(u+=1.5*a,this.targets.push(new v(u,c,a)))}this.draw()}},{key:"update",value:function(t){var e=this.targets,i=this.target;if(i){var s=.9+t[0]/255;i.style.transform="scale(".concat(s,")"),i.style.opacity="".concat(.3+t[0]/255)}else{for(var n=0;n<e.length;n++)void 0!==t[n]&&e[n].update(t[n]);this.draw()}}},{key:"draw",value:function(){var t=this.ctx,e=this.targets,i=e.length;t.clearRect(0,0,this.canvas.width,this.canvas.height);for(var s=0;s<i;s++)e[s].draw(t)}}])&&h(t.prototype,e),i&&h(t,i),n}();i("goMK");function c(t,e){for(var i=0;i<e.length;i++){var s=e[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,s.key,s)}}var l=window.AudioContext||window.webkitAudioContext||window.mozAudioContext,f=function(){function i(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t&&this.setAudio(t),this.AC=new l,this.analyser=this.AC.createAnalyser(),this.analyser.fftSize=1024,this.vc=new u(document.querySelector("#canvas"),e),this.refreshFrame=this.refreshFrame.bind(this),this.setAudio=this.setAudio.bind(this)}var t,e,s;return t=i,(e=[{key:"setAudio",value:function(t,e){if(t){var i=this.AC,s=this.analyser;this.audio=t,i.createMediaElementSource(this.audio).connect(s),s.connect(i.destination),console.log("audio context",i),console.log("analyser",s),t.addEventListener("end",this.pause),this.soundProcessor=new n.SoundProcessor({filterParams:{sigma:1,radius:2},sampleRate:i.sampleRate,fftSize:1024,endFrequency:4500,startFrequency:2===e?1e3:150,outBandsQty:2===e?1:81,tWeight:!0,aWeight:!0}),console.log("soundProcessor",this.soundProcessor)}else console.error("need a audio dom")}},{key:"play",value:function(){var t=this;this.audio&&this.audio.paused?this.AC.resume().then(function(){t.audio.play(),t.paused=!1,t.refreshFrame()}).catch(function(t){console.log("eeee",t)}):(this.audio.pause(),this.paused=!0)}},{key:"pause",value:function(){this.audio&&!this.audio.paused&&(this.audio.pause(),this.paused=!0)}},{key:"refreshFrame",value:function(){var t=this.getFre();this.vc.update(t),this.paused||window.requestAnimationFrame(this.refreshFrame)}},{key:"getFre",value:function(){var t=this.analyser,e=this.soundProcessor,i=new Uint8Array(t.frequencyBinCount);return t.getByteFrequencyData(i),e.process(i)}}])&&c(t.prototype,e),s&&c(t,s),i}();e.a=f},tjUo:function(t,e,i){"use strict";function h(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1,i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0;return Math.pow(Math.E,-Math.pow(t-i,2)/(2*e*e))}function s(t,e){for(var i=0;i<e.length;i++){var s=e[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,s.key,s)}}i.r(e),i.d(e,"SoundProcessor",function(){return n});var n=function(){function c(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c);var e=t.filterParams,i=void 0===e?{}:e,s=t.sampleRate,n=t.fftSize,a=t.endFrequency,r=t.startFrequency,o=t.outBandsQty,h=t.tWeight,u=t.aWeight;if(!n||!s||!o)throw new Error("need fftSize, sampleRate and outBandsQty");this.sampleRate=s,this.fftSize=n||1024,this.bandsQty=Math.floor(n/2),this.outBandsQty=o,this.bandwidth=s/n,this.startFrequency=r||0,this.endFrequency=a||1e4,this.tWeight=!!h,this.aWeight=void 0===u||!!u,this.filterParams={mu:0,sigma:i.sigma||1,filterRadius:Math.floor(i.radius||0)},this.aWeights=[],this.bands=[],this.gKernel=[],this.historyLimit=5,this.history=[],this.initWeights(),this.initBands(),this.initGaussKernel(),this.process=this.process.bind(this)}var t,e,i;return t=c,(e=[{key:"initWeights",value:function(){for(var t,e,i=this.bandwidth,s=this.bandsQty,n=this.aWeights,a=0;a<s;a++)n.push((void 0,1.2588966*14884e4*(e=(t=a*i)*t)*e/((e+424.36)*Math.sqrt((e+11599.29)*(e+544496.41))*(e+14884e4))))}},{key:"initBands",value:function(){var t=this.endFrequency,e=this.startFrequency,i=this.outBandsQty,s=this.bands,n=Math.log2(t/e)/i;n=Math.pow(2,n);for(var a={lowerFrequency:Math.max(e,0),upperFrequency:0},r=0;r<i;r++){var o=a.lowerFrequency*n;a.upperFrequency=Math.min(o,t),s.push({lowerFrequency:a.lowerFrequency,upperFrequency:a.upperFrequency}),a.lowerFrequency=o}}},{key:"initGaussKernel",value:function(){for(var t=this.filterParams,e=this.gKernel,i=t.mu,s=t.sigma,n=t.filterRadius,a=n,r=-a;r<1;r++)e.push(h(r,s,i));for(var o=a-1;-1<o;o--)e.push(e[o]);this.gKernelSum=e.reduce(function(t,e){return t+e}),this.filterRadius=n,console.log(e)}},{key:"filter",value:function(t){var e=this.gKernel,i=this.gKernelSum,s=this.filterRadius;if(s)for(var n=0;n<t.length;n++){for(var a=0,r=n-s;r<n+s;r++){a+=(void 0!==t[r]?t[r]:0)*e[r-n+s]}t[n]=a/i}}},{key:"aWeighting",value:function(t){for(var e=this.aWeights,i=0;i<t.length;i++)void 0!==e[i]&&(t[i]=t[i]*e[i])}},{key:"divide",value:function(t){for(var e=this.outBandsQty,i=this.bandwidth,s=this.bands,n=new Array(e),a=0;a<s.length;a++){for(var r=s[a],o=Math.floor(r.lowerFrequency/i),h=Math.min(Math.floor(r.upperFrequency/i),t.length-1),u=0,c=o;c<=h;c++)u+=t[c]*t[c];n[a]=Math.sqrt(u/(h+1-o))}return n}},{key:"timeWeighting",value:function(t){var e=this.history,i=this.historyLimit;if(e.length<5)e.push(t.slice(0));else{e.pop(),e.unshift(t.slice(0));for(var s=0;s<t.length;s++){for(var n=0,a=0;a<i;a++)n+=e[a][s]/i;t[s]=n}}}},{key:"process",value:function(t){return this.filterRadius&&this.filter(t),this.tWeight&&this.timeWeighting(t),this.aWeight&&this.aWeighting(t),this.divide(t)}}])&&s(t.prototype,e),i&&s(t,i),c}()}},[["JRdx",0]]]);