function wpzinc_modal_open(i,e){jQuery(".js-notices").text("");jQuery(".wpzinc-modal h2.title div.spinner").css("display","inline-block").css("visibility","visible");jQuery(".wpzinc-modal h2.title div.tick").css("display","none").css("visibility","hidden");wpzinc_modal_update_title(i);wpzinc_modal_update_message(e);jQuery(".wpzinc-modal div.notices").text("");jQuery(".wpzinc-modal button.close").hide();if(typeof e==="undefined"||!e.length){jQuery(".wpzinc-modal").addClass("wpzinc-modal-mini")}jQuery(".wpzinc-modal-overlay, .wpzinc-modal").show()}function wpzinc_modal_close(){jQuery(".wpzinc-modal-overlay, .wpzinc-modal").fadeOut("fast",function(){jQuery(".wpzinc-modal h2.title div.spinner").css("display","none").css("visibility","hidden");jQuery(".wpzinc-modal h2.title div.tick").css("display","none").css("visibility","hidden");wpzinc_modal_update_title("");wpzinc_modal_update_message("");jQuery(".wpzinc-modal div.notices").text("");jQuery(".wpzinc-modal button.close").hide();jQuery(".wpzinc-modal").removeClass("wpzinc-modal-mini");jQuery(".wpzinc-modal-overlay, .wpzinc-modal").hide()})}function wpzinc_modal_update_title(i){jQuery(".wpzinc-modal h2.title span.text").text(i)}function wpzinc_modal_update_message(i){jQuery(".wpzinc-modal").removeClass("wpzinc-modal-mini");jQuery(".wpzinc-modal p.message").text(i)}function wpzinc_modal_show_success_message(i){jQuery(".wpzinc-modal").removeClass("wpzinc-modal-mini");jQuery(".wpzinc-modal h2.title div.spinner").css("display","none").css("visibility","hidden");jQuery(".wpzinc-modal h2.title div.tick").css("display","inline-block").css("visibility","visible");jQuery(".wpzinc-modal p.message").text("");jQuery(".wpzinc-modal div.notices").html('<div class="updated notice"><p>'+i+"</p></div>");jQuery(".wpzinc-modal button.close").show()}function wpzinc_modal_show_error_message(i){jQuery(".wpzinc-modal").removeClass("wpzinc-modal-mini");jQuery(".wpzinc-modal h2.title div.spinner").css("display","none").css("visibility","hidden");jQuery(".wpzinc-modal h2.title div.tick").css("display","none").css("visibility","hidden");jQuery(".wpzinc-modal p.message").text("");jQuery(".wpzinc-modal div.notices").html('<div class="error notice"><p>'+i+"</p></div>");jQuery(".wpzinc-modal button.close").show()}function wpzinc_modal_show_success_message_and_exit(i){jQuery(".wpzinc-modal").removeClass("wpzinc-modal-mini");if(!jQuery(".js-notices").length){if(jQuery("hr.wp-header-end").length>0){jQuery("hr.wp-header-end").after('<div class="js-notices"></div>')}else if(jQuery(".wrap > h1:first").length>0){jQuery(".wrap > h1:first").after('<div class="js-notices"></div>')}}jQuery(".js-notices").html('<div class="updated notice is-dismissible wpzinc-is-dismissible"><p>'+i+'</p><button type="button" class="notice-dismiss"></button></div>');jQuery("html,body").animate({scrollTop:jQuery(".js-notices").offset().top-44});wpzinc_modal_close();return false}function wpzinc_modal_show_error_message_and_exit(i){jQuery(".wpzinc-modal").removeClass("wpzinc-modal-mini");jQuery(".js-notices").html('<div class="notice notice-error is-dismissible wpzinc-is-dismissible"><p>'+i+"</p></div>");jQuery("html,body").animate({scrollTop:jQuery(".js-notices").offset().top-44});wpzinc_modal_close();return false}function wpzinc_modal_show_success_and_exit(i,e){wpzinc_modal_update_title(i);if(typeof e==="undefined"||!e.length){jQuery(".wpzinc-modal").addClass("wpzinc-modal-mini")}else{jQuery(".wpzinc-modal").removeClass("wpzinc-modal-mini");wpzinc_modal_update_message(e)}jQuery(".wpzinc-modal h2.title div.spinner").css("display","none").css("visibility","hidden");jQuery(".wpzinc-modal h2.title div.tick").css("display","inline-block").css("visibility","visible");setTimeout(function(){wpzinc_modal_close()},750);return false}jQuery(document).ready(function(i){i("body").on("click",".wpzinc-modal button.close",function(i){wpzinc_modal_close()});i("body").on("click",".wpzinc-is-dismissible button.notice-dismiss",function(e){e.preventDefault();i(this).closest(".js-notices").remove()})});