const MODIFIER_PATTERN = /^(!)?(?:(?:hover|focus|focus-within|focus-visible|active|disabled|visited|checked|first|last|odd|even|sm|md|lg|xl|2xl|dark|light|motion-safe|motion-reduce|portrait|landscape|print|rtl|ltr|open|placeholder|before|after|first-line|first-letter|selection|marker|group-hover|group-focus|peer-hover|peer-focus|has|not|aria-\w+|data-\w+):)*/;
const RAW_VALUE_PATTERN = /\[(?:#|.*?\d+(?:px|rem|em|vh|vw|dvh|dvw|svh|svw|ch|ex|cap|ic|lh|rlh|cm|mm|in|pt|pc|%))/;
function parseToken(token) {
    return token.replace(MODIFIER_PATTERN, '');
}
function hasArbitraryBracket(bare) {
    return bare.includes('[');
}
function hasRawArbitraryValue(bare) {
    if (!hasArbitraryBracket(bare)) {
        return false;
    }
    return RAW_VALUE_PATTERN.test(bare);
}
function validate(value, isInvalid) {
    const tokens = value.trim().split(/\s+/).filter(Boolean);
    const invalidClasses = [];
    for (const token of tokens) {
        const bare = parseToken(token);
        if (isInvalid(bare)) {
            invalidClasses.push(token);
        }
    }
    return { valid: invalidClasses.length === 0, invalidClasses };
}
export function validateContentClassName(value) {
    return validate(value, hasArbitraryBracket);
}
export function validateComponentClassName(value) {
    return validate(value, hasRawArbitraryValue);
}
