!function(){"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}jQuery(document).ready(function(){function e(t,e){"INPUT"===t.prop("tagName")?t.val(e):t.text(e)}jQuery(".knit-pay-payment-button-submit-class").on("click",function(n){jQuery("#knit-pay-payment-button-error").remove(),n.preventDefault();var r=n.currentTarget;if(!r.attributes.disabled){r.setAttribute("disabled","");var i="#"+r.closest("form").id,o=jQuery(i+" #knit-pay-payment-button-submit");e(o,"Please wait...");var a,u,y,p=jQuery.Deferred(),c=window.open(knit_pay_payment_button_ajax_object.loading_icon,"knitpayPaymentWindow","width=400,height=720"),_=jQuery(i+" input[name='knit_pay_honeypot_field']").val(),l=_?jQuery(i+" input[name='"+_+"']").val():"";jQuery.post(knit_pay_payment_button_ajax_object.ajaxurl,(a={action:"knit_pay_payment_button_submit",knit_pay_nonce:jQuery(i+" #knit_pay_nonce").val(),amount:jQuery(i+" #knit_pay_payment_button_amount").val(),currency:jQuery(i+" #knit_pay_payment_button_currency").val(),payment_description:jQuery(i+" #knit_pay_payment_button_payment_description").val(),config_id:jQuery(i+" #knit_pay_payment_button_config_id").val(),knit_pay_honeypot_field:_},y=l,(u=function(e){var n=function(e){if("object"!=t(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=t(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==t(n)?n:n+""}(u=_))in a?Object.defineProperty(a,u,{value:y,enumerable:!0,configurable:!0,writable:!0}):a[u]=y,a),function(t){if(r.removeAttribute("disabled"),e(o,o.attr("knit-pay-button-text")),"success"==(t=JSON.parse(t)).status)return function(t,e){var n=window.open(t,"knitpayPaymentWindow","width=400,height=720"),r=setInterval(function(){n.closed&&(clearInterval(r),e.resolve())},1e3)}(t.redirect_url,p);p.reject({message:t.message}),c.close(),jQuery("<div id='knit-pay-payment-button-error' style='color: red;'>"+t.error_msg+"</div>").insertAfter(r)})}})})}();