tsparticles 1.38.0 → 1.39.3

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.
Files changed (1513) hide show
  1. package/Core/Canvas.d.ts +1 -1
  2. package/Core/Canvas.js +13 -13
  3. package/Core/Container.d.ts +5 -6
  4. package/Core/Container.js +11 -12
  5. package/Core/Interfaces/Gradients.d.ts +2 -2
  6. package/Core/Interfaces/ICircleBouncer.d.ts +1 -1
  7. package/Core/Interfaces/IContainerPlugin.d.ts +4 -4
  8. package/Core/Interfaces/IExternalInteractor.d.ts +1 -1
  9. package/Core/Interfaces/IInteractor.d.ts +1 -1
  10. package/Core/Interfaces/IMovePathGenerator.d.ts +1 -1
  11. package/Core/Interfaces/IParticle.d.ts +8 -8
  12. package/Core/Interfaces/IParticleGradientAnimation.d.ts +1 -1
  13. package/Core/Interfaces/IParticleSpin.d.ts +1 -1
  14. package/Core/Interfaces/IParticlesInteractor.d.ts +2 -2
  15. package/Core/Interfaces/IPlugin.d.ts +1 -1
  16. package/Core/Interfaces/index.d.ts +3 -1
  17. package/Core/Interfaces/index.js +3 -1
  18. package/Core/Loader.d.ts +1 -1
  19. package/Core/Loader.js +4 -3
  20. package/Core/Particle.d.ts +3 -6
  21. package/Core/Particle.js +41 -43
  22. package/Core/Particles.d.ts +3 -3
  23. package/Core/Particles.js +14 -20
  24. package/{Utils → Core/Utils}/Circle.d.ts +1 -1
  25. package/{Utils → Core/Utils}/Circle.js +2 -2
  26. package/{esm → Core}/Utils/CircleWarp.d.ts +2 -3
  27. package/{Utils → Core/Utils}/CircleWarp.js +1 -1
  28. package/{Utils → Core/Utils}/Constants.d.ts +0 -0
  29. package/{Utils → Core/Utils}/Constants.js +0 -0
  30. package/{Utils → Core/Utils}/EventListeners.d.ts +1 -1
  31. package/{Utils → Core/Utils}/EventListeners.js +10 -11
  32. package/Core/{ExternalInteractorBase.d.ts → Utils/ExternalInteractorBase.d.ts} +4 -4
  33. package/Core/{ExternalInteractorBase.js → Utils/ExternalInteractorBase.js} +1 -2
  34. package/{esm/Core → Core/Utils}/FrameManager.d.ts +1 -1
  35. package/Core/{FrameManager.js → Utils/FrameManager.js} +0 -0
  36. package/{esm/Core → Core/Utils}/InteractionManager.d.ts +5 -5
  37. package/Core/{InteractionManager.js → Utils/InteractionManager.js} +4 -3
  38. package/{esm/Core → Core/Utils}/ParticlesInteractorBase.d.ts +4 -4
  39. package/Core/{ParticlesInteractorBase.js → Utils/ParticlesInteractorBase.js} +1 -2
  40. package/{esm/Core/Particle/Mover.d.ts → Core/Utils/ParticlesMover.d.ts} +2 -2
  41. package/Core/{Particle/Mover.js → Utils/ParticlesMover.js} +6 -7
  42. package/{esm → Core}/Utils/Plugins.d.ts +5 -5
  43. package/{Utils → Core/Utils}/Plugins.js +0 -0
  44. package/{Utils → Core/Utils}/Point.d.ts +2 -2
  45. package/{Utils → Core/Utils}/Point.js +0 -0
  46. package/{Utils → Core/Utils}/QuadTree.d.ts +4 -4
  47. package/{Utils → Core/Utils}/QuadTree.js +3 -3
  48. package/{esm → Core}/Utils/Range.d.ts +1 -1
  49. package/{Utils → Core/Utils}/Range.js +0 -0
  50. package/{esm → Core}/Utils/Rectangle.d.ts +1 -2
  51. package/{Utils → Core/Utils}/Rectangle.js +0 -0
  52. package/Core/{Particle → Utils}/Vector.d.ts +0 -0
  53. package/Core/{Particle → Utils}/Vector.js +0 -0
  54. package/{esm/Core/Particle → Core/Utils}/Vector3d.d.ts +1 -1
  55. package/Core/{Particle → Utils}/Vector3d.js +0 -0
  56. package/Core/Utils/index.d.ts +16 -0
  57. package/Core/Utils/index.js +28 -0
  58. package/Core/index.d.ts +8 -0
  59. package/Core/index.js +20 -0
  60. package/Enums/AnimationStatus.d.ts +1 -1
  61. package/Enums/AnimationStatus.js +0 -6
  62. package/Enums/Directions/MoveDirection.d.ts +1 -1
  63. package/Enums/Directions/MoveDirection.js +0 -13
  64. package/Enums/Directions/OutModeDirection.d.ts +1 -1
  65. package/Enums/Directions/OutModeDirection.js +0 -8
  66. package/Enums/Directions/RotateDirection.d.ts +1 -1
  67. package/Enums/Directions/RotateDirection.js +0 -7
  68. package/Enums/Directions/TiltDirection.d.ts +1 -1
  69. package/Enums/Directions/TiltDirection.js +0 -7
  70. package/Enums/InteractivityDetect.d.ts +1 -1
  71. package/Enums/InteractivityDetect.js +0 -7
  72. package/Enums/Modes/ClickMode.d.ts +1 -1
  73. package/Enums/Modes/ClickMode.js +0 -11
  74. package/Enums/Modes/CollisionMode.d.ts +1 -1
  75. package/Enums/Modes/CollisionMode.js +0 -7
  76. package/Enums/Modes/DestroyMode.d.ts +1 -1
  77. package/Enums/Modes/DestroyMode.js +0 -6
  78. package/Enums/Modes/DivMode.d.ts +1 -1
  79. package/Enums/Modes/DivMode.js +0 -7
  80. package/Enums/Modes/HoverMode.d.ts +1 -1
  81. package/Enums/Modes/HoverMode.js +0 -13
  82. package/Enums/Modes/OutMode.d.ts +1 -1
  83. package/Enums/Modes/OutMode.js +0 -11
  84. package/Enums/Modes/ResponsiveMode.d.ts +1 -1
  85. package/Enums/Modes/ResponsiveMode.js +0 -6
  86. package/Enums/Modes/RollMode.d.ts +1 -1
  87. package/Enums/Modes/RollMode.js +0 -7
  88. package/Enums/Modes/SizeMode.d.ts +1 -1
  89. package/Enums/Modes/SizeMode.js +0 -6
  90. package/Enums/Modes/ThemeMode.d.ts +1 -1
  91. package/Enums/Modes/ThemeMode.js +0 -7
  92. package/Enums/Types/AlterType.d.ts +1 -1
  93. package/Enums/Types/AlterType.js +0 -6
  94. package/Enums/Types/DestroyType.d.ts +1 -1
  95. package/Enums/Types/DestroyType.js +0 -7
  96. package/Enums/Types/DivType.d.ts +1 -1
  97. package/Enums/Types/DivType.js +0 -6
  98. package/Enums/Types/EasingType.d.ts +1 -1
  99. package/Enums/Types/EasingType.js +0 -12
  100. package/Enums/Types/GradientType.d.ts +1 -1
  101. package/Enums/Types/GradientType.js +0 -7
  102. package/Enums/Types/InteractorType.d.ts +1 -1
  103. package/Enums/Types/InteractorType.js +0 -6
  104. package/Enums/Types/OrbitType.d.ts +1 -1
  105. package/Enums/Types/OrbitType.js +0 -6
  106. package/Enums/Types/ShapeType.d.ts +1 -1
  107. package/Enums/Types/ShapeType.js +0 -15
  108. package/Enums/Types/StartValueType.d.ts +1 -1
  109. package/Enums/Types/StartValueType.js +0 -7
  110. package/Interactions/External/Attract/Attractor.d.ts +2 -2
  111. package/Interactions/External/Attract/Attractor.js +9 -11
  112. package/Interactions/External/Attract/index.d.ts +2 -2
  113. package/Interactions/External/Attract/index.js +2 -2
  114. package/Interactions/External/Bounce/Bouncer.d.ts +2 -2
  115. package/Interactions/External/Bounce/Bouncer.js +15 -17
  116. package/Interactions/External/Bounce/index.d.ts +2 -2
  117. package/Interactions/External/Bounce/index.js +2 -2
  118. package/Interactions/External/Bubble/Bubbler.d.ts +3 -3
  119. package/Interactions/External/Bubble/Bubbler.js +20 -22
  120. package/Interactions/External/Bubble/ProcessBubbleType.d.ts +1 -1
  121. package/Interactions/External/Bubble/ProcessBubbleType.js +0 -7
  122. package/Interactions/External/Bubble/index.d.ts +2 -2
  123. package/Interactions/External/Bubble/index.js +2 -2
  124. package/Interactions/External/Connect/Connector.d.ts +2 -2
  125. package/Interactions/External/Connect/Connector.js +3 -4
  126. package/Interactions/External/Connect/index.d.ts +2 -2
  127. package/Interactions/External/Connect/index.js +2 -2
  128. package/Interactions/External/Grab/Grabber.d.ts +2 -2
  129. package/Interactions/External/Grab/Grabber.js +4 -5
  130. package/Interactions/External/Grab/index.d.ts +2 -2
  131. package/Interactions/External/Grab/index.js +2 -2
  132. package/Interactions/External/Repulse/Repulser.d.ts +2 -2
  133. package/Interactions/External/Repulse/Repulser.js +15 -17
  134. package/Interactions/External/Repulse/index.d.ts +2 -2
  135. package/Interactions/External/Repulse/index.js +2 -2
  136. package/Interactions/External/Trail/TrailMaker.d.ts +2 -3
  137. package/Interactions/External/Trail/TrailMaker.js +4 -5
  138. package/Interactions/External/Trail/index.d.ts +2 -2
  139. package/Interactions/External/Trail/index.js +2 -2
  140. package/Interactions/Particles/Attract/Attractor.d.ts +2 -4
  141. package/Interactions/Particles/Attract/Attractor.js +2 -2
  142. package/Interactions/Particles/Attract/index.d.ts +2 -2
  143. package/Interactions/Particles/Attract/index.js +2 -2
  144. package/Interactions/Particles/Collisions/Collider.d.ts +2 -3
  145. package/Interactions/Particles/Collisions/Collider.js +5 -6
  146. package/Interactions/Particles/Collisions/index.d.ts +2 -2
  147. package/Interactions/Particles/Collisions/index.js +2 -2
  148. package/Interactions/Particles/Links/LinkInstance.d.ts +1 -3
  149. package/Interactions/Particles/Links/LinkParticle.d.ts +1 -1
  150. package/Interactions/Particles/Links/Linker.d.ts +3 -4
  151. package/Interactions/Particles/Links/Linker.js +4 -4
  152. package/Interactions/Particles/Links/index.d.ts +2 -3
  153. package/Interactions/Particles/Links/index.js +5 -9
  154. package/Interactions/Particles/Links/interaction.d.ts +2 -0
  155. package/Interactions/Particles/Links/interaction.js +8 -0
  156. package/Interactions/Particles/Links/plugin.d.ts +2 -2
  157. package/Interactions/Particles/Links/plugin.js +4 -4
  158. package/Options/Classes/AnimatableColor.d.ts +3 -3
  159. package/Options/Classes/AnimatableColor.js +1 -1
  160. package/Options/Classes/AnimatableGradient.d.ts +6 -6
  161. package/Options/Classes/AnimatableGradient.js +3 -4
  162. package/Options/Classes/AnimationOptions.d.ts +2 -2
  163. package/Options/Classes/Background/Background.d.ts +2 -2
  164. package/Options/Classes/BackgroundMask/BackgroundMask.d.ts +2 -2
  165. package/Options/Classes/BackgroundMask/BackgroundMaskCover.d.ts +2 -2
  166. package/Options/Classes/ColorAnimation.d.ts +1 -1
  167. package/Options/Classes/HslAnimation.d.ts +2 -2
  168. package/Options/Classes/Interactivity/Events/ClickEvent.d.ts +2 -2
  169. package/Options/Classes/Interactivity/Events/DivEvent.d.ts +1 -1
  170. package/Options/Classes/Interactivity/Events/DivEvent.js +1 -2
  171. package/Options/Classes/Interactivity/Events/Events.d.ts +2 -2
  172. package/Options/Classes/Interactivity/Events/HoverEvent.d.ts +3 -3
  173. package/Options/Classes/Interactivity/Events/Parallax.d.ts +1 -1
  174. package/Options/Classes/Interactivity/Interactivity.d.ts +2 -2
  175. package/Options/Classes/Interactivity/Interactivity.js +5 -6
  176. package/Options/Classes/Interactivity/Modes/Attract.d.ts +2 -2
  177. package/Options/Classes/Interactivity/Modes/Attract.js +1 -2
  178. package/Options/Classes/Interactivity/Modes/Bubble.d.ts +2 -2
  179. package/Options/Classes/Interactivity/Modes/Bubble.js +1 -1
  180. package/Options/Classes/Interactivity/Modes/BubbleBase.d.ts +1 -1
  181. package/Options/Classes/Interactivity/Modes/BubbleDiv.d.ts +1 -1
  182. package/Options/Classes/Interactivity/Modes/Connect.d.ts +2 -2
  183. package/Options/Classes/Interactivity/Modes/ConnectLinks.d.ts +1 -1
  184. package/Options/Classes/Interactivity/Modes/Grab.d.ts +2 -2
  185. package/Options/Classes/Interactivity/Modes/GrabLinks.d.ts +2 -2
  186. package/Options/Classes/Interactivity/Modes/Light.d.ts +1 -1
  187. package/Options/Classes/Interactivity/Modes/Modes.d.ts +7 -7
  188. package/Options/Classes/Interactivity/Modes/Modes.js +4 -4
  189. package/Options/Classes/Interactivity/Modes/Push.d.ts +1 -1
  190. package/Options/Classes/Interactivity/Modes/Remove.d.ts +1 -1
  191. package/Options/Classes/Interactivity/Modes/Repulse.d.ts +3 -3
  192. package/Options/Classes/Interactivity/Modes/Repulse.js +1 -1
  193. package/Options/Classes/Interactivity/Modes/RepulseBase.d.ts +2 -2
  194. package/Options/Classes/Interactivity/Modes/RepulseBase.js +1 -2
  195. package/Options/Classes/Interactivity/Modes/RepulseDiv.d.ts +1 -1
  196. package/Options/Classes/Interactivity/Modes/Slow.d.ts +1 -1
  197. package/Options/Classes/Interactivity/Modes/Trail.d.ts +2 -2
  198. package/Options/Classes/ManualParticle.d.ts +2 -2
  199. package/Options/Classes/Motion/Motion.d.ts +1 -1
  200. package/Options/Classes/Options.d.ts +7 -7
  201. package/Options/Classes/Options.js +15 -15
  202. package/Options/Classes/OptionsColor.d.ts +2 -2
  203. package/Options/Classes/Particles/Bounce/Bounce.d.ts +1 -1
  204. package/Options/Classes/Particles/Collisions/Collisions.d.ts +4 -4
  205. package/Options/Classes/Particles/Collisions/Collisions.js +1 -2
  206. package/Options/Classes/Particles/Collisions/CollisionsOverlap.d.ts +2 -2
  207. package/Options/Classes/Particles/Destroy/Destroy.d.ts +1 -1
  208. package/Options/Classes/Particles/Destroy/Destroy.js +1 -2
  209. package/Options/Classes/Particles/Destroy/Split.d.ts +3 -3
  210. package/Options/Classes/Particles/Life/Life.d.ts +1 -1
  211. package/Options/Classes/Particles/Links/Links.d.ts +2 -2
  212. package/Options/Classes/Particles/Links/LinksShadow.d.ts +2 -2
  213. package/Options/Classes/Particles/Links/LinksTriangle.d.ts +1 -1
  214. package/Options/Classes/Particles/Move/Attract.d.ts +2 -2
  215. package/Options/Classes/Particles/Move/Move.d.ts +5 -5
  216. package/Options/Classes/Particles/Move/Move.js +4 -5
  217. package/Options/Classes/Particles/Move/OutModes.d.ts +2 -2
  218. package/Options/Classes/Particles/Move/OutModes.js +1 -2
  219. package/Options/Classes/Particles/Move/Path/Path.d.ts +3 -3
  220. package/Options/Classes/Particles/Move/Spin.d.ts +3 -3
  221. package/Options/Classes/Particles/Move/Trail.d.ts +2 -2
  222. package/Options/Classes/Particles/Number/Density.d.ts +1 -1
  223. package/Options/Classes/Particles/Number/ParticlesNumber.d.ts +2 -2
  224. package/Options/Classes/Particles/Opacity/Opacity.d.ts +1 -1
  225. package/Options/Classes/Particles/Opacity/OpacityAnimation.d.ts +3 -3
  226. package/Options/Classes/Particles/Opacity/OpacityAnimation.js +2 -3
  227. package/Options/Classes/Particles/Orbit/Orbit.d.ts +5 -5
  228. package/Options/Classes/Particles/Orbit/Orbit.js +2 -2
  229. package/Options/Classes/Particles/Orbit/OrbitRotation.d.ts +1 -1
  230. package/Options/Classes/Particles/ParticlesOptions.d.ts +16 -16
  231. package/Options/Classes/Particles/ParticlesOptions.js +13 -13
  232. package/Options/Classes/Particles/Repulse/Repulse.d.ts +1 -1
  233. package/Options/Classes/Particles/Roll/Roll.d.ts +2 -2
  234. package/Options/Classes/Particles/Roll/Roll.js +1 -2
  235. package/Options/Classes/Particles/Roll/RollLight.d.ts +1 -1
  236. package/Options/Classes/Particles/Rotate/Rotate.d.ts +3 -3
  237. package/Options/Classes/Particles/Rotate/Rotate.js +1 -2
  238. package/Options/Classes/Particles/Rotate/RotateAnimation.d.ts +1 -1
  239. package/Options/Classes/Particles/Shadow.d.ts +3 -3
  240. package/Options/Classes/Particles/Shape/Shape.d.ts +5 -5
  241. package/Options/Classes/Particles/Shape/Shape.js +13 -14
  242. package/Options/Classes/Particles/Size/Size.d.ts +2 -2
  243. package/Options/Classes/Particles/Size/SizeAnimation.d.ts +3 -3
  244. package/Options/Classes/Particles/Size/SizeAnimation.js +2 -3
  245. package/Options/Classes/Particles/Stroke.d.ts +2 -2
  246. package/Options/Classes/Particles/Tilt/Tilt.d.ts +3 -3
  247. package/Options/Classes/Particles/Tilt/Tilt.js +1 -2
  248. package/Options/Classes/Particles/Tilt/TiltAnimation.d.ts +1 -1
  249. package/Options/Classes/Particles/Twinkle/Twinkle.d.ts +1 -1
  250. package/Options/Classes/Particles/Twinkle/TwinkleValues.d.ts +2 -2
  251. package/Options/Classes/Particles/Wobble/Wobble.d.ts +2 -2
  252. package/Options/Classes/Particles/ZIndex/ZIndex.d.ts +1 -1
  253. package/Options/Classes/Random.d.ts +1 -1
  254. package/Options/Classes/Responsive.d.ts +2 -2
  255. package/Options/Classes/Responsive.js +4 -5
  256. package/Options/Classes/Theme/Theme.d.ts +2 -2
  257. package/Options/Classes/Theme/Theme.js +1 -1
  258. package/Options/Classes/Theme/ThemeDefault.d.ts +2 -2
  259. package/Options/Classes/Theme/ThemeDefault.js +1 -2
  260. package/Options/Classes/ValueWithRandom.d.ts +2 -2
  261. package/Options/Interfaces/BackgroundMask/IBackgroundMask.d.ts +1 -1
  262. package/Options/Interfaces/IAnimatableColor.d.ts +1 -1
  263. package/Options/Interfaces/IAnimatableGradient.d.ts +1 -1
  264. package/Options/Interfaces/IColorAnimation.d.ts +1 -1
  265. package/Options/Interfaces/IManualParticle.d.ts +1 -1
  266. package/Options/Interfaces/IOptions.d.ts +6 -6
  267. package/Options/Interfaces/IOptionsGradient.d.ts +2 -2
  268. package/Options/Interfaces/IResponsive.d.ts +2 -2
  269. package/Options/Interfaces/IValueWithRandom.d.ts +1 -1
  270. package/Options/Interfaces/Interactivity/Events/IEvents.d.ts +1 -1
  271. package/Options/Interfaces/Interactivity/IInteractivity.d.ts +1 -1
  272. package/Options/Interfaces/Interactivity/Modes/IBubble.d.ts +2 -2
  273. package/Options/Interfaces/Interactivity/Modes/IBubbleBase.d.ts +1 -1
  274. package/Options/Interfaces/Interactivity/Modes/IModes.d.ts +2 -2
  275. package/Options/Interfaces/Interactivity/Modes/IRepulse.d.ts +2 -2
  276. package/Options/Interfaces/Interactivity/Modes/IRepulseDiv.d.ts +1 -1
  277. package/Options/Interfaces/Particles/Destroy/ISplit.d.ts +1 -1
  278. package/Options/Interfaces/Particles/IParticles.d.ts +14 -14
  279. package/Options/Interfaces/Particles/IShadow.d.ts +1 -1
  280. package/Options/Interfaces/Particles/IStroke.d.ts +1 -1
  281. package/Options/Interfaces/Particles/Links/ILinks.d.ts +1 -1
  282. package/Options/Interfaces/Particles/Move/IMove.d.ts +5 -5
  283. package/Options/Interfaces/Particles/Move/Path/{iPath.d.ts → IPath.d.ts} +0 -0
  284. package/Options/Interfaces/Particles/Move/Path/{iPath.js → IPath.js} +0 -0
  285. package/Options/Interfaces/Particles/Orbit/IOrbit.d.ts +3 -3
  286. package/Options/Interfaces/Particles/Roll/IRoll.d.ts +1 -1
  287. package/Options/Interfaces/Particles/Rotate/IRotate.d.ts +1 -1
  288. package/Options/Interfaces/Particles/Shape/IShape.d.ts +3 -3
  289. package/Options/Interfaces/Particles/Tilt/ITilt.d.ts +1 -1
  290. package/Options/Interfaces/Theme/ITheme.d.ts +2 -2
  291. package/Plugins/Absorbers/AbsorberContainer.d.ts +1 -1
  292. package/Plugins/Absorbers/AbsorberInstance.d.ts +6 -7
  293. package/Plugins/Absorbers/AbsorberInstance.js +27 -28
  294. package/Plugins/Absorbers/Absorbers.d.ts +4 -7
  295. package/Plugins/Absorbers/Absorbers.js +2 -3
  296. package/Plugins/Absorbers/Enums/AbsorberClickMode.d.ts +1 -1
  297. package/Plugins/Absorbers/Enums/AbsorberClickMode.js +0 -5
  298. package/Plugins/Absorbers/Options/Classes/Absorber.d.ts +4 -4
  299. package/Plugins/Absorbers/Options/Classes/AbsorberSize.d.ts +2 -2
  300. package/Plugins/Absorbers/Options/Classes/AbsorberSize.js +1 -1
  301. package/Plugins/Absorbers/Options/Classes/AbsorberSizeLimit.d.ts +2 -2
  302. package/Plugins/Absorbers/Options/Interfaces/IAbsorber.d.ts +1 -2
  303. package/Plugins/Absorbers/Options/Interfaces/IAbsorberOptions.d.ts +1 -1
  304. package/Plugins/Absorbers/Options/Interfaces/IAbsorberSize.d.ts +1 -1
  305. package/Plugins/Absorbers/index.d.ts +2 -0
  306. package/Plugins/Absorbers/{plugin.js → index.js} +6 -7
  307. package/Plugins/Emitters/EmitterContainer.d.ts +2 -1
  308. package/Plugins/Emitters/EmitterInstance.d.ts +6 -5
  309. package/Plugins/Emitters/EmitterInstance.js +37 -39
  310. package/Plugins/Emitters/Emitters.d.ts +4 -5
  311. package/Plugins/Emitters/Emitters.js +12 -5
  312. package/Plugins/Emitters/EmittersMain.d.ts +2 -2
  313. package/Plugins/Emitters/Enums/EmitterClickMode.d.ts +1 -1
  314. package/Plugins/Emitters/Enums/EmitterClickMode.js +0 -5
  315. package/Plugins/Emitters/Enums/EmitterShapeType.d.ts +1 -1
  316. package/Plugins/Emitters/Enums/EmitterShapeType.js +0 -6
  317. package/Plugins/Emitters/IEmitterShape.d.ts +1 -1
  318. package/Plugins/Emitters/Options/Classes/Emitter.d.ts +7 -7
  319. package/Plugins/Emitters/Options/Classes/Emitter.js +4 -5
  320. package/Plugins/Emitters/Options/Classes/EmitterLife.d.ts +1 -1
  321. package/Plugins/Emitters/Options/Classes/EmitterRate.d.ts +1 -1
  322. package/Plugins/Emitters/Options/Classes/EmitterSize.d.ts +1 -1
  323. package/Plugins/Emitters/Options/Classes/EmitterSize.js +1 -2
  324. package/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +6 -6
  325. package/Plugins/Emitters/Options/Interfaces/IEmitterOptions.d.ts +1 -1
  326. package/Plugins/Emitters/Options/Interfaces/IEmitterSize.d.ts +1 -1
  327. package/Plugins/Emitters/Shapes/Circle/CircleShape.d.ts +1 -1
  328. package/Plugins/Emitters/Shapes/Square/SquareShape.d.ts +1 -1
  329. package/Plugins/Emitters/index.d.ts +3 -0
  330. package/Plugins/Emitters/{plugin.js → index.js} +10 -11
  331. package/Plugins/PolygonMask/Enums/PolygonMaskInlineArrangement.d.ts +8 -0
  332. package/Plugins/PolygonMask/{Options/Interfaces/IDraw.js → Enums/PolygonMaskInlineArrangement.js} +0 -0
  333. package/Plugins/PolygonMask/Enums/PolygonMaskMoveType.d.ts +4 -0
  334. package/Plugins/PolygonMask/{Options/Interfaces/IDrawStroke.js → Enums/PolygonMaskMoveType.js} +0 -0
  335. package/{esm/Plugins/PolygonMask/Enums/Type.d.ts → Plugins/PolygonMask/Enums/PolygonMaskType.d.ts} +1 -1
  336. package/Plugins/PolygonMask/{Options/Interfaces/IInline.js → Enums/PolygonMaskType.js} +0 -0
  337. package/Plugins/PolygonMask/Enums/index.d.ts +3 -3
  338. package/Plugins/PolygonMask/Enums/index.js +3 -3
  339. package/Plugins/PolygonMask/Options/Classes/PolygonMask.d.ts +14 -14
  340. package/Plugins/PolygonMask/Options/Classes/PolygonMask.js +42 -42
  341. package/Plugins/PolygonMask/Options/Classes/{Draw.d.ts → PolygonMaskDraw.d.ts} +7 -7
  342. package/Plugins/PolygonMask/Options/Classes/{Draw.js → PolygonMaskDraw.js} +15 -14
  343. package/Plugins/PolygonMask/Options/Classes/{DrawStroke.d.ts → PolygonMaskDrawStroke.d.ts} +5 -5
  344. package/Plugins/PolygonMask/Options/Classes/PolygonMaskDrawStroke.js +29 -0
  345. package/Plugins/PolygonMask/Options/Classes/PolygonMaskInline.d.ts +9 -0
  346. package/Plugins/PolygonMask/Options/Classes/PolygonMaskInline.js +17 -0
  347. package/Plugins/PolygonMask/Options/Classes/PolygonMaskLocalSvg.d.ts +11 -0
  348. package/Plugins/PolygonMask/Options/Classes/PolygonMaskLocalSvg.js +29 -0
  349. package/Plugins/PolygonMask/Options/Classes/PolygonMaskMove.d.ts +10 -0
  350. package/Plugins/PolygonMask/Options/Classes/PolygonMaskMove.js +21 -0
  351. package/Plugins/PolygonMask/Options/Interfaces/IPolygonMask.d.ts +12 -13
  352. package/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskDraw.d.ts +8 -0
  353. package/Plugins/PolygonMask/Options/Interfaces/{ILocalSvg.js → IPolygonMaskDraw.js} +0 -0
  354. package/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskDrawStroke.d.ts +6 -0
  355. package/Plugins/PolygonMask/Options/Interfaces/{IMove.js → IPolygonMaskDrawStroke.js} +0 -0
  356. package/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskInline.d.ts +4 -0
  357. package/Plugins/PolygonMask/{types.js → Options/Interfaces/IPolygonMaskInline.js} +0 -0
  358. package/Plugins/PolygonMask/Options/Interfaces/{ILocalSvg.d.ts → IPolygonMaskLocalSvg.d.ts} +2 -2
  359. package/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskLocalSvg.js +2 -0
  360. package/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskMove.d.ts +5 -0
  361. package/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskMove.js +2 -0
  362. package/Plugins/PolygonMask/PolygonMaskInstance.d.ts +4 -6
  363. package/Plugins/PolygonMask/PolygonMaskInstance.js +39 -36
  364. package/Plugins/PolygonMask/{types.d.ts → Types.d.ts} +1 -1
  365. package/Plugins/PolygonMask/Types.js +2 -0
  366. package/{esm/Plugins/PolygonMask/utils.d.ts → Plugins/PolygonMask/Utils.d.ts} +5 -5
  367. package/Plugins/PolygonMask/{utils.js → Utils.js} +15 -12
  368. package/Plugins/PolygonMask/index.d.ts +2 -0
  369. package/Plugins/PolygonMask/{plugin.js → index.js} +7 -8
  370. package/Plugins/PolygonMask/pathseg.js +54 -43
  371. package/README.md +161 -17
  372. package/Shapes/Circle/CircleDrawer.d.ts +1 -1
  373. package/Shapes/Circle/index.d.ts +2 -2
  374. package/Shapes/Circle/index.js +2 -2
  375. package/Shapes/Image/ImageDrawer.d.ts +3 -7
  376. package/Shapes/Image/ImageDrawer.js +29 -109
  377. package/Shapes/Image/Utils.d.ts +8 -5
  378. package/Shapes/Image/Utils.js +69 -38
  379. package/Shapes/Image/index.d.ts +2 -2
  380. package/Shapes/Image/index.js +3 -3
  381. package/Shapes/Line/LineDrawer.d.ts +1 -1
  382. package/Shapes/Line/index.d.ts +2 -2
  383. package/Shapes/Line/index.js +2 -2
  384. package/Shapes/Polygon/PolygonDrawer.d.ts +1 -1
  385. package/Shapes/Polygon/PolygonDrawerBase.d.ts +1 -1
  386. package/Shapes/Polygon/TriangleDrawer.d.ts +1 -1
  387. package/Shapes/Polygon/index.d.ts +4 -4
  388. package/Shapes/Polygon/index.js +7 -7
  389. package/Shapes/Square/SquareDrawer.d.ts +1 -1
  390. package/Shapes/Square/index.d.ts +2 -2
  391. package/Shapes/Square/index.js +3 -3
  392. package/Shapes/Star/StarDrawer.d.ts +1 -1
  393. package/Shapes/Star/index.d.ts +2 -2
  394. package/Shapes/Star/index.js +2 -2
  395. package/Shapes/Text/TextDrawer.d.ts +1 -2
  396. package/Shapes/Text/index.d.ts +2 -2
  397. package/Shapes/Text/index.js +2 -2
  398. package/Types/ShapeData.d.ts +1 -1
  399. package/Types/ShapeDrawerFunctions.d.ts +1 -1
  400. package/Updaters/Angle/AngleUpdater.d.ts +1 -3
  401. package/Updaters/Angle/AngleUpdater.js +8 -9
  402. package/Updaters/Angle/index.d.ts +2 -2
  403. package/Updaters/Angle/index.js +2 -2
  404. package/Updaters/Color/ColorUpdater.d.ts +1 -3
  405. package/Updaters/Color/ColorUpdater.js +3 -4
  406. package/Updaters/Color/index.d.ts +2 -2
  407. package/Updaters/Color/index.js +2 -2
  408. package/Updaters/Life/LifeUpdater.d.ts +1 -3
  409. package/Updaters/Life/index.d.ts +2 -2
  410. package/Updaters/Life/index.js +2 -2
  411. package/Updaters/Opacity/OpacityUpdater.d.ts +1 -3
  412. package/Updaters/Opacity/OpacityUpdater.js +13 -14
  413. package/Updaters/Opacity/index.d.ts +2 -2
  414. package/Updaters/Opacity/index.js +2 -2
  415. package/Updaters/OutModes/IBounceData.d.ts +1 -2
  416. package/Updaters/OutModes/OutOfCanvasUpdater.d.ts +1 -3
  417. package/Updaters/OutModes/OutOfCanvasUpdater.js +28 -29
  418. package/Updaters/OutModes/Utils.js +12 -13
  419. package/Updaters/OutModes/index.d.ts +2 -2
  420. package/Updaters/OutModes/index.js +2 -2
  421. package/Updaters/Roll/RollUpdater.d.ts +1 -2
  422. package/Updaters/Roll/RollUpdater.js +4 -5
  423. package/Updaters/Roll/index.d.ts +2 -2
  424. package/Updaters/Roll/index.js +2 -2
  425. package/Updaters/Size/SizeUpdater.d.ts +1 -2
  426. package/Updaters/Size/SizeUpdater.js +6 -7
  427. package/Updaters/Size/index.d.ts +2 -2
  428. package/Updaters/Size/index.js +2 -2
  429. package/Updaters/StrokeColor/StrokeColorUpdater.d.ts +1 -3
  430. package/Updaters/StrokeColor/StrokeColorUpdater.js +3 -4
  431. package/Updaters/StrokeColor/index.d.ts +2 -2
  432. package/Updaters/StrokeColor/index.js +2 -2
  433. package/Updaters/Tilt/TiltUpdater.d.ts +1 -3
  434. package/Updaters/Tilt/TiltUpdater.js +8 -9
  435. package/Updaters/Tilt/index.d.ts +2 -2
  436. package/Updaters/Tilt/index.js +2 -2
  437. package/Updaters/Wobble/WobbleUpdater.d.ts +1 -3
  438. package/Updaters/Wobble/index.d.ts +2 -2
  439. package/Updaters/Wobble/index.js +2 -2
  440. package/Utils/CanvasUtils.d.ts +3 -4
  441. package/Utils/CanvasUtils.js +5 -6
  442. package/Utils/ColorUtils.d.ts +1 -1
  443. package/Utils/ColorUtils.js +8 -9
  444. package/Utils/NumberUtils.d.ts +3 -3
  445. package/Utils/NumberUtils.js +20 -21
  446. package/Utils/Utils.d.ts +3 -3
  447. package/Utils/Utils.js +6 -7
  448. package/Utils/index.d.ts +0 -9
  449. package/Utils/index.js +0 -9
  450. package/browser/Core/Canvas.d.ts +1 -1
  451. package/browser/Core/Canvas.js +9 -9
  452. package/browser/Core/Container.d.ts +5 -6
  453. package/browser/Core/Container.js +6 -7
  454. package/browser/Core/Interfaces/Gradients.d.ts +2 -2
  455. package/browser/Core/Interfaces/ICircleBouncer.d.ts +1 -1
  456. package/browser/Core/Interfaces/IContainerPlugin.d.ts +4 -4
  457. package/browser/Core/Interfaces/IExternalInteractor.d.ts +1 -1
  458. package/browser/Core/Interfaces/IInteractor.d.ts +1 -1
  459. package/browser/Core/Interfaces/IMovePathGenerator.d.ts +1 -1
  460. package/browser/Core/Interfaces/IParticle.d.ts +8 -8
  461. package/browser/Core/Interfaces/IParticleGradientAnimation.d.ts +1 -1
  462. package/browser/Core/Interfaces/IParticleSpin.d.ts +1 -1
  463. package/browser/Core/Interfaces/IParticlesInteractor.d.ts +2 -2
  464. package/browser/Core/Interfaces/IPlugin.d.ts +1 -1
  465. package/browser/Core/Interfaces/index.d.ts +3 -1
  466. package/browser/Core/Interfaces/index.js +3 -1
  467. package/browser/Core/Loader.d.ts +1 -1
  468. package/browser/Core/Loader.js +2 -1
  469. package/browser/Core/Particle.d.ts +3 -6
  470. package/browser/Core/Particle.js +13 -15
  471. package/browser/Core/Particles.d.ts +3 -3
  472. package/browser/Core/Particles.js +8 -14
  473. package/browser/{Utils → Core/Utils}/Circle.d.ts +1 -1
  474. package/browser/{Utils → Core/Utils}/Circle.js +1 -1
  475. package/browser/{Utils → Core/Utils}/CircleWarp.d.ts +2 -3
  476. package/browser/{Utils → Core/Utils}/CircleWarp.js +1 -1
  477. package/browser/{Utils → Core/Utils}/Constants.d.ts +0 -0
  478. package/browser/{Utils → Core/Utils}/Constants.js +0 -0
  479. package/browser/{Utils → Core/Utils}/EventListeners.d.ts +1 -1
  480. package/browser/{Utils → Core/Utils}/EventListeners.js +10 -11
  481. package/{esm/Core → browser/Core/Utils}/ExternalInteractorBase.d.ts +4 -4
  482. package/{esm/Core → browser/Core/Utils}/ExternalInteractorBase.js +1 -2
  483. package/browser/Core/{FrameManager.d.ts → Utils/FrameManager.d.ts} +1 -1
  484. package/browser/Core/{FrameManager.js → Utils/FrameManager.js} +0 -0
  485. package/browser/Core/{InteractionManager.d.ts → Utils/InteractionManager.d.ts} +5 -5
  486. package/browser/Core/{InteractionManager.js → Utils/InteractionManager.js} +4 -3
  487. package/{Core → browser/Core/Utils}/ParticlesInteractorBase.d.ts +4 -4
  488. package/{esm/Core → browser/Core/Utils}/ParticlesInteractorBase.js +1 -2
  489. package/browser/Core/{Particle/Mover.d.ts → Utils/ParticlesMover.d.ts} +2 -2
  490. package/browser/Core/{Particle/Mover.js → Utils/ParticlesMover.js} +4 -5
  491. package/browser/{Utils → Core/Utils}/Plugins.d.ts +5 -5
  492. package/browser/{Utils → Core/Utils}/Plugins.js +0 -0
  493. package/browser/{Utils → Core/Utils}/Point.d.ts +2 -2
  494. package/browser/{Utils → Core/Utils}/Point.js +0 -0
  495. package/browser/{Utils → Core/Utils}/QuadTree.d.ts +4 -4
  496. package/browser/{Utils → Core/Utils}/QuadTree.js +2 -2
  497. package/browser/{Utils → Core/Utils}/Range.d.ts +1 -1
  498. package/browser/{Utils → Core/Utils}/Range.js +0 -0
  499. package/browser/{Utils → Core/Utils}/Rectangle.d.ts +1 -2
  500. package/browser/{Utils → Core/Utils}/Rectangle.js +0 -0
  501. package/browser/Core/{Particle → Utils}/Vector.d.ts +0 -0
  502. package/browser/Core/{Particle → Utils}/Vector.js +0 -0
  503. package/{Core/Particle → browser/Core/Utils}/Vector3d.d.ts +1 -1
  504. package/browser/Core/{Particle → Utils}/Vector3d.js +0 -0
  505. package/browser/Core/Utils/index.d.ts +16 -0
  506. package/browser/Core/Utils/index.js +16 -0
  507. package/browser/Core/index.d.ts +8 -0
  508. package/browser/Core/index.js +8 -0
  509. package/browser/Enums/AnimationStatus.d.ts +1 -1
  510. package/browser/Enums/AnimationStatus.js +1 -5
  511. package/browser/Enums/Directions/MoveDirection.d.ts +1 -1
  512. package/browser/Enums/Directions/MoveDirection.js +1 -15
  513. package/browser/Enums/Directions/OutModeDirection.d.ts +1 -1
  514. package/browser/Enums/Directions/OutModeDirection.js +1 -7
  515. package/browser/Enums/Directions/RotateDirection.d.ts +1 -1
  516. package/browser/Enums/Directions/RotateDirection.js +1 -9
  517. package/browser/Enums/Directions/TiltDirection.d.ts +1 -1
  518. package/browser/Enums/Directions/TiltDirection.js +1 -9
  519. package/browser/Enums/InteractivityDetect.d.ts +1 -1
  520. package/browser/Enums/InteractivityDetect.js +1 -9
  521. package/browser/Enums/Modes/ClickMode.d.ts +1 -1
  522. package/browser/Enums/Modes/ClickMode.js +1 -13
  523. package/browser/Enums/Modes/CollisionMode.d.ts +1 -1
  524. package/browser/Enums/Modes/CollisionMode.js +1 -9
  525. package/browser/Enums/Modes/DestroyMode.d.ts +1 -1
  526. package/browser/Enums/Modes/DestroyMode.js +1 -5
  527. package/browser/Enums/Modes/DivMode.d.ts +1 -1
  528. package/browser/Enums/Modes/DivMode.js +1 -9
  529. package/browser/Enums/Modes/HoverMode.d.ts +1 -1
  530. package/browser/Enums/Modes/HoverMode.js +1 -15
  531. package/browser/Enums/Modes/OutMode.d.ts +1 -1
  532. package/browser/Enums/Modes/OutMode.js +1 -13
  533. package/browser/Enums/Modes/ResponsiveMode.d.ts +1 -1
  534. package/browser/Enums/Modes/ResponsiveMode.js +1 -5
  535. package/browser/Enums/Modes/RollMode.d.ts +1 -1
  536. package/browser/Enums/Modes/RollMode.js +1 -6
  537. package/browser/Enums/Modes/SizeMode.d.ts +1 -1
  538. package/browser/Enums/Modes/SizeMode.js +1 -8
  539. package/browser/Enums/Modes/ThemeMode.d.ts +1 -1
  540. package/browser/Enums/Modes/ThemeMode.js +1 -6
  541. package/browser/Enums/Types/AlterType.d.ts +1 -1
  542. package/browser/Enums/Types/AlterType.js +1 -5
  543. package/browser/Enums/Types/DestroyType.d.ts +1 -1
  544. package/browser/Enums/Types/DestroyType.js +1 -9
  545. package/browser/Enums/Types/DivType.d.ts +1 -1
  546. package/browser/Enums/Types/DivType.js +1 -8
  547. package/browser/Enums/Types/EasingType.d.ts +1 -1
  548. package/browser/Enums/Types/EasingType.js +1 -11
  549. package/browser/Enums/Types/GradientType.d.ts +1 -1
  550. package/browser/Enums/Types/GradientType.js +1 -6
  551. package/browser/Enums/Types/InteractorType.d.ts +1 -1
  552. package/browser/Enums/Types/InteractorType.js +1 -5
  553. package/browser/Enums/Types/OrbitType.d.ts +1 -1
  554. package/browser/Enums/Types/OrbitType.js +1 -8
  555. package/browser/Enums/Types/ShapeType.d.ts +1 -1
  556. package/browser/Enums/Types/ShapeType.js +1 -17
  557. package/browser/Enums/Types/StartValueType.d.ts +1 -1
  558. package/browser/Enums/Types/StartValueType.js +1 -9
  559. package/browser/Interactions/External/Attract/Attractor.d.ts +2 -2
  560. package/browser/Interactions/External/Attract/Attractor.js +5 -7
  561. package/browser/Interactions/External/Attract/index.d.ts +2 -2
  562. package/browser/Interactions/External/Attract/index.js +2 -2
  563. package/browser/Interactions/External/Bounce/Bouncer.d.ts +2 -2
  564. package/browser/Interactions/External/Bounce/Bouncer.js +7 -9
  565. package/browser/Interactions/External/Bounce/index.d.ts +2 -2
  566. package/browser/Interactions/External/Bounce/index.js +2 -2
  567. package/browser/Interactions/External/Bubble/Bubbler.d.ts +3 -3
  568. package/browser/Interactions/External/Bubble/Bubbler.js +16 -18
  569. package/browser/Interactions/External/Bubble/ProcessBubbleType.d.ts +1 -1
  570. package/browser/Interactions/External/Bubble/ProcessBubbleType.js +1 -9
  571. package/browser/Interactions/External/Bubble/index.d.ts +2 -2
  572. package/browser/Interactions/External/Bubble/index.js +2 -2
  573. package/browser/Interactions/External/Connect/Connector.d.ts +2 -2
  574. package/browser/Interactions/External/Connect/Connector.js +2 -3
  575. package/browser/Interactions/External/Connect/index.d.ts +2 -2
  576. package/browser/Interactions/External/Connect/index.js +2 -2
  577. package/browser/Interactions/External/Grab/Grabber.d.ts +2 -2
  578. package/browser/Interactions/External/Grab/Grabber.js +3 -4
  579. package/browser/Interactions/External/Grab/index.d.ts +2 -2
  580. package/browser/Interactions/External/Grab/index.js +2 -2
  581. package/browser/Interactions/External/Repulse/Repulser.d.ts +2 -2
  582. package/browser/Interactions/External/Repulse/Repulser.js +8 -10
  583. package/browser/Interactions/External/Repulse/index.d.ts +2 -2
  584. package/browser/Interactions/External/Repulse/index.js +2 -2
  585. package/browser/Interactions/External/Trail/TrailMaker.d.ts +2 -3
  586. package/browser/Interactions/External/Trail/TrailMaker.js +3 -4
  587. package/browser/Interactions/External/Trail/index.d.ts +2 -2
  588. package/browser/Interactions/External/Trail/index.js +2 -2
  589. package/browser/Interactions/Particles/Attract/Attractor.d.ts +2 -4
  590. package/browser/Interactions/Particles/Attract/Attractor.js +1 -1
  591. package/browser/Interactions/Particles/Attract/index.d.ts +2 -2
  592. package/browser/Interactions/Particles/Attract/index.js +2 -2
  593. package/browser/Interactions/Particles/Collisions/Collider.d.ts +2 -3
  594. package/browser/Interactions/Particles/Collisions/Collider.js +4 -5
  595. package/browser/Interactions/Particles/Collisions/index.d.ts +2 -2
  596. package/browser/Interactions/Particles/Collisions/index.js +2 -2
  597. package/browser/Interactions/Particles/Links/LinkInstance.d.ts +1 -3
  598. package/browser/Interactions/Particles/Links/LinkParticle.d.ts +1 -1
  599. package/browser/Interactions/Particles/Links/Linker.d.ts +3 -4
  600. package/browser/Interactions/Particles/Links/Linker.js +2 -2
  601. package/browser/Interactions/Particles/Links/index.d.ts +2 -3
  602. package/browser/Interactions/Particles/Links/index.js +4 -7
  603. package/browser/Interactions/Particles/Links/interaction.d.ts +2 -0
  604. package/browser/Interactions/Particles/Links/interaction.js +4 -0
  605. package/browser/Interactions/Particles/Links/plugin.d.ts +2 -2
  606. package/browser/Interactions/Particles/Links/plugin.js +4 -4
  607. package/browser/Options/Classes/AnimatableColor.d.ts +3 -3
  608. package/browser/Options/Classes/AnimatableColor.js +1 -1
  609. package/browser/Options/Classes/AnimatableGradient.d.ts +6 -6
  610. package/browser/Options/Classes/AnimatableGradient.js +3 -4
  611. package/browser/Options/Classes/AnimationOptions.d.ts +2 -2
  612. package/browser/Options/Classes/Background/Background.d.ts +2 -2
  613. package/browser/Options/Classes/BackgroundMask/BackgroundMask.d.ts +2 -2
  614. package/browser/Options/Classes/BackgroundMask/BackgroundMaskCover.d.ts +2 -2
  615. package/browser/Options/Classes/ColorAnimation.d.ts +1 -1
  616. package/browser/Options/Classes/HslAnimation.d.ts +2 -2
  617. package/browser/Options/Classes/Interactivity/Events/ClickEvent.d.ts +2 -2
  618. package/browser/Options/Classes/Interactivity/Events/DivEvent.d.ts +1 -1
  619. package/browser/Options/Classes/Interactivity/Events/DivEvent.js +1 -2
  620. package/browser/Options/Classes/Interactivity/Events/Events.d.ts +2 -2
  621. package/browser/Options/Classes/Interactivity/Events/HoverEvent.d.ts +3 -3
  622. package/browser/Options/Classes/Interactivity/Events/Parallax.d.ts +1 -1
  623. package/browser/Options/Classes/Interactivity/Interactivity.d.ts +2 -2
  624. package/browser/Options/Classes/Interactivity/Interactivity.js +5 -6
  625. package/browser/Options/Classes/Interactivity/Modes/Attract.d.ts +2 -2
  626. package/browser/Options/Classes/Interactivity/Modes/Attract.js +1 -2
  627. package/browser/Options/Classes/Interactivity/Modes/Bubble.d.ts +2 -2
  628. package/browser/Options/Classes/Interactivity/Modes/Bubble.js +1 -1
  629. package/browser/Options/Classes/Interactivity/Modes/BubbleBase.d.ts +1 -1
  630. package/browser/Options/Classes/Interactivity/Modes/BubbleDiv.d.ts +1 -1
  631. package/browser/Options/Classes/Interactivity/Modes/Connect.d.ts +2 -2
  632. package/browser/Options/Classes/Interactivity/Modes/ConnectLinks.d.ts +1 -1
  633. package/browser/Options/Classes/Interactivity/Modes/Grab.d.ts +2 -2
  634. package/browser/Options/Classes/Interactivity/Modes/GrabLinks.d.ts +2 -2
  635. package/browser/Options/Classes/Interactivity/Modes/Light.d.ts +1 -1
  636. package/browser/Options/Classes/Interactivity/Modes/Modes.d.ts +7 -7
  637. package/browser/Options/Classes/Interactivity/Modes/Modes.js +4 -4
  638. package/browser/Options/Classes/Interactivity/Modes/Push.d.ts +1 -1
  639. package/browser/Options/Classes/Interactivity/Modes/Remove.d.ts +1 -1
  640. package/browser/Options/Classes/Interactivity/Modes/Repulse.d.ts +3 -3
  641. package/browser/Options/Classes/Interactivity/Modes/Repulse.js +1 -1
  642. package/browser/Options/Classes/Interactivity/Modes/RepulseBase.d.ts +2 -2
  643. package/browser/Options/Classes/Interactivity/Modes/RepulseBase.js +1 -2
  644. package/browser/Options/Classes/Interactivity/Modes/RepulseDiv.d.ts +1 -1
  645. package/browser/Options/Classes/Interactivity/Modes/Slow.d.ts +1 -1
  646. package/browser/Options/Classes/Interactivity/Modes/Trail.d.ts +2 -2
  647. package/browser/Options/Classes/ManualParticle.d.ts +2 -2
  648. package/browser/Options/Classes/Motion/Motion.d.ts +1 -1
  649. package/browser/Options/Classes/Options.d.ts +7 -7
  650. package/browser/Options/Classes/Options.js +13 -13
  651. package/browser/Options/Classes/OptionsColor.d.ts +2 -2
  652. package/browser/Options/Classes/Particles/Bounce/Bounce.d.ts +1 -1
  653. package/browser/Options/Classes/Particles/Collisions/Collisions.d.ts +4 -4
  654. package/browser/Options/Classes/Particles/Collisions/Collisions.js +1 -2
  655. package/browser/Options/Classes/Particles/Collisions/CollisionsOverlap.d.ts +2 -2
  656. package/browser/Options/Classes/Particles/Destroy/Destroy.d.ts +1 -1
  657. package/browser/Options/Classes/Particles/Destroy/Destroy.js +1 -2
  658. package/browser/Options/Classes/Particles/Destroy/Split.d.ts +3 -3
  659. package/browser/Options/Classes/Particles/Life/Life.d.ts +1 -1
  660. package/browser/Options/Classes/Particles/Links/Links.d.ts +2 -2
  661. package/browser/Options/Classes/Particles/Links/LinksShadow.d.ts +2 -2
  662. package/browser/Options/Classes/Particles/Links/LinksTriangle.d.ts +1 -1
  663. package/browser/Options/Classes/Particles/Move/Attract.d.ts +2 -2
  664. package/browser/Options/Classes/Particles/Move/Move.d.ts +5 -5
  665. package/browser/Options/Classes/Particles/Move/Move.js +4 -5
  666. package/browser/Options/Classes/Particles/Move/OutModes.d.ts +2 -2
  667. package/browser/Options/Classes/Particles/Move/OutModes.js +1 -2
  668. package/browser/Options/Classes/Particles/Move/Path/Path.d.ts +3 -3
  669. package/browser/Options/Classes/Particles/Move/Spin.d.ts +3 -3
  670. package/browser/Options/Classes/Particles/Move/Trail.d.ts +2 -2
  671. package/browser/Options/Classes/Particles/Number/Density.d.ts +1 -1
  672. package/browser/Options/Classes/Particles/Number/ParticlesNumber.d.ts +2 -2
  673. package/browser/Options/Classes/Particles/Opacity/Opacity.d.ts +1 -1
  674. package/browser/Options/Classes/Particles/Opacity/OpacityAnimation.d.ts +3 -3
  675. package/browser/Options/Classes/Particles/Opacity/OpacityAnimation.js +2 -3
  676. package/browser/Options/Classes/Particles/Orbit/Orbit.d.ts +5 -5
  677. package/browser/Options/Classes/Particles/Orbit/Orbit.js +2 -2
  678. package/browser/Options/Classes/Particles/Orbit/OrbitRotation.d.ts +1 -1
  679. package/browser/Options/Classes/Particles/ParticlesOptions.d.ts +16 -16
  680. package/browser/Options/Classes/Particles/ParticlesOptions.js +13 -13
  681. package/browser/Options/Classes/Particles/Repulse/Repulse.d.ts +1 -1
  682. package/browser/Options/Classes/Particles/Roll/Roll.d.ts +2 -2
  683. package/browser/Options/Classes/Particles/Roll/Roll.js +1 -2
  684. package/browser/Options/Classes/Particles/Roll/RollLight.d.ts +1 -1
  685. package/browser/Options/Classes/Particles/Rotate/Rotate.d.ts +3 -3
  686. package/browser/Options/Classes/Particles/Rotate/Rotate.js +1 -2
  687. package/browser/Options/Classes/Particles/Rotate/RotateAnimation.d.ts +1 -1
  688. package/browser/Options/Classes/Particles/Shadow.d.ts +3 -3
  689. package/browser/Options/Classes/Particles/Shape/Shape.d.ts +5 -5
  690. package/browser/Options/Classes/Particles/Shape/Shape.js +13 -14
  691. package/browser/Options/Classes/Particles/Size/Size.d.ts +2 -2
  692. package/browser/Options/Classes/Particles/Size/SizeAnimation.d.ts +3 -3
  693. package/browser/Options/Classes/Particles/Size/SizeAnimation.js +2 -3
  694. package/browser/Options/Classes/Particles/Stroke.d.ts +2 -2
  695. package/browser/Options/Classes/Particles/Tilt/Tilt.d.ts +3 -3
  696. package/browser/Options/Classes/Particles/Tilt/Tilt.js +1 -2
  697. package/browser/Options/Classes/Particles/Tilt/TiltAnimation.d.ts +1 -1
  698. package/browser/Options/Classes/Particles/Twinkle/Twinkle.d.ts +1 -1
  699. package/browser/Options/Classes/Particles/Twinkle/TwinkleValues.d.ts +2 -2
  700. package/browser/Options/Classes/Particles/Wobble/Wobble.d.ts +2 -2
  701. package/browser/Options/Classes/Particles/ZIndex/ZIndex.d.ts +1 -1
  702. package/browser/Options/Classes/Random.d.ts +1 -1
  703. package/browser/Options/Classes/Responsive.d.ts +2 -2
  704. package/browser/Options/Classes/Responsive.js +4 -5
  705. package/browser/Options/Classes/Theme/Theme.d.ts +2 -2
  706. package/browser/Options/Classes/Theme/Theme.js +1 -1
  707. package/browser/Options/Classes/Theme/ThemeDefault.d.ts +2 -2
  708. package/browser/Options/Classes/Theme/ThemeDefault.js +1 -2
  709. package/browser/Options/Classes/ValueWithRandom.d.ts +2 -2
  710. package/browser/Options/Interfaces/BackgroundMask/IBackgroundMask.d.ts +1 -1
  711. package/browser/Options/Interfaces/IAnimatableColor.d.ts +1 -1
  712. package/browser/Options/Interfaces/IAnimatableGradient.d.ts +1 -1
  713. package/browser/Options/Interfaces/IColorAnimation.d.ts +1 -1
  714. package/browser/Options/Interfaces/IColorAnimation.js +0 -4
  715. package/browser/Options/Interfaces/IManualParticle.d.ts +1 -1
  716. package/browser/Options/Interfaces/IOptions.d.ts +6 -6
  717. package/browser/Options/Interfaces/IOptionsGradient.d.ts +2 -2
  718. package/browser/Options/Interfaces/IResponsive.d.ts +2 -2
  719. package/browser/Options/Interfaces/IValueWithRandom.d.ts +1 -1
  720. package/browser/Options/Interfaces/Interactivity/Events/IEvents.d.ts +1 -1
  721. package/browser/Options/Interfaces/Interactivity/IInteractivity.d.ts +1 -1
  722. package/browser/Options/Interfaces/Interactivity/Modes/IBubble.d.ts +2 -2
  723. package/browser/Options/Interfaces/Interactivity/Modes/IBubbleBase.d.ts +1 -1
  724. package/browser/Options/Interfaces/Interactivity/Modes/IModes.d.ts +2 -2
  725. package/browser/Options/Interfaces/Interactivity/Modes/IRepulse.d.ts +2 -2
  726. package/browser/Options/Interfaces/Interactivity/Modes/IRepulseDiv.d.ts +1 -1
  727. package/browser/Options/Interfaces/Particles/Destroy/ISplit.d.ts +1 -1
  728. package/browser/Options/Interfaces/Particles/IParticles.d.ts +14 -14
  729. package/browser/Options/Interfaces/Particles/IShadow.d.ts +1 -1
  730. package/browser/Options/Interfaces/Particles/IStroke.d.ts +1 -1
  731. package/browser/Options/Interfaces/Particles/Links/ILinks.d.ts +1 -1
  732. package/browser/Options/Interfaces/Particles/Move/IMove.d.ts +5 -5
  733. package/browser/Options/Interfaces/Particles/Move/Path/{iPath.d.ts → IPath.d.ts} +0 -0
  734. package/browser/Options/Interfaces/Particles/Move/Path/{iPath.js → IPath.js} +0 -0
  735. package/browser/Options/Interfaces/Particles/Orbit/IOrbit.d.ts +3 -3
  736. package/browser/Options/Interfaces/Particles/Roll/IRoll.d.ts +1 -1
  737. package/browser/Options/Interfaces/Particles/Rotate/IRotate.d.ts +1 -1
  738. package/browser/Options/Interfaces/Particles/Shape/IShape.d.ts +3 -3
  739. package/browser/Options/Interfaces/Particles/Tilt/ITilt.d.ts +1 -1
  740. package/browser/Options/Interfaces/Theme/ITheme.d.ts +2 -2
  741. package/browser/Plugins/Absorbers/AbsorberContainer.d.ts +1 -1
  742. package/browser/Plugins/Absorbers/AbsorberInstance.d.ts +6 -7
  743. package/browser/Plugins/Absorbers/AbsorberInstance.js +22 -23
  744. package/browser/Plugins/Absorbers/Absorbers.d.ts +4 -7
  745. package/browser/Plugins/Absorbers/Absorbers.js +2 -3
  746. package/browser/Plugins/Absorbers/Enums/AbsorberClickMode.d.ts +1 -1
  747. package/browser/Plugins/Absorbers/Enums/AbsorberClickMode.js +1 -7
  748. package/browser/Plugins/Absorbers/Options/Classes/Absorber.d.ts +4 -4
  749. package/browser/Plugins/Absorbers/Options/Classes/AbsorberSize.d.ts +2 -2
  750. package/browser/Plugins/Absorbers/Options/Classes/AbsorberSize.js +1 -1
  751. package/browser/Plugins/Absorbers/Options/Classes/AbsorberSizeLimit.d.ts +2 -2
  752. package/browser/Plugins/Absorbers/Options/Interfaces/IAbsorber.d.ts +1 -2
  753. package/browser/Plugins/Absorbers/Options/Interfaces/IAbsorberOptions.d.ts +1 -1
  754. package/browser/Plugins/Absorbers/Options/Interfaces/IAbsorberSize.d.ts +1 -1
  755. package/browser/Plugins/Absorbers/index.d.ts +2 -0
  756. package/browser/Plugins/Absorbers/{plugin.js → index.js} +6 -7
  757. package/browser/Plugins/Emitters/EmitterContainer.d.ts +2 -1
  758. package/browser/Plugins/Emitters/EmitterInstance.d.ts +6 -5
  759. package/browser/Plugins/Emitters/EmitterInstance.js +37 -39
  760. package/browser/Plugins/Emitters/Emitters.d.ts +4 -5
  761. package/browser/Plugins/Emitters/Emitters.js +12 -5
  762. package/browser/Plugins/Emitters/EmittersMain.d.ts +2 -2
  763. package/browser/Plugins/Emitters/Enums/EmitterClickMode.d.ts +1 -1
  764. package/browser/Plugins/Emitters/Enums/EmitterClickMode.js +1 -7
  765. package/browser/Plugins/Emitters/Enums/EmitterShapeType.d.ts +1 -1
  766. package/browser/Plugins/Emitters/Enums/EmitterShapeType.js +1 -5
  767. package/browser/Plugins/Emitters/IEmitterShape.d.ts +1 -1
  768. package/browser/Plugins/Emitters/Options/Classes/Emitter.d.ts +7 -7
  769. package/browser/Plugins/Emitters/Options/Classes/Emitter.js +4 -5
  770. package/browser/Plugins/Emitters/Options/Classes/EmitterLife.d.ts +1 -1
  771. package/browser/Plugins/Emitters/Options/Classes/EmitterRate.d.ts +1 -1
  772. package/browser/Plugins/Emitters/Options/Classes/EmitterSize.d.ts +1 -1
  773. package/browser/Plugins/Emitters/Options/Classes/EmitterSize.js +1 -2
  774. package/browser/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +6 -6
  775. package/browser/Plugins/Emitters/Options/Interfaces/IEmitterOptions.d.ts +1 -1
  776. package/browser/Plugins/Emitters/Options/Interfaces/IEmitterSize.d.ts +1 -1
  777. package/browser/Plugins/Emitters/Shapes/Circle/CircleShape.d.ts +1 -1
  778. package/browser/Plugins/Emitters/Shapes/Square/SquareShape.d.ts +1 -1
  779. package/browser/Plugins/Emitters/index.d.ts +3 -0
  780. package/browser/Plugins/Emitters/{plugin.js → index.js} +10 -11
  781. package/browser/Plugins/PolygonMask/Enums/PolygonMaskInlineArrangement.d.ts +8 -0
  782. package/browser/Plugins/PolygonMask/{Options/Interfaces/IDraw.js → Enums/PolygonMaskInlineArrangement.js} +0 -0
  783. package/browser/Plugins/PolygonMask/Enums/PolygonMaskMoveType.d.ts +4 -0
  784. package/browser/Plugins/PolygonMask/{Options/Interfaces/IDrawStroke.js → Enums/PolygonMaskMoveType.js} +0 -0
  785. package/{Plugins/PolygonMask/Enums/Type.d.ts → browser/Plugins/PolygonMask/Enums/PolygonMaskType.d.ts} +1 -1
  786. package/browser/Plugins/PolygonMask/{Options/Interfaces/IInline.js → Enums/PolygonMaskType.js} +0 -0
  787. package/browser/Plugins/PolygonMask/Enums/index.d.ts +3 -3
  788. package/browser/Plugins/PolygonMask/Enums/index.js +3 -3
  789. package/browser/Plugins/PolygonMask/Options/Classes/PolygonMask.d.ts +14 -14
  790. package/browser/Plugins/PolygonMask/Options/Classes/PolygonMask.js +42 -42
  791. package/browser/Plugins/PolygonMask/Options/Classes/{Draw.d.ts → PolygonMaskDraw.d.ts} +7 -7
  792. package/browser/Plugins/PolygonMask/Options/Classes/{Draw.js → PolygonMaskDraw.js} +13 -12
  793. package/browser/Plugins/PolygonMask/Options/Classes/{DrawStroke.d.ts → PolygonMaskDrawStroke.d.ts} +5 -5
  794. package/browser/Plugins/PolygonMask/Options/Classes/PolygonMaskDrawStroke.js +28 -0
  795. package/browser/Plugins/PolygonMask/Options/Classes/PolygonMaskInline.d.ts +12 -0
  796. package/browser/Plugins/PolygonMask/Options/Classes/PolygonMaskInline.js +16 -0
  797. package/browser/Plugins/PolygonMask/Options/Classes/{LocalSvg.d.ts → PolygonMaskLocalSvg.d.ts} +6 -6
  798. package/browser/Plugins/PolygonMask/Options/Classes/PolygonMaskLocalSvg.js +28 -0
  799. package/browser/Plugins/PolygonMask/Options/Classes/PolygonMaskMove.d.ts +13 -0
  800. package/browser/Plugins/PolygonMask/Options/Classes/PolygonMaskMove.js +20 -0
  801. package/browser/Plugins/PolygonMask/Options/Interfaces/IPolygonMask.d.ts +12 -13
  802. package/browser/Plugins/PolygonMask/Options/Interfaces/{IDraw.d.ts → IPolygonMaskDraw.d.ts} +4 -4
  803. package/browser/Plugins/PolygonMask/Options/Interfaces/{ILocalSvg.js → IPolygonMaskDraw.js} +0 -0
  804. package/browser/Plugins/PolygonMask/Options/Interfaces/{IDrawStroke.d.ts → IPolygonMaskDrawStroke.d.ts} +2 -2
  805. package/browser/Plugins/PolygonMask/Options/Interfaces/{IMove.js → IPolygonMaskDrawStroke.js} +0 -0
  806. package/browser/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskInline.d.ts +7 -0
  807. package/browser/Plugins/PolygonMask/{types.js → Options/Interfaces/IPolygonMaskInline.js} +0 -0
  808. package/browser/Plugins/PolygonMask/Options/Interfaces/{ILocalSvg.d.ts → IPolygonMaskLocalSvg.d.ts} +2 -2
  809. package/{esm/Options/Interfaces/Particles/Move/Path/iPath.js → browser/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskLocalSvg.js} +0 -0
  810. package/browser/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskMove.d.ts +8 -0
  811. package/{esm/Plugins/PolygonMask/Options/Interfaces/IDraw.js → browser/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskMove.js} +0 -0
  812. package/browser/Plugins/PolygonMask/PolygonMaskInstance.d.ts +4 -6
  813. package/browser/Plugins/PolygonMask/PolygonMaskInstance.js +24 -21
  814. package/{esm/Plugins/PolygonMask/types.d.ts → browser/Plugins/PolygonMask/Types.d.ts} +1 -1
  815. package/{esm/Plugins/PolygonMask/Options/Interfaces/IDrawStroke.js → browser/Plugins/PolygonMask/Types.js} +0 -0
  816. package/{Plugins/PolygonMask/utils.d.ts → browser/Plugins/PolygonMask/Utils.d.ts} +5 -5
  817. package/browser/Plugins/PolygonMask/{utils.js → Utils.js} +15 -12
  818. package/browser/Plugins/PolygonMask/index.d.ts +2 -0
  819. package/browser/Plugins/PolygonMask/{plugin.js → index.js} +8 -9
  820. package/browser/Plugins/PolygonMask/pathseg.js +54 -44
  821. package/browser/Shapes/Circle/CircleDrawer.d.ts +1 -1
  822. package/browser/Shapes/Circle/index.d.ts +2 -2
  823. package/browser/Shapes/Circle/index.js +2 -2
  824. package/browser/Shapes/Image/ImageDrawer.d.ts +3 -7
  825. package/browser/Shapes/Image/ImageDrawer.js +28 -111
  826. package/browser/Shapes/Image/Utils.d.ts +8 -5
  827. package/browser/Shapes/Image/Utils.js +71 -37
  828. package/browser/Shapes/Image/index.d.ts +2 -2
  829. package/browser/Shapes/Image/index.js +3 -3
  830. package/browser/Shapes/Line/LineDrawer.d.ts +1 -1
  831. package/browser/Shapes/Line/index.d.ts +2 -2
  832. package/browser/Shapes/Line/index.js +2 -2
  833. package/browser/Shapes/Polygon/PolygonDrawer.d.ts +1 -1
  834. package/browser/Shapes/Polygon/PolygonDrawerBase.d.ts +1 -1
  835. package/browser/Shapes/Polygon/TriangleDrawer.d.ts +1 -1
  836. package/browser/Shapes/Polygon/index.d.ts +4 -4
  837. package/browser/Shapes/Polygon/index.js +7 -7
  838. package/browser/Shapes/Square/SquareDrawer.d.ts +1 -1
  839. package/browser/Shapes/Square/index.d.ts +2 -2
  840. package/browser/Shapes/Square/index.js +3 -3
  841. package/browser/Shapes/Star/StarDrawer.d.ts +1 -1
  842. package/browser/Shapes/Star/index.d.ts +2 -2
  843. package/browser/Shapes/Star/index.js +2 -2
  844. package/browser/Shapes/Text/TextDrawer.d.ts +1 -2
  845. package/browser/Shapes/Text/index.d.ts +2 -2
  846. package/browser/Shapes/Text/index.js +3 -3
  847. package/browser/Types/ShapeData.d.ts +1 -1
  848. package/browser/Types/ShapeDrawerFunctions.d.ts +1 -1
  849. package/browser/Updaters/Angle/AngleUpdater.d.ts +1 -3
  850. package/browser/Updaters/Angle/AngleUpdater.js +8 -9
  851. package/browser/Updaters/Angle/index.d.ts +2 -2
  852. package/browser/Updaters/Angle/index.js +2 -2
  853. package/browser/Updaters/Color/ColorUpdater.d.ts +1 -3
  854. package/browser/Updaters/Color/ColorUpdater.js +3 -4
  855. package/browser/Updaters/Color/index.d.ts +2 -2
  856. package/browser/Updaters/Color/index.js +2 -2
  857. package/browser/Updaters/Life/LifeUpdater.d.ts +1 -3
  858. package/browser/Updaters/Life/index.d.ts +2 -2
  859. package/browser/Updaters/Life/index.js +2 -2
  860. package/browser/Updaters/Opacity/OpacityUpdater.d.ts +1 -3
  861. package/browser/Updaters/Opacity/OpacityUpdater.js +13 -14
  862. package/browser/Updaters/Opacity/index.d.ts +2 -2
  863. package/browser/Updaters/Opacity/index.js +2 -2
  864. package/browser/Updaters/OutModes/IBounceData.d.ts +1 -2
  865. package/browser/Updaters/OutModes/OutOfCanvasUpdater.d.ts +1 -3
  866. package/browser/Updaters/OutModes/OutOfCanvasUpdater.js +20 -21
  867. package/browser/Updaters/OutModes/Utils.js +12 -13
  868. package/browser/Updaters/OutModes/index.d.ts +2 -2
  869. package/browser/Updaters/OutModes/index.js +2 -2
  870. package/browser/Updaters/Roll/RollUpdater.d.ts +1 -2
  871. package/browser/Updaters/Roll/RollUpdater.js +4 -5
  872. package/browser/Updaters/Roll/index.d.ts +2 -2
  873. package/browser/Updaters/Roll/index.js +2 -2
  874. package/browser/Updaters/Size/SizeUpdater.d.ts +1 -2
  875. package/browser/Updaters/Size/SizeUpdater.js +6 -7
  876. package/browser/Updaters/Size/index.d.ts +2 -2
  877. package/browser/Updaters/Size/index.js +2 -2
  878. package/browser/Updaters/StrokeColor/StrokeColorUpdater.d.ts +1 -3
  879. package/browser/Updaters/StrokeColor/StrokeColorUpdater.js +3 -4
  880. package/browser/Updaters/StrokeColor/index.d.ts +2 -2
  881. package/browser/Updaters/StrokeColor/index.js +2 -2
  882. package/browser/Updaters/Tilt/TiltUpdater.d.ts +1 -3
  883. package/browser/Updaters/Tilt/TiltUpdater.js +8 -9
  884. package/browser/Updaters/Tilt/index.d.ts +2 -2
  885. package/browser/Updaters/Tilt/index.js +2 -2
  886. package/browser/Updaters/Wobble/WobbleUpdater.d.ts +1 -3
  887. package/browser/Updaters/Wobble/index.d.ts +2 -2
  888. package/browser/Updaters/Wobble/index.js +2 -2
  889. package/browser/Utils/CanvasUtils.d.ts +3 -4
  890. package/browser/Utils/CanvasUtils.js +5 -6
  891. package/browser/Utils/ColorUtils.d.ts +1 -1
  892. package/browser/Utils/ColorUtils.js +3 -4
  893. package/browser/Utils/NumberUtils.d.ts +3 -3
  894. package/browser/Utils/NumberUtils.js +18 -19
  895. package/browser/Utils/Utils.d.ts +3 -3
  896. package/browser/Utils/Utils.js +6 -7
  897. package/browser/Utils/index.d.ts +0 -9
  898. package/browser/Utils/index.js +0 -9
  899. package/browser/{main.d.ts → engine.d.ts} +5 -7
  900. package/browser/{main.js → engine.js} +10 -11
  901. package/browser/full.d.ts +2 -2
  902. package/browser/full.js +14 -14
  903. package/browser/index.d.ts +7 -17
  904. package/browser/index.engine.d.ts +13 -0
  905. package/browser/index.engine.js +12 -0
  906. package/browser/index.js +5 -13
  907. package/browser/index.slim.d.ts +6 -16
  908. package/browser/index.slim.js +5 -13
  909. package/browser/pjs.d.ts +3 -3
  910. package/browser/pjs.js +6 -5
  911. package/browser/slim.d.ts +2 -2
  912. package/browser/slim.js +40 -40
  913. package/{esm/main.d.ts → engine.d.ts} +3 -5
  914. package/{main.js → engine.js} +24 -25
  915. package/esm/Core/Canvas.d.ts +1 -1
  916. package/esm/Core/Canvas.js +9 -9
  917. package/esm/Core/Container.d.ts +5 -6
  918. package/esm/Core/Container.js +6 -7
  919. package/esm/Core/Interfaces/Gradients.d.ts +2 -2
  920. package/esm/Core/Interfaces/ICircleBouncer.d.ts +1 -1
  921. package/esm/Core/Interfaces/IContainerPlugin.d.ts +4 -4
  922. package/esm/Core/Interfaces/IExternalInteractor.d.ts +1 -1
  923. package/esm/Core/Interfaces/IInteractor.d.ts +1 -1
  924. package/esm/Core/Interfaces/IMovePathGenerator.d.ts +1 -1
  925. package/esm/Core/Interfaces/IParticle.d.ts +8 -8
  926. package/esm/Core/Interfaces/IParticleGradientAnimation.d.ts +1 -1
  927. package/esm/Core/Interfaces/IParticleSpin.d.ts +1 -1
  928. package/esm/Core/Interfaces/IParticlesInteractor.d.ts +2 -2
  929. package/esm/Core/Interfaces/IPlugin.d.ts +1 -1
  930. package/esm/Core/Interfaces/index.d.ts +3 -1
  931. package/esm/Core/Interfaces/index.js +3 -1
  932. package/esm/Core/Loader.d.ts +1 -1
  933. package/esm/Core/Loader.js +2 -1
  934. package/esm/Core/Particle.d.ts +3 -6
  935. package/esm/Core/Particle.js +13 -15
  936. package/esm/Core/Particles.d.ts +3 -3
  937. package/esm/Core/Particles.js +8 -14
  938. package/esm/{Utils → Core/Utils}/Circle.d.ts +1 -1
  939. package/esm/{Utils → Core/Utils}/Circle.js +1 -1
  940. package/{Utils → esm/Core/Utils}/CircleWarp.d.ts +2 -3
  941. package/esm/{Utils → Core/Utils}/CircleWarp.js +1 -1
  942. package/esm/{Utils → Core/Utils}/Constants.d.ts +0 -0
  943. package/esm/{Utils → Core/Utils}/Constants.js +0 -0
  944. package/esm/{Utils → Core/Utils}/EventListeners.d.ts +1 -1
  945. package/esm/{Utils → Core/Utils}/EventListeners.js +10 -11
  946. package/{browser/Core → esm/Core/Utils}/ExternalInteractorBase.d.ts +4 -4
  947. package/{browser/Core → esm/Core/Utils}/ExternalInteractorBase.js +1 -2
  948. package/{Core → esm/Core/Utils}/FrameManager.d.ts +1 -1
  949. package/esm/Core/{FrameManager.js → Utils/FrameManager.js} +0 -0
  950. package/{Core → esm/Core/Utils}/InteractionManager.d.ts +5 -5
  951. package/esm/Core/{InteractionManager.js → Utils/InteractionManager.js} +4 -3
  952. package/{browser/Core → esm/Core/Utils}/ParticlesInteractorBase.d.ts +4 -4
  953. package/{browser/Core → esm/Core/Utils}/ParticlesInteractorBase.js +1 -2
  954. package/{Core/Particle/Mover.d.ts → esm/Core/Utils/ParticlesMover.d.ts} +2 -2
  955. package/esm/Core/{Particle/Mover.js → Utils/ParticlesMover.js} +4 -5
  956. package/{Utils → esm/Core/Utils}/Plugins.d.ts +5 -5
  957. package/esm/{Utils → Core/Utils}/Plugins.js +0 -0
  958. package/esm/{Utils → Core/Utils}/Point.d.ts +2 -2
  959. package/esm/{Utils → Core/Utils}/Point.js +0 -0
  960. package/esm/{Utils → Core/Utils}/QuadTree.d.ts +4 -4
  961. package/esm/{Utils → Core/Utils}/QuadTree.js +2 -2
  962. package/{Utils → esm/Core/Utils}/Range.d.ts +1 -1
  963. package/esm/{Utils → Core/Utils}/Range.js +0 -0
  964. package/{Utils → esm/Core/Utils}/Rectangle.d.ts +1 -2
  965. package/esm/{Utils → Core/Utils}/Rectangle.js +0 -0
  966. package/esm/Core/{Particle → Utils}/Vector.d.ts +0 -0
  967. package/esm/Core/{Particle → Utils}/Vector.js +0 -0
  968. package/{browser/Core/Particle → esm/Core/Utils}/Vector3d.d.ts +1 -1
  969. package/esm/Core/{Particle → Utils}/Vector3d.js +0 -0
  970. package/esm/Core/Utils/index.d.ts +16 -0
  971. package/esm/Core/Utils/index.js +16 -0
  972. package/esm/Core/index.d.ts +8 -0
  973. package/esm/Core/index.js +8 -0
  974. package/esm/Enums/AnimationStatus.d.ts +1 -1
  975. package/esm/Enums/AnimationStatus.js +1 -5
  976. package/esm/Enums/Directions/MoveDirection.d.ts +1 -1
  977. package/esm/Enums/Directions/MoveDirection.js +1 -12
  978. package/esm/Enums/Directions/OutModeDirection.d.ts +1 -1
  979. package/esm/Enums/Directions/OutModeDirection.js +1 -7
  980. package/esm/Enums/Directions/RotateDirection.d.ts +1 -1
  981. package/esm/Enums/Directions/RotateDirection.js +1 -6
  982. package/esm/Enums/Directions/TiltDirection.d.ts +1 -1
  983. package/esm/Enums/Directions/TiltDirection.js +1 -6
  984. package/esm/Enums/InteractivityDetect.d.ts +1 -1
  985. package/esm/Enums/InteractivityDetect.js +1 -6
  986. package/esm/Enums/Modes/ClickMode.d.ts +1 -1
  987. package/esm/Enums/Modes/ClickMode.js +1 -10
  988. package/esm/Enums/Modes/CollisionMode.d.ts +1 -1
  989. package/esm/Enums/Modes/CollisionMode.js +1 -6
  990. package/esm/Enums/Modes/DestroyMode.d.ts +1 -1
  991. package/esm/Enums/Modes/DestroyMode.js +1 -5
  992. package/esm/Enums/Modes/DivMode.d.ts +1 -1
  993. package/esm/Enums/Modes/DivMode.js +1 -6
  994. package/esm/Enums/Modes/HoverMode.d.ts +1 -1
  995. package/esm/Enums/Modes/HoverMode.js +1 -12
  996. package/esm/Enums/Modes/OutMode.d.ts +1 -1
  997. package/esm/Enums/Modes/OutMode.js +1 -10
  998. package/esm/Enums/Modes/ResponsiveMode.d.ts +1 -1
  999. package/esm/Enums/Modes/ResponsiveMode.js +1 -5
  1000. package/esm/Enums/Modes/RollMode.d.ts +1 -1
  1001. package/esm/Enums/Modes/RollMode.js +1 -6
  1002. package/esm/Enums/Modes/SizeMode.d.ts +1 -1
  1003. package/esm/Enums/Modes/SizeMode.js +1 -5
  1004. package/esm/Enums/Modes/ThemeMode.d.ts +1 -1
  1005. package/esm/Enums/Modes/ThemeMode.js +1 -6
  1006. package/esm/Enums/Types/AlterType.d.ts +1 -1
  1007. package/esm/Enums/Types/AlterType.js +1 -5
  1008. package/esm/Enums/Types/DestroyType.d.ts +1 -1
  1009. package/esm/Enums/Types/DestroyType.js +1 -6
  1010. package/esm/Enums/Types/DivType.d.ts +1 -1
  1011. package/esm/Enums/Types/DivType.js +1 -5
  1012. package/esm/Enums/Types/EasingType.d.ts +1 -1
  1013. package/esm/Enums/Types/EasingType.js +1 -11
  1014. package/esm/Enums/Types/GradientType.d.ts +1 -1
  1015. package/esm/Enums/Types/GradientType.js +1 -6
  1016. package/esm/Enums/Types/InteractorType.d.ts +1 -1
  1017. package/esm/Enums/Types/InteractorType.js +1 -5
  1018. package/esm/Enums/Types/OrbitType.d.ts +1 -1
  1019. package/esm/Enums/Types/OrbitType.js +1 -5
  1020. package/esm/Enums/Types/ShapeType.d.ts +1 -1
  1021. package/esm/Enums/Types/ShapeType.js +1 -14
  1022. package/esm/Enums/Types/StartValueType.d.ts +1 -1
  1023. package/esm/Enums/Types/StartValueType.js +1 -6
  1024. package/esm/Interactions/External/Attract/Attractor.d.ts +2 -2
  1025. package/esm/Interactions/External/Attract/Attractor.js +5 -7
  1026. package/esm/Interactions/External/Attract/index.d.ts +2 -2
  1027. package/esm/Interactions/External/Attract/index.js +2 -2
  1028. package/esm/Interactions/External/Bounce/Bouncer.d.ts +2 -2
  1029. package/esm/Interactions/External/Bounce/Bouncer.js +7 -9
  1030. package/esm/Interactions/External/Bounce/index.d.ts +2 -2
  1031. package/esm/Interactions/External/Bounce/index.js +2 -2
  1032. package/esm/Interactions/External/Bubble/Bubbler.d.ts +3 -3
  1033. package/esm/Interactions/External/Bubble/Bubbler.js +16 -18
  1034. package/esm/Interactions/External/Bubble/ProcessBubbleType.d.ts +1 -1
  1035. package/esm/Interactions/External/Bubble/ProcessBubbleType.js +1 -6
  1036. package/esm/Interactions/External/Bubble/index.d.ts +2 -2
  1037. package/esm/Interactions/External/Bubble/index.js +2 -2
  1038. package/esm/Interactions/External/Connect/Connector.d.ts +2 -2
  1039. package/esm/Interactions/External/Connect/Connector.js +2 -3
  1040. package/esm/Interactions/External/Connect/index.d.ts +2 -2
  1041. package/esm/Interactions/External/Connect/index.js +2 -2
  1042. package/esm/Interactions/External/Grab/Grabber.d.ts +2 -2
  1043. package/esm/Interactions/External/Grab/Grabber.js +3 -4
  1044. package/esm/Interactions/External/Grab/index.d.ts +2 -2
  1045. package/esm/Interactions/External/Grab/index.js +2 -2
  1046. package/esm/Interactions/External/Repulse/Repulser.d.ts +2 -2
  1047. package/esm/Interactions/External/Repulse/Repulser.js +8 -10
  1048. package/esm/Interactions/External/Repulse/index.d.ts +2 -2
  1049. package/esm/Interactions/External/Repulse/index.js +2 -2
  1050. package/esm/Interactions/External/Trail/TrailMaker.d.ts +2 -3
  1051. package/esm/Interactions/External/Trail/TrailMaker.js +3 -4
  1052. package/esm/Interactions/External/Trail/index.d.ts +2 -2
  1053. package/esm/Interactions/External/Trail/index.js +2 -2
  1054. package/esm/Interactions/Particles/Attract/Attractor.d.ts +2 -4
  1055. package/esm/Interactions/Particles/Attract/Attractor.js +1 -1
  1056. package/esm/Interactions/Particles/Attract/index.d.ts +2 -2
  1057. package/esm/Interactions/Particles/Attract/index.js +2 -2
  1058. package/esm/Interactions/Particles/Collisions/Collider.d.ts +2 -3
  1059. package/esm/Interactions/Particles/Collisions/Collider.js +4 -5
  1060. package/esm/Interactions/Particles/Collisions/index.d.ts +2 -2
  1061. package/esm/Interactions/Particles/Collisions/index.js +2 -2
  1062. package/esm/Interactions/Particles/Links/LinkInstance.d.ts +1 -3
  1063. package/esm/Interactions/Particles/Links/LinkParticle.d.ts +1 -1
  1064. package/esm/Interactions/Particles/Links/Linker.d.ts +3 -4
  1065. package/esm/Interactions/Particles/Links/Linker.js +2 -2
  1066. package/esm/Interactions/Particles/Links/index.d.ts +2 -3
  1067. package/esm/Interactions/Particles/Links/index.js +4 -7
  1068. package/esm/Interactions/Particles/Links/interaction.d.ts +2 -0
  1069. package/esm/Interactions/Particles/Links/interaction.js +4 -0
  1070. package/esm/Interactions/Particles/Links/plugin.d.ts +2 -2
  1071. package/esm/Interactions/Particles/Links/plugin.js +4 -4
  1072. package/esm/Options/Classes/AnimatableColor.d.ts +3 -3
  1073. package/esm/Options/Classes/AnimatableColor.js +1 -1
  1074. package/esm/Options/Classes/AnimatableGradient.d.ts +6 -6
  1075. package/esm/Options/Classes/AnimatableGradient.js +3 -4
  1076. package/esm/Options/Classes/AnimationOptions.d.ts +2 -2
  1077. package/esm/Options/Classes/Background/Background.d.ts +2 -2
  1078. package/esm/Options/Classes/BackgroundMask/BackgroundMask.d.ts +2 -2
  1079. package/esm/Options/Classes/BackgroundMask/BackgroundMaskCover.d.ts +2 -2
  1080. package/esm/Options/Classes/ColorAnimation.d.ts +1 -1
  1081. package/esm/Options/Classes/HslAnimation.d.ts +2 -2
  1082. package/esm/Options/Classes/Interactivity/Events/ClickEvent.d.ts +2 -2
  1083. package/esm/Options/Classes/Interactivity/Events/DivEvent.d.ts +1 -1
  1084. package/esm/Options/Classes/Interactivity/Events/DivEvent.js +1 -2
  1085. package/esm/Options/Classes/Interactivity/Events/Events.d.ts +2 -2
  1086. package/esm/Options/Classes/Interactivity/Events/HoverEvent.d.ts +3 -3
  1087. package/esm/Options/Classes/Interactivity/Events/Parallax.d.ts +1 -1
  1088. package/esm/Options/Classes/Interactivity/Interactivity.d.ts +2 -2
  1089. package/esm/Options/Classes/Interactivity/Interactivity.js +5 -6
  1090. package/esm/Options/Classes/Interactivity/Modes/Attract.d.ts +2 -2
  1091. package/esm/Options/Classes/Interactivity/Modes/Attract.js +1 -2
  1092. package/esm/Options/Classes/Interactivity/Modes/Bubble.d.ts +2 -2
  1093. package/esm/Options/Classes/Interactivity/Modes/Bubble.js +1 -1
  1094. package/esm/Options/Classes/Interactivity/Modes/BubbleBase.d.ts +1 -1
  1095. package/esm/Options/Classes/Interactivity/Modes/BubbleDiv.d.ts +1 -1
  1096. package/esm/Options/Classes/Interactivity/Modes/Connect.d.ts +2 -2
  1097. package/esm/Options/Classes/Interactivity/Modes/ConnectLinks.d.ts +1 -1
  1098. package/esm/Options/Classes/Interactivity/Modes/Grab.d.ts +2 -2
  1099. package/esm/Options/Classes/Interactivity/Modes/GrabLinks.d.ts +2 -2
  1100. package/esm/Options/Classes/Interactivity/Modes/Light.d.ts +1 -1
  1101. package/esm/Options/Classes/Interactivity/Modes/Modes.d.ts +7 -7
  1102. package/esm/Options/Classes/Interactivity/Modes/Modes.js +4 -4
  1103. package/esm/Options/Classes/Interactivity/Modes/Push.d.ts +1 -1
  1104. package/esm/Options/Classes/Interactivity/Modes/Remove.d.ts +1 -1
  1105. package/esm/Options/Classes/Interactivity/Modes/Repulse.d.ts +3 -3
  1106. package/esm/Options/Classes/Interactivity/Modes/Repulse.js +1 -1
  1107. package/esm/Options/Classes/Interactivity/Modes/RepulseBase.d.ts +2 -2
  1108. package/esm/Options/Classes/Interactivity/Modes/RepulseBase.js +1 -2
  1109. package/esm/Options/Classes/Interactivity/Modes/RepulseDiv.d.ts +1 -1
  1110. package/esm/Options/Classes/Interactivity/Modes/Slow.d.ts +1 -1
  1111. package/esm/Options/Classes/Interactivity/Modes/Trail.d.ts +2 -2
  1112. package/esm/Options/Classes/ManualParticle.d.ts +2 -2
  1113. package/esm/Options/Classes/Motion/Motion.d.ts +1 -1
  1114. package/esm/Options/Classes/Options.d.ts +7 -7
  1115. package/esm/Options/Classes/Options.js +13 -13
  1116. package/esm/Options/Classes/OptionsColor.d.ts +2 -2
  1117. package/esm/Options/Classes/Particles/Bounce/Bounce.d.ts +1 -1
  1118. package/esm/Options/Classes/Particles/Collisions/Collisions.d.ts +4 -4
  1119. package/esm/Options/Classes/Particles/Collisions/Collisions.js +1 -2
  1120. package/esm/Options/Classes/Particles/Collisions/CollisionsOverlap.d.ts +2 -2
  1121. package/esm/Options/Classes/Particles/Destroy/Destroy.d.ts +1 -1
  1122. package/esm/Options/Classes/Particles/Destroy/Destroy.js +1 -2
  1123. package/esm/Options/Classes/Particles/Destroy/Split.d.ts +3 -3
  1124. package/esm/Options/Classes/Particles/Life/Life.d.ts +1 -1
  1125. package/esm/Options/Classes/Particles/Links/Links.d.ts +2 -2
  1126. package/esm/Options/Classes/Particles/Links/LinksShadow.d.ts +2 -2
  1127. package/esm/Options/Classes/Particles/Links/LinksTriangle.d.ts +1 -1
  1128. package/esm/Options/Classes/Particles/Move/Attract.d.ts +2 -2
  1129. package/esm/Options/Classes/Particles/Move/Move.d.ts +5 -5
  1130. package/esm/Options/Classes/Particles/Move/Move.js +4 -5
  1131. package/esm/Options/Classes/Particles/Move/OutModes.d.ts +2 -2
  1132. package/esm/Options/Classes/Particles/Move/OutModes.js +1 -2
  1133. package/esm/Options/Classes/Particles/Move/Path/Path.d.ts +3 -3
  1134. package/esm/Options/Classes/Particles/Move/Spin.d.ts +3 -3
  1135. package/esm/Options/Classes/Particles/Move/Trail.d.ts +2 -2
  1136. package/esm/Options/Classes/Particles/Number/Density.d.ts +1 -1
  1137. package/esm/Options/Classes/Particles/Number/ParticlesNumber.d.ts +2 -2
  1138. package/esm/Options/Classes/Particles/Opacity/Opacity.d.ts +1 -1
  1139. package/esm/Options/Classes/Particles/Opacity/OpacityAnimation.d.ts +3 -3
  1140. package/esm/Options/Classes/Particles/Opacity/OpacityAnimation.js +2 -3
  1141. package/esm/Options/Classes/Particles/Orbit/Orbit.d.ts +5 -5
  1142. package/esm/Options/Classes/Particles/Orbit/Orbit.js +2 -2
  1143. package/esm/Options/Classes/Particles/Orbit/OrbitRotation.d.ts +1 -1
  1144. package/esm/Options/Classes/Particles/ParticlesOptions.d.ts +16 -16
  1145. package/esm/Options/Classes/Particles/ParticlesOptions.js +13 -13
  1146. package/esm/Options/Classes/Particles/Repulse/Repulse.d.ts +1 -1
  1147. package/esm/Options/Classes/Particles/Roll/Roll.d.ts +2 -2
  1148. package/esm/Options/Classes/Particles/Roll/Roll.js +1 -2
  1149. package/esm/Options/Classes/Particles/Roll/RollLight.d.ts +1 -1
  1150. package/esm/Options/Classes/Particles/Rotate/Rotate.d.ts +3 -3
  1151. package/esm/Options/Classes/Particles/Rotate/Rotate.js +1 -2
  1152. package/esm/Options/Classes/Particles/Rotate/RotateAnimation.d.ts +1 -1
  1153. package/esm/Options/Classes/Particles/Shadow.d.ts +3 -3
  1154. package/esm/Options/Classes/Particles/Shape/Shape.d.ts +5 -5
  1155. package/esm/Options/Classes/Particles/Shape/Shape.js +13 -14
  1156. package/esm/Options/Classes/Particles/Size/Size.d.ts +2 -2
  1157. package/esm/Options/Classes/Particles/Size/SizeAnimation.d.ts +3 -3
  1158. package/esm/Options/Classes/Particles/Size/SizeAnimation.js +2 -3
  1159. package/esm/Options/Classes/Particles/Stroke.d.ts +2 -2
  1160. package/esm/Options/Classes/Particles/Tilt/Tilt.d.ts +3 -3
  1161. package/esm/Options/Classes/Particles/Tilt/Tilt.js +1 -2
  1162. package/esm/Options/Classes/Particles/Tilt/TiltAnimation.d.ts +1 -1
  1163. package/esm/Options/Classes/Particles/Twinkle/Twinkle.d.ts +1 -1
  1164. package/esm/Options/Classes/Particles/Twinkle/TwinkleValues.d.ts +2 -2
  1165. package/esm/Options/Classes/Particles/Wobble/Wobble.d.ts +2 -2
  1166. package/esm/Options/Classes/Particles/ZIndex/ZIndex.d.ts +1 -1
  1167. package/esm/Options/Classes/Random.d.ts +1 -1
  1168. package/esm/Options/Classes/Responsive.d.ts +2 -2
  1169. package/esm/Options/Classes/Responsive.js +4 -5
  1170. package/esm/Options/Classes/Theme/Theme.d.ts +2 -2
  1171. package/esm/Options/Classes/Theme/Theme.js +1 -1
  1172. package/esm/Options/Classes/Theme/ThemeDefault.d.ts +2 -2
  1173. package/esm/Options/Classes/Theme/ThemeDefault.js +1 -2
  1174. package/esm/Options/Classes/ValueWithRandom.d.ts +2 -2
  1175. package/esm/Options/Interfaces/BackgroundMask/IBackgroundMask.d.ts +1 -1
  1176. package/esm/Options/Interfaces/IAnimatableColor.d.ts +1 -1
  1177. package/esm/Options/Interfaces/IAnimatableGradient.d.ts +1 -1
  1178. package/esm/Options/Interfaces/IColorAnimation.d.ts +1 -1
  1179. package/esm/Options/Interfaces/IManualParticle.d.ts +1 -1
  1180. package/esm/Options/Interfaces/IOptions.d.ts +6 -6
  1181. package/esm/Options/Interfaces/IOptionsGradient.d.ts +2 -2
  1182. package/esm/Options/Interfaces/IResponsive.d.ts +2 -2
  1183. package/esm/Options/Interfaces/IValueWithRandom.d.ts +1 -1
  1184. package/esm/Options/Interfaces/Interactivity/Events/IEvents.d.ts +1 -1
  1185. package/esm/Options/Interfaces/Interactivity/IInteractivity.d.ts +1 -1
  1186. package/esm/Options/Interfaces/Interactivity/Modes/IBubble.d.ts +2 -2
  1187. package/esm/Options/Interfaces/Interactivity/Modes/IBubbleBase.d.ts +1 -1
  1188. package/esm/Options/Interfaces/Interactivity/Modes/IModes.d.ts +2 -2
  1189. package/esm/Options/Interfaces/Interactivity/Modes/IRepulse.d.ts +2 -2
  1190. package/esm/Options/Interfaces/Interactivity/Modes/IRepulseDiv.d.ts +1 -1
  1191. package/esm/Options/Interfaces/Particles/Destroy/ISplit.d.ts +1 -1
  1192. package/esm/Options/Interfaces/Particles/IParticles.d.ts +14 -14
  1193. package/esm/Options/Interfaces/Particles/IShadow.d.ts +1 -1
  1194. package/esm/Options/Interfaces/Particles/IStroke.d.ts +1 -1
  1195. package/esm/Options/Interfaces/Particles/Links/ILinks.d.ts +1 -1
  1196. package/esm/Options/Interfaces/Particles/Move/IMove.d.ts +5 -5
  1197. package/esm/Options/Interfaces/Particles/Move/Path/{iPath.d.ts → IPath.d.ts} +0 -0
  1198. package/esm/{Plugins/PolygonMask/Options/Interfaces/IInline.js → Options/Interfaces/Particles/Move/Path/IPath.js} +0 -0
  1199. package/esm/Options/Interfaces/Particles/Orbit/IOrbit.d.ts +3 -3
  1200. package/esm/Options/Interfaces/Particles/Roll/IRoll.d.ts +1 -1
  1201. package/esm/Options/Interfaces/Particles/Rotate/IRotate.d.ts +1 -1
  1202. package/esm/Options/Interfaces/Particles/Shape/IShape.d.ts +3 -3
  1203. package/esm/Options/Interfaces/Particles/Tilt/ITilt.d.ts +1 -1
  1204. package/esm/Options/Interfaces/Theme/ITheme.d.ts +2 -2
  1205. package/esm/Plugins/Absorbers/AbsorberContainer.d.ts +1 -1
  1206. package/esm/Plugins/Absorbers/AbsorberInstance.d.ts +6 -7
  1207. package/esm/Plugins/Absorbers/AbsorberInstance.js +22 -23
  1208. package/esm/Plugins/Absorbers/Absorbers.d.ts +4 -7
  1209. package/esm/Plugins/Absorbers/Absorbers.js +2 -3
  1210. package/esm/Plugins/Absorbers/Enums/AbsorberClickMode.d.ts +1 -1
  1211. package/esm/Plugins/Absorbers/Enums/AbsorberClickMode.js +1 -4
  1212. package/esm/Plugins/Absorbers/Options/Classes/Absorber.d.ts +4 -4
  1213. package/esm/Plugins/Absorbers/Options/Classes/AbsorberSize.d.ts +2 -2
  1214. package/esm/Plugins/Absorbers/Options/Classes/AbsorberSize.js +1 -1
  1215. package/esm/Plugins/Absorbers/Options/Classes/AbsorberSizeLimit.d.ts +2 -2
  1216. package/esm/Plugins/Absorbers/Options/Interfaces/IAbsorber.d.ts +1 -2
  1217. package/esm/Plugins/Absorbers/Options/Interfaces/IAbsorberOptions.d.ts +1 -1
  1218. package/esm/Plugins/Absorbers/Options/Interfaces/IAbsorberSize.d.ts +1 -1
  1219. package/esm/Plugins/Absorbers/index.d.ts +2 -0
  1220. package/esm/Plugins/Absorbers/{plugin.js → index.js} +6 -7
  1221. package/esm/Plugins/Emitters/EmitterContainer.d.ts +2 -1
  1222. package/esm/Plugins/Emitters/EmitterInstance.d.ts +6 -5
  1223. package/esm/Plugins/Emitters/EmitterInstance.js +37 -39
  1224. package/esm/Plugins/Emitters/Emitters.d.ts +4 -5
  1225. package/esm/Plugins/Emitters/Emitters.js +12 -5
  1226. package/esm/Plugins/Emitters/EmittersMain.d.ts +2 -2
  1227. package/esm/Plugins/Emitters/Enums/EmitterClickMode.d.ts +1 -1
  1228. package/esm/Plugins/Emitters/Enums/EmitterClickMode.js +1 -4
  1229. package/esm/Plugins/Emitters/Enums/EmitterShapeType.d.ts +1 -1
  1230. package/esm/Plugins/Emitters/Enums/EmitterShapeType.js +1 -5
  1231. package/esm/Plugins/Emitters/IEmitterShape.d.ts +1 -1
  1232. package/esm/Plugins/Emitters/Options/Classes/Emitter.d.ts +7 -7
  1233. package/esm/Plugins/Emitters/Options/Classes/Emitter.js +4 -5
  1234. package/esm/Plugins/Emitters/Options/Classes/EmitterLife.d.ts +1 -1
  1235. package/esm/Plugins/Emitters/Options/Classes/EmitterRate.d.ts +1 -1
  1236. package/esm/Plugins/Emitters/Options/Classes/EmitterSize.d.ts +1 -1
  1237. package/esm/Plugins/Emitters/Options/Classes/EmitterSize.js +1 -2
  1238. package/esm/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +6 -6
  1239. package/esm/Plugins/Emitters/Options/Interfaces/IEmitterOptions.d.ts +1 -1
  1240. package/esm/Plugins/Emitters/Options/Interfaces/IEmitterSize.d.ts +1 -1
  1241. package/esm/Plugins/Emitters/Shapes/Circle/CircleShape.d.ts +1 -1
  1242. package/esm/Plugins/Emitters/Shapes/Square/SquareShape.d.ts +1 -1
  1243. package/esm/Plugins/Emitters/index.d.ts +3 -0
  1244. package/esm/Plugins/Emitters/{plugin.js → index.js} +10 -11
  1245. package/esm/Plugins/PolygonMask/Enums/PolygonMaskInlineArrangement.d.ts +8 -0
  1246. package/esm/Plugins/PolygonMask/{Options/Interfaces/ILocalSvg.js → Enums/PolygonMaskInlineArrangement.js} +0 -0
  1247. package/esm/Plugins/PolygonMask/Enums/PolygonMaskMoveType.d.ts +4 -0
  1248. package/esm/Plugins/PolygonMask/{Options/Interfaces/IMove.js → Enums/PolygonMaskMoveType.js} +0 -0
  1249. package/{browser/Plugins/PolygonMask/Enums/Type.d.ts → esm/Plugins/PolygonMask/Enums/PolygonMaskType.d.ts} +1 -1
  1250. package/esm/Plugins/PolygonMask/{types.js → Enums/PolygonMaskType.js} +0 -0
  1251. package/esm/Plugins/PolygonMask/Enums/index.d.ts +3 -3
  1252. package/esm/Plugins/PolygonMask/Enums/index.js +3 -3
  1253. package/esm/Plugins/PolygonMask/Options/Classes/PolygonMask.d.ts +14 -14
  1254. package/esm/Plugins/PolygonMask/Options/Classes/PolygonMask.js +42 -42
  1255. package/esm/Plugins/PolygonMask/Options/Classes/{Draw.d.ts → PolygonMaskDraw.d.ts} +7 -7
  1256. package/esm/Plugins/PolygonMask/Options/Classes/{Draw.js → PolygonMaskDraw.js} +13 -12
  1257. package/esm/Plugins/PolygonMask/Options/Classes/{DrawStroke.d.ts → PolygonMaskDrawStroke.d.ts} +5 -5
  1258. package/esm/Plugins/PolygonMask/Options/Classes/PolygonMaskDrawStroke.js +25 -0
  1259. package/esm/Plugins/PolygonMask/Options/Classes/PolygonMaskInline.d.ts +9 -0
  1260. package/esm/Plugins/PolygonMask/Options/Classes/PolygonMaskInline.js +13 -0
  1261. package/esm/Plugins/PolygonMask/Options/Classes/PolygonMaskLocalSvg.d.ts +11 -0
  1262. package/esm/Plugins/PolygonMask/Options/Classes/PolygonMaskLocalSvg.js +25 -0
  1263. package/esm/Plugins/PolygonMask/Options/Classes/PolygonMaskMove.d.ts +10 -0
  1264. package/esm/Plugins/PolygonMask/Options/Classes/PolygonMaskMove.js +17 -0
  1265. package/esm/Plugins/PolygonMask/Options/Interfaces/IPolygonMask.d.ts +12 -13
  1266. package/esm/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskDraw.d.ts +8 -0
  1267. package/esm/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskDraw.js +1 -0
  1268. package/esm/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskDrawStroke.d.ts +6 -0
  1269. package/esm/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskDrawStroke.js +1 -0
  1270. package/esm/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskInline.d.ts +4 -0
  1271. package/esm/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskInline.js +1 -0
  1272. package/esm/Plugins/PolygonMask/Options/Interfaces/{ILocalSvg.d.ts → IPolygonMaskLocalSvg.d.ts} +2 -2
  1273. package/esm/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskLocalSvg.js +1 -0
  1274. package/esm/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskMove.d.ts +5 -0
  1275. package/esm/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskMove.js +1 -0
  1276. package/esm/Plugins/PolygonMask/PolygonMaskInstance.d.ts +4 -6
  1277. package/esm/Plugins/PolygonMask/PolygonMaskInstance.js +24 -21
  1278. package/{browser/Plugins/PolygonMask/types.d.ts → esm/Plugins/PolygonMask/Types.d.ts} +1 -1
  1279. package/esm/Plugins/PolygonMask/Types.js +1 -0
  1280. package/{browser/Plugins/PolygonMask/utils.d.ts → esm/Plugins/PolygonMask/Utils.d.ts} +5 -5
  1281. package/esm/Plugins/PolygonMask/{utils.js → Utils.js} +15 -12
  1282. package/esm/Plugins/PolygonMask/index.d.ts +2 -0
  1283. package/esm/Plugins/PolygonMask/{plugin.js → index.js} +7 -8
  1284. package/esm/Plugins/PolygonMask/pathseg.js +54 -43
  1285. package/esm/Shapes/Circle/CircleDrawer.d.ts +1 -1
  1286. package/esm/Shapes/Circle/index.d.ts +2 -2
  1287. package/esm/Shapes/Circle/index.js +2 -2
  1288. package/esm/Shapes/Image/ImageDrawer.d.ts +3 -7
  1289. package/esm/Shapes/Image/ImageDrawer.js +28 -108
  1290. package/esm/Shapes/Image/Utils.d.ts +8 -5
  1291. package/esm/Shapes/Image/Utils.js +67 -36
  1292. package/esm/Shapes/Image/index.d.ts +2 -2
  1293. package/esm/Shapes/Image/index.js +3 -3
  1294. package/esm/Shapes/Line/LineDrawer.d.ts +1 -1
  1295. package/esm/Shapes/Line/index.d.ts +2 -2
  1296. package/esm/Shapes/Line/index.js +2 -2
  1297. package/esm/Shapes/Polygon/PolygonDrawer.d.ts +1 -1
  1298. package/esm/Shapes/Polygon/PolygonDrawerBase.d.ts +1 -1
  1299. package/esm/Shapes/Polygon/TriangleDrawer.d.ts +1 -1
  1300. package/esm/Shapes/Polygon/index.d.ts +4 -4
  1301. package/esm/Shapes/Polygon/index.js +7 -7
  1302. package/esm/Shapes/Square/SquareDrawer.d.ts +1 -1
  1303. package/esm/Shapes/Square/index.d.ts +2 -2
  1304. package/esm/Shapes/Square/index.js +3 -3
  1305. package/esm/Shapes/Star/StarDrawer.d.ts +1 -1
  1306. package/esm/Shapes/Star/index.d.ts +2 -2
  1307. package/esm/Shapes/Star/index.js +2 -2
  1308. package/esm/Shapes/Text/TextDrawer.d.ts +1 -2
  1309. package/esm/Shapes/Text/index.d.ts +2 -2
  1310. package/esm/Shapes/Text/index.js +3 -3
  1311. package/esm/Types/ShapeData.d.ts +1 -1
  1312. package/esm/Types/ShapeDrawerFunctions.d.ts +1 -1
  1313. package/esm/Updaters/Angle/AngleUpdater.d.ts +1 -3
  1314. package/esm/Updaters/Angle/AngleUpdater.js +8 -9
  1315. package/esm/Updaters/Angle/index.d.ts +2 -2
  1316. package/esm/Updaters/Angle/index.js +2 -2
  1317. package/esm/Updaters/Color/ColorUpdater.d.ts +1 -3
  1318. package/esm/Updaters/Color/ColorUpdater.js +3 -4
  1319. package/esm/Updaters/Color/index.d.ts +2 -2
  1320. package/esm/Updaters/Color/index.js +2 -2
  1321. package/esm/Updaters/Life/LifeUpdater.d.ts +1 -3
  1322. package/esm/Updaters/Life/index.d.ts +2 -2
  1323. package/esm/Updaters/Life/index.js +2 -2
  1324. package/esm/Updaters/Opacity/OpacityUpdater.d.ts +1 -3
  1325. package/esm/Updaters/Opacity/OpacityUpdater.js +13 -14
  1326. package/esm/Updaters/Opacity/index.d.ts +2 -2
  1327. package/esm/Updaters/Opacity/index.js +2 -2
  1328. package/esm/Updaters/OutModes/IBounceData.d.ts +1 -2
  1329. package/esm/Updaters/OutModes/OutOfCanvasUpdater.d.ts +1 -3
  1330. package/esm/Updaters/OutModes/OutOfCanvasUpdater.js +20 -21
  1331. package/esm/Updaters/OutModes/Utils.js +12 -13
  1332. package/esm/Updaters/OutModes/index.d.ts +2 -2
  1333. package/esm/Updaters/OutModes/index.js +2 -2
  1334. package/esm/Updaters/Roll/RollUpdater.d.ts +1 -2
  1335. package/esm/Updaters/Roll/RollUpdater.js +4 -5
  1336. package/esm/Updaters/Roll/index.d.ts +2 -2
  1337. package/esm/Updaters/Roll/index.js +2 -2
  1338. package/esm/Updaters/Size/SizeUpdater.d.ts +1 -2
  1339. package/esm/Updaters/Size/SizeUpdater.js +6 -7
  1340. package/esm/Updaters/Size/index.d.ts +2 -2
  1341. package/esm/Updaters/Size/index.js +2 -2
  1342. package/esm/Updaters/StrokeColor/StrokeColorUpdater.d.ts +1 -3
  1343. package/esm/Updaters/StrokeColor/StrokeColorUpdater.js +3 -4
  1344. package/esm/Updaters/StrokeColor/index.d.ts +2 -2
  1345. package/esm/Updaters/StrokeColor/index.js +2 -2
  1346. package/esm/Updaters/Tilt/TiltUpdater.d.ts +1 -3
  1347. package/esm/Updaters/Tilt/TiltUpdater.js +8 -9
  1348. package/esm/Updaters/Tilt/index.d.ts +2 -2
  1349. package/esm/Updaters/Tilt/index.js +2 -2
  1350. package/esm/Updaters/Wobble/WobbleUpdater.d.ts +1 -3
  1351. package/esm/Updaters/Wobble/index.d.ts +2 -2
  1352. package/esm/Updaters/Wobble/index.js +2 -2
  1353. package/esm/Utils/CanvasUtils.d.ts +3 -4
  1354. package/esm/Utils/CanvasUtils.js +5 -6
  1355. package/esm/Utils/ColorUtils.d.ts +1 -1
  1356. package/esm/Utils/ColorUtils.js +3 -4
  1357. package/esm/Utils/NumberUtils.d.ts +3 -3
  1358. package/esm/Utils/NumberUtils.js +18 -19
  1359. package/esm/Utils/Utils.d.ts +3 -3
  1360. package/esm/Utils/Utils.js +6 -7
  1361. package/esm/Utils/index.d.ts +0 -9
  1362. package/esm/Utils/index.js +0 -9
  1363. package/{main.d.ts → esm/engine.d.ts} +3 -5
  1364. package/esm/{main.js → engine.js} +8 -9
  1365. package/esm/full.d.ts +2 -2
  1366. package/esm/full.js +14 -14
  1367. package/esm/index.d.ts +7 -17
  1368. package/esm/index.engine.d.ts +13 -0
  1369. package/esm/index.engine.js +11 -0
  1370. package/esm/index.js +5 -13
  1371. package/esm/index.slim.d.ts +6 -16
  1372. package/esm/index.slim.js +5 -13
  1373. package/esm/pjs.d.ts +3 -3
  1374. package/esm/pjs.js +6 -5
  1375. package/esm/slim.d.ts +2 -2
  1376. package/esm/slim.js +40 -40
  1377. package/full.d.ts +2 -2
  1378. package/full.js +14 -14
  1379. package/index.d.ts +7 -17
  1380. package/index.engine.d.ts +13 -0
  1381. package/index.engine.js +27 -0
  1382. package/index.js +7 -19
  1383. package/index.slim.d.ts +6 -16
  1384. package/index.slim.js +7 -19
  1385. package/package.json +11 -5
  1386. package/pjs.d.ts +3 -3
  1387. package/pjs.js +6 -5
  1388. package/report.html +2 -2
  1389. package/report.slim.html +2 -2
  1390. package/slim.d.ts +2 -2
  1391. package/slim.js +40 -40
  1392. package/tsparticles.engine.js +6748 -0
  1393. package/tsparticles.engine.min.js +2 -0
  1394. package/tsparticles.interaction.external.attract.js +4978 -0
  1395. package/tsparticles.interaction.external.attract.min.js +2 -0
  1396. package/tsparticles.interaction.external.bounce.js +4999 -0
  1397. package/tsparticles.interaction.external.bounce.min.js +2 -0
  1398. package/tsparticles.interaction.external.bubble.js +5085 -0
  1399. package/tsparticles.interaction.external.bubble.min.js +2 -0
  1400. package/tsparticles.interaction.external.connect.js +4847 -0
  1401. package/tsparticles.interaction.external.connect.min.js +2 -0
  1402. package/tsparticles.interaction.external.grab.js +4853 -0
  1403. package/tsparticles.interaction.external.grab.min.js +2 -0
  1404. package/tsparticles.interaction.external.repulse.js +5030 -0
  1405. package/tsparticles.interaction.external.repulse.min.js +2 -0
  1406. package/tsparticles.interaction.external.trail.js +4855 -0
  1407. package/tsparticles.interaction.external.trail.min.js +2 -0
  1408. package/tsparticles.interaction.particles.attract.js +4836 -0
  1409. package/tsparticles.interaction.particles.attract.min.js +2 -0
  1410. package/tsparticles.interaction.particles.collisions.js +5001 -0
  1411. package/tsparticles.interaction.particles.collisions.min.js +2 -0
  1412. package/tsparticles.interaction.particles.links.js +5073 -0
  1413. package/tsparticles.interaction.particles.links.min.js +2 -0
  1414. package/tsparticles.js +6693 -6994
  1415. package/tsparticles.min.js +2 -2
  1416. package/tsparticles.pathseg.min.js +2 -0
  1417. package/tsparticles.plugins.absorbers.js +5333 -0
  1418. package/tsparticles.plugins.absorbers.min.js +2 -0
  1419. package/tsparticles.plugins.emitters.js +5428 -0
  1420. package/tsparticles.plugins.emitters.min.js +2 -0
  1421. package/tsparticles.plugins.polygonMask.js +5864 -0
  1422. package/tsparticles.plugins.polygonMask.min.js +2 -0
  1423. package/tsparticles.shape.circle.js +59 -0
  1424. package/tsparticles.shape.circle.min.js +2 -0
  1425. package/tsparticles.shape.image.js +5023 -0
  1426. package/tsparticles.shape.image.min.js +2 -0
  1427. package/tsparticles.shape.line.js +60 -0
  1428. package/tsparticles.shape.line.min.js +2 -0
  1429. package/tsparticles.shape.polygon.js +131 -0
  1430. package/tsparticles.shape.polygon.min.js +2 -0
  1431. package/tsparticles.shape.square.js +62 -0
  1432. package/tsparticles.shape.square.min.js +2 -0
  1433. package/tsparticles.shape.star.js +71 -0
  1434. package/tsparticles.shape.star.min.js +2 -0
  1435. package/tsparticles.shape.text.js +4867 -0
  1436. package/tsparticles.shape.text.min.js +2 -0
  1437. package/tsparticles.slim.js +3960 -4220
  1438. package/tsparticles.slim.min.js +2 -2
  1439. package/tsparticles.updater.angle.js +4882 -0
  1440. package/tsparticles.updater.angle.min.js +2 -0
  1441. package/tsparticles.updater.color.js +4864 -0
  1442. package/tsparticles.updater.color.min.js +2 -0
  1443. package/tsparticles.updater.life.js +4866 -0
  1444. package/tsparticles.updater.life.min.js +2 -0
  1445. package/tsparticles.updater.opacity.js +4916 -0
  1446. package/tsparticles.updater.opacity.min.js +2 -0
  1447. package/tsparticles.updater.outModes.js +5000 -0
  1448. package/tsparticles.updater.outModes.min.js +2 -0
  1449. package/tsparticles.updater.roll.js +4864 -0
  1450. package/tsparticles.updater.roll.min.js +2 -0
  1451. package/tsparticles.updater.size.js +4872 -0
  1452. package/tsparticles.updater.size.min.js +2 -0
  1453. package/tsparticles.updater.strokeColor.js +4877 -0
  1454. package/tsparticles.updater.strokeColor.min.js +2 -0
  1455. package/tsparticles.updater.tilt.js +4883 -0
  1456. package/tsparticles.updater.tilt.min.js +2 -0
  1457. package/tsparticles.updater.wobble.js +4852 -0
  1458. package/tsparticles.updater.wobble.min.js +2 -0
  1459. package/Plugins/Absorbers/plugin.d.ts +0 -2
  1460. package/Plugins/Emitters/plugin.d.ts +0 -3
  1461. package/Plugins/PolygonMask/Enums/InlineArrangement.d.ts +0 -8
  1462. package/Plugins/PolygonMask/Enums/InlineArrangement.js +0 -11
  1463. package/Plugins/PolygonMask/Enums/MoveType.d.ts +0 -4
  1464. package/Plugins/PolygonMask/Enums/MoveType.js +0 -8
  1465. package/Plugins/PolygonMask/Enums/Type.js +0 -10
  1466. package/Plugins/PolygonMask/Options/Classes/DrawStroke.js +0 -28
  1467. package/Plugins/PolygonMask/Options/Classes/Inline.d.ts +0 -9
  1468. package/Plugins/PolygonMask/Options/Classes/Inline.js +0 -17
  1469. package/Plugins/PolygonMask/Options/Classes/LocalSvg.d.ts +0 -11
  1470. package/Plugins/PolygonMask/Options/Classes/LocalSvg.js +0 -28
  1471. package/Plugins/PolygonMask/Options/Classes/Move.d.ts +0 -10
  1472. package/Plugins/PolygonMask/Options/Classes/Move.js +0 -21
  1473. package/Plugins/PolygonMask/Options/Interfaces/IDraw.d.ts +0 -8
  1474. package/Plugins/PolygonMask/Options/Interfaces/IDrawStroke.d.ts +0 -6
  1475. package/Plugins/PolygonMask/Options/Interfaces/IInline.d.ts +0 -4
  1476. package/Plugins/PolygonMask/Options/Interfaces/IMove.d.ts +0 -5
  1477. package/Plugins/PolygonMask/plugin.d.ts +0 -2
  1478. package/browser/Plugins/Absorbers/plugin.d.ts +0 -2
  1479. package/browser/Plugins/Emitters/plugin.d.ts +0 -3
  1480. package/browser/Plugins/PolygonMask/Enums/InlineArrangement.d.ts +0 -8
  1481. package/browser/Plugins/PolygonMask/Enums/InlineArrangement.js +0 -8
  1482. package/browser/Plugins/PolygonMask/Enums/MoveType.d.ts +0 -4
  1483. package/browser/Plugins/PolygonMask/Enums/MoveType.js +0 -5
  1484. package/browser/Plugins/PolygonMask/Enums/Type.js +0 -7
  1485. package/browser/Plugins/PolygonMask/Options/Classes/DrawStroke.js +0 -27
  1486. package/browser/Plugins/PolygonMask/Options/Classes/Inline.d.ts +0 -12
  1487. package/browser/Plugins/PolygonMask/Options/Classes/Inline.js +0 -16
  1488. package/browser/Plugins/PolygonMask/Options/Classes/LocalSvg.js +0 -27
  1489. package/browser/Plugins/PolygonMask/Options/Classes/Move.d.ts +0 -13
  1490. package/browser/Plugins/PolygonMask/Options/Classes/Move.js +0 -20
  1491. package/browser/Plugins/PolygonMask/Options/Interfaces/IInline.d.ts +0 -7
  1492. package/browser/Plugins/PolygonMask/Options/Interfaces/IMove.d.ts +0 -8
  1493. package/browser/Plugins/PolygonMask/plugin.d.ts +0 -2
  1494. package/esm/Plugins/Absorbers/plugin.d.ts +0 -2
  1495. package/esm/Plugins/Emitters/plugin.d.ts +0 -3
  1496. package/esm/Plugins/PolygonMask/Enums/InlineArrangement.d.ts +0 -8
  1497. package/esm/Plugins/PolygonMask/Enums/InlineArrangement.js +0 -8
  1498. package/esm/Plugins/PolygonMask/Enums/MoveType.d.ts +0 -4
  1499. package/esm/Plugins/PolygonMask/Enums/MoveType.js +0 -5
  1500. package/esm/Plugins/PolygonMask/Enums/Type.js +0 -7
  1501. package/esm/Plugins/PolygonMask/Options/Classes/DrawStroke.js +0 -24
  1502. package/esm/Plugins/PolygonMask/Options/Classes/Inline.d.ts +0 -9
  1503. package/esm/Plugins/PolygonMask/Options/Classes/Inline.js +0 -13
  1504. package/esm/Plugins/PolygonMask/Options/Classes/LocalSvg.d.ts +0 -11
  1505. package/esm/Plugins/PolygonMask/Options/Classes/LocalSvg.js +0 -24
  1506. package/esm/Plugins/PolygonMask/Options/Classes/Move.d.ts +0 -10
  1507. package/esm/Plugins/PolygonMask/Options/Classes/Move.js +0 -17
  1508. package/esm/Plugins/PolygonMask/Options/Interfaces/IDraw.d.ts +0 -8
  1509. package/esm/Plugins/PolygonMask/Options/Interfaces/IDrawStroke.d.ts +0 -6
  1510. package/esm/Plugins/PolygonMask/Options/Interfaces/IInline.d.ts +0 -4
  1511. package/esm/Plugins/PolygonMask/Options/Interfaces/IMove.d.ts +0 -5
  1512. package/esm/Plugins/PolygonMask/plugin.d.ts +0 -2
  1513. package/tsparticles.pathseg.js +0 -1472
@@ -0,0 +1,5001 @@
1
+ (function webpackUniversalModuleDefinition(root, factory) {
2
+ if (typeof exports === "object" && typeof module === "object") module.exports = factory(); else if (typeof define === "function" && define.amd) define([], factory); else {
3
+ var a = factory();
4
+ for (var i in a) (typeof exports === "object" ? exports : root)[i] = a[i];
5
+ }
6
+ })(window, (function() {
7
+ return function() {
8
+ "use strict";
9
+ var __webpack_require__ = {};
10
+ !function() {
11
+ __webpack_require__.d = function(exports, definition) {
12
+ for (var key in definition) {
13
+ if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
14
+ Object.defineProperty(exports, key, {
15
+ enumerable: true,
16
+ get: definition[key]
17
+ });
18
+ }
19
+ }
20
+ };
21
+ }();
22
+ !function() {
23
+ __webpack_require__.o = function(obj, prop) {
24
+ return Object.prototype.hasOwnProperty.call(obj, prop);
25
+ };
26
+ }();
27
+ !function() {
28
+ __webpack_require__.r = function(exports) {
29
+ if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
30
+ Object.defineProperty(exports, Symbol.toStringTag, {
31
+ value: "Module"
32
+ });
33
+ }
34
+ Object.defineProperty(exports, "__esModule", {
35
+ value: true
36
+ });
37
+ };
38
+ }();
39
+ var __webpack_exports__ = {};
40
+ __webpack_require__.r(__webpack_exports__);
41
+ __webpack_require__.d(__webpack_exports__, {
42
+ loadParticlesCollisionsInteraction: function() {
43
+ return loadParticlesCollisionsInteraction;
44
+ }
45
+ });
46
+ class Circle_Circle extends(null && Range){
47
+ constructor(x, y, radius) {
48
+ super(x, y);
49
+ this.radius = radius;
50
+ }
51
+ contains(point) {
52
+ return getDistance(point, this.position) <= this.radius;
53
+ }
54
+ intersects(range) {
55
+ const rect = range;
56
+ const circle = range;
57
+ const pos1 = this.position;
58
+ const pos2 = range.position;
59
+ const xDist = Math.abs(pos2.x - pos1.x);
60
+ const yDist = Math.abs(pos2.y - pos1.y);
61
+ const r = this.radius;
62
+ if (circle.radius !== undefined) {
63
+ const rSum = r + circle.radius;
64
+ const dist = Math.sqrt(xDist * xDist + yDist + yDist);
65
+ return rSum > dist;
66
+ } else if (rect.size !== undefined) {
67
+ const w = rect.size.width;
68
+ const h = rect.size.height;
69
+ const edges = Math.pow(xDist - w, 2) + Math.pow(yDist - h, 2);
70
+ if (xDist > r + w || yDist > r + h) {
71
+ return false;
72
+ }
73
+ if (xDist <= w || yDist <= h) {
74
+ return true;
75
+ }
76
+ return edges <= r * r;
77
+ }
78
+ return false;
79
+ }
80
+ }
81
+ class CircleWarp_CircleWarp extends(null && Circle){
82
+ constructor(x, y, radius, canvasSize) {
83
+ super(x, y, radius);
84
+ this.canvasSize = canvasSize;
85
+ this.canvasSize = {
86
+ height: canvasSize.height,
87
+ width: canvasSize.width
88
+ };
89
+ }
90
+ contains(point) {
91
+ if (super.contains(point)) {
92
+ return true;
93
+ }
94
+ const posNE = {
95
+ x: point.x - this.canvasSize.width,
96
+ y: point.y
97
+ };
98
+ if (super.contains(posNE)) {
99
+ return true;
100
+ }
101
+ const posSE = {
102
+ x: point.x - this.canvasSize.width,
103
+ y: point.y - this.canvasSize.height
104
+ };
105
+ if (super.contains(posSE)) {
106
+ return true;
107
+ }
108
+ const posSW = {
109
+ x: point.x,
110
+ y: point.y - this.canvasSize.height
111
+ };
112
+ return super.contains(posSW);
113
+ }
114
+ intersects(range) {
115
+ if (super.intersects(range)) {
116
+ return true;
117
+ }
118
+ const rect = range;
119
+ const circle = range;
120
+ const newPos = {
121
+ x: range.position.x - this.canvasSize.width,
122
+ y: range.position.y - this.canvasSize.height
123
+ };
124
+ if (circle.radius !== undefined) {
125
+ const biggerCircle = new Circle(newPos.x, newPos.y, circle.radius * 2);
126
+ return super.intersects(biggerCircle);
127
+ } else if (rect.size !== undefined) {
128
+ const rectSW = new Rectangle(newPos.x, newPos.y, rect.size.width * 2, rect.size.height * 2);
129
+ return super.intersects(rectSW);
130
+ }
131
+ return false;
132
+ }
133
+ }
134
+ class Constants_Constants {}
135
+ Constants_Constants.generatedAttribute = "generated";
136
+ Constants_Constants.randomColorValue = "random";
137
+ Constants_Constants.midColorValue = "mid";
138
+ Constants_Constants.touchEndEvent = "touchend";
139
+ Constants_Constants.mouseDownEvent = "mousedown";
140
+ Constants_Constants.mouseUpEvent = "mouseup";
141
+ Constants_Constants.mouseMoveEvent = "mousemove";
142
+ Constants_Constants.touchStartEvent = "touchstart";
143
+ Constants_Constants.touchMoveEvent = "touchmove";
144
+ Constants_Constants.mouseLeaveEvent = "mouseleave";
145
+ Constants_Constants.mouseOutEvent = "mouseout";
146
+ Constants_Constants.touchCancelEvent = "touchcancel";
147
+ Constants_Constants.resizeEvent = "resize";
148
+ Constants_Constants.visibilityChangeEvent = "visibilitychange";
149
+ Constants_Constants.noPolygonDataLoaded = "No polygon data loaded.";
150
+ Constants_Constants.noPolygonFound = "No polygon found, you need to specify SVG url in config.";
151
+ function manageListener(element, event, handler, add, options) {
152
+ if (add) {
153
+ let addOptions = {
154
+ passive: true
155
+ };
156
+ if (typeof options === "boolean") {
157
+ addOptions.capture = options;
158
+ } else if (options !== undefined) {
159
+ addOptions = options;
160
+ }
161
+ element.addEventListener(event, handler, addOptions);
162
+ } else {
163
+ const removeOptions = options;
164
+ element.removeEventListener(event, handler, removeOptions);
165
+ }
166
+ }
167
+ class EventListeners_EventListeners {
168
+ constructor(container) {
169
+ this.container = container;
170
+ this.canPush = true;
171
+ this.mouseMoveHandler = e => this.mouseTouchMove(e);
172
+ this.touchStartHandler = e => this.mouseTouchMove(e);
173
+ this.touchMoveHandler = e => this.mouseTouchMove(e);
174
+ this.touchEndHandler = () => this.mouseTouchFinish();
175
+ this.mouseLeaveHandler = () => this.mouseTouchFinish();
176
+ this.touchCancelHandler = () => this.mouseTouchFinish();
177
+ this.touchEndClickHandler = e => this.mouseTouchClick(e);
178
+ this.mouseUpHandler = e => this.mouseTouchClick(e);
179
+ this.mouseDownHandler = () => this.mouseDown();
180
+ this.visibilityChangeHandler = () => this.handleVisibilityChange();
181
+ this.themeChangeHandler = e => this.handleThemeChange(e);
182
+ this.oldThemeChangeHandler = e => this.handleThemeChange(e);
183
+ this.resizeHandler = () => this.handleWindowResize();
184
+ }
185
+ addListeners() {
186
+ this.manageListeners(true);
187
+ }
188
+ removeListeners() {
189
+ this.manageListeners(false);
190
+ }
191
+ manageListeners(add) {
192
+ var _a;
193
+ const container = this.container;
194
+ const options = container.actualOptions;
195
+ const detectType = options.interactivity.detectsOn;
196
+ let mouseLeaveEvent = Constants.mouseLeaveEvent;
197
+ if (detectType === "window") {
198
+ container.interactivity.element = window;
199
+ mouseLeaveEvent = Constants.mouseOutEvent;
200
+ } else if (detectType === "parent" && container.canvas.element) {
201
+ const canvasEl = container.canvas.element;
202
+ container.interactivity.element = (_a = canvasEl.parentElement) !== null && _a !== void 0 ? _a : canvasEl.parentNode;
203
+ } else {
204
+ container.interactivity.element = container.canvas.element;
205
+ }
206
+ const mediaMatch = !isSsr() && typeof matchMedia !== "undefined" && matchMedia("(prefers-color-scheme: dark)");
207
+ if (mediaMatch) {
208
+ if (mediaMatch.addEventListener !== undefined) {
209
+ manageListener(mediaMatch, "change", this.themeChangeHandler, add);
210
+ } else if (mediaMatch.addListener !== undefined) {
211
+ if (add) {
212
+ mediaMatch.addListener(this.oldThemeChangeHandler);
213
+ } else {
214
+ mediaMatch.removeListener(this.oldThemeChangeHandler);
215
+ }
216
+ }
217
+ }
218
+ const interactivityEl = container.interactivity.element;
219
+ if (!interactivityEl) {
220
+ return;
221
+ }
222
+ const html = interactivityEl;
223
+ if (options.interactivity.events.onHover.enable || options.interactivity.events.onClick.enable) {
224
+ manageListener(interactivityEl, Constants.mouseMoveEvent, this.mouseMoveHandler, add);
225
+ manageListener(interactivityEl, Constants.touchStartEvent, this.touchStartHandler, add);
226
+ manageListener(interactivityEl, Constants.touchMoveEvent, this.touchMoveHandler, add);
227
+ if (!options.interactivity.events.onClick.enable) {
228
+ manageListener(interactivityEl, Constants.touchEndEvent, this.touchEndHandler, add);
229
+ } else {
230
+ manageListener(interactivityEl, Constants.touchEndEvent, this.touchEndClickHandler, add);
231
+ manageListener(interactivityEl, Constants.mouseUpEvent, this.mouseUpHandler, add);
232
+ manageListener(interactivityEl, Constants.mouseDownEvent, this.mouseDownHandler, add);
233
+ }
234
+ manageListener(interactivityEl, mouseLeaveEvent, this.mouseLeaveHandler, add);
235
+ manageListener(interactivityEl, Constants.touchCancelEvent, this.touchCancelHandler, add);
236
+ }
237
+ if (container.canvas.element) {
238
+ container.canvas.element.style.pointerEvents = html === container.canvas.element ? "initial" : "none";
239
+ }
240
+ if (options.interactivity.events.resize) {
241
+ if (typeof ResizeObserver !== "undefined") {
242
+ if (this.resizeObserver && !add) {
243
+ if (container.canvas.element) {
244
+ this.resizeObserver.unobserve(container.canvas.element);
245
+ }
246
+ this.resizeObserver.disconnect();
247
+ delete this.resizeObserver;
248
+ } else if (!this.resizeObserver && add && container.canvas.element) {
249
+ this.resizeObserver = new ResizeObserver((entries => {
250
+ const entry = entries.find((e => e.target === container.canvas.element));
251
+ if (!entry) {
252
+ return;
253
+ }
254
+ this.handleWindowResize();
255
+ }));
256
+ this.resizeObserver.observe(container.canvas.element);
257
+ }
258
+ } else {
259
+ manageListener(window, Constants.resizeEvent, this.resizeHandler, add);
260
+ }
261
+ }
262
+ if (document) {
263
+ manageListener(document, Constants.visibilityChangeEvent, this.visibilityChangeHandler, add, false);
264
+ }
265
+ }
266
+ handleWindowResize() {
267
+ if (this.resizeTimeout) {
268
+ clearTimeout(this.resizeTimeout);
269
+ delete this.resizeTimeout;
270
+ }
271
+ this.resizeTimeout = setTimeout((async () => {
272
+ var _a;
273
+ return await ((_a = this.container.canvas) === null || _a === void 0 ? void 0 : _a.windowResize());
274
+ }), 500);
275
+ }
276
+ handleVisibilityChange() {
277
+ const container = this.container;
278
+ const options = container.actualOptions;
279
+ this.mouseTouchFinish();
280
+ if (!options.pauseOnBlur) {
281
+ return;
282
+ }
283
+ if (document === null || document === void 0 ? void 0 : document.hidden) {
284
+ container.pageHidden = true;
285
+ container.pause();
286
+ } else {
287
+ container.pageHidden = false;
288
+ if (container.getAnimationStatus()) {
289
+ container.play(true);
290
+ } else {
291
+ container.draw(true);
292
+ }
293
+ }
294
+ }
295
+ mouseDown() {
296
+ const interactivity = this.container.interactivity;
297
+ if (interactivity) {
298
+ const mouse = interactivity.mouse;
299
+ mouse.clicking = true;
300
+ mouse.downPosition = mouse.position;
301
+ }
302
+ }
303
+ mouseTouchMove(e) {
304
+ var _a, _b, _c, _d, _e, _f, _g;
305
+ const container = this.container;
306
+ const options = container.actualOptions;
307
+ if (((_a = container.interactivity) === null || _a === void 0 ? void 0 : _a.element) === undefined) {
308
+ return;
309
+ }
310
+ container.interactivity.mouse.inside = true;
311
+ let pos;
312
+ const canvas = container.canvas.element;
313
+ if (e.type.startsWith("mouse")) {
314
+ this.canPush = true;
315
+ const mouseEvent = e;
316
+ if (container.interactivity.element === window) {
317
+ if (canvas) {
318
+ const clientRect = canvas.getBoundingClientRect();
319
+ pos = {
320
+ x: mouseEvent.clientX - clientRect.left,
321
+ y: mouseEvent.clientY - clientRect.top
322
+ };
323
+ }
324
+ } else if (options.interactivity.detectsOn === "parent") {
325
+ const source = mouseEvent.target;
326
+ const target = mouseEvent.currentTarget;
327
+ const canvasEl = container.canvas.element;
328
+ if (source && target && canvasEl) {
329
+ const sourceRect = source.getBoundingClientRect();
330
+ const targetRect = target.getBoundingClientRect();
331
+ const canvasRect = canvasEl.getBoundingClientRect();
332
+ pos = {
333
+ x: mouseEvent.offsetX + 2 * sourceRect.left - (targetRect.left + canvasRect.left),
334
+ y: mouseEvent.offsetY + 2 * sourceRect.top - (targetRect.top + canvasRect.top)
335
+ };
336
+ } else {
337
+ pos = {
338
+ x: (_b = mouseEvent.offsetX) !== null && _b !== void 0 ? _b : mouseEvent.clientX,
339
+ y: (_c = mouseEvent.offsetY) !== null && _c !== void 0 ? _c : mouseEvent.clientY
340
+ };
341
+ }
342
+ } else {
343
+ if (mouseEvent.target === container.canvas.element) {
344
+ pos = {
345
+ x: (_d = mouseEvent.offsetX) !== null && _d !== void 0 ? _d : mouseEvent.clientX,
346
+ y: (_e = mouseEvent.offsetY) !== null && _e !== void 0 ? _e : mouseEvent.clientY
347
+ };
348
+ }
349
+ }
350
+ } else {
351
+ this.canPush = e.type !== "touchmove";
352
+ const touchEvent = e;
353
+ const lastTouch = touchEvent.touches[touchEvent.touches.length - 1];
354
+ const canvasRect = canvas === null || canvas === void 0 ? void 0 : canvas.getBoundingClientRect();
355
+ pos = {
356
+ x: lastTouch.clientX - ((_f = canvasRect === null || canvasRect === void 0 ? void 0 : canvasRect.left) !== null && _f !== void 0 ? _f : 0),
357
+ y: lastTouch.clientY - ((_g = canvasRect === null || canvasRect === void 0 ? void 0 : canvasRect.top) !== null && _g !== void 0 ? _g : 0)
358
+ };
359
+ }
360
+ const pxRatio = container.retina.pixelRatio;
361
+ if (pos) {
362
+ pos.x *= pxRatio;
363
+ pos.y *= pxRatio;
364
+ }
365
+ container.interactivity.mouse.position = pos;
366
+ container.interactivity.status = Constants.mouseMoveEvent;
367
+ }
368
+ mouseTouchFinish() {
369
+ const interactivity = this.container.interactivity;
370
+ if (interactivity === undefined) {
371
+ return;
372
+ }
373
+ const mouse = interactivity.mouse;
374
+ delete mouse.position;
375
+ delete mouse.clickPosition;
376
+ delete mouse.downPosition;
377
+ interactivity.status = Constants.mouseLeaveEvent;
378
+ mouse.inside = false;
379
+ mouse.clicking = false;
380
+ }
381
+ mouseTouchClick(e) {
382
+ const container = this.container;
383
+ const options = container.actualOptions;
384
+ const mouse = container.interactivity.mouse;
385
+ mouse.inside = true;
386
+ let handled = false;
387
+ const mousePosition = mouse.position;
388
+ if (mousePosition === undefined || !options.interactivity.events.onClick.enable) {
389
+ return;
390
+ }
391
+ for (const [, plugin] of container.plugins) {
392
+ if (plugin.clickPositionValid !== undefined) {
393
+ handled = plugin.clickPositionValid(mousePosition);
394
+ if (handled) {
395
+ break;
396
+ }
397
+ }
398
+ }
399
+ if (!handled) {
400
+ this.doMouseTouchClick(e);
401
+ }
402
+ mouse.clicking = false;
403
+ }
404
+ doMouseTouchClick(e) {
405
+ const container = this.container;
406
+ const options = container.actualOptions;
407
+ if (this.canPush) {
408
+ const mousePos = container.interactivity.mouse.position;
409
+ if (mousePos) {
410
+ container.interactivity.mouse.clickPosition = {
411
+ x: mousePos.x,
412
+ y: mousePos.y
413
+ };
414
+ } else {
415
+ return;
416
+ }
417
+ container.interactivity.mouse.clickTime = (new Date).getTime();
418
+ const onClick = options.interactivity.events.onClick;
419
+ if (onClick.mode instanceof Array) {
420
+ for (const mode of onClick.mode) {
421
+ this.handleClickMode(mode);
422
+ }
423
+ } else {
424
+ this.handleClickMode(onClick.mode);
425
+ }
426
+ }
427
+ if (e.type === "touchend") {
428
+ setTimeout((() => this.mouseTouchFinish()), 500);
429
+ }
430
+ }
431
+ handleThemeChange(e) {
432
+ const mediaEvent = e;
433
+ const themeName = mediaEvent.matches ? this.container.options.defaultDarkTheme : this.container.options.defaultLightTheme;
434
+ const theme = this.container.options.themes.find((theme => theme.name === themeName));
435
+ if (theme && theme.default.auto) {
436
+ this.container.loadTheme(themeName);
437
+ }
438
+ }
439
+ handleClickMode(mode) {
440
+ const container = this.container;
441
+ const options = container.actualOptions;
442
+ const pushNb = options.interactivity.modes.push.quantity;
443
+ const removeNb = options.interactivity.modes.remove.quantity;
444
+ switch (mode) {
445
+ case "push":
446
+ {
447
+ if (pushNb > 0) {
448
+ const pushOptions = options.interactivity.modes.push;
449
+ const group = itemFromArray([ undefined, ...pushOptions.groups ]);
450
+ const groupOptions = group !== undefined ? container.actualOptions.particles.groups[group] : undefined;
451
+ container.particles.push(pushNb, container.interactivity.mouse, groupOptions, group);
452
+ }
453
+ break;
454
+ }
455
+
456
+ case "remove":
457
+ container.particles.removeQuantity(removeNb);
458
+ break;
459
+
460
+ case "bubble":
461
+ container.bubble.clicking = true;
462
+ break;
463
+
464
+ case "repulse":
465
+ container.repulse.clicking = true;
466
+ container.repulse.count = 0;
467
+ for (const particle of container.repulse.particles) {
468
+ particle.velocity.setTo(particle.initialVelocity);
469
+ }
470
+ container.repulse.particles = [];
471
+ container.repulse.finish = false;
472
+ setTimeout((() => {
473
+ if (!container.destroyed) {
474
+ container.repulse.clicking = false;
475
+ }
476
+ }), options.interactivity.modes.repulse.duration * 1e3);
477
+ break;
478
+
479
+ case "attract":
480
+ container.attract.clicking = true;
481
+ container.attract.count = 0;
482
+ for (const particle of container.attract.particles) {
483
+ particle.velocity.setTo(particle.initialVelocity);
484
+ }
485
+ container.attract.particles = [];
486
+ container.attract.finish = false;
487
+ setTimeout((() => {
488
+ if (!container.destroyed) {
489
+ container.attract.clicking = false;
490
+ }
491
+ }), options.interactivity.modes.attract.duration * 1e3);
492
+ break;
493
+
494
+ case "pause":
495
+ if (container.getAnimationStatus()) {
496
+ container.pause();
497
+ } else {
498
+ container.play();
499
+ }
500
+ break;
501
+ }
502
+ for (const [, plugin] of container.plugins) {
503
+ if (plugin.handleClickMode) {
504
+ plugin.handleClickMode(mode);
505
+ }
506
+ }
507
+ }
508
+ }
509
+ class InteractionManager_InteractionManager {
510
+ constructor(container) {
511
+ this.container = container;
512
+ this.externalInteractors = [];
513
+ this.particleInteractors = [];
514
+ this.init();
515
+ }
516
+ init() {
517
+ const interactors = Plugins.getInteractors(this.container, true);
518
+ this.externalInteractors = [];
519
+ this.particleInteractors = [];
520
+ for (const interactor of interactors) {
521
+ switch (interactor.type) {
522
+ case 0:
523
+ this.externalInteractors.push(interactor);
524
+ break;
525
+
526
+ case 1:
527
+ this.particleInteractors.push(interactor);
528
+ break;
529
+ }
530
+ }
531
+ }
532
+ externalInteract(delta) {
533
+ for (const interactor of this.externalInteractors) {
534
+ if (interactor.isEnabled()) {
535
+ interactor.interact(delta);
536
+ }
537
+ }
538
+ }
539
+ particlesInteract(particle, delta) {
540
+ for (const interactor of this.externalInteractors) {
541
+ interactor.reset(particle);
542
+ }
543
+ for (const interactor of this.particleInteractors) {
544
+ if (interactor.isEnabled(particle)) {
545
+ interactor.interact(particle, delta);
546
+ }
547
+ }
548
+ }
549
+ }
550
+ class ParticlesInteractorBase {
551
+ constructor(container) {
552
+ this.container = container;
553
+ this.type = 1;
554
+ }
555
+ }
556
+ function applyDistance(particle) {
557
+ const initialPosition = particle.initialPosition;
558
+ const {dx: dx, dy: dy} = getDistances(initialPosition, particle.position);
559
+ const dxFixed = Math.abs(dx), dyFixed = Math.abs(dy);
560
+ const hDistance = particle.retina.maxDistance.horizontal;
561
+ const vDistance = particle.retina.maxDistance.vertical;
562
+ if (!hDistance && !vDistance) {
563
+ return;
564
+ }
565
+ if ((hDistance && dxFixed >= hDistance || vDistance && dyFixed >= vDistance) && !particle.misplaced) {
566
+ particle.misplaced = !!hDistance && dxFixed > hDistance || !!vDistance && dyFixed > vDistance;
567
+ if (hDistance) {
568
+ particle.velocity.x = particle.velocity.y / 2 - particle.velocity.x;
569
+ }
570
+ if (vDistance) {
571
+ particle.velocity.y = particle.velocity.x / 2 - particle.velocity.y;
572
+ }
573
+ } else if ((!hDistance || dxFixed < hDistance) && (!vDistance || dyFixed < vDistance) && particle.misplaced) {
574
+ particle.misplaced = false;
575
+ } else if (particle.misplaced) {
576
+ const pos = particle.position, vel = particle.velocity;
577
+ if (hDistance && (pos.x < initialPosition.x && vel.x < 0 || pos.x > initialPosition.x && vel.x > 0)) {
578
+ vel.x *= -Math.random();
579
+ }
580
+ if (vDistance && (pos.y < initialPosition.y && vel.y < 0 || pos.y > initialPosition.y && vel.y > 0)) {
581
+ vel.y *= -Math.random();
582
+ }
583
+ }
584
+ }
585
+ class ParticlesMover_ParticlesMover {
586
+ constructor(container) {
587
+ this.container = container;
588
+ }
589
+ move(particle, delta) {
590
+ if (particle.destroyed) {
591
+ return;
592
+ }
593
+ this.moveParticle(particle, delta);
594
+ this.moveParallax(particle);
595
+ }
596
+ moveParticle(particle, delta) {
597
+ var _a, _b, _c;
598
+ var _d, _e;
599
+ const particleOptions = particle.options;
600
+ const moveOptions = particleOptions.move;
601
+ if (!moveOptions.enable) {
602
+ return;
603
+ }
604
+ const container = this.container, slowFactor = this.getProximitySpeedFactor(particle), baseSpeed = ((_a = (_d = particle.retina).moveSpeed) !== null && _a !== void 0 ? _a : _d.moveSpeed = getRangeValue(moveOptions.speed) * container.retina.pixelRatio) * container.retina.reduceFactor, moveDrift = (_b = (_e = particle.retina).moveDrift) !== null && _b !== void 0 ? _b : _e.moveDrift = getRangeValue(particle.options.move.drift) * container.retina.pixelRatio, maxSize = getRangeMax(particleOptions.size.value) * container.retina.pixelRatio, sizeFactor = moveOptions.size ? particle.getRadius() / maxSize : 1, diffFactor = 2, speedFactor = sizeFactor * slowFactor * (delta.factor || 1) / diffFactor, moveSpeed = baseSpeed * speedFactor;
605
+ this.applyPath(particle, delta);
606
+ const gravityOptions = moveOptions.gravity;
607
+ const gravityFactor = gravityOptions.enable && gravityOptions.inverse ? -1 : 1;
608
+ if (gravityOptions.enable && moveSpeed) {
609
+ particle.velocity.y += gravityFactor * (gravityOptions.acceleration * delta.factor) / (60 * moveSpeed);
610
+ }
611
+ if (moveDrift && moveSpeed) {
612
+ particle.velocity.x += moveDrift * delta.factor / (60 * moveSpeed);
613
+ }
614
+ const decay = particle.moveDecay;
615
+ if (decay != 1) {
616
+ particle.velocity.multTo(decay);
617
+ }
618
+ const velocity = particle.velocity.mult(moveSpeed);
619
+ const maxSpeed = (_c = particle.retina.maxSpeed) !== null && _c !== void 0 ? _c : container.retina.maxSpeed;
620
+ if (gravityOptions.enable && gravityOptions.maxSpeed > 0 && (!gravityOptions.inverse && velocity.y >= 0 && velocity.y >= maxSpeed || gravityOptions.inverse && velocity.y <= 0 && velocity.y <= -maxSpeed)) {
621
+ velocity.y = gravityFactor * maxSpeed;
622
+ if (moveSpeed) {
623
+ particle.velocity.y = velocity.y / moveSpeed;
624
+ }
625
+ }
626
+ const zIndexOptions = particle.options.zIndex, zVelocityFactor = (1 - particle.zIndexFactor) ** zIndexOptions.velocityRate;
627
+ if (moveOptions.spin.enable) {
628
+ this.spin(particle, moveSpeed);
629
+ } else {
630
+ if (zVelocityFactor != 1) {
631
+ velocity.multTo(zVelocityFactor);
632
+ }
633
+ particle.position.addTo(velocity);
634
+ if (moveOptions.vibrate) {
635
+ particle.position.x += Math.sin(particle.position.x * Math.cos(particle.position.y));
636
+ particle.position.y += Math.cos(particle.position.y * Math.sin(particle.position.x));
637
+ }
638
+ }
639
+ applyDistance(particle);
640
+ }
641
+ spin(particle, moveSpeed) {
642
+ const container = this.container;
643
+ if (!particle.spin) {
644
+ return;
645
+ }
646
+ const updateFunc = {
647
+ x: particle.spin.direction === "clockwise" ? Math.cos : Math.sin,
648
+ y: particle.spin.direction === "clockwise" ? Math.sin : Math.cos
649
+ };
650
+ particle.position.x = particle.spin.center.x + particle.spin.radius * updateFunc.x(particle.spin.angle);
651
+ particle.position.y = particle.spin.center.y + particle.spin.radius * updateFunc.y(particle.spin.angle);
652
+ particle.spin.radius += particle.spin.acceleration;
653
+ const maxCanvasSize = Math.max(container.canvas.size.width, container.canvas.size.height);
654
+ if (particle.spin.radius > maxCanvasSize / 2) {
655
+ particle.spin.radius = maxCanvasSize / 2;
656
+ particle.spin.acceleration *= -1;
657
+ } else if (particle.spin.radius < 0) {
658
+ particle.spin.radius = 0;
659
+ particle.spin.acceleration *= -1;
660
+ }
661
+ particle.spin.angle += moveSpeed / 100 * (1 - particle.spin.radius / maxCanvasSize);
662
+ }
663
+ applyPath(particle, delta) {
664
+ const particlesOptions = particle.options;
665
+ const pathOptions = particlesOptions.move.path;
666
+ const pathEnabled = pathOptions.enable;
667
+ if (!pathEnabled) {
668
+ return;
669
+ }
670
+ const container = this.container;
671
+ if (particle.lastPathTime <= particle.pathDelay) {
672
+ particle.lastPathTime += delta.value;
673
+ return;
674
+ }
675
+ const path = container.pathGenerator.generate(particle);
676
+ particle.velocity.addTo(path);
677
+ if (pathOptions.clamp) {
678
+ particle.velocity.x = clamp(particle.velocity.x, -1, 1);
679
+ particle.velocity.y = clamp(particle.velocity.y, -1, 1);
680
+ }
681
+ particle.lastPathTime -= particle.pathDelay;
682
+ }
683
+ moveParallax(particle) {
684
+ const container = this.container;
685
+ const options = container.actualOptions;
686
+ if (isSsr() || !options.interactivity.events.onHover.parallax.enable) {
687
+ return;
688
+ }
689
+ const parallaxForce = options.interactivity.events.onHover.parallax.force;
690
+ const mousePos = container.interactivity.mouse.position;
691
+ if (!mousePos) {
692
+ return;
693
+ }
694
+ const canvasCenter = {
695
+ x: container.canvas.size.width / 2,
696
+ y: container.canvas.size.height / 2
697
+ };
698
+ const parallaxSmooth = options.interactivity.events.onHover.parallax.smooth;
699
+ const factor = particle.getRadius() / parallaxForce;
700
+ const tmp = {
701
+ x: (mousePos.x - canvasCenter.x) * factor,
702
+ y: (mousePos.y - canvasCenter.y) * factor
703
+ };
704
+ particle.offset.x += (tmp.x - particle.offset.x) / parallaxSmooth;
705
+ particle.offset.y += (tmp.y - particle.offset.y) / parallaxSmooth;
706
+ }
707
+ getProximitySpeedFactor(particle) {
708
+ const container = this.container;
709
+ const options = container.actualOptions;
710
+ const active = isInArray("slow", options.interactivity.events.onHover.mode);
711
+ if (!active) {
712
+ return 1;
713
+ }
714
+ const mousePos = this.container.interactivity.mouse.position;
715
+ if (!mousePos) {
716
+ return 1;
717
+ }
718
+ const particlePos = particle.getPosition();
719
+ const dist = getDistance(mousePos, particlePos);
720
+ const radius = container.retina.slowModeRadius;
721
+ if (dist > radius) {
722
+ return 1;
723
+ }
724
+ const proximityFactor = dist / radius || 0;
725
+ const slowFactor = options.interactivity.modes.slow.factor;
726
+ return proximityFactor / slowFactor;
727
+ }
728
+ }
729
+ const plugins = null && [];
730
+ const interactorsInitializers = new Map;
731
+ const updatersInitializers = new Map;
732
+ const interactors = new Map;
733
+ const updaters = new Map;
734
+ const presets = new Map;
735
+ const drawers = new Map;
736
+ const pathGenerators = new Map;
737
+ class Plugins_Plugins {
738
+ static getPlugin(plugin) {
739
+ return plugins.find((t => t.id === plugin));
740
+ }
741
+ static addPlugin(plugin) {
742
+ if (!Plugins_Plugins.getPlugin(plugin.id)) {
743
+ plugins.push(plugin);
744
+ }
745
+ }
746
+ static getAvailablePlugins(container) {
747
+ const res = new Map;
748
+ for (const plugin of plugins) {
749
+ if (!plugin.needsPlugin(container.actualOptions)) {
750
+ continue;
751
+ }
752
+ res.set(plugin.id, plugin.getPlugin(container));
753
+ }
754
+ return res;
755
+ }
756
+ static loadOptions(options, sourceOptions) {
757
+ for (const plugin of plugins) {
758
+ plugin.loadOptions(options, sourceOptions);
759
+ }
760
+ }
761
+ static getPreset(preset) {
762
+ return presets.get(preset);
763
+ }
764
+ static addPreset(presetKey, options, override = false) {
765
+ if (override || !Plugins_Plugins.getPreset(presetKey)) {
766
+ presets.set(presetKey, options);
767
+ }
768
+ }
769
+ static addShapeDrawer(type, drawer) {
770
+ if (!Plugins_Plugins.getShapeDrawer(type)) {
771
+ drawers.set(type, drawer);
772
+ }
773
+ }
774
+ static getShapeDrawer(type) {
775
+ return drawers.get(type);
776
+ }
777
+ static getSupportedShapes() {
778
+ return drawers.keys();
779
+ }
780
+ static getPathGenerator(type) {
781
+ return pathGenerators.get(type);
782
+ }
783
+ static addPathGenerator(type, pathGenerator) {
784
+ if (!Plugins_Plugins.getPathGenerator(type)) {
785
+ pathGenerators.set(type, pathGenerator);
786
+ }
787
+ }
788
+ static getInteractors(container, force = false) {
789
+ let res = interactors.get(container);
790
+ if (!res || force) {
791
+ res = [ ...interactorsInitializers.values() ].map((t => t(container)));
792
+ interactors.set(container, res);
793
+ }
794
+ return res;
795
+ }
796
+ static addInteractor(name, initInteractor) {
797
+ interactorsInitializers.set(name, initInteractor);
798
+ }
799
+ static getUpdaters(container, force = false) {
800
+ let res = updaters.get(container);
801
+ if (!res || force) {
802
+ res = [ ...updatersInitializers.values() ].map((t => t(container)));
803
+ updaters.set(container, res);
804
+ }
805
+ return res;
806
+ }
807
+ static addParticleUpdater(name, initUpdater) {
808
+ updatersInitializers.set(name, initUpdater);
809
+ }
810
+ }
811
+ class QuadTree_QuadTree {
812
+ constructor(rectangle, capacity) {
813
+ this.rectangle = rectangle;
814
+ this.capacity = capacity;
815
+ this.points = [];
816
+ this.divided = false;
817
+ }
818
+ subdivide() {
819
+ const x = this.rectangle.position.x;
820
+ const y = this.rectangle.position.y;
821
+ const w = this.rectangle.size.width;
822
+ const h = this.rectangle.size.height;
823
+ const capacity = this.capacity;
824
+ this.northEast = new QuadTree_QuadTree(new Rectangle(x, y, w / 2, h / 2), capacity);
825
+ this.northWest = new QuadTree_QuadTree(new Rectangle(x + w / 2, y, w / 2, h / 2), capacity);
826
+ this.southEast = new QuadTree_QuadTree(new Rectangle(x, y + h / 2, w / 2, h / 2), capacity);
827
+ this.southWest = new QuadTree_QuadTree(new Rectangle(x + w / 2, y + h / 2, w / 2, h / 2), capacity);
828
+ this.divided = true;
829
+ }
830
+ insert(point) {
831
+ var _a, _b, _c, _d, _e;
832
+ if (!this.rectangle.contains(point.position)) {
833
+ return false;
834
+ }
835
+ if (this.points.length < this.capacity) {
836
+ this.points.push(point);
837
+ return true;
838
+ }
839
+ if (!this.divided) {
840
+ this.subdivide();
841
+ }
842
+ return (_e = ((_a = this.northEast) === null || _a === void 0 ? void 0 : _a.insert(point)) || ((_b = this.northWest) === null || _b === void 0 ? void 0 : _b.insert(point)) || ((_c = this.southEast) === null || _c === void 0 ? void 0 : _c.insert(point)) || ((_d = this.southWest) === null || _d === void 0 ? void 0 : _d.insert(point))) !== null && _e !== void 0 ? _e : false;
843
+ }
844
+ queryCircle(position, radius) {
845
+ return this.query(new Circle(position.x, position.y, radius));
846
+ }
847
+ queryCircleWarp(position, radius, containerOrSize) {
848
+ const container = containerOrSize;
849
+ const size = containerOrSize;
850
+ return this.query(new CircleWarp(position.x, position.y, radius, container.canvas !== undefined ? container.canvas.size : size));
851
+ }
852
+ queryRectangle(position, size) {
853
+ return this.query(new Rectangle(position.x, position.y, size.width, size.height));
854
+ }
855
+ query(range, found) {
856
+ var _a, _b, _c, _d;
857
+ const res = found !== null && found !== void 0 ? found : [];
858
+ if (!range.intersects(this.rectangle)) {
859
+ return [];
860
+ } else {
861
+ for (const p of this.points) {
862
+ if (!range.contains(p.position) && getDistance(range.position, p.position) > p.particle.getRadius()) {
863
+ continue;
864
+ }
865
+ res.push(p.particle);
866
+ }
867
+ if (this.divided) {
868
+ (_a = this.northEast) === null || _a === void 0 ? void 0 : _a.query(range, res);
869
+ (_b = this.northWest) === null || _b === void 0 ? void 0 : _b.query(range, res);
870
+ (_c = this.southEast) === null || _c === void 0 ? void 0 : _c.query(range, res);
871
+ (_d = this.southWest) === null || _d === void 0 ? void 0 : _d.query(range, res);
872
+ }
873
+ }
874
+ return res;
875
+ }
876
+ }
877
+ class Vector_Vector {
878
+ constructor(x, y) {
879
+ let defX, defY;
880
+ if (y === undefined) {
881
+ if (typeof x === "number") {
882
+ throw new Error("tsParticles - Vector not initialized correctly");
883
+ }
884
+ const coords = x;
885
+ [defX, defY] = [ coords.x, coords.y ];
886
+ } else {
887
+ [defX, defY] = [ x, y ];
888
+ }
889
+ this.x = defX;
890
+ this.y = defY;
891
+ }
892
+ static clone(source) {
893
+ return Vector_Vector.create(source.x, source.y);
894
+ }
895
+ static create(x, y) {
896
+ return new Vector_Vector(x, y);
897
+ }
898
+ static get origin() {
899
+ return Vector_Vector.create(0, 0);
900
+ }
901
+ get angle() {
902
+ return Math.atan2(this.y, this.x);
903
+ }
904
+ set angle(angle) {
905
+ this.updateFromAngle(angle, this.length);
906
+ }
907
+ get length() {
908
+ return Math.sqrt(this.x ** 2 + this.y ** 2);
909
+ }
910
+ set length(length) {
911
+ this.updateFromAngle(this.angle, length);
912
+ }
913
+ add(v) {
914
+ return Vector_Vector.create(this.x + v.x, this.y + v.y);
915
+ }
916
+ addTo(v) {
917
+ this.x += v.x;
918
+ this.y += v.y;
919
+ }
920
+ sub(v) {
921
+ return Vector_Vector.create(this.x - v.x, this.y - v.y);
922
+ }
923
+ subFrom(v) {
924
+ this.x -= v.x;
925
+ this.y -= v.y;
926
+ }
927
+ mult(n) {
928
+ return Vector_Vector.create(this.x * n, this.y * n);
929
+ }
930
+ multTo(n) {
931
+ this.x *= n;
932
+ this.y *= n;
933
+ }
934
+ div(n) {
935
+ return Vector_Vector.create(this.x / n, this.y / n);
936
+ }
937
+ divTo(n) {
938
+ this.x /= n;
939
+ this.y /= n;
940
+ }
941
+ distanceTo(v) {
942
+ return this.sub(v).length;
943
+ }
944
+ getLengthSq() {
945
+ return this.x ** 2 + this.y ** 2;
946
+ }
947
+ distanceToSq(v) {
948
+ return this.sub(v).getLengthSq();
949
+ }
950
+ manhattanDistanceTo(v) {
951
+ return Math.abs(v.x - this.x) + Math.abs(v.y - this.y);
952
+ }
953
+ copy() {
954
+ return Vector_Vector.clone(this);
955
+ }
956
+ setTo(velocity) {
957
+ this.x = velocity.x;
958
+ this.y = velocity.y;
959
+ }
960
+ rotate(angle) {
961
+ return Vector_Vector.create(this.x * Math.cos(angle) - this.y * Math.sin(angle), this.x * Math.sin(angle) + this.y * Math.cos(angle));
962
+ }
963
+ updateFromAngle(angle, length) {
964
+ this.x = Math.cos(angle) * length;
965
+ this.y = Math.sin(angle) * length;
966
+ }
967
+ }
968
+ class Canvas_Canvas {
969
+ constructor(container) {
970
+ this.container = container;
971
+ this.size = {
972
+ height: 0,
973
+ width: 0
974
+ };
975
+ this.context = null;
976
+ this.generatedCanvas = false;
977
+ }
978
+ init() {
979
+ this.resize();
980
+ this.initStyle();
981
+ this.initCover();
982
+ this.initTrail();
983
+ this.initBackground();
984
+ this.paint();
985
+ }
986
+ loadCanvas(canvas) {
987
+ var _a;
988
+ if (this.generatedCanvas) {
989
+ (_a = this.element) === null || _a === void 0 ? void 0 : _a.remove();
990
+ }
991
+ this.generatedCanvas = canvas.dataset && Constants.generatedAttribute in canvas.dataset ? canvas.dataset[Constants.generatedAttribute] === "true" : this.generatedCanvas;
992
+ this.element = canvas;
993
+ this.originalStyle = deepExtend({}, this.element.style);
994
+ this.size.height = canvas.offsetHeight;
995
+ this.size.width = canvas.offsetWidth;
996
+ this.context = this.element.getContext("2d");
997
+ this.container.retina.init();
998
+ this.initBackground();
999
+ }
1000
+ destroy() {
1001
+ var _a;
1002
+ if (this.generatedCanvas) {
1003
+ (_a = this.element) === null || _a === void 0 ? void 0 : _a.remove();
1004
+ }
1005
+ this.draw((ctx => {
1006
+ clear(ctx, this.size);
1007
+ }));
1008
+ }
1009
+ paint() {
1010
+ const options = this.container.actualOptions;
1011
+ this.draw((ctx => {
1012
+ if (options.backgroundMask.enable && options.backgroundMask.cover && this.coverColor) {
1013
+ clear(ctx, this.size);
1014
+ this.paintBase(getStyleFromRgb(this.coverColor, this.coverColor.a));
1015
+ } else {
1016
+ this.paintBase();
1017
+ }
1018
+ }));
1019
+ }
1020
+ clear() {
1021
+ const options = this.container.actualOptions;
1022
+ const trail = options.particles.move.trail;
1023
+ if (options.backgroundMask.enable) {
1024
+ this.paint();
1025
+ } else if (trail.enable && trail.length > 0 && this.trailFillColor) {
1026
+ this.paintBase(getStyleFromRgb(this.trailFillColor, 1 / trail.length));
1027
+ } else {
1028
+ this.draw((ctx => {
1029
+ clear(ctx, this.size);
1030
+ }));
1031
+ }
1032
+ }
1033
+ async windowResize() {
1034
+ if (!this.element) {
1035
+ return;
1036
+ }
1037
+ const container = this.container;
1038
+ this.resize();
1039
+ const needsRefresh = container.updateActualOptions();
1040
+ container.particles.setDensity();
1041
+ for (const [, plugin] of container.plugins) {
1042
+ if (plugin.resize !== undefined) {
1043
+ plugin.resize();
1044
+ }
1045
+ }
1046
+ if (needsRefresh) {
1047
+ await container.refresh();
1048
+ }
1049
+ }
1050
+ resize() {
1051
+ if (!this.element) {
1052
+ return;
1053
+ }
1054
+ const container = this.container;
1055
+ const pxRatio = container.retina.pixelRatio;
1056
+ const size = container.canvas.size;
1057
+ const oldSize = {
1058
+ width: size.width,
1059
+ height: size.height
1060
+ };
1061
+ size.width = this.element.offsetWidth * pxRatio;
1062
+ size.height = this.element.offsetHeight * pxRatio;
1063
+ this.element.width = size.width;
1064
+ this.element.height = size.height;
1065
+ if (this.container.started) {
1066
+ this.resizeFactor = {
1067
+ width: size.width / oldSize.width,
1068
+ height: size.height / oldSize.height
1069
+ };
1070
+ }
1071
+ }
1072
+ drawConnectLine(p1, p2) {
1073
+ this.draw((ctx => {
1074
+ var _a;
1075
+ const lineStyle = this.lineStyle(p1, p2);
1076
+ if (!lineStyle) {
1077
+ return;
1078
+ }
1079
+ const pos1 = p1.getPosition();
1080
+ const pos2 = p2.getPosition();
1081
+ drawConnectLine(ctx, (_a = p1.retina.linksWidth) !== null && _a !== void 0 ? _a : this.container.retina.linksWidth, lineStyle, pos1, pos2);
1082
+ }));
1083
+ }
1084
+ drawGrabLine(particle, lineColor, opacity, mousePos) {
1085
+ const container = this.container;
1086
+ this.draw((ctx => {
1087
+ var _a;
1088
+ const beginPos = particle.getPosition();
1089
+ drawGrabLine(ctx, (_a = particle.retina.linksWidth) !== null && _a !== void 0 ? _a : container.retina.linksWidth, beginPos, mousePos, lineColor, opacity);
1090
+ }));
1091
+ }
1092
+ drawParticle(particle, delta) {
1093
+ var _a, _b, _c, _d, _e, _f;
1094
+ if (particle.spawning || particle.destroyed) {
1095
+ return;
1096
+ }
1097
+ const pfColor = particle.getFillColor();
1098
+ const psColor = (_a = particle.getStrokeColor()) !== null && _a !== void 0 ? _a : pfColor;
1099
+ if (!pfColor && !psColor) {
1100
+ return;
1101
+ }
1102
+ let [fColor, sColor] = this.getPluginParticleColors(particle);
1103
+ const pOptions = particle.options;
1104
+ const twinkle = pOptions.twinkle.particles;
1105
+ const twinkling = twinkle.enable && Math.random() < twinkle.frequency;
1106
+ if (!fColor || !sColor) {
1107
+ const twinkleRgb = colorToHsl(twinkle.color);
1108
+ if (!fColor) {
1109
+ fColor = twinkling && twinkleRgb !== undefined ? twinkleRgb : pfColor ? pfColor : undefined;
1110
+ }
1111
+ if (!sColor) {
1112
+ sColor = twinkling && twinkleRgb !== undefined ? twinkleRgb : psColor ? psColor : undefined;
1113
+ }
1114
+ }
1115
+ const options = this.container.actualOptions;
1116
+ const zIndexOptions = particle.options.zIndex;
1117
+ const zOpacityFactor = (1 - particle.zIndexFactor) ** zIndexOptions.opacityRate;
1118
+ const radius = particle.getRadius();
1119
+ const opacity = twinkling ? twinkle.opacity : (_d = (_b = particle.bubble.opacity) !== null && _b !== void 0 ? _b : (_c = particle.opacity) === null || _c === void 0 ? void 0 : _c.value) !== null && _d !== void 0 ? _d : 1;
1120
+ const strokeOpacity = (_f = (_e = particle.stroke) === null || _e === void 0 ? void 0 : _e.opacity) !== null && _f !== void 0 ? _f : opacity;
1121
+ const zOpacity = opacity * zOpacityFactor;
1122
+ const fillColorValue = fColor ? getStyleFromHsl(fColor, zOpacity) : undefined;
1123
+ if (!fillColorValue && !sColor) {
1124
+ return;
1125
+ }
1126
+ this.draw((ctx => {
1127
+ const zSizeFactor = (1 - particle.zIndexFactor) ** zIndexOptions.sizeRate;
1128
+ const zStrokeOpacity = strokeOpacity * zOpacityFactor;
1129
+ const strokeColorValue = sColor ? getStyleFromHsl(sColor, zStrokeOpacity) : fillColorValue;
1130
+ if (radius <= 0) {
1131
+ return;
1132
+ }
1133
+ const container = this.container;
1134
+ for (const updater of container.particles.updaters) {
1135
+ if (updater.beforeDraw) {
1136
+ updater.beforeDraw(particle);
1137
+ }
1138
+ }
1139
+ drawParticle(this.container, ctx, particle, delta, fillColorValue, strokeColorValue, options.backgroundMask.enable, options.backgroundMask.composite, radius * zSizeFactor, zOpacity, particle.options.shadow, particle.gradient);
1140
+ for (const updater of container.particles.updaters) {
1141
+ if (updater.afterDraw) {
1142
+ updater.afterDraw(particle);
1143
+ }
1144
+ }
1145
+ }));
1146
+ }
1147
+ drawPlugin(plugin, delta) {
1148
+ this.draw((ctx => {
1149
+ drawPlugin(ctx, plugin, delta);
1150
+ }));
1151
+ }
1152
+ drawParticlePlugin(plugin, particle, delta) {
1153
+ this.draw((ctx => {
1154
+ drawParticlePlugin(ctx, plugin, particle, delta);
1155
+ }));
1156
+ }
1157
+ initBackground() {
1158
+ const options = this.container.actualOptions;
1159
+ const background = options.background;
1160
+ const element = this.element;
1161
+ const elementStyle = element === null || element === void 0 ? void 0 : element.style;
1162
+ if (!elementStyle) {
1163
+ return;
1164
+ }
1165
+ if (background.color) {
1166
+ const color = colorToRgb(background.color);
1167
+ elementStyle.backgroundColor = color ? getStyleFromRgb(color, background.opacity) : "";
1168
+ } else {
1169
+ elementStyle.backgroundColor = "";
1170
+ }
1171
+ elementStyle.backgroundImage = background.image || "";
1172
+ elementStyle.backgroundPosition = background.position || "";
1173
+ elementStyle.backgroundRepeat = background.repeat || "";
1174
+ elementStyle.backgroundSize = background.size || "";
1175
+ }
1176
+ draw(cb) {
1177
+ if (!this.context) {
1178
+ return;
1179
+ }
1180
+ return cb(this.context);
1181
+ }
1182
+ initCover() {
1183
+ const options = this.container.actualOptions;
1184
+ const cover = options.backgroundMask.cover;
1185
+ const color = cover.color;
1186
+ const coverRgb = colorToRgb(color);
1187
+ if (coverRgb) {
1188
+ this.coverColor = {
1189
+ r: coverRgb.r,
1190
+ g: coverRgb.g,
1191
+ b: coverRgb.b,
1192
+ a: cover.opacity
1193
+ };
1194
+ }
1195
+ }
1196
+ initTrail() {
1197
+ const options = this.container.actualOptions;
1198
+ const trail = options.particles.move.trail;
1199
+ const fillColor = colorToRgb(trail.fillColor);
1200
+ if (fillColor) {
1201
+ const trail = options.particles.move.trail;
1202
+ this.trailFillColor = {
1203
+ r: fillColor.r,
1204
+ g: fillColor.g,
1205
+ b: fillColor.b,
1206
+ a: 1 / trail.length
1207
+ };
1208
+ }
1209
+ }
1210
+ getPluginParticleColors(particle) {
1211
+ let fColor;
1212
+ let sColor;
1213
+ for (const [, plugin] of this.container.plugins) {
1214
+ if (!fColor && plugin.particleFillColor) {
1215
+ fColor = colorToHsl(plugin.particleFillColor(particle));
1216
+ }
1217
+ if (!sColor && plugin.particleStrokeColor) {
1218
+ sColor = colorToHsl(plugin.particleStrokeColor(particle));
1219
+ }
1220
+ if (fColor && sColor) {
1221
+ break;
1222
+ }
1223
+ }
1224
+ return [ fColor, sColor ];
1225
+ }
1226
+ initStyle() {
1227
+ const element = this.element, options = this.container.actualOptions;
1228
+ if (!element) {
1229
+ return;
1230
+ }
1231
+ const originalStyle = this.originalStyle;
1232
+ if (options.fullScreen.enable) {
1233
+ this.originalStyle = deepExtend({}, element.style);
1234
+ element.style.setProperty("position", "fixed", "important");
1235
+ element.style.setProperty("z-index", options.fullScreen.zIndex.toString(10), "important");
1236
+ element.style.setProperty("top", "0", "important");
1237
+ element.style.setProperty("left", "0", "important");
1238
+ element.style.setProperty("width", "100%", "important");
1239
+ element.style.setProperty("height", "100%", "important");
1240
+ } else if (originalStyle) {
1241
+ element.style.position = originalStyle.position;
1242
+ element.style.zIndex = originalStyle.zIndex;
1243
+ element.style.top = originalStyle.top;
1244
+ element.style.left = originalStyle.left;
1245
+ element.style.width = originalStyle.width;
1246
+ element.style.height = originalStyle.height;
1247
+ }
1248
+ for (const key in options.style) {
1249
+ if (!key || !options.style) {
1250
+ continue;
1251
+ }
1252
+ const value = options.style[key];
1253
+ if (!value) {
1254
+ continue;
1255
+ }
1256
+ element.style.setProperty(key, value, "important");
1257
+ }
1258
+ }
1259
+ paintBase(baseColor) {
1260
+ this.draw((ctx => {
1261
+ paintBase(ctx, this.size, baseColor);
1262
+ }));
1263
+ }
1264
+ lineStyle(p1, p2) {
1265
+ return this.draw((ctx => {
1266
+ const options = this.container.actualOptions;
1267
+ const connectOptions = options.interactivity.modes.connect;
1268
+ return gradient(ctx, p1, p2, connectOptions.links.opacity);
1269
+ }));
1270
+ }
1271
+ }
1272
+ class Trail_Trail {
1273
+ constructor() {
1274
+ this.delay = 1;
1275
+ this.pauseOnStop = false;
1276
+ this.quantity = 1;
1277
+ }
1278
+ load(data) {
1279
+ if (data === undefined) {
1280
+ return;
1281
+ }
1282
+ if (data.delay !== undefined) {
1283
+ this.delay = data.delay;
1284
+ }
1285
+ if (data.quantity !== undefined) {
1286
+ this.quantity = data.quantity;
1287
+ }
1288
+ if (data.particles !== undefined) {
1289
+ this.particles = deepExtend({}, data.particles);
1290
+ }
1291
+ if (data.pauseOnStop !== undefined) {
1292
+ this.pauseOnStop = data.pauseOnStop;
1293
+ }
1294
+ }
1295
+ }
1296
+ class Modes_Modes {
1297
+ constructor() {
1298
+ this.attract = new Attract;
1299
+ this.bounce = new Bounce;
1300
+ this.bubble = new Bubble;
1301
+ this.connect = new Connect;
1302
+ this.grab = new Grab;
1303
+ this.light = new Light;
1304
+ this.push = new Push;
1305
+ this.remove = new Remove;
1306
+ this.repulse = new Repulse;
1307
+ this.slow = new Slow;
1308
+ this.trail = new Trail;
1309
+ }
1310
+ load(data) {
1311
+ if (data === undefined) {
1312
+ return;
1313
+ }
1314
+ this.attract.load(data.attract);
1315
+ this.bubble.load(data.bubble);
1316
+ this.connect.load(data.connect);
1317
+ this.grab.load(data.grab);
1318
+ this.light.load(data.light);
1319
+ this.push.load(data.push);
1320
+ this.remove.load(data.remove);
1321
+ this.repulse.load(data.repulse);
1322
+ this.slow.load(data.slow);
1323
+ this.trail.load(data.trail);
1324
+ }
1325
+ }
1326
+ class Interactivity_Interactivity {
1327
+ constructor() {
1328
+ this.detectsOn = "window";
1329
+ this.events = new Events;
1330
+ this.modes = new Modes;
1331
+ }
1332
+ get detect_on() {
1333
+ return this.detectsOn;
1334
+ }
1335
+ set detect_on(value) {
1336
+ this.detectsOn = value;
1337
+ }
1338
+ load(data) {
1339
+ var _a, _b, _c;
1340
+ if (data === undefined) {
1341
+ return;
1342
+ }
1343
+ const detectsOn = (_a = data.detectsOn) !== null && _a !== void 0 ? _a : data.detect_on;
1344
+ if (detectsOn !== undefined) {
1345
+ this.detectsOn = detectsOn;
1346
+ }
1347
+ this.events.load(data.events);
1348
+ this.modes.load(data.modes);
1349
+ if (((_c = (_b = data.modes) === null || _b === void 0 ? void 0 : _b.slow) === null || _c === void 0 ? void 0 : _c.active) === true) {
1350
+ if (this.events.onHover.mode instanceof Array) {
1351
+ if (this.events.onHover.mode.indexOf("slow") < 0) {
1352
+ this.events.onHover.mode.push("slow");
1353
+ }
1354
+ } else if (this.events.onHover.mode !== "slow") {
1355
+ this.events.onHover.mode = [ this.events.onHover.mode, "slow" ];
1356
+ }
1357
+ }
1358
+ }
1359
+ }
1360
+ class ManualParticle_ManualParticle {
1361
+ load(data) {
1362
+ var _a, _b;
1363
+ if (!data) {
1364
+ return;
1365
+ }
1366
+ if (data.position !== undefined) {
1367
+ this.position = {
1368
+ x: (_a = data.position.x) !== null && _a !== void 0 ? _a : 50,
1369
+ y: (_b = data.position.y) !== null && _b !== void 0 ? _b : 50
1370
+ };
1371
+ }
1372
+ if (data.options !== undefined) {
1373
+ this.options = deepExtend({}, data.options);
1374
+ }
1375
+ }
1376
+ }
1377
+ class ColorAnimation_ColorAnimation {
1378
+ constructor() {
1379
+ this.count = 0;
1380
+ this.enable = false;
1381
+ this.offset = 0;
1382
+ this.speed = 1;
1383
+ this.sync = true;
1384
+ }
1385
+ load(data) {
1386
+ if (data === undefined) {
1387
+ return;
1388
+ }
1389
+ if (data.count !== undefined) {
1390
+ this.count = data.count;
1391
+ }
1392
+ if (data.enable !== undefined) {
1393
+ this.enable = data.enable;
1394
+ }
1395
+ if (data.offset !== undefined) {
1396
+ this.offset = setRangeValue(data.offset);
1397
+ }
1398
+ if (data.speed !== undefined) {
1399
+ this.speed = data.speed;
1400
+ }
1401
+ if (data.sync !== undefined) {
1402
+ this.sync = data.sync;
1403
+ }
1404
+ }
1405
+ }
1406
+ class HslAnimation_HslAnimation {
1407
+ constructor() {
1408
+ this.h = new ColorAnimation;
1409
+ this.s = new ColorAnimation;
1410
+ this.l = new ColorAnimation;
1411
+ }
1412
+ load(data) {
1413
+ if (!data) {
1414
+ return;
1415
+ }
1416
+ this.h.load(data.h);
1417
+ this.s.load(data.s);
1418
+ this.l.load(data.l);
1419
+ }
1420
+ }
1421
+ class AnimatableColor_AnimatableColor extends(null && OptionsColor){
1422
+ constructor() {
1423
+ super();
1424
+ this.animation = new HslAnimation;
1425
+ }
1426
+ static create(source, data) {
1427
+ const color = new AnimatableColor_AnimatableColor;
1428
+ color.load(source);
1429
+ if (data !== undefined) {
1430
+ if (typeof data === "string" || data instanceof Array) {
1431
+ color.load({
1432
+ value: data
1433
+ });
1434
+ } else {
1435
+ color.load(data);
1436
+ }
1437
+ }
1438
+ return color;
1439
+ }
1440
+ load(data) {
1441
+ super.load(data);
1442
+ if (!data) {
1443
+ return;
1444
+ }
1445
+ const colorAnimation = data.animation;
1446
+ if (colorAnimation !== undefined) {
1447
+ if (colorAnimation.enable !== undefined) {
1448
+ this.animation.h.load(colorAnimation);
1449
+ } else {
1450
+ this.animation.load(data.animation);
1451
+ }
1452
+ }
1453
+ }
1454
+ }
1455
+ class AnimatableGradient_AnimatableGradient {
1456
+ constructor() {
1457
+ this.angle = new GradientAngle;
1458
+ this.colors = [];
1459
+ this.type = "random";
1460
+ }
1461
+ load(data) {
1462
+ if (!data) {
1463
+ return;
1464
+ }
1465
+ this.angle.load(data.angle);
1466
+ if (data.colors !== undefined) {
1467
+ this.colors = data.colors.map((s => {
1468
+ const tmp = new AnimatableGradientColor;
1469
+ tmp.load(s);
1470
+ return tmp;
1471
+ }));
1472
+ }
1473
+ if (data.type !== undefined) {
1474
+ this.type = data.type;
1475
+ }
1476
+ }
1477
+ }
1478
+ class GradientAngle {
1479
+ constructor() {
1480
+ this.value = 0;
1481
+ this.animation = new GradientAngleAnimation;
1482
+ this.direction = "clockwise";
1483
+ }
1484
+ load(data) {
1485
+ if (!data) {
1486
+ return;
1487
+ }
1488
+ this.animation.load(data.animation);
1489
+ if (data.value !== undefined) {
1490
+ this.value = data.value;
1491
+ }
1492
+ if (data.direction !== undefined) {
1493
+ this.direction = data.direction;
1494
+ }
1495
+ }
1496
+ }
1497
+ class GradientColorOpacity {
1498
+ constructor() {
1499
+ this.value = 0;
1500
+ this.animation = new GradientColorOpacityAnimation;
1501
+ }
1502
+ load(data) {
1503
+ if (!data) {
1504
+ return;
1505
+ }
1506
+ this.animation.load(data.animation);
1507
+ if (data.value !== undefined) {
1508
+ this.value = setRangeValue(data.value);
1509
+ }
1510
+ }
1511
+ }
1512
+ class AnimatableGradientColor {
1513
+ constructor() {
1514
+ this.stop = 0;
1515
+ this.value = new AnimatableColor;
1516
+ }
1517
+ load(data) {
1518
+ if (!data) {
1519
+ return;
1520
+ }
1521
+ if (data.stop !== undefined) {
1522
+ this.stop = data.stop;
1523
+ }
1524
+ this.value = AnimatableColor.create(this.value, data.value);
1525
+ if (data.opacity !== undefined) {
1526
+ this.opacity = new GradientColorOpacity;
1527
+ if (typeof data.opacity === "number") {
1528
+ this.opacity.value = data.opacity;
1529
+ } else {
1530
+ this.opacity.load(data.opacity);
1531
+ }
1532
+ }
1533
+ }
1534
+ }
1535
+ class GradientAngleAnimation {
1536
+ constructor() {
1537
+ this.count = 0;
1538
+ this.enable = false;
1539
+ this.speed = 0;
1540
+ this.sync = false;
1541
+ }
1542
+ load(data) {
1543
+ if (!data) {
1544
+ return;
1545
+ }
1546
+ if (data.count !== undefined) {
1547
+ this.count = data.count;
1548
+ }
1549
+ if (data.enable !== undefined) {
1550
+ this.enable = data.enable;
1551
+ }
1552
+ if (data.speed !== undefined) {
1553
+ this.speed = data.speed;
1554
+ }
1555
+ if (data.sync !== undefined) {
1556
+ this.sync = data.sync;
1557
+ }
1558
+ }
1559
+ }
1560
+ class GradientColorOpacityAnimation {
1561
+ constructor() {
1562
+ this.count = 0;
1563
+ this.enable = false;
1564
+ this.speed = 0;
1565
+ this.sync = false;
1566
+ this.startValue = "random";
1567
+ }
1568
+ load(data) {
1569
+ if (!data) {
1570
+ return;
1571
+ }
1572
+ if (data.count !== undefined) {
1573
+ this.count = data.count;
1574
+ }
1575
+ if (data.enable !== undefined) {
1576
+ this.enable = data.enable;
1577
+ }
1578
+ if (data.speed !== undefined) {
1579
+ this.speed = data.speed;
1580
+ }
1581
+ if (data.sync !== undefined) {
1582
+ this.sync = data.sync;
1583
+ }
1584
+ if (data.startValue !== undefined) {
1585
+ this.startValue = data.startValue;
1586
+ }
1587
+ }
1588
+ }
1589
+ class ValueWithRandom_ValueWithRandom {
1590
+ constructor() {
1591
+ this.random = new Random;
1592
+ this.value = 0;
1593
+ }
1594
+ load(data) {
1595
+ if (!data) {
1596
+ return;
1597
+ }
1598
+ if (typeof data.random === "boolean") {
1599
+ this.random.enable = data.random;
1600
+ } else {
1601
+ this.random.load(data.random);
1602
+ }
1603
+ if (data.value !== undefined) {
1604
+ this.value = setRangeValue(data.value, this.random.enable ? this.random.minimumValue : undefined);
1605
+ }
1606
+ }
1607
+ }
1608
+ class BounceFactor_BounceFactor extends(null && ValueWithRandom){
1609
+ constructor() {
1610
+ super();
1611
+ this.random.minimumValue = .1;
1612
+ this.value = 1;
1613
+ }
1614
+ }
1615
+ class Bounce_Bounce {
1616
+ constructor() {
1617
+ this.horizontal = new BounceFactor;
1618
+ this.vertical = new BounceFactor;
1619
+ }
1620
+ load(data) {
1621
+ if (!data) {
1622
+ return;
1623
+ }
1624
+ this.horizontal.load(data.horizontal);
1625
+ this.vertical.load(data.vertical);
1626
+ }
1627
+ }
1628
+ class Collisions_Collisions {
1629
+ constructor() {
1630
+ this.bounce = new Bounce;
1631
+ this.enable = false;
1632
+ this.mode = "bounce";
1633
+ this.overlap = new CollisionsOverlap;
1634
+ }
1635
+ load(data) {
1636
+ if (data === undefined) {
1637
+ return;
1638
+ }
1639
+ this.bounce.load(data.bounce);
1640
+ if (data.enable !== undefined) {
1641
+ this.enable = data.enable;
1642
+ }
1643
+ if (data.mode !== undefined) {
1644
+ this.mode = data.mode;
1645
+ }
1646
+ this.overlap.load(data.overlap);
1647
+ }
1648
+ }
1649
+ class SplitFactor_SplitFactor extends(null && ValueWithRandom){
1650
+ constructor() {
1651
+ super();
1652
+ this.value = 3;
1653
+ }
1654
+ }
1655
+ class SplitRate_SplitRate extends(null && ValueWithRandom){
1656
+ constructor() {
1657
+ super();
1658
+ this.value = {
1659
+ min: 4,
1660
+ max: 9
1661
+ };
1662
+ }
1663
+ }
1664
+ class Split_Split {
1665
+ constructor() {
1666
+ this.count = 1;
1667
+ this.factor = new SplitFactor;
1668
+ this.rate = new SplitRate;
1669
+ this.sizeOffset = true;
1670
+ }
1671
+ load(data) {
1672
+ if (!data) {
1673
+ return;
1674
+ }
1675
+ if (data.count !== undefined) {
1676
+ this.count = data.count;
1677
+ }
1678
+ this.factor.load(data.factor);
1679
+ this.rate.load(data.rate);
1680
+ if (data.particles !== undefined) {
1681
+ this.particles = deepExtend({}, data.particles);
1682
+ }
1683
+ if (data.sizeOffset !== undefined) {
1684
+ this.sizeOffset = data.sizeOffset;
1685
+ }
1686
+ }
1687
+ }
1688
+ class Destroy_Destroy {
1689
+ constructor() {
1690
+ this.mode = "none";
1691
+ this.split = new Split;
1692
+ }
1693
+ load(data) {
1694
+ if (!data) {
1695
+ return;
1696
+ }
1697
+ if (data.mode !== undefined) {
1698
+ this.mode = data.mode;
1699
+ }
1700
+ this.split.load(data.split);
1701
+ }
1702
+ }
1703
+ class LifeDelay_LifeDelay extends(null && ValueWithRandom){
1704
+ constructor() {
1705
+ super();
1706
+ this.sync = false;
1707
+ }
1708
+ load(data) {
1709
+ if (!data) {
1710
+ return;
1711
+ }
1712
+ super.load(data);
1713
+ if (data.sync !== undefined) {
1714
+ this.sync = data.sync;
1715
+ }
1716
+ }
1717
+ }
1718
+ class LifeDuration_LifeDuration extends(null && ValueWithRandom){
1719
+ constructor() {
1720
+ super();
1721
+ this.random.minimumValue = 1e-4;
1722
+ this.sync = false;
1723
+ }
1724
+ load(data) {
1725
+ if (data === undefined) {
1726
+ return;
1727
+ }
1728
+ super.load(data);
1729
+ if (data.sync !== undefined) {
1730
+ this.sync = data.sync;
1731
+ }
1732
+ }
1733
+ }
1734
+ class Life_Life {
1735
+ constructor() {
1736
+ this.count = 0;
1737
+ this.delay = new LifeDelay;
1738
+ this.duration = new LifeDuration;
1739
+ }
1740
+ load(data) {
1741
+ if (data === undefined) {
1742
+ return;
1743
+ }
1744
+ if (data.count !== undefined) {
1745
+ this.count = data.count;
1746
+ }
1747
+ this.delay.load(data.delay);
1748
+ this.duration.load(data.duration);
1749
+ }
1750
+ }
1751
+ class PathDelay_PathDelay extends(null && ValueWithRandom){
1752
+ constructor() {
1753
+ super();
1754
+ }
1755
+ }
1756
+ class Path_Path {
1757
+ constructor() {
1758
+ this.clamp = true;
1759
+ this.delay = new PathDelay;
1760
+ this.enable = false;
1761
+ this.options = {};
1762
+ }
1763
+ load(data) {
1764
+ if (data === undefined) {
1765
+ return;
1766
+ }
1767
+ if (data.clamp !== undefined) {
1768
+ this.clamp = data.clamp;
1769
+ }
1770
+ this.delay.load(data.delay);
1771
+ if (data.enable !== undefined) {
1772
+ this.enable = data.enable;
1773
+ }
1774
+ this.generator = data.generator;
1775
+ if (data.options) {
1776
+ this.options = deepExtend(this.options, data.options);
1777
+ }
1778
+ }
1779
+ }
1780
+ class Spin_Spin {
1781
+ constructor() {
1782
+ this.acceleration = 0;
1783
+ this.enable = false;
1784
+ }
1785
+ load(data) {
1786
+ if (!data) {
1787
+ return;
1788
+ }
1789
+ if (data.acceleration !== undefined) {
1790
+ this.acceleration = setRangeValue(data.acceleration);
1791
+ }
1792
+ if (data.enable !== undefined) {
1793
+ this.enable = data.enable;
1794
+ }
1795
+ this.position = data.position ? deepExtend({}, data.position) : undefined;
1796
+ }
1797
+ }
1798
+ class Move_Move {
1799
+ constructor() {
1800
+ this.angle = new MoveAngle;
1801
+ this.attract = new Attract;
1802
+ this.decay = 0;
1803
+ this.distance = {};
1804
+ this.direction = "none";
1805
+ this.drift = 0;
1806
+ this.enable = false;
1807
+ this.gravity = new MoveGravity;
1808
+ this.path = new Path;
1809
+ this.outModes = new OutModes;
1810
+ this.random = false;
1811
+ this.size = false;
1812
+ this.speed = 2;
1813
+ this.spin = new Spin;
1814
+ this.straight = false;
1815
+ this.trail = new Trail;
1816
+ this.vibrate = false;
1817
+ this.warp = false;
1818
+ }
1819
+ get collisions() {
1820
+ return false;
1821
+ }
1822
+ set collisions(value) {}
1823
+ get bounce() {
1824
+ return this.collisions;
1825
+ }
1826
+ set bounce(value) {
1827
+ this.collisions = value;
1828
+ }
1829
+ get out_mode() {
1830
+ return this.outMode;
1831
+ }
1832
+ set out_mode(value) {
1833
+ this.outMode = value;
1834
+ }
1835
+ get outMode() {
1836
+ return this.outModes.default;
1837
+ }
1838
+ set outMode(value) {
1839
+ this.outModes.default = value;
1840
+ }
1841
+ get noise() {
1842
+ return this.path;
1843
+ }
1844
+ set noise(value) {
1845
+ this.path = value;
1846
+ }
1847
+ load(data) {
1848
+ var _a, _b, _c;
1849
+ if (data === undefined) {
1850
+ return;
1851
+ }
1852
+ if (data.angle !== undefined) {
1853
+ if (typeof data.angle === "number") {
1854
+ this.angle.value = data.angle;
1855
+ } else {
1856
+ this.angle.load(data.angle);
1857
+ }
1858
+ }
1859
+ this.attract.load(data.attract);
1860
+ if (data.decay !== undefined) {
1861
+ this.decay = data.decay;
1862
+ }
1863
+ if (data.direction !== undefined) {
1864
+ this.direction = data.direction;
1865
+ }
1866
+ if (data.distance !== undefined) {
1867
+ this.distance = typeof data.distance === "number" ? {
1868
+ horizontal: data.distance,
1869
+ vertical: data.distance
1870
+ } : deepExtend({}, data.distance);
1871
+ }
1872
+ if (data.drift !== undefined) {
1873
+ this.drift = setRangeValue(data.drift);
1874
+ }
1875
+ if (data.enable !== undefined) {
1876
+ this.enable = data.enable;
1877
+ }
1878
+ this.gravity.load(data.gravity);
1879
+ const outMode = (_a = data.outMode) !== null && _a !== void 0 ? _a : data.out_mode;
1880
+ if (data.outModes !== undefined || outMode !== undefined) {
1881
+ if (typeof data.outModes === "string" || data.outModes === undefined && outMode !== undefined) {
1882
+ this.outModes.load({
1883
+ default: (_b = data.outModes) !== null && _b !== void 0 ? _b : outMode
1884
+ });
1885
+ } else {
1886
+ this.outModes.load(data.outModes);
1887
+ }
1888
+ }
1889
+ this.path.load((_c = data.path) !== null && _c !== void 0 ? _c : data.noise);
1890
+ if (data.random !== undefined) {
1891
+ this.random = data.random;
1892
+ }
1893
+ if (data.size !== undefined) {
1894
+ this.size = data.size;
1895
+ }
1896
+ if (data.speed !== undefined) {
1897
+ this.speed = setRangeValue(data.speed);
1898
+ }
1899
+ this.spin.load(data.spin);
1900
+ if (data.straight !== undefined) {
1901
+ this.straight = data.straight;
1902
+ }
1903
+ this.trail.load(data.trail);
1904
+ if (data.vibrate !== undefined) {
1905
+ this.vibrate = data.vibrate;
1906
+ }
1907
+ if (data.warp !== undefined) {
1908
+ this.warp = data.warp;
1909
+ }
1910
+ }
1911
+ }
1912
+ class Opacity_Opacity extends(null && ValueWithRandom){
1913
+ constructor() {
1914
+ super();
1915
+ this.animation = new OpacityAnimation;
1916
+ this.random.minimumValue = .1;
1917
+ this.value = 1;
1918
+ }
1919
+ get anim() {
1920
+ return this.animation;
1921
+ }
1922
+ set anim(value) {
1923
+ this.animation = value;
1924
+ }
1925
+ load(data) {
1926
+ var _a;
1927
+ if (!data) {
1928
+ return;
1929
+ }
1930
+ super.load(data);
1931
+ const animation = (_a = data.animation) !== null && _a !== void 0 ? _a : data.anim;
1932
+ if (animation !== undefined) {
1933
+ this.animation.load(animation);
1934
+ this.value = setRangeValue(this.value, this.animation.enable ? this.animation.minimumValue : undefined);
1935
+ }
1936
+ }
1937
+ }
1938
+ class OrbitRotation_OrbitRotation extends(null && ValueWithRandom){
1939
+ constructor() {
1940
+ super();
1941
+ this.value = 45;
1942
+ this.random.enable = false;
1943
+ this.random.minimumValue = 0;
1944
+ }
1945
+ load(data) {
1946
+ if (data === undefined) {
1947
+ return;
1948
+ }
1949
+ super.load(data);
1950
+ }
1951
+ }
1952
+ class Orbit_Orbit {
1953
+ constructor() {
1954
+ this.animation = new AnimationOptions;
1955
+ this.enable = false;
1956
+ this.opacity = 1;
1957
+ this.rotation = new OrbitRotation;
1958
+ this.width = 1;
1959
+ }
1960
+ load(data) {
1961
+ if (data === undefined) {
1962
+ return;
1963
+ }
1964
+ this.animation.load(data.animation);
1965
+ this.rotation.load(data.rotation);
1966
+ if (data.enable !== undefined) {
1967
+ this.enable = data.enable;
1968
+ }
1969
+ if (data.opacity !== undefined) {
1970
+ this.opacity = data.opacity;
1971
+ }
1972
+ if (data.width !== undefined) {
1973
+ this.width = data.width;
1974
+ }
1975
+ if (data.radius !== undefined) {
1976
+ this.radius = data.radius;
1977
+ }
1978
+ if (data.color !== undefined) {
1979
+ this.color = OptionsColor.create(this.color, data.color);
1980
+ }
1981
+ }
1982
+ }
1983
+ class Repulse_Repulse extends(null && ValueWithRandom){
1984
+ constructor() {
1985
+ super();
1986
+ this.enabled = false;
1987
+ this.distance = 1;
1988
+ this.duration = 1;
1989
+ this.factor = 1;
1990
+ this.speed = 1;
1991
+ }
1992
+ load(data) {
1993
+ super.load(data);
1994
+ if (!data) {
1995
+ return;
1996
+ }
1997
+ if (data.enabled !== undefined) {
1998
+ this.enabled = data.enabled;
1999
+ }
2000
+ if (data.distance !== undefined) {
2001
+ this.distance = data.distance;
2002
+ }
2003
+ if (data.duration !== undefined) {
2004
+ this.duration = data.duration;
2005
+ }
2006
+ if (data.factor !== undefined) {
2007
+ this.factor = data.factor;
2008
+ }
2009
+ if (data.speed !== undefined) {
2010
+ this.speed = data.speed;
2011
+ }
2012
+ }
2013
+ }
2014
+ class Roll_Roll {
2015
+ constructor() {
2016
+ this.darken = new RollLight;
2017
+ this.enable = false;
2018
+ this.enlighten = new RollLight;
2019
+ this.mode = "vertical";
2020
+ this.speed = 25;
2021
+ }
2022
+ load(data) {
2023
+ if (!data) {
2024
+ return;
2025
+ }
2026
+ if (data.backColor !== undefined) {
2027
+ this.backColor = OptionsColor.create(this.backColor, data.backColor);
2028
+ }
2029
+ this.darken.load(data.darken);
2030
+ if (data.enable !== undefined) {
2031
+ this.enable = data.enable;
2032
+ }
2033
+ this.enlighten.load(data.enlighten);
2034
+ if (data.mode !== undefined) {
2035
+ this.mode = data.mode;
2036
+ }
2037
+ if (data.speed !== undefined) {
2038
+ this.speed = setRangeValue(data.speed);
2039
+ }
2040
+ }
2041
+ }
2042
+ class Rotate_Rotate extends(null && ValueWithRandom){
2043
+ constructor() {
2044
+ super();
2045
+ this.animation = new RotateAnimation;
2046
+ this.direction = "clockwise";
2047
+ this.path = false;
2048
+ this.value = 0;
2049
+ }
2050
+ load(data) {
2051
+ if (!data) {
2052
+ return;
2053
+ }
2054
+ super.load(data);
2055
+ if (data.direction !== undefined) {
2056
+ this.direction = data.direction;
2057
+ }
2058
+ this.animation.load(data.animation);
2059
+ if (data.path !== undefined) {
2060
+ this.path = data.path;
2061
+ }
2062
+ }
2063
+ }
2064
+ class Shape_Shape {
2065
+ constructor() {
2066
+ this.options = {};
2067
+ this.type = "circle";
2068
+ }
2069
+ get image() {
2070
+ var _a;
2071
+ return (_a = this.options["image"]) !== null && _a !== void 0 ? _a : this.options["images"];
2072
+ }
2073
+ set image(value) {
2074
+ this.options["image"] = value;
2075
+ this.options["images"] = value;
2076
+ }
2077
+ get custom() {
2078
+ return this.options;
2079
+ }
2080
+ set custom(value) {
2081
+ this.options = value;
2082
+ }
2083
+ get images() {
2084
+ return this.image;
2085
+ }
2086
+ set images(value) {
2087
+ this.image = value;
2088
+ }
2089
+ get stroke() {
2090
+ return [];
2091
+ }
2092
+ set stroke(_value) {}
2093
+ get character() {
2094
+ var _a;
2095
+ return (_a = this.options["character"]) !== null && _a !== void 0 ? _a : this.options["char"];
2096
+ }
2097
+ set character(value) {
2098
+ this.options["character"] = value;
2099
+ this.options["char"] = value;
2100
+ }
2101
+ get polygon() {
2102
+ var _a;
2103
+ return (_a = this.options["polygon"]) !== null && _a !== void 0 ? _a : this.options["star"];
2104
+ }
2105
+ set polygon(value) {
2106
+ this.options["polygon"] = value;
2107
+ this.options["star"] = value;
2108
+ }
2109
+ load(data) {
2110
+ var _a, _b, _c;
2111
+ if (data === undefined) {
2112
+ return;
2113
+ }
2114
+ const options = (_a = data.options) !== null && _a !== void 0 ? _a : data.custom;
2115
+ if (options !== undefined) {
2116
+ for (const shape in options) {
2117
+ const item = options[shape];
2118
+ if (item !== undefined) {
2119
+ this.options[shape] = deepExtend((_b = this.options[shape]) !== null && _b !== void 0 ? _b : {}, item);
2120
+ }
2121
+ }
2122
+ }
2123
+ this.loadShape(data.character, "character", "char", true);
2124
+ this.loadShape(data.polygon, "polygon", "star", false);
2125
+ this.loadShape((_c = data.image) !== null && _c !== void 0 ? _c : data.images, "image", "images", true);
2126
+ if (data.type !== undefined) {
2127
+ this.type = data.type;
2128
+ }
2129
+ }
2130
+ loadShape(item, mainKey, altKey, altOverride) {
2131
+ var _a, _b, _c, _d;
2132
+ if (item === undefined) {
2133
+ return;
2134
+ }
2135
+ if (item instanceof Array) {
2136
+ if (!(this.options[mainKey] instanceof Array)) {
2137
+ this.options[mainKey] = [];
2138
+ if (!this.options[altKey] || altOverride) {
2139
+ this.options[altKey] = [];
2140
+ }
2141
+ }
2142
+ this.options[mainKey] = deepExtend((_a = this.options[mainKey]) !== null && _a !== void 0 ? _a : [], item);
2143
+ if (!this.options[altKey] || altOverride) {
2144
+ this.options[altKey] = deepExtend((_b = this.options[altKey]) !== null && _b !== void 0 ? _b : [], item);
2145
+ }
2146
+ } else {
2147
+ if (this.options[mainKey] instanceof Array) {
2148
+ this.options[mainKey] = {};
2149
+ if (!this.options[altKey] || altOverride) {
2150
+ this.options[altKey] = {};
2151
+ }
2152
+ }
2153
+ this.options[mainKey] = deepExtend((_c = this.options[mainKey]) !== null && _c !== void 0 ? _c : {}, item);
2154
+ if (!this.options[altKey] || altOverride) {
2155
+ this.options[altKey] = deepExtend((_d = this.options[altKey]) !== null && _d !== void 0 ? _d : {}, item);
2156
+ }
2157
+ }
2158
+ }
2159
+ }
2160
+ class Size_Size extends(null && ValueWithRandom){
2161
+ constructor() {
2162
+ super();
2163
+ this.animation = new SizeAnimation;
2164
+ this.random.minimumValue = 1;
2165
+ this.value = 3;
2166
+ }
2167
+ get anim() {
2168
+ return this.animation;
2169
+ }
2170
+ set anim(value) {
2171
+ this.animation = value;
2172
+ }
2173
+ load(data) {
2174
+ var _a;
2175
+ if (!data) {
2176
+ return;
2177
+ }
2178
+ super.load(data);
2179
+ const animation = (_a = data.animation) !== null && _a !== void 0 ? _a : data.anim;
2180
+ if (animation !== undefined) {
2181
+ this.animation.load(animation);
2182
+ this.value = setRangeValue(this.value, this.animation.enable ? this.animation.minimumValue : undefined);
2183
+ }
2184
+ }
2185
+ }
2186
+ class Stroke_Stroke {
2187
+ constructor() {
2188
+ this.width = 0;
2189
+ }
2190
+ load(data) {
2191
+ if (data === undefined) {
2192
+ return;
2193
+ }
2194
+ if (data.color !== undefined) {
2195
+ this.color = AnimatableColor.create(this.color, data.color);
2196
+ }
2197
+ if (data.width !== undefined) {
2198
+ this.width = data.width;
2199
+ }
2200
+ if (data.opacity !== undefined) {
2201
+ this.opacity = data.opacity;
2202
+ }
2203
+ }
2204
+ }
2205
+ class Tilt_Tilt extends(null && ValueWithRandom){
2206
+ constructor() {
2207
+ super();
2208
+ this.animation = new TiltAnimation;
2209
+ this.direction = "clockwise";
2210
+ this.enable = false;
2211
+ this.value = 0;
2212
+ }
2213
+ load(data) {
2214
+ if (!data) {
2215
+ return;
2216
+ }
2217
+ super.load(data);
2218
+ this.animation.load(data.animation);
2219
+ if (data.direction !== undefined) {
2220
+ this.direction = data.direction;
2221
+ }
2222
+ if (data.enable !== undefined) {
2223
+ this.enable = data.enable;
2224
+ }
2225
+ }
2226
+ }
2227
+ class Wobble_Wobble {
2228
+ constructor() {
2229
+ this.distance = 5;
2230
+ this.enable = false;
2231
+ this.speed = 50;
2232
+ }
2233
+ load(data) {
2234
+ if (!data) {
2235
+ return;
2236
+ }
2237
+ if (data.distance !== undefined) {
2238
+ this.distance = setRangeValue(data.distance);
2239
+ }
2240
+ if (data.enable !== undefined) {
2241
+ this.enable = data.enable;
2242
+ }
2243
+ if (data.speed !== undefined) {
2244
+ this.speed = setRangeValue(data.speed);
2245
+ }
2246
+ }
2247
+ }
2248
+ class ZIndex_ZIndex extends(null && ValueWithRandom){
2249
+ constructor() {
2250
+ super();
2251
+ this.opacityRate = 1;
2252
+ this.sizeRate = 1;
2253
+ this.velocityRate = 1;
2254
+ }
2255
+ load(data) {
2256
+ super.load(data);
2257
+ if (!data) {
2258
+ return;
2259
+ }
2260
+ if (data.opacityRate !== undefined) {
2261
+ this.opacityRate = data.opacityRate;
2262
+ }
2263
+ if (data.sizeRate !== undefined) {
2264
+ this.sizeRate = data.sizeRate;
2265
+ }
2266
+ if (data.velocityRate !== undefined) {
2267
+ this.velocityRate = data.velocityRate;
2268
+ }
2269
+ }
2270
+ }
2271
+ class ParticlesOptions_ParticlesOptions {
2272
+ constructor() {
2273
+ this.bounce = new Bounce;
2274
+ this.collisions = new Collisions;
2275
+ this.color = new AnimatableColor;
2276
+ this.destroy = new Destroy;
2277
+ this.gradient = [];
2278
+ this.groups = {};
2279
+ this.life = new Life;
2280
+ this.links = new Links;
2281
+ this.move = new Move;
2282
+ this.number = new ParticlesNumber;
2283
+ this.opacity = new Opacity;
2284
+ this.orbit = new Orbit;
2285
+ this.reduceDuplicates = false;
2286
+ this.repulse = new Repulse;
2287
+ this.roll = new Roll;
2288
+ this.rotate = new Rotate;
2289
+ this.shadow = new Shadow;
2290
+ this.shape = new Shape;
2291
+ this.size = new Size;
2292
+ this.stroke = new Stroke;
2293
+ this.tilt = new Tilt;
2294
+ this.twinkle = new Twinkle;
2295
+ this.wobble = new Wobble;
2296
+ this.zIndex = new ZIndex;
2297
+ }
2298
+ get line_linked() {
2299
+ return this.links;
2300
+ }
2301
+ set line_linked(value) {
2302
+ this.links = value;
2303
+ }
2304
+ get lineLinked() {
2305
+ return this.links;
2306
+ }
2307
+ set lineLinked(value) {
2308
+ this.links = value;
2309
+ }
2310
+ load(data) {
2311
+ var _a, _b, _c, _d, _e, _f, _g, _h;
2312
+ if (data === undefined) {
2313
+ return;
2314
+ }
2315
+ this.bounce.load(data.bounce);
2316
+ this.color.load(AnimatableColor.create(this.color, data.color));
2317
+ this.destroy.load(data.destroy);
2318
+ this.life.load(data.life);
2319
+ const links = (_b = (_a = data.links) !== null && _a !== void 0 ? _a : data.lineLinked) !== null && _b !== void 0 ? _b : data.line_linked;
2320
+ if (links !== undefined) {
2321
+ this.links.load(links);
2322
+ }
2323
+ if (data.groups !== undefined) {
2324
+ for (const group in data.groups) {
2325
+ const item = data.groups[group];
2326
+ if (item !== undefined) {
2327
+ this.groups[group] = deepExtend((_c = this.groups[group]) !== null && _c !== void 0 ? _c : {}, item);
2328
+ }
2329
+ }
2330
+ }
2331
+ this.move.load(data.move);
2332
+ this.number.load(data.number);
2333
+ this.opacity.load(data.opacity);
2334
+ this.orbit.load(data.orbit);
2335
+ if (data.reduceDuplicates !== undefined) {
2336
+ this.reduceDuplicates = data.reduceDuplicates;
2337
+ }
2338
+ this.repulse.load(data.repulse);
2339
+ this.roll.load(data.roll);
2340
+ this.rotate.load(data.rotate);
2341
+ this.shape.load(data.shape);
2342
+ this.size.load(data.size);
2343
+ this.shadow.load(data.shadow);
2344
+ this.tilt.load(data.tilt);
2345
+ this.twinkle.load(data.twinkle);
2346
+ this.wobble.load(data.wobble);
2347
+ this.zIndex.load(data.zIndex);
2348
+ const collisions = (_e = (_d = data.move) === null || _d === void 0 ? void 0 : _d.collisions) !== null && _e !== void 0 ? _e : (_f = data.move) === null || _f === void 0 ? void 0 : _f.bounce;
2349
+ if (collisions !== undefined) {
2350
+ this.collisions.enable = collisions;
2351
+ }
2352
+ this.collisions.load(data.collisions);
2353
+ const strokeToLoad = (_g = data.stroke) !== null && _g !== void 0 ? _g : (_h = data.shape) === null || _h === void 0 ? void 0 : _h.stroke;
2354
+ if (strokeToLoad) {
2355
+ if (strokeToLoad instanceof Array) {
2356
+ this.stroke = strokeToLoad.map((s => {
2357
+ const tmp = new Stroke;
2358
+ tmp.load(s);
2359
+ return tmp;
2360
+ }));
2361
+ } else {
2362
+ if (this.stroke instanceof Array) {
2363
+ this.stroke = new Stroke;
2364
+ }
2365
+ this.stroke.load(strokeToLoad);
2366
+ }
2367
+ }
2368
+ const gradientToLoad = data.gradient;
2369
+ if (gradientToLoad) {
2370
+ if (gradientToLoad instanceof Array) {
2371
+ this.gradient = gradientToLoad.map((s => {
2372
+ const tmp = new AnimatableGradient;
2373
+ tmp.load(s);
2374
+ return tmp;
2375
+ }));
2376
+ } else {
2377
+ if (this.gradient instanceof Array) {
2378
+ this.gradient = new AnimatableGradient;
2379
+ }
2380
+ this.gradient.load(gradientToLoad);
2381
+ }
2382
+ }
2383
+ }
2384
+ }
2385
+ class Responsive_Responsive {
2386
+ constructor() {
2387
+ this.maxWidth = Infinity;
2388
+ this.options = {};
2389
+ this.mode = "canvas";
2390
+ }
2391
+ load(data) {
2392
+ if (!data) {
2393
+ return;
2394
+ }
2395
+ if (data.maxWidth !== undefined) {
2396
+ this.maxWidth = data.maxWidth;
2397
+ }
2398
+ if (data.mode !== undefined) {
2399
+ if (data.mode === "screen") {
2400
+ this.mode = "screen";
2401
+ } else {
2402
+ this.mode = "canvas";
2403
+ }
2404
+ }
2405
+ if (data.options !== undefined) {
2406
+ this.options = deepExtend({}, data.options);
2407
+ }
2408
+ }
2409
+ }
2410
+ class Theme_Theme {
2411
+ constructor() {
2412
+ this.name = "";
2413
+ this.default = new ThemeDefault;
2414
+ }
2415
+ load(data) {
2416
+ if (data === undefined) {
2417
+ return;
2418
+ }
2419
+ if (data.name !== undefined) {
2420
+ this.name = data.name;
2421
+ }
2422
+ this.default.load(data.default);
2423
+ if (data.options !== undefined) {
2424
+ this.options = deepExtend({}, data.options);
2425
+ }
2426
+ }
2427
+ }
2428
+ var __classPrivateFieldGet = undefined && undefined.__classPrivateFieldGet || function(receiver, state, kind, f) {
2429
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
2430
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
2431
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
2432
+ };
2433
+ var _Options_instances, _Options_findDefaultTheme;
2434
+ class Options_Options {
2435
+ constructor() {
2436
+ _Options_instances.add(this);
2437
+ this.autoPlay = true;
2438
+ this.background = new Background;
2439
+ this.backgroundMask = new BackgroundMask;
2440
+ this.fullScreen = new FullScreen;
2441
+ this.detectRetina = true;
2442
+ this.duration = 0;
2443
+ this.fpsLimit = 120;
2444
+ this.interactivity = new Interactivity;
2445
+ this.manualParticles = [];
2446
+ this.motion = new Motion;
2447
+ this.particles = new ParticlesOptions;
2448
+ this.pauseOnBlur = true;
2449
+ this.pauseOnOutsideViewport = true;
2450
+ this.responsive = [];
2451
+ this.style = {};
2452
+ this.themes = [];
2453
+ this.zLayers = 100;
2454
+ }
2455
+ get fps_limit() {
2456
+ return this.fpsLimit;
2457
+ }
2458
+ set fps_limit(value) {
2459
+ this.fpsLimit = value;
2460
+ }
2461
+ get retina_detect() {
2462
+ return this.detectRetina;
2463
+ }
2464
+ set retina_detect(value) {
2465
+ this.detectRetina = value;
2466
+ }
2467
+ get backgroundMode() {
2468
+ return this.fullScreen;
2469
+ }
2470
+ set backgroundMode(value) {
2471
+ this.fullScreen.load(value);
2472
+ }
2473
+ load(data) {
2474
+ var _a, _b, _c, _d, _e;
2475
+ if (data === undefined) {
2476
+ return;
2477
+ }
2478
+ if (data.preset !== undefined) {
2479
+ if (data.preset instanceof Array) {
2480
+ for (const preset of data.preset) {
2481
+ this.importPreset(preset);
2482
+ }
2483
+ } else {
2484
+ this.importPreset(data.preset);
2485
+ }
2486
+ }
2487
+ if (data.autoPlay !== undefined) {
2488
+ this.autoPlay = data.autoPlay;
2489
+ }
2490
+ const detectRetina = (_a = data.detectRetina) !== null && _a !== void 0 ? _a : data.retina_detect;
2491
+ if (detectRetina !== undefined) {
2492
+ this.detectRetina = detectRetina;
2493
+ }
2494
+ if (data.duration !== undefined) {
2495
+ this.duration = data.duration;
2496
+ }
2497
+ const fpsLimit = (_b = data.fpsLimit) !== null && _b !== void 0 ? _b : data.fps_limit;
2498
+ if (fpsLimit !== undefined) {
2499
+ this.fpsLimit = fpsLimit;
2500
+ }
2501
+ if (data.pauseOnBlur !== undefined) {
2502
+ this.pauseOnBlur = data.pauseOnBlur;
2503
+ }
2504
+ if (data.pauseOnOutsideViewport !== undefined) {
2505
+ this.pauseOnOutsideViewport = data.pauseOnOutsideViewport;
2506
+ }
2507
+ if (data.zLayers !== undefined) {
2508
+ this.zLayers = data.zLayers;
2509
+ }
2510
+ this.background.load(data.background);
2511
+ const fullScreen = (_c = data.fullScreen) !== null && _c !== void 0 ? _c : data.backgroundMode;
2512
+ if (typeof fullScreen === "boolean") {
2513
+ this.fullScreen.enable = fullScreen;
2514
+ } else {
2515
+ this.fullScreen.load(fullScreen);
2516
+ }
2517
+ this.backgroundMask.load(data.backgroundMask);
2518
+ this.interactivity.load(data.interactivity);
2519
+ if (data.manualParticles !== undefined) {
2520
+ this.manualParticles = data.manualParticles.map((t => {
2521
+ const tmp = new ManualParticle;
2522
+ tmp.load(t);
2523
+ return tmp;
2524
+ }));
2525
+ }
2526
+ this.motion.load(data.motion);
2527
+ this.particles.load(data.particles);
2528
+ this.style = deepExtend(this.style, data.style);
2529
+ Plugins.loadOptions(this, data);
2530
+ if (data.responsive !== undefined) {
2531
+ for (const responsive of data.responsive) {
2532
+ const optResponsive = new Responsive;
2533
+ optResponsive.load(responsive);
2534
+ this.responsive.push(optResponsive);
2535
+ }
2536
+ }
2537
+ this.responsive.sort(((a, b) => a.maxWidth - b.maxWidth));
2538
+ if (data.themes !== undefined) {
2539
+ for (const theme of data.themes) {
2540
+ const optTheme = new Theme;
2541
+ optTheme.load(theme);
2542
+ this.themes.push(optTheme);
2543
+ }
2544
+ }
2545
+ this.defaultDarkTheme = (_d = __classPrivateFieldGet(this, _Options_instances, "m", _Options_findDefaultTheme).call(this, "dark")) === null || _d === void 0 ? void 0 : _d.name;
2546
+ this.defaultLightTheme = (_e = __classPrivateFieldGet(this, _Options_instances, "m", _Options_findDefaultTheme).call(this, "light")) === null || _e === void 0 ? void 0 : _e.name;
2547
+ }
2548
+ setTheme(name) {
2549
+ if (name) {
2550
+ const chosenTheme = this.themes.find((theme => theme.name === name));
2551
+ if (chosenTheme) {
2552
+ this.load(chosenTheme.options);
2553
+ }
2554
+ } else {
2555
+ const mediaMatch = typeof matchMedia !== "undefined" && matchMedia("(prefers-color-scheme: dark)"), clientDarkMode = mediaMatch && mediaMatch.matches, defaultTheme = __classPrivateFieldGet(this, _Options_instances, "m", _Options_findDefaultTheme).call(this, clientDarkMode ? "dark" : "light");
2556
+ if (defaultTheme) {
2557
+ this.load(defaultTheme.options);
2558
+ }
2559
+ }
2560
+ }
2561
+ setResponsive(width, pxRatio, defaultOptions) {
2562
+ this.load(defaultOptions);
2563
+ const responsiveOptions = this.responsive.find((t => t.mode === "screen" && screen ? t.maxWidth * pxRatio > screen.availWidth : t.maxWidth * pxRatio > width));
2564
+ this.load(responsiveOptions === null || responsiveOptions === void 0 ? void 0 : responsiveOptions.options);
2565
+ return responsiveOptions === null || responsiveOptions === void 0 ? void 0 : responsiveOptions.maxWidth;
2566
+ }
2567
+ importPreset(preset) {
2568
+ this.load(Plugins.getPreset(preset));
2569
+ }
2570
+ }
2571
+ _Options_instances = new WeakSet, _Options_findDefaultTheme = function _Options_findDefaultTheme(mode) {
2572
+ var _a;
2573
+ return (_a = this.themes.find((theme => theme.default.value && theme.default.mode === mode))) !== null && _a !== void 0 ? _a : this.themes.find((theme => theme.default.value && theme.default.mode === "any"));
2574
+ };
2575
+ const fixOutMode = data => {
2576
+ if (isInArray(data.outMode, data.checkModes) || isInArray(data.outMode, data.checkModes)) {
2577
+ if (data.coord > data.maxCoord - data.radius * 2) {
2578
+ data.setCb(-data.radius);
2579
+ } else if (data.coord < data.radius * 2) {
2580
+ data.setCb(data.radius);
2581
+ }
2582
+ }
2583
+ };
2584
+ class Particle_Particle {
2585
+ constructor(id, container, position, overrideOptions, group) {
2586
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
2587
+ this.id = id;
2588
+ this.container = container;
2589
+ this.group = group;
2590
+ this.fill = true;
2591
+ this.close = true;
2592
+ this.lastPathTime = 0;
2593
+ this.destroyed = false;
2594
+ this.unbreakable = false;
2595
+ this.splitCount = 0;
2596
+ this.misplaced = false;
2597
+ this.retina = {
2598
+ maxDistance: {}
2599
+ };
2600
+ const pxRatio = container.retina.pixelRatio;
2601
+ const mainOptions = container.actualOptions;
2602
+ const particlesOptions = new ParticlesOptions;
2603
+ particlesOptions.load(mainOptions.particles);
2604
+ const shapeType = particlesOptions.shape.type;
2605
+ const reduceDuplicates = particlesOptions.reduceDuplicates;
2606
+ this.shape = shapeType instanceof Array ? itemFromArray(shapeType, this.id, reduceDuplicates) : shapeType;
2607
+ if (overrideOptions === null || overrideOptions === void 0 ? void 0 : overrideOptions.shape) {
2608
+ if (overrideOptions.shape.type) {
2609
+ const overrideShapeType = overrideOptions.shape.type;
2610
+ this.shape = overrideShapeType instanceof Array ? itemFromArray(overrideShapeType, this.id, reduceDuplicates) : overrideShapeType;
2611
+ }
2612
+ const shapeOptions = new Shape;
2613
+ shapeOptions.load(overrideOptions.shape);
2614
+ if (this.shape) {
2615
+ this.shapeData = this.loadShapeData(shapeOptions, reduceDuplicates);
2616
+ }
2617
+ } else {
2618
+ this.shapeData = this.loadShapeData(particlesOptions.shape, reduceDuplicates);
2619
+ }
2620
+ if (overrideOptions !== undefined) {
2621
+ particlesOptions.load(overrideOptions);
2622
+ }
2623
+ if (((_a = this.shapeData) === null || _a === void 0 ? void 0 : _a.particles) !== undefined) {
2624
+ particlesOptions.load((_b = this.shapeData) === null || _b === void 0 ? void 0 : _b.particles);
2625
+ }
2626
+ this.fill = (_d = (_c = this.shapeData) === null || _c === void 0 ? void 0 : _c.fill) !== null && _d !== void 0 ? _d : this.fill;
2627
+ this.close = (_f = (_e = this.shapeData) === null || _e === void 0 ? void 0 : _e.close) !== null && _f !== void 0 ? _f : this.close;
2628
+ this.options = particlesOptions;
2629
+ this.pathDelay = getValue(this.options.move.path.delay) * 1e3;
2630
+ const zIndexValue = getRangeValue(this.options.zIndex.value);
2631
+ container.retina.initParticle(this);
2632
+ const sizeOptions = this.options.size, sizeRange = sizeOptions.value;
2633
+ this.size = {
2634
+ enable: sizeOptions.animation.enable,
2635
+ value: getValue(sizeOptions) * container.retina.pixelRatio,
2636
+ max: getRangeMax(sizeRange) * pxRatio,
2637
+ min: getRangeMin(sizeRange) * pxRatio,
2638
+ loops: 0,
2639
+ maxLoops: sizeOptions.animation.count
2640
+ };
2641
+ const sizeAnimation = sizeOptions.animation;
2642
+ if (sizeAnimation.enable) {
2643
+ this.size.status = 0;
2644
+ switch (sizeAnimation.startValue) {
2645
+ case "min":
2646
+ this.size.value = this.size.min;
2647
+ this.size.status = 0;
2648
+ break;
2649
+
2650
+ case "random":
2651
+ this.size.value = randomInRange(this.size) * pxRatio;
2652
+ this.size.status = Math.random() >= .5 ? 0 : 1;
2653
+ break;
2654
+
2655
+ case "max":
2656
+ default:
2657
+ this.size.value = this.size.max;
2658
+ this.size.status = 1;
2659
+ break;
2660
+ }
2661
+ this.size.velocity = ((_g = this.retina.sizeAnimationSpeed) !== null && _g !== void 0 ? _g : container.retina.sizeAnimationSpeed) / 100 * container.retina.reduceFactor;
2662
+ if (!sizeAnimation.sync) {
2663
+ this.size.velocity *= Math.random();
2664
+ }
2665
+ }
2666
+ this.direction = getParticleDirectionAngle(this.options.move.direction);
2667
+ this.bubble = {
2668
+ inRange: false
2669
+ };
2670
+ this.initialVelocity = this.calculateVelocity();
2671
+ this.velocity = this.initialVelocity.copy();
2672
+ this.moveDecay = 1 - getRangeValue(this.options.move.decay);
2673
+ this.position = this.calcPosition(container, position, clamp(zIndexValue, 0, container.zLayers));
2674
+ this.initialPosition = this.position.copy();
2675
+ this.offset = Vector.origin;
2676
+ const particles = container.particles;
2677
+ particles.needsSort = particles.needsSort || particles.lastZIndex < this.position.z;
2678
+ particles.lastZIndex = this.position.z;
2679
+ this.zIndexFactor = this.position.z / container.zLayers;
2680
+ this.sides = 24;
2681
+ let drawer = container.drawers.get(this.shape);
2682
+ if (!drawer) {
2683
+ drawer = Plugins.getShapeDrawer(this.shape);
2684
+ if (drawer) {
2685
+ container.drawers.set(this.shape, drawer);
2686
+ }
2687
+ }
2688
+ if (drawer === null || drawer === void 0 ? void 0 : drawer.loadShape) {
2689
+ drawer === null || drawer === void 0 ? void 0 : drawer.loadShape(this);
2690
+ }
2691
+ const sideCountFunc = drawer === null || drawer === void 0 ? void 0 : drawer.getSidesCount;
2692
+ if (sideCountFunc) {
2693
+ this.sides = sideCountFunc(this);
2694
+ }
2695
+ this.life = this.loadLife();
2696
+ this.spawning = this.life.delay > 0;
2697
+ if (this.options.move.spin.enable) {
2698
+ const spinPos = (_h = this.options.move.spin.position) !== null && _h !== void 0 ? _h : {
2699
+ x: 50,
2700
+ y: 50
2701
+ };
2702
+ const spinCenter = {
2703
+ x: spinPos.x / 100 * container.canvas.size.width,
2704
+ y: spinPos.y / 100 * container.canvas.size.height
2705
+ };
2706
+ const pos = this.getPosition();
2707
+ const distance = getDistance(pos, spinCenter);
2708
+ this.spin = {
2709
+ center: spinCenter,
2710
+ direction: this.velocity.x >= 0 ? "clockwise" : "counter-clockwise",
2711
+ angle: this.velocity.angle,
2712
+ radius: distance,
2713
+ acceleration: (_j = this.retina.spinAcceleration) !== null && _j !== void 0 ? _j : getRangeValue(this.options.move.spin.acceleration)
2714
+ };
2715
+ }
2716
+ this.shadowColor = colorToRgb(this.options.shadow.color);
2717
+ for (const updater of container.particles.updaters) {
2718
+ if (updater.init) {
2719
+ updater.init(this);
2720
+ }
2721
+ }
2722
+ if (drawer && drawer.particleInit) {
2723
+ drawer.particleInit(container, this);
2724
+ }
2725
+ for (const [, plugin] of container.plugins) {
2726
+ if (plugin.particleCreated) {
2727
+ plugin.particleCreated(this);
2728
+ }
2729
+ }
2730
+ }
2731
+ isVisible() {
2732
+ return !this.destroyed && !this.spawning && this.isInsideCanvas();
2733
+ }
2734
+ isInsideCanvas() {
2735
+ const radius = this.getRadius();
2736
+ const canvasSize = this.container.canvas.size;
2737
+ return this.position.x >= -radius && this.position.y >= -radius && this.position.y <= canvasSize.height + radius && this.position.x <= canvasSize.width + radius;
2738
+ }
2739
+ draw(delta) {
2740
+ const container = this.container;
2741
+ for (const [, plugin] of container.plugins) {
2742
+ container.canvas.drawParticlePlugin(plugin, this, delta);
2743
+ }
2744
+ container.canvas.drawParticle(this, delta);
2745
+ }
2746
+ getPosition() {
2747
+ return {
2748
+ x: this.position.x + this.offset.x,
2749
+ y: this.position.y + this.offset.y,
2750
+ z: this.position.z
2751
+ };
2752
+ }
2753
+ getRadius() {
2754
+ var _a;
2755
+ return (_a = this.bubble.radius) !== null && _a !== void 0 ? _a : this.size.value;
2756
+ }
2757
+ getMass() {
2758
+ return this.getRadius() ** 2 * Math.PI / 2;
2759
+ }
2760
+ getFillColor() {
2761
+ var _a, _b, _c;
2762
+ const color = (_a = this.bubble.color) !== null && _a !== void 0 ? _a : getHslFromAnimation(this.color);
2763
+ if (color && this.roll && (this.backColor || this.roll.alter)) {
2764
+ const rolled = Math.floor(((_c = (_b = this.roll) === null || _b === void 0 ? void 0 : _b.angle) !== null && _c !== void 0 ? _c : 0) / (Math.PI / 2)) % 2;
2765
+ if (rolled) {
2766
+ if (this.backColor) {
2767
+ return this.backColor;
2768
+ }
2769
+ if (this.roll.alter) {
2770
+ return alterHsl(color, this.roll.alter.type, this.roll.alter.value);
2771
+ }
2772
+ }
2773
+ }
2774
+ return color;
2775
+ }
2776
+ getStrokeColor() {
2777
+ var _a, _b;
2778
+ return (_b = (_a = this.bubble.color) !== null && _a !== void 0 ? _a : getHslFromAnimation(this.strokeColor)) !== null && _b !== void 0 ? _b : this.getFillColor();
2779
+ }
2780
+ destroy(override) {
2781
+ this.destroyed = true;
2782
+ this.bubble.inRange = false;
2783
+ if (this.unbreakable) {
2784
+ return;
2785
+ }
2786
+ this.destroyed = true;
2787
+ this.bubble.inRange = false;
2788
+ for (const [, plugin] of this.container.plugins) {
2789
+ if (plugin.particleDestroyed) {
2790
+ plugin.particleDestroyed(this, override);
2791
+ }
2792
+ }
2793
+ if (override) {
2794
+ return;
2795
+ }
2796
+ const destroyOptions = this.options.destroy;
2797
+ if (destroyOptions.mode === "split") {
2798
+ this.split();
2799
+ }
2800
+ }
2801
+ reset() {
2802
+ if (this.opacity) {
2803
+ this.opacity.loops = 0;
2804
+ }
2805
+ this.size.loops = 0;
2806
+ }
2807
+ split() {
2808
+ const splitOptions = this.options.destroy.split;
2809
+ if (splitOptions.count >= 0 && this.splitCount++ > splitOptions.count) {
2810
+ return;
2811
+ }
2812
+ const rate = getRangeValue(splitOptions.rate.value);
2813
+ for (let i = 0; i < rate; i++) {
2814
+ this.container.particles.addSplitParticle(this);
2815
+ }
2816
+ }
2817
+ calcPosition(container, position, zIndex, tryCount = 0) {
2818
+ var _a, _b, _c, _d, _e, _f;
2819
+ for (const [, plugin] of container.plugins) {
2820
+ const pluginPos = plugin.particlePosition !== undefined ? plugin.particlePosition(position, this) : undefined;
2821
+ if (pluginPos !== undefined) {
2822
+ return Vector3d.create(pluginPos.x, pluginPos.y, zIndex);
2823
+ }
2824
+ }
2825
+ const canvasSize = container.canvas.size;
2826
+ const pos = Vector3d.create((_a = position === null || position === void 0 ? void 0 : position.x) !== null && _a !== void 0 ? _a : Math.random() * canvasSize.width, (_b = position === null || position === void 0 ? void 0 : position.y) !== null && _b !== void 0 ? _b : Math.random() * canvasSize.height, zIndex);
2827
+ const radius = this.getRadius();
2828
+ const outModes = this.options.move.outModes, fixHorizontal = outMode => {
2829
+ fixOutMode({
2830
+ outMode: outMode,
2831
+ checkModes: [ "bounce", "bounce-horizontal" ],
2832
+ coord: pos.x,
2833
+ maxCoord: container.canvas.size.width,
2834
+ setCb: value => pos.x += value,
2835
+ radius: radius
2836
+ });
2837
+ }, fixVertical = outMode => {
2838
+ fixOutMode({
2839
+ outMode: outMode,
2840
+ checkModes: [ "bounce", "bounce-vertical" ],
2841
+ coord: pos.y,
2842
+ maxCoord: container.canvas.size.height,
2843
+ setCb: value => pos.y += value,
2844
+ radius: radius
2845
+ });
2846
+ };
2847
+ fixHorizontal((_c = outModes.left) !== null && _c !== void 0 ? _c : outModes.default);
2848
+ fixHorizontal((_d = outModes.right) !== null && _d !== void 0 ? _d : outModes.default);
2849
+ fixVertical((_e = outModes.top) !== null && _e !== void 0 ? _e : outModes.default);
2850
+ fixVertical((_f = outModes.bottom) !== null && _f !== void 0 ? _f : outModes.default);
2851
+ if (this.checkOverlap(pos, tryCount)) {
2852
+ return this.calcPosition(container, undefined, zIndex, tryCount + 1);
2853
+ }
2854
+ return pos;
2855
+ }
2856
+ checkOverlap(pos, tryCount = 0) {
2857
+ const collisionsOptions = this.options.collisions;
2858
+ const radius = this.getRadius();
2859
+ if (!collisionsOptions.enable) {
2860
+ return false;
2861
+ }
2862
+ const overlapOptions = collisionsOptions.overlap;
2863
+ if (overlapOptions.enable) {
2864
+ return false;
2865
+ }
2866
+ const retries = overlapOptions.retries;
2867
+ if (retries >= 0 && tryCount > retries) {
2868
+ throw new Error("Particle is overlapping and can't be placed");
2869
+ }
2870
+ let overlaps = false;
2871
+ for (const particle of this.container.particles.array) {
2872
+ if (getDistance(pos, particle.position) < radius + particle.getRadius()) {
2873
+ overlaps = true;
2874
+ break;
2875
+ }
2876
+ }
2877
+ return overlaps;
2878
+ }
2879
+ calculateVelocity() {
2880
+ const baseVelocity = getParticleBaseVelocity(this.direction);
2881
+ const res = baseVelocity.copy();
2882
+ const moveOptions = this.options.move;
2883
+ const rad = Math.PI / 180 * moveOptions.angle.value;
2884
+ const radOffset = Math.PI / 180 * moveOptions.angle.offset;
2885
+ const range = {
2886
+ left: radOffset - rad / 2,
2887
+ right: radOffset + rad / 2
2888
+ };
2889
+ if (!moveOptions.straight) {
2890
+ res.angle += randomInRange(setRangeValue(range.left, range.right));
2891
+ }
2892
+ if (moveOptions.random && typeof moveOptions.speed === "number") {
2893
+ res.length *= Math.random();
2894
+ }
2895
+ return res;
2896
+ }
2897
+ loadShapeData(shapeOptions, reduceDuplicates) {
2898
+ const shapeData = shapeOptions.options[this.shape];
2899
+ if (shapeData) {
2900
+ return deepExtend({}, shapeData instanceof Array ? itemFromArray(shapeData, this.id, reduceDuplicates) : shapeData);
2901
+ }
2902
+ }
2903
+ loadLife() {
2904
+ const container = this.container;
2905
+ const particlesOptions = this.options;
2906
+ const lifeOptions = particlesOptions.life;
2907
+ const life = {
2908
+ delay: container.retina.reduceFactor ? getRangeValue(lifeOptions.delay.value) * (lifeOptions.delay.sync ? 1 : Math.random()) / container.retina.reduceFactor * 1e3 : 0,
2909
+ delayTime: 0,
2910
+ duration: container.retina.reduceFactor ? getRangeValue(lifeOptions.duration.value) * (lifeOptions.duration.sync ? 1 : Math.random()) / container.retina.reduceFactor * 1e3 : 0,
2911
+ time: 0,
2912
+ count: particlesOptions.life.count
2913
+ };
2914
+ if (life.duration <= 0) {
2915
+ life.duration = -1;
2916
+ }
2917
+ if (life.count <= 0) {
2918
+ life.count = -1;
2919
+ }
2920
+ return life;
2921
+ }
2922
+ }
2923
+ class Particles_Particles {
2924
+ constructor(container) {
2925
+ this.container = container;
2926
+ this.nextId = 0;
2927
+ this.array = [];
2928
+ this.zArray = [];
2929
+ this.mover = new ParticlesMover(container);
2930
+ this.limit = 0;
2931
+ this.needsSort = false;
2932
+ this.lastZIndex = 0;
2933
+ this.freqs = {
2934
+ links: new Map,
2935
+ triangles: new Map
2936
+ };
2937
+ this.interactionManager = new InteractionManager(container);
2938
+ const canvasSize = this.container.canvas.size;
2939
+ this.linksColors = new Map;
2940
+ this.quadTree = new QuadTree(new Rectangle(-canvasSize.width / 4, -canvasSize.height / 4, canvasSize.width * 3 / 2, canvasSize.height * 3 / 2), 4);
2941
+ this.updaters = Plugins.getUpdaters(container, true);
2942
+ }
2943
+ get count() {
2944
+ return this.array.length;
2945
+ }
2946
+ init() {
2947
+ var _a;
2948
+ const container = this.container;
2949
+ const options = container.actualOptions;
2950
+ this.lastZIndex = 0;
2951
+ this.needsSort = false;
2952
+ this.freqs.links = new Map;
2953
+ this.freqs.triangles = new Map;
2954
+ let handled = false;
2955
+ this.updaters = Plugins.getUpdaters(container, true);
2956
+ this.interactionManager.init();
2957
+ for (const [, plugin] of container.plugins) {
2958
+ if (plugin.particlesInitialization !== undefined) {
2959
+ handled = plugin.particlesInitialization();
2960
+ }
2961
+ if (handled) {
2962
+ break;
2963
+ }
2964
+ }
2965
+ this.addManualParticles();
2966
+ if (!handled) {
2967
+ for (const group in options.particles.groups) {
2968
+ const groupOptions = options.particles.groups[group];
2969
+ for (let i = this.count, j = 0; j < ((_a = groupOptions.number) === null || _a === void 0 ? void 0 : _a.value) && i < options.particles.number.value; i++,
2970
+ j++) {
2971
+ this.addParticle(undefined, groupOptions, group);
2972
+ }
2973
+ }
2974
+ for (let i = this.count; i < options.particles.number.value; i++) {
2975
+ this.addParticle();
2976
+ }
2977
+ }
2978
+ container.pathGenerator.init(container);
2979
+ }
2980
+ redraw() {
2981
+ this.clear();
2982
+ this.init();
2983
+ this.draw({
2984
+ value: 0,
2985
+ factor: 0
2986
+ });
2987
+ }
2988
+ removeAt(index, quantity = 1, group, override) {
2989
+ if (!(index >= 0 && index <= this.count)) {
2990
+ return;
2991
+ }
2992
+ let deleted = 0;
2993
+ for (let i = index; deleted < quantity && i < this.count; i++) {
2994
+ const particle = this.array[i];
2995
+ if (!particle || particle.group !== group) {
2996
+ continue;
2997
+ }
2998
+ particle.destroy(override);
2999
+ this.array.splice(i--, 1);
3000
+ const zIdx = this.zArray.indexOf(particle);
3001
+ this.zArray.splice(zIdx, 1);
3002
+ deleted++;
3003
+ }
3004
+ }
3005
+ remove(particle, group, override) {
3006
+ this.removeAt(this.array.indexOf(particle), undefined, group, override);
3007
+ }
3008
+ update(delta) {
3009
+ const container = this.container;
3010
+ const particlesToDelete = [];
3011
+ container.pathGenerator.update();
3012
+ for (const [, plugin] of container.plugins) {
3013
+ if (plugin.update !== undefined) {
3014
+ plugin.update(delta);
3015
+ }
3016
+ }
3017
+ for (const particle of this.array) {
3018
+ const resizeFactor = container.canvas.resizeFactor;
3019
+ if (resizeFactor) {
3020
+ particle.position.x *= resizeFactor.width;
3021
+ particle.position.y *= resizeFactor.height;
3022
+ }
3023
+ particle.bubble.inRange = false;
3024
+ for (const [, plugin] of this.container.plugins) {
3025
+ if (particle.destroyed) {
3026
+ break;
3027
+ }
3028
+ if (plugin.particleUpdate) {
3029
+ plugin.particleUpdate(particle, delta);
3030
+ }
3031
+ }
3032
+ this.mover.move(particle, delta);
3033
+ if (particle.destroyed) {
3034
+ particlesToDelete.push(particle);
3035
+ continue;
3036
+ }
3037
+ this.quadTree.insert(new Point(particle.getPosition(), particle));
3038
+ }
3039
+ for (const particle of particlesToDelete) {
3040
+ this.remove(particle);
3041
+ }
3042
+ this.interactionManager.externalInteract(delta);
3043
+ for (const particle of container.particles.array) {
3044
+ for (const updater of this.updaters) {
3045
+ updater.update(particle, delta);
3046
+ }
3047
+ if (!particle.destroyed && !particle.spawning) {
3048
+ this.interactionManager.particlesInteract(particle, delta);
3049
+ }
3050
+ }
3051
+ delete container.canvas.resizeFactor;
3052
+ }
3053
+ draw(delta) {
3054
+ const container = this.container;
3055
+ container.canvas.clear();
3056
+ const canvasSize = this.container.canvas.size;
3057
+ this.quadTree = new QuadTree(new Rectangle(-canvasSize.width / 4, -canvasSize.height / 4, canvasSize.width * 3 / 2, canvasSize.height * 3 / 2), 4);
3058
+ this.update(delta);
3059
+ if (this.needsSort) {
3060
+ this.zArray.sort(((a, b) => b.position.z - a.position.z || a.id - b.id));
3061
+ this.lastZIndex = this.zArray[this.zArray.length - 1].position.z;
3062
+ this.needsSort = false;
3063
+ }
3064
+ for (const [, plugin] of container.plugins) {
3065
+ container.canvas.drawPlugin(plugin, delta);
3066
+ }
3067
+ for (const p of this.zArray) {
3068
+ p.draw(delta);
3069
+ }
3070
+ }
3071
+ clear() {
3072
+ this.array = [];
3073
+ this.zArray = [];
3074
+ }
3075
+ push(nb, mouse, overrideOptions, group) {
3076
+ this.pushing = true;
3077
+ for (let i = 0; i < nb; i++) {
3078
+ this.addParticle(mouse === null || mouse === void 0 ? void 0 : mouse.position, overrideOptions, group);
3079
+ }
3080
+ this.pushing = false;
3081
+ }
3082
+ addParticle(position, overrideOptions, group) {
3083
+ const container = this.container, options = container.actualOptions, limit = options.particles.number.limit * container.density;
3084
+ if (limit > 0) {
3085
+ const countToRemove = this.count + 1 - limit;
3086
+ if (countToRemove > 0) {
3087
+ this.removeQuantity(countToRemove);
3088
+ }
3089
+ }
3090
+ return this.pushParticle(position, overrideOptions, group);
3091
+ }
3092
+ addSplitParticle(parent) {
3093
+ const splitOptions = parent.options.destroy.split, options = new ParticlesOptions;
3094
+ options.load(parent.options);
3095
+ const factor = getRangeValue(splitOptions.factor.value);
3096
+ options.color.load({
3097
+ value: {
3098
+ hsl: parent.getFillColor()
3099
+ }
3100
+ });
3101
+ if (typeof options.size.value === "number") {
3102
+ options.size.value /= factor;
3103
+ } else {
3104
+ options.size.value.min /= factor;
3105
+ options.size.value.max /= factor;
3106
+ }
3107
+ options.load(splitOptions.particles);
3108
+ const offset = splitOptions.sizeOffset ? setRangeValue(-parent.size.value, parent.size.value) : 0;
3109
+ const position = {
3110
+ x: parent.position.x + randomInRange(offset),
3111
+ y: parent.position.y + randomInRange(offset)
3112
+ };
3113
+ return this.pushParticle(position, options, parent.group, (particle => {
3114
+ if (particle.size.value < .5) {
3115
+ return false;
3116
+ }
3117
+ particle.velocity.length = randomInRange(setRangeValue(parent.velocity.length, particle.velocity.length));
3118
+ particle.splitCount = parent.splitCount + 1;
3119
+ particle.unbreakable = true;
3120
+ setTimeout((() => {
3121
+ particle.unbreakable = false;
3122
+ }), 500);
3123
+ return true;
3124
+ }));
3125
+ }
3126
+ removeQuantity(quantity, group) {
3127
+ this.removeAt(0, quantity, group);
3128
+ }
3129
+ getLinkFrequency(p1, p2) {
3130
+ const range = setRangeValue(p1.id, p2.id), key = `${getRangeMin(range)}_${getRangeMax(range)}`;
3131
+ let res = this.freqs.links.get(key);
3132
+ if (res === undefined) {
3133
+ res = Math.random();
3134
+ this.freqs.links.set(key, res);
3135
+ }
3136
+ return res;
3137
+ }
3138
+ getTriangleFrequency(p1, p2, p3) {
3139
+ let [id1, id2, id3] = [ p1.id, p2.id, p3.id ];
3140
+ if (id1 > id2) {
3141
+ [id2, id1] = [ id1, id2 ];
3142
+ }
3143
+ if (id2 > id3) {
3144
+ [id3, id2] = [ id2, id3 ];
3145
+ }
3146
+ if (id1 > id3) {
3147
+ [id3, id1] = [ id1, id3 ];
3148
+ }
3149
+ const key = `${id1}_${id2}_${id3}`;
3150
+ let res = this.freqs.triangles.get(key);
3151
+ if (res === undefined) {
3152
+ res = Math.random();
3153
+ this.freqs.triangles.set(key, res);
3154
+ }
3155
+ return res;
3156
+ }
3157
+ addManualParticles() {
3158
+ const container = this.container, options = container.actualOptions;
3159
+ for (const particle of options.manualParticles) {
3160
+ const pos = particle.position ? {
3161
+ x: particle.position.x * container.canvas.size.width / 100,
3162
+ y: particle.position.y * container.canvas.size.height / 100
3163
+ } : undefined;
3164
+ this.addParticle(pos, particle.options);
3165
+ }
3166
+ }
3167
+ setDensity() {
3168
+ const options = this.container.actualOptions;
3169
+ for (const group in options.particles.groups) {
3170
+ this.applyDensity(options.particles.groups[group], 0, group);
3171
+ }
3172
+ this.applyDensity(options.particles, options.manualParticles.length);
3173
+ }
3174
+ applyDensity(options, manualCount, group) {
3175
+ var _a;
3176
+ if (!((_a = options.number.density) === null || _a === void 0 ? void 0 : _a.enable)) {
3177
+ return;
3178
+ }
3179
+ const numberOptions = options.number;
3180
+ const densityFactor = this.initDensityFactor(numberOptions.density);
3181
+ const optParticlesNumber = numberOptions.value;
3182
+ const optParticlesLimit = numberOptions.limit > 0 ? numberOptions.limit : optParticlesNumber;
3183
+ const particlesNumber = Math.min(optParticlesNumber, optParticlesLimit) * densityFactor + manualCount;
3184
+ const particlesCount = Math.min(this.count, this.array.filter((t => t.group === group)).length);
3185
+ this.limit = numberOptions.limit * densityFactor;
3186
+ if (particlesCount < particlesNumber) {
3187
+ this.push(Math.abs(particlesNumber - particlesCount), undefined, options, group);
3188
+ } else if (particlesCount > particlesNumber) {
3189
+ this.removeQuantity(particlesCount - particlesNumber, group);
3190
+ }
3191
+ }
3192
+ initDensityFactor(densityOptions) {
3193
+ const container = this.container;
3194
+ if (!container.canvas.element || !densityOptions.enable) {
3195
+ return 1;
3196
+ }
3197
+ const canvas = container.canvas.element, pxRatio = container.retina.pixelRatio;
3198
+ return canvas.width * canvas.height / (densityOptions.factor * pxRatio ** 2 * densityOptions.area);
3199
+ }
3200
+ pushParticle(position, overrideOptions, group, initializer) {
3201
+ try {
3202
+ const particle = new Particle(this.nextId, this.container, position, overrideOptions, group);
3203
+ let canAdd = true;
3204
+ if (initializer) {
3205
+ canAdd = initializer(particle);
3206
+ }
3207
+ if (!canAdd) {
3208
+ return;
3209
+ }
3210
+ this.array.push(particle);
3211
+ this.zArray.push(particle);
3212
+ this.nextId++;
3213
+ return particle;
3214
+ } catch (e) {
3215
+ console.warn(`error adding particle: ${e}`);
3216
+ return;
3217
+ }
3218
+ }
3219
+ }
3220
+ class Retina_Retina {
3221
+ constructor(container) {
3222
+ this.container = container;
3223
+ }
3224
+ init() {
3225
+ const container = this.container;
3226
+ const options = container.actualOptions;
3227
+ this.pixelRatio = !options.detectRetina || isSsr() ? 1 : window.devicePixelRatio;
3228
+ const motionOptions = this.container.actualOptions.motion;
3229
+ if (motionOptions && (motionOptions.disable || motionOptions.reduce.value)) {
3230
+ if (isSsr() || typeof matchMedia === "undefined" || !matchMedia) {
3231
+ this.reduceFactor = 1;
3232
+ } else {
3233
+ const mediaQuery = matchMedia("(prefers-reduced-motion: reduce)");
3234
+ if (mediaQuery) {
3235
+ this.handleMotionChange(mediaQuery);
3236
+ const handleChange = () => {
3237
+ this.handleMotionChange(mediaQuery);
3238
+ container.refresh().catch((() => {}));
3239
+ };
3240
+ if (mediaQuery.addEventListener !== undefined) {
3241
+ mediaQuery.addEventListener("change", handleChange);
3242
+ } else if (mediaQuery.addListener !== undefined) {
3243
+ mediaQuery.addListener(handleChange);
3244
+ }
3245
+ }
3246
+ }
3247
+ } else {
3248
+ this.reduceFactor = 1;
3249
+ }
3250
+ const ratio = this.pixelRatio;
3251
+ if (container.canvas.element) {
3252
+ const element = container.canvas.element;
3253
+ container.canvas.size.width = element.offsetWidth * ratio;
3254
+ container.canvas.size.height = element.offsetHeight * ratio;
3255
+ }
3256
+ const particles = options.particles;
3257
+ this.attractDistance = particles.move.attract.distance * ratio;
3258
+ this.linksDistance = particles.links.distance * ratio;
3259
+ this.linksWidth = particles.links.width * ratio;
3260
+ this.sizeAnimationSpeed = particles.size.animation.speed * ratio;
3261
+ this.maxSpeed = particles.move.gravity.maxSpeed * ratio;
3262
+ if (particles.orbit.radius !== undefined) {
3263
+ this.orbitRadius = particles.orbit.radius * this.container.retina.pixelRatio;
3264
+ }
3265
+ const modes = options.interactivity.modes;
3266
+ this.connectModeDistance = modes.connect.distance * ratio;
3267
+ this.connectModeRadius = modes.connect.radius * ratio;
3268
+ this.grabModeDistance = modes.grab.distance * ratio;
3269
+ this.repulseModeDistance = modes.repulse.distance * ratio;
3270
+ this.bounceModeDistance = modes.bounce.distance * ratio;
3271
+ this.attractModeDistance = modes.attract.distance * ratio;
3272
+ this.slowModeRadius = modes.slow.radius * ratio;
3273
+ this.bubbleModeDistance = modes.bubble.distance * ratio;
3274
+ if (modes.bubble.size) {
3275
+ this.bubbleModeSize = modes.bubble.size * ratio;
3276
+ }
3277
+ }
3278
+ initParticle(particle) {
3279
+ const options = particle.options;
3280
+ const ratio = this.pixelRatio;
3281
+ const moveDistance = options.move.distance;
3282
+ const props = particle.retina;
3283
+ props.attractDistance = options.move.attract.distance * ratio;
3284
+ props.linksDistance = options.links.distance * ratio;
3285
+ props.linksWidth = options.links.width * ratio;
3286
+ props.moveDrift = getRangeValue(options.move.drift) * ratio;
3287
+ props.moveSpeed = getRangeValue(options.move.speed) * ratio;
3288
+ props.sizeAnimationSpeed = options.size.animation.speed * ratio;
3289
+ if (particle.spin) {
3290
+ props.spinAcceleration = getRangeValue(options.move.spin.acceleration) * ratio;
3291
+ }
3292
+ const maxDistance = props.maxDistance;
3293
+ maxDistance.horizontal = moveDistance.horizontal !== undefined ? moveDistance.horizontal * ratio : undefined;
3294
+ maxDistance.vertical = moveDistance.vertical !== undefined ? moveDistance.vertical * ratio : undefined;
3295
+ props.maxSpeed = options.move.gravity.maxSpeed * ratio;
3296
+ }
3297
+ handleMotionChange(mediaQuery) {
3298
+ const options = this.container.actualOptions;
3299
+ if (mediaQuery.matches) {
3300
+ const motion = options.motion;
3301
+ this.reduceFactor = motion.disable ? 0 : motion.reduce.value ? 1 / motion.reduce.factor : 1;
3302
+ } else {
3303
+ this.reduceFactor = 1;
3304
+ }
3305
+ }
3306
+ }
3307
+ class Container_Container {
3308
+ constructor(id, sourceOptions, ...presets) {
3309
+ this.id = id;
3310
+ this.fpsLimit = 120;
3311
+ this.duration = 0;
3312
+ this.lifeTime = 0;
3313
+ this.firstStart = true;
3314
+ this.started = false;
3315
+ this.destroyed = false;
3316
+ this.paused = true;
3317
+ this.lastFrameTime = 0;
3318
+ this.zLayers = 100;
3319
+ this.pageHidden = false;
3320
+ this._sourceOptions = sourceOptions;
3321
+ this._initialSourceOptions = sourceOptions;
3322
+ this.retina = new Retina(this);
3323
+ this.canvas = new Canvas(this);
3324
+ this.particles = new Particles(this);
3325
+ this.drawer = new FrameManager(this);
3326
+ this.presets = presets;
3327
+ this.pathGenerator = {
3328
+ generate: () => {
3329
+ const v = Vector.create(0, 0);
3330
+ v.length = Math.random();
3331
+ v.angle = Math.random() * Math.PI * 2;
3332
+ return v;
3333
+ },
3334
+ init: () => {},
3335
+ update: () => {}
3336
+ };
3337
+ this.interactivity = {
3338
+ mouse: {
3339
+ clicking: false,
3340
+ inside: false
3341
+ }
3342
+ };
3343
+ this.bubble = {};
3344
+ this.repulse = {
3345
+ particles: []
3346
+ };
3347
+ this.attract = {
3348
+ particles: []
3349
+ };
3350
+ this.plugins = new Map;
3351
+ this.drawers = new Map;
3352
+ this.density = 1;
3353
+ this._options = new Options;
3354
+ this.actualOptions = new Options;
3355
+ this.eventListeners = new EventListeners(this);
3356
+ if (typeof IntersectionObserver !== "undefined" && IntersectionObserver) {
3357
+ this.intersectionObserver = new IntersectionObserver((entries => this.intersectionManager(entries)));
3358
+ }
3359
+ }
3360
+ get options() {
3361
+ return this._options;
3362
+ }
3363
+ get sourceOptions() {
3364
+ return this._sourceOptions;
3365
+ }
3366
+ play(force) {
3367
+ const needsUpdate = this.paused || force;
3368
+ if (this.firstStart && !this.actualOptions.autoPlay) {
3369
+ this.firstStart = false;
3370
+ return;
3371
+ }
3372
+ if (this.paused) {
3373
+ this.paused = false;
3374
+ }
3375
+ if (needsUpdate) {
3376
+ for (const [, plugin] of this.plugins) {
3377
+ if (plugin.play) {
3378
+ plugin.play();
3379
+ }
3380
+ }
3381
+ }
3382
+ this.draw(needsUpdate || false);
3383
+ }
3384
+ pause() {
3385
+ if (this.drawAnimationFrame !== undefined) {
3386
+ cancelAnimation()(this.drawAnimationFrame);
3387
+ delete this.drawAnimationFrame;
3388
+ }
3389
+ if (this.paused) {
3390
+ return;
3391
+ }
3392
+ for (const [, plugin] of this.plugins) {
3393
+ if (plugin.pause) {
3394
+ plugin.pause();
3395
+ }
3396
+ }
3397
+ if (!this.pageHidden) {
3398
+ this.paused = true;
3399
+ }
3400
+ }
3401
+ draw(force) {
3402
+ let refreshTime = force;
3403
+ this.drawAnimationFrame = animate()((timestamp => {
3404
+ if (refreshTime) {
3405
+ this.lastFrameTime = undefined;
3406
+ refreshTime = false;
3407
+ }
3408
+ this.drawer.nextFrame(timestamp);
3409
+ }));
3410
+ }
3411
+ getAnimationStatus() {
3412
+ return !this.paused && !this.pageHidden;
3413
+ }
3414
+ setNoise(noiseOrGenerator, init, update) {
3415
+ this.setPath(noiseOrGenerator, init, update);
3416
+ }
3417
+ setPath(pathOrGenerator, init, update) {
3418
+ if (!pathOrGenerator) {
3419
+ return;
3420
+ }
3421
+ if (typeof pathOrGenerator === "function") {
3422
+ this.pathGenerator.generate = pathOrGenerator;
3423
+ if (init) {
3424
+ this.pathGenerator.init = init;
3425
+ }
3426
+ if (update) {
3427
+ this.pathGenerator.update = update;
3428
+ }
3429
+ } else {
3430
+ if (pathOrGenerator.generate) {
3431
+ this.pathGenerator.generate = pathOrGenerator.generate;
3432
+ }
3433
+ if (pathOrGenerator.init) {
3434
+ this.pathGenerator.init = pathOrGenerator.init;
3435
+ }
3436
+ if (pathOrGenerator.update) {
3437
+ this.pathGenerator.update = pathOrGenerator.update;
3438
+ }
3439
+ }
3440
+ }
3441
+ destroy() {
3442
+ this.stop();
3443
+ this.canvas.destroy();
3444
+ for (const [, drawer] of this.drawers) {
3445
+ if (drawer.destroy) {
3446
+ drawer.destroy(this);
3447
+ }
3448
+ }
3449
+ for (const key of this.drawers.keys()) {
3450
+ this.drawers.delete(key);
3451
+ }
3452
+ this.destroyed = true;
3453
+ }
3454
+ exportImg(callback) {
3455
+ this.exportImage(callback);
3456
+ }
3457
+ exportImage(callback, type, quality) {
3458
+ var _a;
3459
+ return (_a = this.canvas.element) === null || _a === void 0 ? void 0 : _a.toBlob(callback, type !== null && type !== void 0 ? type : "image/png", quality);
3460
+ }
3461
+ exportConfiguration() {
3462
+ return JSON.stringify(this.actualOptions, undefined, 2);
3463
+ }
3464
+ refresh() {
3465
+ this.stop();
3466
+ return this.start();
3467
+ }
3468
+ reset() {
3469
+ this._options = new Options;
3470
+ return this.refresh();
3471
+ }
3472
+ stop() {
3473
+ if (!this.started) {
3474
+ return;
3475
+ }
3476
+ this.firstStart = true;
3477
+ this.started = false;
3478
+ this.eventListeners.removeListeners();
3479
+ this.pause();
3480
+ this.particles.clear();
3481
+ this.canvas.clear();
3482
+ if (this.interactivity.element instanceof HTMLElement && this.intersectionObserver) {
3483
+ this.intersectionObserver.unobserve(this.interactivity.element);
3484
+ }
3485
+ for (const [, plugin] of this.plugins) {
3486
+ if (plugin.stop) {
3487
+ plugin.stop();
3488
+ }
3489
+ }
3490
+ for (const key of this.plugins.keys()) {
3491
+ this.plugins.delete(key);
3492
+ }
3493
+ this.particles.linksColors = new Map;
3494
+ delete this.particles.grabLineColor;
3495
+ delete this.particles.linksColor;
3496
+ this._sourceOptions = this._options;
3497
+ }
3498
+ async loadTheme(name) {
3499
+ this.currentTheme = name;
3500
+ await this.refresh();
3501
+ }
3502
+ async start() {
3503
+ if (this.started) {
3504
+ return;
3505
+ }
3506
+ await this.init();
3507
+ this.started = true;
3508
+ this.eventListeners.addListeners();
3509
+ if (this.interactivity.element instanceof HTMLElement && this.intersectionObserver) {
3510
+ this.intersectionObserver.observe(this.interactivity.element);
3511
+ }
3512
+ for (const [, plugin] of this.plugins) {
3513
+ if (plugin.startAsync !== undefined) {
3514
+ await plugin.startAsync();
3515
+ } else if (plugin.start !== undefined) {
3516
+ plugin.start();
3517
+ }
3518
+ }
3519
+ this.play();
3520
+ }
3521
+ addClickHandler(callback) {
3522
+ const el = this.interactivity.element;
3523
+ if (!el) {
3524
+ return;
3525
+ }
3526
+ const clickOrTouchHandler = (e, pos, radius) => {
3527
+ if (this.destroyed) {
3528
+ return;
3529
+ }
3530
+ const pxRatio = this.retina.pixelRatio, posRetina = {
3531
+ x: pos.x * pxRatio,
3532
+ y: pos.y * pxRatio
3533
+ }, particles = this.particles.quadTree.queryCircle(posRetina, radius * pxRatio);
3534
+ callback(e, particles);
3535
+ };
3536
+ const clickHandler = e => {
3537
+ if (this.destroyed) {
3538
+ return;
3539
+ }
3540
+ const mouseEvent = e;
3541
+ const pos = {
3542
+ x: mouseEvent.offsetX || mouseEvent.clientX,
3543
+ y: mouseEvent.offsetY || mouseEvent.clientY
3544
+ };
3545
+ clickOrTouchHandler(e, pos, 1);
3546
+ };
3547
+ const touchStartHandler = () => {
3548
+ if (this.destroyed) {
3549
+ return;
3550
+ }
3551
+ touched = true;
3552
+ touchMoved = false;
3553
+ };
3554
+ const touchMoveHandler = () => {
3555
+ if (this.destroyed) {
3556
+ return;
3557
+ }
3558
+ touchMoved = true;
3559
+ };
3560
+ const touchEndHandler = e => {
3561
+ var _a, _b, _c;
3562
+ if (this.destroyed) {
3563
+ return;
3564
+ }
3565
+ if (touched && !touchMoved) {
3566
+ const touchEvent = e;
3567
+ let lastTouch = touchEvent.touches[touchEvent.touches.length - 1];
3568
+ if (!lastTouch) {
3569
+ lastTouch = touchEvent.changedTouches[touchEvent.changedTouches.length - 1];
3570
+ if (!lastTouch) {
3571
+ return;
3572
+ }
3573
+ }
3574
+ const canvasRect = (_a = this.canvas.element) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
3575
+ const pos = {
3576
+ x: lastTouch.clientX - ((_b = canvasRect === null || canvasRect === void 0 ? void 0 : canvasRect.left) !== null && _b !== void 0 ? _b : 0),
3577
+ y: lastTouch.clientY - ((_c = canvasRect === null || canvasRect === void 0 ? void 0 : canvasRect.top) !== null && _c !== void 0 ? _c : 0)
3578
+ };
3579
+ clickOrTouchHandler(e, pos, Math.max(lastTouch.radiusX, lastTouch.radiusY));
3580
+ }
3581
+ touched = false;
3582
+ touchMoved = false;
3583
+ };
3584
+ const touchCancelHandler = () => {
3585
+ if (this.destroyed) {
3586
+ return;
3587
+ }
3588
+ touched = false;
3589
+ touchMoved = false;
3590
+ };
3591
+ let touched = false;
3592
+ let touchMoved = false;
3593
+ el.addEventListener("click", clickHandler);
3594
+ el.addEventListener("touchstart", touchStartHandler);
3595
+ el.addEventListener("touchmove", touchMoveHandler);
3596
+ el.addEventListener("touchend", touchEndHandler);
3597
+ el.addEventListener("touchcancel", touchCancelHandler);
3598
+ }
3599
+ updateActualOptions() {
3600
+ this.actualOptions.responsive = [];
3601
+ const newMaxWidth = this.actualOptions.setResponsive(this.canvas.size.width, this.retina.pixelRatio, this._options);
3602
+ this.actualOptions.setTheme(this.currentTheme);
3603
+ if (this.responsiveMaxWidth != newMaxWidth) {
3604
+ this.responsiveMaxWidth = newMaxWidth;
3605
+ return true;
3606
+ }
3607
+ return false;
3608
+ }
3609
+ async init() {
3610
+ this._options = new Options;
3611
+ for (const preset of this.presets) {
3612
+ this._options.load(Plugins.getPreset(preset));
3613
+ }
3614
+ const shapes = Plugins.getSupportedShapes();
3615
+ for (const type of shapes) {
3616
+ const drawer = Plugins.getShapeDrawer(type);
3617
+ if (drawer) {
3618
+ this.drawers.set(type, drawer);
3619
+ }
3620
+ }
3621
+ this._options.load(this._initialSourceOptions);
3622
+ this._options.load(this._sourceOptions);
3623
+ this.actualOptions = new Options;
3624
+ this.actualOptions.load(this._options);
3625
+ this.retina.init();
3626
+ this.canvas.init();
3627
+ this.updateActualOptions();
3628
+ this.canvas.initBackground();
3629
+ this.canvas.resize();
3630
+ this.zLayers = this.actualOptions.zLayers;
3631
+ this.duration = getRangeValue(this.actualOptions.duration);
3632
+ this.lifeTime = 0;
3633
+ this.fpsLimit = this.actualOptions.fpsLimit > 0 ? this.actualOptions.fpsLimit : 120;
3634
+ const availablePlugins = Plugins.getAvailablePlugins(this);
3635
+ for (const [id, plugin] of availablePlugins) {
3636
+ this.plugins.set(id, plugin);
3637
+ }
3638
+ for (const [, drawer] of this.drawers) {
3639
+ if (drawer.init) {
3640
+ await drawer.init(this);
3641
+ }
3642
+ }
3643
+ for (const [, plugin] of this.plugins) {
3644
+ if (plugin.init) {
3645
+ plugin.init(this.actualOptions);
3646
+ } else if (plugin.initAsync !== undefined) {
3647
+ await plugin.initAsync(this.actualOptions);
3648
+ }
3649
+ }
3650
+ const pathOptions = this.actualOptions.particles.move.path;
3651
+ if (pathOptions.generator) {
3652
+ const customGenerator = Plugins.getPathGenerator(pathOptions.generator);
3653
+ if (customGenerator) {
3654
+ if (customGenerator.init) {
3655
+ this.pathGenerator.init = customGenerator.init;
3656
+ }
3657
+ if (customGenerator.generate) {
3658
+ this.pathGenerator.generate = customGenerator.generate;
3659
+ }
3660
+ if (customGenerator.update) {
3661
+ this.pathGenerator.update = customGenerator.update;
3662
+ }
3663
+ }
3664
+ }
3665
+ this.particles.init();
3666
+ this.particles.setDensity();
3667
+ for (const [, plugin] of this.plugins) {
3668
+ if (plugin.particlesSetup !== undefined) {
3669
+ plugin.particlesSetup();
3670
+ }
3671
+ }
3672
+ }
3673
+ intersectionManager(entries) {
3674
+ if (!this.actualOptions.pauseOnOutsideViewport) {
3675
+ return;
3676
+ }
3677
+ for (const entry of entries) {
3678
+ if (entry.target !== this.interactivity.element) {
3679
+ continue;
3680
+ }
3681
+ if (entry.isIntersecting) {
3682
+ this.play();
3683
+ } else {
3684
+ this.pause();
3685
+ }
3686
+ }
3687
+ }
3688
+ }
3689
+ const tsParticlesDom = null && [];
3690
+ function fetchError(statusCode) {
3691
+ console.error(`Error tsParticles - fetch status: ${statusCode}`);
3692
+ console.error("Error tsParticles - File config not found");
3693
+ }
3694
+ class Loader {
3695
+ static dom() {
3696
+ return tsParticlesDom;
3697
+ }
3698
+ static domItem(index) {
3699
+ const dom = Loader.dom();
3700
+ const item = dom[index];
3701
+ if (item && !item.destroyed) {
3702
+ return item;
3703
+ }
3704
+ dom.splice(index, 1);
3705
+ }
3706
+ static async loadOptions(params) {
3707
+ var _a, _b, _c;
3708
+ const tagId = (_a = params.tagId) !== null && _a !== void 0 ? _a : `tsparticles${Math.floor(Math.random() * 1e4)}`;
3709
+ const {options: options, index: index} = params;
3710
+ let domContainer = (_b = params.element) !== null && _b !== void 0 ? _b : document.getElementById(tagId);
3711
+ if (!domContainer) {
3712
+ domContainer = document.createElement("div");
3713
+ domContainer.id = tagId;
3714
+ (_c = document.querySelector("body")) === null || _c === void 0 ? void 0 : _c.append(domContainer);
3715
+ }
3716
+ const currentOptions = options instanceof Array ? itemFromArray(options, index) : options;
3717
+ const dom = Loader.dom();
3718
+ const oldIndex = dom.findIndex((v => v.id === tagId));
3719
+ if (oldIndex >= 0) {
3720
+ const old = Loader.domItem(oldIndex);
3721
+ if (old && !old.destroyed) {
3722
+ old.destroy();
3723
+ dom.splice(oldIndex, 1);
3724
+ }
3725
+ }
3726
+ let canvasEl;
3727
+ if (domContainer.tagName.toLowerCase() === "canvas") {
3728
+ canvasEl = domContainer;
3729
+ canvasEl.dataset[Constants.generatedAttribute] = "false";
3730
+ } else {
3731
+ const existingCanvases = domContainer.getElementsByTagName("canvas");
3732
+ if (existingCanvases.length) {
3733
+ canvasEl = existingCanvases[0];
3734
+ canvasEl.dataset[Constants.generatedAttribute] = "false";
3735
+ } else {
3736
+ canvasEl = document.createElement("canvas");
3737
+ canvasEl.dataset[Constants.generatedAttribute] = "true";
3738
+ canvasEl.style.width = "100%";
3739
+ canvasEl.style.height = "100%";
3740
+ domContainer.appendChild(canvasEl);
3741
+ }
3742
+ }
3743
+ const newItem = new Container(tagId, currentOptions);
3744
+ if (oldIndex >= 0) {
3745
+ dom.splice(oldIndex, 0, newItem);
3746
+ } else {
3747
+ dom.push(newItem);
3748
+ }
3749
+ newItem.canvas.loadCanvas(canvasEl);
3750
+ await newItem.start();
3751
+ return newItem;
3752
+ }
3753
+ static async loadRemoteOptions(params) {
3754
+ const {url: jsonUrl, index: index} = params;
3755
+ const url = jsonUrl instanceof Array ? itemFromArray(jsonUrl, index) : jsonUrl;
3756
+ if (!url) {
3757
+ return;
3758
+ }
3759
+ const response = await fetch(url);
3760
+ if (!response.ok) {
3761
+ fetchError(response.status);
3762
+ return;
3763
+ }
3764
+ const data = await response.json();
3765
+ return await Loader.loadOptions({
3766
+ tagId: params.tagId,
3767
+ element: params.element,
3768
+ index: index,
3769
+ options: data
3770
+ });
3771
+ }
3772
+ static load(tagId, options, index) {
3773
+ const params = {
3774
+ index: index
3775
+ };
3776
+ if (typeof tagId === "string") {
3777
+ params.tagId = tagId;
3778
+ } else {
3779
+ params.options = tagId;
3780
+ }
3781
+ if (typeof options === "number") {
3782
+ params.index = options !== null && options !== void 0 ? options : params.index;
3783
+ } else {
3784
+ params.options = options !== null && options !== void 0 ? options : params.options;
3785
+ }
3786
+ return this.loadOptions(params);
3787
+ }
3788
+ static async set(id, domContainer, options, index) {
3789
+ const params = {
3790
+ index: index
3791
+ };
3792
+ if (typeof id === "string") {
3793
+ params.tagId = id;
3794
+ } else {
3795
+ params.element = id;
3796
+ }
3797
+ if (domContainer instanceof HTMLElement) {
3798
+ params.element = domContainer;
3799
+ } else {
3800
+ params.options = domContainer;
3801
+ }
3802
+ if (typeof options === "number") {
3803
+ params.index = options;
3804
+ } else {
3805
+ params.options = options !== null && options !== void 0 ? options : params.options;
3806
+ }
3807
+ return this.loadOptions(params);
3808
+ }
3809
+ static async loadJSON(tagId, jsonUrl, index) {
3810
+ let url, id;
3811
+ if (typeof jsonUrl === "number" || jsonUrl === undefined) {
3812
+ url = tagId;
3813
+ } else {
3814
+ id = tagId;
3815
+ url = jsonUrl;
3816
+ }
3817
+ return await Loader.loadRemoteOptions({
3818
+ tagId: id,
3819
+ url: url,
3820
+ index: index
3821
+ });
3822
+ }
3823
+ static async setJSON(id, domContainer, jsonUrl, index) {
3824
+ let url, newId, newIndex, element;
3825
+ if (id instanceof HTMLElement) {
3826
+ element = id;
3827
+ url = domContainer;
3828
+ newIndex = jsonUrl;
3829
+ } else {
3830
+ newId = id;
3831
+ element = domContainer;
3832
+ url = jsonUrl;
3833
+ newIndex = index;
3834
+ }
3835
+ return await Loader.loadRemoteOptions({
3836
+ tagId: newId,
3837
+ url: url,
3838
+ index: newIndex,
3839
+ element: element
3840
+ });
3841
+ }
3842
+ static setOnClickHandler(callback) {
3843
+ const dom = Loader.dom();
3844
+ if (dom.length === 0) {
3845
+ throw new Error("Can only set click handlers after calling tsParticles.load() or tsParticles.loadJSON()");
3846
+ }
3847
+ for (const domItem of dom) {
3848
+ domItem.addClickHandler(callback);
3849
+ }
3850
+ }
3851
+ }
3852
+ function NumberUtils_clamp(num, min, max) {
3853
+ return Math.min(Math.max(num, min), max);
3854
+ }
3855
+ function NumberUtils_mix(comp1, comp2, weight1, weight2) {
3856
+ return Math.floor((comp1 * weight1 + comp2 * weight2) / (weight1 + weight2));
3857
+ }
3858
+ function NumberUtils_randomInRange(r) {
3859
+ const max = NumberUtils_getRangeMax(r);
3860
+ let min = NumberUtils_getRangeMin(r);
3861
+ if (max === min) {
3862
+ min = 0;
3863
+ }
3864
+ return Math.random() * (max - min) + min;
3865
+ }
3866
+ function NumberUtils_getRangeValue(value) {
3867
+ return typeof value === "number" ? value : NumberUtils_randomInRange(value);
3868
+ }
3869
+ function NumberUtils_getRangeMin(value) {
3870
+ return typeof value === "number" ? value : value.min;
3871
+ }
3872
+ function NumberUtils_getRangeMax(value) {
3873
+ return typeof value === "number" ? value : value.max;
3874
+ }
3875
+ function NumberUtils_setRangeValue(source, value) {
3876
+ if (source === value || value === undefined && typeof source === "number") {
3877
+ return source;
3878
+ }
3879
+ const min = NumberUtils_getRangeMin(source), max = NumberUtils_getRangeMax(source);
3880
+ return value !== undefined ? {
3881
+ min: Math.min(min, value),
3882
+ max: Math.max(max, value)
3883
+ } : NumberUtils_setRangeValue(min, max);
3884
+ }
3885
+ function NumberUtils_getValue(options) {
3886
+ const random = options.random;
3887
+ const {enable: enable, minimumValue: minimumValue} = typeof random === "boolean" ? {
3888
+ enable: random,
3889
+ minimumValue: 0
3890
+ } : random;
3891
+ return enable ? NumberUtils_getRangeValue(NumberUtils_setRangeValue(options.value, minimumValue)) : NumberUtils_getRangeValue(options.value);
3892
+ }
3893
+ function NumberUtils_getDistances(pointA, pointB) {
3894
+ const dx = pointA.x - pointB.x;
3895
+ const dy = pointA.y - pointB.y;
3896
+ return {
3897
+ dx: dx,
3898
+ dy: dy,
3899
+ distance: Math.sqrt(dx * dx + dy * dy)
3900
+ };
3901
+ }
3902
+ function NumberUtils_getDistance(pointA, pointB) {
3903
+ return NumberUtils_getDistances(pointA, pointB).distance;
3904
+ }
3905
+ function NumberUtils_getParticleDirectionAngle(direction) {
3906
+ if (typeof direction === "number") {
3907
+ return direction * Math.PI / 180;
3908
+ } else {
3909
+ switch (direction) {
3910
+ case "top":
3911
+ return -Math.PI / 2;
3912
+
3913
+ case "top-right":
3914
+ return -Math.PI / 4;
3915
+
3916
+ case "right":
3917
+ return 0;
3918
+
3919
+ case "bottom-right":
3920
+ return Math.PI / 4;
3921
+
3922
+ case "bottom":
3923
+ return Math.PI / 2;
3924
+
3925
+ case "bottom-left":
3926
+ return 3 * Math.PI / 4;
3927
+
3928
+ case "left":
3929
+ return Math.PI;
3930
+
3931
+ case "top-left":
3932
+ return -3 * Math.PI / 4;
3933
+
3934
+ case "none":
3935
+ default:
3936
+ return Math.random() * Math.PI * 2;
3937
+ }
3938
+ }
3939
+ }
3940
+ function NumberUtils_getParticleBaseVelocity(direction) {
3941
+ const baseVelocity = Vector.origin;
3942
+ baseVelocity.length = 1;
3943
+ baseVelocity.angle = direction;
3944
+ return baseVelocity;
3945
+ }
3946
+ function collisionVelocity(v1, v2, m1, m2) {
3947
+ return Vector_Vector.create(v1.x * (m1 - m2) / (m1 + m2) + v2.x * 2 * m2 / (m1 + m2), v1.y);
3948
+ }
3949
+ function calcEasing(value, type) {
3950
+ switch (type) {
3951
+ case "ease-out-quad":
3952
+ return 1 - (1 - value) ** 2;
3953
+
3954
+ case "ease-out-cubic":
3955
+ return 1 - (1 - value) ** 3;
3956
+
3957
+ case "ease-out-quart":
3958
+ return 1 - (1 - value) ** 4;
3959
+
3960
+ case "ease-out-quint":
3961
+ return 1 - (1 - value) ** 5;
3962
+
3963
+ case "ease-out-expo":
3964
+ return value === 1 ? 1 : 1 - Math.pow(2, -10 * value);
3965
+
3966
+ case "ease-out-sine":
3967
+ return Math.sin(value * Math.PI / 2);
3968
+
3969
+ case "ease-out-back":
3970
+ {
3971
+ const c1 = 1.70158;
3972
+ const c3 = c1 + 1;
3973
+ return 1 + c3 * Math.pow(value - 1, 3) + c1 * Math.pow(value - 1, 2);
3974
+ }
3975
+
3976
+ case "ease-out-circ":
3977
+ return Math.sqrt(1 - Math.pow(value - 1, 2));
3978
+
3979
+ default:
3980
+ return value;
3981
+ }
3982
+ }
3983
+ function rectSideBounce(pSide, pOtherSide, rectSide, rectOtherSide, velocity, factor) {
3984
+ const res = {
3985
+ bounced: false
3986
+ };
3987
+ if (pOtherSide.min >= rectOtherSide.min && pOtherSide.min <= rectOtherSide.max && pOtherSide.max >= rectOtherSide.min && pOtherSide.max <= rectOtherSide.max) {
3988
+ if (pSide.max >= rectSide.min && pSide.max <= (rectSide.max + rectSide.min) / 2 && velocity > 0 || pSide.min <= rectSide.max && pSide.min > (rectSide.max + rectSide.min) / 2 && velocity < 0) {
3989
+ res.velocity = velocity * -factor;
3990
+ res.bounced = true;
3991
+ }
3992
+ }
3993
+ return res;
3994
+ }
3995
+ function checkSelector(element, selectors) {
3996
+ if (selectors instanceof Array) {
3997
+ for (const selector of selectors) {
3998
+ if (element.matches(selector)) {
3999
+ return true;
4000
+ }
4001
+ }
4002
+ return false;
4003
+ } else {
4004
+ return element.matches(selectors);
4005
+ }
4006
+ }
4007
+ function Utils_isSsr() {
4008
+ return typeof window === "undefined" || !window || typeof window.document === "undefined" || !window.document;
4009
+ }
4010
+ function Utils_animate() {
4011
+ return Utils_isSsr() ? callback => setTimeout(callback) : callback => (window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || window.setTimeout)(callback);
4012
+ }
4013
+ function Utils_cancelAnimation() {
4014
+ return Utils_isSsr() ? handle => clearTimeout(handle) : handle => (window.cancelAnimationFrame || window.webkitCancelRequestAnimationFrame || window.mozCancelRequestAnimationFrame || window.oCancelRequestAnimationFrame || window.msCancelRequestAnimationFrame || window.clearTimeout)(handle);
4015
+ }
4016
+ function Utils_isInArray(value, array) {
4017
+ return value === array || array instanceof Array && array.indexOf(value) > -1;
4018
+ }
4019
+ async function loadFont(character) {
4020
+ var _a, _b;
4021
+ try {
4022
+ await document.fonts.load(`${(_a = character.weight) !== null && _a !== void 0 ? _a : "400"} 36px '${(_b = character.font) !== null && _b !== void 0 ? _b : "Verdana"}'`);
4023
+ } catch (_c) {}
4024
+ }
4025
+ function arrayRandomIndex(array) {
4026
+ return Math.floor(Math.random() * array.length);
4027
+ }
4028
+ function Utils_itemFromArray(array, index, useIndex = true) {
4029
+ const fixedIndex = index !== undefined && useIndex ? index % array.length : arrayRandomIndex(array);
4030
+ return array[fixedIndex];
4031
+ }
4032
+ function isPointInside(point, size, radius, direction) {
4033
+ return areBoundsInside(calculateBounds(point, radius !== null && radius !== void 0 ? radius : 0), size, direction);
4034
+ }
4035
+ function areBoundsInside(bounds, size, direction) {
4036
+ let inside = true;
4037
+ if (!direction || direction === "bottom") {
4038
+ inside = bounds.top < size.height;
4039
+ }
4040
+ if (inside && (!direction || direction === "left")) {
4041
+ inside = bounds.right > 0;
4042
+ }
4043
+ if (inside && (!direction || direction === "right")) {
4044
+ inside = bounds.left < size.width;
4045
+ }
4046
+ if (inside && (!direction || direction === "top")) {
4047
+ inside = bounds.bottom > 0;
4048
+ }
4049
+ return inside;
4050
+ }
4051
+ function calculateBounds(point, radius) {
4052
+ return {
4053
+ bottom: point.y + radius,
4054
+ left: point.x - radius,
4055
+ right: point.x + radius,
4056
+ top: point.y - radius
4057
+ };
4058
+ }
4059
+ function Utils_deepExtend(destination, ...sources) {
4060
+ for (const source of sources) {
4061
+ if (source === undefined || source === null) {
4062
+ continue;
4063
+ }
4064
+ if (typeof source !== "object") {
4065
+ destination = source;
4066
+ continue;
4067
+ }
4068
+ const sourceIsArray = Array.isArray(source);
4069
+ if (sourceIsArray && (typeof destination !== "object" || !destination || !Array.isArray(destination))) {
4070
+ destination = [];
4071
+ } else if (!sourceIsArray && (typeof destination !== "object" || !destination || Array.isArray(destination))) {
4072
+ destination = {};
4073
+ }
4074
+ for (const key in source) {
4075
+ if (key === "__proto__") {
4076
+ continue;
4077
+ }
4078
+ const sourceDict = source;
4079
+ const value = sourceDict[key];
4080
+ const isObject = typeof value === "object";
4081
+ const destDict = destination;
4082
+ destDict[key] = isObject && Array.isArray(value) ? value.map((v => Utils_deepExtend(destDict[key], v))) : Utils_deepExtend(destDict[key], value);
4083
+ }
4084
+ }
4085
+ return destination;
4086
+ }
4087
+ function isDivModeEnabled(mode, divs) {
4088
+ return divs instanceof Array ? !!divs.find((t => t.enable && Utils_isInArray(mode, t.mode))) : Utils_isInArray(mode, divs.mode);
4089
+ }
4090
+ function divModeExecute(mode, divs, callback) {
4091
+ if (divs instanceof Array) {
4092
+ for (const div of divs) {
4093
+ const divMode = div.mode;
4094
+ const divEnabled = div.enable;
4095
+ if (divEnabled && Utils_isInArray(mode, divMode)) {
4096
+ singleDivModeExecute(div, callback);
4097
+ }
4098
+ }
4099
+ } else {
4100
+ const divMode = divs.mode;
4101
+ const divEnabled = divs.enable;
4102
+ if (divEnabled && Utils_isInArray(mode, divMode)) {
4103
+ singleDivModeExecute(divs, callback);
4104
+ }
4105
+ }
4106
+ }
4107
+ function singleDivModeExecute(div, callback) {
4108
+ const selectors = div.selectors;
4109
+ if (selectors instanceof Array) {
4110
+ for (const selector of selectors) {
4111
+ callback(selector, div);
4112
+ }
4113
+ } else {
4114
+ callback(selectors, div);
4115
+ }
4116
+ }
4117
+ function divMode(divs, element) {
4118
+ if (!element || !divs) {
4119
+ return;
4120
+ }
4121
+ if (divs instanceof Array) {
4122
+ return divs.find((d => checkSelector(element, d.selectors)));
4123
+ } else if (checkSelector(element, divs.selectors)) {
4124
+ return divs;
4125
+ }
4126
+ }
4127
+ function circleBounceDataFromParticle(p) {
4128
+ return {
4129
+ position: p.getPosition(),
4130
+ radius: p.getRadius(),
4131
+ mass: p.getMass(),
4132
+ velocity: p.velocity,
4133
+ factor: Vector_Vector.create(NumberUtils_getValue(p.options.bounce.horizontal), NumberUtils_getValue(p.options.bounce.vertical))
4134
+ };
4135
+ }
4136
+ function circleBounce(p1, p2) {
4137
+ const {x: xVelocityDiff, y: yVelocityDiff} = p1.velocity.sub(p2.velocity);
4138
+ const [pos1, pos2] = [ p1.position, p2.position ];
4139
+ const {dx: xDist, dy: yDist} = NumberUtils_getDistances(pos2, pos1);
4140
+ if (xVelocityDiff * xDist + yVelocityDiff * yDist >= 0) {
4141
+ const angle = -Math.atan2(yDist, xDist);
4142
+ const m1 = p1.mass;
4143
+ const m2 = p2.mass;
4144
+ const u1 = p1.velocity.rotate(angle);
4145
+ const u2 = p2.velocity.rotate(angle);
4146
+ const v1 = collisionVelocity(u1, u2, m1, m2);
4147
+ const v2 = collisionVelocity(u2, u1, m1, m2);
4148
+ const vFinal1 = v1.rotate(-angle);
4149
+ const vFinal2 = v2.rotate(-angle);
4150
+ p1.velocity.x = vFinal1.x * p1.factor.x;
4151
+ p1.velocity.y = vFinal1.y * p1.factor.y;
4152
+ p2.velocity.x = vFinal2.x * p2.factor.x;
4153
+ p2.velocity.y = vFinal2.y * p2.factor.y;
4154
+ }
4155
+ }
4156
+ function rectBounce(particle, divBounds) {
4157
+ const pPos = particle.getPosition();
4158
+ const size = particle.getRadius();
4159
+ const bounds = calculateBounds(pPos, size);
4160
+ const resH = rectSideBounce({
4161
+ min: bounds.left,
4162
+ max: bounds.right
4163
+ }, {
4164
+ min: bounds.top,
4165
+ max: bounds.bottom
4166
+ }, {
4167
+ min: divBounds.left,
4168
+ max: divBounds.right
4169
+ }, {
4170
+ min: divBounds.top,
4171
+ max: divBounds.bottom
4172
+ }, particle.velocity.x, getValue(particle.options.bounce.horizontal));
4173
+ if (resH.bounced) {
4174
+ if (resH.velocity !== undefined) {
4175
+ particle.velocity.x = resH.velocity;
4176
+ }
4177
+ if (resH.position !== undefined) {
4178
+ particle.position.x = resH.position;
4179
+ }
4180
+ }
4181
+ const resV = rectSideBounce({
4182
+ min: bounds.top,
4183
+ max: bounds.bottom
4184
+ }, {
4185
+ min: bounds.left,
4186
+ max: bounds.right
4187
+ }, {
4188
+ min: divBounds.top,
4189
+ max: divBounds.bottom
4190
+ }, {
4191
+ min: divBounds.left,
4192
+ max: divBounds.right
4193
+ }, particle.velocity.y, getValue(particle.options.bounce.vertical));
4194
+ if (resV.bounced) {
4195
+ if (resV.velocity !== undefined) {
4196
+ particle.velocity.y = resV.velocity;
4197
+ }
4198
+ if (resV.position !== undefined) {
4199
+ particle.position.y = resV.position;
4200
+ }
4201
+ }
4202
+ }
4203
+ function hue2rgb(p, q, t) {
4204
+ let tCalc = t;
4205
+ if (tCalc < 0) {
4206
+ tCalc += 1;
4207
+ }
4208
+ if (tCalc > 1) {
4209
+ tCalc -= 1;
4210
+ }
4211
+ if (tCalc < 1 / 6) {
4212
+ return p + (q - p) * 6 * tCalc;
4213
+ }
4214
+ if (tCalc < 1 / 2) {
4215
+ return q;
4216
+ }
4217
+ if (tCalc < 2 / 3) {
4218
+ return p + (q - p) * (2 / 3 - tCalc) * 6;
4219
+ }
4220
+ return p;
4221
+ }
4222
+ function stringToRgba(input) {
4223
+ if (input.startsWith("rgb")) {
4224
+ const regex = /rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([\d.]+)\s*)?\)/i;
4225
+ const result = regex.exec(input);
4226
+ return result ? {
4227
+ a: result.length > 4 ? parseFloat(result[5]) : 1,
4228
+ b: parseInt(result[3], 10),
4229
+ g: parseInt(result[2], 10),
4230
+ r: parseInt(result[1], 10)
4231
+ } : undefined;
4232
+ } else if (input.startsWith("hsl")) {
4233
+ const regex = /hsla?\(\s*(\d+)\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(,\s*([\d.]+)\s*)?\)/i;
4234
+ const result = regex.exec(input);
4235
+ return result ? hslaToRgba({
4236
+ a: result.length > 4 ? parseFloat(result[5]) : 1,
4237
+ h: parseInt(result[1], 10),
4238
+ l: parseInt(result[3], 10),
4239
+ s: parseInt(result[2], 10)
4240
+ }) : undefined;
4241
+ } else if (input.startsWith("hsv")) {
4242
+ const regex = /hsva?\(\s*(\d+)°\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(,\s*([\d.]+)\s*)?\)/i;
4243
+ const result = regex.exec(input);
4244
+ return result ? hsvaToRgba({
4245
+ a: result.length > 4 ? parseFloat(result[5]) : 1,
4246
+ h: parseInt(result[1], 10),
4247
+ s: parseInt(result[2], 10),
4248
+ v: parseInt(result[3], 10)
4249
+ }) : undefined;
4250
+ } else {
4251
+ const shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i;
4252
+ const hexFixed = input.replace(shorthandRegex, ((_m, r, g, b, a) => r + r + g + g + b + b + (a !== undefined ? a + a : "")));
4253
+ const regex = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i;
4254
+ const result = regex.exec(hexFixed);
4255
+ return result ? {
4256
+ a: result[4] !== undefined ? parseInt(result[4], 16) / 255 : 1,
4257
+ b: parseInt(result[3], 16),
4258
+ g: parseInt(result[2], 16),
4259
+ r: parseInt(result[1], 16)
4260
+ } : undefined;
4261
+ }
4262
+ }
4263
+ function ColorUtils_colorToRgb(input, index, useIndex = true) {
4264
+ var _a, _b, _c;
4265
+ if (input === undefined) {
4266
+ return;
4267
+ }
4268
+ const color = typeof input === "string" ? {
4269
+ value: input
4270
+ } : input;
4271
+ let res;
4272
+ if (typeof color.value === "string") {
4273
+ if (color.value === Constants.randomColorValue) {
4274
+ res = getRandomRgbColor();
4275
+ } else {
4276
+ res = stringToRgb(color.value);
4277
+ }
4278
+ } else {
4279
+ if (color.value instanceof Array) {
4280
+ const colorSelected = itemFromArray(color.value, index, useIndex);
4281
+ res = ColorUtils_colorToRgb({
4282
+ value: colorSelected
4283
+ });
4284
+ } else {
4285
+ const colorValue = color.value;
4286
+ const rgbColor = (_a = colorValue.rgb) !== null && _a !== void 0 ? _a : color.value;
4287
+ if (rgbColor.r !== undefined) {
4288
+ res = rgbColor;
4289
+ } else {
4290
+ const hslColor = (_b = colorValue.hsl) !== null && _b !== void 0 ? _b : color.value;
4291
+ if (hslColor.h !== undefined && hslColor.l !== undefined) {
4292
+ res = hslToRgb(hslColor);
4293
+ } else {
4294
+ const hsvColor = (_c = colorValue.hsv) !== null && _c !== void 0 ? _c : color.value;
4295
+ if (hsvColor.h !== undefined && hsvColor.v !== undefined) {
4296
+ res = hsvToRgb(hsvColor);
4297
+ }
4298
+ }
4299
+ }
4300
+ }
4301
+ }
4302
+ return res;
4303
+ }
4304
+ function ColorUtils_colorToHsl(color, index, useIndex = true) {
4305
+ const rgb = ColorUtils_colorToRgb(color, index, useIndex);
4306
+ return rgb !== undefined ? rgbToHsl(rgb) : undefined;
4307
+ }
4308
+ function rgbToHsl(color) {
4309
+ const r1 = color.r / 255;
4310
+ const g1 = color.g / 255;
4311
+ const b1 = color.b / 255;
4312
+ const max = Math.max(r1, g1, b1);
4313
+ const min = Math.min(r1, g1, b1);
4314
+ const res = {
4315
+ h: 0,
4316
+ l: (max + min) / 2,
4317
+ s: 0
4318
+ };
4319
+ if (max != min) {
4320
+ res.s = res.l < .5 ? (max - min) / (max + min) : (max - min) / (2 - max - min);
4321
+ res.h = r1 === max ? (g1 - b1) / (max - min) : res.h = g1 === max ? 2 + (b1 - r1) / (max - min) : 4 + (r1 - g1) / (max - min);
4322
+ }
4323
+ res.l *= 100;
4324
+ res.s *= 100;
4325
+ res.h *= 60;
4326
+ if (res.h < 0) {
4327
+ res.h += 360;
4328
+ }
4329
+ return res;
4330
+ }
4331
+ function stringToAlpha(input) {
4332
+ var _a;
4333
+ return (_a = stringToRgba(input)) === null || _a === void 0 ? void 0 : _a.a;
4334
+ }
4335
+ function stringToRgb(input) {
4336
+ return stringToRgba(input);
4337
+ }
4338
+ function hslToRgb(hsl) {
4339
+ const result = {
4340
+ b: 0,
4341
+ g: 0,
4342
+ r: 0
4343
+ };
4344
+ const hslPercent = {
4345
+ h: hsl.h / 360,
4346
+ l: hsl.l / 100,
4347
+ s: hsl.s / 100
4348
+ };
4349
+ if (hslPercent.s === 0) {
4350
+ result.b = hslPercent.l;
4351
+ result.g = hslPercent.l;
4352
+ result.r = hslPercent.l;
4353
+ } else {
4354
+ const q = hslPercent.l < .5 ? hslPercent.l * (1 + hslPercent.s) : hslPercent.l + hslPercent.s - hslPercent.l * hslPercent.s;
4355
+ const p = 2 * hslPercent.l - q;
4356
+ result.r = hue2rgb(p, q, hslPercent.h + 1 / 3);
4357
+ result.g = hue2rgb(p, q, hslPercent.h);
4358
+ result.b = hue2rgb(p, q, hslPercent.h - 1 / 3);
4359
+ }
4360
+ result.r = Math.floor(result.r * 255);
4361
+ result.g = Math.floor(result.g * 255);
4362
+ result.b = Math.floor(result.b * 255);
4363
+ return result;
4364
+ }
4365
+ function hslaToRgba(hsla) {
4366
+ const rgbResult = hslToRgb(hsla);
4367
+ return {
4368
+ a: hsla.a,
4369
+ b: rgbResult.b,
4370
+ g: rgbResult.g,
4371
+ r: rgbResult.r
4372
+ };
4373
+ }
4374
+ function hslToHsv(hsl) {
4375
+ const l = hsl.l / 100, sl = hsl.s / 100;
4376
+ const v = l + sl * Math.min(l, 1 - l), sv = !v ? 0 : 2 * (1 - l / v);
4377
+ return {
4378
+ h: hsl.h,
4379
+ s: sv * 100,
4380
+ v: v * 100
4381
+ };
4382
+ }
4383
+ function hslaToHsva(hsla) {
4384
+ const hsvResult = hslToHsv(hsla);
4385
+ return {
4386
+ a: hsla.a,
4387
+ h: hsvResult.h,
4388
+ s: hsvResult.s,
4389
+ v: hsvResult.v
4390
+ };
4391
+ }
4392
+ function hsvToHsl(hsv) {
4393
+ const v = hsv.v / 100, sv = hsv.s / 100;
4394
+ const l = v * (1 - sv / 2), sl = l === 0 || l === 1 ? 0 : (v - l) / Math.min(l, 1 - l);
4395
+ return {
4396
+ h: hsv.h,
4397
+ l: l * 100,
4398
+ s: sl * 100
4399
+ };
4400
+ }
4401
+ function hsvaToHsla(hsva) {
4402
+ const hslResult = hsvToHsl(hsva);
4403
+ return {
4404
+ a: hsva.a,
4405
+ h: hslResult.h,
4406
+ l: hslResult.l,
4407
+ s: hslResult.s
4408
+ };
4409
+ }
4410
+ function hsvToRgb(hsv) {
4411
+ const result = {
4412
+ b: 0,
4413
+ g: 0,
4414
+ r: 0
4415
+ };
4416
+ const hsvPercent = {
4417
+ h: hsv.h / 60,
4418
+ s: hsv.s / 100,
4419
+ v: hsv.v / 100
4420
+ };
4421
+ const c = hsvPercent.v * hsvPercent.s, x = c * (1 - Math.abs(hsvPercent.h % 2 - 1));
4422
+ let tempRgb;
4423
+ if (hsvPercent.h >= 0 && hsvPercent.h <= 1) {
4424
+ tempRgb = {
4425
+ r: c,
4426
+ g: x,
4427
+ b: 0
4428
+ };
4429
+ } else if (hsvPercent.h > 1 && hsvPercent.h <= 2) {
4430
+ tempRgb = {
4431
+ r: x,
4432
+ g: c,
4433
+ b: 0
4434
+ };
4435
+ } else if (hsvPercent.h > 2 && hsvPercent.h <= 3) {
4436
+ tempRgb = {
4437
+ r: 0,
4438
+ g: c,
4439
+ b: x
4440
+ };
4441
+ } else if (hsvPercent.h > 3 && hsvPercent.h <= 4) {
4442
+ tempRgb = {
4443
+ r: 0,
4444
+ g: x,
4445
+ b: c
4446
+ };
4447
+ } else if (hsvPercent.h > 4 && hsvPercent.h <= 5) {
4448
+ tempRgb = {
4449
+ r: x,
4450
+ g: 0,
4451
+ b: c
4452
+ };
4453
+ } else if (hsvPercent.h > 5 && hsvPercent.h <= 6) {
4454
+ tempRgb = {
4455
+ r: c,
4456
+ g: 0,
4457
+ b: x
4458
+ };
4459
+ }
4460
+ if (tempRgb) {
4461
+ const m = hsvPercent.v - c;
4462
+ result.r = Math.floor((tempRgb.r + m) * 255);
4463
+ result.g = Math.floor((tempRgb.g + m) * 255);
4464
+ result.b = Math.floor((tempRgb.b + m) * 255);
4465
+ }
4466
+ return result;
4467
+ }
4468
+ function hsvaToRgba(hsva) {
4469
+ const rgbResult = hsvToRgb(hsva);
4470
+ return {
4471
+ a: hsva.a,
4472
+ b: rgbResult.b,
4473
+ g: rgbResult.g,
4474
+ r: rgbResult.r
4475
+ };
4476
+ }
4477
+ function rgbToHsv(rgb) {
4478
+ const rgbPercent = {
4479
+ r: rgb.r / 255,
4480
+ g: rgb.g / 255,
4481
+ b: rgb.b / 255
4482
+ }, xMax = Math.max(rgbPercent.r, rgbPercent.g, rgbPercent.b), xMin = Math.min(rgbPercent.r, rgbPercent.g, rgbPercent.b), v = xMax, c = xMax - xMin;
4483
+ let h = 0;
4484
+ if (v === rgbPercent.r) {
4485
+ h = 60 * ((rgbPercent.g - rgbPercent.b) / c);
4486
+ } else if (v === rgbPercent.g) {
4487
+ h = 60 * (2 + (rgbPercent.b - rgbPercent.r) / c);
4488
+ } else if (v === rgbPercent.b) {
4489
+ h = 60 * (4 + (rgbPercent.r - rgbPercent.g) / c);
4490
+ }
4491
+ const s = !v ? 0 : c / v;
4492
+ return {
4493
+ h: h,
4494
+ s: s * 100,
4495
+ v: v * 100
4496
+ };
4497
+ }
4498
+ function rgbaToHsva(rgba) {
4499
+ const hsvResult = rgbToHsv(rgba);
4500
+ return {
4501
+ a: rgba.a,
4502
+ h: hsvResult.h,
4503
+ s: hsvResult.s,
4504
+ v: hsvResult.v
4505
+ };
4506
+ }
4507
+ function getRandomRgbColor(min) {
4508
+ const fixedMin = min !== null && min !== void 0 ? min : 0;
4509
+ return {
4510
+ b: Math.floor(randomInRange(setRangeValue(fixedMin, 256))),
4511
+ g: Math.floor(randomInRange(setRangeValue(fixedMin, 256))),
4512
+ r: Math.floor(randomInRange(setRangeValue(fixedMin, 256)))
4513
+ };
4514
+ }
4515
+ function ColorUtils_getStyleFromRgb(color, opacity) {
4516
+ return `rgba(${color.r}, ${color.g}, ${color.b}, ${opacity !== null && opacity !== void 0 ? opacity : 1})`;
4517
+ }
4518
+ function ColorUtils_getStyleFromHsl(color, opacity) {
4519
+ return `hsla(${color.h}, ${color.s}%, ${color.l}%, ${opacity !== null && opacity !== void 0 ? opacity : 1})`;
4520
+ }
4521
+ function getStyleFromHsv(color, opacity) {
4522
+ return ColorUtils_getStyleFromHsl(hsvToHsl(color), opacity);
4523
+ }
4524
+ function ColorUtils_colorMix(color1, color2, size1, size2) {
4525
+ let rgb1 = color1;
4526
+ let rgb2 = color2;
4527
+ if (rgb1.r === undefined) {
4528
+ rgb1 = hslToRgb(color1);
4529
+ }
4530
+ if (rgb2.r === undefined) {
4531
+ rgb2 = hslToRgb(color2);
4532
+ }
4533
+ return {
4534
+ b: mix(rgb1.b, rgb2.b, size1, size2),
4535
+ g: mix(rgb1.g, rgb2.g, size1, size2),
4536
+ r: mix(rgb1.r, rgb2.r, size1, size2)
4537
+ };
4538
+ }
4539
+ function getLinkColor(p1, p2, linkColor) {
4540
+ var _a, _b;
4541
+ if (linkColor === Constants.randomColorValue) {
4542
+ return getRandomRgbColor();
4543
+ } else if (linkColor === "mid") {
4544
+ const sourceColor = (_a = p1.getFillColor()) !== null && _a !== void 0 ? _a : p1.getStrokeColor();
4545
+ const destColor = (_b = p2 === null || p2 === void 0 ? void 0 : p2.getFillColor()) !== null && _b !== void 0 ? _b : p2 === null || p2 === void 0 ? void 0 : p2.getStrokeColor();
4546
+ if (sourceColor && destColor && p2) {
4547
+ return ColorUtils_colorMix(sourceColor, destColor, p1.getRadius(), p2.getRadius());
4548
+ } else {
4549
+ const hslColor = sourceColor !== null && sourceColor !== void 0 ? sourceColor : destColor;
4550
+ if (hslColor) {
4551
+ return hslToRgb(hslColor);
4552
+ }
4553
+ }
4554
+ } else {
4555
+ return linkColor;
4556
+ }
4557
+ }
4558
+ function getLinkRandomColor(optColor, blink, consent) {
4559
+ const color = typeof optColor === "string" ? optColor : optColor.value;
4560
+ if (color === Constants.randomColorValue) {
4561
+ if (consent) {
4562
+ return ColorUtils_colorToRgb({
4563
+ value: color
4564
+ });
4565
+ } else if (blink) {
4566
+ return Constants.randomColorValue;
4567
+ } else {
4568
+ return Constants.midColorValue;
4569
+ }
4570
+ } else {
4571
+ return ColorUtils_colorToRgb({
4572
+ value: color
4573
+ });
4574
+ }
4575
+ }
4576
+ function ColorUtils_getHslFromAnimation(animation) {
4577
+ return animation !== undefined ? {
4578
+ h: animation.h.value,
4579
+ s: animation.s.value,
4580
+ l: animation.l.value
4581
+ } : undefined;
4582
+ }
4583
+ function getHslAnimationFromHsl(hsl, animationOptions, reduceFactor) {
4584
+ const resColor = {
4585
+ h: {
4586
+ enable: false,
4587
+ value: hsl.h
4588
+ },
4589
+ s: {
4590
+ enable: false,
4591
+ value: hsl.s
4592
+ },
4593
+ l: {
4594
+ enable: false,
4595
+ value: hsl.l
4596
+ }
4597
+ };
4598
+ if (animationOptions) {
4599
+ setColorAnimation(resColor.h, animationOptions.h, reduceFactor);
4600
+ setColorAnimation(resColor.s, animationOptions.s, reduceFactor);
4601
+ setColorAnimation(resColor.l, animationOptions.l, reduceFactor);
4602
+ }
4603
+ return resColor;
4604
+ }
4605
+ function setColorAnimation(colorValue, colorAnimation, reduceFactor) {
4606
+ colorValue.enable = colorAnimation.enable;
4607
+ if (colorValue.enable) {
4608
+ colorValue.velocity = colorAnimation.speed / 100 * reduceFactor;
4609
+ if (colorAnimation.sync) {
4610
+ return;
4611
+ }
4612
+ colorValue.status = 0;
4613
+ colorValue.velocity *= Math.random();
4614
+ if (colorValue.value) {
4615
+ colorValue.value *= Math.random();
4616
+ }
4617
+ } else {
4618
+ colorValue.velocity = 0;
4619
+ }
4620
+ }
4621
+ function drawLine(context, begin, end) {
4622
+ context.beginPath();
4623
+ context.moveTo(begin.x, begin.y);
4624
+ context.lineTo(end.x, end.y);
4625
+ context.closePath();
4626
+ }
4627
+ function drawTriangle(context, p1, p2, p3) {
4628
+ context.beginPath();
4629
+ context.moveTo(p1.x, p1.y);
4630
+ context.lineTo(p2.x, p2.y);
4631
+ context.lineTo(p3.x, p3.y);
4632
+ context.closePath();
4633
+ }
4634
+ function CanvasUtils_paintBase(context, dimension, baseColor) {
4635
+ context.save();
4636
+ context.fillStyle = baseColor !== null && baseColor !== void 0 ? baseColor : "rgba(0,0,0,0)";
4637
+ context.fillRect(0, 0, dimension.width, dimension.height);
4638
+ context.restore();
4639
+ }
4640
+ function CanvasUtils_clear(context, dimension) {
4641
+ context.clearRect(0, 0, dimension.width, dimension.height);
4642
+ }
4643
+ function drawLinkLine(context, width, begin, end, maxDistance, canvasSize, warp, backgroundMask, composite, colorLine, opacity, shadow) {
4644
+ let drawn = false;
4645
+ if (getDistance(begin, end) <= maxDistance) {
4646
+ drawLine(context, begin, end);
4647
+ drawn = true;
4648
+ } else if (warp) {
4649
+ let pi1;
4650
+ let pi2;
4651
+ const endNE = {
4652
+ x: end.x - canvasSize.width,
4653
+ y: end.y
4654
+ };
4655
+ const d1 = getDistances(begin, endNE);
4656
+ if (d1.distance <= maxDistance) {
4657
+ const yi = begin.y - d1.dy / d1.dx * begin.x;
4658
+ pi1 = {
4659
+ x: 0,
4660
+ y: yi
4661
+ };
4662
+ pi2 = {
4663
+ x: canvasSize.width,
4664
+ y: yi
4665
+ };
4666
+ } else {
4667
+ const endSW = {
4668
+ x: end.x,
4669
+ y: end.y - canvasSize.height
4670
+ };
4671
+ const d2 = getDistances(begin, endSW);
4672
+ if (d2.distance <= maxDistance) {
4673
+ const yi = begin.y - d2.dy / d2.dx * begin.x;
4674
+ const xi = -yi / (d2.dy / d2.dx);
4675
+ pi1 = {
4676
+ x: xi,
4677
+ y: 0
4678
+ };
4679
+ pi2 = {
4680
+ x: xi,
4681
+ y: canvasSize.height
4682
+ };
4683
+ } else {
4684
+ const endSE = {
4685
+ x: end.x - canvasSize.width,
4686
+ y: end.y - canvasSize.height
4687
+ };
4688
+ const d3 = getDistances(begin, endSE);
4689
+ if (d3.distance <= maxDistance) {
4690
+ const yi = begin.y - d3.dy / d3.dx * begin.x;
4691
+ const xi = -yi / (d3.dy / d3.dx);
4692
+ pi1 = {
4693
+ x: xi,
4694
+ y: yi
4695
+ };
4696
+ pi2 = {
4697
+ x: pi1.x + canvasSize.width,
4698
+ y: pi1.y + canvasSize.height
4699
+ };
4700
+ }
4701
+ }
4702
+ }
4703
+ if (pi1 && pi2) {
4704
+ drawLine(context, begin, pi1);
4705
+ drawLine(context, end, pi2);
4706
+ drawn = true;
4707
+ }
4708
+ }
4709
+ if (!drawn) {
4710
+ return;
4711
+ }
4712
+ context.lineWidth = width;
4713
+ if (backgroundMask) {
4714
+ context.globalCompositeOperation = composite;
4715
+ }
4716
+ context.strokeStyle = getStyleFromRgb(colorLine, opacity);
4717
+ if (shadow.enable) {
4718
+ const shadowColor = colorToRgb(shadow.color);
4719
+ if (shadowColor) {
4720
+ context.shadowBlur = shadow.blur;
4721
+ context.shadowColor = getStyleFromRgb(shadowColor);
4722
+ }
4723
+ }
4724
+ context.stroke();
4725
+ }
4726
+ function drawLinkTriangle(context, pos1, pos2, pos3, backgroundMask, composite, colorTriangle, opacityTriangle) {
4727
+ drawTriangle(context, pos1, pos2, pos3);
4728
+ if (backgroundMask) {
4729
+ context.globalCompositeOperation = composite;
4730
+ }
4731
+ context.fillStyle = getStyleFromRgb(colorTriangle, opacityTriangle);
4732
+ context.fill();
4733
+ }
4734
+ function CanvasUtils_drawConnectLine(context, width, lineStyle, begin, end) {
4735
+ context.save();
4736
+ drawLine(context, begin, end);
4737
+ context.lineWidth = width;
4738
+ context.strokeStyle = lineStyle;
4739
+ context.stroke();
4740
+ context.restore();
4741
+ }
4742
+ function CanvasUtils_gradient(context, p1, p2, opacity) {
4743
+ const gradStop = Math.floor(p2.getRadius() / p1.getRadius());
4744
+ const color1 = p1.getFillColor();
4745
+ const color2 = p2.getFillColor();
4746
+ if (!color1 || !color2) {
4747
+ return;
4748
+ }
4749
+ const sourcePos = p1.getPosition();
4750
+ const destPos = p2.getPosition();
4751
+ const midRgb = colorMix(color1, color2, p1.getRadius(), p2.getRadius());
4752
+ const grad = context.createLinearGradient(sourcePos.x, sourcePos.y, destPos.x, destPos.y);
4753
+ grad.addColorStop(0, getStyleFromHsl(color1, opacity));
4754
+ grad.addColorStop(gradStop > 1 ? 1 : gradStop, getStyleFromRgb(midRgb, opacity));
4755
+ grad.addColorStop(1, getStyleFromHsl(color2, opacity));
4756
+ return grad;
4757
+ }
4758
+ function CanvasUtils_drawGrabLine(context, width, begin, end, colorLine, opacity) {
4759
+ context.save();
4760
+ drawLine(context, begin, end);
4761
+ context.strokeStyle = getStyleFromRgb(colorLine, opacity);
4762
+ context.lineWidth = width;
4763
+ context.stroke();
4764
+ context.restore();
4765
+ }
4766
+ function CanvasUtils_drawParticle(container, context, particle, delta, fillColorValue, strokeColorValue, backgroundMask, composite, radius, opacity, shadow, gradient) {
4767
+ var _a, _b, _c, _d, _e, _f;
4768
+ const pos = particle.getPosition();
4769
+ const tiltOptions = particle.options.tilt;
4770
+ const rollOptions = particle.options.roll;
4771
+ context.save();
4772
+ if (tiltOptions.enable || rollOptions.enable) {
4773
+ const roll = rollOptions.enable && particle.roll;
4774
+ const tilt = tiltOptions.enable && particle.tilt;
4775
+ const rollHorizontal = roll && (rollOptions.mode === "horizontal" || rollOptions.mode === "both");
4776
+ const rollVertical = roll && (rollOptions.mode === "vertical" || rollOptions.mode === "both");
4777
+ context.setTransform(rollHorizontal ? Math.cos(particle.roll.angle) : 1, tilt ? Math.cos(particle.tilt.value) * particle.tilt.cosDirection : 0, tilt ? Math.sin(particle.tilt.value) * particle.tilt.sinDirection : 0, rollVertical ? Math.sin(particle.roll.angle) : 1, pos.x, pos.y);
4778
+ } else {
4779
+ context.translate(pos.x, pos.y);
4780
+ }
4781
+ context.beginPath();
4782
+ const angle = ((_b = (_a = particle.rotate) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : 0) + (particle.options.rotate.path ? particle.velocity.angle : 0);
4783
+ if (angle !== 0) {
4784
+ context.rotate(angle);
4785
+ }
4786
+ if (backgroundMask) {
4787
+ context.globalCompositeOperation = composite;
4788
+ }
4789
+ const shadowColor = particle.shadowColor;
4790
+ if (shadow.enable && shadowColor) {
4791
+ context.shadowBlur = shadow.blur;
4792
+ context.shadowColor = getStyleFromRgb(shadowColor);
4793
+ context.shadowOffsetX = shadow.offset.x;
4794
+ context.shadowOffsetY = shadow.offset.y;
4795
+ }
4796
+ if (gradient) {
4797
+ const gradientAngle = gradient.angle.value;
4798
+ const fillGradient = gradient.type === "radial" ? context.createRadialGradient(0, 0, 0, 0, 0, radius) : context.createLinearGradient(Math.cos(gradientAngle) * -radius, Math.sin(gradientAngle) * -radius, Math.cos(gradientAngle) * radius, Math.sin(gradientAngle) * radius);
4799
+ for (const color of gradient.colors) {
4800
+ fillGradient.addColorStop(color.stop, getStyleFromHsl({
4801
+ h: color.value.h.value,
4802
+ s: color.value.s.value,
4803
+ l: color.value.l.value
4804
+ }, (_d = (_c = color.opacity) === null || _c === void 0 ? void 0 : _c.value) !== null && _d !== void 0 ? _d : opacity));
4805
+ }
4806
+ context.fillStyle = fillGradient;
4807
+ } else {
4808
+ if (fillColorValue) {
4809
+ context.fillStyle = fillColorValue;
4810
+ }
4811
+ }
4812
+ const stroke = particle.stroke;
4813
+ context.lineWidth = (_e = particle.strokeWidth) !== null && _e !== void 0 ? _e : 0;
4814
+ if (strokeColorValue) {
4815
+ context.strokeStyle = strokeColorValue;
4816
+ }
4817
+ drawShape(container, context, particle, radius, opacity, delta);
4818
+ if (((_f = stroke === null || stroke === void 0 ? void 0 : stroke.width) !== null && _f !== void 0 ? _f : 0) > 0) {
4819
+ context.stroke();
4820
+ }
4821
+ if (particle.close) {
4822
+ context.closePath();
4823
+ }
4824
+ if (particle.fill) {
4825
+ context.fill();
4826
+ }
4827
+ context.restore();
4828
+ context.save();
4829
+ if (tiltOptions.enable && particle.tilt) {
4830
+ context.setTransform(1, Math.cos(particle.tilt.value) * particle.tilt.cosDirection, Math.sin(particle.tilt.value) * particle.tilt.sinDirection, 1, pos.x, pos.y);
4831
+ } else {
4832
+ context.translate(pos.x, pos.y);
4833
+ }
4834
+ if (angle !== 0) {
4835
+ context.rotate(angle);
4836
+ }
4837
+ if (backgroundMask) {
4838
+ context.globalCompositeOperation = composite;
4839
+ }
4840
+ drawShapeAfterEffect(container, context, particle, radius, opacity, delta);
4841
+ context.restore();
4842
+ }
4843
+ function drawShape(container, context, particle, radius, opacity, delta) {
4844
+ if (!particle.shape) {
4845
+ return;
4846
+ }
4847
+ const drawer = container.drawers.get(particle.shape);
4848
+ if (!drawer) {
4849
+ return;
4850
+ }
4851
+ drawer.draw(context, particle, radius, opacity, delta, container.retina.pixelRatio);
4852
+ }
4853
+ function drawShapeAfterEffect(container, context, particle, radius, opacity, delta) {
4854
+ if (!particle.shape) {
4855
+ return;
4856
+ }
4857
+ const drawer = container.drawers.get(particle.shape);
4858
+ if (!(drawer === null || drawer === void 0 ? void 0 : drawer.afterEffect)) {
4859
+ return;
4860
+ }
4861
+ drawer.afterEffect(context, particle, radius, opacity, delta, container.retina.pixelRatio);
4862
+ }
4863
+ function CanvasUtils_drawPlugin(context, plugin, delta) {
4864
+ if (!plugin.draw) {
4865
+ return;
4866
+ }
4867
+ context.save();
4868
+ plugin.draw(context, delta);
4869
+ context.restore();
4870
+ }
4871
+ function CanvasUtils_drawParticlePlugin(context, plugin, particle, delta) {
4872
+ if (plugin.drawParticle !== undefined) {
4873
+ context.save();
4874
+ plugin.drawParticle(context, particle, delta);
4875
+ context.restore();
4876
+ }
4877
+ }
4878
+ function drawEllipse(context, particle, fillColorValue, radius, opacity, width, rotation, start, end) {
4879
+ const pos = particle.getPosition();
4880
+ if (fillColorValue) {
4881
+ context.strokeStyle = getStyleFromHsl(fillColorValue, opacity);
4882
+ }
4883
+ if (width === 0) {
4884
+ return;
4885
+ }
4886
+ context.lineWidth = width;
4887
+ const rotationRadian = rotation * Math.PI / 180;
4888
+ context.beginPath();
4889
+ context.ellipse(pos.x, pos.y, radius / 2, radius * 2, rotationRadian, start, end);
4890
+ context.stroke();
4891
+ }
4892
+ function CanvasUtils_alterHsl(color, type, value) {
4893
+ return {
4894
+ h: color.h,
4895
+ s: color.s,
4896
+ l: color.l + (type === "darken" ? -1 : 1) * value
4897
+ };
4898
+ }
4899
+ function bounce(p1, p2) {
4900
+ circleBounce(circleBounceDataFromParticle(p1), circleBounceDataFromParticle(p2));
4901
+ }
4902
+ function destroy(p1, p2) {
4903
+ if (!p1.unbreakable && !p2.unbreakable) {
4904
+ bounce(p1, p2);
4905
+ }
4906
+ if (p1.getRadius() === undefined && p2.getRadius() !== undefined) {
4907
+ p1.destroy();
4908
+ } else if (p1.getRadius() !== undefined && p2.getRadius() === undefined) {
4909
+ p2.destroy();
4910
+ } else if (p1.getRadius() !== undefined && p2.getRadius() !== undefined) {
4911
+ if (p1.getRadius() >= p2.getRadius()) {
4912
+ p2.destroy();
4913
+ } else {
4914
+ p1.destroy();
4915
+ }
4916
+ }
4917
+ }
4918
+ class Collider extends ParticlesInteractorBase {
4919
+ constructor(container) {
4920
+ super(container);
4921
+ }
4922
+ isEnabled(particle) {
4923
+ return particle.options.collisions.enable;
4924
+ }
4925
+ reset() {}
4926
+ interact(p1) {
4927
+ const container = this.container;
4928
+ const pos1 = p1.getPosition();
4929
+ const radius1 = p1.getRadius();
4930
+ const query = container.particles.quadTree.queryCircle(pos1, radius1 * 2);
4931
+ for (const p2 of query) {
4932
+ if (p1 === p2 || !p2.options.collisions.enable || p1.options.collisions.mode !== p2.options.collisions.mode || p2.destroyed || p2.spawning) {
4933
+ continue;
4934
+ }
4935
+ const pos2 = p2.getPosition();
4936
+ if (Math.round(pos1.z) !== Math.round(pos2.z)) {
4937
+ continue;
4938
+ }
4939
+ const dist = NumberUtils_getDistance(pos1, pos2);
4940
+ const radius2 = p2.getRadius();
4941
+ const distP = radius1 + radius2;
4942
+ if (dist <= distP) {
4943
+ this.resolveCollision(p1, p2);
4944
+ }
4945
+ }
4946
+ }
4947
+ resolveCollision(p1, p2) {
4948
+ switch (p1.options.collisions.mode) {
4949
+ case "absorb":
4950
+ {
4951
+ this.absorb(p1, p2);
4952
+ break;
4953
+ }
4954
+
4955
+ case "bounce":
4956
+ {
4957
+ bounce(p1, p2);
4958
+ break;
4959
+ }
4960
+
4961
+ case "destroy":
4962
+ {
4963
+ destroy(p1, p2);
4964
+ break;
4965
+ }
4966
+ }
4967
+ }
4968
+ absorb(p1, p2) {
4969
+ const container = this.container;
4970
+ const fps = container.fpsLimit / 1e3;
4971
+ if (p1.getRadius() === undefined && p2.getRadius() !== undefined) {
4972
+ p1.destroy();
4973
+ } else if (p1.getRadius() !== undefined && p2.getRadius() === undefined) {
4974
+ p2.destroy();
4975
+ } else if (p1.getRadius() !== undefined && p2.getRadius() !== undefined) {
4976
+ if (p1.getRadius() >= p2.getRadius()) {
4977
+ const factor = NumberUtils_clamp(p1.getRadius() / p2.getRadius(), 0, p2.getRadius()) * fps;
4978
+ p1.size.value += factor;
4979
+ p2.size.value -= factor;
4980
+ if (p2.getRadius() <= container.retina.pixelRatio) {
4981
+ p2.size.value = 0;
4982
+ p2.destroy();
4983
+ }
4984
+ } else {
4985
+ const factor = NumberUtils_clamp(p2.getRadius() / p1.getRadius(), 0, p1.getRadius()) * fps;
4986
+ p1.size.value -= factor;
4987
+ p2.size.value += factor;
4988
+ if (p1.getRadius() <= container.retina.pixelRatio) {
4989
+ p1.size.value = 0;
4990
+ p1.destroy();
4991
+ }
4992
+ }
4993
+ }
4994
+ }
4995
+ }
4996
+ async function loadParticlesCollisionsInteraction(engine) {
4997
+ await engine.addInteractor("particlesCollisions", (container => new Collider(container)));
4998
+ }
4999
+ return __webpack_exports__;
5000
+ }();
5001
+ }));