"use strict";(globalThis.webpackChunkwordpress_particles=globalThis.webpackChunkwordpress_particles||[]).push([[974],{3151:(t,i,n)=>{n.d(i,{L:()=>e});class e{constructor(t){this.container=t,this.type="external"}}},974:(t,i,n)=>{n.r(i),n.d(i,{Grab:()=>d,GrabLinks:()=>l,loadExternalGrabInteraction:()=>p});var e=n(3151),s=n(8264),o=n(5302),r=n(6720),a=n(4684),c=n(2187);class l{constructor(){this.blink=!1,this.consent=!1,this.opacity=1}load(t){t&&(void 0!==t.blink&&(this.blink=t.blink),void 0!==t.color&&(this.color=c.O.create(this.color,t.color)),void 0!==t.consent&&(this.consent=t.consent),void 0!==t.opacity&&(this.opacity=t.opacity))}}class d{constructor(){this.distance=100,this.links=new l}get lineLinked(){return this.links}set lineLinked(t){this.links=t}get line_linked(){return this.links}set line_linked(t){this.links=t}load(t){t&&(void 0!==t.distance&&(this.distance=t.distance),this.links.load(t.links??t.lineLinked??t.line_linked))}}var b=n(3326);function h(t,i,n,e,s){t.canvas.draw((t=>{const o=i.getPosition();!function(t,i,n,e,s,o){(0,b.pS)(t,n,e),t.strokeStyle=(0,r.iz)(s,o),t.lineWidth=i,t.stroke()}(t,i.retina.linksWidth??0,o,s,n,e)}))}class k extends e.L{constructor(t){super(t)}clear(){}init(){const t=this.container,i=t.actualOptions.interactivity.modes.grab;i&&(t.retina.grabModeDistance=i.distance*t.retina.pixelRatio)}async interact(){const t=this.container,i=t.actualOptions.interactivity;if(!i.modes.grab||!i.events.onHover.enable||t.interactivity.status!==s.Wt)return;const n=t.interactivity.mouse.position;if(!n)return;const e=t.retina.grabModeDistance;if(!e||e<0)return;const a=t.particles.quadTree.queryCircle(n,e,(t=>this.isEnabled(t)));for(const s of a){const a=s.getPosition(),c=(0,o.Sp)(a,n);if(c>e)continue;const l=i.modes.grab.links,d=l.opacity,b=d-c*d/e;if(b<=0)continue;const k=l.color??s.options.links?.color;if(!t.particles.grabLineColor&&k){const n=i.modes.grab.links;t.particles.grabLineColor=(0,r.Dt)(k,n.blink,n.consent)}const p=(0,r.BE)(s,void 0,t.particles.grabLineColor);p&&h(t,s,p,b,n)}}isEnabled(t){const i=this.container,n=i.interactivity.mouse,e=(t?.interactivity??i.actualOptions.interactivity).events;return e.onHover.enable&&!!n.position&&(0,a.dB)("grab",e.onHover.mode)}loadModeOptions(t,...i){t.grab||(t.grab=new d);for(const n of i)t.grab.load(n?.grab)}reset(){}}async function p(t,i=!0){await t.addInteractor("externalGrab",(t=>new k(t)),i)}}}]);