@tsparticles/plugin-rgb-color 4.0.0-beta.11 → 4.0.0-beta.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,317 +1,70 @@
1
- /*!
2
- * Author : Matteo Bruni
3
- * MIT license: https://opensource.org/licenses/MIT
4
- * Demo / Generator : https://particles.js.org/
5
- * GitHub : https://www.github.com/matteobruni/tsparticles
6
- * How to use? : Check the GitHub README
7
- * v4.0.0-beta.11
8
- */
9
- /*
10
- * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
11
- * This devtool is neither made for production nor for readable output files.
12
- * It uses "eval()" calls to create a separate source file in the browser devtools.
13
- * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
14
- * or disable the default devtool with "devtool: false".
15
- * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
16
- */
17
- (function webpackUniversalModuleDefinition(root, factory) {
18
- if(typeof exports === 'object' && typeof module === 'object')
19
- module.exports = factory(require("@tsparticles/engine"));
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__ = ({
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
+ /* Plugin v4.0.0-beta.15 */
3
+ (function (global, factory) {
4
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tsparticles/engine')) :
5
+ typeof define === 'function' && define.amd ? define(['exports', '@tsparticles/engine'], factory) :
6
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.__tsParticlesInternals = global.__tsParticlesInternals || {}, global.__tsParticlesInternals.plugins = global.__tsParticlesInternals.plugins || {}, global.__tsParticlesInternals.plugins.rgbColor = global.__tsParticlesInternals.plugins.rgbColor || {}), global.__tsParticlesInternals.engine));
7
+ })(this, (function (exports, engine) { 'use strict';
30
8
 
31
- /***/ "@tsparticles/engine"
32
- /*!*********************************************************************************************************************************!*\
33
- !*** external {"commonjs":"@tsparticles/engine","commonjs2":"@tsparticles/engine","amd":"@tsparticles/engine","root":"window"} ***!
34
- \*********************************************************************************************************************************/
35
- (module) {
9
+ var RgbIndexes;
10
+ (function (RgbIndexes) {
11
+ RgbIndexes[RgbIndexes["r"] = 1] = "r";
12
+ RgbIndexes[RgbIndexes["g"] = 2] = "g";
13
+ RgbIndexes[RgbIndexes["b"] = 3] = "b";
14
+ RgbIndexes[RgbIndexes["a"] = 5] = "a";
15
+ })(RgbIndexes || (RgbIndexes = {}));
16
+ const rgbRegex = /rgba?\(\s*(\d{1,3})\s*[\s,]\s*(\d{1,3})\s*[\s,]\s*(\d{1,3})\s*([\s,]\s*(0|1|0?\.\d+|(\d{1,3})%)\s*)?\)/i;
17
+ class RgbColorManager {
18
+ accepts(input) {
19
+ return input.startsWith("rgb");
20
+ }
21
+ handleColor(color) {
22
+ const colorValue = color.value, rgbColor = colorValue.rgb ?? color.value;
23
+ if (!("r" in rgbColor) || !("g" in rgbColor) || !("b" in rgbColor)) {
24
+ return;
25
+ }
26
+ return rgbColor;
27
+ }
28
+ handleRangeColor(color) {
29
+ const colorValue = color.value, rgbColor = colorValue.rgb ?? color.value;
30
+ if (!("r" in rgbColor) || !("g" in rgbColor) || !("b" in rgbColor)) {
31
+ return;
32
+ }
33
+ return {
34
+ r: engine.getRangeValue(rgbColor.r),
35
+ g: engine.getRangeValue(rgbColor.g),
36
+ b: engine.getRangeValue(rgbColor.b),
37
+ };
38
+ }
39
+ parseString(input) {
40
+ if (!this.accepts(input)) {
41
+ return;
42
+ }
43
+ const result = rgbRegex.exec(input), radix = 10, minLength = 4, defaultAlpha = 1;
44
+ return result
45
+ ? {
46
+ a: result.length > minLength ? engine.parseAlpha(result[RgbIndexes.a]) : defaultAlpha,
47
+ b: parseInt(result[RgbIndexes.b] ?? "0", radix),
48
+ g: parseInt(result[RgbIndexes.g] ?? "0", radix),
49
+ r: parseInt(result[RgbIndexes.r] ?? "0", radix),
50
+ }
51
+ : undefined;
52
+ }
53
+ }
36
54
 
37
- module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
55
+ async function loadRgbColorPlugin(engine) {
56
+ engine.checkVersion("4.0.0-beta.15");
57
+ await engine.pluginManager.register(e => {
58
+ e.pluginManager.addColorManager("rgb", new RgbColorManager());
59
+ });
60
+ }
38
61
 
39
- /***/ },
62
+ const globalObject = globalThis;
63
+ globalObject.__tsParticlesInternals = globalObject.__tsParticlesInternals ?? {};
64
+ globalObject.loadRgbColorPlugin = loadRgbColorPlugin;
40
65
 
41
- /***/ "./dist/browser/index.js"
42
- /*!*******************************!*\
43
- !*** ./dist/browser/index.js ***!
44
- \*******************************/
45
- (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
66
+ exports.loadRgbColorPlugin = loadRgbColorPlugin;
46
67
 
47
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadRgbColorPlugin: () => (/* binding */ loadRgbColorPlugin)\n/* harmony export */ });\nasync function loadRgbColorPlugin(engine) {\n engine.checkVersion(\"4.0.0-beta.11\");\n await engine.pluginManager.register(async (e)=>{\n const { RgbColorManager } = await __webpack_require__.e(/*! import() */ \"dist_browser_RgbColorManager_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./RgbColorManager.js */ \"./dist/browser/RgbColorManager.js\"));\n e.pluginManager.addColorManager(\"rgb\", new RgbColorManager());\n });\n}\n\n\n//# sourceURL=webpack://@tsparticles/plugin-rgb-color/./dist/browser/index.js?\n}");
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
- /******/ if (!(moduleId in __webpack_modules__)) {
72
- /******/ delete __webpack_module_cache__[moduleId];
73
- /******/ var e = new Error("Cannot find module '" + moduleId + "'");
74
- /******/ e.code = 'MODULE_NOT_FOUND';
75
- /******/ throw e;
76
- /******/ }
77
- /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
78
- /******/
79
- /******/ // Return the exports of the module
80
- /******/ return module.exports;
81
- /******/ }
82
- /******/
83
- /******/ // expose the modules object (__webpack_modules__)
84
- /******/ __webpack_require__.m = __webpack_modules__;
85
- /******/
86
- /************************************************************************/
87
- /******/ /* webpack/runtime/define property getters */
88
- /******/ (() => {
89
- /******/ // define getter functions for harmony exports
90
- /******/ __webpack_require__.d = (exports, definition) => {
91
- /******/ for(var key in definition) {
92
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
93
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
94
- /******/ }
95
- /******/ }
96
- /******/ };
97
- /******/ })();
98
- /******/
99
- /******/ /* webpack/runtime/ensure chunk */
100
- /******/ (() => {
101
- /******/ __webpack_require__.f = {};
102
- /******/ // This file contains only the entry chunk.
103
- /******/ // The chunk loading function for additional chunks
104
- /******/ __webpack_require__.e = (chunkId) => {
105
- /******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {
106
- /******/ __webpack_require__.f[key](chunkId, promises);
107
- /******/ return promises;
108
- /******/ }, []));
109
- /******/ };
110
- /******/ })();
111
- /******/
112
- /******/ /* webpack/runtime/get javascript chunk filename */
113
- /******/ (() => {
114
- /******/ // This function allow to reference async chunks
115
- /******/ __webpack_require__.u = (chunkId) => {
116
- /******/ // return url for filenames based on template
117
- /******/ return "" + chunkId + ".js";
118
- /******/ };
119
- /******/ })();
120
- /******/
121
- /******/ /* webpack/runtime/global */
122
- /******/ (() => {
123
- /******/ __webpack_require__.g = (function() {
124
- /******/ if (typeof globalThis === 'object') return globalThis;
125
- /******/ try {
126
- /******/ return this || new Function('return this')();
127
- /******/ } catch (e) {
128
- /******/ if (typeof window === 'object') return window;
129
- /******/ }
130
- /******/ })();
131
- /******/ })();
132
- /******/
133
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
134
- /******/ (() => {
135
- /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
136
- /******/ })();
137
- /******/
138
- /******/ /* webpack/runtime/load script */
139
- /******/ (() => {
140
- /******/ var inProgress = {};
141
- /******/ var dataWebpackPrefix = "@tsparticles/plugin-rgb-color:";
142
- /******/ // loadScript function to load a script via script tag
143
- /******/ __webpack_require__.l = (url, done, key, chunkId) => {
144
- /******/ if(inProgress[url]) { inProgress[url].push(done); return; }
145
- /******/ var script, needAttach;
146
- /******/ if(key !== undefined) {
147
- /******/ var scripts = document.getElementsByTagName("script");
148
- /******/ for(var i = 0; i < scripts.length; i++) {
149
- /******/ var s = scripts[i];
150
- /******/ if(s.getAttribute("src") == url || s.getAttribute("data-webpack") == dataWebpackPrefix + key) { script = s; break; }
151
- /******/ }
152
- /******/ }
153
- /******/ if(!script) {
154
- /******/ needAttach = true;
155
- /******/ script = document.createElement('script');
156
- /******/
157
- /******/ script.charset = 'utf-8';
158
- /******/ if (__webpack_require__.nc) {
159
- /******/ script.setAttribute("nonce", __webpack_require__.nc);
160
- /******/ }
161
- /******/ script.setAttribute("data-webpack", dataWebpackPrefix + key);
162
- /******/
163
- /******/ script.src = url;
164
- /******/ }
165
- /******/ inProgress[url] = [done];
166
- /******/ var onScriptComplete = (prev, event) => {
167
- /******/ // avoid mem leaks in IE.
168
- /******/ script.onerror = script.onload = null;
169
- /******/ clearTimeout(timeout);
170
- /******/ var doneFns = inProgress[url];
171
- /******/ delete inProgress[url];
172
- /******/ script.parentNode && script.parentNode.removeChild(script);
173
- /******/ doneFns && doneFns.forEach((fn) => (fn(event)));
174
- /******/ if(prev) return prev(event);
175
- /******/ }
176
- /******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
177
- /******/ script.onerror = onScriptComplete.bind(null, script.onerror);
178
- /******/ script.onload = onScriptComplete.bind(null, script.onload);
179
- /******/ needAttach && document.head.appendChild(script);
180
- /******/ };
181
- /******/ })();
182
- /******/
183
- /******/ /* webpack/runtime/make namespace object */
184
- /******/ (() => {
185
- /******/ // define __esModule on exports
186
- /******/ __webpack_require__.r = (exports) => {
187
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
188
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
189
- /******/ }
190
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
191
- /******/ };
192
- /******/ })();
193
- /******/
194
- /******/ /* webpack/runtime/publicPath */
195
- /******/ (() => {
196
- /******/ var scriptUrl;
197
- /******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + "";
198
- /******/ var document = __webpack_require__.g.document;
199
- /******/ if (!scriptUrl && document) {
200
- /******/ if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')
201
- /******/ scriptUrl = document.currentScript.src;
202
- /******/ if (!scriptUrl) {
203
- /******/ var scripts = document.getElementsByTagName("script");
204
- /******/ if(scripts.length) {
205
- /******/ var i = scripts.length - 1;
206
- /******/ while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;
207
- /******/ }
208
- /******/ }
209
- /******/ }
210
- /******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration
211
- /******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.
212
- /******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
213
- /******/ scriptUrl = scriptUrl.replace(/^blob:/, "").replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
214
- /******/ __webpack_require__.p = scriptUrl;
215
- /******/ })();
216
- /******/
217
- /******/ /* webpack/runtime/jsonp chunk loading */
218
- /******/ (() => {
219
- /******/ // no baseURI
220
- /******/
221
- /******/ // object to store loaded and loading chunks
222
- /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
223
- /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
224
- /******/ var installedChunks = {
225
- /******/ "tsparticles.plugin.rgbColor": 0
226
- /******/ };
227
- /******/
228
- /******/ __webpack_require__.f.j = (chunkId, promises) => {
229
- /******/ // JSONP chunk loading for javascript
230
- /******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;
231
- /******/ if(installedChunkData !== 0) { // 0 means "already installed".
232
- /******/
233
- /******/ // a Promise means "currently loading".
234
- /******/ if(installedChunkData) {
235
- /******/ promises.push(installedChunkData[2]);
236
- /******/ } else {
237
- /******/ if(true) { // all chunks have JS
238
- /******/ // setup Promise in chunk cache
239
- /******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));
240
- /******/ promises.push(installedChunkData[2] = promise);
241
- /******/
242
- /******/ // start chunk loading
243
- /******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId);
244
- /******/ // create error before stack unwound to get useful stacktrace later
245
- /******/ var error = new Error();
246
- /******/ var loadingEnded = (event) => {
247
- /******/ if(__webpack_require__.o(installedChunks, chunkId)) {
248
- /******/ installedChunkData = installedChunks[chunkId];
249
- /******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined;
250
- /******/ if(installedChunkData) {
251
- /******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type);
252
- /******/ var realSrc = event && event.target && event.target.src;
253
- /******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')';
254
- /******/ error.name = 'ChunkLoadError';
255
- /******/ error.type = errorType;
256
- /******/ error.request = realSrc;
257
- /******/ installedChunkData[1](error);
258
- /******/ }
259
- /******/ }
260
- /******/ };
261
- /******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId);
262
- /******/ }
263
- /******/ }
264
- /******/ }
265
- /******/ };
266
- /******/
267
- /******/ // no prefetching
268
- /******/
269
- /******/ // no preloaded
270
- /******/
271
- /******/ // no HMR
272
- /******/
273
- /******/ // no HMR manifest
274
- /******/
275
- /******/ // no on chunks loaded
276
- /******/
277
- /******/ // install a JSONP callback for chunk loading
278
- /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
279
- /******/ var [chunkIds, moreModules, runtime] = data;
280
- /******/ // add "moreModules" to the modules object,
281
- /******/ // then flag all "chunkIds" as loaded and fire callback
282
- /******/ var moduleId, chunkId, i = 0;
283
- /******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
284
- /******/ for(moduleId in moreModules) {
285
- /******/ if(__webpack_require__.o(moreModules, moduleId)) {
286
- /******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
287
- /******/ }
288
- /******/ }
289
- /******/ if(runtime) var result = runtime(__webpack_require__);
290
- /******/ }
291
- /******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
292
- /******/ for(;i < chunkIds.length; i++) {
293
- /******/ chunkId = chunkIds[i];
294
- /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
295
- /******/ installedChunks[chunkId][0]();
296
- /******/ }
297
- /******/ installedChunks[chunkId] = 0;
298
- /******/ }
299
- /******/
300
- /******/ }
301
- /******/
302
- /******/ var chunkLoadingGlobal = this["webpackChunk_tsparticles_plugin_rgb_color"] = this["webpackChunk_tsparticles_plugin_rgb_color"] || [];
303
- /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
304
- /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
305
- /******/ })();
306
- /******/
307
- /************************************************************************/
308
- /******/
309
- /******/ // startup
310
- /******/ // Load entry module and return exports
311
- /******/ // This entry module can't be inlined because the eval devtool is used.
312
- /******/ var __webpack_exports__ = __webpack_require__("./dist/browser/index.js");
313
- /******/
314
- /******/ return __webpack_exports__;
315
- /******/ })()
316
- ;
317
- });
68
+ }));
69
+ Object.assign(globalThis.window || globalThis, { loadRgbColorPlugin: (globalThis.__tsParticlesInternals.plugins.rgbColor || {}).loadRgbColorPlugin });
70
+ delete (globalThis.window || globalThis).tsparticlesInternalExports;
@@ -1,2 +1 @@
1
- !function(e,r){if("object"==typeof exports&&"object"==typeof module)module.exports=r(require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine"],r);else{var t="object"==typeof exports?r(require("@tsparticles/engine")):r(e.window);for(var o in t)("object"==typeof exports?exports:e)[o]=t[o]}}(this,e=>(()=>{"use strict";var r,t,o,n={303(r){r.exports=e}},i={};function a(e){var r=i[e];if(void 0!==r)return r.exports;var t=i[e]={exports:{}};return n[e](t,t.exports,a),t.exports}a.m=n,a.d=(e,r)=>{for(var t in r)a.o(r,t)&&!a.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce((r,t)=>(a.f[t](e,r),r),[])),a.u=e=>""+e+".min.js",a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),l={},a.l=(e,r,t,o)=>{if(l[e])return void l[e].push(r);if(void 0!==t)for(var n,i,s=document.getElementsByTagName("script"),c=0;c<s.length;c++){var p=s[c];if(p.getAttribute("src")==e||p.getAttribute("data-webpack")=="@tsparticles/plugin-rgb-color:"+t){n=p;break}}n||(i=!0,(n=document.createElement("script")).charset="utf-8",a.nc&&n.setAttribute("nonce",a.nc),n.setAttribute("data-webpack","@tsparticles/plugin-rgb-color:"+t),n.src=e),l[e]=[r];var u=(r,t)=>{n.onerror=n.onload=null,clearTimeout(d);var o=l[e];if(delete l[e],n.parentNode&&n.parentNode.removeChild(n),o&&o.forEach(e=>e(t)),r)return r(t)},d=setTimeout(u.bind(null,void 0,{type:"timeout",target:n}),12e4);n.onerror=u.bind(null,n.onerror),n.onload=u.bind(null,n.onload),i&&document.head.appendChild(n)},a.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.g.importScripts&&(s=a.g.location+"");var l,s,c=a.g.document;if(!s&&c&&(c.currentScript&&"SCRIPT"===c.currentScript.tagName.toUpperCase()&&(s=c.currentScript.src),!s)){var p=c.getElementsByTagName("script");if(p.length)for(var u=p.length-1;u>-1&&(!s||!/^http(s?):/.test(s));)s=p[u--].src}if(!s)throw Error("Automatic publicPath is not supported in this browser");a.p=s=s.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r={574:0},a.f.j=(e,t)=>{var o=a.o(r,e)?r[e]:void 0;if(0!==o)if(o)t.push(o[2]);else{var n=new Promise((t,n)=>o=r[e]=[t,n]);t.push(o[2]=n);var i=a.p+a.u(e),l=Error();a.l(i,t=>{if(a.o(r,e)&&(0!==(o=r[e])&&(r[e]=void 0),o)){var n=t&&("load"===t.type?"missing":t.type),i=t&&t.target&&t.target.src;l.message="Loading chunk "+e+` failed.
2
- (`+n+": "+i+")",l.name="ChunkLoadError",l.type=n,l.request=i,o[1](l)}},"chunk-"+e,e)}},t=(e,t)=>{var o,n,[i,l,s]=t,c=0;if(i.some(e=>0!==r[e])){for(o in l)a.o(l,o)&&(a.m[o]=l[o]);s&&s(a)}for(e&&e(t);c<i.length;c++)n=i[c],a.o(r,n)&&r[n]&&r[n][0](),r[n]=0},(o=this.webpackChunk_tsparticles_plugin_rgb_color=this.webpackChunk_tsparticles_plugin_rgb_color||[]).forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o));var d={};async function f(e){e.checkVersion("4.0.0-beta.11"),await e.pluginManager.register(async e=>{let{RgbColorManager:r}=await a.e(435).then(a.bind(a,435));e.pluginManager.addColorManager("rgb",new r)})}return a.r(d),a.d(d,{loadRgbColorPlugin:()=>f}),d})());
1
+ !function(s){s.__tsParticlesInternals=s.__tsParticlesInternals||{},s.__tsParticlesInternals.bundles=s.__tsParticlesInternals.bundles||{},s.__tsParticlesInternals.effects=s.__tsParticlesInternals.effects||{},s.__tsParticlesInternals.engine=s.__tsParticlesInternals.engine||{},s.__tsParticlesInternals.interactions=s.__tsParticlesInternals.interactions||{},s.__tsParticlesInternals.palettes=s.__tsParticlesInternals.palettes||{},s.__tsParticlesInternals.paths=s.__tsParticlesInternals.paths||{},s.__tsParticlesInternals.plugins=s.__tsParticlesInternals.plugins||{},s.__tsParticlesInternals.plugins=s.__tsParticlesInternals.plugins||{},s.__tsParticlesInternals.plugins.emittersShapes=s.__tsParticlesInternals.plugins.emittersShapes||{},s.__tsParticlesInternals.presets=s.__tsParticlesInternals.presets||{},s.__tsParticlesInternals.shapes=s.__tsParticlesInternals.shapes||{},s.__tsParticlesInternals.updaters=s.__tsParticlesInternals.updaters||{},s.__tsParticlesInternals.utils=s.__tsParticlesInternals.utils||{},s.__tsParticlesInternals.canvas=s.__tsParticlesInternals.canvas||{},s.__tsParticlesInternals.canvas=s.__tsParticlesInternals.canvas||{},s.__tsParticlesInternals.canvas.utils=s.__tsParticlesInternals.canvas.utils||{},s.__tsParticlesInternals.path=s.__tsParticlesInternals.path||{},s.__tsParticlesInternals.path=s.__tsParticlesInternals.path||{},s.__tsParticlesInternals.path.utils=s.__tsParticlesInternals.path.utils||{};var t="undefined"!=typeof Proxy?function(s){return new Proxy(s,{get:function(s,t){return t in s||(s[t]={}),s[t]}})}:function(s){return s};s.__tsParticlesInternals.bundles=t(s.__tsParticlesInternals.bundles),s.__tsParticlesInternals.effects=t(s.__tsParticlesInternals.effects),s.__tsParticlesInternals.interactions=t(s.__tsParticlesInternals.interactions),s.__tsParticlesInternals.palettes=t(s.__tsParticlesInternals.palettes),s.__tsParticlesInternals.paths=t(s.__tsParticlesInternals.paths),s.__tsParticlesInternals.plugins=t(s.__tsParticlesInternals.plugins),s.__tsParticlesInternals.plugins.emittersShapes=t(s.__tsParticlesInternals.plugins.emittersShapes),s.__tsParticlesInternals.presets=t(s.__tsParticlesInternals.presets),s.__tsParticlesInternals.shapes=t(s.__tsParticlesInternals.shapes),s.__tsParticlesInternals.updaters=t(s.__tsParticlesInternals.updaters),s.__tsParticlesInternals.utils=t(s.__tsParticlesInternals.utils),s.__tsParticlesInternals.canvas=t(s.__tsParticlesInternals.canvas),s.__tsParticlesInternals.path=t(s.__tsParticlesInternals.path),s.tsparticlesInternalExports=s.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(s,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@tsparticles/engine")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/engine"],t):t(((s="undefined"!=typeof globalThis?globalThis:s||self).__tsParticlesInternals=s.__tsParticlesInternals||{},s.__tsParticlesInternals.plugins=s.__tsParticlesInternals.plugins||{},s.__tsParticlesInternals.plugins.rgbColor=s.__tsParticlesInternals.plugins.rgbColor||{}),s.__tsParticlesInternals.engine)}(this,function(s,t){"use strict";var e;!function(s){s[s.r=1]="r",s[s.g=2]="g",s[s.b=3]="b",s[s.a=5]="a"}(e||(e={}));const n=/rgba?\(\s*(\d{1,3})\s*[\s,]\s*(\d{1,3})\s*[\s,]\s*(\d{1,3})\s*([\s,]\s*(0|1|0?\.\d+|(\d{1,3})%)\s*)?\)/i;class a{accepts(s){return s.startsWith("rgb")}handleColor(s){const t=s.value.rgb??s.value;if("r"in t&&"g"in t&&"b"in t)return t}handleRangeColor(s){const e=s.value.rgb??s.value;if("r"in e&&"g"in e&&"b"in e)return{r:t.getRangeValue(e.r),g:t.getRangeValue(e.g),b:t.getRangeValue(e.b)}}parseString(s){if(!this.accepts(s))return;const a=n.exec(s);return a?{a:a.length>4?t.parseAlpha(a[e.a]):1,b:parseInt(a[e.b]??"0",10),g:parseInt(a[e.g]??"0",10),r:parseInt(a[e.r]??"0",10)}:void 0}}async function l(s){s.checkVersion("4.0.0-beta.15"),await s.pluginManager.register(s=>{s.pluginManager.addColorManager("rgb",new a)})}const r=globalThis;r.__tsParticlesInternals=r.__tsParticlesInternals??{},r.loadRgbColorPlugin=l,s.loadRgbColorPlugin=l}),Object.assign(globalThis.window||globalThis,{loadRgbColorPlugin:(globalThis.__tsParticlesInternals.plugins.rgbColor||{}).loadRgbColorPlugin}),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 loadRgbColorPlugin(engine: Engine): Promise<void>;
package/435.min.js DELETED
@@ -1 +0,0 @@
1
- "use strict";(this.webpackChunk_tsparticles_plugin_rgb_color=this.webpackChunk_tsparticles_plugin_rgb_color||[]).push([[435],{435(e,r,a){a.d(r,{RgbColorManager:()=>l});var s,t,g=a(303);(s=t||(t={}))[s.r=1]="r",s[s.g=2]="g",s[s.b=3]="b",s[s.a=5]="a";let n=/rgba?\(\s*(\d{1,3})\s*[\s,]\s*(\d{1,3})\s*[\s,]\s*(\d{1,3})\s*([\s,]\s*(0|1|0?\.\d+|(\d{1,3})%)\s*)?\)/i;class l{accepts(e){return e.startsWith("rgb")}handleColor(e){let r=e.value.rgb??e.value;if("r"in r&&"g"in r&&"b"in r)return r}handleRangeColor(e){let r=e.value.rgb??e.value;if("r"in r&&"g"in r&&"b"in r)return{r:(0,g.getRangeValue)(r.r),g:(0,g.getRangeValue)(r.g),b:(0,g.getRangeValue)(r.b)}}parseString(e){if(!this.accepts(e))return;let r=n.exec(e);return r?{a:r.length>4?(0,g.parseAlpha)(r[t.a]):1,b:parseInt(r[t.b]??"0",10),g:parseInt(r[t.g]??"0",10),r:parseInt(r[t.r]??"0",10)}:void 0}}}}]);
@@ -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.11
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_plugin_rgb_color"] = this["webpackChunk_tsparticles_plugin_rgb_color"] || []).push([["dist_browser_RgbColorManager_js"],{
19
-
20
- /***/ "./dist/browser/RgbColorManager.js"
21
- /*!*****************************************!*\
22
- !*** ./dist/browser/RgbColorManager.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 */ RgbColorManager: () => (/* binding */ RgbColorManager)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nvar RgbIndexes;\n(function(RgbIndexes) {\n RgbIndexes[RgbIndexes[\"r\"] = 1] = \"r\";\n RgbIndexes[RgbIndexes[\"g\"] = 2] = \"g\";\n RgbIndexes[RgbIndexes[\"b\"] = 3] = \"b\";\n RgbIndexes[RgbIndexes[\"a\"] = 5] = \"a\";\n})(RgbIndexes || (RgbIndexes = {}));\nconst rgbRegex = /rgba?\\(\\s*(\\d{1,3})\\s*[\\s,]\\s*(\\d{1,3})\\s*[\\s,]\\s*(\\d{1,3})\\s*([\\s,]\\s*(0|1|0?\\.\\d+|(\\d{1,3})%)\\s*)?\\)/i;\nclass RgbColorManager {\n accepts(input) {\n return input.startsWith(\"rgb\");\n }\n handleColor(color) {\n const colorValue = color.value, rgbColor = colorValue.rgb ?? color.value;\n if (!(\"r\" in rgbColor) || !(\"g\" in rgbColor) || !(\"b\" in rgbColor)) {\n return;\n }\n return rgbColor;\n }\n handleRangeColor(color) {\n const colorValue = color.value, rgbColor = colorValue.rgb ?? color.value;\n if (!(\"r\" in rgbColor) || !(\"g\" in rgbColor) || !(\"b\" in rgbColor)) {\n return;\n }\n return {\n r: (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(rgbColor.r),\n g: (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(rgbColor.g),\n b: (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(rgbColor.b)\n };\n }\n parseString(input) {\n if (!this.accepts(input)) {\n return;\n }\n const result = rgbRegex.exec(input), radix = 10, minLength = 4, defaultAlpha = 1;\n return result ? {\n a: result.length > minLength ? (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.parseAlpha)(result[RgbIndexes.a]) : defaultAlpha,\n b: parseInt(result[RgbIndexes.b] ?? \"0\", radix),\n g: parseInt(result[RgbIndexes.g] ?? \"0\", radix),\n r: parseInt(result[RgbIndexes.r] ?? \"0\", radix)\n } : undefined;\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/plugin-rgb-color/./dist/browser/RgbColorManager.js?\n}");
27
-
28
- /***/ }
29
-
30
- }]);