"use strict";(globalThis.webpackChunk_tsparticles_wordpress=globalThis.webpackChunk_tsparticles_wordpress||[]).push([[604],{604:(t,i,o)=>{o.d(i,{loadOrbitUpdater:()=>e});var a=o(9201);class r extends a.SW{constructor(){super(),this.value=45}load(t){void 0!==t&&super.load(t)}}class n{constructor(){this.animation=new a.Pp,this.enable=!1,this.opacity=1,this.rotation=new r,this.width=1}load(t){t&&(this.animation.load(t.animation),this.rotation.load(t.rotation),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.opacity&&(this.opacity=(0,a.Cs)(t.opacity)),void 0!==t.width&&(this.width=(0,a.Cs)(t.width)),void 0!==t.radius&&(this.radius=(0,a.Cs)(t.radius)),void 0!==t.color&&(this.color=a.Oz.create(this.color,t.color)))}}class s{constructor(t){this.container=t}afterDraw(t){const i=t.options.orbit;i?.enable&&this.drawOrbit(t,"front")}beforeDraw(t){const i=t.options.orbit;i?.enable&&this.drawOrbit(t,"back")}drawOrbit(t,i){const o=this.container;let r,n;switch(i){case"back":r=Math.PI/2,n=3*Math.PI/2;break;case"front":r=3*Math.PI/2,n=Math.PI/2;break;default:r=0,n=2*Math.PI}o.canvas.draw((i=>{!function(t,i,o,r,n,s,e,d,b){if(s<=0)return;const l=i.getPosition();o&&(t.strokeStyle=(0,a.vz)(o,n)),t.lineWidth=s;const c=e*Math.PI/180;t.beginPath(),t.ellipse(l.x,l.y,r/2,2*r,c,d,b),t.stroke()}(i,t,t.orbitColor??t.getFillColor(),t.retina.orbitRadius??o.retina.orbitRadius??t.getRadius(),t.orbitOpacity??1,t.orbitWidth??1,(t.orbitRotation??0)*o.retina.pixelRatio,r,n)}))}init(t){const i=this.container,o=t.options.orbit;o?.enable&&(t.orbitRotation=(0,a.Gu)(o.rotation.value),t.orbitColor=(0,a.lN)(o.color),t.retina.orbitRadius=void 0!==o.radius?(0,a.Gu)(o.radius)*i.retina.pixelRatio:void 0,i.retina.orbitRadius=t.retina.orbitRadius,t.orbitAnimationSpeed=o.animation.enable?(0,a.Gu)(o.animation.speed):0,t.orbitWidth=(0,a.Gu)(o.width),t.orbitOpacity=(0,a.Gu)(o.opacity))}isEnabled(t){const i=t.options.orbit?.animation;return!t.destroyed&&!t.spawning&&!!i?.enable}loadOptions(t,...i){t.orbit||(t.orbit=new n);for(const o of i)t.orbit.load(o?.orbit)}update(t,i){this.isEnabled(t)&&(void 0===t.orbitRotation&&(t.orbitRotation=0),t.orbitRotation+=(t.orbitAnimationSpeed??0/(2*Math.PI))*i.factor)}}async function e(t,i=!0){await t.addParticleUpdater("orbit",(t=>new s(t)),i)}}}]);