{"version":3,"file":"HandUnderline.CODe7IMF.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/V0AeceAna2d2KDM01Tfn/2Zax9w3y8y785H5AJvCy/HandUnderline.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{useInView}from\"framer-motion\";import{useEffect,useRef,useState}from\"react\";const PATH=\"M4 13 C 130 4, 280 4, 400 9 S 550 16, 596 7\";const LENGTH=100;/**\n * Hand-drawn underline that draws in when scrolled into view.\n *\n * The line is sized by the text it sits under, so it must not draw until the\n * webfont has loaded and the text has stopped reflowing — otherwise it draws\n * against the fallback-font measurement, then jumps when the real font lands.\n *\n * @framerIntrinsicWidth 600\n * @framerIntrinsicHeight 20\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function HandUnderline(props){const{color=\"#7B61D9\",thickness=5,duration=1,delay=.35,replay=false,style}=props;const isStatic=useIsStaticRenderer();const ref=useRef(null);const inView=useInView(ref,{once:!replay,amount:.6});// wait for fonts, then for the element's own width to stop changing\nconst[settled,setSettled]=useState(false);useEffect(()=>{if(isStatic||typeof window===\"undefined\"){setSettled(true);return;}let cancelled=false;let quietTimer=0;let ro=null;const markSettled=()=>{if(!cancelled)setSettled(true);};const waitForStableWidth=()=>{const el=ref.current;if(!el||typeof ResizeObserver===\"undefined\"){markSettled();return;}// settle once the width has held steady for 120ms\nconst bump=()=>{window.clearTimeout(quietTimer);quietTimer=window.setTimeout(markSettled,120);};ro=new ResizeObserver(bump);ro.observe(el);bump();};const fonts=document.fonts;if(fonts?.ready){fonts.ready.then(()=>{if(!cancelled)waitForStableWidth();});}else{waitForStableWidth();}// never hang: draw anyway after 2.5s\nconst failsafe=window.setTimeout(markSettled,2500);return()=>{cancelled=true;window.clearTimeout(quietTimer);window.clearTimeout(failsafe);ro?.disconnect();};},[isStatic]);const drawn=isStatic||inView&&settled;return /*#__PURE__*/_jsx(\"svg\",{ref:ref,viewBox:\"0 0 600 20\",preserveAspectRatio:\"none\",\"aria-hidden\":\"true\",style:{position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"visible\",display:\"block\",// hidden until the text has stopped moving, so it never flashes\n// in the wrong place\nopacity:isStatic||settled?1:0,...style},children:/*#__PURE__*/_jsx(\"path\",{d:PATH,pathLength:LENGTH,fill:\"none\",stroke:color,strokeWidth:thickness,strokeLinecap:\"round\",style:{strokeDasharray:`${LENGTH} ${LENGTH*2}`,strokeDashoffset:drawn?0:LENGTH,transition:isStatic?\"none\":`stroke-dashoffset ${duration}s cubic-bezier(.6,.1,.2,1) ${drawn?delay:0}s`}})});}addPropertyControls(HandUnderline,{color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#7B61D9\"},thickness:{type:ControlType.Number,title:\"Thickness\",defaultValue:5,min:1,max:12,step:.5,unit:\"px\"},duration:{type:ControlType.Number,title:\"Duration\",defaultValue:1,min:.2,max:3,step:.1,unit:\"s\"},delay:{type:ControlType.Number,title:\"Delay\",defaultValue:.35,min:0,max:3,step:.05,unit:\"s\"},replay:{type:ControlType.Boolean,title:\"Replay on scroll\",defaultValue:false}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"HandUnderline\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"600\",\"framerIntrinsicHeight\":\"20\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./HandUnderline.map"],"mappings":"gQAYG,SAAwB,EAAc,EAAM,CAAC,GAAK,CAAC,QAAM,UAAU,YAAU,EAAE,WAAS,EAAE,QAAM,IAAI,SAAO,GAAM,SAAO,EAAY,EAAS,EAAoB,EAAQ,EAAIA,EAAO,IAAI,EAAQ,EAAO,EAAU,EAAI,CAAC,KAA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