{"version":3,"sources":["node_modules/@angular/core/fesm2022/rxjs-interop.mjs","node_modules/@ngrx/store/fesm2022/ngrx-store.mjs","node_modules/@ngx-translate/core/dist/fesm2022/ngx-translate-core.mjs","src/app/shared/data/actions/user.actions.ts","src/app/shared/data/config/auth.config.ts","src/app/app.const.ts","src/app/shared/data/actions/context.actions.ts","src/app/shared/services/logger.service.ts","src/app/shared/services/routing.service.ts","src/app/shared/services/auth.service.ts","node_modules/@angular/forms/fesm2022/forms.mjs","node_modules/@ngbracket/ngx-layout/fesm2022/ngbracket-ngx-layout-_private-utils.mjs","node_modules/@ngbracket/ngx-layout/fesm2022/ngbracket-ngx-layout-core.mjs","node_modules/@angular/cdk/fesm2022/coercion.mjs","node_modules/@ngbracket/ngx-layout/fesm2022/ngbracket-ngx-layout-extended.mjs","node_modules/@angular/cdk/fesm2022/bidi.mjs","node_modules/@ngbracket/ngx-layout/fesm2022/ngbracket-ngx-layout-flex.mjs","node_modules/@ngbracket/ngx-layout/fesm2022/ngbracket-ngx-layout-grid.mjs","node_modules/@ngbracket/ngx-layout/fesm2022/ngbracket-ngx-layout.mjs","src/app/shared/data/actions/subscription.actions.ts","src/app/components/system-banner/system-banner.model.ts","node_modules/marked/lib/marked.esm.js","src/app/shared/services/markdown-converter.service.ts","src/app/components/system-banner/system-banner.component.ts","src/app/components/system-banner/system-banner.component.html","node_modules/uuid/dist/esm-browser/rng.js","node_modules/uuid/dist/esm-browser/stringify.js","node_modules/uuid/dist/esm-browser/native.js","node_modules/uuid/dist/esm-browser/v4.js","src/app/components/toast/toast-message.model.ts","src/app/components/toast/toast-message.service.ts","src/app/shared/services/user-subscriptions.service.ts","src/app/dashboard/integrations/insights/insights.mock.ts","src/app/shared/services/api.service.ts","src/app/dashboard/integrations/insights/iot-insight.service.ts","src/app/components/banner-display-manager/banner-display-manager.component.ts","src/app/components/banner-display-manager/banner-display-manager.component.html","node_modules/@angular/cdk/fesm2022/platform.mjs","node_modules/@angular/cdk/fesm2022/keycodes.mjs","node_modules/@angular/cdk/fesm2022/observers.mjs","node_modules/@angular/cdk/fesm2022/layout.mjs","node_modules/@angular/cdk/fesm2022/a11y.mjs","node_modules/@angular/cdk/fesm2022/cdk.mjs","node_modules/@angular/material/fesm2022/core.mjs","node_modules/@angular/material/fesm2022/checkbox.mjs","node_modules/@angular/cdk/fesm2022/collections.mjs","node_modules/@angular/cdk/fesm2022/scrolling.mjs","node_modules/@angular/cdk/fesm2022/portal.mjs","node_modules/@angular/cdk/fesm2022/overlay.mjs","node_modules/@angular/cdk/fesm2022/observers/private.mjs","node_modules/@angular/animations/fesm2022/animations.mjs","node_modules/@angular/material/fesm2022/form-field.mjs","node_modules/@angular/material/fesm2022/select.mjs","node_modules/@angular/material/fesm2022/tooltip.mjs","src/app/components/custom-select/custom-select.component.ts","src/app/components/custom-select/custom-select.component.html","src/app/shared/data/actions/interface.actions.ts","src/app/shared/services/user.service.ts","src/app/components/button/button.component.ts","src/app/components/button/button.component.html","src/app/shared/util/simple-changes.util.ts","src/app/components/container-dialog/container-dialog.component.ts","src/app/components/container-dialog/container-dialog.component.html","src/app/global/layout/public-footer/public-footer.component.ts","src/app/global/layout/public-footer/public-footer.component.html","src/app/components/error/error.component.ts","src/app/components/error/error.component.html","src/app/components/gray-box/gray-box.component.ts","src/app/components/gray-box/gray-box.component.html","src/app/components/idplogo/idplogo.component.ts","src/app/components/idplogo/idplogo.component.html","src/app/components/loading-indicator/loading-indicator.service.ts","src/app/components/loading-indicator/loading-indicator.component.ts","src/app/components/loading-indicator/loading-indicator.component.html","src/app/shared/frok/atoms/activity-indicator/activity-indicator.component.ts","src/app/shared/frok/atoms/activity-indicator/activity-indicator.component.html","src/app/shared/frok/atoms/radio-button/radio-button.component.ts","src/app/shared/frok/atoms/radio-button/radio-button.component.html","src/app/components/markdown-editor/markdown-editor.component.ts","src/app/components/markdown-editor/markdown-editor.component.html","src/app/components/rating/rating.component.ts","src/app/components/rating/rating.component.html","src/app/components/search-box/search-box.component.ts","src/app/components/search-box/search-box.component.html","src/app/components/sort-config/sort-config.component.ts","src/app/components/sort-config/sort-config.component.html","src/app/shared/misc/redeem-code/redeem-code.component.ts","src/app/shared/misc/redeem-code/redeem-code.component.html","src/app/shared/services/menu.service.ts","src/app/shared/services/overlay.service.ts","src/app/dashboard/layout/sidebar/sidebar.component.ts","src/app/dashboard/layout/sidebar/sidebar.component.html","src/app/shared/services/quota-notifier.service.ts","src/app/pages/join-demo/join-demo.service.ts","src/app/dashboard/layout/dashboard-header/user-menu/user-menu.component.ts","src/app/dashboard/layout/dashboard-header/user-menu/user-menu.component.html","src/app/dashboard/layout/dashboard-header/dashboard-header.component.ts","src/app/dashboard/layout/dashboard-header/dashboard-header.component.html"],"sourcesContent":["/**\n * @license Angular v17.2.2\n * (c) 2010-2022 Google LLC. https://angular.io/\n * License: MIT\n */\n\nimport { assertInInjectionContext, inject, DestroyRef, Injector, effect, untracked, assertNotInReactiveContext, signal, ɵRuntimeError, computed } from '@angular/core';\nimport { Observable, ReplaySubject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\n/**\n * Operator which completes the Observable when the calling context (component, directive, service,\n * etc) is destroyed.\n *\n * @param destroyRef optionally, the `DestroyRef` representing the current context. This can be\n * passed explicitly to use `takeUntilDestroyed` outside of an [injection\n * context](guide/dependency-injection-context). Otherwise, the current `DestroyRef` is injected.\n *\n * @developerPreview\n */\nfunction takeUntilDestroyed(destroyRef) {\n if (!destroyRef) {\n assertInInjectionContext(takeUntilDestroyed);\n destroyRef = inject(DestroyRef);\n }\n const destroyed$ = new Observable(observer => {\n const unregisterFn = destroyRef.onDestroy(observer.next.bind(observer));\n return unregisterFn;\n });\n return (source) => {\n return source.pipe(takeUntil(destroyed$));\n };\n}\n\n/**\n * Exposes the value of an Angular `Signal` as an RxJS `Observable`.\n *\n * The signal's value will be propagated into the `Observable`'s subscribers using an `effect`.\n *\n * `toObservable` must be called in an injection context unless an injector is provided via options.\n *\n * @developerPreview\n */\nfunction toObservable(source, options) {\n !options?.injector && assertInInjectionContext(toObservable);\n const injector = options?.injector ?? inject(Injector);\n const subject = new ReplaySubject(1);\n const watcher = effect(() => {\n let value;\n try {\n value = source();\n }\n catch (err) {\n untracked(() => subject.error(err));\n return;\n }\n untracked(() => subject.next(value));\n }, { injector, manualCleanup: true });\n injector.get(DestroyRef).onDestroy(() => {\n watcher.destroy();\n subject.complete();\n });\n return subject.asObservable();\n}\n\n/**\n * Get the current value of an `Observable` as a reactive `Signal`.\n *\n * `toSignal` returns a `Signal` which provides synchronous reactive access to values produced\n * by the given `Observable`, by subscribing to that `Observable`. The returned `Signal` will always\n * have the most recent value emitted by the subscription, and will throw an error if the\n * `Observable` errors.\n *\n * With `requireSync` set to `true`, `toSignal` will assert that the `Observable` produces a value\n * immediately upon subscription. No `initialValue` is needed in this case, and the returned signal\n * does not include an `undefined` type.\n *\n * By default, the subscription will be automatically cleaned up when the current [injection\n * context](/guide/dependency-injection-context) is destroyed. For example, when `toObservable` is\n * called during the construction of a component, the subscription will be cleaned up when the\n * component is destroyed. If an injection context is not available, an explicit `Injector` can be\n * passed instead.\n *\n * If the subscription should persist until the `Observable` itself completes, the `manualCleanup`\n * option can be specified instead, which disables the automatic subscription teardown. No injection\n * context is needed in this configuration as well.\n *\n * @developerPreview\n */\nfunction toSignal(source, options) {\n ngDevMode &&\n assertNotInReactiveContext(toSignal, 'Invoking `toSignal` causes new subscriptions every time. ' +\n 'Consider moving `toSignal` outside of the reactive context and read the signal value where needed.');\n const requiresCleanup = !options?.manualCleanup;\n requiresCleanup && !options?.injector && assertInInjectionContext(toSignal);\n const cleanupRef = requiresCleanup ? options?.injector?.get(DestroyRef) ?? inject(DestroyRef) : null;\n // Note: T is the Observable value type, and U is the initial value type. They don't have to be\n // the same - the returned signal gives values of type `T`.\n let state;\n if (options?.requireSync) {\n // Initially the signal is in a `NoValue` state.\n state = signal({ kind: 0 /* StateKind.NoValue */ });\n }\n else {\n // If an initial value was passed, use it. Otherwise, use `undefined` as the initial value.\n state = signal({ kind: 1 /* StateKind.Value */, value: options?.initialValue });\n }\n // Note: This code cannot run inside a reactive context (see assertion above). If we'd support\n // this, we would subscribe to the observable outside of the current reactive context, avoiding\n // that side-effect signal reads/writes are attribute to the current consumer. The current\n // consumer only needs to be notified when the `state` signal changes through the observable\n // subscription. Additional context (related to async pipe):\n // https://github.com/angular/angular/pull/50522.\n const sub = source.subscribe({\n next: value => state.set({ kind: 1 /* StateKind.Value */, value }),\n error: error => {\n if (options?.rejectErrors) {\n // Kick the error back to RxJS. It will be caught and rethrown in a macrotask, which causes\n // the error to end up as an uncaught exception.\n throw error;\n }\n state.set({ kind: 2 /* StateKind.Error */, error });\n },\n // Completion of the Observable is meaningless to the signal. Signals don't have a concept of\n // \"complete\".\n });\n if (ngDevMode && options?.requireSync && state().kind === 0 /* StateKind.NoValue */) {\n throw new ɵRuntimeError(601 /* ɵRuntimeErrorCode.REQUIRE_SYNC_WITHOUT_SYNC_EMIT */, '`toSignal()` called with `requireSync` but `Observable` did not emit synchronously.');\n }\n // Unsubscribe when the current context is destroyed, if requested.\n cleanupRef?.onDestroy(sub.unsubscribe.bind(sub));\n // The actual returned signal is a `computed` of the `State` signal, which maps the various states\n // to either values or errors.\n return computed(() => {\n const current = state();\n switch (current.kind) {\n case 1 /* StateKind.Value */:\n return current.value;\n case 2 /* StateKind.Error */:\n throw current.error;\n case 0 /* StateKind.NoValue */:\n // This shouldn't really happen because the error is thrown on creation.\n // TODO(alxhub): use a RuntimeError when we finalize the error semantics\n throw new ɵRuntimeError(601 /* ɵRuntimeErrorCode.REQUIRE_SYNC_WITHOUT_SYNC_EMIT */, '`toSignal()` called with `requireSync` but `Observable` did not emit synchronously.');\n }\n });\n}\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { takeUntilDestroyed, toObservable, toSignal };\n\n","import * as i0 from '@angular/core';\nimport { Injectable, InjectionToken, Inject, computed, isDevMode, inject, makeEnvironmentProviders, ENVIRONMENT_INITIALIZER, NgModule, Optional } from '@angular/core';\nimport { BehaviorSubject, Observable, Subject, queueScheduler } from 'rxjs';\nimport { observeOn, withLatestFrom, scan, pluck, map, distinctUntilChanged } from 'rxjs/operators';\nimport { toSignal } from '@angular/core/rxjs-interop';\nconst REGISTERED_ACTION_TYPES = {};\nfunction resetRegisteredActionTypes() {\n for (const key of Object.keys(REGISTERED_ACTION_TYPES)) {\n delete REGISTERED_ACTION_TYPES[key];\n }\n}\n\n/**\n * @description\n * Creates a configured `Creator` function that, when called, returns an object in the shape of the `Action` interface.\n *\n * Action creators reduce the explicitness of class-based action creators.\n *\n * @param type Describes the action that will be dispatched\n * @param config Additional metadata needed for the handling of the action. See {@link createAction#usage-notes Usage Notes}.\n *\n * @usageNotes\n *\n * **Declaring an action creator**\n *\n * Without additional metadata:\n * ```ts\n * export const increment = createAction('[Counter] Increment');\n * ```\n * With additional metadata:\n * ```ts\n * export const loginSuccess = createAction(\n * '[Auth/API] Login Success',\n * props<{ user: User }>()\n * );\n * ```\n * With a function:\n * ```ts\n * export const loginSuccess = createAction(\n * '[Auth/API] Login Success',\n * (response: Response) => response.user\n * );\n * ```\n *\n * **Dispatching an action**\n *\n * Without additional metadata:\n * ```ts\n * store.dispatch(increment());\n * ```\n * With additional metadata:\n * ```ts\n * store.dispatch(loginSuccess({ user: newUser }));\n * ```\n *\n * **Referencing an action in a reducer**\n *\n * Using a switch statement:\n * ```ts\n * switch (action.type) {\n * // ...\n * case AuthApiActions.loginSuccess.type: {\n * return {\n * ...state,\n * user: action.user\n * };\n * }\n * }\n * ```\n * Using a reducer creator:\n * ```ts\n * on(AuthApiActions.loginSuccess, (state, { user }) => ({ ...state, user }))\n * ```\n *\n * **Referencing an action in an effect**\n * ```ts\n * effectName$ = createEffect(\n * () => this.actions$.pipe(\n * ofType(AuthApiActions.loginSuccess),\n * // ...\n * )\n * );\n * ```\n */\nfunction createAction(type, config) {\n REGISTERED_ACTION_TYPES[type] = (REGISTERED_ACTION_TYPES[type] || 0) + 1;\n if (typeof config === 'function') {\n return defineType(type, (...args) => ({\n ...config(...args),\n type\n }));\n }\n const as = config ? config._as : 'empty';\n switch (as) {\n case 'empty':\n return defineType(type, () => ({\n type\n }));\n case 'props':\n return defineType(type, props => ({\n ...props,\n type\n }));\n default:\n throw new Error('Unexpected config.');\n }\n}\nfunction props() {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return {\n _as: 'props',\n _p: undefined\n };\n}\nfunction union(creators) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return undefined;\n}\nfunction defineType(type, creator) {\n return Object.defineProperty(creator, 'type', {\n value: type,\n writable: false\n });\n}\nfunction capitalize(text) {\n return text.charAt(0).toUpperCase() + text.substring(1);\n}\nfunction uncapitalize(text) {\n return text.charAt(0).toLowerCase() + text.substring(1);\n}\n\n/**\n * @description\n * A function that creates a group of action creators with the same source.\n *\n * @param config An object that contains a source and dictionary of events.\n * An event is a key-value pair of an event name and event props.\n * @returns A dictionary of action creators.\n * The name of each action creator is created by camel casing the event name.\n * The type of each action is created using the \"[Source] Event Name\" pattern.\n *\n * @usageNotes\n *\n * ```ts\n * const authApiActions = createActionGroup({\n * source: 'Auth API',\n * events: {\n * // defining events with payload using the `props` function\n * 'Login Success': props<{ userId: number; token: string }>(),\n * 'Login Failure': props<{ error: string }>(),\n *\n * // defining an event without payload using the `emptyProps` function\n * 'Logout Success': emptyProps(),\n *\n * // defining an event with payload using the props factory\n * 'Logout Failure': (error: Error) => ({ error }),\n * },\n * });\n *\n * // action type: \"[Auth API] Login Success\"\n * authApiActions.loginSuccess({ userId: 10, token: 'ngrx' });\n *\n * // action type: \"[Auth API] Login Failure\"\n * authApiActions.loginFailure({ error: 'Login Failure!' });\n *\n * // action type: \"[Auth API] Logout Success\"\n * authApiActions.logoutSuccess();\n *\n * // action type: \"[Auth API] Logout Failure\";\n * authApiActions.logoutFailure(new Error('Logout Failure!'));\n * ```\n */\nfunction createActionGroup(config) {\n const {\n source,\n events\n } = config;\n return Object.keys(events).reduce((actionGroup, eventName) => ({\n ...actionGroup,\n [toActionName(eventName)]: createAction(toActionType(source, eventName), events[eventName])\n }), {});\n}\nfunction emptyProps() {\n return props();\n}\nfunction toActionName(eventName) {\n return eventName.trim().split(' ').map((word, i) => i === 0 ? uncapitalize(word) : capitalize(word)).join('');\n}\nfunction toActionType(source, eventName) {\n return `[${source}] ${eventName}`;\n}\nconst INIT = '@ngrx/store/init';\nclass ActionsSubject extends BehaviorSubject {\n constructor() {\n super({\n type: INIT\n });\n }\n next(action) {\n if (typeof action === 'function') {\n throw new TypeError(`\n Dispatch expected an object, instead it received a function.\n If you're using the createAction function, make sure to invoke the function\n before dispatching the action. For example, someAction should be someAction().`);\n } else if (typeof action === 'undefined') {\n throw new TypeError(`Actions must be objects`);\n } else if (typeof action.type === 'undefined') {\n throw new TypeError(`Actions must have a type property`);\n }\n super.next(action);\n }\n complete() {\n /* noop */\n }\n ngOnDestroy() {\n super.complete();\n }\n /** @nocollapse */\n static {\n this.ɵfac = function ActionsSubject_Factory(t) {\n return new (t || ActionsSubject)();\n };\n }\n /** @nocollapse */\n static {\n this.ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: ActionsSubject,\n factory: ActionsSubject.ɵfac\n });\n }\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(ActionsSubject, [{\n type: Injectable\n }], () => [], null);\n})();\nconst ACTIONS_SUBJECT_PROVIDERS = [ActionsSubject];\nconst _ROOT_STORE_GUARD = new InjectionToken('@ngrx/store Internal Root Guard');\nconst _INITIAL_STATE = new InjectionToken('@ngrx/store Internal Initial State');\nconst INITIAL_STATE = new InjectionToken('@ngrx/store Initial State');\nconst REDUCER_FACTORY = new InjectionToken('@ngrx/store Reducer Factory');\nconst _REDUCER_FACTORY = new InjectionToken('@ngrx/store Internal Reducer Factory Provider');\nconst INITIAL_REDUCERS = new InjectionToken('@ngrx/store Initial Reducers');\nconst _INITIAL_REDUCERS = new InjectionToken('@ngrx/store Internal Initial Reducers');\nconst STORE_FEATURES = new InjectionToken('@ngrx/store Store Features');\nconst _STORE_REDUCERS = new InjectionToken('@ngrx/store Internal Store Reducers');\nconst _FEATURE_REDUCERS = new InjectionToken('@ngrx/store Internal Feature Reducers');\nconst _FEATURE_CONFIGS = new InjectionToken('@ngrx/store Internal Feature Configs');\nconst _STORE_FEATURES = new InjectionToken('@ngrx/store Internal Store Features');\nconst _FEATURE_REDUCERS_TOKEN = new InjectionToken('@ngrx/store Internal Feature Reducers Token');\nconst FEATURE_REDUCERS = new InjectionToken('@ngrx/store Feature Reducers');\n/**\n * User-defined meta reducers from StoreModule.forRoot()\n */\nconst USER_PROVIDED_META_REDUCERS = new InjectionToken('@ngrx/store User Provided Meta Reducers');\n/**\n * Meta reducers defined either internally by @ngrx/store or by library authors\n */\nconst META_REDUCERS = new InjectionToken('@ngrx/store Meta Reducers');\n/**\n * Concats the user provided meta reducers and the meta reducers provided on the multi\n * injection token\n */\nconst _RESOLVED_META_REDUCERS = new InjectionToken('@ngrx/store Internal Resolved Meta Reducers');\n/**\n * Runtime checks defined by the user via an InjectionToken\n * Defaults to `_USER_RUNTIME_CHECKS`\n */\nconst USER_RUNTIME_CHECKS = new InjectionToken('@ngrx/store User Runtime Checks Config');\n/**\n * Runtime checks defined by the user via forRoot()\n */\nconst _USER_RUNTIME_CHECKS = new InjectionToken('@ngrx/store Internal User Runtime Checks Config');\n/**\n * Runtime checks currently in use\n */\nconst ACTIVE_RUNTIME_CHECKS = new InjectionToken('@ngrx/store Internal Runtime Checks');\nconst _ACTION_TYPE_UNIQUENESS_CHECK = new InjectionToken('@ngrx/store Check if Action types are unique');\n/**\n * InjectionToken that registers the global Store.\n * Mainly used to provide a hook that can be injected\n * to ensure the root state is loaded before something\n * that depends on it.\n */\nconst ROOT_STORE_PROVIDER = new InjectionToken('@ngrx/store Root Store Provider');\n/**\n * InjectionToken that registers feature states.\n * Mainly used to provide a hook that can be injected\n * to ensure feature state is loaded before something\n * that depends on it.\n */\nconst FEATURE_STATE_PROVIDER = new InjectionToken('@ngrx/store Feature State Provider');\n\n/**\n * @description\n * Combines reducers for individual features into a single reducer.\n *\n * You can use this function to delegate handling of state transitions to multiple reducers, each acting on their\n * own sub-state within the root state.\n *\n * @param reducers An object mapping keys of the root state to their corresponding feature reducer.\n * @param initialState Provides a state value if the current state is `undefined`, as it is initially.\n * @returns A reducer function.\n *\n * @usageNotes\n *\n * **Example combining two feature reducers into one \"root\" reducer**\n *\n * ```ts\n * export const reducer = combineReducers({\n * featureA: featureAReducer,\n * featureB: featureBReducer\n * });\n * ```\n *\n * You can also override the initial states of the sub-features:\n * ```ts\n * export const reducer = combineReducers({\n * featureA: featureAReducer,\n * featureB: featureBReducer\n * }, {\n * featureA: { counterA: 13 },\n * featureB: { counterB: 37 }\n * });\n * ```\n */\nfunction combineReducers(reducers, initialState = {}) {\n const reducerKeys = Object.keys(reducers);\n const finalReducers = {};\n for (let i = 0; i < reducerKeys.length; i++) {\n const key = reducerKeys[i];\n if (typeof reducers[key] === 'function') {\n finalReducers[key] = reducers[key];\n }\n }\n const finalReducerKeys = Object.keys(finalReducers);\n return function combination(state, action) {\n state = state === undefined ? initialState : state;\n let hasChanged = false;\n const nextState = {};\n for (let i = 0; i < finalReducerKeys.length; i++) {\n const key = finalReducerKeys[i];\n const reducer = finalReducers[key];\n const previousStateForKey = state[key];\n const nextStateForKey = reducer(previousStateForKey, action);\n nextState[key] = nextStateForKey;\n hasChanged = hasChanged || nextStateForKey !== previousStateForKey;\n }\n return hasChanged ? nextState : state;\n };\n}\nfunction omit(object, keyToRemove) {\n return Object.keys(object).filter(key => key !== keyToRemove).reduce((result, key) => Object.assign(result, {\n [key]: object[key]\n }), {});\n}\nfunction compose(...functions) {\n return function (arg) {\n if (functions.length === 0) {\n return arg;\n }\n const last = functions[functions.length - 1];\n const rest = functions.slice(0, -1);\n return rest.reduceRight((composed, fn) => fn(composed), last(arg));\n };\n}\nfunction createReducerFactory(reducerFactory, metaReducers) {\n if (Array.isArray(metaReducers) && metaReducers.length > 0) {\n reducerFactory = compose.apply(null, [...metaReducers, reducerFactory]);\n }\n return (reducers, initialState) => {\n const reducer = reducerFactory(reducers);\n return (state, action) => {\n state = state === undefined ? initialState : state;\n return reducer(state, action);\n };\n };\n}\nfunction createFeatureReducerFactory(metaReducers) {\n const reducerFactory = Array.isArray(metaReducers) && metaReducers.length > 0 ? compose(...metaReducers) : r => r;\n return (reducer, initialState) => {\n reducer = reducerFactory(reducer);\n return (state, action) => {\n state = state === undefined ? initialState : state;\n return reducer(state, action);\n };\n };\n}\nclass ReducerObservable extends Observable {}\nclass ReducerManagerDispatcher extends ActionsSubject {}\nconst UPDATE = '@ngrx/store/update-reducers';\nclass ReducerManager extends BehaviorSubject {\n get currentReducers() {\n return this.reducers;\n }\n constructor(dispatcher, initialState, reducers, reducerFactory) {\n super(reducerFactory(reducers, initialState));\n this.dispatcher = dispatcher;\n this.initialState = initialState;\n this.reducers = reducers;\n this.reducerFactory = reducerFactory;\n }\n addFeature(feature) {\n this.addFeatures([feature]);\n }\n addFeatures(features) {\n const reducers = features.reduce((reducerDict, {\n reducers,\n reducerFactory,\n metaReducers,\n initialState,\n key\n }) => {\n const reducer = typeof reducers === 'function' ? createFeatureReducerFactory(metaReducers)(reducers, initialState) : createReducerFactory(reducerFactory, metaReducers)(reducers, initialState);\n reducerDict[key] = reducer;\n return reducerDict;\n }, {});\n this.addReducers(reducers);\n }\n removeFeature(feature) {\n this.removeFeatures([feature]);\n }\n removeFeatures(features) {\n this.removeReducers(features.map(p => p.key));\n }\n addReducer(key, reducer) {\n this.addReducers({\n [key]: reducer\n });\n }\n addReducers(reducers) {\n this.reducers = {\n ...this.reducers,\n ...reducers\n };\n this.updateReducers(Object.keys(reducers));\n }\n removeReducer(featureKey) {\n this.removeReducers([featureKey]);\n }\n removeReducers(featureKeys) {\n featureKeys.forEach(key => {\n this.reducers = omit(this.reducers, key) /*TODO(#823)*/;\n });\n this.updateReducers(featureKeys);\n }\n updateReducers(featureKeys) {\n this.next(this.reducerFactory(this.reducers, this.initialState));\n this.dispatcher.next({\n type: UPDATE,\n features: featureKeys\n });\n }\n ngOnDestroy() {\n this.complete();\n }\n /** @nocollapse */\n static {\n this.ɵfac = function ReducerManager_Factory(t) {\n return new (t || ReducerManager)(i0.ɵɵinject(ReducerManagerDispatcher), i0.ɵɵinject(INITIAL_STATE), i0.ɵɵinject(INITIAL_REDUCERS), i0.ɵɵinject(REDUCER_FACTORY));\n };\n }\n /** @nocollapse */\n static {\n this.ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: ReducerManager,\n factory: ReducerManager.ɵfac\n });\n }\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(ReducerManager, [{\n type: Injectable\n }], () => [{\n type: ReducerManagerDispatcher\n }, {\n type: undefined,\n decorators: [{\n type: Inject,\n args: [INITIAL_STATE]\n }]\n }, {\n type: undefined,\n decorators: [{\n type: Inject,\n args: [INITIAL_REDUCERS]\n }]\n }, {\n type: undefined,\n decorators: [{\n type: Inject,\n args: [REDUCER_FACTORY]\n }]\n }], null);\n})();\nconst REDUCER_MANAGER_PROVIDERS = [ReducerManager, {\n provide: ReducerObservable,\n useExisting: ReducerManager\n}, {\n provide: ReducerManagerDispatcher,\n useExisting: ActionsSubject\n}];\nclass ScannedActionsSubject extends Subject {\n ngOnDestroy() {\n this.complete();\n }\n /** @nocollapse */\n static {\n this.ɵfac = /* @__PURE__ */(() => {\n let ɵScannedActionsSubject_BaseFactory;\n return function ScannedActionsSubject_Factory(t) {\n return (ɵScannedActionsSubject_BaseFactory || (ɵScannedActionsSubject_BaseFactory = i0.ɵɵgetInheritedFactory(ScannedActionsSubject)))(t || ScannedActionsSubject);\n };\n })();\n }\n /** @nocollapse */\n static {\n this.ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: ScannedActionsSubject,\n factory: ScannedActionsSubject.ɵfac\n });\n }\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(ScannedActionsSubject, [{\n type: Injectable\n }], null, null);\n})();\nconst SCANNED_ACTIONS_SUBJECT_PROVIDERS = [ScannedActionsSubject];\nclass StateObservable extends Observable {}\nclass State extends BehaviorSubject {\n static {\n this.INIT = INIT;\n }\n constructor(actions$, reducer$, scannedActions, initialState) {\n super(initialState);\n const actionsOnQueue$ = actions$.pipe(observeOn(queueScheduler));\n const withLatestReducer$ = actionsOnQueue$.pipe(withLatestFrom(reducer$));\n const seed = {\n state: initialState\n };\n const stateAndAction$ = withLatestReducer$.pipe(scan(reduceState, seed));\n this.stateSubscription = stateAndAction$.subscribe(({\n state,\n action\n }) => {\n this.next(state);\n scannedActions.next(action);\n });\n this.state = toSignal(this, {\n manualCleanup: true,\n requireSync: true\n });\n }\n ngOnDestroy() {\n this.stateSubscription.unsubscribe();\n this.complete();\n }\n /** @nocollapse */\n static {\n this.ɵfac = function State_Factory(t) {\n return new (t || State)(i0.ɵɵinject(ActionsSubject), i0.ɵɵinject(ReducerObservable), i0.ɵɵinject(ScannedActionsSubject), i0.ɵɵinject(INITIAL_STATE));\n };\n }\n /** @nocollapse */\n static {\n this.ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: State,\n factory: State.ɵfac\n });\n }\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(State, [{\n type: Injectable\n }], () => [{\n type: ActionsSubject\n }, {\n type: ReducerObservable\n }, {\n type: ScannedActionsSubject\n }, {\n type: undefined,\n decorators: [{\n type: Inject,\n args: [INITIAL_STATE]\n }]\n }], null);\n})();\nfunction reduceState(stateActionPair = {\n state: undefined\n}, [action, reducer]) {\n const {\n state\n } = stateActionPair;\n return {\n state: reducer(state, action),\n action\n };\n}\nconst STATE_PROVIDERS = [State, {\n provide: StateObservable,\n useExisting: State\n}];\n\n// disabled because we have lowercase generics for `select`\nclass Store extends Observable {\n constructor(state$, actionsObserver, reducerManager) {\n super();\n this.actionsObserver = actionsObserver;\n this.reducerManager = reducerManager;\n this.source = state$;\n this.state = state$.state;\n }\n select(pathOrMapFn, ...paths) {\n return select.call(null, pathOrMapFn, ...paths)(this);\n }\n /**\n * Returns a signal of the provided selector.\n *\n * @param selector selector function\n * @param options select signal options\n */\n selectSignal(selector, options) {\n return computed(() => selector(this.state()), options);\n }\n lift(operator) {\n const store = new Store(this, this.actionsObserver, this.reducerManager);\n store.operator = operator;\n return store;\n }\n dispatch(action) {\n this.actionsObserver.next(action);\n }\n next(action) {\n this.actionsObserver.next(action);\n }\n error(err) {\n this.actionsObserver.error(err);\n }\n complete() {\n this.actionsObserver.complete();\n }\n addReducer(key, reducer) {\n this.reducerManager.addReducer(key, reducer);\n }\n removeReducer(key) {\n this.reducerManager.removeReducer(key);\n }\n /** @nocollapse */\n static {\n this.ɵfac = function Store_Factory(t) {\n return new (t || Store)(i0.ɵɵinject(StateObservable), i0.ɵɵinject(ActionsSubject), i0.ɵɵinject(ReducerManager));\n };\n }\n /** @nocollapse */\n static {\n this.ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: Store,\n factory: Store.ɵfac\n });\n }\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(Store, [{\n type: Injectable\n }], () => [{\n type: StateObservable\n }, {\n type: ActionsSubject\n }, {\n type: ReducerManager\n }], null);\n})();\nconst STORE_PROVIDERS = [Store];\nfunction select(pathOrMapFn, propsOrPath, ...paths) {\n return function selectOperator(source$) {\n let mapped$;\n if (typeof pathOrMapFn === 'string') {\n const pathSlices = [propsOrPath, ...paths].filter(Boolean);\n mapped$ = source$.pipe(pluck(pathOrMapFn, ...pathSlices));\n } else if (typeof pathOrMapFn === 'function') {\n mapped$ = source$.pipe(map(source => pathOrMapFn(source, propsOrPath)));\n } else {\n throw new TypeError(`Unexpected type '${typeof pathOrMapFn}' in select operator,` + ` expected 'string' or 'function'`);\n }\n return mapped$.pipe(distinctUntilChanged());\n };\n}\nconst RUNTIME_CHECK_URL = 'https://ngrx.io/guide/store/configuration/runtime-checks';\nfunction isUndefined(target) {\n return target === undefined;\n}\nfunction isNull(target) {\n return target === null;\n}\nfunction isArray(target) {\n return Array.isArray(target);\n}\nfunction isString(target) {\n return typeof target === 'string';\n}\nfunction isBoolean(target) {\n return typeof target === 'boolean';\n}\nfunction isNumber(target) {\n return typeof target === 'number';\n}\nfunction isObjectLike(target) {\n return typeof target === 'object' && target !== null;\n}\nfunction isObject(target) {\n return isObjectLike(target) && !isArray(target);\n}\nfunction isPlainObject(target) {\n if (!isObject(target)) {\n return false;\n }\n const targetPrototype = Object.getPrototypeOf(target);\n return targetPrototype === Object.prototype || targetPrototype === null;\n}\nfunction isFunction(target) {\n return typeof target === 'function';\n}\nfunction isComponent(target) {\n return isFunction(target) && target.hasOwnProperty('ɵcmp');\n}\nfunction hasOwnProperty(target, propertyName) {\n return Object.prototype.hasOwnProperty.call(target, propertyName);\n}\nlet _ngrxMockEnvironment = false;\nfunction setNgrxMockEnvironment(value) {\n _ngrxMockEnvironment = value;\n}\nfunction isNgrxMockEnvironment() {\n return _ngrxMockEnvironment;\n}\nfunction isEqualCheck(a, b) {\n return a === b;\n}\nfunction isArgumentsChanged(args, lastArguments, comparator) {\n for (let i = 0; i < args.length; i++) {\n if (!comparator(args[i], lastArguments[i])) {\n return true;\n }\n }\n return false;\n}\nfunction resultMemoize(projectionFn, isResultEqual) {\n return defaultMemoize(projectionFn, isEqualCheck, isResultEqual);\n}\nfunction defaultMemoize(projectionFn, isArgumentsEqual = isEqualCheck, isResultEqual = isEqualCheck) {\n let lastArguments = null;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, , , , ,\n let lastResult = null;\n let overrideResult;\n function reset() {\n lastArguments = null;\n lastResult = null;\n }\n function setResult(result = undefined) {\n overrideResult = {\n result\n };\n }\n function clearResult() {\n overrideResult = undefined;\n }\n /* eslint-disable prefer-rest-params, prefer-spread */\n // disabled because of the use of `arguments`\n function memoized() {\n if (overrideResult !== undefined) {\n return overrideResult.result;\n }\n if (!lastArguments) {\n lastResult = projectionFn.apply(null, arguments);\n lastArguments = arguments;\n return lastResult;\n }\n if (!isArgumentsChanged(arguments, lastArguments, isArgumentsEqual)) {\n return lastResult;\n }\n const newResult = projectionFn.apply(null, arguments);\n lastArguments = arguments;\n if (isResultEqual(lastResult, newResult)) {\n return lastResult;\n }\n lastResult = newResult;\n return newResult;\n }\n return {\n memoized,\n reset,\n setResult,\n clearResult\n };\n}\nfunction createSelector(...input) {\n return createSelectorFactory(defaultMemoize)(...input);\n}\nfunction defaultStateFn(state, selectors, props, memoizedProjector) {\n if (props === undefined) {\n const args = selectors.map(fn => fn(state));\n return memoizedProjector.memoized.apply(null, args);\n }\n const args = selectors.map(fn => fn(state, props));\n return memoizedProjector.memoized.apply(null, [...args, props]);\n}\n/**\n *\n * @param memoize The function used to memoize selectors\n * @param options Config Object that may include a `stateFn` function defining how to return the selector's value, given the entire `Store`'s state, parent `Selector`s, `Props`, and a `MemoizedProjection`\n *\n * @usageNotes\n *\n * **Creating a Selector Factory Where Array Order Does Not Matter**\n *\n * ```ts\n * function removeMatch(arr: string[], target: string): string[] {\n * const matchIndex = arr.indexOf(target);\n * return [...arr.slice(0, matchIndex), ...arr.slice(matchIndex + 1)];\n * }\n *\n * function orderDoesNotMatterComparer(a: any, b: any): boolean {\n * if (!Array.isArray(a) || !Array.isArray(b)) {\n * return a === b;\n * }\n * if (a.length !== b.length) {\n * return false;\n * }\n * let tempB = [...b];\n * function reduceToDetermineIfArraysContainSameContents(\n * previousCallResult: boolean,\n * arrayMember: any\n * ): boolean {\n * if (previousCallResult === false) {\n * return false;\n * }\n * if (tempB.includes(arrayMember)) {\n * tempB = removeMatch(tempB, arrayMember);\n * return true;\n * }\n * return false;\n * }\n * return a.reduce(reduceToDetermineIfArraysContainSameContents, true);\n * }\n *\n * export const createOrderDoesNotMatterSelector = createSelectorFactory(\n * (projectionFun) => defaultMemoize(\n * projectionFun,\n * orderDoesNotMatterComparer,\n * orderDoesNotMatterComparer\n * )\n * );\n * ```\n *\n * **Creating an Alternative Memoization Strategy**\n *\n * ```ts\n * function serialize(x: any): string {\n * return JSON.stringify(x);\n * }\n *\n * export const createFullHistorySelector = createSelectorFactory(\n * (projectionFunction) => {\n * const cache = {};\n *\n * function memoized() {\n * const serializedArguments = serialize(...arguments);\n * if (cache[serializedArguments] != null) {\n * cache[serializedArguments] = projectionFunction.apply(null, arguments);\n * }\n * return cache[serializedArguments];\n * }\n * return {\n * memoized,\n * reset: () => {},\n * setResult: () => {},\n * clearResult: () => {},\n * };\n * }\n * );\n * ```\n */\nfunction createSelectorFactory(memoize, options = {\n stateFn: defaultStateFn\n}) {\n return function (...input) {\n let args = input;\n if (Array.isArray(args[0])) {\n const [head, ...tail] = args;\n args = [...head, ...tail];\n } else if (args.length === 1 && isSelectorsDictionary(args[0])) {\n args = extractArgsFromSelectorsDictionary(args[0]);\n }\n const selectors = args.slice(0, args.length - 1);\n const projector = args[args.length - 1];\n const memoizedSelectors = selectors.filter(selector => selector.release && typeof selector.release === 'function');\n const memoizedProjector = memoize(function (...selectors) {\n return projector.apply(null, selectors);\n });\n const memoizedState = defaultMemoize(function (state, props) {\n return options.stateFn.apply(null, [state, selectors, props, memoizedProjector]);\n });\n function release() {\n memoizedState.reset();\n memoizedProjector.reset();\n memoizedSelectors.forEach(selector => selector.release());\n }\n return Object.assign(memoizedState.memoized, {\n release,\n projector: memoizedProjector.memoized,\n setResult: memoizedState.setResult,\n clearResult: memoizedState.clearResult\n });\n };\n}\nfunction createFeatureSelector(featureName) {\n return createSelector(state => {\n const featureState = state[featureName];\n if (!isNgrxMockEnvironment() && isDevMode() && !(featureName in state)) {\n console.warn(`@ngrx/store: The feature name \"${featureName}\" does ` + 'not exist in the state, therefore createFeatureSelector ' + 'cannot access it. Be sure it is imported in a loaded module ' + `using StoreModule.forRoot('${featureName}', ...) or ` + `StoreModule.forFeature('${featureName}', ...). If the default ` + 'state is intended to be undefined, as is the case with router ' + 'state, this development-only warning message can be ignored.');\n }\n return featureState;\n }, featureState => featureState);\n}\nfunction isSelectorsDictionary(selectors) {\n return !!selectors && typeof selectors === 'object' && Object.values(selectors).every(selector => typeof selector === 'function');\n}\nfunction extractArgsFromSelectorsDictionary(selectorsDictionary) {\n const selectors = Object.values(selectorsDictionary);\n const resultKeys = Object.keys(selectorsDictionary);\n const projector = (...selectorResults) => resultKeys.reduce((result, key, index) => ({\n ...result,\n [key]: selectorResults[index]\n }), {});\n return [...selectors, projector];\n}\n\n/**\n * @description\n * A function that accepts a feature name and a feature reducer, and creates\n * a feature selector and a selector for each feature state property.\n * This function also provides the ability to add extra selectors to\n * the feature object.\n *\n * @param featureConfig An object that contains a feature name and a feature\n * reducer as required, and extra selectors factory as an optional argument.\n * @returns An object that contains a feature name, a feature reducer,\n * a feature selector, a selector for each feature state property, and extra\n * selectors.\n *\n * @usageNotes\n *\n * ```ts\n * interface ProductsState {\n * products: Product[];\n * selectedId: string | null;\n * }\n *\n * const initialState: ProductsState = {\n * products: [],\n * selectedId: null,\n * };\n *\n * const productsFeature = createFeature({\n * name: 'products',\n * reducer: createReducer(\n * initialState,\n * on(ProductsApiActions.loadSuccess(state, { products }) => ({\n * ...state,\n * products,\n * }),\n * ),\n * });\n *\n * const {\n * name,\n * reducer,\n * // feature selector\n * selectProductsState, // type: MemoizedSelector, ProductsState>\n * // feature state properties selectors\n * selectProducts, // type: MemoizedSelector, Product[]>\n * selectSelectedId, // type: MemoizedSelector, string | null>\n * } = productsFeature;\n * ```\n *\n * **Creating Feature with Extra Selectors**\n *\n * ```ts\n * type CallState = 'init' | 'loading' | 'loaded' | { error: string };\n *\n * interface State extends EntityState {\n * callState: CallState;\n * }\n *\n * const adapter = createEntityAdapter();\n * const initialState: State = adapter.getInitialState({\n * callState: 'init',\n * });\n *\n * export const productsFeature = createFeature({\n * name: 'products',\n * reducer: createReducer(initialState),\n * extraSelectors: ({ selectProductsState, selectCallState }) => ({\n * ...adapter.getSelectors(selectProductsState),\n * ...getCallStateSelectors(selectCallState)\n * }),\n * });\n *\n * const {\n * name,\n * reducer,\n * // feature selector\n * selectProductsState,\n * // feature state properties selectors\n * selectIds,\n * selectEntities,\n * selectCallState,\n * // selectors returned by `adapter.getSelectors`\n * selectAll,\n * selectTotal,\n * // selectors returned by `getCallStateSelectors`\n * selectIsLoading,\n * selectIsLoaded,\n * selectError,\n * } = productsFeature;\n * ```\n */\nfunction createFeature(featureConfig) {\n const {\n name,\n reducer,\n extraSelectors: extraSelectorsFactory\n } = featureConfig;\n const featureSelector = createFeatureSelector(name);\n const nestedSelectors = createNestedSelectors(featureSelector, reducer);\n const baseSelectors = {\n [`select${capitalize(name)}State`]: featureSelector,\n ...nestedSelectors\n };\n const extraSelectors = extraSelectorsFactory ? extraSelectorsFactory(baseSelectors) : {};\n return {\n name,\n reducer,\n ...baseSelectors,\n ...extraSelectors\n };\n}\nfunction createNestedSelectors(featureSelector, reducer) {\n const initialState = getInitialState(reducer);\n const nestedKeys = isPlainObject(initialState) ? Object.keys(initialState) : [];\n return nestedKeys.reduce((nestedSelectors, nestedKey) => ({\n ...nestedSelectors,\n [`select${capitalize(nestedKey)}`]: createSelector(featureSelector, parentState => parentState?.[nestedKey])\n }), {});\n}\nfunction getInitialState(reducer) {\n return reducer(undefined, {\n type: '@ngrx/feature/init'\n });\n}\nfunction _createStoreReducers(reducers) {\n return reducers instanceof InjectionToken ? inject(reducers) : reducers;\n}\nfunction _createFeatureStore(configs, featureStores) {\n return featureStores.map((feat, index) => {\n if (configs[index] instanceof InjectionToken) {\n const conf = inject(configs[index]);\n return {\n key: feat.key,\n reducerFactory: conf.reducerFactory ? conf.reducerFactory : combineReducers,\n metaReducers: conf.metaReducers ? conf.metaReducers : [],\n initialState: conf.initialState\n };\n }\n return feat;\n });\n}\nfunction _createFeatureReducers(reducerCollection) {\n return reducerCollection.map(reducer => {\n return reducer instanceof InjectionToken ? inject(reducer) : reducer;\n });\n}\nfunction _initialStateFactory(initialState) {\n if (typeof initialState === 'function') {\n return initialState();\n }\n return initialState;\n}\nfunction _concatMetaReducers(metaReducers, userProvidedMetaReducers) {\n return metaReducers.concat(userProvidedMetaReducers);\n}\nfunction _provideForRootGuard() {\n const store = inject(Store, {\n optional: true,\n skipSelf: true\n });\n if (store) {\n throw new TypeError(`The root Store has been provided more than once. Feature modules should provide feature states instead.`);\n }\n return 'guarded';\n}\nfunction immutabilityCheckMetaReducer(reducer, checks) {\n return function (state, action) {\n const act = checks.action(action) ? freeze(action) : action;\n const nextState = reducer(state, act);\n return checks.state() ? freeze(nextState) : nextState;\n };\n}\nfunction freeze(target) {\n Object.freeze(target);\n const targetIsFunction = isFunction(target);\n Object.getOwnPropertyNames(target).forEach(prop => {\n // Ignore Ivy properties, ref: https://github.com/ngrx/platform/issues/2109#issuecomment-582689060\n if (prop.startsWith('ɵ')) {\n return;\n }\n if (hasOwnProperty(target, prop) && (targetIsFunction ? prop !== 'caller' && prop !== 'callee' && prop !== 'arguments' : true)) {\n const propValue = target[prop];\n if ((isObjectLike(propValue) || isFunction(propValue)) && !Object.isFrozen(propValue)) {\n freeze(propValue);\n }\n }\n });\n return target;\n}\nfunction serializationCheckMetaReducer(reducer, checks) {\n return function (state, action) {\n if (checks.action(action)) {\n const unserializableAction = getUnserializable(action);\n throwIfUnserializable(unserializableAction, 'action');\n }\n const nextState = reducer(state, action);\n if (checks.state()) {\n const unserializableState = getUnserializable(nextState);\n throwIfUnserializable(unserializableState, 'state');\n }\n return nextState;\n };\n}\nfunction getUnserializable(target, path = []) {\n // Guard against undefined and null, e.g. a reducer that returns undefined\n if ((isUndefined(target) || isNull(target)) && path.length === 0) {\n return {\n path: ['root'],\n value: target\n };\n }\n const keys = Object.keys(target);\n return keys.reduce((result, key) => {\n if (result) {\n return result;\n }\n const value = target[key];\n // Ignore Ivy components\n if (isComponent(value)) {\n return result;\n }\n if (isUndefined(value) || isNull(value) || isNumber(value) || isBoolean(value) || isString(value) || isArray(value)) {\n return false;\n }\n if (isPlainObject(value)) {\n return getUnserializable(value, [...path, key]);\n }\n return {\n path: [...path, key],\n value\n };\n }, false);\n}\nfunction throwIfUnserializable(unserializable, context) {\n if (unserializable === false) {\n return;\n }\n const unserializablePath = unserializable.path.join('.');\n const error = new Error(`Detected unserializable ${context} at \"${unserializablePath}\". ${RUNTIME_CHECK_URL}#strict${context}serializability`);\n error.value = unserializable.value;\n error.unserializablePath = unserializablePath;\n throw error;\n}\nfunction inNgZoneAssertMetaReducer(reducer, checks) {\n return function (state, action) {\n if (checks.action(action) && !i0.NgZone.isInAngularZone()) {\n throw new Error(`Action '${action.type}' running outside NgZone. ${RUNTIME_CHECK_URL}#strictactionwithinngzone`);\n }\n return reducer(state, action);\n };\n}\nfunction createActiveRuntimeChecks(runtimeChecks) {\n if (isDevMode()) {\n return {\n strictStateSerializability: false,\n strictActionSerializability: false,\n strictStateImmutability: true,\n strictActionImmutability: true,\n strictActionWithinNgZone: false,\n strictActionTypeUniqueness: false,\n ...runtimeChecks\n };\n }\n return {\n strictStateSerializability: false,\n strictActionSerializability: false,\n strictStateImmutability: false,\n strictActionImmutability: false,\n strictActionWithinNgZone: false,\n strictActionTypeUniqueness: false\n };\n}\nfunction createSerializationCheckMetaReducer({\n strictActionSerializability,\n strictStateSerializability\n}) {\n return reducer => strictActionSerializability || strictStateSerializability ? serializationCheckMetaReducer(reducer, {\n action: action => strictActionSerializability && !ignoreNgrxAction(action),\n state: () => strictStateSerializability\n }) : reducer;\n}\nfunction createImmutabilityCheckMetaReducer({\n strictActionImmutability,\n strictStateImmutability\n}) {\n return reducer => strictActionImmutability || strictStateImmutability ? immutabilityCheckMetaReducer(reducer, {\n action: action => strictActionImmutability && !ignoreNgrxAction(action),\n state: () => strictStateImmutability\n }) : reducer;\n}\nfunction ignoreNgrxAction(action) {\n return action.type.startsWith('@ngrx');\n}\nfunction createInNgZoneCheckMetaReducer({\n strictActionWithinNgZone\n}) {\n return reducer => strictActionWithinNgZone ? inNgZoneAssertMetaReducer(reducer, {\n action: action => strictActionWithinNgZone && !ignoreNgrxAction(action)\n }) : reducer;\n}\nfunction provideRuntimeChecks(runtimeChecks) {\n return [{\n provide: _USER_RUNTIME_CHECKS,\n useValue: runtimeChecks\n }, {\n provide: USER_RUNTIME_CHECKS,\n useFactory: _runtimeChecksFactory,\n deps: [_USER_RUNTIME_CHECKS]\n }, {\n provide: ACTIVE_RUNTIME_CHECKS,\n deps: [USER_RUNTIME_CHECKS],\n useFactory: createActiveRuntimeChecks\n }, {\n provide: META_REDUCERS,\n multi: true,\n deps: [ACTIVE_RUNTIME_CHECKS],\n useFactory: createImmutabilityCheckMetaReducer\n }, {\n provide: META_REDUCERS,\n multi: true,\n deps: [ACTIVE_RUNTIME_CHECKS],\n useFactory: createSerializationCheckMetaReducer\n }, {\n provide: META_REDUCERS,\n multi: true,\n deps: [ACTIVE_RUNTIME_CHECKS],\n useFactory: createInNgZoneCheckMetaReducer\n }];\n}\nfunction checkForActionTypeUniqueness() {\n return [{\n provide: _ACTION_TYPE_UNIQUENESS_CHECK,\n multi: true,\n deps: [ACTIVE_RUNTIME_CHECKS],\n useFactory: _actionTypeUniquenessCheck\n }];\n}\nfunction _runtimeChecksFactory(runtimeChecks) {\n return runtimeChecks;\n}\nfunction _actionTypeUniquenessCheck(config) {\n if (!config.strictActionTypeUniqueness) {\n return;\n }\n const duplicates = Object.entries(REGISTERED_ACTION_TYPES).filter(([, registrations]) => registrations > 1).map(([type]) => type);\n if (duplicates.length) {\n throw new Error(`Action types are registered more than once, ${duplicates.map(type => `\"${type}\"`).join(', ')}. ${RUNTIME_CHECK_URL}#strictactiontypeuniqueness`);\n }\n}\n\n/**\n * Provides additional slices of state in the Store.\n * These providers cannot be used at the component level.\n *\n * @usageNotes\n *\n * ### Providing Store Features\n *\n * ```ts\n * const booksRoutes: Route[] = [\n * {\n * path: '',\n * providers: [provideState('books', booksReducer)],\n * children: [\n * { path: '', component: BookListComponent },\n * { path: ':id', component: BookDetailsComponent },\n * ],\n * },\n * ];\n * ```\n */\nfunction provideState(featureNameOrSlice, reducers, config = {}) {\n return makeEnvironmentProviders([..._provideState(featureNameOrSlice, reducers, config), ENVIRONMENT_STATE_PROVIDER]);\n}\nfunction _provideStore(reducers = {}, config = {}) {\n return [{\n provide: _ROOT_STORE_GUARD,\n useFactory: _provideForRootGuard\n }, {\n provide: _INITIAL_STATE,\n useValue: config.initialState\n }, {\n provide: INITIAL_STATE,\n useFactory: _initialStateFactory,\n deps: [_INITIAL_STATE]\n }, {\n provide: _INITIAL_REDUCERS,\n useValue: reducers\n }, {\n provide: _STORE_REDUCERS,\n useExisting: reducers instanceof InjectionToken ? reducers : _INITIAL_REDUCERS\n }, {\n provide: INITIAL_REDUCERS,\n deps: [_INITIAL_REDUCERS, [new Inject(_STORE_REDUCERS)]],\n useFactory: _createStoreReducers\n }, {\n provide: USER_PROVIDED_META_REDUCERS,\n useValue: config.metaReducers ? config.metaReducers : []\n }, {\n provide: _RESOLVED_META_REDUCERS,\n deps: [META_REDUCERS, USER_PROVIDED_META_REDUCERS],\n useFactory: _concatMetaReducers\n }, {\n provide: _REDUCER_FACTORY,\n useValue: config.reducerFactory ? config.reducerFactory : combineReducers\n }, {\n provide: REDUCER_FACTORY,\n deps: [_REDUCER_FACTORY, _RESOLVED_META_REDUCERS],\n useFactory: createReducerFactory\n }, ACTIONS_SUBJECT_PROVIDERS, REDUCER_MANAGER_PROVIDERS, SCANNED_ACTIONS_SUBJECT_PROVIDERS, STATE_PROVIDERS, STORE_PROVIDERS, provideRuntimeChecks(config.runtimeChecks), checkForActionTypeUniqueness()];\n}\nfunction rootStoreProviderFactory() {\n inject(ActionsSubject);\n inject(ReducerObservable);\n inject(ScannedActionsSubject);\n inject(Store);\n inject(_ROOT_STORE_GUARD, {\n optional: true\n });\n inject(_ACTION_TYPE_UNIQUENESS_CHECK, {\n optional: true\n });\n}\n/**\n * Environment Initializer used in the root\n * providers to initialize the Store\n */\nconst ENVIRONMENT_STORE_PROVIDER = [{\n provide: ROOT_STORE_PROVIDER,\n useFactory: rootStoreProviderFactory\n}, {\n provide: ENVIRONMENT_INITIALIZER,\n multi: true,\n useFactory() {\n return () => inject(ROOT_STORE_PROVIDER);\n }\n}];\n/**\n * Provides the global Store providers and initializes\n * the Store.\n * These providers cannot be used at the component level.\n *\n * @usageNotes\n *\n * ### Providing the Global Store\n *\n * ```ts\n * bootstrapApplication(AppComponent, {\n * providers: [provideStore()],\n * });\n * ```\n */\nfunction provideStore(reducers, config) {\n return makeEnvironmentProviders([..._provideStore(reducers, config), ENVIRONMENT_STORE_PROVIDER]);\n}\nfunction featureStateProviderFactory() {\n inject(ROOT_STORE_PROVIDER);\n const features = inject(_STORE_FEATURES);\n const featureReducers = inject(FEATURE_REDUCERS);\n const reducerManager = inject(ReducerManager);\n inject(_ACTION_TYPE_UNIQUENESS_CHECK, {\n optional: true\n });\n const feats = features.map((feature, index) => {\n const featureReducerCollection = featureReducers.shift();\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const reducers = featureReducerCollection /*TODO(#823)*/[index];\n return {\n ...feature,\n reducers,\n initialState: _initialStateFactory(feature.initialState)\n };\n });\n reducerManager.addFeatures(feats);\n}\n/**\n * Environment Initializer used in the feature\n * providers to register state features\n */\nconst ENVIRONMENT_STATE_PROVIDER = [{\n provide: FEATURE_STATE_PROVIDER,\n useFactory: featureStateProviderFactory\n}, {\n provide: ENVIRONMENT_INITIALIZER,\n multi: true,\n useFactory() {\n return () => inject(FEATURE_STATE_PROVIDER);\n }\n}];\nfunction _provideState(featureNameOrSlice, reducers, config = {}) {\n return [{\n provide: _FEATURE_CONFIGS,\n multi: true,\n useValue: featureNameOrSlice instanceof Object ? {} : config\n }, {\n provide: STORE_FEATURES,\n multi: true,\n useValue: {\n key: featureNameOrSlice instanceof Object ? featureNameOrSlice.name : featureNameOrSlice,\n reducerFactory: !(config instanceof InjectionToken) && config.reducerFactory ? config.reducerFactory : combineReducers,\n metaReducers: !(config instanceof InjectionToken) && config.metaReducers ? config.metaReducers : [],\n initialState: !(config instanceof InjectionToken) && config.initialState ? config.initialState : undefined\n }\n }, {\n provide: _STORE_FEATURES,\n deps: [_FEATURE_CONFIGS, STORE_FEATURES],\n useFactory: _createFeatureStore\n }, {\n provide: _FEATURE_REDUCERS,\n multi: true,\n useValue: featureNameOrSlice instanceof Object ? featureNameOrSlice.reducer : reducers\n }, {\n provide: _FEATURE_REDUCERS_TOKEN,\n multi: true,\n useExisting: reducers instanceof InjectionToken ? reducers : _FEATURE_REDUCERS\n }, {\n provide: FEATURE_REDUCERS,\n multi: true,\n deps: [_FEATURE_REDUCERS, [new Inject(_FEATURE_REDUCERS_TOKEN)]],\n useFactory: _createFeatureReducers\n }, checkForActionTypeUniqueness()];\n}\nclass StoreRootModule {\n constructor(actions$, reducer$, scannedActions$, store, guard, actionCheck) {}\n /** @nocollapse */\n static {\n this.ɵfac = function StoreRootModule_Factory(t) {\n return new (t || StoreRootModule)(i0.ɵɵinject(ActionsSubject), i0.ɵɵinject(ReducerObservable), i0.ɵɵinject(ScannedActionsSubject), i0.ɵɵinject(Store), i0.ɵɵinject(_ROOT_STORE_GUARD, 8), i0.ɵɵinject(_ACTION_TYPE_UNIQUENESS_CHECK, 8));\n };\n }\n /** @nocollapse */\n static {\n this.ɵmod = /* @__PURE__ */i0.ɵɵdefineNgModule({\n type: StoreRootModule\n });\n }\n /** @nocollapse */\n static {\n this.ɵinj = /* @__PURE__ */i0.ɵɵdefineInjector({});\n }\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(StoreRootModule, [{\n type: NgModule,\n args: [{}]\n }], () => [{\n type: ActionsSubject\n }, {\n type: ReducerObservable\n }, {\n type: ScannedActionsSubject\n }, {\n type: Store\n }, {\n type: undefined,\n decorators: [{\n type: Optional\n }, {\n type: Inject,\n args: [_ROOT_STORE_GUARD]\n }]\n }, {\n type: undefined,\n decorators: [{\n type: Optional\n }, {\n type: Inject,\n args: [_ACTION_TYPE_UNIQUENESS_CHECK]\n }]\n }], null);\n})();\nclass StoreFeatureModule {\n constructor(features, featureReducers, reducerManager, root, actionCheck) {\n this.features = features;\n this.featureReducers = featureReducers;\n this.reducerManager = reducerManager;\n const feats = features.map((feature, index) => {\n const featureReducerCollection = featureReducers.shift();\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const reducers = featureReducerCollection /*TODO(#823)*/[index];\n return {\n ...feature,\n reducers,\n initialState: _initialStateFactory(feature.initialState)\n };\n });\n reducerManager.addFeatures(feats);\n }\n // eslint-disable-next-line @angular-eslint/contextual-lifecycle\n ngOnDestroy() {\n this.reducerManager.removeFeatures(this.features);\n }\n /** @nocollapse */\n static {\n this.ɵfac = function StoreFeatureModule_Factory(t) {\n return new (t || StoreFeatureModule)(i0.ɵɵinject(_STORE_FEATURES), i0.ɵɵinject(FEATURE_REDUCERS), i0.ɵɵinject(ReducerManager), i0.ɵɵinject(StoreRootModule), i0.ɵɵinject(_ACTION_TYPE_UNIQUENESS_CHECK, 8));\n };\n }\n /** @nocollapse */\n static {\n this.ɵmod = /* @__PURE__ */i0.ɵɵdefineNgModule({\n type: StoreFeatureModule\n });\n }\n /** @nocollapse */\n static {\n this.ɵinj = /* @__PURE__ */i0.ɵɵdefineInjector({});\n }\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(StoreFeatureModule, [{\n type: NgModule,\n args: [{}]\n }], () => [{\n type: undefined,\n decorators: [{\n type: Inject,\n args: [_STORE_FEATURES]\n }]\n }, {\n type: undefined,\n decorators: [{\n type: Inject,\n args: [FEATURE_REDUCERS]\n }]\n }, {\n type: ReducerManager\n }, {\n type: StoreRootModule\n }, {\n type: undefined,\n decorators: [{\n type: Optional\n }, {\n type: Inject,\n args: [_ACTION_TYPE_UNIQUENESS_CHECK]\n }]\n }], null);\n})();\nclass StoreModule {\n static forRoot(reducers, config) {\n return {\n ngModule: StoreRootModule,\n providers: [..._provideStore(reducers, config)]\n };\n }\n static forFeature(featureNameOrSlice, reducers, config = {}) {\n return {\n ngModule: StoreFeatureModule,\n providers: [..._provideState(featureNameOrSlice, reducers, config)]\n };\n }\n /** @nocollapse */\n static {\n this.ɵfac = function StoreModule_Factory(t) {\n return new (t || StoreModule)();\n };\n }\n /** @nocollapse */\n static {\n this.ɵmod = /* @__PURE__ */i0.ɵɵdefineNgModule({\n type: StoreModule\n });\n }\n /** @nocollapse */\n static {\n this.ɵinj = /* @__PURE__ */i0.ɵɵdefineInjector({});\n }\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(StoreModule, [{\n type: NgModule,\n args: [{}]\n }], null, null);\n})();\n\n/**\n * @description\n * Associates actions with a given state change function.\n * A state change function must be provided as the last parameter.\n *\n * @param args `ActionCreator`'s followed by a state change function.\n *\n * @returns an association of action types with a state change function.\n *\n * @usageNotes\n * ```ts\n * on(AuthApiActions.loginSuccess, (state, { user }) => ({ ...state, user }))\n * ```\n */\nfunction on(...args) {\n const reducer = args.pop();\n const types = args.map(creator => creator.type);\n return {\n reducer,\n types\n };\n}\n/**\n * @description\n * Creates a reducer function to handle state transitions.\n *\n * Reducer creators reduce the explicitness of reducer functions with switch statements.\n *\n * @param initialState Provides a state value if the current state is `undefined`, as it is initially.\n * @param ons Associations between actions and state changes.\n * @returns A reducer function.\n *\n * @usageNotes\n *\n * - Must be used with `ActionCreator`'s (returned by `createAction`). Cannot be used with class-based action creators.\n * - The returned `ActionReducer` does not require being wrapped with another function.\n *\n * **Declaring a reducer creator**\n *\n * ```ts\n * export const reducer = createReducer(\n * initialState,\n * on(\n * featureActions.actionOne,\n * featureActions.actionTwo,\n * (state, { updatedValue }) => ({ ...state, prop: updatedValue })\n * ),\n * on(featureActions.actionThree, () => initialState);\n * );\n * ```\n */\nfunction createReducer(initialState, ...ons) {\n const map = new Map();\n for (const on of ons) {\n for (const type of on.types) {\n const existingReducer = map.get(type);\n if (existingReducer) {\n const newReducer = (state, action) => on.reducer(existingReducer(state, action), action);\n map.set(type, newReducer);\n } else {\n map.set(type, on.reducer);\n }\n }\n }\n return function (state = initialState, action) {\n const reducer = map.get(action.type);\n return reducer ? reducer(state, action) : state;\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 { ACTIVE_RUNTIME_CHECKS, ActionsSubject, FEATURE_REDUCERS, FEATURE_STATE_PROVIDER, INIT, INITIAL_REDUCERS, INITIAL_STATE, META_REDUCERS, REDUCER_FACTORY, ROOT_STORE_PROVIDER, ReducerManager, ReducerManagerDispatcher, ReducerObservable, STORE_FEATURES, ScannedActionsSubject, State, StateObservable, Store, StoreFeatureModule, StoreModule, StoreRootModule, UPDATE, USER_PROVIDED_META_REDUCERS, USER_RUNTIME_CHECKS, combineReducers, compose, createAction, createActionGroup, createFeature, createFeatureSelector, createReducer, createReducerFactory, createSelector, createSelectorFactory, defaultMemoize, defaultStateFn, emptyProps, isNgrxMockEnvironment, on, props, provideState, provideStore, reduceState, resultMemoize, select, setNgrxMockEnvironment, union };\n","import * as i0 from '@angular/core';\nimport { Injectable, EventEmitter, InjectionToken, Inject, Directive, Input, Pipe, NgModule } from '@angular/core';\nimport { of, isObservable, forkJoin, concat, defer } from 'rxjs';\nimport { take, shareReplay, map, concatMap, switchMap } from 'rxjs/operators';\nclass TranslateLoader {}\n/**\n * This loader is just a placeholder that does nothing, in case you don't need a loader at all\n */\nclass TranslateFakeLoader extends TranslateLoader {\n getTranslation(lang) {\n return of({});\n }\n static ɵfac = /* @__PURE__ */(() => {\n let ɵTranslateFakeLoader_BaseFactory;\n return function TranslateFakeLoader_Factory(t) {\n return (ɵTranslateFakeLoader_BaseFactory || (ɵTranslateFakeLoader_BaseFactory = i0.ɵɵgetInheritedFactory(TranslateFakeLoader)))(t || TranslateFakeLoader);\n };\n })();\n static ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: TranslateFakeLoader,\n factory: TranslateFakeLoader.ɵfac\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(TranslateFakeLoader, [{\n type: Injectable\n }], null, null);\n})();\nclass MissingTranslationHandler {}\n/**\n * This handler is just a placeholder that does nothing, in case you don't need a missing translation handler at all\n */\nclass FakeMissingTranslationHandler {\n handle(params) {\n return params.key;\n }\n static ɵfac = function FakeMissingTranslationHandler_Factory(t) {\n return new (t || FakeMissingTranslationHandler)();\n };\n static ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: FakeMissingTranslationHandler,\n factory: FakeMissingTranslationHandler.ɵfac\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(FakeMissingTranslationHandler, [{\n type: Injectable\n }], null, null);\n})();\n\n/* tslint:disable */\n/**\n * Determines if two objects or two values are equivalent.\n *\n * Two objects or values are considered equivalent if at least one of the following is true:\n *\n * * Both objects or values pass `===` comparison.\n * * Both objects or values are of the same type and all of their properties are equal by\n * comparing them with `equals`.\n *\n * @param o1 Object or value to compare.\n * @param o2 Object or value to compare.\n * @returns true if arguments are equal.\n */\nfunction equals(o1, o2) {\n if (o1 === o2) return true;\n if (o1 === null || o2 === null) return false;\n if (o1 !== o1 && o2 !== o2) return true; // NaN === NaN\n let t1 = typeof o1,\n t2 = typeof o2,\n length,\n key,\n keySet;\n if (t1 == t2 && t1 == 'object') {\n if (Array.isArray(o1)) {\n if (!Array.isArray(o2)) return false;\n if ((length = o1.length) == o2.length) {\n for (key = 0; key < length; key++) {\n if (!equals(o1[key], o2[key])) return false;\n }\n return true;\n }\n } else {\n if (Array.isArray(o2)) {\n return false;\n }\n keySet = Object.create(null);\n for (key in o1) {\n if (!equals(o1[key], o2[key])) {\n return false;\n }\n keySet[key] = true;\n }\n for (key in o2) {\n if (!(key in keySet) && typeof o2[key] !== 'undefined') {\n return false;\n }\n }\n return true;\n }\n }\n return false;\n}\n/* tslint:enable */\nfunction isDefined(value) {\n return typeof value !== 'undefined' && value !== null;\n}\nfunction isObject(item) {\n return item && typeof item === 'object' && !Array.isArray(item);\n}\nfunction mergeDeep(target, source) {\n let output = Object.assign({}, target);\n if (isObject(target) && isObject(source)) {\n Object.keys(source).forEach(key => {\n if (isObject(source[key])) {\n if (!(key in target)) {\n Object.assign(output, {\n [key]: source[key]\n });\n } else {\n output[key] = mergeDeep(target[key], source[key]);\n }\n } else {\n Object.assign(output, {\n [key]: source[key]\n });\n }\n });\n }\n return output;\n}\nclass TranslateParser {}\nclass TranslateDefaultParser extends TranslateParser {\n templateMatcher = /{{\\s?([^{}\\s]*)\\s?}}/g;\n interpolate(expr, params) {\n let result;\n if (typeof expr === 'string') {\n result = this.interpolateString(expr, params);\n } else if (typeof expr === 'function') {\n result = this.interpolateFunction(expr, params);\n } else {\n // this should not happen, but an unrelated TranslateService test depends on it\n result = expr;\n }\n return result;\n }\n getValue(target, key) {\n let keys = typeof key === 'string' ? key.split('.') : [key];\n key = '';\n do {\n key += keys.shift();\n if (isDefined(target) && isDefined(target[key]) && (typeof target[key] === 'object' || !keys.length)) {\n target = target[key];\n key = '';\n } else if (!keys.length) {\n target = undefined;\n } else {\n key += '.';\n }\n } while (keys.length);\n return target;\n }\n interpolateFunction(fn, params) {\n return fn(params);\n }\n interpolateString(expr, params) {\n if (!params) {\n return expr;\n }\n return expr.replace(this.templateMatcher, (substring, b) => {\n let r = this.getValue(params, b);\n return isDefined(r) ? r : substring;\n });\n }\n static ɵfac = /* @__PURE__ */(() => {\n let ɵTranslateDefaultParser_BaseFactory;\n return function TranslateDefaultParser_Factory(t) {\n return (ɵTranslateDefaultParser_BaseFactory || (ɵTranslateDefaultParser_BaseFactory = i0.ɵɵgetInheritedFactory(TranslateDefaultParser)))(t || TranslateDefaultParser);\n };\n })();\n static ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: TranslateDefaultParser,\n factory: TranslateDefaultParser.ɵfac\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(TranslateDefaultParser, [{\n type: Injectable\n }], null, null);\n})();\nclass TranslateCompiler {}\n/**\n * This compiler is just a placeholder that does nothing, in case you don't need a compiler at all\n */\nclass TranslateFakeCompiler extends TranslateCompiler {\n compile(value, lang) {\n return value;\n }\n compileTranslations(translations, lang) {\n return translations;\n }\n static ɵfac = /* @__PURE__ */(() => {\n let ɵTranslateFakeCompiler_BaseFactory;\n return function TranslateFakeCompiler_Factory(t) {\n return (ɵTranslateFakeCompiler_BaseFactory || (ɵTranslateFakeCompiler_BaseFactory = i0.ɵɵgetInheritedFactory(TranslateFakeCompiler)))(t || TranslateFakeCompiler);\n };\n })();\n static ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: TranslateFakeCompiler,\n factory: TranslateFakeCompiler.ɵfac\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(TranslateFakeCompiler, [{\n type: Injectable\n }], null, null);\n})();\nclass TranslateStore {\n /**\n * The default lang to fallback when translations are missing on the current lang\n */\n defaultLang;\n /**\n * The lang currently used\n */\n currentLang = this.defaultLang;\n /**\n * a list of translations per lang\n */\n translations = {};\n /**\n * an array of langs\n */\n langs = [];\n /**\n * An EventEmitter to listen to translation change events\n * onTranslationChange.subscribe((params: TranslationChangeEvent) => {\n * // do something\n * });\n */\n onTranslationChange = new EventEmitter();\n /**\n * An EventEmitter to listen to lang change events\n * onLangChange.subscribe((params: LangChangeEvent) => {\n * // do something\n * });\n */\n onLangChange = new EventEmitter();\n /**\n * An EventEmitter to listen to default lang change events\n * onDefaultLangChange.subscribe((params: DefaultLangChangeEvent) => {\n * // do something\n * });\n */\n onDefaultLangChange = new EventEmitter();\n}\nconst USE_STORE = new InjectionToken('USE_STORE');\nconst USE_DEFAULT_LANG = new InjectionToken('USE_DEFAULT_LANG');\nconst DEFAULT_LANGUAGE = new InjectionToken('DEFAULT_LANGUAGE');\nconst USE_EXTEND = new InjectionToken('USE_EXTEND');\nclass TranslateService {\n store;\n currentLoader;\n compiler;\n parser;\n missingTranslationHandler;\n useDefaultLang;\n isolate;\n extend;\n loadingTranslations;\n pending = false;\n _onTranslationChange = new EventEmitter();\n _onLangChange = new EventEmitter();\n _onDefaultLangChange = new EventEmitter();\n _defaultLang;\n _currentLang;\n _langs = [];\n _translations = {};\n _translationRequests = {};\n /**\n * An EventEmitter to listen to translation change events\n * onTranslationChange.subscribe((params: TranslationChangeEvent) => {\n * // do something\n * });\n */\n get onTranslationChange() {\n return this.isolate ? this._onTranslationChange : this.store.onTranslationChange;\n }\n /**\n * An EventEmitter to listen to lang change events\n * onLangChange.subscribe((params: LangChangeEvent) => {\n * // do something\n * });\n */\n get onLangChange() {\n return this.isolate ? this._onLangChange : this.store.onLangChange;\n }\n /**\n * An EventEmitter to listen to default lang change events\n * onDefaultLangChange.subscribe((params: DefaultLangChangeEvent) => {\n * // do something\n * });\n */\n get onDefaultLangChange() {\n return this.isolate ? this._onDefaultLangChange : this.store.onDefaultLangChange;\n }\n /**\n * The default lang to fallback when translations are missing on the current lang\n */\n get defaultLang() {\n return this.isolate ? this._defaultLang : this.store.defaultLang;\n }\n set defaultLang(defaultLang) {\n if (this.isolate) {\n this._defaultLang = defaultLang;\n } else {\n this.store.defaultLang = defaultLang;\n }\n }\n /**\n * The lang currently used\n */\n get currentLang() {\n return this.isolate ? this._currentLang : this.store.currentLang;\n }\n set currentLang(currentLang) {\n if (this.isolate) {\n this._currentLang = currentLang;\n } else {\n this.store.currentLang = currentLang;\n }\n }\n /**\n * an array of langs\n */\n get langs() {\n return this.isolate ? this._langs : this.store.langs;\n }\n set langs(langs) {\n if (this.isolate) {\n this._langs = langs;\n } else {\n this.store.langs = langs;\n }\n }\n /**\n * a list of translations per lang\n */\n get translations() {\n return this.isolate ? this._translations : this.store.translations;\n }\n set translations(translations) {\n if (this.isolate) {\n this._translations = translations;\n } else {\n this.store.translations = translations;\n }\n }\n /**\n *\n * @param store an instance of the store (that is supposed to be unique)\n * @param currentLoader An instance of the loader currently used\n * @param compiler An instance of the compiler currently used\n * @param parser An instance of the parser currently used\n * @param missingTranslationHandler A handler for missing translations.\n * @param useDefaultLang whether we should use default language translation when current language translation is missing.\n * @param isolate whether this service should use the store or not\n * @param extend To make a child module extend (and use) translations from parent modules.\n * @param defaultLanguage Set the default language using configuration\n */\n constructor(store, currentLoader, compiler, parser, missingTranslationHandler, useDefaultLang = true, isolate = false, extend = false, defaultLanguage) {\n this.store = store;\n this.currentLoader = currentLoader;\n this.compiler = compiler;\n this.parser = parser;\n this.missingTranslationHandler = missingTranslationHandler;\n this.useDefaultLang = useDefaultLang;\n this.isolate = isolate;\n this.extend = extend;\n /** set the default language from configuration */\n if (defaultLanguage) {\n this.setDefaultLang(defaultLanguage);\n }\n }\n /**\n * Sets the default language to use as a fallback\n */\n setDefaultLang(lang) {\n if (lang === this.defaultLang) {\n return;\n }\n let pending = this.retrieveTranslations(lang);\n if (typeof pending !== \"undefined\") {\n // on init set the defaultLang immediately\n if (this.defaultLang == null) {\n this.defaultLang = lang;\n }\n pending.pipe(take(1)).subscribe(res => {\n this.changeDefaultLang(lang);\n });\n } else {\n // we already have this language\n this.changeDefaultLang(lang);\n }\n }\n /**\n * Gets the default language used\n */\n getDefaultLang() {\n return this.defaultLang;\n }\n /**\n * Changes the lang currently used\n */\n use(lang) {\n // don't change the language if the language given is already selected\n if (lang === this.currentLang) {\n return of(this.translations[lang]);\n }\n let pending = this.retrieveTranslations(lang);\n if (typeof pending !== \"undefined\") {\n // on init set the currentLang immediately\n if (!this.currentLang) {\n this.currentLang = lang;\n }\n pending.pipe(take(1)).subscribe(res => {\n this.changeLang(lang);\n });\n return pending;\n } else {\n // we have this language, return an Observable\n this.changeLang(lang);\n return of(this.translations[lang]);\n }\n }\n /**\n * Retrieves the given translations\n */\n retrieveTranslations(lang) {\n let pending;\n // if this language is unavailable or extend is true, ask for it\n if (typeof this.translations[lang] === \"undefined\" || this.extend) {\n this._translationRequests[lang] = this._translationRequests[lang] || this.getTranslation(lang);\n pending = this._translationRequests[lang];\n }\n return pending;\n }\n /**\n * Gets an object of translations for a given language with the current loader\n * and passes it through the compiler\n */\n getTranslation(lang) {\n this.pending = true;\n const loadingTranslations = this.currentLoader.getTranslation(lang).pipe(shareReplay(1), take(1));\n this.loadingTranslations = loadingTranslations.pipe(map(res => this.compiler.compileTranslations(res, lang)), shareReplay(1), take(1));\n this.loadingTranslations.subscribe({\n next: res => {\n this.translations[lang] = this.extend && this.translations[lang] ? {\n ...res,\n ...this.translations[lang]\n } : res;\n this.updateLangs();\n this.pending = false;\n },\n error: err => {\n this.pending = false;\n }\n });\n return loadingTranslations;\n }\n /**\n * Manually sets an object of translations for a given language\n * after passing it through the compiler\n */\n setTranslation(lang, translations, shouldMerge = false) {\n translations = this.compiler.compileTranslations(translations, lang);\n if ((shouldMerge || this.extend) && this.translations[lang]) {\n this.translations[lang] = mergeDeep(this.translations[lang], translations);\n } else {\n this.translations[lang] = translations;\n }\n this.updateLangs();\n this.onTranslationChange.emit({\n lang: lang,\n translations: this.translations[lang]\n });\n }\n /**\n * Returns an array of currently available langs\n */\n getLangs() {\n return this.langs;\n }\n /**\n * Add available langs\n */\n addLangs(langs) {\n langs.forEach(lang => {\n if (this.langs.indexOf(lang) === -1) {\n this.langs.push(lang);\n }\n });\n }\n /**\n * Update the list of available langs\n */\n updateLangs() {\n this.addLangs(Object.keys(this.translations));\n }\n /**\n * Returns the parsed result of the translations\n */\n getParsedResult(translations, key, interpolateParams) {\n let res;\n if (key instanceof Array) {\n let result = {},\n observables = false;\n for (let k of key) {\n result[k] = this.getParsedResult(translations, k, interpolateParams);\n if (isObservable(result[k])) {\n observables = true;\n }\n }\n if (observables) {\n const sources = key.map(k => isObservable(result[k]) ? result[k] : of(result[k]));\n return forkJoin(sources).pipe(map(arr => {\n let obj = {};\n arr.forEach((value, index) => {\n obj[key[index]] = value;\n });\n return obj;\n }));\n }\n return result;\n }\n if (translations) {\n res = this.parser.interpolate(this.parser.getValue(translations, key), interpolateParams);\n }\n if (typeof res === \"undefined\" && this.defaultLang != null && this.defaultLang !== this.currentLang && this.useDefaultLang) {\n res = this.parser.interpolate(this.parser.getValue(this.translations[this.defaultLang], key), interpolateParams);\n }\n if (typeof res === \"undefined\") {\n let params = {\n key,\n translateService: this\n };\n if (typeof interpolateParams !== 'undefined') {\n params.interpolateParams = interpolateParams;\n }\n res = this.missingTranslationHandler.handle(params);\n }\n return typeof res !== \"undefined\" ? res : key;\n }\n /**\n * Gets the translated value of a key (or an array of keys)\n * @returns the translated key, or an object of translated keys\n */\n get(key, interpolateParams) {\n if (!isDefined(key) || !key.length) {\n throw new Error(`Parameter \"key\" required`);\n }\n // check if we are loading a new translation to use\n if (this.pending) {\n return this.loadingTranslations.pipe(concatMap(res => {\n res = this.getParsedResult(res, key, interpolateParams);\n return isObservable(res) ? res : of(res);\n }));\n } else {\n let res = this.getParsedResult(this.translations[this.currentLang], key, interpolateParams);\n return isObservable(res) ? res : of(res);\n }\n }\n /**\n * Returns a stream of translated values of a key (or an array of keys) which updates\n * whenever the translation changes.\n * @returns A stream of the translated key, or an object of translated keys\n */\n getStreamOnTranslationChange(key, interpolateParams) {\n if (!isDefined(key) || !key.length) {\n throw new Error(`Parameter \"key\" required`);\n }\n return concat(defer(() => this.get(key, interpolateParams)), this.onTranslationChange.pipe(switchMap(event => {\n const res = this.getParsedResult(event.translations, key, interpolateParams);\n if (typeof res.subscribe === 'function') {\n return res;\n } else {\n return of(res);\n }\n })));\n }\n /**\n * Returns a stream of translated values of a key (or an array of keys) which updates\n * whenever the language changes.\n * @returns A stream of the translated key, or an object of translated keys\n */\n stream(key, interpolateParams) {\n if (!isDefined(key) || !key.length) {\n throw new Error(`Parameter \"key\" required`);\n }\n return concat(defer(() => this.get(key, interpolateParams)), this.onLangChange.pipe(switchMap(event => {\n const res = this.getParsedResult(event.translations, key, interpolateParams);\n return isObservable(res) ? res : of(res);\n })));\n }\n /**\n * Returns a translation instantly from the internal state of loaded translation.\n * All rules regarding the current language, the preferred language of even fallback languages will be used except any promise handling.\n */\n instant(key, interpolateParams) {\n if (!isDefined(key) || !key.length) {\n throw new Error(`Parameter \"key\" required`);\n }\n let res = this.getParsedResult(this.translations[this.currentLang], key, interpolateParams);\n if (isObservable(res)) {\n if (key instanceof Array) {\n let obj = {};\n key.forEach((value, index) => {\n obj[key[index]] = key[index];\n });\n return obj;\n }\n return key;\n } else {\n return res;\n }\n }\n /**\n * Sets the translated value of a key, after compiling it\n */\n set(key, value, lang = this.currentLang) {\n this.translations[lang][key] = this.compiler.compile(value, lang);\n this.updateLangs();\n this.onTranslationChange.emit({\n lang: lang,\n translations: this.translations[lang]\n });\n }\n /**\n * Changes the current lang\n */\n changeLang(lang) {\n this.currentLang = lang;\n this.onLangChange.emit({\n lang: lang,\n translations: this.translations[lang]\n });\n // if there is no default lang, use the one that we just set\n if (this.defaultLang == null) {\n this.changeDefaultLang(lang);\n }\n }\n /**\n * Changes the default lang\n */\n changeDefaultLang(lang) {\n this.defaultLang = lang;\n this.onDefaultLangChange.emit({\n lang: lang,\n translations: this.translations[lang]\n });\n }\n /**\n * Allows to reload the lang file from the file\n */\n reloadLang(lang) {\n this.resetLang(lang);\n return this.getTranslation(lang);\n }\n /**\n * Deletes inner translation\n */\n resetLang(lang) {\n this._translationRequests[lang] = undefined;\n this.translations[lang] = undefined;\n }\n /**\n * Returns the language code name from the browser, e.g. \"de\"\n */\n getBrowserLang() {\n if (typeof window === 'undefined' || typeof window.navigator === 'undefined') {\n return undefined;\n }\n let browserLang = window.navigator.languages ? window.navigator.languages[0] : null;\n browserLang = browserLang || window.navigator.language || window.navigator.browserLanguage || window.navigator.userLanguage;\n if (typeof browserLang === 'undefined') {\n return undefined;\n }\n if (browserLang.indexOf('-') !== -1) {\n browserLang = browserLang.split('-')[0];\n }\n if (browserLang.indexOf('_') !== -1) {\n browserLang = browserLang.split('_')[0];\n }\n return browserLang;\n }\n /**\n * Returns the culture language code name from the browser, e.g. \"de-DE\"\n */\n getBrowserCultureLang() {\n if (typeof window === 'undefined' || typeof window.navigator === 'undefined') {\n return undefined;\n }\n let browserCultureLang = window.navigator.languages ? window.navigator.languages[0] : null;\n browserCultureLang = browserCultureLang || window.navigator.language || window.navigator.browserLanguage || window.navigator.userLanguage;\n return browserCultureLang;\n }\n static ɵfac = function TranslateService_Factory(t) {\n return new (t || TranslateService)(i0.ɵɵinject(TranslateStore), i0.ɵɵinject(TranslateLoader), i0.ɵɵinject(TranslateCompiler), i0.ɵɵinject(TranslateParser), i0.ɵɵinject(MissingTranslationHandler), i0.ɵɵinject(USE_DEFAULT_LANG), i0.ɵɵinject(USE_STORE), i0.ɵɵinject(USE_EXTEND), i0.ɵɵinject(DEFAULT_LANGUAGE));\n };\n static ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: TranslateService,\n factory: TranslateService.ɵfac\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(TranslateService, [{\n type: Injectable\n }], function () {\n return [{\n type: TranslateStore\n }, {\n type: TranslateLoader\n }, {\n type: TranslateCompiler\n }, {\n type: TranslateParser\n }, {\n type: MissingTranslationHandler\n }, {\n type: undefined,\n decorators: [{\n type: Inject,\n args: [USE_DEFAULT_LANG]\n }]\n }, {\n type: undefined,\n decorators: [{\n type: Inject,\n args: [USE_STORE]\n }]\n }, {\n type: undefined,\n decorators: [{\n type: Inject,\n args: [USE_EXTEND]\n }]\n }, {\n type: undefined,\n decorators: [{\n type: Inject,\n args: [DEFAULT_LANGUAGE]\n }]\n }];\n }, null);\n})();\nclass TranslateDirective {\n translateService;\n element;\n _ref;\n key;\n lastParams;\n currentParams;\n onLangChangeSub;\n onDefaultLangChangeSub;\n onTranslationChangeSub;\n set translate(key) {\n if (key) {\n this.key = key;\n this.checkNodes();\n }\n }\n set translateParams(params) {\n if (!equals(this.currentParams, params)) {\n this.currentParams = params;\n this.checkNodes(true);\n }\n }\n constructor(translateService, element, _ref) {\n this.translateService = translateService;\n this.element = element;\n this._ref = _ref;\n // subscribe to onTranslationChange event, in case the translations of the current lang change\n if (!this.onTranslationChangeSub) {\n this.onTranslationChangeSub = this.translateService.onTranslationChange.subscribe(event => {\n if (event.lang === this.translateService.currentLang) {\n this.checkNodes(true, event.translations);\n }\n });\n }\n // subscribe to onLangChange event, in case the language changes\n if (!this.onLangChangeSub) {\n this.onLangChangeSub = this.translateService.onLangChange.subscribe(event => {\n this.checkNodes(true, event.translations);\n });\n }\n // subscribe to onDefaultLangChange event, in case the default language changes\n if (!this.onDefaultLangChangeSub) {\n this.onDefaultLangChangeSub = this.translateService.onDefaultLangChange.subscribe(event => {\n this.checkNodes(true);\n });\n }\n }\n ngAfterViewChecked() {\n this.checkNodes();\n }\n checkNodes(forceUpdate = false, translations) {\n let nodes = this.element.nativeElement.childNodes;\n // if the element is empty\n if (!nodes.length) {\n // we add the key as content\n this.setContent(this.element.nativeElement, this.key);\n nodes = this.element.nativeElement.childNodes;\n }\n for (let i = 0; i < nodes.length; ++i) {\n let node = nodes[i];\n if (node.nodeType === 3) {\n // node type 3 is a text node\n let key;\n if (forceUpdate) {\n node.lastKey = null;\n }\n if (isDefined(node.lookupKey)) {\n key = node.lookupKey;\n } else if (this.key) {\n key = this.key;\n } else {\n let content = this.getContent(node);\n let trimmedContent = content.trim();\n if (trimmedContent.length) {\n node.lookupKey = trimmedContent;\n // we want to use the content as a key, not the translation value\n if (content !== node.currentValue) {\n key = trimmedContent;\n // the content was changed from the user, we'll use it as a reference if needed\n node.originalContent = content || node.originalContent;\n } else if (node.originalContent) {\n // the content seems ok, but the lang has changed\n // the current content is the translation, not the key, use the last real content as key\n key = node.originalContent.trim();\n } else if (content !== node.currentValue) {\n // we want to use the content as a key, not the translation value\n key = trimmedContent;\n // the content was changed from the user, we'll use it as a reference if needed\n node.originalContent = content || node.originalContent;\n }\n }\n }\n this.updateValue(key, node, translations);\n }\n }\n }\n updateValue(key, node, translations) {\n if (key) {\n if (node.lastKey === key && this.lastParams === this.currentParams) {\n return;\n }\n this.lastParams = this.currentParams;\n let onTranslation = res => {\n if (res !== key) {\n node.lastKey = key;\n }\n if (!node.originalContent) {\n node.originalContent = this.getContent(node);\n }\n node.currentValue = isDefined(res) ? res : node.originalContent || key;\n // we replace in the original content to preserve spaces that we might have trimmed\n this.setContent(node, this.key ? node.currentValue : node.originalContent.replace(key, node.currentValue));\n this._ref.markForCheck();\n };\n if (isDefined(translations)) {\n let res = this.translateService.getParsedResult(translations, key, this.currentParams);\n if (isObservable(res)) {\n res.subscribe({\n next: onTranslation\n });\n } else {\n onTranslation(res);\n }\n } else {\n this.translateService.get(key, this.currentParams).subscribe(onTranslation);\n }\n }\n }\n getContent(node) {\n return isDefined(node.textContent) ? node.textContent : node.data;\n }\n setContent(node, content) {\n if (isDefined(node.textContent)) {\n node.textContent = content;\n } else {\n node.data = content;\n }\n }\n ngOnDestroy() {\n if (this.onLangChangeSub) {\n this.onLangChangeSub.unsubscribe();\n }\n if (this.onDefaultLangChangeSub) {\n this.onDefaultLangChangeSub.unsubscribe();\n }\n if (this.onTranslationChangeSub) {\n this.onTranslationChangeSub.unsubscribe();\n }\n }\n static ɵfac = function TranslateDirective_Factory(t) {\n return new (t || TranslateDirective)(i0.ɵɵdirectiveInject(TranslateService), i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef));\n };\n static ɵdir = /* @__PURE__ */i0.ɵɵdefineDirective({\n type: TranslateDirective,\n selectors: [[\"\", \"translate\", \"\"], [\"\", \"ngx-translate\", \"\"]],\n inputs: {\n translate: \"translate\",\n translateParams: \"translateParams\"\n }\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(TranslateDirective, [{\n type: Directive,\n args: [{\n selector: '[translate],[ngx-translate]'\n }]\n }], function () {\n return [{\n type: TranslateService\n }, {\n type: i0.ElementRef\n }, {\n type: i0.ChangeDetectorRef\n }];\n }, {\n translate: [{\n type: Input\n }],\n translateParams: [{\n type: Input\n }]\n });\n})();\nclass TranslatePipe {\n translate;\n _ref;\n value = '';\n lastKey = null;\n lastParams = [];\n onTranslationChange;\n onLangChange;\n onDefaultLangChange;\n constructor(translate, _ref) {\n this.translate = translate;\n this._ref = _ref;\n }\n updateValue(key, interpolateParams, translations) {\n let onTranslation = res => {\n this.value = res !== undefined ? res : key;\n this.lastKey = key;\n this._ref.markForCheck();\n };\n if (translations) {\n let res = this.translate.getParsedResult(translations, key, interpolateParams);\n if (isObservable(res.subscribe)) {\n res.subscribe(onTranslation);\n } else {\n onTranslation(res);\n }\n }\n this.translate.get(key, interpolateParams).subscribe(onTranslation);\n }\n transform(query, ...args) {\n if (!query || !query.length) {\n return query;\n }\n // if we ask another time for the same key, return the last value\n if (equals(query, this.lastKey) && equals(args, this.lastParams)) {\n return this.value;\n }\n let interpolateParams = undefined;\n if (isDefined(args[0]) && args.length) {\n if (typeof args[0] === 'string' && args[0].length) {\n // we accept objects written in the template such as {n:1}, {'n':1}, {n:'v'}\n // which is why we might need to change it to real JSON objects such as {\"n\":1} or {\"n\":\"v\"}\n let validArgs = args[0].replace(/(\\')?([a-zA-Z0-9_]+)(\\')?(\\s)?:/g, '\"$2\":').replace(/:(\\s)?(\\')(.*?)(\\')/g, ':\"$3\"');\n try {\n interpolateParams = JSON.parse(validArgs);\n } catch (e) {\n throw new SyntaxError(`Wrong parameter in TranslatePipe. Expected a valid Object, received: ${args[0]}`);\n }\n } else if (typeof args[0] === 'object' && !Array.isArray(args[0])) {\n interpolateParams = args[0];\n }\n }\n // store the query, in case it changes\n this.lastKey = query;\n // store the params, in case they change\n this.lastParams = args;\n // set the value\n this.updateValue(query, interpolateParams);\n // if there is a subscription to onLangChange, clean it\n this._dispose();\n // subscribe to onTranslationChange event, in case the translations change\n if (!this.onTranslationChange) {\n this.onTranslationChange = this.translate.onTranslationChange.subscribe(event => {\n if (this.lastKey && event.lang === this.translate.currentLang) {\n this.lastKey = null;\n this.updateValue(query, interpolateParams, event.translations);\n }\n });\n }\n // subscribe to onLangChange event, in case the language changes\n if (!this.onLangChange) {\n this.onLangChange = this.translate.onLangChange.subscribe(event => {\n if (this.lastKey) {\n this.lastKey = null; // we want to make sure it doesn't return the same value until it's been updated\n this.updateValue(query, interpolateParams, event.translations);\n }\n });\n }\n // subscribe to onDefaultLangChange event, in case the default language changes\n if (!this.onDefaultLangChange) {\n this.onDefaultLangChange = this.translate.onDefaultLangChange.subscribe(() => {\n if (this.lastKey) {\n this.lastKey = null; // we want to make sure it doesn't return the same value until it's been updated\n this.updateValue(query, interpolateParams);\n }\n });\n }\n return this.value;\n }\n /**\n * Clean any existing subscription to change events\n */\n _dispose() {\n if (typeof this.onTranslationChange !== 'undefined') {\n this.onTranslationChange.unsubscribe();\n this.onTranslationChange = undefined;\n }\n if (typeof this.onLangChange !== 'undefined') {\n this.onLangChange.unsubscribe();\n this.onLangChange = undefined;\n }\n if (typeof this.onDefaultLangChange !== 'undefined') {\n this.onDefaultLangChange.unsubscribe();\n this.onDefaultLangChange = undefined;\n }\n }\n ngOnDestroy() {\n this._dispose();\n }\n static ɵfac = function TranslatePipe_Factory(t) {\n return new (t || TranslatePipe)(i0.ɵɵdirectiveInject(TranslateService, 16), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef, 16));\n };\n static ɵpipe = /* @__PURE__ */i0.ɵɵdefinePipe({\n name: \"translate\",\n type: TranslatePipe,\n pure: false\n });\n static ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: TranslatePipe,\n factory: TranslatePipe.ɵfac\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(TranslatePipe, [{\n type: Injectable\n }, {\n type: Pipe,\n args: [{\n name: 'translate',\n pure: false // required to update the value when the promise is resolved\n }]\n }], function () {\n return [{\n type: TranslateService\n }, {\n type: i0.ChangeDetectorRef\n }];\n }, null);\n})();\nclass TranslateModule {\n /**\n * Use this method in your root module to provide the TranslateService\n */\n static forRoot(config = {}) {\n return {\n ngModule: TranslateModule,\n providers: [config.loader || {\n provide: TranslateLoader,\n useClass: TranslateFakeLoader\n }, config.compiler || {\n provide: TranslateCompiler,\n useClass: TranslateFakeCompiler\n }, config.parser || {\n provide: TranslateParser,\n useClass: TranslateDefaultParser\n }, config.missingTranslationHandler || {\n provide: MissingTranslationHandler,\n useClass: FakeMissingTranslationHandler\n }, TranslateStore, {\n provide: USE_STORE,\n useValue: config.isolate\n }, {\n provide: USE_DEFAULT_LANG,\n useValue: config.useDefaultLang\n }, {\n provide: USE_EXTEND,\n useValue: config.extend\n }, {\n provide: DEFAULT_LANGUAGE,\n useValue: config.defaultLanguage\n }, TranslateService]\n };\n }\n /**\n * Use this method in your other (non root) modules to import the directive/pipe\n */\n static forChild(config = {}) {\n return {\n ngModule: TranslateModule,\n providers: [config.loader || {\n provide: TranslateLoader,\n useClass: TranslateFakeLoader\n }, config.compiler || {\n provide: TranslateCompiler,\n useClass: TranslateFakeCompiler\n }, config.parser || {\n provide: TranslateParser,\n useClass: TranslateDefaultParser\n }, config.missingTranslationHandler || {\n provide: MissingTranslationHandler,\n useClass: FakeMissingTranslationHandler\n }, {\n provide: USE_STORE,\n useValue: config.isolate\n }, {\n provide: USE_DEFAULT_LANG,\n useValue: config.useDefaultLang\n }, {\n provide: USE_EXTEND,\n useValue: config.extend\n }, {\n provide: DEFAULT_LANGUAGE,\n useValue: config.defaultLanguage\n }, TranslateService]\n };\n }\n static ɵfac = function TranslateModule_Factory(t) {\n return new (t || TranslateModule)();\n };\n static ɵmod = /* @__PURE__ */i0.ɵɵdefineNgModule({\n type: TranslateModule\n });\n static ɵinj = /* @__PURE__ */i0.ɵɵdefineInjector({});\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(TranslateModule, [{\n type: NgModule,\n args: [{\n declarations: [TranslatePipe, TranslateDirective],\n exports: [TranslatePipe, TranslateDirective]\n }]\n }], null, null);\n})();\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { DEFAULT_LANGUAGE, FakeMissingTranslationHandler, MissingTranslationHandler, TranslateCompiler, TranslateDefaultParser, TranslateDirective, TranslateFakeCompiler, TranslateFakeLoader, TranslateLoader, TranslateModule, TranslateParser, TranslatePipe, TranslateService, TranslateStore, USE_DEFAULT_LANG, USE_EXTEND, USE_STORE };\n","/**\n * Copyright (c) 2020-2023 by Bosch.IO GmbH\n *\n * http://www.bosch.io\n * All rights reserved,\n * also regarding any disposal, exploitation, reproduction,\n * editing, distribution, as well as in the event of\n * applications for industrial property rights.\n *\n * This software is the confidential and proprietary information\n * of Bosch.IO GmbH. You shall not disclose\n * such Confidential Information and shall use it only in\n * accordance with the terms of the license agreement you\n * entered into with Bosch.IO.\n */\nimport { Action } from '@ngrx/store';\nexport const LOAD_PROFILE: string = '[User] Load profile';\nexport const LOAD_SUBSCRIPTIONS: string = '[User] Load subscriptions';\nexport const LOAD_UNIVERSAL_FILTERS: string = '[User] Load Universal Filters';\nexport const ACCEPT_TERMS: string = '[User] Accept terms';\nexport const SET_PROFILE: string = '[User] Set Profile';\nexport const SET_PROFILE_LOADED: string = '[User] Set Profile Loaded';\nexport const DECODE_ACCESS_TOKEN_FOR_USER_INFO: string =\n '[User] Decode jwt for user info';\nexport const SET_ROLES_EXTRACTED: string = '[User] Roles extracted';\nexport const SET_SUBSCRIPTIONS: string = '[User] Set Subscriptions';\nexport const SET_SUBSCRIPTIONS_LOADED: string =\n '[User] Set Subscriptions Loaded';\nexport const SET_UNIVERSAL_FILTERS: string = '[User] Set Universal Filters';\nexport const SET_AVAILABLE_INSIGHT_PROJECTS_LOADED: string =\n '[User] Set Insight projects Loaded';\nexport const SET_AVAILABLE_INSIGHT_PROJECTS: string =\n '[User] Set insight projects';\nexport const SET_GLOBAL_FILTER_SELECTED_PROJECTS_LOADED: string =\n '[User] Set Insight selected projects Loaded';\nexport const SET_GLOBAL_FILTER_SELECTED_PROJECTS: string =\n '[User] Set insight selected projects';\nexport const SET_ROLES: string = '[User] Set Roles';\nexport const RESET_USER: string = '[User] Reset user';\nexport const LOAD_SELECTED_SUBSCRIPTION_ROLES: string =\n '[User] Load selected subscriptions roles';\nexport const SET_SELECTED_SUBSCRIPTION_ROLES_LOADED: string =\n '[User] Set selected subscriptions roles Loaded';\nexport const CREATE_INVITE: string = '[User] Create user invites';\nexport const LOAD_INVITATIONS: string = '[User] Load user invites';\nexport const SET_INVITE: string = '[User] Set user invite';\nexport const DELETE_USER: string = '[User] Delete user';\nexport const REDEEM_CODE: string = '[User] Redeem user subscription code';\n\nexport class ResetUser implements Action {\n readonly type = RESET_USER;\n constructor(public payload?: any) {}\n}\n\nexport class LoadProfile implements Action {\n readonly type = LOAD_PROFILE;\n constructor(public payload?: any) {}\n}\n\nexport class LoadSubscriptions implements Action {\n readonly type = LOAD_SUBSCRIPTIONS;\n constructor(public payload?: any) {}\n}\n\nexport class LoadUniversalFilters implements Action {\n readonly type = LOAD_UNIVERSAL_FILTERS;\n constructor(public payload?: any) {}\n}\n\nexport class AcceptTerms implements Action {\n readonly type = ACCEPT_TERMS;\n constructor(public payload?: any) {}\n}\n\nexport class SetProfileLoaded implements Action {\n readonly type = SET_PROFILE_LOADED;\n constructor(public payload?: any) {}\n}\n\nexport class SetProfile implements Action {\n readonly type = SET_PROFILE;\n constructor(public payload?: any) {}\n}\nexport class SetSubscriptionsLoaded implements Action {\n readonly type = SET_SUBSCRIPTIONS_LOADED;\n constructor(public payload: boolean) {}\n}\n\nexport class SetSubscriptions implements Action {\n readonly type = SET_SUBSCRIPTIONS;\n constructor(public payload?: any) {}\n}\n\nexport class SetUniversalFilters implements Action {\n readonly type = SET_UNIVERSAL_FILTERS;\n constructor(public payload?: any) {}\n}\n\nexport class SetAvailableInsightProjects implements Action {\n readonly type = SET_AVAILABLE_INSIGHT_PROJECTS;\n constructor(public payload?: any) {}\n}\n\nexport class SetAvailableInsightProjectsLoaded implements Action {\n readonly type = SET_AVAILABLE_INSIGHT_PROJECTS_LOADED;\n constructor(public payload?: any) {}\n}\n\nexport class SetGlobalFilterSelectedProjects implements Action {\n readonly type = SET_GLOBAL_FILTER_SELECTED_PROJECTS;\n constructor(public payload?: any) {}\n}\n\nexport class SetGlobalFilterSelectedProjectsLoaded implements Action {\n readonly type = SET_GLOBAL_FILTER_SELECTED_PROJECTS_LOADED;\n constructor(public payload?: any) {}\n}\n\nexport class DecodeJWTForUserInfo implements Action {\n readonly type = DECODE_ACCESS_TOKEN_FOR_USER_INFO;\n constructor(public payload?: any) {}\n}\n\nexport class SetRolesExtracted implements Action {\n readonly type = SET_ROLES_EXTRACTED;\n constructor(public payload?: any) {}\n}\n\nexport class SetRoles implements Action {\n readonly type = SET_ROLES;\n constructor(public payload: string[]) {}\n}\n\nexport class LoadSelectedSubscriptionRoles implements Action {\n readonly type = LOAD_SELECTED_SUBSCRIPTION_ROLES;\n constructor(public payload?: any) {}\n}\n\nexport class SetSelectedSubscriptionRoles implements Action {\n readonly type = SET_SELECTED_SUBSCRIPTION_ROLES_LOADED;\n constructor(public payload?: any) {}\n}\n\nexport class CreateInvite implements Action {\n readonly type = CREATE_INVITE;\n constructor(public payload?: any) {}\n}\n\nexport class RedeemCode implements Action {\n readonly type = REDEEM_CODE;\n constructor(public payload?: any) {}\n}\n\nexport class SetInvitations implements Action {\n readonly type = SET_INVITE;\n constructor(public payload?: any) {}\n}\n\nexport class LoadInvitations implements Action {\n readonly type = LOAD_INVITATIONS;\n constructor(public payload?: any) {}\n}\n\nexport class DeleteUser implements Action {\n readonly type = DELETE_USER;\n constructor(public payload?: any) {}\n}\n\nexport type AllUserActions =\n | SetProfile\n | SetProfileLoaded\n | SetSubscriptions\n | SetSubscriptionsLoaded\n | SetUniversalFilters\n | DecodeJWTForUserInfo\n | SetRoles\n | SetAvailableInsightProjects\n | SetAvailableInsightProjectsLoaded\n | SetGlobalFilterSelectedProjects\n | SetGlobalFilterSelectedProjectsLoaded\n | LoadSelectedSubscriptionRoles\n | SetSelectedSubscriptionRoles\n | CreateInvite\n | SetInvitations\n | LoadInvitations;\n","/**\n * Copyright (c) 2020-2023 by Bosch.IO GmbH\n *\n * http://www.bosch.io\n * All rights reserved,\n * also regarding any disposal, exploitation, reproduction,\n * editing, distribution, as well as in the event of\n * applications for industrial property rights.\n *\n * This software is the confidential and proprietary information\n * of Bosch.IO GmbH. You shall not disclose\n * such Confidential Information and shall use it only in\n * accordance with the terms of the license agreement you\n * entered into with Bosch.IO.\n */\nimport { AuthConfig } from 'angular-oauth2-oidc';\nimport { env } from 'src/environments/environment';\nimport { LoginType } from '../../models';\nexport const LOGOUT_URL = `${env.AUTH_URL}/realms/${env.AUTH_REALM}/protocol/openid-connect/logout`;\nconst authConfig: AuthConfig = {\n issuer: `https://p61.authz.bosch.com/auth/realms/${env.AUTH_REALM}`,\n loginUrl: `${env.AUTH_URL}/realms/${env.AUTH_REALM}/protocol/openid-connect/login`,\n revocationEndpoint: `${env.AUTH_URL}/realms/${env.AUTH_REALM}/protocol/openid-connect/revoke`,\n clientId: env.AUTH_CLIENT_ID,\n responseType: 'code',\n scope: 'openid',\n useSilentRefresh: true,\n timeoutFactor: 1.0,\n showDebugInformation: env.environment !== 'prod',\n clockSkewInSec: -60,\n};\n\nexport const getSignInConfig = (loginType: LoginType): AuthConfig => {\n if (loginType === LoginType.Bosch) {\n return {\n ...authConfig,\n customQueryParams: { kc_idp_hint: env.BOSCH_KEYCLOAK_ID },\n };\n }\n return {\n ...authConfig,\n customQueryParams: {\n style_id: env.SINGLE_KEY_STYLE_ID,\n kc_idp_hint: env.SINGLE_KEY_ID_HINT,\n },\n };\n};\n","import { shortUrls, signInRoute } from './app-urls';\n\n/**\n * Copyright (c) 2020-2023 by Bosch.IO GmbH\n *\n * http://www.bosch.io\n * All rights reserved,\n * also regarding any disposal, exploitation, reproduction,\n * editing, distribution, as well as in the event of\n * applications for industrial property rights.\n *\n * This software is the confidential and proprietary information\n * of Bosch.IO GmbH. You shall not disclose\n * such Confidential Information and shall use it only in\n * accordance with the terms of the license agreement you\n * entered into with Bosch.IO.\n */\nexport const DEFAULT_TOAST_DISMISS_TIME_MS = 4000;\nexport const REDIRECT_WHEN_IOT_INSIGHTS_IS_NOT_AUTHENTICATED_AFTER_TIME_MS = 2000;\nexport const MARKDOWN_MESSAGE_MAX_LENGTH = 500;\nexport const GLOBAL_API_ERROR_MESSAGE_HANDLING_HEADER_KEY =\n 'allow-global-api-error-message-handling';\nexport const GRAFANA_LOADING_SCREEN_DISMISS_AFTER_MS = 800;\nexport const USAGE_MONITOR_PAGE_ID = 'usage-monitor';\nexport const PRICE_PLAN_PAGE =\n 'https://inside-docupedia.bosch.com/confluence/pages/viewpage.action?pageId=2720208670';\n\nexport const hideLoadingOnPages = [\n signInRoute,\n shortUrls.visitorWelcome,\n shortUrls.genericError,\n shortUrls.subscriptionAccessDenied,\n shortUrls.auth,\n shortUrls.systemDown,\n];\n\nexport const defaultApplicationTitle = 'SaaS Factory';\n","/**\n * Copyright (c) 2020-2023 by Bosch.IO GmbH\n *\n * http://www.bosch.io\n * All rights reserved,\n * also regarding any disposal, exploitation, reproduction,\n * editing, distribution, as well as in the event of\n * applications for industrial property rights.\n *\n * This software is the confidential and proprietary information\n * of Bosch.IO GmbH. You shall not disclose\n * such Confidential Information and shall use it only in\n * accordance with the terms of the license agreement you\n * entered into with Bosch.IO.\n */\nimport { Action } from '@ngrx/store';\n\nexport const LOAD_PUBLIC_APP_CONFIG: string = '[Context] Load landing content';\nexport const LOAD_SYSTEM_MAINTENANCE_INFO: string =\n '[Context] Load system maintenance info';\nexport const SET_APPLICATION_ID: string = '[Context] Set application ID';\nexport const SET_SUBSCRIPTION_ID: string = '[Context] Set subscription ID';\nexport const SET_VIEW: string = '[Context] Set view';\nexport const SET_PAGE: string = '[Context] Set page';\nexport const SET_PAGE_ACTION_TYPE: string = '[Context] Set action type';\nexport const SET_LANDING_CONTENT: string = '[Context] Set landing content';\nexport const SET_LANDING_CONTENT_LOADED: string =\n '[Context] Set landing content loaded';\nexport const UPDATE_SYSTEM_MAINTENANCE_INFO: string =\n '[Context] Update maintenance info';\nexport const SET_SYSTEM_MAINTENANCE_INFO: string =\n '[Context] Set system maintenance info';\nexport const SET_SYSTEM_MAINTENANCE_INFO_LOADED: string =\n '[Context] Set system maintenance info loaded';\nexport const SET_SYSTEM_MAINTENANCE_INFO_SEEN: string =\n '[Context] Set system maintenance info seen';\nexport const RESET_CONTEXT: string = '[Context] Reset context';\n\nexport class ResetContext implements Action {\n readonly type = RESET_CONTEXT;\n constructor(public payload?: any) {}\n}\n\nexport class LoadPublicAppConfig implements Action {\n readonly type = LOAD_PUBLIC_APP_CONFIG;\n constructor(public payload?: any) {}\n}\n\nexport class LoadSystemMaintenanceInfo implements Action {\n readonly type = LOAD_SYSTEM_MAINTENANCE_INFO;\n constructor(public payload?: any) {}\n}\n\nexport class SetApplicationId implements Action {\n readonly type = SET_APPLICATION_ID;\n constructor(public payload?: any) {}\n}\n\nexport class SetSubscriptionId implements Action {\n readonly type = SET_SUBSCRIPTION_ID;\n constructor(public payload?: any) {}\n}\n\nexport class SetView implements Action {\n readonly type = SET_VIEW;\n constructor(public payload?: any) {}\n}\n\nexport class SetPage implements Action {\n readonly type = SET_PAGE;\n constructor(public payload?: any) {}\n}\nexport class SetPageActionType implements Action {\n readonly type = SET_PAGE_ACTION_TYPE;\n constructor(public payload?: any) {}\n}\n\nexport class SetLandingContent implements Action {\n readonly type = SET_LANDING_CONTENT;\n constructor(public payload?: any) {}\n}\n\nexport class SetLandingContentLoaded implements Action {\n readonly type = SET_LANDING_CONTENT_LOADED;\n constructor(public payload?: any) {}\n}\n\nexport class SetSystemMaintenanceInfo implements Action {\n readonly type = SET_SYSTEM_MAINTENANCE_INFO;\n constructor(public payload?: any) {}\n}\n\nexport class SetSystemMaintenanceInfoLoaded implements Action {\n readonly type = SET_SYSTEM_MAINTENANCE_INFO_LOADED;\n constructor(public payload?: any) {}\n}\n\nexport class SetSystemMaintenanceInfoSeen implements Action {\n readonly type = SET_SYSTEM_MAINTENANCE_INFO_SEEN;\n constructor(public payload?: any) {}\n}\n\nexport class UpdateSystemMaintenanceInfo implements Action {\n readonly type = UPDATE_SYSTEM_MAINTENANCE_INFO;\n constructor(public payload?: any) {}\n}\n\nexport type AllContextActions =\n | SetApplicationId\n | SetSubscriptionId\n | SetView\n | SetLandingContent\n | SetLandingContentLoaded\n | SetSystemMaintenanceInfo\n | SetSystemMaintenanceInfoLoaded\n | SetSystemMaintenanceInfoSeen\n | UpdateSystemMaintenanceInfo;\n","/**\n * Copyright (c) 2020-2023 by Bosch.IO GmbH\n *\n * http://www.bosch.io\n * All rights reserved,\n * also regarding any disposal, exploitation, reproduction,\n * editing, distribution, as well as in the event of\n * applications for industrial property rights.\n *\n * This software is the confidential and proprietary information\n * of Bosch.IO GmbH. You shall not disclose\n * such Confidential Information and shall use it only in\n * accordance with the terms of the license agreement you\n * entered into with Bosch.IO.\n */\nimport { Injectable } from '@angular/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class LoggerService {\n private logToConsole(\n type: 'log' | 'info' | 'warn' | 'error' | 'debug',\n prefix: string,\n content?: any\n ) {\n content = content ?? '';\n console[type](prefix + content);\n }\n\n public log(prefix: string, content?: any) {\n this.logToConsole('log', prefix, content);\n }\n\n public info(prefix: string, content?: any) {\n this.logToConsole('info', prefix, content);\n }\n\n public warn(prefix: string, content?: any) {\n this.logToConsole('warn', prefix, content);\n }\n\n public error(prefix: string, content?: any) {\n this.logToConsole('error', prefix, content);\n }\n\n public debug(prefix: string, content?: any) {\n this.logToConsole('debug', prefix, content);\n }\n}\n","/**\n * Copyright (c) 2020-2023 by Bosch.IO GmbH\n *\n * http://www.bosch.io\n * All rights reserved,\n * also regarding any disposal, exploitation, reproduction,\n * editing, distribution, as well as in the event of\n * applications for industrial property rights.\n *\n * This software is the confidential and proprietary information\n * of Bosch.IO GmbH. You shall not disclose\n * such Confidential Information and shall use it only in\n * accordance with the terms of the license agreement you\n * entered into with Bosch.IO.\n */\nimport { Injectable } from '@angular/core';\nimport { NavigationEnd, NavigationStart, Router } from '@angular/router';\nimport { filter } from 'rxjs';\nimport { env } from '../../../environments/environment';\nimport { fullUrls, signInRoute } from '../../app-urls';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class RoutingService {\n navStart = this.router.events.pipe(\n filter((evt) => evt instanceof NavigationStart)\n );\n navEnd = this.router.events.pipe(\n filter((evt) => evt instanceof NavigationEnd)\n );\n\n constructor(private router: Router) {}\n loadDefaultApplication() {\n window.location.href = `/${env.DEFAULT_APPLICATION}/${signInRoute}`;\n }\n loadSystemDownPage() {\n return this.router.navigateByUrl(fullUrls.systemDown, { replaceUrl: true });\n }\n}\n","/**\n * Copyright (c) 2020-2023 by Bosch.IO GmbH\n *\n * http://www.bosch.io\n * All rights reserved,\n * also regarding any disposal, exploitation, reproduction,\n * editing, distribution, as well as in the event of\n * applications for industrial property rights.\n *\n * This software is the confidential and proprietary information\n * of Bosch.IO GmbH. You shall not disclose\n * such Confidential Information and shall use it only in\n * accordance with the terms of the license agreement you\n * entered into with Bosch.IO.\n */\nimport { Injectable } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { Store } from '@ngrx/store';\nimport { OAuthService } from 'angular-oauth2-oidc';\nimport { LoggerService } from './logger.service';\n\nimport {\n bufferCount,\n distinctUntilChanged,\n filter,\n map,\n Observable,\n tap,\n} from 'rxjs';\nimport {\n DecodeJWTForUserInfo,\n LoadProfile,\n LoadSubscriptions,\n} from 'src/app/shared/data/actions/user.actions';\nimport { getSignInConfig } from '../data/config/auth.config';\nimport { AppState } from '../data/state/app.state.model';\nimport { BrowserStorageKey, LoginType, UserRole } from '../models';\nimport { BrowserStorageService } from './browser-storage.service';\n\nimport { Location } from '@angular/common';\nimport { env } from 'src/environments/environment';\nimport { postLoginRouteForOAuth, signInRoute } from '../../app-urls';\nimport { hideLoadingOnPages } from '../../app.const';\nimport { LoadSystemMaintenanceInfo } from '../data/actions/context.actions';\nimport { findIntersectionOfTwoLists } from '../util';\nimport { RoutingService } from './routing.service';\n@Injectable({\n providedIn: 'root',\n})\nexport class AuthService {\n idpList: Observable> = this.store$.select(\n (state) => state.context.publicAppConfig?.idps\n );\n\n currentUserInfo$ = this.store$\n .select((state) => state.user)\n .pipe(\n map((user) => ({\n profileLoaded: user.profileLoaded,\n profile: user.profile,\n }))\n );\n\n userRoles$ = this.store$\n .select((state) => state.user)\n .pipe(\n filter((user) => user.rolesExtracted),\n map((user) => user.roles)\n );\n\n readonly isSystemAdmin$ = this.doesUserHaveMatchingRole([\n UserRole.SystemAdmin,\n ]);\n readonly isOwner$ = this.doesUserHaveMatchingRole([UserRole.Owner]);\n readonly isAdmin$ = this.doesUserHaveMatchingRole([UserRole.Admin]);\n readonly isUser$ = this.doesUserHaveMatchingRole([UserRole.User]);\n\n authTokenExpired$ = this.routingService.navStart.pipe(\n map((_) => this.hasValidAccessToken()),\n distinctUntilChanged(),\n bufferCount(2),\n filter(\n ([prevState, currentState]) =>\n prevState === true && currentState === false\n ),\n tap((_) =>\n console.log(\n 'Navigation Occurred - Access token needs renewal. Token expired at: ',\n new Date(this.oauthService.getAccessTokenExpiration())\n )\n )\n );\n constructor(\n private router: Router,\n private oauthService: OAuthService,\n private store$: Store,\n private logger: LoggerService,\n private browserStorage: BrowserStorageService,\n private ngLocation: Location,\n private routingService: RoutingService\n ) {}\n\n async redirectToPageBasedOnLoginState() {\n const currentLoginType = this.getCurrentLoginType();\n if (!currentLoginType) {\n const activeApplicationId = this.getActiveApplication();\n this.saveCurrentNonLoginUrl();\n this.router.navigateByUrl(`/${activeApplicationId}/${signInRoute}`);\n return;\n }\n await this.checkIfAccessTokenCanBeAcquired();\n\n /**\n We have to log-in user every time they refresh, but to prevent infinite login loop \n we try to detect if user logged in immediately before this because at this point refresh token\n should be available in memory\n */\n const refreshToken = this.oauthService.getRefreshToken();\n if (!refreshToken || !this.hasValidAccessToken()) {\n await this.initiateLoginFlow(currentLoginType);\n return;\n }\n this.authTokenExpired$.subscribe();\n this.loadUserInfo();\n }\n getActiveApplication() {\n const currentUrl = this.ngLocation.path();\n const applicationIdFromUrl = currentUrl.trim().split('/')[1];\n return applicationIdFromUrl || env.DEFAULT_APPLICATION;\n }\n\n async logout() {\n this.browserStorage.clear();\n this.oauthService.logOut();\n }\n\n initiateLoginFlow(loginType: LoginType): Promise {\n return new Promise(async (resolve, reject) => {\n try {\n this.browserStorage.setItem(BrowserStorageKey.loginType, loginType);\n const validToken = await this.checkIfAccessTokenCanBeAcquired();\n this.logger.debug('Token validated: ', validToken);\n if (validToken) {\n this.saveCurrentNonLoginUrl();\n this.oauthService.initCodeFlow();\n resolve(true);\n }\n reject(false);\n } catch (error) {\n this.logger.debug('Problem loading OAuth discovery: ', error);\n reject(false);\n }\n });\n }\n\n getCurrentLoginType(): LoginType {\n return this.browserStorage.getItem(\n BrowserStorageKey.loginType\n ) as LoginType;\n }\n\n getPostLogoutUrl() {\n const applicationId = this.getActiveApplication();\n return `${env.BASE_HREF}/${applicationId}`;\n }\n\n getAccessToken() {\n return this.oauthService.getAccessToken();\n }\n\n hasValidAccessToken() {\n return this.oauthService.hasValidAccessToken();\n }\n\n doesUserHaveMatchingRole(minRequiredRoles: Array) {\n return this.userRoles$.pipe(\n map((roles) => {\n return !!findIntersectionOfTwoLists(roles, minRequiredRoles).length;\n })\n );\n }\n\n private async checkIfAccessTokenCanBeAcquired() {\n const configured = this.configureOAuthBasedOnLoginType();\n\n let validToken = false;\n if (configured) {\n await this.oauthService\n .loadDiscoveryDocumentAndTryLogin()\n .then((token) => (validToken = token))\n .catch((_) => null);\n }\n\n return validToken;\n }\n private configureOAuthBasedOnLoginType() {\n const loginType = this.getCurrentLoginType();\n if (loginType) {\n this.oauthService.configure({\n ...getSignInConfig(loginType),\n redirectUri: `${\n env.BASE_HREF\n }/${this.getActiveApplication()}/${postLoginRouteForOAuth}`,\n postLogoutRedirectUri: this.getPostLogoutUrl(),\n });\n }\n return !!loginType;\n }\n\n async refreshAccessToken() {\n let refreshToken = this.oauthService.getRefreshToken();\n if (refreshToken) {\n return this.oauthService\n .refreshToken()\n .then((_) => true)\n .catch((_) => false);\n }\n return false;\n }\n\n loadUserInfo() {\n this.store$.dispatch(new LoadProfile());\n this.store$.dispatch(new LoadSubscriptions());\n this.store$.dispatch(new DecodeJWTForUserInfo());\n this.store$.dispatch(new LoadSystemMaintenanceInfo());\n }\n\n private saveCurrentNonLoginUrl() {\n const currentUrl = this.ngLocation.path();\n const urlEndingsToNotSave = hideLoadingOnPages.map((u) => `/${u}`);\n let urlToSave = currentUrl;\n\n if (!!urlEndingsToNotSave.find((u) => currentUrl.includes(u))) {\n urlToSave = this.getActiveApplication();\n }\n this.browserStorage.setItem(BrowserStorageKey.urlBeforeLogin, urlToSave);\n }\n}\n","/**\n * @license Angular v17.2.2\n * (c) 2010-2022 Google LLC. https://angular.io/\n * License: MIT\n */\n\nimport * as i0 from '@angular/core';\nimport { Directive, InjectionToken, forwardRef, Optional, Inject, ɵisPromise, ɵisSubscribable, ɵRuntimeError, Self, EventEmitter, Input, Host, SkipSelf, booleanAttribute, ChangeDetectorRef, Output, Injectable, inject, NgModule, Version } from '@angular/core';\nimport { ɵgetDOM } from '@angular/common';\nimport { from, forkJoin } from 'rxjs';\nimport { map } from 'rxjs/operators';\n\n/**\n * Base class for all ControlValueAccessor classes defined in Forms package.\n * Contains common logic and utility functions.\n *\n * Note: this is an *internal-only* class and should not be extended or used directly in\n * applications code.\n */\nclass BaseControlValueAccessor {\n constructor(_renderer, _elementRef) {\n this._renderer = _renderer;\n this._elementRef = _elementRef;\n /**\n * The registered callback function called when a change or input event occurs on the input\n * element.\n * @nodoc\n */\n this.onChange = _ => {};\n /**\n * The registered callback function called when a blur event occurs on the input element.\n * @nodoc\n */\n this.onTouched = () => {};\n }\n /**\n * Helper method that sets a property on a target element using the current Renderer\n * implementation.\n * @nodoc\n */\n setProperty(key, value) {\n this._renderer.setProperty(this._elementRef.nativeElement, key, value);\n }\n /**\n * Registers a function called when the control is touched.\n * @nodoc\n */\n registerOnTouched(fn) {\n this.onTouched = fn;\n }\n /**\n * Registers a function called when the control value changes.\n * @nodoc\n */\n registerOnChange(fn) {\n this.onChange = fn;\n }\n /**\n * Sets the \"disabled\" property on the range input element.\n * @nodoc\n */\n setDisabledState(isDisabled) {\n this.setProperty('disabled', isDisabled);\n }\n static {\n this.ɵfac = function BaseControlValueAccessor_Factory(t) {\n return new (t || BaseControlValueAccessor)(i0.ɵɵdirectiveInject(i0.Renderer2), i0.ɵɵdirectiveInject(i0.ElementRef));\n };\n }\n static {\n this.ɵdir = /* @__PURE__ */i0.ɵɵdefineDirective({\n type: BaseControlValueAccessor\n });\n }\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(BaseControlValueAccessor, [{\n type: Directive\n }], () => [{\n type: i0.Renderer2\n }, {\n type: i0.ElementRef\n }], null);\n})();\n/**\n * Base class for all built-in ControlValueAccessor classes (except DefaultValueAccessor, which is\n * used in case no other CVAs can be found). We use this class to distinguish between default CVA,\n * built-in CVAs and custom CVAs, so that Forms logic can recognize built-in CVAs and treat custom\n * ones with higher priority (when both built-in and custom CVAs are present).\n *\n * Note: this is an *internal-only* class and should not be extended or used directly in\n * applications code.\n */\nclass BuiltInControlValueAccessor extends BaseControlValueAccessor {\n static {\n this.ɵfac = /* @__PURE__ */(() => {\n let ɵBuiltInControlValueAccessor_BaseFactory;\n return function BuiltInControlValueAccessor_Factory(t) {\n return (ɵBuiltInControlValueAccessor_BaseFactory || (ɵBuiltInControlValueAccessor_BaseFactory = i0.ɵɵgetInheritedFactory(BuiltInControlValueAccessor)))(t || BuiltInControlValueAccessor);\n };\n })();\n }\n static {\n this.ɵdir = /* @__PURE__ */i0.ɵɵdefineDirective({\n type: BuiltInControlValueAccessor,\n features: [i0.ɵɵInheritDefinitionFeature]\n });\n }\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(BuiltInControlValueAccessor, [{\n type: Directive\n }], null, null);\n})();\n/**\n * Used to provide a `ControlValueAccessor` for form controls.\n *\n * See `DefaultValueAccessor` for how to implement one.\n *\n * @publicApi\n */\nconst NG_VALUE_ACCESSOR = new InjectionToken(ngDevMode ? 'NgValueAccessor' : '');\nconst CHECKBOX_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => CheckboxControlValueAccessor),\n multi: true\n};\n/**\n * @description\n * A `ControlValueAccessor` for writing a value and listening to changes on a checkbox input\n * element.\n *\n * @usageNotes\n *\n * ### Using a checkbox with a reactive form.\n *\n * The following example shows how to use a checkbox with a reactive form.\n *\n * ```ts\n * const rememberLoginControl = new FormControl();\n * ```\n *\n * ```\n * \n * ```\n *\n * @ngModule ReactiveFormsModule\n * @ngModule FormsModule\n * @publicApi\n */\nclass CheckboxControlValueAccessor extends BuiltInControlValueAccessor {\n /**\n * Sets the \"checked\" property on the input element.\n * @nodoc\n */\n writeValue(value) {\n this.setProperty('checked', value);\n }\n static {\n this.ɵfac = /* @__PURE__ */(() => {\n let ɵCheckboxControlValueAccessor_BaseFactory;\n return function CheckboxControlValueAccessor_Factory(t) {\n return (ɵCheckboxControlValueAccessor_BaseFactory || (ɵCheckboxControlValueAccessor_BaseFactory = i0.ɵɵgetInheritedFactory(CheckboxControlValueAccessor)))(t || CheckboxControlValueAccessor);\n };\n })();\n }\n static {\n this.ɵdir = /* @__PURE__ */i0.ɵɵdefineDirective({\n type: CheckboxControlValueAccessor,\n selectors: [[\"input\", \"type\", \"checkbox\", \"formControlName\", \"\"], [\"input\", \"type\", \"checkbox\", \"formControl\", \"\"], [\"input\", \"type\", \"checkbox\", \"ngModel\", \"\"]],\n hostBindings: function CheckboxControlValueAccessor_HostBindings(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵlistener(\"change\", function CheckboxControlValueAccessor_change_HostBindingHandler($event) {\n return ctx.onChange($event.target.checked);\n })(\"blur\", function CheckboxControlValueAccessor_blur_HostBindingHandler() {\n return ctx.onTouched();\n });\n }\n },\n features: [i0.ɵɵProvidersFeature([CHECKBOX_VALUE_ACCESSOR]), i0.ɵɵInheritDefinitionFeature]\n });\n }\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(CheckboxControlValueAccessor, [{\n type: Directive,\n args: [{\n selector: 'input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]',\n host: {\n '(change)': 'onChange($event.target.checked)',\n '(blur)': 'onTouched()'\n },\n providers: [CHECKBOX_VALUE_ACCESSOR]\n }]\n }], null, null);\n})();\nconst DEFAULT_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => DefaultValueAccessor),\n multi: true\n};\n/**\n * We must check whether the agent is Android because composition events\n * behave differently between iOS and Android.\n */\nfunction _isAndroid() {\n const userAgent = ɵgetDOM() ? ɵgetDOM().getUserAgent() : '';\n return /android (\\d+)/.test(userAgent.toLowerCase());\n}\n/**\n * @description\n * Provide this token to control if form directives buffer IME input until\n * the \"compositionend\" event occurs.\n * @publicApi\n */\nconst COMPOSITION_BUFFER_MODE = new InjectionToken(ngDevMode ? 'CompositionEventMode' : '');\n/**\n * The default `ControlValueAccessor` for writing a value and listening to changes on input\n * elements. The accessor is used by the `FormControlDirective`, `FormControlName`, and\n * `NgModel` directives.\n *\n * {@searchKeywords ngDefaultControl}\n *\n * @usageNotes\n *\n * ### Using the default value accessor\n *\n * The following example shows how to use an input element that activates the default value accessor\n * (in this case, a text field).\n *\n * ```ts\n * const firstNameControl = new FormControl();\n * ```\n *\n * ```\n * \n * ```\n *\n * This value accessor is used by default for `` and `\n \n \n {{ 'forms.systemBanner.description.en.hint.text' | translate }}\n \n \n \n \n\n","import { Component, Input } from '@angular/core';\n\n@Component({\n selector: 'app-rating',\n standalone: true,\n templateUrl: './rating.component.html',\n})\nexport class RatingComponent {\n @Input() rating: number = 0;\n @Input() numberOfRatings: number = 0;\n\n readonly stars = [0, 1, 2, 3, 4];\n}\n","\n","/**\n * Copyright (c) 2020-2023 by Bosch.IO GmbH\n *\n * http://www.bosch.io\n * All rights reserved,\n * also regarding any disposal, exploitation, reproduction,\n * editing, distribution, as well as in the event of\n * applications for industrial property rights.\n *\n * This software is the confidential and proprietary information\n * of Bosch.IO GmbH. You shall not disclose\n * such Confidential Information and shall use it only in\n * accordance with the terms of the license agreement you\n * entered into with Bosch.IO.\n */\nimport { CommonModule } from '@angular/common';\nimport { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';\nimport { FormControl, ReactiveFormsModule } from '@angular/forms';\nimport { TranslateModule } from '@ngx-translate/core';\nimport { debounceTime, distinctUntilChanged, map } from 'rxjs';\n\n@Component({\n selector: 'app-search-box',\n standalone: true,\n imports: [CommonModule, ReactiveFormsModule, TranslateModule],\n templateUrl: './search-box.component.html',\n styleUrls: ['./search-box.component.scss'],\n})\nexport class SearchBoxComponent implements OnInit {\n @Input() minCharacters = 0;\n @Output() inputChange = new EventEmitter();\n\n searchInput: FormControl = new FormControl('');\n\n ngOnInit(): void {\n this.searchInput.valueChanges\n .pipe(\n debounceTime(300),\n map((str) => {\n const trimmed = str.trim();\n return trimmed.length >= this.minCharacters ? trimmed : '';\n }),\n distinctUntilChanged()\n )\n .subscribe((value) => this.inputChange.emit(value));\n }\n}\n","
\n \n
\n","import { CommonModule } from '@angular/common';\nimport {\n Component,\n EventEmitter,\n Input,\n OnChanges,\n Output,\n SimpleChanges,\n} from '@angular/core';\nimport { TranslateModule } from '@ngx-translate/core';\nimport { isValueChanged } from '../../shared/util/simple-changes.util';\nimport { SortDirection } from './sort-config.model';\n\n@Component({\n selector: 'app-sort-config',\n standalone: true,\n imports: [CommonModule, TranslateModule],\n templateUrl: './sort-config.component.html',\n styleUrls: ['./sort-config.component.scss'],\n})\nexport class SortConfigComponent implements OnChanges {\n @Input() sortDirection: SortDirection = SortDirection.NONE;\n @Output() sortChange = new EventEmitter();\n\n iconTitlePropKey = 'interface.sorting.none';\n iconClass = 'up-down';\n _sortDirection: SortDirection | undefined;\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes['sortDirection'] && isValueChanged(changes['sortDirection'])) {\n this.setupProperties(changes['sortDirection'].currentValue);\n }\n }\n updateSortDirection() {\n let direction = SortDirection.NONE;\n if (this._sortDirection === SortDirection.NONE) {\n direction = SortDirection.ASC;\n } else if (this._sortDirection === SortDirection.ASC) {\n direction = SortDirection.DESC;\n }\n\n this.setupProperties(direction);\n this.sortChange.emit(direction);\n }\n\n setupProperties(direction: SortDirection) {\n this._sortDirection = direction;\n if (this._sortDirection === SortDirection.ASC) {\n this.iconTitlePropKey = 'interface.sorting.descending';\n this.iconClass = 'down';\n } else if (this._sortDirection === SortDirection.DESC) {\n this.iconTitlePropKey = 'interface.sorting.none';\n this.iconClass = 'up';\n } else {\n this.iconTitlePropKey = 'interface.sorting.ascending';\n this.iconClass = 'up-down';\n }\n }\n}\n","\n \n \n \n \n \n \n\n","/**\n * Copyright (c) 2020-2023 by Bosch.IO GmbH\n *\n * http://www.bosch.io\n * All rights reserved,\n * also regarding any disposal, exploitation, reproduction,\n * editing, distribution, as well as in the event of\n * applications for industrial property rights.\n *\n * This software is the confidential and proprietary information\n * of Bosch.IO GmbH. You shall not disclose\n * such Confidential Information and shall use it only in\n * accordance with the terms of the license agreement you\n * entered into with Bosch.IO.\n */\nimport { AsyncPipe, NgClass, NgIf } from '@angular/common';\nimport { Component, EventEmitter, Output } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { Store } from '@ngrx/store';\nimport { TranslateModule } from '@ngx-translate/core';\nimport { Observable } from 'rxjs';\nimport { ContainerDialogComponent } from '../../../components';\nimport { AppState } from '../../data/state/app.state.model';\nimport { PublicAppConfig } from '../../models/public-app-config.model';\nimport { Invitation, User } from '../../models/user.model';\nimport { UserService } from '../../services/user.service';\n\n@Component({\n standalone: true,\n selector: 'app-redeem-code',\n templateUrl: './redeem-code.component.html',\n styleUrls: ['./redeem-code.component.scss'],\n imports: [\n TranslateModule,\n NgClass,\n AsyncPipe,\n NgIf,\n FormsModule,\n ContainerDialogComponent,\n ],\n})\nexport class RedeemInvitationCodeComponent {\n @Output() close = new EventEmitter();\n errorMessage!: string;\n code!: string;\n invitedUsers!: Invitation[];\n\n selectedLanguage$: Observable = this.store$.select(\n (state) => state.interface.language\n );\n\n isAccepted: boolean = false;\n\n profile$: Observable = this.store$.select(\n (state) => state.user.profile\n );\n\n content$: Observable = this.store$.select(\n (state) => state.context.publicAppConfig\n );\n\n usersInvites$: Observable = this.store$.select(\n (state) => state.user.allInvitations\n );\n\n constructor(\n private store$: Store,\n private userService: UserService\n ) {}\n\n redeem() {\n this.userService.redeemCode(this.code).subscribe({\n next: (_) => {\n window.location.reload();\n },\n error: (_) => {\n this.code = '';\n this.close.emit();\n },\n });\n }\n}\n","\n \n

