!function(e){e(function(){var s=e("#zem_rp_ajax_nonce").val(),t=function(t,n,r){e.ajax({url:ajaxurl,data:{action:"zem_subscribe",subscription:n,_wpnonce:s,email:t||"0"},success:r,type:"POST"})};e("#zem_rp_subscribe_email").length&&(e("#zem_rp_subscribe_email").val().length?e("#zem_rp_subscribe_button").hide():e("#zem_rp_unsubscribe_button").hide()),e("#zem_rp_subscribe_button").on("click",function(s){var n=e("#zem_rp_subscribe_email").val();s.preventDefault(),n&&(e("#zem_rp_subscribe_button").attr("disabled",!0),t(n,"activityreport,newsletter",function(s){e("#zem_rp_subscribe_button").attr("disabled",!1),parseInt(s)&&(e("#zem_rp_subscribe_button").hide(),e("#zem_rp_unsubscribe_button").show(),alert("Subscription successful!"))}))}),e("#zem_rp_unsubscribe_button").on("click",function(s){s.preventDefault(),e("#zem_rp_unsubscribe_button").attr("disabled",!0),t(!1,"",function(s){e("#zem_rp_unsubscribe_button").attr("disabled",!1),parseInt(s)&&(e("#zem_rp_subscribe_email").val(""),e("#zem_rp_unsubscribe_button").hide(),e("#zem_rp_subscribe_button").show())})}),e("#zem_rp_wrap .collapsible .collapse-handle").on("click",function(t){var n=e(this).closest(".collapsible"),r=n.find(".container"),_=n.hasClass("collapsed"),i=n.attr("block");_?(r.slideDown(),e.post(ajaxurl,{action:"rp_show_hide_"+i,show:!0,_wpnonce:s})):(r.slideUp(),e.post(ajaxurl,{action:"rp_show_hide_"+i,hide:!0,_wpnonce:s})),n.toggleClass("collapsed"),t.preventDefault()})})}(jQuery);