{"version":3,"file":"NextProjectButton.Bas8FZJM.mjs","names":["React.useState","p"],"sources":["https:/framerusercontent.com/modules/kNBNuaa4q1gFG1wlOq7u/IB9MhYxpIvIP22MdaQAw/NextProjectButton.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";export default function NextProjectButton(props){const[projects,setProjects]=React.useState([]);const[currentIdx,setCurrentIdx]=React.useState(-1);const prefix=\"/project/\";React.useEffect(()=>{let cancelled=false;async function load(){try{const sitemapURL=new URL(\"/sitemap.xml\",window.location.origin).toString();const xml=await fetch(sitemapURL).then(r=>r.text());const parser=new DOMParser;const doc=parser.parseFromString(xml,\"application/xml\");const urls=Array.from(doc.querySelectorAll(\"url loc\")).map(n=>{try{return new URL(n.textContent).pathname;}catch{return\"\";}}).filter(Boolean);const list=urls.filter(p=>p.startsWith(prefix)).sort((a,b)=>a.localeCompare(b,undefined,{numeric:true}));if(!cancelled){setProjects(list);setCurrentIdx(list.indexOf(window.location.pathname));}}catch(e){console.error(\"NextProjectButton error:\",e);}}load();return()=>{cancelled=true;};},[]);const nextIdx=currentIdx>=0&&currentIdx<projects.length-1?currentIdx+1:0;const nextPath=projects[nextIdx]||prefix;const slug=nextPath.replace(prefix,\"\").replace(/\\/$/,\"\");const nextTitle=decodeURIComponent(slug).replace(/-/g,\" \").replace(/\\b\\w/g,c=>c.toUpperCase());// przekazujemy wartości do propsów\nprops.nextTitle=nextTitle;props.nextPath=nextPath;// nic nie renderujemy – tylko data provider\nreturn /*#__PURE__*/_jsx(\"div\",{style:{display:\"none\"}});}// expose props w Framerze\naddPropertyControls(NextProjectButton,{nextTitle:{type:ControlType.String,title:\"Next Project Title\",defaultValue:\"\"},nextPath:{type:ControlType.Link,title:\"Next Project URL\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"NextProjectButton\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__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