import { AXPThemeMode, AXPThemeLayoutSetting } from './acorex-platform-themes-shared.mjs';
import { AXPWidgetsCatalog } from '@acorex/platform/layout/widget-core';
import { objectKeyValueTransforms, AXPPlatformScope } from '@acorex/platform/core';
import { AXTranslationService } from '@acorex/core/translation';

class AXPThemeSettingProvider {
    constructor(injector) {
        this.injector = injector;
        this.translateService = this.injector.get(AXTranslationService);
    }
    async provide(context) {
        const trans = async (key) => await this.translateService.translateAsync(`@layout:settings.appearance.${key}`);
        // Define the 'Appearance Settings' group
        context.addGroup('appearance', await trans('title'), await trans('description'), 'fa-light fa-palette')
            // Add the 'Brightness & Color' section
            .addSection('color', await trans('items.color.title'), await trans('items.color.description'))
            // Add the 'Theme Mode' setting
            .addSetting({
            key: AXPThemeLayoutSetting.Mode,
            title: await trans('items.color.mode.title'),
            scope: AXPPlatformScope.User,
            isInherited: true,
            defaultValue: AXPThemeMode.Light,
            valueTransforms: objectKeyValueTransforms('id'),
            widget: {
                type: AXPWidgetsCatalog.themeModeChooser,
                layout: {
                    positions: {
                        sm: {
                            colSpan: 12,
                        },
                        md: {
                            colSpan: 6,
                        },
                    },
                },
            },
            description: await trans('items.color.mode.description'),
        })
            .addSetting({
            key: AXPThemeLayoutSetting.Palette,
            title: await trans('items.color.palette.title'),
            scope: AXPPlatformScope.User,
            isInherited: true,
            defaultValue: 'default',
            valueTransforms: objectKeyValueTransforms('name'),
            widget: {
                type: AXPWidgetsCatalog.themePaletteChooser,
                layout: {
                    positions: {
                        sm: {
                            colSpan: 12,
                        },
                        xxl: {
                            colSpan: 9,
                        },
                    },
                },
            },
            description: await trans('items.color.palette.description'),
        })
            // End the 'Brightness & Color' section
            .endSection()
            // Add the 'Root Menu' section
            .addSection('root-menu', await trans('items.root-menu.title'), await trans('items.root-menu.description'))
            // Add the 'Menu Orientation' setting
            .addSetting({
            key: AXPThemeLayoutSetting.MenuOrientation,
            title: await trans('items.root-menu.title'),
            scope: AXPPlatformScope.User,
            isInherited: true,
            defaultValue: 'vertical',
            valueTransforms: objectKeyValueTransforms('id'),
            widget: {
                type: AXPWidgetsCatalog.menuOrientationChooser,
                layout: {
                    positions: {
                        sm: {
                            colSpan: 12,
                        },
                        md: {
                            colSpan: 6,
                        },
                    },
                },
            },
            description: await trans('items.root-menu.description'),
        })
            // Add the 'Menu Badge Visibility' setting
            .addSetting({
            key: AXPThemeLayoutSetting.MenuBadgeVisible,
            title: await trans('items.root-menu.badge.title'),
            scope: AXPPlatformScope.User,
            isInherited: true,
            defaultValue: true,
            widget: {
                type: AXPWidgetsCatalog.toggle,
                layout: {
                    positions: {
                        sm: {
                            colSpan: 12,
                        },
                        md: {
                            colSpan: 6,
                        },
                    },
                },
            },
            description: await trans('items.root-menu.badge.description'),
        })
            .endSection()
            // Add the 'Scale & Layout' section
            .addSection('layout', await trans('items.layout.title'), await trans('items.layout.description'))
            // Add the 'Font Style' setting
            .addSetting({
            key: AXPThemeLayoutSetting.Font,
            title: await trans('items.layout.font.title'),
            scope: AXPPlatformScope.User,
            isInherited: true,
            defaultValue: 'system-ui',
            valueTransforms: objectKeyValueTransforms('id'),
            widget: {
                type: AXPWidgetsCatalog.fontStyleChooser,
                layout: {
                    positions: {
                        sm: {
                            colSpan: 12,
                        },
                        md: {
                            colSpan: 6,
                        },
                    },
                },
            },
            description: await trans('items.layout.font.description'),
        })
            // Add the 'Font Size' setting
            .addSetting({
            key: AXPThemeLayoutSetting.FontSize,
            title: await trans('items.layout.size.title'),
            scope: AXPPlatformScope.User,
            isInherited: true,
            defaultValue: 'medium',
            valueTransforms: objectKeyValueTransforms('id'),
            widget: {
                type: AXPWidgetsCatalog.fontSizeChooser,
                layout: {
                    positions: {
                        sm: {
                            colSpan: 12,
                        },
                        md: {
                            colSpan: 6,
                        },
                    },
                },
            },
            description: await trans('items.layout.size.description'),
        })
            // End the 'Scale & Layout' section
            .endSection()
            // End the 'Appearance Settings' group
            .endGroup();
    }
}

export { AXPThemeSettingProvider };
//# sourceMappingURL=acorex-platform-themes-shared-settings.provider-DSs1o1M6.mjs.map
