{"ast":null,"code":"import * as i3 from '@ngrx/store';\nimport { compose, ScannedActionsSubject, createAction } from '@ngrx/store';\nimport * as i1 from 'rxjs';\nimport { merge, Observable, Subject, defer, Notification, pipe, of } from 'rxjs';\nimport { ignoreElements, materialize, map, catchError, filter, groupBy, mergeMap, exhaustMap, dematerialize, take, concatMap, finalize, withLatestFrom } from 'rxjs/operators';\nimport * as i0 from '@angular/core';\nimport { Injectable, Inject, InjectionToken, NgModule, Optional, Injector, SkipSelf, Self } from '@angular/core';\nconst DEFAULT_EFFECT_CONFIG = {\n  dispatch: true,\n  useEffectsErrorHandler: true\n};\nconst CREATE_EFFECT_METADATA_KEY = '__@ngrx/effects_create__';\n/**\n * @description\n * Creates an effect from an `Observable` and an `EffectConfig`.\n *\n * @param source A function which returns an `Observable`.\n * @param config A `Partial<EffectConfig>` to configure the effect.  By default, `dispatch` is true and `useEffectsErrorHandler` is true.\n * @returns If `EffectConfig`#`dispatch` is true, returns `Observable<Action>`.  Else, returns `Observable<unknown>`.\n *\n * @usageNotes\n *\n * ** Mapping to a different action **\n * ```ts\n * effectName$ = createEffect(\n *   () => this.actions$.pipe(\n *     ofType(FeatureActions.actionOne),\n *     map(() => FeatureActions.actionTwo())\n *   )\n * );\n * ```\n *\n *  ** Non-dispatching effects **\n * ```ts\n * effectName$ = createEffect(\n *   () => this.actions$.pipe(\n *     ofType(FeatureActions.actionOne),\n *     tap(() => console.log('Action One Dispatched'))\n *   ),\n *   { dispatch: false }\n *   // FeatureActions.actionOne is not dispatched\n * );\n * ```\n */\n\nfunction createEffect(source, config) {\n  const effect = source();\n  const value = Object.assign(Object.assign({}, DEFAULT_EFFECT_CONFIG), config);\n  Object.defineProperty(effect, CREATE_EFFECT_METADATA_KEY, {\n    value\n  });\n  return effect;\n}\n\nfunction getCreateEffectMetadata(instance) {\n  const propertyNames = Object.getOwnPropertyNames(instance);\n  const metadata = propertyNames.filter(propertyName => {\n    if (instance[propertyName] && instance[propertyName].hasOwnProperty(CREATE_EFFECT_METADATA_KEY)) {\n      // If the property type has overridden `hasOwnProperty` we need to ensure\n      // that the metadata is valid (containing a `dispatch`property)\n      // https://github.com/ngrx/platform/issues/2975\n      const property = instance[propertyName];\n      return property[CREATE_EFFECT_METADATA_KEY].hasOwnProperty('dispatch');\n    }\n\n    return false;\n  }).map(propertyName => {\n    const metaData = instance[propertyName][CREATE_EFFECT_METADATA_KEY];\n    return Object.assign({\n      propertyName\n    }, metaData);\n  });\n  return metadata;\n}\n\nfunction getSourceForInstance(instance) {\n  return Object.getPrototypeOf(instance);\n}\n\nconst METADATA_KEY = '__@ngrx/effects__';\n/**\n * @deprecated The Effect decorator (`@Effect`) is deprecated in favor for the `createEffect` method.\n * See the docs for more info {@link https://ngrx.io/guide/migration/v11#the-effect-decorator}\n */\n\nfunction Effect(config = {}) {\n  return function (target, propertyName) {\n    const metadata = Object.assign(Object.assign(Object.assign({}, DEFAULT_EFFECT_CONFIG), config), {\n      propertyName\n    });\n    addEffectMetadataEntry(target, metadata);\n  };\n}\n\nfunction getEffectDecoratorMetadata(instance) {\n  const effectsDecorators = compose(getEffectMetadataEntries, getSourceForInstance)(instance);\n  return effectsDecorators;\n}\n/**\n * Type guard to detemine whether METADATA_KEY is already present on the Class\n * constructor\n */\n\n\nfunction hasMetadataEntries(sourceProto) {\n  return sourceProto.constructor.hasOwnProperty(METADATA_KEY);\n}\n/** Add Effect Metadata to the Effect Class constructor under specific key */\n\n\nfunction addEffectMetadataEntry(sourceProto, metadata) {\n  if (hasMetadataEntries(sourceProto)) {\n    sourceProto.constructor[METADATA_KEY].push(metadata);\n  } else {\n    Object.defineProperty(sourceProto.constructor, METADATA_KEY, {\n      value: [metadata]\n    });\n  }\n}\n\nfunction getEffectMetadataEntries(sourceProto) {\n  return hasMetadataEntries(sourceProto) ? sourceProto.constructor[METADATA_KEY] : [];\n}\n\nfunction getEffectsMetadata(instance) {\n  return getSourceMetadata(instance).reduce((acc, {\n    propertyName,\n    dispatch,\n    useEffectsErrorHandler\n  }) => {\n    acc[propertyName] = {\n      dispatch,\n      useEffectsErrorHandler\n    };\n    return acc;\n  }, {});\n}\n\nfunction getSourceMetadata(instance) {\n  const effects = [getEffectDecoratorMetadata, getCreateEffectMetadata];\n  return effects.reduce((sources, source) => sources.concat(source(instance)), []);\n}\n\nfunction mergeEffects(sourceInstance, globalErrorHandler, effectsErrorHandler) {\n  const sourceName = getSourceForInstance(sourceInstance).constructor.name;\n  const observables$ = getSourceMetadata(sourceInstance).map(({\n    propertyName,\n    dispatch,\n    useEffectsErrorHandler\n  }) => {\n    const observable$ = typeof sourceInstance[propertyName] === 'function' ? sourceInstance[propertyName]() : sourceInstance[propertyName];\n    const effectAction$ = useEffectsErrorHandler ? effectsErrorHandler(observable$, globalErrorHandler) : observable$;\n\n    if (dispatch === false) {\n      return effectAction$.pipe(ignoreElements());\n    }\n\n    const materialized$ = effectAction$.pipe(materialize());\n    return materialized$.pipe(map(notification => ({\n      effect: sourceInstance[propertyName],\n      notification,\n      propertyName,\n      sourceName,\n      sourceInstance\n    })));\n  });\n  return merge(...observables$);\n}\n\nconst MAX_NUMBER_OF_RETRY_ATTEMPTS = 10;\n\nfunction defaultEffectsErrorHandler(observable$, errorHandler, retryAttemptLeft = MAX_NUMBER_OF_RETRY_ATTEMPTS) {\n  return observable$.pipe(catchError(error => {\n    if (errorHandler) errorHandler.handleError(error);\n\n    if (retryAttemptLeft <= 1) {\n      return observable$; // last attempt\n    } // Return observable that produces this particular effect\n\n\n    return defaultEffectsErrorHandler(observable$, errorHandler, retryAttemptLeft - 1);\n  }));\n}\n\nclass Actions extends Observable {\n  constructor(source) {\n    super();\n\n    if (source) {\n      this.source = source;\n    }\n  }\n\n  lift(operator) {\n    const observable = new Actions();\n    observable.source = this;\n    observable.operator = operator;\n    return observable;\n  }\n\n}\n/** @nocollapse */\n\n/** @nocollapse */\n\n\nActions.ɵfac = function Actions_Factory(t) {\n  return new (t || Actions)(i0.ɵɵinject(ScannedActionsSubject));\n};\n/** @nocollapse */\n\n/** @nocollapse */\n\n\nActions.ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n  token: Actions,\n  factory: Actions.ɵfac\n});\n\n(function () {\n  (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(Actions, [{\n    type: Injectable\n  }], function () {\n    return [{\n      type: i1.Observable,\n      decorators: [{\n        type: Inject,\n        args: [ScannedActionsSubject]\n      }]\n    }];\n  }, null);\n})();\n/**\n * `ofType` filters an Observable of `Actions` into an Observable of the actions\n * whose type strings are passed to it.\n *\n * For example, if `actions` has type `Actions<AdditionAction|SubstractionAction>`, and\n * the type of the `Addition` action is `add`, then\n * `actions.pipe(ofType('add'))` returns an `Observable<AdditionAction>`.\n *\n * Properly typing this function is hard and requires some advanced TS tricks\n * below.\n *\n * Type narrowing automatically works, as long as your `actions` object\n * starts with a `Actions<SomeUnionOfActions>` instead of generic `Actions`.\n *\n * For backwards compatibility, when one passes a single type argument\n * `ofType<T>('something')` the result is an `Observable<T>`. Note, that `T`\n * completely overrides any possible inference from 'something'.\n *\n * Unfortunately, for unknown 'actions: Actions' these types will produce\n * 'Observable<never>'. In such cases one has to manually set the generic type\n * like `actions.ofType<AdditionAction>('add')`.\n *\n * @usageNotes\n *\n * Filter the Actions stream on the \"customers page loaded\" action\n *\n * ```ts\n * import { ofType } from '@ngrx/effects';\n * import * fromCustomers from '../customers';\n *\n * this.actions$.pipe(\n *  ofType(fromCustomers.pageLoaded)\n * )\n * ```\n */\n\n\nfunction ofType(...allowedTypes) {\n  return filter(action => allowedTypes.some(typeOrActionCreator => {\n    if (typeof typeOrActionCreator === 'string') {\n      // Comparing the string to type\n      return typeOrActionCreator === action.type;\n    } // We are filtering by ActionCreator\n\n\n    return typeOrActionCreator.type === action.type;\n  }));\n}\n\nfunction reportInvalidActions(output, reporter) {\n  if (output.notification.kind === 'N') {\n    const action = output.notification.value;\n    const isInvalidAction = !isAction(action);\n\n    if (isInvalidAction) {\n      reporter.handleError(new Error(`Effect ${getEffectName(output)} dispatched an invalid action: ${stringify(action)}`));\n    }\n  }\n}\n\nfunction isAction(action) {\n  return typeof action !== 'function' && action && action.type && typeof action.type === 'string';\n}\n\nfunction getEffectName({\n  propertyName,\n  sourceInstance,\n  sourceName\n}) {\n  const isMethod = typeof sourceInstance[propertyName] === 'function';\n  return `\"${sourceName}.${String(propertyName)}${isMethod ? '()' : ''}\"`;\n}\n\nfunction stringify(action) {\n  try {\n    return JSON.stringify(action);\n  } catch (_a) {\n    return action;\n  }\n}\n\nconst onIdentifyEffectsKey = 'ngrxOnIdentifyEffects';\n\nfunction isOnIdentifyEffects(instance) {\n  return isFunction(instance, onIdentifyEffectsKey);\n}\n\nconst onRunEffectsKey = 'ngrxOnRunEffects';\n\nfunction isOnRunEffects(instance) {\n  return isFunction(instance, onRunEffectsKey);\n}\n\nconst onInitEffects = 'ngrxOnInitEffects';\n\nfunction isOnInitEffects(instance) {\n  return isFunction(instance, onInitEffects);\n}\n\nfunction isFunction(instance, functionName) {\n  return instance && functionName in instance && typeof instance[functionName] === 'function';\n}\n\nconst _ROOT_EFFECTS_GUARD = new InjectionToken('@ngrx/effects Internal Root Guard');\n\nconst USER_PROVIDED_EFFECTS = new InjectionToken('@ngrx/effects User Provided Effects');\n\nconst _ROOT_EFFECTS = new InjectionToken('@ngrx/effects Internal Root Effects');\n\nconst ROOT_EFFECTS = new InjectionToken('@ngrx/effects Root Effects');\n\nconst _FEATURE_EFFECTS = new InjectionToken('@ngrx/effects Internal Feature Effects');\n\nconst FEATURE_EFFECTS = new InjectionToken('@ngrx/effects Feature Effects');\nconst EFFECTS_ERROR_HANDLER = new InjectionToken('@ngrx/effects Effects Error Handler');\n\nclass EffectSources extends Subject {\n  constructor(errorHandler, effectsErrorHandler) {\n    super();\n    this.errorHandler = errorHandler;\n    this.effectsErrorHandler = effectsErrorHandler;\n  }\n\n  addEffects(effectSourceInstance) {\n    this.next(effectSourceInstance);\n  }\n  /**\n   * @internal\n   */\n\n\n  toActions() {\n    return this.pipe(groupBy(getSourceForInstance), mergeMap(source$ => {\n      return source$.pipe(groupBy(effectsInstance));\n    }), mergeMap(source$ => {\n      const effect$ = source$.pipe(exhaustMap(sourceInstance => {\n        return resolveEffectSource(this.errorHandler, this.effectsErrorHandler)(sourceInstance);\n      }), map(output => {\n        reportInvalidActions(output, this.errorHandler);\n        return output.notification;\n      }), filter(notification => notification.kind === 'N' && notification.value != null), dematerialize()); // start the stream with an INIT action\n      // do this only for the first Effect instance\n\n      const init$ = source$.pipe(take(1), filter(isOnInitEffects), map(instance => instance.ngrxOnInitEffects()));\n      return merge(effect$, init$);\n    }));\n  }\n\n}\n/** @nocollapse */\n\n/** @nocollapse */\n\n\nEffectSources.ɵfac = function EffectSources_Factory(t) {\n  return new (t || EffectSources)(i0.ɵɵinject(i0.ErrorHandler), i0.ɵɵinject(EFFECTS_ERROR_HANDLER));\n};\n/** @nocollapse */\n\n/** @nocollapse */\n\n\nEffectSources.ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n  token: EffectSources,\n  factory: EffectSources.ɵfac\n});\n\n(function () {\n  (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(EffectSources, [{\n    type: Injectable\n  }], function () {\n    return [{\n      type: i0.ErrorHandler\n    }, {\n      type: undefined,\n      decorators: [{\n        type: Inject,\n        args: [EFFECTS_ERROR_HANDLER]\n      }]\n    }];\n  }, null);\n})();\n\nfunction effectsInstance(sourceInstance) {\n  if (isOnIdentifyEffects(sourceInstance)) {\n    return sourceInstance.ngrxOnIdentifyEffects();\n  }\n\n  return '';\n}\n\nfunction resolveEffectSource(errorHandler, effectsErrorHandler) {\n  return sourceInstance => {\n    const mergedEffects$ = mergeEffects(sourceInstance, errorHandler, effectsErrorHandler);\n\n    if (isOnRunEffects(sourceInstance)) {\n      return sourceInstance.ngrxOnRunEffects(mergedEffects$);\n    }\n\n    return mergedEffects$;\n  };\n}\n\nclass EffectsRunner {\n  constructor(effectSources, store) {\n    this.effectSources = effectSources;\n    this.store = store;\n    this.effectsSubscription = null;\n  }\n\n  start() {\n    if (!this.effectsSubscription) {\n      this.effectsSubscription = this.effectSources.toActions().subscribe(this.store);\n    }\n  }\n\n  ngOnDestroy() {\n    if (this.effectsSubscription) {\n      this.effectsSubscription.unsubscribe();\n      this.effectsSubscription = null;\n    }\n  }\n\n}\n/** @nocollapse */\n\n/** @nocollapse */\n\n\nEffectsRunner.ɵfac = function EffectsRunner_Factory(t) {\n  return new (t || EffectsRunner)(i0.ɵɵinject(EffectSources), i0.ɵɵinject(i3.Store));\n};\n/** @nocollapse */\n\n/** @nocollapse */\n\n\nEffectsRunner.ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n  token: EffectsRunner,\n  factory: EffectsRunner.ɵfac\n});\n\n(function () {\n  (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(EffectsRunner, [{\n    type: Injectable\n  }], function () {\n    return [{\n      type: EffectSources\n    }, {\n      type: i3.Store\n    }];\n  }, null);\n})();\n\nconst ROOT_EFFECTS_INIT = '@ngrx/effects/init';\nconst rootEffectsInit = createAction(ROOT_EFFECTS_INIT);\n\nclass EffectsRootModule {\n  constructor(sources, runner, store, rootEffects, storeRootModule, storeFeatureModule, guard) {\n    this.sources = sources;\n    runner.start();\n    rootEffects.forEach(effectSourceInstance => sources.addEffects(effectSourceInstance));\n    store.dispatch({\n      type: ROOT_EFFECTS_INIT\n    });\n  }\n\n  addEffects(effectSourceInstance) {\n    this.sources.addEffects(effectSourceInstance);\n  }\n\n}\n/** @nocollapse */\n\n/** @nocollapse */\n\n\nEffectsRootModule.ɵfac = function EffectsRootModule_Factory(t) {\n  return new (t || EffectsRootModule)(i0.ɵɵinject(EffectSources), i0.ɵɵinject(EffectsRunner), i0.ɵɵinject(i3.Store), i0.ɵɵinject(ROOT_EFFECTS), i0.ɵɵinject(i3.StoreRootModule, 8), i0.ɵɵinject(i3.StoreFeatureModule, 8), i0.ɵɵinject(_ROOT_EFFECTS_GUARD, 8));\n};\n/** @nocollapse */\n\n/** @nocollapse */\n\n\nEffectsRootModule.ɵmod = /* @__PURE__ */i0.ɵɵdefineNgModule({\n  type: EffectsRootModule\n});\n/** @nocollapse */\n\n/** @nocollapse */\n\nEffectsRootModule.ɵinj = /* @__PURE__ */i0.ɵɵdefineInjector({});\n\n(function () {\n  (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(EffectsRootModule, [{\n    type: NgModule,\n    args: [{}]\n  }], function () {\n    return [{\n      type: EffectSources\n    }, {\n      type: EffectsRunner\n    }, {\n      type: i3.Store\n    }, {\n      type: undefined,\n      decorators: [{\n        type: Inject,\n        args: [ROOT_EFFECTS]\n      }]\n    }, {\n      type: i3.StoreRootModule,\n      decorators: [{\n        type: Optional\n      }]\n    }, {\n      type: i3.StoreFeatureModule,\n      decorators: [{\n        type: Optional\n      }]\n    }, {\n      type: undefined,\n      decorators: [{\n        type: Optional\n      }, {\n        type: Inject,\n        args: [_ROOT_EFFECTS_GUARD]\n      }]\n    }];\n  }, null);\n})();\n\nclass EffectsFeatureModule {\n  constructor(root, effectSourceGroups, storeRootModule, storeFeatureModule) {\n    effectSourceGroups.forEach(group => group.forEach(effectSourceInstance => root.addEffects(effectSourceInstance)));\n  }\n\n}\n/** @nocollapse */\n\n/** @nocollapse */\n\n\nEffectsFeatureModule.ɵfac = function EffectsFeatureModule_Factory(t) {\n  return new (t || EffectsFeatureModule)(i0.ɵɵinject(EffectsRootModule), i0.ɵɵinject(FEATURE_EFFECTS), i0.ɵɵinject(i3.StoreRootModule, 8), i0.ɵɵinject(i3.StoreFeatureModule, 8));\n};\n/** @nocollapse */\n\n/** @nocollapse */\n\n\nEffectsFeatureModule.ɵmod = /* @__PURE__ */i0.ɵɵdefineNgModule({\n  type: EffectsFeatureModule\n});\n/** @nocollapse */\n\n/** @nocollapse */\n\nEffectsFeatureModule.ɵinj = /* @__PURE__ */i0.ɵɵdefineInjector({});\n\n(function () {\n  (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(EffectsFeatureModule, [{\n    type: NgModule,\n    args: [{}]\n  }], function () {\n    return [{\n      type: EffectsRootModule\n    }, {\n      type: undefined,\n      decorators: [{\n        type: Inject,\n        args: [FEATURE_EFFECTS]\n      }]\n    }, {\n      type: i3.StoreRootModule,\n      decorators: [{\n        type: Optional\n      }]\n    }, {\n      type: i3.StoreFeatureModule,\n      decorators: [{\n        type: Optional\n      }]\n    }];\n  }, null);\n})();\n\nclass EffectsModule {\n  static forFeature(featureEffects = []) {\n    return {\n      ngModule: EffectsFeatureModule,\n      providers: [featureEffects, {\n        provide: _FEATURE_EFFECTS,\n        multi: true,\n        useValue: featureEffects\n      }, {\n        provide: USER_PROVIDED_EFFECTS,\n        multi: true,\n        useValue: []\n      }, {\n        provide: FEATURE_EFFECTS,\n        multi: true,\n        useFactory: createEffects,\n        deps: [Injector, _FEATURE_EFFECTS, USER_PROVIDED_EFFECTS]\n      }]\n    };\n  }\n\n  static forRoot(rootEffects = []) {\n    return {\n      ngModule: EffectsRootModule,\n      providers: [{\n        provide: EFFECTS_ERROR_HANDLER,\n        useValue: defaultEffectsErrorHandler\n      }, EffectsRunner, EffectSources, Actions, rootEffects, {\n        provide: _ROOT_EFFECTS,\n        useValue: [rootEffects]\n      }, {\n        provide: _ROOT_EFFECTS_GUARD,\n        useFactory: _provideForRootGuard,\n        deps: [[EffectsRunner, new Optional(), new SkipSelf()], [_ROOT_EFFECTS, new Self()]]\n      }, {\n        provide: USER_PROVIDED_EFFECTS,\n        multi: true,\n        useValue: []\n      }, {\n        provide: ROOT_EFFECTS,\n        useFactory: createEffects,\n        deps: [Injector, _ROOT_EFFECTS, USER_PROVIDED_EFFECTS]\n      }]\n    };\n  }\n\n}\n/** @nocollapse */\n\n/** @nocollapse */\n\n\nEffectsModule.ɵfac = function EffectsModule_Factory(t) {\n  return new (t || EffectsModule)();\n};\n/** @nocollapse */\n\n/** @nocollapse */\n\n\nEffectsModule.ɵmod = /* @__PURE__ */i0.ɵɵdefineNgModule({\n  type: EffectsModule\n});\n/** @nocollapse */\n\n/** @nocollapse */\n\nEffectsModule.ɵinj = /* @__PURE__ */i0.ɵɵdefineInjector({});\n\n(function () {\n  (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(EffectsModule, [{\n    type: NgModule,\n    args: [{}]\n  }], null, null);\n})();\n\nfunction createEffects(injector, effectGroups, userProvidedEffectGroups) {\n  const mergedEffects = [];\n\n  for (const effectGroup of effectGroups) {\n    mergedEffects.push(...effectGroup);\n  }\n\n  for (const userProvidedEffectGroup of userProvidedEffectGroups) {\n    mergedEffects.push(...userProvidedEffectGroup);\n  }\n\n  return createEffectInstances(injector, mergedEffects);\n}\n\nfunction createEffectInstances(injector, effects) {\n  return effects.map(effect => injector.get(effect));\n}\n\nfunction _provideForRootGuard(runner, rootEffects) {\n  // check whether any effects are actually passed\n  const hasEffects = !(rootEffects.length === 1 && rootEffects[0].length === 0);\n\n  if (hasEffects && runner) {\n    throw new TypeError(`EffectsModule.forRoot() called twice. Feature modules should use EffectsModule.forFeature() instead.`);\n  }\n\n  return 'guarded';\n}\n/**\n * Wraps project fn with error handling making it safe to use in Effects.\n * Takes either a config with named properties that represent different possible\n * callbacks or project/error callbacks that are required.\n */\n\n\nfunction act(\n/** Allow to take either config object or project/error functions */\nconfigOrProject, errorFn) {\n  const {\n    project,\n    error,\n    complete,\n    operator,\n    unsubscribe\n  } = typeof configOrProject === 'function' ? {\n    project: configOrProject,\n    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n    error: errorFn,\n    operator: concatMap,\n    complete: undefined,\n    unsubscribe: undefined\n  } : Object.assign(Object.assign({}, configOrProject), {\n    operator: configOrProject.operator || concatMap\n  });\n  return source => defer(() => {\n    const subject = new Subject();\n    return merge(source.pipe(operator((input, index) => defer(() => {\n      let completed = false;\n      let errored = false;\n      let projectedCount = 0;\n      return project(input, index).pipe(materialize(), map(notification => {\n        switch (notification.kind) {\n          case 'E':\n            errored = true;\n            return new Notification('N', error(notification.error, input));\n\n          case 'C':\n            completed = true;\n            return complete ? new Notification('N', complete(projectedCount, input)) : undefined;\n\n          default:\n            ++projectedCount;\n            return notification;\n        }\n      }), filter(n => n != null), dematerialize(), finalize(() => {\n        if (!completed && !errored && unsubscribe) {\n          subject.next(unsubscribe(projectedCount, input));\n        }\n      }));\n    }))), subject);\n  });\n}\n/**\n * `concatLatestFrom` combines the source value\n * and the last available value from a lazily evaluated Observable\n * in a new array\n *\n * @usageNotes\n *\n * Select the active customer from the NgRx Store\n *\n * ```ts\n * import { concatLatestFrom } from '@ngrx/effects';\n * import * fromCustomers from '../customers';\n *\n * this.actions$.pipe(\n *  concatLatestFrom(() => this.store.select(fromCustomers.selectActiveCustomer))\n * )\n * ```\n *\n * Select a customer from the NgRx Store by its id that is available on the action\n *\n * ```ts\n * import { concatLatestFrom } from '@ngrx/effects';\n * import * fromCustomers from '../customers';\n *\n * this.actions$.pipe(\n *  concatLatestFrom((action) => this.store.select(fromCustomers.selectCustomer(action.customerId)))\n * )\n * ```\n */\n\n\nfunction concatLatestFrom(observablesFactory) {\n  return pipe(concatMap(value => {\n    const observables = observablesFactory(value);\n    const observablesAsArray = Array.isArray(observables) ? observables : [observables];\n    return of(value).pipe(withLatestFrom(...observablesAsArray));\n  }));\n}\n/**\n * DO NOT EDIT\n *\n * This file is automatically generated at build\n */\n\n/**\n * Generated bundle index. Do not edit.\n */\n\n\nexport { Actions, EFFECTS_ERROR_HANDLER, Effect, EffectSources, EffectsFeatureModule, EffectsModule, EffectsRootModule, EffectsRunner, ROOT_EFFECTS_INIT, USER_PROVIDED_EFFECTS, act, concatLatestFrom, createEffect, defaultEffectsErrorHandler, getEffectsMetadata, mergeEffects, ofType, rootEffectsInit };","map":{"version":3,"sources":["D:/Development/Work/CENOS/cenos-ui/node_modules/@ngrx/effects/fesm2015/ngrx-effects.mjs"],"names":["i3","compose","ScannedActionsSubject","createAction","i1","merge","Observable","Subject","defer","Notification","pipe","of","ignoreElements","materialize","map","catchError","filter","groupBy","mergeMap","exhaustMap","dematerialize","take","concatMap","finalize","withLatestFrom","i0","Injectable","Inject","InjectionToken","NgModule","Optional","Injector","SkipSelf","Self","DEFAULT_EFFECT_CONFIG","dispatch","useEffectsErrorHandler","CREATE_EFFECT_METADATA_KEY","createEffect","source","config","effect","value","Object","assign","defineProperty","getCreateEffectMetadata","instance","propertyNames","getOwnPropertyNames","metadata","propertyName","hasOwnProperty","property","metaData","getSourceForInstance","getPrototypeOf","METADATA_KEY","Effect","target","addEffectMetadataEntry","getEffectDecoratorMetadata","effectsDecorators","getEffectMetadataEntries","hasMetadataEntries","sourceProto","constructor","push","getEffectsMetadata","getSourceMetadata","reduce","acc","effects","sources","concat","mergeEffects","sourceInstance","globalErrorHandler","effectsErrorHandler","sourceName","name","observables$","observable$","effectAction$","materialized$","notification","MAX_NUMBER_OF_RETRY_ATTEMPTS","defaultEffectsErrorHandler","errorHandler","retryAttemptLeft","error","handleError","Actions","lift","operator","observable","ɵfac","ɵprov","type","decorators","args","ofType","allowedTypes","action","some","typeOrActionCreator","reportInvalidActions","output","reporter","kind","isInvalidAction","isAction","Error","getEffectName","stringify","isMethod","String","JSON","_a","onIdentifyEffectsKey","isOnIdentifyEffects","isFunction","onRunEffectsKey","isOnRunEffects","onInitEffects","isOnInitEffects","functionName","_ROOT_EFFECTS_GUARD","USER_PROVIDED_EFFECTS","_ROOT_EFFECTS","ROOT_EFFECTS","_FEATURE_EFFECTS","FEATURE_EFFECTS","EFFECTS_ERROR_HANDLER","EffectSources","addEffects","effectSourceInstance","next","toActions","source$","effectsInstance","effect$","resolveEffectSource","init$","ngrxOnInitEffects","ErrorHandler","undefined","ngrxOnIdentifyEffects","mergedEffects$","ngrxOnRunEffects","EffectsRunner","effectSources","store","effectsSubscription","start","subscribe","ngOnDestroy","unsubscribe","Store","ROOT_EFFECTS_INIT","rootEffectsInit","EffectsRootModule","runner","rootEffects","storeRootModule","storeFeatureModule","guard","forEach","StoreRootModule","StoreFeatureModule","ɵmod","ɵinj","EffectsFeatureModule","root","effectSourceGroups","group","EffectsModule","forFeature","featureEffects","ngModule","providers","provide","multi","useValue","useFactory","createEffects","deps","forRoot","_provideForRootGuard","injector","effectGroups","userProvidedEffectGroups","mergedEffects","effectGroup","userProvidedEffectGroup","createEffectInstances","get","hasEffects","length","TypeError","act","configOrProject","errorFn","project","complete","subject","input","index","completed","errored","projectedCount","n","concatLatestFrom","observablesFactory","observables","observablesAsArray","Array","isArray"],"mappings":"AAAA,OAAO,KAAKA,EAAZ,MAAoB,aAApB;AACA,SAASC,OAAT,EAAkBC,qBAAlB,EAAyCC,YAAzC,QAA6D,aAA7D;AACA,OAAO,KAAKC,EAAZ,MAAoB,MAApB;AACA,SAASC,KAAT,EAAgBC,UAAhB,EAA4BC,OAA5B,EAAqCC,KAArC,EAA4CC,YAA5C,EAA0DC,IAA1D,EAAgEC,EAAhE,QAA0E,MAA1E;AACA,SAASC,cAAT,EAAyBC,WAAzB,EAAsCC,GAAtC,EAA2CC,UAA3C,EAAuDC,MAAvD,EAA+DC,OAA/D,EAAwEC,QAAxE,EAAkFC,UAAlF,EAA8FC,aAA9F,EAA6GC,IAA7G,EAAmHC,SAAnH,EAA8HC,QAA9H,EAAwIC,cAAxI,QAA8J,gBAA9J;AACA,OAAO,KAAKC,EAAZ,MAAoB,eAApB;AACA,SAASC,UAAT,EAAqBC,MAArB,EAA6BC,cAA7B,EAA6CC,QAA7C,EAAuDC,QAAvD,EAAiEC,QAAjE,EAA2EC,QAA3E,EAAqFC,IAArF,QAAiG,eAAjG;AAEA,MAAMC,qBAAqB,GAAG;AAC1BC,EAAAA,QAAQ,EAAE,IADgB;AAE1BC,EAAAA,sBAAsB,EAAE;AAFE,CAA9B;AAIA,MAAMC,0BAA0B,GAAG,0BAAnC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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AtQ,EAAoR0B,MAApR,EAA4R2D,eAA5R","sourcesContent":["import * as i3 from '@ngrx/store';\nimport { compose, ScannedActionsSubject, createAction } from '@ngrx/store';\nimport * as i1 from 'rxjs';\nimport { merge, Observable, Subject, defer, Notification, pipe, of } from 'rxjs';\nimport { ignoreElements, materialize, map, catchError, filter, groupBy, mergeMap, exhaustMap, dematerialize, take, concatMap, finalize, withLatestFrom } from 'rxjs/operators';\nimport * as i0 from '@angular/core';\nimport { Injectable, Inject, InjectionToken, NgModule, Optional, Injector, SkipSelf, Self } from '@angular/core';\n\nconst DEFAULT_EFFECT_CONFIG = {\n    dispatch: true,\n    useEffectsErrorHandler: true,\n};\nconst CREATE_EFFECT_METADATA_KEY = '__@ngrx/effects_create__';\n\n/**\n * @description\n * Creates an effect from an `Observable` and an `EffectConfig`.\n *\n * @param source A function which returns an `Observable`.\n * @param config A `Partial<EffectConfig>` to configure the effect.  By default, `dispatch` is true and `useEffectsErrorHandler` is true.\n * @returns If `EffectConfig`#`dispatch` is true, returns `Observable<Action>`.  Else, returns `Observable<unknown>`.\n *\n * @usageNotes\n *\n * ** Mapping to a different action **\n * ```ts\n * effectName$ = createEffect(\n *   () => this.actions$.pipe(\n *     ofType(FeatureActions.actionOne),\n *     map(() => FeatureActions.actionTwo())\n *   )\n * );\n * ```\n *\n *  ** Non-dispatching effects **\n * ```ts\n * effectName$ = createEffect(\n *   () => this.actions$.pipe(\n *     ofType(FeatureActions.actionOne),\n *     tap(() => console.log('Action One Dispatched'))\n *   ),\n *   { dispatch: false }\n *   // FeatureActions.actionOne is not dispatched\n * );\n * ```\n */\nfunction createEffect(source, config) {\n    const effect = source();\n    const value = Object.assign(Object.assign({}, DEFAULT_EFFECT_CONFIG), config);\n    Object.defineProperty(effect, CREATE_EFFECT_METADATA_KEY, {\n        value,\n    });\n    return effect;\n}\nfunction getCreateEffectMetadata(instance) {\n    const propertyNames = Object.getOwnPropertyNames(instance);\n    const metadata = propertyNames\n        .filter((propertyName) => {\n        if (instance[propertyName] &&\n            instance[propertyName].hasOwnProperty(CREATE_EFFECT_METADATA_KEY)) {\n            // If the property type has overridden `hasOwnProperty` we need to ensure\n            // that the metadata is valid (containing a `dispatch`property)\n            // https://github.com/ngrx/platform/issues/2975\n            const property = instance[propertyName];\n            return property[CREATE_EFFECT_METADATA_KEY].hasOwnProperty('dispatch');\n        }\n        return false;\n    })\n        .map((propertyName) => {\n        const metaData = instance[propertyName][CREATE_EFFECT_METADATA_KEY];\n        return Object.assign({ propertyName }, metaData);\n    });\n    return metadata;\n}\n\nfunction getSourceForInstance(instance) {\n    return Object.getPrototypeOf(instance);\n}\n\nconst METADATA_KEY = '__@ngrx/effects__';\n/**\n * @deprecated The Effect decorator (`@Effect`) is deprecated in favor for the `createEffect` method.\n * See the docs for more info {@link https://ngrx.io/guide/migration/v11#the-effect-decorator}\n */\nfunction Effect(config = {}) {\n    return function (target, propertyName) {\n        const metadata = Object.assign(Object.assign(Object.assign({}, DEFAULT_EFFECT_CONFIG), config), { propertyName });\n        addEffectMetadataEntry(target, metadata);\n    };\n}\nfunction getEffectDecoratorMetadata(instance) {\n    const effectsDecorators = compose(getEffectMetadataEntries, getSourceForInstance)(instance);\n    return effectsDecorators;\n}\n/**\n * Type guard to detemine whether METADATA_KEY is already present on the Class\n * constructor\n */\nfunction hasMetadataEntries(sourceProto) {\n    return sourceProto.constructor.hasOwnProperty(METADATA_KEY);\n}\n/** Add Effect Metadata to the Effect Class constructor under specific key */\nfunction addEffectMetadataEntry(sourceProto, metadata) {\n    if (hasMetadataEntries(sourceProto)) {\n        sourceProto.constructor[METADATA_KEY].push(metadata);\n    }\n    else {\n        Object.defineProperty(sourceProto.constructor, METADATA_KEY, {\n            value: [metadata],\n        });\n    }\n}\nfunction getEffectMetadataEntries(sourceProto) {\n    return hasMetadataEntries(sourceProto)\n        ? sourceProto.constructor[METADATA_KEY]\n        : [];\n}\n\nfunction getEffectsMetadata(instance) {\n    return getSourceMetadata(instance).reduce((acc, { propertyName, dispatch, useEffectsErrorHandler }) => {\n        acc[propertyName] = { dispatch, useEffectsErrorHandler };\n        return acc;\n    }, {});\n}\nfunction getSourceMetadata(instance) {\n    const effects = [\n        getEffectDecoratorMetadata,\n        getCreateEffectMetadata,\n    ];\n    return effects.reduce((sources, source) => sources.concat(source(instance)), []);\n}\n\nfunction mergeEffects(sourceInstance, globalErrorHandler, effectsErrorHandler) {\n    const sourceName = getSourceForInstance(sourceInstance).constructor.name;\n    const observables$ = getSourceMetadata(sourceInstance).map(({ propertyName, dispatch, useEffectsErrorHandler, }) => {\n        const observable$ = typeof sourceInstance[propertyName] === 'function'\n            ? sourceInstance[propertyName]()\n            : sourceInstance[propertyName];\n        const effectAction$ = useEffectsErrorHandler\n            ? effectsErrorHandler(observable$, globalErrorHandler)\n            : observable$;\n        if (dispatch === false) {\n            return effectAction$.pipe(ignoreElements());\n        }\n        const materialized$ = effectAction$.pipe(materialize());\n        return materialized$.pipe(map((notification) => ({\n            effect: sourceInstance[propertyName],\n            notification,\n            propertyName,\n            sourceName,\n            sourceInstance,\n        })));\n    });\n    return merge(...observables$);\n}\n\nconst MAX_NUMBER_OF_RETRY_ATTEMPTS = 10;\nfunction defaultEffectsErrorHandler(observable$, errorHandler, retryAttemptLeft = MAX_NUMBER_OF_RETRY_ATTEMPTS) {\n    return observable$.pipe(catchError((error) => {\n        if (errorHandler)\n            errorHandler.handleError(error);\n        if (retryAttemptLeft <= 1) {\n            return observable$; // last attempt\n        }\n        // Return observable that produces this particular effect\n        return defaultEffectsErrorHandler(observable$, errorHandler, retryAttemptLeft - 1);\n    }));\n}\n\nclass Actions extends Observable {\n    constructor(source) {\n        super();\n        if (source) {\n            this.source = source;\n        }\n    }\n    lift(operator) {\n        const observable = new Actions();\n        observable.source = this;\n        observable.operator = operator;\n        return observable;\n    }\n}\n/** @nocollapse */ /** @nocollapse */ Actions.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"13.0.0\", ngImport: i0, type: Actions, deps: [{ token: ScannedActionsSubject }], target: i0.ɵɵFactoryTarget.Injectable });\n/** @nocollapse */ /** @nocollapse */ Actions.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"13.0.0\", ngImport: i0, type: Actions });\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"13.0.0\", ngImport: i0, type: Actions, decorators: [{\n            type: Injectable\n        }], ctorParameters: function () {\n        return [{ type: i1.Observable, decorators: [{\n                        type: Inject,\n                        args: [ScannedActionsSubject]\n                    }] }];\n    } });\n/**\n * `ofType` filters an Observable of `Actions` into an Observable of the actions\n * whose type strings are passed to it.\n *\n * For example, if `actions` has type `Actions<AdditionAction|SubstractionAction>`, and\n * the type of the `Addition` action is `add`, then\n * `actions.pipe(ofType('add'))` returns an `Observable<AdditionAction>`.\n *\n * Properly typing this function is hard and requires some advanced TS tricks\n * below.\n *\n * Type narrowing automatically works, as long as your `actions` object\n * starts with a `Actions<SomeUnionOfActions>` instead of generic `Actions`.\n *\n * For backwards compatibility, when one passes a single type argument\n * `ofType<T>('something')` the result is an `Observable<T>`. Note, that `T`\n * completely overrides any possible inference from 'something'.\n *\n * Unfortunately, for unknown 'actions: Actions' these types will produce\n * 'Observable<never>'. In such cases one has to manually set the generic type\n * like `actions.ofType<AdditionAction>('add')`.\n *\n * @usageNotes\n *\n * Filter the Actions stream on the \"customers page loaded\" action\n *\n * ```ts\n * import { ofType } from '@ngrx/effects';\n * import * fromCustomers from '../customers';\n *\n * this.actions$.pipe(\n *  ofType(fromCustomers.pageLoaded)\n * )\n * ```\n */\nfunction ofType(...allowedTypes) {\n    return filter((action) => allowedTypes.some((typeOrActionCreator) => {\n        if (typeof typeOrActionCreator === 'string') {\n            // Comparing the string to type\n            return typeOrActionCreator === action.type;\n        }\n        // We are filtering by ActionCreator\n        return typeOrActionCreator.type === action.type;\n    }));\n}\n\nfunction reportInvalidActions(output, reporter) {\n    if (output.notification.kind === 'N') {\n        const action = output.notification.value;\n        const isInvalidAction = !isAction(action);\n        if (isInvalidAction) {\n            reporter.handleError(new Error(`Effect ${getEffectName(output)} dispatched an invalid action: ${stringify(action)}`));\n        }\n    }\n}\nfunction isAction(action) {\n    return (typeof action !== 'function' &&\n        action &&\n        action.type &&\n        typeof action.type === 'string');\n}\nfunction getEffectName({ propertyName, sourceInstance, sourceName, }) {\n    const isMethod = typeof sourceInstance[propertyName] === 'function';\n    return `\"${sourceName}.${String(propertyName)}${isMethod ? '()' : ''}\"`;\n}\nfunction stringify(action) {\n    try {\n        return JSON.stringify(action);\n    }\n    catch (_a) {\n        return action;\n    }\n}\n\nconst onIdentifyEffectsKey = 'ngrxOnIdentifyEffects';\nfunction isOnIdentifyEffects(instance) {\n    return isFunction(instance, onIdentifyEffectsKey);\n}\nconst onRunEffectsKey = 'ngrxOnRunEffects';\nfunction isOnRunEffects(instance) {\n    return isFunction(instance, onRunEffectsKey);\n}\nconst onInitEffects = 'ngrxOnInitEffects';\nfunction isOnInitEffects(instance) {\n    return isFunction(instance, onInitEffects);\n}\nfunction isFunction(instance, functionName) {\n    return (instance &&\n        functionName in instance &&\n        typeof instance[functionName] === 'function');\n}\n\nconst _ROOT_EFFECTS_GUARD = new InjectionToken('@ngrx/effects Internal Root Guard');\nconst USER_PROVIDED_EFFECTS = new InjectionToken('@ngrx/effects User Provided Effects');\nconst _ROOT_EFFECTS = new InjectionToken('@ngrx/effects Internal Root Effects');\nconst ROOT_EFFECTS = new InjectionToken('@ngrx/effects Root Effects');\nconst _FEATURE_EFFECTS = new InjectionToken('@ngrx/effects Internal Feature Effects');\nconst FEATURE_EFFECTS = new InjectionToken('@ngrx/effects Feature Effects');\nconst EFFECTS_ERROR_HANDLER = new InjectionToken('@ngrx/effects Effects Error Handler');\n\nclass EffectSources extends Subject {\n    constructor(errorHandler, effectsErrorHandler) {\n        super();\n        this.errorHandler = errorHandler;\n        this.effectsErrorHandler = effectsErrorHandler;\n    }\n    addEffects(effectSourceInstance) {\n        this.next(effectSourceInstance);\n    }\n    /**\n     * @internal\n     */\n    toActions() {\n        return this.pipe(groupBy(getSourceForInstance), mergeMap((source$) => {\n            return source$.pipe(groupBy(effectsInstance));\n        }), mergeMap((source$) => {\n            const effect$ = source$.pipe(exhaustMap((sourceInstance) => {\n                return resolveEffectSource(this.errorHandler, this.effectsErrorHandler)(sourceInstance);\n            }), map((output) => {\n                reportInvalidActions(output, this.errorHandler);\n                return output.notification;\n            }), filter((notification) => notification.kind === 'N' && notification.value != null), dematerialize());\n            // start the stream with an INIT action\n            // do this only for the first Effect instance\n            const init$ = source$.pipe(take(1), filter(isOnInitEffects), map((instance) => instance.ngrxOnInitEffects()));\n            return merge(effect$, init$);\n        }));\n    }\n}\n/** @nocollapse */ /** @nocollapse */ EffectSources.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"13.0.0\", ngImport: i0, type: EffectSources, deps: [{ token: i0.ErrorHandler }, { token: EFFECTS_ERROR_HANDLER }], target: i0.ɵɵFactoryTarget.Injectable });\n/** @nocollapse */ /** @nocollapse */ EffectSources.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"13.0.0\", ngImport: i0, type: EffectSources });\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"13.0.0\", ngImport: i0, type: EffectSources, decorators: [{\n            type: Injectable\n        }], ctorParameters: function () {\n        return [{ type: i0.ErrorHandler }, { type: undefined, decorators: [{\n                        type: Inject,\n                        args: [EFFECTS_ERROR_HANDLER]\n                    }] }];\n    } });\nfunction effectsInstance(sourceInstance) {\n    if (isOnIdentifyEffects(sourceInstance)) {\n        return sourceInstance.ngrxOnIdentifyEffects();\n    }\n    return '';\n}\nfunction resolveEffectSource(errorHandler, effectsErrorHandler) {\n    return (sourceInstance) => {\n        const mergedEffects$ = mergeEffects(sourceInstance, errorHandler, effectsErrorHandler);\n        if (isOnRunEffects(sourceInstance)) {\n            return sourceInstance.ngrxOnRunEffects(mergedEffects$);\n        }\n        return mergedEffects$;\n    };\n}\n\nclass EffectsRunner {\n    constructor(effectSources, store) {\n        this.effectSources = effectSources;\n        this.store = store;\n        this.effectsSubscription = null;\n    }\n    start() {\n        if (!this.effectsSubscription) {\n            this.effectsSubscription = this.effectSources\n                .toActions()\n                .subscribe(this.store);\n        }\n    }\n    ngOnDestroy() {\n        if (this.effectsSubscription) {\n            this.effectsSubscription.unsubscribe();\n            this.effectsSubscription = null;\n        }\n    }\n}\n/** @nocollapse */ /** @nocollapse */ EffectsRunner.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"13.0.0\", ngImport: i0, type: EffectsRunner, deps: [{ token: EffectSources }, { token: i3.Store }], target: i0.ɵɵFactoryTarget.Injectable });\n/** @nocollapse */ /** @nocollapse */ EffectsRunner.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"13.0.0\", ngImport: i0, type: EffectsRunner });\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"13.0.0\", ngImport: i0, type: EffectsRunner, decorators: [{\n            type: Injectable\n        }], ctorParameters: function () { return [{ type: EffectSources }, { type: i3.Store }]; } });\n\nconst ROOT_EFFECTS_INIT = '@ngrx/effects/init';\nconst rootEffectsInit = createAction(ROOT_EFFECTS_INIT);\nclass EffectsRootModule {\n    constructor(sources, runner, store, rootEffects, storeRootModule, storeFeatureModule, guard) {\n        this.sources = sources;\n        runner.start();\n        rootEffects.forEach((effectSourceInstance) => sources.addEffects(effectSourceInstance));\n        store.dispatch({ type: ROOT_EFFECTS_INIT });\n    }\n    addEffects(effectSourceInstance) {\n        this.sources.addEffects(effectSourceInstance);\n    }\n}\n/** @nocollapse */ /** @nocollapse */ EffectsRootModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"13.0.0\", ngImport: i0, type: EffectsRootModule, deps: [{ token: EffectSources }, { token: EffectsRunner }, { token: i3.Store }, { token: ROOT_EFFECTS }, { token: i3.StoreRootModule, optional: true }, { token: i3.StoreFeatureModule, optional: true }, { token: _ROOT_EFFECTS_GUARD, optional: true }], target: i0.ɵɵFactoryTarget.NgModule });\n/** @nocollapse */ /** @nocollapse */ EffectsRootModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: \"12.0.0\", version: \"13.0.0\", ngImport: i0, type: EffectsRootModule });\n/** @nocollapse */ /** @nocollapse */ EffectsRootModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: \"12.0.0\", version: \"13.0.0\", ngImport: i0, type: EffectsRootModule });\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"13.0.0\", ngImport: i0, type: EffectsRootModule, decorators: [{\n            type: NgModule,\n            args: [{}]\n        }], ctorParameters: function () {\n        return [{ type: EffectSources }, { type: EffectsRunner }, { type: i3.Store }, { type: undefined, decorators: [{\n                        type: Inject,\n                        args: [ROOT_EFFECTS]\n                    }] }, { type: i3.StoreRootModule, decorators: [{\n                        type: Optional\n                    }] }, { type: i3.StoreFeatureModule, decorators: [{\n                        type: Optional\n                    }] }, { type: undefined, decorators: [{\n                        type: Optional\n                    }, {\n                        type: Inject,\n                        args: [_ROOT_EFFECTS_GUARD]\n                    }] }];\n    } });\n\nclass EffectsFeatureModule {\n    constructor(root, effectSourceGroups, storeRootModule, storeFeatureModule) {\n        effectSourceGroups.forEach((group) => group.forEach((effectSourceInstance) => root.addEffects(effectSourceInstance)));\n    }\n}\n/** @nocollapse */ /** @nocollapse */ EffectsFeatureModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"13.0.0\", ngImport: i0, type: EffectsFeatureModule, deps: [{ token: EffectsRootModule }, { token: FEATURE_EFFECTS }, { token: i3.StoreRootModule, optional: true }, { token: i3.StoreFeatureModule, optional: true }], target: i0.ɵɵFactoryTarget.NgModule });\n/** @nocollapse */ /** @nocollapse */ EffectsFeatureModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: \"12.0.0\", version: \"13.0.0\", ngImport: i0, type: EffectsFeatureModule });\n/** @nocollapse */ /** @nocollapse */ EffectsFeatureModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: \"12.0.0\", version: \"13.0.0\", ngImport: i0, type: EffectsFeatureModule });\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"13.0.0\", ngImport: i0, type: EffectsFeatureModule, decorators: [{\n            type: NgModule,\n            args: [{}]\n        }], ctorParameters: function () {\n        return [{ type: EffectsRootModule }, { type: undefined, decorators: [{\n                        type: Inject,\n                        args: [FEATURE_EFFECTS]\n                    }] }, { type: i3.StoreRootModule, decorators: [{\n                        type: Optional\n                    }] }, { type: i3.StoreFeatureModule, decorators: [{\n                        type: Optional\n                    }] }];\n    } });\n\nclass EffectsModule {\n    static forFeature(featureEffects = []) {\n        return {\n            ngModule: EffectsFeatureModule,\n            providers: [\n                featureEffects,\n                {\n                    provide: _FEATURE_EFFECTS,\n                    multi: true,\n                    useValue: featureEffects,\n                },\n                {\n                    provide: USER_PROVIDED_EFFECTS,\n                    multi: true,\n                    useValue: [],\n                },\n                {\n                    provide: FEATURE_EFFECTS,\n                    multi: true,\n                    useFactory: createEffects,\n                    deps: [Injector, _FEATURE_EFFECTS, USER_PROVIDED_EFFECTS],\n                },\n            ],\n        };\n    }\n    static forRoot(rootEffects = []) {\n        return {\n            ngModule: EffectsRootModule,\n            providers: [\n                {\n                    provide: EFFECTS_ERROR_HANDLER,\n                    useValue: defaultEffectsErrorHandler,\n                },\n                EffectsRunner,\n                EffectSources,\n                Actions,\n                rootEffects,\n                {\n                    provide: _ROOT_EFFECTS,\n                    useValue: [rootEffects],\n                },\n                {\n                    provide: _ROOT_EFFECTS_GUARD,\n                    useFactory: _provideForRootGuard,\n                    deps: [\n                        [EffectsRunner, new Optional(), new SkipSelf()],\n                        [_ROOT_EFFECTS, new Self()],\n                    ],\n                },\n                {\n                    provide: USER_PROVIDED_EFFECTS,\n                    multi: true,\n                    useValue: [],\n                },\n                {\n                    provide: ROOT_EFFECTS,\n                    useFactory: createEffects,\n                    deps: [Injector, _ROOT_EFFECTS, USER_PROVIDED_EFFECTS],\n                },\n            ],\n        };\n    }\n}\n/** @nocollapse */ /** @nocollapse */ EffectsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"13.0.0\", ngImport: i0, type: EffectsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });\n/** @nocollapse */ /** @nocollapse */ EffectsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: \"12.0.0\", version: \"13.0.0\", ngImport: i0, type: EffectsModule });\n/** @nocollapse */ /** @nocollapse */ EffectsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: \"12.0.0\", version: \"13.0.0\", ngImport: i0, type: EffectsModule });\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"13.0.0\", ngImport: i0, type: EffectsModule, decorators: [{\n            type: NgModule,\n            args: [{}]\n        }] });\nfunction createEffects(injector, effectGroups, userProvidedEffectGroups) {\n    const mergedEffects = [];\n    for (const effectGroup of effectGroups) {\n        mergedEffects.push(...effectGroup);\n    }\n    for (const userProvidedEffectGroup of userProvidedEffectGroups) {\n        mergedEffects.push(...userProvidedEffectGroup);\n    }\n    return createEffectInstances(injector, mergedEffects);\n}\nfunction createEffectInstances(injector, effects) {\n    return effects.map((effect) => injector.get(effect));\n}\nfunction _provideForRootGuard(runner, rootEffects) {\n    // check whether any effects are actually passed\n    const hasEffects = !(rootEffects.length === 1 && rootEffects[0].length === 0);\n    if (hasEffects && runner) {\n        throw new TypeError(`EffectsModule.forRoot() called twice. Feature modules should use EffectsModule.forFeature() instead.`);\n    }\n    return 'guarded';\n}\n\n/**\n * Wraps project fn with error handling making it safe to use in Effects.\n * Takes either a config with named properties that represent different possible\n * callbacks or project/error callbacks that are required.\n */\nfunction act(\n/** Allow to take either config object or project/error functions */\nconfigOrProject, errorFn) {\n    const { project, error, complete, operator, unsubscribe } = typeof configOrProject === 'function'\n        ? {\n            project: configOrProject,\n            // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n            error: errorFn,\n            operator: concatMap,\n            complete: undefined,\n            unsubscribe: undefined,\n        }\n        : Object.assign(Object.assign({}, configOrProject), { operator: configOrProject.operator || concatMap });\n    return (source) => defer(() => {\n        const subject = new Subject();\n        return merge(source.pipe(operator((input, index) => defer(() => {\n            let completed = false;\n            let errored = false;\n            let projectedCount = 0;\n            return project(input, index).pipe(materialize(), map((notification) => {\n                switch (notification.kind) {\n                    case 'E':\n                        errored = true;\n                        return new Notification('N', error(notification.error, input));\n                    case 'C':\n                        completed = true;\n                        return complete\n                            ? new Notification('N', complete(projectedCount, input))\n                            : undefined;\n                    default:\n                        ++projectedCount;\n                        return notification;\n                }\n            }), filter((n) => n != null), dematerialize(), finalize(() => {\n                if (!completed && !errored && unsubscribe) {\n                    subject.next(unsubscribe(projectedCount, input));\n                }\n            }));\n        }))), subject);\n    });\n}\n\n/**\n * `concatLatestFrom` combines the source value\n * and the last available value from a lazily evaluated Observable\n * in a new array\n *\n * @usageNotes\n *\n * Select the active customer from the NgRx Store\n *\n * ```ts\n * import { concatLatestFrom } from '@ngrx/effects';\n * import * fromCustomers from '../customers';\n *\n * this.actions$.pipe(\n *  concatLatestFrom(() => this.store.select(fromCustomers.selectActiveCustomer))\n * )\n * ```\n *\n * Select a customer from the NgRx Store by its id that is available on the action\n *\n * ```ts\n * import { concatLatestFrom } from '@ngrx/effects';\n * import * fromCustomers from '../customers';\n *\n * this.actions$.pipe(\n *  concatLatestFrom((action) => this.store.select(fromCustomers.selectCustomer(action.customerId)))\n * )\n * ```\n */\nfunction concatLatestFrom(observablesFactory) {\n    return pipe(concatMap((value) => {\n        const observables = observablesFactory(value);\n        const observablesAsArray = Array.isArray(observables)\n            ? observables\n            : [observables];\n        return of(value).pipe(withLatestFrom(...observablesAsArray));\n    }));\n}\n\n/**\n * DO NOT EDIT\n *\n * This file is automatically generated at build\n */\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { Actions, EFFECTS_ERROR_HANDLER, Effect, EffectSources, EffectsFeatureModule, EffectsModule, EffectsRootModule, EffectsRunner, ROOT_EFFECTS_INIT, USER_PROVIDED_EFFECTS, act, concatLatestFrom, createEffect, defaultEffectsErrorHandler, getEffectsMetadata, mergeEffects, ofType, rootEffectsInit };\n"]},"metadata":{},"sourceType":"module"}