@tsparticles/ribbons 4.3.0 → 4.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- !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.ribbons=t.__tsParticlesInternals.bundles.ribbons||{}))}(this,function(t){"use strict";const e="generated",i="source-over",s="resize",n="visibilitychange",o=100,a=.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",f="false",g="canvas",y=255,m=360,v=100,b=100,w=.25,P=.75,M=400;var x;function z(t){return"z"in t?t.z:l.z}t.MoveDirection=void 0,(x=t.MoveDirection||(t.MoveDirection={})).bottom="bottom",x.bottomLeft="bottom-left",x.bottomRight="bottom-right",x.left="left",x.none="none",x.right="right",x.top="top",x.topLeft="top-left",x.topRight="top-right",x.outside="outside",x.inside="inside";class S{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 S.create(l.x,l.y,l.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 S.create(t.x,t.y,z(t))}static create(t,e,i){return"number"==typeof t?new S(t,e??l.y,i??l.z):new S(t.x,t.y,z(t))}add(t){return S.create(this.x+t.x,this.y+t.y,this.z+z(t))}addTo(t){this.x+=t.x,this.y+=t.y,this.z+=z(t)}copy(){return S.clone(this)}div(t){return S.create(this.x/t,this.y/t,this.z/t)}getLengthSq(){return this.x**2+this.y**2}mult(t){return S.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 S.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=z(t)}sub(t){return S.create(this.x-t.x,this.y-t.y,this.z-z(t))}subFrom(t){this.x-=t.x,this.y-=t.y,this.z-=z(t)}#t(t,e){this.x=Math.cos(t)*e,this.y=Math.sin(t)*e}}class C extends S{constructor(t=l.x,e=l.y){super(t,e,l.z)}static get origin(){return C.create(l.x,l.y)}static clone(t){return C.create(t.x,t.y)}static create(t,e){return"number"==typeof t?new C(t,e??l.y):new C(t.x,t.y)}}function O(t){return"boolean"==typeof t}function D(t){return"string"==typeof t}function k(t){return"number"==typeof t}function I(t){return"object"==typeof t&&null!==t}function T(t){return Array.isArray(t)}function _(t){return null==t}const E=Math.PI/180;let R=Math.random;const L={nextFrame:t=>requestAnimationFrame(t),cancel:t=>{cancelAnimationFrame(t)}};function F(){return U(R(),0,1-Number.EPSILON)}function A(t,e){return F()*(e-t)+t}function B(t){return L.nextFrame(t)}function V(t){L.cancel(t)}function U(t,e,i){return Math.min(Math.max(t,e),i)}function N(t,e,i,s){return Math.floor((t*i+e*s)/(i+s))}function H(t){const e=$(t);let i=W(t);return e===i&&(i=0),A(i,e)}function G(t){return k(t)?t:H(t)}function W(t){return k(t)?t:t.min}function $(t){return k(t)?t:t.max}function q(t,e){if(t===e||void 0===e&&k(t))return t;const i=W(t),s=$(t);return void 0!==e?{min:Math.min(i,e),max:Math.max(s,e)}:q(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 X(t,e){const i=t.x-e.x,s=t.y-e.y;return i*i+s*s}function Y(t,e){return Math.sqrt(X(t,e))}function Q(t,e,i){return X(t,e)<=i*i}function Z(t){return t*E}function K(e,i,s){if(k(e))return Z(e);switch(e){case t.MoveDirection.top:return-Math.PI*a;case t.MoveDirection.topRight:return-Math.PI*w;case t.MoveDirection.right:return 0;case t.MoveDirection.bottomRight:return Math.PI*w;case t.MoveDirection.bottom:return Math.PI*a;case t.MoveDirection.bottomLeft:return Math.PI*P;case t.MoveDirection.left:return Math.PI;case t.MoveDirection.topLeft:return-Math.PI*P;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 F()*u}}function J(t){const e=C.origin;return e.length=1,e.angle=t,e}function tt(t,e,i,s){return C.create(t.x*(i-s)/(i+s)+2*e.x*s/(i+s),t.y)}function et(t){return{x:(t.position?.x??F()*o)*t.size.width/o,y:(t.position?.y??F()*o)*t.size.height/o}}function it(t){const e={x:void 0!==t.position?.x?G(t.position.x):void 0,y:void 0!==t.position?.y?G(t.position.y):void 0};return et({size:t.size,position:e})}function st(t){const{position:e,size:i}=t;return{x:e?.x??F()*i.width,y:e?.y??F()*i.height}}function nt(t){return t?t.endsWith("%")?parseFloat(t)/o:parseFloat(t):1}var ot,at;t.OutModeDirection=void 0,(ot=t.OutModeDirection||(t.OutModeDirection={})).bottom="bottom",ot.left="left",ot.right="right",ot.top="top",t.PixelMode=void 0,(at=t.PixelMode||(t.PixelMode={})).precise="precise",at.percent="percent";function rt(){return globalThis.document}function lt(t){if("undefined"!=typeof matchMedia)return matchMedia(t)}function ct(t){if("undefined"!=typeof MutationObserver)return new MutationObserver(t)}function ht(t,e){return t===e||T(e)&&e.includes(t)}function dt(t,e,i=!0){return t[void 0!==e&&i?e%t.length:Math.floor(F()*t.length)]}function ut(t,e,i,s,n){return pt(ft(t,s??0),e,i,n)}function pt(e,i,s,n){let o=!0;return n&&n!==t.OutModeDirection.bottom||(o=e.top<i.height+s.x),!o||n&&n!==t.OutModeDirection.left||(o=e.right>s.x),!o||n&&n!==t.OutModeDirection.right||(o=e.left<i.width+s.y),!o||n&&n!==t.OutModeDirection.top||(o=e.bottom>s.y),o}function ft(t,e){return{bottom:t.y+e,left:t.x-e,right:t.x+e,top:t.y-e}}function gt(t,...e){for(const i of e){if(_(i))continue;if(!I(i)){t=i;continue}Array.isArray(i)?Array.isArray(t)||(t=[]):I(t)&&!Array.isArray(t)||(t=Object.create(null));const e=Object.keys(i);if(!e.some(t=>{const e=i[t];return I(e)||Array.isArray(e)})){const s=i,n=t;for(const t of e){if("__proto__"===t||"constructor"===t||"prototype"===t)continue;const e=s[t];void 0!==e&&(n[t]=e)}continue}for(const s of e){if("__proto__"===s||"constructor"===s||"prototype"===s)continue;const e=t,n=i[s];e[s]=Array.isArray(n)?n.map(t=>gt(void 0,t)):gt(e[s],n)}}return t}function yt(t,e){return T(t)?t.map((t,i)=>e(t,i)):e(t,0)}function mt(t,e,i){return T(t)?dt(t,e,i):t}function vt(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/o*i.width,y:e.y/o*i.height}:{width:e.width/o*i.width,height:e.height/o*i.height}}(e,i)}function bt(t){const e=rt().createElement("div").style;for(const i in t){const s=t[i];if(!(i in t)||_(s))continue;const n=t.getPropertyValue?.(s);if(!n)continue;const o=t.getPropertyPriority?.(s);o?e.setProperty(s,n,o):e.setProperty(s,n)}return e}let wt,Pt;function Mt(t){if(wt!==t||!Pt){wt=t;const e=rt().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)}Pt=e}return Pt}function xt(t,e,i,s,n){if(s){let s={passive:!0};O(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 zt(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 St(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 Ct{#e;constructor(){this.#e=new Map}addEventListener(t,e){this.removeEventListener(t,e);let i=this.#e.get(t);i||(i=[],this.#e.set(t,i)),i.push(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):i.splice(n,1))}}var Ot;t.EventType=void 0,(Ot=t.EventType||(t.EventType={})).configAdded="configAdded",Ot.containerInit="containerInit",Ot.particlesSetup="particlesSetup",Ot.containerStarted="containerStarted",Ot.containerStopped="containerStopped",Ot.containerDestroyed="containerDestroyed",Ot.containerPaused="containerPaused",Ot.containerPlay="containerPlay",Ot.containerBuilt="containerBuilt",Ot.particleAdded="particleAdded",Ot.particleDestroyed="particleDestroyed",Ot.particleRemoved="particleRemoved";class Dt{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;#i=new Set;#s=new Map;#n;#o=new Set;#a=!1;#r=!1;#l=new Set;constructor(t){this.#n=t}get configs(){const t={};for(const[e,i]of this.#s)t[e]=i;return t}addColorManager(t,e){this.colorManagers.set(t,e)}addConfig(e){const i=e.key??e.name??"default";this.#s.set(i,e),this.#n.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 St(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 St(t,this.shapeDrawers,this.initializers.shapes,e)}async getUpdaters(t,e=!1){return zt(t,this.updaters,this.initializers.updaters,e)}async init(){if(!this.#a&&!this.#r){this.#r=!0,this.#o=new Set,this.#i=new Set(this.#l);try{for(const t of this.#i)await this.#c(t,this.#o,this.#i)}finally{this.#l.clear(),this.#r=!1,this.#a=!0}}}loadParticlesOptions(t,e,...i){const s=this.updaters.get(t);s&&s.forEach(t=>t.loadOptions?.(e,...i))}async register(...t){if(this.#a)throw new Error("Register plugins can only be done before calling tsParticles.load()");for(const e of t)this.#r?await this.#c(e,this.#o,this.#i):this.#l.add(e)}async#c(t,e,i){e.has(t)||(e.add(t),i.add(t),await t(this.#n))}}const kt=t=>(...e)=>{t(...e)},It={debug:kt(console.debug),error:(t,...e)=>{console.error(`tsParticles - Error - ${t}`,...e)},info:kt(console.info),log:kt(console.log),trace:kt(console.trace),verbose:kt(console.log),warning:kt(console.warn)};function Tt(){return It}const _t="100%";class Et{pluginManager=new Dt(this);#h=[];#d=new Ct;#a=!1;get items(){return this.#h}get version(){return"4.3.0"}addEventListener(t,e){this.#d.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.#d.dispatchEvent(t,e)}async init(){this.#a||(await this.pluginManager.init(),this.#a=!0)}item(t){const e=this.items,i=e[t];if(!i?.destroyed)return i;e.splice(t,1)}async load(t){let i;await this.init(),"undefined"!=typeof HTMLElement&&t.element instanceof HTMLElement&&(i=t.element);const{Container:s}=await Promise.resolve().then(function(){return en}),n=t.id??i?.id??`tsparticles${Math.floor(1e4*F()).toString()}`,{index:o,url:a}=t,r=a?await async function(t){const e=mt(t.url,t.index);if(!e)return t.fallback;const i=await fetch(e);return i.ok?await i.json():(Tt().error(`${i.status.toString()} while retrieving config file`),t.fallback)}({fallback:t.options,url:a,index:o}):t.options,l=mt(r,o),{items:c}=this,h=c.findIndex(t=>t.id.description===n),d=new s({dispatchCallback:(t,e)=>{this.dispatchEvent(t,e)},id:n,onDestroy:t=>{if(!t)return;const e=this.items,i=e.indexOf(d);i>=0&&e.splice(i,1)},pluginManager:this.pluginManager,sourceOptions:l});if(h>=0){const t=this.item(h),e=t?1:0;t&&!t.destroyed&&t.destroy(!1),c.splice(h,e,d)}else c.push(d);const u="undefined"!=typeof OffscreenCanvas&&t.element instanceof OffscreenCanvas?t.element:(t=>{const i=rt();let s;if(t instanceof HTMLCanvasElement||t.tagName.toLowerCase()===g)s=t,s.dataset[e]??=f,s.dataset[e]===p&&(s.style.width||=_t,s.style.height||=_t,s.style.pointerEvents="none",s.style.setProperty("pointer-events","none"));else{const n=t.getElementsByTagName(g).item(0);n?(s=n,s.dataset[e]=f):(s=i.createElement(g),s.dataset[e]=p,t.appendChild(s)),s.style.width||=_t,s.style.height||=_t,s.style.pointerEvents="none",s.style.setProperty("pointer-events","none")}return s})(((t,i)=>{const s=rt();let n=i??s.getElementById(t);return n||(n=s.createElement("canvas"),n.id=t,n.dataset[e]=p,s.body.append(n),n)})(n,i));return d.canvas.loadCanvas(u),await d.start(),d}async refresh(t=!0){t&&await Promise.all(this.items.map(t=>t.refresh()))}removeEventListener(t,e){this.#d.removeEventListener(t,e)}}var Rt,Lt,Ft,At,Bt,Vt,Ut,Nt,Ht,Gt,Wt,$t;!function(t){t.circle="circle",t.rectangle="rectangle"}(Rt||(Rt={}));class qt{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 qt{radius;constructor(t,e,i){super(t,e,Rt.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),o=Math.abs(i.y-e.y);if(t instanceof jt||t.type===Rt.circle){return s+t.radius>Math.hypot(n,o)}if(t instanceof Xt||t.type===Rt.rectangle){const e=t,{width:i,height:a}=e.size;return Math.pow(n-i,2)+Math.pow(o-a,2)<=s**2||n<=s+i&&o<=s+a||n<=i||o<=a}return!1}reset(t,e,i){return this._resetPosition(t,e),this.radius=i,this}}class Xt extends qt{size;constructor(t,e,i,s){super(t,e,Rt.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 Xt))return!1;const e=this.size.width,i=this.size.height,s=this.position,n=t.position,o=t.size,a=o.width,r=o.height;return n.x<s.x+e&&n.x+a>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,(Lt=t.RotateDirection||(t.RotateDirection={})).clockwise="clockwise",Lt.counterClockwise="counter-clockwise",Lt.random="random",t.AnimationMode=void 0,(Ft=t.AnimationMode||(t.AnimationMode={})).auto="auto",Ft.increase="increase",Ft.decrease="decrease",Ft.random="random",t.LimitMode=void 0,(At=t.LimitMode||(t.LimitMode={})).delete="delete",At.wait="wait",t.OutMode=void 0,(Bt=t.OutMode||(t.OutMode={})).bounce="bounce",Bt.none="none",Bt.out="out",Bt.destroy="destroy",Bt.split="split",t.AlterType=void 0,(Vt=t.AlterType||(t.AlterType={})).darken="darken",Vt.enlighten="enlighten",t.DestroyType=void 0,(Ut=t.DestroyType||(t.DestroyType={})).none="none",Ut.max="max",Ut.min="min",t.GradientType=void 0,(Nt=t.GradientType||(t.GradientType={})).linear="linear",Nt.radial="radial",Nt.random="random",t.ParticleOutType=void 0,(Ht=t.ParticleOutType||(t.ParticleOutType={})).normal="normal",Ht.inside="inside",Ht.outside="outside",t.StartValueType=void 0,(Gt=t.StartValueType||(t.StartValueType={})).max="max",Gt.min="min",Gt.random="random",t.AnimationStatus=void 0,(Wt=t.AnimationStatus||(t.AnimationStatus={})).increasing="increasing",Wt.decreasing="decreasing",t.DrawLayer=void 0,($t=t.DrawLayer||(t.DrawLayer={}))[$t.BackgroundElement=0]="BackgroundElement",$t[$t.BackgroundDraw=1]="BackgroundDraw",$t[$t.BackgroundMask=2]="BackgroundMask",$t[$t.CanvasSetup=3]="CanvasSetup",$t[$t.PluginContent=4]="PluginContent",$t[$t.Particles=5]="Particles",$t[$t.CanvasCleanup=6]="CanvasCleanup",$t[$t.Foreground=7]="Foreground";class Yt{load(t){_(t)||this.doLoad(t)}}function Qt(t,...e){for(const i of e)t.load(i)}function Zt(t,e,i){void 0!==i&&(t[e]=i)}function Kt(t,e,i){void 0!==i&&(t[e]=q(i))}function Jt(t,e,i){void 0!==i&&t[e].load(i)}function te(t,e,i,s){if(void 0!==i){const n=t;n[e]??=s(),n[e].load(i)}}function ee(t,e,i,...s){const n=t;n[e]??=new i;const o=n[e];for(const t of s)o.load(t?.[e])}class ie extends Yt{count=0;decay=0;delay=0;enable=!1;speed=1;sync=!1;doLoad(t){Kt(this,"count",t.count),Zt(this,"enable",t.enable),Kt(this,"speed",t.speed),Kt(this,"decay",t.decay),Kt(this,"delay",t.delay),Zt(this,"sync",t.sync)}}class se extends ie{mode=t.AnimationMode.auto;startValue=t.StartValueType.random;doLoad(t){super.doLoad(t),Zt(this,"mode",t.mode),Zt(this,"startValue",t.startValue)}}class ne extends ie{max;min;offset=0;sync=!0;constructor(t,e){super(),this.min=t,this.max=e}doLoad(t){super.doLoad(t),Zt(this,"max",t.max),Zt(this,"min",t.min),Kt(this,"offset",t.offset)}}class oe extends Yt{h=new ne(0,m);l=new ne(0,b);s=new ne(0,v);doLoad(t){this.h.load(t.h),this.s.load(t.s),this.l.load(t.l)}}class ae extends Yt{value="";static create(t,e){const i=new ae;return i.load(t),void 0!==e&&(D(e)||T(e)?i.load({value:e}):i.load(e)),i}doLoad(t){_(t.value)||(this.value=t.value)}}class re extends ae{animation=new oe;static create(t,e){const i=new re;return i.load(t),void 0!==e&&(D(e)||T(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 le extends Yt{color;draw;element;image="";opacity=1;position="";repeat="";size="";constructor(){super(),this.color=new ae,this.color.value=""}doLoad(t){void 0!==t.color&&(this.color=ae.create(this.color,t.color)),Zt(this,"element",t.element),Zt(this,"draw",t.draw),Zt(this,"image",t.image),Zt(this,"position",t.position),Zt(this,"repeat",t.repeat),Zt(this,"size",t.size),Zt(this,"opacity",t.opacity)}}class ce extends Yt{enable=!0;zIndex=0;doLoad(t){Zt(this,"enable",t.enable),Zt(this,"zIndex",t.zIndex)}}class he extends Yt{delay=.5;enable=!0;doLoad(t){Zt(this,"delay",t.delay),Zt(this,"enable",t.enable)}}class de extends Yt{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]=gt(this.options[t]??{},i))}Zt(this,"close",t.close),Zt(this,"type",t.type)}}class ue extends Yt{color;enable=!0;opacity=1;doLoad(t){void 0!==t.color&&(this.color=re.create(this.color,t.color)),Zt(this,"enable",t.enable),Kt(this,"opacity",t.opacity)}}class pe extends Yt{offset=0;value=90;doLoad(t){Kt(this,"offset",t.offset),Kt(this,"value",t.value)}}class fe extends Yt{mode=t.PixelMode.percent;radius=0;x=50;y=50;doLoad(t){Zt(this,"x",t.x),Zt(this,"y",t.y),Zt(this,"mode",t.mode),Zt(this,"radius",t.radius)}}class ge extends Yt{acceleration=9.81;enable=!1;inverse=!1;maxSpeed=50;doLoad(t){Kt(this,"acceleration",t.acceleration),Zt(this,"enable",t.enable),Zt(this,"inverse",t.inverse),Kt(this,"maxSpeed",t.maxSpeed)}}class ye extends Yt{value=0;doLoad(t){_(t.value)||(this.value=q(t.value))}}class me extends ye{animation=new ie;doLoad(t){super.doLoad(t),Jt(this,"animation",t.animation)}}class ve extends me{animation=new se}class be extends Yt{clamp=!0;delay=new ye;enable=!1;generator;options={};doLoad(t){Zt(this,"clamp",t.clamp),this.delay.load(t.delay),Zt(this,"enable",t.enable),this.generator=t.generator,t.options&&(this.options=gt(this.options,t.options))}}class we extends Yt{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 Pe extends Yt{acceleration=0;enable=!1;position;doLoad(t){Kt(this,"acceleration",t.acceleration),Zt(this,"enable",t.enable),t.position&&(this.position=gt({},t.position))}}class Me extends Yt{angle=new pe;center=new fe;decay=0;direction=t.MoveDirection.none;distance={};drift=0;enable=!1;gravity=new ge;outModes=new we;path=new be;random=!1;size=!1;speed=2;spin=new Pe;straight=!1;vibrate=!1;warp=!1;doLoad(t){this.angle.load(k(t.angle)?{value:t.angle}:t.angle),this.center.load(t.center),Kt(this,"decay",t.decay),Zt(this,"direction",t.direction),void 0!==t.distance&&(this.distance=k(t.distance)?{horizontal:t.distance,vertical:t.distance}:{...t.distance}),Kt(this,"drift",t.drift),Zt(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),Zt(this,"random",t.random),Zt(this,"size",t.size),Kt(this,"speed",t.speed),this.spin.load(t.spin),Zt(this,"straight",t.straight),Zt(this,"vibrate",t.vibrate),Zt(this,"warp",t.warp)}}class xe extends Yt{color;opacity;width=0;doLoad(t){void 0!==t.color&&(this.color=re.create(this.color,t.color)),Kt(this,"width",t.width),Kt(this,"opacity",t.opacity)}}class ze extends Yt{color;fill;stroke;doLoad(t){void 0!==t.color&&(this.color=re.create(this.color,t.color)),te(this,"fill",t.fill,()=>new ue),te(this,"stroke",t.stroke,()=>new xe)}}class Se extends ye{value=1}class Ce extends Yt{horizontal=new Se;vertical=new Se;doLoad(t){this.horizontal.load(t.horizontal),this.vertical.load(t.vertical)}}class Oe extends Yt{enable=!1;height=1080;width=1920;doLoad(t){Zt(this,"enable",t.enable),Zt(this,"width",t.width),Zt(this,"height",t.height)}}class De extends Yt{mode=t.LimitMode.delete;value=0;doLoad(t){Zt(this,"mode",t.mode),Zt(this,"value",t.value)}}class ke extends Yt{density=new Oe;limit=new De;value=0;doLoad(t){this.density.load(t.density),this.limit.load(t.limit),Zt(this,"value",t.value)}}class Ie extends Yt{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]=gt(this.options[t]??{},i))}Zt(this,"close",t.close),Zt(this,"type",t.type)}}class Te extends ye{opacityRate=1;sizeRate=1;velocityRate=1;doLoad(t){super.doLoad(t),Zt(this,"opacityRate",t.opacityRate),Zt(this,"sizeRate",t.sizeRate),Zt(this,"velocityRate",t.velocityRate)}}class _e extends Yt{bounce=new Ce;effect=new de;groups={};move=new Me;number=new ke;paint;palette;reduceDuplicates=!1;shape=new Ie;zIndex=new Te;#u;#p;constructor(t,e){super(),this.#p=t,this.#u=e,this.paint=new ze,this.paint.color=new re,this.paint.color.value="#fff",this.paint.fill=new ue,this.paint.fill.enable=!0}doLoad(t){if(t.palette&&(this.palette=t.palette,this.#f(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]=gt(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&&(T(e)?this.paint=yt(e,t=>{const e=new ze;return e.load(t),e}):T(this.paint)?(this.paint=new ze,this.paint.load(e)):this.paint.load(e)),this.shape.load(t.shape),this.zIndex.load(t.zIndex),this.#u){for(const e of this.#p.plugins)e.loadParticlesOptions&&e.loadParticlesOptions(this.#u,this,t);const e=this.#p.updaters.get(this.#u);if(e)for(const i of e)i.loadOptions&&i.loadOptions(this,t)}}#f(t){const e=this.#p.getPalette(t);if(!e)return;const i=e.colors,s=(T(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 Ee(t,e,...i){const s=new _e(t,e);return Qt(s,...i),s}class Re extends Yt{autoPlay=!0;background;clear=!0;defaultThemes={};delay=0;detectRetina=!0;duration=0;fpsLimit=120;fullScreen;hdr=!0;key;name;palette;particles;pauseOnBlur=!0;pauseOnOutsideViewport=!0;preset;resize;smooth=!1;style={};zLayers=100;#u;#p;constructor(t,e){super(),this.#p=t,this.#u=e,this.background=new le,this.fullScreen=new ce,this.particles=Ee(this.#p,this.#u),this.resize=new he}doLoad(t){void 0!==t.preset&&(this.preset=t.preset,yt(this.preset,t=>{this.#g(t)})),void 0!==t.palette&&(this.palette=t.palette,this.#f(this.palette)),Zt(this,"autoPlay",t.autoPlay),Zt(this,"clear",t.clear),Zt(this,"key",t.key),Zt(this,"name",t.name),Kt(this,"delay",t.delay),Zt(this,"detectRetina",t.detectRetina),Kt(this,"duration",t.duration),Zt(this,"fpsLimit",t.fpsLimit),Zt(this,"hdr",t.hdr),Zt(this,"pauseOnBlur",t.pauseOnBlur),Zt(this,"pauseOnOutsideViewport",t.pauseOnOutsideViewport),Zt(this,"zLayers",t.zLayers),this.background.load(t.background);const e=t.fullScreen;O(e)?this.fullScreen.enable=e:this.fullScreen.load(e),this.particles.load(t.particles),this.resize.load(t.resize),this.style=gt(this.style,t.style),Zt(this,"smooth",t.smooth),this.#p.plugins.forEach(e=>{e.loadOptions(this.#u,this,t)})}#f(t){const e=this.#p.getPalette(t);e&&this.load({background:{color:e.background},blend:{enable:!0,mode:e.blendMode},particles:{palette:t}})}#g(t){this.load(this.#p.getPreset(t))}}const Le=new Map;function Fe(t,e){let i=Le.get(t);return i||(i=e(),Le.size>2e3&&Le.clear(),Le.set(t,i)),i}function Ae(t,e){if(e)for(const i of t.colorManagers.values())if(i.accepts(e))return i.parseString(e)}function Be(t,e,i,s=!0){if(!e)return;const n=D(e)?{value:e}:e;if(D(n.value))return Ve(t,n.value,i,s);if(T(n.value)){const e=dt(n.value,i,s);if(!e)return;return Be(t,{value:e})}for(const e of t.colorManagers.values()){const t=e.handleRangeColor(n);if(t)return t}}function Ve(t,e,i,s=!0){if(!e)return;const n=D(e)?{value:e}:e;if(D(n.value))return n.value===h?je():He(t,n.value);if(T(n.value)){const e=dt(n.value,i,s);if(!e)return;return Ve(t,{value:e})}for(const e of t.colorManagers.values()){const t=e.handleColor(n);if(t)return t}}function Ue(t,e,i,s=!0){const n=Be(t,e,i,s);return n?Ne(n):void 0}function Ne(t){const e=t.r/y,i=t.g/y,s=t.b/y,n=Math.max(e,i,s),o=Math.min(e,i,s),r={h:0,l:(n+o)*a,s:0};return n!==o&&(r.s=r.l<a?(n-o)/(n+o):(n-o)/(2-n-o),r.h=e===n?(i-s)/(n-o):i===n?2+(s-e)/(n-o):4+(e-i)/(n-o)),r.l*=b,r.s*=v,r.h*=60,r.h<0&&(r.h+=m),r.h>=m&&(r.h-=m),r}function He(t,e){return Ae(t,e)}function Ge(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 We(t){const e=(t.h%m+m)%m,i=Math.max(0,Math.min(v,t.s)),s=Math.max(0,Math.min(b,t.l)),n=e/m,o=i/v,r=s/b;if(0===i){const t=Math.round(r*y);return{r:t,g:t,b:t}}const l=r<a?r*(1+o):r+o-r*o,c=2*r-l,h=1/3,d=Math.min(y,y*Ge(c,l,n+h)),u=Math.min(y,y*Ge(c,l,n)),p=Math.min(y,y*Ge(c,l,n-h));return{r:Math.round(d),g:Math.round(u),b:Math.round(p)}}function $e(t){const e=(t.h%m+m)%m,i=Math.max(0,Math.min(v,t.s)),s=Math.max(0,Math.min(b,t.l)),n=e/m,o=i/v,r=s/b;if(0===i){const t=r*y;return{r:t,g:t,b:t}}const l=r<a?r*(1+o):r+o-r*o,c=2*r-l,h=1/3;return{r:Math.min(y,y*Ge(c,l,n+h)),g:Math.min(y,y*Ge(c,l,n)),b:Math.min(y,y*Ge(c,l,n-h))}}function qe(t){const e=We(t);return{a:t.a,b:e.b,g:e.g,r:e.r}}function je(t,e){const i=t??0;if(e)return{r:A(i,y),g:A(i,y),b:A(i,y)};const s=()=>Math.floor(A(i,256));return{b:s(),g:s(),r:s()}}function Xe(t,e,i){const s=e?4:2,n=i??1;return Fe(`rgb-${t.r.toFixed(s)}-${t.g.toFixed(s)}-${t.b.toFixed(s)}-${e?"hdr":"sdr"}-${n.toString()}`,()=>e?function(t,e,i=400){const s=i/203;return`color(display-p3 ${(t.r/y*s).toString()} ${(t.g/y*s).toString()} ${(t.b/y*s).toString()} / ${(e??1).toString()})`}(t,i):function(t,e){return`rgba(${t.r.toString()}, ${t.g.toString()}, ${t.b.toString()}, ${(e??1).toString()})`}(t,i))}function Ye(t,e,i){const s=e?4:2,n=i??1;return Fe(`hsl-${t.h.toFixed(s)}-${t.s.toFixed(s)}-${t.l.toFixed(s)}-${e?"hdr":"sdr"}-${n.toString()}`,()=>e?Xe($e(t),!0,i):`hsla(${t.h.toString()}, ${t.s.toString()}%, ${t.l.toString()}%, ${n.toString()})`)}function Qe(t,e,i,s){let n=t,o=e;return"r"in n||(n=We(t)),"r"in o||(o=We(e)),{b:N(n.b,o.b,i,s),g:N(n.g,o.g,i,s),r:N(n.r,o.r,i,s)}}function Ze(t){return void 0===t?void 0:{h:t.h.value,s:t.s.value,l:t.l.value}}function Ke(t,e,i){const s={h:{enable:!1,value:t.h,min:0,max:m},s:{enable:!1,value:t.s,min:0,max:v},l:{enable:!1,value:t.l,min:0,max:b}};return e&&(Je(s.h,e.h,i),Je(s.s,e.s,i),Je(s.l,e.l,i)),s}function Je(e,i,s){e.enable=i.enable,e.min=i.min,e.max=i.max,e.enable?(e.velocity=G(i.speed)/o*s,e.decay=1-G(i.decay),e.status=t.AnimationStatus.increasing,e.loops=0,e.maxLoops=G(i.count),e.time=0,e.delayTime=G(i.delay)*r,i.sync||(e.velocity*=F(),e.value*=F()),e.initialValue=e.value,e.offset=q(i.offset)):e.velocity=0}function ti(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 o=e.offset?H(e.offset):0,a=((e.velocity??0)*s.factor+3.6*o)*(n?.5075:1),r=e.decay??1,l=e.max,c=e.min;i&&e.status!==t.AnimationStatus.increasing?(e.value-=a,e.value<c&&(e.loops??=0,e.loops++,e.status=t.AnimationStatus.increasing)):(e.value+=a,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=U(e.value,c,l)}function ei(t,e,i){if(!t)return;const{h:s,s:n,l:o}=t;ti(s,!1,e,i),ti(n,!0,e,i),ti(o,!0,e,i)}function ii(e,i,s){return{h:e.h,s:e.s,l:e.l+(i===t.AlterType.darken?-1:1)*s}}const si=new Et;class ni{enable=!1;mode="destination-out";load(t){_(t)||(Zt(this,"mode",t.mode),Zt(this,"enable",t.enable))}}class oi{id="blend";async getPlugin(t){const{BlendPluginInstance:e}=await Promise.resolve().then(function(){return sn});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 ni),s.load(i?.blend)}loadParticlesOptions(t,e,i){e.blend??=new ni,e.blend.load(i?.blend)}needsPlugin(t){return!!t?.blend?.enable||!!t?.particles?.blend?.enable}}async function ai(t){t.checkVersion("4.3.0"),await t.pluginManager.register(t=>{t.pluginManager.addPlugin(new oi)})}class ri{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:Z(s.min),max:Z(s.max)}:{min:0,max:Z(s)}}}async function li(t){t.checkVersion("4.3.0"),await t.pluginManager.register(t=>{t.pluginManager.addShape(["circle"],()=>Promise.resolve(new ri))})}var ci;!function(t){t[t.r=1]="r",t[t.g=2]="g",t[t.b=3]="b",t[t.a=4]="a"}(ci||(ci={}));const hi=/^#?([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 ui{accepts(t){return t.startsWith("#")}handleColor(t){return this.#y(t.value)}handleRangeColor(t){return this.#y(t.value)}parseString(t){return this.#y(t)}#y(t){if("string"!=typeof t||!this.accepts(t))return;const e=t.replace(hi,(t,e,i,s,n)=>e+e+i+i+s+s+(void 0===n?"":n+n)),i=di.exec(e);return i?{a:i[ci.a]?Number.parseInt(i[ci.a],16)/255:1,b:Number.parseInt(i[ci.b]??"0",16),g:Number.parseInt(i[ci.g]??"0",16),r:Number.parseInt(i[ci.r]??"0",16)}:void 0}}async function pi(t){t.checkVersion("4.3.0"),await t.pluginManager.register(t=>{t.pluginManager.addColorManager("hex",new ui)})}var fi;!function(t){t[t.h=1]="h",t[t.s=2]="s",t[t.l=3]="l",t[t.a=5]="a"}(fi||(fi={}));const gi=/hsla?\(\s*(\d+)\s*[\s,]\s*(\d+)%\s*[\s,]\s*(\d+)%\s*([\s,]\s*(0|1|0?\.\d+|(\d{1,3})%)\s*)?\)/i;class yi{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 We(e)}handleRangeColor(t){const e=t.value.hsl??t.value;if("h"in e&&"s"in e&&"l"in e)return We({h:G(e.h),l:G(e.l),s:G(e.s)})}parseString(t){if(!this.accepts(t))return;const e=gi.exec(t);return e?qe({a:e.length>4?nt(e[fi.a]):1,h:Number.parseInt(e[fi.h]??"0",10),l:Number.parseInt(e[fi.l]??"0",10),s:Number.parseInt(e[fi.s]??"0",10)}):void 0}}async function mi(t){t.checkVersion("4.3.0"),await t.pluginManager.register(t=>{t.pluginManager.addColorManager("hsl",new yi)})}class vi{id="move";#p;constructor(t){this.#p=t}async getPlugin(t){const{MovePluginInstance:e}=await Promise.resolve().then(function(){return on});return new e(this.#p,t)}loadOptions(){}needsPlugin(){return!0}}async function bi(t){t.checkVersion("4.3.0"),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,St(t,e.pathGenerators,e.initializers.pathGenerators,i)),t.pluginManager.addPlugin(new vi(t.pluginManager))})}function wi(e,i){const s=e.value,n=e.animation,o={delayTime:G(n.delay)*r,enable:n.enable,value:G(e.value)*i,max:$(s)*i,min:W(s)*i,loops:0,maxLoops:G(n.count),time:0};if(n.enable){switch(o.decay=1-G(n.decay),n.mode){case t.AnimationMode.increase:o.status=t.AnimationStatus.increasing;break;case t.AnimationMode.decrease:o.status=t.AnimationStatus.decreasing;break;case t.AnimationMode.random:o.status=F()>=a?t.AnimationStatus.increasing:t.AnimationStatus.decreasing}const e=n.mode===t.AnimationMode.auto;switch(n.startValue){case t.StartValueType.min:o.value=o.min,e&&(o.status=t.AnimationStatus.increasing);break;case t.StartValueType.max:o.value=o.max,e&&(o.status=t.AnimationStatus.decreasing);break;case t.StartValueType.random:default:o.value=H(o),e&&(o.status=F()>=a?t.AnimationStatus.increasing:t.AnimationStatus.decreasing)}}return o.initialValue=o.value,o}function Pi(e,i,s,n,o){if(e.destroyed||!i.enable||(i.maxLoops??0)>0&&(i.loops??0)>(i.maxLoops??0))return;const a=(i.velocity??0)*o.factor,r=i.min,l=i.max,c=i.decay??1;i.time??=0;const h=i.delayTime??0;if(!(h>0&&i.time<h&&(i.time+=o.value,i.time<h))){switch(i.status){case t.AnimationStatus.increasing:i.value+=a;break;case t.AnimationStatus.decreasing:i.value-=a}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,o){switch(i){case t.DestroyType.max:s>=o&&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))}}class Mi extends se{destroy=t.DestroyType.none;load(t){super.load(t),_(t)||Zt(this,"destroy",t.destroy)}}class xi extends ve{animation=new Mi;value=1;load(t){if(_(t))return;super.load(t);const e=t.animation;void 0!==e&&this.animation.load(e)}}class zi{#u;constructor(t){this.#u=t}init(t){const e=t.options.opacity;if(!e)return;t.opacity=wi(e,1);const i=e.animation;i.enable&&(t.opacity.velocity=G(i.speed)/o*this.#u.retina.reduceFactor,i.sync||(t.opacity.velocity*=F()))}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){ee(t,"opacity",xi,...e)}reset(t){t.opacity&&(t.opacity.time=0,t.opacity.loops=0)}update(t,e){this.isEnabled(t)&&t.opacity&&t.options.opacity&&Pi(t,t.opacity,0,t.options.opacity.animation.destroy,e)}}async function Si(t){t.checkVersion("4.3.0"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("opacity",t=>Promise.resolve(new zi(t)))})}class Ci{modes;#u;#m;constructor(e){this.#u=e,this.modes=[t.OutMode.bounce,t.OutMode.split],this.#m=e.plugins.filter(t=>void 0!==t.particleBounce)}update(e,i,s,n){if(!this.modes.includes(n))return;const o=this.#u;let a=!1;for(const t of this.#m)if(a=t.particleBounce?.(e,s,i)??!1,a)break;if(a)return;const r=e.getPosition(),l=e.offset,c=e.getRadius(),h=ft(r,c),d=o.canvas.size,u=!e.isInsideCanvasForOutMode(n,i);!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.outOfCanvas&&(e.direction===t.OutModeDirection.right&&i>0||e.direction===t.OutModeDirection.left&&i<0)){const t=G(e.particle.options.bounce.horizontal.value);e.particle.velocity.x*=-t,s=!0}if(!s)return;const n=e.offset.x+e.size;e.outOfCanvas&&e.direction===t.OutModeDirection.right?e.particle.position.x=e.canvasSize.width-n:e.outOfCanvas&&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,outOfCanvas:u,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.outOfCanvas&&(e.direction===t.OutModeDirection.bottom&&i>0||e.direction===t.OutModeDirection.top&&i<0)){const t=G(e.particle.options.bounce.vertical.value);e.particle.velocity.y*=-t,s=!0}if(!s)return;const n=e.offset.y+e.size;e.outOfCanvas&&e.direction===t.OutModeDirection.bottom?e.particle.position.y=e.canvasSize.height-n:e.outOfCanvas&&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,outOfCanvas:u,size:c})}}class Oi{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{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 Di{modes;#u;constructor(e){this.#u=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 o=e.options.move.gravity,a=this.#u,r=a.canvas.size,c=e.getRadius();if(o.enable){const s=e.position;(!o.inverse&&s.y>r.height+c&&i===t.OutModeDirection.bottom||o.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;ut(e.position,a.canvas.size,l,c,i)||e.destroy()}}}const ki=C.origin;class Ii{modes;#u;constructor(e){this.#u=e,this.modes=[t.OutMode.out]}update(e,i,s,n){if(!this.modes.includes(n))return;const o=this.#u;switch(e.outType){case t.ParticleOutType.inside:{const{x:t,y:i}=e.velocity;ki.setTo(l),ki.length=e.moveCenter.radius,ki.angle=e.velocity.angle+Math.PI,ki.addTo(e.moveCenter);const{dx:s,dy:n}=j(e.position,ki);if(t<=0&&s>=0||i<=0&&n>=0||t>=0&&s<=0||i>=0&&n<=0)return;e.position.x=Math.floor(H({min:0,max:o.canvas.size.width})),e.position.y=Math.floor(H({min:0,max:o.canvas.size.height}));const{dx:a,dy:r}=j(e.position,e.moveCenter);e.direction=Math.atan2(-r,-a),e.velocity.angle=e.direction,e.justWarped=!0;break}default:if(e.isInsideCanvasForOutMode(n,i))return;switch(e.outType){case t.ParticleOutType.outside:{e.position.x=Math.floor(H({min:-e.moveCenter.radius,max:e.moveCenter.radius}))+e.moveCenter.x,e.position.y=Math.floor(H({min:-e.moveCenter.radius,max:e.moveCenter.radius}))+e.moveCenter.y;const{dx:t,dy:i}=j(e.position,e.moveCenter);e.moveCenter.radius&&(e.direction=Math.atan2(i,t),e.velocity.angle=e.direction),e.justWarped=!0;break}case t.ParticleOutType.normal:{const s=e.options.move.warp,n=o.canvas.size,a={bottom:n.height+e.getRadius()+e.offset.y,left:-e.getRadius()-e.offset.x,right:n.width+e.getRadius()+e.offset.x,top:-e.getRadius()-e.offset.y},r=e.getRadius(),l=ft(e.position,r);i===t.OutModeDirection.right&&l.left>n.width+e.offset.x?(e.position.x=a.left,e.initialPosition.x=e.position.x,s||(e.position.y=F()*n.height,e.initialPosition.y=e.position.y),e.justWarped=!0):i===t.OutModeDirection.left&&l.right<-e.offset.x&&(e.position.x=a.right,e.initialPosition.x=e.position.x,s||(e.position.y=F()*n.height,e.initialPosition.y=e.position.y),e.justWarped=!0),i===t.OutModeDirection.bottom&&l.top>n.height+e.offset.y?(s||(e.position.x=F()*n.width,e.initialPosition.x=e.position.x),e.position.y=a.top,e.initialPosition.y=e.position.y,e.justWarped=!0):i===t.OutModeDirection.top&&l.bottom<-e.offset.y&&(s||(e.position.x=F()*n.width,e.initialPosition.x=e.position.x),e.position.y=a.bottom,e.initialPosition.y=e.position.y,e.justWarped=!0);break}}}}}class Ti{updaters;#u;constructor(t){this.#u=t,this.updaters=new Map}init(e){this.#v(e,t.OutMode.bounce,t=>new Ci(t)),this.#v(e,t.OutMode.out,t=>new Ii(t)),this.#v(e,t.OutMode.destroy,t=>new Oi(t)),this.#v(e,t.OutMode.none,t=>new Di(t))}isEnabled(t){return!t.destroyed&&!t.spawning}update(e,i){const s=e.options.move.outModes;e.justWarped=!1,this.#b(e,i,s.bottom??s.default,t.OutModeDirection.bottom),this.#b(e,i,s.left??s.default,t.OutModeDirection.left),this.#b(e,i,s.right??s.default,t.OutModeDirection.right),this.#b(e,i,s.top??s.default,t.OutModeDirection.top)}#v(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.#u))}#b(t,e,i,s){for(const n of this.updaters.values())n.update(t,s,e,i)}}async function _i(t){t.checkVersion("4.3.0"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("outModes",t=>Promise.resolve(new Ti(t)))})}class Ei{#u;#p;constructor(t,e){this.#u=e,this.#p=t}init(t){const e=this.#u,i=t.options,s=mt(i.paint,t.id,i.reduceDuplicates),n=s?.color,o=n??void 0,a=s?.fill,r=s?.stroke;if(a){const i=re.create(void 0===o?void 0:re.create(void 0,o),a.color);t.fillEnabled=a.enable,t.fillOpacity=G(a.opacity),t.fillAnimation=i.animation;const s=Ue(this.#p,i);s&&(t.fillColor=Ke(s,t.fillAnimation,e.retina.reduceFactor))}else t.fillEnabled=!1,t.fillAnimation=void 0,t.fillColor=void 0,t.fillOpacity=1;if(r){const i=re.create(void 0===o?void 0:re.create(void 0,o),r.color);t.strokeWidth=G(r.width)*e.retina.pixelRatio,t.strokeOpacity=G(r.opacity??1),t.strokeAnimation=i.animation;const s=Ue(this.#p,i)??t.getFillColor();s&&(t.strokeColor=Ke(s,t.strokeAnimation,e.retina.reduceFactor))}else t.strokeAnimation=void 0,t.strokeColor=void 0,t.strokeOpacity=1,t.strokeWidth=0}isEnabled(t){const{fillAnimation:e,fillColor:i,strokeAnimation:s,strokeColor:n}=t,o=!!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),a=!!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&&(o||a)}update(t,e){this.isEnabled(t)&&(ei(t.fillColor,e,this.#u.hdr),ei(t.strokeColor,e,this.#u.hdr))}}async function Ri(t){t.checkVersion("4.3.0"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("paint",e=>Promise.resolve(new Ei(t.pluginManager,e)))})}var Li;!function(t){t[t.r=1]="r",t[t.g=2]="g",t[t.b=3]="b",t[t.a=5]="a"}(Li||(Li={}));const Fi=/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 Ai{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:G(e.r),g:G(e.g),b:G(e.b)}}parseString(t){if(!this.accepts(t))return;const e=Fi.exec(t);return e?{a:e.length>4?nt(e[Li.a]):1,b:parseInt(e[Li.b]??"0",10),g:parseInt(e[Li.g]??"0",10),r:parseInt(e[Li.r]??"0",10)}:void 0}}async function Bi(t){t.checkVersion("4.3.0"),await t.pluginManager.register(t=>{t.pluginManager.addColorManager("rgb",new Ai)})}class Vi extends se{destroy=t.DestroyType.none;load(t){super.load(t),_(t)||Zt(this,"destroy",t.destroy)}}class Ui extends ve{animation=new Vi;value=3;load(t){if(super.load(t),_(t))return;const e=t.animation;void 0!==e&&this.animation.load(e)}}class Ni{#u;constructor(t){this.#u=t}init(t){const e=this.#u,i=t.options.size;if(!i)return;const s=i.animation;s.enable&&(t.size.velocity=t.retina.sizeAnimationSpeed/o*e.retina.reduceFactor,s.sync||(t.size.velocity*=F()))}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){ee(t,"size",Ui,...e)}preInit(t){const e=this.#u.retina.pixelRatio,i=t.options.size;i&&(t.size=wi(i,e),t.retina.sizeAnimationSpeed=G(i.animation.speed)*e)}reset(t){t.size.time=0,t.size.loops=0}update(t,e){this.isEnabled(t)&&t.options.size&&Pi(t,t.size,0,t.options.size.animation.destroy,e)}}async function Hi(t){t.checkVersion("4.3.0"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("size",t=>Promise.resolve(new Ni(t)))})}async function Gi(t){t.checkVersion("4.3.0"),await t.pluginManager.register(async t=>{await Promise.all([ai(t),pi(t),mi(t),Bi(t),bi(t),li(t),Ri(t),Si(t),_i(t),Hi(t)])})}class Wi{count;delay;duration;wait=!1;load(t){_(t)||(Zt(this,"count",t.count),Kt(this,"delay",t.delay),Kt(this,"duration",t.duration),Zt(this,"wait",t.wait))}}class $i{delay=.1;quantity=1;load(t){_(t)||(Kt(this,"quantity",t.quantity),Kt(this,"delay",t.delay))}}class qi{color=!1;opacity=!1;load(t){_(t)||(Zt(this,"color",t.color),Zt(this,"opacity",t.opacity))}}class ji{options={};replace=new qi;type="square";load(t){_(t)||(void 0!==t.options&&(this.options=gt({},t.options??{})),this.replace.load(t.replace),Zt(this,"type",t.type))}}class Xi{height=0;mode=t.PixelMode.percent;width=0;load(t){_(t)||(Zt(this,"mode",t.mode),Zt(this,"height",t.height),Zt(this,"width",t.width))}}class Yi{fill;stroke;load(t){_(t)||(t.fill&&(this.fill??=new ue,this.fill.load(t.fill)),t.stroke&&(this.stroke??=new xe,this.stroke.load(t.stroke)))}}class Qi{autoPlay=!0;direction;domId;fill=!0;life=new Wi;name;particles;position;rate=new $i;shape=new ji;size;spawn=new Yi;spawnFillColor;spawnStrokeColor;startCount=0;load(t){_(t)||(Zt(this,"autoPlay",t.autoPlay),void 0!==t.size&&(this.size??=new Xi,this.size.load(t.size)),Zt(this,"direction",t.direction),Zt(this,"domId",t.domId),Zt(this,"fill",t.fill),this.life.load(t.life),Zt(this,"name",t.name),this.particles=yt(t.particles,t=>gt({},t)),this.rate.load(t.rate),this.shape.load(t.shape),this.spawn.load(t.spawn),void 0!==t.position&&(this.position={},void 0!==t.position.x&&(this.position.x=q(t.position.x)),void 0!==t.position.y&&(this.position.y=q(t.position.y))),void 0!==t.spawnFillColor&&(this.spawnFillColor??=new re,this.spawnFillColor.load(t.spawnFillColor)),void 0!==t.spawnStrokeColor&&(this.spawnStrokeColor??=new re,this.spawnStrokeColor.load(t.spawnStrokeColor)),Zt(this,"startCount",t.startCount))}}class Zi{id="emitters";#w;constructor(t){this.#w=t}async getPlugin(t){const{EmittersPluginInstance:e}=await Promise.resolve().then(function(){return an});return new e(this.#w,t)}loadOptions(t,e,i){(this.needsPlugin(e)||this.needsPlugin(i))&&i?.emitters&&(e.emitters=yt(i.emitters,t=>{const e=new Qi;return e.load(t),e}))}needsPlugin(t){if(!t)return!1;const e=t.emitters;return T(e)&&!!e.length||void 0!==e}}const Ki=new WeakMap;class Ji{fill;options;position;size;constructor(t,e,i,s){this.position=t,this.size=e,this.fill=i,this.options=s}resize(t,e){this.position=t,this.size=e}}var ts;async function es(t){t.checkVersion("4.3.0"),await t.pluginManager.register(async t=>{const e=await function(t){const e=t.pluginManager;let i=Ki.get(e);return i||(i=Promise.resolve().then(function(){return cn}).then(({EmittersInstancesManager:t})=>new t(e)).catch(t=>{throw Ki.delete(e),t}),Ki.set(e,i)),i}(t);await async function(t){const{ShapeManager:e}=await Promise.resolve().then(function(){return ln}),i=t.pluginManager;i.emitterShapeManager??=new e,i.addEmitterShapeGenerator??=(t,e)=>{i.emitterShapeManager?.addShapeGenerator(t,e)}}(t),t.pluginManager.addPlugin(new Zi(e))})}!function(t){t.emitter="emitter"}(ts||(ts={}));var is;function ss(t,e){return t+e*(F()-a)}!function(t){t[t.TopLeft=0]="TopLeft",t[t.TopRight=1]="TopRight",t[t.BottomRight=2]="BottomRight",t[t.BottomLeft=3]="BottomLeft"}(is||(is={}));class ns extends Ji{constructor(t,e,i,s){super(t,e,i,s)}async init(){}randomPosition(){const t=this.fill,e=this.position,i=this.size;if(t)return{position:{x:ss(e.x,i.width),y:ss(e.y,i.height)}};{const t=i.width*a,s=i.height*a,n=function(t){return Math.floor(F()*t)}(4),o=2*(F()-a);switch(n){case is.TopLeft:return{position:{x:e.x+o*t,y:e.y-s}};case is.TopRight:return{position:{x:e.x-t,y:e.y+o*s}};case is.BottomRight:return{position:{x:e.x+o*t,y:e.y+s}};case is.BottomLeft:default:return{position:{x:e.x+t,y:e.y+o*s}}}}}}class os{generate(t,e,i,s,n){return new ns(e,i,s,n)}}async function as(t){t.checkVersion("4.3.0"),await t.pluginManager.register(t=>{!function(t){if(!t.pluginManager.addEmitterShapeGenerator)throw new Error("tsParticles Emitters Plugin is not loaded")}(t),t.pluginManager.addEmitterShapeGenerator?.("square",new os)})}class rs extends ye{sync=!1;load(t){_(t)||(super.load(t),Zt(this,"sync",t.sync))}}class ls extends ye{sync=!1;load(t){_(t)||(super.load(t),Zt(this,"sync",t.sync))}}class cs{count=0;delay=new rs;duration=new ls;load(t){_(t)||(Zt(this,"count",t.count),this.delay.load(t.delay),this.duration.load(t.duration))}}class hs{#u;constructor(t){this.#u=t}init(t){const e=this.#u,i=t.options.life;if(!i)return;const s=i.delay.sync?1:F(),n=i.duration.sync?1:F();t.life={delay:e.retina.reduceFactor?G(i.delay.value)*s/e.retina.reduceFactor*r:0,delayTime:0,duration:e.retina.reduceFactor?G(i.duration.value)*n/e.retina.reduceFactor*r:0,time:0,count:i.count},t.life.duration<=0&&(t.life.duration=-1),t.life.count<=0&&(t.life.count=-1),t.spawning=t.life.delay>0}isEnabled(t){return!t.destroyed}loadOptions(t,...e){ee(t,"life",cs,...e)}update(t,e){this.isEnabled(t)&&t.life&&function(t,e,i){if(!t.life)return;const s=t.life;let n=!1;if(t.spawning){if(s.delayTime+=e.value,!(s.delayTime>=t.life.delay))return;n=!0,t.spawning=!1,s.delayTime=0,s.time=0}if(-1===s.duration)return;if(n?s.time=0:s.time+=e.value,s.time<s.duration)return;if(s.time=0,t.life.count>0&&t.life.count--,0===t.life.count)return void t.destroy();const o=q(0,i.width),a=q(0,i.width);t.position.x=H(o),t.position.y=H(a),t.spawning=!0,s.delayTime=0,s.time=0,t.reset();const l=t.options.life;l&&(s.delay=G(l.delay.value)*r,s.duration=G(l.duration.value)*r)}(t,e,this.#u.canvas.size)}}async function ds(t){t.checkVersion("4.3.0"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("life",t=>Promise.resolve(new hs(t)))})}class us{factor=4;value=!0;load(t){_(t)||(Zt(this,"factor",t.factor),Zt(this,"value",t.value))}}class ps{disable=!0;reduce=new us;load(t){_(t)||(Zt(this,"disable",t.disable),this.reduce.load(t.reduce))}}class fs{id="motion";async getPlugin(t){const{MotionPluginInstance:e}=await Promise.resolve().then(function(){return hn});return new e(t)}loadOptions(t,e,i){if(!this.needsPlugin())return;let s=e.motion;s?.load||(e.motion=s=new ps),s.load(i?.motion)}needsPlugin(){return!0}}async function gs(t){t.checkVersion("4.3.0"),await t.pluginManager.register(t=>{t.pluginManager.addPlugin(new fs)})}const ys=.5;function ms(t){return t.ribbonParticleDist??8}function vs(t){return t.ribbonOscillationSpeed??3}function bs(t){return t.ribbonOscillationDistance??40}function ws(t){const e=t.shapeData,i=Math.max(4,Math.round(G(e?.count??30))),s=G(e?.particleDist??8),n=G(e?.mass??1),o=G(e?.drag??.05),a=G(e?.velocityInherit??5),r=G(e?.oscillationSpeed??3),l=G(e?.oscillationDistance??40),c=G(e?.angle??45),h=Math.PI/180*c,d=C.create(t.position.x,t.position.y);if(!t.ribbonBounds)return;t.ribbonParticleDist=s,t.ribbonMass=n,t.ribbonDrag=o,t.ribbonVelocityInherit=a,t.ribbonOscillationSpeed=r,t.ribbonOscillationDistance=l,t.ribbonTime=100*F(),t.ribbonOffsets=C.create(Math.cos(h),Math.sin(h)),t.ribbonHead=d,t.ribbonPreviousHead=C.create(d.x,d.y),t.ribbonPreviousPosition=C.create(t.position.x,t.position.y);const u=t.velocity.angle+Math.PI,p=s*ys;t.ribbonPoints=new Array(i);for(let e=0;e<i;e++){const i=e*s,n=(F()-ys)*p,o=u+Math.PI*ys;t.ribbonPoints[e]={force:C.origin,position:C.create(d.x+Math.cos(u)*i+Math.cos(o)*n,d.y+Math.sin(u)*i+Math.sin(o)*n),velocity:C.origin}}}function Ps(t){const e=t.ribbonPoints,i=t.ribbonBounds,s=i?.x??0,n=i?.y??0,o=C.create(F()*s,-F()*n);if(i)if(e?.length){t.position.x=o.x,t.position.y=o.y,t.ribbonHead=C.create(o.x,o.y),t.ribbonPreviousHead=C.create(o.x,o.y),t.ribbonPreviousPosition=C.create(o.x,o.y),t.ribbonTime=100*F();for(let i=0;i<e.length;i++){const s=e[i];s&&(s.position=C.create(o.x,o.y-i*ms(t)),s.force=C.origin,s.velocity=C.origin)}}else ws(t)}function Ms(t,e,i){const s=t.ribbonPoints?.[e];s&&s.force.addTo(i)}function xs(t,e,i){const s=t.ribbonPoints?.[e];if(!s)return;const n=function(t){return t.ribbonMass??1}(t),o=function(t){return t.ribbonDrag??.05}(t),a=C.create(s.force.x,s.force.y),r=s.velocity.length,l=C.create(s.velocity.x,s.velocity.y);l.multTo(o*n*r),a.subFrom(l);const c=a.div(n);s.position.addTo(s.velocity.mult(i)),s.velocity.addTo(c.mult(i)),s.force=C.origin}function zs(t){const{particle:e,delta:i}=t,s=e.ribbonPoints,n=e.ribbonOffsets,o=e.ribbonBounds;if(!s?.length||!n||!o)return;const a=Math.min(.02,Math.max(i.value/1e3,1e-6)),r=function(t){return t.ribbonHead??=C.create(t.position.x,t.position.y),t.ribbonHead}(e),l=function(t){return t.ribbonPreviousHead??=C.create(t.position.x,t.position.y),t.ribbonPreviousHead}(e),c=function(t){return t.ribbonVelocityInherit??5}(e),h=e.options.move.enable;if(e.ribbonTime=(e.ribbonTime??0)+a*vs(e),h?(r.x=e.position.x+Math.cos(e.ribbonTime)*bs(e)/vs(e),r.y=e.position.y):r.x+=Math.cos(e.ribbonTime)*bs(e)*a,e.justWarped){const t=e.velocity.angle+Math.PI,i=ms(e),n=s[0];n&&(n.position=C.create(r.x,r.y),n.velocity=C.origin,n.force=C.origin);for(let e=1;e<s.length;e++){const n=s[e];if(!n)continue;const o=e*i;n.position=C.create(r.x+Math.cos(t)*o,r.y+Math.sin(t)*o),n.velocity=C.origin,n.force=C.origin}}const d=ms(e);if(!Number.isFinite(r.x)||!Number.isFinite(r.y))return void Ps(e);const u=s[0];if(!u)return;u.position=C.create(r.x,r.y);const p=l.x-r.x,f=l.y-r.y,g=Math.sqrt(p*p+f*f),y=Math.min(g/a*c,800);e.ribbonPreviousHead=C.create(r.x,r.y),e.ribbonPreviousPosition=C.create(e.position.x,e.position.y);for(let t=1;t<s.length;t++){const i=s[t],n=s[t-1];if(!i||!n)continue;const o=n.position.sub(i.position).copy();o.normalize(),o.multTo(y),Ms(e,t,o)}for(let t=1;t<s.length;t++)xs(e,t,a);for(let t=1;t<s.length;t++){const i=s[t],n=s[t-1];if(!i||!n)continue;const o=i.position.sub(n.position).copy();if(o.normalize(),o.multTo(d),i.position=n.position.add(o),!(Number.isFinite(i.position.x)&&Number.isFinite(i.position.y)&&Number.isFinite(i.velocity.x)&&Number.isFinite(i.velocity.y)))return void Ps(e)}}function Ss(t,e,i,s,n,o){return(t-i)*(o-s)-(e-s)*(n-i)}function Cs(t,e){return C.create((t.x+e.x)*ys,(t.y+e.y)*ys)}function Os(t,e){t.beginPath(),t.moveTo(e.a.x,e.a.y),t.lineTo(e.b.x,e.b.y),t.lineTo(e.c.x,e.c.y),e.d&&t.lineTo(e.d.x,e.d.y),t.closePath(),e.stroke&&t.stroke(),e.fill&&t.fill()}function Ds(t,e,i){!function(t,e,i){t.ribbonBounds=C.create(e,i)}(t,e,i),t.ribbonPoints?.length||ws(t)}function ks(t){return Math.max(4,Math.round(G(t.shapeData?.count??30)))}function Is(e,i,s,n,o,a){const{canvasSize:r,direction:l}=e;return l===t.OutModeDirection.bottom?n<=r.height+a:l===t.OutModeDirection.left?s>=-a:l===t.OutModeDirection.right?i<=r.width+a:l===t.OutModeDirection.top?o>=-a:s>=-a&&o>=-a&&i<=r.width+a&&n<=r.height+a}class Ts{#u;constructor(t){this.#u=t}draw(e){const i=this.#u.canvas.size;Ds(e.particle,i.width,i.height),e.particle.ribbonPoints&&e.particle.ribbonPoints.length!==ks(e.particle)&&ws(e.particle),zs(e),function(e,i){const{context:s,particle:n,radius:o}=e,a=n.ribbonPoints,r=n.ribbonOffsets,l=n.ribbonBounds,c=e.fill,h=e.stroke;if(!a||!r||!l||a.length<4||!c&&!h)return;const d=r.mult(o),u=n.position,p="string"==typeof s.fillStyle?s.fillStyle:"",f="string"==typeof s.strokeStyle?s.strokeStyle:"",g=n.shapeData;let y=h?f:p;if(g?.backColor)y=g.backColor;else if(g?.darken?.enable){const e=Ze(n.fillColor);e&&(y=Ye(ii(e,t.AlterType.darken,G(g.darken.value)),i))}else if(g?.enlighten?.enable){const e=Ze(n.fillColor);e&&(y=Ye(ii(e,t.AlterType.enlighten,G(g.enlighten.value)),i))}s.lineWidth=1,s.lineJoin="round",s.lineCap="round";for(let t=0;t<a.length-1;t++){const e=a[t],i=a[t+1];if(!e||!i)continue;const n=e.position.add(d),o=i.position.add(d),r=e.position.sub(u),f=i.position.sub(u),g=n.sub(u),m=o.sub(u),v=Math.min(e.position.y,i.position.y,n.y,o.y),b=Math.max(e.position.y,i.position.y,n.y,o.y),w=Ss(e.position.x,e.position.y,i.position.x,i.position.y,o.x,o.y)<0?p:y;v>l.y+d.length||b<-d.length||(s.fillStyle=w,h&&(s.strokeStyle=w),0===t?(Os(s,{a:r,b:f,c:Cs(f,m),fill:c,stroke:h}),Os(s,{a:m,b:g,c:Cs(f,m),fill:c,stroke:h})):t===a.length-2?(Os(s,{a:r,b:f,c:Cs(r,g),fill:c,stroke:h}),Os(s,{a:m,b:g,c:Cs(r,g),fill:c,stroke:h})):Os(s,{a:r,b:f,c:m,d:g,fill:c,stroke:h}))}s.fillStyle=p,h&&(s.strokeStyle=f),s.beginPath()}(e,this.#u.hdr)}getSidesCount(t){const e=t.ribbonPoints?.length;return e?Math.max(12,2*e):12}isInsideCanvas(e){const{outMode:i,particle:s,radius:n}=e,o=s.ribbonPoints,a=s.ribbonOffsets,r=s.position,l=i===t.OutMode.destroy||i===t.OutMode.out,c=(a?.length??0)*n,h=Math.max(n,c);if(!l)return Is(e,r.x-h,r.x+h,r.y-h,r.y+h,0);if(!o?.length||!a)return Is(e,r.x-h,r.x+h,r.y-h,r.y+h,0);let d=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,p=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY;for(const t of o){const e=t.position.x,i=t.position.y,s=e+a.x*n,o=i+a.y*n;d=Math.min(d,e,s),u=Math.max(u,e,s),p=Math.min(p,i,o),f=Math.max(f,i,o)}if(!(Number.isFinite(d)&&Number.isFinite(p)&&Number.isFinite(u)&&Number.isFinite(f)))return!1;const g=s.ribbonOscillationSpeed&&s.ribbonOscillationDistance?s.ribbonOscillationDistance/s.ribbonOscillationSpeed:0;return Is(e,d,u,p,f,Math.max(h,s.ribbonParticleDist??0)+g)}loadShape(t){if(!t.shapeData)return;const e=ks(t);t.ribbonPoints?.length&&t.ribbonPoints.length===e||ws(t)}particleDestroy(t){delete t.ribbonPoints,delete t.ribbonHead,delete t.ribbonPreviousHead,delete t.ribbonPreviousPosition,delete t.ribbonTime,delete t.ribbonOffsets,delete t.ribbonParticleDist,delete t.ribbonMass,delete t.ribbonDrag,delete t.ribbonVelocityInherit,delete t.ribbonOscillationSpeed,delete t.ribbonOscillationDistance}particleInit(t,e){Ds(e,t.canvas.size.width,t.canvas.size.height)}}async function _s(t){t.checkVersion("4.3.0"),await t.pluginManager.register(t=>{t.pluginManager.addShape(["ribbon"],t=>Promise.resolve(new Ts(t)))})}class Es{colors;count;disableForReducedMotion;emitterSize;positionX;ribbonOptions;scalar;zIndex;constructor(){this.count=5,this.emitterSize={width:100,height:0},this.positionX=50,this.colors=["#FF0055","#00D1FF","#FFD23F","#61FF7E","#B284FF"],this.ribbonOptions={angle:45,darken:{enable:!0,value:30},count:60,drag:.02,mass:1,oscillationDistance:{min:100,max:140},oscillationSpeed:{min:3,max:5},particleDist:8,velocityInherit:{min:4,max:6}},this.scalar=1,this.zIndex=100,this.disableForReducedMotion=!0}get origin(){return{x:this.positionX/o,y:0}}set origin(t){this.positionX=t.x*o}get particleCount(){return this.count}set particleCount(t){this.count=t}get position(){return{x:this.positionX,y:0}}set position(t){this.positionX=t.x}load(t){if(_(t))return;const e=t.count??t.particleCount;if(void 0!==e&&(this.count=e),t.emitterSize&&(void 0!==t.emitterSize.width&&(this.emitterSize.width=t.emitterSize.width),void 0!==t.emitterSize.height&&(this.emitterSize.height=t.emitterSize.height)),Zt(this,"positionX",t.positionX),void 0===t.positionX){const e=t.origin;e&&!t.position&&(t.position={x:void 0===e.x?void 0:e.x*o,y:0});const i=t.position;i&&void 0!==i.x&&(this.positionX=i.x)}void 0!==t.colors&&(T(t.colors)?this.colors=[...t.colors]:this.colors=t.colors),void 0!==t.ribbonOptions&&(this.ribbonOptions=gt({},t.ribbonOptions)),Zt(this,"scalar",t.scalar),Zt(this,"zIndex",t.zIndex),Zt(this,"disableForReducedMotion",t.disableForReducedMotion)}}const Rs=new Map;async function Ls(t,e){const i=new Es;i.load(e.options);let s=Rs.get(e.id);s instanceof Promise&&(await s,s=Rs.get(e.id));const n=s;if(n&&!n.destroyed){const t=n;if("addEmitter"in t)return await async function(t,e){await(t.addEmitter?.({startCount:e.count,position:{x:e.positionX,y:0},shape:{type:"square"},size:{width:e.emitterSize.width,height:e.emitterSize.height},rate:{delay:0,quantity:0},life:{duration:.1,count:1},particles:{paint:{fill:{color:{value:e.colors},enable:!0}},shape:{type:"ribbon",options:{ribbon:e.ribbonOptions}},life:{count:1},size:{value:8*e.scalar},move:{direction:"bottom",enable:!0,outModes:{top:"none",default:"destroy"},speed:{min:4,max:6}},roll:{enable:!1},rotate:{value:0,move:!1,animation:{enable:!1}},tilt:{enable:!1},wobble:{enable:!1}}}))}(t,i),n}const o=(async()=>{const s=function(t,e){return{fullScreen:{enable:!e.canvas,zIndex:t.zIndex},fpsLimit:120,particles:{number:{value:0},paint:{fill:{color:{value:t.colors},enable:!0}},shape:{type:"ribbon",options:{ribbon:t.ribbonOptions}},size:{value:8*t.scalar},links:{enable:!1},life:{count:1},move:{direction:"bottom",enable:!0,outModes:{top:"none",default:"destroy"},speed:{min:4,max:6}},roll:{enable:!1},rotate:{value:0,move:!1,animation:{enable:!1}},tilt:{enable:!1},wobble:{enable:!1}},motion:{disable:t.disableForReducedMotion},emitters:{name:"ribbons",startCount:t.count,position:{x:t.positionX,y:0},shape:{type:"square"},size:{width:t.emitterSize.width,height:t.emitterSize.height},rate:{delay:0,quantity:0},life:{duration:.1,count:1}}}}(i,e),n=await t.load({id:e.id,element:e.canvas,options:s});return Rs.set(e.id,n),n})();return Rs.set(e.id,o),o}let Fs=null;async function As(t){return Fs||(Fs=async function(t){t.checkVersion("4.3.0"),await t.pluginManager.register(async t=>{await Promise.all([Gi(t),gs(t),(async t=>{await es(t),await as(t)})(t),_s(t),ds(t)])})}(t),Fs)}async function Bs(t,e){let i,s;return await As(si),D(t)?(s=t,i=e??{}):(s="ribbons",i=t??{}),Ls(si,{id:s,options:i})}Bs.create=async(t,e={})=>{await As(si);const i=t?.getAttribute("id")??"ribbons";return t?.setAttribute("id",i),await Ls(si,{id:i,canvas:t??void 0,options:e}),async(s,n)=>{let o,a;return D(s)?(a=s,o=n??e):(a=i,o=s??{}),Ls(si,{id:a,canvas:t??void 0,options:o})}},Bs.init=async()=>{await As(si)},Bs.version="4.3.0",globalThis.ribbons=Bs;const Vs=globalThis;Vs.ribbons=Bs,Vs.tsParticles=si;function Us(t,e,i){const s=e[i];void 0!==s&&(t[i]=(t[i]??1)*s)}class Ns{#P;#M;#x;#z;#S;#u;#C;#O;#D;#k;#I;#T;#p;#_;#E;#R={};#L=[void 0,void 0];#F={};constructor(t,e,i){this.#p=t,this.#u=e,this.#z=i,this.#C=null,this.#P=null,this.#M=new Set,this.#E=[],this.#_=[],this.#x=[],this.#S=[],this.#D=[],this.#k=[],this.#I=[],this.#T={0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[]}}get settings(){return this.#O}canvasClear(){this.#u.actualOptions.clear&&this.draw(t=>{t.clearRect(l.x,l.y,this.#z.size.width,this.#z.size.height)})}clear(){for(const t of this.#x)if(t.canvasClear?.())return;for(const e of Object.values(t.DrawLayer))if("number"==typeof e)for(const t of this.#A(e))if(t.canvasClear?.())return;this.canvasClear()}destroy(){this.stop(),this.#P=null,this.#M.clear(),this.#E=[],this.#_=[],this.#x=[],this.#S=[],this.#D=[],this.#k=[],this.#I=[];for(const e of Object.values(t.DrawLayer))"number"==typeof e&&(this.#T[e]=[])}draw(t){const e=this.#C;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[o,a]=this.#B(t);if(o??=s,a??=n,!o&&!a)return;const r=this.#u,l=t.options.zIndex,c=1-t.zIndexFactor,{fillOpacity:h,opacity:d,strokeOpacity:u}=t.getOpacity(),p=this.#F,f=this.#R,g=o?Ye(o,r.hdr,h*d):void 0,y=a?Ye(a,r.hdr,u*d):g;p.a=p.b=p.c=p.d=void 0,f.fill=g,f.stroke=y,this.draw(s=>{for(const i of this.#I)i.drawParticleSetup?.(s,t,e);this.#V(s,t,i,d,f,p),this.#U({container:r,context:s,particle:t,delta:e,colorStyles:f,radius:i*c**l.sizeRate,opacity:d,transform:p}),this.#N(t);for(const i of this.#k)i.drawParticleCleanup?.(s,t,e)})}drawParticlePlugins(t,e){this.draw(i=>{for(const s of this.#D)this.#H(i,s,t,e)})}drawParticles(e){const{particles:i,actualOptions:s}=this.#u;this.clear(),i.update(e),this.draw(n=>{const o=this.#z.size.width,a=this.#z.size.height;if(this.#P)try{n.drawImage(this.#P,l.x,l.y,o,a)}catch{this.#G("background-element-draw-error","Error drawing background element onto canvas")}const r=s.background;if(r.draw)try{r.draw(n,e)}catch{this.#G("background-draw-error","Error in background.draw callback")}for(const e of this.#A(t.DrawLayer.BackgroundMask))e.canvasPaint?.();for(const i of this.#A(t.DrawLayer.CanvasSetup))i.drawSettingsSetup?.(n,e);for(const i of this.#A(t.DrawLayer.PluginContent))i.draw?.(n,e);i.drawParticles(e);for(const i of this.#A(t.DrawLayer.CanvasCleanup))i.clearDraw?.(n,e),i.drawSettingsCleanup?.(n,e)})}init(){this.initUpdaters(),this.initPlugins(),this.#W(),this.paint()}initPlugins(){this.#x=[],this.#S=[],this.#D=[],this.#I=[],this.#k=[];for(const e of Object.values(t.DrawLayer))"number"==typeof e&&(this.#T[e]=[]);for(const e of this.#u.plugins)(e.particleFillColor??e.particleStrokeColor)&&this.#S.push(e),e.drawParticle&&this.#D.push(e),e.drawParticleSetup&&this.#I.push(e),e.drawParticleCleanup&&this.#k.push(e),e.canvasClear&&this.#x.push(e),e.canvasPaint&&this.#A(t.DrawLayer.BackgroundMask).push(e),e.drawSettingsSetup&&this.#A(t.DrawLayer.CanvasSetup).push(e),e.draw&&this.#A(t.DrawLayer.PluginContent).push(e),(e.clearDraw??e.drawSettingsCleanup)&&this.#A(t.DrawLayer.CanvasCleanup).push(e)}initUpdaters(){this.#E=[],this.#_=[];for(const t of this.#u.particleUpdaters)t.afterDraw&&this.#_.push(t),(t.getColorStyles??t.getTransformValues??t.beforeDraw)&&this.#E.push(t)}paint(){let e=!1;for(const i of this.#A(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(l.x,l.y,this.#z.size.width,this.#z.size.height)})}paintImage(t,e){this.draw(i=>{if(!t)return;const s=i.globalAlpha;i.globalAlpha=e,i.drawImage(t,l.x,l.y,this.#z.size.width,this.#z.size.height),i.globalAlpha=s})}setContext(t){this.#C=t,this.#C&&(this.#C.globalCompositeOperation=i)}setContextSettings(t){this.#O=t}stop(){this.draw(t=>{t.clearRect(l.x,l.y,this.#z.size.width,this.#z.size.height)})}#N(t){for(const e of this.#_)e.afterDraw?.(t)}#V(t,e,i,s,n,o){for(const a of this.#E){if(a.getColorStyles){const{fill:o,stroke:r}=a.getColorStyles(e,t,i,s);o&&(n.fill=o),r&&(n.stroke=r)}if(a.getTransformValues){const t=a.getTransformValues(e);for(const e in t)Us(o,t,e)}a.beforeDraw?.(e)}}#$(t,e){if(!t?.drawAfter)return;const{particle:i}=e;i.effect&&t.drawAfter(e)}#q(t,e){if(!t?.drawBefore)return;const{particle:i}=e;i.effect&&t.drawBefore(e)}#U(t){const{container:e,context:i,particle:s,delta:n,colorStyles:o,radius:a,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),o.fill&&(i.fillStyle=o.fill);const f=!!s.fillEnabled,g=s.strokeWidth??0;i.lineWidth=g,o.stroke&&(i.strokeStyle=o.stroke);const y={context:i,particle:s,radius:a,drawRadius:1*a,opacity:r,delta:n,pixelRatio:e.retina.pixelRatio,fill:f,stroke:g>0,transformData:u,position:{...d},drawPosition:p,drawScale:1};for(const t of e.plugins)t.drawParticleTransform?.(y);const m=s.effect?c.get(s.effect):void 0,v=s.shape?h.get(s.shape):void 0;this.#q(m,y),this.#j(v,y),this.#X(v,y),this.#Y(v,y),this.#$(m,y),i.resetTransform()}#H(t,e,i,s){e.drawParticle&&e.drawParticle(t,i,s)}#X(t,e){if(!t)return;const{context:i,fill:s,particle:n,stroke:o}=e;n.shape&&(i.beginPath(),t.draw(e),n.shapeClose&&i.closePath(),s&&i.fill(),o&&i.stroke())}#Y(t,e){if(!t?.afterDraw)return;const{particle:i}=e;i.shape&&t.afterDraw(e)}#j(t,e){if(!t?.beforeDraw)return;const{particle:i}=e;i.shape&&t.beforeDraw(e)}#A(t){return this.#T[t]}#B(t){let e,i;for(const s of this.#S)if(!e&&s.particleFillColor&&(e=Ue(this.#p,s.particleFillColor(t))),!i&&s.particleStrokeColor&&(i=Ue(this.#p,s.particleStrokeColor(t))),e&&i)break;return this.#L[0]=e,this.#L[1]=i,this.#L}#W(){const t=this.#u.actualOptions.background;if(this.#P=null,t.element)if("string"==typeof t.element){if("undefined"!=typeof document){const e=document.querySelector(t.element);e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof HTMLImageElement?this.#P=e:e?this.#G("background-element-not-supported",`Background element "${t.element}" is not a supported drawable element (canvas, video, or img)`):this.#G("background-element-not-found",`Background element selector "${t.element}" not found`)}}else(t.element instanceof HTMLCanvasElement||t.element instanceof OffscreenCanvas||t.element instanceof HTMLVideoElement||t.element instanceof HTMLImageElement)&&(this.#P=t.element)}#G(t,e){this.#M.has(t)||(this.#M.add(t),Tt().warning(e))}}const Hs=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 Ws{domElement;render;renderCanvas;size;zoom=1;#u;#Q;#Z;#K;#p;#J;#tt;#et;#it;constructor(t,e){this.#p=t,this.#u=e,this.render=new Ns(t,e,this),this.#et={height:0,width:0};const i=e.retina.pixelRatio,s=this.#et;this.size={height:s.height*i,width:s.width*i},this.#Q=!1,this.#tt=[],this.#J="none"}get#st(){return this.#u.actualOptions.fullScreen.enable}destroy(){if(this.stop(),this.#Q){const t=this.domElement;t?.remove(),this.domElement=void 0,this.renderCanvas=void 0}else this.#nt();this.render.destroy(),this.#tt=[]}getZoomCenter(){const t=this.#u.retina.pixelRatio,{width:e,height:i}=this.size;return this.#it?this.#it:{x:e*a/t,y:i*a/t}}init(){this.#ot(t=>{t.disconnect()}),this.#Z=ct(t=>{for(const e of t)"attributes"===e.type&&"style"===e.attributeName&&this.#at()}),this.resize(),this.#rt(),this.initBackground(),this.#ot(t=>{const e=this.domElement;e&&e instanceof Node&&t.observe(e,{attributes:!0})}),this.initPlugins(),this.#lt(),this.render.init()}initBackground(){const t=this.#u,e=t.actualOptions.background,i=this.domElement;if(!i)return;const s=i.style,n=Be(this.#p,e.color);s.backgroundColor=n?Xe(n,t.actualOptions.hdr,e.opacity):"",s.backgroundImage=e.image||"",s.backgroundPosition=e.position||"",s.backgroundRepeat=e.repeat||"",s.backgroundSize=e.size||""}initPlugins(){this.#tt=[];for(const t of this.#u.plugins)t.resize&&this.#tt.push(t)}loadCanvas(t){this.#Q&&this.domElement&&this.domElement.remove();const i=(t=>"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement)(t)?t:void 0;this.domElement=i,this.#Q=!!i&&"true"===i.dataset[e],this.renderCanvas=i?(t=>{const e=Hs.get(t);if(e)return e;if("function"!=typeof t.transferControlToOffscreen)throw new TypeError("OffscreenCanvas is required but not supported by this browser");try{const e=t.transferControlToOffscreen();return Hs.set(t,e),e}catch{throw new TypeError("OffscreenCanvas transfer failed")}})(i):t;const s=this.domElement;s&&(s.ariaHidden="true",this.#K=bt(s.style));const n=this.#et,o=this.renderCanvas;s?(n.height=s.offsetHeight,n.width=s.offsetWidth):(n.height=o.height,n.width=o.width);const a=this.#u.retina.pixelRatio,r=this.size;o.height=r.height=n.height*a,o.width=r.width=n.width*a}resize(){const t=this.domElement;if(!t)return!1;const e=this.#u,i=this.renderCanvas;if(void 0===i)return!1;const s=e.canvas.#et,n={width:t.offsetWidth,height:t.offsetHeight},o=e.retina.pixelRatio,a={width:n.width*o,height:n.height*o};if(n.height===s.height&&n.width===s.width&&a.height===i.height&&a.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=a.width,i.height=l.height=a.height,this.#u.started&&e.particles.setResizeFactor({width:s.width/r.width,height:s.height/r.height}),!0}setPointerEvents(t){this.domElement&&(this.#J=t,this.#at())}setZoom(t,e){this.zoom=t,this.#it=e}stop(){this.#ot(t=>{t.disconnect()}),this.#Z=void 0,this.render.stop()}async windowResize(){if(!this.domElement||!this.resize())return;const t=this.#u,e=t.updateActualOptions();t.particles.setDensity(),this.#ct(),e&&await t.refresh()}#ct(){for(const t of this.#tt)t.resize?.()}#lt(){const t=this.#u.actualOptions.hdr&&lt("(color-gamut: p3)")?.matches&&lt("(dynamic-range: high)")?.matches;this.render.setContextSettings({alpha:!0,desynchronized:!0,willReadFrequently:!1,...t?{colorSpace:"display-p3",colorType:"float16"}:{colorSpace:"srgb"}});const e=this.renderCanvas;e&&this.render.setContext(e.getContext("2d",this.render.settings))}#rt(){const t=this.domElement,e=this.#u.actualOptions;if(t){this.#st?this.#ht():this.#nt();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")}}}#at(){const t=this.domElement;if(!t)return;this.#ot(t=>{t.disconnect()}),this.#rt(),this.initBackground();const e=this.#J;t.style.pointerEvents=e,t.style.setProperty("pointer-events",e),this.#ot(e=>{t instanceof Node&&e.observe(t,{attributes:!0})})}#nt(){const t=this.domElement,e=this.#K;t&&e&&Gs(t,e,!0)}#ot(t){this.#Z&&t(this.#Z)}#ht(){const t=this.domElement;t&&Gs(t,Mt(this.#u.actualOptions.fullScreen.zIndex),!0)}}class $s{#u;#dt;#ut;#pt;constructor(t){this.#u=t,this.#dt={visibilityChange:()=>{this.#ft()},resize:()=>{this.#gt()}}}addListeners(){this.#yt(!0)}removeListeners(){this.#yt(!1)}#ft(){const t=this.#u;t.actualOptions.pauseOnBlur&&(rt().hidden?(t.pageHidden=!0,t.pause()):(t.pageHidden=!1,t.animationStatus?t.play(!0):t.draw(!0)))}#gt(){this.#pt&&(clearTimeout(this.#pt),this.#pt=void 0);const t=async()=>{const t=this.#u.canvas;await t.windowResize()};this.#pt=setTimeout(()=>{t()},this.#u.actualOptions.resize.delay*r)}#yt(t){const e=this.#dt;this.#mt(t),xt(document,n,e.visibilityChange,t,!1)}#mt(t){const e=this.#dt,i=this.#u;if(!i.actualOptions.resize.enable)return;if("undefined"==typeof ResizeObserver)return void xt(globalThis,s,e.resize,t);const n=i.canvas.domElement;this.#ut&&!t?(n&&this.#ut.unobserve(n),this.#ut.disconnect(),this.#ut=void 0):!this.#ut&&t&&n&&(this.#ut=new ResizeObserver(t=>{t.find(t=>t.target===n)&&this.#gt()}),this.#ut.observe(n))}}function qs(t){if(!ht(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 js(t,e){const i=t%e;return i<0?i+e:i}function Xs(t,e,i,s){const n=Ee(i,e,e.actualOptions.particles),o=n.reduceDuplicates;t.effect=mt(n.effect.type,t.id,o),t.shape=mt(n.shape.type,t.id,o);const a=n.effect,r=n.shape;if(s){if(s.effect){const e=s.effect.type;if(e&&e!==t.effect){const i=mt(e,t.id,o);i&&(t.effect=i)}a.load(s.effect)}if(s.shape){const e=s.shape.type;if(e&&e!==t.shape){const i=mt(e,t.id,o);i&&(t.shape=i)}r.load(s.shape)}}if(t.effect===h){const i=[...e.effectDrawers.keys()];t.effect=i[Math.floor(F()*i.length)]}if(t.shape===h){const i=[...e.shapeDrawers.keys()];t.shape=i[Math.floor(F()*i.length)]}t.effectData=t.effect?function(t,e,i,s){const n=e.options[t];return gt({close:e.close},mt(n,i,s))}(t.effect,a,t.id,o):void 0,t.shapeData=t.shape?function(t,e,i,s){const n=e.options[t];return gt({close:e.close},mt(n,i,s))}(t.shape,r,t.id,o):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 Ys{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;#vt={fillOpacity:1,opacity:1,strokeOpacity:1};#bt=S.origin;#wt={sin:0,cos:0};#Pt={a:1,b:0,c:0,d:1};#u;#Mt=[];#p;constructor(t,e){this.#p=t,this.#u=e}addModifier(t){this.#Mt.push(t),this.#Mt.sort((t,e)=>t.priority-e.priority)}clearModifiers(){this.#Mt.length=0}destroy(e){if(this.unbreakable||this.destroyed)return;this.destroyed=!0,this.clearModifiers();const i=this.#u,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.#u.dispatchEvent(t.EventType.particleDestroyed,{particle:this})}draw(t){const e=this.#u.canvas.render;e.drawParticlePlugins(this,t),e.drawParticle(this,t)}getAngle(){return this.rotation+(this.pathRotation?this.velocity.angle:0)}getFillColor(){return this.#xt(this.#zt(Ze(this.fillColor),t=>t.fillColor))}getMass(){return this.getRadius()**2*Math.PI*a}getModifier(t){return this.#Mt.find(e=>e.id===t)}getOpacity(){const t=this.options.zIndex,e=(1-this.zIndexFactor)**t.opacityRate,i=G(this.opacity?.value??1),s=this.#zt(void 0,t=>t.opacity)??i,n=this.fillOpacity??1,o=this.strokeOpacity??1;return this.#vt.fillOpacity=s*n*e,this.#vt.opacity=s*e,this.#vt.strokeOpacity=s*o*e,this.#vt}getPosition(){return this.#bt.x=this.position.x+this.offset.x,this.#bt.y=this.position.y+this.offset.y,this.#bt.z=this.position.z,this.#bt}getRadius(){return this.#zt(this.size.value,t=>t.radius)}getRotateData(){const t=this.getAngle();return this.#wt.sin=Math.sin(t),this.#wt.cos=Math.cos(t),this.#wt}getStrokeColor(){return this.#xt(this.#zt(Ze(this.strokeColor),t=>t.strokeColor))}getTransformData(t){const e=this.getRotateData(),i=this.isRotating;return this.#Pt.a=e.cos*(t.a??c.a),this.#Pt.b=i?e.sin*(t.b??1):t.b??c.b,this.#Pt.c=i?-e.sin*(t.c??1):t.c??c.c,this.#Pt.d=e.cos*(t.d??c.d),this.#Pt}init(e,i,s,n){const o=this.#u;!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=Xs(this,o,this.#p,s),o.retina.initParticle(this),function(t,e){for(const i of t)i.preInit?.(e)}(o.particleUpdaters,this),this.#St(i),this.initialVelocity=this.#Ct(),this.velocity=this.initialVelocity.copy(),this.zIndexFactor=this.position.z/o.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,o),this.spawning=!1,function(t,e){for(const i of t)i.init(e)}(o.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)}(o,this),function(t,e){for(const i of t.particleCreatedPlugins)i.particleCreated?.(e)}(o,this)}isInsideCanvas(t){return this.#Ot({direction:t}).inside}isInsideCanvasForOutMode(t,e){return this.#Ot({direction:e,outMode:t}).inside}isShowingBack(){if(!this.roll)return!1;const t=this.roll.angle;if(this.roll.horizontal&&this.roll.vertical){const e=js(t,u);return e>=Math.PI*a&&e<3*Math.PI*a}if(this.roll.horizontal){const e=js(t+Math.PI*a,u);return e>=Math.PI&&e<2*Math.PI}if(this.roll.vertical){const e=js(t,u);return e>=Math.PI&&e<2*Math.PI}return!1}isVisible(){return!this.destroyed&&!this.spawning&&this.isInsideCanvas()}removeModifier(t){const e=this.#Mt.findIndex(e=>e.id===t);e>=0&&this.#Mt.splice(e,1)}reset(){for(const t of this.#u.particleUpdaters)t.reset?.(this)}#zt(t,e){let i=t;for(const t of this.#Mt)if(t.enabled){const s=e(t);void 0!==s&&(i=s)}return i}#Dt(t,e){let i=0,s=t?S.create(t.x,t.y,e):void 0;const n=this.#u,o=n.particlePositionPlugins,a=this.options.move.outModes,r=this.getRadius(),l=n.canvas.size;for(;;){for(const t of o){const i=t.particlePosition?.(s,this);if(i)return S.create(i.x,i.y,e)}const t=st({size:l,position:s}),c=S.create(t.x,t.y,e);this.#kt(c,r,a.left??a.default),this.#kt(c,r,a.right??a.default),this.#It(c,r,a.top??a.default),this.#It(c,r,a.bottom??a.default);let h=!0;for(const t of n.particles.checkParticlePositionPlugins)if(h=t.checkParticlePosition?.(this,c,i)??!0,!h)break;if(h)return c;i+=1,s=void 0}}#Ct(){const e=this.options.move,i=J(this.direction).copy();if(e.direction===t.MoveDirection.inside||e.direction===t.MoveDirection.outside)return i;const s=Z(G(e.angle.value)),n=Z(G(e.angle.offset)),o={left:n-s*a,right:n+s*a};return e.straight||(i.angle+=H(q(o.left,o.right))),e.random&&"number"==typeof e.speed&&(i.length*=F()),i}#kt(e,i,s){qs({outMode:s,checkModes:[t.OutMode.bounce],coord:e.x,maxCoord:this.#u.canvas.size.width,setCb:t=>e.x+=t,radius:i})}#It(e,i,s){qs({outMode:s,checkModes:[t.OutMode.bounce],coord:e.y,maxCoord:this.#u.canvas.size.height,setCb:t=>e.y+=t,radius:i})}#Tt(e,i){const s=this.getRadius(),n=this.#u.canvas.size,o=this.position,a=i===t.OutMode.bounce;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"}}#_t(t,e){return{canvasSize:this.#u.canvas.size,direction:t,outMode:e,particle:this,radius:this.getRadius()}}#Ot(t){const e=this.#Tt(t.direction,t.outMode),i=this.#u,s=this.shape?i.shapeDrawers.get(this.shape):void 0,n=this.effect?i.effectDrawers.get(this.effect):void 0,o=s?.isInsideCanvas,a=n?.isInsideCanvas;if(!o&&!a)return e;const r=this.#_t(t.direction,t.outMode),l=o?this.#Et(o(r),"shape"):void 0,c=a?this.#Et(a(r),"effect"):void 0;if(l&&c){const t=Math.max(l.margin??0,c.margin??0);return{inside:l.inside&&c.inside,margin:t>0?t:void 0,reason:"combined"}}return l??c??e}#xt(t){return t&&this.roll&&(this.backColor||this.roll.alter)&&this.isShowingBack()?this.backColor?this.backColor:this.roll.alter?ii(t,this.roll.alter.type,this.roll.alter.value):t:t}#St(e){const i=this.#u,s=Math.floor(G(this.options.zIndex.value)),n=this.#Dt(e,U(s,0,i.zLayers));if(!n)throw new Error("a valid position cannot be found for particle");this.position=n,this.initialPosition=this.position.copy();const o=i.canvas.size;switch(this.moveCenter={...vt(this.options.move.center,o),radius:this.options.move.center.radius,mode:this.options.move.center.mode},this.direction=K(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=C.origin}#Et(t,e){return"boolean"==typeof t?{inside:t,reason:e}:{inside:t.inside,margin:t.margin,reason:t.reason??e}}}class Qs{#Rt;#Lt=new Map;#Ft=[];#At;#Bt;#Vt=[];#Ut;constructor(t){this.#Rt=t,this.#At=0,this.#Ut=0}clear(){this.#Lt.clear();const t=this.#Bt;t&&(this.#Rt=t),this.#Bt=void 0}insert(t){const{x:e,y:i}=t.getPosition(),s=this.#Nt(e,i);this.#Lt.has(s)||this.#Lt.set(s,[]),this.#Lt.get(s)?.push(t)}query(t,e,i=[]){const s=this.#Ht(t);if(!s)return i;const n=Math.floor(s.minX/this.#Rt),o=Math.floor(s.maxX/this.#Rt),a=Math.floor(s.minY/this.#Rt),r=Math.floor(s.maxY/this.#Rt);for(let s=n;s<=o;s++)for(let n=a;n<=r;n++){const o=`${s}_${n}`,a=this.#Lt.get(o);if(a)for(const s of a)e&&!e(s)||t.contains(s.getPosition())&&i.push(s)}return i}queryCircle(t,e,i,s=[]){const n=this.#Gt(t.x,t.y,e),o=this.query(n,i,s);return this.#Wt(),o}queryRectangle(t,e,i,s=[]){const n=this.#$t(t.x,t.y,e.width,e.height),o=this.query(n,i,s);return this.#Wt(),o}setCellSize(t){this.#Bt=t}#Gt(t,e,i){return(this.#Ft[this.#At++]??=new jt(t,e,i)).reset(t,e,i)}#$t(t,e,i,s){return(this.#Vt[this.#Ut++]??=new Xt(t,e,i,s)).reset(t,e,i,s)}#Nt(t,e){return`${Math.floor(t/this.#Rt)}_${Math.floor(e/this.#Rt)}`}#Ht(t){if(t instanceof jt){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 Xt){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}#Wt(){this.#At=0,this.#Ut=0}}class Zs{checkParticlePositionPlugins;grid;#qt;#u;#jt;#Xt;#Yt;#Qt;#Zt;#Kt;#p;#Jt;#te;#ee;#ie;#se;#ne;constructor(t,e){this.#p=t,this.#u=e,this.#Yt=0,this.#qt=[],this.#Jt=[],this.#Xt=0,this.#jt=new Map,this.#Qt=new Map,this.#ne=this.#oe(this.#u.zLayers),this.grid=new Qs(100),this.checkParticlePositionPlugins=[],this.#Zt=[],this.#Kt=[],this.#ee=[],this.#te=[],this.#se=[]}get count(){return this.#qt.length}addParticle(e,i,s,n){const o=this.#u.actualOptions.particles.number.limit.mode,a=void 0===s?this.#Xt:this.#jt.get(s)??this.#Xt,r=this.count;if(a>0)switch(o){case t.LimitMode.delete:{const t=r+1-a;t>0&&this.removeQuantity(t);break}case t.LimitMode.wait:if(r>=a)return}try{const o=this.#Jt.pop()??new Ys(this.#p,this.#u);o.init(this.#Yt,e,i,s);let a=!0;return n&&(a=n(o)),a?(this.#qt.push(o),this.#ae(o),this.#Yt++,this.#u.dispatchEvent(t.EventType.particleAdded,{particle:o}),o):void this.#Jt.push(o)}catch(t){Tt().warning(`error adding particle: ${t}`)}}clear(){this.#qt=[],this.#Qt.clear(),this.#re(this.#u.zLayers)}destroy(){this.#qt=[],this.#Jt.length=0,this.#Qt.clear(),this.#ne=[],this.checkParticlePositionPlugins=[],this.#Zt=[],this.#Kt=[],this.#ee=[],this.#te=[],this.#se=[]}drawParticles(t){for(let e=this.#ne.length-1;e>=0;e--){const i=this.#ne[e];if(i)for(const e of i)e.draw(t)}}filter(t){return this.#qt.filter(t)}find(t){return this.#qt.find(t)}get(t){return this.#qt[t]}async init(){const t=this.#u,e=t.actualOptions;this.checkParticlePositionPlugins=[],this.#se=[],this.#Kt=[],this.#ee=[],this.#Zt=[],this.#te=[],this.#Qt.clear(),this.#re(t.zLayers),this.grid=new Qs(100*t.retina.pixelRatio);for(const e of t.plugins)e.redrawInit&&await e.redrawInit(),e.checkParticlePosition&&this.checkParticlePositionPlugins.push(e),e.update&&this.#se.push(e),e.particleUpdate&&this.#Kt.push(e),e.postUpdate&&this.#ee.push(e),e.particleReset&&this.#Zt.push(e),e.postParticleUpdate&&this.#te.push(e);await this.#u.initDrawersAndUpdaters();for(const e of this.#u.effectDrawers.values())await(e.init?.(t));for(const e of this.#u.shapeDrawers.values())await(e.init?.(t));let i=!1;for(const e of t.plugins)if(i=e.particlesInitialization?.()??i,i)break;if(!i){const t=e.particles,i=t.groups;for(const e in i){const s=i[e];if(s)for(let i=this.count,n=0;n<s.number.value&&i<t.number.value;i++,n++)this.addParticle(void 0,s,e)}for(let e=this.count;e<t.number.value;e++)this.addParticle()}}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.#u.canvas.render.drawParticles({value:0,factor:0})}remove(t,e,i){this.removeAt(this.#qt.indexOf(t),void 0,e,i)}removeAt(t,e=1,i,s){if(t<0||t>this.count)return;let n=0;for(let o=t;n<e&&o<this.count;o++)this.#le(o,i,s)&&(o--,n++)}removeQuantity(t,e){this.removeAt(0,t,e)}setDensity(){const t=this.#u.actualOptions,e=t.particles.groups;let i=0;for(const t of this.#u.plugins)t.particlesDensityCount&&(i+=t.particlesDensityCount());for(const t in e){const s=e[t];if(!s)continue;const n=Ee(this.#p,this.#u,s);this.#ce(n,i,t)}this.#ce(t.particles,i)}setResizeFactor(t){this.#ie=t}update(t){this.grid.clear();for(const e of this.#se)e.update?.(t);const e=this.#he(t);for(const e of this.#ee)e.postUpdate?.(t);if(this.#de(t,e),e.size)for(const t of e)this.remove(t);this.#ie=void 0}#ue(...t){this.#Jt.push(...t)}#ce(t,e,i,s){const n=t.number;if(!n.density.enable)return void(void 0===i?this.#Xt=n.limit.value:(s?.number.limit.value??n.limit.value)&&this.#jt.set(i,s?.number.limit.value??n.limit.value));const o=this.#pe(n.density),a=n.value,r=n.limit.value>0?n.limit.value:a,l=Math.min(a,r)*o+e,c=Math.min(this.count,this.filter(t=>t.group===i).length);void 0===i?this.#Xt=n.limit.value*o:this.#jt.set(i,n.limit.value*o),c<l?this.push(Math.abs(l-c),void 0,t,i):c>l&&this.removeQuantity(c-l,i)}#oe(t){const e=Math.max(Math.floor(t),1);return Array.from({length:e},()=>[])}#fe(t){const e=this.#ne.length-1;return e<=0?0:Math.min(Math.max(Math.floor(t),0),e)}#pe(t){const e=this.#u;if(!t.enable)return 1;const i=e.canvas.size,s=e.retina.pixelRatio;return i.width&&i.height?i.width*i.height/(t.height*t.width*s**2):1}#ae(t){const e=this.#fe(t.position.z),i=this.#ne[e];i&&(i.push(t),this.#Qt.set(t.id,e))}#le(e,i,s){const n=this.#qt[e];return!!n&&(n.group===i&&(this.#qt.splice(e,1),this.#ge(n),n.destroy(s),this.#u.dispatchEvent(t.EventType.particleRemoved,{particle:n}),this.#ue(n),!0))}#ge(t){const e=this.#Qt.get(t.id)??this.#fe(t.position.z),i=this.#ne[e];if(!i)return void this.#Qt.delete(t.id);const s=i.findIndex(e=>e.id===t.id);s>=0&&i.splice(s,1),this.#Qt.delete(t.id)}#re(t){const e=Math.max(Math.floor(t),1);if(this.#ne.length===e)for(const t of this.#ne)t.length=0;else this.#ne=this.#oe(e)}#ye(t){const e=this.#fe(t.position.z),i=this.#Qt.get(t.id);if(void 0===i)return void this.#ae(t);if(i===e)return;const s=this.#ne[i];if(s){const e=s.findIndex(e=>e.id===t.id);e>=0&&s.splice(e,1)}const n=this.#ne[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.#Qt.set(t.id,e)}else this.#Qt.set(t.id,e)}#he(t){const e=new Set,i=this.#ie;for(const s of this.#qt){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.#Zt)t.particleReset?.(s);for(const e of this.#Kt){if(s.destroyed)break;e.particleUpdate?.(s,t)}s.destroyed?e.add(s):this.grid.insert(s)}return e}#de(t,e){for(const i of this.#qt)if(i.destroyed)e.add(i);else{for(const e of this.#u.particleUpdaters)e.update(i,t);if(!i.spawning)for(const e of this.#te)e.postParticleUpdate?.(i,t);this.#ye(i)}}}class Ks{pixelRatio;reduceFactor;#u;constructor(t){this.#u=t,this.pixelRatio=1,this.reduceFactor=1}init(){const t=this.#u,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,o=t.retina;o.maxSpeed=G(s.gravity.maxSpeed)*i,o.moveDrift=G(s.drift)*i,o.moveSpeed=G(s.speed)*i;const a=o.maxDistance;a.horizontal=void 0===n.horizontal?void 0:n.horizontal*i,a.vertical=void 0===n.vertical?void 0:n.vertical*i}}function Js(t){return!t.destroyed}function tn(t,e,...i){const s=new Re(t,e);return Qt(s,...i),s}var en=Object.freeze({__proto__:null,Container:class{actualOptions;canvas;destroyed;effectDrawers;fpsLimit;hdr;id;pageHidden;particleCreatedPlugins;particleDestroyedPlugins;particlePositionPlugins;particleUpdaters;particles;plugins;retina;shapeDrawers;started;zLayers;#me;#ve;#be={value:0,factor:0};#we;#Pe;#Me;#xe;#ze;#Se;#Ce;#Oe;#De;#ke;#Ie;#p;#Te;#_e;constructor(e){const{dispatchCallback:i,pluginManager:s,id:n,onDestroy:o,sourceOptions:a}=e;this.#p=s,this.#we=i,this.#De=o,this.id=Symbol(n),this.fpsLimit=120,this.hdr=!1,this.#Te=!1,this.#me=0,this.#Me=0,this.#Oe=0,this.#ze=!0,this.started=!1,this.destroyed=!1,this.#Ie=!0,this.#Ce=0,this.zLayers=100,this.pageHidden=!1,this.#_e=a,this.#Se=a,this.effectDrawers=new Map,this.shapeDrawers=new Map,this.particleUpdaters=[],this.retina=new Ks(this),this.canvas=new Ws(this.#p,this),this.particles=new Zs(this.#p,this),this.plugins=[],this.particleDestroyedPlugins=[],this.particleCreatedPlugins=[],this.particlePositionPlugins=[],this.#ke=tn(this.#p,this),this.actualOptions=tn(this.#p,this),this.#xe=new $s(this),this.dispatchEvent(t.EventType.containerBuilt)}get animationStatus(){return!this.#Ie&&!this.pageHidden&&Js(this)}get options(){return this.#ke}get sourceOptions(){return this.#_e}addLifeTime(t){this.#Oe+=t}alive(){return!this.#Me||this.#Oe<=this.#Me}destroy(e=!0){if(Js(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.plugins.length=0,this.#p.clearPlugins(this),this.destroyed=!0,this.#De(e),this.dispatchEvent(t.EventType.containerDestroyed)}}dispatchEvent(t,e){this.#we(t,{container:this,data:e})}draw(t){if(!Js(this))return;let e=t;this.#Pe=B(t=>{e&&(this.#Ce=void 0,e=!1),this.#Ee(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}Tt().error(`Export plugin with type ${t} not found`)}async init(){if(!Js(this))return;const e=new Map;for(const t of this.#p.plugins){const i=await t.getPlugin(this);i.preInit&&await i.preInit(),e.set(t,i)}await this.initDrawersAndUpdaters(),this.#ke=tn(this.#p,this,this.#Se,this.sourceOptions),this.actualOptions=tn(this.#p,this,this.#ke),this.plugins.length=0,this.particleDestroyedPlugins.length=0,this.particleCreatedPlugins.length=0,this.particlePositionPlugins.length=0;for(const[t,i]of e)t.needsPlugin(this.actualOptions)&&(this.plugins.push(i),i.particleCreated&&this.particleCreatedPlugins.push(i),i.particleDestroyed&&this.particleDestroyedPlugins.push(i),i.particlePosition&&this.particlePositionPlugins.push(i));this.retina.init(),this.canvas.init(),this.updateActualOptions(),this.canvas.initBackground(),this.canvas.resize();const{delay:i,duration:s,fpsLimit:n,hdr:o,smooth:a,zLayers:l}=this.actualOptions;this.hdr=o,this.zLayers=l,this.#Me=G(s)*r,this.#me=G(i)*r,this.#Oe=0,this.fpsLimit=n>0?n:120,this.#Te=a;for(const t of this.plugins)await(t.init?.());await this.particles.init(),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.#p;this.effectDrawers=await t.getEffectDrawers(this,!0),this.shapeDrawers=await t.getShapeDrawers(this,!0),this.particleUpdaters=await t.getUpdaters(this,!0)}pause(){if(Js(this)&&(void 0!==this.#Pe&&(V(this.#Pe),this.#Pe=void 0),!this.#Ie)){for(const t of this.plugins)t.pause?.();this.pageHidden||(this.#Ie=!0),this.dispatchEvent(t.EventType.containerPaused)}}play(e){if(!Js(this))return;const i=this.#Ie||e;if(!this.#ze||this.actualOptions.autoPlay){if(this.#Ie&&(this.#Ie=!1),i)for(const t of this.plugins)t.play&&t.play();this.dispatchEvent(t.EventType.containerPlay),this.draw(i??!1)}else this.#ze=!1}async refresh(){if(Js(this))return this.stop(),this.start()}async reset(t){if(Js(this))return this.#Se=t,this.#_e=t,this.#ke=tn(this.#p,this,this.#Se,this.sourceOptions),this.actualOptions=tn(this.#p,this,this.#ke),this.refresh()}async start(){Js(this)&&!this.started&&(await this.init(),this.started=!0,await new Promise(e=>{const i=async()=>{this.#xe.addListeners();for(const t of this.plugins)await(t.start?.());this.dispatchEvent(t.EventType.containerStarted),this.play(),e()};this.#ve=setTimeout(()=>{i()},this.#me)}))}stop(){if(Js(this)&&this.started){this.#ve&&(clearTimeout(this.#ve),this.#ve=void 0),this.#ze=!0,this.started=!1,this.#xe.removeListeners(),this.pause(),this.particles.clear(),this.canvas.stop();for(const t of this.plugins)t.stop?.();this.particleCreatedPlugins.length=0,this.particleDestroyedPlugins.length=0,this.particlePositionPlugins.length=0,this.#_e=this.#ke,this.dispatchEvent(t.EventType.containerStopped)}}updateActualOptions(){let t=!1;for(const e of this.plugins)e.updateActualOptions&&(t=e.updateActualOptions()||t);return t}#Ee(t){try{if(!this.#Te&&void 0!==this.#Ce&&t<this.#Ce+r/this.fpsLimit)return void this.draw(!1);if(this.#Ce??=t,function(t,e,i=60,s=!1){t.value=e,t.factor=s?60/i:60*e/r}(this.#be,t-this.#Ce,this.fpsLimit,this.#Te),this.addLifeTime(this.#be.value),this.#Ce=t,this.#be.value>r)return void this.draw(!1);if(this.canvas.render.drawParticles(this.#be),!this.alive())return void this.destroy();this.animationStatus&&this.draw(!1)}catch(t){Tt().error("error in animation loop",t)}}}});var sn=Object.freeze({__proto__:null,BlendPluginInstance:class{layer=t.DrawLayer.CanvasSetup;#u;#Re;constructor(t){this.#u=t}drawParticleCleanup(t,e){e.options.blend?.enable&&(t.globalCompositeOperation=e.originalBlendMode??i,e.originalBlendMode=void 0)}drawParticleSetup(t,e){e.options.blend?.enable&&(e.originalBlendMode=t.globalCompositeOperation,t.globalCompositeOperation=e.options.blend.mode)}drawSettingsCleanup(t){this.#Re&&(t.globalCompositeOperation=this.#Re)}drawSettingsSetup(t){const e=t.globalCompositeOperation,i=this.#u.actualOptions.blend;this.#Re=e,t.globalCompositeOperation=i?.enable?i.mode:e}}});function nn(t,e,i,s,n,o,a){!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 o=t.pathGenerator?.generate(t,e);o&&t.velocity.addTo(o);s.clamp&&(t.velocity.x=U(t.velocity.x,-1,1),t.velocity.y=U(t.velocity.y,-1,1));t.lastPathTime-=n}(t,a);const r=t.gravity,l=r?.enable&&r.inverse?-1:1;n&&i&&(t.velocity.x+=n*a.factor/(60*i)),r?.enable&&i&&(t.velocity.y+=l*(r.acceleration*a.factor)/(60*i));const c=t.moveDecay;t.velocity.multTo(c??1);const h=t.velocity.mult(i);r?.enable&&s>0&&(!r.inverse&&h.y>=0&&h.y>=s||r.inverse&&h.y<=0&&h.y<=-s)&&(h.y=l*s,i&&(t.velocity.y=h.y/i));const d=t.options.zIndex,u=(1-t.zIndexFactor)**d.velocityRate;h.multTo(u),h.multTo(o);const{position:p}=t;p.addTo(h),e.vibrate&&(p.x+=Math.sin(p.x*Math.cos(p.y))*o,p.y+=Math.cos(p.y*Math.sin(p.x))*o)}var on=Object.freeze({__proto__:null,MovePluginInstance:class{availablePathGenerators;pathGenerators;#u;#p;constructor(t,e){this.#p=t,this.#u=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-G(i.decay),e.pathDelay=G(n.delay.value)*r,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:G(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},o={x:.01*n.x*e.canvas.size.width,y:.01*n.y*e.canvas.size.height},a=Y(i.getPosition(),o),r=G(s.acceleration);i.retina.spinAcceleration=r*e.retina.pixelRatio,i.spin={center:o,direction:i.velocity.x>=0?t.RotateDirection.clockwise:t.RotateDirection.counterClockwise,angle:F()*u,radius:a,acceleration:i.retina.spinAcceleration}}(this.#u,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.#u,o=function(t){const e=t.getModifier("slow");return e?.enabled?e.speedFactor??1:1}(e),r=n.retina.reduceFactor,l=e.retina.moveSpeed,c=e.retina.moveDrift,h=e.size.max,d=l*(s.size?e.getRadius()/h:1)*o*(i.factor||1)*a,u=e.retina.maxSpeed;s.spin.enable?function(e,i,s,n){if(!i.spin)return;const o=i.spin.direction===t.RotateDirection.clockwise,r={x:o?Math.cos:Math.sin,y:o?Math.sin:Math.cos};i.position.x=i.spin.center.x+i.spin.radius*r.x(i.spin.angle)*n,i.position.y=i.spin.center.y+i.spin.radius*r.y(i.spin.angle)*n,i.spin.radius+=i.spin.acceleration*n;const l=Math.max(e.canvas.size.width,e.canvas.size.height),c=l*a;i.spin.radius>c?(i.spin.radius=c,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/l)}(n,e,d,r):nn(e,s,d,u,c,r,i),function(t){const e=t.initialPosition,{dx:i,dy:s}=j(e,t.position),n=Math.abs(i),o=Math.abs(s),{maxDistance:r}=t.retina,l=r.horizontal,c=r.vertical;if(!l&&!c)return;if((l&&n>=l||c&&o>=c)&&!t.misplaced)t.misplaced=!!l&&n>l||!!c&&o>c,l&&(t.velocity.x=t.velocity.y*a-t.velocity.x),c&&(t.velocity.y=t.velocity.x*a-t.velocity.y);else if((!l||n<l)&&(!c||o<c)&&t.misplaced)t.misplaced=!1;else if(t.misplaced){const i=t.position,s=t.velocity;l&&(i.x<e.x&&s.x<0||i.x>e.x&&s.x>0)&&(s.x*=-F()),c&&(i.y<e.y&&s.y<0||i.y>e.y&&s.y>0)&&(s.y*=-F())}}(e)}preInit(){return this.#Le()}redrawInit(){return this.#Le()}update(){for(const t of this.pathGenerators.values())t.update()}async#Le(){const t=await(this.#p.getPathGenerators?.(this.#u,!0));if(t){this.availablePathGenerators=t,this.pathGenerators=new Map;for(const t of this.pathGenerators.values())t.init()}}}});var an=Object.freeze({__proto__:null,EmittersPluginInstance:class{#u;#w;constructor(t,e){this.#w=t,this.#u=e,this.#w.initContainer(e)}async init(){const t=this.#u.actualOptions.emitters;if(T(t))for(const e of t)await this.#w.addEmitter(this.#u,e);else await this.#w.addEmitter(this.#u,t)}pause(){for(const t of this.#w.getArray(this.#u))t.pause()}play(){for(const t of this.#w.getArray(this.#u))t.play()}resize(){for(const t of this.#w.getArray(this.#u))t.resize()}stop(){this.#w.clear(this.#u)}update(t){this.#w.getArray(this.#u).forEach(e=>{e.update(t)})}}});const rn=new Map;var ln=Object.freeze({__proto__:null,ShapeManager:class{addShapeGenerator(t,e){this.getShapeGenerator(t)||rn.set(t,e)}getShapeGenerator(t){return rn.get(t)}getSupportedShapeGenerators(){return rn.keys()}}});var cn=Object.freeze({__proto__:null,EmittersInstancesManager:class{#Fe;#p;constructor(t){this.#Fe=new Map,this.#p=t}async addEmitter(t,e,i){const s=new Qi;s.load(e);const{EmitterInstance:n}=await Promise.resolve().then(function(){return pn}),o=new n(this.#p,t,e=>{this.removeEmitter(t,e)},s,i);return await o.init(),this.getArray(t).push(o),o}clear(t){this.initContainer(t),this.#Fe.set(t,[])}getArray(t){this.initContainer(t);let e=this.#Fe.get(t);return e||(e=[],this.#Fe.set(t,e)),e}initContainer(t){this.#Fe.has(t)||(this.#Fe.set(t,[]),t.getEmitter=e=>{const i=this.getArray(t);return void 0===e||k(e)?i[e??0]:i.find(t=>t.name===e)},t.addEmitter=async(e,i)=>this.addEmitter(t,e,i),t.removeEmitter=e=>{const i=t.getEmitter?.(e);i&&this.removeEmitter(t,i)},t.playEmitter=e=>{const i=t.getEmitter?.(e);i&&i.externalPlay()},t.pauseEmitter=e=>{const i=t.getEmitter?.(e);i&&i.externalPause()})}removeEmitter(t,e){const i=this.getArray(t).indexOf(e);i>=0&&this.getArray(t).splice(i,1)}}});var hn=Object.freeze({__proto__:null,MotionPluginInstance:class{#u;constructor(t){this.#u=t}async init(){const t=this.#u,e=t.actualOptions.motion;if(!e||!e.disable&&!e.reduce.value)return void(t.retina.reduceFactor=1);const i=lt("(prefers-reduced-motion: reduce)");if(!i)return void(t.retina.reduceFactor=1);this.#Ae(i);i.addEventListener("change",()=>{(async()=>{this.#Ae(i);try{await t.refresh()}catch{}})()}),await Promise.resolve()}#Ae(t){const e=this.#u,i=e.actualOptions.motion;i&&(t.matches?i.disable?e.retina.reduceFactor=0:e.retina.reduceFactor=i.reduce.value?1/i.reduce.factor:1:e.retina.reduceFactor=1)}}});function dn(t,e,i,s){(t.paint??=new ze).fill={color:re.create(void 0,{value:e}),enable:s,opacity:i}}function un(t,e,i,s){(t.paint??=new ze).stroke={color:re.create(void 0,{value:e}),opacity:i,width:s}}var pn=Object.freeze({__proto__:null,EmitterInstance:class{fill;name;options;position;size;spawnFillColor;spawnFillEnabled;spawnFillOpacity;spawnStrokeColor;spawnStrokeOpacity;spawnStrokeWidth;#u;#Be;#Ve;#Ue;#Me;#Ne;#He;#Ge;#We;#$e;#Z;#qe;#Ie;#p;#je;#ut;#Xe;#Ye;#Qe;#Ze;constructor(e,i,s,n,a){this.#p=e,this.#u=i,this.#je=s,this.#Be=0,this.#Ve=0,this.#Ue=0,this.#We=a,n instanceof Qi?this.options=n:(this.options=new Qi,this.options.load(n)),this.#Qe=i.retina.reduceFactor?G(this.options.life.delay??0)*r/i.retina.reduceFactor:1/0,this.position=this.#We??this.#Dt(),this.name=this.options.name,this.fill=this.options.fill,this.#He=!this.options.life.wait,this.#Ze=!1;const l=gt({},this.options.particles);if(l.move??={},l.move.direction??=this.options.direction,this.options.spawn.fill?.color&&(this.spawnFillColor=Ue(this.#p,this.options.spawn.fill.color)),this.options.spawn.stroke?.color&&(this.spawnStrokeColor=Ue(this.#p,this.options.spawn.stroke.color)),this.#Ie=!this.options.autoPlay,this.#qe=l,this.#Ye=this.#Ke(),this.size=this.#Ye.mode===t.PixelMode.percent?{width:this.#Ye.width/o*this.#u.canvas.size.width,height:this.#Ye.height/o*this.#u.canvas.size.height}:{width:this.#Ye.width,height:this.#Ye.height},this.#$e=this.options.life.count??-1,this.#Ge=this.#$e<=0,this.options.domId){const t=rt().getElementById(this.options.domId);t&&(this.#Z=new MutationObserver(()=>{this.resize()}),this.#ut=new ResizeObserver(()=>{this.resize()}),this.#Z.observe(t,{attributes:!0,attributeFilter:["style","width","height"]}),this.#ut.observe(t))}const c=this.options.shape,h=this.#p.emitterShapeManager?.getShapeGenerator(c.type);h&&(this.#Xe=h.generate(this.#u,this.position,this.size,this.fill,c.options)),this.#u.dispatchEvent("emitterCreated",{emitter:this}),this.play()}externalPause(){this.#Ie=!0,this.pause()}externalPlay(){this.#Ie=!1,this.play()}async init(){await(this.#Xe?.init())}pause(){this.#Ie||(this.#Ne=void 0)}play(){if(this.#Ie)return;if(!(this.#$e>0||this.#Ge)&&this.options.life.count||!(this.#He||this.#Ue>=(this.#Qe??0)))return;const t=this.#u;if(void 0===this.#Ne){const e=G(this.options.rate.delay);this.#Ne=t.retina.reduceFactor?e*r/t.retina.reduceFactor:1/0}(this.#$e>0||this.#Ge)&&this.#Je()}resize(){const e=this.#We,i=this.#u;this.position=e&&ut(e,i.canvas.size,C.origin)?e:this.#Dt(),this.#Ye=this.#Ke(),this.size=this.#Ye.mode===t.PixelMode.percent?{width:this.#Ye.width/o*i.canvas.size.width,height:this.#Ye.height/o*i.canvas.size.height}:{width:this.#Ye.width,height:this.#Ye.height},this.#Xe?.resize(this.position,this.size)}update(t){if(this.#Ie)return;const e=this.#u;this.#He&&(this.#He=!1,this.#Ue=this.#Qe??0,this.#Ve=this.#Ne??0),this.#Ze||(this.#Ze=!0,this.#ti(this.options.startCount)),void 0!==this.#Me&&(this.#Be+=t.value,this.#Be>=this.#Me&&(this.pause(),void 0!==this.#Qe&&(this.#Qe=void 0),this.#Ge||this.#$e--,this.#$e>0||this.#Ge?(this.position=this.#Dt(),this.#Xe?.resize(this.position,this.size),this.#Qe=e.retina.reduceFactor?G(this.options.life.delay??0)*r/e.retina.reduceFactor:1/0):this.#ei(),this.#Be-=this.#Me,this.#Me=void 0)),void 0!==this.#Qe&&(this.#Ue+=t.value,this.#Ue>=this.#Qe&&(this.#u.dispatchEvent("emitterPlay"),this.play(),this.#Ue-=this.#Qe,this.#Qe=void 0)),void 0!==this.#Ne&&(this.#Ve+=t.value,this.#Ve>=this.#Ne&&(this.#ii(),this.#Ve-=this.#Ne))}#Dt(){const t=this.#u;if(this.options.domId){const e=rt().getElementById(this.options.domId);if(e){const i=e.getBoundingClientRect(),s=t.retina.pixelRatio;return{x:(i.x+i.width*a)*s,y:(i.y+i.height*a)*s}}}return it({size:t.canvas.size,position:this.options.position})}#Ke(){const e=this.#u;if(this.options.domId){const i=rt().getElementById(this.options.domId);if(i){const s=i.getBoundingClientRect();return{width:s.width*e.retina.pixelRatio,height:s.height*e.retina.pixelRatio,mode:t.PixelMode.precise}}}return this.options.size??(()=>{const e=new Xi;return e.load({height:0,mode:t.PixelMode.percent,width:0}),e})()}#ei(){this.#Z?.disconnect(),this.#Z=void 0,this.#ut?.disconnect(),this.#ut=void 0,this.#je(this),this.#u.dispatchEvent("emitterDestroyed",{emitter:this})}#ii(){if(this.#Ie)return;const t=G(this.options.rate.quantity);this.#ti(t)}#ti(t){const e=mt(this.#qe)??{},i=this.options.spawn.fill?.color?.animation,s=this.options.spawn.fill?.enable??!!this.options.spawn.fill?.color,n=void 0===this.options.spawn.fill?.opacity?1:G(this.options.spawn.fill.opacity),o=this.options.spawn.stroke?.color?.animation,a=void 0===this.options.spawn.stroke?.opacity?1:G(this.options.spawn.stroke.opacity),r=void 0===this.options.spawn.stroke?.width?1:G(this.options.spawn.stroke.width),l=this.#u.retina.reduceFactor,c=!!i,h=!!o,d=!!this.#Xe,u=c||h,p=u||d,f=u?{h:m,s:v,l:b}:null,g=this.options.shape;for(let c=0;c<t*l;c++){const t=p?gt({},e):e;this.spawnFillOpacity=n,this.spawnFillEnabled=s,this.spawnStrokeOpacity=a,this.spawnStrokeWidth=r,this.spawnFillColor&&(i&&f&&(this.spawnFillColor.h=this.#si(i.h,this.spawnFillColor.h,f.h,3.6),this.spawnFillColor.s=this.#si(i.s,this.spawnFillColor.s,f.s),this.spawnFillColor.l=this.#si(i.l,this.spawnFillColor.l,f.l)),dn(t,this.spawnFillColor,this.spawnFillOpacity,this.spawnFillEnabled)),this.spawnStrokeColor&&(o&&f&&(this.spawnStrokeColor.h=this.#si(o.h,this.spawnStrokeColor.h,f.h,3.6),this.spawnStrokeColor.s=this.#si(o.s,this.spawnStrokeColor.s,f.s),this.spawnStrokeColor.l=this.#si(o.l,this.spawnStrokeColor.l,f.l)),un(t,this.spawnStrokeColor,this.spawnStrokeOpacity,this.spawnStrokeWidth));let l=this.position;if(this.#Xe){const e=this.#Xe.randomPosition();if(e){l=e.position;const i=g.replace;i.color&&e.color&&dn(t,e.color,i.opacity?e.opacity??1:1,!0)}else l=null}l&&this.#u.particles.addParticle(l,t)}}#Je(){if(this.#Ie)return;const t=void 0!==this.options.life.duration?G(this.options.life.duration):void 0;(this.#$e>0||this.#Ge)&&void 0!==t&&t>0&&(this.#Me=t*r)}#si(t,e,i,s=1){const n=this.#u;if(!t.enable)return e;const o=H(t.offset),a=G(this.options.rate.delay),l=n.retina.reduceFactor?a*r/n.retina.reduceFactor:1/0;return(e+G(t.speed)*n.fpsLimit/l+o*s)%i}}});t.AnimatableColor=re,t.AnimationOptions=ie,t.AnimationValueWithRandom=me,t.Background=le,t.BaseRange=qt,t.Circle=jt,t.ColorAnimation=ne,t.Fill=ue,t.FullScreen=ce,t.HslAnimation=oe,t.Move=Me,t.MoveAngle=pe,t.MoveCenter=fe,t.MoveGravity=ge,t.MovePath=be,t.OptionLoader=Yt,t.Options=Re,t.OptionsColor=ae,t.OutModes=we,t.Paint=ze,t.ParticlesBounce=Ce,t.ParticlesBounceFactor=Se,t.ParticlesDensity=Oe,t.ParticlesNumber=ke,t.ParticlesNumberLimit=De,t.ParticlesOptions=_e,t.RangedAnimationOptions=se,t.RangedAnimationValueWithRandom=ve,t.Rectangle=Xt,t.ResizeEvent=he,t.Shape=Ie,t.Spin=Pe,t.Stroke=xe,t.ValueWithRandom=ye,t.Vector=C,t.Vector3d=S,t.ZIndex=Te,t.alterHsl=ii,t.animate=B,t.areBoundsInside=pt,t.calcExactPositionOrRandomFromSize=st,t.calcPositionFromSize=function(t){return void 0!==t.position?.x&&void 0!==t.position.y?{x:t.position.x*t.size.width/o,y:t.position.y*t.size.height/o}:void 0},t.calcPositionOrRandomFromSize=et,t.calcPositionOrRandomFromSizeRanged=it,t.calculateBounds=ft,t.cancelAnimation=V,t.canvasFirstIndex=0,t.canvasTag=g,t.checkDistance=Q,t.circleBounce=function(t,e){const{x:i,y:s}=t.velocity.sub(e.velocity),[n,o]=[t.position,e.position],{dx:a,dy:r}=j(o,n);if(i*a+s*r<0)return;const l=-Math.atan2(r,a),c=t.mass,h=e.mass,d=t.velocity.rotate(l),u=e.velocity.rotate(l),p=tt(d,u,c,h),f=tt(u,d,c,h),g=p.rotate(-l),y=f.rotate(-l);t.velocity.x=g.x*t.factor.x,t.velocity.y=g.y*t.factor.y,e.velocity.x=y.x*e.factor.x,e.velocity.y=y.y*e.factor.y},t.circleBounceDataFromParticle=function(t){return{position:t.getPosition(),radius:t.getRadius(),mass:t.getMass(),velocity:t.velocity,factor:C.create(G(t.options.bounce.horizontal.value),G(t.options.bounce.vertical.value))}},t.clamp=U,t.cloneStyle=bt,t.collisionVelocity=tt,t.colorMix=Qe,t.colorToRgb=Ve,t.countOffset=1,t.decayOffset=1,t.deepExtend=gt,t.defaultAlpha=1,t.defaultAngle=0,t.defaultCompositeValue=i,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=c,t.defaultTransformValue=1,t.defaultVelocity=0,t.defaultZoom=1,t.degToRad=Z,t.deleteCount=1,t.double=2,t.doublePI=u,t.empty=0,t.executeOnSingleOrMultiple=yt,t.generatedAttribute=e,t.generatedFalse=f,t.generatedTrue=p,t.getDistance=Y,t.getDistanceSq=X,t.getDistances=j,t.getFullScreenStyle=Mt,t.getHslAnimationFromHsl=Ke,t.getHslFromAnimation=Ze,t.getItemMapFromInitializer=St,t.getItemsFromInitializer=zt,t.getLinkColor=function(t,e,i){if(i===h)return je();if(i!==d)return i;{const i=t.getFillColor()??t.getStrokeColor(),s=e?.getFillColor()??e?.getStrokeColor();if(i&&s&&e)return Qe(i,s,t.getRadius(),e.getRadius());{const t=i??s;if(t)return We(t)}}},t.getLinkRandomColor=function(t,e,i,s){const n=D(e)?e:e.value;return n===h?s?Be(t,{value:n}):i?h:d:n===d?d:Be(t,{value:n})},t.getLogger=Tt,t.getParticleBaseVelocity=J,t.getParticleDirectionAngle=K,t.getPosition=vt,t.getRandom=F,t.getRandomFn=function(){return R},t.getRandomInRange=A,t.getRandomRgbColor=je,t.getRangeMax=$,t.getRangeMin=W,t.getRangeValue=G,t.getStyleFromHsl=Ye,t.getStyleFromRgb=Xe,t.hMax=m,t.hMin=0,t.hPhase=60,t.half=a,t.hslToRgb=We,t.hslToRgbFloat=$e,t.hslaToRgba=qe,t.identity=1,t.inverseFactorNumerator=1,t.isArray=T,t.isBoolean=O,t.isFunction=function(t){return"function"==typeof t},t.isInArray=ht,t.isNull=_,t.isNumber=k,t.isObject=I,t.isPointInside=ut,t.isString=D,t.itemFromArray=dt,t.itemFromSingleOrMultiple=mt,t.lFactor=1,t.lMax=b,t.lMin=0,t.lengthOffset=1,t.loadExtendProperty=function(t,e,i){void 0!==i&&(t[e]=gt(t[e]??{},i))},t.loadLazyProperty=te,t.loadMinIndex=0,t.loadNestedProperty=Jt,t.loadOptionProperty=ee,t.loadOptions=Qt,t.loadParticlesOptions=Ee,t.loadProperty=Zt,t.loadRandomFactor=1e4,t.loadRangeProperty=Kt,t.manageListener=xt,t.maxNits=M,t.midColorValue=d,t.millisecondsToSeconds=r,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=N,t.none=0,t.one=1,t.originPoint=l,t.parseAlpha=nt,t.percentDenominator=o,t.phaseNumerator=1,t.quarter=w,t.randomColorValue=h,t.randomInRangeValue=H,t.rangeColorToHsl=Ue,t.rangeColorToRgb=Be,t.removeDeleteCount=1,t.removeMinIndex=0,t.resizeEvent=s,t.rgbMax=y,t.rgbToHsl=Ne,t.ribbons=Bs,t.sMax=v,t.sMin=0,t.sNormalizedOffset=1,t.safeDocument=rt,t.safeMatchMedia=lt,t.safeMutationObserver=ct,t.setAnimationFunctions=function(t,e){L.nextFrame=t,L.cancel=e},t.setLogger=function(t){t.debug&&(It.debug=kt(t.debug)),t.error&&(It.error=kt(t.error)),t.info&&(It.info=kt(t.info)),t.log&&(It.log=kt(t.log)),t.trace&&(It.trace=kt(t.trace)),t.verbose&&(It.verbose=kt(t.verbose)),t.warning&&(It.warning=kt(t.warning))},t.setRandom=function(t=Math.random){R=t},t.setRangeValue=q,t.sextuple=6,t.spatialHashGridCellSize=100,t.squareExp=2,t.stringToAlpha=function(t,e){return Ae(t,e)?.a},t.stringToRgb=He,t.threeQuarter=P,t.triple=3,t.tryCountIncrement=1,t.tsParticles=si,t.updateColor=ei,t.updateColorValue=ti,t.visibilityChangeEvent=n,t.zIndexFactorOffset=1}),Object.assign(globalThis.window||globalThis,{loadExtendProperty:(globalThis.__tsParticlesInternals.bundles.ribbons||{}).loadExtendProperty,loadLazyProperty:(globalThis.__tsParticlesInternals.bundles.ribbons||{}).loadLazyProperty,loadMinIndex:(globalThis.__tsParticlesInternals.bundles.ribbons||{}).loadMinIndex,loadNestedProperty:(globalThis.__tsParticlesInternals.bundles.ribbons||{}).loadNestedProperty,loadOptionProperty:(globalThis.__tsParticlesInternals.bundles.ribbons||{}).loadOptionProperty,loadOptions:(globalThis.__tsParticlesInternals.bundles.ribbons||{}).loadOptions,loadParticlesOptions:(globalThis.__tsParticlesInternals.bundles.ribbons||{}).loadParticlesOptions,loadProperty:(globalThis.__tsParticlesInternals.bundles.ribbons||{}).loadProperty,loadRandomFactor:(globalThis.__tsParticlesInternals.bundles.ribbons||{}).loadRandomFactor,loadRangeProperty:(globalThis.__tsParticlesInternals.bundles.ribbons||{}).loadRangeProperty,tsParticles:(globalThis.__tsParticlesInternals.bundles.ribbons||{}).tsParticles}),globalThis.__tsParticlesInternals=globalThis.__tsParticlesInternals||{},globalThis.__tsParticlesInternals.engine&&globalThis.__tsParticlesInternals.engine.tsParticles||(globalThis.__tsParticlesInternals.engine=globalThis.__tsParticlesInternals.bundles.ribbons||{}),delete(globalThis.window||globalThis).tsparticlesInternalExports;
1
+ !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.ribbons=t.__tsParticlesInternals.bundles.ribbons||{}))}(this,function(t){"use strict";const e="generated",i="source-over",s="resize",n="visibilitychange",o=100,a=.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",f="false",g="canvas",y=255,m=360,v=100,b=100,w=.25,P=.75,M=400;var x;function z(t){return"z"in t?t.z:l.z}t.MoveDirection=void 0,(x=t.MoveDirection||(t.MoveDirection={})).bottom="bottom",x.bottomLeft="bottom-left",x.bottomRight="bottom-right",x.left="left",x.none="none",x.right="right",x.top="top",x.topLeft="top-left",x.topRight="top-right",x.outside="outside",x.inside="inside";class S{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 S.create(l.x,l.y,l.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 S.create(t.x,t.y,z(t))}static create(t,e,i){return"number"==typeof t?new S(t,e??l.y,i??l.z):new S(t.x,t.y,z(t))}add(t){return S.create(this.x+t.x,this.y+t.y,this.z+z(t))}addTo(t){this.x+=t.x,this.y+=t.y,this.z+=z(t)}copy(){return S.clone(this)}div(t){return S.create(this.x/t,this.y/t,this.z/t)}getLengthSq(){return this.x**2+this.y**2}mult(t){return S.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 S.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=z(t)}sub(t){return S.create(this.x-t.x,this.y-t.y,this.z-z(t))}subFrom(t){this.x-=t.x,this.y-=t.y,this.z-=z(t)}#t(t,e){this.x=Math.cos(t)*e,this.y=Math.sin(t)*e}}class C extends S{constructor(t=l.x,e=l.y){super(t,e,l.z)}static get origin(){return C.create(l.x,l.y)}static clone(t){return C.create(t.x,t.y)}static create(t,e){return"number"==typeof t?new C(t,e??l.y):new C(t.x,t.y)}}function O(t){return"boolean"==typeof t}function D(t){return"string"==typeof t}function k(t){return"number"==typeof t}function I(t){return"object"==typeof t&&null!==t}function T(t){return Array.isArray(t)}function _(t){return null==t}const E=Math.PI/180;let R=Math.random;const L={nextFrame:t=>requestAnimationFrame(t),cancel:t=>{cancelAnimationFrame(t)}};function F(){return U(R(),0,1-Number.EPSILON)}function A(t,e){return F()*(e-t)+t}function B(t){return L.nextFrame(t)}function V(t){L.cancel(t)}function U(t,e,i){return Math.min(Math.max(t,e),i)}function N(t,e,i,s){return Math.floor((t*i+e*s)/(i+s))}function H(t){const e=$(t);let i=W(t);return e===i&&(i=0),A(i,e)}function G(t){return k(t)?t:H(t)}function W(t){return k(t)?t:t.min}function $(t){return k(t)?t:t.max}function q(t,e){if(t===e||void 0===e&&k(t))return t;const i=W(t),s=$(t);return void 0!==e?{min:Math.min(i,e),max:Math.max(s,e)}:q(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 X(t,e){const i=t.x-e.x,s=t.y-e.y;return i*i+s*s}function Y(t,e){return Math.sqrt(X(t,e))}function Q(t,e,i){return X(t,e)<=i*i}function Z(t){return t*E}function K(e,i,s){if(k(e))return Z(e);switch(e){case t.MoveDirection.top:return-Math.PI*a;case t.MoveDirection.topRight:return-Math.PI*w;case t.MoveDirection.right:return 0;case t.MoveDirection.bottomRight:return Math.PI*w;case t.MoveDirection.bottom:return Math.PI*a;case t.MoveDirection.bottomLeft:return Math.PI*P;case t.MoveDirection.left:return Math.PI;case t.MoveDirection.topLeft:return-Math.PI*P;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 F()*u}}function J(t){const e=C.origin;return e.length=1,e.angle=t,e}function tt(t,e,i,s){return C.create(t.x*(i-s)/(i+s)+2*e.x*s/(i+s),t.y)}function et(t){return{x:(t.position?.x??F()*o)*t.size.width/o,y:(t.position?.y??F()*o)*t.size.height/o}}function it(t){const e={x:void 0!==t.position?.x?G(t.position.x):void 0,y:void 0!==t.position?.y?G(t.position.y):void 0};return et({size:t.size,position:e})}function st(t){const{position:e,size:i}=t;return{x:e?.x??F()*i.width,y:e?.y??F()*i.height}}function nt(t){return t?t.endsWith("%")?parseFloat(t)/o:parseFloat(t):1}var ot,at;t.OutModeDirection=void 0,(ot=t.OutModeDirection||(t.OutModeDirection={})).bottom="bottom",ot.left="left",ot.right="right",ot.top="top",t.PixelMode=void 0,(at=t.PixelMode||(t.PixelMode={})).precise="precise",at.percent="percent";function rt(t){return"__proto__"===t||"constructor"===t||"prototype"===t}function lt(){return globalThis.document}function ct(t){if("undefined"!=typeof matchMedia)return matchMedia(t)}function ht(t){if("undefined"!=typeof MutationObserver)return new MutationObserver(t)}function dt(t,e){return t===e||T(e)&&e.includes(t)}function ut(t,e,i=!0){return t[void 0!==e&&i?e%t.length:Math.floor(F()*t.length)]}function pt(t,e,i,s,n){return ft(gt(t,s??0),e,i,n)}function ft(e,i,s,n){let o=!0;return n&&n!==t.OutModeDirection.bottom||(o=e.top<i.height+s.x),!o||n&&n!==t.OutModeDirection.left||(o=e.right>s.x),!o||n&&n!==t.OutModeDirection.right||(o=e.left<i.width+s.y),!o||n&&n!==t.OutModeDirection.top||(o=e.bottom>s.y),o}function gt(t,e){return{bottom:t.y+e,left:t.x-e,right:t.x+e,top:t.y-e}}function yt(t,...e){for(const i of e){if(_(i))continue;if(!I(i)){t=i;continue}Array.isArray(i)?Array.isArray(t)||(t=[]):I(t)&&!Array.isArray(t)||(t=Object.create(null));const e=Object.keys(i);if(!e.some(t=>{const e=i[t];return I(e)||Array.isArray(e)})){const s=i,n=t;for(const t of e){if(rt(t))continue;const e=s[t];void 0!==e&&(n[t]=e)}continue}for(const s of e){if(rt(s))continue;const e=t,n=i[s];e[s]=Array.isArray(n)?n.map(t=>yt(void 0,t)):yt(e[s],n)}}return t}function mt(t,e){return T(t)?t.map((t,i)=>e(t,i)):e(t,0)}function vt(t,e,i){return T(t)?ut(t,e,i):t}function bt(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/o*i.width,y:e.y/o*i.height}:{width:e.width/o*i.width,height:e.height/o*i.height}}(e,i)}function wt(t){const e=lt().createElement("div").style;for(const i in t){const s=t[i];if(!(i in t)||_(s))continue;const n=t.getPropertyValue?.(s);if(!n)continue;const o=t.getPropertyPriority?.(s);o?e.setProperty(s,n,o):e.setProperty(s,n)}return e}let Pt,Mt;function xt(t){if(Pt!==t||!Mt){Pt=t;const e=lt().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)}Mt=e}return Mt}function zt(t,e,i,s,n){if(s){let s={passive:!0};O(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 St(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 Ct(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 Ot{#e;constructor(){this.#e=new Map}addEventListener(t,e){this.removeEventListener(t,e);let i=this.#e.get(t);i||(i=[],this.#e.set(t,i)),i.push(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):i.splice(n,1))}}var Dt;t.EventType=void 0,(Dt=t.EventType||(t.EventType={})).configAdded="configAdded",Dt.containerInit="containerInit",Dt.particlesSetup="particlesSetup",Dt.containerStarted="containerStarted",Dt.containerStopped="containerStopped",Dt.containerDestroyed="containerDestroyed",Dt.containerPaused="containerPaused",Dt.containerPlay="containerPlay",Dt.containerBuilt="containerBuilt",Dt.particleAdded="particleAdded",Dt.particleDestroyed="particleDestroyed",Dt.particleRemoved="particleRemoved";class kt{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;#i=new Set;#s=new Map;#n;#o=new Set;#a=!1;#r=!1;#l=new Set;constructor(t){this.#n=t}get configs(){const t={};for(const[e,i]of this.#s)t[e]=i;return t}addColorManager(t,e){this.colorManagers.set(t,e)}addConfig(e){const i=e.key??e.name??"default";this.#s.set(i,e),this.#n.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 Ct(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 Ct(t,this.shapeDrawers,this.initializers.shapes,e)}async getUpdaters(t,e=!1){return St(t,this.updaters,this.initializers.updaters,e)}async init(){if(!this.#a&&!this.#r){this.#r=!0,this.#o=new Set,this.#i=new Set(this.#l);try{for(const t of this.#i)await this.#c(t,this.#o,this.#i)}finally{this.#l.clear(),this.#r=!1,this.#a=!0}}}loadParticlesOptions(t,e,...i){const s=this.updaters.get(t);s&&s.forEach(t=>t.loadOptions?.(e,...i))}async register(...t){if(this.#a)throw new Error("Register plugins can only be done before calling tsParticles.load()");for(const e of t)this.#r?await this.#c(e,this.#o,this.#i):this.#l.add(e)}async#c(t,e,i){e.has(t)||(e.add(t),i.add(t),await t(this.#n))}}const It=t=>(...e)=>{t(...e)},Tt={debug:It(console.debug),error:(t,...e)=>{console.error(`tsParticles - Error - ${t}`,...e)},info:It(console.info),log:It(console.log),trace:It(console.trace),verbose:It(console.log),warning:It(console.warn)};function _t(){return Tt}const Et="100%";class Rt{pluginManager=new kt(this);#h=[];#d=new Ot;#a=!1;get items(){return this.#h}get version(){return"4.3.2"}addEventListener(t,e){this.#d.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.#d.dispatchEvent(t,e)}async init(){this.#a||(await this.pluginManager.init(),this.#a=!0)}item(t){const e=this.items,i=e[t];if(!i?.destroyed)return i;e.splice(t,1)}async load(t){let i;await this.init(),"undefined"!=typeof HTMLElement&&t.element instanceof HTMLElement&&(i=t.element);const{Container:s}=await Promise.resolve().then(function(){return sn}),n=t.id??i?.id??`tsparticles${Math.floor(1e4*F()).toString()}`,{index:o,url:a}=t,r=a?await async function(t){const e=vt(t.url,t.index);if(!e)return t.fallback;const i=await fetch(e);return i.ok?await i.json():(_t().error(`${i.status.toString()} while retrieving config file`),t.fallback)}({fallback:t.options,url:a,index:o}):t.options,l=vt(r,o),{items:c}=this,h=c.findIndex(t=>t.id.description===n),d=new s({dispatchCallback:(t,e)=>{this.dispatchEvent(t,e)},id:n,onDestroy:t=>{if(!t)return;const e=this.items,i=e.indexOf(d);i>=0&&e.splice(i,1)},pluginManager:this.pluginManager,sourceOptions:l});if(h>=0){const t=this.item(h),e=t?1:0;t&&!t.destroyed&&t.destroy(!1),c.splice(h,e,d)}else c.push(d);const u="undefined"!=typeof OffscreenCanvas&&t.element instanceof OffscreenCanvas?t.element:(t=>{const i=lt();let s;if(t instanceof HTMLCanvasElement||t.tagName.toLowerCase()===g)s=t,s.dataset[e]??=f,s.dataset[e]===p&&(s.style.width||=Et,s.style.height||=Et,s.style.pointerEvents="none",s.style.setProperty("pointer-events","none"));else{const n=t.getElementsByTagName(g).item(0);n?(s=n,s.dataset[e]=f):(s=i.createElement(g),s.dataset[e]=p,t.appendChild(s)),s.style.width||=Et,s.style.height||=Et,s.style.pointerEvents="none",s.style.setProperty("pointer-events","none")}return s})(((t,i)=>{const s=lt();let n=i??s.getElementById(t);return n||(n=s.createElement("canvas"),n.id=t,n.dataset[e]=p,s.body.append(n),n)})(n,i));return d.canvas.loadCanvas(u),await d.start(),d}async refresh(t=!0){t&&await Promise.all(this.items.map(t=>t.refresh()))}removeEventListener(t,e){this.#d.removeEventListener(t,e)}}var Lt,Ft,At,Bt,Vt,Ut,Nt,Ht,Gt,Wt,$t,qt;!function(t){t.circle="circle",t.rectangle="rectangle"}(Lt||(Lt={}));class jt{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 Xt extends jt{radius;constructor(t,e,i){super(t,e,Lt.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),o=Math.abs(i.y-e.y);if(t instanceof Xt||t.type===Lt.circle){return s+t.radius>Math.hypot(n,o)}if(t instanceof Yt||t.type===Lt.rectangle){const e=t,{width:i,height:a}=e.size;return Math.pow(n-i,2)+Math.pow(o-a,2)<=s**2||n<=s+i&&o<=s+a||n<=i||o<=a}return!1}reset(t,e,i){return this._resetPosition(t,e),this.radius=i,this}}class Yt extends jt{size;constructor(t,e,i,s){super(t,e,Lt.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 Xt)return t.intersects(this);if(!(t instanceof Yt))return!1;const e=this.size.width,i=this.size.height,s=this.position,n=t.position,o=t.size,a=o.width,r=o.height;return n.x<s.x+e&&n.x+a>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,(Ft=t.RotateDirection||(t.RotateDirection={})).clockwise="clockwise",Ft.counterClockwise="counter-clockwise",Ft.random="random",t.AnimationMode=void 0,(At=t.AnimationMode||(t.AnimationMode={})).auto="auto",At.increase="increase",At.decrease="decrease",At.random="random",t.LimitMode=void 0,(Bt=t.LimitMode||(t.LimitMode={})).delete="delete",Bt.wait="wait",t.OutMode=void 0,(Vt=t.OutMode||(t.OutMode={})).bounce="bounce",Vt.none="none",Vt.out="out",Vt.destroy="destroy",Vt.split="split",t.AlterType=void 0,(Ut=t.AlterType||(t.AlterType={})).darken="darken",Ut.enlighten="enlighten",t.DestroyType=void 0,(Nt=t.DestroyType||(t.DestroyType={})).none="none",Nt.max="max",Nt.min="min",t.GradientType=void 0,(Ht=t.GradientType||(t.GradientType={})).linear="linear",Ht.radial="radial",Ht.random="random",t.ParticleOutType=void 0,(Gt=t.ParticleOutType||(t.ParticleOutType={})).normal="normal",Gt.inside="inside",Gt.outside="outside",t.StartValueType=void 0,(Wt=t.StartValueType||(t.StartValueType={})).max="max",Wt.min="min",Wt.random="random",t.AnimationStatus=void 0,($t=t.AnimationStatus||(t.AnimationStatus={})).increasing="increasing",$t.decreasing="decreasing",t.DrawLayer=void 0,(qt=t.DrawLayer||(t.DrawLayer={}))[qt.BackgroundElement=0]="BackgroundElement",qt[qt.BackgroundDraw=1]="BackgroundDraw",qt[qt.BackgroundMask=2]="BackgroundMask",qt[qt.CanvasSetup=3]="CanvasSetup",qt[qt.PluginContent=4]="PluginContent",qt[qt.Particles=5]="Particles",qt[qt.CanvasCleanup=6]="CanvasCleanup",qt[qt.Foreground=7]="Foreground";class Qt{load(t){_(t)||this.doLoad(t)}}function Zt(t,...e){for(const i of e)t.load(i)}function Kt(t,e,i){void 0!==i&&(t[e]=i)}function Jt(t,e,i){void 0!==i&&(t[e]=q(i))}function te(t,e,i){void 0!==i&&t[e].load(i)}function ee(t,e,i,s){if(void 0!==i){const n=t;n[e]??=s(),n[e].load(i)}}function ie(t,e,i,...s){const n=t;n[e]??=new i;const o=n[e];for(const t of s)o.load(t?.[e])}class se extends Qt{count=0;decay=0;delay=0;enable=!1;speed=1;sync=!1;doLoad(t){Jt(this,"count",t.count),Kt(this,"enable",t.enable),Jt(this,"speed",t.speed),Jt(this,"decay",t.decay),Jt(this,"delay",t.delay),Kt(this,"sync",t.sync)}}class ne extends se{mode=t.AnimationMode.auto;startValue=t.StartValueType.random;doLoad(t){super.doLoad(t),Kt(this,"mode",t.mode),Kt(this,"startValue",t.startValue)}}class oe extends se{max;min;offset=0;sync=!0;constructor(t,e){super(),this.min=t,this.max=e}doLoad(t){super.doLoad(t),Kt(this,"max",t.max),Kt(this,"min",t.min),Jt(this,"offset",t.offset)}}class ae extends Qt{h=new oe(0,m);l=new oe(0,b);s=new oe(0,v);doLoad(t){this.h.load(t.h),this.s.load(t.s),this.l.load(t.l)}}class re extends Qt{value="";static create(t,e){const i=new re;return i.load(t),void 0!==e&&(D(e)||T(e)?i.load({value:e}):i.load(e)),i}doLoad(t){_(t.value)||(this.value=t.value)}}class le extends re{animation=new ae;static create(t,e){const i=new le;return i.load(t),void 0!==e&&(D(e)||T(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 ce extends Qt{color;draw;element;image="";opacity=1;position="";repeat="";size="";constructor(){super(),this.color=new re,this.color.value=""}doLoad(t){void 0!==t.color&&(this.color=re.create(this.color,t.color)),Kt(this,"element",t.element),Kt(this,"draw",t.draw),Kt(this,"image",t.image),Kt(this,"position",t.position),Kt(this,"repeat",t.repeat),Kt(this,"size",t.size),Kt(this,"opacity",t.opacity)}}class he extends Qt{enable=!0;zIndex=0;doLoad(t){Kt(this,"enable",t.enable),Kt(this,"zIndex",t.zIndex)}}class de extends Qt{delay=.5;enable=!0;doLoad(t){Kt(this,"delay",t.delay),Kt(this,"enable",t.enable)}}class ue extends Qt{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]=yt(this.options[t]??{},i))}Kt(this,"close",t.close),Kt(this,"type",t.type)}}class pe extends Qt{color;enable=!0;opacity=1;doLoad(t){void 0!==t.color&&(this.color=le.create(this.color,t.color)),Kt(this,"enable",t.enable),Jt(this,"opacity",t.opacity)}}class fe extends Qt{offset=0;value=90;doLoad(t){Jt(this,"offset",t.offset),Jt(this,"value",t.value)}}class ge extends Qt{mode=t.PixelMode.percent;radius=0;x=50;y=50;doLoad(t){Kt(this,"x",t.x),Kt(this,"y",t.y),Kt(this,"mode",t.mode),Kt(this,"radius",t.radius)}}class ye extends Qt{acceleration=9.81;enable=!1;inverse=!1;maxSpeed=50;doLoad(t){Jt(this,"acceleration",t.acceleration),Kt(this,"enable",t.enable),Kt(this,"inverse",t.inverse),Jt(this,"maxSpeed",t.maxSpeed)}}class me extends Qt{value=0;doLoad(t){_(t.value)||(this.value=q(t.value))}}class ve extends me{animation=new se;doLoad(t){super.doLoad(t),te(this,"animation",t.animation)}}class be extends ve{animation=new ne}class we extends Qt{clamp=!0;delay=new me;enable=!1;generator;options={};doLoad(t){Kt(this,"clamp",t.clamp),this.delay.load(t.delay),Kt(this,"enable",t.enable),this.generator=t.generator,t.options&&(this.options=yt(this.options,t.options))}}class Pe extends Qt{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 Me extends Qt{acceleration=0;enable=!1;position;doLoad(t){Jt(this,"acceleration",t.acceleration),Kt(this,"enable",t.enable),t.position&&(this.position=yt({},t.position))}}class xe extends Qt{angle=new fe;center=new ge;decay=0;direction=t.MoveDirection.none;distance={};drift=0;enable=!1;gravity=new ye;outModes=new Pe;path=new we;random=!1;size=!1;speed=2;spin=new Me;straight=!1;vibrate=!1;warp=!1;doLoad(t){this.angle.load(k(t.angle)?{value:t.angle}:t.angle),this.center.load(t.center),Jt(this,"decay",t.decay),Kt(this,"direction",t.direction),void 0!==t.distance&&(this.distance=k(t.distance)?{horizontal:t.distance,vertical:t.distance}:{...t.distance}),Jt(this,"drift",t.drift),Kt(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),Kt(this,"random",t.random),Kt(this,"size",t.size),Jt(this,"speed",t.speed),this.spin.load(t.spin),Kt(this,"straight",t.straight),Kt(this,"vibrate",t.vibrate),Kt(this,"warp",t.warp)}}class ze extends Qt{color;opacity;width=0;doLoad(t){void 0!==t.color&&(this.color=le.create(this.color,t.color)),Jt(this,"width",t.width),Jt(this,"opacity",t.opacity)}}class Se extends Qt{color;fill;stroke;doLoad(t){void 0!==t.color&&(this.color=le.create(this.color,t.color)),ee(this,"fill",t.fill,()=>new pe),ee(this,"stroke",t.stroke,()=>new ze)}}class Ce extends me{value=1}class Oe extends Qt{horizontal=new Ce;vertical=new Ce;doLoad(t){this.horizontal.load(t.horizontal),this.vertical.load(t.vertical)}}class De extends Qt{enable=!1;height=1080;width=1920;doLoad(t){Kt(this,"enable",t.enable),Kt(this,"width",t.width),Kt(this,"height",t.height)}}class ke extends Qt{mode=t.LimitMode.delete;value=0;doLoad(t){Kt(this,"mode",t.mode),Kt(this,"value",t.value)}}class Ie extends Qt{density=new De;limit=new ke;value=0;doLoad(t){this.density.load(t.density),this.limit.load(t.limit),Kt(this,"value",t.value)}}class Te extends Qt{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]=yt(this.options[t]??{},i))}Kt(this,"close",t.close),Kt(this,"type",t.type)}}class _e extends me{opacityRate=1;sizeRate=1;velocityRate=1;doLoad(t){super.doLoad(t),Kt(this,"opacityRate",t.opacityRate),Kt(this,"sizeRate",t.sizeRate),Kt(this,"velocityRate",t.velocityRate)}}class Ee extends Qt{bounce=new Oe;effect=new ue;groups={};move=new xe;number=new Ie;paint;palette;reduceDuplicates=!1;shape=new Te;zIndex=new _e;#u;#p;constructor(t,e){super(),this.#p=t,this.#u=e,this.paint=new Se,this.paint.color=new le,this.paint.color.value="#fff",this.paint.fill=new pe,this.paint.fill.enable=!0}doLoad(t){if(t.palette&&(this.palette=t.palette,this.#f(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]=yt(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&&(T(e)?this.paint=mt(e,t=>{const e=new Se;return e.load(t),e}):T(this.paint)?(this.paint=new Se,this.paint.load(e)):this.paint.load(e)),this.shape.load(t.shape),this.zIndex.load(t.zIndex),this.#u){for(const e of this.#p.plugins)e.loadParticlesOptions&&e.loadParticlesOptions(this.#u,this,t);const e=this.#p.updaters.get(this.#u);if(e)for(const i of e)i.loadOptions&&i.loadOptions(this,t)}}#f(t){const e=this.#p.getPalette(t);if(!e)return;const i=e.colors,s=(T(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 Re(t,e,...i){const s=new Ee(t,e);return Zt(s,...i),s}class Le extends Qt{autoPlay=!0;background;clear=!0;defaultThemes={};delay=0;detectRetina=!0;duration=0;fpsLimit=120;fullScreen;hdr=!0;key;name;palette;particles;pauseOnBlur=!0;pauseOnOutsideViewport=!0;preset;resize;smooth=!1;style={};zLayers=100;#u;#p;constructor(t,e){super(),this.#p=t,this.#u=e,this.background=new ce,this.fullScreen=new he,this.particles=Re(this.#p,this.#u),this.resize=new de}doLoad(t){void 0!==t.preset&&(this.preset=t.preset,mt(this.preset,t=>{this.#g(t)})),void 0!==t.palette&&(this.palette=t.palette,this.#f(this.palette)),Kt(this,"autoPlay",t.autoPlay),Kt(this,"clear",t.clear),Kt(this,"key",t.key),Kt(this,"name",t.name),Jt(this,"delay",t.delay),Kt(this,"detectRetina",t.detectRetina),Jt(this,"duration",t.duration),Kt(this,"fpsLimit",t.fpsLimit),Kt(this,"hdr",t.hdr),Kt(this,"pauseOnBlur",t.pauseOnBlur),Kt(this,"pauseOnOutsideViewport",t.pauseOnOutsideViewport),Kt(this,"zLayers",t.zLayers),this.background.load(t.background);const e=t.fullScreen;O(e)?this.fullScreen.enable=e:this.fullScreen.load(e),this.particles.load(t.particles),this.resize.load(t.resize),this.style=yt(this.style,t.style),Kt(this,"smooth",t.smooth),this.#p.plugins.forEach(e=>{e.loadOptions(this.#u,this,t)})}#f(t){const e=this.#p.getPalette(t);e&&this.load({background:{color:e.background},blend:{enable:!0,mode:e.blendMode},particles:{palette:t}})}#g(t){this.load(this.#p.getPreset(t))}}const Fe=new Map;function Ae(t,e){let i=Fe.get(t);return i||(i=e(),Fe.size>2e3&&Fe.clear(),Fe.set(t,i)),i}function Be(t,e){if(e)for(const i of t.colorManagers.values())if(i.accepts(e))return i.parseString(e)}function Ve(t,e,i,s=!0){if(!e)return;const n=D(e)?{value:e}:e;if(D(n.value))return Ue(t,n.value,i,s);if(T(n.value)){const e=ut(n.value,i,s);if(!e)return;return Ve(t,{value:e})}for(const e of t.colorManagers.values()){const t=e.handleRangeColor(n);if(t)return t}}function Ue(t,e,i,s=!0){if(!e)return;const n=D(e)?{value:e}:e;if(D(n.value))return n.value===h?Xe():Ge(t,n.value);if(T(n.value)){const e=ut(n.value,i,s);if(!e)return;return Ue(t,{value:e})}for(const e of t.colorManagers.values()){const t=e.handleColor(n);if(t)return t}}function Ne(t,e,i,s=!0){const n=Ve(t,e,i,s);return n?He(n):void 0}function He(t){const e=t.r/y,i=t.g/y,s=t.b/y,n=Math.max(e,i,s),o=Math.min(e,i,s),r={h:0,l:(n+o)*a,s:0};return n!==o&&(r.s=r.l<a?(n-o)/(n+o):(n-o)/(2-n-o),r.h=e===n?(i-s)/(n-o):i===n?2+(s-e)/(n-o):4+(e-i)/(n-o)),r.l*=b,r.s*=v,r.h*=60,r.h<0&&(r.h+=m),r.h>=m&&(r.h-=m),r}function Ge(t,e){return Be(t,e)}function We(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 $e(t){const e=(t.h%m+m)%m,i=Math.max(0,Math.min(v,t.s)),s=Math.max(0,Math.min(b,t.l)),n=e/m,o=i/v,r=s/b;if(0===i){const t=Math.round(r*y);return{r:t,g:t,b:t}}const l=r<a?r*(1+o):r+o-r*o,c=2*r-l,h=1/3,d=Math.min(y,y*We(c,l,n+h)),u=Math.min(y,y*We(c,l,n)),p=Math.min(y,y*We(c,l,n-h));return{r:Math.round(d),g:Math.round(u),b:Math.round(p)}}function qe(t){const e=(t.h%m+m)%m,i=Math.max(0,Math.min(v,t.s)),s=Math.max(0,Math.min(b,t.l)),n=e/m,o=i/v,r=s/b;if(0===i){const t=r*y;return{r:t,g:t,b:t}}const l=r<a?r*(1+o):r+o-r*o,c=2*r-l,h=1/3;return{r:Math.min(y,y*We(c,l,n+h)),g:Math.min(y,y*We(c,l,n)),b:Math.min(y,y*We(c,l,n-h))}}function je(t){const e=$e(t);return{a:t.a,b:e.b,g:e.g,r:e.r}}function Xe(t,e){const i=t??0;if(e)return{r:A(i,y),g:A(i,y),b:A(i,y)};const s=()=>Math.floor(A(i,256));return{b:s(),g:s(),r:s()}}function Ye(t,e,i){const s=e?4:2,n=i??1;return Ae(`rgb-${t.r.toFixed(s)}-${t.g.toFixed(s)}-${t.b.toFixed(s)}-${e?"hdr":"sdr"}-${n.toString()}`,()=>e?function(t,e,i=400){const s=i/203;return`color(display-p3 ${(t.r/y*s).toString()} ${(t.g/y*s).toString()} ${(t.b/y*s).toString()} / ${(e??1).toString()})`}(t,i):function(t,e){return`rgba(${t.r.toString()}, ${t.g.toString()}, ${t.b.toString()}, ${(e??1).toString()})`}(t,i))}function Qe(t,e,i){const s=e?4:2,n=i??1;return Ae(`hsl-${t.h.toFixed(s)}-${t.s.toFixed(s)}-${t.l.toFixed(s)}-${e?"hdr":"sdr"}-${n.toString()}`,()=>e?Ye(qe(t),!0,i):`hsla(${t.h.toString()}, ${t.s.toString()}%, ${t.l.toString()}%, ${n.toString()})`)}function Ze(t,e,i,s){let n=t,o=e;return"r"in n||(n=$e(t)),"r"in o||(o=$e(e)),{b:N(n.b,o.b,i,s),g:N(n.g,o.g,i,s),r:N(n.r,o.r,i,s)}}function Ke(t){return void 0===t?void 0:{h:t.h.value,s:t.s.value,l:t.l.value}}function Je(t,e,i){const s={h:{enable:!1,value:t.h,min:0,max:m},s:{enable:!1,value:t.s,min:0,max:v},l:{enable:!1,value:t.l,min:0,max:b}};return e&&(ti(s.h,e.h,i),ti(s.s,e.s,i),ti(s.l,e.l,i)),s}function ti(e,i,s){e.enable=i.enable,e.min=i.min,e.max=i.max,e.enable?(e.velocity=G(i.speed)/o*s,e.decay=1-G(i.decay),e.status=t.AnimationStatus.increasing,e.loops=0,e.maxLoops=G(i.count),e.time=0,e.delayTime=G(i.delay)*r,i.sync||(e.velocity*=F(),e.value*=F()),e.initialValue=e.value,e.offset=q(i.offset)):e.velocity=0}function ei(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 o=e.offset?H(e.offset):0,a=((e.velocity??0)*s.factor+3.6*o)*(n?.5075:1),r=e.decay??1,l=e.max,c=e.min;i&&e.status!==t.AnimationStatus.increasing?(e.value-=a,e.value<c&&(e.loops??=0,e.loops++,e.status=t.AnimationStatus.increasing)):(e.value+=a,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=U(e.value,c,l)}function ii(t,e,i){if(!t)return;const{h:s,s:n,l:o}=t;ei(s,!1,e,i),ei(n,!0,e,i),ei(o,!0,e,i)}function si(e,i,s){return{h:e.h,s:e.s,l:e.l+(i===t.AlterType.darken?-1:1)*s}}const ni=new Rt;class oi{enable=!1;mode="destination-out";load(t){_(t)||(Kt(this,"mode",t.mode),Kt(this,"enable",t.enable))}}class ai{id="blend";async getPlugin(t){const{BlendPluginInstance:e}=await Promise.resolve().then(function(){return nn});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 oi),s.load(i?.blend)}loadParticlesOptions(t,e,i){e.blend??=new oi,e.blend.load(i?.blend)}needsPlugin(t){return!!t?.blend?.enable||!!t?.particles?.blend?.enable}}async function ri(t){t.checkVersion("4.3.2"),await t.pluginManager.register(t=>{t.pluginManager.addPlugin(new ai)})}class li{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:Z(s.min),max:Z(s.max)}:{min:0,max:Z(s)}}}async function ci(t){t.checkVersion("4.3.2"),await t.pluginManager.register(t=>{t.pluginManager.addShape(["circle"],()=>Promise.resolve(new li))})}var hi;!function(t){t[t.r=1]="r",t[t.g=2]="g",t[t.b=3]="b",t[t.a=4]="a"}(hi||(hi={}));const di=/^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i,ui=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i;class pi{accepts(t){return t.startsWith("#")}handleColor(t){return this.#y(t.value)}handleRangeColor(t){return this.#y(t.value)}parseString(t){return this.#y(t)}#y(t){if("string"!=typeof t||!this.accepts(t))return;const e=t.replace(di,(t,e,i,s,n)=>e+e+i+i+s+s+(void 0===n?"":n+n)),i=ui.exec(e);return i?{a:i[hi.a]?Number.parseInt(i[hi.a],16)/255:1,b:Number.parseInt(i[hi.b]??"0",16),g:Number.parseInt(i[hi.g]??"0",16),r:Number.parseInt(i[hi.r]??"0",16)}:void 0}}async function fi(t){t.checkVersion("4.3.2"),await t.pluginManager.register(t=>{t.pluginManager.addColorManager("hex",new pi)})}var gi;!function(t){t[t.h=1]="h",t[t.s=2]="s",t[t.l=3]="l",t[t.a=5]="a"}(gi||(gi={}));const yi=/hsla?\(\s*(\d+)\s*[\s,]\s*(\d+)%\s*[\s,]\s*(\d+)%\s*([\s,]\s*(0|1|0?\.\d+|(\d{1,3})%)\s*)?\)/i;class mi{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 $e(e)}handleRangeColor(t){const e=t.value.hsl??t.value;if("h"in e&&"s"in e&&"l"in e)return $e({h:G(e.h),l:G(e.l),s:G(e.s)})}parseString(t){if(!this.accepts(t))return;const e=yi.exec(t);return e?je({a:e.length>4?nt(e[gi.a]):1,h:Number.parseInt(e[gi.h]??"0",10),l:Number.parseInt(e[gi.l]??"0",10),s:Number.parseInt(e[gi.s]??"0",10)}):void 0}}async function vi(t){t.checkVersion("4.3.2"),await t.pluginManager.register(t=>{t.pluginManager.addColorManager("hsl",new mi)})}class bi{id="move";#p;constructor(t){this.#p=t}async getPlugin(t){const{MovePluginInstance:e}=await Promise.resolve().then(function(){return an});return new e(this.#p,t)}loadOptions(){}needsPlugin(){return!0}}async function wi(t){t.checkVersion("4.3.2"),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,Ct(t,e.pathGenerators,e.initializers.pathGenerators,i)),t.pluginManager.addPlugin(new bi(t.pluginManager))})}function Pi(e,i){const s=e.value,n=e.animation,o={delayTime:G(n.delay)*r,enable:n.enable,value:G(e.value)*i,max:$(s)*i,min:W(s)*i,loops:0,maxLoops:G(n.count),time:0};if(n.enable){switch(o.decay=1-G(n.decay),n.mode){case t.AnimationMode.increase:o.status=t.AnimationStatus.increasing;break;case t.AnimationMode.decrease:o.status=t.AnimationStatus.decreasing;break;case t.AnimationMode.random:o.status=F()>=a?t.AnimationStatus.increasing:t.AnimationStatus.decreasing}const e=n.mode===t.AnimationMode.auto;switch(n.startValue){case t.StartValueType.min:o.value=o.min,e&&(o.status=t.AnimationStatus.increasing);break;case t.StartValueType.max:o.value=o.max,e&&(o.status=t.AnimationStatus.decreasing);break;case t.StartValueType.random:default:o.value=H(o),e&&(o.status=F()>=a?t.AnimationStatus.increasing:t.AnimationStatus.decreasing)}}return o.initialValue=o.value,o}function Mi(e,i,s,n,o){if(e.destroyed||!i.enable||(i.maxLoops??0)>0&&(i.loops??0)>(i.maxLoops??0))return;const a=(i.velocity??0)*o.factor,r=i.min,l=i.max,c=i.decay??1;i.time??=0;const h=i.delayTime??0;if(!(h>0&&i.time<h&&(i.time+=o.value,i.time<h))){switch(i.status){case t.AnimationStatus.increasing:i.value+=a;break;case t.AnimationStatus.decreasing:i.value-=a}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,o){switch(i){case t.DestroyType.max:s>=o&&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))}}class xi extends ne{destroy=t.DestroyType.none;load(t){super.load(t),_(t)||Kt(this,"destroy",t.destroy)}}class zi extends be{animation=new xi;value=1;load(t){if(_(t))return;super.load(t);const e=t.animation;void 0!==e&&this.animation.load(e)}}class Si{#u;constructor(t){this.#u=t}init(t){const e=t.options.opacity;if(!e)return;t.opacity=Pi(e,1);const i=e.animation;i.enable&&(t.opacity.velocity=G(i.speed)/o*this.#u.retina.reduceFactor,i.sync||(t.opacity.velocity*=F()))}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){ie(t,"opacity",zi,...e)}reset(t){t.opacity&&(t.opacity.time=0,t.opacity.loops=0)}update(t,e){this.isEnabled(t)&&t.opacity&&t.options.opacity&&Mi(t,t.opacity,0,t.options.opacity.animation.destroy,e)}}async function Ci(t){t.checkVersion("4.3.2"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("opacity",t=>Promise.resolve(new Si(t)))})}class Oi{modes;#u;#m;constructor(e){this.#u=e,this.modes=[t.OutMode.bounce,t.OutMode.split],this.#m=e.plugins.filter(t=>void 0!==t.particleBounce)}update(e,i,s,n){if(!this.modes.includes(n))return;const o=this.#u;let a=!1;for(const t of this.#m)if(a=t.particleBounce?.(e,s,i)??!1,a)break;if(a)return;const r=e.getPosition(),l=e.offset,c=e.getRadius(),h=gt(r,c),d=o.canvas.size,u=!e.isInsideCanvasForOutMode(n,i);!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.outOfCanvas&&(e.direction===t.OutModeDirection.right&&i>0||e.direction===t.OutModeDirection.left&&i<0)){const t=G(e.particle.options.bounce.horizontal.value);e.particle.velocity.x*=-t,s=!0}if(!s)return;const n=e.offset.x+e.size;e.outOfCanvas&&e.direction===t.OutModeDirection.right?e.particle.position.x=e.canvasSize.width-n:e.outOfCanvas&&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,outOfCanvas:u,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.outOfCanvas&&(e.direction===t.OutModeDirection.bottom&&i>0||e.direction===t.OutModeDirection.top&&i<0)){const t=G(e.particle.options.bounce.vertical.value);e.particle.velocity.y*=-t,s=!0}if(!s)return;const n=e.offset.y+e.size;e.outOfCanvas&&e.direction===t.OutModeDirection.bottom?e.particle.position.y=e.canvasSize.height-n:e.outOfCanvas&&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,outOfCanvas:u,size:c})}}class Di{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{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 ki{modes;#u;constructor(e){this.#u=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 o=e.options.move.gravity,a=this.#u,r=a.canvas.size,c=e.getRadius();if(o.enable){const s=e.position;(!o.inverse&&s.y>r.height+c&&i===t.OutModeDirection.bottom||o.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;pt(e.position,a.canvas.size,l,c,i)||e.destroy()}}}const Ii=C.origin;class Ti{modes;#u;constructor(e){this.#u=e,this.modes=[t.OutMode.out]}update(e,i,s,n){if(!this.modes.includes(n))return;const o=this.#u;switch(e.outType){case t.ParticleOutType.inside:{const{x:t,y:i}=e.velocity;Ii.setTo(l),Ii.length=e.moveCenter.radius,Ii.angle=e.velocity.angle+Math.PI,Ii.addTo(e.moveCenter);const{dx:s,dy:n}=j(e.position,Ii);if(t<=0&&s>=0||i<=0&&n>=0||t>=0&&s<=0||i>=0&&n<=0)return;e.position.x=Math.floor(H({min:0,max:o.canvas.size.width})),e.position.y=Math.floor(H({min:0,max:o.canvas.size.height}));const{dx:a,dy:r}=j(e.position,e.moveCenter);e.direction=Math.atan2(-r,-a),e.velocity.angle=e.direction,e.justWarped=!0;break}default:if(e.isInsideCanvasForOutMode(n,i))return;switch(e.outType){case t.ParticleOutType.outside:{e.position.x=Math.floor(H({min:-e.moveCenter.radius,max:e.moveCenter.radius}))+e.moveCenter.x,e.position.y=Math.floor(H({min:-e.moveCenter.radius,max:e.moveCenter.radius}))+e.moveCenter.y;const{dx:t,dy:i}=j(e.position,e.moveCenter);e.moveCenter.radius&&(e.direction=Math.atan2(i,t),e.velocity.angle=e.direction),e.justWarped=!0;break}case t.ParticleOutType.normal:{const s=e.options.move.warp,n=o.canvas.size,a={bottom:n.height+e.getRadius()+e.offset.y,left:-e.getRadius()-e.offset.x,right:n.width+e.getRadius()+e.offset.x,top:-e.getRadius()-e.offset.y},r=e.getRadius(),l=gt(e.position,r);i===t.OutModeDirection.right&&l.left>n.width+e.offset.x?(e.position.x=a.left,e.initialPosition.x=e.position.x,s||(e.position.y=F()*n.height,e.initialPosition.y=e.position.y),e.justWarped=!0):i===t.OutModeDirection.left&&l.right<-e.offset.x&&(e.position.x=a.right,e.initialPosition.x=e.position.x,s||(e.position.y=F()*n.height,e.initialPosition.y=e.position.y),e.justWarped=!0),i===t.OutModeDirection.bottom&&l.top>n.height+e.offset.y?(s||(e.position.x=F()*n.width,e.initialPosition.x=e.position.x),e.position.y=a.top,e.initialPosition.y=e.position.y,e.justWarped=!0):i===t.OutModeDirection.top&&l.bottom<-e.offset.y&&(s||(e.position.x=F()*n.width,e.initialPosition.x=e.position.x),e.position.y=a.bottom,e.initialPosition.y=e.position.y,e.justWarped=!0);break}}}}}class _i{updaters;#u;constructor(t){this.#u=t,this.updaters=new Map}init(e){this.#v(e,t.OutMode.bounce,t=>new Oi(t)),this.#v(e,t.OutMode.out,t=>new Ti(t)),this.#v(e,t.OutMode.destroy,t=>new Di(t)),this.#v(e,t.OutMode.none,t=>new ki(t))}isEnabled(t){return!t.destroyed&&!t.spawning}update(e,i){const s=e.options.move.outModes;e.justWarped=!1,this.#b(e,i,s.bottom??s.default,t.OutModeDirection.bottom),this.#b(e,i,s.left??s.default,t.OutModeDirection.left),this.#b(e,i,s.right??s.default,t.OutModeDirection.right),this.#b(e,i,s.top??s.default,t.OutModeDirection.top)}#v(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.#u))}#b(t,e,i,s){for(const n of this.updaters.values())n.update(t,s,e,i)}}async function Ei(t){t.checkVersion("4.3.2"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("outModes",t=>Promise.resolve(new _i(t)))})}class Ri{#u;#p;constructor(t,e){this.#u=e,this.#p=t}init(t){const e=this.#u,i=t.options,s=vt(i.paint,t.id,i.reduceDuplicates),n=s?.color,o=n??void 0,a=s?.fill,r=s?.stroke;if(a){const i=le.create(void 0===o?void 0:le.create(void 0,o),a.color);t.fillEnabled=a.enable,t.fillOpacity=G(a.opacity),t.fillAnimation=i.animation;const s=Ne(this.#p,i);s&&(t.fillColor=Je(s,t.fillAnimation,e.retina.reduceFactor))}else t.fillEnabled=!1,t.fillAnimation=void 0,t.fillColor=void 0,t.fillOpacity=1;if(r){const i=le.create(void 0===o?void 0:le.create(void 0,o),r.color);t.strokeWidth=G(r.width)*e.retina.pixelRatio,t.strokeOpacity=G(r.opacity??1),t.strokeAnimation=i.animation;const s=Ne(this.#p,i)??t.getFillColor();s&&(t.strokeColor=Je(s,t.strokeAnimation,e.retina.reduceFactor))}else t.strokeAnimation=void 0,t.strokeColor=void 0,t.strokeOpacity=1,t.strokeWidth=0}isEnabled(t){const{fillAnimation:e,fillColor:i,strokeAnimation:s,strokeColor:n}=t,o=!!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),a=!!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&&(o||a)}update(t,e){this.isEnabled(t)&&(ii(t.fillColor,e,this.#u.hdr),ii(t.strokeColor,e,this.#u.hdr))}}async function Li(t){t.checkVersion("4.3.2"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("paint",e=>Promise.resolve(new Ri(t.pluginManager,e)))})}var Fi;!function(t){t[t.r=1]="r",t[t.g=2]="g",t[t.b=3]="b",t[t.a=5]="a"}(Fi||(Fi={}));const Ai=/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 Bi{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:G(e.r),g:G(e.g),b:G(e.b)}}parseString(t){if(!this.accepts(t))return;const e=Ai.exec(t);return e?{a:e.length>4?nt(e[Fi.a]):1,b:parseInt(e[Fi.b]??"0",10),g:parseInt(e[Fi.g]??"0",10),r:parseInt(e[Fi.r]??"0",10)}:void 0}}async function Vi(t){t.checkVersion("4.3.2"),await t.pluginManager.register(t=>{t.pluginManager.addColorManager("rgb",new Bi)})}class Ui extends ne{destroy=t.DestroyType.none;load(t){super.load(t),_(t)||Kt(this,"destroy",t.destroy)}}class Ni extends be{animation=new Ui;value=3;load(t){if(super.load(t),_(t))return;const e=t.animation;void 0!==e&&this.animation.load(e)}}class Hi{#u;constructor(t){this.#u=t}init(t){const e=this.#u,i=t.options.size;if(!i)return;const s=i.animation;s.enable&&(t.size.velocity=t.retina.sizeAnimationSpeed/o*e.retina.reduceFactor,s.sync||(t.size.velocity*=F()))}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){ie(t,"size",Ni,...e)}preInit(t){const e=this.#u.retina.pixelRatio,i=t.options.size;i&&(t.size=Pi(i,e),t.retina.sizeAnimationSpeed=G(i.animation.speed)*e)}reset(t){t.size.time=0,t.size.loops=0}update(t,e){this.isEnabled(t)&&t.options.size&&Mi(t,t.size,0,t.options.size.animation.destroy,e)}}async function Gi(t){t.checkVersion("4.3.2"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("size",t=>Promise.resolve(new Hi(t)))})}async function Wi(t){t.checkVersion("4.3.2"),await t.pluginManager.register(async t=>{await Promise.all([ri(t),fi(t),vi(t),Vi(t),wi(t),ci(t),Li(t),Ci(t),Ei(t),Gi(t)])})}class $i{count;delay;duration;wait=!1;load(t){_(t)||(Kt(this,"count",t.count),Jt(this,"delay",t.delay),Jt(this,"duration",t.duration),Kt(this,"wait",t.wait))}}class qi{delay=.1;quantity=1;load(t){_(t)||(Jt(this,"quantity",t.quantity),Jt(this,"delay",t.delay))}}class ji{color=!1;opacity=!1;load(t){_(t)||(Kt(this,"color",t.color),Kt(this,"opacity",t.opacity))}}class Xi{options={};replace=new ji;type="square";load(t){_(t)||(void 0!==t.options&&(this.options=yt({},t.options??{})),this.replace.load(t.replace),Kt(this,"type",t.type))}}class Yi{height=0;mode=t.PixelMode.percent;width=0;load(t){_(t)||(Kt(this,"mode",t.mode),Kt(this,"height",t.height),Kt(this,"width",t.width))}}class Qi{fill;stroke;load(t){_(t)||(t.fill&&(this.fill??=new pe,this.fill.load(t.fill)),t.stroke&&(this.stroke??=new ze,this.stroke.load(t.stroke)))}}class Zi{autoPlay=!0;direction;domId;fill=!0;life=new $i;name;particles;position;rate=new qi;shape=new Xi;size;spawn=new Qi;spawnFillColor;spawnStrokeColor;startCount=0;load(t){_(t)||(Kt(this,"autoPlay",t.autoPlay),void 0!==t.size&&(this.size??=new Yi,this.size.load(t.size)),Kt(this,"direction",t.direction),Kt(this,"domId",t.domId),Kt(this,"fill",t.fill),this.life.load(t.life),Kt(this,"name",t.name),this.particles=mt(t.particles,t=>yt({},t)),this.rate.load(t.rate),this.shape.load(t.shape),this.spawn.load(t.spawn),void 0!==t.position&&(this.position={},void 0!==t.position.x&&(this.position.x=q(t.position.x)),void 0!==t.position.y&&(this.position.y=q(t.position.y))),void 0!==t.spawnFillColor&&(this.spawnFillColor??=new le,this.spawnFillColor.load(t.spawnFillColor)),void 0!==t.spawnStrokeColor&&(this.spawnStrokeColor??=new le,this.spawnStrokeColor.load(t.spawnStrokeColor)),Kt(this,"startCount",t.startCount))}}class Ki{id="emitters";#w;constructor(t){this.#w=t}async getPlugin(t){const{EmittersPluginInstance:e}=await Promise.resolve().then(function(){return rn});return new e(this.#w,t)}loadOptions(t,e,i){(this.needsPlugin(e)||this.needsPlugin(i))&&i?.emitters&&(e.emitters=mt(i.emitters,t=>{const e=new Zi;return e.load(t),e}))}needsPlugin(t){if(!t)return!1;const e=t.emitters;return T(e)&&!!e.length||void 0!==e}}const Ji=new WeakMap;class ts{fill;options;position;size;constructor(t,e,i,s){this.position=t,this.size=e,this.fill=i,this.options=s}resize(t,e){this.position=t,this.size=e}}var es;async function is(t){t.checkVersion("4.3.2"),await t.pluginManager.register(async t=>{const e=await function(t){const e=t.pluginManager;let i=Ji.get(e);return i||(i=Promise.resolve().then(function(){return hn}).then(({EmittersInstancesManager:t})=>new t(e)).catch(t=>{throw Ji.delete(e),t}),Ji.set(e,i)),i}(t);await async function(t){const{ShapeManager:e}=await Promise.resolve().then(function(){return cn}),i=t.pluginManager;i.emitterShapeManager??=new e,i.addEmitterShapeGenerator??=(t,e)=>{i.emitterShapeManager?.addShapeGenerator(t,e)}}(t),t.pluginManager.addPlugin(new Ki(e))})}!function(t){t.emitter="emitter"}(es||(es={}));var ss;function ns(t,e){return t+e*(F()-a)}!function(t){t[t.TopLeft=0]="TopLeft",t[t.TopRight=1]="TopRight",t[t.BottomRight=2]="BottomRight",t[t.BottomLeft=3]="BottomLeft"}(ss||(ss={}));class os extends ts{constructor(t,e,i,s){super(t,e,i,s)}async init(){}randomPosition(){const t=this.fill,e=this.position,i=this.size;if(t)return{position:{x:ns(e.x,i.width),y:ns(e.y,i.height)}};{const t=i.width*a,s=i.height*a,n=function(t){return Math.floor(F()*t)}(4),o=2*(F()-a);switch(n){case ss.TopLeft:return{position:{x:e.x+o*t,y:e.y-s}};case ss.TopRight:return{position:{x:e.x-t,y:e.y+o*s}};case ss.BottomRight:return{position:{x:e.x+o*t,y:e.y+s}};case ss.BottomLeft:default:return{position:{x:e.x+t,y:e.y+o*s}}}}}}class as{generate(t,e,i,s,n){return new os(e,i,s,n)}}async function rs(t){t.checkVersion("4.3.2"),await t.pluginManager.register(t=>{!function(t){if(!t.pluginManager.addEmitterShapeGenerator)throw new Error("tsParticles Emitters Plugin is not loaded")}(t),t.pluginManager.addEmitterShapeGenerator?.("square",new as)})}class ls extends me{sync=!1;load(t){_(t)||(super.load(t),Kt(this,"sync",t.sync))}}class cs extends me{sync=!1;load(t){_(t)||(super.load(t),Kt(this,"sync",t.sync))}}class hs{count=0;delay=new ls;duration=new cs;load(t){_(t)||(Kt(this,"count",t.count),this.delay.load(t.delay),this.duration.load(t.duration))}}class ds{#u;constructor(t){this.#u=t}init(t){const e=this.#u,i=t.options.life;if(!i)return;const s=i.delay.sync?1:F(),n=i.duration.sync?1:F();t.life={delay:e.retina.reduceFactor?G(i.delay.value)*s/e.retina.reduceFactor*r:0,delayTime:0,duration:e.retina.reduceFactor?G(i.duration.value)*n/e.retina.reduceFactor*r:0,time:0,count:i.count},t.life.duration<=0&&(t.life.duration=-1),t.life.count<=0&&(t.life.count=-1),t.spawning=t.life.delay>0}isEnabled(t){return!t.destroyed}loadOptions(t,...e){ie(t,"life",hs,...e)}update(t,e){this.isEnabled(t)&&t.life&&function(t,e,i){if(!t.life)return;const s=t.life;let n=!1;if(t.spawning){if(s.delayTime+=e.value,!(s.delayTime>=t.life.delay))return;n=!0,t.spawning=!1,s.delayTime=0,s.time=0}if(-1===s.duration)return;if(n?s.time=0:s.time+=e.value,s.time<s.duration)return;if(s.time=0,t.life.count>0&&t.life.count--,0===t.life.count)return void t.destroy();const o=q(0,i.width),a=q(0,i.width);t.position.x=H(o),t.position.y=H(a),t.spawning=!0,s.delayTime=0,s.time=0,t.reset();const l=t.options.life;l&&(s.delay=G(l.delay.value)*r,s.duration=G(l.duration.value)*r)}(t,e,this.#u.canvas.size)}}async function us(t){t.checkVersion("4.3.2"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("life",t=>Promise.resolve(new ds(t)))})}class ps{factor=4;value=!0;load(t){_(t)||(Kt(this,"factor",t.factor),Kt(this,"value",t.value))}}class fs{disable=!0;reduce=new ps;load(t){_(t)||(Kt(this,"disable",t.disable),this.reduce.load(t.reduce))}}class gs{id="motion";async getPlugin(t){const{MotionPluginInstance:e}=await Promise.resolve().then(function(){return dn});return new e(t)}loadOptions(t,e,i){if(!this.needsPlugin())return;let s=e.motion;s?.load||(e.motion=s=new fs),s.load(i?.motion)}needsPlugin(){return!0}}async function ys(t){t.checkVersion("4.3.2"),await t.pluginManager.register(t=>{t.pluginManager.addPlugin(new gs)})}const ms=.5;function vs(t){return t.ribbonParticleDist??8}function bs(t){return t.ribbonOscillationSpeed??3}function ws(t){return t.ribbonOscillationDistance??40}function Ps(t){const e=t.shapeData,i=Math.max(4,Math.round(G(e?.count??30))),s=G(e?.particleDist??8),n=G(e?.mass??1),o=G(e?.drag??.05),a=G(e?.velocityInherit??5),r=G(e?.oscillationSpeed??3),l=G(e?.oscillationDistance??40),c=G(e?.angle??45),h=Math.PI/180*c,d=C.create(t.position.x,t.position.y);if(!t.ribbonBounds)return;t.ribbonParticleDist=s,t.ribbonMass=n,t.ribbonDrag=o,t.ribbonVelocityInherit=a,t.ribbonOscillationSpeed=r,t.ribbonOscillationDistance=l,t.ribbonTime=100*F(),t.ribbonOffsets=C.create(Math.cos(h),Math.sin(h)),t.ribbonHead=d,t.ribbonPreviousHead=C.create(d.x,d.y),t.ribbonPreviousPosition=C.create(t.position.x,t.position.y);const u=t.velocity.angle+Math.PI,p=s*ms;t.ribbonPoints=new Array(i);for(let e=0;e<i;e++){const i=e*s,n=(F()-ms)*p,o=u+Math.PI*ms;t.ribbonPoints[e]={force:C.origin,position:C.create(d.x+Math.cos(u)*i+Math.cos(o)*n,d.y+Math.sin(u)*i+Math.sin(o)*n),velocity:C.origin}}}function Ms(t){const e=t.ribbonPoints,i=t.ribbonBounds,s=i?.x??0,n=i?.y??0,o=C.create(F()*s,-F()*n);if(i)if(e?.length){t.position.x=o.x,t.position.y=o.y,t.ribbonHead=C.create(o.x,o.y),t.ribbonPreviousHead=C.create(o.x,o.y),t.ribbonPreviousPosition=C.create(o.x,o.y),t.ribbonTime=100*F();for(let i=0;i<e.length;i++){const s=e[i];s&&(s.position=C.create(o.x,o.y-i*vs(t)),s.force=C.origin,s.velocity=C.origin)}}else Ps(t)}function xs(t,e,i){const s=t.ribbonPoints?.[e];s&&s.force.addTo(i)}function zs(t,e,i){const s=t.ribbonPoints?.[e];if(!s)return;const n=function(t){return t.ribbonMass??1}(t),o=function(t){return t.ribbonDrag??.05}(t),a=C.create(s.force.x,s.force.y),r=s.velocity.length,l=C.create(s.velocity.x,s.velocity.y);l.multTo(o*n*r),a.subFrom(l);const c=a.div(n);s.position.addTo(s.velocity.mult(i)),s.velocity.addTo(c.mult(i)),s.force=C.origin}function Ss(t){const{particle:e,delta:i}=t,s=e.ribbonPoints,n=e.ribbonOffsets,o=e.ribbonBounds;if(!s?.length||!n||!o)return;const a=Math.min(.02,Math.max(i.value/1e3,1e-6)),r=function(t){return t.ribbonHead??=C.create(t.position.x,t.position.y),t.ribbonHead}(e),l=function(t){return t.ribbonPreviousHead??=C.create(t.position.x,t.position.y),t.ribbonPreviousHead}(e),c=function(t){return t.ribbonVelocityInherit??5}(e),h=e.options.move.enable;if(e.ribbonTime=(e.ribbonTime??0)+a*bs(e),h?(r.x=e.position.x+Math.cos(e.ribbonTime)*ws(e)/bs(e),r.y=e.position.y):r.x+=Math.cos(e.ribbonTime)*ws(e)*a,e.justWarped){const t=e.velocity.angle+Math.PI,i=vs(e),n=s[0];n&&(n.position=C.create(r.x,r.y),n.velocity=C.origin,n.force=C.origin);for(let e=1;e<s.length;e++){const n=s[e];if(!n)continue;const o=e*i;n.position=C.create(r.x+Math.cos(t)*o,r.y+Math.sin(t)*o),n.velocity=C.origin,n.force=C.origin}}const d=vs(e);if(!Number.isFinite(r.x)||!Number.isFinite(r.y))return void Ms(e);const u=s[0];if(!u)return;u.position=C.create(r.x,r.y);const p=l.x-r.x,f=l.y-r.y,g=Math.sqrt(p*p+f*f),y=Math.min(g/a*c,800);e.ribbonPreviousHead=C.create(r.x,r.y),e.ribbonPreviousPosition=C.create(e.position.x,e.position.y);for(let t=1;t<s.length;t++){const i=s[t],n=s[t-1];if(!i||!n)continue;const o=n.position.sub(i.position).copy();o.normalize(),o.multTo(y),xs(e,t,o)}for(let t=1;t<s.length;t++)zs(e,t,a);for(let t=1;t<s.length;t++){const i=s[t],n=s[t-1];if(!i||!n)continue;const o=i.position.sub(n.position).copy();if(o.normalize(),o.multTo(d),i.position=n.position.add(o),!(Number.isFinite(i.position.x)&&Number.isFinite(i.position.y)&&Number.isFinite(i.velocity.x)&&Number.isFinite(i.velocity.y)))return void Ms(e)}}function Cs(t,e,i,s,n,o){return(t-i)*(o-s)-(e-s)*(n-i)}function Os(t,e){return C.create((t.x+e.x)*ms,(t.y+e.y)*ms)}function Ds(t,e){t.beginPath(),t.moveTo(e.a.x,e.a.y),t.lineTo(e.b.x,e.b.y),t.lineTo(e.c.x,e.c.y),e.d&&t.lineTo(e.d.x,e.d.y),t.closePath(),e.stroke&&t.stroke(),e.fill&&t.fill()}function ks(t,e,i){!function(t,e,i){t.ribbonBounds=C.create(e,i)}(t,e,i),t.ribbonPoints?.length||Ps(t)}function Is(t){return Math.max(4,Math.round(G(t.shapeData?.count??30)))}function Ts(e,i,s,n,o,a){const{canvasSize:r,direction:l}=e;return l===t.OutModeDirection.bottom?n<=r.height+a:l===t.OutModeDirection.left?s>=-a:l===t.OutModeDirection.right?i<=r.width+a:l===t.OutModeDirection.top?o>=-a:s>=-a&&o>=-a&&i<=r.width+a&&n<=r.height+a}class _s{#u;constructor(t){this.#u=t}draw(e){const i=this.#u.canvas.size;ks(e.particle,i.width,i.height),e.particle.ribbonPoints&&e.particle.ribbonPoints.length!==Is(e.particle)&&Ps(e.particle),Ss(e),function(e,i){const{context:s,particle:n,radius:o}=e,a=n.ribbonPoints,r=n.ribbonOffsets,l=n.ribbonBounds,c=e.fill,h=e.stroke;if(!a||!r||!l||a.length<4||!c&&!h)return;const d=r.mult(o),u=n.position,p="string"==typeof s.fillStyle?s.fillStyle:"",f="string"==typeof s.strokeStyle?s.strokeStyle:"",g=n.shapeData;let y=h?f:p;if(g?.backColor)y=g.backColor;else if(g?.darken?.enable){const e=Ke(n.fillColor);e&&(y=Qe(si(e,t.AlterType.darken,G(g.darken.value)),i))}else if(g?.enlighten?.enable){const e=Ke(n.fillColor);e&&(y=Qe(si(e,t.AlterType.enlighten,G(g.enlighten.value)),i))}s.lineWidth=1,s.lineJoin="round",s.lineCap="round";for(let t=0;t<a.length-1;t++){const e=a[t],i=a[t+1];if(!e||!i)continue;const n=e.position.add(d),o=i.position.add(d),r=e.position.sub(u),f=i.position.sub(u),g=n.sub(u),m=o.sub(u),v=Math.min(e.position.y,i.position.y,n.y,o.y),b=Math.max(e.position.y,i.position.y,n.y,o.y),w=Cs(e.position.x,e.position.y,i.position.x,i.position.y,o.x,o.y)<0?p:y;v>l.y+d.length||b<-d.length||(s.fillStyle=w,h&&(s.strokeStyle=w),0===t?(Ds(s,{a:r,b:f,c:Os(f,m),fill:c,stroke:h}),Ds(s,{a:m,b:g,c:Os(f,m),fill:c,stroke:h})):t===a.length-2?(Ds(s,{a:r,b:f,c:Os(r,g),fill:c,stroke:h}),Ds(s,{a:m,b:g,c:Os(r,g),fill:c,stroke:h})):Ds(s,{a:r,b:f,c:m,d:g,fill:c,stroke:h}))}s.fillStyle=p,h&&(s.strokeStyle=f),s.beginPath()}(e,this.#u.hdr)}getSidesCount(t){const e=t.ribbonPoints?.length;return e?Math.max(12,2*e):12}isInsideCanvas(e){const{outMode:i,particle:s,radius:n}=e,o=s.ribbonPoints,a=s.ribbonOffsets,r=s.position,l=i===t.OutMode.destroy||i===t.OutMode.out,c=(a?.length??0)*n,h=Math.max(n,c);if(!l)return Ts(e,r.x-h,r.x+h,r.y-h,r.y+h,0);if(!o?.length||!a)return Ts(e,r.x-h,r.x+h,r.y-h,r.y+h,0);let d=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,p=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY;for(const t of o){const e=t.position.x,i=t.position.y,s=e+a.x*n,o=i+a.y*n;d=Math.min(d,e,s),u=Math.max(u,e,s),p=Math.min(p,i,o),f=Math.max(f,i,o)}if(!(Number.isFinite(d)&&Number.isFinite(p)&&Number.isFinite(u)&&Number.isFinite(f)))return!1;const g=s.ribbonOscillationSpeed&&s.ribbonOscillationDistance?s.ribbonOscillationDistance/s.ribbonOscillationSpeed:0;return Ts(e,d,u,p,f,Math.max(h,s.ribbonParticleDist??0)+g)}loadShape(t){if(!t.shapeData)return;const e=Is(t);t.ribbonPoints?.length&&t.ribbonPoints.length===e||Ps(t)}particleDestroy(t){delete t.ribbonPoints,delete t.ribbonHead,delete t.ribbonPreviousHead,delete t.ribbonPreviousPosition,delete t.ribbonTime,delete t.ribbonOffsets,delete t.ribbonParticleDist,delete t.ribbonMass,delete t.ribbonDrag,delete t.ribbonVelocityInherit,delete t.ribbonOscillationSpeed,delete t.ribbonOscillationDistance}particleInit(t,e){ks(e,t.canvas.size.width,t.canvas.size.height)}}async function Es(t){t.checkVersion("4.3.2"),await t.pluginManager.register(t=>{t.pluginManager.addShape(["ribbon"],t=>Promise.resolve(new _s(t)))})}class Rs{colors;count;disableForReducedMotion;emitterSize;positionX;ribbonOptions;scalar;zIndex;constructor(){this.count=5,this.emitterSize={width:100,height:0},this.positionX=50,this.colors=["#FF0055","#00D1FF","#FFD23F","#61FF7E","#B284FF"],this.ribbonOptions={angle:45,darken:{enable:!0,value:30},count:60,drag:.02,mass:1,oscillationDistance:{min:100,max:140},oscillationSpeed:{min:3,max:5},particleDist:8,velocityInherit:{min:4,max:6}},this.scalar=1,this.zIndex=100,this.disableForReducedMotion=!0}get origin(){return{x:this.positionX/o,y:0}}set origin(t){this.positionX=t.x*o}get particleCount(){return this.count}set particleCount(t){this.count=t}get position(){return{x:this.positionX,y:0}}set position(t){this.positionX=t.x}load(t){if(_(t))return;const e=t.count??t.particleCount;if(void 0!==e&&(this.count=e),t.emitterSize&&(void 0!==t.emitterSize.width&&(this.emitterSize.width=t.emitterSize.width),void 0!==t.emitterSize.height&&(this.emitterSize.height=t.emitterSize.height)),Kt(this,"positionX",t.positionX),void 0===t.positionX){const e=t.origin;e&&!t.position&&(t.position={x:void 0===e.x?void 0:e.x*o,y:0});const i=t.position;i&&void 0!==i.x&&(this.positionX=i.x)}void 0!==t.colors&&(T(t.colors)?this.colors=[...t.colors]:this.colors=t.colors),void 0!==t.ribbonOptions&&(this.ribbonOptions=yt({},t.ribbonOptions)),Kt(this,"scalar",t.scalar),Kt(this,"zIndex",t.zIndex),Kt(this,"disableForReducedMotion",t.disableForReducedMotion)}}const Ls=new Map;async function Fs(t,e){const i=new Rs;i.load(e.options);let s=Ls.get(e.id);s instanceof Promise&&(await s,s=Ls.get(e.id));const n=s;if(n&&!n.destroyed){const t=n;if("addEmitter"in t)return await async function(t,e){await(t.addEmitter?.({startCount:e.count,position:{x:e.positionX,y:0},shape:{type:"square"},size:{width:e.emitterSize.width,height:e.emitterSize.height},rate:{delay:0,quantity:0},life:{duration:.1,count:1},particles:{paint:{fill:{color:{value:e.colors},enable:!0}},shape:{type:"ribbon",options:{ribbon:e.ribbonOptions}},life:{count:1},size:{value:8*e.scalar},move:{direction:"bottom",enable:!0,outModes:{top:"none",default:"destroy"},speed:{min:4,max:6}},roll:{enable:!1},rotate:{value:0,move:!1,animation:{enable:!1}},tilt:{enable:!1},wobble:{enable:!1}}}))}(t,i),n}const o=(async()=>{const s=function(t,e){return{fullScreen:{enable:!e.canvas,zIndex:t.zIndex},fpsLimit:120,particles:{number:{value:0},paint:{fill:{color:{value:t.colors},enable:!0}},shape:{type:"ribbon",options:{ribbon:t.ribbonOptions}},size:{value:8*t.scalar},links:{enable:!1},life:{count:1},move:{direction:"bottom",enable:!0,outModes:{top:"none",default:"destroy"},speed:{min:4,max:6}},roll:{enable:!1},rotate:{value:0,move:!1,animation:{enable:!1}},tilt:{enable:!1},wobble:{enable:!1}},motion:{disable:t.disableForReducedMotion},emitters:{name:"ribbons",startCount:t.count,position:{x:t.positionX,y:0},shape:{type:"square"},size:{width:t.emitterSize.width,height:t.emitterSize.height},rate:{delay:0,quantity:0},life:{duration:.1,count:1}}}}(i,e),n=await t.load({id:e.id,element:e.canvas,options:s});return Ls.set(e.id,n),n})();return Ls.set(e.id,o),o}let As=null;async function Bs(t){return As||(As=async function(t){t.checkVersion("4.3.2"),await t.pluginManager.register(async t=>{await Promise.all([Wi(t),ys(t),(async t=>{await is(t),await rs(t)})(t),Es(t),us(t)])})}(t),As)}async function Vs(t,e){let i,s;return await Bs(ni),D(t)?(s=t,i=e??{}):(s="ribbons",i=t??{}),Fs(ni,{id:s,options:i})}Vs.create=async(t,e={})=>{await Bs(ni);const i=t?.getAttribute("id")??"ribbons";return t?.setAttribute("id",i),await Fs(ni,{id:i,canvas:t??void 0,options:e}),async(s,n)=>{let o,a;return D(s)?(a=s,o=n??e):(a=i,o=s??{}),Fs(ni,{id:a,canvas:t??void 0,options:o})}},Vs.init=async()=>{await Bs(ni)},Vs.version="4.3.2",globalThis.ribbons=Vs;const Us=globalThis;Us.ribbons=Vs,Us.tsParticles=ni;function Ns(t,e,i){const s=e[i];void 0!==s&&(t[i]=(t[i]??1)*s)}class Hs{#P;#M;#x;#z;#S;#u;#C;#O;#D;#k;#I;#T;#p;#_;#E;#R={};#L=[void 0,void 0];#F={};constructor(t,e,i){this.#p=t,this.#u=e,this.#z=i,this.#C=null,this.#P=null,this.#M=new Set,this.#E=[],this.#_=[],this.#x=[],this.#S=[],this.#D=[],this.#k=[],this.#I=[],this.#T={0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[]}}get settings(){return this.#O}canvasClear(){this.#u.actualOptions.clear&&this.draw(t=>{t.clearRect(l.x,l.y,this.#z.size.width,this.#z.size.height)})}clear(){for(const t of this.#x)if(t.canvasClear?.())return;for(const e of Object.values(t.DrawLayer))if("number"==typeof e)for(const t of this.#A(e))if(t.canvasClear?.())return;this.canvasClear()}destroy(){this.stop(),this.#P=null,this.#M.clear(),this.#E=[],this.#_=[],this.#x=[],this.#S=[],this.#D=[],this.#k=[],this.#I=[];for(const e of Object.values(t.DrawLayer))"number"==typeof e&&(this.#T[e]=[])}draw(t){const e=this.#C;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[o,a]=this.#B(t);if(o??=s,a??=n,!o&&!a)return;const r=this.#u,l=t.options.zIndex,c=1-t.zIndexFactor,{fillOpacity:h,opacity:d,strokeOpacity:u}=t.getOpacity(),p=this.#F,f=this.#R,g=o?Qe(o,r.hdr,h*d):void 0,y=a?Qe(a,r.hdr,u*d):g;p.a=p.b=p.c=p.d=void 0,f.fill=g,f.stroke=y,this.draw(s=>{for(const i of this.#I)i.drawParticleSetup?.(s,t,e);this.#V(s,t,i,d,f,p),this.#U({container:r,context:s,particle:t,delta:e,colorStyles:f,radius:i*c**l.sizeRate,opacity:d,transform:p}),this.#N(t);for(const i of this.#k)i.drawParticleCleanup?.(s,t,e)})}drawParticlePlugins(t,e){this.draw(i=>{for(const s of this.#D)this.#H(i,s,t,e)})}drawParticles(e){const{particles:i,actualOptions:s}=this.#u;this.clear(),i.update(e),this.draw(n=>{const o=this.#z.size.width,a=this.#z.size.height;if(this.#P)try{n.drawImage(this.#P,l.x,l.y,o,a)}catch{this.#G("background-element-draw-error","Error drawing background element onto canvas")}const r=s.background;if(r.draw)try{r.draw(n,e)}catch{this.#G("background-draw-error","Error in background.draw callback")}for(const e of this.#A(t.DrawLayer.BackgroundMask))e.canvasPaint?.();for(const i of this.#A(t.DrawLayer.CanvasSetup))i.drawSettingsSetup?.(n,e);for(const i of this.#A(t.DrawLayer.PluginContent))i.draw?.(n,e);i.drawParticles(e);for(const i of this.#A(t.DrawLayer.CanvasCleanup))i.clearDraw?.(n,e),i.drawSettingsCleanup?.(n,e)})}init(){this.initUpdaters(),this.initPlugins(),this.#W(),this.paint()}initPlugins(){this.#x=[],this.#S=[],this.#D=[],this.#I=[],this.#k=[];for(const e of Object.values(t.DrawLayer))"number"==typeof e&&(this.#T[e]=[]);for(const e of this.#u.plugins)(e.particleFillColor??e.particleStrokeColor)&&this.#S.push(e),e.drawParticle&&this.#D.push(e),e.drawParticleSetup&&this.#I.push(e),e.drawParticleCleanup&&this.#k.push(e),e.canvasClear&&this.#x.push(e),e.canvasPaint&&this.#A(t.DrawLayer.BackgroundMask).push(e),e.drawSettingsSetup&&this.#A(t.DrawLayer.CanvasSetup).push(e),e.draw&&this.#A(t.DrawLayer.PluginContent).push(e),(e.clearDraw??e.drawSettingsCleanup)&&this.#A(t.DrawLayer.CanvasCleanup).push(e)}initUpdaters(){this.#E=[],this.#_=[];for(const t of this.#u.particleUpdaters)t.afterDraw&&this.#_.push(t),(t.getColorStyles??t.getTransformValues??t.beforeDraw)&&this.#E.push(t)}paint(){let e=!1;for(const i of this.#A(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(l.x,l.y,this.#z.size.width,this.#z.size.height)})}paintImage(t,e){this.draw(i=>{if(!t)return;const s=i.globalAlpha;i.globalAlpha=e,i.drawImage(t,l.x,l.y,this.#z.size.width,this.#z.size.height),i.globalAlpha=s})}setContext(t){this.#C=t,this.#C&&(this.#C.globalCompositeOperation=i)}setContextSettings(t){this.#O=t}stop(){this.draw(t=>{t.clearRect(l.x,l.y,this.#z.size.width,this.#z.size.height)})}#N(t){for(const e of this.#_)e.afterDraw?.(t)}#V(t,e,i,s,n,o){for(const a of this.#E){if(a.getColorStyles){const{fill:o,stroke:r}=a.getColorStyles(e,t,i,s);o&&(n.fill=o),r&&(n.stroke=r)}if(a.getTransformValues){const t=a.getTransformValues(e);for(const e in t)Ns(o,t,e)}a.beforeDraw?.(e)}}#$(t,e){if(!t?.drawAfter)return;const{particle:i}=e;i.effect&&t.drawAfter(e)}#q(t,e){if(!t?.drawBefore)return;const{particle:i}=e;i.effect&&t.drawBefore(e)}#U(t){const{container:e,context:i,particle:s,delta:n,colorStyles:o,radius:a,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),o.fill&&(i.fillStyle=o.fill);const f=!!s.fillEnabled,g=s.strokeWidth??0;i.lineWidth=g,o.stroke&&(i.strokeStyle=o.stroke);const y={context:i,particle:s,radius:a,drawRadius:1*a,opacity:r,delta:n,pixelRatio:e.retina.pixelRatio,fill:f,stroke:g>0,transformData:u,position:{...d},drawPosition:p,drawScale:1};for(const t of e.plugins)t.drawParticleTransform?.(y);const m=s.effect?c.get(s.effect):void 0,v=s.shape?h.get(s.shape):void 0;this.#q(m,y),this.#j(v,y),this.#X(v,y),this.#Y(v,y),this.#$(m,y),i.resetTransform()}#H(t,e,i,s){e.drawParticle&&e.drawParticle(t,i,s)}#X(t,e){if(!t)return;const{context:i,fill:s,particle:n,stroke:o}=e;n.shape&&(i.beginPath(),t.draw(e),n.shapeClose&&i.closePath(),s&&i.fill(),o&&i.stroke())}#Y(t,e){if(!t?.afterDraw)return;const{particle:i}=e;i.shape&&t.afterDraw(e)}#j(t,e){if(!t?.beforeDraw)return;const{particle:i}=e;i.shape&&t.beforeDraw(e)}#A(t){return this.#T[t]}#B(t){let e,i;for(const s of this.#S)if(!e&&s.particleFillColor&&(e=Ne(this.#p,s.particleFillColor(t))),!i&&s.particleStrokeColor&&(i=Ne(this.#p,s.particleStrokeColor(t))),e&&i)break;return this.#L[0]=e,this.#L[1]=i,this.#L}#W(){const t=this.#u.actualOptions.background;if(this.#P=null,t.element)if("string"==typeof t.element){if("undefined"!=typeof document){const e=document.querySelector(t.element);e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof HTMLImageElement?this.#P=e:e?this.#G("background-element-not-supported",`Background element "${t.element}" is not a supported drawable element (canvas, video, or img)`):this.#G("background-element-not-found",`Background element selector "${t.element}" not found`)}}else(t.element instanceof HTMLCanvasElement||t.element instanceof OffscreenCanvas||t.element instanceof HTMLVideoElement||t.element instanceof HTMLImageElement)&&(this.#P=t.element)}#G(t,e){this.#M.has(t)||(this.#M.add(t),_t().warning(e))}}const Gs=new WeakMap;function Ws(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 $s{domElement;render;renderCanvas;size;zoom=1;#u;#Q;#Z;#K;#p;#J;#tt;#et;#it;constructor(t,e){this.#p=t,this.#u=e,this.render=new Hs(t,e,this),this.#et={height:0,width:0};const i=e.retina.pixelRatio,s=this.#et;this.size={height:s.height*i,width:s.width*i},this.#Q=!1,this.#tt=[],this.#J="none"}get#st(){return this.#u.actualOptions.fullScreen.enable}destroy(){if(this.stop(),this.#Q){const t=this.domElement;t?.remove(),this.domElement=void 0,this.renderCanvas=void 0}else this.#nt();this.render.destroy(),this.#tt=[]}getZoomCenter(){const t=this.#u.retina.pixelRatio,{width:e,height:i}=this.size;return this.#it?this.#it:{x:e*a/t,y:i*a/t}}init(){this.#ot(t=>{t.disconnect()}),this.#Z=ht(t=>{for(const e of t)"attributes"===e.type&&"style"===e.attributeName&&this.#at()}),this.resize(),this.#rt(),this.initBackground(),this.#ot(t=>{const e=this.domElement;e&&e instanceof Node&&t.observe(e,{attributes:!0})}),this.initPlugins(),this.#lt(),this.render.init()}initBackground(){const t=this.#u,e=t.actualOptions.background,i=this.domElement;if(!i)return;const s=i.style,n=Ve(this.#p,e.color);s.backgroundColor=n?Ye(n,t.actualOptions.hdr,e.opacity):"",s.backgroundImage=e.image||"",s.backgroundPosition=e.position||"",s.backgroundRepeat=e.repeat||"",s.backgroundSize=e.size||""}initPlugins(){this.#tt=[];for(const t of this.#u.plugins)t.resize&&this.#tt.push(t)}loadCanvas(t){this.#Q&&this.domElement&&this.domElement.remove();const i=(t=>"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement)(t)?t:void 0;this.domElement=i,this.#Q=!!i&&"true"===i.dataset[e],this.renderCanvas=i?(t=>{const e=Gs.get(t);if(e)return e;if("function"!=typeof t.transferControlToOffscreen)throw new TypeError("OffscreenCanvas is required but not supported by this browser");try{const e=t.transferControlToOffscreen();return Gs.set(t,e),e}catch{throw new TypeError("OffscreenCanvas transfer failed")}})(i):t;const s=this.domElement;s&&(s.ariaHidden="true",this.#K=wt(s.style));const n=this.#et,o=this.renderCanvas;s?(n.height=s.offsetHeight,n.width=s.offsetWidth):(n.height=o.height,n.width=o.width);const a=this.#u.retina.pixelRatio,r=this.size;o.height=r.height=n.height*a,o.width=r.width=n.width*a}resize(){const t=this.domElement;if(!t)return!1;const e=this.#u,i=this.renderCanvas;if(void 0===i)return!1;const s=e.canvas.#et,n={width:t.offsetWidth,height:t.offsetHeight},o=e.retina.pixelRatio,a={width:n.width*o,height:n.height*o};if(n.height===s.height&&n.width===s.width&&a.height===i.height&&a.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=a.width,i.height=l.height=a.height,this.#u.started&&e.particles.setResizeFactor({width:s.width/r.width,height:s.height/r.height}),!0}setPointerEvents(t){this.domElement&&(this.#J=t,this.#at())}setZoom(t,e){this.zoom=t,this.#it=e}stop(){this.#ot(t=>{t.disconnect()}),this.#Z=void 0,this.render.stop()}async windowResize(){if(!this.domElement||!this.resize())return;const t=this.#u,e=t.updateActualOptions();t.particles.setDensity(),this.#ct(),e&&await t.refresh()}#ct(){for(const t of this.#tt)t.resize?.()}#lt(){const t=this.#u.actualOptions.hdr&&ct("(color-gamut: p3)")?.matches&&ct("(dynamic-range: high)")?.matches;this.render.setContextSettings({alpha:!0,desynchronized:!0,willReadFrequently:!1,...t?{colorSpace:"display-p3",colorType:"float16"}:{colorSpace:"srgb"}});const e=this.renderCanvas;e&&this.render.setContext(e.getContext("2d",this.render.settings))}#rt(){const t=this.domElement,e=this.#u.actualOptions;if(t){this.#st?this.#ht():this.#nt();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")}}}#at(){const t=this.domElement;if(!t)return;this.#ot(t=>{t.disconnect()}),this.#rt(),this.initBackground();const e=this.#J;t.style.pointerEvents=e,t.style.setProperty("pointer-events",e),this.#ot(e=>{t instanceof Node&&e.observe(t,{attributes:!0})})}#nt(){const t=this.domElement,e=this.#K;t&&e&&Ws(t,e,!0)}#ot(t){this.#Z&&t(this.#Z)}#ht(){const t=this.domElement;t&&Ws(t,xt(this.#u.actualOptions.fullScreen.zIndex),!0)}}class qs{#u;#dt;#ut;#pt;constructor(t){this.#u=t,this.#dt={visibilityChange:()=>{this.#ft()},resize:()=>{this.#gt()}}}addListeners(){this.#yt(!0)}removeListeners(){this.#yt(!1)}#ft(){const t=this.#u;t.actualOptions.pauseOnBlur&&(lt().hidden?(t.pageHidden=!0,t.pause()):(t.pageHidden=!1,t.animationStatus?t.play(!0):t.draw(!0)))}#gt(){this.#pt&&(clearTimeout(this.#pt),this.#pt=void 0);const t=async()=>{const t=this.#u.canvas;await t.windowResize()};this.#pt=setTimeout(()=>{t()},this.#u.actualOptions.resize.delay*r)}#yt(t){const e=this.#dt;this.#mt(t),zt(document,n,e.visibilityChange,t,!1)}#mt(t){const e=this.#dt,i=this.#u;if(!i.actualOptions.resize.enable)return;if("undefined"==typeof ResizeObserver)return void zt(globalThis,s,e.resize,t);const n=i.canvas.domElement;this.#ut&&!t?(n&&this.#ut.unobserve(n),this.#ut.disconnect(),this.#ut=void 0):!this.#ut&&t&&n&&(this.#ut=new ResizeObserver(t=>{t.find(t=>t.target===n)&&this.#gt()}),this.#ut.observe(n))}}function js(t){if(!dt(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 Xs(t,e){const i=t%e;return i<0?i+e:i}function Ys(t,e,i,s){const n=Re(i,e,e.actualOptions.particles),o=n.reduceDuplicates;t.effect=vt(n.effect.type,t.id,o),t.shape=vt(n.shape.type,t.id,o);const a=n.effect,r=n.shape;if(s){if(s.effect){const e=s.effect.type;if(e&&e!==t.effect){const i=vt(e,t.id,o);i&&(t.effect=i)}a.load(s.effect)}if(s.shape){const e=s.shape.type;if(e&&e!==t.shape){const i=vt(e,t.id,o);i&&(t.shape=i)}r.load(s.shape)}}if(t.effect===h){const i=[...e.effectDrawers.keys()];t.effect=i[Math.floor(F()*i.length)]}if(t.shape===h){const i=[...e.shapeDrawers.keys()];t.shape=i[Math.floor(F()*i.length)]}t.effectData=t.effect?function(t,e,i,s){const n=e.options[t];return yt({close:e.close},vt(n,i,s))}(t.effect,a,t.id,o):void 0,t.shapeData=t.shape?function(t,e,i,s){const n=e.options[t];return yt({close:e.close},vt(n,i,s))}(t.shape,r,t.id,o):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 Qs{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;#vt={fillOpacity:1,opacity:1,strokeOpacity:1};#bt=S.origin;#wt={sin:0,cos:0};#Pt={a:1,b:0,c:0,d:1};#u;#Mt=[];#p;constructor(t,e){this.#p=t,this.#u=e}addModifier(t){this.#Mt.push(t),this.#Mt.sort((t,e)=>t.priority-e.priority)}clearModifiers(){this.#Mt.length=0}destroy(e){if(this.unbreakable||this.destroyed)return;this.destroyed=!0,this.clearModifiers();const i=this.#u,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.#u.dispatchEvent(t.EventType.particleDestroyed,{particle:this})}draw(t){const e=this.#u.canvas.render;e.drawParticlePlugins(this,t),e.drawParticle(this,t)}getAngle(){return this.rotation+(this.pathRotation?this.velocity.angle:0)}getFillColor(){return this.#xt(this.#zt(Ke(this.fillColor),t=>t.fillColor))}getMass(){return this.getRadius()**2*Math.PI*a}getModifier(t){return this.#Mt.find(e=>e.id===t)}getOpacity(){const t=this.options.zIndex,e=(1-this.zIndexFactor)**t.opacityRate,i=G(this.opacity?.value??1),s=this.#zt(void 0,t=>t.opacity)??i,n=this.fillOpacity??1,o=this.strokeOpacity??1;return this.#vt.fillOpacity=s*n*e,this.#vt.opacity=s*e,this.#vt.strokeOpacity=s*o*e,this.#vt}getPosition(){return this.#bt.x=this.position.x+this.offset.x,this.#bt.y=this.position.y+this.offset.y,this.#bt.z=this.position.z,this.#bt}getRadius(){return this.#zt(this.size.value,t=>t.radius)}getRotateData(){const t=this.getAngle();return this.#wt.sin=Math.sin(t),this.#wt.cos=Math.cos(t),this.#wt}getStrokeColor(){return this.#xt(this.#zt(Ke(this.strokeColor),t=>t.strokeColor))}getTransformData(t){const e=this.getRotateData(),i=this.isRotating;return this.#Pt.a=e.cos*(t.a??c.a),this.#Pt.b=i?e.sin*(t.b??1):t.b??c.b,this.#Pt.c=i?-e.sin*(t.c??1):t.c??c.c,this.#Pt.d=e.cos*(t.d??c.d),this.#Pt}init(e,i,s,n){const o=this.#u;!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=Ys(this,o,this.#p,s),o.retina.initParticle(this),function(t,e){for(const i of t)i.preInit?.(e)}(o.particleUpdaters,this),this.#St(i),this.initialVelocity=this.#Ct(),this.velocity=this.initialVelocity.copy(),this.zIndexFactor=this.position.z/o.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,o),this.spawning=!1,function(t,e){for(const i of t)i.init(e)}(o.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)}(o,this),function(t,e){for(const i of t.particleCreatedPlugins)i.particleCreated?.(e)}(o,this)}isInsideCanvas(t){return this.#Ot({direction:t}).inside}isInsideCanvasForOutMode(t,e){return this.#Ot({direction:e,outMode:t}).inside}isShowingBack(){if(!this.roll)return!1;const t=this.roll.angle;if(this.roll.horizontal&&this.roll.vertical){const e=Xs(t,u);return e>=Math.PI*a&&e<3*Math.PI*a}if(this.roll.horizontal){const e=Xs(t+Math.PI*a,u);return e>=Math.PI&&e<2*Math.PI}if(this.roll.vertical){const e=Xs(t,u);return e>=Math.PI&&e<2*Math.PI}return!1}isVisible(){return!this.destroyed&&!this.spawning&&this.isInsideCanvas()}removeModifier(t){const e=this.#Mt.findIndex(e=>e.id===t);e>=0&&this.#Mt.splice(e,1)}reset(){for(const t of this.#u.particleUpdaters)t.reset?.(this)}#zt(t,e){let i=t;for(const t of this.#Mt)if(t.enabled){const s=e(t);void 0!==s&&(i=s)}return i}#Dt(t,e){let i=0,s=t?S.create(t.x,t.y,e):void 0;const n=this.#u,o=n.particlePositionPlugins,a=this.options.move.outModes,r=this.getRadius(),l=n.canvas.size;for(;;){for(const t of o){const i=t.particlePosition?.(s,this);if(i)return S.create(i.x,i.y,e)}const t=st({size:l,position:s}),c=S.create(t.x,t.y,e);this.#kt(c,r,a.left??a.default),this.#kt(c,r,a.right??a.default),this.#It(c,r,a.top??a.default),this.#It(c,r,a.bottom??a.default);let h=!0;for(const t of n.particles.checkParticlePositionPlugins)if(h=t.checkParticlePosition?.(this,c,i)??!0,!h)break;if(h)return c;i+=1,s=void 0}}#Ct(){const e=this.options.move,i=J(this.direction).copy();if(e.direction===t.MoveDirection.inside||e.direction===t.MoveDirection.outside)return i;const s=Z(G(e.angle.value)),n=Z(G(e.angle.offset)),o={left:n-s*a,right:n+s*a};return e.straight||(i.angle+=H(q(o.left,o.right))),e.random&&"number"==typeof e.speed&&(i.length*=F()),i}#kt(e,i,s){js({outMode:s,checkModes:[t.OutMode.bounce],coord:e.x,maxCoord:this.#u.canvas.size.width,setCb:t=>e.x+=t,radius:i})}#It(e,i,s){js({outMode:s,checkModes:[t.OutMode.bounce],coord:e.y,maxCoord:this.#u.canvas.size.height,setCb:t=>e.y+=t,radius:i})}#Tt(e,i){const s=this.getRadius(),n=this.#u.canvas.size,o=this.position,a=i===t.OutMode.bounce;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"}}#_t(t,e){return{canvasSize:this.#u.canvas.size,direction:t,outMode:e,particle:this,radius:this.getRadius()}}#Ot(t){const e=this.#Tt(t.direction,t.outMode),i=this.#u,s=this.shape?i.shapeDrawers.get(this.shape):void 0,n=this.effect?i.effectDrawers.get(this.effect):void 0,o=s?.isInsideCanvas,a=n?.isInsideCanvas;if(!o&&!a)return e;const r=this.#_t(t.direction,t.outMode),l=o?this.#Et(o(r),"shape"):void 0,c=a?this.#Et(a(r),"effect"):void 0;if(l&&c){const t=Math.max(l.margin??0,c.margin??0);return{inside:l.inside&&c.inside,margin:t>0?t:void 0,reason:"combined"}}return l??c??e}#xt(t){return t&&this.roll&&(this.backColor||this.roll.alter)&&this.isShowingBack()?this.backColor?this.backColor:this.roll.alter?si(t,this.roll.alter.type,this.roll.alter.value):t:t}#St(e){const i=this.#u,s=Math.floor(G(this.options.zIndex.value)),n=this.#Dt(e,U(s,0,i.zLayers));if(!n)throw new Error("a valid position cannot be found for particle");this.position=n,this.initialPosition=this.position.copy();const o=i.canvas.size;switch(this.moveCenter={...bt(this.options.move.center,o),radius:this.options.move.center.radius,mode:this.options.move.center.mode},this.direction=K(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=C.origin}#Et(t,e){return"boolean"==typeof t?{inside:t,reason:e}:{inside:t.inside,margin:t.margin,reason:t.reason??e}}}class Zs{#Rt;#Lt=new Map;#Ft=[];#At;#Bt;#Vt=[];#Ut;constructor(t){this.#Rt=t,this.#At=0,this.#Ut=0}clear(){this.#Lt.clear();const t=this.#Bt;t&&(this.#Rt=t),this.#Bt=void 0}insert(t){const{x:e,y:i}=t.getPosition(),s=this.#Nt(e,i);this.#Lt.has(s)||this.#Lt.set(s,[]),this.#Lt.get(s)?.push(t)}query(t,e,i=[]){const s=this.#Ht(t);if(!s)return i;const n=Math.floor(s.minX/this.#Rt),o=Math.floor(s.maxX/this.#Rt),a=Math.floor(s.minY/this.#Rt),r=Math.floor(s.maxY/this.#Rt);for(let s=n;s<=o;s++)for(let n=a;n<=r;n++){const o=`${s}_${n}`,a=this.#Lt.get(o);if(a)for(const s of a)e&&!e(s)||t.contains(s.getPosition())&&i.push(s)}return i}queryCircle(t,e,i,s=[]){const n=this.#Gt(t.x,t.y,e),o=this.query(n,i,s);return this.#Wt(),o}queryRectangle(t,e,i,s=[]){const n=this.#$t(t.x,t.y,e.width,e.height),o=this.query(n,i,s);return this.#Wt(),o}setCellSize(t){this.#Bt=t}#Gt(t,e,i){return(this.#Ft[this.#At++]??=new Xt(t,e,i)).reset(t,e,i)}#$t(t,e,i,s){return(this.#Vt[this.#Ut++]??=new Yt(t,e,i,s)).reset(t,e,i,s)}#Nt(t,e){return`${Math.floor(t/this.#Rt)}_${Math.floor(e/this.#Rt)}`}#Ht(t){if(t instanceof Xt){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 Yt){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}#Wt(){this.#At=0,this.#Ut=0}}class Ks{checkParticlePositionPlugins;grid;#qt;#u;#jt;#Xt;#Yt;#Qt;#Zt;#Kt;#p;#Jt;#te;#ee;#ie;#se;#ne;constructor(t,e){this.#p=t,this.#u=e,this.#Yt=0,this.#qt=[],this.#Jt=[],this.#Xt=0,this.#jt=new Map,this.#Qt=new Map,this.#ne=this.#oe(this.#u.zLayers),this.grid=new Zs(100),this.checkParticlePositionPlugins=[],this.#Zt=[],this.#Kt=[],this.#ee=[],this.#te=[],this.#se=[]}get count(){return this.#qt.length}addParticle(e,i,s,n){const o=this.#u.actualOptions.particles.number.limit.mode,a=void 0===s?this.#Xt:this.#jt.get(s)??this.#Xt,r=this.count;if(a>0)switch(o){case t.LimitMode.delete:{const t=r+1-a;t>0&&this.removeQuantity(t);break}case t.LimitMode.wait:if(r>=a)return}try{const o=this.#Jt.pop()??new Qs(this.#p,this.#u);o.init(this.#Yt,e,i,s);let a=!0;return n&&(a=n(o)),a?(this.#qt.push(o),this.#ae(o),this.#Yt++,this.#u.dispatchEvent(t.EventType.particleAdded,{particle:o}),o):void this.#Jt.push(o)}catch(t){_t().warning(`error adding particle: ${t}`)}}clear(){this.#qt=[],this.#Qt.clear(),this.#re(this.#u.zLayers)}destroy(){this.#qt=[],this.#Jt.length=0,this.#Qt.clear(),this.#ne=[],this.checkParticlePositionPlugins=[],this.#Zt=[],this.#Kt=[],this.#ee=[],this.#te=[],this.#se=[]}drawParticles(t){for(let e=this.#ne.length-1;e>=0;e--){const i=this.#ne[e];if(i)for(const e of i)e.draw(t)}}filter(t){return this.#qt.filter(t)}find(t){return this.#qt.find(t)}get(t){return this.#qt[t]}async init(){const t=this.#u,e=t.actualOptions;this.checkParticlePositionPlugins=[],this.#se=[],this.#Kt=[],this.#ee=[],this.#Zt=[],this.#te=[],this.#Qt.clear(),this.#re(t.zLayers),this.grid=new Zs(100*t.retina.pixelRatio);for(const e of t.plugins)e.redrawInit&&await e.redrawInit(),e.checkParticlePosition&&this.checkParticlePositionPlugins.push(e),e.update&&this.#se.push(e),e.particleUpdate&&this.#Kt.push(e),e.postUpdate&&this.#ee.push(e),e.particleReset&&this.#Zt.push(e),e.postParticleUpdate&&this.#te.push(e);await this.#u.initDrawersAndUpdaters();for(const e of this.#u.effectDrawers.values())await(e.init?.(t));for(const e of this.#u.shapeDrawers.values())await(e.init?.(t));let i=!1;for(const e of t.plugins)if(i=e.particlesInitialization?.()??i,i)break;if(!i){const t=e.particles,i=t.groups;for(const e in i){const s=i[e];if(s)for(let i=this.count,n=0;n<s.number.value&&i<t.number.value;i++,n++)this.addParticle(void 0,s,e)}for(let e=this.count;e<t.number.value;e++)this.addParticle()}}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.#u.canvas.render.drawParticles({value:0,factor:0})}remove(t,e,i){this.removeAt(this.#qt.indexOf(t),void 0,e,i)}removeAt(t,e=1,i,s){if(t<0||t>this.count)return;let n=0;for(let o=t;n<e&&o<this.count;o++)this.#le(o,i,s)&&(o--,n++)}removeQuantity(t,e){this.removeAt(0,t,e)}setDensity(){const t=this.#u.actualOptions,e=t.particles.groups;let i=0;for(const t of this.#u.plugins)t.particlesDensityCount&&(i+=t.particlesDensityCount());for(const t in e){const s=e[t];if(!s)continue;const n=Re(this.#p,this.#u,s);this.#ce(n,i,t)}this.#ce(t.particles,i)}setResizeFactor(t){this.#ie=t}update(t){this.grid.clear();for(const e of this.#se)e.update?.(t);const e=this.#he(t);for(const e of this.#ee)e.postUpdate?.(t);if(this.#de(t,e),e.size)for(const t of e)this.remove(t);this.#ie=void 0}#ue(...t){this.#Jt.push(...t)}#ce(t,e,i,s){const n=t.number;if(!n.density.enable)return void(void 0===i?this.#Xt=n.limit.value:(s?.number.limit.value??n.limit.value)&&this.#jt.set(i,s?.number.limit.value??n.limit.value));const o=this.#pe(n.density),a=n.value,r=n.limit.value>0?n.limit.value:a,l=Math.min(a,r)*o+e,c=Math.min(this.count,this.filter(t=>t.group===i).length);void 0===i?this.#Xt=n.limit.value*o:this.#jt.set(i,n.limit.value*o),c<l?this.push(Math.abs(l-c),void 0,t,i):c>l&&this.removeQuantity(c-l,i)}#oe(t){const e=Math.max(Math.floor(t),1);return Array.from({length:e},()=>[])}#fe(t){const e=this.#ne.length-1;return e<=0?0:Math.min(Math.max(Math.floor(t),0),e)}#pe(t){const e=this.#u;if(!t.enable)return 1;const i=e.canvas.size,s=e.retina.pixelRatio;return i.width&&i.height?i.width*i.height/(t.height*t.width*s**2):1}#ae(t){const e=this.#fe(t.position.z),i=this.#ne[e];i&&(i.push(t),this.#Qt.set(t.id,e))}#le(e,i,s){const n=this.#qt[e];return!!n&&(n.group===i&&(this.#qt.splice(e,1),this.#ge(n),n.destroy(s),this.#u.dispatchEvent(t.EventType.particleRemoved,{particle:n}),this.#ue(n),!0))}#ge(t){const e=this.#Qt.get(t.id)??this.#fe(t.position.z),i=this.#ne[e];if(!i)return void this.#Qt.delete(t.id);const s=i.findIndex(e=>e.id===t.id);s>=0&&i.splice(s,1),this.#Qt.delete(t.id)}#re(t){const e=Math.max(Math.floor(t),1);if(this.#ne.length===e)for(const t of this.#ne)t.length=0;else this.#ne=this.#oe(e)}#ye(t){const e=this.#fe(t.position.z),i=this.#Qt.get(t.id);if(void 0===i)return void this.#ae(t);if(i===e)return;const s=this.#ne[i];if(s){const e=s.findIndex(e=>e.id===t.id);e>=0&&s.splice(e,1)}const n=this.#ne[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.#Qt.set(t.id,e)}else this.#Qt.set(t.id,e)}#he(t){const e=new Set,i=this.#ie;for(const s of this.#qt){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.#Zt)t.particleReset?.(s);for(const e of this.#Kt){if(s.destroyed)break;e.particleUpdate?.(s,t)}s.destroyed?e.add(s):this.grid.insert(s)}return e}#de(t,e){for(const i of this.#qt)if(i.destroyed)e.add(i);else{for(const e of this.#u.particleUpdaters)e.update(i,t);if(!i.spawning)for(const e of this.#te)e.postParticleUpdate?.(i,t);this.#ye(i)}}}class Js{pixelRatio;reduceFactor;#u;constructor(t){this.#u=t,this.pixelRatio=1,this.reduceFactor=1}init(){const t=this.#u,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,o=t.retina;o.maxSpeed=G(s.gravity.maxSpeed)*i,o.moveDrift=G(s.drift)*i,o.moveSpeed=G(s.speed)*i;const a=o.maxDistance;a.horizontal=void 0===n.horizontal?void 0:n.horizontal*i,a.vertical=void 0===n.vertical?void 0:n.vertical*i}}function tn(t){return!t.destroyed}function en(t,e,...i){const s=new Le(t,e);return Zt(s,...i),s}var sn=Object.freeze({__proto__:null,Container:class{actualOptions;canvas;destroyed;effectDrawers;fpsLimit;hdr;id;pageHidden;particleCreatedPlugins;particleDestroyedPlugins;particlePositionPlugins;particleUpdaters;particles;plugins;retina;shapeDrawers;started;zLayers;#me;#ve;#be={value:0,factor:0};#we;#Pe;#Me;#xe;#ze;#Se;#Ce;#Oe;#De;#ke;#Ie;#p;#Te;#_e;constructor(e){const{dispatchCallback:i,pluginManager:s,id:n,onDestroy:o,sourceOptions:a}=e;this.#p=s,this.#we=i,this.#De=o,this.id=Symbol(n),this.fpsLimit=120,this.hdr=!1,this.#Te=!1,this.#me=0,this.#Me=0,this.#Oe=0,this.#ze=!0,this.started=!1,this.destroyed=!1,this.#Ie=!0,this.#Ce=0,this.zLayers=100,this.pageHidden=!1,this.#_e=a,this.#Se=a,this.effectDrawers=new Map,this.shapeDrawers=new Map,this.particleUpdaters=[],this.retina=new Js(this),this.canvas=new $s(this.#p,this),this.particles=new Ks(this.#p,this),this.plugins=[],this.particleDestroyedPlugins=[],this.particleCreatedPlugins=[],this.particlePositionPlugins=[],this.#ke=en(this.#p,this),this.actualOptions=en(this.#p,this),this.#xe=new qs(this),this.dispatchEvent(t.EventType.containerBuilt)}get animationStatus(){return!this.#Ie&&!this.pageHidden&&tn(this)}get options(){return this.#ke}get sourceOptions(){return this.#_e}addLifeTime(t){this.#Oe+=t}alive(){return!this.#Me||this.#Oe<=this.#Me}destroy(e=!0){if(tn(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.plugins.length=0,this.#p.clearPlugins(this),this.destroyed=!0,this.#De(e),this.dispatchEvent(t.EventType.containerDestroyed)}}dispatchEvent(t,e){this.#we(t,{container:this,data:e})}draw(t){if(!tn(this))return;let e=t;this.#Pe=B(t=>{e&&(this.#Ce=void 0,e=!1),this.#Ee(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}_t().error(`Export plugin with type ${t} not found`)}async init(){if(!tn(this))return;const e=new Map;for(const t of this.#p.plugins){const i=await t.getPlugin(this);i.preInit&&await i.preInit(),e.set(t,i)}await this.initDrawersAndUpdaters(),this.#ke=en(this.#p,this,this.#Se,this.sourceOptions),this.actualOptions=en(this.#p,this,this.#ke),this.plugins.length=0,this.particleDestroyedPlugins.length=0,this.particleCreatedPlugins.length=0,this.particlePositionPlugins.length=0;for(const[t,i]of e)t.needsPlugin(this.actualOptions)&&(this.plugins.push(i),i.particleCreated&&this.particleCreatedPlugins.push(i),i.particleDestroyed&&this.particleDestroyedPlugins.push(i),i.particlePosition&&this.particlePositionPlugins.push(i));this.retina.init(),this.canvas.init(),this.updateActualOptions(),this.canvas.initBackground(),this.canvas.resize();const{delay:i,duration:s,fpsLimit:n,hdr:o,smooth:a,zLayers:l}=this.actualOptions;this.hdr=o,this.zLayers=l,this.#Me=G(s)*r,this.#me=G(i)*r,this.#Oe=0,this.fpsLimit=n>0?n:120,this.#Te=a;for(const t of this.plugins)await(t.init?.());await this.particles.init(),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.#p;this.effectDrawers=await t.getEffectDrawers(this,!0),this.shapeDrawers=await t.getShapeDrawers(this,!0),this.particleUpdaters=await t.getUpdaters(this,!0)}pause(){if(tn(this)&&(void 0!==this.#Pe&&(V(this.#Pe),this.#Pe=void 0),!this.#Ie)){for(const t of this.plugins)t.pause?.();this.pageHidden||(this.#Ie=!0),this.dispatchEvent(t.EventType.containerPaused)}}play(e){if(!tn(this))return;const i=this.#Ie||e;if(!this.#ze||this.actualOptions.autoPlay){if(this.#Ie&&(this.#Ie=!1),i)for(const t of this.plugins)t.play&&t.play();this.dispatchEvent(t.EventType.containerPlay),this.draw(i??!1)}else this.#ze=!1}async refresh(){if(tn(this))return this.stop(),this.start()}async reset(t){if(tn(this))return this.#Se=t,this.#_e=t,this.#ke=en(this.#p,this,this.#Se,this.sourceOptions),this.actualOptions=en(this.#p,this,this.#ke),this.refresh()}async start(){tn(this)&&!this.started&&(await this.init(),this.started=!0,await new Promise(e=>{const i=async()=>{this.#xe.addListeners();for(const t of this.plugins)await(t.start?.());this.dispatchEvent(t.EventType.containerStarted),this.play(),e()};this.#ve=setTimeout(()=>{i()},this.#me)}))}stop(){if(tn(this)&&this.started){this.#ve&&(clearTimeout(this.#ve),this.#ve=void 0),this.#ze=!0,this.started=!1,this.#xe.removeListeners(),this.pause(),this.particles.clear(),this.canvas.stop();for(const t of this.plugins)t.stop?.();this.particleCreatedPlugins.length=0,this.particleDestroyedPlugins.length=0,this.particlePositionPlugins.length=0,this.#_e=this.#ke,this.dispatchEvent(t.EventType.containerStopped)}}updateActualOptions(){let t=!1;for(const e of this.plugins)e.updateActualOptions&&(t=e.updateActualOptions()||t);return t}#Ee(t){try{if(!this.#Te&&void 0!==this.#Ce&&t<this.#Ce+r/this.fpsLimit)return void this.draw(!1);if(this.#Ce??=t,function(t,e,i=60,s=!1){t.value=e,t.factor=s?60/i:60*e/r}(this.#be,t-this.#Ce,this.fpsLimit,this.#Te),this.addLifeTime(this.#be.value),this.#Ce=t,this.#be.value>r)return void this.draw(!1);if(this.canvas.render.drawParticles(this.#be),!this.alive())return void this.destroy();this.animationStatus&&this.draw(!1)}catch(t){_t().error("error in animation loop",t)}}}});var nn=Object.freeze({__proto__:null,BlendPluginInstance:class{layer=t.DrawLayer.CanvasSetup;#u;#Re;constructor(t){this.#u=t}drawParticleCleanup(t,e){e.options.blend?.enable&&(t.globalCompositeOperation=e.originalBlendMode??i,e.originalBlendMode=void 0)}drawParticleSetup(t,e){e.options.blend?.enable&&(e.originalBlendMode=t.globalCompositeOperation,t.globalCompositeOperation=e.options.blend.mode)}drawSettingsCleanup(t){this.#Re&&(t.globalCompositeOperation=this.#Re)}drawSettingsSetup(t){const e=t.globalCompositeOperation,i=this.#u.actualOptions.blend;this.#Re=e,t.globalCompositeOperation=i?.enable?i.mode:e}}});function on(t,e,i,s,n,o,a){!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 o=t.pathGenerator?.generate(t,e);o&&t.velocity.addTo(o);s.clamp&&(t.velocity.x=U(t.velocity.x,-1,1),t.velocity.y=U(t.velocity.y,-1,1));t.lastPathTime-=n}(t,a);const r=t.gravity,l=r?.enable&&r.inverse?-1:1;n&&i&&(t.velocity.x+=n*a.factor/(60*i)),r?.enable&&i&&(t.velocity.y+=l*(r.acceleration*a.factor)/(60*i));const c=t.moveDecay;t.velocity.multTo(c??1);const h=t.velocity.mult(i);r?.enable&&s>0&&(!r.inverse&&h.y>=0&&h.y>=s||r.inverse&&h.y<=0&&h.y<=-s)&&(h.y=l*s,i&&(t.velocity.y=h.y/i));const d=t.options.zIndex,u=(1-t.zIndexFactor)**d.velocityRate;h.multTo(u),h.multTo(o);const{position:p}=t;p.addTo(h),e.vibrate&&(p.x+=Math.sin(p.x*Math.cos(p.y))*o,p.y+=Math.cos(p.y*Math.sin(p.x))*o)}var an=Object.freeze({__proto__:null,MovePluginInstance:class{availablePathGenerators;pathGenerators;#u;#p;constructor(t,e){this.#p=t,this.#u=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-G(i.decay),e.pathDelay=G(n.delay.value)*r,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:G(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},o={x:.01*n.x*e.canvas.size.width,y:.01*n.y*e.canvas.size.height},a=Y(i.getPosition(),o),r=G(s.acceleration);i.retina.spinAcceleration=r*e.retina.pixelRatio,i.spin={center:o,direction:i.velocity.x>=0?t.RotateDirection.clockwise:t.RotateDirection.counterClockwise,angle:F()*u,radius:a,acceleration:i.retina.spinAcceleration}}(this.#u,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.#u,o=function(t){const e=t.getModifier("slow");return e?.enabled?e.speedFactor??1:1}(e),r=n.retina.reduceFactor,l=e.retina.moveSpeed,c=e.retina.moveDrift,h=e.size.max,d=l*(s.size?e.getRadius()/h:1)*o*(i.factor||1)*a,u=e.retina.maxSpeed;s.spin.enable?function(e,i,s,n){if(!i.spin)return;const o=i.spin.direction===t.RotateDirection.clockwise,r={x:o?Math.cos:Math.sin,y:o?Math.sin:Math.cos};i.position.x=i.spin.center.x+i.spin.radius*r.x(i.spin.angle)*n,i.position.y=i.spin.center.y+i.spin.radius*r.y(i.spin.angle)*n,i.spin.radius+=i.spin.acceleration*n;const l=Math.max(e.canvas.size.width,e.canvas.size.height),c=l*a;i.spin.radius>c?(i.spin.radius=c,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/l)}(n,e,d,r):on(e,s,d,u,c,r,i),function(t){const e=t.initialPosition,{dx:i,dy:s}=j(e,t.position),n=Math.abs(i),o=Math.abs(s),{maxDistance:r}=t.retina,l=r.horizontal,c=r.vertical;if(!l&&!c)return;if((l&&n>=l||c&&o>=c)&&!t.misplaced)t.misplaced=!!l&&n>l||!!c&&o>c,l&&(t.velocity.x=t.velocity.y*a-t.velocity.x),c&&(t.velocity.y=t.velocity.x*a-t.velocity.y);else if((!l||n<l)&&(!c||o<c)&&t.misplaced)t.misplaced=!1;else if(t.misplaced){const i=t.position,s=t.velocity;l&&(i.x<e.x&&s.x<0||i.x>e.x&&s.x>0)&&(s.x*=-F()),c&&(i.y<e.y&&s.y<0||i.y>e.y&&s.y>0)&&(s.y*=-F())}}(e)}preInit(){return this.#Le()}redrawInit(){return this.#Le()}update(){for(const t of this.pathGenerators.values())t.update()}async#Le(){const t=await(this.#p.getPathGenerators?.(this.#u,!0));if(t){this.availablePathGenerators=t,this.pathGenerators=new Map;for(const t of this.pathGenerators.values())t.init()}}}});var rn=Object.freeze({__proto__:null,EmittersPluginInstance:class{#u;#w;constructor(t,e){this.#w=t,this.#u=e,this.#w.initContainer(e)}async init(){const t=this.#u.actualOptions.emitters;if(T(t))for(const e of t)await this.#w.addEmitter(this.#u,e);else await this.#w.addEmitter(this.#u,t)}pause(){for(const t of this.#w.getArray(this.#u))t.pause()}play(){for(const t of this.#w.getArray(this.#u))t.play()}resize(){for(const t of this.#w.getArray(this.#u))t.resize()}stop(){this.#w.clear(this.#u)}update(t){this.#w.getArray(this.#u).forEach(e=>{e.update(t)})}}});const ln=new Map;var cn=Object.freeze({__proto__:null,ShapeManager:class{addShapeGenerator(t,e){this.getShapeGenerator(t)||ln.set(t,e)}getShapeGenerator(t){return ln.get(t)}getSupportedShapeGenerators(){return ln.keys()}}});var hn=Object.freeze({__proto__:null,EmittersInstancesManager:class{#Fe;#p;constructor(t){this.#Fe=new Map,this.#p=t}async addEmitter(t,e,i){const s=new Zi;s.load(e);const{EmitterInstance:n}=await Promise.resolve().then(function(){return fn}),o=new n(this.#p,t,e=>{this.removeEmitter(t,e)},s,i);return await o.init(),this.getArray(t).push(o),o}clear(t){this.initContainer(t),this.#Fe.set(t,[])}getArray(t){this.initContainer(t);let e=this.#Fe.get(t);return e||(e=[],this.#Fe.set(t,e)),e}initContainer(t){this.#Fe.has(t)||(this.#Fe.set(t,[]),t.getEmitter=e=>{const i=this.getArray(t);return void 0===e||k(e)?i[e??0]:i.find(t=>t.name===e)},t.addEmitter=async(e,i)=>this.addEmitter(t,e,i),t.removeEmitter=e=>{const i=t.getEmitter?.(e);i&&this.removeEmitter(t,i)},t.playEmitter=e=>{const i=t.getEmitter?.(e);i&&i.externalPlay()},t.pauseEmitter=e=>{const i=t.getEmitter?.(e);i&&i.externalPause()})}removeEmitter(t,e){const i=this.getArray(t).indexOf(e);i>=0&&this.getArray(t).splice(i,1)}}});var dn=Object.freeze({__proto__:null,MotionPluginInstance:class{#u;constructor(t){this.#u=t}async init(){const t=this.#u,e=t.actualOptions.motion;if(!e||!e.disable&&!e.reduce.value)return void(t.retina.reduceFactor=1);const i=ct("(prefers-reduced-motion: reduce)");if(!i)return void(t.retina.reduceFactor=1);this.#Ae(i);i.addEventListener("change",()=>{(async()=>{this.#Ae(i);try{await t.refresh()}catch{}})()}),await Promise.resolve()}#Ae(t){const e=this.#u,i=e.actualOptions.motion;i&&(t.matches?i.disable?e.retina.reduceFactor=0:e.retina.reduceFactor=i.reduce.value?1/i.reduce.factor:1:e.retina.reduceFactor=1)}}});function un(t,e,i,s){(t.paint??=new Se).fill={color:le.create(void 0,{value:e}),enable:s,opacity:i}}function pn(t,e,i,s){(t.paint??=new Se).stroke={color:le.create(void 0,{value:e}),opacity:i,width:s}}var fn=Object.freeze({__proto__:null,EmitterInstance:class{fill;name;options;position;size;spawnFillColor;spawnFillEnabled;spawnFillOpacity;spawnStrokeColor;spawnStrokeOpacity;spawnStrokeWidth;#u;#Be;#Ve;#Ue;#Me;#Ne;#He;#Ge;#We;#$e;#Z;#qe;#Ie;#p;#je;#ut;#Xe;#Ye;#Qe;#Ze;constructor(e,i,s,n,a){this.#p=e,this.#u=i,this.#je=s,this.#Be=0,this.#Ve=0,this.#Ue=0,this.#We=a,n instanceof Zi?this.options=n:(this.options=new Zi,this.options.load(n)),this.#Qe=i.retina.reduceFactor?G(this.options.life.delay??0)*r/i.retina.reduceFactor:1/0,this.position=this.#We??this.#Dt(),this.name=this.options.name,this.fill=this.options.fill,this.#He=!this.options.life.wait,this.#Ze=!1;const l=yt({},this.options.particles);if(l.move??={},l.move.direction??=this.options.direction,this.options.spawn.fill?.color&&(this.spawnFillColor=Ne(this.#p,this.options.spawn.fill.color)),this.options.spawn.stroke?.color&&(this.spawnStrokeColor=Ne(this.#p,this.options.spawn.stroke.color)),this.#Ie=!this.options.autoPlay,this.#qe=l,this.#Ye=this.#Ke(),this.size=this.#Ye.mode===t.PixelMode.percent?{width:this.#Ye.width/o*this.#u.canvas.size.width,height:this.#Ye.height/o*this.#u.canvas.size.height}:{width:this.#Ye.width,height:this.#Ye.height},this.#$e=this.options.life.count??-1,this.#Ge=this.#$e<=0,this.options.domId){const t=lt().getElementById(this.options.domId);t&&(this.#Z=new MutationObserver(()=>{this.resize()}),this.#ut=new ResizeObserver(()=>{this.resize()}),this.#Z.observe(t,{attributes:!0,attributeFilter:["style","width","height"]}),this.#ut.observe(t))}const c=this.options.shape,h=this.#p.emitterShapeManager?.getShapeGenerator(c.type);h&&(this.#Xe=h.generate(this.#u,this.position,this.size,this.fill,c.options)),this.#u.dispatchEvent("emitterCreated",{emitter:this}),this.play()}externalPause(){this.#Ie=!0,this.pause()}externalPlay(){this.#Ie=!1,this.play()}async init(){await(this.#Xe?.init())}pause(){this.#Ie||(this.#Ne=void 0)}play(){if(this.#Ie)return;if(!(this.#$e>0||this.#Ge)&&this.options.life.count||!(this.#He||this.#Ue>=(this.#Qe??0)))return;const t=this.#u;if(void 0===this.#Ne){const e=G(this.options.rate.delay);this.#Ne=t.retina.reduceFactor?e*r/t.retina.reduceFactor:1/0}(this.#$e>0||this.#Ge)&&this.#Je()}resize(){const e=this.#We,i=this.#u;this.position=e&&pt(e,i.canvas.size,C.origin)?e:this.#Dt(),this.#Ye=this.#Ke(),this.size=this.#Ye.mode===t.PixelMode.percent?{width:this.#Ye.width/o*i.canvas.size.width,height:this.#Ye.height/o*i.canvas.size.height}:{width:this.#Ye.width,height:this.#Ye.height},this.#Xe?.resize(this.position,this.size)}update(t){if(this.#Ie)return;const e=this.#u;this.#He&&(this.#He=!1,this.#Ue=this.#Qe??0,this.#Ve=this.#Ne??0),this.#Ze||(this.#Ze=!0,this.#ti(this.options.startCount)),void 0!==this.#Me&&(this.#Be+=t.value,this.#Be>=this.#Me&&(this.pause(),void 0!==this.#Qe&&(this.#Qe=void 0),this.#Ge||this.#$e--,this.#$e>0||this.#Ge?(this.position=this.#Dt(),this.#Xe?.resize(this.position,this.size),this.#Qe=e.retina.reduceFactor?G(this.options.life.delay??0)*r/e.retina.reduceFactor:1/0):this.#ei(),this.#Be-=this.#Me,this.#Me=void 0)),void 0!==this.#Qe&&(this.#Ue+=t.value,this.#Ue>=this.#Qe&&(this.#u.dispatchEvent("emitterPlay"),this.play(),this.#Ue-=this.#Qe,this.#Qe=void 0)),void 0!==this.#Ne&&(this.#Ve+=t.value,this.#Ve>=this.#Ne&&(this.#ii(),this.#Ve-=this.#Ne))}#Dt(){const t=this.#u;if(this.options.domId){const e=lt().getElementById(this.options.domId);if(e){const i=e.getBoundingClientRect(),s=t.retina.pixelRatio;return{x:(i.x+i.width*a)*s,y:(i.y+i.height*a)*s}}}return it({size:t.canvas.size,position:this.options.position})}#Ke(){const e=this.#u;if(this.options.domId){const i=lt().getElementById(this.options.domId);if(i){const s=i.getBoundingClientRect();return{width:s.width*e.retina.pixelRatio,height:s.height*e.retina.pixelRatio,mode:t.PixelMode.precise}}}return this.options.size??(()=>{const e=new Yi;return e.load({height:0,mode:t.PixelMode.percent,width:0}),e})()}#ei(){this.#Z?.disconnect(),this.#Z=void 0,this.#ut?.disconnect(),this.#ut=void 0,this.#je(this),this.#u.dispatchEvent("emitterDestroyed",{emitter:this})}#ii(){if(this.#Ie)return;const t=G(this.options.rate.quantity);this.#ti(t)}#ti(t){const e=vt(this.#qe)??{},i=this.options.spawn.fill?.color?.animation,s=this.options.spawn.fill?.enable??!!this.options.spawn.fill?.color,n=void 0===this.options.spawn.fill?.opacity?1:G(this.options.spawn.fill.opacity),o=this.options.spawn.stroke?.color?.animation,a=void 0===this.options.spawn.stroke?.opacity?1:G(this.options.spawn.stroke.opacity),r=void 0===this.options.spawn.stroke?.width?1:G(this.options.spawn.stroke.width),l=this.#u.retina.reduceFactor,c=!!i,h=!!o,d=!!this.#Xe,u=c||h,p=u||d,f=u?{h:m,s:v,l:b}:null,g=this.options.shape;for(let c=0;c<t*l;c++){const t=p?yt({},e):e;this.spawnFillOpacity=n,this.spawnFillEnabled=s,this.spawnStrokeOpacity=a,this.spawnStrokeWidth=r,this.spawnFillColor&&(i&&f&&(this.spawnFillColor.h=this.#si(i.h,this.spawnFillColor.h,f.h,3.6),this.spawnFillColor.s=this.#si(i.s,this.spawnFillColor.s,f.s),this.spawnFillColor.l=this.#si(i.l,this.spawnFillColor.l,f.l)),un(t,this.spawnFillColor,this.spawnFillOpacity,this.spawnFillEnabled)),this.spawnStrokeColor&&(o&&f&&(this.spawnStrokeColor.h=this.#si(o.h,this.spawnStrokeColor.h,f.h,3.6),this.spawnStrokeColor.s=this.#si(o.s,this.spawnStrokeColor.s,f.s),this.spawnStrokeColor.l=this.#si(o.l,this.spawnStrokeColor.l,f.l)),pn(t,this.spawnStrokeColor,this.spawnStrokeOpacity,this.spawnStrokeWidth));let l=this.position;if(this.#Xe){const e=this.#Xe.randomPosition();if(e){l=e.position;const i=g.replace;i.color&&e.color&&un(t,e.color,i.opacity?e.opacity??1:1,!0)}else l=null}l&&this.#u.particles.addParticle(l,t)}}#Je(){if(this.#Ie)return;const t=void 0!==this.options.life.duration?G(this.options.life.duration):void 0;(this.#$e>0||this.#Ge)&&void 0!==t&&t>0&&(this.#Me=t*r)}#si(t,e,i,s=1){const n=this.#u;if(!t.enable)return e;const o=H(t.offset),a=G(this.options.rate.delay),l=n.retina.reduceFactor?a*r/n.retina.reduceFactor:1/0;return(e+G(t.speed)*n.fpsLimit/l+o*s)%i}}});t.AnimatableColor=le,t.AnimationOptions=se,t.AnimationValueWithRandom=ve,t.Background=ce,t.BaseRange=jt,t.Circle=Xt,t.ColorAnimation=oe,t.Fill=pe,t.FullScreen=he,t.HslAnimation=ae,t.Move=xe,t.MoveAngle=fe,t.MoveCenter=ge,t.MoveGravity=ye,t.MovePath=we,t.OptionLoader=Qt,t.Options=Le,t.OptionsColor=re,t.OutModes=Pe,t.Paint=Se,t.ParticlesBounce=Oe,t.ParticlesBounceFactor=Ce,t.ParticlesDensity=De,t.ParticlesNumber=Ie,t.ParticlesNumberLimit=ke,t.ParticlesOptions=Ee,t.RangedAnimationOptions=ne,t.RangedAnimationValueWithRandom=be,t.Rectangle=Yt,t.ResizeEvent=de,t.Shape=Te,t.Spin=Me,t.Stroke=ze,t.ValueWithRandom=me,t.Vector=C,t.Vector3d=S,t.ZIndex=_e,t.alterHsl=si,t.animate=B,t.areBoundsInside=ft,t.calcExactPositionOrRandomFromSize=st,t.calcPositionFromSize=function(t){return void 0!==t.position?.x&&void 0!==t.position.y?{x:t.position.x*t.size.width/o,y:t.position.y*t.size.height/o}:void 0},t.calcPositionOrRandomFromSize=et,t.calcPositionOrRandomFromSizeRanged=it,t.calculateBounds=gt,t.cancelAnimation=V,t.canvasFirstIndex=0,t.canvasTag=g,t.checkDistance=Q,t.circleBounce=function(t,e){const{x:i,y:s}=t.velocity.sub(e.velocity),[n,o]=[t.position,e.position],{dx:a,dy:r}=j(o,n);if(i*a+s*r<0)return;const l=-Math.atan2(r,a),c=t.mass,h=e.mass,d=t.velocity.rotate(l),u=e.velocity.rotate(l),p=tt(d,u,c,h),f=tt(u,d,c,h),g=p.rotate(-l),y=f.rotate(-l);t.velocity.x=g.x*t.factor.x,t.velocity.y=g.y*t.factor.y,e.velocity.x=y.x*e.factor.x,e.velocity.y=y.y*e.factor.y},t.circleBounceDataFromParticle=function(t){return{position:t.getPosition(),radius:t.getRadius(),mass:t.getMass(),velocity:t.velocity,factor:C.create(G(t.options.bounce.horizontal.value),G(t.options.bounce.vertical.value))}},t.clamp=U,t.cloneStyle=wt,t.collisionVelocity=tt,t.colorMix=Ze,t.colorToRgb=Ue,t.countOffset=1,t.decayOffset=1,t.deepExtend=yt,t.defaultAlpha=1,t.defaultAngle=0,t.defaultCompositeValue=i,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=c,t.defaultTransformValue=1,t.defaultVelocity=0,t.defaultZoom=1,t.degToRad=Z,t.deleteCount=1,t.double=2,t.doublePI=u,t.empty=0,t.executeOnSingleOrMultiple=mt,t.generatedAttribute=e,t.generatedFalse=f,t.generatedTrue=p,t.getDistance=Y,t.getDistanceSq=X,t.getDistances=j,t.getFullScreenStyle=xt,t.getHslAnimationFromHsl=Je,t.getHslFromAnimation=Ke,t.getItemMapFromInitializer=Ct,t.getItemsFromInitializer=St,t.getLinkColor=function(t,e,i){if(i===h)return Xe();if(i!==d)return i;{const i=t.getFillColor()??t.getStrokeColor(),s=e?.getFillColor()??e?.getStrokeColor();if(i&&s&&e)return Ze(i,s,t.getRadius(),e.getRadius());{const t=i??s;if(t)return $e(t)}}},t.getLinkRandomColor=function(t,e,i,s){const n=D(e)?e:e.value;return n===h?s?Ve(t,{value:n}):i?h:d:n===d?d:Ve(t,{value:n})},t.getLogger=_t,t.getParticleBaseVelocity=J,t.getParticleDirectionAngle=K,t.getPosition=bt,t.getRandom=F,t.getRandomFn=function(){return R},t.getRandomInRange=A,t.getRandomRgbColor=Xe,t.getRangeMax=$,t.getRangeMin=W,t.getRangeValue=G,t.getStyleFromHsl=Qe,t.getStyleFromRgb=Ye,t.hMax=m,t.hMin=0,t.hPhase=60,t.half=a,t.hslToRgb=$e,t.hslToRgbFloat=qe,t.hslaToRgba=je,t.identity=1,t.inverseFactorNumerator=1,t.isArray=T,t.isBoolean=O,t.isFunction=function(t){return"function"==typeof t},t.isInArray=dt,t.isNull=_,t.isNumber=k,t.isObject=I,t.isPointInside=pt,t.isString=D,t.itemFromArray=ut,t.itemFromSingleOrMultiple=vt,t.lFactor=1,t.lMax=b,t.lMin=0,t.lengthOffset=1,t.loadExtendProperty=function(t,e,i){if(void 0!==i){const s=e;if("__proto__"===s||"constructor"===s||"prototype"===s)return;const n=t,o=Object.prototype.hasOwnProperty.call(n,s)?n[s]:{};n[s]=yt(o,i)}},t.loadLazyProperty=ee,t.loadMinIndex=0,t.loadNestedProperty=te,t.loadOptionProperty=ie,t.loadOptions=Zt,t.loadParticlesOptions=Re,t.loadProperty=Kt,t.loadRandomFactor=1e4,t.loadRangeProperty=Jt,t.manageListener=zt,t.maxNits=M,t.midColorValue=d,t.millisecondsToSeconds=r,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=N,t.none=0,t.one=1,t.originPoint=l,t.parseAlpha=nt,t.percentDenominator=o,t.phaseNumerator=1,t.quarter=w,t.randomColorValue=h,t.randomInRangeValue=H,t.rangeColorToHsl=Ne,t.rangeColorToRgb=Ve,t.removeDeleteCount=1,t.removeMinIndex=0,t.resizeEvent=s,t.rgbMax=y,t.rgbToHsl=He,t.ribbons=Vs,t.sMax=v,t.sMin=0,t.sNormalizedOffset=1,t.safeDocument=lt,t.safeMatchMedia=ct,t.safeMutationObserver=ht,t.setAnimationFunctions=function(t,e){L.nextFrame=t,L.cancel=e},t.setLogger=function(t){t.debug&&(Tt.debug=It(t.debug)),t.error&&(Tt.error=It(t.error)),t.info&&(Tt.info=It(t.info)),t.log&&(Tt.log=It(t.log)),t.trace&&(Tt.trace=It(t.trace)),t.verbose&&(Tt.verbose=It(t.verbose)),t.warning&&(Tt.warning=It(t.warning))},t.setRandom=function(t=Math.random){R=t},t.setRangeValue=q,t.sextuple=6,t.spatialHashGridCellSize=100,t.squareExp=2,t.stringToAlpha=function(t,e){return Be(t,e)?.a},t.stringToRgb=Ge,t.threeQuarter=P,t.triple=3,t.tryCountIncrement=1,t.tsParticles=ni,t.updateColor=ii,t.updateColorValue=ei,t.visibilityChangeEvent=n,t.zIndexFactorOffset=1}),Object.assign(globalThis.window||globalThis,{loadExtendProperty:(globalThis.__tsParticlesInternals.bundles.ribbons||{}).loadExtendProperty,loadLazyProperty:(globalThis.__tsParticlesInternals.bundles.ribbons||{}).loadLazyProperty,loadMinIndex:(globalThis.__tsParticlesInternals.bundles.ribbons||{}).loadMinIndex,loadNestedProperty:(globalThis.__tsParticlesInternals.bundles.ribbons||{}).loadNestedProperty,loadOptionProperty:(globalThis.__tsParticlesInternals.bundles.ribbons||{}).loadOptionProperty,loadOptions:(globalThis.__tsParticlesInternals.bundles.ribbons||{}).loadOptions,loadParticlesOptions:(globalThis.__tsParticlesInternals.bundles.ribbons||{}).loadParticlesOptions,loadProperty:(globalThis.__tsParticlesInternals.bundles.ribbons||{}).loadProperty,loadRandomFactor:(globalThis.__tsParticlesInternals.bundles.ribbons||{}).loadRandomFactor,loadRangeProperty:(globalThis.__tsParticlesInternals.bundles.ribbons||{}).loadRangeProperty,tsParticles:(globalThis.__tsParticlesInternals.bundles.ribbons||{}).tsParticles}),globalThis.__tsParticlesInternals=globalThis.__tsParticlesInternals||{},globalThis.__tsParticlesInternals.engine&&globalThis.__tsParticlesInternals.engine.tsParticles||(globalThis.__tsParticlesInternals.engine=globalThis.__tsParticlesInternals.bundles.ribbons||{}),delete(globalThis.window||globalThis).tsparticlesInternalExports;