(()=>{var e={1669:e=>{"use strict";e.exports=jQuery}},a={},t=function t(n){var s=a[n];if(void 0!==s)return s.exports;var i=a[n]={exports:{}};return e[n](i,i.exports,t),i.exports}(1669);!function(e,a){"use strict";a("body").on("click",".edd-extension-manager__actions .edd-extension-manager__action",(function(e){e.preventDefault();let t=a(this),n=t.attr("data-action"),s=t.attr("data-plugin"),i=t.attr("data-type"),d="",o="",r="",l=t.hasClass("edd-button__toggle"),c=t.attr("data-product");if(!t.attr("disabled")){switch(n){case"activate":d="edd_activate_extension",o="edd-plugin__inactive",r="edd-plugin__active",l||t.text(EDDExtensionManager.activating);break;case"install":d="edd_install_extension",r="edd-plugin__active",t.text(EDDExtensionManager.installing);break;case"deactivate":d="edd_deactivate_extension",o="edd-plugin__active",r="edd-plugin__inactive",l||t.text(EDDExtensionManager.deactivating);break;default:return}t.attr("disabled",!0).addClass("edd-updating"),t.hasClass("button-primary")&&t.removeClass("button-primary").addClass("updating-message");var g={action:d,nonce:EDDExtensionManager.extension_manager_nonce,plugin:s,type:i,pass:t.attr("data-pass"),id:t.attr("data-id"),product:c};a.post(ajaxurl,g).done((function(e){if(EDDExtensionManager.debug&&console.log(e),a("#edd-admin-about").length){var n=t.closest(".actions");e.success?n.addClass("has-response").empty().append('<div class="status"><span class="status-label active">'+e.data.message+"</span></div>"):((s=e.data.message)||(s=EDDExtensionManager.plugin_install_failed),n.addClass("has-response").empty().append('<div class="status"><span class="status-label">'+s+"</span></div>"))}else{var s,d=t.closest(".edd-extension-manager__step");if(e.success)if(d.length){var l=d.next();l.length&&(d.fadeOut(),l.prepend('<div class="notice inline-notice notice-success"><p>'+e.data.message+"</p></div>"),l.fadeIn())}else t.attr("disabled",!1).removeClass("edd-updating"),t.closest(".edd-extension-manager__card").removeClass(o).addClass(r),e.data.button.length&&t.closest(".edd-extension-manager__control").empty().append(e.data.button);else(s=e.data.message)||(s="plugin"!==i?EDDExtensionManager.extension_install_failed:EDDExtensionManager.plugin_install_failed),d.length?(d.fadeOut(),d.after('<div class="notice inline-notice notice-warning"><p>'+s+"</p></div>")):t.closest(".edd-extension-manager__actions").empty().append('<div class="notice inline-notice notice-warning"><p>'+s+"</p></div>")}}))}}));let t,n=a("#edd-extension-manager__bar-search");function s(){clearTimeout(t),t=setTimeout(i,342)}function i(){let e=n.val().toLowerCase(),t=0;if(e.length)a(".edd-extension-manager__card").each((function(){let n=a(this).text().toLowerCase().includes(e),s=a(this).data("filter")&&a(this).data("filter").toLowerCase().includes(e);n||s?(t++,a(this).removeClass("edd-hidden")):a(this).addClass("edd-hidden")}));else{let e=a(".edd-extension-manager__card");e.removeClass("edd-hidden"),t=e.length}a(".edd-extension-manager__card:not(.edd-hidden)").hide().show(0),a(".edd-extension-manager__results").remove(),a("#edd-extension-manager__bar-search").after('<div role="status" class="edd-extension-manager__results screen-reader-text">'+t+" "+EDDExtensionManager.results+"</div>")}n&&(EDDExtensionManager.filter&&(n.val(EDDExtensionManager.filter),s()),n.on("keyup",(function(e){s()})),n.on("search",(function(e){s()})))}(document,t)})();