UNPKG

@tsparticles/particles

Version:

Easily create highly customizable particle animations and use them as animated backgrounds for your website. Ready to use components available also for React, Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact, Riot.js, Inferno.

1 lines 124 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),t.tsparticlesInternalExports=t.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.bundles=t.__tsParticlesInternals.bundles||{},t.__tsParticlesInternals.bundles.particles=t.__tsParticlesInternals.bundles.particles||{}))}(this,function(t){"use strict";const e="generated",i="source-over",s="resize",n="visibilitychange",a=100,o=.5,r=1e3,l={x:0,y:0,z:0},c={a:1,b:0,c:0,d:1},h="random",d="mid",u=2*Math.PI,p="true",g="false",f="canvas",y=255,_=360,v=100,m=100,b=.25,w=.75;var P;function x(t){return"z"in t?t.z:l.z}t.MoveDirection=void 0,(P=t.MoveDirection||(t.MoveDirection={})).bottom="bottom",P.bottomLeft="bottom-left",P.bottomRight="bottom-right",P.left="left",P.none="none",P.right="right",P.top="top",P.topLeft="top-left",P.topRight="top-right",P.outside="outside",P.inside="inside";class M{x;y;z;constructor(t=l.x,e=l.y,i=l.z){this.x=t,this.y=e,this.z=i}static get origin(){return M.create(l.x,l.y,l.z)}get angle(){return Math.atan2(this.y,this.x)}set angle(t){this._updateFromAngle(t,this.length)}get length(){return Math.sqrt(this.getLengthSq())}set length(t){this._updateFromAngle(this.angle,t)}static clone(t){return M.create(t.x,t.y,x(t))}static create(t,e,i){return"number"==typeof t?new M(t,e??l.y,i??l.z):new M(t.x,t.y,x(t))}add(t){return M.create(this.x+t.x,this.y+t.y,this.z+x(t))}addTo(t){this.x+=t.x,this.y+=t.y,this.z+=x(t)}copy(){return M.clone(this)}div(t){return M.create(this.x/t,this.y/t,this.z/t)}divTo(t){this.x/=t,this.y/=t,this.z/=t}getLengthSq(){return this.x**2+this.y**2}mult(t){return M.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 M.create(this.x*Math.cos(t)-this.y*Math.sin(t),this.x*Math.sin(t)+this.y*Math.cos(t),l.z)}setTo(t){this.x=t.x,this.y=t.y,this.z=x(t)}sub(t){return M.create(this.x-t.x,this.y-t.y,this.z-x(t))}subFrom(t){this.x-=t.x,this.y-=t.y,this.z-=x(t)}_updateFromAngle(t,e){this.x=Math.cos(t)*e,this.y=Math.sin(t)*e}}class z extends M{constructor(t=l.x,e=l.y){super(t,e,l.z)}static get origin(){return z.create(l.x,l.y)}static clone(t){return z.create(t.x,t.y)}static create(t,e){return"number"==typeof t?new z(t,e??l.y):new z(t.x,t.y)}}function S(t){return"boolean"==typeof t}function O(t){return"string"==typeof t}function k(t){return"number"==typeof t}function I(t){return"object"==typeof t&&null!==t}function C(t){return Array.isArray(t)}function D(t){return null==t}const T=Math.PI/180;let R=Math.random;const A={nextFrame:t=>requestAnimationFrame(t),cancel:t=>{cancelAnimationFrame(t)}};function L(){return U(R(),0,1-Number.EPSILON)}function E(t,e){return L()*(e-t)+t}function F(t){return A.nextFrame(t)}function V(t){A.cancel(t)}function U(t,e,i){return Math.min(Math.max(t,e),i)}function q(t,e,i,s){return Math.floor((t*i+e*s)/(i+s))}function B(t){const e=W(t);let i=$(t);return e===i&&(i=0),E(i,e)}function H(t){return k(t)?t:B(t)}function $(t){return k(t)?t:t.min}function W(t){return k(t)?t:t.max}function G(t,e){if(t===e||void 0===e&&k(t))return t;const i=$(t),s=W(t);return void 0!==e?{min:Math.min(i,e),max:Math.max(s,e)}:G(i,s)}function j(t,e){const i=t.x-e.x,s=t.y-e.y;return{dx:i,dy:s,distance:Math.hypot(i,s)}}function N(t,e){const i=t.x-e.x,s=t.y-e.y;return i*i+s*s}function Z(t,e){return Math.sqrt(N(t,e))}function Q(t,e,i){return N(t,e)<=i*i}function X(t){return t*T}function Y(e,i,s){if(k(e))return X(e);switch(e){case t.MoveDirection.top:return-Math.PI*o;case t.MoveDirection.topRight:return-Math.PI*b;case t.MoveDirection.right:return 0;case t.MoveDirection.bottomRight:return Math.PI*b;case t.MoveDirection.bottom:return Math.PI*o;case t.MoveDirection.bottomLeft:return Math.PI*w;case t.MoveDirection.left:return Math.PI;case t.MoveDirection.topLeft:return-Math.PI*w;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 L()*u}}function J(t){const e=z.origin;return e.length=1,e.angle=t,e}function K(t,e,i,s){return z.create(t.x*(i-s)/(i+s)+2*e.x*s/(i+s),t.y)}function tt(t){return{x:(t.position?.x??L()*a)*t.size.width/a,y:(t.position?.y??L()*a)*t.size.height/a}}function et(t){const{position:e,size:i}=t;return{x:e?.x??L()*i.width,y:e?.y??L()*i.height}}function it(t){return t?t.endsWith("%")?parseFloat(t)/a:parseFloat(t):1}var st,nt,at,ot,rt,lt;t.AnimationMode=void 0,(st=t.AnimationMode||(t.AnimationMode={})).auto="auto",st.increase="increase",st.decrease="decrease",st.random="random",t.AnimationStatus=void 0,(nt=t.AnimationStatus||(t.AnimationStatus={})).increasing="increasing",nt.decreasing="decreasing",t.DestroyType=void 0,(at=t.DestroyType||(t.DestroyType={})).none="none",at.max="max",at.min="min",t.OutModeDirection=void 0,(ot=t.OutModeDirection||(t.OutModeDirection={})).bottom="bottom",ot.left="left",ot.right="right",ot.top="top",t.PixelMode=void 0,(rt=t.PixelMode||(t.PixelMode={})).precise="precise",rt.percent="percent",t.StartValueType=void 0,(lt=t.StartValueType||(t.StartValueType={})).max="max",lt.min="min",lt.random="random";function ct(t,e){const i=new Map,s=e?.maxSize,n=e?.ttlMs,a=e?.keyFn,o=(t,e=new WeakSet)=>{if(null===t)return"null";const i=typeof t;if("undefined"===i)return"undefined";if("number"===i||"boolean"===i||"string"===i)return JSON.stringify(t);if("function"===i)try{return t.toString()}catch{return'"[Function]"'}if("symbol"===i)try{return t.toString()}catch{return'"[Symbol]"'}if(Array.isArray(t))return`[${t.map(t=>o(t,e)).join(",")}]`;if(e.has(t))return'"[Circular]"';e.add(t);return`{${Object.keys(t).sort().map(i=>`${JSON.stringify(i)}:${o(t[i],e)}`).join(",")}}`},r=t=>a?a(t):(t=>o(t))(t);return(...e)=>{const a=r(e),o=Date.now(),l=i.get(a);if(void 0!==l){if(!(n&&o-l.ts>n))return i.delete(a),i.set(a,{value:l.value,ts:l.ts}),l.value;i.delete(a)}const c=t(...e);return i.set(a,{value:c,ts:o}),(()=>{if("number"==typeof s&&s>=0)for(;i.size>s;){const t=i.keys().next().value;if(void 0===t)break;i.delete(t)}})(),c}}function ht(){return"undefined"!=typeof matchMedia}function dt(){return globalThis.document}function ut(t){if(ht())return matchMedia(t)}function pt(t){if("undefined"!=typeof IntersectionObserver)return new IntersectionObserver(t)}function gt(t){if("undefined"!=typeof MutationObserver)return new MutationObserver(t)}function ft(t,e){return t===e||C(e)&&e.includes(t)}function yt(t){return Math.floor(L()*t.length)}function _t(t,e,i=!0){return t[void 0!==e&&i?e%t.length:yt(t)]}function vt(t,e,i,s,n){return mt(bt(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 bt(t,e){return{bottom:t.y+e,left:t.x-e,right:t.x+e,top:t.y-e}}function wt(t,...e){for(const i of e){if(D(i))continue;if(!I(i)){t=i;continue}Array.isArray(i)?Array.isArray(t)||(t=[]):I(t)&&!Array.isArray(t)||(t={});const e=Object.keys(i),s=new Set(["__proto__","constructor","prototype"]);if(!e.some(t=>{const e=i[t];return I(e)||Array.isArray(e)})){const n=i,a=t;for(const t of e)if(!s.has(t)&&t in n){const e=n[t];void 0!==e&&(a[t]=e)}continue}for(const n of e){if(s.has(n))continue;const e=t,a=i[n];e[n]=Array.isArray(a)?a.map(t=>wt(void 0,t)):wt(e[n],a)}}return t}function Pt(t){return{position:t.getPosition(),radius:t.getRadius(),mass:t.getMass(),velocity:t.velocity,factor:z.create(H(t.options.bounce.horizontal.value),H(t.options.bounce.vertical.value))}}function xt(t,e){const{x:i,y:s}=t.velocity.sub(e.velocity),[n,a]=[t.position,e.position],{dx:o,dy:r}=j(a,n);if(i*o+s*r<0)return;const l=-Math.atan2(r,o),c=t.mass,h=e.mass,d=t.velocity.rotate(l),u=e.velocity.rotate(l),p=K(d,u,c,h),g=K(u,d,c,h),f=p.rotate(-l),y=g.rotate(-l);t.velocity.x=f.x*t.factor.x,t.velocity.y=f.y*t.factor.y,e.velocity.x=y.x*e.factor.x,e.velocity.y=y.y*e.factor.y}function Mt(t,e){return C(t)?t.map((t,i)=>e(t,i)):e(t,0)}function zt(t,e,i){return C(t)?_t(t,e,i):t}function St(e,i){const s=e.value,n=e.animation,a={delayTime:H(n.delay)*r,enable:n.enable,value:H(e.value)*i,max:W(s)*i,min:$(s)*i,loops:0,maxLoops:H(n.count),time:0};if(n.enable){switch(a.decay=1-H(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=L()>=o?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=B(a),e&&(a.status=L()>=o?t.AnimationStatus.increasing:t.AnimationStatus.decreasing)}}return a.initialValue=a.value,a}function Ot(e,i){if(!(e.mode===t.PixelMode.percent)){const{mode:t,...i}=e;return i}return"x"in e?{x:e.x/a*i.width,y:e.y/a*i.height}:{width:e.width/a*i.width,height:e.height/a*i.height}}function kt(t,e){return Ot(t,e)}function It(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;if(i.time??=0,(i.delayTime??0)>0&&i.time<(i.delayTime??0)&&(i.time+=a.value),!((i.delayTime??0)>0&&i.time<(i.delayTime??0))){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&&(s?i.status=t.AnimationStatus.decreasing:i.value-=l,i.loops??=0,i.loops++);break;case t.AnimationStatus.decreasing:i.value<=r&&(s?i.status=t.AnimationStatus.increasing:i.value+=l,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=U(i.value,r,l))}}function Ct(t){const e=dt().createElement("div").style;for(const i in t){const s=t[i];if(!(i in t)||D(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}const Dt=ct(function(t){const e=dt().createElement("div").style,i={width:"100%",height:"100%",margin:"0",padding:"0",borderWidth:"0",position:"fixed",zIndex:t.toString(10),"z-index":t.toString(10),top:"0",left:"0"};for(const t in i){const s=i[t];void 0!==s&&e.setProperty(t,s)}return e});function Tt(t,e,i,s,n){if(s){let s={passive:!0};S(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 Rt(t,e,i,s=!1){let n=e.get(t);return n&&!s||(n=await Promise.all([...i.values()].map(e=>e(t))),e.set(t,n)),n}async function At(t,e,i,s=!1){let n=e.get(t);if(!n||s){const s=await Promise.all([...i.entries()].map(([e,i])=>i(t).then(t=>[e,t])));n=new Map(s),e.set(t,n)}return n}class Lt{_listeners;constructor(){this._listeners=new Map}addEventListener(t,e){this.removeEventListener(t,e);let i=this._listeners.get(t);i||(i=[],this._listeners.set(t,i)),i.push(e)}dispatchEvent(t,e){const i=this._listeners.get(t);i?.forEach(t=>{t(e)})}hasEventListener(t){return!!this._listeners.get(t)}removeAllEventListeners(t){t?this._listeners.delete(t):this._listeners=new Map}removeEventListener(t,e){const i=this._listeners.get(t);if(!i)return;const s=i.length,n=i.indexOf(e);n<0||(1===s?this._listeners.delete(t):i.splice(n,1))}}var Et;t.EventType=void 0,(Et=t.EventType||(t.EventType={})).configAdded="configAdded",Et.containerInit="containerInit",Et.particlesSetup="particlesSetup",Et.containerStarted="containerStarted",Et.containerStopped="containerStopped",Et.containerDestroyed="containerDestroyed",Et.containerPaused="containerPaused",Et.containerPlay="containerPlay",Et.containerBuilt="containerBuilt",Et.particleAdded="particleAdded",Et.particleDestroyed="particleDestroyed",Et.particleRemoved="particleRemoved";class Ft{colorManagers=new Map;easingFunctions=new Map;effectDrawers=new Map;initializers={effects:new Map,shapes:new Map,updaters:new Map};palettes=new Map;plugins=[];presets=new Map;shapeDrawers=new Map;updaters=new Map;_allLoadersSet=new Set;_configs=new Map;_engine;_executedSet=new Set;_initialized=!1;_isRunningLoaders=!1;_loadPromises=new Set;constructor(t){this._engine=t}get configs(){const t={};for(const[e,i]of this._configs)t[e]=i;return t}addColorManager(t,e){this.colorManagers.set(t,e)}addConfig(e){const i=e.key??e.name??"default";this._configs.set(i,e),this._engine.dispatchEvent(t.EventType.configAdded,{data:{name:i,config:e}})}addEasing(t,e){this.easingFunctions.get(t)||this.easingFunctions.set(t,e)}addEffect(t,e){this.initializers.effects.set(t,e)}addPalette(t,e){this.palettes.set(t,e)}addParticleUpdater(t,e){this.initializers.updaters.set(t,e)}addPlugin(t){this.getPlugin(t.id)||this.plugins.push(t)}addPreset(t,e,i=!1){!i&&this.getPreset(t)||this.presets.set(t,e)}addShape(t,e){for(const i of t)this.initializers.shapes.set(i,e)}clearPlugins(t){this.effectDrawers.delete(t),this.shapeDrawers.delete(t),this.updaters.delete(t)}getEasing(t){return this.easingFunctions.get(t)??(t=>t)}getEffectDrawers(t,e=!1){return At(t,this.effectDrawers,this.initializers.effects,e)}getPalette(t){return this.palettes.get(t)}getPlugin(t){return this.plugins.find(e=>e.id===t)}getPreset(t){return this.presets.get(t)}async getShapeDrawers(t,e=!1){return At(t,this.shapeDrawers,this.initializers.shapes,e)}async getUpdaters(t,e=!1){return Rt(t,this.updaters,this.initializers.updaters,e)}async init(){if(!this._initialized&&!this._isRunningLoaders){this._isRunningLoaders=!0,this._executedSet=new Set,this._allLoadersSet=new Set(this._loadPromises);try{for(const t of this._allLoadersSet)await this._runLoader(t,this._executedSet,this._allLoadersSet)}finally{this._loadPromises.clear(),this._isRunningLoaders=!1,this._initialized=!0}}}loadParticlesOptions(t,e,...i){const s=this.updaters.get(t);s&&s.forEach(t=>t.loadOptions?.(e,...i))}async register(...t){if(this._initialized)throw new Error("Register plugins can only be done before calling tsParticles.load()");for(const e of t)this._isRunningLoaders?await this._runLoader(e,this._executedSet,this._allLoadersSet):this._loadPromises.add(e)}async _runLoader(t,e,i){e.has(t)||(e.add(t),i.add(t),await t(this._engine))}}const Vt=t=>(...e)=>{t(...e)},Ut={debug:Vt(console.debug),error:(t,...e)=>{console.error(`tsParticles - Error - ${t}`,...e)},info:Vt(console.info),log:Vt(console.log),trace:Vt(console.trace),verbose:Vt(console.log),warning:Vt(console.warn)};function qt(){return Ut}const Bt="100%";class Ht{pluginManager=new Ft(this);_domArray=[];_eventDispatcher=new Lt;_initialized=!1;get items(){return this._domArray}get version(){return"4.0.0-beta.12"}addEventListener(t,e){this._eventDispatcher.addEventListener(t,e)}checkVersion(t){if(this.version!==t)throw new Error(`The tsParticles version is different from the loaded plugins version. Engine version: ${this.version}. Plugin version: ${t}`)}dispatchEvent(t,e){this._eventDispatcher.dispatchEvent(t,e)}async init(){this._initialized||(await this.pluginManager.init(),this._initialized=!0)}item(t){const{items:e}=this,i=e[t];if(!i?.destroyed)return i;e.splice(t,1)}async load(t){await this.init();const{Container:i}=await Promise.resolve().then(function(){return Ks}),s=t.id??t.element?.id??`tsparticles${Math.floor(1e4*L()).toString()}`,{index:n,url:a}=t,o=a?await async function(t){const e=zt(t.url,t.index);if(!e)return t.fallback;const i=await fetch(e);return i.ok?await i.json():(qt().error(`${i.status.toString()} while retrieving config file`),t.fallback)}({fallback:t.options,url:a,index:n}):t.options,r=zt(o,n),{items:l}=this,c=l.findIndex(t=>t.id.description===s),h=new i({dispatchCallback:(t,e)=>{this.dispatchEvent(t,e)},id:s,onDestroy:t=>{if(!t)return;const e=this.items,i=e.indexOf(h);i>=0&&e.splice(i,1)},pluginManager:this.pluginManager,sourceOptions:r});if(c>=0){const t=this.item(c),e=t?1:0;t&&!t.destroyed&&t.destroy(!1),l.splice(c,e,h)}else l.push(h);const d=((t,i)=>{const s=dt();let n=i??s.getElementById(t);return n||(n=s.createElement("canvas"),n.id=t,n.dataset[e]=p,s.body.append(n),n)})(s,t.element),u=(t=>{const i=dt();let s;if(t instanceof HTMLCanvasElement||t.tagName.toLowerCase()===f)s=t,s.dataset[e]??=g;else{const n=t.getElementsByTagName(f)[0];n?(s=n,s.dataset[e]=g):(s=i.createElement(f),s.dataset[e]=p,t.appendChild(s))}return s.style.width||=Bt,s.style.height||=Bt,s})(d);return h.canvas.loadCanvas(u),await h.start(),h}async refresh(t=!0){t&&await Promise.all(this.items.map(t=>t.refresh()))}removeEventListener(t,e){this._eventDispatcher.removeEventListener(t,e)}}var $t,Wt,Gt,jt,Nt,Zt,Qt,Xt;!function(t){t.circle="circle",t.rectangle="rectangle"}($t||($t={}));class Yt{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 Jt extends Yt{radius;constructor(t,e,i){super(t,e,$t.circle),this.radius=i}contains(t){return Q(t,this.position,this.radius)}intersects(t){const e=this.position,i=t.position,s=this.radius,n=Math.abs(i.x-e.x),a=Math.abs(i.y-e.y);if(t instanceof Jt||t.type===$t.circle){return s+t.radius>Math.hypot(n,a)}if(t instanceof Kt||t.type===$t.rectangle){const e=t,{width:i,height:o}=e.size;return Math.pow(n-i,2)+Math.pow(a-o,2)<=s**2||n<=s+i&&a<=s+o||n<=i||a<=o}return!1}reset(t,e,i){return this._resetPosition(t,e),this.radius=i,this}}class Kt extends Yt{size;constructor(t,e,i,s){super(t,e,$t.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 Jt)return t.intersects(this);if(!(t instanceof Kt))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}}t.RotateDirection=void 0,(Wt=t.RotateDirection||(t.RotateDirection={})).clockwise="clockwise",Wt.counterClockwise="counter-clockwise",Wt.random="random",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,(Nt=t.AlterType||(t.AlterType={})).darken="darken",Nt.enlighten="enlighten",t.GradientType=void 0,(Zt=t.GradientType||(t.GradientType={})).linear="linear",Zt.radial="radial",Zt.random="random",t.ParticleOutType=void 0,(Qt=t.ParticleOutType||(t.ParticleOutType={})).normal="normal",Qt.inside="inside",Qt.outside="outside",t.EasingType=void 0,(Xt=t.EasingType||(t.EasingType={})).easeInBack="ease-in-back",Xt.easeInBounce="ease-in-bounce",Xt.easeInCirc="ease-in-circ",Xt.easeInCubic="ease-in-cubic",Xt.easeInElastic="ease-in-elastic",Xt.easeInExpo="ease-in-expo",Xt.easeInGaussian="ease-in-gaussian",Xt.easeInLinear="ease-in-linear",Xt.easeInQuad="ease-in-quad",Xt.easeInQuart="ease-in-quart",Xt.easeInQuint="ease-in-quint",Xt.easeInSigmoid="ease-in-sigmoid",Xt.easeInSine="ease-in-sine",Xt.easeInSmoothstep="ease-in-smoothstep",Xt.easeOutBack="ease-out-back",Xt.easeOutBounce="ease-out-bounce",Xt.easeOutCirc="ease-out-circ",Xt.easeOutCubic="ease-out-cubic",Xt.easeOutElastic="ease-out-elastic",Xt.easeOutExpo="ease-out-expo",Xt.easeOutGaussian="ease-out-gaussian",Xt.easeOutLinear="ease-out-linear",Xt.easeOutQuad="ease-out-quad",Xt.easeOutQuart="ease-out-quart",Xt.easeOutQuint="ease-out-quint",Xt.easeOutSigmoid="ease-out-sigmoid",Xt.easeOutSine="ease-out-sine",Xt.easeOutSmoothstep="ease-out-smoothstep",Xt.easeInOutBack="ease-in-out-back",Xt.easeInOutBounce="ease-in-out-bounce",Xt.easeInOutCirc="ease-in-out-circ",Xt.easeInOutCubic="ease-in-out-cubic",Xt.easeInOutElastic="ease-in-out-elastic",Xt.easeInOutExpo="ease-in-out-expo",Xt.easeInOutGaussian="ease-in-out-gaussian",Xt.easeInOutLinear="ease-in-out-linear",Xt.easeInOutQuad="ease-in-out-quad",Xt.easeInOutQuart="ease-in-out-quart",Xt.easeInOutQuint="ease-in-out-quint",Xt.easeInOutSigmoid="ease-in-out-sigmoid",Xt.easeInOutSine="ease-in-out-sine",Xt.easeInOutSmoothstep="ease-in-out-smoothstep";class te{count;decay;delay;enable;speed;sync;constructor(){this.count=0,this.enable=!1,this.speed=1,this.decay=0,this.delay=0,this.sync=!1}load(t){D(t)||(void 0!==t.count&&(this.count=G(t.count)),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.speed&&(this.speed=G(t.speed)),void 0!==t.decay&&(this.decay=G(t.decay)),void 0!==t.delay&&(this.delay=G(t.delay)),void 0!==t.sync&&(this.sync=t.sync))}}class ee extends te{mode;startValue;constructor(){super(),this.mode=t.AnimationMode.auto,this.startValue=t.StartValueType.random}load(t){super.load(t),D(t)||(void 0!==t.mode&&(this.mode=t.mode),void 0!==t.startValue&&(this.startValue=t.startValue))}}class ie extends te{max;min;offset;constructor(t,e){super(),this.min=t,this.max=e,this.offset=0,this.sync=!0}load(t){super.load(t),D(t)||(void 0!==t.max&&(this.max=t.max),void 0!==t.min&&(this.min=t.min),void 0!==t.offset&&(this.offset=G(t.offset)))}}class se{h=new ie(0,_);l=new ie(0,m);s=new ie(0,v);load(t){D(t)||(this.h.load(t.h),this.s.load(t.s),this.l.load(t.l))}}class ne{value;constructor(){this.value=""}static create(t,e){const i=new ne;return i.load(t),void 0!==e&&(O(e)||C(e)?i.load({value:e}):i.load(e)),i}load(t){D(t)||D(t.value)||(this.value=t.value)}}class ae extends ne{animation;constructor(){super(),this.animation=new se}static create(t,e){const i=new ae;return i.load(t),void 0!==e&&(O(e)||C(e)?i.load({value:e}):i.load(e)),i}load(t){if(super.load(t),D(t))return;const e=t.animation;void 0!==e&&(void 0===e.enable?this.animation.load(t.animation):this.animation.h.load(e))}}class oe{color;image;opacity;position;repeat;size;constructor(){this.color=new ne,this.color.value="",this.image="",this.position="",this.repeat="",this.size="",this.opacity=1}load(t){D(t)||(void 0!==t.color&&(this.color=ne.create(this.color,t.color)),void 0!==t.image&&(this.image=t.image),void 0!==t.position&&(this.position=t.position),void 0!==t.repeat&&(this.repeat=t.repeat),void 0!==t.size&&(this.size=t.size),void 0!==t.opacity&&(this.opacity=t.opacity))}}class re{enable;zIndex;constructor(){this.enable=!0,this.zIndex=0}load(t){D(t)||(void 0!==t.enable&&(this.enable=t.enable),void 0!==t.zIndex&&(this.zIndex=t.zIndex))}}class le{delay;enable;constructor(){this.delay=.5,this.enable=!0}load(t){D(t)||(void 0!==t.delay&&(this.delay=t.delay),void 0!==t.enable&&(this.enable=t.enable))}}class ce{close;options;type;constructor(){this.close=!0,this.options={},this.type=[]}load(t){if(D(t))return;const e=t.options;if(void 0!==e)for(const t in e){const i=e[t];i&&(this.options[t]=wt(this.options[t]??{},i))}void 0!==t.close&&(this.close=t.close),void 0!==t.type&&(this.type=t.type)}}class he{color;enable;opacity;constructor(){this.enable=!0,this.opacity=1}load(t){D(t)||(void 0!==t.color&&(this.color=ae.create(this.color,t.color)),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.opacity&&(this.opacity=G(t.opacity)))}}class de{offset;value;constructor(){this.offset=0,this.value=90}load(t){D(t)||(void 0!==t.offset&&(this.offset=G(t.offset)),void 0!==t.value&&(this.value=G(t.value)))}}class ue{mode;radius;x;y;constructor(){this.x=50,this.y=50,this.mode=t.PixelMode.percent,this.radius=0}load(t){D(t)||(void 0!==t.x&&(this.x=t.x),void 0!==t.y&&(this.y=t.y),void 0!==t.mode&&(this.mode=t.mode),void 0!==t.radius&&(this.radius=t.radius))}}class pe{acceleration;enable;inverse;maxSpeed;constructor(){this.acceleration=9.81,this.enable=!1,this.inverse=!1,this.maxSpeed=50}load(t){D(t)||(void 0!==t.acceleration&&(this.acceleration=G(t.acceleration)),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.inverse&&(this.inverse=t.inverse),void 0!==t.maxSpeed&&(this.maxSpeed=G(t.maxSpeed)))}}class ge{value;constructor(){this.value=0}load(t){D(t)||D(t.value)||(this.value=G(t.value))}}class fe extends ge{animation=new te;load(t){if(super.load(t),D(t))return;const e=t.animation;void 0!==e&&this.animation.load(e)}}class ye extends fe{animation;constructor(){super(),this.animation=new ee}load(t){super.load(t)}}class _e{clamp;delay;enable;generator;options;constructor(){this.clamp=!0,this.delay=new ge,this.enable=!1,this.options={}}load(t){D(t)||(void 0!==t.clamp&&(this.clamp=t.clamp),this.delay.load(t.delay),void 0!==t.enable&&(this.enable=t.enable),this.generator=t.generator,t.options&&(this.options=wt(this.options,t.options)))}}class ve{bottom;default;left;right;top;constructor(){this.default=t.OutMode.out}load(t){D(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 me{acceleration;enable;position;constructor(){this.acceleration=0,this.enable=!1}load(t){D(t)||(void 0!==t.acceleration&&(this.acceleration=G(t.acceleration)),void 0!==t.enable&&(this.enable=t.enable),t.position&&(this.position=wt({},t.position)))}}class be{angle;center;decay;direction;distance;drift;enable;gravity;outModes;path;random;size;speed;spin;straight;vibrate;warp;constructor(){this.angle=new de,this.center=new ue,this.decay=0,this.distance={},this.direction=t.MoveDirection.none,this.drift=0,this.enable=!1,this.gravity=new pe,this.path=new _e,this.outModes=new ve,this.random=!1,this.size=!1,this.speed=2,this.spin=new me,this.straight=!1,this.vibrate=!1,this.warp=!1}load(t){if(D(t))return;this.angle.load(k(t.angle)?{value:t.angle}:t.angle),this.center.load(t.center),void 0!==t.decay&&(this.decay=G(t.decay)),void 0!==t.direction&&(this.direction=t.direction),void 0!==t.distance&&(this.distance=k(t.distance)?{horizontal:t.distance,vertical:t.distance}:{...t.distance}),void 0!==t.drift&&(this.drift=G(t.drift)),void 0!==t.enable&&(this.enable=t.enable),this.gravity.load(t.gravity);const e=t.outModes;void 0!==e&&(I(e)?this.outModes.load(e):this.outModes.load({default:e})),this.path.load(t.path),void 0!==t.random&&(this.random=t.random),void 0!==t.size&&(this.size=t.size),void 0!==t.speed&&(this.speed=G(t.speed)),this.spin.load(t.spin),void 0!==t.straight&&(this.straight=t.straight),void 0!==t.vibrate&&(this.vibrate=t.vibrate),void 0!==t.warp&&(this.warp=t.warp)}}class we extends ee{destroy;constructor(){super(),this.destroy=t.DestroyType.none,this.speed=2}load(t){super.load(t),D(t)||void 0!==t.destroy&&(this.destroy=t.destroy)}}class Pe extends ye{animation;constructor(){super(),this.animation=new we,this.value=1}load(t){if(D(t))return;super.load(t);const e=t.animation;void 0!==e&&this.animation.load(e)}}class xe{color;opacity;width;constructor(){this.width=0}load(t){D(t)||(void 0!==t.color&&(this.color=ae.create(this.color,t.color)),void 0!==t.width&&(this.width=G(t.width)),void 0!==t.opacity&&(this.opacity=G(t.opacity)))}}class Me{color;fill;stroke;load(t){D(t)||(void 0!==t.color&&(this.color=ae.create(this.color,t.color)),void 0!==t.fill&&(this.fill??=new he,this.fill.load(t.fill)),void 0!==t.stroke&&(this.stroke??=new xe,this.stroke.load(t.stroke)))}}class ze extends ge{constructor(){super(),this.value=1}}class Se{horizontal;vertical;constructor(){this.horizontal=new ze,this.vertical=new ze}load(t){D(t)||(this.horizontal.load(t.horizontal),this.vertical.load(t.vertical))}}class Oe{enable;height;width;constructor(){this.enable=!1,this.width=1920,this.height=1080}load(t){if(D(t))return;void 0!==t.enable&&(this.enable=t.enable);const e=t.width;void 0!==e&&(this.width=e);const i=t.height;void 0!==i&&(this.height=i)}}class ke{mode;value;constructor(){this.mode=t.LimitMode.delete,this.value=0}load(t){D(t)||(void 0!==t.mode&&(this.mode=t.mode),void 0!==t.value&&(this.value=t.value))}}class Ie{density;limit;value;constructor(){this.density=new Oe,this.limit=new ke,this.value=0}load(t){D(t)||(this.density.load(t.density),this.limit.load(t.limit),void 0!==t.value&&(this.value=t.value))}}class Ce{close;options;type;constructor(){this.close=!0,this.options={},this.type="circle"}load(t){if(D(t))return;const e=t.options;if(void 0!==e)for(const t in e){const i=e[t];i&&(this.options[t]=wt(this.options[t]??{},i))}void 0!==t.close&&(this.close=t.close),void 0!==t.type&&(this.type=t.type)}}class De extends ee{destroy;constructor(){super(),this.destroy=t.DestroyType.none,this.speed=5}load(t){super.load(t),D(t)||void 0!==t.destroy&&(this.destroy=t.destroy)}}class Te extends ye{animation;constructor(){super(),this.animation=new De,this.value=3}load(t){if(super.load(t),D(t))return;const e=t.animation;void 0!==e&&this.animation.load(e)}}class Re extends ge{opacityRate;sizeRate;velocityRate;constructor(){super(),this.opacityRate=1,this.sizeRate=1,this.velocityRate=1}load(t){super.load(t),D(t)||(void 0!==t.opacityRate&&(this.opacityRate=t.opacityRate),void 0!==t.sizeRate&&(this.sizeRate=t.sizeRate),void 0!==t.velocityRate&&(this.velocityRate=t.velocityRate))}}class Ae{bounce;effect;groups;move;number;opacity;paint;palette;reduceDuplicates;shape;size;zIndex;_container;_pluginManager;constructor(t,e){this._pluginManager=t,this._container=e,this.bounce=new Se,this.effect=new ce,this.groups={},this.move=new be,this.number=new Ie,this.opacity=new Pe,this.paint=new Me,this.paint.color=new ae,this.paint.color.value="#fff",this.paint.fill=new he,this.paint.fill.enable=!0,this.reduceDuplicates=!1,this.shape=new Ce,this.size=new Te,this.zIndex=new Re}load(t){if(D(t))return;if(t.palette&&(this.palette=t.palette,this._importPalette(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]=wt(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),this.opacity.load(t.opacity);const e=t.paint;if(e&&(C(e)?this.paint=Mt(e,t=>{const e=new Me;return e.load(t),e}):C(this.paint)?(this.paint=new Me,this.paint.load(e)):this.paint.load(e)),this.shape.load(t.shape),this.size.load(t.size),this.zIndex.load(t.zIndex),this._container){for(const e of this._pluginManager.plugins)e.loadParticlesOptions&&e.loadParticlesOptions(this._container,this,t);const e=this._pluginManager.updaters.get(this._container);if(e)for(const i of e)i.loadOptions&&i.loadOptions(this,t)}}_importPalette=t=>{const e=this._pluginManager.getPalette(t);if(!e)return;const i=e.colors,s=(C(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 Le(t,...e){for(const i of e)t.load(i)}function Ee(t,e,...i){const s=new Ae(t,e);return Le(s,...i),s}class Fe{autoPlay;background;clear;defaultThemes;delay;detectRetina;duration;fpsLimit;fullScreen;hdr;key;name;palette;particles;pauseOnBlur;pauseOnOutsideViewport;preset;resize;smooth;style;zLayers;_container;_pluginManager;constructor(t,e){this._pluginManager=t,this._container=e,this.autoPlay=!0,this.background=new oe,this.clear=!0,this.defaultThemes={},this.delay=0,this.fullScreen=new re,this.detectRetina=!0,this.duration=0,this.fpsLimit=120,this.hdr=!0,this.particles=Ee(this._pluginManager,this._container),this.pauseOnBlur=!0,this.pauseOnOutsideViewport=!0,this.resize=new le,this.smooth=!1,this.style={},this.zLayers=100}load(t){if(D(t))return;void 0!==t.preset&&(this.preset=t.preset,Mt(this.preset,t=>{this._importPreset(t)})),void 0!==t.palette&&(this.palette=t.palette,this._importPalette(this.palette)),void 0!==t.autoPlay&&(this.autoPlay=t.autoPlay),void 0!==t.clear&&(this.clear=t.clear),void 0!==t.key&&(this.key=t.key),void 0!==t.name&&(this.name=t.name),void 0!==t.delay&&(this.delay=G(t.delay));const e=t.detectRetina;void 0!==e&&(this.detectRetina=e),void 0!==t.duration&&(this.duration=G(t.duration));const i=t.fpsLimit;void 0!==i&&(this.fpsLimit=i),void 0!==t.hdr&&(this.hdr=t.hdr),void 0!==t.pauseOnBlur&&(this.pauseOnBlur=t.pauseOnBlur),void 0!==t.pauseOnOutsideViewport&&(this.pauseOnOutsideViewport=t.pauseOnOutsideViewport),void 0!==t.zLayers&&(this.zLayers=t.zLayers),this.background.load(t.background);const s=t.fullScreen;S(s)?this.fullScreen.enable=s:this.fullScreen.load(s),this.particles.load(t.particles),this.resize.load(t.resize),this.style=wt(this.style,t.style),void 0!==t.smooth&&(this.smooth=t.smooth),this._pluginManager.plugins.forEach(e=>{e.loadOptions(this._container,this,t)})}_importPalette=t=>{const e=this._pluginManager.getPalette(t);e&&this.load({background:{color:e.background},blend:{enable:!0,mode:e.blendMode},particles:{palette:t}})};_importPreset=t=>{this.load(this._pluginManager.getPreset(t))}}function Ve(t,e,i){t.fillStyle=i??"rgba(0,0,0,0)",t.fillRect(l.x,l.y,e.width,e.height)}function Ue(t,e,i,s){if(!i)return;const n=t.globalAlpha;t.globalAlpha=s,t.drawImage(i,l.x,l.y,e.width,e.height),t.globalAlpha=n}function qe(t,e){t.clearRect(l.x,l.y,e.width,e.height)}function Be(t){const{container:e,context:i,particle:s,delta:n,colorStyles:a,radius:o,opacity:r,transform:l}=t,{effectDrawers:c,shapeDrawers:h}=e,d=s.getPosition(),u=s.getTransformData(l),p={x:d.x,y:d.y};i.setTransform(u.a,u.b,u.c,u.d,d.x,d.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 y={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:{...d},drawPosition:p,drawScale:1};for(const t of e.plugins)t.drawParticleTransform?.(y);const _=s.effect?c.get(s.effect):void 0,v=s.shape?h.get(s.shape):void 0;$e(_,y),je(v,y),We(v,y),Ge(v,y),He(_,y),i.resetTransform()}function He(t,e){if(!t?.drawAfter)return;const{particle:i}=e;i.effect&&t.drawAfter(e)}function $e(t,e){if(!t?.drawBefore)return;const{particle:i}=e;i.effect&&t.drawBefore(e)}function We(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())}function Ge(t,e){if(!t?.afterDraw)return;const{particle:i}=e;i.shape&&t.afterDraw(e)}function je(t,e){if(!t?.beforeDraw)return;const{particle:i}=e;i.shape&&t.beforeDraw(e)}function Ne(t,e,i,s){e.drawParticle&&e.drawParticle(t,i,s)}const Ze=new Map;function Qe(t,e){let i=Ze.get(t);if(!i){if(i=e(),Ze.size>=1e3){[...Ze.keys()].slice(0,500).forEach(t=>Ze.delete(t))}Ze.set(t,i)}return i}function Xe(t,e){if(e)for(const i of t.colorManagers.values())if(i.accepts(e))return i.parseString(e)}function Ye(t,e,i,s=!0){if(!e)return;const n=O(e)?{value:e}:e;if(O(n.value))return Je(t,n.value,i,s);if(C(n.value)){const e=_t(n.value,i,s);if(!e)return;return Ye(t,{value:e})}for(const e of t.colorManagers.values()){const t=e.handleRangeColor(n);if(t)return t}}function Je(t,e,i,s=!0){if(!e)return;const n=O(e)?{value:e}:e;if(O(n.value))return n.value===h?ni():ei(t,n.value);if(C(n.value)){const e=_t(n.value,i,s);if(!e)return;return Je(t,{value:e})}for(const e of t.colorManagers.values()){const t=e.handleColor(n);if(t)return t}}function Ke(t,e,i,s=!0){const n=Ye(t,e,i,s);return n?ti(n):void 0}function ti(t){const e=t.r/y,i=t.g/y,s=t.b/y,n=Math.max(e,i,s),a=Math.min(e,i,s),r={h:0,l:(n+a)*o,s:0};return n!==a&&(r.s=r.l<o?(n-a)/(n+a):(n-a)/(2-n-a),r.h=e===n?(i-s)/(n-a):i===n?2+(s-e)/(n-a):4+(e-i)/(n-a)),r.l*=m,r.s*=v,r.h*=60,r.h<0&&(r.h+=_),r.h>=_&&(r.h-=_),r}function ei(t,e){return Xe(t,e)}function ii(t){const e=(t.h%_+_)%_,i=Math.max(0,Math.min(v,t.s)),s=Math.max(0,Math.min(m,t.l)),n=e/_,a=i/v,r=s/m;if(0===i){const t=Math.round(r*y);return{r:t,g:t,b:t}}const l=(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},c=r<o?r*(1+a):r+a-r*a,h=2*r-c,d=1/3,u=Math.min(y,y*l(h,c,n+d)),p=Math.min(y,y*l(h,c,n)),g=Math.min(y,y*l(h,c,n-d));return{r:Math.round(u),g:Math.round(p),b:Math.round(g)}}function si(t){const e=ii(t);return{a:t.a,b:e.b,g:e.g,r:e.r}}function ni(t){const e=t??0,i=()=>Math.floor(E(e,256));return{b:i(),g:i(),r:i()}}function ai(t,e,i){const s=i??1;return Qe(`rgb-${t.r.toFixed(2)}-${t.g.toFixed(2)}-${t.b.toFixed(2)}-${e?"hdr":"sdr"}-${s.toString()}`,()=>e?oi(t,i):function(t,e){return`rgba(${t.r.toString()}, ${t.g.toString()}, ${t.b.toString()}, ${(e??1).toString()})`}(t,i))}function oi(t,e){return`color(display-p3 ${(t.r/y).toString()} ${(t.g/y).toString()} ${(t.b/y).toString()} / ${(e??1).toString()})`}function ri(t,e,i){const s=i??1;return Qe(`hsl-${t.h.toFixed(2)}-${t.s.toFixed(2)}-${t.l.toFixed(2)}-${e?"hdr":"sdr"}-${s.toString()}`,()=>e?function(t,e){return oi(ii(t),e)}(t,i):function(t,e){return`hsla(${t.h.toString()}, ${t.s.toString()}%, ${t.l.toString()}%, ${(e??1).toString()})`}(t,i))}function li(t,e,i,s){let n=t,a=e;return"r"in n||(n=ii(t)),"r"in a||(a=ii(e)),{b:q(n.b,a.b,i,s),g:q(n.g,a.g,i,s),r:q(n.r,a.r,i,s)}}function ci(t,e,i){if(i===h)return ni();if(i!==d)return i;{const i=t.getFillColor()??t.getStrokeColor(),s=e?.getFillColor()??e?.getStrokeColor();if(i&&s&&e)return li(i,s,t.getRadius(),e.getRadius());{const t=i??s;if(t)return ii(t)}}}function hi(t,e,i,s){const n=O(e)?e:e.value;return n===h?s?Ye(t,{value:n}):i?h:d:n===d?d:Ye(t,{value:n})}function di(t){return void 0===t?void 0:{h:t.h.value,s:t.s.value,l:t.l.value}}function ui(t,e,i){const s={h:{enable:!1,value:t.h,min:0,max:_},s:{enable:!1,value:t.s,min:0,max:v},l:{enable:!1,value:t.l,min:0,max:m}};return e&&(pi(s.h,e.h,i),pi(s.s,e.s,i),pi(s.l,e.l,i)),s}function pi(e,i,s){e.enable=i.enable,e.min=i.min,e.max=i.max,e.enable?(e.velocity=H(i.speed)/a*s,e.decay=1-H(i.decay),e.status=t.AnimationStatus.increasing,e.loops=0,e.maxLoops=H(i.count),e.time=0,e.delayTime=H(i.delay)*r,i.sync||(e.velocity*=L(),e.value*=L()),e.initialValue=e.value,e.offset=G(i.offset)):e.velocity=0}function gi(e,i,s){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 n=e.offset?B(e.offset):0,a=(e.velocity??0)*s.factor+3.6*n,o=e.decay??1,r=e.max,l=e.min;i&&e.status!==t.AnimationStatus.increasing?(e.value-=a,e.value<l&&(e.loops??=0,e.loops++,e.status=t.AnimationStatus.increasing)):(e.value+=a,e.value>r&&(e.loops??=0,e.loops++,i?e.status=t.AnimationStatus.decreasing:e.value-=r)),e.velocity&&1!==o&&(e.velocity*=o),e.value=U(e.value,l,r)}function fi(t,e){if(!t)return;const{h:i,s:s,l:n}=t;gi(i,!1,e),gi(s,!0,e),gi(n,!0,e)}function yi(e,i,s){return{h:e.h,s:e.s,l:e.l+(i===t.AlterType.darken?-1:1)*s}}const _i=new Ht,vi=new Map;async function mi(t,e,i,s){const n=vi.get(e);if(n instanceof Promise)return n;if(n)return n;const a=(async()=>{const n={particles:{number:{value:(o=i).count??80},color:{value:o.color??"#fff"},links:{enable:o.links??!1,color:o.linksColor??"#fff",distance:o.linksLength??100},collisions:{enable:o.collisions??!1},move:{enable:!0,speed:o.speed??3},opacity:{value:o.opacity??1},shape:{type:o.shape??"circle"},size:{value:o.radius??3}}},a=await t.load({id:e,element:s,options:n});var o;if(!a)return void vi.delete(e);const{ParticlesInstance:r}=await Promise.resolve().then(function(){return tn}),l=new r(a);return vi.set(e,l),l})();return vi.set(e,a),a}class bi{draw(t){!function(t){const{context:e,particle:i,radius:s}=t;i.circleRange??={min:0,max:u};const n=i.circleRange;e.arc(l.x,l.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=I(s)?{min:X(s.min),max:X(s.max)}:{min:0,max:X(s)}}}async function wi(t){t.checkVersion("4.0.0-beta.12"),await t.pluginManager.register(t=>{t.pluginManager.addShape(["circle"],()=>Promise.resolve(new bi))})}var Pi;!function(t){t[t.r=1]="r",t[t.g=2]="g",t[t.b=3]="b",t[t.a=4]="a"}(Pi||(Pi={}));const xi=/^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i,Mi=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i;class zi{accepts(t){return t.startsWith("#")}handleColor(t){return this._parseString(t.value)}handleRangeColor(t){return this._parseString(t.value)}parseString(t){return this._parseString(t)}_parseString(t){if("string"!=typeof t||!this.accepts(t))return;const e=t.replace(xi,(t,e,i,s,n)=>e+e+i+i+s+s+(void 0===n?"":n+n)),i=Mi.exec(e);return i?{a:i[Pi.a]?Number.parseInt(i[Pi.a],16)/255:1,b:Number.parseInt(i[Pi.b]??"0",16),g:Number.parseInt(i[Pi.g]??"0",16),r:Number.parseInt(i[Pi.r]??"0",16)}:void 0}}async function Si(t){t.checkVersion("4.0.0-beta.12"),await t.pluginManager.register(t=>{t.pluginManager.addColorManager("hex",new zi)})}var Oi;!function(t){t[t.h=1]="h",t[t.s=2]="s",t[t.l=3]="l",t[t.a=5]="a"}(Oi||(Oi={}));const ki=/hsla?\(\s*(\d+)\s*[\s,]\s*(\d+)%\s*[\s,]\s*(\d+)%\s*([\s,]\s*(0|1|0?\.\d+|(\d{1,3})%)\s*)?\)/i;class Ii{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 ii(e)}handleRangeColor(t){const e=t.value.hsl??t.value;if("h"in e&&"s"in e&&"l"in e)return ii({h:H(e.h),l:H(e.l),s:H(e.s)})}parseString(t){if(!this.accepts(t))return;const e=ki.exec(t);return e?si({a:e.length>4?it(e[Oi.a]):1,h:Number.parseInt(e[Oi.h]??"0",10),l:Number.parseInt(e[Oi.l]??"0",10),s:Number.parseInt(e[Oi.s]??"0",10)}):void 0}}async function Ci(t){t.checkVersion("4.0.0-beta.12"),await t.pluginManager.register(t=>{t.pluginManager.addColorManager("hsl",new Ii)})}class Di{id="move";_pluginManager;constructor(t){this._pluginManager=t}async getPlugin(t){const{MovePluginInstance:e}=await Promise.resolve().then(function(){return sn});return new e(this._pluginManager,t)}loadOptions(){}needsPlugin(){return!0}}async function Ti(t){t.checkVersion("4.0.0-beta.12"),await t.pluginManager.register(t=>{const e=t.pluginManager;e.initializers.pathGenerators??=new Map,e.pathGenerators??=new Map,e.addPathGenerator=(t,i)=>{e.initializers.pathGenerators??=new Map,e.initializers.pathGenerators.set(t,i)},e.getPathGenerators=async(t,i=!1)=>(e.initializers.pathGenerators??=new Map,e.pathGenerators??=new Map,At(t,e.pathGenerators,e.initializers.pathGenerators,i)),t.pluginManager.addPlugin(new Di(t.pluginManager))})}class Ri{container;constructor(t){this.container=t}init(t){const e=t.options.opacity;t.opacity=St(e,1);const i=e.animation;i.enable&&(t.opacity.velocity=H(i.speed)/a*this.container.retina.reduceFactor,i.sync||(t.opacity.velocity*=L()))}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))}reset(t){t.opacity&&(t.opacity.time=0,t.opacity.loops=0)}update(t,e){this.isEnabled(t)&&t.opacity&&It(t,t.opacity,!0,t.options.opacity.animation.destroy,e)}}async function Ai(t){t.checkVersion("4.0.0-beta.12"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("opacity",t=>Promise.resolve(new Ri(t)))})}class Li{container;modes;_particleBouncePlugins;constructor(e){this.container=e,this.modes=[t.OutMode.bounce,t.OutMode.split],this._particleBouncePlugins=e.plugins.filter(t=>void 0!==t.particleBounce)}update(e,i,s,n){if(!this.modes.includes(n))return;const a=this.container;let o=!1;for(const t of this._particleBouncePlugins)if(o=t.particleBounce?.(e,s,i)??!1,o)break;if(o)return;const r=e.getPosition(),l=e.offset,c=e.getRadius(),h=bt(r,c),d=a.canvas.size;!function(e){if(e.outMode!==t.OutMode.bounce&&e.outMode!==t.OutMode.split||e.direction!==t.OutModeDirection.left&&e.direction!==t.OutModeDirection.right)return;e.bounds.right<0&&e.direction===t.OutModeDirection.left?e.particle.position.x=e.size+e.offset.x:e.bounds.left>e.canvasSize.width&&e.direction===t.OutModeDirection.right&&(e.particle.position.x=e.canvasSize.width-e.size-e.offset.x);const i=e.particle.velocity.x;let s=!1;if(e.direction===t.OutModeDirection.right&&e.bounds.right>=e.canvasSize.width&&i>0||e.direction===t.OutModeDirection.left&&e.bounds.left<=0&&i<0){const t=H(e.particle.options.bounce.horizontal.value);e.particle.velocity.x*=-t,s=!0}if(!s)return;const n=e.offset.x+e.size;e.bounds.right>=e.canvasSize.width&&e.direction===t.OutModeDirection.right?e.particle.position.x=e.canvasSize.width-n:e.bounds.left<=0&&e.direction===t.OutModeDirection.left&&(e.particle.position.x=n),e.outMode===t.OutMode.split&&e.particle.destroy()}({particle:e,outMode:n,direction:i,bounds:h,canvasSize:d,offset:l,size:c}),function(e){if(e.outMode!==t.OutMode.bounce&&e.outMode!==t.OutMode.split||e.direction!==t.OutModeDirection.bottom&&e.direction!==t.OutModeDirection.top)return;e.bounds.bottom<0&&e.direction===t.OutModeDirection.top?e.particle.position.y=e.size+e.offset.y:e.bounds.top>e.canvasSize.height&&e.direction===t.OutModeDirection.bottom&&(e.particle.position.y=e.canvasSize.height-e.size-e.offset.y);const i=e.particle.velocity.y;let s=!1;if(e.direction===t.OutModeDirection.bottom&&e.bounds.bottom>=e.canvasSize.height&&i>0||e.direction===t.OutModeDirection.top&&e.bounds.top<=0&&i<0){const t=H(e.particle.options.bounce.vertical.value);e.particle.velocity.y*=-t,s=!0}if(!s)return;const n=e.offset.y+e.size;e.bounds.bottom>=e.canvasSize.height&&e.direction===t.OutModeDirection.bottom?e.particle.position.y=e.canvasSize.height-n:e.bounds.top<=0&&e.direction===t.OutModeDirection.top&&(e.particle.position.y=n),e.outMode===t.OutMode.split&&e.particle.destroy()}({particle:e,outMode:n,direction:i,bounds:h,canvasSize:d,offset:l,size:c})}}class Ei{container;modes;constructor(e){this.container=e,this.modes=[t.OutMode.destroy]}update(e,i,s,n){if(!this.modes.includes(n))return;const a=this.container;switch(e.outType){case t.ParticleOutType.normal:case t.ParticleOutType.outside:if(vt(e.position,a.canvas.size,l,e.getRadius(),i))return;break;case t.ParticleOutType.inside:{const{dx:t,dy:i}=j(e.position,e.moveCenter),{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 Fi{container;modes;constructor(e){this.container=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.container,r=o.canvas.size,c=e.getRadius();if(a.enable){const s=e.position;(!a.inverse&&s.y>r.height+c&&i===t.OutModeDirection.bottom||a.inverse&&s.y<-c&&i===t.OutModeDirection.top)&&e.destroy()}else{if(e.velocity.y>0&&e.position.y<=r.height+c||e.velocity.y<0&&e.position.y>=-c||e.velocity.x>0&&e.position.x<=r.width+c||e.velocity.x<0&&e.position.x>=-c)return;vt(e.position,o.canvas.size,l,c,i)||e.destroy()}}}const Vi=z.origin;class Ui{container;modes;constructor(e){this.container=e,this.modes=[t.OutMode.out]}update(e,i,s,n){if(!this.modes.includes(n))return;const a=this.container;switch(e.outType){case t.ParticleOutType.inside:{const{x:t,y:i}=e.velocity;Vi.setTo(l),Vi.length=e.moveCenter.radius,Vi.angle=e.velocity.angle+Math.PI,Vi.addTo(e.moveCenter);const{dx:s,dy:n}=j(e.position,Vi);if(t<=0&&s>=0||i<=0&&n>=0||t>=0&&s<=0||i>=0&&n<=0)return;e