import { AXPSettingService, createAllQueryView, AXPEntityCommandScope, AXPEntityQueryType, AXP_MENU_PROVIDER, AXP_MENU_MIDDLEWARE, AXPSearchCommandProvider } from '@acorex/platform/common';
import { AXPEntityService, AXMEntityCrudServiceImpl, entityDetailsCrudActions, AXP_ENTITY_DEFINITION_LOADER } from '@acorex/platform/layout/entity';
import { AXPAuthGuard } from '@acorex/platform/auth';
import { AXPRootLayoutComponent } from '@acorex/platform/themes/default';
import * as i0 from '@angular/core';
import { inject, Injector, Injectable, NgModule } from '@angular/core';
import { ROUTES } from '@angular/router';
import { AXPPlatformScope } from '@acorex/platform/core';
import { AXPWidgetsCatalog } from '@acorex/platform/layout/widget-core';

const config = {
    i18n: 'application-management',
    module: 'ApplicationManagement',
};
const RootConfig = {
    config,
    module: {
        route: 'application-management',
        name: config.module,
        title: `@${config.i18n}:module-name`,
        icon: 'fa-light fa-cogs',
    },
    entities: {
        application: {
            name: 'Application',
            title: `@${config.i18n}:application.individual-title`,
            titlePlural: `@${config.i18n}:application.plural-title`,
            icon: 'fa-light fa-cube',
        },
        module: {
            name: 'Module',
            title: `@${config.i18n}:module.individual-title`,
            titlePlural: `@${config.i18n}:module.plural-title`,
            icon: 'fa-light fa-puzzle-piece',
        },
        edition: {
            name: 'Edition',
            title: `@${config.i18n}:edition.individual-title`,
            titlePlural: `@${config.i18n}:edition.plural-title`,
            icon: 'fa-light fa-layer-group',
        },
        feature: {
            name: 'Feature',
            title: `@${config.i18n}:feature.individual-title`,
            titlePlural: `@${config.i18n}:feature.plural-title`,
            icon: 'fa-light fa-star',
        },
    },
};
// Keep the old export for backward compatibility
const AXMApplicationManagementModuleConst = {
    moduleName: 'ApplicationManagement',
    moduleRoute: 'application-management',
    i18n: 'platform-management',
};

class AXMEntityProvider {
    constructor() {
        this.injector = inject(Injector);
    }
    preload() {
        const module = RootConfig.module.name;
        return Array.from(Object.values(RootConfig.entities)).map((entity) => ({
            module: module,
            entity: entity.name,
        }));
    }
    async get(moduleName, entityName) {
        if (moduleName == RootConfig.module.name) {
            switch (entityName) {
                case RootConfig.entities.application.name: {
                    const entity = (await Promise.resolve().then(function () { return application_entity; })).applicationEntityFactory;
                    return entity(this.injector);
                }
                case RootConfig.entities.edition.name: {
                    const entity = (await Promise.resolve().then(function () { return edition_entity; })).editionEntityFactory;
                    return entity(this.injector);
                }
                case RootConfig.entities.module.name: {
                    const entity = (await Promise.resolve().then(function () { return module_entity; })).moduleEntityFactory;
                    return entity(this.injector);
                }
                case RootConfig.entities.feature.name: {
                    const entity = (await Promise.resolve().then(function () { return feature_entity; })).featureEntityFactory;
                    return entity(this.injector);
                }
            }
        }
        return null;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMEntityProvider, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
    static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMEntityProvider }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMEntityProvider, decorators: [{
            type: Injectable
        }] });

const AXPApplicationManagementMenuKeys = {
    Root: 'application-management:menu',
    Applications: 'application-management:menu:applications',
    Modules: 'application-management:menu:modules',
    Features: 'application-management:menu:features',
    Editions: 'application-management:menu:editions',
    UserMenuManagement: 'application-management:user:menus',
    TenantMenuManagement: 'application-management:tenant:menus',
};

class AXMApplicationManagmentModuleMenuProvider {
    constructor() {
        this.entityService = inject(AXPEntityService);
    }
    async provide(context) {
        const scope = RootConfig.config.i18n;
        const module = RootConfig.module;
        context.addItems([
            {
                priority: 9002,
                text: `@${scope}:module-name`,
                icon: module.icon,
                name: AXPApplicationManagementMenuKeys.Root,
                children: [
                    {
                        name: AXPApplicationManagementMenuKeys.Applications,
                        text: RootConfig.entities.application.title,
                        path: this.entityService.createPath(module.name, RootConfig.entities.application.name),
                        icon: RootConfig.entities.application.icon,
                        priority: 1,
                    },
                    // {
                    //   name: AXPApplicationManagementMenuKeys.Editions,
                    //   text: RootConfig.entities.edition.title,
                    //   path: this.entityService.createPath(module.name, RootConfig.entities.edition.name),
                    //   icon: RootConfig.entities.edition.icon,
                    //   priority: 2,
                    // },
                    {
                        name: AXPApplicationManagementMenuKeys.Modules,
                        text: RootConfig.entities.module.title,
                        path: this.entityService.createPath(module.name, RootConfig.entities.module.name),
                        icon: RootConfig.entities.module.icon,
                        priority: 2,
                    },
                    // {
                    //   name: AXPApplicationManagementMenuKeys.Features,
                    //   text: RootConfig.entities.feature.title,
                    //   path: this.entityService.createPath(module.name, RootConfig.entities.feature.name),
                    //   icon: RootConfig.entities.feature.icon,
                    //   priority: 4,
                    // },
                ],
            },
        ]);
        // Menu Management - User Scope (in user profile menu)
        context.find('user:profile').addItems([
            {
                name: AXPApplicationManagementMenuKeys.UserMenuManagement,
                text: `@${scope}:menu-management.user.title`,
                icon: 'fa-light fa-bars',
                path: `/app/application-management/menus/U`,
            },
        ]);
        // Menu Management - Tenant Scope (Admin only)
        context.addItems([
            {
                name: AXPApplicationManagementMenuKeys.TenantMenuManagement,
                priority: 10000001,
                text: `@${scope}:menu-management.tenant.title`,
                type: 'menu',
                icon: 'fa-light fa-bars',
                path: `/app/application-management/menus/T`,
                data: {
                    requiredPermission: 'admin',
                },
            },
        ]);
    }
}

