"use strict";(globalThis.webpackChunk_tsparticles_wordpress=globalThis.webpackChunk_tsparticles_wordpress||[]).push([[3834],{3834:(t,i,n)=>{n.d(i,{loadExternalGrabInteraction:()=>c});var o=n(9201);class s{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=o.Oz.create(this.color,t.color)),void 0!==t.consent&&(this.consent=t.consent),void 0!==t.opacity&&(this.opacity=t.opacity))}}class e{constructor(){this.distance=100,this.links=new s}load(t){t&&(void 0!==t.distance&&(this.distance=t.distance),this.links.load(t.links))}}function a(t,i,n,s,e){t.canvas.draw((t=>{const a=i.getPosition();!function(t,i,n,s,e,a){(0,o.pS)(t,n,s),t.strokeStyle=(0,o.iz)(e,a),t.lineWidth=i,t.stroke()}(t,i.retina.linksWidth??0,a,e,n,s)}))}class r extends o.L8{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!==o.Wt)return;const n=t.interactivity.mouse.position;if(!n)return;const s=t.retina.grabModeDistance;if(!s||s<0)return;const e=t.particles.quadTree.queryCircle(n,s,(t=>this.isEnabled(t)));for(const r of e){const e=r.getPosition(),c=(0,o.Sp)(e,n);if(c>s)continue;const l=i.modes.grab.links,d=l.opacity,b=d-c*d/s;if(b<=0)continue;const p=l.color??r.options.links?.color;if(!t.particles.grabLineColor&&p){const n=i.modes.grab.links;t.particles.grabLineColor=(0,o.Dt)(p,n.blink,n.consent)}const u=(0,o.BE)(r,void 0,t.particles.grabLineColor);u&&a(t,r,u,b,n)}}isEnabled(t){const i=this.container,n=i.interactivity.mouse,s=(t?.interactivity??i.actualOptions.interactivity).events;return s.onHover.enable&&!!n.position&&(0,o.dB)("grab",s.onHover.mode)}loadModeOptions(t,...i){t.grab||(t.grab=new e);for(const n of i)t.grab.load(n?.grab)}reset(){}}async function c(t,i=!0){await t.addInteractor("externalGrab",(t=>new r(t)),i)}}}]);