"use strict";(self.webpackChunkwordpress_particles=self.webpackChunkwordpress_particles||[]).push([[4385],{4385:function(e,t,s){s.r(t),s.d(t,{Repulse:function(){return r},RepulseBase:function(){return o},RepulseDiv:function(){return n},loadExternalRepulseInteraction:function(){return c}});var i=s(3563);class o{constructor(){this.distance=200,this.duration=.4,this.factor=100,this.speed=1,this.maxSpeed=50,this.easing="ease-out-quad"}load(e){e&&(void 0!==e.distance&&(this.distance=e.distance),void 0!==e.duration&&(this.duration=e.duration),void 0!==e.easing&&(this.easing=e.easing),void 0!==e.factor&&(this.factor=e.factor),void 0!==e.speed&&(this.speed=e.speed),void 0!==e.maxSpeed&&(this.maxSpeed=e.maxSpeed))}}class n extends o{constructor(){super(),this.selectors=[]}get ids(){return(0,i.KH)(this.selectors,(e=>e.replace("#","")))}set ids(e){this.selectors=(0,i.KH)(e,(e=>`#${e}`))}load(e){super.load(e),e&&(void 0!==e.ids&&(this.ids=e.ids),void 0!==e.selectors&&(this.selectors=e.selectors))}}class r extends o{load(e){super.load(e),e&&(this.divs=(0,i.KH)(e.divs,(e=>{const t=new n;return t.load(e),t})))}}class l extends i.L8{constructor(e,t){super(t),this._engine=e,t.repulse||(t.repulse={particles:[]}),this.handleClickMode=e=>{const s=this.container.actualOptions.interactivity.modes.repulse;if(s&&"repulse"===e){t.repulse||(t.repulse={particles:[]}),t.repulse.clicking=!0,t.repulse.count=0;for(const e of t.repulse.particles)this.isEnabled(e)&&e.velocity.setTo(e.initialVelocity);t.repulse.particles=[],t.repulse.finish=!1,setTimeout((()=>{t.destroyed||(t.repulse||(t.repulse={particles:[]}),t.repulse.clicking=!1)}),1e3*s.duration)}}}clear(){}init(){const e=this.container,t=e.actualOptions.interactivity.modes.repulse;t&&(e.retina.repulseModeDistance=t.distance*e.retina.pixelRatio)}async interact(){const e=this.container,t=e.actualOptions,s=e.interactivity.status===i.Wt,o=t.interactivity.events,n=o.onHover.enable,r=o.onHover.mode,l=o.onClick.enable,c=o.onClick.mode,a=o.onDiv;s&&n&&(0,i.dB)("repulse",r)?this.hoverRepulse():l&&(0,i.dB)("repulse",c)?this.clickRepulse():(0,i.XD)("repulse",a,((e,t)=>this.singleSelectorRepulse(e,t)))}isEnabled(e){var t;const s=this.container,o=s.actualOptions,n=s.interactivity.mouse,r=(null!==(t=null==e?void 0:e.interactivity)&&void 0!==t?t:o.interactivity).events,l=r.onDiv,c=(0,i.wm)("repulse",l);if(!(c||r.onHover.enable&&n.position||r.onClick.enable&&n.clickPosition))return!1;const a=r.onHover.mode,u=r.onClick.mode;return(0,i.dB)("repulse",a)||(0,i.dB)("repulse",u)||c}loadModeOptions(e){e.repulse||(e.repulse=new r);for(var t=arguments.length,s=new Array(t>1?t-1:0),i=1;i<t;i++)s[i-1]=arguments[i];for(const t of s)e.repulse.load(null==t?void 0:t.repulse)}reset(){}clickRepulse(){const e=this.container,t=e.actualOptions.interactivity.modes.repulse;if(t)if(e.repulse||(e.repulse={particles:[]}),e.repulse.finish||(e.repulse.count||(e.repulse.count=0),e.repulse.count++,e.repulse.count===e.particles.count&&(e.repulse.finish=!0)),e.repulse.clicking){const s=e.retina.repulseModeDistance;if(!s||s<0)return;const o=Math.pow(s/6,3),n=e.interactivity.mouse.clickPosition;if(void 0===n)return;const r=new i.Cd(n.x,n.y,o),l=e.particles.quadTree.query(r,(e=>this.isEnabled(e)));for(const s of l){const{dx:r,dy:l,distance:c}=(0,i.oW)(n,s.position),a=c**2,u=t.speed,p=-o*u/a;if(a<=o){e.repulse.particles.push(s);const t=i.OW.create(r,l);t.length=p,s.velocity.setTo(t)}}}else if(!1===e.repulse.clicking){for(const t of e.repulse.particles)t.velocity.setTo(t.initialVelocity);e.repulse.particles=[]}}hoverRepulse(){const e=this.container,t=e.interactivity.mouse.position,s=e.retina.repulseModeDistance;!s||s<0||!t||this.processRepulse(t,s,new i.Cd(t.x,t.y,s))}processRepulse(e,t,s,o){var n;const r=this.container,l=r.particles.quadTree.query(s,(e=>this.isEnabled(e))),c=r.actualOptions.interactivity.modes.repulse;if(c)for(const s of l){const{dx:r,dy:l,distance:a}=(0,i.oW)(s.position,e),u=(null!==(n=null==o?void 0:o.speed)&&void 0!==n?n:c.speed)*c.factor,p=(0,i.uZ)((0,i._X)(c.easing)(1-a/t)*u,0,c.maxSpeed),d=i.OW.create(0===a?u:r/a*p,0===a?u:l/a*p);s.position.addTo(d)}}singleSelectorRepulse(e,t){const s=this.container,o=s.actualOptions.interactivity.modes.repulse;if(!o)return;const n=document.querySelectorAll(e);n.length&&n.forEach((e=>{const n=e,r=s.retina.pixelRatio,l={x:(n.offsetLeft+n.offsetWidth/2)*r,y:(n.offsetTop+n.offsetHeight/2)*r},c=n.offsetWidth/2*r,a="circle"===t.type?new i.Cd(l.x,l.y,c):new i.Ae(n.offsetLeft*r,n.offsetTop*r,n.offsetWidth*r,n.offsetHeight*r),u=o.divs,p=(0,i.iC)(u,n);this.processRepulse(l,c,a,p)}))}}async function c(e){await e.addInteractor("externalRepulse",(t=>new l(e,t)))}}}]);