//#region ----   Menu Customization Constants   ----
/**
 * Setting key for menu customizations
 */
const AXP_MENU_CUSTOMIZATION_KEY = 'axp.application-management.menu-customization';
/**
 * Current version of menu customization schema
 */
const AXP_MENU_CUSTOMIZATION_VERSION = '1.0.0';
/**
 * Default menu customization
 */
const AXP_MENU_CUSTOMIZATION_DEFAULT = {
    version: AXP_MENU_CUSTOMIZATION_VERSION,
    overrides: {},
    customItems: [],
};
/**
 * Menu management feature configuration
 */
const MenuManagementConfig = {
    route: 'menus',
    title: `@${RootConfig.config.i18n}:menu-management.title`,
    icon: 'fa-light fa-bars',
};
//#endregion

//#region ----   Custom Menu Middleware   ----
/**
 * Middleware that applies menu customizations using the enhanced context API
 * Applies user/tenant customizations from settings with priority support
 */
class AXPCustomMenuMiddleware {
    constructor() {
        //#region ----   Middleware Properties   ----
        this.name = 'menu-customization';
        this.priority = 100; // High priority to apply customizations early
        //#endregion
        //#region ----   Dependencies   ----
        this.settingService = inject(AXPSettingService);
        //#endregion
    }
    //#endregion
    //#region ----   Middleware Implementation   ----
    async process(context) {
        try {
            // Load menu customization from settings
            const customization = await this.loadCustomization();
            // Apply overrides to existing menu items using context API
            this.applyOverrides(context, customization);
            // Add custom menu items
            this.addCustomItems(context, customization);
            // Re-sort after applying priority overrides
            context.sort();
        }
        catch (error) {
            console.error('Error applying menu customizations:', error);
        }
    }
    //#endregion
    //#region ----   Private Methods   ----
    /**
     * Load menu customization from settings
     * Merges Tenant and User scope customizations (User overrides Tenant)
     */
    async loadCustomization() {
        try {
            // Load both scopes
            const tenantSettings = this.settingService.scope(AXPPlatformScope.Tenant);
            const userSettings = this.settingService.scope(AXPPlatformScope.User);
            const tenantCustomization = await tenantSettings.get(AXP_MENU_CUSTOMIZATION_KEY);
            const userCustomization = await userSettings.get(AXP_MENU_CUSTOMIZATION_KEY);
            // Merge customizations: Tenant as base, User overrides
            const merged = {
                version: userCustomization?.version || tenantCustomization?.version || AXP_MENU_CUSTOMIZATION_DEFAULT.version,
                overrides: {
                    ...(tenantCustomization?.overrides || {}),
                    ...(userCustomization?.overrides || {}), // User overrides win
                },
                customItems: [...(tenantCustomization?.customItems || []), ...(userCustomization?.customItems || [])],
            };
            // Return merged result or default if both are empty
            const hasCustomizations = Object.keys(merged.overrides).length > 0 || merged.customItems.length > 0;
            return hasCustomizations ? merged : AXP_MENU_CUSTOMIZATION_DEFAULT;
        }
        catch (error) {
            console.error('Failed to load menu customization:', error);
            return AXP_MENU_CUSTOMIZATION_DEFAULT;
        }
    }
    /**
     * Apply overrides to existing menu items using enhanced context API
     */
    applyOverrides(context, customization) {
        Object.entries(customization.overrides).forEach(([menuName, override]) => {
            const finder = context.findByName(menuName);
            if (!finder.exists()) {
                return;
            }
            // Hide menu item
            if (override.hidden) {
                finder.remove();
                return;
            }
            // Apply priority override
            if (override.priority !== undefined) {
                finder.setPriority(override.priority);
            }
            // Apply property overrides
            if (override.properties) {
                finder.update(override.properties);
            }
            // Move to different parent
            if (override.parentName !== undefined) {
                finder.moveTo(override.parentName);
            }
        });
    }
    /**
     * Add custom menu items using context API
     */
    addCustomItems(context, customization) {
        if (customization.customItems && customization.customItems.length > 0) {
            context.add(...customization.customItems);
        }
    }
}
//#endregion

class AXMApplicationService extends AXMEntityCrudServiceImpl {
}
class AXMApplicationServiceImpl extends AXMApplicationService {
    constructor() {
        super(`${RootConfig.module.name}.${RootConfig.entities.application.name}`);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMApplicationServiceImpl, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
    static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMApplicationServiceImpl }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMApplicationServiceImpl, decorators: [{
            type: Injectable
        }], ctorParameters: () => [] });

class AXMApplicationEntityModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMApplicationEntityModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.4", ngImport: i0, type: AXMApplicationEntityModule }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMApplicationEntityModule, providers: [
            {
                provide: AXMApplicationService,
                useClass: AXMApplicationServiceImpl,
            },
        ] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMApplicationEntityModule, decorators: [{
            type: NgModule,
            args: [{
                    declarations: [],
                    imports: [],
                    exports: [],
                    providers: [
                        {
                            provide: AXMApplicationService,
                            useClass: AXMApplicationServiceImpl,
                        },
                    ],
                }]
        }] });

