"use strict";
var __webpack_require__ = {};
(()=>{
    __webpack_require__.d = function(exports1, definition) {
        for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
            enumerable: true,
            get: definition[key]
        });
    };
})();
(()=>{
    __webpack_require__.o = function(obj, prop) {
        return Object.prototype.hasOwnProperty.call(obj, prop);
    };
})();
(()=>{
    __webpack_require__.r = function(exports1) {
        if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
            value: 'Module'
        });
        Object.defineProperty(exports1, '__esModule', {
            value: true
        });
    };
})();
var __webpack_exports__ = {};
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
    CSSVariableProvider: ()=>CSSVariableProvider,
    default: ()=>CSSVariableProvider_rslib_entry_
});
const external_react_namespaceObject = require("react");
const tinycolor_namespaceObject = require("@ctrl/tinycolor");
const external_index_js_namespaceObject = require("../index.js");
const index_js_namespaceObject = require("../theme/index.js");
const CSSVariableProvider = (param)=>{
    let { children } = param;
    const { token } = (0, external_index_js_namespaceObject.useToken)();
    const colorBgScrollTrack = token.colorFillTertiary;
    const colorBgScrollBar = new tinycolor_namespaceObject.TinyColor(token.colorFill).onBackground(token.colorFillSecondary).toHexShortString();
    const colorBgScrollBarHover = new tinycolor_namespaceObject.TinyColor(token.colorFill).onBackground(token.colorFill).toHexShortString();
    const colorBgScrollBarActive = new tinycolor_namespaceObject.TinyColor(token.colorFill).onBackground(token.colorFill).onBackground(token.colorFill).toHexShortString();
    const colorBgDrawer = (0, external_react_namespaceObject.useMemo)(()=>{
        const colorBgElevated = new tinycolor_namespaceObject.TinyColor(token.colorBgElevated);
        return colorBgElevated.isDark() ? token.colorBgElevated : colorBgElevated.darken(4).toHexString();
    }, [
        token.colorBgElevated
    ]);
    (0, external_react_namespaceObject.useEffect)(()=>{
        document.body.style.setProperty('--tb-spacing', "".concat(token.marginLG, "px"));
        document.body.style.setProperty('--tb-designer-offset', "".concat(token.marginXS, "px"));
        document.body.style.setProperty('--tb-header-height', "".concat(token.sizeXXL - 2, "px"));
        document.body.style.setProperty('--tb-box-bg', token.colorBgLayout);
        document.body.style.setProperty('--tb-box-bg', token.colorBgLayout);
        document.body.style.setProperty('--controlHeightLG', "".concat(token.controlHeightLG, "px"));
        document.body.style.setProperty('--paddingContentVerticalSM', "".concat(token.paddingContentVerticalSM, "px"));
        document.body.style.setProperty('--marginSM', "".concat(token.marginSM, "px"));
        document.body.style.setProperty('--colorInfoBg', token.colorInfoBg);
        document.body.style.setProperty('--colorInfoBorder', token.colorInfoBorder);
        document.body.style.setProperty('--colorText', token.colorText);
        document.body.style.setProperty('--colorPrimaryText', token.colorPrimaryText);
        document.body.style.setProperty('--colorPrimaryTextActive', token.colorPrimaryTextActive);
        document.body.style.setProperty('--colorPrimaryTextHover', token.colorPrimaryTextHover);
        document.body.style.setProperty('--colorBgScrollTrack', colorBgScrollTrack);
        document.body.style.setProperty('--colorBgScrollBar', colorBgScrollBar);
        document.body.style.setProperty('--colorBgScrollBarHover', colorBgScrollBarHover);
        document.body.style.setProperty('--colorBgScrollBarActive', colorBgScrollBarActive);
        document.body.style.setProperty('--colorBgDrawer', colorBgDrawer);
        document.body.style.setProperty('--colorSettings', token.colorSettings || index_js_namespaceObject.defaultTheme.token.colorSettings);
        document.body.style.setProperty('--colorBgSettingsHover', token.colorBgSettingsHover);
        document.body.style.setProperty('--colorBorderSettingsHover', token.colorBorderSettingsHover);
        document.body.style.setProperty('background-color', token.colorBgContainer);
    }, [
        token.marginLG,
        token.colorBgLayout,
        token.sizeXXL,
        token.marginXS,
        token.controlHeightLG,
        token.paddingContentVerticalSM,
        token.marginSM,
        token.colorInfoBg,
        token.colorInfoBorder,
        token.colorText,
        token.colorBgContainer,
        token.colorFillQuaternary,
        token.colorFillSecondary,
        token.colorFill,
        token.colorFillTertiary,
        colorBgScrollTrack,
        colorBgScrollBar,
        colorBgScrollBarHover,
        colorBgScrollBarActive,
        colorBgDrawer,
        token.colorPrimaryText,
        token.colorPrimaryTextActive,
        token.colorPrimaryTextHover,
        token.colorSettings,
        token.colorBgSettingsHover,
        token.colorBorderSettingsHover
    ]);
    return children;
};
CSSVariableProvider.displayName = 'CSSVariableProvider';
const CSSVariableProvider_rslib_entry_ = CSSVariableProvider;
var __webpack_export_target__ = exports;
for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
    value: true
});
