/**
 * Aumni AMS — application JavaScript.
 *
 * Everything here is progressive enhancement. Every screen works with
 * JavaScript disabled: forms post normally, links navigate, tables paginate on
 * the server. Nothing is rendered client-side.
 */

// Inter, self-hosted. Vite bundles the woff2 files into public/build and
// fingerprints them, so the font is never fetched from a third-party CDN — the
// production host sits behind a corporate network where that request may not
// resolve, and a missing font would drop the whole UI into the fallback stack.
import '@fontsource-variable/inter/wght.css';

import * as bootstrap from 'bootstrap';

import './modules/confirm';
import './modules/filters';
import './modules/specifications';
import './modules/bulk-select';
import './modules/submit-progress';
import './modules/print';
import './modules/charts';
import './modules/asset-tag-preview';

// Exposed so a Blade partial can drive a modal or tooltip without importing.
window.bootstrap = bootstrap;

/**
 * Opt-in tooltips: add data-bs-toggle="tooltip" title="..." to any element.
 */
document.addEventListener('DOMContentLoaded', () => {
    document
        .querySelectorAll('[data-bs-toggle="tooltip"]')
        .forEach((element) => bootstrap.Tooltip.getOrCreateInstance(element));
});
