{"version":3,"file":"PostContentTree.DcHIbbS8.mjs","names":["useState","useRef","useCallback","startTransition","useEffect","_jsx","_jsxs","__esmMin","window","te","init_ssg_sandbox_shims","init_npm_react_18_3_1","_e","de","ne","p","c","init_jsx_runtime","ce","addPropertyControls","init_framer_ChujFWHC","ControlType","PostContentTree","props","titleLabel","showTitle","headingSelector","contentRootSelector","labelColor","itemTextColor","activeItemTextColor","hoverItemTextColor","dividerColor","labelFont","itemFont","itemSpacing","sectionPaddingTop","sectionPaddingBottom","borderOpacity","activeIndicatorOpacity","stickyTop","scrollOffset","smoothScroll","showDividers","maxWidth","mobileDisplay","debugMode","uppercaseItems","activeId","setActiveId","isMobile","setIsMobile","items","setItems","debugInfo","setDebugInfo","observerRef","sectionsRef","mutationObserverRef","componentRef","headingsFoundRef","assignedIdsRef","isClickScrollingRef","generateSlug","text","extractHeadings","headingElements","contentRoot","detectionMethod","current","candidates","el","candidate","foundHeadings","allHeadings","filteredHeadings","heading","extractedItems","id","item","index","debugMessage","initialTimeout","retryTimeouts","delay","timeout","checkMobile","handleClick","targetId","cleanId","targetElement","finalOffset","finalPosition","element","observerOptions","entries","topMostEntry","topMostPosition","entry","rect","distanceFromTop","prevId","enabledItems","isActive","e","containerStyle","init_PostContentTree"],"sources":["https:/framerusercontent.com/modules/N1JsBuu68t1CQi1cOwEx/asnpi3jI8olYCLFS6x0C/PostContentTree.js"],"sourcesContent":["// Post Content Tree - A sticky table-of-contents sidebar component for CMS blog posts\n// Dynamically extracts H4 headings from CMS rich text content field \"Conteúdo\"\n// Displays clickable section links that smoothly scroll to article sections\n// Tracks active section while scrolling and highlights the current item\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useEffect,useState,useCallback,useRef,startTransition}from\"react\";/**\n * Post Content Tree\n *\n * @framerIntrinsicWidth 280\n * @framerIntrinsicHeight 400\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function PostContentTree(props){const{titleLabel=\"Neste Artigo\",showTitle=true,headingSelector=\"h4\",contentRootSelector=\"\",labelColor=\"#000000\",itemTextColor=\"#666666\",activeItemTextColor=\"#000000\",hoverItemTextColor=\"#000000\",dividerColor=\"#EEEEEE\",labelFont,itemFont,itemSpacing=16,sectionPaddingTop=24,sectionPaddingBottom=24,borderOpacity=1,activeIndicatorOpacity=1,stickyTop=100,scrollOffset=100,smoothScroll=true,showDividers=true,maxWidth=280,mobileDisplay=\"collapsible\",debugMode=false,uppercaseItems=false}=props;const[activeId,setActiveId]=useState(null);const[isMobile,setIsMobile]=useState(false);const[items,setItems]=useState([]);const[debugInfo,setDebugInfo]=useState(\"\");const observerRef=useRef(null);const sectionsRef=useRef(new Map);const mutationObserverRef=useRef(null);const componentRef=useRef(null);const headingsFoundRef=useRef(false);const assignedIdsRef=useRef(new Set);const isClickScrollingRef=useRef(false);// Generate slug from text\nconst generateSlug=useCallback(text=>{return text.toLowerCase().normalize(\"NFD\").replace(/[\\u0300-\\u036f]/g,\"\")// Remove accents\n.replace(/[^\\w\\s-]/g,\"\")// Remove special characters\n.replace(/\\s+/g,\"-\")// Replace spaces with hyphens\n.replace(/-+/g,\"-\")// Replace multiple hyphens with single\n.trim();},[]);// Extract H4 headings from CMS rich text content\nconst extractHeadings=useCallback(()=>{if(typeof window===\"undefined\")return;// Stop scanning if we've already found headings successfully\nif(headingsFoundRef.current&&items.length>0)return;let headingElements=null;let contentRoot=null;let detectionMethod=\"\";// Strategy 1: Use provided contentRootSelector\nif(contentRootSelector&&contentRootSelector.trim()!==\"\"){try{contentRoot=document.querySelector(contentRootSelector);if(contentRoot){headingElements=contentRoot.querySelectorAll(headingSelector);detectionMethod=`Custom selector: ${contentRootSelector}`;}}catch(e){// Invalid selector, continue to fallback\n}}// Strategy 2: Automatic detection - find nearest article content container\nif(!headingElements||headingElements.length===0){// Try to find the component's position in the DOM\nif(componentRef.current){// Look for sibling or nearby content containers\nlet current=componentRef.current.parentElement;// Walk up the DOM tree to find a common container\nwhile(current&&!contentRoot){// Look for article content containers within this level\nconst candidates=[current.querySelector(\"article\"),current.querySelector(\"main\"),current.querySelector(\"[role='main']\"),current.querySelector(\".post-content\"),current.querySelector(\".article-content\"),current.querySelector(\".content\"),// Look for rich text containers (Framer CMS often uses these)\n...Array.from(current.querySelectorAll(\"[data-framer-component-type]\")).filter(el=>{// Filter for elements that look like rich text content\nconst text=el.textContent||\"\";return text.length>200// Likely article content if substantial text\n;})];for(const candidate of candidates){if(candidate&&candidate!==componentRef.current&&!componentRef.current.contains(candidate)){const foundHeadings=candidate.querySelectorAll(headingSelector);if(foundHeadings.length>0){contentRoot=candidate;headingElements=foundHeadings;detectionMethod=`Auto-detected: ${candidate.tagName}${candidate.className?\".\"+candidate.className.split(\" \")[0]:\"\"}`;break;}}}if(!contentRoot){current=current.parentElement;}}}}// Strategy 3: Fallback - search entire document but exclude sidebar\nif(!headingElements||headingElements.length===0){const allHeadings=document.querySelectorAll(headingSelector);const filteredHeadings=[];allHeadings.forEach(heading=>{// Exclude headings inside this component\nif(componentRef.current&&!componentRef.current.contains(heading)){filteredHeadings.push(heading);}});if(filteredHeadings.length>0){headingElements=filteredHeadings;detectionMethod=`Fallback: all ${headingSelector} elements on page`;}}const extractedItems=[];if(headingElements&&headingElements.length>0){headingElements.forEach(heading=>{const text=heading.textContent?.trim()||\"\";if(!text)return;// Use existing id or generate one\nlet id=heading.id;if(!id){id=generateSlug(text);// Only assign id if we haven't already done so\nif(!assignedIdsRef.current.has(id)){heading.id=id;assignedIdsRef.current.add(id);}}else{assignedIdsRef.current.add(id);}extractedItems.push({label:text,targetId:id});});}// Only update state if items have changed\nif(extractedItems.length>0){const itemsChanged=extractedItems.length!==items.length||extractedItems.some((item,index)=>!items[index]||item.label!==items[index].label||item.targetId!==items[index].targetId);if(itemsChanged){startTransition(()=>setItems(extractedItems));headingsFoundRef.current=true;// Disconnect MutationObserver once we've found headings\nif(mutationObserverRef.current){mutationObserverRef.current.disconnect();mutationObserverRef.current=null;}}}if(debugMode){const debugMessage=`Detection: ${detectionMethod||\"none\"}\nFound: ${extractedItems.length} ${headingSelector} elements\nHeadings: ${extractedItems.map(item=>item.label).join(\", \")||\"none\"}`;startTransition(()=>setDebugInfo(debugMessage));}},[headingSelector,contentRootSelector,generateSlug,debugMode,items]);// Extract headings on mount with retry logic for async CMS content\nuseEffect(()=>{if(typeof window===\"undefined\")return;// Initial extraction after a brief delay\nconst initialTimeout=setTimeout(()=>{extractHeadings();},100);// Retry a few times to catch async-loaded content\nconst retryTimeouts=[];const retryDelays=[500,1e3,2e3];retryDelays.forEach(delay=>{const timeout=window.setTimeout(()=>{// Only retry if we haven't found headings yet\nif(!headingsFoundRef.current){extractHeadings();}},delay);retryTimeouts.push(timeout);});// Set up MutationObserver to watch for content changes\n// Only if we haven't found headings yet\nif(!headingsFoundRef.current){mutationObserverRef.current=new MutationObserver(()=>{if(!headingsFoundRef.current){extractHeadings();}});mutationObserverRef.current.observe(document.body,{childList:true,subtree:true});}return()=>{clearTimeout(initialTimeout);retryTimeouts.forEach(timeout=>clearTimeout(timeout));if(mutationObserverRef.current){mutationObserverRef.current.disconnect();}};},[extractHeadings]);// Detect mobile viewport\nuseEffect(()=>{if(typeof window===\"undefined\")return;const checkMobile=()=>{startTransition(()=>setIsMobile(window.innerWidth<768));};checkMobile();window.addEventListener(\"resize\",checkMobile);return()=>window.removeEventListener(\"resize\",checkMobile);},[]);// Handle smooth scroll to section\nconst handleClick=useCallback(targetId=>{if(typeof window===\"undefined\")return;// Normalize targetId (remove leading # if present)\nconst cleanId=targetId.startsWith(\"#\")?targetId.slice(1):targetId;const targetElement=document.getElementById(cleanId);if(!targetElement)return;// Set flag to prevent IntersectionObserver from interfering\nisClickScrollingRef.current=true;// Update active state immediately\nstartTransition(()=>setActiveId(cleanId));// Manual scroll calculation to account for fixed header\n// Apply additional 50px correction to ensure content is fully visible\nconst finalOffset=scrollOffset+50;const elementTop=targetElement.getBoundingClientRect().top+window.scrollY;const finalPosition=elementTop-finalOffset;if(smoothScroll){window.scrollTo({top:finalPosition,behavior:\"smooth\"});}else{window.scrollTo({top:finalPosition,behavior:\"auto\"});}// Re-enable IntersectionObserver after scroll completes\n// Use longer timeout for smooth scroll to ensure it's finished\nsetTimeout(()=>{isClickScrollingRef.current=false;},smoothScroll?1e3:100);},[scrollOffset,smoothScroll]);// Set up IntersectionObserver to track active section\nuseEffect(()=>{if(typeof window===\"undefined\")return;if(items.length===0)return;// Clean up previous observer\nif(observerRef.current){observerRef.current.disconnect();}// Clear sections map\nsectionsRef.current.clear();// Find all target sections\nitems.forEach(item=>{const cleanId=item.targetId.startsWith(\"#\")?item.targetId.slice(1):item.targetId;const element=document.getElementById(cleanId);if(element){sectionsRef.current.set(cleanId,element);}});if(sectionsRef.current.size===0)return;// Create intersection observer with passive observation\nconst observerOptions={rootMargin:`-${scrollOffset}px 0px -50% 0px`,threshold:[0,.25,.5,.75,1]};observerRef.current=new IntersectionObserver(entries=>{// Skip updates if user just clicked a link\nif(isClickScrollingRef.current)return;// Use requestAnimationFrame to avoid layout thrashing\nrequestAnimationFrame(()=>{// Find the most visible section near the top\nlet topMostEntry=null;let topMostPosition=Number.POSITIVE_INFINITY;entries.forEach(entry=>{if(entry.isIntersecting){const rect=entry.boundingClientRect;const distanceFromTop=Math.abs(rect.top-scrollOffset);if(distanceFromTop<topMostPosition){topMostPosition=distanceFromTop;topMostEntry=entry;}}});if(topMostEntry){const id=topMostEntry.target.id;// Only update if changed\nsetActiveId(prevId=>prevId===id?prevId:id);}});},observerOptions);// Observe all sections\nsectionsRef.current.forEach(element=>{observerRef.current?.observe(element);});return()=>{if(observerRef.current){observerRef.current.disconnect();}};},[items,scrollOffset]);// Filter enabled items\nconst enabledItems=items;// If no items found, show minimal empty state or debug info\nif(enabledItems.length===0){if(debugMode){return /*#__PURE__*/_jsx(\"div\",{ref:componentRef,style:{width:\"100%\",maxWidth:`${maxWidth}px`,minHeight:\"100px\",backgroundColor:\"#FFF9E6\",border:\"1px solid #FFD700\",borderRadius:\"4px\",position:\"relative\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",padding:\"24px\"},children:/*#__PURE__*/_jsx(\"span\",{style:{...itemFont,color:\"#000\",fontSize:\"12px\",whiteSpace:\"pre-wrap\",textAlign:\"left\"},children:debugInfo||\"Searching for h3 elements...\"})});}// Neutral empty state - just render nothing visible\nreturn /*#__PURE__*/_jsx(\"div\",{ref:componentRef,style:{width:\"100%\",maxWidth:`${maxWidth}px`,minHeight:\"1px\",backgroundColor:\"transparent\",position:\"relative\"}});}// Handle mobile display\nif(isMobile){if(mobileDisplay===\"hidden\"){return null;}// Mobile: always show full list, no collapsible behavior\nreturn /*#__PURE__*/_jsxs(\"nav\",{ref:componentRef,style:{width:\"100%\",backgroundColor:\"transparent\",position:\"relative\",paddingLeft:\"16px\",paddingRight:\"16px\"},\"aria-label\":\"Table of contents\",children:[debugMode&&debugInfo&&/*#__PURE__*/_jsx(\"div\",{style:{backgroundColor:\"#FFF9E6\",border:\"1px solid #FFD700\",borderRadius:\"4px\",padding:\"8px\",marginBottom:\"16px\",fontSize:\"11px\",whiteSpace:\"pre-wrap\",color:\"#000\"},children:debugInfo}),showTitle&&/*#__PURE__*/_jsx(\"div\",{style:{...labelFont,color:labelColor,paddingTop:`${Math.max(16,sectionPaddingTop)}px`,paddingBottom:`${Math.max(12,sectionPaddingBottom)}px`},children:titleLabel}),/*#__PURE__*/_jsx(\"div\",{style:{paddingBottom:`${Math.max(16,sectionPaddingBottom)}px`},children:enabledItems.map((item,index)=>{const cleanId=item.targetId.startsWith(\"#\")?item.targetId.slice(1):item.targetId;const isActive=activeId===cleanId;return /*#__PURE__*/_jsxs(\"div\",{children:[showDividers&&index>0&&/*#__PURE__*/_jsx(\"div\",{style:{height:\"1px\",backgroundColor:dividerColor,opacity:borderOpacity,marginTop:`${Math.max(12,itemSpacing)}px`,marginBottom:`${Math.max(12,itemSpacing)}px`}}),/*#__PURE__*/_jsx(\"a\",{href:`#${cleanId}`,onClick:e=>{e.preventDefault();handleClick(item.targetId);},style:{display:\"block\",textDecoration:\"none\",cursor:\"pointer\",padding:\"8px 0\",minHeight:\"44px\",alignItems:\"center\",...itemFont,color:isActive?activeItemTextColor:itemTextColor,opacity:isActive?activeIndicatorOpacity:1,transition:\"color 0.2s ease, opacity 0.2s ease\",textTransform:uppercaseItems?\"uppercase\":\"none\"},\"aria-current\":isActive?\"location\":undefined,children:item.label})]},index);})})]});}// Desktop display\nconst containerStyle={width:\"100%\",maxWidth:`${maxWidth}px`,backgroundColor:\"transparent\",position:\"sticky\",top:`${stickyTop}px`};return /*#__PURE__*/_jsxs(\"nav\",{ref:componentRef,style:containerStyle,\"aria-label\":\"Table of contents\",children:[debugMode&&debugInfo&&/*#__PURE__*/_jsx(\"div\",{style:{backgroundColor:\"#FFF9E6\",border:\"1px solid #FFD700\",borderRadius:\"4px\",padding:\"8px\",marginBottom:\"16px\",fontSize:\"11px\",whiteSpace:\"pre-wrap\",color:\"#000\"},children:debugInfo}),showTitle&&/*#__PURE__*/_jsx(\"div\",{style:{...labelFont,color:labelColor,paddingTop:`${sectionPaddingTop}px`,paddingBottom:`${sectionPaddingBottom}px`},children:titleLabel}),/*#__PURE__*/_jsx(\"div\",{children:enabledItems.map((item,index)=>{const cleanId=item.targetId.startsWith(\"#\")?item.targetId.slice(1):item.targetId;const isActive=activeId===cleanId;return /*#__PURE__*/_jsxs(\"div\",{children:[showDividers&&index>0&&/*#__PURE__*/_jsx(\"div\",{style:{height:\"1px\",backgroundColor:dividerColor,opacity:borderOpacity,marginBottom:`${itemSpacing}px`}}),/*#__PURE__*/_jsx(\"a\",{href:`#${cleanId}`,onClick:e=>{e.preventDefault();handleClick(item.targetId);},style:{display:\"block\",textDecoration:\"none\",cursor:\"pointer\",marginBottom:index<enabledItems.length-1?`${itemSpacing}px`:0,...itemFont,color:isActive?activeItemTextColor:itemTextColor,opacity:isActive?activeIndicatorOpacity:1,transition:\"color 0.2s ease, opacity 0.2s ease\",textTransform:uppercaseItems?\"uppercase\":\"none\"},\"aria-current\":isActive?\"location\":undefined,onMouseEnter:e=>{if(!isActive){e.currentTarget.style.color=hoverItemTextColor;e.currentTarget.style.opacity=\"0.7\";}},onMouseLeave:e=>{if(!isActive){e.currentTarget.style.color=itemTextColor;e.currentTarget.style.opacity=\"1\";}},children:item.label})]},index);})})]});}addPropertyControls(PostContentTree,{titleLabel:{type:ControlType.String,title:\"Title Label\",defaultValue:\"Neste Artigo\"},showTitle:{type:ControlType.Boolean,title:\"Show Title\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},headingSelector:{type:ControlType.String,title:\"Heading Selector\",defaultValue:\"h4\",description:\"HTML heading tag to extract (e.g., h4)\"},contentRootSelector:{type:ControlType.String,title:\"Content Root Selector\",defaultValue:\"\",description:\"Optional CSS selector for article container (leave empty for auto-detect)\"},debugMode:{type:ControlType.Boolean,title:\"Debug Mode\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"},labelColor:{type:ControlType.Color,title:\"Label Color\",defaultValue:\"#000000\"},itemTextColor:{type:ControlType.Color,title:\"Item Text Color\",defaultValue:\"#666666\"},activeItemTextColor:{type:ControlType.Color,title:\"Active Item Color\",defaultValue:\"#000000\"},hoverItemTextColor:{type:ControlType.Color,title:\"Hover Item Color\",defaultValue:\"#000000\"},dividerColor:{type:ControlType.Color,title:\"Divider Color\",defaultValue:\"#EEEEEE\"},labelFont:{type:ControlType.Font,title:\"Label Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"12px\",variant:\"Semibold\",letterSpacing:\"0.05em\",lineHeight:\"1.2em\"}},itemFont:{type:ControlType.Font,title:\"Item Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"14px\",variant:\"Regular\",letterSpacing:\"-0.01em\",lineHeight:\"1.4em\"}},itemSpacing:{type:ControlType.Number,title:\"Item Spacing\",defaultValue:16,min:0,max:48,step:1,unit:\"px\"},sectionPaddingTop:{type:ControlType.Number,title:\"Padding Top\",defaultValue:24,min:0,max:64,step:1,unit:\"px\"},sectionPaddingBottom:{type:ControlType.Number,title:\"Padding Bottom\",defaultValue:24,min:0,max:64,step:1,unit:\"px\"},borderOpacity:{type:ControlType.Number,title:\"Border Opacity\",defaultValue:1,min:0,max:1,step:.1},activeIndicatorOpacity:{type:ControlType.Number,title:\"Active Opacity\",defaultValue:1,min:0,max:1,step:.1},stickyTop:{type:ControlType.Number,title:\"Sticky Top\",defaultValue:100,min:0,max:500,step:10,unit:\"px\"},scrollOffset:{type:ControlType.Number,title:\"Scroll Offset\",defaultValue:100,min:0,max:500,step:10,unit:\"px\"},smoothScroll:{type:ControlType.Boolean,title:\"Smooth Scroll\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},showDividers:{type:ControlType.Boolean,title:\"Show Dividers\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},maxWidth:{type:ControlType.Number,title:\"Max Width\",defaultValue:280,min:200,max:500,step:10,unit:\"px\"},mobileDisplay:{type:ControlType.Enum,title:\"Mobile Display\",options:[\"hidden\",\"collapsible\",\"normal\"],optionTitles:[\"Hidden\",\"Collapsible\",\"Normal\"],defaultValue:\"collapsible\"},uppercaseItems:{type:ControlType.Boolean,title:\"Uppercase Items\",defaultValue:false,enabledTitle:\"Uppercase\",disabledTitle:\"Normal\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"PostContentTree\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"400\",\"framerIntrinsicWidth\":\"280\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./PostContentTree.map"],"mappings":"A,2NAYG,SAAwBsB,EAAgBC,EAAM,CAAC,GAAK,CAACC,aAAW,eAAeC,YAAU,G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