@tsparticles/interaction-particles-links 4.5.0 → 4.5.1

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.
@@ -1,4 +1,4 @@
1
- import { Circle, Rectangle } from "@tsparticles/engine";
1
+ import { Circle, Rectangle, originPoint, } from "@tsparticles/engine";
2
2
  export class CircleWarp extends Circle {
3
3
  #canvasSize;
4
4
  constructor(x, y, radius, canvasSize) {
@@ -46,4 +46,28 @@ export class CircleWarp extends Circle {
46
46
  }
47
47
  return false;
48
48
  }
49
+ query(grid) {
50
+ const { x, y } = this.position, { width, height } = this.#canvasSize, radius = this.radius, crossesLeft = x - radius <= originPoint.x, crossesRight = x + radius >= width, crossesTop = y - radius <= originPoint.y, crossesBottom = y + radius >= height;
51
+ if (!crossesLeft && !crossesRight && !crossesTop && !crossesBottom) {
52
+ return grid.query(this);
53
+ }
54
+ const xShifts = [originPoint.x], yShifts = [originPoint.y];
55
+ if (crossesLeft)
56
+ xShifts.push(width);
57
+ if (crossesRight)
58
+ xShifts.push(-width);
59
+ if (crossesTop)
60
+ yShifts.push(height);
61
+ if (crossesBottom)
62
+ yShifts.push(-height);
63
+ const particles = new Set();
64
+ for (const dx of xShifts) {
65
+ for (const dy of yShifts) {
66
+ for (const particle of grid.queryCircle({ x: x + dx, y: y + dy }, radius)) {
67
+ particles.add(particle);
68
+ }
69
+ }
70
+ }
71
+ return [...particles];
72
+ }
49
73
  }
package/browser/Linker.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Circle, getDistances, getLinkColor, getLinkRandomColor, loadOptionProperty, originPoint, } from "@tsparticles/engine";
1
+ import { getDistances, getLinkColor, getLinkRandomColor, loadOptionProperty, originPoint, } from "@tsparticles/engine";
2
2
  import { CircleWarp } from "./CircleWarp.js";
3
3
  import { Links } from "./Options/Classes/Links.js";
4
4
  import { ParticlesInteractorBase } from "@tsparticles/plugin-interactivity";
