<?php $bootstrapJs = ugfx_vendor_asset('assets/vendor/bootstrap/js/bootstrap.bundle.min.js', 'https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js', '../'); ?>
</section>
<script>window.UGFX_CSRF_TOKEN = <?= json_encode(ugfx_csrf_token()) ?>;</script>
<script src="<?= htmlspecialchars($bootstrapJs) ?>"></script>
<script src="../assets/js/app.js"></script>
<script>
(function(){
  const token = window.UGFX_CSRF_TOKEN || '';
  if (!token) return;
  document.querySelectorAll('form[method="post"], form:not([method])').forEach(form => {
    let input = form.querySelector('input[name="csrf_token"]');
    if (!input) {
      input = document.createElement('input');
      input.type = 'hidden';
      input.name = 'csrf_token';
      form.appendChild(input);
    }
    input.value = token;
  });
})();
</script>
</body>
</html>
