@tsparticles/updater-destroy 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,2 +1 @@
1
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine"],t);else{var r="object"==typeof exports?t(require("@tsparticles/engine")):t(e.window);for(var o in r)("object"==typeof exports?exports:e)[o]=r[o]}}(this,e=>(()=>{"use strict";var t,r,o,n={303(t){t.exports=e}},i={};function a(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={exports:{}};return n[e](r,r.exports,a),r.exports}a.m=n,a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce((t,r)=>(a.f[r](e,t),t),[])),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,t)=>Object.prototype.hasOwnProperty.call(e,t),s={},a.l=(e,t,r,o)=>{if(s[e])return void s[e].push(t);if(void 0!==r)for(var n,i,p=document.getElementsByTagName("script"),c=0;c<p.length;c++){var u=p[c];if(u.getAttribute("src")==e||u.getAttribute("data-webpack")=="@tsparticles/updater-destroy:"+r){n=u;break}}n||(i=!0,(n=document.createElement("script")).charset="utf-8",a.nc&&n.setAttribute("nonce",a.nc),n.setAttribute("data-webpack","@tsparticles/updater-destroy:"+r),n.src=e),s[e]=[t];var l=(t,r)=>{n.onerror=n.onload=null,clearTimeout(d);var o=s[e];if(delete s[e],n.parentNode&&n.parentNode.removeChild(n),o&&o.forEach(e=>e(r)),t)return t(r)},d=setTimeout(l.bind(null,void 0,{type:"timeout",target:n}),12e4);n.onerror=l.bind(null,n.onerror),n.onload=l.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&&(p=a.g.location+"");var s,p,c=a.g.document;if(!p&&c&&(c.currentScript&&"SCRIPT"===c.currentScript.tagName.toUpperCase()&&(p=c.currentScript.src),!p)){var u=c.getElementsByTagName("script");if(u.length)for(var l=u.length-1;l>-1&&(!p||!/^http(s?):/.test(p));)p=u[l--].src}if(!p)throw Error("Automatic publicPath is not supported in this browser");a.p=p=p.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),t={114:0},a.f.j=(e,r)=>{var o=a.o(t,e)?t[e]:void 0;if(0!==o)if(o)r.push(o[2]);else{var n=new Promise((r,n)=>o=t[e]=[r,n]);r.push(o[2]=n);var i=a.p+a.u(e),s=Error();a.l(i,r=>{if(a.o(t,e)&&(0!==(o=t[e])&&(t[e]=void 0),o)){var n=r&&("load"===r.type?"missing":r.type),i=r&&r.target&&r.target.src;s.message="Loading chunk "+e+` failed.
2
- (`+n+": "+i+")",s.name="ChunkLoadError",s.type=n,s.request=i,o[1](s)}},"chunk-"+e,e)}},r=(e,r)=>{var o,n,[i,s,p]=r,c=0;if(i.some(e=>0!==t[e])){for(o in s)a.o(s,o)&&(a.m[o]=s[o]);p&&p(a)}for(e&&e(r);c<i.length;c++)n=i[c],a.o(t,n)&&t[n]&&t[n][0](),t[n]=0},(o=this.webpackChunk_tsparticles_updater_destroy=this.webpackChunk_tsparticles_updater_destroy||[]).forEach(r.bind(null,0)),o.push=r.bind(null,o.push.bind(o));var d={};async function f(e){e.checkVersion("4.0.0-beta.12"),await e.pluginManager.register(e=>{e.pluginManager.addParticleUpdater("destroy",async t=>{let{DestroyUpdater:r}=await a.e(310).then(a.bind(a,310));return new r(e.pluginManager,t)})})}return a.r(d),a.d(d,{loadDestroyUpdater:()=>f}),d})());
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 e="undefined"!=typeof Proxy?function(t){return new Proxy(t,{get:function(t,e){return e in t||(t[e]={}),t[e]}})}:function(t){return t};t.__tsParticlesInternals.bundles=e(t.__tsParticlesInternals.bundles),t.__tsParticlesInternals.effects=e(t.__tsParticlesInternals.effects),t.__tsParticlesInternals.interactions=e(t.__tsParticlesInternals.interactions),t.__tsParticlesInternals.palettes=e(t.__tsParticlesInternals.palettes),t.__tsParticlesInternals.paths=e(t.__tsParticlesInternals.paths),t.__tsParticlesInternals.plugins=e(t.__tsParticlesInternals.plugins),t.__tsParticlesInternals.plugins.emittersShapes=e(t.__tsParticlesInternals.plugins.emittersShapes),t.__tsParticlesInternals.presets=e(t.__tsParticlesInternals.presets),t.__tsParticlesInternals.shapes=e(t.__tsParticlesInternals.shapes),t.__tsParticlesInternals.updaters=e(t.__tsParticlesInternals.updaters),t.__tsParticlesInternals.utils=e(t.__tsParticlesInternals.utils),t.__tsParticlesInternals.canvas=e(t.__tsParticlesInternals.canvas),t.__tsParticlesInternals.path=e(t.__tsParticlesInternals.path),t.tsparticlesInternalExports=t.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@tsparticles/engine")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/engine"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.updaters.destroy=t.__tsParticlesInternals.updaters.destroy||{}),t.__tsParticlesInternals.engine)}(this,function(t,e){"use strict";class s{bottom;left;right;top;load(t){e.isNull(t)||(void 0!==t.bottom&&(this.bottom=e.setRangeValue(t.bottom)),void 0!==t.left&&(this.left=e.setRangeValue(t.left)),void 0!==t.right&&(this.right=e.setRangeValue(t.right)),void 0!==t.top&&(this.top=e.setRangeValue(t.top)))}}var l;!function(t){t.explode="explode",t.none="none",t.split="split"}(l||(l={}));class i{maxSizeFactor;speed;constructor(){this.maxSizeFactor=3,this.speed=2}load(t){e.isNull(t)||(void 0!==t.maxSizeFactor&&(this.maxSizeFactor=t.maxSizeFactor),void 0!==t.speed&&(this.speed=t.speed))}}class n extends e.ValueWithRandom{constructor(){super(),this.value=3}}class r extends e.ValueWithRandom{constructor(){super(),this.value={min:4,max:9}}}class a{count;factor;fillColor;fillColorOffset;particles;rate;sizeOffset;strokeColor;strokeColorOffset;constructor(){this.count=1,this.factor=new n,this.rate=new r,this.sizeOffset=!0}load(t){e.isNull(t)||(void 0!==t.fillColor&&(this.fillColor=e.OptionsColor.create(this.fillColor,t.fillColor)),void 0!==t.strokeColor&&(this.strokeColor=e.OptionsColor.create(this.strokeColor,t.strokeColor)),void 0!==t.count&&(this.count=t.count),this.factor.load(t.factor),this.rate.load(t.rate),this.particles=e.executeOnSingleOrMultiple(t.particles,t=>e.deepExtend({},t)),void 0!==t.sizeOffset&&(this.sizeOffset=t.sizeOffset),t.fillColorOffset&&(this.fillColorOffset=this.fillColorOffset??{},void 0!==t.fillColorOffset.h&&(this.fillColorOffset.h=t.fillColorOffset.h),void 0!==t.fillColorOffset.s&&(this.fillColorOffset.s=t.fillColorOffset.s),void 0!==t.fillColorOffset.l&&(this.fillColorOffset.l=t.fillColorOffset.l)),t.strokeColorOffset&&(this.strokeColorOffset=this.strokeColorOffset??{},void 0!==t.strokeColorOffset.h&&(this.strokeColorOffset.h=t.strokeColorOffset.h),void 0!==t.strokeColorOffset.s&&(this.strokeColorOffset.s=t.strokeColorOffset.s),void 0!==t.strokeColorOffset.l&&(this.strokeColorOffset.l=t.strokeColorOffset.l)))}}class o{bounds;explode;mode;split;constructor(){this.bounds=new s,this.explode=new i,this.mode=l.none,this.split=new a}load(t){e.isNull(t)||(t.mode&&(this.mode=t.mode),t.bounds&&this.bounds.load(t.bounds),this.explode.load(t.explode),this.split.load(t.split))}}function c(t,s,l,i){return t&&i?function(t,s){const l=e.getRangeValue(s.h??0),i=e.getRangeValue(s.s??0),n=e.getRangeValue(s.l??0),r=(t.h+l)%360,a=Math.max(0,Math.min(100,t.s+i)),o=Math.max(0,Math.min(100,t.l+n));return e.AnimatableColor.create(void 0,{value:{hsl:{h:r<0?r+360:r,s:a,l:o}}})}(i,t):s?e.AnimatableColor.create(void 0,s):l?e.AnimatableColor.create(void 0,l):i?function(t){return e.AnimatableColor.create(void 0,{value:{hsl:t}})}(i):void 0}function p(t,s,l,i){const n=l.options.destroy;if(!n)return;const r=n.split,a=e.loadParticlesOptions(t,s,l.options),o=e.itemFromSingleOrMultiple(r.fillColor),p=e.itemFromSingleOrMultiple(r.strokeColor),d=l.getFillColor(),_=l.getStrokeColor();a.move.load({center:{x:l.position.x,y:l.position.y,mode:e.PixelMode.precise}});const f=e.identity/e.getRangeValue(r.factor.value);e.isNumber(a.size.value)?a.size.value*=f:(a.size.value.min*=f,a.size.value.max*=f),a.load(i);const u=e.itemFromSingleOrMultiple(a.paint),h=u?.fill,g=u?.stroke,P=c(r.fillColorOffset,o,h?.color,d),I=c(r.strokeColorOffset,p,g?.color,_);P&&h&&(h.color=P),I&&g&&(g.color=I);const m=r.sizeOffset?e.setRangeValue(-l.size.value,l.size.value):0,v={x:l.position.x+e.randomInRangeValue(m),y:l.position.y+e.randomInRangeValue(m)};return s.particles.addParticle(v,a,l.group,t=>!(t.size.value<.5)&&(t.velocity.length=e.randomInRangeValue(e.setRangeValue(l.velocity.length,t.velocity.length)),t.splitCount=(l.splitCount??0)+1,t.unbreakable=!0,t.unbreakableUntil=performance.now()+500,!0))}class d{_container;_pluginManager;constructor(t,e){this._container=e,this._pluginManager=t}init(t){const s=this._container,l=t.options.destroy;if(!l)return;t.exploding=void 0,t.splitCount=0;const i=l.bounds;t.destroyBounds??={};const{bottom:n,left:r,right:a,top:o}=i,{destroyBounds:c}=t,p=s.canvas.size;n&&(c.bottom=e.getRangeValue(n)*p.height/e.percentDenominator),r&&(c.left=e.getRangeValue(r)*p.width/e.percentDenominator),a&&(c.right=e.getRangeValue(a)*p.width/e.percentDenominator),o&&(c.top=e.getRangeValue(o)*p.height/e.percentDenominator)}isEnabled(t){const e=t;return!e.destroyed||!!e.exploding}loadOptions(t,...e){t.destroy??=new o;for(const s of e)t.destroy.load(s?.destroy)}particleDestroyed(t,s){if(s)return;const i=t.options.destroy;switch(i?.mode){case l.split:!function(t,s,l){const i=l.options.destroy;if(!i)return;const n=i.split;if(n.count>=0){if(void 0===l.splitCount||l.splitCount>n.count)return;l.splitCount++}const r=e.getRangeValue(n.rate.value),a=e.itemFromSingleOrMultiple(n.particles);for(let e=0;e<r;e++)p(t,s,l,a)}(this._pluginManager,this._container,t);break;case l.explode:{if(t.exploding){t.destroyed=!1;break}const{explode:e}=i,s=t.size.value,l=s*e.maxSizeFactor,n=t.getOpacity();t.exploding={initialFillOpacity:n.fillOpacity,initialSize:s,initialStrokeOpacity:n.strokeOpacity,maxSize:l,progress:0,speed:Math.max(e.speed,.01)},t.fillOpacity=n.fillOpacity,t.strokeOpacity=n.strokeOpacity,t.destroyed=!1;break}}}update(t,e){if(t.exploding){const s=t.exploding,l=e.factor||1;s.progress=Math.min(1,s.progress+s.speed*l/60);const i=s.progress;return t.size.value=s.initialSize+(s.maxSize-s.initialSize)*i,t.fillOpacity=s.initialFillOpacity*(1-i),t.strokeOpacity=s.initialStrokeOpacity*(1-i),void(i>=1&&(t.exploding=void 0,t.destroy(!0)))}void 0!==t.unbreakableUntil&&performance.now()>=t.unbreakableUntil&&(t.unbreakable=!1,t.unbreakableUntil=void 0);const s=t.getPosition(),l=t.destroyBounds;l&&(void 0!==l.bottom&&s.y>=l.bottom||void 0!==l.left&&s.x<=l.left||void 0!==l.right&&s.x>=l.right||void 0!==l.top&&s.y<=l.top)&&t.destroy()}}async function _(t){t.checkVersion("4.0.0-beta.15"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("destroy",e=>Promise.resolve(new d(t.pluginManager,e)))})}const f=globalThis;f.__tsParticlesInternals=f.__tsParticlesInternals??{},f.loadDestroyUpdater=_,t.loadDestroyUpdater=_}),Object.assign(globalThis.window||globalThis,{loadDestroyUpdater:(globalThis.__tsParticlesInternals.updaters.destroy||{}).loadDestroyUpdater}),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 loadDestroyUpdater(engine: Engine): Promise<void>;
package/310.min.js DELETED
@@ -1 +0,0 @@
1
- "use strict";(this.webpackChunk_tsparticles_updater_destroy=this.webpackChunk_tsparticles_updater_destroy||[]).push([[310],{310(e,t,o){o.d(t,{DestroyUpdater:()=>c});var i,l,s=o(303);class r{bottom;left;right;top;load(e){(0,s.isNull)(e)||(void 0!==e.bottom&&(this.bottom=(0,s.setRangeValue)(e.bottom)),void 0!==e.left&&(this.left=(0,s.setRangeValue)(e.left)),void 0!==e.right&&(this.right=(0,s.setRangeValue)(e.right)),void 0!==e.top&&(this.top=(0,s.setRangeValue)(e.top)))}}(i=l||(l={})).explode="explode",i.none="none",i.split="split";class a{maxSizeFactor;speed;constructor(){this.maxSizeFactor=3,this.speed=2}load(e){(0,s.isNull)(e)||(void 0!==e.maxSizeFactor&&(this.maxSizeFactor=e.maxSizeFactor),void 0!==e.speed&&(this.speed=e.speed))}}class n extends s.ValueWithRandom{constructor(){super(),this.value=3}}class f extends s.ValueWithRandom{constructor(){super(),this.value={min:4,max:9}}}class d{count;factor;fillColor;fillColorOffset;particles;rate;sizeOffset;strokeColor;strokeColorOffset;constructor(){this.count=1,this.factor=new n,this.rate=new f,this.sizeOffset=!0}load(e){!(0,s.isNull)(e)&&(void 0!==e.fillColor&&(this.fillColor=s.OptionsColor.create(this.fillColor,e.fillColor)),void 0!==e.strokeColor&&(this.strokeColor=s.OptionsColor.create(this.strokeColor,e.strokeColor)),void 0!==e.count&&(this.count=e.count),this.factor.load(e.factor),this.rate.load(e.rate),this.particles=(0,s.executeOnSingleOrMultiple)(e.particles,e=>(0,s.deepExtend)({},e)),void 0!==e.sizeOffset&&(this.sizeOffset=e.sizeOffset),e.fillColorOffset&&(this.fillColorOffset=this.fillColorOffset??{},void 0!==e.fillColorOffset.h&&(this.fillColorOffset.h=e.fillColorOffset.h),void 0!==e.fillColorOffset.s&&(this.fillColorOffset.s=e.fillColorOffset.s),void 0!==e.fillColorOffset.l&&(this.fillColorOffset.l=e.fillColorOffset.l)),e.strokeColorOffset&&(this.strokeColorOffset=this.strokeColorOffset??{},void 0!==e.strokeColorOffset.h&&(this.strokeColorOffset.h=e.strokeColorOffset.h),void 0!==e.strokeColorOffset.s&&(this.strokeColorOffset.s=e.strokeColorOffset.s),void 0!==e.strokeColorOffset.l&&(this.strokeColorOffset.l=e.strokeColorOffset.l)))}}class p{bounds;explode;mode;split;constructor(){this.bounds=new r,this.explode=new a,this.mode=l.none,this.split=new d}load(e){(0,s.isNull)(e)||(e.mode&&(this.mode=e.mode),e.bounds&&this.bounds.load(e.bounds),this.explode.load(e.explode),this.split.load(e.split))}}function u(e,t,o,i){if(e&&i){let t,o,l,r,a,n;return t=(0,s.getRangeValue)(e.h??0),o=(0,s.getRangeValue)(e.s??0),l=(0,s.getRangeValue)(e.l??0),r=(i.h+t)%360,a=Math.max(0,Math.min(100,i.s+o)),n=Math.max(0,Math.min(100,i.l+l)),s.AnimatableColor.create(void 0,{value:{hsl:{h:r<0?r+360:r,s:a,l:n}}})}return t?s.AnimatableColor.create(void 0,t):o?s.AnimatableColor.create(void 0,o):i?s.AnimatableColor.create(void 0,{value:{hsl:i}}):void 0}class c{_container;_pluginManager;constructor(e,t){this._container=t,this._pluginManager=e}init(e){let t=this._container,o=e.options.destroy;if(!o)return;e.exploding=void 0,e.splitCount=0;let i=o.bounds;e.destroyBounds??={};let{bottom:l,left:r,right:a,top:n}=i,{destroyBounds:f}=e,d=t.canvas.size;l&&(f.bottom=(0,s.getRangeValue)(l)*d.height/s.percentDenominator),r&&(f.left=(0,s.getRangeValue)(r)*d.width/s.percentDenominator),a&&(f.right=(0,s.getRangeValue)(a)*d.width/s.percentDenominator),n&&(f.top=(0,s.getRangeValue)(n)*d.height/s.percentDenominator)}isEnabled(e){return!e.destroyed||!!e.exploding}loadOptions(e,...t){for(let o of(e.destroy??=new p,t))e.destroy.load(o?.destroy)}particleDestroyed(e,t){if(t)return;let o=e.options.destroy;switch(o?.mode){case l.split:!function(e,t,o){let i=o.options.destroy;if(!i)return;let l=i.split;if(l.count>=0){if(void 0===o.splitCount||o.splitCount>l.count)return;o.splitCount++}let r=(0,s.getRangeValue)(l.rate.value),a=(0,s.itemFromSingleOrMultiple)(l.particles);for(let i=0;i<r;i++)!function(e,t,o,i){let l=o.options.destroy;if(!l)return;let r=l.split,a=(0,s.loadParticlesOptions)(e,t,o.options),n=(0,s.itemFromSingleOrMultiple)(r.fillColor),f=(0,s.itemFromSingleOrMultiple)(r.strokeColor),d=o.getFillColor(),p=o.getStrokeColor();a.move.load({center:{x:o.position.x,y:o.position.y,mode:s.PixelMode.precise}});let c=s.identity/(0,s.getRangeValue)(r.factor.value);(0,s.isNumber)(a.size.value)?a.size.value*=c:(a.size.value.min*=c,a.size.value.max*=c),a.load(i);let h=(0,s.itemFromSingleOrMultiple)(a.paint),g=h?.fill,O=h?.stroke,m=u(r.fillColorOffset,n,g?.color,d),C=u(r.strokeColorOffset,f,O?.color,p);m&&g&&(g.color=m),C&&O&&(O.color=C);let v=r.sizeOffset?(0,s.setRangeValue)(-o.size.value,o.size.value):0,y={x:o.position.x+(0,s.randomInRangeValue)(v),y:o.position.y+(0,s.randomInRangeValue)(v)};t.particles.addParticle(y,a,o.group,e=>!(e.size.value<.5)&&(e.velocity.length=(0,s.randomInRangeValue)((0,s.setRangeValue)(o.velocity.length,e.velocity.length)),e.splitCount=(o.splitCount??0)+1,e.unbreakable=!0,e.unbreakableUntil=performance.now()+500,!0))}(e,t,o,a)}(this._pluginManager,this._container,e);break;case l.explode:{if(e.exploding){e.destroyed=!1;break}let{explode:t}=o,i=e.size.value,l=i*t.maxSizeFactor,s=e.getOpacity();e.exploding={initialFillOpacity:s.fillOpacity,initialSize:i,initialStrokeOpacity:s.strokeOpacity,maxSize:l,progress:0,speed:Math.max(t.speed,.01)},e.fillOpacity=s.fillOpacity,e.strokeOpacity=s.strokeOpacity,e.destroyed=!1}}}update(e,t){if(e.exploding){let o=e.exploding,i=t.factor||1;o.progress=Math.min(1,o.progress+o.speed*i/60);let l=o.progress;e.size.value=o.initialSize+(o.maxSize-o.initialSize)*l,e.fillOpacity=o.initialFillOpacity*(1-l),e.strokeOpacity=o.initialStrokeOpacity*(1-l),l>=1&&(e.exploding=void 0,e.destroy(!0));return}void 0!==e.unbreakableUntil&&performance.now()>=e.unbreakableUntil&&(e.unbreakable=!1,e.unbreakableUntil=void 0);let o=e.getPosition(),i=e.destroyBounds;i&&(void 0!==i.bottom&&o.y>=i.bottom||void 0!==i.left&&o.x<=i.left||void 0!==i.right&&o.x>=i.right||void 0!==i.top&&o.y<=i.top)&&e.destroy()}}}}]);
@@ -1,110 +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_updater_destroy"] = this["webpackChunk_tsparticles_updater_destroy"] || []).push([["dist_browser_DestroyUpdater_js"],{
19
-
20
- /***/ "./dist/browser/DestroyUpdater.js"
21
- /*!****************************************!*\
22
- !*** ./dist/browser/DestroyUpdater.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 */ DestroyUpdater: () => (/* binding */ DestroyUpdater)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _Options_Classes_Destroy_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Options/Classes/Destroy.js */ \"./dist/browser/Options/Classes/Destroy.js\");\n/* harmony import */ var _Enums_DestroyMode_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Enums/DestroyMode.js */ \"./dist/browser/Enums/DestroyMode.js\");\n/* harmony import */ var _Utils_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Utils.js */ \"./dist/browser/Utils.js\");\n\n\n\n\nconst defaultDeltaFactor = 1, fpsFactor = 60, minExplodeSpeed = 0.01, maxExplodeProgress = 1;\nclass DestroyUpdater {\n _container;\n _pluginManager;\n constructor(pluginManager, container){\n this._container = container;\n this._pluginManager = pluginManager;\n }\n init(particle) {\n const container = this._container, particlesOptions = particle.options, destroyOptions = particlesOptions.destroy;\n if (!destroyOptions) {\n return;\n }\n particle.exploding = undefined;\n particle.splitCount = 0;\n const destroyBoundsOptions = destroyOptions.bounds;\n particle.destroyBounds ??= {};\n const { bottom, left, right, top } = destroyBoundsOptions, { destroyBounds } = particle, canvasSize = container.canvas.size;\n if (bottom) {\n destroyBounds.bottom = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(bottom) * canvasSize.height / _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.percentDenominator;\n }\n if (left) {\n destroyBounds.left = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(left) * canvasSize.width / _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.percentDenominator;\n }\n if (right) {\n destroyBounds.right = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(right) * canvasSize.width / _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.percentDenominator;\n }\n if (top) {\n destroyBounds.top = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(top) * canvasSize.height / _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.percentDenominator;\n }\n }\n isEnabled(particle) {\n const destroyParticle = particle;\n return !destroyParticle.destroyed || !!destroyParticle.exploding;\n }\n loadOptions(options, ...sources) {\n options.destroy ??= new _Options_Classes_Destroy_js__WEBPACK_IMPORTED_MODULE_1__.Destroy();\n for (const source of sources){\n options.destroy.load(source?.destroy);\n }\n }\n particleDestroyed(particle, override) {\n if (override) {\n return;\n }\n const destroyOptions = particle.options.destroy;\n switch(destroyOptions?.mode){\n case _Enums_DestroyMode_js__WEBPACK_IMPORTED_MODULE_2__.DestroyMode.split:\n (0,_Utils_js__WEBPACK_IMPORTED_MODULE_3__.split)(this._pluginManager, this._container, particle);\n break;\n case _Enums_DestroyMode_js__WEBPACK_IMPORTED_MODULE_2__.DestroyMode.explode:\n {\n if (particle.exploding) {\n particle.destroyed = false;\n break;\n }\n const { explode } = destroyOptions, initialSize = particle.size.value, maxSize = initialSize * explode.maxSizeFactor, opacity = particle.getOpacity();\n particle.exploding = {\n initialFillOpacity: opacity.fillOpacity,\n initialSize,\n initialStrokeOpacity: opacity.strokeOpacity,\n maxSize,\n progress: 0,\n speed: Math.max(explode.speed, minExplodeSpeed)\n };\n particle.fillOpacity = opacity.fillOpacity;\n particle.strokeOpacity = opacity.strokeOpacity;\n particle.destroyed = false;\n break;\n }\n default:\n break;\n }\n }\n update(particle, delta) {\n if (particle.exploding) {\n const explosionState = particle.exploding, deltaFactor = delta.factor || defaultDeltaFactor;\n explosionState.progress = Math.min(maxExplodeProgress, explosionState.progress + explosionState.speed * deltaFactor / fpsFactor);\n const progress = explosionState.progress;\n particle.size.value = explosionState.initialSize + (explosionState.maxSize - explosionState.initialSize) * progress;\n particle.fillOpacity = explosionState.initialFillOpacity * (maxExplodeProgress - progress);\n particle.strokeOpacity = explosionState.initialStrokeOpacity * (maxExplodeProgress - progress);\n if (progress >= maxExplodeProgress) {\n particle.exploding = undefined;\n particle.destroy(true);\n }\n return;\n }\n if (particle.unbreakableUntil !== undefined && performance.now() >= particle.unbreakableUntil) {\n particle.unbreakable = false;\n particle.unbreakableUntil = undefined;\n }\n const position = particle.getPosition(), bounds = particle.destroyBounds;\n if (!bounds) {\n return;\n }\n if (bounds.bottom !== undefined && position.y >= bounds.bottom || bounds.left !== undefined && position.x <= bounds.left || bounds.right !== undefined && position.x >= bounds.right || bounds.top !== undefined && position.y <= bounds.top) {\n particle.destroy();\n }\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/updater-destroy/./dist/browser/DestroyUpdater.js?\n}");
27
-
28
- /***/ },
29
-
30
- /***/ "./dist/browser/Enums/DestroyMode.js"
31
- /*!*******************************************!*\
32
- !*** ./dist/browser/Enums/DestroyMode.js ***!
33
- \*******************************************/
34
- (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
35
-
36
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ DestroyMode: () => (/* binding */ DestroyMode)\n/* harmony export */ });\nvar DestroyMode;\n(function(DestroyMode) {\n DestroyMode[\"explode\"] = \"explode\";\n DestroyMode[\"none\"] = \"none\";\n DestroyMode[\"split\"] = \"split\";\n})(DestroyMode || (DestroyMode = {}));\n\n\n//# sourceURL=webpack://@tsparticles/updater-destroy/./dist/browser/Enums/DestroyMode.js?\n}");
37
-
38
- /***/ },
39
-
40
- /***/ "./dist/browser/Options/Classes/Destroy.js"
41
- /*!*************************************************!*\
42
- !*** ./dist/browser/Options/Classes/Destroy.js ***!
43
- \*************************************************/
44
- (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
45
-
46
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Destroy: () => (/* binding */ Destroy)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _DestroyBounds_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./DestroyBounds.js */ \"./dist/browser/Options/Classes/DestroyBounds.js\");\n/* harmony import */ var _Enums_DestroyMode_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../Enums/DestroyMode.js */ \"./dist/browser/Enums/DestroyMode.js\");\n/* harmony import */ var _Explode_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Explode.js */ \"./dist/browser/Options/Classes/Explode.js\");\n/* harmony import */ var _Split_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Split.js */ \"./dist/browser/Options/Classes/Split.js\");\n\n\n\n\n\nclass Destroy {\n bounds;\n explode;\n mode;\n split;\n constructor(){\n this.bounds = new _DestroyBounds_js__WEBPACK_IMPORTED_MODULE_1__.DestroyBounds();\n this.explode = new _Explode_js__WEBPACK_IMPORTED_MODULE_3__.Explode();\n this.mode = _Enums_DestroyMode_js__WEBPACK_IMPORTED_MODULE_2__.DestroyMode.none;\n this.split = new _Split_js__WEBPACK_IMPORTED_MODULE_4__.Split();\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n if (data.mode) {\n this.mode = data.mode;\n }\n if (data.bounds) {\n this.bounds.load(data.bounds);\n }\n this.explode.load(data.explode);\n this.split.load(data.split);\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/updater-destroy/./dist/browser/Options/Classes/Destroy.js?\n}");
47
-
48
- /***/ },
49
-
50
- /***/ "./dist/browser/Options/Classes/DestroyBounds.js"
51
- /*!*******************************************************!*\
52
- !*** ./dist/browser/Options/Classes/DestroyBounds.js ***!
53
- \*******************************************************/
54
- (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
55
-
56
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ DestroyBounds: () => (/* binding */ DestroyBounds)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nclass DestroyBounds {\n bottom;\n left;\n right;\n top;\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n if (data.bottom !== undefined) {\n this.bottom = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.bottom);\n }\n if (data.left !== undefined) {\n this.left = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.left);\n }\n if (data.right !== undefined) {\n this.right = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.right);\n }\n if (data.top !== undefined) {\n this.top = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.top);\n }\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/updater-destroy/./dist/browser/Options/Classes/DestroyBounds.js?\n}");
57
-
58
- /***/ },
59
-
60
- /***/ "./dist/browser/Options/Classes/Explode.js"
61
- /*!*************************************************!*\
62
- !*** ./dist/browser/Options/Classes/Explode.js ***!
63
- \*************************************************/
64
- (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
65
-
66
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Explode: () => (/* binding */ Explode)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nclass Explode {\n maxSizeFactor;\n speed;\n constructor(){\n this.maxSizeFactor = 3;\n this.speed = 2;\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n if (data.maxSizeFactor !== undefined) {\n this.maxSizeFactor = data.maxSizeFactor;\n }\n if (data.speed !== undefined) {\n this.speed = data.speed;\n }\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/updater-destroy/./dist/browser/Options/Classes/Explode.js?\n}");
67
-
68
- /***/ },
69
-
70
- /***/ "./dist/browser/Options/Classes/Split.js"
71
- /*!***********************************************!*\
72
- !*** ./dist/browser/Options/Classes/Split.js ***!
73
- \***********************************************/
74
- (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
75
-
76
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Split: () => (/* binding */ Split)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _SplitFactor_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SplitFactor.js */ \"./dist/browser/Options/Classes/SplitFactor.js\");\n/* harmony import */ var _SplitRate_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./SplitRate.js */ \"./dist/browser/Options/Classes/SplitRate.js\");\n\n\n\nclass Split {\n count;\n factor;\n fillColor;\n fillColorOffset;\n particles;\n rate;\n sizeOffset;\n strokeColor;\n strokeColorOffset;\n constructor(){\n this.count = 1;\n this.factor = new _SplitFactor_js__WEBPACK_IMPORTED_MODULE_1__.SplitFactor();\n this.rate = new _SplitRate_js__WEBPACK_IMPORTED_MODULE_2__.SplitRate();\n this.sizeOffset = true;\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n if (data.fillColor !== undefined) {\n this.fillColor = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OptionsColor.create(this.fillColor, data.fillColor);\n }\n if (data.strokeColor !== undefined) {\n this.strokeColor = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OptionsColor.create(this.strokeColor, data.strokeColor);\n }\n if (data.count !== undefined) {\n this.count = data.count;\n }\n this.factor.load(data.factor);\n this.rate.load(data.rate);\n this.particles = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.executeOnSingleOrMultiple)(data.particles, (particles)=>{\n return (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.deepExtend)({}, particles);\n });\n if (data.sizeOffset !== undefined) {\n this.sizeOffset = data.sizeOffset;\n }\n if (data.fillColorOffset) {\n this.fillColorOffset = this.fillColorOffset ?? {};\n if (data.fillColorOffset.h !== undefined) {\n this.fillColorOffset.h = data.fillColorOffset.h;\n }\n if (data.fillColorOffset.s !== undefined) {\n this.fillColorOffset.s = data.fillColorOffset.s;\n }\n if (data.fillColorOffset.l !== undefined) {\n this.fillColorOffset.l = data.fillColorOffset.l;\n }\n }\n if (data.strokeColorOffset) {\n this.strokeColorOffset = this.strokeColorOffset ?? {};\n if (data.strokeColorOffset.h !== undefined) {\n this.strokeColorOffset.h = data.strokeColorOffset.h;\n }\n if (data.strokeColorOffset.s !== undefined) {\n this.strokeColorOffset.s = data.strokeColorOffset.s;\n }\n if (data.strokeColorOffset.l !== undefined) {\n this.strokeColorOffset.l = data.strokeColorOffset.l;\n }\n }\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/updater-destroy/./dist/browser/Options/Classes/Split.js?\n}");
77
-
78
- /***/ },
79
-
80
- /***/ "./dist/browser/Options/Classes/SplitFactor.js"
81
- /*!*****************************************************!*\
82
- !*** ./dist/browser/Options/Classes/SplitFactor.js ***!
83
- \*****************************************************/
84
- (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
85
-
86
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SplitFactor: () => (/* binding */ SplitFactor)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nclass SplitFactor extends _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.ValueWithRandom {\n constructor(){\n super();\n this.value = 3;\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/updater-destroy/./dist/browser/Options/Classes/SplitFactor.js?\n}");
87
-
88
- /***/ },
89
-
90
- /***/ "./dist/browser/Options/Classes/SplitRate.js"
91
- /*!***************************************************!*\
92
- !*** ./dist/browser/Options/Classes/SplitRate.js ***!
93
- \***************************************************/
94
- (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
95
-
96
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SplitRate: () => (/* binding */ SplitRate)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nclass SplitRate extends _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.ValueWithRandom {\n constructor(){\n super();\n this.value = {\n min: 4,\n max: 9\n };\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/updater-destroy/./dist/browser/Options/Classes/SplitRate.js?\n}");
97
-
98
- /***/ },
99
-
100
- /***/ "./dist/browser/Utils.js"
101
- /*!*******************************!*\
102
- !*** ./dist/browser/Utils.js ***!
103
- \*******************************/
104
- (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
105
-
106
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ split: () => (/* binding */ split)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nconst defaultOffset = 0, minDestroySize = 0.5, defaultSplitCount = 0, increment = 1, unbreakableTime = 500, minSplitCount = 0, minHue = 0, hueRange = 360, minSaturation = 0, maxSaturation = 100, minLightness = 0, maxLightness = 100;\nfunction createParentColor(parentColor) {\n return _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.AnimatableColor.create(undefined, {\n value: {\n hsl: parentColor\n }\n });\n}\nfunction createOffsetColor(parentColor, offset) {\n const offsetH = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(offset.h ?? defaultOffset), offsetS = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(offset.s ?? defaultOffset), offsetL = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(offset.l ?? defaultOffset), h = (parentColor.h + offsetH) % hueRange, s = Math.max(minSaturation, Math.min(maxSaturation, parentColor.s + offsetS)), l = Math.max(minLightness, Math.min(maxLightness, parentColor.l + offsetL));\n return _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.AnimatableColor.create(undefined, {\n value: {\n hsl: {\n h: h < minHue ? h + hueRange : h,\n s,\n l\n }\n }\n });\n}\nfunction resolveSplitColor(offset, splitColor, splitParticlesColor, parentColor) {\n if (offset && parentColor) {\n return createOffsetColor(parentColor, offset);\n }\n if (splitColor) {\n return _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.AnimatableColor.create(undefined, splitColor);\n }\n if (splitParticlesColor) {\n return _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.AnimatableColor.create(undefined, splitParticlesColor);\n }\n return parentColor ? createParentColor(parentColor) : undefined;\n}\nfunction addSplitParticle(pluginManager, container, parent, splitParticlesOptions) {\n const destroyOptions = parent.options.destroy;\n if (!destroyOptions) {\n return;\n }\n const splitOptions = destroyOptions.split, splitParticleOptions = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.loadParticlesOptions)(pluginManager, container, parent.options), splitFillColor = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.itemFromSingleOrMultiple)(splitOptions.fillColor), splitStrokeColor = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.itemFromSingleOrMultiple)(splitOptions.strokeColor), parentFillColor = parent.getFillColor(), parentStrokeColor = parent.getStrokeColor();\n splitParticleOptions.move.load({\n center: {\n x: parent.position.x,\n y: parent.position.y,\n mode: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.PixelMode.precise\n }\n });\n const factor = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.identity / (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(splitOptions.factor.value);\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNumber)(splitParticleOptions.size.value)) {\n splitParticleOptions.size.value *= factor;\n } else {\n splitParticleOptions.size.value.min *= factor;\n splitParticleOptions.size.value.max *= factor;\n }\n splitParticleOptions.load(splitParticlesOptions);\n const splitParticlePaintOptions = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.itemFromSingleOrMultiple)(splitParticleOptions.paint), splitParticleFillOptions = splitParticlePaintOptions?.fill, splitParticleStrokeOptions = splitParticlePaintOptions?.stroke, fillColor = resolveSplitColor(splitOptions.fillColorOffset, splitFillColor, splitParticleFillOptions?.color, parentFillColor), strokeColor = resolveSplitColor(splitOptions.strokeColorOffset, splitStrokeColor, splitParticleStrokeOptions?.color, parentStrokeColor);\n if (fillColor && splitParticleFillOptions) {\n splitParticleFillOptions.color = fillColor;\n }\n if (strokeColor && splitParticleStrokeOptions) {\n splitParticleStrokeOptions.color = strokeColor;\n }\n const offset = splitOptions.sizeOffset ? (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(-parent.size.value, parent.size.value) : defaultOffset, position = {\n x: parent.position.x + (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.randomInRangeValue)(offset),\n y: parent.position.y + (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.randomInRangeValue)(offset)\n };\n return container.particles.addParticle(position, splitParticleOptions, parent.group, (particle)=>{\n if (particle.size.value < minDestroySize) {\n return false;\n }\n particle.velocity.length = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.randomInRangeValue)((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(parent.velocity.length, particle.velocity.length));\n particle.splitCount = (parent.splitCount ?? defaultSplitCount) + increment;\n particle.unbreakable = true;\n particle.unbreakableUntil = performance.now() + unbreakableTime;\n return true;\n });\n}\nfunction split(pluginManager, container, particle) {\n const destroyOptions = particle.options.destroy;\n if (!destroyOptions) {\n return;\n }\n const splitOptions = destroyOptions.split;\n if (splitOptions.count >= minSplitCount) {\n if (particle.splitCount === undefined || particle.splitCount > splitOptions.count) {\n return;\n }\n particle.splitCount++;\n }\n const rate = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(splitOptions.rate.value), particlesSplitOptions = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.itemFromSingleOrMultiple)(splitOptions.particles);\n for(let i = 0; i < rate; i++){\n addSplitParticle(pluginManager, container, particle, particlesSplitOptions);\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/updater-destroy/./dist/browser/Utils.js?\n}");
107
-
108
- /***/ }
109
-
110
- }]);