"use strict";(globalThis.webpackChunk_tsparticles_wordpress=globalThis.webpackChunk_tsparticles_wordpress||[]).push([[9404],{9404:(t,i,e)=>{e.d(i,{loadTiltUpdater:()=>o});var s=e(9201);class a{constructor(){this.enable=!1,this.speed=0,this.decay=0,this.sync=!1}load(t){t&&(void 0!==t.enable&&(this.enable=t.enable),void 0!==t.speed&&(this.speed=(0,s.Cs)(t.speed)),void 0!==t.decay&&(this.decay=(0,s.Cs)(t.decay)),void 0!==t.sync&&(this.sync=t.sync))}}class n extends s.SW{constructor(){super(),this.animation=new a,this.direction="clockwise",this.enable=!1,this.value=0}load(t){super.load(t),t&&(this.animation.load(t.animation),void 0!==t.direction&&(this.direction=t.direction),void 0!==t.enable&&(this.enable=t.enable))}}class l{constructor(t){this.container=t}getTransformValues(t){const i=t.tilt?.enable&&t.tilt;return{b:i?Math.cos(i.value)*i.cosDirection:void 0,c:i?Math.sin(i.value)*i.sinDirection:void 0}}init(t){const i=t.options.tilt;if(!i)return;t.tilt={enable:i.enable,value:(0,s.Gu)(i.value)*Math.PI/180,sinDirection:(0,s.sZ)()>=.5?1:-1,cosDirection:(0,s.sZ)()>=.5?1:-1};let e=i.direction;switch("random"===e&&(e=Math.floor(2*(0,s.sZ)())>0?"counter-clockwise":"clockwise"),e){case"counter-clockwise":case"counterClockwise":t.tilt.status="decreasing";break;case"clockwise":t.tilt.status="increasing"}const a=t.options.tilt?.animation;a?.enable&&(t.tilt.decay=1-(0,s.Gu)(a.decay),t.tilt.velocity=(0,s.Gu)(a.speed)/360*this.container.retina.reduceFactor,a.sync||(t.tilt.velocity*=(0,s.sZ)()))}isEnabled(t){const i=t.options.tilt?.animation;return!t.destroyed&&!t.spawning&&!!i?.enable}loadOptions(t,...i){t.tilt||(t.tilt=new n);for(const e of i)t.tilt.load(e?.tilt)}update(t,i){this.isEnabled(t)&&function(t,i){if(!t.tilt||!t.options.tilt)return;const e=t.options.tilt.animation,s=(t.tilt.velocity??0)*i.factor,a=2*Math.PI,n=t.tilt.decay??1;e.enable&&("increasing"===t.tilt.status?(t.tilt.value+=s,t.tilt.value>a&&(t.tilt.value-=a)):(t.tilt.value-=s,t.tilt.value<0&&(t.tilt.value+=a)),t.tilt.velocity&&1!==n&&(t.tilt.velocity*=n))}(t,i)}}async function o(t,i=!0){await t.addParticleUpdater("tilt",(t=>new l(t)),i)}}}]);