\n {{ 'redeem.input' | translate }}\n

\n \n \n {{ 'redeem.code' | translate }}*\n \n \n \n \n\n","/**\n * Copyright (c) 2020-2023 by Bosch.IO GmbH\n *\n * http://www.bosch.io\n * All rights reserved,\n * also regarding any disposal, exploitation, reproduction,\n * editing, distribution, as well as in the event of\n * applications for industrial property rights.\n *\n * This software is the confidential and proprietary information\n * of Bosch.IO GmbH. You shall not disclose\n * such Confidential Information and shall use it only in\n * accordance with the terms of the license agreement you\n * entered into with Bosch.IO.\n */\nimport { Injectable } from '@angular/core';\nimport { BehaviorSubject } from 'rxjs';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class MenuService {\n sideMenuExpanded$ = new BehaviorSubject(false);\n}\n","import { Overlay, PositionStrategy } from '@angular/cdk/overlay';\nimport {\n ComponentPortal,\n ComponentType,\n TemplatePortal,\n} from '@angular/cdk/portal';\nimport { Injectable, TemplateRef, ViewContainerRef } from '@angular/core';\nimport { Subject } from 'rxjs';\n\nexport interface OverlayOpenRef {\n dismissOverlay: (data?: any) => void;\n overlayDismissed: Subject;\n}\n@Injectable({\n providedIn: 'root',\n})\nexport class OverlayService {\n constructor(private overlay: Overlay) {}\n\n openOverlay({\n component,\n templateRef,\n positionStrategy,\n viewContainerRef,\n }: {\n component?: ComponentType;\n templateRef?: TemplateRef;\n positionStrategy: PositionStrategy;\n viewContainerRef?: ViewContainerRef;\n }): OverlayOpenRef {\n const overlayRef = this.overlay.create({\n hasBackdrop: true,\n positionStrategy,\n disposeOnNavigation: true,\n backdropClass: '',\n });\n\n let portal: ComponentPortal | TemplatePortal;\n if (component) {\n portal = new ComponentPortal(component);\n } else {\n portal = new TemplatePortal(templateRef!, viewContainerRef!);\n }\n\n const overlayDismissed = new Subject();\n const dismissOverlay = (data: any) => {\n overlayRef?.dispose();\n overlayDismissed.next(data);\n };\n\n overlayRef.backdropClick().subscribe((data: any) => {\n dismissOverlay(data);\n });\n\n const attachedOverlayRef = overlayRef.attach(portal);\n if (component) {\n attachedOverlayRef.instance?.dismissOverlay.subscribe((data: any) =>\n dismissOverlay(data)\n );\n }\n\n return {\n dismissOverlay,\n overlayDismissed,\n };\n }\n}\n","/**\n * Copyright (c) 2020-2023 by Bosch.IO GmbH\n *\n * http://www.bosch.io\n * All rights reserved,\n * also regarding any disposal, exploitation, reproduction,\n * editing, distribution, as well as in the event of\n * applications for industrial property rights.\n *\n * This software is the confidential and proprietary information\n * of Bosch.IO GmbH. You shall not disclose\n * such Confidential Information and shall use it only in\n * accordance with the terms of the license agreement you\n * entered into with Bosch.IO.\n */\nimport { OverlayPositionBuilder } from '@angular/cdk/overlay';\nimport { CommonModule, I18nSelectPipe } from '@angular/common';\nimport {\n Component,\n ElementRef,\n OnInit,\n TemplateRef,\n ViewChild,\n ViewContainerRef,\n} from '@angular/core';\nimport {\n ActivatedRoute,\n Router,\n RouterLink,\n RouterLinkActive,\n} from '@angular/router';\nimport { Store } from '@ngrx/store';\nimport { TranslateModule, TranslateService } from '@ngx-translate/core';\nimport { Observable, firstValueFrom, map } from 'rxjs';\nimport { UpdateInterfaceTitle } from 'src/app/shared/data/actions/interface.actions';\nimport { AppState } from 'src/app/shared/data/state/app.state.model';\nimport { ActionTypes } from 'src/app/shared/models/enums/actions';\nimport { UserRole } from 'src/app/shared/models/enums/roles';\nimport { View, ViewMenuItem } from 'src/app/shared/models/view.model';\nimport { AuthService } from 'src/app/shared/services/auth.service';\nimport { shortUrls } from '../../../app-urls';\nimport { SetPage } from '../../../shared/data/actions/context.actions';\nimport { Language } from '../../../shared/data/state/interface.state.model';\nimport { MenuService } from '../../../shared/services/menu.service';\nimport {\n OverlayOpenRef,\n OverlayService,\n} from '../../../shared/services/overlay.service';\nimport { UserSubscriptionService } from '../../../shared/services/user-subscriptions.service';\nimport { MenuItem } from './menu-item.model';\n\n@Component({\n standalone: true,\n selector: 'app-sidebar',\n templateUrl: './sidebar.component.html',\n styleUrls: ['./sidebar.component.scss'],\n imports: [\n CommonModule,\n RouterLink,\n RouterLinkActive,\n TranslateModule,\n I18nSelectPipe,\n ],\n})\nexport class SidebarComponent implements OnInit {\n @ViewChild('sideMenuExpandedContainerRef') sideMenuExpandedContainerRef:\n | ElementRef\n | undefined;\n @ViewChild('sideMenuNavigationRef', { static: false }) sideMenuNavigationRef:\n | TemplateRef\n | undefined;\n subscriptionHomeUrl = `${shortUrls.defaultView}/${shortUrls.home}`;\n selectedLanguage$: Observable = this.store$.select(\n (state) => state.interface.language\n );\n\n views$: Observable = this.store$.select(\n (state) => state.subscription.views\n );\n\n viewsLoaded$: Observable = this.store$.select(\n (state) => state.subscription.viewsLoaded\n );\n\n roles$: Observable = this.store$.select(\n (state) => state.user.roles\n );\n\n mappedMenuItems$ = this.userSubscriptionService.userSpecifiedMenuItems$.pipe(\n map((menuItems) => {\n return menuItems.map((menu) => ({\n ...menu,\n show: this.authService.doesUserHaveMatchingRole(menu.roles),\n }));\n })\n );\n\n adminMenu: MenuItem[] = [];\n ownerMenu: MenuItem[] = [];\n systemAdminMenu: MenuItem[] = [];\n location = window.location;\n sideMenuExpandedOverlayRef: OverlayOpenRef | undefined;\n constructor(\n private router: Router,\n public activatedRoute: ActivatedRoute,\n private store$: Store,\n public authService: AuthService,\n public userSubscriptionService: UserSubscriptionService,\n private translateService: TranslateService,\n public menuService: MenuService,\n private overlayService: OverlayService,\n private positionBuilder: OverlayPositionBuilder,\n private viewContainerRef: ViewContainerRef\n ) {}\n\n ngOnInit() {\n this.userSubscriptionService.systemSpecifiedMenuItems$.subscribe(() =>\n this.setupSidebarMenu()\n );\n this.translateService.onLangChange.subscribe((_) => {\n this.setupSidebarMenu();\n });\n }\n\n async setupSidebarMenu() {\n const systemSpecifiedMenuItems = await firstValueFrom(\n this.userSubscriptionService.systemSpecifiedMenuItems$\n );\n\n const { sysAdminItems, adminItems, ownerItems } =\n await this.getSystemMenuItemsBasedOnRoles(systemSpecifiedMenuItems);\n\n this.adminMenu = [\n ...adminItems,\n {\n route: `${shortUrls.admin}/${shortUrls.users}`,\n icon: 'boschicon-bosch-ic-user',\n label: this.translateService.instant('menu.users'),\n },\n {\n route: `${shortUrls.admin}/${shortUrls.credentials}`,\n icon: 'boschicon-bosch-ic-keys',\n label: this.translateService.instant('menu.credentials'),\n },\n ];\n\n this.ownerMenu = [\n ...ownerItems,\n {\n route: `${shortUrls.admin}/${shortUrls.maintenance}`,\n icon: 'boschicon-bosch-ic-configuration',\n label: this.translateService.instant('menu.maintenance'),\n },\n {\n route: `${shortUrls.admin}/${shortUrls.views}`,\n icon: 'boschicon-bosch-ic-watch-on',\n label: this.translateService.instant('menu.views'),\n },\n ];\n\n this.systemAdminMenu = [\n ...sysAdminItems,\n {\n route: `${shortUrls.admin}/${shortUrls.systemMaintenance}`,\n icon: 'boschicon-bosch-ic-hammer',\n label: this.translateService.instant('menu.sysMaintenance'),\n },\n ];\n }\n\n async customNavigate(item: ViewMenuItem) {\n this.collapseSideMenu();\n if (item.action.type === ActionTypes.ExternalLink) {\n window.open(item.action.url, '_blank');\n } else {\n this.store$.dispatch(new UpdateInterfaceTitle(item.label));\n // We are at subscription level\n\n this.router.navigate([await this.getUrlWithActiveView(item.id)], {\n relativeTo: this.activatedRoute,\n });\n }\n }\n\n async getUrlWithActiveView(pageId: string) {\n const activeView = await firstValueFrom(\n this.userSubscriptionService.activeView$\n );\n\n return `${activeView.id}/${pageId}`;\n }\n\n homeIconClicked() {\n this.collapseSideMenu();\n this.store$.dispatch(new SetPage(null));\n }\n\n expandSideMenu() {\n this.menuService.sideMenuExpanded$.next(true);\n const positionStrategy = this.positionBuilder\n .flexibleConnectedTo(this.sideMenuExpandedContainerRef?.nativeElement)\n .withPositions([\n {\n originX: 'start',\n originY: 'top',\n overlayX: 'start',\n overlayY: 'top',\n },\n ]);\n this.sideMenuExpandedOverlayRef = this.overlayService.openOverlay({\n templateRef: this.sideMenuNavigationRef,\n positionStrategy,\n viewContainerRef: this.viewContainerRef,\n });\n this.sideMenuExpandedOverlayRef.overlayDismissed.subscribe(() =>\n this.menuService.sideMenuExpanded$.next(false)\n );\n }\n\n collapseSideMenu() {\n this.menuService.sideMenuExpanded$.next(false);\n this.sideMenuExpandedOverlayRef?.dismissOverlay();\n }\n\n async getSystemMenuItemsBasedOnRoles(list: ViewMenuItem[]) {\n const partitionArrayByRole = async (\n items: ViewMenuItem[],\n role: UserRole\n ) => {\n const filteredItems = items.filter((item) => item.roles.includes(role));\n\n const matchingRoleItems = await Promise.all(\n filteredItems.filter(\n async (item) =>\n await firstValueFrom(\n this.authService.doesUserHaveMatchingRole(item.roles)\n )\n )\n );\n\n const filteredMappedItems = await Promise.all(\n matchingRoleItems.map(async (item) => ({\n route: await this.getUrlWithActiveView(item.id),\n icon: item.icon,\n label: item.label[this.translateService.currentLang as Language],\n }))\n );\n\n return filteredMappedItems;\n };\n\n const systemAdminItems = await partitionArrayByRole(\n list,\n UserRole.SystemAdmin\n );\n const ownerItems = await partitionArrayByRole(list, UserRole.Owner);\n const adminItems = await partitionArrayByRole(list, UserRole.Admin);\n\n return {\n sysAdminItems: systemAdminItems,\n ownerItems: ownerItems,\n adminItems: adminItems,\n };\n }\n}\n","
\n\n \n\n\n\n \n \n \n Navigation\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {{ 'menu.home' | translate }}\n \n \n \n \n \n \n {{ selectedLanguage$ | async | i18nSelect: item.label }}\n \n \n \n \n \n \n \n \n \n \n \n \n {{ 'menu.adminstration' | translate }}\n \n \n \n \n \n \n \n {{ item.label }}\n \n \n \n \n \n \n \n {{ item.label }}\n \n \n \n \n \n \n \n {{ item.label }}\n \n \n \n \n \n \n \n\n","/**\n * Copyright (c) 2020-2023 by Bosch.IO GmbH\n *\n * http://www.bosch.io\n * All rights reserved,\n * also regarding any disposal, exploitation, reproduction,\n * editing, distribution, as well as in the event of\n * applications for industrial property rights.\n *\n * This software is the confidential and proprietary information\n * of Bosch.IO GmbH. You shall not disclose\n * such Confidential Information and shall use it only in\n * accordance with the terms of the license agreement you\n * entered into with Bosch.IO.\n */\nimport { Injectable } from '@angular/core';\nimport { TranslateService } from '@ngx-translate/core';\nimport { marked } from 'marked';\nimport { firstValueFrom } from 'rxjs';\nimport { PRICE_PLAN_PAGE } from '../../app.const';\nimport { ToastType } from '../../components/toast/toast-message.model';\nimport { ToastMessageService } from '../../components/toast/toast-message.service';\nimport { QuotaError } from '../models';\n@Injectable({\n providedIn: 'root',\n})\nexport class QuotaNotifierService {\n constructor(\n private translateService: TranslateService,\n private toastMessageService: ToastMessageService\n ) {}\n async notify(quotaInfo: QuotaError) {\n const { currentPricePlan, quota, type } = quotaInfo;\n\n const messageToShow = await firstValueFrom(\n this.translateService.get('quota', {\n type: type.toLowerCase(),\n plan: currentPricePlan.toLowerCase(),\n quota,\n pricePlanPage: PRICE_PLAN_PAGE,\n })\n );\n\n const html = await marked(messageToShow, { async: true });\n this.toastMessageService.showNotification({\n messageInfo: {\n message: html,\n type: ToastType.Warning,\n messageIsHTML: true,\n },\n customDismissTime: 15000,\n });\n }\n}\n","/**\n * Copyright (c) 2020-2023 by Bosch.IO GmbH\n *\n * http://www.bosch.io\n * All rights reserved,\n * also regarding any disposal, exploitation, reproduction,\n * editing, distribution, as well as in the event of\n * applications for industrial property rights.\n *\n * This software is the confidential and proprietary information\n * of Bosch.IO GmbH. You shall not disclose\n * such Confidential Information and shall use it only in\n * accordance with the terms of the license agreement you\n * entered into with Bosch.IO.\n */\nimport { HttpClient } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport { TranslateService } from '@ngx-translate/core';\nimport { firstValueFrom } from 'rxjs';\nimport { env } from '../../../environments/environment';\nimport { LoadingIndicatorService } from '../../components';\nimport { AppSubscription } from '../../shared/models';\nimport { LoggerService } from '../../shared/services/logger.service';\nimport { QuotaNotifierService } from '../../shared/services/quota-notifier.service';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class JoinDemoService {\n constructor(\n private httpClient: HttpClient,\n private logger: LoggerService,\n private loadingIndicatorService: LoadingIndicatorService,\n private translateService: TranslateService,\n private quotaNotifierService: QuotaNotifierService\n ) {}\n\n async createEvaluationSubscription() {\n const loadingMessage = await firstValueFrom(\n this.translateService.get('loading.subscriptionCreationInProgress')\n );\n this.loadingIndicatorService.changeConfig({\n show: true,\n message: loadingMessage,\n });\n this.httpClient\n .post(\n `${env.API_URL}/subscriptions/${env.DEFAULT_APPLICATION}/join`,\n {},\n { observe: 'body' }\n )\n .subscribe({\n next: (subscriptionInfo) => {\n this.loadingIndicatorService.changeConfig({\n show: false,\n });\n location.href = `/${subscriptionInfo.appConfiguration.id}/${subscriptionInfo.id}`;\n },\n error: (er) => {\n this.loadingIndicatorService.changeConfig({\n show: false,\n });\n if (er.status === 400) {\n this.quotaNotifierService.notify(er.error);\n }\n this.logger.log(er);\n },\n });\n }\n}\n","/**\n * Copyright (c) 2020-2023 by Bosch.IO GmbH\n *\n * http://www.bosch.io\n * All rights reserved,\n * also regarding any disposal, exploitation, reproduction,\n * editing, distribution, as well as in the event of\n * applications for industrial property rights.\n *\n * This software is the confidential and proprietary information\n * of Bosch.IO GmbH. You shall not disclose\n * such Confidential Information and shall use it only in\n * accordance with the terms of the license agreement you\n * entered into with Bosch.IO.\n */\nimport { OverlayModule } from '@angular/cdk/overlay';\nimport { CommonModule } from '@angular/common';\nimport { Component, EventEmitter, OnInit, Output } from '@angular/core';\nimport { Router, RouterModule } from '@angular/router';\nimport { Store } from '@ngrx/store';\nimport { TranslateModule } from '@ngx-translate/core';\nimport { Observable, firstValueFrom, map, withLatestFrom } from 'rxjs';\nimport { AppState } from 'src/app/shared/data/state/app.state.model';\nimport { AuthService } from 'src/app/shared/services/auth.service';\nimport { env } from 'src/environments/environment';\nimport { JoinDemoService } from '../../../../pages/join-demo/join-demo.service';\nimport { RedeemInvitationCodeComponent } from '../../../../shared/misc/redeem-code/redeem-code.component';\nimport { AppSubscription, LoginType } from '../../../../shared/models';\nimport { UserSubscriptionService } from '../../../../shared/services/user-subscriptions.service';\nimport { shortUrls } from '../../../../app-urls';\nimport { getValidStartPage } from '../../../../shared/util';\nimport { SetSubscriptionId } from '../../../../shared/data/actions/context.actions';\nimport {\n LoadSubscription,\n LoadViews,\n} from '../../../../shared/data/actions/subscription.actions';\nimport { DecodeJWTForUserInfo } from '../../../../shared/data/actions/user.actions';\nimport { ViewService } from '../../../../shared/services/view.service';\n\n@Component({\n standalone: true,\n selector: 'app-user-menu',\n templateUrl: './user-menu.component.html',\n styleUrls: ['./user-menu.component.scss'],\n imports: [\n CommonModule,\n RouterModule,\n TranslateModule,\n RedeemInvitationCodeComponent,\n OverlayModule,\n ],\n})\nexport class UserMenuComponent implements OnInit {\n @Output() dismissOverlay = new EventEmitter();\n LoginType = LoginType;\n\n displayName$: Observable = this.store$.select(\n (state) => state.user.profile.displayname\n );\n\n currentLoginType!: LoginType;\n\n // user can create evaluation subscription when they don't already one and when the login type is not SingleKeyId\n allowCreateEvaluationSandboxSubscription$ =\n this.userSubscriptionService.userSubscriptions$.pipe(\n withLatestFrom(this.authService.currentUserInfo$),\n map(\n ([subscriptions, currentUser]) =>\n currentUser.profile.identityProvider.toLowerCase() !==\n LoginType.SingleKeyId.toLowerCase() &&\n !subscriptions.find((sub) =>\n sub.name.toLowerCase().includes('sandbox-')\n )\n )\n );\n\n constructor(\n private store$: Store,\n public authService: AuthService,\n public userSubscriptionService: UserSubscriptionService,\n private joinDemoService: JoinDemoService\n ) {}\n\n ngOnInit(): void {\n this.currentLoginType = this.authService.getCurrentLoginType();\n }\n\n hideMenu() {\n this.dismissOverlay.emit(true);\n }\n\n async changeMenu(subscription: AppSubscription) {\n this.hideMenu();\n const {\n id: subscriptionId,\n appConfiguration: { id: applicationId },\n } = subscription;\n\n window.location.href = `${applicationId}/${subscriptionId}`;\n }\n\n open() {\n window.open(env.SINGLE_KEY_ID_MY_PROFILE);\n }\n\n createEvaluationSubscription() {\n this.joinDemoService.createEvaluationSubscription();\n }\n\n showRedeemDialog() {\n this.dismissOverlay.emit({ redeemInvitationCodeClicked: true });\n }\n}\n","\n \n \n \n \n \n Logged in with\n \n \n \n \n \n \n {{ 'interface.subscriptions' | translate }}\n \n \n \n \n \n {{ item.name }}\n \n {{ 'interface.current' | translate }}\n \n \n \n\n \n \n \n \n {{ 'redeem.title' | translate }}\n \n \n \n \n \n {{ 'interface.createEvaluationSubscription' | translate }}\n \n \n \n \n \n \n \n \n \n {{ 'interface.logout' | translate }}\n \n \n \n \n \n \n\n","/**\n * Copyright (c) 2020-2023 by Bosch.IO GmbH\n *\n * http://www.bosch.io\n * All rights reserved,\n * also regarding any disposal, exploitation, reproduction,\n * editing, distribution, as well as in the event of\n * applications for industrial property rights.\n *\n * This software is the confidential and proprietary information\n * of Bosch.IO GmbH. You shall not disclose\n * such Confidential Information and shall use it only in\n * accordance with the terms of the license agreement you\n * entered into with Bosch.IO.\n */\nimport { OverlayPositionBuilder } from '@angular/cdk/overlay';\nimport { AsyncPipe, NgIf, NgStyle } from '@angular/common';\nimport { Component, ElementRef, Input, OnInit, ViewChild } from '@angular/core';\nimport {\n FormBuilder,\n FormGroup,\n ReactiveFormsModule,\n Validators,\n} from '@angular/forms';\nimport { Store } from '@ngrx/store';\nimport { TranslateModule } from '@ngx-translate/core';\nimport { BehaviorSubject, Observable, tap } from 'rxjs';\nimport { UpdateLanguage } from 'src/app/shared/data/actions/interface.actions';\nimport { AppState } from 'src/app/shared/data/state/app.state.model';\nimport { RedeemInvitationCodeComponent } from '../../../shared/misc/redeem-code/redeem-code.component';\nimport { MenuService } from '../../../shared/services/menu.service';\nimport {\n OverlayOpenRef,\n OverlayService,\n} from '../../../shared/services/overlay.service';\nimport { SidebarComponent } from '../sidebar/sidebar.component';\nimport { UserMenuComponent } from './user-menu/user-menu.component';\n\n@Component({\n standalone: true,\n selector: 'app-header',\n templateUrl: './dashboard-header.component.html',\n styleUrls: ['./dashboard-header.component.scss'],\n imports: [\n AsyncPipe,\n ReactiveFormsModule,\n TranslateModule,\n UserMenuComponent,\n NgStyle,\n NgIf,\n SidebarComponent,\n RedeemInvitationCodeComponent,\n ],\n})\nexport class HeaderComponent implements OnInit {\n @Input() allowHeaderFunctions = true;\n @ViewChild('userMenuNavElementRef')\n userMenuNavElementRef!: ElementRef;\n userMenuOverlayRef!: OverlayOpenRef;\n readonly defaultTitle = 'Bosch Digital Service Dashboard';\n selectedLanguage$: Observable = this.store$.select(\n (state) => state.interface.language\n );\n\n title$ = this.store$.select((state) => state.interface.title);\n\n languageForm: FormGroup = this.builder.group({\n lang: ['', [Validators.required]],\n });\n\n showLanguagePicker$ = this.store$.select(\n (state) => state.context.publicAppConfig.multiLingual\n );\n\n userLoggedIn$ = this.store$.select((state) => state.user.profileLoaded);\n\n displayName$: Observable = this.store$.select(\n (state) => state.user.profile.displayname\n );\n showUserMenuOverlay: boolean = false;\n userMenuPosition = {} as { x: number; y: number };\n showReedemDialog$ = new BehaviorSubject(false);\n get lang() {\n return this.languageForm.get('lang');\n }\n\n constructor(\n private store$: Store,\n private builder: FormBuilder,\n private overlayService: OverlayService,\n private positionBuilder: OverlayPositionBuilder,\n public menuService: MenuService\n ) {}\n\n ngOnInit(): void {\n this.selectedLanguage$.pipe(tap((lang) => this.lang?.setValue(lang)));\n }\n\n changeLanguage(): void {\n this.store$.dispatch(new UpdateLanguage(this.lang?.value));\n }\n\n showUserMenu() {\n this.showUserMenuOverlay = true;\n this.openOverlay();\n }\n\n hideUserMenu() {\n this.showUserMenuOverlay = false;\n this.userMenuOverlayRef.dismissOverlay();\n }\n\n async openOverlay() {\n const positionStrategy = this.positionBuilder\n .flexibleConnectedTo(this.userMenuNavElementRef.nativeElement)\n .withPositions([\n {\n originX: 'start',\n originY: 'bottom',\n overlayX: 'center',\n overlayY: 'center',\n },\n ]);\n\n this.userMenuOverlayRef = this.overlayService.openOverlay({\n component: UserMenuComponent,\n positionStrategy,\n });\n\n this.userMenuOverlayRef.overlayDismissed.subscribe((data: any) => {\n this.showUserMenuOverlay = false;\n this.showReedemDialog$.next(data?.redeemInvitationCodeClicked === true);\n });\n }\n}\n","\n \n \n\n \n \n \n \n \n \n \n {{ (allowHeaderFunctions && (title$ | async)) || defaultTitle }}\n \n \n \n \n \n {{ 'interface.help' | translate }}\n \n \n \n \n \n {{ 'interface.contact' | translate }}\n \n \n \n \n \n \n \n DE\n \n \n EN\n \n \n \n \n \n \n \n \n {{ displayName$ | async }}\n \n \n \n