import { resetComponent as p, textEllipsis as c } from "../../style/index.mjs";
import { initMoveMotion as r } from "../../style/motion/move.mjs";
import { slideUpIn as g, slideDownIn as u, slideUpOut as $, slideDownOut as b, initSlideMotion as s } from "../../style/motion/slide.mjs";
const m = (o) => {
  const {
    optionHeight: i,
    optionFontSize: n,
    optionLineHeight: t,
    optionPadding: l
  } = o;
  return {
    position: "relative",
    display: "block",
    minHeight: i,
    padding: l,
    color: o.colorText,
    fontWeight: "normal",
    fontSize: n,
    lineHeight: t,
    boxSizing: "border-box"
  };
}, f = (o) => {
  const {
    antCls: i,
    componentCls: n
  } = o, t = `${n}-item`, l = `&${i}-slide-up-enter${i}-slide-up-enter-active`, d = `&${i}-slide-up-appear${i}-slide-up-appear-active`, a = `&${i}-slide-up-leave${i}-slide-up-leave-active`, e = `${n}-dropdown-placement-`;
  return [
    {
      [`${n}-dropdown`]: Object.assign(Object.assign({}, p(o)), {
        position: "absolute",
        top: -9999,
        zIndex: o.zIndexPopup,
        boxSizing: "border-box",
        padding: o.paddingXXS,
        overflow: "hidden",
        fontSize: o.fontSize,
        // Fix select render lag of long text in chrome
        // https://github.com/ant-design/ant-design/issues/11456
        // https://github.com/ant-design/ant-design/issues/11843
        fontVariant: "initial",
        backgroundColor: o.colorBgElevated,
        borderRadius: o.borderRadiusLG,
        outline: "none",
        boxShadow: o.boxShadowSecondary,
        [`
          ${l}${e}bottomLeft,
          ${d}${e}bottomLeft
        `]: {
          animationName: g
        },
        [`
          ${l}${e}topLeft,
          ${d}${e}topLeft,
          ${l}${e}topRight,
          ${d}${e}topRight
        `]: {
          animationName: u
        },
        [`${a}${e}bottomLeft`]: {
          animationName: $
        },
        [`
          ${a}${e}topLeft,
          ${a}${e}topRight
        `]: {
          animationName: b
        },
        "&-hidden": {
          display: "none"
        },
        [`${t}`]: Object.assign(Object.assign({}, m(o)), {
          cursor: "pointer",
          transition: `background ${o.motionDurationSlow} ease`,
          borderRadius: o.borderRadiusSM,
          // =========== Group ============
          "&-group": {
            color: o.colorTextDescription,
            fontSize: o.fontSizeSM,
            cursor: "default"
          },
          // =========== Option ===========
          "&-option": {
            display: "flex",
            "&-content": Object.assign({
              flex: "auto"
            }, c),
            "&-state": {
              flex: "none",
              display: "flex",
              alignItems: "center"
            },
            [`&-active:not(${t}-option-disabled)`]: {
              backgroundColor: o.optionActiveBg
            },
            [`&-selected:not(${t}-option-disabled)`]: {
              color: o.optionSelectedColor,
              fontWeight: o.optionSelectedFontWeight,
              backgroundColor: o.optionSelectedBg,
              [`${t}-option-state`]: {
                color: o.colorPrimary
              }
            },
            "&-disabled": {
              [`&${t}-option-selected`]: {
                backgroundColor: o.colorBgContainerDisabled
              },
              color: o.colorTextDisabled,
              cursor: "not-allowed"
            },
            "&-grouped": {
              paddingInlineStart: o.calc(o.controlPaddingHorizontal).mul(2).equal()
            }
          }
        }),
        // =========================== RTL ===========================
        "&-rtl": {
          direction: "rtl"
        }
      })
    },
    // Follow code may reuse in other components
    s(o, "slide-up"),
    s(o, "slide-down"),
    r(o, "move-up"),
    r(o, "move-down")
  ];
}, h = f;
export {
  h as default
};
