"use strict";(globalThis.webpackChunkwordpress_particles=globalThis.webpackChunkwordpress_particles||[]).push([[2611],{2611:(o,l,a)=>{a.r(l),a.d(l,{loadColorUpdater:()=>n});var i=a(1197);function s(o,l,a,s,e){var n,t;const r=l;if(!r||!a.enable||void 0!==r.loops&&void 0!==r.maxLoops&&r.maxLoops>0&&r.loops>=r.maxLoops)return;const c=(0,i.vd)(a.offset),v=(null!==(n=l.velocity)&&void 0!==n?n:0)*o.factor+3.6*c,u=null!==(t=l.decay)&&void 0!==t?t:1;e&&"increasing"!==r.status?(r.value-=v,r.value<0&&(r.loops||(r.loops=0),r.loops++,r.status="increasing",r.value+=r.value)):(r.value+=v,r.value>s&&(r.loops||(r.loops=0),r.loops++,e&&(r.status="decreasing",r.value-=r.value%s))),r.velocity&&1!==u&&(r.velocity*=u),r.value>s&&(r.value%=s)}class e{constructor(o){this.container=o}init(o){const l=(0,i.lN)(o.options.color,o.id,o.options.reduceDuplicates);l&&(o.color=(0,i.bS)(l,o.options.color.animation,this.container.retina.reduceFactor))}isEnabled(o){var l,a,i;const s=o.options.color.animation;return!o.destroyed&&!o.spawning&&(void 0!==(null===(l=o.color)||void 0===l?void 0:l.h.value)&&s.h.enable||void 0!==(null===(a=o.color)||void 0===a?void 0:a.s.value)&&s.s.enable||void 0!==(null===(i=o.color)||void 0===i?void 0:i.l.value)&&s.l.enable)}update(o,l){!function(o,l){var a,i,e;const n=o.options.color.animation,t=null===(a=o.color)||void 0===a?void 0:a.h,r=null===(i=o.color)||void 0===i?void 0:i.s,c=null===(e=o.color)||void 0===e?void 0:e.l;t&&s(l,t,n.h,360,!1),r&&s(l,r,n.s,100,!0),c&&s(l,c,n.l,100,!0)}(o,l)}}async function n(o){await o.addParticleUpdater("color",(o=>new e(o)))}}}]);