import styled from "@emotion/styled";
import { popoverClasses } from "../../../Popover";
import { addFocus } from "../../../../mixins";
import { classes, innerTokens, tokens } from "../../Calendar.tokens";
import { addActive, addSelected, flexCenter } from "../../mixins";
const inRange = ()=>`
    &:before {
        content: '';
        z-index: -1;
        position: absolute;
        width: 100%;
        height: calc(100% - 0.125rem);
        background: var(${tokens.calendarRangeBackground});
    }
`;
const sideInRange = ()=>`
    &:before {
        content: '';
        z-index: -1;
        position: absolute;
        width: 0.75rem;
        height: calc(100% - 0.125rem);
        background: var(${tokens.calendarRangeBackground});
    }
`;
export const StyledItem = /*#__PURE__*/ styled("div", {
    target: "ex7f0pk0",
    label: "StyledItem"
})("border-radius:calc(var(", innerTokens.dateStructureBorderRadius, ") - 0.125rem);", String(flexCenter), ";&.", String(classes.inRange), "{", inRange(), ";}&.", String(classes.sideInRange), "{", sideInRange(), ";}&.", String(classes.sideLeft), "{&:before{left:", ({ offset })=>`${offset}px`, ";}}&.", String(classes.sideRight), "{&:before{right:", ({ offset })=>`${offset}px`, ";}}");
const disabledItem = ()=>`
    cursor: not-allowed;
    opacity: var(${tokens.calendarDisabledOpacity});
`;
const disabledCurrentItem = ()=>`
    ${disabledItem()};
`;
export const StyledItemRoot = /*#__PURE__*/ styled("div", {
    target: "ex7f0pk1",
    label: "StyledItemRoot"
})("font-family:var(", innerTokens.dateStructureFontFamily, ");font-size:var(", innerTokens.dateStructureFontSize, ");font-style:var(", innerTokens.dateStructureFontStyle, ");font-weight:var(", innerTokens.dateStructureFontWeight, ");letter-spacing:var(", innerTokens.dateStructureFontLetterSpacing, ");line-height:var(", innerTokens.dateStructureFontLineHeight, ");position:relative;box-sizing:border-box;border-radius:var(", innerTokens.dateStructureBorderRadius, ");", String(flexCenter), ";color:", ({ isDayInCurrentMonth })=>isDayInCurrentMonth ? `var(${tokens.calendarContentPrimaryColor})` : `var(${tokens.calendarContentSecondaryColor})`, ";&.", String(classes.selectableItem), "{", addSelected({
    minWidth: 'calc(100% - 0.125rem)',
    minHeight: 'calc(100% - 0.125rem)',
    selectedFontWeight: `var(${innerTokens.dateStructureSelectedFontWeight})`,
    selectedBackground: `var(${tokens.calendarSelectedItemBackground})`,
    selectedColor: `var(${tokens.calendarSelectedItemColor})`,
    selectableBackgroundHover: `var(${tokens.calendarSelectableItemBackgroundHover})`,
    currentBorderColor: `var(${tokens.calendarCurrentItemBorderColor})`,
    currentBorderWidth: `var(${tokens.calendarCurrentItemBorderWidth})`,
    activeBackground: `var(${tokens.calendarActiveItemBackground})`,
    activeColor: `var(${tokens.calendarActiveItemColor})`
}), ";", addFocus({
    outlineSize: '0.063rem',
    outlineOffset: '-0.125rem',
    outlineColor: `var(${tokens.calendarOutlineFocusColor})`,
    outlineRadius: `calc(var(${innerTokens.dateStructureBorderRadius}) + 0.125rem)`
}), ";&.", classes.currentItem, "{", addFocus({
    outlineSize: '0.063rem',
    outlineOffset: '-0.1875rem',
    outlineColor: `var(${tokens.calendarOutlineFocusColor})`,
    outlineRadius: `calc(var(${innerTokens.dateStructureBorderRadius}) + 0.125rem)`
}), ";}}&.", classes.dayInCurrentMonth, ":not(.", classes.disabled, "){", addActive({
    activeBackground: `var(${tokens.calendarActiveItemBackground})`,
    activeColor: `var(${tokens.calendarActiveItemColor})`,
    activeFontWeight: `var(${innerTokens.dateStructureSelectedFontWeight})`
}), ";}&.", classes.dayOfWeek, "{color:var(", tokens.calendarDayOfWeekColor, ");}&.", classes.disabled, "{color:", ({ isDayInCurrentMonth })=>isDayInCurrentMonth ? `var(${tokens.calendarContentPrimaryDisabledColor})` : `var(${tokens.calendarContentSecondaryDisabledColor})`, ";", disabledItem(), ";}&.", classes.disabledCurrent, "{color:", ({ isDayInCurrentMonth })=>isDayInCurrentMonth ? `var(${tokens.calendarContentPrimaryDisabledColor})` : `var(${tokens.calendarContentSecondaryDisabledColor})`, ";", disabledCurrentItem(), ";}&.", classes.currentItem, "{& > .", classes.inRange, ":before{width:calc(100% + 2px);height:100%;}& > .", classes.sideRight, ":before{width:100%;right:-1px;left:unset;}& > .", classes.sideLeft, ":before{width:100%;left:-1px;right:unset;}}& .", popoverClasses.wrapper, ".", popoverClasses.targetAsRef, "{z-index:-1;width:100%;}");
export const StyledEvents = /*#__PURE__*/ styled("div", {
    target: "ex7f0pk2",
    label: "StyledEvents"
})("display:flex;position:absolute;bottom:var(", tokens.calendarEventItemBottom, ",0.25rem);");
export const StyledEvent = /*#__PURE__*/ styled("div", {
    target: "ex7f0pk3",
    label: "StyledEvent"
})("margin:0 0.063rem;width:0.188rem;height:0.188rem;border-radius:50%;background-color:", ({ color = 'var(--plasma-colors-accent, var(--surface-accent))' })=>color, ";");
