(()=>{var e={1669:e=>{"use strict";e.exports=jQuery},2262:(e,t,o)=>{var d=o(1669),r=o(1669);d((e=>{let t;e("#edd-generator-characters .edd-toggle").on("change",(function(){const t=e("#edd-generator-characters .edd-toggle input:checked"),o=e("#edd-generator-characters .edd-toggle input");1===t.length?t.each((function(){e(this).attr("readonly",!0),e(this).attr("disabled",!0)})):o.each((function(){e(this).attr("readonly",!1),e(this).attr("disabled",!1)}))})),e("#edd-generate-code").on("click",(function(){const o=e("#generator-letters").is(":checked"),d=e("#generator-numbers").is(":checked");o||d?(t&&(clearTimeout(t),e(this).removeClass("updated-message")),c(),e(this).prop("disabled",!0).addClass("updating-message"),e.ajax({url:ajaxurl,method:"POST",data:{action:"edd_admin_generate_discount_code","edd-discount-nonce":e('[name="edd-discount-nonce"]').val(),prefix:e("#generator-prefix").val(),limit:e("#generator-length").val(),letters:o,numbers:d},success:o=>{o.success?(e("#edd-code").val(o.data.code),e(this).addClass("updated-message"),t=setTimeout((()=>{e(this).removeClass("updated-message")}),1e3)):s(o.data.message)},error:e=>{var t;s(null!==(t=e.responseJSON)&&void 0!==t?t:e.responseText)},complete:()=>{e(this).prop("disabled",!1).removeClass("updating-message")}})):s(edd_vars.no_letters_or_numbers)})),e(".edd-popup-trigger.disabled").on("mouseover",(function(){e(this).parent().next(".edd-code-generator-popup").show()})),e(".edd-popup-trigger.disabled").on("mouseout",(function(){})),e(document).on("focus",":input",(function(){a(e(this))||n(e(".edd-code-generator-popup"))})).on("click touchstart",(function(t){const o=e(t.target).closest(".edd-popup-trigger").length?e(".edd-popup-trigger"):e(t.target);o.is(".edd-popup-trigger")?o.parent().next(".edd-code-generator-popup").toggle():a(o)||n(e(".edd-code-generator-popup"))})).on("keyup",(function(t){27===t.keyCode&&n(e(".edd-code-generator-popup"))}))}));const n=()=>{const e=r(".edd-code-generator-popup");e.hide(),c(e)},a=e=>!!e.closest(".edd-code-generator-popup").length,s=e=>{r("<div/>").addClass("notice notice-error").append(r("<p/>").text(e)).insertBefore("#edd-generate-code")},c=(e=!1)=>{e||(e=r(".edd-code-generator-popup:not(.hidden)")),e.find(".notice").remove(),e.css("margin-top",0)}}},t={};function o(d){var r=t[d];if(void 0!==r)return r.exports;var n=t[d]={exports:{}};return e[d](n,n.exports,o),n.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var d in t)o.o(t,d)&&!o.o(e,d)&&Object.defineProperty(e,d,{enumerable:!0,get:t[d]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";o(2262);var e=o(1669);!function(e,t){const o=t("#edd_products"),d=t("#edd_categories");(o||d)&&(o.on("change",(function(){t("#edd-discount-product-conditions").toggle(!!o.val().length)})),d.on("change",(function(){t("#edd-discount-category-conditions").toggle(!!d.val().length)})))}(document,e)})()})();