!function(){var e=new URLSearchParams(window.location.search),n=e.get("client_secret"),t=e.get("pk"),o=document.getElementById("onramp-element");function i(e,n){o.innerHTML='<div class="error"><div class="error-icon"><svg width="24" height="24" fill="none" viewBox="0 0 24 24" stroke="#f87171"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z" /></svg></div><p>'+e+"</p>"+(n?'<p class="detail">'+n+"</p>":"")+"</div>"}if(n&&t){var r=0;!function e(){if(r++,"undefined"==typeof StripeOnramp)return r>100?void i("Payment widget failed to load.","Stripe scripts could not be loaded. Check your network connection and try again."):void setTimeout(e,100);try{var o=new StripeOnramp(t).createSession({clientSecret:n});o.addEventListener("onramp_session_updated",function(e){e.payload&&e.payload.session&&"error"===e.payload.session.status&&i("Payment session error.","The onramp session could not be initialized. Please try again.")}),o.mount("#onramp-element")}catch(e){console.error("Stripe onramp mount error:",e),i("Failed to load payment widget.",e.message||"Please try again.")}}()}else i("Missing session data.","Please try again from the Super Wallet extension.")}();