async function applicationEntityFactory(injector) {
    const dataService = injector.get(AXMApplicationService);
    const i18n = RootConfig.config.i18n + ':application';
    const entityDef = {
        module: RootConfig.module.name,
        name: RootConfig.entities.application.name,
        icon: RootConfig.entities.application.icon,
        title: RootConfig.entities.application.title,
        plugins: [{ name: 'color', options: { colSpan: 12 } }, { name: 'avatar' }],
        formats: {
            individual: RootConfig.entities.application.title,
            plural: RootConfig.entities.application.titlePlural,
            searchResult: {
                title: '{{ title }}',
                description: RootConfig.module.title,
            },
        },
        relatedEntities: [
            {
                entity: `${RootConfig.module.name}.${RootConfig.entities.edition.name}`,
                title: `@${i18n}.edition-assignment`,
                conditions: [{ name: 'id', operator: { type: 'in' }, value: '{{ context.eval("editionIds") }}' }],
                actions: [...entityDetailsCrudActions('editionIds')],
                layout: { type: 'page-list', position: 'after', order: 1 },
                persistence: {
                    dataPath: 'editions',
                    strategy: 'referenced',
                    idField: 'editionIds',
                },
            },
        ],
        groups: [
            {
                id: 'basic-info',
                title: `@${i18n}.basic-info`,
            },
            {
                id: 'edition-assignment',
                title: `@${i18n}.edition-assignment`,
            },
        ],
        properties: [
            {
                name: 'title',
                title: `@${i18n}.title`,
                groupId: 'basic-info',
                options: {
                    sort: {
                        enabled: true,
                    },
                    filter: {
                        advance: {
                            enabled: true,
                        },
                        inline: {
                            enabled: false,
                        },
                    },
                },
                schema: {
                    dataType: 'string',
                    interface: {
                        type: AXPWidgetsCatalog.text,
                    },
                },
                validations: [
                    {
                        rule: 'required',
                    },
                ],
            },
            {
                name: 'description',
                title: `@${i18n}.description`,
                groupId: 'basic-info',
                options: {
                    sort: {
                        enabled: true,
                    },
                    filter: {
                        advance: {
                            enabled: true,
                        },
                        inline: {
                            enabled: false,
                        },
                    },
                },
                schema: {
                    dataType: 'string',
                    interface: {
                        type: AXPWidgetsCatalog.largeText,
                    },
                },
            },
            // {
            //   name: 'editionIds',
            //   groupId: 'edition-assignment',
            //   title: `@${i18n}.edition`,
            //   options: {
            //     sort: {
            //       enabled: true,
            //     },
            //     filter: {
            //       advance: {
            //         enabled: true,
            //       },
            //       inline: {
            //         enabled: true,
            //       },
            //     },
            //   },
            //   schema: {
            //     dataType: 'string',
            //     interface: {
            //       type: AXPWidgetsCatalog.lookup,
            //       options: {
            //         entity: `${RootConfig.module.name}.${RootConfig.entities.edition.name}`,
            //         multiple: true,
            //         textField: 'title',
            //         valueField: 'id',
            //         expose: [
            //           { source: 'id', target: 'editions.id' },
            //           { source: 'title', target: 'editions.title' },
            //         ],
            //       },
            //     },
            //   },
            //   validations: [
            //     {
            //       rule: 'required',
            //     },
            //   ],
            // },
        ],
        columns: [{ name: 'title' }, { name: 'description' }],
        commands: {
            create: {
                execute: async (data) => {
                    const res = await dataService.insertOne(data);
                    return { id: res };
                },
            },
            delete: {
                execute: async (id) => {
                    return await dataService.deleteOne(id);
                },
            },
            update: {
                execute: async (data) => {
                    return await dataService.updateOne(data.id, data);
                },
            },
        },
        queries: {
            byKey: {
                execute: async (id) => {
                    return await dataService.getOne(id);
                },
                type: AXPEntityQueryType.Single,
            },
            list: {
                execute: async (e) => {
                    return await dataService.query({ skip: e.skip, take: e.take, filter: e.filter });
                },
                type: AXPEntityQueryType.List,
            },
        },
        interfaces: {
            master: {
                create: {
                    sections: [
                        {
                            id: 'basic-info',
                        },
                    ],
                    properties: [
                        {
                            name: 'title',
                            layout: {
                                positions: {
                                    lg: {
                                        colSpan: 12,
                                        order: 1,
                                    },
                                },
                            },
                        },
                        {
                            name: 'description',
                            layout: {
                                positions: {
                                    lg: {
                                        colSpan: 12,
                                        order: 2,
                                    },
                                },
                            },
                        },
                    ],
                },
                update: {
                    sections: [
                        {
                            id: 'basic-info',
                        },
                    ],
                    properties: [
                        {
                            name: 'title',
                            layout: {
                                positions: {
                                    lg: {
                                        colSpan: 12,
                                        order: 1,
                                    },
                                },
                            },
                        },
                        {
                            name: 'description',
                            layout: {
                                positions: {
                                    lg: {
                                        colSpan: 12,
                                        order: 2,
                                    },
                                },
                            },
                        },
                    ],
                },
                single: {
                    title: '{{title}}',
                    sections: [
                        {
                            id: 'basic-info',
                            layout: {
                                positions: {
                                    lg: {
                                        colSpan: 12,
                                    },
                                },
                            },
                        },
                    ],
                    properties: [
                        {
                            name: 'title',
                            layout: {
                                positions: {
                                    lg: {
                                        colSpan: 12,
                                        order: 1,
                                    },
                                },
                            },
                        },
                        {
                            name: 'description',
                            layout: {
                                positions: {
                                    lg: {
                                        colSpan: 12,
                                        order: 2,
                                    },
                                },
                            },
                        },
                    ],
                    actions: [],
                },
                list: {
                    actions: [
                        {
                            title: `@general:create`,
                            command: 'create-entity',
                            priority: 'primary',
                            type: 'create',
                            scope: AXPEntityCommandScope.TypeLevel,
                        },
                        {
                            title: '@general:deleteItems',
                            command: 'delete-entity',
                            priority: 'primary',
                            type: 'delete',
                            scope: AXPEntityCommandScope.Selected,
                        },
                        {
                            title: '@general:detail',
                            command: 'open-entity',
                            priority: 'secondary',
                            type: 'view',
                            scope: AXPEntityCommandScope.Individual,
                        },
                        {
                            title: '@general:delete',
                            command: 'delete-entity',
                            priority: 'secondary',
                            type: 'delete',
                            scope: AXPEntityCommandScope.Individual,
                        },
                    ],
                    views: [
                        createAllQueryView({
                            sorts: [{ name: 'title', dir: 'asc' }],
                        }),
                    ],
                },
            },
        },
    };
    return entityDef;
}

