// Divi dependencies.
import { ModuleEditProps } from '@divi/module-library';
import {
	FormatBreakpointStateAttr,
	InternalAttrs,
	type Element,
} from '@divi/types';
import type {
	AttrVal,
	BorderValue,
	SpacingValue,
	TypographyValue,
} from '../custom-types';

type BaseDecoration = Element.Decoration.PickedAttributes<
	| 'animation'
	| 'background'
	| 'border'
	| 'boxShadow'
	| 'disabledOn'
	| 'filters'
	| 'overflow'
	| 'position'
	| 'scroll'
	| 'sizing'
	| 'spacing'
	| 'sticky'
	| 'transform'
	| 'transition'
	| 'zIndex'
>;

type DecorationExtras = {
	captionBgColor?: FormatBreakpointStateAttr<AttrVal>;
	captionTextColor?: FormatBreakpointStateAttr<AttrVal>;
	captionTypography?: FormatBreakpointStateAttr<TypographyValue>;
	captionSpacing?: FormatBreakpointStateAttr<SpacingValue>;
	captionBorder?: FormatBreakpointStateAttr<BorderValue>;
	captionGap?: FormatBreakpointStateAttr<AttrVal>;
	navWidth?: FormatBreakpointStateAttr<AttrVal>;
	navHeight?: FormatBreakpointStateAttr<AttrVal>;
	navSize?: FormatBreakpointStateAttr<AttrVal>;
	navBorder?: FormatBreakpointStateAttr<BorderValue>;
	navBorderNext?: FormatBreakpointStateAttr<BorderValue>;
	navColor?: FormatBreakpointStateAttr<AttrVal>;
	navBackgroundColor?: FormatBreakpointStateAttr<AttrVal>;
	navColorHover?: FormatBreakpointStateAttr<AttrVal>;
	navBackgroundColorHover?: FormatBreakpointStateAttr<AttrVal>;
	navBorderColorHover?: FormatBreakpointStateAttr<AttrVal>;
	weekBgColor?: FormatBreakpointStateAttr<AttrVal>;
	weekTextColor?: FormatBreakpointStateAttr<AttrVal>;
	weekTypography?: FormatBreakpointStateAttr<TypographyValue>;
	weekPadding?: FormatBreakpointStateAttr<SpacingValue>;
	weekBorderWidth?: FormatBreakpointStateAttr<AttrVal>;
	weekBorderColor?: FormatBreakpointStateAttr<AttrVal>;
	weekBorderColorFirst?: FormatBreakpointStateAttr<AttrVal>;
	weekBorderColorLast?: FormatBreakpointStateAttr<AttrVal>;
	dayBgColor?: FormatBreakpointStateAttr<AttrVal>;
	dayPadding?: FormatBreakpointStateAttr<SpacingValue>;
	dayMinHeight?: FormatBreakpointStateAttr<AttrVal>;
	dayEventsGap?: FormatBreakpointStateAttr<AttrVal>;
	dayBorderWidth?: FormatBreakpointStateAttr<AttrVal>;
	dayBorderColor?: FormatBreakpointStateAttr<AttrVal>;
	dayLabelColor?: FormatBreakpointStateAttr<AttrVal>;
	dayLabelBgColor?: FormatBreakpointStateAttr<AttrVal>;
	dayLabelColorHasEvents?: FormatBreakpointStateAttr<AttrVal>;
	dayLabelBgColorHasEvents?: FormatBreakpointStateAttr<AttrVal>;
	dayLabelTypography?: FormatBreakpointStateAttr<TypographyValue>;
	dayLabelAlignment?: FormatBreakpointStateAttr<AttrVal>;
	dayLabelTextAlignment?: FormatBreakpointStateAttr<AttrVal>;
	dayLabelWidth?: FormatBreakpointStateAttr<AttrVal>;
	dayLabelHeight?: FormatBreakpointStateAttr<AttrVal>;
	dayLabelBorder?: FormatBreakpointStateAttr<BorderValue>;
	dayLabelSpacing?: FormatBreakpointStateAttr<SpacingValue>;
	currentDayBgColor?: FormatBreakpointStateAttr<AttrVal>;
	currentDayLabelColor?: FormatBreakpointStateAttr<AttrVal>;
	currentDayLabelBgColor?: FormatBreakpointStateAttr<AttrVal>;
	currentDayLabelBorderColor?: FormatBreakpointStateAttr<AttrVal>;
	dayOpacity?: FormatBreakpointStateAttr<AttrVal>;
	dayBgColorDisabled?: FormatBreakpointStateAttr<AttrVal>;
	dayBorderColorDisabled?: FormatBreakpointStateAttr<AttrVal>;
	dayLabelColorDisabled?: FormatBreakpointStateAttr<AttrVal>;
	dayLabelBgColorDisabled?: FormatBreakpointStateAttr<AttrVal>;
	dayLabelBorderColorDisabled?: FormatBreakpointStateAttr<AttrVal>;
	mobileTriggerColor?: FormatBreakpointStateAttr<AttrVal>;
	mobileTriggerColorActive?: FormatBreakpointStateAttr<AttrVal>;
	mobileTriggerWidth?: FormatBreakpointStateAttr<AttrVal>;
	mobileTriggerHeight?: FormatBreakpointStateAttr<AttrVal>;
	mobileTriggerAlignment?: FormatBreakpointStateAttr<AttrVal>;
	mobileTriggerBorder?: FormatBreakpointStateAttr<BorderValue>;
	mobileTriggerSpacing?: FormatBreakpointStateAttr<SpacingValue>;
	mobileEventSpacing?: FormatBreakpointStateAttr<SpacingValue>;
};

export interface ListingCalendarAttrs extends InternalAttrs {
	module?: {
		meta?: Element.Meta.Attributes;
		advanced?: {
			link?: Element.Advanced.Link.Attributes;
			htmlAttributes?: Element.Advanced.IdClasses.Attributes;
			text?: Element.Advanced.Text.Attributes;
		};
		decoration?: BaseDecoration & DecorationExtras;
	};

	[key: string]: any;
}

export type ListingCalendarEditProps = ModuleEditProps<ListingCalendarAttrs>;
