import { AXPWidgetsCatalog } from '@acorex/platform/layout/widget-core';
import { AXPSessionService } from '@acorex/platform/auth';
import { AXTranslationService } from '@acorex/core/translation';
import { objectKeyValueTransforms } from '@acorex/platform/core';

const path = 'organization:';
var AXPOrganizationSetting;
(function (AXPOrganizationSetting) {
    AXPOrganizationSetting["OrganizationName"] = "organization:organization-name";
    AXPOrganizationSetting["OrganizationID"] = "organization:organization-id";
    AXPOrganizationSetting["ContactEmail"] = "organization:contact-email";
    AXPOrganizationSetting["ContactPhone"] = "organization:contact-phone";
    AXPOrganizationSetting["OrganizationAddress"] = "organization:organization-address";
    AXPOrganizationSetting["OrganizationCity"] = "organization:organization-city";
    AXPOrganizationSetting["OrganizationCountry"] = "organization:organization-country";
    AXPOrganizationSetting["BrandingColor"] = "organization:branding-color";
    AXPOrganizationSetting["BrandingLogo"] = "organization:branding-logo";
    AXPOrganizationSetting["CopyrightText"] = "organization:copyright-text";
    AXPOrganizationSetting["ApplicationHeaderTitle"] = "organization:application-header-title";
    AXPOrganizationSetting["SupportEmail"] = "organization:support-email";
    AXPOrganizationSetting["InfoEmail"] = "organization:info-email";
    AXPOrganizationSetting["FaxNumber"] = "organization:fax-number";
    AXPOrganizationSetting["Relations"] = "organization:relations";
})(AXPOrganizationSetting || (AXPOrganizationSetting = {}));

class AXMSettingProvider {
    constructor(injector) {
        this.injector = injector;
        this.translateService = this.injector.get(AXTranslationService);
        this.sessionService = this.injector.get(AXPSessionService);
    }
    async provide(context) {
        const trans = async (key) => await this.translateService.translateAsync(`settings.${key}`, { scope: 'organization-management' });
        context
            .addGroup('organization-settings', await trans('organization-settings.title'), await trans('organization-settings.description'), 'fa-light fa-building')
            // Branding Section
            .addSection('branding', await trans('branding.title'), await trans('branding.description'))
            .addSetting({
            key: AXPOrganizationSetting.OrganizationName,
            title: await trans('branding-name.title'),
            scope: 'T',
            isInherited: false,
            defaultValue: this.sessionService.tenant?.title,
            widget: {
                type: AXPWidgetsCatalog.text,
            },
            description: await trans('branding-name.description'),
        })
            .addSetting({
            key: AXPOrganizationSetting.BrandingLogo,
            title: await trans('branding-logo.title'),
            scope: 'T',
            isInherited: false,
            defaultValue: '',
            widget: {
                type: AXPWidgetsCatalog.avatar,
                options: {
                    fileTypes: ['image/png', 'image/jpeg'],
                },
            },
            description: await trans('branding-logo.description'),
        })
            .addSetting({
            key: AXPOrganizationSetting.CopyrightText,
            title: await trans('branding-copyright.title'),
            scope: 'T',
            isInherited: true,
            defaultValue: '© 2025 Your Company',
            widget: {
                type: AXPWidgetsCatalog.text,
            },
            description: await trans('branding-copyright.description'),
        })
            .endSection()
            // Contact Details Section
            .addSection('contact', 'Contact Details', 'Set company contact information.')
            .addSetting({
            key: AXPOrganizationSetting.ContactEmail,
            title: 'Company Email',
            scope: 'T',
            isInherited: false,
            defaultValue: '',
            widget: {
                type: AXPWidgetsCatalog.contact,
                options: {
                    type: 'email',
                    hasLabel: false,
                }
            },
            description: 'Primary email address for the company.',
        })
            .addSetting({
            key: AXPOrganizationSetting.SupportEmail,
            title: 'Support Email',
            scope: 'T',
            isInherited: false,
            defaultValue: '',
            widget: {
                type: AXPWidgetsCatalog.contact,
                options: {
                    type: 'email',
                    hasLabel: false,
                }
            },
            description: 'Support email address for customer inquiries.',
        })
            .addSetting({
            key: AXPOrganizationSetting.InfoEmail,
            title: 'Info Email',
            scope: 'T',
            isInherited: false,
            defaultValue: '',
            widget: {
                type: AXPWidgetsCatalog.contact,
                options: {
                    type: 'email',
                    hasLabel: false,
                }
            },
            description: 'General information email address.',
        })
            .addSetting({
            key: AXPOrganizationSetting.ContactPhone,
            title: 'Company Phone',
            scope: 'T',
            isInherited: false,
            defaultValue: '',
            widget: {
                type: AXPWidgetsCatalog.contact,
                options: {
                    type: 'phone',
                    hasLabel: false,
                }
            },
            description: 'Primary contact phone number.',
        })
            .addSetting({
            key: AXPOrganizationSetting.FaxNumber,
            title: 'Fax Number',
            scope: 'T',
            isInherited: false,
            defaultValue: '',
            widget: {
                type: AXPWidgetsCatalog.contact,
                options: {
                    type: 'phone',
                    hasLabel: false,
                }
            },
            description: 'Fax number for the company.',
        })
            .endSection()
            // Address Section
            .addSection('address', 'Address', 'Manage company address details.')
            .addSetting({
            key: AXPOrganizationSetting.OrganizationAddress,
            title: 'Street Address',
            scope: 'T',
            isInherited: false,
            defaultValue: '',
            widget: {
                type: AXPWidgetsCatalog.text,
            },
            description: 'Street address of the company.',
        })
            .addSetting({
            key: AXPOrganizationSetting.OrganizationCity,
            title: 'City',
            scope: 'T',
            isInherited: false,
            defaultValue: '',
            widget: {
                type: AXPWidgetsCatalog.text,
            },
            description: 'City where the company is located.',
        })
            .addSetting({
            key: AXPOrganizationSetting.OrganizationCountry,
            title: 'Country',
            scope: 'T',
            isInherited: false,
            valueTransforms: objectKeyValueTransforms('id'),
            widget: {
                type: AXPWidgetsCatalog.select,
                options: {
                    valueField: 'id',
                    textField: 'title',
                    dataSource: 'countries',
                },
            },
            description: 'Country where the company is based.',
        })
            .endSection()
            .endGroup();
    }
}

export { AXMSettingProvider };
//# sourceMappingURL=acorex-modules-organization-management-settings.provider-CYCe7NZ-.mjs.map
