1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3962,2746],{23962:function(e,t,r){r.r(t),r.d(t,{LensRenderer:function(){return i}});var n=r(32746);class i{init(){let e,t;let r=this.gl;if(!r){this.status("WebGL unavailable \xb7 static fallback");return}let i=[];try{for(let[e,t]of[[r.VERTEX_SHADER,n.vertexSource],[r.FRAGMENT_SHADER,n.fragmentSource]]){let n=r.createShader(e);if(!n)throw Error("Shader allocation failed");if(i.push(n),r.shaderSource(n,t),r.compileShader(n),!r.getShaderParameter(n,r.COMPILE_STATUS))throw Error(r.getShaderInfoLog(n))}if(!(e=r.createProgram()))throw Error("Program allocation failed");if(i.forEach(t=>r.attachShader(e,t)),r.linkProgram(e),!r.getProgramParameter(e,r.LINK_STATUS))throw Error(r.getProgramInfoLog(e));if(r.useProgram(e),!(t=r.createBuffer()))throw Error("Buffer allocation failed");r.bindBuffer(r.ARRAY_BUFFER,t),r.bufferData(r.ARRAY_BUFFER,new Float32Array([-1,-1,3,-1,-1,3]),r.STATIC_DRAW);let o=r.getAttribLocation(e,"position");r.enableVertexAttribArray(o),r.vertexAttribPointer(o,2,r.FLOAT,!1,0,0),this.uniforms=Object.fromEntries(["resolution","detailCrop","front","back","ior","diagnosticGrid","upperOffset","rearOffset","studyView","lightGain","lightTheme","squareFrame"].map(t=>[t,r.getUniformLocation(e,t)])),this.program=e,this.buffer=t,this.ready=!0,this.status("Continuous glass \xb7 WebGL 1")}catch(n){t&&r.deleteBuffer(t),e&&r.deleteProgram(e),this.ready=!1,this.canvas.parentElement.dataset.ready="false",this.status("Renderer failed \xb7 static fallback"),console.error(n)}finally{i.forEach(e=>r.deleteShader(e))}}draw(e,t,r,i){var o,a,s,l,c;let d=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(!this.ready)return;let f=this.gl,h=this.canvas.getBoundingClientRect();if(!h.width||!h.height)return;let u=Math.min(window.devicePixelRatio||1,1.5,1440/h.width,1200/h.height,Math.sqrt(1152e3/(h.width*h.height))),g=Math.max(1,Math.round(h.width*u)),p=Math.max(1,Math.round(h.height*u));(this.canvas.width!==g||this.canvas.height!==p)&&(this.canvas.width=g,this.canvas.height=p,f.viewport(0,0,g,p));let m=this.uniforms;f.uniform2f(m.resolution,g,p),f.uniform4fv(m.detailCrop,null!==(o=e.crop)&&void 0!==o?o:[0,0,0,0]),f.uniform3fv(m.front,e.front),f.uniform3fv(m.back,e.back),f.uniform1f(m.ior,null!==(a=e.ior)&&void 0!==a?a:1.46),f.uniform1f(m.diagnosticGrid,e.grid?1:0);let v=(0,n.motionOffsets)(t,null!==(s=e.motionMode)&&void 0!==s?s:0);if(f.uniform2fv(m.upperOffset,v.upper),f.uniform2fv(m.rearOffset,v.rear),f.uniform1f(m.studyView,null!==(l=e.view)&&void 0!==l?l:0),f.uniform1f(m.lightGain,null!==(c=e.lightGain)&&void 0!==c?c:1),f.uniform1f(m.lightTheme,r?1:0),f.uniform1f(m.squareFrame,e.square?1:0),f.drawArrays(f.TRIANGLES,0,3),f.isContextLost()){this.lost();return}"true"!==this.canvas.parentElement.dataset.ready&&(this.canvas.parentElement.dataset.ready="true"),this.frames++,d&&null!==this.lastFrame&&(this.intervals.push(i-this.lastFrame),this.intervals.length>720&&this.intervals.shift()),this.lastFrame=d?i:null}report(){let e=[...this.intervals].sort((e,t)=>e-t);return{renderer:"WebGL 1 procedural, no texture input",ready:this.ready,raster:[this.canvas.width,this.canvas.height],frames:this.frames,samples:e.length,rafMedianMs:e.length?e[Math.floor(.5*e.length)]:null,rafP95Ms:e.length?e[Math.floor(.95*e.length)]:null,intervalsOver25Ms:e.filter(e=>e>25).length}}dispose(){if(!this.disposed){if(this.disposed=!0,this.canvas.removeEventListener("webglcontextlost",this.lost),this.gl){var e;this.gl.deleteBuffer(this.buffer),this.gl.deleteProgram(this.program),null===(e=this.gl.getExtension("WEBGL_lose_context"))||void 0===e||e.loseContext()}this.ready=!1}}constructor(e,t){this.canvas=e,this.status=t,this.frames=0,this.intervals=[],this.lastFrame=null,this.ready=!1,this.disposed=!1,this.gl=e.getContext("webgl",{alpha:!1,antialias:!1,depth:!1,stencil:!1,powerPreference:"low-power"}),this.lost=()=>{this.disposed||(this.ready=!1,e.parentElement.dataset.ready="false",this.status("Context unavailable \xb7 static fallback"))},e.addEventListener("webglcontextlost",this.lost),this.init()}}},32746:function(e,t,r){function n(e,t){return t?{front:[.74,.29,.63],back:[.02,.92,.77],glow:[.4,.6,.45,.14],square:!0}:"square"===e?{front:[.3,.16,.62],back:[1.11,1.18,1.02],glow:[.57,.5,.46,.15],square:!0}:{front:[.981152,-.346334,.917352],back:[1.289,1.328,1.238],glow:[1.1,.31,.56,.19],square:!1}}function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=e%12*Math.PI*2/12;return{upper:1===t?[0,0]:[.045*Math.sin(r),(Math.cos(r)-1)*.025],rear:2===t?[0,0]:[-(.085*(Math.sin(r+.75)-.6816387600233341)),(Math.sin(2*r+.4)-.3894183423086505)*.035]}}r.r(t),r.d(t,{composition:function(){return n},fragmentSource:function(){return a},motionOffsets:function(){return i},vertexSource:function(){return o}});let o="\nattribute vec2 position;\nvoid main() { gl_Position = vec4(position, 0.0, 1.0); }\n",a="\nprecision highp float;\nuniform vec2 resolution;\nuniform vec4 detailCrop;\nuniform vec3 front;\nuniform vec3 back;\nuniform vec2 upperOffset;\nuniform vec2 rearOffset;\nuniform float lightTheme;\nuniform float squareFrame;\nuniform float ior;\nuniform float diagnosticGrid;\nuniform float studyView;\nuniform float lightGain;\n\n\n\nconst float PI = 3.14159265359;\nconst vec3 MIDNIGHT = vec3(2.0,12.0,27.0)/255.0;\nconst vec3 BLUE = vec3(19.0,51.0,133.0)/255.0;\nconst vec3 MINT = vec3(27.0,236.0,197.0)/255.0;\nfloat gaussian(float x,float width) { return exp(-0.5*x*x/(width*width)); }\n\n// Intersect an arbitrary ray with a closed ellipsoid, in real scene units.\n// The second root locates the EXIT surface after the ray enters the glass.\nvec2 intersections(vec3 origin,vec3 direction,vec3 center,vec3 axes) {\n vec3 o=(origin-center)/axes, d=direction/axes;\n float a=dot(d,d), b=dot(o,d), c=dot(o,o)-1.0;\n float discriminant=b*b-a*c;
1\n if(discriminant<0.0) return vec2(-1.0);\n float root=sqrt(discriminant);\n return vec2((-b-root)/a,(-b+root)/a);\n}\n\n// Snell's law at air->glass and glass->air. Returns 0 for a miss, 1 for\n// transmission, 2 for total internal reflection. No art-directed internal glow.\nfloat throughGlass(inout vec3 origin,inout vec3 direction,vec3 center,\n vec3 axes,float index,out float reflection,out float thickness,out vec3 reflectedRay) {\n reflection=0.0; thickness=0.0; reflectedRay=vec3(0.0,0.0,-1.0);\n vec2 hits=intersections(origin,direction,center,axes);\n if(hits.x<0.0) return 0.0;\n vec3 entry=origin+direction*hits.x;\n vec3 normal=normalize((entry-center)/(axes*axes));\n float cosine=clamp(-dot(direction,normal),0.0,1.0);\n float r0=pow((1.0-index)/(1.0+index),2.0);\n reflection=index<=1.00001 ? 0.0 : r0+(1.0-r0)*pow(1.0-cosine,5.0);\n reflectedRay=reflect(direction,normal);\n vec3 inside=refract(direction,normal,1.0/index);\n vec3 entryInside=entry+inside*0.0001;\n vec2 exits=intersections(entryInside,inside,center,axes);\n vec3 exitPoint=entryInside+inside*exits.y;\n vec3 exitNormal=normalize((exitPoint-center)/(axes*axes));\n thickness=length(exitPoint-entry);\n vec3 outgoing=refract(inside,-exitNormal,index);\n if(dot(outgoing,outgoing)<0.00001) { reflection=1.0; return 2.0; }\n origin=exitPoint+outgoing*0.0001;\n direction=outgoing;\n return 1.0;\n}\n\n\n// Shape-preserving cubic interpolation of the radial surface slope. Shared\n// tangents give a continuous normal field, without painted contour corrections.\nfloat slopeTangent(float a,float b) {\n return a*b<=0.0 ? 0.0 : 2.0*a*b/(a+b);\n}\nfloat slopeSegment(float x,float a,float b,float ya,float yb,float ma,float mb) {\n float t=clamp((x-a)/(b-a),0.0,1.0),t2=t*t,t3=t2*t;\n return (2.0*t3-3.0*t2+1.0)*ya+(t3-2.0*t2+t)*(b-a)*ma\n +(-2.0*t3+3.0*t2)*yb+(t3-t2)*(b-a)*mb;\n}\nfloat surfaceSlope(float r) {\n const float h1=0.086356,h2=0.366394,h3=0.744503,h4=0.952638;\n float d0=h1/0.05,d1=(h2-h1)/0.05,d2=(h3-h2)/0.05,d3=(h4-h3)/0.05;\n float m1=slopeTangent(d0,d1),m2=slopeTangent(d1,d2),m3=slopeTangent(d2,d3);\n if(r<0.85) return slopeSegment(r,0.8,0.85,0.0,h1,0.0,m1);\n if(r<0.9) return slopeSegment(r,0.85,0.9,h1,h2,m1,m2);\n if(r<0.95) return slopeSegment(r,0.9,0.95,h2,h3,m2,m3);\n return slopeSegment(r,0.95,1.0,h3,h4,m3,0.0);\n}\n\n// A continuous thin glass surface refracts the procedural layers beneath it.\n// The edge normal grows smoothly over the Glass depth region. There is no\n// cylindrical exit wall, ray-path switch, or internal-reflection fallback.\n// This is a fitted optical surface, not Figma's unpublished native shader.\nfloat throughUpper(inout vec3 origin,inout vec3 direction,vec3 f,float index,\n out float reflection,out float thickness,out vec3 reflectedRay) {\n reflection=0.0; thickness=0.0; reflectedRay=vec3(0.0,0.0,-1.0);\n vec2 v=origin.xy-f.xy;\n float radius=length(v)/f.z;\n if(radius>=1.0) return 0.0;\n vec2 radial=v/max(length(v),0.00001);\n vec3 normal=normalize(vec3(radial*surfaceSlope(radius),-1.0));\n direction=refract(direction,normal,1.0/index);\n origin=vec3(origin.xy,0.0);\n thickness=0.10;\n reflectedRay=reflect(vec3(0.0,0.0,1.0),normal);\n return 1.0;\n}\n\nvec3 backdrop(vec2 p) {\n if(diagnosticGrid>0.5) {\n vec2 tile=abs(fract(p*10.0)-0.5);\n float line=smoothstep(0.455,0.485,max(tile.x,tile.y));\n vec3 color=mix(vec3(0.09,0.15,0.24),vec3(0.70,0.81,0.83),line);\n // Colored axes make displacement direction visible, even at rest.\n color=mix(color,MINT,1.0-smoothstep(0.008,0.012,abs(p.x-1.0)));\n return color;\n }\n // The source background returns to midnight at both ends of its radial\n // gradient. A single centered glow incorrectly filled the upper-left corner.\n float wash=gaussian(length(p-vec2(1.045770,0.943800))-0.930000,0.321025)*0.720213;\n vec3 color=mix(MIDNIGHT,vec3(9.0,34.0,101.0)/255.0,wash);\n if(lightTheme>0.5) color=mix(vec3(245.0/255.0),vec3(217.0/255.0),clamp(p.y*0.5,0.0,1.0));\n return color;\n}\n\nvec3 environment(vec3 direction) {\n float softbox=pow(max(0.0,dot(normalize(direction),normalize(vec3(-0.3,-0.5,-1.0)))),10.0);\n float strip=pow(max(0.0,dot(normalize(direction),normalize(vec3(0.4,0.5,-1.0)))),6.0);\n return mix(MIDNIGHT,vec3(0.65,0.79,0.81),softbox*0.5+lightTheme*0.2)+MINT*strip*0.35;\n}\n\n// A soft blue body and mint edge in the rear object's own plane. The upper\n// ray samples this material, so its apparent contour comes from refraction.\nfloat rearDefocus(vec2 p,vec3 b) {\n // The focus region follows the rear material, independently of upper motion.\n vec2 focus=front.xy+(b.xy-back.xy);\n float separation=max(0.0,length(p-focus)-front.z);\n return 0.022372*smoothstep(0.015,0.70,separation);\n}\n\nvec3 rearLighting(vec2 p,vec3 b,float frost,float paintedBlue) {\n float r=length(p-b.xy)/b.z;\n float defocus=length(vec2(rearDefocus(p,b),frost));\n // Convolve the narrow core and its soft halo with the local blur. Preserve\
1n // their integrated brightness, so a blurred edge also fades instead of turning\n // into an equally bright, thicker outline.\n float coreWidth=sqrt(0.0035*0.0035+defocus*defocus);\n float haloWidth=sqrt(0.014*0.014+defocus*defocus);\n float edge=gaussian(r-1.0,coreWidth)*(0.0035/coreWidth)*0.183255\n +gaussian(r-1.0,haloWidth)*(0.014/haloWidth)*0.04;\n float bodyWidth=sqrt(0.059795*0.059795+defocus*defocus);\n float body=gaussian(r-0.94,bodyWidth)*(0.059795/bodyWidth);\n // Through the upper glass, blue is composited as pigment in sampleScene.\n // Adding it here as radiance as well would wash out the transmitted blue band.\n return BLUE*body*0.344843*(1.0-paintedBlue)+MINT*edge;\n}\n\n// Procedural light and shade layers seeded from the designer SVG exports.\n// Gaussian widths, shade position and exposure are fitted for the wide study.\n// These are the source's blurred lighting ellipses, not a painted lens contour.\n// The light card is only visible through the upper glass.\nvec3 lightCard(vec2 p) {\n vec2 q=p-vec2(0.998044,0.305643);\n float along=q.x*0.966-q.y*0.260;\n float across=q.x*0.260+q.y*0.966;\n float mint=gaussian(along,0.556724)*gaussian(across,0.135697);\n vec2 dark=p-vec2(1.244860,0.402950);\n float shade=gaussian(dark.x*0.981-dark.y*0.196,0.545217)\n *gaussian(dark.x*0.196+dark.y*0.981,0.153032);\n return MINT*mint*0.638624*(1.0-0.427959*shade);\n}\n\nvec3 sampleScene(vec2 p,vec3 f,vec3 b,float index) {\n vec3 origin=vec3(p,-2.0), direction=vec3(0.0,0.0,1.0);\n float upperReflection,upperThickness;\n vec3 upperReflected;\n if(studyView>1.5) return MIDNIGHT+lightCard(p)*lightGain;\n if(studyView>0.5) f=vec3(-10.0,-10.0,0.5);\n float upper=throughUpper(origin,direction,f,index,upperReflection,upperThickness,upperReflected);\n if(upper>1.5) return environment(reflect(vec3(0.0,0.0,1.0),normalize(vec3(p-f.xy,-0.12))));\n vec2 rearPlane=origin.xy+direction.xy*((1.10-origin.z)/max(direction.z,0.0001));\n vec2 cardPlane=origin.xy+direction.xy*((1.10-origin.z)/max(direction.z,0.0001));\n vec3 glow=upper>0.5 && diagnosticGrid<0.5 && lightTheme<0.5 ? lightCard(cardPlane)*lightGain : vec3(0.0);\n vec3 rearLight=diagnosticGrid<0.5 && lightTheme<0.5 ? rearLighting(rearPlane,b,upper>0.5 ? 0.005984 : 0.0,upper) : vec3(0.0);\n // Figma refracts the painted layer stack, not a second closed glass solid.\n // Preserve the existing rear-only renderer; avoid its silhouette/TIR branch\n // inside the upper transmitted image. Grid mode retains both optics as a test.\n if(upper>0.5 && diagnosticGrid<0.5 && lightTheme<0.5) {\n // The radial blue layer covers the mint light beneath its rim. Compositing\n // this coverage is essential: adding both lights makes the rim uniformly cyan.\n float rearRadius=length(rearPlane-b.xy)/b.z;\n float faceRadius=length(p-f.xy)/f.z;\n float edgeFrost=smoothstep(0.88,1.0,faceRadius);\n // Radial opacity rises toward the edge of the painted rear circle, then\n // falls through its blurred silhouette. This replaces an additive Gaussian\n // blue glow; the contour still comes entirely from the refracted rear ray.\n float blueCoverage=smoothstep(0.806134,1.0,rearRadius)*(1.0-smoothstep(0.982206,1.016710,rearRadius));\n // Keep the transmitted mint within the rear artwork's soft footprint.\n // A gradual mask follows the moving rear layer, not a fixed screen oval.\n float lightCoverage=1.0-0.85*smoothstep(0.94,1.189681,rearRadius);\n // Less blue absorption at the thin outer edge; keep the warmer interior.\n float apertureRadius=length(p-f.xy)/f.z;\n float edgeTransmission=smoothstep(0.88,1.0,apertureRadius);\n float edgeLight=1.0-0.549582*smoothstep(0.94,1.0,apertureRadius);\n vec3 transmitted=backdrop(rearPlane)*vec3(0.90,0.88,0.82)\n +glow*vec3(1.1,1.0,mix(0.864259,0.45,edgeTransmission))*edgeLight*lightCoverage;\n return mix(transmitted,BLUE*0.905759,blueCoverage*(1.0-0.171232*edgeFrost))+rearLight*0.611264;\n }\n float rearReflection,rearThickness;\n vec3 rearReflected;\n float rear=throughGlass(origin,direction,vec3(b.xy,1.10),vec3(b.zz,0.18),index,rearReflection,rearThickness,rearReflected);\n // The frosted rear finish contributes diffuse radiance at grazing angles.\n if(rear>1.5) return diagnosticGrid>0.5 || lightTheme>0.5 ? environment(rearReflected) : backdrop(rearPlane)+rearLight+glow;\n if(direction.z<=0.0001) return environment(direction);\n vec2 hit=origin.xy+direction.xy*((2.6-origin.z)/direction.z);\n // Five deterministic samples approximate frost on the background plane.\n float frost=diagnosticGrid>0.5 ? 0.0 : 0.011*(upperThickness+rearThickness);\n vec3 color=backdrop(hit)*0.4;
1\n color+=(backdrop(hit+vec2(frost,0.0))+backdrop(hit-vec2(frost,0.0))\n +backdrop(hit+vec2(0.0,frost))+backdrop(hit-vec2(0.0,frost)))*0.15;\n if(diagnosticGrid<0.5) {\n // Beer-Lambert tint travels with actual thickness, not a painted oval.\n color*=exp(-vec3(0.14,0.025,0.04)*(upperThickness+rearThickness));\n color=mix(color,environment(rearReflected),rearReflection*(lightTheme>0.5 ? 0.7 : 0.20));\n // Rougher parts of the rear finish tend toward diffuse backdrop radiance.\n // Soften the glass boundary too, not just the luminous stroke around it.\n if(lightTheme<0.5) color=mix(color,backdrop(rearPlane),mix(0.92,1.0,smoothstep(0.0,0.035,rearDefocus(rearPlane,b))));\n color+=rearLight*(upper>0.5 ? 0.60 : 1.0)+glow;\n color=mix(color,environment(upperReflected),upperReflection*0.7);\n }\n return color;\n}\n\nvoid main() {\n vec2 p=vec2(gl_FragCoord.x,resolution.y-gl_FragCoord.y)/resolution.y;\n float aspect=resolution.x/resolution.y;\n float sourceAspect=mix(1920.0/900.0,1.0,squareFrame);\n float scale=max(1.0,aspect/sourceAspect);\n p/=scale;\n p.x+=(sourceAspect-aspect/scale)*0.5;\n if(detailCrop.z>0.0) p=detailCrop.xy+vec2(gl_FragCoord.x/resolution.x,1.0-gl_FragCoord.y/resolution.y)*detailCrop.zw;\n vec3 f=vec3(front.xy+upperOffset,front.z);\n vec3 b=vec3(back.xy+rearOffset,back.z);\n vec3 result=sampleScene(p,f,b,ior);\n if(diagnosticGrid<0.5) {\n // Small wavelength-specific IOR changes produce real dispersed rays.\n float dispersion=ior>1.001 ? 0.006 : 0.0;\n result.r=sampleScene(p,f,b,max(1.0,ior-dispersion)).r;\n result.b=sampleScene(p,f,b,ior+dispersion).b;\n float d=length(p-f.xy)-f.z;\n // Antialias in source-space pixels. A detail crop magnifies the same fine\n // edge instead of widening it according to the full-frame viewport height.\n float sourcePixel=detailCrop.z>0.0 ? detailCrop.w/resolution.y : 1.0/(resolution.y*scale);\n float rimWidth=sqrt(0.00065*0.00065+sourcePixel*sourcePixel/12.0);\n float rim=gaussian(d,rimWidth)*(0.00065/rimWidth);\n vec2 rimDirection=normalize(p-f.xy);\n float lower=smoothstep(0.157542,0.98,rimDirection.y);\n float sideFade=1.0-0.80*smoothstep(0.25,0.85,rimDirection.x);\n result=mix(result,vec3(0.7,0.86,0.85),rim*lower*sideFade*0.95*(studyView<0.5 ? 1.0 : 0.0));\n }\n float noise=fract(sin(dot(gl_FragCoord.xy,vec2(12.9898,78.233)))*43758.5453)-0.5;\n gl_FragColor=vec4(clamp(result+noise/255.0,0.0,1.0),1.0);\n}\n"}}]);
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.