{"version":3,"file":"ScrollProgress.DWe75is3.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/uZxJO2DwADgm4P9hKI1m/FV1MR2bO6bTykTCs24sR/ScrollProgress.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{useScroll,useSpring}from\"framer-motion\";/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto\n * @framerIntrinsicWidth 1200\n * @framerIntrinsicHeight 3\n */export default function ScrollProgress({color,barHeight,zIndex,style}){const{scrollYProgress}=useScroll();const scaleX=useSpring(scrollYProgress,{stiffness:100,damping:30,restDelta:.001});const isCanvas=RenderTarget.hasRestrictions();const h=barHeight??3;const c=color??\"rgb(141,225,99)\";const z=zIndex??9999;const barRef=useRef(null);useEffect(()=>{if(isCanvas)return;// Remove any existing bar (hot-reload safety)\nconst existing=document.getElementById(\"sp-21ll\");if(existing)existing.remove();// Create fixed bar directly on body -- escapes all Framer transform wrappers\nconst bar=document.createElement(\"div\");bar.id=\"sp-21ll\";bar.style.cssText=[\"position:fixed\",\"top:0\",\"left:0\",\"right:0\",`height:${h}px`,`z-index:${z}`,\"pointer-events:none\",`background:${c}`,\"transform-origin:left center\",\"transform:scaleX(0)\",\"will-change:transform\"].join(\";\");document.body.appendChild(bar);barRef.current=bar;const unsub=scaleX.on(\"change\",v=>{if(barRef.current){barRef.current.style.transform=`scaleX(${v})`;}});return()=>{unsub();bar.remove();barRef.current=null;};},[h,c,z,isCanvas]);// Canvas preview: show static green bar\nif(isCanvas){return /*#__PURE__*/_jsx(\"div\",{style:{width:\"35%\",height:h,background:c,transformOrigin:\"0%\",borderRadius:0,...style}});}// Live/preview: render nothing -- bar lives on document.body\nreturn /*#__PURE__*/_jsx(\"div\",{style:{width:0,height:0,overflow:\"visible\",pointerEvents:\"none\"}});}ScrollProgress.defaultProps={color:\"rgb(141,225,99)\",barHeight:3,zIndex:9999};addPropertyControls(ScrollProgress,{color:{type:ControlType.Color,title:\"Color\",defaultValue:\"rgb(141,225,99)\"},barHeight:{type:ControlType.Number,title:\"Height\",min:1,max:10,step:1,unit:\"px\",defaultValue:3},zIndex:{type:ControlType.Number,title:\"Z-Index\",defaultValue:9999}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ScrollProgress\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"1200\",\"framerIntrinsicHeight\":\"3\",\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ScrollProgress.map"],"mappings":"gPAKG,SAAwB,EAAe,CAAC,QAAM,YAAU,SAAO,SAAO,CAAC,GAAK,CAAC,mBAAiB,GAAW,CAAO,EAAO,EAAU,EAAgB,CAAC,UAAU,IAAI,QAAQ,GAAG,UAAU,KAAK,CAAC,CAAO,EAAS,EAAa,iBAAiB,CAAO,EAAE,GAAW,EAAQ,EAAE,GAAO,kBAAwB,EAAE,GAAQ,KAAW,EAAOA,EAAO,KAAK,CAIjV,OAJkV,MAAc,CAAC,GAAG,EAAS,OAC7W,IAAM,EAAS,SAAS,eAAe,UAAU,CAAI,GAAS,EAAS,QAAQ,CAC/E,IAAM,EAAI,SAAS,cAAc,MAAM,CAAC,EAAI,GAAG,UAAU,EAAI,MAAM,QAAQ,CAAC,iBAAiB,QAAQ,SAAS,UAAU,UAAU,EAAE,IAAI,WAAW,IAAI,sBAAsB,cAAc,IAAI,+BAA+B,sBAAsB,wBAAwB,CAAC,KAAK,IAAI,CAAC,SAAS,KAAK,YAAY,EAAI,CAAC,EAAO,QAAQ,EAAI,IAAM,EAAM,EAAO,GAAG,SAAS,GAAG,CAAI,EAAO,UAAS,EAAO,QAAQ,MAAM,UAAU,UAAU,EAAE,KAAM,CAAC,UAAU,CAAC,GAAO,CAAC,EAAI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