1import{A as e,D as t,L as n,N as r,et as i,it as a,k as o,ot as s}from"./LogUtils-D1uL_RU1.js";import{j as c}from"./index-BDimrMBs.js";var l=60,u=0,d=.01,f=0,p=1;function m(t){let n=t.initialPosition,{dx:i,dy:o}=e(n,t.position),s=Math.abs(i),c=Math.abs(o),{maxDistance:l}=t.retina,u=l.horizontal,d=l.vertical;if(!(!u&&!d)){if((((u&&s>=u)??!1)||((d&&c>=d)??!1))&&!t.misplaced)t.misplaced=!!u&&s>u||!!d&&c>d,u&&(t.velocity.x=t.velocity.y*a-t.velocity.x),d&&(t.velocity.y=t.velocity.x*a-t.velocity.y);else if((!u||s<u)&&(!d||c<d)&&t.misplaced)t.misplaced=!1;else if(t.misplaced){let e=t.position,i=t.velocity;u&&(e.x<n.x&&i.x<0||e.x>n.x&&i.x>0)&&(i.x*=-r()),d&&(e.y<n.y&&i.y<0||e.y>n.y&&i.y>0)&&(i.y*=-r())}}}function h(e,t,n,r,i,a,o){_(e,o);let s=e.gravity,c=s?.enable&&s.inverse?-1:1;i&&n&&(e.velocity.x+=i*o.factor/(l*n)),s?.enable&&n&&(e.velocity.y+=c*(s.acceleration*o.factor)/(l*n));let u=e.moveDecay;e.velocity.multTo(u??p);let d=e.velocity.mult(n);s?.enable&&r>0&&(!s.inverse&&d.y>=0&&d.y>=r||s.inverse&&d.y<=0&&d.y<=-r)&&(d.y=c*r,n&&(e.velocity.y=d.y/n));let f=e.options.zIndex,m=(1-e.zIndexFactor)**f.velocityRate;d.multTo(m),d.multTo(a);let{position:h}=e;h.addTo(d),t.vibrate&&(h.x+=Math.sin(h.x*Math.cos(h.y))*a,h.y+=Math.cos(h.y*Math.sin(h.x))*a)}function g(e,t,n,r){if(!t.spin)return;let i=t.spin.direction===c.clockwise,o={x:i?Math.cos:Math.sin,y:i?Math.sin:Math.cos};t.position.x=t.spin.center.x+t.spin.radius*o.x(t.spin.angle)*r,t.position.y=t.spin.center.y+t.spin.radius*o.y(t.spin.angle)*r,t.spin.radius+=t.spin.acceleration*r;let s=Math.max(e.canvas.size.width,e.canvas.size.height),l=s*a;t.spin.radius>l?(t.spin.radius=l,t.spin.acceleration*=-1):t.spin.radius<u&&(t.spin.radius=u,t.spin.acceleration*=-1),t.spin.angle+=n*d*(1-t.spin.radius/s)}function _(e,n){let r=e.options.move.path;if(!r.enable)return;let i=e.pathDelay??f;if(e.lastPathTime<=i){e.lastPathTime+=n.value;return}let a=e.pathGenerator?.generate(e,n);a&&e.velocity.addTo(a),r.clamp&&(e.velocity.x=t(e.velocity.x,-1,1),e.velocity.y=t(e.velocity.y,-1,1)),e.lastPathTime-=i}function v(e){let t=e.getModifier(`slow`);return t?.enabled?t.speedFactor??1:1}function y(e,t){let a=t.options.move.spin;if(!a.enable)return;let s=a.position??{x:50,y:50},l=.01,u={x:s.x*l*e.canvas.size.width,y:s.y*l*e.canvas.size.height},d=o(t.getPosition(),u),f=n(a.acceleration);t.retina.spinAcceleration=f*e.retina.pixelRatio,t.spin={center:u,direction:t.velocity.x>=0?c.clockwise:c.counterClockwise,angle:r()*i,radius:d,acceleration:t.retina.spinAcceleration}}var b=1,x=1,S=class{availablePathGenerators;pathGenerators;#e;#t;constructor(e,t){this.#t=e,this.#e=t,this.availablePathGenerators=new Map,this.pathGenerators=new Map}destroy(){this.availablePathGenerators=new Map,this.pathGenerators=new Map}isEnabled(e){return!e.destroyed&&e.options.move.enable}particleCreated(e){let t=e.options.move,r=t.gravity,i=t.path;if(e.moveDecay=1-n(t.decay),e.pathDelay=n(i.delay.value)*s,i.generator){let t=this.pathGenerators.get(i.generator);t||(t=this.availablePathGenerators.get(i.generator),t&&(this.pathGenerators.set(i.generator,t),t.init())),e.pathGenerator=t}e.gravity={enable:r.enable,acceleration:n(r.acceleration),inverse:r.inverse},y(this.#e,e)}particleDestroyed(e){e.pathGenerator?.reset(e)}particleUpdate(e,t){let n=e.options.move;if(!n.enable)return;let r=this.#e,i=v(e),o=r.retina.reduceFactor,s=e.retina.moveSpeed,c=e.retina.moveDrift,l=e.size.max,u=n.size?e.getRadius()/l:b,d=t.factor||x,f=s*u*i*d*a,p=e.retina.maxSpeed;n.spin.enable?g(r,e,f,o):h(e,n,f,p,c,o,t),m(e)}preInit(){return this.#n()}redrawInit(){return this.#n()}update(){for(let e of this.pathGenerators.values())e.update()}async#n(){let e=await this.#t.getPathGenerators?.(this.#e,!0);if(e){this.availablePathGenerators=e,this.pathGenerators=new Map;for(let e of this.pathGenerators.values())e.init()}}};export{S as MovePluginInstance};
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.