var application_entity = /*#__PURE__*/Object.freeze({
    __proto__: null,
    applicationEntityFactory: applicationEntityFactory
});

class AXMEditionService extends AXMEntityCrudServiceImpl {
}
class AXMEditionServiceImpl extends AXMEditionService {
    constructor() {
        super(`${RootConfig.module.name}.${RootConfig.entities.edition.name}`);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMEditionServiceImpl, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
    static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMEditionServiceImpl }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMEditionServiceImpl, decorators: [{
            type: Injectable
        }], ctorParameters: () => [] });

async function editionEntityFactory(injector) {
    const dataService = injector.get(AXMEditionService);
    const i18n = RootConfig.config.i18n + ':edition';
    const entityDef = {
        module: RootConfig.module.name,
        name: RootConfig.entities.edition.name,
        icon: RootConfig.entities.edition.icon,
        title: RootConfig.entities.edition.title,
        formats: {
            individual: RootConfig.entities.edition.title,
            plural: RootConfig.entities.edition.titlePlural,
            searchResult: {
                title: '{{ title }}',
                description: RootConfig.module.title,
            },
        },
        relatedEntities: [
            {
                entity: `${RootConfig.module.name}.${RootConfig.entities.module.name}`,
                title: `@${i18n}.module-assignment`,
                conditions: [{ name: 'id', operator: { type: 'in' }, value: '{{ context.eval("moduleIds") }}' }],
                layout: { type: 'page-list', position: 'after', order: 1 },
                persistence: {
                    dataPath: 'modules',
                    strategy: 'referenced',
                    idField: 'moduleIds',
                },
            },
        ],
        groups: [
            {
                id: 'basic-info',
                title: `@${i18n}.basic-info`,
            },
            {
                id: 'module-assignment',
                title: `@${i18n}.module-assignment`,
            },
        ],
        properties: [
            {
                name: 'title',
                title: `@${i18n}.title`,
                groupId: 'basic-info',
                options: {
                    sort: {
                        enabled: true,
                    },
                    filter: {
                        advance: {
                            enabled: true,
                        },
                        inline: {
                            enabled: false,
                        },
                    },
                },
                schema: {
                    dataType: 'string',
                    interface: {
                        type: AXPWidgetsCatalog.text,
                    },
                },
                validations: [
                    {
                        rule: 'required',
                    },
                ],
            },
            {
                name: 'description',
                title: `@${i18n}.description`,
                groupId: 'basic-info',
                options: {
                    sort: {
                        enabled: true,
                    },
                    filter: {
                        advance: {
                            enabled: true,
                        },
                        inline: {
                            enabled: false,
                        },
                    },
                },
                schema: {
                    dataType: 'string',
                    interface: {
                        type: AXPWidgetsCatalog.largeText,
                    },
                },
            },
            {
                name: 'moduleIds',
                groupId: 'module-assignment',
                title: `@${i18n}.module`,
                options: {
                    sort: {
                        enabled: true,
                    },
                    filter: {
                        advance: {
                            enabled: true,
                        },
                        inline: {
                            enabled: true,
                        },
                    },
                },
                schema: {
                    dataType: 'string',
                    interface: {
                        type: AXPWidgetsCatalog.lookup,
                        options: {
                            entity: `${RootConfig.module.name}.${RootConfig.entities.module.name}`,
                            multiple: true,
                            textField: 'title',
                            valueField: 'id',
                            expose: [
                                { source: 'id', target: 'modules.id' },
                                { source: 'title', target: 'modules.title' },
                            ],
                        },
                    },
                },
                validations: [
                    {
                        rule: 'required',
                    },
                ],
            },
        ],
        columns: [{ name: 'title' }, { name: 'description' }, { name: 'moduleIds', options: { dataPath: 'modules' } }],
        commands: {
            create: {
                execute: async (data) => {
                    const res = await dataService.insertOne(data);
                    return { id: res };
                },
            },
            delete: {
                execute: async (id) => {
                    return await dataService.deleteOne(id);
                },
            },
            update: {
                execute: async (data) => {
                    return await dataService.updateOne(data.id, data);
                },
            },
        },
        queries: {
            byKey: {
                execute: async (id) => {
                    return await dataService.getOne(id);
                },
                type: AXPEntityQueryType.Single,
            },
            list: {
                execute: async (e) => {
                    return await dataService.query({ skip: e.skip, take: e.take, filter: e.filter });
                },
                type: AXPEntityQueryType.List,
            },
        },
        interfaces: {
            master: {
                create: {
                    sections: [
                        {
                            id: 'basic-info',
                        },
                        {
                            id: 'module-assignment',
                        },
                    ],
                    properties: [
                        {
                            name: 'title',
                            layout: {
                                positions: {
                                    lg: {
                                        colSpan: 12,
                                        order: 1,
                                    },
                                },
                            },
                        },
                        {
                            name: 'description',
                            layout: {
                                positions: {
                                    lg: {
                                        colSpan: 12,
                                        order: 2,
                                    },
                                },
                            },
                        },
                        {
                            name: 'moduleIds',
                            layout: {
                                positions: {
                                    lg: {
                                        colSpan: 12,
                                        order: 3,
                                    },
                                },
                            },
                        },
                    ],
                },
                update: {
                    sections: [
                        {
                            id: 'basic-info',
                        },
                        {
                            id: 'module-assignment',
                        },
                    ],
                    properties: [
                        {
                            name: 'title',
                            layout: {
                                positions: {
                                    lg: {
                                        colSpan: 12,
                                        order: 1,
                                    },
                                },
                            },
                        },
                        {
                            name: 'description',
                            layout: {
                                positions: {
                                    lg: {
                                        colSpan: 12,
                                        order: 2,
                                    },
                                },
                            },
                        },
                        {
                            name: 'moduleIds',
                            layout: {
                                positions: {
                                    lg: {
                                        colSpan: 12,
                                        order: 3,
                                    },
                                },
                            },
                        },
                    ],
                },
                single: {
                    title: '{{title}}',
                    sections: [
                        {
                            id: 'basic-info',
                            layout: {
                                positions: {
                                    lg: {
                                        colSpan: 12,
                                    },
                                },
                            },
                        },
                        {
                            id: 'module-assignment',
                            layout: {
                                positions: {
                                    lg: {
                                        colSpan: 12,
                                    },
                                },
                            },
                        },
                    ],
                    properties: [
                        {
                            name: 'title',
                            layout: {
                                positions: {
                                    lg: {
                                        colSpan: 12,
                                        order: 1,
                                    },
                                },
                            },
                        },
                        {
                            name: 'description',
                            layout: {
                                positions: {
                                    lg: {
                                        colSpan: 12,
                                        order: 2,
                                    },
                                },
                            },
                        },
                        {
                            name: 'moduleIds',
                            layout: {
                                positions: {
                                    lg: {
                                        colSpan: 12,
                                        order: 3,
                                    },
                                },
                            },
                        },
                    ],
                    actions: [],
                },
                list: {
                    actions: [
                        {
                            title: `@general:create`,
                            command: 'create-entity',
                            priority: 'primary',
                            type: 'create',
                            scope: AXPEntityCommandScope.TypeLevel,
                        },
                        {
                            title: `@general:deleteItems`,
                            command: 'delete-entity',
                            priority: 'primary',
                            type: 'delete',
                            scope: AXPEntityCommandScope.Selected,
                        },
                        {
                            title: `@general:detail`,
                            command: 'open-entity',
                            priority: 'secondary',
                            type: 'view',
                            scope: AXPEntityCommandScope.Individual,
                        },
                        {
                            title: `@general:delete`,
                            command: 'delete-entity',
                            priority: 'secondary',
                            type: 'delete',
                            scope: AXPEntityCommandScope.Individual,
                        },
                    ],
                    views: [
                        createAllQueryView({
                            sorts: [{ name: 'title', dir: 'asc' }],
                        }),
                    ],
                },
            },
        },
    };
    return entityDef;
}

