jQuery(document).ready(function(n){"use strict";var e={message:null,overlayCSS:{background:"#fff",opacity:.7},ignoreIfBlocked:!0},a=n("#ywraq-reject-confirm"),c=(n("tr.quotes").on("click",function(t){0===n(t.target).closest(".quote-actions__more").length&&(window.location.href=n(this).data("url"))}),n(document).on("click",".ywraq-reject",function(t){t.preventDefault(),a.dialog({width:350,modal:!0,dialogClass:"ywraq-reject-confirm"})}),n(document).on("click","#reject-form button",function(t){t.preventDefault();var o=n(this),t=n("#reject-form");o.block(e),n.ajax({url:ywraq_frontend.ajaxurl.toString().replace("%%endpoint%%","yith_ywraq_action"),data:t.serialize(),type:"POST",success:function(t){t.result?(n.post(document.location.href,function(t){""!=t&&(t=n("<div></div>").html(t).find(".ywraq-view-quote-wrapper"),n(".ywraq-view-quote-wrapper").html(t.html()))}),a.dialog("close")):(t=n("<div></div>").html(t.message),n(".ywraq-reject-confirm-wrapper").html(t.html()).addClass("error"))},complete:function(){o.unblock()}})}),{init:function(){n(document).on("click",".quote-actions__more",c.open),n(document).on("click",".quote-actions-button__menu",c.stopPropagation),n(document).on("click",c.closeAll)},closeAll:function(){n(".quote-actions-button--opened").removeClass("quote-actions-button--opened")},open:function(t){var o=n(this).find(".quote-actions__action-button"),e=o.hasClass("quote-actions-button--opened");t.preventDefault(),t.stopPropagation(),c.closeAll(),e||o.addClass("quote-actions-button--opened")},stopPropagation:function(t){t.stopPropagation()}});c.init()});