/**
 * Copyright © Volker Schukai and all contributing authors, 2026. All rights reserved.
 * Node module: @schukai/monster
 *
 * This source code is licensed under the GNU Affero General Public License version 3 (AGPLv3).
 * The full text of the license can be found at: https://www.gnu.org/licenses/agpl-3.0.en.html
 *
 * For those who do not wish to adhere to the AGPLv3, a commercial license is available.
 * Acquiring a commercial license allows you to use this software without complying with the AGPLv3 terms.
 * For more information about purchasing a commercial license, please contact Volker Schukai.
 */

import { addAttributeToken } from "../../dom/attributes.mjs";
import { ATTRIBUTE_ERRORMESSAGE } from "../../dom/constants.mjs";

export { BadgeStyleSheet };

/**
 * @private
 * @type {CSSStyleSheet}
 */
const BadgeStyleSheet = new CSSStyleSheet();

try {
	BadgeStyleSheet.insertRule(
		`
@layer badge {
.monster-badge-primary{padding:.25em .4em}.monster-badge-primary,.monster-badge-primary-pill{display:inline-block;font-size:75%;font-weight:700;line-height:1;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25rem;text-decoration:none;color:var(--monster-color-primary-4);background-color:var(--monster-bg-color-primary-4)}.monster-badge-primary-pill{padding:.25em .6em;border-radius:10rem}.monster-badge-secondary{padding:.25em .4em}.monster-badge-secondary,.monster-badge-secondary-pill{display:inline-block;font-size:75%;font-weight:700;line-height:1;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25rem;text-decoration:none;background-color:var(--monster-bg-color-secondary-3);color:var(--monster-color-secondary-3)}.monster-badge-secondary-pill{padding:.25em .6em;border-radius:10rem}.monster-badge-tertiary{padding:.25em .4em}.monster-badge-tertiary,.monster-badge-tertiary-pill{display:inline-block;font-size:75%;font-weight:700;line-height:1;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25rem;text-decoration:none;background-color:var(--monster-bg-color-tertiary-3);color:var(--monster-color-tertiary-3)}.monster-badge-tertiary-pill{padding:.25em .6em;border-radius:10rem}.monster-badge-destructive{padding:.25em .4em}.monster-badge-destructive,.monster-badge-destructive-pill{display:inline-block;font-size:75%;font-weight:700;line-height:1;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25rem;text-decoration:none;background-color:var(--monster-bg-color-destructive-1);color:var(--monster-color-destructive-1)}.monster-badge-destructive-pill{padding:.25em .6em;border-radius:10rem}.monster-badge-success{padding:.25em .4em}.monster-badge-success,.monster-badge-success-pill{display:inline-block;font-size:75%;font-weight:700;line-height:1;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25rem;text-decoration:none;background-color:var(--monster-bg-color-success-1);color:var(--monster-color-success-1)}.monster-badge-success-pill{padding:.25em .6em;border-radius:10rem}.monster-badge-warning{padding:.25em .4em}.monster-badge-warning,.monster-badge-warning-pill{display:inline-block;font-size:75%;font-weight:700;line-height:1;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25rem;text-decoration:none;background-color:var(--monster-bg-color-warning-1);color:var(--monster-color-warning-1)}.monster-badge-warning-pill{padding:.25em .6em;border-radius:10rem}.monster-badge-error{padding:.25em .4em}.monster-badge-error,.monster-badge-error-pill{display:inline-block;font-size:75%;font-weight:700;line-height:1;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25rem;text-decoration:none;background-color:var(--monster-bg-color-error-1);color:var(--monster-color-error-1)}.monster-badge-error-pill{padding:.25em .6em;border-radius:10rem}
}`,
		0,
	);
} catch (e) {
	addAttributeToken(
		document.getRootNode().querySelector("html"),
		ATTRIBUTE_ERRORMESSAGE,
		e + "",
	);
}