var edition_entity = /*#__PURE__*/Object.freeze({
    __proto__: null,
    editionEntityFactory: editionEntityFactory
});

class AXMEditionEntityModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMEditionEntityModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.4", ngImport: i0, type: AXMEditionEntityModule }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMEditionEntityModule, providers: [
            {
                provide: AXMEditionService,
                useClass: AXMEditionServiceImpl,
            },
        ] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMEditionEntityModule, decorators: [{
            type: NgModule,
            args: [{
                    declarations: [],
                    imports: [],
                    exports: [],
                    providers: [
                        {
                            provide: AXMEditionService,
                            useClass: AXMEditionServiceImpl,
                        },
                    ],
                }]
        }] });

class AXMFeatureService extends AXMEntityCrudServiceImpl {
}
class AXMFeatureServiceImpl extends AXMFeatureService {
    constructor() {
        super(`${RootConfig.module.name}.${RootConfig.entities.feature.name}`);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMFeatureServiceImpl, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
    static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMFeatureServiceImpl }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMFeatureServiceImpl, decorators: [{
            type: Injectable
        }], ctorParameters: () => [] });

async function featureEntityFactory(injector) {
    const dataService = injector.get(AXMFeatureService);
    const i18n = RootConfig.config.i18n + ':feature';
    const entityDef = {
        module: RootConfig.module.name,
        name: RootConfig.entities.feature.name,
        icon: RootConfig.entities.feature.icon,
        title: RootConfig.entities.feature.title,
        parentKey: 'parentId',
        formats: {
            individual: RootConfig.entities.feature.title,
            plural: RootConfig.entities.feature.titlePlural,
            searchResult: {
                title: '{{ title }}',
                description: RootConfig.module.title,
            },
        },
        relatedEntities: [],
        groups: [
            {
                id: 'basic-info',
                title: `@${i18n}.basic-info`,
            },
        ],
        properties: [
            {
                name: 'title',
                title: `@${i18n}.title`,
                groupId: 'basic-info',
                options: {
                    sort: {
                        enabled: true,
                    },
                    filter: {
                        advance: {
                            enabled: true,
                        },
                        inline: {
                            enabled: false,
                        },
                    },
                },
                schema: {
                    dataType: 'string',
                    interface: {
                        type: AXPWidgetsCatalog.text,
                    },
                },
                validations: [
                    {
                        rule: 'required',
                    },
                ],
            },
            {
                name: 'description',
                title: `@${i18n}.description`,
                groupId: 'basic-info',
                options: {
                    sort: {
                        enabled: true,
                    },
                    filter: {
                        advance: {
                            enabled: true,
                        },
                        inline: {
                            enabled: false,
                        },
                    },
                },
                schema: {
                    dataType: 'string',
                    interface: {
                        type: AXPWidgetsCatalog.largeText,
                    },
                },
            },
        ],
        columns: [{ name: 'title' }, { name: 'description' }, { name: 'moduleId', options: { dataPath: 'module' } }],
        commands: {
            create: {
                execute: async (data) => {
                    const res = await dataService.insertOne(data);
                    return { id: res };
                },
            },
            delete: {
                execute: async (id) => {
                    return await dataService.deleteOne(id);
                },
            },
            update: {
                execute: async (data) => {
                    return await dataService.updateOne(data.id, data);
                },
            },
        },
        queries: {
            byKey: {
                execute: async (id) => {
                    return await dataService.getOne(id);
                },
                type: AXPEntityQueryType.Single,
            },
            list: {
                execute: async (e) => {
                    debugger;
                    if (e.filter?.field !== 'parentId') {
                        return await dataService.query({ skip: e.skip, take: e.take, filter: { field: 'parentId', value: null } });
                    }
                    else {
                        return await dataService.query({ skip: e.skip, take: e.take, filter: e.filter });
                    }
                },
                type: AXPEntityQueryType.List,
            },
        },
        interfaces: {
            master: {
                create: {
                    sections: [
                        {
                            id: 'basic-info',
                        },
                    ],
                    properties: [
                        {
                            name: 'title',
                            layout: {
                                positions: {
                                    lg: {
                                        colSpan: 12,
                                        order: 1,
                                    },
                                },
                            },
                        },
                        {
                            name: 'description',
                            layout: {
                                positions: {
                                    lg: {
                                        colSpan: 12,
                                        order: 2,
                                    },
                                },
                            },
                        },
                        {
                            name: 'moduleId',
                            layout: {
                                positions: {
                                    lg: {
                                        colSpan: 12,
                                        order: 3,
                                    },
                                },
                            },
                        },
                    ],
                },
                update: {
                    sections: [
                        {
                            id: 'basic-info',
                        },
                    ],
                    properties: [
                        {
                            name: 'title',
                            layout: {
                                positions: {
                                    lg: {
                                        colSpan: 12,
                                        order: 1,
                                    },
                                },
                            },
                        },
                        {
                            name: 'description',
                            layout: {
                                positions: {
                                    lg: {
                                        colSpan: 12,
                                        order: 2,
                                    },
                                },
                            },
                        },
                        {
                            name: 'moduleId',
                            layout: {
                                positions: {
                                    lg: {
                                        colSpan: 12,
                                        order: 3,
                                    },
                                },
                            },
                        },
                    ],
                },
                single: {
                    title: '{{title}}',
                    sections: [
                        {
                            id: 'basic-info',
                            layout: {
                                positions: {
                                    lg: {
                                        colSpan: 12,
                                    },
                                },
                            },
                        },
                    ],
                    properties: [
                        {
                            name: 'title',
                            layout: {
                                positions: {
                                    lg: {
                                        colSpan: 12,
                                        order: 1,
                                    },
                                },
                            },
                        },
                        {
                            name: 'description',
                            layout: {
                                positions: {
                                    lg: {
                                        colSpan: 12,
                                        order: 2,
                                    },
                                },
                            },
                        },
                        {
                            name: 'moduleId',
                            layout: {
                                positions: {
                                    lg: {
                                        colSpan: 12,
                                        order: 3,
                                    },
                                },
                            },
                        },
                    ],
                    actions: [],
                },
                list: {
                    actions: [
                        {
                            title: `@general:create`,
                            command: 'create-entity',
                            priority: 'primary',
                            type: 'create',
                            scope: AXPEntityCommandScope.TypeLevel,
                        },
                        {
                            title: `@general:deleteItems`,
                            command: 'delete-entity',
                            priority: 'primary',
                            type: 'delete',
                            scope: AXPEntityCommandScope.Selected,
                        },
                        {
                            title: `@general:detail`,
                            command: 'open-entity',
                            priority: 'secondary',
                            type: 'view',
                            scope: AXPEntityCommandScope.Individual,
                        },
                        {
                            title: `@general:delete`,
                            command: 'delete-entity',
                            priority: 'secondary',
                            type: 'delete',
                            scope: AXPEntityCommandScope.Individual,
                        },
                    ],
                    views: [
                        createAllQueryView({
                            sorts: [{ name: 'title', dir: 'asc' }],
                        }),
                    ],
                },
            },
        },
    };
    return entityDef;
}

