@tsparticles/preset-fireworks 4.0.0-beta.15 → 4.0.0-beta.16

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsparticles/preset-fireworks",
3
- "version": "4.0.0-beta.15",
3
+ "version": "4.0.0-beta.16",
4
4
  "description": "tsParticles fireworks preset",
5
5
  "homepage": "https://particles.js.org",
6
6
  "repository": {
@@ -106,16 +106,16 @@
106
106
  "./package.json": "./package.json"
107
107
  },
108
108
  "dependencies": {
109
- "@tsparticles/basic": "4.0.0-beta.15",
110
- "@tsparticles/effect-trail": "4.0.0-beta.15",
111
- "@tsparticles/engine": "4.0.0-beta.15",
112
- "@tsparticles/plugin-emitters": "4.0.0-beta.15",
113
- "@tsparticles/plugin-emitters-shape-square": "4.0.0-beta.15",
114
- "@tsparticles/plugin-sounds": "4.0.0-beta.15",
115
- "@tsparticles/shape-line": "4.0.0-beta.15",
116
- "@tsparticles/updater-destroy": "4.0.0-beta.15",
117
- "@tsparticles/updater-life": "4.0.0-beta.15",
118
- "@tsparticles/updater-rotate": "4.0.0-beta.15"
109
+ "@tsparticles/basic": "4.0.0-beta.16",
110
+ "@tsparticles/effect-trail": "4.0.0-beta.16",
111
+ "@tsparticles/engine": "4.0.0-beta.16",
112
+ "@tsparticles/plugin-emitters": "4.0.0-beta.16",
113
+ "@tsparticles/plugin-emitters-shape-square": "4.0.0-beta.16",
114
+ "@tsparticles/plugin-sounds": "4.0.0-beta.16",
115
+ "@tsparticles/shape-line": "4.0.0-beta.16",
116
+ "@tsparticles/updater-destroy": "4.0.0-beta.16",
117
+ "@tsparticles/updater-life": "4.0.0-beta.16",
118
+ "@tsparticles/updater-rotate": "4.0.0-beta.16"
119
119
  },
120
120
  "publishConfig": {
121
121
  "access": "public"
@@ -1,5 +1,5 @@
1
1
  (function(g){g.__tsParticlesInternals=g.__tsParticlesInternals||{};g.__tsParticlesInternals.bundles=g.__tsParticlesInternals.bundles||{};g.__tsParticlesInternals.effects=g.__tsParticlesInternals.effects||{};g.__tsParticlesInternals.engine=g.__tsParticlesInternals.engine||{};g.__tsParticlesInternals.interactions=g.__tsParticlesInternals.interactions||{};g.__tsParticlesInternals.palettes=g.__tsParticlesInternals.palettes||{};g.__tsParticlesInternals.paths=g.__tsParticlesInternals.paths||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins.emittersShapes=g.__tsParticlesInternals.plugins.emittersShapes||{};g.__tsParticlesInternals.presets=g.__tsParticlesInternals.presets||{};g.__tsParticlesInternals.shapes=g.__tsParticlesInternals.shapes||{};g.__tsParticlesInternals.updaters=g.__tsParticlesInternals.updaters||{};g.__tsParticlesInternals.utils=g.__tsParticlesInternals.utils||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas.utils=g.__tsParticlesInternals.canvas.utils||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path.utils=g.__tsParticlesInternals.path.utils||{};var __tsProxyFactory=typeof Proxy!=="undefined"?function(obj){return new Proxy(obj,{get:function(target,key){if(!(key in target)){target[key]={};}return target[key];}});}:function(obj){return obj;};g.__tsParticlesInternals.bundles=__tsProxyFactory(g.__tsParticlesInternals.bundles);g.__tsParticlesInternals.effects=__tsProxyFactory(g.__tsParticlesInternals.effects);g.__tsParticlesInternals.interactions=__tsProxyFactory(g.__tsParticlesInternals.interactions);g.__tsParticlesInternals.palettes=__tsProxyFactory(g.__tsParticlesInternals.palettes);g.__tsParticlesInternals.paths=__tsProxyFactory(g.__tsParticlesInternals.paths);g.__tsParticlesInternals.plugins=__tsProxyFactory(g.__tsParticlesInternals.plugins);g.__tsParticlesInternals.plugins.emittersShapes=__tsProxyFactory(g.__tsParticlesInternals.plugins.emittersShapes);g.__tsParticlesInternals.presets=__tsProxyFactory(g.__tsParticlesInternals.presets);g.__tsParticlesInternals.shapes=__tsProxyFactory(g.__tsParticlesInternals.shapes);g.__tsParticlesInternals.updaters=__tsProxyFactory(g.__tsParticlesInternals.updaters);g.__tsParticlesInternals.utils=__tsProxyFactory(g.__tsParticlesInternals.utils);g.__tsParticlesInternals.canvas=__tsProxyFactory(g.__tsParticlesInternals.canvas);g.__tsParticlesInternals.path=__tsProxyFactory(g.__tsParticlesInternals.path);g.tsparticlesInternalExports=g.tsparticlesInternalExports||{};})(typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:this);
2
- /* Preset v4.0.0-beta.15 */
2
+ /* Preset v4.0.0-beta.16 */
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
5
5
  typeof define === 'function' && define.amd ? define(['exports'], factory) :
@@ -1021,7 +1021,7 @@
1021
1021
  return this._domArray;
1022
1022
  }
1023
1023
  get version() {
1024
- return "4.0.0-beta.15";
1024
+ return "4.0.0-beta.16";
1025
1025
  }
1026
1026
  addEventListener(type, listener) {
1027
1027
  this._eventDispatcher.addEventListener(type, listener);
@@ -3129,7 +3129,7 @@
3129
3129
  }
3130
3130
 
3131
3131
  async function loadCircleShape(engine) {
3132
- engine.checkVersion("4.0.0-beta.15");
3132
+ engine.checkVersion("4.0.0-beta.16");
3133
3133
  await engine.pluginManager.register(e => {
3134
3134
  e.pluginManager.addShape(["circle"], () => {
3135
3135
  return Promise.resolve(new CircleDrawer());
@@ -3177,7 +3177,7 @@
3177
3177
  }
3178
3178
 
3179
3179
  async function loadHexColorPlugin(engine) {
3180
- engine.checkVersion("4.0.0-beta.15");
3180
+ engine.checkVersion("4.0.0-beta.16");
3181
3181
  await engine.pluginManager.register(e => {
3182
3182
  e.pluginManager.addColorManager("hex", new HexColorManager());
3183
3183
  });
@@ -3230,7 +3230,7 @@
3230
3230
  }
3231
3231
 
3232
3232
  async function loadHslColorPlugin(engine) {
3233
- engine.checkVersion("4.0.0-beta.15");
3233
+ engine.checkVersion("4.0.0-beta.16");
3234
3234
  await engine.pluginManager.register(e => {
3235
3235
  e.pluginManager.addColorManager("hsl", new HslColorManager());
3236
3236
  });
@@ -3254,7 +3254,7 @@
3254
3254
  }
3255
3255
 
3256
3256
  async function loadMovePlugin(engine) {
3257
- engine.checkVersion("4.0.0-beta.15");
3257
+ engine.checkVersion("4.0.0-beta.16");
3258
3258
  await engine.pluginManager.register(e => {
3259
3259
  const moveEngine = e, movePluginManager = moveEngine.pluginManager;
3260
3260
  movePluginManager.initializers.pathGenerators ??= new Map();
@@ -3315,7 +3315,7 @@
3315
3315
  }
3316
3316
 
3317
3317
  async function loadOpacityUpdater(engine) {
3318
- engine.checkVersion("4.0.0-beta.15");
3318
+ engine.checkVersion("4.0.0-beta.16");
3319
3319
  await engine.pluginManager.register(e => {
3320
3320
  e.pluginManager.addParticleUpdater("opacity", container => {
3321
3321
  return Promise.resolve(new OpacityUpdater(container));
@@ -3667,7 +3667,7 @@
3667
3667
  }
3668
3668
 
3669
3669
  async function loadOutModesUpdater(engine) {
3670
- engine.checkVersion("4.0.0-beta.15");
3670
+ engine.checkVersion("4.0.0-beta.16");
3671
3671
  await engine.pluginManager.register(e => {
3672
3672
  e.pluginManager.addParticleUpdater("outModes", container => {
3673
3673
  return Promise.resolve(new OutOfCanvasUpdater(container));
@@ -3738,7 +3738,7 @@
3738
3738
  }
3739
3739
 
3740
3740
  async function loadPaintUpdater(engine) {
3741
- engine.checkVersion("4.0.0-beta.15");
3741
+ engine.checkVersion("4.0.0-beta.16");
3742
3742
  await engine.pluginManager.register(e => {
3743
3743
  e.pluginManager.addParticleUpdater("paint", container => {
3744
3744
  return Promise.resolve(new PaintUpdater(e.pluginManager, container));
@@ -3793,7 +3793,7 @@
3793
3793
  }
3794
3794
 
3795
3795
  async function loadRgbColorPlugin(engine) {
3796
- engine.checkVersion("4.0.0-beta.15");
3796
+ engine.checkVersion("4.0.0-beta.16");
3797
3797
  await engine.pluginManager.register(e => {
3798
3798
  e.pluginManager.addColorManager("rgb", new RgbColorManager());
3799
3799
  });
@@ -3836,7 +3836,7 @@
3836
3836
  }
3837
3837
 
3838
3838
  async function loadSizeUpdater(engine) {
3839
- engine.checkVersion("4.0.0-beta.15");
3839
+ engine.checkVersion("4.0.0-beta.16");
3840
3840
  await engine.pluginManager.register(e => {
3841
3841
  e.pluginManager.addParticleUpdater("size", container => {
3842
3842
  return Promise.resolve(new SizeUpdater(container));
@@ -3845,7 +3845,7 @@
3845
3845
  }
3846
3846
 
3847
3847
  async function loadBasic(engine) {
3848
- engine.checkVersion("4.0.0-beta.15");
3848
+ engine.checkVersion("4.0.0-beta.16");
3849
3849
  await engine.pluginManager.register(async (e) => {
3850
3850
  await Promise.all([
3851
3851
  loadHexColorPlugin(e),
@@ -4214,7 +4214,7 @@
4214
4214
  }
4215
4215
 
4216
4216
  async function loadDestroyUpdater(engine) {
4217
- engine.checkVersion("4.0.0-beta.15");
4217
+ engine.checkVersion("4.0.0-beta.16");
4218
4218
  await engine.pluginManager.register(e => {
4219
4219
  e.pluginManager.addParticleUpdater("destroy", container => {
4220
4220
  return Promise.resolve(new DestroyUpdater(e.pluginManager, container));
@@ -4507,7 +4507,7 @@
4507
4507
  })(EmitterClickMode || (EmitterClickMode = {}));
4508
4508
 
4509
4509
  async function loadEmittersPluginSimple(engine) {
4510
- engine.checkVersion("4.0.0-beta.15");
4510
+ engine.checkVersion("4.0.0-beta.16");
4511
4511
  await engine.pluginManager.register(async (e) => {
4512
4512
  const instancesManager = await getEmittersInstancesManager(e);
4513
4513
  await addEmittersShapesManager(e);
@@ -4595,7 +4595,7 @@
4595
4595
  }
4596
4596
 
4597
4597
  async function loadEmittersShapeSquare(engine) {
4598
- engine.checkVersion("4.0.0-beta.15");
4598
+ engine.checkVersion("4.0.0-beta.16");
4599
4599
  await engine.pluginManager.register((e) => {
4600
4600
  ensureEmittersPluginLoaded(e);
4601
4601
  e.pluginManager.addEmitterShapeGenerator?.("square", new EmittersSquareShapeGenerator());
@@ -4761,7 +4761,7 @@
4761
4761
  }
4762
4762
 
4763
4763
  async function loadLifeUpdater(engine) {
4764
- engine.checkVersion("4.0.0-beta.15");
4764
+ engine.checkVersion("4.0.0-beta.16");
4765
4765
  await engine.pluginManager.register(e => {
4766
4766
  e.pluginManager.addParticleUpdater("life", container => {
4767
4767
  return Promise.resolve(new LifeUpdater(container));
@@ -4787,7 +4787,7 @@
4787
4787
  }
4788
4788
 
4789
4789
  async function loadLineShape(engine) {
4790
- engine.checkVersion("4.0.0-beta.15");
4790
+ engine.checkVersion("4.0.0-beta.16");
4791
4791
  await engine.pluginManager.register(e => {
4792
4792
  e.pluginManager.addShape(["line"], () => Promise.resolve(new LineDrawer()));
4793
4793
  });
@@ -4919,7 +4919,7 @@
4919
4919
  }
4920
4920
 
4921
4921
  async function loadRotateUpdater(engine) {
4922
- engine.checkVersion("4.0.0-beta.15");
4922
+ engine.checkVersion("4.0.0-beta.16");
4923
4923
  await engine.pluginManager.register(e => {
4924
4924
  e.pluginManager.addParticleUpdater("rotate", container => {
4925
4925
  return Promise.resolve(new RotateUpdater(container));
@@ -5300,7 +5300,7 @@
5300
5300
  }
5301
5301
 
5302
5302
  async function loadSoundsPlugin(engine) {
5303
- engine.checkVersion("4.0.0-beta.15");
5303
+ engine.checkVersion("4.0.0-beta.16");
5304
5304
  await engine.pluginManager.register(e => {
5305
5305
  e.pluginManager.addPlugin(new SoundsPlugin(e));
5306
5306
  });
@@ -5383,7 +5383,7 @@
5383
5383
  }
5384
5384
 
5385
5385
  async function loadTrailEffect(engine) {
5386
- engine.checkVersion("4.0.0-beta.15");
5386
+ engine.checkVersion("4.0.0-beta.16");
5387
5387
  await engine.pluginManager.register(e => {
5388
5388
  e.pluginManager.addEffect("trail", container => {
5389
5389
  return Promise.resolve(new TrailDrawer(container));
@@ -1 +1 @@
1
- !function(t){t.__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.bundles=t.__tsParticlesInternals.bundles||{},t.__tsParticlesInternals.effects=t.__tsParticlesInternals.effects||{},t.__tsParticlesInternals.engine=t.__tsParticlesInternals.engine||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},t.__tsParticlesInternals.palettes=t.__tsParticlesInternals.palettes||{},t.__tsParticlesInternals.paths=t.__tsParticlesInternals.paths||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins.emittersShapes=t.__tsParticlesInternals.plugins.emittersShapes||{},t.__tsParticlesInternals.presets=t.__tsParticlesInternals.presets||{},t.__tsParticlesInternals.shapes=t.__tsParticlesInternals.shapes||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.utils=t.__tsParticlesInternals.utils||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas.utils=t.__tsParticlesInternals.canvas.utils||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path.utils=t.__tsParticlesInternals.path.utils||{};var e="undefined"!=typeof Proxy?function(t){return new Proxy(t,{get:function(t,e){return e in t||(t[e]={}),t[e]}})}:function(t){return t};t.__tsParticlesInternals.bundles=e(t.__tsParticlesInternals.bundles),t.__tsParticlesInternals.effects=e(t.__tsParticlesInternals.effects),t.__tsParticlesInternals.interactions=e(t.__tsParticlesInternals.interactions),t.__tsParticlesInternals.palettes=e(t.__tsParticlesInternals.palettes),t.__tsParticlesInternals.paths=e(t.__tsParticlesInternals.paths),t.__tsParticlesInternals.plugins=e(t.__tsParticlesInternals.plugins),t.__tsParticlesInternals.plugins.emittersShapes=e(t.__tsParticlesInternals.plugins.emittersShapes),t.__tsParticlesInternals.presets=e(t.__tsParticlesInternals.presets),t.__tsParticlesInternals.shapes=e(t.__tsParticlesInternals.shapes),t.__tsParticlesInternals.updaters=e(t.__tsParticlesInternals.updaters),t.__tsParticlesInternals.utils=e(t.__tsParticlesInternals.utils),t.__tsParticlesInternals.canvas=e(t.__tsParticlesInternals.canvas),t.__tsParticlesInternals.path=e(t.__tsParticlesInternals.path),t.tsparticlesInternalExports=t.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.presets=t.__tsParticlesInternals.presets||{},t.__tsParticlesInternals.presets.fireworks=t.__tsParticlesInternals.presets.fireworks||{}))}(this,function(t){"use strict";const e="generated",i=100,s=.5,n=1e3,a={x:0,y:0,z:0},o=1,r=0,l=0,c=1,h="random",d=2*Math.PI,u="true",p="false",f="canvas",g=255,m=360,_=100,y=100,v=.25;var w;function b(t){return"z"in t?t.z:a.z}!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"}(w||(w={}));class x{x;y;z;constructor(t=a.x,e=a.y,i=a.z){this.x=t,this.y=e,this.z=i}static get origin(){return x.create(a.x,a.y,a.z)}get angle(){return Math.atan2(this.y,this.x)}set angle(t){this._updateFromAngle(t,this.length)}get length(){return Math.sqrt(this.getLengthSq())}set length(t){this._updateFromAngle(this.angle,t)}static clone(t){return x.create(t.x,t.y,b(t))}static create(t,e,i){return"number"==typeof t?new x(t,e??a.y,i??a.z):new x(t.x,t.y,b(t))}add(t){return x.create(this.x+t.x,this.y+t.y,this.z+b(t))}addTo(t){this.x+=t.x,this.y+=t.y,this.z+=b(t)}copy(){return x.clone(this)}div(t){return x.create(this.x/t,this.y/t,this.z/t)}divTo(t){this.x/=t,this.y/=t,this.z/=t}getLengthSq(){return this.x**2+this.y**2}mult(t){return x.create(this.x*t,this.y*t,this.z*t)}multTo(t){this.x*=t,this.y*=t,this.z*=t}normalize(){const t=this.length;0!=t&&this.multTo(1/t)}rotate(t){return x.create(this.x*Math.cos(t)-this.y*Math.sin(t),this.x*Math.sin(t)+this.y*Math.cos(t),a.z)}setTo(t){this.x=t.x,this.y=t.y,this.z=b(t)}sub(t){return x.create(this.x-t.x,this.y-t.y,this.z-b(t))}subFrom(t){this.x-=t.x,this.y-=t.y,this.z-=b(t)}_updateFromAngle(t,e){this.x=Math.cos(t)*e,this.y=Math.sin(t)*e}}class P extends x{constructor(t=a.x,e=a.y){super(t,e,a.z)}static get origin(){return P.create(a.x,a.y)}static clone(t){return P.create(t.x,t.y)}static create(t,e){return"number"==typeof t?new P(t,e??a.y):new P(t.x,t.y)}}function z(t){return"boolean"==typeof t}function M(t){return"string"==typeof t}function C(t){return"number"==typeof t}function S(t){return"object"==typeof t&&null!==t}function k(t){return Array.isArray(t)}function O(t){return null==t}const I=Math.PI/180;let D=Math.random;const R=t=>requestAnimationFrame(t),E=t=>{cancelAnimationFrame(t)};function F(){return T(D(),0,1-Number.EPSILON)}function L(t,e){return F()*(e-t)+t}function T(t,e,i){return Math.min(Math.max(t,e),i)}function A(t){const e=B(t);let i=V(t);return e===i&&(i=0),L(i,e)}function U(t){return C(t)?t:A(t)}function V(t){return C(t)?t:t.min}function B(t){return C(t)?t:t.max}function G(t,e){if(t===e||void 0===e&&C(t))return t;const i=V(t),s=B(t);return void 0!==e?{min:Math.min(i,e),max:Math.max(s,e)}:G(i,s)}function W(t,e){const i=t.x-e.x,s=t.y-e.y;return{dx:i,dy:s,distance:Math.hypot(i,s)}}function $(t,e){const i=t.x-e.x,s=t.y-e.y;return i*i+s*s}function q(t){return t*I}function N(t){const e={x:void 0!==t.position?.x?U(t.position.x):void 0,y:void 0!==t.position?.y?U(t.position.y):void 0};return function(t){return{x:(t.position?.x??F()*i)*t.size.width/i,y:(t.position?.y??F()*i)*t.size.height/i}}({size:t.size,position:e})}function j(t){const{position:e,size:i}=t;return{x:e?.x??F()*i.width,y:e?.y??F()*i.height}}function Z(t){return t?t.endsWith("%")?parseFloat(t)/i:parseFloat(t):1}var H,Q,X,Y,J,K;!function(t){t.auto="auto",t.increase="increase",t.decrease="decrease",t.random="random"}(H||(H={})),function(t){t.increasing="increasing",t.decreasing="decreasing"}(Q||(Q={})),function(t){t.none="none",t.max="max",t.min="min"}(X||(X={})),function(t){t.bottom="bottom",t.left="left",t.right="right",t.top="top"}(Y||(Y={})),function(t){t.precise="precise",t.percent="percent"}(J||(J={})),function(t){t.max="max",t.min="min",t.random="random"}(K||(K={}));function tt(){return globalThis.document}function et(t){if("undefined"!=typeof matchMedia)return matchMedia(t)}function it(t,e,i=!0){return t[void 0!==e&&i?e%t.length:function(t){return Math.floor(F()*t.length)}(t)]}function st(t,e,i,s,n){return function(t,e,i,s){let n=!0;s&&s!==Y.bottom||(n=t.top<e.height+i.x);!n||s&&s!==Y.left||(n=t.right>i.x);!n||s&&s!==Y.right||(n=t.left<e.width+i.y);!n||s&&s!==Y.top||(n=t.bottom>i.y);return n}(nt(t,s??0),e,i,n)}function nt(t,e){return{bottom:t.y+e,left:t.x-e,right:t.x+e,top:t.y-e}}function at(t,...e){for(const i of e){if(O(i))continue;if(!S(i)){t=i;continue}Array.isArray(i)?Array.isArray(t)||(t=[]):S(t)&&!Array.isArray(t)||(t={});const e=Object.keys(i),s=new Set(["__proto__","constructor","prototype"]);if(!e.some(t=>{const e=i[t];return S(e)||Array.isArray(e)})){const n=i,a=t;for(const t of e)if(!s.has(t)&&t in n){const e=n[t];void 0!==e&&(a[t]=e)}continue}for(const n of e){if(s.has(n))continue;const e=t,a=i[n];e[n]=Array.isArray(a)?a.map(t=>at(void 0,t)):at(e[n],a)}}return t}function ot(t,e){return k(t)?t.map((t,i)=>e(t,i)):e(t,0)}function rt(t,e,i){return k(t)?it(t,e,i):t}function lt(t,e){const i=t.value,a=t.animation,o={delayTime:U(a.delay)*n,enable:a.enable,value:U(t.value)*e,max:B(i)*e,min:V(i)*e,loops:0,maxLoops:U(a.count),time:0};if(a.enable){switch(o.decay=1-U(a.decay),a.mode){case H.increase:o.status=Q.increasing;break;case H.decrease:o.status=Q.decreasing;break;case H.random:o.status=F()>=s?Q.increasing:Q.decreasing}const t=a.mode===H.auto;switch(a.startValue){case K.min:o.value=o.min,t&&(o.status=Q.increasing);break;case K.max:o.value=o.max,t&&(o.status=Q.decreasing);break;case K.random:default:o.value=A(o),t&&(o.status=F()>=s?Q.increasing:Q.decreasing)}}return o.initialValue=o.value,o}function ct(t,e){if(!(t.mode===J.percent)){const{mode:e,...i}=t;return i}return"x"in t?{x:t.x/i*e.width,y:t.y/i*e.height}:{width:t.width/i*e.width,height:t.height/i*e.height}}function ht(t,e){return ct(t,e)}function dt(t,e){return ct(t,e)}function ut(t,e,i,s,n){if(t.destroyed||!e.enable||(e.maxLoops??0)>0&&(e.loops??0)>(e.maxLoops??0))return;const a=(e.velocity??0)*n.factor,o=e.min,r=e.max,l=e.decay??1;if(e.time??=0,(e.delayTime??0)>0&&e.time<(e.delayTime??0)&&(e.time+=n.value),!((e.delayTime??0)>0&&e.time<(e.delayTime??0))){switch(e.status){case Q.increasing:e.value+=a;break;case Q.decreasing:e.value-=a}switch(e.velocity&&1!==l&&(e.velocity*=l),e.status){case Q.increasing:e.value>=r&&(i?e.status=Q.decreasing:e.value-=r,e.loops??=0,e.loops++);break;case Q.decreasing:e.value<=o&&(i?e.status=Q.increasing:e.value+=r,e.loops??=0,e.loops++)}!function(t,e,i,s,n){switch(e){case X.max:i>=n&&t.destroy();break;case X.min:i<=s&&t.destroy()}}(t,s,e.value,o,r),t.destroyed||(e.value=T(e.value,o,r))}}const pt=function(t){const e=new Map,i=(t,e=new WeakSet)=>{if(null===t)return"null";const s=typeof t;if("undefined"===s)return"undefined";if("number"===s||"boolean"===s||"string"===s)return JSON.stringify(t);if("function"===s)try{return t.toString()}catch{return'"[Function]"'}if("symbol"===s)try{return t.toString()}catch{return'"[Symbol]"'}if(Array.isArray(t))return`[${t.map(t=>i(t,e)).join(",")}]`;if(e.has(t))return'"[Circular]"';e.add(t);return`{${Object.keys(t).sort().map(s=>`${JSON.stringify(s)}:${i(t[s],e)}`).join(",")}}`},s=t=>(t=>i(t))(t);return(...i)=>{const n=s(i),a=Date.now(),o=e.get(n);if(void 0!==o)return e.delete(n),e.set(n,{value:o.value,ts:o.ts}),o.value;const r=t(...i);return e.set(n,{value:r,ts:a}),r}}(function(t){const e=tt().createElement("div").style,i={width:"100%",height:"100%",margin:"0",padding:"0",borderWidth:"0",position:"fixed",zIndex:t.toString(10),"z-index":t.toString(10),top:"0",left:"0","pointer-events":"none"};for(const t in i){const s=i[t];void 0!==s&&e.setProperty(t,s)}return e});function ft(t,e,i,s,n){if(s){let s={passive:!0};z(n)?s.capture=n:void 0!==n&&(s=n),t.addEventListener(e,i,s)}else{const s=n;t.removeEventListener(e,i,s)}}async function gt(t,e,i,s=!1){let n=e.get(t);if(!n||s){const s=await Promise.all([...i.entries()].map(([e,i])=>i(t).then(t=>[e,t])));n=new Map(s),e.set(t,n)}return n}class mt{_listeners;constructor(){this._listeners=new Map}addEventListener(t,e){this.removeEventListener(t,e);let i=this._listeners.get(t);i||(i=[],this._listeners.set(t,i)),i.push(e)}dispatchEvent(t,e){const i=this._listeners.get(t);i?.forEach(t=>{t(e)})}hasEventListener(t){return!!this._listeners.get(t)}removeAllEventListeners(t){t?this._listeners.delete(t):this._listeners=new Map}removeEventListener(t,e){const i=this._listeners.get(t);if(!i)return;const s=i.length,n=i.indexOf(e);n<0||(1===s?this._listeners.delete(t):i.splice(n,1))}}var _t;!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"}(_t||(_t={}));class yt{colorManagers=new Map;easingFunctions=new Map;effectDrawers=new Map;initializers={effects:new Map,shapes:new Map,updaters:new Map};palettes=new Map;plugins=[];presets=new Map;shapeDrawers=new Map;updaters=new Map;_allLoadersSet=new Set;_configs=new Map;_engine;_executedSet=new Set;_initialized=!1;_isRunningLoaders=!1;_loadPromises=new Set;constructor(t){this._engine=t}get configs(){const t={};for(const[e,i]of this._configs)t[e]=i;return t}addColorManager(t,e){this.colorManagers.set(t,e)}addConfig(t){const e=t.key??t.name??"default";this._configs.set(e,t),this._engine.dispatchEvent(_t.configAdded,{data:{name:e,config:t}})}addEasing(t,e){this.easingFunctions.get(t)||this.easingFunctions.set(t,e)}addEffect(t,e){this.initializers.effects.set(t,e)}addPalette(t,e){this.palettes.set(t,e)}addParticleUpdater(t,e){this.initializers.updaters.set(t,e)}addPlugin(t){this.getPlugin(t.id)||this.plugins.push(t)}addPreset(t,e,i=!1){!i&&this.getPreset(t)||this.presets.set(t,e)}addShape(t,e){for(const i of t)this.initializers.shapes.set(i,e)}clearPlugins(t){this.effectDrawers.delete(t),this.shapeDrawers.delete(t),this.updaters.delete(t)}getEasing(t){return this.easingFunctions.get(t)??(t=>t)}getEffectDrawers(t,e=!1){return gt(t,this.effectDrawers,this.initializers.effects,e)}getPalette(t){return this.palettes.get(t)}getPlugin(t){return this.plugins.find(e=>e.id===t)}getPreset(t){return this.presets.get(t)}async getShapeDrawers(t,e=!1){return gt(t,this.shapeDrawers,this.initializers.shapes,e)}async getUpdaters(t,e=!1){return async function(t,e,i,s=!1){let n=e.get(t);return n&&!s||(n=await Promise.all([...i.values()].map(e=>e(t))),e.set(t,n)),n}(t,this.updaters,this.initializers.updaters,e)}async init(){if(!this._initialized&&!this._isRunningLoaders){this._isRunningLoaders=!0,this._executedSet=new Set,this._allLoadersSet=new Set(this._loadPromises);try{for(const t of this._allLoadersSet)await this._runLoader(t,this._executedSet,this._allLoadersSet)}finally{this._loadPromises.clear(),this._isRunningLoaders=!1,this._initialized=!0}}}loadParticlesOptions(t,e,...i){const s=this.updaters.get(t);s&&s.forEach(t=>t.loadOptions?.(e,...i))}async register(...t){if(this._initialized)throw new Error("Register plugins can only be done before calling tsParticles.load()");for(const e of t)this._isRunningLoaders?await this._runLoader(e,this._executedSet,this._allLoadersSet):this._loadPromises.add(e)}async _runLoader(t,e,i){e.has(t)||(e.add(t),i.add(t),await t(this._engine))}}const vt=t=>(...e)=>{t(...e)},wt={debug:vt(console.debug),error:(t,...e)=>{console.error(`tsParticles - Error - ${t}`,...e)},info:vt(console.info),log:vt(console.log),trace:vt(console.trace),verbose:vt(console.log),warning:vt(console.warn)};function bt(){return wt}const xt="100%";class Pt{pluginManager=new yt(this);_domArray=[];_eventDispatcher=new mt;_initialized=!1;get items(){return this._domArray}get version(){return"4.0.0-beta.15"}addEventListener(t,e){this._eventDispatcher.addEventListener(t,e)}checkVersion(t){if(this.version!==t)throw new Error(`The tsParticles version is different from the loaded plugins version. Engine version: ${this.version}. Plugin version: ${t}`)}dispatchEvent(t,e){this._eventDispatcher.dispatchEvent(t,e)}async init(){this._initialized||(await this.pluginManager.init(),this._initialized=!0)}item(t){const{items:e}=this,i=e[t];if(!i?.destroyed)return i;e.splice(t,1)}async load(t){await this.init();const{Container:i}=await Promise.resolve().then(function(){return Ls}),s=t.id??t.element?.id??`tsparticles${Math.floor(1e4*F()).toString()}`,{index:n,url:a}=t,o=a?await async function(t){const e=rt(t.url,t.index);if(!e)return t.fallback;const i=await fetch(e);return i.ok?await i.json():(bt().error(`${i.status.toString()} while retrieving config file`),t.fallback)}({fallback:t.options,url:a,index:n}):t.options,r=rt(o,n),{items:l}=this,c=l.findIndex(t=>t.id.description===s),h=new i({dispatchCallback:(t,e)=>{this.dispatchEvent(t,e)},id:s,onDestroy:t=>{if(!t)return;const e=this.items,i=e.indexOf(h);i>=0&&e.splice(i,1)},pluginManager:this.pluginManager,sourceOptions:r});if(c>=0){const t=this.item(c),e=t?1:0;t&&!t.destroyed&&t.destroy(!1),l.splice(c,e,h)}else l.push(h);const d=((t,i)=>{const s=tt();let n=i??s.getElementById(t);return n||(n=s.createElement("canvas"),n.id=t,n.dataset[e]=u,s.body.append(n),n)})(s,t.element),g=(t=>{const i=tt();let s;if(t instanceof HTMLCanvasElement||t.tagName.toLowerCase()===f)s=t,s.dataset[e]??=p,s.dataset[e]===u&&(s.style.width||=xt,s.style.height||=xt,s.style.pointerEvents="none",s.style.setProperty("pointer-events","none"));else{const n=t.getElementsByTagName(f)[0];n?(s=n,s.dataset[e]=p):(s=i.createElement(f),s.dataset[e]=u,t.appendChild(s)),s.style.width||=xt,s.style.height||=xt,s.style.pointerEvents="none",s.style.setProperty("pointer-events","none")}return s})(d);return h.canvas.loadCanvas(g),await h.start(),h}async refresh(t=!0){t&&await Promise.all(this.items.map(t=>t.refresh()))}removeEventListener(t,e){this._eventDispatcher.removeEventListener(t,e)}}var zt,Mt,Ct,St,kt,Ot,It,Dt;!function(t){t.circle="circle",t.rectangle="rectangle"}(zt||(zt={}));class Rt{position;type;constructor(t,e,i){this.position={x:t,y:e},this.type=i}_resetPosition(t,e){this.position.x=t,this.position.y=e}}class Et extends Rt{radius;constructor(t,e,i){super(t,e,zt.circle),this.radius=i}contains(t){return e=t,i=this.position,s=this.radius,$(e,i)<=s*s;var e,i,s}intersects(t){const e=this.position,i=t.position,s=this.radius,n=Math.abs(i.x-e.x),a=Math.abs(i.y-e.y);if(t instanceof Et||t.type===zt.circle){return s+t.radius>Math.hypot(n,a)}if(t instanceof Ft||t.type===zt.rectangle){const e=t,{width:i,height:o}=e.size;return Math.pow(n-i,2)+Math.pow(a-o,2)<=s**2||n<=s+i&&a<=s+o||n<=i||a<=o}return!1}reset(t,e,i){return this._resetPosition(t,e),this.radius=i,this}}class Ft extends Rt{size;constructor(t,e,i,s){super(t,e,zt.rectangle),this.size={height:s,width:i}}contains(t){const e=this.size.width,i=this.size.height,s=this.position;return t.x>=s.x&&t.x<=s.x+e&&t.y>=s.y&&t.y<=s.y+i}intersects(t){if(t instanceof Et)return t.intersects(this);if(!(t instanceof Ft))return!1;const e=this.size.width,i=this.size.height,s=this.position,n=t.position,a=t.size,o=a.width,r=a.height;return n.x<s.x+e&&n.x+o>s.x&&n.y<s.y+i&&n.y+r>s.y}reset(t,e,i,s){return this._resetPosition(t,e),this.size.width=i,this.size.height=s,this}}!function(t){t.clockwise="clockwise",t.counterClockwise="counter-clockwise",t.random="random"}(Mt||(Mt={})),function(t){t.delete="delete",t.wait="wait"}(Ct||(Ct={})),function(t){t.bounce="bounce",t.none="none",t.out="out",t.destroy="destroy",t.split="split"}(St||(St={})),function(t){t.darken="darken",t.enlighten="enlighten"}(kt||(kt={})),function(t){t.linear="linear",t.radial="radial",t.random="random"}(Ot||(Ot={})),function(t){t.normal="normal",t.inside="inside",t.outside="outside"}(It||(It={})),function(t){t.easeInBack="ease-in-back",t.easeInBounce="ease-in-bounce",t.easeInCirc="ease-in-circ",t.easeInCubic="ease-in-cubic",t.easeInElastic="ease-in-elastic",t.easeInExpo="ease-in-expo",t.easeInGaussian="ease-in-gaussian",t.easeInLinear="ease-in-linear",t.easeInQuad="ease-in-quad",t.easeInQuart="ease-in-quart",t.easeInQuint="ease-in-quint",t.easeInSigmoid="ease-in-sigmoid",t.easeInSine="ease-in-sine",t.easeInSmoothstep="ease-in-smoothstep",t.easeOutBack="ease-out-back",t.easeOutBounce="ease-out-bounce",t.easeOutCirc="ease-out-circ",t.easeOutCubic="ease-out-cubic",t.easeOutElastic="ease-out-elastic",t.easeOutExpo="ease-out-expo",t.easeOutGaussian="ease-out-gaussian",t.easeOutLinear="ease-out-linear",t.easeOutQuad="ease-out-quad",t.easeOutQuart="ease-out-quart",t.easeOutQuint="ease-out-quint",t.easeOutSigmoid="ease-out-sigmoid",t.easeOutSine="ease-out-sine",t.easeOutSmoothstep="ease-out-smoothstep",t.easeInOutBack="ease-in-out-back",t.easeInOutBounce="ease-in-out-bounce",t.easeInOutCirc="ease-in-out-circ",t.easeInOutCubic="ease-in-out-cubic",t.easeInOutElastic="ease-in-out-elastic",t.easeInOutExpo="ease-in-out-expo",t.easeInOutGaussian="ease-in-out-gaussian",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.easeInOutSigmoid="ease-in-out-sigmoid",t.easeInOutSine="ease-in-out-sine",t.easeInOutSmoothstep="ease-in-out-smoothstep"}(Dt||(Dt={}));class Lt{count;decay;delay;enable;speed;sync;constructor(){this.count=0,this.enable=!1,this.speed=1,this.decay=0,this.delay=0,this.sync=!1}load(t){O(t)||(void 0!==t.count&&(this.count=G(t.count)),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.speed&&(this.speed=G(t.speed)),void 0!==t.decay&&(this.decay=G(t.decay)),void 0!==t.delay&&(this.delay=G(t.delay)),void 0!==t.sync&&(this.sync=t.sync))}}class Tt extends Lt{mode;startValue;constructor(){super(),this.mode=H.auto,this.startValue=K.random}load(t){super.load(t),O(t)||(void 0!==t.mode&&(this.mode=t.mode),void 0!==t.startValue&&(this.startValue=t.startValue))}}class At extends Lt{max;min;offset;constructor(t,e){super(),this.min=t,this.max=e,this.offset=0,this.sync=!0}load(t){super.load(t),O(t)||(void 0!==t.max&&(this.max=t.max),void 0!==t.min&&(this.min=t.min),void 0!==t.offset&&(this.offset=G(t.offset)))}}class Ut{h=new At(0,m);l=new At(0,y);s=new At(0,_);load(t){O(t)||(this.h.load(t.h),this.s.load(t.s),this.l.load(t.l))}}class Vt{value;constructor(){this.value=""}static create(t,e){const i=new Vt;return i.load(t),void 0!==e&&(M(e)||k(e)?i.load({value:e}):i.load(e)),i}load(t){O(t)||O(t.value)||(this.value=t.value)}}class Bt extends Vt{animation;constructor(){super(),this.animation=new Ut}static create(t,e){const i=new Bt;return i.load(t),void 0!==e&&(M(e)||k(e)?i.load({value:e}):i.load(e)),i}load(t){if(super.load(t),O(t))return;const e=t.animation;void 0!==e&&(void 0===e.enable?this.animation.load(t.animation):this.animation.h.load(e))}}class Gt{color;image;opacity;position;repeat;size;constructor(){this.color=new Vt,this.color.value="",this.image="",this.position="",this.repeat="",this.size="",this.opacity=1}load(t){O(t)||(void 0!==t.color&&(this.color=Vt.create(this.color,t.color)),void 0!==t.image&&(this.image=t.image),void 0!==t.position&&(this.position=t.position),void 0!==t.repeat&&(this.repeat=t.repeat),void 0!==t.size&&(this.size=t.size),void 0!==t.opacity&&(this.opacity=t.opacity))}}class Wt{enable;zIndex;constructor(){this.enable=!0,this.zIndex=0}load(t){O(t)||(void 0!==t.enable&&(this.enable=t.enable),void 0!==t.zIndex&&(this.zIndex=t.zIndex))}}class $t{delay;enable;constructor(){this.delay=.5,this.enable=!0}load(t){O(t)||(void 0!==t.delay&&(this.delay=t.delay),void 0!==t.enable&&(this.enable=t.enable))}}class qt{close;options;type;constructor(){this.close=!0,this.options={},this.type=[]}load(t){if(O(t))return;const e=t.options;if(void 0!==e)for(const t in e){const i=e[t];i&&(this.options[t]=at(this.options[t]??{},i))}void 0!==t.close&&(this.close=t.close),void 0!==t.type&&(this.type=t.type)}}class Nt{color;enable;opacity;constructor(){this.enable=!0,this.opacity=1}load(t){O(t)||(void 0!==t.color&&(this.color=Bt.create(this.color,t.color)),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.opacity&&(this.opacity=G(t.opacity)))}}class jt{offset;value;constructor(){this.offset=0,this.value=90}load(t){O(t)||(void 0!==t.offset&&(this.offset=G(t.offset)),void 0!==t.value&&(this.value=G(t.value)))}}class Zt{mode;radius;x;y;constructor(){this.x=50,this.y=50,this.mode=J.percent,this.radius=0}load(t){O(t)||(void 0!==t.x&&(this.x=t.x),void 0!==t.y&&(this.y=t.y),void 0!==t.mode&&(this.mode=t.mode),void 0!==t.radius&&(this.radius=t.radius))}}class Ht{acceleration;enable;inverse;maxSpeed;constructor(){this.acceleration=9.81,this.enable=!1,this.inverse=!1,this.maxSpeed=50}load(t){O(t)||(void 0!==t.acceleration&&(this.acceleration=G(t.acceleration)),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.inverse&&(this.inverse=t.inverse),void 0!==t.maxSpeed&&(this.maxSpeed=G(t.maxSpeed)))}}class Qt{value;constructor(){this.value=0}load(t){O(t)||O(t.value)||(this.value=G(t.value))}}class Xt extends Qt{animation=new Lt;load(t){if(super.load(t),O(t))return;const e=t.animation;void 0!==e&&this.animation.load(e)}}class Yt extends Xt{animation;constructor(){super(),this.animation=new Tt}load(t){super.load(t)}}class Jt{clamp;delay;enable;generator;options;constructor(){this.clamp=!0,this.delay=new Qt,this.enable=!1,this.options={}}load(t){O(t)||(void 0!==t.clamp&&(this.clamp=t.clamp),this.delay.load(t.delay),void 0!==t.enable&&(this.enable=t.enable),this.generator=t.generator,t.options&&(this.options=at(this.options,t.options)))}}class Kt{bottom;default;left;right;top;constructor(){this.default=St.out}load(t){O(t)||(void 0!==t.default&&(this.default=t.default),this.bottom=t.bottom??t.default,this.left=t.left??t.default,this.right=t.right??t.default,this.top=t.top??t.default)}}class te{acceleration;enable;position;constructor(){this.acceleration=0,this.enable=!1}load(t){O(t)||(void 0!==t.acceleration&&(this.acceleration=G(t.acceleration)),void 0!==t.enable&&(this.enable=t.enable),t.position&&(this.position=at({},t.position)))}}class ee{angle;center;decay;direction;distance;drift;enable;gravity;outModes;path;random;size;speed;spin;straight;vibrate;warp;constructor(){this.angle=new jt,this.center=new Zt,this.decay=0,this.distance={},this.direction=w.none,this.drift=0,this.enable=!1,this.gravity=new Ht,this.path=new Jt,this.outModes=new Kt,this.random=!1,this.size=!1,this.speed=2,this.spin=new te,this.straight=!1,this.vibrate=!1,this.warp=!1}load(t){if(O(t))return;this.angle.load(C(t.angle)?{value:t.angle}:t.angle),this.center.load(t.center),void 0!==t.decay&&(this.decay=G(t.decay)),void 0!==t.direction&&(this.direction=t.direction),void 0!==t.distance&&(this.distance=C(t.distance)?{horizontal:t.distance,vertical:t.distance}:{...t.distance}),void 0!==t.drift&&(this.drift=G(t.drift)),void 0!==t.enable&&(this.enable=t.enable),this.gravity.load(t.gravity);const e=t.outModes;void 0!==e&&(S(e)?this.outModes.load(e):this.outModes.load({default:e})),this.path.load(t.path),void 0!==t.random&&(this.random=t.random),void 0!==t.size&&(this.size=t.size),void 0!==t.speed&&(this.speed=G(t.speed)),this.spin.load(t.spin),void 0!==t.straight&&(this.straight=t.straight),void 0!==t.vibrate&&(this.vibrate=t.vibrate),void 0!==t.warp&&(this.warp=t.warp)}}class ie extends Tt{destroy;constructor(){super(),this.destroy=X.none,this.speed=2}load(t){super.load(t),O(t)||void 0!==t.destroy&&(this.destroy=t.destroy)}}class se extends Yt{animation;constructor(){super(),this.animation=new ie,this.value=1}load(t){if(O(t))return;super.load(t);const e=t.animation;void 0!==e&&this.animation.load(e)}}class ne{color;opacity;width;constructor(){this.width=0}load(t){O(t)||(void 0!==t.color&&(this.color=Bt.create(this.color,t.color)),void 0!==t.width&&(this.width=G(t.width)),void 0!==t.opacity&&(this.opacity=G(t.opacity)))}}class ae{color;fill;stroke;load(t){O(t)||(void 0!==t.color&&(this.color=Bt.create(this.color,t.color)),void 0!==t.fill&&(this.fill??=new Nt,this.fill.load(t.fill)),void 0!==t.stroke&&(this.stroke??=new ne,this.stroke.load(t.stroke)))}}class oe extends Qt{constructor(){super(),this.value=1}}class re{horizontal;vertical;constructor(){this.horizontal=new oe,this.vertical=new oe}load(t){O(t)||(this.horizontal.load(t.horizontal),this.vertical.load(t.vertical))}}class le{enable;height;width;constructor(){this.enable=!1,this.width=1920,this.height=1080}load(t){if(O(t))return;void 0!==t.enable&&(this.enable=t.enable);const e=t.width;void 0!==e&&(this.width=e);const i=t.height;void 0!==i&&(this.height=i)}}class ce{mode;value;constructor(){this.mode=Ct.delete,this.value=0}load(t){O(t)||(void 0!==t.mode&&(this.mode=t.mode),void 0!==t.value&&(this.value=t.value))}}class he{density;limit;value;constructor(){this.density=new le,this.limit=new ce,this.value=0}load(t){O(t)||(this.density.load(t.density),this.limit.load(t.limit),void 0!==t.value&&(this.value=t.value))}}class de{close;options;type;constructor(){this.close=!0,this.options={},this.type="circle"}load(t){if(O(t))return;const e=t.options;if(void 0!==e)for(const t in e){const i=e[t];i&&(this.options[t]=at(this.options[t]??{},i))}void 0!==t.close&&(this.close=t.close),void 0!==t.type&&(this.type=t.type)}}class ue extends Tt{destroy;constructor(){super(),this.destroy=X.none,this.speed=5}load(t){super.load(t),O(t)||void 0!==t.destroy&&(this.destroy=t.destroy)}}class pe extends Yt{animation;constructor(){super(),this.animation=new ue,this.value=3}load(t){if(super.load(t),O(t))return;const e=t.animation;void 0!==e&&this.animation.load(e)}}class fe extends Qt{opacityRate;sizeRate;velocityRate;constructor(){super(),this.opacityRate=1,this.sizeRate=1,this.velocityRate=1}load(t){super.load(t),O(t)||(void 0!==t.opacityRate&&(this.opacityRate=t.opacityRate),void 0!==t.sizeRate&&(this.sizeRate=t.sizeRate),void 0!==t.velocityRate&&(this.velocityRate=t.velocityRate))}}class ge{bounce;effect;groups;move;number;opacity;paint;palette;reduceDuplicates;shape;size;zIndex;_container;_pluginManager;constructor(t,e){this._pluginManager=t,this._container=e,this.bounce=new re,this.effect=new qt,this.groups={},this.move=new ee,this.number=new he,this.opacity=new se,this.paint=new ae,this.paint.color=new Bt,this.paint.color.value="#fff",this.paint.fill=new Nt,this.paint.fill.enable=!0,this.reduceDuplicates=!1,this.shape=new de,this.size=new pe,this.zIndex=new fe}load(t){if(O(t))return;if(t.palette&&(this.palette=t.palette,this._importPalette(this.palette)),void 0!==t.groups)for(const e of Object.keys(t.groups)){if(!(e in t.groups))continue;const i=t.groups[e];void 0!==i&&(this.groups[e]=at(this.groups[e]??{},i))}void 0!==t.reduceDuplicates&&(this.reduceDuplicates=t.reduceDuplicates),this.bounce.load(t.bounce),this.effect.load(t.effect),this.move.load(t.move),this.number.load(t.number),this.opacity.load(t.opacity);const e=t.paint;if(e&&(k(e)?this.paint=ot(e,t=>{const e=new ae;return e.load(t),e}):k(this.paint)?(this.paint=new ae,this.paint.load(e)):this.paint.load(e)),this.shape.load(t.shape),this.size.load(t.size),this.zIndex.load(t.zIndex),this._container){for(const e of this._pluginManager.plugins)e.loadParticlesOptions&&e.loadParticlesOptions(this._container,this,t);const e=this._pluginManager.updaters.get(this._container);if(e)for(const i of e)i.loadOptions&&i.loadOptions(this,t)}}_importPalette=t=>{const e=this._pluginManager.getPalette(t);if(!e)return;const i=e.colors,s=(k(i)?i:[i]).flatMap(t=>{const e=t.fill,i=t.stroke,s=e?{color:{value:e.value},enable:e.enable,opacity:e.opacity}:void 0;return i?[{fill:s,stroke:{color:{value:i.value},opacity:i.opacity,width:i.width||0}}]:[{fill:s}]}),n=s.length>1?s:s[0]??{};this.load({paint:n,blend:{enable:!0,mode:e.blendMode}})}}function me(t,...e){for(const i of e)t.load(i)}function _e(t,e,...i){const s=new ge(t,e);return me(s,...i),s}class ye{autoPlay;background;clear;defaultThemes;delay;detectRetina;duration;fpsLimit;fullScreen;hdr;key;name;palette;particles;pauseOnBlur;pauseOnOutsideViewport;preset;resize;smooth;style;zLayers;_container;_pluginManager;constructor(t,e){this._pluginManager=t,this._container=e,this.autoPlay=!0,this.background=new Gt,this.clear=!0,this.defaultThemes={},this.delay=0,this.fullScreen=new Wt,this.detectRetina=!0,this.duration=0,this.fpsLimit=120,this.hdr=!0,this.particles=_e(this._pluginManager,this._container),this.pauseOnBlur=!0,this.pauseOnOutsideViewport=!0,this.resize=new $t,this.smooth=!1,this.style={},this.zLayers=100}load(t){if(O(t))return;void 0!==t.preset&&(this.preset=t.preset,ot(this.preset,t=>{this._importPreset(t)})),void 0!==t.palette&&(this.palette=t.palette,this._importPalette(this.palette)),void 0!==t.autoPlay&&(this.autoPlay=t.autoPlay),void 0!==t.clear&&(this.clear=t.clear),void 0!==t.key&&(this.key=t.key),void 0!==t.name&&(this.name=t.name),void 0!==t.delay&&(this.delay=G(t.delay));const e=t.detectRetina;void 0!==e&&(this.detectRetina=e),void 0!==t.duration&&(this.duration=G(t.duration));const i=t.fpsLimit;void 0!==i&&(this.fpsLimit=i),void 0!==t.hdr&&(this.hdr=t.hdr),void 0!==t.pauseOnBlur&&(this.pauseOnBlur=t.pauseOnBlur),void 0!==t.pauseOnOutsideViewport&&(this.pauseOnOutsideViewport=t.pauseOnOutsideViewport),void 0!==t.zLayers&&(this.zLayers=t.zLayers),this.background.load(t.background);const s=t.fullScreen;z(s)?this.fullScreen.enable=s:this.fullScreen.load(s),this.particles.load(t.particles),this.resize.load(t.resize),this.style=at(this.style,t.style),void 0!==t.smooth&&(this.smooth=t.smooth),this._pluginManager.plugins.forEach(e=>{e.loadOptions(this._container,this,t)})}_importPalette=t=>{const e=this._pluginManager.getPalette(t);e&&this.load({background:{color:e.background},blend:{enable:!0,mode:e.blendMode},particles:{palette:t}})};_importPreset=t=>{this.load(this._pluginManager.getPreset(t))}}function ve(t,e){t.clearRect(a.x,a.y,e.width,e.height)}function we(t,e,i,s){e.drawParticle&&e.drawParticle(t,i,s)}const be=new Map;function xe(t,e){let i=be.get(t);if(!i){if(i=e(),be.size>=1e3){[...be.keys()].slice(0,500).forEach(t=>be.delete(t))}be.set(t,i)}return i}function Pe(t,e,i,s=!0){if(!e)return;const n=M(e)?{value:e}:e;if(M(n.value))return ze(t,n.value,i,s);if(k(n.value)){const e=it(n.value,i,s);if(!e)return;return Pe(t,{value:e})}for(const e of t.colorManagers.values()){const t=e.handleRangeColor(n);if(t)return t}}function ze(t,e,i,s=!0){if(!e)return;const n=M(e)?{value:e}:e;if(M(n.value))return n.value===h?function(){const t=0,e=256,i=()=>Math.floor(L(t,e));return{b:i(),g:i(),r:i()}}():function(t,e){return function(t,e){if(e)for(const i of t.colorManagers.values())if(i.accepts(e))return i.parseString(e)}(t,e)}(t,n.value);if(k(n.value)){const e=it(n.value,i,s);if(!e)return;return ze(t,{value:e})}for(const e of t.colorManagers.values()){const t=e.handleColor(n);if(t)return t}}function Me(t,e,i,s=!0){const n=Pe(t,e,i,s);return n?Ce(n):void 0}function Ce(t){const e=t.r/g,i=t.g/g,n=t.b/g,a=Math.max(e,i,n),o=Math.min(e,i,n),r={h:0,l:(a+o)*s,s:0};return a!==o&&(r.s=r.l<s?(a-o)/(a+o):(a-o)/(2-a-o),r.h=e===a?(i-n)/(a-o):i===a?2+(n-e)/(a-o):4+(e-i)/(a-o)),r.l*=y,r.s*=_,r.h*=60,r.h<0&&(r.h+=m),r.h>=m&&(r.h-=m),r}function Se(t){const e=(t.h%m+m)%m,i=Math.max(0,Math.min(_,t.s)),n=Math.max(0,Math.min(y,t.l)),a=e/m,o=i/_,r=n/y;if(0===i){const t=Math.round(r*g);return{r:t,g:t,b:t}}const l=(t,e,i)=>{if(i<0&&i++,i>1&&i--,6*i<1)return t+6*(e-t)*i;if(2*i<1)return e;if(3*i<2){return t+(e-t)*(2/3-i)*6}return t},c=r<s?r*(1+o):r+o-r*o,h=2*r-c,d=1/3,u=Math.min(g,g*l(h,c,a+d)),p=Math.min(g,g*l(h,c,a)),f=Math.min(g,g*l(h,c,a-d));return{r:Math.round(u),g:Math.round(p),b:Math.round(f)}}function ke(t,e,i){const s=i??1;return xe(`rgb-${t.r.toFixed(2)}-${t.g.toFixed(2)}-${t.b.toFixed(2)}-${e?"hdr":"sdr"}-${s.toString()}`,()=>e?Oe(t,i):function(t,e){return`rgba(${t.r.toString()}, ${t.g.toString()}, ${t.b.toString()}, ${(e??1).toString()})`}(t,i))}function Oe(t,e){return`color(display-p3 ${(t.r/g).toString()} ${(t.g/g).toString()} ${(t.b/g).toString()} / ${(e??1).toString()})`}function Ie(t,e,i){const s=i??1;return xe(`hsl-${t.h.toFixed(2)}-${t.s.toFixed(2)}-${t.l.toFixed(2)}-${e?"hdr":"sdr"}-${s.toString()}`,()=>e?function(t,e){return Oe(Se(t),e)}(t,i):function(t,e){return`hsla(${t.h.toString()}, ${t.s.toString()}%, ${t.l.toString()}%, ${(e??1).toString()})`}(t,i))}function De(t){return void 0===t?void 0:{h:t.h.value,s:t.s.value,l:t.l.value}}function Re(t,e,i){const s={h:{enable:!1,value:t.h,min:0,max:m},s:{enable:!1,value:t.s,min:0,max:_},l:{enable:!1,value:t.l,min:0,max:y}};return e&&(Ee(s.h,e.h,i),Ee(s.s,e.s,i),Ee(s.l,e.l,i)),s}function Ee(t,e,s){t.enable=e.enable,t.min=e.min,t.max=e.max,t.enable?(t.velocity=U(e.speed)/i*s,t.decay=1-U(e.decay),t.status=Q.increasing,t.loops=0,t.maxLoops=U(e.count),t.time=0,t.delayTime=U(e.delay)*n,e.sync||(t.velocity*=F(),t.value*=F()),t.initialValue=t.value,t.offset=G(e.offset)):t.velocity=0}function Fe(t,e,i){if(!t.enable||(t.maxLoops??0)>0&&(t.loops??0)>(t.maxLoops??0))return;if(t.time??=0,(t.delayTime??0)>0&&t.time<(t.delayTime??0)&&(t.time+=i.value),(t.delayTime??0)>0&&t.time<(t.delayTime??0))return;const s=t.offset?A(t.offset):0,n=(t.velocity??0)*i.factor+3.6*s,a=t.decay??1,o=t.max,r=t.min;e&&t.status!==Q.increasing?(t.value-=n,t.value<r&&(t.loops??=0,t.loops++,t.status=Q.increasing)):(t.value+=n,t.value>o&&(t.loops??=0,t.loops++,e?t.status=Q.decreasing:t.value-=o)),t.velocity&&1!==a&&(t.velocity*=a),t.value=T(t.value,r,o)}function Le(t,e){if(!t)return;const{h:i,s:s,l:n}=t;Fe(i,!1,e),Fe(s,!0,e),Fe(n,!0,e)}const Te=new Pt;function Ae(){const t=(t,e,i)=>{const s=t.max>i?t.max-i:0;let n=G(t);s&&(n=G(t.min-s,i));const a=t.min<e?t.min:0;return a&&(n=G(0,t.max+a)),n},e=["#FF0000","#FF8000","#FFFF00","#00FF00","#00FFFF","#0000FF","#FF00FF"].map(e=>{const i=(t=>{let e=t;const i=/^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i;i.test(e)&&(e=e.replace(i,(t,e,i,s,n)=>e+e+i+i+s+s+(n?n+n:"")));const s=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i.exec(e);if(!s)return;s.shift();const n=2,a=1,o=0,r={a:s[3],b:s[n],g:s[a],r:s[o]};return{r:r.r?Number.parseInt(r.r,16):0,g:r.g?Number.parseInt(r.g,16):0,b:r.b?Number.parseInt(r.b,16):0,a:r.a?Number.parseInt(r.a,16):1}})(e);if(!i)return;const s=Ce(i),n=0,a=100,o=0,r=100,l=t({min:s.s-30,max:s.s+30},n,a),c=t({min:s.l-30,max:s.l+30},o,r);return{paint:{fill:{color:{value:{h:s.h,s:l,l:c}},enable:!0},stroke:{width:0}},number:{value:0},opacity:{value:{min:.1,max:1},animation:{enable:!0,speed:.7,sync:!1,startValue:K.max,destroy:X.min}},shape:{type:"circle"},effect:{type:"trail",options:{trail:{length:{min:5,max:10}}}},size:{value:{min:1,max:2},animation:{enable:!0,speed:5,count:1,sync:!1,startValue:K.min,destroy:X.none}},life:{count:1,duration:{value:{min:1,max:2}}},move:{decay:{min:.075,max:.1},enable:!0,gravity:{enable:!0,inverse:!1,acceleration:5},speed:{min:5,max:15},direction:w.none,outModes:St.destroy}}}).filter(t=>void 0!==t);return{detectRetina:!0,background:{color:"#000"},fpsLimit:120,emitters:{direction:w.top,rate:{delay:.3,quantity:1},size:{width:100,height:0},position:{y:100,x:50}},particles:{number:{value:0},destroy:{mode:"split",bounds:{top:{min:15,max:35}},split:{sizeOffset:!1,count:1,factor:{value:.333333},rate:{value:{min:75,max:150}},particles:e}},life:{count:1},shape:{type:"circle"},effect:{type:"trail",options:{trail:{length:{min:5,max:15},minWidth:1,maxWidth:1}}},size:{value:1},paint:{stroke:{color:{value:"#ffffff"},width:1},fill:{enable:!1}},move:{enable:!0,gravity:{acceleration:15,enable:!0,inverse:!0,maxSpeed:100},speed:{min:10,max:20},outModes:{default:St.destroy,top:St.none}}},sounds:{enable:!0,events:[{event:_t.particleRemoved,filter:t=>t.data.particle.options.move.gravity.inverse,audio:["https://particles.js.org/audio/explosion0.mp3","https://particles.js.org/audio/explosion1.mp3","https://particles.js.org/audio/explosion2.mp3"]}],volume:50}}}class Ue{draw(t){!function(t){const{context:e,particle:i,radius:s}=t;i.circleRange??={min:0,max:d};const n=i.circleRange;e.arc(a.x,a.y,s,n.min,n.max,!1)}(t)}getSidesCount(){return 12}particleInit(t,e){const i=e.shapeData,s=i?.angle??{max:360,min:0};e.circleRange=S(s)?{min:q(s.min),max:q(s.max)}:{min:0,max:q(s)}}}async function Ve(t){t.checkVersion("4.0.0-beta.15"),await t.pluginManager.register(t=>{t.pluginManager.addShape(["circle"],()=>Promise.resolve(new Ue))})}var Be;!function(t){t[t.r=1]="r",t[t.g=2]="g",t[t.b=3]="b",t[t.a=4]="a"}(Be||(Be={}));const Ge=/^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i,We=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i;class $e{accepts(t){return t.startsWith("#")}handleColor(t){return this._parseString(t.value)}handleRangeColor(t){return this._parseString(t.value)}parseString(t){return this._parseString(t)}_parseString(t){if("string"!=typeof t||!this.accepts(t))return;const e=t.replace(Ge,(t,e,i,s,n)=>e+e+i+i+s+s+(void 0===n?"":n+n)),i=We.exec(e);return i?{a:i[Be.a]?Number.parseInt(i[Be.a],16)/255:1,b:Number.parseInt(i[Be.b]??"0",16),g:Number.parseInt(i[Be.g]??"0",16),r:Number.parseInt(i[Be.r]??"0",16)}:void 0}}async function qe(t){t.checkVersion("4.0.0-beta.15"),await t.pluginManager.register(t=>{t.pluginManager.addColorManager("hex",new $e)})}var Ne;!function(t){t[t.h=1]="h",t[t.s=2]="s",t[t.l=3]="l",t[t.a=5]="a"}(Ne||(Ne={}));const je=/hsla?\(\s*(\d+)\s*[\s,]\s*(\d+)%\s*[\s,]\s*(\d+)%\s*([\s,]\s*(0|1|0?\.\d+|(\d{1,3})%)\s*)?\)/i;class Ze{accepts(t){return t.startsWith("hsl")}handleColor(t){const e=t.value.hsl??t.value;if("h"in e&&"s"in e&&"l"in e)return Se(e)}handleRangeColor(t){const e=t.value.hsl??t.value;if("h"in e&&"s"in e&&"l"in e)return Se({h:U(e.h),l:U(e.l),s:U(e.s)})}parseString(t){if(!this.accepts(t))return;const e=je.exec(t);return e?function(t){const e=Se(t);return{a:t.a,b:e.b,g:e.g,r:e.r}}({a:e.length>4?Z(e[Ne.a]):1,h:Number.parseInt(e[Ne.h]??"0",10),l:Number.parseInt(e[Ne.l]??"0",10),s:Number.parseInt(e[Ne.s]??"0",10)}):void 0}}async function He(t){t.checkVersion("4.0.0-beta.15"),await t.pluginManager.register(t=>{t.pluginManager.addColorManager("hsl",new Ze)})}class Qe{id="move";_pluginManager;constructor(t){this._pluginManager=t}async getPlugin(t){const{MovePluginInstance:e}=await Promise.resolve().then(function(){return Us});return new e(this._pluginManager,t)}loadOptions(){}needsPlugin(){return!0}}async function Xe(t){t.checkVersion("4.0.0-beta.15"),await t.pluginManager.register(t=>{const e=t.pluginManager;e.initializers.pathGenerators??=new Map,e.pathGenerators??=new Map,e.addPathGenerator=(t,i)=>{e.initializers.pathGenerators??=new Map,e.initializers.pathGenerators.set(t,i)},e.getPathGenerators=async(t,i=!1)=>(e.initializers.pathGenerators??=new Map,e.pathGenerators??=new Map,gt(t,e.pathGenerators,e.initializers.pathGenerators,i)),t.pluginManager.addPlugin(new Qe(t.pluginManager))})}class Ye{container;constructor(t){this.container=t}init(t){const e=t.options.opacity;t.opacity=lt(e,1);const s=e.animation;s.enable&&(t.opacity.velocity=U(s.speed)/i*this.container.retina.reduceFactor,s.sync||(t.opacity.velocity*=F()))}isEnabled(t){return!t.destroyed&&!t.spawning&&!!t.opacity&&t.opacity.enable&&((t.opacity.maxLoops??0)<=0||(t.opacity.maxLoops??0)>0&&(t.opacity.loops??0)<(t.opacity.maxLoops??0))}reset(t){t.opacity&&(t.opacity.time=0,t.opacity.loops=0)}update(t,e){this.isEnabled(t)&&t.opacity&&ut(t,t.opacity,!0,t.options.opacity.animation.destroy,e)}}async function Je(t){t.checkVersion("4.0.0-beta.15"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("opacity",t=>Promise.resolve(new Ye(t)))})}class Ke{container;modes;_particleBouncePlugins;constructor(t){this.container=t,this.modes=[St.bounce,St.split],this._particleBouncePlugins=t.plugins.filter(t=>void 0!==t.particleBounce)}update(t,e,i,s){if(!this.modes.includes(s))return;const n=this.container;let a=!1;for(const s of this._particleBouncePlugins)if(a=s.particleBounce?.(t,i,e)??!1,a)break;if(a)return;const o=t.getPosition(),r=t.offset,l=t.getRadius(),c=nt(o,l),h=n.canvas.size;!function(t){if(t.outMode!==St.bounce&&t.outMode!==St.split||t.direction!==Y.left&&t.direction!==Y.right)return;t.bounds.right<0&&t.direction===Y.left?t.particle.position.x=t.size+t.offset.x:t.bounds.left>t.canvasSize.width&&t.direction===Y.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===Y.right&&t.bounds.right>=t.canvasSize.width&&e>0||t.direction===Y.left&&t.bounds.left<=0&&e<0){const e=U(t.particle.options.bounce.horizontal.value);t.particle.velocity.x*=-e,i=!0}if(!i)return;const s=t.offset.x+t.size;t.bounds.right>=t.canvasSize.width&&t.direction===Y.right?t.particle.position.x=t.canvasSize.width-s:t.bounds.left<=0&&t.direction===Y.left&&(t.particle.position.x=s),t.outMode===St.split&&t.particle.destroy()}({particle:t,outMode:s,direction:e,bounds:c,canvasSize:h,offset:r,size:l}),function(t){if(t.outMode!==St.bounce&&t.outMode!==St.split||t.direction!==Y.bottom&&t.direction!==Y.top)return;t.bounds.bottom<0&&t.direction===Y.top?t.particle.position.y=t.size+t.offset.y:t.bounds.top>t.canvasSize.height&&t.direction===Y.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===Y.bottom&&t.bounds.bottom>=t.canvasSize.height&&e>0||t.direction===Y.top&&t.bounds.top<=0&&e<0){const e=U(t.particle.options.bounce.vertical.value);t.particle.velocity.y*=-e,i=!0}if(!i)return;const s=t.offset.y+t.size;t.bounds.bottom>=t.canvasSize.height&&t.direction===Y.bottom?t.particle.position.y=t.canvasSize.height-s:t.bounds.top<=0&&t.direction===Y.top&&(t.particle.position.y=s),t.outMode===St.split&&t.particle.destroy()}({particle:t,outMode:s,direction:e,bounds:c,canvasSize:h,offset:r,size:l})}}class ti{container;modes;constructor(t){this.container=t,this.modes=[St.destroy]}update(t,e,i,s){if(!this.modes.includes(s))return;const n=this.container;switch(t.outType){case It.normal:case It.outside:if(st(t.position,n.canvas.size,a,t.getRadius(),e))return;break;case It.inside:{const{dx:e,dy:i}=W(t.position,t.moveCenter),{x:s,y:n}=t.velocity;if(s<0&&e>t.moveCenter.radius||n<0&&i>t.moveCenter.radius||s>=0&&e<-t.moveCenter.radius||n>=0&&i<-t.moveCenter.radius)return;break}}t.destroy(!0)}}class ei{container;modes;constructor(t){this.container=t,this.modes=[St.none]}update(t,e,i,s){if(!this.modes.includes(s))return;if((t.options.move.distance.horizontal&&(e===Y.left||e===Y.right))??(t.options.move.distance.vertical&&(e===Y.top||e===Y.bottom)))return;const n=t.options.move.gravity,o=this.container,r=o.canvas.size,l=t.getRadius();if(n.enable){const i=t.position;(!n.inverse&&i.y>r.height+l&&e===Y.bottom||n.inverse&&i.y<-l&&e===Y.top)&&t.destroy()}else{if(t.velocity.y>0&&t.position.y<=r.height+l||t.velocity.y<0&&t.position.y>=-l||t.velocity.x>0&&t.position.x<=r.width+l||t.velocity.x<0&&t.position.x>=-l)return;st(t.position,o.canvas.size,a,l,e)||t.destroy()}}}const ii=P.origin;class si{container;modes;constructor(t){this.container=t,this.modes=[St.out]}update(t,e,i,s){if(!this.modes.includes(s))return;const n=this.container;switch(t.outType){case It.inside:{const{x:e,y:i}=t.velocity;ii.setTo(a),ii.length=t.moveCenter.radius,ii.angle=t.velocity.angle+Math.PI,ii.addTo(t.moveCenter);const{dx:s,dy:o}=W(t.position,ii);if(e<=0&&s>=0||i<=0&&o>=0||e>=0&&s<=0||i>=0&&o<=0)return;t.position.x=Math.floor(A({min:0,max:n.canvas.size.width})),t.position.y=Math.floor(A({min:0,max:n.canvas.size.height}));const{dx:r,dy:l}=W(t.position,t.moveCenter);t.direction=Math.atan2(-l,-r),t.velocity.angle=t.direction,t.justWarped=!0;break}default:if(st(t.position,n.canvas.size,a,t.getRadius(),e))return;switch(t.outType){case It.outside:{t.position.x=Math.floor(A({min:-t.moveCenter.radius,max:t.moveCenter.radius}))+t.moveCenter.x,t.position.y=Math.floor(A({min:-t.moveCenter.radius,max:t.moveCenter.radius}))+t.moveCenter.y;const{dx:e,dy:i}=W(t.position,t.moveCenter);t.moveCenter.radius&&(t.direction=Math.atan2(i,e),t.velocity.angle=t.direction),t.justWarped=!0;break}case It.normal:{const i=t.options.move.warp,s=n.canvas.size,a={bottom:s.height+t.getRadius()+t.offset.y,left:-t.getRadius()-t.offset.x,right:s.width+t.getRadius()+t.offset.x,top:-t.getRadius()-t.offset.y},o=t.getRadius(),r=nt(t.position,o);e===Y.right&&r.left>s.width+t.offset.x?(t.position.x=a.left,t.initialPosition.x=t.position.x,i||(t.position.y=F()*s.height,t.initialPosition.y=t.position.y),t.justWarped=!0):e===Y.left&&r.right<-t.offset.x&&(t.position.x=a.right,t.initialPosition.x=t.position.x,i||(t.position.y=F()*s.height,t.initialPosition.y=t.position.y),t.justWarped=!0),e===Y.bottom&&r.top>s.height+t.offset.y?(i||(t.position.x=F()*s.width,t.initialPosition.x=t.position.x),t.position.y=a.top,t.initialPosition.y=t.position.y,t.justWarped=!0):e===Y.top&&r.bottom<-t.offset.y&&(i||(t.position.x=F()*s.width,t.initialPosition.x=t.position.x),t.position.y=a.bottom,t.initialPosition.y=t.position.y,t.justWarped=!0);break}}}}}class ni{updaters;container;constructor(t){this.container=t,this.updaters=new Map}init(t){this._addUpdaterIfMissing(t,St.bounce,t=>new Ke(t)),this._addUpdaterIfMissing(t,St.out,t=>new si(t)),this._addUpdaterIfMissing(t,St.destroy,t=>new ti(t)),this._addUpdaterIfMissing(t,St.none,t=>new ei(t))}isEnabled(t){return!t.destroyed&&!t.spawning}update(t,e){const i=t.options.move.outModes;t.justWarped=!1,this._updateOutMode(t,e,i.bottom??i.default,Y.bottom),this._updateOutMode(t,e,i.left??i.default,Y.left),this._updateOutMode(t,e,i.right??i.default,Y.right),this._updateOutMode(t,e,i.top??i.default,Y.top)}_addUpdaterIfMissing=(t,e,i)=>{const s=t.options.move.outModes;!this.updaters.has(e)&&((t,e)=>t.default===e||t.bottom===e||t.left===e||t.right===e||t.top===e)(s,e)&&this.updaters.set(e,i(this.container))};_updateOutMode=(t,e,i,s)=>{for(const n of this.updaters.values())n.update(t,s,e,i)}}async function ai(t){t.checkVersion("4.0.0-beta.15"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("outModes",t=>Promise.resolve(new ni(t)))})}class oi{_container;_pluginManager;constructor(t,e){this._container=e,this._pluginManager=t}init(t){const e=this._container,i=t.options,s=rt(i.paint,t.id,i.reduceDuplicates),n=s?.color,a=n??void 0,o=s?.fill,r=s?.stroke;if(o){const i=Bt.create(void 0===a?void 0:Bt.create(void 0,a),o.color);t.fillEnabled=o.enable,t.fillOpacity=U(o.opacity),t.fillAnimation=i.animation;const s=Me(this._pluginManager,i);s&&(t.fillColor=Re(s,t.fillAnimation,e.retina.reduceFactor))}else t.fillEnabled=!1,t.fillAnimation=void 0,t.fillColor=void 0,t.fillOpacity=1;if(r){const i=Bt.create(void 0===a?void 0:Bt.create(void 0,a),r.color);t.strokeWidth=U(r.width)*e.retina.pixelRatio,t.strokeOpacity=U(r.opacity??1),t.strokeAnimation=i.animation;const s=Me(this._pluginManager,i)??t.getFillColor();s&&(t.strokeColor=Re(s,t.strokeAnimation,e.retina.reduceFactor))}else t.strokeAnimation=void 0,t.strokeColor=void 0,t.strokeOpacity=1,t.strokeWidth=0}isEnabled(t){const{fillAnimation:e,fillColor:i,strokeAnimation:s,strokeColor:n}=t,a=!!e&&(void 0!==i?.h.value&&i.h.enable||void 0!==i?.s.value&&i.s.enable||void 0!==i?.l.value&&i.l.enable),o=!!s&&(void 0!==n?.h.value&&n.h.enable||void 0!==n?.s.value&&n.s.enable||void 0!==n?.l.value&&n.l.enable);return!t.destroyed&&!t.spawning&&(a||o)}update(t,e){this.isEnabled(t)&&(Le(t.fillColor,e),Le(t.strokeColor,e))}}async function ri(t){t.checkVersion("4.0.0-beta.15"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("paint",e=>Promise.resolve(new oi(t.pluginManager,e)))})}var li;!function(t){t[t.r=1]="r",t[t.g=2]="g",t[t.b=3]="b",t[t.a=5]="a"}(li||(li={}));const ci=/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;class hi{accepts(t){return t.startsWith("rgb")}handleColor(t){const e=t.value.rgb??t.value;if("r"in e&&"g"in e&&"b"in e)return e}handleRangeColor(t){const e=t.value.rgb??t.value;if("r"in e&&"g"in e&&"b"in e)return{r:U(e.r),g:U(e.g),b:U(e.b)}}parseString(t){if(!this.accepts(t))return;const e=ci.exec(t);return e?{a:e.length>4?Z(e[li.a]):1,b:parseInt(e[li.b]??"0",10),g:parseInt(e[li.g]??"0",10),r:parseInt(e[li.r]??"0",10)}:void 0}}async function di(t){t.checkVersion("4.0.0-beta.15"),await t.pluginManager.register(t=>{t.pluginManager.addColorManager("rgb",new hi)})}class ui{_container;constructor(t){this._container=t}init(t){const e=this._container,s=t.options.size.animation;s.enable&&(t.size.velocity=t.retina.sizeAnimationSpeed/i*e.retina.reduceFactor,s.sync||(t.size.velocity*=F()))}isEnabled(t){return!t.destroyed&&!t.spawning&&t.size.enable&&((t.size.maxLoops??0)<=0||(t.size.maxLoops??0)>0&&(t.size.loops??0)<(t.size.maxLoops??0))}reset(t){t.size.time=0,t.size.loops=0}update(t,e){this.isEnabled(t)&&ut(t,t.size,!0,t.options.size.animation.destroy,e)}}async function pi(t){t.checkVersion("4.0.0-beta.15"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("size",t=>Promise.resolve(new ui(t)))})}async function fi(t){t.checkVersion("4.0.0-beta.15"),await t.pluginManager.register(async t=>{await Promise.all([qe(t),He(t),di(t),Xe(t),Ve(t),ri(t),Je(t),ai(t),pi(t)])})}class gi{bottom;left;right;top;load(t){O(t)||(void 0!==t.bottom&&(this.bottom=G(t.bottom)),void 0!==t.left&&(this.left=G(t.left)),void 0!==t.right&&(this.right=G(t.right)),void 0!==t.top&&(this.top=G(t.top)))}}var mi;!function(t){t.explode="explode",t.none="none",t.split="split"}(mi||(mi={}));class _i{maxSizeFactor;speed;constructor(){this.maxSizeFactor=3,this.speed=2}load(t){O(t)||(void 0!==t.maxSizeFactor&&(this.maxSizeFactor=t.maxSizeFactor),void 0!==t.speed&&(this.speed=t.speed))}}class yi extends Qt{constructor(){super(),this.value=3}}class vi extends Qt{constructor(){super(),this.value={min:4,max:9}}}class wi{count;factor;fillColor;fillColorOffset;particles;rate;sizeOffset;strokeColor;strokeColorOffset;constructor(){this.count=1,this.factor=new yi,this.rate=new vi,this.sizeOffset=!0}load(t){O(t)||(void 0!==t.fillColor&&(this.fillColor=Vt.create(this.fillColor,t.fillColor)),void 0!==t.strokeColor&&(this.strokeColor=Vt.create(this.strokeColor,t.strokeColor)),void 0!==t.count&&(this.count=t.count),this.factor.load(t.factor),this.rate.load(t.rate),this.particles=ot(t.particles,t=>at({},t)),void 0!==t.sizeOffset&&(this.sizeOffset=t.sizeOffset),t.fillColorOffset&&(this.fillColorOffset=this.fillColorOffset??{},void 0!==t.fillColorOffset.h&&(this.fillColorOffset.h=t.fillColorOffset.h),void 0!==t.fillColorOffset.s&&(this.fillColorOffset.s=t.fillColorOffset.s),void 0!==t.fillColorOffset.l&&(this.fillColorOffset.l=t.fillColorOffset.l)),t.strokeColorOffset&&(this.strokeColorOffset=this.strokeColorOffset??{},void 0!==t.strokeColorOffset.h&&(this.strokeColorOffset.h=t.strokeColorOffset.h),void 0!==t.strokeColorOffset.s&&(this.strokeColorOffset.s=t.strokeColorOffset.s),void 0!==t.strokeColorOffset.l&&(this.strokeColorOffset.l=t.strokeColorOffset.l)))}}class bi{bounds;explode;mode;split;constructor(){this.bounds=new gi,this.explode=new _i,this.mode=mi.none,this.split=new wi}load(t){O(t)||(t.mode&&(this.mode=t.mode),t.bounds&&this.bounds.load(t.bounds),this.explode.load(t.explode),this.split.load(t.split))}}function xi(t,e,i,s){return t&&s?function(t,e){const i=U(e.h??0),s=U(e.s??0),n=U(e.l??0),a=(t.h+i)%360,o=Math.max(0,Math.min(100,t.s+s)),r=Math.max(0,Math.min(100,t.l+n));return Bt.create(void 0,{value:{hsl:{h:a<0?a+360:a,s:o,l:r}}})}(s,t):e?Bt.create(void 0,e):i?Bt.create(void 0,i):s?function(t){return Bt.create(void 0,{value:{hsl:t}})}(s):void 0}function Pi(t,e,i,s){const n=i.options.destroy;if(!n)return;const a=n.split,o=_e(t,e,i.options),r=rt(a.fillColor),l=rt(a.strokeColor),c=i.getFillColor(),h=i.getStrokeColor();o.move.load({center:{x:i.position.x,y:i.position.y,mode:J.precise}});const d=1/U(a.factor.value);C(o.size.value)?o.size.value*=d:(o.size.value.min*=d,o.size.value.max*=d),o.load(s);const u=rt(o.paint),p=u?.fill,f=u?.stroke,g=xi(a.fillColorOffset,r,p?.color,c),m=xi(a.strokeColorOffset,l,f?.color,h);g&&p&&(p.color=g),m&&f&&(f.color=m);const _=a.sizeOffset?G(-i.size.value,i.size.value):0,y={x:i.position.x+A(_),y:i.position.y+A(_)};return e.particles.addParticle(y,o,i.group,t=>!(t.size.value<.5)&&(t.velocity.length=A(G(i.velocity.length,t.velocity.length)),t.splitCount=(i.splitCount??0)+1,t.unbreakable=!0,t.unbreakableUntil=performance.now()+500,!0))}class zi{_container;_pluginManager;constructor(t,e){this._container=e,this._pluginManager=t}init(t){const e=this._container,s=t.options.destroy;if(!s)return;t.exploding=void 0,t.splitCount=0;const n=s.bounds;t.destroyBounds??={};const{bottom:a,left:o,right:r,top:l}=n,{destroyBounds:c}=t,h=e.canvas.size;a&&(c.bottom=U(a)*h.height/i),o&&(c.left=U(o)*h.width/i),r&&(c.right=U(r)*h.width/i),l&&(c.top=U(l)*h.height/i)}isEnabled(t){const e=t;return!e.destroyed||!!e.exploding}loadOptions(t,...e){t.destroy??=new bi;for(const i of e)t.destroy.load(i?.destroy)}particleDestroyed(t,e){if(e)return;const i=t.options.destroy;switch(i?.mode){case mi.split:!function(t,e,i){const s=i.options.destroy;if(!s)return;const n=s.split;if(n.count>=0){if(void 0===i.splitCount||i.splitCount>n.count)return;i.splitCount++}const a=U(n.rate.value),o=rt(n.particles);for(let s=0;s<a;s++)Pi(t,e,i,o)}(this._pluginManager,this._container,t);break;case mi.explode:{if(t.exploding){t.destroyed=!1;break}const{explode:e}=i,s=t.size.value,n=s*e.maxSizeFactor,a=t.getOpacity();t.exploding={initialFillOpacity:a.fillOpacity,initialSize:s,initialStrokeOpacity:a.strokeOpacity,maxSize:n,progress:0,speed:Math.max(e.speed,.01)},t.fillOpacity=a.fillOpacity,t.strokeOpacity=a.strokeOpacity,t.destroyed=!1;break}}}update(t,e){if(t.exploding){const i=t.exploding,s=e.factor||1;i.progress=Math.min(1,i.progress+i.speed*s/60);const n=i.progress;return t.size.value=i.initialSize+(i.maxSize-i.initialSize)*n,t.fillOpacity=i.initialFillOpacity*(1-n),t.strokeOpacity=i.initialStrokeOpacity*(1-n),void(n>=1&&(t.exploding=void 0,t.destroy(!0)))}void 0!==t.unbreakableUntil&&performance.now()>=t.unbreakableUntil&&(t.unbreakable=!1,t.unbreakableUntil=void 0);const i=t.getPosition(),s=t.destroyBounds;s&&(void 0!==s.bottom&&i.y>=s.bottom||void 0!==s.left&&i.x<=s.left||void 0!==s.right&&i.x>=s.right||void 0!==s.top&&i.y<=s.top)&&t.destroy()}}async function Mi(t){t.checkVersion("4.0.0-beta.15"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("destroy",e=>Promise.resolve(new zi(t.pluginManager,e)))})}class Ci{count;delay;duration;wait;constructor(){this.wait=!1}load(t){O(t)||(void 0!==t.count&&(this.count=t.count),void 0!==t.delay&&(this.delay=G(t.delay)),void 0!==t.duration&&(this.duration=G(t.duration)),void 0!==t.wait&&(this.wait=t.wait))}}class Si{delay;quantity;constructor(){this.quantity=1,this.delay=.1}load(t){O(t)||(void 0!==t.quantity&&(this.quantity=G(t.quantity)),void 0!==t.delay&&(this.delay=G(t.delay)))}}class ki{color;opacity;constructor(){this.color=!1,this.opacity=!1}load(t){O(t)||(void 0!==t.color&&(this.color=t.color),void 0!==t.opacity&&(this.opacity=t.opacity))}}class Oi{options;replace;type;constructor(){this.options={},this.replace=new ki,this.type="square"}load(t){O(t)||(void 0!==t.options&&(this.options=at({},t.options??{})),this.replace.load(t.replace),void 0!==t.type&&(this.type=t.type))}}class Ii{height;mode;width;constructor(){this.mode=J.percent,this.height=0,this.width=0}load(t){O(t)||(void 0!==t.mode&&(this.mode=t.mode),void 0!==t.height&&(this.height=t.height),void 0!==t.width&&(this.width=t.width))}}class Di{fill;stroke;load(t){O(t)||(t.fill&&(this.fill??=new Nt,this.fill.load(t.fill)),t.stroke&&(this.stroke??=new ne,this.stroke.load(t.stroke)))}}class Ri{autoPlay;direction;domId;fill;life;name;particles;position;rate;shape;size;spawn;spawnFillColor;spawnStrokeColor;startCount;constructor(){this.autoPlay=!0,this.fill=!0,this.life=new Ci,this.rate=new Si,this.shape=new Oi,this.spawn=new Di,this.startCount=0}load(t){O(t)||(void 0!==t.autoPlay&&(this.autoPlay=t.autoPlay),void 0!==t.size&&(this.size??=new Ii,this.size.load(t.size)),void 0!==t.direction&&(this.direction=t.direction),this.domId=t.domId,void 0!==t.fill&&(this.fill=t.fill),this.life.load(t.life),this.name=t.name,this.particles=ot(t.particles,t=>at({},t)),this.rate.load(t.rate),this.shape.load(t.shape),this.spawn.load(t.spawn),void 0!==t.position&&(this.position={},void 0!==t.position.x&&(this.position.x=G(t.position.x)),void 0!==t.position.y&&(this.position.y=G(t.position.y))),void 0!==t.spawnFillColor&&(this.spawnFillColor??=new Bt,this.spawnFillColor.load(t.spawnFillColor)),void 0!==t.spawnStrokeColor&&(this.spawnStrokeColor??=new Bt,this.spawnStrokeColor.load(t.spawnStrokeColor)),void 0!==t.startCount&&(this.startCount=t.startCount))}}class Ei{id="emitters";_instancesManager;constructor(t){this._instancesManager=t}async getPlugin(t){const{EmittersPluginInstance:e}=await Promise.resolve().then(function(){return Vs});return new e(this._instancesManager,t)}loadOptions(t,e,i){(this.needsPlugin(e)||this.needsPlugin(i))&&i?.emitters&&(e.emitters=ot(i.emitters,t=>{const e=new Ri;return e.load(t),e}))}needsPlugin(t){if(!t)return!1;const e=t.emitters;return k(e)&&!!e.length||void 0!==e}}const Fi=new WeakMap;class Li{fill;options;position;size;constructor(t,e,i,s){this.position=t,this.size=e,this.fill=i,this.options=s}resize(t,e){this.position=t,this.size=e}}var Ti;async function Ai(t){t.checkVersion("4.0.0-beta.15"),await t.pluginManager.register(async t=>{const e=await function(t){const e=t.pluginManager;let i=Fi.get(e);return i||(i=Promise.resolve().then(function(){return qs}).then(({EmittersInstancesManager:t})=>new t(e)).catch(t=>{throw Fi.delete(e),t}),Fi.set(e,i)),i}(t);await async function(t){const{ShapeManager:e}=await Promise.resolve().then(function(){return Gs}),i=t.pluginManager;i.emitterShapeManager??=new e,i.addEmitterShapeGenerator??=(t,e)=>{i.emitterShapeManager?.addShapeGenerator(t,e)}}(t),t.pluginManager.addPlugin(new Ei(e))})}!function(t){t.emitter="emitter"}(Ti||(Ti={}));var Ui;function Vi(t,e){return t+e*(F()-s)}!function(t){t[t.TopLeft=0]="TopLeft",t[t.TopRight=1]="TopRight",t[t.BottomRight=2]="BottomRight",t[t.BottomLeft=3]="BottomLeft"}(Ui||(Ui={}));class Bi extends Li{constructor(t,e,i,s){super(t,e,i,s)}async init(){}randomPosition(){const t=this.fill,e=this.position,i=this.size;if(t)return{position:{x:Vi(e.x,i.width),y:Vi(e.y,i.height)}};{const t=i.width*s,n=i.height*s,a=function(t){return Math.floor(F()*t)}(4),o=2*(F()-s);switch(a){case Ui.TopLeft:return{position:{x:e.x+o*t,y:e.y-n}};case Ui.TopRight:return{position:{x:e.x-t,y:e.y+o*n}};case Ui.BottomRight:return{position:{x:e.x+o*t,y:e.y+n}};case Ui.BottomLeft:default:return{position:{x:e.x+t,y:e.y+o*n}}}}}}class Gi{generate(t,e,i,s,n){return new Bi(e,i,s,n)}}async function Wi(t){t.checkVersion("4.0.0-beta.15"),await t.pluginManager.register(t=>{!function(t){if(!t.pluginManager.addEmitterShapeGenerator)throw new Error("tsParticles Emitters Plugin is not loaded")}(t),t.pluginManager.addEmitterShapeGenerator?.("square",new Gi)})}class $i extends Qt{sync;constructor(){super(),this.sync=!1}load(t){O(t)||(super.load(t),void 0!==t.sync&&(this.sync=t.sync))}}class qi extends Qt{sync;constructor(){super(),this.sync=!1}load(t){O(t)||(super.load(t),void 0!==t.sync&&(this.sync=t.sync))}}class Ni{count;delay;duration;constructor(){this.count=0,this.delay=new $i,this.duration=new qi}load(t){O(t)||(void 0!==t.count&&(this.count=t.count),this.delay.load(t.delay),this.duration.load(t.duration))}}class ji{container;constructor(t){this.container=t}init(t){const e=this.container,i=t.options.life;if(!i)return;const s=i.delay.sync?1:F(),a=i.duration.sync?1:F();t.life={delay:e.retina.reduceFactor?U(i.delay.value)*s/e.retina.reduceFactor*n:0,delayTime:0,duration:e.retina.reduceFactor?U(i.duration.value)*a/e.retina.reduceFactor*n:0,time:0,count:i.count},t.life.duration<=0&&(t.life.duration=-1),t.life.count<=0&&(t.life.count=-1),t.spawning=t.life.delay>0}isEnabled(t){return!t.destroyed}loadOptions(t,...e){t.life??=new Ni;for(const i of e)t.life.load(i?.life)}update(t,e){this.isEnabled(t)&&t.life&&function(t,e,i){if(!t.life)return;const s=t.life;let a=!1;if(t.spawning){if(s.delayTime+=e.value,!(s.delayTime>=t.life.delay))return;a=!0,t.spawning=!1,s.delayTime=0,s.time=0}if(-1===s.duration)return;if(a?s.time=0:s.time+=e.value,s.time<s.duration)return;if(s.time=0,t.life.count>0&&t.life.count--,0===t.life.count)return void t.destroy();const o=G(0,i.width),r=G(0,i.width);t.position.x=A(o),t.position.y=A(r),t.spawning=!0,s.delayTime=0,s.time=0,t.reset();const l=t.options.life;l&&(s.delay=U(l.delay.value)*n,s.duration=U(l.duration.value)*n)}(t,e,this.container.canvas.size)}}async function Zi(t){t.checkVersion("4.0.0-beta.15"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("life",t=>Promise.resolve(new ji(t)))})}class Hi{draw(t){!function(t){const{context:e,particle:i,radius:s}=t,n=i.shapeData;e.moveTo(-s,0),e.lineTo(s,0),e.lineCap=n?.cap??"butt"}(t)}getSidesCount(){return 1}}async function Qi(t){t.checkVersion("4.0.0-beta.15"),await t.pluginManager.register(t=>{t.pluginManager.addShape(["line"],()=>Promise.resolve(new Hi))})}class Xi{decay;enable;speed;sync;constructor(){this.enable=!1,this.speed=0,this.decay=0,this.sync=!1}load(t){O(t)||(void 0!==t.enable&&(this.enable=t.enable),void 0!==t.speed&&(this.speed=G(t.speed)),void 0!==t.decay&&(this.decay=G(t.decay)),void 0!==t.sync&&(this.sync=t.sync))}}class Yi extends Qt{animation;direction;path;constructor(){super(),this.animation=new Xi,this.direction=Mt.clockwise,this.path=!1,this.value=0}load(t){O(t)||(super.load(t),void 0!==t.direction&&(this.direction=t.direction),this.animation.load(t.animation),void 0!==t.path&&(this.path=t.path))}}class Ji{container;constructor(t){this.container=t}init(t){const e=t.options.rotate;if(!e)return;t.rotate={enable:e.animation.enable,value:q(U(e.value)),min:0,max:d},t.pathRotation=e.path;let i=e.direction;if(i===Mt.random){i=Math.floor(2*F())>0?Mt.counterClockwise:Mt.clockwise}switch(i){case Mt.counterClockwise:case"counterClockwise":t.rotate.status=Q.decreasing;break;case Mt.clockwise:t.rotate.status=Q.increasing}const s=e.animation;s.enable&&(t.rotate.decay=1-U(s.decay),t.rotate.velocity=U(s.speed)/360*this.container.retina.reduceFactor,s.sync||(t.rotate.velocity*=F())),t.rotation=t.rotate.value}isEnabled(t){const e=t.options.rotate;return!!e&&(!t.destroyed&&!t.spawning&&(!!e.value||e.animation.enable||e.path))}loadOptions(t,...e){t.rotate??=new Yi;for(const i of e)t.rotate.load(i?.rotate)}update(t,e){this.isEnabled(t)&&(t.isRotating=!!t.rotate,t.rotate&&(ut(t,t.rotate,!1,X.none,e),t.rotation=t.rotate.value))}}async function Ki(t){t.checkVersion("4.0.0-beta.15"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("rotate",t=>Promise.resolve(new Ji(t)))})}const ts="pointerdown",es="touchstart";class is{loop;source;constructor(){this.loop=!1,this.source=""}load(t){O(t)||(S(t)?(void 0!==t.loop&&(this.loop=t.loop),void 0!==t.source&&(this.source=t.source)):this.source=t)}}class ss{duration;value;constructor(){this.duration=500,this.value=[]}load(t){O(t)||(void 0!==t.duration&&(this.duration=t.duration),void 0!==t.value&&(this.value=t.value))}}class ns{loop;melodies;notes;constructor(){this.loop=!1,this.melodies=[],this.notes=[]}load(t){O(t)||(void 0!==t.loop&&(this.loop=t.loop),void 0!==t.melodies&&(this.melodies=t.melodies.map(t=>{const e=new ns;return e.load(t),e})),void 0!==t.notes&&(this.notes=t.notes.map(t=>{const e=new ss;return e.load(t),e})))}}class as{audio;event;filter;melodies;notes;constructor(){this.event=[],this.notes=[]}load(t){if(!O(t)&&(void 0!==t.event&&(this.event=t.event),void 0!==t.audio&&(k(t.audio)?this.audio=t.audio.map(t=>{const e=new is;return e.load(t),e}):(this.audio=new is,this.audio.load(t.audio))),void 0!==t.notes&&(this.notes=t.notes.map(t=>{const e=new ss;return e.load(t),e})),void 0!==t.melodies&&(this.melodies=t.melodies.map(t=>{const e=new ns;return e.load(t),e})),t.filter))if(M(t.filter)){const e=globalThis[t.filter];"function"==typeof e&&(this.filter=e)}else this.filter=t.filter}}class os{height;path;style;svg;width;constructor(){this.width=24,this.height=24,this.style=""}load(t){O(t)||(void 0!==t.path&&(this.path=t.path),void 0!==t.svg&&(this.svg=t.svg),void 0!==t.width&&(this.width=t.width),void 0!==t.height&&(this.height=t.height))}}class rs{enable;mute;unmute;volumeDown;volumeUp;constructor(){this.mute=new os,this.unmute=new os,this.volumeDown=new os,this.volumeUp=new os,this.enable=!1,this.mute.svg='<?xml version="1.0"?>\n<svg baseProfile="tiny" height="24px" version="1.2" viewBox="0 0 24 24" width="24px"\n xml:space="preserve" xmlns="http://www.w3.org/2000/svg"\n xmlns:xlink="http://www.w3.org/1999/xlink">\n <g id="Layer_1">\n <path fill="#fff" d="M19.707,5.293c-0.391-0.391-1.023-0.391-1.414,0l-1.551,1.551c-0.345-0.688-0.987-1.02-1.604-1.02c-0.449,0-0.905,0.152-1.356,0.453l-2.672,1.781C10.357,8.561,8.904,9,8,9c-1.654,0-3,1.346-3,3v2c0,1.237,0.754,2.302,1.826,2.76l-1.533,1.533c-0.391,0.391-0.391,1.023,0,1.414C5.488,19.902,5.744,20,6,20s0.512-0.098,0.707-0.293l2.527-2.527c0.697,0.174,1.416,0.455,1.875,0.762l2.672,1.781c0.451,0.301,0.907,0.453,1.356,0.453C16.035,20.176,17,19.495,17,18V9.414l2.707-2.707C20.098,6.316,20.098,5.684,19.707,5.293z M14.891,7.941c0.038-0.025,0.073-0.046,0.104-0.062C14.998,7.914,15,7.954,15,8v1.293l-2,2V9.202L14.891,7.941z M7,12c0-0.552,0.448-1,1-1c1.211,0,2.907-0.495,4-1.146v2.439l-2.83,2.83C8.757,15.046,8.356,15,8,15c-0.552,0-1-0.448-1-1V12z M10.301,15.406L12,13.707v2.439C11.519,15.859,10.925,15.604,10.301,15.406z M14.994,18.12c-0.03-0.016-0.065-0.036-0.104-0.062L13,16.798v-4.091l2-2V18C15,18.046,14.998,18.086,14.994,18.12z"/>\n </g>\n</svg>',this.unmute.svg='<?xml version="1.0"?>\n<svg baseProfile="tiny" height="24px" version="1.2" viewBox="0 0 24 24" width="24px"\n xml:space="preserve" xmlns="http://www.w3.org/2000/svg"\n xmlns:xlink="http://www.w3.org/1999/xlink">\n <g id="Layer_1">\n <path fill="#fff" d="M17.138,5.824c-0.449,0-0.905,0.152-1.356,0.453l-2.672,1.781C12.357,8.561,10.904,9,10,9c-1.654,0-3,1.346-3,3v2c0,1.654,1.346,3,3,3c0.904,0,2.357,0.439,3.109,0.941l2.672,1.781c0.451,0.301,0.907,0.453,1.356,0.453C18.035,20.176,19,19.495,19,18V8C19,6.505,18.035,5.824,17.138,5.824z M14,16.146C12.907,15.495,11.211,15,10,15c-0.552,0-1-0.448-1-1v-2c0-0.552,0.448-1,1-1c1.211,0,2.907-0.495,4-1.146V16.146z M17,18c0,0.046-0.002,0.086-0.006,0.12c-0.03-0.016-0.065-0.036-0.104-0.062L15,16.798V9.202l1.891-1.261c0.038-0.025,0.073-0.046,0.104-0.062C16.998,7.914,17,7.954,17,8V18z"/>\n </g>\n</svg>',this.volumeDown.svg='<?xml version="1.0"?>\n<svg baseProfile="tiny" height="24px" version="1.2" viewBox="0 0 24 24" width="24px"\n xml:space="preserve" xmlns="http://www.w3.org/2000/svg"\n xmlns:xlink="http://www.w3.org/1999/xlink">\n <g id="Layer_1">\n <path fill="#fff" d="M15.138,5.824c-0.449,0-0.905,0.152-1.356,0.453l-2.672,1.781C10.357,8.561,8.904,9,8,9c-1.654,0-3,1.346-3,3v2c0,1.654,1.346,3,3,3c0.904,0,2.357,0.439,3.109,0.941l2.672,1.781c0.451,0.301,0.907,0.453,1.356,0.453C16.035,20.176,17,19.495,17,18V8C17,6.505,16.035,5.824,15.138,5.824z M8,15c-0.552,0-1-0.448-1-1v-2c0-0.552,0.448-1,1-1c1.211,0,2.907-0.495,4-1.146v6.293C10.907,15.495,9.211,15,8,15z M15,18c0,0.046-0.002,0.086-0.006,0.12c-0.03-0.016-0.065-0.036-0.104-0.062L13,16.798V9.202l1.891-1.261c0.038-0.025,0.073-0.046,0.104-0.062C14.998,7.914,15,7.954,15,8V18z"/>\n <path fill="#fff" d="M18.292,10.294c-0.39,0.391-0.39,1.023,0.002,1.414c0.345,0.345,0.535,0.803,0.535,1.291c0,0.489-0.19,0.948-0.536,1.294c-0.391,0.39-0.391,1.023,0,1.414C18.488,15.902,18.744,16,19,16s0.512-0.098,0.707-0.293c0.724-0.723,1.122-1.685,1.122-2.708s-0.398-1.984-1.123-2.707C19.317,9.903,18.683,9.901,18.292,10.294z"/>\n </g>\n</svg>',this.volumeUp.svg='<?xml version="1.0"?>\n<svg baseProfile="tiny" height="24px" version="1.2" viewBox="0 0 24 24" width="24px"\n xml:space="preserve" xmlns="http://www.w3.org/2000/svg"\n xmlns:xlink="http://www.w3.org/1999/xlink">\n <g id="Layer_1">\n <path fill="#fff" d="M16.706,10.292c-0.389-0.389-1.023-0.391-1.414,0.002c-0.39,0.391-0.39,1.023,0.002,1.414c0.345,0.345,0.535,0.803,0.535,1.291c0,0.489-0.19,0.948-0.536,1.294c-0.391,0.39-0.391,1.023,0,1.414C15.488,15.902,15.744,16,16,16s0.512-0.098,0.707-0.293c0.724-0.723,1.122-1.685,1.122-2.708S17.431,11.015,16.706,10.292z"/>\n <path fill="#fff" d="M18.706,8.292c-0.391-0.389-1.023-0.39-1.414,0.002c-0.39,0.391-0.39,1.024,0.002,1.414c0.879,0.877,1.363,2.044,1.364,3.287c0.001,1.246-0.484,2.417-1.365,3.298c-0.391,0.391-0.391,1.023,0,1.414C17.488,17.902,17.744,18,18,18s0.512-0.098,0.707-0.293c1.259-1.259,1.952-2.933,1.951-4.713C20.657,11.217,19.964,9.547,18.706,8.292z"/>\n <path fill="#fff" d="M20.706,6.292c-0.391-0.389-1.023-0.39-1.414,0.002c-0.39,0.391-0.39,1.024,0.002,1.414c1.412,1.409,2.191,3.285,2.192,5.284c0.002,2.002-0.777,3.885-2.193,5.301c-0.391,0.391-0.391,1.023,0,1.414C19.488,19.902,19.744,20,20,20s0.512-0.098,0.707-0.293c1.794-1.794,2.781-4.18,2.779-6.717C23.485,10.457,22.497,8.078,20.706,6.292z"/>\n <path fill="#fff" d="M12.138,5.824c-0.449,0-0.905,0.152-1.356,0.453L8.109,8.059C7.357,8.561,5.904,9,5,9c-1.654,0-3,1.346-3,3v2c0,1.654,1.346,3,3,3c0.904,0,2.357,0.439,3.109,0.941l2.672,1.781c0.451,0.301,0.907,0.453,1.356,0.453C13.035,20.176,14,19.495,14,18V8C14,6.505,13.035,5.824,12.138,5.824z M5,15c-0.552,0-1-0.448-1-1v-2c0-0.552,0.448-1,1-1c1.211,0,2.907-0.495,4-1.146v6.293C7.907,15.495,6.211,15,5,15z M12,18c0,0.046-0.002,0.086-0.006,0.12c-0.03-0.016-0.065-0.036-0.104-0.062L10,16.798V9.202l1.891-1.261c0.038-0.025,0.073-0.046,0.104-0.062C11.998,7.914,12,7.954,12,8V18z"/>\n </g>\n</svg>'}load(t){O(t)||(void 0!==t.enable&&(this.enable=t.enable),this.mute.load(t.mute),this.unmute.load(t.unmute),this.volumeDown.load(t.volumeDown),this.volumeUp.load(t.volumeUp))}}class ls{max;min;step;value;constructor(){this.value=100,this.max=100,this.min=0,this.step=10}load(t){O(t)||(S(t)?(void 0!==t.max&&(this.max=t.max),void 0!==t.min&&(this.min=t.min),void 0!==t.step&&(this.step=t.step),void 0!==t.value&&(this.value=t.value)):this.value=t)}}class cs{autoPlay;enable;events;icons;volume;constructor(){this.autoPlay=!0,this.enable=!1,this.events=[],this.icons=new rs,this.volume=new ls}load(t){O(t)||(void 0!==t.autoPlay&&(this.autoPlay=t.autoPlay),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.events&&(this.events=t.events.map(t=>{const e=new as;return e.load(t),e})),this.icons.load(t.icons),void 0!==t.volume&&this.volume.load(t.volume))}}const hs=new Map;function ds(t){const e=/(([A-G]b?)(\d))|pause/i.exec(t);if(!e?.length)return;const i=e[2]??e[0],s=hs.get(i);return s?s[parseInt(e[3]??"0")]:void 0}hs.set("C",[16.35,32.7,65.41,130.81,261.63,523.25,1046.5,2093,4186.01]),hs.set("Db",[17.32,34.65,69.3,138.59,277.18,554.37,1108.73,2217.46,4434.92]),hs.set("D",[18.35,36.71,73.42,146.83,293.66,587.33,1174.66,2349.32,4698.63]),hs.set("Eb",[19.45,38.89,77.78,155.56,311.13,622.25,1244.51,2489.02,4978.03]),hs.set("E",[20.6,41.2,82.41,164.81,329.63,659.25,1318.51,2637.02,5274.04]),hs.set("F",[21.83,43.65,87.31,174.61,349.23,698.46,1396.91,2793.83,5587.65]),hs.set("Gb",[23.12,46.25,92.5,185,369.99,739.99,1479.98,2959.96,5919.91]),hs.set("G",[24.5,49,98,196,392,783.99,1567.98,3135.96,6271.93]),hs.set("Ab",[25.96,51.91,103.83,207.65,415.3,830.61,1661.22,3322.44,6644.88]),hs.set("A",[27.5,55,110,220,440,880,1760,3520,7040]),hs.set("Bb",[29.14,58.27,116.54,233.08,466.16,932.33,1864.66,3729.31,7458.62]),hs.set("B",[30.87,61.74,123.47,246.94,493.88,987.77,1975.53,3951.07,7902.13]),hs.set("pause",[0]);let us=!0;const ps=()=>us,fs=()=>{us=!1},gs=()=>{removeEventListener(ts,gs),removeEventListener(es,gs),fs()};class ms{id="sounds";_engine;constructor(t){this._engine=t;const e={capture:!0,once:!0};addEventListener(ts,gs,e),addEventListener(es,gs,e)}async getPlugin(t){const{SoundsPluginInstance:e}=await Promise.resolve().then(function(){return Zs});return new e(t,this._engine)}loadOptions(t,e,i){if(!this.needsPlugin(e)&&!this.needsPlugin(i))return;let s=e.sounds;void 0===s?.load&&(e.sounds=s=new cs),s.load(i?.sounds)}needsPlugin(t){return t?.sounds?.enable??!1}}async function _s(t){t.checkVersion("4.0.0-beta.15"),await t.pluginManager.register(t=>{t.pluginManager.addPlugin(new ms(t))})}const ys={a:1,b:0,c:0,d:1};class vs{_container;constructor(t){this._container=t}drawAfter(t){const{context:e,drawPosition:i,drawRadius:n,drawScale:o,particle:r,transformData:l}=t,c=2*n,h=this._container.retina.pixelRatio,d=r.trail;if(!d||!r.trailLength)return;const u=i,p=r.trailLength*o+n;if(d.push({break:r.justWarped,color:e.fillStyle||e.strokeStyle,position:{x:u.x,y:u.y},transformData:l}),d.length<3)return;const f=Math.floor(p);d.length>f&&d.splice(0,d.length-f);const g=Math.min(d.length,p);e.save(),e.lineCap="butt",e.lineJoin="round";for(let t=g-2;t>0;t--){const i=d[t+1],n=d[t],l=d[t-1];if(!i||!n||!l)continue;const u=i.position,p=n.position,f=l.position,m=r.trailTransform?n.transformData??ys:ys;if(n.break||i.break||l.break)continue;e.setTransform(m.a,m.b,m.c,m.d,p.x,p.y);const _=(u.x+p.x)*s-p.x,y=(u.y+p.y)*s-p.y,v=(p.x+f.x)*s-p.x,w=(p.y+f.y)*s-p.y;e.beginPath(),e.moveTo(_,y),e.quadraticCurveTo(a.x,a.y,v,w);const b=Math.max(t/g*c,h,(r.trailMinWidth??-1)*o),x=e.globalAlpha;e.globalAlpha=r.trailFade?t/g:1,e.lineWidth=r.trailMaxWidth?Math.min(b,r.trailMaxWidth*o):b,e.strokeStyle=n.color,e.stroke(),e.globalAlpha=x}e.restore()}particleInit(t,e){e.trail=[];const i=e.effectData;e.trailFade=i?.fade??!0,e.trailLength=U(i?.length??10)*t.retina.pixelRatio,e.trailMaxWidth=i?.maxWidth?U(i.maxWidth)*t.retina.pixelRatio:void 0,e.trailMinWidth=i?.minWidth?U(i.minWidth)*t.retina.pixelRatio:void 0,e.trailTransform=i?.transform??!1}}async function ws(t){t.checkVersion("4.0.0-beta.15"),await t.pluginManager.register(t=>{t.pluginManager.addEffect("trail",t=>Promise.resolve(new vs(t)))})}async function bs(t){await t.pluginManager.register(async t=>{await Promise.all([fi(t),(async t=>{await Ai(t),await Wi(t)})(t),ws(t),_s(t),Qi(t),Ki(t),Mi(t),Zi(t)]),t.pluginManager.addPreset("fireworks",Ae(),!1)})}const xs=globalThis;xs.__tsParticlesInternals=xs.__tsParticlesInternals??{},xs.loadFireworksPreset=bs;function Ps(t,e,i){const s=e[i];void 0!==s&&(t[i]=(t[i]??1)*s)}class zs{_canvasClearPlugins;_canvasManager;_canvasPaintPlugins;_clearDrawPlugins;_colorPlugins;_container;_context;_contextSettings;_drawParticlePlugins;_drawParticlesCleanupPlugins;_drawParticlesSetupPlugins;_drawPlugins;_drawSettingsCleanupPlugins;_drawSettingsSetupPlugins;_pluginManager;_postDrawUpdaters;_preDrawUpdaters;_reusableColorStyles={};_reusablePluginColors=[void 0,void 0];_reusableTransform={};constructor(t,e,i){this._pluginManager=t,this._container=e,this._canvasManager=i,this._context=null,this._preDrawUpdaters=[],this._postDrawUpdaters=[],this._colorPlugins=[],this._canvasClearPlugins=[],this._canvasPaintPlugins=[],this._clearDrawPlugins=[],this._drawParticlePlugins=[],this._drawParticlesCleanupPlugins=[],this._drawParticlesSetupPlugins=[],this._drawPlugins=[],this._drawSettingsSetupPlugins=[],this._drawSettingsCleanupPlugins=[]}get settings(){return this._contextSettings}canvasClear(){this._container.actualOptions.clear&&this.draw(t=>{ve(t,this._canvasManager.size)})}clear(){let t=!1;for(const e of this._canvasClearPlugins)if(t=e.canvasClear?.()??!1,t)break;t||this.canvasClear()}destroy(){this.stop(),this._preDrawUpdaters=[],this._postDrawUpdaters=[],this._colorPlugins=[],this._canvasClearPlugins=[],this._canvasPaintPlugins=[],this._clearDrawPlugins=[],this._drawParticlePlugins=[],this._drawParticlesCleanupPlugins=[],this._drawParticlesSetupPlugins=[],this._drawPlugins=[],this._drawSettingsSetupPlugins=[],this._drawSettingsCleanupPlugins=[]}draw(t){const e=this._context;if(e)return t(e)}drawParticle(t,e){if(t.spawning||t.destroyed)return;const i=t.getRadius();if(i<=0)return;const s=t.getFillColor(),n=t.getStrokeColor();let[a,o]=this._getPluginParticleColors(t);if(a??=s,o??=n,!a&&!o)return;const r=this._container,l=t.options.zIndex,c=1-t.zIndexFactor,{fillOpacity:h,opacity:d,strokeOpacity:u}=t.getOpacity(),p=this._reusableTransform,f=this._reusableColorStyles,g=a?Ie(a,r.hdr,h*d):void 0,m=o?Ie(o,r.hdr,u*d):g;p.a=p.b=p.c=p.d=void 0,f.fill=g,f.stroke=m,this.draw(s=>{for(const i of this._drawParticlesSetupPlugins)i.drawParticleSetup?.(s,t,e);this._applyPreDrawUpdaters(s,t,i,d,f,p),function(t){const{container:e,context:i,particle:s,delta:n,colorStyles:a,radius:o,opacity:r,transform:l}=t,{effectDrawers:c,shapeDrawers:h}=e,d=s.getPosition(),u=s.getTransformData(l),p={x:d.x,y:d.y};i.setTransform(u.a,u.b,u.c,u.d,d.x,d.y),a.fill&&(i.fillStyle=a.fill);const f=!!s.fillEnabled,g=s.strokeWidth??0;i.lineWidth=g,a.stroke&&(i.strokeStyle=a.stroke);const m={context:i,particle:s,radius:o,drawRadius:1*o,opacity:r,delta:n,pixelRatio:e.retina.pixelRatio,fill:f,stroke:g>0,transformData:u,position:{...d},drawPosition:p,drawScale:1};for(const t of e.plugins)t.drawParticleTransform?.(m);const _=s.effect?c.get(s.effect):void 0,y=s.shape?h.get(s.shape):void 0;!function(t,e){if(!t?.drawBefore)return;const{particle:i}=e;i.effect&&t.drawBefore(e)}(_,m),function(t,e){if(!t?.beforeDraw)return;const{particle:i}=e;i.shape&&t.beforeDraw(e)}(y,m),function(t,e){if(!t)return;const{context:i,fill:s,particle:n,stroke:a}=e;n.shape&&(i.beginPath(),t.draw(e),n.shapeClose&&i.closePath(),s&&i.fill(),a&&i.stroke())}(y,m),function(t,e){if(!t?.afterDraw)return;const{particle:i}=e;i.shape&&t.afterDraw(e)}(y,m),function(t,e){if(!t?.drawAfter)return;const{particle:i}=e;i.effect&&t.drawAfter(e)}(_,m),i.resetTransform()}({container:r,context:s,particle:t,delta:e,colorStyles:f,radius:i*c**l.sizeRate,opacity:d,transform:p}),this._applyPostDrawUpdaters(t);for(const i of this._drawParticlesCleanupPlugins)i.drawParticleCleanup?.(s,t,e)})}drawParticlePlugins(t,e){this.draw(i=>{for(const s of this._drawParticlePlugins)we(i,s,t,e)})}drawParticles(t){const{particles:e}=this._container;this.clear(),e.update(t),this.draw(i=>{for(const e of this._drawSettingsSetupPlugins)e.drawSettingsSetup?.(i,t);for(const e of this._drawPlugins)e.draw?.(i,t);e.drawParticles(t);for(const e of this._clearDrawPlugins)e.clearDraw?.(i,t);for(const e of this._drawSettingsCleanupPlugins)e.drawSettingsCleanup?.(i,t)})}init(){this.initUpdaters(),this.initPlugins(),this.paint()}initPlugins(){this._colorPlugins=[],this._canvasClearPlugins=[],this._canvasPaintPlugins=[],this._clearDrawPlugins=[],this._drawParticlePlugins=[],this._drawParticlesSetupPlugins=[],this._drawParticlesCleanupPlugins=[],this._drawPlugins=[],this._drawSettingsSetupPlugins=[],this._drawSettingsCleanupPlugins=[];for(const t of this._container.plugins)(t.particleFillColor??t.particleStrokeColor)&&this._colorPlugins.push(t),t.canvasClear&&this._canvasClearPlugins.push(t),t.canvasPaint&&this._canvasPaintPlugins.push(t),t.drawParticle&&this._drawParticlePlugins.push(t),t.drawParticleSetup&&this._drawParticlesSetupPlugins.push(t),t.drawParticleCleanup&&this._drawParticlesCleanupPlugins.push(t),t.draw&&this._drawPlugins.push(t),t.drawSettingsSetup&&this._drawSettingsSetupPlugins.push(t),t.drawSettingsCleanup&&this._drawSettingsCleanupPlugins.push(t),t.clearDraw&&this._clearDrawPlugins.push(t)}initUpdaters(){this._preDrawUpdaters=[],this._postDrawUpdaters=[];for(const t of this._container.particleUpdaters)t.afterDraw&&this._postDrawUpdaters.push(t),(t.getColorStyles??t.getTransformValues??t.beforeDraw)&&this._preDrawUpdaters.push(t)}paint(){let t=!1;for(const e of this._canvasPaintPlugins)if(t=e.canvasPaint?.()??!1,t)break;t||this.paintBase()}paintBase(t){this.draw(e=>{!function(t,e,i){t.fillStyle=i??"rgba(0,0,0,0)",t.fillRect(a.x,a.y,e.width,e.height)}(e,this._canvasManager.size,t)})}paintImage(t,e){this.draw(i=>{!function(t,e,i,s){if(!i)return;const n=t.globalAlpha;t.globalAlpha=s,t.drawImage(i,a.x,a.y,e.width,e.height),t.globalAlpha=n}(i,this._canvasManager.size,t,e)})}setContext(t){this._context=t,this._context&&(this._context.globalCompositeOperation="source-over")}setContextSettings(t){this._contextSettings=t}stop(){this.draw(t=>{ve(t,this._canvasManager.size)})}_applyPostDrawUpdaters=t=>{for(const e of this._postDrawUpdaters)e.afterDraw?.(t)};_applyPreDrawUpdaters=(t,e,i,s,n,a)=>{for(const o of this._preDrawUpdaters){if(o.getColorStyles){const{fill:a,stroke:r}=o.getColorStyles(e,t,i,s);a&&(n.fill=a),r&&(n.stroke=r)}if(o.getTransformValues){const t=o.getTransformValues(e);for(const e in t)Ps(a,t,e)}o.beforeDraw?.(e)}};_getPluginParticleColors=t=>{let e,i;for(const s of this._colorPlugins)if(!e&&s.particleFillColor&&(e=Me(this._pluginManager,s.particleFillColor(t))),!i&&s.particleStrokeColor&&(i=Me(this._pluginManager,s.particleStrokeColor(t))),e&&i)break;return this._reusablePluginColors[0]=e,this._reusablePluginColors[1]=i,this._reusablePluginColors}}function Ms(t,e,i=!1){if(!e)return;const s=t.style,n=new Set;for(let t=0;t<s.length;t++){const e=s.item(t);e&&n.add(e)}for(let t=0;t<e.length;t++){const i=e.item(t);i&&n.add(i)}for(const t of n){const n=e.getPropertyValue(t);n?s.setProperty(t,n,i?"important":""):s.removeProperty(t)}}class Cs{element;render;size;zoom=1;_container;_generated;_mutationObserver;_originalStyle;_pluginManager;_pointerEvents;_resizePlugins;_standardSize;_zoomCenter;constructor(t,e){this._pluginManager=t,this._container=e,this.render=new zs(t,e,this),this._standardSize={height:0,width:0};const i=e.retina.pixelRatio,s=this._standardSize;this.size={height:s.height*i,width:s.width*i},this._generated=!1,this._resizePlugins=[],this._pointerEvents="none"}get _fullScreen(){return this._container.actualOptions.fullScreen.enable}destroy(){if(this.stop(),this._generated){const t=this.element;t?.remove(),this.element=void 0}else this._resetOriginalStyle();this.render.destroy(),this._resizePlugins=[]}getZoomCenter(){const t=this._container.retina.pixelRatio,{width:e,height:i}=this.size;return this._zoomCenter?this._zoomCenter:{x:e*s/t,y:i*s/t}}init(){this._safeMutationObserver(t=>{t.disconnect()}),this._mutationObserver=function(t){if("undefined"!=typeof MutationObserver)return new MutationObserver(t)}(t=>{for(const e of t)"attributes"===e.type&&"style"===e.attributeName&&this._repairStyle()}),this.resize(),this._initStyle(),this.initBackground(),this._safeMutationObserver(t=>{this.element&&this.element instanceof Node&&t.observe(this.element,{attributes:!0})}),this.initPlugins(),this.render.init()}initBackground(){const{_container:t}=this,e=t.actualOptions.background,i=this.element;if(!i)return;const s=i.style,n=Pe(this._pluginManager,e.color);s.backgroundColor=n?ke(n,t.hdr,e.opacity):"",s.backgroundImage=e.image||"",s.backgroundPosition=e.position||"",s.backgroundRepeat=e.repeat||"",s.backgroundSize=e.size||""}initPlugins(){this._resizePlugins=[];for(const t of this._container.plugins)t.resize&&this._resizePlugins.push(t)}loadCanvas(t){this._generated&&this.element&&this.element.remove();const i=this._container;this._generated=e in t.dataset?"true"===t.dataset[e]:this._generated,this.element=t,this.element.ariaHidden="true",this._originalStyle=function(t){const e=tt().createElement("div").style;for(const i in t){const s=t[i];if(!(i in t)||O(s))continue;const n=t.getPropertyValue?.(s);if(!n)continue;const a=t.getPropertyPriority?.(s);a?e.setProperty(s,n,a):e.setProperty(s,n)}return e}(this.element.style);const s=this._standardSize;s.height=t.offsetHeight,s.width=t.offsetWidth;const n=this._container.retina.pixelRatio,a=this.size;t.height=a.height=s.height*n,t.width=a.width=s.width*n;const o=et("(color-gamut: p3)");this.render.setContextSettings({alpha:!0,colorSpace:o?.matches&&i.hdr?"display-p3":"srgb",desynchronized:!0,willReadFrequently:!1}),this.render.setContext(this.element.getContext("2d",this.render.settings)),this._safeMutationObserver(t=>{t.disconnect()}),i.retina.init(),this.initBackground(),this._safeMutationObserver(t=>{this.element&&this.element instanceof Node&&t.observe(this.element,{attributes:!0})})}resize(){if(!this.element)return!1;const t=this._container,e=t.canvas._standardSize,i={width:this.element.offsetWidth,height:this.element.offsetHeight},s=t.retina.pixelRatio,n={width:i.width*s,height:i.height*s};if(i.height===e.height&&i.width===e.width&&n.height===this.element.height&&n.width===this.element.width)return!1;const a={...e};e.height=i.height,e.width=i.width;const o=this.size;return this.element.width=o.width=n.width,this.element.height=o.height=n.height,this._container.started&&t.particles.setResizeFactor({width:e.width/a.width,height:e.height/a.height}),!0}setPointerEvents(t){this.element&&(this._pointerEvents=t,this._repairStyle())}setZoom(t,e){this.zoom=t,this._zoomCenter=e}stop(){this._safeMutationObserver(t=>{t.disconnect()}),this._mutationObserver=void 0,this.render.stop()}async windowResize(){if(!this.element||!this.resize())return;const t=this._container,e=t.updateActualOptions();t.particles.setDensity(),this._applyResizePlugins(),e&&await t.refresh()}_applyResizePlugins=()=>{for(const t of this._resizePlugins)t.resize?.()};_initStyle=()=>{const t=this.element,e=this._container.actualOptions;if(t){this._fullScreen?this._setFullScreenStyle():this._resetOriginalStyle();for(const i in e.style){if(!i||!(i in e.style))continue;const s=e.style[i];s&&t.style.setProperty(i,s,"important")}}};_repairStyle=()=>{const t=this.element;if(!t)return;this._safeMutationObserver(t=>{t.disconnect()}),this._initStyle(),this.initBackground();const e=this._pointerEvents;t.style.pointerEvents=e,t.style.setProperty("pointer-events",e),this._safeMutationObserver(e=>{t instanceof Node&&e.observe(t,{attributes:!0})})};_resetOriginalStyle=()=>{const t=this.element,e=this._originalStyle;t&&e&&Ms(t,e,!0)};_safeMutationObserver=t=>{this._mutationObserver&&t(this._mutationObserver)};_setFullScreenStyle=()=>{const t=this.element;t&&Ms(t,pt(this._container.actualOptions.fullScreen.zIndex),!0)}}class Ss{container;_handlers;_resizeObserver;_resizeTimeout;constructor(t){this.container=t,this._handlers={visibilityChange:()=>{this._handleVisibilityChange()},resize:()=>{this._handleWindowResize()}}}addListeners(){this._manageListeners(!0)}removeListeners(){this._manageListeners(!1)}_handleVisibilityChange=()=>{const t=this.container;t.actualOptions.pauseOnBlur&&(tt().hidden?(t.pageHidden=!0,t.pause()):(t.pageHidden=!1,t.animationStatus?t.play(!0):t.draw(!0)))};_handleWindowResize=()=>{this._resizeTimeout&&(clearTimeout(this._resizeTimeout),delete this._resizeTimeout);const t=async()=>{const t=this.container.canvas;await t.windowResize()};this._resizeTimeout=setTimeout(()=>{t()},this.container.actualOptions.resize.delay*n)};_manageListeners=t=>{const e=this._handlers;this._manageResize(t),ft(document,"visibilitychange",e.visibilityChange,t,!1)};_manageResize=t=>{const e=this._handlers,i=this.container;if(!i.actualOptions.resize.enable)return;if("undefined"==typeof ResizeObserver)return void ft(globalThis,"resize",e.resize,t);const s=i.canvas.element;this._resizeObserver&&!t?(s&&this._resizeObserver.unobserve(s),this._resizeObserver.disconnect(),delete this._resizeObserver):!this._resizeObserver&&t&&s&&(this._resizeObserver=new ResizeObserver(t=>{t.find(t=>t.target===s)&&this._handleWindowResize()}),this._resizeObserver.observe(s))}}function ks(t){if(e=t.outMode,i=t.checkModes,!(e===i||k(i)&&i.includes(e)))return;var e,i;const s=2*t.radius;t.coord>t.maxCoord-s?t.setCb(-t.radius):t.coord<s&&t.setCb(t.radius)}class Os{backColor;bubble;destroyed;direction;effect;effectClose;effectData;fillColor;fillEnabled;fillOpacity;group;id;ignoresResizeRatio;initialPosition;initialVelocity;isRotating;justWarped;lastPathTime;misplaced;moveCenter;offset;opacity;options;outType;pathRotation;position;randomIndexData;retina;roll;rotation;shape;shapeClose;shapeData;sides;size;slow;spawning;strokeColor;strokeOpacity;strokeWidth;unbreakable;velocity;zIndexFactor;_cachedOpacityData={fillOpacity:1,opacity:1,strokeOpacity:1};_cachedPosition=x.origin;_cachedRotateData={sin:0,cos:0};_cachedTransform={a:1,b:0,c:0,d:1};_container;_pluginManager;constructor(t,e){this._pluginManager=t,this._container=e}destroy(t){if(this.unbreakable||this.destroyed)return;this.destroyed=!0,this.bubble.inRange=!1,this.slow.inRange=!1;const e=this._container,i=this.shape?e.shapeDrawers.get(this.shape):void 0;i?.particleDestroy?.(this);for(const i of e.particleDestroyedPlugins)i.particleDestroyed?.(this,t);for(const i of e.particleUpdaters)i.particleDestroyed?.(this,t);this._container.dispatchEvent(_t.particleDestroyed,{particle:this})}draw(t){const e=this._container.canvas.render;e.drawParticlePlugins(this,t),e.drawParticle(this,t)}getAngle(){return this.rotation+(this.pathRotation?this.velocity.angle:0)}getFillColor(){return this._getRollColor(this.bubble.color??De(this.fillColor))}getMass(){return this.getRadius()**2*Math.PI*s}getOpacity(){const t=this.options.zIndex,e=(1-this.zIndexFactor)**t.opacityRate,i=this.bubble.opacity??U(this.opacity?.value??1),s=this.fillOpacity??1,n=this.strokeOpacity??1;return this._cachedOpacityData.fillOpacity=i*s*e,this._cachedOpacityData.opacity=i*e,this._cachedOpacityData.strokeOpacity=i*n*e,this._cachedOpacityData}getPosition(){return this._cachedPosition.x=this.position.x+this.offset.x,this._cachedPosition.y=this.position.y+this.offset.y,this._cachedPosition.z=this.position.z,this._cachedPosition}getRadius(){return this.bubble.radius??this.size.value}getRotateData(){const t=this.getAngle();return this._cachedRotateData.sin=Math.sin(t),this._cachedRotateData.cos=Math.cos(t),this._cachedRotateData}getStrokeColor(){return this._getRollColor(this.bubble.color??De(this.strokeColor))}getTransformData(t){const e=this.getRotateData(),i=this.isRotating;return this._cachedTransform.a=e.cos*(t.a??o),this._cachedTransform.b=i?e.sin*(t.b??1):t.b??r,this._cachedTransform.c=i?-e.sin*(t.c??1):t.c??l,this._cachedTransform.d=e.cos*(t.d??c),this._cachedTransform}init(t,e,i,s){const n=this._container;this.id=t,this.group=s,this.justWarped=!1,this.effectClose=!0,this.shapeClose=!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:{},maxSpeed:0,moveDrift:0,moveSpeed:0,sizeAnimationSpeed:0},this.outType=It.normal,this.ignoresResizeRatio=!0;const a=n.retina.pixelRatio,o=n.actualOptions,r=_e(this._pluginManager,n,o.particles),l=r.reduceDuplicates,c=r.effect.type,d=r.shape.type;this.effect=rt(c,this.id,l),this.shape=rt(d,this.id,l);const u=r.effect,p=r.shape;if(i){if(i.effect?.type){const t=rt(i.effect.type,this.id,l);t&&(this.effect=t,u.load(i.effect))}if(i.shape?.type){const t=rt(i.shape.type,this.id,l);t&&(this.shape=t,p.load(i.shape))}}if(this.effect===h){const t=[...this._container.effectDrawers.keys()];this.effect=t[Math.floor(F()*t.length)]}if(this.shape===h){const t=[...this._container.shapeDrawers.keys()];this.shape=t[Math.floor(F()*t.length)]}this.effectData=this.effect?function(t,e,i,s){const n=e.options[t];return at({close:e.close},rt(n,i,s))}(this.effect,u,this.id,l):void 0,this.shapeData=this.shape?function(t,e,i,s){const n=e.options[t];return at({close:e.close},rt(n,i,s))}(this.shape,p,this.id,l):void 0,r.load(i);const f=this.effectData;f&&r.load(f.particles);const g=this.shapeData;g&&r.load(g.particles),this.effectClose=f?.close??r.effect.close,this.shapeClose=g?.close??r.shape.close,this.options=r,n.retina.initParticle(this),this.size=lt(this.options.size,a),this.bubble={inRange:!1},this.slow={inRange:!1,factor:1},this._initPosition(e),this.initialVelocity=this._calculateVelocity(),this.velocity=this.initialVelocity.copy();let m,_;n.particles.setLastZIndex(this.position.z),this.zIndexFactor=this.position.z/n.zLayers,this.sides=24,this.effect&&(m=n.effectDrawers.get(this.effect)),m?.loadEffect&&m.loadEffect(this),this.shape&&(_=n.shapeDrawers.get(this.shape)),_?.loadShape&&_.loadShape(this);const y=_?.getSidesCount;y&&(this.sides=y(this)),this.spawning=!1;for(const t of n.particleUpdaters)t.init(this);m?.particleInit?.(n,this),_?.particleInit?.(n,this);for(const t of n.particleCreatedPlugins)t.particleCreated?.(this)}isInsideCanvas(){const t=this.getRadius(),e=this._container.canvas.size,i=this.position;return i.x>=-t&&i.y>=-t&&i.y<=e.height+t&&i.x<=e.width+t}isShowingBack(){if(!this.roll)return!1;const t=this.roll.angle;if(this.roll.horizontal&&this.roll.vertical){const e=t%d,i=e<0?e+d:e;return i>=Math.PI*s&&i<3*Math.PI*s}if(this.roll.horizontal){const e=(t+Math.PI*s)%(2*Math.PI),i=e<0?e+2*Math.PI:e;return i>=Math.PI&&i<2*Math.PI}if(this.roll.vertical){const e=t%(2*Math.PI),i=e<0?e+2*Math.PI:e;return i>=Math.PI&&i<2*Math.PI}return!1}isVisible(){return!this.destroyed&&!this.spawning&&this.isInsideCanvas()}reset(){for(const t of this._container.particleUpdaters)t.reset?.(this)}_calcPosition=(t,e)=>{let i=0,s=t?x.create(t.x,t.y,e):void 0;const n=this._container,a=n.particlePositionPlugins,o=this.options.move.outModes,r=this.getRadius(),l=n.canvas.size,c=new AbortController,{signal:h}=c;for(;!h.aborted;){for(const t of a){const i=t.particlePosition?.(s,this);if(i)return x.create(i.x,i.y,e)}const t=j({size:l,position:s}),c=x.create(t.x,t.y,e);this._fixHorizontal(c,r,o.left??o.default),this._fixHorizontal(c,r,o.right??o.default),this._fixVertical(c,r,o.top??o.default),this._fixVertical(c,r,o.bottom??o.default);let h=!0;for(const t of n.particles.checkParticlePositionPlugins)if(h=t.checkParticlePosition?.(this,c,i)??!0,!h)break;if(h)return c;i+=1,s=void 0}return s};_calculateVelocity=()=>{const t=function(t){const e=P.origin;return e.length=1,e.angle=t,e}(this.direction).copy(),e=this.options.move;if(e.direction===w.inside||e.direction===w.outside)return t;const i=q(U(e.angle.value)),n=q(U(e.angle.offset)),a={left:n-i*s,right:n+i*s};return e.straight||(t.angle+=A(G(a.left,a.right))),e.random&&"number"==typeof e.speed&&(t.length*=F()),t};_fixHorizontal=(t,e,i)=>{ks({outMode:i,checkModes:[St.bounce],coord:t.x,maxCoord:this._container.canvas.size.width,setCb:e=>t.x+=e,radius:e})};_fixVertical=(t,e,i)=>{ks({outMode:i,checkModes:[St.bounce],coord:t.y,maxCoord:this._container.canvas.size.height,setCb:e=>t.y+=e,radius:e})};_getRollColor=t=>t&&this.roll&&(this.backColor||this.roll.alter)&&this.isShowingBack()?this.backColor?this.backColor:this.roll.alter?function(t,e,i){return{h:t.h,s:t.s,l:t.l+(e===kt.darken?-1:1)*i}}(t,this.roll.alter.type,this.roll.alter.value):t:t;_initPosition=t=>{const e=this._container,i=U(this.options.zIndex.value),n=this._calcPosition(t,T(i,0,e.zLayers));if(!n)throw new Error("a valid position cannot be found for particle");this.position=n,this.initialPosition=this.position.copy();const a=e.canvas.size;switch(this.moveCenter={...ht(this.options.move.center,a),radius:this.options.move.center.radius,mode:this.options.move.center.mode},this.direction=function(t,e,i){if(C(t))return q(t);switch(t){case w.top:return-Math.PI*s;case w.topRight:return-Math.PI*v;case w.right:return 0;case w.bottomRight:return Math.PI*v;case w.bottom:return Math.PI*s;case w.bottomLeft:return.75*Math.PI;case w.left:return Math.PI;case w.topLeft:return.75*-Math.PI;case w.inside:return Math.atan2(i.y-e.y,i.x-e.x);case w.outside:return Math.atan2(e.y-i.y,e.x-i.x);default:return F()*d}}(this.options.move.direction,this.position,this.moveCenter),this.options.move.direction){case w.inside:this.outType=It.inside;break;case w.outside:this.outType=It.outside}this.offset=P.origin}}class Is{_cellSize;_cells=new Map;_circlePool=[];_circlePoolIdx;_pendingCellSize;_rectanglePool=[];_rectanglePoolIdx;constructor(t){this._cellSize=t,this._circlePoolIdx=0,this._rectanglePoolIdx=0}clear(){this._cells.clear();const t=this._pendingCellSize;t&&(this._cellSize=t),this._pendingCellSize=void 0}insert(t){const{x:e,y:i}=t.getPosition(),s=this._cellKeyFromCoords(e,i);this._cells.has(s)||this._cells.set(s,[]),this._cells.get(s)?.push(t)}query(t,e,i=[]){const s=this._getRangeBounds(t);if(!s)return i;const n=Math.floor(s.minX/this._cellSize),a=Math.floor(s.maxX/this._cellSize),o=Math.floor(s.minY/this._cellSize),r=Math.floor(s.maxY/this._cellSize);for(let s=n;s<=a;s++)for(let n=o;n<=r;n++){const a=`${s}_${n}`,o=this._cells.get(a);if(o)for(const s of o)e&&!e(s)||t.contains(s.getPosition())&&i.push(s)}return i}queryCircle(t,e,i,s=[]){const n=this._acquireCircle(t.x,t.y,e),a=this.query(n,i,s);return this._releaseShapes(),a}queryRectangle(t,e,i,s=[]){const n=this._acquireRectangle(t.x,t.y,e.width,e.height),a=this.query(n,i,s);return this._releaseShapes(),a}setCellSize(t){this._pendingCellSize=t}_acquireCircle(t,e,i){return(this._circlePool[this._circlePoolIdx++]??=new Et(t,e,i)).reset(t,e,i)}_acquireRectangle(t,e,i,s){return(this._rectanglePool[this._rectanglePoolIdx++]??=new Ft(t,e,i,s)).reset(t,e,i,s)}_cellKeyFromCoords(t,e){return`${Math.floor(t/this._cellSize)}_${Math.floor(e/this._cellSize)}`}_getRangeBounds(t){if(t instanceof Et){const e=t.radius,{x:i,y:s}=t.position;return{minX:i-e,maxX:i+e,minY:s-e,maxY:s+e}}if(t instanceof Ft){const{x:e,y:i}=t.position,{width:s,height:n}=t.size;return{minX:e,maxX:e+s,minY:i,maxY:i+n}}return null}_releaseShapes(){this._circlePoolIdx=0,this._rectanglePoolIdx=0}}class Ds{checkParticlePositionPlugins;grid;_array;_container;_groupLimits;_limit;_maxZIndex;_minZIndex;_needsSort;_nextId;_particleResetPlugins;_particleUpdatePlugins;_pluginManager;_pool;_postParticleUpdatePlugins;_postUpdatePlugins;_resizeFactor;_updatePlugins;_zArray;constructor(t,e){this._pluginManager=t,this._container=e,this._nextId=0,this._array=[],this._zArray=[],this._pool=[],this._limit=0,this._groupLimits=new Map,this._needsSort=!1,this._minZIndex=0,this._maxZIndex=0,this.grid=new Is(100),this.checkParticlePositionPlugins=[],this._particleResetPlugins=[],this._particleUpdatePlugins=[],this._postUpdatePlugins=[],this._postParticleUpdatePlugins=[],this._updatePlugins=[]}get count(){return this._array.length}addParticle(t,e,i,s){const n=this._container.actualOptions.particles.number.limit.mode,a=void 0===i?this._limit:this._groupLimits.get(i)??this._limit,o=this.count;if(a>0)switch(n){case Ct.delete:{const t=o+1-a;t>0&&this.removeQuantity(t);break}case Ct.wait:if(o>=a)return}try{const n=this._pool.pop()??new Os(this._pluginManager,this._container);n.init(this._nextId,t,e,i);let a=!0;return s&&(a=s(n)),a?(this._array.push(n),this._zArray.push(n),this._nextId++,this._container.dispatchEvent(_t.particleAdded,{particle:n}),n):void this._pool.push(n)}catch(t){bt().warning(`error adding particle: ${t}`)}}clear(){this._array=[],this._zArray=[]}destroy(){this._array=[],this._pool.length=0,this._zArray=[],this.checkParticlePositionPlugins=[],this._particleResetPlugins=[],this._particleUpdatePlugins=[],this._postUpdatePlugins=[],this._postParticleUpdatePlugins=[],this._updatePlugins=[]}drawParticles(t){for(const e of this._zArray)e.draw(t)}filter(t){return this._array.filter(t)}find(t){return this._array.find(t)}get(t){return this._array[t]}async init(){const t=this._container,e=t.actualOptions;this._minZIndex=0,this._maxZIndex=0,this._needsSort=!1,this.checkParticlePositionPlugins=[],this._updatePlugins=[],this._particleUpdatePlugins=[],this._postUpdatePlugins=[],this._particleResetPlugins=[],this._postParticleUpdatePlugins=[],this.grid=new Is(100*t.retina.pixelRatio);for(const e of t.plugins)e.redrawInit&&await e.redrawInit(),e.checkParticlePosition&&this.checkParticlePositionPlugins.push(e),e.update&&this._updatePlugins.push(e),e.particleUpdate&&this._particleUpdatePlugins.push(e),e.postUpdate&&this._postUpdatePlugins.push(e),e.particleReset&&this._particleResetPlugins.push(e),e.postParticleUpdate&&this._postParticleUpdatePlugins.push(e);await this._container.initDrawersAndUpdaters();for(const e of this._container.effectDrawers.values())await(e.init?.(t));for(const e of this._container.shapeDrawers.values())await(e.init?.(t));let i=!1;for(const e of t.plugins)if(i=e.particlesInitialization?.()??i,i)break;if(!i){const t=e.particles,i=t.groups;for(const e in i){const s=i[e];if(s)for(let i=this.count,n=0;n<s.number.value&&i<t.number.value;i++,n++)this.addParticle(void 0,s,e)}for(let e=this.count;e<t.number.value;e++)this.addParticle()}}push(t,e,i,s){for(let n=0;n<t;n++)this.addParticle(e,i,s)}async redraw(){this.clear(),await this.init(),this._container.canvas.render.drawParticles({value:0,factor:0})}remove(t,e,i){this.removeAt(this._array.indexOf(t),void 0,e,i)}removeAt(t,e=1,i,s){if(t<0||t>this.count)return;let n=0;for(let a=t;n<e&&a<this.count;a++)this._removeParticle(a,i,s)&&(a--,n++)}removeQuantity(t,e){this.removeAt(0,t,e)}setDensity(){const t=this._container.actualOptions,e=t.particles.groups;let i=0;for(const t of this._container.plugins)t.particlesDensityCount&&(i+=t.particlesDensityCount());for(const t in e){const s=e[t];if(!s)continue;const n=_e(this._pluginManager,this._container,s);this._applyDensity(n,i,t)}this._applyDensity(t.particles,i)}setLastZIndex(t){this._needsSort||=t>=this._maxZIndex||t>this._minZIndex&&t<this._maxZIndex}setResizeFactor(t){this._resizeFactor=t}update(t){const e=new Set;this.grid.clear();for(const e of this._updatePlugins)e.update?.(t);const i=this._resizeFactor;for(const s of this._array){i&&!s.ignoresResizeRatio&&(s.position.x*=i.width,s.position.y*=i.height,s.initialPosition.x*=i.width,s.initialPosition.y*=i.height),s.ignoresResizeRatio=!1;for(const t of this._particleResetPlugins)t.particleReset?.(s);for(const e of this._particleUpdatePlugins){if(s.destroyed)break;e.particleUpdate?.(s,t)}s.destroyed?e.add(s):this.grid.insert(s)}for(const e of this._postUpdatePlugins)e.postUpdate?.(t);for(const i of this._array)if(i.destroyed)e.add(i);else{for(const e of this._container.particleUpdaters)e.update(i,t);if(i.destroyed||i.spawning)i.destroyed&&e.add(i);else for(const e of this._postParticleUpdatePlugins)e.postParticleUpdate?.(i,t)}if(e.size)for(const t of e)this.remove(t);if(delete this._resizeFactor,this._needsSort){const t=this._zArray;t.sort((t,e)=>e.position.z-t.position.z||t.id-e.id);const e=t[0],i=t[t.length-1];if(!e||!i)return;this._maxZIndex=e.position.z,this._minZIndex=i.position.z,this._needsSort=!1}}_addToPool=(...t)=>{this._pool.push(...t)};_applyDensity=(t,e,i,s)=>{const n=t.number;if(!n.density.enable)return void(void 0===i?this._limit=n.limit.value:(s?.number.limit.value??n.limit.value)&&this._groupLimits.set(i,s?.number.limit.value??n.limit.value));const a=this._initDensityFactor(n.density),o=n.value,r=n.limit.value>0?n.limit.value:o,l=Math.min(o,r)*a+e,c=Math.min(this.count,this.filter(t=>t.group===i).length);void 0===i?this._limit=n.limit.value*a:this._groupLimits.set(i,n.limit.value*a),c<l?this.push(Math.abs(l-c),void 0,t,i):c>l&&this.removeQuantity(c-l,i)};_initDensityFactor=t=>{const e=this._container;if(!e.canvas.element||!t.enable)return 1;const i=e.canvas.element,s=e.retina.pixelRatio;return i.width*i.height/(t.height*t.width*s**2)};_removeParticle=(t,e,i)=>{const s=this._array[t];if(!s)return!1;if(s.group!==e)return!1;const n=this._zArray.indexOf(s);return this._array.splice(t,1),this._zArray.splice(n,1),s.destroy(i),this._container.dispatchEvent(_t.particleRemoved,{particle:s}),this._addToPool(s),!0}}class Rs{container;pixelRatio;reduceFactor;constructor(t){this.container=t,this.pixelRatio=1,this.reduceFactor=1}init(){const t=this.container,e=t.actualOptions;this.pixelRatio=e.detectRetina?devicePixelRatio:1,this.reduceFactor=1;const i=this.pixelRatio,s=t.canvas;if(s.element){const t=s.element;s.size.width=t.offsetWidth*i,s.size.height=t.offsetHeight*i}}initParticle(t){const e=t.options,i=this.pixelRatio,s=e.move,n=s.distance,a=t.retina;a.maxSpeed=U(s.gravity.maxSpeed)*i,a.moveDrift=U(s.drift)*i,a.moveSpeed=U(s.speed)*i,a.sizeAnimationSpeed=U(e.size.animation.speed)*i;const o=a.maxDistance;o.horizontal=void 0===n.horizontal?void 0:n.horizontal*i,o.vertical=void 0===n.vertical?void 0:n.vertical*i}}function Es(t){return!t.destroyed}function Fs(t,e,...i){const s=new ye(t,e);return me(s,...i),s}var Ls=Object.freeze({__proto__:null,Container:class{actualOptions;canvas;destroyed;effectDrawers;fpsLimit;hdr;id;pageHidden;particleCreatedPlugins;particleDestroyedPlugins;particlePositionPlugins;particleUpdaters;particles;plugins;retina;shapeDrawers;started;zLayers;_delay;_delayTimeout;_delta={value:0,factor:0};_dispatchCallback;_drawAnimationFrame;_duration;_eventListeners;_firstStart;_initialSourceOptions;_lastFrameTime;_lifeTime;_onDestroy;_options;_paused;_pluginManager;_smooth;_sourceOptions;constructor(t){const{dispatchCallback:e,pluginManager:i,id:s,onDestroy:n,sourceOptions:a}=t;this._pluginManager=i,this._dispatchCallback=e,this._onDestroy=n,this.id=Symbol(s),this.fpsLimit=120,this.hdr=!1,this._smooth=!1,this._delay=0,this._duration=0,this._lifeTime=0,this._firstStart=!0,this.started=!1,this.destroyed=!1,this._paused=!0,this._lastFrameTime=0,this.zLayers=100,this.pageHidden=!1,this._sourceOptions=a,this._initialSourceOptions=a,this.effectDrawers=new Map,this.shapeDrawers=new Map,this.particleUpdaters=[],this.retina=new Rs(this),this.canvas=new Cs(this._pluginManager,this),this.particles=new Ds(this._pluginManager,this),this.plugins=[],this.particleDestroyedPlugins=[],this.particleCreatedPlugins=[],this.particlePositionPlugins=[],this._options=Fs(this._pluginManager,this),this.actualOptions=Fs(this._pluginManager,this),this._eventListeners=new Ss(this),this.dispatchEvent(_t.containerBuilt)}get animationStatus(){return!this._paused&&!this.pageHidden&&Es(this)}get options(){return this._options}get sourceOptions(){return this._sourceOptions}addLifeTime(t){this._lifeTime+=t}alive(){return!this._duration||this._lifeTime<=this._duration}destroy(t=!0){if(Es(this)){this.stop(),this.particles.destroy(),this.canvas.destroy();for(const[,t]of this.effectDrawers)t.destroy?.(this);for(const[,t]of this.shapeDrawers)t.destroy?.(this);for(const t of this.plugins)t.destroy?.();this.effectDrawers=new Map,this.shapeDrawers=new Map,this.particleUpdaters=[],this.plugins.length=0,this._pluginManager.clearPlugins(this),this.destroyed=!0,this._onDestroy(t),this.dispatchEvent(_t.containerDestroyed)}}dispatchEvent(t,e){this._dispatchCallback(t,{container:this,data:e})}draw(t){if(!Es(this))return;let e=t;this._drawAnimationFrame=R(t=>{e&&(this._lastFrameTime=void 0,e=!1),this._nextFrame(t)})}async export(t,e={}){for(const i of this.plugins){if(!i.export)continue;const s=await i.export(t,e);if(s.supported)return s.blob}bt().error(`Export plugin with type ${t} not found`)}async init(){if(!Es(this))return;const t=new Map;for(const e of this._pluginManager.plugins){const i=await e.getPlugin(this);i.preInit&&await i.preInit(),t.set(e,i)}await this.initDrawersAndUpdaters(),this._options=Fs(this._pluginManager,this,this._initialSourceOptions,this.sourceOptions),this.actualOptions=Fs(this._pluginManager,this,this._options),this.plugins.length=0,this.particleDestroyedPlugins.length=0,this.particleCreatedPlugins.length=0,this.particlePositionPlugins.length=0;for(const[e,i]of t)e.needsPlugin(this.actualOptions)&&(this.plugins.push(i),i.particleCreated&&this.particleCreatedPlugins.push(i),i.particleDestroyed&&this.particleDestroyedPlugins.push(i),i.particlePosition&&this.particlePositionPlugins.push(i));this.retina.init(),this.canvas.init(),this.updateActualOptions(),this.canvas.initBackground(),this.canvas.resize();const{delay:e,duration:i,fpsLimit:s,hdr:a,smooth:o,zLayers:r}=this.actualOptions;this.hdr=a,this.zLayers=r,this._duration=U(i)*n,this._delay=U(e)*n,this._lifeTime=0,this.fpsLimit=s>0?s:120,this._smooth=o;for(const t of this.plugins)await(t.init?.());await this.particles.init(),this.dispatchEvent(_t.containerInit),this.particles.setDensity();for(const t of this.plugins)t.particlesSetup?.();this.dispatchEvent(_t.particlesSetup)}async initDrawersAndUpdaters(){const t=this._pluginManager;this.effectDrawers=await t.getEffectDrawers(this,!0),this.shapeDrawers=await t.getShapeDrawers(this,!0),this.particleUpdaters=await t.getUpdaters(this,!0)}pause(){var t;if(Es(this)&&(void 0!==this._drawAnimationFrame&&(t=this._drawAnimationFrame,E(t),delete this._drawAnimationFrame),!this._paused)){for(const t of this.plugins)t.pause?.();this.pageHidden||(this._paused=!0),this.dispatchEvent(_t.containerPaused)}}play(t){if(!Es(this))return;const e=this._paused||t;if(!this._firstStart||this.actualOptions.autoPlay){if(this._paused&&(this._paused=!1),e)for(const t of this.plugins)t.play&&t.play();this.dispatchEvent(_t.containerPlay),this.draw(e??!1)}else this._firstStart=!1}async refresh(){if(Es(this))return this.stop(),this.start()}async reset(t){if(Es(this))return this._initialSourceOptions=t,this._sourceOptions=t,this._options=Fs(this._pluginManager,this,this._initialSourceOptions,this.sourceOptions),this.actualOptions=Fs(this._pluginManager,this,this._options),this.refresh()}async start(){Es(this)&&!this.started&&(await this.init(),this.started=!0,await new Promise(t=>{const e=async()=>{this._eventListeners.addListeners();for(const t of this.plugins)await(t.start?.());this.dispatchEvent(_t.containerStarted),this.play(),t()};this._delayTimeout=setTimeout(()=>{e()},this._delay)}))}stop(){if(Es(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();for(const t of this.plugins)t.stop?.();this.particleCreatedPlugins.length=0,this.particleDestroyedPlugins.length=0,this.particlePositionPlugins.length=0,this._sourceOptions=this._options,this.dispatchEvent(_t.containerStopped)}}updateActualOptions(){let t=!1;for(const e of this.plugins)e.updateActualOptions&&(t=e.updateActualOptions()||t);return t}_nextFrame=t=>{try{if(!this._smooth&&void 0!==this._lastFrameTime&&t<this._lastFrameTime+n/this.fpsLimit)return void this.draw(!1);if(this._lastFrameTime??=t,function(t,e,i=60,s=!1){t.value=e,t.factor=s?60/i:60*e/n}(this._delta,t-this._lastFrameTime,this.fpsLimit,this._smooth),this.addLifeTime(this._delta.value),this._lastFrameTime=t,this._delta.value>n)return void this.draw(!1);if(this.canvas.render.drawParticles(this._delta),!this.alive())return void this.destroy();this.animationStatus&&this.draw(!1)}catch(t){bt().error("error in animation loop",t)}}}});function Ts(t,e,i,s,n,a,o){!function(t,e){const i=t.options,s=i.move.path;if(!s.enable)return;const n=t.pathDelay??0;if(t.lastPathTime<=n)return void(t.lastPathTime+=e.value);const a=t.pathGenerator?.generate(t,e);a&&t.velocity.addTo(a);s.clamp&&(t.velocity.x=T(t.velocity.x,-1,1),t.velocity.y=T(t.velocity.y,-1,1));t.lastPathTime-=n}(t,o);const r=t.gravity,l=r?.enable&&r.inverse?-1:1;n&&i&&(t.velocity.x+=n*o.factor/(60*i)),r?.enable&&i&&(t.velocity.y+=l*(r.acceleration*o.factor)/(60*i));const c=t.moveDecay;t.velocity.multTo(c??1);const h=t.velocity.mult(i);r?.enable&&s>0&&(!r.inverse&&h.y>=0&&h.y>=s||r.inverse&&h.y<=0&&h.y<=-s)&&(h.y=l*s,i&&(t.velocity.y=h.y/i));const d=t.options.zIndex,u=(1-t.zIndexFactor)**d.velocityRate;h.multTo(u),h.multTo(a);const{position:p}=t;p.addTo(h),e.vibrate&&(p.x+=Math.sin(p.x*Math.cos(p.y))*a,p.y+=Math.cos(p.y*Math.sin(p.x))*a)}function As(t,e){const i=e.options.move.spin;if(!i.enable)return;const s=i.position??{x:50,y:50},n={x:.01*s.x*t.canvas.size.width,y:.01*s.y*t.canvas.size.height},a=e.getPosition(),o=(l=a,c=n,Math.sqrt($(l,c))),r=U(i.acceleration);var l,c;e.retina.spinAcceleration=r*t.retina.pixelRatio,e.spin={center:n,direction:e.velocity.x>=0?Mt.clockwise:Mt.counterClockwise,angle:F()*d,radius:o,acceleration:e.retina.spinAcceleration}}var Us=Object.freeze({__proto__:null,MovePluginInstance:class{availablePathGenerators;pathGenerators;_container;_pluginManager;constructor(t,e){this._pluginManager=t,this._container=e,this.availablePathGenerators=new Map,this.pathGenerators=new Map}destroy(){this.availablePathGenerators=new Map,this.pathGenerators=new Map}isEnabled(t){return!t.destroyed&&t.options.move.enable}particleCreated(t){const e=t.options.move,i=e.gravity,s=e.path;if(t.moveDecay=1-U(e.decay),t.pathDelay=U(s.delay.value)*n,s.generator){let e=this.pathGenerators.get(s.generator);e||(e=this.availablePathGenerators.get(s.generator),e&&(this.pathGenerators.set(s.generator,e),e.init())),t.pathGenerator=e}t.gravity={enable:i.enable,acceleration:U(i.acceleration),inverse:i.inverse},As(this._container,t)}particleDestroyed(t){const e=t.pathGenerator;e?.reset(t)}particleUpdate(t,e){const i=t.options,n=i.move;if(!n.enable)return;const a=this._container,o=a.retina.pixelRatio,r=function(t){return t.slow.inRange?t.slow.factor:1}(t),l=a.retina.reduceFactor,c=t.retina.moveSpeed,h=t.retina.moveDrift,d=B(i.size.value)*o,u=c*(n.size?t.getRadius()/d:1)*r*(e.factor||1)*s,p=t.retina.maxSpeed;n.spin.enable?function(t,e,i,n){if(!e.spin)return;const a=e.spin.direction===Mt.clockwise,o={x:a?Math.cos:Math.sin,y:a?Math.sin:Math.cos};e.position.x=e.spin.center.x+e.spin.radius*o.x(e.spin.angle)*n,e.position.y=e.spin.center.y+e.spin.radius*o.y(e.spin.angle)*n,e.spin.radius+=e.spin.acceleration*n;const r=Math.max(t.canvas.size.width,t.canvas.size.height),l=r*s;e.spin.radius>l?(e.spin.radius=l,e.spin.acceleration*=-1):e.spin.radius<0&&(e.spin.radius=0,e.spin.acceleration*=-1),e.spin.angle+=.01*i*(1-e.spin.radius/r)}(a,t,u,l):Ts(t,n,u,p,h,l,e),function(t){const e=t.initialPosition,{dx:i,dy:n}=W(e,t.position),a=Math.abs(i),o=Math.abs(n),{maxDistance:r}=t.retina,l=r.horizontal,c=r.vertical;if(!l&&!c)return;if((l&&a>=l||c&&o>=c)&&!t.misplaced)t.misplaced=!!l&&a>l||!!c&&o>c,l&&(t.velocity.x=t.velocity.y*s-t.velocity.x),c&&(t.velocity.y=t.velocity.x*s-t.velocity.y);else if((!l||a<l)&&(!c||o<c)&&t.misplaced)t.misplaced=!1;else if(t.misplaced){const i=t.position,s=t.velocity;l&&(i.x<e.x&&s.x<0||i.x>e.x&&s.x>0)&&(s.x*=-F()),c&&(i.y<e.y&&s.y<0||i.y>e.y&&s.y>0)&&(s.y*=-F())}}(t)}preInit(){return this._init()}redrawInit(){return this._init()}update(){for(const t of this.pathGenerators.values())t.update()}async _init(){const t=await(this._pluginManager.getPathGenerators?.(this._container,!0));if(t){this.availablePathGenerators=t,this.pathGenerators=new Map;for(const t of this.pathGenerators.values())t.init()}}}});var Vs=Object.freeze({__proto__:null,EmittersPluginInstance:class{container;_instancesManager;constructor(t,e){this.container=e,this._instancesManager=t,this._instancesManager.initContainer(e)}async init(){const t=this.container.actualOptions.emitters;if(k(t))for(const e of t)await this._instancesManager.addEmitter(this.container,e);else await this._instancesManager.addEmitter(this.container,t)}pause(){for(const t of this._instancesManager.getArray(this.container))t.pause()}play(){for(const t of this._instancesManager.getArray(this.container))t.play()}resize(){for(const t of this._instancesManager.getArray(this.container))t.resize()}stop(){this._instancesManager.clear(this.container)}update(t){this._instancesManager.getArray(this.container).forEach(e=>{e.update(t)})}}});const Bs=new Map;var Gs=Object.freeze({__proto__:null,ShapeManager:class{addShapeGenerator(t,e){this.getShapeGenerator(t)||Bs.set(t,e)}getShapeGenerator(t){return Bs.get(t)}getSupportedShapeGenerators(){return Bs.keys()}}});var Ws,$s,qs=Object.freeze({__proto__:null,EmittersInstancesManager:class{_containerArrays;_pluginManager;constructor(t){this._containerArrays=new Map,this._pluginManager=t}async addEmitter(t,e,i){const s=new Ri;s.load(e);const{EmitterInstance:n}=await Promise.resolve().then(function(){return Xs}),a=new n(this._pluginManager,t,e=>{this.removeEmitter(t,e)},s,i);return await a.init(),this.getArray(t).push(a),a}clear(t){this.initContainer(t),this._containerArrays.set(t,[])}getArray(t){this.initContainer(t);let e=this._containerArrays.get(t);return e||(e=[],this._containerArrays.set(t,e)),e}initContainer(t){this._containerArrays.has(t)||(this._containerArrays.set(t,[]),t.getEmitter=e=>{const i=this.getArray(t);return void 0===e||C(e)?i[e??0]:i.find(t=>t.name===e)},t.addEmitter=async(e,i)=>this.addEmitter(t,e,i),t.removeEmitter=e=>{const i=t.getEmitter?.(e);i&&this.removeEmitter(t,i)},t.playEmitter=e=>{const i=t.getEmitter?.(e);i&&i.externalPlay()},t.pauseEmitter=e=>{const i=t.getEmitter?.(e);i&&i.externalPause()})}removeEmitter(t,e){const i=this.getArray(t).indexOf(e);i>=0&&this.getArray(t).splice(i,1)}}});!function(t){t.mute="soundsMuted",t.unmute="soundsUnmuted"}(Ws||(Ws={})),function(t){t.Block="block",t.None="none"}($s||($s={}));function Ns(t){const e=tt().createElement("img"),{clickCb:i,container:s,display:n,iconOptions:a,margin:o,options:r,pos:l,rightOffsets:c}=t,{width:h,path:d,style:u,svg:p}=a;!function(t,e,i,s,n,a,o,r){t.style.userSelect="none",t.style.position="absolute",t.style.top=`${(e+o).toString()}px`,t.style.left=`${(i-o-a).toString()}px`,t.style.display=s,t.style.zIndex=(n+1).toString(),t.style.cssText+=r}(e,l.top+o,l.right-(o*(c.length+1)+h+c.reduce((t,e)=>t+e,0)),n,r.fullScreen.zIndex+1,h,o,u),e.src=d??(p?`data:image/svg+xml;base64,${btoa(p)}`:"");return(s.canvas.element?.parentNode??tt().body).append(e),e.addEventListener("click",()=>{i()}),e}function js(t){t&&t.remove()}var Zs=Object.freeze({__proto__:null,SoundsPluginInstance:class{_audioMap;_audioSources;_container;_engine;_gain;_muteImg;_unmuteImg;_volume;_volumeDownImg;_volumeUpImg;constructor(t,e){this._container=t,this._engine=e,this._volume=0,this._audioSources=[],this._audioMap=new Map}async init(){const t=this._container.actualOptions.sounds;if(!t?.enable)return;if(t.autoPlay&&ps()){const t=()=>{removeEventListener(ts,t),removeEventListener(es,t),fs(),this.unmute()},e={capture:!0,once:!0};addEventListener(ts,t,e),addEventListener(es,t,e)}this._volume=t.volume.value;const e=t.events;this._audioMap=new Map;for(const t of e){if(!t.audio)continue;const e=ot(t.audio,async t=>{const e=await fetch(t.source);if(!e.ok)return;const i=await e.arrayBuffer(),s=this._getAudioContext(),n=await s.decodeAudioData(i);this._audioMap.set(t.source,n)});e instanceof Promise?await e:await Promise.allSettled(e)}}async mute(){this._container.muted||await this.toggleMute()}async start(){const t=this._container,e=t.actualOptions,i=e.sounds;if(!i?.enable||!t.canvas.element)return;t.muted=!0;const s=t.canvas.element,n={top:s.offsetTop,right:s.offsetLeft+s.offsetWidth},{mute:a,unmute:o,volumeDown:r,volumeUp:l}=i.icons,c=async()=>{await this.toggleMute()},h=i.icons.enable?$s.Block:$s.None;this._muteImg=Ns({container:t,options:e,pos:n,display:h,iconOptions:a,margin:10,rightOffsets:[r.width,l.width],clickCb:c}),this._unmuteImg=Ns({container:t,options:e,pos:n,display:$s.None,iconOptions:o,margin:10,rightOffsets:[r.width,l.width],clickCb:c}),this._volumeDownImg=Ns({container:t,options:e,pos:n,display:h,iconOptions:r,margin:10,rightOffsets:[l.width],clickCb:async()=>{await this.volumeDown()}}),this._volumeUpImg=Ns({container:t,options:e,pos:n,display:h,iconOptions:l,margin:10,rightOffsets:[],clickCb:async()=>{await this.volumeUp()}}),!ps()&&i.autoPlay&&await this.unmute()}stop(){this._container.muted=!0,(async()=>{await this._mute(),js(this._muteImg),js(this._unmuteImg),js(this._volumeDownImg),js(this._volumeUpImg)})()}async toggleMute(){const t=this._container;t.muted=!t.muted,this._updateMuteIcons(),await this._updateMuteStatus()}async unmute(){this._container.muted&&await this.toggleMute()}async volumeDown(){const t=this._container,e=t.actualOptions.sounds;e?.enable&&(t.muted&&(this._volume=0),this._volume-=e.volume.step,await this._updateVolume())}async volumeUp(){const t=this._container.actualOptions.sounds;t?.enable&&(this._volume+=t.volume.step,await this._updateVolume())}_addBuffer=t=>{const e=t.createBufferSource();return this._audioSources.push(e),e};_addOscillator=t=>{const e=t.createOscillator();return this._audioSources.push(e),e};_getAudioContext(){const t=this._container;return t.audioContext??=new AudioContext,t.audioContext}_initEvents=()=>{const t=this._container,e=t.actualOptions.sounds;if(e?.enable&&t.canvas.element)for(const t of e.events){const e=i=>{i&&(async()=>{const s=t.filter&&!t.filter(i);if(this._container!==i.container)return;if(this._container.muted||this._container.destroyed)return void ot(t.event,t=>{this._engine.removeEventListener(t,e)});if(s)return;if(t.audio){const e=rt(t.audio);if(!e)return;this._playBuffer(e)}else if(t.melodies){const e=it(t.melodies);if(!e)return;e.melodies.length?await Promise.allSettled(e.melodies.map(t=>this._playNote(t.notes,0,e.loop))):await this._playNote(e.notes,0,e.loop)}else if(t.notes){const e=it(t.notes);if(!e)return;await this._playNote([e],0,!1)}})()};ot(t.event,t=>{this._engine.addEventListener(t,e)})}};_mute=async()=>{const t=this._container,e=this._getAudioContext();for(const t of this._audioSources)this._removeAudioSource(t);this._gain&&this._gain.disconnect(),await e.close(),t.audioContext=void 0,this._container.dispatchEvent(Ws.mute)};_playBuffer=t=>{const e=this._audioMap.get(t.source);if(!e)return;const i=this._container.audioContext;if(!i)return;const s=this._addBuffer(i);s.loop=t.loop,s.buffer=e,s.connect(this._gain??i.destination),s.start()};_playFrequency=async(t,e)=>{if(!this._gain||this._container.muted)return;const i=this._getAudioContext(),s=this._addOscillator(i);return s.connect(this._gain),s.type="sine",s.frequency.value=t,s.start(),new Promise(t=>{setTimeout(()=>{this._removeAudioSource(s),t()},e)})};_playMuteSound=()=>{if(this._container.muted)return;const t=this._getAudioContext(),e=t.createGain();e.connect(t.destination),e.gain.value=0;const i=t.createOscillator();i.connect(e),i.type="sine",i.frequency.value=1,i.start(),setTimeout(()=>{i.stop(),i.disconnect(),e.disconnect()})};_playNote=async(t,e,i)=>{if(this._container.muted)return;const s=t[e];if(!s)return;const n=ot(s.value,async(i,s)=>this._playNoteValue(t,e,s));await(k(n)?Promise.allSettled(n):n);let a=e+1;i&&a>=t.length&&(a%=t.length),await this._playNote(t,a,i)};_playNoteValue=async(t,e,i)=>{const s=t[e];if(!s)return;const n=rt(s.value,i,!0);if(n)try{const t=ds(n);if(!C(t))return;await this._playFrequency(t,s.duration)}catch(t){bt().error(t)}};_removeAudioSource=t=>{t.stop(),t.disconnect();this._audioSources.splice(this._audioSources.indexOf(t),1)};_unmute=()=>{const t=this._container.actualOptions.sounds;if(!t)return;const e=this._getAudioContext(),s=e.createGain();s.connect(e.destination),s.gain.value=t.volume.value/i,this._gain=s,this._initEvents(),this._container.dispatchEvent(Ws.unmute)};_updateMuteIcons=()=>{const t=this._container,e=t.actualOptions.sounds;if(!e?.enable||!e.icons.enable)return;const i=this._muteImg,s=this._unmuteImg;i&&(i.style.display=t.muted?"block":"none"),s&&(s.style.display=t.muted?"none":"block")};_updateMuteStatus=async()=>{const t=this._container,e=this._getAudioContext();t.muted?(await e.suspend(),await this._mute()):(await e.resume(),this._unmute(),this._playMuteSound())};_updateVolume=async()=>{const t=this._container,e=t.actualOptions.sounds;if(!e?.enable)return;T(this._volume,e.volume.min,e.volume.max);let s=!1;this._volume<=0&&!t.muted?(this._volume=0,t.muted=!0,s=!0):this._volume>0&&t.muted&&(t.muted=!1,s=!0),s&&(this._updateMuteIcons(),await this._updateMuteStatus()),this._gain?.gain&&(this._gain.gain.value=this._volume/i)}}});function Hs(t,e,i,s){(t.paint??=new ae).fill={color:Bt.create(void 0,{value:e}),enable:s,opacity:i}}function Qs(t,e,i,s){(t.paint??=new ae).stroke={color:Bt.create(void 0,{value:e}),opacity:i,width:s}}var Xs=Object.freeze({__proto__:null,EmitterInstance:class{fill;name;options;position;size;spawnFillColor;spawnFillEnabled;spawnFillOpacity;spawnStrokeColor;spawnStrokeOpacity;spawnStrokeWidth;_container;_currentDuration;_currentEmitDelay;_currentSpawnDelay;_duration;_emitDelay;_firstSpawn;_immortal;_initialPosition;_lifeCount;_mutationObserver;_particlesOptions;_paused;_pluginManager;_removeCallback;_resizeObserver;_shape;_size;_spawnDelay;_startParticlesAdded;constructor(t,e,i,s,a){this._pluginManager=t,this._container=e,this._removeCallback=i,this._currentDuration=0,this._currentEmitDelay=0,this._currentSpawnDelay=0,this._initialPosition=a,s instanceof Ri?this.options=s:(this.options=new Ri,this.options.load(s)),this._spawnDelay=e.retina.reduceFactor?U(this.options.life.delay??0)*n/e.retina.reduceFactor:1/0,this.position=this._initialPosition??this._calcPosition(),this.name=this.options.name,this.fill=this.options.fill,this._firstSpawn=!this.options.life.wait,this._startParticlesAdded=!1;const o=at({},this.options.particles);if(o.move??={},o.move.direction??=this.options.direction,this.options.spawn.fill?.color&&(this.spawnFillColor=Me(this._pluginManager,this.options.spawn.fill.color)),this.options.spawn.stroke?.color&&(this.spawnStrokeColor=Me(this._pluginManager,this.options.spawn.stroke.color)),this._paused=!this.options.autoPlay,this._particlesOptions=o,this._size=this._calcSize(),this.size=dt(this._size,this._container.canvas.size),this._lifeCount=this.options.life.count??-1,this._immortal=this._lifeCount<=0,this.options.domId){const t=tt().getElementById(this.options.domId);t&&(this._mutationObserver=new MutationObserver(()=>{this.resize()}),this._resizeObserver=new ResizeObserver(()=>{this.resize()}),this._mutationObserver.observe(t,{attributes:!0,attributeFilter:["style","width","height"]}),this._resizeObserver.observe(t))}const r=this.options.shape,l=this._pluginManager.emitterShapeManager?.getShapeGenerator(r.type);l&&(this._shape=l.generate(this._container,this.position,this.size,this.fill,r.options)),this._container.dispatchEvent("emitterCreated",{emitter:this}),this.play()}externalPause(){this._paused=!0,this.pause()}externalPlay(){this._paused=!1,this.play()}async init(){await(this._shape?.init())}pause(){this._paused||delete this._emitDelay}play(){if(this._paused)return;if(!(this._lifeCount>0||this._immortal)&&this.options.life.count||!(this._firstSpawn||this._currentSpawnDelay>=(this._spawnDelay??0)))return;const t=this._container;if(void 0===this._emitDelay){const e=U(this.options.rate.delay);this._emitDelay=t.retina.reduceFactor?e*n/t.retina.reduceFactor:1/0}(this._lifeCount>0||this._immortal)&&this._prepareToDie()}resize(){const t=this._initialPosition,e=this._container;this.position=t&&st(t,e.canvas.size,P.origin)?t:this._calcPosition(),this._size=this._calcSize(),this.size=dt(this._size,e.canvas.size),this._shape?.resize(this.position,this.size)}update(t){if(this._paused)return;const e=this._container;this._firstSpawn&&(this._firstSpawn=!1,this._currentSpawnDelay=this._spawnDelay??0,this._currentEmitDelay=this._emitDelay??0),this._startParticlesAdded||(this._startParticlesAdded=!0,this._emitParticles(this.options.startCount)),void 0!==this._duration&&(this._currentDuration+=t.value,this._currentDuration>=this._duration&&(this.pause(),void 0!==this._spawnDelay&&delete this._spawnDelay,this._immortal||this._lifeCount--,this._lifeCount>0||this._immortal?(this.position=this._calcPosition(),this._shape?.resize(this.position,this.size),this._spawnDelay=e.retina.reduceFactor?U(this.options.life.delay??0)*n/e.retina.reduceFactor:1/0):this._destroy(),this._currentDuration-=this._duration,delete this._duration)),void 0!==this._spawnDelay&&(this._currentSpawnDelay+=t.value,this._currentSpawnDelay>=this._spawnDelay&&(this._container.dispatchEvent("emitterPlay"),this.play(),this._currentSpawnDelay-=this._spawnDelay,delete this._spawnDelay)),void 0!==this._emitDelay&&(this._currentEmitDelay+=t.value,this._currentEmitDelay>=this._emitDelay&&(this._emit(),this._currentEmitDelay-=this._emitDelay))}_calcPosition(){const t=this._container;if(this.options.domId){const e=tt().getElementById(this.options.domId);if(e){const i=e.getBoundingClientRect(),n=t.retina.pixelRatio;return{x:(i.x+i.width*s)*n,y:(i.y+i.height*s)*n}}}return N({size:t.canvas.size,position:this.options.position})}_calcSize(){const t=this._container;if(this.options.domId){const e=tt().getElementById(this.options.domId);if(e){const i=e.getBoundingClientRect();return{width:i.width*t.retina.pixelRatio,height:i.height*t.retina.pixelRatio,mode:J.precise}}}return this.options.size??(()=>{const t=new Ii;return t.load({height:0,mode:J.percent,width:0}),t})()}_destroy=()=>{this._mutationObserver?.disconnect(),this._mutationObserver=void 0,this._resizeObserver?.disconnect(),this._resizeObserver=void 0,this._removeCallback(this),this._container.dispatchEvent("emitterDestroyed",{emitter:this})};_emit(){if(this._paused)return;const t=U(this.options.rate.quantity);this._emitParticles(t)}_emitParticles(t){const e=rt(this._particlesOptions)??{},i=this.options.spawn.fill?.color?.animation,s=this.options.spawn.fill?.enable??!!this.options.spawn.fill?.color,n=void 0===this.options.spawn.fill?.opacity?1:U(this.options.spawn.fill.opacity),a=this.options.spawn.stroke?.color?.animation,o=void 0===this.options.spawn.stroke?.opacity?1:U(this.options.spawn.stroke.opacity),r=void 0===this.options.spawn.stroke?.width?1:U(this.options.spawn.stroke.width),l=this._container.retina.reduceFactor,c=!!i,h=!!a,d=!!this._shape,u=c||h,p=u||d,f=u?{h:m,s:_,l:y}:null,g=this.options.shape;for(let c=0;c<t*l;c++){const t=p?at({},e):e;this.spawnFillOpacity=n,this.spawnFillEnabled=s,this.spawnStrokeOpacity=o,this.spawnStrokeWidth=r,this.spawnFillColor&&(i&&f&&(this.spawnFillColor.h=this._setColorAnimation(i.h,this.spawnFillColor.h,f.h,3.6),this.spawnFillColor.s=this._setColorAnimation(i.s,this.spawnFillColor.s,f.s),this.spawnFillColor.l=this._setColorAnimation(i.l,this.spawnFillColor.l,f.l)),Hs(t,this.spawnFillColor,this.spawnFillOpacity,this.spawnFillEnabled)),this.spawnStrokeColor&&(a&&f&&(this.spawnStrokeColor.h=this._setColorAnimation(a.h,this.spawnStrokeColor.h,f.h,3.6),this.spawnStrokeColor.s=this._setColorAnimation(a.s,this.spawnStrokeColor.s,f.s),this.spawnStrokeColor.l=this._setColorAnimation(a.l,this.spawnStrokeColor.l,f.l)),Qs(t,this.spawnStrokeColor,this.spawnStrokeOpacity,this.spawnStrokeWidth));let l=this.position;if(this._shape){const e=this._shape.randomPosition();if(e){l=e.position;const i=g.replace;i.color&&e.color&&Hs(t,e.color,i.opacity?e.opacity??1:1,!0)}else l=null}l&&this._container.particles.addParticle(l,t)}}_prepareToDie=()=>{if(this._paused)return;const t=void 0!==this.options.life.duration?U(this.options.life.duration):void 0;(this._lifeCount>0||this._immortal)&&void 0!==t&&t>0&&(this._duration=t*n)};_setColorAnimation=(t,e,i,s=1)=>{const a=this._container;if(!t.enable)return e;const o=A(t.offset),r=U(this.options.rate.delay),l=a.retina.reduceFactor?r*n/a.retina.reduceFactor:1/0;return(e+U(t.speed)*a.fpsLimit/l+o*s)%i}}});t.loadFireworksPreset=bs,t.tsParticles=Te}),Object.assign(globalThis.window||globalThis,{loadFireworksPreset:(globalThis.__tsParticlesInternals.presets.fireworks||{}).loadFireworksPreset}),delete(globalThis.window||globalThis).tsparticlesInternalExports;
1
+ !function(t){t.__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.bundles=t.__tsParticlesInternals.bundles||{},t.__tsParticlesInternals.effects=t.__tsParticlesInternals.effects||{},t.__tsParticlesInternals.engine=t.__tsParticlesInternals.engine||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},t.__tsParticlesInternals.palettes=t.__tsParticlesInternals.palettes||{},t.__tsParticlesInternals.paths=t.__tsParticlesInternals.paths||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins.emittersShapes=t.__tsParticlesInternals.plugins.emittersShapes||{},t.__tsParticlesInternals.presets=t.__tsParticlesInternals.presets||{},t.__tsParticlesInternals.shapes=t.__tsParticlesInternals.shapes||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.utils=t.__tsParticlesInternals.utils||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas.utils=t.__tsParticlesInternals.canvas.utils||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path.utils=t.__tsParticlesInternals.path.utils||{};var e="undefined"!=typeof Proxy?function(t){return new Proxy(t,{get:function(t,e){return e in t||(t[e]={}),t[e]}})}:function(t){return t};t.__tsParticlesInternals.bundles=e(t.__tsParticlesInternals.bundles),t.__tsParticlesInternals.effects=e(t.__tsParticlesInternals.effects),t.__tsParticlesInternals.interactions=e(t.__tsParticlesInternals.interactions),t.__tsParticlesInternals.palettes=e(t.__tsParticlesInternals.palettes),t.__tsParticlesInternals.paths=e(t.__tsParticlesInternals.paths),t.__tsParticlesInternals.plugins=e(t.__tsParticlesInternals.plugins),t.__tsParticlesInternals.plugins.emittersShapes=e(t.__tsParticlesInternals.plugins.emittersShapes),t.__tsParticlesInternals.presets=e(t.__tsParticlesInternals.presets),t.__tsParticlesInternals.shapes=e(t.__tsParticlesInternals.shapes),t.__tsParticlesInternals.updaters=e(t.__tsParticlesInternals.updaters),t.__tsParticlesInternals.utils=e(t.__tsParticlesInternals.utils),t.__tsParticlesInternals.canvas=e(t.__tsParticlesInternals.canvas),t.__tsParticlesInternals.path=e(t.__tsParticlesInternals.path),t.tsparticlesInternalExports=t.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.presets=t.__tsParticlesInternals.presets||{},t.__tsParticlesInternals.presets.fireworks=t.__tsParticlesInternals.presets.fireworks||{}))}(this,function(t){"use strict";const e="generated",i=100,s=.5,n=1e3,a={x:0,y:0,z:0},o=1,r=0,l=0,c=1,h="random",d=2*Math.PI,u="true",p="false",f="canvas",g=255,m=360,_=100,y=100,v=.25;var w;function b(t){return"z"in t?t.z:a.z}!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"}(w||(w={}));class x{x;y;z;constructor(t=a.x,e=a.y,i=a.z){this.x=t,this.y=e,this.z=i}static get origin(){return x.create(a.x,a.y,a.z)}get angle(){return Math.atan2(this.y,this.x)}set angle(t){this._updateFromAngle(t,this.length)}get length(){return Math.sqrt(this.getLengthSq())}set length(t){this._updateFromAngle(this.angle,t)}static clone(t){return x.create(t.x,t.y,b(t))}static create(t,e,i){return"number"==typeof t?new x(t,e??a.y,i??a.z):new x(t.x,t.y,b(t))}add(t){return x.create(this.x+t.x,this.y+t.y,this.z+b(t))}addTo(t){this.x+=t.x,this.y+=t.y,this.z+=b(t)}copy(){return x.clone(this)}div(t){return x.create(this.x/t,this.y/t,this.z/t)}divTo(t){this.x/=t,this.y/=t,this.z/=t}getLengthSq(){return this.x**2+this.y**2}mult(t){return x.create(this.x*t,this.y*t,this.z*t)}multTo(t){this.x*=t,this.y*=t,this.z*=t}normalize(){const t=this.length;0!=t&&this.multTo(1/t)}rotate(t){return x.create(this.x*Math.cos(t)-this.y*Math.sin(t),this.x*Math.sin(t)+this.y*Math.cos(t),a.z)}setTo(t){this.x=t.x,this.y=t.y,this.z=b(t)}sub(t){return x.create(this.x-t.x,this.y-t.y,this.z-b(t))}subFrom(t){this.x-=t.x,this.y-=t.y,this.z-=b(t)}_updateFromAngle(t,e){this.x=Math.cos(t)*e,this.y=Math.sin(t)*e}}class P extends x{constructor(t=a.x,e=a.y){super(t,e,a.z)}static get origin(){return P.create(a.x,a.y)}static clone(t){return P.create(t.x,t.y)}static create(t,e){return"number"==typeof t?new P(t,e??a.y):new P(t.x,t.y)}}function z(t){return"boolean"==typeof t}function M(t){return"string"==typeof t}function C(t){return"number"==typeof t}function S(t){return"object"==typeof t&&null!==t}function k(t){return Array.isArray(t)}function O(t){return null==t}const I=Math.PI/180;let D=Math.random;const R=t=>requestAnimationFrame(t),E=t=>{cancelAnimationFrame(t)};function F(){return T(D(),0,1-Number.EPSILON)}function L(t,e){return F()*(e-t)+t}function T(t,e,i){return Math.min(Math.max(t,e),i)}function A(t){const e=B(t);let i=V(t);return e===i&&(i=0),L(i,e)}function U(t){return C(t)?t:A(t)}function V(t){return C(t)?t:t.min}function B(t){return C(t)?t:t.max}function G(t,e){if(t===e||void 0===e&&C(t))return t;const i=V(t),s=B(t);return void 0!==e?{min:Math.min(i,e),max:Math.max(s,e)}:G(i,s)}function W(t,e){const i=t.x-e.x,s=t.y-e.y;return{dx:i,dy:s,distance:Math.hypot(i,s)}}function $(t,e){const i=t.x-e.x,s=t.y-e.y;return i*i+s*s}function q(t){return t*I}function N(t){const e={x:void 0!==t.position?.x?U(t.position.x):void 0,y:void 0!==t.position?.y?U(t.position.y):void 0};return function(t){return{x:(t.position?.x??F()*i)*t.size.width/i,y:(t.position?.y??F()*i)*t.size.height/i}}({size:t.size,position:e})}function j(t){const{position:e,size:i}=t;return{x:e?.x??F()*i.width,y:e?.y??F()*i.height}}function Z(t){return t?t.endsWith("%")?parseFloat(t)/i:parseFloat(t):1}var H,Q,X,Y,J,K;!function(t){t.auto="auto",t.increase="increase",t.decrease="decrease",t.random="random"}(H||(H={})),function(t){t.increasing="increasing",t.decreasing="decreasing"}(Q||(Q={})),function(t){t.none="none",t.max="max",t.min="min"}(X||(X={})),function(t){t.bottom="bottom",t.left="left",t.right="right",t.top="top"}(Y||(Y={})),function(t){t.precise="precise",t.percent="percent"}(J||(J={})),function(t){t.max="max",t.min="min",t.random="random"}(K||(K={}));function tt(){return globalThis.document}function et(t){if("undefined"!=typeof matchMedia)return matchMedia(t)}function it(t,e,i=!0){return t[void 0!==e&&i?e%t.length:function(t){return Math.floor(F()*t.length)}(t)]}function st(t,e,i,s,n){return function(t,e,i,s){let n=!0;s&&s!==Y.bottom||(n=t.top<e.height+i.x);!n||s&&s!==Y.left||(n=t.right>i.x);!n||s&&s!==Y.right||(n=t.left<e.width+i.y);!n||s&&s!==Y.top||(n=t.bottom>i.y);return n}(nt(t,s??0),e,i,n)}function nt(t,e){return{bottom:t.y+e,left:t.x-e,right:t.x+e,top:t.y-e}}function at(t,...e){for(const i of e){if(O(i))continue;if(!S(i)){t=i;continue}Array.isArray(i)?Array.isArray(t)||(t=[]):S(t)&&!Array.isArray(t)||(t={});const e=Object.keys(i),s=new Set(["__proto__","constructor","prototype"]);if(!e.some(t=>{const e=i[t];return S(e)||Array.isArray(e)})){const n=i,a=t;for(const t of e)if(!s.has(t)&&t in n){const e=n[t];void 0!==e&&(a[t]=e)}continue}for(const n of e){if(s.has(n))continue;const e=t,a=i[n];e[n]=Array.isArray(a)?a.map(t=>at(void 0,t)):at(e[n],a)}}return t}function ot(t,e){return k(t)?t.map((t,i)=>e(t,i)):e(t,0)}function rt(t,e,i){return k(t)?it(t,e,i):t}function lt(t,e){const i=t.value,a=t.animation,o={delayTime:U(a.delay)*n,enable:a.enable,value:U(t.value)*e,max:B(i)*e,min:V(i)*e,loops:0,maxLoops:U(a.count),time:0};if(a.enable){switch(o.decay=1-U(a.decay),a.mode){case H.increase:o.status=Q.increasing;break;case H.decrease:o.status=Q.decreasing;break;case H.random:o.status=F()>=s?Q.increasing:Q.decreasing}const t=a.mode===H.auto;switch(a.startValue){case K.min:o.value=o.min,t&&(o.status=Q.increasing);break;case K.max:o.value=o.max,t&&(o.status=Q.decreasing);break;case K.random:default:o.value=A(o),t&&(o.status=F()>=s?Q.increasing:Q.decreasing)}}return o.initialValue=o.value,o}function ct(t,e){if(!(t.mode===J.percent)){const{mode:e,...i}=t;return i}return"x"in t?{x:t.x/i*e.width,y:t.y/i*e.height}:{width:t.width/i*e.width,height:t.height/i*e.height}}function ht(t,e){return ct(t,e)}function dt(t,e){return ct(t,e)}function ut(t,e,i,s,n){if(t.destroyed||!e.enable||(e.maxLoops??0)>0&&(e.loops??0)>(e.maxLoops??0))return;const a=(e.velocity??0)*n.factor,o=e.min,r=e.max,l=e.decay??1;if(e.time??=0,(e.delayTime??0)>0&&e.time<(e.delayTime??0)&&(e.time+=n.value),!((e.delayTime??0)>0&&e.time<(e.delayTime??0))){switch(e.status){case Q.increasing:e.value+=a;break;case Q.decreasing:e.value-=a}switch(e.velocity&&1!==l&&(e.velocity*=l),e.status){case Q.increasing:e.value>=r&&(i?e.status=Q.decreasing:e.value-=r,e.loops??=0,e.loops++);break;case Q.decreasing:e.value<=o&&(i?e.status=Q.increasing:e.value+=r,e.loops??=0,e.loops++)}!function(t,e,i,s,n){switch(e){case X.max:i>=n&&t.destroy();break;case X.min:i<=s&&t.destroy()}}(t,s,e.value,o,r),t.destroyed||(e.value=T(e.value,o,r))}}const pt=function(t){const e=new Map,i=(t,e=new WeakSet)=>{if(null===t)return"null";const s=typeof t;if("undefined"===s)return"undefined";if("number"===s||"boolean"===s||"string"===s)return JSON.stringify(t);if("function"===s)try{return t.toString()}catch{return'"[Function]"'}if("symbol"===s)try{return t.toString()}catch{return'"[Symbol]"'}if(Array.isArray(t))return`[${t.map(t=>i(t,e)).join(",")}]`;if(e.has(t))return'"[Circular]"';e.add(t);return`{${Object.keys(t).sort().map(s=>`${JSON.stringify(s)}:${i(t[s],e)}`).join(",")}}`},s=t=>(t=>i(t))(t);return(...i)=>{const n=s(i),a=Date.now(),o=e.get(n);if(void 0!==o)return e.delete(n),e.set(n,{value:o.value,ts:o.ts}),o.value;const r=t(...i);return e.set(n,{value:r,ts:a}),r}}(function(t){const e=tt().createElement("div").style,i={width:"100%",height:"100%",margin:"0",padding:"0",borderWidth:"0",position:"fixed",zIndex:t.toString(10),"z-index":t.toString(10),top:"0",left:"0","pointer-events":"none"};for(const t in i){const s=i[t];void 0!==s&&e.setProperty(t,s)}return e});function ft(t,e,i,s,n){if(s){let s={passive:!0};z(n)?s.capture=n:void 0!==n&&(s=n),t.addEventListener(e,i,s)}else{const s=n;t.removeEventListener(e,i,s)}}async function gt(t,e,i,s=!1){let n=e.get(t);if(!n||s){const s=await Promise.all([...i.entries()].map(([e,i])=>i(t).then(t=>[e,t])));n=new Map(s),e.set(t,n)}return n}class mt{_listeners;constructor(){this._listeners=new Map}addEventListener(t,e){this.removeEventListener(t,e);let i=this._listeners.get(t);i||(i=[],this._listeners.set(t,i)),i.push(e)}dispatchEvent(t,e){const i=this._listeners.get(t);i?.forEach(t=>{t(e)})}hasEventListener(t){return!!this._listeners.get(t)}removeAllEventListeners(t){t?this._listeners.delete(t):this._listeners=new Map}removeEventListener(t,e){const i=this._listeners.get(t);if(!i)return;const s=i.length,n=i.indexOf(e);n<0||(1===s?this._listeners.delete(t):i.splice(n,1))}}var _t;!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"}(_t||(_t={}));class yt{colorManagers=new Map;easingFunctions=new Map;effectDrawers=new Map;initializers={effects:new Map,shapes:new Map,updaters:new Map};palettes=new Map;plugins=[];presets=new Map;shapeDrawers=new Map;updaters=new Map;_allLoadersSet=new Set;_configs=new Map;_engine;_executedSet=new Set;_initialized=!1;_isRunningLoaders=!1;_loadPromises=new Set;constructor(t){this._engine=t}get configs(){const t={};for(const[e,i]of this._configs)t[e]=i;return t}addColorManager(t,e){this.colorManagers.set(t,e)}addConfig(t){const e=t.key??t.name??"default";this._configs.set(e,t),this._engine.dispatchEvent(_t.configAdded,{data:{name:e,config:t}})}addEasing(t,e){this.easingFunctions.get(t)||this.easingFunctions.set(t,e)}addEffect(t,e){this.initializers.effects.set(t,e)}addPalette(t,e){this.palettes.set(t,e)}addParticleUpdater(t,e){this.initializers.updaters.set(t,e)}addPlugin(t){this.getPlugin(t.id)||this.plugins.push(t)}addPreset(t,e,i=!1){!i&&this.getPreset(t)||this.presets.set(t,e)}addShape(t,e){for(const i of t)this.initializers.shapes.set(i,e)}clearPlugins(t){this.effectDrawers.delete(t),this.shapeDrawers.delete(t),this.updaters.delete(t)}getEasing(t){return this.easingFunctions.get(t)??(t=>t)}getEffectDrawers(t,e=!1){return gt(t,this.effectDrawers,this.initializers.effects,e)}getPalette(t){return this.palettes.get(t)}getPlugin(t){return this.plugins.find(e=>e.id===t)}getPreset(t){return this.presets.get(t)}async getShapeDrawers(t,e=!1){return gt(t,this.shapeDrawers,this.initializers.shapes,e)}async getUpdaters(t,e=!1){return async function(t,e,i,s=!1){let n=e.get(t);return n&&!s||(n=await Promise.all([...i.values()].map(e=>e(t))),e.set(t,n)),n}(t,this.updaters,this.initializers.updaters,e)}async init(){if(!this._initialized&&!this._isRunningLoaders){this._isRunningLoaders=!0,this._executedSet=new Set,this._allLoadersSet=new Set(this._loadPromises);try{for(const t of this._allLoadersSet)await this._runLoader(t,this._executedSet,this._allLoadersSet)}finally{this._loadPromises.clear(),this._isRunningLoaders=!1,this._initialized=!0}}}loadParticlesOptions(t,e,...i){const s=this.updaters.get(t);s&&s.forEach(t=>t.loadOptions?.(e,...i))}async register(...t){if(this._initialized)throw new Error("Register plugins can only be done before calling tsParticles.load()");for(const e of t)this._isRunningLoaders?await this._runLoader(e,this._executedSet,this._allLoadersSet):this._loadPromises.add(e)}async _runLoader(t,e,i){e.has(t)||(e.add(t),i.add(t),await t(this._engine))}}const vt=t=>(...e)=>{t(...e)},wt={debug:vt(console.debug),error:(t,...e)=>{console.error(`tsParticles - Error - ${t}`,...e)},info:vt(console.info),log:vt(console.log),trace:vt(console.trace),verbose:vt(console.log),warning:vt(console.warn)};function bt(){return wt}const xt="100%";class Pt{pluginManager=new yt(this);_domArray=[];_eventDispatcher=new mt;_initialized=!1;get items(){return this._domArray}get version(){return"4.0.0-beta.16"}addEventListener(t,e){this._eventDispatcher.addEventListener(t,e)}checkVersion(t){if(this.version!==t)throw new Error(`The tsParticles version is different from the loaded plugins version. Engine version: ${this.version}. Plugin version: ${t}`)}dispatchEvent(t,e){this._eventDispatcher.dispatchEvent(t,e)}async init(){this._initialized||(await this.pluginManager.init(),this._initialized=!0)}item(t){const{items:e}=this,i=e[t];if(!i?.destroyed)return i;e.splice(t,1)}async load(t){await this.init();const{Container:i}=await Promise.resolve().then(function(){return Ls}),s=t.id??t.element?.id??`tsparticles${Math.floor(1e4*F()).toString()}`,{index:n,url:a}=t,o=a?await async function(t){const e=rt(t.url,t.index);if(!e)return t.fallback;const i=await fetch(e);return i.ok?await i.json():(bt().error(`${i.status.toString()} while retrieving config file`),t.fallback)}({fallback:t.options,url:a,index:n}):t.options,r=rt(o,n),{items:l}=this,c=l.findIndex(t=>t.id.description===s),h=new i({dispatchCallback:(t,e)=>{this.dispatchEvent(t,e)},id:s,onDestroy:t=>{if(!t)return;const e=this.items,i=e.indexOf(h);i>=0&&e.splice(i,1)},pluginManager:this.pluginManager,sourceOptions:r});if(c>=0){const t=this.item(c),e=t?1:0;t&&!t.destroyed&&t.destroy(!1),l.splice(c,e,h)}else l.push(h);const d=((t,i)=>{const s=tt();let n=i??s.getElementById(t);return n||(n=s.createElement("canvas"),n.id=t,n.dataset[e]=u,s.body.append(n),n)})(s,t.element),g=(t=>{const i=tt();let s;if(t instanceof HTMLCanvasElement||t.tagName.toLowerCase()===f)s=t,s.dataset[e]??=p,s.dataset[e]===u&&(s.style.width||=xt,s.style.height||=xt,s.style.pointerEvents="none",s.style.setProperty("pointer-events","none"));else{const n=t.getElementsByTagName(f)[0];n?(s=n,s.dataset[e]=p):(s=i.createElement(f),s.dataset[e]=u,t.appendChild(s)),s.style.width||=xt,s.style.height||=xt,s.style.pointerEvents="none",s.style.setProperty("pointer-events","none")}return s})(d);return h.canvas.loadCanvas(g),await h.start(),h}async refresh(t=!0){t&&await Promise.all(this.items.map(t=>t.refresh()))}removeEventListener(t,e){this._eventDispatcher.removeEventListener(t,e)}}var zt,Mt,Ct,St,kt,Ot,It,Dt;!function(t){t.circle="circle",t.rectangle="rectangle"}(zt||(zt={}));class Rt{position;type;constructor(t,e,i){this.position={x:t,y:e},this.type=i}_resetPosition(t,e){this.position.x=t,this.position.y=e}}class Et extends Rt{radius;constructor(t,e,i){super(t,e,zt.circle),this.radius=i}contains(t){return e=t,i=this.position,s=this.radius,$(e,i)<=s*s;var e,i,s}intersects(t){const e=this.position,i=t.position,s=this.radius,n=Math.abs(i.x-e.x),a=Math.abs(i.y-e.y);if(t instanceof Et||t.type===zt.circle){return s+t.radius>Math.hypot(n,a)}if(t instanceof Ft||t.type===zt.rectangle){const e=t,{width:i,height:o}=e.size;return Math.pow(n-i,2)+Math.pow(a-o,2)<=s**2||n<=s+i&&a<=s+o||n<=i||a<=o}return!1}reset(t,e,i){return this._resetPosition(t,e),this.radius=i,this}}class Ft extends Rt{size;constructor(t,e,i,s){super(t,e,zt.rectangle),this.size={height:s,width:i}}contains(t){const e=this.size.width,i=this.size.height,s=this.position;return t.x>=s.x&&t.x<=s.x+e&&t.y>=s.y&&t.y<=s.y+i}intersects(t){if(t instanceof Et)return t.intersects(this);if(!(t instanceof Ft))return!1;const e=this.size.width,i=this.size.height,s=this.position,n=t.position,a=t.size,o=a.width,r=a.height;return n.x<s.x+e&&n.x+o>s.x&&n.y<s.y+i&&n.y+r>s.y}reset(t,e,i,s){return this._resetPosition(t,e),this.size.width=i,this.size.height=s,this}}!function(t){t.clockwise="clockwise",t.counterClockwise="counter-clockwise",t.random="random"}(Mt||(Mt={})),function(t){t.delete="delete",t.wait="wait"}(Ct||(Ct={})),function(t){t.bounce="bounce",t.none="none",t.out="out",t.destroy="destroy",t.split="split"}(St||(St={})),function(t){t.darken="darken",t.enlighten="enlighten"}(kt||(kt={})),function(t){t.linear="linear",t.radial="radial",t.random="random"}(Ot||(Ot={})),function(t){t.normal="normal",t.inside="inside",t.outside="outside"}(It||(It={})),function(t){t.easeInBack="ease-in-back",t.easeInBounce="ease-in-bounce",t.easeInCirc="ease-in-circ",t.easeInCubic="ease-in-cubic",t.easeInElastic="ease-in-elastic",t.easeInExpo="ease-in-expo",t.easeInGaussian="ease-in-gaussian",t.easeInLinear="ease-in-linear",t.easeInQuad="ease-in-quad",t.easeInQuart="ease-in-quart",t.easeInQuint="ease-in-quint",t.easeInSigmoid="ease-in-sigmoid",t.easeInSine="ease-in-sine",t.easeInSmoothstep="ease-in-smoothstep",t.easeOutBack="ease-out-back",t.easeOutBounce="ease-out-bounce",t.easeOutCirc="ease-out-circ",t.easeOutCubic="ease-out-cubic",t.easeOutElastic="ease-out-elastic",t.easeOutExpo="ease-out-expo",t.easeOutGaussian="ease-out-gaussian",t.easeOutLinear="ease-out-linear",t.easeOutQuad="ease-out-quad",t.easeOutQuart="ease-out-quart",t.easeOutQuint="ease-out-quint",t.easeOutSigmoid="ease-out-sigmoid",t.easeOutSine="ease-out-sine",t.easeOutSmoothstep="ease-out-smoothstep",t.easeInOutBack="ease-in-out-back",t.easeInOutBounce="ease-in-out-bounce",t.easeInOutCirc="ease-in-out-circ",t.easeInOutCubic="ease-in-out-cubic",t.easeInOutElastic="ease-in-out-elastic",t.easeInOutExpo="ease-in-out-expo",t.easeInOutGaussian="ease-in-out-gaussian",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.easeInOutSigmoid="ease-in-out-sigmoid",t.easeInOutSine="ease-in-out-sine",t.easeInOutSmoothstep="ease-in-out-smoothstep"}(Dt||(Dt={}));class Lt{count;decay;delay;enable;speed;sync;constructor(){this.count=0,this.enable=!1,this.speed=1,this.decay=0,this.delay=0,this.sync=!1}load(t){O(t)||(void 0!==t.count&&(this.count=G(t.count)),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.speed&&(this.speed=G(t.speed)),void 0!==t.decay&&(this.decay=G(t.decay)),void 0!==t.delay&&(this.delay=G(t.delay)),void 0!==t.sync&&(this.sync=t.sync))}}class Tt extends Lt{mode;startValue;constructor(){super(),this.mode=H.auto,this.startValue=K.random}load(t){super.load(t),O(t)||(void 0!==t.mode&&(this.mode=t.mode),void 0!==t.startValue&&(this.startValue=t.startValue))}}class At extends Lt{max;min;offset;constructor(t,e){super(),this.min=t,this.max=e,this.offset=0,this.sync=!0}load(t){super.load(t),O(t)||(void 0!==t.max&&(this.max=t.max),void 0!==t.min&&(this.min=t.min),void 0!==t.offset&&(this.offset=G(t.offset)))}}class Ut{h=new At(0,m);l=new At(0,y);s=new At(0,_);load(t){O(t)||(this.h.load(t.h),this.s.load(t.s),this.l.load(t.l))}}class Vt{value;constructor(){this.value=""}static create(t,e){const i=new Vt;return i.load(t),void 0!==e&&(M(e)||k(e)?i.load({value:e}):i.load(e)),i}load(t){O(t)||O(t.value)||(this.value=t.value)}}class Bt extends Vt{animation;constructor(){super(),this.animation=new Ut}static create(t,e){const i=new Bt;return i.load(t),void 0!==e&&(M(e)||k(e)?i.load({value:e}):i.load(e)),i}load(t){if(super.load(t),O(t))return;const e=t.animation;void 0!==e&&(void 0===e.enable?this.animation.load(t.animation):this.animation.h.load(e))}}class Gt{color;image;opacity;position;repeat;size;constructor(){this.color=new Vt,this.color.value="",this.image="",this.position="",this.repeat="",this.size="",this.opacity=1}load(t){O(t)||(void 0!==t.color&&(this.color=Vt.create(this.color,t.color)),void 0!==t.image&&(this.image=t.image),void 0!==t.position&&(this.position=t.position),void 0!==t.repeat&&(this.repeat=t.repeat),void 0!==t.size&&(this.size=t.size),void 0!==t.opacity&&(this.opacity=t.opacity))}}class Wt{enable;zIndex;constructor(){this.enable=!0,this.zIndex=0}load(t){O(t)||(void 0!==t.enable&&(this.enable=t.enable),void 0!==t.zIndex&&(this.zIndex=t.zIndex))}}class $t{delay;enable;constructor(){this.delay=.5,this.enable=!0}load(t){O(t)||(void 0!==t.delay&&(this.delay=t.delay),void 0!==t.enable&&(this.enable=t.enable))}}class qt{close;options;type;constructor(){this.close=!0,this.options={},this.type=[]}load(t){if(O(t))return;const e=t.options;if(void 0!==e)for(const t in e){const i=e[t];i&&(this.options[t]=at(this.options[t]??{},i))}void 0!==t.close&&(this.close=t.close),void 0!==t.type&&(this.type=t.type)}}class Nt{color;enable;opacity;constructor(){this.enable=!0,this.opacity=1}load(t){O(t)||(void 0!==t.color&&(this.color=Bt.create(this.color,t.color)),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.opacity&&(this.opacity=G(t.opacity)))}}class jt{offset;value;constructor(){this.offset=0,this.value=90}load(t){O(t)||(void 0!==t.offset&&(this.offset=G(t.offset)),void 0!==t.value&&(this.value=G(t.value)))}}class Zt{mode;radius;x;y;constructor(){this.x=50,this.y=50,this.mode=J.percent,this.radius=0}load(t){O(t)||(void 0!==t.x&&(this.x=t.x),void 0!==t.y&&(this.y=t.y),void 0!==t.mode&&(this.mode=t.mode),void 0!==t.radius&&(this.radius=t.radius))}}class Ht{acceleration;enable;inverse;maxSpeed;constructor(){this.acceleration=9.81,this.enable=!1,this.inverse=!1,this.maxSpeed=50}load(t){O(t)||(void 0!==t.acceleration&&(this.acceleration=G(t.acceleration)),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.inverse&&(this.inverse=t.inverse),void 0!==t.maxSpeed&&(this.maxSpeed=G(t.maxSpeed)))}}class Qt{value;constructor(){this.value=0}load(t){O(t)||O(t.value)||(this.value=G(t.value))}}class Xt extends Qt{animation=new Lt;load(t){if(super.load(t),O(t))return;const e=t.animation;void 0!==e&&this.animation.load(e)}}class Yt extends Xt{animation;constructor(){super(),this.animation=new Tt}load(t){super.load(t)}}class Jt{clamp;delay;enable;generator;options;constructor(){this.clamp=!0,this.delay=new Qt,this.enable=!1,this.options={}}load(t){O(t)||(void 0!==t.clamp&&(this.clamp=t.clamp),this.delay.load(t.delay),void 0!==t.enable&&(this.enable=t.enable),this.generator=t.generator,t.options&&(this.options=at(this.options,t.options)))}}class Kt{bottom;default;left;right;top;constructor(){this.default=St.out}load(t){O(t)||(void 0!==t.default&&(this.default=t.default),this.bottom=t.bottom??t.default,this.left=t.left??t.default,this.right=t.right??t.default,this.top=t.top??t.default)}}class te{acceleration;enable;position;constructor(){this.acceleration=0,this.enable=!1}load(t){O(t)||(void 0!==t.acceleration&&(this.acceleration=G(t.acceleration)),void 0!==t.enable&&(this.enable=t.enable),t.position&&(this.position=at({},t.position)))}}class ee{angle;center;decay;direction;distance;drift;enable;gravity;outModes;path;random;size;speed;spin;straight;vibrate;warp;constructor(){this.angle=new jt,this.center=new Zt,this.decay=0,this.distance={},this.direction=w.none,this.drift=0,this.enable=!1,this.gravity=new Ht,this.path=new Jt,this.outModes=new Kt,this.random=!1,this.size=!1,this.speed=2,this.spin=new te,this.straight=!1,this.vibrate=!1,this.warp=!1}load(t){if(O(t))return;this.angle.load(C(t.angle)?{value:t.angle}:t.angle),this.center.load(t.center),void 0!==t.decay&&(this.decay=G(t.decay)),void 0!==t.direction&&(this.direction=t.direction),void 0!==t.distance&&(this.distance=C(t.distance)?{horizontal:t.distance,vertical:t.distance}:{...t.distance}),void 0!==t.drift&&(this.drift=G(t.drift)),void 0!==t.enable&&(this.enable=t.enable),this.gravity.load(t.gravity);const e=t.outModes;void 0!==e&&(S(e)?this.outModes.load(e):this.outModes.load({default:e})),this.path.load(t.path),void 0!==t.random&&(this.random=t.random),void 0!==t.size&&(this.size=t.size),void 0!==t.speed&&(this.speed=G(t.speed)),this.spin.load(t.spin),void 0!==t.straight&&(this.straight=t.straight),void 0!==t.vibrate&&(this.vibrate=t.vibrate),void 0!==t.warp&&(this.warp=t.warp)}}class ie extends Tt{destroy;constructor(){super(),this.destroy=X.none,this.speed=2}load(t){super.load(t),O(t)||void 0!==t.destroy&&(this.destroy=t.destroy)}}class se extends Yt{animation;constructor(){super(),this.animation=new ie,this.value=1}load(t){if(O(t))return;super.load(t);const e=t.animation;void 0!==e&&this.animation.load(e)}}class ne{color;opacity;width;constructor(){this.width=0}load(t){O(t)||(void 0!==t.color&&(this.color=Bt.create(this.color,t.color)),void 0!==t.width&&(this.width=G(t.width)),void 0!==t.opacity&&(this.opacity=G(t.opacity)))}}class ae{color;fill;stroke;load(t){O(t)||(void 0!==t.color&&(this.color=Bt.create(this.color,t.color)),void 0!==t.fill&&(this.fill??=new Nt,this.fill.load(t.fill)),void 0!==t.stroke&&(this.stroke??=new ne,this.stroke.load(t.stroke)))}}class oe extends Qt{constructor(){super(),this.value=1}}class re{horizontal;vertical;constructor(){this.horizontal=new oe,this.vertical=new oe}load(t){O(t)||(this.horizontal.load(t.horizontal),this.vertical.load(t.vertical))}}class le{enable;height;width;constructor(){this.enable=!1,this.width=1920,this.height=1080}load(t){if(O(t))return;void 0!==t.enable&&(this.enable=t.enable);const e=t.width;void 0!==e&&(this.width=e);const i=t.height;void 0!==i&&(this.height=i)}}class ce{mode;value;constructor(){this.mode=Ct.delete,this.value=0}load(t){O(t)||(void 0!==t.mode&&(this.mode=t.mode),void 0!==t.value&&(this.value=t.value))}}class he{density;limit;value;constructor(){this.density=new le,this.limit=new ce,this.value=0}load(t){O(t)||(this.density.load(t.density),this.limit.load(t.limit),void 0!==t.value&&(this.value=t.value))}}class de{close;options;type;constructor(){this.close=!0,this.options={},this.type="circle"}load(t){if(O(t))return;const e=t.options;if(void 0!==e)for(const t in e){const i=e[t];i&&(this.options[t]=at(this.options[t]??{},i))}void 0!==t.close&&(this.close=t.close),void 0!==t.type&&(this.type=t.type)}}class ue extends Tt{destroy;constructor(){super(),this.destroy=X.none,this.speed=5}load(t){super.load(t),O(t)||void 0!==t.destroy&&(this.destroy=t.destroy)}}class pe extends Yt{animation;constructor(){super(),this.animation=new ue,this.value=3}load(t){if(super.load(t),O(t))return;const e=t.animation;void 0!==e&&this.animation.load(e)}}class fe extends Qt{opacityRate;sizeRate;velocityRate;constructor(){super(),this.opacityRate=1,this.sizeRate=1,this.velocityRate=1}load(t){super.load(t),O(t)||(void 0!==t.opacityRate&&(this.opacityRate=t.opacityRate),void 0!==t.sizeRate&&(this.sizeRate=t.sizeRate),void 0!==t.velocityRate&&(this.velocityRate=t.velocityRate))}}class ge{bounce;effect;groups;move;number;opacity;paint;palette;reduceDuplicates;shape;size;zIndex;_container;_pluginManager;constructor(t,e){this._pluginManager=t,this._container=e,this.bounce=new re,this.effect=new qt,this.groups={},this.move=new ee,this.number=new he,this.opacity=new se,this.paint=new ae,this.paint.color=new Bt,this.paint.color.value="#fff",this.paint.fill=new Nt,this.paint.fill.enable=!0,this.reduceDuplicates=!1,this.shape=new de,this.size=new pe,this.zIndex=new fe}load(t){if(O(t))return;if(t.palette&&(this.palette=t.palette,this._importPalette(this.palette)),void 0!==t.groups)for(const e of Object.keys(t.groups)){if(!(e in t.groups))continue;const i=t.groups[e];void 0!==i&&(this.groups[e]=at(this.groups[e]??{},i))}void 0!==t.reduceDuplicates&&(this.reduceDuplicates=t.reduceDuplicates),this.bounce.load(t.bounce),this.effect.load(t.effect),this.move.load(t.move),this.number.load(t.number),this.opacity.load(t.opacity);const e=t.paint;if(e&&(k(e)?this.paint=ot(e,t=>{const e=new ae;return e.load(t),e}):k(this.paint)?(this.paint=new ae,this.paint.load(e)):this.paint.load(e)),this.shape.load(t.shape),this.size.load(t.size),this.zIndex.load(t.zIndex),this._container){for(const e of this._pluginManager.plugins)e.loadParticlesOptions&&e.loadParticlesOptions(this._container,this,t);const e=this._pluginManager.updaters.get(this._container);if(e)for(const i of e)i.loadOptions&&i.loadOptions(this,t)}}_importPalette=t=>{const e=this._pluginManager.getPalette(t);if(!e)return;const i=e.colors,s=(k(i)?i:[i]).flatMap(t=>{const e=t.fill,i=t.stroke,s=e?{color:{value:e.value},enable:e.enable,opacity:e.opacity}:void 0;return i?[{fill:s,stroke:{color:{value:i.value},opacity:i.opacity,width:i.width||0}}]:[{fill:s}]}),n=s.length>1?s:s[0]??{};this.load({paint:n,blend:{enable:!0,mode:e.blendMode}})}}function me(t,...e){for(const i of e)t.load(i)}function _e(t,e,...i){const s=new ge(t,e);return me(s,...i),s}class ye{autoPlay;background;clear;defaultThemes;delay;detectRetina;duration;fpsLimit;fullScreen;hdr;key;name;palette;particles;pauseOnBlur;pauseOnOutsideViewport;preset;resize;smooth;style;zLayers;_container;_pluginManager;constructor(t,e){this._pluginManager=t,this._container=e,this.autoPlay=!0,this.background=new Gt,this.clear=!0,this.defaultThemes={},this.delay=0,this.fullScreen=new Wt,this.detectRetina=!0,this.duration=0,this.fpsLimit=120,this.hdr=!0,this.particles=_e(this._pluginManager,this._container),this.pauseOnBlur=!0,this.pauseOnOutsideViewport=!0,this.resize=new $t,this.smooth=!1,this.style={},this.zLayers=100}load(t){if(O(t))return;void 0!==t.preset&&(this.preset=t.preset,ot(this.preset,t=>{this._importPreset(t)})),void 0!==t.palette&&(this.palette=t.palette,this._importPalette(this.palette)),void 0!==t.autoPlay&&(this.autoPlay=t.autoPlay),void 0!==t.clear&&(this.clear=t.clear),void 0!==t.key&&(this.key=t.key),void 0!==t.name&&(this.name=t.name),void 0!==t.delay&&(this.delay=G(t.delay));const e=t.detectRetina;void 0!==e&&(this.detectRetina=e),void 0!==t.duration&&(this.duration=G(t.duration));const i=t.fpsLimit;void 0!==i&&(this.fpsLimit=i),void 0!==t.hdr&&(this.hdr=t.hdr),void 0!==t.pauseOnBlur&&(this.pauseOnBlur=t.pauseOnBlur),void 0!==t.pauseOnOutsideViewport&&(this.pauseOnOutsideViewport=t.pauseOnOutsideViewport),void 0!==t.zLayers&&(this.zLayers=t.zLayers),this.background.load(t.background);const s=t.fullScreen;z(s)?this.fullScreen.enable=s:this.fullScreen.load(s),this.particles.load(t.particles),this.resize.load(t.resize),this.style=at(this.style,t.style),void 0!==t.smooth&&(this.smooth=t.smooth),this._pluginManager.plugins.forEach(e=>{e.loadOptions(this._container,this,t)})}_importPalette=t=>{const e=this._pluginManager.getPalette(t);e&&this.load({background:{color:e.background},blend:{enable:!0,mode:e.blendMode},particles:{palette:t}})};_importPreset=t=>{this.load(this._pluginManager.getPreset(t))}}function ve(t,e){t.clearRect(a.x,a.y,e.width,e.height)}function we(t,e,i,s){e.drawParticle&&e.drawParticle(t,i,s)}const be=new Map;function xe(t,e){let i=be.get(t);if(!i){if(i=e(),be.size>=1e3){[...be.keys()].slice(0,500).forEach(t=>be.delete(t))}be.set(t,i)}return i}function Pe(t,e,i,s=!0){if(!e)return;const n=M(e)?{value:e}:e;if(M(n.value))return ze(t,n.value,i,s);if(k(n.value)){const e=it(n.value,i,s);if(!e)return;return Pe(t,{value:e})}for(const e of t.colorManagers.values()){const t=e.handleRangeColor(n);if(t)return t}}function ze(t,e,i,s=!0){if(!e)return;const n=M(e)?{value:e}:e;if(M(n.value))return n.value===h?function(){const t=0,e=256,i=()=>Math.floor(L(t,e));return{b:i(),g:i(),r:i()}}():function(t,e){return function(t,e){if(e)for(const i of t.colorManagers.values())if(i.accepts(e))return i.parseString(e)}(t,e)}(t,n.value);if(k(n.value)){const e=it(n.value,i,s);if(!e)return;return ze(t,{value:e})}for(const e of t.colorManagers.values()){const t=e.handleColor(n);if(t)return t}}function Me(t,e,i,s=!0){const n=Pe(t,e,i,s);return n?Ce(n):void 0}function Ce(t){const e=t.r/g,i=t.g/g,n=t.b/g,a=Math.max(e,i,n),o=Math.min(e,i,n),r={h:0,l:(a+o)*s,s:0};return a!==o&&(r.s=r.l<s?(a-o)/(a+o):(a-o)/(2-a-o),r.h=e===a?(i-n)/(a-o):i===a?2+(n-e)/(a-o):4+(e-i)/(a-o)),r.l*=y,r.s*=_,r.h*=60,r.h<0&&(r.h+=m),r.h>=m&&(r.h-=m),r}function Se(t){const e=(t.h%m+m)%m,i=Math.max(0,Math.min(_,t.s)),n=Math.max(0,Math.min(y,t.l)),a=e/m,o=i/_,r=n/y;if(0===i){const t=Math.round(r*g);return{r:t,g:t,b:t}}const l=(t,e,i)=>{if(i<0&&i++,i>1&&i--,6*i<1)return t+6*(e-t)*i;if(2*i<1)return e;if(3*i<2){return t+(e-t)*(2/3-i)*6}return t},c=r<s?r*(1+o):r+o-r*o,h=2*r-c,d=1/3,u=Math.min(g,g*l(h,c,a+d)),p=Math.min(g,g*l(h,c,a)),f=Math.min(g,g*l(h,c,a-d));return{r:Math.round(u),g:Math.round(p),b:Math.round(f)}}function ke(t,e,i){const s=i??1;return xe(`rgb-${t.r.toFixed(2)}-${t.g.toFixed(2)}-${t.b.toFixed(2)}-${e?"hdr":"sdr"}-${s.toString()}`,()=>e?Oe(t,i):function(t,e){return`rgba(${t.r.toString()}, ${t.g.toString()}, ${t.b.toString()}, ${(e??1).toString()})`}(t,i))}function Oe(t,e){return`color(display-p3 ${(t.r/g).toString()} ${(t.g/g).toString()} ${(t.b/g).toString()} / ${(e??1).toString()})`}function Ie(t,e,i){const s=i??1;return xe(`hsl-${t.h.toFixed(2)}-${t.s.toFixed(2)}-${t.l.toFixed(2)}-${e?"hdr":"sdr"}-${s.toString()}`,()=>e?function(t,e){return Oe(Se(t),e)}(t,i):function(t,e){return`hsla(${t.h.toString()}, ${t.s.toString()}%, ${t.l.toString()}%, ${(e??1).toString()})`}(t,i))}function De(t){return void 0===t?void 0:{h:t.h.value,s:t.s.value,l:t.l.value}}function Re(t,e,i){const s={h:{enable:!1,value:t.h,min:0,max:m},s:{enable:!1,value:t.s,min:0,max:_},l:{enable:!1,value:t.l,min:0,max:y}};return e&&(Ee(s.h,e.h,i),Ee(s.s,e.s,i),Ee(s.l,e.l,i)),s}function Ee(t,e,s){t.enable=e.enable,t.min=e.min,t.max=e.max,t.enable?(t.velocity=U(e.speed)/i*s,t.decay=1-U(e.decay),t.status=Q.increasing,t.loops=0,t.maxLoops=U(e.count),t.time=0,t.delayTime=U(e.delay)*n,e.sync||(t.velocity*=F(),t.value*=F()),t.initialValue=t.value,t.offset=G(e.offset)):t.velocity=0}function Fe(t,e,i){if(!t.enable||(t.maxLoops??0)>0&&(t.loops??0)>(t.maxLoops??0))return;if(t.time??=0,(t.delayTime??0)>0&&t.time<(t.delayTime??0)&&(t.time+=i.value),(t.delayTime??0)>0&&t.time<(t.delayTime??0))return;const s=t.offset?A(t.offset):0,n=(t.velocity??0)*i.factor+3.6*s,a=t.decay??1,o=t.max,r=t.min;e&&t.status!==Q.increasing?(t.value-=n,t.value<r&&(t.loops??=0,t.loops++,t.status=Q.increasing)):(t.value+=n,t.value>o&&(t.loops??=0,t.loops++,e?t.status=Q.decreasing:t.value-=o)),t.velocity&&1!==a&&(t.velocity*=a),t.value=T(t.value,r,o)}function Le(t,e){if(!t)return;const{h:i,s:s,l:n}=t;Fe(i,!1,e),Fe(s,!0,e),Fe(n,!0,e)}const Te=new Pt;function Ae(){const t=(t,e,i)=>{const s=t.max>i?t.max-i:0;let n=G(t);s&&(n=G(t.min-s,i));const a=t.min<e?t.min:0;return a&&(n=G(0,t.max+a)),n},e=["#FF0000","#FF8000","#FFFF00","#00FF00","#00FFFF","#0000FF","#FF00FF"].map(e=>{const i=(t=>{let e=t;const i=/^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i;i.test(e)&&(e=e.replace(i,(t,e,i,s,n)=>e+e+i+i+s+s+(n?n+n:"")));const s=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i.exec(e);if(!s)return;s.shift();const n=2,a=1,o=0,r={a:s[3],b:s[n],g:s[a],r:s[o]};return{r:r.r?Number.parseInt(r.r,16):0,g:r.g?Number.parseInt(r.g,16):0,b:r.b?Number.parseInt(r.b,16):0,a:r.a?Number.parseInt(r.a,16):1}})(e);if(!i)return;const s=Ce(i),n=0,a=100,o=0,r=100,l=t({min:s.s-30,max:s.s+30},n,a),c=t({min:s.l-30,max:s.l+30},o,r);return{paint:{fill:{color:{value:{h:s.h,s:l,l:c}},enable:!0},stroke:{width:0}},number:{value:0},opacity:{value:{min:.1,max:1},animation:{enable:!0,speed:.7,sync:!1,startValue:K.max,destroy:X.min}},shape:{type:"circle"},effect:{type:"trail",options:{trail:{length:{min:5,max:10}}}},size:{value:{min:1,max:2},animation:{enable:!0,speed:5,count:1,sync:!1,startValue:K.min,destroy:X.none}},life:{count:1,duration:{value:{min:1,max:2}}},move:{decay:{min:.075,max:.1},enable:!0,gravity:{enable:!0,inverse:!1,acceleration:5},speed:{min:5,max:15},direction:w.none,outModes:St.destroy}}}).filter(t=>void 0!==t);return{detectRetina:!0,background:{color:"#000"},fpsLimit:120,emitters:{direction:w.top,rate:{delay:.3,quantity:1},size:{width:100,height:0},position:{y:100,x:50}},particles:{number:{value:0},destroy:{mode:"split",bounds:{top:{min:15,max:35}},split:{sizeOffset:!1,count:1,factor:{value:.333333},rate:{value:{min:75,max:150}},particles:e}},life:{count:1},shape:{type:"circle"},effect:{type:"trail",options:{trail:{length:{min:5,max:15},minWidth:1,maxWidth:1}}},size:{value:1},paint:{stroke:{color:{value:"#ffffff"},width:1},fill:{enable:!1}},move:{enable:!0,gravity:{acceleration:15,enable:!0,inverse:!0,maxSpeed:100},speed:{min:10,max:20},outModes:{default:St.destroy,top:St.none}}},sounds:{enable:!0,events:[{event:_t.particleRemoved,filter:t=>t.data.particle.options.move.gravity.inverse,audio:["https://particles.js.org/audio/explosion0.mp3","https://particles.js.org/audio/explosion1.mp3","https://particles.js.org/audio/explosion2.mp3"]}],volume:50}}}class Ue{draw(t){!function(t){const{context:e,particle:i,radius:s}=t;i.circleRange??={min:0,max:d};const n=i.circleRange;e.arc(a.x,a.y,s,n.min,n.max,!1)}(t)}getSidesCount(){return 12}particleInit(t,e){const i=e.shapeData,s=i?.angle??{max:360,min:0};e.circleRange=S(s)?{min:q(s.min),max:q(s.max)}:{min:0,max:q(s)}}}async function Ve(t){t.checkVersion("4.0.0-beta.16"),await t.pluginManager.register(t=>{t.pluginManager.addShape(["circle"],()=>Promise.resolve(new Ue))})}var Be;!function(t){t[t.r=1]="r",t[t.g=2]="g",t[t.b=3]="b",t[t.a=4]="a"}(Be||(Be={}));const Ge=/^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i,We=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i;class $e{accepts(t){return t.startsWith("#")}handleColor(t){return this._parseString(t.value)}handleRangeColor(t){return this._parseString(t.value)}parseString(t){return this._parseString(t)}_parseString(t){if("string"!=typeof t||!this.accepts(t))return;const e=t.replace(Ge,(t,e,i,s,n)=>e+e+i+i+s+s+(void 0===n?"":n+n)),i=We.exec(e);return i?{a:i[Be.a]?Number.parseInt(i[Be.a],16)/255:1,b:Number.parseInt(i[Be.b]??"0",16),g:Number.parseInt(i[Be.g]??"0",16),r:Number.parseInt(i[Be.r]??"0",16)}:void 0}}async function qe(t){t.checkVersion("4.0.0-beta.16"),await t.pluginManager.register(t=>{t.pluginManager.addColorManager("hex",new $e)})}var Ne;!function(t){t[t.h=1]="h",t[t.s=2]="s",t[t.l=3]="l",t[t.a=5]="a"}(Ne||(Ne={}));const je=/hsla?\(\s*(\d+)\s*[\s,]\s*(\d+)%\s*[\s,]\s*(\d+)%\s*([\s,]\s*(0|1|0?\.\d+|(\d{1,3})%)\s*)?\)/i;class Ze{accepts(t){return t.startsWith("hsl")}handleColor(t){const e=t.value.hsl??t.value;if("h"in e&&"s"in e&&"l"in e)return Se(e)}handleRangeColor(t){const e=t.value.hsl??t.value;if("h"in e&&"s"in e&&"l"in e)return Se({h:U(e.h),l:U(e.l),s:U(e.s)})}parseString(t){if(!this.accepts(t))return;const e=je.exec(t);return e?function(t){const e=Se(t);return{a:t.a,b:e.b,g:e.g,r:e.r}}({a:e.length>4?Z(e[Ne.a]):1,h:Number.parseInt(e[Ne.h]??"0",10),l:Number.parseInt(e[Ne.l]??"0",10),s:Number.parseInt(e[Ne.s]??"0",10)}):void 0}}async function He(t){t.checkVersion("4.0.0-beta.16"),await t.pluginManager.register(t=>{t.pluginManager.addColorManager("hsl",new Ze)})}class Qe{id="move";_pluginManager;constructor(t){this._pluginManager=t}async getPlugin(t){const{MovePluginInstance:e}=await Promise.resolve().then(function(){return Us});return new e(this._pluginManager,t)}loadOptions(){}needsPlugin(){return!0}}async function Xe(t){t.checkVersion("4.0.0-beta.16"),await t.pluginManager.register(t=>{const e=t.pluginManager;e.initializers.pathGenerators??=new Map,e.pathGenerators??=new Map,e.addPathGenerator=(t,i)=>{e.initializers.pathGenerators??=new Map,e.initializers.pathGenerators.set(t,i)},e.getPathGenerators=async(t,i=!1)=>(e.initializers.pathGenerators??=new Map,e.pathGenerators??=new Map,gt(t,e.pathGenerators,e.initializers.pathGenerators,i)),t.pluginManager.addPlugin(new Qe(t.pluginManager))})}class Ye{container;constructor(t){this.container=t}init(t){const e=t.options.opacity;t.opacity=lt(e,1);const s=e.animation;s.enable&&(t.opacity.velocity=U(s.speed)/i*this.container.retina.reduceFactor,s.sync||(t.opacity.velocity*=F()))}isEnabled(t){return!t.destroyed&&!t.spawning&&!!t.opacity&&t.opacity.enable&&((t.opacity.maxLoops??0)<=0||(t.opacity.maxLoops??0)>0&&(t.opacity.loops??0)<(t.opacity.maxLoops??0))}reset(t){t.opacity&&(t.opacity.time=0,t.opacity.loops=0)}update(t,e){this.isEnabled(t)&&t.opacity&&ut(t,t.opacity,!0,t.options.opacity.animation.destroy,e)}}async function Je(t){t.checkVersion("4.0.0-beta.16"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("opacity",t=>Promise.resolve(new Ye(t)))})}class Ke{container;modes;_particleBouncePlugins;constructor(t){this.container=t,this.modes=[St.bounce,St.split],this._particleBouncePlugins=t.plugins.filter(t=>void 0!==t.particleBounce)}update(t,e,i,s){if(!this.modes.includes(s))return;const n=this.container;let a=!1;for(const s of this._particleBouncePlugins)if(a=s.particleBounce?.(t,i,e)??!1,a)break;if(a)return;const o=t.getPosition(),r=t.offset,l=t.getRadius(),c=nt(o,l),h=n.canvas.size;!function(t){if(t.outMode!==St.bounce&&t.outMode!==St.split||t.direction!==Y.left&&t.direction!==Y.right)return;t.bounds.right<0&&t.direction===Y.left?t.particle.position.x=t.size+t.offset.x:t.bounds.left>t.canvasSize.width&&t.direction===Y.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===Y.right&&t.bounds.right>=t.canvasSize.width&&e>0||t.direction===Y.left&&t.bounds.left<=0&&e<0){const e=U(t.particle.options.bounce.horizontal.value);t.particle.velocity.x*=-e,i=!0}if(!i)return;const s=t.offset.x+t.size;t.bounds.right>=t.canvasSize.width&&t.direction===Y.right?t.particle.position.x=t.canvasSize.width-s:t.bounds.left<=0&&t.direction===Y.left&&(t.particle.position.x=s),t.outMode===St.split&&t.particle.destroy()}({particle:t,outMode:s,direction:e,bounds:c,canvasSize:h,offset:r,size:l}),function(t){if(t.outMode!==St.bounce&&t.outMode!==St.split||t.direction!==Y.bottom&&t.direction!==Y.top)return;t.bounds.bottom<0&&t.direction===Y.top?t.particle.position.y=t.size+t.offset.y:t.bounds.top>t.canvasSize.height&&t.direction===Y.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===Y.bottom&&t.bounds.bottom>=t.canvasSize.height&&e>0||t.direction===Y.top&&t.bounds.top<=0&&e<0){const e=U(t.particle.options.bounce.vertical.value);t.particle.velocity.y*=-e,i=!0}if(!i)return;const s=t.offset.y+t.size;t.bounds.bottom>=t.canvasSize.height&&t.direction===Y.bottom?t.particle.position.y=t.canvasSize.height-s:t.bounds.top<=0&&t.direction===Y.top&&(t.particle.position.y=s),t.outMode===St.split&&t.particle.destroy()}({particle:t,outMode:s,direction:e,bounds:c,canvasSize:h,offset:r,size:l})}}class ti{container;modes;constructor(t){this.container=t,this.modes=[St.destroy]}update(t,e,i,s){if(!this.modes.includes(s))return;const n=this.container;switch(t.outType){case It.normal:case It.outside:if(st(t.position,n.canvas.size,a,t.getRadius(),e))return;break;case It.inside:{const{dx:e,dy:i}=W(t.position,t.moveCenter),{x:s,y:n}=t.velocity;if(s<0&&e>t.moveCenter.radius||n<0&&i>t.moveCenter.radius||s>=0&&e<-t.moveCenter.radius||n>=0&&i<-t.moveCenter.radius)return;break}}t.destroy(!0)}}class ei{container;modes;constructor(t){this.container=t,this.modes=[St.none]}update(t,e,i,s){if(!this.modes.includes(s))return;if((t.options.move.distance.horizontal&&(e===Y.left||e===Y.right))??(t.options.move.distance.vertical&&(e===Y.top||e===Y.bottom)))return;const n=t.options.move.gravity,o=this.container,r=o.canvas.size,l=t.getRadius();if(n.enable){const i=t.position;(!n.inverse&&i.y>r.height+l&&e===Y.bottom||n.inverse&&i.y<-l&&e===Y.top)&&t.destroy()}else{if(t.velocity.y>0&&t.position.y<=r.height+l||t.velocity.y<0&&t.position.y>=-l||t.velocity.x>0&&t.position.x<=r.width+l||t.velocity.x<0&&t.position.x>=-l)return;st(t.position,o.canvas.size,a,l,e)||t.destroy()}}}const ii=P.origin;class si{container;modes;constructor(t){this.container=t,this.modes=[St.out]}update(t,e,i,s){if(!this.modes.includes(s))return;const n=this.container;switch(t.outType){case It.inside:{const{x:e,y:i}=t.velocity;ii.setTo(a),ii.length=t.moveCenter.radius,ii.angle=t.velocity.angle+Math.PI,ii.addTo(t.moveCenter);const{dx:s,dy:o}=W(t.position,ii);if(e<=0&&s>=0||i<=0&&o>=0||e>=0&&s<=0||i>=0&&o<=0)return;t.position.x=Math.floor(A({min:0,max:n.canvas.size.width})),t.position.y=Math.floor(A({min:0,max:n.canvas.size.height}));const{dx:r,dy:l}=W(t.position,t.moveCenter);t.direction=Math.atan2(-l,-r),t.velocity.angle=t.direction,t.justWarped=!0;break}default:if(st(t.position,n.canvas.size,a,t.getRadius(),e))return;switch(t.outType){case It.outside:{t.position.x=Math.floor(A({min:-t.moveCenter.radius,max:t.moveCenter.radius}))+t.moveCenter.x,t.position.y=Math.floor(A({min:-t.moveCenter.radius,max:t.moveCenter.radius}))+t.moveCenter.y;const{dx:e,dy:i}=W(t.position,t.moveCenter);t.moveCenter.radius&&(t.direction=Math.atan2(i,e),t.velocity.angle=t.direction),t.justWarped=!0;break}case It.normal:{const i=t.options.move.warp,s=n.canvas.size,a={bottom:s.height+t.getRadius()+t.offset.y,left:-t.getRadius()-t.offset.x,right:s.width+t.getRadius()+t.offset.x,top:-t.getRadius()-t.offset.y},o=t.getRadius(),r=nt(t.position,o);e===Y.right&&r.left>s.width+t.offset.x?(t.position.x=a.left,t.initialPosition.x=t.position.x,i||(t.position.y=F()*s.height,t.initialPosition.y=t.position.y),t.justWarped=!0):e===Y.left&&r.right<-t.offset.x&&(t.position.x=a.right,t.initialPosition.x=t.position.x,i||(t.position.y=F()*s.height,t.initialPosition.y=t.position.y),t.justWarped=!0),e===Y.bottom&&r.top>s.height+t.offset.y?(i||(t.position.x=F()*s.width,t.initialPosition.x=t.position.x),t.position.y=a.top,t.initialPosition.y=t.position.y,t.justWarped=!0):e===Y.top&&r.bottom<-t.offset.y&&(i||(t.position.x=F()*s.width,t.initialPosition.x=t.position.x),t.position.y=a.bottom,t.initialPosition.y=t.position.y,t.justWarped=!0);break}}}}}class ni{updaters;container;constructor(t){this.container=t,this.updaters=new Map}init(t){this._addUpdaterIfMissing(t,St.bounce,t=>new Ke(t)),this._addUpdaterIfMissing(t,St.out,t=>new si(t)),this._addUpdaterIfMissing(t,St.destroy,t=>new ti(t)),this._addUpdaterIfMissing(t,St.none,t=>new ei(t))}isEnabled(t){return!t.destroyed&&!t.spawning}update(t,e){const i=t.options.move.outModes;t.justWarped=!1,this._updateOutMode(t,e,i.bottom??i.default,Y.bottom),this._updateOutMode(t,e,i.left??i.default,Y.left),this._updateOutMode(t,e,i.right??i.default,Y.right),this._updateOutMode(t,e,i.top??i.default,Y.top)}_addUpdaterIfMissing=(t,e,i)=>{const s=t.options.move.outModes;!this.updaters.has(e)&&((t,e)=>t.default===e||t.bottom===e||t.left===e||t.right===e||t.top===e)(s,e)&&this.updaters.set(e,i(this.container))};_updateOutMode=(t,e,i,s)=>{for(const n of this.updaters.values())n.update(t,s,e,i)}}async function ai(t){t.checkVersion("4.0.0-beta.16"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("outModes",t=>Promise.resolve(new ni(t)))})}class oi{_container;_pluginManager;constructor(t,e){this._container=e,this._pluginManager=t}init(t){const e=this._container,i=t.options,s=rt(i.paint,t.id,i.reduceDuplicates),n=s?.color,a=n??void 0,o=s?.fill,r=s?.stroke;if(o){const i=Bt.create(void 0===a?void 0:Bt.create(void 0,a),o.color);t.fillEnabled=o.enable,t.fillOpacity=U(o.opacity),t.fillAnimation=i.animation;const s=Me(this._pluginManager,i);s&&(t.fillColor=Re(s,t.fillAnimation,e.retina.reduceFactor))}else t.fillEnabled=!1,t.fillAnimation=void 0,t.fillColor=void 0,t.fillOpacity=1;if(r){const i=Bt.create(void 0===a?void 0:Bt.create(void 0,a),r.color);t.strokeWidth=U(r.width)*e.retina.pixelRatio,t.strokeOpacity=U(r.opacity??1),t.strokeAnimation=i.animation;const s=Me(this._pluginManager,i)??t.getFillColor();s&&(t.strokeColor=Re(s,t.strokeAnimation,e.retina.reduceFactor))}else t.strokeAnimation=void 0,t.strokeColor=void 0,t.strokeOpacity=1,t.strokeWidth=0}isEnabled(t){const{fillAnimation:e,fillColor:i,strokeAnimation:s,strokeColor:n}=t,a=!!e&&(void 0!==i?.h.value&&i.h.enable||void 0!==i?.s.value&&i.s.enable||void 0!==i?.l.value&&i.l.enable),o=!!s&&(void 0!==n?.h.value&&n.h.enable||void 0!==n?.s.value&&n.s.enable||void 0!==n?.l.value&&n.l.enable);return!t.destroyed&&!t.spawning&&(a||o)}update(t,e){this.isEnabled(t)&&(Le(t.fillColor,e),Le(t.strokeColor,e))}}async function ri(t){t.checkVersion("4.0.0-beta.16"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("paint",e=>Promise.resolve(new oi(t.pluginManager,e)))})}var li;!function(t){t[t.r=1]="r",t[t.g=2]="g",t[t.b=3]="b",t[t.a=5]="a"}(li||(li={}));const ci=/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;class hi{accepts(t){return t.startsWith("rgb")}handleColor(t){const e=t.value.rgb??t.value;if("r"in e&&"g"in e&&"b"in e)return e}handleRangeColor(t){const e=t.value.rgb??t.value;if("r"in e&&"g"in e&&"b"in e)return{r:U(e.r),g:U(e.g),b:U(e.b)}}parseString(t){if(!this.accepts(t))return;const e=ci.exec(t);return e?{a:e.length>4?Z(e[li.a]):1,b:parseInt(e[li.b]??"0",10),g:parseInt(e[li.g]??"0",10),r:parseInt(e[li.r]??"0",10)}:void 0}}async function di(t){t.checkVersion("4.0.0-beta.16"),await t.pluginManager.register(t=>{t.pluginManager.addColorManager("rgb",new hi)})}class ui{_container;constructor(t){this._container=t}init(t){const e=this._container,s=t.options.size.animation;s.enable&&(t.size.velocity=t.retina.sizeAnimationSpeed/i*e.retina.reduceFactor,s.sync||(t.size.velocity*=F()))}isEnabled(t){return!t.destroyed&&!t.spawning&&t.size.enable&&((t.size.maxLoops??0)<=0||(t.size.maxLoops??0)>0&&(t.size.loops??0)<(t.size.maxLoops??0))}reset(t){t.size.time=0,t.size.loops=0}update(t,e){this.isEnabled(t)&&ut(t,t.size,!0,t.options.size.animation.destroy,e)}}async function pi(t){t.checkVersion("4.0.0-beta.16"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("size",t=>Promise.resolve(new ui(t)))})}async function fi(t){t.checkVersion("4.0.0-beta.16"),await t.pluginManager.register(async t=>{await Promise.all([qe(t),He(t),di(t),Xe(t),Ve(t),ri(t),Je(t),ai(t),pi(t)])})}class gi{bottom;left;right;top;load(t){O(t)||(void 0!==t.bottom&&(this.bottom=G(t.bottom)),void 0!==t.left&&(this.left=G(t.left)),void 0!==t.right&&(this.right=G(t.right)),void 0!==t.top&&(this.top=G(t.top)))}}var mi;!function(t){t.explode="explode",t.none="none",t.split="split"}(mi||(mi={}));class _i{maxSizeFactor;speed;constructor(){this.maxSizeFactor=3,this.speed=2}load(t){O(t)||(void 0!==t.maxSizeFactor&&(this.maxSizeFactor=t.maxSizeFactor),void 0!==t.speed&&(this.speed=t.speed))}}class yi extends Qt{constructor(){super(),this.value=3}}class vi extends Qt{constructor(){super(),this.value={min:4,max:9}}}class wi{count;factor;fillColor;fillColorOffset;particles;rate;sizeOffset;strokeColor;strokeColorOffset;constructor(){this.count=1,this.factor=new yi,this.rate=new vi,this.sizeOffset=!0}load(t){O(t)||(void 0!==t.fillColor&&(this.fillColor=Vt.create(this.fillColor,t.fillColor)),void 0!==t.strokeColor&&(this.strokeColor=Vt.create(this.strokeColor,t.strokeColor)),void 0!==t.count&&(this.count=t.count),this.factor.load(t.factor),this.rate.load(t.rate),this.particles=ot(t.particles,t=>at({},t)),void 0!==t.sizeOffset&&(this.sizeOffset=t.sizeOffset),t.fillColorOffset&&(this.fillColorOffset=this.fillColorOffset??{},void 0!==t.fillColorOffset.h&&(this.fillColorOffset.h=t.fillColorOffset.h),void 0!==t.fillColorOffset.s&&(this.fillColorOffset.s=t.fillColorOffset.s),void 0!==t.fillColorOffset.l&&(this.fillColorOffset.l=t.fillColorOffset.l)),t.strokeColorOffset&&(this.strokeColorOffset=this.strokeColorOffset??{},void 0!==t.strokeColorOffset.h&&(this.strokeColorOffset.h=t.strokeColorOffset.h),void 0!==t.strokeColorOffset.s&&(this.strokeColorOffset.s=t.strokeColorOffset.s),void 0!==t.strokeColorOffset.l&&(this.strokeColorOffset.l=t.strokeColorOffset.l)))}}class bi{bounds;explode;mode;split;constructor(){this.bounds=new gi,this.explode=new _i,this.mode=mi.none,this.split=new wi}load(t){O(t)||(t.mode&&(this.mode=t.mode),t.bounds&&this.bounds.load(t.bounds),this.explode.load(t.explode),this.split.load(t.split))}}function xi(t,e,i,s){return t&&s?function(t,e){const i=U(e.h??0),s=U(e.s??0),n=U(e.l??0),a=(t.h+i)%360,o=Math.max(0,Math.min(100,t.s+s)),r=Math.max(0,Math.min(100,t.l+n));return Bt.create(void 0,{value:{hsl:{h:a<0?a+360:a,s:o,l:r}}})}(s,t):e?Bt.create(void 0,e):i?Bt.create(void 0,i):s?function(t){return Bt.create(void 0,{value:{hsl:t}})}(s):void 0}function Pi(t,e,i,s){const n=i.options.destroy;if(!n)return;const a=n.split,o=_e(t,e,i.options),r=rt(a.fillColor),l=rt(a.strokeColor),c=i.getFillColor(),h=i.getStrokeColor();o.move.load({center:{x:i.position.x,y:i.position.y,mode:J.precise}});const d=1/U(a.factor.value);C(o.size.value)?o.size.value*=d:(o.size.value.min*=d,o.size.value.max*=d),o.load(s);const u=rt(o.paint),p=u?.fill,f=u?.stroke,g=xi(a.fillColorOffset,r,p?.color,c),m=xi(a.strokeColorOffset,l,f?.color,h);g&&p&&(p.color=g),m&&f&&(f.color=m);const _=a.sizeOffset?G(-i.size.value,i.size.value):0,y={x:i.position.x+A(_),y:i.position.y+A(_)};return e.particles.addParticle(y,o,i.group,t=>!(t.size.value<.5)&&(t.velocity.length=A(G(i.velocity.length,t.velocity.length)),t.splitCount=(i.splitCount??0)+1,t.unbreakable=!0,t.unbreakableUntil=performance.now()+500,!0))}class zi{_container;_pluginManager;constructor(t,e){this._container=e,this._pluginManager=t}init(t){const e=this._container,s=t.options.destroy;if(!s)return;t.exploding=void 0,t.splitCount=0;const n=s.bounds;t.destroyBounds??={};const{bottom:a,left:o,right:r,top:l}=n,{destroyBounds:c}=t,h=e.canvas.size;a&&(c.bottom=U(a)*h.height/i),o&&(c.left=U(o)*h.width/i),r&&(c.right=U(r)*h.width/i),l&&(c.top=U(l)*h.height/i)}isEnabled(t){const e=t;return!e.destroyed||!!e.exploding}loadOptions(t,...e){t.destroy??=new bi;for(const i of e)t.destroy.load(i?.destroy)}particleDestroyed(t,e){if(e)return;const i=t.options.destroy;switch(i?.mode){case mi.split:!function(t,e,i){const s=i.options.destroy;if(!s)return;const n=s.split;if(n.count>=0){if(void 0===i.splitCount||i.splitCount>n.count)return;i.splitCount++}const a=U(n.rate.value),o=rt(n.particles);for(let s=0;s<a;s++)Pi(t,e,i,o)}(this._pluginManager,this._container,t);break;case mi.explode:{if(t.exploding){t.destroyed=!1;break}const{explode:e}=i,s=t.size.value,n=s*e.maxSizeFactor,a=t.getOpacity();t.exploding={initialFillOpacity:a.fillOpacity,initialSize:s,initialStrokeOpacity:a.strokeOpacity,maxSize:n,progress:0,speed:Math.max(e.speed,.01)},t.fillOpacity=a.fillOpacity,t.strokeOpacity=a.strokeOpacity,t.destroyed=!1;break}}}update(t,e){if(t.exploding){const i=t.exploding,s=e.factor||1;i.progress=Math.min(1,i.progress+i.speed*s/60);const n=i.progress;return t.size.value=i.initialSize+(i.maxSize-i.initialSize)*n,t.fillOpacity=i.initialFillOpacity*(1-n),t.strokeOpacity=i.initialStrokeOpacity*(1-n),void(n>=1&&(t.exploding=void 0,t.destroy(!0)))}void 0!==t.unbreakableUntil&&performance.now()>=t.unbreakableUntil&&(t.unbreakable=!1,t.unbreakableUntil=void 0);const i=t.getPosition(),s=t.destroyBounds;s&&(void 0!==s.bottom&&i.y>=s.bottom||void 0!==s.left&&i.x<=s.left||void 0!==s.right&&i.x>=s.right||void 0!==s.top&&i.y<=s.top)&&t.destroy()}}async function Mi(t){t.checkVersion("4.0.0-beta.16"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("destroy",e=>Promise.resolve(new zi(t.pluginManager,e)))})}class Ci{count;delay;duration;wait;constructor(){this.wait=!1}load(t){O(t)||(void 0!==t.count&&(this.count=t.count),void 0!==t.delay&&(this.delay=G(t.delay)),void 0!==t.duration&&(this.duration=G(t.duration)),void 0!==t.wait&&(this.wait=t.wait))}}class Si{delay;quantity;constructor(){this.quantity=1,this.delay=.1}load(t){O(t)||(void 0!==t.quantity&&(this.quantity=G(t.quantity)),void 0!==t.delay&&(this.delay=G(t.delay)))}}class ki{color;opacity;constructor(){this.color=!1,this.opacity=!1}load(t){O(t)||(void 0!==t.color&&(this.color=t.color),void 0!==t.opacity&&(this.opacity=t.opacity))}}class Oi{options;replace;type;constructor(){this.options={},this.replace=new ki,this.type="square"}load(t){O(t)||(void 0!==t.options&&(this.options=at({},t.options??{})),this.replace.load(t.replace),void 0!==t.type&&(this.type=t.type))}}class Ii{height;mode;width;constructor(){this.mode=J.percent,this.height=0,this.width=0}load(t){O(t)||(void 0!==t.mode&&(this.mode=t.mode),void 0!==t.height&&(this.height=t.height),void 0!==t.width&&(this.width=t.width))}}class Di{fill;stroke;load(t){O(t)||(t.fill&&(this.fill??=new Nt,this.fill.load(t.fill)),t.stroke&&(this.stroke??=new ne,this.stroke.load(t.stroke)))}}class Ri{autoPlay;direction;domId;fill;life;name;particles;position;rate;shape;size;spawn;spawnFillColor;spawnStrokeColor;startCount;constructor(){this.autoPlay=!0,this.fill=!0,this.life=new Ci,this.rate=new Si,this.shape=new Oi,this.spawn=new Di,this.startCount=0}load(t){O(t)||(void 0!==t.autoPlay&&(this.autoPlay=t.autoPlay),void 0!==t.size&&(this.size??=new Ii,this.size.load(t.size)),void 0!==t.direction&&(this.direction=t.direction),this.domId=t.domId,void 0!==t.fill&&(this.fill=t.fill),this.life.load(t.life),this.name=t.name,this.particles=ot(t.particles,t=>at({},t)),this.rate.load(t.rate),this.shape.load(t.shape),this.spawn.load(t.spawn),void 0!==t.position&&(this.position={},void 0!==t.position.x&&(this.position.x=G(t.position.x)),void 0!==t.position.y&&(this.position.y=G(t.position.y))),void 0!==t.spawnFillColor&&(this.spawnFillColor??=new Bt,this.spawnFillColor.load(t.spawnFillColor)),void 0!==t.spawnStrokeColor&&(this.spawnStrokeColor??=new Bt,this.spawnStrokeColor.load(t.spawnStrokeColor)),void 0!==t.startCount&&(this.startCount=t.startCount))}}class Ei{id="emitters";_instancesManager;constructor(t){this._instancesManager=t}async getPlugin(t){const{EmittersPluginInstance:e}=await Promise.resolve().then(function(){return Vs});return new e(this._instancesManager,t)}loadOptions(t,e,i){(this.needsPlugin(e)||this.needsPlugin(i))&&i?.emitters&&(e.emitters=ot(i.emitters,t=>{const e=new Ri;return e.load(t),e}))}needsPlugin(t){if(!t)return!1;const e=t.emitters;return k(e)&&!!e.length||void 0!==e}}const Fi=new WeakMap;class Li{fill;options;position;size;constructor(t,e,i,s){this.position=t,this.size=e,this.fill=i,this.options=s}resize(t,e){this.position=t,this.size=e}}var Ti;async function Ai(t){t.checkVersion("4.0.0-beta.16"),await t.pluginManager.register(async t=>{const e=await function(t){const e=t.pluginManager;let i=Fi.get(e);return i||(i=Promise.resolve().then(function(){return qs}).then(({EmittersInstancesManager:t})=>new t(e)).catch(t=>{throw Fi.delete(e),t}),Fi.set(e,i)),i}(t);await async function(t){const{ShapeManager:e}=await Promise.resolve().then(function(){return Gs}),i=t.pluginManager;i.emitterShapeManager??=new e,i.addEmitterShapeGenerator??=(t,e)=>{i.emitterShapeManager?.addShapeGenerator(t,e)}}(t),t.pluginManager.addPlugin(new Ei(e))})}!function(t){t.emitter="emitter"}(Ti||(Ti={}));var Ui;function Vi(t,e){return t+e*(F()-s)}!function(t){t[t.TopLeft=0]="TopLeft",t[t.TopRight=1]="TopRight",t[t.BottomRight=2]="BottomRight",t[t.BottomLeft=3]="BottomLeft"}(Ui||(Ui={}));class Bi extends Li{constructor(t,e,i,s){super(t,e,i,s)}async init(){}randomPosition(){const t=this.fill,e=this.position,i=this.size;if(t)return{position:{x:Vi(e.x,i.width),y:Vi(e.y,i.height)}};{const t=i.width*s,n=i.height*s,a=function(t){return Math.floor(F()*t)}(4),o=2*(F()-s);switch(a){case Ui.TopLeft:return{position:{x:e.x+o*t,y:e.y-n}};case Ui.TopRight:return{position:{x:e.x-t,y:e.y+o*n}};case Ui.BottomRight:return{position:{x:e.x+o*t,y:e.y+n}};case Ui.BottomLeft:default:return{position:{x:e.x+t,y:e.y+o*n}}}}}}class Gi{generate(t,e,i,s,n){return new Bi(e,i,s,n)}}async function Wi(t){t.checkVersion("4.0.0-beta.16"),await t.pluginManager.register(t=>{!function(t){if(!t.pluginManager.addEmitterShapeGenerator)throw new Error("tsParticles Emitters Plugin is not loaded")}(t),t.pluginManager.addEmitterShapeGenerator?.("square",new Gi)})}class $i extends Qt{sync;constructor(){super(),this.sync=!1}load(t){O(t)||(super.load(t),void 0!==t.sync&&(this.sync=t.sync))}}class qi extends Qt{sync;constructor(){super(),this.sync=!1}load(t){O(t)||(super.load(t),void 0!==t.sync&&(this.sync=t.sync))}}class Ni{count;delay;duration;constructor(){this.count=0,this.delay=new $i,this.duration=new qi}load(t){O(t)||(void 0!==t.count&&(this.count=t.count),this.delay.load(t.delay),this.duration.load(t.duration))}}class ji{container;constructor(t){this.container=t}init(t){const e=this.container,i=t.options.life;if(!i)return;const s=i.delay.sync?1:F(),a=i.duration.sync?1:F();t.life={delay:e.retina.reduceFactor?U(i.delay.value)*s/e.retina.reduceFactor*n:0,delayTime:0,duration:e.retina.reduceFactor?U(i.duration.value)*a/e.retina.reduceFactor*n:0,time:0,count:i.count},t.life.duration<=0&&(t.life.duration=-1),t.life.count<=0&&(t.life.count=-1),t.spawning=t.life.delay>0}isEnabled(t){return!t.destroyed}loadOptions(t,...e){t.life??=new Ni;for(const i of e)t.life.load(i?.life)}update(t,e){this.isEnabled(t)&&t.life&&function(t,e,i){if(!t.life)return;const s=t.life;let a=!1;if(t.spawning){if(s.delayTime+=e.value,!(s.delayTime>=t.life.delay))return;a=!0,t.spawning=!1,s.delayTime=0,s.time=0}if(-1===s.duration)return;if(a?s.time=0:s.time+=e.value,s.time<s.duration)return;if(s.time=0,t.life.count>0&&t.life.count--,0===t.life.count)return void t.destroy();const o=G(0,i.width),r=G(0,i.width);t.position.x=A(o),t.position.y=A(r),t.spawning=!0,s.delayTime=0,s.time=0,t.reset();const l=t.options.life;l&&(s.delay=U(l.delay.value)*n,s.duration=U(l.duration.value)*n)}(t,e,this.container.canvas.size)}}async function Zi(t){t.checkVersion("4.0.0-beta.16"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("life",t=>Promise.resolve(new ji(t)))})}class Hi{draw(t){!function(t){const{context:e,particle:i,radius:s}=t,n=i.shapeData;e.moveTo(-s,0),e.lineTo(s,0),e.lineCap=n?.cap??"butt"}(t)}getSidesCount(){return 1}}async function Qi(t){t.checkVersion("4.0.0-beta.16"),await t.pluginManager.register(t=>{t.pluginManager.addShape(["line"],()=>Promise.resolve(new Hi))})}class Xi{decay;enable;speed;sync;constructor(){this.enable=!1,this.speed=0,this.decay=0,this.sync=!1}load(t){O(t)||(void 0!==t.enable&&(this.enable=t.enable),void 0!==t.speed&&(this.speed=G(t.speed)),void 0!==t.decay&&(this.decay=G(t.decay)),void 0!==t.sync&&(this.sync=t.sync))}}class Yi extends Qt{animation;direction;path;constructor(){super(),this.animation=new Xi,this.direction=Mt.clockwise,this.path=!1,this.value=0}load(t){O(t)||(super.load(t),void 0!==t.direction&&(this.direction=t.direction),this.animation.load(t.animation),void 0!==t.path&&(this.path=t.path))}}class Ji{container;constructor(t){this.container=t}init(t){const e=t.options.rotate;if(!e)return;t.rotate={enable:e.animation.enable,value:q(U(e.value)),min:0,max:d},t.pathRotation=e.path;let i=e.direction;if(i===Mt.random){i=Math.floor(2*F())>0?Mt.counterClockwise:Mt.clockwise}switch(i){case Mt.counterClockwise:case"counterClockwise":t.rotate.status=Q.decreasing;break;case Mt.clockwise:t.rotate.status=Q.increasing}const s=e.animation;s.enable&&(t.rotate.decay=1-U(s.decay),t.rotate.velocity=U(s.speed)/360*this.container.retina.reduceFactor,s.sync||(t.rotate.velocity*=F())),t.rotation=t.rotate.value}isEnabled(t){const e=t.options.rotate;return!!e&&(!t.destroyed&&!t.spawning&&(!!e.value||e.animation.enable||e.path))}loadOptions(t,...e){t.rotate??=new Yi;for(const i of e)t.rotate.load(i?.rotate)}update(t,e){this.isEnabled(t)&&(t.isRotating=!!t.rotate,t.rotate&&(ut(t,t.rotate,!1,X.none,e),t.rotation=t.rotate.value))}}async function Ki(t){t.checkVersion("4.0.0-beta.16"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("rotate",t=>Promise.resolve(new Ji(t)))})}const ts="pointerdown",es="touchstart";class is{loop;source;constructor(){this.loop=!1,this.source=""}load(t){O(t)||(S(t)?(void 0!==t.loop&&(this.loop=t.loop),void 0!==t.source&&(this.source=t.source)):this.source=t)}}class ss{duration;value;constructor(){this.duration=500,this.value=[]}load(t){O(t)||(void 0!==t.duration&&(this.duration=t.duration),void 0!==t.value&&(this.value=t.value))}}class ns{loop;melodies;notes;constructor(){this.loop=!1,this.melodies=[],this.notes=[]}load(t){O(t)||(void 0!==t.loop&&(this.loop=t.loop),void 0!==t.melodies&&(this.melodies=t.melodies.map(t=>{const e=new ns;return e.load(t),e})),void 0!==t.notes&&(this.notes=t.notes.map(t=>{const e=new ss;return e.load(t),e})))}}class as{audio;event;filter;melodies;notes;constructor(){this.event=[],this.notes=[]}load(t){if(!O(t)&&(void 0!==t.event&&(this.event=t.event),void 0!==t.audio&&(k(t.audio)?this.audio=t.audio.map(t=>{const e=new is;return e.load(t),e}):(this.audio=new is,this.audio.load(t.audio))),void 0!==t.notes&&(this.notes=t.notes.map(t=>{const e=new ss;return e.load(t),e})),void 0!==t.melodies&&(this.melodies=t.melodies.map(t=>{const e=new ns;return e.load(t),e})),t.filter))if(M(t.filter)){const e=globalThis[t.filter];"function"==typeof e&&(this.filter=e)}else this.filter=t.filter}}class os{height;path;style;svg;width;constructor(){this.width=24,this.height=24,this.style=""}load(t){O(t)||(void 0!==t.path&&(this.path=t.path),void 0!==t.svg&&(this.svg=t.svg),void 0!==t.width&&(this.width=t.width),void 0!==t.height&&(this.height=t.height))}}class rs{enable;mute;unmute;volumeDown;volumeUp;constructor(){this.mute=new os,this.unmute=new os,this.volumeDown=new os,this.volumeUp=new os,this.enable=!1,this.mute.svg='<?xml version="1.0"?>\n<svg baseProfile="tiny" height="24px" version="1.2" viewBox="0 0 24 24" width="24px"\n xml:space="preserve" xmlns="http://www.w3.org/2000/svg"\n xmlns:xlink="http://www.w3.org/1999/xlink">\n <g id="Layer_1">\n <path fill="#fff" d="M19.707,5.293c-0.391-0.391-1.023-0.391-1.414,0l-1.551,1.551c-0.345-0.688-0.987-1.02-1.604-1.02c-0.449,0-0.905,0.152-1.356,0.453l-2.672,1.781C10.357,8.561,8.904,9,8,9c-1.654,0-3,1.346-3,3v2c0,1.237,0.754,2.302,1.826,2.76l-1.533,1.533c-0.391,0.391-0.391,1.023,0,1.414C5.488,19.902,5.744,20,6,20s0.512-0.098,0.707-0.293l2.527-2.527c0.697,0.174,1.416,0.455,1.875,0.762l2.672,1.781c0.451,0.301,0.907,0.453,1.356,0.453C16.035,20.176,17,19.495,17,18V9.414l2.707-2.707C20.098,6.316,20.098,5.684,19.707,5.293z M14.891,7.941c0.038-0.025,0.073-0.046,0.104-0.062C14.998,7.914,15,7.954,15,8v1.293l-2,2V9.202L14.891,7.941z M7,12c0-0.552,0.448-1,1-1c1.211,0,2.907-0.495,4-1.146v2.439l-2.83,2.83C8.757,15.046,8.356,15,8,15c-0.552,0-1-0.448-1-1V12z M10.301,15.406L12,13.707v2.439C11.519,15.859,10.925,15.604,10.301,15.406z M14.994,18.12c-0.03-0.016-0.065-0.036-0.104-0.062L13,16.798v-4.091l2-2V18C15,18.046,14.998,18.086,14.994,18.12z"/>\n </g>\n</svg>',this.unmute.svg='<?xml version="1.0"?>\n<svg baseProfile="tiny" height="24px" version="1.2" viewBox="0 0 24 24" width="24px"\n xml:space="preserve" xmlns="http://www.w3.org/2000/svg"\n xmlns:xlink="http://www.w3.org/1999/xlink">\n <g id="Layer_1">\n <path fill="#fff" d="M17.138,5.824c-0.449,0-0.905,0.152-1.356,0.453l-2.672,1.781C12.357,8.561,10.904,9,10,9c-1.654,0-3,1.346-3,3v2c0,1.654,1.346,3,3,3c0.904,0,2.357,0.439,3.109,0.941l2.672,1.781c0.451,0.301,0.907,0.453,1.356,0.453C18.035,20.176,19,19.495,19,18V8C19,6.505,18.035,5.824,17.138,5.824z M14,16.146C12.907,15.495,11.211,15,10,15c-0.552,0-1-0.448-1-1v-2c0-0.552,0.448-1,1-1c1.211,0,2.907-0.495,4-1.146V16.146z M17,18c0,0.046-0.002,0.086-0.006,0.12c-0.03-0.016-0.065-0.036-0.104-0.062L15,16.798V9.202l1.891-1.261c0.038-0.025,0.073-0.046,0.104-0.062C16.998,7.914,17,7.954,17,8V18z"/>\n </g>\n</svg>',this.volumeDown.svg='<?xml version="1.0"?>\n<svg baseProfile="tiny" height="24px" version="1.2" viewBox="0 0 24 24" width="24px"\n xml:space="preserve" xmlns="http://www.w3.org/2000/svg"\n xmlns:xlink="http://www.w3.org/1999/xlink">\n <g id="Layer_1">\n <path fill="#fff" d="M15.138,5.824c-0.449,0-0.905,0.152-1.356,0.453l-2.672,1.781C10.357,8.561,8.904,9,8,9c-1.654,0-3,1.346-3,3v2c0,1.654,1.346,3,3,3c0.904,0,2.357,0.439,3.109,0.941l2.672,1.781c0.451,0.301,0.907,0.453,1.356,0.453C16.035,20.176,17,19.495,17,18V8C17,6.505,16.035,5.824,15.138,5.824z M8,15c-0.552,0-1-0.448-1-1v-2c0-0.552,0.448-1,1-1c1.211,0,2.907-0.495,4-1.146v6.293C10.907,15.495,9.211,15,8,15z M15,18c0,0.046-0.002,0.086-0.006,0.12c-0.03-0.016-0.065-0.036-0.104-0.062L13,16.798V9.202l1.891-1.261c0.038-0.025,0.073-0.046,0.104-0.062C14.998,7.914,15,7.954,15,8V18z"/>\n <path fill="#fff" d="M18.292,10.294c-0.39,0.391-0.39,1.023,0.002,1.414c0.345,0.345,0.535,0.803,0.535,1.291c0,0.489-0.19,0.948-0.536,1.294c-0.391,0.39-0.391,1.023,0,1.414C18.488,15.902,18.744,16,19,16s0.512-0.098,0.707-0.293c0.724-0.723,1.122-1.685,1.122-2.708s-0.398-1.984-1.123-2.707C19.317,9.903,18.683,9.901,18.292,10.294z"/>\n </g>\n</svg>',this.volumeUp.svg='<?xml version="1.0"?>\n<svg baseProfile="tiny" height="24px" version="1.2" viewBox="0 0 24 24" width="24px"\n xml:space="preserve" xmlns="http://www.w3.org/2000/svg"\n xmlns:xlink="http://www.w3.org/1999/xlink">\n <g id="Layer_1">\n <path fill="#fff" d="M16.706,10.292c-0.389-0.389-1.023-0.391-1.414,0.002c-0.39,0.391-0.39,1.023,0.002,1.414c0.345,0.345,0.535,0.803,0.535,1.291c0,0.489-0.19,0.948-0.536,1.294c-0.391,0.39-0.391,1.023,0,1.414C15.488,15.902,15.744,16,16,16s0.512-0.098,0.707-0.293c0.724-0.723,1.122-1.685,1.122-2.708S17.431,11.015,16.706,10.292z"/>\n <path fill="#fff" d="M18.706,8.292c-0.391-0.389-1.023-0.39-1.414,0.002c-0.39,0.391-0.39,1.024,0.002,1.414c0.879,0.877,1.363,2.044,1.364,3.287c0.001,1.246-0.484,2.417-1.365,3.298c-0.391,0.391-0.391,1.023,0,1.414C17.488,17.902,17.744,18,18,18s0.512-0.098,0.707-0.293c1.259-1.259,1.952-2.933,1.951-4.713C20.657,11.217,19.964,9.547,18.706,8.292z"/>\n <path fill="#fff" d="M20.706,6.292c-0.391-0.389-1.023-0.39-1.414,0.002c-0.39,0.391-0.39,1.024,0.002,1.414c1.412,1.409,2.191,3.285,2.192,5.284c0.002,2.002-0.777,3.885-2.193,5.301c-0.391,0.391-0.391,1.023,0,1.414C19.488,19.902,19.744,20,20,20s0.512-0.098,0.707-0.293c1.794-1.794,2.781-4.18,2.779-6.717C23.485,10.457,22.497,8.078,20.706,6.292z"/>\n <path fill="#fff" d="M12.138,5.824c-0.449,0-0.905,0.152-1.356,0.453L8.109,8.059C7.357,8.561,5.904,9,5,9c-1.654,0-3,1.346-3,3v2c0,1.654,1.346,3,3,3c0.904,0,2.357,0.439,3.109,0.941l2.672,1.781c0.451,0.301,0.907,0.453,1.356,0.453C13.035,20.176,14,19.495,14,18V8C14,6.505,13.035,5.824,12.138,5.824z M5,15c-0.552,0-1-0.448-1-1v-2c0-0.552,0.448-1,1-1c1.211,0,2.907-0.495,4-1.146v6.293C7.907,15.495,6.211,15,5,15z M12,18c0,0.046-0.002,0.086-0.006,0.12c-0.03-0.016-0.065-0.036-0.104-0.062L10,16.798V9.202l1.891-1.261c0.038-0.025,0.073-0.046,0.104-0.062C11.998,7.914,12,7.954,12,8V18z"/>\n </g>\n</svg>'}load(t){O(t)||(void 0!==t.enable&&(this.enable=t.enable),this.mute.load(t.mute),this.unmute.load(t.unmute),this.volumeDown.load(t.volumeDown),this.volumeUp.load(t.volumeUp))}}class ls{max;min;step;value;constructor(){this.value=100,this.max=100,this.min=0,this.step=10}load(t){O(t)||(S(t)?(void 0!==t.max&&(this.max=t.max),void 0!==t.min&&(this.min=t.min),void 0!==t.step&&(this.step=t.step),void 0!==t.value&&(this.value=t.value)):this.value=t)}}class cs{autoPlay;enable;events;icons;volume;constructor(){this.autoPlay=!0,this.enable=!1,this.events=[],this.icons=new rs,this.volume=new ls}load(t){O(t)||(void 0!==t.autoPlay&&(this.autoPlay=t.autoPlay),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.events&&(this.events=t.events.map(t=>{const e=new as;return e.load(t),e})),this.icons.load(t.icons),void 0!==t.volume&&this.volume.load(t.volume))}}const hs=new Map;function ds(t){const e=/(([A-G]b?)(\d))|pause/i.exec(t);if(!e?.length)return;const i=e[2]??e[0],s=hs.get(i);return s?s[parseInt(e[3]??"0")]:void 0}hs.set("C",[16.35,32.7,65.41,130.81,261.63,523.25,1046.5,2093,4186.01]),hs.set("Db",[17.32,34.65,69.3,138.59,277.18,554.37,1108.73,2217.46,4434.92]),hs.set("D",[18.35,36.71,73.42,146.83,293.66,587.33,1174.66,2349.32,4698.63]),hs.set("Eb",[19.45,38.89,77.78,155.56,311.13,622.25,1244.51,2489.02,4978.03]),hs.set("E",[20.6,41.2,82.41,164.81,329.63,659.25,1318.51,2637.02,5274.04]),hs.set("F",[21.83,43.65,87.31,174.61,349.23,698.46,1396.91,2793.83,5587.65]),hs.set("Gb",[23.12,46.25,92.5,185,369.99,739.99,1479.98,2959.96,5919.91]),hs.set("G",[24.5,49,98,196,392,783.99,1567.98,3135.96,6271.93]),hs.set("Ab",[25.96,51.91,103.83,207.65,415.3,830.61,1661.22,3322.44,6644.88]),hs.set("A",[27.5,55,110,220,440,880,1760,3520,7040]),hs.set("Bb",[29.14,58.27,116.54,233.08,466.16,932.33,1864.66,3729.31,7458.62]),hs.set("B",[30.87,61.74,123.47,246.94,493.88,987.77,1975.53,3951.07,7902.13]),hs.set("pause",[0]);let us=!0;const ps=()=>us,fs=()=>{us=!1},gs=()=>{removeEventListener(ts,gs),removeEventListener(es,gs),fs()};class ms{id="sounds";_engine;constructor(t){this._engine=t;const e={capture:!0,once:!0};addEventListener(ts,gs,e),addEventListener(es,gs,e)}async getPlugin(t){const{SoundsPluginInstance:e}=await Promise.resolve().then(function(){return Zs});return new e(t,this._engine)}loadOptions(t,e,i){if(!this.needsPlugin(e)&&!this.needsPlugin(i))return;let s=e.sounds;void 0===s?.load&&(e.sounds=s=new cs),s.load(i?.sounds)}needsPlugin(t){return t?.sounds?.enable??!1}}async function _s(t){t.checkVersion("4.0.0-beta.16"),await t.pluginManager.register(t=>{t.pluginManager.addPlugin(new ms(t))})}const ys={a:1,b:0,c:0,d:1};class vs{_container;constructor(t){this._container=t}drawAfter(t){const{context:e,drawPosition:i,drawRadius:n,drawScale:o,particle:r,transformData:l}=t,c=2*n,h=this._container.retina.pixelRatio,d=r.trail;if(!d||!r.trailLength)return;const u=i,p=r.trailLength*o+n;if(d.push({break:r.justWarped,color:e.fillStyle||e.strokeStyle,position:{x:u.x,y:u.y},transformData:l}),d.length<3)return;const f=Math.floor(p);d.length>f&&d.splice(0,d.length-f);const g=Math.min(d.length,p);e.save(),e.lineCap="butt",e.lineJoin="round";for(let t=g-2;t>0;t--){const i=d[t+1],n=d[t],l=d[t-1];if(!i||!n||!l)continue;const u=i.position,p=n.position,f=l.position,m=r.trailTransform?n.transformData??ys:ys;if(n.break||i.break||l.break)continue;e.setTransform(m.a,m.b,m.c,m.d,p.x,p.y);const _=(u.x+p.x)*s-p.x,y=(u.y+p.y)*s-p.y,v=(p.x+f.x)*s-p.x,w=(p.y+f.y)*s-p.y;e.beginPath(),e.moveTo(_,y),e.quadraticCurveTo(a.x,a.y,v,w);const b=Math.max(t/g*c,h,(r.trailMinWidth??-1)*o),x=e.globalAlpha;e.globalAlpha=r.trailFade?t/g:1,e.lineWidth=r.trailMaxWidth?Math.min(b,r.trailMaxWidth*o):b,e.strokeStyle=n.color,e.stroke(),e.globalAlpha=x}e.restore()}particleInit(t,e){e.trail=[];const i=e.effectData;e.trailFade=i?.fade??!0,e.trailLength=U(i?.length??10)*t.retina.pixelRatio,e.trailMaxWidth=i?.maxWidth?U(i.maxWidth)*t.retina.pixelRatio:void 0,e.trailMinWidth=i?.minWidth?U(i.minWidth)*t.retina.pixelRatio:void 0,e.trailTransform=i?.transform??!1}}async function ws(t){t.checkVersion("4.0.0-beta.16"),await t.pluginManager.register(t=>{t.pluginManager.addEffect("trail",t=>Promise.resolve(new vs(t)))})}async function bs(t){await t.pluginManager.register(async t=>{await Promise.all([fi(t),(async t=>{await Ai(t),await Wi(t)})(t),ws(t),_s(t),Qi(t),Ki(t),Mi(t),Zi(t)]),t.pluginManager.addPreset("fireworks",Ae(),!1)})}const xs=globalThis;xs.__tsParticlesInternals=xs.__tsParticlesInternals??{},xs.loadFireworksPreset=bs;function Ps(t,e,i){const s=e[i];void 0!==s&&(t[i]=(t[i]??1)*s)}class zs{_canvasClearPlugins;_canvasManager;_canvasPaintPlugins;_clearDrawPlugins;_colorPlugins;_container;_context;_contextSettings;_drawParticlePlugins;_drawParticlesCleanupPlugins;_drawParticlesSetupPlugins;_drawPlugins;_drawSettingsCleanupPlugins;_drawSettingsSetupPlugins;_pluginManager;_postDrawUpdaters;_preDrawUpdaters;_reusableColorStyles={};_reusablePluginColors=[void 0,void 0];_reusableTransform={};constructor(t,e,i){this._pluginManager=t,this._container=e,this._canvasManager=i,this._context=null,this._preDrawUpdaters=[],this._postDrawUpdaters=[],this._colorPlugins=[],this._canvasClearPlugins=[],this._canvasPaintPlugins=[],this._clearDrawPlugins=[],this._drawParticlePlugins=[],this._drawParticlesCleanupPlugins=[],this._drawParticlesSetupPlugins=[],this._drawPlugins=[],this._drawSettingsSetupPlugins=[],this._drawSettingsCleanupPlugins=[]}get settings(){return this._contextSettings}canvasClear(){this._container.actualOptions.clear&&this.draw(t=>{ve(t,this._canvasManager.size)})}clear(){let t=!1;for(const e of this._canvasClearPlugins)if(t=e.canvasClear?.()??!1,t)break;t||this.canvasClear()}destroy(){this.stop(),this._preDrawUpdaters=[],this._postDrawUpdaters=[],this._colorPlugins=[],this._canvasClearPlugins=[],this._canvasPaintPlugins=[],this._clearDrawPlugins=[],this._drawParticlePlugins=[],this._drawParticlesCleanupPlugins=[],this._drawParticlesSetupPlugins=[],this._drawPlugins=[],this._drawSettingsSetupPlugins=[],this._drawSettingsCleanupPlugins=[]}draw(t){const e=this._context;if(e)return t(e)}drawParticle(t,e){if(t.spawning||t.destroyed)return;const i=t.getRadius();if(i<=0)return;const s=t.getFillColor(),n=t.getStrokeColor();let[a,o]=this._getPluginParticleColors(t);if(a??=s,o??=n,!a&&!o)return;const r=this._container,l=t.options.zIndex,c=1-t.zIndexFactor,{fillOpacity:h,opacity:d,strokeOpacity:u}=t.getOpacity(),p=this._reusableTransform,f=this._reusableColorStyles,g=a?Ie(a,r.hdr,h*d):void 0,m=o?Ie(o,r.hdr,u*d):g;p.a=p.b=p.c=p.d=void 0,f.fill=g,f.stroke=m,this.draw(s=>{for(const i of this._drawParticlesSetupPlugins)i.drawParticleSetup?.(s,t,e);this._applyPreDrawUpdaters(s,t,i,d,f,p),function(t){const{container:e,context:i,particle:s,delta:n,colorStyles:a,radius:o,opacity:r,transform:l}=t,{effectDrawers:c,shapeDrawers:h}=e,d=s.getPosition(),u=s.getTransformData(l),p={x:d.x,y:d.y};i.setTransform(u.a,u.b,u.c,u.d,d.x,d.y),a.fill&&(i.fillStyle=a.fill);const f=!!s.fillEnabled,g=s.strokeWidth??0;i.lineWidth=g,a.stroke&&(i.strokeStyle=a.stroke);const m={context:i,particle:s,radius:o,drawRadius:1*o,opacity:r,delta:n,pixelRatio:e.retina.pixelRatio,fill:f,stroke:g>0,transformData:u,position:{...d},drawPosition:p,drawScale:1};for(const t of e.plugins)t.drawParticleTransform?.(m);const _=s.effect?c.get(s.effect):void 0,y=s.shape?h.get(s.shape):void 0;!function(t,e){if(!t?.drawBefore)return;const{particle:i}=e;i.effect&&t.drawBefore(e)}(_,m),function(t,e){if(!t?.beforeDraw)return;const{particle:i}=e;i.shape&&t.beforeDraw(e)}(y,m),function(t,e){if(!t)return;const{context:i,fill:s,particle:n,stroke:a}=e;n.shape&&(i.beginPath(),t.draw(e),n.shapeClose&&i.closePath(),s&&i.fill(),a&&i.stroke())}(y,m),function(t,e){if(!t?.afterDraw)return;const{particle:i}=e;i.shape&&t.afterDraw(e)}(y,m),function(t,e){if(!t?.drawAfter)return;const{particle:i}=e;i.effect&&t.drawAfter(e)}(_,m),i.resetTransform()}({container:r,context:s,particle:t,delta:e,colorStyles:f,radius:i*c**l.sizeRate,opacity:d,transform:p}),this._applyPostDrawUpdaters(t);for(const i of this._drawParticlesCleanupPlugins)i.drawParticleCleanup?.(s,t,e)})}drawParticlePlugins(t,e){this.draw(i=>{for(const s of this._drawParticlePlugins)we(i,s,t,e)})}drawParticles(t){const{particles:e}=this._container;this.clear(),e.update(t),this.draw(i=>{for(const e of this._drawSettingsSetupPlugins)e.drawSettingsSetup?.(i,t);for(const e of this._drawPlugins)e.draw?.(i,t);e.drawParticles(t);for(const e of this._clearDrawPlugins)e.clearDraw?.(i,t);for(const e of this._drawSettingsCleanupPlugins)e.drawSettingsCleanup?.(i,t)})}init(){this.initUpdaters(),this.initPlugins(),this.paint()}initPlugins(){this._colorPlugins=[],this._canvasClearPlugins=[],this._canvasPaintPlugins=[],this._clearDrawPlugins=[],this._drawParticlePlugins=[],this._drawParticlesSetupPlugins=[],this._drawParticlesCleanupPlugins=[],this._drawPlugins=[],this._drawSettingsSetupPlugins=[],this._drawSettingsCleanupPlugins=[];for(const t of this._container.plugins)(t.particleFillColor??t.particleStrokeColor)&&this._colorPlugins.push(t),t.canvasClear&&this._canvasClearPlugins.push(t),t.canvasPaint&&this._canvasPaintPlugins.push(t),t.drawParticle&&this._drawParticlePlugins.push(t),t.drawParticleSetup&&this._drawParticlesSetupPlugins.push(t),t.drawParticleCleanup&&this._drawParticlesCleanupPlugins.push(t),t.draw&&this._drawPlugins.push(t),t.drawSettingsSetup&&this._drawSettingsSetupPlugins.push(t),t.drawSettingsCleanup&&this._drawSettingsCleanupPlugins.push(t),t.clearDraw&&this._clearDrawPlugins.push(t)}initUpdaters(){this._preDrawUpdaters=[],this._postDrawUpdaters=[];for(const t of this._container.particleUpdaters)t.afterDraw&&this._postDrawUpdaters.push(t),(t.getColorStyles??t.getTransformValues??t.beforeDraw)&&this._preDrawUpdaters.push(t)}paint(){let t=!1;for(const e of this._canvasPaintPlugins)if(t=e.canvasPaint?.()??!1,t)break;t||this.paintBase()}paintBase(t){this.draw(e=>{!function(t,e,i){t.fillStyle=i??"rgba(0,0,0,0)",t.fillRect(a.x,a.y,e.width,e.height)}(e,this._canvasManager.size,t)})}paintImage(t,e){this.draw(i=>{!function(t,e,i,s){if(!i)return;const n=t.globalAlpha;t.globalAlpha=s,t.drawImage(i,a.x,a.y,e.width,e.height),t.globalAlpha=n}(i,this._canvasManager.size,t,e)})}setContext(t){this._context=t,this._context&&(this._context.globalCompositeOperation="source-over")}setContextSettings(t){this._contextSettings=t}stop(){this.draw(t=>{ve(t,this._canvasManager.size)})}_applyPostDrawUpdaters=t=>{for(const e of this._postDrawUpdaters)e.afterDraw?.(t)};_applyPreDrawUpdaters=(t,e,i,s,n,a)=>{for(const o of this._preDrawUpdaters){if(o.getColorStyles){const{fill:a,stroke:r}=o.getColorStyles(e,t,i,s);a&&(n.fill=a),r&&(n.stroke=r)}if(o.getTransformValues){const t=o.getTransformValues(e);for(const e in t)Ps(a,t,e)}o.beforeDraw?.(e)}};_getPluginParticleColors=t=>{let e,i;for(const s of this._colorPlugins)if(!e&&s.particleFillColor&&(e=Me(this._pluginManager,s.particleFillColor(t))),!i&&s.particleStrokeColor&&(i=Me(this._pluginManager,s.particleStrokeColor(t))),e&&i)break;return this._reusablePluginColors[0]=e,this._reusablePluginColors[1]=i,this._reusablePluginColors}}function Ms(t,e,i=!1){if(!e)return;const s=t.style,n=new Set;for(let t=0;t<s.length;t++){const e=s.item(t);e&&n.add(e)}for(let t=0;t<e.length;t++){const i=e.item(t);i&&n.add(i)}for(const t of n){const n=e.getPropertyValue(t);n?s.setProperty(t,n,i?"important":""):s.removeProperty(t)}}class Cs{element;render;size;zoom=1;_container;_generated;_mutationObserver;_originalStyle;_pluginManager;_pointerEvents;_resizePlugins;_standardSize;_zoomCenter;constructor(t,e){this._pluginManager=t,this._container=e,this.render=new zs(t,e,this),this._standardSize={height:0,width:0};const i=e.retina.pixelRatio,s=this._standardSize;this.size={height:s.height*i,width:s.width*i},this._generated=!1,this._resizePlugins=[],this._pointerEvents="none"}get _fullScreen(){return this._container.actualOptions.fullScreen.enable}destroy(){if(this.stop(),this._generated){const t=this.element;t?.remove(),this.element=void 0}else this._resetOriginalStyle();this.render.destroy(),this._resizePlugins=[]}getZoomCenter(){const t=this._container.retina.pixelRatio,{width:e,height:i}=this.size;return this._zoomCenter?this._zoomCenter:{x:e*s/t,y:i*s/t}}init(){this._safeMutationObserver(t=>{t.disconnect()}),this._mutationObserver=function(t){if("undefined"!=typeof MutationObserver)return new MutationObserver(t)}(t=>{for(const e of t)"attributes"===e.type&&"style"===e.attributeName&&this._repairStyle()}),this.resize(),this._initStyle(),this.initBackground(),this._safeMutationObserver(t=>{this.element&&this.element instanceof Node&&t.observe(this.element,{attributes:!0})}),this.initPlugins(),this.render.init()}initBackground(){const{_container:t}=this,e=t.actualOptions.background,i=this.element;if(!i)return;const s=i.style,n=Pe(this._pluginManager,e.color);s.backgroundColor=n?ke(n,t.hdr,e.opacity):"",s.backgroundImage=e.image||"",s.backgroundPosition=e.position||"",s.backgroundRepeat=e.repeat||"",s.backgroundSize=e.size||""}initPlugins(){this._resizePlugins=[];for(const t of this._container.plugins)t.resize&&this._resizePlugins.push(t)}loadCanvas(t){this._generated&&this.element&&this.element.remove();const i=this._container;this._generated=e in t.dataset?"true"===t.dataset[e]:this._generated,this.element=t,this.element.ariaHidden="true",this._originalStyle=function(t){const e=tt().createElement("div").style;for(const i in t){const s=t[i];if(!(i in t)||O(s))continue;const n=t.getPropertyValue?.(s);if(!n)continue;const a=t.getPropertyPriority?.(s);a?e.setProperty(s,n,a):e.setProperty(s,n)}return e}(this.element.style);const s=this._standardSize;s.height=t.offsetHeight,s.width=t.offsetWidth;const n=this._container.retina.pixelRatio,a=this.size;t.height=a.height=s.height*n,t.width=a.width=s.width*n;const o=et("(color-gamut: p3)");this.render.setContextSettings({alpha:!0,colorSpace:o?.matches&&i.hdr?"display-p3":"srgb",desynchronized:!0,willReadFrequently:!1}),this.render.setContext(this.element.getContext("2d",this.render.settings)),this._safeMutationObserver(t=>{t.disconnect()}),i.retina.init(),this.initBackground(),this._safeMutationObserver(t=>{this.element&&this.element instanceof Node&&t.observe(this.element,{attributes:!0})})}resize(){if(!this.element)return!1;const t=this._container,e=t.canvas._standardSize,i={width:this.element.offsetWidth,height:this.element.offsetHeight},s=t.retina.pixelRatio,n={width:i.width*s,height:i.height*s};if(i.height===e.height&&i.width===e.width&&n.height===this.element.height&&n.width===this.element.width)return!1;const a={...e};e.height=i.height,e.width=i.width;const o=this.size;return this.element.width=o.width=n.width,this.element.height=o.height=n.height,this._container.started&&t.particles.setResizeFactor({width:e.width/a.width,height:e.height/a.height}),!0}setPointerEvents(t){this.element&&(this._pointerEvents=t,this._repairStyle())}setZoom(t,e){this.zoom=t,this._zoomCenter=e}stop(){this._safeMutationObserver(t=>{t.disconnect()}),this._mutationObserver=void 0,this.render.stop()}async windowResize(){if(!this.element||!this.resize())return;const t=this._container,e=t.updateActualOptions();t.particles.setDensity(),this._applyResizePlugins(),e&&await t.refresh()}_applyResizePlugins=()=>{for(const t of this._resizePlugins)t.resize?.()};_initStyle=()=>{const t=this.element,e=this._container.actualOptions;if(t){this._fullScreen?this._setFullScreenStyle():this._resetOriginalStyle();for(const i in e.style){if(!i||!(i in e.style))continue;const s=e.style[i];s&&t.style.setProperty(i,s,"important")}}};_repairStyle=()=>{const t=this.element;if(!t)return;this._safeMutationObserver(t=>{t.disconnect()}),this._initStyle(),this.initBackground();const e=this._pointerEvents;t.style.pointerEvents=e,t.style.setProperty("pointer-events",e),this._safeMutationObserver(e=>{t instanceof Node&&e.observe(t,{attributes:!0})})};_resetOriginalStyle=()=>{const t=this.element,e=this._originalStyle;t&&e&&Ms(t,e,!0)};_safeMutationObserver=t=>{this._mutationObserver&&t(this._mutationObserver)};_setFullScreenStyle=()=>{const t=this.element;t&&Ms(t,pt(this._container.actualOptions.fullScreen.zIndex),!0)}}class Ss{container;_handlers;_resizeObserver;_resizeTimeout;constructor(t){this.container=t,this._handlers={visibilityChange:()=>{this._handleVisibilityChange()},resize:()=>{this._handleWindowResize()}}}addListeners(){this._manageListeners(!0)}removeListeners(){this._manageListeners(!1)}_handleVisibilityChange=()=>{const t=this.container;t.actualOptions.pauseOnBlur&&(tt().hidden?(t.pageHidden=!0,t.pause()):(t.pageHidden=!1,t.animationStatus?t.play(!0):t.draw(!0)))};_handleWindowResize=()=>{this._resizeTimeout&&(clearTimeout(this._resizeTimeout),delete this._resizeTimeout);const t=async()=>{const t=this.container.canvas;await t.windowResize()};this._resizeTimeout=setTimeout(()=>{t()},this.container.actualOptions.resize.delay*n)};_manageListeners=t=>{const e=this._handlers;this._manageResize(t),ft(document,"visibilitychange",e.visibilityChange,t,!1)};_manageResize=t=>{const e=this._handlers,i=this.container;if(!i.actualOptions.resize.enable)return;if("undefined"==typeof ResizeObserver)return void ft(globalThis,"resize",e.resize,t);const s=i.canvas.element;this._resizeObserver&&!t?(s&&this._resizeObserver.unobserve(s),this._resizeObserver.disconnect(),delete this._resizeObserver):!this._resizeObserver&&t&&s&&(this._resizeObserver=new ResizeObserver(t=>{t.find(t=>t.target===s)&&this._handleWindowResize()}),this._resizeObserver.observe(s))}}function ks(t){if(e=t.outMode,i=t.checkModes,!(e===i||k(i)&&i.includes(e)))return;var e,i;const s=2*t.radius;t.coord>t.maxCoord-s?t.setCb(-t.radius):t.coord<s&&t.setCb(t.radius)}class Os{backColor;bubble;destroyed;direction;effect;effectClose;effectData;fillColor;fillEnabled;fillOpacity;group;id;ignoresResizeRatio;initialPosition;initialVelocity;isRotating;justWarped;lastPathTime;misplaced;moveCenter;offset;opacity;options;outType;pathRotation;position;randomIndexData;retina;roll;rotation;shape;shapeClose;shapeData;sides;size;slow;spawning;strokeColor;strokeOpacity;strokeWidth;unbreakable;velocity;zIndexFactor;_cachedOpacityData={fillOpacity:1,opacity:1,strokeOpacity:1};_cachedPosition=x.origin;_cachedRotateData={sin:0,cos:0};_cachedTransform={a:1,b:0,c:0,d:1};_container;_pluginManager;constructor(t,e){this._pluginManager=t,this._container=e}destroy(t){if(this.unbreakable||this.destroyed)return;this.destroyed=!0,this.bubble.inRange=!1,this.slow.inRange=!1;const e=this._container,i=this.shape?e.shapeDrawers.get(this.shape):void 0;i?.particleDestroy?.(this);for(const i of e.particleDestroyedPlugins)i.particleDestroyed?.(this,t);for(const i of e.particleUpdaters)i.particleDestroyed?.(this,t);this._container.dispatchEvent(_t.particleDestroyed,{particle:this})}draw(t){const e=this._container.canvas.render;e.drawParticlePlugins(this,t),e.drawParticle(this,t)}getAngle(){return this.rotation+(this.pathRotation?this.velocity.angle:0)}getFillColor(){return this._getRollColor(this.bubble.color??De(this.fillColor))}getMass(){return this.getRadius()**2*Math.PI*s}getOpacity(){const t=this.options.zIndex,e=(1-this.zIndexFactor)**t.opacityRate,i=this.bubble.opacity??U(this.opacity?.value??1),s=this.fillOpacity??1,n=this.strokeOpacity??1;return this._cachedOpacityData.fillOpacity=i*s*e,this._cachedOpacityData.opacity=i*e,this._cachedOpacityData.strokeOpacity=i*n*e,this._cachedOpacityData}getPosition(){return this._cachedPosition.x=this.position.x+this.offset.x,this._cachedPosition.y=this.position.y+this.offset.y,this._cachedPosition.z=this.position.z,this._cachedPosition}getRadius(){return this.bubble.radius??this.size.value}getRotateData(){const t=this.getAngle();return this._cachedRotateData.sin=Math.sin(t),this._cachedRotateData.cos=Math.cos(t),this._cachedRotateData}getStrokeColor(){return this._getRollColor(this.bubble.color??De(this.strokeColor))}getTransformData(t){const e=this.getRotateData(),i=this.isRotating;return this._cachedTransform.a=e.cos*(t.a??o),this._cachedTransform.b=i?e.sin*(t.b??1):t.b??r,this._cachedTransform.c=i?-e.sin*(t.c??1):t.c??l,this._cachedTransform.d=e.cos*(t.d??c),this._cachedTransform}init(t,e,i,s){const n=this._container;this.id=t,this.group=s,this.justWarped=!1,this.effectClose=!0,this.shapeClose=!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:{},maxSpeed:0,moveDrift:0,moveSpeed:0,sizeAnimationSpeed:0},this.outType=It.normal,this.ignoresResizeRatio=!0;const a=n.retina.pixelRatio,o=n.actualOptions,r=_e(this._pluginManager,n,o.particles),l=r.reduceDuplicates,c=r.effect.type,d=r.shape.type;this.effect=rt(c,this.id,l),this.shape=rt(d,this.id,l);const u=r.effect,p=r.shape;if(i){if(i.effect?.type){const t=rt(i.effect.type,this.id,l);t&&(this.effect=t,u.load(i.effect))}if(i.shape?.type){const t=rt(i.shape.type,this.id,l);t&&(this.shape=t,p.load(i.shape))}}if(this.effect===h){const t=[...this._container.effectDrawers.keys()];this.effect=t[Math.floor(F()*t.length)]}if(this.shape===h){const t=[...this._container.shapeDrawers.keys()];this.shape=t[Math.floor(F()*t.length)]}this.effectData=this.effect?function(t,e,i,s){const n=e.options[t];return at({close:e.close},rt(n,i,s))}(this.effect,u,this.id,l):void 0,this.shapeData=this.shape?function(t,e,i,s){const n=e.options[t];return at({close:e.close},rt(n,i,s))}(this.shape,p,this.id,l):void 0,r.load(i);const f=this.effectData;f&&r.load(f.particles);const g=this.shapeData;g&&r.load(g.particles),this.effectClose=f?.close??r.effect.close,this.shapeClose=g?.close??r.shape.close,this.options=r,n.retina.initParticle(this),this.size=lt(this.options.size,a),this.bubble={inRange:!1},this.slow={inRange:!1,factor:1},this._initPosition(e),this.initialVelocity=this._calculateVelocity(),this.velocity=this.initialVelocity.copy();let m,_;n.particles.setLastZIndex(this.position.z),this.zIndexFactor=this.position.z/n.zLayers,this.sides=24,this.effect&&(m=n.effectDrawers.get(this.effect)),m?.loadEffect&&m.loadEffect(this),this.shape&&(_=n.shapeDrawers.get(this.shape)),_?.loadShape&&_.loadShape(this);const y=_?.getSidesCount;y&&(this.sides=y(this)),this.spawning=!1;for(const t of n.particleUpdaters)t.init(this);m?.particleInit?.(n,this),_?.particleInit?.(n,this);for(const t of n.particleCreatedPlugins)t.particleCreated?.(this)}isInsideCanvas(){const t=this.getRadius(),e=this._container.canvas.size,i=this.position;return i.x>=-t&&i.y>=-t&&i.y<=e.height+t&&i.x<=e.width+t}isShowingBack(){if(!this.roll)return!1;const t=this.roll.angle;if(this.roll.horizontal&&this.roll.vertical){const e=t%d,i=e<0?e+d:e;return i>=Math.PI*s&&i<3*Math.PI*s}if(this.roll.horizontal){const e=(t+Math.PI*s)%(2*Math.PI),i=e<0?e+2*Math.PI:e;return i>=Math.PI&&i<2*Math.PI}if(this.roll.vertical){const e=t%(2*Math.PI),i=e<0?e+2*Math.PI:e;return i>=Math.PI&&i<2*Math.PI}return!1}isVisible(){return!this.destroyed&&!this.spawning&&this.isInsideCanvas()}reset(){for(const t of this._container.particleUpdaters)t.reset?.(this)}_calcPosition=(t,e)=>{let i=0,s=t?x.create(t.x,t.y,e):void 0;const n=this._container,a=n.particlePositionPlugins,o=this.options.move.outModes,r=this.getRadius(),l=n.canvas.size,c=new AbortController,{signal:h}=c;for(;!h.aborted;){for(const t of a){const i=t.particlePosition?.(s,this);if(i)return x.create(i.x,i.y,e)}const t=j({size:l,position:s}),c=x.create(t.x,t.y,e);this._fixHorizontal(c,r,o.left??o.default),this._fixHorizontal(c,r,o.right??o.default),this._fixVertical(c,r,o.top??o.default),this._fixVertical(c,r,o.bottom??o.default);let h=!0;for(const t of n.particles.checkParticlePositionPlugins)if(h=t.checkParticlePosition?.(this,c,i)??!0,!h)break;if(h)return c;i+=1,s=void 0}return s};_calculateVelocity=()=>{const t=function(t){const e=P.origin;return e.length=1,e.angle=t,e}(this.direction).copy(),e=this.options.move;if(e.direction===w.inside||e.direction===w.outside)return t;const i=q(U(e.angle.value)),n=q(U(e.angle.offset)),a={left:n-i*s,right:n+i*s};return e.straight||(t.angle+=A(G(a.left,a.right))),e.random&&"number"==typeof e.speed&&(t.length*=F()),t};_fixHorizontal=(t,e,i)=>{ks({outMode:i,checkModes:[St.bounce],coord:t.x,maxCoord:this._container.canvas.size.width,setCb:e=>t.x+=e,radius:e})};_fixVertical=(t,e,i)=>{ks({outMode:i,checkModes:[St.bounce],coord:t.y,maxCoord:this._container.canvas.size.height,setCb:e=>t.y+=e,radius:e})};_getRollColor=t=>t&&this.roll&&(this.backColor||this.roll.alter)&&this.isShowingBack()?this.backColor?this.backColor:this.roll.alter?function(t,e,i){return{h:t.h,s:t.s,l:t.l+(e===kt.darken?-1:1)*i}}(t,this.roll.alter.type,this.roll.alter.value):t:t;_initPosition=t=>{const e=this._container,i=U(this.options.zIndex.value),n=this._calcPosition(t,T(i,0,e.zLayers));if(!n)throw new Error("a valid position cannot be found for particle");this.position=n,this.initialPosition=this.position.copy();const a=e.canvas.size;switch(this.moveCenter={...ht(this.options.move.center,a),radius:this.options.move.center.radius,mode:this.options.move.center.mode},this.direction=function(t,e,i){if(C(t))return q(t);switch(t){case w.top:return-Math.PI*s;case w.topRight:return-Math.PI*v;case w.right:return 0;case w.bottomRight:return Math.PI*v;case w.bottom:return Math.PI*s;case w.bottomLeft:return.75*Math.PI;case w.left:return Math.PI;case w.topLeft:return.75*-Math.PI;case w.inside:return Math.atan2(i.y-e.y,i.x-e.x);case w.outside:return Math.atan2(e.y-i.y,e.x-i.x);default:return F()*d}}(this.options.move.direction,this.position,this.moveCenter),this.options.move.direction){case w.inside:this.outType=It.inside;break;case w.outside:this.outType=It.outside}this.offset=P.origin}}class Is{_cellSize;_cells=new Map;_circlePool=[];_circlePoolIdx;_pendingCellSize;_rectanglePool=[];_rectanglePoolIdx;constructor(t){this._cellSize=t,this._circlePoolIdx=0,this._rectanglePoolIdx=0}clear(){this._cells.clear();const t=this._pendingCellSize;t&&(this._cellSize=t),this._pendingCellSize=void 0}insert(t){const{x:e,y:i}=t.getPosition(),s=this._cellKeyFromCoords(e,i);this._cells.has(s)||this._cells.set(s,[]),this._cells.get(s)?.push(t)}query(t,e,i=[]){const s=this._getRangeBounds(t);if(!s)return i;const n=Math.floor(s.minX/this._cellSize),a=Math.floor(s.maxX/this._cellSize),o=Math.floor(s.minY/this._cellSize),r=Math.floor(s.maxY/this._cellSize);for(let s=n;s<=a;s++)for(let n=o;n<=r;n++){const a=`${s}_${n}`,o=this._cells.get(a);if(o)for(const s of o)e&&!e(s)||t.contains(s.getPosition())&&i.push(s)}return i}queryCircle(t,e,i,s=[]){const n=this._acquireCircle(t.x,t.y,e),a=this.query(n,i,s);return this._releaseShapes(),a}queryRectangle(t,e,i,s=[]){const n=this._acquireRectangle(t.x,t.y,e.width,e.height),a=this.query(n,i,s);return this._releaseShapes(),a}setCellSize(t){this._pendingCellSize=t}_acquireCircle(t,e,i){return(this._circlePool[this._circlePoolIdx++]??=new Et(t,e,i)).reset(t,e,i)}_acquireRectangle(t,e,i,s){return(this._rectanglePool[this._rectanglePoolIdx++]??=new Ft(t,e,i,s)).reset(t,e,i,s)}_cellKeyFromCoords(t,e){return`${Math.floor(t/this._cellSize)}_${Math.floor(e/this._cellSize)}`}_getRangeBounds(t){if(t instanceof Et){const e=t.radius,{x:i,y:s}=t.position;return{minX:i-e,maxX:i+e,minY:s-e,maxY:s+e}}if(t instanceof Ft){const{x:e,y:i}=t.position,{width:s,height:n}=t.size;return{minX:e,maxX:e+s,minY:i,maxY:i+n}}return null}_releaseShapes(){this._circlePoolIdx=0,this._rectanglePoolIdx=0}}class Ds{checkParticlePositionPlugins;grid;_array;_container;_groupLimits;_limit;_maxZIndex;_minZIndex;_needsSort;_nextId;_particleResetPlugins;_particleUpdatePlugins;_pluginManager;_pool;_postParticleUpdatePlugins;_postUpdatePlugins;_resizeFactor;_updatePlugins;_zArray;constructor(t,e){this._pluginManager=t,this._container=e,this._nextId=0,this._array=[],this._zArray=[],this._pool=[],this._limit=0,this._groupLimits=new Map,this._needsSort=!1,this._minZIndex=0,this._maxZIndex=0,this.grid=new Is(100),this.checkParticlePositionPlugins=[],this._particleResetPlugins=[],this._particleUpdatePlugins=[],this._postUpdatePlugins=[],this._postParticleUpdatePlugins=[],this._updatePlugins=[]}get count(){return this._array.length}addParticle(t,e,i,s){const n=this._container.actualOptions.particles.number.limit.mode,a=void 0===i?this._limit:this._groupLimits.get(i)??this._limit,o=this.count;if(a>0)switch(n){case Ct.delete:{const t=o+1-a;t>0&&this.removeQuantity(t);break}case Ct.wait:if(o>=a)return}try{const n=this._pool.pop()??new Os(this._pluginManager,this._container);n.init(this._nextId,t,e,i);let a=!0;return s&&(a=s(n)),a?(this._array.push(n),this._zArray.push(n),this._nextId++,this._container.dispatchEvent(_t.particleAdded,{particle:n}),n):void this._pool.push(n)}catch(t){bt().warning(`error adding particle: ${t}`)}}clear(){this._array=[],this._zArray=[]}destroy(){this._array=[],this._pool.length=0,this._zArray=[],this.checkParticlePositionPlugins=[],this._particleResetPlugins=[],this._particleUpdatePlugins=[],this._postUpdatePlugins=[],this._postParticleUpdatePlugins=[],this._updatePlugins=[]}drawParticles(t){for(const e of this._zArray)e.draw(t)}filter(t){return this._array.filter(t)}find(t){return this._array.find(t)}get(t){return this._array[t]}async init(){const t=this._container,e=t.actualOptions;this._minZIndex=0,this._maxZIndex=0,this._needsSort=!1,this.checkParticlePositionPlugins=[],this._updatePlugins=[],this._particleUpdatePlugins=[],this._postUpdatePlugins=[],this._particleResetPlugins=[],this._postParticleUpdatePlugins=[],this.grid=new Is(100*t.retina.pixelRatio);for(const e of t.plugins)e.redrawInit&&await e.redrawInit(),e.checkParticlePosition&&this.checkParticlePositionPlugins.push(e),e.update&&this._updatePlugins.push(e),e.particleUpdate&&this._particleUpdatePlugins.push(e),e.postUpdate&&this._postUpdatePlugins.push(e),e.particleReset&&this._particleResetPlugins.push(e),e.postParticleUpdate&&this._postParticleUpdatePlugins.push(e);await this._container.initDrawersAndUpdaters();for(const e of this._container.effectDrawers.values())await(e.init?.(t));for(const e of this._container.shapeDrawers.values())await(e.init?.(t));let i=!1;for(const e of t.plugins)if(i=e.particlesInitialization?.()??i,i)break;if(!i){const t=e.particles,i=t.groups;for(const e in i){const s=i[e];if(s)for(let i=this.count,n=0;n<s.number.value&&i<t.number.value;i++,n++)this.addParticle(void 0,s,e)}for(let e=this.count;e<t.number.value;e++)this.addParticle()}}push(t,e,i,s){for(let n=0;n<t;n++)this.addParticle(e,i,s)}async redraw(){this.clear(),await this.init(),this._container.canvas.render.drawParticles({value:0,factor:0})}remove(t,e,i){this.removeAt(this._array.indexOf(t),void 0,e,i)}removeAt(t,e=1,i,s){if(t<0||t>this.count)return;let n=0;for(let a=t;n<e&&a<this.count;a++)this._removeParticle(a,i,s)&&(a--,n++)}removeQuantity(t,e){this.removeAt(0,t,e)}setDensity(){const t=this._container.actualOptions,e=t.particles.groups;let i=0;for(const t of this._container.plugins)t.particlesDensityCount&&(i+=t.particlesDensityCount());for(const t in e){const s=e[t];if(!s)continue;const n=_e(this._pluginManager,this._container,s);this._applyDensity(n,i,t)}this._applyDensity(t.particles,i)}setLastZIndex(t){this._needsSort||=t>=this._maxZIndex||t>this._minZIndex&&t<this._maxZIndex}setResizeFactor(t){this._resizeFactor=t}update(t){const e=new Set;this.grid.clear();for(const e of this._updatePlugins)e.update?.(t);const i=this._resizeFactor;for(const s of this._array){i&&!s.ignoresResizeRatio&&(s.position.x*=i.width,s.position.y*=i.height,s.initialPosition.x*=i.width,s.initialPosition.y*=i.height),s.ignoresResizeRatio=!1;for(const t of this._particleResetPlugins)t.particleReset?.(s);for(const e of this._particleUpdatePlugins){if(s.destroyed)break;e.particleUpdate?.(s,t)}s.destroyed?e.add(s):this.grid.insert(s)}for(const e of this._postUpdatePlugins)e.postUpdate?.(t);for(const i of this._array)if(i.destroyed)e.add(i);else{for(const e of this._container.particleUpdaters)e.update(i,t);if(i.destroyed||i.spawning)i.destroyed&&e.add(i);else for(const e of this._postParticleUpdatePlugins)e.postParticleUpdate?.(i,t)}if(e.size)for(const t of e)this.remove(t);if(delete this._resizeFactor,this._needsSort){const t=this._zArray;t.sort((t,e)=>e.position.z-t.position.z||t.id-e.id);const e=t[0],i=t[t.length-1];if(!e||!i)return;this._maxZIndex=e.position.z,this._minZIndex=i.position.z,this._needsSort=!1}}_addToPool=(...t)=>{this._pool.push(...t)};_applyDensity=(t,e,i,s)=>{const n=t.number;if(!n.density.enable)return void(void 0===i?this._limit=n.limit.value:(s?.number.limit.value??n.limit.value)&&this._groupLimits.set(i,s?.number.limit.value??n.limit.value));const a=this._initDensityFactor(n.density),o=n.value,r=n.limit.value>0?n.limit.value:o,l=Math.min(o,r)*a+e,c=Math.min(this.count,this.filter(t=>t.group===i).length);void 0===i?this._limit=n.limit.value*a:this._groupLimits.set(i,n.limit.value*a),c<l?this.push(Math.abs(l-c),void 0,t,i):c>l&&this.removeQuantity(c-l,i)};_initDensityFactor=t=>{const e=this._container;if(!e.canvas.element||!t.enable)return 1;const i=e.canvas.element,s=e.retina.pixelRatio;return i.width*i.height/(t.height*t.width*s**2)};_removeParticle=(t,e,i)=>{const s=this._array[t];if(!s)return!1;if(s.group!==e)return!1;const n=this._zArray.indexOf(s);return this._array.splice(t,1),this._zArray.splice(n,1),s.destroy(i),this._container.dispatchEvent(_t.particleRemoved,{particle:s}),this._addToPool(s),!0}}class Rs{container;pixelRatio;reduceFactor;constructor(t){this.container=t,this.pixelRatio=1,this.reduceFactor=1}init(){const t=this.container,e=t.actualOptions;this.pixelRatio=e.detectRetina?devicePixelRatio:1,this.reduceFactor=1;const i=this.pixelRatio,s=t.canvas;if(s.element){const t=s.element;s.size.width=t.offsetWidth*i,s.size.height=t.offsetHeight*i}}initParticle(t){const e=t.options,i=this.pixelRatio,s=e.move,n=s.distance,a=t.retina;a.maxSpeed=U(s.gravity.maxSpeed)*i,a.moveDrift=U(s.drift)*i,a.moveSpeed=U(s.speed)*i,a.sizeAnimationSpeed=U(e.size.animation.speed)*i;const o=a.maxDistance;o.horizontal=void 0===n.horizontal?void 0:n.horizontal*i,o.vertical=void 0===n.vertical?void 0:n.vertical*i}}function Es(t){return!t.destroyed}function Fs(t,e,...i){const s=new ye(t,e);return me(s,...i),s}var Ls=Object.freeze({__proto__:null,Container:class{actualOptions;canvas;destroyed;effectDrawers;fpsLimit;hdr;id;pageHidden;particleCreatedPlugins;particleDestroyedPlugins;particlePositionPlugins;particleUpdaters;particles;plugins;retina;shapeDrawers;started;zLayers;_delay;_delayTimeout;_delta={value:0,factor:0};_dispatchCallback;_drawAnimationFrame;_duration;_eventListeners;_firstStart;_initialSourceOptions;_lastFrameTime;_lifeTime;_onDestroy;_options;_paused;_pluginManager;_smooth;_sourceOptions;constructor(t){const{dispatchCallback:e,pluginManager:i,id:s,onDestroy:n,sourceOptions:a}=t;this._pluginManager=i,this._dispatchCallback=e,this._onDestroy=n,this.id=Symbol(s),this.fpsLimit=120,this.hdr=!1,this._smooth=!1,this._delay=0,this._duration=0,this._lifeTime=0,this._firstStart=!0,this.started=!1,this.destroyed=!1,this._paused=!0,this._lastFrameTime=0,this.zLayers=100,this.pageHidden=!1,this._sourceOptions=a,this._initialSourceOptions=a,this.effectDrawers=new Map,this.shapeDrawers=new Map,this.particleUpdaters=[],this.retina=new Rs(this),this.canvas=new Cs(this._pluginManager,this),this.particles=new Ds(this._pluginManager,this),this.plugins=[],this.particleDestroyedPlugins=[],this.particleCreatedPlugins=[],this.particlePositionPlugins=[],this._options=Fs(this._pluginManager,this),this.actualOptions=Fs(this._pluginManager,this),this._eventListeners=new Ss(this),this.dispatchEvent(_t.containerBuilt)}get animationStatus(){return!this._paused&&!this.pageHidden&&Es(this)}get options(){return this._options}get sourceOptions(){return this._sourceOptions}addLifeTime(t){this._lifeTime+=t}alive(){return!this._duration||this._lifeTime<=this._duration}destroy(t=!0){if(Es(this)){this.stop(),this.particles.destroy(),this.canvas.destroy();for(const[,t]of this.effectDrawers)t.destroy?.(this);for(const[,t]of this.shapeDrawers)t.destroy?.(this);for(const t of this.plugins)t.destroy?.();this.effectDrawers=new Map,this.shapeDrawers=new Map,this.particleUpdaters=[],this.plugins.length=0,this._pluginManager.clearPlugins(this),this.destroyed=!0,this._onDestroy(t),this.dispatchEvent(_t.containerDestroyed)}}dispatchEvent(t,e){this._dispatchCallback(t,{container:this,data:e})}draw(t){if(!Es(this))return;let e=t;this._drawAnimationFrame=R(t=>{e&&(this._lastFrameTime=void 0,e=!1),this._nextFrame(t)})}async export(t,e={}){for(const i of this.plugins){if(!i.export)continue;const s=await i.export(t,e);if(s.supported)return s.blob}bt().error(`Export plugin with type ${t} not found`)}async init(){if(!Es(this))return;const t=new Map;for(const e of this._pluginManager.plugins){const i=await e.getPlugin(this);i.preInit&&await i.preInit(),t.set(e,i)}await this.initDrawersAndUpdaters(),this._options=Fs(this._pluginManager,this,this._initialSourceOptions,this.sourceOptions),this.actualOptions=Fs(this._pluginManager,this,this._options),this.plugins.length=0,this.particleDestroyedPlugins.length=0,this.particleCreatedPlugins.length=0,this.particlePositionPlugins.length=0;for(const[e,i]of t)e.needsPlugin(this.actualOptions)&&(this.plugins.push(i),i.particleCreated&&this.particleCreatedPlugins.push(i),i.particleDestroyed&&this.particleDestroyedPlugins.push(i),i.particlePosition&&this.particlePositionPlugins.push(i));this.retina.init(),this.canvas.init(),this.updateActualOptions(),this.canvas.initBackground(),this.canvas.resize();const{delay:e,duration:i,fpsLimit:s,hdr:a,smooth:o,zLayers:r}=this.actualOptions;this.hdr=a,this.zLayers=r,this._duration=U(i)*n,this._delay=U(e)*n,this._lifeTime=0,this.fpsLimit=s>0?s:120,this._smooth=o;for(const t of this.plugins)await(t.init?.());await this.particles.init(),this.dispatchEvent(_t.containerInit),this.particles.setDensity();for(const t of this.plugins)t.particlesSetup?.();this.dispatchEvent(_t.particlesSetup)}async initDrawersAndUpdaters(){const t=this._pluginManager;this.effectDrawers=await t.getEffectDrawers(this,!0),this.shapeDrawers=await t.getShapeDrawers(this,!0),this.particleUpdaters=await t.getUpdaters(this,!0)}pause(){var t;if(Es(this)&&(void 0!==this._drawAnimationFrame&&(t=this._drawAnimationFrame,E(t),delete this._drawAnimationFrame),!this._paused)){for(const t of this.plugins)t.pause?.();this.pageHidden||(this._paused=!0),this.dispatchEvent(_t.containerPaused)}}play(t){if(!Es(this))return;const e=this._paused||t;if(!this._firstStart||this.actualOptions.autoPlay){if(this._paused&&(this._paused=!1),e)for(const t of this.plugins)t.play&&t.play();this.dispatchEvent(_t.containerPlay),this.draw(e??!1)}else this._firstStart=!1}async refresh(){if(Es(this))return this.stop(),this.start()}async reset(t){if(Es(this))return this._initialSourceOptions=t,this._sourceOptions=t,this._options=Fs(this._pluginManager,this,this._initialSourceOptions,this.sourceOptions),this.actualOptions=Fs(this._pluginManager,this,this._options),this.refresh()}async start(){Es(this)&&!this.started&&(await this.init(),this.started=!0,await new Promise(t=>{const e=async()=>{this._eventListeners.addListeners();for(const t of this.plugins)await(t.start?.());this.dispatchEvent(_t.containerStarted),this.play(),t()};this._delayTimeout=setTimeout(()=>{e()},this._delay)}))}stop(){if(Es(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();for(const t of this.plugins)t.stop?.();this.particleCreatedPlugins.length=0,this.particleDestroyedPlugins.length=0,this.particlePositionPlugins.length=0,this._sourceOptions=this._options,this.dispatchEvent(_t.containerStopped)}}updateActualOptions(){let t=!1;for(const e of this.plugins)e.updateActualOptions&&(t=e.updateActualOptions()||t);return t}_nextFrame=t=>{try{if(!this._smooth&&void 0!==this._lastFrameTime&&t<this._lastFrameTime+n/this.fpsLimit)return void this.draw(!1);if(this._lastFrameTime??=t,function(t,e,i=60,s=!1){t.value=e,t.factor=s?60/i:60*e/n}(this._delta,t-this._lastFrameTime,this.fpsLimit,this._smooth),this.addLifeTime(this._delta.value),this._lastFrameTime=t,this._delta.value>n)return void this.draw(!1);if(this.canvas.render.drawParticles(this._delta),!this.alive())return void this.destroy();this.animationStatus&&this.draw(!1)}catch(t){bt().error("error in animation loop",t)}}}});function Ts(t,e,i,s,n,a,o){!function(t,e){const i=t.options,s=i.move.path;if(!s.enable)return;const n=t.pathDelay??0;if(t.lastPathTime<=n)return void(t.lastPathTime+=e.value);const a=t.pathGenerator?.generate(t,e);a&&t.velocity.addTo(a);s.clamp&&(t.velocity.x=T(t.velocity.x,-1,1),t.velocity.y=T(t.velocity.y,-1,1));t.lastPathTime-=n}(t,o);const r=t.gravity,l=r?.enable&&r.inverse?-1:1;n&&i&&(t.velocity.x+=n*o.factor/(60*i)),r?.enable&&i&&(t.velocity.y+=l*(r.acceleration*o.factor)/(60*i));const c=t.moveDecay;t.velocity.multTo(c??1);const h=t.velocity.mult(i);r?.enable&&s>0&&(!r.inverse&&h.y>=0&&h.y>=s||r.inverse&&h.y<=0&&h.y<=-s)&&(h.y=l*s,i&&(t.velocity.y=h.y/i));const d=t.options.zIndex,u=(1-t.zIndexFactor)**d.velocityRate;h.multTo(u),h.multTo(a);const{position:p}=t;p.addTo(h),e.vibrate&&(p.x+=Math.sin(p.x*Math.cos(p.y))*a,p.y+=Math.cos(p.y*Math.sin(p.x))*a)}function As(t,e){const i=e.options.move.spin;if(!i.enable)return;const s=i.position??{x:50,y:50},n={x:.01*s.x*t.canvas.size.width,y:.01*s.y*t.canvas.size.height},a=e.getPosition(),o=(l=a,c=n,Math.sqrt($(l,c))),r=U(i.acceleration);var l,c;e.retina.spinAcceleration=r*t.retina.pixelRatio,e.spin={center:n,direction:e.velocity.x>=0?Mt.clockwise:Mt.counterClockwise,angle:F()*d,radius:o,acceleration:e.retina.spinAcceleration}}var Us=Object.freeze({__proto__:null,MovePluginInstance:class{availablePathGenerators;pathGenerators;_container;_pluginManager;constructor(t,e){this._pluginManager=t,this._container=e,this.availablePathGenerators=new Map,this.pathGenerators=new Map}destroy(){this.availablePathGenerators=new Map,this.pathGenerators=new Map}isEnabled(t){return!t.destroyed&&t.options.move.enable}particleCreated(t){const e=t.options.move,i=e.gravity,s=e.path;if(t.moveDecay=1-U(e.decay),t.pathDelay=U(s.delay.value)*n,s.generator){let e=this.pathGenerators.get(s.generator);e||(e=this.availablePathGenerators.get(s.generator),e&&(this.pathGenerators.set(s.generator,e),e.init())),t.pathGenerator=e}t.gravity={enable:i.enable,acceleration:U(i.acceleration),inverse:i.inverse},As(this._container,t)}particleDestroyed(t){const e=t.pathGenerator;e?.reset(t)}particleUpdate(t,e){const i=t.options,n=i.move;if(!n.enable)return;const a=this._container,o=a.retina.pixelRatio,r=function(t){return t.slow.inRange?t.slow.factor:1}(t),l=a.retina.reduceFactor,c=t.retina.moveSpeed,h=t.retina.moveDrift,d=B(i.size.value)*o,u=c*(n.size?t.getRadius()/d:1)*r*(e.factor||1)*s,p=t.retina.maxSpeed;n.spin.enable?function(t,e,i,n){if(!e.spin)return;const a=e.spin.direction===Mt.clockwise,o={x:a?Math.cos:Math.sin,y:a?Math.sin:Math.cos};e.position.x=e.spin.center.x+e.spin.radius*o.x(e.spin.angle)*n,e.position.y=e.spin.center.y+e.spin.radius*o.y(e.spin.angle)*n,e.spin.radius+=e.spin.acceleration*n;const r=Math.max(t.canvas.size.width,t.canvas.size.height),l=r*s;e.spin.radius>l?(e.spin.radius=l,e.spin.acceleration*=-1):e.spin.radius<0&&(e.spin.radius=0,e.spin.acceleration*=-1),e.spin.angle+=.01*i*(1-e.spin.radius/r)}(a,t,u,l):Ts(t,n,u,p,h,l,e),function(t){const e=t.initialPosition,{dx:i,dy:n}=W(e,t.position),a=Math.abs(i),o=Math.abs(n),{maxDistance:r}=t.retina,l=r.horizontal,c=r.vertical;if(!l&&!c)return;if((l&&a>=l||c&&o>=c)&&!t.misplaced)t.misplaced=!!l&&a>l||!!c&&o>c,l&&(t.velocity.x=t.velocity.y*s-t.velocity.x),c&&(t.velocity.y=t.velocity.x*s-t.velocity.y);else if((!l||a<l)&&(!c||o<c)&&t.misplaced)t.misplaced=!1;else if(t.misplaced){const i=t.position,s=t.velocity;l&&(i.x<e.x&&s.x<0||i.x>e.x&&s.x>0)&&(s.x*=-F()),c&&(i.y<e.y&&s.y<0||i.y>e.y&&s.y>0)&&(s.y*=-F())}}(t)}preInit(){return this._init()}redrawInit(){return this._init()}update(){for(const t of this.pathGenerators.values())t.update()}async _init(){const t=await(this._pluginManager.getPathGenerators?.(this._container,!0));if(t){this.availablePathGenerators=t,this.pathGenerators=new Map;for(const t of this.pathGenerators.values())t.init()}}}});var Vs=Object.freeze({__proto__:null,EmittersPluginInstance:class{container;_instancesManager;constructor(t,e){this.container=e,this._instancesManager=t,this._instancesManager.initContainer(e)}async init(){const t=this.container.actualOptions.emitters;if(k(t))for(const e of t)await this._instancesManager.addEmitter(this.container,e);else await this._instancesManager.addEmitter(this.container,t)}pause(){for(const t of this._instancesManager.getArray(this.container))t.pause()}play(){for(const t of this._instancesManager.getArray(this.container))t.play()}resize(){for(const t of this._instancesManager.getArray(this.container))t.resize()}stop(){this._instancesManager.clear(this.container)}update(t){this._instancesManager.getArray(this.container).forEach(e=>{e.update(t)})}}});const Bs=new Map;var Gs=Object.freeze({__proto__:null,ShapeManager:class{addShapeGenerator(t,e){this.getShapeGenerator(t)||Bs.set(t,e)}getShapeGenerator(t){return Bs.get(t)}getSupportedShapeGenerators(){return Bs.keys()}}});var Ws,$s,qs=Object.freeze({__proto__:null,EmittersInstancesManager:class{_containerArrays;_pluginManager;constructor(t){this._containerArrays=new Map,this._pluginManager=t}async addEmitter(t,e,i){const s=new Ri;s.load(e);const{EmitterInstance:n}=await Promise.resolve().then(function(){return Xs}),a=new n(this._pluginManager,t,e=>{this.removeEmitter(t,e)},s,i);return await a.init(),this.getArray(t).push(a),a}clear(t){this.initContainer(t),this._containerArrays.set(t,[])}getArray(t){this.initContainer(t);let e=this._containerArrays.get(t);return e||(e=[],this._containerArrays.set(t,e)),e}initContainer(t){this._containerArrays.has(t)||(this._containerArrays.set(t,[]),t.getEmitter=e=>{const i=this.getArray(t);return void 0===e||C(e)?i[e??0]:i.find(t=>t.name===e)},t.addEmitter=async(e,i)=>this.addEmitter(t,e,i),t.removeEmitter=e=>{const i=t.getEmitter?.(e);i&&this.removeEmitter(t,i)},t.playEmitter=e=>{const i=t.getEmitter?.(e);i&&i.externalPlay()},t.pauseEmitter=e=>{const i=t.getEmitter?.(e);i&&i.externalPause()})}removeEmitter(t,e){const i=this.getArray(t).indexOf(e);i>=0&&this.getArray(t).splice(i,1)}}});!function(t){t.mute="soundsMuted",t.unmute="soundsUnmuted"}(Ws||(Ws={})),function(t){t.Block="block",t.None="none"}($s||($s={}));function Ns(t){const e=tt().createElement("img"),{clickCb:i,container:s,display:n,iconOptions:a,margin:o,options:r,pos:l,rightOffsets:c}=t,{width:h,path:d,style:u,svg:p}=a;!function(t,e,i,s,n,a,o,r){t.style.userSelect="none",t.style.position="absolute",t.style.top=`${(e+o).toString()}px`,t.style.left=`${(i-o-a).toString()}px`,t.style.display=s,t.style.zIndex=(n+1).toString(),t.style.cssText+=r}(e,l.top+o,l.right-(o*(c.length+1)+h+c.reduce((t,e)=>t+e,0)),n,r.fullScreen.zIndex+1,h,o,u),e.src=d??(p?`data:image/svg+xml;base64,${btoa(p)}`:"");return(s.canvas.element?.parentNode??tt().body).append(e),e.addEventListener("click",()=>{i()}),e}function js(t){t&&t.remove()}var Zs=Object.freeze({__proto__:null,SoundsPluginInstance:class{_audioMap;_audioSources;_container;_engine;_gain;_muteImg;_unmuteImg;_volume;_volumeDownImg;_volumeUpImg;constructor(t,e){this._container=t,this._engine=e,this._volume=0,this._audioSources=[],this._audioMap=new Map}async init(){const t=this._container.actualOptions.sounds;if(!t?.enable)return;if(t.autoPlay&&ps()){const t=()=>{removeEventListener(ts,t),removeEventListener(es,t),fs(),this.unmute()},e={capture:!0,once:!0};addEventListener(ts,t,e),addEventListener(es,t,e)}this._volume=t.volume.value;const e=t.events;this._audioMap=new Map;for(const t of e){if(!t.audio)continue;const e=ot(t.audio,async t=>{const e=await fetch(t.source);if(!e.ok)return;const i=await e.arrayBuffer(),s=this._getAudioContext(),n=await s.decodeAudioData(i);this._audioMap.set(t.source,n)});e instanceof Promise?await e:await Promise.allSettled(e)}}async mute(){this._container.muted||await this.toggleMute()}async start(){const t=this._container,e=t.actualOptions,i=e.sounds;if(!i?.enable||!t.canvas.element)return;t.muted=!0;const s=t.canvas.element,n={top:s.offsetTop,right:s.offsetLeft+s.offsetWidth},{mute:a,unmute:o,volumeDown:r,volumeUp:l}=i.icons,c=async()=>{await this.toggleMute()},h=i.icons.enable?$s.Block:$s.None;this._muteImg=Ns({container:t,options:e,pos:n,display:h,iconOptions:a,margin:10,rightOffsets:[r.width,l.width],clickCb:c}),this._unmuteImg=Ns({container:t,options:e,pos:n,display:$s.None,iconOptions:o,margin:10,rightOffsets:[r.width,l.width],clickCb:c}),this._volumeDownImg=Ns({container:t,options:e,pos:n,display:h,iconOptions:r,margin:10,rightOffsets:[l.width],clickCb:async()=>{await this.volumeDown()}}),this._volumeUpImg=Ns({container:t,options:e,pos:n,display:h,iconOptions:l,margin:10,rightOffsets:[],clickCb:async()=>{await this.volumeUp()}}),!ps()&&i.autoPlay&&await this.unmute()}stop(){this._container.muted=!0,(async()=>{await this._mute(),js(this._muteImg),js(this._unmuteImg),js(this._volumeDownImg),js(this._volumeUpImg)})()}async toggleMute(){const t=this._container;t.muted=!t.muted,this._updateMuteIcons(),await this._updateMuteStatus()}async unmute(){this._container.muted&&await this.toggleMute()}async volumeDown(){const t=this._container,e=t.actualOptions.sounds;e?.enable&&(t.muted&&(this._volume=0),this._volume-=e.volume.step,await this._updateVolume())}async volumeUp(){const t=this._container.actualOptions.sounds;t?.enable&&(this._volume+=t.volume.step,await this._updateVolume())}_addBuffer=t=>{const e=t.createBufferSource();return this._audioSources.push(e),e};_addOscillator=t=>{const e=t.createOscillator();return this._audioSources.push(e),e};_getAudioContext(){const t=this._container;return t.audioContext??=new AudioContext,t.audioContext}_initEvents=()=>{const t=this._container,e=t.actualOptions.sounds;if(e?.enable&&t.canvas.element)for(const t of e.events){const e=i=>{i&&(async()=>{const s=t.filter&&!t.filter(i);if(this._container!==i.container)return;if(this._container.muted||this._container.destroyed)return void ot(t.event,t=>{this._engine.removeEventListener(t,e)});if(s)return;if(t.audio){const e=rt(t.audio);if(!e)return;this._playBuffer(e)}else if(t.melodies){const e=it(t.melodies);if(!e)return;e.melodies.length?await Promise.allSettled(e.melodies.map(t=>this._playNote(t.notes,0,e.loop))):await this._playNote(e.notes,0,e.loop)}else if(t.notes){const e=it(t.notes);if(!e)return;await this._playNote([e],0,!1)}})()};ot(t.event,t=>{this._engine.addEventListener(t,e)})}};_mute=async()=>{const t=this._container,e=this._getAudioContext();for(const t of this._audioSources)this._removeAudioSource(t);this._gain&&this._gain.disconnect(),await e.close(),t.audioContext=void 0,this._container.dispatchEvent(Ws.mute)};_playBuffer=t=>{const e=this._audioMap.get(t.source);if(!e)return;const i=this._container.audioContext;if(!i)return;const s=this._addBuffer(i);s.loop=t.loop,s.buffer=e,s.connect(this._gain??i.destination),s.start()};_playFrequency=async(t,e)=>{if(!this._gain||this._container.muted)return;const i=this._getAudioContext(),s=this._addOscillator(i);return s.connect(this._gain),s.type="sine",s.frequency.value=t,s.start(),new Promise(t=>{setTimeout(()=>{this._removeAudioSource(s),t()},e)})};_playMuteSound=()=>{if(this._container.muted)return;const t=this._getAudioContext(),e=t.createGain();e.connect(t.destination),e.gain.value=0;const i=t.createOscillator();i.connect(e),i.type="sine",i.frequency.value=1,i.start(),setTimeout(()=>{i.stop(),i.disconnect(),e.disconnect()})};_playNote=async(t,e,i)=>{if(this._container.muted)return;const s=t[e];if(!s)return;const n=ot(s.value,async(i,s)=>this._playNoteValue(t,e,s));await(k(n)?Promise.allSettled(n):n);let a=e+1;i&&a>=t.length&&(a%=t.length),await this._playNote(t,a,i)};_playNoteValue=async(t,e,i)=>{const s=t[e];if(!s)return;const n=rt(s.value,i,!0);if(n)try{const t=ds(n);if(!C(t))return;await this._playFrequency(t,s.duration)}catch(t){bt().error(t)}};_removeAudioSource=t=>{t.stop(),t.disconnect();this._audioSources.splice(this._audioSources.indexOf(t),1)};_unmute=()=>{const t=this._container.actualOptions.sounds;if(!t)return;const e=this._getAudioContext(),s=e.createGain();s.connect(e.destination),s.gain.value=t.volume.value/i,this._gain=s,this._initEvents(),this._container.dispatchEvent(Ws.unmute)};_updateMuteIcons=()=>{const t=this._container,e=t.actualOptions.sounds;if(!e?.enable||!e.icons.enable)return;const i=this._muteImg,s=this._unmuteImg;i&&(i.style.display=t.muted?"block":"none"),s&&(s.style.display=t.muted?"none":"block")};_updateMuteStatus=async()=>{const t=this._container,e=this._getAudioContext();t.muted?(await e.suspend(),await this._mute()):(await e.resume(),this._unmute(),this._playMuteSound())};_updateVolume=async()=>{const t=this._container,e=t.actualOptions.sounds;if(!e?.enable)return;T(this._volume,e.volume.min,e.volume.max);let s=!1;this._volume<=0&&!t.muted?(this._volume=0,t.muted=!0,s=!0):this._volume>0&&t.muted&&(t.muted=!1,s=!0),s&&(this._updateMuteIcons(),await this._updateMuteStatus()),this._gain?.gain&&(this._gain.gain.value=this._volume/i)}}});function Hs(t,e,i,s){(t.paint??=new ae).fill={color:Bt.create(void 0,{value:e}),enable:s,opacity:i}}function Qs(t,e,i,s){(t.paint??=new ae).stroke={color:Bt.create(void 0,{value:e}),opacity:i,width:s}}var Xs=Object.freeze({__proto__:null,EmitterInstance:class{fill;name;options;position;size;spawnFillColor;spawnFillEnabled;spawnFillOpacity;spawnStrokeColor;spawnStrokeOpacity;spawnStrokeWidth;_container;_currentDuration;_currentEmitDelay;_currentSpawnDelay;_duration;_emitDelay;_firstSpawn;_immortal;_initialPosition;_lifeCount;_mutationObserver;_particlesOptions;_paused;_pluginManager;_removeCallback;_resizeObserver;_shape;_size;_spawnDelay;_startParticlesAdded;constructor(t,e,i,s,a){this._pluginManager=t,this._container=e,this._removeCallback=i,this._currentDuration=0,this._currentEmitDelay=0,this._currentSpawnDelay=0,this._initialPosition=a,s instanceof Ri?this.options=s:(this.options=new Ri,this.options.load(s)),this._spawnDelay=e.retina.reduceFactor?U(this.options.life.delay??0)*n/e.retina.reduceFactor:1/0,this.position=this._initialPosition??this._calcPosition(),this.name=this.options.name,this.fill=this.options.fill,this._firstSpawn=!this.options.life.wait,this._startParticlesAdded=!1;const o=at({},this.options.particles);if(o.move??={},o.move.direction??=this.options.direction,this.options.spawn.fill?.color&&(this.spawnFillColor=Me(this._pluginManager,this.options.spawn.fill.color)),this.options.spawn.stroke?.color&&(this.spawnStrokeColor=Me(this._pluginManager,this.options.spawn.stroke.color)),this._paused=!this.options.autoPlay,this._particlesOptions=o,this._size=this._calcSize(),this.size=dt(this._size,this._container.canvas.size),this._lifeCount=this.options.life.count??-1,this._immortal=this._lifeCount<=0,this.options.domId){const t=tt().getElementById(this.options.domId);t&&(this._mutationObserver=new MutationObserver(()=>{this.resize()}),this._resizeObserver=new ResizeObserver(()=>{this.resize()}),this._mutationObserver.observe(t,{attributes:!0,attributeFilter:["style","width","height"]}),this._resizeObserver.observe(t))}const r=this.options.shape,l=this._pluginManager.emitterShapeManager?.getShapeGenerator(r.type);l&&(this._shape=l.generate(this._container,this.position,this.size,this.fill,r.options)),this._container.dispatchEvent("emitterCreated",{emitter:this}),this.play()}externalPause(){this._paused=!0,this.pause()}externalPlay(){this._paused=!1,this.play()}async init(){await(this._shape?.init())}pause(){this._paused||delete this._emitDelay}play(){if(this._paused)return;if(!(this._lifeCount>0||this._immortal)&&this.options.life.count||!(this._firstSpawn||this._currentSpawnDelay>=(this._spawnDelay??0)))return;const t=this._container;if(void 0===this._emitDelay){const e=U(this.options.rate.delay);this._emitDelay=t.retina.reduceFactor?e*n/t.retina.reduceFactor:1/0}(this._lifeCount>0||this._immortal)&&this._prepareToDie()}resize(){const t=this._initialPosition,e=this._container;this.position=t&&st(t,e.canvas.size,P.origin)?t:this._calcPosition(),this._size=this._calcSize(),this.size=dt(this._size,e.canvas.size),this._shape?.resize(this.position,this.size)}update(t){if(this._paused)return;const e=this._container;this._firstSpawn&&(this._firstSpawn=!1,this._currentSpawnDelay=this._spawnDelay??0,this._currentEmitDelay=this._emitDelay??0),this._startParticlesAdded||(this._startParticlesAdded=!0,this._emitParticles(this.options.startCount)),void 0!==this._duration&&(this._currentDuration+=t.value,this._currentDuration>=this._duration&&(this.pause(),void 0!==this._spawnDelay&&delete this._spawnDelay,this._immortal||this._lifeCount--,this._lifeCount>0||this._immortal?(this.position=this._calcPosition(),this._shape?.resize(this.position,this.size),this._spawnDelay=e.retina.reduceFactor?U(this.options.life.delay??0)*n/e.retina.reduceFactor:1/0):this._destroy(),this._currentDuration-=this._duration,delete this._duration)),void 0!==this._spawnDelay&&(this._currentSpawnDelay+=t.value,this._currentSpawnDelay>=this._spawnDelay&&(this._container.dispatchEvent("emitterPlay"),this.play(),this._currentSpawnDelay-=this._spawnDelay,delete this._spawnDelay)),void 0!==this._emitDelay&&(this._currentEmitDelay+=t.value,this._currentEmitDelay>=this._emitDelay&&(this._emit(),this._currentEmitDelay-=this._emitDelay))}_calcPosition(){const t=this._container;if(this.options.domId){const e=tt().getElementById(this.options.domId);if(e){const i=e.getBoundingClientRect(),n=t.retina.pixelRatio;return{x:(i.x+i.width*s)*n,y:(i.y+i.height*s)*n}}}return N({size:t.canvas.size,position:this.options.position})}_calcSize(){const t=this._container;if(this.options.domId){const e=tt().getElementById(this.options.domId);if(e){const i=e.getBoundingClientRect();return{width:i.width*t.retina.pixelRatio,height:i.height*t.retina.pixelRatio,mode:J.precise}}}return this.options.size??(()=>{const t=new Ii;return t.load({height:0,mode:J.percent,width:0}),t})()}_destroy=()=>{this._mutationObserver?.disconnect(),this._mutationObserver=void 0,this._resizeObserver?.disconnect(),this._resizeObserver=void 0,this._removeCallback(this),this._container.dispatchEvent("emitterDestroyed",{emitter:this})};_emit(){if(this._paused)return;const t=U(this.options.rate.quantity);this._emitParticles(t)}_emitParticles(t){const e=rt(this._particlesOptions)??{},i=this.options.spawn.fill?.color?.animation,s=this.options.spawn.fill?.enable??!!this.options.spawn.fill?.color,n=void 0===this.options.spawn.fill?.opacity?1:U(this.options.spawn.fill.opacity),a=this.options.spawn.stroke?.color?.animation,o=void 0===this.options.spawn.stroke?.opacity?1:U(this.options.spawn.stroke.opacity),r=void 0===this.options.spawn.stroke?.width?1:U(this.options.spawn.stroke.width),l=this._container.retina.reduceFactor,c=!!i,h=!!a,d=!!this._shape,u=c||h,p=u||d,f=u?{h:m,s:_,l:y}:null,g=this.options.shape;for(let c=0;c<t*l;c++){const t=p?at({},e):e;this.spawnFillOpacity=n,this.spawnFillEnabled=s,this.spawnStrokeOpacity=o,this.spawnStrokeWidth=r,this.spawnFillColor&&(i&&f&&(this.spawnFillColor.h=this._setColorAnimation(i.h,this.spawnFillColor.h,f.h,3.6),this.spawnFillColor.s=this._setColorAnimation(i.s,this.spawnFillColor.s,f.s),this.spawnFillColor.l=this._setColorAnimation(i.l,this.spawnFillColor.l,f.l)),Hs(t,this.spawnFillColor,this.spawnFillOpacity,this.spawnFillEnabled)),this.spawnStrokeColor&&(a&&f&&(this.spawnStrokeColor.h=this._setColorAnimation(a.h,this.spawnStrokeColor.h,f.h,3.6),this.spawnStrokeColor.s=this._setColorAnimation(a.s,this.spawnStrokeColor.s,f.s),this.spawnStrokeColor.l=this._setColorAnimation(a.l,this.spawnStrokeColor.l,f.l)),Qs(t,this.spawnStrokeColor,this.spawnStrokeOpacity,this.spawnStrokeWidth));let l=this.position;if(this._shape){const e=this._shape.randomPosition();if(e){l=e.position;const i=g.replace;i.color&&e.color&&Hs(t,e.color,i.opacity?e.opacity??1:1,!0)}else l=null}l&&this._container.particles.addParticle(l,t)}}_prepareToDie=()=>{if(this._paused)return;const t=void 0!==this.options.life.duration?U(this.options.life.duration):void 0;(this._lifeCount>0||this._immortal)&&void 0!==t&&t>0&&(this._duration=t*n)};_setColorAnimation=(t,e,i,s=1)=>{const a=this._container;if(!t.enable)return e;const o=A(t.offset),r=U(this.options.rate.delay),l=a.retina.reduceFactor?r*n/a.retina.reduceFactor:1/0;return(e+U(t.speed)*a.fpsLimit/l+o*s)%i}}});t.loadFireworksPreset=bs,t.tsParticles=Te}),Object.assign(globalThis.window||globalThis,{loadFireworksPreset:(globalThis.__tsParticlesInternals.presets.fireworks||{}).loadFireworksPreset}),delete(globalThis.window||globalThis).tsparticlesInternalExports;
@@ -1,5 +1,5 @@
1
1
  (function(g){g.__tsParticlesInternals=g.__tsParticlesInternals||{};g.__tsParticlesInternals.bundles=g.__tsParticlesInternals.bundles||{};g.__tsParticlesInternals.effects=g.__tsParticlesInternals.effects||{};g.__tsParticlesInternals.engine=g.__tsParticlesInternals.engine||{};g.__tsParticlesInternals.interactions=g.__tsParticlesInternals.interactions||{};g.__tsParticlesInternals.palettes=g.__tsParticlesInternals.palettes||{};g.__tsParticlesInternals.paths=g.__tsParticlesInternals.paths||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins.emittersShapes=g.__tsParticlesInternals.plugins.emittersShapes||{};g.__tsParticlesInternals.presets=g.__tsParticlesInternals.presets||{};g.__tsParticlesInternals.shapes=g.__tsParticlesInternals.shapes||{};g.__tsParticlesInternals.updaters=g.__tsParticlesInternals.updaters||{};g.__tsParticlesInternals.utils=g.__tsParticlesInternals.utils||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas.utils=g.__tsParticlesInternals.canvas.utils||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path.utils=g.__tsParticlesInternals.path.utils||{};var __tsProxyFactory=typeof Proxy!=="undefined"?function(obj){return new Proxy(obj,{get:function(target,key){if(!(key in target)){target[key]={};}return target[key];}});}:function(obj){return obj;};g.__tsParticlesInternals.bundles=__tsProxyFactory(g.__tsParticlesInternals.bundles);g.__tsParticlesInternals.effects=__tsProxyFactory(g.__tsParticlesInternals.effects);g.__tsParticlesInternals.interactions=__tsProxyFactory(g.__tsParticlesInternals.interactions);g.__tsParticlesInternals.palettes=__tsProxyFactory(g.__tsParticlesInternals.palettes);g.__tsParticlesInternals.paths=__tsProxyFactory(g.__tsParticlesInternals.paths);g.__tsParticlesInternals.plugins=__tsProxyFactory(g.__tsParticlesInternals.plugins);g.__tsParticlesInternals.plugins.emittersShapes=__tsProxyFactory(g.__tsParticlesInternals.plugins.emittersShapes);g.__tsParticlesInternals.presets=__tsProxyFactory(g.__tsParticlesInternals.presets);g.__tsParticlesInternals.shapes=__tsProxyFactory(g.__tsParticlesInternals.shapes);g.__tsParticlesInternals.updaters=__tsProxyFactory(g.__tsParticlesInternals.updaters);g.__tsParticlesInternals.utils=__tsProxyFactory(g.__tsParticlesInternals.utils);g.__tsParticlesInternals.canvas=__tsProxyFactory(g.__tsParticlesInternals.canvas);g.__tsParticlesInternals.path=__tsProxyFactory(g.__tsParticlesInternals.path);g.tsparticlesInternalExports=g.tsparticlesInternalExports||{};})(typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:this);
2
- /* Preset v4.0.0-beta.15 */
2
+ /* Preset v4.0.0-beta.16 */
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tsparticles/engine'), require('@tsparticles/basic'), require('@tsparticles/updater-destroy'), require('@tsparticles/plugin-emitters/plugin'), require('@tsparticles/plugin-emitters-shape-square'), require('@tsparticles/updater-life'), require('@tsparticles/shape-line'), require('@tsparticles/updater-rotate'), require('@tsparticles/plugin-sounds'), require('@tsparticles/effect-trail')) :
5
5
  typeof define === 'function' && define.amd ? define(['exports', '@tsparticles/engine', '@tsparticles/basic', '@tsparticles/updater-destroy', '@tsparticles/plugin-emitters/plugin', '@tsparticles/plugin-emitters-shape-square', '@tsparticles/updater-life', '@tsparticles/shape-line', '@tsparticles/updater-rotate', '@tsparticles/plugin-sounds', '@tsparticles/effect-trail'], factory) :