// checkout-free.el -- Free plan: show success panel after auth completes.
// Watches the auth-badge element; when it becomes visible, hides the auth
// section and shows the free-success panel. No card required for free tier.
// Compiled with: elc --target=js --bundle --minify --obfuscate

fn main() -> Void {
    native_js("(function() {
  var success = document.getElementById('free-success');
  var auth = document.getElementById('auth-section');
  if (!success) return;
  var timer = setInterval(function() {
    var badge = document.getElementById('auth-badge');
    if (badge && badge.offsetParent !== null) {
      if (auth) auth.style.display = 'none';
      success.style.display = '';
      clearInterval(timer);
    }
  }, 150);
})()")
}
