2 lines
20 KiB
JavaScript
2 lines
20 KiB
JavaScript
"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[7426],{1526:(e,t,a)=>{a.d(t,{A:()=>A});var i=a(84051),n=a(87357),r=a(17142),o=a(14242),s=a(4961),c=a(37661),l=a(39351),f=a(59030),d=a(18276),m=a(9267),u=a(64493);const h={options:"OnCj9kef",option:"tpTHQAUF",active:"U_9MXPG5",wideOption:"dJcJl33b",optionTop:"x9G4lqMf",stackedStars:"etXLebjM",stackedStar:"swttXv9P",optionBottom:"tK7La7L2",moreOptions:"AWXBaWLW",iconDown:"zWYHZJmd"};var p=a(20021);const A=(0,i.ph)(({isActive:e,className:t,options:a,selectedStarOption:A,selectedStarCount:b,starsNeeded:v,onClick:g})=>{const _=(0,f.A)(),F=(0,l.A)(),[w,R,S]=(0,c.A)();(0,i.vJ)(()=>{e||S()},[e]);const[T,y]=(0,i.Kr)(()=>{if(!a)return[void 0,!1];const e=a.reduce((e,t)=>e.stars>t.stars?e:t),t=v&&e.stars<v,i=[];let n=0,r=!1;return a.forEach((e,o)=>{e.isExtended||n++,v&&!t&&e.stars<v||(w||!e.isExtended?i.push({option:e,starsCount:Math.min(n,6),isWide:o===a.length-1}):r=!0)}),[i,r]},[w,a,v]);return(0,p.FD)("div",{className:(0,n.A)(h.options,t),children:[T?.map(({option:e,starsCount:t,isWide:a})=>{const i=T?.length,c=i%2==0,l=e===A;let f;if(e&&"winners"in e){const t=e.winners.find(e=>e.users===b)||e.winners.reduce((e,t)=>t.users>e.users?t:e,e.winners[0]);f=t?.perUserStars}return(0,p.FD)("div",{className:(0,n.A)(h.option,!c&&a&&h.wideOption,l&&h.active),onClick:()=>g?.(e),children:[(0,p.FD)("div",{className:h.optionTop,children:["+",(0,o.Sm)(e.stars),(0,p.Y)("div",{className:h.stackedStars,dir:F.isRtl?"ltr":"rtl",children:Array.from({length:t}).map(()=>(0,p.Y)(m.A,{className:h.stackedStar,type:"gold",size:"big"}))})]}),(0,p.Y)("div",{className:h.optionBottom,children:(0,r.vv)(F,e.amount,e.currency)}),(l||A&&"winners"in A)&&Boolean(f)&&(0,p.Y)("div",{className:h.optionBottom,children:(0,p.Y)("div",{className:h.perUserStars,children:(0,s.A)(_("BoostGift.Stars.PerUser",(0,o.Sm)(f)))})})]},e.stars)}),!w&&y&&(0,p.FD)(u.A,{className:h.moreOptions,isText:!0,noForcedUpperCase:!0,onClick:R,children:[_("Stars.Purchase.ShowMore"),(0,p.Y)(d.A,{className:h.iconDown,name:"down"})]})]})})},5463:(e,t,a)=>{a.d(t,{A:()=>d});var i=a(84051),n=a(87357),r=a(18276),o=a(64493),s=a(22720),c=a(22337),l=a(32581);var f=a(20021);const d=(0,i.ph)(({isOpen:e,listItemData:t,headerIconName:a,header:i,footer:d,buttonText:m,hasBackdrop:u,withSeparator:h,onClose:p,onButtonClick:A,contentClassName:b})=>(0,f.FD)(c.A,{isOpen:e,className:(0,n.A)("LAh8evux",b),contentClassName:"hrizpMDe",hasAbsoluteCloseButton:!0,absoluteCloseButtonColor:u?"translucent-white":void 0,onClose:p,children:[a&&(0,f.Y)("div",{className:"jySLtQNG",children:(0,f.Y)(r.A,{name:a})}),i,(0,f.Y)("div",{children:t?.map(([e,t,a])=>(0,f.FD)(s.A,{isStatic:!0,multiline:!0,icon:e,iconClassName:"hQbEPsTU",children:[(0,f.Y)("span",{className:(0,n.A)("title","yfODVQ1M"),children:t}),(0,f.Y)("span",{className:"subtitle",children:a})]}))}),h&&(0,f.Y)(l.A,{className:"En1zD2cT"}),d,m&&(0,f.Y)(o.A,{onClick:A||p,children:m})]}))},34642:(e,t,a)=>{a.d(t,{A:()=>l});var i=a(84051),n=a(87357),r=a(59030),o=a(64493),s=a(22337);var c=a(20021);const l=(0,i.ph)(({confirmButtonText:e,isConfirmDisabled:t,shouldAdaptToSearch:a,withFixedHeight:i,onConfirm:l,withPremiumGradient:f,...d})=>{const m=(0,r.A)(),u=Boolean(e||l);return(0,c.FD)(s.A,{...d,isSlim:!0,className:(0,n.A)(a&&"WGSZ8u75",i&&"CrEsDylb",d.className),contentClassName:(0,n.A)("FuFYE0AA",d.contentClassName),headerClassName:(0,n.A)("iEptOmIp",d.headerClassName),isCondensedHeader:!0,children:[d.children,u&&(0,c.Y)("div",{className:"HqeDTaSr",children:(0,c.Y)(o.A,{withPremiumGradient:f,onClick:l||d.onClose,color:"primary",disabled:t,children:e||m("Confirm")})})]})})},38777:(e,t,a)=>{a.d(t,{A:()=>w});var i=a(84051),n=a(87357),r=a(76023),o=a(17712),s=a(97040),c=a(82855),l=a(66644),f=a(19822),d=a(58443),m=a(64489);const u=a.p+"diamond.9926e8364655a28cecf3.png";var h=a(20021);let p,A=!0;const b=(0,i.ph)(function({onMouseMove:e}){const[t,a]=(0,i.J0)(1),n=(0,o.A)(()=>{p&&(clearTimeout(p),p=void 0),p=window.setTimeout(()=>{const e=Date.now();A=!0,(0,f.S0)(()=>{if(!A)return!1;const t=Math.min((Date.now()-e)/1500,1),i=4*(1-function(e){return 1-(1-e)**2}(t));return a(i),A=t<1&&i>1,A},l.RK)},300),A=!1,a(5),e()});return(0,h.Y)("div",{className:"lIc96mwM",children:(0,h.Y)("div",{className:"vIrSZr0L",onMouseMove:n,children:(0,h.Y)(m.A,{speed:t,size:130,tgsUrl:d.w.Diamond,previewUrl:u,nonInteractive:!0,noLoop:!1})})})}),v={root:"KQ61en7j",star:"no11eFNA",star_purple:"NXn1Bbql",starPurple:"NXn1Bbql"},g=(0,i.ph)(function({color:e,centerShift:t,onMouseMove:a}){const r=(0,i.li)(),s=(0,o.A)(e=>{const i=e.currentTarget.getBoundingClientRect(),n=i.left+i.width/2+t[0],o=i.top+i.height/2+t[1],s=e.clientX-n,c=e.clientY-o,f=Math.max(-1,Math.min(1,s/50)),d=Math.max(-1,Math.min(1,c/50)),m=40*f,u=40*-d;(0,l.RK)(()=>{r.current.style.transform=`scale(1.1) rotateX(${u}deg) rotateY(${m}deg)`}),a()}),c=(0,o.A)(()=>{(0,l.RK)(()=>{r.current.style.transform=""})});return(0,h.Y)("div",{className:v.root,onMouseMove:s,onMouseLeave:c,children:(0,h.Y)("div",{ref:r,className:(0,n.A)(v.star,v[`star_${e}`]),role:"img","aria-label":"Telegram Stars"})})}),_=8*r.$,F={centerShift:[0,-36]},w=(0,i.ph)(function({model:e,sticker:t,color:a,title:r,description:l,isDisabled:f,className:d}){const m=(0,i.li)(),u=(0,i.li)(),p=(0,o.A)(()=>{u.current?.()}),A=(0,o.A)(e=>{u.current=e});return(0,h.FD)("div",{className:(0,n.A)("gibpMWRW",d),children:[(0,h.Y)(s.A,{color:a,centerShift:F.centerShift,isDisabled:f,className:"ptK2PtrY",onRequestAnimation:A}),"swaying-star"===e?(0,h.Y)(g,{color:a,centerShift:F.centerShift,onMouseMove:p}):"speeding-diamond"===e?(0,h.Y)(b,{onMouseMove:p}):"sticker"===e&&t&&(0,h.Y)("div",{ref:m,className:"Kjblw3yb",style:`width: ${_}px; height: ${_}px`,onMouseMove:p,children:(0,h.Y)(c.A,{containerRef:m,sticker:t,size:_,shouldPreloadPreview:!0,shouldLoop:!0})}),(0,h.Y)("h2",{className:"uHi7dzFK",children:r}),(0,h.Y)("div",{className:"y4GHVbyq",children:l})]})})},70046:(e,t,a)=>{a.d(t,{A:()=>u});var i=a(84051),n=a(13439),r=a(87357),o=a(17712),s=a(21849),c=a(10187),l=a(64493),f=a(22337);const d="Cnh5ENvm";var m=a(20021);const u=(0,i.ph)(({isOpen:e,title:t,tableData:a,headerAvatarPeer:i,header:u,modalHeader:h,footer:p,buttonText:A,className:b,contentClassName:v,hasBackdrop:g,onClose:_,onButtonClick:F,withBalanceBar:w,isLowStackPriority:R,currencyInBalanceBar:S})=>{const{openChat:T}=(0,n.ko)(),y=(0,o.A)(e=>{T({id:e}),_()});return(0,m.FD)(f.A,{isOpen:e,hasCloseButton:Boolean(t),hasAbsoluteCloseButton:!t,absoluteCloseButtonColor:g?"translucent-white":void 0,isSlim:!0,header:h,title:t,className:b,contentClassName:(0,r.A)("KYHkJ9Qf",v),onClose:_,withBalanceBar:w,currencyInBalanceBar:S,isLowStackPriority:R,children:[i&&(0,m.Y)(s.A,{peer:i,size:"jumbo",className:"SHQbPR5Y"}),u,(0,m.Y)("div",{className:"DFRB0Ad4",children:a?.map(([e,t])=>(0,m.FD)(m.FK,{children:[Boolean(e)&&(0,m.Y)("div",{className:(0,r.A)(d,"AwnUe4Qk"),children:e}),(0,m.Y)("div",{className:(0,r.A)(d,"JGH6P9Az",!e&&"UssCZwgy"),children:"object"==typeof t&&"chatId"in t?(0,m.Y)(c.A,{peerId:t.chatId,className:"aS9U4hiQ",forceShowSelf:!0,withEmojiStatus:t.withEmojiStatus,clickArg:t.chatId,onClick:y}):t})]}))}),p,A&&(0,m.Y)(l.A,{className:p?void 0:"cSamlkt9",onClick:F||_,children:A})]})})},84991:(e,t,a)=>{a.d(t,{A:()=>f});var i=a(84051),n=a(87357),r=a(39351),o=a(21849),s=a(18276);const c={root:"hyRfEyRz",top:"p_Ny8jqJ",badge:"QRrryqp4",text:"I5jdPgFL"};var l=a(20021);const f=(0,i.ph)(({peer:e,avatarWebPhoto:t,avatarSize:a,text:i,badgeText:f,badgeIcon:d,className:m,badgeClassName:u,badgeIconClassName:h,textClassName:p,onClick:A})=>{const b=(0,r.A)();return(0,l.FD)("div",{className:(0,n.A)(c.root,A&&c.clickable,m),onClick:A,children:[(0,l.FD)("div",{className:c.top,children:[(0,l.Y)(o.A,{size:a,peer:e,webPhoto:t}),f&&(0,l.FD)("div",{className:(0,n.A)(c.badge,u),dir:b.isRtl?"rtl":"ltr",children:[d&&(0,l.Y)(s.A,{name:d,className:h}),f]})]}),i&&(0,l.Y)("p",{className:(0,n.A)(c.text,p),children:i})]})})},97040:(e,t,a)=>{a.d(t,{A:()=>_});var i=a(84051),n=a(87357),r=a(14235),o=a(61157);const s={blue:[0,152/255,234/255],blueGradient:[[1/255,88/255,175/255],[103/255,208/255,1]],purple:[150/255,111/255,254/255],purpleGradient:[[107/255,147/255,1],[228/255,106/255,206/255]],gold:[1,191/255,10/255],goldGradient:[[253/255,235/255,50/255],[215/255,89/255,2/255]]},c={particleCount:5,distanceLimit:1,fadeInTime:.05,minLifetime:3,maxLifetime:3,maxStartTimeDelay:0,selfDestroyTime:3,minSpawnRadius:5,maxSpawnRadius:50},l={width:350,height:230,particleCount:100,color:[0,152/255,234/255],speed:18,baseSize:6,minSpawnRadius:35,maxSpawnRadius:70,distanceLimit:.7,fadeInTime:.25,fadeOutTime:1,minLifetime:4,maxLifetime:6,maxStartTimeDelay:3,edgeFadeZone:50,centerShift:[0,0],accelerationFactor:3,selfDestroyTime:0},f=new Map;function d(e,t){let a=f.get(e);return a||(a=function(e){const t=e.getContext("webgl",{alpha:!0,antialias:!1,preserveDrawingBuffer:!1});if(!t)throw new Error("WebGL not supported");const a=h(t,t.VERTEX_SHADER,m),i=h(t,t.FRAGMENT_SHADER,u);if(!a||!i)throw new Error("Failed to create shaders");const n=function(e,t,a){const i=e.createProgram();if(i){if(e.attachShader(i,t),e.attachShader(i,a),e.linkProgram(i),e.getProgramParameter(i,e.LINK_STATUS))return i;e.deleteProgram(i)}}(t,a,i);if(!n)throw new Error("Failed to create shader program");const s=window.devicePixelRatio||1,c=new Map,d={attributes:{startPosition:t.getAttribLocation(n,"a_startPosition"),velocity:t.getAttribLocation(n,"a_velocity"),startTime:t.getAttribLocation(n,"a_startTime"),lifetime:t.getAttribLocation(n,"a_lifetime"),size:t.getAttribLocation(n,"a_size"),baseOpacity:t.getAttribLocation(n,"a_baseOpacity"),color:t.getAttribLocation(n,"a_color")},uniforms:{resolution:t.getUniformLocation(n,"u_resolution"),time:t.getUniformLocation(n,"u_time"),canvasWidth:t.getUniformLocation(n,"u_canvasWidth"),canvasHeight:t.getUniformLocation(n,"u_canvasHeight"),accelerationFactor:t.getUniformLocation(n,"u_accelerationFactor"),fadeInTime:t.getUniformLocation(n,"u_fadeInTime"),fadeOutTime:t.getUniformLocation(n,"u_fadeOutTime"),edgeFadeZone:t.getUniformLocation(n,"u_edgeFadeZone"),rotationMatrices:t.getUniformLocation(n,"u_rotationMatrices"),spawnCenter:t.getUniformLocation(n,"u_spawnCenter")}};let v,g;function _(e){v&&(t.clear(t.COLOR_BUFFER_BIT),c.forEach(a=>{const i=(e-a.startTime)/1e3;t.uniform1f(d.uniforms.time,i),t.uniform1f(d.uniforms.canvasWidth,a.config.width*s),t.uniform1f(d.uniforms.canvasHeight,a.config.height*s),t.uniform1f(d.uniforms.accelerationFactor,a.config.accelerationFactor),t.uniform1f(d.uniforms.fadeInTime,a.config.fadeInTime),t.uniform1f(d.uniforms.fadeOutTime,a.config.fadeOutTime),t.uniform1f(d.uniforms.edgeFadeZone,a.config.edgeFadeZone*s),t.uniform2f(d.uniforms.spawnCenter,a.centerX*s,a.centerY*s),t.bindBuffer(t.ARRAY_BUFFER,a.buffers.startPosition),t.enableVertexAttribArray(d.attributes.startPosition),t.vertexAttribPointer(d.attributes.startPosition,2,t.FLOAT,!1,0,0),t.bindBuffer(t.ARRAY_BUFFER,a.buffers.velocity),t.enableVertexAttribArray(d.attributes.velocity),t.vertexAttribPointer(d.attributes.velocity,2,t.FLOAT,!1,0,0),t.bindBuffer(t.ARRAY_BUFFER,a.buffers.startTime),t.enableVertexAttribArray(d.attributes.startTime),t.vertexAttribPointer(d.attributes.startTime,1,t.FLOAT,!1,0,0),t.bindBuffer(t.ARRAY_BUFFER,a.buffers.lifetime),t.enableVertexAttribArray(d.attributes.lifetime),t.vertexAttribPointer(d.attributes.lifetime,1,t.FLOAT,!1,0,0),t.bindBuffer(t.ARRAY_BUFFER,a.buffers.size),t.enableVertexAttribArray(d.attributes.size),t.vertexAttribPointer(d.attributes.size,1,t.FLOAT,!1,0,0),t.bindBuffer(t.ARRAY_BUFFER,a.buffers.baseOpacity),t.enableVertexAttribArray(d.attributes.baseOpacity),t.vertexAttribPointer(d.attributes.baseOpacity,1,t.FLOAT,!1,0,0),t.bindBuffer(t.ARRAY_BUFFER,a.buffers.color),t.enableVertexAttribArray(d.attributes.color),t.vertexAttribPointer(d.attributes.color,3,t.FLOAT,!1,0,0),t.drawArrays(t.POINTS,0,a.config.particleCount)}),v=requestAnimationFrame(_))}function F(r){const o=c.get(r);o&&(o.selfDestroyTimeout&&clearTimeout(o.selfDestroyTimeout),Object.values(o.buffers).forEach(e=>{e&&t.deleteBuffer(e)}),c.delete(r),0===c.size&&(void 0!==v&&(cancelAnimationFrame(v),v=void 0),g?.(),c.clear(),t.deleteProgram(n),t.deleteShader(a),t.deleteShader(i),f.delete(e)))}return{addSystem:function(a){const i=(0,r.A)(),f={...l,...a},m={startPosition:t.createBuffer(),velocity:t.createBuffer(),startTime:t.createBuffer(),lifetime:t.createBuffer(),size:t.createBuffer(),baseOpacity:t.createBuffer(),color:t.createBuffer()},u={id:i,config:f,buffers:m,startTime:performance.now(),seed:Math.floor(1e6*Math.random()),centerX:f.width/2+f.centerShift[0],centerY:f.height/2+f.centerShift[1],avgDistance:(f.width/2+f.height/2)/2};return c.set(i,u),function(e){const a=new p(e.seed),{config:i}=e,n=new Float32Array(2*i.particleCount),r=new Float32Array(2*i.particleCount),o=new Float32Array(i.particleCount),c=new Float32Array(i.particleCount),l=new Float32Array(i.particleCount),f=new Float32Array(i.particleCount),d=new Float32Array(3*i.particleCount);for(let t=0;t<i.particleCount;t++){const m=a.next()*Math.PI*2,u=a.nextBetween(i.minSpawnRadius,i.maxSpawnRadius),h=Math.cos(m),p=Math.sin(m),A=e.centerX+h*u,v=e.centerY+p*u;n[2*t]=A*s,n[2*t+1]=v*s,c[t]=a.nextBetween(i.minLifetime,i.maxLifetime),o[t]=a.next()*i.maxStartTimeDelay;const g=a.nextBetween(e.avgDistance*i.distanceLimit*.5,e.avgDistance*i.distanceLimit)/c[t]*s;r[2*t]=h*g,r[2*t+1]=p*g;const _=a.next();l[t]=_<.3?.67*i.baseSize*s:_<.7?1.33*i.baseSize*s:2.2*i.baseSize*s,f[t]=a.nextBetween(.3,.8);const F=b(i.color,a);d[3*t]=F[0],d[3*t+1]=F[1],d[3*t+2]=F[2]}t.bindBuffer(t.ARRAY_BUFFER,e.buffers.startPosition),t.bufferData(t.ARRAY_BUFFER,n,t.STATIC_DRAW),t.bindBuffer(t.ARRAY_BUFFER,e.buffers.velocity),t.bufferData(t.ARRAY_BUFFER,r,t.STATIC_DRAW),t.bindBuffer(t.ARRAY_BUFFER,e.buffers.startTime),t.bufferData(t.ARRAY_BUFFER,o,t.STATIC_DRAW),t.bindBuffer(t.ARRAY_BUFFER,e.buffers.lifetime),t.bufferData(t.ARRAY_BUFFER,c,t.STATIC_DRAW),t.bindBuffer(t.ARRAY_BUFFER,e.buffers.size),t.bufferData(t.ARRAY_BUFFER,l,t.STATIC_DRAW),t.bindBuffer(t.ARRAY_BUFFER,e.buffers.baseOpacity),t.bufferData(t.ARRAY_BUFFER,f,t.STATIC_DRAW),t.bindBuffer(t.ARRAY_BUFFER,e.buffers.color),t.bufferData(t.ARRAY_BUFFER,d,t.STATIC_DRAW)}(u),function(){let a=0,i=0;c.forEach(e=>{a=Math.max(a,e.config.width),i=Math.max(i,e.config.height)}),0===c.size&&(a=l.width,i=l.height),e.width===a*s&&e.height===i*s||(e.width=a*s,e.height=i*s,e.style.width=a+"px",e.style.height=i+"px"),t.viewport(0,0,e.width,e.height)}(),f.selfDestroyTime&&(u.selfDestroyTimeout=window.setTimeout(()=>{F(i)},1e3*f.selfDestroyTime)),1===c.size&&(t.useProgram(n),t.uniform2f(d.uniforms.resolution,e.width,e.height),t.uniformMatrix2fv(d.uniforms.rotationMatrices,!1,function(){if(!A){const e=18,t=220;A=new Float32Array(4*e);for(let a=0;a<e;a++){const e=t*Math.PI/180*a,i=Math.cos(e),n=Math.sin(e);A[4*a]=i,A[4*a+1]=n,A[4*a+2]=-n,A[4*a+3]=i}}return A}()),t.enable(t.BLEND),t.blendFunc(t.ONE,t.ONE_MINUS_SRC_ALPHA),t.clearColor(0,0,0,0),g=o.GE.subscribe(()=>{const e=!(0,o.GE)();e&&!v?v=requestAnimationFrame(_):!e&&v&&(cancelAnimationFrame(v),v=void 0)}),v=requestAnimationFrame(_)),()=>F(i)}}}(e),f.set(e,a)),a.addSystem(t)}const m="\n attribute vec2 a_startPosition;\n attribute vec2 a_velocity;\n attribute float a_startTime;\n attribute float a_lifetime;\n attribute float a_size;\n attribute float a_baseOpacity;\n attribute vec3 a_color;\n\n uniform vec2 u_resolution;\n uniform float u_time;\n uniform float u_canvasWidth;\n uniform float u_canvasHeight;\n uniform float u_accelerationFactor;\n uniform float u_fadeInTime;\n uniform float u_fadeOutTime;\n uniform float u_edgeFadeZone;\n uniform mat2 u_rotationMatrices[18];\n uniform vec2 u_spawnCenter;\n\n varying float v_opacity;\n varying vec3 v_color;\n\n void main() {\n float totalAge = u_time - a_startTime;\n float age = mod(totalAge, a_lifetime);\n\n // For the initial animation, fade in all particles\n float globalFadeIn = min(u_time / u_fadeInTime, 1.0);\n\n float lifeRatio = age / a_lifetime;\n\n // Calculate rotation based on completed lifecycles\n float lifecycleCount = floor(totalAge / a_lifetime);\n int rotationIndex = int(mod(lifecycleCount, 18.0));\n\n // Get rotation matrix\n mat2 rotationMatrix = u_rotationMatrices[rotationIndex];\n\n // Rotate start position around spawn center\n vec2 startOffset = a_startPosition - u_spawnCenter;\n vec2 rotatedStartOffset = rotationMatrix * startOffset;\n vec2 rotatedStartPosition = u_spawnCenter + rotatedStartOffset;\n\n // Apply rotation matrix to velocity\n vec2 rotatedVelocity = rotationMatrix * a_velocity;\n\n // Apply shoot-out effect: fast initial speed that slows down\n float speedMultiplier = 1.0 + u_accelerationFactor * exp(-3.0 * lifeRatio);\n\n vec2 position = rotatedStartPosition + rotatedVelocity * age * speedMultiplier;\n\n float opacity = 1.0;\n if (lifeRatio < u_fadeInTime / a_lifetime) {\n opacity = (lifeRatio * a_lifetime) / u_fadeInTime;\n } else if (lifeRatio > 1.0 - u_fadeOutTime / a_lifetime) {\n opacity = (1.0 - lifeRatio) * a_lifetime / u_fadeOutTime;\n }\n opacity *= a_baseOpacity * globalFadeIn;\n\n float distToLeft = position.x;\n float distToRight = u_canvasWidth - position.x;\n float distToTop = position.y;\n float distToBottom = u_canvasHeight - position.y;\n float distToEdge = min(min(distToLeft, distToRight), min(distToTop, distToBottom));\n\n if (distToEdge < u_edgeFadeZone) {\n opacity *= distToEdge / u_edgeFadeZone;\n }\n\n vec2 clipSpace = ((position / u_resolution) * 2.0 - 1.0) * vec2(1, -1);\n gl_Position = vec4(clipSpace, 0, 1);\n gl_PointSize = a_size;\n v_opacity = opacity;\n v_color = a_color;\n }\n",u="\n precision mediump float;\n\n varying float v_opacity;\n varying vec3 v_color;\n\n void main() {\n vec2 coord = gl_PointCoord - vec2(0.5);\n\n // Create a four-pointed star\n float absX = abs(coord.x);\n float absY = abs(coord.y);\n\n // Star parameters\n float innerSize = 0.12; // Size of center square\n float armLength = 0.45; // Length of star arms\n float armWidth = 0.08; // Half-width of star arms at base\n\n float dist = 1.0; // Default to outside\n\n // Center square\n if (absX <= innerSize && absY <= innerSize) {\n dist = max(absX, absY) - innerSize;\n }\n // Horizontal arms (left and right points)\n else if (absY <= armWidth && absX <= armLength) {\n // Taper the arms - they get narrower toward the tips\n float normalizedX = (absX - innerSize) / (armLength - innerSize);\n float taperFactor = 1.0 - normalizedX * 0.8; // Taper to 20% of original width\n float currentArmWidth = armWidth * taperFactor;\n dist = absY - currentArmWidth;\n }\n // Vertical arms (top and bottom points)\n else if (absX <= armWidth && absY <= armLength) {\n // Taper the arms - they get narrower toward the tips\n float normalizedY = (absY - innerSize) / (armLength - innerSize);\n float taperFactor = 1.0 - normalizedY * 0.8; // Taper to 20% of original width\n float currentArmWidth = armWidth * taperFactor;\n dist = absX - currentArmWidth;\n }\n\n // Use smoothstep for anti-aliasing to reduce subpixel artifacts\n float alpha = 1.0 - smoothstep(-0.01, 0.01, dist);\n\n if (alpha <= 0.0) {\n discard;\n }\n\n gl_FragColor = vec4(v_color * v_opacity * alpha, v_opacity * alpha);\n }\n";function h(e,t,a){const i=e.createShader(t);if(i){if(e.shaderSource(i,a),e.compileShader(i),e.getShaderParameter(i,e.COMPILE_STATUS))return i;e.deleteShader(i)}}class p{constructor(e){this.seed=e}next(){return this.seed=(9301*this.seed+49297)%233280,this.seed/233280}nextBetween(e,t){return e+(t-e)*this.next()}}let A;function b(e,t){if(Array.isArray(e[0])){const[a,i]=e;return[t.nextBetween(a[0],i[0]),t.nextBetween(a[1],i[1]),t.nextBetween(a[2],i[2])]}return e}var v=a(20021);const g=[0,-36],_=(0,i.ph)(({color:e="purple",centerShift:t=g,isDisabled:a,className:r,onRequestAnimation:o})=>{const l=(0,i.li)();return(0,i.Nf)(()=>{if(!a)return d(l.current,{color:s[`${e}Gradient`],centerShift:t})},[t,e,a]),(0,i.vJ)(()=>{o&&o(()=>{a||d(l.current,{color:s[`${e}Gradient`],centerShift:t,...c})})},[t,e,a,o]),(0,v.Y)("canvas",{ref:l,className:(0,n.A)("hHHgpBRr",r)})})}}]);
|
|
//# sourceMappingURL=7426.c02a76a0c7f9f6f79de2.js.map
|