"use strict";
var __webpack_require__ = {};
(()=>{
    __webpack_require__.d = (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 = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
})();
(()=>{
    __webpack_require__.r = (exports1)=>{
        if ("u" > 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__, {
    ToolbarIconButton: ()=>ToolbarIconButton
});
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
const react_namespaceObject = require("motion/react");
const external_react_namespaceObject = require("react");
const TOOLBAR_ICON_BUTTON_CLASS = "grid place-items-center w-6 h-6 p-0 border-0 rounded-[4px] [transition:background-color_140ms_ease,color_140ms_ease,opacity_140ms_ease] [&>svg]:w-4 [&>svg]:h-4 [&>svg]:text-[inherit] [&>svg]:origin-center [&>svg]:transition-transform [&>svg]:duration-[140ms] [&>svg]:ease-[ease] text-(--tb-color) bg-(--tb-bg) enabled:hover:bg-(--tb-hover-bg) enabled:hover:text-(--tb-hover-color) enabled:hover:[&>svg]:scale-[1.125]";
const TOOLBAR_ICON_BUTTON_DISABLED_CLASS = 'cursor-not-allowed opacity-40 pointer-events-none';
const TOOLBAR_ICON_BUTTON_ENABLED_CLASS = 'cursor-pointer opacity-100';
const ToolbarIconButtonInner = ({ disabled, isToggled, color, hoverBg, className, style, ...rest }, ref)=>{
    const restColor = color ?? (isToggled ? 'var(--canvas-foreground)' : 'var(--canvas-foreground-de-emp)');
    const effectiveHoverColor = color ?? 'var(--canvas-foreground)';
    const restBg = isToggled ? hoverBg ?? 'var(--canvas-background-hover)' : 'transparent';
    const effectiveHoverBg = hoverBg ?? 'var(--canvas-background-hover)';
    const mergedStyle = {
        ['--tb-color']: restColor,
        ['--tb-hover-color']: effectiveHoverColor,
        ['--tb-bg']: restBg,
        ['--tb-hover-bg']: effectiveHoverBg,
        ...style
    };
    return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_namespaceObject.motion.button, {
        ref: ref,
        disabled: disabled,
        className: (0, apollo_wind_namespaceObject.cn)(TOOLBAR_ICON_BUTTON_CLASS, disabled ? TOOLBAR_ICON_BUTTON_DISABLED_CLASS : TOOLBAR_ICON_BUTTON_ENABLED_CLASS, className),
        style: mergedStyle,
        ...rest
    });
};
const ToolbarIconButton = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)(ToolbarIconButtonInner);
ToolbarIconButton.displayName = 'ToolbarIconButton';
exports.ToolbarIconButton = __webpack_exports__.ToolbarIconButton;
for(var __rspack_i in __webpack_exports__)if (-1 === [
    "ToolbarIconButton"
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
Object.defineProperty(exports, '__esModule', {
    value: true
});
