import{i as Ot}from"./index-BbBXKozi.js";const fe="generated",ci="pointerdown",ui="pointerup",je="pointerleave",hi="pointerout",ie="pointermove",fi="touchstart",ot="touchend",di="touchmove",pi="touchcancel",mi="resize",yi="visibilitychange",W="tsParticles - Error";class F{constructor(e,t,i){if(this._updateFromAngle=(n,o)=>{this.x=Math.cos(n)*o,this.y=Math.sin(n)*o},!E(e)&&e){this.x=e.x,this.y=e.y;const n=e;this.z=n.z?n.z:0}else if(e!==void 0&&t!==void 0)this.x=e,this.y=t,this.z=i??0;else throw new Error(`${W} Vector3d not initialized correctly`)}static get origin(){return F.create(0,0,0)}get angle(){return Math.atan2(this.y,this.x)}set angle(e){this._updateFromAngle(e,this.length)}get length(){return Math.sqrt(this.getLengthSq())}set length(e){this._updateFromAngle(this.angle,e)}static clone(e){return F.create(e.x,e.y,e.z)}static create(e,t,i){return new F(e,t,i)}add(e){return F.create(this.x+e.x,this.y+e.y,this.z+e.z)}addTo(e){this.x+=e.x,this.y+=e.y,this.z+=e.z}copy(){return F.clone(this)}distanceTo(e){return this.sub(e).length}distanceToSq(e){return this.sub(e).getLengthSq()}div(e){return F.create(this.x/e,this.y/e,this.z/e)}divTo(e){this.x/=e,this.y/=e,this.z/=e}getLengthSq(){return this.x**2+this.y**2}mult(e){return F.create(this.x*e,this.y*e,this.z*e)}multTo(e){this.x*=e,this.y*=e,this.z*=e}normalize(){const e=this.length;e!=0&&this.multTo(1/e)}rotate(e){return F.create(this.x*Math.cos(e)-this.y*Math.sin(e),this.x*Math.sin(e)+this.y*Math.cos(e),0)}setTo(e){this.x=e.x,this.y=e.y;const t=e;this.z=t.z?t.z:0}sub(e){return F.create(this.x-e.x,this.y-e.y,this.z-e.z)}subFrom(e){this.x-=e.x,this.y-=e.y,this.z-=e.z}}class P extends F{constructor(e,t){super(e,t,0)}static get origin(){return P.create(0,0)}static clone(e){return P.create(e.x,e.y)}static create(e,t){return new P(e,t)}}let gi=Math.random;const Je=new Map;function De(s,e){Je.get(s)||Je.set(s,e)}function St(s){return Je.get(s)||(e=>e)}function _(){return X(gi(),0,1-1e-16)}function X(s,e,t){return Math.min(Math.max(s,e),t)}function Re(s,e,t,i){return Math.floor((s*t+e*i)/(t+i))}function R(s){const e=K(s);let t=Ke(s);return e===t&&(t=0),_()*(e-t)+t}function y(s){return E(s)?s:R(s)}function Ke(s){return E(s)?s:s.min}function K(s){return E(s)?s:s.max}function v(s,e){if(s===e||e===void 0&&E(s))return s;const t=Ke(s),i=K(s);return e!==void 0?{min:Math.min(t,e),max:Math.max(i,e)}:v(t,i)}function V(s){const e=s.random,{enable:t,minimumValue:i}=ee(e)?{enable:e,minimumValue:0}:e;return y(t?v(s.value,i):s.value)}function T(s,e){const t=s.x-e.x,i=s.y-e.y;return{dx:t,dy:i,distance:Math.sqrt(t**2+i**2)}}function L(s,e){return T(s,e).distance}function bi(s,e,t){if(E(s))return s*Math.PI/180;switch(s){case"top":return-Math.PI/2;case"top-right":return-Math.PI/4;case"right":return 0;case"bottom-right":return Math.PI/4;case"bottom":return Math.PI/2;case"bottom-left":return 3*Math.PI/4;case"left":return Math.PI;case"top-left":return-3*Math.PI/4;case"inside":return Math.atan2(t.y-e.y,t.x-e.x);case"outside":return Math.atan2(e.y-t.y,e.x-t.x);default:return _()*Math.PI*2}}function vi(s){const e=P.origin;return e.length=1,e.angle=s,e}function rt(s,e,t,i){return P.create(s.x*(t-i)/(t+i)+e.x*2*i/(t+i),s.y)}function Dt(s){return{x:(s.position?.x??_()*100)*s.size.width/100,y:(s.position?.y??_()*100)*s.size.height/100}}function Rt(s){const e={x:s.position?.x!==void 0?y(s.position.x):void 0,y:s.position?.y!==void 0?y(s.position.y):void 0};return Dt({size:s.size,position:e})}function wi(s){return{x:s.position?.x??_()*s.size.width,y:s.position?.y??_()*s.size.height}}function Tt(s){return s?s.endsWith("%")?parseFloat(s)/100:parseFloat(s):1}const xi={debug:console.debug,error:console.error,info:console.info,log:console.log,verbose:console.log,warning:console.warn};function se(){return xi}function at(s){const e={bounced:!1},{pSide:t,pOtherSide:i,rectSide:n,rectOtherSide:o,velocity:r,factor:a}=s;return i.min<o.min||i.min>o.max||i.max<o.min||i.max>o.max||(t.max>=n.min&&t.max<=(n.max+n.min)/2&&r>0||t.min<=n.max&&t.min>(n.max+n.min)/2&&r<0)&&(e.velocity=r*-a,e.bounced=!0),e}function _i(s,e){const t=M(e,i=>s.matches(i));return D(t)?t.some(i=>i):t}function le(){return typeof window>"u"||!window||typeof window.document>"u"||!window.document}function ki(){return!le()&&typeof matchMedia<"u"}function Et(s){if(ki())return matchMedia(s)}function Pi(s){if(!(le()||typeof MutationObserver>"u"))return new MutationObserver(s)}function C(s,e){return s===e||D(e)&&e.indexOf(s)>-1}async function Ci(s,e){try{await document.fonts.load(`${e??"400"} 36px '${s??"Verdana"}'`)}catch{}}function It(s){return Math.floor(_()*s.length)}function me(s,e,t=!0){return s[e!==void 0&&t?e%s.length:It(s)]}function ye(s,e,t,i,n){return Mi(ge(s,i??0),e,t,n)}function Mi(s,e,t,i){let n=!0;return(!i||i==="bottom")&&(n=s.top<e.height+t.x),n&&(!i||i==="left")&&(n=s.right>t.x),n&&(!i||i==="right")&&(n=s.left<e.width+t.y),n&&(!i||i==="top")&&(n=s.bottom>t.y),n}function ge(s,e){return{bottom:s.y+e,left:s.x-e,right:s.x+e,top:s.y-e}}function S(s,...e){for(const t of e){if(t==null)continue;if(!re(t)){s=t;continue}const i=Array.isArray(t);i&&(re(s)||!s||!Array.isArray(s))?s=[]:!i&&(re(s)||!s||Array.isArray(s))&&(s={});for(const n in t){if(n==="__proto__")continue;const o=t,r=o[n],a=s;a[n]=re(r)&&Array.isArray(r)?r.map(l=>S(a[n],l)):S(a[n],r)}}return s}function et(s,e){return!!Ft(e,t=>t.enable&&C(s,t.mode))}function tt(s,e,t){M(e,i=>{const n=i.mode;i.enable&&C(s,n)&&zi(i,t)})}function zi(s,e){const t=s.selectors;M(t,i=>{e(i,s)})}function Lt(s,e){if(!(!e||!s))return Ft(s,t=>_i(e,t.selectors))}function Qe(s){return{position:s.getPosition(),radius:s.getRadius(),mass:s.getMass(),velocity:s.velocity,factor:P.create(V(s.options.bounce.horizontal),V(s.options.bounce.vertical))}}function At(s,e){const{x:t,y:i}=s.velocity.sub(e.velocity),[n,o]=[s.position,e.position],{dx:r,dy:a}=T(o,n);if(t*r+i*a<0)return;const l=-Math.atan2(a,r),c=s.mass,u=e.mass,h=s.velocity.rotate(l),f=e.velocity.rotate(l),d=rt(h,f,c,u),m=rt(f,h,c,u),p=d.rotate(-l),x=m.rotate(-l);s.velocity.x=p.x*s.factor.x,s.velocity.y=p.y*s.factor.y,e.velocity.x=x.x*e.factor.x,e.velocity.y=x.y*e.factor.y}function Oi(s,e){const t=s.getPosition(),i=s.getRadius(),n=ge(t,i),o=at({pSide:{min:n.left,max:n.right},pOtherSide:{min:n.top,max:n.bottom},rectSide:{min:e.left,max:e.right},rectOtherSide:{min:e.top,max:e.bottom},velocity:s.velocity.x,factor:V(s.options.bounce.horizontal)});o.bounced&&(o.velocity!==void 0&&(s.velocity.x=o.velocity),o.position!==void 0&&(s.position.x=o.position));const r=at({pSide:{min:n.top,max:n.bottom},pOtherSide:{min:n.left,max:n.right},rectSide:{min:e.top,max:e.bottom},rectOtherSide:{min:e.left,max:e.right},velocity:s.velocity.y,factor:V(s.options.bounce.vertical)});r.bounced&&(r.velocity!==void 0&&(s.velocity.y=r.velocity),r.position!==void 0&&(s.position.y=r.position))}function M(s,e){return D(s)?s.map((t,i)=>e(t,i)):e(s,0)}function q(s,e,t){return D(s)?me(s,e,t):s}function Ft(s,e){return D(s)?s.find((t,i)=>e(t,i)):e(s,0)?s:void 0}function qt(s,e){const t=s.value,i=s.animation,n={delayTime:y(i.delay)*1e3,enable:i.enable,value:y(s.value)*e,max:K(t)*e,min:Ke(t)*e,loops:0,maxLoops:y(i.count),time:0};if(i.enable){switch(n.decay=1-y(i.decay),i.mode){case"increase":n.status="increasing";break;case"decrease":n.status="decreasing";break;case"random":n.status=_()>=.5?"increasing":"decreasing";break}const o=i.mode==="auto";switch(i.startValue){case"min":n.value=n.min,o&&(n.status="increasing");break;case"max":n.value=n.max,o&&(n.status="decreasing");break;case"random":default:n.value=R(n),o&&(n.status=_()>=.5?"increasing":"decreasing");break}}return n.initialValue=n.value,n}function Bt(s,e){if(!(s.mode==="percent")){const{mode:n,...o}=s;return o}return"x"in s?{x:s.x/100*e.width,y:s.y/100*e.height}:{width:s.width/100*e.width,height:s.height/100*e.height}}function Ut(s,e){return Bt(s,e)}function Si(s,e){return Bt(s,e)}function ee(s){return typeof s=="boolean"}function N(s){return typeof s=="string"}function E(s){return typeof s=="number"}function Ht(s){return typeof s=="function"}function re(s){return typeof s=="object"&&s!==null}function D(s){return Array.isArray(s)}const we="random",be="mid",Ce=new Map;function lt(s){Ce.set(s.key,s)}function Te(s,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?s+(e-s)*6*t:t<1/2?e:t<2/3?s+(e-s)*(2/3-t)*6:s}function Di(s){for(const[,o]of Ce)if(s.startsWith(o.stringPrefix))return o.parseString(s);const e=/^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i,t=s.replace(e,(o,r,a,l,c)=>r+r+a+a+l+l+(c!==void 0?c+c:"")),i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i,n=i.exec(t);return n?{a:n[4]!==void 0?parseInt(n[4],16)/255:1,b:parseInt(n[3],16),g:parseInt(n[2],16),r:parseInt(n[1],16)}:void 0}function H(s,e,t=!0){if(!s)return;const i=N(s)?{value:s}:s;if(N(i.value))return Wt(i.value,e,t);if(D(i.value))return H({value:me(i.value,e,t)});for(const[,n]of Ce){const o=n.handleRangeColor(i);if(o)return o}}function Wt(s,e,t=!0){if(!s)return;const i=N(s)?{value:s}:s;if(N(i.value))return i.value===we?Gt():Ri(i.value);if(D(i.value))return Wt({value:me(i.value,e,t)});for(const[,n]of Ce){const o=n.handleColor(i);if(o)return o}}function te(s,e,t=!0){const i=H(s,e,t);return i?$t(i):void 0}function $t(s){const e=s.r/255,t=s.g/255,i=s.b/255,n=Math.max(e,t,i),o=Math.min(e,t,i),r={h:0,l:(n+o)/2,s:0};return n!==o&&(r.s=r.l<.5?(n-o)/(n+o):(n-o)/(2-n-o),r.h=e===n?(t-i)/(n-o):r.h=t===n?2+(i-e)/(n-o):4+(e-t)/(n-o)),r.l*=100,r.s*=100,r.h*=60,r.h<0&&(r.h+=360),r.h>=360&&(r.h-=360),r}function Ri(s){return Di(s)}function ce(s){const e={b:0,g:0,r:0},t={h:s.h/360,l:s.l/100,s:s.s/100};if(!t.s)e.r=e.g=e.b=t.l;else{const i=t.l<.5?t.l*(1+t.s):t.l+t.s-t.l*t.s,n=2*t.l-i;e.r=Te(n,i,t.h+1/3),e.g=Te(n,i,t.h),e.b=Te(n,i,t.h-1/3)}return e.r=Math.floor(e.r*255),e.g=Math.floor(e.g*255),e.b=Math.floor(e.b*255),e}function Ti(s){const e=ce(s);return{a:s.a,b:e.b,g:e.g,r:e.r}}function Gt(s){return{b:Math.floor(R(v(0,256))),g:Math.floor(R(v(0,256))),r:Math.floor(R(v(0,256)))}}function J(s,e){return`rgba(${s.r}, ${s.g}, ${s.b}, ${e??1})`}function ue(s,e){return`hsla(${s.h}, ${s.s}%, ${s.l}%, ${e??1})`}function it(s,e,t,i){let n=s,o=e;return n.r===void 0&&(n=ce(s)),o.r===void 0&&(o=ce(e)),{b:Re(n.b,o.b,t,i),g:Re(n.g,o.g,t,i),r:Re(n.r,o.r,t,i)}}function Ve(s,e,t){if(t===we)return Gt();if(t===be){const i=s.getFillColor()??s.getStrokeColor(),n=e?.getFillColor()??e?.getStrokeColor();if(i&&n&&e)return it(i,n,s.getRadius(),e.getRadius());{const o=i??n;if(o)return ce(o)}}else return t}function Nt(s,e,t){const i=N(s)?s:s.value;return i===we?t?H({value:i}):e?we:be:i===be?be:H({value:i})}function ct(s){return s!==void 0?{h:s.h.value,s:s.s.value,l:s.l.value}:void 0}function Xt(s,e,t){const i={h:{enable:!1,value:s.h},s:{enable:!1,value:s.s},l:{enable:!1,value:s.l}};return e&&(Ee(i.h,e.h,t),Ee(i.s,e.s,t),Ee(i.l,e.l,t)),i}function Ee(s,e,t){s.enable=e.enable,s.enable?(s.velocity=y(e.speed)/100*t,s.decay=1-y(e.decay),s.status="increasing",s.loops=0,s.maxLoops=y(e.count),s.time=0,s.delayTime=y(e.delay)*1e3,e.sync||(s.velocity*=_(),s.value*=_()),s.initialValue=s.value):s.velocity=0}function de(s,e,t){s.beginPath(),s.moveTo(e.x,e.y),s.lineTo(t.x,t.y),s.closePath()}function Ei(s,e,t,i){s.beginPath(),s.moveTo(e.x,e.y),s.lineTo(t.x,t.y),s.lineTo(i.x,i.y),s.closePath()}function Ii(s,e,t){s.fillStyle=t??"rgba(0,0,0,0)",s.fillRect(0,0,e.width,e.height)}function Li(s,e,t,i){t&&(s.globalAlpha=i,s.drawImage(t,0,0,e.width,e.height),s.globalAlpha=1)}function Ie(s,e){s.clearRect(0,0,e.width,e.height)}function Ai(s){const{container:e,context:t,particle:i,delta:n,colorStyles:o,backgroundMask:r,composite:a,radius:l,opacity:c,shadow:u,transform:h}=s,f=i.getPosition(),d=i.rotation+(i.pathRotation?i.velocity.angle:0),m={sin:Math.sin(d),cos:Math.cos(d)},p={a:m.cos*(h.a??1),b:m.sin*(h.b??1),c:-m.sin*(h.c??1),d:m.cos*(h.d??1)};t.setTransform(p.a,p.b,p.c,p.d,f.x,f.y),t.beginPath(),r&&(t.globalCompositeOperation=a);const x=i.shadowColor;u.enable&&x&&(t.shadowBlur=u.blur,t.shadowColor=J(x),t.shadowOffsetX=u.offset.x,t.shadowOffsetY=u.offset.y),o.fill&&(t.fillStyle=o.fill);const g=i.strokeWidth??0;t.lineWidth=g,o.stroke&&(t.strokeStyle=o.stroke),Fi(e,t,i,l,c,n),g>0&&t.stroke(),i.close&&t.closePath(),i.fill&&t.fill(),qi(e,t,i,l,c,n),t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0)}function Fi(s,e,t,i,n,o){if(!t.shape)return;const r=s.drawers.get(t.shape);r&&r.draw(e,t,i,n,o,s.retina.pixelRatio)}function qi(s,e,t,i,n,o){if(!t.shape)return;const r=s.drawers.get(t.shape);!r||!r.afterEffect||r.afterEffect(e,t,i,n,o,s.retina.pixelRatio)}function Bi(s,e,t){e.draw&&e.draw(s,t)}function Ui(s,e,t,i){e.drawParticle&&e.drawParticle(s,t,i)}function Hi(s,e,t){return{h:s.h,s:s.s,l:s.l+(e==="darken"?-1:1)*t}}function Wi(s,e,t){const i=e[t];i!==void 0&&(s[t]=(s[t]??1)*i)}class $i{constructor(e){this.container=e,this._applyPostDrawUpdaters=t=>{for(const i of this._postDrawUpdaters)i.afterDraw&&i.afterDraw(t)},this._applyPreDrawUpdaters=(t,i,n,o,r,a)=>{for(const l of this._preDrawUpdaters){if(l.getColorStyles){const{fill:c,stroke:u}=l.getColorStyles(i,t,n,o);c&&(r.fill=c),u&&(r.stroke=u)}if(l.getTransformValues){const c=l.getTransformValues(i);for(const u in c)Wi(a,c,u)}l.beforeDraw&&l.beforeDraw(i)}},this._applyResizePlugins=()=>{for(const t of this._resizePlugins)t.resize&&t.resize()},this._getPluginParticleColors=t=>{let i,n;for(const o of this._colorPlugins)if(!i&&o.particleFillColor&&(i=te(o.particleFillColor(t))),!n&&o.particleStrokeColor&&(n=te(o.particleStrokeColor(t))),i&&n)break;return[i,n]},this._initCover=()=>{const t=this.container.actualOptions,i=t.backgroundMask.cover,n=i.color,o=H(n);if(o){const r={...o,a:i.opacity};this._coverColorStyle=J(r,r.a)}},this._initStyle=()=>{const t=this.element,i=this.container.actualOptions;if(t){this._fullScreen?(this._originalStyle=S({},t.style),this._setFullScreenStyle()):this._resetOriginalStyle();for(const n in i.style){if(!n||!i.style)continue;const o=i.style[n];o&&t.style.setProperty(n,o,"important")}}},this._initTrail=async()=>{const t=this.container.actualOptions,i=t.particles.move.trail,n=i.fill;if(i.enable)if(n.color){const o=H(n.color);if(!o)return;const r=t.particles.move.trail;this._trailFill={color:{...o},opacity:1/r.length}}else await new Promise((o,r)=>{if(!n.image)return;const a=document.createElement("img");a.addEventListener("load",()=>{this._trailFill={image:a,opacity:1/i.length},o()}),a.addEventListener("error",l=>{r(l.error)}),a.src=n.image})},this._paintBase=t=>{this.draw(i=>Ii(i,this.size,t))},this._paintImage=(t,i)=>{this.draw(n=>Li(n,this.size,t,i))},this._repairStyle=()=>{const t=this.element;t&&(this._safeMutationObserver(i=>i.disconnect()),this._initStyle(),this.initBackground(),this._safeMutationObserver(i=>i.observe(t,{attributes:!0})))},this._resetOriginalStyle=()=>{const t=this.element,i=this._originalStyle;if(!(t&&i))return;const n=t.style;n.position=i.position,n.zIndex=i.zIndex,n.top=i.top,n.left=i.left,n.width=i.width,n.height=i.height},this._safeMutationObserver=t=>{this._mutationObserver&&t(this._mutationObserver)},this._setFullScreenStyle=()=>{const t=this.element;if(!t)return;const i="important",n=t.style;n.setProperty("position","fixed",i),n.setProperty("z-index",this.container.actualOptions.fullScreen.zIndex.toString(10),i),n.setProperty("top","0",i),n.setProperty("left","0",i),n.setProperty("width","100%",i),n.setProperty("height","100%",i)},this.size={height:0,width:0},this._context=null,this._generated=!1,this._preDrawUpdaters=[],this._postDrawUpdaters=[],this._resizePlugins=[],this._colorPlugins=[]}get _fullScreen(){return this.container.actualOptions.fullScreen.enable}clear(){const e=this.container.actualOptions,t=e.particles.move.trail,i=this._trailFill;e.backgroundMask.enable?this.paint():t.enable&&t.length>0&&i?i.color?this._paintBase(J(i.color,i.opacity)):i.image&&this._paintImage(i.image,i.opacity):this.draw(n=>{Ie(n,this.size)})}destroy(){if(this.stop(),this._generated){const e=this.element;e&&e.remove()}else this._resetOriginalStyle();this._preDrawUpdaters=[],this._postDrawUpdaters=[],this._resizePlugins=[],this._colorPlugins=[]}draw(e){const t=this._context;if(t)return e(t)}drawParticle(e,t){if(e.spawning||e.destroyed)return;const i=e.getRadius();if(i<=0)return;const n=e.getFillColor(),o=e.getStrokeColor()??n;let[r,a]=this._getPluginParticleColors(e);r||(r=n),a||(a=o),!(!r&&!a)&&this.draw(l=>{const c=this.container,u=c.actualOptions,h=e.options.zIndex,f=(1-e.zIndexFactor)**h.opacityRate,d=e.bubble.opacity??e.opacity?.value??1,m=e.strokeOpacity??d,p=d*f,x=m*f,g={},w={fill:r?ue(r,p):void 0};w.stroke=a?ue(a,x):w.fill,this._applyPreDrawUpdaters(l,e,i,p,w,g),Ai({container:c,context:l,particle:e,delta:t,colorStyles:w,backgroundMask:u.backgroundMask.enable,composite:u.backgroundMask.composite,radius:i*(1-e.zIndexFactor)**h.sizeRate,opacity:p,shadow:e.options.shadow,transform:g}),this._applyPostDrawUpdaters(e)})}drawParticlePlugin(e,t,i){this.draw(n=>Ui(n,e,t,i))}drawPlugin(e,t){this.draw(i=>Bi(i,e,t))}async init(){this._safeMutationObserver(e=>e.disconnect()),this._mutationObserver=Pi(e=>{for(const t of e)t.type==="attributes"&&t.attributeName==="style"&&this._repairStyle()}),this.resize(),this._initStyle(),this._initCover();try{await this._initTrail()}catch(e){se().error(e)}this.initBackground(),this._safeMutationObserver(e=>{this.element&&e.observe(this.element,{attributes:!0})}),this.initUpdaters(),this.initPlugins(),this.paint()}initBackground(){const e=this.container.actualOptions,t=e.background,i=this.element;if(!i)return;const n=i.style;if(n){if(t.color){const o=H(t.color);n.backgroundColor=o?J(o,t.opacity):""}else n.backgroundColor="";n.backgroundImage=t.image||"",n.backgroundPosition=t.position||"",n.backgroundRepeat=t.repeat||"",n.backgroundSize=t.size||""}}initPlugins(){this._resizePlugins=[];for(const[,e]of this.container.plugins)e.resize&&this._resizePlugins.push(e),(e.particleFillColor||e.particleStrokeColor)&&this._colorPlugins.push(e)}initUpdaters(){this._preDrawUpdaters=[],this._postDrawUpdaters=[];for(const e of this.container.particles.updaters)e.afterDraw&&this._postDrawUpdaters.push(e),(e.getColorStyles||e.getTransformValues||e.beforeDraw)&&this._preDrawUpdaters.push(e)}loadCanvas(e){this._generated&&this.element&&this.element.remove(),this._generated=e.dataset&&fe in e.dataset?e.dataset[fe]==="true":this._generated,this.element=e,this.element.ariaHidden="true",this._originalStyle=S({},this.element.style),this.size.height=e.offsetHeight,this.size.width=e.offsetWidth,this._context=this.element.getContext("2d"),this._safeMutationObserver(t=>{this.element&&t.observe(this.element,{attributes:!0})}),this.container.retina.init(),this.initBackground()}paint(){const e=this.container.actualOptions;this.draw(t=>{e.backgroundMask.enable&&e.backgroundMask.cover?(Ie(t,this.size),this._paintBase(this._coverColorStyle)):this._paintBase()})}resize(){if(!this.element)return!1;const e=this.container,t=e.retina.pixelRatio,i=e.canvas.size,n={width:this.element.offsetWidth*t,height:this.element.offsetHeight*t};if(n.height===i.height&&n.width===i.width&&n.height===this.element.height&&n.width===this.element.width)return!1;const o={...i};return this.element.width=i.width=this.element.offsetWidth*t,this.element.height=i.height=this.element.offsetHeight*t,this.container.started&&(this.resizeFactor={width:i.width/o.width,height:i.height/o.height}),!0}stop(){this._safeMutationObserver(e=>e.disconnect()),this._mutationObserver=void 0,this.draw(e=>Ie(e,this.size))}async windowResize(){if(!this.element||!this.resize())return;const e=this.container,t=e.updateActualOptions();e.particles.setDensity(),this._applyResizePlugins(),t&&await e.refresh()}}function U(s,e,t,i,n){if(i){let o={passive:!0};ee(n)?o.capture=n:n!==void 0&&(o=n),s.addEventListener(e,t,o)}else{const o=n;s.removeEventListener(e,t,o)}}class Gi{constructor(e){this.container=e,this._doMouseTouchClick=t=>{const i=this.container,n=i.actualOptions;if(this._canPush){const o=i.interactivity.mouse,r=o.position;if(!r)return;o.clickPosition={...r},o.clickTime=new Date().getTime();const a=n.interactivity.events.onClick;M(a.mode,l=>this.container.handleClickMode(l))}t.type==="touchend"&&setTimeout(()=>this._mouseTouchFinish(),500)},this._handleThemeChange=t=>{const i=t,n=this.container,o=n.options,r=o.defaultThemes,a=i.matches?r.dark:r.light,l=o.themes.find(c=>c.name===a);l&&l.default.auto&&n.loadTheme(a)},this._handleVisibilityChange=()=>{const t=this.container,i=t.actualOptions;this._mouseTouchFinish(),i.pauseOnBlur&&(document&&document.hidden?(t.pageHidden=!0,t.pause()):(t.pageHidden=!1,t.getAnimationStatus()?t.play(!0):t.draw(!0)))},this._handleWindowResize=async()=>{this._resizeTimeout&&(clearTimeout(this._resizeTimeout),delete this._resizeTimeout),this._resizeTimeout=setTimeout(async()=>{const t=this.container.canvas;t&&await t.windowResize()},this.container.actualOptions.interactivity.events.resize.delay*1e3)},this._manageInteractivityListeners=(t,i)=>{const n=this._handlers,o=this.container,r=o.actualOptions,a=o.interactivity.element;if(!a)return;const l=a,c=o.canvas.element;c&&(c.style.pointerEvents=l===c?"initial":"none"),(r.interactivity.events.onHover.enable||r.interactivity.events.onClick.enable)&&(U(a,ie,n.mouseMove,i),U(a,fi,n.touchStart,i),U(a,di,n.touchMove,i),r.interactivity.events.onClick.enable?(U(a,ot,n.touchEndClick,i),U(a,ui,n.mouseUp,i),U(a,ci,n.mouseDown,i)):U(a,ot,n.touchEnd,i),U(a,t,n.mouseLeave,i),U(a,pi,n.touchCancel,i))},this._manageListeners=t=>{const i=this._handlers,n=this.container,o=n.actualOptions,r=o.interactivity.detectsOn,a=n.canvas.element;let l=je;r==="window"?(n.interactivity.element=window,l=hi):r==="parent"&&a?n.interactivity.element=a.parentElement??a.parentNode:n.interactivity.element=a,this._manageMediaMatch(t),this._manageResize(t),this._manageInteractivityListeners(l,t),document&&U(document,yi,i.visibilityChange,t,!1)},this._manageMediaMatch=t=>{const i=this._handlers,n=Et("(prefers-color-scheme: dark)");if(n){if(n.addEventListener!==void 0){U(n,"change",i.themeChange,t);return}n.addListener!==void 0&&(t?n.addListener(i.oldThemeChange):n.removeListener(i.oldThemeChange))}},this._manageResize=t=>{const i=this._handlers,n=this.container;if(!n.actualOptions.interactivity.events.resize)return;if(typeof ResizeObserver>"u"){U(window,mi,i.resize,t);return}const r=n.canvas.element;this._resizeObserver&&!t?(r&&this._resizeObserver.unobserve(r),this._resizeObserver.disconnect(),delete this._resizeObserver):!this._resizeObserver&&t&&r&&(this._resizeObserver=new ResizeObserver(async a=>{a.find(c=>c.target===r)&&await this._handleWindowResize()}),this._resizeObserver.observe(r))},this._mouseDown=()=>{const{interactivity:t}=this.container;if(!t)return;const{mouse:i}=t;i.clicking=!0,i.downPosition=i.position},this._mouseTouchClick=t=>{const i=this.container,n=i.actualOptions,{mouse:o}=i.interactivity;o.inside=!0;let r=!1;const a=o.position;if(!(!a||!n.interactivity.events.onClick.enable)){for(const[,l]of i.plugins)if(l.clickPositionValid&&(r=l.clickPositionValid(a),r))break;r||this._doMouseTouchClick(t),o.clicking=!1}},this._mouseTouchFinish=()=>{const t=this.container.interactivity;if(!t)return;const i=t.mouse;delete i.position,delete i.clickPosition,delete i.downPosition,t.status=je,i.inside=!1,i.clicking=!1},this._mouseTouchMove=t=>{const i=this.container,n=i.actualOptions,o=i.interactivity,r=i.canvas.element;if(!o||!o.element)return;o.mouse.inside=!0;let a;if(t.type.startsWith("pointer")){this._canPush=!0;const c=t;if(o.element===window){if(r){const u=r.getBoundingClientRect();a={x:c.clientX-u.left,y:c.clientY-u.top}}}else if(n.interactivity.detectsOn==="parent"){const u=c.target,h=c.currentTarget;if(u&&h&&r){const f=u.getBoundingClientRect(),d=h.getBoundingClientRect(),m=r.getBoundingClientRect();a={x:c.offsetX+2*f.left-(d.left+m.left),y:c.offsetY+2*f.top-(d.top+m.top)}}else a={x:c.offsetX??c.clientX,y:c.offsetY??c.clientY}}else c.target===r&&(a={x:c.offsetX??c.clientX,y:c.offsetY??c.clientY})}else if(this._canPush=t.type!=="touchmove",r){const c=t,u=c.touches[c.touches.length-1],h=r.getBoundingClientRect();a={x:u.clientX-(h.left??0),y:u.clientY-(h.top??0)}}const l=i.retina.pixelRatio;a&&(a.x*=l,a.y*=l),o.mouse.position=a,o.status=ie},this._touchEnd=t=>{const i=t,n=Array.from(i.changedTouches);for(const o of n)this._touches.delete(o.identifier);this._mouseTouchFinish()},this._touchEndClick=t=>{const i=t,n=Array.from(i.changedTouches);for(const o of n)this._touches.delete(o.identifier);this._mouseTouchClick(t)},this._touchStart=t=>{const i=t,n=Array.from(i.changedTouches);for(const o of n)this._touches.set(o.identifier,performance.now());this._mouseTouchMove(t)},this._canPush=!0,this._touches=new Map,this._handlers={mouseDown:()=>this._mouseDown(),mouseLeave:()=>this._mouseTouchFinish(),mouseMove:t=>this._mouseTouchMove(t),mouseUp:t=>this._mouseTouchClick(t),touchStart:t=>this._touchStart(t),touchMove:t=>this._mouseTouchMove(t),touchEnd:t=>this._touchEnd(t),touchCancel:t=>this._touchEnd(t),touchEndClick:t=>this._touchEndClick(t),visibilityChange:()=>this._handleVisibilityChange(),themeChange:t=>this._handleThemeChange(t),oldThemeChange:t=>this._handleThemeChange(t),resize:()=>{this._handleWindowResize()}}}addListeners(){this._manageListeners(!0)}removeListeners(){this._manageListeners(!1)}}class O{constructor(){this.value=""}static create(e,t){const i=new O;return i.load(e),t!==void 0&&(N(t)||D(t)?i.load({value:t}):i.load(t)),i}load(e){e?.value!==void 0&&(this.value=e.value)}}class Ni{constructor(){this.color=new O,this.color.value="",this.image="",this.position="",this.repeat="",this.size="",this.opacity=1}load(e){e&&(e.color!==void 0&&(this.color=O.create(this.color,e.color)),e.image!==void 0&&(this.image=e.image),e.position!==void 0&&(this.position=e.position),e.repeat!==void 0&&(this.repeat=e.repeat),e.size!==void 0&&(this.size=e.size),e.opacity!==void 0&&(this.opacity=e.opacity))}}class Xi{constructor(){this.color=new O,this.color.value="#fff",this.opacity=1}load(e){e&&(e.color!==void 0&&(this.color=O.create(this.color,e.color)),e.opacity!==void 0&&(this.opacity=e.opacity))}}class Yi{constructor(){this.composite="destination-out",this.cover=new Xi,this.enable=!1}load(e){if(e){if(e.composite!==void 0&&(this.composite=e.composite),e.cover!==void 0){const t=e.cover,i=N(e.cover)?{color:e.cover}:e.cover;this.cover.load(t.color!==void 0?t:{color:i})}e.enable!==void 0&&(this.enable=e.enable)}}}class ji{constructor(){this.enable=!0,this.zIndex=0}load(e){e&&(e.enable!==void 0&&(this.enable=e.enable),e.zIndex!==void 0&&(this.zIndex=e.zIndex))}}class Ji{constructor(){this.enable=!1,this.mode=[]}load(e){e&&(e.enable!==void 0&&(this.enable=e.enable),e.mode!==void 0&&(this.mode=e.mode))}}class ut{constructor(){this.selectors=[],this.enable=!1,this.mode=[],this.type="circle"}get el(){return this.elementId}set el(e){this.elementId=e}get elementId(){return this.ids}set elementId(e){this.ids=e}get ids(){return M(this.selectors,e=>e.replace("#",""))}set ids(e){this.selectors=M(e,t=>`#${t}`)}load(e){if(!e)return;const t=e.ids??e.elementId??e.el;t!==void 0&&(this.ids=t),e.selectors!==void 0&&(this.selectors=e.selectors),e.enable!==void 0&&(this.enable=e.enable),e.mode!==void 0&&(this.mode=e.mode),e.type!==void 0&&(this.type=e.type)}}class Qi{constructor(){this.enable=!1,this.force=2,this.smooth=10}load(e){e&&(e.enable!==void 0&&(this.enable=e.enable),e.force!==void 0&&(this.force=e.force),e.smooth!==void 0&&(this.smooth=e.smooth))}}class Vi{constructor(){this.enable=!1,this.mode=[],this.parallax=new Qi}load(e){e&&(e.enable!==void 0&&(this.enable=e.enable),e.mode!==void 0&&(this.mode=e.mode),this.parallax.load(e.parallax))}}class Zi{constructor(){this.delay=.5,this.enable=!0}load(e){e!==void 0&&(e.delay!==void 0&&(this.delay=e.delay),e.enable!==void 0&&(this.enable=e.enable))}}class Ki{constructor(){this.onClick=new Ji,this.onDiv=new ut,this.onHover=new Vi,this.resize=new Zi}get onclick(){return this.onClick}set onclick(e){this.onClick=e}get ondiv(){return this.onDiv}set ondiv(e){this.onDiv=e}get onhover(){return this.onHover}set onhover(e){this.onHover=e}load(e){if(!e)return;this.onClick.load(e.onClick??e.onclick);const t=e.onDiv??e.ondiv;t!==void 0&&(this.onDiv=M(t,i=>{const n=new ut;return n.load(i),n})),this.onHover.load(e.onHover??e.onhover),ee(e.resize)?this.resize.enable=e.resize:this.resize.load(e.resize)}}class es{constructor(e,t){this._engine=e,this._container=t}load(e){if(!e||!this._container)return;const t=this._engine.plugins.interactors.get(this._container);if(t)for(const i of t)i.loadModeOptions&&i.loadModeOptions(this,e)}}class Yt{constructor(e,t){this.detectsOn="window",this.events=new Ki,this.modes=new es(e,t)}get detect_on(){return this.detectsOn}set detect_on(e){this.detectsOn=e}load(e){if(!e)return;const t=e.detectsOn??e.detect_on;t!==void 0&&(this.detectsOn=t),this.events.load(e.events),this.modes.load(e.modes)}}class ts{load(e){e&&(e.position&&(this.position={x:e.position.x??50,y:e.position.y??50,mode:e.position.mode??"percent"}),e.options&&(this.options=S({},e.options)))}}class is{constructor(){this.maxWidth=1/0,this.options={},this.mode="canvas"}load(e){e&&(e.maxWidth!==void 0&&(this.maxWidth=e.maxWidth),e.mode!==void 0&&(e.mode==="screen"?this.mode="screen":this.mode="canvas"),e.options!==void 0&&(this.options=S({},e.options)))}}class ss{constructor(){this.auto=!1,this.mode="any",this.value=!1}load(e){e&&(e.auto!==void 0&&(this.auto=e.auto),e.mode!==void 0&&(this.mode=e.mode),e.value!==void 0&&(this.value=e.value))}}class ns{constructor(){this.name="",this.default=new ss}load(e){e&&(e.name!==void 0&&(this.name=e.name),this.default.load(e.default),e.options!==void 0&&(this.options=S({},e.options)))}}class Le{constructor(){this.count=0,this.enable=!1,this.offset=0,this.speed=1,this.delay=0,this.decay=0,this.sync=!0}load(e){e&&(e.count!==void 0&&(this.count=v(e.count)),e.enable!==void 0&&(this.enable=e.enable),e.offset!==void 0&&(this.offset=v(e.offset)),e.speed!==void 0&&(this.speed=v(e.speed)),e.decay!==void 0&&(this.decay=v(e.decay)),e.delay!==void 0&&(this.delay=v(e.delay)),e.sync!==void 0&&(this.sync=e.sync))}}class os{constructor(){this.h=new Le,this.s=new Le,this.l=new Le}load(e){e&&(this.h.load(e.h),this.s.load(e.s),this.l.load(e.l))}}class he extends O{constructor(){super(),this.animation=new os}static create(e,t){const i=new he;return i.load(e),t!==void 0&&(N(t)||D(t)?i.load({value:t}):i.load(t)),i}load(e){if(super.load(e),!e)return;const t=e.animation;t!==void 0&&(t.enable!==void 0?this.animation.h.load(t):this.animation.load(e.animation))}}class rs{constructor(){this.speed=2}load(e){e&&e.speed!==void 0&&(this.speed=e.speed)}}class as{constructor(){this.enable=!0,this.retries=0}load(e){e&&(e.enable!==void 0&&(this.enable=e.enable),e.retries!==void 0&&(this.retries=e.retries))}}class ls{constructor(){this.count=0,this.enable=!1,this.speed=1,this.decay=0,this.delay=0,this.sync=!1}load(e){e&&(e.count!==void 0&&(this.count=v(e.count)),e.enable!==void 0&&(this.enable=e.enable),e.speed!==void 0&&(this.speed=v(e.speed)),e.decay!==void 0&&(this.decay=v(e.decay)),e.delay!==void 0&&(this.delay=v(e.delay)),e.sync!==void 0&&(this.sync=e.sync))}}class jt extends ls{constructor(){super(),this.mode="auto",this.startValue="random"}load(e){super.load(e),e&&(e.minimumValue!==void 0&&(this.minimumValue=e.minimumValue),e.mode!==void 0&&(this.mode=e.mode),e.startValue!==void 0&&(this.startValue=e.startValue))}}class cs{constructor(){this.enable=!1,this.minimumValue=0}load(e){e&&(e.enable!==void 0&&(this.enable=e.enable),e.minimumValue!==void 0&&(this.minimumValue=e.minimumValue))}}class ${constructor(){this.random=new cs,this.value=0}load(e){e&&(ee(e.random)?this.random.enable=e.random:this.random.load(e.random),e.value!==void 0&&(this.value=v(e.value,this.random.enable?this.random.minimumValue:void 0)))}}class ht extends ${constructor(){super(),this.random.minimumValue=.1,this.value=1}}class Jt{constructor(){this.horizontal=new ht,this.vertical=new ht}load(e){e&&(this.horizontal.load(e.horizontal),this.vertical.load(e.vertical))}}class us{constructor(){this.absorb=new rs,this.bounce=new Jt,this.enable=!1,this.maxSpeed=50,this.mode="bounce",this.overlap=new as}load(e){e&&(this.absorb.load(e.absorb),this.bounce.load(e.bounce),e.enable!==void 0&&(this.enable=e.enable),e.maxSpeed!==void 0&&(this.maxSpeed=v(e.maxSpeed)),e.mode!==void 0&&(this.mode=e.mode),this.overlap.load(e.overlap))}}class hs{constructor(){this.offset=0,this.value=90}load(e){e&&(e.offset!==void 0&&(this.offset=v(e.offset)),e.value!==void 0&&(this.value=v(e.value)))}}class fs{constructor(){this.distance=200,this.enable=!1,this.rotate={x:3e3,y:3e3}}get rotateX(){return this.rotate.x}set rotateX(e){this.rotate.x=e}get rotateY(){return this.rotate.y}set rotateY(e){this.rotate.y=e}load(e){if(!e)return;e.distance!==void 0&&(this.distance=v(e.distance)),e.enable!==void 0&&(this.enable=e.enable);const t=e.rotate?.x??e.rotateX;t!==void 0&&(this.rotate.x=t);const i=e.rotate?.y??e.rotateY;i!==void 0&&(this.rotate.y=i)}}class ds{constructor(){this.x=50,this.y=50,this.mode="percent",this.radius=0}load(e){e&&(e.x!==void 0&&(this.x=e.x),e.y!==void 0&&(this.y=e.y),e.mode!==void 0&&(this.mode=e.mode),e.radius!==void 0&&(this.radius=e.radius))}}class ps{constructor(){this.acceleration=9.81,this.enable=!1,this.inverse=!1,this.maxSpeed=50}load(e){e&&(e.acceleration!==void 0&&(this.acceleration=v(e.acceleration)),e.enable!==void 0&&(this.enable=e.enable),e.inverse!==void 0&&(this.inverse=e.inverse),e.maxSpeed!==void 0&&(this.maxSpeed=v(e.maxSpeed)))}}class ms{constructor(){this.clamp=!0,this.delay=new $,this.enable=!1,this.options={}}load(e){e&&(e.clamp!==void 0&&(this.clamp=e.clamp),this.delay.load(e.delay),e.enable!==void 0&&(this.enable=e.enable),this.generator=e.generator,e.options&&(this.options=S(this.options,e.options)))}}class ys{load(e){e&&(e.color!==void 0&&(this.color=O.create(this.color,e.color)),e.image!==void 0&&(this.image=e.image))}}class gs{constructor(){this.enable=!1,this.length=10,this.fill=new ys}get fillColor(){return this.fill.color}set fillColor(e){this.fill.load({color:e})}load(e){e&&(e.enable!==void 0&&(this.enable=e.enable),(e.fill!==void 0||e.fillColor!==void 0)&&this.fill.load(e.fill||{color:e.fillColor}),e.length!==void 0&&(this.length=e.length))}}class bs{constructor(){this.default="out"}load(e){e&&(e.default!==void 0&&(this.default=e.default),this.bottom=e.bottom??e.default,this.left=e.left??e.default,this.right=e.right??e.default,this.top=e.top??e.default)}}class vs{constructor(){this.acceleration=0,this.enable=!1}load(e){e&&(e.acceleration!==void 0&&(this.acceleration=v(e.acceleration)),e.enable!==void 0&&(this.enable=e.enable),e.position&&(this.position=S({},e.position)))}}class ws{constructor(){this.angle=new hs,this.attract=new fs,this.center=new ds,this.decay=0,this.distance={},this.direction="none",this.drift=0,this.enable=!1,this.gravity=new ps,this.path=new ms,this.outModes=new bs,this.random=!1,this.size=!1,this.speed=2,this.spin=new vs,this.straight=!1,this.trail=new gs,this.vibrate=!1,this.warp=!1}get bounce(){return this.collisions}set bounce(e){this.collisions=e}get collisions(){return!1}set collisions(e){}get noise(){return this.path}set noise(e){this.path=e}get outMode(){return this.outModes.default}set outMode(e){this.outModes.default=e}get out_mode(){return this.outMode}set out_mode(e){this.outMode=e}load(e){if(!e)return;this.angle.load(E(e.angle)?{value:e.angle}:e.angle),this.attract.load(e.attract),this.center.load(e.center),e.decay!==void 0&&(this.decay=v(e.decay)),e.direction!==void 0&&(this.direction=e.direction),e.distance!==void 0&&(this.distance=E(e.distance)?{horizontal:e.distance,vertical:e.distance}:{...e.distance}),e.drift!==void 0&&(this.drift=v(e.drift)),e.enable!==void 0&&(this.enable=e.enable),this.gravity.load(e.gravity);const t=e.outModes??e.outMode??e.out_mode;t!==void 0&&(re(t)?this.outModes.load(t):this.outModes.load({default:t})),this.path.load(e.path??e.noise),e.random!==void 0&&(this.random=e.random),e.size!==void 0&&(this.size=e.size),e.speed!==void 0&&(this.speed=v(e.speed)),this.spin.load(e.spin),e.straight!==void 0&&(this.straight=e.straight),this.trail.load(e.trail),e.vibrate!==void 0&&(this.vibrate=e.vibrate),e.warp!==void 0&&(this.warp=e.warp)}}class xs extends jt{constructor(){super(),this.destroy="none",this.speed=2}get opacity_min(){return this.minimumValue}set opacity_min(e){this.minimumValue=e}load(e){e?.opacity_min!==void 0&&e.minimumValue===void 0&&(e.minimumValue=e.opacity_min),super.load(e),e&&e.destroy!==void 0&&(this.destroy=e.destroy)}}class _s extends ${constructor(){super(),this.animation=new xs,this.random.minimumValue=.1,this.value=1}get anim(){return this.animation}set anim(e){this.animation=e}load(e){if(!e)return;super.load(e);const t=e.animation??e.anim;t!==void 0&&(this.animation.load(t),this.value=v(this.value,this.animation.enable?this.animation.minimumValue:void 0))}}class ks{constructor(){this.enable=!1,this.width=1920,this.height=1080}get area(){return this.width}set area(e){this.width=e}get factor(){return this.height}set factor(e){this.height=e}get value_area(){return this.area}set value_area(e){this.area=e}load(e){if(!e)return;e.enable!==void 0&&(this.enable=e.enable);const t=e.width??e.area??e.value_area;t!==void 0&&(this.width=t);const i=e.height??e.factor;i!==void 0&&(this.height=i)}}class Ps{constructor(){this.density=new ks,this.limit=0,this.value=0}get max(){return this.limit}set max(e){this.limit=e}load(e){if(!e)return;this.density.load(e.density);const t=e.limit??e.max;t!==void 0&&(this.limit=t),e.value!==void 0&&(this.value=e.value)}}class Cs{constructor(){this.blur=0,this.color=new O,this.enable=!1,this.offset={x:0,y:0},this.color.value="#000"}load(e){e&&(e.blur!==void 0&&(this.blur=e.blur),this.color=O.create(this.color,e.color),e.enable!==void 0&&(this.enable=e.enable),e.offset!==void 0&&(e.offset.x!==void 0&&(this.offset.x=e.offset.x),e.offset.y!==void 0&&(this.offset.y=e.offset.y)))}}const Ae="character",Fe="char",qe="image",Be="images",Ue="polygon",He="star";class Ms{constructor(){this.loadShape=(e,t,i,n)=>{if(!e)return;const o=D(e),r=o?[]:{},a=o!==D(this.options[t]),l=o!==D(this.options[i]);a&&(this.options[t]=r),l&&n&&(this.options[i]=r),this.options[t]=S(this.options[t]??r,e),(!this.options[i]||n)&&(this.options[i]=S(this.options[i]??r,e))},this.close=!0,this.fill=!0,this.options={},this.type="circle"}get character(){return this.options[Ae]??this.options[Fe]}set character(e){this.options[Fe]=this.options[Ae]=e}get custom(){return this.options}set custom(e){this.options=e}get image(){return this.options[qe]??this.options[Be]}set image(e){this.options[Be]=this.options[qe]=e}get images(){return this.image}set images(e){this.image=e}get polygon(){return this.options[Ue]??this.options[He]}set polygon(e){this.options[He]=this.options[Ue]=e}get stroke(){return[]}set stroke(e){}load(e){if(!e)return;const t=e.options??e.custom;if(t!==void 0)for(const i in t){const n=t[i];n&&(this.options[i]=S(this.options[i]??{},n))}this.loadShape(e.character,Ae,Fe,!0),this.loadShape(e.polygon,Ue,He,!1),this.loadShape(e.image??e.images,qe,Be,!0),e.close!==void 0&&(this.close=e.close),e.fill!==void 0&&(this.fill=e.fill),e.type!==void 0&&(this.type=e.type)}}class zs extends jt{constructor(){super(),this.destroy="none",this.speed=5}get size_min(){return this.minimumValue}set size_min(e){this.minimumValue=e}load(e){e?.size_min!==void 0&&e.minimumValue===void 0&&(e.minimumValue=e.size_min),super.load(e),e&&e.destroy!==void 0&&(this.destroy=e.destroy)}}class Os extends ${constructor(){super(),this.animation=new zs,this.random.minimumValue=1,this.value=3}get anim(){return this.animation}set anim(e){this.animation=e}load(e){if(super.load(e),!e)return;const t=e.animation??e.anim;t!==void 0&&(this.animation.load(t),this.value=v(this.value,this.animation.enable?this.animation.minimumValue:void 0))}}class ft{constructor(){this.width=0}load(e){e&&(e.color!==void 0&&(this.color=he.create(this.color,e.color)),e.width!==void 0&&(this.width=v(e.width)),e.opacity!==void 0&&(this.opacity=v(e.opacity)))}}class Ss extends ${constructor(){super(),this.opacityRate=1,this.sizeRate=1,this.velocityRate=1}load(e){super.load(e),e&&(e.opacityRate!==void 0&&(this.opacityRate=e.opacityRate),e.sizeRate!==void 0&&(this.sizeRate=e.sizeRate),e.velocityRate!==void 0&&(this.velocityRate=e.velocityRate))}}class Ds{constructor(e,t){this._engine=e,this._container=t,this.bounce=new Jt,this.collisions=new us,this.color=new he,this.color.value="#fff",this.groups={},this.move=new ws,this.number=new Ps,this.opacity=new _s,this.reduceDuplicates=!1,this.shadow=new Cs,this.shape=new Ms,this.size=new Os,this.stroke=new ft,this.zIndex=new Ss}load(e){if(!e)return;if(this.bounce.load(e.bounce),this.color.load(he.create(this.color,e.color)),e.groups!==void 0)for(const n in e.groups){const o=e.groups[n];o!==void 0&&(this.groups[n]=S(this.groups[n]??{},o))}this.move.load(e.move),this.number.load(e.number),this.opacity.load(e.opacity),e.reduceDuplicates!==void 0&&(this.reduceDuplicates=e.reduceDuplicates),this.shape.load(e.shape),this.size.load(e.size),this.shadow.load(e.shadow),this.zIndex.load(e.zIndex);const t=e.move?.collisions??e.move?.bounce;t!==void 0&&(this.collisions.enable=t),this.collisions.load(e.collisions),e.interactivity!==void 0&&(this.interactivity=S({},e.interactivity));const i=e.stroke??e.shape?.stroke;if(i&&(this.stroke=M(i,n=>{const o=new ft;return o.load(n),o})),this._container){const n=this._engine.plugins.updaters.get(this._container);if(n)for(const r of n)r.loadOptions&&r.loadOptions(this,e);const o=this._engine.plugins.interactors.get(this._container);if(o)for(const r of o)r.loadParticlesOptions&&r.loadParticlesOptions(this,e)}}}function Qt(s,...e){for(const t of e)s.load(t)}function st(s,e,...t){const i=new Ds(s,e);return Qt(i,...t),i}class Rs{constructor(e,t){this._findDefaultTheme=i=>this.themes.find(n=>n.default.value&&n.default.mode===i)??this.themes.find(n=>n.default.value&&n.default.mode==="any"),this._importPreset=i=>{this.load(this._engine.plugins.getPreset(i))},this._engine=e,this._container=t,this.autoPlay=!0,this.background=new Ni,this.backgroundMask=new Yi,this.defaultThemes={},this.delay=0,this.fullScreen=new ji,this.detectRetina=!0,this.duration=0,this.fpsLimit=120,this.interactivity=new Yt(e,t),this.manualParticles=[],this.particles=st(this._engine,this._container),this.pauseOnBlur=!0,this.pauseOnOutsideViewport=!0,this.responsive=[],this.smooth=!1,this.style={},this.themes=[],this.zLayers=100}get backgroundMode(){return this.fullScreen}set backgroundMode(e){this.fullScreen.load(e)}get fps_limit(){return this.fpsLimit}set fps_limit(e){this.fpsLimit=e}get retina_detect(){return this.detectRetina}set retina_detect(e){this.detectRetina=e}load(e){if(!e)return;e.preset!==void 0&&M(e.preset,r=>this._importPreset(r)),e.autoPlay!==void 0&&(this.autoPlay=e.autoPlay),e.delay!==void 0&&(this.delay=v(e.delay));const t=e.detectRetina??e.retina_detect;t!==void 0&&(this.detectRetina=t),e.duration!==void 0&&(this.duration=v(e.duration));const i=e.fpsLimit??e.fps_limit;i!==void 0&&(this.fpsLimit=i),e.pauseOnBlur!==void 0&&(this.pauseOnBlur=e.pauseOnBlur),e.pauseOnOutsideViewport!==void 0&&(this.pauseOnOutsideViewport=e.pauseOnOutsideViewport),e.zLayers!==void 0&&(this.zLayers=e.zLayers),this.background.load(e.background);const n=e.fullScreen??e.backgroundMode;ee(n)?this.fullScreen.enable=n:this.fullScreen.load(n),this.backgroundMask.load(e.backgroundMask),this.interactivity.load(e.interactivity),e.manualParticles&&(this.manualParticles=e.manualParticles.map(r=>{const a=new ts;return a.load(r),a})),this.particles.load(e.particles),this.style=S(this.style,e.style),this._engine.plugins.loadOptions(this,e),e.smooth!==void 0&&(this.smooth=e.smooth);const o=this._engine.plugins.interactors.get(this._container);if(o)for(const r of o)r.loadOptions&&r.loadOptions(this,e);if(e.responsive!==void 0)for(const r of e.responsive){const a=new is;a.load(r),this.responsive.push(a)}if(this.responsive.sort((r,a)=>r.maxWidth-a.maxWidth),e.themes!==void 0)for(const r of e.themes){const a=this.themes.find(l=>l.name===r.name);if(a)a.load(r);else{const l=new ns;l.load(r),this.themes.push(l)}}this.defaultThemes.dark=this._findDefaultTheme("dark")?.name,this.defaultThemes.light=this._findDefaultTheme("light")?.name}setResponsive(e,t,i){this.load(i);const n=this.responsive.find(o=>o.mode==="screen"&&screen?o.maxWidth>screen.availWidth:o.maxWidth*t>e);return this.load(n?.options),n?.maxWidth}setTheme(e){if(e){const t=this.themes.find(i=>i.name===e);t&&this.load(t.options)}else{const t=Et("(prefers-color-scheme: dark)"),i=t&&t.matches,n=this._findDefaultTheme(i?"dark":"light");n&&this.load(n.options)}}}class Ts{constructor(e,t){this.container=t,this._engine=e,this._interactors=e.plugins.getInteractors(this.container,!0),this._externalInteractors=[],this._particleInteractors=[]}async externalInteract(e){for(const t of this._externalInteractors)t.isEnabled()&&await t.interact(e)}handleClickMode(e){for(const t of this._externalInteractors)t.handleClickMode&&t.handleClickMode(e)}init(){this._externalInteractors=[],this._particleInteractors=[];for(const e of this._interactors){switch(e.type){case"external":this._externalInteractors.push(e);break;case"particles":this._particleInteractors.push(e);break}e.init()}}async particlesInteract(e,t){for(const i of this._externalInteractors)i.clear(e,t);for(const i of this._particleInteractors)i.isEnabled(e)&&await i.interact(e,t)}async reset(e){for(const t of this._externalInteractors)t.isEnabled()&&t.reset(e);for(const t of this._particleInteractors)t.isEnabled(e)&&t.reset(e)}}const dt=s=>{if(!C(s.outMode,s.checkModes))return;const e=s.radius*2;s.coord>s.maxCoord-e?s.setCb(-s.radius):s.coord<e&&s.setCb(s.radius)};class Es{constructor(e,t,i,n,o,r){this.container=i,this._calcPosition=(a,l,c,u=0)=>{for(const[,w]of a.plugins){const k=w.particlePosition!==void 0?w.particlePosition(l,this):void 0;if(k)return F.create(k.x,k.y,c)}const h=a.canvas.size,f=wi({size:h,position:l}),d=F.create(f.x,f.y,c),m=this.getRadius(),p=this.options.move.outModes,x=w=>{dt({outMode:w,checkModes:["bounce","bounce-horizontal"],coord:d.x,maxCoord:a.canvas.size.width,setCb:k=>d.x+=k,radius:m})},g=w=>{dt({outMode:w,checkModes:["bounce","bounce-vertical"],coord:d.y,maxCoord:a.canvas.size.height,setCb:k=>d.y+=k,radius:m})};return x(p.left??p.default),x(p.right??p.default),g(p.top??p.default),g(p.bottom??p.default),this._checkOverlap(d,u)?this._calcPosition(a,void 0,c,u+1):d},this._calculateVelocity=()=>{const a=vi(this.direction),l=a.copy(),c=this.options.move;if(c.direction==="inside"||c.direction==="outside")return l;const u=Math.PI/180*y(c.angle.value),h=Math.PI/180*y(c.angle.offset),f={left:h-u/2,right:h+u/2};return c.straight||(l.angle+=R(v(f.left,f.right))),c.random&&typeof c.speed=="number"&&(l.length*=_()),l},this._checkOverlap=(a,l=0)=>{const c=this.options.collisions,u=this.getRadius();if(!c.enable)return!1;const h=c.overlap;if(h.enable)return!1;const f=h.retries;if(f>=0&&l>f)throw new Error(`${W} particle is overlapping and can't be placed`);return!!this.container.particles.find(d=>L(a,d.position)<u+d.getRadius())},this._getRollColor=a=>{if(!a||!this.roll||!this.backColor&&!this.roll.alter)return a;const l=this.roll.horizontal&&this.roll.vertical?2:1,c=this.roll.horizontal?Math.PI/2:0;return Math.floor(((this.roll.angle??0)+c)/(Math.PI/l))%2?this.backColor?this.backColor:this.roll.alter?Hi(a,this.roll.alter.type,this.roll.alter.value):a:a},this._initPosition=a=>{const l=this.container,c=y(this.options.zIndex.value);this.position=this._calcPosition(l,a,X(c,0,l.zLayers)),this.initialPosition=this.position.copy();const u=l.canvas.size;switch(this.moveCenter={...Ut(this.options.move.center,u),radius:this.options.move.center.radius??0,mode:this.options.move.center.mode??"percent"},this.direction=bi(this.options.move.direction,this.position,this.moveCenter),this.options.move.direction){case"inside":this.outType="inside";break;case"outside":this.outType="outside";break}this.offset=P.origin},this._loadShapeData=(a,l)=>{const c=a.options[this.shape];if(c)return S({close:a.close,fill:a.fill},q(c,this.id,l))},this._engine=e,this.init(t,n,o,r)}destroy(e){if(this.unbreakable||this.destroyed)return;this.destroyed=!0,this.bubble.inRange=!1,this.slow.inRange=!1;const t=this.container,i=this.pathGenerator;for(const[,n]of t.plugins)n.particleDestroyed&&n.particleDestroyed(this,e);for(const n of t.particles.updaters)n.particleDestroyed&&n.particleDestroyed(this,e);i&&i.reset(this)}draw(e){const t=this.container;for(const[,i]of t.plugins)t.canvas.drawParticlePlugin(i,this,e);t.canvas.drawParticle(this,e)}getFillColor(){return this._getRollColor(this.bubble.color??ct(this.color))}getMass(){return this.getRadius()**2*Math.PI/2}getPosition(){return{x:this.position.x+this.offset.x,y:this.position.y+this.offset.y,z:this.position.z}}getRadius(){return this.bubble.radius??this.size.value}getStrokeColor(){return this._getRollColor(this.bubble.color??ct(this.strokeColor))}init(e,t,i,n){const o=this.container,r=this._engine;this.id=e,this.group=n,this.fill=!0,this.pathRotation=!1,this.close=!0,this.lastPathTime=0,this.destroyed=!1,this.unbreakable=!1,this.rotation=0,this.misplaced=!1,this.retina={maxDistance:{}},this.outType="normal",this.ignoresResizeRatio=!0;const a=o.retina.pixelRatio,l=o.actualOptions,c=st(this._engine,o,l.particles),u=c.shape.type,{reduceDuplicates:h}=c;this.shape=q(u,this.id,h);const f=c.shape;if(i&&i.shape&&i.shape.type){const k=i.shape.type,b=q(k,this.id,h);b&&(this.shape=b,f.load(i.shape))}this.shapeData=this._loadShapeData(f,h),c.load(i);const d=this.shapeData;d&&c.load(d.particles);const m=new Yt(r,o);m.load(o.actualOptions.interactivity),m.load(c.interactivity),this.interactivity=m,this.fill=d?.fill??c.shape.fill,this.close=d?.close??c.shape.close,this.options=c;const p=this.options.move.path;this.pathDelay=V(p.delay)*1e3,p.generator&&(this.pathGenerator=this._engine.plugins.getPathGenerator(p.generator),this.pathGenerator&&o.addPath(p.generator,this.pathGenerator)&&this.pathGenerator.init(o)),o.retina.initParticle(this),this.size=qt(this.options.size,a),this.bubble={inRange:!1},this.slow={inRange:!1,factor:1},this._initPosition(t),this.initialVelocity=this._calculateVelocity(),this.velocity=this.initialVelocity.copy(),this.moveDecay=1-y(this.options.move.decay);const x=o.particles;x.needsSort=x.needsSort||x.lastZIndex<this.position.z,x.lastZIndex=this.position.z,this.zIndexFactor=this.position.z/o.zLayers,this.sides=24;let g=o.drawers.get(this.shape);g||(g=this._engine.plugins.getShapeDrawer(this.shape),g&&o.drawers.set(this.shape,g)),g&&g.loadShape&&g.loadShape(this);const w=g?.getSidesCount;w&&(this.sides=w(this)),this.spawning=!1,this.shadowColor=H(this.options.shadow.color);for(const k of o.particles.updaters)k.init(this);for(const k of o.particles.movers)k.init&&k.init(this);g&&g.particleInit&&g.particleInit(o,this);for(const[,k]of o.plugins)k.particleCreated&&k.particleCreated(this)}isInsideCanvas(){const e=this.getRadius(),t=this.container.canvas.size,i=this.position;return i.x>=-e&&i.y>=-e&&i.y<=t.height+e&&i.x<=t.width+e}isVisible(){return!this.destroyed&&!this.spawning&&this.isInsideCanvas()}reset(){for(const e of this.container.particles.updaters)e.reset&&e.reset(this)}}class Is{constructor(e,t){this.position=e,this.particle=t}}class Vt{constructor(e,t){this.position={x:e,y:t}}}class Y extends Vt{constructor(e,t,i,n){super(e,t),this.size={height:n,width:i}}contains(e){const t=this.size.width,i=this.size.height,n=this.position;return e.x>=n.x&&e.x<=n.x+t&&e.y>=n.y&&e.y<=n.y+i}intersects(e){e instanceof I&&e.intersects(this);const t=this.size.width,i=this.size.height,n=this.position,o=e.position,r=e instanceof Y?e.size:{width:0,height:0},a=r.width,l=r.height;return o.x<n.x+t&&o.x+a>n.x&&o.y<n.y+i&&o.y+l>n.y}}class I extends Vt{constructor(e,t,i){super(e,t),this.radius=i}contains(e){return L(e,this.position)<=this.radius}intersects(e){const t=this.position,i=e.position,n={x:Math.abs(i.x-t.x),y:Math.abs(i.y-t.y)},o=this.radius;if(e instanceof I){const r=o+e.radius,a=Math.sqrt(n.x**2+n.y**2);return r>a}else if(e instanceof Y){const{width:r,height:a}=e.size;return Math.pow(n.x-r,2)+Math.pow(n.y-a,2)<=o**2||n.x<=o+r&&n.y<=o+a||n.x<=r||n.y<=a}return!1}}class xe{constructor(e,t){this.rectangle=e,this.capacity=t,this._subdivide=()=>{const{x:i,y:n}=this.rectangle.position,{width:o,height:r}=this.rectangle.size,{capacity:a}=this;for(let l=0;l<4;l++)this._subs.push(new xe(new Y(i+o/2*(l%2),n+r/2*(Math.round(l/2)-l%2),o/2,r/2),a));this._divided=!0},this._points=[],this._divided=!1,this._subs=[]}insert(e){return this.rectangle.contains(e.position)?this._points.length<this.capacity?(this._points.push(e),!0):(this._divided||this._subdivide(),this._subs.some(t=>t.insert(e))):!1}query(e,t,i){const n=i||[];if(!e.intersects(this.rectangle))return[];for(const o of this._points)!e.contains(o.position)&&L(e.position,o.position)>o.particle.getRadius()&&(!t||t(o.particle))||n.push(o.particle);if(this._divided)for(const o of this._subs)o.query(e,t,n);return n}queryCircle(e,t,i){return this.query(new I(e.x,e.y,t),i)}queryRectangle(e,t,i){return this.query(new Y(e.x,e.y,t.width,t.height),i)}}const pt=4,mt=s=>new Y(-s.width/4,-s.height/4,s.width*3/2,s.height*3/2);let Ls=class{constructor(e,t){this._applyDensity=(n,o,r)=>{if(!n.number.density?.enable)return;const a=n.number,l=this._initDensityFactor(a.density),c=a.value,u=a.limit>0?a.limit:c,h=Math.min(c,u)*l+o,f=Math.min(this.count,this.filter(d=>d.group===r).length);this.limit=a.limit*l,f<h?this.push(Math.abs(h-f),void 0,n,r):f>h&&this.removeQuantity(f-h,r)},this._initDensityFactor=n=>{const o=this._container;if(!o.canvas.element||!n.enable)return 1;const r=o.canvas.element,a=o.retina.pixelRatio;return r.width*r.height/(n.factor*a**2*n.area)},this._pushParticle=(n,o,r,a)=>{try{let l=this.pool.pop();l?l.init(this._nextId,n,o,r):l=new Es(this._engine,this._nextId,this._container,n,o,r);let c=!0;return a&&(c=a(l)),c?(this._array.push(l),this._zArray.push(l),this._nextId++,this._engine.dispatchEvent("particleAdded",{container:this._container,data:{particle:l}}),l):void 0}catch(l){se().warning(`${W} adding particle: ${l}`);return}},this._removeParticle=(n,o,r)=>{const a=this._array[n];if(!a||a.group!==o)return!1;a.destroy(r);const l=this._zArray.indexOf(a);return this._array.splice(n,1),this._zArray.splice(l,1),this.pool.push(a),this._engine.dispatchEvent("particleRemoved",{container:this._container,data:{particle:a}}),!0},this._engine=e,this._container=t,this._nextId=0,this._array=[],this._zArray=[],this.pool=[],this.limit=0,this.needsSort=!1,this.lastZIndex=0,this._interactionManager=new Ts(e,t);const i=t.canvas.size;this.quadTree=new xe(mt(i),pt),this.movers=this._engine.plugins.getMovers(t,!0),this.updaters=this._engine.plugins.getUpdaters(t,!0)}get count(){return this._array.length}addManualParticles(){const e=this._container,t=e.actualOptions;for(const i of t.manualParticles)this.addParticle(i.position?Ut(i.position,e.canvas.size):void 0,i.options)}addParticle(e,t,i,n){const o=this._container,r=o.actualOptions,a=r.particles.number.limit;if(a>0){const l=this.count+1-a;l>0&&this.removeQuantity(l)}return this._pushParticle(e,t,i,n)}clear(){this._array=[],this._zArray=[]}destroy(){this._array=[],this._zArray=[],this.movers=[],this.updaters=[]}async draw(e){const t=this._container;t.canvas.clear(),await this.update(e);for(const[,i]of t.plugins)t.canvas.drawPlugin(i,e);for(const i of this._zArray)i.draw(e)}filter(e){return this._array.filter(e)}find(e){return this._array.find(e)}handleClickMode(e){this._interactionManager.handleClickMode(e)}init(){const e=this._container,t=e.actualOptions;this.lastZIndex=0,this.needsSort=!1;let i=!1;this.updaters=this._engine.plugins.getUpdaters(e,!0),this._interactionManager.init();for(const[,n]of e.plugins)if(n.particlesInitialization!==void 0&&(i=n.particlesInitialization()),i)break;this._interactionManager.init();for(const[,n]of e.pathGenerators)n.init(e);if(this.addManualParticles(),!i){for(const n in t.particles.groups){const o=t.particles.groups[n];for(let r=this.count,a=0;a<o.number?.value&&r<t.particles.number.value;r++,a++)this.addParticle(void 0,o,n)}for(let n=this.count;n<t.particles.number.value;n++)this.addParticle()}}push(e,t,i,n){this.pushing=!0;for(let o=0;o<e;o++)this.addParticle(t?.position,i,n);this.pushing=!1}async redraw(){this.clear(),this.init(),await this.draw({value:0,factor:0})}remove(e,t,i){this.removeAt(this._array.indexOf(e),void 0,t,i)}removeAt(e,t=1,i,n){if(e<0||e>this.count)return;let o=0;for(let r=e;o<t&&r<this.count;r++)this._removeParticle(r--,i,n)&&o++}removeQuantity(e,t){this.removeAt(0,e,t)}setDensity(){const e=this._container.actualOptions,t=e.particles.groups;for(const i in t)this._applyDensity(t[i],0,i);this._applyDensity(e.particles,e.manualParticles.length)}async update(e){const t=this._container,i=new Set;this.quadTree=new xe(mt(t.canvas.size),pt);for(const[,n]of t.pathGenerators)n.update();for(const[,n]of t.plugins)n.update&&n.update(e);for(const n of this._array){const o=t.canvas.resizeFactor;o&&!n.ignoresResizeRatio&&(n.position.x*=o.width,n.position.y*=o.height,n.initialPosition.x*=o.width,n.initialPosition.y*=o.height),n.ignoresResizeRatio=!1,await this._interactionManager.reset(n);for(const[,r]of this._container.plugins){if(n.destroyed)break;r.particleUpdate&&r.particleUpdate(n,e)}for(const r of this.movers)r.isEnabled(n)&&r.move(n,e);if(n.destroyed){i.add(n);continue}this.quadTree.insert(new Is(n.getPosition(),n))}if(i.size){const n=o=>!i.has(o);this._array=this.filter(n),this._zArray=this._zArray.filter(n),this.pool.push(...i)}await this._interactionManager.externalInteract(e);for(const n of this._array){for(const o of this.updaters)o.update(n,e);!n.destroyed&&!n.spawning&&await this._interactionManager.particlesInteract(n,e)}if(delete t.canvas.resizeFactor,this.needsSort){const n=this._zArray;n.sort((o,r)=>r.position.z-o.position.z||o.id-r.id),this.lastZIndex=n[n.length-1].position.z,this.needsSort=!1}}};class As{constructor(e){this.container=e,this.pixelRatio=1,this.reduceFactor=1}init(){const e=this.container,t=e.actualOptions;this.pixelRatio=!t.detectRetina||le()?1:window.devicePixelRatio,this.reduceFactor=1;const i=this.pixelRatio;if(e.canvas.element){const r=e.canvas.element;e.canvas.size.width=r.offsetWidth*i,e.canvas.size.height=r.offsetHeight*i}const n=t.particles,o=n.move;this.attractDistance=y(o.attract.distance)*i,this.maxSpeed=y(o.gravity.maxSpeed)*i,this.sizeAnimationSpeed=y(n.size.animation.speed)*i}initParticle(e){const t=e.options,i=this.pixelRatio,n=t.move,o=n.distance,r=e.retina;r.attractDistance=y(n.attract.distance)*i,r.moveDrift=y(n.drift)*i,r.moveSpeed=y(n.speed)*i,r.sizeAnimationSpeed=y(t.size.animation.speed)*i;const a=r.maxDistance;a.horizontal=o.horizontal!==void 0?o.horizontal*i:void 0,a.vertical=o.vertical!==void 0?o.vertical*i:void 0,r.maxSpeed=y(n.gravity.maxSpeed)*i}}function z(s){return s&&!s.destroyed}function Fs(s,e=60,t=!1){return{value:s,factor:t?60/e:60*s/1e3}}function oe(s,e,...t){const i=new Rs(s,e);return Qt(i,...t),i}const qs="default",yt={generate:s=>s.velocity,init:()=>{},update:()=>{},reset:()=>{}};class Bs{constructor(e,t,i){this.id=t,this._intersectionManager=n=>{if(!(!z(this)||!this.actualOptions.pauseOnOutsideViewport))for(const o of n)o.target===this.interactivity.element&&(o.isIntersecting?this.play:this.pause)()},this._nextFrame=async n=>{try{if(!this.smooth&&this.lastFrameTime!==void 0&&n<this.lastFrameTime+1e3/this.fpsLimit){this.draw(!1);return}this.lastFrameTime??=n;const o=Fs(n-this.lastFrameTime,this.fpsLimit,this.smooth);if(this.addLifeTime(o.value),this.lastFrameTime=n,o.value>1e3){this.draw(!1);return}if(await this.particles.draw(o),!this.alive()){this.destroy();return}this.getAnimationStatus()&&this.draw(!1)}catch(o){se().error(`${W} in animation loop`,o)}},this._engine=e,this.fpsLimit=120,this.smooth=!1,this._delay=0,this._duration=0,this._lifeTime=0,this._firstStart=!0,this.started=!1,this.destroyed=!1,this._paused=!0,this.lastFrameTime=0,this.zLayers=100,this.pageHidden=!1,this._sourceOptions=i,this._initialSourceOptions=i,this.retina=new As(this),this.canvas=new $i(this),this.particles=new Ls(this._engine,this),this.pathGenerators=new Map,this.interactivity={mouse:{clicking:!1,inside:!1}},this.plugins=new Map,this.drawers=new Map,this._options=oe(this._engine,this),this.actualOptions=oe(this._engine,this),this._eventListeners=new Gi(this),typeof IntersectionObserver<"u"&&IntersectionObserver&&(this._intersectionObserver=new IntersectionObserver(n=>this._intersectionManager(n))),this._engine.dispatchEvent("containerBuilt",{container:this})}get options(){return this._options}get sourceOptions(){return this._sourceOptions}addClickHandler(e){if(!z(this))return;const t=this.interactivity.element;if(!t)return;const i=(h,f,d)=>{if(!z(this))return;const m=this.retina.pixelRatio,p={x:f.x*m,y:f.y*m},x=this.particles.quadTree.queryCircle(p,d*m);e(h,x)},n=h=>{if(!z(this))return;const f=h,d={x:f.offsetX||f.clientX,y:f.offsetY||f.clientY};i(h,d,1)},o=()=>{z(this)&&(c=!0,u=!1)},r=()=>{z(this)&&(u=!0)},a=h=>{if(z(this)){if(c&&!u){const f=h;let d=f.touches[f.touches.length-1];if(!d&&(d=f.changedTouches[f.changedTouches.length-1],!d))return;const m=this.canvas.element,p=m?m.getBoundingClientRect():void 0,x={x:d.clientX-(p?p.left:0),y:d.clientY-(p?p.top:0)};i(h,x,Math.max(d.radiusX,d.radiusY))}c=!1,u=!1}},l=()=>{z(this)&&(c=!1,u=!1)};let c=!1,u=!1;t.addEventListener("click",n),t.addEventListener("touchstart",o),t.addEventListener("touchmove",r),t.addEventListener("touchend",a),t.addEventListener("touchcancel",l)}addLifeTime(e){this._lifeTime+=e}addPath(e,t,i=!1){return!z(this)||!i&&this.pathGenerators.has(e)?!1:(this.pathGenerators.set(e,t??yt),!0)}alive(){return!this._duration||this._lifeTime<=this._duration}destroy(){if(!z(this))return;this.stop(),this.particles.destroy(),this.canvas.destroy();for(const[,i]of this.drawers)i.destroy&&i.destroy(this);for(const i of this.drawers.keys())this.drawers.delete(i);this._engine.plugins.destroy(this),this.destroyed=!0;const e=this._engine.dom(),t=e.findIndex(i=>i===this);t>=0&&e.splice(t,1),this._engine.dispatchEvent("containerDestroyed",{container:this})}draw(e){if(!z(this))return;let t=e;this._drawAnimationFrame=requestAnimationFrame(async i=>{t&&(this.lastFrameTime=void 0,t=!1),await this._nextFrame(i)})}async export(e,t={}){for(const[,i]of this.plugins){if(!i.export)continue;const n=await i.export(e,t);if(n.supported)return n.blob}se().error(`${W} - Export plugin with type ${e} not found`)}getAnimationStatus(){return!this._paused&&!this.pageHidden&&z(this)}handleClickMode(e){if(z(this)){this.particles.handleClickMode(e);for(const[,t]of this.plugins)t.handleClickMode&&t.handleClickMode(e)}}async init(){if(!z(this))return;const e=this._engine.plugins.getSupportedShapes();for(const i of e){const n=this._engine.plugins.getShapeDrawer(i);n&&this.drawers.set(i,n)}this._options=oe(this._engine,this,this._initialSourceOptions,this.sourceOptions),this.actualOptions=oe(this._engine,this,this._options);const t=this._engine.plugins.getAvailablePlugins(this);for(const[i,n]of t)this.plugins.set(i,n);this.retina.init(),await this.canvas.init(),this.updateActualOptions(),this.canvas.initBackground(),this.canvas.resize(),this.zLayers=this.actualOptions.zLayers,this._duration=y(this.actualOptions.duration)*1e3,this._delay=y(this.actualOptions.delay)*1e3,this._lifeTime=0,this.fpsLimit=this.actualOptions.fpsLimit>0?this.actualOptions.fpsLimit:120,this.smooth=this.actualOptions.smooth;for(const[,i]of this.drawers)i.init&&await i.init(this);for(const[,i]of this.plugins)i.init&&await i.init();this._engine.dispatchEvent("containerInit",{container:this}),this.particles.init(),this.particles.setDensity();for(const[,i]of this.plugins)i.particlesSetup&&i.particlesSetup();this._engine.dispatchEvent("particlesSetup",{container:this})}async loadTheme(e){z(this)&&(this._currentTheme=e,await this.refresh())}pause(){if(z(this)&&(this._drawAnimationFrame!==void 0&&(cancelAnimationFrame(this._drawAnimationFrame),delete this._drawAnimationFrame),!this._paused)){for(const[,e]of this.plugins)e.pause&&e.pause();this.pageHidden||(this._paused=!0),this._engine.dispatchEvent("containerPaused",{container:this})}}play(e){if(!z(this))return;const t=this._paused||e;if(this._firstStart&&!this.actualOptions.autoPlay){this._firstStart=!1;return}if(this._paused&&(this._paused=!1),t)for(const[,i]of this.plugins)i.play&&i.play();this._engine.dispatchEvent("containerPlay",{container:this}),this.draw(t||!1)}async refresh(){if(z(this))return this.stop(),this.start()}async reset(){if(z(this))return this._initialSourceOptions=void 0,this._options=oe(this._engine,this),this.actualOptions=oe(this._engine,this,this._options),this.refresh()}setNoise(e,t,i){z(this)&&this.setPath(e,t,i)}setPath(e,t,i){if(!e||!z(this))return;const n={...yt};if(Ht(e))n.generate=e,t&&(n.init=t),i&&(n.update=i);else{const o=n;n.generate=e.generate||o.generate,n.init=e.init||o.init,n.update=e.update||o.update}this.addPath(qs,n,!0)}async start(){!z(this)||this.started||(await this.init(),this.started=!0,await new Promise(e=>{this._delayTimeout=setTimeout(async()=>{this._eventListeners.addListeners(),this.interactivity.element instanceof HTMLElement&&this._intersectionObserver&&this._intersectionObserver.observe(this.interactivity.element);for(const[,t]of this.plugins)t.start&&await t.start();this._engine.dispatchEvent("containerStarted",{container:this}),this.play(),e()},this._delay)}))}stop(){if(!(!z(this)||!this.started)){this._delayTimeout&&(clearTimeout(this._delayTimeout),delete this._delayTimeout),this._firstStart=!0,this.started=!1,this._eventListeners.removeListeners(),this.pause(),this.particles.clear(),this.canvas.stop(),this.interactivity.element instanceof HTMLElement&&this._intersectionObserver&&this._intersectionObserver.unobserve(this.interactivity.element);for(const[,e]of this.plugins)e.stop&&e.stop();for(const e of this.plugins.keys())this.plugins.delete(e);this._sourceOptions=this._options,this._engine.dispatchEvent("containerStopped",{container:this})}}updateActualOptions(){this.actualOptions.responsive=[];const e=this.actualOptions.setResponsive(this.canvas.size.width,this.retina.pixelRatio,this._options);return this.actualOptions.setTheme(this._currentTheme),this.responsiveMaxWidth===e?!1:(this.responsiveMaxWidth=e,!0)}}class Us{constructor(){this._listeners=new Map}addEventListener(e,t){this.removeEventListener(e,t);let i=this._listeners.get(e);i||(i=[],this._listeners.set(e,i)),i.push(t)}dispatchEvent(e,t){const i=this._listeners.get(e);i&&i.forEach(n=>n(t))}hasEventListener(e){return!!this._listeners.get(e)}removeAllEventListeners(e){e?this._listeners.delete(e):this._listeners=new Map}removeEventListener(e,t){const i=this._listeners.get(e);if(!i)return;const n=i.length,o=i.indexOf(t);o<0||(n===1?this._listeners.delete(e):i.splice(o,1))}}function We(s,e,t,i=!1){let n=e.get(s);return(!n||i)&&(n=[...t.values()].map(o=>o(s)),e.set(s,n)),n}class Hs{constructor(e){this._engine=e,this.plugins=[],this._initializers={interactors:new Map,movers:new Map,updaters:new Map},this.interactors=new Map,this.movers=new Map,this.updaters=new Map,this.presets=new Map,this.drawers=new Map,this.pathGenerators=new Map}addInteractor(e,t){this._initializers.interactors.set(e,t)}addParticleMover(e,t){this._initializers.movers.set(e,t)}addParticleUpdater(e,t){this._initializers.updaters.set(e,t)}addPathGenerator(e,t){!this.getPathGenerator(e)&&this.pathGenerators.set(e,t)}addPlugin(e){!this.getPlugin(e.id)&&this.plugins.push(e)}addPreset(e,t,i=!1){(i||!this.getPreset(e))&&this.presets.set(e,t)}addShapeDrawer(e,t){M(e,i=>{!this.getShapeDrawer(i)&&this.drawers.set(i,t)})}destroy(e){this.updaters.delete(e),this.movers.delete(e),this.interactors.delete(e)}getAvailablePlugins(e){const t=new Map;for(const i of this.plugins)i.needsPlugin(e.actualOptions)&&t.set(i.id,i.getPlugin(e));return t}getInteractors(e,t=!1){return We(e,this.interactors,this._initializers.interactors,t)}getMovers(e,t=!1){return We(e,this.movers,this._initializers.movers,t)}getPathGenerator(e){return this.pathGenerators.get(e)}getPlugin(e){return this.plugins.find(t=>t.id===e)}getPreset(e){return this.presets.get(e)}getShapeDrawer(e){return this.drawers.get(e)}getSupportedShapes(){return this.drawers.keys()}getUpdaters(e,t=!1){return We(e,this.updaters,this._initializers.updaters,t)}loadOptions(e,t){for(const i of this.plugins)i.loadOptions(e,t)}loadParticlesOptions(e,t,...i){const n=this.updaters.get(e);if(n)for(const o of n)o.loadOptions&&o.loadOptions(t,...i)}}async function Ws(s){const e=q(s.url,s.index);if(!e)return s.fallback;const t=await fetch(e);return t.ok?t.json():(se().error(`${W} ${t.status} while retrieving config file`),s.fallback)}function $s(s){return!s.id&&!s.element&&!s.url&&!s.options}function Gs(s){return!$s(s)}class Ns{constructor(){this._configs=new Map,this._domArray=[],this._eventDispatcher=new Us,this._initialized=!1,this.plugins=new Hs(this)}get configs(){const e={};for(const[t,i]of this._configs)e[t]=i;return e}get version(){return"2.12.0"}addConfig(e,t){N(e)?t&&(t.name=e,this._configs.set(e,t)):this._configs.set(e.name??"default",e)}addEventListener(e,t){this._eventDispatcher.addEventListener(e,t)}async addInteractor(e,t,i=!0){this.plugins.addInteractor(e,t),await this.refresh(i)}async addMover(e,t,i=!0){this.plugins.addParticleMover(e,t),await this.refresh(i)}async addParticleUpdater(e,t,i=!0){this.plugins.addParticleUpdater(e,t),await this.refresh(i)}async addPathGenerator(e,t,i=!0){this.plugins.addPathGenerator(e,t),await this.refresh(i)}async addPlugin(e,t=!0){this.plugins.addPlugin(e),await this.refresh(t)}async addPreset(e,t,i=!1,n=!0){this.plugins.addPreset(e,t,i),await this.refresh(n)}async addShape(e,t,i,n,o,r=!0){let a,l=r,c,u,h;ee(i)?(l=i,c=void 0):c=i,ee(n)?(l=n,u=void 0):u=n,ee(o)?(l=o,h=void 0):h=o,Ht(t)?a={afterEffect:u,destroy:h,draw:t,init:c}:a=t,this.plugins.addShapeDrawer(e,a),await this.refresh(l)}dispatchEvent(e,t){this._eventDispatcher.dispatchEvent(e,t)}dom(){return this._domArray}domItem(e){const t=this.dom(),i=t[e];if(!i||i.destroyed){t.splice(e,1);return}return i}init(){this._initialized||(this._initialized=!0)}async load(e,t){return this.loadFromArray(e,t)}async loadFromArray(e,t,i){let n;return Gs(e)?n=e:(n={},N(e)?n.id=e:n.options=e,E(t)?n.index=t:n.options=t??n.options,n.index=i??n.index),this._loadParams(n)}async loadJSON(e,t,i){let n,o;return E(t)||t===void 0?n=e:(o=e,n=t),this._loadParams({id:o,url:n,index:i})}async refresh(e=!0){e&&this.dom().forEach(t=>t.refresh())}removeEventListener(e,t){this._eventDispatcher.removeEventListener(e,t)}async set(e,t,i,n){const o={index:n};return N(e)?o.id=e:o.element=e,t instanceof HTMLElement?o.element=t:o.options=t,E(i)?o.index=i:o.options=i??o.options,this._loadParams(o)}async setJSON(e,t,i,n){const o={};return e instanceof HTMLElement?(o.element=e,o.url=t,o.index=i):(o.id=e,o.element=t,o.url=i,o.index=n),this._loadParams(o)}setOnClickHandler(e){const t=this.dom();if(!t.length)throw new Error(`${W} can only set click handlers after calling tsParticles.load()`);for(const i of t)i.addClickHandler(e)}async _loadParams(e){const t=e.id??`tsparticles${Math.floor(_()*1e4)}`,{index:i,url:n}=e,o=n?await Ws({fallback:e.options,url:n,index:i}):e.options;let r=e.element??document.getElementById(t);r||(r=document.createElement("div"),r.id=t,document.body.append(r));const a=q(o,i),l=this.dom(),c=l.findIndex(f=>f.id===t);if(c>=0){const f=this.domItem(c);f&&!f.destroyed&&(f.destroy(),l.splice(c,1))}let u;if(r.tagName.toLowerCase()==="canvas")u=r,u.dataset[fe]="false";else{const f=r.getElementsByTagName("canvas");f.length?(u=f[0],u.dataset[fe]="false"):(u=document.createElement("canvas"),u.dataset[fe]="true",r.appendChild(u))}u.style.width||(u.style.width="100%"),u.style.height||(u.style.height="100%");const h=new Bs(this,t,a);return c>=0?l.splice(c,0,h):l.push(h),h.canvas.loadCanvas(u),await h.start(),h}}class Xs{constructor(){this.key="hsl",this.stringPrefix="hsl"}handleColor(e){const t=e.value,i=t.hsl??e.value;if(i.h!==void 0&&i.s!==void 0&&i.l!==void 0)return ce(i)}handleRangeColor(e){const t=e.value,i=t.hsl??e.value;if(i.h!==void 0&&i.l!==void 0)return ce({h:y(i.h),l:y(i.l),s:y(i.s)})}parseString(e){if(!e.startsWith("hsl"))return;const t=/hsla?\(\s*(\d+)\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(,\s*([\d.%]+)\s*)?\)/i,i=t.exec(e);return i?Ti({a:i.length>4?Tt(i[5]):1,h:parseInt(i[1],10),l:parseInt(i[3],10),s:parseInt(i[2],10)}):void 0}}class Ys{constructor(){this.key="rgb",this.stringPrefix="rgb"}handleColor(e){const t=e.value,i=t.rgb??e.value;if(i.r!==void 0)return i}handleRangeColor(e){const t=e.value,i=t.rgb??e.value;if(i.r!==void 0)return{r:y(i.r),g:y(i.g),b:y(i.b)}}parseString(e){if(!e.startsWith(this.stringPrefix))return;const t=/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([\d.%]+)\s*)?\)/i,i=t.exec(e);return i?{a:i.length>4?Tt(i[5]):1,b:parseInt(i[3],10),g:parseInt(i[2],10),r:parseInt(i[1],10)}:void 0}}function js(){const s=new Ys,e=new Xs;lt(s),lt(e);const t=new Ns;return t.init(),t}class j{constructor(e){this.container=e,this.type="external"}}class nt{constructor(e){this.container=e,this.type="particles"}}const pe=js();le()||(window.tsParticles=pe);class Js{constructor(){this.radius=0,this.mass=0}load(e){e&&(e.mass!==void 0&&(this.mass=e.mass),e.radius!==void 0&&(this.radius=e.radius))}}class Qs extends ${constructor(){super(),this.density=5,this.value=50,this.limit=new Js}load(e){e&&(super.load(e),e.density!==void 0&&(this.density=e.density),E(e.limit)?this.limit.radius=e.limit:this.limit.load(e.limit))}}class _e{constructor(){this.color=new O,this.color.value="#000000",this.draggable=!1,this.opacity=1,this.destroy=!0,this.orbits=!1,this.size=new Qs}load(e){e!==void 0&&(e.color!==void 0&&(this.color=O.create(this.color,e.color)),e.draggable!==void 0&&(this.draggable=e.draggable),this.name=e.name,e.opacity!==void 0&&(this.opacity=e.opacity),e.position!==void 0&&(this.position={},e.position.x!==void 0&&(this.position.x=v(e.position.x)),e.position.y!==void 0&&(this.position.y=v(e.position.y))),e.size!==void 0&&this.size.load(e.size),e.destroy!==void 0&&(this.destroy=e.destroy),e.orbits!==void 0&&(this.orbits=e.orbits))}}class Vs{constructor(e,t,i,n){this.absorbers=e,this.container=t,this._calcPosition=()=>{const r=Rt({size:this.container.canvas.size,position:this.options.position});return P.create(r.x,r.y)},this._updateParticlePosition=(r,a)=>{if(r.destroyed)return;const l=this.container,c=l.canvas.size;if(r.needsNewPosition){const u=Dt({size:c});r.position.setTo(u),r.velocity.setTo(r.initialVelocity),r.absorberOrbit=void 0,r.needsNewPosition=!1}if(this.options.orbits){if(r.absorberOrbit===void 0&&(r.absorberOrbit=P.create(0,0),r.absorberOrbit.length=L(r.getPosition(),this.position),r.absorberOrbit.angle=_()*Math.PI*2),r.absorberOrbit.length<=this.size&&!this.options.destroy){const m=Math.min(c.width,c.height);r.absorberOrbit.length=m*(1+(_()*.2-.1))}r.absorberOrbitDirection===void 0&&(r.absorberOrbitDirection=r.velocity.x>=0?"clockwise":"counter-clockwise");const u=r.absorberOrbit.length,h=r.absorberOrbit.angle,f=r.absorberOrbitDirection;r.velocity.setTo(P.origin);const d={x:f==="clockwise"?Math.cos:Math.sin,y:f==="clockwise"?Math.sin:Math.cos};r.position.x=this.position.x+u*d.x(h),r.position.y=this.position.y+u*d.y(h),r.absorberOrbit.length-=a.length,r.absorberOrbit.angle+=(r.retina.moveSpeed??0)*l.retina.pixelRatio/100*l.retina.reduceFactor}else{const u=P.origin;u.length=a.length,u.angle=a.angle,r.velocity.addTo(u)}},this.initialPosition=n?P.create(n.x,n.y):void 0,i instanceof _e?this.options=i:(this.options=new _e,this.options.load(i)),this.dragging=!1,this.name=this.options.name,this.opacity=this.options.opacity,this.size=y(this.options.size.value)*t.retina.pixelRatio,this.mass=this.size*this.options.size.density*t.retina.reduceFactor;const o=this.options.size.limit;this.limit={radius:o.radius*t.retina.pixelRatio*t.retina.reduceFactor,mass:o.mass},this.color=H(this.options.color)??{b:0,g:0,r:0},this.position=this.initialPosition?.copy()??this._calcPosition()}attract(e){const t=this.container,i=this.options;if(i.draggable){const c=t.interactivity.mouse;c.clicking&&c.downPosition?L(this.position,c.downPosition)<=this.size&&(this.dragging=!0):this.dragging=!1,this.dragging&&c.position&&(this.position.x=c.position.x,this.position.y=c.position.y)}const n=e.getPosition(),{dx:o,dy:r,distance:a}=T(this.position,n),l=P.create(o,r);if(l.length=this.mass/Math.pow(a,2)*t.retina.reduceFactor,a<this.size+e.getRadius()){const c=e.getRadius()*.033*t.retina.pixelRatio;this.size>e.getRadius()&&a<this.size-e.getRadius()||e.absorberOrbit!==void 0&&e.absorberOrbit.length<0?i.destroy?e.destroy():(e.needsNewPosition=!0,this._updateParticlePosition(e,l)):(i.destroy&&(e.size.value-=c),this._updateParticlePosition(e,l)),(this.limit.radius<=0||this.size<this.limit.radius)&&(this.size+=c),(this.limit.mass<=0||this.mass<this.limit.mass)&&(this.mass+=c*this.options.size.density*t.retina.reduceFactor)}else this._updateParticlePosition(e,l)}draw(e){e.translate(this.position.x,this.position.y),e.beginPath(),e.arc(0,0,this.size,0,Math.PI*2,!1),e.closePath(),e.fillStyle=J(this.color,this.opacity),e.fill()}resize(){const e=this.initialPosition;this.position=e&&ye(e,this.container.canvas.size,P.origin)?e:this._calcPosition()}}class Zs{constructor(e){this.container=e,this.array=[],this.absorbers=[],this.interactivityAbsorbers=[],e.getAbsorber=t=>t===void 0||E(t)?this.array[t||0]:this.array.find(i=>i.name===t),e.addAbsorber=(t,i)=>this.addAbsorber(t,i)}addAbsorber(e,t){const i=new Vs(this,this.container,e,t);return this.array.push(i),i}draw(e){for(const t of this.array)t.draw(e)}handleClickMode(e){const t=this.absorbers,i=this.interactivityAbsorbers;if(e==="absorber"){const n=q(i),o=n??q(t),r=this.container.interactivity.mouse.clickPosition;this.addAbsorber(o,r)}}async init(){this.absorbers=this.container.actualOptions.absorbers,this.interactivityAbsorbers=this.container.actualOptions.interactivity.modes.absorbers,M(this.absorbers,e=>{this.addAbsorber(e)})}particleUpdate(e){for(const t of this.array)if(t.attract(e),e.destroyed)break}removeAbsorber(e){const t=this.array.indexOf(e);t>=0&&this.array.splice(t,1)}resize(){for(const e of this.array)e.resize()}stop(){this.array=[]}}class Ks{constructor(){this.id="absorbers"}getPlugin(e){return new Zs(e)}loadOptions(e,t){!this.needsPlugin(e)&&!this.needsPlugin(t)||(t?.absorbers&&(e.absorbers=M(t.absorbers,i=>{const n=new _e;return n.load(i),n})),e.interactivity.modes.absorbers=M(t?.interactivity?.modes?.absorbers,i=>{const n=new _e;return n.load(i),n}))}needsPlugin(e){if(!e)return!1;const t=e.absorbers;return D(t)?!!t.length:t?!0:!!(e.interactivity?.events?.onClick?.mode&&C("absorber",e.interactivity.events.onClick.mode))}}async function en(s,e=!0){await s.addPlugin(new Ks,e)}class tn{load(e){e&&(e.bottom!==void 0&&(this.bottom=v(e.bottom)),e.left!==void 0&&(this.left=v(e.left)),e.right!==void 0&&(this.right=v(e.right)),e.top!==void 0&&(this.top=v(e.top)))}}class sn extends ${constructor(){super(),this.value=3}}class nn extends ${constructor(){super(),this.value={min:4,max:9}}}class on{constructor(){this.count=1,this.factor=new sn,this.rate=new nn,this.sizeOffset=!0}load(e){e&&(e.color!==void 0&&(this.color=O.create(this.color,e.color)),e.count!==void 0&&(this.count=e.count),this.factor.load(e.factor),this.rate.load(e.rate),this.particles=M(e.particles,t=>S({},t)),e.sizeOffset!==void 0&&(this.sizeOffset=e.sizeOffset),e.colorOffset&&(this.colorOffset=this.colorOffset??{},e.colorOffset.h!==void 0&&(this.colorOffset.h=e.colorOffset.h),e.colorOffset.s!==void 0&&(this.colorOffset.s=e.colorOffset.s),e.colorOffset.l!==void 0&&(this.colorOffset.l=e.colorOffset.l)))}}class rn{constructor(){this.bounds=new tn,this.mode="none",this.split=new on}load(e){e&&(e.mode&&(this.mode=e.mode),e.bounds&&this.bounds.load(e.bounds),this.split.load(e.split))}}function an(s,e,t,i){const n=t.options.destroy;if(!n)return;const o=n.split,r=st(s,e,t.options),a=V(o.factor),l=t.getFillColor();o.color?r.color.load(o.color):o.colorOffset&&l?r.color.load({value:{hsl:{h:l.h+y(o.colorOffset.h??0),s:l.s+y(o.colorOffset.s??0),l:l.l+y(o.colorOffset.l??0)}}}):r.color.load({value:{hsl:t.getFillColor()}}),r.move.load({center:{x:t.position.x,y:t.position.y,mode:"precise"}}),E(r.size.value)?r.size.value/=a:(r.size.value.min/=a,r.size.value.max/=a),r.load(i);const c=o.sizeOffset?v(-t.size.value,t.size.value):0,u={x:t.position.x+R(c),y:t.position.y+R(c)};return e.particles.addParticle(u,r,t.group,h=>h.size.value<.5?!1:(h.velocity.length=R(v(t.velocity.length,h.velocity.length)),h.splitCount=(t.splitCount??0)+1,h.unbreakable=!0,setTimeout(()=>{h.unbreakable=!1},500),!0))}function ln(s,e,t){const i=t.options.destroy;if(!i)return;const n=i.split;if(n.count>=0&&(t.splitCount===void 0||t.splitCount++>n.count))return;const o=V(n.rate),r=q(n.particles);for(let a=0;a<o;a++)an(s,e,t,r)}class cn{constructor(e,t){this.engine=e,this.container=t}init(e){const t=this.container,i=e.options,n=i.destroy;if(!n)return;e.splitCount=0;const o=n.bounds;e.destroyBounds||(e.destroyBounds={});const{bottom:r,left:a,right:l,top:c}=o,{destroyBounds:u}=e,h=t.canvas.size;r&&(u.bottom=y(r)*h.height/100),a&&(u.left=y(a)*h.width/100),l&&(u.right=y(l)*h.width/100),c&&(u.top=y(c)*h.height/100)}isEnabled(e){return!e.destroyed}loadOptions(e,...t){e.destroy||(e.destroy=new rn);for(const i of t)e.destroy.load(i?.destroy)}particleDestroyed(e,t){if(t)return;const i=e.options.destroy;i&&i.mode==="split"&&ln(this.engine,this.container,e)}update(e){if(!this.isEnabled(e))return;const t=e.getPosition(),i=e.destroyBounds;i&&(i.bottom!==void 0&&t.y>=i.bottom||i.left!==void 0&&t.x<=i.left||i.right!==void 0&&t.x>=i.right||i.top!==void 0&&t.y<=i.top)&&e.destroy()}}async function un(s,e=!0){await s.addParticleUpdater("destroy",t=>new cn(s,t),e)}class hn{randomPosition(e,t,i){const n=(h,f)=>{const d=_()/4,m=Math.atan(f/h*Math.tan(2*Math.PI*d)),p=_();return p<.25?m:p<.5?Math.PI-m:p<.75?Math.PI+m:-m},o=(h,f,d)=>h*f/Math.sqrt((f*Math.cos(d))**2+(h*Math.sin(d))**2),[r,a]=[t.width/2,t.height/2],l=n(r,a),c=o(r,a,l),u=i?c*Math.sqrt(_()):c;return{x:e.x+u*Math.cos(l),y:e.y+u*Math.sin(l)}}}class fn{constructor(){this.wait=!1}load(e){e&&(e.count!==void 0&&(this.count=e.count),e.delay!==void 0&&(this.delay=v(e.delay)),e.duration!==void 0&&(this.duration=v(e.duration)),e.wait!==void 0&&(this.wait=e.wait))}}class dn{constructor(){this.quantity=1,this.delay=.1}load(e){e!==void 0&&(e.quantity!==void 0&&(this.quantity=v(e.quantity)),e.delay!==void 0&&(this.delay=v(e.delay)))}}class Zt{constructor(){this.mode="percent",this.height=0,this.width=0}load(e){e!==void 0&&(e.mode!==void 0&&(this.mode=e.mode),e.height!==void 0&&(this.height=e.height),e.width!==void 0&&(this.width=e.width))}}class Z{constructor(){this.autoPlay=!0,this.fill=!0,this.life=new fn,this.rate=new dn,this.shape="square",this.startCount=0}load(e){e&&(e.autoPlay!==void 0&&(this.autoPlay=e.autoPlay),e.size!==void 0&&(this.size||(this.size=new Zt),this.size.load(e.size)),e.direction!==void 0&&(this.direction=e.direction),this.domId=e.domId,e.fill!==void 0&&(this.fill=e.fill),this.life.load(e.life),this.name=e.name,this.particles=M(e.particles,t=>S({},t)),this.rate.load(e.rate),e.shape!==void 0&&(this.shape=e.shape),e.position!==void 0&&(this.position={},e.position.x!==void 0&&(this.position.x=v(e.position.x)),e.position.y!==void 0&&(this.position.y=v(e.position.y))),e.spawnColor!==void 0&&(this.spawnColor===void 0&&(this.spawnColor=new he),this.spawnColor.load(e.spawnColor)),e.startCount!==void 0&&(this.startCount=e.startCount))}}class pn{constructor(e,t,i,n,o){this.emitters=t,this.container=i,this._calcPosition=()=>Rt({size:this.container.canvas.size,position:this.options.position}),this._destroy=()=>{this.emitters.removeEmitter(this),this._engine.dispatchEvent("emitterDestroyed",{container:this.container,data:{emitter:this}})},this._emit=()=>{if(this._paused)return;const a=y(this.options.rate.quantity);this._emitParticles(a)},this._emitParticles=a=>{const l=this.getPosition(),c=this.getSize(),u=q(this._particlesOptions);for(let h=0;h<a;h++){const f=S({},u);if(this.spawnColor){const m=this.options.spawnColor?.animation;m&&(this.spawnColor.h=this._setColorAnimation(m.h,this.spawnColor.h,360),this.spawnColor.s=this._setColorAnimation(m.s,this.spawnColor.s,100),this.spawnColor.l=this._setColorAnimation(m.l,this.spawnColor.l,100)),f.color?f.color.value=this.spawnColor:f.color={value:this.spawnColor}}if(!l)return;const d=this._shape?.randomPosition(l,c,this.fill)??l;this.container.particles.addParticle(d,f)}},this._prepareToDie=()=>{if(this._paused)return;const a=this.options.life?.duration!==void 0?y(this.options.life.duration):void 0;this.container.retina.reduceFactor&&(this._lifeCount>0||this._immortal)&&a!==void 0&&a>0&&(this._duration=a*1e3)},this._setColorAnimation=(a,l,c)=>{const u=this.container;if(!a.enable)return l;const h=R(a.offset),f=y(this.options.rate.delay),d=1e3*f/u.retina.reduceFactor,m=y(a.speed??0);return(l+m*u.fpsLimit/d+h*3.6)%c},this._engine=e,this._currentDuration=0,this._currentEmitDelay=0,this._currentSpawnDelay=0,this._initialPosition=o,n instanceof Z?this.options=n:(this.options=new Z,this.options.load(n)),this._spawnDelay=y(this.options.life.delay??0)*1e3/this.container.retina.reduceFactor,this.position=this._initialPosition??this._calcPosition(),this.name=this.options.name,this._shape=this._engine.emitterShapeManager?.getShape(this.options.shape),this.fill=this.options.fill,this._firstSpawn=!this.options.life.wait,this._startParticlesAdded=!1;let r=S({},this.options.particles);r??={},r.move??={},r.move.direction??=this.options.direction,this.options.spawnColor&&(this.spawnColor=te(this.options.spawnColor)),this._paused=!this.options.autoPlay,this._particlesOptions=r,this.size=this.options.size??(()=>{const a=new Zt;return a.load({height:0,mode:"percent",width:0}),a})(),this._lifeCount=this.options.life.count??-1,this._immortal=this._lifeCount<=0,this._engine.dispatchEvent("emitterCreated",{container:i,data:{emitter:this}}),this.play()}externalPause(){this._paused=!0,this.pause()}externalPlay(){this._paused=!1,this.play()}getPosition(){if(this.options.domId){const e=this.container,t=document.getElementById(this.options.domId);if(t){const i=t.getBoundingClientRect();return{x:(i.x+i.width/2)*e.retina.pixelRatio,y:(i.y+i.height/2)*e.retina.pixelRatio}}}return this.position}getSize(){const e=this.container;if(this.options.domId){const t=document.getElementById(this.options.domId);if(t){const i=t.getBoundingClientRect();return{width:i.width*e.retina.pixelRatio,height:i.height*e.retina.pixelRatio}}}return Si(this.size,e.canvas.size)}pause(){this._paused||delete this._emitDelay}play(){if(!this._paused&&this.container.retina.reduceFactor&&(this._lifeCount>0||this._immortal||!this.options.life.count)&&(this._firstSpawn||this._currentSpawnDelay>=(this._spawnDelay??0))){if(this._emitDelay===void 0){const e=y(this.options.rate.delay);this._emitDelay=1e3*e/this.container.retina.reduceFactor}(this._lifeCount>0||this._immortal)&&this._prepareToDie()}}resize(){const e=this._initialPosition;this.position=e&&ye(e,this.container.canvas.size,P.origin)?e:this._calcPosition()}update(e){this._paused||(this._firstSpawn&&(this._firstSpawn=!1,this._currentSpawnDelay=this._spawnDelay??0,this._currentEmitDelay=this._emitDelay??0),this._startParticlesAdded||(this._startParticlesAdded=!0,this._emitParticles(this.options.startCount)),this._duration!==void 0&&(this._currentDuration+=e.value,this._currentDuration>=this._duration&&(this.pause(),this._spawnDelay!==void 0&&delete this._spawnDelay,this._immortal||this._lifeCount--,this._lifeCount>0||this._immortal?(this.position=this._calcPosition(),this._spawnDelay=y(this.options.life.delay??0)*1e3/this.container.retina.reduceFactor):this._destroy(),this._currentDuration-=this._duration,delete this._duration)),this._spawnDelay!==void 0&&(this._currentSpawnDelay+=e.value,this._currentSpawnDelay>=this._spawnDelay&&(this._engine.dispatchEvent("emitterPlay",{container:this.container}),this.play(),this._currentSpawnDelay-=this._currentSpawnDelay,delete this._spawnDelay)),this._emitDelay!==void 0&&(this._currentEmitDelay+=e.value,this._currentEmitDelay>=this._emitDelay&&(this._emit(),this._currentEmitDelay-=this._emitDelay)))}}class mn{constructor(e,t){this.container=t,this._engine=e,this.array=[],this.emitters=[],this.interactivityEmitters={random:{count:1,enable:!1},value:[]},t.getEmitter=i=>i===void 0||E(i)?this.array[i||0]:this.array.find(n=>n.name===i),t.addEmitter=(i,n)=>this.addEmitter(i,n),t.removeEmitter=i=>{const n=t.getEmitter(i);n&&this.removeEmitter(n)},t.playEmitter=i=>{const n=t.getEmitter(i);n&&n.externalPlay()},t.pauseEmitter=i=>{const n=t.getEmitter(i);n&&n.externalPause()}}addEmitter(e,t){const i=new Z;i.load(e);const n=new pn(this._engine,this,this.container,i,t);return this.array.push(n),n}handleClickMode(e){const t=this.emitters,i=this.interactivityEmitters;if(e!=="emitter")return;let n;if(i&&D(i.value))if(i.value.length>0&&i.random.enable){n=[];const a=[];for(let l=0;l<i.random.count;l++){const c=It(i.value);if(a.includes(c)&&a.length<i.value.length){l--;continue}a.push(c),n.push(me(i.value,c))}}else n=i.value;else n=i?.value;const o=n??t,r=this.container.interactivity.mouse.clickPosition;M(o,a=>{this.addEmitter(a,r)})}async init(){if(this.emitters=this.container.actualOptions.emitters,this.interactivityEmitters=this.container.actualOptions.interactivity.modes.emitters,!!this.emitters)if(D(this.emitters))for(const e of this.emitters)this.addEmitter(e);else this.addEmitter(this.emitters)}pause(){for(const e of this.array)e.pause()}play(){for(const e of this.array)e.play()}removeEmitter(e){const t=this.array.indexOf(e);t>=0&&this.array.splice(t,1)}resize(){for(const e of this.array)e.resize()}stop(){this.array=[]}update(e){for(const t of this.array)t.update(e)}}const $e=new Map;class yn{constructor(e){this._engine=e}addShape(e,t){this.getShape(e)||$e.set(e,t)}getShape(e){return $e.get(e)}getSupportedShapes(){return $e.keys()}}function gt(s,e){return s+e*(_()-.5)}class gn{randomPosition(e,t,i){if(i)return{x:gt(e.x,t.width),y:gt(e.y,t.height)};{const n=t.width/2,o=t.height/2,r=Math.floor(_()*4),a=(_()-.5)*2;switch(r){case 0:return{x:e.x+a*n,y:e.y-o};case 1:return{x:e.x-n,y:e.y+a*o};case 2:return{x:e.x+a*n,y:e.y+o};case 3:default:return{x:e.x+n,y:e.y+a*o}}}}}class bn{constructor(e){this._engine=e,this.id="emitters"}getPlugin(e){return new mn(this._engine,e)}loadOptions(e,t){if(!this.needsPlugin(e)&&!this.needsPlugin(t))return;t?.emitters&&(e.emitters=M(t.emitters,n=>{const o=new Z;return o.load(n),o}));const i=t?.interactivity?.modes?.emitters;if(i)if(D(i))e.interactivity.modes.emitters={random:{count:1,enable:!0},value:i.map(n=>{const o=new Z;return o.load(n),o})};else{const n=i;if(n.value!==void 0)if(D(n.value))e.interactivity.modes.emitters={random:{count:n.random.count??1,enable:n.random.enable??!1},value:n.value.map(o=>{const r=new Z;return r.load(o),r})};else{const o=new Z;o.load(n.value),e.interactivity.modes.emitters={random:{count:n.random.count??1,enable:n.random.enable??!1},value:o}}else(e.interactivity.modes.emitters={random:{count:1,enable:!1},value:new Z}).value.load(i)}}needsPlugin(e){if(!e)return!1;const t=e.emitters;return D(t)&&!!t.length||t!==void 0||!!e.interactivity?.events?.onClick?.mode&&C("emitter",e.interactivity.events.onClick.mode)}}async function vn(s,e=!0){s.emitterShapeManager||(s.emitterShapeManager=new yn(s)),s.addEmitterShape||(s.addEmitterShape=(i,n)=>{s.emitterShapeManager?.addShape(i,n)});const t=new bn(s);await s.addPlugin(t,e),s.addEmitterShape("circle",new hn),s.addEmitterShape("square",new gn)}class wn{constructor(){this.delay=1,this.pauseOnStop=!1,this.quantity=1}load(e){e&&(e.delay!==void 0&&(this.delay=e.delay),e.quantity!==void 0&&(this.quantity=e.quantity),e.particles!==void 0&&(this.particles=S({},e.particles)),e.pauseOnStop!==void 0&&(this.pauseOnStop=e.pauseOnStop))}}class xn extends j{constructor(e){super(e),this._delay=0}clear(){}init(){}async interact(e){const t=this.container,{interactivity:i}=t;if(!t.retina.reduceFactor)return;const n=t.actualOptions,o=n.interactivity.modes.trail;if(!o)return;const r=o.delay*1e3/this.container.retina.reduceFactor;if(this._delay<r&&(this._delay+=e.value),this._delay<r)return;const a=!(o.pauseOnStop&&(i.mouse.position===this._lastPosition||i.mouse.position?.x===this._lastPosition?.x&&i.mouse.position?.y===this._lastPosition?.y)),l=t.interactivity.mouse.position;l?this._lastPosition={...l}:delete this._lastPosition,a&&t.particles.push(o.quantity,t.interactivity.mouse,o.particles),this._delay-=r}isEnabled(e){const t=this.container,i=t.actualOptions,n=t.interactivity.mouse,o=(e?.interactivity??i.interactivity).events;return n.clicking&&n.inside&&!!n.position&&C("trail",o.onClick.mode)||n.inside&&!!n.position&&C("trail",o.onHover.mode)}loadModeOptions(e,...t){e.trail||(e.trail=new wn);for(const i of t)e.trail.load(i?.trail)}reset(){}}async function _n(s,e=!0){await s.addInteractor("externalTrail",t=>new xn(t),e)}function kn(s){const e=s.options.roll;if(!e?.enable){s.roll={enable:!1,horizontal:!1,vertical:!1,angle:0,speed:0};return}if(s.roll={enable:e.enable,horizontal:e.mode==="horizontal"||e.mode==="both",vertical:e.mode==="vertical"||e.mode==="both",angle:_()*Math.PI*2,speed:y(e.speed)/360},e.backColor)s.backColor=te(e.backColor);else if(e.darken.enable&&e.enlighten.enable){const t=_()>=.5?"darken":"enlighten";s.roll.alter={type:t,value:y(t==="darken"?e.darken.value:e.enlighten.value)}}else e.darken.enable?s.roll.alter={type:"darken",value:y(e.darken.value)}:e.enlighten.enable&&(s.roll.alter={type:"enlighten",value:y(e.enlighten.value)})}function Pn(s,e){const t=s.options.roll,i=s.roll;if(!i||!t?.enable)return;const n=i.speed*e.factor,o=2*Math.PI;i.angle+=n,i.angle>o&&(i.angle-=o)}class bt{constructor(){this.enable=!1,this.value=0}load(e){e&&(e.enable!==void 0&&(this.enable=e.enable),e.value!==void 0&&(this.value=v(e.value)))}}class Cn{constructor(){this.darken=new bt,this.enable=!1,this.enlighten=new bt,this.mode="vertical",this.speed=25}load(e){e&&(e.backColor!==void 0&&(this.backColor=O.create(this.backColor,e.backColor)),this.darken.load(e.darken),e.enable!==void 0&&(this.enable=e.enable),this.enlighten.load(e.enlighten),e.mode!==void 0&&(this.mode=e.mode),e.speed!==void 0&&(this.speed=v(e.speed)))}}class Mn{getTransformValues(e){const t=e.roll?.enable&&e.roll,i=t&&t.horizontal,n=t&&t.vertical;return{a:i?Math.cos(t.angle):void 0,d:n?Math.sin(t.angle):void 0}}init(e){kn(e)}isEnabled(e){const t=e.options.roll;return!e.destroyed&&!e.spawning&&!!t?.enable}loadOptions(e,...t){e.roll||(e.roll=new Cn);for(const i of t)e.roll.load(i?.roll)}update(e,t){this.isEnabled(e)&&Pn(e,t)}}async function zn(s,e=!0){await s.addParticleUpdater("roll",()=>new Mn,e)}let vt=class Kt{static init(e){const t=new Kt,i=e.selector;if(!i)throw new Error("No selector provided");const n=document.querySelector(i);if(!n)throw new Error("No element found for selector");return pe.set(i.replace(".","").replace("!",""),n,{fullScreen:{enable:!1},particles:{color:{value:e.color??"!000000"},links:{color:"random",distance:e.minDistance??120,enable:e.connectParticles??!1},move:{enable:!0,speed:e.speed??.5},number:{value:e.maxParticles??100},size:{value:{min:1,max:e.sizeVariations??3}}},responsive:e.responsive?.map(o=>({maxWidth:o.breakpoint,options:{particles:{color:{value:o.options?.color},links:{distance:o.options?.minDistance,enable:o.options?.connectParticles},number:{value:e.maxParticles},move:{enable:!0,speed:o.options?.speed},size:{value:o.options?.sizeVariations}}}}))}).then(o=>{t._container=o}),t}destroy(){const e=this._container;e&&e.destroy()}pauseAnimation(){const e=this._container;e&&e.pause()}resumeAnimation(){const e=this._container;e&&e.play()}};const On=s=>{const e=(i,n)=>s.load(i,n);e.load=(i,n,o)=>{s.loadJSON(i,n).then(r=>{r&&o(r)}).catch(()=>{o(void 0)})},e.setOnClickHandler=i=>{s.setOnClickHandler(i)};const t=s.dom();return{particlesJS:e,pJSDom:t}},Sn=s=>{const{particlesJS:e,pJSDom:t}=On(s);return window.particlesJS=e,window.pJSDom=t,window.Particles=vt,{particlesJS:e,pJSDom:t,Particles:vt}};function Dn(s){const e=s.initialPosition,{dx:t,dy:i}=T(e,s.position),n=Math.abs(t),o=Math.abs(i),{maxDistance:r}=s.retina,a=r.horizontal,l=r.vertical;if(!(!a&&!l)){if((a&&n>=a||l&&o>=l)&&!s.misplaced)s.misplaced=!!a&&n>a||!!l&&o>l,a&&(s.velocity.x=s.velocity.y/2-s.velocity.x),l&&(s.velocity.y=s.velocity.x/2-s.velocity.y);else if((!a||n<a)&&(!l||o<l)&&s.misplaced)s.misplaced=!1;else if(s.misplaced){const c=s.position,u=s.velocity;a&&(c.x<e.x&&u.x<0||c.x>e.x&&u.x>0)&&(u.x*=-_()),l&&(c.y<e.y&&u.y<0||c.y>e.y&&u.y>0)&&(u.y*=-_())}}}function Rn(s,e,t,i,n,o){En(s,o);const r=s.gravity,a=r?.enable&&r.inverse?-1:1;n&&t&&(s.velocity.x+=n*o.factor/(60*t)),r?.enable&&t&&(s.velocity.y+=a*(r.acceleration*o.factor)/(60*t));const l=s.moveDecay;s.velocity.multTo(l);const c=s.velocity.mult(t);r?.enable&&i>0&&(!r.inverse&&c.y>=0&&c.y>=i||r.inverse&&c.y<=0&&c.y<=-i)&&(c.y=a*i,t&&(s.velocity.y=c.y/t));const u=s.options.zIndex,h=(1-s.zIndexFactor)**u.velocityRate;c.multTo(h);const{position:f}=s;f.addTo(c),e.vibrate&&(f.x+=Math.sin(f.x*Math.cos(f.y)),f.y+=Math.cos(f.y*Math.sin(f.x)))}function Tn(s,e){const t=s.container;if(!s.spin)return;const i={x:s.spin.direction==="clockwise"?Math.cos:Math.sin,y:s.spin.direction==="clockwise"?Math.sin:Math.cos};s.position.x=s.spin.center.x+s.spin.radius*i.x(s.spin.angle),s.position.y=s.spin.center.y+s.spin.radius*i.y(s.spin.angle),s.spin.radius+=s.spin.acceleration;const n=Math.max(t.canvas.size.width,t.canvas.size.height);s.spin.radius>n/2?(s.spin.radius=n/2,s.spin.acceleration*=-1):s.spin.radius<0&&(s.spin.radius=0,s.spin.acceleration*=-1),s.spin.angle+=e/100*(1-s.spin.radius/n)}function En(s,e){const t=s.options,i=t.move.path;if(!i.enable)return;if(s.lastPathTime<=s.pathDelay){s.lastPathTime+=e.value;return}const o=s.pathGenerator?.generate(s,e);o&&s.velocity.addTo(o),i.clamp&&(s.velocity.x=X(s.velocity.x,-1,1),s.velocity.y=X(s.velocity.y,-1,1)),s.lastPathTime-=s.pathDelay}function In(s){return s.slow.inRange?s.slow.factor:1}const Ln=2;class An{constructor(){this._initSpin=e=>{const t=e.container,i=e.options,n=i.move.spin;if(!n.enable)return;const o=n.position??{x:50,y:50},r={x:o.x/100*t.canvas.size.width,y:o.y/100*t.canvas.size.height},a=e.getPosition(),l=L(a,r),c=y(n.acceleration);e.retina.spinAcceleration=c*t.retina.pixelRatio,e.spin={center:r,direction:e.velocity.x>=0?"clockwise":"counter-clockwise",angle:e.velocity.angle,radius:l,acceleration:e.retina.spinAcceleration}}}init(e){const t=e.options,i=t.move.gravity;e.gravity={enable:i.enable,acceleration:y(i.acceleration),inverse:i.inverse},this._initSpin(e)}isEnabled(e){return!e.destroyed&&e.options.move.enable}move(e,t){const i=e.options,n=i.move;if(!n.enable)return;const o=e.container,r=o.retina.pixelRatio,a=In(e),l=(e.retina.moveSpeed??=y(n.speed)*r)*o.retina.reduceFactor,c=e.retina.moveDrift??=y(e.options.move.drift)*r,u=K(i.size.value)*r,h=n.size?e.getRadius()/u:1,f=l*h*a*(t.factor||1)/Ln,d=e.retina.maxSpeed??o.retina.maxSpeed;n.spin.enable?Tn(e,f):Rn(e,n,f,d,c,t),Dn(e)}}async function Fn(s,e=!0){await s.addMover("base",()=>new An,e)}class qn{draw(e,t,i){t.circleRange||(t.circleRange={min:0,max:Math.PI*2});const n=t.circleRange;e.arc(0,0,i,n.min,n.max,!1)}getSidesCount(){return 12}particleInit(e,t){const i=t.shapeData,n=i?.angle??{max:360,min:0};t.circleRange=re(n)?{min:n.min*Math.PI/180,max:n.max*Math.PI/180}:{min:0,max:n*Math.PI/180}}}async function Bn(s,e=!0){await s.addShape("circle",new qn,e)}function Ge(s,e,t,i,n){if(!e||!t.enable||(e.maxLoops??0)>0&&(e.loops??0)>(e.maxLoops??0)||(e.time||(e.time=0),(e.delayTime??0)>0&&e.time<(e.delayTime??0)&&(e.time+=s.value),(e.delayTime??0)>0&&e.time<(e.delayTime??0)))return;const o=R(t.offset),r=(e.velocity??0)*s.factor+o*3.6,a=e.decay??1;!n||e.status==="increasing"?(e.value+=r,e.value>i&&(e.loops||(e.loops=0),e.loops++,n&&(e.status="decreasing",e.value-=e.value%i))):(e.value-=r,e.value<0&&(e.loops||(e.loops=0),e.loops++,e.status="increasing",e.value+=e.value)),e.velocity&&a!==1&&(e.velocity*=a),e.value>i&&(e.value%=i)}function Un(s,e){const{h:t,s:i,l:n}=s.options.color.animation,{color:o}=s;if(!o)return;const{h:r,s:a,l}=o;r&&Ge(e,r,t,360,!1),a&&Ge(e,a,i,100,!0),l&&Ge(e,l,n,100,!0)}class Hn{constructor(e){this.container=e}init(e){const t=te(e.options.color,e.id,e.options.reduceDuplicates);t&&(e.color=Xt(t,e.options.color.animation,this.container.retina.reduceFactor))}isEnabled(e){const{h:t,s:i,l:n}=e.options.color.animation,{color:o}=e;return!e.destroyed&&!e.spawning&&(o?.h.value!==void 0&&t.enable||o?.s.value!==void 0&&i.enable||o?.l.value!==void 0&&n.enable)}update(e,t){Un(e,t)}}async function Wn(s,e=!0){await s.addParticleUpdater("color",t=>new Hn(t),e)}function $n(s,e,t,i){switch(s.options.opacity.animation.destroy){case"max":e>=i&&s.destroy();break;case"min":e<=t&&s.destroy();break}}function Gn(s,e){const t=s.opacity;if(s.destroyed||!t?.enable||(t.maxLoops??0)>0&&(t.loops??0)>(t.maxLoops??0))return;const i=t.min,n=t.max,o=t.decay??1;if(t.time||(t.time=0),(t.delayTime??0)>0&&t.time<(t.delayTime??0)&&(t.time+=e.value),!((t.delayTime??0)>0&&t.time<(t.delayTime??0))){switch(t.status){case"increasing":t.value>=n?(t.status="decreasing",t.loops||(t.loops=0),t.loops++):t.value+=(t.velocity??0)*e.factor;break;case"decreasing":t.value<=i?(t.status="increasing",t.loops||(t.loops=0),t.loops++):t.value-=(t.velocity??0)*e.factor;break}t.velocity&&t.decay!==1&&(t.velocity*=o),$n(s,t.value,i,n),s.destroyed||(t.value=X(t.value,i,n))}}class Nn{constructor(e){this.container=e}init(e){const t=e.options.opacity;e.opacity=qt(t,1);const i=t.animation;i.enable&&(e.opacity.velocity=y(i.speed)/100*this.container.retina.reduceFactor,i.sync||(e.opacity.velocity*=_()))}isEnabled(e){return!e.destroyed&&!e.spawning&&!!e.opacity&&e.opacity.enable&&((e.opacity.maxLoops??0)<=0||(e.opacity.maxLoops??0)>0&&(e.opacity.loops??0)<(e.opacity.maxLoops??0))}reset(e){e.opacity&&(e.opacity.time=0,e.opacity.loops=0)}update(e,t){this.isEnabled(e)&&Gn(e,t)}}async function Xn(s,e=!0){await s.addParticleUpdater("opacity",t=>new Nn(t),e)}function Yn(s){if(s.outMode!=="bounce"&&s.outMode!=="bounce-horizontal"&&s.outMode!=="bounceHorizontal"&&s.outMode!=="split"||s.direction!=="left"&&s.direction!=="right")return;s.bounds.right<0&&s.direction==="left"?s.particle.position.x=s.size+s.offset.x:s.bounds.left>s.canvasSize.width&&s.direction==="right"&&(s.particle.position.x=s.canvasSize.width-s.size-s.offset.x);const e=s.particle.velocity.x;let t=!1;if(s.direction==="right"&&s.bounds.right>=s.canvasSize.width&&e>0||s.direction==="left"&&s.bounds.left<=0&&e<0){const n=V(s.particle.options.bounce.horizontal);s.particle.velocity.x*=-n,t=!0}if(!t)return;const i=s.offset.x+s.size;s.bounds.right>=s.canvasSize.width&&s.direction==="right"?s.particle.position.x=s.canvasSize.width-i:s.bounds.left<=0&&s.direction==="left"&&(s.particle.position.x=i),s.outMode==="split"&&s.particle.destroy()}function jn(s){if(s.outMode!=="bounce"&&s.outMode!=="bounce-vertical"&&s.outMode!=="bounceVertical"&&s.outMode!=="split"||s.direction!=="bottom"&&s.direction!=="top")return;s.bounds.bottom<0&&s.direction==="top"?s.particle.position.y=s.size+s.offset.y:s.bounds.top>s.canvasSize.height&&s.direction==="bottom"&&(s.particle.position.y=s.canvasSize.height-s.size-s.offset.y);const e=s.particle.velocity.y;let t=!1;if(s.direction==="bottom"&&s.bounds.bottom>=s.canvasSize.height&&e>0||s.direction==="top"&&s.bounds.top<=0&&e<0){const n=V(s.particle.options.bounce.vertical);s.particle.velocity.y*=-n,t=!0}if(!t)return;const i=s.offset.y+s.size;s.bounds.bottom>=s.canvasSize.height&&s.direction==="bottom"?s.particle.position.y=s.canvasSize.height-i:s.bounds.top<=0&&s.direction==="top"&&(s.particle.position.y=i),s.outMode==="split"&&s.particle.destroy()}class Jn{constructor(e){this.container=e,this.modes=["bounce","bounce-vertical","bounce-horizontal","bounceVertical","bounceHorizontal","split"]}update(e,t,i,n){if(!this.modes.includes(n))return;const o=this.container;let r=!1;for(const[,f]of o.plugins)if(f.particleBounce!==void 0&&(r=f.particleBounce(e,i,t)),r)break;if(r)return;const a=e.getPosition(),l=e.offset,c=e.getRadius(),u=ge(a,c),h=o.canvas.size;Yn({particle:e,outMode:n,direction:t,bounds:u,canvasSize:h,offset:l,size:c}),jn({particle:e,outMode:n,direction:t,bounds:u,canvasSize:h,offset:l,size:c})}}class Qn{constructor(e){this.container=e,this.modes=["destroy"]}update(e,t,i,n){if(!this.modes.includes(n))return;const o=this.container;switch(e.outType){case"normal":case"outside":if(ye(e.position,o.canvas.size,P.origin,e.getRadius(),t))return;break;case"inside":{const{dx:r,dy:a}=T(e.position,e.moveCenter),{x:l,y:c}=e.velocity;if(l<0&&r>e.moveCenter.radius||c<0&&a>e.moveCenter.radius||l>=0&&r<-e.moveCenter.radius||c>=0&&a<-e.moveCenter.radius)return;break}}o.particles.remove(e,void 0,!0)}}class Vn{constructor(e){this.container=e,this.modes=["none"]}update(e,t,i,n){if(!this.modes.includes(n)||e.options.move.distance.horizontal&&(t==="left"||t==="right")||e.options.move.distance.vertical&&(t==="top"||t==="bottom"))return;const o=e.options.move.gravity,r=this.container,a=r.canvas.size,l=e.getRadius();if(o.enable){const c=e.position;(!o.inverse&&c.y>a.height+l&&t==="bottom"||o.inverse&&c.y<-l&&t==="top")&&r.particles.remove(e)}else{if(e.velocity.y>0&&e.position.y<=a.height+l||e.velocity.y<0&&e.position.y>=-l||e.velocity.x>0&&e.position.x<=a.width+l||e.velocity.x<0&&e.position.x>=-l)return;ye(e.position,r.canvas.size,P.origin,l,t)||r.particles.remove(e)}}}class Zn{constructor(e){this.container=e,this.modes=["out"]}update(e,t,i,n){if(!this.modes.includes(n))return;const o=this.container;switch(e.outType){case"inside":{const{x:r,y:a}=e.velocity,l=P.origin;l.length=e.moveCenter.radius,l.angle=e.velocity.angle+Math.PI,l.addTo(P.create(e.moveCenter));const{dx:c,dy:u}=T(e.position,l);if(r<=0&&c>=0||a<=0&&u>=0||r>=0&&c<=0||a>=0&&u<=0)return;e.position.x=Math.floor(R({min:0,max:o.canvas.size.width})),e.position.y=Math.floor(R({min:0,max:o.canvas.size.height}));const{dx:h,dy:f}=T(e.position,e.moveCenter);e.direction=Math.atan2(-f,-h),e.velocity.angle=e.direction;break}default:{if(ye(e.position,o.canvas.size,P.origin,e.getRadius(),t))return;switch(e.outType){case"outside":{e.position.x=Math.floor(R({min:-e.moveCenter.radius,max:e.moveCenter.radius}))+e.moveCenter.x,e.position.y=Math.floor(R({min:-e.moveCenter.radius,max:e.moveCenter.radius}))+e.moveCenter.y;const{dx:r,dy:a}=T(e.position,e.moveCenter);e.moveCenter.radius&&(e.direction=Math.atan2(a,r),e.velocity.angle=e.direction);break}case"normal":{const r=e.options.move.warp,a=o.canvas.size,l={bottom:a.height+e.getRadius()+e.offset.y,left:-e.getRadius()-e.offset.x,right:a.width+e.getRadius()+e.offset.x,top:-e.getRadius()-e.offset.y},c=e.getRadius(),u=ge(e.position,c);t==="right"&&u.left>a.width+e.offset.x?(e.position.x=l.left,e.initialPosition.x=e.position.x,r||(e.position.y=_()*a.height,e.initialPosition.y=e.position.y)):t==="left"&&u.right<-e.offset.x&&(e.position.x=l.right,e.initialPosition.x=e.position.x,r||(e.position.y=_()*a.height,e.initialPosition.y=e.position.y)),t==="bottom"&&u.top>a.height+e.offset.y?(r||(e.position.x=_()*a.width,e.initialPosition.x=e.position.x),e.position.y=l.top,e.initialPosition.y=e.position.y):t==="top"&&u.bottom<-e.offset.y&&(r||(e.position.x=_()*a.width,e.initialPosition.x=e.position.x),e.position.y=l.bottom,e.initialPosition.y=e.position.y);break}}break}}}}class Kn{constructor(e){this.container=e,this._updateOutMode=(t,i,n,o)=>{for(const r of this.updaters)r.update(t,o,i,n)},this.updaters=[new Jn(e),new Qn(e),new Zn(e),new Vn(e)]}init(){}isEnabled(e){return!e.destroyed&&!e.spawning}update(e,t){const i=e.options.move.outModes;this._updateOutMode(e,t,i.bottom??i.default,"bottom"),this._updateOutMode(e,t,i.left??i.default,"left"),this._updateOutMode(e,t,i.right??i.default,"right"),this._updateOutMode(e,t,i.top??i.default,"top")}}async function eo(s,e=!0){await s.addParticleUpdater("outModes",t=>new Kn(t),e)}function to(s,e,t,i){switch(s.options.size.animation.destroy){case"max":e>=i&&s.destroy();break;case"min":e<=t&&s.destroy();break}}function io(s,e){const t=s.size;if(s.destroyed||!t||!t.enable||(t.maxLoops??0)>0&&(t.loops??0)>(t.maxLoops??0))return;const i=(t.velocity??0)*e.factor,n=t.min,o=t.max,r=t.decay??1;if(t.time||(t.time=0),(t.delayTime??0)>0&&t.time<(t.delayTime??0)&&(t.time+=e.value),!((t.delayTime??0)>0&&t.time<(t.delayTime??0))){switch(t.status){case"increasing":t.value>=o?(t.status="decreasing",t.loops||(t.loops=0),t.loops++):t.value+=i;break;case"decreasing":t.value<=n?(t.status="increasing",t.loops||(t.loops=0),t.loops++):t.value-=i}t.velocity&&r!==1&&(t.velocity*=r),to(s,t.value,n,o),s.destroyed||(t.value=X(t.value,n,o))}}class so{init(e){const t=e.container,i=e.options.size,n=i.animation;n.enable&&(e.size.velocity=(e.retina.sizeAnimationSpeed??t.retina.sizeAnimationSpeed)/100*t.retina.reduceFactor,n.sync||(e.size.velocity*=_()))}isEnabled(e){return!e.destroyed&&!e.spawning&&e.size.enable&&((e.size.maxLoops??0)<=0||(e.size.maxLoops??0)>0&&(e.size.loops??0)<(e.size.maxLoops??0))}reset(e){e.size.loops=0}update(e,t){this.isEnabled(e)&&io(e,t)}}async function no(s,e=!0){await s.addParticleUpdater("size",()=>new so,e)}async function oo(s,e=!0){await Fn(s,!1),await Bn(s,!1),await Wn(s,!1),await Xn(s,!1),await eo(s,!1),await no(s,!1),await s.refresh(e)}async function ro(){De("ease-in-quad",s=>s**2),De("ease-out-quad",s=>1-(1-s)**2),De("ease-in-out-quad",s=>s<.5?2*s**2:1-(-2*s+2)**2/2)}class ao{constructor(){this.distance=200,this.duration=.4,this.easing="ease-out-quad",this.factor=1,this.maxSpeed=50,this.speed=1}load(e){e&&(e.distance!==void 0&&(this.distance=e.distance),e.duration!==void 0&&(this.duration=e.duration),e.easing!==void 0&&(this.easing=e.easing),e.factor!==void 0&&(this.factor=e.factor),e.maxSpeed!==void 0&&(this.maxSpeed=e.maxSpeed),e.speed!==void 0&&(this.speed=e.speed))}}let lo=class extends j{constructor(e,t){super(t),this._clickAttract=()=>{const i=this.container;i.attract||(i.attract={particles:[]});const{attract:n}=i;if(n.finish||(n.count||(n.count=0),n.count++,n.count===i.particles.count&&(n.finish=!0)),n.clicking){const o=i.interactivity.mouse.clickPosition,r=i.retina.attractModeDistance;if(!r||r<0||!o)return;this._processAttract(o,r,new I(o.x,o.y,r))}else n.clicking===!1&&(n.particles=[])},this._hoverAttract=()=>{const i=this.container,n=i.interactivity.mouse.position,o=i.retina.attractModeDistance;!o||o<0||!n||this._processAttract(n,o,new I(n.x,n.y,o))},this._processAttract=(i,n,o)=>{const r=this.container,a=r.actualOptions.interactivity.modes.attract;if(!a)return;const l=r.particles.quadTree.query(o,c=>this.isEnabled(c));for(const c of l){const{dx:u,dy:h,distance:f}=T(c.position,i),d=a.speed*a.factor,m=X(St(a.easing)(1-f/n)*d,0,a.maxSpeed),p=P.create(f===0?d:u/f*m,f===0?d:h/f*m);c.position.subFrom(p)}},this._engine=e,t.attract||(t.attract={particles:[]}),this.handleClickMode=i=>{const n=this.container.actualOptions,o=n.interactivity.modes.attract;if(!(!o||i!=="attract")){t.attract||(t.attract={particles:[]}),t.attract.clicking=!0,t.attract.count=0;for(const r of t.attract.particles)this.isEnabled(r)&&r.velocity.setTo(r.initialVelocity);t.attract.particles=[],t.attract.finish=!1,setTimeout(()=>{t.destroyed||(t.attract||(t.attract={particles:[]}),t.attract.clicking=!1)},o.duration*1e3)}}}clear(){}init(){const e=this.container,t=e.actualOptions.interactivity.modes.attract;t&&(e.retina.attractModeDistance=t.distance*e.retina.pixelRatio)}async interact(){const e=this.container,t=e.actualOptions,i=e.interactivity.status===ie,n=t.interactivity.events,o=n.onHover.enable,r=n.onHover.mode,a=n.onClick.enable,l=n.onClick.mode;i&&o&&C("attract",r)?this._hoverAttract():a&&C("attract",l)&&this._clickAttract()}isEnabled(e){const t=this.container,i=t.actualOptions,n=t.interactivity.mouse,o=(e?.interactivity??i.interactivity).events;if((!n.position||!o.onHover.enable)&&(!n.clickPosition||!o.onClick.enable))return!1;const r=o.onHover.mode,a=o.onClick.mode;return C("attract",r)||C("attract",a)}loadModeOptions(e,...t){e.attract||(e.attract=new ao);for(const i of t)e.attract.load(i?.attract)}reset(){}};async function co(s,e=!0){await s.addInteractor("externalAttract",t=>new lo(s,t),e)}class uo{constructor(){this.distance=200}load(e){e&&e.distance!==void 0&&(this.distance=e.distance)}}class ho extends j{constructor(e){super(e),this._processBounce=(t,i,n)=>{const o=this.container.particles.quadTree.query(n,r=>this.isEnabled(r));for(const r of o)n instanceof I?At(Qe(r),{position:t,radius:i,mass:i**2*Math.PI/2,velocity:P.origin,factor:P.origin}):n instanceof Y&&Oi(r,ge(t,i))},this._processMouseBounce=()=>{const t=this.container,i=t.retina.pixelRatio,n=10*i,o=t.interactivity.mouse.position,r=t.retina.bounceModeDistance;!r||r<0||!o||this._processBounce(o,r,new I(o.x,o.y,r+n))},this._singleSelectorBounce=(t,i)=>{const n=this.container,o=document.querySelectorAll(t);o.length&&o.forEach(r=>{const a=r,l=n.retina.pixelRatio,c={x:(a.offsetLeft+a.offsetWidth/2)*l,y:(a.offsetTop+a.offsetHeight/2)*l},u=a.offsetWidth/2*l,h=10*l,f=i.type==="circle"?new I(c.x,c.y,u+h):new Y(a.offsetLeft*l-h,a.offsetTop*l-h,a.offsetWidth*l+h*2,a.offsetHeight*l+h*2);this._processBounce(c,u,f)})}}clear(){}init(){const e=this.container,t=e.actualOptions.interactivity.modes.bounce;t&&(e.retina.bounceModeDistance=t.distance*e.retina.pixelRatio)}async interact(){const e=this.container,t=e.actualOptions,i=t.interactivity.events,n=e.interactivity.status===ie,o=i.onHover.enable,r=i.onHover.mode,a=i.onDiv;n&&o&&C("bounce",r)?this._processMouseBounce():tt("bounce",a,(l,c)=>this._singleSelectorBounce(l,c))}isEnabled(e){const t=this.container,i=t.actualOptions,n=t.interactivity.mouse,o=(e?.interactivity??i.interactivity).events,r=o.onDiv;return n.position&&o.onHover.enable&&C("bounce",o.onHover.mode)||et("bounce",r)}loadModeOptions(e,...t){e.bounce||(e.bounce=new uo);for(const i of t)e.bounce.load(i?.bounce)}reset(){}}async function fo(s,e=!0){await s.addInteractor("externalBounce",t=>new ho(t),e)}class ei{constructor(){this.distance=200,this.duration=.4,this.mix=!1}load(e){if(e){if(e.distance!==void 0&&(this.distance=e.distance),e.duration!==void 0&&(this.duration=e.duration),e.mix!==void 0&&(this.mix=e.mix),e.opacity!==void 0&&(this.opacity=e.opacity),e.color!==void 0){const t=D(this.color)?void 0:this.color;this.color=M(e.color,i=>O.create(t,i))}e.size!==void 0&&(this.size=e.size)}}}class po extends ei{constructor(){super(),this.selectors=[]}get ids(){return M(this.selectors,e=>e.replace("#",""))}set ids(e){this.selectors=M(e,t=>`#${t}`)}load(e){super.load(e),e&&(e.ids!==void 0&&(this.ids=e.ids),e.selectors!==void 0&&(this.selectors=e.selectors))}}class mo extends ei{load(e){super.load(e),e&&(this.divs=M(e.divs,t=>{const i=new po;return i.load(t),i}))}}function wt(s,e,t,i){if(e>=t){const n=s+(e-t)*i;return X(n,s,e)}else if(e<t){const n=s-(t-e)*i;return X(n,e,s)}}class yo extends j{constructor(e){super(e),this._clickBubble=()=>{const t=this.container,i=t.actualOptions,n=t.interactivity.mouse.clickPosition,o=i.interactivity.modes.bubble;if(!o||!n)return;t.bubble||(t.bubble={});const r=t.retina.bubbleModeDistance;if(!r||r<0)return;const a=t.particles.quadTree.queryCircle(n,r,c=>this.isEnabled(c)),{bubble:l}=t;for(const c of a){if(!l.clicking)continue;c.bubble.inRange=!l.durationEnd;const u=c.getPosition(),h=L(u,n),f=(new Date().getTime()-(t.interactivity.mouse.clickTime||0))/1e3;f>o.duration&&(l.durationEnd=!0),f>o.duration*2&&(l.clicking=!1,l.durationEnd=!1);const d={bubbleObj:{optValue:t.retina.bubbleModeSize,value:c.bubble.radius},particlesObj:{optValue:K(c.options.size.value)*t.retina.pixelRatio,value:c.size.value},type:"size"};this._process(c,h,f,d);const m={bubbleObj:{optValue:o.opacity,value:c.bubble.opacity},particlesObj:{optValue:K(c.options.opacity.value),value:c.opacity?.value??1},type:"opacity"};this._process(c,h,f,m),!l.durationEnd&&h<=r?this._hoverBubbleColor(c,h):delete c.bubble.color}},this._hoverBubble=()=>{const t=this.container,i=t.interactivity.mouse.position,n=t.retina.bubbleModeDistance;if(!n||n<0||i===void 0)return;const o=t.particles.quadTree.queryCircle(i,n,r=>this.isEnabled(r));for(const r of o){r.bubble.inRange=!0;const a=r.getPosition(),l=L(a,i),c=1-l/n;l<=n?c>=0&&t.interactivity.status===ie&&(this._hoverBubbleSize(r,c),this._hoverBubbleOpacity(r,c),this._hoverBubbleColor(r,c)):this.reset(r),t.interactivity.status===je&&this.reset(r)}},this._hoverBubbleColor=(t,i,n)=>{const o=this.container.actualOptions,r=n??o.interactivity.modes.bubble;if(r){if(!t.bubble.finalColor){const a=r.color;if(!a)return;const l=q(a);t.bubble.finalColor=te(l)}if(t.bubble.finalColor)if(r.mix){t.bubble.color=void 0;const a=t.getFillColor();t.bubble.color=a?$t(it(a,t.bubble.finalColor,1-i,i)):t.bubble.finalColor}else t.bubble.color=t.bubble.finalColor}},this._hoverBubbleOpacity=(t,i,n)=>{const o=this.container,r=o.actualOptions,a=n?.opacity??r.interactivity.modes.bubble?.opacity;if(!a)return;const l=t.options.opacity.value,c=t.opacity?.value??1,u=wt(c,a,K(l),i);u!==void 0&&(t.bubble.opacity=u)},this._hoverBubbleSize=(t,i,n)=>{const o=this.container,r=n?.size?n.size*o.retina.pixelRatio:o.retina.bubbleModeSize;if(r===void 0)return;const a=K(t.options.size.value)*o.retina.pixelRatio,l=t.size.value,c=wt(l,r,a,i);c!==void 0&&(t.bubble.radius=c)},this._process=(t,i,n,o)=>{const r=this.container,a=o.bubbleObj.optValue,l=r.actualOptions,c=l.interactivity.modes.bubble;if(!c||a===void 0)return;const u=c.duration,h=r.retina.bubbleModeDistance,f=o.particlesObj.optValue,d=o.bubbleObj.value,m=o.particlesObj.value||0,p=o.type;if(!(!h||h<0||a===f))if(r.bubble||(r.bubble={}),r.bubble.durationEnd)d&&(p==="size"&&delete t.bubble.radius,p==="opacity"&&delete t.bubble.opacity);else if(i<=h){if((d??m)!==a){const g=m-n*(m-a)/u;p==="size"&&(t.bubble.radius=g),p==="opacity"&&(t.bubble.opacity=g)}}else p==="size"&&delete t.bubble.radius,p==="opacity"&&delete t.bubble.opacity},this._singleSelectorHover=(t,i,n)=>{const o=this.container,r=document.querySelectorAll(i),a=o.actualOptions.interactivity.modes.bubble;!a||!r.length||r.forEach(l=>{const c=l,u=o.retina.pixelRatio,h={x:(c.offsetLeft+c.offsetWidth/2)*u,y:(c.offsetTop+c.offsetHeight/2)*u},f=c.offsetWidth/2*u,d=n.type==="circle"?new I(h.x,h.y,f):new Y(c.offsetLeft*u,c.offsetTop*u,c.offsetWidth*u,c.offsetHeight*u),m=o.particles.quadTree.query(d,p=>this.isEnabled(p));for(const p of m){if(!d.contains(p.getPosition()))continue;p.bubble.inRange=!0;const x=a.divs,g=Lt(x,c);(!p.bubble.div||p.bubble.div!==c)&&(this.clear(p,t,!0),p.bubble.div=c),this._hoverBubbleSize(p,1,g),this._hoverBubbleOpacity(p,1,g),this._hoverBubbleColor(p,1,g)}})},e.bubble||(e.bubble={}),this.handleClickMode=t=>{t==="bubble"&&(e.bubble||(e.bubble={}),e.bubble.clicking=!0)}}clear(e,t,i){e.bubble.inRange&&!i||(delete e.bubble.div,delete e.bubble.opacity,delete e.bubble.radius,delete e.bubble.color)}init(){const e=this.container,t=e.actualOptions.interactivity.modes.bubble;t&&(e.retina.bubbleModeDistance=t.distance*e.retina.pixelRatio,t.size!==void 0&&(e.retina.bubbleModeSize=t.size*e.retina.pixelRatio))}async interact(e){const t=this.container.actualOptions,i=t.interactivity.events,n=i.onHover,o=i.onClick,r=n.enable,a=n.mode,l=o.enable,c=o.mode,u=i.onDiv;r&&C("bubble",a)?this._hoverBubble():l&&C("bubble",c)?this._clickBubble():tt("bubble",u,(h,f)=>this._singleSelectorHover(e,h,f))}isEnabled(e){const t=this.container,i=t.actualOptions,n=t.interactivity.mouse,o=(e?.interactivity??i.interactivity).events,{onClick:r,onDiv:a,onHover:l}=o,c=et("bubble",a);return c||l.enable&&n.position||r.enable&&n.clickPosition?C("bubble",l.mode)||C("bubble",r.mode)||c:!1}loadModeOptions(e,...t){e.bubble||(e.bubble=new mo);for(const i of t)e.bubble.load(i?.bubble)}reset(e){e.bubble.inRange=!1}}async function go(s,e=!0){await s.addInteractor("externalBubble",t=>new yo(t),e)}class bo{constructor(){this.opacity=.5}load(e){e&&e.opacity!==void 0&&(this.opacity=e.opacity)}}class vo{constructor(){this.distance=80,this.links=new bo,this.radius=60}get lineLinked(){return this.links}set lineLinked(e){this.links=e}get line_linked(){return this.links}set line_linked(e){this.links=e}load(e){e&&(e.distance!==void 0&&(this.distance=e.distance),this.links.load(e.links??e.lineLinked??e.line_linked),e.radius!==void 0&&(this.radius=e.radius))}}function wo(s,e,t,i){const n=Math.floor(t.getRadius()/e.getRadius()),o=e.getFillColor(),r=t.getFillColor();if(!o||!r)return;const a=e.getPosition(),l=t.getPosition(),c=it(o,r,e.getRadius(),t.getRadius()),u=s.createLinearGradient(a.x,a.y,l.x,l.y);return u.addColorStop(0,ue(o,i)),u.addColorStop(n>1?1:n,J(c,i)),u.addColorStop(1,ue(r,i)),u}function xo(s,e,t,i,n){de(s,i,n),s.lineWidth=e,s.strokeStyle=t,s.stroke()}function _o(s,e,t,i){const n=s.actualOptions,o=n.interactivity.modes.connect;if(o)return wo(e,t,i,o.links.opacity)}function ko(s,e,t){s.canvas.draw(i=>{const n=_o(s,i,e,t);if(!n)return;const o=e.getPosition(),r=t.getPosition();xo(i,e.retina.linksWidth??0,n,o,r)})}class Po extends j{constructor(e){super(e)}clear(){}init(){const e=this.container,t=e.actualOptions.interactivity.modes.connect;t&&(e.retina.connectModeDistance=t.distance*e.retina.pixelRatio,e.retina.connectModeRadius=t.radius*e.retina.pixelRatio)}async interact(){const e=this.container;if(e.actualOptions.interactivity.events.onHover.enable&&e.interactivity.status==="pointermove"){const i=e.interactivity.mouse.position;if(!e.retina.connectModeDistance||e.retina.connectModeDistance<0||!e.retina.connectModeRadius||e.retina.connectModeRadius<0||!i)return;const n=Math.abs(e.retina.connectModeRadius),o=e.particles.quadTree.queryCircle(i,n,a=>this.isEnabled(a));let r=0;for(const a of o){const l=a.getPosition();for(const c of o.slice(r+1)){const u=c.getPosition(),h=Math.abs(e.retina.connectModeDistance),f=Math.abs(l.x-u.x),d=Math.abs(l.y-u.y);f<h&&d<h&&ko(e,a,c)}++r}}}isEnabled(e){const t=this.container,i=t.interactivity.mouse,n=(e?.interactivity??t.actualOptions.interactivity).events;return n.onHover.enable&&i.position?C("connect",n.onHover.mode):!1}loadModeOptions(e,...t){e.connect||(e.connect=new vo);for(const i of t)e.connect.load(i?.connect)}reset(){}}async function Co(s,e=!0){await s.addInteractor("externalConnect",t=>new Po(t),e)}class Mo{constructor(){this.blink=!1,this.consent=!1,this.opacity=1}load(e){e&&(e.blink!==void 0&&(this.blink=e.blink),e.color!==void 0&&(this.color=O.create(this.color,e.color)),e.consent!==void 0&&(this.consent=e.consent),e.opacity!==void 0&&(this.opacity=e.opacity))}}class zo{constructor(){this.distance=100,this.links=new Mo}get lineLinked(){return this.links}set lineLinked(e){this.links=e}get line_linked(){return this.links}set line_linked(e){this.links=e}load(e){e&&(e.distance!==void 0&&(this.distance=e.distance),this.links.load(e.links??e.lineLinked??e.line_linked))}}function Oo(s,e,t,i,n,o){de(s,t,i),s.strokeStyle=J(n,o),s.lineWidth=e,s.stroke()}function So(s,e,t,i,n){s.canvas.draw(o=>{const r=e.getPosition();Oo(o,e.retina.linksWidth??0,r,n,t,i)})}class Do extends j{constructor(e){super(e)}clear(){}init(){const e=this.container,t=e.actualOptions.interactivity.modes.grab;t&&(e.retina.grabModeDistance=t.distance*e.retina.pixelRatio)}async interact(){const e=this.container,t=e.actualOptions,i=t.interactivity;if(!i.modes.grab||!i.events.onHover.enable||e.interactivity.status!==ie)return;const n=e.interactivity.mouse.position;if(!n)return;const o=e.retina.grabModeDistance;if(!o||o<0)return;const r=e.particles.quadTree.queryCircle(n,o,a=>this.isEnabled(a));for(const a of r){const l=a.getPosition(),c=L(l,n);if(c>o)continue;const u=i.modes.grab.links,h=u.opacity,f=h-c*h/o;if(f<=0)continue;const d=u.color??a.options.links?.color;if(!e.particles.grabLineColor&&d){const p=i.modes.grab.links;e.particles.grabLineColor=Nt(d,p.blink,p.consent)}const m=Ve(a,void 0,e.particles.grabLineColor);m&&So(e,a,m,f,n)}}isEnabled(e){const t=this.container,i=t.interactivity.mouse,n=(e?.interactivity??t.actualOptions.interactivity).events;return n.onHover.enable&&!!i.position&&C("grab",n.onHover.mode)}loadModeOptions(e,...t){e.grab||(e.grab=new zo);for(const i of t)e.grab.load(i?.grab)}reset(){}}async function Ro(s,e=!0){await s.addInteractor("externalGrab",t=>new Do(t),e)}class To extends j{constructor(e){super(e),this.handleClickMode=t=>{if(t!=="pause")return;const i=this.container;i.getAnimationStatus()?i.pause():i.play()}}clear(){}init(){}async interact(){}isEnabled(){return!0}reset(){}}async function Eo(s,e=!0){await s.addInteractor("externalPause",t=>new To(t),e)}class Io{constructor(){this.default=!0,this.groups=[],this.quantity=4}get particles_nb(){return this.quantity}set particles_nb(e){this.quantity=v(e)}load(e){if(!e)return;e.default!==void 0&&(this.default=e.default),e.groups!==void 0&&(this.groups=e.groups.map(i=>i)),this.groups.length||(this.default=!0);const t=e.quantity??e.particles_nb;t!==void 0&&(this.quantity=v(t))}}class Lo extends j{constructor(e){super(e),this.handleClickMode=t=>{if(t!=="push")return;const i=this.container,n=i.actualOptions,o=n.interactivity.modes.push;if(!o)return;const r=y(o.quantity);if(r<=0)return;const a=me([void 0,...o.groups]),l=a!==void 0?i.actualOptions.particles.groups[a]:void 0;i.particles.push(r,i.interactivity.mouse,l,a)}}clear(){}init(){}async interact(){}isEnabled(){return!0}loadModeOptions(e,...t){e.push||(e.push=new Io);for(const i of t)e.push.load(i?.push)}reset(){}}async function Ao(s,e=!0){await s.addInteractor("externalPush",t=>new Lo(t),e)}class Fo{constructor(){this.quantity=2}get particles_nb(){return this.quantity}set particles_nb(e){this.quantity=v(e)}load(e){if(!e)return;const t=e.quantity??e.particles_nb;t!==void 0&&(this.quantity=v(t))}}class qo extends j{constructor(e){super(e),this.handleClickMode=t=>{const i=this.container,n=i.actualOptions;if(!n.interactivity.modes.remove||t!=="remove")return;const o=y(n.interactivity.modes.remove.quantity);i.particles.removeQuantity(o)}}clear(){}init(){}async interact(){}isEnabled(){return!0}loadModeOptions(e,...t){e.remove||(e.remove=new Fo);for(const i of t)e.remove.load(i?.remove)}reset(){}}async function Bo(s,e=!0){await s.addInteractor("externalRemove",t=>new qo(t),e)}class ti{constructor(){this.distance=200,this.duration=.4,this.factor=100,this.speed=1,this.maxSpeed=50,this.easing="ease-out-quad"}load(e){e&&(e.distance!==void 0&&(this.distance=e.distance),e.duration!==void 0&&(this.duration=e.duration),e.easing!==void 0&&(this.easing=e.easing),e.factor!==void 0&&(this.factor=e.factor),e.speed!==void 0&&(this.speed=e.speed),e.maxSpeed!==void 0&&(this.maxSpeed=e.maxSpeed))}}class Uo extends ti{constructor(){super(),this.selectors=[]}get ids(){return M(this.selectors,e=>e.replace("#",""))}set ids(e){this.selectors=M(e,t=>`#${t}`)}load(e){super.load(e),e&&(e.ids!==void 0&&(this.ids=e.ids),e.selectors!==void 0&&(this.selectors=e.selectors))}}class Ho extends ti{load(e){super.load(e),e&&(this.divs=M(e.divs,t=>{const i=new Uo;return i.load(t),i}))}}class Wo extends j{constructor(e,t){super(t),this._clickRepulse=()=>{const i=this.container,n=i.actualOptions.interactivity.modes.repulse;if(!n)return;const o=i.repulse||{particles:[]};if(o.finish||(o.count||(o.count=0),o.count++,o.count===i.particles.count&&(o.finish=!0)),o.clicking){const r=i.retina.repulseModeDistance;if(!r||r<0)return;const a=Math.pow(r/6,3),l=i.interactivity.mouse.clickPosition;if(l===void 0)return;const c=new I(l.x,l.y,a),u=i.particles.quadTree.query(c,h=>this.isEnabled(h));for(const h of u){const{dx:f,dy:d,distance:m}=T(l,h.position),p=m**2,x=n.speed,g=-a*x/p;if(p<=a){o.particles.push(h);const w=P.create(f,d);w.length=g,h.velocity.setTo(w)}}}else if(o.clicking===!1){for(const r of o.particles)r.velocity.setTo(r.initialVelocity);o.particles=[]}},this._hoverRepulse=()=>{const i=this.container,n=i.interactivity.mouse.position,o=i.retina.repulseModeDistance;!o||o<0||!n||this._processRepulse(n,o,new I(n.x,n.y,o))},this._processRepulse=(i,n,o,r)=>{const a=this.container,l=a.particles.quadTree.query(o,u=>this.isEnabled(u)),c=a.actualOptions.interactivity.modes.repulse;if(c)for(const u of l){const{dx:h,dy:f,distance:d}=T(u.position,i),m=(r?.speed??c.speed)*c.factor,p=X(St(c.easing)(1-d/n)*m,0,c.maxSpeed),x=P.create(d===0?m:h/d*p,d===0?m:f/d*p);u.position.addTo(x)}},this._singleSelectorRepulse=(i,n)=>{const o=this.container,r=o.actualOptions.interactivity.modes.repulse;if(!r)return;const a=document.querySelectorAll(i);a.length&&a.forEach(l=>{const c=l,u=o.retina.pixelRatio,h={x:(c.offsetLeft+c.offsetWidth/2)*u,y:(c.offsetTop+c.offsetHeight/2)*u},f=c.offsetWidth/2*u,d=n.type==="circle"?new I(h.x,h.y,f):new Y(c.offsetLeft*u,c.offsetTop*u,c.offsetWidth*u,c.offsetHeight*u),m=r.divs,p=Lt(m,c);this._processRepulse(h,f,d,p)})},this._engine=e,t.repulse||(t.repulse={particles:[]}),this.handleClickMode=i=>{const n=this.container.actualOptions,o=n.interactivity.modes.repulse;if(!o||i!=="repulse")return;t.repulse||(t.repulse={particles:[]});const r=t.repulse;r.clicking=!0,r.count=0;for(const a of t.repulse.particles)this.isEnabled(a)&&a.velocity.setTo(a.initialVelocity);r.particles=[],r.finish=!1,setTimeout(()=>{t.destroyed||(r.clicking=!1)},o.duration*1e3)}}clear(){}init(){const e=this.container,t=e.actualOptions.interactivity.modes.repulse;t&&(e.retina.repulseModeDistance=t.distance*e.retina.pixelRatio)}async interact(){const e=this.container,t=e.actualOptions,i=e.interactivity.status===ie,n=t.interactivity.events,o=n.onHover,r=o.enable,a=o.mode,l=n.onClick,c=l.enable,u=l.mode,h=n.onDiv;i&&r&&C("repulse",a)?this._hoverRepulse():c&&C("repulse",u)?this._clickRepulse():tt("repulse",h,(f,d)=>this._singleSelectorRepulse(f,d))}isEnabled(e){const t=this.container,i=t.actualOptions,n=t.interactivity.mouse,o=(e?.interactivity??i.interactivity).events,r=o.onDiv,a=o.onHover,l=o.onClick,c=et("repulse",r);if(!(c||a.enable&&n.position||l.enable&&n.clickPosition))return!1;const u=a.mode,h=l.mode;return C("repulse",u)||C("repulse",h)||c}loadModeOptions(e,...t){e.repulse||(e.repulse=new Ho);for(const i of t)e.repulse.load(i?.repulse)}reset(){}}async function $o(s,e=!0){await s.addInteractor("externalRepulse",t=>new Wo(s,t),e)}class Go{constructor(){this.factor=3,this.radius=200}load(e){e&&(e.factor!==void 0&&(this.factor=e.factor),e.radius!==void 0&&(this.radius=e.radius))}}class No extends j{constructor(e){super(e)}clear(e,t,i){e.slow.inRange&&!i||(e.slow.factor=1)}init(){const e=this.container,t=e.actualOptions.interactivity.modes.slow;t&&(e.retina.slowModeRadius=t.radius*e.retina.pixelRatio)}async interact(){}isEnabled(e){const t=this.container,i=t.interactivity.mouse,n=(e?.interactivity??t.actualOptions.interactivity).events;return n.onHover.enable&&!!i.position&&C("slow",n.onHover.mode)}loadModeOptions(e,...t){e.slow||(e.slow=new Go);for(const i of t)e.slow.load(i?.slow)}reset(e){e.slow.inRange=!1;const t=this.container,i=t.actualOptions,n=t.interactivity.mouse.position,o=t.retina.slowModeRadius,r=i.interactivity.modes.slow;if(!r||!o||o<0||!n)return;const a=e.getPosition(),l=L(n,a),c=l/o,u=r.factor,{slow:h}=e;l>o||(h.inRange=!0,h.factor=c/u)}}async function Xo(s,e=!0){await s.addInteractor("externalSlow",t=>new No(t),e)}const Ne=[0,4,2,1],xt=[8,8,4,2];class Yo{constructor(e){this.pos=0,this.data=new Uint8ClampedArray(e)}getString(e){const t=this.data.slice(this.pos,this.pos+e);return this.pos+=t.length,t.reduce((i,n)=>i+String.fromCharCode(n),"")}nextByte(){return this.data[this.pos++]}nextTwoBytes(){return this.pos+=2,this.data[this.pos-2]+(this.data[this.pos-1]<<8)}readSubBlocks(){let e="",t=0;do{t=this.data[this.pos++];for(let i=t;--i>=0;e+=String.fromCharCode(this.data[this.pos++]));}while(t!==0);return e}readSubBlocksBin(){let e=0,t=0;for(let n=0;(e=this.data[this.pos+n])!==0;n+=e+1)t+=e;const i=new Uint8Array(t);for(let n=0;(e=this.data[this.pos++])!==0;)for(let o=e;--o>=0;i[n++]=this.data[this.pos++]);return i}skipSubBlocks(){for(;this.data[this.pos]!==0;this.pos+=this.data[this.pos]+1);this.pos++}}function ii(s,e){const t=[];for(let i=0;i<e;i++)t.push({r:s.data[s.pos],g:s.data[s.pos+1],b:s.data[s.pos+2]}),s.pos+=3;return t}async function jo(s,e,t,i){switch(s.nextByte()){case 249:{const n=e.frames[t(!1)];s.pos++;const o=s.nextByte();n.GCreserved=(o&224)>>>5,n.disposalMethod=(o&28)>>>2,n.userInputDelayFlag=(o&2)===2;const r=(o&1)===1;n.delayTime=s.nextTwoBytes()*10;const a=s.nextByte();r&&i(a),s.pos++;break}case 255:{s.pos++;const n={identifier:s.getString(8),authenticationCode:s.getString(3),data:s.readSubBlocksBin()};e.applicationExtensions.push(n);break}case 254:{e.comments.push([t(!1),s.readSubBlocks()]);break}case 1:{if(e.globalColorTable.length===0)throw new EvalError("plain text extension without global color table");s.pos++,e.frames[t(!1)].plainTextData={left:s.nextTwoBytes(),top:s.nextTwoBytes(),width:s.nextTwoBytes(),height:s.nextTwoBytes(),charSize:{width:s.nextTwoBytes(),height:s.nextTwoBytes()},foregroundColor:s.nextByte(),backgroundColor:s.nextByte(),text:s.readSubBlocks()};break}default:s.skipSubBlocks();break}}async function Jo(s,e,t,i,n,o){const r=e.frames[i(!0)];r.left=s.nextTwoBytes(),r.top=s.nextTwoBytes(),r.width=s.nextTwoBytes(),r.height=s.nextTwoBytes();const a=s.nextByte(),l=(a&128)===128,c=(a&64)===64;r.sortFlag=(a&32)===32,r.reserved=(a&24)>>>3;const u=1<<(a&7)+1;l&&(r.localColorTable=ii(s,u));const h=g=>{const{r:w,g:k,b}=(l?r.localColorTable:e.globalColorTable)[g];return{r:w,g:k,b,a:g===n(null)?t?~~((w+k+b)/3):0:255}},f=(()=>{try{return new ImageData(r.width,r.height,{colorSpace:"srgb"})}catch(g){if(g instanceof DOMException&&g.name==="IndexSizeError")return null;throw g}})();if(f==null)throw new EvalError("GIF frame size is to large");const d=s.nextByte(),m=s.readSubBlocksBin(),p=1<<d,x=(g,w)=>{const k=g>>>3,b=g&7;return(m[k]+(m[k+1]<<8)+(m[k+2]<<16)&(1<<w)-1<<b)>>>b};if(c){for(let g=0,w=d+1,k=0,b=[[0]],B=0;B<4;B++)if(Ne[B]<r.height)for(let Q=0,A=0;;){const ne=g;if(g=x(k,w),k+=w+1,g===p){w=d+1,b.length=p+2;for(let G=0;G<b.length;G++)b[G]=G<p?[G]:[]}else{g>=b.length?b.push(b[ne].concat(b[ne][0])):ne!==p&&b.push(b[ne].concat(b[g][0]));for(let G=0;G<b[g].length;G++){const{r:Oe,g:Se,b:ai,a:li}=h(b[g][G]);f.data.set([Oe,Se,ai,li],Ne[B]*r.width+xt[B]*A+Q%(r.width*4)),Q+=4}b.length===1<<w&&w<12&&w++}if(Q===r.width*4*(A+1)&&(A++,Ne[B]+xt[B]*A>=r.height))break}r.image=f,r.bitmap=await createImageBitmap(f)}else{for(let g=0,w=d+1,k=0,b=[[0]],B=-4;;){const Q=g;if(g=x(k,w),k+=w,g===p){w=d+1,b.length=p+2;for(let A=0;A<b.length;A++)b[A]=A<p?[A]:[]}else{if(g===p+1)break;g>=b.length?b.push(b[Q].concat(b[Q][0])):Q!==p&&b.push(b[Q].concat(b[g][0]));for(let A=0;A<b[g].length;A++){const{r:ne,g:G,b:Oe,a:Se}=h(b[g][A]);f.data.set([ne,G,Oe,Se],B+=4)}b.length>=1<<w&&w<12&&w++}}r.image=f,r.bitmap=await createImageBitmap(f)}}async function Qo(s,e,t,i,n,o){switch(s.nextByte()){case 59:return!0;case 44:await Jo(s,e,t,i,n);break;case 33:await jo(s,e,i,n);break;default:throw new EvalError("undefined block found")}return!1}function Vo(s){for(const e of s.applicationExtensions)if(e.identifier+e.authenticationCode==="NETSCAPE2.0")return e.data[1]+(e.data[2]<<8);return NaN}async function Zo(s,e,t){t||(t=!1);const i=await fetch(s);if(!i.ok&&i.status===404)throw new EvalError("file not found");const n=await i.arrayBuffer(),o={width:0,height:0,totalTime:0,colorRes:0,pixelAspectRatio:0,frames:[],sortFlag:!1,globalColorTable:[],backgroundImage:new ImageData(1,1,{colorSpace:"srgb"}),comments:[],applicationExtensions:[]},r=new Yo(new Uint8ClampedArray(n));if(r.getString(6)!=="GIF89a")throw new Error("not a supported GIF file");o.width=r.nextTwoBytes(),o.height=r.nextTwoBytes();const a=r.nextByte(),l=(a&128)===128;o.colorRes=(a&112)>>>4,o.sortFlag=(a&8)===8;const c=1<<(a&7)+1,u=r.nextByte();o.pixelAspectRatio=r.nextByte(),o.pixelAspectRatio!==0&&(o.pixelAspectRatio=(o.pixelAspectRatio+15)/64),l&&(o.globalColorTable=ii(r,c));const h=(()=>{try{return new ImageData(o.width,o.height,{colorSpace:"srgb"})}catch(b){if(b instanceof DOMException&&b.name==="IndexSizeError")return null;throw b}})();if(h==null)throw new Error("GIF frame size is to large");const{r:f,g:d,b:m}=o.globalColorTable[u];h.data.set(l?[f,d,m,255]:[0,0,0,0]);for(let b=4;b<h.data.length;b*=2)h.data.copyWithin(b,0,b);o.backgroundImage=h;let p=-1,x=!0,g=-1;const w=b=>(b&&(x=!0),p),k=b=>(b!=null&&(g=b),g);try{do x&&(o.frames.push({left:0,top:0,width:0,height:0,disposalMethod:0,image:new ImageData(1,1,{colorSpace:"srgb"}),plainTextData:null,userInputDelayFlag:!1,delayTime:0,sortFlag:!1,localColorTable:[],reserved:0,GCreserved:0}),p++,g=-1,x=!1);while(!await Qo(r,o,t,w,k,e));o.frames.length--;for(const b of o.frames){if(b.userInputDelayFlag&&b.delayTime===0){o.totalTime=1/0;break}o.totalTime+=b.delayTime}return o}catch(b){throw b instanceof EvalError?new Error(`error while parsing frame ${p} "${b.message}"`):b}}const Ko=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d.]+%?\))|currentcolor/gi;function er(s,e,t){const{svgData:i}=s;if(!i)return"";const n=ue(e,t);if(i.includes("fill"))return i.replace(Ko,()=>n);const o=i.indexOf(">");return`${i.substring(0,o)} fill="${n}"${i.substring(o)}`}async function Me(s){return new Promise(e=>{s.loading=!0;const t=new Image;s.element=t,t.addEventListener("load",()=>{s.loading=!1,e()}),t.addEventListener("error",()=>{s.element=void 0,s.error=!0,s.loading=!1,se().error(`${W} loading image: ${s.source}`),e()}),t.src=s.source})}async function tr(s){if(s.type!=="gif"){await Me(s);return}s.loading=!0;try{s.gifData=await Zo(s.source),s.gifLoopCount=Vo(s.gifData)??0,s.gifLoopCount===0&&(s.gifLoopCount=1/0)}catch{s.error=!0}s.loading=!1}async function ir(s){if(s.type!=="svg"){await Me(s);return}s.loading=!0;const e=await fetch(s.source);e.ok?s.svgData=await e.text():(se().error(`${W} Image not found`),s.error=!0),s.loading=!1}function sr(s,e,t,i){const n=er(s,t,i.opacity?.value??1),o={color:t,gif:e.gif,data:{...s,svgData:n},loaded:!1,ratio:e.width/e.height,replaceColor:e.replaceColor??e.replace_color,source:e.src};return new Promise(r=>{const a=new Blob([n],{type:"image/svg+xml"}),l=URL||window.URL||window.webkitURL||window,c=l.createObjectURL(a),u=new Image;u.addEventListener("load",()=>{o.loaded=!0,o.element=u,r(o),l.revokeObjectURL(c)}),u.addEventListener("error",async()=>{l.revokeObjectURL(c);const h={...s,error:!1,loading:!0};await Me(h),o.loaded=!0,o.element=h.element,r(o)}),u.src=c})}class nr{constructor(e){this.loadImageShape=async t=>{if(!this._engine.loadImage)throw new Error(`${W} image shape not initialized`);await this._engine.loadImage({gif:t.gif,name:t.name,replaceColor:t.replaceColor??t.replace_color??!1,src:t.src})},this._engine=e}addImage(e){this._engine.images||(this._engine.images=[]),this._engine.images.push(e)}draw(e,t,i,n,o){const r=t.image,a=r?.element;if(r){if(e.globalAlpha=n,r.gif&&r.gifData){const l=new OffscreenCanvas(r.gifData.width,r.gifData.height),c=l.getContext("2d");if(!c)throw new Error("could not create offscreen canvas context");c.imageSmoothingQuality="low",c.imageSmoothingEnabled=!1,c.clearRect(0,0,l.width,l.height),t.gifLoopCount===void 0&&(t.gifLoopCount=r.gifLoopCount??0);let u=t.gifFrame??0;const h={x:-r.gifData.width*.5,y:-r.gifData.height*.5},f=r.gifData.frames[u];if(t.gifTime===void 0&&(t.gifTime=0),!f.bitmap)return;switch(e.scale(i/r.gifData.width,i/r.gifData.height),f.disposalMethod){case 4:case 5:case 6:case 7:case 0:c.drawImage(f.bitmap,f.left,f.top),e.drawImage(l,h.x,h.y),c.clearRect(0,0,l.width,l.height);break;case 1:c.drawImage(f.bitmap,f.left,f.top),e.drawImage(l,h.x,h.y);break;case 2:c.drawImage(f.bitmap,f.left,f.top),e.drawImage(l,h.x,h.y),c.clearRect(0,0,l.width,l.height),r.gifData.globalColorTable.length===0?c.putImageData(r.gifData.frames[0].image,h.x+f.left,h.y+f.top):c.putImageData(r.gifData.backgroundImage,h.x,h.y);break;case 3:{const d=c.getImageData(0,0,l.width,l.height);c.drawImage(f.bitmap,f.left,f.top),e.drawImage(l,h.x,h.y),c.clearRect(0,0,l.width,l.height),c.putImageData(d,0,0)}break}if(t.gifTime+=o.value,t.gifTime>f.delayTime){if(t.gifTime-=f.delayTime,++u>=r.gifData.frames.length){if(--t.gifLoopCount<=0)return;u=0,c.clearRect(0,0,l.width,l.height)}t.gifFrame=u}e.scale(r.gifData.width/i,r.gifData.height/i)}else if(a){const l=r.ratio,c={x:-i,y:-i};e.drawImage(a,c.x,c.y,i*2,i*2/l)}e.globalAlpha=1}}getSidesCount(){return 12}async init(e){const t=e.actualOptions;if(!(!t.preload||!this._engine.loadImage))for(const i of t.preload)await this._engine.loadImage(i)}loadShape(e){if(e.shape!=="image"&&e.shape!=="images")return;this._engine.images||(this._engine.images=[]);const t=e.shapeData;this._engine.images.find(n=>n.name===t.name||n.source===t.src)||this.loadImageShape(t).then(()=>{this.loadShape(e)})}particleInit(e,t){if(t.shape!=="image"&&t.shape!=="images")return;this._engine.images||(this._engine.images=[]);const i=this._engine.images,n=t.shapeData,o=t.getFillColor(),r=i.find(l=>l.name===n.name||l.source===n.src);if(!r)return;const a=n.replaceColor??n.replace_color??r.replaceColor;if(r.loading){setTimeout(()=>{this.particleInit(e,t)});return}(async()=>{let l;r.svgData&&o?l=await sr(r,n,o,t):l={color:o,data:r,element:r.element,gif:r.gif,gifData:r.gifData,gifLoopCount:r.gifLoopCount,loaded:!0,ratio:n.width&&n.height?n.width/n.height:r.ratio??1,replaceColor:a,source:n.src},l.ratio||(l.ratio=1);const c=n.fill??t.fill,u=n.close??t.close,h={image:l,fill:c,close:u};t.image=h.image,t.fill=h.fill,t.close=h.close})()}}class or{constructor(){this.src="",this.gif=!1}load(e){e&&(e.gif!==void 0&&(this.gif=e.gif),e.height!==void 0&&(this.height=e.height),e.name!==void 0&&(this.name=e.name),e.replaceColor!==void 0&&(this.replaceColor=e.replaceColor),e.src!==void 0&&(this.src=e.src),e.width!==void 0&&(this.width=e.width))}}class rr{constructor(e){this.id="imagePreloader",this._engine=e}getPlugin(){return{}}loadOptions(e,t){if(!t||!t.preload)return;e.preload||(e.preload=[]);const i=e.preload;for(const n of t.preload){const o=i.find(r=>r.name===n.name||r.src===n.src);if(o)o.load(n);else{const r=new or;r.load(n),i.push(r)}}}needsPlugin(){return!0}}function ar(s){s.loadImage||(s.loadImage=async e=>{if(!e.name&&!e.src)throw new Error(`${W} no image source provided`);if(s.images||(s.images=[]),!s.images.find(t=>t.name===e.name||t.source===e.src))try{const t={gif:e.gif??!1,name:e.name??e.src,source:e.src,type:e.src.substring(e.src.length-3),error:!1,loading:!0,replaceColor:e.replaceColor,ratio:e.width&&e.height?e.width/e.height:void 0};s.images.push(t),await(e.gif?tr:e.replaceColor?ir:Me)(t)}catch{throw new Error(`${W} ${e.name??e.src} not found`)}})}async function lr(s,e=!0){ar(s);const t=new rr(s);await s.addPlugin(t,e),await s.addShape(["image","images"],new nr(s),e)}class cr extends ${constructor(){super(),this.sync=!1}load(e){e&&(super.load(e),e.sync!==void 0&&(this.sync=e.sync))}}class ur extends ${constructor(){super(),this.random.minimumValue=1e-4,this.sync=!1}load(e){e&&(super.load(e),e.sync!==void 0&&(this.sync=e.sync))}}class hr{constructor(){this.count=0,this.delay=new cr,this.duration=new ur}load(e){e&&(e.count!==void 0&&(this.count=e.count),this.delay.load(e.delay),this.duration.load(e.duration))}}class fr{constructor(e){this.container=e}init(e){const t=this.container,i=e.options,n=i.life;n&&(e.life={delay:t.retina.reduceFactor?y(n.delay.value)*(n.delay.sync?1:_())/t.retina.reduceFactor*1e3:0,delayTime:0,duration:t.retina.reduceFactor?y(n.duration.value)*(n.duration.sync?1:_())/t.retina.reduceFactor*1e3:0,time:0,count:n.count},e.life.duration<=0&&(e.life.duration=-1),e.life.count<=0&&(e.life.count=-1),e.life&&(e.spawning=e.life.delay>0))}isEnabled(e){return!e.destroyed}loadOptions(e,...t){e.life||(e.life=new hr);for(const i of t)e.life.load(i?.life)}update(e,t){if(!this.isEnabled(e)||!e.life)return;const i=e.life;let n=!1;if(e.spawning)if(i.delayTime+=t.value,i.delayTime>=e.life.delay)n=!0,e.spawning=!1,i.delayTime=0,i.time=0;else return;if(i.duration===-1||e.spawning||(n?i.time=0:i.time+=t.value,i.time<i.duration))return;if(i.time=0,e.life.count>0&&e.life.count--,e.life.count===0){e.destroy();return}const o=this.container.canvas.size,r=v(0,o.width),a=v(0,o.width);e.position.x=R(r),e.position.y=R(a),e.spawning=!0,i.delayTime=0,i.time=0,e.reset();const l=e.options.life;l&&(i.delay=y(l.delay.value)*1e3,i.duration=y(l.duration.value)*1e3)}}async function dr(s,e=!0){await s.addParticleUpdater("life",t=>new fr(t),e)}class pr{draw(e,t,i){const n=t.shapeData;e.moveTo(-i/2,0),e.lineTo(i/2,0),e.lineCap=n?.cap??"butt"}getSidesCount(){return 1}}async function mr(s,e=!0){await s.addShape("line",new pr,e)}class yr{init(){}isEnabled(e){return!le()&&!e.destroyed&&e.container.actualOptions.interactivity.events.onHover.parallax.enable}move(e){const t=e.container,i=t.actualOptions,n=i.interactivity.events.onHover.parallax;if(le()||!n.enable)return;const o=n.force,r=t.interactivity.mouse.position;if(!r)return;const a=t.canvas.size,l={x:a.width/2,y:a.height/2},c=n.smooth,u=e.getRadius()/o,h={x:(r.x-l.x)*u,y:(r.y-l.y)*u},{offset:f}=e;f.x+=(h.x-f.x)/c,f.y+=(h.y-f.y)/c}}async function gr(s,e=!0){await s.addMover("parallax",()=>new yr,e)}class br extends nt{constructor(e){super(e)}clear(){}init(){}async interact(e){const t=this.container,i=e.retina.attractDistance??t.retina.attractDistance,n=e.getPosition(),o=t.particles.quadTree.queryCircle(n,i);for(const r of o){if(e===r||!r.options.move.attract.enable||r.destroyed||r.spawning)continue;const a=r.getPosition(),{dx:l,dy:c}=T(n,a),u=e.options.move.attract.rotate,h=l/(u.x*1e3),f=c/(u.y*1e3),d=r.size.value/e.size.value,m=1/d;e.velocity.x-=h*d,e.velocity.y-=f*d,r.velocity.x+=h*m,r.velocity.y+=f*m}}isEnabled(e){return e.options.move.attract.enable}reset(){}}async function vr(s,e=!0){await s.addInteractor("particlesAttract",t=>new br(t),e)}function _t(s,e,t,i,n,o){const r=X(s.options.collisions.absorb.speed*n.factor/10,0,i);s.size.value+=r/2,t.size.value-=r,i<=o&&(t.size.value=0,t.destroy())}function wr(s,e,t,i){const n=s.getRadius(),o=e.getRadius();n===void 0&&o!==void 0?s.destroy():n!==void 0&&o===void 0?e.destroy():n!==void 0&&o!==void 0&&(n>=o?_t(s,n,e,o,t,i):_t(e,o,s,n,t,i))}const kt=s=>{s.collisionMaxSpeed===void 0&&(s.collisionMaxSpeed=y(s.options.collisions.maxSpeed)),s.velocity.length>s.collisionMaxSpeed&&(s.velocity.length=s.collisionMaxSpeed)};function si(s,e){At(Qe(s),Qe(e)),kt(s),kt(e)}function xr(s,e){!s.unbreakable&&!e.unbreakable&&si(s,e),s.getRadius()===void 0&&e.getRadius()!==void 0?s.destroy():s.getRadius()!==void 0&&e.getRadius()===void 0?e.destroy():s.getRadius()!==void 0&&e.getRadius()!==void 0&&(s.getRadius()>=e.getRadius()?e:s).destroy()}function _r(s,e,t,i){switch(s.options.collisions.mode){case"absorb":{wr(s,e,t,i);break}case"bounce":{si(s,e);break}case"destroy":{xr(s,e);break}}}class kr extends nt{constructor(e){super(e)}clear(){}init(){}async interact(e,t){if(e.destroyed||e.spawning)return;const i=this.container,n=e.getPosition(),o=e.getRadius(),r=i.particles.quadTree.queryCircle(n,o*2);for(const a of r){if(e===a||!a.options.collisions.enable||e.options.collisions.mode!==a.options.collisions.mode||a.destroyed||a.spawning)continue;const l=a.getPosition(),c=a.getRadius();if(Math.abs(Math.round(n.z)-Math.round(l.z))>o+c)continue;const u=L(n,l),h=o+c;u>h||_r(e,a,t,i.retina.pixelRatio)}}isEnabled(e){return e.options.collisions.enable}reset(){}}async function Pr(s,e=!0){await s.addInteractor("particlesCollisions",t=>new kr(t),e)}class Cr extends I{constructor(e,t,i,n){super(e,t,i),this.canvasSize=n,this.canvasSize={...n}}contains(e){const{width:t,height:i}=this.canvasSize,{x:n,y:o}=e;return super.contains(e)||super.contains({x:n-t,y:o})||super.contains({x:n-t,y:o-i})||super.contains({x:n,y:o-i})}intersects(e){if(super.intersects(e))return!0;const t=e,i=e,n={x:e.position.x-this.canvasSize.width,y:e.position.y-this.canvasSize.height};if(i.radius!==void 0){const o=new I(n.x,n.y,i.radius*2);return super.intersects(o)}else if(t.size!==void 0){const o=new Y(n.x,n.y,t.size.width*2,t.size.height*2);return super.intersects(o)}return!1}}class Mr{constructor(){this.blur=5,this.color=new O,this.color.value="#000",this.enable=!1}load(e){e&&(e.blur!==void 0&&(this.blur=e.blur),this.color=O.create(this.color,e.color),e.enable!==void 0&&(this.enable=e.enable))}}class zr{constructor(){this.enable=!1,this.frequency=1}load(e){e&&(e.color!==void 0&&(this.color=O.create(this.color,e.color)),e.enable!==void 0&&(this.enable=e.enable),e.frequency!==void 0&&(this.frequency=e.frequency),e.opacity!==void 0&&(this.opacity=e.opacity))}}class Or{constructor(){this.blink=!1,this.color=new O,this.color.value="#fff",this.consent=!1,this.distance=100,this.enable=!1,this.frequency=1,this.opacity=1,this.shadow=new Mr,this.triangles=new zr,this.width=1,this.warp=!1}load(e){e&&(e.id!==void 0&&(this.id=e.id),e.blink!==void 0&&(this.blink=e.blink),this.color=O.create(this.color,e.color),e.consent!==void 0&&(this.consent=e.consent),e.distance!==void 0&&(this.distance=e.distance),e.enable!==void 0&&(this.enable=e.enable),e.frequency!==void 0&&(this.frequency=e.frequency),e.opacity!==void 0&&(this.opacity=e.opacity),this.shadow.load(e.shadow),this.triangles.load(e.triangles),e.width!==void 0&&(this.width=e.width),e.warp!==void 0&&(this.warp=e.warp))}}function Sr(s,e,t,i,n){const{dx:o,dy:r,distance:a}=T(s,e);if(!n||a<=t)return a;const l={x:Math.abs(o),y:Math.abs(r)},c={x:Math.min(l.x,i.width-l.x),y:Math.min(l.y,i.height-l.y)};return Math.sqrt(c.x**2+c.y**2)}class Dr extends nt{constructor(e){super(e),this._setColor=t=>{if(!t.options.links)return;const i=this.linkContainer,n=t.options.links;let o=n.id===void 0?i.particles.linksColor:i.particles.linksColors.get(n.id);if(o)return;const r=n.color;o=Nt(r,n.blink,n.consent),n.id===void 0?i.particles.linksColor=o:i.particles.linksColors.set(n.id,o)},this.linkContainer=e}clear(){}init(){this.linkContainer.particles.linksColor=void 0,this.linkContainer.particles.linksColors=new Map}async interact(e){if(!e.options.links)return;e.links=[];const t=e.getPosition(),i=this.container,n=i.canvas.size;if(t.x<0||t.y<0||t.x>n.width||t.y>n.height)return;const o=e.options.links,r=o.opacity,a=e.retina.linksDistance??0,l=o.warp,c=l?new Cr(t.x,t.y,a,n):new I(t.x,t.y,a),u=i.particles.quadTree.query(c);for(const h of u){const f=h.options.links;if(e===h||!f?.enable||o.id!==f.id||h.spawning||h.destroyed||!h.links||e.links.some(x=>x.destination===h)||h.links.some(x=>x.destination===e))continue;const d=h.getPosition();if(d.x<0||d.y<0||d.x>n.width||d.y>n.height)continue;const m=Sr(t,d,a,n,l&&f.warp);if(m>a)continue;const p=(1-m/a)*r;this._setColor(e),e.links.push({destination:h,opacity:p})}}isEnabled(e){return!!e.options.links?.enable}loadParticlesOptions(e,...t){e.links||(e.links=new Or);for(const i of t)e.links.load(i?.links??i?.lineLinked??i?.line_linked)}reset(){}}async function Rr(s,e=!0){await s.addInteractor("particlesLinks",t=>new Dr(t),e)}function Tr(s){let e=!1;const{begin:t,end:i,maxDistance:n,context:o,canvasSize:r,width:a,backgroundMask:l,colorLine:c,opacity:u,links:h}=s;if(L(t,i)<=n)de(o,t,i),e=!0;else if(h.warp){let d,m;const p={x:i.x-r.width,y:i.y},x=T(t,p);if(x.distance<=n){const g=t.y-x.dy/x.dx*t.x;d={x:0,y:g},m={x:r.width,y:g}}else{const g={x:i.x,y:i.y-r.height},w=T(t,g);if(w.distance<=n){const b=-(t.y-w.dy/w.dx*t.x)/(w.dy/w.dx);d={x:b,y:0},m={x:b,y:r.height}}else{const k={x:i.x-r.width,y:i.y-r.height},b=T(t,k);if(b.distance<=n){const B=t.y-b.dy/b.dx*t.x;d={x:-B/(b.dy/b.dx),y:B},m={x:d.x+r.width,y:d.y+r.height}}}}d&&m&&(de(o,t,d),de(o,i,m),e=!0)}if(!e)return;o.lineWidth=a,l.enable&&(o.globalCompositeOperation=l.composite),o.strokeStyle=J(c,u);const{shadow:f}=h;if(f.enable){const d=H(f.color);d&&(o.shadowBlur=f.blur,o.shadowColor=J(d))}o.stroke()}function Er(s){const{context:e,pos1:t,pos2:i,pos3:n,backgroundMask:o,colorTriangle:r,opacityTriangle:a}=s;Ei(e,t,i,n),o.enable&&(e.globalCompositeOperation=o.composite),e.fillStyle=J(r,a),e.fill()}function Ir(s){return s.sort((e,t)=>e-t),s.join("_")}function Pt(s,e){const t=Ir(s.map(n=>n.id));let i=e.get(t);return i===void 0&&(i=_(),e.set(t,i)),i}class Lr{constructor(e){this.container=e,this._drawLinkLine=(t,i)=>{const n=t.options.links;if(!n?.enable)return;const o=this.container,r=o.actualOptions,a=i.destination,l=t.getPosition(),c=a.getPosition();let u=i.opacity;o.canvas.draw(h=>{let f;const d=t.options.twinkle?.lines;if(d?.enable){const g=d.frequency,w=H(d.color);_()<g&&w&&(f=w,u=y(d.opacity))}if(!f){const g=n.id!==void 0?o.particles.linksColors.get(n.id):o.particles.linksColor;f=Ve(t,a,g)}if(!f)return;const m=t.retina.linksWidth??0,p=t.retina.linksDistance??0,{backgroundMask:x}=r;Tr({context:h,width:m,begin:l,end:c,maxDistance:p,canvasSize:o.canvas.size,links:n,backgroundMask:x,colorLine:f,opacity:u})})},this._drawLinkTriangle=(t,i,n)=>{const o=t.options.links;if(!o?.enable)return;const r=o.triangles;if(!r.enable)return;const a=this.container,l=a.actualOptions,c=i.destination,u=n.destination,h=r.opacity??(i.opacity+n.opacity)/2;h<=0||a.canvas.draw(f=>{const d=t.getPosition(),m=c.getPosition(),p=u.getPosition(),x=t.retina.linksDistance??0;if(L(d,m)>x||L(p,m)>x||L(p,d)>x)return;let g=H(r.color);if(!g){const w=o.id!==void 0?a.particles.linksColors.get(o.id):a.particles.linksColor;g=Ve(t,c,w)}g&&Er({context:f,pos1:d,pos2:m,pos3:p,backgroundMask:l.backgroundMask,colorTriangle:g,opacityTriangle:h})})},this._drawTriangles=(t,i,n,o)=>{const r=n.destination;if(!(t.links?.triangles.enable&&r.options.links?.triangles.enable))return;const a=r.links?.filter(l=>{const c=this._getLinkFrequency(r,l.destination);return r.options.links&&c<=r.options.links.frequency&&o.findIndex(u=>u.destination===l.destination)>=0});if(a?.length)for(const l of a){const c=l.destination;this._getTriangleFrequency(i,r,c)>t.links.triangles.frequency||this._drawLinkTriangle(i,n,l)}},this._getLinkFrequency=(t,i)=>Pt([t,i],this._freqs.links),this._getTriangleFrequency=(t,i,n)=>Pt([t,i,n],this._freqs.triangles),this._freqs={links:new Map,triangles:new Map}}drawParticle(e,t){const{links:i,options:n}=t;if(!i||i.length<=0)return;const o=i.filter(r=>n.links&&this._getLinkFrequency(t,r.destination)<=n.links.frequency);for(const r of o)this._drawTriangles(n,t,r,o),r.opacity>0&&(t.retina.linksWidth??0)>0&&this._drawLinkLine(t,r)}async init(){this._freqs.links=new Map,this._freqs.triangles=new Map}particleCreated(e){if(e.links=[],!e.options.links)return;const t=this.container.retina.pixelRatio,{retina:i}=e,{distance:n,width:o}=e.options.links;i.linksDistance=n*t,i.linksWidth=o*t}particleDestroyed(e){e.links=[]}}class Ar{constructor(){this.id="links"}getPlugin(e){return new Lr(e)}loadOptions(){}needsPlugin(){return!0}}async function Fr(s,e=!0){const t=new Ar;await s.addPlugin(t,e)}async function qr(s,e=!0){await Rr(s,e),await Fr(s,e)}class ni{draw(e,t,i){const n=this.getCenter(t,i),o=this.getSidesData(t,i),r=o.count.numerator*o.count.denominator,a=o.count.numerator/o.count.denominator,l=180*(a-2)/a,c=Math.PI-Math.PI*l/180;if(e){e.beginPath(),e.translate(n.x,n.y),e.moveTo(0,0);for(let u=0;u<r;u++)e.lineTo(o.length,0),e.translate(o.length,0),e.rotate(c)}}getSidesCount(e){const t=e.shapeData;return Math.round(y(t?.sides??t?.nb_sides??5))}}class Br extends ni{getCenter(e,t){return{x:-t/(e.sides/3.5),y:-t/(2.66/3.5)}}getSidesData(e,t){const i=e.sides;return{count:{denominator:1,numerator:i},length:t*2.66/(i/3)}}}class Ur extends ni{getCenter(e,t){return{x:-t,y:t/1.66}}getSidesCount(){return 3}getSidesData(e,t){return{count:{denominator:2,numerator:3},length:t*2}}}async function Hr(s,e=!0){await s.addShape("polygon",new Br,e)}async function Wr(s,e=!0){await s.addShape("triangle",new Ur,e)}async function $r(s,e=!0){await Hr(s,e),await Wr(s,e)}class Gr{constructor(){this.enable=!1,this.speed=0,this.decay=0,this.sync=!1}load(e){e&&(e.enable!==void 0&&(this.enable=e.enable),e.speed!==void 0&&(this.speed=v(e.speed)),e.decay!==void 0&&(this.decay=v(e.decay)),e.sync!==void 0&&(this.sync=e.sync))}}class Nr extends ${constructor(){super(),this.animation=new Gr,this.direction="clockwise",this.path=!1,this.value=0}load(e){e&&(super.load(e),e.direction!==void 0&&(this.direction=e.direction),this.animation.load(e.animation),e.path!==void 0&&(this.path=e.path))}}function Xr(s,e){const t=s.rotate,i=s.options.rotate;if(!t||!i)return;const n=i.animation,o=(t.velocity??0)*e.factor,r=2*Math.PI,a=t.decay??1;if(n.enable){switch(t.status){case"increasing":t.value+=o,t.value>r&&(t.value-=r);break;case"decreasing":default:t.value-=o,t.value<0&&(t.value+=r);break}t.velocity&&a!==1&&(t.velocity*=a)}}class Yr{constructor(e){this.container=e}init(e){const t=e.options.rotate;if(!t)return;e.rotate={enable:t.animation.enable,value:y(t.value)*Math.PI/180},e.pathRotation=t.path;let i=t.direction;switch(i==="random"&&(i=Math.floor(_()*2)>0?"counter-clockwise":"clockwise"),i){case"counter-clockwise":case"counterClockwise":e.rotate.status="decreasing";break;case"clockwise":e.rotate.status="increasing";break}const n=t.animation;n.enable&&(e.rotate.decay=1-y(n.decay),e.rotate.velocity=y(n.speed)/360*this.container.retina.reduceFactor,n.sync||(e.rotate.velocity*=_())),e.rotation=e.rotate.value}isEnabled(e){const t=e.options.rotate;return t?!e.destroyed&&!e.spawning&&t.animation.enable&&!t.path:!1}loadOptions(e,...t){e.rotate||(e.rotate=new Nr);for(const i of t)e.rotate.load(i?.rotate)}update(e,t){this.isEnabled(e)&&(Xr(e,t),e.rotation=e.rotate?.value??0)}}async function jr(s,e=!0){await s.addParticleUpdater("rotate",t=>new Yr(t),e)}const Jr=Math.sqrt(2);class Qr{draw(e,t,i){const n=i/Jr,o=n*2;e.rect(-n,-n,o,o)}getSidesCount(){return 4}}async function Vr(s,e=!0){await s.addShape(["edge","square"],new Qr,e)}class Zr{draw(e,t,i){const n=t.sides,o=t.starInset??2;e.moveTo(0,0-i);for(let r=0;r<n;r++)e.rotate(Math.PI/n),e.lineTo(0,0-i*o),e.rotate(Math.PI/n),e.lineTo(0,0-i)}getSidesCount(e){const t=e.shapeData;return Math.round(y(t?.sides??t?.nb_sides??5))}particleInit(e,t){const i=t.shapeData,n=y(i?.inset??2);t.starInset=n}}async function Kr(s,e=!0){await s.addShape("star",new Zr,e)}function Xe(s,e,t,i,n){if(!e||!t.enable||(e.maxLoops??0)>0&&(e.loops??0)>(e.maxLoops??0)||(e.time||(e.time=0),(e.delayTime??0)>0&&e.time<(e.delayTime??0)&&(e.time+=s.value),(e.delayTime??0)>0&&e.time<(e.delayTime??0)))return;const o=R(t.offset),r=(e.velocity??0)*s.factor+o*3.6,a=e.decay??1;!n||e.status==="increasing"?(e.value+=r,e.value>i&&(e.loops||(e.loops=0),e.loops++,n&&(e.status="decreasing",e.value-=e.value%i))):(e.value-=r,e.value<0&&(e.loops||(e.loops=0),e.loops++,e.status="increasing",e.value+=e.value)),e.velocity&&a!==1&&(e.velocity*=a),e.value>i&&(e.value%=i)}function ea(s,e){if(!s.strokeColor||!s.strokeAnimation)return;const{h:t,s:i,l:n}=s.strokeColor,{h:o,s:r,l:a}=s.strokeAnimation;t&&Xe(e,t,o,360,!1),i&&Xe(e,i,r,100,!0),n&&Xe(e,n,a,100,!0)}class ta{constructor(e){this.container=e}init(e){const t=this.container,i=e.options,n=q(i.stroke,e.id,i.reduceDuplicates);e.strokeWidth=y(n.width)*t.retina.pixelRatio,e.strokeOpacity=y(n.opacity??1),e.strokeAnimation=n.color?.animation;const o=te(n.color)??e.getFillColor();o&&(e.strokeColor=Xt(o,e.strokeAnimation,t.retina.reduceFactor))}isEnabled(e){const t=e.strokeAnimation,{strokeColor:i}=e;return!e.destroyed&&!e.spawning&&!!t&&(i?.h.value!==void 0&&i.h.enable||i?.s.value!==void 0&&i.s.enable||i?.l.value!==void 0&&i.l.enable)}update(e,t){this.isEnabled(e)&&ea(e,t)}}async function ia(s,e=!0){await s.addParticleUpdater("strokeColor",t=>new ta(t),e)}const ve=["text","character","char"];class sa{draw(e,t,i,n){const o=t.shapeData;if(o===void 0)return;const r=o.value;if(r===void 0)return;t.text===void 0&&(t.text=q(r,t.randomIndexData));const a=t.text,l=o.style??"",c=o.weight??"400",u=Math.round(i)*2,h=o.font??"Verdana",f=t.fill,d=a.length*i/2;e.font=`${l} ${c} ${u}px "${h}"`;const m={x:-d,y:i/2};e.globalAlpha=n,f?e.fillText(a,m.x,m.y):e.strokeText(a,m.x,m.y),e.globalAlpha=1}getSidesCount(){return 12}async init(e){const t=e.actualOptions;if(ve.find(i=>C(i,t.particles.shape.type))){const i=ve.map(o=>t.particles.shape.options[o]).find(o=>!!o),n=[];M(i,o=>{n.push(Ci(o.font,o.weight))}),await Promise.all(n)}}particleInit(e,t){if(!t.shape||!ve.includes(t.shape))return;const i=t.shapeData;if(i===void 0)return;const n=i.value;n!==void 0&&(t.text=q(n,t.randomIndexData))}}async function na(s,e=!0){await s.addShape(ve,new sa,e)}async function oa(s,e=!0){Sn(s),await gr(s,!1),await co(s,!1),await fo(s,!1),await go(s,!1),await Co(s,!1),await Ro(s,!1),await Eo(s,!1),await Ao(s,!1),await Bo(s,!1),await $o(s,!1),await Xo(s,!1),await vr(s,!1),await Pr(s,!1),await qr(s,!1),await ro(),await lr(s,!1),await mr(s,!1),await $r(s,!1),await Vr(s,!1),await Kr(s,!1),await na(s,!1),await dr(s,!1),await jr(s,!1),await ia(s,!1),await oo(s,e)}class ra{constructor(){this.enable=!1,this.speed=0,this.decay=0,this.sync=!1}load(e){e&&(e.enable!==void 0&&(this.enable=e.enable),e.speed!==void 0&&(this.speed=v(e.speed)),e.decay!==void 0&&(this.decay=v(e.decay)),e.sync!==void 0&&(this.sync=e.sync))}}class aa extends ${constructor(){super(),this.animation=new ra,this.direction="clockwise",this.enable=!1,this.value=0}load(e){super.load(e),e&&(this.animation.load(e.animation),e.direction!==void 0&&(this.direction=e.direction),e.enable!==void 0&&(this.enable=e.enable))}}function la(s,e){if(!s.tilt||!s.options.tilt)return;const t=s.options.tilt,i=t.animation,n=(s.tilt.velocity??0)*e.factor,o=2*Math.PI,r=s.tilt.decay??1;if(i.enable){switch(s.tilt.status){case"increasing":s.tilt.value+=n,s.tilt.value>o&&(s.tilt.value-=o);break;case"decreasing":default:s.tilt.value-=n,s.tilt.value<0&&(s.tilt.value+=o);break}s.tilt.velocity&&r!==1&&(s.tilt.velocity*=r)}}class ca{constructor(e){this.container=e}getTransformValues(e){const t=e.tilt?.enable&&e.tilt;return{b:t?Math.cos(t.value)*t.cosDirection:void 0,c:t?Math.sin(t.value)*t.sinDirection:void 0}}init(e){const t=e.options.tilt;if(!t)return;e.tilt={enable:t.enable,value:y(t.value)*Math.PI/180,sinDirection:_()>=.5?1:-1,cosDirection:_()>=.5?1:-1};let i=t.direction;switch(i==="random"&&(i=Math.floor(_()*2)>0?"counter-clockwise":"clockwise"),i){case"counter-clockwise":case"counterClockwise":e.tilt.status="decreasing";break;case"clockwise":e.tilt.status="increasing";break}const n=e.options.tilt?.animation;n?.enable&&(e.tilt.decay=1-y(n.decay),e.tilt.velocity=y(n.speed)/360*this.container.retina.reduceFactor,n.sync||(e.tilt.velocity*=_()))}isEnabled(e){const t=e.options.tilt?.animation;return!e.destroyed&&!e.spawning&&!!t?.enable}loadOptions(e,...t){e.tilt||(e.tilt=new aa);for(const i of t)e.tilt.load(i?.tilt)}update(e,t){this.isEnabled(e)&&la(e,t)}}async function ua(s,e=!0){await s.addParticleUpdater("tilt",t=>new ca(t),e)}class Ct{constructor(){this.enable=!1,this.frequency=.05,this.opacity=1}load(e){e&&(e.color!==void 0&&(this.color=O.create(this.color,e.color)),e.enable!==void 0&&(this.enable=e.enable),e.frequency!==void 0&&(this.frequency=e.frequency),e.opacity!==void 0&&(this.opacity=v(e.opacity)))}}class ha{constructor(){this.lines=new Ct,this.particles=new Ct}load(e){e&&(this.lines.load(e.lines),this.particles.load(e.particles))}}class fa{getColorStyles(e,t,i,n){const o=e.options,r=o.twinkle;if(!r)return{};const a=r.particles,l=a.enable&&_()<a.frequency,c=e.options.zIndex,u=(1-e.zIndexFactor)**c.opacityRate,h=l?y(a.opacity)*u:n,f=te(a.color),d=f?ue(f,h):void 0,m={},p=l&&d;return m.fill=p?d:void 0,m.stroke=p?d:void 0,m}init(){}isEnabled(e){const t=e.options,i=t.twinkle;return i?i.particles.enable:!1}loadOptions(e,...t){e.twinkle||(e.twinkle=new ha);for(const i of t)e.twinkle.load(i?.twinkle)}update(){}}async function da(s,e=!0){await s.addParticleUpdater("twinkle",()=>new fa,e)}class pa{constructor(){this.angle=50,this.move=10}load(e){e&&(e.angle!==void 0&&(this.angle=v(e.angle)),e.move!==void 0&&(this.move=v(e.move)))}}class ma{constructor(){this.distance=5,this.enable=!1,this.speed=new pa}load(e){if(e&&(e.distance!==void 0&&(this.distance=v(e.distance)),e.enable!==void 0&&(this.enable=e.enable),e.speed!==void 0))if(E(e.speed))this.speed.load({angle:e.speed});else{const t=e.speed;t.min!==void 0?this.speed.load({angle:t}):this.speed.load(e.speed)}}}function ya(s,e){const{wobble:t}=s.options,{wobble:i}=s;if(!t?.enable||!i)return;const n=i.angleSpeed*e.factor,o=i.moveSpeed*e.factor,r=o*((s.retina.wobbleDistance??0)*e.factor)/(1e3/60),a=2*Math.PI,{position:l}=s;i.angle+=n,i.angle>a&&(i.angle-=a),l.x+=r*Math.cos(i.angle),l.y+=r*Math.abs(Math.sin(i.angle))}class ga{constructor(e){this.container=e}init(e){const t=e.options.wobble;t?.enable?e.wobble={angle:_()*Math.PI*2,angleSpeed:y(t.speed.angle)/360,moveSpeed:y(t.speed.move)/10}:e.wobble={angle:0,angleSpeed:0,moveSpeed:0},e.retina.wobbleDistance=y(t?.distance??0)*this.container.retina.pixelRatio}isEnabled(e){return!e.destroyed&&!e.spawning&&!!e.options.wobble?.enable}loadOptions(e,...t){e.wobble||(e.wobble=new ma);for(const i of t)e.wobble.load(i?.wobble)}update(e,t){this.isEnabled(e)&&ya(e,t)}}async function ba(s,e=!0){await s.addParticleUpdater("wobble",t=>new ga(t),e)}async function va(s,e=!0){await un(s,!1),await zn(s,!1),await ua(s,!1),await da(s,!1),await ba(s,!1),await _n(s,!1),await en(s,!1),await vn(s,!1),await oa(s,e)}const{useState:Mt,useCallback:Ye,useRef:zt,useEffect:wa}=await Ot("react"),ke=(s,e,t)=>{const i=t?{type:"image",options:{image:{src:t,width:100,height:100,gif:!0,fill:!0}}}:{type:"char",options:{char:{value:["🦄"],font:"16px serif",style:"",weight:"400",fill:!0}}};return{direction:s,life:{count:1,duration:1},rate:{quantity:2,delay:Number.MIN_VALUE},position:e,particles:{shape:i,move:{enable:!0,angle:{value:45,offset:{max:35,min:-35}},random:!0,speed:55,gravity:{enable:!0,acceleration:25},outModes:{default:"destroy"}},rotate:{value:{min:0,max:360},direction:"random",animation:{enable:!0,speed:{min:-55,max:55}}},tilt:{direction:"random",enable:!0,value:{min:0,max:360},animation:{enable:!0,speed:{min:-10,max:10}}},wobble:{distance:30,enable:!0,speed:{min:-45,max:45}},size:{value:{min:30,max:40}},number:{value:0},opacity:{value:1}}}},xa={backgroundMode:{enable:!0,zIndex:50},emitters:[ke("top-right",{x:0,y:40}),ke("top-left",{x:100,y:40})]};function Ma(){const s=zt(!1),e=zt(),[t,i]=Mt(!1),[n,o]=Mt(0),r=Ye(async c=>{s.current||(await va(c),s.current=!0)},[]),a=Ye(async c=>{e.current&&(e.current.stop(),e.current.destroy(),e.current=void 0);const u={...xa,emitters:[ke("top-right",{x:0,y:40},c),ke("top-left",{x:100,y:40},c)]},h=await pe.load("tsparticles",u);e.current=h},[]),l=Ye(()=>{t||(i(!0),setTimeout(()=>{o(0),i(!1)},3e3));const c=n+1;o(c),c===5&&(a(),o(0))},[n,t,a]);return wa(()=>()=>{e.current?.destroy(),e.current=void 0},[]),{triggerConfetti:a,triggerCounterRain:l,particlesInit:r}}const ae=s=>typeof s=="object"&&s!==null;function Pe(s,e,t=()=>!1){if(!ae(s)||!ae(e))return s===e;const i=Object.keys(s).filter(o=>!t(o)),n=Object.keys(e).filter(o=>!t(o));if(i.length!==n.length)return!1;for(const o of i){const r=s[o],a=e[o];if(ae(r)&&ae(a)){if(r===e&&a===s)continue;if(!Pe(r,a,t))return!1}else if(Array.isArray(r)&&Array.isArray(a)){if(!oi(r,a,t))return!1}else if(r!==a)return!1}return!0}function oi(s,e,t){if(s.length!==e.length)return!1;for(let i=0;i<s.length;i++){const n=s[i],o=e[i];if(Array.isArray(n)&&Array.isArray(o)){if(!oi(n,o,t))return!1}else if(ae(n)&&ae(o)){if(!Pe(n,o,t))return!1}else if(n!==o)return!1}return!0}const Ze=await Ot("react"),{Component:_a}=Ze,ri="tsparticles";class ze extends _a{constructor(e){super(e),this.state={init:!1,library:void 0}}destroy(){this.state.library&&(this.state.library.destroy(),this.setState({library:void 0}))}shouldComponentUpdate(e){const t=e.options??e.params,i=this.props.options??this.props.params;return e.url!==this.props.url||e.id!==this.props.id||e.canvasClassName!==this.props.canvasClassName||e.className!==this.props.className||e.height!==this.props.height||e.width!==this.props.width||!Pe(e.style,this.props.style)||e.init!==this.props.init||e.loaded!==this.props.loaded||!Pe(t,i,n=>n.startsWith("_"))}componentDidUpdate(){this.refresh()}forceUpdate(){this.refresh().then(()=>{super.forceUpdate()})}componentDidMount(){(async()=>(this.props.init&&await this.props.init(pe),this.setState({init:!0},async()=>{await this.loadParticles()})))()}componentWillUnmount(){this.destroy()}render(){const{width:e,height:t,className:i,canvasClassName:n,id:o}=this.props;return Ze.createElement("div",{className:i,id:o},Ze.createElement("canvas",{className:n,style:{...this.props.style,width:e,height:t}}))}async refresh(){this.destroy(),await this.loadParticles()}async loadParticles(){if(!this.state.init)return;const e=this.props.id??ze.defaultProps.id??ri,t=await pe.load({url:this.props.url,id:e,options:this.props.options??this.props.params});this.props.container&&(this.props.container.current=t),this.setState({library:t}),this.props.loaded&&await this.props.loaded(t)}}ze.defaultProps={width:"100%",height:"100%",options:{},style:{},url:void 0,id:ri};const za=ze;export{za as P,Ma as u}; //# sourceMappingURL=Particles-DVCmyRgI.js.map