(()=>{var e={1669:e=>{"use strict";e.exports=jQuery}},a={},t=function t(s){var d=a[s];if(void 0!==d)return d.exports;var n=a[s]={exports:{}};return e[s](n,n.exports,t),n.exports}(1669);!function(e,a){"use strict";a(".edd-pass-handler__control").on("click",".edd-pass-handler__action",(function(e){e.preventDefault();var t=a(this),s=t.attr("data-action"),d="",n=t.text();if(!t.attr("disabled")){switch(s){case"verify":d="edd_verify_pass",t.text(EDDPassManager.verifying);break;case"activate":d="edd_activate_pass",t.text(EDDPassManager.activating);break;case"deactivate":d="edd_deactivate_pass",t.text(EDDPassManager.deactivating);break;default:return}a(".edd-pass-handler__control + .notice").remove(),a(".edd-pass-handler__control + p").remove(),t.removeClass("button-primary").attr("disabled",!0).addClass("updating-message"),"verify"===s&&(a("body").addClass("edd-pass-handler__verifying"),a(".edd-pass-handler__control").after('<div class="edd-pass-handler__verifying-wrap"><p class="edd-pass-handler__loading">'+EDDPassManager.verify_loader+"</p></div>"));var r={action:d,token:t.attr("data-token"),timestamp:t.attr("data-timestamp"),nonce:t.attr("data-nonce"),license:a("#edd_pass_key").val()};a.post(ajaxurl,r).done((function(e){if(e.success){if(a(".edd-pass-handler__actions").replaceWith(e.data.actions),e.data.message&&a(".edd-pass-handler__control").after(e.data.message),r.license.length&&"deactivate"===s)a("#edd_pass_key").attr("readonly",!1);else if("activate"===s||"verify"===s){if(a("#edd_pass_key").attr("readonly",!0),e.data.url&&e.data.url.length)return void setTimeout((function(){window.location.href=e.data.url}),1500);"activate"===s&&(a("#edd-admin-notice-inactivepro, .edd-pass-handler__description").slideUp(),a("#edd-flyout-button").removeClass("has-alert"),a(".edd-flyout-item-license").remove(),a(".edd-flyout-item-activate").remove())}}else t.text(n),a(".edd-pass-handler__control").after('<div class="notice inline-notice notice-warning edd-pass-handler__notice">'+e.data.message+"</div>"),"verify"===s&&(a("body").removeClass("edd-pass-handler__verifying"),a(".edd-pass-handler__verifying-wrap").remove());t.attr("disabled",!1).removeClass("updating-message")}))}})),a(".edd-pass-handler__control").on("click",".edd-pass-handler__delete",(function(e){e.preventDefault();var t=a(this),s={action:"edd_delete_pass",token:t.attr("data-token"),timestamp:t.attr("data-timestamp"),nonce:t.attr("data-nonce"),license:a("#edd_pass_key").val()};s.license&&(a(".edd-pass-handler__control + .notice").remove(),a(".edd-pass-handler__control + p").remove(),t.attr("disabled",!0).addClass("updating-message"),a("#edd_pass_key").val(""),a.post(ajaxurl,s).done((function(e){e.success?(a(".edd-pass-handler__control").after(e.data.message),t.hide()):a(".edd-pass-handler__control").after('<div class="notice inline-notice notice-warning">'+e.data.message+"</div>"),t.attr("disabled",!1).removeClass("updating-message")})))}))}(document,t)})();