1import{n as e,r as t,t as n}from"./index-p71tLBts.js";var r=t(e(),1),i=n();function a(e,t,n=!1){let r=[`circle`,`circle`,`diamond`,`diamond`,`star`];return{x:Math.random()*e,y:n?Math.random()*t:Math.random()*t-t,size:Math.random()*3.5+.8,speedY:Math.random()*.6+.15,speedX:(Math.random()-.5)*.4,opacity:Math.random()*.6+.15,opacityDelta:(Math.random()*.01+.004)*(Math.random()>.5?1:-1),rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.025,shape:r[Math.floor(Math.random()*r.length)],twinklePhase:Math.random()*Math.PI*2,twinkleSpeed:Math.random()*.04+.02}}function o(e,t,n,r,i){e.setTransform(1,0,0,1,t,n),e.rotate(i),e.beginPath();for(let t=0;t<4;t++){let n=t/4*Math.PI*2,i=Math.cos(n)*r,a=Math.sin(n)*r,o=n+Math.PI/4,s=Math.cos(o)*r*.3,c=Math.sin(o)*r*.3;t===0?e.moveTo(i,a):e.lineTo(i,a),e.lineTo(s,c)}e.closePath(),e.fill(),e.setTransform(1,0,0,1,0,0)}function s(e,t,n,r,i){e.setTransform(1,0,0,1,t,n),e.rotate(i),e.beginPath(),e.moveTo(0,-r),e.lineTo(r*.55,0),e.lineTo(0,r),e.lineTo(-r*.55,0),e.closePath(),e.fill(),e.setTransform(1,0,0,1,0,0)}var c=[`#D4A63A`,`#F0D68A`,`#E8C060`,`#FFE08A`];function l(){let e=(0,r.useRef)(null),t=(0,r.useRef)(null);return(0,r.useEffect)(()=>{let n=e.current;if(!n)return;let r=n.getContext(`2d`);if(!r)return;let i=window.innerWidth<1024,l=i?28:90,u=i?33:0;n.width=n.offsetWidth,n.height=n.offsetHeight;let d=Array.from({length:l},()=>a(n.width,n.height,!0)),f=()=>{let e=n.width,t=n.height;if(n.width=n.offsetWidth,n.height=n.offsetHeight,e>0&&t>0)for(let e of d)e.x>n.width&&(e.x=Math.random()*n.width),e.y>n.height&&(e.y=Math.random()*n.height)},p=0,m=!0,h=0,g=i?6:3,_=e=>{if(m){if(u>0&&e-h<u){t.current=requestAnimationFrame(_);return}h=e,p++,r.clearRect(0,0,n.width,n.height);for(let e of d){e.y+=e.speedY,e.x+=e.speedX,e.rotation+=e.rotationSpeed,e.twinklePhase+=e.twinkleSpeed;let t=Math.sin(e.twinklePhase)*.25,i=Math.max(.05,Math.min(.9,e.opacity+t));if(e.opacity+=e.opacityDelta,(e.opacity>.7||e.opacity<.1)&&(e.opacityDelta*=-1),e.y>n.height+10&&(e.y=-10,e.x=Math.random()*n.width),e.x<-10&&(e.x=n.width+10),e.x>n.width+10&&(e.x=-10),e.size>2.5&&p%g===0){let t=r.createRadialGradient(e.x,e.y,0,e.x,e.y,e.size*3.5);t.addColorStop(0,`rgba(240,214,138,${i*.5})`),t.addColorStop(1,`rgba(212,166,58,0)`),r.fillStyle=t,r.beginPath(),r.arc(e.x,e.y,e.size*3.5,0,Math.PI*2),r.fill()}r.globalAlpha=i,r.fillStyle=c[Math.floor(e.size*10)%c.length],e.shape===`circle`?(r.beginPath(),r.arc(e.x,e.y,e.size,0,Math.PI*2),r.fill()):e.shape===`diamond`?s(r,e.x,e.y,e.size,e.rotation):o(r,e.x,e.y,e.size*1.2,e.rotation)}r.globalAlpha=1,t.current=requestAnimationFrame(_)}},v=()=>{document.hidden?(m=!1,t.current!==null&&(cancelAnimationFrame(t.current),t.current=null)):(m=!0,h=0,t.current=requestAnimationFrame(_))};document.addEventListener(`visibilitychange`,v),t.current=requestAnimationFrame(_);let y=new ResizeObserver(f);return y.observe(n),()=>{m=!1,t.current!==null&&cancelAnimationFrame(t.current),y.disconnect(),document.removeEventListener(`visibilitychange`,v)}},[]),(0,i.jsx)(`canvas`,{ref:e,className:`absolute inset-0 w-full h-full pointer-events-none`,style:{zIndex:3}})}export{l as default};
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.