@tsparticles/plugin-emitters-shape-canvas 4.0.0-beta.12 → 4.0.0-beta.16

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,367 +1,266 @@
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-emitters"), require("@tsparticles/engine"), require("@tsparticles/canvas-utils"));
20
- else if(typeof define === 'function' && define.amd)
21
- define(["@tsparticles/plugin-emitters", "@tsparticles/engine", "@tsparticles/canvas-utils"], factory);
22
- else {
23
- var a = typeof exports === 'object' ? factory(require("@tsparticles/plugin-emitters"), require("@tsparticles/engine"), require("@tsparticles/canvas-utils")) : factory(root["window"], 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_emitters__, __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__, __WEBPACK_EXTERNAL_MODULE__tsparticles_canvas_utils__) => {
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
+ /* Emitters Shape v4.0.0-beta.16 */
3
+ (function (global, factory) {
4
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tsparticles/plugin-emitters'), require('@tsparticles/engine'), require('@tsparticles/canvas-utils')) :
5
+ typeof define === 'function' && define.amd ? define(['exports', '@tsparticles/plugin-emitters', '@tsparticles/engine', '@tsparticles/canvas-utils'], factory) :
6
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.__tsParticlesInternals = global.__tsParticlesInternals || {}, global.__tsParticlesInternals.plugins = global.__tsParticlesInternals.plugins || {}, global.__tsParticlesInternals.plugins.emittersShapes = global.__tsParticlesInternals.plugins.emittersShapes || {}, global.__tsParticlesInternals.plugins.emittersShapes.canvas = global.__tsParticlesInternals.plugins.emittersShapes.canvas || {}), global.__tsParticlesInternals.plugins.emitters, global.__tsParticlesInternals.engine, global.__tsParticlesInternals.canvas.utils));
7
+ })(this, (function (exports, pluginEmitters, engine, canvasUtils) { 'use strict';
30
8
 
31
- /***/ "@tsparticles/canvas-utils"
32
- /*!***************************************************************************************************************************************************!*\
33
- !*** external {"commonjs":"@tsparticles/canvas-utils","commonjs2":"@tsparticles/canvas-utils","amd":"@tsparticles/canvas-utils","root":"window"} ***!
34
- \***************************************************************************************************************************************************/
35
- (module) {
9
+ const maxRetries = 100;
10
+ class EmittersCanvasShape extends pluginEmitters.EmitterShapeBase {
11
+ filter;
12
+ pixelData;
13
+ scale;
14
+ _container;
15
+ constructor(container, position, size, fill, options) {
16
+ super(position, size, fill, options);
17
+ this._container = container;
18
+ const filter = options.filter, minAlpha = 0;
19
+ let filterFunc = (pixel) => pixel.a > minAlpha;
20
+ if (engine.isString(filter)) {
21
+ if (filter in globalThis) {
22
+ const wndFilter = globalThis[filter];
23
+ if (engine.isFunction(wndFilter)) {
24
+ filterFunc = wndFilter;
25
+ }
26
+ }
27
+ }
28
+ else {
29
+ filterFunc = filter;
30
+ }
31
+ this.filter = filterFunc;
32
+ this.scale = options.scale;
33
+ this.pixelData = {
34
+ pixels: [],
35
+ height: 0,
36
+ width: 0,
37
+ };
38
+ }
39
+ async init() {
40
+ let pixelData;
41
+ const options = this.options, selector = options.selector, pixels = options.pixels, image = options.image, element = options.element, text = options.text, offset = pixels.offset;
42
+ if (image) {
43
+ const url = image.src;
44
+ if (!url) {
45
+ return;
46
+ }
47
+ pixelData = await canvasUtils.getImageData(url, offset, this._container.canvas.render.settings);
48
+ }
49
+ else if (element ?? selector) {
50
+ const canvas = element ?? (selector && engine.safeDocument().querySelector(selector));
51
+ if (!canvas) {
52
+ return;
53
+ }
54
+ const context = canvas.getContext("2d", this._container.canvas.render.settings);
55
+ if (!context) {
56
+ return;
57
+ }
58
+ pixelData = canvasUtils.getCanvasImageData(context, canvas, offset);
59
+ }
60
+ else {
61
+ const data = canvasUtils.getTextData(text, offset, this.fill, this._container.canvas.render.settings);
62
+ if (engine.isNull(data)) {
63
+ return;
64
+ }
65
+ pixelData = data;
66
+ }
67
+ this.pixelData = pixelData;
68
+ }
69
+ randomPosition() {
70
+ const { height, width } = this.pixelData, data = this.pixelData, position = this.position, scale = this.scale, positionOffset = {
71
+ x: position.x - width * scale * engine.half,
72
+ y: position.y - height * scale * engine.half,
73
+ };
74
+ for (let i = 0; i < maxRetries; i++) {
75
+ const nextIndex = Math.floor(engine.getRandom() * width * height), pixelPos = {
76
+ x: nextIndex % width,
77
+ y: Math.floor(nextIndex / width),
78
+ }, row = data.pixels[pixelPos.y];
79
+ if (!row) {
80
+ continue;
81
+ }
82
+ const pixel = row[pixelPos.x];
83
+ if (!pixel) {
84
+ continue;
85
+ }
86
+ const shouldCreateParticle = this.filter(pixel);
87
+ if (!shouldCreateParticle) {
88
+ continue;
89
+ }
90
+ return {
91
+ position: {
92
+ x: pixelPos.x * scale + positionOffset.x,
93
+ y: pixelPos.y * scale + positionOffset.y,
94
+ },
95
+ color: { ...pixel },
96
+ opacity: pixel.a,
97
+ };
98
+ }
99
+ return null;
100
+ }
101
+ resize(position, size) {
102
+ super.resize(position, size);
103
+ }
104
+ }
36
105
 
37
- module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_canvas_utils__;
106
+ class PixelsOptions {
107
+ offset;
108
+ constructor() {
109
+ this.offset = 4;
110
+ }
111
+ load(data) {
112
+ if (engine.isNull(data)) {
113
+ return;
114
+ }
115
+ if (data.offset !== undefined) {
116
+ this.offset = data.offset;
117
+ }
118
+ }
119
+ }
38
120
 
39
- /***/ },
121
+ class TextFontOptions {
122
+ family;
123
+ size;
124
+ style;
125
+ variant;
126
+ weight;
127
+ constructor() {
128
+ this.family = "Verdana";
129
+ this.size = 32;
130
+ this.style = "";
131
+ this.variant = "";
132
+ this.weight = "";
133
+ }
134
+ load(data) {
135
+ if (engine.isNull(data)) {
136
+ return;
137
+ }
138
+ if (data.family !== undefined) {
139
+ this.family = data.family;
140
+ }
141
+ if (data.size !== undefined) {
142
+ this.size = data.size;
143
+ }
144
+ if (data.style !== undefined) {
145
+ this.style = data.style;
146
+ }
147
+ if (data.variant !== undefined) {
148
+ this.variant = data.variant;
149
+ }
150
+ if (data.weight !== undefined) {
151
+ this.weight = data.weight;
152
+ }
153
+ }
154
+ }
40
155
 
41
- /***/ "@tsparticles/engine"
42
- /*!*********************************************************************************************************************************!*\
43
- !*** external {"commonjs":"@tsparticles/engine","commonjs2":"@tsparticles/engine","amd":"@tsparticles/engine","root":"window"} ***!
44
- \*********************************************************************************************************************************/
45
- (module) {
156
+ class TextLinesOptions {
157
+ separator;
158
+ spacing;
159
+ constructor() {
160
+ this.separator = "\n";
161
+ this.spacing = 0;
162
+ }
163
+ load(data) {
164
+ if (engine.isNull(data)) {
165
+ return;
166
+ }
167
+ if (data.separator !== undefined) {
168
+ this.separator = data.separator;
169
+ }
170
+ if (data.spacing !== undefined) {
171
+ this.spacing = data.spacing;
172
+ }
173
+ }
174
+ }
46
175
 
47
- module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
176
+ class TextOptions {
177
+ color;
178
+ font;
179
+ lines;
180
+ text;
181
+ constructor() {
182
+ this.color = "#000000";
183
+ this.font = new TextFontOptions();
184
+ this.lines = new TextLinesOptions();
185
+ this.text = "";
186
+ }
187
+ load(data) {
188
+ if (engine.isNull(data)) {
189
+ return;
190
+ }
191
+ if (data.color !== undefined) {
192
+ this.color = data.color;
193
+ }
194
+ this.font.load(data.font);
195
+ this.lines.load(data.lines);
196
+ if (data.text !== undefined) {
197
+ this.text = data.text;
198
+ }
199
+ }
200
+ }
48
201
 
49
- /***/ },
202
+ const minAlpha = 0;
203
+ class EmittersCanvasShapeOptions {
204
+ element;
205
+ filter;
206
+ image;
207
+ pixels;
208
+ scale;
209
+ selector;
210
+ text;
211
+ constructor() {
212
+ this.filter = (pixel) => pixel.a > minAlpha;
213
+ this.pixels = new PixelsOptions();
214
+ this.scale = 1;
215
+ this.selector = "";
216
+ this.text = new TextOptions();
217
+ }
218
+ load(data) {
219
+ if (engine.isNull(data)) {
220
+ return;
221
+ }
222
+ if (data.element !== undefined) {
223
+ this.element = data.element;
224
+ }
225
+ if (data.filter !== undefined) {
226
+ this.filter = data.filter;
227
+ }
228
+ this.pixels.load(data.pixels);
229
+ if (data.scale !== undefined) {
230
+ this.scale = data.scale;
231
+ }
232
+ if (data.selector !== undefined) {
233
+ this.selector = data.selector;
234
+ }
235
+ if (data.image !== undefined) {
236
+ this.image = data.image;
237
+ }
238
+ this.text.load(data.text);
239
+ }
240
+ }
50
241
 
51
- /***/ "@tsparticles/plugin-emitters"
52
- /*!************************************************************************************************************************************************************!*\
53
- !*** external {"commonjs":"@tsparticles/plugin-emitters","commonjs2":"@tsparticles/plugin-emitters","amd":"@tsparticles/plugin-emitters","root":"window"} ***!
54
- \************************************************************************************************************************************************************/
55
- (module) {
242
+ class EmittersCanvasShapeGenerator {
243
+ generate(container, position, size, fill, options) {
244
+ const shapeOptions = new EmittersCanvasShapeOptions();
245
+ shapeOptions.load(options);
246
+ return new EmittersCanvasShape(container, position, size, fill, shapeOptions);
247
+ }
248
+ }
56
249
 
57
- module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_emitters__;
250
+ async function loadEmittersShapeCanvas(engine) {
251
+ engine.checkVersion("4.0.0-beta.16");
252
+ await engine.pluginManager.register((e) => {
253
+ pluginEmitters.ensureEmittersPluginLoaded(e);
254
+ e.pluginManager.addEmitterShapeGenerator?.("canvas", new EmittersCanvasShapeGenerator());
255
+ });
256
+ }
58
257
 
59
- /***/ },
258
+ const globalObject = globalThis;
259
+ globalObject.__tsParticlesInternals = globalObject.__tsParticlesInternals ?? {};
260
+ globalObject.loadEmittersShapeCanvas = loadEmittersShapeCanvas;
60
261
 
61
- /***/ "./dist/browser/index.js"
62
- /*!*******************************!*\
63
- !*** ./dist/browser/index.js ***!
64
- \*******************************/
65
- (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
262
+ exports.loadEmittersShapeCanvas = loadEmittersShapeCanvas;
66
263
 
67
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadEmittersShapeCanvas: () => (/* binding */ loadEmittersShapeCanvas)\n/* harmony export */ });\nasync function loadEmittersShapeCanvas(engine) {\n engine.checkVersion(\"4.0.0-beta.12\");\n await engine.pluginManager.register(async (e)=>{\n const { ensureEmittersPluginLoaded } = await Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! @tsparticles/plugin-emitters */ \"@tsparticles/plugin-emitters\", 19));\n ensureEmittersPluginLoaded(e);\n const { EmittersCanvasShapeGenerator } = await __webpack_require__.e(/*! import() */ \"dist_browser_EmittersCanvasShapeGenerator_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./EmittersCanvasShapeGenerator.js */ \"./dist/browser/EmittersCanvasShapeGenerator.js\"));\n e.pluginManager.addEmitterShapeGenerator?.(\"canvas\", new EmittersCanvasShapeGenerator());\n });\n}\n\n\n//# sourceURL=webpack://@tsparticles/plugin-emitters-shape-canvas/./dist/browser/index.js?\n}");
68
-
69
- /***/ }
70
-
71
- /******/ });
72
- /************************************************************************/
73
- /******/ // The module cache
74
- /******/ var __webpack_module_cache__ = {};
75
- /******/
76
- /******/ // The require function
77
- /******/ function __webpack_require__(moduleId) {
78
- /******/ // Check if module is in cache
79
- /******/ var cachedModule = __webpack_module_cache__[moduleId];
80
- /******/ if (cachedModule !== undefined) {
81
- /******/ return cachedModule.exports;
82
- /******/ }
83
- /******/ // Create a new module (and put it into the cache)
84
- /******/ var module = __webpack_module_cache__[moduleId] = {
85
- /******/ // no module.id needed
86
- /******/ // no module.loaded needed
87
- /******/ exports: {}
88
- /******/ };
89
- /******/
90
- /******/ // Execute the module function
91
- /******/ if (!(moduleId in __webpack_modules__)) {
92
- /******/ delete __webpack_module_cache__[moduleId];
93
- /******/ var e = new Error("Cannot find module '" + moduleId + "'");
94
- /******/ e.code = 'MODULE_NOT_FOUND';
95
- /******/ throw e;
96
- /******/ }
97
- /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
98
- /******/
99
- /******/ // Return the exports of the module
100
- /******/ return module.exports;
101
- /******/ }
102
- /******/
103
- /******/ // expose the modules object (__webpack_modules__)
104
- /******/ __webpack_require__.m = __webpack_modules__;
105
- /******/
106
- /************************************************************************/
107
- /******/ /* webpack/runtime/create fake namespace object */
108
- /******/ (() => {
109
- /******/ var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);
110
- /******/ var leafPrototypes;
111
- /******/ // create a fake namespace object
112
- /******/ // mode & 1: value is a module id, require it
113
- /******/ // mode & 2: merge all properties of value into the ns
114
- /******/ // mode & 4: return value when already ns object
115
- /******/ // mode & 16: return value when it's Promise-like
116
- /******/ // mode & 8|1: behave like require
117
- /******/ __webpack_require__.t = function(value, mode) {
118
- /******/ if(mode & 1) value = this(value);
119
- /******/ if(mode & 8) return value;
120
- /******/ if(typeof value === 'object' && value) {
121
- /******/ if((mode & 4) && value.__esModule) return value;
122
- /******/ if((mode & 16) && typeof value.then === 'function') return value;
123
- /******/ }
124
- /******/ var ns = Object.create(null);
125
- /******/ __webpack_require__.r(ns);
126
- /******/ var def = {};
127
- /******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];
128
- /******/ for(var current = mode & 2 && value; (typeof current == 'object' || typeof current == 'function') && !~leafPrototypes.indexOf(current); current = getProto(current)) {
129
- /******/ Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));
130
- /******/ }
131
- /******/ def['default'] = () => (value);
132
- /******/ __webpack_require__.d(ns, def);
133
- /******/ return ns;
134
- /******/ };
135
- /******/ })();
136
- /******/
137
- /******/ /* webpack/runtime/define property getters */
138
- /******/ (() => {
139
- /******/ // define getter functions for harmony exports
140
- /******/ __webpack_require__.d = (exports, definition) => {
141
- /******/ for(var key in definition) {
142
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
143
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
144
- /******/ }
145
- /******/ }
146
- /******/ };
147
- /******/ })();
148
- /******/
149
- /******/ /* webpack/runtime/ensure chunk */
150
- /******/ (() => {
151
- /******/ __webpack_require__.f = {};
152
- /******/ // This file contains only the entry chunk.
153
- /******/ // The chunk loading function for additional chunks
154
- /******/ __webpack_require__.e = (chunkId) => {
155
- /******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {
156
- /******/ __webpack_require__.f[key](chunkId, promises);
157
- /******/ return promises;
158
- /******/ }, []));
159
- /******/ };
160
- /******/ })();
161
- /******/
162
- /******/ /* webpack/runtime/get javascript chunk filename */
163
- /******/ (() => {
164
- /******/ // This function allow to reference async chunks
165
- /******/ __webpack_require__.u = (chunkId) => {
166
- /******/ // return url for filenames based on template
167
- /******/ return "" + chunkId + ".js";
168
- /******/ };
169
- /******/ })();
170
- /******/
171
- /******/ /* webpack/runtime/global */
172
- /******/ (() => {
173
- /******/ __webpack_require__.g = (function() {
174
- /******/ if (typeof globalThis === 'object') return globalThis;
175
- /******/ try {
176
- /******/ return this || new Function('return this')();
177
- /******/ } catch (e) {
178
- /******/ if (typeof window === 'object') return window;
179
- /******/ }
180
- /******/ })();
181
- /******/ })();
182
- /******/
183
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
184
- /******/ (() => {
185
- /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
186
- /******/ })();
187
- /******/
188
- /******/ /* webpack/runtime/load script */
189
- /******/ (() => {
190
- /******/ var inProgress = {};
191
- /******/ var dataWebpackPrefix = "@tsparticles/plugin-emitters-shape-canvas:";
192
- /******/ // loadScript function to load a script via script tag
193
- /******/ __webpack_require__.l = (url, done, key, chunkId) => {
194
- /******/ if(inProgress[url]) { inProgress[url].push(done); return; }
195
- /******/ var script, needAttach;
196
- /******/ if(key !== undefined) {
197
- /******/ var scripts = document.getElementsByTagName("script");
198
- /******/ for(var i = 0; i < scripts.length; i++) {
199
- /******/ var s = scripts[i];
200
- /******/ if(s.getAttribute("src") == url || s.getAttribute("data-webpack") == dataWebpackPrefix + key) { script = s; break; }
201
- /******/ }
202
- /******/ }
203
- /******/ if(!script) {
204
- /******/ needAttach = true;
205
- /******/ script = document.createElement('script');
206
- /******/
207
- /******/ script.charset = 'utf-8';
208
- /******/ if (__webpack_require__.nc) {
209
- /******/ script.setAttribute("nonce", __webpack_require__.nc);
210
- /******/ }
211
- /******/ script.setAttribute("data-webpack", dataWebpackPrefix + key);
212
- /******/
213
- /******/ script.src = url;
214
- /******/ }
215
- /******/ inProgress[url] = [done];
216
- /******/ var onScriptComplete = (prev, event) => {
217
- /******/ // avoid mem leaks in IE.
218
- /******/ script.onerror = script.onload = null;
219
- /******/ clearTimeout(timeout);
220
- /******/ var doneFns = inProgress[url];
221
- /******/ delete inProgress[url];
222
- /******/ script.parentNode && script.parentNode.removeChild(script);
223
- /******/ doneFns && doneFns.forEach((fn) => (fn(event)));
224
- /******/ if(prev) return prev(event);
225
- /******/ }
226
- /******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
227
- /******/ script.onerror = onScriptComplete.bind(null, script.onerror);
228
- /******/ script.onload = onScriptComplete.bind(null, script.onload);
229
- /******/ needAttach && document.head.appendChild(script);
230
- /******/ };
231
- /******/ })();
232
- /******/
233
- /******/ /* webpack/runtime/make namespace object */
234
- /******/ (() => {
235
- /******/ // define __esModule on exports
236
- /******/ __webpack_require__.r = (exports) => {
237
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
238
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
239
- /******/ }
240
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
241
- /******/ };
242
- /******/ })();
243
- /******/
244
- /******/ /* webpack/runtime/publicPath */
245
- /******/ (() => {
246
- /******/ var scriptUrl;
247
- /******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + "";
248
- /******/ var document = __webpack_require__.g.document;
249
- /******/ if (!scriptUrl && document) {
250
- /******/ if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')
251
- /******/ scriptUrl = document.currentScript.src;
252
- /******/ if (!scriptUrl) {
253
- /******/ var scripts = document.getElementsByTagName("script");
254
- /******/ if(scripts.length) {
255
- /******/ var i = scripts.length - 1;
256
- /******/ while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;
257
- /******/ }
258
- /******/ }
259
- /******/ }
260
- /******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration
261
- /******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.
262
- /******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
263
- /******/ scriptUrl = scriptUrl.replace(/^blob:/, "").replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
264
- /******/ __webpack_require__.p = scriptUrl;
265
- /******/ })();
266
- /******/
267
- /******/ /* webpack/runtime/jsonp chunk loading */
268
- /******/ (() => {
269
- /******/ // no baseURI
270
- /******/
271
- /******/ // object to store loaded and loading chunks
272
- /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
273
- /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
274
- /******/ var installedChunks = {
275
- /******/ "tsparticles.plugin.emitters.shape.canvas": 0
276
- /******/ };
277
- /******/
278
- /******/ __webpack_require__.f.j = (chunkId, promises) => {
279
- /******/ // JSONP chunk loading for javascript
280
- /******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;
281
- /******/ if(installedChunkData !== 0) { // 0 means "already installed".
282
- /******/
283
- /******/ // a Promise means "currently loading".
284
- /******/ if(installedChunkData) {
285
- /******/ promises.push(installedChunkData[2]);
286
- /******/ } else {
287
- /******/ if(true) { // all chunks have JS
288
- /******/ // setup Promise in chunk cache
289
- /******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));
290
- /******/ promises.push(installedChunkData[2] = promise);
291
- /******/
292
- /******/ // start chunk loading
293
- /******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId);
294
- /******/ // create error before stack unwound to get useful stacktrace later
295
- /******/ var error = new Error();
296
- /******/ var loadingEnded = (event) => {
297
- /******/ if(__webpack_require__.o(installedChunks, chunkId)) {
298
- /******/ installedChunkData = installedChunks[chunkId];
299
- /******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined;
300
- /******/ if(installedChunkData) {
301
- /******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type);
302
- /******/ var realSrc = event && event.target && event.target.src;
303
- /******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')';
304
- /******/ error.name = 'ChunkLoadError';
305
- /******/ error.type = errorType;
306
- /******/ error.request = realSrc;
307
- /******/ installedChunkData[1](error);
308
- /******/ }
309
- /******/ }
310
- /******/ };
311
- /******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId);
312
- /******/ }
313
- /******/ }
314
- /******/ }
315
- /******/ };
316
- /******/
317
- /******/ // no prefetching
318
- /******/
319
- /******/ // no preloaded
320
- /******/
321
- /******/ // no HMR
322
- /******/
323
- /******/ // no HMR manifest
324
- /******/
325
- /******/ // no on chunks loaded
326
- /******/
327
- /******/ // install a JSONP callback for chunk loading
328
- /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
329
- /******/ var [chunkIds, moreModules, runtime] = data;
330
- /******/ // add "moreModules" to the modules object,
331
- /******/ // then flag all "chunkIds" as loaded and fire callback
332
- /******/ var moduleId, chunkId, i = 0;
333
- /******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
334
- /******/ for(moduleId in moreModules) {
335
- /******/ if(__webpack_require__.o(moreModules, moduleId)) {
336
- /******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
337
- /******/ }
338
- /******/ }
339
- /******/ if(runtime) var result = runtime(__webpack_require__);
340
- /******/ }
341
- /******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
342
- /******/ for(;i < chunkIds.length; i++) {
343
- /******/ chunkId = chunkIds[i];
344
- /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
345
- /******/ installedChunks[chunkId][0]();
346
- /******/ }
347
- /******/ installedChunks[chunkId] = 0;
348
- /******/ }
349
- /******/
350
- /******/ }
351
- /******/
352
- /******/ var chunkLoadingGlobal = this["webpackChunk_tsparticles_plugin_emitters_shape_canvas"] = this["webpackChunk_tsparticles_plugin_emitters_shape_canvas"] || [];
353
- /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
354
- /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
355
- /******/ })();
356
- /******/
357
- /************************************************************************/
358
- /******/
359
- /******/ // startup
360
- /******/ // Load entry module and return exports
361
- /******/ // This entry module can't be inlined because the eval devtool is used.
362
- /******/ var __webpack_exports__ = __webpack_require__("./dist/browser/index.js");
363
- /******/
364
- /******/ return __webpack_exports__;
365
- /******/ })()
366
- ;
367
- });
264
+ }));
265
+ Object.assign(globalThis.window || globalThis, { loadEmittersShapeCanvas: (globalThis.__tsParticlesInternals.plugins.emittersShapes.canvas || {}).loadEmittersShapeCanvas });
266
+ delete (globalThis.window || globalThis).tsparticlesInternalExports;