PageSourceSearch

https://imsqueezy.com/assets/Container-ol37TOq8.js

js imsqueezy.com collected 2026-10-03 20:12:06 UTC 43,681 bytes, 1 lines download raw bytes

1import{R as Y,h as Ft,j as F,O as g,k as dt,l as c,H as B,n as nt,f as ot,o as S,q as x,P as Bt,V as lt,r as Q,M as T,t as Ht,L as rt,u as Vt,F as At,i as K,v as Ot,w as Rt,x as P,D as y,y as Ut,z as Et,B as ut,C as Nt,G as ft,I as Lt,J as pt,K as Z,N as qt,Q as D,U as jt,W as Wt,X as $t,Y as Xt,Z as Yt,s as q,$ as Qt,a0 as Zt,a1 as L,a2 as gt,a3 as Gt,a4 as Kt,a5 as R,a6 as j,a7 as v,a8 as C,a9 as mt,aa as k,ab as W,ac as _,ad as _t,ae as H,af as Jt,ag as te,ah as ee,ai as ie,aj as yt,ak as se,al as ne,am as at,an as $,ao as oe,ap as re,aq as ae,ar as he,as as le,at as ht,au as ce,av as I,aw as wt,ax as de,ay as J,az as vt,aA as Pt,aB as ue,aC as X,aD as z,aE as fe,aF as bt,aG as tt,aH as pe,aI as Ct,aJ as xt,aK as ge,aL as me,aM as ye,aN as we,aO as et}from"./utils-CoLvW3q7.js";import{P as it}from"./Paint-Cg3yiYTF.js";class It{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 V extends It{radius;constructor(t,e,i){super(t,e,Y.circle),this.radius=i}contains(t){return Ft(t,this.position,this.radius)}intersects(t){const e=this.position,i=t.position,s=this.radius,n=Math.abs(i.x-e.x),r=Math.abs(i.y-e.y);if(t instanceof V||t.type===Y.circle){const a=t,h=s+a.radius,l=Math.hypot(n,r);return h>l}else if(t instanceof A||t.type===Y.rectangle){const a=t,{width:h,height:l}=a.size;return Math.pow(n-h,F)+Math.pow(r-l,F)<=s**F||n<=s+h&&r<=s+l||n<=h||r<=l}return!1}reset(t,e,i){return this._resetPosition(t,e),this.radius=i,this}}class A extends It{size;constructor(t,e,i,s){super(t,e,Y.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 V)return t.intersects(this);if(!(t instanceof A))return!1;const e=this.size.width,i=this.size.height,s=this.position,n=t.position,r=t.size,a=r.width,h=r.height;return n.x<s.x+e&&n.x+a>s.x&&n.y<s.y+i&&n.y+h>s.y}reset(t,e,i,s){return this._resetPosition(t,e),this.size.width=i,this.size.height=s,this}}class ve extends g{color;draw;element;image="";opacity=1;position="";repeat="";size="";constructor(){super(),this.color=new dt,this.color.value=""}doLoad(t){t.color!==void 0&&(this.color=dt.create(this.color,t.color)),c(this,"element",t.element),c(this,"draw",t.draw),c(this,"image",t.image),c(this,"position",t.position),c(this,"repeat",t.repeat),c(this,"size",t.size),c(this,"opacity",t.opacity)}}class Pe extends g{enable=!0;zIndex=0;doLoad(t){c(this,"enable",t.enable),c(this,"zIndex",t.zIndex)}}const be=400,Ce=0,xe=o=>String(o);class ze extends g{enable=!0;mode=B.standard;peakNits=be;doLoad(t){if(t.enable!==void 0&&!nt(t.enable))throw new Error(`Invalid HDR "enable" value: expected a boolean, got "${String(t.enable)}"`);if(t.mode!==void 0&&(typeof t.mode!="string"||!Object.values(B).includes(t.mode)))throw new Error(`Invalid HDR "mode" value: expected one of ${Object.values(B).join(", ")}, got "${xe(t.mode)}"`);if(t.peakNits!==void 0&&(!ot(t.peakNits)||!Number.isFinite(t.peakNits)||t.peakNits<=Ce))throw new Error(`Invalid HDR "peakNits" value: expected a positive number, got "${String(t.peakNits)}"`);c(this,"enable",t.enable),c(this,"mode",t.mode),c(this,"peakNits",t.peakNits)}}class ke extends g{delay=.5;enable=!0;doLoad(t){c(this,"delay",t.delay),c(this,"enable",t.enable)}}class De extends g{close=!0;options={};type=[];doLoad(t){const e=t.options;if(e!==void 0)for(const i in e){const s=e[i];s&&(this.options[i]=S(this.options[i]??{},s))}c(this,"close",t.close),c(this,"type",t.type)}}class Se extends g{offset=0;value=90;doLoad(t){x(this,"offset",t.offset),x(this,"value",t.value)}}class Me extends g{mode=Bt.percent;radius=0;x=50;y=50;doLoad(t){c(this,"x",t.x),c(this,"y",t.y),c(this,"mode",t.mode),c(this,"radius",t.radius)}}class Oe extends g{acceleration=9.81;enable=!1;inverse=!1;maxSpeed=50;doLoad(t){x(this,"acceleration",t.acceleration),c(this,"enable",t.enable),c(this,"inverse",t.inverse),x(this,"maxSpeed",t.maxSpeed)}}class Re extends g{clamp=!0;delay=new lt;enable=!1;generator;options={};doLoad(t){c(this,"clamp",t.clamp),this.delay.load(t.delay),c(this,"enable",t.enable),this.generator=t.generator,t.options&&(this.options=S(this.options,t.options))}}class Ee extends g{bottom;default=Q.out;left;right;top;doLoad(t){t.default!==void 0&&(this.default=t.default),this.bottom=t.bottom??t.default,this.left=t.left??t.default,this.right=t.right??t.default,this.top=t.top??t.default}}class Le extends g{acceleration=0;enable=!1;position;doLoad(t){x(this,"acceleration",t.acceleration),c(this,"enable",t.enable),t.position&&(this.position=S({},t.position))}}class Ie extends g{angle=new Se;center=new Me;decay=0;direction=T.none;distance={};drift=0;enable=!1;gravity=new Oe;outModes=new Ee;path=new Re;random=!1;size=!1;speed=2;spin=new Le;straight=!1;vibrate=!1;warp=!1;doLoad(t){this.angle.load(ot(t.angle)?{value:t.angle}:t.angle),this.center.load(t.center),x(this,"decay",t.decay),c(this,"direction",t.direction),t.distance!==void 0&&(this.distance=ot(t.distance)?{horizontal:t.distance,vertical:t.distance}:{...t.distance}),x(this,"drift",t.drift),c(this,"enable",t.enable),this.gravity.load(t.gravity);const e=t.outModes;e!==void 0&&(Ht(e)?this.outModes.load(e):this.outModes.load({default:e})),this.path.load(t.path),c(this,"random",t.random),c(this,"size",t.size),x(this,"speed",t.speed),this.spin.load(t.spin),c(this,"straight",t.straight),c(this,"vibrate",t.vibrate),c(this,"warp",t.warp)}}class zt extends lt{value=1}class Te extends g{horizontal=new zt;vertical=new zt;doLoad(t){this.horizontal.load(t.horizontal),this.vertical.load(t.vertical)}}class Fe extends g{enable=!1;height=1080;width=1920;doLoad(t){c(this,"enable",t.enable),c(this,"width",t.width),c(this,"height",t.height)}}class Be extends g{mode=rt.delete;value=0;doLoad(t){c(this,"mode",t.mode),c(this,"value",t.value)}}class He extends g{density=new Fe;limit=new Be;value=0;doLoad(t){this.density.load(t.density),this.limit.load(t.limit),c(this,"value",t.value)}}class Ve extends g{close=!0;options={};type="circle";doLoad(t){const e=t.options;if(e!==void 0)for(const i in e){const s=e[i];s&&(this.options[i]=S(this.options[i]??{},s))}c(this,"close",t.close),c(this,"type",t.type)}}class Ae extends lt{opacityRate=1;sizeRate=1;velocityRate=1;doLoad(t){super.doLoad(t),c(this,"opacityRate",t.opacityRate),c(this,"sizeRate",t.sizeRate),c(this,"velocityRate",t.velocityRate)}}class Ue extends g{bounce=new Te;effect=new De;groups={};move=new Ie;number=new He;paint;palette;reduceDuplicates=!1;shape=new Ve;zIndex=new Ae;#t;#e;constructor(t,e){super(),this.#e=t,this.#t=e,this.paint=new it,this.paint.color=new Vt,this.paint.color.value="#fff",this.paint.fill=new At,this.paint.fill.enable=!0}doLoad(t){if(t.palette&&(this.palette=t.palette,this.#n(this.palette)),t.groups!==void 0)for(const i of Object.keys(t.groups)){if(!(i in t.groups))continue;const s=t.groups[i];s!==void 0&&(this.groups[i]=S(this.groups[i]??{},s))}t.reduceDuplicates!==void 0&&(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&&(K(e)?this.paint=Ot(e,i=>{const s=new it;return s.load(i),s}):K(this.paint)?(this.paint=new it,this.paint.load(e)):this.paint.load(e)),this.shape.load(t.shape),this.zIndex.load(t.zIndex),this.#t){for(const s of this.#e.plugins)s.loadParticlesOptions&&s.loadParticlesOptions(this.#t,this,t);const i=this.#e.updaters.get(this.#t);if(i)for(const s of i)s.loadOptions&&s.loadOptions(this,t)}}#n(t){const e=this.#e.getPalette(t);if(!e)return;const i=e.colors,s=0,n=1,r=0,a={},h=K(i)?i:[i],l=h.flatMap(d=>{const u=d.fill,p=d.stroke,m=u?{color:{value:u.value},enable:u.enable,opacity:u.opacity}:void 0;return p?[{fill:m,stroke:{color:{value:p.value},opacity:p.opacity,width:p.width||s}}]:[{fill:m}]}),f=l.length>n?l:l[r]??a;this.load({paint:f,blend:{enable:!0,mode:e.blendMode}})}}function ct(o,t,...e){const i=new Ue(o,t);return Rt(i,...e),i}class Ne extends g{autoPlay=!0;background;clear=!0;defaultThemes={};delay=0;detectRetina=!0;duration=0;fpsLimit=120;fullScreen;hdr;key;name;palette;particles;pauseOnBlur=!0;pauseOnOutsideViewport=!0;preset;resize;smooth=!1;style={};zLayers=100;#t;#e;constructor(t,e){super(),this.#e=t,this.#t=e,this.background=new ve,this.fullScreen=new Pe,this.hdr=new ze,this.particles=ct(this.#e,this.#t),this.resize=new ke}doLoad(t){t.preset!==void 0&&(this.preset=t.preset,Ot(this.preset,s=>{this.#i(s)})),t.palette!==void 0&&(this.palette=t.palette,this.#n(this.palette)),c(this,"autoPlay",t.autoPlay),c(this,"clear",t.clear),c(this,"key",t.key),c(this,"name",t.name),x(this,"delay",t.delay),c(this,"detectRetina",t.detectRetina),x(this,"duration",t.duration),c(this,"fpsLimit",t.fpsLimit);const e=t.hdr;nt(e)?(this.hdr.enable=e,this.hdr.mode=B.standard,this.hdr.peakNits=400):this.hdr.load(e),c(this,"pauseOnBlur",t.pauseOnBlur),c(this,"pauseOnOutsideViewport",t.pauseOnOutsideViewport),c(this,"zLayers",t.zLayers),this.background.load(t.background);const i=t.fullScreen;nt(i)?this.fullScreen.enable=i:this.fullScreen.load(i),this.particles.load(t.particles),this.resize.load(t.resize),this.style=S(this.style,t.style),c(this,"smooth",t.smooth),this.#e.plugins.forEach(s=>{s.loadOptions(this.#t,this,t)})}#n(t){const e=this.#e.getPalette(t);e&&this.load({background:{color:e.background},blend:{enable:!0,mode:e.blendMode},particles:{palette:t}})}#i(t){this.load(this.#e.getPreset(t))}}const qe=0,je=1;function We(o,t,e){const i=t[e];i!==void 0&&(o[e]=(o[e]??qt)*i)}class $e{#t;#e;#n;#i;#o;#s;#a;#h;#c;#l;#d;#f;#p;#u;#r;#m={};#g=[void 0,void 0];#y={};constructor(t,e,i){this.#p=t,this.#s=e,this.#i=i,this.#a=null,this.#t=null,this.#e=new Set,this.#r=[],this.#u=[],this.#n=[],this.#o=[],this.#c=[],this.#l=[],this.#d=[],this.#f={0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[]}}get settings(){return this.#h}canvasClear(){this.#s.actualOptions.clear&&this.draw(t=>{t.clearRect(P.x,P.y,this.#i.size.width,this.#i.size.height)})}clear(){for(const t of this.#n)if(t.canvasClear?.()??!1)return;for(const t of Object.values(y))if(typeof t=="number"){for(const e of this.#w(t))if(e.canvasClear?.()??!1)return}this.canvasClear()}destroy(){this.stop(),this.#t=null,this.#e.clear(),this.#r=[],this.#u=[],this.#n=[],this.#o=[],this.#c=[],this.#l=[],this.#d=[];for(const t of Object.values(y))typeof t=="number"&&(this.#f[t]=[])}draw(t){const e=this.#a;if(e)return t(e)}
vendor: 4,104 bytes, line 1
1drawParticle(t,e){if(t.spawning||t.destroyed)return;const i=t.getRadius();if(i<=Ut)return;const s=t.getFillColor(),n=t.getStrokeColor();let[r,a]=this.#O(t);if(r??=s,a??=n,!r&&!a)return;const h=this.#s,l=t.options.zIndex,f=Et-t.zIndexFactor,{fillOpacity:d,opacity:u,strokeOpacity:p}=t.getOpacity(),m=this.#y,M=this.#m,U=r?ut(r,h.hdr,d*u,h.peakNits,h.hdrMode):void 0,N=a?ut(a,h.hdr,p*u,h.peakNits,h.hdrMode):U;m.a=m.b=m.c=m.d=void 0,M.fill=U,M.stroke=N,this.draw(w=>{for(const O of this.#d)O.drawParticleSetup?.(w,t,e);this.#v(w,t,i,u,M,m),this.#k({container:h,context:w,particle:t,delta:e,colorStyles:M,radius:i*f**l.sizeRate,opacity:u,transform:m}),this.#P(t);for(const O of this.#l)O.drawParticleCleanup?.(w,t,e)})}drawParticlePlugins(t,e){this.draw(i=>{for(const s of this.#c)this.#C(i,s,t,e)})}drawParticles(t){const{particles:e,actualOptions:i}=this.#s;this.clear(),e.update(t),this.draw(s=>{const n=this.#i.size.width,r=this.#i.size.height;if(this.#t)try{s.drawImage(this.#t,P.x,P.y,n,r)}catch{this.#x("background-element-draw-error","Error drawing background element onto canvas")}const a=i.background;if(a.draw)try{a.draw(s,t)}catch{this.#x("background-draw-error","Error in background.draw callback")}for(const h of this.#w(y.BackgroundMask))h.canvasPaint?.();for(const h of this.#w(y.CanvasSetup))h.drawSettingsSetup?.(s,t);for(const h of this.#w(y.PluginContent))h.draw?.(s,t);e.drawParticles(t);for(const h of this.#w(y.CanvasCleanup))h.clearDraw?.(s,t),h.drawSettingsCleanup?.(s,t)})}init(){this.initUpdaters(),this.initPlugins(),this.#R(),this.paint()}initPlugins(){this.#n=[],this.#o=[],this.#c=[],this.#d=[],this.#l=[];for(const t of Object.values(y))typeof t=="number"&&(this.#f[t]=[]);for(const t of this.#s.plugins)(t.particleFillColor??t.particleStrokeColor)&&this.#o.push(t),t.drawParticle&&this.#c.push(t),t.drawParticleSetup&&this.#d.push(t),t.drawParticleCleanup&&this.#l.push(t),t.canvasClear&&this.#n.push(t),t.canvasPaint&&this.#w(y.BackgroundMask).push(t),t.drawSettingsSetup&&this.#w(y.CanvasSetup).push(t),t.draw&&this.#w(y.PluginContent).push(t),(t.clearDraw??t.drawSettingsCleanup)&&this.#w(y.CanvasCleanup).push(t)}initUpdaters(){this.#r=[],this.#u=[];for(const t of this.#s.particleUpdaters)t.afterDraw&&this.#u.push(t),(t.getColorStyles??t.getTransformValues??t.beforeDraw)&&this.#r.push(t)}paint(){let t=!1;for(const e of this.#w(y.BackgroundMask))if(t=e.canvasPaint?.()??!1,t)break;t||this.paintBase()}paintBase(t){this.draw(e=>{e.fillStyle=t??"rgba(0,0,0,0)",e.fillRect(P.x,P.y,this.#i.size.width,this.#i.size.height)})}paintImage(t,e){this.draw(i=>{if(!t)return;const s=i.globalAlpha;i.globalAlpha=e,i.drawImage(t,P.x,P.y,this.#i.size.width,this.#i.size.height),i.globalAlpha=s})}setContext(t){this.#a=t,this.#a&&(this.#a.globalCompositeOperation=Nt)}setContextSettings(t){this.#h=t}stop(){this.draw(t=>{t.clearRect(P.x,P.y,this.#i.size.width,this.#i.size.height)})}#P(t){for(const e of this.#u)e.afterDraw?.(t)}#v(t,e,i,s,n,r){for(const a of this.#r){if(a.getColorStyles){const{fill:h,stroke:l}=a.getColorStyles(e,t,i,s);h&&(n.fill=h),l&&(n.stroke=l)}if(a.getTransformValues){const h=a.getTransformValues(e);for(const l in h)We(r,h,l)}a.beforeDraw?.(e)}}#b(t,e){if(!t?.drawAfter)return;const{particle:i}=e;i.effect&&t.drawAfter(e)}#z(t,e){if(!t?.drawBefore)return;const{particle:i}=e;i.effect&&t.drawBefore(e)}#k(t){const{container:e,context:i,particle:s,delta:n,colorStyles:r,radius:a,opacity:h,transform:l}=t,{effectDrawers:f,shapeDrawers:d}=e,u=s.getPosition(),p=s.getTransformData(l),m=Lt,M={x:u.x,y:u.y};i.setTransform(p.a,p.b,p.c,p.d,u.x,u.y),r.fill&&(i.fillStyle=r.fill);const U=!!s.fillEnabled,N=s.strokeWidth??ft;i.lineWidth=N,r.stroke&&(i.strokeStyle=r.stroke);const w={context:i,particle:s,radius:a,drawRadius:a*m,opacity:h,delta:n,pixelRatio:e.retina.pixelRatio,fill:U,stroke:N>ft,transformData:p,position:{...u},drawPosition:M,drawScale:m};for(const Tt of e.plugins)Tt.drawParticleTransform?.(w);const O=s.effect?f.get(s.effect):void 0,G=s.shape?d.get(s.shape):void 0;this.#z(O,w),this.#M(G,w),this.#D(G,w),this.#S(G,w),this.#b(O,w),i.resetTransform()}
1#C(t,e,i,s){e.drawParticle&&e.drawParticle(t,i,s)}#D(t,e){if(!t)return;const{context:i,fill:s,particle:n,stroke:r}=e;n.shape&&(i.beginPath(),t.draw(e),n.shapeClose&&i.closePath(),s&&i.fill(),r&&i.stroke())}#S(t,e){if(!t?.afterDraw)return;const{particle:i}=e;i.shape&&t.afterDraw(e)}#M(t,e){if(!t?.beforeDraw)return;const{particle:i}=e;i.shape&&t.beforeDraw(e)}#w(t){return this.#f[t]}#O(t){let e,i;for(const s of this.#o)if(!e&&s.particleFillColor&&(e=pt(this.#p,s.particleFillColor(t))),!i&&s.particleStrokeColor&&(i=pt(this.#p,s.particleStrokeColor(t))),e&&i)break;return this.#g[qe]=e,this.#g[je]=i,this.#g}#R(){const t=this.#s.actualOptions.background;if(this.#t=null,!!t.element)if(typeof t.element=="string"){if(typeof document<"u"){const e=document.querySelector(t.element);typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof HTMLVideoElement<"u"&&e instanceof HTMLVideoElement||typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement?this.#t=e:e?this.#x("background-element-not-supported",`Background element "${t.element}" is not a supported drawable element (canvas, video, or img)`):this.#x("background-element-not-found",`Background element selector "${t.element}" not found`)}}else(typeof HTMLCanvasElement<"u"&&t.element instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&t.element instanceof OffscreenCanvas||typeof HTMLVideoElement<"u"&&t.element instanceof HTMLVideoElement||typeof HTMLImageElement<"u"&&t.element instanceof HTMLImageElement)&&(this.#t=t.element)}#x(t,e){this.#e.has(t)||(this.#e.add(t),Z().warning(e))}}const kt=new WeakMap,Xe=o=>{const t=kt.get(o);if(t)return t;if(typeof o.transferControlToOffscreen!="function")throw new TypeError("OffscreenCanvas is required but not supported by this browser");try{const e=o.transferControlToOffscreen();return kt.set(o,e),e}catch{throw new TypeError("OffscreenCanvas transfer failed")}},Ye=o=>typeof HTMLCanvasElement<"u"&&o instanceof HTMLCanvasElement;function Dt(o,t,e=!1){if(!t)return;const i=o,s=i.style,n=new Set;for(let r=0;r<s.length;r++){const a=s.item(r);a&&n.add(a)}for(let r=0;r<t.length;r++){const a=t.item(r);a&&n.add(a)}for(const r of n){const a=t.getPropertyValue(r);a?s.setProperty(r,a,e?"important":""):s.removeProperty(r)}}class Qe{domElement;render;renderCanvas;size;zoom=Lt;#t;#e;#n;#i;#o;#s;#a;#h;#c;#l;constructor(t,e){this.#s=t,this.#t=e,this.render=new $e(t,e,this),this.#c={height:0,width:0};const i=e.retina.pixelRatio,s=this.#c;this.size={height:s.height*i,width:s.width*i},this.#e=!1,this.#h=[],this.#a="none"}get#d(){return this.#t.actualOptions.fullScreen.enable}destroy(){this.stop(),this.#e?(this.domElement?.remove(),this.domElement=void 0,this.renderCanvas=void 0):this.#P(),this.render.destroy(),this.#h=[]}getZoomCenter(){const t=this.#t.retina.pixelRatio,{width:e,height:i}=this.size;return this.#l?this.#l:{x:e*D/t,y:i*D/t}}init(){this.#v(t=>{t.disconnect()}),this.#i=jt(t=>{for(const e of t)e.type==="attributes"&&e.attributeName==="style"&&this.#y()}),this.resize(),this.#r(),this.#v(t=>{const e=this.domElement;!e||!(e instanceof Node)||t.observe(e,{attributes:!0})}
vendor: 2,672 bytes, line 1
1),this.initPlugins(),this.#p(),this.initBackground(),this.#u(),this.render.init()}initBackground(){const t=this.#t,e=t.actualOptions,i=e.background,s=this.domElement;if(!s)return;const n=s.style,r=Wt(this.#s,i.color);if(r){const a=t.actualOptions.hdr;n.backgroundColor=$t(r,t.hdr,i.opacity,a.peakNits,a.mode)}else n.backgroundColor="";n.backgroundImage=i.image||"",n.backgroundPosition=i.position||"",n.backgroundRepeat=i.repeat||"",n.backgroundSize=i.size||""}initPlugins(){this.#h=[];for(const t of this.#t.plugins)t.resize&&this.#h.push(t)}loadCanvas(t){this.#e&&this.domElement&&this.domElement.remove();const e=Ye(t)?t:void 0;this.domElement=e,this.#e=e?e.dataset[Xt]==="true":!1,this.renderCanvas=e?Xe(e):t;const i=this.domElement;i&&(i.ariaHidden="true",this.#o=Yt(i.style));const s=this.#c,n=this.renderCanvas;i?(s.height=i.offsetHeight,s.width=i.offsetWidth):(s.height=n.height,s.width=n.width);const r=this.#t.retina.pixelRatio,a=this.size;n.height=a.height=s.height*r,n.width=a.width=s.width*r}resize(){const t=this.domElement;if(!t)return!1;const e=this.#t,i=this.renderCanvas;if(i===void 0)return!1;const s=e.canvas.#c,n={width:t.offsetWidth,height:t.offsetHeight},r=e.retina.pixelRatio,a={width:n.width*r,height:n.height*r};if(n.height===s.height&&n.width===s.width&&a.height===i.height&&a.width===i.width)return!1;const h={...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.#t.started&&e.particles.setResizeFactor({width:s.width/h.width,height:s.height/h.height}),!0}setPointerEvents(t){this.domElement&&(this.#a=t,this.#y())}setZoom(t,e){this.zoom=t,this.#l=e}stop(){this.#v(t=>{t.disconnect()}),this.#i=void 0,this.#g(),this.render.stop()}async windowResize(){if(!this.domElement||!this.resize())return;const t=this.#t,e=t.updateActualOptions();t.particles.setDensity(),this.#f(),e&&await t.refresh()}#f(){for(const t of this.#h)t.resize?.()}#p(){const t=this.#t,e=t.actualOptions.hdr.enable&&q("(color-gamut: p3)")?.matches&&q("(dynamic-range: high)")?.matches;t.hdr=e??!1,t.hdrMode=t.actualOptions.hdr.mode,t.peakNits=t.actualOptions.hdr.peakNits;const i=this.renderCanvas;if(!i)return;this.render.setContextSettings({alpha:!0,desynchronized:!0,willReadFrequently:!1,...e?{colorSpace:"display-p3",colorType:"float16"}:{colorSpace:"srgb"}});let s;try{s=i.getContext("2d",this.render.settings)}catch{s=null}if(e&&!s){t.hdr=!1;const n={alpha:!0,desynchronized:!0,willReadFrequently:!1,colorSpace:"srgb"};this.render.setContextSettings(n);try{s=i.getContext("2d",n)}catch{s=null}}this.render.setContext(s)}#u(){this.#g();const t=q("(color-gamut: p3)"),e=q("(dynamic-range: high)"),i=()=>
1{this.#m(),this.#p(),this.initBackground()},s=[];t&&(t.addEventListener("change",i),s.push({handler:i,mql:t})),e&&(e.addEventListener("change",i),s.push({handler:i,mql:e})),this.#n=s}#r(){const t=this.domElement,e=this.#t.actualOptions;if(t){this.#d?this.#b():this.#P();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")}}}#m(){const t=this.renderCanvas;t&&(this.domElement||(this.renderCanvas=new OffscreenCanvas(t.width,t.height)))}#g(){if(this.#n){for(const{handler:t,mql:e}of this.#n)e.removeEventListener("change",t);this.#n=void 0}}#y(){const t=this.domElement;if(!t)return;this.#v(i=>{i.disconnect()}),this.#r(),this.initBackground();const e=this.#a;t.style.pointerEvents=e,t.style.setProperty("pointer-events",e),this.#v(i=>{t instanceof Node&&i.observe(t,{attributes:!0})})}#P(){const t=this.domElement,e=this.#o;!t||!e||Dt(t,e,!0)}#v(t){this.#i&&t(this.#i)}#b(){const t=this.domElement;t&&Dt(t,Qt(this.#t.actualOptions.fullScreen.zIndex),!0)}}class Ze{#t;#e;#n;#i;constructor(t){this.#t=t,this.#e={visibilityChange:()=>{this.#o()},resize:()=>{this.#s()}}}addListeners(){this.#a(!0)}removeListeners(){this.#a(!1)}#o(){const t=this.#t;t.actualOptions.pauseOnBlur&&(Zt().hidden?(t.pageHidden=!0,t.pause()):(t.pageHidden=!1,t.animationStatus?t.play(!0):t.draw(!0)))}#s(){this.#i&&(clearTimeout(this.#i),this.#i=void 0);const t=async()=>{await this.#t.canvas.windowResize()};this.#i=setTimeout(()=>{t()},this.#t.actualOptions.resize.delay*L)}#a(t){const e=this.#e;this.#h(t),gt(document,Gt,e.visibilityChange,t,!1)}#h(t){const e=this.#e,i=this.#t;if(!i.actualOptions.resize.enable)return;if(typeof ResizeObserver>"u"){gt(globalThis,Kt,e.resize,t);return}const n=i.canvas.domElement;this.#n&&!t?(n&&this.#n.unobserve(n),this.#n.disconnect(),this.#n=void 0):!this.#n&&t&&n&&(this.#n=new ResizeObserver(r=>{r.find(h=>h.target===n)&&this.#s()}),this.#n.observe(n))}}function Ge(o,t,e,i){const s=t.options[o];return S({close:t.close},I(s,e,i))}function Ke(o,t,e,i){const s=t.options[o];return S({close:t.close},I(s,e,i))}function St(o){if(!de(o.outMode,o.checkModes))return;const t=o.radius*H;o.coord>o.maxCoord-t?o.setCb(-o.radius):o.coord<t&&o.setCb(o.radius)}function st(o,t){const e=o%t;return e<C?e+t:e}function _e(o,t,e){o.id=t,o.group=e,o.justWarped=!1,o.effectClose=!0,o.shapeClose=!0,o.pathRotation=!1,o.lastPathTime=0,o.destroyed=!1,o.unbreakable=!1,o.isRotating=!1,o.rotation=0,o.misplaced=!1,o.retina={maxDistance:{},maxSpeed:0,moveDrift:0,moveSpeed:0,sizeAnimationSpeed:0},o.size={value:1,max:1,min:1,enable:!1},o.outType=ht.normal,o.ignoresResizeRatio=!0}function Je(o,t,e,i){const s=t.actualOptions,n=ct(e,t,s.particles),r=n.reduceDuplicates;o.effect=I(n.effect.type,o.id,r),o.shape=I(n.shape.type,o.id,r);const a=n.effect,h=n.shape;if(i){if(i.effect){const d=i.effect.type;if(d&&d!==o.effect){const u=I(d,o.id,r);u&&(o.effect=u)}a.load(i.effect)}if(i.shape){const d=i.shape.type;if(d&&d!==o.shape){const u=I(d,o.id,r);u&&(o.shape=u)}h.load(i.shape)}}if(o.effect===wt){const d=[...t.effectDrawers.keys()];o.effect=d[Math.floor(at()*d.length)]}if(o.shape===wt){const d=[...t.shapeDrawers.keys()];o.shape=d[Math.floor(at()*d.length)]}o.effectData=o.effect?Ge(o.effect,a,o.id,r):void 0,o.shapeData=o.shape?Ke(o.shape,h,o.id,r):void 0,n.load(i);const l=o.effectData,f=o.shapeData;return l&&n.load(l.particles),f&&n.load(f.particles),o.effectClose=l?.close??n.effect.close,o.shapeClose=f?.close??n.shape.close,n}function ti(o,t){let e,i;o.effect&&(e=t.effectDrawers.get(o.effect)),e?.loadEffect&&e.loadEffect(o),o.shape&&(i=t.shapeDrawers.get(o.shape)),i?.loadShape&&i.loadShape(o);const s=i?.getSidesCount;s&&(o.sides=s(o))}function ei(o,t){for(const e of o)e.preInit?.(t)}function ii(o,t){for(const e of o)e.init(t)}function si(o,t){const e=t.shape?o.shapeDrawers.get(t.shape):void 0;(t.effect?o.effectDrawers.get(t.effect):void 0)?.particleInit?.(o,t),e?.particleInit?.(o,t)}function ni(o,t){for(const e of o.particleCreatedPlugins)e.particleCreated?.(t)}class oi{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;#t={fillOpacity:R,opacity:R,strokeOpacity:R};#e=j.origin;#n={sin:0,cos:0};#i={a:1,b:0,c:0,d:1};#o;#s=[];#a;constructor(t,e){this.#a=t,this.#o=e}addModifier(t){this.#s.push(t),this.#s.sort((e,i)=>e.priority-i.priority)}clearModifiers(){this.#s.length=0}destroy(t){if(this.unbreakable||this.destroyed)return;this.destroyed=!0,this.clearModifiers();const e=this.#o;(this.shape?e.shapeDrawers.get(this.shape):void 0)?.particleDestroy?.(this);for(const s of e.particleDestroyedPlugins)s.particleDestroyed?.(this,t);for(const s of e.particleUpdaters)s.particleDestroyed?.(this,t);this.#o.dispatchEvent(v.particleDestroyed,{particle:this})}draw(t){const e=this.#o,i=e.canvas.render;
1i.drawParticlePlugins(this,t),i.drawParticle(this,t)}getAngle(){return this.rotation+(this.pathRotation?this.velocity.angle:C)}getFillColor(){return this.#m(this.#h(mt(this.fillColor),t=>t.fillColor))}getMass(){return this.getRadius()**F*Math.PI*D}getModifier(t){return this.#s.find(e=>e.id===t)}getOpacity(){const t=this.options.zIndex,e=Et-this.zIndexFactor,i=e**t.opacityRate,s=k(this.opacity?.value??R),n=this.#h(void 0,l=>l.opacity),r=n??s,a=this.fillOpacity??R,h=this.strokeOpacity??R;return this.#t.fillOpacity=a,this.#t.opacity=r*i,this.#t.strokeOpacity=h,this.#t}getPosition(){return this.#e.x=this.position.x+this.offset.x,this.#e.y=this.position.y+this.offset.y,this.#e.z=this.position.z,this.#e}getRadius(){return this.#h(this.size.value,t=>t.radius)}getRotateData(){const t=this.getAngle();return this.#n.sin=Math.sin(t),this.#n.cos=Math.cos(t),this.#n}getStrokeColor(){return this.#m(this.#h(mt(this.strokeColor),t=>t.strokeColor))}getTransformData(t){const e=this.getRotateData(),i=this.isRotating;return this.#i.a=e.cos*(t.a??W.a),this.#i.b=i?e.sin*(t.b??_):t.b??W.b,this.#i.c=i?-e.sin*(t.c??_):t.c??W.c,this.#i.d=e.cos*(t.d??W.d),this.#i}init(t,e,i,s){const n=this.#o;_e(this,t,s),this.options=Je(this,n,this.#a,i),n.retina.initParticle(this),ei(n.particleUpdaters,this),this.#g(e),this.initialVelocity=this.#l(),this.velocity=this.initialVelocity.copy(),this.zIndexFactor=this.position.z/n.zLayers,this.sides=24,ti(this,n),this.spawning=!1,ii(n.particleUpdaters,this),si(n,this),ni(n,this)}isInsideCanvas(t){return this.#r({direction:t}).inside}isInsideCanvasForOutMode(t,e){return this.#r({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=st(t,J);return e>=Math.PI*D&&e<Math.PI*_t*D}if(this.roll.horizontal){const e=st(t+Math.PI*D,J);return e>=Math.PI&&e<Math.PI*H}if(this.roll.vertical){const e=st(t,J);return e>=Math.PI&&e<Math.PI*H}return!1}isVisible(){return!this.destroyed&&!this.spawning&&this.isInsideCanvas()}removeModifier(t){const e=this.#s.findIndex(i=>i.id===t);e>=C&&this.#s.splice(e,_)}reset(){for(const t of this.#o.particleUpdaters)t.reset?.(this)}#h(t,e){let i=t;for(const s of this.#s)if(s.enabled){const n=e(s);n!==void 0&&(i=n)}return i}#c(t,e){let i=te,s=t?j.create(t.x,t.y,e):void 0;const n=this.#o,r=n.particlePositionPlugins,a=this.options.move.outModes,h=this.getRadius(),l=n.canvas.size;for(;;){for(const p of r){const m=p.particlePosition?.(s,this);if(m)return j.create(m.x,m.y,e)}const f=Jt({size:l,position:s}),d=j.create(f.x,f.y,e);this.#d(d,h,a.left??a.default),this.#d(d,h,a.right??a.default),this.#f(d,h,a.top??a.default),this.#f(d,h,a.bottom??a.default);let u=!0;for(const p of n.particles.checkParticlePositionPlugins)if(u=p.checkParticlePosition?.(this,d,i)??!0,!u)break;if(u)return d;i+=ee,s=void 0}}#l(){const t=this.options.move,e=ie(this.direction),i=e.copy();if(t.direction===T.inside||t.direction===T.outside)return i;const s=yt(k(t.angle.value)),n=yt(k(t.angle.offset)),r={left:n-s*D,right:n+s*D};return t.straight||(i.angle+=se(ne(r.left,r.right))),t.random&&typeof t.speed=="number"&&(i.length*=at()),i}#d(t,e,i){St({outMode:i,checkModes:[Q.bounce],coord:t.x,maxCoord:this.#o.canvas.size.width,setCb:s=>t.x+=s,radius:e})}#f(t,e,i){St({outMode:i,checkModes:[Q.bounce],coord:t.y,maxCoord:this.#o.canvas.size.height,setCb:s=>t.y+=s,radius:e})}#p(t,e){const i=this.getRadius(),s=this.#o.canvas.size,n=this.position,r=e===Q.bounce;return t===$.bottom?{inside:r?n.y+i<s.height:n.y-i<s.height,reason:"default"}:t===$.left?{inside:r?n.x-i>C:n.x+i>C,reason:"default"}:t===$.right?{inside:r?n.x+i<s.width:n.x-i<s.width,reason:"default"}:t===$.top?{inside:r?n.y-i>C:n.y+i>C,reason:"default"}:{inside:n.x>=-i&&n.y>=-i&&n.y<=s.height+i&&n.x<=s.width+i,reason:"default"}}#u(t,e){return{canvasSize:this.#o.canvas.size,direction:t,outMode:e,particle:this,radius:this.getRadius()}}#r(t){const e=this.#p(t.direction,t.outMode),i=this.#o,s=this.shape?i.shapeDrawers.get(this.shape):void 0,n=this.effect?i.effectDrawers.get(this.effect):void 0,r=s?.isInsideCanvas,a=n?.isInsideCanvas;if(!r&&!a)return e;const h=this.#u(t.direction,t.outMode),l=r?this.#y(r(h),"shape"):void 0,f=a?this.#y(a(h),"effect"):void 0;if(l&&f){const d=Math.max(l.margin??C,f.margin??C);return{inside:l.inside&&f.inside,margin:d>C?d:void 0,reason:"combined"}}return l??f??e}#m(t){return!t||!this.roll||!this.backColor&&!this.roll.alter||!this.isShowingBack()?t:this.backColor?this.backColor:this.roll.alter?oe(t,this.roll.alter.type,this.roll.alter.value):t}#g(t){const e=this.#o,i=Math.floor(k(this.options.zIndex.value)),s=this.#c(t,re(i,ae,e.zLayers));if(!s)throw new Error("a valid position cannot be found for particle");this.position=s,this.initialPosition=this.position.copy();const n=e.canvas.size;switch(this.moveCenter={...he(this.options.move.center,n),radius:this.options.move.center.radius,mode:this.options.move.center.mode},this.direction=le(this.options.move.direction,this.position,this.moveCenter),this.options.move.direction){case T.
1inside:this.outType=ht.inside;break;case T.outside:this.outType=ht.outside;break}this.offset=ce.origin}#y(t,e){return typeof t=="boolean"?{inside:t,reason:e}:{inside:t.inside,margin:t.margin,reason:t.reason??e}}}class Mt{#t;#e=new Map;#n=[];#i;#o;#s=[];#a;constructor(t){this.#t=t,this.#i=0,this.#a=0}clear(){this.#e.clear();const t=this.#o;t&&(this.#t=t),this.#o=void 0}insert(t){const{x:e,y:i}=t.getPosition(),s=this.#l(e,i);this.#e.has(s)||this.#e.set(s,[]),this.#e.get(s)?.push(t)}query(t,e,i=[]){const s=this.#d(t);if(!s)return i;const n=Math.floor(s.minX/this.#t),r=Math.floor(s.maxX/this.#t),a=Math.floor(s.minY/this.#t),h=Math.floor(s.maxY/this.#t);for(let l=n;l<=r;l++)for(let f=a;f<=h;f++){const d=`${l}_${f}`,u=this.#e.get(d);if(u)for(const p of u)e&&!e(p)||t.contains(p.getPosition())&&i.push(p)}return i}queryCircle(t,e,i,s=[]){const n=this.#h(t.x,t.y,e),r=this.query(n,i,s);return this.#f(),r}queryRectangle(t,e,i,s=[]){const n=this.#c(t.x,t.y,e.width,e.height),r=this.query(n,i,s);return this.#f(),r}setCellSize(t){this.#o=t}#h(t,e,i){return(this.#n[this.#i++]??=new V(t,e,i)).reset(t,e,i)}#c(t,e,i,s){return(this.#s[this.#a++]??=new A(t,e,i,s)).reset(t,e,i,s)}#l(t,e){const i=Math.floor(t/this.#t),s=Math.floor(e/this.#t);return`${i}_${s}`}#d(t){if(t instanceof V){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 A){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}#f(){this.#i=0,this.#a=0}}class ri{checkParticlePositionPlugins;grid;#t;#e;#n;#i;#o;#s;#a;#h;#c;#l;#d;#f;#p;#u;#r;constructor(t,e){this.#c=t,this.#e=e,this.#o=0,this.#t=[],this.#l=[],this.#i=0,this.#n=new Map,this.#s=new Map,this.#r=this.#y(this.#e.zLayers),this.grid=new Mt(vt),this.checkParticlePositionPlugins=[],this.#a=[],this.#h=[],this.#f=[],this.#d=[],this.#u=[]}get count(){return this.#t.length}addParticle(t,e,i,s){const n=this.#e.actualOptions.particles.number.limit.mode,r=i===void 0?this.#i:this.#n.get(i)??this.#i,a=this.count;if(r>Pt)switch(n){case rt.delete:{const h=a+pe-r;h>ue&&this.removeQuantity(h);break}case rt.wait:if(a>=r)return;break}try{const h=this.#l.pop()??new oi(this.#c,this.#e);h.init(this.#o,t,e,i);let l=!0;if(s&&(l=s(h)),!l){this.#l.push(h);return}return this.#t.push(h),this.#b(h),this.#o++,this.#e.dispatchEvent(v.particleAdded,{particle:h}),h}catch(h){Z().warning(`error adding particle: ${h}`)}}clear(){this.#t=[],this.#s.clear(),this.#C(this.#e.zLayers)}destroy(){this.#t=[],this.#l.length=0,this.#s.clear(),this.#r=[],this.checkParticlePositionPlugins=[],this.#a=[],this.#h=[],this.#f=[],this.#d=[],this.#u=[]}drawParticles(t){for(let e=this.#r.length-X;e>=z;e--){const i=this.#r[e];if(i)for(const s of i)s.draw(t)}}filter(t){return this.#t.filter(t)}find(t){return this.#t.find(t)}get(t){return this.#t[t]}
1async init(){const t=this.#e,e=t.actualOptions;this.checkParticlePositionPlugins=[],this.#u=[],this.#h=[],this.#f=[],this.#a=[],this.#d=[],this.#s.clear(),this.#C(t.zLayers),this.grid=new Mt(vt*t.retina.pixelRatio);for(const s of t.plugins)s.redrawInit&&await s.redrawInit(),s.checkParticlePosition&&this.checkParticlePositionPlugins.push(s),s.update&&this.#u.push(s),s.particleUpdate&&this.#h.push(s),s.postUpdate&&this.#f.push(s),s.particleReset&&this.#a.push(s),s.postParticleUpdate&&this.#d.push(s);await this.#e.initDrawersAndUpdaters();for(const s of this.#e.effectDrawers.values())await s.init?.(t);for(const s of this.#e.shapeDrawers.values())await s.init?.(t);let i=!1;for(const s of t.plugins)if(i=s.particlesInitialization?.()??i,i)break;if(!i){const s=e.particles,n=s.groups;for(const r in n){const a=n[r];if(a)for(let h=this.count,l=0;l<a.number.value&&h<s.number.value;h++,l++)this.addParticle(void 0,a,r)}for(let r=this.count;r<s.number.value;r++)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.#e.canvas.render.drawParticles({value:0,factor:0})}remove(t,e,i){this.removeAt(this.#t.indexOf(t),void 0,e,i)}removeAt(t,e=fe,i,s){if(t<z||t>this.count)return;let n=0;for(let r=t;n<e&&r<this.count;r++)this.#z(r,i,s)&&(r--,n++)}removeQuantity(t,e){this.removeAt(z,t,e)}setDensity(){const t=this.#e.actualOptions,e=t.particles.groups;let i=0;for(const s of this.#e.plugins)s.particlesDensityCount&&(i+=s.particlesDensityCount());for(const s in e){const n=e[s];if(!n)continue;const r=ct(this.#c,this.#e,n);this.#g(r,i,s)}this.#g(t.particles,i)}setResizeFactor(t){this.#p=t}update(t){this.grid.clear();for(const i of this.#u)i.update?.(t);const e=this.#S(t);for(const i of this.#f)i.postUpdate?.(t);if(this.#M(t,e),e.size)for(const i of e)this.remove(i);this.#p=void 0}#m(...t){this.#l.push(...t)}#g(t,e,i,s){const n=t.number;if(!n.density.enable){i===void 0?this.#i=n.limit.value:(s?.number.limit.value??n.limit.value)&&this.#n.set(i,s?.number.limit.value??n.limit.value);return}const r=this.#v(n.density),a=n.value,h=n.limit.value>Pt?n.limit.value:a,l=Math.min(a,h)*r+e,f=Math.min(this.count,this.filter(d=>d.group===i).length);i===void 0?this.#i=n.limit.value*r:this.#n.set(i,n.limit.value*r),f<l?this.push(Math.abs(l-f),void 0,t,i):f>l&&this.removeQuantity(f-l,i)}#y(t){const e=Math.max(Math.floor(t),X);return Array.from({length:e},()=>[])}#P(t){const e=this.#r.length-X;return e<=z?z:Math.min(Math.max(Math.floor(t),z),e)}#v(t){const e=this.#e;if(!t.enable)return bt;const i=e.canvas.size,s=e.retina.pixelRatio;return!i.width||!i.height?bt:i.width*i.height/(t.height*t.width*s**F)}#b(t){const e=this.#P(t.position.z),i=this.#r[e];i&&(i.push(t),this.#s.set(t.id,e))}#z(t,e,i){const s=this.#t[t];return!s||s.group!==e?!1:(this.#t.splice(t,tt),this.#k(s),s.destroy(i),this.#e.dispatchEvent(v.particleRemoved,{particle:s}),this.#m(s),!0)}#k(t){const e=this.#s.get(t.id)??this.#P(t.position.z),i=this.#r[e];if(!i){this.#s.delete(t.id);return}const s=i.findIndex(n=>n.id===t.id);s>=z&&i.splice(s,tt),this.#s.delete(t.id)}#C(t){const e=Math.max(Math.floor(t),X);if(this.#r.length!==e){this.#r=this.#y(e);return}for(const i of this.#r)i.length=z}#D(t){const e=this.#P(t.position.z),i=this.#s.get(t.id);if(i===void 0){this.#b(t);return}if(i===e)return;const s=this.#r[i];if(s){const r=s.findIndex(a=>a.id===t.id);r>=z&&s.splice(r,tt)}const n=this.#r[e];if(!n){this.#s.set(t.id,e);return}if(n.push(t),n.length>=H){const r=n[n.length-H];r&&t.id<r.id&&n.sort((a,h)=>a.id-h.id)}this.#s.set(t.id,e)}#S(t){const e=new Set,i=this.#p;for(const s of this.#t){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 n of this.#a)n.particleReset?.(s);for(const n of this.#h){if(s.destroyed)break;n.particleUpdate?.(s,t)}if(s.destroyed){e.add(s);continue}this.grid.insert(s)}return e}#M(t,e){for(const i of this.#t){if(i.destroyed){e.add(i);continue}for(const s of this.#e.particleUpdaters)s.update(i,t);if(!i.spawning)for(const s of this.#d)s.postParticleUpdate?.(i,t);this.#D(i)}}}class ai{pixelRatio;reduceFactor;#t;constructor(t){this.#t=t,this.pixelRatio=Ct,this.reduceFactor=xt}init(){const t=this.#t,e=t.actualOptions;this.pixelRatio=e.detectRetina?devicePixelRatio:Ct,this.reduceFactor=xt;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,r=t.retina;r.maxSpeed=k(s.gravity.maxSpeed)*i,r.moveDrift=k(s.drift)*i,r.moveSpeed=k(s.speed)*i;const a=r.maxDistance;a.horizontal=n.horizontal===void 0?void 0:n.horizontal*i,a.vertical=n.vertical===void 0?void 0:n.vertical*i}}function b(o){return!o.destroyed}function hi(o,t,e=et,i=!1){o.value=t,o.factor=i?et/e:et*t/L}function E(o,t,...e){const i=new Ne(o,t);return Rt(i,...e),i}class di{actualOptions;canvas;destroyed;effectDrawers;fpsLimit;hdr;hdrMode;id;pageHidden;particleCreatedPlugins;particleDestroyedPlugins;particlePositionPlugins;particleUpdaters;particles;peakNits;plugins;retina;shapeDrawers;started;zLayers;#t;#e;#n={value:0,factor:0};#i;#o;#s;#a;#h;#c;#l;#d;#f;#p;#u;#r;#m;#g;constructor(t){const{dispatchCallback:e,pluginManager:i,id:s,onDestroy:n,sourceOptions:r}=t;this.#r=i,this.#i=e,this.#f=n,this.id=Symbol(s),this.fpsLimit=120,this.hdr=!1,this.hdrMode=B.standard,this.peakNits=400,this.#m=!1,this.#t=0,this.#s=0,this.#d=0,this.#h=!0,this.started=!1,this.destroyed=!1,this.#u=!0,this.#l=0,this.zLayers=100,this.pageHidden=!1,this.#g=r,this.#c=r,this.effectDrawers=new Map,this.shapeDrawers=new Map,this.particleUpdaters=[],this.retina=new ai(this),this.canvas=new Qe(this.#r,this),this.particles=new ri(this.#r,this),this.plugins=[],this.particleDestroyedPlugins=[],this.particleCreatedPlugins=[],this.particlePositionPlugins=[],this.#p=E(this.#r,this),this.actualOptions=E(this.#r,this),this.#a=new Ze(this),this.dispatchEvent(v.containerBuilt)}get animationStatus(){return!this.#u&&!this.pageHidden&&b(this)}get options(){return this.#p}get sourceOptions(){return this.#g}addLifeTime(t){this.#d+=t}alive(){return!this.#s||this.#d<=this.#s}destroy(t=!0){if(b(this)){this.stop(),this.particles.destroy(),this.canvas.destroy();for(const[,e]of this.effectDrawers)e.destroy?.(this);for(const[,e]of this.shapeDrawers)e.destroy?.(this);for(const e of this.plugins)e.destroy?.();this.effectDrawers=new Map,this.shapeDrawers=new Map,this.particleUpdaters=[],this.plugins.length=0,this.#r.clearPlugins(this),this.destroyed=!0,this.#f(t),this.dispatchEvent(v.containerDestroyed)}}dispatchEvent(t,e){this.#i(t,{container:this,data:e})}draw(t){if(!b(this))return;let e=t;this.#o=ge(i=>{e&&(this.#l=void 0,e=!1),this.#y(i)})}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}Z().error(`Export plugin with type ${t} not found`)}
1async init(){if(!b(this))return;const t=new Map;for(const h of this.#r.plugins){const l=await h.getPlugin(this);l.preInit&&await l.preInit(),t.set(h,l)}await this.initDrawersAndUpdaters(),this.#p=E(this.#r,this,this.#c,this.sourceOptions),this.actualOptions=E(this.#r,this,this.#p),this.plugins.length=0,this.particleDestroyedPlugins.length=0,this.particleCreatedPlugins.length=0,this.particlePositionPlugins.length=0;for(const[h,l]of t)h.needsPlugin(this.actualOptions)&&(this.plugins.push(l),l.particleCreated&&this.particleCreatedPlugins.push(l),l.particleDestroyed&&this.particleDestroyedPlugins.push(l),l.particlePosition&&this.particlePositionPlugins.push(l));this.retina.init(),this.canvas.init(),this.updateActualOptions(),this.canvas.initBackground(),this.canvas.resize();const{delay:e,duration:i,fpsLimit:s,smooth:n,zLayers:r}=this.actualOptions,a=this.actualOptions.hdr;this.hdrMode=a.mode,this.peakNits=a.peakNits,this.zLayers=r,this.#s=k(i)*L,this.#t=k(e)*L,this.#d=0,this.fpsLimit=s>ye?s:me,this.#m=n;for(const h of this.plugins)await h.init?.();await this.particles.init(),this.dispatchEvent(v.containerInit),this.particles.setDensity();for(const h of this.plugins)h.particlesSetup?.();this.dispatchEvent(v.particlesSetup)}async initDrawersAndUpdaters(){const t=this.#r;this.effectDrawers=await t.getEffectDrawers(this,!0),this.shapeDrawers=await t.getShapeDrawers(this,!0),this.particleUpdaters=await t.getUpdaters(this,!0)}pause(){if(b(this)&&(this.#o!==void 0&&(we(this.#o),this.#o=void 0),!this.#u)){for(const t of this.plugins)t.pause?.();this.pageHidden||(this.#u=!0),this.dispatchEvent(v.containerPaused)}}play(t){if(!b(this))return;const e=this.#u||t;if(this.#h&&!this.actualOptions.autoPlay){this.#h=!1;return}if(this.#u&&(this.#u=!1),e)for(const i of this.plugins)i.play&&i.play();this.dispatchEvent(v.containerPlay),this.draw(e??!1)}async refresh(){if(b(this))return this.stop(),this.start()}async reset(t){if(b(this))return this.#c=t,this.#g=t,this.#p=E(this.#r,this,this.#c,this.sourceOptions),this.actualOptions=E(this.#r,this,this.#p),this.refresh()}async start(){!b(this)||this.started||(await this.init(),this.started=!0,await new Promise(t=>{const e=async()=>{this.#a.addListeners();for(const i of this.plugins)await i.start?.();this.dispatchEvent(v.containerStarted),this.play(),t()};this.#e=setTimeout(()=>{e()},this.#t)}))}stop(){if(!(!b(this)||!this.started)){this.#e&&(clearTimeout(this.#e),this.#e=void 0),this.#h=!0,this.started=!1,this.#a.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.#g=this.#p,this.dispatchEvent(v.containerStopped)}}updateActualOptions(){let t=!1;for(const e of this.plugins)e.updateActualOptions&&(t=e.updateActualOptions()||t);return t}#y(t){try{if(!this.#m&&this.#l!==void 0&&t<this.#l+L/this.fpsLimit){this.draw(!1);return}if(this.#l??=t,hi(this.#n,t-this.#l,this.fpsLimit,this.#m),this.addLifeTime(this.#n.value),this.#l=t,this.#n.value>L){this.draw(!1);return}if(this.canvas.render.drawParticles(this.#n),!this.alive()){this.destroy();return}this.animationStatus&&this.draw(!1)}catch(e){Z().error("error in animation loop",e)}}}export{di as Container};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.