/** * Minified by jsDelivr using Terser v3.14.1. * Original file: /npm/canvas-confetti@0.4.0/dist/confetti.browser.js * * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files */ !function(t,e){!function(){var n,o;t.requestAnimationFrame&&t.cancelAnimationFrame?(n=t.requestAnimationFrame,o=t.cancelAnimationFrame):["webkit","moz","o","ms"].forEach(function(e){if(!n||!o){var i=e+"RequestAnimationFrame",r=e+"CancelAnimationFrame";t[i]&&t[r]&&(n=t[i],o=t[r])}}),n&&o||(n=function(e){return t.setTimeout(e,1e3/60)},o=function(e){return t.clearTimeout(e)});var i={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,ticks:200,x:.5,y:.5,shapes:["square","circle"],zIndex:100,colors:["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"]};function r(){}function a(t,e,n){return function(t,e){return e?e(t):t}(t&&null!=t[e]?t[e]:i[e],n)}function l(t){return parseInt(t,16)}function c(t){t.width=document.documentElement.clientWidth,t.height=document.documentElement.clientHeight}function s(t){var e=t.getBoundingClientRect();t.width=e.width,t.height=e.height}function u(i,a,l,u,h){var f,d,m=a.slice(),b=i.getContext("2d"),g=i.width,y=i.height,p=l?c:s;function M(){g=y=null}var v,x=(v=function(e){function o(){f=d=null,u&&t.removeEventListener("resize",M),b.clearRect(0,0,g,y),h(),e()}f=n(function t(){g||y||(p(i),g=i.width,y=i.height),b.clearRect(0,0,g,y),(m=m.filter(function(t){return function(t,e){e.x+=Math.cos(e.angle2D)*e.velocity,e.y+=Math.sin(e.angle2D)*e.velocity+3,e.wobble+=.1,e.velocity*=e.decay,e.tiltAngle+=.1,e.tiltSin=Math.sin(e.tiltAngle),e.tiltCos=Math.cos(e.tiltAngle),e.random=Math.random()+5,e.wobbleX=e.x+10*Math.cos(e.wobble),e.wobbleY=e.y+10*Math.sin(e.wobble);var n=e.tick++/e.totalTicks,o=e.x+e.random*e.tiltCos,i=e.y+e.random*e.tiltSin,r=e.wobbleX+e.random*e.tiltCos,a=e.wobbleY+e.random*e.tiltSin;return t.fillStyle="rgba("+e.color.r+", "+e.color.g+", "+e.color.b+", "+(1-n)+")",t.beginPath(),"circle"===e.shape?t.ellipse(e.x,e.y,.6*Math.abs(r-o),.6*Math.abs(a-i),Math.PI/10*e.wobble,0,2*Math.PI):(t.moveTo(Math.floor(e.x),Math.floor(e.y)),t.lineTo(Math.floor(e.wobbleX),Math.floor(i)),t.lineTo(Math.floor(r),Math.floor(a)),t.lineTo(Math.floor(o),Math.floor(e.wobbleY))),t.closePath(),t.fill(),e.tick