var feature_entity = /*#__PURE__*/Object.freeze({
    __proto__: null,
    featureEntityFactory: featureEntityFactory
});

class AXMFeatureEntityModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMFeatureEntityModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.4", ngImport: i0, type: AXMFeatureEntityModule }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMFeatureEntityModule, providers: [
            {
                provide: AXMFeatureService,
                useClass: AXMFeatureServiceImpl,
            },
        ] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMFeatureEntityModule, decorators: [{
            type: NgModule,
            args: [{
                    declarations: [],
                    imports: [],
                    exports: [],
                    providers: [
                        {
                            provide: AXMFeatureService,
                            useClass: AXMFeatureServiceImpl,
                        },
                    ],
                }]
        }] });

class AXMModuleService extends AXMEntityCrudServiceImpl {
}
class AXMModuleServiceImpl extends AXMModuleService {
    constructor() {
        super(`${RootConfig.module.name}.${RootConfig.entities.module.name}`);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMModuleServiceImpl, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
    static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMModuleServiceImpl }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMModuleServiceImpl, decorators: [{
            type: Injectable
        }], ctorParameters: () => [] });

async function moduleEntityFactory(injector) {
    const dataService = injector.get(AXMModuleService);
    const i18n = RootConfig.config.i18n + ':module';
    const entityDef = {
        module: RootConfig.module.name,
        name: RootConfig.entities.module.name,
        icon: RootConfig.entities.module.icon,
        title: RootConfig.entities.module.title,
        plugins: [{ name: 'color', options: { colSpan: 12 } }, { name: 'icon' }],
        formats: {
            individual: RootConfig.entities.module.title,
            plural: RootConfig.entities.module.titlePlural,
            searchResult: {
                title: '{{ title }}',
                description: RootConfig.module.title,
            },
        },
        relatedEntities: [
            {
                entity: `${RootConfig.module.name}.${RootConfig.entities.feature.name}`,
                title: `@${i18n}.feature-assignment`,
                conditions: [{ name: 'id', operator: { type: 'in' }, value: '{{ context.eval("featureIds") }}' }],
                actions: [...entityDetailsCrudActions('featureIds')],
                layout: { type: 'page-list', position: 'after', order: 1 },
                persistence: {
                    dataPath: 'features',
                    strategy: 'referenced',
                    idField: 'featureIds',
                },
            },
        ],
        groups: [
            {
                id: 'basic-info',
                title: `@${i18n}.basic-info`,
            },
        ],
        properties: [
            {
                name: 'title',
                title: `@${i18n}.title`,
                groupId: 'basic-info',
                options: {
                    sort: {
                        enabled: true,
                    },
                    filter: {
                        advance: {
                            enabled: true,
                        },
                        inline: {
                            enabled: false,
                        },
                    },
                },
                schema: {
                    dataType: 'string',
                    interface: {
                        type: AXPWidgetsCatalog.text,
                    },
                },
                validations: [
                    {
                        rule: 'required',
                    },
                ],
            },
            {
                name: 'description',
                title: `@${i18n}.description`,
                groupId: 'basic-info',
                options: {
                    sort: {
                        enabled: true,
                    },
                    filter: {
                        advance: {
                            enabled: true,
                        },
                        inline: {
                            enabled: false,
                        },
                    },
                },
                schema: {
                    dataType: 'string',
                    interface: {
                        type: AXPWidgetsCatalog.largeText,
                    },
                },
            },
            // {
            //   name: 'featureIds',
            //   groupId: 'feature-assignment',
            //   title: `@${i18n}.feature`,
            //   options: {
            //     sort: {
            //       enabled: true,
            //     },
            //     filter: {
            //       advance: {
            //         enabled: true,
            //       },
            //       inline: {
            //         enabled: true,
            //       },
            //     },
            //   },
            //   schema: {
            //     dataType: 'string',
            //     interface: {
            //       type: AXPWidgetsCatalog.lookup,
            //       options: {
            //         entity: `${RootConfig.module.name}.${RootConfig.entities.feature.name}`,
            //         multiple: true,
            //         textField: 'title',
            //         valueField: 'id',
            //         expose: [
            //           { source: 'id', target: 'feature.id' },
            //           { source: 'title', target: 'feature.title' },
            //         ],
            //       },
            //     },
            //   },
            //   validations: [
            //     {
            //       rule: 'required',
            //     },
            //   ],
            // },
        ],
        columns: [{ name: 'title' }, { name: 'description' }],
        commands: {
            create: {
                execute: async (data) => {
                    const res = await dataService.insertOne(data);
                    return { id: res };
                },
            },
            delete: {
                execute: async (id) => {
                    return await dataService.deleteOne(id);
                },
            },
            update: {
                execute: async (data) => {
                    return await dataService.updateOne(data.id, data);
                },
            },
        },
        queries: {
            byKey: {
                execute: async (id) => {
                    return await dataService.getOne(id);
                },
                type: AXPEntityQueryType.Single,
            },
            list: {
                execute: async (e) => {
                    return await dataService.query({ skip: e.skip, take: e.take, filter: e.filter });
                },
                type: AXPEntityQueryType.List,
            },
        },
        interfaces: {
            master: {
                create: {
                    sections: [
                        {
                            id: 'basic-info',
                        },
                    ],
                    properties: [
                        {
                            name: 'title',
                            layout: {
                                positions: {
                                    lg: {
                                        colSpan: 12,
                                        order: 1,
                                    },
                                },
                            },
                        },
                        {
                            name: 'description',
                            layout: {
                                positions: {
                                    lg: {
                                        colSpan: 12,
                                        order: 2,
                                    },
                                },
                            },
                        },
                    ],
                },
                update: {
                    sections: [
                        {
                            id: 'basic-info',
                        },
                    ],
                    properties: [
                        {
                            name: 'title',
                            layout: {
                                positions: {
                                    lg: {
                                        colSpan: 12,
                                        order: 1,
                                    },
                                },
                            },
                        },
                        {
                            name: 'description',
                            layout: {
                                positions: {
                                    lg: {
                                        colSpan: 12,
                                        order: 2,
                                    },
                                },
                            },
                        },
                    ],
                },
                single: {
                    title: '{{title}}',
                    sections: [
                        {
                            id: 'basic-info',
                            layout: {
                                positions: {
                                    lg: {
                                        colSpan: 12,
                                    },
                                },
                            },
                        },
                    ],
                    properties: [
                        {
                            name: 'title',
                            layout: {
                                positions: {
                                    lg: {
                                        colSpan: 12,
                                        order: 1,
                                    },
                                },
                            },
                        },
                        {
                            name: 'description',
                            layout: {
                                positions: {
                                    lg: {
                                        colSpan: 12,
                                        order: 2,
                                    },
                                },
                            },
                        },
                    ],
                    actions: [],
                },
                list: {
                    actions: [
                        {
                            title: `@general:create`,
                            command: 'create-entity',
                            priority: 'primary',
                            type: 'create',
                            scope: AXPEntityCommandScope.TypeLevel,
                        },
                        {
                            title: `@general:deleteItems`,
                            command: 'delete-entity',
                            priority: 'primary',
                            type: 'delete',
                            scope: AXPEntityCommandScope.Selected,
                        },
                        {
                            title: `@general:detail`,
                            command: 'open-entity',
                            priority: 'secondary',
                            type: 'view',
                            scope: AXPEntityCommandScope.Individual,
                        },
                        {
                            title: `@general:delete`,
                            command: 'delete-entity',
                            priority: 'secondary',
                            type: 'delete',
                            scope: AXPEntityCommandScope.Individual,
                        },
                    ],
                    views: [
                        createAllQueryView({
                            sorts: [{ name: 'title', dir: 'asc' }],
                        }),
                    ],
                },
            },
        },
    };
    return entityDef;
}

