"use strict";(globalThis.webpackChunk_tsparticles_wordpress=globalThis.webpackChunk_tsparticles_wordpress||[]).push([[493],{493:(e,i,t)=>{t.d(i,{loadLifeUpdater:()=>l});var n=t(9201);class a extends n.SW{constructor(){super(),this.sync=!1}load(e){e&&(super.load(e),void 0!==e.sync&&(this.sync=e.sync))}}class s extends n.SW{constructor(){super(),this.sync=!1}load(e){e&&(super.load(e),void 0!==e.sync&&(this.sync=e.sync))}}class o{constructor(){this.count=0,this.delay=new a,this.duration=new s}load(e){e&&(void 0!==e.count&&(this.count=e.count),this.delay.load(e.delay),this.duration.load(e.duration))}}class r{constructor(e){this.container=e}init(e){const i=this.container,t=e.options.life;t&&(e.life={delay:i.retina.reduceFactor?(0,n.Gu)(t.delay.value)*(t.delay.sync?1:(0,n.sZ)())/i.retina.reduceFactor*1e3:0,delayTime:0,duration:i.retina.reduceFactor?(0,n.Gu)(t.duration.value)*(t.duration.sync?1:(0,n.sZ)())/i.retina.reduceFactor*1e3:0,time:0,count:t.count},e.life.duration<=0&&(e.life.duration=-1),e.life.count<=0&&(e.life.count=-1),e.life&&(e.spawning=e.life.delay>0))}isEnabled(e){return!e.destroyed}loadOptions(e,...i){e.life||(e.life=new o);for(const t of i)e.life.load(t?.life)}update(e,i){if(!this.isEnabled(e)||!e.life)return;const t=e.life;let a=!1;if(e.spawning){if(t.delayTime+=i.value,!(t.delayTime>=e.life.delay))return;a=!0,e.spawning=!1,t.delayTime=0,t.time=0}if(-1===t.duration)return;if(e.spawning)return;if(a?t.time=0:t.time+=i.value,t.time<t.duration)return;if(t.time=0,e.life.count>0&&e.life.count--,0===e.life.count)return void e.destroy();const s=this.container.canvas.size,o=(0,n.Cs)(0,s.width),r=(0,n.Cs)(0,s.width);e.position.x=(0,n.vd)(o),e.position.y=(0,n.vd)(r),e.spawning=!0,t.delayTime=0,t.time=0,e.reset();const l=e.options.life;l&&(t.delay=1e3*(0,n.Gu)(l.delay.value),t.duration=1e3*(0,n.Gu)(l.duration.value))}}async function l(e,i=!0){await e.addParticleUpdater("life",(e=>new r(e)),i)}}}]);