@tsparticles/interaction-external-particle 3.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.
Files changed (43) hide show
  1. package/207.min.js +2 -0
  2. package/207.min.js.LICENSE.txt +1 -0
  3. package/LICENSE +21 -0
  4. package/README.md +76 -0
  5. package/browser/InteractivityParticleMaker.js +102 -0
  6. package/browser/Options/Classes/InteractivityParticle.js +25 -0
  7. package/browser/Options/Classes/InteractivityParticleOptions.js +1 -0
  8. package/browser/Options/Interfaces/IInteractivityParticle.js +1 -0
  9. package/browser/Types.js +1 -0
  10. package/browser/index.js +6 -0
  11. package/browser/package.json +1 -0
  12. package/cjs/InteractivityParticleMaker.js +106 -0
  13. package/cjs/Options/Classes/InteractivityParticle.js +29 -0
  14. package/cjs/Options/Classes/InteractivityParticleOptions.js +2 -0
  15. package/cjs/Options/Interfaces/IInteractivityParticle.js +2 -0
  16. package/cjs/Types.js +2 -0
  17. package/cjs/index.js +33 -0
  18. package/cjs/package.json +1 -0
  19. package/dist_browser_InteractivityParticleMaker_js.js +40 -0
  20. package/esm/InteractivityParticleMaker.js +102 -0
  21. package/esm/Options/Classes/InteractivityParticle.js +25 -0
  22. package/esm/Options/Classes/InteractivityParticleOptions.js +1 -0
  23. package/esm/Options/Interfaces/IInteractivityParticle.js +1 -0
  24. package/esm/Types.js +1 -0
  25. package/esm/index.js +6 -0
  26. package/esm/package.json +1 -0
  27. package/package.json +95 -0
  28. package/report.html +39 -0
  29. package/tsparticles.interaction.external.particle.js +326 -0
  30. package/tsparticles.interaction.external.particle.min.js +2 -0
  31. package/tsparticles.interaction.external.particle.min.js.LICENSE.txt +1 -0
  32. package/types/InteractivityParticleMaker.d.ts +14 -0
  33. package/types/Options/Classes/InteractivityParticle.d.ts +10 -0
  34. package/types/Options/Classes/InteractivityParticleOptions.d.ts +7 -0
  35. package/types/Options/Interfaces/IInteractivityParticle.d.ts +7 -0
  36. package/types/Types.d.ts +13 -0
  37. package/types/index.d.ts +2 -0
  38. package/umd/InteractivityParticleMaker.js +116 -0
  39. package/umd/Options/Classes/InteractivityParticle.js +39 -0
  40. package/umd/Options/Classes/InteractivityParticleOptions.js +12 -0
  41. package/umd/Options/Interfaces/IInteractivityParticle.js +12 -0
  42. package/umd/Types.js +12 -0
  43. package/umd/index.js +44 -0