@@ -39,7 +39,9 @@ export class Linker extends ParticlesInteractorBase {
39
39
  if (pos1.x < originPoint.x || pos1.y < originPoint.y || pos1.x > canvasSize.width || pos1.y > canvasSize.height) {
40
40
  return;
41
41
  }
42
- const linkOpt1 = p1.options.links, optOpacity = linkOpt1.opacity, optDistance = p1.retina.linksDistance ?? minDistance, warp = linkOpt1.warp, range = warp ? new CircleWarp(pos1.x, pos1.y, optDistance, canvasSize) : new Circle(pos1.x, pos1.y, optDistance), query = container.particles.grid.query(range);
42
+ const linkOpt1 = p1.options.links, optOpacity = linkOpt1.opacity, optDistance = p1.retina.linksDistance ?? minDistance, warp = linkOpt1.warp, query = (warp
43
+ ? new CircleWarp(pos1.x, pos1.y, optDistance, canvasSize).query(container.particles.grid)
44
+ : container.particles.grid.queryCircle(pos1, optDistance));
43
45
  for (const p2 of query) {
44
46
  const linkOpt2 = p2.options.links;
45
47
  if (p1 === p2 ||
package/browser/index.js CHANGED
@@ -2,7 +2,7 @@ import { ensureInteractivityPluginLoaded } from "@tsparticles/plugin-interactivi
2
2
  import { Linker } from "./Linker.js";
3
3
  import { LinksPlugin } from "./LinksPlugin.js";
4
4
  export async function loadParticlesLinksInteraction(engine) {
5
- engine.checkVersion("4.5.0");
5
+ engine.checkVersion("4.5.1");
6
6
  await engine.pluginManager.register((e) => {
7
7
  const pluginManager = e.pluginManager;
8
8
  ensureInteractivityPluginLoaded(e);
@@ -1,5 +1,5 @@
1
1
  export async function loadParticlesLinksInteraction(engine) {
2
- engine.checkVersion("4.5.0");
2
+ engine.checkVersion("4.5.1");
3
3
  await engine.pluginManager.register(async (e) => {
4
4
  const pluginManager = e.pluginManager, [{ ensureInteractivityPluginLoaded }, { LinksPlugin },] = await Promise.all([
5
5
  import("@tsparticles/plugin-interactivity/lazy"),
package/cjs/CircleWarp.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Circle, Rectangle } from "@tsparticles/engine";
1
+ import { Circle, Rectangle, originPoint, } from "@tsparticles/engine";
2
2
  export class CircleWarp extends Circle {
3
3
  #canvasSize;
4
4
  constructor(x, y, radius, canvasSize) {
@@ -46,4 +46,28 @@ export class CircleWarp extends Circle {
46
46
  }
47
47
  return false;
48
48
  }
49
+ query(grid) {
50
+ const { x, y } = this.position, { width, height } = this.#canvasSize, radius = this.radius, crossesLeft = x - radius <= originPoint.x, crossesRight = x + radius >= width, crossesTop = y - radius <= originPoint.y, crossesBottom = y + radius >= height;
51
+ if (!crossesLeft && !crossesRight && !crossesTop && !crossesBottom) {
52
+ return grid.query(this);
53
+ }
54
+ const xShifts = [originPoint.x], yShifts = [originPoint.y];
55
+ if (crossesLeft)
56
+ xShifts.push(width);
57
+ if (crossesRight)
58
+ xShifts.push(-width);
59
+ if (crossesTop)
60
+ yShifts.push(height);
61
+ if (crossesBottom)
62
+ yShifts.push(-height);
63
+ const particles = new Set();
64
+ for (const dx of xShifts) {
65
+ for (const dy of yShifts) {
66
+ for (const particle of grid.queryCircle({ x: x + dx, y: y + dy }, radius)) {
67
+ particles.add(particle);
68
+ }
69
+ }
70
+ }
71
+ return [...particles];
72
+ }
49
73
  }
package/cjs/Linker.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Circle, getDistances, getLinkColor, getLinkRandomColor, loadOptionProperty, originPoint, } from "@tsparticles/engine";
1
+ import { getDistances, getLinkColor, getLinkRandomColor, loadOptionProperty, originPoint, } from "@tsparticles/engine";
2
2
  import { CircleWarp } from "./CircleWarp.js";
3
3
  import { Links } from "./Options/Classes/Links.js";
4
4
  import { ParticlesInteractorBase } from "@tsparticles/plugin-interactivity";
@@ -39,7 +39,9 @@ export class Linker extends ParticlesInteractorBase {
39
39
  if (pos1.x < originPoint.x || pos1.y < originPoint.y || pos1.x > canvasSize.width || pos1.y > canvasSize.height) {
40
40
  return;
41
41
  }
42
- const linkOpt1 = p1.options.links, optOpacity = linkOpt1.opacity, optDistance = p1.retina.linksDistance ?? minDistance, warp = linkOpt1.warp, range = warp ? new CircleWarp(pos1.x, pos1.y, optDistance, canvasSize) : new Circle(pos1.x, pos1.y, optDistance), query = container.particles.grid.query(range);
42
+ const linkOpt1 = p1.options.links, optOpacity = linkOpt1.opacity, optDistance = p1.retina.linksDistance ?? minDistance, warp = linkOpt1.warp, query = (warp
43
+ ? new CircleWarp(pos1.x, pos1.y, optDistance, canvasSize).query(container.particles.grid)
44
+ : container.particles.grid.queryCircle(pos1, optDistance));
43
45
  for (const p2 of query) {
44
46
  const linkOpt2 = p2.options.links;
45
47
  if (p1 === p2 ||
package/cjs/index.js CHANGED
@@ -2,7 +2,7 @@ import { ensureInteractivityPluginLoaded } from "@tsparticles/plugin-interactivi
2
2
  import { Linker } from "./Linker.js";
3
3
  import { LinksPlugin } from "./LinksPlugin.js";
4
4
  export async function loadParticlesLinksInteraction(engine) {
5
- engine.checkVersion("4.5.0");
5
+ engine.checkVersion("4.5.1");
6
6
  await engine.pluginManager.register((e) => {
7
7
  const pluginManager = e.pluginManager;
8
8
  ensureInteractivityPluginLoaded(e);
package/cjs/index.lazy.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export async function loadParticlesLinksInteraction(engine) {
2
- engine.checkVersion("4.5.0");
2
+ engine.checkVersion("4.5.1");
3
3
  await engine.pluginManager.register(async (e) => {
4
4
  const pluginManager = e.pluginManager, [{ ensureInteractivityPluginLoaded }, { LinksPlugin },] = await Promise.all([
5
5
  import("@tsparticles/plugin-interactivity/lazy"),
package/esm/CircleWarp.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Circle, Rectangle } from "@tsparticles/engine";
1
+ import { Circle, Rectangle, originPoint, } from "@tsparticles/engine";
2
2
  export class CircleWarp extends Circle {
3
3
  #canvasSize;
4
4
  constructor(x, y, radius, canvasSize) {
@@ -46,4 +46,28 @@ export class CircleWarp extends Circle {
46
46
  }
47
47
  return false;
48
48
  }
49
+ query(grid) {
50
+ const { x, y } = this.position, { width, height } = this.#canvasSize, radius = this.radius, crossesLeft = x - radius <= originPoint.x, crossesRight = x + radius >= width, crossesTop = y - radius <= originPoint.y, crossesBottom = y + radius >= height;
51
+ if (!crossesLeft && !crossesRight && !crossesTop && !crossesBottom) {
52
+ return grid.query(this);
53
+ }
54
+ const xShifts = [originPoint.x], yShifts = [originPoint.y];
55
+ if (crossesLeft)
56
+ xShifts.push(width);
57
+ if (crossesRight)
58
+ xShifts.push(-width);
59
+ if (crossesTop)
60
+ yShifts.push(height);
61
+ if (crossesBottom)
62
+ yShifts.push(-height);
63
+ const particles = new Set();
64
+ for (const dx of xShifts) {
65
+ for (const dy of yShifts) {
66
+ for (const particle of grid.queryCircle({ x: x + dx, y: y + dy }, radius)) {
67
+ particles.add(particle);
68
+ }
69
+ }
70
+ }
71
+ return [...particles];
72
+ }
49
73
  }
package/esm/Linker.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Circle, getDistances, getLinkColor, getLinkRandomColor, loadOptionProperty, originPoint, } from "@tsparticles/engine";
1
+ import { getDistances, getLinkColor, getLinkRandomColor, loadOptionProperty, originPoint, } from "@tsparticles/engine";
2
2
  import { CircleWarp } from "./CircleWarp.js";
3
3
  import { Links } from "./Options/Classes/Links.js";
4
4
  import { ParticlesInteractorBase } from "@tsparticles/plugin-interactivity";
@@ -39,7 +39,9 @@ export class Linker extends ParticlesInteractorBase {
39
39
  if (pos1.x < originPoint.x || pos1.y < originPoint.y || pos1.x > canvasSize.width || pos1.y > canvasSize.height) {
40
40
  return;
41
41
  }
42
- const linkOpt1 = p1.options.links, optOpacity = linkOpt1.opacity, optDistance = p1.retina.linksDistance ?? minDistance, warp = linkOpt1.warp, range = warp ? new CircleWarp(pos1.x, pos1.y, optDistance, canvasSize) : new Circle(pos1.x, pos1.y, optDistance), query = container.particles.grid.query(range);
42
+ const linkOpt1 = p1.options.links, optOpacity = linkOpt1.opacity, optDistance = p1.retina.linksDistance ?? minDistance, warp = linkOpt1.warp, query = (warp
43
+ ? new CircleWarp(pos1.x, pos1.y, optDistance, canvasSize).query(container.particles.grid)
44
+ : container.particles.grid.queryCircle(pos1, optDistance));
43
45
  for (const p2 of query) {
44
46
  const linkOpt2 = p2.options.links;
45
47
  if (p1 === p2 ||
package/esm/index.js CHANGED
@@ -2,7 +2,7 @@ import { ensureInteractivityPluginLoaded } from "@tsparticles/plugin-interactivi
2
2
  import { Linker } from "./Linker.js";
3
3
  import { LinksPlugin } from "./LinksPlugin.js";
4
4
  export async function loadParticlesLinksInteraction(engine) {
5
- engine.checkVersion("4.5.0");
5
+ engine.checkVersion("4.5.1");
6
6
  await engine.pluginManager.register((e) => {
7
7
  const pluginManager = e.pluginManager;
8
8
  ensureInteractivityPluginLoaded(e);
package/esm/index.lazy.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export async function loadParticlesLinksInteraction(engine) {
2
- engine.checkVersion("4.5.0");
2
+ engine.checkVersion("4.5.1");
3
3
  await engine.pluginManager.register(async (e) => {
4
4
  const pluginManager = e.pluginManager, [{ ensureInteractivityPluginLoaded }, { LinksPlugin },] = 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-links",
3
- "version": "4.5.0",
3
+ "version": "4.5.1",
4
4
  "description": "tsParticles links particles interaction",
5
5
  "homepage": "https://particles.js.org",
6
6
  "repository": {
@@ -97,10 +97,10 @@
97
97
  },
98
98
  "type": "module",
99
99
  "peerDependencies": {
100
- "@tsparticles/engine": "4.5.0",
101
- "@tsparticles/plugin-interactivity": "4.5.0"
100
+ "@tsparticles/engine": "4.5.1",
101
+ "@tsparticles/plugin-interactivity": "4.5.1"
102
102
  },
103
103
  "dependencies": {
104
- "@tsparticles/canvas-utils": "4.5.0"
104
+ "@tsparticles/canvas-utils": "4.5.1"
105
105
  }
106
106
  }
package/report.html CHANGED
@@ -5285,7 +5285,7 @@ var drawChart = (function (exports) {
5285
5285
  </script>
5286
5286
  <script>
5287
5287
  /*<!--*/
5288
- const data = {"version":2,"tree":{"name":"root","children":[{"name":"tsparticles.interaction.particles.links.js","children":[{"name":"dist/browser","children":[{"uid":"13273d74-1","name":"CircleWarp.js"},{"name":"Options/Classes","children":[{"uid":"13273d74-3","name":"LinksShadow.js"},{"uid":"13273d74-5","name":"LinksTriangle.js"},{"uid":"13273d74-7","name":"Links.js"}]},{"uid":"13273d74-9","name":"Linker.js"},{"uid":"13273d74-11","name":"LinksPlugin.js"},{"uid":"13273d74-13","name":"index.js"},{"uid":"13273d74-15","name":"browser.js"},{"uid":"13273d74-17","name":"Utils.js"},{"uid":"13273d74-19","name":"LinkInstance.js"}]}]}],"isRoot":true},"nodeParts":{"13273d74-1":{"renderedLength":2053,"gzipLength":0,"brotliLength":0,"metaUid":"13273d74-0"},"13273d74-3":{"renderedLength":492,"gzipLength":0,"brotliLength":0,"metaUid":"13273d74-2"},"13273d74-5":{"renderedLength":551,"gzipLength":0,"brotliLength":0,"metaUid":"13273d74-4"},"13273d74-7":{"renderedLength":1242,"gzipLength":0,"brotliLength":0,"metaUid":"13273d74-6"},"13273d74-9":{"renderedLength":4810,"gzipLength":0,"brotliLength":0,"metaUid":"13273d74-8"},"13273d74-11":{"renderedLength":487,"gzipLength":0,"brotliLength":0,"metaUid":"13273d74-10"},"13273d74-13":{"renderedLength":524,"gzipLength":0,"brotliLength":0,"metaUid":"13273d74-12"},"13273d74-15":{"renderedLength":201,"gzipLength":0,"brotliLength":0,"metaUid":"13273d74-14"},"13273d74-17":{"renderedLength":390,"gzipLength":0,"brotliLength":0,"metaUid":"13273d74-16"},"13273d74-19":{"renderedLength":7779,"gzipLength":0,"brotliLength":0,"metaUid":"13273d74-18"}},"nodeMetas":{"13273d74-0":{"id":"/dist/browser/CircleWarp.js","moduleParts":{"tsparticles.interaction.particles.links.js":"13273d74-1"},"imported":[{"uid":"13273d74-21"}],"importedBy":[{"uid":"13273d74-8"}]},"13273d74-2":{"id":"/dist/browser/Options/Classes/LinksShadow.js","moduleParts":{"tsparticles.interaction.particles.links.js":"13273d74-3"},"imported":[{"uid":"13273d74-21"}],"importedBy":[{"uid":"13273d74-12"},{"uid":"13273d74-6"}]},"13273d74-4":{"id":"/dist/browser/Options/Classes/LinksTriangle.js","moduleParts":{"tsparticles.interaction.particles.links.js":"13273d74-5"},"imported":[{"uid":"13273d74-21"}],"importedBy":[{"uid":"13273d74-12"},{"uid":"13273d74-6"}]},"13273d74-6":{"id":"/dist/browser/Options/Classes/Links.js","moduleParts":{"tsparticles.interaction.particles.links.js":"13273d74-7"},"imported":[{"uid":"13273d74-21"},{"uid":"13273d74-2"},{"uid":"13273d74-4"}],"importedBy":[{"uid":"13273d74-12"},{"uid":"13273d74-8"}]},"13273d74-8":{"id":"/dist/browser/Linker.js","moduleParts":{"tsparticles.interaction.particles.links.js":"13273d74-9"},"imported":[{"uid":"13273d74-21"},{"uid":"13273d74-0"},{"uid":"13273d74-6"},{"uid":"13273d74-20"}],"importedBy":[{"uid":"13273d74-12"}]},"13273d74-10":{"id":"/dist/browser/LinksPlugin.js","moduleParts":{"tsparticles.interaction.particles.links.js":"13273d74-11"},"imported":[{"uid":"13273d74-18","dynamic":true}],"importedBy":[{"uid":"13273d74-12"}]},"13273d74-12":{"id":"/dist/browser/index.js","moduleParts":{"tsparticles.interaction.particles.links.js":"13273d74-13"},"imported":[{"uid":"13273d74-20"},{"uid":"13273d74-8"},{"uid":"13273d74-10"},{"uid":"13273d74-6"},{"uid":"13273d74-2"},{"uid":"13273d74-4"}],"importedBy":[{"uid":"13273d74-14"}]},"13273d74-14":{"id":"/dist/browser/browser.js","moduleParts":{"tsparticles.interaction.particles.links.js":"13273d74-15"},"imported":[{"uid":"13273d74-12"}],"importedBy":[],"isEntry":true},"13273d74-16":{"id":"/dist/browser/Utils.js","moduleParts":{"tsparticles.interaction.particles.links.js":"13273d74-17"},"imported":[{"uid":"13273d74-21"}],"importedBy":[{"uid":"13273d74-18"}]},"13273d74-18":{"id":"/dist/browser/LinkInstance.js","moduleParts":{"tsparticles.interaction.particles.links.js":"13273d74-19"},"imported":[{"uid":"13273d74-21"},{"uid":"13273d74-16"}],"importedBy":[{"uid":"13273d74-10"}]},"13273d74-20":{"id":"@tsparticles/plugin-interactivity","moduleParts":{},"imported":[],"importedBy":[{"uid":"13273d74-12"},{"uid":"13273d74-8"}],"isExternal":true},"13273d74-21":{"id":"@tsparticles/engine","moduleParts":{},"imported":[],"importedBy":[{"uid":"13273d74-8"},{"uid":"13273d74-6"},{"uid":"13273d74-2"},{"uid":"13273d74-4"},{"uid":"13273d74-0"},{"uid":"13273d74-18"},{"uid":"13273d74-16"}],"isExternal":true}},"env":{"rollup":"4.63.1"},"options":{"gzip":false,"brotli":false,"sourcemap":false}};
5288
+ const data = {"version":2,"tree":{"name":"root","children":[{"name":"tsparticles.interaction.particles.links.js","children":[{"name":"dist/browser","children":[{"uid":"76c9c7ce-1","name":"CircleWarp.js"},{"name":"Options/Classes","children":[{"uid":"76c9c7ce-3","name":"LinksShadow.js"},{"uid":"76c9c7ce-5","name":"LinksTriangle.js"},{"uid":"76c9c7ce-7","name":"Links.js"}]},{"uid":"76c9c7ce-9","name":"Linker.js"},{"uid":"76c9c7ce-11","name":"LinksPlugin.js"},{"uid":"76c9c7ce-13","name":"index.js"},{"uid":"76c9c7ce-15","name":"browser.js"},{"uid":"76c9c7ce-17","name":"Utils.js"},{"uid":"76c9c7ce-19","name":"LinkInstance.js"}]}]}],"isRoot":true},"nodeParts":{"76c9c7ce-1":{"renderedLength":3215,"gzipLength":0,"brotliLength":0,"metaUid":"76c9c7ce-0"},"76c9c7ce-3":{"renderedLength":492,"gzipLength":0,"brotliLength":0,"metaUid":"76c9c7ce-2"},"76c9c7ce-5":{"renderedLength":551,"gzipLength":0,"brotliLength":0,"metaUid":"76c9c7ce-4"},"76c9c7ce-7":{"renderedLength":1242,"gzipLength":0,"brotliLength":0,"metaUid":"76c9c7ce-6"},"76c9c7ce-9":{"renderedLength":4838,"gzipLength":0,"brotliLength":0,"metaUid":"76c9c7ce-8"},"76c9c7ce-11":{"renderedLength":487,"gzipLength":0,"brotliLength":0,"metaUid":"76c9c7ce-10"},"76c9c7ce-13":{"renderedLength":524,"gzipLength":0,"brotliLength":0,"metaUid":"76c9c7ce-12"},"76c9c7ce-15":{"renderedLength":201,"gzipLength":0,"brotliLength":0,"metaUid":"76c9c7ce-14"},"76c9c7ce-17":{"renderedLength":390,"gzipLength":0,"brotliLength":0,"metaUid":"76c9c7ce-16"},"76c9c7ce-19":{"renderedLength":7779,"gzipLength":0,"brotliLength":0,"metaUid":"76c9c7ce-18"}},"nodeMetas":{"76c9c7ce-0":{"id":"/dist/browser/CircleWarp.js","moduleParts":{"tsparticles.interaction.particles.links.js":"76c9c7ce-1"},"imported":[{"uid":"76c9c7ce-21"}],"importedBy":[{"uid":"76c9c7ce-8"}]},"76c9c7ce-2":{"id":"/dist/browser/Options/Classes/LinksShadow.js","moduleParts":{"tsparticles.interaction.particles.links.js":"76c9c7ce-3"},"imported":[{"uid":"76c9c7ce-21"}],"importedBy":[{"uid":"76c9c7ce-12"},{"uid":"76c9c7ce-6"}]},"76c9c7ce-4":{"id":"/dist/browser/Options/Classes/LinksTriangle.js","moduleParts":{"tsparticles.interaction.particles.links.js":"76c9c7ce-5"},"imported":[{"uid":"76c9c7ce-21"}],"importedBy":[{"uid":"76c9c7ce-12"},{"uid":"76c9c7ce-6"}]},"76c9c7ce-6":{"id":"/dist/browser/Options/Classes/Links.js","moduleParts":{"tsparticles.interaction.particles.links.js":"76c9c7ce-7"},"imported":[{"uid":"76c9c7ce-21"},{"uid":"76c9c7ce-2"},{"uid":"76c9c7ce-4"}],"importedBy":[{"uid":"76c9c7ce-12"},{"uid":"76c9c7ce-8"}]},"76c9c7ce-8":{"id":"/dist/browser/Linker.js","moduleParts":{"tsparticles.interaction.particles.links.js":"76c9c7ce-9"},"imported":[{"uid":"76c9c7ce-21"},{"uid":"76c9c7ce-0"},{"uid":"76c9c7ce-6"},{"uid":"76c9c7ce-20"}],"importedBy":[{"uid":"76c9c7ce-12"}]},"76c9c7ce-10":{"id":"/dist/browser/LinksPlugin.js","moduleParts":{"tsparticles.interaction.particles.links.js":"76c9c7ce-11"},"imported":[{"uid":"76c9c7ce-18","dynamic":true}],"importedBy":[{"uid":"76c9c7ce-12"}]},"76c9c7ce-12":{"id":"/dist/browser/index.js","moduleParts":{"tsparticles.interaction.particles.links.js":"76c9c7ce-13"},"imported":[{"uid":"76c9c7ce-20"},{"uid":"76c9c7ce-8"},{"uid":"76c9c7ce-10"},{"uid":"76c9c7ce-6"},{"uid":"76c9c7ce-2"},{"uid":"76c9c7ce-4"}],"importedBy":[{"uid":"76c9c7ce-14"}]},"76c9c7ce-14":{"id":"/dist/browser/browser.js","moduleParts":{"tsparticles.interaction.particles.links.js":"76c9c7ce-15"},"imported":[{"uid":"76c9c7ce-12"}],"importedBy":[],"isEntry":true},"76c9c7ce-16":{"id":"/dist/browser/Utils.js","moduleParts":{"tsparticles.interaction.particles.links.js":"76c9c7ce-17"},"imported":[{"uid":"76c9c7ce-21"}],"importedBy":[{"uid":"76c9c7ce-18"}]},"76c9c7ce-18":{"id":"/dist/browser/LinkInstance.js","moduleParts":{"tsparticles.interaction.particles.links.js":"76c9c7ce-19"},"imported":[{"uid":"76c9c7ce-21"},{"uid":"76c9c7ce-16"}],"importedBy":[{"uid":"76c9c7ce-10"}]},"76c9c7ce-20":{"id":"@tsparticles/plugin-interactivity","moduleParts":{},"imported":[],"importedBy":[{"uid":"76c9c7ce-12"},{"uid":"76c9c7ce-8"}],"isExternal":true},"76c9c7ce-21":{"id":"@tsparticles/engine","moduleParts":{},"imported":[],"importedBy":[{"uid":"76c9c7ce-8"},{"uid":"76c9c7ce-6"},{"uid":"76c9c7ce-2"},{"uid":"76c9c7ce-4"},{"uid":"76c9c7ce-0"},{"uid":"76c9c7ce-18"},{"uid":"76c9c7ce-16"}],"isExternal":true}},"env":{"rollup":"4.66.0"},"options":{"gzip":false,"brotli":false,"sourcemap":false}};
5289
5289
 
5290
5290
  const run = () => {
5291
5291
  const width = window.innerWidth;
@@ -1,6 +1,6 @@
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);})(typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:this);
2
2
  (function (g) {
3
- /* Particles Interaction v4.5.0 */
3
+ /* Particles Interaction v4.5.1 */
4
4
  g.__tsParticlesInternals = g.__tsParticlesInternals || {};
5
5
  g.__tsParticlesInternals.interactions = g.__tsParticlesInternals.interactions || {};
6
6
  (function (exports, pluginInteractivity, engine) {
@@ -53,6 +53,30 @@ g.__tsParticlesInternals.interactions = g.__tsParticlesInternals.interactions ||
53
53
  }
54
54
  return false;
55
55
  }
56
+ query(grid) {
57
+ const { x, y } = this.position, { width, height } = this.#canvasSize, radius = this.radius, crossesLeft = x - radius <= engine.originPoint.x, crossesRight = x + radius >= width, crossesTop = y - radius <= engine.originPoint.y, crossesBottom = y + radius >= height;
58
+ if (!crossesLeft && !crossesRight && !crossesTop && !crossesBottom) {
59
+ return grid.query(this);
60
+ }
61
+ const xShifts = [engine.originPoint.x], yShifts = [engine.originPoint.y];
62
+ if (crossesLeft)
63
+ xShifts.push(width);
64
+ if (crossesRight)
65
+ xShifts.push(-width);
66
+ if (crossesTop)
67
+ yShifts.push(height);
68
+ if (crossesBottom)
69
+ yShifts.push(-height);
70
+ const particles = new Set();
71
+ for (const dx of xShifts) {
72
+ for (const dy of yShifts) {
73
+ for (const particle of grid.queryCircle({ x: x + dx, y: y + dy }, radius)) {
74
+ particles.add(particle);
75
+ }
76
+ }
77
+ }
78
+ return [...particles];
79
+ }
56
80
  }
57
81
 
58
82
  class LinksShadow {
@@ -162,7 +186,9 @@ g.__tsParticlesInternals.interactions = g.__tsParticlesInternals.interactions ||
162
186
  if (pos1.x < engine.originPoint.x || pos1.y < engine.originPoint.y || pos1.x > canvasSize.width || pos1.y > canvasSize.height) {
163
187
  return;
164
188
  }
165
- const linkOpt1 = p1.options.links, optOpacity = linkOpt1.opacity, optDistance = p1.retina.linksDistance ?? minDistance$1, warp = linkOpt1.warp, range = warp ? new CircleWarp(pos1.x, pos1.y, optDistance, canvasSize) : new engine.Circle(pos1.x, pos1.y, optDistance), query = container.particles.grid.query(range);
189
+ const linkOpt1 = p1.options.links, optOpacity = linkOpt1.opacity, optDistance = p1.retina.linksDistance ?? minDistance$1, warp = linkOpt1.warp, query = (warp
190
+ ? new CircleWarp(pos1.x, pos1.y, optDistance, canvasSize).query(container.particles.grid)
191
+ : container.particles.grid.queryCircle(pos1, optDistance));
166
192
  for (const p2 of query) {
167
193
  const linkOpt2 = p2.options.links;
168
194
  if (p1 === p2 ||
@@ -250,7 +276,7 @@ g.__tsParticlesInternals.interactions = g.__tsParticlesInternals.interactions ||
250
276
  }
251
277
 
252
278
  async function loadParticlesLinksInteraction(engine) {
253
- engine.checkVersion("4.5.0");
279
+ engine.checkVersion("4.5.1");
254
280
  await engine.pluginManager.register((e) => {
255
281
  const pluginManager = e.pluginManager;
256
282
  pluginInteractivity.ensureInteractivityPluginLoaded(e);
@@ -1 +1 @@
1
- !function(t){t.__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.bundles=t.__tsParticlesInternals.bundles||{},t.__tsParticlesInternals.effects=t.__tsParticlesInternals.effects||{},t.__tsParticlesInternals.engine=t.__tsParticlesInternals.engine||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},t.__tsParticlesInternals.palettes=t.__tsParticlesInternals.palettes||{},t.__tsParticlesInternals.paths=t.__tsParticlesInternals.paths||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins.emittersShapes=t.__tsParticlesInternals.plugins.emittersShapes||{},t.__tsParticlesInternals.presets=t.__tsParticlesInternals.presets||{},t.__tsParticlesInternals.shapes=t.__tsParticlesInternals.shapes||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.utils=t.__tsParticlesInternals.utils||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas.utils=t.__tsParticlesInternals.canvas.utils||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path.utils=t.__tsParticlesInternals.path.utils||{};var s="undefined"!=typeof Proxy?function(t){return new Proxy(t,{get:function(t,s){return s in t||(t[s]={}),t[s]}})}:function(t){return t};t.__tsParticlesInternals.bundles=s(t.__tsParticlesInternals.bundles),t.__tsParticlesInternals.effects=s(t.__tsParticlesInternals.effects),t.__tsParticlesInternals.interactions=s(t.__tsParticlesInternals.interactions),t.__tsParticlesInternals.palettes=s(t.__tsParticlesInternals.palettes),t.__tsParticlesInternals.paths=s(t.__tsParticlesInternals.paths),t.__tsParticlesInternals.plugins=s(t.__tsParticlesInternals.plugins),t.__tsParticlesInternals.plugins.emittersShapes=s(t.__tsParticlesInternals.plugins.emittersShapes),t.__tsParticlesInternals.presets=s(t.__tsParticlesInternals.presets),t.__tsParticlesInternals.shapes=s(t.__tsParticlesInternals.shapes),t.__tsParticlesInternals.updaters=s(t.__tsParticlesInternals.updaters),t.__tsParticlesInternals.utils=s(t.__tsParticlesInternals.utils),t.__tsParticlesInternals.canvas=s(t.__tsParticlesInternals.canvas),t.__tsParticlesInternals.path=s(t.__tsParticlesInternals.path)}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(t){t.__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},function(t,s,n){"use strict";class e extends n.Circle{#t;constructor(t,s,n,e){super(t,s,n),this.#t=e}contains(t){if(super.contains(t))return!0;const{width:s,height:n}=this.#t,{x:e,y:i}=t;return super.contains({x:e-s,y:i})||super.contains({x:e+s,y:i})||super.contains({x:e,y:i-n})||super.contains({x:e,y:i+n})||super.contains({x:e-s,y:i-n})||super.contains({x:e+s,y:i+n})||super.contains({x:e-s,y:i+n})||super.contains({x:e+s,y:i-n})}intersects(t){if(super.intersects(t))return!0;const{width:s,height:e}=this.#t,i=t.position,a=[{x:-s,y:0},{x:s,y:0},{x:0,y:-e},{x:0,y:e},{x:-s,y:-e},{x:s,y:e},{x:-s,y:e},{x:s,y:-e}];for(const s of a){const e={x:i.x+s.x,y:i.y+s.y};let a;if(t instanceof n.Circle)a=new n.Circle(e.x,e.y,t.radius);else{const s=t;a=new n.Rectangle(e.x,e.y,s.size.width,s.size.height)}if(super.intersects(a))return!0}return!1}}class i{blur=5;color=new n.OptionsColor;enable=!1;constructor(){this.color.value="#000"}load(t){n.isNull(t)||(n.loadProperty(this,"blur",t.blur),this.color=n.OptionsColor.create(this.color,t.color),n.loadProperty(this,"enable",t.enable))}}class a{color;enable=!1;frequency=1;opacity;load(t){n.isNull(t)||(void 0!==t.color&&(this.color=n.OptionsColor.create(this.color,t.color)),n.loadProperty(this,"enable",t.enable),n.loadProperty(this,"frequency",t.frequency),n.loadProperty(this,"opacity",t.opacity))}}class r{blink=!1;color=new n.OptionsColor;consent=!1;distance=100;enable=!1;frequency=1;id;opacity=1;shadow=new i;triangles=new a;warp=!1;width=1;constructor(){this.color.value="#fff"}load(t){n.isNull(t)||(n.loadProperty(this,"id",t.id),n.loadProperty(this,"blink",t.blink),this.color=n.OptionsColor.create(this.color,t.color),n.loadProperty(this,"consent",t.consent),n.loadProperty(this,"distance",t.distance),n.loadProperty(this,"enable",t.enable),n.loadProperty(this,"frequency",t.frequency),n.loadProperty(this,"opacity",t.opacity),this.shadow.load(t.shadow),this.triangles.load(t.triangles),n.loadProperty(this,"width",t.width),n.loadProperty(this,"warp",t.warp))}}function l(t,s,e){const{dx:i,dy:a}=n.getDistances(t,s),r={x:Math.abs(i),y:Math.abs(a)},l={x:Math.min(r.x,e.width-r.x),y:Math.min(r.y,e.height-r.y)};return Math.hypot(l.x,l.y)}class o extends s.ParticlesInteractorBase{#s;#n;constructor(t,s){super(s),this.#n=t,this.#s=0}get maxDistance(){return this.#s}clear(){}init(){this.container.particles.linksColor=void 0,this.container.particles.linksColors=new Map}interact(t){if(!t.options.links)return;t.links=[],t.linksDistance&&t.linksDistance>this.#s&&(this.#s=t.linksDistance);const s=t.getPosition(),i=this.container,a=i.canvas.size;if(s.x<n.originPoint.x||s.y<n.originPoint.y||s.x>a.width||s.y>a.height)return;const r=t.options.links,o=r.opacity,c=t.retina.linksDistance??0,h=r.warp,p=h?new e(s.x,s.y,c,a):new n.Circle(s.x,s.y,c),_=i.particles.grid.query(p);for(const e of _){const i=e.options.links;if(t===e||!i?.enable||r.id!==i.id||e.spawning||e.destroyed||!e.links||t.links.some(t=>t.destination===e)||e.links.some(s=>s.destination===t))continue;const p=e.getPosition();if(p.x<n.originPoint.x||p.y<n.originPoint.y||p.x>a.width||p.y>a.height)continue;const _=n.getDistances(s,p).distance,d=h&&i.warp?l(s,p,a):_,u=Math.min(_,d);if(u>c)continue;const g=(1-u/c)*o;this.#e(t),t.links.push({destination:e,opacity:g,color:this.#i(t,e),isWarped:d<_})}}isEnabled(t){return!!t.options.links?.enable}loadParticlesOptions(t,...s){n.loadOptionProperty(t,"links",r,...s)}reset(){}#i(t,s){const e=this.container,i=t.options.links;if(!i)return;const a=void 0!==i.id?e.particles.linksColors.get(i.id):e.particles.linksColor;return n.getLinkColor(t,s,a,e.hdr)}#e(t){if(!t.options.links)return;const s=this.container,e=t.options.links;let i=void 0===e.id?s.particles.linksColor:s.particles.linksColors.get(e.id);i||(i=n.getLinkRandomColor(this.#n,e.color,e.blink,e.consent),void 0===e.id?s.particles.linksColor=i:s.particles.linksColors.set(e.id,i))}}class c{id="links";#n;constructor(t){this.#n=t}async getPlugin(t){const{LinkInstance:s}=await Promise.resolve().then(function(){return d});return new s(this.#n,t)}loadOptions(){}needsPlugin(){return!0}}async function h(t){t.checkVersion("4.5.0"),await t.pluginManager.register(t=>{const n=t.pluginManager;s.ensureInteractivityPluginLoaded(t),n.addPlugin(new c(n)),n.addInteractor?.("particlesLinks",t=>Promise.resolve(new o(n,t)))})}const p=globalThis;function _(t,s){const e=(i=t.map(t=>t.id),[...i].sort((t,s)=>t-s).join("_"));var i;let a=s.get(e);return void 0===a&&(a=n.getRandom(),s.set(e,a)),a}p.__tsParticlesInternals=p.__tsParticlesInternals??{},p.loadParticlesLinksInteraction=h;var d=Object.freeze({__proto__:null,LinkInstance:class{#a=new Map;#r;#l;#n;constructor(t,s){this.#n=t,this.#r=s,this.#l={links:new Map,triangles:new Map}}drawParticle(t,s){const{links:e,options:i}=s;if(!e?.length||!i.links)return;const a=i.links,r=s.retina.linksWidth??0,l=s.getPosition(),o=s.options.twinkle?.links,c=a.triangles.enable,h=c?new Set(e.map(t=>t.destination.id)):null,p=t.globalAlpha;let _="",d=-1,u=-1,g=!1;const P=()=>{g&&(t.stroke(),g=!1)};for(const p of e){if(a.frequency<1&&this.#o(s,p.destination)>a.frequency)continue;const e=p.destination.getPosition();if(c&&!p.isWarped&&h&&(P(),this.#c(i,s,p,h,l,e,t)),p.opacity<=0||r<=0)continue;if(!a.enable)continue;let y=p.opacity,f=p.color;const I=o?.enable&&n.getRandom()<o.frequency?n.rangeColorToRgb(this.#n,o.color):void 0;if(o&&I&&(f=I,y=n.getRangeValue(o.opacity)),!f){const t=void 0!==a.id?this.#r.particles.linksColors.get(a.id):this.#r.particles.linksColor;f=n.getLinkColor(s,p.destination,t)}if(!f)continue;const k=this.#h(f);if(k===_&&r===d&&y===u||(P(),t.strokeStyle=k,t.lineWidth=r,t.globalAlpha=y,_=k,d=r,u=y,t.beginPath(),g=!0),p.isWarped){const s=this.#r.canvas.size,i=e.x-l.x,a=e.y-l.y;let r=n.originPoint.x,o=n.originPoint.y;Math.abs(i)>s.width*n.half&&(r=i>0?-s.width:s.width),Math.abs(a)>s.height*n.half&&(o=a>0?-s.height:s.height),t.moveTo(l.x,l.y),t.lineTo(e.x+r,e.y+o),t.moveTo(l.x-r,l.y-o),t.lineTo(e.x,e.y)}else t.moveTo(l.x,l.y),t.lineTo(e.x,e.y)}P(),t.globalAlpha=p}init(){return this.#l.links.clear(),this.#l.triangles.clear(),this.#a.clear(),Promise.resolve()}particleCreated(t){if(t.links=[],!t.options.links)return;t.linksDistance=t.options.links.distance,t.linksWidth=t.options.links.width;const s=this.#r.retina.pixelRatio;t.retina.linksDistance=t.linksDistance*s,t.retina.linksWidth=t.linksWidth*s}particleDestroyed(t){t.links=[]}#c(t,s,e,i,a,r,l){const o=e.destination,c=t.links?.triangles;if(!c?.enable||!o.options.links?.triangles.enable)return;const h=o.links;if(h?.length)for(const p of h){if(p.isWarped||this.#o(o,p.destination)>o.options.links.frequency||!i.has(p.destination.id))continue;const h=p.destination;if(this.#p(s,o,h)>(t.links?.triangles.frequency??0))continue;const _=c.opacity??(e.opacity+p.opacity)*n.half,d=n.rangeColorToRgb(this.#n,c.color)??e.color;if(!d||_<=0)continue;const u=h.getPosition();l.save(),l.fillStyle=this.#h(d),l.globalAlpha=_,l.beginPath(),l.moveTo(a.x,a.y),l.lineTo(r.x,r.y),l.lineTo(u.x,u.y),l.closePath(),l.fill(),l.restore()}}#h(t){const s=`${t.r},${t.g},${t.b}-${this.#r.hdr}-${this.#r.peakNits}-${this.#r.hdrMode}`;let e=this.#a.get(s);return e||(e=n.getStyleFromRgb(t,this.#r.hdr,void 0,this.#r.peakNits,this.#r.hdrMode),this.#a.set(s,e)),e}#o(t,s){return _([t,s],this.#l.links)}#p(t,s,n){return _([t,s,n],this.#l.triangles)}}});t.Links=r,t.LinksShadow=i,t.LinksTriangle=a,t.loadParticlesLinksInteraction=h}(t.__tsParticlesInternals.interactions.particlesLinks=t.__tsParticlesInternals.interactions.particlesLinks||{},t.__tsParticlesInternals.plugins.interactivity,t.__tsParticlesInternals.engine)}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:self),Object.assign(globalThis.window||globalThis,{loadParticlesLinksInteraction:(globalThis.__tsParticlesInternals.interactions.particlesLinks||{}).loadParticlesLinksInteraction});
1
+ !function(t){t.__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.bundles=t.__tsParticlesInternals.bundles||{},t.__tsParticlesInternals.effects=t.__tsParticlesInternals.effects||{},t.__tsParticlesInternals.engine=t.__tsParticlesInternals.engine||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},t.__tsParticlesInternals.palettes=t.__tsParticlesInternals.palettes||{},t.__tsParticlesInternals.paths=t.__tsParticlesInternals.paths||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins.emittersShapes=t.__tsParticlesInternals.plugins.emittersShapes||{},t.__tsParticlesInternals.presets=t.__tsParticlesInternals.presets||{},t.__tsParticlesInternals.shapes=t.__tsParticlesInternals.shapes||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.utils=t.__tsParticlesInternals.utils||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas.utils=t.__tsParticlesInternals.canvas.utils||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path.utils=t.__tsParticlesInternals.path.utils||{};var s="undefined"!=typeof Proxy?function(t){return new Proxy(t,{get:function(t,s){return s in t||(t[s]={}),t[s]}})}:function(t){return t};t.__tsParticlesInternals.bundles=s(t.__tsParticlesInternals.bundles),t.__tsParticlesInternals.effects=s(t.__tsParticlesInternals.effects),t.__tsParticlesInternals.interactions=s(t.__tsParticlesInternals.interactions),t.__tsParticlesInternals.palettes=s(t.__tsParticlesInternals.palettes),t.__tsParticlesInternals.paths=s(t.__tsParticlesInternals.paths),t.__tsParticlesInternals.plugins=s(t.__tsParticlesInternals.plugins),t.__tsParticlesInternals.plugins.emittersShapes=s(t.__tsParticlesInternals.plugins.emittersShapes),t.__tsParticlesInternals.presets=s(t.__tsParticlesInternals.presets),t.__tsParticlesInternals.shapes=s(t.__tsParticlesInternals.shapes),t.__tsParticlesInternals.updaters=s(t.__tsParticlesInternals.updaters),t.__tsParticlesInternals.utils=s(t.__tsParticlesInternals.utils),t.__tsParticlesInternals.canvas=s(t.__tsParticlesInternals.canvas),t.__tsParticlesInternals.path=s(t.__tsParticlesInternals.path)}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(t){t.__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},function(t,s,n){"use strict";class e extends n.Circle{#t;constructor(t,s,n,e){super(t,s,n),this.#t=e}contains(t){if(super.contains(t))return!0;const{width:s,height:n}=this.#t,{x:e,y:i}=t;return super.contains({x:e-s,y:i})||super.contains({x:e+s,y:i})||super.contains({x:e,y:i-n})||super.contains({x:e,y:i+n})||super.contains({x:e-s,y:i-n})||super.contains({x:e+s,y:i+n})||super.contains({x:e-s,y:i+n})||super.contains({x:e+s,y:i-n})}intersects(t){if(super.intersects(t))return!0;const{width:s,height:e}=this.#t,i=t.position,r=[{x:-s,y:0},{x:s,y:0},{x:0,y:-e},{x:0,y:e},{x:-s,y:-e},{x:s,y:e},{x:-s,y:e},{x:s,y:-e}];for(const s of r){const e={x:i.x+s.x,y:i.y+s.y};let r;if(t instanceof n.Circle)r=new n.Circle(e.x,e.y,t.radius);else{const s=t;r=new n.Rectangle(e.x,e.y,s.size.width,s.size.height)}if(super.intersects(r))return!0}return!1}query(t){const{x:s,y:e}=this.position,{width:i,height:r}=this.#t,a=this.radius,l=s-a<=n.originPoint.x,o=s+a>=i,c=e-a<=n.originPoint.y,h=e+a>=r;if(!(l||o||c||h))return t.query(this);const p=[n.originPoint.x],_=[n.originPoint.y];l&&p.push(i),o&&p.push(-i),c&&_.push(r),h&&_.push(-r);const u=new Set;for(const n of p)for(const i of _)for(const r of t.queryCircle({x:s+n,y:e+i},a))u.add(r);return[...u]}}class i{blur=5;color=new n.OptionsColor;enable=!1;constructor(){this.color.value="#000"}load(t){n.isNull(t)||(n.loadProperty(this,"blur",t.blur),this.color=n.OptionsColor.create(this.color,t.color),n.loadProperty(this,"enable",t.enable))}}class r{color;enable=!1;frequency=1;opacity;load(t){n.isNull(t)||(void 0!==t.color&&(this.color=n.OptionsColor.create(this.color,t.color)),n.loadProperty(this,"enable",t.enable),n.loadProperty(this,"frequency",t.frequency),n.loadProperty(this,"opacity",t.opacity))}}class a{blink=!1;color=new n.OptionsColor;consent=!1;distance=100;enable=!1;frequency=1;id;opacity=1;shadow=new i;triangles=new r;warp=!1;width=1;constructor(){this.color.value="#fff"}load(t){n.isNull(t)||(n.loadProperty(this,"id",t.id),n.loadProperty(this,"blink",t.blink),this.color=n.OptionsColor.create(this.color,t.color),n.loadProperty(this,"consent",t.consent),n.loadProperty(this,"distance",t.distance),n.loadProperty(this,"enable",t.enable),n.loadProperty(this,"frequency",t.frequency),n.loadProperty(this,"opacity",t.opacity),this.shadow.load(t.shadow),this.triangles.load(t.triangles),n.loadProperty(this,"width",t.width),n.loadProperty(this,"warp",t.warp))}}function l(t,s,e){const{dx:i,dy:r}=n.getDistances(t,s),a={x:Math.abs(i),y:Math.abs(r)},l={x:Math.min(a.x,e.width-a.x),y:Math.min(a.y,e.height-a.y)};return Math.hypot(l.x,l.y)}class o extends s.ParticlesInteractorBase{#s;#n;constructor(t,s){super(s),this.#n=t,this.#s=0}get maxDistance(){return this.#s}clear(){}init(){this.container.particles.linksColor=void 0,this.container.particles.linksColors=new Map}interact(t){if(!t.options.links)return;t.links=[],t.linksDistance&&t.linksDistance>this.#s&&(this.#s=t.linksDistance);const s=t.getPosition(),i=this.container,r=i.canvas.size;if(s.x<n.originPoint.x||s.y<n.originPoint.y||s.x>r.width||s.y>r.height)return;const a=t.options.links,o=a.opacity,c=t.retina.linksDistance??0,h=a.warp,p=h?new e(s.x,s.y,c,r).query(i.particles.grid):i.particles.grid.queryCircle(s,c);for(const e of p){const i=e.options.links;if(t===e||!i?.enable||a.id!==i.id||e.spawning||e.destroyed||!e.links||t.links.some(t=>t.destination===e)||e.links.some(s=>s.destination===t))continue;const p=e.getPosition();if(p.x<n.originPoint.x||p.y<n.originPoint.y||p.x>r.width||p.y>r.height)continue;const _=n.getDistances(s,p).distance,u=h&&i.warp?l(s,p,r):_,d=Math.min(_,u);if(d>c)continue;const g=(1-d/c)*o;this.#e(t),t.links.push({destination:e,opacity:g,color:this.#i(t,e),isWarped:u<_})}}isEnabled(t){return!!t.options.links?.enable}loadParticlesOptions(t,...s){n.loadOptionProperty(t,"links",a,...s)}reset(){}#i(t,s){const e=this.container,i=t.options.links;if(!i)return;const r=void 0!==i.id?e.particles.linksColors.get(i.id):e.particles.linksColor;return n.getLinkColor(t,s,r,e.hdr)}#e(t){if(!t.options.links)return;const s=this.container,e=t.options.links;let i=void 0===e.id?s.particles.linksColor:s.particles.linksColors.get(e.id);i||(i=n.getLinkRandomColor(this.#n,e.color,e.blink,e.consent),void 0===e.id?s.particles.linksColor=i:s.particles.linksColors.set(e.id,i))}}class c{id="links";#n;constructor(t){this.#n=t}async getPlugin(t){const{LinkInstance:s}=await Promise.resolve().then(function(){return u});return new s(this.#n,t)}loadOptions(){}needsPlugin(){return!0}}async function h(t){t.checkVersion("4.5.1"),await t.pluginManager.register(t=>{const n=t.pluginManager;s.ensureInteractivityPluginLoaded(t),n.addPlugin(new c(n)),n.addInteractor?.("particlesLinks",t=>Promise.resolve(new o(n,t)))})}const p=globalThis;function _(t,s){const e=(i=t.map(t=>t.id),[...i].sort((t,s)=>t-s).join("_"));var i;let r=s.get(e);return void 0===r&&(r=n.getRandom(),s.set(e,r)),r}p.__tsParticlesInternals=p.__tsParticlesInternals??{},p.loadParticlesLinksInteraction=h;var u=Object.freeze({__proto__:null,LinkInstance:class{#r=new Map;#a;#l;#n;constructor(t,s){this.#n=t,this.#a=s,this.#l={links:new Map,triangles:new Map}}drawParticle(t,s){const{links:e,options:i}=s;if(!e?.length||!i.links)return;const r=i.links,a=s.retina.linksWidth??0,l=s.getPosition(),o=s.options.twinkle?.links,c=r.triangles.enable,h=c?new Set(e.map(t=>t.destination.id)):null,p=t.globalAlpha;let _="",u=-1,d=-1,g=!1;const P=()=>{g&&(t.stroke(),g=!1)};for(const p of e){if(r.frequency<1&&this.#o(s,p.destination)>r.frequency)continue;const e=p.destination.getPosition();if(c&&!p.isWarped&&h&&(P(),this.#c(i,s,p,h,l,e,t)),p.opacity<=0||a<=0)continue;if(!r.enable)continue;let y=p.opacity,f=p.color;const I=o?.enable&&n.getRandom()<o.frequency?n.rangeColorToRgb(this.#n,o.color):void 0;if(o&&I&&(f=I,y=n.getRangeValue(o.opacity)),!f){const t=void 0!==r.id?this.#a.particles.linksColors.get(r.id):this.#a.particles.linksColor;f=n.getLinkColor(s,p.destination,t)}if(!f)continue;const k=this.#h(f);if(k===_&&a===u&&y===d||(P(),t.strokeStyle=k,t.lineWidth=a,t.globalAlpha=y,_=k,u=a,d=y,t.beginPath(),g=!0),p.isWarped){const s=this.#a.canvas.size,i=e.x-l.x,r=e.y-l.y;let a=n.originPoint.x,o=n.originPoint.y;Math.abs(i)>s.width*n.half&&(a=i>0?-s.width:s.width),Math.abs(r)>s.height*n.half&&(o=r>0?-s.height:s.height),t.moveTo(l.x,l.y),t.lineTo(e.x+a,e.y+o),t.moveTo(l.x-a,l.y-o),t.lineTo(e.x,e.y)}else t.moveTo(l.x,l.y),t.lineTo(e.x,e.y)}P(),t.globalAlpha=p}init(){return this.#l.links.clear(),this.#l.triangles.clear(),this.#r.clear(),Promise.resolve()}particleCreated(t){if(t.links=[],!t.options.links)return;t.linksDistance=t.options.links.distance,t.linksWidth=t.options.links.width;const s=this.#a.retina.pixelRatio;t.retina.linksDistance=t.linksDistance*s,t.retina.linksWidth=t.linksWidth*s}particleDestroyed(t){t.links=[]}#c(t,s,e,i,r,a,l){const o=e.destination,c=t.links?.triangles;if(!c?.enable||!o.options.links?.triangles.enable)return;const h=o.links;if(h?.length)for(const p of h){if(p.isWarped||this.#o(o,p.destination)>o.options.links.frequency||!i.has(p.destination.id))continue;const h=p.destination;if(this.#p(s,o,h)>(t.links?.triangles.frequency??0))continue;const _=c.opacity??(e.opacity+p.opacity)*n.half,u=n.rangeColorToRgb(this.#n,c.color)??e.color;if(!u||_<=0)continue;const d=h.getPosition();l.save(),l.fillStyle=this.#h(u),l.globalAlpha=_,l.beginPath(),l.moveTo(r.x,r.y),l.lineTo(a.x,a.y),l.lineTo(d.x,d.y),l.closePath(),l.fill(),l.restore()}}#h(t){const s=`${t.r},${t.g},${t.b}-${this.#a.hdr}-${this.#a.peakNits}-${this.#a.hdrMode}`;let e=this.#r.get(s);return e||(e=n.getStyleFromRgb(t,this.#a.hdr,void 0,this.#a.peakNits,this.#a.hdrMode),this.#r.set(s,e)),e}#o(t,s){return _([t,s],this.#l.links)}#p(t,s,n){return _([t,s,n],this.#l.triangles)}}});t.Links=a,t.LinksShadow=i,t.LinksTriangle=r,t.loadParticlesLinksInteraction=h}(t.__tsParticlesInternals.interactions.particlesLinks=t.__tsParticlesInternals.interactions.particlesLinks||{},t.__tsParticlesInternals.plugins.interactivity,t.__tsParticlesInternals.engine)}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:self),Object.assign(globalThis.window||globalThis,{loadParticlesLinksInteraction:(globalThis.__tsParticlesInternals.interactions.particlesLinks||{}).loadParticlesLinksInteraction});
@@ -1,7 +1,8 @@
1
- import { Circle, type ICoordinates, type IDimension, Rectangle } from "@tsparticles/engine";
1
+ import { Circle, type ICoordinates, type IDimension, type Particle, Rectangle, type SpatialHashGrid } from "@tsparticles/engine";
2
2
  export declare class CircleWarp extends Circle {
3
3
  #private;
4
4
  constructor(x: number, y: number, radius: number, canvasSize: IDimension);
5
5
  contains(point: ICoordinates): boolean;
6
6
  intersects(range: Rectangle | Circle): boolean;
7
+ query(grid: SpatialHashGrid): Particle[];
7
8
  }