var module_entity = /*#__PURE__*/Object.freeze({
    __proto__: null,
    moduleEntityFactory: moduleEntityFactory
});

class AXMModuleEntityModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMModuleEntityModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.4", ngImport: i0, type: AXMModuleEntityModule }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMModuleEntityModule, providers: [
            {
                provide: AXMModuleService,
                useClass: AXMModuleServiceImpl,
            },
        ] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMModuleEntityModule, decorators: [{
            type: NgModule,
            args: [{
                    declarations: [],
                    imports: [],
                    exports: [],
                    providers: [
                        {
                            provide: AXMModuleService,
                            useClass: AXMModuleServiceImpl,
                        },
                    ],
                }]
        }] });

//#region ----   Routes Factory   ----
function routesFactory() {
    const routes = [
        {
            path: ':app/application-management/menus/:scope',
            canActivate: [AXPAuthGuard],
            loadComponent: () => AXPRootLayoutComponent,
            children: [
                {
                    path: '',
                    loadComponent: () => import('./acorex-modules-application-management-menu-list.component-D4uW0aXY.mjs').then((c) => c.AXMMenuListComponent),
                    data: { reuse: true },
                },
            ],
        },
    ];
    return routes;
}
//#endregion
class AXMApplicationManagementModule {
    constructor() { }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMApplicationManagementModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.4", ngImport: i0, type: AXMApplicationManagementModule, imports: [
            // Entity Modules
            AXMApplicationEntityModule] }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMApplicationManagementModule, providers: [
            {
                provide: AXMFeatureService,
                useClass: AXMFeatureServiceImpl,
            },
            {
                provide: AXMModuleService,
                useClass: AXMModuleServiceImpl,
            },
            {
                provide: AXMEditionService,
                useClass: AXMEditionServiceImpl,
            },
            {
                provide: AXP_MENU_PROVIDER,
                useClass: AXMApplicationManagmentModuleMenuProvider,
                multi: true,
            },
            {
                provide: AXP_MENU_MIDDLEWARE,
                useClass: AXPCustomMenuMiddleware,
                multi: true,
            },
            {
                provide: AXP_ENTITY_DEFINITION_LOADER,
                useClass: AXMEntityProvider,
                multi: true,
            },
            {
                provide: ROUTES,
                multi: true,
                useFactory: routesFactory,
            },
        ], imports: [
            // Entity Modules
            AXMApplicationEntityModule] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMApplicationManagementModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [
                        // Entity Modules
                        AXMApplicationEntityModule,
                    ],
                    exports: [],
                    declarations: [],
                    providers: [
                        {
                            provide: AXMFeatureService,
                            useClass: AXMFeatureServiceImpl,
                        },
                        {
                            provide: AXMModuleService,
                            useClass: AXMModuleServiceImpl,
                        },
                        {
                            provide: AXMEditionService,
                            useClass: AXMEditionServiceImpl,
                        },
                        {
                            provide: AXP_MENU_PROVIDER,
                            useClass: AXMApplicationManagmentModuleMenuProvider,
                            multi: true,
                        },
                        {
                            provide: AXP_MENU_MIDDLEWARE,
                            useClass: AXPCustomMenuMiddleware,
                            multi: true,
                        },
                        {
                            provide: AXP_ENTITY_DEFINITION_LOADER,
                            useClass: AXMEntityProvider,
                            multi: true,
                        },
                        {
                            provide: ROUTES,
                            multi: true,
                            useFactory: routesFactory,
                        },
                    ],
                }]
        }], ctorParameters: () => [] });

