// Divi dependencies.
import { ModuleEditProps } from '@divi/module-library';
import {
	InternalAttrs,
	FormatBreakpointStateAttr,
	type Element,
} 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 = {
	paginationBackgroundColor?: FormatBreakpointStateAttr<AttrVal>;
	paginationBorder?: FormatBreakpointStateAttr<BorderValue>;
	paginationPadding?: FormatBreakpointStateAttr<SpacingValue>;
	itemsTypography?: FormatBreakpointStateAttr<TypographyValue>;
	itemsNormalColor?: FormatBreakpointStateAttr<AttrVal>;
	itemsNormalBgColor?: FormatBreakpointStateAttr<AttrVal>;
	itemsHoverColor?: FormatBreakpointStateAttr<AttrVal>;
	itemsHoverBgColor?: FormatBreakpointStateAttr<AttrVal>;
	itemsHoverBorderColor?: FormatBreakpointStateAttr<AttrVal>;
	itemsActiveColor?: FormatBreakpointStateAttr<AttrVal>;
	itemsActiveBgColor?: FormatBreakpointStateAttr<AttrVal>;
	itemsActiveBorderColor?: FormatBreakpointStateAttr<AttrVal>;
	itemsDotsColor?: FormatBreakpointStateAttr<AttrVal>;
	itemsDotsBgColor?: FormatBreakpointStateAttr<AttrVal>;
	itemsDotsBorderColor?: FormatBreakpointStateAttr<AttrVal>;
	itemsPadding?: FormatBreakpointStateAttr<SpacingValue>;
	itemsHorizontalGap?: FormatBreakpointStateAttr<AttrVal>;
	itemsVerticalGap?: FormatBreakpointStateAttr<AttrVal>;
	itemsBorder?: FormatBreakpointStateAttr<BorderValue>;
	itemsAlignment?: FormatBreakpointStateAttr<AttrVal>;
	loadMoreTypography?: FormatBreakpointStateAttr<TypographyValue>;
	loadMoreNormalColor?: FormatBreakpointStateAttr<AttrVal>;
	loadMoreNormalBgColor?: FormatBreakpointStateAttr<AttrVal>;
	loadMoreHoverColor?: FormatBreakpointStateAttr<AttrVal>;
	loadMoreHoverBgColor?: FormatBreakpointStateAttr<AttrVal>;
	loadMoreHoverBorderColor?: FormatBreakpointStateAttr<AttrVal>;
	loadMoreSpacing?: FormatBreakpointStateAttr<SpacingValue>;
	loadMoreMargin?: FormatBreakpointStateAttr<SpacingValue>;
	loadMorePadding?: FormatBreakpointStateAttr<SpacingValue>;
	loadMoreBorder?: FormatBreakpointStateAttr<BorderValue>;
	loadMorePosition?: FormatBreakpointStateAttr<AttrVal>;
};

export interface PaginationAttrs 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 PaginationEditProps = ModuleEditProps<PaginationAttrs>;
