@tsparticles/interaction-particles-collisions 4.0.1 → 4.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/index.js +1 -1
- package/browser/index.lazy.js +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.lazy.js +1 -1
- package/esm/index.js +1 -1
- package/esm/index.lazy.js +1 -1
- package/package.json +3 -7
- package/tsparticles.interaction.particles.collisions.js +2 -2
- package/tsparticles.interaction.particles.collisions.min.js +1 -1
package/browser/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { ensureInteractivityPluginLoaded } from "@tsparticles/plugin-interactivi
|
|
|
2
2
|
import { Collider } from "./Collider.js";
|
|
3
3
|
import { OverlapPlugin } from "./OverlapPlugin.js";
|
|
4
4
|
export async function loadParticlesCollisionsInteraction(engine) {
|
|
5
|
-
engine.checkVersion("4.0.
|
|
5
|
+
engine.checkVersion("4.0.2");
|
|
6
6
|
await engine.pluginManager.register((e) => {
|
|
7
7
|
ensureInteractivityPluginLoaded(e);
|
|
8
8
|
e.pluginManager.addPlugin(new OverlapPlugin());
|
package/browser/index.lazy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadParticlesCollisionsInteraction(engine) {
|
|
2
|
-
engine.checkVersion("4.0.
|
|
2
|
+
engine.checkVersion("4.0.2");
|
|
3
3
|
await engine.pluginManager.register(async (e) => {
|
|
4
4
|
const [{ ensureInteractivityPluginLoaded }, { OverlapPlugin },] = await Promise.all([
|
|
5
5
|
import("@tsparticles/plugin-interactivity/lazy"),
|
package/cjs/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { ensureInteractivityPluginLoaded } from "@tsparticles/plugin-interactivi
|
|
|
2
2
|
import { Collider } from "./Collider.js";
|
|
3
3
|
import { OverlapPlugin } from "./OverlapPlugin.js";
|
|
4
4
|
export async function loadParticlesCollisionsInteraction(engine) {
|
|
5
|
-
engine.checkVersion("4.0.
|
|
5
|
+
engine.checkVersion("4.0.2");
|
|
6
6
|
await engine.pluginManager.register((e) => {
|
|
7
7
|
ensureInteractivityPluginLoaded(e);
|
|
8
8
|
e.pluginManager.addPlugin(new OverlapPlugin());
|
package/cjs/index.lazy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadParticlesCollisionsInteraction(engine) {
|
|
2
|
-
engine.checkVersion("4.0.
|
|
2
|
+
engine.checkVersion("4.0.2");
|
|
3
3
|
await engine.pluginManager.register(async (e) => {
|
|
4
4
|
const [{ ensureInteractivityPluginLoaded }, { OverlapPlugin },] = await Promise.all([
|
|
5
5
|
import("@tsparticles/plugin-interactivity/lazy"),
|
package/esm/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { ensureInteractivityPluginLoaded } from "@tsparticles/plugin-interactivi
|
|
|
2
2
|
import { Collider } from "./Collider.js";
|
|
3
3
|
import { OverlapPlugin } from "./OverlapPlugin.js";
|
|
4
4
|
export async function loadParticlesCollisionsInteraction(engine) {
|
|
5
|
-
engine.checkVersion("4.0.
|
|
5
|
+
engine.checkVersion("4.0.2");
|
|
6
6
|
await engine.pluginManager.register((e) => {
|
|
7
7
|
ensureInteractivityPluginLoaded(e);
|
|
8
8
|
e.pluginManager.addPlugin(new OverlapPlugin());
|
package/esm/index.lazy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadParticlesCollisionsInteraction(engine) {
|
|
2
|
-
engine.checkVersion("4.0.
|
|
2
|
+
engine.checkVersion("4.0.2");
|
|
3
3
|
await engine.pluginManager.register(async (e) => {
|
|
4
4
|
const [{ ensureInteractivityPluginLoaded }, { OverlapPlugin },] = await Promise.all([
|
|
5
5
|
import("@tsparticles/plugin-interactivity/lazy"),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/interaction-particles-collisions",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.2",
|
|
4
4
|
"description": "tsParticles collisions particles interaction",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -92,16 +92,12 @@
|
|
|
92
92
|
},
|
|
93
93
|
"./package.json": "./package.json"
|
|
94
94
|
},
|
|
95
|
-
"peerDepdendencies": {
|
|
96
|
-
"@tsparticles/engine": "4.0.0-beta.1",
|
|
97
|
-
"@tsparticles/plugin-interactivity": "4.0.0-beta.1"
|
|
98
|
-
},
|
|
99
95
|
"publishConfig": {
|
|
100
96
|
"access": "public"
|
|
101
97
|
},
|
|
102
98
|
"type": "module",
|
|
103
99
|
"peerDependencies": {
|
|
104
|
-
"@tsparticles/engine": "4.0.
|
|
105
|
-
"@tsparticles/plugin-interactivity": "4.0.
|
|
100
|
+
"@tsparticles/engine": "4.0.2",
|
|
101
|
+
"@tsparticles/plugin-interactivity": "4.0.2"
|
|
106
102
|
}
|
|
107
103
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
(function(g){g.__tsParticlesInternals=g.__tsParticlesInternals||{};g.__tsParticlesInternals.bundles=g.__tsParticlesInternals.bundles||{};g.__tsParticlesInternals.effects=g.__tsParticlesInternals.effects||{};g.__tsParticlesInternals.engine=g.__tsParticlesInternals.engine||{};g.__tsParticlesInternals.interactions=g.__tsParticlesInternals.interactions||{};g.__tsParticlesInternals.palettes=g.__tsParticlesInternals.palettes||{};g.__tsParticlesInternals.paths=g.__tsParticlesInternals.paths||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins.emittersShapes=g.__tsParticlesInternals.plugins.emittersShapes||{};g.__tsParticlesInternals.presets=g.__tsParticlesInternals.presets||{};g.__tsParticlesInternals.shapes=g.__tsParticlesInternals.shapes||{};g.__tsParticlesInternals.updaters=g.__tsParticlesInternals.updaters||{};g.__tsParticlesInternals.utils=g.__tsParticlesInternals.utils||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas.utils=g.__tsParticlesInternals.canvas.utils||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path.utils=g.__tsParticlesInternals.path.utils||{};var __tsProxyFactory=typeof Proxy!=="undefined"?function(obj){return new Proxy(obj,{get:function(target,key){if(!(key in target)){target[key]={};}return target[key];}});}:function(obj){return obj;};g.__tsParticlesInternals.bundles=__tsProxyFactory(g.__tsParticlesInternals.bundles);g.__tsParticlesInternals.effects=__tsProxyFactory(g.__tsParticlesInternals.effects);g.__tsParticlesInternals.interactions=__tsProxyFactory(g.__tsParticlesInternals.interactions);g.__tsParticlesInternals.palettes=__tsProxyFactory(g.__tsParticlesInternals.palettes);g.__tsParticlesInternals.paths=__tsProxyFactory(g.__tsParticlesInternals.paths);g.__tsParticlesInternals.plugins=__tsProxyFactory(g.__tsParticlesInternals.plugins);g.__tsParticlesInternals.plugins.emittersShapes=__tsProxyFactory(g.__tsParticlesInternals.plugins.emittersShapes);g.__tsParticlesInternals.presets=__tsProxyFactory(g.__tsParticlesInternals.presets);g.__tsParticlesInternals.shapes=__tsProxyFactory(g.__tsParticlesInternals.shapes);g.__tsParticlesInternals.updaters=__tsProxyFactory(g.__tsParticlesInternals.updaters);g.__tsParticlesInternals.utils=__tsProxyFactory(g.__tsParticlesInternals.utils);g.__tsParticlesInternals.canvas=__tsProxyFactory(g.__tsParticlesInternals.canvas);g.__tsParticlesInternals.path=__tsProxyFactory(g.__tsParticlesInternals.path);g.tsparticlesInternalExports=g.tsparticlesInternalExports||{};})(typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:this);
|
|
2
|
-
/* Particles Interaction v4.0.
|
|
2
|
+
/* Particles Interaction v4.0.2 */
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tsparticles/plugin-interactivity'), require('@tsparticles/engine')) :
|
|
5
5
|
typeof define === 'function' && define.amd ? define(['exports', '@tsparticles/plugin-interactivity', '@tsparticles/engine'], factory) :
|
|
@@ -237,7 +237,7 @@
|
|
|
237
237
|
}
|
|
238
238
|
|
|
239
239
|
async function loadParticlesCollisionsInteraction(engine) {
|
|
240
|
-
engine.checkVersion("4.0.
|
|
240
|
+
engine.checkVersion("4.0.2");
|
|
241
241
|
await engine.pluginManager.register((e) => {
|
|
242
242
|
pluginInteractivity.ensureInteractivityPluginLoaded(e);
|
|
243
243
|
e.pluginManager.addPlugin(new OverlapPlugin());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(s){s.__tsParticlesInternals=s.__tsParticlesInternals||{},s.__tsParticlesInternals.bundles=s.__tsParticlesInternals.bundles||{},s.__tsParticlesInternals.effects=s.__tsParticlesInternals.effects||{},s.__tsParticlesInternals.engine=s.__tsParticlesInternals.engine||{},s.__tsParticlesInternals.interactions=s.__tsParticlesInternals.interactions||{},s.__tsParticlesInternals.palettes=s.__tsParticlesInternals.palettes||{},s.__tsParticlesInternals.paths=s.__tsParticlesInternals.paths||{},s.__tsParticlesInternals.plugins=s.__tsParticlesInternals.plugins||{},s.__tsParticlesInternals.plugins=s.__tsParticlesInternals.plugins||{},s.__tsParticlesInternals.plugins.emittersShapes=s.__tsParticlesInternals.plugins.emittersShapes||{},s.__tsParticlesInternals.presets=s.__tsParticlesInternals.presets||{},s.__tsParticlesInternals.shapes=s.__tsParticlesInternals.shapes||{},s.__tsParticlesInternals.updaters=s.__tsParticlesInternals.updaters||{},s.__tsParticlesInternals.utils=s.__tsParticlesInternals.utils||{},s.__tsParticlesInternals.canvas=s.__tsParticlesInternals.canvas||{},s.__tsParticlesInternals.canvas=s.__tsParticlesInternals.canvas||{},s.__tsParticlesInternals.canvas.utils=s.__tsParticlesInternals.canvas.utils||{},s.__tsParticlesInternals.path=s.__tsParticlesInternals.path||{},s.__tsParticlesInternals.path=s.__tsParticlesInternals.path||{},s.__tsParticlesInternals.path.utils=s.__tsParticlesInternals.path.utils||{};var t="undefined"!=typeof Proxy?function(s){return new Proxy(s,{get:function(s,t){return t in s||(s[t]={}),s[t]}})}:function(s){return s};s.__tsParticlesInternals.bundles=t(s.__tsParticlesInternals.bundles),s.__tsParticlesInternals.effects=t(s.__tsParticlesInternals.effects),s.__tsParticlesInternals.interactions=t(s.__tsParticlesInternals.interactions),s.__tsParticlesInternals.palettes=t(s.__tsParticlesInternals.palettes),s.__tsParticlesInternals.paths=t(s.__tsParticlesInternals.paths),s.__tsParticlesInternals.plugins=t(s.__tsParticlesInternals.plugins),s.__tsParticlesInternals.plugins.emittersShapes=t(s.__tsParticlesInternals.plugins.emittersShapes),s.__tsParticlesInternals.presets=t(s.__tsParticlesInternals.presets),s.__tsParticlesInternals.shapes=t(s.__tsParticlesInternals.shapes),s.__tsParticlesInternals.updaters=t(s.__tsParticlesInternals.updaters),s.__tsParticlesInternals.utils=t(s.__tsParticlesInternals.utils),s.__tsParticlesInternals.canvas=t(s.__tsParticlesInternals.canvas),s.__tsParticlesInternals.path=t(s.__tsParticlesInternals.path),s.tsparticlesInternalExports=s.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(s,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@tsparticles/plugin-interactivity"),require("@tsparticles/engine")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/plugin-interactivity","@tsparticles/engine"],t):t(((s="undefined"!=typeof globalThis?globalThis:s||self).__tsParticlesInternals=s.__tsParticlesInternals||{},s.__tsParticlesInternals.interactions=s.__tsParticlesInternals.interactions||{},s.__tsParticlesInternals.interactions.particlesCollisions=s.__tsParticlesInternals.interactions.particlesCollisions||{}),s.__tsParticlesInternals.plugins.interactivity,s.__tsParticlesInternals.engine)}(this,function(s,t,e){"use strict";var n;!function(s){s.absorb="absorb",s.bounce="bounce",s.destroy="destroy"}(n||(n={}));class a{speed;constructor(){this.speed=2}load(s){e.isNull(s)||void 0!==s.speed&&(this.speed=s.speed)}}class i{enable;retries;constructor(){this.enable=!0,this.retries=0}load(s){e.isNull(s)||(void 0!==s.enable&&(this.enable=s.enable),void 0!==s.retries&&(this.retries=s.retries))}}class l{absorb;bounce;enable;maxSpeed;mode;overlap;constructor(){this.absorb=new a,this.bounce=new e.ParticlesBounce,this.enable=!1,this.maxSpeed=50,this.mode=n.bounce,this.overlap=new i}load(s){e.isNull(s)||(this.absorb.load(s.absorb),this.bounce.load(s.bounce),void 0!==s.enable&&(this.enable=s.enable),void 0!==s.maxSpeed&&(this.maxSpeed=e.setRangeValue(s.maxSpeed)),void 0!==s.mode&&(this.mode=s.mode),this.overlap.load(s.overlap))}}function r(s,t,n,a,i,l){if(!s.options.collisions||!n.options.collisions)return;const r=s.options.collisions.absorb.speed,o=e.clamp(r*i.factor,0,a);s.size.value=Math.sqrt(t*t+o*o),n.size.value-=o,n.size.value<=l&&(n.size.value=0,n.destroy())}const o=s=>{s.options.collisions&&(s.collisionMaxSpeed??=e.getRangeValue(s.options.collisions.maxSpeed),s.velocity.length>s.collisionMaxSpeed&&(s.velocity.length=s.collisionMaxSpeed))};function c(s,t){const n=s.getMass(),a=t.getMass(),i=s.velocity.length,l=t.velocity.length,r=n*i*i+a*l*l;e.circleBounce(e.circleBounceDataFromParticle(s),e.circleBounceDataFromParticle(t));const c=s.velocity.length,_=t.velocity.length,p=n*c*c+a*_*_;if(p>1e-6*r){const e=Math.sqrt(r/p);Math.abs(e-1)>1e-4&&(s.velocity.length=c*e,t.velocity.length=_*e)}o(s),o(t)}function _(s,t,e,a){if(s.options.collisions&&t.options.collisions)switch(s.options.collisions.mode){case n.absorb:!function(s,t,e,n){const a=s.getRadius(),i=t.getRadius();!a&&i?s.destroy():a&&!i?t.destroy():a&&i&&(a>=i?r(s,a,t,i,e,n):r(t,i,s,a,e,n))}(s,t,e,a);break;case n.bounce:c(s,t);break;case n.destroy:!function(s,t){s.unbreakable||t.unbreakable||c(s,t);const e=s.getRadius(),n=t.getRadius();!e&&n?s.destroy():e&&!n?t.destroy():e&&n&&(s.getRadius()>=t.getRadius()?t:s).destroy()}(s,t)}}class p extends t.ParticlesInteractorBase{maxDistance;constructor(s){super(s),this.maxDistance=0}clear(){}init(){}interact(s,t,n){if(s.destroyed||s.spawning)return;const a=this.container,i=s.getPosition(),l=s.getRadius(),r=a.particles.grid.queryCircle(i,l*e.double);for(const t of r){if(s===t||s.id>=t.id||!s.options.collisions?.enable||!t.options.collisions?.enable||s.options.collisions.mode!==t.options.collisions.mode||t.destroyed||t.spawning)continue;const r=t.getPosition(),o=t.getRadius();if(Math.abs(Math.round(i.z)-Math.round(r.z))>l+o)continue;e.getDistance(i,r)>l+o||_(s,t,n,a.retina.pixelRatio)}}isEnabled(s){return!!s.options.collisions?.enable}loadParticlesOptions(s,...t){s.collisions??=new l;for(const e of t)s.collisions.load(e?.collisions)}reset(){}}class u{id="overlap";async getPlugin(s){const{OverlapPluginInstance:t}=await Promise.resolve().then(function(){return I});return new t(s)}loadOptions(){}needsPlugin(){return!0}}async function d(s){s.checkVersion("4.0.
|
|
1
|
+
!function(s){s.__tsParticlesInternals=s.__tsParticlesInternals||{},s.__tsParticlesInternals.bundles=s.__tsParticlesInternals.bundles||{},s.__tsParticlesInternals.effects=s.__tsParticlesInternals.effects||{},s.__tsParticlesInternals.engine=s.__tsParticlesInternals.engine||{},s.__tsParticlesInternals.interactions=s.__tsParticlesInternals.interactions||{},s.__tsParticlesInternals.palettes=s.__tsParticlesInternals.palettes||{},s.__tsParticlesInternals.paths=s.__tsParticlesInternals.paths||{},s.__tsParticlesInternals.plugins=s.__tsParticlesInternals.plugins||{},s.__tsParticlesInternals.plugins=s.__tsParticlesInternals.plugins||{},s.__tsParticlesInternals.plugins.emittersShapes=s.__tsParticlesInternals.plugins.emittersShapes||{},s.__tsParticlesInternals.presets=s.__tsParticlesInternals.presets||{},s.__tsParticlesInternals.shapes=s.__tsParticlesInternals.shapes||{},s.__tsParticlesInternals.updaters=s.__tsParticlesInternals.updaters||{},s.__tsParticlesInternals.utils=s.__tsParticlesInternals.utils||{},s.__tsParticlesInternals.canvas=s.__tsParticlesInternals.canvas||{},s.__tsParticlesInternals.canvas=s.__tsParticlesInternals.canvas||{},s.__tsParticlesInternals.canvas.utils=s.__tsParticlesInternals.canvas.utils||{},s.__tsParticlesInternals.path=s.__tsParticlesInternals.path||{},s.__tsParticlesInternals.path=s.__tsParticlesInternals.path||{},s.__tsParticlesInternals.path.utils=s.__tsParticlesInternals.path.utils||{};var t="undefined"!=typeof Proxy?function(s){return new Proxy(s,{get:function(s,t){return t in s||(s[t]={}),s[t]}})}:function(s){return s};s.__tsParticlesInternals.bundles=t(s.__tsParticlesInternals.bundles),s.__tsParticlesInternals.effects=t(s.__tsParticlesInternals.effects),s.__tsParticlesInternals.interactions=t(s.__tsParticlesInternals.interactions),s.__tsParticlesInternals.palettes=t(s.__tsParticlesInternals.palettes),s.__tsParticlesInternals.paths=t(s.__tsParticlesInternals.paths),s.__tsParticlesInternals.plugins=t(s.__tsParticlesInternals.plugins),s.__tsParticlesInternals.plugins.emittersShapes=t(s.__tsParticlesInternals.plugins.emittersShapes),s.__tsParticlesInternals.presets=t(s.__tsParticlesInternals.presets),s.__tsParticlesInternals.shapes=t(s.__tsParticlesInternals.shapes),s.__tsParticlesInternals.updaters=t(s.__tsParticlesInternals.updaters),s.__tsParticlesInternals.utils=t(s.__tsParticlesInternals.utils),s.__tsParticlesInternals.canvas=t(s.__tsParticlesInternals.canvas),s.__tsParticlesInternals.path=t(s.__tsParticlesInternals.path),s.tsparticlesInternalExports=s.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(s,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@tsparticles/plugin-interactivity"),require("@tsparticles/engine")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/plugin-interactivity","@tsparticles/engine"],t):t(((s="undefined"!=typeof globalThis?globalThis:s||self).__tsParticlesInternals=s.__tsParticlesInternals||{},s.__tsParticlesInternals.interactions=s.__tsParticlesInternals.interactions||{},s.__tsParticlesInternals.interactions.particlesCollisions=s.__tsParticlesInternals.interactions.particlesCollisions||{}),s.__tsParticlesInternals.plugins.interactivity,s.__tsParticlesInternals.engine)}(this,function(s,t,e){"use strict";var n;!function(s){s.absorb="absorb",s.bounce="bounce",s.destroy="destroy"}(n||(n={}));class a{speed;constructor(){this.speed=2}load(s){e.isNull(s)||void 0!==s.speed&&(this.speed=s.speed)}}class i{enable;retries;constructor(){this.enable=!0,this.retries=0}load(s){e.isNull(s)||(void 0!==s.enable&&(this.enable=s.enable),void 0!==s.retries&&(this.retries=s.retries))}}class l{absorb;bounce;enable;maxSpeed;mode;overlap;constructor(){this.absorb=new a,this.bounce=new e.ParticlesBounce,this.enable=!1,this.maxSpeed=50,this.mode=n.bounce,this.overlap=new i}load(s){e.isNull(s)||(this.absorb.load(s.absorb),this.bounce.load(s.bounce),void 0!==s.enable&&(this.enable=s.enable),void 0!==s.maxSpeed&&(this.maxSpeed=e.setRangeValue(s.maxSpeed)),void 0!==s.mode&&(this.mode=s.mode),this.overlap.load(s.overlap))}}function r(s,t,n,a,i,l){if(!s.options.collisions||!n.options.collisions)return;const r=s.options.collisions.absorb.speed,o=e.clamp(r*i.factor,0,a);s.size.value=Math.sqrt(t*t+o*o),n.size.value-=o,n.size.value<=l&&(n.size.value=0,n.destroy())}const o=s=>{s.options.collisions&&(s.collisionMaxSpeed??=e.getRangeValue(s.options.collisions.maxSpeed),s.velocity.length>s.collisionMaxSpeed&&(s.velocity.length=s.collisionMaxSpeed))};function c(s,t){const n=s.getMass(),a=t.getMass(),i=s.velocity.length,l=t.velocity.length,r=n*i*i+a*l*l;e.circleBounce(e.circleBounceDataFromParticle(s),e.circleBounceDataFromParticle(t));const c=s.velocity.length,_=t.velocity.length,p=n*c*c+a*_*_;if(p>1e-6*r){const e=Math.sqrt(r/p);Math.abs(e-1)>1e-4&&(s.velocity.length=c*e,t.velocity.length=_*e)}o(s),o(t)}function _(s,t,e,a){if(s.options.collisions&&t.options.collisions)switch(s.options.collisions.mode){case n.absorb:!function(s,t,e,n){const a=s.getRadius(),i=t.getRadius();!a&&i?s.destroy():a&&!i?t.destroy():a&&i&&(a>=i?r(s,a,t,i,e,n):r(t,i,s,a,e,n))}(s,t,e,a);break;case n.bounce:c(s,t);break;case n.destroy:!function(s,t){s.unbreakable||t.unbreakable||c(s,t);const e=s.getRadius(),n=t.getRadius();!e&&n?s.destroy():e&&!n?t.destroy():e&&n&&(s.getRadius()>=t.getRadius()?t:s).destroy()}(s,t)}}class p extends t.ParticlesInteractorBase{maxDistance;constructor(s){super(s),this.maxDistance=0}clear(){}init(){}interact(s,t,n){if(s.destroyed||s.spawning)return;const a=this.container,i=s.getPosition(),l=s.getRadius(),r=a.particles.grid.queryCircle(i,l*e.double);for(const t of r){if(s===t||s.id>=t.id||!s.options.collisions?.enable||!t.options.collisions?.enable||s.options.collisions.mode!==t.options.collisions.mode||t.destroyed||t.spawning)continue;const r=t.getPosition(),o=t.getRadius();if(Math.abs(Math.round(i.z)-Math.round(r.z))>l+o)continue;e.getDistance(i,r)>l+o||_(s,t,n,a.retina.pixelRatio)}}isEnabled(s){return!!s.options.collisions?.enable}loadParticlesOptions(s,...t){s.collisions??=new l;for(const e of t)s.collisions.load(e?.collisions)}reset(){}}class u{id="overlap";async getPlugin(s){const{OverlapPluginInstance:t}=await Promise.resolve().then(function(){return I});return new t(s)}loadOptions(){}needsPlugin(){return!0}}async function d(s){s.checkVersion("4.0.2"),await s.pluginManager.register(s=>{t.ensureInteractivityPluginLoaded(s),s.pluginManager.addPlugin(new u),s.pluginManager.addInteractor?.("particlesCollisions",s=>Promise.resolve(new p(s)))})}const P=globalThis;P.__tsParticlesInternals=P.__tsParticlesInternals??{},P.loadParticlesCollisionsInteraction=d;var I=Object.freeze({__proto__:null,OverlapPluginInstance:class{_container;constructor(s){this._container=s}checkParticlePosition(s,t,e){return!this._hasOverlaps(s,t,e)}_hasOverlaps=(s,t,n)=>{const a=s.options.collisions;if(!a?.enable)return!1;const i=a.overlap;if(i.enable)return!1;const l=i.retries;if(l>=0&&n>l)throw new Error("Particle is overlapping and can't be placed");return!!this._container.particles.find(n=>e.getDistance(t,n.position)<s.getRadius()+n.getRadius())}}});s.loadParticlesCollisionsInteraction=d}),Object.assign(globalThis.window||globalThis,{loadParticlesCollisionsInteraction:(globalThis.__tsParticlesInternals.interactions.particlesCollisions||{}).loadParticlesCollisionsInteraction}),delete(globalThis.window||globalThis).tsparticlesInternalExports;
|