(()=>{var e={1669:e=>{"use strict";e.exports=jQuery}},t={},a=function a(n){var i=t[n];if(void 0!==i)return i.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,a),s.exports}(1669);!function(e,t){"use strict";t("p.submit").remove(),t(".edd-license__control").on("click",".edd-license__action",(function(e){e.preventDefault();var a=t(this),n=a.attr("data-action"),i="",s=a.text(),d=t(this).closest(".edd-license__control"),c=d.find('input[type="password"]'),r=d.find('input[name="apiurl"]');if(!a.attr("disabled")){switch(n){case"activate":i="edd_activate_extension_license",a.text(EDDLicenseHandler.activating);break;case"deactivate":i="edd_deactivate_extension_license",a.text(EDDLicenseHandler.deactivating);break;default:return}a.removeClass("button-primary").attr("disabled",!0).addClass("updating-message");var l={action:i,token:a.attr("data-token"),timestamp:a.attr("data-timestamp"),nonce:a.attr("data-nonce"),license:c.val(),item_id:c.attr("data-item"),item_name:c.attr("data-name"),key:c.attr("data-key"),api:r.val()};t.post(ajaxurl,l).done((function(e){console.log(e),a.text(s);let t=d.next(".edd-license-data");e.success?(e.data.actions&&d.find(".edd-licensing__actions").replaceWith(e.data.actions),e.data.message&&("deactivate"===n?t.find("p").replaceWith(e.data.message):t.replaceWith(e.data.message)),l.license.length&&"activate"===n?c.attr("readonly",!0):c.attr("readonly",!1)):t.find("p").replaceWith(e.data.message),a.attr("disabled",!1).removeClass("updating-message")}))}})),t(".edd-license__control").on("click",".edd-license__delete",(function(e){e.preventDefault();var a=t(this),n=t(this).closest(".edd-license__control"),i=n.find("input"),s={action:"edd_delete_extension_license",token:a.attr("data-token"),timestamp:a.attr("data-timestamp"),nonce:a.attr("data-nonce"),license:i.val(),item_name:i.attr("data-name")};a.attr("disabled",!0).addClass("updating-message"),i.val(""),t.post(ajaxurl,s).done((function(e){e.success&&a.hide(),n.next(".edd-license-data").find("p").replaceWith(e.data.message),a.attr("disabled",!1).removeClass("updating-message")}))}))}(document,a)})();