{"version":3,"file":"TableOfContents.DA5i7gcO.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/OTFD74cLM0WRcnxbTkdJ/FDdcZf5xuYUud0j11yxk/TableOfContents.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";export default function TableOfContents(){const[headings,setHeadings]=useState([]);useEffect(()=>{const h2Elements=Array.from(document.querySelectorAll(\"h2\"));// Usuwamy dwa ostatnie elementy\n// (czyli 'Zobacz także...' i 'Zamów bezpłatną wycenę')\nconst filtered=h2Elements.slice(0,-2);const updatedHeadings=filtered.map((el,index)=>{if(!el.id){const slug=`section-${index}`;el.id=slug;}return{id:el.id,text:el.textContent||`Sekcja ${index+1}`};});setHeadings(updatedHeadings);},[]);const scrollToSection=id=>{const target=document.getElementById(id);if(target){target.scrollIntoView({behavior:\"smooth\"});}};// Styl typograficzny zgodny z resztą strony\nconst typographyStyle={fontFamily:\"Inter, sans-serif\",fontSize:\"18px\",fontWeight:400,color:\"#1a1a1a\"};// Styl dla nagłówka spisu treści\nconst headingStyle={...typographyStyle,fontWeight:600,marginBottom:\"0.5rem\"};// Styl dla elementów listy z zachowaniem koloru linkowego dla interaktywności\nconst listItemStyle={...typographyStyle,color:\"#2563eb\",cursor:\"pointer\"};return /*#__PURE__*/_jsxs(\"div\",{className:\"p-4 rounded-xl shadow-lg bg-white w-full max-w-md\",children:[/*#__PURE__*/_jsx(\"h3\",{style:headingStyle,className:\"mb-2\",children:\"Spis treści\"}),/*#__PURE__*/_jsx(\"ul\",{className:\"list-disc pl-5 space-y-1\",children:headings.map(({id,text})=>/*#__PURE__*/_jsx(\"li\",{style:listItemStyle,className:\"hover:underline\",onClick:()=>scrollToSection(id),children:text},id))})]});}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TableOfContents\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TableOfContents.map"],"mappings":"0KAA+F,SAAwB,GAAiB,CAAC,GAAK,CAAC,EAAS,EAAY,CAACA,EAAS,EAAE,EAAE,MAAc,CAAC,IAAM,EAAW,MAAM,KAAK,SAAS,iBAAiB,OAEjP,EAAS,EAAW,MAAM,EAAE,IAAU,EAAgB,EAAS,KAAK,EAAG,IAAQ,CAAC,GAAG,CAAC,EAAG,GAAG,CAAC,IAAM,EAAK,WAAW,IAAQ,EAAG,GAAG,CAAM,OAAM,CAAC,GAAG,EAAG,GAAG,KAAK,EAAG,aAAa,UAAU,EAAM,IAAI,AAAE,GAAE,EAAY,EAAkB,EAAC,EAAE,EAAE,IAAM,EAAgB,GAAI,CAAC,IAAM,EAAO,SAAS,eAAe,GAAO,GAAQ,EAAO,eAAe,CAAC,SAAS,SAAS,CAAI,EACjW,EAAgB,CAAC,WAAW,oBAAoB,SAAS,OAAO,WAAW,IAAI,MAAM,UAAU,CAC/F,EAAa,CAAC,GAAG,EAAgB,WAAW,IAAI,aAAa,SAAS,CACtE,EAAc,CAAC,GAAG,EAAgB,MAAM,UAAU,OAAO,UAAU,CAAC,OAAoB,EAAM,MAAM,CAAC,UAAU,oDAAoD,SAAS,CAAc,EAAK,KAAK,CAAC,MAAM,EAAa,UAAU,OAAO,SAAS,cAAc,EAAe,EAAK,KAAK,CAAC,UAAU,2BAA2B,SAAS,EAAS,KAAK,CAAC,KAAG,OAAK,GAAgB,EAAK,KAAK,CAAC,MAAM,EAAc,UAAU,kBAAkB,YAAY,EAAgB,GAAI,SAAS,EAAK,CAAC,IAAK,EAAE,CAAC,CAAG"}