function e(){const e=document.querySelector("#fcircle-random"),t=document.querySelectorAll(".fcircle-item-container");if(!e||0===t.length)return;const r=Array.from(t).map(e=>{const t=e.closest(".fcircle-item"),r=e.querySelector(".fcircle-item-author")?.textContent||"",n=e.querySelector(".fcircle-item-title")?.textContent||"",c=e.querySelector(".fcircle-item-date")?.textContent||"",i=e.querySelector(".fcircle-item-desc")?.textContent||"";return{author:r,title:n,date:c,logo:t?.querySelector(".fcircle-item-image img")?.src||"",link:e.href,description:i}}),n=e.querySelector(".fcircle-random-card"),c=e.querySelector(".fcircle-random-refresh");function i(){if(!e)return;const t=Math.floor(Math.random()*r.length);var c;c=r[t],n.innerHTML=`\n\t\t\t<span class="fcircle-random-author">${c.author}</span>\n\t\t\t<span class="fcircle-random-title-inner">${c.title}</span>\n\t\t\t${c.date?`<time class="fcircle-random-date">${c.date}</time>`:""}\n\t\t`,n.href=c.link,e.style.display="flex"}n.addEventListener("click",()=>{window.open(n.href,"_blank")}),c.addEventListener("click",()=>{c.classList.add("is-spinning"),i(),setTimeout(()=>{c.classList.remove("is-spinning")},300)}),i()}document.addEventListener("DOMContentLoaded",()=>{e()}),window.addEventListener("swup:success",()=>{e()});
