{"version":3,"file":"SmoothGradient.1hRGp81J.mjs","names":["useMemo","_jsx","__esmMin","pe","init_npm_react_18_3_1","c","init_jsx_runtime","addPropertyControls","init_framer_BWzg2IRg","ControlType","SmoothGradient","props","direction","startColor","opacity","gradientStyle","scrimCoordinates","r","g","b","color","hex","rgbMatch","ctx","computedColor","match","stops","stop","alpha","adjustedAlpha","init_SmoothGradient"],"sources":["https:/framerusercontent.com/modules/cQsnejtuAjcdIX3mkhq6/O5PH9EUBDvBhsKePlgCE/SmoothGradient.js"],"sourcesContent":["// Smooth gradient overlay component with customizable scrim effect\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useMemo}from\"react\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function SmoothGradient(props){const{direction,startColor,opacity}=props;const gradientStyle=useMemo(()=>{// Scrim coordinates for smooth easing\nconst scrimCoordinates=[{stop:0,alpha:1},{stop:19,alpha:.738},{stop:34,alpha:.541},{stop:47,alpha:.382},{stop:56.5,alpha:.278},{stop:65,alpha:.194},{stop:73,alpha:.126},{stop:80.2,alpha:.075},{stop:86.1,alpha:.042},{stop:91,alpha:.021},{stop:95.2,alpha:.008},{stop:98.2,alpha:.002},{stop:100,alpha:0}];// Parse color to extract RGB values\nconst parseColor=color=>{// Guard for server-side rendering\nif(typeof document===\"undefined\"){// Fallback color parsing for server-side rendering\nif(color.startsWith(\"#\")){const hex=color.slice(1);return{r:parseInt(hex.slice(0,2),16)||0,g:parseInt(hex.slice(2,4),16)||0,b:parseInt(hex.slice(4,6),16)||0};}const rgbMatch=color.match(/rgb\\((\\d+),\\s*(\\d+),\\s*(\\d+)\\)/);if(rgbMatch){return{r:parseInt(rgbMatch[1])||0,g:parseInt(rgbMatch[2])||0,b:parseInt(rgbMatch[3])||0};}// Default to black for unknown formats\nreturn{r:0,g:0,b:0};}const canvas=document.createElement(\"canvas\");const ctx=canvas.getContext(\"2d\");if(!ctx)return{r:0,g:0,b:0};ctx.fillStyle=color;const computedColor=ctx.fillStyle;if(computedColor.startsWith(\"#\")){const hex=computedColor.slice(1);return{r:parseInt(hex.slice(0,2),16),g:parseInt(hex.slice(2,4),16),b:parseInt(hex.slice(4,6),16)};}const match=computedColor.match(/rgb\\((\\d+),\\s*(\\d+),\\s*(\\d+)\\)/);if(match){return{r:parseInt(match[1]),g:parseInt(match[2]),b:parseInt(match[3])};}return{r:0,g:0,b:0};};const{r,g,b}=parseColor(startColor);// Generate gradient stops\nconst stops=scrimCoordinates.map(({stop,alpha})=>{const adjustedAlpha=alpha*opacity;return`rgba(${r}, ${g}, ${b}, ${adjustedAlpha}) ${stop}%`;}).join(\", \");return{background:`linear-gradient(${direction}, ${stops})`};},[direction,startColor,opacity]);return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",position:\"relative\",...gradientStyle,...props.style}});}addPropertyControls(SmoothGradient,{direction:{type:ControlType.Enum,title:\"Direction\",options:[\"to bottom\",\"to top\",\"to left\",\"to right\"],optionTitles:[\"Top to Bottom\",\"Bottom to Top\",\"Left to Right\",\"Right to Left\"],defaultValue:\"to bottom\",displaySegmentedControl:true},startColor:{type:ControlType.Color,title:\"Start Color\",defaultValue:\"#000000\"},opacity:{type:ControlType.Number,title:\"Opacity\",defaultValue:1,min:0,max:1,step:.1}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SmoothGradient\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SmoothGradient.map"],"mappings":"A,0KAIG,SAAwBU,EAAeC,EAAM,CAAC,GAAK,CAACC,YAAUC,aAAWC,WAASH,EAAYI,EAAcf,MAAY,CAC3H,IAAMgB,EAAiB,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,CAA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