"use strict";(globalThis.webpackChunk_tsparticles_wordpress=globalThis.webpackChunk_tsparticles_wordpress||[]).push([[4825],{4825(e,i,t){t.d(i,{loadLifeUpdater:()=>l});var n=t(3199);class a extends n.PVU{sync=!1;load(e){(0,n.kZJ)(e)||(super.load(e),(0,n.kBH)(this,"sync",e.sync))}}class s extends n.PVU{sync=!1;load(e){(0,n.kZJ)(e)||(super.load(e),(0,n.kBH)(this,"sync",e.sync))}}class o{count=0;delay=new a;duration=new s;load(e){(0,n.kZJ)(e)||((0,n.kBH)(this,"count",e.count),this.delay.load(e.delay),this.duration.load(e.duration))}}class r{#e;constructor(e){this.#e=e}init(e){const i=this.#e,t=e.options.life;if(!t)return;const a=t.delay.sync?1:(0,n.G0i)(),s=t.duration.sync?1:(0,n.G0i)();e.life={delay:i.retina.reduceFactor?(0,n.VGA)(t.delay.value)*a/i.retina.reduceFactor*n.XuV:0,delayTime:0,duration:i.retina.reduceFactor?(0,n.VGA)(t.duration.value)*s/i.retina.reduceFactor*n.XuV:0,time:0,count:t.count},e.life.duration<=0&&(e.life.duration=-1),e.life.count<=0&&(e.life.count=-1),e.spawning=e.life.delay>0}isEnabled(e){return!e.destroyed}loadOptions(e,...i){(0,n.Ret)(e,"life",o,...i)}update(e,i){this.isEnabled(e)&&e.life&&function(e,i,t){if(!e.life)return;const a=e.life;let s=!1;if(e.spawning){if(a.delayTime+=i.value,!(a.delayTime>=e.life.delay))return;s=!0,e.spawning=!1,a.delayTime=0,a.time=0}if(-1===a.duration)return;if(s?a.time=0:a.time+=i.value,a.time<a.duration)return;if(a.time=0,e.life.count>0&&e.life.count--,0===e.life.count)return void e.destroy();const o=(0,n.DT4)(0,t.width),r=(0,n.DT4)(0,t.width);e.position.x=(0,n.vEz)(o),e.position.y=(0,n.vEz)(r),e.spawning=!0,a.delayTime=0,a.time=0,e.reset();const l=e.options.life;l&&(a.delay=(0,n.VGA)(l.delay.value)*n.XuV,a.duration=(0,n.VGA)(l.duration.value)*n.XuV)}(e,i,this.#e.canvas.size)}}async function l(e){e.checkVersion("4.1.3"),await e.pluginManager.register(e=>{e.pluginManager.addParticleUpdater("life",e=>Promise.resolve(new r(e)))})}}}]);