{"version":3,"file":"MagicDistortion.CFOOODVn.mjs","names":["React.useRef","React.useState","React.useMemo"],"sources":["https:/framerusercontent.com/modules/zNJyV2dbAVGwMYqypc3x/6AIArmvWyd6gjVdCk2zr/MagicDistortion.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";const DEFAULT_EFFECT={strength:30,radius:46,trail:1,ripple:1.05,flow:.72,refraction:.18,motion:.74,response:8,fadeOut:.85,drift:.28};const VERTEX_SHADER=`\nattribute vec2 aPosition;\nvarying vec2 vUv;\n\nvoid main() {\n    vUv = aPosition * 0.5 + 0.5;\n    gl_Position = vec4(aPosition, 0.0, 1.0);\n}\n`;const FRAGMENT_SHADER=`\nprecision highp float;\n\nuniform sampler2D uTexture;\nuniform vec2 uResolution;\nuniform vec4 uImageRect;\nuniform vec2 uMouse;\nuniform vec2 uVelocity;\nuniform vec2 uDirection;\nuniform float uMotion;\nuniform float uActivity;\nuniform float uHover;\nuniform float uTime;\nuniform float uStrength;\nuniform float uRadius;\nuniform float uTrail;\nuniform float uRipple;\nuniform float uFlow;\nuniform float uRefraction;\nuniform float uVelocityAmount;\nuniform float uDrift;\n\nvarying vec2 vUv;\n\nvec4 sampleCanvas(vec2 canvasUv) {\n    vec2 uv = (canvasUv - uImageRect.xy) / max(uImageRect.zw, vec2(0.00001));\n    float inside =\n        step(0.0, uv.x) * step(uv.x, 1.0) *\n        step(0.0, uv.y) * step(uv.y, 1.0);\n\n    if (inside < 0.5) return vec4(0.0);\n    return texture2D(uTexture, uv);\n}\n\nfloat bell(float x) {\n    x = clamp(x, 0.0, 1.0);\n    return x * x * (3.0 - 2.0 * x);\n}\n\nfloat smoother01(float x) {\n    x = clamp(x, 0.0, 1.0);\n    return x * x * x * (x * (x * 6.0 - 15.0) + 10.0);\n}\n\nvec2 safeNormalize(vec2 v) {\n    float len = max(length(v), 0.00001);\n    return v / len;\n}\n\nvoid main() {\n    vec2 p = vUv;\n    float aspect = uResolution.x / max(uResolution.y, 1.0);\n    vec2 pIso = vec2(p.x * aspect, p.y);\n    vec2 mouseIso = vec2(uMouse.x * aspect, uMouse.y);\n    vec2 velIso = uVelocity;\n\n    float hover = smoother01(uHover);\n    float motion = smoother01(uMotion) * hover;\n\n    // Distortion exists only while the pointer is actually moving. Multiplying uMotion\n    // before smootherstep keeps the existing effect strength during normal movement,\n    // while allowing the whole deformation to fade completely to zero after stopping.\n    float activity = smoother01(clamp(uActivity, 0.0, 1.0)) * hover;\n\n    vec2 dir = safeNormalize(uDirection + vec2(0.000001, 0.0));\n    vec2 normal = vec2(-dir.y, dir.x);\n\n    vec2 rel = pIso - mouseIso;\n    float along = dot(rel, dir);\n    float across = dot(rel, normal);\n    float radius = max(uRadius, 0.01);\n    float amp = uStrength / max(uResolution.y, 1.0);\n\n    float trailLength = radius * mix(0.7, 3.0, clamp(uTrail, 0.0, 1.5) / 1.5);\n    float crossFalloff = exp(-pow(abs(across) / max(radius * 0.65, 0.001), 2.1));\n    float behind = exp(-pow(max(-along, 0.0) / max(trailLength, 0.001), 1.35));\n    float ahead = exp(-pow(max(along, 0.0) / max(radius * 0.82, 0.001), 2.0));\n\n    float dist = length(rel);\n    float contact = 1.0 - smoothstep(radius * 0.10, radius, dist);\n    contact = bell(contact);\n\n    float wake = crossFalloff * mix(ahead * 0.24, behind, step(along, 0.0));\n    float field = max(contact * 0.72, wake * (0.34 + 0.66 * motion)) * activity;\n\n    float speed = length(velIso);\n    float velocityWeight = (0.25 + 0.75 * motion) * clamp(uVelocityAmount, 0.0, 1.6);\n    vec2 drag = -dir * amp * uFlow * field * (0.15 + 0.50 * velocityWeight + 0.16 * speed);\n\n    vec2 radial = safeNormalize(rel);\n\n    // Remove the tiny moving black/white point at the cursor by fading the local\n    // pressure/refraction all the way to zero at the exact center.\n    float centerFade = smoothstep(radius * 0.14, radius * 0.30, dist);\n    vec2 lens = -radial * amp * uRefraction * contact * centerFade * (0.10 + 0.08 * motion) * activity;\n\n    float tail = clamp(max(-along, 0.0) / max(trailLength, 0.001), 0.0, 1.0);\n    float rippleEnvelope = wake * exp(-tail * 1.05) * (0.40 + 0.68 * motion) * activity;\n    float ripplePhase = tail * 12.4 - uTime * (2.35 + uDrift * 1.1) + across * 3.1;\n    float ripples = sin(ripplePhase) * 0.5 + sin(ripplePhase * 0.55 + 0.9) * 0.5;\n    vec2 rippleOffset = normal * ripples * amp * uRipple * rippleEnvelope * 0.24;\n\n    // No center eddy: it was the second source of the tiny moving spot.\n    vec2 warpedIso = pIso + drag + lens + rippleOffset;\n    vec2 warpedUv = vec2(warpedIso.x / aspect, warpedIso.y);\n\n    vec4 color = sampleCanvas(warpedUv);\n    if (color.a < 0.001) {\n        color.rgb = vec3(0.0);\n    }\n\n    gl_FragColor = color;\n}\n`;function clamp(value,min,max){return Math.min(max,Math.max(min,value));}function parseLength(token,reference){const n=Number.parseFloat(token);if(!Number.isFinite(n))return 0;return token.trim().endsWith(\"%\")?n/100*reference:n;}function parsePadding(padding,width,height){const tokens=String(padding||\"0px\").trim().split(/\\s+/).filter(Boolean);const raw=tokens.length?tokens:[\"0px\"];const values=raw.map(token=>parseLength(token,width));let top=0;let right=0;let bottom=0;let left=0;if(values.length===1){top=right=bottom=left=values[0];}else if(values.length===2){top=bottom=values[0];right=left=values[1];}else if(values.length===3){top=values[0];right=left=values[1];bottom=values[2];}else{top=values[0];right=values[1];bottom=values[2];left=values[3];}// Keep at least a 1px drawable inner region.\nconst maxHorizontal=Math.max(0,width-1);const maxVertical=Math.max(0,height-1);left=clamp(left,0,maxHorizontal);right=clamp(right,0,Math.max(0,maxHorizontal-left));top=clamp(top,0,maxVertical);bottom=clamp(bottom,0,Math.max(0,maxVertical-top));return{top,right,bottom,left};}function negatePadding(padding){const tokens=String(padding||\"0px\").trim().split(/\\s+/).filter(Boolean);const raw=tokens.length?tokens:[\"0px\"];return raw.map(token=>{const value=token.trim();if(!value||value===\"0\"||value===\"0px\"||value===\"0%\")return value;return value.startsWith(\"-\")?value.slice(1):`-${value}`;}).join(\" \");}function makeShader(gl,type,source){const shader=gl.createShader(type);if(!shader)throw new Error(\"Could not create WebGL shader\");gl.shaderSource(shader,source);gl.compileShader(shader);if(!gl.getShaderParameter(shader,gl.COMPILE_STATUS)){const log=gl.getShaderInfoLog(shader)||\"Unknown shader error\";gl.deleteShader(shader);throw new Error(log);}return shader;}function makeProgram(gl){const vertex=makeShader(gl,gl.VERTEX_SHADER,VERTEX_SHADER);const fragment=makeShader(gl,gl.FRAGMENT_SHADER,FRAGMENT_SHADER);const program=gl.createProgram();if(!program)throw new Error(\"Could not create WebGL program\");gl.attachShader(program,vertex);gl.attachShader(program,fragment);gl.linkProgram(program);gl.deleteShader(vertex);gl.deleteShader(fragment);if(!gl.getProgramParameter(program,gl.LINK_STATUS)){const log=gl.getProgramInfoLog(program)||\"Unknown program error\";gl.deleteProgram(program);throw new Error(log);}return program;}/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight auto\n * @framerIntrinsicWidth 720\n * @framerIntrinsicHeight 160\n * @framerDisableUnlink\n */export default function MagicDistortion(props){const{image,altText=\"\",sizing=\"ratio\",aspectRatio=5.8,fit=\"contain\",padding=\"28px\",tabletEffect=true,phoneEffect=true,effect=DEFAULT_EFFECT,style}=props;const canvasRef=React.useRef(null);const containerRef=React.useRef(null);const pointerTarget=React.useRef([.5,.5]);const pointerCurrent=React.useRef([.5,.5]);const pointerVelocity=React.useRef([0,0]);const directionCurrent=React.useRef([1,0]);const directionInitialized=React.useRef(false);const motionCurrent=React.useRef(0);const pointerActivityCurrent=React.useRef(0);const activityFadeStartTime=React.useRef(0);const activityFadeStartValue=React.useRef(0);const lastPointerMoveTime=React.useRef(0);const hoverTarget=React.useRef(0);const hoverCurrent=React.useRef(0);const[naturalSize,setNaturalSize]=React.useState({width:1441,height:248});const[webglReady,setWebglReady]=React.useState(false);const[webglFailed,setWebglFailed]=React.useState(false);const[viewportCategory,setViewportCategory]=React.useState(null);const isStaticRenderer=useIsStaticRenderer();const naturalRatio=naturalSize.width/Math.max(naturalSize.height,1);const safeRatio=clamp(Number(aspectRatio)||naturalRatio||1,.05,30);const fxInset=React.useMemo(()=>negatePadding(padding),[padding]);// Resolve the current viewport category only in the browser. These widths match\n// Framer's common Desktop / Tablet / Phone breakpoint convention.\nReact.useEffect(()=>{if(typeof window===\"undefined\")return;const updateViewportCategory=()=>{const width=window.innerWidth;setViewportCategory(width>=1200?\"desktop\":width>=810?\"tablet\":\"phone\");};updateViewportCategory();window.addEventListener(\"resize\",updateViewportCategory,{passive:true});return()=>{window.removeEventListener(\"resize\",updateViewportCategory);};},[]);const viewportEffectEnabled=viewportCategory===\"desktop\"||viewportCategory===\"tablet\"&&tabletEffect||viewportCategory===\"phone\"&&phoneEffect;const shouldRenderWebGL=!isStaticRenderer&&viewportEffectEnabled;React.useEffect(()=>{if(!image?.src)return;const img=new Image;img.crossOrigin=\"anonymous\";img.onload=()=>{if(img.naturalWidth>0&&img.naturalHeight>0){setNaturalSize({width:img.naturalWidth,height:img.naturalHeight});}};img.src=image.src;},[image?.src]);React.useEffect(()=>{// Framer Canvas/static rendering and disabled Tablet/Phone viewports show only\n// the original image. The canvas is not mounted in these states, so no WebGL\n// context, texture, observer, or animation loop is created.\nif(!shouldRenderWebGL){setWebglReady(false);setWebglFailed(false);return;}const canvas=canvasRef.current;const container=containerRef.current;if(!canvas||!container||!image?.src){setWebglReady(false);return;}setWebglFailed(false);setWebglReady(false);const gl=canvas.getContext(\"webgl\",{alpha:true,antialias:true,premultipliedAlpha:false,preserveDrawingBuffer:false,powerPreference:\"high-performance\"});if(!gl){setWebglFailed(true);return;}let program=null;let texture=null;let buffer=null;let frame=0;let viewportCheckFrame=0;let resizeObserver=null;let intersectionObserver=null;let cancelled=false;let lastTime=performance.now();let textureImage=null;let textureReady=false;let renderLoopRunning=false;let hasRenderedFrame=false;// Start optimistically. IntersectionObserver will pause truly offscreen instances,\n// but this avoids Framer Live Preview getting stuck before its first reliable\n// observer callback/layout pass.\nlet isNearViewport=true;try{program=makeProgram(gl);gl.useProgram(program);buffer=gl.createBuffer();gl.bindBuffer(gl.ARRAY_BUFFER,buffer);gl.bufferData(gl.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,1]),gl.STATIC_DRAW);const position=gl.getAttribLocation(program,\"aPosition\");gl.enableVertexAttribArray(position);gl.vertexAttribPointer(position,2,gl.FLOAT,false,0,0);texture=gl.createTexture();gl.activeTexture(gl.TEXTURE0);gl.bindTexture(gl.TEXTURE_2D,texture);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_S,gl.CLAMP_TO_EDGE);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_T,gl.CLAMP_TO_EDGE);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,gl.LINEAR);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MAG_FILTER,gl.LINEAR);gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL,1);gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,0);const textureUniform=gl.getUniformLocation(program,\"uTexture\");gl.uniform1i(textureUniform,0);}catch(error){console.error(\"MagicDistortion WebGL setup failed:\",error);setWebglFailed(true);return;}const uniform=name=>gl.getUniformLocation(program,name);const uniforms={resolution:uniform(\"uResolution\"),imageRect:uniform(\"uImageRect\"),mouse:uniform(\"uMouse\"),velocity:uniform(\"uVelocity\"),direction:uniform(\"uDirection\"),motion:uniform(\"uMotion\"),activity:uniform(\"uActivity\"),hover:uniform(\"uHover\"),time:uniform(\"uTime\"),strength:uniform(\"uStrength\"),radius:uniform(\"uRadius\"),trail:uniform(\"uTrail\"),ripple:uniform(\"uRipple\"),flow:uniform(\"uFlow\"),refraction:uniform(\"uRefraction\"),velocityAmount:uniform(\"uVelocityAmount\"),drift:uniform(\"uDrift\")};function resizeCanvas(){// The canvas lives inside an FX layer that expands beyond the layout box.\n// Size the WebGL buffer from the actual canvas bounds, not the layout root.\nconst rect=canvas.getBoundingClientRect();const dpr=Math.min(window.devicePixelRatio||1,2);const width=Math.max(1,Math.round(rect.width*dpr));const height=Math.max(1,Math.round(rect.height*dpr));if(canvas.width!==width||canvas.height!==height){canvas.width=width;canvas.height=height;}gl.viewport(0,0,canvas.width,canvas.height);}function getImageRect(width,height,imgW,imgH){// The root is the real Framer layout box. The canvas is larger only for FX.\n// Derive the image area from actual DOM geometry so asymmetric and percentage\n// FX Padding values cannot shift or shrink the artwork.\nconst canvasRect=canvas.getBoundingClientRect();const containerRect=container.getBoundingClientRect();const innerX=containerRect.left-canvasRect.left;const innerY=containerRect.top-canvasRect.top;const innerW=Math.max(1,containerRect.width);const innerH=Math.max(1,containerRect.height);const imageRatio=imgW/Math.max(imgH,1);const boxRatio=innerW/Math.max(innerH,1);let drawW=innerW;let drawH=innerH;const effectiveFit=sizing===\"fitImage\"?\"contain\":fit;if(effectiveFit===\"contain\"){if(imageRatio>boxRatio){drawW=innerW;drawH=drawW/imageRatio;}else{drawH=innerH;drawW=drawH*imageRatio;}}else{if(imageRatio>boxRatio){drawH=innerH;drawW=drawH*imageRatio;}else{drawW=innerW;drawH=drawW/imageRatio;}}const x=innerX+(innerW-drawW)*.5;const yTop=innerY+(innerH-drawH)*.5;// Shader coordinates use bottom-left origin.\nreturn{x:x/width,y:1-(yTop+drawH)/height,w:drawW/width,h:drawH/height};}function stopRenderLoop(resetInteraction=false){if(frame)cancelAnimationFrame(frame);frame=0;renderLoopRunning=false;if(resetInteraction){hoverTarget.current=0;hoverCurrent.current=0;motionCurrent.current=0;pointerActivityCurrent.current=0;pointerVelocity.current=[0,0];directionInitialized.current=false;activityFadeStartTime.current=0;activityFadeStartValue.current=0;}}function startRenderLoop(){if(cancelled||renderLoopRunning||!isNearViewport||!textureReady||!textureImage){return;}// Reset the frame clock after a viewport pause so the first resumed frame\n// never inherits a large delta from time spent offscreen.\nlastTime=performance.now();renderLoopRunning=true;frame=requestAnimationFrame(render);}function render(now){if(cancelled||!program||!textureImage||!textureReady){renderLoopRunning=false;frame=0;return;}if(!isNearViewport){renderLoopRunning=false;frame=0;return;}resizeCanvas();const dt=Math.min(.05,Math.max(.001,(now-lastTime)/1e3));lastTime=now;const response=clamp(effect?.response??DEFAULT_EFFECT.response,1,30);// Frame-rate-independent damping. Even at the highest Response setting we\n// deliberately cap the follow rate so the cursor can never snap to target.\nconst positionRate=2.8+response/30*7.2;const positionAlpha=1-Math.exp(-positionRate*dt);const prevX=pointerCurrent.current[0];const prevY=pointerCurrent.current[1];pointerCurrent.current[0]+=(pointerTarget.current[0]-pointerCurrent.current[0])*positionAlpha;pointerCurrent.current[1]+=(pointerTarget.current[1]-pointerCurrent.current[1])*positionAlpha;// Velocity is derived from the already-smoothed render-frame position in\n// CSS PIXELS per second. This is the key responsive fix: the same physical\n// mouse movement now produces the same velocity whether the component is\n// 600px or 1600px wide. Normalized UV velocity used to get smaller as the\n// element grew, which made the effect almost disappear on large screens.\nconst layoutRect=container.getBoundingClientRect();const cssWidth=Math.max(layoutRect.width||1,1);const cssHeight=Math.max(layoutRect.height||1,1);const velocityReference=900// px/s -> shader-friendly isotropic units\n;const rawVelocityX=clamp((pointerCurrent.current[0]-prevX)*cssWidth/dt/velocityReference,-1.8,1.8);const rawVelocityY=clamp((pointerCurrent.current[1]-prevY)*cssHeight/dt/velocityReference,-1.8,1.8);const velocityAlpha=1-Math.exp(-8*dt);pointerVelocity.current[0]+=(rawVelocityX-pointerVelocity.current[0])*velocityAlpha;pointerVelocity.current[1]+=(rawVelocityY-pointerVelocity.current[1])*velocityAlpha;// Direction has its own slower filter. Magnitude and direction should not share\n// the same smoothing: a tiny Y fluctuation during a horizontal gesture used to\n// rotate the wake normal and create visible edge shimmer.\nconst directionSpeed=Math.hypot(pointerVelocity.current[0],pointerVelocity.current[1]);if(directionSpeed>.028){const targetDirX=pointerVelocity.current[0]/directionSpeed;const targetDirY=pointerVelocity.current[1]/directionSpeed;if(!directionInitialized.current){directionCurrent.current[0]=targetDirX;directionCurrent.current[1]=targetDirY;directionInitialized.current=true;}else{const directionAlpha=1-Math.exp(-5.2*dt);directionCurrent.current[0]+=(targetDirX-directionCurrent.current[0])*directionAlpha;directionCurrent.current[1]+=(targetDirY-directionCurrent.current[1])*directionAlpha;const directionLength=Math.max(1e-5,Math.hypot(directionCurrent.current[0],directionCurrent.current[1]));directionCurrent.current[0]/=directionLength;directionCurrent.current[1]/=directionLength;}}// A separate motion envelope uses quintic smootherstep. Because speed is now\n// pixel-based, these thresholds are stable across viewport/component sizes.\n// Moderate movement (~250–450 px/s) remains visibly active even on 1600px layouts.\nconst speed=Math.hypot(pointerVelocity.current[0],pointerVelocity.current[1]);const normalizedSpeed=clamp((speed-.045)/.52,0,1);const motionTarget=normalizedSpeed*normalizedSpeed*normalizedSpeed*(normalizedSpeed*(normalizedSpeed*6-15)+10);const motionRate=motionTarget>motionCurrent.current?7.5:4;const motionAlpha=1-Math.exp(-motionRate*dt);motionCurrent.current+=(motionTarget-motionCurrent.current)*motionAlpha;// Exponential damping approaches zero forever but never mathematically reaches it.\n// Snap only an imperceptibly small remainder to zero so no animated deformation\n// can remain under a completely stationary cursor.\nif(motionTarget===0&&motionCurrent.current<.0025){motionCurrent.current=0;}// Real pointer activity is tracked separately from the smoothed cursor position.\n// While moving, activity rises quickly. After the physical pointer stops, the whole\n// deformation returns to zero over the user-controlled Fade Out duration using a\n// quintic smootherstep, so the release has zero slope at both ends instead of snapping.\nconst pointerIsMoving=hoverTarget.current>0&&now-lastPointerMoveTime.current<75;const fadeOut=clamp(effect?.fadeOut??DEFAULT_EFFECT.fadeOut,.15,4);if(pointerIsMoving){activityFadeStartTime.current=0;activityFadeStartValue.current=0;const activityAlpha=1-Math.exp(-16*dt);pointerActivityCurrent.current+=(1-pointerActivityCurrent.current)*activityAlpha;}else{if(activityFadeStartTime.current===0){activityFadeStartTime.current=now;activityFadeStartValue.current=pointerActivityCurrent.current;}const fadeProgress=clamp((now-activityFadeStartTime.current)/(fadeOut*1e3),0,1);const easedFade=fadeProgress*fadeProgress*fadeProgress*(fadeProgress*(fadeProgress*6-15)+10);pointerActivityCurrent.current=activityFadeStartValue.current*(1-easedFade);if(fadeProgress>=1){pointerActivityCurrent.current=0;}}const hoverGoal=isStaticRenderer?0:hoverTarget.current;const hoverRate=hoverGoal>hoverCurrent.current?7:5;const hoverAlpha=1-Math.exp(-hoverRate*dt);hoverCurrent.current+=(hoverGoal-hoverCurrent.current)*hoverAlpha;const rect=getImageRect(canvas.clientWidth||1,canvas.clientHeight||1,textureImage.naturalWidth||1,textureImage.naturalHeight||1);gl.clearColor(0,0,0,0);gl.clear(gl.COLOR_BUFFER_BIT);gl.useProgram(program);gl.bindTexture(gl.TEXTURE_2D,texture);gl.uniform2f(uniforms.resolution,canvas.clientWidth||1,canvas.clientHeight||1);gl.uniform4f(uniforms.imageRect,rect.x,rect.y,rect.w,rect.h);gl.uniform2f(uniforms.mouse,pointerCurrent.current[0],pointerCurrent.current[1]);gl.uniform2f(uniforms.velocity,pointerVelocity.current[0],pointerVelocity.current[1]);gl.uniform2f(uniforms.direction,directionCurrent.current[0],directionCurrent.current[1]);gl.uniform1f(uniforms.motion,clamp(motionCurrent.current,0,1));gl.uniform1f(uniforms.activity,clamp(pointerActivityCurrent.current,0,1));gl.uniform1f(uniforms.hover,clamp(hoverCurrent.current,0,1));gl.uniform1f(uniforms.time,now/1e3);// Strength is authored as a convenient base value, then scaled with the\n// actual component width. This keeps the deformation visually proportional\n// as the layout grows. Above ~1200px we add a subtle extra boost so a wide\n// 1600px hero/wordmark feels a little more expressive, not merely equivalent.\nconst baseStrength=clamp(effect?.strength??DEFAULT_EFFECT.strength,0,90);const widthScale=clamp(cssWidth/900,.7,1.85);const largeScreenBoost=1+clamp((cssWidth-1200)/800,0,1)*.12;const responsiveStrength=baseStrength*widthScale*largeScreenBoost;gl.uniform1f(uniforms.strength,responsiveStrength);gl.uniform1f(uniforms.trail,clamp(effect?.trail??DEFAULT_EFFECT.trail,0,1.5));gl.uniform1f(uniforms.radius,clamp((effect?.radius??DEFAULT_EFFECT.radius)/100,.05,1.5));gl.uniform1f(uniforms.ripple,clamp(effect?.ripple??DEFAULT_EFFECT.ripple,0,1.5));gl.uniform1f(uniforms.flow,clamp(effect?.flow??DEFAULT_EFFECT.flow,0,1.8));gl.uniform1f(uniforms.refraction,clamp(effect?.refraction??DEFAULT_EFFECT.refraction,0,1));gl.uniform1f(uniforms.velocityAmount,clamp(effect?.motion??DEFAULT_EFFECT.motion,0,1.6));gl.uniform1f(uniforms.drift,clamp(effect?.drift??DEFAULT_EFFECT.drift,0,2));gl.drawArrays(gl.TRIANGLE_STRIP,0,4);if(!hasRenderedFrame){hasRenderedFrame=true;setWebglReady(true);}if(isNearViewport&&!cancelled){frame=requestAnimationFrame(render);}else{frame=0;renderLoopRunning=false;}}textureImage=new Image;textureImage.crossOrigin=\"anonymous\";textureImage.onload=()=>{if(cancelled||!texture||!textureImage)return;try{gl.bindTexture(gl.TEXTURE_2D,texture);gl.texImage2D(gl.TEXTURE_2D,0,gl.RGBA,gl.RGBA,gl.UNSIGNED_BYTE,textureImage);if(textureImage.naturalWidth>0&&textureImage.naturalHeight>0){setNaturalSize({width:textureImage.naturalWidth,height:textureImage.naturalHeight});}textureReady=true;resizeCanvas();startRenderLoop();scheduleViewportSync();}catch(error){console.error(\"MagicDistortion texture upload failed:\",error);setWebglFailed(true);}};textureImage.onerror=()=>{setWebglFailed(true);};textureImage.src=image.src;// Pause the animation loop when the component is comfortably outside the\n// viewport. A preload margin starts WebGL ~250px before it becomes visible.\n// Framer Live Preview can report an unreliable first IntersectionObserver state\n// while its iframe/layout is still settling, so we also keep a geometric fallback.\nconst viewportMargin=250;function isGeometricallyNearViewport(){const rect=container.getBoundingClientRect();const viewportWidth=Math.max(document.documentElement?.clientWidth||0,window.innerWidth||0);const viewportHeight=Math.max(document.documentElement?.clientHeight||0,window.innerHeight||0);// A zero-sized rect during Framer's initial layout pass is inconclusive.\n// Keep the optimistic state and check again on the next frame.\nif(rect.width<=0||rect.height<=0)return null;return rect.bottom>=-viewportMargin&&rect.top<=viewportHeight+viewportMargin&&rect.right>=-viewportMargin&&rect.left<=viewportWidth+viewportMargin;}function applyViewportState(nextState){if(nextState===isNearViewport){if(nextState)startRenderLoop();return;}isNearViewport=nextState;if(isNearViewport){resizeCanvas();startRenderLoop();}else{// Offscreen interaction state is no longer meaningful. Reset it\n// without destroying the WebGL context or reloading the texture.\nstopRenderLoop(true);}}function syncViewportFromGeometry(){if(cancelled)return;const geometricState=isGeometricallyNearViewport();if(geometricState!==null)applyViewportState(geometricState);}function scheduleViewportSync(){if(viewportCheckFrame)cancelAnimationFrame(viewportCheckFrame);viewportCheckFrame=requestAnimationFrame(()=>{viewportCheckFrame=requestAnimationFrame(()=>{viewportCheckFrame=0;syncViewportFromGeometry();});});}if(typeof IntersectionObserver!==\"undefined\"){intersectionObserver=new IntersectionObserver(entries=>{const entry=entries[0];const geometricState=isGeometricallyNearViewport();// Prefer a positive IO result, but let current geometry override a\n// false initial callback in Framer Live Preview.\nconst nextIsNearViewport=Boolean(entry?.isIntersecting)||geometricState===true;applyViewportState(nextIsNearViewport);// Framer may still be finishing the preview iframe layout here.\n// Re-check on two RAFs so an initially false state self-corrects\n// without requiring the user to scroll out and back in.\nscheduleViewportSync();},{root:null,rootMargin:`${viewportMargin}px 0px ${viewportMargin}px 0px`,threshold:0});intersectionObserver.observe(container);}resizeObserver=new ResizeObserver(()=>{resizeCanvas();scheduleViewportSync();if(isNearViewport)startRenderLoop();});resizeObserver.observe(container);// Start optimistically, then verify after Framer has completed a couple of\n// layout frames. Truly offscreen instances will be paused immediately after.\nstartRenderLoop();scheduleViewportSync();return()=>{cancelled=true;stopRenderLoop();if(viewportCheckFrame)cancelAnimationFrame(viewportCheckFrame);resizeObserver?.disconnect();intersectionObserver?.disconnect();if(texture)gl.deleteTexture(texture);if(buffer)gl.deleteBuffer(buffer);if(program)gl.deleteProgram(program);};},[image?.src,sizing,safeRatio,fit,padding,effect?.strength,effect?.radius,effect?.trail,effect?.ripple,effect?.flow,effect?.refraction,effect?.motion,effect?.response,effect?.fadeOut,effect?.drift,shouldRenderWebGL]);function getPointerPosition(event){const canvas=canvasRef.current;if(!canvas)return null;const rect=canvas.getBoundingClientRect();if(rect.width<=0||rect.height<=0)return null;return[clamp((event.clientX-rect.left)/rect.width,0,1),clamp(1-(event.clientY-rect.top)/rect.height,0,1)];}function updatePointer(event){const point=getPointerPosition(event);if(!point)return;pointerTarget.current=point;lastPointerMoveTime.current=performance.now();}function beginPointer(event){const point=getPointerPosition(event);if(!point)return;// Snap only the hidden tracking state on entry. This prevents the old\n// center-to-entry delta from being interpreted as a huge cursor velocity.\npointerTarget.current=point;pointerCurrent.current=point;pointerVelocity.current=[0,0];directionInitialized.current=false;motionCurrent.current=0;pointerActivityCurrent.current=0;activityFadeStartTime.current=0;activityFadeStartValue.current=0;lastPointerMoveTime.current=performance.now();hoverTarget.current=1;}const spacer=/*#__PURE__*/_jsx(\"div\",{\"aria-hidden\":\"true\",style:{width:\"100%\",aspectRatio:String(sizing===\"fitImage\"?naturalRatio||safeRatio:safeRatio),visibility:\"hidden\",pointerEvents:\"none\"}});const showFallback=!shouldRenderWebGL||!webglReady||webglFailed;return /*#__PURE__*/_jsxs(\"div\",{ref:containerRef,style:{...style,width:\"100%\",height:\"auto\",position:\"relative\",overflow:\"visible\",background:\"transparent\",touchAction:\"pan-y\"},onPointerEnter:beginPointer,onPointerMove:updatePointer,onPointerLeave:()=>{// Do not zero velocity abruptly: the render loop eases both motion and\n// hover to rest, which keeps the deformation continuous on exit.\nhoverTarget.current=0;lastPointerMoveTime.current=0;},children:[spacer,image?.src&&/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",inset:0,pointerEvents:\"none\",opacity:showFallback?1:0},children:/*#__PURE__*/_jsx(\"img\",{src:image.src,srcSet:isStaticRenderer?undefined:image.srcSet,alt:altText||image.alt||\"\",draggable:false,style:{width:\"100%\",height:\"100%\",display:\"block\",objectFit:sizing===\"fitImage\"?\"contain\":fit,objectPosition:\"center\"}})}),shouldRenderWebGL&&/*#__PURE__*/_jsx(\"div\",{\"aria-hidden\":\"true\",style:{position:\"absolute\",inset:fxInset,pointerEvents:\"none\",overflow:\"visible\"},children:/*#__PURE__*/_jsx(\"canvas\",{ref:canvasRef,style:{width:\"100%\",height:\"100%\",display:\"block\",pointerEvents:\"none\",background:\"transparent\"}})})]});}MagicDistortion.defaultProps={altText:\"\",sizing:\"ratio\",aspectRatio:5.8,fit:\"contain\",padding:\"28px\",tabletEffect:true,phoneEffect:true,effect:DEFAULT_EFFECT};addPropertyControls(MagicDistortion,{image:{type:ControlType.ResponsiveImage,title:\"Image\"},altText:{type:ControlType.String,title:\"Alt Text\",defaultValue:\"\",placeholder:\"Describe the image\",description:\"Accessibility text for screen readers. Leave empty for decorative images.\"},sizing:{type:ControlType.Enum,title:\"Height\",options:[\"ratio\",\"fitImage\"],optionTitles:[\"Aspect Ratio\",\"Fit Image\"],displaySegmentedControl:true,defaultValue:\"ratio\"},aspectRatio:{type:ControlType.Number,title:\"Ratio W/H\",min:.2,max:12,step:.01,defaultValue:5.8,displayStepper:true,hidden:props=>props.sizing===\"fitImage\"},fit:{type:ControlType.Enum,title:\"Image Fit\",options:[\"contain\",\"cover\"],optionTitles:[\"Contain\",\"Cover\"],displaySegmentedControl:true,defaultValue:\"contain\",hidden:props=>props.sizing===\"fitImage\"},padding:{type:ControlType.Padding,title:\"FX Padding\",defaultValue:\"28px\",description:\"Transparent safety area around the image so distortion can extend past its edges without clipping.\"},tabletEffect:{type:ControlType.Boolean,title:\"Tablet FX\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\",description:\"Enable WebGL distortion on Tablet viewports (810–1199px).\"},phoneEffect:{type:ControlType.Boolean,title:\"Phone FX\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\",description:\"Enable WebGL distortion on Phone viewports below 810px.\"},effect:{type:ControlType.Object,title:\"Effect\",icon:\"effect\",controls:{strength:{type:ControlType.Number,title:\"Strength\",min:0,max:90,step:1,unit:\"px\",defaultValue:DEFAULT_EFFECT.strength},radius:{type:ControlType.Number,title:\"Radius\",min:8,max:120,step:1,unit:\"%\",defaultValue:DEFAULT_EFFECT.radius},trail:{type:ControlType.Number,title:\"Trail\",min:0,max:1.5,step:.05,defaultValue:DEFAULT_EFFECT.trail},ripple:{type:ControlType.Number,title:\"Ripple\",min:0,max:1.5,step:.05,defaultValue:DEFAULT_EFFECT.ripple},flow:{type:ControlType.Number,title:\"Flow\",min:0,max:1.8,step:.05,defaultValue:DEFAULT_EFFECT.flow},refraction:{type:ControlType.Number,title:\"Refraction\",min:0,max:1,step:.05,defaultValue:DEFAULT_EFFECT.refraction},motion:{type:ControlType.Number,title:\"Motion\",min:0,max:1.6,step:.05,defaultValue:DEFAULT_EFFECT.motion},response:{type:ControlType.Number,title:\"Response\",min:1,max:30,step:1,defaultValue:DEFAULT_EFFECT.response},fadeOut:{type:ControlType.Number,title:\"Fade Out\",min:.15,max:4,step:.05,unit:\"s\",defaultValue:DEFAULT_EFFECT.fadeOut},drift:{type:ControlType.Number,title:\"Drift\",min:0,max:1.5,step:.05,defaultValue:DEFAULT_EFFECT.drift}}},credits:{type:ControlType.Link,title:\"Credits\",defaultValue:\"https://framer.link/CxdtHWB\",description:\"Made by [Bestlooker](https://framer.link/CxdtHWB)\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"MagicDistortion\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerIntrinsicWidth\":\"720\",\"framerSupportedLayoutHeight\":\"auto\",\"framerIntrinsicHeight\":\"160\",\"framerDisableUnlink\":\"\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./MagicDistortion.map"],"mappings":"4NAyHE,SAAS,EAAM,EAAM,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