tsparticles 2.4.0 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,7 +4,7 @@
4
4
  * Demo / Generator : https://particles.js.org/
5
5
  * GitHub : https://www.github.com/matteobruni/tsparticles
6
6
  * How to use? : Check the GitHub README
7
- * v2.4.0
7
+ * v2.5.0
8
8
  */
9
9
  (function webpackUniversalModuleDefinition(root, factory) {
10
10
  if(typeof exports === 'object' && typeof module === 'object')
@@ -209,19 +209,20 @@ __webpack_require__.d(__webpack_exports__, {
209
209
 
210
210
  ;// CONCATENATED MODULE: ../../engine/dist/esm/Utils/EventDispatcher.js
211
211
  class EventDispatcher {
212
- _listeners;
213
212
  constructor() {
214
213
  this._listeners = new Map();
215
214
  }
216
215
  addEventListener(type, listener) {
216
+ var _a;
217
217
  this.removeEventListener(type, listener);
218
218
  if (!this._listeners.get(type)) {
219
219
  this._listeners.set(type, []);
220
220
  }
221
- this._listeners.get(type)?.push(listener);
221
+ (_a = this._listeners.get(type)) === null || _a === void 0 ? void 0 : _a.push(listener);
222
222
  }
223
223
  dispatchEvent(type, args) {
224
- this._listeners.get(type)?.forEach(handler => handler(args));
224
+ var _a;
225
+ (_a = this._listeners.get(type)) === null || _a === void 0 ? void 0 : _a.forEach(handler => handler(args));
225
226
  }
226
227
  hasEventListener(type) {
227
228
  return !!this._listeners.get(type);
@@ -252,9 +253,6 @@ class EventDispatcher {
252
253
  }
253
254
  ;// CONCATENATED MODULE: ../../engine/dist/esm/Core/Utils/Vector3d.js
254
255
  class Vector3d {
255
- x;
256
- y;
257
- z;
258
256
  constructor(xOrCoords, y, z) {
259
257
  if (typeof xOrCoords !== "number" && xOrCoords) {
260
258
  this.x = xOrCoords.x;
@@ -264,7 +262,7 @@ class Vector3d {
264
262
  } else if (xOrCoords !== undefined && y !== undefined) {
265
263
  this.x = xOrCoords;
266
264
  this.y = y;
267
- this.z = z ?? 0;
265
+ this.z = z !== null && z !== void 0 ? z : 0;
268
266
  } else {
269
267
  throw new Error("tsParticles - Vector3d not initialized correctly");
270
268
  }
@@ -374,8 +372,9 @@ function addEasing(name, easing) {
374
372
  }
375
373
  }
376
374
  function getEasing(name) {
375
+ var _a;
377
376
  const noEasing = value => value;
378
- return easings.get(name) ?? noEasing;
377
+ return (_a = easings.get(name)) !== null && _a !== void 0 ? _a : noEasing;
379
378
  }
380
379
  function setRandom(rnd = Math.random) {
381
380
  _random = rnd;
@@ -486,15 +485,17 @@ function calcPositionFromSize(data) {
486
485
  } : undefined;
487
486
  }
488
487
  function calcPositionOrRandomFromSize(data) {
488
+ var _a, _b, _c, _d;
489
489
  return {
490
- x: (data.position?.x ?? getRandom() * 100) * data.size.width / 100,
491
- y: (data.position?.y ?? getRandom() * 100) * data.size.height / 100
490
+ x: ((_b = (_a = data.position) === null || _a === void 0 ? void 0 : _a.x) !== null && _b !== void 0 ? _b : getRandom() * 100) * data.size.width / 100,
491
+ y: ((_d = (_c = data.position) === null || _c === void 0 ? void 0 : _c.y) !== null && _d !== void 0 ? _d : getRandom() * 100) * data.size.height / 100
492
492
  };
493
493
  }
494
494
  function calcPositionOrRandomFromSizeRanged(data) {
495
+ var _a, _b;
495
496
  const position = {
496
- x: data.position?.x !== undefined ? getRangeValue(data.position.x) : undefined,
497
- y: data.position?.y !== undefined ? getRangeValue(data.position.y) : undefined
497
+ x: ((_a = data.position) === null || _a === void 0 ? void 0 : _a.x) !== undefined ? getRangeValue(data.position.x) : undefined,
498
+ y: ((_b = data.position) === null || _b === void 0 ? void 0 : _b.y) !== undefined ? getRangeValue(data.position.y) : undefined
498
499
  };
499
500
  return calcPositionOrRandomFromSize({
500
501
  size: data.size,
@@ -502,15 +503,17 @@ function calcPositionOrRandomFromSizeRanged(data) {
502
503
  });
503
504
  }
504
505
  function calcExactPositionOrRandomFromSize(data) {
506
+ var _a, _b, _c, _d;
505
507
  return {
506
- x: data.position?.x ?? getRandom() * data.size.width,
507
- y: data.position?.y ?? getRandom() * data.size.height
508
+ x: (_b = (_a = data.position) === null || _a === void 0 ? void 0 : _a.x) !== null && _b !== void 0 ? _b : getRandom() * data.size.width,
509
+ y: (_d = (_c = data.position) === null || _c === void 0 ? void 0 : _c.y) !== null && _d !== void 0 ? _d : getRandom() * data.size.height
508
510
  };
509
511
  }
510
512
  function calcExactPositionOrRandomFromSizeRanged(data) {
513
+ var _a, _b;
511
514
  const position = {
512
- x: data.position?.x !== undefined ? getRangeValue(data.position.x) : undefined,
513
- y: data.position?.y !== undefined ? getRangeValue(data.position.y) : undefined
515
+ x: ((_a = data.position) === null || _a === void 0 ? void 0 : _a.x) !== undefined ? getRangeValue(data.position.x) : undefined,
516
+ y: ((_b = data.position) === null || _b === void 0 ? void 0 : _b.y) !== undefined ? getRangeValue(data.position.y) : undefined
514
517
  };
515
518
  return calcExactPositionOrRandomFromSize({
516
519
  size: data.size,
@@ -565,8 +568,8 @@ function isInArray(value, array) {
565
568
  }
566
569
  async function loadFont(font, weight) {
567
570
  try {
568
- await document.fonts.load(`${weight ?? "400"} 36px '${font ?? "Verdana"}'`);
569
- } catch {}
571
+ await document.fonts.load(`${weight !== null && weight !== void 0 ? weight : "400"} 36px '${font !== null && font !== void 0 ? font : "Verdana"}'`);
572
+ } catch (_a) {}
570
573
  }
571
574
  function arrayRandomIndex(array) {
572
575
  return Math.floor(getRandom() * array.length);
@@ -575,7 +578,7 @@ function itemFromArray(array, index, useIndex = true) {
575
578
  return array[index !== undefined && useIndex ? index % array.length : arrayRandomIndex(array)];
576
579
  }
577
580
  function isPointInside(point, size, offset, radius, direction) {
578
- return areBoundsInside(calculateBounds(point, radius ?? 0), size, offset, direction);
581
+ return areBoundsInside(calculateBounds(point, radius !== null && radius !== void 0 ? radius : 0), size, offset, direction);
579
582
  }
580
583
  function areBoundsInside(bounds, size, offset, direction) {
581
584
  let inside = true;
@@ -872,7 +875,8 @@ function rgbToHsl(color) {
872
875
  return res;
873
876
  }
874
877
  function stringToAlpha(input) {
875
- return stringToRgba(input)?.a;
878
+ var _a;
879
+ return (_a = stringToRgba(input)) === null || _a === void 0 ? void 0 : _a.a;
876
880
  }
877
881
  function stringToRgb(input) {
878
882
  return stringToRgba(input);
@@ -914,7 +918,7 @@ function hslaToRgba(hsla) {
914
918
  };
915
919
  }
916
920
  function getRandomRgbColor(min) {
917
- const fixedMin = min ?? 0;
921
+ const fixedMin = min !== null && min !== void 0 ? min : 0;
918
922
  return {
919
923
  b: Math.floor(randomInRange(setRangeValue(fixedMin, 256))),
920
924
  g: Math.floor(randomInRange(setRangeValue(fixedMin, 256))),
@@ -922,10 +926,10 @@ function getRandomRgbColor(min) {
922
926
  };
923
927
  }
924
928
  function getStyleFromRgb(color, opacity) {
925
- return `rgba(${color.r}, ${color.g}, ${color.b}, ${opacity ?? 1})`;
929
+ return `rgba(${color.r}, ${color.g}, ${color.b}, ${opacity !== null && opacity !== void 0 ? opacity : 1})`;
926
930
  }
927
931
  function getStyleFromHsl(color, opacity) {
928
- return `hsla(${color.h}, ${color.s}%, ${color.l}%, ${opacity ?? 1})`;
932
+ return `hsla(${color.h}, ${color.s}%, ${color.l}%, ${opacity !== null && opacity !== void 0 ? opacity : 1})`;
929
933
  }
930
934
  function colorMix(color1, color2, size1, size2) {
931
935
  let rgb1 = color1,
@@ -943,15 +947,16 @@ function colorMix(color1, color2, size1, size2) {
943
947
  };
944
948
  }
945
949
  function getLinkColor(p1, p2, linkColor) {
950
+ var _a, _b;
946
951
  if (linkColor === randomColorValue) {
947
952
  return getRandomRgbColor();
948
953
  } else if (linkColor === midColorValue) {
949
- const sourceColor = p1.getFillColor() ?? p1.getStrokeColor(),
950
- destColor = p2?.getFillColor() ?? p2?.getStrokeColor();
954
+ const sourceColor = (_a = p1.getFillColor()) !== null && _a !== void 0 ? _a : p1.getStrokeColor(),
955
+ 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();
951
956
  if (sourceColor && destColor && p2) {
952
957
  return colorMix(sourceColor, destColor, p1.getRadius(), p2.getRadius());
953
958
  } else {
954
- const hslColor = sourceColor ?? destColor;
959
+ const hslColor = sourceColor !== null && sourceColor !== void 0 ? sourceColor : destColor;
955
960
  if (hslColor) {
956
961
  return hslToRgb(hslColor);
957
962
  }
@@ -1039,13 +1044,14 @@ function drawTriangle(context, p1, p2, p3) {
1039
1044
  context.closePath();
1040
1045
  }
1041
1046
  function paintBase(context, dimension, baseColor) {
1042
- context.fillStyle = baseColor ?? "rgba(0,0,0,0)";
1047
+ context.fillStyle = baseColor !== null && baseColor !== void 0 ? baseColor : "rgba(0,0,0,0)";
1043
1048
  context.fillRect(0, 0, dimension.width, dimension.height);
1044
1049
  }
1045
1050
  function clear(context, dimension) {
1046
1051
  context.clearRect(0, 0, dimension.width, dimension.height);
1047
1052
  }
1048
1053
  function drawParticle(data) {
1054
+ var _a, _b, _c, _d, _e, _f;
1049
1055
  const {
1050
1056
  container,
1051
1057
  context,
@@ -1066,10 +1072,10 @@ function drawParticle(data) {
1066
1072
  cos: Math.cos(angle)
1067
1073
  },
1068
1074
  transformData = {
1069
- a: rotateData.cos * (transform.a ?? 1),
1070
- b: rotateData.sin * (transform.b ?? 1),
1071
- c: -rotateData.sin * (transform.c ?? 1),
1072
- d: rotateData.cos * (transform.d ?? 1)
1075
+ a: rotateData.cos * ((_a = transform.a) !== null && _a !== void 0 ? _a : 1),
1076
+ b: rotateData.sin * ((_b = transform.b) !== null && _b !== void 0 ? _b : 1),
1077
+ c: -rotateData.sin * ((_c = transform.c) !== null && _c !== void 0 ? _c : 1),
1078
+ d: rotateData.cos * ((_d = transform.d) !== null && _d !== void 0 ? _d : 1)
1073
1079
  };
1074
1080
  context.setTransform(transformData.a, transformData.b, transformData.c, transformData.d, pos.x, pos.y);
1075
1081
  context.beginPath();
@@ -1087,12 +1093,12 @@ function drawParticle(data) {
1087
1093
  context.fillStyle = colorStyles.fill;
1088
1094
  }
1089
1095
  const stroke = particle.stroke;
1090
- context.lineWidth = particle.strokeWidth ?? 0;
1096
+ context.lineWidth = (_e = particle.strokeWidth) !== null && _e !== void 0 ? _e : 0;
1091
1097
  if (colorStyles.stroke) {
1092
1098
  context.strokeStyle = colorStyles.stroke;
1093
1099
  }
1094
1100
  drawShape(container, context, particle, radius, opacity, delta);
1095
- if ((stroke?.width ?? 0) > 0) {
1101
+ if (((_f = stroke === null || stroke === void 0 ? void 0 : stroke.width) !== null && _f !== void 0 ? _f : 0) > 0) {
1096
1102
  context.stroke();
1097
1103
  }
1098
1104
  if (particle.close) {
@@ -1120,7 +1126,7 @@ function drawShapeAfterEffect(container, context, particle, radius, opacity, del
1120
1126
  return;
1121
1127
  }
1122
1128
  const drawer = container.drawers.get(particle.shape);
1123
- if (!drawer?.afterEffect) {
1129
+ if (!(drawer === null || drawer === void 0 ? void 0 : drawer.afterEffect)) {
1124
1130
  return;
1125
1131
  }
1126
1132
  drawer.afterEffect(context, particle, radius, opacity, delta, container.retina.pixelRatio);
@@ -1163,26 +1169,13 @@ const visibilityChangeEvent = "visibilitychange";
1163
1169
 
1164
1170
 
1165
1171
  function setTransformValue(factor, newFactor, key) {
1172
+ var _a;
1166
1173
  const newValue = newFactor[key];
1167
1174
  if (newValue !== undefined) {
1168
- factor[key] = (factor[key] ?? 1) * newValue;
1175
+ factor[key] = ((_a = factor[key]) !== null && _a !== void 0 ? _a : 1) * newValue;
1169
1176
  }
1170
1177
  }
1171
1178
  class Canvas {
1172
- container;
1173
- element;
1174
- resizeFactor;
1175
- size;
1176
- _colorPlugins;
1177
- _context;
1178
- _coverColorStyle;
1179
- _generated;
1180
- _mutationObserver;
1181
- _originalStyle;
1182
- _postDrawUpdaters;
1183
- _preDrawUpdaters;
1184
- _resizePlugins;
1185
- _trailFillColor;
1186
1179
  constructor(container) {
1187
1180
  this.container = container;
1188
1181
  this.size = {
@@ -1220,9 +1213,10 @@ class Canvas {
1220
1213
  }
1221
1214
  }
1222
1215
  destroy() {
1223
- this._mutationObserver?.disconnect();
1216
+ var _a, _b;
1217
+ (_a = this._mutationObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
1224
1218
  if (this._generated) {
1225
- this.element?.remove();
1219
+ (_b = this.element) === null || _b === void 0 ? void 0 : _b.remove();
1226
1220
  } else {
1227
1221
  this._resetOriginalStyle();
1228
1222
  }
@@ -1241,6 +1235,7 @@ class Canvas {
1241
1235
  return cb(this._context);
1242
1236
  }
1243
1237
  drawParticle(particle, delta) {
1238
+ var _a;
1244
1239
  if (particle.spawning || particle.destroyed) {
1245
1240
  return;
1246
1241
  }
@@ -1249,7 +1244,7 @@ class Canvas {
1249
1244
  return;
1250
1245
  }
1251
1246
  const pfColor = particle.getFillColor(),
1252
- psColor = particle.getStrokeColor() ?? pfColor;
1247
+ psColor = (_a = particle.getStrokeColor()) !== null && _a !== void 0 ? _a : pfColor;
1253
1248
  let [fColor, sColor] = this._getPluginParticleColors(particle);
1254
1249
  if (!fColor) {
1255
1250
  fColor = pfColor;
@@ -1261,11 +1256,12 @@ class Canvas {
1261
1256
  return;
1262
1257
  }
1263
1258
  this.draw(ctx => {
1259
+ var _a, _b, _c, _d, _e;
1264
1260
  const options = this.container.actualOptions,
1265
1261
  zIndexOptions = particle.options.zIndex,
1266
1262
  zOpacityFactor = (1 - particle.zIndexFactor) ** zIndexOptions.opacityRate,
1267
- opacity = particle.bubble.opacity ?? particle.opacity?.value ?? 1,
1268
- strokeOpacity = particle.stroke?.opacity ?? opacity,
1263
+ opacity = (_c = (_a = particle.bubble.opacity) !== null && _a !== void 0 ? _a : (_b = particle.opacity) === null || _b === void 0 ? void 0 : _b.value) !== null && _c !== void 0 ? _c : 1,
1264
+ strokeOpacity = (_e = (_d = particle.stroke) === null || _d === void 0 ? void 0 : _d.opacity) !== null && _e !== void 0 ? _e : opacity,
1269
1265
  zOpacity = opacity * zOpacityFactor,
1270
1266
  zStrokeOpacity = strokeOpacity * zOpacityFactor,
1271
1267
  transform = {},
@@ -1301,13 +1297,14 @@ class Canvas {
1301
1297
  });
1302
1298
  }
1303
1299
  init() {
1300
+ var _a;
1304
1301
  this.resize();
1305
1302
  this._initStyle();
1306
1303
  this._initCover();
1307
1304
  this._initTrail();
1308
1305
  this.initBackground();
1309
1306
  if (this.element) {
1310
- this._mutationObserver?.observe(this.element, {
1307
+ (_a = this._mutationObserver) === null || _a === void 0 ? void 0 : _a.observe(this.element, {
1311
1308
  attributes: true
1312
1309
  });
1313
1310
  }
@@ -1319,7 +1316,7 @@ class Canvas {
1319
1316
  const options = this.container.actualOptions,
1320
1317
  background = options.background,
1321
1318
  element = this.element,
1322
- elementStyle = element?.style;
1319
+ elementStyle = element === null || element === void 0 ? void 0 : element.style;
1323
1320
  if (!elementStyle) {
1324
1321
  return;
1325
1322
  }
@@ -1358,8 +1355,9 @@ class Canvas {
1358
1355
  }
1359
1356
  }
1360
1357
  loadCanvas(canvas) {
1358
+ var _a, _b;
1361
1359
  if (this._generated) {
1362
- this.element?.remove();
1360
+ (_a = this.element) === null || _a === void 0 ? void 0 : _a.remove();
1363
1361
  }
1364
1362
  this._generated = canvas.dataset && generatedAttribute in canvas.dataset ? canvas.dataset[generatedAttribute] === "true" : this._generated;
1365
1363
  this.element = canvas;
@@ -1368,7 +1366,7 @@ class Canvas {
1368
1366
  this.size.height = canvas.offsetHeight;
1369
1367
  this.size.width = canvas.offsetWidth;
1370
1368
  this._context = this.element.getContext("2d");
1371
- this._mutationObserver?.observe(this.element, {
1369
+ (_b = this._mutationObserver) === null || _b === void 0 ? void 0 : _b.observe(this.element, {
1372
1370
  attributes: true
1373
1371
  });
1374
1372
  this.container.retina.init();
@@ -1399,9 +1397,7 @@ class Canvas {
1399
1397
  if (newSize.height === size.height && newSize.width === size.width && newSize.height === this.element.height && newSize.width === this.element.width) {
1400
1398
  return;
1401
1399
  }
1402
- const oldSize = {
1403
- ...size
1404
- };
1400
+ const oldSize = Object.assign({}, size);
1405
1401
  this.element.width = size.width = this.element.offsetWidth * pxRatio;
1406
1402
  this.element.height = size.height = this.element.offsetHeight * pxRatio;
1407
1403
  if (this.container.started) {
@@ -1425,11 +1421,13 @@ class Canvas {
1425
1421
  }
1426
1422
  }
1427
1423
  _applyPostDrawUpdaters(particle) {
1424
+ var _a;
1428
1425
  for (const updater of this._postDrawUpdaters) {
1429
- updater.afterDraw?.(particle);
1426
+ (_a = updater.afterDraw) === null || _a === void 0 ? void 0 : _a.call(updater, particle);
1430
1427
  }
1431
1428
  }
1432
1429
  _applyPreDrawUpdaters(ctx, particle, radius, zOpacity, colorStyles, transform) {
1430
+ var _a;
1433
1431
  for (const updater of this._preDrawUpdaters) {
1434
1432
  if (updater.getColorStyles) {
1435
1433
  const {
@@ -1449,7 +1447,7 @@ class Canvas {
1449
1447
  setTransformValue(transform, updaterTransform, key);
1450
1448
  }
1451
1449
  }
1452
- updater.beforeDraw?.(particle);
1450
+ (_a = updater.beforeDraw) === null || _a === void 0 ? void 0 : _a.call(updater, particle);
1453
1451
  }
1454
1452
  }
1455
1453
  _applyResizePlugins() {
@@ -1518,10 +1516,9 @@ class Canvas {
1518
1516
  fillColor = rangeColorToRgb(trail.fillColor);
1519
1517
  if (fillColor) {
1520
1518
  const trail = options.particles.move.trail;
1521
- this._trailFillColor = {
1522
- ...fillColor,
1519
+ this._trailFillColor = Object.assign(Object.assign({}, fillColor), {
1523
1520
  a: 1 / trail.length
1524
- };
1521
+ });
1525
1522
  }
1526
1523
  }
1527
1524
  _paintBase(baseColor) {
@@ -1530,14 +1527,15 @@ class Canvas {
1530
1527
  });
1531
1528
  }
1532
1529
  _repairStyle() {
1530
+ var _a, _b;
1533
1531
  const element = this.element;
1534
1532
  if (!element) {
1535
1533
  return;
1536
1534
  }
1537
- this._mutationObserver?.disconnect();
1535
+ (_a = this._mutationObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
1538
1536
  this._initStyle();
1539
1537
  this.initBackground();
1540
- this._mutationObserver?.observe(element, {
1538
+ (_b = this._mutationObserver) === null || _b === void 0 ? void 0 : _b.observe(element, {
1541
1539
  attributes: true
1542
1540
  });
1543
1541
  }
@@ -1588,23 +1586,6 @@ function manageListener(element, event, handler, add, options) {
1588
1586
  }
1589
1587
  }
1590
1588
  class EventListeners {
1591
- container;
1592
- canPush;
1593
- mouseDownHandler;
1594
- mouseLeaveHandler;
1595
- mouseMoveHandler;
1596
- mouseUpHandler;
1597
- oldThemeChangeHandler;
1598
- resizeHandler;
1599
- resizeObserver;
1600
- resizeTimeout;
1601
- themeChangeHandler;
1602
- touchCancelHandler;
1603
- touchEndClickHandler;
1604
- touchEndHandler;
1605
- touchMoveHandler;
1606
- touchStartHandler;
1607
- visibilityChangeHandler;
1608
1589
  constructor(container) {
1609
1590
  this.container = container;
1610
1591
  this.canPush = true;
@@ -1636,9 +1617,7 @@ class EventListeners {
1636
1617
  if (!mousePos) {
1637
1618
  return;
1638
1619
  }
1639
- container.interactivity.mouse.clickPosition = {
1640
- ...mousePos
1641
- };
1620
+ container.interactivity.mouse.clickPosition = Object.assign({}, mousePos);
1642
1621
  container.interactivity.mouse.clickTime = new Date().getTime();
1643
1622
  const onClick = options.interactivity.events.onClick;
1644
1623
  executeOnSingleOrMultiple(onClick.mode, mode => this.handleClickMode(mode));
@@ -1665,7 +1644,7 @@ class EventListeners {
1665
1644
  if (!options.pauseOnBlur) {
1666
1645
  return;
1667
1646
  }
1668
- if (document?.hidden) {
1647
+ if (document === null || document === void 0 ? void 0 : document.hidden) {
1669
1648
  container.pageHidden = true;
1670
1649
  container.pause();
1671
1650
  } else {
@@ -1682,9 +1661,13 @@ class EventListeners {
1682
1661
  clearTimeout(this.resizeTimeout);
1683
1662
  delete this.resizeTimeout;
1684
1663
  }
1685
- this.resizeTimeout = setTimeout(async () => this.container.canvas?.windowResize(), 500);
1664
+ this.resizeTimeout = setTimeout(async () => {
1665
+ var _a;
1666
+ return (_a = this.container.canvas) === null || _a === void 0 ? void 0 : _a.windowResize();
1667
+ }, 500);
1686
1668
  }
1687
1669
  manageListeners(add) {
1670
+ var _a;
1688
1671
  const container = this.container,
1689
1672
  options = container.actualOptions,
1690
1673
  detectType = options.interactivity.detectsOn;
@@ -1694,7 +1677,7 @@ class EventListeners {
1694
1677
  mouseLeaveTmpEvent = mouseOutEvent;
1695
1678
  } else if (detectType === "parent" && container.canvas.element) {
1696
1679
  const canvasEl = container.canvas.element;
1697
- container.interactivity.element = canvasEl.parentElement ?? canvasEl.parentNode;
1680
+ container.interactivity.element = (_a = canvasEl.parentElement) !== null && _a !== void 0 ? _a : canvasEl.parentNode;
1698
1681
  } else {
1699
1682
  container.interactivity.element = container.canvas.element;
1700
1683
  }
@@ -1804,9 +1787,10 @@ class EventListeners {
1804
1787
  mouse.clicking = false;
1805
1788
  }
1806
1789
  mouseTouchMove(e) {
1790
+ var _a, _b, _c, _d, _e, _f, _g;
1807
1791
  const container = this.container,
1808
1792
  options = container.actualOptions;
1809
- if (!container.interactivity?.element) {
1793
+ if (!((_a = container.interactivity) === null || _a === void 0 ? void 0 : _a.element)) {
1810
1794
  return;
1811
1795
  }
1812
1796
  container.interactivity.mouse.inside = true;
@@ -1837,24 +1821,24 @@ class EventListeners {
1837
1821
  };
1838
1822
  } else {
1839
1823
  pos = {
1840
- x: mouseEvent.offsetX ?? mouseEvent.clientX,
1841
- y: mouseEvent.offsetY ?? mouseEvent.clientY
1824
+ x: (_b = mouseEvent.offsetX) !== null && _b !== void 0 ? _b : mouseEvent.clientX,
1825
+ y: (_c = mouseEvent.offsetY) !== null && _c !== void 0 ? _c : mouseEvent.clientY
1842
1826
  };
1843
1827
  }
1844
1828
  } else if (mouseEvent.target === container.canvas.element) {
1845
1829
  pos = {
1846
- x: mouseEvent.offsetX ?? mouseEvent.clientX,
1847
- y: mouseEvent.offsetY ?? mouseEvent.clientY
1830
+ x: (_d = mouseEvent.offsetX) !== null && _d !== void 0 ? _d : mouseEvent.clientX,
1831
+ y: (_e = mouseEvent.offsetY) !== null && _e !== void 0 ? _e : mouseEvent.clientY
1848
1832
  };
1849
1833
  }
1850
1834
  } else {
1851
1835
  this.canPush = e.type !== "touchmove";
1852
1836
  const touchEvent = e,
1853
1837
  lastTouch = touchEvent.touches[touchEvent.touches.length - 1],
1854
- canvasRect = canvas?.getBoundingClientRect();
1838
+ canvasRect = canvas === null || canvas === void 0 ? void 0 : canvas.getBoundingClientRect();
1855
1839
  pos = {
1856
- x: lastTouch.clientX - (canvasRect?.left ?? 0),
1857
- y: lastTouch.clientY - (canvasRect?.top ?? 0)
1840
+ x: lastTouch.clientX - ((_f = canvasRect === null || canvasRect === void 0 ? void 0 : canvasRect.left) !== null && _f !== void 0 ? _f : 0),
1841
+ y: lastTouch.clientY - ((_g = canvasRect === null || canvasRect === void 0 ? void 0 : canvasRect.top) !== null && _g !== void 0 ? _g : 0)
1858
1842
  };
1859
1843
  }
1860
1844
  const pxRatio = container.retina.pixelRatio;
@@ -1874,18 +1858,18 @@ function initDelta(value, fpsLimit = 60, smooth = false) {
1874
1858
  };
1875
1859
  }
1876
1860
  class FrameManager {
1877
- container;
1878
1861
  constructor(container) {
1879
1862
  this.container = container;
1880
1863
  }
1881
1864
  async nextFrame(timestamp) {
1865
+ var _a;
1882
1866
  try {
1883
1867
  const container = this.container;
1884
1868
  if (!container.smooth && container.lastFrameTime !== undefined && timestamp < container.lastFrameTime + 1000 / container.fpsLimit) {
1885
1869
  container.draw(false);
1886
1870
  return;
1887
1871
  }
1888
- container.lastFrameTime ??= timestamp;
1872
+ (_a = container.lastFrameTime) !== null && _a !== void 0 ? _a : container.lastFrameTime = timestamp;
1889
1873
  const delta = initDelta(timestamp - container.lastFrameTime, container.fpsLimit, container.smooth);
1890
1874
  container.lifeTime += delta.value;
1891
1875
  container.lastFrameTime = timestamp;
@@ -1908,7 +1892,6 @@ class FrameManager {
1908
1892
  }
1909
1893
  ;// CONCATENATED MODULE: ../../engine/dist/esm/Options/Classes/OptionsColor.js
1910
1894
  class OptionsColor {
1911
- value;
1912
1895
  constructor() {
1913
1896
  this.value = "";
1914
1897
  }
@@ -1927,7 +1910,7 @@ class OptionsColor {
1927
1910
  return color;
1928
1911
  }
1929
1912
  load(data) {
1930
- if (data?.value === undefined) {
1913
+ if ((data === null || data === void 0 ? void 0 : data.value) === undefined) {
1931
1914
  return;
1932
1915
  }
1933
1916
  this.value = data.value;
@@ -1936,12 +1919,6 @@ class OptionsColor {
1936
1919
  ;// CONCATENATED MODULE: ../../engine/dist/esm/Options/Classes/Background/Background.js
1937
1920
 
1938
1921
  class Background {
1939
- color;
1940
- image;
1941
- opacity;
1942
- position;
1943
- repeat;
1944
- size;
1945
1922
  constructor() {
1946
1923
  this.color = new OptionsColor();
1947
1924
  this.color.value = "";
@@ -1978,8 +1955,6 @@ class Background {
1978
1955
  ;// CONCATENATED MODULE: ../../engine/dist/esm/Options/Classes/BackgroundMask/BackgroundMaskCover.js
1979
1956
 
1980
1957
  class BackgroundMaskCover {
1981
- color;
1982
- opacity;
1983
1958
  constructor() {
1984
1959
  this.color = new OptionsColor();
1985
1960
  this.color.value = "#fff";
@@ -2000,9 +1975,6 @@ class BackgroundMaskCover {
2000
1975
  ;// CONCATENATED MODULE: ../../engine/dist/esm/Options/Classes/BackgroundMask/BackgroundMask.js
2001
1976
 
2002
1977
  class BackgroundMask {
2003
- composite;
2004
- cover;
2005
- enable;
2006
1978
  constructor() {
2007
1979
  this.composite = "destination-out";
2008
1980
  this.cover = new BackgroundMaskCover();
@@ -2031,8 +2003,6 @@ class BackgroundMask {
2031
2003
  }
2032
2004
  ;// CONCATENATED MODULE: ../../engine/dist/esm/Options/Classes/FullScreen/FullScreen.js
2033
2005
  class FullScreen {
2034
- enable;
2035
- zIndex;
2036
2006
  constructor() {
2037
2007
  this.enable = true;
2038
2008
  this.zIndex = 0;
@@ -2051,8 +2021,6 @@ class FullScreen {
2051
2021
  }
2052
2022
  ;// CONCATENATED MODULE: ../../engine/dist/esm/Options/Classes/Interactivity/Events/ClickEvent.js
2053
2023
  class ClickEvent {
2054
- enable;
2055
- mode;
2056
2024
  constructor() {
2057
2025
  this.enable = false;
2058
2026
  this.mode = [];
@@ -2072,10 +2040,6 @@ class ClickEvent {
2072
2040
  ;// CONCATENATED MODULE: ../../engine/dist/esm/Options/Classes/Interactivity/Events/DivEvent.js
2073
2041
 
2074
2042
  class DivEvent {
2075
- enable;
2076
- mode;
2077
- selectors;
2078
- type;
2079
2043
  constructor() {
2080
2044
  this.selectors = [];
2081
2045
  this.enable = false;
@@ -2101,10 +2065,11 @@ class DivEvent {
2101
2065
  this.selectors = executeOnSingleOrMultiple(value, t => `#${t}`);
2102
2066
  }
2103
2067
  load(data) {
2068
+ var _a, _b;
2104
2069
  if (!data) {
2105
2070
  return;
2106
2071
  }
2107
- const ids = data.ids ?? data.elementId ?? data.el;
2072
+ const ids = (_b = (_a = data.ids) !== null && _a !== void 0 ? _a : data.elementId) !== null && _b !== void 0 ? _b : data.el;
2108
2073
  if (ids !== undefined) {
2109
2074
  this.ids = ids;
2110
2075
  }
@@ -2124,9 +2089,6 @@ class DivEvent {
2124
2089
  }
2125
2090
  ;// CONCATENATED MODULE: ../../engine/dist/esm/Options/Classes/Interactivity/Events/Parallax.js
2126
2091
  class Parallax {
2127
- enable;
2128
- force;
2129
- smooth;
2130
2092
  constructor() {
2131
2093
  this.enable = false;
2132
2094
  this.force = 2;
@@ -2150,9 +2112,6 @@ class Parallax {
2150
2112
  ;// CONCATENATED MODULE: ../../engine/dist/esm/Options/Classes/Interactivity/Events/HoverEvent.js
2151
2113
 
2152
2114
  class HoverEvent {
2153
- enable;
2154
- mode;
2155
- parallax;
2156
2115
  constructor() {
2157
2116
  this.enable = false;
2158
2117
  this.mode = [];
@@ -2177,10 +2136,6 @@ class HoverEvent {
2177
2136
 
2178
2137
 
2179
2138
  class Events {
2180
- onClick;
2181
- onDiv;
2182
- onHover;
2183
- resize;
2184
2139
  constructor() {
2185
2140
  this.onClick = new ClickEvent();
2186
2141
  this.onDiv = new DivEvent();
@@ -2206,11 +2161,12 @@ class Events {
2206
2161
  this.onHover = value;
2207
2162
  }
2208
2163
  load(data) {
2164
+ var _a, _b, _c;
2209
2165
  if (!data) {
2210
2166
  return;
2211
2167
  }
2212
- this.onClick.load(data.onClick ?? data.onclick);
2213
- const onDiv = data.onDiv ?? data.ondiv;
2168
+ this.onClick.load((_a = data.onClick) !== null && _a !== void 0 ? _a : data.onclick);
2169
+ const onDiv = (_b = data.onDiv) !== null && _b !== void 0 ? _b : data.ondiv;
2214
2170
  if (onDiv !== undefined) {
2215
2171
  this.onDiv = executeOnSingleOrMultiple(onDiv, t => {
2216
2172
  const tmp = new DivEvent();
@@ -2218,7 +2174,7 @@ class Events {
2218
2174
  return tmp;
2219
2175
  });
2220
2176
  }
2221
- this.onHover.load(data.onHover ?? data.onhover);
2177
+ this.onHover.load((_c = data.onHover) !== null && _c !== void 0 ? _c : data.onhover);
2222
2178
  if (data.resize !== undefined) {
2223
2179
  this.resize = data.resize;
2224
2180
  }
@@ -2226,8 +2182,6 @@ class Events {
2226
2182
  }
2227
2183
  ;// CONCATENATED MODULE: ../../engine/dist/esm/Options/Classes/Interactivity/Modes/Modes.js
2228
2184
  class Modes {
2229
- _container;
2230
- _engine;
2231
2185
  constructor(engine, container) {
2232
2186
  this._engine = engine;
2233
2187
  this._container = container;
@@ -2252,9 +2206,6 @@ class Modes {
2252
2206
 
2253
2207
 
2254
2208
  class Interactivity {
2255
- detectsOn;
2256
- events;
2257
- modes;
2258
2209
  constructor(engine, container) {
2259
2210
  this.detectsOn = "window";
2260
2211
  this.events = new Events();
@@ -2267,10 +2218,11 @@ class Interactivity {
2267
2218
  this.detectsOn = value;
2268
2219
  }
2269
2220
  load(data) {
2221
+ var _a;
2270
2222
  if (!data) {
2271
2223
  return;
2272
2224
  }
2273
- const detectsOn = data.detectsOn ?? data.detect_on;
2225
+ const detectsOn = (_a = data.detectsOn) !== null && _a !== void 0 ? _a : data.detect_on;
2274
2226
  if (detectsOn !== undefined) {
2275
2227
  this.detectsOn = detectsOn;
2276
2228
  }
@@ -2281,16 +2233,15 @@ class Interactivity {
2281
2233
  ;// CONCATENATED MODULE: ../../engine/dist/esm/Options/Classes/ManualParticle.js
2282
2234
 
2283
2235
  class ManualParticle {
2284
- options;
2285
- position;
2286
2236
  load(data) {
2237
+ var _a, _b;
2287
2238
  if (!data) {
2288
2239
  return;
2289
2240
  }
2290
2241
  if (data.position !== undefined) {
2291
2242
  this.position = {
2292
- x: data.position.x ?? 50,
2293
- y: data.position.y ?? 50
2243
+ x: (_a = data.position.x) !== null && _a !== void 0 ? _a : 50,
2244
+ y: (_b = data.position.y) !== null && _b !== void 0 ? _b : 50
2294
2245
  };
2295
2246
  }
2296
2247
  if (data.options !== undefined) {
@@ -2301,9 +2252,6 @@ class ManualParticle {
2301
2252
  ;// CONCATENATED MODULE: ../../engine/dist/esm/Options/Classes/Responsive.js
2302
2253
 
2303
2254
  class Responsive {
2304
- maxWidth;
2305
- mode;
2306
- options;
2307
2255
  constructor() {
2308
2256
  this.maxWidth = Infinity;
2309
2257
  this.options = {};
@@ -2330,9 +2278,6 @@ class Responsive {
2330
2278
  }
2331
2279
  ;// CONCATENATED MODULE: ../../engine/dist/esm/Options/Classes/Theme/ThemeDefault.js
2332
2280
  class ThemeDefault {
2333
- auto;
2334
- mode;
2335
- value;
2336
2281
  constructor() {
2337
2282
  this.auto = false;
2338
2283
  this.mode = "any";
@@ -2357,9 +2302,6 @@ class ThemeDefault {
2357
2302
 
2358
2303
 
2359
2304
  class Theme {
2360
- default;
2361
- name;
2362
- options;
2363
2305
  constructor() {
2364
2306
  this.name = "";
2365
2307
  this.default = new ThemeDefault();
@@ -2380,12 +2322,6 @@ class Theme {
2380
2322
  ;// CONCATENATED MODULE: ../../engine/dist/esm/Options/Classes/ColorAnimation.js
2381
2323
 
2382
2324
  class ColorAnimation {
2383
- count;
2384
- decay;
2385
- enable;
2386
- offset;
2387
- speed;
2388
- sync;
2389
2325
  constructor() {
2390
2326
  this.count = 0;
2391
2327
  this.enable = false;
@@ -2421,9 +2357,6 @@ class ColorAnimation {
2421
2357
  ;// CONCATENATED MODULE: ../../engine/dist/esm/Options/Classes/HslAnimation.js
2422
2358
 
2423
2359
  class HslAnimation {
2424
- h;
2425
- l;
2426
- s;
2427
2360
  constructor() {
2428
2361
  this.h = new ColorAnimation();
2429
2362
  this.s = new ColorAnimation();
@@ -2442,7 +2375,6 @@ class HslAnimation {
2442
2375
 
2443
2376
 
2444
2377
  class AnimatableColor extends OptionsColor {
2445
- animation;
2446
2378
  constructor() {
2447
2379
  super();
2448
2380
  this.animation = new HslAnimation();
@@ -2478,7 +2410,6 @@ class AnimatableColor extends OptionsColor {
2478
2410
  }
2479
2411
  ;// CONCATENATED MODULE: ../../engine/dist/esm/Options/Classes/Particles/Collisions/CollisionsAbsorb.js
2480
2412
  class CollisionsAbsorb {
2481
- speed;
2482
2413
  constructor() {
2483
2414
  this.speed = 2;
2484
2415
  }
@@ -2493,8 +2424,6 @@ class CollisionsAbsorb {
2493
2424
  }
2494
2425
  ;// CONCATENATED MODULE: ../../engine/dist/esm/Options/Classes/Particles/Collisions/CollisionsOverlap.js
2495
2426
  class CollisionsOverlap {
2496
- enable;
2497
- retries;
2498
2427
  constructor() {
2499
2428
  this.enable = true;
2500
2429
  this.retries = 0;
@@ -2513,8 +2442,6 @@ class CollisionsOverlap {
2513
2442
  }
2514
2443
  ;// CONCATENATED MODULE: ../../engine/dist/esm/Options/Classes/Random.js
2515
2444
  class Random {
2516
- enable;
2517
- minimumValue;
2518
2445
  constructor() {
2519
2446
  this.enable = false;
2520
2447
  this.minimumValue = 0;
@@ -2535,8 +2462,6 @@ class Random {
2535
2462
 
2536
2463
 
2537
2464
  class ValueWithRandom {
2538
- random;
2539
- value;
2540
2465
  constructor() {
2541
2466
  this.random = new Random();
2542
2467
  this.value = 0;
@@ -2567,8 +2492,6 @@ class ParticlesBounceFactor extends ValueWithRandom {
2567
2492
  ;// CONCATENATED MODULE: ../../engine/dist/esm/Options/Classes/Particles/Bounce/ParticlesBounce.js
2568
2493
 
2569
2494
  class ParticlesBounce {
2570
- horizontal;
2571
- vertical;
2572
2495
  constructor() {
2573
2496
  this.horizontal = new ParticlesBounceFactor();
2574
2497
  this.vertical = new ParticlesBounceFactor();
@@ -2586,11 +2509,6 @@ class ParticlesBounce {
2586
2509
 
2587
2510
 
2588
2511
  class Collisions {
2589
- absorb;
2590
- bounce;
2591
- enable;
2592
- mode;
2593
- overlap;
2594
2512
  constructor() {
2595
2513
  this.absorb = new CollisionsAbsorb();
2596
2514
  this.bounce = new ParticlesBounce();
@@ -2616,8 +2534,6 @@ class Collisions {
2616
2534
  ;// CONCATENATED MODULE: ../../engine/dist/esm/Options/Classes/Particles/Move/MoveAngle.js
2617
2535
 
2618
2536
  class MoveAngle {
2619
- offset;
2620
- value;
2621
2537
  constructor() {
2622
2538
  this.offset = 0;
2623
2539
  this.value = 90;
@@ -2637,9 +2553,6 @@ class MoveAngle {
2637
2553
  ;// CONCATENATED MODULE: ../../engine/dist/esm/Options/Classes/Particles/Move/MoveAttract.js
2638
2554
 
2639
2555
  class MoveAttract {
2640
- distance;
2641
- enable;
2642
- rotate;
2643
2556
  constructor() {
2644
2557
  this.distance = 200;
2645
2558
  this.enable = false;
@@ -2661,6 +2574,7 @@ class MoveAttract {
2661
2574
  this.rotate.y = value;
2662
2575
  }
2663
2576
  load(data) {
2577
+ var _a, _b, _c, _d;
2664
2578
  if (!data) {
2665
2579
  return;
2666
2580
  }
@@ -2670,11 +2584,11 @@ class MoveAttract {
2670
2584
  if (data.enable !== undefined) {
2671
2585
  this.enable = data.enable;
2672
2586
  }
2673
- const rotateX = data.rotate?.x ?? data.rotateX;
2587
+ const rotateX = (_b = (_a = data.rotate) === null || _a === void 0 ? void 0 : _a.x) !== null && _b !== void 0 ? _b : data.rotateX;
2674
2588
  if (rotateX !== undefined) {
2675
2589
  this.rotate.x = rotateX;
2676
2590
  }
2677
- const rotateY = data.rotate?.y ?? data.rotateY;
2591
+ const rotateY = (_d = (_c = data.rotate) === null || _c === void 0 ? void 0 : _c.y) !== null && _d !== void 0 ? _d : data.rotateY;
2678
2592
  if (rotateY !== undefined) {
2679
2593
  this.rotate.y = rotateY;
2680
2594
  }
@@ -2682,10 +2596,6 @@ class MoveAttract {
2682
2596
  }
2683
2597
  ;// CONCATENATED MODULE: ../../engine/dist/esm/Options/Classes/Particles/Move/MoveCenter.js
2684
2598
  class MoveCenter {
2685
- mode;
2686
- radius;
2687
- x;
2688
- y;
2689
2599
  constructor() {
2690
2600
  this.x = 50;
2691
2601
  this.y = 50;
@@ -2713,10 +2623,6 @@ class MoveCenter {
2713
2623
  ;// CONCATENATED MODULE: ../../engine/dist/esm/Options/Classes/Particles/Move/MoveGravity.js
2714
2624
 
2715
2625
  class MoveGravity {
2716
- acceleration;
2717
- enable;
2718
- inverse;
2719
- maxSpeed;
2720
2626
  constructor() {
2721
2627
  this.acceleration = 9.81;
2722
2628
  this.enable = false;
@@ -2745,11 +2651,6 @@ class MoveGravity {
2745
2651
 
2746
2652
 
2747
2653
  class MovePath {
2748
- clamp;
2749
- delay;
2750
- enable;
2751
- generator;
2752
- options;
2753
2654
  constructor() {
2754
2655
  this.clamp = true;
2755
2656
  this.delay = new ValueWithRandom();
@@ -2776,9 +2677,6 @@ class MovePath {
2776
2677
  ;// CONCATENATED MODULE: ../../engine/dist/esm/Options/Classes/Particles/Move/MoveTrail.js
2777
2678
 
2778
2679
  class MoveTrail {
2779
- enable;
2780
- fillColor;
2781
- length;
2782
2680
  constructor() {
2783
2681
  this.enable = false;
2784
2682
  this.length = 10;
@@ -2800,34 +2698,27 @@ class MoveTrail {
2800
2698
  }
2801
2699
  ;// CONCATENATED MODULE: ../../engine/dist/esm/Options/Classes/Particles/Move/OutModes.js
2802
2700
  class OutModes {
2803
- bottom;
2804
- default;
2805
- left;
2806
- right;
2807
- top;
2808
2701
  constructor() {
2809
2702
  this.default = "out";
2810
2703
  }
2811
2704
  load(data) {
2705
+ var _a, _b, _c, _d;
2812
2706
  if (!data) {
2813
2707
  return;
2814
2708
  }
2815
2709
  if (data.default !== undefined) {
2816
2710
  this.default = data.default;
2817
2711
  }
2818
- this.bottom = data.bottom ?? data.default;
2819
- this.left = data.left ?? data.default;
2820
- this.right = data.right ?? data.default;
2821
- this.top = data.top ?? data.default;
2712
+ this.bottom = (_a = data.bottom) !== null && _a !== void 0 ? _a : data.default;
2713
+ this.left = (_b = data.left) !== null && _b !== void 0 ? _b : data.default;
2714
+ this.right = (_c = data.right) !== null && _c !== void 0 ? _c : data.default;
2715
+ this.top = (_d = data.top) !== null && _d !== void 0 ? _d : data.default;
2822
2716
  }
2823
2717
  }
2824
2718
  ;// CONCATENATED MODULE: ../../engine/dist/esm/Options/Classes/Particles/Move/Spin.js
2825
2719
 
2826
2720
 
2827
2721
  class Spin {
2828
- acceleration;
2829
- enable;
2830
- position;
2831
2722
  constructor() {
2832
2723
  this.acceleration = 0;
2833
2724
  this.enable = false;
@@ -2856,25 +2747,6 @@ class Spin {
2856
2747
 
2857
2748
 
2858
2749
  class Move {
2859
- angle;
2860
- attract;
2861
- center;
2862
- decay;
2863
- direction;
2864
- distance;
2865
- drift;
2866
- enable;
2867
- gravity;
2868
- outModes;
2869
- path;
2870
- random;
2871
- size;
2872
- speed;
2873
- spin;
2874
- straight;
2875
- trail;
2876
- vibrate;
2877
- warp;
2878
2750
  constructor() {
2879
2751
  this.angle = new MoveAngle();
2880
2752
  this.attract = new MoveAttract();
@@ -2925,6 +2797,7 @@ class Move {
2925
2797
  this.outMode = value;
2926
2798
  }
2927
2799
  load(data) {
2800
+ var _a, _b, _c;
2928
2801
  if (!data) {
2929
2802
  return;
2930
2803
  }
@@ -2943,9 +2816,7 @@ class Move {
2943
2816
  this.distance = typeof data.distance === "number" ? {
2944
2817
  horizontal: data.distance,
2945
2818
  vertical: data.distance
2946
- } : {
2947
- ...data.distance
2948
- };
2819
+ } : Object.assign({}, data.distance);
2949
2820
  }
2950
2821
  if (data.drift !== undefined) {
2951
2822
  this.drift = setRangeValue(data.drift);
@@ -2954,7 +2825,7 @@ class Move {
2954
2825
  this.enable = data.enable;
2955
2826
  }
2956
2827
  this.gravity.load(data.gravity);
2957
- const outModes = data.outModes ?? data.outMode ?? data.out_mode;
2828
+ const outModes = (_b = (_a = data.outModes) !== null && _a !== void 0 ? _a : data.outMode) !== null && _b !== void 0 ? _b : data.out_mode;
2958
2829
  if (outModes !== undefined) {
2959
2830
  if (typeof outModes === "object") {
2960
2831
  this.outModes.load(outModes);
@@ -2964,7 +2835,7 @@ class Move {
2964
2835
  });
2965
2836
  }
2966
2837
  }
2967
- this.path.load(data.path ?? data.noise);
2838
+ this.path.load((_c = data.path) !== null && _c !== void 0 ? _c : data.noise);
2968
2839
  if (data.random !== undefined) {
2969
2840
  this.random = data.random;
2970
2841
  }
@@ -2990,11 +2861,6 @@ class Move {
2990
2861
  ;// CONCATENATED MODULE: ../../engine/dist/esm/Options/Classes/AnimationOptions.js
2991
2862
 
2992
2863
  class AnimationOptions {
2993
- count;
2994
- decay;
2995
- enable;
2996
- speed;
2997
- sync;
2998
2864
  constructor() {
2999
2865
  this.count = 0;
3000
2866
  this.enable = false;
@@ -3026,9 +2892,6 @@ class AnimationOptions {
3026
2892
  ;// CONCATENATED MODULE: ../../engine/dist/esm/Options/Classes/Particles/Opacity/OpacityAnimation.js
3027
2893
 
3028
2894
  class OpacityAnimation extends AnimationOptions {
3029
- destroy;
3030
- minimumValue;
3031
- startValue;
3032
2895
  constructor() {
3033
2896
  super();
3034
2897
  this.destroy = "none";
@@ -3044,6 +2907,7 @@ class OpacityAnimation extends AnimationOptions {
3044
2907
  this.minimumValue = value;
3045
2908
  }
3046
2909
  load(data) {
2910
+ var _a;
3047
2911
  if (!data) {
3048
2912
  return;
3049
2913
  }
@@ -3054,7 +2918,7 @@ class OpacityAnimation extends AnimationOptions {
3054
2918
  if (data.enable !== undefined) {
3055
2919
  this.enable = data.enable;
3056
2920
  }
3057
- this.minimumValue = data.minimumValue ?? data.opacity_min;
2921
+ this.minimumValue = (_a = data.minimumValue) !== null && _a !== void 0 ? _a : data.opacity_min;
3058
2922
  if (data.speed !== undefined) {
3059
2923
  this.speed = data.speed;
3060
2924
  }
@@ -3071,7 +2935,6 @@ class OpacityAnimation extends AnimationOptions {
3071
2935
 
3072
2936
 
3073
2937
  class Opacity extends ValueWithRandom {
3074
- animation;
3075
2938
  constructor() {
3076
2939
  super();
3077
2940
  this.animation = new OpacityAnimation();
@@ -3085,11 +2948,12 @@ class Opacity extends ValueWithRandom {
3085
2948
  this.animation = value;
3086
2949
  }
3087
2950
  load(data) {
2951
+ var _a;
3088
2952
  if (!data) {
3089
2953
  return;
3090
2954
  }
3091
2955
  super.load(data);
3092
- const animation = data.animation ?? data.anim;
2956
+ const animation = (_a = data.animation) !== null && _a !== void 0 ? _a : data.anim;
3093
2957
  if (animation !== undefined) {
3094
2958
  this.animation.load(animation);
3095
2959
  this.value = setRangeValue(this.value, this.animation.enable ? this.animation.minimumValue : undefined);
@@ -3098,9 +2962,6 @@ class Opacity extends ValueWithRandom {
3098
2962
  }
3099
2963
  ;// CONCATENATED MODULE: ../../engine/dist/esm/Options/Classes/Particles/Number/ParticlesDensity.js
3100
2964
  class ParticlesDensity {
3101
- area;
3102
- enable;
3103
- factor;
3104
2965
  constructor() {
3105
2966
  this.enable = false;
3106
2967
  this.area = 800;
@@ -3113,13 +2974,14 @@ class ParticlesDensity {
3113
2974
  this.area = value;
3114
2975
  }
3115
2976
  load(data) {
2977
+ var _a;
3116
2978
  if (!data) {
3117
2979
  return;
3118
2980
  }
3119
2981
  if (data.enable !== undefined) {
3120
2982
  this.enable = data.enable;
3121
2983
  }
3122
- const area = data.area ?? data.value_area;
2984
+ const area = (_a = data.area) !== null && _a !== void 0 ? _a : data.value_area;
3123
2985
  if (area !== undefined) {
3124
2986
  this.area = area;
3125
2987
  }
@@ -3131,9 +2993,6 @@ class ParticlesDensity {
3131
2993
  ;// CONCATENATED MODULE: ../../engine/dist/esm/Options/Classes/Particles/Number/ParticlesNumber.js
3132
2994
 
3133
2995
  class ParticlesNumber {
3134
- density;
3135
- limit;
3136
- value;
3137
2996
  constructor() {
3138
2997
  this.density = new ParticlesDensity();
3139
2998
  this.limit = 0;
@@ -3146,11 +3005,12 @@ class ParticlesNumber {
3146
3005
  this.limit = value;
3147
3006
  }
3148
3007
  load(data) {
3008
+ var _a;
3149
3009
  if (!data) {
3150
3010
  return;
3151
3011
  }
3152
3012
  this.density.load(data.density);
3153
- const limit = data.limit ?? data.max;
3013
+ const limit = (_a = data.limit) !== null && _a !== void 0 ? _a : data.max;
3154
3014
  if (limit !== undefined) {
3155
3015
  this.limit = limit;
3156
3016
  }
@@ -3162,10 +3022,6 @@ class ParticlesNumber {
3162
3022
  ;// CONCATENATED MODULE: ../../engine/dist/esm/Options/Classes/Particles/Shadow.js
3163
3023
 
3164
3024
  class Shadow {
3165
- blur;
3166
- color;
3167
- enable;
3168
- offset;
3169
3025
  constructor() {
3170
3026
  this.blur = 0;
3171
3027
  this.color = new OptionsColor();
@@ -3207,14 +3063,13 @@ const charKey = "character",
3207
3063
  polygonKey = "polygon",
3208
3064
  polygonAltKey = "star";
3209
3065
  class Shape {
3210
- options;
3211
- type;
3212
3066
  constructor() {
3213
3067
  this.options = {};
3214
3068
  this.type = "circle";
3215
3069
  }
3216
3070
  get character() {
3217
- return this.options[charKey] ?? this.options[charAltKey];
3071
+ var _a;
3072
+ return (_a = this.options[charKey]) !== null && _a !== void 0 ? _a : this.options[charAltKey];
3218
3073
  }
3219
3074
  set character(value) {
3220
3075
  this.options[charAltKey] = this.options[charKey] = value;
@@ -3226,7 +3081,8 @@ class Shape {
3226
3081
  this.options = value;
3227
3082
  }
3228
3083
  get image() {
3229
- return this.options[imageKey] ?? this.options[imageAltKey];
3084
+ var _a;
3085
+ return (_a = this.options[imageKey]) !== null && _a !== void 0 ? _a : this.options[imageAltKey];
3230
3086
  }
3231
3087
  set image(value) {
3232
3088
  this.options[imageAltKey] = this.options[imageKey] = value;
@@ -3238,7 +3094,8 @@ class Shape {
3238
3094
  this.image = value;
3239
3095
  }
3240
3096
  get polygon() {
3241
- return this.options[polygonKey] ?? this.options[polygonAltKey];
3097
+ var _a;
3098
+ return (_a = this.options[polygonKey]) !== null && _a !== void 0 ? _a : this.options[polygonAltKey];
3242
3099
  }
3243
3100
  set polygon(value) {
3244
3101
  this.options[polygonAltKey] = this.options[polygonKey] = value;
@@ -3248,26 +3105,28 @@ class Shape {
3248
3105
  }
3249
3106
  set stroke(_value) {}
3250
3107
  load(data) {
3108
+ var _a, _b, _c;
3251
3109
  if (!data) {
3252
3110
  return;
3253
3111
  }
3254
- const options = data.options ?? data.custom;
3112
+ const options = (_a = data.options) !== null && _a !== void 0 ? _a : data.custom;
3255
3113
  if (options !== undefined) {
3256
3114
  for (const shape in options) {
3257
3115
  const item = options[shape];
3258
3116
  if (item) {
3259
- this.options[shape] = deepExtend(this.options[shape] ?? {}, item);
3117
+ this.options[shape] = deepExtend((_b = this.options[shape]) !== null && _b !== void 0 ? _b : {}, item);
3260
3118
  }
3261
3119
  }
3262
3120
  }
3263
3121
  this.loadShape(data.character, charKey, charAltKey, true);
3264
3122
  this.loadShape(data.polygon, polygonKey, polygonAltKey, false);
3265
- this.loadShape(data.image ?? data.images, imageKey, imageAltKey, true);
3123
+ this.loadShape((_c = data.image) !== null && _c !== void 0 ? _c : data.images, imageKey, imageAltKey, true);
3266
3124
  if (data.type !== undefined) {
3267
3125
  this.type = data.type;
3268
3126
  }
3269
3127
  }
3270
3128
  loadShape(item, mainKey, altKey, altOverride) {
3129
+ var _a, _b;
3271
3130
  if (!item) {
3272
3131
  return;
3273
3132
  }
@@ -3281,18 +3140,15 @@ class Shape {
3281
3140
  if (altDifferentValues && altOverride) {
3282
3141
  this.options[altKey] = emptyValue;
3283
3142
  }
3284
- this.options[mainKey] = deepExtend(this.options[mainKey] ?? emptyValue, item);
3143
+ this.options[mainKey] = deepExtend((_a = this.options[mainKey]) !== null && _a !== void 0 ? _a : emptyValue, item);
3285
3144
  if (!this.options[altKey] || altOverride) {
3286
- this.options[altKey] = deepExtend(this.options[altKey] ?? emptyValue, item);
3145
+ this.options[altKey] = deepExtend((_b = this.options[altKey]) !== null && _b !== void 0 ? _b : emptyValue, item);
3287
3146
  }
3288
3147
  }
3289
3148
  }
3290
3149
  ;// CONCATENATED MODULE: ../../engine/dist/esm/Options/Classes/Particles/Size/SizeAnimation.js
3291
3150
 
3292
3151
  class SizeAnimation extends AnimationOptions {
3293
- destroy;
3294
- minimumValue;
3295
- startValue;
3296
3152
  constructor() {
3297
3153
  super();
3298
3154
  this.destroy = "none";
@@ -3308,6 +3164,7 @@ class SizeAnimation extends AnimationOptions {
3308
3164
  this.minimumValue = value;
3309
3165
  }
3310
3166
  load(data) {
3167
+ var _a;
3311
3168
  super.load(data);
3312
3169
  if (!data) {
3313
3170
  return;
@@ -3318,7 +3175,7 @@ class SizeAnimation extends AnimationOptions {
3318
3175
  if (data.enable !== undefined) {
3319
3176
  this.enable = data.enable;
3320
3177
  }
3321
- this.minimumValue = data.minimumValue ?? data.size_min;
3178
+ this.minimumValue = (_a = data.minimumValue) !== null && _a !== void 0 ? _a : data.size_min;
3322
3179
  if (data.speed !== undefined) {
3323
3180
  this.speed = data.speed;
3324
3181
  }
@@ -3335,7 +3192,6 @@ class SizeAnimation extends AnimationOptions {
3335
3192
 
3336
3193
 
3337
3194
  class Size extends ValueWithRandom {
3338
- animation;
3339
3195
  constructor() {
3340
3196
  super();
3341
3197
  this.animation = new SizeAnimation();
@@ -3349,11 +3205,12 @@ class Size extends ValueWithRandom {
3349
3205
  this.animation = value;
3350
3206
  }
3351
3207
  load(data) {
3208
+ var _a;
3352
3209
  super.load(data);
3353
3210
  if (!data) {
3354
3211
  return;
3355
3212
  }
3356
- const animation = data.animation ?? data.anim;
3213
+ const animation = (_a = data.animation) !== null && _a !== void 0 ? _a : data.anim;
3357
3214
  if (animation !== undefined) {
3358
3215
  this.animation.load(animation);
3359
3216
  this.value = setRangeValue(this.value, this.animation.enable ? this.animation.minimumValue : undefined);
@@ -3363,9 +3220,6 @@ class Size extends ValueWithRandom {
3363
3220
  ;// CONCATENATED MODULE: ../../engine/dist/esm/Options/Classes/Particles/Stroke.js
3364
3221
 
3365
3222
  class Stroke {
3366
- color;
3367
- opacity;
3368
- width;
3369
3223
  constructor() {
3370
3224
  this.width = 0;
3371
3225
  }
@@ -3387,9 +3241,6 @@ class Stroke {
3387
3241
  ;// CONCATENATED MODULE: ../../engine/dist/esm/Options/Classes/Particles/ZIndex/ZIndex.js
3388
3242
 
3389
3243
  class ZIndex extends ValueWithRandom {
3390
- opacityRate;
3391
- sizeRate;
3392
- velocityRate;
3393
3244
  constructor() {
3394
3245
  super();
3395
3246
  this.opacityRate = 1;
@@ -3426,22 +3277,6 @@ class ZIndex extends ValueWithRandom {
3426
3277
 
3427
3278
 
3428
3279
  class ParticlesOptions {
3429
- bounce;
3430
- collisions;
3431
- color;
3432
- groups;
3433
- interactivity;
3434
- move;
3435
- number;
3436
- opacity;
3437
- reduceDuplicates;
3438
- shadow;
3439
- shape;
3440
- size;
3441
- stroke;
3442
- zIndex;
3443
- _container;
3444
- _engine;
3445
3280
  constructor(engine, container) {
3446
3281
  this._engine = engine;
3447
3282
  this._container = container;
@@ -3461,6 +3296,7 @@ class ParticlesOptions {
3461
3296
  this.zIndex = new ZIndex();
3462
3297
  }
3463
3298
  load(data) {
3299
+ var _a, _b, _c, _d, _e, _f;
3464
3300
  if (!data) {
3465
3301
  return;
3466
3302
  }
@@ -3470,7 +3306,7 @@ class ParticlesOptions {
3470
3306
  for (const group in data.groups) {
3471
3307
  const item = data.groups[group];
3472
3308
  if (item !== undefined) {
3473
- this.groups[group] = deepExtend(this.groups[group] ?? {}, item);
3309
+ this.groups[group] = deepExtend((_a = this.groups[group]) !== null && _a !== void 0 ? _a : {}, item);
3474
3310
  }
3475
3311
  }
3476
3312
  }
@@ -3484,7 +3320,7 @@ class ParticlesOptions {
3484
3320
  this.size.load(data.size);
3485
3321
  this.shadow.load(data.shadow);
3486
3322
  this.zIndex.load(data.zIndex);
3487
- const collisions = data.move?.collisions ?? data.move?.bounce;
3323
+ const collisions = (_c = (_b = data.move) === null || _b === void 0 ? void 0 : _b.collisions) !== null && _c !== void 0 ? _c : (_d = data.move) === null || _d === void 0 ? void 0 : _d.bounce;
3488
3324
  if (collisions !== undefined) {
3489
3325
  this.collisions.enable = collisions;
3490
3326
  }
@@ -3492,7 +3328,7 @@ class ParticlesOptions {
3492
3328
  if (data.interactivity !== undefined) {
3493
3329
  this.interactivity = deepExtend({}, data.interactivity);
3494
3330
  }
3495
- const strokeToLoad = data.stroke ?? data.shape?.stroke;
3331
+ const strokeToLoad = (_e = data.stroke) !== null && _e !== void 0 ? _e : (_f = data.shape) === null || _f === void 0 ? void 0 : _f.stroke;
3496
3332
  if (strokeToLoad) {
3497
3333
  this.stroke = executeOnSingleOrMultiple(strokeToLoad, t => {
3498
3334
  const tmp = new Stroke();
@@ -3544,28 +3380,6 @@ function loadParticlesOptions(engine, container, ...sourceOptionsArr) {
3544
3380
 
3545
3381
 
3546
3382
  class Options {
3547
- autoPlay;
3548
- background;
3549
- backgroundMask;
3550
- defaultThemes;
3551
- delay;
3552
- detectRetina;
3553
- duration;
3554
- fpsLimit;
3555
- fullScreen;
3556
- interactivity;
3557
- manualParticles;
3558
- particles;
3559
- pauseOnBlur;
3560
- pauseOnOutsideViewport;
3561
- preset;
3562
- responsive;
3563
- smooth;
3564
- style;
3565
- themes;
3566
- zLayers;
3567
- _container;
3568
- _engine;
3569
3383
  constructor(engine, container) {
3570
3384
  this._engine = engine;
3571
3385
  this._container = container;
@@ -3608,6 +3422,7 @@ class Options {
3608
3422
  this.detectRetina = value;
3609
3423
  }
3610
3424
  load(data) {
3425
+ var _a, _b, _c, _d, _e;
3611
3426
  if (!data) {
3612
3427
  return;
3613
3428
  }
@@ -3620,14 +3435,14 @@ class Options {
3620
3435
  if (data.delay !== undefined) {
3621
3436
  this.delay = setRangeValue(data.delay);
3622
3437
  }
3623
- const detectRetina = data.detectRetina ?? data.retina_detect;
3438
+ const detectRetina = (_a = data.detectRetina) !== null && _a !== void 0 ? _a : data.retina_detect;
3624
3439
  if (detectRetina !== undefined) {
3625
3440
  this.detectRetina = detectRetina;
3626
3441
  }
3627
3442
  if (data.duration !== undefined) {
3628
3443
  this.duration = setRangeValue(data.duration);
3629
3444
  }
3630
- const fpsLimit = data.fpsLimit ?? data.fps_limit;
3445
+ const fpsLimit = (_b = data.fpsLimit) !== null && _b !== void 0 ? _b : data.fps_limit;
3631
3446
  if (fpsLimit !== undefined) {
3632
3447
  this.fpsLimit = fpsLimit;
3633
3448
  }
@@ -3641,7 +3456,7 @@ class Options {
3641
3456
  this.zLayers = data.zLayers;
3642
3457
  }
3643
3458
  this.background.load(data.background);
3644
- const fullScreen = data.fullScreen ?? data.backgroundMode;
3459
+ const fullScreen = (_c = data.fullScreen) !== null && _c !== void 0 ? _c : data.backgroundMode;
3645
3460
  if (typeof fullScreen === "boolean") {
3646
3461
  this.fullScreen.enable = fullScreen;
3647
3462
  } else {
@@ -3685,14 +3500,14 @@ class Options {
3685
3500
  this.themes.push(optTheme);
3686
3501
  }
3687
3502
  }
3688
- this.defaultThemes.dark = this._findDefaultTheme("dark")?.name;
3689
- this.defaultThemes.light = this._findDefaultTheme("light")?.name;
3503
+ this.defaultThemes.dark = (_d = this._findDefaultTheme("dark")) === null || _d === void 0 ? void 0 : _d.name;
3504
+ this.defaultThemes.light = (_e = this._findDefaultTheme("light")) === null || _e === void 0 ? void 0 : _e.name;
3690
3505
  }
3691
3506
  setResponsive(width, pxRatio, defaultOptions) {
3692
3507
  this.load(defaultOptions);
3693
3508
  const responsiveOptions = this.responsive.find(t => t.mode === "screen" && screen ? t.maxWidth > screen.availWidth : t.maxWidth * pxRatio > width);
3694
- this.load(responsiveOptions?.options);
3695
- return responsiveOptions?.maxWidth;
3509
+ this.load(responsiveOptions === null || responsiveOptions === void 0 ? void 0 : responsiveOptions.options);
3510
+ return responsiveOptions === null || responsiveOptions === void 0 ? void 0 : responsiveOptions.maxWidth;
3696
3511
  }
3697
3512
  setTheme(name) {
3698
3513
  if (name) {
@@ -3710,7 +3525,8 @@ class Options {
3710
3525
  }
3711
3526
  }
3712
3527
  _findDefaultTheme(mode) {
3713
- return this.themes.find(theme => theme.default.value && theme.default.mode === mode) ?? this.themes.find(theme => theme.default.value && theme.default.mode === "any");
3528
+ var _a;
3529
+ 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");
3714
3530
  }
3715
3531
  _importPreset(preset) {
3716
3532
  this.load(this._engine.plugins.getPreset(preset));
@@ -3718,11 +3534,6 @@ class Options {
3718
3534
  }
3719
3535
  ;// CONCATENATED MODULE: ../../engine/dist/esm/Core/Utils/InteractionManager.js
3720
3536
  class InteractionManager {
3721
- container;
3722
- _engine;
3723
- _externalInteractors;
3724
- _interactors;
3725
- _particleInteractors;
3726
3537
  constructor(engine, container) {
3727
3538
  this.container = container;
3728
3539
  this._engine = engine;
@@ -3802,51 +3613,6 @@ const fixOutMode = data => {
3802
3613
  }
3803
3614
  };
3804
3615
  class Particle {
3805
- container;
3806
- backColor;
3807
- bubble;
3808
- close;
3809
- color;
3810
- destroyed;
3811
- direction;
3812
- fill;
3813
- group;
3814
- id;
3815
- ignoresResizeRatio;
3816
- initialPosition;
3817
- initialVelocity;
3818
- interactivity;
3819
- lastPathTime;
3820
- misplaced;
3821
- moveCenter;
3822
- moveDecay;
3823
- offset;
3824
- opacity;
3825
- options;
3826
- outType;
3827
- pathDelay;
3828
- pathGenerator;
3829
- pathRotation;
3830
- position;
3831
- randomIndexData;
3832
- retina;
3833
- roll;
3834
- rotation;
3835
- shadowColor;
3836
- shape;
3837
- shapeData;
3838
- sides;
3839
- size;
3840
- slow;
3841
- spawning;
3842
- stroke;
3843
- strokeColor;
3844
- strokeWidth;
3845
- unbreakable;
3846
- velocity;
3847
- wobble;
3848
- zIndexFactor;
3849
- _engine;
3850
3616
  constructor(engine, id, container, position, overrideOptions, group) {
3851
3617
  this.container = container;
3852
3618
  this._engine = engine;
@@ -3878,11 +3644,12 @@ class Particle {
3878
3644
  container.canvas.drawParticle(this, delta);
3879
3645
  }
3880
3646
  getFillColor() {
3881
- const color = this.bubble.color ?? getHslFromAnimation(this.color);
3647
+ var _a, _b;
3648
+ const color = (_a = this.bubble.color) !== null && _a !== void 0 ? _a : getHslFromAnimation(this.color);
3882
3649
  if (color && this.roll && (this.backColor || this.roll.alter)) {
3883
3650
  const backFactor = this.roll.horizontal && this.roll.vertical ? 2 : 1,
3884
3651
  backSum = this.roll.horizontal ? Math.PI / 2 : 0,
3885
- rolled = Math.floor(((this.roll.angle ?? 0) + backSum) / (Math.PI / backFactor)) % 2;
3652
+ rolled = Math.floor((((_b = this.roll.angle) !== null && _b !== void 0 ? _b : 0) + backSum) / (Math.PI / backFactor)) % 2;
3886
3653
  if (rolled) {
3887
3654
  if (this.backColor) {
3888
3655
  return this.backColor;
@@ -3905,12 +3672,15 @@ class Particle {
3905
3672
  };
3906
3673
  }
3907
3674
  getRadius() {
3908
- return this.bubble.radius ?? this.size.value;
3675
+ var _a;
3676
+ return (_a = this.bubble.radius) !== null && _a !== void 0 ? _a : this.size.value;
3909
3677
  }
3910
3678
  getStrokeColor() {
3911
- return this.bubble.color ?? getHslFromAnimation(this.strokeColor) ?? this.getFillColor();
3679
+ var _a, _b;
3680
+ return (_b = (_a = this.bubble.color) !== null && _a !== void 0 ? _a : getHslFromAnimation(this.strokeColor)) !== null && _b !== void 0 ? _b : this.getFillColor();
3912
3681
  }
3913
3682
  init(id, position, overrideOptions, group) {
3683
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
3914
3684
  const container = this.container,
3915
3685
  engine = this._engine;
3916
3686
  this.group = group;
@@ -3946,12 +3716,12 @@ class Particle {
3946
3716
  }
3947
3717
  this.shapeData = this._loadShapeData(shapeOptions, reduceDuplicates);
3948
3718
  particlesOptions.load(overrideOptions);
3949
- particlesOptions.load(this.shapeData?.particles);
3719
+ particlesOptions.load((_a = this.shapeData) === null || _a === void 0 ? void 0 : _a.particles);
3950
3720
  this.interactivity = new Interactivity(engine, container);
3951
3721
  this.interactivity.load(container.actualOptions.interactivity);
3952
3722
  this.interactivity.load(particlesOptions.interactivity);
3953
- this.fill = this.shapeData?.fill ?? this.fill;
3954
- this.close = this.shapeData?.close ?? this.close;
3723
+ this.fill = (_c = (_b = this.shapeData) === null || _b === void 0 ? void 0 : _b.fill) !== null && _c !== void 0 ? _c : this.fill;
3724
+ this.close = (_e = (_d = this.shapeData) === null || _d === void 0 ? void 0 : _d.close) !== null && _e !== void 0 ? _e : this.close;
3955
3725
  this.options = particlesOptions;
3956
3726
  const pathOptions = this.options.move.path;
3957
3727
  this.pathDelay = getValue(pathOptions.delay) * 1000;
@@ -4003,15 +3773,13 @@ class Particle {
4003
3773
  this.position = this._calcPosition(container, position, clamp(zIndexValue, 0, container.zLayers));
4004
3774
  this.initialPosition = this.position.copy();
4005
3775
  const canvasSize = container.canvas.size,
4006
- moveCenter = {
4007
- ...this.options.move.center
4008
- },
3776
+ moveCenter = Object.assign({}, this.options.move.center),
4009
3777
  isCenterPercent = moveCenter.mode === "percent";
4010
3778
  this.moveCenter = {
4011
3779
  x: moveCenter.x * (isCenterPercent ? canvasSize.width / 100 : 1),
4012
3780
  y: moveCenter.y * (isCenterPercent ? canvasSize.height / 100 : 1),
4013
- radius: this.options.move.center.radius ?? 0,
4014
- mode: this.options.move.center.mode ?? "percent"
3781
+ radius: (_f = this.options.move.center.radius) !== null && _f !== void 0 ? _f : 0,
3782
+ mode: (_g = this.options.move.center.mode) !== null && _g !== void 0 ? _g : "percent"
4015
3783
  };
4016
3784
  this.direction = getParticleDirectionAngle(this.options.move.direction, this.position, this.moveCenter);
4017
3785
  switch (this.options.move.direction) {
@@ -4038,10 +3806,10 @@ class Particle {
4038
3806
  container.drawers.set(this.shape, drawer);
4039
3807
  }
4040
3808
  }
4041
- if (drawer?.loadShape) {
4042
- drawer?.loadShape(this);
3809
+ if (drawer === null || drawer === void 0 ? void 0 : drawer.loadShape) {
3810
+ drawer === null || drawer === void 0 ? void 0 : drawer.loadShape(this);
4043
3811
  }
4044
- const sideCountFunc = drawer?.getSidesCount;
3812
+ const sideCountFunc = drawer === null || drawer === void 0 ? void 0 : drawer.getSidesCount;
4045
3813
  if (sideCountFunc) {
4046
3814
  this.sides = sideCountFunc(this);
4047
3815
  }
@@ -4051,13 +3819,13 @@ class Particle {
4051
3819
  updater.init(this);
4052
3820
  }
4053
3821
  for (const mover of container.particles.movers) {
4054
- mover.init?.(this);
3822
+ (_h = mover.init) === null || _h === void 0 ? void 0 : _h.call(mover, this);
4055
3823
  }
4056
- if (drawer?.particleInit) {
3824
+ if (drawer === null || drawer === void 0 ? void 0 : drawer.particleInit) {
4057
3825
  drawer.particleInit(container, this);
4058
3826
  }
4059
3827
  for (const [, plugin] of container.plugins) {
4060
- plugin.particleCreated?.(this);
3828
+ (_j = plugin.particleCreated) === null || _j === void 0 ? void 0 : _j.call(plugin, this);
4061
3829
  }
4062
3830
  }
4063
3831
  isInsideCanvas() {
@@ -4069,11 +3837,13 @@ class Particle {
4069
3837
  return !this.destroyed && !this.spawning && this.isInsideCanvas();
4070
3838
  }
4071
3839
  reset() {
3840
+ var _a;
4072
3841
  for (const updater of this.container.particles.updaters) {
4073
- updater.reset?.(this);
3842
+ (_a = updater.reset) === null || _a === void 0 ? void 0 : _a.call(updater, this);
4074
3843
  }
4075
3844
  }
4076
3845
  _calcPosition(container, position, zIndex, tryCount = 0) {
3846
+ var _a, _b, _c, _d;
4077
3847
  for (const [, plugin] of container.plugins) {
4078
3848
  const pluginPos = plugin.particlePosition !== undefined ? plugin.particlePosition(position, this) : undefined;
4079
3849
  if (pluginPos !== undefined) {
@@ -4108,10 +3878,10 @@ class Particle {
4108
3878
  radius
4109
3879
  });
4110
3880
  };
4111
- fixHorizontal(outModes.left ?? outModes.default);
4112
- fixHorizontal(outModes.right ?? outModes.default);
4113
- fixVertical(outModes.top ?? outModes.default);
4114
- fixVertical(outModes.bottom ?? outModes.default);
3881
+ fixHorizontal((_a = outModes.left) !== null && _a !== void 0 ? _a : outModes.default);
3882
+ fixHorizontal((_b = outModes.right) !== null && _b !== void 0 ? _b : outModes.default);
3883
+ fixVertical((_c = outModes.top) !== null && _c !== void 0 ? _c : outModes.default);
3884
+ fixVertical((_d = outModes.bottom) !== null && _d !== void 0 ? _d : outModes.default);
4115
3885
  if (this._checkOverlap(pos, tryCount)) {
4116
3886
  return this._calcPosition(container, undefined, zIndex, tryCount + 1);
4117
3887
  }
@@ -4170,8 +3940,6 @@ class Particle {
4170
3940
  }
4171
3941
  ;// CONCATENATED MODULE: ../../engine/dist/esm/Core/Utils/Point.js
4172
3942
  class Point {
4173
- position;
4174
- particle;
4175
3943
  constructor(position, particle) {
4176
3944
  this.position = position;
4177
3945
  this.particle = particle;
@@ -4179,7 +3947,6 @@ class Point {
4179
3947
  }
4180
3948
  ;// CONCATENATED MODULE: ../../engine/dist/esm/Core/Utils/Range.js
4181
3949
  class Range {
4182
- position;
4183
3950
  constructor(x, y) {
4184
3951
  this.position = {
4185
3952
  x: x,
@@ -4191,7 +3958,6 @@ class Range {
4191
3958
 
4192
3959
 
4193
3960
  class Circle extends Range {
4194
- radius;
4195
3961
  constructor(x, y, radius) {
4196
3962
  super(x, y);
4197
3963
  this.radius = radius;
@@ -4226,7 +3992,6 @@ class Circle extends Range {
4226
3992
 
4227
3993
 
4228
3994
  class Rectangle extends Range {
4229
- size;
4230
3995
  constructor(x, y, width, height) {
4231
3996
  super(x, y);
4232
3997
  this.size = {
@@ -4262,14 +4027,6 @@ class Rectangle extends Range {
4262
4027
 
4263
4028
 
4264
4029
  class QuadTree {
4265
- rectangle;
4266
- capacity;
4267
- _NE;
4268
- _NW;
4269
- _SE;
4270
- _SW;
4271
- _divided;
4272
- _points;
4273
4030
  constructor(rectangle, capacity) {
4274
4031
  this.rectangle = rectangle;
4275
4032
  this.capacity = capacity;
@@ -4277,6 +4034,7 @@ class QuadTree {
4277
4034
  this._divided = false;
4278
4035
  }
4279
4036
  insert(point) {
4037
+ var _a, _b, _c, _d, _e;
4280
4038
  if (!this.rectangle.contains(point.position)) {
4281
4039
  return false;
4282
4040
  }
@@ -4287,10 +4045,11 @@ class QuadTree {
4287
4045
  if (!this._divided) {
4288
4046
  this.subdivide();
4289
4047
  }
4290
- return (this._NE?.insert(point) || this._NW?.insert(point) || this._SE?.insert(point) || this._SW?.insert(point)) ?? false;
4048
+ return (_e = ((_a = this._NE) === null || _a === void 0 ? void 0 : _a.insert(point)) || ((_b = this._NW) === null || _b === void 0 ? void 0 : _b.insert(point)) || ((_c = this._SE) === null || _c === void 0 ? void 0 : _c.insert(point)) || ((_d = this._SW) === null || _d === void 0 ? void 0 : _d.insert(point))) !== null && _e !== void 0 ? _e : false;
4291
4049
  }
4292
4050
  query(range, check, found) {
4293
- const res = found ?? [];
4051
+ var _a, _b, _c, _d;
4052
+ const res = found !== null && found !== void 0 ? found : [];
4294
4053
  if (!range.intersects(this.rectangle)) {
4295
4054
  return [];
4296
4055
  }
@@ -4301,10 +4060,10 @@ class QuadTree {
4301
4060
  res.push(p.particle);
4302
4061
  }
4303
4062
  if (this._divided) {
4304
- this._NE?.query(range, check, res);
4305
- this._NW?.query(range, check, res);
4306
- this._SE?.query(range, check, res);
4307
- this._SW?.query(range, check, res);
4063
+ (_a = this._NE) === null || _a === void 0 ? void 0 : _a.query(range, check, res);
4064
+ (_b = this._NW) === null || _b === void 0 ? void 0 : _b.query(range, check, res);
4065
+ (_c = this._SE) === null || _c === void 0 ? void 0 : _c.query(range, check, res);
4066
+ (_d = this._SW) === null || _d === void 0 ? void 0 : _d.query(range, check, res);
4308
4067
  }
4309
4068
  return res;
4310
4069
  }
@@ -4335,20 +4094,6 @@ class QuadTree {
4335
4094
 
4336
4095
 
4337
4096
  class Particles {
4338
- container;
4339
- array;
4340
- lastZIndex;
4341
- limit;
4342
- movers;
4343
- needsSort;
4344
- pool;
4345
- pushing;
4346
- quadTree;
4347
- updaters;
4348
- zArray;
4349
- _engine;
4350
- interactionManager;
4351
- nextId;
4352
4097
  constructor(engine, container) {
4353
4098
  this.container = container;
4354
4099
  this._engine = engine;
@@ -4422,6 +4167,7 @@ class Particles {
4422
4167
  this.interactionManager.handleClickMode(mode);
4423
4168
  }
4424
4169
  init() {
4170
+ var _a;
4425
4171
  const container = this.container,
4426
4172
  options = container.actualOptions;
4427
4173
  this.lastZIndex = 0;
@@ -4445,7 +4191,7 @@ class Particles {
4445
4191
  if (!handled) {
4446
4192
  for (const group in options.particles.groups) {
4447
4193
  const groupOptions = options.particles.groups[group];
4448
- for (let i = this.count, j = 0; j < groupOptions.number?.value && i < options.particles.number.value; i++, j++) {
4194
+ 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++, j++) {
4449
4195
  this.addParticle(undefined, groupOptions, group);
4450
4196
  }
4451
4197
  }
@@ -4457,7 +4203,7 @@ class Particles {
4457
4203
  push(nb, mouse, overrideOptions, group) {
4458
4204
  this.pushing = true;
4459
4205
  for (let i = 0; i < nb; i++) {
4460
- this.addParticle(mouse?.position, overrideOptions, group);
4206
+ this.addParticle(mouse === null || mouse === void 0 ? void 0 : mouse.position, overrideOptions, group);
4461
4207
  }
4462
4208
  this.pushing = false;
4463
4209
  }
@@ -4507,13 +4253,14 @@ class Particles {
4507
4253
  this._applyDensity(options.particles, options.manualParticles.length);
4508
4254
  }
4509
4255
  async update(delta) {
4256
+ var _a, _b;
4510
4257
  const container = this.container,
4511
4258
  particlesToDelete = [];
4512
4259
  for (const [, pathGenerator] of container.pathGenerators) {
4513
4260
  pathGenerator.update();
4514
4261
  }
4515
4262
  for (const [, plugin] of container.plugins) {
4516
- plugin.update?.(delta);
4263
+ (_a = plugin.update) === null || _a === void 0 ? void 0 : _a.call(plugin, delta);
4517
4264
  }
4518
4265
  for (const particle of this.array) {
4519
4266
  const resizeFactor = container.canvas.resizeFactor;
@@ -4529,7 +4276,7 @@ class Particles {
4529
4276
  if (particle.destroyed) {
4530
4277
  break;
4531
4278
  }
4532
- plugin.particleUpdate?.(particle, delta);
4279
+ (_b = plugin.particleUpdate) === null || _b === void 0 ? void 0 : _b.call(plugin, particle, delta);
4533
4280
  }
4534
4281
  for (const mover of this.movers) {
4535
4282
  if (mover.isEnabled(particle)) {
@@ -4557,7 +4304,8 @@ class Particles {
4557
4304
  delete container.canvas.resizeFactor;
4558
4305
  }
4559
4306
  _applyDensity(options, manualCount, group) {
4560
- if (!options.number.density?.enable) {
4307
+ var _a;
4308
+ if (!((_a = options.number.density) === null || _a === void 0 ? void 0 : _a.enable)) {
4561
4309
  return;
4562
4310
  }
4563
4311
  const numberOptions = options.number,
@@ -4617,12 +4365,6 @@ class Particles {
4617
4365
 
4618
4366
 
4619
4367
  class Retina {
4620
- container;
4621
- attractDistance;
4622
- maxSpeed;
4623
- pixelRatio;
4624
- reduceFactor;
4625
- sizeAnimationSpeed;
4626
4368
  constructor(container) {
4627
4369
  this.container = container;
4628
4370
  }
@@ -4686,38 +4428,6 @@ const defaultPathGeneratorKey = "default",
4686
4428
  update: () => {}
4687
4429
  };
4688
4430
  class Container {
4689
- id;
4690
- actualOptions;
4691
- canvas;
4692
- destroyed;
4693
- drawers;
4694
- duration;
4695
- fpsLimit;
4696
- frameManager;
4697
- interactivity;
4698
- lastFrameTime;
4699
- lifeTime;
4700
- pageHidden;
4701
- particles;
4702
- pathGenerators;
4703
- plugins;
4704
- responsiveMaxWidth;
4705
- retina;
4706
- smooth;
4707
- started;
4708
- zLayers;
4709
- _currentTheme;
4710
- _delay;
4711
- _delayTimeout;
4712
- _drawAnimationFrame;
4713
- _engine;
4714
- _eventListeners;
4715
- _firstStart;
4716
- _initialSourceOptions;
4717
- _intersectionObserver;
4718
- _options;
4719
- _paused;
4720
- _sourceOptions;
4721
4431
  constructor(engine, id, sourceOptions) {
4722
4432
  this.id = id;
4723
4433
  this._engine = engine;
@@ -4851,7 +4561,7 @@ class Container {
4851
4561
  if (!guardCheck(this) || !override && this.pathGenerators.has(key)) {
4852
4562
  return false;
4853
4563
  }
4854
- this.pathGenerators.set(key, generator ?? defaultPathGenerator);
4564
+ this.pathGenerators.set(key, generator !== null && generator !== void 0 ? generator : defaultPathGenerator);
4855
4565
  return true;
4856
4566
  }
4857
4567
  destroy() {
@@ -4904,7 +4614,7 @@ class Container {
4904
4614
  exportImage(callback, type, quality) {
4905
4615
  const element = this.canvas.element;
4906
4616
  if (element) {
4907
- element.toBlob(callback, type ?? "image/png", quality);
4617
+ element.toBlob(callback, type !== null && type !== void 0 ? type : "image/png", quality);
4908
4618
  }
4909
4619
  }
4910
4620
  exportImg(callback) {
@@ -5054,9 +4764,7 @@ class Container {
5054
4764
  if (!pathOrGenerator || !guardCheck(this)) {
5055
4765
  return;
5056
4766
  }
5057
- const pathGenerator = {
5058
- ...defaultPathGenerator
5059
- };
4767
+ const pathGenerator = Object.assign({}, defaultPathGenerator);
5060
4768
  if (typeof pathOrGenerator === "function") {
5061
4769
  pathGenerator.generate = pathOrGenerator;
5062
4770
  if (init) {
@@ -5170,7 +4878,6 @@ async function getDataFromUrl(jsonUrl, index) {
5170
4878
  fetchError(response.status);
5171
4879
  }
5172
4880
  class Loader {
5173
- _engine;
5174
4881
  constructor(engine) {
5175
4882
  this._engine = engine;
5176
4883
  }
@@ -5187,7 +4894,7 @@ class Loader {
5187
4894
  if (typeof options === "number") {
5188
4895
  params.index = options;
5189
4896
  } else {
5190
- params.options = options ?? params.options;
4897
+ params.options = options !== null && options !== void 0 ? options : params.options;
5191
4898
  }
5192
4899
  return this.loadOptions(params);
5193
4900
  }
@@ -5207,18 +4914,19 @@ class Loader {
5207
4914
  });
5208
4915
  }
5209
4916
  async loadOptions(params) {
5210
- const tagId = params.tagId ?? `tsparticles${Math.floor(getRandom() * 10000)}`,
4917
+ var _a, _b, _c;
4918
+ const tagId = (_a = params.tagId) !== null && _a !== void 0 ? _a : `tsparticles${Math.floor(getRandom() * 10000)}`,
5211
4919
  {
5212
4920
  index,
5213
4921
  url: jsonUrl,
5214
4922
  remote
5215
4923
  } = params,
5216
4924
  options = remote ? await getDataFromUrl(jsonUrl, index) : params.options;
5217
- let domContainer = params.element ?? document.getElementById(tagId);
4925
+ let domContainer = (_b = params.element) !== null && _b !== void 0 ? _b : document.getElementById(tagId);
5218
4926
  if (!domContainer) {
5219
4927
  domContainer = document.createElement("div");
5220
4928
  domContainer.id = tagId;
5221
- document.querySelector("body")?.append(domContainer);
4929
+ (_c = document.querySelector("body")) === null || _c === void 0 ? void 0 : _c.append(domContainer);
5222
4930
  }
5223
4931
  const currentOptions = itemFromSingleOrMultiple(options, index),
5224
4932
  dom = this._engine.dom(),
@@ -5282,7 +4990,7 @@ class Loader {
5282
4990
  if (typeof options === "number") {
5283
4991
  params.index = options;
5284
4992
  } else {
5285
- params.options = options ?? params.options;
4993
+ params.options = options !== null && options !== void 0 ? options : params.options;
5286
4994
  }
5287
4995
  return this.loadOptions(params);
5288
4996
  }
@@ -5317,15 +5025,6 @@ function getItemsFromInitializer(container, map, initializers, force = false) {
5317
5025
  return res;
5318
5026
  }
5319
5027
  class Plugins {
5320
- drawers;
5321
- interactors;
5322
- movers;
5323
- pathGenerators;
5324
- plugins;
5325
- presets;
5326
- updaters;
5327
- _engine;
5328
- _initializers;
5329
5028
  constructor(engine) {
5330
5029
  this._engine = engine;
5331
5030
  this.plugins = [];
@@ -5431,11 +5130,6 @@ class Plugins {
5431
5130
 
5432
5131
 
5433
5132
  class Engine {
5434
- plugins;
5435
- _domArray;
5436
- _eventDispatcher;
5437
- _initialized;
5438
- _loader;
5439
5133
  constructor() {
5440
5134
  this._domArray = [];
5441
5135
  this._eventDispatcher = new EventDispatcher();
@@ -5541,22 +5235,22 @@ class Engine {
5541
5235
 
5542
5236
 
5543
5237
  class HslColorManager {
5544
- key;
5545
- stringPrefix;
5546
5238
  constructor() {
5547
5239
  this.key = "hsl";
5548
5240
  this.stringPrefix = "hsl";
5549
5241
  }
5550
5242
  handleColor(color) {
5243
+ var _a;
5551
5244
  const colorValue = color.value,
5552
- hslColor = colorValue.hsl ?? color.value;
5245
+ hslColor = (_a = colorValue.hsl) !== null && _a !== void 0 ? _a : color.value;
5553
5246
  if (hslColor.h !== undefined && hslColor.l !== undefined) {
5554
5247
  return hslToRgb(hslColor);
5555
5248
  }
5556
5249
  }
5557
5250
  handleRangeColor(color) {
5251
+ var _a;
5558
5252
  const colorValue = color.value,
5559
- hslColor = colorValue.hsl ?? color.value;
5253
+ hslColor = (_a = colorValue.hsl) !== null && _a !== void 0 ? _a : color.value;
5560
5254
  if (hslColor.h !== undefined && hslColor.l !== undefined) {
5561
5255
  return hslToRgb({
5562
5256
  h: getRangeValue(hslColor.h),
@@ -5582,22 +5276,22 @@ class HslColorManager {
5582
5276
  ;// CONCATENATED MODULE: ../../engine/dist/esm/Utils/RgbColorManager.js
5583
5277
 
5584
5278
  class RgbColorManager {
5585
- key;
5586
- stringPrefix;
5587
5279
  constructor() {
5588
5280
  this.key = "rgb";
5589
5281
  this.stringPrefix = "rgb";
5590
5282
  }
5591
5283
  handleColor(color) {
5284
+ var _a;
5592
5285
  const colorValue = color.value,
5593
- rgbColor = colorValue.rgb ?? color.value;
5286
+ rgbColor = (_a = colorValue.rgb) !== null && _a !== void 0 ? _a : color.value;
5594
5287
  if (rgbColor.r !== undefined) {
5595
5288
  return rgbColor;
5596
5289
  }
5597
5290
  }
5598
5291
  handleRangeColor(color) {
5292
+ var _a;
5599
5293
  const colorValue = color.value,
5600
- rgbColor = colorValue.rgb ?? color.value;
5294
+ rgbColor = (_a = colorValue.rgb) !== null && _a !== void 0 ? _a : color.value;
5601
5295
  if (rgbColor.r !== undefined) {
5602
5296
  return {
5603
5297
  r: getRangeValue(rgbColor.r),
@@ -5622,18 +5316,16 @@ class RgbColorManager {
5622
5316
  }
5623
5317
  ;// CONCATENATED MODULE: ../../engine/dist/esm/Core/Utils/ExternalInteractorBase.js
5624
5318
  class ExternalInteractorBase {
5625
- container;
5626
- type = 0;
5627
5319
  constructor(container) {
5628
5320
  this.container = container;
5321
+ this.type = 0;
5629
5322
  }
5630
5323
  }
5631
5324
  ;// CONCATENATED MODULE: ../../engine/dist/esm/Core/Utils/ParticlesInteractorBase.js
5632
5325
  class ParticlesInteractorBase {
5633
- container;
5634
- type = 1;
5635
5326
  constructor(container) {
5636
5327
  this.container = container;
5328
+ this.type = 1;
5637
5329
  }
5638
5330
  }
5639
5331
  ;// CONCATENATED MODULE: ../../engine/dist/esm/index.js