"use strict";(globalThis.webpackChunkwordpress_particles=globalThis.webpackChunkwordpress_particles||[]).push([[7808],{3151:(t,i,s)=>{s.d(i,{L:()=>a});class a{constructor(t){this.container=t,this.type="external"}}},7808:(t,i,s)=>{s.r(i),s.d(i,{Trail:()=>n,loadExternalTrailInteraction:()=>r});var a=s(3151),e=s(4684);class n{constructor(){this.delay=1,this.pauseOnStop=!1,this.quantity=1}load(t){t&&(void 0!==t.delay&&(this.delay=t.delay),void 0!==t.quantity&&(this.quantity=t.quantity),void 0!==t.particles&&(this.particles=(0,e.ZB)({},t.particles)),void 0!==t.pauseOnStop&&(this.pauseOnStop=t.pauseOnStop))}}class o extends a.L{constructor(t){super(t),this._delay=0}clear(){}init(){}async interact(t){const i=this.container,{interactivity:s}=i;if(!i.retina.reduceFactor)return;const a=i.actualOptions.interactivity.modes.trail;if(!a)return;const e=1e3*a.delay/this.container.retina.reduceFactor;if(this._delay<e&&(this._delay+=t.value),this._delay<e)return;const n=!(a.pauseOnStop&&(s.mouse.position===this._lastPosition||s.mouse.position?.x===this._lastPosition?.x&&s.mouse.position?.y===this._lastPosition?.y)),o=i.interactivity.mouse.position;o?this._lastPosition={...o}:delete this._lastPosition,n&&i.particles.push(a.quantity,i.interactivity.mouse,a.particles),this._delay-=e}isEnabled(t){const i=this.container,s=i.actualOptions,a=i.interactivity.mouse,n=(t?.interactivity??s.interactivity).events;return a.clicking&&a.inside&&!!a.position&&(0,e.dB)("trail",n.onClick.mode)||a.inside&&!!a.position&&(0,e.dB)("trail",n.onHover.mode)}loadModeOptions(t,...i){t.trail||(t.trail=new n);for(const s of i)t.trail.load(s?.trail)}reset(){}}async function r(t,i=!0){await t.addInteractor("externalTrail",(t=>new o(t)),i)}}}]);