jQuery(document).ready(function(e){var a=e("body").find(".ff_paddle_payment_container"),t=e("body").find(".ff_frameless_header");if(a.length){var n=window.ff_paddle_vars,i=n.frame_initial_height||"450",d=n.frame_style||"width: 100%; min-width: 312px; background-color: transparent; border: none;",o=n.allowed_payment_methods||["alipay","apple_pay","bancontact","card","google_pay","ideal","paypal"],r=n.payment_mode||"sandbox",l=n.theme||"light",c=n.locale||"en",s=n.client_token,f=n.redirect_delay||1e3;s&&(Paddle.Environment.set(r),Paddle.Initialize({token:s,checkout:{settings:{displayMode:"inline",allowedPaymentMethods:o,theme:l,locale:c,frameTarget:"ff_paddle_payment_container",frameInitialHeight:i,frameStyle:d}},eventCallback:function(i){if("checkout.completed"==i.name){var d={action:"fluentform_paddle_confirm_payment",transaction_hash:n.transaction_hash,submission_id:n.submission_id,paddle_payment:i.data};e.post(n.ajax_url,d).then(function(e){e.data&&e.data.payment.id==i.data.id&&(a.find("p").text(e.data.success_message),t.text(n.title_message),setTimeout(function(){window.location.href=e.data.redirect_url||n.success_redirect},f))}).catch(function(e){var t="Request failed. Please try again";e&&e.responseJSON&&(t=e.responseJSON.errors),a.find("p").text(t),setTimeout(function(){window.location.href=n.failure_redirect},f)})}if("checkout.error"==i.name){var o="Paddle payment process failed!";i.data&&i.data.error&&(o=i.data.error.detail),a.find("p").text(o),setTimeout(function(){window.location.href=n.failure_redirect},f)}}}))}});