class AXMSearchCommandProvider extends AXPSearchCommandProvider {
    constructor() {
        super(...arguments);
        this.commands = [
        // {
        //   group: 'command',
        //  title: 'New Form Template',
        //  icon: RootConfig.entities.template.icon,
        //  description: 'Create a new form template for designing reusable forms.', // Added description
        //  commands: {
        //    'create-entity': {
        //      entity: `${RootConfig.module.name}.${RootConfig.entities.template.name}`,
        //    },
        //  },
        // }
        ];
    }
}

class AXMSettingProvider {
    async provide(context) {
        // context
        //   // Add Form Template Group
        //   .addGroup('form-template', 'Form Template', 'Settings related to form templates.', RootConfig.module.icon)
        //   // Start Interface Section
        //   .addSection('interface', 'UI Interface', 'Customize the user interface for forms.')
        //   .addSetting({
        //     key: 'history-panel',
        //     title: 'Show History Panel',
        //     scope: 'U',
        //     isInherited: true,
        //     defaultValue: false,
        //     widget: {
        //       type: AXPWidgetsCatalog.toggle,
        //     },
        //     description: 'Enable or disable the history panel for forms.',
        //     validationRules: [
        //       {
        //         rule: 'required',
        //       },
        //     ],
        //   })
        //   .endSection()
        //   .endGroup();
    }
}

/**
 * Generated bundle index. Do not edit.
 */

export { AXP_MENU_CUSTOMIZATION_KEY as A, RootConfig as R, AXP_MENU_CUSTOMIZATION_DEFAULT as a, AXMApplicationManagementModule as b, AXMApplicationManagementModuleConst as c, applicationEntityFactory as d, AXMApplicationEntityModule as e, AXMApplicationService as f, AXMApplicationServiceImpl as g, editionEntityFactory as h, AXMEditionEntityModule as i, AXMEditionService as j, AXMEditionServiceImpl as k, featureEntityFactory as l, AXMFeatureEntityModule as m, AXMFeatureService as n, AXMFeatureServiceImpl as o, moduleEntityFactory as p, AXMModuleEntityModule as q, AXMModuleService as r, AXMModuleServiceImpl as s, AXMEntityProvider as t, AXMApplicationManagmentModuleMenuProvider as u, AXMSearchCommandProvider as v, AXMSettingProvider as w };
//# sourceMappingURL=acorex-modules-application-management-acorex-modules-application-management-BqYLpEvY.mjs.map
