@tsparticles/interaction-external-pause 4.0.0-beta.12 → 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,357 +1,60 @@
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.12
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/plugin-interactivity"), require("@tsparticles/engine"));
20
- else if(typeof define === 'function' && define.amd)
21
- define(["@tsparticles/plugin-interactivity", "@tsparticles/engine"], factory);
22
- else {
23
- var a = typeof exports === 'object' ? factory(require("@tsparticles/plugin-interactivity"), require("@tsparticles/engine")) : 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_plugin_interactivity__, __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__) => {
27
- return /******/ (() => { // webpackBootstrap
28
- /******/ "use strict";
29
- /******/ var __webpack_modules__ = ({
30
-
31
- /***/ "@tsparticles/engine"
32
- /*!*********************************************************************************************************************************!*\
33
- !*** external {"commonjs":"@tsparticles/engine","commonjs2":"@tsparticles/engine","amd":"@tsparticles/engine","root":"window"} ***!
34
- \*********************************************************************************************************************************/
35
- (module) {
36
-
37
- module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
38
-
39
- /***/ },
40
-
41
- /***/ "@tsparticles/plugin-interactivity"
42
- /*!***************************************************************************************************************************************************************************!*\
43
- !*** external {"commonjs":"@tsparticles/plugin-interactivity","commonjs2":"@tsparticles/plugin-interactivity","amd":"@tsparticles/plugin-interactivity","root":"window"} ***!
44
- \***************************************************************************************************************************************************************************/
45
- (module) {
46
-
47
- module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_interactivity__;
48
-
49
- /***/ },
50
-
51
- /***/ "./dist/browser/index.js"
52
- /*!*******************************!*\
53
- !*** ./dist/browser/index.js ***!
54
- \*******************************/
55
- (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
56
-
57
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadExternalPauseInteraction: () => (/* binding */ loadExternalPauseInteraction)\n/* harmony export */ });\nasync function loadExternalPauseInteraction(engine) {\n engine.checkVersion(\"4.0.0-beta.12\");\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 e.pluginManager.addInteractor?.(\"externalPause\", async (container)=>{\n const { Pauser } = await __webpack_require__.e(/*! import() */ \"dist_browser_Pauser_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./Pauser.js */ \"./dist/browser/Pauser.js\"));\n return new Pauser(container);\n });\n });\n}\n\n\n//# sourceURL=webpack://@tsparticles/interaction-external-pause/./dist/browser/index.js?\n}");
58
-
59
- /***/ }
60
-
61
- /******/ });
62
- /************************************************************************/
63
- /******/ // The module cache
64
- /******/ var __webpack_module_cache__ = {};
65
- /******/
66
- /******/ // The require function
67
- /******/ function __webpack_require__(moduleId) {
68
- /******/ // Check if module is in cache
69
- /******/ var cachedModule = __webpack_module_cache__[moduleId];
70
- /******/ if (cachedModule !== undefined) {
71
- /******/ return cachedModule.exports;
72
- /******/ }
73
- /******/ // Create a new module (and put it into the cache)
74
- /******/ var module = __webpack_module_cache__[moduleId] = {
75
- /******/ // no module.id needed
76
- /******/ // no module.loaded needed
77
- /******/ exports: {}
78
- /******/ };
79
- /******/
80
- /******/ // Execute the module function
81
- /******/ if (!(moduleId in __webpack_modules__)) {
82
- /******/ delete __webpack_module_cache__[moduleId];
83
- /******/ var e = new Error("Cannot find module '" + moduleId + "'");
84
- /******/ e.code = 'MODULE_NOT_FOUND';
85
- /******/ throw e;
86
- /******/ }
87
- /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
88
- /******/
89
- /******/ // Return the exports of the module
90
- /******/ return module.exports;
91
- /******/ }
92
- /******/
93
- /******/ // expose the modules object (__webpack_modules__)
94
- /******/ __webpack_require__.m = __webpack_modules__;
95
- /******/
96
- /************************************************************************/
97
- /******/ /* webpack/runtime/create fake namespace object */
98
- /******/ (() => {
99
- /******/ var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);
100
- /******/ var leafPrototypes;
101
- /******/ // create a fake namespace object
102
- /******/ // mode & 1: value is a module id, require it
103
- /******/ // mode & 2: merge all properties of value into the ns
104
- /******/ // mode & 4: return value when already ns object
105
- /******/ // mode & 16: return value when it's Promise-like
106
- /******/ // mode & 8|1: behave like require
107
- /******/ __webpack_require__.t = function(value, mode) {
108
- /******/ if(mode & 1) value = this(value);
109
- /******/ if(mode & 8) return value;
110
- /******/ if(typeof value === 'object' && value) {
111
- /******/ if((mode & 4) && value.__esModule) return value;
112
- /******/ if((mode & 16) && typeof value.then === 'function') return value;
113
- /******/ }
114
- /******/ var ns = Object.create(null);
115
- /******/ __webpack_require__.r(ns);
116
- /******/ var def = {};
117
- /******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];
118
- /******/ for(var current = mode & 2 && value; (typeof current == 'object' || typeof current == 'function') && !~leafPrototypes.indexOf(current); current = getProto(current)) {
119
- /******/ Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));
120
- /******/ }
121
- /******/ def['default'] = () => (value);
122
- /******/ __webpack_require__.d(ns, def);
123
- /******/ return ns;
124
- /******/ };
125
- /******/ })();
126
- /******/
127
- /******/ /* webpack/runtime/define property getters */
128
- /******/ (() => {
129
- /******/ // define getter functions for harmony exports
130
- /******/ __webpack_require__.d = (exports, definition) => {
131
- /******/ for(var key in definition) {
132
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
133
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
134
- /******/ }
135
- /******/ }
136
- /******/ };
137
- /******/ })();
138
- /******/
139
- /******/ /* webpack/runtime/ensure chunk */
140
- /******/ (() => {
141
- /******/ __webpack_require__.f = {};
142
- /******/ // This file contains only the entry chunk.
143
- /******/ // The chunk loading function for additional chunks
144
- /******/ __webpack_require__.e = (chunkId) => {
145
- /******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {
146
- /******/ __webpack_require__.f[key](chunkId, promises);
147
- /******/ return promises;
148
- /******/ }, []));
149
- /******/ };
150
- /******/ })();
151
- /******/
152
- /******/ /* webpack/runtime/get javascript chunk filename */
153
- /******/ (() => {
154
- /******/ // This function allow to reference async chunks
155
- /******/ __webpack_require__.u = (chunkId) => {
156
- /******/ // return url for filenames based on template
157
- /******/ return "" + chunkId + ".js";
158
- /******/ };
159
- /******/ })();
160
- /******/
161
- /******/ /* webpack/runtime/global */
162
- /******/ (() => {
163
- /******/ __webpack_require__.g = (function() {
164
- /******/ if (typeof globalThis === 'object') return globalThis;
165
- /******/ try {
166
- /******/ return this || new Function('return this')();
167
- /******/ } catch (e) {
168
- /******/ if (typeof window === 'object') return window;
169
- /******/ }
170
- /******/ })();
171
- /******/ })();
172
- /******/
173
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
174
- /******/ (() => {
175
- /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
176
- /******/ })();
177
- /******/
178
- /******/ /* webpack/runtime/load script */
179
- /******/ (() => {
180
- /******/ var inProgress = {};
181
- /******/ var dataWebpackPrefix = "@tsparticles/interaction-external-pause:";
182
- /******/ // loadScript function to load a script via script tag
183
- /******/ __webpack_require__.l = (url, done, key, chunkId) => {
184
- /******/ if(inProgress[url]) { inProgress[url].push(done); return; }
185
- /******/ var script, needAttach;
186
- /******/ if(key !== undefined) {
187
- /******/ var scripts = document.getElementsByTagName("script");
188
- /******/ for(var i = 0; i < scripts.length; i++) {
189
- /******/ var s = scripts[i];
190
- /******/ if(s.getAttribute("src") == url || s.getAttribute("data-webpack") == dataWebpackPrefix + key) { script = s; break; }
191
- /******/ }
192
- /******/ }
193
- /******/ if(!script) {
194
- /******/ needAttach = true;
195
- /******/ script = document.createElement('script');
196
- /******/
197
- /******/ script.charset = 'utf-8';
198
- /******/ if (__webpack_require__.nc) {
199
- /******/ script.setAttribute("nonce", __webpack_require__.nc);
200
- /******/ }
201
- /******/ script.setAttribute("data-webpack", dataWebpackPrefix + key);
202
- /******/
203
- /******/ script.src = url;
204
- /******/ }
205
- /******/ inProgress[url] = [done];
206
- /******/ var onScriptComplete = (prev, event) => {
207
- /******/ // avoid mem leaks in IE.
208
- /******/ script.onerror = script.onload = null;
209
- /******/ clearTimeout(timeout);
210
- /******/ var doneFns = inProgress[url];
211
- /******/ delete inProgress[url];
212
- /******/ script.parentNode && script.parentNode.removeChild(script);
213
- /******/ doneFns && doneFns.forEach((fn) => (fn(event)));
214
- /******/ if(prev) return prev(event);
215
- /******/ }
216
- /******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
217
- /******/ script.onerror = onScriptComplete.bind(null, script.onerror);
218
- /******/ script.onload = onScriptComplete.bind(null, script.onload);
219
- /******/ needAttach && document.head.appendChild(script);
220
- /******/ };
221
- /******/ })();
222
- /******/
223
- /******/ /* webpack/runtime/make namespace object */
224
- /******/ (() => {
225
- /******/ // define __esModule on exports
226
- /******/ __webpack_require__.r = (exports) => {
227
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
228
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
229
- /******/ }
230
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
231
- /******/ };
232
- /******/ })();
233
- /******/
234
- /******/ /* webpack/runtime/publicPath */
235
- /******/ (() => {
236
- /******/ var scriptUrl;
237
- /******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + "";
238
- /******/ var document = __webpack_require__.g.document;
239
- /******/ if (!scriptUrl && document) {
240
- /******/ if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')
241
- /******/ scriptUrl = document.currentScript.src;
242
- /******/ if (!scriptUrl) {
243
- /******/ var scripts = document.getElementsByTagName("script");
244
- /******/ if(scripts.length) {
245
- /******/ var i = scripts.length - 1;
246
- /******/ while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;
247
- /******/ }
248
- /******/ }
249
- /******/ }
250
- /******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration
251
- /******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.
252
- /******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
253
- /******/ scriptUrl = scriptUrl.replace(/^blob:/, "").replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
254
- /******/ __webpack_require__.p = scriptUrl;
255
- /******/ })();
256
- /******/
257
- /******/ /* webpack/runtime/jsonp chunk loading */
258
- /******/ (() => {
259
- /******/ // no baseURI
260
- /******/
261
- /******/ // object to store loaded and loading chunks
262
- /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
263
- /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
264
- /******/ var installedChunks = {
265
- /******/ "tsparticles.interaction.external.pause": 0
266
- /******/ };
267
- /******/
268
- /******/ __webpack_require__.f.j = (chunkId, promises) => {
269
- /******/ // JSONP chunk loading for javascript
270
- /******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;
271
- /******/ if(installedChunkData !== 0) { // 0 means "already installed".
272
- /******/
273
- /******/ // a Promise means "currently loading".
274
- /******/ if(installedChunkData) {
275
- /******/ promises.push(installedChunkData[2]);
276
- /******/ } else {
277
- /******/ if(true) { // all chunks have JS
278
- /******/ // setup Promise in chunk cache
279
- /******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));
280
- /******/ promises.push(installedChunkData[2] = promise);
281
- /******/
282
- /******/ // start chunk loading
283
- /******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId);
284
- /******/ // create error before stack unwound to get useful stacktrace later
285
- /******/ var error = new Error();
286
- /******/ var loadingEnded = (event) => {
287
- /******/ if(__webpack_require__.o(installedChunks, chunkId)) {
288
- /******/ installedChunkData = installedChunks[chunkId];
289
- /******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined;
290
- /******/ if(installedChunkData) {
291
- /******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type);
292
- /******/ var realSrc = event && event.target && event.target.src;
293
- /******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')';
294
- /******/ error.name = 'ChunkLoadError';
295
- /******/ error.type = errorType;
296
- /******/ error.request = realSrc;
297
- /******/ installedChunkData[1](error);
298
- /******/ }
299
- /******/ }
300
- /******/ };
301
- /******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId);
302
- /******/ }
303
- /******/ }
304
- /******/ }
305
- /******/ };
306
- /******/
307
- /******/ // no prefetching
308
- /******/
309
- /******/ // no preloaded
310
- /******/
311
- /******/ // no HMR
312
- /******/
313
- /******/ // no HMR manifest
314
- /******/
315
- /******/ // no on chunks loaded
316
- /******/
317
- /******/ // install a JSONP callback for chunk loading
318
- /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
319
- /******/ var [chunkIds, moreModules, runtime] = data;
320
- /******/ // add "moreModules" to the modules object,
321
- /******/ // then flag all "chunkIds" as loaded and fire callback
322
- /******/ var moduleId, chunkId, i = 0;
323
- /******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
324
- /******/ for(moduleId in moreModules) {
325
- /******/ if(__webpack_require__.o(moreModules, moduleId)) {
326
- /******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
327
- /******/ }
328
- /******/ }
329
- /******/ if(runtime) var result = runtime(__webpack_require__);
330
- /******/ }
331
- /******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
332
- /******/ for(;i < chunkIds.length; i++) {
333
- /******/ chunkId = chunkIds[i];
334
- /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
335
- /******/ installedChunks[chunkId][0]();
336
- /******/ }
337
- /******/ installedChunks[chunkId] = 0;
338
- /******/ }
339
- /******/
340
- /******/ }
341
- /******/
342
- /******/ var chunkLoadingGlobal = this["webpackChunk_tsparticles_interaction_external_pause"] = this["webpackChunk_tsparticles_interaction_external_pause"] || [];
343
- /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
344
- /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
345
- /******/ })();
346
- /******/
347
- /************************************************************************/
348
- /******/
349
- /******/ // startup
350
- /******/ // Load entry module and return exports
351
- /******/ // This entry module can't be inlined because the eval devtool is used.
352
- /******/ var __webpack_exports__ = __webpack_require__("./dist/browser/index.js");
353
- /******/
354
- /******/ return __webpack_exports__;
355
- /******/ })()
356
- ;
357
- });
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.externalPause = global.__tsParticlesInternals.interactions.externalPause || {}), global.__tsParticlesInternals.plugins.interactivity, global.__tsParticlesInternals.engine));
7
+ })(this, (function (exports, pluginInteractivity, engine) { 'use strict';
8
+
9
+ const pauseMode = "pause";
10
+ class Pauser extends pluginInteractivity.ExternalInteractorBase {
11
+ handleClickMode;
12
+ maxDistance = 0;
13
+ constructor(container) {
14
+ super(container);
15
+ this.handleClickMode = (mode) => {
16
+ if (mode !== pauseMode) {
17
+ return;
18
+ }
19
+ const container = this.container;
20
+ if (container.animationStatus) {
21
+ container.pause();
22
+ }
23
+ else {
24
+ container.play();
25
+ }
26
+ };
27
+ }
28
+ clear() {
29
+ }
30
+ init() {
31
+ }
32
+ interact() {
33
+ }
34
+ isEnabled(_interactivityData, particle) {
35
+ const container = this.container, options = container.actualOptions, events = (particle?.interactivity ?? options.interactivity)?.events;
36
+ return !!events && engine.isInArray(pauseMode, events.onClick.mode);
37
+ }
38
+ reset() {
39
+ }
40
+ }
41
+
42
+ async function loadExternalPauseInteraction(engine) {
43
+ engine.checkVersion("4.0.0-beta.15");
44
+ await engine.pluginManager.register((e) => {
45
+ pluginInteractivity.ensureInteractivityPluginLoaded(e);
46
+ e.pluginManager.addInteractor?.("externalPause", container => {
47
+ return Promise.resolve(new Pauser(container));
48
+ });
49
+ });
50
+ }
51
+
52
+ const globalObject = globalThis;
53
+ globalObject.__tsParticlesInternals = globalObject.__tsParticlesInternals ?? {};
54
+ globalObject.loadExternalPauseInteraction = loadExternalPauseInteraction;
55
+
56
+ exports.loadExternalPauseInteraction = loadExternalPauseInteraction;
57
+
58
+ }));
59
+ Object.assign(globalThis.window || globalThis, { loadExternalPauseInteraction: (globalThis.__tsParticlesInternals.interactions.externalPause || {}).loadExternalPauseInteraction });
60
+ delete (globalThis.window || globalThis).tsparticlesInternalExports;
@@ -1,2 +1 @@
1
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/plugin-interactivity"),require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/plugin-interactivity","@tsparticles/engine"],t);else{var r="object"==typeof exports?t(require("@tsparticles/plugin-interactivity"),require("@tsparticles/engine")):t(e.window,e.window);for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(this,(e,t)=>(()=>{"use strict";var r,n,o,i={303(e){e.exports=t},702(t){t.exports=e}},a={};function s(e){var t=a[e];if(void 0!==t)return t.exports;var r=a[e]={exports:{}};return i[e](r,r.exports,s),r.exports}s.m=i,l=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,s.t=function(e,t){if(1&t&&(e=this(e)),8&t||"object"==typeof e&&e&&(4&t&&e.__esModule||16&t&&"function"==typeof e.then))return e;var r=Object.create(null);s.r(r);var n={};c=c||[null,l({}),l([]),l(l)];for(var o=2&t&&e;("object"==typeof o||"function"==typeof o)&&!~c.indexOf(o);o=l(o))Object.getOwnPropertyNames(o).forEach(t=>n[t]=()=>e[t]);return n.default=()=>e,s.d(r,n),r},s.d=(e,t)=>{for(var r in t)s.o(t,r)&&!s.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},s.f={},s.e=e=>Promise.all(Object.keys(s.f).reduce((t,r)=>(s.f[r](e,t),t),[])),s.u=e=>""+e+".min.js",s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),p={},s.l=(e,t,r,n)=>{if(p[e])return void p[e].push(t);if(void 0!==r)for(var o,i,a=document.getElementsByTagName("script"),c=0;c<a.length;c++){var l=a[c];if(l.getAttribute("src")==e||l.getAttribute("data-webpack")=="@tsparticles/interaction-external-pause:"+r){o=l;break}}o||(i=!0,(o=document.createElement("script")).charset="utf-8",s.nc&&o.setAttribute("nonce",s.nc),o.setAttribute("data-webpack","@tsparticles/interaction-external-pause:"+r),o.src=e),p[e]=[t];var u=(t,r)=>{o.onerror=o.onload=null,clearTimeout(f);var n=p[e];if(delete p[e],o.parentNode&&o.parentNode.removeChild(o),n&&n.forEach(e=>e(r)),t)return t(r)},f=setTimeout(u.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=u.bind(null,o.onerror),o.onload=u.bind(null,o.onload),i&&document.head.appendChild(o)},s.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.g.importScripts&&(u=s.g.location+"");var c,l,p,u,f=s.g.document;if(!u&&f&&(f.currentScript&&"SCRIPT"===f.currentScript.tagName.toUpperCase()&&(u=f.currentScript.src),!u)){var d=f.getElementsByTagName("script");if(d.length)for(var b=d.length-1;b>-1&&(!u||!/^http(s?):/.test(u));)u=d[b--].src}if(!u)throw Error("Automatic publicPath is not supported in this browser");s.p=u=u.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r={736:0},s.f.j=(e,t)=>{var n=s.o(r,e)?r[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var o=new Promise((t,o)=>n=r[e]=[t,o]);t.push(n[2]=o);var i=s.p+s.u(e),a=Error();s.l(i,t=>{if(s.o(r,e)&&(0!==(n=r[e])&&(r[e]=void 0),n)){var o=t&&("load"===t.type?"missing":t.type),i=t&&t.target&&t.target.src;a.message="Loading chunk "+e+` failed.
2
- (`+o+": "+i+")",a.name="ChunkLoadError",a.type=o,a.request=i,n[1](a)}},"chunk-"+e,e)}},n=(e,t)=>{var n,o,[i,a,c]=t,l=0;if(i.some(e=>0!==r[e])){for(n in a)s.o(a,n)&&(s.m[n]=a[n]);c&&c(s)}for(e&&e(t);l<i.length;l++)o=i[l],s.o(r,o)&&r[o]&&r[o][0](),r[o]=0},(o=this.webpackChunk_tsparticles_interaction_external_pause=this.webpackChunk_tsparticles_interaction_external_pause||[]).forEach(n.bind(null,0)),o.push=n.bind(null,o.push.bind(o));var g={};async function h(e){e.checkVersion("4.0.0-beta.12"),await e.pluginManager.register(async e=>{let{ensureInteractivityPluginLoaded:t}=await Promise.resolve().then(s.t.bind(s,702,19));t(e),e.pluginManager.addInteractor?.("externalPause",async e=>{let{Pauser:t}=await s.e(748).then(s.bind(s,748));return new t(e)})})}return s.r(g),s.d(g,{loadExternalPauseInteraction:()=>h}),g})());
1
+ !function(t){t.__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.bundles=t.__tsParticlesInternals.bundles||{},t.__tsParticlesInternals.effects=t.__tsParticlesInternals.effects||{},t.__tsParticlesInternals.engine=t.__tsParticlesInternals.engine||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},t.__tsParticlesInternals.palettes=t.__tsParticlesInternals.palettes||{},t.__tsParticlesInternals.paths=t.__tsParticlesInternals.paths||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins.emittersShapes=t.__tsParticlesInternals.plugins.emittersShapes||{},t.__tsParticlesInternals.presets=t.__tsParticlesInternals.presets||{},t.__tsParticlesInternals.shapes=t.__tsParticlesInternals.shapes||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.utils=t.__tsParticlesInternals.utils||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas.utils=t.__tsParticlesInternals.canvas.utils||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path.utils=t.__tsParticlesInternals.path.utils||{};var s="undefined"!=typeof Proxy?function(t){return new Proxy(t,{get:function(t,s){return s in t||(t[s]={}),t[s]}})}:function(t){return t};t.__tsParticlesInternals.bundles=s(t.__tsParticlesInternals.bundles),t.__tsParticlesInternals.effects=s(t.__tsParticlesInternals.effects),t.__tsParticlesInternals.interactions=s(t.__tsParticlesInternals.interactions),t.__tsParticlesInternals.palettes=s(t.__tsParticlesInternals.palettes),t.__tsParticlesInternals.paths=s(t.__tsParticlesInternals.paths),t.__tsParticlesInternals.plugins=s(t.__tsParticlesInternals.plugins),t.__tsParticlesInternals.plugins.emittersShapes=s(t.__tsParticlesInternals.plugins.emittersShapes),t.__tsParticlesInternals.presets=s(t.__tsParticlesInternals.presets),t.__tsParticlesInternals.shapes=s(t.__tsParticlesInternals.shapes),t.__tsParticlesInternals.updaters=s(t.__tsParticlesInternals.updaters),t.__tsParticlesInternals.utils=s(t.__tsParticlesInternals.utils),t.__tsParticlesInternals.canvas=s(t.__tsParticlesInternals.canvas),t.__tsParticlesInternals.path=s(t.__tsParticlesInternals.path),t.tsparticlesInternalExports=t.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(t,s){"object"==typeof exports&&"undefined"!=typeof module?s(exports,require("@tsparticles/plugin-interactivity"),require("@tsparticles/engine")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/plugin-interactivity","@tsparticles/engine"],s):s(((t="undefined"!=typeof globalThis?globalThis:t||self).__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},t.__tsParticlesInternals.interactions.externalPause=t.__tsParticlesInternals.interactions.externalPause||{}),t.__tsParticlesInternals.plugins.interactivity,t.__tsParticlesInternals.engine)}(this,function(t,s,e){"use strict";const n="pause";class a extends s.ExternalInteractorBase{handleClickMode;maxDistance=0;constructor(t){super(t),this.handleClickMode=t=>{if(t!==n)return;const s=this.container;s.animationStatus?s.pause():s.play()}}clear(){}init(){}interact(){}isEnabled(t,s){const a=this.container.actualOptions,r=(s?.interactivity??a.interactivity)?.events;return!!r&&e.isInArray(n,r.onClick.mode)}reset(){}}async function r(t){t.checkVersion("4.0.0-beta.15"),await t.pluginManager.register(t=>{s.ensureInteractivityPluginLoaded(t),t.pluginManager.addInteractor?.("externalPause",t=>Promise.resolve(new a(t)))})}const l=globalThis;l.__tsParticlesInternals=l.__tsParticlesInternals??{},l.loadExternalPauseInteraction=r,t.loadExternalPauseInteraction=r}),Object.assign(globalThis.window||globalThis,{loadExternalPauseInteraction:(globalThis.__tsParticlesInternals.interactions.externalPause||{}).loadExternalPauseInteraction}),delete(globalThis.window||globalThis).tsparticlesInternalExports;
@@ -0,0 +1 @@
1
+ export * from "./index.js";
@@ -0,0 +1,2 @@
1
+ import { type Engine } from "@tsparticles/engine/lazy";
2
+ export declare function loadExternalPauseInteraction(engine: Engine): Promise<void>;
package/748.min.js DELETED
@@ -1 +0,0 @@
1
- "use strict";(this.webpackChunk_tsparticles_interaction_external_pause=this.webpackChunk_tsparticles_interaction_external_pause||[]).push([[748],{748(t,e,a){a.d(e,{Pauser:()=>r});var i=a(702),n=a(303);let s="pause";class r extends i.ExternalInteractorBase{handleClickMode;maxDistance=0;constructor(t){super(t),this.handleClickMode=t=>{if(t!==s)return;let e=this.container;e.animationStatus?e.pause():e.play()}}clear(){}init(){}interact(){}isEnabled(t,e){let a=this.container.actualOptions,i=(e?.interactivity??a.interactivity)?.events;return!!i&&(0,n.isInArray)(s,i.onClick.mode)}reset(){}}}}]);
@@ -1,30 +0,0 @@
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.12
8
- */
9
- "use strict";
10
- /*
11
- * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
12
- * This devtool is neither made for production nor for readable output files.
13
- * It uses "eval()" calls to create a separate source file in the browser devtools.
14
- * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
15
- * or disable the default devtool with "devtool: false".
16
- * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
17
- */
18
- (this["webpackChunk_tsparticles_interaction_external_pause"] = this["webpackChunk_tsparticles_interaction_external_pause"] || []).push([["dist_browser_Pauser_js"],{
19
-
20
- /***/ "./dist/browser/Pauser.js"
21
- /*!********************************!*\
22
- !*** ./dist/browser/Pauser.js ***!
23
- \********************************/
24
- (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
25
-
26
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Pauser: () => (/* binding */ Pauser)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_plugin_interactivity__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/plugin-interactivity */ \"@tsparticles/plugin-interactivity\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\n\nconst pauseMode = \"pause\";\nclass Pauser extends _tsparticles_plugin_interactivity__WEBPACK_IMPORTED_MODULE_0__.ExternalInteractorBase {\n handleClickMode;\n maxDistance = 0;\n constructor(container){\n super(container);\n this.handleClickMode = (mode)=>{\n if (mode !== pauseMode) {\n return;\n }\n const container = this.container;\n if (container.animationStatus) {\n container.pause();\n } else {\n container.play();\n }\n };\n }\n clear() {}\n init() {}\n interact() {}\n isEnabled(_interactivityData, particle) {\n const container = this.container, options = container.actualOptions, events = (particle?.interactivity ?? options.interactivity)?.events;\n return !!events && (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__.isInArray)(pauseMode, events.onClick.mode);\n }\n reset() {}\n}\n\n\n//# sourceURL=webpack://@tsparticles/interaction-external-pause/./dist/browser/Pauser.js?\n}");
27
-
28
- /***/ }
29
-
30
- }]);