{"version":3,"file":"AnimatingLine.VJRb3aIR.mjs","names":["useRef","useMemo","r","g","b"],"sources":["https:/framerusercontent.com/modules/HFG0zsF2aOl4j6knI3JF/mKUB6mubmDsvs8Jm7iJ7/AnimatingLine.js"],"sourcesContent":["// Framer component: Animating line/border with relevant controls (orientation, thickness, color, dashes, animation).\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{motion,useInView}from\"framer-motion\";import{useMemo,useRef}from\"react\";/**\n * AnimatingLine\n *\n * Animated line / border with controls for orientation, thickness, color, dash, and animation.\n *\n * @framerIntrinsicWidth 400\n * @framerIntrinsicHeight 10\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight fixed\n */export default function AnimatingLine(props){const{orientation,thickness,lineColor,backgroundColor,dashLength,gapLength,animationSpeed,animationDirection,animate,roundedEnds,lineOpacity,curved,curveAmount,dashThickness,style}=props;const isHorizontal=orientation===\"horizontal\";const isStatic=useIsStaticRenderer();const containerRef=useRef(null);const isInView=useInView(containerRef,{once:false});const shouldAnimate=animate&&!isStatic&&isInView&&animationSpeed>0;const rgbaColor=useMemo(()=>{const baseColor=lineColor||\"#000000\";const opacity=Math.max(0,Math.min(1,lineOpacity));return hexToRgba(baseColor,opacity);},[lineColor,lineOpacity]);const gradientStyle=useMemo(()=>{const total=Math.max(1,dashLength+gapLength);const backgroundSize=isHorizontal?`${total}px 100%`:`100% ${total}px`;const angle=isHorizontal?\"90deg\":\"0deg\";const gradient=`repeating-linear-gradient(${angle}, ${rgbaColor} 0px, ${rgbaColor} ${dashLength}px, transparent ${dashLength}px, transparent ${total}px)`;return{backgroundImage:gradient,backgroundSize,backgroundRepeat:\"repeat\"};},[dashLength,gapLength,isHorizontal,rgbaColor]);const motionTransition=useMemo(()=>{if(!shouldAnimate)return undefined;const duration=Math.max(.1,animationSpeed);return{duration,ease:\"linear\",repeat:Infinity,repeatType:\"loop\"};},[shouldAnimate,animationSpeed]);const motionAnimate=useMemo(()=>{if(!shouldAnimate){return{backgroundPositionX:0,backgroundPositionY:0};}const distance=dashLength+gapLength||40;const sign=animationDirection===\"forward\"?1:-1;const offset=sign*distance;if(isHorizontal){return{backgroundPositionX:[0,offset],backgroundPositionY:0};}return{backgroundPositionX:0,backgroundPositionY:[0,offset]};},[shouldAnimate,dashLength,gapLength,animationDirection,isHorizontal]);const svgPath=useMemo(()=>{const clampedCurve=Math.max(-100,Math.min(100,curveAmount));if(isHorizontal){const controlY=50-clampedCurve;return`M 0 50 Q 50 ${controlY} 100 50`;}const controlX=50+clampedCurve;return`M 50 0 Q ${controlX} 50 50 100`;},[isHorizontal,curveAmount]);const svgAnimate=useMemo(()=>{if(!shouldAnimate){return{strokeDashoffset:0};}const distance=dashLength+gapLength||40;const sign=animationDirection===\"forward\"?1:-1;const offset=sign*distance;return{strokeDashoffset:[0,offset]};},[shouldAnimate,dashLength,gapLength,animationDirection]);const lineStyle=useMemo(()=>{const effectiveThickness=typeof dashThickness===\"number\"?dashThickness:thickness;const radius=roundedEnds?effectiveThickness/2:0;const base={position:\"absolute\",top:isHorizontal?\"50%\":0,left:isHorizontal?0:\"50%\",width:isHorizontal?\"100%\":effectiveThickness,height:isHorizontal?effectiveThickness:\"100%\",transform:isHorizontal?\"translateY(-50%)\":\"translateX(-50%)\",borderRadius:radius,overflow:\"hidden\"};return base;},[isHorizontal,thickness,roundedEnds,dashThickness]);const outerStyle=useMemo(()=>{return{...style||{},position:\"relative\",display:\"block\",width:\"100%\",height:\"100%\",minWidth:5,minHeight:5,backgroundColor,overflow:\"hidden\"};},[style,backgroundColor]);return /*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:outerStyle,\"aria-hidden\":\"true\",children:curved?/*#__PURE__*/_jsx(motion.svg,{viewBox:\"0 0 100 100\",preserveAspectRatio:\"none\",style:{position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\"},children:/*#__PURE__*/_jsx(motion.path,{d:svgPath,fill:\"none\",stroke:rgbaColor,strokeWidth:typeof dashThickness===\"number\"?dashThickness:thickness,strokeLinecap:roundedEnds?\"round\":\"butt\",style:{strokeDasharray:`${dashLength} ${gapLength}`},animate:svgAnimate,transition:motionTransition})}):/*#__PURE__*/_jsx(motion.div,{style:{width:\"100%\",height:\"100%\",...lineStyle,...gradientStyle},animate:motionAnimate,transition:motionTransition})});}function hexToRgba(hex,alpha){let sanitized=hex.trim();// If the color is not in hex format (e.g. \"rgba(...)\" or \"hsla(...)\")\n// return it as-is so Framer color values work correctly.\nif(!sanitized.startsWith(\"#\")){return sanitized;}if(sanitized.startsWith(\"#\")){sanitized=sanitized.slice(1);}if(sanitized.length===3){const r=sanitized[0];const g=sanitized[1];const b=sanitized[2];sanitized=`${r}${r}${g}${g}${b}${b}`;}if(sanitized.length!==6){return`rgba(0,0,0,${alpha})`;}const r=parseInt(sanitized.slice(0,2),16);const g=parseInt(sanitized.slice(2,4),16);const b=parseInt(sanitized.slice(4,6),16);if(Number.isNaN(r)||Number.isNaN(g)||Number.isNaN(b)){return`rgba(0,0,0,${alpha})`;}const clampedAlpha=Math.max(0,Math.min(1,alpha));return`rgba(${r},${g},${b},${clampedAlpha})`;}addPropertyControls(AnimatingLine,{orientation:{type:ControlType.Enum,title:\"Orientation\",options:[\"horizontal\",\"vertical\"],optionTitles:[\"Horizontal\",\"Vertical\"],defaultValue:\"horizontal\",displaySegmentedControl:true},thickness:{type:ControlType.Number,title:\"Thickness\",defaultValue:5,min:1,max:20,step:1,unit:\"px\"},lineColor:{type:ControlType.Color,title:\"Line Color\",defaultValue:\"#000000\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\"},dashLength:{type:ControlType.Number,title:\"Dash\",defaultValue:20,min:1,max:200,step:1,unit:\"px\"},dashThickness:{type:ControlType.Number,title:\"Dash Thick\",defaultValue:5,min:1,max:20,step:1,unit:\"px\"},gapLength:{type:ControlType.Number,title:\"Gap\",defaultValue:20,min:1,max:200,step:1,unit:\"px\"},animationSpeed:{type:ControlType.Number,title:\"Speed\",defaultValue:1.5,min:0,max:10,step:.1,unit:\"s\"},animationDirection:{type:ControlType.Enum,title:\"Direction\",options:[\"forward\",\"backward\"],optionTitles:[\"Forward\",\"Backward\"],defaultValue:\"forward\",displaySegmentedControl:true},animate:{type:ControlType.Boolean,title:\"Animate\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},roundedEnds:{type:ControlType.Boolean,title:\"Rounded\",defaultValue:false,enabledTitle:\"Yes\",disabledTitle:\"No\"},lineOpacity:{type:ControlType.Number,title:\"Opacity\",defaultValue:1,min:0,max:1,step:.05},curved:{type:ControlType.Boolean,title:\"Curved\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"},curveAmount:{type:ControlType.Number,title:\"Curve Amt\",defaultValue:0,min:-100,max:100,step:1,unit:\"%\",hidden:props=>!props.curved}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"AnimatingLine\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerIntrinsicWidth\":\"400\",\"framerIntrinsicHeight\":\"10\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./AnimatingLine.map"],"mappings":"kPAWG,SAAwB,EAAc,EAAM,CAAC,GAAK,CAAC,cAAY,YAAU,YAAU,kBAAgB,aAAW,YAAU,iBAAe,qBAAmB,UAAQ,cAAY,cAAY,SAAO,cAAY,gBAAc,SAAO,EAAY,EAAa,IAAc,aAAmB,EAAS,GAAqB,CAAO,EAAaA,EAAO,KAAK,CAAO,EAAS,EAAU,EAAa,CAAC,KAAK,GAAM,CAAC,CAAO,EAAc,GAAS,CAAC,GAAU,GAAU,EAAe,EAAQ,EAAUC,MAA2G,EAA9E,GAAW,UAAwB,KAAK,IAAI,EAAE,KAAK,IAAI,EAAE,EAAY,CA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