import { lazy } from 'react';
// Provide lazy-loaded page/widget modules. Consumers can either use the loader
// functions (to resolve the module) or the Lazy components directly via React.lazy.
export const UdpPagesLoaders = {
    UdpNotesPage: () => import('../UdpNotesPage'),
    UdpVerticalManagementPage: () => import('../UdpVerticalManagementPage'),
    UdpGridPanelManagementPage: () => import('../UdpGridPanelManagementPage'),
    UdpMaintenanceEnginePage: () => import('../UdpMaintenanceEnginePage'),
    UdpInquiryMaintenanceEnginePage: () => import('../UdpInquiryMaintenanceEnginePage'),
    UdpReportsPage: () => import('../UdpReportsPage'),
    DonutChartWidget: () => import('../../../UI/widgets/library/DonutChartWidget'),
    SparklineWidget: () => import('../../../UI/widgets/library/SparklineWidget'),
    ProgressBarWidget: () => import('../../../UI/widgets/library/ProgressBarWidget'),
    RecentlyLoadedNodesWidget: () => import('../../../UI/widgets/library/RecentlyLoadedNodesWidget'),
    ChatUDP: () => import('../ChatUDP'),
    UdpDataBrowserPage: () => import('../UdpDataBrowserPage'),
    UdpRemindersPage: () => import('../UdpRemindersPage'),
    RemindersWidget: () => import('../../../UI/widgets/library/RemindersWidget'),
    UdpPublicForm: () => import('../UdpFormsPublicForm'),
    UdpPrivateForm: () => import('../UdpFormsPrivateForm'),
    UdpFormsBuilderPage: () => import('../UdpFormsBuilderPage'),
    UdpFormsListPage: () => import('../UdpFormsListPage'),
    UdpFormsSubmissionGridManagerPage: () => import('../UdpFormsSubmissionGridManagerPage'),
    UdpFormsSubmissionGridResponderPage: () => import('../UdpFormsSubmissionGridResponderPage'),
    UdpFormsSubmissionGrid: () => import('../UdpFormsSubmissionGrid'),
    UdpImportFromFileMappingPage: () => import('../UdpImportFromFileMappingPage'),
    UdpAuditEventsPage: () => import('../UdpAuditEvents/UdpAuditEventsPage'),
    UdpTransactionTypesPage: () => import('../UdpTransactionTypesPage'),
    UdpTransactionsPage: () => import('../UdpTransactionsPage'),
    UdpLookupManagementPage: () => import('../UdpLookupManagementPage')
};
// HMR-safe cache: Persists across module reloads by using import.meta.hot.data
// This is THE KEY to preventing infinite loops with dynamic imports + HMR
let lazyComponentCache;
if (import.meta.hot) {
    // In development with HMR
    if (!import.meta.hot.data.lazyCache) {
        import.meta.hot.data.lazyCache = {};
    }
    lazyComponentCache = import.meta.hot.data.lazyCache;
    // Accept HMR updates without invalidating the cache
    import.meta.hot.accept(() => {
        console.log('[udpPages] HMR update accepted - cache preserved');
    });
}
else {
    // Production build - normal cache
    lazyComponentCache = {};
}
// Convenience: a map of React.lazy components. Consumers who want to render
// the page directly can use these with Suspense.
// Uses a Proxy to create lazy components on-demand and cache them for HMR stability
export const UdpPagesLazy = new Proxy({}, {
    get(target, prop) {
        if (prop in UdpPagesLoaders) {
            if (!lazyComponentCache[prop]) {
                lazyComponentCache[prop] = lazy(UdpPagesLoaders[prop]);
            }
            return lazyComponentCache[prop];
        }
        return undefined;
    },
    ownKeys() {
        return Object.keys(UdpPagesLoaders);
    },
    getOwnPropertyDescriptor(target, prop) {
        if (prop in UdpPagesLoaders) {
            return {
                enumerable: true,
                configurable: true
            };
        }
    }
});
//# sourceMappingURL=index.js.map