@tsparticles/stencil 4.1.3 → 4.2.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.
- package/README.md +13 -0
- package/dist/cjs/{Container-0BqPfTsu.js → Container-CGxn4Tv3.js} +659 -1010
- package/dist/cjs/{index-Bw7g3biq.js → index-7q-LddLf.js} +57 -160
- package/dist/cjs/{index-B2lLThjb.js → index-BjS63OiI.js} +95 -5
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/stencil-particles.cjs.entry.js +23 -6
- package/dist/cjs/tsparticlesstencil.cjs.js +2 -2
- package/dist/collection/components/stencil-particles/stencil-particles.js +83 -4
- package/dist/esm/{Container-BxLt611H.js → Container-BWWTh10Z.js} +659 -1010
- package/dist/esm/{index-DKFk70aj.js → index-PhwiK2_P.js} +95 -6
- package/dist/esm/{index-BXzC9NH1.js → index-aPxdqzSw.js} +57 -160
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/stencil-particles.entry.js +23 -6
- package/dist/esm/tsparticlesstencil.js +3 -3
- package/dist/tsparticlesstencil/index.esm.js +1 -1
- package/dist/tsparticlesstencil/p-FNL2LsWF.js +1 -0
- package/dist/tsparticlesstencil/p-PBQ5N1xQ.js +1 -0
- package/dist/tsparticlesstencil/p-PhwiK2_P.js +2 -0
- package/dist/tsparticlesstencil/p-e16c4912.entry.js +1 -0
- package/dist/tsparticlesstencil/tsparticlesstencil.esm.js +1 -1
- package/dist/types/components/stencil-particles/stencil-particles.d.ts +6 -2
- package/dist/types/components.d.ts +24 -2
- package/package.json +8 -7
- package/dist/tsparticlesstencil/p-BhGs05ap.js +0 -1
- package/dist/tsparticlesstencil/p-DKFk70aj.js +0 -2
- package/dist/tsparticlesstencil/p-LyLjQmWv.js +0 -1
- package/dist/tsparticlesstencil/p-cf6e2424.entry.js +0 -1
|
@@ -82,6 +82,7 @@ var registerHost = (hostElement, cmpMeta) => {
|
|
|
82
82
|
hostElement.__stencil__getHostRef = () => ref;
|
|
83
83
|
return ref;
|
|
84
84
|
};
|
|
85
|
+
var isMemberInElement = (elm, memberName) => memberName in elm;
|
|
85
86
|
var consoleError = (e, el) => (0, console.error)(e, el);
|
|
86
87
|
|
|
87
88
|
// src/client/client-load-module.ts
|
|
@@ -289,6 +290,25 @@ var parsePropertyValue = (propValue, propType, isFormAssociated) => {
|
|
|
289
290
|
}
|
|
290
291
|
return propValue;
|
|
291
292
|
};
|
|
293
|
+
var getElement = (ref) => {
|
|
294
|
+
var _a;
|
|
295
|
+
return (_a = getHostRef(ref)) == null ? void 0 : _a.$hostElement$ ;
|
|
296
|
+
};
|
|
297
|
+
|
|
298
|
+
// src/runtime/event-emitter.ts
|
|
299
|
+
var createEvent = (ref, name, flags) => {
|
|
300
|
+
const elm = getElement(ref);
|
|
301
|
+
return {
|
|
302
|
+
emit: (detail) => {
|
|
303
|
+
return emitEvent(elm, name, {
|
|
304
|
+
bubbles: true,
|
|
305
|
+
composed: true,
|
|
306
|
+
cancelable: true,
|
|
307
|
+
detail
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
};
|
|
311
|
+
};
|
|
292
312
|
var emitEvent = (elm, name, opts) => {
|
|
293
313
|
const ev = plt.ce(name, opts);
|
|
294
314
|
elm.dispatchEvent(ev);
|
|
@@ -298,6 +318,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
|
|
|
298
318
|
if (oldValue === newValue) {
|
|
299
319
|
return;
|
|
300
320
|
}
|
|
321
|
+
let isProp = isMemberInElement(elm, memberName);
|
|
301
322
|
memberName.toLowerCase();
|
|
302
323
|
if (memberName === "style") {
|
|
303
324
|
{
|
|
@@ -324,7 +345,70 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
|
|
|
324
345
|
if (newValue) {
|
|
325
346
|
queueRefAttachment(newValue, elm);
|
|
326
347
|
}
|
|
327
|
-
} else
|
|
348
|
+
} else if (memberName[0] === "a" && memberName.startsWith("attr:")) {
|
|
349
|
+
const propName = memberName.slice(5);
|
|
350
|
+
let attrName;
|
|
351
|
+
{
|
|
352
|
+
const hostRef = getHostRef(elm);
|
|
353
|
+
if (hostRef && hostRef.$cmpMeta$ && hostRef.$cmpMeta$.$members$) {
|
|
354
|
+
const memberMeta = hostRef.$cmpMeta$.$members$[propName];
|
|
355
|
+
if (memberMeta && memberMeta[1]) {
|
|
356
|
+
attrName = memberMeta[1];
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
if (!attrName) {
|
|
361
|
+
attrName = propName.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
362
|
+
}
|
|
363
|
+
if (newValue == null || newValue === false) {
|
|
364
|
+
if (newValue !== false || elm.getAttribute(attrName) === "") {
|
|
365
|
+
elm.removeAttribute(attrName);
|
|
366
|
+
}
|
|
367
|
+
} else {
|
|
368
|
+
elm.setAttribute(attrName, newValue === true ? "" : newValue);
|
|
369
|
+
}
|
|
370
|
+
return;
|
|
371
|
+
} else if (memberName[0] === "p" && memberName.startsWith("prop:")) {
|
|
372
|
+
const propName = memberName.slice(5);
|
|
373
|
+
try {
|
|
374
|
+
elm[propName] = newValue;
|
|
375
|
+
} catch (e) {
|
|
376
|
+
}
|
|
377
|
+
return;
|
|
378
|
+
} else {
|
|
379
|
+
const isComplex = isComplexType(newValue);
|
|
380
|
+
if ((isProp || isComplex && newValue !== null) && !isSvg) {
|
|
381
|
+
try {
|
|
382
|
+
if (!elm.tagName.includes("-")) {
|
|
383
|
+
const n = newValue == null ? "" : newValue;
|
|
384
|
+
if (memberName === "list") {
|
|
385
|
+
isProp = false;
|
|
386
|
+
} else if (oldValue == null || elm[memberName] !== n) {
|
|
387
|
+
if (typeof elm.__lookupSetter__(memberName) === "function") {
|
|
388
|
+
elm[memberName] = n;
|
|
389
|
+
} else {
|
|
390
|
+
elm.setAttribute(memberName, n);
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
} else if (elm[memberName] !== newValue) {
|
|
394
|
+
elm[memberName] = newValue;
|
|
395
|
+
}
|
|
396
|
+
} catch (e) {
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
if (newValue == null || newValue === false) {
|
|
400
|
+
if (newValue !== false || elm.getAttribute(memberName) === "") {
|
|
401
|
+
{
|
|
402
|
+
elm.removeAttribute(memberName);
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
} else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex && elm.nodeType === 1 /* ElementNode */) {
|
|
406
|
+
newValue = newValue === true ? "" : newValue;
|
|
407
|
+
{
|
|
408
|
+
elm.setAttribute(memberName, newValue);
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
}
|
|
328
412
|
};
|
|
329
413
|
|
|
330
414
|
// src/runtime/vdom/update-element.ts
|
|
@@ -339,7 +423,9 @@ var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
|
|
|
339
423
|
elm,
|
|
340
424
|
memberName,
|
|
341
425
|
oldVnodeAttrs[memberName],
|
|
342
|
-
void 0
|
|
426
|
+
void 0,
|
|
427
|
+
isSvgMode2,
|
|
428
|
+
newVnode.$flags$);
|
|
343
429
|
}
|
|
344
430
|
}
|
|
345
431
|
}
|
|
@@ -348,7 +434,9 @@ var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
|
|
|
348
434
|
elm,
|
|
349
435
|
memberName,
|
|
350
436
|
oldVnodeAttrs[memberName],
|
|
351
|
-
newVnodeAttrs[memberName]
|
|
437
|
+
newVnodeAttrs[memberName],
|
|
438
|
+
isSvgMode2,
|
|
439
|
+
newVnode.$flags$);
|
|
352
440
|
}
|
|
353
441
|
};
|
|
354
442
|
function sortedAttrNames(attrNames) {
|
|
@@ -361,6 +449,7 @@ function sortedAttrNames(attrNames) {
|
|
|
361
449
|
);
|
|
362
450
|
}
|
|
363
451
|
var hostTagName;
|
|
452
|
+
var isSvgMode = false;
|
|
364
453
|
var refCallbacksToRemove = [];
|
|
365
454
|
var refCallbacksToAttach = [];
|
|
366
455
|
var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
@@ -376,7 +465,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
|
376
465
|
newVNode2.$tag$
|
|
377
466
|
);
|
|
378
467
|
{
|
|
379
|
-
updateElement(null, newVNode2);
|
|
468
|
+
updateElement(null, newVNode2, isSvgMode);
|
|
380
469
|
}
|
|
381
470
|
if (newVNode2.$children$) {
|
|
382
471
|
const appendTarget = newVNode2.$tag$ === "template" ? elm.content : elm;
|
|
@@ -522,7 +611,7 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
522
611
|
const newChildren = newVNode2.$children$;
|
|
523
612
|
{
|
|
524
613
|
{
|
|
525
|
-
updateElement(oldVNode, newVNode2);
|
|
614
|
+
updateElement(oldVNode, newVNode2, isSvgMode);
|
|
526
615
|
}
|
|
527
616
|
if (oldChildren !== null && newChildren !== null) {
|
|
528
617
|
updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
|
|
@@ -1220,4 +1309,4 @@ function transformTag(tag) {
|
|
|
1220
1309
|
return tag;
|
|
1221
1310
|
}
|
|
1222
1311
|
|
|
1223
|
-
export { bootstrapLazy as b, h, promiseResolve as p, registerInstance as r, setNonce as s };
|
|
1312
|
+
export { bootstrapLazy as b, createEvent as c, h, promiseResolve as p, registerInstance as r, setNonce as s };
|
|
@@ -7,7 +7,7 @@ const generatedAttribute = "generated", defaultCompositeValue = "source-over", r
|
|
|
7
7
|
b: 0,
|
|
8
8
|
c: 0,
|
|
9
9
|
d: 1,
|
|
10
|
-
}, randomColorValue = "random", double = 2, doublePI = Math.PI * double, defaultFps = 60, generatedTrue = "true", generatedFalse = "false", canvasTag = "canvas", defaultRetryCount = 0, squareExp = 2, spatialHashGridCellSize = 100, defaultRemoveQuantity = 1, defaultRatio = 1, defaultReduceFactor = 1, inverseFactorNumerator = 1, rgbMax = 255, hMax = 360, sMax = 100, lMax = 100, hMin = 0, sMin = 0, hPhase = 60, empty = 0, quarter = 0.25, threeQuarter = half + quarter, defaultTransformValue = 1, minimumSize = 0, zIndexFactorOffset = 1, defaultOpacity = 1, removeDeleteCount = 1, removeMinIndex = 0, defaultFpsLimit = 120, minFpsLimit = 0, canvasFirstIndex = 0, loadRandomFactor = 10000, loadMinIndex = 0, one = 1, none = 0, tryCountIncrement = 1, minZ = 0, minLimit = 0, countOffset = 1, minCount = 0, minIndex = 0, defaultDensityFactor = 1, deleteCount = 1, defaultAngle = 0, identity = 1, minStrokeWidth = 0, lFactor = 1, lMin = 0, triple = 3, sextuple = 6, sNormalizedOffset = 1, phaseNumerator = 1, defaultRgbMin = 0, defaultZoom = 1;
|
|
10
|
+
}, randomColorValue = "random", double = 2, doublePI = Math.PI * double, defaultFps = 60, generatedTrue = "true", generatedFalse = "false", canvasTag = "canvas", defaultRetryCount = 0, squareExp = 2, spatialHashGridCellSize = 100, defaultRemoveQuantity = 1, defaultRatio = 1, defaultReduceFactor = 1, inverseFactorNumerator = 1, rgbMax = 255, hMax = 360, sMax = 100, lMax = 100, hMin = 0, sMin = 0, hPhase = 60, empty = 0, quarter = 0.25, threeQuarter = half + quarter, defaultTransformValue = 1, minimumSize = 0, zIndexFactorOffset = 1, defaultOpacity = 1, removeDeleteCount = 1, removeMinIndex = 0, defaultFpsLimit = 120, minFpsLimit = 0, canvasFirstIndex = 0, loadRandomFactor = 10000, loadMinIndex = 0, one = 1, none = 0, tryCountIncrement = 1, minZ = 0, minLimit = 0, countOffset = 1, minCount = 0, minIndex = 0, defaultDensityFactor = 1, deleteCount = 1, defaultAngle = 0, identity = 1, minStrokeWidth = 0, lFactor = 1, lMin = 0, maxNits = 400, triple = 3, sextuple = 6, sNormalizedOffset = 1, phaseNumerator = 1, defaultRgbMin = 0, defaultZoom = 1;
|
|
11
11
|
|
|
12
12
|
var MoveDirection;
|
|
13
13
|
(function (MoveDirection) {
|
|
@@ -74,11 +74,6 @@ class Vector3d {
|
|
|
74
74
|
div(n) {
|
|
75
75
|
return Vector3d.create(this.x / n, this.y / n, this.z / n);
|
|
76
76
|
}
|
|
77
|
-
divTo(n) {
|
|
78
|
-
this.x /= n;
|
|
79
|
-
this.y /= n;
|
|
80
|
-
this.z /= n;
|
|
81
|
-
}
|
|
82
77
|
getLengthSq() {
|
|
83
78
|
return this.x ** squareExp + this.y ** squareExp;
|
|
84
79
|
}
|
|
@@ -260,27 +255,6 @@ function calcExactPositionOrRandomFromSize(data) {
|
|
|
260
255
|
};
|
|
261
256
|
}
|
|
262
257
|
|
|
263
|
-
var AnimationMode;
|
|
264
|
-
(function (AnimationMode) {
|
|
265
|
-
AnimationMode["auto"] = "auto";
|
|
266
|
-
AnimationMode["increase"] = "increase";
|
|
267
|
-
AnimationMode["decrease"] = "decrease";
|
|
268
|
-
AnimationMode["random"] = "random";
|
|
269
|
-
})(AnimationMode || (AnimationMode = {}));
|
|
270
|
-
|
|
271
|
-
var AnimationStatus;
|
|
272
|
-
(function (AnimationStatus) {
|
|
273
|
-
AnimationStatus["increasing"] = "increasing";
|
|
274
|
-
AnimationStatus["decreasing"] = "decreasing";
|
|
275
|
-
})(AnimationStatus || (AnimationStatus = {}));
|
|
276
|
-
|
|
277
|
-
var DestroyType;
|
|
278
|
-
(function (DestroyType) {
|
|
279
|
-
DestroyType["none"] = "none";
|
|
280
|
-
DestroyType["max"] = "max";
|
|
281
|
-
DestroyType["min"] = "min";
|
|
282
|
-
})(DestroyType || (DestroyType = {}));
|
|
283
|
-
|
|
284
258
|
var OutModeDirection;
|
|
285
259
|
(function (OutModeDirection) {
|
|
286
260
|
OutModeDirection["bottom"] = "bottom";
|
|
@@ -295,66 +269,6 @@ var PixelMode;
|
|
|
295
269
|
PixelMode["percent"] = "percent";
|
|
296
270
|
})(PixelMode || (PixelMode = {}));
|
|
297
271
|
|
|
298
|
-
var StartValueType;
|
|
299
|
-
(function (StartValueType) {
|
|
300
|
-
StartValueType["max"] = "max";
|
|
301
|
-
StartValueType["min"] = "min";
|
|
302
|
-
StartValueType["random"] = "random";
|
|
303
|
-
})(StartValueType || (StartValueType = {}));
|
|
304
|
-
|
|
305
|
-
function memoize(fn, options) {
|
|
306
|
-
const cache = new Map(), keyFn = options?.keyFn, stableStringify = (obj, seen = new WeakSet()) => {
|
|
307
|
-
if (obj === null) {
|
|
308
|
-
return "null";
|
|
309
|
-
}
|
|
310
|
-
const t = typeof obj;
|
|
311
|
-
if (t === "undefined") {
|
|
312
|
-
return "undefined";
|
|
313
|
-
}
|
|
314
|
-
if (t === "number" || t === "boolean" || t === "string") {
|
|
315
|
-
return JSON.stringify(obj);
|
|
316
|
-
}
|
|
317
|
-
if (t === "function") {
|
|
318
|
-
try {
|
|
319
|
-
const fn = obj;
|
|
320
|
-
return fn.toString();
|
|
321
|
-
}
|
|
322
|
-
catch {
|
|
323
|
-
return '"[Function]"';
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
if (t === "symbol") {
|
|
327
|
-
try {
|
|
328
|
-
return obj.toString();
|
|
329
|
-
}
|
|
330
|
-
catch {
|
|
331
|
-
return '"[Symbol]"';
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
if (Array.isArray(obj)) {
|
|
335
|
-
return `[${obj.map(i => stableStringify(i, seen)).join(",")}]`;
|
|
336
|
-
}
|
|
337
|
-
if (seen.has(obj)) {
|
|
338
|
-
return '"[Circular]"';
|
|
339
|
-
}
|
|
340
|
-
seen.add(obj);
|
|
341
|
-
const keys = Object.keys(obj).sort();
|
|
342
|
-
return `{${keys.map(k => `${JSON.stringify(k)}:${stableStringify(obj[k], seen)}`).join(",")}}`;
|
|
343
|
-
}, defaultKeyer = (args) => stableStringify(args), makeKey = (args) => (keyFn ? keyFn(args) : defaultKeyer(args));
|
|
344
|
-
return (...args) => {
|
|
345
|
-
const key = makeKey(args), now = Date.now(), entry = cache.get(key);
|
|
346
|
-
if (entry !== undefined) {
|
|
347
|
-
{
|
|
348
|
-
cache.delete(key);
|
|
349
|
-
cache.set(key, { value: entry.value, ts: entry.ts });
|
|
350
|
-
return entry.value;
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
const result = fn(...args);
|
|
354
|
-
cache.set(key, { value: result, ts: now });
|
|
355
|
-
return result;
|
|
356
|
-
};
|
|
357
|
-
}
|
|
358
272
|
function hasMatchMedia() {
|
|
359
273
|
return typeof matchMedia !== "undefined";
|
|
360
274
|
}
|
|
@@ -376,11 +290,8 @@ function safeMutationObserver(callback) {
|
|
|
376
290
|
function isInArray(value, array) {
|
|
377
291
|
return value === array || (isArray(array) && array.includes(value));
|
|
378
292
|
}
|
|
379
|
-
function arrayRandomIndex(array) {
|
|
380
|
-
return Math.floor(getRandom() * array.length);
|
|
381
|
-
}
|
|
382
293
|
function itemFromArray(array, index, useIndex = true) {
|
|
383
|
-
return array[index !== undefined && useIndex ? index % array.length :
|
|
294
|
+
return array[index !== undefined && useIndex ? index % array.length : Math.floor(getRandom() * array.length)];
|
|
384
295
|
}
|
|
385
296
|
function deepExtend(destination, ...sources) {
|
|
386
297
|
for (const source of sources) {
|
|
@@ -481,30 +392,34 @@ function cloneStyle(style) {
|
|
|
481
392
|
}
|
|
482
393
|
return clonedStyle;
|
|
483
394
|
}
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
395
|
+
let _cachedZIndex, _cachedStyle;
|
|
396
|
+
function getFullScreenStyle(zIndex) {
|
|
397
|
+
if (_cachedZIndex !== zIndex || !_cachedStyle) {
|
|
398
|
+
_cachedZIndex = zIndex;
|
|
399
|
+
const fullScreenStyle = safeDocument().createElement("div").style, radix = 10, style = {
|
|
400
|
+
width: "100%",
|
|
401
|
+
height: "100%",
|
|
402
|
+
margin: "0",
|
|
403
|
+
padding: "0",
|
|
404
|
+
borderWidth: "0",
|
|
405
|
+
position: "fixed",
|
|
406
|
+
zIndex: zIndex.toString(radix),
|
|
407
|
+
"z-index": zIndex.toString(radix),
|
|
408
|
+
top: "0",
|
|
409
|
+
left: "0",
|
|
410
|
+
"pointer-events": "none",
|
|
411
|
+
};
|
|
412
|
+
for (const key in style) {
|
|
413
|
+
const value = style[key];
|
|
414
|
+
if (value === undefined) {
|
|
415
|
+
continue;
|
|
416
|
+
}
|
|
417
|
+
fullScreenStyle.setProperty(key, value);
|
|
502
418
|
}
|
|
503
|
-
fullScreenStyle
|
|
419
|
+
_cachedStyle = fullScreenStyle;
|
|
504
420
|
}
|
|
505
|
-
return
|
|
421
|
+
return _cachedStyle;
|
|
506
422
|
}
|
|
507
|
-
const getFullScreenStyle = memoize(computeFullScreenStyle);
|
|
508
423
|
function manageListener(element, event, handler, add, options) {
|
|
509
424
|
if (add) {
|
|
510
425
|
let addOptions = { passive: true };
|
|
@@ -831,7 +746,7 @@ class Engine {
|
|
|
831
746
|
return this.#domArray;
|
|
832
747
|
}
|
|
833
748
|
get version() {
|
|
834
|
-
return "4.
|
|
749
|
+
return "4.2.0";
|
|
835
750
|
}
|
|
836
751
|
addEventListener(type, listener) {
|
|
837
752
|
this.#eventDispatcher.addEventListener(type, listener);
|
|
@@ -866,7 +781,7 @@ class Engine {
|
|
|
866
781
|
if (typeof HTMLElement !== "undefined" && params.element instanceof HTMLElement) {
|
|
867
782
|
domSourceElement = params.element;
|
|
868
783
|
}
|
|
869
|
-
const { Container } = await import('./Container-
|
|
784
|
+
const { Container } = await import('./Container-BWWTh10Z.js'), id = params.id ?? domSourceElement?.id ?? `tsparticles${Math.floor(getRandom() * loadRandomFactor).toString()}`, { index, url } = params, options = url ? await getDataFromUrl({ fallback: params.options, url, index }) : params.options, currentOptions = itemFromSingleOrMultiple(options, index), { items } = this, oldIndex = items.findIndex(v => v.id.description === id), newItem = new Container({
|
|
870
785
|
dispatchCallback: (eventType, args) => {
|
|
871
786
|
this.dispatchEvent(eventType, args);
|
|
872
787
|
},
|
|
@@ -928,6 +843,14 @@ var RotateDirection;
|
|
|
928
843
|
RotateDirection["random"] = "random";
|
|
929
844
|
})(RotateDirection || (RotateDirection = {}));
|
|
930
845
|
|
|
846
|
+
var AnimationMode;
|
|
847
|
+
(function (AnimationMode) {
|
|
848
|
+
AnimationMode["auto"] = "auto";
|
|
849
|
+
AnimationMode["increase"] = "increase";
|
|
850
|
+
AnimationMode["decrease"] = "decrease";
|
|
851
|
+
AnimationMode["random"] = "random";
|
|
852
|
+
})(AnimationMode || (AnimationMode = {}));
|
|
853
|
+
|
|
931
854
|
var LimitMode;
|
|
932
855
|
(function (LimitMode) {
|
|
933
856
|
LimitMode["delete"] = "delete";
|
|
@@ -949,6 +872,13 @@ var AlterType;
|
|
|
949
872
|
AlterType["enlighten"] = "enlighten";
|
|
950
873
|
})(AlterType || (AlterType = {}));
|
|
951
874
|
|
|
875
|
+
var DestroyType;
|
|
876
|
+
(function (DestroyType) {
|
|
877
|
+
DestroyType["none"] = "none";
|
|
878
|
+
DestroyType["max"] = "max";
|
|
879
|
+
DestroyType["min"] = "min";
|
|
880
|
+
})(DestroyType || (DestroyType = {}));
|
|
881
|
+
|
|
952
882
|
var GradientType;
|
|
953
883
|
(function (GradientType) {
|
|
954
884
|
GradientType["linear"] = "linear";
|
|
@@ -963,51 +893,18 @@ var ParticleOutType;
|
|
|
963
893
|
ParticleOutType["outside"] = "outside";
|
|
964
894
|
})(ParticleOutType || (ParticleOutType = {}));
|
|
965
895
|
|
|
966
|
-
var
|
|
967
|
-
(function (
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
EasingType["easeInQuint"] = "ease-in-quint";
|
|
979
|
-
EasingType["easeInSigmoid"] = "ease-in-sigmoid";
|
|
980
|
-
EasingType["easeInSine"] = "ease-in-sine";
|
|
981
|
-
EasingType["easeInSmoothstep"] = "ease-in-smoothstep";
|
|
982
|
-
EasingType["easeOutBack"] = "ease-out-back";
|
|
983
|
-
EasingType["easeOutBounce"] = "ease-out-bounce";
|
|
984
|
-
EasingType["easeOutCirc"] = "ease-out-circ";
|
|
985
|
-
EasingType["easeOutCubic"] = "ease-out-cubic";
|
|
986
|
-
EasingType["easeOutElastic"] = "ease-out-elastic";
|
|
987
|
-
EasingType["easeOutExpo"] = "ease-out-expo";
|
|
988
|
-
EasingType["easeOutGaussian"] = "ease-out-gaussian";
|
|
989
|
-
EasingType["easeOutLinear"] = "ease-out-linear";
|
|
990
|
-
EasingType["easeOutQuad"] = "ease-out-quad";
|
|
991
|
-
EasingType["easeOutQuart"] = "ease-out-quart";
|
|
992
|
-
EasingType["easeOutQuint"] = "ease-out-quint";
|
|
993
|
-
EasingType["easeOutSigmoid"] = "ease-out-sigmoid";
|
|
994
|
-
EasingType["easeOutSine"] = "ease-out-sine";
|
|
995
|
-
EasingType["easeOutSmoothstep"] = "ease-out-smoothstep";
|
|
996
|
-
EasingType["easeInOutBack"] = "ease-in-out-back";
|
|
997
|
-
EasingType["easeInOutBounce"] = "ease-in-out-bounce";
|
|
998
|
-
EasingType["easeInOutCirc"] = "ease-in-out-circ";
|
|
999
|
-
EasingType["easeInOutCubic"] = "ease-in-out-cubic";
|
|
1000
|
-
EasingType["easeInOutElastic"] = "ease-in-out-elastic";
|
|
1001
|
-
EasingType["easeInOutExpo"] = "ease-in-out-expo";
|
|
1002
|
-
EasingType["easeInOutGaussian"] = "ease-in-out-gaussian";
|
|
1003
|
-
EasingType["easeInOutLinear"] = "ease-in-out-linear";
|
|
1004
|
-
EasingType["easeInOutQuad"] = "ease-in-out-quad";
|
|
1005
|
-
EasingType["easeInOutQuart"] = "ease-in-out-quart";
|
|
1006
|
-
EasingType["easeInOutQuint"] = "ease-in-out-quint";
|
|
1007
|
-
EasingType["easeInOutSigmoid"] = "ease-in-out-sigmoid";
|
|
1008
|
-
EasingType["easeInOutSine"] = "ease-in-out-sine";
|
|
1009
|
-
EasingType["easeInOutSmoothstep"] = "ease-in-out-smoothstep";
|
|
1010
|
-
})(EasingType || (EasingType = {}));
|
|
896
|
+
var StartValueType;
|
|
897
|
+
(function (StartValueType) {
|
|
898
|
+
StartValueType["max"] = "max";
|
|
899
|
+
StartValueType["min"] = "min";
|
|
900
|
+
StartValueType["random"] = "random";
|
|
901
|
+
})(StartValueType || (StartValueType = {}));
|
|
902
|
+
|
|
903
|
+
var AnimationStatus;
|
|
904
|
+
(function (AnimationStatus) {
|
|
905
|
+
AnimationStatus["increasing"] = "increasing";
|
|
906
|
+
AnimationStatus["decreasing"] = "decreasing";
|
|
907
|
+
})(AnimationStatus || (AnimationStatus = {}));
|
|
1011
908
|
|
|
1012
909
|
const tsParticles = initEngine();
|
|
1013
910
|
|
|
@@ -1049,4 +946,4 @@ async function waitForParticlesEngineInitialization() {
|
|
|
1049
946
|
await (initPromise !== null && initPromise !== void 0 ? initPromise : Promise.resolve());
|
|
1050
947
|
}
|
|
1051
948
|
|
|
1052
|
-
export {
|
|
949
|
+
export { safeDocument as $, AlterType as A, rgbMax as B, getRandomInRange as C, identity as D, defaultRgbMin as E, maxNits as F, sextuple as G, triple as H, phaseNumerator as I, sNormalizedOffset as J, originPoint as K, LimitMode as L, MoveDirection as M, minimumSize as N, OutMode as O, PixelMode as P, defaultCompositeValue as Q, RangeType as R, minStrokeWidth as S, defaultZoom as T, zIndexFactorOffset as U, defaultTransformValue as V, safeMutationObserver as W, generatedAttribute as X, cloneStyle as Y, safeMatchMedia as Z, getFullScreenStyle as _, isNull as a, millisecondsToSeconds as a0, manageListener as a1, visibilityChangeEvent as a2, resizeEvent as a3, Vector3d as a4, EventType as a5, defaultAngle as a6, defaultTransform as a7, defaultRetryCount as a8, tryCountIncrement as a9, defaultRatio as aA, defaultReduceFactor as aB, animate as aC, defaultFpsLimit as aD, minFpsLimit as aE, cancelAnimation as aF, defaultFps as aG, isParticlesEngineInitialized as aH, waitForParticlesEngineInitialization as aI, getParticleBaseVelocity as aa, randomInRangeValue as ab, getRandom as ac, OutModeDirection as ad, clamp as ae, minZ as af, getPosition as ag, getParticleDirectionAngle as ah, ParticleOutType as ai, Vector as aj, getRangeValue as ak, calcExactPositionOrRandomFromSize as al, itemFromSingleOrMultiple as am, isInArray as an, doublePI as ao, degToRad as ap, spatialHashGridCellSize as aq, minLimit as ar, minCount as as, getLogger as at, minIndex as au, defaultRemoveQuantity as av, defaultDensityFactor as aw, deleteCount as ax, countOffset as ay, one as az, setRangeValue as b, checkDistance as c, hMax as d, lMax as e, sMin as f, sMax as g, hMin as h, initParticlesEngine as i, isString as j, isArray as k, lMin as l, deepExtend as m, isNumber as n, isObject as o, executeOnSingleOrMultiple as p, isBoolean as q, itemFromArray as r, squareExp as s, tsParticles as t, defaultOpacity as u, randomColorValue as v, lFactor as w, half as x, double as y, hPhase as z };
|
package/dist/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { i as initParticlesEngine, aH as isParticlesEngineInitialized, aI as waitForParticlesEngineInitialization } from './index-
|
|
1
|
+
export { i as initParticlesEngine, aH as isParticlesEngineInitialized, aI as waitForParticlesEngineInitialization } from './index-aPxdqzSw.js';
|
package/dist/esm/loader.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { b as bootstrapLazy } from './index-
|
|
2
|
-
export { s as setNonce } from './index-
|
|
1
|
+
import { b as bootstrapLazy } from './index-PhwiK2_P.js';
|
|
2
|
+
export { s as setNonce } from './index-PhwiK2_P.js';
|
|
3
3
|
import { g as globalScripts } from './app-globals-DQuL1Twl.js';
|
|
4
4
|
|
|
5
5
|
const defineCustomElements = async (win, options) => {
|
|
6
6
|
if (typeof window === 'undefined') return undefined;
|
|
7
7
|
await globalScripts();
|
|
8
|
-
return bootstrapLazy([["stencil-particles",[[0,"stencil-particles",{"options":[16],"url":[1],"init":[16]},null,{"options":[{"onPropsChange":0}],"url":[{"onPropsChange":0}],"init":[{"onPropsChange":0}]}]]]], options);
|
|
8
|
+
return bootstrapLazy([["stencil-particles",[[0,"stencil-particles",{"options":[16],"url":[1],"init":[16],"containerId":[1,"container-id"],"theme":[1]},null,{"options":[{"onPropsChange":0}],"url":[{"onPropsChange":0}],"init":[{"onPropsChange":0}],"containerId":[{"onPropsChange":0}],"theme":[{"onThemeChange":0}]}]]]], options);
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export { defineCustomElements };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { r as registerInstance, h } from './index-
|
|
2
|
-
import { i as initParticlesEngine, t as tsParticles } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h } from './index-PhwiK2_P.js';
|
|
2
|
+
import { i as initParticlesEngine, t as tsParticles } from './index-aPxdqzSw.js';
|
|
3
3
|
|
|
4
4
|
const StencilParticles = class {
|
|
5
5
|
constructor(hostRef) {
|
|
6
6
|
registerInstance(this, hostRef);
|
|
7
|
+
this.particlesLoaded = createEvent(this, "particlesLoaded");
|
|
7
8
|
this.renderId = 0;
|
|
8
9
|
}
|
|
9
10
|
async componentDidLoad() {
|
|
@@ -18,8 +19,14 @@ const StencilParticles = class {
|
|
|
18
19
|
async onPropsChange() {
|
|
19
20
|
await this.loadParticles(++this.renderId);
|
|
20
21
|
}
|
|
22
|
+
async onThemeChange() {
|
|
23
|
+
var _a, _b;
|
|
24
|
+
if (!this.container)
|
|
25
|
+
return;
|
|
26
|
+
(_b = (_a = this.container).loadTheme) === null || _b === void 0 ? void 0 : _b.call(_a, this.theme);
|
|
27
|
+
}
|
|
21
28
|
async loadParticles(currentRenderId) {
|
|
22
|
-
var _a;
|
|
29
|
+
var _a, _b, _c;
|
|
23
30
|
(_a = this.container) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
24
31
|
if (!this.containerElement) {
|
|
25
32
|
console.warn("[stencil-particles] container element not available yet");
|
|
@@ -38,8 +45,8 @@ const StencilParticles = class {
|
|
|
38
45
|
return;
|
|
39
46
|
}
|
|
40
47
|
// Load particles directly onto the DOM element.
|
|
41
|
-
//
|
|
42
|
-
const loadParams = Object.assign({ element: this.containerElement }, (this.options ? { options: this.options } : { url: this.url }));
|
|
48
|
+
// If a container-id is provided, use it so consumers can retrieve the container later.
|
|
49
|
+
const loadParams = Object.assign(Object.assign({ element: this.containerElement }, (this.containerId ? { id: this.containerId } : {})), (this.options ? { options: this.options } : { url: this.url }));
|
|
43
50
|
container = await tsParticles.load(loadParams);
|
|
44
51
|
}
|
|
45
52
|
catch (error) {
|
|
@@ -52,9 +59,13 @@ const StencilParticles = class {
|
|
|
52
59
|
return;
|
|
53
60
|
}
|
|
54
61
|
this.container = container;
|
|
62
|
+
this.particlesLoaded.emit(container);
|
|
63
|
+
if (container && this.theme) {
|
|
64
|
+
(_c = (_b = container).loadTheme) === null || _c === void 0 ? void 0 : _c.call(_b, this.theme);
|
|
65
|
+
}
|
|
55
66
|
}
|
|
56
67
|
render() {
|
|
57
|
-
return (h("div", { key: '
|
|
68
|
+
return (h("div", { key: 'f5fe33d147a1a606a75fe0d1ee385bacaf0e0b7d', id: this.containerId, ref: el => {
|
|
58
69
|
this.containerElement = el;
|
|
59
70
|
}, style: { width: "100%", height: "100%" } }));
|
|
60
71
|
}
|
|
@@ -67,6 +78,12 @@ const StencilParticles = class {
|
|
|
67
78
|
}],
|
|
68
79
|
"init": [{
|
|
69
80
|
"onPropsChange": 0
|
|
81
|
+
}],
|
|
82
|
+
"containerId": [{
|
|
83
|
+
"onPropsChange": 0
|
|
84
|
+
}],
|
|
85
|
+
"theme": [{
|
|
86
|
+
"onThemeChange": 0
|
|
70
87
|
}]
|
|
71
88
|
}; }
|
|
72
89
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
2
|
-
export { s as setNonce } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-PhwiK2_P.js';
|
|
2
|
+
export { s as setNonce } from './index-PhwiK2_P.js';
|
|
3
3
|
import { g as globalScripts } from './app-globals-DQuL1Twl.js';
|
|
4
4
|
|
|
5
5
|
/*
|
|
@@ -17,5 +17,5 @@ var patchBrowser = () => {
|
|
|
17
17
|
|
|
18
18
|
patchBrowser().then(async (options) => {
|
|
19
19
|
await globalScripts();
|
|
20
|
-
return bootstrapLazy([["stencil-particles",[[0,"stencil-particles",{"options":[16],"url":[1],"init":[16]},null,{"options":[{"onPropsChange":0}],"url":[{"onPropsChange":0}],"init":[{"onPropsChange":0}]}]]]], options);
|
|
20
|
+
return bootstrapLazy([["stencil-particles",[[0,"stencil-particles",{"options":[16],"url":[1],"init":[16],"containerId":[1,"container-id"],"theme":[1]},null,{"options":[{"onPropsChange":0}],"url":[{"onPropsChange":0}],"init":[{"onPropsChange":0}],"containerId":[{"onPropsChange":0}],"theme":[{"onThemeChange":0}]}]]]], options);
|
|
21
21
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{i as initParticlesEngine,aH as isParticlesEngineInitialized,aI as waitForParticlesEngineInitialization}from"./p-
|
|
1
|
+
export{i as initParticlesEngine,aH as isParticlesEngineInitialized,aI as waitForParticlesEngineInitialization}from"./p-FNL2LsWF.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const t="generated",n="source-over",e="resize",s="visibilitychange",i=100,a=.5,r=1e3,o={x:0,y:0,z:0},c={a:1,b:0,c:0,d:1},u="random",h=2,f=2*Math.PI,l=60,d="true",p="false",g="canvas",w=0,m=2,M=100,v=1,y=1,b=1,E=255,P=360,x=100,A=100,S=0,L=0,z=60,D=1,k=0,C=1,T=1,O=120,F=0,$=1,j=1,H=0,_=0,q=1,B=0,I=0,R=1,N=1,Q=0,U=1,G=0,V=1,W=0,J=400,K=3,X=6,Y=1,Z=1,tt=0,nt=1;var et;function st(t){return"z"in t?t.z:o.z}!function(t){t.bottom="bottom",t.bottomLeft="bottom-left",t.bottomRight="bottom-right",t.left="left",t.none="none",t.right="right",t.top="top",t.topLeft="top-left",t.topRight="top-right",t.outside="outside",t.inside="inside"}(et||(et={}));class it{x;y;z;constructor(t=o.x,n=o.y,e=o.z){this.x=t,this.y=n,this.z=e}static get origin(){return it.create(o.x,o.y,o.z)}get angle(){return Math.atan2(this.y,this.x)}set angle(t){this.#t(t,this.length)}get length(){return Math.sqrt(this.getLengthSq())}set length(t){this.#t(this.angle,t)}static clone(t){return it.create(t.x,t.y,st(t))}static create(t,n,e){return"number"==typeof t?new it(t,n??o.y,e??o.z):new it(t.x,t.y,st(t))}add(t){return it.create(this.x+t.x,this.y+t.y,this.z+st(t))}addTo(t){this.x+=t.x,this.y+=t.y,this.z+=st(t)}copy(){return it.clone(this)}div(t){return it.create(this.x/t,this.y/t,this.z/t)}getLengthSq(){return this.x**2+this.y**2}mult(t){return it.create(this.x*t,this.y*t,this.z*t)}multTo(t){this.x*=t,this.y*=t,this.z*=t}normalize(){const t=this.length;0!=t&&this.multTo(1/t)}rotate(t){return it.create(this.x*Math.cos(t)-this.y*Math.sin(t),this.x*Math.sin(t)+this.y*Math.cos(t),o.z)}setTo(t){this.x=t.x,this.y=t.y,this.z=st(t)}sub(t){return it.create(this.x-t.x,this.y-t.y,this.z-st(t))}subFrom(t){this.x-=t.x,this.y-=t.y,this.z-=st(t)}#t(t,n){this.x=Math.cos(t)*n,this.y=Math.sin(t)*n}}class at extends it{constructor(t=o.x,n=o.y){super(t,n,o.z)}static get origin(){return at.create(o.x,o.y)}static clone(t){return at.create(t.x,t.y)}static create(t,n){return"number"==typeof t?new at(t,n??o.y):new at(t.x,t.y)}}function rt(t){return"boolean"==typeof t}function ot(t){return"string"==typeof t}function ct(t){return"number"==typeof t}function ut(t){return"object"==typeof t&&null!==t}function ht(t){return Array.isArray(t)}function ft(t){return null==t}const lt=Math.PI/180;let dt=Math.random;function pt(){return Mt(dt(),0,1-Number.EPSILON)}function gt(t,n){return pt()*(n-t)+t}function wt(t){return requestAnimationFrame(t)}function mt(t){cancelAnimationFrame(t)}function Mt(t,n,e){return Math.min(Math.max(t,n),e)}function vt(t){const n=Et(t);let e=bt(t);return n===e&&(e=0),gt(e,n)}function yt(t){return ct(t)?t:vt(t)}function bt(t){return ct(t)?t:t.min}function Et(t){return ct(t)?t:t.max}function Pt(t,n){if(t===n||void 0===n&&ct(t))return t;const e=bt(t),s=Et(t);return void 0!==n?{min:Math.min(e,n),max:Math.max(s,n)}:Pt(e,s)}function xt(t,n,e){return function(t,n){const e=t.x-n.x,s=t.y-n.y;return e*e+s*s}(t,n)<=e*e}function At(t){return t*lt}function St(t,n,e){if(ct(t))return At(t);switch(t){case et.top:return.5*-Math.PI;case et.topRight:return.25*-Math.PI;case et.right:return 0;case et.bottomRight:return.25*Math.PI;case et.bottom:return.5*Math.PI;case et.bottomLeft:return.75*Math.PI;case et.left:return Math.PI;case et.topLeft:return.75*-Math.PI;case et.inside:return Math.atan2(e.y-n.y,e.x-n.x);case et.outside:return Math.atan2(n.y-e.y,n.x-e.x);default:return pt()*f}}function Lt(t){const n=at.origin;return n.length=1,n.angle=t,n}function zt(t){const{position:n,size:e}=t;return{x:n?.x??pt()*e.width,y:n?.y??pt()*e.height}}var Dt,kt;function Ct(){return globalThis.document}function Tt(t){if("undefined"!=typeof matchMedia)return matchMedia(t)}function Ot(t){if("undefined"!=typeof MutationObserver)return new MutationObserver(t)}function Ft(t,n){return t===n||ht(n)&&n.includes(t)}function $t(t,n,e=!0){return t[void 0!==n&&e?n%t.length:Math.floor(pt()*t.length)]}function jt(t,...n){for(const e of n){if(ft(e))continue;if(!ut(e)){t=e;continue}Array.isArray(e)?Array.isArray(t)||(t=[]):ut(t)&&!Array.isArray(t)||(t={});const n=Object.keys(e),s=new Set(["__proto__","constructor","prototype"]);if(n.some((t=>{const n=e[t];return ut(n)||Array.isArray(n)})))for(const i of n){if(s.has(i))continue;const n=t,a=e[i];n[i]=Array.isArray(a)?a.map((t=>jt(void 0,t))):jt(n[i],a)}else{const i=e,a=t;for(const t of n)if(!s.has(t)&&t in i){const n=i[t];void 0!==n&&(a[t]=n)}}}return t}function Ht(t,n){return ht(t)?t.map(((t,e)=>n(t,e))):n(t,0)}function _t(t,n,e){return ht(t)?$t(t,n,e):t}function qt(t,n){return function(t,n){if(t.mode!==kt.percent){const{mode:n,...e}=t;return e}return"x"in t?{x:t.x/i*n.width,y:t.y/i*n.height}:{width:t.width/i*n.width,height:t.height/i*n.height}}(t,n)}function Bt(t){const n=Ct().createElement("div").style;for(const e in t){const s=t[e];if(!(e in t)||ft(s))continue;const i=t.getPropertyValue?.(s);if(!i)continue;const a=t.getPropertyPriority?.(s);a?n.setProperty(s,i,a):n.setProperty(s,i)}return n}let It,Rt;function Nt(t){if(It!==t||!Rt){It=t;const n=Ct().createElement("div").style,e=10,s={width:"100%",height:"100%",margin:"0",padding:"0",borderWidth:"0",position:"fixed",zIndex:t.toString(e),"z-index":t.toString(e),top:"0",left:"0","pointer-events":"none"};for(const t in s){const e=s[t];void 0!==e&&n.setProperty(t,e)}Rt=n}return Rt}function Qt(t,n,e,s,i){if(s){let s={passive:!0};rt(i)?s.capture=i:void 0!==i&&(s=i),t.addEventListener(n,e,s)}else t.removeEventListener(n,e,i)}async function Ut(t,n,e,s=!1){let i=n.get(t);if(!i||s){const s=await Promise.all([...e.entries()].map((([n,e])=>e(t).then((t=>[n,t])))));i=new Map(s),n.set(t,i)}return i}!function(t){t.bottom="bottom",t.left="left",t.right="right",t.top="top"}(Dt||(Dt={})),function(t){t.precise="precise",t.percent="percent"}(kt||(kt={}));class Gt{#n;constructor(){this.#n=new Map}addEventListener(t,n){this.removeEventListener(t,n);let e=this.#n.get(t);e||(e=[],this.#n.set(t,e)),e.push(n)}dispatchEvent(t,n){const e=this.#n.get(t);e?.forEach((t=>{t(n)}))}hasEventListener(t){return!!this.#n.get(t)}removeAllEventListeners(t){t?this.#n.delete(t):this.#n=new Map}removeEventListener(t,n){const e=this.#n.get(t);if(!e)return;const s=e.length,i=e.indexOf(n);i<0||(1===s?this.#n.delete(t):e.splice(i,1))}}var Vt;!function(t){t.configAdded="configAdded",t.containerInit="containerInit",t.particlesSetup="particlesSetup",t.containerStarted="containerStarted",t.containerStopped="containerStopped",t.containerDestroyed="containerDestroyed",t.containerPaused="containerPaused",t.containerPlay="containerPlay",t.containerBuilt="containerBuilt",t.particleAdded="particleAdded",t.particleDestroyed="particleDestroyed",t.particleRemoved="particleRemoved"}(Vt||(Vt={}));class Wt{colorManagers=new Map;easingFunctions=new Map;effectDrawers=new Map;initializers={effects:new Map,shapes:new Map,updaters:new Map};palettes=new Map;plugins=[];presets=new Map;shapeDrawers=new Map;updaters=new Map;#e=new Set;#s=new Map;#i;#a=new Set;#r=!1;#o=!1;#c=new Set;constructor(t){this.#i=t}get configs(){const t={};for(const[n,e]of this.#s)t[n]=e;return t}addColorManager(t,n){this.colorManagers.set(t,n)}addConfig(t){const n=t.key??t.name??"default";this.#s.set(n,t),this.#i.dispatchEvent(Vt.configAdded,{data:{name:n,config:t}})}addEasing(t,n){this.easingFunctions.get(t)||this.easingFunctions.set(t,n)}addEffect(t,n){this.initializers.effects.set(t,n)}addPalette(t,n){this.palettes.set(t,n)}addParticleUpdater(t,n){this.initializers.updaters.set(t,n)}addPlugin(t){this.getPlugin(t.id)||this.plugins.push(t)}addPreset(t,n,e=!1){!e&&this.getPreset(t)||this.presets.set(t,n)}addShape(t,n){for(const e of t)this.initializers.shapes.set(e,n)}clearPlugins(t){this.effectDrawers.delete(t),this.shapeDrawers.delete(t),this.updaters.delete(t)}getEasing(t){return this.easingFunctions.get(t)??(t=>t)}getEffectDrawers(t,n=!1){return Ut(t,this.effectDrawers,this.initializers.effects,n)}getPalette(t){return this.palettes.get(t)}getPlugin(t){return this.plugins.find((n=>n.id===t))}getPreset(t){return this.presets.get(t)}async getShapeDrawers(t,n=!1){return Ut(t,this.shapeDrawers,this.initializers.shapes,n)}async getUpdaters(t,n=!1){return async function(t,n,e,s=!1){let i=n.get(t);return i&&!s||(i=await Promise.all([...e.values()].map((n=>n(t)))),n.set(t,i)),i}(t,this.updaters,this.initializers.updaters,n)}async init(){if(!this.#r&&!this.#o){this.#o=!0,this.#a=new Set,this.#e=new Set(this.#c);try{for(const t of this.#e)await this.#u(t,this.#a,this.#e)}finally{this.#c.clear(),this.#o=!1,this.#r=!0}}}loadParticlesOptions(t,n,...e){const s=this.updaters.get(t);s&&s.forEach((t=>t.loadOptions?.(n,...e)))}async register(...t){if(this.#r)throw new Error("Register plugins can only be done before calling tsParticles.load()");for(const n of t)this.#o?await this.#u(n,this.#a,this.#e):this.#c.add(n)}async#u(t,n,e){n.has(t)||(n.add(t),e.add(t),await t(this.#i))}}const Jt=t=>(...n)=>{t(...n)},Kt={debug:Jt(console.debug),error:(t,...n)=>{console.error(`tsParticles - Error - ${t}`,...n)},info:Jt(console.info),log:Jt(console.log),trace:Jt(console.trace),verbose:Jt(console.log),warning:Jt(console.warn)};function Xt(){return Kt}const Yt="100%";var Zt,tn,nn,en,sn,an,rn,on,cn,un,hn;!function(t){t.circle="circle",t.rectangle="rectangle"}(Zt||(Zt={})),function(t){t.clockwise="clockwise",t.counterClockwise="counter-clockwise",t.random="random"}(tn||(tn={})),function(t){t.auto="auto",t.increase="increase",t.decrease="decrease",t.random="random"}(nn||(nn={})),function(t){t.delete="delete",t.wait="wait"}(en||(en={})),function(t){t.bounce="bounce",t.none="none",t.out="out",t.destroy="destroy",t.split="split"}(sn||(sn={})),function(t){t.darken="darken",t.enlighten="enlighten"}(an||(an={})),function(t){t.none="none",t.max="max",t.min="min"}(rn||(rn={})),function(t){t.linear="linear",t.radial="radial",t.random="random"}(on||(on={})),function(t){t.normal="normal",t.inside="inside",t.outside="outside"}(cn||(cn={})),function(t){t.max="max",t.min="min",t.random="random"}(un||(un={})),function(t){t.increasing="increasing",t.decreasing="decreasing"}(hn||(hn={}));const fn=new class{pluginManager=new Wt(this);#h=[];#f=new Gt;#r=!1;get items(){return this.#h}get version(){return"4.2.0"}addEventListener(t,n){this.#f.addEventListener(t,n)}checkVersion(t){if(this.version!==t)throw new Error(`The tsParticles version is different from the loaded plugins version. Engine version: ${this.version}. Plugin version: ${t}`)}dispatchEvent(t,n){this.#f.dispatchEvent(t,n)}async init(){this.#r||(await this.pluginManager.init(),this.#r=!0)}item(t){const n=this.items,e=n[t];if(!e?.destroyed)return e;n.splice(t,1)}async load(n){let e;await this.init(),"undefined"!=typeof HTMLElement&&n.element instanceof HTMLElement&&(e=n.element);const{Container:s}=await import("./p-PBQ5N1xQ.js"),i=n.id??e?.id??`tsparticles${Math.floor(1e4*pt()).toString()}`,{index:a,url:r}=n,o=r?await async function(t){const n=_t(t.url,t.index);if(!n)return t.fallback;const e=await fetch(n);return e.ok?await e.json():(Xt().error(`${e.status.toString()} while retrieving config file`),t.fallback)}({fallback:n.options,url:r,index:a}):n.options,c=_t(o,a),{items:u}=this,h=u.findIndex((t=>t.id.description===i)),f=new s({dispatchCallback:(t,n)=>{this.dispatchEvent(t,n)},id:i,onDestroy:t=>{if(!t)return;const n=this.items,e=n.indexOf(f);e>=0&&n.splice(e,1)},pluginManager:this.pluginManager,sourceOptions:c});if(h>=0){const t=this.item(h),n=t?1:0;t&&!t.destroyed&&t.destroy(!1),u.splice(h,n,f)}else u.push(f);const l="undefined"!=typeof OffscreenCanvas&&n.element instanceof OffscreenCanvas?n.element:(n=>{const e=Ct();let s;if(n instanceof HTMLCanvasElement||n.tagName.toLowerCase()===g)s=n,s.dataset[t]??=p,s.dataset[t]===d&&(s.style.width||=Yt,s.style.height||=Yt,s.style.pointerEvents="none",s.style.setProperty("pointer-events","none"));else{const i=n.getElementsByTagName(g).item(0);i?(s=i,s.dataset[t]=p):(s=e.createElement(g),s.dataset[t]=d,n.appendChild(s)),s.style.width||=Yt,s.style.height||=Yt,s.style.pointerEvents="none",s.style.setProperty("pointer-events","none")}return s})(((n,e)=>{const s=Ct();let i=e??s.getElementById(n);return i||(i=s.createElement("canvas"),i.id=n,i.dataset[t]=d,s.body.append(i),i)})(i,e));return f.canvas.loadCanvas(l),await f.start(),f}async refresh(t=!0){t&&await Promise.all(this.items.map((t=>t.refresh())))}removeEventListener(t,n){this.#f.removeEventListener(t,n)}};let ln,dn,pn=!1;async function gn(t){if(!pn)if(ln){if(dn!==t)throw new Error("initParticlesEngine callback must be stable across the app lifecycle.");await ln}else dn=t,ln=(async()=>{t&&await t(fn),"function"==typeof fn.init&&await fn.init(),pn=!0})().catch((t=>{throw ln=void 0,dn=void 0,pn=!1,t})),await ln}function wn(){return pn}async function mn(){await(null!=ln?ln:Promise.resolve())}export{Ct as $,an as A,E as B,gt as C,U as D,tt as E,J as F,X as G,K as H,Z as I,Y as J,o as K,en as L,et as M,k as N,sn as O,kt as P,n as Q,Zt as R,G as S,nt as T,C as U,D as V,Ot as W,t as X,Bt as Y,Tt as Z,Nt as _,ft as a,r as a0,Qt as a1,s as a2,e as a3,it as a4,Vt as a5,Q as a6,c as a7,w as a8,j as a9,y as aA,b as aB,wt as aC,O as aD,F as aE,mt as aF,l as aG,wn as aH,mn as aI,Lt as aa,vt as ab,pt as ac,Dt as ad,Mt as ae,H as af,qt as ag,St as ah,cn as ai,at as aj,yt as ak,zt as al,_t as am,Ft as an,f as ao,At as ap,M as aq,_ as ar,B as as,Xt as at,I as au,v as av,R as aw,N as ax,q as ay,$ as az,Pt as b,xt as c,P as d,A as e,L as f,x as g,S as h,gn as i,ot as j,ht as k,W as l,jt as m,ct as n,ut as o,Ht as p,rt as q,$t as r,m as s,fn as t,T as u,u as v,V as w,a as x,h as y,z}
|