{"version":3,"file":"gewd-lazy-registry.mjs","sources":["../../../../libs/lazy/registry/registry.ts","../../../../libs/lazy/registry/gewd-lazy-registry.ts"],"sourcesContent":["import { ComponentFactory, NgModuleRef, Type } from '@angular/core';\nimport { Lazy } from '@gewd/lazy/utils';\nimport { LazyModule } from '@gewd/lazy/contracts';\n\ninterface LoadedModule {\n  ngModule: NgModuleRef<any>;\n  componentFactories: ComponentFactory<any>[];\n}\n\nexport interface LazyModuleComponentConfig {\n  load: Lazy<Type<LazyModule>>; // the external import call to get the module\n  loadedModule?: Promise<LoadedModule>; // cached\n}\n\nexport class DynamicLoaderRegistry {\n  // Registry + Cache\n  public static readonly LazyComponents: { [key: string]: Lazy<any> } = {};\n\n  public static RegisterLazyComponent(componentName: string, lazyImport: Lazy<any>): void  {\n    DynamicLoaderRegistry.LazyComponents[componentName] = lazyImport;\n  }\n\n  // Registry\n  public static readonly LazyModuleComponents: { [key: string]: LazyModuleComponentConfig } = {};\n\n  public static RegisterLazyModuleComponent(moduleName: string, lazyImport: LazyModuleComponentConfig): void  {\n    DynamicLoaderRegistry.LazyModuleComponents[moduleName] = lazyImport;\n  }\n\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":"MAca,qBAAqB,CAAA;;aAET,IAAc,CAAA,cAAA,GAAiC,EAAE,CAAC,EAAA;AAElE,IAAA,OAAO,qBAAqB,CAAC,aAAqB,EAAE,UAAqB,EAAA;AAC9E,QAAA,qBAAqB,CAAC,cAAc,CAAC,aAAa,CAAC,GAAG,UAAU,CAAC;KAClE;;aAGsB,IAAoB,CAAA,oBAAA,GAAiD,EAAE,CAAC,EAAA;AAExF,IAAA,OAAO,2BAA2B,CAAC,UAAkB,EAAE,UAAqC,EAAA;AACjG,QAAA,qBAAqB,CAAC,oBAAoB,CAAC,UAAU,CAAC,GAAG,UAAU,CAAC;KACrE;;;AC3BH;;AAEG;;;;"}