!function(){"use strict";(0,window.ctFrontend.registerDynamicChunk)("blocksy_ext_woo_extra_advanced_reviews_voting",{mount:function(t,{event:e}){const o="active"===t.dataset.buttonState,n="up"===t.dataset.vote;t.dataset.buttonState="loading",fetch(`${ct_localizations.ajax_url}?action=ct_review_vote`,{method:"POST",body:JSON.stringify({comment_id:t.dataset.commentId,vote:t.dataset.vote}),headers:{Accept:"application/json","Content-Type":"application/json"}}).then(function(t){return t.json()}).then(function({votes:e,upvotes:a,total:c}){if(e){const e=t.closest(".ct-review-votes");e.querySelector(".ct-review-upvote-count").textContent=a,e.querySelector(".ct-review-vote-count").dataset.count=a,e.querySelector(".ct-review-total-count").textContent=c,t.dataset.buttonState=o?"":"active",o||(e.querySelector(`[data-vote=${n?"down":"up"}]`).dataset.buttonState="")}})}})}();