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

import type {
	AttrVal,
	BorderValue,
	TypographyValue,
	SpacingValue,
} 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 = {
	filtersPosition?: FormatBreakpointStateAttr<AttrVal>;
	filtersSpaceBetweenHorizontal?: FormatBreakpointStateAttr<AttrVal>;
	filtersSpaceBetweenVertical?: FormatBreakpointStateAttr<AttrVal>;
	filtersListAlignment?: FormatBreakpointStateAttr<AttrVal>;

	itemTypography?: FormatBreakpointStateAttr<TypographyValue>;
	itemNormalColor?: FormatBreakpointStateAttr<AttrVal>;
	itemNormalBgColor?: FormatBreakpointStateAttr<AttrVal>;
	itemCheckedColor?: FormatBreakpointStateAttr<AttrVal>;
	itemCheckedBgColor?: FormatBreakpointStateAttr<AttrVal>;
	itemCheckedBorderColor?: FormatBreakpointStateAttr<AttrVal>;
	itemSpacing?: FormatBreakpointStateAttr<SpacingValue>;
	itemBorder?: FormatBreakpointStateAttr<BorderValue>;

	colorImageSize?: FormatBreakpointStateAttr<AttrVal>;
	colorImageLabelOffset?: FormatBreakpointStateAttr<AttrVal>;
	colorImageBorder?: FormatBreakpointStateAttr<BorderValue>;
	colorImageCheckedBorderColor?: FormatBreakpointStateAttr<AttrVal>;

	labelTypography?: FormatBreakpointStateAttr<TypographyValue>;
	labelAlignment?: FormatBreakpointStateAttr<AttrVal>;
	labelColor?: FormatBreakpointStateAttr<AttrVal>;
	labelSpacing?: FormatBreakpointStateAttr<SpacingValue>;

	applyNormalColor?: FormatBreakpointStateAttr<AttrVal>;
	applyNormalBgColor?: FormatBreakpointStateAttr<AttrVal>;
	applyHoverColor?: FormatBreakpointStateAttr<AttrVal>;
	applyHoverBgColor?: FormatBreakpointStateAttr<AttrVal>;
	applyHoverBorderColor?: FormatBreakpointStateAttr<AttrVal>;
	applyBorder?: FormatBreakpointStateAttr<BorderValue>;
	applySpacing?: FormatBreakpointStateAttr<SpacingValue>;
	applyAlignment?: FormatBreakpointStateAttr<AttrVal>;

	searchItemsWidth?: FormatBreakpointStateAttr<AttrVal>;
	searchItemsTypography?: FormatBreakpointStateAttr<TypographyValue>;
	searchItemsColor?: FormatBreakpointStateAttr<AttrVal>;
	searchItemsBackgroundColor?: FormatBreakpointStateAttr<AttrVal>;
	searchInputBorder?: FormatBreakpointStateAttr<BorderValue>;
	searchInputPadding?: FormatBreakpointStateAttr<SpacingValue>;
	searchInputMargin?: FormatBreakpointStateAttr<SpacingValue>;
	searchRemoveNormalColor?: FormatBreakpointStateAttr<AttrVal>;
	searchRemoveHoverColor?: FormatBreakpointStateAttr<AttrVal>;
	searchRemoveSize?: FormatBreakpointStateAttr<AttrVal>;
	searchRemoveRightOffset?: FormatBreakpointStateAttr<AttrVal>;
	moreLessButtonTypography?: FormatBreakpointStateAttr<TypographyValue>;
	moreLessButtonNormalColor?: FormatBreakpointStateAttr<AttrVal>;
	moreLessButtonNormalBackgroundColor?: FormatBreakpointStateAttr<AttrVal>;
	moreLessButtonHoverColor?: FormatBreakpointStateAttr<AttrVal>;
	moreLessButtonHoverBackgroundColor?: FormatBreakpointStateAttr<AttrVal>;
	moreLessButtonHoverBorderColor?: FormatBreakpointStateAttr<AttrVal>;
	moreLessButtonBorder?: FormatBreakpointStateAttr<BorderValue>;
	moreLessButtonPadding?: FormatBreakpointStateAttr<SpacingValue>;
	moreLessBackgroundColor?: FormatBreakpointStateAttr<AttrVal>;
	moreLessBorder?: FormatBreakpointStateAttr<BorderValue>;
	moreLessPadding?: FormatBreakpointStateAttr<SpacingValue>;
	moreLessButtonAlignment?: FormatBreakpointStateAttr<AttrVal>;
	dropdownWidth?: FormatBreakpointStateAttr<AttrVal>;
	dropdownLabelTypography?: FormatBreakpointStateAttr<TypographyValue>;
	dropdownLabelColor?: FormatBreakpointStateAttr<AttrVal>;
	dropdownLabelBackgroundColor?: FormatBreakpointStateAttr<AttrVal>;
	dropdownLabelBorder?: FormatBreakpointStateAttr<BorderValue>;
	dropdownLabelPadding?: FormatBreakpointStateAttr<SpacingValue>;
	dropdownActiveItemsOffset?: FormatBreakpointStateAttr<AttrVal>;
	dropdownActiveItemTypography?: FormatBreakpointStateAttr<TypographyValue>;
	dropdownActiveItemNormalColor?: FormatBreakpointStateAttr<AttrVal>;
	dropdownActiveItemNormalBackgroundColor?: FormatBreakpointStateAttr<AttrVal>;
	dropdownActiveItemHoverColor?: FormatBreakpointStateAttr<AttrVal>;
	dropdownActiveItemHoverBackgroundColor?: FormatBreakpointStateAttr<AttrVal>;
	dropdownActiveItemHoverBorderColor?: FormatBreakpointStateAttr<AttrVal>;
	dropdownActiveItemBorder?: FormatBreakpointStateAttr<BorderValue>;
	dropdownActiveItemPadding?: FormatBreakpointStateAttr<SpacingValue>;
	dropdownNSelectedTypography?: FormatBreakpointStateAttr<TypographyValue>;
	dropdownNSelectedColor?: FormatBreakpointStateAttr<AttrVal>;
	dropdownNSelectedMargin?: FormatBreakpointStateAttr<SpacingValue>;
	dropdownBodyOffset?: FormatBreakpointStateAttr<AttrVal>;
	dropdownBodyBorder?: FormatBreakpointStateAttr<BorderValue>;
	dropdownBodyBackgroundColor?: FormatBreakpointStateAttr<AttrVal>;
	dropdownBodyItemsPadding?: FormatBreakpointStateAttr<SpacingValue>;
	dropdownFooterBackgroundColor?: FormatBreakpointStateAttr<AttrVal>;
	dropdownFooterBorder?: FormatBreakpointStateAttr<BorderValue>;
	dropdownFooterMargin?: FormatBreakpointStateAttr<SpacingValue>;
	dropdownFooterPadding?: FormatBreakpointStateAttr<SpacingValue>;
	dropdownFooterAlignment?: FormatBreakpointStateAttr<AttrVal>;
	counterTypography?: FormatBreakpointStateAttr<TypographyValue>;
	counterColor?: FormatBreakpointStateAttr<AttrVal>;
	counterBgColor?: FormatBreakpointStateAttr<AttrVal>;
	counterSpacing?: FormatBreakpointStateAttr<SpacingValue>;
	counterBorder?: FormatBreakpointStateAttr<BorderValue>;
};

export interface ColorImageAttrs 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 ColorImageEditProps = ModuleEditProps<ColorImageAttrs>;
