"use strict";(globalThis.webpackChunk_tsparticles_wordpress=globalThis.webpackChunk_tsparticles_wordpress||[]).push([[1366],{1366(t,e,n){n.d(e,{InfectionPluginInstance:()=>a});var i=n(3199);class o{#t;constructor(t){this.#t=t}startInfection(t,e){const n=this.#t.actualOptions.infection,{infection:i}=t;n&&i&&(e>n.stages.length||e<0||(i.delay=0,i.delayStage=e))}updateInfection(t,e){const n=this.#t.actualOptions.infection,{infection:o}=t;if(!n||!o)return;const a=n.stages,s=a.length;if(void 0!==o.delay&&void 0!==o.delayStage){const t=o.delayStage;if(t>s||t<0)return;o.delay>=n.delay*i.XuV?(o.stage=t,o.time=0,delete o.delay,delete o.delayStage):o.delay+=e}else delete o.delay,delete o.delayStage;if(void 0!==o.stage&&void 0!==o.time){const n=a[o.stage];void 0!==n?.duration&&n.duration>=0&&o.time>n.duration*i.XuV?this.#e(t):o.time+=e}else delete o.stage,delete o.time}updateInfectionStage(t,e){const n=this.#t.actualOptions,{infection:i}=t;n.infection&&i&&(e>n.infection.stages.length||e<0||void 0!==i.stage&&i.stage>e||(i.stage=e,i.time=0))}#e(t){const e=this.#t.actualOptions.infection,{infection:n}=t;if(!e||!n)return;const i=e.stages.length;i<=0||void 0===n.stage||(n.time=0,i<=++n.stage&&(e.cure?(delete n.stage,delete n.time):(n.stage=0,n.time=0)))}}class a{#t;constructor(t){this.#t=t,this.#t.infecter=new o(this.#t)}particleFillColor(t){const e=this.#t.actualOptions;if(!t.infection||!e.infection)return;const n=t.infection.stage,i=e.infection.stages;return void 0===n?void 0:i[n]?.color}particleStrokeColor(t){return this.particleFillColor(t)}particlesSetup(){const t=this.#t.actualOptions;if(t.infection)for(let e=0;e<t.infection.infections;e++){const t=this.#t.particles.filter(t=>{const e=t;return e.infection??={},void 0===e.infection.stage}),e=(0,i.Vh1)(t);e&&this.#t.infecter?.startInfection(e,0)}}}}}]);