import "../../../../@ant-design/cssinjs/es/extractStyle.mjs";
import "../../../../@ant-design/cssinjs/es/hooks/useCacheToken.mjs";
import "react";
import "../../../../@ant-design/cssinjs/es/StyleContext.mjs";
import { unit as t } from "../../../../@ant-design/cssinjs/es/util/index.mjs";
import "../../../../@ant-design/cssinjs/es/hooks/useCompatibleInsertionEffect.mjs";
import "../../../../@ant-design/cssinjs/es/hooks/useEffectCleanupRegister.mjs";
import "../../../../@ant-design/cssinjs/es/hooks/useHMR.mjs";
import "../../../../rc-util/es/warning.mjs";
import "../../../../@ant-design/cssinjs/es/theme/createTheme.mjs";
import "../../../../@ant-design/cssinjs/es/theme/ThemeCache.mjs";
import "../../../../@ant-design/cssinjs/es/transformers/legacyLogicalProperties.mjs";
import { initInputToken as te, genActiveStyle as V, genHoverStyle as ie, genBasicInputStyle as ae, initComponentToken as oe } from "../../input/style/index.mjs";
import { resetComponent as ee, textEllipsis as le } from "../../style/index.mjs";
import { genCompactItemStyle as de } from "../../style/compact-item.mjs";
import { initMoveMotion as re } from "../../style/motion/move.mjs";
import { slideDownIn as ce, slideUpIn as se, slideDownOut as ge, slideUpOut as pe, initSlideMotion as ne } from "../../style/motion/slide.mjs";
import { genStyleHooks as $e } from "../../theme/util/genComponentStyleHook.mjs";
import { merge as J } from "../../theme/util/statistic.mjs";
import { genRoundedArrow as ue, getArrowToken as be } from "../../style/roundedArrow.mjs";
import { TinyColor as M } from "../../../../@ctrl/tinycolor/dist/module/index.mjs";
const U = (n, e, r, i) => {
  const o = n.calc(r).add(2).equal(), d = n.max(n.calc(e).sub(o).div(2).equal(), 0), a = n.max(n.calc(e).sub(o).sub(d).equal(), 0);
  return {
    padding: `${t(d)} ${t(i)} ${t(a)}`
  };
}, he = (n) => {
  const {
    componentCls: e,
    pickerCellCls: r,
    pickerCellInnerCls: i,
    cellHeight: o,
    motionDurationSlow: d,
    borderRadiusSM: a,
    motionDurationMid: p,
    cellHoverBg: c,
    lineWidth: u,
    lineType: x,
    colorPrimary: l,
    cellActiveWithRangeBg: g,
    colorTextLightSolid: E,
    controlHeightSM: C,
    cellRangeBorderColor: b,
    pickerCellBorderGap: $,
    cellHoverWithRangeBg: h,
    cellWidth: v,
    colorTextDisabled: m,
    cellBgDisabled: w
  } = n;
  return {
    "&::before": {
      position: "absolute",
      top: "50%",
      insetInlineStart: 0,
      insetInlineEnd: 0,
      zIndex: 1,
      height: o,
      transform: "translateY(-50%)",
      transition: `all ${d}`,
      content: '""'
    },
    // >>> Default
    [i]: {
      position: "relative",
      zIndex: 2,
      display: "inline-block",
      minWidth: o,
      height: o,
      lineHeight: t(o),
      borderRadius: a,
      transition: `background ${p}, border ${p}`
    },
    "&-range-hover-start, &-range-hover-end": {
      [i]: {
        borderStartEndRadius: 0,
        borderEndEndRadius: 0
      }
    },
    // >>> Hover
    [`&:hover:not(${r}-in-view),
    &:hover:not(${r}-selected):not(${r}-range-start):not(${r}-range-end):not(${r}-range-hover-start):not(${r}-range-hover-end)`]: {
      [i]: {
        background: c
      }
    },
    // >>> Today
    [`&-in-view${r}-today ${i}`]: {
      "&::before": {
        position: "absolute",
        top: 0,
        insetInlineEnd: 0,
        bottom: 0,
        insetInlineStart: 0,
        zIndex: 1,
        border: `${t(u)} ${x} ${l}`,
        borderRadius: a,
        content: '""'
      }
    },
    // >>> In Range
    [`&-in-view${r}-in-range`]: {
      position: "relative",
      "&::before": {
        background: g
      }
    },
    // >>> Selected
    [`&-in-view${r}-selected ${i},
      &-in-view${r}-range-start ${i},
      &-in-view${r}-range-end ${i}`]: {
      color: E,
      background: l
    },
    [`&-in-view${r}-range-start:not(${r}-range-start-single),
      &-in-view${r}-range-end:not(${r}-range-end-single)`]: {
      "&::before": {
        background: g
      }
    },
    [`&-in-view${r}-range-start::before`]: {
      insetInlineStart: "50%"
    },
    [`&-in-view${r}-range-end::before`]: {
      insetInlineEnd: "50%"
    },
    // >>> Range Hover
    [`&-in-view${r}-range-hover-start:not(${r}-in-range):not(${r}-range-start):not(${r}-range-end),
      &-in-view${r}-range-hover-end:not(${r}-in-range):not(${r}-range-start):not(${r}-range-end),
      &-in-view${r}-range-hover-start${r}-range-start-single,
      &-in-view${r}-range-hover-start${r}-range-start${r}-range-end${r}-range-end-near-hover,
      &-in-view${r}-range-hover-end${r}-range-start${r}-range-end${r}-range-start-near-hover,
      &-in-view${r}-range-hover-end${r}-range-end-single,
      &-in-view${r}-range-hover:not(${r}-in-range)`]: {
      "&::after": {
        position: "absolute",
        top: "50%",
        zIndex: 0,
        height: C,
        borderTop: `${t(u)} dashed ${b}`,
        borderBottom: `${t(u)} dashed ${b}`,
        transform: "translateY(-50%)",
        transition: `all ${d}`,
        content: '""'
      }
    },
    // Add space for stash
    "&-range-hover-start::after,\n      &-range-hover-end::after,\n      &-range-hover::after": {
      insetInlineEnd: 0,
      insetInlineStart: $
    },
    // Hover with in range
    [`&-in-view${r}-in-range${r}-range-hover::before,
      &-in-view${r}-in-range${r}-range-hover-start::before,
      &-in-view${r}-in-range${r}-range-hover-end::before,
      &-in-view${r}-range-start${r}-range-hover::before,
      &-in-view${r}-range-end${r}-range-hover::before,
      &-in-view${r}-range-start:not(${r}-range-start-single)${r}-range-hover-start::before,
      &-in-view${r}-range-end:not(${r}-range-end-single)${r}-range-hover-end::before,
      ${e}-panel
      > :not(${e}-date-panel)
      &-in-view${r}-in-range${r}-range-hover-start::before,
      ${e}-panel
      > :not(${e}-date-panel)
      &-in-view${r}-in-range${r}-range-hover-end::before`]: {
      background: h
    },
    // range start border-radius
    [`&-in-view${r}-range-start:not(${r}-range-start-single):not(${r}-range-end) ${i}`]: {
      borderStartStartRadius: a,
      borderEndStartRadius: a,
      borderStartEndRadius: 0,
      borderEndEndRadius: 0
    },
    // range end border-radius
    [`&-in-view${r}-range-end:not(${r}-range-end-single):not(${r}-range-start) ${i}`]: {
      borderStartStartRadius: 0,
      borderEndStartRadius: 0,
      borderStartEndRadius: a,
      borderEndEndRadius: a
    },
    [`&-range-hover${r}-range-end::after`]: {
      insetInlineStart: "50%"
    },
    // Edge start
    [`tr > &-in-view${r}-range-hover:first-child::after,
      tr > &-in-view${r}-range-hover-end:first-child::after,
      &-in-view${r}-start${r}-range-hover-edge-start${r}-range-hover-edge-start-near-range::after,
      &-in-view${r}-range-hover-edge-start:not(${r}-range-hover-edge-start-near-range)::after,
      &-in-view${r}-range-hover-start::after`]: {
      insetInlineStart: n.calc(v).sub(o).div(2).equal(),
      borderInlineStart: `${t(u)} dashed ${b}`,
      borderStartStartRadius: a,
      borderEndStartRadius: a
    },
    // Edge end
    [`tr > &-in-view${r}-range-hover:last-child::after,
      tr > &-in-view${r}-range-hover-start:last-child::after,
      &-in-view${r}-end${r}-range-hover-edge-end${r}-range-hover-edge-end-near-range::after,
      &-in-view${r}-range-hover-edge-end:not(${r}-range-hover-edge-end-near-range)::after,
      &-in-view${r}-range-hover-end::after`]: {
      insetInlineEnd: n.calc(v).sub(o).div(2).equal(),
      borderInlineEnd: `${t(u)} dashed ${b}`,
      borderStartEndRadius: a,
      borderEndEndRadius: a
    },
    // >>> Disabled
    "&-disabled": {
      color: m,
      pointerEvents: "none",
      [i]: {
        background: "transparent"
      },
      "&::before": {
        background: w
      }
    },
    [`&-disabled${r}-today ${i}::before`]: {
      borderColor: m
    }
  };
}, ve = (n) => {
  const {
    componentCls: e,
    pickerCellCls: r,
    pickerCellInnerCls: i,
    pickerYearMonthCellWidth: o,
    pickerControlIconSize: d,
    cellWidth: a,
    paddingSM: p,
    paddingXS: c,
    paddingXXS: u,
    colorBgContainer: x,
    lineWidth: l,
    lineType: g,
    borderRadiusLG: E,
    colorPrimary: C,
    colorTextHeading: b,
    colorSplit: $,
    pickerControlIconBorderWidth: h,
    colorIcon: v,
    textHeight: m,
    motionDurationMid: w,
    colorIconHover: z,
    fontWeightStrong: q,
    cellHeight: S,
    pickerCellPaddingVertical: T,
    colorTextDisabled: y,
    colorText: R,
    fontSize: G,
    cellHoverWithRangeBg: X,
    motionDurationSlow: P,
    withoutTimeCellHeight: Y,
    pickerQuarterPanelContentHeight: A,
    colorLink: N,
    colorLinkActive: F,
    colorLinkHover: Q,
    cellRangeBorderColor: f,
    borderRadiusSM: s,
    colorTextLightSolid: k,
    cellHoverBg: O,
    timeColumnHeight: H,
    timeColumnWidth: W,
    timeCellHeight: I,
    controlItemBgActive: B,
    marginXXS: j,
    pickerDatePanelPaddingHorizontal: K,
    pickerControlIconMargin: Z
  } = n, _ = n.calc(a).mul(7).add(n.calc(K).mul(2)).equal(), D = n.calc(_).sub(n.calc(c).mul(2)).div(3).sub(n.pickerYearMonthCellWidth).sub(p).equal(), L = n.calc(_).sub(n.calc(c).mul(2)).div(4).sub(n.pickerYearMonthCellWidth).equal();
  return {
    [e]: {
      "&-panel": {
        display: "inline-flex",
        flexDirection: "column",
        textAlign: "center",
        background: x,
        border: `${t(l)} ${g} ${$}`,
        borderRadius: E,
        outline: "none",
        "&-focused": {
          borderColor: C
        },
        "&-rtl": {
          direction: "rtl",
          [`${e}-prev-icon,
              ${e}-super-prev-icon`]: {
            transform: "rotate(45deg)"
          },
          [`${e}-next-icon,
              ${e}-super-next-icon`]: {
            transform: "rotate(-135deg)"
          }
        }
      },
      // ========================================================
      // =                     Shared Panel                     =
      // ========================================================
      "&-decade-panel,\n        &-year-panel,\n        &-quarter-panel,\n        &-month-panel,\n        &-week-panel,\n        &-date-panel,\n        &-time-panel": {
        display: "flex",
        flexDirection: "column",
        width: _
      },
      // ======================= Header =======================
      "&-header": {
        display: "flex",
        padding: `0 ${t(c)}`,
        color: b,
        borderBottom: `${t(l)} ${g} ${$}`,
        "> *": {
          flex: "none"
        },
        button: {
          padding: 0,
          color: v,
          lineHeight: t(m),
          background: "transparent",
          border: 0,
          cursor: "pointer",
          transition: `color ${w}`,
          fontSize: "inherit"
        },
        "> button": {
          minWidth: "1.6em",
          fontSize: G,
          "&:hover": {
            color: z
          }
        },
        "&-view": {
          flex: "auto",
          fontWeight: q,
          lineHeight: t(m),
          button: {
            color: "inherit",
            fontWeight: "inherit",
            verticalAlign: "top",
            "&:not(:first-child)": {
              marginInlineStart: c
            },
            "&:hover": {
              color: C
            }
          }
        }
      },
      // Arrow button
      "&-prev-icon,\n        &-next-icon,\n        &-super-prev-icon,\n        &-super-next-icon": {
        position: "relative",
        display: "inline-block",
        width: d,
        height: d,
        "&::before": {
          position: "absolute",
          top: 0,
          insetInlineStart: 0,
          display: "inline-block",
          width: d,
          height: d,
          border: "0 solid currentcolor",
          borderBlockStartWidth: h,
          borderBlockEndWidth: 0,
          borderInlineStartWidth: h,
          borderInlineEndWidth: 0,
          content: '""'
        }
      },
      "&-super-prev-icon,\n        &-super-next-icon": {
        "&::after": {
          position: "absolute",
          top: Z,
          insetInlineStart: Z,
          display: "inline-block",
          width: d,
          height: d,
          border: "0 solid currentcolor",
          borderBlockStartWidth: h,
          borderBlockEndWidth: 0,
          borderInlineStartWidth: h,
          borderInlineEndWidth: 0,
          content: '""'
        }
      },
      "&-prev-icon,\n        &-super-prev-icon": {
        transform: "rotate(-45deg)"
      },
      "&-next-icon,\n        &-super-next-icon": {
        transform: "rotate(135deg)"
      },
      // ======================== Body ========================
      "&-content": {
        width: "100%",
        tableLayout: "fixed",
        borderCollapse: "collapse",
        "th, td": {
          position: "relative",
          minWidth: S,
          fontWeight: "normal"
        },
        th: {
          height: n.calc(S).add(n.calc(T).mul(2)).equal(),
          color: R,
          verticalAlign: "middle"
        }
      },
      "&-cell": Object.assign({
        padding: `${t(T)} 0`,
        color: y,
        cursor: "pointer",
        // In view
        "&-in-view": {
          color: R
        }
      }, he(n)),
      // DatePanel only
      [`&-date-panel ${e}-cell-in-view${e}-cell-in-range${e}-cell-range-hover-start ${i},
        &-date-panel ${e}-cell-in-view${e}-cell-in-range${e}-cell-range-hover-end ${i}`]: {
        "&::after": {
          position: "absolute",
          top: 0,
          bottom: 0,
          zIndex: -1,
          background: X,
          transition: `all ${P}`,
          content: '""'
        }
      },
      [`&-date-panel
        ${e}-cell-in-view${e}-cell-in-range${e}-cell-range-hover-start
        ${i}::after`]: {
        insetInlineEnd: n.calc(a).sub(S).mul(-1).div(2).equal(),
        insetInlineStart: 0
      },
      [`&-date-panel ${e}-cell-in-view${e}-cell-in-range${e}-cell-range-hover-end ${i}::after`]: {
        insetInlineEnd: 0,
        insetInlineStart: n.calc(a).sub(S).mul(-1).div(2).equal()
      },
      // Hover with range start & end
      [`&-range-hover${e}-range-start::after`]: {
        insetInlineEnd: "50%"
      },
      "&-decade-panel,\n        &-year-panel,\n        &-quarter-panel,\n        &-month-panel": {
        [`${e}-content`]: {
          height: n.calc(Y).mul(4).equal()
        },
        [i]: {
          padding: `0 ${t(c)}`
        }
      },
      "&-quarter-panel": {
        [`${e}-content`]: {
          height: A
        },
        // Quarter Panel Special Style
        [`${e}-cell-range-hover-start::after`]: {
          insetInlineStart: L,
          borderInlineStart: `${t(l)} dashed ${f}`,
          [`${e}-panel-rtl &`]: {
            insetInlineEnd: L,
            borderInlineEnd: `${t(l)} dashed ${f}`
          }
        },
        [`${e}-cell-range-hover-end::after`]: {
          insetInlineEnd: L,
          borderInlineEnd: `${t(l)} dashed ${f}`,
          [`${e}-panel-rtl &`]: {
            insetInlineStart: L,
            borderInlineStart: `${t(l)} dashed ${f}`
          }
        }
      },
      // ======================== Footer ========================
      [`&-panel ${e}-footer`]: {
        borderTop: `${t(l)} ${g} ${$}`
      },
      "&-footer": {
        width: "min-content",
        minWidth: "100%",
        lineHeight: t(n.calc(m).sub(n.calc(l).mul(2)).equal()),
        textAlign: "center",
        "&-extra": {
          padding: `0 ${t(p)}`,
          lineHeight: t(n.calc(m).sub(n.calc(l).mul(2)).equal()),
          textAlign: "start",
          "&:not(:last-child)": {
            borderBottom: `${t(l)} ${g} ${$}`
          }
        }
      },
      "&-now": {
        textAlign: "start"
      },
      "&-today-btn": {
        color: N,
        "&:hover": {
          color: Q
        },
        "&:active": {
          color: F
        },
        [`&${e}-today-btn-disabled`]: {
          color: y,
          cursor: "not-allowed"
        }
      },
      // ========================================================
      // =                       Special                        =
      // ========================================================
      // ===================== Decade Panel =====================
      "&-decade-panel": {
        [i]: {
          padding: `0 ${t(n.calc(c).div(2).equal())}`
        },
        [`${e}-cell::before`]: {
          display: "none"
        }
      },
      // ============= Year & Quarter & Month Panel =============
      "&-year-panel,\n        &-quarter-panel,\n        &-month-panel": {
        [`${e}-body`]: {
          padding: `0 ${t(c)}`
        },
        [i]: {
          width: o
        },
        [`${e}-cell-range-hover-start::after`]: {
          borderStartStartRadius: s,
          borderEndStartRadius: s,
          borderStartEndRadius: 0,
          borderEndEndRadius: 0,
          [`${e}-panel-rtl &`]: {
            borderStartStartRadius: 0,
            borderEndStartRadius: 0,
            borderStartEndRadius: s,
            borderEndEndRadius: s
          }
        },
        [`${e}-cell-range-hover-end::after`]: {
          borderStartStartRadius: 0,
          borderEndStartRadius: 0,
          borderStartEndRadius: s,
          borderEndEndRadius: s,
          [`${e}-panel-rtl &`]: {
            borderStartStartRadius: s,
            borderEndStartRadius: s,
            borderStartEndRadius: 0,
            borderEndEndRadius: 0
          }
        }
      },
      "&-year-panel,\n        &-month-panel": {
        [`${e}-cell-range-hover-start::after`]: {
          insetInlineStart: D,
          borderInlineStart: `${t(l)} dashed ${f}`,
          [`${e}-panel-rtl &`]: {
            insetInlineEnd: D,
            borderInlineEnd: `${t(l)} dashed ${f}`
          }
        },
        [`${e}-cell-range-hover-end::after`]: {
          insetInlineEnd: D,
          borderInlineEnd: `${t(l)} dashed ${f}`,
          [`${e}-panel-rtl &`]: {
            insetInlineStart: D,
            borderInlineStart: `${t(l)} dashed ${f}`
          }
        }
      },
      // ====================== Week Panel ======================
      "&-week-panel": {
        [`${e}-body`]: {
          padding: `${t(c)} ${t(p)}`
        },
        // Clear cell style
        [`${e}-cell`]: {
          [`&:hover ${i},
            &-selected ${i},
            ${i}`]: {
            background: "transparent !important"
          }
        },
        "&-row": {
          td: {
            "&:before": {
              transition: `background ${w}`
            },
            "&:first-child:before": {
              borderStartStartRadius: s,
              borderEndStartRadius: s
            },
            "&:last-child:before": {
              borderStartEndRadius: s,
              borderEndEndRadius: s
            }
          },
          "&:hover td": {
            "&:before": {
              background: O
            }
          },
          "&-range-start td,\n            &-range-end td,\n            &-selected td": {
            // Rise priority to override hover style
            [`&${r}`]: {
              "&:before": {
                background: C
              },
              [`&${e}-cell-week`]: {
                color: new M(k).setAlpha(0.5).toHexString()
              },
              [i]: {
                color: k
              }
            }
          },
          "&-range-hover td:before": {
            background: B
          }
        }
      },
      // ====================== Date Panel ======================
      "&-date-panel": {
        [`${e}-body`]: {
          padding: `${t(c)} ${t(K)}`
        },
        [`${e}-content`]: {
          width: n.calc(a).mul(7).equal(),
          th: {
            width: a,
            boxSizing: "border-box",
            padding: 0
          }
        }
      },
      // ==================== Datetime Panel ====================
      "&-datetime-panel": {
        display: "flex",
        [`${e}-time-panel`]: {
          borderInlineStart: `${t(l)} ${g} ${$}`
        },
        [`${e}-date-panel,
          ${e}-time-panel`]: {
          transition: `opacity ${P}`
        },
        // Keyboard
        "&-active": {
          [`${e}-date-panel,
            ${e}-time-panel`]: {
            opacity: 0.3,
            "&-active": {
              opacity: 1
            }
          }
        }
      },
      // ====================== Time Panel ======================
      "&-time-panel": {
        width: "auto",
        minWidth: "auto",
        direction: "ltr",
        [`${e}-content`]: {
          display: "flex",
          flex: "auto",
          height: H
        },
        "&-column": {
          flex: "1 0 auto",
          width: W,
          margin: `${t(u)} 0`,
          padding: 0,
          overflowY: "hidden",
          textAlign: "start",
          listStyle: "none",
          transition: `background ${w}`,
          overflowX: "hidden",
          "&::-webkit-scrollbar": {
            width: 8,
            backgroundColor: "transparent"
          },
          "&::-webkit-scrollbar-thumb": {
            backgroundColor: n.colorTextTertiary,
            borderRadius: 4
          },
          // For Firefox
          "&": {
            scrollbarWidth: "thin",
            scrollbarColor: `${n.colorTextTertiary} transparent`
          },
          "&::after": {
            display: "block",
            height: n.calc(H).sub(I).equal(),
            content: '""'
          },
          "&:not(:first-child)": {
            borderInlineStart: `${t(l)} ${g} ${$}`
          },
          "&-active": {
            background: new M(B).setAlpha(0.2).toHexString()
          },
          "&:hover": {
            overflowY: "auto"
          },
          "> li": {
            margin: 0,
            padding: 0,
            [`&${e}-time-panel-cell`]: {
              marginInline: j,
              [`${e}-time-panel-cell-inner`]: {
                display: "block",
                width: n.calc(W).sub(n.calc(j).mul(2)).equal(),
                height: I,
                margin: 0,
                paddingBlock: 0,
                paddingInlineEnd: 0,
                paddingInlineStart: n.calc(W).sub(I).div(2).equal(),
                color: R,
                lineHeight: t(I),
                borderRadius: s,
                cursor: "pointer",
                transition: `background ${w}`,
                "&:hover": {
                  background: O
                }
              },
              "&-selected": {
                [`${e}-time-panel-cell-inner`]: {
                  background: B
                }
              },
              "&-disabled": {
                [`${e}-time-panel-cell-inner`]: {
                  color: y,
                  background: "transparent",
                  cursor: "not-allowed"
                }
              }
            }
          }
        }
      },
      // https://github.com/ant-design/ant-design/issues/39227
      [`&-datetime-panel ${e}-time-panel-column:after`]: {
        height: n.calc(H).sub(I).add(n.calc(u).mul(2)).equal()
      }
    }
  };
}, me = (n) => {
  const {
    componentCls: e,
    colorBgContainer: r,
    colorError: i,
    errorActiveShadow: o,
    colorWarning: d,
    warningActiveShadow: a,
    colorErrorHover: p,
    colorWarningHover: c
  } = n;
  return {
    [`${e}:not(${e}-disabled):not([disabled])`]: {
      [`&${e}-status-error`]: {
        backgroundColor: r,
        borderColor: i,
        "&:hover": {
          borderColor: p
        },
        [`&${e}-focused, &:focus`]: Object.assign({}, V(J(n, {
          activeBorderColor: i,
          activeShadow: o
        }))),
        [`${e}-active-bar`]: {
          background: i
        }
      },
      [`&${e}-status-warning`]: {
        backgroundColor: r,
        borderColor: d,
        "&:hover": {
          borderColor: c
        },
        [`&${e}-focused, &:focus`]: Object.assign({}, V(J(n, {
          activeBorderColor: d,
          activeShadow: a
        }))),
        [`${e}-active-bar`]: {
          background: d
        }
      }
    }
  };
}, fe = (n) => {
  const {
    componentCls: e,
    antCls: r,
    controlHeight: i,
    paddingInline: o,
    colorBgContainer: d,
    lineWidth: a,
    lineType: p,
    colorBorder: c,
    borderRadius: u,
    motionDurationMid: x,
    colorBgContainerDisabled: l,
    colorTextDisabled: g,
    colorTextPlaceholder: E,
    controlHeightLG: C,
    fontSizeLG: b,
    controlHeightSM: $,
    paddingInlineSM: h,
    paddingXS: v,
    marginXS: m,
    colorTextDescription: w,
    lineWidthBold: z,
    colorPrimary: q,
    motionDurationSlow: S,
    zIndexPopup: T,
    paddingXXS: y,
    paddingSM: R,
    textHeight: G,
    cellActiveWithRangeBg: X,
    colorPrimaryBorder: P,
    sizePopupArrow: Y,
    colorBgElevated: A,
    borderRadiusLG: N,
    boxShadowSecondary: F,
    borderRadiusSM: Q,
    colorSplit: f,
    cellHoverBg: s,
    presetsWidth: k,
    presetsMaxWidth: O,
    boxShadowPopoverArrow: H,
    colorTextQuaternary: W,
    fontHeight: I,
    fontHeightLG: B,
    lineHeightLG: j
  } = n;
  return [
    {
      [e]: Object.assign(Object.assign(Object.assign({}, ee(n)), U(n, i, I, o)), {
        position: "relative",
        display: "inline-flex",
        alignItems: "center",
        background: d,
        lineHeight: 1,
        border: `${t(a)} ${p} ${c}`,
        borderRadius: u,
        transition: `border ${x}, box-shadow ${x}`,
        "&:hover": Object.assign({}, ie(n)),
        [`&-focused${e}`]: Object.assign({}, V(n)),
        [`&${e}-disabled`]: {
          background: l,
          borderColor: c,
          cursor: "not-allowed",
          [`${e}-suffix`]: {
            color: W
          }
        },
        [`&${e}-borderless`]: {
          backgroundColor: "transparent !important",
          borderColor: "transparent !important",
          boxShadow: "none !important"
        },
        // ======================== Input =========================
        [`${e}-input`]: {
          position: "relative",
          display: "inline-flex",
          alignItems: "center",
          width: "100%",
          "> input": Object.assign(Object.assign({}, ae(n)), {
            flex: "auto",
            // Fix Firefox flex not correct:
            // https://github.com/ant-design/ant-design/pull/20023#issuecomment-564389553
            minWidth: 1,
            height: "auto",
            padding: 0,
            background: "transparent",
            border: 0,
            borderRadius: 0,
            fontFamily: "inherit",
            "&:focus": {
              boxShadow: "none"
            },
            "&[disabled]": {
              background: "transparent"
            }
          }),
          "&:hover": {
            [`${e}-clear`]: {
              opacity: 1
            }
          },
          "&-placeholder": {
            "> input": {
              color: E
            }
          }
        },
        // Size
        "&-large": Object.assign(Object.assign({}, U(n, C, B, o)), {
          [`${e}-input > input`]: {
            fontSize: b,
            lineHeight: j
          }
        }),
        "&-small": Object.assign({}, U(n, $, I, h)),
        [`${e}-suffix`]: {
          display: "flex",
          flex: "none",
          alignSelf: "center",
          marginInlineStart: n.calc(v).div(2).equal(),
          color: g,
          lineHeight: 1,
          pointerEvents: "none",
          "> *": {
            verticalAlign: "top",
            "&:not(:last-child)": {
              marginInlineEnd: m
            }
          }
        },
        [`${e}-clear`]: {
          position: "absolute",
          top: "50%",
          insetInlineEnd: 0,
          color: g,
          lineHeight: 1,
          background: d,
          transform: "translateY(-50%)",
          cursor: "pointer",
          opacity: 0,
          transition: `opacity ${x}, color ${x}`,
          "> *": {
            verticalAlign: "top"
          },
          "&:hover": {
            color: w
          }
        },
        [`${e}-separator`]: {
          position: "relative",
          display: "inline-block",
          width: "1em",
          height: b,
          color: g,
          fontSize: b,
          verticalAlign: "top",
          cursor: "default",
          [`${e}-focused &`]: {
            color: w
          },
          [`${e}-range-separator &`]: {
            [`${e}-disabled &`]: {
              cursor: "not-allowed"
            }
          }
        },
        // ======================== Range =========================
        "&-range": {
          position: "relative",
          display: "inline-flex",
          // Clear
          [`${e}-clear`]: {
            insetInlineEnd: o
          },
          "&:hover": {
            [`${e}-clear`]: {
              opacity: 1
            }
          },
          // Active bar
          [`${e}-active-bar`]: {
            bottom: n.calc(a).mul(-1).equal(),
            height: z,
            marginInlineStart: o,
            background: q,
            opacity: 0,
            transition: `all ${S} ease-out`,
            pointerEvents: "none"
          },
          [`&${e}-focused`]: {
            [`${e}-active-bar`]: {
              opacity: 1
            }
          },
          [`${e}-range-separator`]: {
            alignItems: "center",
            padding: `0 ${t(v)}`,
            lineHeight: 1
          },
          [`&${e}-small`]: {
            [`${e}-clear`]: {
              insetInlineEnd: h
            },
            [`${e}-active-bar`]: {
              marginInlineStart: h
            }
          }
        },
        // ======================= Dropdown =======================
        "&-dropdown": Object.assign(Object.assign(Object.assign({}, ee(n)), ve(n)), {
          position: "absolute",
          // Fix incorrect position of picker popup
          // https://github.com/ant-design/ant-design/issues/35590
          top: -9999,
          left: {
            _skip_check_: !0,
            value: -9999
          },
          zIndex: T,
          [`&${e}-dropdown-hidden`]: {
            display: "none"
          },
          [`&${e}-dropdown-placement-bottomLeft`]: {
            [`${e}-range-arrow`]: {
              top: 0,
              display: "block",
              transform: "translateY(-100%)"
            }
          },
          [`&${e}-dropdown-placement-topLeft`]: {
            [`${e}-range-arrow`]: {
              bottom: 0,
              display: "block",
              transform: "translateY(100%) rotate(180deg)"
            }
          },
          [`&${r}-slide-up-enter${r}-slide-up-enter-active${e}-dropdown-placement-topLeft,
          &${r}-slide-up-enter${r}-slide-up-enter-active${e}-dropdown-placement-topRight,
          &${r}-slide-up-appear${r}-slide-up-appear-active${e}-dropdown-placement-topLeft,
          &${r}-slide-up-appear${r}-slide-up-appear-active${e}-dropdown-placement-topRight`]: {
            animationName: ce
          },
          [`&${r}-slide-up-enter${r}-slide-up-enter-active${e}-dropdown-placement-bottomLeft,
          &${r}-slide-up-enter${r}-slide-up-enter-active${e}-dropdown-placement-bottomRight,
          &${r}-slide-up-appear${r}-slide-up-appear-active${e}-dropdown-placement-bottomLeft,
          &${r}-slide-up-appear${r}-slide-up-appear-active${e}-dropdown-placement-bottomRight`]: {
            animationName: se
          },
          [`&${r}-slide-up-leave${r}-slide-up-leave-active${e}-dropdown-placement-topLeft,
          &${r}-slide-up-leave${r}-slide-up-leave-active${e}-dropdown-placement-topRight`]: {
            animationName: ge
          },
          [`&${r}-slide-up-leave${r}-slide-up-leave-active${e}-dropdown-placement-bottomLeft,
          &${r}-slide-up-leave${r}-slide-up-leave-active${e}-dropdown-placement-bottomRight`]: {
            animationName: pe
          },
          // Time picker with additional style
          [`${e}-panel > ${e}-time-panel`]: {
            paddingTop: y
          },
          // ======================== Ranges ========================
          [`${e}-ranges`]: {
            marginBottom: 0,
            padding: `${t(y)} ${t(R)}`,
            overflow: "hidden",
            lineHeight: t(n.calc(G).sub(n.calc(a).mul(2)).sub(n.calc(v).div(2)).equal()),
            textAlign: "start",
            listStyle: "none",
            display: "flex",
            justifyContent: "space-between",
            "> li": {
              display: "inline-block"
            },
            // https://github.com/ant-design/ant-design/issues/23687
            [`${e}-preset > ${r}-tag-blue`]: {
              color: q,
              background: X,
              borderColor: P,
              cursor: "pointer"
            },
            [`${e}-ok`]: {
              marginInlineStart: "auto"
            }
          },
          [`${e}-range-wrapper`]: {
            display: "flex",
            position: "relative"
          },
          [`${e}-range-arrow`]: Object.assign({
            position: "absolute",
            zIndex: 1,
            display: "none",
            marginInlineStart: n.calc(o).mul(1.5).equal(),
            transition: `left ${S} ease-out`
          }, ue(n, A, H)),
          [`${e}-panel-container`]: {
            overflow: "hidden",
            verticalAlign: "top",
            background: A,
            borderRadius: N,
            boxShadow: F,
            transition: `margin ${S}`,
            // ======================== Layout ========================
            [`${e}-panel-layout`]: {
              display: "flex",
              flexWrap: "nowrap",
              alignItems: "stretch"
            },
            // ======================== Preset ========================
            [`${e}-presets`]: {
              display: "flex",
              flexDirection: "column",
              minWidth: k,
              maxWidth: O,
              ul: {
                height: 0,
                flex: "auto",
                listStyle: "none",
                overflow: "auto",
                margin: 0,
                padding: v,
                borderInlineEnd: `${t(a)} ${p} ${f}`,
                li: Object.assign(Object.assign({}, le), {
                  borderRadius: Q,
                  paddingInline: v,
                  paddingBlock: n.calc($).sub(I).div(2).equal(),
                  cursor: "pointer",
                  transition: `all ${S}`,
                  "+ li": {
                    marginTop: m
                  },
                  "&:hover": {
                    background: s
                  }
                })
              }
            },
            // ======================== Panels ========================
            [`${e}-panels`]: {
              display: "inline-flex",
              flexWrap: "nowrap",
              direction: "ltr",
              [`${e}-panel`]: {
                borderWidth: `0 0 ${t(a)}`
              },
              "&:last-child": {
                [`${e}-panel`]: {
                  borderWidth: 0
                }
              }
            },
            [`${e}-panel`]: {
              verticalAlign: "top",
              background: "transparent",
              borderRadius: 0,
              borderWidth: 0,
              [`${e}-content,
            table`]: {
                textAlign: "center"
              },
              "&-focused": {
                borderColor: c
              }
            }
          }
        }),
        "&-dropdown-range": {
          padding: `${t(n.calc(Y).mul(2).div(3).equal())} 0`,
          "&-hidden": {
            display: "none"
          }
        },
        "&-rtl": {
          direction: "rtl",
          [`${e}-separator`]: {
            transform: "rotate(180deg)"
          },
          [`${e}-footer`]: {
            "&-extra": {
              direction: "rtl"
            }
          }
        }
      })
    },
    // Follow code may reuse in other components
    ne(n, "slide-up"),
    ne(n, "slide-down"),
    re(n, "move-up"),
    re(n, "move-down")
  ];
}, we = (n) => {
  const {
    componentCls: e,
    controlHeightLG: r,
    paddingXXS: i,
    padding: o
  } = n;
  return {
    pickerCellCls: `${e}-cell`,
    pickerCellInnerCls: `${e}-cell-inner`,
    pickerYearMonthCellWidth: n.calc(r).mul(1.5).equal(),
    pickerQuarterPanelContentHeight: n.calc(r).mul(1.4).equal(),
    pickerCellPaddingVertical: n.calc(i).add(n.calc(i).div(2)).equal(),
    pickerCellBorderGap: 2,
    // Magic for gap between cells
    pickerControlIconSize: 7,
    pickerControlIconMargin: 4,
    pickerControlIconBorderWidth: 1.5,
    pickerDatePanelPaddingHorizontal: n.calc(o).add(n.calc(i).div(2)).equal()
    // 18 in normal
  };
}, Se = (n) => ({
  cellHoverBg: n.controlItemBgHover,
  cellActiveWithRangeBg: n.controlItemBgActive,
  cellHoverWithRangeBg: new M(n.colorPrimary).lighten(35).toHexString(),
  cellRangeBorderColor: new M(n.colorPrimary).lighten(20).toHexString(),
  cellBgDisabled: n.colorBgContainerDisabled,
  timeColumnWidth: n.controlHeightLG * 1.4,
  timeColumnHeight: 28 * 8,
  timeCellHeight: 28,
  cellWidth: n.controlHeightSM * 1.5,
  cellHeight: n.controlHeightSM,
  textHeight: n.controlHeightLG,
  withoutTimeCellHeight: n.controlHeightLG * 1.65
}), Ie = (n) => Object.assign(Object.assign(Object.assign(Object.assign({}, oe(n)), Se(n)), be(n)), {
  presetsWidth: 120,
  presetsMaxWidth: 200,
  zIndexPopup: n.zIndexPopupBase + 50
}), Ye = $e("DatePicker", (n) => {
  const e = J(te(n), we(n));
  return [
    fe(e),
    me(e),
    // =====================================================
    // ==             Space Compact                       ==
    // =====================================================
    de(n, {
      focusElCls: `${n.componentCls}-focused`
    })
  ];
}, Ie);
export {
  Ye as default,
  ve as genPanelStyle,
  Se as initPanelComponentToken,
  we as initPickerPanelToken,
  Ie as prepareComponentToken
};
