(()=>{function r(o){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},r(o)}function o(r,o){for(var t=0;t<o.length;t++){var e=o[t];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(r,n(e.key),e)}}function n(o){var n=function(o,n){if("object"!=r(o)||!o)return o;var t=o[Symbol.toPrimitive];if(void 0!==t){var e=t.call(o,n||"default");if("object"!=r(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(o)}(o,"string");return"symbol"==r(n)?n:n+""}var t=function(){return r=function r(o,n){!function(r,o){if(!(r instanceof o))throw new TypeError("Cannot call a class as a function")}(this,r);var t=n.settings.id;this.$form=o,this.formInstance=n,this.formId=t,this.getGatewayMessage=function(r,o){var n="fluentform_gateway_messages_"+this.formId;return window[n]&&window[n][r]?window[n][r]:o}},(n=[{key:"init",value:function(){var r=this;this.$form.on("fluentform_next_action_razorpay",function(o,n){var t=n.response;r.$form.parent().find(".ff_razorpay_text").remove(),jQuery("<div/>",{id:"form_success",class:"ff-message-success ff_razorpay_text"}).html(t.data.message).insertAfter(r.$form),"initRazorPayModal"===t.data.actionName?r.initRazorPayModal(t.data):alert(r.getGatewayMessage("no_method_found","No method found"))})}},{key:"initRazorPayModal",value:function(r){var o=this,n=r.modal_data;n.handler=function(n){o.formInstance.hideFormSubmissionProgress(o.$form);var t={action:"fluentform_razorpay_confirm_payment",transaction_hash:r.transaction_hash,form_id:o.formId,razorpay_order_id:n.razorpay_order_id,razorpay_payment_id:n.razorpay_payment_id,razorpay_signature:n.razorpay_signature,_ff_payment_nonce:r._ff_payment_nonce||""};o.$form.parent().find(".ff_razorpay_text").remove(),jQuery("<div/>",{id:o.formId+"_success",class:"ff-message-success ff_msg_temp ff_razorpay_text"}).html(r.confirming_text).insertAfter(o.$form),o.formInstance.showFormSubmissionProgress(o.$form),o.formInstance.sendData(o.$form,t)},n.modal={escape:!1,ondismiss:function(){o.$form.parent().find(".ff_razorpay_text").remove(),o.formInstance.hideFormSubmissionProgress(o.$form)}};var t=new Razorpay(n);t.on("payment.failed",function(r){console.log(r),o.formInstance.hideFormSubmissionProgress(o.$form)}),this.formInstance.showFormSubmissionProgress(this.$form),t.open()}}])&&o(r.prototype,n),t&&o(r,t),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,t}();function e(r){r.each(r("form.fluentform_has_payment"),function(){function o(r,o){new t(n,o).init()}var n=r(this);n.off("fluentform_init_single","",o),n.on("fluentform_init_single",o)})}e(jQuery),jQuery(document).ready(function(r){e(r)})})();