| 1 |
(()=>{"use strict";document.addEventListener("DOMContentLoaded",()=>{!function(e,t,a="ablocksInitialized"){e&&("function"==typeof e.forEach?e:[e]).forEach(e=>{e&&e.dataset&&!e.dataset[a]&&(e.dataset[a]="1",t(e))})}(document.querySelectorAll(".ablocks-paypal-button__form"),e=>{const t=e.getAttribute("data-ablocks__error-msg");e.addEventListener("submit",a=>{(function(e){const t=e.querySelector('input[name="business"]').value,a=e.querySelector('input[name="cmd"]').value,n=e.querySelector('input[name="item_name"]').value;return!!(t&&a&&n)})(e)||(a.preventDefault(),function(e,t){let a=e.querySelector(".ablocks-paypal-button__error");a||(a=document.createElement("p"),a.className="ablocks-paypal-button__error",a.style.color="red",a.style.fontSize="14px",a.style.textAlign="center",e.appendChild(a)),a.textContent=t||"Please fill in all required fields.",a.style.display="block"}(e,t))})},"ablocksPaypalInit")})})(); |