UNPKG

@tsparticles/basic

Version:

Basic tsParticles bundle — minimal core engine with only the essential features for fast, lightweight particle animations. Ready to use components available for React, Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact, Riot.js, Inferno.

2 lines • 101 kB
!function(t){t.__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.bundles=t.__tsParticlesInternals.bundles||{},t.__tsParticlesInternals.effects=t.__tsParticlesInternals.effects||{},t.__tsParticlesInternals.engine=t.__tsParticlesInternals.engine||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},t.__tsParticlesInternals.palettes=t.__tsParticlesInternals.palettes||{},t.__tsParticlesInternals.paths=t.__tsParticlesInternals.paths||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins.emittersShapes=t.__tsParticlesInternals.plugins.emittersShapes||{},t.__tsParticlesInternals.presets=t.__tsParticlesInternals.presets||{},t.__tsParticlesInternals.shapes=t.__tsParticlesInternals.shapes||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.utils=t.__tsParticlesInternals.utils||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas.utils=t.__tsParticlesInternals.canvas.utils||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path.utils=t.__tsParticlesInternals.path.utils||{};var e="undefined"!=typeof Proxy?function(t){return new Proxy(t,{get:function(t,e){return e in t||(t[e]={}),t[e]}})}:function(t){return t};t.__tsParticlesInternals.bundles=e(t.__tsParticlesInternals.bundles),t.__tsParticlesInternals.effects=e(t.__tsParticlesInternals.effects),t.__tsParticlesInternals.interactions=e(t.__tsParticlesInternals.interactions),t.__tsParticlesInternals.palettes=e(t.__tsParticlesInternals.palettes),t.__tsParticlesInternals.paths=e(t.__tsParticlesInternals.paths),t.__tsParticlesInternals.plugins=e(t.__tsParticlesInternals.plugins),t.__tsParticlesInternals.plugins.emittersShapes=e(t.__tsParticlesInternals.plugins.emittersShapes),t.__tsParticlesInternals.presets=e(t.__tsParticlesInternals.presets),t.__tsParticlesInternals.shapes=e(t.__tsParticlesInternals.shapes),t.__tsParticlesInternals.updaters=e(t.__tsParticlesInternals.updaters),t.__tsParticlesInternals.utils=e(t.__tsParticlesInternals.utils),t.__tsParticlesInternals.canvas=e(t.__tsParticlesInternals.canvas),t.__tsParticlesInternals.path=e(t.__tsParticlesInternals.path)}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(t){t.__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.bundles=t.__tsParticlesInternals.bundles||{},function(t){"use strict";const e=/^\[tsParticles Error (TSP-\d+)\]\s*/,i=t=>(...e)=>{t(...e)},s={debug:i(console.debug),error:(t,...i)=>{if("string"==typeof t){const s=e.exec(t);if(s?.[1])return void console.error(`tsParticles - ${s[1]} - ${t.slice(s[0].length)}`,...i)}console.error(`tsParticles - Error - ${t}`,...i)},info:i(console.info),log:i(console.log),trace:i(console.trace),verbose:i(console.log),warning:i(console.warn)};function n(){return s}var a;t.MoveDirection=void 0,(a=t.MoveDirection||(t.MoveDirection={})).bottom="bottom",a.bottomLeft="bottom-left",a.bottomRight="bottom-right",a.left="left",a.none="none",a.right="right",a.top="top",a.topLeft="top-left",a.topRight="top-right",a.outside="outside",a.inside="inside";const o="generated",r="100%",l="source-over",c="resize",d="visibilitychange",h=100,u=.5,p=1e3,g={x:0,y:0,z:0},f={a:1,b:0,c:0,d:1},m="random",y="mid",v=2*Math.PI,P="true",b="false",w="canvas",M=255,x=360,z=100,C=100,S=.25,O=.75,k=1e4,I=400;function D(t){return"z"in t?t.z:g.z}class L{x;y;z;constructor(t=g.x,e=g.y,i=g.z){this.x=t,this.y=e,this.z=i}static get origin(){return L.create(g.x,g.y,g.z)}get angle(){return Math.atan2(this.y,this.x)}set angle(t){this.#t(t,this.length)}get length(){return Math.sqrt(this.getLengthSq())}set length(t){this.#t(this.angle,t)}static clone(t){return L.create(t.x,t.y,D(t))}static create(t,e,i){return"number"==typeof t?new L(t,e??g.y,i??g.z):new L(t.x,t.y,D(t))}add(t){return L.create(this.x+t.x,this.y+t.y,this.z+D(t))}addTo(t){this.x+=t.x,this.y+=t.y,this.z+=D(t)}copy(){return L.clone(this)}div(t){return L.create(this.x/t,this.y/t,this.z/t)}getLengthSq(){return this.x*this.x+this.y*this.y}mult(t){return L.create(this.x*t,this.y*t,this.z*t)}multTo(t){this.x*=t,this.y*=t,this.z*=t}normalize(){const t=this.length;0!==t&&this.multTo(1/t)}rotate(t){return L.create(this.x*Math.cos(t)-this.y*Math.sin(t),this.x*Math.sin(t)+this.y*Math.cos(t),g.z)}setTo(t){this.x=t.x,this.y=t.y,this.z=D(t)}sub(t){return L.create(this.x-t.x,this.y-t.y,this.z-D(t))}subFrom(t){this.x-=t.x,this.y-=t.y,this.z-=D(t)}#t(t,e){this.x=Math.cos(t)*e,this.y=Math.sin(t)*e}}class _ extends L{constructor(t=g.x,e=g.y){super(t,e,g.z)}static get origin(){return _.create(g.x,g.y)}static clone(t){return _.create(t.x,t.y)}static create(t,e){return"number"==typeof t?new _(t,e??g.y):new _(t.x,t.y)}}function T(t){return"boolean"==typeof t}function R(t){return"string"==typeof t}function E(t){return"number"==typeof t}function A(t,e){return Object.values(t).some(t=>t===e)}function F(t,e,i){return A(t,e)?e:i}function B(t){return"object"==typeof t&&null!==t}function V(t){return Array.isArray(t)}function U(t){return null==t}const H=Math.PI/180;let N=Math.random;const $={nextFrame:t=>requestAnimationFrame(t),cancel:t=>{cancelAnimationFrame(t)}};function G(){return X(N(),0,1-Number.EPSILON)}function j(t,e){return G()*(e-t)+t}function W(t){return $.nextFrame(t)}function q(t){$.cancel(t)}function X(t,e,i){return Math.min(Math.max(t,e),i)}function Y(t,e,i,s){return Math.floor((t*i+e*s)/(i+s))}function Q(t){const e=J(t);let i=K(t);return e===i&&(i=0),j(i,e)}function Z(t){return E(t)?t:Q(t)}function K(t){return E(t)?t:t.min}function J(t){return E(t)?t:t.max}function tt(t,e){if(t===e||void 0===e&&E(t))return t;const i=K(t),s=J(t);return void 0!==e?{min:Math.min(i,e),max:Math.max(s,e)}:tt(i,s)}function et(t,e){const i=t.x-e.x,s=t.y-e.y;return i*i+s*s}function it(t,e){return Math.sqrt(et(t,e))}function st(t,e,i){return et(t,e)<=i*i}function nt(t){return t*H}function at(e,i,s){if(E(e))return nt(e);switch(e){case t.MoveDirection.top:return-Math.PI*u;case t.MoveDirection.topRight:return-Math.PI*S;case t.MoveDirection.right:return 0;case t.MoveDirection.bottomRight:return Math.PI*S;case t.MoveDirection.bottom:return Math.PI*u;case t.MoveDirection.bottomLeft:return Math.PI*O;case t.MoveDirection.left:return Math.PI;case t.MoveDirection.topLeft:return-Math.PI*O;case t.MoveDirection.inside:return Math.atan2(s.y-i.y,s.x-i.x);case t.MoveDirection.outside:return Math.atan2(i.y-s.y,i.x-s.x);default:return G()*v}}function ot(t){const e=_.origin;return e.length=1,e.angle=t,e}function rt(t,e,i,s){return _.create(t.x*(i-s)/(i+s)+2*e.x*s/(i+s),t.y)}function lt(t){return{x:(t.position?.x??G()*h)*t.size.width/h,y:(t.position?.y??G()*h)*t.size.height/h}}function ct(t){const{position:e,size:i}=t;return{x:e?.x??G()*i.width,y:e?.y??G()*i.height}}function dt(t){return t?t.endsWith("%")?Number.parseFloat(t)/h:Number.parseFloat(t):1}const ht={engineVersionMismatch:"TSP-1001",particlePositionNotFound:"TSP-1002",pluginRegisterAfterLoad:"TSP-1003",offscreenCanvasUnsupported:"TSP-1101",offscreenCanvasTransferFailed:"TSP-1102",hdrEnableInvalid:"TSP-1201",hdrModeInvalid:"TSP-1202",hdrPeakNitsInvalid:"TSP-1203"};function ut(t,...e){return`[tsParticles Error ${t}] https://particles.js.org/errors/#${t}`}var pt,gt;function ft(t){return"__proto__"===t||"constructor"===t||"prototype"===t}function mt(){return globalThis.document}function yt(t){if("undefined"!=typeof matchMedia)return matchMedia(t)}function vt(t){if("undefined"!=typeof MutationObserver)return new MutationObserver(t)}function Pt(t,e){return t===e||V(e)&&e.includes(t)}function bt(t,e,i=!0){return t[void 0!==e&&i?e%t.length:Math.floor(G()*t.length)]}function wt(t,e,i,s,n){return Mt(xt(t,s??0),e,i,n)}function Mt(e,i,s,n){let a=!0;return n&&n!==t.OutModeDirection.bottom||(a=e.top<i.height+s.x),!a||n&&n!==t.OutModeDirection.left||(a=e.right>s.x),!a||n&&n!==t.OutModeDirection.right||(a=e.left<i.width+s.y),!a||n&&n!==t.OutModeDirection.top||(a=e.bottom>s.y),a}function xt(t,e){return{bottom:t.y+e,left:t.x-e,right:t.x+e,top:t.y-e}}function zt(t,...e){for(const i of e){if(U(i))continue;if(!B(i)){t=i;continue}Array.isArray(i)?Array.isArray(t)||(t=[]):B(t)&&!Array.isArray(t)||(t=Object.create(null));const e=Object.keys(i);if(!e.some(t=>{const e=i[t];return B(e)||Array.isArray(e)})){const s=i,n=t;for(const t of e){if(ft(t))continue;const e=s[t];void 0!==e&&(n[t]=e)}continue}for(const s of e){if(ft(s))continue;const e=t,n=i[s];e[s]=Array.isArray(n)?n.map(t=>zt(void 0,t)):zt(e[s],n)}}return t}function Ct(t,e){return V(t)?t.map((t,i)=>e(t,i)):e(t,0)}function St(t,e,i){return V(t)?bt(t,e,i):t}function Ot(e,i){return function(e,i){if(e.mode!==t.PixelMode.percent){const{mode:t,...i}=e;return i}return"x"in e?{x:e.x/h*i.width,y:e.y/h*i.height}:{width:e.width/h*i.width,height:e.height/h*i.height}}(e,i)}function kt(t){const e=mt().createElement("div").style;for(const i in t){const s=t[i];if(!(i in t)||U(s))continue;const n=t.getPropertyValue?.(s);if(!n)continue;const a=t.getPropertyPriority?.(s);a?e.setProperty(s,n,a):e.setProperty(s,n)}return e}let It,Dt;function Lt(t){if(It!==t||!Dt){It=t;const e=mt().createElement("div").style,i=10,s={width:"100%",height:"100%",margin:"0",padding:"0",borderWidth:"0",position:"fixed",zIndex:t.toString(i),"z-index":t.toString(i),top:"0",left:"0","pointer-events":"none"};for(const t in s){const i=s[t];void 0!==i&&e.setProperty(t,i)}Dt=e}return Dt}function _t(t,e,i,s,n){if(s){let s={passive:!0};T(n)?s.capture=n:void 0!==n&&(s=n),t.addEventListener(e,i,s)}else{const s=n;t.removeEventListener(e,i,s)}}async function Tt(t,e){return await Promise.all([...e.values()].map(e=>e(t)))}async function Rt(t,e){const i=await Promise.all([...e.entries()].map(([e,i])=>i(t).then(t=>[e,t])));return new Map(i)}async function Et(t){const e=St(t.url,t.index);if(!e)return t.fallback;try{const t=await fetch(e);if(t.ok){const e=await t.json();if(function(t){if(V(t))return t.every(t=>B(t)&&!V(t));return B(t)&&!V(t)}(e))return e;n().error("invalid configuration data while retrieving config file")}else n().error(`${t.status.toString()} while retrieving config file`)}catch(t){n().error(`error while retrieving config file: ${t}`)}return t.fallback}function At(t){let e;const i=mt();if(t instanceof HTMLCanvasElement||t.tagName.toLowerCase()===w)e=t,e.dataset[o]??=b,e.dataset[o]===P&&(e.style.width||=r,e.style.height||=r,e.style.pointerEvents="none",e.style.setProperty("pointer-events","none"));else{const s=t.getElementsByTagName(w).item(0);s?(e=s,e.dataset[o]=b):(e=i.createElement(w),e.dataset[o]=P,t.appendChild(e)),e.style.width||=r,e.style.height||=r,e.style.pointerEvents="none",e.style.setProperty("pointer-events","none")}return e}function Ft(t,e){const i=mt();let s=e??i.getElementById(t);return s||(s=i.createElement("canvas"),s.id=t,s.dataset[o]=P,i.body.append(s),s)}t.OutModeDirection=void 0,(pt=t.OutModeDirection||(t.OutModeDirection={})).bottom="bottom",pt.left="left",pt.right="right",pt.top="top",t.PixelMode=void 0,(gt=t.PixelMode||(t.PixelMode={})).precise="precise",gt.percent="percent";class Bt{#e;constructor(){this.#e=new Map}addEventListener(t,e){this.removeEventListener(t,e);const i=this.#e.get(t);this.#e.set(t,i?[...i,e]:[e])}dispatchEvent(t,e){const i=this.#e.get(t);i?.forEach(t=>{t(e)})}hasEventListener(t){return!!this.#e.get(t)}removeAllEventListeners(t){t?this.#e.delete(t):this.#e=new Map}removeEventListener(t,e){const i=this.#e.get(t);if(!i)return;const s=i.length,n=i.indexOf(e);n<0||(1===s?this.#e.delete(t):this.#e.set(t,[...i.slice(0,n),...i.slice(n+1)]))}}var Vt,Ut,Ht,Nt,$t,Gt,jt,Wt,qt,Xt,Yt,Qt,Zt,Kt;t.EventType=void 0,(Vt=t.EventType||(t.EventType={})).configAdded="configAdded",Vt.containerInit="containerInit",Vt.particlesSetup="particlesSetup",Vt.containerStarted="containerStarted",Vt.containerStopped="containerStopped",Vt.containerDestroyed="containerDestroyed",Vt.containerPaused="containerPaused",Vt.containerPlay="containerPlay",Vt.containerBuilt="containerBuilt",Vt.particleAdded="particleAdded",Vt.particleDestroyed="particleDestroyed",Vt.particleRemoved="particleRemoved";class Jt{colorManagers=new Map;easingFunctions=new Map;initializers={effects:new Map,shapes:new Map,updaters:new Map};palettes=new Map;presets=new Map;#i=0;#s=new Set;#n=new Map;#a;#o=new Set;#r=new Set;#l=!1;#c;#d=!1;#h;#u=new Set;#p=[];#g;constructor(t){this.#a=t;const e=new WeakMap,i=()=>this.#i>0?Promise.resolve():t.init();this.#h=new Proxy(t,{get:(t,s)=>{if("init"===s)return i;const n=Reflect.get(t,s,t);if("function"!=typeof n)return n;let a=e.get(n);return a||(a=(...e)=>Reflect.apply(n,t,e),e.set(n,a)),a}})}get configs(){const t={};for(const[e,i]of this.#n)t[e]=i;return t}get initialized(){return this.#l}get plugins(){return this.#g??=Object.freeze([...this.#p])}addColorManager(t,e){this.#f(),this.colorManagers.set(t,e)}addConfig(e){this.#f();const i=e.key??e.name??"default";this.#n.set(i,e),this.#a.dispatchEvent(t.EventType.configAdded,{data:{name:i,config:e}})}addEasing(t,e){this.#f(),this.easingFunctions.get(t)||this.easingFunctions.set(t,e)}addEffect(t,e){this.#f(),this.initializers.effects.set(t,e)}addPalette(t,e){this.#f(),this.palettes.set(t,e)}addParticleUpdater(t,e){this.#f(),this.initializers.updaters.set(t,e)}addPlugin(t){if(!this.#d)throw new Error(ut(ht.pluginRegisterAfterLoad));this.getPlugin(t.id)||(this.#p.push(t),this.#g=void 0)}addPreset(t,e,i=!1){this.#f(),!i&&this.getPreset(t)||this.presets.set(t,e)}addShape(t,e){this.#f();for(const i of t)this.initializers.shapes.set(i,e)}getEasing(t){return this.easingFunctions.get(t)??(t=>t)}getPalette(t){return this.palettes.get(t)}getPlugin(t){return this.#p.find(e=>e.id===t)}getPreset(t){return this.presets.get(t)}async init(){if(!this.#l)return this.#c||(this.#c=Promise.resolve().then(async()=>{this.#d=!0,this.#s=new Set(this.#u);try{for(;this.#r.size>0||[...this.#s].some(t=>!this.#o.has(t));){for(const t of this.#s)await this.#m(t,this.#o,this.#s);const t=[...this.#r];t.length&&await Promise.all(t)}this.#u.clear(),this.#l=!0}finally{this.#d=!1,this.#c=void 0}})),this.#c}async register(...t){this.#f();for(const e of t)this.#d?(this.#u.add(e),await this.#m(e,this.#o,this.#s)):this.#u.add(e)}#f(){if(this.#l)throw new Error(ut(ht.pluginRegisterAfterLoad))}async#m(t,e,i){if(e.has(t))return;e.add(t),i.add(t),this.#i++;const s=(async()=>t(this.#h))();this.#r.add(s);try{await s}catch(i){throw e.delete(t),i}finally{this.#i--,this.#r.delete(s)}}}class te{pluginManager=new Jt(this);#y=0;#v=new WeakMap;#P=[];#b=new Bt;#l=!1;#w=0;#M=new Map;get items(){return this.#P}get version(){return"4.6.0"}addEventListener(t,e){this.#b.addEventListener(t,e)}checkVersion(t){if(this.version!==t)throw new Error(ut(ht.engineVersionMismatch,this.version))}dispatchEvent(t,e){this.#b.dispatchEvent(t,e)}async init(){this.#l||(await this.pluginManager.init(),this.#l=!0)}item(t){const e=this.items,i=e[t];if(!i?.destroyed)return i;e.splice(t,1)}async load(t){let e;"undefined"!=typeof HTMLElement&&t.element instanceof HTMLElement&&(e=t.element);const i=t.id??(e?this.#x(e):void 0)??`tsparticles${Math.floor(G()*k).toString()}`,s=++this.#w;this.#M.set(i,s);try{await this.init();const{Container:n}=await Promise.resolve().then(function(){return Os}),{index:a,url:o}=t,r=o?await Et({fallback:t.options,url:o,index:a}):t.options;if(this.#M.get(i)!==s)return;const l=St(r,a),{items:c}=this,d=c.findIndex(t=>t.id.description===i),h=new n({dispatchCallback:(t,e)=>{this.dispatchEvent(t,e)},id:i,onDestroy:t=>{if(!t)return;const e=this.items,i=e.indexOf(h);i>=0&&e.splice(i,1)},pluginManager:this.pluginManager,sourceOptions:l});if(d>=0){const t=this.item(d),e=t?1:0;t&&!t.destroyed&&t.destroy(!1),c.splice(d,e,h)}else c.push(h);const u="undefined"!=typeof OffscreenCanvas&&t.element instanceof OffscreenCanvas?t.element:At(Ft(i,e));h.canvas.loadCanvas(u);try{await h.start()}catch(t){h.destroy(!1);const e=c.indexOf(h);throw e>=0&&c.splice(e,1),t}if(h.destroyed)return;return h}finally{this.#M.get(i)===s&&this.#M.delete(i)}}async refresh(t=!0){t&&await Promise.all(this.items.map(t=>t.refresh()))}removeEventListener(t,e){this.#b.removeEventListener(t,e)}#z(t){let e=this.#v.get(t);return e||(e=`tsparticles${Math.floor(G()*k).toString()}_${this.#y++}`,this.#v.set(t,e)),e}#x(t){return t.id.length?t.id:this.#z(t)}}!function(t){t.circle="circle",t.rectangle="rectangle"}(Ut||(Ut={}));class ee{position;type;constructor(t,e,i){this.position={x:t,y:e},this.type=i}_resetPosition(t,e){this.position.x=t,this.position.y=e}}class ie extends ee{radius;constructor(t,e,i){super(t,e,Ut.circle),this.radius=i}contains(t){return st(t,this.position,this.radius)}intersects(t){const e=this.position,i=t.position,s=this.radius,n=i.x-e.x,a=i.y-e.y;if(t instanceof ie||t.type===Ut.circle){const e=s+t.radius;return e>0&&n*n+a*a<e*e}if(t instanceof se||t.type===Ut.rectangle){const e=t,{width:i,height:o}=e.size,r=Math.abs(n),l=Math.abs(a),c=r-i,d=l-o;return c*c+d*d<=s*s||r<=s+i&&l<=s+o||r<=i||l<=o}return!1}reset(t,e,i){return this._resetPosition(t,e),this.radius=i,this}}class se extends ee{size;constructor(t,e,i,s){super(t,e,Ut.rectangle),this.size={height:s,width:i}}contains(t){const e=this.size.width,i=this.size.height,s=this.position;return t.x>=s.x&&t.x<=s.x+e&&t.y>=s.y&&t.y<=s.y+i}intersects(t){if(t instanceof ie)return t.intersects(this);if(!(t instanceof se))return!1;const e=this.size.width,i=this.size.height,s=this.position,n=t.position,a=t.size,o=a.width,r=a.height;return n.x<s.x+e&&n.x+o>s.x&&n.y<s.y+i&&n.y+r>s.y}reset(t,e,i,s){return this._resetPosition(t,e),this.size.width=i,this.size.height=s,this}}function ne(t,e,i){void 0!==i&&(t[e]=i)}function ae(t,e,i){void 0!==i&&(t[e]=tt(i))}function oe(t,e,i){void 0!==i&&t[e].load(i)}function re(t,e,i,s){if(void 0!==i){const n=t;n[e]??=s(),n[e].load(i)}}function le(t,e,i,...s){const n=t;n[e]??=new i;const a=n[e];for(const t of s)a.load(t?.[e])}t.RotateDirection=void 0,(Ht=t.RotateDirection||(t.RotateDirection={})).clockwise="clockwise",Ht.counterClockwise="counter-clockwise",Ht.random="random",t.AnimationMode=void 0,(Nt=t.AnimationMode||(t.AnimationMode={})).auto="auto",Nt.increase="increase",Nt.decrease="decrease",Nt.random="random",t.HdrMode=void 0,($t=t.HdrMode||(t.HdrMode={})).standard="standard",$t.natural="natural",$t.vivid="vivid",$t.cinematic="cinematic",$t.dynamic="dynamic",t.LimitMode=void 0,(Gt=t.LimitMode||(t.LimitMode={})).delete="delete",Gt.wait="wait",t.OutMode=void 0,(jt=t.OutMode||(t.OutMode={})).bounce="bounce",jt.none="none",jt.out="out",jt.destroy="destroy",jt.split="split",t.AlterType=void 0,(Wt=t.AlterType||(t.AlterType={})).darken="darken",Wt.enlighten="enlighten",t.DestroyType=void 0,(qt=t.DestroyType||(t.DestroyType={})).none="none",qt.max="max",qt.min="min",t.GradientType=void 0,(Xt=t.GradientType||(t.GradientType={})).linear="linear",Xt.radial="radial",Xt.random="random",t.ParticleOutType=void 0,(Yt=t.ParticleOutType||(t.ParticleOutType={})).normal="normal",Yt.inside="inside",Yt.outside="outside",t.StartValueType=void 0,(Qt=t.StartValueType||(t.StartValueType={})).max="max",Qt.min="min",Qt.random="random",t.AnimationStatus=void 0,(Zt=t.AnimationStatus||(t.AnimationStatus={})).increasing="increasing",Zt.decreasing="decreasing",t.DrawLayer=void 0,(Kt=t.DrawLayer||(t.DrawLayer={}))[Kt.BackgroundElement=0]="BackgroundElement",Kt[Kt.BackgroundDraw=1]="BackgroundDraw",Kt[Kt.BackgroundMask=2]="BackgroundMask",Kt[Kt.CanvasSetup=3]="CanvasSetup",Kt[Kt.PluginContent=4]="PluginContent",Kt[Kt.Particles=5]="Particles",Kt[Kt.CanvasCleanup=6]="CanvasCleanup",Kt[Kt.Foreground=7]="Foreground";class ce{load(t){U(t)||this.doLoad(t)}}function de(t,...e){for(const i of e)t.load(i)}class he extends ce{count=0;decay=0;delay=0;enable=!1;speed=1;sync=!1;doLoad(t){ae(this,"count",t.count),ne(this,"enable",t.enable),ae(this,"speed",t.speed),ae(this,"decay",t.decay),ae(this,"delay",t.delay),ne(this,"sync",t.sync)}}class ue extends he{mode=t.AnimationMode.auto;startValue=t.StartValueType.random;doLoad(t){super.doLoad(t),ne(this,"mode",t.mode),ne(this,"startValue",t.startValue)}}class pe extends he{max;min;offset=0;sync=!0;constructor(t,e){super(),this.min=t,this.max=e}doLoad(t){super.doLoad(t),ne(this,"max",t.max),ne(this,"min",t.min),ae(this,"offset",t.offset)}}class ge extends ce{h=new pe(0,x);l=new pe(0,C);s=new pe(0,z);doLoad(t){this.h.load(t.h),this.s.load(t.s),this.l.load(t.l)}}class fe extends ce{value="";static create(t,e){const i=new fe;return i.load(t),void 0!==e&&(R(e)||V(e)?i.load({value:e}):i.load(e)),i}doLoad(t){U(t.value)||(this.value=t.value)}}class me extends fe{animation=new ge;static create(t,e){const i=new me;return i.load(t),void 0!==e&&(R(e)||V(e)?i.load({value:e}):i.load(e)),i}doLoad(t){super.doLoad(t);const e=t.animation;void 0!==e&&(void 0===e.enable?this.animation.load(t.animation):this.animation.h.load(e))}}class ye extends ce{color;draw;element;image="";opacity=1;position="";repeat="";size="";constructor(){super(),this.color=new fe,this.color.value=""}doLoad(t){void 0!==t.color&&(this.color=fe.create(this.color,t.color)),ne(this,"element",t.element),ne(this,"draw",t.draw),ne(this,"image",t.image),ne(this,"position",t.position),ne(this,"repeat",t.repeat),ne(this,"size",t.size),ne(this,"opacity",t.opacity)}}class ve extends ce{enable=!0;zIndex=0;doLoad(t){ne(this,"enable",t.enable),ne(this,"zIndex",t.zIndex)}}class Pe extends ce{enable=!0;mode=t.HdrMode.standard;peakNits=400;doLoad(e){if(void 0!==e.enable&&!T(e.enable))throw new Error(ut(ht.hdrEnableInvalid,String(e.enable)));if(void 0!==e.mode&&!A(t.HdrMode,e.mode))throw new Error(ut(ht.hdrModeInvalid,Object.values(t.HdrMode).join(", "),(i=e.mode,String(i))));var i;if(void 0!==e.peakNits&&(!E(e.peakNits)||!Number.isFinite(e.peakNits)||e.peakNits<=0))throw new Error(ut(ht.hdrPeakNitsInvalid,String(e.peakNits)));ne(this,"enable",e.enable),ne(this,"mode",e.mode),ne(this,"peakNits",e.peakNits)}}class be extends ce{delay=.5;enable=!0;doLoad(t){ne(this,"delay",t.delay),ne(this,"enable",t.enable)}}class we extends ce{close=!0;options={};type=[];doLoad(t){const e=t.options;if(void 0!==e)for(const t in e){const i=e[t];i&&(this.options[t]=zt(this.options[t]??{},i))}ne(this,"close",t.close),ne(this,"type",t.type)}}class Me extends ce{color;enable=!0;opacity=1;doLoad(t){void 0!==t.color&&(this.color=me.create(this.color,t.color)),ne(this,"enable",t.enable),ae(this,"opacity",t.opacity)}}class xe extends ce{offset=0;value=90;doLoad(t){ae(this,"offset",t.offset),ae(this,"value",t.value)}}class ze extends ce{mode=t.PixelMode.percent;radius=0;x=50;y=50;doLoad(t){ne(this,"x",t.x),ne(this,"y",t.y),ne(this,"mode",t.mode),ne(this,"radius",t.radius)}}class Ce extends ce{acceleration=9.81;enable=!1;inverse=!1;maxSpeed=50;doLoad(t){ae(this,"acceleration",t.acceleration),ne(this,"enable",t.enable),ne(this,"inverse",t.inverse),ae(this,"maxSpeed",t.maxSpeed)}}class Se extends ce{value=0;doLoad(t){U(t.value)||(this.value=tt(t.value))}}class Oe extends Se{animation=new he;doLoad(t){super.doLoad(t),oe(this,"animation",t.animation)}}class ke extends Oe{animation=new ue}class Ie extends ce{clamp=!0;delay=new Se;enable=!1;generator;options={};doLoad(t){ne(this,"clamp",t.clamp),this.delay.load(t.delay),ne(this,"enable",t.enable),this.generator=t.generator,t.options&&(this.options=zt(this.options,t.options))}}class De extends ce{bottom;default=t.OutMode.out;left;right;top;doLoad(t){void 0!==t.default&&(this.default=t.default),this.bottom=t.bottom??t.default,this.left=t.left??t.default,this.right=t.right??t.default,this.top=t.top??t.default}}class Le extends ce{acceleration=0;enable=!1;position;doLoad(t){ae(this,"acceleration",t.acceleration),ne(this,"enable",t.enable),t.position&&(this.position=zt({},t.position))}}class _e extends ce{angle=new xe;center=new ze;decay=0;direction=t.MoveDirection.none;distance={};drift=0;enable=!1;gravity=new Ce;outModes=new De;path=new Ie;random=!1;size=!1;speed=2;spin=new Le;straight=!1;vibrate=!1;warp=!1;doLoad(t){this.angle.load(E(t.angle)?{value:t.angle}:t.angle),this.center.load(t.center),ae(this,"decay",t.decay),ne(this,"direction",t.direction),void 0!==t.distance&&(this.distance=E(t.distance)?{horizontal:t.distance,vertical:t.distance}:{...t.distance}),ae(this,"drift",t.drift),ne(this,"enable",t.enable),this.gravity.load(t.gravity);const e=t.outModes;void 0!==e&&(B(e)?this.outModes.load(e):this.outModes.load({default:e})),this.path.load(t.path),ne(this,"random",t.random),ne(this,"size",t.size),ae(this,"speed",t.speed),this.spin.load(t.spin),ne(this,"straight",t.straight),ne(this,"vibrate",t.vibrate),ne(this,"warp",t.warp)}}class Te extends ce{color;opacity;width=0;doLoad(t){void 0!==t.color&&(this.color=me.create(this.color,t.color)),ae(this,"width",t.width),ae(this,"opacity",t.opacity)}}class Re extends ce{color;fill;stroke;doLoad(t){void 0!==t.color&&(this.color=me.create(this.color,t.color)),re(this,"fill",t.fill,()=>new Me),re(this,"stroke",t.stroke,()=>new Te)}}class Ee extends Se{value=1}class Ae extends ce{horizontal=new Ee;vertical=new Ee;doLoad(t){this.horizontal.load(t.horizontal),this.vertical.load(t.vertical)}}class Fe extends ce{enable=!1;height=1080;width=1920;doLoad(t){ne(this,"enable",t.enable),ne(this,"width",t.width),ne(this,"height",t.height)}}class Be extends ce{mode=t.LimitMode.delete;value=0;doLoad(t){ne(this,"mode",t.mode),ne(this,"value",t.value)}}class Ve extends ce{density=new Fe;limit=new Be;value=0;doLoad(t){this.density.load(t.density),this.limit.load(t.limit),ne(this,"value",t.value)}}class Ue extends ce{close=!0;options={};type="circle";doLoad(t){const e=t.options;if(void 0!==e)for(const t in e){const i=e[t];i&&(this.options[t]=zt(this.options[t]??{},i))}ne(this,"close",t.close),ne(this,"type",t.type)}}class He extends Se{opacityRate=1;sizeRate=1;velocityRate=1;doLoad(t){super.doLoad(t),ne(this,"opacityRate",t.opacityRate),ne(this,"sizeRate",t.sizeRate),ne(this,"velocityRate",t.velocityRate)}}class Ne extends ce{bounce=new Ae;effect=new we;groups={};move=new _e;number=new Ve;paint;palette;reduceDuplicates=!1;shape=new Ue;zIndex=new He;#C;#S;constructor(t,e){super(),this.#S=t,this.#C=e,this.paint=new Re,this.paint.color=new me,this.paint.color.value="#fff",this.paint.fill=new Me,this.paint.fill.enable=!0}doLoad(t){if(t.palette&&(this.palette=t.palette,this.#O(this.palette)),void 0!==t.groups)for(const e of Object.keys(t.groups)){if(!(e in t.groups))continue;const i=t.groups[e];void 0!==i&&(this.groups[e]=zt(this.groups[e]??{},i))}void 0!==t.reduceDuplicates&&(this.reduceDuplicates=t.reduceDuplicates),this.bounce.load(t.bounce),this.effect.load(t.effect),this.move.load(t.move),this.number.load(t.number);const e=t.paint;if(e&&(V(e)?this.paint=Ct(e,t=>{const e=new Re;return e.load(t),e}):V(this.paint)?(this.paint=new Re,this.paint.load(e)):this.paint.load(e)),this.shape.load(t.shape),this.zIndex.load(t.zIndex),this.#C){for(const e of this.#S.plugins)e.loadParticlesOptions&&e.loadParticlesOptions(this.#C,this,t);const e=this.#C.particleUpdaters;for(const i of e)i.loadOptions&&i.loadOptions(this,t)}}#O(t){const e=this.#S.getPalette(t);if(!e)return;const i=e.colors,s=(V(i)?i:[i]).flatMap(t=>{const e=t.fill,i=t.stroke,s=e?{color:{value:e.value},enable:e.enable,opacity:e.opacity}:void 0;return i?[{fill:s,stroke:{color:{value:i.value},opacity:i.opacity,width:i.width||0}}]:[{fill:s}]}),n=s.length>1?s:s[0]??{};this.load({paint:n,blend:{enable:!0,mode:e.blendMode}})}}function $e(t,e,...i){const s=new Ne(t,e);return de(s,...i),s}class Ge extends ce{autoPlay=!0;background;clear=!0;defaultThemes={};delay=0;detectRetina=!0;duration=0;fpsLimit=120;fullScreen;hdr;key;name;palette;particles;pauseOnBlur=!0;pauseOnOutsideViewport=!0;preset;resize;smooth=!1;style={};zLayers=100;#C;#S;constructor(t,e){super(),this.#S=t,this.#C=e,this.background=new ye,this.fullScreen=new ve,this.hdr=new Pe,this.particles=$e(this.#S,this.#C),this.resize=new be}doLoad(e){void 0!==e.preset&&(this.preset=e.preset,Ct(this.preset,t=>{this.#k(t)})),void 0!==e.palette&&(this.palette=e.palette,this.#O(this.palette)),ne(this,"autoPlay",e.autoPlay),ne(this,"clear",e.clear),ne(this,"key",e.key),ne(this,"name",e.name),ae(this,"delay",e.delay),ne(this,"detectRetina",e.detectRetina),ae(this,"duration",e.duration),ne(this,"fpsLimit",e.fpsLimit);const i=e.hdr;T(i)?(this.hdr.enable=i,this.hdr.mode=t.HdrMode.standard,this.hdr.peakNits=400):this.hdr.load(i),ne(this,"pauseOnBlur",e.pauseOnBlur),ne(this,"pauseOnOutsideViewport",e.pauseOnOutsideViewport),ne(this,"zLayers",e.zLayers),this.background.load(e.background);const s=e.fullScreen;T(s)?this.fullScreen.enable=s:this.fullScreen.load(s),this.particles.load(e.particles),this.resize.load(e.resize),this.style=zt(this.style,e.style),ne(this,"smooth",e.smooth),this.#S.plugins.forEach(t=>{t.loadOptions(this.#C,this,e)})}#O(t){const e=this.#S.getPalette(t);e&&this.load({background:{color:e.background},blend:{enable:!0,mode:e.blendMode},particles:{palette:t}})}#k(t){this.load(this.#S.getPreset(t))}}const je=new Map,We=1.15,qe=1.05,Xe=.2126,Ye=.7152,Qe=.0722;function Ze(t,e){let i=je.get(t);return i||(i=e(),je.size>2e3&&je.clear(),je.set(t,i)),i}function Ke(t){return X(t*(2.51*t+.03)/(t*(2.43*t+.59)+.14),0,1)}function Je(t){return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function ti(t){return t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055}function ei(t,e){if(e)for(const i of t.colorManagers.values())if(i.accepts(e))return i.parseString(e)}function ii(t,e,i,s=!0){if(!e)return;const n=R(e)?{value:e}:e;if(R(n.value))return si(t,n.value,i,s);if(V(n.value)){const e=bt(n.value,i,s);if(!e)return;return ii(t,{value:e})}for(const e of t.colorManagers.values()){const t=e.handleRangeColor(n);if(t)return t}}function si(t,e,i,s=!0){if(!e)return;const n=R(e)?{value:e}:e;if(R(n.value))return n.value===m?hi():oi(t,n.value);if(V(n.value)){const e=bt(n.value,i,s);if(!e)return;return si(t,{value:e})}for(const e of t.colorManagers.values()){const t=e.handleColor(n);if(t)return t}}function ni(t,e,i,s=!0){const n=ii(t,e,i,s);return n?ai(n):void 0}function ai(t){const e=t.r/M,i=t.g/M,s=t.b/M,n=Math.max(e,i,s),a=Math.min(e,i,s),o={h:0,l:(n+a)*u,s:0};return n!==a&&(o.s=o.l<u?(n-a)/(n+a):(n-a)/(2-n-a),o.h=e===n?(i-s)/(n-a):i===n?2+(s-e)/(n-a):4+(e-i)/(n-a)),o.l*=C,o.s*=z,o.h*=60,o.h<0&&(o.h+=x),o.h>=x&&(o.h-=x),o}function oi(t,e){return ei(t,e)}function ri(t,e,i){if(i<0&&i++,i>1&&i--,6*i<1)return t+6*(e-t)*i;if(2*i<1)return e;if(3*i<2){return t+(e-t)*(2/3-i)*6}return t}function li(t){const e=(t.h%x+x)%x,i=Math.max(0,Math.min(z,t.s)),s=Math.max(0,Math.min(C,t.l)),n=e/x,a=i/z,o=s/C;if(0===i){const t=Math.round(o*M);return{r:t,g:t,b:t}}const r=o<u?o*(1+a):o+a-o*a,l=2*o-r,c=1/3,d=Math.min(M,M*ri(l,r,n+c)),h=Math.min(M,M*ri(l,r,n)),p=Math.min(M,M*ri(l,r,n-c));return{r:Math.round(d),g:Math.round(h),b:Math.round(p)}}function ci(t){const e=(t.h%x+x)%x,i=Math.max(0,Math.min(z,t.s)),s=Math.max(0,Math.min(C,t.l)),n=e/x,a=i/z,o=s/C;if(0===i){const t=o*M;return{r:t,g:t,b:t}}const r=o<u?o*(1+a):o+a-o*a,l=2*o-r,c=1/3;return{r:Math.min(M,M*ri(l,r,n+c)),g:Math.min(M,M*ri(l,r,n)),b:Math.min(M,M*ri(l,r,n-c))}}function di(t){const e=li(t);return{a:t.a,b:e.b,g:e.g,r:e.r}}function hi(t,e){const i=t??0;if(e)return{r:j(i,M),g:j(i,M),b:j(i,M)};const s=()=>Math.floor(j(i,256));return{b:s(),g:s(),r:s()}}function ui(e,i,s,n,a){const o=i?4:2,r=s??1;return Ze(i?`rgb-${e.r.toFixed(o)}-${e.g.toFixed(o)}-${e.b.toFixed(o)}-hdr-${r.toString()}-${(n??I).toString()}-${a??t.HdrMode.standard}`:`rgb-${e.r.toFixed(o)}-${e.g.toFixed(o)}-${e.b.toFixed(o)}-sdr-${r.toString()}`,()=>i?function(e,i,s=400,n=t.HdrMode.standard){const a=s/203,o=function(e,i,s,n){const a=e.r/M,o=e.g/M,r=e.b/M;if(n!==t.HdrMode.natural&&n!==t.HdrMode.vivid&&n!==t.HdrMode.cinematic&&n!==t.HdrMode.dynamic)return{b:r,g:o,r:a};const l=Math.max(1,i),c=Xe*a+Ye*o+Qe*r,d=function(t,e,i){if(t<=i)return Ke(t);const s=t+(t-i)*(e-1);return Ke(s)}(c,i,s),h=c>0?d/c:1;return function(e,i,s,n,a){switch(n){case t.HdrMode.vivid:{const t=(e+i+s)/3;return{b:X(X(t+(s-t)*We,0,a)*qe,0,a),g:X(X(t+(i-t)*We,0,a)*qe,0,a),r:X(X(t+(e-t)*We,0,a)*qe,0,a)}}case t.HdrMode.cinematic:{const t=1.05*e,n=.95*s,o=(t+i+n)/3;return{b:X(o+1.1*(n-o),0,a),g:X(o+1.1*(i-o),0,a),r:X(o+1.1*(t-o),0,a)}}case t.HdrMode.dynamic:{const t=Xe*e+Ye*i+Qe*s,n=Math.min(1,2*t),o=1-n,r=(e+i+s)/3,l=X(r+(e-r)*We,0,a)*qe,c=X(r+(i-r)*We,0,a)*qe,d=X(r+(s-r)*We,0,a)*qe;return{b:X(s*o+d*n,0,a),g:X(i*o+c*n,0,a),r:X(e*o+l*n,0,a)}}case t.HdrMode.standard:case t.HdrMode.natural:default:return{b:s,g:i,r:e}}}(X(a*h,0,l),X(o*h,0,l),X(r*h,0,l),n,l)}(e,a,.18,n);return`color(display-p3 ${o.r.toString()} ${o.g.toString()} ${o.b.toString()} / ${(i??1).toString()})`}(e,s,n,a):function(t,e){return`rgba(${t.r.toString()}, ${t.g.toString()}, ${t.b.toString()}, ${(e??1).toString()})`}(e,s))}function pi(e,i,s,n,a){const o=i?4:2,r=s??1;return Ze(i?`hsl-${e.h.toFixed(o)}-${e.s.toFixed(o)}-${e.l.toFixed(o)}-hdr-${r.toString()}-${(n??I).toString()}-${a??t.HdrMode.standard}`:`hsl-${e.h.toFixed(o)}-${e.s.toFixed(o)}-${e.l.toFixed(o)}-sdr-${r.toString()}`,()=>i?ui(ci(e),!0,s,n,a):`hsla(${e.h.toString()}, ${e.s.toString()}%, ${e.l.toString()}%, ${r.toString()})`)}function gi(t,e,i,s,n){let a=t,o=e;if("r"in a||(a=n?ci(t):li(t)),"r"in o||(o=n?ci(e):li(e)),n){const t={b:Je(a.b/M),g:Je(a.g/M),r:Je(a.r/M)},e={b:Je(o.b/M),g:Je(o.g/M),r:Je(o.r/M)},n=i+s;return{b:ti((t.b*i+e.b*s)/n)*M,g:ti((t.g*i+e.g*s)/n)*M,r:ti((t.r*i+e.r*s)/n)*M}}return{b:Y(a.b,o.b,i,s),g:Y(a.g,o.g,i,s),r:Y(a.r,o.r,i,s)}}function fi(t){return void 0===t?void 0:{h:t.h.value,s:t.s.value,l:t.l.value}}function mi(t,e,i){const s={h:{enable:!1,value:t.h,min:0,max:x},s:{enable:!1,value:t.s,min:0,max:z},l:{enable:!1,value:t.l,min:0,max:C}};return e&&(yi(s.h,e.h,i),yi(s.s,e.s,i),yi(s.l,e.l,i)),s}function yi(e,i,s){e.enable=i.enable,e.min=i.min,e.max=i.max,e.enable?(e.velocity=Z(i.speed)/h*s,e.decay=1-Z(i.decay),e.status=t.AnimationStatus.increasing,e.loops=0,e.maxLoops=Z(i.count),e.time=0,e.delayTime=Z(i.delay)*p,i.sync||(e.velocity*=G(),e.value*=G()),e.initialValue=e.value,e.offset=tt(i.offset)):e.velocity=0}function vi(e,i,s,n){if(!e.enable||(e.maxLoops??0)>0&&(e.loops??0)>(e.maxLoops??0))return;if(e.time??=0,(e.delayTime??0)>0&&e.time<(e.delayTime??0)&&(e.time+=s.value),(e.delayTime??0)>0&&e.time<(e.delayTime??0))return;const a=e.offset?Q(e.offset):0,o=(e.velocity??0)*s.factor+3.6*a,r=e.decay??1,l=e.max,c=e.min;i&&e.status!==t.AnimationStatus.increasing?(e.value-=o,e.value<c&&(e.loops??=0,e.loops++,e.status=t.AnimationStatus.increasing)):(e.value+=o,e.value>l&&(e.loops??=0,e.loops++,i?e.status=t.AnimationStatus.decreasing:e.value-=l)),e.velocity&&1!==r&&(e.velocity*=r),e.value=X(e.value,c,l)}function Pi(t,e,i){if(!t)return;const{h:s,s:n,l:a}=t;vi(s,!1,e),vi(n,!0,e),vi(a,!0,e)}function bi(e,i,s){return{h:e.h,s:e.s,l:e.l+(i===t.AlterType.darken?-1:1)*s}}const wi=function(){const t=globalThis.tsParticles;return t?.pluginManager?t:new te}();class Mi{enable=!1;mode="destination-out";load(t){U(t)||(ne(this,"mode",t.mode),ne(this,"enable",t.enable))}}function xi(t){if(!t||"object"!=typeof t||!("blend"in t))return!1;const e=t.blend;return!!e&&"object"==typeof e&&"enable"in e&&!!e.enable}class zi{id="blend";async getPlugin(t){const{BlendPluginInstance:e}=await Promise.resolve().then(function(){return ks});return new e(t)}loadOptions(t,e,i){if(!this.needsPlugin(e)&&!this.needsPlugin(i))return;let s=e.blend;s?.load||(e.blend=s=new Mi),s.load(i?.blend)}loadParticlesOptions(t,e,i){e.blend??=new Mi,e.blend.load(i?.blend)}needsPlugin(t){if(t?.blend?.enable||t?.particles?.blend?.enable||Object.values(t?.particles?.groups??{}).some(xi))return!0;const e=t?.emitters;let i=[];return Array.isArray(e)?i=e:e&&(i=[e]),i.some(t=>{if(!t||"object"!=typeof t||!("particles"in t))return!1;const e=t.particles;return Array.isArray(e)?e.some(xi):xi(e)})}}async function Ci(t){t.checkVersion("4.6.0"),await t.pluginManager.register(t=>{t.pluginManager.addPlugin(new zi)})}class Si{draw(t){!function(t){const{context:e,particle:i,radius:s}=t;i.circleRange??={min:0,max:v};const n=i.circleRange;e.arc(g.x,g.y,s,n.min,n.max,!1)}(t)}getSidesCount(){return 12}particleInit(t,e){const i=e.shapeData,s=i?.angle??{max:360,min:0};e.circleRange=B(s)?{min:nt(s.min),max:nt(s.max)}:{min:0,max:nt(s)}}}async function Oi(t){t.checkVersion("4.6.0"),await t.pluginManager.register(t=>{t.pluginManager.addShape(["circle"],()=>Promise.resolve(new Si))})}var ki;!function(t){t[t.r=1]="r",t[t.g=2]="g",t[t.b=3]="b",t[t.a=4]="a"}(ki||(ki={}));const Ii=/^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i,Di=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i;class Li{accepts(t){return t.startsWith("#")}handleColor(t){return this.#I(t.value)}handleRangeColor(t){return this.#I(t.value)}parseString(t){return this.#I(t)}#I(t){if("string"!=typeof t||!this.accepts(t))return;const e=t.replace(Ii,(t,e,i,s,n)=>e+e+i+i+s+s+(void 0===n?"":n+n)),i=Di.exec(e);return i?{a:i[ki.a]?Number.parseInt(i[ki.a],16)/255:1,b:Number.parseInt(i[ki.b]??"0",16),g:Number.parseInt(i[ki.g]??"0",16),r:Number.parseInt(i[ki.r]??"0",16)}:void 0}}async function _i(t){t.checkVersion("4.6.0"),await t.pluginManager.register(t=>{t.pluginManager.addColorManager("hex",new Li)})}var Ti;!function(t){t[t.h=1]="h",t[t.s=2]="s",t[t.l=3]="l",t[t.a=5]="a"}(Ti||(Ti={}));const Ri=/hsla?\(\s*(\d+)\s*[\s,]\s*(\d+)%\s*[\s,]\s*(\d+)%\s*([\s,]\s*(0|1|0?\.\d+|(\d{1,3})%)\s*)?\)/i;class Ei{accepts(t){return t.startsWith("hsl")}handleColor(t){const e=t.value.hsl??t.value;if("h"in e&&"s"in e&&"l"in e)return li(e)}handleRangeColor(t){const e=t.value.hsl??t.value;if("h"in e&&"s"in e&&"l"in e)return li({h:Z(e.h),l:Z(e.l),s:Z(e.s)})}parseString(t){if(!this.accepts(t))return;const e=Ri.exec(t);return e?di({a:e.length>4?dt(e[Ti.a]):1,h:Number.parseInt(e[Ti.h]??"0",10),l:Number.parseInt(e[Ti.l]??"0",10),s:Number.parseInt(e[Ti.s]??"0",10)}):void 0}}async function Ai(t){t.checkVersion("4.6.0"),await t.pluginManager.register(t=>{t.pluginManager.addColorManager("hsl",new Ei)})}class Fi{id="move";#S;constructor(t){this.#S=t}async getPlugin(t){const{MovePluginInstance:e}=await Promise.resolve().then(function(){return Ds});return new e(this.#S,t)}loadOptions(){}needsPlugin(){return!0}}async function Bi(t){t.checkVersion("4.6.0"),await t.pluginManager.register(t=>{const e=t.pluginManager;e.initializers.pathGenerators??=new Map,e.addPathGenerator=(t,i)=>{e.initialized||(e.initializers.pathGenerators??=new Map,e.initializers.pathGenerators.set(t,i))},t.pluginManager.addPlugin(new Fi(t.pluginManager))})}function Vi(e,i){const s=e.value,n=e.animation,a={delayTime:Z(n.delay)*p,enable:n.enable,value:Z(e.value)*i,max:J(s)*i,min:K(s)*i,loops:0,maxLoops:Z(n.count),time:0};if(n.enable){switch(a.decay=1-Z(n.decay),n.mode){case t.AnimationMode.increase:a.status=t.AnimationStatus.increasing;break;case t.AnimationMode.decrease:a.status=t.AnimationStatus.decreasing;break;case t.AnimationMode.random:a.status=G()>=u?t.AnimationStatus.increasing:t.AnimationStatus.decreasing}const e=n.mode===t.AnimationMode.auto;switch(n.startValue){case t.StartValueType.min:a.value=a.min,e&&(a.status=t.AnimationStatus.increasing);break;case t.StartValueType.max:a.value=a.max,e&&(a.status=t.AnimationStatus.decreasing);break;case t.StartValueType.random:default:a.value=Q(a),e&&(a.status=G()>=u?t.AnimationStatus.increasing:t.AnimationStatus.decreasing)}}return a.initialValue=a.value,a}function Ui(e,i,s,n,a){if(e.destroyed||!i.enable||(i.maxLoops??0)>0&&(i.loops??0)>(i.maxLoops??0))return;const o=(i.velocity??0)*a.factor,r=i.min,l=i.max,c=i.decay??1;i.time??=0;const d=i.delayTime??0;if(!(d>0&&i.time<d&&(i.time+=a.value,i.time<d))){switch(i.status){case t.AnimationStatus.increasing:i.value+=o;break;case t.AnimationStatus.decreasing:i.value-=o}switch(i.velocity&&1!==c&&(i.velocity*=c),i.status){case t.AnimationStatus.increasing:i.value>=l&&(i.status=t.AnimationStatus.decreasing,i.loops??=0,i.loops++);break;case t.AnimationStatus.decreasing:i.value<=r&&(i.status=t.AnimationStatus.increasing,i.loops??=0,i.loops++)}!function(e,i,s,n,a){switch(i){case t.DestroyType.max:s>=a&&e.destroy();break;case t.DestroyType.min:s<=n&&e.destroy()}}(e,n,i.value,r,l),e.destroyed||(i.value=X(i.value,r,l))}}class Hi extends ue{destroy=t.DestroyType.none;load(t){super.load(t),U(t)||ne(this,"destroy",t.destroy)}}class Ni extends ke{animation=new Hi;value=1;load(t){if(U(t))return;super.load(t);const e=t.animation;void 0!==e&&this.animation.load(e)}}class $i{#C;constructor(t){this.#C=t}init(t){const e=t.options.opacity;if(!e)return;t.opacity=Vi(e,1);const i=e.animation;i.enable&&(t.opacity.velocity=Z(i.speed)/h*this.#C.retina.reduceFactor,i.sync||(t.opacity.velocity*=G()))}isEnabled(t){return!t.destroyed&&!t.spawning&&!!t.opacity&&t.opacity.enable&&((t.opacity.maxLoops??0)<=0||(t.opacity.maxLoops??0)>0&&(t.opacity.loops??0)<(t.opacity.maxLoops??0))}loadOptions(t,...e){le(t,"opacity",Ni,...e)}reset(t){t.opacity&&(t.opacity.time=0,t.opacity.loops=0)}update(t,e){this.isEnabled(t)&&t.opacity&&t.options.opacity&&Ui(t,t.opacity,0,t.options.opacity.animation.destroy,e)}}async function Gi(t){t.checkVersion("4.6.0"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("opacity",t=>Promise.resolve(new $i(t)))})}const ji={[t.OutModeDirection.left]:{axis:"x",canvas:"width",bounce:"horizontal",negativeEdge:"right",positiveEdge:"left",negative:!0},[t.OutModeDirection.right]:{axis:"x",canvas:"width",bounce:"horizontal",negativeEdge:"right",positiveEdge:"left",negative:!1},[t.OutModeDirection.top]:{axis:"y",canvas:"height",bounce:"vertical",negativeEdge:"bottom",positiveEdge:"top",negative:!0},[t.OutModeDirection.bottom]:{axis:"y",canvas:"height",bounce:"vertical",negativeEdge:"bottom",positiveEdge:"top",negative:!1}};class Wi{modes;#C;#D;constructor(e){this.#C=e,this.modes=[t.OutMode.bounce,t.OutMode.split],this.#D=e.plugins.filter(t=>!!t.particleBounce)}update(e,i,s,n){if(!this.modes.includes(n))return;for(const t of this.#D)if(t.particleBounce?.(e,s,i))return;const a=e.getPosition(),o=e.offset,r=e.getRadius(),l=xt(a,r),c=this.#C.canvas.size,d=!e.isInsideCanvasForOutMode(n,i);!function(e){if(e.outMode!==t.OutMode.bounce&&e.outMode!==t.OutMode.split||!(e.direction in ji))return;const i=ji[e.direction],s=e.bounds,n=e.canvasSize[i.canvas],a=e.particle.position,o=e.particle.velocity[i.axis];if(i.negative&&s[i.negativeEdge]<0?a[i.axis]=e.size+e.offset[i.axis]:!i.negative&&s[i.positiveEdge]>n&&(a[i.axis]=n-e.size-e.offset[i.axis]),!e.outOfCanvas||!(i.negative&&o<0||!i.negative&&o>0))return;e.particle.velocity[i.axis]*=-Z(e.particle.options.bounce[i.bounce].value);const r=e.offset[i.axis]+e.size;a[i.axis]=i.negative?r:n-r,e.outMode===t.OutMode.split&&e.particle.destroy()}({particle:e,outMode:n,direction:i,bounds:l,canvasSize:c,offset:o,outOfCanvas:d,size:r})}}class qi{modes;constructor(e){this.modes=[t.OutMode.destroy]}update(e,i,s,n){if(this.modes.includes(n)){switch(e.outType){case t.ParticleOutType.normal:case t.ParticleOutType.outside:if(e.isInsideCanvasForOutMode(n,i))return;break;case t.ParticleOutType.inside:{const t=e.position.x-e.moveCenter.x,i=e.position.y-e.moveCenter.y,{x:s,y:n}=e.velocity;if(s<0&&t>e.moveCenter.radius||n<0&&i>e.moveCenter.radius||s>=0&&t<-e.moveCenter.radius||n>=0&&i<-e.moveCenter.radius)return;break}}e.destroy(!0)}}}class Xi{modes;#C;constructor(e){this.#C=e,this.modes=[t.OutMode.none]}update(e,i,s,n){if(!this.modes.includes(n))return;if((e.options.move.distance.horizontal&&(i===t.OutModeDirection.left||i===t.OutModeDirection.right))??(e.options.move.distance.vertical&&(i===t.OutModeDirection.top||i===t.OutModeDirection.bottom)))return;const a=e.options.move.gravity,o=this.#C,r=o.canvas.size,l=e.getRadius();if(a.enable){const s=e.position;(!a.inverse&&s.y>r.height+l&&i===t.OutModeDirection.bottom||a.inverse&&s.y<-l&&i===t.OutModeDirection.top)&&e.destroy()}else{if(e.velocity.y>0&&e.position.y<=r.height+l||e.velocity.y<0&&e.position.y>=-l||e.velocity.x>0&&e.position.x<=r.width+l||e.velocity.x<0&&e.position.x>=-l)return;wt(e.position,o.canvas.size,g,l,i)||e.destroy()}}}const Yi=_.origin;class Qi{modes;#C;constructor(e){this.#C=e,this.modes=[t.OutMode.out]}update(e,i,s,n){if(!this.modes.includes(n))return;const a=this.#C;if(e.outType===t.ParticleOutType.inside)this.#L(e,a);else{if(e.isInsideCanvasForOutMode(n,i))return;e.outType===t.ParticleOutType.outside?this.#_(e):this.#T(e,a,i)}}#L(t,e){const{x:i,y:s}=t.velocity;Yi.setTo(g),Yi.length=t.moveCenter.radius,Yi.angle=t.velocity.angle+Math.PI,Yi.addTo(t.moveCenter);const n=t.position.x-Yi.x,a=t.position.y-Yi.y;if(i<=0&&n>=0||s<=0&&a>=0||i>=0&&n<=0||s>=0&&a<=0)return;t.position.x=Math.floor(Q({min:0,max:e.canvas.size.width})),t.position.y=Math.floor(Q({min:0,max:e.canvas.size.height}));const o=t.position.x-t.moveCenter.x,r=t.position.y-t.moveCenter.y;t.direction=Math.atan2(-r,-o),t.velocity.angle=t.direction,t.justWarped=!0}#T(e,i,s){const n=e.options.move.warp,a=i.canvas.size,o=e.getRadius(),r={bottom:a.height+o+e.offset.y,left:-o-e.offset.x,right:a.width+o+e.offset.x,top:-o-e.offset.y},l=xt(e.position,o);s===t.OutModeDirection.right&&l.left>a.width+e.offset.x?(e.position.x=r.left,e.initialPosition.x=e.position.x,n||(e.position.y=G()*a.height,e.initialPosition.y=e.position.y),e.justWarped=!0):s===t.OutModeDirection.left&&l.right<-e.offset.x&&(e.position.x=r.right,e.initialPosition.x=e.position.x,n||(e.position.y=G()*a.height,e.initialPosition.y=e.position.y),e.justWarped=!0),s===t.OutModeDirection.bottom&&l.top>a.height+e.offset.y?(n||(e.position.x=G()*a.width,e.initialPosition.x=e.position.x),e.position.y=r.top,e.initialPosition.y=e.position.y,e.justWarped=!0):s===t.OutModeDirection.top&&l.bottom<-e.offset.y&&(n||(e.position.x=G()*a.width,e.initialPosition.x=e.position.x),e.position.y=r.bottom,e.initialPosition.y=e.position.y,e.justWarped=!0)}#_(t){t.position.x=Math.floor(Q({min:-t.moveCenter.radius,max:t.moveCenter.radius}))+t.moveCenter.x,t.position.y=Math.floor(Q({min:-t.moveCenter.radius,max:t.moveCenter.radius}))+t.moveCenter.y;const e=t.position.x-t.moveCenter.x,i=t.position.y-t.moveCenter.y;t.moveCenter.radius&&(t.direction=Math.atan2(i,e),t.velocity.angle=t.direction),t.justWarped=!0}}class Zi{updaters;#C;constructor(t){this.#C=t,this.updaters=new Map}init(e){this.#R(e,t.OutMode.bounce,t=>new Wi(t)),this.#R(e,t.OutMode.out,t=>new Qi(t)),this.#R(e,t.OutMode.destroy,t=>new qi(t)),this.#R(e,t.OutMode.none,t=>new Xi(t))}isEnabled(t){return!t.destroyed&&!t.spawning}update(e,i){const s=e.options.move.outModes;e.justWarped=!1,this.#E(e,i,s.bottom??s.default,t.OutModeDirection.bottom),this.#E(e,i,s.left??s.default,t.OutModeDirection.left),this.#E(e,i,s.right??s.default,t.OutModeDirection.right),this.#E(e,i,s.top??s.default,t.OutModeDirection.top)}#R(t,e,i){const s=t.options.move.outModes;!this.updaters.has(e)&&((t,e)=>t.default===e||t.bottom===e||t.left===e||t.right===e||t.top===e)(s,e)&&this.updaters.set(e,i(this.#C))}#E(t,e,i,s){for(const n of this.updaters.values())n.update(t,s,e,i)}}async function Ki(t){t.checkVersion("4.6.0"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("outModes",t=>Promise.resolve(new Zi(t)))})}class Ji{#C;#S;constructor(t,e){this.#C=e,this.#S=t}init(t){const e=this.#C,i=t.options,s=St(i.paint,t.id,i.reduceDuplicates);this.#A(s,t,e),this.#F(s,t,e)}isEnabled(t){const{fillAnimation:e,fillColor:i,strokeAnimation:s,strokeColor:n}=t,a=!!e&&(void 0!==i?.h.value&&i.h.enable||void 0!==i?.s.value&&i.s.enable||void 0!==i?.l.value&&i.l.enable),o=!!s&&(void 0!==n?.h.value&&n.h.enable||void 0!==n?.s.value&&n.s.enable||void 0!==n?.l.value&&n.l.enable);return!t.destroyed&&!t.spawning&&(a||o)}update(t,e){this.isEnabled(t)&&(Pi(t.fillColor,e,this.#C.hdr),Pi(t.strokeColor,e,this.#C.hdr))}#A(t,e,i){const s=t?.fill,n=t?.color,a=n??void 0;if(!s)return e.fillEnabled=!1,e.fillAnimation=void 0,e.fillColor=void 0,void(e.fillOpacity=1);const o=me.create(void 0===a?void 0:me.create(void 0,a),s.color);e.fillEnabled=s.enable,e.fillOpacity=Z(s.opacity),e.fillAnimation=o.animation;const r=ni(this.#S,o);r&&(e.fillColor=mi(r,e.fillAnimation,i.retina.reduceFactor))}#F(t,e,i){const s=t?.stroke,n=t?.color,a=n??void 0;if(!s)return e.strokeAnimation=void 0,e.strokeColor=void 0,e.strokeOpacity=1,void(e.strokeWidth=0);const o=me.create(void 0===a?void 0:me.create(void 0,a),s.color);e.strokeWidth=Z(s.width)*i.retina.pixelRatio,e.strokeOpacity=Z(s.opacity??1),e.strokeAnimation=o.animation;const r=ni(this.#S,o)??e.getFillColor();r&&(e.strokeColor=mi(r,e.strokeAnimation,i.retina.reduceFactor))}}async function ts(t){t.checkVersion("4.6.0"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("paint",e=>Promise.resolve(new Ji(t.pluginManager,e)))})}var es;!function(t){t[t.r=1]="r",t[t.g=2]="g",t[t.b=3]="b",t[t.a=5]="a"}(es||(es={}));const is=/rgba?\(\s*(\d{1,3})\s*[\s,]\s*(\d{1,3})\s*[\s,]\s*(\d{1,3})\s*([\s,]\s*(0|1|0?\.\d+|(\d{1,3})%)\s*)?\)/i;class ss{accepts(t){return t.startsWith("rgb")}handleColor(t){const e=t.value.rgb??t.value;if("r"in e&&"g"in e&&"b"in e)return e}handleRangeColor(t){const e=t.value.rgb??t.value;if("r"in e&&"g"in e&&"b"in e)return{r:Z(e.r),g:Z(e.g),b:Z(e.b)}}parseString(t){if(!this.accepts(t))return;const e=is.exec(t);return e?{a:e.length>4?dt(e[es.a]):1,b:parseInt(e[es.b]??"0",10),g:parseInt(e[es.g]??"0",10),r:parseInt(e[es.r]??"0",10)}:void 0}}async function ns(t){t.checkVersion("4.6.0"),await t.pluginManager.register(t=>{t.pluginManager.addColorManager("rgb",new ss)})}class as extends ue{destroy=t.DestroyType.none;load(t){super.load(t),U(t)||ne(this,"destroy",t.destroy)}}class os extends ke{animation=new as;value=3;load(t){if(super.load(t),U(t))return;const e=t.animation;void 0!==e&&this.animation.load(e)}}class rs{#C;constructor(t){this.#C=t}init(t){const e=this.#C,i=t.options.size;if(!i)return;const s=i.animation;s.enable&&(t.size.velocity=t.retina.sizeAnimationSpeed/h*e.retina.reduceFactor,s.sync||(t.size.velocity*=G()))}isEnabled(t){return!t.destroyed&&!t.spawning&&t.size.enable&&((t.size.maxLoops??0)<=0||(t.size.maxLoops??0)>0&&(t.size.loops??0)<(t.size.maxLoops??0))}loadOptions(t,...e){le(t,"size",os,...e)}preInit(t){const e=this.#C.retina.pixelRatio,i=t.options.size;i&&(t.size=Vi(i,e),t.retina.sizeAnimationSpeed=Z(i.animation.speed)*e)}reset(t){t.size.time=0,t.size.loops=0}update(t,e){this.isEnabled(t)&&t.options.size&&Ui(t,t.size,0,t.options.size.animation.destroy,e)}}async function ls(t){t.checkVersion("4.6.0"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("size",t=>Promise.resolve(new rs(t)))})}async function cs(t){t.checkVersion("4.6.0"),await t.pluginManager.register(async t=>{await Promise.all([Ci(t),_i(t),Ai(t),ns(t),Bi(t),Oi(t),ts(t),Gi(t),Ki(t),ls(t)])})}const ds=globalThis;ds.loadBasic=cs,ds.tsParticles=wi;function hs(t,e,i){const s=e[i];void 0!==s&&(t[i]=(t[i]??1)*s)}class us{#B;#V;#U;#H;#N;#C;#$;#G;#j;#W;#q;#X;#S;#Y;#Q;#Z={};#K=[void 0,void 0];#J={};constructor(t,e,i){this.#S=t,this.#C=e,this.#H=i,this.#$=null,this.#B=null,this.#V=new Set,this.#Q=[],this.#Y=[],this.#U=[],this.#N=[],this.#j=[],this.#W=[],this.#q=[],this.#X={0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[]}}get settings(){return this.#G}canvasClear(){this.#C.actualOptions.clear&&this.draw(t=>{t.clearRect(g.x,g.y,this.#H.size.width,this.#H.size.height)})}clear(){const e=new Set;for(const t of this.#U)if(e.add(t),t.canvasClear?.())return t;for(const i of Object.values(t.DrawLayer))if("number"==typeof i)for(const t of this.#tt(i))if(!e.has(t)&&(e.add(t),t.canvasClear?.()))return t;this.canvasClear()}destroy(){this.stop(),this.#B=null,this.#V.clear(),this.#Q=[],this.#Y=[],this.#U=[],this.#N=[],this.#j=[],this.#W=[],this.#q=[];for(const e of Object.values(t.DrawLayer))"number"==typeof e&&(this.#X[e]=[])}draw(t){const e=this.#$;if(e)return t(e)}drawParticle(t,e){if(t.spawning||t.destroyed)return;const i=t.getRadius();if(i<=0)return;const s=t.getFillColor(),n=t.getStrokeColor();let[a,o]=this.#et(t);if(a??=s,o??=n,!a&&!o)return;const r=this.#C,l=t.options.zIndex,c=1-t.zIndexFactor,{fillOpacity:d,opacity:h,strokeOpacity:u}=t.getOpacity(),p=this.#J,g=this.#Z,f=a?pi(a,r.hdr,d*h,r.peakNits,r.hdrMode):void 0,m=o?pi(o,r.hdr,u*h,r.peakNits,r.hdrMode):f;p.a=p.b=p.c=p.d=void 0,g.fill=f,g.stroke=m,this.draw(s=>{for(const i of this.#q)i.drawParticleSetup?.(s,t,e);this.#it(s,t,i,h,g,p),this.#st({container:r,context:s,particle:t,delta:e,colorStyles:g,radius:i*c**l.sizeRate,opacity:h,transform:p}),this.#nt(t);for(const i of this.#W)i.drawParticleCleanup?.(s,t,e)})}drawParticlePlugins(t,e){this.draw(i=>{for(const s of this.#j)this.#at(i,s,t,e)})}drawParticles(e){const{particles:i,actualOptions:s}=this.#C;this.clear(),i.update(e),this.draw(n=>{const a=this.#H.size.width,o=this.#H.size.height;if(this.#B)try{n.drawImage(this.#B,g.x,g.y,a,o)}catch{this.#ot("background-element-draw-error","Error drawing background element onto canvas")}const r=s.background;if(r.draw)try{r.draw(n,e)}catch{this.#ot("background-draw-error","Error in background.draw callback")}for(const e of this.#tt(t.DrawLayer.BackgroundMask))e.canvasPaint?.();for(const i of this.#tt(t.DrawLayer.CanvasSetup))i.drawSettingsSetup?.(n,e);for(const i of this.#tt(t.DrawLayer.PluginContent))i.draw?.(n,e);i.drawParticles(e);for(const i of this.#tt(t.DrawLayer.CanvasCleanup))i.clearDraw?.(n,e),i.drawSettingsCleanup?.(n,e)})}init(){this.initUpdaters(),this.initPlugins(),this.#rt(),this.paint()}initPlugins(){this.#U=[],this.#N=[],this.#j=[],this.#q=[],this.#W=[];for(const e of Object.values(t.DrawLayer))"number"==typeof e&&(this.#X[e]=[]);this.#lt()}initUpdaters(){this.#Q=[],this.#Y=[];for(const t of this.#C.particleUpdaters)t.afterDraw&&this.#Y.push(t),(t.getColorStyles??t.getTransformValues??t.beforeDraw)&&this.#Q.push(t)}paint(){let e=!1;for(const i of this.#tt(t.DrawLayer.BackgroundMask))if(e=i.canvasPaint?.()??!1,e)break;e||this.paintBase()}paintBase(t){this.draw(e=>{e.fillStyle=t??"rgba(0,0,0,0)",e.fillRect(g.x,g.y,this.#H.size.width,this.#H.size.height)})}paintImage(t,e){this.draw(i=>{if(!t)return;const s=i.globalAlpha;i.globalAlpha=e,i.drawImage(t,g.x,g.y,this.#H.size.width,this.#H.size.height),i.globalAlpha=s})}setContext(t){this.#$=t,this.#$&&(this.#$.globalCompositeOperation=l)}setContextSettings(t){this.#G=t}stop(){this.draw(t=>{t.clearRect(g.x,g.y,this.#H.size.width,this.#H.size.height)})}updateBackgroundElement(){this.#rt()}#nt(t){for(const e of this.#Y)e.afterDraw?.(t)}#it(t,e,i,s,n,a){for(const o of this.#Q){if(o.getColorStyles){const{fill:a,stroke:r}=o.getColorStyles(e,t,i,s);a&&(n.fill=a),r&&(n.stroke=r)}if(o.getTransformValues){const t=o.getTransformValues(e);for(const e in t)hs(a,t,e)}o.beforeDraw?.(e)}}#ct(t,e){if(!t?.drawAfter)return;const{particle:i}=e;i.effect&&t.drawAfter(e)}#dt(t,e){if(!t?.drawBefore)return;const{particle:i}=e;i.effect&&t.drawBefore(e)}#st(t){const{container:e,context:i,particle:s,delta:n,colorStyles:a,radius:o,opacity:r,transform:l}=t,{effectDrawers:c,shapeDrawers:d}=e,h=s.getPosition(),u=s.getTransformData(l),p={x:h.x,y:h.y};i.setTransform(u.a,u.b,u.c,u.d,h.x,h.y),a.fill&&(i.fillStyle=a.fill);const g=!!s.fillEnabled,f=s.strokeWidth??0;i.lineWidth=f,a.stroke&&(i.strokeStyle=a.stroke);const m={context:i,particle:s,radius:o,drawRadius:1*o,opacity:r,delta:n,pixelRatio:e.retina.pixelRatio,fill:g,stroke:f>0,transformData:u,position:{...h},drawPosition:p,drawScale:1};for(const t of e.plugins)t.drawParticleTransform?.(m);const y=s.effect?c.get(s.effect):void 0,v=s.shape?d.get(s.shape):void 0;this.#dt(y,m),this.#ht(v,m),this.#ut(v,m),this.#pt(v,m),this.#ct(y,m),i.resetTransform()}#at(t,e,i,s){e.drawParticle&&e.drawParticle(t,i,s)}#ut(t,e){if(!t)return;const{context:i,fill:s,particle:n,stroke:a}=e;n.shape&&(i.beginPath(),t.draw(e),n.shapeClose&&i.closePath(),s&&i.fill(),a&&i.stroke())}#pt(t,e){if(!t?.afterDraw)return;const{particle:i}=e;i.shape&&t.afterDraw(e)}#ht(t,e){if(!t?.beforeDraw)return;const{particle:i}=e;i.shape&&t.beforeDraw(e)}#tt(t){return this.#X[t]}#et(t){let e,i;for(const s of this.#N)if(!e&&s.particleFillColor&&(e=ni(this.#S,s.particleFillColor(t))),!i&&s.particleStrokeColor&&(i=ni(this.#S,s.particleStrokeColor(t))),e&&i)break;return this.#K[0]=e,this.#K[1]=i,this.#K}#gt(e){const i=[[t.DrawLayer.BackgroundMask,!!e.canvasPaint],[t.DrawLayer.CanvasSetup,!!e.drawSettingsSetup],[t.DrawLayer.PluginContent,!!e.draw],[t.DrawLayer.CanvasCleanup,!!(e.clearDraw??e.drawSettingsCleanup)]];for(const[t,s]of i)s&&this.#X[t].push(e)}#lt(){for(const t of this.#C.plugins)(t.particleFillColor??t.particleStrokeColor)&&this.#N.push(t),t.drawParticle&&this.#j.push(t),t.drawParticleSetup&&this.#q.push(t),t.drawParticleCleanup&&this.#W.push(t),t.canvasClear&&this.#U.push(t),this.#gt(t)}#ft(t){return"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas||"undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement||"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement}#rt(){const t=this.#C.actualOptions.background;if(this.#B=null,t.element)if("string"==typeof t.element){if("undefined"!=typeof document){let e;try{e=document.querySelector(t.element)}catch{return void this.#ot("background-element-invalid-selector",`Background element selector "${t.element}" is invalid`)}e&&this.#ft(e)?this.#B=e:e?this.#ot("background-element-not-supported",`Background element "${t.element}" is not a supported drawable element (canvas, video, or img)`):this.#ot("background-element-not-found",`Background element selector "${t.element}" not found`)}}else this.#ft(t.element)&&(this.#B=t.element)}#ot(t,e){this.#V.has(t)||(this.#V.add(t),n().warning(e))}}const ps=new WeakMap;function gs(t,e,i=!1){if(!e)return;const s=t.style,n=new Set;for(let t=0;t<s.length;t++){const e=s.item(t);e&&n.add(e)}for(let t=0;t<e.length;t++){const i=e.item(t);i&&n.add(i)}for(const t of n){const n=e.getPropertyValue(t);n?s.setProperty(t,n,i?"important":""):s.removeProperty(t)}}class fs{domElement;render;renderCanvas;size;zoom=1;#C;#mt;#yt;#vt;#Pt;#S;#bt;#wt;#Mt;#xt;constructor(t,e){this.#S=t,this.#C=e,this.render=new us(t,e,this),this.#Mt={height:0,width:0};const i=e.retina.pixelRatio,s=this.#Mt;this.size={height:s.height*i,width:s.width*i},this.#mt=!1,this.#wt=[],this.#bt="none"}get#zt(){return this.#C.actualOptions.fullScreen.enable}destroy(){if(this.stop(),this.#mt){const t=this.domElement;t?.remove(),this.domElement=void 0,this.renderCanvas=void 0}else this.#Ct();this.render.destroy(),this.#wt=[]}getZoomCenter(){const t=this.#C.retina.pixelRatio,{width:e,height:i}=this.size;return this.#xt?this.#xt:{x:e*u/t,y:i*u/t}}init(){this.#St(t=>{t.disconnect()}),this.#vt=vt(t=>{for(const e of t)"attributes"===e.type&&"style"===e.attributeName&&this.#Ot()}),this.resize(),this.#kt(),this.#St(t=>{const e=this.domElement;e&&e instanceof Node&&t.observe(e,{attributes:!0})}),this.initPlugins(),this.#It(),this.initBackground(),this.#Dt(),this.render.init()}initBackground(){const e=this.#C,i=e.actualOptions.background,s=this.domElement;if(!s)return;const n=s.style,a=ii(this.#S,i.color);if(a){const s=e.actualOptions.hdr;n.backgroundColor=ui(a,e.hdr,i.opacity,s.peakNits,F(t.HdrMode,s.mode,t.HdrMode.standard))}else n.backgroundColor="";n.backgroundImage=i.image||"",n.backgroundPosition=i.position||"",n.backgroundRepeat=i.repeat||"",n.backgroundSize=i.size||""}initPlugins(){this.#wt=[];for(const t of this.#C.plugins)t.resize&&this.#wt.push(t)}loadCanvas(t){this.#mt&&this.domElement&&this.domElement.remove();const e=(t=>"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement)(t)?t:void 0;this.domElement=e,this.#mt=!!e&&"true"===e.dataset[o],this.renderCanvas=e?(t=>{const e=ps.get(t);if(e)return e;if("function"!=typeof t.transferControlToOffscreen)throw new TypeError(ut(ht.offscreenCanvasUnsupported));try{const e=t.transferControlToOffscreen();return ps.set(t,e),e}catch{throw new TypeError(ut(ht.offscreenCanvasTransferFailed))}})(e):t;const i=this.domElement;i&&(i.ariaHidden="true",this.#Pt=kt(i.style));const s=this.#Mt,n=this.renderCanvas;i?(s.height=i.offsetHeight,s.width=i.offsetWidth):(s.height=n.height,s.width=n.width);const a=this.#C.retina.pixelRatio,r=this.size;n.height=r.height=s.height*a,n.width=r.width=s.width*a}resize(){const t=this.domElement;if(!t)return!1;const e=this.#C,i=this.renderCanvas;if(void 0===i)return!1;const s=e.canvas.#Mt,n={width:t.offsetWidth,height:t.offsetHeight},a=e.retina.pixelRatio,o={width:n.width*a,height:n.height*a};if(n.height===s.height&&n.width===s.width&&o.height===i.height&&o.width===i.width)return!1;const r={...s};s.height=n.height,s.width=n.width;const l=this.size;return i.width=l.width=o.width,i.height=l.height=o.height,this.#C.started&&e.particles.setResizeFactor({width:s.width/r.width,height:s.height/r.height}),!0}setPointerEvents(t){this.domElement&&(this.#bt=t,this.#Ot())}setZoom(t,e){this.zoom=t,this.#xt=e}stop(){this.#St(t=>{t.disconnect()}),this.#vt=void 0,this.#Lt(),this.render.stop()}async windowResize(){if(!this.domElement||!this.resize())return;const t=this.#C,e=t.updateActualOptions();t.particles.setDensity(),this.#_t(),e&&await t.refresh()}#_t(){for(const t of this.#wt)t.resize?.()}#It(){const e=this.#C,i=e.actualOptions.hdr.enable&&yt("(color-gamut: p3)")?.matches&&yt("(dynamic-range: high)")?.matches;e.hdrMode=F(t.HdrMode,e.actualOptions.hdr.mode,t.HdrMode.standard),e.peakNits=e.actualOptions.hdr.peakNits;const s=this.renderCanvas;if(!s)return void(e.hdr=i??!1);let n;this.render.setContextSettings({alpha:!0,desynchronized:!0,willReadFrequently:!1,...i?{colorSpace:"display-p3",colorType:"float16"}:{colorSpace:"srgb"}});try{n=s.getContext("2d",this.render.settings)}catch{n=null}if(i&&!n){const t={alpha:!0,desynchronized:!0,willReadFrequently:!1,colorSpace:"srgb"};this.render.setContextSettings(t);try{n=s.getContext("2d",t)}catch{n=null}}if(this.render.setContext(n),n){const t=(t=>{if(!t)return;const e=t;return e.getContextAttributes?.().colorSpace??void 0})(n);void 0!==t&&(e.hdr="display-p3"===t)}}#Dt(){this.#Lt();const t=yt("(color-gamut: p3)"),e=yt("(dynamic-range: high)"),i=()=>{this.#It(),this.initBackground()},s=[];t&&(t.addEventListener("change",i),s.push({handler:i,mql:t})),e&&(e.addEventListener("change",i),s.push({handler:i,mql:e})),this.#yt=s}#kt(){const t=this.domElement,e=this.#C.actualOptions;if(t){this.#zt?this.#Tt():this.#Ct();for(const i in e.style){if(!i||!(i in e.style))continue;const s=e.style[i];s&&t.style.setProperty(i,s,"important")}}}#Lt(){if(this.#yt){for(const{handler:t,mql:e}of this.#yt)e.removeEventListener("change",t);this.#yt=void 0}}#Ot(){const t=this.domElement;if(!t)return;this.#St(t=>{t.disconnect()}),this.#kt(),this.initBackground();const e=this.#bt;t.style.pointerEvents=e,t.style.setProperty("pointer-events",e),this.#St(e=>{t instanceof Node&&e.observe(t,{attributes:!0})})}#Ct(){const t=this.domElement,e=this.#Pt;t&&e&&gs(t,e,!0)}#St(t){this.#vt&&t(this.#vt)}#Tt(){const t=this.domElement;t&&gs(t,Lt(this.#C.actualOptions.fullScreen.zIndex),!0)}}class ms{#C;#Rt;#Et;#At;constructor(t){this.#C=t,this.#Rt={visibilityChange:()=>{this.#Ft()},resize:()=>{this.#Bt()}}}addListeners(){this.#Vt(!0)}removeListeners(){void 0!==this.#At&&(clearTimeout(this.#At),this.#At=void 0),this.#Vt(!1)}#Ft(){const t=this.#C;t.actualOptions.pauseOnBlur&&(mt().hidden?(t.pageHidden=!0,t.pause()):(t.pageHidden=!1,t.animationStatus?t.play(!0):t.draw(!0)))}#Bt(){this.#At&&(clearTimeout(this.#At),this.#At=void 0);const t=async()=>{await this.#C.canvas.windowResize()};this.#At=setTimeout(()=>{t()},this.#C.actualOptions.resize.delay*p)}#Vt(t){const e=this.#Rt;this.#Ut(t),"undefined"!=typeof document&&_t(document,d,e.visibilityChange,t,!1)}#Ut(t){const e=this.#Rt,i=this.#C;if(!i.actualOptions.resize.enable)return;if("undefined"==typeof ResizeObserver)return void _t(globalThis,c,e.resize,t);const s=i.canvas.domElement;this.#Et&&!t?(s&&this.#Et.unobserve(s),this.#Et.disconnect(),this.#Et=void 0):!this.#Et&&t&&s&&(this.#Et=new ResizeObserver(t=>{t.some(t=>t.target===s)&&this.#Bt()}),this.#Et.observe(s))}}function ys(t){if(!Pt(t.outMode,t.checkModes))return;const e=2*t.radius;t.coord>t.maxCoord-e?t.setCb(-t.radius):t.coord<e&&t.setCb(t.radius)}function vs(t,e){const i=t%e;return i<0?i+e:i}function Ps(t,e,i,s){const n=$e(i,e,e.actualOptions.particles),a=n.reduceDuplicates;t.effect=St(n.effect.type,t.id,a),t.shape=St(n.shape.type,t.id,a);const o=n.effect,r=n.shape;if(s){if(s.effect){const e=s.effect.type;if(e&&e!==t.effect){const i=St(e,t.id,a);i&&(t.effect=i)}o.load(s.effect)}if(s.shape){const e=s.shape.type;if(e&&e!==t.shape){const i=St(e,t.id,a);i&&(t.shape=i)}r.load(s.shape)}}if(t.effect===m){const i=[...e.effectDrawers.keys()];t.effect=i[Math.floor(G()*i.length)]}if(t.shape===m){const i=[...e.shapeDrawers.keys()];t.shape=i[Math.floor(G()*i.length)]}t.effectData=t.effect?function(t,e,i,s){const n=e.options[t];return zt({close:e.close},St(n,i,s))}(t.effect,o,t.id,a):void 0,t.shapeData=t.shape?function(t,e,i,s){const n=e.options[t];return zt({close:e.close},St(n,i,s))}(t.shape,r,t.id,a):void 0,n.load(s);const l=t.effectData,c=t.shapeData;return l&&n.load(l.particles),c&&n.load(c.particles),t.effectClose=l?.close??n.effect.close,t.shapeClose=c?.close??n.shape.close,n}class bs{backColor;destroyed;direction;effect;effectClose;effectData;fillColor;fillEnabled;fillOpacity;group;id;ignoresResizeRatio;initialPosition;initialVelocity;isRotating;justWarped;lastPathTime;misplaced;moveCenter;offset;opacity;options;outType;pathRotation;position;randomIndexData;retina;roll;rotation;shape;shapeClose;shapeData;sides;size;spawning;strokeColor;strokeOpacity;strokeWidth;unbreakable;velocity;zIndexFactor;#Ht={fillOpacity:1,opacity:1,strokeOpacity:1};#Nt=L.origin;#$t={sin:0,cos:0};#Gt={a:1,b:0,c:0,d:1};#C;#jt=[];#S;constructor(t,e){this.#S=t,this.#C=e}addModifier(t){this.#jt.push(t),this.#jt.sort((t,e)=>t.priority-e.priority)}clearModifiers(){this.#jt.length=0}destroy(e){if(this.unbreakable||this.destroyed)return;this.destroyed=!0,this.clearModifiers();const i=this.#C,s=this.shape?i.shapeDrawers.get(this.shape):void 0;s?.particleDestroy?.(this);for(const t of i.particleDestroyedPlugins)t.particleDestroyed?.(this,e);for(const t of i.particleUpdaters)t.particleDestroyed?.(this,e);this.#C.dispatchEvent(t.EventType.particleDestroyed,{particle:this})}draw(t){const e=this.#C.canvas.render;e.drawParticlePlugins(this,t),e.drawParticle(this,t)}getAngle(){return this.rotation+(this.pathRotation?this.velocity.angle:0)}getFillColor(){return this.#Wt(this.#qt(fi(this.fillColor),t=>t.fillColor))}getMass(){return this.getRadius()**2*Math.PI*u}getModifier(t){return this.#jt.find(e=>e.id===t)}getOpacity(){const t=this.options.zIndex,e=(1-this.zIndexFactor)**t.opacityRate,i=Z(this.opacity?.value??1),s=this.#qt(void 0,t=>t.opacity)??i;return this.#Ht.fillOpacity=this.fillOpacity??1,this.#Ht.opacity=s*e,this.#Ht.strokeOpacity=this.strokeOpacity??1,this.#Ht}getPosition(){return this.#Nt.x=this.position.x+this.offset.x,this.#Nt.y=this.position.y+this.offset.y,this.#Nt.z=this.position.z,this.#Nt}getRadius(){return this.#qt(this.size.value,t=>t.radius)}getRotateData(){const t=this.getAngle();return this.#$t.sin=Math.sin(t),this.#$t.cos=Math.cos(t),this.#$t}getStrokeColor(){return this.#Wt(this.#qt(fi(this.strokeColor),t=>t.strokeColor))}getTransformData(t){const e=this.getRotateData(),i=this.isRotating;return this.#Gt.a=e.cos*(t.a??f.a),this.#Gt.b=i?e.sin*(t.b??1):t.b??f.b,this.#Gt.c=i?-e.sin*(t.c??1):t.c??f.c,this.#Gt.d=e.cos*(t.d??f.d),this.#Gt}init(e,i,s,n){const a=this.#C;!function(e,i,s){e.id=i,e.group=s,e.justWarped=!1,e.effectClose=!0,e.shapeClose=!0,e.pathRotation=!1,e.lastPathTime=0,e.destroyed=!1,e.unbreakable=!1,e.isRotating=!1,e.rotation=0,e.misplaced=!1,e.retina={maxDistance:{},maxSpeed:0,moveDrift:0,moveSpeed:0,sizeAnimationSpeed:0},e.size={value:1,max:1,min:1,enable:!1},e.outType=t.ParticleOutType.normal,e.ignoresResizeRatio=!0}(this,e,n),this.options=Ps(this,a,this.#S,s),a.retina.initParticle(this),function(t,e){for(const i of t)i.preInit?.(e)}(a.particleUpdaters,this),this.#Xt(i),this.initialVelocity=this.#Yt(),this.velocity=this.initialVelocity.copy(),this.zIndexFactor=this.position.z/a.zLayers,this.sides=24,function(t,e){let i,s;t.effect&&(i=e.effectDrawers.get(t.effect)),i?.loadEffect&&i.loadEffect(t),t.shape&&(s=e.shapeDrawers.get(t.shape)),s?.loadShape&&s.loadShape(t);const n=s?.getSidesCount;n&&(t.sides=n(t))}(this,a),this.spawning=!1,function(t,e){for(const i of t)i.init(e)}(a.particleUpdaters,this),function(t,e){const i=e.shape?t.shapeDrawers.get(e.shape):void 0,s=e.effect?t.effectDrawers.get(e.effect):void 0;s?.particleInit?.(t,e),i?.particleInit?.(t,e)}(a,this),function(t,e){for(const i of t.particleCreatedPlugins)i.particleCreated?.(e)}(a,this)}isInsideCanvas(t){return this.#Qt(t).inside}isInsideCanvasForOutMode(t,e){return this.#Qt(e,t).inside}isShowingBack(){if(!this.roll)return!1;const t=this.roll.angle;if(this.roll.horizontal&&this.roll.vertical){const e=vs(t,v);return e>=Math.PI*u&&e<3*Math.PI*u}if(this.roll.horizontal){const e=vs(t+Math.PI*u,v);return e>=Math.PI&&e<2*Math.PI}if(this.roll.vertical){const e=vs(t,v);return e>=Math.PI&&e<2*Math.PI}return!1}isVisible(){return!this.destroyed&&!this.spawning&&this.isInsideCanvas()}removeModifier(t){const e=this.#jt.findIndex(e=>e.id===t);e>=0&&this.#jt.splice(e,1)}reset(){for(const t of this.#C.particleUpdaters)t.reset?.(this)}#qt(t,e){let i=t;for(const t of this.#jt)if(t.enabled){const s=e(t);void 0!==s&&(i=s)}return i}#Zt(t,e){let i=0,s=t?L.create(t.x,t.y,e):void 0;const n=this.#C,a=n.particlePositionPlugins,o=this.options.move.outModes,r=this.getRadius(),l=n.canvas.size;for(;;){for(const t of a){const i=t.particlePosition?.(s,this);if(i)return L.create(i.x,i.y,e)}const t=ct({size:l,position:s}),c=L.create(t.x,t.y,e);this.#Kt(c,r,o.left??o.default),this.#Kt(c,r,o.right??o.default),this.#Jt(c,r,o.top??o.default),this.#Jt(c,r,o.bottom??o.default);let d=!0;for(const t of n.particles.checkParticlePositionPlugins)if(d=t.checkParticlePosition?.(this,c,i)??!0,!d)break;if(d)return c;i+=1,s=void 0}}#Yt(){const e=this.options.move,i=ot(this.direction).copy();if(e.direction===t.MoveDirection.inside||e.direction===t.MoveDirection.outside)return i;const s=nt(Z(e.angle.value)),n=nt(Z(e.angle.offset)),a={left:n-s*u,right:n+s*u};return e.straight||(i.angle+=Q(tt(a.left,a.right))),e.random&&"number"==typeof e.speed&&(i.length*=G()),i}#Kt(e,i,s){ys({outMode:s,checkModes:[t.OutMode.bounce],coord:e.x,maxCoord:this.#C.canvas.size.width,setCb:t=>e.x+=t,radius:i})}#Jt(e,i,s){ys({outMode:s,checkModes:[t.OutMode.bounce],coord:e.y,maxCoord:this.#C.canvas.size.height,setCb:t=>e.y+=t,radius:i})}#te(e,i){const s=this.getRadius(),n=this.#C.canvas.size,a=i===t.OutMode.bounce||i===t.OutMode.split,o=a?this.getPosition():this.position;return e===t.OutModeDirection.bottom?{inside:a?o.y+s<n.height:o.y-s<n.height,reason:"default"}:e===t.OutModeDirection.left?{inside:a?o.x-s>0:o.x+s>0,reason:"default"}:e===t.OutModeDirection.right?{inside:a?o.x+s<n.width:o.x-s<n.width,reason:"default"}:e===t.OutModeDirection.top?{inside:a?o.y-s>0:o.y+s>0,reason:"default"}:{inside:o.x>=-s&&o.y>=-s&&o.y<=n.height+s&&o.x<=n.width+s,reason:"default"}}#ee(t,e){return{canvasSize:this.#C.canvas.size,direction:t,outMode:e,particle:this,radius:this.getRadius()}}#Qt(e,i){const s=this.#te(e,i),n=this.#C,a=this.shape?n.shapeDrawers.get(this.shape):void 0,o=this.effect?n.effectDrawers.get(this.effect):void 0;if(!a?.isInsideCanvas&&!o?.isInsideCanvas)return s;const r=this.#ee(e,i),l=a?.isInsideCanvas?this.#ie(a.isInsideCanvas(r),"shape"):void 0,c=o?.isInsideCanvas?this.#ie(o.isInsideCanvas(r),"effect"):void 0;if(l&&c){const e=Math.max(l.margin??0,c.margin??0);return{inside:i===t.OutMode.destroy||i===t.OutMode.out?l.inside||c.inside:l.inside&&c.inside,margin:e>0?e:void 0,reason:"combined"}}return l??c??s}#Wt(t){return t&&this.roll&&(this.backColor||this.roll.alter)&&this.isShowingBack()?this.backColor?this.backColor:this.roll.alter?bi(t,this.roll.alter.type,this.roll.alter.value):t:t}#Xt(e){const i=this.#C,s=Math.floor(Z(this.options.zIndex.value)),n=this.#Zt(e,X(s,0,i.zLayers));if(!n)throw new Error(ut(ht.particlePositionNotFound));this.position=n,this.initialPosition=this.position.copy();const a=i.canvas.size;switch(this.moveCenter={...Ot(this.options.move.center,a),radius:this.options.move.center.radius,mode:this.options.move.center.mode},this.direction=at(this.options.move.direction,this.position,this.moveCenter),this.options.move.direction){case t.MoveDirection.inside:this.outType=t.ParticleOutType.inside;break;case t.MoveDirection.outside:this.outType=t.ParticleOutType.outside}this.offset=_.origin}#ie(t,e){return"boolean"==typeof t?{inside:t,reason:e}:{inside:t.inside,margin:t.margin,reason:t.reason??e}}}class ws{#se=new Map;#ne;#ae=[];#oe;#re;#le=[];#ce;constructor(t){this.#ne=t,this.#oe=0,this.#ce=0}get cellSize(){return this.#ne}set cellSize(t){this.#re=t}clear(){this.#se.clear();const t=this.#re;t&&(this.#ne=t),this.#re=void 0}insert(t){const{x:e,y:i}=t.getPosition(),s=this.#de(e,i);this.#se.has(s)||this.#se.set(s,[]),this.#se.get(s)?.push(t)}query(t,e,i=[]){const s=this.#he(t);if(!s||!this.#se.size)return i;const n=Math.floor(s.minX/this.#ne),a=Math.floor(s.maxX/this.#ne),o=Math.floor(s.minY/this.#ne),r=Math.floor(s.maxY/this.#ne);if(!Number.isSafeInteger(n)||!Number.isSafeInteger(a)||!Number.isSafeInteger(o)||!Number.isSafeInteger(r)||n>a||o>r)return i;if(!e&&(a-n+1)*(r-o+1)>Math.max(64,16*this.#se.size)){const e=[];for(const t of this.#se.keys()){const i=t.indexOf("_"),s=Number(t.slice(0,i)),l=Number(t.slice(i+1));s>=n&&s<=a&&l>=o&&l<=r&&e.push({x:s,y:l})}e.sort((t,e)=>t.x===e.x?t.y-e.y:t.x-e.x);for(const{x:s,y:n}of e)this.#ue(s,n,t,void 0,i);return i}for(let s=n;s<=a;s++)for(let n=o;n<=r;n++)this.#ue(s,n,t,e,i);return i}queryCircle(t,e,i,s=[]){const n=this.#pe(t.x,t.y,e);try{return this.query(n,i,s)}finally{this.#oe--}}queryRectangle(t,e,i,s=[]){const n=this.#ge(t.x,t.y,e.width,e.height);try{return this.query(n,i,s)}finally{this.#ce--}}#pe(t,e,i){const s=this.#oe++;let n=this.#ae[s];return n||(n=new ie(t,e,i),this.#ae[s]=n),n.reset(t,e,i)}#ge(t,e,i,s){const n=this.#ce++;let a=this.#le[n];return a||(a=new se(t,e,i,s),this.#le[n]=a),a.reset(t,e,i,s)}#de(t,e){return`${Math.floor(t/this.#ne)}_${Math.floor(e/this.#ne)}`}#he(t){if(t instanceof ie){const e=t.radius,{x:i,y:s}=t.position;return{minX:i-e,maxX:i+e,minY:s-e,maxY:s+e}}if(t instanceof se){const{x:e,y:i}=t.position,{width:s,height:n}=t.size;return{minX:e,maxX:e+s,minY:i,maxY:i+n}}return null}#ue(t,e,i,s,n){const a=this.#se.get(`${t}_${e}`);if(a)for(const t of a)s&&!s(t)||i.contains(t.getPosition())&&n.push(t)}}class Ms{checkParticlePositionPlugins;#fe;#C;#me;#ye;#ve;#Pe;#be;#we;#Me;#S;#xe;#ze;#Ce;#Se;#Oe;#ke;constructor(t,e){this.#S=t,this.#C=e,this.#Pe=0,this.#fe=[],this.#xe=[],this.#ve=0,this.#ye=new Map,this.#be=new Map,this.#ke=this.#Ie(this.#C.zLayers),this.#me=new ws(100),this.checkParticlePositionPlugins=[],this.#we=[],this.#Me=[],this.#Ce=[],this.#ze=[],this.#Oe=[]}get count(){return this.#fe.length}get grid(){return this.#me}addParticle(e,i,s,a){if(!this.#De(s,this.count))try{const n=this.#xe.pop()??new bs(this.#S,this.#C);n.init(this.#Pe,e,i,s);let o=!0;return a&&(o=a(n)),o?(this.#fe.push(n),this.#Le(n),this.#Pe++,this.#C.dispatchEvent(t.EventType.particleAdded,{particle:n}),n):void this.#xe.push(n)}catch(t){n().warning(`error adding particle: ${t}`)}}clear(){this.#fe=[],this.#be.clear(),this.#_e(this.#C.zLayers)}destroy(){this.#fe=[],this.#xe.length=0,this.#be.clear(),this.#ke=[],this.checkParticlePositionPlugins=[],this.#we=[],this.#Me=[],this.#Ce=[],this.#ze=[],this.#Oe=[]}drawParticles(t){for(let e=this.#ke.length-1;e>=0;e--){const i=this.#ke[e];if(i)for(const e of i)e.draw(t)}}filter(t){return this.#fe.filter(t)}find(t){return this.#fe.find(t)}get(t){return this.#fe[t]}async init(){const t=this.#C;this.checkParticlePositionPlugins=[],this.#Oe=[],this.#Me=[],this.#Ce=[],this.#we=[],this.#ze=[],this.#be.clear(),this.#_e(t.zLayers),this.#me=new ws(100*t.retina.pixelRatio),this.#Te(t.actualOptions.particles);const e=t.actualOptions.particles.groups;for(const t in e){const i=e[t];i&&this.#Te($e(this.#S,this.#C,i),t,i)}await this.#Re()}push(t,e,i,s){for(let n=0;n<t;n++)this.addParticle(e,i,s)}async redraw(){this.clear(),await this.init(),this.#C.canvas.render.drawParticles({value:0,factor:0})}remove(t,e,i){this.removeAt(this.#fe.indexOf(t),void 0,e,i)}removeAt(t,e=1,i,s,n=!0){if(t<0||t>this.count)return;let a=0;for(let o=t;a<e&&o<this.count;o++)this.#Ee(o,i,s,n)&&(o--,a++)}removeQuantity(t,e){this.removeAt(0,t,e)}setDensity(){const t=this.#C.actualOptions,e=t.particles.groups;let i=0;for(const t of this.#C.plugins)t.particlesDensityCount&&(i+=t.particlesDensityCount());for(const t in e){const s=e[t];if(!s)continue;const n=$e(this.#S,this.#C,s);this.#Ae(n,i,t)}this.#Ae(t.particles,i)}setResizeFactor(t){this.#Se=t}update(t){this.#me.clear();for(const e of this.#Oe)e.update?.(t);const e=this.#Fe(t);for(const e of this.#Ce)e.postUpdate?.(t);if(this.#Be(t,e),e.size)for(const t of e)this.remove(t,t.group);this.#Se=void 0}#Ve(...t){this.#xe.push(...t)}#Ae(e,i,s,n){const a=e.number;if(!a.density.enable)return void this.#Te(e,s,n);const o=this.#Ue(a.density),r=a.value,l=a.limit.value>0?a.limit.value:r,c=Math.round(Math.min(r,l)*o+i),d=this.#He(s);void 0===s?this.#ve=a.limit.value*o:this.#ye.set(s,{limit:a.limit.value*o,mode:F(t.LimitMode,a.limit.mode,t.LimitMode.delete)}),d<c?this.push(Math.abs(c-d),void 0,e,s):d>c&&this.removeQuantity(d-c,s)}#Te(e,i,s){if(void 0===i){this.#ve=e.number.limit.value;const t=this.#C.actualOptions.particles.groups;for(const e of this.#ye.keys())e in t||this.#ye.delete(e)}else{const n=s?.number?.limit?.value??e.number.limit.value;n>0?this.#ye.set(i,{limit:n,mode:F(t.LimitMode,s?.number?.limit?.mode??e.number.limit.mode,t.LimitMode.delete)}):this.#ye.delete(i)}}#De(e,i){const s=this.#ve,n=this.#C.actualOptions.particles.number.limit.mode;if(s>0&&n===t.LimitMode.wait&&i>=s)return!0;const a=void 0===e?void 0:this.#ye.get(e);if(a&&a.limit>0&&a.mode===t.LimitMode.wait){if(this.#He(e)>=a.limit)return!0}if(a&&a.limit>0&&a.mode===t.LimitMode.delete){const t=this.#He(e)+1-a.limit;t>0&&this.removeQuantity(t,e)}if(s>0&&n===t.LimitMode.delete){const t=this.count+1-s;t>0&&this.#Ne(t)}return!1}#He(t){let e=0;for(const i of this.#fe)i.group===t&&e++;return e}#Ie(t){const e=Math.max(Math.floor(t),1);return Array.from({length:e},()=>[])}#$e(t){const e=this.#ke.length-1;return e<=0?0:Math.min(Math.max(Math.floor(t),0),e)}#Ue(t){const e=this.#C;if(!t.enable)return 1;const i=e.canvas.size,s=e.retina.pixelRatio;if(!Number.isFinite(i.width)||!Number.isFinite(i.height)||i.width<=0||i.height<=0||!Number.isFinite(t.width)||!Number.isFinite(t.height)||t.width<=0||t.height<=0||!Number.isFinite(s)||s<=0)return 1;const n=i.width*i.height/(t.height*t.width*s**2);return Number.isFinite(n)&&n>=0?n:1}async#Ge(){const t=this.#C;await t.initDrawersAndUpdaters(),t.canvas.render.initUpdaters();for(const e of t.effectDrawers.values())await(e.init?.(t));for(const e of t.shapeDrawers.values())await(e.init?.(t))}async#Re(){await this.#je(),await this.#Ge();let t=!1;const e=this.#C;for(const i of e.plugins)if(t=i.particlesInitialization?.()??t,t)break;if(t)return;const i=e.actualOptions.particles,s=i.groups;for(const t in s){const e=s[t];if(e)for(let s=this.count,n=0;n<e.number.value&&s<i.number.value;s++,n++)this.addParticle(void 0,e,t)}for(let t=this.count;t<i.number.value;t++)this.addParticle()}async#je(){const t=this.#C;for(const e of t.plugins)e.redrawInit&&await e.redrawInit(),e.checkParticlePosition&&this.checkParticlePositionPlugins.push(e),e.update&&this.#Oe.push(e),e.particleUpdate&&this.#Me.push(e),e.postUpdate&&this.#Ce.push(e),e.particleReset&&this.#we.push(e),e.postParticleUpdate&&this.#ze.push(e)}#Le(t){const e=this.#$e(t.position.z),i=this.#ke[e];i&&(i.push(t),this.#be.set(t.id,e))}#Ne(t){this.removeAt(0,t,void 0,void 0,!1)}#Ee(e,i,s,n=!0){const a=this.#fe[e];return!!a&&((!n||a.group===i)&&(this.#fe.splice(e,1),this.#We(a),a.destroy(s),this.#C.dispatchEvent(t.EventType.particleRemoved,{particle:a}),this.#Ve(a),!0))}#We(t){const e=this.#be.get(t.id)??this.#$e(t.position.z),i=this.#ke[e];if(!i)return void this.#be.delete(t.id);const s=i.findIndex(e=>e.id===t.id);s>=0&&i.splice(s,1),this.#be.delete(t.id)}#_e(t){const e=Math.max(Math.floor(t),1);if(this.#ke.length===e)for(const t of this.#ke)t.length=0;else this.#ke=this.#Ie(e)}#qe(t){const e=this.#$e(t.position.z),i=this.#be.get(t.id);if(void 0===i)return void this.#Le(t);if(i===e)return;const s=this.#ke[i];if(s){const e=s.findIndex(e=>e.id===t.id);e>=0&&s.splice(e,1)}const n=this.#ke[e];if(n){if(n.push(t),n.length>=2){const e=n[n.length-2];e&&t.id<e.id&&n.sort((t,e)=>t.id-e.id)}this.#be.set(t.id,e)}else this.#be.set(t.id,e)}#Fe(t){const e=new Set,i=this.#Se;for(const s of this.#fe){i&&!s.ignoresResizeRatio&&(s.position.x*=i.width,s.position.y*=i.height,s.initialPosition.x*=i.width,s.initialPosition.y*=i.height),s.ignoresResizeRatio=!1;for(const t of this.#we)t.particleReset?.(s);for(const e of this.#Me){if(s.destroyed)break;e.particleUpdate?.(s,t)}s.destroyed?e.add(s):this.#me.insert(s)}return e}#Be(t,e){for(const i of this.#fe)if(i.destroyed)e.add(i);else{for(const e of this.#C.particleUpdaters)e.update(i,t);if(!i.spawning)for(const e of this.#ze)e.postParticleUpdate?.(i,t);this.#qe(i)}}}class xs{pixelRatio;reduceFactor;#C;constructor(t){this.#C=t,this.pixelRatio=1,this.reduceFactor=1}init(){const t=this.#C,e=t.actualOptions;this.pixelRatio=e.detectRetina?devicePixelRatio:1,this.reduceFactor=1;const i=this.pixelRatio,s=t.canvas,n=s.domElement;n&&(s.size.width=n.offsetWidth*i,s.size.height=n.offsetHeight*i)}initParticle(t){const e=t.options,i=this.pixelRatio,s=e.move,n=s.distance,a=t.retina;a.maxSpeed=Z(s.gravity.maxSpeed)*i,a.moveDrift=Z(s.drift)*i,a.moveSpeed=Z(s.speed)*i;const o=a.maxDistance;o.horizontal=void 0===n.horizontal?void 0:n.horizontal*i,o.vertical=void 0===n.vertical?void 0:n.vertical*i}}function zs(t){return!t.destroyed}function Cs(t,e,...i){const s=new Ge(t,e);return de(s,...i),s}const Ss=Object.freeze([]);var Os=Object.freeze({__proto__:null,Container:class{actualOptions;canvas;destroyed;effectDrawers;fpsLimit;hdr;hdrMode;id;pageHidden;particles;particleUpdaters;peakNits;retina;shapeDrawers;started;zLayers;#Xe;#Ye;#Qe;#Ze={value:0,factor:0};#Ke;#Je;#ti;#ei;#ii;#si;#ni;#ai;#oi;#ri;#li=Ss;#ci=Ss;#di=Ss;#hi;#S;#p=Ss;#ui;#pi;#gi;#fi=0;#mi;constructor(e){const{dispatchCallback:i,pluginManager:s,id:n,onDestroy:a,sourceOptions:o}=e;this.#S=s,this.#Ke=i,this.#oi=a,this.id=Symbol(n),this.fpsLimit=120,this.hdr=!1,this.hdrMode=t.HdrMode.standard,this.peakNits=400,this.#ui=!1,this.#Xe=0,this.#ti=0,this.#ai=0,this.#ii=!0,this.started=!1,this.destroyed=!1,this.#hi=!0,this.#ni=0,this.zLayers=100,this.pageHidden=!1,this.#pi=o,this.#si=o,this.effectDrawers=new Map,this.shapeDrawers=new Map,this.particleUpdaters=[],this.retina=new xs(this),this.canvas=new fs(this.#S,this),this.particles=new Ms(this.#S,this),this.#ri=Cs(this.#S,this),this.actualOptions=Cs(this.#S,this),this.#ei=new ms(this),this.dispatchEvent(t.EventType.containerBuilt)}get animationStatus(){return!this.#hi&&!this.pageHidden&&zs(this)}get options(){return this.#ri}get particleCreatedPlugins(){return this.#li}get particleDestroyedPlugins(){return this.#ci}get particlePositionPlugins(){return this.#di}get plugins(){return this.#p}get sourceOptions(){return this.#pi}addLifeTime(t){this.#ai+=t}alive(){return!this.#ti||this.#ai<=this.#ti}destroy(e=!0){if(zs(this)){this.stop(),this.particles.destroy(),this.canvas.destroy();for(const[,t]of this.effectDrawers)t.destroy?.(this);for(const[,t]of this.shapeDrawers)t.destroy?.(this);for(const t of this.plugins)t.destroy?.();this.effectDrawers=new Map,this.shapeDrawers=new Map,this.particleUpdaters=[],this.#p=Ss,this.destroyed=!0,this.#oi(e),this.dispatchEvent(t.EventType.containerDestroyed)}}dispatchEvent(t,e){this.#Ke(t,{container:this,data:e})}draw(t){if(!zs(this))return;if(void 0!==this.#Je){if(!t)return;q(this.#Je),this.#Je=void 0}let e=t;this.#Je=W(t=>{this.#Je=void 0,e&&(this.#ni=void 0,e=!1),this.#yi(t)})}async export(t,e={}){for(const i of this.plugins){if(!i.export)continue;const s=await i.export(t,e);if(s.supported)return s.blob}n().error(`Export plugin with type ${t} not found`)}async init(){if(!zs(this))return;const e=this.#fi,i=new Map;for(const t of this.#S.plugins){const s=await t.getPlugin(this);if(e!==this.#fi||this.destroyed)return;if(s.preInit&&(await s.preInit(),e!==this.#fi))return;i.set(t,s)}if(await this.initDrawersAndUpdaters(),e!==this.#fi)return;this.#ri=Cs(this.#S,this,this.#si,this.sourceOptions),this.actualOptions=Cs(this.#S,this,this.#ri),this.#Re(i),this.retina.init(),this.canvas.init(),this.updateActualOptions(),this.canvas.initBackground(),this.canvas.resize();const{delay:s,duration:n,fpsLimit:a,smooth:o,zLayers:r}=this.actualOptions,l=this.actualOptions.hdr;this.hdrMode=F(t.HdrMode,l.mode,t.HdrMode.standard),this.peakNits=l.peakNits,this.zLayers=r,this.#ti=Z(n)*p,this.#Xe=Z(s)*p,this.#ai=0,this.fpsLimit=a>0?a:120,this.#ui=o;for(const t of this.plugins)if(await(t.init?.()),e!==this.#fi)return;if(await this.particles.init(),e===this.#fi){this.dispatchEvent(t.EventType.containerInit),this.particles.setDensity();for(const t of this.plugins)t.particlesSetup?.();this.dispatchEvent(t.EventType.particlesSetup)}}async initDrawersAndUpdaters(){const t=this.#S;this.effectDrawers=await Rt(this,t.initializers.effects),this.shapeDrawers=await Rt(this,t.initializers.shapes),this.particleUpdaters=await Tt(this,t.initializers.updaters)}pause(){if(zs(this)&&(void 0!==this.#Je&&(q(this.#Je),this.#Je=void 0),!this.#hi)){for(const t of this.plugins)t.pause?.();this.pageHidden||(this.#hi=!0),this.dispatchEvent(t.EventType.containerPaused)}}play(e){if(!zs(this))return;const i=this.#hi||e;if(!this.#ii||this.actualOptions.autoPlay){if(this.#hi&&(this.#hi=!1),i)for(const t of this.plugins)t.play&&t.play();this.dispatchEvent(t.EventType.containerPlay),this.draw(i??!1)}else this.#ii=!1}async refresh(){if(zs(this))return this.stop(),this.start()}async reset(t){if(zs(this))return this.#si=t,this.#pi=t,this.#ri=Cs(this.#S,this,this.#si,this.sourceOptions),this.actualOptions=Cs(this.#S,this,this.#ri),this.refresh()}async start(){if(!zs(this)||this.started)return;if(this.#mi)return this.#mi;const e=++this.#fi;let i;const s=new Promise(t=>{i=t});return this.#gi=i,this.#mi=(async()=>{try{if(await Promise.race([this.init(),s]),e!==this.#fi)return;if(this.started=!0,await Promise.race([new Promise(t=>{this.#Ye=t,this.#Qe=setTimeout(()=>{this.#Qe=void 0,this.#Ye=void 0,t()},this.#Xe)}),s]),e!==this.#fi||this.destroyed)return;this.#ei.addListeners();const i=async()=>{for(const t of this.plugins){if(e!==this.#fi)return;await(t.start?.())}};if(await Promise.race([i(),s]),e!==this.#fi)return;this.dispatchEvent(t.EventType.containerStarted),this.play()}catch(t){throw e!==this.#fi||this.destroyed||this.stop(),t}finally{e===this.#fi&&(this.#mi=void 0,this.#gi=void 0)}})(),this.#mi}stop(){if(zs(this)&&(this.#fi++,this.#gi?.(),this.#gi=void 0,this.#mi=void 0,this.started)){void 0!==this.#Qe&&(clearTimeout(this.#Qe),this.#Qe=void 0,this.#Ye?.(),this.#Ye=void 0),this.#ii=!0,this.started=!1,this.#ei.removeListeners(),this.pause(),this.particles.clear(),this.canvas.stop();for(const t of this.plugins)t.stop?.();this.#li=Ss,this.#ci=Ss,this.#di=Ss,this.#pi=this.#ri,this.dispatchEvent(t.EventType.containerStopped)}}updateActualOptions(){let t=!1;for(const e of this.plugins)e.updateActualOptions&&(t=e.updateActualOptions()||t);return this.canvas.render.updateBackgroundElement(),t}#Re(t){const e=[],i=[],s=[],n=[];for(const[a,o]of t)a.needsPlugin(this.actualOptions)&&(e.push(o),o.particleCreated&&i.push(o),o.particleDestroyed&&s.push(o),o.particlePosition&&n.push(o));this.#p=Object.freeze(e),this.#li=Object.freeze(i),this.#ci=Object.freeze(s),this.#di=Object.freeze(n)}#yi(t){try{if(!this.#ui&&void 0!==this.#ni&&t<this.#ni+p/this.fpsLimit)return void this.draw(!1);if(this.#ni??=t,function(t,e,i=60,s=!1){t.value=e,t.factor=s?60/i:60*e/p}(this.#Ze,t-this.#ni,this.fpsLimit,this.#ui),this.addLifeTime(this.#Ze.value),this.#ni=t,this.#Ze.value>p)return void this.draw(!1);if(this.canvas.render.drawParticles(this.#Ze),!this.alive())return void this.destroy();this.animationStatus&&this.draw(!1)}catch(t){n().error("error in animation loop",t)}}}});var ks=Object.freeze({__proto__:null,BlendPluginInstance:class{layer=t.DrawLayer.CanvasSetup;#C;#vi;constructor(t){this.#C=t}drawParticleCleanup(t,e){e.options.blend?.enable&&(t.globalCompositeOperation=e.originalBlendMode??l,e.originalBlendMode=void 0)}drawParticleSetup(t,e){e.options.blend?.enable&&(e.originalBlendMode=t.globalCompositeOperation,t.globalCompositeOperation=e.options.blend.mode)}drawSettingsCleanup(t){this.#vi&&(t.globalCompositeOperation=this.#vi)}drawSettingsSetup(t){const e=t.globalCompositeOperation,i=this.#C.actualOptions.blend;this.#vi=e,t.globalCompositeOperation=i?.enable?i.mode:e}}});function Is(t,e,i,s,n,a,o){!function(t,e){const i=t.options,s=i.move.path;if(!s.enable)return;const n=t.pathDelay??0;if(t.lastPathTime<=n)return void(t.lastPathTime+=e.value);const a=t.pathGenerator?.generate(t,e);a&&t.velocity.addTo(a);s.clamp&&(t.velocity.x=X(t.velocity.x,-1,1),t.velocity.y=X(t.velocity.y,-1,1));t.lastPathTime-=n}(t,o);const r=t.gravity,l=r?.enable&&r.inverse?-1:1,c=t.velocity.x,d=t.velocity.y,h=o.factor||1,u=t.moveDecay??1,p=u<0?u:u**h,g=n&&i?n/(60*i):0,f=r?.enable&&i?l*r.acceleration/(60*i):0,m=t=>u<=0||1===u?t*h:t*(1-p)/-Math.log(u);u>0&&t.velocity.multTo(p),t.velocity.x+=m(g),t.velocity.y+=m(f),u<=0&&t.velocity.multTo(p);const y=t.velocity.mult(i);let v=!1;r?.enable&&s>0&&(!r.inverse&&y.y>=0&&y.y>=s||r.inverse&&y.y<=0&&y.y<=-s)&&(y.y=l*s,v=!0,i&&(t.velocity.y=y.y/i));const P=u>0&&u<1;if(P){const e=-Math.log(u),s=(1-p)/e,n=(h-s)/e;y.x=(c*s+g*n)*i,y.y=v?t.velocity.y*i*h:(d*s+f*n)*i}const b=t.options.zIndex,w=(1-t.zIndexFactor)**b.velocityRate;y.multTo(w),y.multTo(a),P||y.multTo(h);const{position:M}=t;M.addTo(y),e.vibrate&&(M.x+=Math.sin(M.x*Math.cos(M.y))*a,M.y+=Math.cos(M.y*Math.sin(M.x))*a)}var Ds=Object.freeze({__proto__:null,MovePluginInstance:class{availablePathGenerators;pathGenerators;#C;#S;constructor(t,e){this.#S=t,this.#C=e,this.availablePathGenerators=new Map,this.pathGenerators=new Map}destroy(){this.availablePathGenerators=new Map,this.pathGenerators=new Map}isEnabled(t){return!t.destroyed&&t.options.move.enable}particleCreated(e){const i=e.options.move,s=i.gravity,n=i.path;if(e.moveDecay=1-Z(i.decay),e.pathDelay=Z(n.delay.value)*p,n.generator){let t=this.pathGenerators.get(n.generator);t||(t=this.availablePathGenerators.get(n.generator),t&&(this.pathGenerators.set(n.generator,t),t.init())),e.pathGenerator=t}e.gravity={enable:s.enable,acceleration:Z(s.acceleration),inverse:s.inverse},function(e,i){const s=i.options.move.spin;if(!s.enable)return;const n=s.position??{x:50,y:50},a={x:.01*n.x*e.canvas.size.width,y:.01*n.y*e.canvas.size.height},o=it(i.getPosition(),a),r=Z(s.acceleration);i.retina.spinAcceleration=r*e.retina.pixelRatio,i.spin={center:a,direction:i.velocity.x>=0?t.RotateDirection.clockwise:t.RotateDirection.counterClockwise,angle:G()*v,radius:o,acceleration:i.retina.spinAcceleration}}(this.#C,e)}particleDestroyed(t){const e=t.pathGenerator;e?.reset(t)}particleUpdate(e,i){const s=e.options.move;if(!s.enable)return;const n=this.#C,a=function(t){const e=t.getModifier("slow");return e?.enabled?e.speedFactor??1:1}(e),o=n.retina.reduceFactor,r=e.retina.moveSpeed,l=e.retina.moveDrift,c=e.size.max,d=r*(s.size?e.getRadius()/c:1)*a*u,h=e.retina.maxSpeed;s.spin.enable?function(e,i,s,n){if(!i.spin)return;const a=i.spin.direction===t.RotateDirection.clockwise,o={x:a?Math.cos:Math.sin,y:a?Math.sin:Math.cos};i.position.x=i.spin.center.x+i.spin.radius*o.x(i.spin.angle)*n,i.position.y=i.spin.center.y+i.spin.radius*o.y(i.spin.angle)*n,i.spin.radius+=i.spin.acceleration*n;const r=Math.max(e.canvas.size.width,e.canvas.size.height),l=r*u;i.spin.radius>l?(i.spin.radius=l,i.spin.acceleration*=-1):i.spin.radius<0&&(i.spin.radius=0,i.spin.acceleration*=-1),i.spin.angle+=.01*s*(1-i.spin.radius/r)}(n,e,d*(i.factor||1),o):Is(e,s,d,h,l,o,i),function(t){const e=t.initialPosition,i=e.x-t.position.x,s=e.y-t.position.y,n=Math.abs(i),a=Math.abs(s),{maxDistance:o}=t.retina,r=o.horizontal,l=o.vertical;if(!r&&!l)return;if((r&&n>=r||l&&a>=l)&&!t.misplaced)t.misplaced=!!r&&n>r||!!l&&a>l,r&&(t.velocity.x=t.velocity.y*u-t.velocity.x),l&&(t.velocity.y=t.velocity.x*u-t.velocity.y);else if((!r||n<r)&&(!l||a<l)&&t.misplaced)t.misplaced=!1;else if(t.misplaced){const i=t.position,s=t.velocity;r&&(i.x<e.x&&s.x<0||i.x>e.x&&s.x>0)&&(s.x*=-G()),l&&(i.y<e.y&&s.y<0||i.y>e.y&&s.y>0)&&(s.y*=-G())}}(e)}preInit(){return this.#Pi()}redrawInit(){return this.#Pi()}update(){for(const t of this.pathGenerators.values())t.update()}async#Pi(){const t=this.#S;if(t.initializers.pathGenerators){this.availablePathGenerators=await Rt(this.#C,t.initializers.pathGenerators),this.pathGenerators=new Map;for(const t of this.pathGenerators.values())t.init()}}}});t.AnimatableColor=me,t.AnimationOptions=he,t.AnimationValueWithRandom=Oe,t.Background=ye,t.BaseRange=ee,t.Circle=ie,t.ColorAnimation=pe,t.ErrorCodes=ht,t.Fill=Me,t.FullScreen=ve,t.HDROptions=Pe,t.HslAnimation=ge,t.Move=_e,t.MoveAngle=xe,t.MoveCenter=ze,t.MoveGravity=Ce,t.MovePath=Ie,t.OptionLoader=ce,t.Options=Ge,t.OptionsColor=fe,t.OutModes=De,t.Paint=Re,t.ParticlesBounce=Ae,t.ParticlesBounceFactor=Ee,t.ParticlesDensity=Fe,t.ParticlesNumber=Ve,t.ParticlesNumberLimit=Be,t.ParticlesOptions=Ne,t.RangedAnimationOptions=ue,t.RangedAnimationValueWithRandom=ke,t.Rectangle=se,t.ResizeEvent=be,t.Shape=Ue,t.Spin=Le,t.Stroke=Te,t.ValueWithRandom=Se,t.Vector=_,t.Vector3d=L,t.ZIndex=He,t.addErrorMessages=function(t){},t.alterHsl=bi,t.animate=W,t.areBoundsInside=Mt,t.calcExactPositionOrRandomFromSize=ct,t.calcPositionFromSize=function(t){return void 0!==t.position?.x&&void 0!==t.position.y?{x:t.position.x*t.size.width/h,y:t.position.y*t.size.height/h}:void 0},t.calcPositionOrRandomFromSize=lt,t.calcPositionOrRandomFromSizeRanged=function(t){const e={x:void 0!==t.position?.x?Z(t.position.x):void 0,y:void 0!==t.position?.y?Z(t.position.y):void 0};return lt({size:t.size,position:e})},t.calculateBounds=xt,t.cancelAnimation=q,t.canvasFirstIndex=0,t.canvasTag=w,t.checkDistance=st,t.circleBounce=function(t,e){const{x:i,y:s}=t.velocity.sub(e.velocity),[n,a]=[t.position,e.position],o=a.x-n.x,r=a.y-n.y;if(i*o+s*r<0)return;const l=-Math.atan2(r,o),c=t.mass,d=e.mass,h=t.velocity.rotate(l),u=e.velocity.rotate(l),p=rt(h,u,c,d),g=rt(u,h,c,d),f=p.rotate(-l),m=g.rotate(-l);t.velocity.x=f.x*t.factor.x,t.velocity.y=f.y*t.factor.y,e.velocity.x=m.x*e.factor.x,e.velocity.y=m.y*e.factor.y},t.circleBounceDataFromParticle=function(t){return{position:t.getPosition(),radius:t.getRadius(),mass:t.getMass(),velocity:t.velocity,factor:_.create(Z(t.options.bounce.horizontal.value),Z(t.options.bounce.vertical.value))}},t.clamp=X,t.cloneStyle=kt,t.collisionVelocity=rt,t.colorMix=gi,t.colorToRgb=si,t.countOffset=1,t.decayOffset=1,t.deepExtend=zt,t.defaultAlpha=1,t.defaultAngle=0,t.defaultCompositeValue=l,t.defaultDensityFactor=1,t.defaultFps=60,t.defaultFpsLimit=120,t.defaultLoops=0,t.defaultOpacity=1,t.defaultRatio=1,t.defaultReduceFactor=1,t.defaultRemoveQuantity=1,t.defaultRetryCount=0,t.defaultRgbMin=0,t.defaultTime=0,t.defaultTransform=f,t.defaultTransformValue=1,t.defaultVelocity=0,t.defaultZoom=1,t.degToRad=nt,t.deleteCount=1,t.double=2,t.doublePI=v,t.empty=0,t.executeOnSingleOrMultiple=Ct,t.fullPercent=r,t.generatedAttribute=o,t.generatedFalse=b,t.generatedTrue=P,t.getCanvasFromContainer=At,t.getDataFromUrl=Et,t.getDistance=it,t.getDistanceSq=et,t.getDistances=function(t,e){const i=t.x-e.x,s=t.y-e.y;return{dx:i,dy:s,distance:Math.hypot(i,s)}},t.getDomContainer=Ft,t.getErrorMessage=ut,t.getFullScreenStyle=Lt,t.getHslAnimationFromHsl=mi,t.getHslFromAnimation=fi,t.getItemMapFromInitializer=Rt,t.getItemsFromInitializer=Tt,t.getLinkColor=function(t,e,i,s){if(i===m)return hi();if(i!==y)return i;{const i=t.getFillColor()??t.getStrokeColor(),n=e?.getFillColor()??e?.getStrokeColor();if(i&&n&&e)return gi(i,n,t.getRadius(),e.getRadius(),s);{const t=i??n;if(t)return li(t)}}},t.getLinkRandomColor=function(t,e,i,s){const n=R(e)?e:e.value;return n===m?s?ii(t,{value:n}):i?m:y:n===y?y:ii(t,{value:n})},t.getLogger=n,t.getParticleBaseVelocity=ot,t.getParticleDirectionAngle=at,t.getPosition=Ot,t.getRandom=G,t.getRandomFn=function(){return N},t.getRandomInRange=j,t.getRandomRgbColor=hi,t.getRangeMax=J,t.getRangeMin=K,t.getRangeValue=Z,t.getStyleFromHsl=pi,t.getStyleFromRgb=ui,t.hMax=x,t.hMin=0,t.hPhase=60,t.half=u,t.hslToRgb=li,t.hslToRgbFloat=ci,t.hslaToRgba=di,t.hypot=function(t,e){return Math.sqrt(t*t+e*e)},t.identity=1,t.inverseFactorNumerator=1,t.isArray=V,t.isBoolean=T,t.isEnumValue=A,t.isFunction=function(t){return"function"==typeof t},t.isInArray=Pt,t.isNull=U,t.isNumber=E,t.isObject=B,t.isPointInside=wt,t.isString=R,t.itemFromArray=bt,t.itemFromSingleOrMultiple=St,t.lFactor=1,t.lMax=C,t.lMin=0,t.lengthOffset=1,t.loadBasic=cs,t.loadExtendProperty=function(t,e,i){if(void 0!==i){const s=e;if("__proto__"===s||"constructor"===s||"prototype"===s)return;const n=t,a=Object.hasOwn(n,s)?n[s]:{};n[s]=zt(a,i)}},t.loadLazyProperty=re,t.loadMinIndex=0,t.loadNestedProperty=oe,t.loadOptionProperty=le,t.loadOptions=de,t.loadParticlesOptions=$e,t.loadProperty=ne,t.loadRandomFactor=k,t.loadRangeProperty=ae,t.manageListener=_t,t.maxNits=I,t.midColorValue=y,t.millisecondsToSeconds=p,t.minCount=0,t.minDistance=0,t.minFpsLimit=0,t.minIndex=0,t.minLimit=0,t.minRadius=0,t.minStrokeWidth=0,t.minVelocity=0,t.minZ=0,t.minimumSize=0,t.mix=Y,t.none=0,t.one=1,t.originPoint=g,t.parseAlpha=dt,t.percentDenominator=h,t.phaseNumerator=1,t.quarter=S,t.randomColorValue=m,t.randomInRangeValue=Q,t.rangeColorToHsl=ni,t.rangeColorToRgb=ii,t.removeDeleteCount=1,t.removeMinIndex=0,t.resizeEvent=c,t.rgbMax=M,t.rgbToHsl=ai,t.sMax=z,t.sMin=0,t.sNormalizedOffset=1,t.safeDocument=mt,t.safeMatchMedia=yt,t.safeMutationObserver=vt,t.setAnimationFunctions=function(t,e){$.nextFrame=t,$.cancel=e},t.setLogger=function(t){t.debug&&(s.debug=i(t.debug)),t.error&&(s.error=i(t.error)),t.info&&(s.info=i(t.info)),t.log&&(s.log=i(t.log)),t.trace&&(s.trace=i(t.trace)),t.verbose&&(s.verbose=i(t.verbose)),t.warning&&(s.warning=i(t.warning))},t.setRandom=function(t=Math.random){N=t},t.setRangeValue=tt,t.sextuple=6,t.spatialHashGridCellSize=100,t.squareExp=2,t.stringToAlpha=function(t,e){return ei(t,e)?.a},t.stringToRgb=oi,t.threeQuarter=O,t.toEnumValue=F,t.triple=3,t.tryCountIncrement=1,t.tsParticles=wi,t.updateColor=Pi,t.updateColorValue=vi,t.visibilityChangeEvent=d,t.zIndexFactorOffset=1}(t.__tsParticlesInternals.bundles.basic=t.__tsParticlesInternals.bundles.basic||{})}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:self),Object.assign(globalThis.window||globalThis,{loadBasic:(globalThis.__tsParticlesInternals.bundles.basic||{}).loadBasic,loadExtendProperty:(globalThis.__tsParticlesInternals.bundles.basic||{}).loadExtendProperty,loadLazyProperty:(globalThis.__tsParticlesInternals.bundles.basic||{}).loadLazyProperty,loadMinIndex:(globalThis.__tsParticlesInternals.bundles.basic||{}).loadMinIndex,loadNestedProperty:(globalThis.__tsParticlesInternals.bundles.basic||{}).loadNestedProperty,loadOptionProperty:(globalThis.__tsParticlesInternals.bundles.basic||{}).loadOptionProperty,loadOptions:(globalThis.__tsParticlesInternals.bundles.basic||{}).loadOptions,loadParticlesOptions:(globalThis.__tsParticlesInternals.bundles.basic||{}).loadParticlesOptions,loadProperty:(globalThis.__tsParticlesInternals.bundles.basic||{}).loadProperty,loadRandomFactor:(globalThis.__tsParticlesInternals.bundles.basic||{}).loadRandomFactor,loadRangeProperty:(globalThis.__tsParticlesInternals.bundles.basic||{}).loadRangeProperty,tsParticles:(globalThis.__tsParticlesInternals.bundles.basic||{}).tsParticles}),globalThis.__tsParticlesInternals=globalThis.__tsParticlesInternals||{},globalThis.__tsParticlesInternals.engine&&globalThis.__tsParticlesInternals.engine.tsParticles||(globalThis.__tsParticlesInternals.engine=globalThis.__tsParticlesInternals.bundles.basic||{});