"use strict";(globalThis.webpackChunkwordpress_particles=globalThis.webpackChunkwordpress_particles||[]).push([[1151],{1151:(e,t,i)=>{i.r(t),i.d(t,{loadMotionPlugin:()=>c});class n{constructor(){this.factor=4,this.value=!0}load(e){e&&(void 0!==e.factor&&(this.factor=e.factor),void 0!==e.value&&(this.value=e.value))}}class a{constructor(){this.disable=!1,this.reduce=new n}load(e){e&&(void 0!==e.disable&&(this.disable=e.disable),this.reduce.load(e.reduce))}}var o=i(3290);class s{constructor(e,t){this._container=e,this._engine=t}async init(){const e=this._container,t=e.actualOptions.motion;if(t&&(t.disable||t.reduce.value)){const t=(0,o.HY)("(prefers-reduced-motion: reduce)");if(t){this._handleMotionChange(t);const i=async()=>{this._handleMotionChange(t);try{await e.refresh()}catch(e){}};void 0!==t.addEventListener?t.addEventListener("change",i):void 0!==t.addListener&&t.addListener(i)}else e.retina.reduceFactor=1}else e.retina.reduceFactor=1}_handleMotionChange(e){const t=this._container,i=t.actualOptions.motion;i&&(t.retina.reduceFactor=e.matches?i.disable?0:i.reduce.value?1/i.reduce.factor:1:1)}}class r{constructor(e){this.id="motion",this._engine=e}getPlugin(e){return new s(e,this._engine)}loadOptions(e,t){if(!this.needsPlugin())return;let i=e.motion;void 0===(null==i?void 0:i.load)&&(e.motion=i=new a),i.load(null==t?void 0:t.motion)}needsPlugin(){return!0}}async function c(e){const t=new r(e);await e.addPlugin(t)}}}]);