function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}
function ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        if (enumerableOnly) {
            symbols = symbols.filter(function(sym) {
                return Object.getOwnPropertyDescriptor(object, sym).enumerable;
            });
        }
        keys.push.apply(keys, symbols);
    }
    return keys;
}
function _object_spread_props(target, source) {
    source = source != null ? source : {};
    if (Object.getOwnPropertyDescriptors) {
        Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
        ownKeys(Object(source)).forEach(function(key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
    }
    return target;
}
import { Keyframes } from "@ant-design/cssinjs";
import { useEditorStyleRegister } from "../../../Hooks/useStyle";
// 定义闪光动画
var shine = new Keyframes('shine', {
    '0%': {
        backgroundPosition: '100%'
    },
    '100%': {
        backgroundPosition: '-100%'
    }
});
var genStyle = function(token) {
    return _define_property({}, token.componentCls, {
        display: 'inline-block',
        animationName: shine,
        animationDuration: '1.2s',
        animationTimingFunction: 'linear',
        animationIterationCount: 'infinite',
        // 亮色主题：深色文字 + 亮色光泽（适用于白色背景）
        '&-light': {
            color: '#00000066',
            backgroundImage: "linear-gradient(\n          120deg,\n          rgba(255, 255, 255, 0.8) 40%,\n          rgba(15, 14, 14, 0.8) 50%,\n          rgba(255, 255, 255, 0.8) 60%\n        )",
            backgroundSize: '200% 100%',
            WebkitBackgroundClip: 'text',
            backgroundClip: 'text'
        },
        // 暗色主题：浅色文字 + 深色光泽（适用于黑色背景）
        '&-dark': {
            color: '#ffffff40',
            backgroundImage: "linear-gradient(\n          120deg,\n          rgba(255, 255, 255, 0) 40%,\n          rgba(255, 255, 255, 0.8) 50%,\n          rgba(255, 255, 255, 0) 60%\n        )",
            backgroundSize: '200% 100%',
            WebkitBackgroundClip: 'text',
            backgroundClip: 'text'
        },
        '&-disabled': {
            animationName: 'none'
        }
    });
};
export function useStyle(prefixCls) {
    return useEditorStyleRegister('TextLoading', function(token) {
        var textLoadingToken = _object_spread_props(_object_spread({}, token), {
            componentCls: ".".concat(prefixCls)
        });
        return [
            genStyle(textLoadingToken)
        ];
    });
}
