@tsparticles/interaction-external-repulse 4.0.0-beta.11 → 4.0.0-beta.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,387 +1,275 @@
1
- /*!
2
- * Author : Matteo Bruni
3
- * MIT license: https://opensource.org/licenses/MIT
4
- * Demo / Generator : https://particles.js.org/
5
- * GitHub : https://www.github.com/matteobruni/tsparticles
6
- * How to use? : Check the GitHub README
7
- * v4.0.0-beta.11
8
- */
9
- /*
10
- * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
11
- * This devtool is neither made for production nor for readable output files.
12
- * It uses "eval()" calls to create a separate source file in the browser devtools.
13
- * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
14
- * or disable the default devtool with "devtool: false".
15
- * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
16
- */
17
- (function webpackUniversalModuleDefinition(root, factory) {
18
- if(typeof exports === 'object' && typeof module === 'object')
19
- module.exports = factory(require("@tsparticles/engine"), require("@tsparticles/plugin-interactivity"));
20
- else if(typeof define === 'function' && define.amd)
21
- define(["@tsparticles/engine", "@tsparticles/plugin-interactivity"], factory);
22
- else {
23
- var a = typeof exports === 'object' ? factory(require("@tsparticles/engine"), require("@tsparticles/plugin-interactivity")) : factory(root["window"], root["window"]);
24
- for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
25
- }
26
- })(this, (__WEBPACK_EXTERNAL_MODULE__tsparticles_engine__, __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_interactivity__) => {
27
- return /******/ (() => { // webpackBootstrap
28
- /******/ "use strict";
29
- /******/ var __webpack_modules__ = ({
1
+ (function(g){g.__tsParticlesInternals=g.__tsParticlesInternals||{};g.__tsParticlesInternals.bundles=g.__tsParticlesInternals.bundles||{};g.__tsParticlesInternals.effects=g.__tsParticlesInternals.effects||{};g.__tsParticlesInternals.engine=g.__tsParticlesInternals.engine||{};g.__tsParticlesInternals.interactions=g.__tsParticlesInternals.interactions||{};g.__tsParticlesInternals.palettes=g.__tsParticlesInternals.palettes||{};g.__tsParticlesInternals.paths=g.__tsParticlesInternals.paths||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins.emittersShapes=g.__tsParticlesInternals.plugins.emittersShapes||{};g.__tsParticlesInternals.presets=g.__tsParticlesInternals.presets||{};g.__tsParticlesInternals.shapes=g.__tsParticlesInternals.shapes||{};g.__tsParticlesInternals.updaters=g.__tsParticlesInternals.updaters||{};g.__tsParticlesInternals.utils=g.__tsParticlesInternals.utils||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas.utils=g.__tsParticlesInternals.canvas.utils||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path.utils=g.__tsParticlesInternals.path.utils||{};var __tsProxyFactory=typeof Proxy!=="undefined"?function(obj){return new Proxy(obj,{get:function(target,key){if(!(key in target)){target[key]={};}return target[key];}});}:function(obj){return obj;};g.__tsParticlesInternals.bundles=__tsProxyFactory(g.__tsParticlesInternals.bundles);g.__tsParticlesInternals.effects=__tsProxyFactory(g.__tsParticlesInternals.effects);g.__tsParticlesInternals.interactions=__tsProxyFactory(g.__tsParticlesInternals.interactions);g.__tsParticlesInternals.palettes=__tsProxyFactory(g.__tsParticlesInternals.palettes);g.__tsParticlesInternals.paths=__tsProxyFactory(g.__tsParticlesInternals.paths);g.__tsParticlesInternals.plugins=__tsProxyFactory(g.__tsParticlesInternals.plugins);g.__tsParticlesInternals.plugins.emittersShapes=__tsProxyFactory(g.__tsParticlesInternals.plugins.emittersShapes);g.__tsParticlesInternals.presets=__tsProxyFactory(g.__tsParticlesInternals.presets);g.__tsParticlesInternals.shapes=__tsProxyFactory(g.__tsParticlesInternals.shapes);g.__tsParticlesInternals.updaters=__tsProxyFactory(g.__tsParticlesInternals.updaters);g.__tsParticlesInternals.utils=__tsProxyFactory(g.__tsParticlesInternals.utils);g.__tsParticlesInternals.canvas=__tsProxyFactory(g.__tsParticlesInternals.canvas);g.__tsParticlesInternals.path=__tsProxyFactory(g.__tsParticlesInternals.path);g.tsparticlesInternalExports=g.tsparticlesInternalExports||{};})(typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:this);
2
+ /* External Interaction v4.0.0-beta.15 */
3
+ (function (global, factory) {
4
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tsparticles/plugin-interactivity'), require('@tsparticles/engine')) :
5
+ typeof define === 'function' && define.amd ? define(['exports', '@tsparticles/plugin-interactivity', '@tsparticles/engine'], factory) :
6
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.__tsParticlesInternals = global.__tsParticlesInternals || {}, global.__tsParticlesInternals.interactions = global.__tsParticlesInternals.interactions || {}, global.__tsParticlesInternals.interactions.externalRepulse = global.__tsParticlesInternals.interactions.externalRepulse || {}), global.__tsParticlesInternals.plugins.interactivity, global.__tsParticlesInternals.engine));
7
+ })(this, (function (exports, pluginInteractivity, engine) { 'use strict';
30
8
 
31
- /***/ "@tsparticles/engine"
32
- /*!*********************************************************************************************************************************!*\
33
- !*** external {"commonjs":"@tsparticles/engine","commonjs2":"@tsparticles/engine","amd":"@tsparticles/engine","root":"window"} ***!
34
- \*********************************************************************************************************************************/
35
- (module) {
9
+ class RepulseBase {
10
+ distance;
11
+ duration;
12
+ easing;
13
+ factor;
14
+ maxSpeed;
15
+ speed;
16
+ constructor() {
17
+ this.distance = 200;
18
+ this.duration = 0.4;
19
+ this.factor = 100;
20
+ this.speed = 1;
21
+ this.maxSpeed = 50;
22
+ this.easing = engine.EasingType.easeOutQuad;
23
+ }
24
+ load(data) {
25
+ if (engine.isNull(data)) {
26
+ return;
27
+ }
28
+ if (data.distance !== undefined) {
29
+ this.distance = data.distance;
30
+ }
31
+ if (data.duration !== undefined) {
32
+ this.duration = data.duration;
33
+ }
34
+ if (data.easing !== undefined) {
35
+ this.easing = data.easing;
36
+ }
37
+ if (data.factor !== undefined) {
38
+ this.factor = data.factor;
39
+ }
40
+ if (data.speed !== undefined) {
41
+ this.speed = data.speed;
42
+ }
43
+ if (data.maxSpeed !== undefined) {
44
+ this.maxSpeed = data.maxSpeed;
45
+ }
46
+ }
47
+ }
36
48
 
37
- module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
49
+ class RepulseDiv extends RepulseBase {
50
+ selectors;
51
+ constructor() {
52
+ super();
53
+ this.selectors = [];
54
+ }
55
+ load(data) {
56
+ super.load(data);
57
+ if (engine.isNull(data)) {
58
+ return;
59
+ }
60
+ if (data.selectors !== undefined) {
61
+ this.selectors = data.selectors;
62
+ }
63
+ }
64
+ }
38
65
 
39
- /***/ },
66
+ class Repulse extends RepulseBase {
67
+ divs;
68
+ load(data) {
69
+ super.load(data);
70
+ if (engine.isNull(data)) {
71
+ return;
72
+ }
73
+ this.divs = engine.executeOnSingleOrMultiple(data.divs, div => {
74
+ const tmp = new RepulseDiv();
75
+ tmp.load(div);
76
+ return tmp;
77
+ });
78
+ }
79
+ }
40
80
 
41
- /***/ "@tsparticles/plugin-interactivity"
42
- /*!***************************************************************************************************************************************************************************!*\
43
- !*** external {"commonjs":"@tsparticles/plugin-interactivity","commonjs2":"@tsparticles/plugin-interactivity","amd":"@tsparticles/plugin-interactivity","root":"window"} ***!
44
- \***************************************************************************************************************************************************************************/
45
- (module) {
81
+ const repulseMode = "repulse", minDistance = 0, repulseRadiusFactor = 6, repulseRadiusPower = 3, squarePower = 2, minRadius = 0, minSpeed = 0, easingOffset = 1;
82
+ class Repulser extends pluginInteractivity.ExternalInteractorBase {
83
+ handleClickMode;
84
+ _clickVec;
85
+ _maxDistance;
86
+ _normVec;
87
+ _pluginManager;
88
+ constructor(pluginManager, container) {
89
+ super(container);
90
+ this._pluginManager = pluginManager;
91
+ this._maxDistance = 0;
92
+ this._normVec = engine.Vector.origin;
93
+ this._clickVec = engine.Vector.origin;
94
+ container.repulse ??= { particles: [] };
95
+ this.handleClickMode = (mode, interactivityData) => {
96
+ const options = this.container.actualOptions, repulseOpts = options.interactivity?.modes.repulse;
97
+ if (!repulseOpts || mode !== repulseMode) {
98
+ return;
99
+ }
100
+ container.repulse ??= { particles: [] };
101
+ const repulse = container.repulse;
102
+ repulse.clicking = true;
103
+ repulse.count = 0;
104
+ for (const particle of container.repulse.particles) {
105
+ if (!this.isEnabled(interactivityData, particle)) {
106
+ continue;
107
+ }
108
+ particle.velocity.setTo(particle.initialVelocity);
109
+ }
110
+ repulse.particles = [];
111
+ repulse.finish = false;
112
+ setTimeout(() => {
113
+ if (container.destroyed) {
114
+ return;
115
+ }
116
+ repulse.clicking = false;
117
+ }, repulseOpts.duration * engine.millisecondsToSeconds);
118
+ };
119
+ }
120
+ get maxDistance() {
121
+ return this._maxDistance;
122
+ }
123
+ clear() {
124
+ }
125
+ init() {
126
+ const container = this.container, repulse = container.actualOptions.interactivity?.modes.repulse;
127
+ if (!repulse) {
128
+ return;
129
+ }
130
+ this._maxDistance = repulse.distance;
131
+ container.retina.repulseModeDistance = repulse.distance * container.retina.pixelRatio;
132
+ }
133
+ interact(interactivityData) {
134
+ const container = this.container, options = container.actualOptions, mouseMoveStatus = interactivityData.status === pluginInteractivity.mouseMoveEvent, events = options.interactivity?.events;
135
+ if (!events) {
136
+ return;
137
+ }
138
+ const hover = events.onHover, hoverEnabled = hover.enable, hoverMode = hover.mode, click = events.onClick, clickEnabled = click.enable, clickMode = click.mode, divs = events.onDiv;
139
+ if (mouseMoveStatus && hoverEnabled && engine.isInArray(repulseMode, hoverMode)) {
140
+ this._hoverRepulse(interactivityData);
141
+ }
142
+ else if (clickEnabled && engine.isInArray(repulseMode, clickMode)) {
143
+ this._clickRepulse(interactivityData);
144
+ }
145
+ else {
146
+ pluginInteractivity.divModeExecute(repulseMode, divs, (selector, div) => {
147
+ this._singleSelectorRepulse(interactivityData, selector, div);
148
+ });
149
+ }
150
+ }
151
+ isEnabled(interactivityData, particle) {
152
+ const container = this.container, options = container.actualOptions, mouse = interactivityData.mouse, events = (particle?.interactivity ?? options.interactivity)?.events;
153
+ if (!events) {
154
+ return false;
155
+ }
156
+ const divs = events.onDiv, hover = events.onHover, click = events.onClick, divRepulse = pluginInteractivity.isDivModeEnabled(repulseMode, divs);
157
+ if (!(divRepulse || (hover.enable && !!mouse.position) || (click.enable && mouse.clickPosition))) {
158
+ return false;
159
+ }
160
+ const hoverMode = hover.mode, clickMode = click.mode;
161
+ return engine.isInArray(repulseMode, hoverMode) || engine.isInArray(repulseMode, clickMode) || divRepulse;
162
+ }
163
+ loadModeOptions(options, ...sources) {
164
+ options.repulse ??= new Repulse();
165
+ for (const source of sources) {
166
+ options.repulse.load(source?.repulse);
167
+ }
168
+ }
169
+ reset() {
170
+ }
171
+ _clickRepulse = interactivityData => {
172
+ const container = this.container, repulseOptions = container.actualOptions.interactivity?.modes.repulse;
173
+ if (!repulseOptions) {
174
+ return;
175
+ }
176
+ const repulse = container.repulse ?? { particles: [] };
177
+ if (!repulse.finish) {
178
+ repulse.count ??= 0;
179
+ repulse.count++;
180
+ if (repulse.count === container.particles.count) {
181
+ repulse.finish = true;
182
+ }
183
+ }
184
+ if (repulse.clicking) {
185
+ const repulseDistance = container.retina.repulseModeDistance;
186
+ if (!repulseDistance || repulseDistance < minDistance) {
187
+ return;
188
+ }
189
+ const repulseRadius = Math.pow(repulseDistance / repulseRadiusFactor, repulseRadiusPower), mouseClickPos = interactivityData.mouse.clickPosition;
190
+ if (mouseClickPos === undefined) {
191
+ return;
192
+ }
193
+ const range = new engine.Circle(mouseClickPos.x, mouseClickPos.y, repulseRadius), query = container.particles.grid.query(range, p => this.isEnabled(interactivityData, p));
194
+ for (const particle of query) {
195
+ const { dx, dy, distance } = engine.getDistances(mouseClickPos, particle.position), d = distance ** squarePower, velocity = repulseOptions.speed, force = (-repulseRadius * velocity) / d;
196
+ if (d <= repulseRadius) {
197
+ repulse.particles.push(particle);
198
+ this._clickVec.x = dx;
199
+ this._clickVec.y = dy;
200
+ this._clickVec.length = force;
201
+ particle.velocity.setTo(this._clickVec);
202
+ }
203
+ }
204
+ }
205
+ else if (repulse.clicking === false) {
206
+ for (const particle of repulse.particles) {
207
+ particle.velocity.setTo(particle.initialVelocity);
208
+ }
209
+ repulse.particles = [];
210
+ }
211
+ };
212
+ _hoverRepulse = interactivityData => {
213
+ const container = this.container, mousePos = interactivityData.mouse.position, repulseRadius = container.retina.repulseModeDistance;
214
+ if (!repulseRadius || repulseRadius < minRadius || !mousePos) {
215
+ return;
216
+ }
217
+ this._processRepulse(interactivityData, mousePos, repulseRadius, new engine.Circle(mousePos.x, mousePos.y, repulseRadius));
218
+ };
219
+ _processRepulse = (interactivityData, position, repulseRadius, area, divRepulse) => {
220
+ const container = this.container, query = container.particles.grid.query(area, p => this.isEnabled(interactivityData, p)), repulseOptions = container.actualOptions.interactivity?.modes.repulse;
221
+ if (!repulseOptions) {
222
+ return;
223
+ }
224
+ const { easing, speed, factor, maxSpeed } = repulseOptions, easingFunc = this._pluginManager.getEasing(easing), velocity = (divRepulse?.speed ?? speed) * factor;
225
+ for (const particle of query) {
226
+ const { dx, dy, distance } = engine.getDistances(particle.position, position), repulseFactor = engine.clamp(easingFunc(easingOffset - distance / repulseRadius) * velocity, minSpeed, maxSpeed);
227
+ this._normVec.x = !distance ? velocity : (dx / distance) * repulseFactor;
228
+ this._normVec.y = !distance ? velocity : (dy / distance) * repulseFactor;
229
+ particle.position.addTo(this._normVec);
230
+ }
231
+ };
232
+ _singleSelectorRepulse = (interactivityData, selector, div) => {
233
+ const container = this.container, repulse = container.actualOptions.interactivity?.modes.repulse;
234
+ if (!repulse) {
235
+ return;
236
+ }
237
+ const query = engine.safeDocument().querySelectorAll(selector);
238
+ if (!query.length) {
239
+ return;
240
+ }
241
+ query.forEach(item => {
242
+ const elem = item, pxRatio = container.retina.pixelRatio, pos = {
243
+ x: (elem.offsetLeft + elem.offsetWidth * engine.half) * pxRatio,
244
+ y: (elem.offsetTop + elem.offsetHeight * engine.half) * pxRatio,
245
+ }, repulseRadius = elem.offsetWidth * engine.half * pxRatio, area = div.type === pluginInteractivity.DivType.circle
246
+ ? new engine.Circle(pos.x, pos.y, repulseRadius)
247
+ : new engine.Rectangle(elem.offsetLeft * pxRatio, elem.offsetTop * pxRatio, elem.offsetWidth * pxRatio, elem.offsetHeight * pxRatio), divs = repulse.divs, divRepulse = pluginInteractivity.divMode(divs, elem);
248
+ this._processRepulse(interactivityData, pos, repulseRadius, area, divRepulse);
249
+ });
250
+ };
251
+ }
46
252
 
47
- module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_interactivity__;
253
+ async function loadExternalRepulseInteraction(engine) {
254
+ engine.checkVersion("4.0.0-beta.15");
255
+ await engine.pluginManager.register((e) => {
256
+ pluginInteractivity.ensureInteractivityPluginLoaded(e);
257
+ const pluginManager = e.pluginManager;
258
+ pluginManager.addInteractor?.("externalRepulse", container => {
259
+ return Promise.resolve(new Repulser(pluginManager, container));
260
+ });
261
+ });
262
+ }
48
263
 
49
- /***/ },
264
+ const globalObject = globalThis;
265
+ globalObject.__tsParticlesInternals = globalObject.__tsParticlesInternals ?? {};
266
+ globalObject.loadExternalRepulseInteraction = loadExternalRepulseInteraction;
50
267
 
51
- /***/ "./dist/browser/Options/Classes/Repulse.js"
52
- /*!*************************************************!*\
53
- !*** ./dist/browser/Options/Classes/Repulse.js ***!
54
- \*************************************************/
55
- (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
268
+ exports.Repulse = Repulse;
269
+ exports.RepulseBase = RepulseBase;
270
+ exports.RepulseDiv = RepulseDiv;
271
+ exports.loadExternalRepulseInteraction = loadExternalRepulseInteraction;
56
272
 
57
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Repulse: () => (/* binding */ Repulse)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _RepulseBase_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./RepulseBase.js */ \"./dist/browser/Options/Classes/RepulseBase.js\");\n/* harmony import */ var _RepulseDiv_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./RepulseDiv.js */ \"./dist/browser/Options/Classes/RepulseDiv.js\");\n\n\n\nclass Repulse extends _RepulseBase_js__WEBPACK_IMPORTED_MODULE_1__.RepulseBase {\n divs;\n load(data) {\n super.load(data);\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n this.divs = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.executeOnSingleOrMultiple)(data.divs, (div)=>{\n const tmp = new _RepulseDiv_js__WEBPACK_IMPORTED_MODULE_2__.RepulseDiv();\n tmp.load(div);\n return tmp;\n });\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/interaction-external-repulse/./dist/browser/Options/Classes/Repulse.js?\n}");
58
-
59
- /***/ },
60
-
61
- /***/ "./dist/browser/Options/Classes/RepulseBase.js"
62
- /*!*****************************************************!*\
63
- !*** ./dist/browser/Options/Classes/RepulseBase.js ***!
64
- \*****************************************************/
65
- (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
66
-
67
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ RepulseBase: () => (/* binding */ RepulseBase)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nclass RepulseBase {\n distance;\n duration;\n easing;\n factor;\n maxSpeed;\n speed;\n constructor(){\n this.distance = 200;\n this.duration = 0.4;\n this.factor = 100;\n this.speed = 1;\n this.maxSpeed = 50;\n this.easing = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.EasingType.easeOutQuad;\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n if (data.distance !== undefined) {\n this.distance = data.distance;\n }\n if (data.duration !== undefined) {\n this.duration = data.duration;\n }\n if (data.easing !== undefined) {\n this.easing = data.easing;\n }\n if (data.factor !== undefined) {\n this.factor = data.factor;\n }\n if (data.speed !== undefined) {\n this.speed = data.speed;\n }\n if (data.maxSpeed !== undefined) {\n this.maxSpeed = data.maxSpeed;\n }\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/interaction-external-repulse/./dist/browser/Options/Classes/RepulseBase.js?\n}");
68
-
69
- /***/ },
70
-
71
- /***/ "./dist/browser/Options/Classes/RepulseDiv.js"
72
- /*!****************************************************!*\
73
- !*** ./dist/browser/Options/Classes/RepulseDiv.js ***!
74
- \****************************************************/
75
- (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
76
-
77
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ RepulseDiv: () => (/* binding */ RepulseDiv)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _RepulseBase_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./RepulseBase.js */ \"./dist/browser/Options/Classes/RepulseBase.js\");\n\n\nclass RepulseDiv extends _RepulseBase_js__WEBPACK_IMPORTED_MODULE_1__.RepulseBase {\n selectors;\n constructor(){\n super();\n this.selectors = [];\n }\n load(data) {\n super.load(data);\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n if (data.selectors !== undefined) {\n this.selectors = data.selectors;\n }\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/interaction-external-repulse/./dist/browser/Options/Classes/RepulseDiv.js?\n}");
78
-
79
- /***/ },
80
-
81
- /***/ "./dist/browser/index.js"
82
- /*!*******************************!*\
83
- !*** ./dist/browser/index.js ***!
84
- \*******************************/
85
- (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
86
-
87
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Repulse: () => (/* reexport safe */ _Options_Classes_Repulse_js__WEBPACK_IMPORTED_MODULE_2__.Repulse),\n/* harmony export */ RepulseBase: () => (/* reexport safe */ _Options_Classes_RepulseBase_js__WEBPACK_IMPORTED_MODULE_0__.RepulseBase),\n/* harmony export */ RepulseDiv: () => (/* reexport safe */ _Options_Classes_RepulseDiv_js__WEBPACK_IMPORTED_MODULE_1__.RepulseDiv),\n/* harmony export */ loadExternalRepulseInteraction: () => (/* binding */ loadExternalRepulseInteraction)\n/* harmony export */ });\n/* harmony import */ var _Options_Classes_RepulseBase_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Options/Classes/RepulseBase.js */ \"./dist/browser/Options/Classes/RepulseBase.js\");\n/* harmony import */ var _Options_Classes_RepulseDiv_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Options/Classes/RepulseDiv.js */ \"./dist/browser/Options/Classes/RepulseDiv.js\");\n/* harmony import */ var _Options_Classes_Repulse_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Options/Classes/Repulse.js */ \"./dist/browser/Options/Classes/Repulse.js\");\nasync function loadExternalRepulseInteraction(engine) {\n engine.checkVersion(\"4.0.0-beta.11\");\n await engine.pluginManager.register(async (e)=>{\n const { ensureInteractivityPluginLoaded } = await Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! @tsparticles/plugin-interactivity */ \"@tsparticles/plugin-interactivity\", 19));\n ensureInteractivityPluginLoaded(e);\n const pluginManager = e.pluginManager;\n pluginManager.addInteractor?.(\"externalRepulse\", async (container)=>{\n const { Repulser } = await __webpack_require__.e(/*! import() */ \"dist_browser_Repulser_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./Repulser.js */ \"./dist/browser/Repulser.js\"));\n return new Repulser(pluginManager, container);\n });\n });\n}\n\n\n\n\n\n//# sourceURL=webpack://@tsparticles/interaction-external-repulse/./dist/browser/index.js?\n}");
88
-
89
- /***/ }
90
-
91
- /******/ });
92
- /************************************************************************/
93
- /******/ // The module cache
94
- /******/ var __webpack_module_cache__ = {};
95
- /******/
96
- /******/ // The require function
97
- /******/ function __webpack_require__(moduleId) {
98
- /******/ // Check if module is in cache
99
- /******/ var cachedModule = __webpack_module_cache__[moduleId];
100
- /******/ if (cachedModule !== undefined) {
101
- /******/ return cachedModule.exports;
102
- /******/ }
103
- /******/ // Create a new module (and put it into the cache)
104
- /******/ var module = __webpack_module_cache__[moduleId] = {
105
- /******/ // no module.id needed
106
- /******/ // no module.loaded needed
107
- /******/ exports: {}
108
- /******/ };
109
- /******/
110
- /******/ // Execute the module function
111
- /******/ if (!(moduleId in __webpack_modules__)) {
112
- /******/ delete __webpack_module_cache__[moduleId];
113
- /******/ var e = new Error("Cannot find module '" + moduleId + "'");
114
- /******/ e.code = 'MODULE_NOT_FOUND';
115
- /******/ throw e;
116
- /******/ }
117
- /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
118
- /******/
119
- /******/ // Return the exports of the module
120
- /******/ return module.exports;
121
- /******/ }
122
- /******/
123
- /******/ // expose the modules object (__webpack_modules__)
124
- /******/ __webpack_require__.m = __webpack_modules__;
125
- /******/
126
- /************************************************************************/
127
- /******/ /* webpack/runtime/create fake namespace object */
128
- /******/ (() => {
129
- /******/ var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);
130
- /******/ var leafPrototypes;
131
- /******/ // create a fake namespace object
132
- /******/ // mode & 1: value is a module id, require it
133
- /******/ // mode & 2: merge all properties of value into the ns
134
- /******/ // mode & 4: return value when already ns object
135
- /******/ // mode & 16: return value when it's Promise-like
136
- /******/ // mode & 8|1: behave like require
137
- /******/ __webpack_require__.t = function(value, mode) {
138
- /******/ if(mode & 1) value = this(value);
139
- /******/ if(mode & 8) return value;
140
- /******/ if(typeof value === 'object' && value) {
141
- /******/ if((mode & 4) && value.__esModule) return value;
142
- /******/ if((mode & 16) && typeof value.then === 'function') return value;
143
- /******/ }
144
- /******/ var ns = Object.create(null);
145
- /******/ __webpack_require__.r(ns);
146
- /******/ var def = {};
147
- /******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];
148
- /******/ for(var current = mode & 2 && value; (typeof current == 'object' || typeof current == 'function') && !~leafPrototypes.indexOf(current); current = getProto(current)) {
149
- /******/ Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));
150
- /******/ }
151
- /******/ def['default'] = () => (value);
152
- /******/ __webpack_require__.d(ns, def);
153
- /******/ return ns;
154
- /******/ };
155
- /******/ })();
156
- /******/
157
- /******/ /* webpack/runtime/define property getters */
158
- /******/ (() => {
159
- /******/ // define getter functions for harmony exports
160
- /******/ __webpack_require__.d = (exports, definition) => {
161
- /******/ for(var key in definition) {
162
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
163
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
164
- /******/ }
165
- /******/ }
166
- /******/ };
167
- /******/ })();
168
- /******/
169
- /******/ /* webpack/runtime/ensure chunk */
170
- /******/ (() => {
171
- /******/ __webpack_require__.f = {};
172
- /******/ // This file contains only the entry chunk.
173
- /******/ // The chunk loading function for additional chunks
174
- /******/ __webpack_require__.e = (chunkId) => {
175
- /******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {
176
- /******/ __webpack_require__.f[key](chunkId, promises);
177
- /******/ return promises;
178
- /******/ }, []));
179
- /******/ };
180
- /******/ })();
181
- /******/
182
- /******/ /* webpack/runtime/get javascript chunk filename */
183
- /******/ (() => {
184
- /******/ // This function allow to reference async chunks
185
- /******/ __webpack_require__.u = (chunkId) => {
186
- /******/ // return url for filenames based on template
187
- /******/ return "" + chunkId + ".js";
188
- /******/ };
189
- /******/ })();
190
- /******/
191
- /******/ /* webpack/runtime/global */
192
- /******/ (() => {
193
- /******/ __webpack_require__.g = (function() {
194
- /******/ if (typeof globalThis === 'object') return globalThis;
195
- /******/ try {
196
- /******/ return this || new Function('return this')();
197
- /******/ } catch (e) {
198
- /******/ if (typeof window === 'object') return window;
199
- /******/ }
200
- /******/ })();
201
- /******/ })();
202
- /******/
203
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
204
- /******/ (() => {
205
- /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
206
- /******/ })();
207
- /******/
208
- /******/ /* webpack/runtime/load script */
209
- /******/ (() => {
210
- /******/ var inProgress = {};
211
- /******/ var dataWebpackPrefix = "@tsparticles/interaction-external-repulse:";
212
- /******/ // loadScript function to load a script via script tag
213
- /******/ __webpack_require__.l = (url, done, key, chunkId) => {
214
- /******/ if(inProgress[url]) { inProgress[url].push(done); return; }
215
- /******/ var script, needAttach;
216
- /******/ if(key !== undefined) {
217
- /******/ var scripts = document.getElementsByTagName("script");
218
- /******/ for(var i = 0; i < scripts.length; i++) {
219
- /******/ var s = scripts[i];
220
- /******/ if(s.getAttribute("src") == url || s.getAttribute("data-webpack") == dataWebpackPrefix + key) { script = s; break; }
221
- /******/ }
222
- /******/ }
223
- /******/ if(!script) {
224
- /******/ needAttach = true;
225
- /******/ script = document.createElement('script');
226
- /******/
227
- /******/ script.charset = 'utf-8';
228
- /******/ if (__webpack_require__.nc) {
229
- /******/ script.setAttribute("nonce", __webpack_require__.nc);
230
- /******/ }
231
- /******/ script.setAttribute("data-webpack", dataWebpackPrefix + key);
232
- /******/
233
- /******/ script.src = url;
234
- /******/ }
235
- /******/ inProgress[url] = [done];
236
- /******/ var onScriptComplete = (prev, event) => {
237
- /******/ // avoid mem leaks in IE.
238
- /******/ script.onerror = script.onload = null;
239
- /******/ clearTimeout(timeout);
240
- /******/ var doneFns = inProgress[url];
241
- /******/ delete inProgress[url];
242
- /******/ script.parentNode && script.parentNode.removeChild(script);
243
- /******/ doneFns && doneFns.forEach((fn) => (fn(event)));
244
- /******/ if(prev) return prev(event);
245
- /******/ }
246
- /******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
247
- /******/ script.onerror = onScriptComplete.bind(null, script.onerror);
248
- /******/ script.onload = onScriptComplete.bind(null, script.onload);
249
- /******/ needAttach && document.head.appendChild(script);
250
- /******/ };
251
- /******/ })();
252
- /******/
253
- /******/ /* webpack/runtime/make namespace object */
254
- /******/ (() => {
255
- /******/ // define __esModule on exports
256
- /******/ __webpack_require__.r = (exports) => {
257
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
258
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
259
- /******/ }
260
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
261
- /******/ };
262
- /******/ })();
263
- /******/
264
- /******/ /* webpack/runtime/publicPath */
265
- /******/ (() => {
266
- /******/ var scriptUrl;
267
- /******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + "";
268
- /******/ var document = __webpack_require__.g.document;
269
- /******/ if (!scriptUrl && document) {
270
- /******/ if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')
271
- /******/ scriptUrl = document.currentScript.src;
272
- /******/ if (!scriptUrl) {
273
- /******/ var scripts = document.getElementsByTagName("script");
274
- /******/ if(scripts.length) {
275
- /******/ var i = scripts.length - 1;
276
- /******/ while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;
277
- /******/ }
278
- /******/ }
279
- /******/ }
280
- /******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration
281
- /******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.
282
- /******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
283
- /******/ scriptUrl = scriptUrl.replace(/^blob:/, "").replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
284
- /******/ __webpack_require__.p = scriptUrl;
285
- /******/ })();
286
- /******/
287
- /******/ /* webpack/runtime/jsonp chunk loading */
288
- /******/ (() => {
289
- /******/ // no baseURI
290
- /******/
291
- /******/ // object to store loaded and loading chunks
292
- /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
293
- /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
294
- /******/ var installedChunks = {
295
- /******/ "tsparticles.interaction.external.repulse": 0
296
- /******/ };
297
- /******/
298
- /******/ __webpack_require__.f.j = (chunkId, promises) => {
299
- /******/ // JSONP chunk loading for javascript
300
- /******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;
301
- /******/ if(installedChunkData !== 0) { // 0 means "already installed".
302
- /******/
303
- /******/ // a Promise means "currently loading".
304
- /******/ if(installedChunkData) {
305
- /******/ promises.push(installedChunkData[2]);
306
- /******/ } else {
307
- /******/ if(true) { // all chunks have JS
308
- /******/ // setup Promise in chunk cache
309
- /******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));
310
- /******/ promises.push(installedChunkData[2] = promise);
311
- /******/
312
- /******/ // start chunk loading
313
- /******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId);
314
- /******/ // create error before stack unwound to get useful stacktrace later
315
- /******/ var error = new Error();
316
- /******/ var loadingEnded = (event) => {
317
- /******/ if(__webpack_require__.o(installedChunks, chunkId)) {
318
- /******/ installedChunkData = installedChunks[chunkId];
319
- /******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined;
320
- /******/ if(installedChunkData) {
321
- /******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type);
322
- /******/ var realSrc = event && event.target && event.target.src;
323
- /******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')';
324
- /******/ error.name = 'ChunkLoadError';
325
- /******/ error.type = errorType;
326
- /******/ error.request = realSrc;
327
- /******/ installedChunkData[1](error);
328
- /******/ }
329
- /******/ }
330
- /******/ };
331
- /******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId);
332
- /******/ }
333
- /******/ }
334
- /******/ }
335
- /******/ };
336
- /******/
337
- /******/ // no prefetching
338
- /******/
339
- /******/ // no preloaded
340
- /******/
341
- /******/ // no HMR
342
- /******/
343
- /******/ // no HMR manifest
344
- /******/
345
- /******/ // no on chunks loaded
346
- /******/
347
- /******/ // install a JSONP callback for chunk loading
348
- /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
349
- /******/ var [chunkIds, moreModules, runtime] = data;
350
- /******/ // add "moreModules" to the modules object,
351
- /******/ // then flag all "chunkIds" as loaded and fire callback
352
- /******/ var moduleId, chunkId, i = 0;
353
- /******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
354
- /******/ for(moduleId in moreModules) {
355
- /******/ if(__webpack_require__.o(moreModules, moduleId)) {
356
- /******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
357
- /******/ }
358
- /******/ }
359
- /******/ if(runtime) var result = runtime(__webpack_require__);
360
- /******/ }
361
- /******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
362
- /******/ for(;i < chunkIds.length; i++) {
363
- /******/ chunkId = chunkIds[i];
364
- /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
365
- /******/ installedChunks[chunkId][0]();
366
- /******/ }
367
- /******/ installedChunks[chunkId] = 0;
368
- /******/ }
369
- /******/
370
- /******/ }
371
- /******/
372
- /******/ var chunkLoadingGlobal = this["webpackChunk_tsparticles_interaction_external_repulse"] = this["webpackChunk_tsparticles_interaction_external_repulse"] || [];
373
- /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
374
- /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
375
- /******/ })();
376
- /******/
377
- /************************************************************************/
378
- /******/
379
- /******/ // startup
380
- /******/ // Load entry module and return exports
381
- /******/ // This entry module can't be inlined because the eval devtool is used.
382
- /******/ var __webpack_exports__ = __webpack_require__("./dist/browser/index.js");
383
- /******/
384
- /******/ return __webpack_exports__;
385
- /******/ })()
386
- ;
387
- });
273
+ }));
274
+ Object.assign(globalThis.window || globalThis, { loadExternalRepulseInteraction: (globalThis.__tsParticlesInternals.interactions.externalRepulse || {}).loadExternalRepulseInteraction });
275
+ delete (globalThis.window || globalThis).tsparticlesInternalExports;