{"version":3,"file":"AnimatedLine.DS48HCyA.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/qZTCereBLDok8DZFNksB/sX3Xc1k3U0eXxt6MjFGp/AnimatedLine.js"],"sourcesContent":["// Animated line that animates from left to right, only when in view, with full customization\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useRef,useEffect,useState,startTransition}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{useInView}from\"framer-motion\";/**\n * Animated Line\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight fixed\n */export default function AnimatedLine(props){const{color,thickness,duration,delay,borderRadius,style,width=300,height=4}=props;const ref=useRef(null);const isStatic=useIsStaticRenderer();const inView=useInView(ref,{once:true,margin:\"-10% 0px\"});const[animate,setAnimate]=useState(false);useEffect(()=>{if(isStatic){startTransition(()=>setAnimate(true));return;}if(inView){// Fix: clear previous timeout to avoid multiple triggers\nlet timeoutId;timeoutId=window.setTimeout(()=>{startTransition(()=>setAnimate(true));},delay*1e3);return()=>{if(timeoutId!==undefined)clearTimeout(timeoutId);};}},[inView,isStatic,delay]);return /*#__PURE__*/_jsx(\"div\",{ref:ref,style:{...style,width:\"100%\",height:thickness,display:\"flex\",alignItems:\"center\",justifyContent:\"flex-start\",position:\"relative\",overflow:\"hidden\",background:\"transparent\"},children:/*#__PURE__*/_jsx(\"div\",{style:{height:thickness,width:animate?\"100%\":0,background:color,borderRadius,transition:`width ${duration}s cubic-bezier(0.4,0,0.2,1)`}})});}addPropertyControls(AnimatedLine,{color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#000000\"},thickness:{type:ControlType.Number,title:\"Thickness\",defaultValue:4,min:1,max:32,unit:\"px\"},duration:{type:ControlType.Number,title:\"Duration\",defaultValue:1.2,min:.1,max:5,step:.05,unit:\"s\"},delay:{type:ControlType.Number,title:\"Delay\",defaultValue:0,min:0,max:5,step:.05,unit:\"s\"},borderRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:8,min:0,max:32,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"AnimatedLine\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./AnimatedLine.map"],"mappings":"sQAMG,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,QAAM,YAAU,WAAS,QAAM,eAAa,QAAM,QAAM,IAAI,SAAO,GAAG,EAAY,EAAIA,EAAO,IAAI,EAAQ,EAAS,EAAoB,EAAQ,EAAO,EAAU,EAAI,CAAC,KAAK,GAAK,OAAO,UAAU,CAAC,EAAO,CAAC,EAAQ,GAAYC,EAAS,EAAK,EACnG,OADqG,MAAc,CAAC,GAAG,EAAS,CAAC,MAAoB,EAAW,EAAI,CAAC,EAAE,MAAO,CAAC,GAAG,EAAO,CACrX,IAAI,EAA8F,MAApF,GAAU,EAAO,eAAe,CAAC,MAAoB,EAAW,EAAI,CAAC,CAAE,EAAE,EAAM,GAAG,MAAY,CAAI,IAAY,IAAA,IAAU,aAAa,CAAS,CAAE,CAAE,CAAC,EAAE,CAAC,EAAO,EAAS,CAAK,CAAC,EAAsB,EAAK,MAAM,CAAK,MAAI,MAAM,CAAC,GAAG,EAAM,MAAM,OAAO,OAAO,EAAU,QAAQ,OAAO,WAAW,SAAS,eAAe,aAAa,SAAS,WAAW,SAAS,SAAS,WAAW,aAAa,EAAE,SAAsB,EAAK,MAAM,CAAC,MAAM,CAAC,OAAO,EAAU,MAAM,EAAQ,OAAO,EAAE,WAAW,EAAM,eAAa,WAAW,SAAS,EAAS,4BAA4B,CAAC,CAAC,CAAC,CAAC,CAAE,qBANrhB,IAA6D,IAAwE,IAAqC,EAM4W,EAAoB,EAAa,CAAC,MAAM,CAAC,KAAK,EAAY,MAAM,MAAM,QAAQ,a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