function setupPayPal(){paypal.Buttons({style:{layout:"horizontal",shape:"pill",tagline:!1,funding:{disallowed:[paypal.FUNDING.CREDIT]}},onInit:function(n,t){getPayPalActions=function(){return t};actionStatus=t},onClick:function(){console.log("paypal clicked");updateRealAddress();updateFieldsOnSubmit()},createOrder:function(n,t){if(console.log("createOrder"),!validateAndLogForm(document.getElementById("paypal-wrapper"))){actionStatus.disable();scrollToFirstError();throw new Error("Form validation failed");}return t.order.create({intent:"AUTHORIZE",purchase_units:[{amount:{value:document.getElementById("Amount").value},description:document.getElementById("AccountName").value.substring(0,127),custom_id:document.getElementById("DebugId").value}]})},onApprove:function(n){return document.getElementById("PayPalOrderID").value=n.orderID,updateAfterPayPal()},onCancel:function(){},onError:function(n){var t=document.getElementById("trans-paypal3").textContent;console.error("An error occured with PayPal",n);document.getElementById("PayPalError").value=n;showPayPalFailedMessage()}}).render("#paypal-wrapper")}function updateAfterPayPal(){document.querySelector(".efundForm").submit();disableAmountAffectors()}function disablePayPal(){if(document.getElementById("btnPayPal")&&(document.getElementById("btnPayPal").style.display="none"),document.getElementById("paypal-tab-content")&&(document.getElementById("paypal-tab-content").style.display="none"),document.getElementById("btnPayPal")){let n=document.getElementById("btnPayPal").getAttribute("disabled");n!==undefined&&n!==!1&&handleCreditCardClick()}}function enablePayPal(){document.getElementById("btnPayPal").style.display="block"}function showPayPalFailedMessage(){document.getElementById("paypal-message").innerHTML='<p class="text-center">'+document.getElementById("trans-paypal3").textContent+"<\/p>";document.getElementById("paypal-message").style.display="block"}console.log("Old PayPal Code Connected");document.addEventListener("DOMContentLoaded",function(){document.getElementById("btnPayPal")&&document.getElementById("btnPayPal").addEventListener("click",function(){document.querySelector(".paypal-buttons")||setupPayPal()})});var getPayPalActions