@@ -0,0 +1,326 @@
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
+ * v3.2.0
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"));
20
+ else if(typeof define === 'function' && define.amd)
21
+ define(["@tsparticles/engine"], factory);
22
+ else {
23
+ var a = typeof exports === 'object' ? factory(require("@tsparticles/engine")) : factory(root["window"]);
24
+ for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
25
+ }
26
+ })(this, (__WEBPACK_EXTERNAL_MODULE__tsparticles_engine__) => {
27
+ return /******/ (() => { // webpackBootstrap
28
+ /******/ "use strict";
29
+ /******/ var __webpack_modules__ = ({
30
+
31
+ /***/ "./dist/browser/index.js":
32
+ /*!*******************************!*\
33
+ !*** ./dist/browser/index.js ***!
34
+ \*******************************/
35
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
36
+
37
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadExternalParticleInteraction: () => (/* binding */ loadExternalParticleInteraction)\n/* harmony export */ });\nasync function loadExternalParticleInteraction(engine, refresh = true) {\n await engine.addInteractor(\"externalParticle\", async container => {\n const {\n InteractivityParticleMaker\n } = await __webpack_require__.e(/*! import() */ \"dist_browser_InteractivityParticleMaker_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./InteractivityParticleMaker.js */ \"./dist/browser/InteractivityParticleMaker.js\"));\n return new InteractivityParticleMaker(container);\n }, refresh);\n}\n\n//# sourceURL=webpack://@tsparticles/interaction-external-particle/./dist/browser/index.js?");
38
+
39
+ /***/ }),
40
+
41
+ /***/ "@tsparticles/engine":
42
+ /*!*********************************************************************************************************************************!*\
43
+ !*** external {"commonjs":"@tsparticles/engine","commonjs2":"@tsparticles/engine","amd":"@tsparticles/engine","root":"window"} ***!
44
+ \*********************************************************************************************************************************/
45
+ /***/ ((module) => {
46
+
47
+ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
48
+
49
+ /***/ })
50
+
51
+ /******/ });
52
+ /************************************************************************/
53
+ /******/ // The module cache
54
+ /******/ var __webpack_module_cache__ = {};
55
+ /******/
56
+ /******/ // The require function
57
+ /******/ function __webpack_require__(moduleId) {
58
+ /******/ // Check if module is in cache
59
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
60
+ /******/ if (cachedModule !== undefined) {
61
+ /******/ return cachedModule.exports;
62
+ /******/ }
63
+ /******/ // Create a new module (and put it into the cache)
64
+ /******/ var module = __webpack_module_cache__[moduleId] = {
65
+ /******/ // no module.id needed
66
+ /******/ // no module.loaded needed
67
+ /******/ exports: {}
68
+ /******/ };
69
+ /******/
70
+ /******/ // Execute the module function
71
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
72
+ /******/
73
+ /******/ // Return the exports of the module
74
+ /******/ return module.exports;
75
+ /******/ }
76
+ /******/
77
+ /******/ // expose the modules object (__webpack_modules__)
78
+ /******/ __webpack_require__.m = __webpack_modules__;
79
+ /******/
80
+ /************************************************************************/
81
+ /******/ /* webpack/runtime/compat get default export */
82
+ /******/ (() => {
83
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
84
+ /******/ __webpack_require__.n = (module) => {
85
+ /******/ var getter = module && module.__esModule ?
86
+ /******/ () => (module['default']) :
87
+ /******/ () => (module);
88
+ /******/ __webpack_require__.d(getter, { a: getter });
89
+ /******/ return getter;
90
+ /******/ };
91
+ /******/ })();
92
+ /******/
93
+ /******/ /* webpack/runtime/define property getters */
94
+ /******/ (() => {
95
+ /******/ // define getter functions for harmony exports
96
+ /******/ __webpack_require__.d = (exports, definition) => {
97
+ /******/ for(var key in definition) {
98
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
99
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
100
+ /******/ }
101
+ /******/ }
102
+ /******/ };
103
+ /******/ })();
104
+ /******/
105
+ /******/ /* webpack/runtime/ensure chunk */
106
+ /******/ (() => {
107
+ /******/ __webpack_require__.f = {};
108
+ /******/ // This file contains only the entry chunk.
109
+ /******/ // The chunk loading function for additional chunks
110
+ /******/ __webpack_require__.e = (chunkId) => {
111
+ /******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {
112
+ /******/ __webpack_require__.f[key](chunkId, promises);
113
+ /******/ return promises;
114
+ /******/ }, []));
115
+ /******/ };
116
+ /******/ })();
117
+ /******/
118
+ /******/ /* webpack/runtime/get javascript chunk filename */
119
+ /******/ (() => {
120
+ /******/ // This function allow to reference async chunks
121
+ /******/ __webpack_require__.u = (chunkId) => {
122
+ /******/ // return url for filenames based on template
123
+ /******/ return "" + chunkId + ".js";
124
+ /******/ };
125
+ /******/ })();
126
+ /******/
127
+ /******/ /* webpack/runtime/global */
128
+ /******/ (() => {
129
+ /******/ __webpack_require__.g = (function() {
130
+ /******/ if (typeof globalThis === 'object') return globalThis;
131
+ /******/ try {
132
+ /******/ return this || new Function('return this')();
133
+ /******/ } catch (e) {
134
+ /******/ if (typeof window === 'object') return window;
135
+ /******/ }
136
+ /******/ })();
137
+ /******/ })();
138
+ /******/
139
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
140
+ /******/ (() => {
141
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
142
+ /******/ })();
143
+ /******/
144
+ /******/ /* webpack/runtime/load script */
145
+ /******/ (() => {
146
+ /******/ var inProgress = {};
147
+ /******/ var dataWebpackPrefix = "@tsparticles/interaction-external-particle:";
148
+ /******/ // loadScript function to load a script via script tag
149
+ /******/ __webpack_require__.l = (url, done, key, chunkId) => {
150
+ /******/ if(inProgress[url]) { inProgress[url].push(done); return; }
151
+ /******/ var script, needAttach;
152
+ /******/ if(key !== undefined) {
153
+ /******/ var scripts = document.getElementsByTagName("script");
154
+ /******/ for(var i = 0; i < scripts.length; i++) {
155
+ /******/ var s = scripts[i];
156
+ /******/ if(s.getAttribute("src") == url || s.getAttribute("data-webpack") == dataWebpackPrefix + key) { script = s; break; }
157
+ /******/ }
158
+ /******/ }
159
+ /******/ if(!script) {
160
+ /******/ needAttach = true;
161
+ /******/ script = document.createElement('script');
162
+ /******/
163
+ /******/ script.charset = 'utf-8';
164
+ /******/ script.timeout = 120;
165
+ /******/ if (__webpack_require__.nc) {
166
+ /******/ script.setAttribute("nonce", __webpack_require__.nc);
167
+ /******/ }
168
+ /******/ script.setAttribute("data-webpack", dataWebpackPrefix + key);
169
+ /******/
170
+ /******/ script.src = url;
171
+ /******/ }
172
+ /******/ inProgress[url] = [done];
173
+ /******/ var onScriptComplete = (prev, event) => {
174
+ /******/ // avoid mem leaks in IE.
175
+ /******/ script.onerror = script.onload = null;
176
+ /******/ clearTimeout(timeout);
177
+ /******/ var doneFns = inProgress[url];
178
+ /******/ delete inProgress[url];
179
+ /******/ script.parentNode && script.parentNode.removeChild(script);
180
+ /******/ doneFns && doneFns.forEach((fn) => (fn(event)));
181
+ /******/ if(prev) return prev(event);
182
+ /******/ }
183
+ /******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
184
+ /******/ script.onerror = onScriptComplete.bind(null, script.onerror);
185
+ /******/ script.onload = onScriptComplete.bind(null, script.onload);
186
+ /******/ needAttach && document.head.appendChild(script);
187
+ /******/ };
188
+ /******/ })();
189
+ /******/
190
+ /******/ /* webpack/runtime/make namespace object */
191
+ /******/ (() => {
192
+ /******/ // define __esModule on exports
193
+ /******/ __webpack_require__.r = (exports) => {
194
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
195
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
196
+ /******/ }
197
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
198
+ /******/ };
199
+ /******/ })();
200
+ /******/
201
+ /******/ /* webpack/runtime/publicPath */
202
+ /******/ (() => {
203
+ /******/ var scriptUrl;
204
+ /******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + "";
205
+ /******/ var document = __webpack_require__.g.document;
206
+ /******/ if (!scriptUrl && document) {
207
+ /******/ if (document.currentScript)
208
+ /******/ scriptUrl = document.currentScript.src;
209
+ /******/ if (!scriptUrl) {
210
+ /******/ var scripts = document.getElementsByTagName("script");
211
+ /******/ if(scripts.length) {
212
+ /******/ var i = scripts.length - 1;
213
+ /******/ while (i > -1 && !scriptUrl) scriptUrl = scripts[i--].src;
214
+ /******/ }
215
+ /******/ }
216
+ /******/ }
217
+ /******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration
218
+ /******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.
219
+ /******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
220
+ /******/ scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
221
+ /******/ __webpack_require__.p = scriptUrl;
222
+ /******/ })();
223
+ /******/
224
+ /******/ /* webpack/runtime/jsonp chunk loading */
225
+ /******/ (() => {
226
+ /******/ // no baseURI
227
+ /******/
228
+ /******/ // object to store loaded and loading chunks
229
+ /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
230
+ /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
231
+ /******/ var installedChunks = {
232
+ /******/ "tsparticles.interaction.external.particle": 0
233
+ /******/ };
234
+ /******/
235
+ /******/ __webpack_require__.f.j = (chunkId, promises) => {
236
+ /******/ // JSONP chunk loading for javascript
237
+ /******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;
238
+ /******/ if(installedChunkData !== 0) { // 0 means "already installed".
239
+ /******/
240
+ /******/ // a Promise means "currently loading".
241
+ /******/ if(installedChunkData) {
242
+ /******/ promises.push(installedChunkData[2]);
243
+ /******/ } else {
244
+ /******/ if(true) { // all chunks have JS
245
+ /******/ // setup Promise in chunk cache
246
+ /******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));
247
+ /******/ promises.push(installedChunkData[2] = promise);
248
+ /******/
249
+ /******/ // start chunk loading
250
+ /******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId);
251
+ /******/ // create error before stack unwound to get useful stacktrace later
252
+ /******/ var error = new Error();
253
+ /******/ var loadingEnded = (event) => {
254
+ /******/ if(__webpack_require__.o(installedChunks, chunkId)) {
255
+ /******/ installedChunkData = installedChunks[chunkId];
256
+ /******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined;
257
+ /******/ if(installedChunkData) {
258
+ /******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type);
259
+ /******/ var realSrc = event && event.target && event.target.src;
260
+ /******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')';
261
+ /******/ error.name = 'ChunkLoadError';
262
+ /******/ error.type = errorType;
263
+ /******/ error.request = realSrc;
264
+ /******/ installedChunkData[1](error);
265
+ /******/ }
266
+ /******/ }
267
+ /******/ };
268
+ /******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId);
269
+ /******/ }
270
+ /******/ }
271
+ /******/ }
272
+ /******/ };
273
+ /******/
274
+ /******/ // no prefetching
275
+ /******/
276
+ /******/ // no preloaded
277
+ /******/
278
+ /******/ // no HMR
279
+ /******/
280
+ /******/ // no HMR manifest
281
+ /******/
282
+ /******/ // no on chunks loaded
283
+ /******/
284
+ /******/ // install a JSONP callback for chunk loading
285
+ /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
286
+ /******/ var chunkIds = data[0];
287
+ /******/ var moreModules = data[1];
288
+ /******/ var runtime = data[2];
289
+ /******/ // add "moreModules" to the modules object,
290
+ /******/ // then flag all "chunkIds" as loaded and fire callback
291
+ /******/ var moduleId, chunkId, i = 0;
292
+ /******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
293
+ /******/ for(moduleId in moreModules) {
294
+ /******/ if(__webpack_require__.o(moreModules, moduleId)) {
295
+ /******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
296
+ /******/ }
297
+ /******/ }
298
+ /******/ if(runtime) var result = runtime(__webpack_require__);
299
+ /******/ }
300
+ /******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
301
+ /******/ for(;i < chunkIds.length; i++) {
302
+ /******/ chunkId = chunkIds[i];
303
+ /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
304
+ /******/ installedChunks[chunkId][0]();
305
+ /******/ }
306
+ /******/ installedChunks[chunkId] = 0;
307
+ /******/ }
308
+ /******/
309
+ /******/ }
310
+ /******/
311
+ /******/ var chunkLoadingGlobal = this["webpackChunk_tsparticles_interaction_external_particle"] = this["webpackChunk_tsparticles_interaction_external_particle"] || [];
312
+ /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
313
+ /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
314
+ /******/ })();
315
+ /******/
316
+ /************************************************************************/
317
+ /******/
318
+ /******/ // startup
319
+ /******/ // Load entry module and return exports
320
+ /******/ // This entry module can't be inlined because the eval devtool is used.
321
+ /******/ var __webpack_exports__ = __webpack_require__("./dist/browser/index.js");
322
+ /******/
323
+ /******/ return __webpack_exports__;
324
+ /******/ })()
325
+ ;
326
+ });
@@ -0,0 +1,2 @@
1
+ /*! For license information please see tsparticles.interaction.external.particle.min.js.LICENSE.txt */
2
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine"],t);else{var r="object"==typeof exports?t(require("@tsparticles/engine")):t(e.window);for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(this,(e=>(()=>{var t,r,n={533:t=>{t.exports=e}},o={};function i(e){var t=o[e];if(void 0!==t)return t.exports;var r=o[e]={exports:{}};return n[e](r,r.exports,i),r.exports}i.m=n,i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.f={},i.e=e=>Promise.all(Object.keys(i.f).reduce(((t,r)=>(i.f[r](e,t),t)),[])),i.u=e=>e+".min.js",i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),t={},r="@tsparticles/interaction-external-particle:",i.l=(e,n,o,a)=>{if(t[e])t[e].push(n);else{var c,l;if(void 0!==o)for(var s=document.getElementsByTagName("script"),p=0;p<s.length;p++){var u=s[p];if(u.getAttribute("src")==e||u.getAttribute("data-webpack")==r+o){c=u;break}}c||(l=!0,(c=document.createElement("script")).charset="utf-8",c.timeout=120,i.nc&&c.setAttribute("nonce",i.nc),c.setAttribute("data-webpack",r+o),c.src=e),t[e]=[n];var d=(r,n)=>{c.onerror=c.onload=null,clearTimeout(f);var o=t[e];if(delete t[e],c.parentNode&&c.parentNode.removeChild(c),o&&o.forEach((e=>e(n))),r)return r(n)},f=setTimeout(d.bind(null,void 0,{type:"timeout",target:c}),12e4);c.onerror=d.bind(null,c.onerror),c.onload=d.bind(null,c.onload),l&&document.head.appendChild(c)}},i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;i.g.importScripts&&(e=i.g.location+"");var t=i.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&!e;)e=r[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i.p=e})(),(()=>{var e={71:0};i.f.j=(t,r)=>{var n=i.o(e,t)?e[t]:void 0;if(0!==n)if(n)r.push(n[2]);else{var o=new Promise(((r,o)=>n=e[t]=[r,o]));r.push(n[2]=o);var a=i.p+i.u(t),c=new Error;i.l(a,(r=>{if(i.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var o=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;c.message="Loading chunk "+t+" failed.\n("+o+": "+a+")",c.name="ChunkLoadError",c.type=o,c.request=a,n[1](c)}}),"chunk-"+t,t)}};var t=(t,r)=>{var n,o,a=r[0],c=r[1],l=r[2],s=0;if(a.some((t=>0!==e[t]))){for(n in c)i.o(c,n)&&(i.m[n]=c[n]);if(l)l(i)}for(t&&t(r);s<a.length;s++)o=a[s],i.o(e,o)&&e[o]&&e[o][0](),e[o]=0},r=this.webpackChunk_tsparticles_interaction_external_particle=this.webpackChunk_tsparticles_interaction_external_particle||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();var a={};return(()=>{async function e(e,t=!0){await e.addInteractor("externalParticle",(async e=>{const{InteractivityParticleMaker:t}=await i.e(207).then(i.bind(i,207));return new t(e)}),t)}i.r(a),i.d(a,{loadExternalParticleInteraction:()=>e})})(),a})()));
@@ -0,0 +1 @@
1
+ /*! tsParticles Particle External Interaction v3.2.0 by Matteo Bruni */
@@ -0,0 +1,14 @@
1
+ import { ExternalInteractorBase, type IModes, type Modes, type Particle, type RecursivePartial } from "@tsparticles/engine";
2
+ import type { IParticleMode, InteractivityParticleContainer, ParticleMode } from "./Types.js";
3
+ export declare class InteractivityParticleMaker extends ExternalInteractorBase<InteractivityParticleContainer> {
4
+ private _clearTimeout?;
5
+ private _lastPosition?;
6
+ private _particle?;
7
+ constructor(container: InteractivityParticleContainer);
8
+ clear(): void;
9
+ init(): void;
10
+ interact(): Promise<void>;
11
+ isEnabled(particle?: Particle): boolean;
12
+ loadModeOptions(options: Modes & ParticleMode, ...sources: RecursivePartial<(IModes & IParticleMode) | undefined>[]): void;
13
+ reset(): void;
14
+ }
@@ -0,0 +1,10 @@
1
+ import { type IOptionLoader, type IParticlesOptions, type RecursivePartial } from "@tsparticles/engine";
2
+ import type { IInteractivityParticle } from "../Interfaces/IInteractivityParticle.js";
3
+ export declare class InteractivityParticle implements IInteractivityParticle, IOptionLoader<IInteractivityParticle> {
4
+ options?: RecursivePartial<IParticlesOptions>;
5
+ pauseOnStop: boolean;
6
+ replaceCursor: boolean;
7
+ stopDelay: number;
8
+ constructor();
9
+ load(data?: RecursivePartial<IInteractivityParticle>): void;
10
+ }
@@ -0,0 +1,7 @@
1
+ import type { Options } from "@tsparticles/engine";
2
+ import type { ParticleMode } from "../../Types.js";
3
+ export type InteractivityParticleOptions = Options & {
4
+ interactivity: {
5
+ modes: ParticleMode;
6
+ };
7
+ };
@@ -0,0 +1,7 @@
1
+ import type { IParticlesOptions, RecursivePartial } from "@tsparticles/engine";
2
+ export interface IInteractivityParticle {
3
+ options?: RecursivePartial<IParticlesOptions>;
4
+ pauseOnStop: boolean;
5
+ replaceCursor: boolean;
6
+ stopDelay: number;
7
+ }
@@ -0,0 +1,13 @@
1
+ import type { Container } from "@tsparticles/engine";
2
+ import type { IInteractivityParticle } from "./Options/Interfaces/IInteractivityParticle.js";
3
+ import type { InteractivityParticle } from "./Options/Classes/InteractivityParticle.js";
4
+ import type { InteractivityParticleOptions } from "./Options/Classes/InteractivityParticleOptions.js";
5
+ export interface IParticleMode {
6
+ particle: IInteractivityParticle;
7
+ }
8
+ export interface ParticleMode {
9
+ particle?: InteractivityParticle;
10
+ }
11
+ export type InteractivityParticleContainer = Container & {
12
+ actualOptions: InteractivityParticleOptions;
13
+ };
@@ -0,0 +1,2 @@
1
+ import type { Engine } from "@tsparticles/engine";
2
+ export declare function loadExternalParticleInteraction(engine: Engine, refresh?: boolean): Promise<void>;
@@ -0,0 +1,116 @@
1
+ (function (factory) {
2
+ if (typeof module === "object" && typeof module.exports === "object") {
3
+ var v = factory(require, exports);
4
+ if (v !== undefined) module.exports = v;
5
+ }
6
+ else if (typeof define === "function" && define.amd) {
7
+ define(["require", "exports", "@tsparticles/engine", "./Options/Classes/InteractivityParticle.js"], factory);
8
+ }
9
+ })(function (require, exports) {
10
+ "use strict";
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.InteractivityParticleMaker = void 0;
13
+ const engine_1 = require("@tsparticles/engine");
14
+ const InteractivityParticle_js_1 = require("./Options/Classes/InteractivityParticle.js");
15
+ const particleMode = "particle";
16
+ class InteractivityParticleMaker extends engine_1.ExternalInteractorBase {
17
+ constructor(container) {
18
+ super(container);
19
+ }
20
+ clear() {
21
+ }
22
+ init() {
23
+ }
24
+ async interact() {
25
+ const container = this.container, { interactivity } = container, options = container.actualOptions;
26
+ if (!container.retina.reduceFactor) {
27
+ return;
28
+ }
29
+ const mousePos = interactivity.mouse.position, interactivityParticleOptions = options.interactivity.modes.particle;
30
+ if (!interactivityParticleOptions) {
31
+ return;
32
+ }
33
+ const mouseStopped = interactivityParticleOptions.pauseOnStop &&
34
+ (interactivity.mouse.position === this._lastPosition ||
35
+ (interactivity.mouse.position?.x === this._lastPosition?.x &&
36
+ interactivity.mouse.position?.y === this._lastPosition?.y)), clearDelay = interactivityParticleOptions.stopDelay;
37
+ if (mousePos) {
38
+ this._lastPosition = { ...mousePos };
39
+ }
40
+ else {
41
+ delete this._lastPosition;
42
+ }
43
+ if (!this._lastPosition) {
44
+ return;
45
+ }
46
+ if (mouseStopped) {
47
+ if (this._clearTimeout) {
48
+ return;
49
+ }
50
+ this._clearTimeout = setTimeout(() => {
51
+ if (!this._particle) {
52
+ return;
53
+ }
54
+ if (interactivityParticleOptions.replaceCursor) {
55
+ const element = interactivity.element;
56
+ if (element) {
57
+ if (element instanceof Window) {
58
+ document.body.style.cursor = "";
59
+ }
60
+ else {
61
+ element.style.cursor = "";
62
+ }
63
+ }
64
+ }
65
+ this.container.particles.remove(this._particle, undefined, true);
66
+ delete this._particle;
67
+ }, clearDelay);
68
+ return;
69
+ }
70
+ if (this._clearTimeout) {
71
+ clearTimeout(this._clearTimeout);
72
+ delete this._clearTimeout;
73
+ }
74
+ if (!this._particle) {
75
+ const particleOptions = (0, engine_1.deepExtend)(interactivityParticleOptions.options, {
76
+ move: {
77
+ enable: false,
78
+ },
79
+ });
80
+ this._particle = await container.particles.addParticle(this._lastPosition, particleOptions);
81
+ if (interactivityParticleOptions.replaceCursor) {
82
+ const element = interactivity.element;
83
+ if (element) {
84
+ if (element instanceof Window) {
85
+ document.body.style.cursor = "none";
86
+ }
87
+ else {
88
+ element.style.cursor = "none";
89
+ }
90
+ }
91
+ }
92
+ }
93
+ if (!this._particle) {
94
+ return;
95
+ }
96
+ this._particle.position.x = this._lastPosition.x;
97
+ this._particle.position.y = this._lastPosition.y;
98
+ }
99
+ isEnabled(particle) {
100
+ const container = this.container, options = container.actualOptions, mouse = container.interactivity.mouse, events = (particle?.interactivity ?? options.interactivity).events;
101
+ return ((mouse.clicking && mouse.inside && !!mouse.position && (0, engine_1.isInArray)(particleMode, events.onClick.mode)) ||
102
+ (mouse.inside && !!mouse.position && (0, engine_1.isInArray)(particleMode, events.onHover.mode)));
103
+ }
104
+ loadModeOptions(options, ...sources) {
105
+ if (!options.particle) {
106
+ options.particle = new InteractivityParticle_js_1.InteractivityParticle();
107
+ }
108
+ for (const source of sources) {
109
+ options.particle.load(source?.particle);
110
+ }
111
+ }
112
+ reset() {
113
+ }
114
+ }
115
+ exports.InteractivityParticleMaker = InteractivityParticleMaker;
116
+ });
@@ -0,0 +1,39 @@
1
+ (function (factory) {
2
+ if (typeof module === "object" && typeof module.exports === "object") {
3
+ var v = factory(require, exports);
4
+ if (v !== undefined) module.exports = v;
5
+ }
6
+ else if (typeof define === "function" && define.amd) {
7
+ define(["require", "exports", "@tsparticles/engine"], factory);
8
+ }
9
+ })(function (require, exports) {
10
+ "use strict";
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.InteractivityParticle = void 0;
13
+ const engine_1 = require("@tsparticles/engine");
14
+ class InteractivityParticle {
15
+ constructor() {
16
+ this.replaceCursor = false;
17
+ this.pauseOnStop = false;
18
+ this.stopDelay = 0;
19
+ }
20
+ load(data) {
21
+ if (!data) {
22
+ return;
23
+ }
24
+ if (data.options !== undefined) {
25
+ this.options = (0, engine_1.deepExtend)({}, data.options);
26
+ }
27
+ if (data.replaceCursor !== undefined) {
28
+ this.replaceCursor = data.replaceCursor;
29
+ }
30
+ if (data.pauseOnStop !== undefined) {
31
+ this.pauseOnStop = data.pauseOnStop;
32
+ }
33
+ if (data.stopDelay !== undefined) {
34
+ this.stopDelay = data.stopDelay;
35
+ }
36
+ }
37
+ }
38
+ exports.InteractivityParticle = InteractivityParticle;
39
+ });
@@ -0,0 +1,12 @@
1
+ (function (factory) {
2
+ if (typeof module === "object" && typeof module.exports === "object") {
3
+ var v = factory(require, exports);
4
+ if (v !== undefined) module.exports = v;
5
+ }
6
+ else if (typeof define === "function" && define.amd) {
7
+ define(["require", "exports"], factory);
8
+ }
9
+ })(function (require, exports) {
10
+ "use strict";
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ });
@@ -0,0 +1,12 @@
1
+ (function (factory) {
2
+ if (typeof module === "object" && typeof module.exports === "object") {
3
+ var v = factory(require, exports);
4
+ if (v !== undefined) module.exports = v;
5
+ }
6
+ else if (typeof define === "function" && define.amd) {
7
+ define(["require", "exports"], factory);
8
+ }
9
+ })(function (require, exports) {
10
+ "use strict";
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ });
package/umd/Types.js ADDED
@@ -0,0 +1,12 @@
1
+ (function (factory) {
2
+ if (typeof module === "object" && typeof module.exports === "object") {
3
+ var v = factory(require, exports);
4
+ if (v !== undefined) module.exports = v;
5
+ }
6
+ else if (typeof define === "function" && define.amd) {
7
+ define(["require", "exports"], factory);
8
+ }
9
+ })(function (require, exports) {
10
+ "use strict";
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ });
package/umd/index.js ADDED
@@ -0,0 +1,44 @@
1
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
2
+ if (k2 === undefined) k2 = k;
3
+ var desc = Object.getOwnPropertyDescriptor(m, k);
4
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
5
+ desc = { enumerable: true, get: function() { return m[k]; } };
6
+ }
7
+ Object.defineProperty(o, k2, desc);
8
+ }) : (function(o, m, k, k2) {
9
+ if (k2 === undefined) k2 = k;
10
+ o[k2] = m[k];
11
+ }));
12
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
13
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
14
+ }) : function(o, v) {
15
+ o["default"] = v;
16
+ });
17
+ var __importStar = (this && this.__importStar) || function (mod) {
18
+ if (mod && mod.__esModule) return mod;
19
+ var result = {};
20
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
21
+ __setModuleDefault(result, mod);
22
+ return result;
23
+ };
24
+ (function (factory) {
25
+ if (typeof module === "object" && typeof module.exports === "object") {
26
+ var v = factory(require, exports);
27
+ if (v !== undefined) module.exports = v;
28
+ }
29
+ else if (typeof define === "function" && define.amd) {
30
+ define(["require", "exports"], factory);
31
+ }
32
+ })(function (require, exports) {
33
+ "use strict";
34
+ var __syncRequire = typeof module === "object" && typeof module.exports === "object";
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.loadExternalParticleInteraction = void 0;
37
+ async function loadExternalParticleInteraction(engine, refresh = true) {
38
+ await engine.addInteractor("externalParticle", async (container) => {
39
+ const { InteractivityParticleMaker } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./InteractivityParticleMaker.js"))) : new Promise((resolve_1, reject_1) => { require(["./InteractivityParticleMaker.js"], resolve_1, reject_1); }).then(__importStar));
40
+ return new InteractivityParticleMaker(container);
41
+ }, refresh);
42
+ }
43
+ exports.loadExternalParticleInteraction = loadExternalParticleInteraction;
44
+ });