// 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 = {
	popupPinSize?: FormatBreakpointStateAttr<AttrVal>;
	popupPinColor?: FormatBreakpointStateAttr<AttrVal>;
	popupPreloaderBgColor?: FormatBreakpointStateAttr<AttrVal>;
	popupPreloaderColor?: FormatBreakpointStateAttr<AttrVal>;
	popupPreloaderHeight?: FormatBreakpointStateAttr<AttrVal>;
	markerWidth?: FormatBreakpointStateAttr<AttrVal>;
	markerTypography?: FormatBreakpointStateAttr<TypographyValue>;
	markerIconSize?: FormatBreakpointStateAttr<AttrVal>;
	markerColor?: FormatBreakpointStateAttr<AttrVal>;
	markerBgColor?: FormatBreakpointStateAttr<AttrVal>;
	markerIconColor?: FormatBreakpointStateAttr<AttrVal>;
	markerColorHover?: FormatBreakpointStateAttr<AttrVal>;
	markerBgColorHover?: FormatBreakpointStateAttr<AttrVal>;
	markerIconColorHover?: FormatBreakpointStateAttr<AttrVal>;
	markerSpacing?: FormatBreakpointStateAttr<SpacingValue>;
	markerBorder?: FormatBreakpointStateAttr<BorderValue>;
	markerPinSize?: FormatBreakpointStateAttr<AttrVal>;
	markerAlignment?: FormatBreakpointStateAttr<AttrVal>;
	markerClusterTypography?: FormatBreakpointStateAttr<TypographyValue>;
	markerClusterTextColor?: FormatBreakpointStateAttr<AttrVal>;
	userLocationMarkerWidth?: FormatBreakpointStateAttr<AttrVal>;
	userLocationMarkerTypography?: FormatBreakpointStateAttr<TypographyValue>;
	userLocationMarkerIconSize?: FormatBreakpointStateAttr<AttrVal>;
	userLocationMarkerColor?: FormatBreakpointStateAttr<AttrVal>;
	userLocationMarkerBgColor?: FormatBreakpointStateAttr<AttrVal>;
	userLocationMarkerIconColor?: FormatBreakpointStateAttr<AttrVal>;
	userLocationMarkerColorHover?: FormatBreakpointStateAttr<AttrVal>;
	userLocationMarkerBgColorHover?: FormatBreakpointStateAttr<AttrVal>;
	userLocationMarkerIconColorHover?: FormatBreakpointStateAttr<AttrVal>;
	userLocationMarkerSpacing?: FormatBreakpointStateAttr<SpacingValue>;
	userLocationMarkerBorder?: FormatBreakpointStateAttr<BorderValue>;
	userLocationMarkerPinSize?: FormatBreakpointStateAttr<AttrVal>;
};

export interface MapsListingAttrs 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 MapsListingEditProps = ModuleEditProps<MapsListingAttrs>;
