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