"use strict";(self.webpackChunkwordpress_particles=self.webpackChunkwordpress_particles||[]).push([[7556],{7556:function(o,s,i){i.r(s),i.d(s,{loadParticlesCollisionsInteraction:function(){return r}});var e=i(3563);function t(o,s,i,t,n,a){const d=(0,e.uZ)(o.options.collisions.absorb.speed*n.factor/10,0,t);o.size.value+=d/2,i.size.value-=d,t<=a&&(i.size.value=0,i.destroy())}function n(o,s){(0,e.kR)((0,e.gy)(o),(0,e.gy)(s))}function a(o,s,i,e){switch(o.options.collisions.mode){case"absorb":!function(o,s,i,e){const n=o.getRadius(),a=s.getRadius();void 0===n&&void 0!==a?o.destroy():void 0!==n&&void 0===a?s.destroy():void 0!==n&&void 0!==a&&(n>=a?t(o,0,s,a,i,e):t(s,0,o,n,i,e))}(o,s,i,e);break;case"bounce":n(o,s);break;case"destroy":!function(o,s){o.unbreakable||s.unbreakable||n(o,s),void 0===o.getRadius()&&void 0!==s.getRadius()?o.destroy():void 0!==o.getRadius()&&void 0===s.getRadius()?s.destroy():void 0!==o.getRadius()&&void 0!==s.getRadius()&&(o.getRadius()>=s.getRadius()?o:s).destroy()}(o,s)}}class d extends e.$S{constructor(o){super(o)}clear(){}init(){}async interact(o,s){const i=this.container,t=o.getPosition(),n=o.getRadius(),d=i.particles.quadTree.queryCircle(t,2*n);for(const r of d){if(o===r||!r.options.collisions.enable||o.options.collisions.mode!==r.options.collisions.mode||r.destroyed||r.spawning)continue;const d=r.getPosition(),c=r.getRadius();Math.abs(Math.round(t.z)-Math.round(d.z))>n+c||((0,e.Sp)(t,d)>n+c||a(o,r,s,i.retina.pixelRatio))}}isEnabled(o){return o.options.collisions.enable}reset(){}}async function r(o){await o.addInteractor("particlesCollisions",(o=>new d(o)))}}}]);