!function(a,n){"use strict";let o=dokan_razorpay_checkout_data,t=a("#dokan_razorpay_form"),e=null;const d={init:function(){o.modal=d.modal,o.handler=d.handler,e=new Razorpay(o)},setDisable:function(n,o){void 0===typeof o&&(o=!0),!1===o?a(n).removeAttr("disabled"):a(n).attr("disabled",o)},modal:{ondismiss:function(){d.setDisable("#dokan-razorpay-btn",!1)}},handler:function(n){d.setDisable("#dokan-razorpay-btn-cancel"),a(".dokan-razorpay-success").removeClass("dokan-hide"),a(".dokan-razorpay-pay-buttons, .dokan-razorpay-thank-you").addClass("dokan-hide"),t.attr("action",`${t.attr("action")}&razorpay_payment_id=${n.razorpay_payment_id}&razorpay_signature=${n.razorpay_signature}`),t.submit()},openCheckout:function(){d.setDisable("#dokan-razorpay-btn"),e.open()},addEvent:function(a,n,o){return a.attachEvent?a.attachEvent("on"+n,o):a.addEventListener(n,o,!1)},handleCheckoutModal:function(){"complete"===n.readyState?(d.addEvent(a("#dokan-razorpay-btn")[0],"click",d.openCheckout),d.openCheckout()):n.addEventListener("DOMContentLoaded",(function(){d.addEvent(a("#dokan-razorpay-btn")[0],"click",d.openCheckout),d.openCheckout()}))}};d.init(),d.handleCheckoutModal()}(jQuery,window,document);