@xdy-npm/react-particle-backgrounds 1.0.3 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -2
- package/dist/index.d.ts +16 -1
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +990 -903
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var co=Object.create;var on=Object.defineProperty;var lo=Object.getOwnPropertyDescriptor;var uo=Object.getOwnPropertyNames;var ho=Object.getPrototypeOf,fo=Object.prototype.hasOwnProperty;var po=(t,e,i,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of uo(e))!fo.call(t,s)&&s!==i&&on(t,s,{get:()=>e[s],enumerable:!(n=lo(e,s))||n.enumerable});return t};var mo=(t,e,i)=>(i=t!=null?co(ho(t)):{},po(e||!t||!t.__esModule?on(i,"default",{value:t,enumerable:!0}):i,t));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const D=require("react/jsx-runtime"),I=require("react"),je="generated",yo="pointerdown",go="pointerup",_i="pointerleave",vo="pointerout",Qe="pointermove",bo="touchstart",rn="touchend",wo="touchmove",xo="touchcancel",_o="resize",ko="visibilitychange",ue="tsParticles - Error",Te=100,q=.5,W=1e3,j={x:0,y:0,z:0},It={a:1,b:0,c:0,d:1},mt="random",Ht="mid",G=2,Co=Math.PI*G,si=60,us="true",an="false",oi="canvas",cn=0,Me=2,ln=4,Po=1,un=1,hn=1,Mo=4,hs=1,Ut=255,We=360,ki=100,Ci=100,fn=0,Pi=0,zo=60,So=0,Wt=.25,dn=q+Wt,pn=0,Oo=1,Ro=0,To=0,Eo=1,Ii=1,Io=1,mn=1,Gt=0,fs=1,Do=0,Lo=120,Ao=0,Fo=0,Bo=1e4,qo=0,$o=1,Nt=0,ds=1,Vo=1,Ho=0,yn=1,Uo=0,jo=0,gn=-Wt,vn=1.5,bn=0,Wo=1,Go=0,Mi=0,ps=1,No=1,Yt=1,Yo=500,wn=50,Qo=0,zi=1,ms=0,xn=1,Xo=0,Be=255,ri=3,ai=6,Zo=1,Ko=1,Jo=0,er=0,tr=0,ir=0;var H;(function(t){t.bottom="bottom",t.bottomLeft="bottom-left",t.bottomRight="bottom-right",t.left="left",t.none="none",t.right="right",t.top="top",t.topLeft="top-left",t.topRight="top-right",t.outside="outside",t.inside="inside"})(H||(H={}));function ys(t){return typeof t=="boolean"}function De(t){return typeof t=="string"}function Le(t){return typeof t=="number"}function at(t){return typeof t=="object"&&t!==null}function ke(t){return Array.isArray(t)}function g(t){return t==null}class ne{constructor(e,i,n){if(this._updateFromAngle=(s,o)=>{this.x=Math.cos(s)*o,this.y=Math.sin(s)*o},!Le(e)&&e){this.x=e.x,this.y=e.y;const s=e;this.z=s.z?s.z:j.z}else if(e!==void 0&&i!==void 0)this.x=e,this.y=i,this.z=n??j.z;else throw new Error(`${ue} Vector3d not initialized correctly`)}static get origin(){return ne.create(j.x,j.y,j.z)}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 ne.create(e.x,e.y,e.z)}static create(e,i,n){return new ne(e,i,n)}add(e){return ne.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 ne.clone(this)}distanceTo(e){return this.sub(e).length}distanceToSq(e){return this.sub(e).getLengthSq()}div(e){return ne.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**Me+this.y**Me}mult(e){return ne.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!=Nt&&this.multTo(hs/e)}rotate(e){return ne.create(this.x*Math.cos(e)-this.y*Math.sin(e),this.x*Math.sin(e)+this.y*Math.cos(e),j.z)}setTo(e){this.x=e.x,this.y=e.y;const i=e;this.z=i.z?i.z:j.z}sub(e){return ne.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 $ extends ne{constructor(e,i){super(e,i,j.z)}static get origin(){return $.create(j.x,j.y)}static clone(e){return $.create(e.x,e.y)}static create(e,i){return new $(e,i)}}let nr=Math.random;const gs={nextFrame:t=>requestAnimationFrame(t),cancel:t=>cancelAnimationFrame(t)};function R(){return he(nr(),0,1-Number.EPSILON)}function sr(t){return gs.nextFrame(t)}function or(t){gs.cancel(t)}function he(t,e,i){return Math.min(Math.max(t,e),i)}function ci(t,e,i,n){return Math.floor((t*i+e*n)/(i+n))}function se(t){const e=_e(t),i=0;let n=Zt(t);return e===n&&(n=i),R()*(e-n)+n}function x(t){return Le(t)?t:se(t)}function Zt(t){return Le(t)?t:t.min}function _e(t){return Le(t)?t:t.max}function S(t,e){if(t===e||e===void 0&&Le(t))return t;const i=Zt(t),n=_e(t);return e!==void 0?{min:Math.min(i,e),max:Math.max(n,e)}:S(i,n)}function J(t,e){const i=t.x-e.x,n=t.y-e.y,s=2;return{dx:i,dy:n,distance:Math.sqrt(i**s+n**s)}}function oe(t,e){return J(t,e).distance}function Ie(t){return t*Math.PI/180}function rr(t,e,i){if(Le(t))return Ie(t);switch(t){case H.top:return-Math.PI*q;case H.topRight:return-Math.PI*Wt;case H.right:return So;case H.bottomRight:return Math.PI*Wt;case H.bottom:return Math.PI*q;case H.bottomLeft:return Math.PI*dn;case H.left:return Math.PI;case H.topLeft:return-Math.PI*dn;case H.inside:return Math.atan2(i.y-e.y,i.x-e.x);case H.outside:return Math.atan2(e.y-i.y,e.x-i.x);default:return R()*Co}}function ar(t){const e=$.origin;return e.length=1,e.angle=t,e}function _n(t,e,i,n){return $.create(t.x*(i-n)/(i+n)+e.x*G*n/(i+n),t.y)}function cr(t){var e,i;return{x:((e=t.position)==null?void 0:e.x)??R()*t.size.width,y:((i=t.position)==null?void 0:i.y)??R()*t.size.height}}function vs(t){return t?t.endsWith("%")?parseFloat(t)/Te:parseFloat(t):1}var Ge;(function(t){t.auto="auto",t.increase="increase",t.decrease="decrease",t.random="random"})(Ge||(Ge={}));var F;(function(t){t.increasing="increasing",t.decreasing="decreasing"})(F||(F={}));var Xe;(function(t){t.none="none",t.max="max",t.min="min"})(Xe||(Xe={}));var z;(function(t){t.bottom="bottom",t.left="left",t.right="right",t.top="top"})(z||(z={}));var yt;(function(t){t.precise="precise",t.percent="percent"})(yt||(yt={}));var ut;(function(t){t.max="max",t.min="min",t.random="random"})(ut||(ut={}));const lr={debug:console.debug,error:console.error,info:console.info,log:console.log,verbose:console.log,warning:console.warn};function Ze(){return lr}function ur(t){const e=new Map;return(...i)=>{const n=JSON.stringify(i);if(e.has(n))return e.get(n);const s=t(...i);return e.set(n,s),s}}function kn(t){const e={bounced:!1},{pSide:i,pOtherSide:n,rectSide:s,rectOtherSide:o,velocity:r,factor:a}=t;return n.min<o.min||n.min>o.max||n.max<o.min||n.max>o.max||(i.max>=s.min&&i.max<=(s.max+s.min)*q&&r>pn||i.min<=s.max&&i.min>(s.max+s.min)*q&&r<pn)&&(e.velocity=r*-a,e.bounced=!0),e}function hr(t,e){const i=re(e,n=>t.matches(n));return ke(i)?i.some(n=>n):i}function Ke(){return typeof window>"u"||!window||typeof window.document>"u"||!window.document}function fr(){return!Ke()&&typeof matchMedia<"u"}function bs(t){if(fr())return matchMedia(t)}function dr(t){if(!(Ke()||typeof IntersectionObserver>"u"))return new IntersectionObserver(t)}function pr(t){if(!(Ke()||typeof MutationObserver>"u"))return new MutationObserver(t)}function A(t,e){return t===e||ke(e)&&e.indexOf(t)>-1}async function Cn(t,e){try{await document.fonts.load(`${e??"400"} 36px '${t??"Verdana"}'`)}catch{}}function mr(t){return Math.floor(R()*t.length)}function Kt(t,e,i=!0){return t[e!==void 0&&i?e%t.length:mr(t)]}function Di(t,e,i,n,s){return yr(Et(t,n??0),e,i,s)}function yr(t,e,i,n){let s=!0;return(!n||n===z.bottom)&&(s=t.top<e.height+i.x),s&&(!n||n===z.left)&&(s=t.right>i.x),s&&(!n||n===z.right)&&(s=t.left<e.width+i.y),s&&(!n||n===z.top)&&(s=t.bottom>i.y),s}function Et(t,e){return{bottom:t.y+e,left:t.x-e,right:t.x+e,top:t.y-e}}function Y(t,...e){for(const i of e){if(i==null)continue;if(!at(i)){t=i;continue}const n=Array.isArray(i);n&&(at(t)||!t||!Array.isArray(t))?t=[]:!n&&(at(t)||!t||Array.isArray(t))&&(t={});for(const s in i){if(s==="__proto__")continue;const o=i,r=o[s],a=t;a[s]=at(r)&&Array.isArray(r)?r.map(c=>Y(a[s],c)):Y(a[s],r)}}return t}function Li(t,e){return!!_s(e,i=>i.enable&&A(t,i.mode))}function Ai(t,e,i){re(e,n=>{const s=n.mode;n.enable&&A(t,s)&&gr(n,i)})}function gr(t,e){const i=t.selectors;re(i,n=>{e(n,t)})}function ws(t,e){if(!(!e||!t))return _s(t,i=>hr(e,i.selectors))}function Si(t){return{position:t.getPosition(),radius:t.getRadius(),mass:t.getMass(),velocity:t.velocity,factor:$.create(x(t.options.bounce.horizontal.value),x(t.options.bounce.vertical.value))}}function xs(t,e){const{x:i,y:n}=t.velocity.sub(e.velocity),[s,o]=[t.position,e.position],{dx:r,dy:a}=J(o,s);if(i*r+n*a<0)return;const l=-Math.atan2(a,r),u=t.mass,h=e.mass,d=t.velocity.rotate(l),f=e.velocity.rotate(l),p=_n(d,f,u,h),y=_n(f,d,u,h),m=p.rotate(-l),b=y.rotate(-l);t.velocity.x=m.x*t.factor.x,t.velocity.y=m.y*t.factor.y,e.velocity.x=b.x*e.factor.x,e.velocity.y=b.y*e.factor.y}function vr(t,e){const i=t.getPosition(),n=t.getRadius(),s=Et(i,n),o=t.options.bounce,r=kn({pSide:{min:s.left,max:s.right},pOtherSide:{min:s.top,max:s.bottom},rectSide:{min:e.left,max:e.right},rectOtherSide:{min:e.top,max:e.bottom},velocity:t.velocity.x,factor:x(o.horizontal.value)});r.bounced&&(r.velocity!==void 0&&(t.velocity.x=r.velocity),r.position!==void 0&&(t.position.x=r.position));const a=kn({pSide:{min:s.top,max:s.bottom},pOtherSide:{min:s.left,max:s.right},rectSide:{min:e.top,max:e.bottom},rectOtherSide:{min:e.left,max:e.right},velocity:t.velocity.y,factor:x(o.vertical.value)});a.bounced&&(a.velocity!==void 0&&(t.velocity.y=a.velocity),a.position!==void 0&&(t.position.y=a.position))}function re(t,e){return ke(t)?t.map((n,s)=>e(n,s)):e(t,0)}function le(t,e,i){return ke(t)?Kt(t,e,i):t}function _s(t,e){return ke(t)?t.find((n,s)=>e(n,s)):e(t,0)?t:void 0}function ks(t,e){const i=t.value,n=t.animation,s={delayTime:x(n.delay)*W,enable:n.enable,value:x(t.value)*e,max:_e(i)*e,min:Zt(i)*e,loops:0,maxLoops:x(n.count),time:0},o=1;if(n.enable){switch(s.decay=o-x(n.decay),n.mode){case Ge.increase:s.status=F.increasing;break;case Ge.decrease:s.status=F.decreasing;break;case Ge.random:s.status=R()>=q?F.increasing:F.decreasing;break}const r=n.mode===Ge.auto;switch(n.startValue){case ut.min:s.value=s.min,r&&(s.status=F.increasing);break;case ut.max:s.value=s.max,r&&(s.status=F.decreasing);break;case ut.random:default:s.value=se(s),r&&(s.status=R()>=q?F.increasing:F.decreasing);break}}return s.initialValue=s.value,s}function br(t,e){if(!(t.mode===yt.percent)){const{mode:s,...o}=t;return o}return"x"in t?{x:t.x/Te*e.width,y:t.y/Te*e.height}:{width:t.width/Te*e.width,height:t.height/Te*e.height}}function Cs(t,e){return br(t,e)}function wr(t,e,i,n,s){switch(e){case Xe.max:i>=s&&t.destroy();break;case Xe.min:i<=n&&t.destroy();break}}function Fi(t,e,i,n,s){if(t.destroyed||!e||!e.enable||(e.maxLoops??0)>0&&(e.loops??0)>(e.maxLoops??0))return;const u=(e.velocity??0)*s.factor,h=e.min,d=e.max,f=e.decay??1;if(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))){switch(e.status){case F.increasing:e.value>=d?(i?e.status=F.decreasing:e.value-=d,e.loops||(e.loops=0),e.loops++):e.value+=u;break;case F.decreasing:e.value<=h?(i?e.status=F.increasing:e.value+=d,e.loops||(e.loops=0),e.loops++):e.value-=u}e.velocity&&f!==1&&(e.velocity*=f),wr(t,n,e.value,h,d),t.destroyed||(e.value=he(e.value,h,d))}}function xr(t){var i,n,s,o;const e=document.createElement("div").style;if(!t)return e;for(const r in t){const a=t[r];if(!Object.prototype.hasOwnProperty.call(t,r)||g(a))continue;const c=(i=t.getPropertyValue)==null?void 0:i.call(t,a);if(!c)continue;const l=(n=t.getPropertyPriority)==null?void 0:n.call(t,a);l?(o=e.setProperty)==null||o.call(e,a,c,l):(s=e.setProperty)==null||s.call(e,a,c)}return e}function _r(t){const e=document.createElement("div").style,i=10,n={width:"100%",height:"100%",margin:"0",padding:"0",borderWidth:"0",position:"fixed",zIndex:t.toString(i),"z-index":t.toString(i),top:"0",left:"0"};for(const s in n){const o=n[s];e.setProperty(s,o)}return e}const kr=ur(_r);var Oi;(function(t){t.darken="darken",t.enlighten="enlighten"})(Oi||(Oi={}));function Cr(t,e){if(e){for(const i of t.colorManagers.values())if(e.startsWith(i.stringPrefix))return i.parseString(e)}}function ye(t,e,i,n=!0){if(!e)return;const s=De(e)?{value:e}:e;if(De(s.value))return Ps(t,s.value,i,n);if(ke(s.value))return ye(t,{value:Kt(s.value,i,n)});for(const o of t.colorManagers.values()){const r=o.handleRangeColor(s);if(r)return r}}function Ps(t,e,i,n=!0){if(!e)return;const s=De(e)?{value:e}:e;if(De(s.value))return s.value===mt?zs():Pr(t,s.value);if(ke(s.value))return Ps(t,{value:Kt(s.value,i,n)});for(const o of t.colorManagers.values()){const r=o.handleColor(s);if(r)return r}}function St(t,e,i,n=!0){const s=ye(t,e,i,n);return s?Ms(s):void 0}function Ms(t){const e=t.r/Ut,i=t.g/Ut,n=t.b/Ut,s=Math.max(e,i,n),o=Math.min(e,i,n),r={h:fn,l:(s+o)*q,s:Pi};return s!==o&&(r.s=r.l<q?(s-o)/(s+o):(s-o)/(G-s-o),r.h=e===s?(i-n)/(s-o):r.h=i===s?G+(n-e)/(s-o):G*G+(e-i)/(s-o)),r.l*=Ci,r.s*=ki,r.h*=zo,r.h<fn&&(r.h+=We),r.h>=We&&(r.h-=We),r}function Pr(t,e){return Cr(t,e)}function gt(t){const e=(t.h%We+We)%We,i=Math.max(Pi,Math.min(ki,t.s)),n=Math.max(Xo,Math.min(Ci,t.l)),s=e/We,o=i/ki,r=n/Ci;if(i===Pi){const p=Math.round(r*Be);return{r:p,g:p,b:p}}const a=(p,y,m)=>{if(m<0&&m++,m>1&&m--,m*ai<1)return p+(y-p)*ai*m;if(m*G<1)return y;if(m*ri<1*G){const _=G/ri;return p+(y-p)*(_-m)*ai}return p},c=r<q?r*(Zo+o):r+o-r*o,l=G*r-c,u=Ko/ri,h=Math.min(Be,Be*a(l,c,s+u)),d=Math.min(Be,Be*a(l,c,s)),f=Math.min(Be,Be*a(l,c,s-u));return{r:Math.round(h),g:Math.round(d),b:Math.round(f)}}function Mr(t){const e=gt(t);return{a:t.a,b:e.b,g:e.g,r:e.r}}function zs(t){const e=Jo,i=Ut+zi;return{b:Math.floor(se(S(e,i))),g:Math.floor(se(S(e,i))),r:Math.floor(se(S(e,i)))}}function Se(t,e){return`rgba(${t.r}, ${t.g}, ${t.b}, ${e??Ii})`}function Ot(t,e){return`hsla(${t.h}, ${t.s}%, ${t.l}%, ${e??Ii})`}function Bi(t,e,i,n){let s=t,o=e;return s.r===void 0&&(s=gt(t)),o.r===void 0&&(o=gt(e)),{b:ci(s.b,o.b,i,n),g:ci(s.g,o.g,i,n),r:ci(s.r,o.r,i,n)}}function Ri(t,e,i){if(i===mt)return zs();if(i===Ht){const n=t.getFillColor()??t.getStrokeColor(),s=(e==null?void 0:e.getFillColor())??(e==null?void 0:e.getStrokeColor());if(n&&s&&e)return Bi(n,s,t.getRadius(),e.getRadius());{const o=n??s;if(o)return gt(o)}}else return i}function Ss(t,e,i,n){const s=De(e)?e:e.value;return s===mt?n?ye(t,{value:s}):i?mt:Ht:s===Ht?Ht:ye(t,{value:s})}function Pn(t){return t!==void 0?{h:t.h.value,s:t.s.value,l:t.l.value}:void 0}function Os(t,e,i){const n={h:{enable:!1,value:t.h},s:{enable:!1,value:t.s},l:{enable:!1,value:t.l}};return e&&(li(n.h,e.h,i),li(n.s,e.s,i),li(n.l,e.l,i)),n}function li(t,e,i){t.enable=e.enable,t.enable?(t.velocity=x(e.speed)/Te*i,t.decay=ds-x(e.decay),t.status=F.increasing,t.loops=tr,t.maxLoops=x(e.count),t.time=ir,t.delayTime=x(e.delay)*W,e.sync||(t.velocity*=R(),t.value*=R()),t.initialValue=t.value,t.offset=S(e.offset)):t.velocity=er}function ui(t,e,i,n){if(!t||!t.enable||(t.maxLoops??0)>0&&(t.loops??0)>(t.maxLoops??0)||(t.time||(t.time=0),(t.delayTime??0)>0&&t.time<(t.delayTime??0)&&(t.time+=n.value),(t.delayTime??0)>0&&t.time<(t.delayTime??0)))return;const u=t.offset?se(t.offset):0,h=(t.velocity??0)*n.factor+u*3.6,d=t.decay??1,f=_e(e),p=Zt(e);!i||t.status===F.increasing?(t.value+=h,t.value>f&&(t.loops||(t.loops=0),t.loops++,i?t.status=F.decreasing:t.value-=f)):(t.value-=h,t.value<0&&(t.loops||(t.loops=0),t.loops++,t.status=F.increasing)),t.velocity&&d!==1&&(t.velocity*=d),t.value=he(t.value,p,f)}function Rs(t,e){if(!t)return;const{h:i,s:n,l:s}=t,o={h:{min:0,max:360},s:{min:0,max:100},l:{min:0,max:100}};i&&ui(i,o.h,!1,e),n&&ui(n,o.s,!0,e),s&&ui(s,o.l,!0,e)}function zt(t,e,i){t.beginPath(),t.moveTo(e.x,e.y),t.lineTo(i.x,i.y),t.closePath()}function zr(t,e,i){t.fillStyle=i??"rgba(0,0,0,0)",t.fillRect(j.x,j.y,e.width,e.height)}function Sr(t,e,i,n){i&&(t.globalAlpha=n,t.drawImage(i,j.x,j.y,e.width,e.height),t.globalAlpha=1)}function hi(t,e){t.clearRect(j.x,j.y,e.width,e.height)}function Or(t){const{container:e,context:i,particle:n,delta:s,colorStyles:o,backgroundMask:r,composite:a,radius:c,opacity:l,shadow:u,transform:h}=t,d=n.getPosition(),f=n.rotation+(n.pathRotation?n.velocity.angle:Qo),p={sin:Math.sin(f),cos:Math.cos(f)},y=!!f,m={a:p.cos*(h.a??It.a),b:y?p.sin*(h.b??zi):h.b??It.b,c:y?-p.sin*(h.c??zi):h.c??It.c,d:p.cos*(h.d??It.d)};i.setTransform(m.a,m.b,m.c,m.d,d.x,d.y),r&&(i.globalCompositeOperation=a);const b=n.shadowColor;u.enable&&b&&(i.shadowBlur=u.blur,i.shadowColor=Se(b),i.shadowOffsetX=u.offset.x,i.shadowOffsetY=u.offset.y),o.fill&&(i.fillStyle=o.fill);const w=n.strokeWidth??ms;i.lineWidth=w,o.stroke&&(i.strokeStyle=o.stroke);const _={container:e,context:i,particle:n,radius:c,opacity:l,delta:s,transformData:m,strokeWidth:w};Tr(_),Er(_),Rr(_),i.globalCompositeOperation="source-over",i.resetTransform()}function Rr(t){const{container:e,context:i,particle:n,radius:s,opacity:o,delta:r,transformData:a}=t;if(!n.effect)return;const c=e.effectDrawers.get(n.effect);c&&c.draw({context:i,particle:n,radius:s,opacity:o,delta:r,pixelRatio:e.retina.pixelRatio,transformData:{...a}})}function Tr(t){const{container:e,context:i,particle:n,radius:s,opacity:o,delta:r,strokeWidth:a,transformData:c}=t;if(!n.shape)return;const l=e.shapeDrawers.get(n.shape);l&&(i.beginPath(),l.draw({context:i,particle:n,radius:s,opacity:o,delta:r,pixelRatio:e.retina.pixelRatio,transformData:{...c}}),n.shapeClose&&i.closePath(),a>ms&&i.stroke(),n.shapeFill&&i.fill())}function Er(t){const{container:e,context:i,particle:n,radius:s,opacity:o,delta:r,transformData:a}=t;if(!n.shape)return;const c=e.shapeDrawers.get(n.shape);c!=null&&c.afterDraw&&c.afterDraw({context:i,particle:n,radius:s,opacity:o,delta:r,pixelRatio:e.retina.pixelRatio,transformData:{...a}})}function Ir(t,e,i){e.draw&&e.draw(t,i)}function Dr(t,e,i,n){e.drawParticle&&e.drawParticle(t,i,n)}function Lr(t,e,i){return{h:t.h,s:t.s,l:t.l+(e===Oi.darken?-xn:xn)*i}}function Ar(t,e,i){const n=e[i];n!==void 0&&(t[i]=(t[i]??Oo)*n)}function Mn(t,e,i=!1){if(!e)return;const n=t;if(!n)return;const s=n.style;if(!s)return;const o=new Set;for(const r in s)Object.prototype.hasOwnProperty.call(s,r)&&o.add(s[r]);for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&o.add(e[r]);for(const r of o){const a=e.getPropertyValue(r);a?s.setProperty(r,a,i?"important":""):s.removeProperty(r)}}class Fr{constructor(e,i){this.container=e,this._applyPostDrawUpdaters=o=>{var r;for(const a of this._postDrawUpdaters)(r=a.afterDraw)==null||r.call(a,o)},this._applyPreDrawUpdaters=(o,r,a,c,l,u)=>{var h;for(const d of this._preDrawUpdaters){if(d.getColorStyles){const{fill:f,stroke:p}=d.getColorStyles(r,o,a,c);f&&(l.fill=f),p&&(l.stroke=p)}if(d.getTransformValues){const f=d.getTransformValues(r);for(const p in f)Ar(u,f,p)}(h=d.beforeDraw)==null||h.call(d,r)}},this._applyResizePlugins=()=>{var o;for(const r of this._resizePlugins)(o=r.resize)==null||o.call(r)},this._getPluginParticleColors=o=>{let r,a;for(const c of this._colorPlugins)if(!r&&c.particleFillColor&&(r=St(this._engine,c.particleFillColor(o))),!a&&c.particleStrokeColor&&(a=St(this._engine,c.particleStrokeColor(o))),r&&a)break;return[r,a]},this._initCover=async()=>{const o=this.container.actualOptions,r=o.backgroundMask.cover,a=r.color;if(a){const c=ye(this._engine,a);if(c){const l={...c,a:r.opacity};this._coverColorStyle=Se(l,l.a)}}else await new Promise((c,l)=>{if(!r.image)return;const u=document.createElement("img");u.addEventListener("load",()=>{this._coverImage={image:u,opacity:r.opacity},c()}),u.addEventListener("error",h=>{l(h.error)}),u.src=r.image})},this._initStyle=()=>{const o=this.element,r=this.container.actualOptions;if(o){this._fullScreen?this._setFullScreenStyle():this._resetOriginalStyle();for(const a in r.style){if(!a||!r.style||!Object.prototype.hasOwnProperty.call(r.style,a))continue;const c=r.style[a];c&&o.style.setProperty(a,c,"important")}}},this._initTrail=async()=>{const o=this.container.actualOptions,r=o.particles.move.trail,a=r.fill;if(!r.enable)return;const c=hs/r.length;if(a.color){const l=ye(this._engine,a.color);if(!l)return;this._trailFill={color:{...l},opacity:c}}else await new Promise((l,u)=>{if(!a.image)return;const h=document.createElement("img");h.addEventListener("load",()=>{this._trailFill={image:h,opacity:c},l()}),h.addEventListener("error",d=>{u(d.error)}),h.src=a.image})},this._paintBase=o=>{this.draw(r=>zr(r,this.size,o))},this._paintImage=(o,r)=>{this.draw(a=>Sr(a,this.size,o,r))},this._repairStyle=()=>{const o=this.element;if(!o)return;this._safeMutationObserver(a=>a.disconnect()),this._initStyle(),this.initBackground();const r=this._pointerEvents;o.style.pointerEvents=r,o.setAttribute("pointer-events",r),this._safeMutationObserver(a=>{!o||!(o instanceof Node)||a.observe(o,{attributes:!0})})},this._resetOriginalStyle=()=>{const o=this.element,r=this._originalStyle;!o||!r||Mn(o,r,!0)},this._safeMutationObserver=o=>{this._mutationObserver&&o(this._mutationObserver)},this._setFullScreenStyle=()=>{const o=this.element;o&&Mn(o,kr(this.container.actualOptions.fullScreen.zIndex),!0)},this._engine=i,this._standardSize={height:0,width:0};const n=e.retina.pixelRatio,s=this._standardSize;this.size={height:s.height*n,width:s.width*n},this._context=null,this._generated=!1,this._preDrawUpdaters=[],this._postDrawUpdaters=[],this._resizePlugins=[],this._colorPlugins=[],this._pointerEvents="none"}get _fullScreen(){return this.container.actualOptions.fullScreen.enable}clear(){const e=this.container.actualOptions,i=e.particles.move.trail,n=this._trailFill;e.backgroundMask.enable?this.paint():i.enable&&i.length>To&&n?n.color?this._paintBase(Se(n.color,n.opacity)):n.image&&this._paintImage(n.image,n.opacity):e.clear&&this.draw(s=>{hi(s,this.size)})}destroy(){if(this.stop(),this._generated){const e=this.element;e==null||e.remove(),this.element=void 0}else this._resetOriginalStyle();this._preDrawUpdaters=[],this._postDrawUpdaters=[],this._resizePlugins=[],this._colorPlugins=[]}draw(e){const i=this._context;if(i)return e(i)}drawAsync(e){const i=this._context;if(i)return e(i)}drawParticle(e,i){if(e.spawning||e.destroyed)return;const n=e.getRadius();if(n<=Ro)return;const s=e.getFillColor(),o=e.getStrokeColor()??s;let[r,a]=this._getPluginParticleColors(e);r||(r=s),a||(a=o),!(!r&&!a)&&this.draw(c=>{var v;const l=this.container,u=l.actualOptions,h=e.options.zIndex,d=Eo-e.zIndexFactor,f=d**h.opacityRate,p=e.bubble.opacity??((v=e.opacity)==null?void 0:v.value)??Ii,y=e.strokeOpacity??p,m=p*f,b=y*f,w={},_={fill:r?Ot(r,m):void 0};_.stroke=a?Ot(a,b):_.fill,this._applyPreDrawUpdaters(c,e,n,m,_,w),Or({container:l,context:c,particle:e,delta:i,colorStyles:_,backgroundMask:u.backgroundMask.enable,composite:u.backgroundMask.composite,radius:n*d**h.sizeRate,opacity:m,shadow:e.options.shadow,transform:w}),this._applyPostDrawUpdaters(e)})}drawParticlePlugin(e,i,n){this.draw(s=>Dr(s,e,i,n))}drawPlugin(e,i){this.draw(n=>Ir(n,e,i))}async init(){this._safeMutationObserver(e=>e.disconnect()),this._mutationObserver=pr(e=>{for(const i of e)i.type==="attributes"&&i.attributeName==="style"&&this._repairStyle()}),this.resize(),this._initStyle(),await this._initCover();try{await this._initTrail()}catch(e){Ze().error(e)}this.initBackground(),this._safeMutationObserver(e=>{!this.element||!(this.element instanceof Node)||e.observe(this.element,{attributes:!0})}),this.initUpdaters(),this.initPlugins(),this.paint()}initBackground(){const e=this.container.actualOptions,i=e.background,n=this.element;if(!n)return;const s=n.style;if(s){if(i.color){const o=ye(this._engine,i.color);s.backgroundColor=o?Se(o,i.opacity):""}else s.backgroundColor="";s.backgroundImage=i.image||"",s.backgroundPosition=i.position||"",s.backgroundRepeat=i.repeat||"",s.backgroundSize=i.size||""}}initPlugins(){this._resizePlugins=[];for(const e of this.container.plugins.values())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&&je in e.dataset?e.dataset[je]==="true":this._generated,this.element=e,this.element.ariaHidden="true",this._originalStyle=xr(this.element.style);const i=this._standardSize;i.height=e.offsetHeight,i.width=e.offsetWidth;const n=this.container.retina.pixelRatio,s=this.size;e.height=s.height=i.height*n,e.width=s.width=i.width*n,this._context=this.element.getContext("2d"),this._safeMutationObserver(o=>o.disconnect()),this.container.retina.init(),this.initBackground(),this._safeMutationObserver(o=>{!this.element||!(this.element instanceof Node)||o.observe(this.element,{attributes:!0})})}paint(){const e=this.container.actualOptions;this.draw(i=>{e.backgroundMask.enable&&e.backgroundMask.cover?(hi(i,this.size),this._coverImage?this._paintImage(this._coverImage.image,this._coverImage.opacity):this._coverColorStyle?this._paintBase(this._coverColorStyle):this._paintBase()):this._paintBase()})}resize(){if(!this.element)return!1;const e=this.container,i=e.canvas._standardSize,n={width:this.element.offsetWidth,height:this.element.offsetHeight},s=e.retina.pixelRatio,o={width:n.width*s,height:n.height*s};if(n.height===i.height&&n.width===i.width&&o.height===this.element.height&&o.width===this.element.width)return!1;const r={...i};i.height=n.height,i.width=n.width;const a=this.size;return this.element.width=a.width=o.width,this.element.height=a.height=o.height,this.container.started&&e.particles.setResizeFactor({width:i.width/r.width,height:i.height/r.height}),!0}setPointerEvents(e){this.element&&(this._pointerEvents=e,this._repairStyle())}stop(){this._safeMutationObserver(e=>e.disconnect()),this._mutationObserver=void 0,this.draw(e=>hi(e,this.size))}async windowResize(){if(!this.element||!this.resize())return;const e=this.container,i=e.updateActualOptions();e.particles.setDensity(),this._applyResizePlugins(),i&&await e.refresh()}}var ht;(function(t){t.canvas="canvas",t.parent="parent",t.window="window"})(ht||(ht={}));function ce(t,e,i,n,s){if(n){let o={passive:!0};ys(s)?o.capture=s:s!==void 0&&(o=s),t.addEventListener(e,i,o)}else{const o=s;t.removeEventListener(e,i,o)}}class Br{constructor(e){this.container=e,this._doMouseTouchClick=i=>{const n=this.container,s=n.actualOptions;if(this._canPush){const o=n.interactivity.mouse,r=o.position;if(!r)return;o.clickPosition={...r},o.clickTime=new Date().getTime();const a=s.interactivity.events.onClick;re(a.mode,c=>this.container.handleClickMode(c))}i.type==="touchend"&&setTimeout(()=>this._mouseTouchFinish(),Yo)},this._handleThemeChange=i=>{const n=i,s=this.container,o=s.options,r=o.defaultThemes,a=n.matches?r.dark:r.light,c=o.themes.find(l=>l.name===a);c!=null&&c.default.auto&&s.loadTheme(a)},this._handleVisibilityChange=()=>{const i=this.container,n=i.actualOptions;this._mouseTouchFinish(),n.pauseOnBlur&&(document!=null&&document.hidden?(i.pageHidden=!0,i.pause()):(i.pageHidden=!1,i.animationStatus?i.play(!0):i.draw(!0)))},this._handleWindowResize=()=>{this._resizeTimeout&&(clearTimeout(this._resizeTimeout),delete this._resizeTimeout);const i=async()=>{const n=this.container.canvas;await(n==null?void 0:n.windowResize())};this._resizeTimeout=setTimeout(()=>void i(),this.container.actualOptions.interactivity.events.resize.delay*W)},this._manageInteractivityListeners=(i,n)=>{const s=this._handlers,o=this.container,r=o.actualOptions,a=o.interactivity.element;if(!a)return;const c=a,l=o.canvas;l.setPointerEvents(c===l.element?"initial":"none"),(r.interactivity.events.onHover.enable||r.interactivity.events.onClick.enable)&&(ce(a,Qe,s.mouseMove,n),ce(a,bo,s.touchStart,n),ce(a,wo,s.touchMove,n),r.interactivity.events.onClick.enable?(ce(a,rn,s.touchEndClick,n),ce(a,go,s.mouseUp,n),ce(a,yo,s.mouseDown,n)):ce(a,rn,s.touchEnd,n),ce(a,i,s.mouseLeave,n),ce(a,xo,s.touchCancel,n))},this._manageListeners=i=>{const n=this._handlers,s=this.container,o=s.actualOptions,r=o.interactivity.detectsOn,a=s.canvas.element;let c=_i;r===ht.window?(s.interactivity.element=window,c=vo):r===ht.parent&&a?s.interactivity.element=a.parentElement??a.parentNode:s.interactivity.element=a,this._manageMediaMatch(i),this._manageResize(i),this._manageInteractivityListeners(c,i),document&&ce(document,ko,n.visibilityChange,i,!1)},this._manageMediaMatch=i=>{const n=this._handlers,s=bs("(prefers-color-scheme: dark)");if(s){if(s.addEventListener!==void 0){ce(s,"change",n.themeChange,i);return}s.addListener!==void 0&&(i?s.addListener(n.oldThemeChange):s.removeListener(n.oldThemeChange))}},this._manageResize=i=>{const n=this._handlers,s=this.container;if(!s.actualOptions.interactivity.events.resize)return;if(typeof ResizeObserver>"u"){ce(window,_o,n.resize,i);return}const r=s.canvas.element;this._resizeObserver&&!i?(r&&this._resizeObserver.unobserve(r),this._resizeObserver.disconnect(),delete this._resizeObserver):!this._resizeObserver&&i&&r&&(this._resizeObserver=new ResizeObserver(a=>{a.find(l=>l.target===r)&&this._handleWindowResize()}),this._resizeObserver.observe(r))},this._mouseDown=()=>{const{interactivity:i}=this.container;if(!i)return;const{mouse:n}=i;n.clicking=!0,n.downPosition=n.position},this._mouseTouchClick=i=>{const n=this.container,s=n.actualOptions,{mouse:o}=n.interactivity;o.inside=!0;let r=!1;const a=o.position;if(!(!a||!s.interactivity.events.onClick.enable)){for(const c of n.plugins.values())if(c.clickPositionValid&&(r=c.clickPositionValid(a),r))break;r||this._doMouseTouchClick(i),o.clicking=!1}},this._mouseTouchFinish=()=>{const i=this.container.interactivity;if(!i)return;const n=i.mouse;delete n.position,delete n.clickPosition,delete n.downPosition,i.status=_i,n.inside=!1,n.clicking=!1},this._mouseTouchMove=i=>{const n=this.container,s=n.actualOptions,o=n.interactivity,r=n.canvas.element;if(!(o!=null&&o.element))return;o.mouse.inside=!0;let a;if(i.type.startsWith("pointer")){this._canPush=!0;const l=i;if(o.element===window){if(r){const u=r.getBoundingClientRect();a={x:l.clientX-u.left,y:l.clientY-u.top}}}else if(s.interactivity.detectsOn===ht.parent){const u=l.target,h=l.currentTarget;if(u&&h&&r){const d=u.getBoundingClientRect(),f=h.getBoundingClientRect(),p=r.getBoundingClientRect();a={x:l.offsetX+G*d.left-(f.left+p.left),y:l.offsetY+G*d.top-(f.top+p.top)}}else a={x:l.offsetX??l.clientX,y:l.offsetY??l.clientY}}else l.target===r&&(a={x:l.offsetX??l.clientX,y:l.offsetY??l.clientY})}else if(this._canPush=i.type!=="touchmove",r){const l=i,u=l.touches[l.touches.length-ps],h=r.getBoundingClientRect();a={x:u.clientX-(h.left??Gt),y:u.clientY-(h.top??Gt)}}const c=n.retina.pixelRatio;a&&(a.x*=c,a.y*=c),o.mouse.position=a,o.status=Qe},this._touchEnd=i=>{const n=i,s=Array.from(n.changedTouches);for(const o of s)this._touches.delete(o.identifier);this._mouseTouchFinish()},this._touchEndClick=i=>{const n=i,s=Array.from(n.changedTouches);for(const o of s)this._touches.delete(o.identifier);this._mouseTouchClick(i)},this._touchStart=i=>{const n=i,s=Array.from(n.changedTouches);for(const o of s)this._touches.set(o.identifier,performance.now());this._mouseTouchMove(i)},this._canPush=!0,this._touches=new Map,this._handlers={mouseDown:()=>this._mouseDown(),mouseLeave:()=>this._mouseTouchFinish(),mouseMove:i=>this._mouseTouchMove(i),mouseUp:i=>this._mouseTouchClick(i),touchStart:i=>this._touchStart(i),touchMove:i=>this._mouseTouchMove(i),touchEnd:i=>this._touchEnd(i),touchCancel:i=>this._touchEnd(i),touchEndClick:i=>this._touchEndClick(i),visibilityChange:()=>this._handleVisibilityChange(),themeChange:i=>this._handleThemeChange(i),oldThemeChange:i=>this._handleThemeChange(i),resize:()=>{this._handleWindowResize()}}}addListeners(){this._manageListeners(!0)}removeListeners(){this._manageListeners(!1)}}var K;(function(t){t.configAdded="configAdded",t.containerInit="containerInit",t.particlesSetup="particlesSetup",t.containerStarted="containerStarted",t.containerStopped="containerStopped",t.containerDestroyed="containerDestroyed",t.containerPaused="containerPaused",t.containerPlay="containerPlay",t.containerBuilt="containerBuilt",t.particleAdded="particleAdded",t.particleDestroyed="particleDestroyed",t.particleRemoved="particleRemoved"})(K||(K={}));class Q{constructor(){this.value=""}static create(e,i){const n=new Q;return n.load(e),i!==void 0&&(De(i)||ke(i)?n.load({value:i}):n.load(i)),n}load(e){g(e)||g(e.value)||(this.value=e.value)}}class qr{constructor(){this.color=new Q,this.color.value="",this.image="",this.position="",this.repeat="",this.size="",this.opacity=1}load(e){g(e)||(e.color!==void 0&&(this.color=Q.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 $r{constructor(){this.opacity=1}load(e){g(e)||(e.color!==void 0&&(this.color=Q.create(this.color,e.color)),e.image!==void 0&&(this.image=e.image),e.opacity!==void 0&&(this.opacity=e.opacity))}}class Vr{constructor(){this.composite="destination-out",this.cover=new $r,this.enable=!1}load(e){if(!g(e)){if(e.composite!==void 0&&(this.composite=e.composite),e.cover!==void 0){const i=e.cover,n=De(e.cover)?{color:e.cover}:e.cover;this.cover.load(i.color!==void 0||i.image!==void 0?i:{color:n})}e.enable!==void 0&&(this.enable=e.enable)}}}class Hr{constructor(){this.enable=!0,this.zIndex=0}load(e){g(e)||(e.enable!==void 0&&(this.enable=e.enable),e.zIndex!==void 0&&(this.zIndex=e.zIndex))}}class Ur{constructor(){this.enable=!1,this.mode=[]}load(e){g(e)||(e.enable!==void 0&&(this.enable=e.enable),e.mode!==void 0&&(this.mode=e.mode))}}var vt;(function(t){t.circle="circle",t.rectangle="rectangle"})(vt||(vt={}));class zn{constructor(){this.selectors=[],this.enable=!1,this.mode=[],this.type=vt.circle}load(e){g(e)||(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 jr{constructor(){this.enable=!1,this.force=2,this.smooth=10}load(e){g(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 Wr{constructor(){this.enable=!1,this.mode=[],this.parallax=new jr}load(e){g(e)||(e.enable!==void 0&&(this.enable=e.enable),e.mode!==void 0&&(this.mode=e.mode),this.parallax.load(e.parallax))}}class Gr{constructor(){this.delay=.5,this.enable=!0}load(e){g(e)||(e.delay!==void 0&&(this.delay=e.delay),e.enable!==void 0&&(this.enable=e.enable))}}class Nr{constructor(){this.onClick=new Ur,this.onDiv=new zn,this.onHover=new Wr,this.resize=new Gr}load(e){if(g(e))return;this.onClick.load(e.onClick);const i=e.onDiv;i!==void 0&&(this.onDiv=re(i,n=>{const s=new zn;return s.load(n),s})),this.onHover.load(e.onHover),this.resize.load(e.resize)}}class Yr{constructor(e,i){this._engine=e,this._container=i}load(e){if(g(e)||!this._container)return;const i=this._engine.interactors.get(this._container);if(i)for(const n of i)n.loadModeOptions&&n.loadModeOptions(this,e)}}class Ts{constructor(e,i){this.detectsOn=ht.window,this.events=new Nr,this.modes=new Yr(e,i)}load(e){if(g(e))return;const i=e.detectsOn;i!==void 0&&(this.detectsOn=i),this.events.load(e.events),this.modes.load(e.modes)}}class Qr{load(e){g(e)||(e.position&&(this.position={x:e.position.x??wn,y:e.position.y??wn,mode:e.position.mode??yt.percent}),e.options&&(this.options=Y({},e.options)))}}var Ne;(function(t){t.screen="screen",t.canvas="canvas"})(Ne||(Ne={}));class Xr{constructor(){this.maxWidth=1/0,this.options={},this.mode=Ne.canvas}load(e){g(e)||(g(e.maxWidth)||(this.maxWidth=e.maxWidth),g(e.mode)||(e.mode===Ne.screen?this.mode=Ne.screen:this.mode=Ne.canvas),g(e.options)||(this.options=Y({},e.options)))}}var Re;(function(t){t.any="any",t.dark="dark",t.light="light"})(Re||(Re={}));class Zr{constructor(){this.auto=!1,this.mode=Re.any,this.value=!1}load(e){g(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 Kr{constructor(){this.name="",this.default=new Zr}load(e){g(e)||(e.name!==void 0&&(this.name=e.name),this.default.load(e.default),e.options!==void 0&&(this.options=Y({},e.options)))}}class qi{constructor(){this.count=0,this.enable=!1,this.speed=1,this.decay=0,this.delay=0,this.sync=!1}load(e){g(e)||(e.count!==void 0&&(this.count=S(e.count)),e.enable!==void 0&&(this.enable=e.enable),e.speed!==void 0&&(this.speed=S(e.speed)),e.decay!==void 0&&(this.decay=S(e.decay)),e.delay!==void 0&&(this.delay=S(e.delay)),e.sync!==void 0&&(this.sync=e.sync))}}class $i extends qi{constructor(){super(),this.mode=Ge.auto,this.startValue=ut.random}load(e){super.load(e),!g(e)&&(e.mode!==void 0&&(this.mode=e.mode),e.startValue!==void 0&&(this.startValue=e.startValue))}}class fi extends qi{constructor(){super(),this.offset=0,this.sync=!0}load(e){super.load(e),!g(e)&&e.offset!==void 0&&(this.offset=S(e.offset))}}class Jr{constructor(){this.h=new fi,this.s=new fi,this.l=new fi}load(e){g(e)||(this.h.load(e.h),this.s.load(e.s),this.l.load(e.l))}}class Rt extends Q{constructor(){super(),this.animation=new Jr}static create(e,i){const n=new Rt;return n.load(e),i!==void 0&&(De(i)||ke(i)?n.load({value:i}):n.load(i)),n}load(e){if(super.load(e),g(e))return;const i=e.animation;i!==void 0&&(i.enable!==void 0?this.animation.h.load(i):this.animation.load(e.animation))}}var ft;(function(t){t.absorb="absorb",t.bounce="bounce",t.destroy="destroy"})(ft||(ft={}));class ea{constructor(){this.speed=2}load(e){g(e)||e.speed!==void 0&&(this.speed=e.speed)}}class ta{constructor(){this.enable=!0,this.retries=0}load(e){g(e)||(e.enable!==void 0&&(this.enable=e.enable),e.retries!==void 0&&(this.retries=e.retries))}}class Je{constructor(){this.value=0}load(e){g(e)||g(e.value)||(this.value=S(e.value))}}class ia extends Je{constructor(){super(),this.animation=new qi}load(e){if(super.load(e),g(e))return;const i=e.animation;i!==void 0&&this.animation.load(i)}}class Es extends ia{constructor(){super(),this.animation=new $i}load(e){super.load(e)}}class Sn extends Je{constructor(){super(),this.value=1}}class Is{constructor(){this.horizontal=new Sn,this.vertical=new Sn}load(e){g(e)||(this.horizontal.load(e.horizontal),this.vertical.load(e.vertical))}}class na{constructor(){this.absorb=new ea,this.bounce=new Is,this.enable=!1,this.maxSpeed=50,this.mode=ft.bounce,this.overlap=new ta}load(e){g(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=S(e.maxSpeed)),e.mode!==void 0&&(this.mode=e.mode),this.overlap.load(e.overlap))}}class sa{constructor(){this.close=!0,this.fill=!0,this.options={},this.type=[]}load(e){if(g(e))return;const i=e.options;if(i!==void 0)for(const n in i){const s=i[n];s&&(this.options[n]=Y(this.options[n]??{},s))}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 oa{constructor(){this.offset=0,this.value=90}load(e){g(e)||(e.offset!==void 0&&(this.offset=S(e.offset)),e.value!==void 0&&(this.value=S(e.value)))}}class ra{constructor(){this.distance=200,this.enable=!1,this.rotate={x:3e3,y:3e3}}load(e){if(!g(e)&&(e.distance!==void 0&&(this.distance=S(e.distance)),e.enable!==void 0&&(this.enable=e.enable),e.rotate)){const i=e.rotate.x;i!==void 0&&(this.rotate.x=i);const n=e.rotate.y;n!==void 0&&(this.rotate.y=n)}}}class aa{constructor(){this.x=50,this.y=50,this.mode=yt.percent,this.radius=0}load(e){g(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 ca{constructor(){this.acceleration=9.81,this.enable=!1,this.inverse=!1,this.maxSpeed=50}load(e){g(e)||(e.acceleration!==void 0&&(this.acceleration=S(e.acceleration)),e.enable!==void 0&&(this.enable=e.enable),e.inverse!==void 0&&(this.inverse=e.inverse),e.maxSpeed!==void 0&&(this.maxSpeed=S(e.maxSpeed)))}}class la{constructor(){this.clamp=!0,this.delay=new Je,this.enable=!1,this.options={}}load(e){g(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=Y(this.options,e.options)))}}class ua{load(e){g(e)||(e.color!==void 0&&(this.color=Q.create(this.color,e.color)),e.image!==void 0&&(this.image=e.image))}}class ha{constructor(){this.enable=!1,this.length=10,this.fill=new ua}load(e){g(e)||(e.enable!==void 0&&(this.enable=e.enable),e.fill!==void 0&&this.fill.load(e.fill),e.length!==void 0&&(this.length=e.length))}}var B;(function(t){t.bounce="bounce",t.none="none",t.out="out",t.destroy="destroy",t.split="split"})(B||(B={}));class fa{constructor(){this.default=B.out}load(e){g(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 da{constructor(){this.acceleration=0,this.enable=!1}load(e){g(e)||(e.acceleration!==void 0&&(this.acceleration=S(e.acceleration)),e.enable!==void 0&&(this.enable=e.enable),e.position&&(this.position=Y({},e.position)))}}class pa{constructor(){this.angle=new oa,this.attract=new ra,this.center=new aa,this.decay=0,this.distance={},this.direction=H.none,this.drift=0,this.enable=!1,this.gravity=new ca,this.path=new la,this.outModes=new fa,this.random=!1,this.size=!1,this.speed=2,this.spin=new da,this.straight=!1,this.trail=new ha,this.vibrate=!1,this.warp=!1}load(e){if(g(e))return;this.angle.load(Le(e.angle)?{value:e.angle}:e.angle),this.attract.load(e.attract),this.center.load(e.center),e.decay!==void 0&&(this.decay=S(e.decay)),e.direction!==void 0&&(this.direction=e.direction),e.distance!==void 0&&(this.distance=Le(e.distance)?{horizontal:e.distance,vertical:e.distance}:{...e.distance}),e.drift!==void 0&&(this.drift=S(e.drift)),e.enable!==void 0&&(this.enable=e.enable),this.gravity.load(e.gravity);const i=e.outModes;i!==void 0&&(at(i)?this.outModes.load(i):this.outModes.load({default:i})),this.path.load(e.path),e.random!==void 0&&(this.random=e.random),e.size!==void 0&&(this.size=e.size),e.speed!==void 0&&(this.speed=S(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 ma extends $i{constructor(){super(),this.destroy=Xe.none,this.speed=2}load(e){super.load(e),!g(e)&&e.destroy!==void 0&&(this.destroy=e.destroy)}}class ya extends Es{constructor(){super(),this.animation=new ma,this.value=1}load(e){if(g(e))return;super.load(e);const i=e.animation;i!==void 0&&this.animation.load(i)}}class ga{constructor(){this.enable=!1,this.width=1920,this.height=1080}load(e){if(g(e))return;e.enable!==void 0&&(this.enable=e.enable);const i=e.width;i!==void 0&&(this.width=i);const n=e.height;n!==void 0&&(this.height=n)}}var Tt;(function(t){t.delete="delete",t.wait="wait"})(Tt||(Tt={}));class va{constructor(){this.mode=Tt.delete,this.value=0}load(e){g(e)||(e.mode!==void 0&&(this.mode=e.mode),e.value!==void 0&&(this.value=e.value))}}class ba{constructor(){this.density=new ga,this.limit=new va,this.value=0}load(e){g(e)||(this.density.load(e.density),this.limit.load(e.limit),e.value!==void 0&&(this.value=e.value))}}class wa{constructor(){this.blur=0,this.color=new Q,this.enable=!1,this.offset={x:0,y:0},this.color.value="#000"}load(e){g(e)||(e.blur!==void 0&&(this.blur=e.blur),this.color=Q.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)))}}class xa{constructor(){this.close=!0,this.fill=!0,this.options={},this.type="circle"}load(e){if(g(e))return;const i=e.options;if(i!==void 0)for(const n in i){const s=i[n];s&&(this.options[n]=Y(this.options[n]??{},s))}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 _a extends $i{constructor(){super(),this.destroy=Xe.none,this.speed=5}load(e){super.load(e),!g(e)&&e.destroy!==void 0&&(this.destroy=e.destroy)}}class ka extends Es{constructor(){super(),this.animation=new _a,this.value=3}load(e){if(super.load(e),g(e))return;const i=e.animation;i!==void 0&&this.animation.load(i)}}class On{constructor(){this.width=0}load(e){g(e)||(e.color!==void 0&&(this.color=Rt.create(this.color,e.color)),e.width!==void 0&&(this.width=S(e.width)),e.opacity!==void 0&&(this.opacity=S(e.opacity)))}}class Ca extends Je{constructor(){super(),this.opacityRate=1,this.sizeRate=1,this.velocityRate=1}load(e){super.load(e),!g(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 Pa{constructor(e,i){this._engine=e,this._container=i,this.bounce=new Is,this.collisions=new na,this.color=new Rt,this.color.value="#fff",this.effect=new sa,this.groups={},this.move=new pa,this.number=new ba,this.opacity=new ya,this.reduceDuplicates=!1,this.shadow=new wa,this.shape=new xa,this.size=new ka,this.stroke=new On,this.zIndex=new Ca}load(e){if(g(e))return;if(e.groups!==void 0)for(const n of Object.keys(e.groups)){if(!Object.hasOwn(e.groups,n))continue;const s=e.groups[n];s!==void 0&&(this.groups[n]=Y(this.groups[n]??{},s))}e.reduceDuplicates!==void 0&&(this.reduceDuplicates=e.reduceDuplicates),this.bounce.load(e.bounce),this.color.load(Rt.create(this.color,e.color)),this.effect.load(e.effect),this.move.load(e.move),this.number.load(e.number),this.opacity.load(e.opacity),this.shape.load(e.shape),this.size.load(e.size),this.shadow.load(e.shadow),this.zIndex.load(e.zIndex),this.collisions.load(e.collisions),e.interactivity!==void 0&&(this.interactivity=Y({},e.interactivity));const i=e.stroke;if(i&&(this.stroke=re(i,n=>{const s=new On;return s.load(n),s})),this._container){const n=this._engine.updaters.get(this._container);if(n)for(const o of n)o.loadOptions&&o.loadOptions(this,e);const s=this._engine.interactors.get(this._container);if(s)for(const o of s)o.loadParticlesOptions&&o.loadParticlesOptions(this,e)}}}function Ds(t,...e){for(const i of e)t.load(i)}function Ls(t,e,...i){const n=new Pa(t,e);return Ds(n,...i),n}class Ma{constructor(e,i){this._findDefaultTheme=n=>this.themes.find(s=>s.default.value&&s.default.mode===n)??this.themes.find(s=>s.default.value&&s.default.mode===Re.any),this._importPreset=n=>{this.load(this._engine.getPreset(n))},this._engine=e,this._container=i,this.autoPlay=!0,this.background=new qr,this.backgroundMask=new Vr,this.clear=!0,this.defaultThemes={},this.delay=0,this.fullScreen=new Hr,this.detectRetina=!0,this.duration=0,this.fpsLimit=120,this.interactivity=new Ts(e,i),this.manualParticles=[],this.particles=Ls(this._engine,this._container),this.pauseOnBlur=!0,this.pauseOnOutsideViewport=!0,this.responsive=[],this.smooth=!1,this.style={},this.themes=[],this.zLayers=100}load(e){var r,a;if(g(e))return;e.preset!==void 0&&re(e.preset,c=>this._importPreset(c)),e.autoPlay!==void 0&&(this.autoPlay=e.autoPlay),e.clear!==void 0&&(this.clear=e.clear),e.key!==void 0&&(this.key=e.key),e.name!==void 0&&(this.name=e.name),e.delay!==void 0&&(this.delay=S(e.delay));const i=e.detectRetina;i!==void 0&&(this.detectRetina=i),e.duration!==void 0&&(this.duration=S(e.duration));const n=e.fpsLimit;n!==void 0&&(this.fpsLimit=n),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 s=e.fullScreen;ys(s)?this.fullScreen.enable=s:this.fullScreen.load(s),this.backgroundMask.load(e.backgroundMask),this.interactivity.load(e.interactivity),e.manualParticles&&(this.manualParticles=e.manualParticles.map(c=>{const l=new Qr;return l.load(c),l})),this.particles.load(e.particles),this.style=Y(this.style,e.style),this._engine.loadOptions(this,e),e.smooth!==void 0&&(this.smooth=e.smooth);const o=this._engine.interactors.get(this._container);if(o)for(const c of o)c.loadOptions&&c.loadOptions(this,e);if(e.responsive!==void 0)for(const c of e.responsive){const l=new Xr;l.load(c),this.responsive.push(l)}if(this.responsive.sort((c,l)=>c.maxWidth-l.maxWidth),e.themes!==void 0)for(const c of e.themes){const l=this.themes.find(u=>u.name===c.name);if(l)l.load(c);else{const u=new Kr;u.load(c),this.themes.push(u)}}this.defaultThemes.dark=(r=this._findDefaultTheme(Re.dark))==null?void 0:r.name,this.defaultThemes.light=(a=this._findDefaultTheme(Re.light))==null?void 0:a.name}setResponsive(e,i,n){this.load(n);const s=this.responsive.find(o=>o.mode===Ne.screen&&screen?o.maxWidth>screen.availWidth:o.maxWidth*i>e);return this.load(s==null?void 0:s.options),s==null?void 0:s.maxWidth}setTheme(e){if(e){const i=this.themes.find(n=>n.name===e);i&&this.load(i.options)}else{const i=bs("(prefers-color-scheme: dark)"),n=i==null?void 0:i.matches,s=this._findDefaultTheme(n?Re.dark:Re.light);s&&this.load(s.options)}}}var bt;(function(t){t.external="external",t.particles="particles"})(bt||(bt={}));class za{constructor(e,i){this.container=i,this._engine=e,this._interactors=[],this._externalInteractors=[],this._particleInteractors=[]}externalInteract(e){for(const i of this._externalInteractors)i.isEnabled()&&i.interact(e)}handleClickMode(e){var i;for(const n of this._externalInteractors)(i=n.handleClickMode)==null||i.call(n,e)}async init(){this._interactors=await this._engine.getInteractors(this.container,!0),this._externalInteractors=[],this._particleInteractors=[];for(const e of this._interactors){switch(e.type){case bt.external:this._externalInteractors.push(e);break;case bt.particles:this._particleInteractors.push(e);break}e.init()}}particlesInteract(e,i){for(const n of this._externalInteractors)n.clear(e,i);for(const n of this._particleInteractors)n.isEnabled(e)&&n.interact(e,i)}reset(e){for(const i of this._externalInteractors)i.isEnabled()&&i.reset(e);for(const i of this._particleInteractors)i.isEnabled(e)&&i.reset(e)}}var ge;(function(t){t.normal="normal",t.inside="inside",t.outside="outside"})(ge||(ge={}));function Sa(t,e,i,n){const s=e.options[t];if(s)return Y({close:e.close,fill:e.fill},le(s,i,n))}function Oa(t,e,i,n){const s=e.options[t];if(s)return Y({close:e.close,fill:e.fill},le(s,i,n))}function Rn(t){if(!A(t.outMode,t.checkModes))return;const e=t.radius*G;t.coord>t.maxCoord-e?t.setCb(-t.radius):t.coord<e&&t.setCb(t.radius)}class Ra{constructor(e,i){this.container=i,this._calcPosition=(n,s,o,r=cn)=>{for(const p of n.plugins.values()){const y=p.particlePosition!==void 0?p.particlePosition(s,this):void 0;if(y)return ne.create(y.x,y.y,o)}const a=n.canvas.size,c=cr({size:a,position:s}),l=ne.create(c.x,c.y,o),u=this.getRadius(),h=this.options.move.outModes,d=p=>{Rn({outMode:p,checkModes:[B.bounce],coord:l.x,maxCoord:n.canvas.size.width,setCb:y=>l.x+=y,radius:u})},f=p=>{Rn({outMode:p,checkModes:[B.bounce],coord:l.y,maxCoord:n.canvas.size.height,setCb:y=>l.y+=y,radius:u})};return d(h.left??h.default),d(h.right??h.default),f(h.top??h.default),f(h.bottom??h.default),this._checkOverlap(l,r)?this._calcPosition(n,void 0,o,r+Vo):l},this._calculateVelocity=()=>{const n=ar(this.direction),s=n.copy(),o=this.options.move;if(o.direction===H.inside||o.direction===H.outside)return s;const r=Ie(x(o.angle.value)),a=Ie(x(o.angle.offset)),c={left:a-r*q,right:a+r*q};return o.straight||(s.angle+=se(S(c.left,c.right))),o.random&&typeof o.speed=="number"&&(s.length*=R()),s},this._checkOverlap=(n,s=cn)=>{const o=this.options.collisions,r=this.getRadius();if(!o.enable)return!1;const a=o.overlap;if(a.enable)return!1;const c=a.retries;if(c>=Ho&&s>c)throw new Error(`${ue} particle is overlapping and can't be placed`);return!!this.container.particles.find(l=>oe(n,l.position)<r+l.getRadius())},this._getRollColor=n=>{if(!n||!this.roll||!this.backColor&&!this.roll.alter)return n;const s=this.roll.horizontal&&this.roll.vertical?G*yn:yn,o=this.roll.horizontal?Math.PI*q:Nt;return Math.floor(((this.roll.angle??Nt)+o)/(Math.PI/s))%G?this.backColor?this.backColor:this.roll.alter?Lr(n,this.roll.alter.type,this.roll.alter.value):n:n},this._initPosition=n=>{const s=this.container,o=x(this.options.zIndex.value);this.position=this._calcPosition(s,n,he(o,Uo,s.zLayers)),this.initialPosition=this.position.copy();const r=s.canvas.size;switch(this.moveCenter={...Cs(this.options.move.center,r),radius:this.options.move.center.radius??jo,mode:this.options.move.center.mode??yt.percent},this.direction=rr(this.options.move.direction,this.position,this.moveCenter),this.options.move.direction){case H.inside:this.outType=ge.inside;break;case H.outside:this.outType=ge.outside;break}this.offset=$.origin},this._engine=e}destroy(e){var o,r,a;if(this.unbreakable||this.destroyed)return;this.destroyed=!0,this.bubble.inRange=!1,this.slow.inRange=!1;const i=this.container,n=this.pathGenerator,s=i.shapeDrawers.get(this.shape);(o=s==null?void 0:s.particleDestroy)==null||o.call(s,this);for(const c of i.plugins.values())(r=c.particleDestroyed)==null||r.call(c,this,e);for(const c of i.particles.updaters)(a=c.particleDestroyed)==null||a.call(c,this,e);n==null||n.reset(this),this._engine.dispatchEvent(K.particleDestroyed,{container:this.container,data:{particle:this}})}draw(e){const i=this.container,n=i.canvas;for(const s of i.plugins.values())n.drawParticlePlugin(s,this,e);n.drawParticle(this,e)}getFillColor(){return this._getRollColor(this.bubble.color??Pn(this.color))}getMass(){return this.getRadius()**Me*Math.PI*q}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??Pn(this.strokeColor))}init(e,i,n,s){var X,U,te,V,ae,fe;const o=this.container,r=this._engine;this.id=e,this.group=s,this.effectClose=!0,this.effectFill=!0,this.shapeClose=!0,this.shapeFill=!0,this.pathRotation=!1,this.lastPathTime=0,this.destroyed=!1,this.unbreakable=!1,this.isRotating=!1,this.rotation=0,this.misplaced=!1,this.retina={maxDistance:{}},this.outType=ge.normal,this.ignoresResizeRatio=!0;const a=o.retina.pixelRatio,c=o.actualOptions,l=Ls(this._engine,o,c.particles),{reduceDuplicates:u}=l,h=l.effect.type,d=l.shape.type;this.effect=le(h,this.id,u),this.shape=le(d,this.id,u);const f=l.effect,p=l.shape;if(n){if((X=n.effect)!=null&&X.type){const E=n.effect.type,be=le(E,this.id,u);be&&(this.effect=be,f.load(n.effect))}if((U=n.shape)!=null&&U.type){const E=n.shape.type,be=le(E,this.id,u);be&&(this.shape=be,p.load(n.shape))}}if(this.effect===mt){const E=[...this.container.effectDrawers.keys()];this.effect=E[Math.floor(R()*E.length)]}if(this.shape===mt){const E=[...this.container.shapeDrawers.keys()];this.shape=E[Math.floor(R()*E.length)]}this.effectData=Sa(this.effect,f,this.id,u),this.shapeData=Oa(this.shape,p,this.id,u),l.load(n);const y=this.effectData;y&&l.load(y.particles);const m=this.shapeData;m&&l.load(m.particles);const b=new Ts(r,o);b.load(o.actualOptions.interactivity),b.load(l.interactivity),this.interactivity=b,this.effectFill=(y==null?void 0:y.fill)??l.effect.fill,this.effectClose=(y==null?void 0:y.close)??l.effect.close,this.shapeFill=(m==null?void 0:m.fill)??l.shape.fill,this.shapeClose=(m==null?void 0:m.close)??l.shape.close,this.options=l;const w=this.options.move.path;this.pathDelay=x(w.delay.value)*W,w.generator&&(this.pathGenerator=this._engine.getPathGenerator(w.generator),this.pathGenerator&&o.addPath(w.generator,this.pathGenerator)&&this.pathGenerator.init(o)),o.retina.initParticle(this),this.size=ks(this.options.size,a),this.bubble={inRange:!1},this.slow={inRange:!1,factor:1},this._initPosition(i),this.initialVelocity=this._calculateVelocity(),this.velocity=this.initialVelocity.copy(),this.moveDecay=ds-x(this.options.move.decay);const _=o.particles;_.setLastZIndex(this.position.z),this.zIndexFactor=this.position.z/o.zLayers,this.sides=24;let v=o.effectDrawers.get(this.effect);v||(v=this._engine.getEffectDrawer(this.effect),v&&o.effectDrawers.set(this.effect,v)),v!=null&&v.loadEffect&&v.loadEffect(this);let M=o.shapeDrawers.get(this.shape);M||(M=this._engine.getShapeDrawer(this.shape),M&&o.shapeDrawers.set(this.shape,M)),M!=null&&M.loadShape&&M.loadShape(this);const T=M==null?void 0:M.getSidesCount;T&&(this.sides=T(this)),this.spawning=!1,this.shadowColor=ye(this._engine,this.options.shadow.color);for(const E of _.updaters)E.init(this);for(const E of _.movers)(te=E.init)==null||te.call(E,this);(V=v==null?void 0:v.particleInit)==null||V.call(v,o,this),(ae=M==null?void 0:M.particleInit)==null||ae.call(M,o,this);for(const E of o.plugins.values())(fe=E.particleCreated)==null||fe.call(E,this)}isInsideCanvas(){const e=this.getRadius(),i=this.container.canvas.size,n=this.position;return n.x>=-e&&n.y>=-e&&n.y<=i.height+e&&n.x<=i.width+e}isVisible(){return!this.destroyed&&!this.spawning&&this.isInsideCanvas()}reset(){var e;for(const i of this.container.particles.updaters)(e=i.reset)==null||e.call(i,this)}}class Ta{constructor(e,i){this.position=e,this.particle=i}}var dt;(function(t){t.circle="circle",t.rectangle="rectangle"})(dt||(dt={}));class As{constructor(e,i,n){this.position={x:e,y:i},this.type=n}}class N extends As{constructor(e,i,n){super(e,i,dt.circle),this.radius=n}contains(e){return oe(e,this.position)<=this.radius}intersects(e){const i=this.position,n=e.position,s={x:Math.abs(n.x-i.x),y:Math.abs(n.y-i.y)},o=this.radius;if(e instanceof N||e.type===dt.circle){const r=e,a=o+r.radius,c=Math.sqrt(s.x**Me+s.y**Me);return a>c}else if(e instanceof ve||e.type===dt.rectangle){const r=e,{width:a,height:c}=r.size;return Math.pow(s.x-a,Me)+Math.pow(s.y-c,Me)<=o**Me||s.x<=o+a&&s.y<=o+c||s.x<=a||s.y<=c}return!1}}class ve extends As{constructor(e,i,n,s){super(e,i,dt.rectangle),this.size={height:s,width:n}}contains(e){const i=this.size.width,n=this.size.height,s=this.position;return e.x>=s.x&&e.x<=s.x+i&&e.y>=s.y&&e.y<=s.y+n}intersects(e){if(e instanceof N)return e.intersects(this);const i=this.size.width,n=this.size.height,s=this.position,o=e.position,r=e instanceof ve?e.size:{width:0,height:0},a=r.width,c=r.height;return o.x<s.x+i&&o.x+a>s.x&&o.y<s.y+n&&o.y+c>s.y}}class Qt{constructor(e,i){this.rectangle=e,this.capacity=i,this._subdivide=()=>{const{x:n,y:s}=this.rectangle.position,{width:o,height:r}=this.rectangle.size,{capacity:a}=this;for(let c=0;c<Mo;c++){const l=c%G;this._subs.push(new Qt(new ve(n+o*q*l,s+r*q*(Math.round(c*q)-l),o*q,r*q),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(i=>i.insert(e))):!1}query(e,i){const n=[];if(!e.intersects(this.rectangle))return[];for(const s of this._points)!e.contains(s.position)&&oe(e.position,s.position)>s.particle.getRadius()&&(!i||i(s.particle))||n.push(s.particle);if(this._divided)for(const s of this._subs)n.push(...s.query(e,i));return n}queryCircle(e,i,n){return this.query(new N(e.x,e.y,i),n)}queryRectangle(e,i,n){return this.query(new ve(e.x,e.y,i.width,i.height),n)}}const Tn=t=>{const{height:e,width:i}=t;return new ve(gn*i,gn*e,vn*i,vn*e)};class Ea{constructor(e,i){this._addToPool=(...s)=>{this._pool.push(...s)},this._applyDensity=(s,o,r,a)=>{var p,y,m;const c=s.number;if(!((p=s.number.density)!=null&&p.enable)){r===void 0?this._limit=c.limit.value:(((y=a==null?void 0:a.number.limit)==null?void 0:y.value)??c.limit.value)&&this._groupLimits.set(r,((m=a==null?void 0:a.number.limit)==null?void 0:m.value)??c.limit.value);return}const l=this._initDensityFactor(c.density),u=c.value,h=c.limit.value>bn?c.limit.value:u,d=Math.min(u,h)*l+o,f=Math.min(this.count,this.filter(b=>b.group===r).length);r===void 0?this._limit=c.limit.value*l:this._groupLimits.set(r,c.limit.value*l),f<d?this.push(Math.abs(d-f),void 0,s,r):f>d&&this.removeQuantity(f-d,r)},this._initDensityFactor=s=>{const o=this._container;if(!o.canvas.element||!s.enable)return No;const r=o.canvas.element,a=o.retina.pixelRatio;return r.width*r.height/(s.height*s.width*a**Me)},this._pushParticle=(s,o,r,a)=>{try{let c=this._pool.pop();c||(c=new Ra(this._engine,this._container)),c.init(this._nextId,s,o,r);let l=!0;return a&&(l=a(c)),l?(this._array.push(c),this._zArray.push(c),this._nextId++,this._engine.dispatchEvent(K.particleAdded,{container:this._container,data:{particle:c}}),c):void 0}catch(c){Ze().warning(`${ue} adding particle: ${c}`)}},this._removeParticle=(s,o,r)=>{const a=this._array[s];if(!a||a.group!==o)return!1;const c=this._zArray.indexOf(a);return this._array.splice(s,Yt),this._zArray.splice(c,Yt),a.destroy(r),this._engine.dispatchEvent(K.particleRemoved,{container:this._container,data:{particle:a}}),this._addToPool(a),!0},this._engine=e,this._container=i,this._nextId=0,this._array=[],this._zArray=[],this._pool=[],this._limit=0,this._groupLimits=new Map,this._needsSort=!1,this._lastZIndex=0,this._interactionManager=new za(e,i),this._pluginsInitialized=!1;const n=i.canvas.size;this.quadTree=new Qt(Tn(n),ln),this.movers=[],this.updaters=[]}get count(){return this._array.length}addManualParticles(){const e=this._container;e.actualOptions.manualParticles.forEach(n=>this.addParticle(n.position?Cs(n.position,e.canvas.size):void 0,n.options))}addParticle(e,i,n,s){const o=this._container.actualOptions.particles.number.limit.mode,r=n===void 0?this._limit:this._groupLimits.get(n)??this._limit,a=this.count;if(r>bn)switch(o){case Tt.delete:{const c=a+Wo-r;c>Go&&this.removeQuantity(c);break}case Tt.wait:if(a>=r)return;break}return this._pushParticle(e,i,n,s)}clear(){this._array=[],this._zArray=[],this._pluginsInitialized=!1}destroy(){this._array=[],this._zArray=[],this.movers=[],this.updaters=[]}draw(e){const i=this._container,n=i.canvas;n.clear(),this.update(e);for(const s of i.plugins.values())n.drawPlugin(s,e);for(const s of this._zArray)s.draw(e)}filter(e){return this._array.filter(e)}find(e){return this._array.find(e)}get(e){return this._array[e]}handleClickMode(e){this._interactionManager.handleClickMode(e)}async init(){var s,o;const e=this._container,i=e.actualOptions;this._lastZIndex=0,this._needsSort=!1,await this.initPlugins();let n=!1;for(const r of e.plugins.values())if(n=((s=r.particlesInitialization)==null?void 0:s.call(r))??n,n)break;if(this.addManualParticles(),!n){const r=i.particles,a=r.groups;for(const c in a){const l=a[c];for(let u=this.count,h=0;h<((o=l.number)==null?void 0:o.value)&&u<r.number.value;u++,h++)this.addParticle(void 0,l,c)}for(let c=this.count;c<r.number.value;c++)this.addParticle()}}async initPlugins(){if(this._pluginsInitialized)return;const e=this._container;this.movers=await this._engine.getMovers(e,!0),this.updaters=await this._engine.getUpdaters(e,!0),await this._interactionManager.init();for(const i of e.pathGenerators.values())i.init(e)}push(e,i,n,s){for(let o=0;o<e;o++)this.addParticle(i==null?void 0:i.position,n,s)}async redraw(){this.clear(),await this.init(),this.draw({value:0,factor:0})}remove(e,i,n){this.removeAt(this._array.indexOf(e),void 0,i,n)}removeAt(e,i=Po,n,s){if(e<Mi||e>this.count)return;let o=0;for(let r=e;o<i&&r<this.count;r++)this._removeParticle(r,n,s)&&(r--,o++)}removeQuantity(e,i){this.removeAt(Mi,e,i)}setDensity(){const e=this._container.actualOptions,i=e.particles.groups,n=e.manualParticles.length;for(const s in i)this._applyDensity(i[s],n,s);this._applyDensity(e.particles,n)}setLastZIndex(e){this._lastZIndex=e,this._needsSort=this._needsSort||this._lastZIndex<e}setResizeFactor(e){this._resizeFactor=e}update(e){var o,r;const i=this._container,n=new Set;this.quadTree=new Qt(Tn(i.canvas.size),ln);for(const a of i.pathGenerators.values())a.update();for(const a of i.plugins.values())(o=a.update)==null||o.call(a,e);const s=this._resizeFactor;for(const a of this._array){s&&!a.ignoresResizeRatio&&(a.position.x*=s.width,a.position.y*=s.height,a.initialPosition.x*=s.width,a.initialPosition.y*=s.height),a.ignoresResizeRatio=!1,this._interactionManager.reset(a);for(const c of this._container.plugins.values()){if(a.destroyed)break;(r=c.particleUpdate)==null||r.call(c,a,e)}for(const c of this.movers)c.isEnabled(a)&&c.move(a,e);if(a.destroyed){n.add(a);continue}this.quadTree.insert(new Ta(a.getPosition(),a))}if(n.size){const a=c=>!n.has(c);this._array=this.filter(a),this._zArray=this._zArray.filter(a);for(const c of n)this._engine.dispatchEvent(K.particleRemoved,{container:this._container,data:{particle:c}});this._addToPool(...n)}this._interactionManager.externalInteract(e);for(const a of this._array){for(const c of this.updaters)c.update(a,e);!a.destroyed&&!a.spawning&&this._interactionManager.particlesInteract(a,e)}if(delete this._resizeFactor,this._needsSort){const a=this._zArray;a.sort((c,l)=>l.position.z-c.position.z||c.id-l.id),this._lastZIndex=a[a.length-ps].position.z,this._needsSort=!1}}}class Ia{constructor(e){this.container=e,this.pixelRatio=un,this.reduceFactor=hn}init(){const e=this.container,i=e.actualOptions;this.pixelRatio=!i.detectRetina||Ke()?un:devicePixelRatio,this.reduceFactor=hn;const n=this.pixelRatio,s=e.canvas;if(s.element){const a=s.element;s.size.width=a.offsetWidth*n,s.size.height=a.offsetHeight*n}const o=i.particles,r=o.move;this.maxSpeed=x(r.gravity.maxSpeed)*n,this.sizeAnimationSpeed=x(o.size.animation.speed)*n}initParticle(e){const i=e.options,n=this.pixelRatio,s=i.move,o=s.distance,r=e.retina;r.moveDrift=x(s.drift)*n,r.moveSpeed=x(s.speed)*n,r.sizeAnimationSpeed=x(i.size.animation.speed)*n;const a=r.maxDistance;a.horizontal=o.horizontal!==void 0?o.horizontal*n:void 0,a.vertical=o.vertical!==void 0?o.vertical*n:void 0,r.maxSpeed=x(s.gravity.maxSpeed)*n}}function L(t){return t&&!t.destroyed}function Da(t,e=si,i=!1){return{value:t,factor:i?si/e:si*t/W}}function st(t,e,...i){const n=new Ma(t,e);return Ds(n,...i),n}class La{constructor(e,i,n){this._intersectionManager=s=>{if(!(!L(this)||!this.actualOptions.pauseOnOutsideViewport))for(const o of s)o.target===this.interactivity.element&&(o.isIntersecting?this.play():this.pause())},this._nextFrame=s=>{try{if(!this._smooth&&this._lastFrameTime!==void 0&&s<this._lastFrameTime+W/this.fpsLimit){this.draw(!1);return}this._lastFrameTime??(this._lastFrameTime=s);const o=Da(s-this._lastFrameTime,this.fpsLimit,this._smooth);if(this.addLifeTime(o.value),this._lastFrameTime=s,o.value>W){this.draw(!1);return}if(this.particles.draw(o),!this.alive()){this.destroy();return}this.animationStatus&&this.draw(!1)}catch(o){Ze().error(`${ue} in animation loop`,o)}},this._engine=e,this.id=Symbol(i),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._clickHandlers=new Map,this._sourceOptions=n,this._initialSourceOptions=n,this.retina=new Ia(this),this.canvas=new Fr(this,this._engine),this.particles=new Ea(this._engine,this),this.pathGenerators=new Map,this.interactivity={mouse:{clicking:!1,inside:!1}},this.plugins=new Map,this.effectDrawers=new Map,this.shapeDrawers=new Map,this._options=st(this._engine,this),this.actualOptions=st(this._engine,this),this._eventListeners=new Br(this),this._intersectionObserver=dr(s=>this._intersectionManager(s)),this._engine.dispatchEvent(K.containerBuilt,{container:this})}get animationStatus(){return!this._paused&&!this.pageHidden&&L(this)}get options(){return this._options}get sourceOptions(){return this._sourceOptions}addClickHandler(e){if(!L(this))return;const i=this.interactivity.element;if(!i)return;const n=(h,d,f)=>{if(!L(this))return;const p=this.retina.pixelRatio,y={x:d.x*p,y:d.y*p},m=this.particles.quadTree.queryCircle(y,f*p);e(h,m)},s=h=>{if(!L(this))return;const d=h,f={x:d.offsetX||d.clientX,y:d.offsetY||d.clientY};n(h,f,Io)},o=()=>{L(this)&&(l=!0,u=!1)},r=()=>{L(this)&&(u=!0)},a=h=>{if(L(this)){if(l&&!u){const d=h;let f=d.touches[d.touches.length-mn];if(!f&&(f=d.changedTouches[d.changedTouches.length-mn],!f))return;const p=this.canvas.element,y=p?p.getBoundingClientRect():void 0,m={x:f.clientX-(y?y.left:Gt),y:f.clientY-(y?y.top:Gt)};n(h,m,Math.max(f.radiusX,f.radiusY))}l=!1,u=!1}},c=()=>{L(this)&&(l=!1,u=!1)};let l=!1,u=!1;this._clickHandlers.set("click",s),this._clickHandlers.set("touchstart",o),this._clickHandlers.set("touchmove",r),this._clickHandlers.set("touchend",a),this._clickHandlers.set("touchcancel",c);for(const[h,d]of this._clickHandlers)i.addEventListener(h,d)}addLifeTime(e){this._lifeTime+=e}addPath(e,i,n=!1){return!L(this)||!n&&this.pathGenerators.has(e)?!1:(this.pathGenerators.set(e,i),!0)}alive(){return!this._duration||this._lifeTime<=this._duration}clearClickHandlers(){var e;if(L(this)){for(const[i,n]of this._clickHandlers)(e=this.interactivity.element)==null||e.removeEventListener(i,n);this._clickHandlers.clear()}}destroy(e=!0){var i,n;if(L(this)){this.stop(),this.clearClickHandlers(),this.particles.destroy(),this.canvas.destroy();for(const s of this.effectDrawers.values())(i=s.destroy)==null||i.call(s,this);for(const s of this.shapeDrawers.values())(n=s.destroy)==null||n.call(s,this);for(const s of this.effectDrawers.keys())this.effectDrawers.delete(s);for(const s of this.shapeDrawers.keys())this.shapeDrawers.delete(s);if(this._engine.clearPlugins(this),this.destroyed=!0,e){const s=this._engine.items,o=s.findIndex(r=>r===this);o>=Do&&s.splice(o,fs)}this._engine.dispatchEvent(K.containerDestroyed,{container:this})}}draw(e){if(!L(this))return;let i=e;const n=s=>{i&&(this._lastFrameTime=void 0,i=!1),this._nextFrame(s)};this._drawAnimationFrame=sr(s=>n(s))}async export(e,i={}){for(const n of this.plugins.values()){if(!n.export)continue;const s=await n.export(e,i);if(s.supported)return s.blob}Ze().error(`${ue} - Export plugin with type ${e} not found`)}handleClickMode(e){var i;if(L(this)){this.particles.handleClickMode(e);for(const n of this.plugins.values())(i=n.handleClickMode)==null||i.call(n,e)}}async init(){var l,u,h,d;if(!L(this))return;const e=this._engine.getSupportedEffects();for(const f of e){const p=this._engine.getEffectDrawer(f);p&&this.effectDrawers.set(f,p)}const i=this._engine.getSupportedShapes();for(const f of i){const p=this._engine.getShapeDrawer(f);p&&this.shapeDrawers.set(f,p)}await this.particles.initPlugins(),this._options=st(this._engine,this,this._initialSourceOptions,this.sourceOptions),this.actualOptions=st(this._engine,this,this._options);const n=await this._engine.getAvailablePlugins(this);for(const[f,p]of n)this.plugins.set(f,p);this.retina.init(),await this.canvas.init(),this.updateActualOptions(),this.canvas.initBackground(),this.canvas.resize();const{zLayers:s,duration:o,delay:r,fpsLimit:a,smooth:c}=this.actualOptions;this.zLayers=s,this._duration=x(o)*W,this._delay=x(r)*W,this._lifeTime=0,this.fpsLimit=a>Ao?a:Lo,this._smooth=c;for(const f of this.effectDrawers.values())await((l=f.init)==null?void 0:l.call(f,this));for(const f of this.shapeDrawers.values())await((u=f.init)==null?void 0:u.call(f,this));for(const f of this.plugins.values())await((h=f.init)==null?void 0:h.call(f));this._engine.dispatchEvent(K.containerInit,{container:this}),await this.particles.init(),this.particles.setDensity();for(const f of this.plugins.values())(d=f.particlesSetup)==null||d.call(f);this._engine.dispatchEvent(K.particlesSetup,{container:this})}async loadTheme(e){L(this)&&(this._currentTheme=e,await this.refresh())}pause(){var e;if(L(this)&&(this._drawAnimationFrame!==void 0&&(or(this._drawAnimationFrame),delete this._drawAnimationFrame),!this._paused)){for(const i of this.plugins.values())(e=i.pause)==null||e.call(i);this.pageHidden||(this._paused=!0),this._engine.dispatchEvent(K.containerPaused,{container:this})}}play(e){if(!L(this))return;const i=this._paused||e;if(this._firstStart&&!this.actualOptions.autoPlay){this._firstStart=!1;return}if(this._paused&&(this._paused=!1),i)for(const n of this.plugins.values())n.play&&n.play();this._engine.dispatchEvent(K.containerPlay,{container:this}),this.draw(i??!1)}async refresh(){if(L(this))return this.stop(),this.start()}async reset(e){if(L(this))return this._initialSourceOptions=e,this._sourceOptions=e,this._options=st(this._engine,this,this._initialSourceOptions,this.sourceOptions),this.actualOptions=st(this._engine,this,this._options),this.refresh()}async start(){!L(this)||this.started||(await this.init(),this.started=!0,await new Promise(e=>{const i=async()=>{var n;this._eventListeners.addListeners(),this.interactivity.element instanceof HTMLElement&&this._intersectionObserver&&this._intersectionObserver.observe(this.interactivity.element);for(const s of this.plugins.values())await((n=s.start)==null?void 0:n.call(s));this._engine.dispatchEvent(K.containerStarted,{container:this}),this.play(),e()};this._delayTimeout=setTimeout(()=>void i(),this._delay)}))}stop(){var e;if(!(!L(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 i of this.plugins.values())(e=i.stop)==null||e.call(i);for(const i of this.plugins.keys())this.plugins.delete(i);this._sourceOptions=this._options,this._engine.dispatchEvent(K.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 Aa{constructor(){this._listeners=new Map}addEventListener(e,i){this.removeEventListener(e,i);let n=this._listeners.get(e);n||(n=[],this._listeners.set(e,n)),n.push(i)}dispatchEvent(e,i){const n=this._listeners.get(e);n==null||n.forEach(s=>s(i))}hasEventListener(e){return!!this._listeners.get(e)}removeAllEventListeners(e){e?this._listeners.delete(e):this._listeners=new Map}removeEventListener(e,i){const n=this._listeners.get(e);if(!n)return;const s=n.length,o=n.indexOf(i);o<Mi||(s===Yt?this._listeners.delete(e):n.splice(o,Yt))}}async function di(t,e,i,n=!1){let s=e.get(t);return(!s||n)&&(s=await Promise.all([...i.values()].map(o=>o(t))),e.set(t,s)),s}async function Fa(t){const e=le(t.url,t.index);if(!e)return t.fallback;const i=await fetch(e);return i.ok?await i.json():(Ze().error(`${ue} ${i.status} while retrieving config file`),t.fallback)}const Ba=t=>{let e;if(t instanceof HTMLCanvasElement||t.tagName.toLowerCase()===oi)e=t,e.dataset[je]||(e.dataset[je]=an);else{const n=t.getElementsByTagName(oi);n.length?(e=n[Fo],e.dataset[je]=an):(e=document.createElement(oi),e.dataset[je]=us,t.appendChild(e))}const i="100%";return e.style.width||(e.style.width=i),e.style.height||(e.style.height=i),e},qa=(t,e)=>{let i=e??document.getElementById(t);return i||(i=document.createElement("div"),i.id=t,i.dataset[je]=us,document.body.append(i),i)};class $a{constructor(){this._configs=new Map,this._domArray=[],this._eventDispatcher=new Aa,this._initialized=!1,this.plugins=[],this.colorManagers=new Map,this.easingFunctions=new Map,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.effectDrawers=new Map,this.shapeDrawers=new Map,this.pathGenerators=new Map}get configs(){const e={};for(const[i,n]of this._configs)e[i]=n;return e}get items(){return this._domArray}get version(){return"3.9.1"}async addColorManager(e,i=!0){this.colorManagers.set(e.key,e),await this.refresh(i)}addConfig(e){const i=e.key??e.name??"default";this._configs.set(i,e),this._eventDispatcher.dispatchEvent(K.configAdded,{data:{name:i,config:e}})}async addEasing(e,i,n=!0){this.getEasing(e)||(this.easingFunctions.set(e,i),await this.refresh(n))}async addEffect(e,i,n=!0){re(e,s=>{this.getEffectDrawer(s)||this.effectDrawers.set(s,i)}),await this.refresh(n)}addEventListener(e,i){this._eventDispatcher.addEventListener(e,i)}async addInteractor(e,i,n=!0){this._initializers.interactors.set(e,i),await this.refresh(n)}async addMover(e,i,n=!0){this._initializers.movers.set(e,i),await this.refresh(n)}async addParticleUpdater(e,i,n=!0){this._initializers.updaters.set(e,i),await this.refresh(n)}async addPathGenerator(e,i,n=!0){this.getPathGenerator(e)||this.pathGenerators.set(e,i),await this.refresh(n)}async addPlugin(e,i=!0){this.getPlugin(e.id)||this.plugins.push(e),await this.refresh(i)}async addPreset(e,i,n=!1,s=!0){(n||!this.getPreset(e))&&this.presets.set(e,i),await this.refresh(s)}async addShape(e,i=!0){for(const n of e.validTypes)this.getShapeDrawer(n)||this.shapeDrawers.set(n,e);await this.refresh(i)}checkVersion(e){if(this.version!==e)throw new Error(`The tsParticles version is different from the loaded plugins version. Engine version: ${this.version}. Plugin version: ${e}`)}clearPlugins(e){this.updaters.delete(e),this.movers.delete(e),this.interactors.delete(e)}dispatchEvent(e,i){this._eventDispatcher.dispatchEvent(e,i)}dom(){return this.items}domItem(e){return this.item(e)}async getAvailablePlugins(e){const i=new Map;for(const n of this.plugins)n.needsPlugin(e.actualOptions)&&i.set(n.id,await n.getPlugin(e));return i}getEasing(e){return this.easingFunctions.get(e)??(i=>i)}getEffectDrawer(e){return this.effectDrawers.get(e)}async getInteractors(e,i=!1){return di(e,this.interactors,this._initializers.interactors,i)}async getMovers(e,i=!1){return di(e,this.movers,this._initializers.movers,i)}getPathGenerator(e){return this.pathGenerators.get(e)}getPlugin(e){return this.plugins.find(i=>i.id===e)}getPreset(e){return this.presets.get(e)}getShapeDrawer(e){return this.shapeDrawers.get(e)}getSupportedEffects(){return this.effectDrawers.keys()}getSupportedShapes(){return this.shapeDrawers.keys()}async getUpdaters(e,i=!1){return di(e,this.updaters,this._initializers.updaters,i)}init(){this._initialized||(this._initialized=!0)}item(e){const{items:i}=this,n=i[e];if(!n||n.destroyed){i.splice(e,fs);return}return n}async load(e){var d;const i=e.id??((d=e.element)==null?void 0:d.id)??`tsparticles${Math.floor(R()*Bo)}`,{index:n,url:s}=e,o=s?await Fa({fallback:e.options,url:s,index:n}):e.options,r=le(o,n),{items:a}=this,c=a.findIndex(f=>f.id.description===i),l=new La(this,i,r);if(c>=qo){const f=this.item(c),p=f?$o:Nt;f&&!f.destroyed&&f.destroy(!1),a.splice(c,p,l)}else a.push(l);const u=qa(i,e.element),h=Ba(u);return l.canvas.loadCanvas(h),await l.start(),l}loadOptions(e,i){this.plugins.forEach(n=>{var s;return(s=n.loadOptions)==null?void 0:s.call(n,e,i)})}loadParticlesOptions(e,i,...n){const s=this.updaters.get(e);s&&s.forEach(o=>{var r;return(r=o.loadOptions)==null?void 0:r.call(o,i,...n)})}async refresh(e=!0){e&&await Promise.all(this.items.map(i=>i.refresh()))}removeEventListener(e,i){this._eventDispatcher.removeEventListener(e,i)}setOnClickHandler(e){const{items:i}=this;if(!i.length)throw new Error(`${ue} can only set click handlers after calling tsParticles.load()`);i.forEach(n=>n.addClickHandler(e))}}function Va(){const t=new $a;return t.init(),t}class Ce{constructor(e){this.type=bt.external,this.container=e}}class Vi{constructor(e){this.type=bt.particles,this.container=e}}var pe;(function(t){t.clockwise="clockwise",t.counterClockwise="counter-clockwise",t.random="random"})(pe||(pe={}));var En;(function(t){t.linear="linear",t.radial="radial",t.random="random"})(En||(En={}));var Ye;(function(t){t.easeInBack="ease-in-back",t.easeInCirc="ease-in-circ",t.easeInCubic="ease-in-cubic",t.easeInLinear="ease-in-linear",t.easeInQuad="ease-in-quad",t.easeInQuart="ease-in-quart",t.easeInQuint="ease-in-quint",t.easeInExpo="ease-in-expo",t.easeInSine="ease-in-sine",t.easeOutBack="ease-out-back",t.easeOutCirc="ease-out-circ",t.easeOutCubic="ease-out-cubic",t.easeOutLinear="ease-out-linear",t.easeOutQuad="ease-out-quad",t.easeOutQuart="ease-out-quart",t.easeOutQuint="ease-out-quint",t.easeOutExpo="ease-out-expo",t.easeOutSine="ease-out-sine",t.easeInOutBack="ease-in-out-back",t.easeInOutCirc="ease-in-out-circ",t.easeInOutCubic="ease-in-out-cubic",t.easeInOutLinear="ease-in-out-linear",t.easeInOutQuad="ease-in-out-quad",t.easeInOutQuart="ease-in-out-quart",t.easeInOutQuint="ease-in-out-quint",t.easeInOutExpo="ease-in-out-expo",t.easeInOutSine="ease-in-out-sine"})(Ye||(Ye={}));const Hi=Va();Ke()||(window.tsParticles=Hi);const Ha=t=>{const e=t.id??"tsparticles";return I.useEffect(()=>{let i;return Hi.load({id:e,url:t.url,options:t.options}).then(n=>{var s;i=n,(s=t.particlesLoaded)==null||s.call(t,n)}),()=>{i==null||i.destroy()}},[e,t,t.url,t.options]),D.jsx("div",{id:e,className:t.className})};async function Ua(t){await t(Hi)}const Ti=.5,ja=2,Ee=0,me=1,In=60,Dn=0,Wa=.01,Ga=Math.PI*ja;function Na(t){const e=t.initialPosition,{dx:i,dy:n}=J(e,t.position),s=Math.abs(i),o=Math.abs(n),{maxDistance:r}=t.retina,a=r.horizontal,c=r.vertical;if(!a&&!c)return;const l=(a&&s>=a)??!1,u=(c&&o>=c)??!1;if((l||u)&&!t.misplaced)t.misplaced=!!a&&s>a||!!c&&o>c,a&&(t.velocity.x=t.velocity.y*Ti-t.velocity.x),c&&(t.velocity.y=t.velocity.x*Ti-t.velocity.y);else if((!a||s<a)&&(!c||o<c)&&t.misplaced)t.misplaced=!1;else if(t.misplaced){const h=t.position,d=t.velocity;a&&(h.x<e.x&&d.x<Ee||h.x>e.x&&d.x>Ee)&&(d.x*=-R()),c&&(h.y<e.y&&d.y<Ee||h.y>e.y&&d.y>Ee)&&(d.y*=-R())}}function Ya(t,e,i,n,s,o,r){Xa(t,r);const a=t.gravity,c=a!=null&&a.enable&&a.inverse?-me:me;s&&i&&(t.velocity.x+=s*r.factor/(In*i)),a!=null&&a.enable&&i&&(t.velocity.y+=c*(a.acceleration*r.factor)/(In*i));const l=t.moveDecay;t.velocity.multTo(l);const u=t.velocity.mult(i);a!=null&&a.enable&&n>Ee&&(!a.inverse&&u.y>=Ee&&u.y>=n||a.inverse&&u.y<=Ee&&u.y<=-n)&&(u.y=c*n,i&&(t.velocity.y=u.y/i));const h=t.options.zIndex,d=(me-t.zIndexFactor)**h.velocityRate;u.multTo(d),u.multTo(o);const{position:f}=t;f.addTo(u),e.vibrate&&(f.x+=Math.sin(f.x*Math.cos(f.y))*o,f.y+=Math.cos(f.y*Math.sin(f.x))*o)}function Qa(t,e,i){const n=t.container;if(!t.spin)return;const s=t.spin.direction===pe.clockwise,o={x:s?Math.cos:Math.sin,y:s?Math.sin:Math.cos};t.position.x=t.spin.center.x+t.spin.radius*o.x(t.spin.angle)*i,t.position.y=t.spin.center.y+t.spin.radius*o.y(t.spin.angle)*i,t.spin.radius+=t.spin.acceleration*i;const r=Math.max(n.canvas.size.width,n.canvas.size.height),a=r*Ti;t.spin.radius>a?(t.spin.radius=a,t.spin.acceleration*=-me):t.spin.radius<Dn&&(t.spin.radius=Dn,t.spin.acceleration*=-me),t.spin.angle+=e*Wa*(me-t.spin.radius/r)}function Xa(t,e){var r;const i=t.options,n=i.move.path;if(!n.enable)return;if(t.lastPathTime<=t.pathDelay){t.lastPathTime+=e.value;return}const o=(r=t.pathGenerator)==null?void 0:r.generate(t,e);o&&t.velocity.addTo(o),n.clamp&&(t.velocity.x=he(t.velocity.x,-me,me),t.velocity.y=he(t.velocity.y,-me,me)),t.lastPathTime-=t.pathDelay}function Za(t){return t.slow.inRange?t.slow.factor:me}function Ka(t){const e=t.container,i=t.options,n=i.move.spin;if(!n.enable)return;const s=n.position??{x:50,y:50},o=.01,r={x:s.x*o*e.canvas.size.width,y:s.y*o*e.canvas.size.height},a=t.getPosition(),c=oe(a,r),l=x(n.acceleration);t.retina.spinAcceleration=l*e.retina.pixelRatio,t.spin={center:r,direction:t.velocity.x>=Ee?pe.clockwise:pe.counterClockwise,angle:R()*Ga,radius:c,acceleration:t.retina.spinAcceleration}}const Ja=2,ec=1,tc=1;class ic{init(e){const i=e.options,n=i.move.gravity;e.gravity={enable:n.enable,acceleration:x(n.acceleration),inverse:n.inverse},Ka(e)}isEnabled(e){return!e.destroyed&&e.options.move.enable}move(e,i){var m,b;const n=e.options,s=n.move;if(!s.enable)return;const o=e.container,r=o.retina.pixelRatio;(m=e.retina).moveSpeed??(m.moveSpeed=x(s.speed)*r),(b=e.retina).moveDrift??(b.moveDrift=x(e.options.move.drift)*r);const a=Za(e),c=o.retina.reduceFactor,l=e.retina.moveSpeed,u=e.retina.moveDrift,h=_e(n.size.value)*r,d=s.size?e.getRadius()/h:ec,f=i.factor||tc,p=l*d*a*f/Ja,y=e.retina.maxSpeed??o.retina.maxSpeed;s.spin.enable?Qa(e,p,c):Ya(e,s,p,y,u,c,i),Na(e)}}async function nc(t,e=!0){t.checkVersion("3.9.1"),await t.addMover("base",()=>Promise.resolve(new ic),e)}const sc=2,oc=Math.PI*sc,rc=0,Ln={x:0,y:0};function ac(t){const{context:e,particle:i,radius:n}=t;i.circleRange||(i.circleRange={min:rc,max:oc});const s=i.circleRange;e.arc(Ln.x,Ln.y,n,s.min,s.max,!1)}const cc=12,lc=360,An=0;class uc{constructor(){this.validTypes=["circle"]}draw(e){ac(e)}getSidesCount(){return cc}particleInit(e,i){const n=i.shapeData,s=(n==null?void 0:n.angle)??{max:lc,min:An};i.circleRange=at(s)?{min:Ie(s.min),max:Ie(s.max)}:{min:An,max:Ie(s)}}}async function hc(t,e=!0){t.checkVersion("3.9.1"),await t.addShape(new uc,e)}class fc{constructor(e,i){this._container=e,this._engine=i}init(e){const i=St(this._engine,e.options.color,e.id,e.options.reduceDuplicates);i&&(e.color=Os(i,e.options.color.animation,this._container.retina.reduceFactor))}isEnabled(e){const{h:i,s:n,l:s}=e.options.color.animation,{color:o}=e;return!e.destroyed&&!e.spawning&&((o==null?void 0:o.h.value)!==void 0&&i.enable||(o==null?void 0:o.s.value)!==void 0&&n.enable||(o==null?void 0:o.l.value)!==void 0&&s.enable)}update(e,i){Rs(e.color,i)}}async function dc(t,e=!0){t.checkVersion("3.9.1"),await t.addParticleUpdater("color",i=>Promise.resolve(new fc(i,t)),e)}var Ue;(function(t){t[t.r=1]="r",t[t.g=2]="g",t[t.b=3]="b",t[t.a=4]="a"})(Ue||(Ue={}));const pc=/^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i,mc=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i,Dt=16,yc=1,gc=255;class vc{constructor(){this.key="hex",this.stringPrefix="#"}handleColor(e){return this._parseString(e.value)}handleRangeColor(e){return this._parseString(e.value)}parseString(e){return this._parseString(e)}_parseString(e){if(typeof e!="string"||!(e!=null&&e.startsWith(this.stringPrefix)))return;const i=e.replace(pc,(s,o,r,a,c)=>o+o+r+r+a+a+(c!==void 0?c+c:"")),n=mc.exec(i);return n?{a:n[Ue.a]!==void 0?parseInt(n[Ue.a],Dt)/gc:yc,b:parseInt(n[Ue.b],Dt),g:parseInt(n[Ue.g],Dt),r:parseInt(n[Ue.r],Dt)}:void 0}}async function bc(t,e=!0){t.checkVersion("3.9.1"),await t.addColorManager(new vc,e)}var ct;(function(t){t[t.h=1]="h",t[t.s=2]="s",t[t.l=3]="l",t[t.a=5]="a"})(ct||(ct={}));class wc{constructor(){this.key="hsl",this.stringPrefix="hsl"}handleColor(e){const i=e.value,n=i.hsl??e.value;if(n.h!==void 0&&n.s!==void 0&&n.l!==void 0)return gt(n)}handleRangeColor(e){const i=e.value,n=i.hsl??e.value;if(n.h!==void 0&&n.l!==void 0)return gt({h:x(n.h),l:x(n.l),s:x(n.s)})}parseString(e){if(!e.startsWith("hsl"))return;const i=/hsla?\(\s*(\d+)\s*[\s,]\s*(\d+)%\s*[\s,]\s*(\d+)%\s*([\s,]\s*(0|1|0?\.\d+|(\d{1,3})%)\s*)?\)/i,n=i.exec(e),s=4,o=1,r=10;return n?Mr({a:n.length>s?vs(n[ct.a]):o,h:parseInt(n[ct.h],r),l:parseInt(n[ct.l],r),s:parseInt(n[ct.s],r)}):void 0}}async function xc(t,e=!0){t.checkVersion("3.9.1"),await t.addColorManager(new wc,e)}class _c{constructor(e){this.container=e}init(e){const i=e.options.opacity,n=1;e.opacity=ks(i,n);const s=i.animation;s.enable&&(e.opacity.velocity=x(s.speed)/Te*this.container.retina.reduceFactor,s.sync||(e.opacity.velocity*=R()))}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,i){!this.isEnabled(e)||!e.opacity||Fi(e,e.opacity,!0,e.options.opacity.animation.destroy,i)}}async function kc(t,e=!0){t.checkVersion("3.9.1"),await t.addParticleUpdater("opacity",i=>Promise.resolve(new _c(i)),e)}const Xt=0,pt=0;function Cc(t){if(t.outMode!==B.bounce&&t.outMode!==B.split||t.direction!==z.left&&t.direction!==z.right)return;t.bounds.right<pt&&t.direction===z.left?t.particle.position.x=t.size+t.offset.x:t.bounds.left>t.canvasSize.width&&t.direction===z.right&&(t.particle.position.x=t.canvasSize.width-t.size-t.offset.x);const e=t.particle.velocity.x;let i=!1;if(t.direction===z.right&&t.bounds.right>=t.canvasSize.width&&e>Xt||t.direction===z.left&&t.bounds.left<=pt&&e<Xt){const s=x(t.particle.options.bounce.horizontal.value);t.particle.velocity.x*=-s,i=!0}if(!i)return;const n=t.offset.x+t.size;t.bounds.right>=t.canvasSize.width&&t.direction===z.right?t.particle.position.x=t.canvasSize.width-n:t.bounds.left<=pt&&t.direction===z.left&&(t.particle.position.x=n),t.outMode===B.split&&t.particle.destroy()}function Pc(t){if(t.outMode!==B.bounce&&t.outMode!==B.split||t.direction!==z.bottom&&t.direction!==z.top)return;t.bounds.bottom<pt&&t.direction===z.top?t.particle.position.y=t.size+t.offset.y:t.bounds.top>t.canvasSize.height&&t.direction===z.bottom&&(t.particle.position.y=t.canvasSize.height-t.size-t.offset.y);const e=t.particle.velocity.y;let i=!1;if(t.direction===z.bottom&&t.bounds.bottom>=t.canvasSize.height&&e>Xt||t.direction===z.top&&t.bounds.top<=pt&&e<Xt){const s=x(t.particle.options.bounce.vertical.value);t.particle.velocity.y*=-s,i=!0}if(!i)return;const n=t.offset.y+t.size;t.bounds.bottom>=t.canvasSize.height&&t.direction===z.bottom?t.particle.position.y=t.canvasSize.height-n:t.bounds.top<=pt&&t.direction===z.top&&(t.particle.position.y=n),t.outMode===B.split&&t.particle.destroy()}class Mc{constructor(e){this.container=e,this.modes=[B.bounce,B.split]}update(e,i,n,s){if(!this.modes.includes(s))return;const o=this.container;let r=!1;for(const d of o.plugins.values())if(d.particleBounce!==void 0&&(r=d.particleBounce(e,n,i)),r)break;if(r)return;const a=e.getPosition(),c=e.offset,l=e.getRadius(),u=Et(a,l),h=o.canvas.size;Cc({particle:e,outMode:s,direction:i,bounds:u,canvasSize:h,offset:c,size:l}),Pc({particle:e,outMode:s,direction:i,bounds:u,canvasSize:h,offset:c,size:l})}}const Lt=0;class zc{constructor(e){this.container=e,this.modes=[B.destroy]}update(e,i,n,s){if(!this.modes.includes(s))return;const o=this.container;switch(e.outType){case ge.normal:case ge.outside:if(Di(e.position,o.canvas.size,$.origin,e.getRadius(),i))return;break;case ge.inside:{const{dx:r,dy:a}=J(e.position,e.moveCenter),{x:c,y:l}=e.velocity;if(c<Lt&&r>e.moveCenter.radius||l<Lt&&a>e.moveCenter.radius||c>=Lt&&r<-e.moveCenter.radius||l>=Lt&&a<-e.moveCenter.radius)return;break}}o.particles.remove(e,e.group,!0)}}const At=0;class Sc{constructor(e){this.container=e,this.modes=[B.none]}update(e,i,n,s){if(!this.modes.includes(s)||((e.options.move.distance.horizontal&&(i===z.left||i===z.right))??(e.options.move.distance.vertical&&(i===z.top||i===z.bottom))))return;const o=e.options.move.gravity,r=this.container,a=r.canvas.size,c=e.getRadius();if(o.enable){const l=e.position;(!o.inverse&&l.y>a.height+c&&i===z.bottom||o.inverse&&l.y<-c&&i===z.top)&&r.particles.remove(e)}else{if(e.velocity.y>At&&e.position.y<=a.height+c||e.velocity.y<At&&e.position.y>=-c||e.velocity.x>At&&e.position.x<=a.width+c||e.velocity.x<At&&e.position.x>=-c)return;Di(e.position,r.canvas.size,$.origin,c,i)||r.particles.remove(e)}}}const Ft=0,Bt=0;class Oc{constructor(e){this.container=e,this.modes=[B.out]}update(e,i,n,s){if(!this.modes.includes(s))return;const o=this.container;switch(e.outType){case ge.inside:{const{x:r,y:a}=e.velocity,c=$.origin;c.length=e.moveCenter.radius,c.angle=e.velocity.angle+Math.PI,c.addTo($.create(e.moveCenter));const{dx:l,dy:u}=J(e.position,c);if(r<=Ft&&l>=Bt||a<=Ft&&u>=Bt||r>=Ft&&l<=Bt||a>=Ft&&u<=Bt)return;e.position.x=Math.floor(se({min:0,max:o.canvas.size.width})),e.position.y=Math.floor(se({min:0,max:o.canvas.size.height}));const{dx:h,dy:d}=J(e.position,e.moveCenter);e.direction=Math.atan2(-d,-h),e.velocity.angle=e.direction;break}default:{if(Di(e.position,o.canvas.size,$.origin,e.getRadius(),i))return;switch(e.outType){case ge.outside:{e.position.x=Math.floor(se({min:-e.moveCenter.radius,max:e.moveCenter.radius}))+e.moveCenter.x,e.position.y=Math.floor(se({min:-e.moveCenter.radius,max:e.moveCenter.radius}))+e.moveCenter.y;const{dx:r,dy:a}=J(e.position,e.moveCenter);e.moveCenter.radius&&(e.direction=Math.atan2(a,r),e.velocity.angle=e.direction);break}case ge.normal:{const r=e.options.move.warp,a=o.canvas.size,c={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},l=e.getRadius(),u=Et(e.position,l);i===z.right&&u.left>a.width+e.offset.x?(e.position.x=c.left,e.initialPosition.x=e.position.x,r||(e.position.y=R()*a.height,e.initialPosition.y=e.position.y)):i===z.left&&u.right<-e.offset.x&&(e.position.x=c.right,e.initialPosition.x=e.position.x,r||(e.position.y=R()*a.height,e.initialPosition.y=e.position.y)),i===z.bottom&&u.top>a.height+e.offset.y?(r||(e.position.x=R()*a.width,e.initialPosition.x=e.position.x),e.position.y=c.top,e.initialPosition.y=e.position.y):i===z.top&&u.bottom<-e.offset.y&&(r||(e.position.x=R()*a.width,e.initialPosition.x=e.position.x),e.position.y=c.bottom,e.initialPosition.y=e.position.y);break}}break}}}}const Rc=(t,e)=>t.default===e||t.bottom===e||t.left===e||t.right===e||t.top===e;class Tc{constructor(e){this._addUpdaterIfMissing=(i,n,s)=>{const o=i.options.move.outModes;!this.updaters.has(n)&&Rc(o,n)&&this.updaters.set(n,s(this.container))},this._updateOutMode=(i,n,s,o)=>{for(const r of this.updaters.values())r.update(i,o,n,s)},this.container=e,this.updaters=new Map}init(e){this._addUpdaterIfMissing(e,B.bounce,i=>new Mc(i)),this._addUpdaterIfMissing(e,B.out,i=>new Oc(i)),this._addUpdaterIfMissing(e,B.destroy,i=>new zc(i)),this._addUpdaterIfMissing(e,B.none,i=>new Sc(i))}isEnabled(e){return!e.destroyed&&!e.spawning}update(e,i){const n=e.options.move.outModes;this._updateOutMode(e,i,n.bottom??n.default,z.bottom),this._updateOutMode(e,i,n.left??n.default,z.left),this._updateOutMode(e,i,n.right??n.default,z.right),this._updateOutMode(e,i,n.top??n.default,z.top)}}async function Ec(t,e=!0){t.checkVersion("3.9.1"),await t.addParticleUpdater("outModes",i=>Promise.resolve(new Tc(i)),e)}var lt;(function(t){t[t.r=1]="r",t[t.g=2]="g",t[t.b=3]="b",t[t.a=5]="a"})(lt||(lt={}));class Ic{constructor(){this.key="rgb",this.stringPrefix="rgb"}handleColor(e){const i=e.value,n=i.rgb??e.value;if(n.r!==void 0)return n}handleRangeColor(e){const i=e.value,n=i.rgb??e.value;if(n.r!==void 0)return{r:x(n.r),g:x(n.g),b:x(n.b)}}parseString(e){if(!e.startsWith(this.stringPrefix))return;const i=/rgba?\(\s*(\d{1,3})\s*[\s,]\s*(\d{1,3})\s*[\s,]\s*(\d{1,3})\s*([\s,]\s*(0|1|0?\.\d+|(\d{1,3})%)\s*)?\)/i,n=i.exec(e),s=10;return n?{a:n.length>4?vs(n[lt.a]):1,b:parseInt(n[lt.b],s),g:parseInt(n[lt.g],s),r:parseInt(n[lt.r],s)}:void 0}}async function Dc(t,e=!0){t.checkVersion("3.9.1"),await t.addColorManager(new Ic,e)}const qe=0;class Lc{init(e){const i=e.container,n=e.options.size,s=n.animation;s.enable&&(e.size.velocity=(e.retina.sizeAnimationSpeed??i.retina.sizeAnimationSpeed)/Te*i.retina.reduceFactor,s.sync||(e.size.velocity*=R()))}isEnabled(e){return!e.destroyed&&!e.spawning&&e.size.enable&&((e.size.maxLoops??qe)<=qe||(e.size.maxLoops??qe)>qe&&(e.size.loops??qe)<(e.size.maxLoops??qe))}reset(e){e.size.loops=qe}update(e,i){this.isEnabled(e)&&Fi(e,e.size,!0,e.options.size.animation.destroy,i)}}async function Ac(t,e=!0){t.checkVersion("3.9.1"),await t.addParticleUpdater("size",()=>Promise.resolve(new Lc),e)}async function Fc(t,e=!0){t.checkVersion("3.9.1"),await bc(t,!1),await xc(t,!1),await Dc(t,!1),await nc(t,!1),await hc(t,!1),await dc(t,!1),await kc(t,!1),await Ec(t,!1),await Ac(t,!1),await t.refresh(e)}async function Bc(t,e=!0){t.checkVersion("3.9.1"),await t.addEasing(Ye.easeInQuad,i=>i**2,!1),await t.addEasing(Ye.easeOutQuad,i=>1-(1-i)**2,!1),await t.addEasing(Ye.easeInOutQuad,i=>i<.5?2*i**2:1-(-2*i+2)**2/2,!1),await t.refresh(e)}function qc(t,e){const{context:i,opacity:n}=t,s=.5,o=i.globalAlpha;if(!e)return;const r=e.width,a=r*s;i.globalAlpha=n,i.drawImage(e,-a,-a,r,r),i.globalAlpha=o}const pi='"Twemoji Mozilla", Apple Color Emoji, "Segoe UI Emoji", "Noto Color Emoji", "EmojiOne Color"',Fn=0;class $c{constructor(){this.validTypes=["emoji"],this._emojiShapeDict=new Map}destroy(){for(const[e,i]of this._emojiShapeDict)i instanceof ImageBitmap&&(i==null||i.close()),this._emojiShapeDict.delete(e)}draw(e){const i=e.particle.emojiDataKey;if(!i)return;const n=this._emojiShapeDict.get(i);n&&qc(e,n)}async init(e){const i=e.actualOptions,{validTypes:n}=this;if(!n.find(r=>A(r,i.particles.shape.type)))return;const s=[Cn(pi)],o=n.map(r=>i.particles.shape.options[r]).find(r=>!!r);o&&re(o,r=>{r.font&&s.push(Cn(r.font))}),await Promise.all(s)}particleDestroy(e){e.emojiDataKey=void 0}particleInit(e,i){const s=i.shapeData;if(!(s!=null&&s.value))return;const o=le(s.value,i.randomIndexData);if(!o)return;const r=typeof o=="string"?{font:s.font??pi,padding:s.padding??Fn,value:o}:{font:pi,padding:Fn,...s,...o},a=r.font,c=r.value,l=`${c}_${a}`;if(this._emojiShapeDict.has(l)){i.emojiDataKey=l;return}const u=r.padding*2,h=_e(i.size.value),d=h+u,f=d*2;let p;if(typeof OffscreenCanvas<"u"){const y=new OffscreenCanvas(f,f),m=y.getContext("2d");if(!m)return;m.font=`400 ${h*2}px ${a}`,m.textBaseline="middle",m.textAlign="center",m.fillText(c,d,d),p=y.transferToImageBitmap()}else{const y=document.createElement("canvas");y.width=f,y.height=f;const m=y.getContext("2d");if(!m)return;m.font=`400 ${h*2}px ${a}`,m.textBaseline="middle",m.textAlign="center",m.fillText(c,d,d),p=y}this._emojiShapeDict.set(l,p),i.emojiDataKey=l}}async function Vc(t,e=!0){t.checkVersion("3.9.1"),await t.addShape(new $c,e)}const Hc=1,Uc=1,Fs=0;function Bs(t,e,i,n,s,o){const r=e.actualOptions.interactivity.modes.attract;if(!r)return;const a=e.particles.quadTree.query(s,o);for(const c of a){const{dx:l,dy:u,distance:h}=J(c.position,i),d=r.speed*r.factor,f=he(t.getEasing(r.easing)(Uc-h/n)*d,Hc,r.maxSpeed),p=$.create(h?l/h*f:d,h?u/h*f:d);c.position.subFrom(p)}}function jc(t,e,i){e.attract||(e.attract={particles:[]});const{attract:n}=e;if(n.finish||(n.count||(n.count=0),n.count++,n.count===e.particles.count&&(n.finish=!0)),n.clicking){const s=e.interactivity.mouse.clickPosition,o=e.retina.attractModeDistance;if(!o||o<Fs||!s)return;Bs(t,e,s,o,new N(s.x,s.y,o),r=>i(r))}else n.clicking===!1&&(n.particles=[])}function Wc(t,e,i){const n=e.interactivity.mouse.position,s=e.retina.attractModeDistance;!s||s<Fs||!n||Bs(t,e,n,s,new N(n.x,n.y,s),o=>i(o))}class Gc{constructor(){this.distance=200,this.duration=.4,this.easing=Ye.easeOutQuad,this.factor=1,this.maxSpeed=50,this.speed=1}load(e){g(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))}}const Mt="attract";let Nc=class extends Ce{constructor(e,i){super(i),this._engine=e,i.attract||(i.attract={particles:[]}),this.handleClickMode=n=>{const s=this.container.actualOptions,o=s.interactivity.modes.attract;if(!(!o||n!==Mt)){i.attract||(i.attract={particles:[]}),i.attract.clicking=!0,i.attract.count=0;for(const r of i.attract.particles)this.isEnabled(r)&&r.velocity.setTo(r.initialVelocity);i.attract.particles=[],i.attract.finish=!1,setTimeout(()=>{i.destroyed||(i.attract||(i.attract={particles:[]}),i.attract.clicking=!1)},o.duration*W)}}}clear(){}init(){const e=this.container,i=e.actualOptions.interactivity.modes.attract;i&&(e.retina.attractModeDistance=i.distance*e.retina.pixelRatio)}interact(){const e=this.container,i=e.actualOptions,n=e.interactivity.status===Qe,s=i.interactivity.events,{enable:o,mode:r}=s.onHover,{enable:a,mode:c}=s.onClick;n&&o&&A(Mt,r)?Wc(this._engine,this.container,l=>this.isEnabled(l)):a&&A(Mt,c)&&jc(this._engine,this.container,l=>this.isEnabled(l))}isEnabled(e){const i=this.container,n=i.actualOptions,s=i.interactivity.mouse,o=((e==null?void 0:e.interactivity)??n.interactivity).events;if((!s.position||!o.onHover.enable)&&(!s.clickPosition||!o.onClick.enable))return!1;const r=o.onHover.mode,a=o.onClick.mode;return A(Mt,r)||A(Mt,a)}loadModeOptions(e,...i){e.attract||(e.attract=new Gc);for(const n of i)e.attract.load(n==null?void 0:n.attract)}reset(){}};async function Yc(t,e=!0){t.checkVersion("3.9.1"),await t.addInteractor("externalAttract",i=>Promise.resolve(new Nc(t,i)),e)}const Qc=2,jt=.5,Xc=Math.PI*jt,Bn=2,qs=10,Zc=0;function $s(t,e,i,n,s){const o=t.particles.quadTree.query(n,s);for(const r of o)n instanceof N?xs(Si(r),{position:e,mass:i**Qc*Xc,velocity:$.origin,factor:$.origin}):n instanceof ve&&vr(r,Et(e,i))}function Kc(t,e,i,n){const s=document.querySelectorAll(e);s.length&&s.forEach(o=>{const r=o,a=t.retina.pixelRatio,c={x:(r.offsetLeft+r.offsetWidth*jt)*a,y:(r.offsetTop+r.offsetHeight*jt)*a},l=r.offsetWidth*jt*a,u=qs*a,h=i.type===vt.circle?new N(c.x,c.y,l+u):new ve(r.offsetLeft*a-u,r.offsetTop*a-u,r.offsetWidth*a+u*Bn,r.offsetHeight*a+u*Bn);n(c,l,h)})}function Jc(t,e,i,n){Ai(i,e,(s,o)=>Kc(t,s,o,(r,a,c)=>$s(t,r,a,c,n)))}function el(t,e){const i=t.retina.pixelRatio,n=qs*i,s=t.interactivity.mouse.position,o=t.retina.bounceModeDistance;!o||o<Zc||!s||$s(t,s,o,new N(s.x,s.y,o+n),e)}class tl{constructor(){this.distance=200}load(e){g(e)||e.distance!==void 0&&(this.distance=e.distance)}}const qt="bounce";class il extends Ce{constructor(e){super(e)}clear(){}init(){const e=this.container,i=e.actualOptions.interactivity.modes.bounce;i&&(e.retina.bounceModeDistance=i.distance*e.retina.pixelRatio)}interact(){const e=this.container,i=e.actualOptions,n=i.interactivity.events,s=e.interactivity.status===Qe,o=n.onHover.enable,r=n.onHover.mode,a=n.onDiv;s&&o&&A(qt,r)?el(this.container,c=>this.isEnabled(c)):Jc(this.container,a,qt,c=>this.isEnabled(c))}isEnabled(e){const i=this.container,n=i.actualOptions,s=i.interactivity.mouse,o=((e==null?void 0:e.interactivity)??n.interactivity).events,r=o.onDiv;return!!s.position&&o.onHover.enable&&A(qt,o.onHover.mode)||Li(qt,r)}loadModeOptions(e,...i){e.bounce||(e.bounce=new tl);for(const n of i)e.bounce.load(n==null?void 0:n.bounce)}reset(){}}async function nl(t,e=!0){t.checkVersion("3.9.1"),await t.addInteractor("externalBounce",i=>Promise.resolve(new il(i)),e)}class Vs{constructor(){this.distance=200,this.duration=.4,this.mix=!1}load(e){if(!g(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 i=ke(this.color)?void 0:this.color;this.color=re(e.color,n=>Q.create(i,n))}e.size!==void 0&&(this.size=e.size)}}}class sl extends Vs{constructor(){super(),this.selectors=[]}load(e){super.load(e),!g(e)&&e.selectors!==void 0&&(this.selectors=e.selectors)}}class ol extends Vs{load(e){super.load(e),!g(e)&&(this.divs=re(e.divs,i=>{const n=new sl;return n.load(i),n}))}}var xe;(function(t){t.color="color",t.opacity="opacity",t.size="size"})(xe||(xe={}));function qn(t,e,i,n){if(e>=i){const s=t+(e-i)*n;return he(s,t,e)}else if(e<i){const s=t-(i-e)*n;return he(s,e,t)}}const $e="bubble",mi=0,rl=0,al=2,$n=1,Vn=1,cl=0,ll=0,yi=.5,gi=1;class ul extends Ce{constructor(e,i){super(e),this._clickBubble=()=>{var u;const n=this.container,s=n.actualOptions,o=n.interactivity.mouse.clickPosition,r=s.interactivity.modes.bubble;if(!r||!o)return;n.bubble||(n.bubble={});const a=n.retina.bubbleModeDistance;if(!a||a<mi)return;const c=n.particles.quadTree.queryCircle(o,a,h=>this.isEnabled(h)),{bubble:l}=n;for(const h of c){if(!l.clicking)continue;h.bubble.inRange=!l.durationEnd;const d=h.getPosition(),f=oe(d,o),p=(new Date().getTime()-(n.interactivity.mouse.clickTime??rl))/W;p>r.duration&&(l.durationEnd=!0),p>r.duration*al&&(l.clicking=!1,l.durationEnd=!1);const y={bubbleObj:{optValue:n.retina.bubbleModeSize,value:h.bubble.radius},particlesObj:{optValue:_e(h.options.size.value)*n.retina.pixelRatio,value:h.size.value},type:xe.size};this._process(h,f,p,y);const m={bubbleObj:{optValue:r.opacity,value:h.bubble.opacity},particlesObj:{optValue:_e(h.options.opacity.value),value:((u=h.opacity)==null?void 0:u.value)??$n},type:xe.opacity};this._process(h,f,p,m),!l.durationEnd&&f<=a?this._hoverBubbleColor(h,f):delete h.bubble.color}},this._hoverBubble=()=>{const n=this.container,s=n.interactivity.mouse.position,o=n.retina.bubbleModeDistance;if(!o||o<mi||!s)return;const r=n.particles.quadTree.queryCircle(s,o,a=>this.isEnabled(a));for(const a of r){a.bubble.inRange=!0;const c=a.getPosition(),l=oe(c,s),u=Vn-l/o;l<=o?u>=ll&&n.interactivity.status===Qe&&(this._hoverBubbleSize(a,u),this._hoverBubbleOpacity(a,u),this._hoverBubbleColor(a,u)):this.reset(a),n.interactivity.status===_i&&this.reset(a)}},this._hoverBubbleColor=(n,s,o)=>{const r=this.container.actualOptions,a=o??r.interactivity.modes.bubble;if(a){if(!n.bubble.finalColor){const c=a.color;if(!c)return;const l=le(c);n.bubble.finalColor=St(this._engine,l)}if(n.bubble.finalColor)if(a.mix){n.bubble.color=void 0;const c=n.getFillColor();n.bubble.color=c?Ms(Bi(c,n.bubble.finalColor,Vn-s,s)):n.bubble.finalColor}else n.bubble.color=n.bubble.finalColor}},this._hoverBubbleOpacity=(n,s,o)=>{var d,f;const r=this.container,a=r.actualOptions,c=(o==null?void 0:o.opacity)??((d=a.interactivity.modes.bubble)==null?void 0:d.opacity);if(!c)return;const l=n.options.opacity.value,u=((f=n.opacity)==null?void 0:f.value)??$n,h=qn(u,c,_e(l),s);h!==void 0&&(n.bubble.opacity=h)},this._hoverBubbleSize=(n,s,o)=>{const r=this.container,a=o!=null&&o.size?o.size*r.retina.pixelRatio:r.retina.bubbleModeSize;if(a===void 0)return;const c=_e(n.options.size.value)*r.retina.pixelRatio,l=n.size.value,u=qn(l,a,c,s);u!==void 0&&(n.bubble.radius=u)},this._process=(n,s,o,r)=>{const a=this.container,c=r.bubbleObj.optValue,l=a.actualOptions,u=l.interactivity.modes.bubble;if(!u||c===void 0)return;const h=u.duration,d=a.retina.bubbleModeDistance,f=r.particlesObj.optValue,p=r.bubbleObj.value,y=r.particlesObj.value??cl,m=r.type;if(!(!d||d<mi||c===f))if(a.bubble||(a.bubble={}),a.bubble.durationEnd)p&&(m===xe.size&&delete n.bubble.radius,m===xe.opacity&&delete n.bubble.opacity);else if(s<=d){if((p??y)!==c){const w=y-o*(y-c)/h;m===xe.size&&(n.bubble.radius=w),m===xe.opacity&&(n.bubble.opacity=w)}}else m===xe.size&&delete n.bubble.radius,m===xe.opacity&&delete n.bubble.opacity},this._singleSelectorHover=(n,s,o)=>{const r=this.container,a=document.querySelectorAll(s),c=r.actualOptions.interactivity.modes.bubble;!c||!a.length||a.forEach(l=>{const u=l,h=r.retina.pixelRatio,d={x:(u.offsetLeft+u.offsetWidth*yi)*h,y:(u.offsetTop+u.offsetHeight*yi)*h},f=u.offsetWidth*yi*h,p=o.type===vt.circle?new N(d.x,d.y,f):new ve(u.offsetLeft*h,u.offsetTop*h,u.offsetWidth*h,u.offsetHeight*h),y=r.particles.quadTree.query(p,m=>this.isEnabled(m));for(const m of y){if(!p.contains(m.getPosition()))continue;m.bubble.inRange=!0;const b=c.divs,w=ws(b,u);(!m.bubble.div||m.bubble.div!==u)&&(this.clear(m,n,!0),m.bubble.div=u),this._hoverBubbleSize(m,gi,w),this._hoverBubbleOpacity(m,gi,w),this._hoverBubbleColor(m,gi,w)}})},this._engine=i,e.bubble||(e.bubble={}),this.handleClickMode=n=>{n===$e&&(e.bubble||(e.bubble={}),e.bubble.clicking=!0)}}clear(e,i,n){e.bubble.inRange&&!n||(delete e.bubble.div,delete e.bubble.opacity,delete e.bubble.radius,delete e.bubble.color)}init(){const e=this.container,i=e.actualOptions.interactivity.modes.bubble;i&&(e.retina.bubbleModeDistance=i.distance*e.retina.pixelRatio,i.size!==void 0&&(e.retina.bubbleModeSize=i.size*e.retina.pixelRatio))}interact(e){const i=this.container.actualOptions,n=i.interactivity.events,s=n.onHover,o=n.onClick,r=s.enable,a=s.mode,c=o.enable,l=o.mode,u=n.onDiv;r&&A($e,a)?this._hoverBubble():c&&A($e,l)?this._clickBubble():Ai($e,u,(h,d)=>this._singleSelectorHover(e,h,d))}isEnabled(e){const i=this.container,n=i.actualOptions,s=i.interactivity.mouse,o=((e==null?void 0:e.interactivity)??n.interactivity).events,{onClick:r,onDiv:a,onHover:c}=o,l=Li($e,a);return l||c.enable&&s.position||r.enable&&s.clickPosition?A($e,c.mode)||A($e,r.mode)||l:!1}loadModeOptions(e,...i){e.bubble||(e.bubble=new ol);for(const n of i)e.bubble.load(n==null?void 0:n.bubble)}reset(e){e.bubble.inRange=!1}}async function hl(t,e=!0){t.checkVersion("3.9.1"),await t.addInteractor("externalBubble",i=>Promise.resolve(new ul(i,t)),e)}class fl{constructor(){this.opacity=.5}load(e){g(e)||e.opacity!==void 0&&(this.opacity=e.opacity)}}class dl{constructor(){this.distance=80,this.links=new fl,this.radius=60}load(e){g(e)||(e.distance!==void 0&&(this.distance=e.distance),this.links.load(e.links),e.radius!==void 0&&(this.radius=e.radius))}}const Hn=0,Un=1,pl=0;function ml(t,e,i,n){const s=Math.floor(i.getRadius()/e.getRadius()),o=e.getFillColor(),r=i.getFillColor();if(!o||!r)return;const a=e.getPosition(),c=i.getPosition(),l=Bi(o,r,e.getRadius(),i.getRadius()),u=t.createLinearGradient(a.x,a.y,c.x,c.y);return u.addColorStop(Hn,Ot(o,n)),u.addColorStop(he(s,Hn,Un),Se(l,n)),u.addColorStop(Un,Ot(r,n)),u}function yl(t,e,i,n,s){zt(t,n,s),t.lineWidth=e,t.strokeStyle=i,t.stroke()}function gl(t,e,i,n){const s=t.actualOptions,o=s.interactivity.modes.connect;if(o)return ml(e,i,n,o.links.opacity)}function vl(t,e,i){t.canvas.draw(n=>{const s=gl(t,n,e,i);if(!s)return;const o=e.getPosition(),r=i.getPosition();yl(n,e.retina.linksWidth??pl,s,o,r)})}const bl="connect",jn=0;class wl extends Ce{constructor(e){super(e)}clear(){}init(){const e=this.container,i=e.actualOptions.interactivity.modes.connect;i&&(e.retina.connectModeDistance=i.distance*e.retina.pixelRatio,e.retina.connectModeRadius=i.radius*e.retina.pixelRatio)}interact(){const e=this.container;if(e.actualOptions.interactivity.events.onHover.enable&&e.interactivity.status==="pointermove"){const n=e.interactivity.mouse.position,{connectModeDistance:s,connectModeRadius:o}=e.retina;if(!s||s<jn||!o||o<jn||!n)return;const r=Math.abs(o),a=e.particles.quadTree.queryCircle(n,r,c=>this.isEnabled(c));a.forEach((c,l)=>{const u=c.getPosition(),h=1;for(const d of a.slice(l+h)){const f=d.getPosition(),p=Math.abs(s),y=Math.abs(u.x-f.x),m=Math.abs(u.y-f.y);y<p&&m<p&&vl(e,c,d)}})}}isEnabled(e){const i=this.container,n=i.interactivity.mouse,s=((e==null?void 0:e.interactivity)??i.actualOptions.interactivity).events;return s.onHover.enable&&n.position?A(bl,s.onHover.mode):!1}loadModeOptions(e,...i){e.connect||(e.connect=new dl);for(const n of i)e.connect.load(n==null?void 0:n.connect)}reset(){}}async function xl(t,e=!0){t.checkVersion("3.9.1"),await t.addInteractor("externalConnect",i=>Promise.resolve(new wl(i)),e)}class _l{constructor(){this.blink=!1,this.consent=!1,this.opacity=1}load(e){g(e)||(e.blink!==void 0&&(this.blink=e.blink),e.color!==void 0&&(this.color=Q.create(this.color,e.color)),e.consent!==void 0&&(this.consent=e.consent),e.opacity!==void 0&&(this.opacity=e.opacity))}}class kl{constructor(){this.distance=100,this.links=new _l}load(e){g(e)||(e.distance!==void 0&&(this.distance=e.distance),this.links.load(e.links))}}const Cl=0;function Pl(t,e,i,n,s,o){zt(t,i,n),t.strokeStyle=Se(s,o),t.lineWidth=e,t.stroke()}function Ml(t,e,i,n,s){t.canvas.draw(o=>{const r=e.getPosition();Pl(o,e.retina.linksWidth??Cl,r,s,i,n)})}const zl="grab",Sl=0,Ol=0;class Rl extends Ce{constructor(e,i){super(e),this._engine=i}clear(){}init(){const e=this.container,i=e.actualOptions.interactivity.modes.grab;i&&(e.retina.grabModeDistance=i.distance*e.retina.pixelRatio)}interact(){var a;const e=this.container,i=e.actualOptions,n=i.interactivity;if(!n.modes.grab||!n.events.onHover.enable||e.interactivity.status!==Qe)return;const s=e.interactivity.mouse.position;if(!s)return;const o=e.retina.grabModeDistance;if(!o||o<Sl)return;const r=e.particles.quadTree.queryCircle(s,o,c=>this.isEnabled(c));for(const c of r){const l=c.getPosition(),u=oe(l,s);if(u>o)continue;const h=n.modes.grab.links,d=h.opacity,f=d-u*d/o;if(f<=Ol)continue;const p=h.color??((a=c.options.links)==null?void 0:a.color);if(!e.particles.grabLineColor&&p){const m=n.modes.grab.links;e.particles.grabLineColor=Ss(this._engine,p,m.blink,m.consent)}const y=Ri(c,void 0,e.particles.grabLineColor);y&&Ml(e,c,y,f,s)}}isEnabled(e){const i=this.container,n=i.interactivity.mouse,s=((e==null?void 0:e.interactivity)??i.actualOptions.interactivity).events;return s.onHover.enable&&!!n.position&&A(zl,s.onHover.mode)}loadModeOptions(e,...i){e.grab||(e.grab=new kl);for(const n of i)e.grab.load(n==null?void 0:n.grab)}reset(){}}async function Tl(t,e=!0){t.checkVersion("3.9.1"),await t.addInteractor("externalGrab",i=>Promise.resolve(new Rl(i,t)),e)}const El="pause";class Il extends Ce{constructor(e){super(e),this.handleClickMode=i=>{if(i!==El)return;const n=this.container;n.animationStatus?n.pause():n.play()}}clear(){}init(){}interact(){}isEnabled(){return!0}reset(){}}async function Dl(t,e=!0){t.checkVersion("3.9.1"),await t.addInteractor("externalPause",i=>Promise.resolve(new Il(i)),e)}class Ll{constructor(){this.default=!0,this.groups=[],this.quantity=4}load(e){if(g(e))return;e.default!==void 0&&(this.default=e.default),e.groups!==void 0&&(this.groups=e.groups.map(n=>n)),this.groups.length||(this.default=!0);const i=e.quantity;i!==void 0&&(this.quantity=S(i)),this.particles=re(e.particles,n=>Y({},n))}}const Al="push",Fl=0;class Bl extends Ce{constructor(e){super(e),this.handleClickMode=i=>{if(i!==Al)return;const n=this.container,s=n.actualOptions,o=s.interactivity.modes.push;if(!o)return;const r=x(o.quantity);if(r<=Fl)return;const a=Kt([void 0,...o.groups]),c=a!==void 0?n.actualOptions.particles.groups[a]:void 0,l=le(o.particles),u=Y(c,l);n.particles.push(r,n.interactivity.mouse,u,a)}}clear(){}init(){}interact(){}isEnabled(){return!0}loadModeOptions(e,...i){e.push||(e.push=new Ll);for(const n of i)e.push.load(n==null?void 0:n.push)}reset(){}}async function ql(t,e=!0){t.checkVersion("3.9.1"),await t.addInteractor("externalPush",i=>Promise.resolve(new Bl(i)),e)}class $l{constructor(){this.quantity=2}load(e){if(g(e))return;const i=e.quantity;i!==void 0&&(this.quantity=S(i))}}const Vl="remove";class Hl extends Ce{constructor(e){super(e),this.handleClickMode=i=>{const n=this.container,s=n.actualOptions;if(!s.interactivity.modes.remove||i!==Vl)return;const o=x(s.interactivity.modes.remove.quantity);n.particles.removeQuantity(o)}}clear(){}init(){}interact(){}isEnabled(){return!0}loadModeOptions(e,...i){e.remove||(e.remove=new $l);for(const n of i)e.remove.load(n==null?void 0:n.remove)}reset(){}}async function Ul(t,e=!0){t.checkVersion("3.9.1"),await t.addInteractor("externalRemove",i=>Promise.resolve(new Hl(i)),e)}class Hs{constructor(){this.distance=200,this.duration=.4,this.factor=100,this.speed=1,this.maxSpeed=50,this.easing=Ye.easeOutQuad}load(e){g(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 jl extends Hs{constructor(){super(),this.selectors=[]}load(e){super.load(e),!g(e)&&e.selectors!==void 0&&(this.selectors=e.selectors)}}class Wl extends Hs{load(e){super.load(e),!g(e)&&(this.divs=re(e.divs,i=>{const n=new jl;return n.load(i),n}))}}const Ve="repulse",Gl=0,Nl=6,Yl=3,Ql=2,Xl=0,Zl=0,Kl=1,vi=.5;class Jl extends Ce{constructor(e,i){super(i),this._clickRepulse=()=>{const n=this.container,s=n.actualOptions.interactivity.modes.repulse;if(!s)return;const o=n.repulse??{particles:[]};if(o.finish||(o.count||(o.count=0),o.count++,o.count===n.particles.count&&(o.finish=!0)),o.clicking){const r=n.retina.repulseModeDistance;if(!r||r<Gl)return;const a=Math.pow(r/Nl,Yl),c=n.interactivity.mouse.clickPosition;if(c===void 0)return;const l=new N(c.x,c.y,a),u=n.particles.quadTree.query(l,h=>this.isEnabled(h));for(const h of u){const{dx:d,dy:f,distance:p}=J(c,h.position),y=p**Ql,m=s.speed,b=-a*m/y;if(y<=a){o.particles.push(h);const w=$.create(d,f);w.length=b,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 n=this.container,s=n.interactivity.mouse.position,o=n.retina.repulseModeDistance;!o||o<Xl||!s||this._processRepulse(s,o,new N(s.x,s.y,o))},this._processRepulse=(n,s,o,r)=>{const a=this.container,c=a.particles.quadTree.query(o,m=>this.isEnabled(m)),l=a.actualOptions.interactivity.modes.repulse;if(!l)return;const{easing:u,speed:h,factor:d,maxSpeed:f}=l,p=this._engine.getEasing(u),y=((r==null?void 0:r.speed)??h)*d;for(const m of c){const{dx:b,dy:w,distance:_}=J(m.position,n),v=he(p(Kl-_/s)*y,Zl,f),M=$.create(_?b/_*v:y,_?w/_*v:y);m.position.addTo(M)}},this._singleSelectorRepulse=(n,s)=>{const o=this.container,r=o.actualOptions.interactivity.modes.repulse;if(!r)return;const a=document.querySelectorAll(n);a.length&&a.forEach(c=>{const l=c,u=o.retina.pixelRatio,h={x:(l.offsetLeft+l.offsetWidth*vi)*u,y:(l.offsetTop+l.offsetHeight*vi)*u},d=l.offsetWidth*vi*u,f=s.type===vt.circle?new N(h.x,h.y,d):new ve(l.offsetLeft*u,l.offsetTop*u,l.offsetWidth*u,l.offsetHeight*u),p=r.divs,y=ws(p,l);this._processRepulse(h,d,f,y)})},this._engine=e,i.repulse||(i.repulse={particles:[]}),this.handleClickMode=n=>{const s=this.container.actualOptions,o=s.interactivity.modes.repulse;if(!o||n!==Ve)return;i.repulse||(i.repulse={particles:[]});const r=i.repulse;r.clicking=!0,r.count=0;for(const a of i.repulse.particles)this.isEnabled(a)&&a.velocity.setTo(a.initialVelocity);r.particles=[],r.finish=!1,setTimeout(()=>{i.destroyed||(r.clicking=!1)},o.duration*W)}}clear(){}init(){const e=this.container,i=e.actualOptions.interactivity.modes.repulse;i&&(e.retina.repulseModeDistance=i.distance*e.retina.pixelRatio)}interact(){const e=this.container,i=e.actualOptions,n=e.interactivity.status===Qe,s=i.interactivity.events,o=s.onHover,r=o.enable,a=o.mode,c=s.onClick,l=c.enable,u=c.mode,h=s.onDiv;n&&r&&A(Ve,a)?this._hoverRepulse():l&&A(Ve,u)?this._clickRepulse():Ai(Ve,h,(d,f)=>this._singleSelectorRepulse(d,f))}isEnabled(e){const i=this.container,n=i.actualOptions,s=i.interactivity.mouse,o=((e==null?void 0:e.interactivity)??n.interactivity).events,r=o.onDiv,a=o.onHover,c=o.onClick,l=Li(Ve,r);if(!(l||a.enable&&s.position||c.enable&&s.clickPosition))return!1;const u=a.mode,h=c.mode;return A(Ve,u)||A(Ve,h)||l}loadModeOptions(e,...i){e.repulse||(e.repulse=new Wl);for(const n of i)e.repulse.load(n==null?void 0:n.repulse)}reset(){}}async function eu(t,e=!0){t.checkVersion("3.9.1"),await t.addInteractor("externalRepulse",i=>Promise.resolve(new Jl(t,i)),e)}class tu{constructor(){this.factor=3,this.radius=200}load(e){g(e)||(e.factor!==void 0&&(this.factor=e.factor),e.radius!==void 0&&(this.radius=e.radius))}}const iu="slow",nu=0;class su extends Ce{constructor(e){super(e)}clear(e,i,n){e.slow.inRange&&!n||(e.slow.factor=1)}init(){const e=this.container,i=e.actualOptions.interactivity.modes.slow;i&&(e.retina.slowModeRadius=i.radius*e.retina.pixelRatio)}interact(){}isEnabled(e){const i=this.container,n=i.interactivity.mouse,s=((e==null?void 0:e.interactivity)??i.actualOptions.interactivity).events;return s.onHover.enable&&!!n.position&&A(iu,s.onHover.mode)}loadModeOptions(e,...i){e.slow||(e.slow=new tu);for(const n of i)e.slow.load(n==null?void 0:n.slow)}reset(e){e.slow.inRange=!1;const i=this.container,n=i.actualOptions,s=i.interactivity.mouse.position,o=i.retina.slowModeRadius,r=n.interactivity.modes.slow;if(!r||!o||o<nu||!s)return;const a=e.getPosition(),c=oe(s,a),l=c/o,u=r.factor,{slow:h}=e;c>o||(h.inRange=!0,h.factor=l/u)}}async function ou(t,e=!0){t.checkVersion("3.9.1"),await t.addInteractor("externalSlow",i=>Promise.resolve(new su(i)),e)}const ru=0,au=1,cu=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d.]+%?\))|currentcolor/gi;function lu(t,e,i){const{svgData:n}=t;if(!n)return"";const s=Ot(e,i);if(n.includes("fill"))return n.replace(cu,()=>s);const o=n.indexOf(">");return`${n.substring(ru,o)} fill="${s}"${n.substring(o)}`}async function Jt(t){return new Promise(e=>{t.loading=!0;const i=new Image;t.element=i,i.addEventListener("load",()=>{t.loading=!1,e()}),i.addEventListener("error",()=>{t.element=void 0,t.error=!0,t.loading=!1,Ze().error(`${ue} loading image: ${t.source}`),e()}),i.src=t.source})}async function uu(t){if(t.type!=="svg"){await Jt(t);return}t.loading=!0;const e=await fetch(t.source);e.ok?t.svgData=await e.text():(Ze().error(`${ue} Image not found`),t.error=!0),t.loading=!1}function hu(t,e,i,n){var r;const s=lu(t,i,((r=n.opacity)==null?void 0:r.value)??au),o={color:i,gif:e.gif,data:{...t,svgData:s},loaded:!1,ratio:e.width/e.height,replaceColor:e.replaceColor,source:e.src};return new Promise(a=>{const c=new Blob([s],{type:"image/svg+xml"}),l=URL||window.URL||window.webkitURL||window,u=l.createObjectURL(c),h=new Image;h.addEventListener("load",()=>{o.loaded=!0,o.element=h,a(o),l.revokeObjectURL(u)});const d=async()=>{l.revokeObjectURL(u);const f={...t,error:!1,loading:!0};await Jt(f),o.loaded=!0,o.element=f.element,a(o)};h.addEventListener("error",()=>void d()),h.src=u})}const bi=[0,4,2,1],Wn=[8,8,4,2];class fu{constructor(e){this.pos=0,this.data=new Uint8ClampedArray(e)}getString(e){const i=this.data.slice(this.pos,this.pos+e);return this.pos+=i.length,i.reduce((n,s)=>n+String.fromCharCode(s),"")}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="",i=0;const n=0,s=0;do{i=this.data[this.pos++];for(let o=i;--o>=n;e+=String.fromCharCode(this.data[this.pos++]));}while(i!==s);return e}readSubBlocksBin(){let e=this.data[this.pos],i=0;const n=0,s=1;for(let r=0;e!==n;r+=e+s,e=this.data[this.pos+r])i+=e;const o=new Uint8Array(i);e=this.data[this.pos++];for(let r=0;e!==n;e=this.data[this.pos++])for(let a=e;--a>=n;o[r++]=this.data[this.pos++]);return o}skipSubBlocks(){for(const e=1,i=0;this.data[this.pos]!==i;this.pos+=this.data[this.pos]+e);this.pos++}}var de;(function(t){t[t.Replace=0]="Replace",t[t.Combine=1]="Combine",t[t.RestoreBackground=2]="RestoreBackground",t[t.RestorePrevious=3]="RestorePrevious",t[t.UndefinedA=4]="UndefinedA",t[t.UndefinedB=5]="UndefinedB",t[t.UndefinedC=6]="UndefinedC",t[t.UndefinedD=7]="UndefinedD"})(de||(de={}));var ze;(function(t){t[t.Extension=33]="Extension",t[t.ApplicationExtension=255]="ApplicationExtension",t[t.GraphicsControlExtension=249]="GraphicsControlExtension",t[t.PlainTextExtension=1]="PlainTextExtension",t[t.CommentExtension=254]="CommentExtension",t[t.Image=44]="Image",t[t.EndOfFile=59]="EndOfFile"})(ze||(ze={}));const ee={x:0,y:0},du=0,Gn=.5,pu=0,Nn=0,Ei=0;function Us(t,e){const i=[];for(let n=0;n<e;n++)i.push({r:t.data[t.pos],g:t.data[t.pos+1],b:t.data[t.pos+2]}),t.pos+=3;return i}function mu(t,e,i,n){switch(t.nextByte()){case ze.GraphicsControlExtension:{const s=e.frames[i(!1)];t.pos++;const o=t.nextByte();s.GCreserved=(o&224)>>>5,s.disposalMethod=(o&28)>>>2,s.userInputDelayFlag=(o&2)===2;const r=(o&1)===1;s.delayTime=t.nextTwoBytes()*10;const a=t.nextByte();r&&n(a),t.pos++;break}case ze.ApplicationExtension:{t.pos++;const s={identifier:t.getString(8),authenticationCode:t.getString(3),data:t.readSubBlocksBin()};e.applicationExtensions.push(s);break}case ze.CommentExtension:{e.comments.push([i(!1),t.readSubBlocks()]);break}case ze.PlainTextExtension:{if(e.globalColorTable.length===0)throw new EvalError("plain text extension without global color table");t.pos++,e.frames[i(!1)].plainTextData={left:t.nextTwoBytes(),top:t.nextTwoBytes(),width:t.nextTwoBytes(),height:t.nextTwoBytes(),charSize:{width:t.nextTwoBytes(),height:t.nextTwoBytes()},foregroundColor:t.nextByte(),backgroundColor:t.nextByte(),text:t.readSubBlocks()};break}default:t.skipSubBlocks();break}}async function yu(t,e,i,n,s,o){const r=e.frames[n(!0)];r.left=t.nextTwoBytes(),r.top=t.nextTwoBytes(),r.width=t.nextTwoBytes(),r.height=t.nextTwoBytes();const a=t.nextByte(),c=(a&128)===128,l=(a&64)===64;r.sortFlag=(a&32)===32,r.reserved=(a&24)>>>3;const u=1<<(a&7)+1;c&&(r.localColorTable=Us(t,u));const h=b=>{const{r:w,g:_,b:v}=(c?r.localColorTable:e.globalColorTable)[b];return b!==s(null)?{r:w,g:_,b:v,a:255}:{r:w,g:_,b:v,a:i?~~((w+_+v)/3):0}},d=(()=>{try{return new ImageData(r.width,r.height,{colorSpace:"srgb"})}catch(b){if(b instanceof DOMException&&b.name==="IndexSizeError")return null;throw b}})();if(d==null)throw new EvalError("GIF frame size is to large");const f=t.nextByte(),p=t.readSubBlocksBin(),y=1<<f,m=(b,w)=>{const _=b>>>3,v=b&7;return(p[_]+(p[_+1]<<8)+(p[_+2]<<16)&(1<<w)-1<<v)>>>v};if(l){for(let b=0,w=f+1,_=0,v=[[0]],M=0;M<4;M++)if(bi[M]<r.height){let T=0,X=0,U=!1;for(;!U;){const te=b;if(b=m(_,w),_+=w+1,b===y){w=f+1,v.length=y+2;for(let V=0;V<v.length;V++)v[V]=V<y?[V]:[]}else{b>=v.length?v.push(v[te].concat(v[te][0])):te!==y&&v.push(v[te].concat(v[b][0]));for(const V of v[b]){const{r:ae,g:fe,b:E,a:be}=h(V);d.data.set([ae,fe,E,be],bi[M]*r.width+Wn[M]*X+T%(r.width*4)),T+=4}v.length===1<<w&&w<12&&w++}T===r.width*4*(X+1)&&(X++,bi[M]+Wn[M]*X>=r.height&&(U=!0))}}r.image=d,r.bitmap=await createImageBitmap(d)}else{let b=0,w=f+1,_=0,v=-4,M=!1;const T=[[0]];for(;!M;){const X=b;if(b=m(_,w),_+=w,b===y){w=f+1,T.length=y+2;for(let U=0;U<T.length;U++)T[U]=U<y?[U]:[]}else{if(b===y+1){M=!0;break}b>=T.length?T.push(T[X].concat(T[X][0])):X!==y&&T.push(T[X].concat(T[b][0]));for(const U of T[b]){const{r:te,g:V,b:ae,a:fe}=h(U);d.data.set([te,V,ae,fe],v+=4)}T.length>=1<<w&&w<12&&w++}}r.image=d,r.bitmap=await createImageBitmap(d)}}async function gu(t,e,i,n,s,o){switch(t.nextByte()){case ze.EndOfFile:return!0;case ze.Image:await yu(t,e,i,n,s);break;case ze.Extension:mu(t,e,n,s);break;default:throw new EvalError("undefined block found")}return!1}function vu(t){for(const e of t.applicationExtensions)if(e.identifier+e.authenticationCode==="NETSCAPE2.0")return e.data[1]+(e.data[2]<<8);return NaN}async function bu(t,e,i){i||(i=!1);const n=await fetch(t);if(!n.ok&&n.status===404)throw new EvalError("file not found");const s=await n.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 fu(new Uint8ClampedArray(s));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(),c=(a&128)===128;o.colorRes=(a&112)>>>4,o.sortFlag=(a&8)===8;const l=1<<(a&7)+1,u=r.nextByte();o.pixelAspectRatio=r.nextByte(),o.pixelAspectRatio!==0&&(o.pixelAspectRatio=(o.pixelAspectRatio+15)/64),c&&(o.globalColorTable=Us(r,l));const h=(()=>{try{return new ImageData(o.width,o.height,{colorSpace:"srgb"})}catch(v){if(v instanceof DOMException&&v.name==="IndexSizeError")return null;throw v}})();if(h==null)throw new Error("GIF frame size is to large");const{r:d,g:f,b:p}=o.globalColorTable[u];h.data.set(c?[d,f,p,255]:[0,0,0,0]);for(let v=4;v<h.data.length;v*=2)h.data.copyWithin(v,0,v);o.backgroundImage=h;let y=-1,m=!0,b=-1;const w=v=>(v&&(m=!0),y),_=v=>(v!=null&&(b=v),b);try{do m&&(o.frames.push({left:0,top:0,width:0,height:0,disposalMethod:de.Replace,image:new ImageData(1,1,{colorSpace:"srgb"}),plainTextData:null,userInputDelayFlag:!1,delayTime:0,sortFlag:!1,localColorTable:[],reserved:0,GCreserved:0}),y++,b=-1,m=!1);while(!await gu(r,o,i,w,_,e));o.frames.length--;for(const v of o.frames){if(v.userInputDelayFlag&&v.delayTime===0){o.totalTime=1/0;break}o.totalTime+=v.delayTime}return o}catch(v){throw v instanceof EvalError?new Error(`error while parsing frame ${y} "${v.message}"`):v}}function wu(t){const{context:e,radius:i,particle:n,delta:s}=t,o=n.image;if(!(o!=null&&o.gifData)||!o.gif)return;const r=new OffscreenCanvas(o.gifData.width,o.gifData.height),a=r.getContext("2d");if(!a)throw new Error("could not create offscreen canvas context");a.imageSmoothingQuality="low",a.imageSmoothingEnabled=!1,a.clearRect(ee.x,ee.y,r.width,r.height),n.gifLoopCount===void 0&&(n.gifLoopCount=o.gifLoopCount??Ei);let c=n.gifFrame??du;const l={x:-o.gifData.width*Gn,y:-o.gifData.height*Gn},u=o.gifData.frames[c];if(n.gifTime===void 0&&(n.gifTime=pu),!!u.bitmap){switch(e.scale(i/o.gifData.width,i/o.gifData.height),u.disposalMethod){case de.UndefinedA:case de.UndefinedB:case de.UndefinedC:case de.UndefinedD:case de.Replace:a.drawImage(u.bitmap,u.left,u.top),e.drawImage(r,l.x,l.y),a.clearRect(ee.x,ee.y,r.width,r.height);break;case de.Combine:a.drawImage(u.bitmap,u.left,u.top),e.drawImage(r,l.x,l.y);break;case de.RestoreBackground:a.drawImage(u.bitmap,u.left,u.top),e.drawImage(r,l.x,l.y),a.clearRect(ee.x,ee.y,r.width,r.height),o.gifData.globalColorTable.length?a.putImageData(o.gifData.backgroundImage,l.x,l.y):a.putImageData(o.gifData.frames[Nn].image,l.x+u.left,l.y+u.top);break;case de.RestorePrevious:{const h=a.getImageData(ee.x,ee.y,r.width,r.height);a.drawImage(u.bitmap,u.left,u.top),e.drawImage(r,l.x,l.y),a.clearRect(ee.x,ee.y,r.width,r.height),a.putImageData(h,ee.x,ee.y)}break}if(n.gifTime+=s.value,n.gifTime>u.delayTime){if(n.gifTime-=u.delayTime,++c>=o.gifData.frames.length){if(--n.gifLoopCount<=Ei)return;c=Nn,a.clearRect(ee.x,ee.y,r.width,r.height)}n.gifFrame=c}e.scale(o.gifData.width/i,o.gifData.height/i)}}async function xu(t){if(t.type!=="gif"){await Jt(t);return}t.loading=!0;try{t.gifData=await bu(t.source),t.gifLoopCount=vu(t.gifData)??Ei,t.gifLoopCount||(t.gifLoopCount=1/0)}catch{t.error=!0}t.loading=!1}const _u=2,ku=1,Cu=12,Pu=1;class Mu{constructor(e){this.validTypes=["image","images"],this.loadImageShape=async i=>{if(!this._engine.loadImage)throw new Error(`${ue} image shape not initialized`);await this._engine.loadImage({gif:i.gif,name:i.name,replaceColor:i.replaceColor??!1,src:i.src})},this._engine=e}addImage(e){this._engine.images||(this._engine.images=[]),this._engine.images.push(e)}draw(e){const{context:i,radius:n,particle:s,opacity:o}=e,r=s.image,a=r==null?void 0:r.element;if(r){if(i.globalAlpha=o,r.gif&&r.gifData)wu(e);else if(a){const c=r.ratio,l={x:-n,y:-n},u=n*_u;i.drawImage(a,l.x,l.y,u,u/c)}i.globalAlpha=ku}}getSidesCount(){return Cu}async init(e){const i=e.actualOptions;if(!(!i.preload||!this._engine.loadImage))for(const n of i.preload)await this._engine.loadImage(n)}loadShape(e){if(e.shape!=="image"&&e.shape!=="images")return;this._engine.images||(this._engine.images=[]);const i=e.shapeData;if(!i)return;this._engine.images.find(s=>s.name===i.name||s.source===i.src)||this.loadImageShape(i).then(()=>{this.loadShape(e)})}particleInit(e,i){if(i.shape!=="image"&&i.shape!=="images")return;this._engine.images||(this._engine.images=[]);const n=this._engine.images,s=i.shapeData;if(!s)return;const o=i.getFillColor(),r=n.find(c=>c.name===s.name||c.source===s.src);if(!r)return;const a=s.replaceColor??r.replaceColor;if(r.loading){setTimeout(()=>{this.particleInit(e,i)});return}(async()=>{let c;r.svgData&&o?c=await hu(r,s,o,i):c={color:o,data:r,element:r.element,gif:r.gif,gifData:r.gifData,gifLoopCount:r.gifLoopCount,loaded:!0,ratio:s.width&&s.height?s.width/s.height:r.ratio??Pu,replaceColor:a,source:s.src},c.ratio||(c.ratio=1);const l=s.fill??i.shapeFill,u=s.close??i.shapeClose,h={image:c,fill:l,close:u};i.image=h.image,i.shapeFill=h.fill,i.shapeClose=h.close})()}}class zu{constructor(){this.src="",this.gif=!1}load(e){g(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 Su{constructor(e){this.id="imagePreloader",this._engine=e}async getPlugin(){return await Promise.resolve(),{}}loadOptions(e,i){if(!(i!=null&&i.preload))return;e.preload||(e.preload=[]);const n=e.preload;for(const s of i.preload){const o=n.find(r=>r.name===s.name||r.src===s.src);if(o)o.load(s);else{const r=new zu;r.load(s),n.push(r)}}}needsPlugin(){return!0}}const Ou=3;function Ru(t){t.loadImage||(t.loadImage=async e=>{if(!e.name&&!e.src)throw new Error(`${ue} no image source provided`);if(t.images||(t.images=[]),!t.images.find(i=>i.name===e.name||i.source===e.src))try{const i={gif:e.gif??!1,name:e.name??e.src,source:e.src,type:e.src.substring(e.src.length-Ou),error:!1,loading:!0,replaceColor:e.replaceColor,ratio:e.width&&e.height?e.width/e.height:void 0};t.images.push(i);let n;e.gif?n=xu:n=e.replaceColor?uu:Jt,await n(i)}catch{throw new Error(`${ue} ${e.name??e.src} not found`)}})}async function Tu(t,e=!0){t.checkVersion("3.9.1"),Ru(t);const i=new Su(t);await t.addPlugin(i,e),await t.addShape(new Mu(t),e)}class Eu extends Je{constructor(){super(),this.sync=!1}load(e){g(e)||(super.load(e),e.sync!==void 0&&(this.sync=e.sync))}}class Iu extends Je{constructor(){super(),this.sync=!1}load(e){g(e)||(super.load(e),e.sync!==void 0&&(this.sync=e.sync))}}class Du{constructor(){this.count=0,this.delay=new Eu,this.duration=new Iu}load(e){g(e)||(e.count!==void 0&&(this.count=e.count),this.delay.load(e.delay),this.duration.load(e.duration))}}const ot=0,Lu=-1,Yn=0,Qn=0;function Au(t,e,i){if(!t.life)return;const n=t.life;let s=!1;if(t.spawning)if(n.delayTime+=e.value,n.delayTime>=t.life.delay)s=!0,t.spawning=!1,n.delayTime=ot,n.time=ot;else return;if(n.duration===Lu||t.spawning||(s?n.time=ot:n.time+=e.value,n.time<n.duration))return;if(n.time=ot,t.life.count>Yn&&t.life.count--,t.life.count===Yn){t.destroy();return}const o=S(Qn,i.width),r=S(Qn,i.width);t.position.x=se(o),t.position.y=se(r),t.spawning=!0,n.delayTime=ot,n.time=ot,t.reset();const a=t.options.life;a&&(n.delay=x(a.delay.value)*W,n.duration=x(a.duration.value)*W)}const He=0,Xn=1,Zn=-1;class Fu{constructor(e){this.container=e}init(e){const i=this.container,n=e.options,s=n.life;s&&(e.life={delay:i.retina.reduceFactor?x(s.delay.value)*(s.delay.sync?Xn:R())/i.retina.reduceFactor*W:He,delayTime:He,duration:i.retina.reduceFactor?x(s.duration.value)*(s.duration.sync?Xn:R())/i.retina.reduceFactor*W:He,time:He,count:s.count},e.life.duration<=He&&(e.life.duration=Zn),e.life.count<=He&&(e.life.count=Zn),e.life&&(e.spawning=e.life.delay>He))}isEnabled(e){return!e.destroyed}loadOptions(e,...i){e.life||(e.life=new Du);for(const n of i)e.life.load(n==null?void 0:n.life)}update(e,i){!this.isEnabled(e)||!e.life||Au(e,i,this.container.canvas.size)}}async function Bu(t,e=!0){t.checkVersion("3.9.1"),await t.addParticleUpdater("life",async i=>Promise.resolve(new Fu(i)),e)}function qu(t){const{context:e,particle:i,radius:n}=t,s=i.shapeData,o=0;e.moveTo(-n,o),e.lineTo(n,o),e.lineCap=(s==null?void 0:s.cap)??"butt"}const $u=1;class Vu{constructor(){this.validTypes=["line"]}draw(e){qu(e)}getSidesCount(){return $u}}async function Hu(t,e=!0){t.checkVersion("3.9.1"),await t.addShape(new Vu,e)}const Kn=.5;class Uu{init(){}isEnabled(e){return!Ke()&&!e.destroyed&&e.container.actualOptions.interactivity.events.onHover.parallax.enable}move(e){const i=e.container,n=i.actualOptions,s=n.interactivity.events.onHover.parallax;if(Ke()||!s.enable)return;const o=s.force,r=i.interactivity.mouse.position;if(!r)return;const a=i.canvas.size,c={x:a.width*Kn,y:a.height*Kn},l=s.smooth,u=e.getRadius()/o,h={x:(r.x-c.x)*u,y:(r.y-c.y)*u},{offset:d}=e;d.x+=(h.x-d.x)/l,d.y+=(h.y-d.y)/l}}async function ju(t,e=!0){t.checkVersion("3.9.1"),await t.addMover("parallax",()=>Promise.resolve(new Uu),e)}const Jn=1e3,Wu=1;class Gu extends Vi{constructor(e){super(e)}clear(){}init(){}interact(e){const i=this.container;e.attractDistance===void 0&&(e.attractDistance=x(e.options.move.attract.distance)*i.retina.pixelRatio);const n=e.attractDistance,s=e.getPosition(),o=i.particles.quadTree.queryCircle(s,n);for(const r of o){if(e===r||!r.options.move.attract.enable||r.destroyed||r.spawning)continue;const a=r.getPosition(),{dx:c,dy:l}=J(s,a),u=e.options.move.attract.rotate,h=c/(u.x*Jn),d=l/(u.y*Jn),f=r.size.value/e.size.value,p=Wu/f;e.velocity.x-=h*f,e.velocity.y-=d*f,r.velocity.x+=h*p,r.velocity.y+=d*p}}isEnabled(e){return e.options.move.attract.enable}reset(){}}async function Nu(t,e=!0){t.checkVersion("3.9.1"),await t.addInteractor("particlesAttract",i=>Promise.resolve(new Gu(i)),e)}const Yu=.5,Qu=10,Xu=0;function es(t,e,i,n,s,o){const r=he(t.options.collisions.absorb.speed*s.factor/Qu,Xu,n);t.size.value+=r*Yu,i.size.value-=r,n<=o&&(i.size.value=0,i.destroy())}function Zu(t,e,i,n){const s=t.getRadius(),o=e.getRadius();s===void 0&&o!==void 0?t.destroy():s!==void 0&&o===void 0?e.destroy():s!==void 0&&o!==void 0&&(s>=o?es(t,s,e,o,i,n):es(e,o,t,s,i,n))}const ts=t=>{t.collisionMaxSpeed===void 0&&(t.collisionMaxSpeed=x(t.options.collisions.maxSpeed)),t.velocity.length>t.collisionMaxSpeed&&(t.velocity.length=t.collisionMaxSpeed)};function js(t,e){xs(Si(t),Si(e)),ts(t),ts(e)}function Ku(t,e){!t.unbreakable&&!e.unbreakable&&js(t,e),t.getRadius()===void 0&&e.getRadius()!==void 0?t.destroy():t.getRadius()!==void 0&&e.getRadius()===void 0?e.destroy():t.getRadius()!==void 0&&e.getRadius()!==void 0&&(t.getRadius()>=e.getRadius()?e:t).destroy()}function Ju(t,e,i,n){switch(t.options.collisions.mode){case ft.absorb:{Zu(t,e,i,n);break}case ft.bounce:{js(t,e);break}case ft.destroy:{Ku(t,e);break}}}const eh=2;class th extends Vi{constructor(e){super(e)}clear(){}init(){}interact(e,i){if(e.destroyed||e.spawning)return;const n=this.container,s=e.getPosition(),o=e.getRadius(),r=n.particles.quadTree.queryCircle(s,o*eh);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 c=a.getPosition(),l=a.getRadius();if(Math.abs(Math.round(s.z)-Math.round(c.z))>o+l)continue;const u=oe(s,c),h=o+l;u>h||Ju(e,a,i,n.retina.pixelRatio)}}isEnabled(e){return e.options.collisions.enable}reset(){}}async function ih(t,e=!0){t.checkVersion("3.9.1"),await t.addInteractor("particlesCollisions",i=>Promise.resolve(new th(i)),e)}const wi=2;class nh extends N{constructor(e,i,n,s){super(e,i,n),this.canvasSize=s,this.canvasSize={...s}}contains(e){const{width:i,height:n}=this.canvasSize,{x:s,y:o}=e;return super.contains(e)||super.contains({x:s-i,y:o})||super.contains({x:s-i,y:o-n})||super.contains({x:s,y:o-n})}intersects(e){if(super.intersects(e))return!0;const i=e,n=e,s={x:e.position.x-this.canvasSize.width,y:e.position.y-this.canvasSize.height};if(n.radius!==void 0){const o=new N(s.x,s.y,n.radius*wi);return super.intersects(o)}else if(i.size!==void 0){const o=new ve(s.x,s.y,i.size.width*wi,i.size.height*wi);return super.intersects(o)}return!1}}class sh{constructor(){this.blur=5,this.color=new Q,this.color.value="#000",this.enable=!1}load(e){g(e)||(e.blur!==void 0&&(this.blur=e.blur),this.color=Q.create(this.color,e.color),e.enable!==void 0&&(this.enable=e.enable))}}class oh{constructor(){this.enable=!1,this.frequency=1}load(e){g(e)||(e.color!==void 0&&(this.color=Q.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 rh{constructor(){this.blink=!1,this.color=new Q,this.color.value="#fff",this.consent=!1,this.distance=100,this.enable=!1,this.frequency=1,this.opacity=1,this.shadow=new sh,this.triangles=new oh,this.width=1,this.warp=!1}load(e){g(e)||(e.id!==void 0&&(this.id=e.id),e.blink!==void 0&&(this.blink=e.blink),this.color=Q.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))}}const is=2,ah=1,$t={x:0,y:0},ch=0;function lh(t,e,i,n,s){const{dx:o,dy:r,distance:a}=J(t,e);if(!s||a<=i)return a;const c={x:Math.abs(o),y:Math.abs(r)},l={x:Math.min(c.x,n.width-c.x),y:Math.min(c.y,n.height-c.y)};return Math.sqrt(l.x**is+l.y**is)}class uh extends Vi{constructor(e,i){super(e),this._setColor=n=>{if(!n.options.links)return;const s=this._linkContainer,o=n.options.links;let r=o.id===void 0?s.particles.linksColor:s.particles.linksColors.get(o.id);if(r)return;const a=o.color;r=Ss(this._engine,a,o.blink,o.consent),o.id===void 0?s.particles.linksColor=r:s.particles.linksColors.set(o.id,r)},this._linkContainer=e,this._engine=i}clear(){}init(){this._linkContainer.particles.linksColor=void 0,this._linkContainer.particles.linksColors=new Map}interact(e){if(!e.options.links)return;e.links=[];const i=e.getPosition(),n=this.container,s=n.canvas.size;if(i.x<$t.x||i.y<$t.y||i.x>s.width||i.y>s.height)return;const o=e.options.links,r=o.opacity,a=e.retina.linksDistance??ch,c=o.warp;let l;c?l=new nh(i.x,i.y,a,s):l=new N(i.x,i.y,a);const u=n.particles.quadTree.query(l);for(const h of u){const d=h.options.links;if(e===h||!(d!=null&&d.enable)||o.id!==d.id||h.spawning||h.destroyed||!h.links||e.links.some(m=>m.destination===h)||h.links.some(m=>m.destination===e))continue;const f=h.getPosition();if(f.x<$t.x||f.y<$t.y||f.x>s.width||f.y>s.height)continue;const p=lh(i,f,a,s,c&&d.warp);if(p>a)continue;const y=(ah-p/a)*r;this._setColor(e),e.links.push({destination:h,opacity:y})}}isEnabled(e){var i;return!!((i=e.options.links)!=null&&i.enable)}loadParticlesOptions(e,...i){e.links||(e.links=new rh);for(const n of i)e.links.load(n==null?void 0:n.links)}reset(){}}async function hh(t,e=!0){await t.addInteractor("particlesLinks",async i=>Promise.resolve(new uh(i,t)),e)}function fh(t,e,i,n){t.beginPath(),t.moveTo(e.x,e.y),t.lineTo(i.x,i.y),t.lineTo(n.x,n.y),t.closePath()}function dh(t){let e=!1;const{begin:i,end:n,engine:s,maxDistance:o,context:r,canvasSize:a,width:c,backgroundMask:l,colorLine:u,opacity:h,links:d}=t;if(oe(i,n)<=o)zt(r,i,n),e=!0;else if(d.warp){let p,y;const m={x:n.x-a.width,y:n.y},b=J(i,m);if(b.distance<=o){const w=i.y-b.dy/b.dx*i.x;p={x:0,y:w},y={x:a.width,y:w}}else{const w={x:n.x,y:n.y-a.height},_=J(i,w);if(_.distance<=o){const M=-(i.y-_.dy/_.dx*i.x)/(_.dy/_.dx);p={x:M,y:0},y={x:M,y:a.height}}else{const v={x:n.x-a.width,y:n.y-a.height},M=J(i,v);if(M.distance<=o){const T=i.y-M.dy/M.dx*i.x;p={x:-T/(M.dy/M.dx),y:T},y={x:p.x+a.width,y:p.y+a.height}}}}p&&y&&(zt(r,i,p),zt(r,n,y),e=!0)}if(!e)return;r.lineWidth=c,l.enable&&(r.globalCompositeOperation=l.composite),r.strokeStyle=Se(u,h);const{shadow:f}=d;if(f.enable){const p=ye(s,f.color);p&&(r.shadowBlur=f.blur,r.shadowColor=Se(p))}r.stroke()}function ph(t){const{context:e,pos1:i,pos2:n,pos3:s,backgroundMask:o,colorTriangle:r,opacityTriangle:a}=t;fh(e,i,n,s),o.enable&&(e.globalCompositeOperation=o.composite),e.fillStyle=Se(r,a),e.fill()}function mh(t){return t.sort((e,i)=>e-i),t.join("_")}function ns(t,e){const i=mh(t.map(s=>s.id));let n=e.get(i);return n===void 0&&(n=R(),e.set(i,n)),n}const ss=0,xi=0,os=0,yh=.5,gh=1;class vh{constructor(e,i){this._drawLinkLine=(n,s)=>{const o=n.options.links;if(!(o!=null&&o.enable))return;const r=this._container,a=r.actualOptions,c=s.destination,l=n.getPosition(),u=c.getPosition();let h=s.opacity;r.canvas.draw(d=>{var w;let f;const p=(w=n.options.twinkle)==null?void 0:w.lines;if(p!=null&&p.enable){const _=p.frequency,v=ye(this._engine,p.color);R()<_&&v&&(f=v,h=x(p.opacity))}if(!f){const _=o.id!==void 0?r.particles.linksColors.get(o.id):r.particles.linksColor;f=Ri(n,c,_)}if(!f)return;const y=n.retina.linksWidth??xi,m=n.retina.linksDistance??os,{backgroundMask:b}=a;dh({context:d,width:y,begin:l,end:u,engine:this._engine,maxDistance:m,canvasSize:r.canvas.size,links:o,backgroundMask:b,colorLine:f,opacity:h})})},this._drawLinkTriangle=(n,s,o)=>{const r=n.options.links;if(!(r!=null&&r.enable))return;const a=r.triangles;if(!a.enable)return;const c=this._container,l=c.actualOptions,u=s.destination,h=o.destination,d=a.opacity??(s.opacity+o.opacity)*yh;d<=ss||c.canvas.draw(f=>{const p=n.getPosition(),y=u.getPosition(),m=h.getPosition(),b=n.retina.linksDistance??os;if(oe(p,y)>b||oe(m,y)>b||oe(m,p)>b)return;let w=ye(this._engine,a.color);if(!w){const _=r.id!==void 0?c.particles.linksColors.get(r.id):c.particles.linksColor;w=Ri(n,u,_)}w&&ph({context:f,pos1:p,pos2:y,pos3:m,backgroundMask:l.backgroundMask,colorTriangle:w,opacityTriangle:d})})},this._drawTriangles=(n,s,o,r)=>{var l,u,h;const a=o.destination;if(!((l=n.links)!=null&&l.triangles.enable&&((u=a.options.links)!=null&&u.triangles.enable)))return;const c=(h=a.links)==null?void 0:h.filter(d=>{const f=this._getLinkFrequency(a,d.destination);return a.options.links&&f<=a.options.links.frequency&&r.findIndex(y=>y.destination===d.destination)>=0});if(c!=null&&c.length)for(const d of c){const f=d.destination;this._getTriangleFrequency(s,a,f)>n.links.triangles.frequency||this._drawLinkTriangle(s,o,d)}},this._getLinkFrequency=(n,s)=>ns([n,s],this._freqs.links),this._getTriangleFrequency=(n,s,o)=>ns([n,s,o],this._freqs.triangles),this._container=e,this._engine=i,this._freqs={links:new Map,triangles:new Map}}drawParticle(e,i){const{links:n,options:s}=i;if(!(n!=null&&n.length))return;const o=n.filter(r=>s.links&&(s.links.frequency>=gh||this._getLinkFrequency(i,r.destination)<=s.links.frequency));for(const r of o)this._drawTriangles(s,i,r,o),r.opacity>ss&&(i.retina.linksWidth??xi)>xi&&this._drawLinkLine(i,r)}async init(){this._freqs.links=new Map,this._freqs.triangles=new Map,await Promise.resolve()}particleCreated(e){if(e.links=[],!e.options.links)return;const i=this._container.retina.pixelRatio,{retina:n}=e,{distance:s,width:o}=e.options.links;n.linksDistance=s*i,n.linksWidth=o*i}particleDestroyed(e){e.links=[]}}class bh{constructor(e){this.id="links",this._engine=e}getPlugin(e){return Promise.resolve(new vh(e,this._engine))}loadOptions(){}needsPlugin(){return!0}}async function wh(t,e=!0){const i=new bh(t);await t.addPlugin(i,e)}async function xh(t,e=!0){t.checkVersion("3.9.1"),await hh(t,e),await wh(t,e)}const _h=180,Vt={x:0,y:0},kh=2;function Ch(t,e,i){const{context:n}=t,s=i.count.numerator*i.count.denominator,o=i.count.numerator/i.count.denominator,r=_h*(o-kh)/o,a=Math.PI-Ie(r);if(n){n.beginPath(),n.translate(e.x,e.y),n.moveTo(Vt.x,Vt.y);for(let c=0;c<s;c++)n.lineTo(i.length,Vt.y),n.translate(i.length,Vt.y),n.rotate(a)}}const Ph=5;class Ws{draw(e){const{particle:i,radius:n}=e,s=this.getCenter(i,n),o=this.getSidesData(i,n);Ch(e,s,o)}getSidesCount(e){const i=e.shapeData;return Math.round(x((i==null?void 0:i.sides)??Ph))}}const rs=3.5,as=2.66,Mh=3;class zh extends Ws{constructor(){super(...arguments),this.validTypes=["polygon"]}getCenter(e,i){return{x:-i/(e.sides/rs),y:-i/(as/rs)}}getSidesData(e,i){const n=e.sides;return{count:{denominator:1,numerator:n},length:i*as/(n/Mh)}}}const Sh=1.66,Oh=3,Rh=2;class Th extends Ws{constructor(){super(...arguments),this.validTypes=["triangle"]}getCenter(e,i){return{x:-i,y:i/Sh}}getSidesCount(){return Oh}getSidesData(e,i){const n=i*Rh;return{count:{denominator:2,numerator:3},length:n}}}async function Eh(t,e=!0){t.checkVersion("3.9.1"),await t.addShape(new zh,e)}async function Ih(t,e=!0){t.checkVersion("3.9.1"),await t.addShape(new Th,e)}async function Dh(t,e=!0){t.checkVersion("3.9.1"),await Eh(t,e),await Ih(t,e)}class Lh{constructor(){this.enable=!1,this.speed=0,this.decay=0,this.sync=!1}load(e){g(e)||(e.enable!==void 0&&(this.enable=e.enable),e.speed!==void 0&&(this.speed=S(e.speed)),e.decay!==void 0&&(this.decay=S(e.decay)),e.sync!==void 0&&(this.sync=e.sync))}}class Ah extends Je{constructor(){super(),this.animation=new Lh,this.direction=pe.clockwise,this.path=!1,this.value=0}load(e){g(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))}}const Gs=2,Fh=Math.PI*Gs,Bh=1,qh=360;class $h{constructor(e){this.container=e}init(e){const i=e.options.rotate;if(!i)return;e.rotate={enable:i.animation.enable,value:Ie(x(i.value)),min:0,max:Fh},e.pathRotation=i.path;let n=i.direction;switch(n===pe.random&&(n=Math.floor(R()*Gs)>0?pe.counterClockwise:pe.clockwise),n){case pe.counterClockwise:case"counterClockwise":e.rotate.status=F.decreasing;break;case pe.clockwise:e.rotate.status=F.increasing;break}const s=i.animation;s.enable&&(e.rotate.decay=Bh-x(s.decay),e.rotate.velocity=x(s.speed)/qh*this.container.retina.reduceFactor,s.sync||(e.rotate.velocity*=R())),e.rotation=e.rotate.value}isEnabled(e){const i=e.options.rotate;return i?!e.destroyed&&!e.spawning&&(!!i.value||i.animation.enable||i.path):!1}loadOptions(e,...i){e.rotate||(e.rotate=new Ah);for(const n of i)e.rotate.load(n==null?void 0:n.rotate)}update(e,i){this.isEnabled(e)&&(e.isRotating=!!e.rotate,e.rotate&&(Fi(e,e.rotate,!1,Xe.none,i),e.rotation=e.rotate.value))}}async function Vh(t,e=!0){t.checkVersion("3.9.1"),await t.addParticleUpdater("rotate",i=>Promise.resolve(new $h(i)),e)}const Hh=2,Uh=Math.sqrt(Hh),jh=2;function Wh(t){const{context:e,radius:i}=t,n=i/Uh,s=n*jh;e.rect(-n,-n,s,s)}const Gh=4;class Nh{constructor(){this.validTypes=["edge","square"]}draw(e){Wh(e)}getSidesCount(){return Gh}}async function Yh(t,e=!0){t.checkVersion("3.9.1"),await t.addShape(new Nh,e)}const Qh=2,rt={x:0,y:0};function Xh(t){const{context:e,particle:i,radius:n}=t,s=i.sides,o=i.starInset??Qh;e.moveTo(rt.x,rt.y-n);for(let r=0;r<s;r++)e.rotate(Math.PI/s),e.lineTo(rt.x,rt.y-n*o),e.rotate(Math.PI/s),e.lineTo(rt.x,rt.y-n)}const Zh=2,Kh=5;class Jh{constructor(){this.validTypes=["star"]}draw(e){Xh(e)}getSidesCount(e){const i=e.shapeData;return Math.round(x((i==null?void 0:i.sides)??Kh))}particleInit(e,i){const n=i.shapeData;i.starInset=x((n==null?void 0:n.inset)??Zh)}}async function ef(t,e=!0){t.checkVersion("3.9.1"),await t.addShape(new Jh,e)}const tf=1;class nf{constructor(e,i){this._container=e,this._engine=i}init(e){var r;const i=this._container,n=e.options,s=le(n.stroke,e.id,n.reduceDuplicates);e.strokeWidth=x(s.width)*i.retina.pixelRatio,e.strokeOpacity=x(s.opacity??tf),e.strokeAnimation=(r=s.color)==null?void 0:r.animation;const o=St(this._engine,s.color)??e.getFillColor();o&&(e.strokeColor=Os(o,e.strokeAnimation,i.retina.reduceFactor))}isEnabled(e){const i=e.strokeAnimation,{strokeColor:n}=e;return!e.destroyed&&!e.spawning&&!!i&&((n==null?void 0:n.h.value)!==void 0&&n.h.enable||(n==null?void 0:n.s.value)!==void 0&&n.s.enable||(n==null?void 0:n.l.value)!==void 0&&n.l.enable)}update(e,i){this.isEnabled(e)&&Rs(e.strokeColor,i)}}async function sf(t,e=!0){t.checkVersion("3.9.1"),await t.addParticleUpdater("strokeColor",i=>Promise.resolve(new nf(i,t)),e)}async function of(t,e=!0){t.checkVersion("3.9.1"),await ju(t,!1),await Yc(t,!1),await nl(t,!1),await hl(t,!1),await xl(t,!1),await Tl(t,!1),await Dl(t,!1),await ql(t,!1),await Ul(t,!1),await eu(t,!1),await ou(t,!1),await Nu(t,!1),await ih(t,!1),await xh(t,!1),await Bc(t,!1),await Vc(t,!1),await Tu(t,!1),await Hu(t,!1),await Dh(t,!1),await Yh(t,!1),await ef(t,!1),await Bu(t,!1),await Vh(t,!1),await sf(t,!1),await Fc(t,e)}const Ae={fullScreen:{enable:!0,zIndex:0},background:{color:{value:"transparent"}},fpsLimit:120,detectRetina:!0},Ns=["#ffb3d9","#f43f5e","#a78bfa","#3b82f6","#10b981","#f59e0b","#ff6b6b","#8b5cf6","#06b6d4","#fb7185"],Ui={id:"starline",name:"星链",icon:"✨",description:"经典粒子连线效果",backgroundGradient:"linear-gradient(180deg, #0f172a 0%, #1e293b 50%, #334155 100%)",options:t=>{const e=Ns;return{...Ae,interactivity:{detectsOn:"window",events:{onClick:{enable:!0,mode:"push"},onHover:{enable:!0,mode:"grab"},resize:{enable:!0}},modes:{push:{quantity:2},grab:{distance:200,links:{opacity:1,color:e}}}},particles:{color:{value:e},links:{color:e,distance:150,enable:!0,opacity:.5,width:1},move:{direction:"none",enable:!0,outModes:{default:"out"},random:!1,speed:2,straight:!1},number:{density:{enable:!0,width:1920,height:1080},value:100,limit:{value:130,mode:"delete"}},opacity:{value:.7},shape:{type:"circle"},size:{value:{min:2,max:6}},shadow:{blur:8,color:{value:e},enable:!0,offset:{x:0,y:0}}}}}},Ys={id:"snow",name:"飘雪",icon:"❄️",description:"浪漫飘落雪花",backgroundGradient:"linear-gradient(180deg, #1e3a5f 0%, #2d4a6b 50%, #3d5a7b 100%)",options:t=>({...Ae,interactivity:{detectsOn:"window",events:{onHover:{enable:!0,mode:"repulse"},resize:{enable:!0}},modes:{repulse:{distance:100,duration:.4}}},particles:{color:{value:t?"#ffffff":"#87CEEB"},move:{direction:"bottom",enable:!0,outModes:{default:"out"},speed:{min:1,max:3},straight:!1,drift:{min:-.5,max:.5}},number:{density:{enable:!0,width:1920,height:1080},value:80},opacity:{value:{min:.3,max:.8},animation:{enable:!0,speed:1,minimumValue:.3,sync:!1}},shape:{type:"circle"},size:{value:{min:2,max:6}},wobble:{enable:!0,distance:10,speed:{min:-5,max:5}},shadow:{blur:5,color:{value:t?"#ffffff":"#87CEEB"},enable:!0,offset:{x:0,y:0}}}})},Qs={id:"bubble",name:"气泡",icon:"🫧",description:"梦幻上升气泡",backgroundGradient:"linear-gradient(180deg, #0a2647 0%, #144272 50%, #205295 100%)",options:t=>({...Ae,interactivity:{detectsOn:"window",events:{onClick:{enable:!0,mode:"pop"},onHover:{enable:!0,mode:"bubble"},resize:{enable:!0}},modes:{bubble:{distance:200,size:15,duration:2,opacity:.8},pop:{}}},particles:{color:{value:t?["#00d9ff","#00ff9d","#ff00e6","#ffee00"]:["#ffb3d9","#ff91c7","#ffc0e5","#ffd6e8"]},move:{direction:"top",enable:!0,outModes:{default:"out"},speed:{min:1,max:2},straight:!1},number:{density:{enable:!0,width:1920,height:1080},value:50},opacity:{value:{min:.2,max:.6},animation:{enable:!0,speed:.5,minimumValue:.1,sync:!1}},shape:{type:"circle"},size:{value:{min:5,max:15},animation:{enable:!0,speed:3,minimumValue:3,sync:!1}},stroke:{width:1,color:{value:t?"rgba(255,255,255,0.3)":"rgba(0,0,0,0.1)"}},shadow:{blur:10,color:{value:t?"#ffb3d9":"#ff91c7"},enable:!0,offset:{x:0,y:0}}}})},Xs={id:"stars",name:"繁星",icon:"⭐",description:"闪烁星空效果",backgroundGradient:"linear-gradient(180deg, #000000 0%, #1a1a2e 50%, #16213e 100%)",options:t=>({...Ae,interactivity:{detectsOn:"window",events:{onClick:{enable:!0,mode:"push"},onHover:{enable:!0,mode:"connect"},resize:{enable:!0}},modes:{push:{quantity:1},connect:{distance:100,links:{opacity:.3},radius:150}}},particles:{color:{value:t?["#ffffff","#ffffd4","#ffecd2","#d4f1ff"]:["#ffd700","#ffb347","#ff6b6b","#4ecdc4"]},move:{direction:"none",enable:!0,outModes:{default:"out"},random:!0,speed:.5,straight:!1},number:{density:{enable:!0,width:1920,height:1080},value:120,limit:{value:150,mode:"delete"}},opacity:{value:{min:.2,max:1},animation:{enable:!0,speed:1,minimumValue:.1,sync:!1}},shape:{type:"star",options:{star:{sides:5}}},size:{value:{min:1,max:4}},twinkle:{lines:{enable:!1},particles:{enable:!0,frequency:.05,opacity:1,color:{value:t?"#ffffff":"#ffd700"}}},shadow:{blur:6,color:{value:t?"#ffffff":"#ffd700"},enable:!0,offset:{x:0,y:0}}}})},Zs={id:"firefly",name:"萤火虫",icon:"🪲",description:"温暖的萤火虫光效",backgroundGradient:"linear-gradient(180deg, #1a1a1a 0%, #2d2d2d 50%, #1a1a1a 100%)",options:t=>({...Ae,interactivity:{detectsOn:"window",events:{onHover:{enable:!0,mode:"slow"},resize:{enable:!0}},modes:{slow:{factor:3,radius:200}}},particles:{color:{value:t?["#ffff00","#adff2f","#7fff00","#00ff7f"]:["#ffc107","#ff9800","#ff5722","#4caf50"]},move:{direction:"none",enable:!0,outModes:{default:"bounce"},random:!0,speed:1,straight:!1,trail:{enable:!0,length:5,fill:{color:"transparent"}}},number:{density:{enable:!0,width:1920,height:1080},value:40},opacity:{value:{min:.3,max:1},animation:{enable:!0,speed:2,minimumValue:.1,sync:!1}},shape:{type:"circle"},size:{value:{min:2,max:5}},shadow:{blur:15,color:{value:t?"#adff2f":"#ffc107"},enable:!0,offset:{x:0,y:0}}}})},Ks={id:"geometry",name:"几何",icon:"🔷",description:"漂浮的抽象几何图形",backgroundGradient:"linear-gradient(180deg, #0f0c29 0%, #302b63 50%, #24243e 100%)",options:t=>({...Ae,interactivity:{detectsOn:"window",events:{onClick:{enable:!0,mode:"push"},onHover:{enable:!0,mode:"repulse"},resize:{enable:!0}},modes:{push:{quantity:1},repulse:{distance:150,duration:.4}}},particles:{color:{value:["#ffb3d9","#ff91c7","#ffc0e5","#ffd6e8"]},move:{direction:"none",enable:!0,outModes:{default:"bounce"},random:!1,speed:1.5,straight:!1},number:{density:{enable:!0,width:1920,height:1080},value:30,limit:{value:60,mode:"delete"}},opacity:{value:{min:.3,max:.7}},rotate:{value:{min:0,max:360},direction:"random",animation:{enable:!0,speed:5}},shape:{type:["triangle","square","polygon"],options:{polygon:{sides:6}}},size:{value:{min:10,max:25}},stroke:{width:1,color:{value:t?"rgba(255,255,255,0.5)":"rgba(0,0,0,0.2)"}},shadow:{blur:10,color:{value:t?"#ffb3d9":"#ff91c7"},enable:!0,offset:{x:2,y:2}}}})},Js={id:"wave",name:"粒子海洋",icon:"🌊",description:"3D 粒子波浪效果(需要 three.js)",isThreeJS:!0,backgroundGradient:"linear-gradient(180deg, #000000 0%, #0a1628 50%, #0d1f3c 100%)",options:()=>({...Ae,particles:{number:{value:0}}})},ji=[Ui,Ys,Qs,Xs,Zs,Ks,Js],Wi=t=>ji.find(e=>e.id===t)||Ui,Gi="starline",Ni=I.createContext(null),cs="rpb-theme-id",rf=({defaultTheme:t=Gi,isDark:e=!0,persist:i=!0,children:n})=>{const[s,o]=I.useState(()=>i&&typeof window<"u"&&localStorage.getItem(cs)||t),[r,a]=I.useState(e);I.useEffect(()=>{a(e)},[e]);const c=I.useCallback(l=>{o(l),i&&typeof window<"u"&&localStorage.setItem(cs,l)},[i]);return D.jsx(Ni.Provider,{value:{themeId:s,isDark:r,setTheme:c,setDark:a},children:n})},eo=()=>{const t=I.useContext(Ni);if(!t)throw new Error("useParticleTheme must be used within a <ParticleProvider>");return t},af=()=>I.useContext(Ni),to=({background:t="linear-gradient(180deg, #000000 0%, #0a1628 50%, #0d1f3c 100%)",className:e,style:i})=>{const n=I.useRef(null),s=I.useRef(),o=I.useRef(!0);return I.useEffect(()=>{let r=!1,a;return(async()=>{let c;try{const C=globalThis.require;if(typeof C=="function")c=C("three");else{const k=await import("three");c=k.default??k}}catch{o.current=!1,console.warn('[react-particle-backgrounds] 未安装 "three"。波浪主题需要它作为 peer dependency。');return}if(r||!n.current)return;const l=n.current,u=l.clientWidth,h=l.clientHeight,d=new c.Scene;d.background=null;const f=new c.PerspectiveCamera(75,u/h,.1,1e3);f.position.set(0,50,100),f.lookAt(0,0,0);const p=new c.WebGLRenderer({antialias:!0,alpha:!0});p.setSize(u,h),p.setPixelRatio(Math.min(window.devicePixelRatio,2)),l.appendChild(p.domElement);const y=15e3,m=200,b=100,w=new c.BufferGeometry,_=new Float32Array(y*3),v=new Float32Array(y*3),M=new Float32Array(y);for(let C=0;C<y;C++){const k=C*3;_[k]=(Math.random()-.5)*m,_[k+1]=0,_[k+2]=(Math.random()-.5)*b;const ie=Math.random();ie<.5?(v[k]=0,v[k+1]=.8+Math.random()*.2,v[k+2]=1):ie<.8?(v[k]=.1,v[k+1]=.3+Math.random()*.3,v[k+2]=.9+Math.random()*.1):(v[k]=.8+Math.random()*.2,v[k+1]=.9+Math.random()*.1,v[k+2]=1),M[C]=Math.random()*2+.5}w.setAttribute("position",new c.BufferAttribute(_,3)),w.setAttribute("color",new c.BufferAttribute(v,3)),w.setAttribute("size",new c.BufferAttribute(M,1));const T=`
|
|
1
|
+
"use strict";var uo=Object.create;var on=Object.defineProperty;var ho=Object.getOwnPropertyDescriptor;var fo=Object.getOwnPropertyNames;var po=Object.getPrototypeOf,mo=Object.prototype.hasOwnProperty;var yo=(t,e,i,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of fo(e))!mo.call(t,s)&&s!==i&&on(t,s,{get:()=>e[s],enumerable:!(n=ho(e,s))||n.enumerable});return t};var go=(t,e,i)=>(i=t!=null?uo(po(t)):{},yo(e||!t||!t.__esModule?on(i,"default",{value:t,enumerable:!0}):i,t));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("react/jsx-runtime"),R=require("react"),We="generated",vo="pointerdown",bo="pointerup",_i="pointerleave",wo="pointerout",Qe="pointermove",xo="touchstart",rn="touchend",_o="touchmove",ko="touchcancel",Co="resize",Mo="visibilitychange",ue="tsParticles - Error",Ee=100,$=.5,G=1e3,j={x:0,y:0,z:0},It={a:1,b:0,c:0,d:1},mt="random",Ht="mid",N=2,Po=Math.PI*N,si=60,us="true",an="false",oi="canvas",cn=0,Pe=2,ln=4,zo=1,un=1,hn=1,So=4,hs=1,Ut=255,je=360,ki=100,Ci=100,fn=0,Mi=0,Ro=60,Oo=0,jt=.25,dn=$+jt,pn=0,To=1,Eo=0,Io=0,Do=1,Ii=1,Lo=1,mn=1,Gt=0,fs=1,Ao=0,Fo=120,Bo=0,qo=0,$o=1e4,Vo=0,Ho=1,Nt=0,ds=1,Uo=1,Wo=0,yn=1,jo=0,Go=0,gn=-jt,vn=1.5,bn=0,No=1,Yo=0,Pi=0,ps=1,Qo=1,Yt=1,Xo=500,wn=50,Zo=0,zi=1,ms=0,xn=1,Ko=0,Be=255,ri=3,ai=6,Jo=1,er=1,tr=0,ir=0,nr=0,sr=0;var U;(function(t){t.bottom="bottom",t.bottomLeft="bottom-left",t.bottomRight="bottom-right",t.left="left",t.none="none",t.right="right",t.top="top",t.topLeft="top-left",t.topRight="top-right",t.outside="outside",t.inside="inside"})(U||(U={}));function ys(t){return typeof t=="boolean"}function Le(t){return typeof t=="string"}function Ae(t){return typeof t=="number"}function at(t){return typeof t=="object"&&t!==null}function ke(t){return Array.isArray(t)}function v(t){return t==null}class ne{constructor(e,i,n){if(this._updateFromAngle=(s,o)=>{this.x=Math.cos(s)*o,this.y=Math.sin(s)*o},!Ae(e)&&e){this.x=e.x,this.y=e.y;const s=e;this.z=s.z?s.z:j.z}else if(e!==void 0&&i!==void 0)this.x=e,this.y=i,this.z=n??j.z;else throw new Error(`${ue} Vector3d not initialized correctly`)}static get origin(){return ne.create(j.x,j.y,j.z)}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 ne.create(e.x,e.y,e.z)}static create(e,i,n){return new ne(e,i,n)}add(e){return ne.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 ne.clone(this)}distanceTo(e){return this.sub(e).length}distanceToSq(e){return this.sub(e).getLengthSq()}div(e){return ne.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**Pe+this.y**Pe}mult(e){return ne.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!=Nt&&this.multTo(hs/e)}rotate(e){return ne.create(this.x*Math.cos(e)-this.y*Math.sin(e),this.x*Math.sin(e)+this.y*Math.cos(e),j.z)}setTo(e){this.x=e.x,this.y=e.y;const i=e;this.z=i.z?i.z:j.z}sub(e){return ne.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 V extends ne{constructor(e,i){super(e,i,j.z)}static get origin(){return V.create(j.x,j.y)}static clone(e){return V.create(e.x,e.y)}static create(e,i){return new V(e,i)}}let or=Math.random;const gs={nextFrame:t=>requestAnimationFrame(t),cancel:t=>cancelAnimationFrame(t)};function E(){return he(or(),0,1-Number.EPSILON)}function rr(t){return gs.nextFrame(t)}function ar(t){gs.cancel(t)}function he(t,e,i){return Math.min(Math.max(t,e),i)}function ci(t,e,i,n){return Math.floor((t*i+e*n)/(i+n))}function se(t){const e=_e(t),i=0;let n=Zt(t);return e===n&&(n=i),E()*(e-n)+n}function _(t){return Ae(t)?t:se(t)}function Zt(t){return Ae(t)?t:t.min}function _e(t){return Ae(t)?t:t.max}function S(t,e){if(t===e||e===void 0&&Ae(t))return t;const i=Zt(t),n=_e(t);return e!==void 0?{min:Math.min(i,e),max:Math.max(n,e)}:S(i,n)}function J(t,e){const i=t.x-e.x,n=t.y-e.y,s=2;return{dx:i,dy:n,distance:Math.sqrt(i**s+n**s)}}function oe(t,e){return J(t,e).distance}function De(t){return t*Math.PI/180}function cr(t,e,i){if(Ae(t))return De(t);switch(t){case U.top:return-Math.PI*$;case U.topRight:return-Math.PI*jt;case U.right:return Oo;case U.bottomRight:return Math.PI*jt;case U.bottom:return Math.PI*$;case U.bottomLeft:return Math.PI*dn;case U.left:return Math.PI;case U.topLeft:return-Math.PI*dn;case U.inside:return Math.atan2(i.y-e.y,i.x-e.x);case U.outside:return Math.atan2(e.y-i.y,e.x-i.x);default:return E()*Po}}function lr(t){const e=V.origin;return e.length=1,e.angle=t,e}function _n(t,e,i,n){return V.create(t.x*(i-n)/(i+n)+e.x*N*n/(i+n),t.y)}function ur(t){var e,i;return{x:((e=t.position)==null?void 0:e.x)??E()*t.size.width,y:((i=t.position)==null?void 0:i.y)??E()*t.size.height}}function vs(t){return t?t.endsWith("%")?parseFloat(t)/Ee:parseFloat(t):1}var Ge;(function(t){t.auto="auto",t.increase="increase",t.decrease="decrease",t.random="random"})(Ge||(Ge={}));var F;(function(t){t.increasing="increasing",t.decreasing="decreasing"})(F||(F={}));var Xe;(function(t){t.none="none",t.max="max",t.min="min"})(Xe||(Xe={}));var z;(function(t){t.bottom="bottom",t.left="left",t.right="right",t.top="top"})(z||(z={}));var yt;(function(t){t.precise="precise",t.percent="percent"})(yt||(yt={}));var ut;(function(t){t.max="max",t.min="min",t.random="random"})(ut||(ut={}));const hr={debug:console.debug,error:console.error,info:console.info,log:console.log,verbose:console.log,warning:console.warn};function Ze(){return hr}function fr(t){const e=new Map;return(...i)=>{const n=JSON.stringify(i);if(e.has(n))return e.get(n);const s=t(...i);return e.set(n,s),s}}function kn(t){const e={bounced:!1},{pSide:i,pOtherSide:n,rectSide:s,rectOtherSide:o,velocity:r,factor:a}=t;return n.min<o.min||n.min>o.max||n.max<o.min||n.max>o.max||(i.max>=s.min&&i.max<=(s.max+s.min)*$&&r>pn||i.min<=s.max&&i.min>(s.max+s.min)*$&&r<pn)&&(e.velocity=r*-a,e.bounced=!0),e}function dr(t,e){const i=re(e,n=>t.matches(n));return ke(i)?i.some(n=>n):i}function Ke(){return typeof window>"u"||!window||typeof window.document>"u"||!window.document}function pr(){return!Ke()&&typeof matchMedia<"u"}function bs(t){if(pr())return matchMedia(t)}function mr(t){if(!(Ke()||typeof IntersectionObserver>"u"))return new IntersectionObserver(t)}function yr(t){if(!(Ke()||typeof MutationObserver>"u"))return new MutationObserver(t)}function A(t,e){return t===e||ke(e)&&e.indexOf(t)>-1}async function Cn(t,e){try{await document.fonts.load(`${e??"400"} 36px '${t??"Verdana"}'`)}catch{}}function gr(t){return Math.floor(E()*t.length)}function Kt(t,e,i=!0){return t[e!==void 0&&i?e%t.length:gr(t)]}function Di(t,e,i,n,s){return vr(Et(t,n??0),e,i,s)}function vr(t,e,i,n){let s=!0;return(!n||n===z.bottom)&&(s=t.top<e.height+i.x),s&&(!n||n===z.left)&&(s=t.right>i.x),s&&(!n||n===z.right)&&(s=t.left<e.width+i.y),s&&(!n||n===z.top)&&(s=t.bottom>i.y),s}function Et(t,e){return{bottom:t.y+e,left:t.x-e,right:t.x+e,top:t.y-e}}function Q(t,...e){for(const i of e){if(i==null)continue;if(!at(i)){t=i;continue}const n=Array.isArray(i);n&&(at(t)||!t||!Array.isArray(t))?t=[]:!n&&(at(t)||!t||Array.isArray(t))&&(t={});for(const s in i){if(s==="__proto__")continue;const o=i,r=o[s],a=t;a[s]=at(r)&&Array.isArray(r)?r.map(c=>Q(a[s],c)):Q(a[s],r)}}return t}function Li(t,e){return!!_s(e,i=>i.enable&&A(t,i.mode))}function Ai(t,e,i){re(e,n=>{const s=n.mode;n.enable&&A(t,s)&&br(n,i)})}function br(t,e){const i=t.selectors;re(i,n=>{e(n,t)})}function ws(t,e){if(!(!e||!t))return _s(t,i=>dr(e,i.selectors))}function Si(t){return{position:t.getPosition(),radius:t.getRadius(),mass:t.getMass(),velocity:t.velocity,factor:V.create(_(t.options.bounce.horizontal.value),_(t.options.bounce.vertical.value))}}function xs(t,e){const{x:i,y:n}=t.velocity.sub(e.velocity),[s,o]=[t.position,e.position],{dx:r,dy:a}=J(o,s);if(i*r+n*a<0)return;const l=-Math.atan2(a,r),u=t.mass,h=e.mass,d=t.velocity.rotate(l),f=e.velocity.rotate(l),p=_n(d,f,u,h),y=_n(f,d,u,h),m=p.rotate(-l),w=y.rotate(-l);t.velocity.x=m.x*t.factor.x,t.velocity.y=m.y*t.factor.y,e.velocity.x=w.x*e.factor.x,e.velocity.y=w.y*e.factor.y}function wr(t,e){const i=t.getPosition(),n=t.getRadius(),s=Et(i,n),o=t.options.bounce,r=kn({pSide:{min:s.left,max:s.right},pOtherSide:{min:s.top,max:s.bottom},rectSide:{min:e.left,max:e.right},rectOtherSide:{min:e.top,max:e.bottom},velocity:t.velocity.x,factor:_(o.horizontal.value)});r.bounced&&(r.velocity!==void 0&&(t.velocity.x=r.velocity),r.position!==void 0&&(t.position.x=r.position));const a=kn({pSide:{min:s.top,max:s.bottom},pOtherSide:{min:s.left,max:s.right},rectSide:{min:e.top,max:e.bottom},rectOtherSide:{min:e.left,max:e.right},velocity:t.velocity.y,factor:_(o.vertical.value)});a.bounced&&(a.velocity!==void 0&&(t.velocity.y=a.velocity),a.position!==void 0&&(t.position.y=a.position))}function re(t,e){return ke(t)?t.map((n,s)=>e(n,s)):e(t,0)}function le(t,e,i){return ke(t)?Kt(t,e,i):t}function _s(t,e){return ke(t)?t.find((n,s)=>e(n,s)):e(t,0)?t:void 0}function ks(t,e){const i=t.value,n=t.animation,s={delayTime:_(n.delay)*G,enable:n.enable,value:_(t.value)*e,max:_e(i)*e,min:Zt(i)*e,loops:0,maxLoops:_(n.count),time:0},o=1;if(n.enable){switch(s.decay=o-_(n.decay),n.mode){case Ge.increase:s.status=F.increasing;break;case Ge.decrease:s.status=F.decreasing;break;case Ge.random:s.status=E()>=$?F.increasing:F.decreasing;break}const r=n.mode===Ge.auto;switch(n.startValue){case ut.min:s.value=s.min,r&&(s.status=F.increasing);break;case ut.max:s.value=s.max,r&&(s.status=F.decreasing);break;case ut.random:default:s.value=se(s),r&&(s.status=E()>=$?F.increasing:F.decreasing);break}}return s.initialValue=s.value,s}function xr(t,e){if(!(t.mode===yt.percent)){const{mode:s,...o}=t;return o}return"x"in t?{x:t.x/Ee*e.width,y:t.y/Ee*e.height}:{width:t.width/Ee*e.width,height:t.height/Ee*e.height}}function Cs(t,e){return xr(t,e)}function _r(t,e,i,n,s){switch(e){case Xe.max:i>=s&&t.destroy();break;case Xe.min:i<=n&&t.destroy();break}}function Fi(t,e,i,n,s){if(t.destroyed||!e||!e.enable||(e.maxLoops??0)>0&&(e.loops??0)>(e.maxLoops??0))return;const u=(e.velocity??0)*s.factor,h=e.min,d=e.max,f=e.decay??1;if(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))){switch(e.status){case F.increasing:e.value>=d?(i?e.status=F.decreasing:e.value-=d,e.loops||(e.loops=0),e.loops++):e.value+=u;break;case F.decreasing:e.value<=h?(i?e.status=F.increasing:e.value+=d,e.loops||(e.loops=0),e.loops++):e.value-=u}e.velocity&&f!==1&&(e.velocity*=f),_r(t,n,e.value,h,d),t.destroyed||(e.value=he(e.value,h,d))}}function kr(t){var i,n,s,o;const e=document.createElement("div").style;if(!t)return e;for(const r in t){const a=t[r];if(!Object.prototype.hasOwnProperty.call(t,r)||v(a))continue;const c=(i=t.getPropertyValue)==null?void 0:i.call(t,a);if(!c)continue;const l=(n=t.getPropertyPriority)==null?void 0:n.call(t,a);l?(o=e.setProperty)==null||o.call(e,a,c,l):(s=e.setProperty)==null||s.call(e,a,c)}return e}function Cr(t){const e=document.createElement("div").style,i=10,n={width:"100%",height:"100%",margin:"0",padding:"0",borderWidth:"0",position:"fixed",zIndex:t.toString(i),"z-index":t.toString(i),top:"0",left:"0"};for(const s in n){const o=n[s];e.setProperty(s,o)}return e}const Mr=fr(Cr);var Ri;(function(t){t.darken="darken",t.enlighten="enlighten"})(Ri||(Ri={}));function Pr(t,e){if(e){for(const i of t.colorManagers.values())if(e.startsWith(i.stringPrefix))return i.parseString(e)}}function ye(t,e,i,n=!0){if(!e)return;const s=Le(e)?{value:e}:e;if(Le(s.value))return Ms(t,s.value,i,n);if(ke(s.value))return ye(t,{value:Kt(s.value,i,n)});for(const o of t.colorManagers.values()){const r=o.handleRangeColor(s);if(r)return r}}function Ms(t,e,i,n=!0){if(!e)return;const s=Le(e)?{value:e}:e;if(Le(s.value))return s.value===mt?zs():zr(t,s.value);if(ke(s.value))return Ms(t,{value:Kt(s.value,i,n)});for(const o of t.colorManagers.values()){const r=o.handleColor(s);if(r)return r}}function St(t,e,i,n=!0){const s=ye(t,e,i,n);return s?Ps(s):void 0}function Ps(t){const e=t.r/Ut,i=t.g/Ut,n=t.b/Ut,s=Math.max(e,i,n),o=Math.min(e,i,n),r={h:fn,l:(s+o)*$,s:Mi};return s!==o&&(r.s=r.l<$?(s-o)/(s+o):(s-o)/(N-s-o),r.h=e===s?(i-n)/(s-o):r.h=i===s?N+(n-e)/(s-o):N*N+(e-i)/(s-o)),r.l*=Ci,r.s*=ki,r.h*=Ro,r.h<fn&&(r.h+=je),r.h>=je&&(r.h-=je),r}function zr(t,e){return Pr(t,e)}function gt(t){const e=(t.h%je+je)%je,i=Math.max(Mi,Math.min(ki,t.s)),n=Math.max(Ko,Math.min(Ci,t.l)),s=e/je,o=i/ki,r=n/Ci;if(i===Mi){const p=Math.round(r*Be);return{r:p,g:p,b:p}}const a=(p,y,m)=>{if(m<0&&m++,m>1&&m--,m*ai<1)return p+(y-p)*ai*m;if(m*N<1)return y;if(m*ri<1*N){const x=N/ri;return p+(y-p)*(x-m)*ai}return p},c=r<$?r*(Jo+o):r+o-r*o,l=N*r-c,u=er/ri,h=Math.min(Be,Be*a(l,c,s+u)),d=Math.min(Be,Be*a(l,c,s)),f=Math.min(Be,Be*a(l,c,s-u));return{r:Math.round(h),g:Math.round(d),b:Math.round(f)}}function Sr(t){const e=gt(t);return{a:t.a,b:e.b,g:e.g,r:e.r}}function zs(t){const e=tr,i=Ut+zi;return{b:Math.floor(se(S(e,i))),g:Math.floor(se(S(e,i))),r:Math.floor(se(S(e,i)))}}function Se(t,e){return`rgba(${t.r}, ${t.g}, ${t.b}, ${e??Ii})`}function Rt(t,e){return`hsla(${t.h}, ${t.s}%, ${t.l}%, ${e??Ii})`}function Bi(t,e,i,n){let s=t,o=e;return s.r===void 0&&(s=gt(t)),o.r===void 0&&(o=gt(e)),{b:ci(s.b,o.b,i,n),g:ci(s.g,o.g,i,n),r:ci(s.r,o.r,i,n)}}function Oi(t,e,i){if(i===mt)return zs();if(i===Ht){const n=t.getFillColor()??t.getStrokeColor(),s=(e==null?void 0:e.getFillColor())??(e==null?void 0:e.getStrokeColor());if(n&&s&&e)return Bi(n,s,t.getRadius(),e.getRadius());{const o=n??s;if(o)return gt(o)}}else return i}function Ss(t,e,i,n){const s=Le(e)?e:e.value;return s===mt?n?ye(t,{value:s}):i?mt:Ht:s===Ht?Ht:ye(t,{value:s})}function Mn(t){return t!==void 0?{h:t.h.value,s:t.s.value,l:t.l.value}:void 0}function Rs(t,e,i){const n={h:{enable:!1,value:t.h},s:{enable:!1,value:t.s},l:{enable:!1,value:t.l}};return e&&(li(n.h,e.h,i),li(n.s,e.s,i),li(n.l,e.l,i)),n}function li(t,e,i){t.enable=e.enable,t.enable?(t.velocity=_(e.speed)/Ee*i,t.decay=ds-_(e.decay),t.status=F.increasing,t.loops=nr,t.maxLoops=_(e.count),t.time=sr,t.delayTime=_(e.delay)*G,e.sync||(t.velocity*=E(),t.value*=E()),t.initialValue=t.value,t.offset=S(e.offset)):t.velocity=ir}function ui(t,e,i,n){if(!t||!t.enable||(t.maxLoops??0)>0&&(t.loops??0)>(t.maxLoops??0)||(t.time||(t.time=0),(t.delayTime??0)>0&&t.time<(t.delayTime??0)&&(t.time+=n.value),(t.delayTime??0)>0&&t.time<(t.delayTime??0)))return;const u=t.offset?se(t.offset):0,h=(t.velocity??0)*n.factor+u*3.6,d=t.decay??1,f=_e(e),p=Zt(e);!i||t.status===F.increasing?(t.value+=h,t.value>f&&(t.loops||(t.loops=0),t.loops++,i?t.status=F.decreasing:t.value-=f)):(t.value-=h,t.value<0&&(t.loops||(t.loops=0),t.loops++,t.status=F.increasing)),t.velocity&&d!==1&&(t.velocity*=d),t.value=he(t.value,p,f)}function Os(t,e){if(!t)return;const{h:i,s:n,l:s}=t,o={h:{min:0,max:360},s:{min:0,max:100},l:{min:0,max:100}};i&&ui(i,o.h,!1,e),n&&ui(n,o.s,!0,e),s&&ui(s,o.l,!0,e)}function zt(t,e,i){t.beginPath(),t.moveTo(e.x,e.y),t.lineTo(i.x,i.y),t.closePath()}function Rr(t,e,i){t.fillStyle=i??"rgba(0,0,0,0)",t.fillRect(j.x,j.y,e.width,e.height)}function Or(t,e,i,n){i&&(t.globalAlpha=n,t.drawImage(i,j.x,j.y,e.width,e.height),t.globalAlpha=1)}function hi(t,e){t.clearRect(j.x,j.y,e.width,e.height)}function Tr(t){const{container:e,context:i,particle:n,delta:s,colorStyles:o,backgroundMask:r,composite:a,radius:c,opacity:l,shadow:u,transform:h}=t,d=n.getPosition(),f=n.rotation+(n.pathRotation?n.velocity.angle:Zo),p={sin:Math.sin(f),cos:Math.cos(f)},y=!!f,m={a:p.cos*(h.a??It.a),b:y?p.sin*(h.b??zi):h.b??It.b,c:y?-p.sin*(h.c??zi):h.c??It.c,d:p.cos*(h.d??It.d)};i.setTransform(m.a,m.b,m.c,m.d,d.x,d.y),r&&(i.globalCompositeOperation=a);const w=n.shadowColor;u.enable&&w&&(i.shadowBlur=u.blur,i.shadowColor=Se(w),i.shadowOffsetX=u.offset.x,i.shadowOffsetY=u.offset.y),o.fill&&(i.fillStyle=o.fill);const b=n.strokeWidth??ms;i.lineWidth=b,o.stroke&&(i.strokeStyle=o.stroke);const x={container:e,context:i,particle:n,radius:c,opacity:l,delta:s,transformData:m,strokeWidth:b};Ir(x),Dr(x),Er(x),i.globalCompositeOperation="source-over",i.resetTransform()}function Er(t){const{container:e,context:i,particle:n,radius:s,opacity:o,delta:r,transformData:a}=t;if(!n.effect)return;const c=e.effectDrawers.get(n.effect);c&&c.draw({context:i,particle:n,radius:s,opacity:o,delta:r,pixelRatio:e.retina.pixelRatio,transformData:{...a}})}function Ir(t){const{container:e,context:i,particle:n,radius:s,opacity:o,delta:r,strokeWidth:a,transformData:c}=t;if(!n.shape)return;const l=e.shapeDrawers.get(n.shape);l&&(i.beginPath(),l.draw({context:i,particle:n,radius:s,opacity:o,delta:r,pixelRatio:e.retina.pixelRatio,transformData:{...c}}),n.shapeClose&&i.closePath(),a>ms&&i.stroke(),n.shapeFill&&i.fill())}function Dr(t){const{container:e,context:i,particle:n,radius:s,opacity:o,delta:r,transformData:a}=t;if(!n.shape)return;const c=e.shapeDrawers.get(n.shape);c!=null&&c.afterDraw&&c.afterDraw({context:i,particle:n,radius:s,opacity:o,delta:r,pixelRatio:e.retina.pixelRatio,transformData:{...a}})}function Lr(t,e,i){e.draw&&e.draw(t,i)}function Ar(t,e,i,n){e.drawParticle&&e.drawParticle(t,i,n)}function Fr(t,e,i){return{h:t.h,s:t.s,l:t.l+(e===Ri.darken?-xn:xn)*i}}function Br(t,e,i){const n=e[i];n!==void 0&&(t[i]=(t[i]??To)*n)}function Pn(t,e,i=!1){if(!e)return;const n=t;if(!n)return;const s=n.style;if(!s)return;const o=new Set;for(const r in s)Object.prototype.hasOwnProperty.call(s,r)&&o.add(s[r]);for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&o.add(e[r]);for(const r of o){const a=e.getPropertyValue(r);a?s.setProperty(r,a,i?"important":""):s.removeProperty(r)}}class qr{constructor(e,i){this.container=e,this._applyPostDrawUpdaters=o=>{var r;for(const a of this._postDrawUpdaters)(r=a.afterDraw)==null||r.call(a,o)},this._applyPreDrawUpdaters=(o,r,a,c,l,u)=>{var h;for(const d of this._preDrawUpdaters){if(d.getColorStyles){const{fill:f,stroke:p}=d.getColorStyles(r,o,a,c);f&&(l.fill=f),p&&(l.stroke=p)}if(d.getTransformValues){const f=d.getTransformValues(r);for(const p in f)Br(u,f,p)}(h=d.beforeDraw)==null||h.call(d,r)}},this._applyResizePlugins=()=>{var o;for(const r of this._resizePlugins)(o=r.resize)==null||o.call(r)},this._getPluginParticleColors=o=>{let r,a;for(const c of this._colorPlugins)if(!r&&c.particleFillColor&&(r=St(this._engine,c.particleFillColor(o))),!a&&c.particleStrokeColor&&(a=St(this._engine,c.particleStrokeColor(o))),r&&a)break;return[r,a]},this._initCover=async()=>{const o=this.container.actualOptions,r=o.backgroundMask.cover,a=r.color;if(a){const c=ye(this._engine,a);if(c){const l={...c,a:r.opacity};this._coverColorStyle=Se(l,l.a)}}else await new Promise((c,l)=>{if(!r.image)return;const u=document.createElement("img");u.addEventListener("load",()=>{this._coverImage={image:u,opacity:r.opacity},c()}),u.addEventListener("error",h=>{l(h.error)}),u.src=r.image})},this._initStyle=()=>{const o=this.element,r=this.container.actualOptions;if(o){this._fullScreen?this._setFullScreenStyle():this._resetOriginalStyle();for(const a in r.style){if(!a||!r.style||!Object.prototype.hasOwnProperty.call(r.style,a))continue;const c=r.style[a];c&&o.style.setProperty(a,c,"important")}}},this._initTrail=async()=>{const o=this.container.actualOptions,r=o.particles.move.trail,a=r.fill;if(!r.enable)return;const c=hs/r.length;if(a.color){const l=ye(this._engine,a.color);if(!l)return;this._trailFill={color:{...l},opacity:c}}else await new Promise((l,u)=>{if(!a.image)return;const h=document.createElement("img");h.addEventListener("load",()=>{this._trailFill={image:h,opacity:c},l()}),h.addEventListener("error",d=>{u(d.error)}),h.src=a.image})},this._paintBase=o=>{this.draw(r=>Rr(r,this.size,o))},this._paintImage=(o,r)=>{this.draw(a=>Or(a,this.size,o,r))},this._repairStyle=()=>{const o=this.element;if(!o)return;this._safeMutationObserver(a=>a.disconnect()),this._initStyle(),this.initBackground();const r=this._pointerEvents;o.style.pointerEvents=r,o.setAttribute("pointer-events",r),this._safeMutationObserver(a=>{!o||!(o instanceof Node)||a.observe(o,{attributes:!0})})},this._resetOriginalStyle=()=>{const o=this.element,r=this._originalStyle;!o||!r||Pn(o,r,!0)},this._safeMutationObserver=o=>{this._mutationObserver&&o(this._mutationObserver)},this._setFullScreenStyle=()=>{const o=this.element;o&&Pn(o,Mr(this.container.actualOptions.fullScreen.zIndex),!0)},this._engine=i,this._standardSize={height:0,width:0};const n=e.retina.pixelRatio,s=this._standardSize;this.size={height:s.height*n,width:s.width*n},this._context=null,this._generated=!1,this._preDrawUpdaters=[],this._postDrawUpdaters=[],this._resizePlugins=[],this._colorPlugins=[],this._pointerEvents="none"}get _fullScreen(){return this.container.actualOptions.fullScreen.enable}clear(){const e=this.container.actualOptions,i=e.particles.move.trail,n=this._trailFill;e.backgroundMask.enable?this.paint():i.enable&&i.length>Io&&n?n.color?this._paintBase(Se(n.color,n.opacity)):n.image&&this._paintImage(n.image,n.opacity):e.clear&&this.draw(s=>{hi(s,this.size)})}destroy(){if(this.stop(),this._generated){const e=this.element;e==null||e.remove(),this.element=void 0}else this._resetOriginalStyle();this._preDrawUpdaters=[],this._postDrawUpdaters=[],this._resizePlugins=[],this._colorPlugins=[]}draw(e){const i=this._context;if(i)return e(i)}drawAsync(e){const i=this._context;if(i)return e(i)}drawParticle(e,i){if(e.spawning||e.destroyed)return;const n=e.getRadius();if(n<=Eo)return;const s=e.getFillColor(),o=e.getStrokeColor()??s;let[r,a]=this._getPluginParticleColors(e);r||(r=s),a||(a=o),!(!r&&!a)&&this.draw(c=>{var g;const l=this.container,u=l.actualOptions,h=e.options.zIndex,d=Do-e.zIndexFactor,f=d**h.opacityRate,p=e.bubble.opacity??((g=e.opacity)==null?void 0:g.value)??Ii,y=e.strokeOpacity??p,m=p*f,w=y*f,b={},x={fill:r?Rt(r,m):void 0};x.stroke=a?Rt(a,w):x.fill,this._applyPreDrawUpdaters(c,e,n,m,x,b),Tr({container:l,context:c,particle:e,delta:i,colorStyles:x,backgroundMask:u.backgroundMask.enable,composite:u.backgroundMask.composite,radius:n*d**h.sizeRate,opacity:m,shadow:e.options.shadow,transform:b}),this._applyPostDrawUpdaters(e)})}drawParticlePlugin(e,i,n){this.draw(s=>Ar(s,e,i,n))}drawPlugin(e,i){this.draw(n=>Lr(n,e,i))}async init(){this._safeMutationObserver(e=>e.disconnect()),this._mutationObserver=yr(e=>{for(const i of e)i.type==="attributes"&&i.attributeName==="style"&&this._repairStyle()}),this.resize(),this._initStyle(),await this._initCover();try{await this._initTrail()}catch(e){Ze().error(e)}this.initBackground(),this._safeMutationObserver(e=>{!this.element||!(this.element instanceof Node)||e.observe(this.element,{attributes:!0})}),this.initUpdaters(),this.initPlugins(),this.paint()}initBackground(){const e=this.container.actualOptions,i=e.background,n=this.element;if(!n)return;const s=n.style;if(s){if(i.color){const o=ye(this._engine,i.color);s.backgroundColor=o?Se(o,i.opacity):""}else s.backgroundColor="";s.backgroundImage=i.image||"",s.backgroundPosition=i.position||"",s.backgroundRepeat=i.repeat||"",s.backgroundSize=i.size||""}}initPlugins(){this._resizePlugins=[];for(const e of this.container.plugins.values())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&&We in e.dataset?e.dataset[We]==="true":this._generated,this.element=e,this.element.ariaHidden="true",this._originalStyle=kr(this.element.style);const i=this._standardSize;i.height=e.offsetHeight,i.width=e.offsetWidth;const n=this.container.retina.pixelRatio,s=this.size;e.height=s.height=i.height*n,e.width=s.width=i.width*n,this._context=this.element.getContext("2d"),this._safeMutationObserver(o=>o.disconnect()),this.container.retina.init(),this.initBackground(),this._safeMutationObserver(o=>{!this.element||!(this.element instanceof Node)||o.observe(this.element,{attributes:!0})})}paint(){const e=this.container.actualOptions;this.draw(i=>{e.backgroundMask.enable&&e.backgroundMask.cover?(hi(i,this.size),this._coverImage?this._paintImage(this._coverImage.image,this._coverImage.opacity):this._coverColorStyle?this._paintBase(this._coverColorStyle):this._paintBase()):this._paintBase()})}resize(){if(!this.element)return!1;const e=this.container,i=e.canvas._standardSize,n={width:this.element.offsetWidth,height:this.element.offsetHeight},s=e.retina.pixelRatio,o={width:n.width*s,height:n.height*s};if(n.height===i.height&&n.width===i.width&&o.height===this.element.height&&o.width===this.element.width)return!1;const r={...i};i.height=n.height,i.width=n.width;const a=this.size;return this.element.width=a.width=o.width,this.element.height=a.height=o.height,this.container.started&&e.particles.setResizeFactor({width:i.width/r.width,height:i.height/r.height}),!0}setPointerEvents(e){this.element&&(this._pointerEvents=e,this._repairStyle())}stop(){this._safeMutationObserver(e=>e.disconnect()),this._mutationObserver=void 0,this.draw(e=>hi(e,this.size))}async windowResize(){if(!this.element||!this.resize())return;const e=this.container,i=e.updateActualOptions();e.particles.setDensity(),this._applyResizePlugins(),i&&await e.refresh()}}var ht;(function(t){t.canvas="canvas",t.parent="parent",t.window="window"})(ht||(ht={}));function ce(t,e,i,n,s){if(n){let o={passive:!0};ys(s)?o.capture=s:s!==void 0&&(o=s),t.addEventListener(e,i,o)}else{const o=s;t.removeEventListener(e,i,o)}}class $r{constructor(e){this.container=e,this._doMouseTouchClick=i=>{const n=this.container,s=n.actualOptions;if(this._canPush){const o=n.interactivity.mouse,r=o.position;if(!r)return;o.clickPosition={...r},o.clickTime=new Date().getTime();const a=s.interactivity.events.onClick;re(a.mode,c=>this.container.handleClickMode(c))}i.type==="touchend"&&setTimeout(()=>this._mouseTouchFinish(),Xo)},this._handleThemeChange=i=>{const n=i,s=this.container,o=s.options,r=o.defaultThemes,a=n.matches?r.dark:r.light,c=o.themes.find(l=>l.name===a);c!=null&&c.default.auto&&s.loadTheme(a)},this._handleVisibilityChange=()=>{const i=this.container,n=i.actualOptions;this._mouseTouchFinish(),n.pauseOnBlur&&(document!=null&&document.hidden?(i.pageHidden=!0,i.pause()):(i.pageHidden=!1,i.animationStatus?i.play(!0):i.draw(!0)))},this._handleWindowResize=()=>{this._resizeTimeout&&(clearTimeout(this._resizeTimeout),delete this._resizeTimeout);const i=async()=>{const n=this.container.canvas;await(n==null?void 0:n.windowResize())};this._resizeTimeout=setTimeout(()=>void i(),this.container.actualOptions.interactivity.events.resize.delay*G)},this._manageInteractivityListeners=(i,n)=>{const s=this._handlers,o=this.container,r=o.actualOptions,a=o.interactivity.element;if(!a)return;const c=a,l=o.canvas;l.setPointerEvents(c===l.element?"initial":"none"),(r.interactivity.events.onHover.enable||r.interactivity.events.onClick.enable)&&(ce(a,Qe,s.mouseMove,n),ce(a,xo,s.touchStart,n),ce(a,_o,s.touchMove,n),r.interactivity.events.onClick.enable?(ce(a,rn,s.touchEndClick,n),ce(a,bo,s.mouseUp,n),ce(a,vo,s.mouseDown,n)):ce(a,rn,s.touchEnd,n),ce(a,i,s.mouseLeave,n),ce(a,ko,s.touchCancel,n))},this._manageListeners=i=>{const n=this._handlers,s=this.container,o=s.actualOptions,r=o.interactivity.detectsOn,a=s.canvas.element;let c=_i;r===ht.window?(s.interactivity.element=window,c=wo):r===ht.parent&&a?s.interactivity.element=a.parentElement??a.parentNode:s.interactivity.element=a,this._manageMediaMatch(i),this._manageResize(i),this._manageInteractivityListeners(c,i),document&&ce(document,Mo,n.visibilityChange,i,!1)},this._manageMediaMatch=i=>{const n=this._handlers,s=bs("(prefers-color-scheme: dark)");if(s){if(s.addEventListener!==void 0){ce(s,"change",n.themeChange,i);return}s.addListener!==void 0&&(i?s.addListener(n.oldThemeChange):s.removeListener(n.oldThemeChange))}},this._manageResize=i=>{const n=this._handlers,s=this.container;if(!s.actualOptions.interactivity.events.resize)return;if(typeof ResizeObserver>"u"){ce(window,Co,n.resize,i);return}const r=s.canvas.element;this._resizeObserver&&!i?(r&&this._resizeObserver.unobserve(r),this._resizeObserver.disconnect(),delete this._resizeObserver):!this._resizeObserver&&i&&r&&(this._resizeObserver=new ResizeObserver(a=>{a.find(l=>l.target===r)&&this._handleWindowResize()}),this._resizeObserver.observe(r))},this._mouseDown=()=>{const{interactivity:i}=this.container;if(!i)return;const{mouse:n}=i;n.clicking=!0,n.downPosition=n.position},this._mouseTouchClick=i=>{const n=this.container,s=n.actualOptions,{mouse:o}=n.interactivity;o.inside=!0;let r=!1;const a=o.position;if(!(!a||!s.interactivity.events.onClick.enable)){for(const c of n.plugins.values())if(c.clickPositionValid&&(r=c.clickPositionValid(a),r))break;r||this._doMouseTouchClick(i),o.clicking=!1}},this._mouseTouchFinish=()=>{const i=this.container.interactivity;if(!i)return;const n=i.mouse;delete n.position,delete n.clickPosition,delete n.downPosition,i.status=_i,n.inside=!1,n.clicking=!1},this._mouseTouchMove=i=>{const n=this.container,s=n.actualOptions,o=n.interactivity,r=n.canvas.element;if(!(o!=null&&o.element))return;o.mouse.inside=!0;let a;if(i.type.startsWith("pointer")){this._canPush=!0;const l=i;if(o.element===window){if(r){const u=r.getBoundingClientRect();a={x:l.clientX-u.left,y:l.clientY-u.top}}}else if(s.interactivity.detectsOn===ht.parent){const u=l.target,h=l.currentTarget;if(u&&h&&r){const d=u.getBoundingClientRect(),f=h.getBoundingClientRect(),p=r.getBoundingClientRect();a={x:l.offsetX+N*d.left-(f.left+p.left),y:l.offsetY+N*d.top-(f.top+p.top)}}else a={x:l.offsetX??l.clientX,y:l.offsetY??l.clientY}}else l.target===r&&(a={x:l.offsetX??l.clientX,y:l.offsetY??l.clientY})}else if(this._canPush=i.type!=="touchmove",r){const l=i,u=l.touches[l.touches.length-ps],h=r.getBoundingClientRect();a={x:u.clientX-(h.left??Gt),y:u.clientY-(h.top??Gt)}}const c=n.retina.pixelRatio;a&&(a.x*=c,a.y*=c),o.mouse.position=a,o.status=Qe},this._touchEnd=i=>{const n=i,s=Array.from(n.changedTouches);for(const o of s)this._touches.delete(o.identifier);this._mouseTouchFinish()},this._touchEndClick=i=>{const n=i,s=Array.from(n.changedTouches);for(const o of s)this._touches.delete(o.identifier);this._mouseTouchClick(i)},this._touchStart=i=>{const n=i,s=Array.from(n.changedTouches);for(const o of s)this._touches.set(o.identifier,performance.now());this._mouseTouchMove(i)},this._canPush=!0,this._touches=new Map,this._handlers={mouseDown:()=>this._mouseDown(),mouseLeave:()=>this._mouseTouchFinish(),mouseMove:i=>this._mouseTouchMove(i),mouseUp:i=>this._mouseTouchClick(i),touchStart:i=>this._touchStart(i),touchMove:i=>this._mouseTouchMove(i),touchEnd:i=>this._touchEnd(i),touchCancel:i=>this._touchEnd(i),touchEndClick:i=>this._touchEndClick(i),visibilityChange:()=>this._handleVisibilityChange(),themeChange:i=>this._handleThemeChange(i),oldThemeChange:i=>this._handleThemeChange(i),resize:()=>{this._handleWindowResize()}}}addListeners(){this._manageListeners(!0)}removeListeners(){this._manageListeners(!1)}}var K;(function(t){t.configAdded="configAdded",t.containerInit="containerInit",t.particlesSetup="particlesSetup",t.containerStarted="containerStarted",t.containerStopped="containerStopped",t.containerDestroyed="containerDestroyed",t.containerPaused="containerPaused",t.containerPlay="containerPlay",t.containerBuilt="containerBuilt",t.particleAdded="particleAdded",t.particleDestroyed="particleDestroyed",t.particleRemoved="particleRemoved"})(K||(K={}));class X{constructor(){this.value=""}static create(e,i){const n=new X;return n.load(e),i!==void 0&&(Le(i)||ke(i)?n.load({value:i}):n.load(i)),n}load(e){v(e)||v(e.value)||(this.value=e.value)}}class Vr{constructor(){this.color=new X,this.color.value="",this.image="",this.position="",this.repeat="",this.size="",this.opacity=1}load(e){v(e)||(e.color!==void 0&&(this.color=X.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 Hr{constructor(){this.opacity=1}load(e){v(e)||(e.color!==void 0&&(this.color=X.create(this.color,e.color)),e.image!==void 0&&(this.image=e.image),e.opacity!==void 0&&(this.opacity=e.opacity))}}class Ur{constructor(){this.composite="destination-out",this.cover=new Hr,this.enable=!1}load(e){if(!v(e)){if(e.composite!==void 0&&(this.composite=e.composite),e.cover!==void 0){const i=e.cover,n=Le(e.cover)?{color:e.cover}:e.cover;this.cover.load(i.color!==void 0||i.image!==void 0?i:{color:n})}e.enable!==void 0&&(this.enable=e.enable)}}}class Wr{constructor(){this.enable=!0,this.zIndex=0}load(e){v(e)||(e.enable!==void 0&&(this.enable=e.enable),e.zIndex!==void 0&&(this.zIndex=e.zIndex))}}class jr{constructor(){this.enable=!1,this.mode=[]}load(e){v(e)||(e.enable!==void 0&&(this.enable=e.enable),e.mode!==void 0&&(this.mode=e.mode))}}var vt;(function(t){t.circle="circle",t.rectangle="rectangle"})(vt||(vt={}));class zn{constructor(){this.selectors=[],this.enable=!1,this.mode=[],this.type=vt.circle}load(e){v(e)||(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 Gr{constructor(){this.enable=!1,this.force=2,this.smooth=10}load(e){v(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 Nr{constructor(){this.enable=!1,this.mode=[],this.parallax=new Gr}load(e){v(e)||(e.enable!==void 0&&(this.enable=e.enable),e.mode!==void 0&&(this.mode=e.mode),this.parallax.load(e.parallax))}}class Yr{constructor(){this.delay=.5,this.enable=!0}load(e){v(e)||(e.delay!==void 0&&(this.delay=e.delay),e.enable!==void 0&&(this.enable=e.enable))}}class Qr{constructor(){this.onClick=new jr,this.onDiv=new zn,this.onHover=new Nr,this.resize=new Yr}load(e){if(v(e))return;this.onClick.load(e.onClick);const i=e.onDiv;i!==void 0&&(this.onDiv=re(i,n=>{const s=new zn;return s.load(n),s})),this.onHover.load(e.onHover),this.resize.load(e.resize)}}class Xr{constructor(e,i){this._engine=e,this._container=i}load(e){if(v(e)||!this._container)return;const i=this._engine.interactors.get(this._container);if(i)for(const n of i)n.loadModeOptions&&n.loadModeOptions(this,e)}}class Ts{constructor(e,i){this.detectsOn=ht.window,this.events=new Qr,this.modes=new Xr(e,i)}load(e){if(v(e))return;const i=e.detectsOn;i!==void 0&&(this.detectsOn=i),this.events.load(e.events),this.modes.load(e.modes)}}class Zr{load(e){v(e)||(e.position&&(this.position={x:e.position.x??wn,y:e.position.y??wn,mode:e.position.mode??yt.percent}),e.options&&(this.options=Q({},e.options)))}}var Ne;(function(t){t.screen="screen",t.canvas="canvas"})(Ne||(Ne={}));class Kr{constructor(){this.maxWidth=1/0,this.options={},this.mode=Ne.canvas}load(e){v(e)||(v(e.maxWidth)||(this.maxWidth=e.maxWidth),v(e.mode)||(e.mode===Ne.screen?this.mode=Ne.screen:this.mode=Ne.canvas),v(e.options)||(this.options=Q({},e.options)))}}var Te;(function(t){t.any="any",t.dark="dark",t.light="light"})(Te||(Te={}));class Jr{constructor(){this.auto=!1,this.mode=Te.any,this.value=!1}load(e){v(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 ea{constructor(){this.name="",this.default=new Jr}load(e){v(e)||(e.name!==void 0&&(this.name=e.name),this.default.load(e.default),e.options!==void 0&&(this.options=Q({},e.options)))}}class qi{constructor(){this.count=0,this.enable=!1,this.speed=1,this.decay=0,this.delay=0,this.sync=!1}load(e){v(e)||(e.count!==void 0&&(this.count=S(e.count)),e.enable!==void 0&&(this.enable=e.enable),e.speed!==void 0&&(this.speed=S(e.speed)),e.decay!==void 0&&(this.decay=S(e.decay)),e.delay!==void 0&&(this.delay=S(e.delay)),e.sync!==void 0&&(this.sync=e.sync))}}class $i extends qi{constructor(){super(),this.mode=Ge.auto,this.startValue=ut.random}load(e){super.load(e),!v(e)&&(e.mode!==void 0&&(this.mode=e.mode),e.startValue!==void 0&&(this.startValue=e.startValue))}}class fi extends qi{constructor(){super(),this.offset=0,this.sync=!0}load(e){super.load(e),!v(e)&&e.offset!==void 0&&(this.offset=S(e.offset))}}class ta{constructor(){this.h=new fi,this.s=new fi,this.l=new fi}load(e){v(e)||(this.h.load(e.h),this.s.load(e.s),this.l.load(e.l))}}class Ot extends X{constructor(){super(),this.animation=new ta}static create(e,i){const n=new Ot;return n.load(e),i!==void 0&&(Le(i)||ke(i)?n.load({value:i}):n.load(i)),n}load(e){if(super.load(e),v(e))return;const i=e.animation;i!==void 0&&(i.enable!==void 0?this.animation.h.load(i):this.animation.load(e.animation))}}var ft;(function(t){t.absorb="absorb",t.bounce="bounce",t.destroy="destroy"})(ft||(ft={}));class ia{constructor(){this.speed=2}load(e){v(e)||e.speed!==void 0&&(this.speed=e.speed)}}class na{constructor(){this.enable=!0,this.retries=0}load(e){v(e)||(e.enable!==void 0&&(this.enable=e.enable),e.retries!==void 0&&(this.retries=e.retries))}}class Je{constructor(){this.value=0}load(e){v(e)||v(e.value)||(this.value=S(e.value))}}class sa extends Je{constructor(){super(),this.animation=new qi}load(e){if(super.load(e),v(e))return;const i=e.animation;i!==void 0&&this.animation.load(i)}}class Es extends sa{constructor(){super(),this.animation=new $i}load(e){super.load(e)}}class Sn extends Je{constructor(){super(),this.value=1}}class Is{constructor(){this.horizontal=new Sn,this.vertical=new Sn}load(e){v(e)||(this.horizontal.load(e.horizontal),this.vertical.load(e.vertical))}}class oa{constructor(){this.absorb=new ia,this.bounce=new Is,this.enable=!1,this.maxSpeed=50,this.mode=ft.bounce,this.overlap=new na}load(e){v(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=S(e.maxSpeed)),e.mode!==void 0&&(this.mode=e.mode),this.overlap.load(e.overlap))}}class ra{constructor(){this.close=!0,this.fill=!0,this.options={},this.type=[]}load(e){if(v(e))return;const i=e.options;if(i!==void 0)for(const n in i){const s=i[n];s&&(this.options[n]=Q(this.options[n]??{},s))}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 aa{constructor(){this.offset=0,this.value=90}load(e){v(e)||(e.offset!==void 0&&(this.offset=S(e.offset)),e.value!==void 0&&(this.value=S(e.value)))}}class ca{constructor(){this.distance=200,this.enable=!1,this.rotate={x:3e3,y:3e3}}load(e){if(!v(e)&&(e.distance!==void 0&&(this.distance=S(e.distance)),e.enable!==void 0&&(this.enable=e.enable),e.rotate)){const i=e.rotate.x;i!==void 0&&(this.rotate.x=i);const n=e.rotate.y;n!==void 0&&(this.rotate.y=n)}}}class la{constructor(){this.x=50,this.y=50,this.mode=yt.percent,this.radius=0}load(e){v(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 ua{constructor(){this.acceleration=9.81,this.enable=!1,this.inverse=!1,this.maxSpeed=50}load(e){v(e)||(e.acceleration!==void 0&&(this.acceleration=S(e.acceleration)),e.enable!==void 0&&(this.enable=e.enable),e.inverse!==void 0&&(this.inverse=e.inverse),e.maxSpeed!==void 0&&(this.maxSpeed=S(e.maxSpeed)))}}class ha{constructor(){this.clamp=!0,this.delay=new Je,this.enable=!1,this.options={}}load(e){v(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=Q(this.options,e.options)))}}class fa{load(e){v(e)||(e.color!==void 0&&(this.color=X.create(this.color,e.color)),e.image!==void 0&&(this.image=e.image))}}class da{constructor(){this.enable=!1,this.length=10,this.fill=new fa}load(e){v(e)||(e.enable!==void 0&&(this.enable=e.enable),e.fill!==void 0&&this.fill.load(e.fill),e.length!==void 0&&(this.length=e.length))}}var B;(function(t){t.bounce="bounce",t.none="none",t.out="out",t.destroy="destroy",t.split="split"})(B||(B={}));class pa{constructor(){this.default=B.out}load(e){v(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 ma{constructor(){this.acceleration=0,this.enable=!1}load(e){v(e)||(e.acceleration!==void 0&&(this.acceleration=S(e.acceleration)),e.enable!==void 0&&(this.enable=e.enable),e.position&&(this.position=Q({},e.position)))}}class ya{constructor(){this.angle=new aa,this.attract=new ca,this.center=new la,this.decay=0,this.distance={},this.direction=U.none,this.drift=0,this.enable=!1,this.gravity=new ua,this.path=new ha,this.outModes=new pa,this.random=!1,this.size=!1,this.speed=2,this.spin=new ma,this.straight=!1,this.trail=new da,this.vibrate=!1,this.warp=!1}load(e){if(v(e))return;this.angle.load(Ae(e.angle)?{value:e.angle}:e.angle),this.attract.load(e.attract),this.center.load(e.center),e.decay!==void 0&&(this.decay=S(e.decay)),e.direction!==void 0&&(this.direction=e.direction),e.distance!==void 0&&(this.distance=Ae(e.distance)?{horizontal:e.distance,vertical:e.distance}:{...e.distance}),e.drift!==void 0&&(this.drift=S(e.drift)),e.enable!==void 0&&(this.enable=e.enable),this.gravity.load(e.gravity);const i=e.outModes;i!==void 0&&(at(i)?this.outModes.load(i):this.outModes.load({default:i})),this.path.load(e.path),e.random!==void 0&&(this.random=e.random),e.size!==void 0&&(this.size=e.size),e.speed!==void 0&&(this.speed=S(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 ga extends $i{constructor(){super(),this.destroy=Xe.none,this.speed=2}load(e){super.load(e),!v(e)&&e.destroy!==void 0&&(this.destroy=e.destroy)}}class va extends Es{constructor(){super(),this.animation=new ga,this.value=1}load(e){if(v(e))return;super.load(e);const i=e.animation;i!==void 0&&this.animation.load(i)}}class ba{constructor(){this.enable=!1,this.width=1920,this.height=1080}load(e){if(v(e))return;e.enable!==void 0&&(this.enable=e.enable);const i=e.width;i!==void 0&&(this.width=i);const n=e.height;n!==void 0&&(this.height=n)}}var Tt;(function(t){t.delete="delete",t.wait="wait"})(Tt||(Tt={}));class wa{constructor(){this.mode=Tt.delete,this.value=0}load(e){v(e)||(e.mode!==void 0&&(this.mode=e.mode),e.value!==void 0&&(this.value=e.value))}}class xa{constructor(){this.density=new ba,this.limit=new wa,this.value=0}load(e){v(e)||(this.density.load(e.density),this.limit.load(e.limit),e.value!==void 0&&(this.value=e.value))}}class _a{constructor(){this.blur=0,this.color=new X,this.enable=!1,this.offset={x:0,y:0},this.color.value="#000"}load(e){v(e)||(e.blur!==void 0&&(this.blur=e.blur),this.color=X.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)))}}class ka{constructor(){this.close=!0,this.fill=!0,this.options={},this.type="circle"}load(e){if(v(e))return;const i=e.options;if(i!==void 0)for(const n in i){const s=i[n];s&&(this.options[n]=Q(this.options[n]??{},s))}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 Ca extends $i{constructor(){super(),this.destroy=Xe.none,this.speed=5}load(e){super.load(e),!v(e)&&e.destroy!==void 0&&(this.destroy=e.destroy)}}class Ma extends Es{constructor(){super(),this.animation=new Ca,this.value=3}load(e){if(super.load(e),v(e))return;const i=e.animation;i!==void 0&&this.animation.load(i)}}class Rn{constructor(){this.width=0}load(e){v(e)||(e.color!==void 0&&(this.color=Ot.create(this.color,e.color)),e.width!==void 0&&(this.width=S(e.width)),e.opacity!==void 0&&(this.opacity=S(e.opacity)))}}class Pa extends Je{constructor(){super(),this.opacityRate=1,this.sizeRate=1,this.velocityRate=1}load(e){super.load(e),!v(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 za{constructor(e,i){this._engine=e,this._container=i,this.bounce=new Is,this.collisions=new oa,this.color=new Ot,this.color.value="#fff",this.effect=new ra,this.groups={},this.move=new ya,this.number=new xa,this.opacity=new va,this.reduceDuplicates=!1,this.shadow=new _a,this.shape=new ka,this.size=new Ma,this.stroke=new Rn,this.zIndex=new Pa}load(e){if(v(e))return;if(e.groups!==void 0)for(const n of Object.keys(e.groups)){if(!Object.hasOwn(e.groups,n))continue;const s=e.groups[n];s!==void 0&&(this.groups[n]=Q(this.groups[n]??{},s))}e.reduceDuplicates!==void 0&&(this.reduceDuplicates=e.reduceDuplicates),this.bounce.load(e.bounce),this.color.load(Ot.create(this.color,e.color)),this.effect.load(e.effect),this.move.load(e.move),this.number.load(e.number),this.opacity.load(e.opacity),this.shape.load(e.shape),this.size.load(e.size),this.shadow.load(e.shadow),this.zIndex.load(e.zIndex),this.collisions.load(e.collisions),e.interactivity!==void 0&&(this.interactivity=Q({},e.interactivity));const i=e.stroke;if(i&&(this.stroke=re(i,n=>{const s=new Rn;return s.load(n),s})),this._container){const n=this._engine.updaters.get(this._container);if(n)for(const o of n)o.loadOptions&&o.loadOptions(this,e);const s=this._engine.interactors.get(this._container);if(s)for(const o of s)o.loadParticlesOptions&&o.loadParticlesOptions(this,e)}}}function Ds(t,...e){for(const i of e)t.load(i)}function Ls(t,e,...i){const n=new za(t,e);return Ds(n,...i),n}class Sa{constructor(e,i){this._findDefaultTheme=n=>this.themes.find(s=>s.default.value&&s.default.mode===n)??this.themes.find(s=>s.default.value&&s.default.mode===Te.any),this._importPreset=n=>{this.load(this._engine.getPreset(n))},this._engine=e,this._container=i,this.autoPlay=!0,this.background=new Vr,this.backgroundMask=new Ur,this.clear=!0,this.defaultThemes={},this.delay=0,this.fullScreen=new Wr,this.detectRetina=!0,this.duration=0,this.fpsLimit=120,this.interactivity=new Ts(e,i),this.manualParticles=[],this.particles=Ls(this._engine,this._container),this.pauseOnBlur=!0,this.pauseOnOutsideViewport=!0,this.responsive=[],this.smooth=!1,this.style={},this.themes=[],this.zLayers=100}load(e){var r,a;if(v(e))return;e.preset!==void 0&&re(e.preset,c=>this._importPreset(c)),e.autoPlay!==void 0&&(this.autoPlay=e.autoPlay),e.clear!==void 0&&(this.clear=e.clear),e.key!==void 0&&(this.key=e.key),e.name!==void 0&&(this.name=e.name),e.delay!==void 0&&(this.delay=S(e.delay));const i=e.detectRetina;i!==void 0&&(this.detectRetina=i),e.duration!==void 0&&(this.duration=S(e.duration));const n=e.fpsLimit;n!==void 0&&(this.fpsLimit=n),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 s=e.fullScreen;ys(s)?this.fullScreen.enable=s:this.fullScreen.load(s),this.backgroundMask.load(e.backgroundMask),this.interactivity.load(e.interactivity),e.manualParticles&&(this.manualParticles=e.manualParticles.map(c=>{const l=new Zr;return l.load(c),l})),this.particles.load(e.particles),this.style=Q(this.style,e.style),this._engine.loadOptions(this,e),e.smooth!==void 0&&(this.smooth=e.smooth);const o=this._engine.interactors.get(this._container);if(o)for(const c of o)c.loadOptions&&c.loadOptions(this,e);if(e.responsive!==void 0)for(const c of e.responsive){const l=new Kr;l.load(c),this.responsive.push(l)}if(this.responsive.sort((c,l)=>c.maxWidth-l.maxWidth),e.themes!==void 0)for(const c of e.themes){const l=this.themes.find(u=>u.name===c.name);if(l)l.load(c);else{const u=new ea;u.load(c),this.themes.push(u)}}this.defaultThemes.dark=(r=this._findDefaultTheme(Te.dark))==null?void 0:r.name,this.defaultThemes.light=(a=this._findDefaultTheme(Te.light))==null?void 0:a.name}setResponsive(e,i,n){this.load(n);const s=this.responsive.find(o=>o.mode===Ne.screen&&screen?o.maxWidth>screen.availWidth:o.maxWidth*i>e);return this.load(s==null?void 0:s.options),s==null?void 0:s.maxWidth}setTheme(e){if(e){const i=this.themes.find(n=>n.name===e);i&&this.load(i.options)}else{const i=bs("(prefers-color-scheme: dark)"),n=i==null?void 0:i.matches,s=this._findDefaultTheme(n?Te.dark:Te.light);s&&this.load(s.options)}}}var bt;(function(t){t.external="external",t.particles="particles"})(bt||(bt={}));class Ra{constructor(e,i){this.container=i,this._engine=e,this._interactors=[],this._externalInteractors=[],this._particleInteractors=[]}externalInteract(e){for(const i of this._externalInteractors)i.isEnabled()&&i.interact(e)}handleClickMode(e){var i;for(const n of this._externalInteractors)(i=n.handleClickMode)==null||i.call(n,e)}async init(){this._interactors=await this._engine.getInteractors(this.container,!0),this._externalInteractors=[],this._particleInteractors=[];for(const e of this._interactors){switch(e.type){case bt.external:this._externalInteractors.push(e);break;case bt.particles:this._particleInteractors.push(e);break}e.init()}}particlesInteract(e,i){for(const n of this._externalInteractors)n.clear(e,i);for(const n of this._particleInteractors)n.isEnabled(e)&&n.interact(e,i)}reset(e){for(const i of this._externalInteractors)i.isEnabled()&&i.reset(e);for(const i of this._particleInteractors)i.isEnabled(e)&&i.reset(e)}}var ge;(function(t){t.normal="normal",t.inside="inside",t.outside="outside"})(ge||(ge={}));function Oa(t,e,i,n){const s=e.options[t];if(s)return Q({close:e.close,fill:e.fill},le(s,i,n))}function Ta(t,e,i,n){const s=e.options[t];if(s)return Q({close:e.close,fill:e.fill},le(s,i,n))}function On(t){if(!A(t.outMode,t.checkModes))return;const e=t.radius*N;t.coord>t.maxCoord-e?t.setCb(-t.radius):t.coord<e&&t.setCb(t.radius)}class Ea{constructor(e,i){this.container=i,this._calcPosition=(n,s,o,r=cn)=>{for(const p of n.plugins.values()){const y=p.particlePosition!==void 0?p.particlePosition(s,this):void 0;if(y)return ne.create(y.x,y.y,o)}const a=n.canvas.size,c=ur({size:a,position:s}),l=ne.create(c.x,c.y,o),u=this.getRadius(),h=this.options.move.outModes,d=p=>{On({outMode:p,checkModes:[B.bounce],coord:l.x,maxCoord:n.canvas.size.width,setCb:y=>l.x+=y,radius:u})},f=p=>{On({outMode:p,checkModes:[B.bounce],coord:l.y,maxCoord:n.canvas.size.height,setCb:y=>l.y+=y,radius:u})};return d(h.left??h.default),d(h.right??h.default),f(h.top??h.default),f(h.bottom??h.default),this._checkOverlap(l,r)?this._calcPosition(n,void 0,o,r+Uo):l},this._calculateVelocity=()=>{const n=lr(this.direction),s=n.copy(),o=this.options.move;if(o.direction===U.inside||o.direction===U.outside)return s;const r=De(_(o.angle.value)),a=De(_(o.angle.offset)),c={left:a-r*$,right:a+r*$};return o.straight||(s.angle+=se(S(c.left,c.right))),o.random&&typeof o.speed=="number"&&(s.length*=E()),s},this._checkOverlap=(n,s=cn)=>{const o=this.options.collisions,r=this.getRadius();if(!o.enable)return!1;const a=o.overlap;if(a.enable)return!1;const c=a.retries;if(c>=Wo&&s>c)throw new Error(`${ue} particle is overlapping and can't be placed`);return!!this.container.particles.find(l=>oe(n,l.position)<r+l.getRadius())},this._getRollColor=n=>{if(!n||!this.roll||!this.backColor&&!this.roll.alter)return n;const s=this.roll.horizontal&&this.roll.vertical?N*yn:yn,o=this.roll.horizontal?Math.PI*$:Nt;return Math.floor(((this.roll.angle??Nt)+o)/(Math.PI/s))%N?this.backColor?this.backColor:this.roll.alter?Fr(n,this.roll.alter.type,this.roll.alter.value):n:n},this._initPosition=n=>{const s=this.container,o=_(this.options.zIndex.value);this.position=this._calcPosition(s,n,he(o,jo,s.zLayers)),this.initialPosition=this.position.copy();const r=s.canvas.size;switch(this.moveCenter={...Cs(this.options.move.center,r),radius:this.options.move.center.radius??Go,mode:this.options.move.center.mode??yt.percent},this.direction=cr(this.options.move.direction,this.position,this.moveCenter),this.options.move.direction){case U.inside:this.outType=ge.inside;break;case U.outside:this.outType=ge.outside;break}this.offset=V.origin},this._engine=e}destroy(e){var o,r,a;if(this.unbreakable||this.destroyed)return;this.destroyed=!0,this.bubble.inRange=!1,this.slow.inRange=!1;const i=this.container,n=this.pathGenerator,s=i.shapeDrawers.get(this.shape);(o=s==null?void 0:s.particleDestroy)==null||o.call(s,this);for(const c of i.plugins.values())(r=c.particleDestroyed)==null||r.call(c,this,e);for(const c of i.particles.updaters)(a=c.particleDestroyed)==null||a.call(c,this,e);n==null||n.reset(this),this._engine.dispatchEvent(K.particleDestroyed,{container:this.container,data:{particle:this}})}draw(e){const i=this.container,n=i.canvas;for(const s of i.plugins.values())n.drawParticlePlugin(s,this,e);n.drawParticle(this,e)}getFillColor(){return this._getRollColor(this.bubble.color??Mn(this.color))}getMass(){return this.getRadius()**Pe*Math.PI*$}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??Mn(this.strokeColor))}init(e,i,n,s){var q,W,te,H,ae,fe;const o=this.container,r=this._engine;this.id=e,this.group=s,this.effectClose=!0,this.effectFill=!0,this.shapeClose=!0,this.shapeFill=!0,this.pathRotation=!1,this.lastPathTime=0,this.destroyed=!1,this.unbreakable=!1,this.isRotating=!1,this.rotation=0,this.misplaced=!1,this.retina={maxDistance:{}},this.outType=ge.normal,this.ignoresResizeRatio=!0;const a=o.retina.pixelRatio,c=o.actualOptions,l=Ls(this._engine,o,c.particles),{reduceDuplicates:u}=l,h=l.effect.type,d=l.shape.type;this.effect=le(h,this.id,u),this.shape=le(d,this.id,u);const f=l.effect,p=l.shape;if(n){if((q=n.effect)!=null&&q.type){const D=n.effect.type,be=le(D,this.id,u);be&&(this.effect=be,f.load(n.effect))}if((W=n.shape)!=null&&W.type){const D=n.shape.type,be=le(D,this.id,u);be&&(this.shape=be,p.load(n.shape))}}if(this.effect===mt){const D=[...this.container.effectDrawers.keys()];this.effect=D[Math.floor(E()*D.length)]}if(this.shape===mt){const D=[...this.container.shapeDrawers.keys()];this.shape=D[Math.floor(E()*D.length)]}this.effectData=Oa(this.effect,f,this.id,u),this.shapeData=Ta(this.shape,p,this.id,u),l.load(n);const y=this.effectData;y&&l.load(y.particles);const m=this.shapeData;m&&l.load(m.particles);const w=new Ts(r,o);w.load(o.actualOptions.interactivity),w.load(l.interactivity),this.interactivity=w,this.effectFill=(y==null?void 0:y.fill)??l.effect.fill,this.effectClose=(y==null?void 0:y.close)??l.effect.close,this.shapeFill=(m==null?void 0:m.fill)??l.shape.fill,this.shapeClose=(m==null?void 0:m.close)??l.shape.close,this.options=l;const b=this.options.move.path;this.pathDelay=_(b.delay.value)*G,b.generator&&(this.pathGenerator=this._engine.getPathGenerator(b.generator),this.pathGenerator&&o.addPath(b.generator,this.pathGenerator)&&this.pathGenerator.init(o)),o.retina.initParticle(this),this.size=ks(this.options.size,a),this.bubble={inRange:!1},this.slow={inRange:!1,factor:1},this._initPosition(i),this.initialVelocity=this._calculateVelocity(),this.velocity=this.initialVelocity.copy(),this.moveDecay=ds-_(this.options.move.decay);const x=o.particles;x.setLastZIndex(this.position.z),this.zIndexFactor=this.position.z/o.zLayers,this.sides=24;let g=o.effectDrawers.get(this.effect);g||(g=this._engine.getEffectDrawer(this.effect),g&&o.effectDrawers.set(this.effect,g)),g!=null&&g.loadEffect&&g.loadEffect(this);let k=o.shapeDrawers.get(this.shape);k||(k=this._engine.getShapeDrawer(this.shape),k&&o.shapeDrawers.set(this.shape,k)),k!=null&&k.loadShape&&k.loadShape(this);const O=k==null?void 0:k.getSidesCount;O&&(this.sides=O(this)),this.spawning=!1,this.shadowColor=ye(this._engine,this.options.shadow.color);for(const D of x.updaters)D.init(this);for(const D of x.movers)(te=D.init)==null||te.call(D,this);(H=g==null?void 0:g.particleInit)==null||H.call(g,o,this),(ae=k==null?void 0:k.particleInit)==null||ae.call(k,o,this);for(const D of o.plugins.values())(fe=D.particleCreated)==null||fe.call(D,this)}isInsideCanvas(){const e=this.getRadius(),i=this.container.canvas.size,n=this.position;return n.x>=-e&&n.y>=-e&&n.y<=i.height+e&&n.x<=i.width+e}isVisible(){return!this.destroyed&&!this.spawning&&this.isInsideCanvas()}reset(){var e;for(const i of this.container.particles.updaters)(e=i.reset)==null||e.call(i,this)}}class Ia{constructor(e,i){this.position=e,this.particle=i}}var dt;(function(t){t.circle="circle",t.rectangle="rectangle"})(dt||(dt={}));class As{constructor(e,i,n){this.position={x:e,y:i},this.type=n}}class Y extends As{constructor(e,i,n){super(e,i,dt.circle),this.radius=n}contains(e){return oe(e,this.position)<=this.radius}intersects(e){const i=this.position,n=e.position,s={x:Math.abs(n.x-i.x),y:Math.abs(n.y-i.y)},o=this.radius;if(e instanceof Y||e.type===dt.circle){const r=e,a=o+r.radius,c=Math.sqrt(s.x**Pe+s.y**Pe);return a>c}else if(e instanceof ve||e.type===dt.rectangle){const r=e,{width:a,height:c}=r.size;return Math.pow(s.x-a,Pe)+Math.pow(s.y-c,Pe)<=o**Pe||s.x<=o+a&&s.y<=o+c||s.x<=a||s.y<=c}return!1}}class ve extends As{constructor(e,i,n,s){super(e,i,dt.rectangle),this.size={height:s,width:n}}contains(e){const i=this.size.width,n=this.size.height,s=this.position;return e.x>=s.x&&e.x<=s.x+i&&e.y>=s.y&&e.y<=s.y+n}intersects(e){if(e instanceof Y)return e.intersects(this);const i=this.size.width,n=this.size.height,s=this.position,o=e.position,r=e instanceof ve?e.size:{width:0,height:0},a=r.width,c=r.height;return o.x<s.x+i&&o.x+a>s.x&&o.y<s.y+n&&o.y+c>s.y}}class Qt{constructor(e,i){this.rectangle=e,this.capacity=i,this._subdivide=()=>{const{x:n,y:s}=this.rectangle.position,{width:o,height:r}=this.rectangle.size,{capacity:a}=this;for(let c=0;c<So;c++){const l=c%N;this._subs.push(new Qt(new ve(n+o*$*l,s+r*$*(Math.round(c*$)-l),o*$,r*$),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(i=>i.insert(e))):!1}query(e,i){const n=[];if(!e.intersects(this.rectangle))return[];for(const s of this._points)!e.contains(s.position)&&oe(e.position,s.position)>s.particle.getRadius()&&(!i||i(s.particle))||n.push(s.particle);if(this._divided)for(const s of this._subs)n.push(...s.query(e,i));return n}queryCircle(e,i,n){return this.query(new Y(e.x,e.y,i),n)}queryRectangle(e,i,n){return this.query(new ve(e.x,e.y,i.width,i.height),n)}}const Tn=t=>{const{height:e,width:i}=t;return new ve(gn*i,gn*e,vn*i,vn*e)};class Da{constructor(e,i){this._addToPool=(...s)=>{this._pool.push(...s)},this._applyDensity=(s,o,r,a)=>{var p,y,m;const c=s.number;if(!((p=s.number.density)!=null&&p.enable)){r===void 0?this._limit=c.limit.value:(((y=a==null?void 0:a.number.limit)==null?void 0:y.value)??c.limit.value)&&this._groupLimits.set(r,((m=a==null?void 0:a.number.limit)==null?void 0:m.value)??c.limit.value);return}const l=this._initDensityFactor(c.density),u=c.value,h=c.limit.value>bn?c.limit.value:u,d=Math.min(u,h)*l+o,f=Math.min(this.count,this.filter(w=>w.group===r).length);r===void 0?this._limit=c.limit.value*l:this._groupLimits.set(r,c.limit.value*l),f<d?this.push(Math.abs(d-f),void 0,s,r):f>d&&this.removeQuantity(f-d,r)},this._initDensityFactor=s=>{const o=this._container;if(!o.canvas.element||!s.enable)return Qo;const r=o.canvas.element,a=o.retina.pixelRatio;return r.width*r.height/(s.height*s.width*a**Pe)},this._pushParticle=(s,o,r,a)=>{try{let c=this._pool.pop();c||(c=new Ea(this._engine,this._container)),c.init(this._nextId,s,o,r);let l=!0;return a&&(l=a(c)),l?(this._array.push(c),this._zArray.push(c),this._nextId++,this._engine.dispatchEvent(K.particleAdded,{container:this._container,data:{particle:c}}),c):void 0}catch(c){Ze().warning(`${ue} adding particle: ${c}`)}},this._removeParticle=(s,o,r)=>{const a=this._array[s];if(!a||a.group!==o)return!1;const c=this._zArray.indexOf(a);return this._array.splice(s,Yt),this._zArray.splice(c,Yt),a.destroy(r),this._engine.dispatchEvent(K.particleRemoved,{container:this._container,data:{particle:a}}),this._addToPool(a),!0},this._engine=e,this._container=i,this._nextId=0,this._array=[],this._zArray=[],this._pool=[],this._limit=0,this._groupLimits=new Map,this._needsSort=!1,this._lastZIndex=0,this._interactionManager=new Ra(e,i),this._pluginsInitialized=!1;const n=i.canvas.size;this.quadTree=new Qt(Tn(n),ln),this.movers=[],this.updaters=[]}get count(){return this._array.length}addManualParticles(){const e=this._container;e.actualOptions.manualParticles.forEach(n=>this.addParticle(n.position?Cs(n.position,e.canvas.size):void 0,n.options))}addParticle(e,i,n,s){const o=this._container.actualOptions.particles.number.limit.mode,r=n===void 0?this._limit:this._groupLimits.get(n)??this._limit,a=this.count;if(r>bn)switch(o){case Tt.delete:{const c=a+No-r;c>Yo&&this.removeQuantity(c);break}case Tt.wait:if(a>=r)return;break}return this._pushParticle(e,i,n,s)}clear(){this._array=[],this._zArray=[],this._pluginsInitialized=!1}destroy(){this._array=[],this._zArray=[],this.movers=[],this.updaters=[]}draw(e){const i=this._container,n=i.canvas;n.clear(),this.update(e);for(const s of i.plugins.values())n.drawPlugin(s,e);for(const s of this._zArray)s.draw(e)}filter(e){return this._array.filter(e)}find(e){return this._array.find(e)}get(e){return this._array[e]}handleClickMode(e){this._interactionManager.handleClickMode(e)}async init(){var s,o;const e=this._container,i=e.actualOptions;this._lastZIndex=0,this._needsSort=!1,await this.initPlugins();let n=!1;for(const r of e.plugins.values())if(n=((s=r.particlesInitialization)==null?void 0:s.call(r))??n,n)break;if(this.addManualParticles(),!n){const r=i.particles,a=r.groups;for(const c in a){const l=a[c];for(let u=this.count,h=0;h<((o=l.number)==null?void 0:o.value)&&u<r.number.value;u++,h++)this.addParticle(void 0,l,c)}for(let c=this.count;c<r.number.value;c++)this.addParticle()}}async initPlugins(){if(this._pluginsInitialized)return;const e=this._container;this.movers=await this._engine.getMovers(e,!0),this.updaters=await this._engine.getUpdaters(e,!0),await this._interactionManager.init();for(const i of e.pathGenerators.values())i.init(e)}push(e,i,n,s){for(let o=0;o<e;o++)this.addParticle(i==null?void 0:i.position,n,s)}async redraw(){this.clear(),await this.init(),this.draw({value:0,factor:0})}remove(e,i,n){this.removeAt(this._array.indexOf(e),void 0,i,n)}removeAt(e,i=zo,n,s){if(e<Pi||e>this.count)return;let o=0;for(let r=e;o<i&&r<this.count;r++)this._removeParticle(r,n,s)&&(r--,o++)}removeQuantity(e,i){this.removeAt(Pi,e,i)}setDensity(){const e=this._container.actualOptions,i=e.particles.groups,n=e.manualParticles.length;for(const s in i)this._applyDensity(i[s],n,s);this._applyDensity(e.particles,n)}setLastZIndex(e){this._lastZIndex=e,this._needsSort=this._needsSort||this._lastZIndex<e}setResizeFactor(e){this._resizeFactor=e}update(e){var o,r;const i=this._container,n=new Set;this.quadTree=new Qt(Tn(i.canvas.size),ln);for(const a of i.pathGenerators.values())a.update();for(const a of i.plugins.values())(o=a.update)==null||o.call(a,e);const s=this._resizeFactor;for(const a of this._array){s&&!a.ignoresResizeRatio&&(a.position.x*=s.width,a.position.y*=s.height,a.initialPosition.x*=s.width,a.initialPosition.y*=s.height),a.ignoresResizeRatio=!1,this._interactionManager.reset(a);for(const c of this._container.plugins.values()){if(a.destroyed)break;(r=c.particleUpdate)==null||r.call(c,a,e)}for(const c of this.movers)c.isEnabled(a)&&c.move(a,e);if(a.destroyed){n.add(a);continue}this.quadTree.insert(new Ia(a.getPosition(),a))}if(n.size){const a=c=>!n.has(c);this._array=this.filter(a),this._zArray=this._zArray.filter(a);for(const c of n)this._engine.dispatchEvent(K.particleRemoved,{container:this._container,data:{particle:c}});this._addToPool(...n)}this._interactionManager.externalInteract(e);for(const a of this._array){for(const c of this.updaters)c.update(a,e);!a.destroyed&&!a.spawning&&this._interactionManager.particlesInteract(a,e)}if(delete this._resizeFactor,this._needsSort){const a=this._zArray;a.sort((c,l)=>l.position.z-c.position.z||c.id-l.id),this._lastZIndex=a[a.length-ps].position.z,this._needsSort=!1}}}class La{constructor(e){this.container=e,this.pixelRatio=un,this.reduceFactor=hn}init(){const e=this.container,i=e.actualOptions;this.pixelRatio=!i.detectRetina||Ke()?un:devicePixelRatio,this.reduceFactor=hn;const n=this.pixelRatio,s=e.canvas;if(s.element){const a=s.element;s.size.width=a.offsetWidth*n,s.size.height=a.offsetHeight*n}const o=i.particles,r=o.move;this.maxSpeed=_(r.gravity.maxSpeed)*n,this.sizeAnimationSpeed=_(o.size.animation.speed)*n}initParticle(e){const i=e.options,n=this.pixelRatio,s=i.move,o=s.distance,r=e.retina;r.moveDrift=_(s.drift)*n,r.moveSpeed=_(s.speed)*n,r.sizeAnimationSpeed=_(i.size.animation.speed)*n;const a=r.maxDistance;a.horizontal=o.horizontal!==void 0?o.horizontal*n:void 0,a.vertical=o.vertical!==void 0?o.vertical*n:void 0,r.maxSpeed=_(s.gravity.maxSpeed)*n}}function L(t){return t&&!t.destroyed}function Aa(t,e=si,i=!1){return{value:t,factor:i?si/e:si*t/G}}function st(t,e,...i){const n=new Sa(t,e);return Ds(n,...i),n}class Fa{constructor(e,i,n){this._intersectionManager=s=>{if(!(!L(this)||!this.actualOptions.pauseOnOutsideViewport))for(const o of s)o.target===this.interactivity.element&&(o.isIntersecting?this.play():this.pause())},this._nextFrame=s=>{try{if(!this._smooth&&this._lastFrameTime!==void 0&&s<this._lastFrameTime+G/this.fpsLimit){this.draw(!1);return}this._lastFrameTime??(this._lastFrameTime=s);const o=Aa(s-this._lastFrameTime,this.fpsLimit,this._smooth);if(this.addLifeTime(o.value),this._lastFrameTime=s,o.value>G){this.draw(!1);return}if(this.particles.draw(o),!this.alive()){this.destroy();return}this.animationStatus&&this.draw(!1)}catch(o){Ze().error(`${ue} in animation loop`,o)}},this._engine=e,this.id=Symbol(i),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._clickHandlers=new Map,this._sourceOptions=n,this._initialSourceOptions=n,this.retina=new La(this),this.canvas=new qr(this,this._engine),this.particles=new Da(this._engine,this),this.pathGenerators=new Map,this.interactivity={mouse:{clicking:!1,inside:!1}},this.plugins=new Map,this.effectDrawers=new Map,this.shapeDrawers=new Map,this._options=st(this._engine,this),this.actualOptions=st(this._engine,this),this._eventListeners=new $r(this),this._intersectionObserver=mr(s=>this._intersectionManager(s)),this._engine.dispatchEvent(K.containerBuilt,{container:this})}get animationStatus(){return!this._paused&&!this.pageHidden&&L(this)}get options(){return this._options}get sourceOptions(){return this._sourceOptions}addClickHandler(e){if(!L(this))return;const i=this.interactivity.element;if(!i)return;const n=(h,d,f)=>{if(!L(this))return;const p=this.retina.pixelRatio,y={x:d.x*p,y:d.y*p},m=this.particles.quadTree.queryCircle(y,f*p);e(h,m)},s=h=>{if(!L(this))return;const d=h,f={x:d.offsetX||d.clientX,y:d.offsetY||d.clientY};n(h,f,Lo)},o=()=>{L(this)&&(l=!0,u=!1)},r=()=>{L(this)&&(u=!0)},a=h=>{if(L(this)){if(l&&!u){const d=h;let f=d.touches[d.touches.length-mn];if(!f&&(f=d.changedTouches[d.changedTouches.length-mn],!f))return;const p=this.canvas.element,y=p?p.getBoundingClientRect():void 0,m={x:f.clientX-(y?y.left:Gt),y:f.clientY-(y?y.top:Gt)};n(h,m,Math.max(f.radiusX,f.radiusY))}l=!1,u=!1}},c=()=>{L(this)&&(l=!1,u=!1)};let l=!1,u=!1;this._clickHandlers.set("click",s),this._clickHandlers.set("touchstart",o),this._clickHandlers.set("touchmove",r),this._clickHandlers.set("touchend",a),this._clickHandlers.set("touchcancel",c);for(const[h,d]of this._clickHandlers)i.addEventListener(h,d)}addLifeTime(e){this._lifeTime+=e}addPath(e,i,n=!1){return!L(this)||!n&&this.pathGenerators.has(e)?!1:(this.pathGenerators.set(e,i),!0)}alive(){return!this._duration||this._lifeTime<=this._duration}clearClickHandlers(){var e;if(L(this)){for(const[i,n]of this._clickHandlers)(e=this.interactivity.element)==null||e.removeEventListener(i,n);this._clickHandlers.clear()}}destroy(e=!0){var i,n;if(L(this)){this.stop(),this.clearClickHandlers(),this.particles.destroy(),this.canvas.destroy();for(const s of this.effectDrawers.values())(i=s.destroy)==null||i.call(s,this);for(const s of this.shapeDrawers.values())(n=s.destroy)==null||n.call(s,this);for(const s of this.effectDrawers.keys())this.effectDrawers.delete(s);for(const s of this.shapeDrawers.keys())this.shapeDrawers.delete(s);if(this._engine.clearPlugins(this),this.destroyed=!0,e){const s=this._engine.items,o=s.findIndex(r=>r===this);o>=Ao&&s.splice(o,fs)}this._engine.dispatchEvent(K.containerDestroyed,{container:this})}}draw(e){if(!L(this))return;let i=e;const n=s=>{i&&(this._lastFrameTime=void 0,i=!1),this._nextFrame(s)};this._drawAnimationFrame=rr(s=>n(s))}async export(e,i={}){for(const n of this.plugins.values()){if(!n.export)continue;const s=await n.export(e,i);if(s.supported)return s.blob}Ze().error(`${ue} - Export plugin with type ${e} not found`)}handleClickMode(e){var i;if(L(this)){this.particles.handleClickMode(e);for(const n of this.plugins.values())(i=n.handleClickMode)==null||i.call(n,e)}}async init(){var l,u,h,d;if(!L(this))return;const e=this._engine.getSupportedEffects();for(const f of e){const p=this._engine.getEffectDrawer(f);p&&this.effectDrawers.set(f,p)}const i=this._engine.getSupportedShapes();for(const f of i){const p=this._engine.getShapeDrawer(f);p&&this.shapeDrawers.set(f,p)}await this.particles.initPlugins(),this._options=st(this._engine,this,this._initialSourceOptions,this.sourceOptions),this.actualOptions=st(this._engine,this,this._options);const n=await this._engine.getAvailablePlugins(this);for(const[f,p]of n)this.plugins.set(f,p);this.retina.init(),await this.canvas.init(),this.updateActualOptions(),this.canvas.initBackground(),this.canvas.resize();const{zLayers:s,duration:o,delay:r,fpsLimit:a,smooth:c}=this.actualOptions;this.zLayers=s,this._duration=_(o)*G,this._delay=_(r)*G,this._lifeTime=0,this.fpsLimit=a>Bo?a:Fo,this._smooth=c;for(const f of this.effectDrawers.values())await((l=f.init)==null?void 0:l.call(f,this));for(const f of this.shapeDrawers.values())await((u=f.init)==null?void 0:u.call(f,this));for(const f of this.plugins.values())await((h=f.init)==null?void 0:h.call(f));this._engine.dispatchEvent(K.containerInit,{container:this}),await this.particles.init(),this.particles.setDensity();for(const f of this.plugins.values())(d=f.particlesSetup)==null||d.call(f);this._engine.dispatchEvent(K.particlesSetup,{container:this})}async loadTheme(e){L(this)&&(this._currentTheme=e,await this.refresh())}pause(){var e;if(L(this)&&(this._drawAnimationFrame!==void 0&&(ar(this._drawAnimationFrame),delete this._drawAnimationFrame),!this._paused)){for(const i of this.plugins.values())(e=i.pause)==null||e.call(i);this.pageHidden||(this._paused=!0),this._engine.dispatchEvent(K.containerPaused,{container:this})}}play(e){if(!L(this))return;const i=this._paused||e;if(this._firstStart&&!this.actualOptions.autoPlay){this._firstStart=!1;return}if(this._paused&&(this._paused=!1),i)for(const n of this.plugins.values())n.play&&n.play();this._engine.dispatchEvent(K.containerPlay,{container:this}),this.draw(i??!1)}async refresh(){if(L(this))return this.stop(),this.start()}async reset(e){if(L(this))return this._initialSourceOptions=e,this._sourceOptions=e,this._options=st(this._engine,this,this._initialSourceOptions,this.sourceOptions),this.actualOptions=st(this._engine,this,this._options),this.refresh()}async start(){!L(this)||this.started||(await this.init(),this.started=!0,await new Promise(e=>{const i=async()=>{var n;this._eventListeners.addListeners(),this.interactivity.element instanceof HTMLElement&&this._intersectionObserver&&this._intersectionObserver.observe(this.interactivity.element);for(const s of this.plugins.values())await((n=s.start)==null?void 0:n.call(s));this._engine.dispatchEvent(K.containerStarted,{container:this}),this.play(),e()};this._delayTimeout=setTimeout(()=>void i(),this._delay)}))}stop(){var e;if(!(!L(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 i of this.plugins.values())(e=i.stop)==null||e.call(i);for(const i of this.plugins.keys())this.plugins.delete(i);this._sourceOptions=this._options,this._engine.dispatchEvent(K.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 Ba{constructor(){this._listeners=new Map}addEventListener(e,i){this.removeEventListener(e,i);let n=this._listeners.get(e);n||(n=[],this._listeners.set(e,n)),n.push(i)}dispatchEvent(e,i){const n=this._listeners.get(e);n==null||n.forEach(s=>s(i))}hasEventListener(e){return!!this._listeners.get(e)}removeAllEventListeners(e){e?this._listeners.delete(e):this._listeners=new Map}removeEventListener(e,i){const n=this._listeners.get(e);if(!n)return;const s=n.length,o=n.indexOf(i);o<Pi||(s===Yt?this._listeners.delete(e):n.splice(o,Yt))}}async function di(t,e,i,n=!1){let s=e.get(t);return(!s||n)&&(s=await Promise.all([...i.values()].map(o=>o(t))),e.set(t,s)),s}async function qa(t){const e=le(t.url,t.index);if(!e)return t.fallback;const i=await fetch(e);return i.ok?await i.json():(Ze().error(`${ue} ${i.status} while retrieving config file`),t.fallback)}const $a=t=>{let e;if(t instanceof HTMLCanvasElement||t.tagName.toLowerCase()===oi)e=t,e.dataset[We]||(e.dataset[We]=an);else{const n=t.getElementsByTagName(oi);n.length?(e=n[qo],e.dataset[We]=an):(e=document.createElement(oi),e.dataset[We]=us,t.appendChild(e))}const i="100%";return e.style.width||(e.style.width=i),e.style.height||(e.style.height=i),e},Va=(t,e)=>{let i=e??document.getElementById(t);return i||(i=document.createElement("div"),i.id=t,i.dataset[We]=us,document.body.append(i),i)};class Ha{constructor(){this._configs=new Map,this._domArray=[],this._eventDispatcher=new Ba,this._initialized=!1,this.plugins=[],this.colorManagers=new Map,this.easingFunctions=new Map,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.effectDrawers=new Map,this.shapeDrawers=new Map,this.pathGenerators=new Map}get configs(){const e={};for(const[i,n]of this._configs)e[i]=n;return e}get items(){return this._domArray}get version(){return"3.9.1"}async addColorManager(e,i=!0){this.colorManagers.set(e.key,e),await this.refresh(i)}addConfig(e){const i=e.key??e.name??"default";this._configs.set(i,e),this._eventDispatcher.dispatchEvent(K.configAdded,{data:{name:i,config:e}})}async addEasing(e,i,n=!0){this.getEasing(e)||(this.easingFunctions.set(e,i),await this.refresh(n))}async addEffect(e,i,n=!0){re(e,s=>{this.getEffectDrawer(s)||this.effectDrawers.set(s,i)}),await this.refresh(n)}addEventListener(e,i){this._eventDispatcher.addEventListener(e,i)}async addInteractor(e,i,n=!0){this._initializers.interactors.set(e,i),await this.refresh(n)}async addMover(e,i,n=!0){this._initializers.movers.set(e,i),await this.refresh(n)}async addParticleUpdater(e,i,n=!0){this._initializers.updaters.set(e,i),await this.refresh(n)}async addPathGenerator(e,i,n=!0){this.getPathGenerator(e)||this.pathGenerators.set(e,i),await this.refresh(n)}async addPlugin(e,i=!0){this.getPlugin(e.id)||this.plugins.push(e),await this.refresh(i)}async addPreset(e,i,n=!1,s=!0){(n||!this.getPreset(e))&&this.presets.set(e,i),await this.refresh(s)}async addShape(e,i=!0){for(const n of e.validTypes)this.getShapeDrawer(n)||this.shapeDrawers.set(n,e);await this.refresh(i)}checkVersion(e){if(this.version!==e)throw new Error(`The tsParticles version is different from the loaded plugins version. Engine version: ${this.version}. Plugin version: ${e}`)}clearPlugins(e){this.updaters.delete(e),this.movers.delete(e),this.interactors.delete(e)}dispatchEvent(e,i){this._eventDispatcher.dispatchEvent(e,i)}dom(){return this.items}domItem(e){return this.item(e)}async getAvailablePlugins(e){const i=new Map;for(const n of this.plugins)n.needsPlugin(e.actualOptions)&&i.set(n.id,await n.getPlugin(e));return i}getEasing(e){return this.easingFunctions.get(e)??(i=>i)}getEffectDrawer(e){return this.effectDrawers.get(e)}async getInteractors(e,i=!1){return di(e,this.interactors,this._initializers.interactors,i)}async getMovers(e,i=!1){return di(e,this.movers,this._initializers.movers,i)}getPathGenerator(e){return this.pathGenerators.get(e)}getPlugin(e){return this.plugins.find(i=>i.id===e)}getPreset(e){return this.presets.get(e)}getShapeDrawer(e){return this.shapeDrawers.get(e)}getSupportedEffects(){return this.effectDrawers.keys()}getSupportedShapes(){return this.shapeDrawers.keys()}async getUpdaters(e,i=!1){return di(e,this.updaters,this._initializers.updaters,i)}init(){this._initialized||(this._initialized=!0)}item(e){const{items:i}=this,n=i[e];if(!n||n.destroyed){i.splice(e,fs);return}return n}async load(e){var d;const i=e.id??((d=e.element)==null?void 0:d.id)??`tsparticles${Math.floor(E()*$o)}`,{index:n,url:s}=e,o=s?await qa({fallback:e.options,url:s,index:n}):e.options,r=le(o,n),{items:a}=this,c=a.findIndex(f=>f.id.description===i),l=new Fa(this,i,r);if(c>=Vo){const f=this.item(c),p=f?Ho:Nt;f&&!f.destroyed&&f.destroy(!1),a.splice(c,p,l)}else a.push(l);const u=Va(i,e.element),h=$a(u);return l.canvas.loadCanvas(h),await l.start(),l}loadOptions(e,i){this.plugins.forEach(n=>{var s;return(s=n.loadOptions)==null?void 0:s.call(n,e,i)})}loadParticlesOptions(e,i,...n){const s=this.updaters.get(e);s&&s.forEach(o=>{var r;return(r=o.loadOptions)==null?void 0:r.call(o,i,...n)})}async refresh(e=!0){e&&await Promise.all(this.items.map(i=>i.refresh()))}removeEventListener(e,i){this._eventDispatcher.removeEventListener(e,i)}setOnClickHandler(e){const{items:i}=this;if(!i.length)throw new Error(`${ue} can only set click handlers after calling tsParticles.load()`);i.forEach(n=>n.addClickHandler(e))}}function Ua(){const t=new Ha;return t.init(),t}class Ce{constructor(e){this.type=bt.external,this.container=e}}class Vi{constructor(e){this.type=bt.particles,this.container=e}}var pe;(function(t){t.clockwise="clockwise",t.counterClockwise="counter-clockwise",t.random="random"})(pe||(pe={}));var En;(function(t){t.linear="linear",t.radial="radial",t.random="random"})(En||(En={}));var Ye;(function(t){t.easeInBack="ease-in-back",t.easeInCirc="ease-in-circ",t.easeInCubic="ease-in-cubic",t.easeInLinear="ease-in-linear",t.easeInQuad="ease-in-quad",t.easeInQuart="ease-in-quart",t.easeInQuint="ease-in-quint",t.easeInExpo="ease-in-expo",t.easeInSine="ease-in-sine",t.easeOutBack="ease-out-back",t.easeOutCirc="ease-out-circ",t.easeOutCubic="ease-out-cubic",t.easeOutLinear="ease-out-linear",t.easeOutQuad="ease-out-quad",t.easeOutQuart="ease-out-quart",t.easeOutQuint="ease-out-quint",t.easeOutExpo="ease-out-expo",t.easeOutSine="ease-out-sine",t.easeInOutBack="ease-in-out-back",t.easeInOutCirc="ease-in-out-circ",t.easeInOutCubic="ease-in-out-cubic",t.easeInOutLinear="ease-in-out-linear",t.easeInOutQuad="ease-in-out-quad",t.easeInOutQuart="ease-in-out-quart",t.easeInOutQuint="ease-in-out-quint",t.easeInOutExpo="ease-in-out-expo",t.easeInOutSine="ease-in-out-sine"})(Ye||(Ye={}));const Hi=Ua();Ke()||(window.tsParticles=Hi);const Wa=t=>{const e=t.id??"tsparticles";return R.useEffect(()=>{let i;return Hi.load({id:e,url:t.url,options:t.options}).then(n=>{var s;i=n,(s=t.particlesLoaded)==null||s.call(t,n)}),()=>{i==null||i.destroy()}},[e,t,t.url,t.options]),I.jsx("div",{id:e,className:t.className})};async function ja(t){await t(Hi)}const Ti=.5,Ga=2,Ie=0,me=1,In=60,Dn=0,Na=.01,Ya=Math.PI*Ga;function Qa(t){const e=t.initialPosition,{dx:i,dy:n}=J(e,t.position),s=Math.abs(i),o=Math.abs(n),{maxDistance:r}=t.retina,a=r.horizontal,c=r.vertical;if(!a&&!c)return;const l=(a&&s>=a)??!1,u=(c&&o>=c)??!1;if((l||u)&&!t.misplaced)t.misplaced=!!a&&s>a||!!c&&o>c,a&&(t.velocity.x=t.velocity.y*Ti-t.velocity.x),c&&(t.velocity.y=t.velocity.x*Ti-t.velocity.y);else if((!a||s<a)&&(!c||o<c)&&t.misplaced)t.misplaced=!1;else if(t.misplaced){const h=t.position,d=t.velocity;a&&(h.x<e.x&&d.x<Ie||h.x>e.x&&d.x>Ie)&&(d.x*=-E()),c&&(h.y<e.y&&d.y<Ie||h.y>e.y&&d.y>Ie)&&(d.y*=-E())}}function Xa(t,e,i,n,s,o,r){Ka(t,r);const a=t.gravity,c=a!=null&&a.enable&&a.inverse?-me:me;s&&i&&(t.velocity.x+=s*r.factor/(In*i)),a!=null&&a.enable&&i&&(t.velocity.y+=c*(a.acceleration*r.factor)/(In*i));const l=t.moveDecay;t.velocity.multTo(l);const u=t.velocity.mult(i);a!=null&&a.enable&&n>Ie&&(!a.inverse&&u.y>=Ie&&u.y>=n||a.inverse&&u.y<=Ie&&u.y<=-n)&&(u.y=c*n,i&&(t.velocity.y=u.y/i));const h=t.options.zIndex,d=(me-t.zIndexFactor)**h.velocityRate;u.multTo(d),u.multTo(o);const{position:f}=t;f.addTo(u),e.vibrate&&(f.x+=Math.sin(f.x*Math.cos(f.y))*o,f.y+=Math.cos(f.y*Math.sin(f.x))*o)}function Za(t,e,i){const n=t.container;if(!t.spin)return;const s=t.spin.direction===pe.clockwise,o={x:s?Math.cos:Math.sin,y:s?Math.sin:Math.cos};t.position.x=t.spin.center.x+t.spin.radius*o.x(t.spin.angle)*i,t.position.y=t.spin.center.y+t.spin.radius*o.y(t.spin.angle)*i,t.spin.radius+=t.spin.acceleration*i;const r=Math.max(n.canvas.size.width,n.canvas.size.height),a=r*Ti;t.spin.radius>a?(t.spin.radius=a,t.spin.acceleration*=-me):t.spin.radius<Dn&&(t.spin.radius=Dn,t.spin.acceleration*=-me),t.spin.angle+=e*Na*(me-t.spin.radius/r)}function Ka(t,e){var r;const i=t.options,n=i.move.path;if(!n.enable)return;if(t.lastPathTime<=t.pathDelay){t.lastPathTime+=e.value;return}const o=(r=t.pathGenerator)==null?void 0:r.generate(t,e);o&&t.velocity.addTo(o),n.clamp&&(t.velocity.x=he(t.velocity.x,-me,me),t.velocity.y=he(t.velocity.y,-me,me)),t.lastPathTime-=t.pathDelay}function Ja(t){return t.slow.inRange?t.slow.factor:me}function ec(t){const e=t.container,i=t.options,n=i.move.spin;if(!n.enable)return;const s=n.position??{x:50,y:50},o=.01,r={x:s.x*o*e.canvas.size.width,y:s.y*o*e.canvas.size.height},a=t.getPosition(),c=oe(a,r),l=_(n.acceleration);t.retina.spinAcceleration=l*e.retina.pixelRatio,t.spin={center:r,direction:t.velocity.x>=Ie?pe.clockwise:pe.counterClockwise,angle:E()*Ya,radius:c,acceleration:t.retina.spinAcceleration}}const tc=2,ic=1,nc=1;class sc{init(e){const i=e.options,n=i.move.gravity;e.gravity={enable:n.enable,acceleration:_(n.acceleration),inverse:n.inverse},ec(e)}isEnabled(e){return!e.destroyed&&e.options.move.enable}move(e,i){var m,w;const n=e.options,s=n.move;if(!s.enable)return;const o=e.container,r=o.retina.pixelRatio;(m=e.retina).moveSpeed??(m.moveSpeed=_(s.speed)*r),(w=e.retina).moveDrift??(w.moveDrift=_(e.options.move.drift)*r);const a=Ja(e),c=o.retina.reduceFactor,l=e.retina.moveSpeed,u=e.retina.moveDrift,h=_e(n.size.value)*r,d=s.size?e.getRadius()/h:ic,f=i.factor||nc,p=l*d*a*f/tc,y=e.retina.maxSpeed??o.retina.maxSpeed;s.spin.enable?Za(e,p,c):Xa(e,s,p,y,u,c,i),Qa(e)}}async function oc(t,e=!0){t.checkVersion("3.9.1"),await t.addMover("base",()=>Promise.resolve(new sc),e)}const rc=2,ac=Math.PI*rc,cc=0,Ln={x:0,y:0};function lc(t){const{context:e,particle:i,radius:n}=t;i.circleRange||(i.circleRange={min:cc,max:ac});const s=i.circleRange;e.arc(Ln.x,Ln.y,n,s.min,s.max,!1)}const uc=12,hc=360,An=0;class fc{constructor(){this.validTypes=["circle"]}draw(e){lc(e)}getSidesCount(){return uc}particleInit(e,i){const n=i.shapeData,s=(n==null?void 0:n.angle)??{max:hc,min:An};i.circleRange=at(s)?{min:De(s.min),max:De(s.max)}:{min:An,max:De(s)}}}async function dc(t,e=!0){t.checkVersion("3.9.1"),await t.addShape(new fc,e)}class pc{constructor(e,i){this._container=e,this._engine=i}init(e){const i=St(this._engine,e.options.color,e.id,e.options.reduceDuplicates);i&&(e.color=Rs(i,e.options.color.animation,this._container.retina.reduceFactor))}isEnabled(e){const{h:i,s:n,l:s}=e.options.color.animation,{color:o}=e;return!e.destroyed&&!e.spawning&&((o==null?void 0:o.h.value)!==void 0&&i.enable||(o==null?void 0:o.s.value)!==void 0&&n.enable||(o==null?void 0:o.l.value)!==void 0&&s.enable)}update(e,i){Os(e.color,i)}}async function mc(t,e=!0){t.checkVersion("3.9.1"),await t.addParticleUpdater("color",i=>Promise.resolve(new pc(i,t)),e)}var Ue;(function(t){t[t.r=1]="r",t[t.g=2]="g",t[t.b=3]="b",t[t.a=4]="a"})(Ue||(Ue={}));const yc=/^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i,gc=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i,Dt=16,vc=1,bc=255;class wc{constructor(){this.key="hex",this.stringPrefix="#"}handleColor(e){return this._parseString(e.value)}handleRangeColor(e){return this._parseString(e.value)}parseString(e){return this._parseString(e)}_parseString(e){if(typeof e!="string"||!(e!=null&&e.startsWith(this.stringPrefix)))return;const i=e.replace(yc,(s,o,r,a,c)=>o+o+r+r+a+a+(c!==void 0?c+c:"")),n=gc.exec(i);return n?{a:n[Ue.a]!==void 0?parseInt(n[Ue.a],Dt)/bc:vc,b:parseInt(n[Ue.b],Dt),g:parseInt(n[Ue.g],Dt),r:parseInt(n[Ue.r],Dt)}:void 0}}async function xc(t,e=!0){t.checkVersion("3.9.1"),await t.addColorManager(new wc,e)}var ct;(function(t){t[t.h=1]="h",t[t.s=2]="s",t[t.l=3]="l",t[t.a=5]="a"})(ct||(ct={}));class _c{constructor(){this.key="hsl",this.stringPrefix="hsl"}handleColor(e){const i=e.value,n=i.hsl??e.value;if(n.h!==void 0&&n.s!==void 0&&n.l!==void 0)return gt(n)}handleRangeColor(e){const i=e.value,n=i.hsl??e.value;if(n.h!==void 0&&n.l!==void 0)return gt({h:_(n.h),l:_(n.l),s:_(n.s)})}parseString(e){if(!e.startsWith("hsl"))return;const i=/hsla?\(\s*(\d+)\s*[\s,]\s*(\d+)%\s*[\s,]\s*(\d+)%\s*([\s,]\s*(0|1|0?\.\d+|(\d{1,3})%)\s*)?\)/i,n=i.exec(e),s=4,o=1,r=10;return n?Sr({a:n.length>s?vs(n[ct.a]):o,h:parseInt(n[ct.h],r),l:parseInt(n[ct.l],r),s:parseInt(n[ct.s],r)}):void 0}}async function kc(t,e=!0){t.checkVersion("3.9.1"),await t.addColorManager(new _c,e)}class Cc{constructor(e){this.container=e}init(e){const i=e.options.opacity,n=1;e.opacity=ks(i,n);const s=i.animation;s.enable&&(e.opacity.velocity=_(s.speed)/Ee*this.container.retina.reduceFactor,s.sync||(e.opacity.velocity*=E()))}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,i){!this.isEnabled(e)||!e.opacity||Fi(e,e.opacity,!0,e.options.opacity.animation.destroy,i)}}async function Mc(t,e=!0){t.checkVersion("3.9.1"),await t.addParticleUpdater("opacity",i=>Promise.resolve(new Cc(i)),e)}const Xt=0,pt=0;function Pc(t){if(t.outMode!==B.bounce&&t.outMode!==B.split||t.direction!==z.left&&t.direction!==z.right)return;t.bounds.right<pt&&t.direction===z.left?t.particle.position.x=t.size+t.offset.x:t.bounds.left>t.canvasSize.width&&t.direction===z.right&&(t.particle.position.x=t.canvasSize.width-t.size-t.offset.x);const e=t.particle.velocity.x;let i=!1;if(t.direction===z.right&&t.bounds.right>=t.canvasSize.width&&e>Xt||t.direction===z.left&&t.bounds.left<=pt&&e<Xt){const s=_(t.particle.options.bounce.horizontal.value);t.particle.velocity.x*=-s,i=!0}if(!i)return;const n=t.offset.x+t.size;t.bounds.right>=t.canvasSize.width&&t.direction===z.right?t.particle.position.x=t.canvasSize.width-n:t.bounds.left<=pt&&t.direction===z.left&&(t.particle.position.x=n),t.outMode===B.split&&t.particle.destroy()}function zc(t){if(t.outMode!==B.bounce&&t.outMode!==B.split||t.direction!==z.bottom&&t.direction!==z.top)return;t.bounds.bottom<pt&&t.direction===z.top?t.particle.position.y=t.size+t.offset.y:t.bounds.top>t.canvasSize.height&&t.direction===z.bottom&&(t.particle.position.y=t.canvasSize.height-t.size-t.offset.y);const e=t.particle.velocity.y;let i=!1;if(t.direction===z.bottom&&t.bounds.bottom>=t.canvasSize.height&&e>Xt||t.direction===z.top&&t.bounds.top<=pt&&e<Xt){const s=_(t.particle.options.bounce.vertical.value);t.particle.velocity.y*=-s,i=!0}if(!i)return;const n=t.offset.y+t.size;t.bounds.bottom>=t.canvasSize.height&&t.direction===z.bottom?t.particle.position.y=t.canvasSize.height-n:t.bounds.top<=pt&&t.direction===z.top&&(t.particle.position.y=n),t.outMode===B.split&&t.particle.destroy()}class Sc{constructor(e){this.container=e,this.modes=[B.bounce,B.split]}update(e,i,n,s){if(!this.modes.includes(s))return;const o=this.container;let r=!1;for(const d of o.plugins.values())if(d.particleBounce!==void 0&&(r=d.particleBounce(e,n,i)),r)break;if(r)return;const a=e.getPosition(),c=e.offset,l=e.getRadius(),u=Et(a,l),h=o.canvas.size;Pc({particle:e,outMode:s,direction:i,bounds:u,canvasSize:h,offset:c,size:l}),zc({particle:e,outMode:s,direction:i,bounds:u,canvasSize:h,offset:c,size:l})}}const Lt=0;class Rc{constructor(e){this.container=e,this.modes=[B.destroy]}update(e,i,n,s){if(!this.modes.includes(s))return;const o=this.container;switch(e.outType){case ge.normal:case ge.outside:if(Di(e.position,o.canvas.size,V.origin,e.getRadius(),i))return;break;case ge.inside:{const{dx:r,dy:a}=J(e.position,e.moveCenter),{x:c,y:l}=e.velocity;if(c<Lt&&r>e.moveCenter.radius||l<Lt&&a>e.moveCenter.radius||c>=Lt&&r<-e.moveCenter.radius||l>=Lt&&a<-e.moveCenter.radius)return;break}}o.particles.remove(e,e.group,!0)}}const At=0;class Oc{constructor(e){this.container=e,this.modes=[B.none]}update(e,i,n,s){if(!this.modes.includes(s)||((e.options.move.distance.horizontal&&(i===z.left||i===z.right))??(e.options.move.distance.vertical&&(i===z.top||i===z.bottom))))return;const o=e.options.move.gravity,r=this.container,a=r.canvas.size,c=e.getRadius();if(o.enable){const l=e.position;(!o.inverse&&l.y>a.height+c&&i===z.bottom||o.inverse&&l.y<-c&&i===z.top)&&r.particles.remove(e)}else{if(e.velocity.y>At&&e.position.y<=a.height+c||e.velocity.y<At&&e.position.y>=-c||e.velocity.x>At&&e.position.x<=a.width+c||e.velocity.x<At&&e.position.x>=-c)return;Di(e.position,r.canvas.size,V.origin,c,i)||r.particles.remove(e)}}}const Ft=0,Bt=0;class Tc{constructor(e){this.container=e,this.modes=[B.out]}update(e,i,n,s){if(!this.modes.includes(s))return;const o=this.container;switch(e.outType){case ge.inside:{const{x:r,y:a}=e.velocity,c=V.origin;c.length=e.moveCenter.radius,c.angle=e.velocity.angle+Math.PI,c.addTo(V.create(e.moveCenter));const{dx:l,dy:u}=J(e.position,c);if(r<=Ft&&l>=Bt||a<=Ft&&u>=Bt||r>=Ft&&l<=Bt||a>=Ft&&u<=Bt)return;e.position.x=Math.floor(se({min:0,max:o.canvas.size.width})),e.position.y=Math.floor(se({min:0,max:o.canvas.size.height}));const{dx:h,dy:d}=J(e.position,e.moveCenter);e.direction=Math.atan2(-d,-h),e.velocity.angle=e.direction;break}default:{if(Di(e.position,o.canvas.size,V.origin,e.getRadius(),i))return;switch(e.outType){case ge.outside:{e.position.x=Math.floor(se({min:-e.moveCenter.radius,max:e.moveCenter.radius}))+e.moveCenter.x,e.position.y=Math.floor(se({min:-e.moveCenter.radius,max:e.moveCenter.radius}))+e.moveCenter.y;const{dx:r,dy:a}=J(e.position,e.moveCenter);e.moveCenter.radius&&(e.direction=Math.atan2(a,r),e.velocity.angle=e.direction);break}case ge.normal:{const r=e.options.move.warp,a=o.canvas.size,c={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},l=e.getRadius(),u=Et(e.position,l);i===z.right&&u.left>a.width+e.offset.x?(e.position.x=c.left,e.initialPosition.x=e.position.x,r||(e.position.y=E()*a.height,e.initialPosition.y=e.position.y)):i===z.left&&u.right<-e.offset.x&&(e.position.x=c.right,e.initialPosition.x=e.position.x,r||(e.position.y=E()*a.height,e.initialPosition.y=e.position.y)),i===z.bottom&&u.top>a.height+e.offset.y?(r||(e.position.x=E()*a.width,e.initialPosition.x=e.position.x),e.position.y=c.top,e.initialPosition.y=e.position.y):i===z.top&&u.bottom<-e.offset.y&&(r||(e.position.x=E()*a.width,e.initialPosition.x=e.position.x),e.position.y=c.bottom,e.initialPosition.y=e.position.y);break}}break}}}}const Ec=(t,e)=>t.default===e||t.bottom===e||t.left===e||t.right===e||t.top===e;class Ic{constructor(e){this._addUpdaterIfMissing=(i,n,s)=>{const o=i.options.move.outModes;!this.updaters.has(n)&&Ec(o,n)&&this.updaters.set(n,s(this.container))},this._updateOutMode=(i,n,s,o)=>{for(const r of this.updaters.values())r.update(i,o,n,s)},this.container=e,this.updaters=new Map}init(e){this._addUpdaterIfMissing(e,B.bounce,i=>new Sc(i)),this._addUpdaterIfMissing(e,B.out,i=>new Tc(i)),this._addUpdaterIfMissing(e,B.destroy,i=>new Rc(i)),this._addUpdaterIfMissing(e,B.none,i=>new Oc(i))}isEnabled(e){return!e.destroyed&&!e.spawning}update(e,i){const n=e.options.move.outModes;this._updateOutMode(e,i,n.bottom??n.default,z.bottom),this._updateOutMode(e,i,n.left??n.default,z.left),this._updateOutMode(e,i,n.right??n.default,z.right),this._updateOutMode(e,i,n.top??n.default,z.top)}}async function Dc(t,e=!0){t.checkVersion("3.9.1"),await t.addParticleUpdater("outModes",i=>Promise.resolve(new Ic(i)),e)}var lt;(function(t){t[t.r=1]="r",t[t.g=2]="g",t[t.b=3]="b",t[t.a=5]="a"})(lt||(lt={}));class Lc{constructor(){this.key="rgb",this.stringPrefix="rgb"}handleColor(e){const i=e.value,n=i.rgb??e.value;if(n.r!==void 0)return n}handleRangeColor(e){const i=e.value,n=i.rgb??e.value;if(n.r!==void 0)return{r:_(n.r),g:_(n.g),b:_(n.b)}}parseString(e){if(!e.startsWith(this.stringPrefix))return;const i=/rgba?\(\s*(\d{1,3})\s*[\s,]\s*(\d{1,3})\s*[\s,]\s*(\d{1,3})\s*([\s,]\s*(0|1|0?\.\d+|(\d{1,3})%)\s*)?\)/i,n=i.exec(e),s=10;return n?{a:n.length>4?vs(n[lt.a]):1,b:parseInt(n[lt.b],s),g:parseInt(n[lt.g],s),r:parseInt(n[lt.r],s)}:void 0}}async function Ac(t,e=!0){t.checkVersion("3.9.1"),await t.addColorManager(new Lc,e)}const qe=0;class Fc{init(e){const i=e.container,n=e.options.size,s=n.animation;s.enable&&(e.size.velocity=(e.retina.sizeAnimationSpeed??i.retina.sizeAnimationSpeed)/Ee*i.retina.reduceFactor,s.sync||(e.size.velocity*=E()))}isEnabled(e){return!e.destroyed&&!e.spawning&&e.size.enable&&((e.size.maxLoops??qe)<=qe||(e.size.maxLoops??qe)>qe&&(e.size.loops??qe)<(e.size.maxLoops??qe))}reset(e){e.size.loops=qe}update(e,i){this.isEnabled(e)&&Fi(e,e.size,!0,e.options.size.animation.destroy,i)}}async function Bc(t,e=!0){t.checkVersion("3.9.1"),await t.addParticleUpdater("size",()=>Promise.resolve(new Fc),e)}async function qc(t,e=!0){t.checkVersion("3.9.1"),await xc(t,!1),await kc(t,!1),await Ac(t,!1),await oc(t,!1),await dc(t,!1),await mc(t,!1),await Mc(t,!1),await Dc(t,!1),await Bc(t,!1),await t.refresh(e)}async function $c(t,e=!0){t.checkVersion("3.9.1"),await t.addEasing(Ye.easeInQuad,i=>i**2,!1),await t.addEasing(Ye.easeOutQuad,i=>1-(1-i)**2,!1),await t.addEasing(Ye.easeInOutQuad,i=>i<.5?2*i**2:1-(-2*i+2)**2/2,!1),await t.refresh(e)}function Vc(t,e){const{context:i,opacity:n}=t,s=.5,o=i.globalAlpha;if(!e)return;const r=e.width,a=r*s;i.globalAlpha=n,i.drawImage(e,-a,-a,r,r),i.globalAlpha=o}const pi='"Twemoji Mozilla", Apple Color Emoji, "Segoe UI Emoji", "Noto Color Emoji", "EmojiOne Color"',Fn=0;class Hc{constructor(){this.validTypes=["emoji"],this._emojiShapeDict=new Map}destroy(){for(const[e,i]of this._emojiShapeDict)i instanceof ImageBitmap&&(i==null||i.close()),this._emojiShapeDict.delete(e)}draw(e){const i=e.particle.emojiDataKey;if(!i)return;const n=this._emojiShapeDict.get(i);n&&Vc(e,n)}async init(e){const i=e.actualOptions,{validTypes:n}=this;if(!n.find(r=>A(r,i.particles.shape.type)))return;const s=[Cn(pi)],o=n.map(r=>i.particles.shape.options[r]).find(r=>!!r);o&&re(o,r=>{r.font&&s.push(Cn(r.font))}),await Promise.all(s)}particleDestroy(e){e.emojiDataKey=void 0}particleInit(e,i){const s=i.shapeData;if(!(s!=null&&s.value))return;const o=le(s.value,i.randomIndexData);if(!o)return;const r=typeof o=="string"?{font:s.font??pi,padding:s.padding??Fn,value:o}:{font:pi,padding:Fn,...s,...o},a=r.font,c=r.value,l=`${c}_${a}`;if(this._emojiShapeDict.has(l)){i.emojiDataKey=l;return}const u=r.padding*2,h=_e(i.size.value),d=h+u,f=d*2;let p;if(typeof OffscreenCanvas<"u"){const y=new OffscreenCanvas(f,f),m=y.getContext("2d");if(!m)return;m.font=`400 ${h*2}px ${a}`,m.textBaseline="middle",m.textAlign="center",m.fillText(c,d,d),p=y.transferToImageBitmap()}else{const y=document.createElement("canvas");y.width=f,y.height=f;const m=y.getContext("2d");if(!m)return;m.font=`400 ${h*2}px ${a}`,m.textBaseline="middle",m.textAlign="center",m.fillText(c,d,d),p=y}this._emojiShapeDict.set(l,p),i.emojiDataKey=l}}async function Uc(t,e=!0){t.checkVersion("3.9.1"),await t.addShape(new Hc,e)}const Wc=1,jc=1,Fs=0;function Bs(t,e,i,n,s,o){const r=e.actualOptions.interactivity.modes.attract;if(!r)return;const a=e.particles.quadTree.query(s,o);for(const c of a){const{dx:l,dy:u,distance:h}=J(c.position,i),d=r.speed*r.factor,f=he(t.getEasing(r.easing)(jc-h/n)*d,Wc,r.maxSpeed),p=V.create(h?l/h*f:d,h?u/h*f:d);c.position.subFrom(p)}}function Gc(t,e,i){e.attract||(e.attract={particles:[]});const{attract:n}=e;if(n.finish||(n.count||(n.count=0),n.count++,n.count===e.particles.count&&(n.finish=!0)),n.clicking){const s=e.interactivity.mouse.clickPosition,o=e.retina.attractModeDistance;if(!o||o<Fs||!s)return;Bs(t,e,s,o,new Y(s.x,s.y,o),r=>i(r))}else n.clicking===!1&&(n.particles=[])}function Nc(t,e,i){const n=e.interactivity.mouse.position,s=e.retina.attractModeDistance;!s||s<Fs||!n||Bs(t,e,n,s,new Y(n.x,n.y,s),o=>i(o))}class Yc{constructor(){this.distance=200,this.duration=.4,this.easing=Ye.easeOutQuad,this.factor=1,this.maxSpeed=50,this.speed=1}load(e){v(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))}}const Pt="attract";let Qc=class extends Ce{constructor(e,i){super(i),this._engine=e,i.attract||(i.attract={particles:[]}),this.handleClickMode=n=>{const s=this.container.actualOptions,o=s.interactivity.modes.attract;if(!(!o||n!==Pt)){i.attract||(i.attract={particles:[]}),i.attract.clicking=!0,i.attract.count=0;for(const r of i.attract.particles)this.isEnabled(r)&&r.velocity.setTo(r.initialVelocity);i.attract.particles=[],i.attract.finish=!1,setTimeout(()=>{i.destroyed||(i.attract||(i.attract={particles:[]}),i.attract.clicking=!1)},o.duration*G)}}}clear(){}init(){const e=this.container,i=e.actualOptions.interactivity.modes.attract;i&&(e.retina.attractModeDistance=i.distance*e.retina.pixelRatio)}interact(){const e=this.container,i=e.actualOptions,n=e.interactivity.status===Qe,s=i.interactivity.events,{enable:o,mode:r}=s.onHover,{enable:a,mode:c}=s.onClick;n&&o&&A(Pt,r)?Nc(this._engine,this.container,l=>this.isEnabled(l)):a&&A(Pt,c)&&Gc(this._engine,this.container,l=>this.isEnabled(l))}isEnabled(e){const i=this.container,n=i.actualOptions,s=i.interactivity.mouse,o=((e==null?void 0:e.interactivity)??n.interactivity).events;if((!s.position||!o.onHover.enable)&&(!s.clickPosition||!o.onClick.enable))return!1;const r=o.onHover.mode,a=o.onClick.mode;return A(Pt,r)||A(Pt,a)}loadModeOptions(e,...i){e.attract||(e.attract=new Yc);for(const n of i)e.attract.load(n==null?void 0:n.attract)}reset(){}};async function Xc(t,e=!0){t.checkVersion("3.9.1"),await t.addInteractor("externalAttract",i=>Promise.resolve(new Qc(t,i)),e)}const Zc=2,Wt=.5,Kc=Math.PI*Wt,Bn=2,qs=10,Jc=0;function $s(t,e,i,n,s){const o=t.particles.quadTree.query(n,s);for(const r of o)n instanceof Y?xs(Si(r),{position:e,mass:i**Zc*Kc,velocity:V.origin,factor:V.origin}):n instanceof ve&&wr(r,Et(e,i))}function el(t,e,i,n){const s=document.querySelectorAll(e);s.length&&s.forEach(o=>{const r=o,a=t.retina.pixelRatio,c={x:(r.offsetLeft+r.offsetWidth*Wt)*a,y:(r.offsetTop+r.offsetHeight*Wt)*a},l=r.offsetWidth*Wt*a,u=qs*a,h=i.type===vt.circle?new Y(c.x,c.y,l+u):new ve(r.offsetLeft*a-u,r.offsetTop*a-u,r.offsetWidth*a+u*Bn,r.offsetHeight*a+u*Bn);n(c,l,h)})}function tl(t,e,i,n){Ai(i,e,(s,o)=>el(t,s,o,(r,a,c)=>$s(t,r,a,c,n)))}function il(t,e){const i=t.retina.pixelRatio,n=qs*i,s=t.interactivity.mouse.position,o=t.retina.bounceModeDistance;!o||o<Jc||!s||$s(t,s,o,new Y(s.x,s.y,o+n),e)}class nl{constructor(){this.distance=200}load(e){v(e)||e.distance!==void 0&&(this.distance=e.distance)}}const qt="bounce";class sl extends Ce{constructor(e){super(e)}clear(){}init(){const e=this.container,i=e.actualOptions.interactivity.modes.bounce;i&&(e.retina.bounceModeDistance=i.distance*e.retina.pixelRatio)}interact(){const e=this.container,i=e.actualOptions,n=i.interactivity.events,s=e.interactivity.status===Qe,o=n.onHover.enable,r=n.onHover.mode,a=n.onDiv;s&&o&&A(qt,r)?il(this.container,c=>this.isEnabled(c)):tl(this.container,a,qt,c=>this.isEnabled(c))}isEnabled(e){const i=this.container,n=i.actualOptions,s=i.interactivity.mouse,o=((e==null?void 0:e.interactivity)??n.interactivity).events,r=o.onDiv;return!!s.position&&o.onHover.enable&&A(qt,o.onHover.mode)||Li(qt,r)}loadModeOptions(e,...i){e.bounce||(e.bounce=new nl);for(const n of i)e.bounce.load(n==null?void 0:n.bounce)}reset(){}}async function ol(t,e=!0){t.checkVersion("3.9.1"),await t.addInteractor("externalBounce",i=>Promise.resolve(new sl(i)),e)}class Vs{constructor(){this.distance=200,this.duration=.4,this.mix=!1}load(e){if(!v(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 i=ke(this.color)?void 0:this.color;this.color=re(e.color,n=>X.create(i,n))}e.size!==void 0&&(this.size=e.size)}}}class rl extends Vs{constructor(){super(),this.selectors=[]}load(e){super.load(e),!v(e)&&e.selectors!==void 0&&(this.selectors=e.selectors)}}class al extends Vs{load(e){super.load(e),!v(e)&&(this.divs=re(e.divs,i=>{const n=new rl;return n.load(i),n}))}}var xe;(function(t){t.color="color",t.opacity="opacity",t.size="size"})(xe||(xe={}));function qn(t,e,i,n){if(e>=i){const s=t+(e-i)*n;return he(s,t,e)}else if(e<i){const s=t-(i-e)*n;return he(s,e,t)}}const $e="bubble",mi=0,cl=0,ll=2,$n=1,Vn=1,ul=0,hl=0,yi=.5,gi=1;class fl extends Ce{constructor(e,i){super(e),this._clickBubble=()=>{var u;const n=this.container,s=n.actualOptions,o=n.interactivity.mouse.clickPosition,r=s.interactivity.modes.bubble;if(!r||!o)return;n.bubble||(n.bubble={});const a=n.retina.bubbleModeDistance;if(!a||a<mi)return;const c=n.particles.quadTree.queryCircle(o,a,h=>this.isEnabled(h)),{bubble:l}=n;for(const h of c){if(!l.clicking)continue;h.bubble.inRange=!l.durationEnd;const d=h.getPosition(),f=oe(d,o),p=(new Date().getTime()-(n.interactivity.mouse.clickTime??cl))/G;p>r.duration&&(l.durationEnd=!0),p>r.duration*ll&&(l.clicking=!1,l.durationEnd=!1);const y={bubbleObj:{optValue:n.retina.bubbleModeSize,value:h.bubble.radius},particlesObj:{optValue:_e(h.options.size.value)*n.retina.pixelRatio,value:h.size.value},type:xe.size};this._process(h,f,p,y);const m={bubbleObj:{optValue:r.opacity,value:h.bubble.opacity},particlesObj:{optValue:_e(h.options.opacity.value),value:((u=h.opacity)==null?void 0:u.value)??$n},type:xe.opacity};this._process(h,f,p,m),!l.durationEnd&&f<=a?this._hoverBubbleColor(h,f):delete h.bubble.color}},this._hoverBubble=()=>{const n=this.container,s=n.interactivity.mouse.position,o=n.retina.bubbleModeDistance;if(!o||o<mi||!s)return;const r=n.particles.quadTree.queryCircle(s,o,a=>this.isEnabled(a));for(const a of r){a.bubble.inRange=!0;const c=a.getPosition(),l=oe(c,s),u=Vn-l/o;l<=o?u>=hl&&n.interactivity.status===Qe&&(this._hoverBubbleSize(a,u),this._hoverBubbleOpacity(a,u),this._hoverBubbleColor(a,u)):this.reset(a),n.interactivity.status===_i&&this.reset(a)}},this._hoverBubbleColor=(n,s,o)=>{const r=this.container.actualOptions,a=o??r.interactivity.modes.bubble;if(a){if(!n.bubble.finalColor){const c=a.color;if(!c)return;const l=le(c);n.bubble.finalColor=St(this._engine,l)}if(n.bubble.finalColor)if(a.mix){n.bubble.color=void 0;const c=n.getFillColor();n.bubble.color=c?Ps(Bi(c,n.bubble.finalColor,Vn-s,s)):n.bubble.finalColor}else n.bubble.color=n.bubble.finalColor}},this._hoverBubbleOpacity=(n,s,o)=>{var d,f;const r=this.container,a=r.actualOptions,c=(o==null?void 0:o.opacity)??((d=a.interactivity.modes.bubble)==null?void 0:d.opacity);if(!c)return;const l=n.options.opacity.value,u=((f=n.opacity)==null?void 0:f.value)??$n,h=qn(u,c,_e(l),s);h!==void 0&&(n.bubble.opacity=h)},this._hoverBubbleSize=(n,s,o)=>{const r=this.container,a=o!=null&&o.size?o.size*r.retina.pixelRatio:r.retina.bubbleModeSize;if(a===void 0)return;const c=_e(n.options.size.value)*r.retina.pixelRatio,l=n.size.value,u=qn(l,a,c,s);u!==void 0&&(n.bubble.radius=u)},this._process=(n,s,o,r)=>{const a=this.container,c=r.bubbleObj.optValue,l=a.actualOptions,u=l.interactivity.modes.bubble;if(!u||c===void 0)return;const h=u.duration,d=a.retina.bubbleModeDistance,f=r.particlesObj.optValue,p=r.bubbleObj.value,y=r.particlesObj.value??ul,m=r.type;if(!(!d||d<mi||c===f))if(a.bubble||(a.bubble={}),a.bubble.durationEnd)p&&(m===xe.size&&delete n.bubble.radius,m===xe.opacity&&delete n.bubble.opacity);else if(s<=d){if((p??y)!==c){const b=y-o*(y-c)/h;m===xe.size&&(n.bubble.radius=b),m===xe.opacity&&(n.bubble.opacity=b)}}else m===xe.size&&delete n.bubble.radius,m===xe.opacity&&delete n.bubble.opacity},this._singleSelectorHover=(n,s,o)=>{const r=this.container,a=document.querySelectorAll(s),c=r.actualOptions.interactivity.modes.bubble;!c||!a.length||a.forEach(l=>{const u=l,h=r.retina.pixelRatio,d={x:(u.offsetLeft+u.offsetWidth*yi)*h,y:(u.offsetTop+u.offsetHeight*yi)*h},f=u.offsetWidth*yi*h,p=o.type===vt.circle?new Y(d.x,d.y,f):new ve(u.offsetLeft*h,u.offsetTop*h,u.offsetWidth*h,u.offsetHeight*h),y=r.particles.quadTree.query(p,m=>this.isEnabled(m));for(const m of y){if(!p.contains(m.getPosition()))continue;m.bubble.inRange=!0;const w=c.divs,b=ws(w,u);(!m.bubble.div||m.bubble.div!==u)&&(this.clear(m,n,!0),m.bubble.div=u),this._hoverBubbleSize(m,gi,b),this._hoverBubbleOpacity(m,gi,b),this._hoverBubbleColor(m,gi,b)}})},this._engine=i,e.bubble||(e.bubble={}),this.handleClickMode=n=>{n===$e&&(e.bubble||(e.bubble={}),e.bubble.clicking=!0)}}clear(e,i,n){e.bubble.inRange&&!n||(delete e.bubble.div,delete e.bubble.opacity,delete e.bubble.radius,delete e.bubble.color)}init(){const e=this.container,i=e.actualOptions.interactivity.modes.bubble;i&&(e.retina.bubbleModeDistance=i.distance*e.retina.pixelRatio,i.size!==void 0&&(e.retina.bubbleModeSize=i.size*e.retina.pixelRatio))}interact(e){const i=this.container.actualOptions,n=i.interactivity.events,s=n.onHover,o=n.onClick,r=s.enable,a=s.mode,c=o.enable,l=o.mode,u=n.onDiv;r&&A($e,a)?this._hoverBubble():c&&A($e,l)?this._clickBubble():Ai($e,u,(h,d)=>this._singleSelectorHover(e,h,d))}isEnabled(e){const i=this.container,n=i.actualOptions,s=i.interactivity.mouse,o=((e==null?void 0:e.interactivity)??n.interactivity).events,{onClick:r,onDiv:a,onHover:c}=o,l=Li($e,a);return l||c.enable&&s.position||r.enable&&s.clickPosition?A($e,c.mode)||A($e,r.mode)||l:!1}loadModeOptions(e,...i){e.bubble||(e.bubble=new al);for(const n of i)e.bubble.load(n==null?void 0:n.bubble)}reset(e){e.bubble.inRange=!1}}async function dl(t,e=!0){t.checkVersion("3.9.1"),await t.addInteractor("externalBubble",i=>Promise.resolve(new fl(i,t)),e)}class pl{constructor(){this.opacity=.5}load(e){v(e)||e.opacity!==void 0&&(this.opacity=e.opacity)}}class ml{constructor(){this.distance=80,this.links=new pl,this.radius=60}load(e){v(e)||(e.distance!==void 0&&(this.distance=e.distance),this.links.load(e.links),e.radius!==void 0&&(this.radius=e.radius))}}const Hn=0,Un=1,yl=0;function gl(t,e,i,n){const s=Math.floor(i.getRadius()/e.getRadius()),o=e.getFillColor(),r=i.getFillColor();if(!o||!r)return;const a=e.getPosition(),c=i.getPosition(),l=Bi(o,r,e.getRadius(),i.getRadius()),u=t.createLinearGradient(a.x,a.y,c.x,c.y);return u.addColorStop(Hn,Rt(o,n)),u.addColorStop(he(s,Hn,Un),Se(l,n)),u.addColorStop(Un,Rt(r,n)),u}function vl(t,e,i,n,s){zt(t,n,s),t.lineWidth=e,t.strokeStyle=i,t.stroke()}function bl(t,e,i,n){const s=t.actualOptions,o=s.interactivity.modes.connect;if(o)return gl(e,i,n,o.links.opacity)}function wl(t,e,i){t.canvas.draw(n=>{const s=bl(t,n,e,i);if(!s)return;const o=e.getPosition(),r=i.getPosition();vl(n,e.retina.linksWidth??yl,s,o,r)})}const xl="connect",Wn=0;class _l extends Ce{constructor(e){super(e)}clear(){}init(){const e=this.container,i=e.actualOptions.interactivity.modes.connect;i&&(e.retina.connectModeDistance=i.distance*e.retina.pixelRatio,e.retina.connectModeRadius=i.radius*e.retina.pixelRatio)}interact(){const e=this.container;if(e.actualOptions.interactivity.events.onHover.enable&&e.interactivity.status==="pointermove"){const n=e.interactivity.mouse.position,{connectModeDistance:s,connectModeRadius:o}=e.retina;if(!s||s<Wn||!o||o<Wn||!n)return;const r=Math.abs(o),a=e.particles.quadTree.queryCircle(n,r,c=>this.isEnabled(c));a.forEach((c,l)=>{const u=c.getPosition(),h=1;for(const d of a.slice(l+h)){const f=d.getPosition(),p=Math.abs(s),y=Math.abs(u.x-f.x),m=Math.abs(u.y-f.y);y<p&&m<p&&wl(e,c,d)}})}}isEnabled(e){const i=this.container,n=i.interactivity.mouse,s=((e==null?void 0:e.interactivity)??i.actualOptions.interactivity).events;return s.onHover.enable&&n.position?A(xl,s.onHover.mode):!1}loadModeOptions(e,...i){e.connect||(e.connect=new ml);for(const n of i)e.connect.load(n==null?void 0:n.connect)}reset(){}}async function kl(t,e=!0){t.checkVersion("3.9.1"),await t.addInteractor("externalConnect",i=>Promise.resolve(new _l(i)),e)}class Cl{constructor(){this.blink=!1,this.consent=!1,this.opacity=1}load(e){v(e)||(e.blink!==void 0&&(this.blink=e.blink),e.color!==void 0&&(this.color=X.create(this.color,e.color)),e.consent!==void 0&&(this.consent=e.consent),e.opacity!==void 0&&(this.opacity=e.opacity))}}class Ml{constructor(){this.distance=100,this.links=new Cl}load(e){v(e)||(e.distance!==void 0&&(this.distance=e.distance),this.links.load(e.links))}}const Pl=0;function zl(t,e,i,n,s,o){zt(t,i,n),t.strokeStyle=Se(s,o),t.lineWidth=e,t.stroke()}function Sl(t,e,i,n,s){t.canvas.draw(o=>{const r=e.getPosition();zl(o,e.retina.linksWidth??Pl,r,s,i,n)})}const Rl="grab",Ol=0,Tl=0;class El extends Ce{constructor(e,i){super(e),this._engine=i}clear(){}init(){const e=this.container,i=e.actualOptions.interactivity.modes.grab;i&&(e.retina.grabModeDistance=i.distance*e.retina.pixelRatio)}interact(){var a;const e=this.container,i=e.actualOptions,n=i.interactivity;if(!n.modes.grab||!n.events.onHover.enable||e.interactivity.status!==Qe)return;const s=e.interactivity.mouse.position;if(!s)return;const o=e.retina.grabModeDistance;if(!o||o<Ol)return;const r=e.particles.quadTree.queryCircle(s,o,c=>this.isEnabled(c));for(const c of r){const l=c.getPosition(),u=oe(l,s);if(u>o)continue;const h=n.modes.grab.links,d=h.opacity,f=d-u*d/o;if(f<=Tl)continue;const p=h.color??((a=c.options.links)==null?void 0:a.color);if(!e.particles.grabLineColor&&p){const m=n.modes.grab.links;e.particles.grabLineColor=Ss(this._engine,p,m.blink,m.consent)}const y=Oi(c,void 0,e.particles.grabLineColor);y&&Sl(e,c,y,f,s)}}isEnabled(e){const i=this.container,n=i.interactivity.mouse,s=((e==null?void 0:e.interactivity)??i.actualOptions.interactivity).events;return s.onHover.enable&&!!n.position&&A(Rl,s.onHover.mode)}loadModeOptions(e,...i){e.grab||(e.grab=new Ml);for(const n of i)e.grab.load(n==null?void 0:n.grab)}reset(){}}async function Il(t,e=!0){t.checkVersion("3.9.1"),await t.addInteractor("externalGrab",i=>Promise.resolve(new El(i,t)),e)}const Dl="pause";class Ll extends Ce{constructor(e){super(e),this.handleClickMode=i=>{if(i!==Dl)return;const n=this.container;n.animationStatus?n.pause():n.play()}}clear(){}init(){}interact(){}isEnabled(){return!0}reset(){}}async function Al(t,e=!0){t.checkVersion("3.9.1"),await t.addInteractor("externalPause",i=>Promise.resolve(new Ll(i)),e)}class Fl{constructor(){this.default=!0,this.groups=[],this.quantity=4}load(e){if(v(e))return;e.default!==void 0&&(this.default=e.default),e.groups!==void 0&&(this.groups=e.groups.map(n=>n)),this.groups.length||(this.default=!0);const i=e.quantity;i!==void 0&&(this.quantity=S(i)),this.particles=re(e.particles,n=>Q({},n))}}const Bl="push",ql=0;class $l extends Ce{constructor(e){super(e),this.handleClickMode=i=>{if(i!==Bl)return;const n=this.container,s=n.actualOptions,o=s.interactivity.modes.push;if(!o)return;const r=_(o.quantity);if(r<=ql)return;const a=Kt([void 0,...o.groups]),c=a!==void 0?n.actualOptions.particles.groups[a]:void 0,l=le(o.particles),u=Q(c,l);n.particles.push(r,n.interactivity.mouse,u,a)}}clear(){}init(){}interact(){}isEnabled(){return!0}loadModeOptions(e,...i){e.push||(e.push=new Fl);for(const n of i)e.push.load(n==null?void 0:n.push)}reset(){}}async function Vl(t,e=!0){t.checkVersion("3.9.1"),await t.addInteractor("externalPush",i=>Promise.resolve(new $l(i)),e)}class Hl{constructor(){this.quantity=2}load(e){if(v(e))return;const i=e.quantity;i!==void 0&&(this.quantity=S(i))}}const Ul="remove";class Wl extends Ce{constructor(e){super(e),this.handleClickMode=i=>{const n=this.container,s=n.actualOptions;if(!s.interactivity.modes.remove||i!==Ul)return;const o=_(s.interactivity.modes.remove.quantity);n.particles.removeQuantity(o)}}clear(){}init(){}interact(){}isEnabled(){return!0}loadModeOptions(e,...i){e.remove||(e.remove=new Hl);for(const n of i)e.remove.load(n==null?void 0:n.remove)}reset(){}}async function jl(t,e=!0){t.checkVersion("3.9.1"),await t.addInteractor("externalRemove",i=>Promise.resolve(new Wl(i)),e)}class Hs{constructor(){this.distance=200,this.duration=.4,this.factor=100,this.speed=1,this.maxSpeed=50,this.easing=Ye.easeOutQuad}load(e){v(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 Gl extends Hs{constructor(){super(),this.selectors=[]}load(e){super.load(e),!v(e)&&e.selectors!==void 0&&(this.selectors=e.selectors)}}class Nl extends Hs{load(e){super.load(e),!v(e)&&(this.divs=re(e.divs,i=>{const n=new Gl;return n.load(i),n}))}}const Ve="repulse",Yl=0,Ql=6,Xl=3,Zl=2,Kl=0,Jl=0,eu=1,vi=.5;class tu extends Ce{constructor(e,i){super(i),this._clickRepulse=()=>{const n=this.container,s=n.actualOptions.interactivity.modes.repulse;if(!s)return;const o=n.repulse??{particles:[]};if(o.finish||(o.count||(o.count=0),o.count++,o.count===n.particles.count&&(o.finish=!0)),o.clicking){const r=n.retina.repulseModeDistance;if(!r||r<Yl)return;const a=Math.pow(r/Ql,Xl),c=n.interactivity.mouse.clickPosition;if(c===void 0)return;const l=new Y(c.x,c.y,a),u=n.particles.quadTree.query(l,h=>this.isEnabled(h));for(const h of u){const{dx:d,dy:f,distance:p}=J(c,h.position),y=p**Zl,m=s.speed,w=-a*m/y;if(y<=a){o.particles.push(h);const b=V.create(d,f);b.length=w,h.velocity.setTo(b)}}}else if(o.clicking===!1){for(const r of o.particles)r.velocity.setTo(r.initialVelocity);o.particles=[]}},this._hoverRepulse=()=>{const n=this.container,s=n.interactivity.mouse.position,o=n.retina.repulseModeDistance;!o||o<Kl||!s||this._processRepulse(s,o,new Y(s.x,s.y,o))},this._processRepulse=(n,s,o,r)=>{const a=this.container,c=a.particles.quadTree.query(o,m=>this.isEnabled(m)),l=a.actualOptions.interactivity.modes.repulse;if(!l)return;const{easing:u,speed:h,factor:d,maxSpeed:f}=l,p=this._engine.getEasing(u),y=((r==null?void 0:r.speed)??h)*d;for(const m of c){const{dx:w,dy:b,distance:x}=J(m.position,n),g=he(p(eu-x/s)*y,Jl,f),k=V.create(x?w/x*g:y,x?b/x*g:y);m.position.addTo(k)}},this._singleSelectorRepulse=(n,s)=>{const o=this.container,r=o.actualOptions.interactivity.modes.repulse;if(!r)return;const a=document.querySelectorAll(n);a.length&&a.forEach(c=>{const l=c,u=o.retina.pixelRatio,h={x:(l.offsetLeft+l.offsetWidth*vi)*u,y:(l.offsetTop+l.offsetHeight*vi)*u},d=l.offsetWidth*vi*u,f=s.type===vt.circle?new Y(h.x,h.y,d):new ve(l.offsetLeft*u,l.offsetTop*u,l.offsetWidth*u,l.offsetHeight*u),p=r.divs,y=ws(p,l);this._processRepulse(h,d,f,y)})},this._engine=e,i.repulse||(i.repulse={particles:[]}),this.handleClickMode=n=>{const s=this.container.actualOptions,o=s.interactivity.modes.repulse;if(!o||n!==Ve)return;i.repulse||(i.repulse={particles:[]});const r=i.repulse;r.clicking=!0,r.count=0;for(const a of i.repulse.particles)this.isEnabled(a)&&a.velocity.setTo(a.initialVelocity);r.particles=[],r.finish=!1,setTimeout(()=>{i.destroyed||(r.clicking=!1)},o.duration*G)}}clear(){}init(){const e=this.container,i=e.actualOptions.interactivity.modes.repulse;i&&(e.retina.repulseModeDistance=i.distance*e.retina.pixelRatio)}interact(){const e=this.container,i=e.actualOptions,n=e.interactivity.status===Qe,s=i.interactivity.events,o=s.onHover,r=o.enable,a=o.mode,c=s.onClick,l=c.enable,u=c.mode,h=s.onDiv;n&&r&&A(Ve,a)?this._hoverRepulse():l&&A(Ve,u)?this._clickRepulse():Ai(Ve,h,(d,f)=>this._singleSelectorRepulse(d,f))}isEnabled(e){const i=this.container,n=i.actualOptions,s=i.interactivity.mouse,o=((e==null?void 0:e.interactivity)??n.interactivity).events,r=o.onDiv,a=o.onHover,c=o.onClick,l=Li(Ve,r);if(!(l||a.enable&&s.position||c.enable&&s.clickPosition))return!1;const u=a.mode,h=c.mode;return A(Ve,u)||A(Ve,h)||l}loadModeOptions(e,...i){e.repulse||(e.repulse=new Nl);for(const n of i)e.repulse.load(n==null?void 0:n.repulse)}reset(){}}async function iu(t,e=!0){t.checkVersion("3.9.1"),await t.addInteractor("externalRepulse",i=>Promise.resolve(new tu(t,i)),e)}class nu{constructor(){this.factor=3,this.radius=200}load(e){v(e)||(e.factor!==void 0&&(this.factor=e.factor),e.radius!==void 0&&(this.radius=e.radius))}}const su="slow",ou=0;class ru extends Ce{constructor(e){super(e)}clear(e,i,n){e.slow.inRange&&!n||(e.slow.factor=1)}init(){const e=this.container,i=e.actualOptions.interactivity.modes.slow;i&&(e.retina.slowModeRadius=i.radius*e.retina.pixelRatio)}interact(){}isEnabled(e){const i=this.container,n=i.interactivity.mouse,s=((e==null?void 0:e.interactivity)??i.actualOptions.interactivity).events;return s.onHover.enable&&!!n.position&&A(su,s.onHover.mode)}loadModeOptions(e,...i){e.slow||(e.slow=new nu);for(const n of i)e.slow.load(n==null?void 0:n.slow)}reset(e){e.slow.inRange=!1;const i=this.container,n=i.actualOptions,s=i.interactivity.mouse.position,o=i.retina.slowModeRadius,r=n.interactivity.modes.slow;if(!r||!o||o<ou||!s)return;const a=e.getPosition(),c=oe(s,a),l=c/o,u=r.factor,{slow:h}=e;c>o||(h.inRange=!0,h.factor=l/u)}}async function au(t,e=!0){t.checkVersion("3.9.1"),await t.addInteractor("externalSlow",i=>Promise.resolve(new ru(i)),e)}const cu=0,lu=1,uu=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d.]+%?\))|currentcolor/gi;function hu(t,e,i){const{svgData:n}=t;if(!n)return"";const s=Rt(e,i);if(n.includes("fill"))return n.replace(uu,()=>s);const o=n.indexOf(">");return`${n.substring(cu,o)} fill="${s}"${n.substring(o)}`}async function Jt(t){return new Promise(e=>{t.loading=!0;const i=new Image;t.element=i,i.addEventListener("load",()=>{t.loading=!1,e()}),i.addEventListener("error",()=>{t.element=void 0,t.error=!0,t.loading=!1,Ze().error(`${ue} loading image: ${t.source}`),e()}),i.src=t.source})}async function fu(t){if(t.type!=="svg"){await Jt(t);return}t.loading=!0;const e=await fetch(t.source);e.ok?t.svgData=await e.text():(Ze().error(`${ue} Image not found`),t.error=!0),t.loading=!1}function du(t,e,i,n){var r;const s=hu(t,i,((r=n.opacity)==null?void 0:r.value)??lu),o={color:i,gif:e.gif,data:{...t,svgData:s},loaded:!1,ratio:e.width/e.height,replaceColor:e.replaceColor,source:e.src};return new Promise(a=>{const c=new Blob([s],{type:"image/svg+xml"}),l=URL||window.URL||window.webkitURL||window,u=l.createObjectURL(c),h=new Image;h.addEventListener("load",()=>{o.loaded=!0,o.element=h,a(o),l.revokeObjectURL(u)});const d=async()=>{l.revokeObjectURL(u);const f={...t,error:!1,loading:!0};await Jt(f),o.loaded=!0,o.element=f.element,a(o)};h.addEventListener("error",()=>void d()),h.src=u})}const bi=[0,4,2,1],jn=[8,8,4,2];class pu{constructor(e){this.pos=0,this.data=new Uint8ClampedArray(e)}getString(e){const i=this.data.slice(this.pos,this.pos+e);return this.pos+=i.length,i.reduce((n,s)=>n+String.fromCharCode(s),"")}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="",i=0;const n=0,s=0;do{i=this.data[this.pos++];for(let o=i;--o>=n;e+=String.fromCharCode(this.data[this.pos++]));}while(i!==s);return e}readSubBlocksBin(){let e=this.data[this.pos],i=0;const n=0,s=1;for(let r=0;e!==n;r+=e+s,e=this.data[this.pos+r])i+=e;const o=new Uint8Array(i);e=this.data[this.pos++];for(let r=0;e!==n;e=this.data[this.pos++])for(let a=e;--a>=n;o[r++]=this.data[this.pos++]);return o}skipSubBlocks(){for(const e=1,i=0;this.data[this.pos]!==i;this.pos+=this.data[this.pos]+e);this.pos++}}var de;(function(t){t[t.Replace=0]="Replace",t[t.Combine=1]="Combine",t[t.RestoreBackground=2]="RestoreBackground",t[t.RestorePrevious=3]="RestorePrevious",t[t.UndefinedA=4]="UndefinedA",t[t.UndefinedB=5]="UndefinedB",t[t.UndefinedC=6]="UndefinedC",t[t.UndefinedD=7]="UndefinedD"})(de||(de={}));var ze;(function(t){t[t.Extension=33]="Extension",t[t.ApplicationExtension=255]="ApplicationExtension",t[t.GraphicsControlExtension=249]="GraphicsControlExtension",t[t.PlainTextExtension=1]="PlainTextExtension",t[t.CommentExtension=254]="CommentExtension",t[t.Image=44]="Image",t[t.EndOfFile=59]="EndOfFile"})(ze||(ze={}));const ee={x:0,y:0},mu=0,Gn=.5,yu=0,Nn=0,Ei=0;function Us(t,e){const i=[];for(let n=0;n<e;n++)i.push({r:t.data[t.pos],g:t.data[t.pos+1],b:t.data[t.pos+2]}),t.pos+=3;return i}function gu(t,e,i,n){switch(t.nextByte()){case ze.GraphicsControlExtension:{const s=e.frames[i(!1)];t.pos++;const o=t.nextByte();s.GCreserved=(o&224)>>>5,s.disposalMethod=(o&28)>>>2,s.userInputDelayFlag=(o&2)===2;const r=(o&1)===1;s.delayTime=t.nextTwoBytes()*10;const a=t.nextByte();r&&n(a),t.pos++;break}case ze.ApplicationExtension:{t.pos++;const s={identifier:t.getString(8),authenticationCode:t.getString(3),data:t.readSubBlocksBin()};e.applicationExtensions.push(s);break}case ze.CommentExtension:{e.comments.push([i(!1),t.readSubBlocks()]);break}case ze.PlainTextExtension:{if(e.globalColorTable.length===0)throw new EvalError("plain text extension without global color table");t.pos++,e.frames[i(!1)].plainTextData={left:t.nextTwoBytes(),top:t.nextTwoBytes(),width:t.nextTwoBytes(),height:t.nextTwoBytes(),charSize:{width:t.nextTwoBytes(),height:t.nextTwoBytes()},foregroundColor:t.nextByte(),backgroundColor:t.nextByte(),text:t.readSubBlocks()};break}default:t.skipSubBlocks();break}}async function vu(t,e,i,n,s,o){const r=e.frames[n(!0)];r.left=t.nextTwoBytes(),r.top=t.nextTwoBytes(),r.width=t.nextTwoBytes(),r.height=t.nextTwoBytes();const a=t.nextByte(),c=(a&128)===128,l=(a&64)===64;r.sortFlag=(a&32)===32,r.reserved=(a&24)>>>3;const u=1<<(a&7)+1;c&&(r.localColorTable=Us(t,u));const h=w=>{const{r:b,g:x,b:g}=(c?r.localColorTable:e.globalColorTable)[w];return w!==s(null)?{r:b,g:x,b:g,a:255}:{r:b,g:x,b:g,a:i?~~((b+x+g)/3):0}},d=(()=>{try{return new ImageData(r.width,r.height,{colorSpace:"srgb"})}catch(w){if(w instanceof DOMException&&w.name==="IndexSizeError")return null;throw w}})();if(d==null)throw new EvalError("GIF frame size is to large");const f=t.nextByte(),p=t.readSubBlocksBin(),y=1<<f,m=(w,b)=>{const x=w>>>3,g=w&7;return(p[x]+(p[x+1]<<8)+(p[x+2]<<16)&(1<<b)-1<<g)>>>g};if(l){for(let w=0,b=f+1,x=0,g=[[0]],k=0;k<4;k++)if(bi[k]<r.height){let O=0,q=0,W=!1;for(;!W;){const te=w;if(w=m(x,b),x+=b+1,w===y){b=f+1,g.length=y+2;for(let H=0;H<g.length;H++)g[H]=H<y?[H]:[]}else{w>=g.length?g.push(g[te].concat(g[te][0])):te!==y&&g.push(g[te].concat(g[w][0]));for(const H of g[w]){const{r:ae,g:fe,b:D,a:be}=h(H);d.data.set([ae,fe,D,be],bi[k]*r.width+jn[k]*q+O%(r.width*4)),O+=4}g.length===1<<b&&b<12&&b++}O===r.width*4*(q+1)&&(q++,bi[k]+jn[k]*q>=r.height&&(W=!0))}}r.image=d,r.bitmap=await createImageBitmap(d)}else{let w=0,b=f+1,x=0,g=-4,k=!1;const O=[[0]];for(;!k;){const q=w;if(w=m(x,b),x+=b,w===y){b=f+1,O.length=y+2;for(let W=0;W<O.length;W++)O[W]=W<y?[W]:[]}else{if(w===y+1){k=!0;break}w>=O.length?O.push(O[q].concat(O[q][0])):q!==y&&O.push(O[q].concat(O[w][0]));for(const W of O[w]){const{r:te,g:H,b:ae,a:fe}=h(W);d.data.set([te,H,ae,fe],g+=4)}O.length>=1<<b&&b<12&&b++}}r.image=d,r.bitmap=await createImageBitmap(d)}}async function bu(t,e,i,n,s,o){switch(t.nextByte()){case ze.EndOfFile:return!0;case ze.Image:await vu(t,e,i,n,s);break;case ze.Extension:gu(t,e,n,s);break;default:throw new EvalError("undefined block found")}return!1}function wu(t){for(const e of t.applicationExtensions)if(e.identifier+e.authenticationCode==="NETSCAPE2.0")return e.data[1]+(e.data[2]<<8);return NaN}async function xu(t,e,i){i||(i=!1);const n=await fetch(t);if(!n.ok&&n.status===404)throw new EvalError("file not found");const s=await n.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 pu(new Uint8ClampedArray(s));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(),c=(a&128)===128;o.colorRes=(a&112)>>>4,o.sortFlag=(a&8)===8;const l=1<<(a&7)+1,u=r.nextByte();o.pixelAspectRatio=r.nextByte(),o.pixelAspectRatio!==0&&(o.pixelAspectRatio=(o.pixelAspectRatio+15)/64),c&&(o.globalColorTable=Us(r,l));const h=(()=>{try{return new ImageData(o.width,o.height,{colorSpace:"srgb"})}catch(g){if(g instanceof DOMException&&g.name==="IndexSizeError")return null;throw g}})();if(h==null)throw new Error("GIF frame size is to large");const{r:d,g:f,b:p}=o.globalColorTable[u];h.data.set(c?[d,f,p,255]:[0,0,0,0]);for(let g=4;g<h.data.length;g*=2)h.data.copyWithin(g,0,g);o.backgroundImage=h;let y=-1,m=!0,w=-1;const b=g=>(g&&(m=!0),y),x=g=>(g!=null&&(w=g),w);try{do m&&(o.frames.push({left:0,top:0,width:0,height:0,disposalMethod:de.Replace,image:new ImageData(1,1,{colorSpace:"srgb"}),plainTextData:null,userInputDelayFlag:!1,delayTime:0,sortFlag:!1,localColorTable:[],reserved:0,GCreserved:0}),y++,w=-1,m=!1);while(!await bu(r,o,i,b,x,e));o.frames.length--;for(const g of o.frames){if(g.userInputDelayFlag&&g.delayTime===0){o.totalTime=1/0;break}o.totalTime+=g.delayTime}return o}catch(g){throw g instanceof EvalError?new Error(`error while parsing frame ${y} "${g.message}"`):g}}function _u(t){const{context:e,radius:i,particle:n,delta:s}=t,o=n.image;if(!(o!=null&&o.gifData)||!o.gif)return;const r=new OffscreenCanvas(o.gifData.width,o.gifData.height),a=r.getContext("2d");if(!a)throw new Error("could not create offscreen canvas context");a.imageSmoothingQuality="low",a.imageSmoothingEnabled=!1,a.clearRect(ee.x,ee.y,r.width,r.height),n.gifLoopCount===void 0&&(n.gifLoopCount=o.gifLoopCount??Ei);let c=n.gifFrame??mu;const l={x:-o.gifData.width*Gn,y:-o.gifData.height*Gn},u=o.gifData.frames[c];if(n.gifTime===void 0&&(n.gifTime=yu),!!u.bitmap){switch(e.scale(i/o.gifData.width,i/o.gifData.height),u.disposalMethod){case de.UndefinedA:case de.UndefinedB:case de.UndefinedC:case de.UndefinedD:case de.Replace:a.drawImage(u.bitmap,u.left,u.top),e.drawImage(r,l.x,l.y),a.clearRect(ee.x,ee.y,r.width,r.height);break;case de.Combine:a.drawImage(u.bitmap,u.left,u.top),e.drawImage(r,l.x,l.y);break;case de.RestoreBackground:a.drawImage(u.bitmap,u.left,u.top),e.drawImage(r,l.x,l.y),a.clearRect(ee.x,ee.y,r.width,r.height),o.gifData.globalColorTable.length?a.putImageData(o.gifData.backgroundImage,l.x,l.y):a.putImageData(o.gifData.frames[Nn].image,l.x+u.left,l.y+u.top);break;case de.RestorePrevious:{const h=a.getImageData(ee.x,ee.y,r.width,r.height);a.drawImage(u.bitmap,u.left,u.top),e.drawImage(r,l.x,l.y),a.clearRect(ee.x,ee.y,r.width,r.height),a.putImageData(h,ee.x,ee.y)}break}if(n.gifTime+=s.value,n.gifTime>u.delayTime){if(n.gifTime-=u.delayTime,++c>=o.gifData.frames.length){if(--n.gifLoopCount<=Ei)return;c=Nn,a.clearRect(ee.x,ee.y,r.width,r.height)}n.gifFrame=c}e.scale(o.gifData.width/i,o.gifData.height/i)}}async function ku(t){if(t.type!=="gif"){await Jt(t);return}t.loading=!0;try{t.gifData=await xu(t.source),t.gifLoopCount=wu(t.gifData)??Ei,t.gifLoopCount||(t.gifLoopCount=1/0)}catch{t.error=!0}t.loading=!1}const Cu=2,Mu=1,Pu=12,zu=1;class Su{constructor(e){this.validTypes=["image","images"],this.loadImageShape=async i=>{if(!this._engine.loadImage)throw new Error(`${ue} image shape not initialized`);await this._engine.loadImage({gif:i.gif,name:i.name,replaceColor:i.replaceColor??!1,src:i.src})},this._engine=e}addImage(e){this._engine.images||(this._engine.images=[]),this._engine.images.push(e)}draw(e){const{context:i,radius:n,particle:s,opacity:o}=e,r=s.image,a=r==null?void 0:r.element;if(r){if(i.globalAlpha=o,r.gif&&r.gifData)_u(e);else if(a){const c=r.ratio,l={x:-n,y:-n},u=n*Cu;i.drawImage(a,l.x,l.y,u,u/c)}i.globalAlpha=Mu}}getSidesCount(){return Pu}async init(e){const i=e.actualOptions;if(!(!i.preload||!this._engine.loadImage))for(const n of i.preload)await this._engine.loadImage(n)}loadShape(e){if(e.shape!=="image"&&e.shape!=="images")return;this._engine.images||(this._engine.images=[]);const i=e.shapeData;if(!i)return;this._engine.images.find(s=>s.name===i.name||s.source===i.src)||this.loadImageShape(i).then(()=>{this.loadShape(e)})}particleInit(e,i){if(i.shape!=="image"&&i.shape!=="images")return;this._engine.images||(this._engine.images=[]);const n=this._engine.images,s=i.shapeData;if(!s)return;const o=i.getFillColor(),r=n.find(c=>c.name===s.name||c.source===s.src);if(!r)return;const a=s.replaceColor??r.replaceColor;if(r.loading){setTimeout(()=>{this.particleInit(e,i)});return}(async()=>{let c;r.svgData&&o?c=await du(r,s,o,i):c={color:o,data:r,element:r.element,gif:r.gif,gifData:r.gifData,gifLoopCount:r.gifLoopCount,loaded:!0,ratio:s.width&&s.height?s.width/s.height:r.ratio??zu,replaceColor:a,source:s.src},c.ratio||(c.ratio=1);const l=s.fill??i.shapeFill,u=s.close??i.shapeClose,h={image:c,fill:l,close:u};i.image=h.image,i.shapeFill=h.fill,i.shapeClose=h.close})()}}class Ru{constructor(){this.src="",this.gif=!1}load(e){v(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 Ou{constructor(e){this.id="imagePreloader",this._engine=e}async getPlugin(){return await Promise.resolve(),{}}loadOptions(e,i){if(!(i!=null&&i.preload))return;e.preload||(e.preload=[]);const n=e.preload;for(const s of i.preload){const o=n.find(r=>r.name===s.name||r.src===s.src);if(o)o.load(s);else{const r=new Ru;r.load(s),n.push(r)}}}needsPlugin(){return!0}}const Tu=3;function Eu(t){t.loadImage||(t.loadImage=async e=>{if(!e.name&&!e.src)throw new Error(`${ue} no image source provided`);if(t.images||(t.images=[]),!t.images.find(i=>i.name===e.name||i.source===e.src))try{const i={gif:e.gif??!1,name:e.name??e.src,source:e.src,type:e.src.substring(e.src.length-Tu),error:!1,loading:!0,replaceColor:e.replaceColor,ratio:e.width&&e.height?e.width/e.height:void 0};t.images.push(i);let n;e.gif?n=ku:n=e.replaceColor?fu:Jt,await n(i)}catch{throw new Error(`${ue} ${e.name??e.src} not found`)}})}async function Iu(t,e=!0){t.checkVersion("3.9.1"),Eu(t);const i=new Ou(t);await t.addPlugin(i,e),await t.addShape(new Su(t),e)}class Du extends Je{constructor(){super(),this.sync=!1}load(e){v(e)||(super.load(e),e.sync!==void 0&&(this.sync=e.sync))}}class Lu extends Je{constructor(){super(),this.sync=!1}load(e){v(e)||(super.load(e),e.sync!==void 0&&(this.sync=e.sync))}}class Au{constructor(){this.count=0,this.delay=new Du,this.duration=new Lu}load(e){v(e)||(e.count!==void 0&&(this.count=e.count),this.delay.load(e.delay),this.duration.load(e.duration))}}const ot=0,Fu=-1,Yn=0,Qn=0;function Bu(t,e,i){if(!t.life)return;const n=t.life;let s=!1;if(t.spawning)if(n.delayTime+=e.value,n.delayTime>=t.life.delay)s=!0,t.spawning=!1,n.delayTime=ot,n.time=ot;else return;if(n.duration===Fu||t.spawning||(s?n.time=ot:n.time+=e.value,n.time<n.duration))return;if(n.time=ot,t.life.count>Yn&&t.life.count--,t.life.count===Yn){t.destroy();return}const o=S(Qn,i.width),r=S(Qn,i.width);t.position.x=se(o),t.position.y=se(r),t.spawning=!0,n.delayTime=ot,n.time=ot,t.reset();const a=t.options.life;a&&(n.delay=_(a.delay.value)*G,n.duration=_(a.duration.value)*G)}const He=0,Xn=1,Zn=-1;class qu{constructor(e){this.container=e}init(e){const i=this.container,n=e.options,s=n.life;s&&(e.life={delay:i.retina.reduceFactor?_(s.delay.value)*(s.delay.sync?Xn:E())/i.retina.reduceFactor*G:He,delayTime:He,duration:i.retina.reduceFactor?_(s.duration.value)*(s.duration.sync?Xn:E())/i.retina.reduceFactor*G:He,time:He,count:s.count},e.life.duration<=He&&(e.life.duration=Zn),e.life.count<=He&&(e.life.count=Zn),e.life&&(e.spawning=e.life.delay>He))}isEnabled(e){return!e.destroyed}loadOptions(e,...i){e.life||(e.life=new Au);for(const n of i)e.life.load(n==null?void 0:n.life)}update(e,i){!this.isEnabled(e)||!e.life||Bu(e,i,this.container.canvas.size)}}async function $u(t,e=!0){t.checkVersion("3.9.1"),await t.addParticleUpdater("life",async i=>Promise.resolve(new qu(i)),e)}function Vu(t){const{context:e,particle:i,radius:n}=t,s=i.shapeData,o=0;e.moveTo(-n,o),e.lineTo(n,o),e.lineCap=(s==null?void 0:s.cap)??"butt"}const Hu=1;class Uu{constructor(){this.validTypes=["line"]}draw(e){Vu(e)}getSidesCount(){return Hu}}async function Wu(t,e=!0){t.checkVersion("3.9.1"),await t.addShape(new Uu,e)}const Kn=.5;class ju{init(){}isEnabled(e){return!Ke()&&!e.destroyed&&e.container.actualOptions.interactivity.events.onHover.parallax.enable}move(e){const i=e.container,n=i.actualOptions,s=n.interactivity.events.onHover.parallax;if(Ke()||!s.enable)return;const o=s.force,r=i.interactivity.mouse.position;if(!r)return;const a=i.canvas.size,c={x:a.width*Kn,y:a.height*Kn},l=s.smooth,u=e.getRadius()/o,h={x:(r.x-c.x)*u,y:(r.y-c.y)*u},{offset:d}=e;d.x+=(h.x-d.x)/l,d.y+=(h.y-d.y)/l}}async function Gu(t,e=!0){t.checkVersion("3.9.1"),await t.addMover("parallax",()=>Promise.resolve(new ju),e)}const Jn=1e3,Nu=1;class Yu extends Vi{constructor(e){super(e)}clear(){}init(){}interact(e){const i=this.container;e.attractDistance===void 0&&(e.attractDistance=_(e.options.move.attract.distance)*i.retina.pixelRatio);const n=e.attractDistance,s=e.getPosition(),o=i.particles.quadTree.queryCircle(s,n);for(const r of o){if(e===r||!r.options.move.attract.enable||r.destroyed||r.spawning)continue;const a=r.getPosition(),{dx:c,dy:l}=J(s,a),u=e.options.move.attract.rotate,h=c/(u.x*Jn),d=l/(u.y*Jn),f=r.size.value/e.size.value,p=Nu/f;e.velocity.x-=h*f,e.velocity.y-=d*f,r.velocity.x+=h*p,r.velocity.y+=d*p}}isEnabled(e){return e.options.move.attract.enable}reset(){}}async function Qu(t,e=!0){t.checkVersion("3.9.1"),await t.addInteractor("particlesAttract",i=>Promise.resolve(new Yu(i)),e)}const Xu=.5,Zu=10,Ku=0;function es(t,e,i,n,s,o){const r=he(t.options.collisions.absorb.speed*s.factor/Zu,Ku,n);t.size.value+=r*Xu,i.size.value-=r,n<=o&&(i.size.value=0,i.destroy())}function Ju(t,e,i,n){const s=t.getRadius(),o=e.getRadius();s===void 0&&o!==void 0?t.destroy():s!==void 0&&o===void 0?e.destroy():s!==void 0&&o!==void 0&&(s>=o?es(t,s,e,o,i,n):es(e,o,t,s,i,n))}const ts=t=>{t.collisionMaxSpeed===void 0&&(t.collisionMaxSpeed=_(t.options.collisions.maxSpeed)),t.velocity.length>t.collisionMaxSpeed&&(t.velocity.length=t.collisionMaxSpeed)};function Ws(t,e){xs(Si(t),Si(e)),ts(t),ts(e)}function eh(t,e){!t.unbreakable&&!e.unbreakable&&Ws(t,e),t.getRadius()===void 0&&e.getRadius()!==void 0?t.destroy():t.getRadius()!==void 0&&e.getRadius()===void 0?e.destroy():t.getRadius()!==void 0&&e.getRadius()!==void 0&&(t.getRadius()>=e.getRadius()?e:t).destroy()}function th(t,e,i,n){switch(t.options.collisions.mode){case ft.absorb:{Ju(t,e,i,n);break}case ft.bounce:{Ws(t,e);break}case ft.destroy:{eh(t,e);break}}}const ih=2;class nh extends Vi{constructor(e){super(e)}clear(){}init(){}interact(e,i){if(e.destroyed||e.spawning)return;const n=this.container,s=e.getPosition(),o=e.getRadius(),r=n.particles.quadTree.queryCircle(s,o*ih);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 c=a.getPosition(),l=a.getRadius();if(Math.abs(Math.round(s.z)-Math.round(c.z))>o+l)continue;const u=oe(s,c),h=o+l;u>h||th(e,a,i,n.retina.pixelRatio)}}isEnabled(e){return e.options.collisions.enable}reset(){}}async function sh(t,e=!0){t.checkVersion("3.9.1"),await t.addInteractor("particlesCollisions",i=>Promise.resolve(new nh(i)),e)}const wi=2;class oh extends Y{constructor(e,i,n,s){super(e,i,n),this.canvasSize=s,this.canvasSize={...s}}contains(e){const{width:i,height:n}=this.canvasSize,{x:s,y:o}=e;return super.contains(e)||super.contains({x:s-i,y:o})||super.contains({x:s-i,y:o-n})||super.contains({x:s,y:o-n})}intersects(e){if(super.intersects(e))return!0;const i=e,n=e,s={x:e.position.x-this.canvasSize.width,y:e.position.y-this.canvasSize.height};if(n.radius!==void 0){const o=new Y(s.x,s.y,n.radius*wi);return super.intersects(o)}else if(i.size!==void 0){const o=new ve(s.x,s.y,i.size.width*wi,i.size.height*wi);return super.intersects(o)}return!1}}class rh{constructor(){this.blur=5,this.color=new X,this.color.value="#000",this.enable=!1}load(e){v(e)||(e.blur!==void 0&&(this.blur=e.blur),this.color=X.create(this.color,e.color),e.enable!==void 0&&(this.enable=e.enable))}}class ah{constructor(){this.enable=!1,this.frequency=1}load(e){v(e)||(e.color!==void 0&&(this.color=X.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 ch{constructor(){this.blink=!1,this.color=new X,this.color.value="#fff",this.consent=!1,this.distance=100,this.enable=!1,this.frequency=1,this.opacity=1,this.shadow=new rh,this.triangles=new ah,this.width=1,this.warp=!1}load(e){v(e)||(e.id!==void 0&&(this.id=e.id),e.blink!==void 0&&(this.blink=e.blink),this.color=X.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))}}const is=2,lh=1,$t={x:0,y:0},uh=0;function hh(t,e,i,n,s){const{dx:o,dy:r,distance:a}=J(t,e);if(!s||a<=i)return a;const c={x:Math.abs(o),y:Math.abs(r)},l={x:Math.min(c.x,n.width-c.x),y:Math.min(c.y,n.height-c.y)};return Math.sqrt(l.x**is+l.y**is)}class fh extends Vi{constructor(e,i){super(e),this._setColor=n=>{if(!n.options.links)return;const s=this._linkContainer,o=n.options.links;let r=o.id===void 0?s.particles.linksColor:s.particles.linksColors.get(o.id);if(r)return;const a=o.color;r=Ss(this._engine,a,o.blink,o.consent),o.id===void 0?s.particles.linksColor=r:s.particles.linksColors.set(o.id,r)},this._linkContainer=e,this._engine=i}clear(){}init(){this._linkContainer.particles.linksColor=void 0,this._linkContainer.particles.linksColors=new Map}interact(e){if(!e.options.links)return;e.links=[];const i=e.getPosition(),n=this.container,s=n.canvas.size;if(i.x<$t.x||i.y<$t.y||i.x>s.width||i.y>s.height)return;const o=e.options.links,r=o.opacity,a=e.retina.linksDistance??uh,c=o.warp;let l;c?l=new oh(i.x,i.y,a,s):l=new Y(i.x,i.y,a);const u=n.particles.quadTree.query(l);for(const h of u){const d=h.options.links;if(e===h||!(d!=null&&d.enable)||o.id!==d.id||h.spawning||h.destroyed||!h.links||e.links.some(m=>m.destination===h)||h.links.some(m=>m.destination===e))continue;const f=h.getPosition();if(f.x<$t.x||f.y<$t.y||f.x>s.width||f.y>s.height)continue;const p=hh(i,f,a,s,c&&d.warp);if(p>a)continue;const y=(lh-p/a)*r;this._setColor(e),e.links.push({destination:h,opacity:y})}}isEnabled(e){var i;return!!((i=e.options.links)!=null&&i.enable)}loadParticlesOptions(e,...i){e.links||(e.links=new ch);for(const n of i)e.links.load(n==null?void 0:n.links)}reset(){}}async function dh(t,e=!0){await t.addInteractor("particlesLinks",async i=>Promise.resolve(new fh(i,t)),e)}function ph(t,e,i,n){t.beginPath(),t.moveTo(e.x,e.y),t.lineTo(i.x,i.y),t.lineTo(n.x,n.y),t.closePath()}function mh(t){let e=!1;const{begin:i,end:n,engine:s,maxDistance:o,context:r,canvasSize:a,width:c,backgroundMask:l,colorLine:u,opacity:h,links:d}=t;if(oe(i,n)<=o)zt(r,i,n),e=!0;else if(d.warp){let p,y;const m={x:n.x-a.width,y:n.y},w=J(i,m);if(w.distance<=o){const b=i.y-w.dy/w.dx*i.x;p={x:0,y:b},y={x:a.width,y:b}}else{const b={x:n.x,y:n.y-a.height},x=J(i,b);if(x.distance<=o){const k=-(i.y-x.dy/x.dx*i.x)/(x.dy/x.dx);p={x:k,y:0},y={x:k,y:a.height}}else{const g={x:n.x-a.width,y:n.y-a.height},k=J(i,g);if(k.distance<=o){const O=i.y-k.dy/k.dx*i.x;p={x:-O/(k.dy/k.dx),y:O},y={x:p.x+a.width,y:p.y+a.height}}}}p&&y&&(zt(r,i,p),zt(r,n,y),e=!0)}if(!e)return;r.lineWidth=c,l.enable&&(r.globalCompositeOperation=l.composite),r.strokeStyle=Se(u,h);const{shadow:f}=d;if(f.enable){const p=ye(s,f.color);p&&(r.shadowBlur=f.blur,r.shadowColor=Se(p))}r.stroke()}function yh(t){const{context:e,pos1:i,pos2:n,pos3:s,backgroundMask:o,colorTriangle:r,opacityTriangle:a}=t;ph(e,i,n,s),o.enable&&(e.globalCompositeOperation=o.composite),e.fillStyle=Se(r,a),e.fill()}function gh(t){return t.sort((e,i)=>e-i),t.join("_")}function ns(t,e){const i=gh(t.map(s=>s.id));let n=e.get(i);return n===void 0&&(n=E(),e.set(i,n)),n}const ss=0,xi=0,os=0,vh=.5,bh=1;class wh{constructor(e,i){this._drawLinkLine=(n,s)=>{const o=n.options.links;if(!(o!=null&&o.enable))return;const r=this._container,a=r.actualOptions,c=s.destination,l=n.getPosition(),u=c.getPosition();let h=s.opacity;r.canvas.draw(d=>{var b;let f;const p=(b=n.options.twinkle)==null?void 0:b.lines;if(p!=null&&p.enable){const x=p.frequency,g=ye(this._engine,p.color);E()<x&&g&&(f=g,h=_(p.opacity))}if(!f){const x=o.id!==void 0?r.particles.linksColors.get(o.id):r.particles.linksColor;f=Oi(n,c,x)}if(!f)return;const y=n.retina.linksWidth??xi,m=n.retina.linksDistance??os,{backgroundMask:w}=a;mh({context:d,width:y,begin:l,end:u,engine:this._engine,maxDistance:m,canvasSize:r.canvas.size,links:o,backgroundMask:w,colorLine:f,opacity:h})})},this._drawLinkTriangle=(n,s,o)=>{const r=n.options.links;if(!(r!=null&&r.enable))return;const a=r.triangles;if(!a.enable)return;const c=this._container,l=c.actualOptions,u=s.destination,h=o.destination,d=a.opacity??(s.opacity+o.opacity)*vh;d<=ss||c.canvas.draw(f=>{const p=n.getPosition(),y=u.getPosition(),m=h.getPosition(),w=n.retina.linksDistance??os;if(oe(p,y)>w||oe(m,y)>w||oe(m,p)>w)return;let b=ye(this._engine,a.color);if(!b){const x=r.id!==void 0?c.particles.linksColors.get(r.id):c.particles.linksColor;b=Oi(n,u,x)}b&&yh({context:f,pos1:p,pos2:y,pos3:m,backgroundMask:l.backgroundMask,colorTriangle:b,opacityTriangle:d})})},this._drawTriangles=(n,s,o,r)=>{var l,u,h;const a=o.destination;if(!((l=n.links)!=null&&l.triangles.enable&&((u=a.options.links)!=null&&u.triangles.enable)))return;const c=(h=a.links)==null?void 0:h.filter(d=>{const f=this._getLinkFrequency(a,d.destination);return a.options.links&&f<=a.options.links.frequency&&r.findIndex(y=>y.destination===d.destination)>=0});if(c!=null&&c.length)for(const d of c){const f=d.destination;this._getTriangleFrequency(s,a,f)>n.links.triangles.frequency||this._drawLinkTriangle(s,o,d)}},this._getLinkFrequency=(n,s)=>ns([n,s],this._freqs.links),this._getTriangleFrequency=(n,s,o)=>ns([n,s,o],this._freqs.triangles),this._container=e,this._engine=i,this._freqs={links:new Map,triangles:new Map}}drawParticle(e,i){const{links:n,options:s}=i;if(!(n!=null&&n.length))return;const o=n.filter(r=>s.links&&(s.links.frequency>=bh||this._getLinkFrequency(i,r.destination)<=s.links.frequency));for(const r of o)this._drawTriangles(s,i,r,o),r.opacity>ss&&(i.retina.linksWidth??xi)>xi&&this._drawLinkLine(i,r)}async init(){this._freqs.links=new Map,this._freqs.triangles=new Map,await Promise.resolve()}particleCreated(e){if(e.links=[],!e.options.links)return;const i=this._container.retina.pixelRatio,{retina:n}=e,{distance:s,width:o}=e.options.links;n.linksDistance=s*i,n.linksWidth=o*i}particleDestroyed(e){e.links=[]}}class xh{constructor(e){this.id="links",this._engine=e}getPlugin(e){return Promise.resolve(new wh(e,this._engine))}loadOptions(){}needsPlugin(){return!0}}async function _h(t,e=!0){const i=new xh(t);await t.addPlugin(i,e)}async function kh(t,e=!0){t.checkVersion("3.9.1"),await dh(t,e),await _h(t,e)}const Ch=180,Vt={x:0,y:0},Mh=2;function Ph(t,e,i){const{context:n}=t,s=i.count.numerator*i.count.denominator,o=i.count.numerator/i.count.denominator,r=Ch*(o-Mh)/o,a=Math.PI-De(r);if(n){n.beginPath(),n.translate(e.x,e.y),n.moveTo(Vt.x,Vt.y);for(let c=0;c<s;c++)n.lineTo(i.length,Vt.y),n.translate(i.length,Vt.y),n.rotate(a)}}const zh=5;class js{draw(e){const{particle:i,radius:n}=e,s=this.getCenter(i,n),o=this.getSidesData(i,n);Ph(e,s,o)}getSidesCount(e){const i=e.shapeData;return Math.round(_((i==null?void 0:i.sides)??zh))}}const rs=3.5,as=2.66,Sh=3;class Rh extends js{constructor(){super(...arguments),this.validTypes=["polygon"]}getCenter(e,i){return{x:-i/(e.sides/rs),y:-i/(as/rs)}}getSidesData(e,i){const n=e.sides;return{count:{denominator:1,numerator:n},length:i*as/(n/Sh)}}}const Oh=1.66,Th=3,Eh=2;class Ih extends js{constructor(){super(...arguments),this.validTypes=["triangle"]}getCenter(e,i){return{x:-i,y:i/Oh}}getSidesCount(){return Th}getSidesData(e,i){const n=i*Eh;return{count:{denominator:2,numerator:3},length:n}}}async function Dh(t,e=!0){t.checkVersion("3.9.1"),await t.addShape(new Rh,e)}async function Lh(t,e=!0){t.checkVersion("3.9.1"),await t.addShape(new Ih,e)}async function Ah(t,e=!0){t.checkVersion("3.9.1"),await Dh(t,e),await Lh(t,e)}class Fh{constructor(){this.enable=!1,this.speed=0,this.decay=0,this.sync=!1}load(e){v(e)||(e.enable!==void 0&&(this.enable=e.enable),e.speed!==void 0&&(this.speed=S(e.speed)),e.decay!==void 0&&(this.decay=S(e.decay)),e.sync!==void 0&&(this.sync=e.sync))}}class Bh extends Je{constructor(){super(),this.animation=new Fh,this.direction=pe.clockwise,this.path=!1,this.value=0}load(e){v(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))}}const Gs=2,qh=Math.PI*Gs,$h=1,Vh=360;class Hh{constructor(e){this.container=e}init(e){const i=e.options.rotate;if(!i)return;e.rotate={enable:i.animation.enable,value:De(_(i.value)),min:0,max:qh},e.pathRotation=i.path;let n=i.direction;switch(n===pe.random&&(n=Math.floor(E()*Gs)>0?pe.counterClockwise:pe.clockwise),n){case pe.counterClockwise:case"counterClockwise":e.rotate.status=F.decreasing;break;case pe.clockwise:e.rotate.status=F.increasing;break}const s=i.animation;s.enable&&(e.rotate.decay=$h-_(s.decay),e.rotate.velocity=_(s.speed)/Vh*this.container.retina.reduceFactor,s.sync||(e.rotate.velocity*=E())),e.rotation=e.rotate.value}isEnabled(e){const i=e.options.rotate;return i?!e.destroyed&&!e.spawning&&(!!i.value||i.animation.enable||i.path):!1}loadOptions(e,...i){e.rotate||(e.rotate=new Bh);for(const n of i)e.rotate.load(n==null?void 0:n.rotate)}update(e,i){this.isEnabled(e)&&(e.isRotating=!!e.rotate,e.rotate&&(Fi(e,e.rotate,!1,Xe.none,i),e.rotation=e.rotate.value))}}async function Uh(t,e=!0){t.checkVersion("3.9.1"),await t.addParticleUpdater("rotate",i=>Promise.resolve(new Hh(i)),e)}const Wh=2,jh=Math.sqrt(Wh),Gh=2;function Nh(t){const{context:e,radius:i}=t,n=i/jh,s=n*Gh;e.rect(-n,-n,s,s)}const Yh=4;class Qh{constructor(){this.validTypes=["edge","square"]}draw(e){Nh(e)}getSidesCount(){return Yh}}async function Xh(t,e=!0){t.checkVersion("3.9.1"),await t.addShape(new Qh,e)}const Zh=2,rt={x:0,y:0};function Kh(t){const{context:e,particle:i,radius:n}=t,s=i.sides,o=i.starInset??Zh;e.moveTo(rt.x,rt.y-n);for(let r=0;r<s;r++)e.rotate(Math.PI/s),e.lineTo(rt.x,rt.y-n*o),e.rotate(Math.PI/s),e.lineTo(rt.x,rt.y-n)}const Jh=2,ef=5;class tf{constructor(){this.validTypes=["star"]}draw(e){Kh(e)}getSidesCount(e){const i=e.shapeData;return Math.round(_((i==null?void 0:i.sides)??ef))}particleInit(e,i){const n=i.shapeData;i.starInset=_((n==null?void 0:n.inset)??Jh)}}async function nf(t,e=!0){t.checkVersion("3.9.1"),await t.addShape(new tf,e)}const sf=1;class of{constructor(e,i){this._container=e,this._engine=i}init(e){var r;const i=this._container,n=e.options,s=le(n.stroke,e.id,n.reduceDuplicates);e.strokeWidth=_(s.width)*i.retina.pixelRatio,e.strokeOpacity=_(s.opacity??sf),e.strokeAnimation=(r=s.color)==null?void 0:r.animation;const o=St(this._engine,s.color)??e.getFillColor();o&&(e.strokeColor=Rs(o,e.strokeAnimation,i.retina.reduceFactor))}isEnabled(e){const i=e.strokeAnimation,{strokeColor:n}=e;return!e.destroyed&&!e.spawning&&!!i&&((n==null?void 0:n.h.value)!==void 0&&n.h.enable||(n==null?void 0:n.s.value)!==void 0&&n.s.enable||(n==null?void 0:n.l.value)!==void 0&&n.l.enable)}update(e,i){this.isEnabled(e)&&Os(e.strokeColor,i)}}async function rf(t,e=!0){t.checkVersion("3.9.1"),await t.addParticleUpdater("strokeColor",i=>Promise.resolve(new of(i,t)),e)}async function af(t,e=!0){t.checkVersion("3.9.1"),await Gu(t,!1),await Xc(t,!1),await ol(t,!1),await dl(t,!1),await kl(t,!1),await Il(t,!1),await Al(t,!1),await Vl(t,!1),await jl(t,!1),await iu(t,!1),await au(t,!1),await Qu(t,!1),await sh(t,!1),await kh(t,!1),await $c(t,!1),await Uc(t,!1),await Iu(t,!1),await Wu(t,!1),await Ah(t,!1),await Xh(t,!1),await nf(t,!1),await $u(t,!1),await Uh(t,!1),await rf(t,!1),await qc(t,e)}const Re={fullScreen:{enable:!0,zIndex:0},background:{color:{value:"transparent"}},fpsLimit:120,detectRetina:!0},Ns=["#ffb3d9","#f43f5e","#a78bfa","#3b82f6","#10b981","#f59e0b","#ff6b6b","#8b5cf6","#06b6d4","#fb7185"],Ui={id:"starline",name:"星链",icon:"✨",description:"经典粒子连线效果",backgroundGradient:"linear-gradient(180deg, #0f172a 0%, #1e293b 50%, #334155 100%)",options:t=>{const e=Ns;return{...Re,interactivity:{detectsOn:"window",events:{onClick:{enable:!0,mode:"push"},onHover:{enable:!0,mode:"grab"},resize:{enable:!0}},modes:{push:{quantity:2},grab:{distance:200,links:{opacity:1,color:e}}}},particles:{color:{value:e},links:{color:e,distance:150,enable:!0,opacity:.5,width:1},move:{direction:"none",enable:!0,outModes:{default:"out"},random:!1,speed:2,straight:!1},number:{density:{enable:!0,width:1920,height:1080},value:100,limit:{value:130,mode:"delete"}},opacity:{value:.7},shape:{type:"circle"},size:{value:{min:2,max:6}},shadow:{blur:8,color:{value:e},enable:!0,offset:{x:0,y:0}}}}}},Ys={id:"snow",name:"飘雪",icon:"❄️",description:"浪漫飘落雪花",backgroundGradient:"linear-gradient(180deg, #1e3a5f 0%, #2d4a6b 50%, #3d5a7b 100%)",options:t=>({...Re,interactivity:{detectsOn:"window",events:{onHover:{enable:!0,mode:"repulse"},resize:{enable:!0}},modes:{repulse:{distance:100,duration:.4}}},particles:{color:{value:t?"#ffffff":"#87CEEB"},move:{direction:"bottom",enable:!0,outModes:{default:"out"},speed:{min:1,max:3},straight:!1,drift:{min:-.5,max:.5}},number:{density:{enable:!0,width:1920,height:1080},value:80},opacity:{value:{min:.3,max:.8},animation:{enable:!0,speed:1,minimumValue:.3,sync:!1}},shape:{type:"circle"},size:{value:{min:2,max:6}},wobble:{enable:!0,distance:10,speed:{min:-5,max:5}},shadow:{blur:5,color:{value:t?"#ffffff":"#87CEEB"},enable:!0,offset:{x:0,y:0}}}})},Qs={id:"bubble",name:"气泡",icon:"🫧",description:"梦幻上升气泡",backgroundGradient:"linear-gradient(180deg, #0a2647 0%, #144272 50%, #205295 100%)",options:t=>({...Re,interactivity:{detectsOn:"window",events:{onClick:{enable:!0,mode:"pop"},onHover:{enable:!0,mode:"bubble"},resize:{enable:!0}},modes:{bubble:{distance:200,size:15,duration:2,opacity:.8},pop:{}}},particles:{color:{value:t?["#00d9ff","#00ff9d","#ff00e6","#ffee00"]:["#ffb3d9","#ff91c7","#ffc0e5","#ffd6e8"]},move:{direction:"top",enable:!0,outModes:{default:"out"},speed:{min:1,max:2},straight:!1},number:{density:{enable:!0,width:1920,height:1080},value:50},opacity:{value:{min:.2,max:.6},animation:{enable:!0,speed:.5,minimumValue:.1,sync:!1}},shape:{type:"circle"},size:{value:{min:5,max:15},animation:{enable:!0,speed:3,minimumValue:3,sync:!1}},stroke:{width:1,color:{value:t?"rgba(255,255,255,0.3)":"rgba(0,0,0,0.1)"}},shadow:{blur:10,color:{value:t?"#ffb3d9":"#ff91c7"},enable:!0,offset:{x:0,y:0}}}})},Xs={id:"stars",name:"繁星",icon:"⭐",description:"闪烁星空效果",backgroundGradient:"linear-gradient(180deg, #000000 0%, #1a1a2e 50%, #16213e 100%)",options:t=>({...Re,interactivity:{detectsOn:"window",events:{onClick:{enable:!0,mode:"push"},onHover:{enable:!0,mode:"connect"},resize:{enable:!0}},modes:{push:{quantity:1},connect:{distance:100,links:{opacity:.3},radius:150}}},particles:{color:{value:t?["#ffffff","#ffffd4","#ffecd2","#d4f1ff"]:["#ffd700","#ffb347","#ff6b6b","#4ecdc4"]},move:{direction:"none",enable:!0,outModes:{default:"out"},random:!0,speed:.5,straight:!1},number:{density:{enable:!0,width:1920,height:1080},value:120,limit:{value:150,mode:"delete"}},opacity:{value:{min:.2,max:1},animation:{enable:!0,speed:1,minimumValue:.1,sync:!1}},shape:{type:"star",options:{star:{sides:5}}},size:{value:{min:1,max:4}},twinkle:{lines:{enable:!1},particles:{enable:!0,frequency:.05,opacity:1,color:{value:t?"#ffffff":"#ffd700"}}},shadow:{blur:6,color:{value:t?"#ffffff":"#ffd700"},enable:!0,offset:{x:0,y:0}}}})},Zs={id:"firefly",name:"萤火虫",icon:"🪲",description:"温暖的萤火虫光效",backgroundGradient:"linear-gradient(180deg, #1a1a1a 0%, #2d2d2d 50%, #1a1a1a 100%)",options:t=>({...Re,interactivity:{detectsOn:"window",events:{onHover:{enable:!0,mode:"slow"},resize:{enable:!0}},modes:{slow:{factor:3,radius:200}}},particles:{color:{value:t?["#ffff00","#adff2f","#7fff00","#00ff7f"]:["#ffc107","#ff9800","#ff5722","#4caf50"]},move:{direction:"none",enable:!0,outModes:{default:"bounce"},random:!0,speed:1,straight:!1,trail:{enable:!0,length:5,fill:{color:"transparent"}}},number:{density:{enable:!0,width:1920,height:1080},value:40},opacity:{value:{min:.3,max:1},animation:{enable:!0,speed:2,minimumValue:.1,sync:!1}},shape:{type:"circle"},size:{value:{min:2,max:5}},shadow:{blur:15,color:{value:t?"#adff2f":"#ffc107"},enable:!0,offset:{x:0,y:0}}}})},Ks={id:"geometry",name:"几何",icon:"🔷",description:"漂浮的抽象几何图形",backgroundGradient:"linear-gradient(180deg, #0f0c29 0%, #302b63 50%, #24243e 100%)",options:t=>({...Re,interactivity:{detectsOn:"window",events:{onClick:{enable:!0,mode:"push"},onHover:{enable:!0,mode:"repulse"},resize:{enable:!0}},modes:{push:{quantity:1},repulse:{distance:150,duration:.4}}},particles:{color:{value:["#ffb3d9","#ff91c7","#ffc0e5","#ffd6e8"]},move:{direction:"none",enable:!0,outModes:{default:"bounce"},random:!1,speed:1.5,straight:!1},number:{density:{enable:!0,width:1920,height:1080},value:30,limit:{value:60,mode:"delete"}},opacity:{value:{min:.3,max:.7}},rotate:{value:{min:0,max:360},direction:"random",animation:{enable:!0,speed:5}},shape:{type:["triangle","square","polygon"],options:{polygon:{sides:6}}},size:{value:{min:10,max:25}},stroke:{width:1,color:{value:t?"rgba(255,255,255,0.5)":"rgba(0,0,0,0.2)"}},shadow:{blur:10,color:{value:t?"#ffb3d9":"#ff91c7"},enable:!0,offset:{x:2,y:2}}}})},Js={id:"wave",name:"粒子海洋",icon:"🌊",description:"3D 粒子波浪效果(需要 three.js)",isThreeJS:!0,backgroundGradient:"linear-gradient(180deg, #000000 0%, #0a1628 50%, #0d1f3c 100%)",options:()=>({...Re,particles:{number:{value:0}}})},eo={id:"wave2d",name:"轻量波浪",icon:"🌊",description:"轻量级 Canvas 2D 粒子波浪",isThreeJS:!0,options:()=>Re,backgroundGradient:"linear-gradient(180deg, #000000 0%, #0a1628 50%, #0d1f3c 100%)"},Wi=[Ui,Ys,Qs,Xs,Zs,Ks,Js,eo],ji=t=>Wi.find(e=>e.id===t)||Ui,Gi="starline",Ni=R.createContext(null),cs="rpb-theme-id",cf=({defaultTheme:t=Gi,isDark:e=!0,persist:i=!0,children:n})=>{const[s,o]=R.useState(()=>i&&typeof window<"u"&&localStorage.getItem(cs)||t),[r,a]=R.useState(e);R.useEffect(()=>{a(e)},[e]);const c=R.useCallback(l=>{o(l),i&&typeof window<"u"&&localStorage.setItem(cs,l)},[i]);return I.jsx(Ni.Provider,{value:{themeId:s,isDark:r,setTheme:c,setDark:a},children:n})},to=()=>{const t=R.useContext(Ni);if(!t)throw new Error("useParticleTheme must be used within a <ParticleProvider>");return t},lf=()=>R.useContext(Ni),io=({background:t="linear-gradient(180deg, #000000 0%, #0a1628 50%, #0d1f3c 100%)",className:e,style:i})=>{const n=R.useRef(null),s=R.useRef(),o=R.useRef(!0);return R.useEffect(()=>{let r=!1,a;return(async()=>{let c;try{const M=globalThis.require;if(typeof M=="function")c=M("three");else{const C=await import("three");c=C.default??C}}catch{o.current=!1,console.warn('[react-particle-backgrounds] 未安装 "three"。波浪主题需要它作为 peer dependency。');return}if(r||!n.current)return;const l=n.current,u=l.clientWidth,h=l.clientHeight,d=new c.Scene;d.background=null;const f=new c.PerspectiveCamera(75,u/h,.1,1e3);f.position.set(0,50,100),f.lookAt(0,0,0);const p=new c.WebGLRenderer({antialias:!0,alpha:!0});p.setSize(u,h),p.setPixelRatio(Math.min(window.devicePixelRatio,2)),l.appendChild(p.domElement);const y=15e3,m=200,w=100,b=new c.BufferGeometry,x=new Float32Array(y*3),g=new Float32Array(y*3),k=new Float32Array(y);for(let M=0;M<y;M++){const C=M*3;x[C]=(Math.random()-.5)*m,x[C+1]=0,x[C+2]=(Math.random()-.5)*w;const ie=Math.random();ie<.5?(g[C]=0,g[C+1]=.8+Math.random()*.2,g[C+2]=1):ie<.8?(g[C]=.1,g[C+1]=.3+Math.random()*.3,g[C+2]=.9+Math.random()*.1):(g[C]=.8+Math.random()*.2,g[C+1]=.9+Math.random()*.1,g[C+2]=1),k[M]=Math.random()*2+.5}b.setAttribute("position",new c.BufferAttribute(x,3)),b.setAttribute("color",new c.BufferAttribute(g,3)),b.setAttribute("size",new c.BufferAttribute(k,1));const O=`
|
|
2
2
|
attribute float size;
|
|
3
3
|
varying vec3 vColor;
|
|
4
4
|
void main() {
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
gl_PointSize = size * (300.0 / -mvPosition.z);
|
|
8
8
|
gl_Position = projectionMatrix * mvPosition;
|
|
9
9
|
}
|
|
10
|
-
`,
|
|
10
|
+
`,q=`
|
|
11
11
|
varying vec3 vColor;
|
|
12
12
|
void main() {
|
|
13
13
|
float dist = length(gl_PointCoord - vec2(0.5));
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
vec3 finalColor = vColor + glow * 0.5;
|
|
18
18
|
gl_FragColor = vec4(finalColor, alpha * 0.8);
|
|
19
19
|
}
|
|
20
|
-
`,
|
|
20
|
+
`,W=new c.ShaderMaterial({vertexShader:O,fragmentShader:q,transparent:!0,vertexColors:!0,blending:c.AdditiveBlending,depthWrite:!1}),te=new c.Points(b,W);d.add(te);const H=100,ae=new c.BufferGeometry,fe=new Float32Array(H*3),D=new Float32Array(H*3),be=new Float32Array(H);for(let M=0;M<H;M++){const C=M*3;fe[C]=(Math.random()-.5)*m*1.5,fe[C+1]=Math.random()*-30-10,fe[C+2]=(Math.random()-.5)*w*2,D[C]=.2,D[C+1]=.5+Math.random()*.3,D[C+2]=1,be[M]=Math.random()*15+8}ae.setAttribute("position",new c.BufferAttribute(fe,3)),ae.setAttribute("color",new c.BufferAttribute(D,3)),ae.setAttribute("size",new c.BufferAttribute(be,1));const Yi=new c.ShaderMaterial({vertexShader:O,fragmentShader:`
|
|
21
21
|
varying vec3 vColor;
|
|
22
22
|
void main() {
|
|
23
23
|
float dist = length(gl_PointCoord - vec2(0.5));
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
float alpha = 1.0 - smoothstep(0.2, 0.5, dist);
|
|
26
26
|
gl_FragColor = vec4(vColor, alpha * 0.3);
|
|
27
27
|
}
|
|
28
|
-
`,transparent:!0,vertexColors:!0,blending:c.AdditiveBlending,depthWrite:!1}),
|
|
28
|
+
`,transparent:!0,vertexColors:!0,blending:c.AdditiveBlending,depthWrite:!1}),so=new c.Points(ae,Yi);d.add(so);const we=150,Me=12,Oe=[];for(let M=0;M<we;M++){const C=Math.random()<.1,ie=(Math.random()-.5)*m*.9,et=(Math.random()-.5)*w*.7,tt=Math.sin(ie*.05)*8+Math.sin(et*.08)*5,Ct=C?tt+Math.random()*40:-200;Oe.push({x:ie,z:et,y:Ct,velocity:C?.5+Math.random()*.7:0,active:C,maxHeight:tt+80+Math.random()*120,trail:new Array(Me).fill(Ct),opacity:C?1:0})}const ei=we*Me,wt=new c.BufferGeometry,oo=new Float32Array(ei*3),ro=new Float32Array(ei*3),Qi=new Float32Array(ei);for(let M=0;M<we;M++)for(let C=0;C<Me;C++)Qi[M*Me+C]=4*(1-C/Me)*.5;wt.setAttribute("position",new c.BufferAttribute(oo,3)),wt.setAttribute("color",new c.BufferAttribute(ro,3)),wt.setAttribute("size",new c.BufferAttribute(Qi,1));const Xi=new c.ShaderMaterial({vertexShader:O,fragmentShader:`
|
|
29
29
|
varying vec3 vColor;
|
|
30
30
|
void main() {
|
|
31
31
|
float dist = length(gl_PointCoord - vec2(0.5));
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
float alpha = 1.0 - smoothstep(0.0, 0.5, dist);
|
|
34
34
|
gl_FragColor = vec4(vColor, alpha * 0.8);
|
|
35
35
|
}
|
|
36
|
-
`,transparent:!0,vertexColors:!0,blending:c.AdditiveBlending,depthWrite:!1}),xt=new c.Points(wt,Xi);d.add(xt);const _t=new c.BufferGeometry,
|
|
36
|
+
`,transparent:!0,vertexColors:!0,blending:c.AdditiveBlending,depthWrite:!1}),xt=new c.Points(wt,Xi);d.add(xt);const _t=new c.BufferGeometry,ao=new Float32Array(we*3),co=new Float32Array(we*3),Zi=new Float32Array(we);for(let M=0;M<we;M++)Zi[M]=(6+Math.random()*4)*.5;_t.setAttribute("position",new c.BufferAttribute(ao,3)),_t.setAttribute("color",new c.BufferAttribute(co,3)),_t.setAttribute("size",new c.BufferAttribute(Zi,1));const Ki=new c.ShaderMaterial({vertexShader:O,fragmentShader:`
|
|
37
37
|
varying vec3 vColor;
|
|
38
38
|
void main() {
|
|
39
39
|
float dist = length(gl_PointCoord - vec2(0.5));
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
vec3 finalColor = vColor + glow * 0.8;
|
|
44
44
|
gl_FragColor = vec4(finalColor, alpha);
|
|
45
45
|
}
|
|
46
|
-
`,transparent:!0,vertexColors:!0,blending:c.AdditiveBlending,depthWrite:!1}),kt=new c.Points(_t,Ki);d.add(kt);let Fe=0,Ji=0;const en=(C,
|
|
46
|
+
`,transparent:!0,vertexColors:!0,blending:c.AdditiveBlending,depthWrite:!1}),kt=new c.Points(_t,Ki);d.add(kt);let Fe=0,Ji=0;const en=(M,C,ie)=>Math.sin(M*.05+ie)*8+Math.sin(C*.08+ie*.8)*5+Math.sin((M+C)*.03+ie*1.2)*3,ti=M=>{M.x=(Math.random()-.5)*m*.9,M.z=(Math.random()-.5)*w*.7;const C=en(M.x,M.z,Fe);M.y=C,M.velocity=.5+Math.random()*.7,M.maxHeight=C+80+Math.random()*120,M.active=!0,M.opacity=.5,M.trail.fill(C)},tn=()=>{Fe+=.02;const M=te.geometry.attributes.position.array;for(let T=0;T<y;T++){const P=T*3;M[P+1]=en(M[P],M[P+2],Fe)}te.geometry.attributes.position.needsUpdate=!0;const C=xt.geometry.attributes.position.array,ie=xt.geometry.attributes.color.array,et=kt.geometry.attributes.position.array,tt=kt.geometry.attributes.color.array;let Ct=0;const it=[];for(let T=0;T<we;T++){const P=Oe[T];if(P.active){Ct++;for(let Z=Me-1;Z>0;Z--)P.trail[Z]=P.trail[Z-1];P.trail[0]=P.y,P.velocity=Math.max(P.velocity*.995,.3),P.y+=P.velocity,P.opacity<1&&(P.opacity=Math.min(P.opacity+.05,1)),P.y>P.maxHeight&&(P.opacity-=.03,P.opacity<=0&&(P.active=!1,P.y=-200,P.trail.fill(-200),it.push(T)))}else it.push(T)}if(Fe-Ji>=.1&&it.length>0){const T=Math.min(2+Math.floor(Math.random()*2),it.length),P=[...it].sort(()=>Math.random()-.5);for(let Z=0;Z<T;Z++)ti(Oe[P[Z]]);Ji=Fe}const lo=Math.max(3,20-Ct),sn=it.filter(T=>!Oe[T].active);if(sn.length>0){const T=[...sn].sort(()=>Math.random()-.5);for(let P=0;P<Math.min(lo,T.length);P++)ti(Oe[T[P]])}for(let T=0;T<we;T++)!Oe[T].active&&Math.random()<.25&&ti(Oe[T]);for(let T=0;T<we;T++){const P=Oe[T],Z=T*3;et[Z]=P.x,et[Z+1]=P.y,et[Z+2]=P.z;const ii=P.active?.8+Math.sin(Fe*5+T)*.2:0;tt[Z]=.5*ii*P.opacity,tt[Z+1]=1*ii*P.opacity,tt[Z+2]=1*ii*P.opacity;for(let Mt=0;Mt<Me;Mt++){const nt=(T*Me+Mt)*3;C[nt]=P.x,C[nt+1]=P.trail[Mt],C[nt+2]=P.z;const ni=1-Mt/Me;ie[nt]=.6*ni*P.opacity,ie[nt+1]=1*ni*P.opacity,ie[nt+2]=1*ni*P.opacity}}xt.geometry.attributes.position.needsUpdate=!0,xt.geometry.attributes.color.needsUpdate=!0,kt.geometry.attributes.position.needsUpdate=!0,kt.geometry.attributes.color.needsUpdate=!0,f.position.x=Math.sin(Fe*.3)*5,f.lookAt(0,0,0),p.render(d,f),s.current=requestAnimationFrame(tn)};tn();const nn=()=>{const M=l.clientWidth,C=l.clientHeight;f.aspect=M/C,f.updateProjectionMatrix(),p.setSize(M,C)};window.addEventListener("resize",nn),a=()=>{window.removeEventListener("resize",nn),s.current&&cancelAnimationFrame(s.current),p.domElement.parentNode===l&&l.removeChild(p.domElement),b.dispose(),W.dispose(),ae.dispose(),Yi.dispose(),wt.dispose(),Xi.dispose(),_t.dispose(),Ki.dispose(),p.dispose()}})(),()=>{r=!0,a==null||a()}},[t]),I.jsx("div",{ref:n,className:e,style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",zIndex:1,pointerEvents:"none",background:t,...i}})},no=({background:t="linear-gradient(180deg, #000000 0%, #0a1628 50%, #0d1f3c 100%)",className:e,style:i})=>{const n=R.useRef(null),s=R.useRef(),o=R.useRef([]),r=R.useRef(0);return R.useEffect(()=>{const a=n.current;if(!a)return;const c=a.getContext("2d");if(!c)return;const l=()=>{a.width=a.offsetWidth*window.devicePixelRatio,a.height=a.offsetHeight*window.devicePixelRatio,c.scale(window.devicePixelRatio,window.devicePixelRatio)};l();const u=800,h=[];for(let p=0;p<u;p++){const y=Math.random();let m;y<.5?m=`rgba(0, ${Math.floor(200+Math.random()*55)}, 255, `:y<.8?m=`rgba(25, ${Math.floor(76+Math.random()*76)}, ${Math.floor(230+Math.random()*25)}, `:m=`rgba(${Math.floor(200+Math.random()*55)}, ${Math.floor(230+Math.random()*25)}, 255, `,h.push({x:Math.random()*a.offsetWidth,y:Math.random()*a.offsetHeight,z:Math.random()*1e3,vx:(Math.random()-.5)*.5,vy:(Math.random()-.5)*.3,size:Math.random()*2+1,color:m,alpha:Math.random()*.5+.3})}o.current=h;const d=()=>{const p=a.offsetWidth,y=a.offsetHeight;c.clearRect(0,0,p,y),r.current+=.01,h.forEach(m=>{const w=Math.sin(m.x*.01+r.current)*20+Math.sin(m.z*.005+r.current*.5)*15;m.y+=m.vy+Math.sin(r.current+m.x*.01)*.2,m.x+=m.vx,m.z+=.5,(m.x<0||m.x>p)&&(m.vx*=-1),(m.y<0||m.y>y)&&(m.vy*=-1),m.z>1e3&&(m.z=0);const b=1e3/(1e3+m.z),x=m.x,g=m.y+w,k=m.size*b,O=m.alpha*b;if(c.beginPath(),c.arc(x,g,k,0,Math.PI*2),c.fillStyle=m.color+O+")",c.fill(),b>.7){const q=c.createRadialGradient(x,g,0,x,g,k*3);q.addColorStop(0,m.color+O*.3+")"),q.addColorStop(1,m.color+"0)"),c.fillStyle=q,c.fillRect(x-k*3,g-k*3,k*6,k*6)}}),s.current=requestAnimationFrame(d)};d();const f=()=>l();return window.addEventListener("resize",f),()=>{window.removeEventListener("resize",f),s.current&&cancelAnimationFrame(s.current)}},[]),I.jsx("div",{className:e,style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",zIndex:1,pointerEvents:"none",background:t,...i},children:I.jsx("canvas",{ref:n,style:{width:"100%",height:"100%",display:"block"}})})};let ls=0;const uf=({theme:t,isDark:e,onLoaded:i,className:n,style:s})=>{const[o,r]=R.useState(!1),[a,c]=R.useState(()=>++ls),l=R.useRef(void 0),u=R.useRef(!0),h=lf(),d=t??(h==null?void 0:h.themeId)??Gi,f=e??(h==null?void 0:h.isDark)??!0,p=ji(d);R.useEffect(()=>{ja(async b=>{await af(b)}).then(()=>{r(!0)}).catch(()=>{r(!0)})},[]),R.useEffect(()=>(u.current||c(++ls),u.current=!1,()=>{l.current&&(l.current.destroy(),l.current=void 0)}),[d,f]);const y=R.useCallback(async b=>{l.current&&l.current!==b&&l.current.destroy(),l.current=b,i==null||i(b)},[i]),m=R.useMemo(()=>p.options(f),[p,f]);if(d==="none")return null;if(p.isThreeJS){const b=d==="wave2d"?no:io;return I.jsx(b,{background:p.backgroundGradient||p.backgroundColor,className:n,style:s})}if(!o)return null;const w=`rpb-tsparticles-${a}`;return I.jsx(Wa,{id:w,className:n,style:s,particlesLoaded:y,options:m},w)},hf={"bottom-right":{bottom:80,right:16},"bottom-left":{bottom:80,left:16},"top-right":{top:80,right:16},"top-left":{top:80,left:16}},ff={position:"fixed",zIndex:9999,width:44,height:44,borderRadius:12,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(255, 255, 255, 0.7)",backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)",border:"1px solid rgba(255, 255, 255, 0.5)",boxShadow:"0 4px 20px rgba(0, 0, 0, 0.08)",cursor:"pointer",fontSize:20,transition:"transform 0.3s, box-shadow 0.3s"},df={position:"fixed",inset:0,zIndex:1e4,background:"rgba(0, 0, 0, 0.3)",transition:"opacity 0.3s"},pf={position:"fixed",top:0,width:320,maxWidth:"85vw",height:"100vh",zIndex:10001,background:"#fff",boxShadow:"-4px 0 24px rgba(0, 0, 0, 0.12)",transition:"transform 0.3s ease",overflowY:"auto",display:"flex",flexDirection:"column"},mf={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:"1px solid #f0f0f0"},yf={background:"none",border:"none",fontSize:20,cursor:"pointer",color:"#999",padding:4},gf={padding:16,display:"flex",flexDirection:"column",gap:12},vf={padding:"0 16px 16px",marginTop:"auto"},bf={padding:16,background:"#f9fafb",borderRadius:12,fontSize:13,color:"#6b7280",lineHeight:1.6},wf=[...Wi,{id:"none",name:"无",icon:"🚫",description:"关闭粒子效果"}],xf=({position:t="bottom-right",accentColor:e="#3b82f6"})=>{const[i,n]=R.useState(!1),{themeId:s,setTheme:o}=to(),r=ji(s),a=t.includes("right")?"right":"left",c=R.useMemo(()=>({...ff,...hf[t]}),[t]),l=R.useMemo(()=>({...pf,[a]:0,transform:i?"translateX(0)":`translateX(${a==="right"?"100%":"-100%"})`}),[a,i]),u=R.useCallback(()=>n(!0),[]),h=R.useCallback(()=>n(!1),[]),d=R.useCallback(f=>{o(f)},[o]);return I.jsxs(I.Fragment,{children:[I.jsx("style",{children:`
|
|
47
47
|
.rpb-trigger-button:hover {
|
|
48
48
|
transform: scale(1.05) translateY(-2px);
|
|
49
49
|
}
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
.rpb-theme-item.active:hover {
|
|
54
54
|
border-color: ${e} !important;
|
|
55
55
|
}
|
|
56
|
-
`}),
|
|
56
|
+
`}),I.jsx("button",{className:"rpb-trigger-button",onClick:u,title:"主题设置",style:c,children:r.icon}),i&&I.jsx("div",{onClick:h,style:df}),I.jsxs("div",{style:l,children:[I.jsxs("div",{style:mf,children:[I.jsx("span",{style:{fontWeight:600,fontSize:16},children:"粒子主题"}),I.jsx("button",{onClick:h,style:yf,children:"×"})]}),I.jsx("div",{style:gf,children:wf.map(f=>{const p=f.id===s;return I.jsxs("div",{className:`rpb-theme-item${p?" active":""}`,onClick:()=>d(f.id),style:{padding:16,borderRadius:12,cursor:"pointer",display:"flex",alignItems:"center",gap:12,transition:"all 0.2s",border:`2px solid ${p?e:"transparent"}`,background:p?`${e}10`:"#f5f5f5"},children:[I.jsx("div",{style:{width:48,height:48,borderRadius:12,display:"flex",alignItems:"center",justifyContent:"center",fontSize:24,background:p?e:"#e5e5e5",flexShrink:0},children:f.icon}),I.jsxs("div",{style:{flex:1,minWidth:0},children:[I.jsx("div",{style:{fontWeight:600,fontSize:14,color:"#1f2937"},children:f.name}),I.jsx("div",{style:{fontSize:12,color:"#9ca3af",marginTop:2},children:f.description})]}),p&&I.jsx("div",{style:{width:24,height:24,borderRadius:"50%",background:e,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:I.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#fff",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:I.jsx("path",{d:"M5 13l4 4L19 7"})})})]},f.id)})}),I.jsx("div",{style:vf,children:I.jsx("div",{style:bf,children:"你的主题选择会自动保存,下次访问时将自动恢复。"})})]})]})};exports.DEFAULT_COLORS=Ns;exports.DEFAULT_THEME_ID=Gi;exports.ParticleProvider=cf;exports.ParticleWave=io;exports.ParticleWave2D=no;exports.ParticlesBackground=uf;exports.ThemeSelector=xf;exports.baseConfig=Re;exports.bubbleTheme=Qs;exports.fireflyTheme=Zs;exports.geometryTheme=Ks;exports.getThemeById=ji;exports.particleThemes=Wi;exports.snowTheme=Ys;exports.starlineTheme=Ui;exports.starsTheme=Xs;exports.useParticleTheme=to;exports.wave2dTheme=eo;exports.waveTheme=Js;
|
|
57
57
|
//# sourceMappingURL=index.js.map
|