window.toggleFavourite=function(t){window.jvbInteractions?window.jvbInteractions.toggleFavourite(t):console.warn("FrontendInteractions not initialized")},window.handleVote=function(t){window.jvbInteractions?window.jvbInteractions.handleVote(t):console.warn("FrontendInteractions not initialized")},window.isFavourited=function(t,n){return!!window.jvbInteractions&&window.jvbInteractions.isFavourited(t,n)},window.checkVoteStatus=function(t,n){return window.jvbInteractions?window.jvbInteractions.checkVoteStatus(t,n):""},window.formatVote=function(t,n){let o=window.getTemplate("voteButton");o.dataset.itemId=t.id,o.dataset.content=t.content;let e=o.querySelector("button.up"),i=o.querySelector("button.down");return"up"===n&&e.classList.add("voted"),"down"===n&&i.classList.add("voted"),t.upvotes>0&&(e.querySelector(".count").textContent=t.upvotes),t.downvotes>0&&(i.querySelector(".count").textContent="-"+t.downvotes),o},window.checkVoteStatus=function(t,n){if(!window.auth.getUser())return"";let o="";return window.userVotes&&window.userVotes[t]?.has(n)&&(o=window.userVotes[t].get(n)),o};