class PlanadayUtility {
    addedStylesheets = [];

    ensureStylesheetOnce(href) {
        const existing = document.querySelector<HTMLLinkElement>(
            `link[rel="stylesheet"][href="${href}"]`
        );
        if (existing || this.addedStylesheets.includes(href)) return;
        this.addedStylesheets.push(href);

        const link = document.createElement("link");
        link.rel = "stylesheet";
        link.href = href;
        document.head.appendChild(link);
    }
}

window.PadUtil = new PlanadayUtility();