{"version":3,"file":"ScrollProgressBar.D-RfdFYq.mjs","names":["useState","useState"],"sources":["https:/framerusercontent.com/modules/bGvTcLWeafoGhuryXU0y/OBNJZdJfdNaRqmaW32PI/Table_of_content.js","https:/framerusercontent.com/modules/Wap2EUbxUVnXCVzTH0Da/CoaNAq47qrqYsg46CWeW/ScrollProgressBar.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{motion}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";export default function BlogTableOfContents({bgColor,textColor,linkColor,hoverColor,autoDetect,includeH1,includeH2,includeH3,itemSpacing,itemPadding,fontSize,fontWeight,fontFamily,scrollDuration,scrollEasing,scrollOffset}){const[headings,setHeadings]=useState([]);const[activeId,setActiveId]=useState(null);const[hoveredId,setHoveredId]=useState(null);// Fixed values for removed properties\nconst containerSelector=\"[data-framer-name='Content']\";// Easing functions\nconst easingFunctions={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>t*(2-t),easeInOutQuad:t=>t<.5?2*t*t:-1+(4-2*t)*t,easeInCubic:t=>t*t*t,easeOutCubic:t=>1+--t*t*t,easeInOutCubic:t=>t<.5?4*t*t*t:1+--t*(2*--t*t+2)*t};// Smooth scroll with easing\nconst smoothScrollTo=(element,duration=600,easing=\"easeInOutCubic\",offset=0)=>{const targetPosition=element.getBoundingClientRect().top+window.scrollY-offset;const startPosition=window.scrollY;const distance=targetPosition-startPosition;const ease=easingFunctions[easing]||easingFunctions.easeInOutCubic;let start=null;const animation=currentTime=>{if(start===null)start=currentTime;const elapsed=currentTime-start;const progress=Math.min(elapsed/duration,1);const easeProgress=ease(progress);window.scrollTo(0,startPosition+distance*easeProgress);if(progress<1){requestAnimationFrame(animation);}};requestAnimationFrame(animation);};// 🔍 Collect headings dynamically\nuseEffect(()=>{const levelsToInclude=[];if(includeH1)levelsToInclude.push(\"h1\");if(includeH2)levelsToInclude.push(\"h2\");if(includeH3)levelsToInclude.push(\"h3\");if(levelsToInclude.length===0){setHeadings([]);return;}// Try multiple selectors in order of specificity\nlet container=null;// First: Look for hardcoded toc-content class (user must add this to their content div)\nlet tocContent=document.querySelector(\".toc-content\");if(tocContent){container=tocContent;}// Fallback: Try Content with RichTextContainer inside\nif(!container){let contentEl=document.querySelector(\"[data-framer-name='Content']\");if(contentEl){const richText=contentEl.querySelector(\"[data-framer-component-type='RichTextContainer']\");container=richText||contentEl;}}// Fallback to main\nif(!container){container=document.querySelector(\"main\");}// Last fallback to entire document\nif(!container){container=document;}const headingElements=Array.from(container.querySelectorAll(levelsToInclude.join(\",\"))).map(el=>({id:el.id||el.textContent.replace(/\\s+/g,\"-\").toLowerCase(),text:el.textContent,level:el.tagName}));// Deduplicate headings by id\nconst uniqueHeadings=Array.from(new Map(headingElements.map(h=>[h.id,h])).values());// Ensure each heading has a unique ID\nuniqueHeadings.forEach(({id},i)=>{if(!document.getElementById(id)){const els=container.querySelectorAll(levelsToInclude.join(\",\"));if(els[i]){els[i].id=id;}}});setHeadings(uniqueHeadings);},[autoDetect,includeH1,includeH2,includeH3]);// 🧭 Track which section is active\nuseEffect(()=>{const handleScroll=()=>{let current=null;headings.forEach(heading=>{const el=document.getElementById(heading.id);if(el&&el.getBoundingClientRect().top<150)current=heading.id;});setActiveId(current);};window.addEventListener(\"scroll\",handleScroll);return()=>window.removeEventListener(\"scroll\",handleScroll);},[headings]);return /*#__PURE__*/_jsx(\"div\",{className:\"p-4 rounded-2xl w-64\",style:{background:bgColor,color:textColor},children:/*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",flexDirection:\"column\",gap:`${itemSpacing}px`},children:headings.map((h,i)=>{let levelClass=\"\";if(h.level===\"H1\"){levelClass=\"font-bold\";}else if(h.level===\"H2\"){levelClass=\"opacity-90\";}else if(h.level===\"H3\"){levelClass=\"opacity-75\";}return /*#__PURE__*/_jsx(motion.a,{href:`#${h.id}`,onClick:e=>{e.preventDefault();const element=document.getElementById(h.id);if(element){smoothScrollTo(element,scrollDuration,scrollEasing,scrollOffset);}},className:`block rounded-md transition-all ${activeId===h.id?\"font-semibold\":\"hover:opacity-100\"} ${levelClass}`,style:{color:activeId===h.id?textColor:hoveredId===h.id?hoverColor:linkColor,padding:itemPadding,fontSize:fontSize,fontWeight:fontWeight,fontFamily:fontFamily,textDecoration:\"none\"},onMouseEnter:()=>setHoveredId(h.id),onMouseLeave:()=>setHoveredId(null),children:h.text},i);})})});}// 🧩 Framer Property Controls (visible in the right sidebar)\naddPropertyControls(BlogTableOfContents,{autoDetect:{type:ControlType.Boolean,title:\"Auto Detect Headings\",defaultValue:true},includeH1:{type:ControlType.Boolean,title:\"Include H1\",defaultValue:true},includeH2:{type:ControlType.Boolean,title:\"Include H2\",defaultValue:true},includeH3:{type:ControlType.Boolean,title:\"Include H3\",defaultValue:false},bgColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#0F4C81\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#FFFFFF\"},linkColor:{type:ControlType.Color,title:\"Link Color\",defaultValue:\"#3B82F6\"},hoverColor:{type:ControlType.Color,title:\"Hover Color\",defaultValue:\"#1E40AF\"},itemSpacing:{type:ControlType.Number,title:\"Item Spacing (px)\",defaultValue:0,min:0,max:32,step:1},itemPadding:{type:ControlType.String,title:\"Item Padding\",defaultValue:\"0px\",placeholder:\"e.g., 8px 12px or 4px\"},scrollDuration:{type:ControlType.Number,title:\"Scroll Duration (ms)\",defaultValue:600,min:100,max:2e3,step:100},scrollEasing:{type:ControlType.Enum,title:\"Scroll Easing\",options:[\"linear\",\"easeInQuad\",\"easeOutQuad\",\"easeInOutQuad\",\"easeInCubic\",\"easeOutCubic\",\"easeInOutCubic\"],optionTitles:[\"Linear\",\"Ease In (Quad)\",\"Ease Out (Quad)\",\"Ease In Out (Quad)\",\"Ease In (Cubic)\",\"Ease Out (Cubic)\",\"Ease In Out (Cubic)\"],defaultValue:\"easeInOutCubic\"},scrollOffset:{type:ControlType.Number,title:\"Scroll Offset (px)\",description:\"Space from top for fixed headers\",defaultValue:80,min:0,max:300,step:10},fontSize:{type:ControlType.Enum,title:\"Font Size\",options:[\"12px\",\"14px\",\"16px\",\"18px\",\"20px\"],optionTitles:[\"Small (12px)\",\"Regular (14px)\",\"Base (16px)\",\"Large (18px)\",\"XL (20px)\"],defaultValue:\"14px\"},fontWeight:{type:ControlType.Enum,title:\"Font Weight\",options:[\"300\",\"400\",\"500\",\"600\",\"700\"],optionTitles:[\"Light\",\"Regular\",\"Medium\",\"Semibold\",\"Bold\"],defaultValue:\"400\"},fontFamily:{type:ControlType.Enum,title:\"Font Family\",options:[\"Inter, sans-serif\",\"system-ui, sans-serif\",\"-apple-system, BlinkMacSystemFont, sans-serif\",\"Georgia, serif\",\"Courier New, monospace\",\"Helvetica, Arial, sans-serif\",\"Times New Roman, serif\",\"Trebuchet MS, sans-serif\",\"Lucida Console, monospace\",\"Palatino Linotype, serif\",\"Garamond, serif\",\"Verdana, sans-serif\"],optionTitles:[\"Inter\",\"System UI\",\"Apple System\",\"Georgia\",\"Courier\",\"Helvetica\",\"Times New Roman\",\"Trebuchet\",\"Lucida Console\",\"Palatino\",\"Garamond\",\"Verdana\"],defaultValue:\"Inter, sans-serif\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"BlogTableOfContents\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Table_of_content.map","// Scroll Progress Bar with customizable colors\n// Shows a progress bar that fills as you scroll the page. Colors are customizable.\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState,startTransition}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";/**\n * Scroll Progress Bar\n * Shows a progress bar that fills as you scroll the page. Colors are customizable.\n *\n * @framerIntrinsicWidth 600\n * @framerIntrinsicHeight 8\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight fixed\n */export default function ScrollProgressBar(props){const{backgroundColor,fillColor,style}=props;const[progress,setProgress]=useState(0);useEffect(()=>{if(typeof window===\"undefined\")return;function onScroll(){const scrollTop=window.scrollY||window.pageYOffset;const docHeight=document.documentElement.scrollHeight-window.innerHeight;const percent=docHeight>0?Math.min(1,Math.max(0,scrollTop/docHeight)):0;startTransition(()=>setProgress(percent));}window.addEventListener(\"scroll\",onScroll,{passive:true});onScroll();return()=>window.removeEventListener(\"scroll\",onScroll);},[]);if(RenderTarget.current()===RenderTarget.thumbnail)return null;return /*#__PURE__*/_jsx(\"div\",{style:{...style,width:\"100%\",height:props.height,background:backgroundColor,borderRadius:0,overflow:\"hidden\",position:\"relative\"},children:/*#__PURE__*/_jsx(\"div\",{style:{height:\"100%\",width:`${progress*100}%`,background:fillColor,borderRadius:0,transition:\"none\",position:\"absolute\",left:0,top:0},\"aria-valuenow\":Math.round(progress*100),\"aria-valuemin\":0,\"aria-valuemax\":100,role:\"progressbar\"})});}addPropertyControls(ScrollProgressBar,{height:{type:ControlType.Number,title:\"Height\",defaultValue:8,min:2,max:40,unit:\"px\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#EEEEEE\"},fillColor:{type:ControlType.Color,title:\"Fill\",defaultValue:\"#0099FF\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ScrollProgressBar\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"600\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"8\",\"framerSupportedLayoutHeight\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ScrollProgressBar.map"],"mappings":"+PAAuK,SAAwB,EAAoB,CAAC,UAAQ,YAAU,YAAU,aAAW,aAAW,YAAU,YAAU,YAAU,cAAY,cAAY,WAAS,aAAW,aAAW,iBAAe,eAAa,gBAAc,CAAC,GAA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