/**
 * @license MIT
 * author: Cube Dev Team
 * @cube-dev/ui-kit v0.0.0-canary-2305ece
 * Released under the MIT license.
 */

import { parseStyle } from '../utils/styles.js';
const AUTOFILL_STYLES = {
    'caret-color': 'var(--primary-color)',
    '-webkit-text-fill-color': 'var(--primary-color)',
    '-webkit-box-shadow': '0 0 0px 9999rem var(--white-color) inset',
    'box-shadow': '0 0 0px 9999rem var(--white-color) inset',
    'font-family': 'inherit',
    'font-size': 'inherit',
    'line-height': 'inherit',
};
const RESET_MAP = {
    input: [
        {
            '-webkit-appearance': 'none',
            'word-spacing': 'initial',
            '-webkit-text-fill-color': 'currentColor',
        },
        {
            $: '::-webkit-search-cancel-button',
            display: 'none',
        },
        {
            $: ':-webkit-autofill',
            ...AUTOFILL_STYLES,
        },
        {
            $: ':-webkit-autofill:hover',
            ...AUTOFILL_STYLES,
        },
        {
            $: ':-webkit-autofill:focus',
            ...AUTOFILL_STYLES,
        },
        {
            $: '[disabled]',
            '-webkit-opacity': '1',
        },
        {
            $: '::placeholder',
            '-webkit-text-fill-color': 'var(--placeholder-color, initial)',
            color: 'var(--placeholder-color, initial)',
        },
        {
            $: '::-webkit-search-cancel-button',
            display: 'none',
            '-webkit-appearance': 'none',
        },
    ],
    button: [
        {
            '-webkit-tap-highlight-color': 'transparent',
        },
    ],
};
export function resetStyle({ reset }) {
    if (!reset)
        return;
    const processed = parseStyle(reset);
    const { mods } = processed.groups[0] ?? { mods: [] };
    const result = [];
    for (const mod of mods) {
        if (RESET_MAP[mod]) {
            result.push(...RESET_MAP[mod]);
        }
    }
    return result.length ? result : undefined;
}
resetStyle.__lookupStyles = ['reset'];

        