@dereekb/dbx-core 13.0.7 → 13.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"dereekb-dbx-core.mjs","sources":["../../../../packages/dbx-core/src/lib/rxjs/clean.ts","../../../../packages/dbx-core/src/lib/rxjs/subscription.ts","../../../../packages/dbx-core/src/lib/rxjs/lockset.ts","../../../../packages/dbx-core/src/lib/rxjs/loading.ts","../../../../packages/dbx-core/src/lib/rxjs/destroy.ts","../../../../packages/dbx-core/src/lib/action/action.store.source.ts","../../../../packages/dbx-core/src/lib/action/directive/auto/action.automodify.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/auto/action.autotrigger.directive.ts","../../../../packages/dbx-core/src/lib/action/action.handler.ts","../../../../packages/dbx-core/src/lib/action/action.ts","../../../../packages/dbx-core/src/lib/action/action.store.ts","../../../../packages/dbx-core/src/lib/action/action.holder.ts","../../../../packages/dbx-core/src/lib/action/action.machine.ts","../../../../packages/dbx-core/src/lib/action/action.store.source.provide.ts","../../../../packages/dbx-core/src/lib/action/directive/context/action.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/context/action.source.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/debug/action.logger.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/map/action.map.ts","../../../../packages/dbx-core/src/lib/action/directive/map/action.map.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/map/action.map.key.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/map/action.map.source.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/map/action.map.utility.ts","../../../../packages/dbx-core/src/lib/action/directive/map/action.map.working.disable.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.disabled.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.disableonsuccess.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.handler.instance.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.handler.directive.ts","../../../../packages/dbx-core/src/lib/view/if.directive.ts","../../../../packages/dbx-core/src/lib/util/input.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.idle.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.presuccess.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.success.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.success.handler.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.error.handler.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.value.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.working.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.enforce.modified.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.value.trigger.instance.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.value.trigger.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.value.stream.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.triggered.directive.ts","../../../../packages/dbx-core/src/lib/action/action.module.ts","../../../../packages/dbx-core/src/lib/action/action.reference.ts","../../../../packages/dbx-core/src/lib/router/segue.ts","../../../../packages/dbx-core/src/lib/auth/service/auth.service.ts","../../../../packages/dbx-core/src/lib/auth/router/provider/uirouter/hook.ts","../../../../packages/dbx-core/src/lib/auth/router/provider/uirouter/redirect.ts","../../../../packages/dbx-core/src/lib/auth/router/provider/uirouter/auth.hook.ts","../../../../packages/dbx-core/src/lib/auth/router/provider/uirouter/role.hook.ts","../../../../packages/dbx-core/src/lib/auth/router/provider/uirouter/state.hook.ts","../../../../packages/dbx-core/src/lib/context/context.ts","../../../../packages/dbx-core/src/lib/context/state/action/data.action.ts","../../../../packages/dbx-core/src/lib/context/state/reducer/data.reducer.ts","../../../../packages/dbx-core/src/lib/context/state/reducer/index.ts","../../../../packages/dbx-core/src/lib/context/state/effect/index.ts","../../../../packages/dbx-core/src/lib/auth/auth.user.ts","../../../../packages/dbx-core/src/lib/auth/state/action/auth.action.ts","../../../../packages/dbx-core/src/lib/auth/state/action/user.action.ts","../../../../packages/dbx-core/src/lib/auth/state/reducer/user.reducer.ts","../../../../packages/dbx-core/src/lib/auth/state/reducer/index.ts","../../../../packages/dbx-core/src/lib/router/router/service/router.go.ts","../../../../packages/dbx-core/src/lib/router/router/service/router.transition.service.ts","../../../../packages/dbx-core/src/lib/router/router/service/router.service.ts","../../../../packages/dbx-core/src/lib/auth/router/auth.router.ts","../../../../packages/dbx-core/src/lib/auth/router/auth.router.service.ts","../../../../packages/dbx-core/src/lib/auth/router/state/effect/auth.router.state.effect.ts","../../../../packages/dbx-core/src/lib/auth/router/state/auth.router.state.providers.ts","../../../../packages/dbx-core/src/lib/auth/router/auth.router.providers.ts","../../../../packages/dbx-core/src/lib/auth/service/auth.service.rxjs.ts","../../../../packages/dbx-core/src/lib/auth/state/effect/auth.effect.ts","../../../../packages/dbx-core/src/lib/auth/auth.state.providers.ts","../../../../packages/dbx-core/src/lib/auth/auth.providers.ts","../../../../packages/dbx-core/src/lib/auth/auth.role.any.directive.ts","../../../../packages/dbx-core/src/lib/auth/auth.role.has.directive.ts","../../../../packages/dbx-core/src/lib/auth/auth.role.not.directive.ts","../../../../packages/dbx-core/src/lib/auth/auth.state.service.ts","../../../../packages/dbx-core/src/lib/button/button.ts","../../../../packages/dbx-core/src/lib/button/action/action.button.trigger.directive.ts","../../../../packages/dbx-core/src/lib/button/action/action.button.directive.ts","../../../../packages/dbx-core/src/lib/button/router/button.segue.directive.ts","../../../../packages/dbx-core/src/lib/button/button.directive.ts","../../../../packages/dbx-core/src/lib/button/button.loading.directive.ts","../../../../packages/dbx-core/src/lib/button/button.module.ts","../../../../packages/dbx-core/src/lib/context/context.service.ts","../../../../packages/dbx-core/src/lib/context/context.directive.ts","../../../../packages/dbx-core/src/lib/context/context.providers.ts","../../../../packages/dbx-core/src/lib/environment/environment.ts","../../../../packages/dbx-core/src/lib/environment/environment.service.ts","../../../../packages/dbx-core/src/lib/environment/environment.providers.ts","../../../../packages/dbx-core/src/lib/router/anchor/anchor.ts","../../../../packages/dbx-core/src/lib/router/anchor/anchor.directive.ts","../../../../packages/dbx-core/src/lib/router/anchor/clickable.ts","../../../../packages/dbx-core/src/lib/router/auth/hook/id.hook.ts","../../../../packages/dbx-core/src/lib/router/auth/hook/uid.hook.ts","../../../../packages/dbx-core/src/lib/router/router/transition/transition.ts","../../../../packages/dbx-core/src/lib/router/router/provider/angular/angular.router.service.ts","../../../../packages/dbx-core/src/lib/router/router/provider/angular/angular.router.service.module.ts","../../../../packages/dbx-core/src/lib/router/router/provider/uirouter/uirouter.router.service.ts","../../../../packages/dbx-core/src/lib/router/router/provider/uirouter/uirouter.router.service.providers.ts","../../../../packages/dbx-core/src/lib/router/router/transition/transition.rxjs.ts","../../../../packages/dbx-core/src/lib/router/router/transition/transition.directive.ts","../../../../packages/dbx-core/src/lib/router/router/transition/transition.watcher.directive.ts","../../../../packages/dbx-core/src/lib/router/router/service/router.service.util.ts","../../../../packages/dbx-core/src/lib/router/router/service/router.service.rxjs.ts","../../../../packages/dbx-core/src/lib/router/router/util/route.reader.ts","../../../../packages/dbx-core/src/lib/router/router/util/route.default.ts","../../../../packages/dbx-core/src/lib/router/model/id.param.redirect.ts","../../../../packages/dbx-core/src/lib/router/model/model.router.ts","../../../../packages/dbx-core/src/lib/router/model/model.router.uid.directive.ts","../../../../packages/dbx-core/src/lib/router/model/model.router.id.directive.ts","../../../../packages/dbx-core/src/lib/router/model/model.router.key.directive.ts","../../../../packages/dbx-core/src/lib/pipe/async/asobservable.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/datedayrange.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/tojsdate.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/datedistance.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/dateformatdistance.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/dateformatfromto.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/datedaytimerange.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/datetimerange.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/daterangedistance.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/datetimerangeonly.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/targetdatetosystemdate.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/datetimerangeonlydistance.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/timezoneabbreviation.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/systemdatetotargetdate.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/minutesstring.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/timedistance.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/tominutes.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/misc/prettyjson.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/value/cuttext.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/value/getvalue.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/value/dollar.pipe.ts","../../../../packages/dbx-core/src/lib/filter/filter.abstract.connector.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.content.ts","../../../../packages/dbx-core/src/lib/filter/filter.abstract.source.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.connect.source.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.connector.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.map.instance.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.map.source.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.map.connector.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.map.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.preset.ts","../../../../packages/dbx-core/src/lib/filter/filter.source.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.module.ts","../../../../packages/dbx-core/src/lib/injection/injection.ts","../../../../packages/dbx-core/src/lib/injection/injection.util.ts","../../../../packages/dbx-core/src/lib/injection/injection.instance.ts","../../../../packages/dbx-core/src/lib/injection/injection.directive.ts","../../../../packages/dbx-core/src/lib/injection/injection.component.ts","../../../../packages/dbx-core/src/lib/injection/injection.array.component.ts","../../../../packages/dbx-core/src/lib/injection/injection.context.ts","../../../../packages/dbx-core/src/lib/injection/injection.context.directive.ts","../../../../packages/dbx-core/src/lib/injection/injection.context.forward.directive.ts","../../../../packages/dbx-core/src/lib/injection/injection.rxjs.ts","../../../../packages/dbx-core/src/lib/injection/injector.ts","../../../../packages/dbx-core/src/lib/ngrx/store.lockset.ts","../../../../packages/dbx-core/src/lib/storage/storage.accessor.simple.ts","../../../../packages/dbx-core/src/lib/storage/storage.accessor.string.ts","../../../../packages/dbx-core/src/lib/storage/storage.di.ts","../../../../packages/dbx-core/src/lib/storage/storage.accessor.simple.factory.ts","../../../../packages/dbx-core/src/lib/storage/storage.accessor.ts","../../../../packages/dbx-core/src/lib/storage/storage.object.localstorage.ts","../../../../packages/dbx-core/src/lib/storage/storage.object.memory.ts","../../../../packages/dbx-core/src/lib/storage/storage.providers.ts","../../../../packages/dbx-core/src/lib/util/view.ts","../../../../packages/dbx-core/src/dereekb-dbx-core.ts"],"sourcesContent":["import { DestroyRef, inject } from '@angular/core';\nimport { type Destroyable, type DestroyFunction } from '@dereekb/util';\nimport { type Subject } from 'rxjs';\n\n/**\n * Wraps a Destroyable in a function that registers the input Destroyable to be destroyed\n * when the DestroyRef is destroyed in the context.\n *\n * Must be run in an Angular injection context.\n *\n * @example\n * // Clean up a Destroyable object (e.g., SubscriptionObject, LockSet):\n * const sub = new SubscriptionObject(obs$.subscribe(handler));\n * clean(sub);\n *\n * @example\n * // Clean up a destroy function directly:\n * clean(() => resource.release());\n */\nexport function clean<T extends Destroyable | DestroyFunction>(input: T): T {\n const destroyRef = inject(DestroyRef);\n\n if ((input as Destroyable).destroy) {\n destroyRef.onDestroy(() => (input as Destroyable).destroy());\n } else {\n destroyRef.onDestroy(input as DestroyFunction);\n }\n\n return input;\n}\n\n/**\n * Wraps a Subject in a function that registers the input Subject to be completed\n * when the DestroyRef is destroyed in the context.\n *\n * Must be run in an Angular injection context.\n *\n * @example\n * // Complete a BehaviorSubject when the component is destroyed:\n * readonly value$ = completeOnDestroy(new BehaviorSubject<string>('initial'));\n *\n * @example\n * // Complete a ReplaySubject when the component is destroyed:\n * readonly events$ = completeOnDestroy(new ReplaySubject<Event>(1));\n */\nexport function completeOnDestroy<T extends Pick<Subject<any>, 'complete' | 'error'>>(input: T): T {\n clean(() => input.complete());\n return input;\n}\n","import { SubscriptionObject } from '@dereekb/rxjs';\nimport { type GetterOrValue, getValueFromGetter, type Maybe } from '@dereekb/util';\nimport { type Unsubscribable } from 'rxjs';\nimport { clean } from './clean';\n\n// MARK: cleanSubscription()\n/**\n * Creates a new SubscriptionObject that is automatically destroyed when the context is destroyed.\n *\n * Must be run within an Angular injection context.\n *\n * @example\n * // Pass a subscription directly - it will be cleaned up automatically:\n * cleanSubscription(obs$.subscribe(handler));\n *\n * // Or create first, then set the subscription later:\n * readonly _sub = cleanSubscription();\n * this._sub.subscription = obs$.subscribe(handler);\n */\nexport function cleanSubscription<T extends Unsubscribable = Unsubscribable>(sub?: Maybe<GetterOrValue<T>>): SubscriptionObject<T> {\n const subscription = getValueFromGetter(sub);\n const subscriptionObject = new SubscriptionObject<T>(subscription);\n clean(subscriptionObject);\n return subscriptionObject;\n}\n","import { DestroyRef, inject } from '@angular/core';\nimport { type DestroyOnNextUnlockConfig, LockSet, SubscriptionObject } from '@dereekb/rxjs';\nimport { type Configurable, type DestroyFunction, type GetterOrValue, getValueFromGetter, type Maybe } from '@dereekb/util';\nimport { cleanSubscription } from './subscription';\nimport { type Unsubscribable } from 'rxjs';\n\nexport interface CleanLockSetConfig {\n /**\n * Arbitrary onDestroy function to call when onDestroy is called by the internal DestroyRef.\n */\n readonly onDestroy?: Maybe<() => void>;\n /**\n * Called when the LockSet is finally destroyed.\n */\n readonly onLockSetDestroy?: Maybe<() => void>;\n /**\n * Configures when the lockset should be destroyed.\n */\n readonly destroyLocksetTiming?: Maybe<DestroyOnNextUnlockConfig>;\n}\n\nexport type CleanLockSet = LockSet & { readonly _cleanDestroy: () => void };\n\n/**\n * Creates a new LockSet that is automatically destroyed when the component is destroyed.\n *\n * Must be run within an Angular injection context.\n *\n * @param config Optional configuration for destruction behavior and callbacks.\n *\n * @example\n * // Create a simple lockset:\n * readonly lockSet = cleanLockSet();\n *\n * @example\n * // Create with a callback when the lockset is destroyed:\n * readonly lockSet = cleanLockSet({\n * onLockSetDestroy: () => console.log('lockset destroyed')\n * });\n */\nexport function cleanLockSet(config?: Maybe<CleanLockSetConfig>): CleanLockSet {\n const { onDestroy, onLockSetDestroy, destroyLocksetTiming } = config ?? {};\n\n const destroyRef = inject(DestroyRef);\n const lockSet = new LockSet() as unknown as CleanLockSet;\n\n function cleanDestroy() {\n onDestroy?.();\n lockSet.destroyOnNextUnlock(destroyLocksetTiming); // flag to be destroyed on the next complete unlock\n }\n\n destroyRef.onDestroy(() => cleanDestroy());\n\n if (onLockSetDestroy) {\n const _destroySub = cleanSubscription(\n lockSet.onDestroy$.subscribe(() => {\n onLockSetDestroy();\n _destroySub.destroy();\n })\n );\n }\n\n (lockSet as Configurable<CleanLockSet>)._cleanDestroy = cleanDestroy;\n return lockSet;\n}\n\n// MARK: cleanWithLockSet()\n/**\n * Runs the given onDestroy function when the context is destroyed, and the lock set's next unlock occurs.\n *\n * Must be run within an Angular injection context.\n *\n * @param lockSet The lockset to use.\n * @param onDestroy The function to run when the lockset is unlocked.\n *\n * @example\n * // Defer cleanup until the lockset unlocks after component destroy:\n * cleanWithLockSet(this.lockSet, () => resource.release());\n */\nexport function cleanWithLockSet(lockSet: LockSet, onDestroy: DestroyFunction) {\n const destroyRef = inject(DestroyRef);\n\n destroyRef.onDestroy(() => {\n lockSet.onNextUnlock(() => {\n onDestroy();\n });\n });\n}\n\n// MARK: cleanSubscriptionWithLockSet()\n/**\n * Config for cleanSubscriptionWithLockSet()\n */\nexport interface CleanSubscriptionWithLockSetConfig<T extends Unsubscribable = Unsubscribable> {\n readonly lockSet: LockSet;\n readonly sub?: Maybe<GetterOrValue<T>>;\n}\n\n/**\n * Creates a new SubscriptionObject that is automatically destroyed when the context is destroyed, and the lock set's next unlock occurs.\n *\n * Must be run within an Angular injection context.\n *\n * @example\n * // Pass a subscription that waits for the lockset to unlock before cleanup:\n * readonly _sub = cleanSubscriptionWithLockSet({\n * lockSet: this.lockSet,\n * sub: obs$.subscribe(handler)\n * });\n *\n * @example\n * // Create first, then set the subscription later:\n * readonly _sub = cleanSubscriptionWithLockSet({ lockSet: this.lockSet });\n * this._sub.subscription = obs$.subscribe(handler);\n */\nexport function cleanSubscriptionWithLockSet<T extends Unsubscribable = Unsubscribable>(input: CleanSubscriptionWithLockSetConfig<T>): SubscriptionObject<T> {\n const subscription = getValueFromGetter(input.sub);\n const subscriptionObject = new SubscriptionObject<T>(subscription);\n cleanWithLockSet(input.lockSet, () => subscriptionObject.destroy());\n return subscriptionObject;\n}\n","import { type LoadingState, type LoadingContextEvent, type LoadingStateContextInput, type MutableLoadingStateContext, loadingStateContext, type ListLoadingState, type ListLoadingStateContextInput, type MutableListLoadingStateContext, listLoadingStateContext } from '@dereekb/rxjs';\nimport { clean } from './clean';\n\n/**\n * Creates a new LoadingStateContext that is automatically destroyed when the context is destroyed.\n *\n * Must be run within an Angular injection context.\n *\n * @example\n * // Create with an observable source:\n * readonly context = cleanLoadingContext<MyData>(this.data$);\n *\n * @example\n * // Create empty, then set the observable source later:\n * readonly context = cleanLoadingContext<MyData>();\n * this.context.obs = this.data$;\n */\nexport function cleanLoadingContext<T = unknown, S extends LoadingState<T> = LoadingState<T>, E extends LoadingContextEvent = LoadingContextEvent & S>(input?: LoadingStateContextInput<T, S, E>): MutableLoadingStateContext<T, S, E> {\n return clean(loadingStateContext(input));\n}\n\n/**\n * Creates a new ListLoadingStateContext that is automatically destroyed when the context is destroyed.\n *\n * Must be run within an Angular injection context.\n *\n * @example\n * // Create with an observable source:\n * readonly listContext = cleanListLoadingContext<MyItem>(this.items$);\n *\n * @example\n * // Create empty, then set the observable source later:\n * readonly listContext = cleanListLoadingContext<MyItem>();\n * this.listContext.obs = this.items$;\n */\nexport function cleanListLoadingContext<L = unknown, S extends ListLoadingState<L> = ListLoadingState<L>>(input?: ListLoadingStateContextInput<L, S>): MutableListLoadingStateContext<L, S> {\n return clean(listLoadingStateContext(input));\n}\n","import { type DestroyFunction, DestroyFunctionObject, type Maybe } from '@dereekb/util';\nimport { clean } from './clean';\n\n/**\n * Creates a new DestroyFunctionObject that is automatically destroyed when the context is destroyed.\n *\n * Must be run within an Angular injection context.\n *\n * @example\n * // Pass a destroy function directly:\n * cleanDestroy(() => resource.release());\n *\n * @example\n * // Create first, then set the destroy function later:\n * readonly _destroy = cleanDestroy();\n * this._destroy.setDestroyFunction(() => resource.release());\n */\nexport function cleanDestroy(input?: Maybe<DestroyFunction>): DestroyFunctionObject {\n const destroyFunction = new DestroyFunctionObject(input);\n clean(destroyFunction);\n return destroyFunction;\n}\n","import { first, switchMap, type Observable, type Subscription } from 'rxjs';\nimport { LockSet, filterMaybe, type LoadingState, type LoadingStateType, type MaybeObservableOrValue } from '@dereekb/rxjs';\nimport { type Destroyable, type Maybe, type ReadableError } from '@dereekb/util';\nimport { type ActionContextState, type ActionContextStore } from './action.store';\nimport { type DbxActionDisabledKey, type DbxActionRejectedPair, type DbxActionState, type DbxActionSuccessPair, type DbxActionWorkOrWorkProgress, type DbxActionWorkProgress } from './action';\n\n/**\n * Source that provides a ActionContextStore observable.\n */\nexport abstract class ActionContextStoreSource<T = unknown, O = unknown> {\n /**\n * Observable referencing the ActionContextStore.\n *\n * This observable by design is pre-filtered to not return null values.\n */\n abstract readonly store$: Observable<ActionContextStore<T, O>>;\n}\n\n/**\n * Secondary source. Used by DbxActionContextComponent to find secondary sources.\n */\nexport abstract class SecondaryActionContextStoreSource<T = unknown, O = unknown> extends ActionContextStoreSource<T, O> {}\n\nexport function actionContextStoreSourcePipe<T, O>(obs: Observable<Maybe<ActionContextStore<T, O>>>): Observable<ActionContextStore<T, O>> {\n return obs.pipe(filterMaybe());\n}\n\nexport type PipeActionStoreFunction<R, T, O> = (store: ActionContextStore<T, O>) => Observable<R>;\n\nexport function pipeActionStore<R = unknown, T = unknown, O = unknown>(source: ActionContextStoreSource<T, O>, pipeFn: PipeActionStoreFunction<R, T, O>): Observable<R> {\n return source.store$.pipe(switchMap(pipeFn));\n}\n\nexport type UseActionStoreFunction<T, O> = (store: ActionContextStore<T, O>) => void;\n\n/**\n * Convenience function for subscribing to the input source once and using the provided store.\n */\nexport function useActionStore<T = unknown, O = unknown>(source: ActionContextStoreSource<T, O>, useFn: UseActionStoreFunction<T, O>): Subscription {\n return source.store$.pipe(first()).subscribe(useFn);\n}\n\n/**\n * Service that wraps a ActionContextStoreSource.\n */\nexport class DbxActionContextStoreSourceInstance<T = unknown, O = unknown> implements ActionContextStoreSource<T, O>, Destroyable {\n readonly lockSet = new LockSet();\n\n private readonly _source: ActionContextStoreSource<T, O>;\n\n constructor(source: ActionContextStoreSource<T, O>) {\n if (!source) {\n throw new Error('Source is required.');\n }\n\n this._source = source;\n }\n\n get source(): ActionContextStoreSource<T, O> {\n return this._source;\n }\n\n public destroy(): void {\n this.lockSet.destroyOnNextUnlock();\n }\n\n // MARK: Store\n get store$(): Observable<ActionContextStore<T, O>> {\n return this.source.store$;\n }\n\n pipeStore<R>(pipeFn: PipeActionStoreFunction<R, T, O>): Observable<R> {\n return pipeActionStore(this.source, pipeFn);\n }\n\n useStore(useFn: UseActionStoreFunction<T, O>): Subscription {\n return useActionStore(this.source, useFn);\n }\n\n get state$(): Observable<ActionContextState<T, O>> {\n return this.pipeStore((x) => x.state$);\n }\n\n get idle$(): Observable<boolean> {\n return this.pipeStore((x) => x.idle$);\n }\n\n get triggered$(): Observable<boolean> {\n return this.pipeStore((x) => x.triggered$);\n }\n\n get valueReady$(): Observable<T> {\n return this.pipeStore((x) => x.valueReady$);\n }\n\n get success$(): Observable<Maybe<O>> {\n return this.pipeStore((x) => x.success$);\n }\n\n get successPair$(): Observable<DbxActionSuccessPair<T, O>> {\n return this.pipeStore((x) => x.successPair$);\n }\n\n get workProgress$(): Observable<Maybe<DbxActionWorkProgress>> {\n return this.pipeStore((x) => x.workProgress$);\n }\n\n get error$(): Observable<Maybe<ReadableError>> {\n return this.pipeStore((x) => x.error$);\n }\n\n get rejected$(): Observable<Maybe<ReadableError>> {\n return this.pipeStore((x) => x.rejected$);\n }\n\n get rejectedPair$(): Observable<DbxActionRejectedPair<T>> {\n return this.pipeStore((x) => x.rejectedPair$);\n }\n\n get isModified$(): Observable<boolean> {\n return this.pipeStore((x) => x.isModified$);\n }\n\n get canTrigger$(): Observable<boolean> {\n return this.pipeStore((x) => x.canTrigger$);\n }\n\n get isModifiedAndCanTriggerUpdates$(): Observable<boolean> {\n return this.pipeStore((x) => x.isModifiedAndCanTriggerUpdates$);\n }\n\n get isModifiedAndCanTrigger$(): Observable<boolean> {\n return this.pipeStore((x) => x.isModifiedAndCanTrigger$);\n }\n\n get actionState$(): Observable<DbxActionState> {\n return this.pipeStore((x) => x.actionState$);\n }\n\n get loadingState$(): Observable<LoadingState<O>> {\n return this.pipeStore((x) => x.loadingState$);\n }\n\n get loadingStateType$(): Observable<LoadingStateType> {\n return this.pipeStore((x) => x.loadingStateType$);\n }\n\n get isWorking$(): Observable<boolean> {\n return this.pipeStore((x) => x.isWorking$);\n }\n\n get isWorkingOrWorkProgress$(): Observable<DbxActionWorkOrWorkProgress> {\n return this.pipeStore((x) => x.isWorkingOrWorkProgress$);\n }\n\n get isSuccess$(): Observable<boolean> {\n return this.pipeStore((x) => x.isSuccess$);\n }\n\n get disabledKeys$(): Observable<string[]> {\n return this.pipeStore((x) => x.disabledKeys$);\n }\n\n get isDisabled$(): Observable<boolean> {\n return this.pipeStore((x) => x.isDisabled$);\n }\n\n get errorCountSinceLastSuccess$(): Observable<number> {\n return this.pipeStore((x) => x.errorCountSinceLastSuccess$);\n }\n\n public enable(key?: DbxActionDisabledKey, enable = true): void {\n this.disable(key, !enable);\n }\n\n public disable(key?: DbxActionDisabledKey, disable = true): void {\n this.useStore((x) => (disable ? x.disable(key) : x.enable(key)));\n }\n\n public setIsSame(isSame?: boolean | Observable<boolean> | Observable<void>): void {\n this.useStore((x) => x.setIsSame(isSame));\n }\n\n public setIsModified(isModified?: boolean | Observable<boolean> | Observable<void>): void {\n this.useStore((x) => x.setIsModified(isModified));\n }\n\n public setWorkProgress(workProgress: MaybeObservableOrValue<DbxActionWorkProgress>): void {\n this.useStore((x) => x.setWorkProgress(workProgress));\n }\n\n public trigger(): void {\n this.useStore((x) => x.trigger());\n }\n\n public triggerWithValue(value: T | Observable<T>): void {\n this.useStore((x) => {\n x.trigger();\n x.readyValue(value);\n });\n }\n\n public readyValue(value: T | Observable<T>): void {\n this.useStore((x) => x.readyValue(value));\n }\n\n public startWorking(): void {\n this.useStore((x) => x.startWorking());\n }\n\n public reject(error: Maybe<ReadableError | Observable<ReadableError>>): void {\n this.useStore((x) => x.reject(error));\n }\n\n public resolve(value: O | Observable<O>): void {\n this.useStore((x) => x.resolve(value));\n }\n\n public reset(): void {\n this.useStore((x) => x.reset());\n }\n}\n","import { Directive, inject, input } from '@angular/core';\nimport { cleanSubscriptionWithLockSet } from '../../../rxjs';\nimport { distinctUntilChanged, filter, switchMap, Observable, EMPTY } from 'rxjs';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { isNotFalse } from '@dereekb/util';\nimport { toObservable } from '@angular/core/rxjs-interop';\n\n@Directive({\n selector: 'dbxActionAutoModify, [dbxActionAutoModify]',\n standalone: true\n})\nexport class DbxActionAutoModifyDirective<T, O> {\n readonly source = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n readonly autoModifyEnabled = input<boolean, string | boolean>(true, { alias: 'dbxActionAutoModify', transform: isNotFalse });\n readonly markAsModified$: Observable<void> = toObservable(this.autoModifyEnabled).pipe(\n distinctUntilChanged(),\n switchMap((x) => {\n let obs: Observable<any>;\n\n if (x) {\n obs = this.source.isModified$.pipe(filter((x) => !x));\n } else {\n obs = EMPTY;\n }\n\n return obs;\n })\n );\n\n constructor() {\n cleanSubscriptionWithLockSet({\n lockSet: this.source.lockSet,\n sub: this.markAsModified$.subscribe(() => {\n this.source.setIsModified(true);\n })\n });\n }\n}\n","import { inject, Directive, input, computed, signal, Signal } from '@angular/core';\nimport { cleanSubscriptionWithLockSet } from '../../../rxjs';\nimport { debounce, distinctUntilChanged, exhaustMap, filter, first, map, mergeMap, shareReplay, switchMap, throttle, EMPTY, interval, combineLatest, Observable } from 'rxjs';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { isDefinedAndNotFalse, isNotFalse, type Maybe } from '@dereekb/util';\nimport { toObservable } from '@angular/core/rxjs-interop';\n\nconst DEFAULT_DEBOUNCE_MS = 2 * 1000;\n\nconst DEFAULT_THROTTLE_MS = 10 * 1000;\n\nconst DEFAULT_ERROR_THROTTLE_MS = 3 * 1000;\n\nconst MAX_ERRORS_TO_THROTTLE_ON = 6;\n\nconst DBX_ACTION_AUTO_TRIGGER_FAST_TRIGGER_DEBOUNCE = 200;\nconst DBX_ACTION_AUTO_TRIGGER_INSTANT_TRIGGER_DEBOUNCE = 10;\n\n/**\n * Directive that automatically triggers the action periodically when it is in a modified state.\n *\n * When using auto triggers be sure to make sure that the action is not triggering too often due to misconfiguration.\n */\n@Directive({\n selector: 'dbxActionAutoTrigger,[dbxActionAutoTrigger]',\n standalone: true\n})\nexport class DbxActionAutoTriggerDirective<T = unknown, O = unknown> {\n readonly source = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n\n readonly triggerDebounce = input<Maybe<number>>(undefined);\n readonly triggerThrottle = input<Maybe<number>>(undefined);\n readonly triggerErrorThrottle = input<number, Maybe<number>>(DEFAULT_ERROR_THROTTLE_MS, { transform: (x) => x ?? DEFAULT_ERROR_THROTTLE_MS });\n readonly maxErrorsForThrottle = input<number, Maybe<number>>(MAX_ERRORS_TO_THROTTLE_ON, { transform: (x) => x ?? MAX_ERRORS_TO_THROTTLE_ON });\n readonly triggerLimit = input<Maybe<number>>();\n readonly triggerEnabled = input<boolean, Maybe<string | boolean>>(true, { alias: 'dbxActionAutoTrigger', transform: isNotFalse });\n readonly useFastTriggerPreset = input<boolean, Maybe<'' | boolean>>(false, { transform: isDefinedAndNotFalse });\n readonly useInstantTriggerPreset = input<boolean, Maybe<'' | boolean>>(false, { transform: isDefinedAndNotFalse });\n\n readonly triggerDebounceSignal = computed(() => {\n let debounce = this.triggerDebounce();\n\n if (debounce == null) {\n const useFastTrigger = this.useFastTriggerPreset();\n const useInstantTrigger = this.useInstantTriggerPreset();\n\n if (useFastTrigger) {\n debounce = DBX_ACTION_AUTO_TRIGGER_FAST_TRIGGER_DEBOUNCE;\n } else if (useInstantTrigger) {\n debounce = DBX_ACTION_AUTO_TRIGGER_INSTANT_TRIGGER_DEBOUNCE;\n }\n }\n\n return debounce ?? DEFAULT_DEBOUNCE_MS;\n });\n\n readonly triggerThrottleSignal: Signal<number> = computed(() => {\n let throttle = this.triggerThrottle();\n\n if (throttle == null) {\n const useFastTrigger = this.useFastTriggerPreset();\n const useInstantTrigger = this.useInstantTriggerPreset();\n\n if (useFastTrigger) {\n throttle = DBX_ACTION_AUTO_TRIGGER_FAST_TRIGGER_DEBOUNCE;\n } else if (useInstantTrigger) {\n throttle = DBX_ACTION_AUTO_TRIGGER_INSTANT_TRIGGER_DEBOUNCE;\n }\n }\n\n return throttle ?? DEFAULT_THROTTLE_MS;\n });\n\n readonly triggerCountSignal = signal<number>(0);\n\n readonly _errorCount$ = this.source.errorCountSinceLastSuccess$;\n readonly _triggerCount$ = this.source.isModifiedAndCanTriggerUpdates$.pipe(\n // each time something is triggered the\n filter(() => this.triggerEnabled() ?? false),\n debounce(() => interval(this.triggerDebounceSignal())),\n throttle(\n () =>\n this._errorCount$.pipe(\n first(),\n exhaustMap((errorCount) => {\n const maxErrors = this.maxErrorsForThrottle() ?? MAX_ERRORS_TO_THROTTLE_ON;\n const throttleTime = this.triggerErrorThrottle() ?? DEFAULT_ERROR_THROTTLE_MS;\n const additionalInterval = Math.min(errorCount, maxErrors) * throttleTime;\n\n return interval(this.triggerThrottleSignal() + additionalInterval);\n })\n ),\n { leading: true, trailing: true }\n ),\n // Check again for the \"trailing\" piece.\n filter(() => this.triggerEnabled() ?? false),\n mergeMap(() => this.source.isModifiedAndCanTrigger$.pipe(first())),\n filter((x) => x),\n map(() => {\n const count = this.triggerCountSignal();\n this.triggerCountSignal.update((x) => x + 1);\n return count;\n }),\n shareReplay(1)\n );\n\n /**\n * Observable for the trigger mechanism.\n */\n readonly triggerCount$ = toObservable(this.triggerEnabled).pipe(\n switchMap((enabled) => {\n let countObs: Observable<number>;\n\n if (enabled !== false) {\n countObs = this._triggerCount$;\n } else {\n countObs = EMPTY;\n }\n\n return countObs;\n })\n );\n\n private readonly _isTriggerLimited$: Observable<readonly [number, boolean]> = combineLatest([this.triggerCount$, toObservable(this.triggerLimit)]).pipe(\n map(([triggerCount, limit]) => {\n const isAllowedToRun = limit != null ? triggerCount < limit : true;\n return [triggerCount, isAllowedToRun] as const;\n }),\n shareReplay(1)\n );\n\n readonly isTriggerAllowedToRun$ = this._isTriggerLimited$.pipe(\n map((x) => x[1]),\n shareReplay(1)\n );\n\n readonly automaticTrigger$: Observable<void> = this._isTriggerLimited$.pipe(\n filter((x) => x[1]),\n distinctUntilChanged((a, b) => a[0] === b[0]), // Only trigger when the count changes.\n map(() => undefined as void)\n );\n\n constructor() {\n cleanSubscriptionWithLockSet({\n lockSet: this.source.lockSet,\n sub: this.automaticTrigger$.subscribe(() => {\n this.source.trigger();\n })\n });\n }\n}\n","import { type Maybe, type ReadableError } from '@dereekb/util';\nimport { type DbxActionContextStoreSourceInstance } from './action.store.source';\nimport { type WorkInstanceDelegate } from '@dereekb/rxjs';\nimport { type Observable } from 'rxjs';\n\n/**\n * WorkInstanceDelegate implementation using an DbxActionContextStoreSourceInstance.\n */\nexport class DbxActionWorkInstanceDelegate<T = unknown, O = unknown> implements WorkInstanceDelegate<O> {\n private _source: DbxActionContextStoreSourceInstance<T, O>;\n\n constructor(source: DbxActionContextStoreSourceInstance<T, O>) {\n this._source = source;\n }\n\n get source() {\n return this._source;\n }\n\n startWorking(): void {\n this.source.startWorking();\n }\n\n success(result: O): void {\n this.source.resolve(result);\n }\n\n reject(error: Maybe<ReadableError | Observable<ReadableError>>): void {\n this.source.reject(error);\n }\n}\n","import { LoadingStateType } from '@dereekb/rxjs';\nimport { type PercentNumber, type Maybe } from '@dereekb/util';\n\n/**\n * Used to denote the percent progress of a working action.\n *\n * This is a PercentNumber, a number between 0 and 100.\n */\nexport type DbxActionWorkProgress = PercentNumber;\n\n/**\n * Used for denoting working state or progress.\n *\n * True is working, but no progress level.\n */\nexport type DbxActionWorkOrWorkProgress = boolean | DbxActionWorkProgress;\n\n/**\n * Creates a working progress value from an array of working progress values.\n *\n * @param workOrWorkProgress The array of working progress values to use.\n * @param progressPercent An optional progress percent value to use if the working progress is a boolean.\n * @returns The working progress value.\n */\nexport function dbxActionWorkProgress(workOrWorkProgress: Maybe<DbxActionWorkOrWorkProgress>[], progressPercent?: Maybe<DbxActionWorkProgress>) {\n const workingValue = workOrWorkProgress.reduce((acc, val) => acc ?? val);\n const isWorking = workingValue != null && workingValue !== false;\n\n let workingProgress: DbxActionWorkOrWorkProgress;\n\n if (isWorking) {\n if (typeof workingValue === 'number') {\n workingProgress = workingValue;\n } else {\n workingProgress = progressPercent ?? true;\n }\n } else {\n workingProgress = false;\n }\n\n return workingProgress;\n}\n\n/**\n * Used by ActionContextState to denote what state the action is in.\n */\nexport enum DbxActionState {\n /**\n * No action in progress. Waiting for the trigger.\n */\n IDLE = 'idle',\n /**\n * Idle state that can be set to show that the source is not yet ready.\n */\n DISABLED = 'disabled',\n /**\n * The action was triggered. We wait (and allow) the value to be updated.\n */\n TRIGGERED = 'triggered',\n /**\n * The trigger was accepted and the value is updated. It should begin working immediately.\n *\n * ValueReady cannot be set until triggered is set.\n */\n VALUE_READY = 'valueReady',\n /**\n * The action is in progress.\n */\n WORKING = 'working',\n /**\n * The trigger, action, or value was rejected due to an error or other issue.\n *\n * An error may be specified optionally.\n */\n REJECTED = 'rejected',\n /**\n * The action resolved without issue.\n */\n RESOLVED = 'resolved'\n}\n\n/**\n * Contains the input value and the output result from a DbxAction.\n */\nexport interface DbxActionSuccessPair<T, O> {\n readonly value: T;\n readonly result: Maybe<O>;\n}\n\n/**\n * Contains the input value and the output error from a DbxAction.\n */\nexport interface DbxActionRejectedPair<T> {\n readonly value: T;\n readonly error: unknown;\n}\n\n/**\n * Unique key for disabling/enabling.\n */\nexport type DbxActionDisabledKey = string;\n\nexport const DEFAULT_ACTION_DISABLED_KEY = 'dbx_action_disabled';\n\nexport function isIdleActionState(actionState: DbxActionState): boolean {\n switch (actionState) {\n case DbxActionState.IDLE:\n case DbxActionState.DISABLED:\n case DbxActionState.REJECTED:\n case DbxActionState.RESOLVED:\n return true;\n default:\n return false;\n }\n}\n\nexport function loadingStateTypeForActionState(actionState: DbxActionState): LoadingStateType {\n let loadingStateType: LoadingStateType;\n\n switch (actionState) {\n case DbxActionState.RESOLVED:\n loadingStateType = LoadingStateType.SUCCESS;\n break;\n case DbxActionState.REJECTED:\n loadingStateType = LoadingStateType.ERROR;\n break;\n case DbxActionState.IDLE:\n case DbxActionState.DISABLED:\n loadingStateType = LoadingStateType.IDLE;\n break;\n default:\n loadingStateType = LoadingStateType.LOADING;\n break;\n }\n\n return loadingStateType;\n}\n","import { Injectable, OnDestroy } from '@angular/core';\nimport { ComponentStore } from '@ngrx/component-store';\nimport { Observable, distinctUntilChanged, filter, map, shareReplay, switchMap, startWith, of } from 'rxjs';\nimport { BooleanStringKeyArray, BooleanStringKeyArrayUtility, Maybe, ReadableError } from '@dereekb/util';\nimport { LoadingStateType, idleLoadingState, errorResult, filterMaybe, LoadingState, scanCount, successResult, beginLoading } from '@dereekb/rxjs';\nimport { DbxActionDisabledKey, DbxActionRejectedPair, DbxActionState, DbxActionSuccessPair, DbxActionWorkOrWorkProgress, DbxActionWorkProgress, DEFAULT_ACTION_DISABLED_KEY, isIdleActionState, loadingStateTypeForActionState } from './action';\nimport { cleanLockSet } from '../rxjs';\n\nexport function isActionContextEnabled(state: ActionContextState): boolean {\n return BooleanStringKeyArrayUtility.isFalse(state.disabled);\n}\n\nexport function isActionContextDisabled(state: ActionContextState): boolean {\n return BooleanStringKeyArrayUtility.isTrue(state.disabled);\n}\n\nexport function isDisabledActionContextState(state: ActionContextState): boolean {\n return isIdleActionState(state.actionState) && isActionContextDisabled(state);\n}\n\nexport function isWorkingActionState(actionState: DbxActionState): boolean {\n return !isIdleActionState(actionState);\n}\n\nexport function canTriggerActionState(actionState: DbxActionState): boolean {\n return actionState !== DbxActionState.DISABLED && isIdleActionState(actionState);\n}\n\nexport function canTriggerAction(state: ActionContextState): boolean {\n return isActionContextEnabled(state) && isIdleActionState(state.actionState);\n}\n\nexport function canReadyValue(state: ActionContextState): boolean {\n return state.actionState === DbxActionState.TRIGGERED;\n}\n\nexport function actionContextIsModifiedAndCanTrigger(state: ActionContextState): boolean {\n // console.log('check: ', state, state.isModified, canTriggerAction(state));\n return state.isModified && canTriggerAction(state);\n}\n\nexport function actionContextHasNoErrorAndIsModifiedAndCanTrigger(state: ActionContextState): boolean {\n return !state.error && actionContextIsModifiedAndCanTrigger(state);\n}\n\nexport function loadingStateForActionContextState<O = unknown>(state: ActionContextState<unknown, O>): LoadingState<O> {\n let loadingState: LoadingState<O>;\n\n switch (state.actionState) {\n case DbxActionState.RESOLVED:\n loadingState = successResult(state.result);\n break;\n case DbxActionState.REJECTED:\n loadingState = errorResult(state.error);\n break;\n case DbxActionState.IDLE:\n case DbxActionState.DISABLED:\n loadingState = idleLoadingState();\n break;\n default:\n loadingState = beginLoading(state.workProgress != null ? { loadingProgress: state.workProgress } : undefined);\n break;\n }\n\n return loadingState;\n}\n\nexport function loadingStateTypeForActionContextState(state: ActionContextState): LoadingStateType {\n return loadingStateTypeForActionState(state.actionState);\n}\n\nexport interface ActionContextState<T = unknown, O = unknown> {\n readonly actionState: DbxActionState;\n /**\n * Whether or not this action is flagged as having been modified.\n */\n readonly isModified: boolean;\n /**\n * The working progress of the action.\n *\n * Is reset to null when triggered/ready value is set.\n */\n readonly workProgress?: Maybe<DbxActionWorkProgress>;\n /**\n * Value that is set after a triggered action. Not to be confused with result.\n */\n readonly value?: Maybe<T>;\n /**\n * Resolved result value.\n */\n readonly result?: Maybe<O>;\n /**\n * Rejected error, if available.\n */\n readonly error?: Maybe<ReadableError>;\n /**\n * Current disabled state.\n */\n readonly disabled?: BooleanStringKeyArray;\n /**\n * Number of consecutive errors that have occured.\n */\n readonly errorCount?: number;\n}\n\nconst INITIAL_STATE: ActionContextState = {\n isModified: false,\n actionState: DbxActionState.IDLE\n};\n\nexport const ACTION_CONTEXT_STORE_LOCKSET_DESTROY_DELAY_TIME = 2000;\n\n@Injectable()\nexport class ActionContextStore<T = unknown, O = unknown> extends ComponentStore<ActionContextState<T, O>> implements OnDestroy {\n readonly lockSet = cleanLockSet({\n onLockSetDestroy: () => super.ngOnDestroy(),\n destroyLocksetTiming: {\n delayTime: ACTION_CONTEXT_STORE_LOCKSET_DESTROY_DELAY_TIME\n }\n });\n\n constructor() {\n super({ ...INITIAL_STATE } as ActionContextState<T, O>);\n this.lockSet.addLock('working', this.isWorking$);\n }\n\n // MARK: Accessors\n readonly actionState$ = this.state$.pipe(\n map((x) => (isDisabledActionContextState(x) ? DbxActionState.DISABLED : x.actionState)),\n shareReplay(1)\n );\n\n /**\n * Returns the current disabled reasons/keys.\n */\n readonly disabledKeys$ = this.state$.pipe(\n map((x) => [...(x.disabled ?? [])]),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n /**\n * Current value of the state.\n */\n readonly currentValue$: Observable<Maybe<T>> = this.state$.pipe(map((x) => x.value));\n\n /**\n * Maps the current state to true or not when the action state changes to/from disabled.\n */\n readonly isDisabled$ = this.state$.pipe(map(isDisabledActionContextState), distinctUntilChanged(), shareReplay(1));\n\n /**\n * Pipes when idle but modified.\n */\n readonly isModified$ = this.afterDistinctBoolean((x) => x.isModified);\n\n /**\n * Pipes true when idle.\n */\n readonly idle$ = this.actionState$.pipe(\n map((x) => x === DbxActionState.IDLE),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n /**\n * Pipes true when triggered.\n */\n readonly triggered$ = this.afterDistinctActionState(DbxActionState.TRIGGERED, () => true);\n\n /**\n * Pipes the readied value on ValueReady.\n */\n readonly valueReady$: Observable<T> = this.afterDistinctActionState(DbxActionState.VALUE_READY, (x) => x.value as T);\n\n /**\n * Pipes the working progress on the working state.\n */\n readonly workProgress$ = this.state$.pipe(\n map((x) => x.workProgress),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n /**\n * Pipes the error on the rejection state.\n */\n readonly rejected$ = this.afterDistinctActionState(DbxActionState.REJECTED, (x) => x.error);\n\n /**\n * Pipes the result when the ActionState becomes rejected.\n */\n readonly rejectedPair$ = this.afterDistinctActionState(DbxActionState.RESOLVED, (x) => ({ value: x.value, error: x.error }) as DbxActionRejectedPair<T>);\n\n /**\n * Pipes the result when the ActionState becomes working.\n */\n readonly working$ = this.afterDistinctActionState(DbxActionState.WORKING, () => true);\n\n /**\n * Whether or not it is currently in a working state.\n */\n readonly isWorking$ = this.afterDistinctBoolean((x) => isWorkingActionState(x.actionState));\n\n /**\n * Pipes the current work or work progress.\n */\n readonly isWorkingOrWorkProgress$ = this.isWorking$.pipe(\n switchMap((x) => {\n let obs: Observable<DbxActionWorkOrWorkProgress>;\n\n if (x) {\n obs = this.workProgress$.pipe(\n filter((x) => x != null),\n startWith(x)\n );\n } else {\n obs = of(x);\n }\n\n return obs;\n }),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n /**\n * Pipes the current error.\n */\n readonly error$ = this.state$.pipe(\n map((x) => x.error),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n /**\n * Pipes the result when the ActionState becomes success.\n */\n readonly success$ = this.afterDistinctActionState(DbxActionState.RESOLVED, (x) => x.result);\n\n /**\n * Pipes the result when the ActionState becomes success.\n */\n readonly successPair$ = this.afterDistinctActionState(DbxActionState.RESOLVED, (x) => ({ value: x.value, result: x.result }) as DbxActionSuccessPair<T, O>);\n\n /**\n * Whether or not it is currently in a success state.\n */\n readonly isSuccess$ = this.afterDistinctBoolean((x) => x.actionState === DbxActionState.RESOLVED);\n\n /**\n * Returns a loading state based on the current state.\n */\n readonly loadingState$ = this.afterDistinctLoadingStateTypeChange().pipe(\n switchMap((x) => {\n const base = loadingStateForActionContextState<O>(x);\n let obs: Observable<LoadingState<O>>;\n\n if (base.loading === true) {\n obs = this.workProgress$.pipe(\n filter((x) => x != null),\n map((loadingProgress) => ({ ...base, loadingProgress })),\n startWith(base)\n );\n } else {\n obs = of(base);\n }\n\n return obs;\n }),\n shareReplay(1)\n );\n\n /**\n * Returns the current LoadingStateType based on the current state.\n */\n readonly loadingStateType$ = this.state$.pipe(\n map((x) => loadingStateTypeForActionContextState(x)),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n /**\n * Number of errors since last success.\n */\n readonly errorCountSinceLastSuccess$ = this.isSuccess$.pipe(\n startWith(false),\n distinctUntilChanged(),\n switchMap(() => this.error$.pipe(filterMaybe(), scanCount(), startWith(0))),\n shareReplay(1)\n );\n\n /**\n * Whether or not the state can be triggered.\n */\n readonly canTrigger$ = this.state$.pipe(map(canTriggerAction), distinctUntilChanged(), shareReplay(1));\n\n /**\n * Pipe that maps whether or not this is modified and can be triggered.\n *\n * Updates every state update instead of when the value changes.\n */\n readonly isModifiedAndCanTriggerUpdates$ = this.state$.pipe(map((x) => actionContextIsModifiedAndCanTrigger(x), shareReplay(1)));\n\n /**\n * Whether or not it can be triggered and modified.\n */\n readonly isModifiedAndCanTrigger$ = this.isModifiedAndCanTriggerUpdates$.pipe(distinctUntilChanged());\n\n readonly hasNoErrorAndIsModifiedAndCanTrigger$ = this.state$.pipe(\n map((x) => actionContextHasNoErrorAndIsModifiedAndCanTrigger(x)),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n // MARK: State Changes\n /**\n * Adds a disabled reason.\n */\n readonly disable = this.updater((state, key?: void | DbxActionDisabledKey) => ({\n ...state,\n disabled: BooleanStringKeyArrayUtility.insert(state.disabled, (key as string) ?? DEFAULT_ACTION_DISABLED_KEY)\n }));\n\n /**\n * Removes a disabled reason.\n */\n readonly enable = this.updater((state, key?: void | DbxActionDisabledKey) => ({\n ...state,\n disabled: BooleanStringKeyArrayUtility.remove(state.disabled, (key as string) ?? DEFAULT_ACTION_DISABLED_KEY)\n }));\n\n /**\n * Triggers the modified state, if not disabled.\n *\n * Equivalent to calling setIsModified() with opposite input.\n */\n readonly setIsSame = this.updater<void, void | boolean>(updateIsSameOnActionContextState);\n\n /**\n * Triggers the modified state, if not disabled.\n */\n readonly setIsModified = this.updater<void, void | boolean>(updateIsModifiedOnActionContextState);\n\n /**\n * Triggers the action if the state is currently not idle. The current state is cleared, but the error is retained (as we may need the error from the previous attempt).\n *\n * Will not fire if the action is disabled.\n */\n readonly trigger = this.updater((state) => (canTriggerAction(state) ? { isModified: state.isModified, actionState: DbxActionState.TRIGGERED, error: state.error, value: undefined } : state));\n\n /**\n * Updates the value, setting value ready. The current result is cleared.\n */\n readonly readyValue = this.updater((state, value: T) => (canReadyValue(state) ? { ...state, actionState: DbxActionState.VALUE_READY, value, result: undefined } : state));\n\n /**\n * Notifys the context that the action is in progress.\n */\n readonly startWorking = this.updater((state) => ({ ...state, actionState: DbxActionState.WORKING, workProgress: null }));\n\n /**\n * Updates the working progress.\n */\n readonly setWorkProgress = this.updater((state, workProgress: Maybe<DbxActionWorkProgress>) => ({ ...state, workProgress }));\n\n /**\n * Triggers rejection of the action. The value is cleared.\n */\n readonly reject = this.updater((state, error?: Maybe<ReadableError>) => ({\n isModified: state.isModified,\n actionState: DbxActionState.REJECTED,\n error,\n errorCount: (state.errorCount ?? 0) + 1,\n disabled: state.disabled\n }));\n\n /**\n * Updates the state to success, and optionally sets a result.\n *\n * Clears modified state, and any errors.\n */\n readonly resolve = this.updater((state, result?: Maybe<O>) => ({ isModified: false, actionState: DbxActionState.RESOLVED, value: state.value, result, error: undefined, disabled: state.disabled }));\n\n /**\n * Completely resets the store.\n */\n readonly reset = this.updater(() => ({ ...INITIAL_STATE }) as ActionContextState<T, O>);\n\n // MARK: Utility\n afterDistinctBoolean(fromState: (state: ActionContextState<T, O>) => boolean): Observable<boolean> {\n return this.state$.pipe(\n map((x) => fromState(x)),\n distinctUntilChanged(),\n shareReplay(1)\n );\n }\n\n afterDistinctActionState<X>(actionState: DbxActionState, fromState: (state: ActionContextState<T, O>) => X): Observable<X> {\n return this.afterDistinctActionStateChange().pipe(\n filter((x) => x.actionState === actionState), // Only pipe when the new action state matches.\n map((x) => fromState(x)),\n shareReplay(1)\n );\n }\n\n afterDistinctActionStateChange(): Observable<ActionContextState<T, O>> {\n return this.state$.pipe(\n map((x) => [x, x.actionState] as [ActionContextState, DbxActionState]),\n distinctUntilChanged((a, b) => a?.[1] === b?.[1]), // Filter out when the state remains the same.\n map((x) => x[0] as ActionContextState<T, O>),\n shareReplay(1)\n );\n }\n\n afterDistinctLoadingStateTypeChange(): Observable<ActionContextState<T, O>> {\n return this.state$.pipe(\n map((x) => [x, loadingStateTypeForActionContextState(x)] as [ActionContextState, LoadingStateType]),\n distinctUntilChanged((a, b) => a?.[1] === b?.[1]), // Filter out when the loading state remains the same.\n map((x) => x[0] as ActionContextState<T, O>),\n shareReplay(1)\n );\n }\n\n // MARK: Cleanup\n override ngOnDestroy(): void {\n // do not call super.destroy here, to keep the component store from destroying itself.\n // the lockset is configured to cleanup the component store.\n }\n}\n\nfunction updateIsSameOnActionContextState<T, O>(state: ActionContextState<T, O>, isSame?: void | boolean): ActionContextState<T, O> {\n return updateIsModifiedOnActionContextState(state, isSame == null ? false : !isSame);\n}\n\nfunction updateIsModifiedOnActionContextState<T, O>(state: ActionContextState<T, O>, isModified?: void | boolean): ActionContextState<T, O> {\n return {\n ...state,\n actionState: state.actionState === DbxActionState.RESOLVED ? DbxActionState.IDLE : state.actionState, // Set to idle from success.\n isModified: (isModified as boolean) ?? true // if isModified is not input, default it to true\n };\n}\n","import { type Observable, of } from 'rxjs';\nimport { type Destroyable, type Maybe } from '@dereekb/util';\nimport { type LockSet } from '@dereekb/rxjs';\nimport { type ActionContextStoreSource, DbxActionContextStoreSourceInstance, type SecondaryActionContextStoreSource } from './action.store.source';\nimport { ActionContextStore } from './action.store';\nimport { type DbxActionDisabledKey } from './action';\n\n/**\n * Abstract class that can either use SecondaryActionContextStoreSource or create it's own.\n */\nexport abstract class DbxActionContextBaseSource<T = unknown, O = unknown> implements ActionContextStoreSource<T, O>, Destroyable {\n private readonly _inputSource: Maybe<SecondaryActionContextStoreSource<T, O>>;\n\n private readonly _store?: ActionContextStore<T, O>;\n private readonly _store$: Observable<ActionContextStore<T, O>>;\n private readonly _instance: DbxActionContextStoreSourceInstance<T, O>;\n\n readonly isModified$: Observable<boolean>;\n readonly triggered$: Observable<boolean>;\n readonly success$: Observable<Maybe<O>>;\n\n constructor(inputSource?: Maybe<SecondaryActionContextStoreSource<T, O>>) {\n this._inputSource = inputSource;\n\n if (inputSource) {\n this._store$ = inputSource.store$;\n } else {\n this._store = new ActionContextStore();\n this._store$ = of(this._store);\n }\n\n this._instance = new DbxActionContextStoreSourceInstance(this);\n this.isModified$ = this._instance.isModified$;\n this.triggered$ = this._instance.triggered$;\n this.success$ = this._instance.success$;\n }\n\n destroy(): void {\n if (this._store) {\n this._store.ngOnDestroy();\n this._instance.destroy();\n }\n }\n\n get inputSource() {\n return this._inputSource;\n }\n\n get lockSet(): LockSet {\n return this._instance.lockSet;\n }\n\n get sourceInstance(): DbxActionContextStoreSourceInstance<T, O> {\n return this._instance;\n }\n\n get store$(): Observable<ActionContextStore<T, O>> {\n return this._store$;\n }\n\n /**\n * Use to trigger the action directly.\n */\n public trigger(): void {\n this._instance.trigger();\n }\n\n public readyValue(value: T | Observable<T>): void {\n this._instance.readyValue(value);\n }\n\n /**\n * Triggers the context and then readies the value.\n * @param value\n */\n public triggerWithValue(value: T | Observable<T>): void {\n this._instance.triggerWithValue(value);\n }\n\n public reset(): void {\n this._instance.reset();\n }\n\n public enable(key?: DbxActionDisabledKey, enable?: boolean): void {\n this._instance.enable(key, enable);\n }\n\n public disable(key?: DbxActionDisabledKey, disable?: boolean): void {\n this._instance.disable(key, disable);\n }\n\n public setIsModified(isModified?: boolean): void {\n this._instance.setIsModified(isModified);\n }\n}\n","import { DbxActionContextSourceReference } from './action.reference';\nimport { delay, first } from 'rxjs';\nimport { ActionContextStoreSource } from './action.store.source';\nimport { DbxActionWorkInstanceDelegate } from './action.handler';\nimport { DbxActionContextBaseSource } from './action.holder';\nimport { Destroyable, type Maybe } from '@dereekb/util';\nimport { SubscriptionObject, Work, workFactory } from '@dereekb/rxjs';\nimport { Injectable } from '@angular/core';\nimport { clean } from '../rxjs/clean';\n\n/**\n * DbxActionContextMachine configuration.\n */\nexport interface DbxActionContextMachineConfig<T = unknown, O = unknown> {\n /**\n * Whether or not the machine should clean itself up after being triggered once.\n */\n oneTimeUse: boolean;\n /**\n * Function to handle any valueReady events.\n *\n * If false, will not subscribe/handle valueReady$ events.\n */\n handleValueReady: Work<T, O> | false;\n /**\n * Optional function to execute after the action has succeeded.\n */\n onSuccess?: (value: Maybe<O>) => void;\n}\n\n/**\n * Configurable machine that handles components of the ActionContextStore lifecycle.\n *\n * It can be configured to activate only once before cleaning itself up. It can be used directly as a DbxActionContextSourceReference in cases where it is created as a one-off action.\n */\nexport class DbxActionContextMachine<T = unknown, O = unknown> extends DbxActionContextBaseSource<T, O> implements DbxActionContextSourceReference<T, O>, Destroyable {\n private _isShutdown = true;\n\n private readonly _config: DbxActionContextMachineConfig<T, O>;\n private readonly _handleValueReadySub = new SubscriptionObject();\n private readonly _successSub = new SubscriptionObject();\n\n constructor(config: DbxActionContextMachineConfig<T, O>, source?: ActionContextStoreSource<T, O>) {\n super(source);\n this._config = config;\n\n // Handle Value Ready\n if (config.handleValueReady !== false) {\n this._handleValueReadySub.subscription = this.sourceInstance.valueReady$.subscribe((value) => {\n const doWork = workFactory({\n work: config.handleValueReady as Work<T, O>,\n delegate: new DbxActionWorkInstanceDelegate<T, O>(this.sourceInstance)\n });\n\n doWork(value);\n });\n }\n\n // If this is a one-time use, then destroy it after the first success comes through.\n if (config.oneTimeUse) {\n this.sourceInstance.success$.pipe(first(), delay(1000)).subscribe(() => {\n this.destroy();\n });\n }\n\n if (config.onSuccess) {\n this._successSub.subscription = this.sourceInstance.success$.subscribe(config.onSuccess);\n }\n }\n\n override destroy(): void {\n super.destroy();\n this._handleValueReadySub.destroy();\n this._successSub.destroy();\n this._isShutdown = true;\n }\n\n get config() {\n return this._config;\n }\n\n get isShutdown(): boolean {\n return this._isShutdown;\n }\n}\n\n/**\n * DbxActionContextMachine configured for use as a Service/Injectable.\n */\n@Injectable()\nexport class DbxActionContextMachineAsService<T = unknown, O = unknown> extends DbxActionContextMachine<T, O> {\n constructor() {\n super({\n oneTimeUse: false,\n handleValueReady: false\n });\n\n clean(() => this.destroy());\n }\n}\n","import { forwardRef, type Provider, type Type } from '@angular/core';\nimport { ActionContextStoreSource, DbxActionContextStoreSourceInstance, SecondaryActionContextStoreSource } from './action.store.source';\nimport { DbxActionContextMachineAsService } from './action.machine';\nimport { clean } from '../rxjs/clean';\n\n/**\n * Provides an ActionContextStoreSource, as well as an DbxActionContextStoreSourceInstance.\n */\nexport function provideActionStoreSource<S extends ActionContextStoreSource>(sourceType: Type<S> | null): Provider[] {\n const storeSourceProvider: Provider =\n sourceType != null\n ? {\n provide: ActionContextStoreSource,\n useExisting: forwardRef(() => sourceType)\n }\n : {\n provide: ActionContextStoreSource,\n useFactory: () => new DbxActionContextMachineAsService()\n };\n\n return [\n storeSourceProvider,\n {\n provide: DbxActionContextStoreSourceInstance,\n useFactory: (source: ActionContextStoreSource) => clean(new DbxActionContextStoreSourceInstance(source)),\n deps: [ActionContextStoreSource]\n }\n ];\n}\n\nexport function provideSecondaryActionStoreSource<S extends SecondaryActionContextStoreSource>(sourceType: Type<S>): Provider[] {\n return [\n {\n provide: SecondaryActionContextStoreSource,\n useExisting: forwardRef(() => sourceType)\n },\n ...provideActionStoreSource(sourceType)\n ];\n}\n","import { Directive, inject } from '@angular/core';\nimport { SecondaryActionContextStoreSource } from '../../action.store.source';\nimport { provideActionStoreSource } from '../../action.store.source.provide';\nimport { DbxActionContextBaseSource } from '../../action.holder';\nimport { clean } from '../../../rxjs/clean';\n\n/**\n * Provides an DbxAction/DbxActionContext.\n */\n@Directive({\n selector: 'dbx-action,[dbxAction]',\n exportAs: 'action,dbxAction',\n providers: provideActionStoreSource(DbxActionDirective),\n standalone: true\n})\nexport class DbxActionDirective<T = unknown, O = unknown> extends DbxActionContextBaseSource<T, O> {\n constructor() {\n super(inject(SecondaryActionContextStoreSource<T, O>, { optional: true, host: true }));\n\n // during cleaning/onDestroy, queue the lockset for cleanup\n clean(() => {\n this.lockSet.destroyOnNextUnlock(() => {\n this.destroy();\n });\n });\n }\n}\n","import { filterMaybe } from '@dereekb/rxjs';\nimport { Directive, input } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { switchMap } from 'rxjs';\nimport { SecondaryActionContextStoreSource, ActionContextStoreSource, actionContextStoreSourcePipe } from '../../action.store.source';\nimport { provideSecondaryActionStoreSource } from '../../action.store.source.provide';\nimport { toObservable } from '@angular/core/rxjs-interop';\n\n/**\n * Directive that provides a DbxActionSourceDirective that is passed in.\n */\n@Directive({\n selector: '[dbxActionSource]',\n providers: provideSecondaryActionStoreSource(DbxActionSourceDirective),\n standalone: true\n})\nexport class DbxActionSourceDirective implements SecondaryActionContextStoreSource {\n readonly dbxActionSource = input<Maybe<ActionContextStoreSource>>();\n\n readonly store$ = toObservable(this.dbxActionSource).pipe(\n filterMaybe(),\n switchMap((x) => actionContextStoreSourcePipe(x.store$))\n );\n}\n","import { Directive, inject } from '@angular/core';\nimport { cleanSubscriptionWithLockSet } from '../../../rxjs/lockset';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\n\n/**\n * Prints out the current state to the console. Useful for debugging.\n */\n@Directive({\n selector: '[dbxActionLogger],[dbxActionContextLogger]',\n standalone: true\n})\nexport class DbxActionContextLoggerDirective {\n readonly source = inject(DbxActionContextStoreSourceInstance, { host: true });\n\n constructor() {\n cleanSubscriptionWithLockSet({\n lockSet: this.source.lockSet,\n sub: this.source.state$.subscribe((state) => {\n console.log('dbxActionLogger - state: ', state);\n })\n });\n }\n}\n","import { BehaviorSubject, distinctUntilChanged, map, type Observable, of, shareReplay, switchMap } from 'rxjs';\nimport { type ActionContextStoreSource, actionContextStoreSourcePipe } from '../../action.store.source';\nimport { type Destroyable } from '@dereekb/util';\n\n/**\n * Arbitrary string used to identify an action.\n */\nexport type ActionKey = string;\n\n/**\n * Map that returns sources for ActionKey values.\n */\nexport abstract class ActionContextStoreSourceMap<T = unknown, O = unknown> implements Destroyable {\n /**\n * Returns the read-only map of action keys to sources.\n */\n abstract readonly actionKeySourceMap$: Observable<Map<ActionKey, ActionContextStoreSource<T, O>>>;\n /**\n * Returns a ActionContextStoreSource for the input action key.\n *\n * @param key Action key to retrieve the source for.\n */\n abstract sourceForKey(key: ActionKey): ActionContextStoreSource<T, O>;\n /**\n * Adds the store source for the input key.\n * @param key Action key to add the source for.\n * @param source Store source to add.\n */\n abstract addStoreSource(key: ActionKey, source: ActionContextStoreSource<T, O>): void;\n /**\n * Removes the store source for the input key.\n * @param key Action key to remove the source for.\n */\n abstract removeStoreSource(key: ActionKey): void;\n /**\n * Destroys the map.\n */\n abstract destroy(): void;\n}\n\n/**\n * Creates a new ActionContextStoreSourceMap.\n *\n * @returns A new ActionContextStoreSourceMap.\n */\nexport function actionContextStoreSourceMap<T = unknown, O = unknown>(): ActionContextStoreSourceMap<T, O> {\n const _actionKeySourceMap = new BehaviorSubject<Map<ActionKey, ActionContextStoreSource<T, O>>>(new Map());\n const actionKeySourceMap$ = _actionKeySourceMap.asObservable();\n\n function updateMap(fn: (map: Map<ActionKey, ActionContextStoreSource<T, O>>) => Map<ActionKey, ActionContextStoreSource<T, O>> | void): void {\n const currentMap = _actionKeySourceMap.value;\n const nextMap = fn(currentMap) ?? currentMap;\n _actionKeySourceMap.next(nextMap);\n }\n\n function sourceForKey(key: ActionKey): ActionContextStoreSource<T, O> {\n const _store$ = actionKeySourceMap$.pipe(\n map((x) => x.get(key)),\n distinctUntilChanged(),\n switchMap((x) => x?.store$ ?? of(undefined)),\n shareReplay(1)\n );\n\n const source: ActionContextStoreSource<T, O> = {\n store$: actionContextStoreSourcePipe(_store$)\n };\n\n return source;\n }\n\n function addStoreSource(key: ActionKey, source: ActionContextStoreSource<T, O>): void {\n updateMap((actionKeySourceMap) => {\n if (actionKeySourceMap.has(key)) {\n throw new Error(`Key already existed for \"${key}\" in map. Ensure the previous store is removed before setting another.`);\n } else if (!source) {\n throw new Error('addStoreSource requires a source.');\n }\n\n actionKeySourceMap.set(key, source);\n return actionKeySourceMap;\n });\n }\n\n function removeStoreSource(key: ActionKey): void {\n updateMap((actionKeySourceMap) => {\n if (!actionKeySourceMap.delete(key)) {\n console.warn('removeStore called and no value was found.');\n }\n\n return actionKeySourceMap;\n });\n }\n\n function destroy(): void {\n _actionKeySourceMap.complete();\n }\n\n const result: ActionContextStoreSourceMap<T, O> = {\n actionKeySourceMap$: actionKeySourceMap$,\n sourceForKey: sourceForKey,\n addStoreSource: addStoreSource,\n removeStoreSource: removeStoreSource,\n destroy\n };\n\n return result;\n}\n","import { Directive, inject } from '@angular/core';\nimport { actionContextStoreSourceMap, ActionContextStoreSourceMap } from './action.map';\nimport { clean } from '../../../rxjs/clean';\n\n/**\n * Context used for providing actions based on the action key.\n *\n * This is useful for passing action contexts around via the providers instead of explicit injection.\n */\n@Directive({\n selector: '[dbxActionContextMap]',\n providers: [\n {\n provide: ActionContextStoreSourceMap,\n useFactory: actionContextStoreSourceMap\n }\n ],\n exportAs: 'actionMap',\n standalone: true\n})\nexport class DbxActionContextMapDirective {\n readonly actionContextStoreSourceMap = clean(inject(ActionContextStoreSourceMap));\n}\n","import { filterMaybe } from '@dereekb/rxjs';\nimport { Directive, inject, input } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { switchMap } from 'rxjs';\nimport { ActionContextStoreSourceMap, ActionKey } from './action.map';\nimport { SecondaryActionContextStoreSource } from '../../action.store.source';\nimport { provideSecondaryActionStoreSource } from '../../action.store.source.provide';\nimport { toObservable } from '@angular/core/rxjs-interop';\n\n/**\n * Directive that provides a ActionContextStoreSource using the input key and DbxActionContextMapDirective.\n */\n@Directive({\n selector: '[dbxActionFromMap]',\n providers: provideSecondaryActionStoreSource(DbxActionFromMapDirective),\n standalone: true\n})\nexport class DbxActionFromMapDirective implements SecondaryActionContextStoreSource {\n private readonly _actionContextStoreSourceMap = inject(ActionContextStoreSourceMap);\n\n readonly key = input<Maybe<ActionKey>>(undefined, { alias: 'dbxActionFromMap' });\n readonly key$ = toObservable(this.key);\n\n readonly store$ = this.key$.pipe(\n filterMaybe(),\n switchMap((x) => this._actionContextStoreSourceMap.sourceForKey(x).store$)\n );\n}\n","import { Directive, OnDestroy, effect, inject, input } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { ActionContextStoreSource } from '../../action.store.source';\nimport { ActionContextStoreSourceMap, ActionKey } from './action.map';\n\n/**\n * Used to communicate with an dbxActionMap and set the ActionContextStore to the store based on the key.\n */\n@Directive({\n selector: '[dbxActionMapSource]',\n standalone: true\n})\nexport class DbxActionMapSourceDirective implements OnDestroy {\n private readonly _actionContextStoreSourceMap = inject(ActionContextStoreSourceMap);\n\n readonly source = inject(ActionContextStoreSource, { host: true });\n\n readonly key = input<Maybe<ActionKey>>(undefined, { alias: 'dbxActionMapSource' });\n private _currentKey: Maybe<ActionKey>;\n\n protected readonly _keyEffect = effect(() => {\n const nextKey = this.key();\n\n if (this._currentKey !== nextKey) {\n this._removeFromToStore();\n }\n\n this._currentKey = nextKey;\n this._addToStore();\n });\n\n ngOnDestroy(): void {\n this._removeFromToStore();\n }\n\n private _addToStore(): void {\n if (this._currentKey) {\n this._actionContextStoreSourceMap.addStoreSource(this._currentKey, this.source);\n }\n }\n\n private _removeFromToStore(): void {\n if (this._currentKey) {\n this._actionContextStoreSourceMap.removeStoreSource(this._currentKey);\n }\n }\n}\n","import { asObservable, combineLatestFromMapValuesObsFn, type IsCheckFunction, type ObservableOrValue } from '@dereekb/rxjs';\nimport { map, type Observable, switchMap } from 'rxjs';\nimport { type ActionContextStore } from '../../action.store';\nimport { type ActionContextStoreSourceMap, type ActionKey } from './action.map';\nimport { type ActionContextStoreSource } from '../../action.store.source';\nimport { reduceBooleansWithOrFn } from '@dereekb/util';\n\n/**\n * Utility interface that provides a set of functions to read from an ActionContextStoreSourceMap.\n */\nexport interface ActionContextStoreSourceMapReader<T = unknown, O = unknown> {\n /**\n * The input key source map.\n */\n readonly actionKeySourceMap$: Observable<Map<ActionKey, ActionContextStoreSource<T, O>>>;\n\n /**\n * Checks if any of the stores in the map match the input checkFunction.\n *\n * @param checkFunction Function to apply to each store.\n * @param emptyArrayValue Value to return if the map is empty.\n */\n checkAny(checkFunction: IsCheckFunction<ActionContextStore<T, O>>, emptyArrayValue?: boolean): Observable<boolean>;\n\n /**\n * Reduces a value from all stores in the map.\n *\n * @param mapFn Function to apply to each store.\n * @param reduceFn Function to apply to the results of the mapFn.\n */\n reduceFromAllSources<X, Y>(mapFn: (input: ActionContextStore<T, O>) => Observable<X>, reduceFn: (values: X[]) => Y): Observable<Y>;\n\n /**\n * Reads a value from each store in the map and returns an array of the results.\n *\n * @param mapFn Function to apply to each store.\n */\n fromAllSources<Y>(mapFn: (input: ActionContextStore<T, O>) => Observable<Y>): Observable<Y[]>;\n}\n\n/**\n * Creates a new ActionContextStoreSourceMapReader from the input.\n \n * @param actionKeySourceMap$ \n */\nexport function actionContextStoreSourceMapReader<T = unknown, O = unknown>(actionKeySourceMap$: ObservableOrValue<Map<ActionKey, ActionContextStoreSource<T, O>>>): ActionContextStoreSourceMapReader<T, O> {\n const sourceMap$ = asObservable(actionKeySourceMap$);\n\n function checkAnyAre(mapFn: (input: ActionContextStore<T, O>) => Observable<boolean>, emptyArrayValue?: boolean): Observable<boolean> {\n return reduceFromAllSources(mapFn, reduceBooleansWithOrFn(emptyArrayValue));\n }\n\n function reduceFromAllSources<X, Y>(mapFn: (input: ActionContextStore<T, O>) => Observable<X>, reduceFn: (values: X[]) => Y): Observable<Y> {\n return fromAllSources<X>(mapFn).pipe(map(reduceFn));\n }\n\n function fromAllSources<Y>(mapFn: (input: ActionContextStore<T, O>) => Observable<Y>): Observable<Y[]> {\n return sourceMap$.pipe(switchMap(combineLatestFromMapValuesObsFn((x) => x.store$.pipe(switchMap(mapFn)))));\n }\n\n return {\n actionKeySourceMap$: sourceMap$,\n fromAllSources,\n checkAny: checkAnyAre,\n reduceFromAllSources\n };\n}\n\n/**\n * Returns an Observable of the results of the mapFn for each source in the actionKeySourceMap$.\n *\n * @param actionKeySourceMap$ Observable of the action key source map.\n * @param mapFn Function to apply to each source.\n * @returns Observable of the results of the mapFn for each source.\n */\nexport function fromAllActionContextStoreSourceMapSources<O>(actionKeySourceMap$: ObservableOrValue<ActionContextStoreSourceMap>, mapFn: (input: ActionContextStore) => Observable<O>): Observable<O[]> {\n return asObservable(actionKeySourceMap$).pipe(\n switchMap((x) => x.actionKeySourceMap$),\n switchMap(combineLatestFromMapValuesObsFn((x) => x.store$.pipe(switchMap(mapFn))))\n );\n}\n","import { Directive, inject, input } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { clean, cleanSubscription } from '../../../rxjs';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { type DbxActionDisabledKey } from '../../action';\nimport { actionContextStoreSourceMapReader } from './action.map.utility';\nimport { ActionContextStoreSourceMap } from './action.map';\n\nexport const DEFAULT_ACTION_MAP_WORKING_DISABLED_KEY = 'action_map_working_disable';\n\n/**\n * Used to communicate with an dbxActionMap and set the ActionContextStore to be disabled if any other element in the map is working.\n */\n@Directive({\n selector: '[dbxActionMapWorkingDisable]',\n standalone: true\n})\nexport class DbxActionMapWorkingDisableDirective {\n private readonly _actionContextStoreSourceMap = inject(ActionContextStoreSourceMap);\n\n readonly source = inject(DbxActionContextStoreSourceInstance, { host: true });\n\n readonly disabledKey = input<Maybe<DbxActionDisabledKey>>(undefined, { alias: 'dbxActionMapWorkingDisable' });\n\n readonly areAnySourcesWorking$ = actionContextStoreSourceMapReader(this._actionContextStoreSourceMap.actionKeySourceMap$).checkAny((x) => x.isWorking$, false);\n\n constructor() {\n cleanSubscription(\n this.areAnySourcesWorking$.subscribe((x) => {\n this.source.disable(this.disabledKey() || DEFAULT_ACTION_MAP_WORKING_DISABLED_KEY, x);\n })\n );\n\n clean(() => {\n this.source.enable(this.disabledKey() || DEFAULT_ACTION_MAP_WORKING_DISABLED_KEY);\n });\n }\n}\n","import { Directive, inject, input } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { clean, cleanSubscription } from '../../../rxjs';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { toObservable } from '@angular/core/rxjs-interop';\n\nexport const APP_ACTION_DISABLED_DIRECTIVE_KEY = 'dbx_action_disabled';\n\n/**\n * Directive that allows disabling an action using the inputs.\n */\n@Directive({\n selector: '[dbxActionDisabled]',\n standalone: true\n})\nexport class DbxActionDisabledDirective<T, O> {\n readonly source = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n\n readonly disabled = input<boolean, Maybe<boolean | ''>>(false, { alias: 'dbxActionDisabled', transform: (value) => value !== false });\n readonly disabled$ = toObservable(this.disabled);\n\n constructor() {\n cleanSubscription(\n this.disabled$.subscribe((x) => {\n this.source.disable(APP_ACTION_DISABLED_DIRECTIVE_KEY, x);\n })\n );\n\n clean(() => this.source.enable(APP_ACTION_DISABLED_DIRECTIVE_KEY));\n }\n}\n","import { Directive, inject, input } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { combineLatest } from 'rxjs';\nimport { clean, cleanSubscription } from '../../../rxjs';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { toObservable } from '@angular/core/rxjs-interop';\n\nexport const APP_ACTION_DISABLED_ON_SUCCESS_DIRECTIVE_KEY = 'dbx_action_disabled_on_success';\n\n/**\n * Directive that will disable the action after the action completes successfully.\n */\n@Directive({\n selector: '[dbxActionDisabledOnSuccess]',\n standalone: true\n})\nexport class DbxActionDisabledOnSuccessDirective<T, O> {\n readonly source = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n\n readonly disabledOnSuccess = input<boolean, Maybe<boolean | ''>>(true, { alias: 'dbxActionDisabledOnSuccess', transform: (value) => value !== false });\n readonly disabledOnSuccess$ = toObservable(this.disabledOnSuccess);\n\n constructor() {\n cleanSubscription(\n combineLatest([this.disabledOnSuccess$, this.source.isSuccess$]).subscribe(([disableOnSuccess, success]) => {\n this.source.disable(APP_ACTION_DISABLED_ON_SUCCESS_DIRECTIVE_KEY, disableOnSuccess && success);\n })\n );\n\n clean(() => this.source.enable(APP_ACTION_DISABLED_ON_SUCCESS_DIRECTIVE_KEY));\n }\n}\n","import { map, shareReplay, switchMap, tap, BehaviorSubject, combineLatest } from 'rxjs';\nimport { type DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { DbxActionWorkInstanceDelegate } from '../../action.handler';\nimport { type Maybe, type Destroyable, type Initialized, type GetterOrValue, asGetter, type FactoryWithInput } from '@dereekb/util';\nimport { filterMaybe, SubscriptionObject, type Work, workFactory } from '@dereekb/rxjs';\n\nexport const DBX_ACTION_HANDLER_LOCK_KEY = 'dbxActionHandler';\n\n/**\n * Context used for defining a function that performs an action using the input function to handle valueReady$ events from an action context.\n */\nexport class DbxActionHandlerInstance<T = unknown, O = unknown> implements Initialized, Destroyable {\n private readonly _delegate: DbxActionWorkInstanceDelegate<T, O>;\n\n private readonly _sub = new SubscriptionObject();\n private readonly _handlerFunction = new BehaviorSubject<Maybe<Work<T, O>>>(undefined);\n private readonly _handlerValue = new BehaviorSubject<Maybe<GetterOrValue<O> | FactoryWithInput<O, T>>>(undefined);\n\n readonly handlerFunction$ = combineLatest([this._handlerValue, this._handlerFunction]).pipe(\n map(([handlerValue, handlerFunction]) => {\n let work: Maybe<Work<T, O>>;\n\n if (handlerFunction != null) {\n work = handlerFunction;\n } else if (handlerValue !== undefined) {\n const getter = asGetter(handlerValue) as FactoryWithInput<O, T>;\n work = (x, c) => c.performTaskWithReturnValue(() => getter(x));\n }\n\n return work;\n }),\n filterMaybe(),\n shareReplay(1)\n );\n\n constructor(source: DbxActionContextStoreSourceInstance<T, O>) {\n this._delegate = new DbxActionWorkInstanceDelegate<T, O>(source);\n }\n\n get source(): DbxActionContextStoreSourceInstance<T, O> {\n return this._delegate.source;\n }\n\n get handlerFunction(): Maybe<Work<T, O>> {\n return this._handlerFunction.value;\n }\n\n get handlerValue(): Maybe<GetterOrValue<O> | FactoryWithInput<O, T>> {\n return this._handlerValue.value;\n }\n\n setHandlerFunction(handlerFunction: Maybe<Work<T, O>>): void {\n this._handlerFunction.next(handlerFunction);\n }\n\n setHandlerValue(handlerValue: Maybe<GetterOrValue<O> | FactoryWithInput<O, T>>): void {\n this._handlerValue.next(handlerValue);\n }\n\n init(): void {\n this._sub.subscription = this.handlerFunction$\n .pipe(\n switchMap((work) =>\n this.source.valueReady$.pipe(\n tap((value) => {\n const context = workFactory({ work, delegate: this._delegate })(value);\n\n if (context) {\n // Add the action to the lockSet for the source to prevent it from being destroyed until the action completes.\n this.source.lockSet.addLock(DBX_ACTION_HANDLER_LOCK_KEY, context.isComplete$.pipe(map((x) => !x)));\n }\n })\n )\n )\n )\n .subscribe();\n }\n\n destroy(): void {\n this.source.lockSet.onNextUnlock(() => {\n this._sub.destroy();\n this._handlerFunction.complete();\n });\n }\n}\n","import { Directive, effect, inject, input } from '@angular/core';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { FactoryWithInput, GetterOrValue, type Maybe } from '@dereekb/util';\nimport { DbxActionHandlerInstance } from './action.handler.instance';\nimport { Work } from '@dereekb/rxjs';\nimport { clean } from '../../../rxjs';\n\n/**\n * Abstract directive that wraps and handles a DbxActionHandlerInstance lifecycle.\n */\n@Directive()\nexport abstract class AbstractDbxActionHandlerDirective<T = unknown, O = unknown> {\n readonly source: DbxActionContextStoreSourceInstance<T, O> = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n\n protected readonly _dbxActionHandlerInstance = clean(new DbxActionHandlerInstance<T, O>(this.source));\n\n constructor() {\n this._dbxActionHandlerInstance.init();\n }\n}\n\n/**\n * Directive that passes a Work function to handle a valueReady$ event from an action context.\n */\n@Directive({\n selector: '[dbxActionHandler]',\n standalone: true\n})\nexport class DbxActionHandlerDirective<T = unknown, O = unknown> extends AbstractDbxActionHandlerDirective<T, O> {\n readonly handlerFunction = input.required<Maybe<Work<T, O>>>({ alias: 'dbxActionHandler' });\n\n protected readonly _handlerFunctionEffect = effect(() => {\n this._dbxActionHandlerInstance.setHandlerFunction(this.handlerFunction());\n });\n}\n\n/**\n * Directive that passes a value to handle a valueReady$ event from an action context.\n */\n@Directive({\n selector: '[dbxActionHandlerValue]',\n standalone: true\n})\nexport class DbxActionHandlerValueDirective<T = unknown, O = unknown> extends AbstractDbxActionHandlerDirective<T, O> {\n readonly handlerValue = input.required<Maybe<GetterOrValue<O> | FactoryWithInput<O, T>>>({ alias: 'dbxActionHandlerValue' });\n protected readonly _handlerValueEffect = effect(() => {\n this._dbxActionHandlerInstance.setHandlerValue(this.handlerValue());\n });\n}\n","import { Directive, OnInit, TemplateRef, ViewContainerRef, inject } from '@angular/core';\nimport { distinctUntilChanged, Observable } from 'rxjs';\nimport { cleanSubscription } from '../rxjs/subscription';\n\n/**\n * Abstract directive class that watches a show$ observable and behaves like *ngIf.\n */\n@Directive()\nexport abstract class AbstractIfDirective implements OnInit {\n private readonly _templateRef = inject(TemplateRef);\n private readonly _viewContainer = inject(ViewContainerRef);\n\n /**\n * Observable that is watched for showing/hiding.\n */\n abstract readonly show$: Observable<boolean>;\n\n private readonly _sub = cleanSubscription();\n\n ngOnInit() {\n this._sub.subscription = this.show$.pipe(distinctUntilChanged()).subscribe((show) => {\n if (show) {\n this._viewContainer.createEmbeddedView(this._templateRef);\n } else {\n this._viewContainer.clear();\n }\n });\n }\n}\n","/**\n * Transforms an empty string to undefined.\n *\n * Used for Angular inputs that are optional and share the same alias as the directive.\n */\nexport const transformEmptyStringInputToUndefined = <T>(value: T | '') => (value === '' ? undefined : value);\n","import { Directive, inject, input } from '@angular/core';\nimport { emitDelayObs } from '@dereekb/rxjs';\nimport { type Maybe } from '@dereekb/util';\nimport { of, exhaustMap, shareReplay } from 'rxjs';\nimport { AbstractIfDirective } from '../../../view/if.directive';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { transformEmptyStringInputToUndefined } from '../../../util/input';\n\n/**\n * Structural directive that displays the content before the store has success.\n *\n * Can be configured to hide for a temporary period.\n */\n@Directive({\n selector: '[dbxActionIdle]',\n standalone: true\n})\nexport class DbxActionIdleDirective extends AbstractIfDirective {\n private readonly _store = inject(DbxActionContextStoreSourceInstance);\n\n readonly hideAfter = input<Maybe<number>, Maybe<number> | ''>(undefined, { alias: 'dbxActionIdle', transform: transformEmptyStringInputToUndefined });\n\n readonly show$ = this._store.idle$.pipe(\n exhaustMap((idle) => {\n if (idle) {\n return emitDelayObs(true, false, this.hideAfter());\n } else {\n return of(false);\n }\n }),\n shareReplay(1)\n );\n}\n","import { Directive, inject, input } from '@angular/core';\nimport { emitDelayObs } from '@dereekb/rxjs';\nimport { type Maybe } from '@dereekb/util';\nimport { of, exhaustMap, shareReplay } from 'rxjs';\nimport { AbstractIfDirective } from '../../../view/if.directive';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { transformEmptyStringInputToUndefined } from '../../../util/input';\n\n/**\n * Structural directive that displays the content before the store has success.\n *\n * Can be configured to hide for a temporary period.\n */\n@Directive({\n selector: '[dbxActionPreSuccess]',\n standalone: true\n})\nexport class DbxActionPreSuccessDirective extends AbstractIfDirective {\n private readonly _store = inject(DbxActionContextStoreSourceInstance);\n\n readonly hideFor = input<Maybe<number>, Maybe<number> | ''>(undefined, { alias: 'dbxActionPreSuccess', transform: transformEmptyStringInputToUndefined });\n\n readonly show$ = this._store.isSuccess$.pipe(\n exhaustMap((success) => {\n if (success) {\n return emitDelayObs(false, true, this.hideFor());\n } else {\n return of(true);\n }\n }),\n shareReplay(1)\n );\n}\n","import { Directive, inject, input } from '@angular/core';\nimport { emitDelayObs } from '@dereekb/rxjs';\nimport { type Maybe } from '@dereekb/util';\nimport { of, exhaustMap, shareReplay } from 'rxjs';\nimport { AbstractIfDirective } from '../../../view/if.directive';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { transformEmptyStringInputToUndefined } from '../../../util/input';\n\n/**\n * Structural directive that displays the content when the store has a success value.\n *\n * Can be configured to show for a temporary period.\n */\n@Directive({\n selector: '[dbxActionHasSuccess]',\n standalone: true\n})\nexport class DbxActionHasSuccessDirective extends AbstractIfDirective {\n private readonly _store = inject(DbxActionContextStoreSourceInstance);\n\n readonly hideAfter = input<Maybe<number>, Maybe<number> | ''>(undefined, { alias: 'dbxActionHasSuccess', transform: transformEmptyStringInputToUndefined });\n\n readonly show$ = this._store.isSuccess$.pipe(\n exhaustMap((success) => {\n if (success) {\n return emitDelayObs(true, false, this.hideAfter());\n } else {\n return of(false);\n }\n }),\n shareReplay(1)\n );\n}\n","import { map, tap, shareReplay, switchMap } from 'rxjs';\nimport { filterMaybe } from '@dereekb/rxjs';\nimport { Directive, inject, input } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { cleanSubscriptionWithLockSet } from '../../../rxjs';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { toObservable } from '@angular/core/rxjs-interop';\n\n/**\n * Performs the action on success.\n */\nexport type DbxActionSuccessHandlerFunction<O = unknown> = (value: O) => void;\n\n/**\n * Directive that executes a function on ActionContextStore Success.\n */\n@Directive({\n selector: '[dbxActionSuccessHandler]',\n standalone: true\n})\nexport class DbxActionSuccessHandlerDirective<T, O> {\n readonly source = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n\n readonly dbxActionSuccessHandler = input<Maybe<DbxActionSuccessHandlerFunction<O>>>();\n readonly successFunction$ = toObservable(this.dbxActionSuccessHandler).pipe(filterMaybe(), shareReplay(1));\n\n constructor() {\n cleanSubscriptionWithLockSet({\n lockSet: this.source.lockSet,\n sub: this.successFunction$\n .pipe(\n switchMap((successFunction) =>\n this.source.success$.pipe(\n map((x) => [successFunction, x] as [DbxActionSuccessHandlerFunction<O>, O]),\n tap(([successFn, result]) => {\n successFn(result);\n })\n )\n )\n )\n .subscribe()\n });\n }\n}\n","import { map, tap, shareReplay, switchMap } from 'rxjs';\nimport { filterMaybe } from '@dereekb/rxjs';\nimport { Directive, inject, input } from '@angular/core';\nimport { ReadableError, type Maybe } from '@dereekb/util';\nimport { cleanSubscriptionWithLockSet } from '../../../rxjs';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { toObservable } from '@angular/core/rxjs-interop';\n\n/**\n * Performs the action on error.\n */\nexport type DbxActionErrorHandlerFunction = (error?: Maybe<ReadableError>) => void;\n\n/**\n * Directive that executes a function on ActionContextStore error.\n */\n@Directive({\n selector: '[dbxActionErrorHandler]',\n standalone: true\n})\nexport class DbxActionErrorHandlerDirective<T, O> {\n readonly source = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n\n readonly dbxActionErrorHandler = input<Maybe<DbxActionErrorHandlerFunction>>();\n readonly errorFunction$ = toObservable(this.dbxActionErrorHandler).pipe(filterMaybe(), shareReplay(1));\n\n constructor() {\n cleanSubscriptionWithLockSet({\n lockSet: this.source.lockSet,\n sub: this.errorFunction$\n .pipe(\n switchMap((errorFunction) =>\n this.source.error$.pipe(\n filterMaybe(),\n map((x) => [errorFunction, x] as const),\n tap(([errorFn, error]) => {\n errorFn(error);\n })\n )\n )\n )\n .subscribe()\n });\n }\n}\n","import { Directive, inject, input } from '@angular/core';\nimport { getValueFromGetter, Maybe, GetterOrValue } from '@dereekb/util';\nimport { filterMaybe } from '@dereekb/rxjs';\nimport { BehaviorSubject, combineLatest, map, Observable, shareReplay, switchMap } from 'rxjs';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { toObservable } from '@angular/core/rxjs-interop';\nimport { cleanSubscriptionWithLockSet } from '../../../rxjs';\n\n/**\n * Directive that provides a default value when triggered.\n *\n * No value is required, allowing the directive to automatically call readyValue.\n *\n * The valueOrFunction will filter on null/undefined input and wait until the input value is non-null.\n *\n * Use a getter if null/undefined values should be passed to the action.\n */\n@Directive({\n selector: 'dbxActionValue,[dbxActionValue]',\n standalone: true\n})\nexport class DbxActionValueDirective<T, O> {\n readonly valueOrFunction = input<Maybe<GetterOrValue<T> | ''>>('', { alias: 'dbxActionValue' });\n\n readonly source = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n\n private readonly _valueOrFunctionOverride = new BehaviorSubject<Maybe<GetterOrValue<T>>>(undefined);\n\n readonly valueOrFunction$: Observable<GetterOrValue<T>> = combineLatest([this._valueOrFunctionOverride, toObservable(this.valueOrFunction)]).pipe(\n map(([x, y]) => x ?? (y as Maybe<GetterOrValue<T>>)),\n filterMaybe(),\n shareReplay(1)\n );\n\n constructor() {\n cleanSubscriptionWithLockSet({\n lockSet: this.source.lockSet,\n sub: this.valueOrFunction$.pipe(switchMap((valueOrFunction) => this.source.triggered$.pipe(map(() => valueOrFunction)))).subscribe((valueOrFunction) => {\n const value: T = getValueFromGetter(valueOrFunction);\n this.source.readyValue(value);\n })\n });\n }\n\n setValueOrFunction(value: Maybe<GetterOrValue<T>>) {\n this._valueOrFunctionOverride.next(value);\n }\n}\n","import { computed, Directive, inject, input } from '@angular/core';\nimport { emitDelayObs } from '@dereekb/rxjs';\nimport { type Maybe } from '@dereekb/util';\nimport { of, exhaustMap, shareReplay } from 'rxjs';\nimport { AbstractIfDirective } from '../../../view/if.directive';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { transformEmptyStringInputToUndefined } from '../../../util/input';\n\n/**\n * Structural directive that displays the content when the store is working.\n *\n * Can specify a period in milliseconds that shows how long to show up after working for a particular number of seconds.\n */\n@Directive({\n selector: '[dbxActionWorking],[dbxActionIsWorking]',\n standalone: true\n})\nexport class DbxActionIsWorkingDirective extends AbstractIfDirective {\n private readonly _store = inject(DbxActionContextStoreSourceInstance);\n\n readonly hideAfter = input<Maybe<number>, Maybe<number> | ''>(undefined, { alias: 'dbxActionWorking', transform: transformEmptyStringInputToUndefined });\n readonly hideAfterIsWorking = input<Maybe<number>, Maybe<number> | ''>(undefined, { alias: 'dbxActionIsWorking', transform: transformEmptyStringInputToUndefined });\n\n readonly hideAfterSignal = computed(() => {\n const hideAfter = this.hideAfter();\n const hideAfterIsWorking = this.hideAfterIsWorking();\n return hideAfter ?? hideAfterIsWorking;\n });\n\n readonly show$ = this._store.isWorking$.pipe(\n exhaustMap((isWorking) => {\n const hideAfter = this.hideAfterSignal();\n\n if (isWorking && hideAfter != null) {\n return emitDelayObs(true, false, hideAfter);\n } else {\n return of(isWorking);\n }\n }),\n shareReplay(1)\n );\n}\n","import { Directive, inject, input } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { combineLatest, delay } from 'rxjs';\nimport { clean, cleanSubscription } from '../../../rxjs';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { toObservable } from '@angular/core/rxjs-interop';\n\nexport const APP_ACTION_ENFORCE_MODIFIED_DIRECTIVE_KEY = 'dbx_action_enforce_modified';\n\n/**\n * Directive that toggles disabling an action if the action is not marked modified.\n */\n@Directive({\n selector: '[dbxActionEnforceModified]',\n standalone: true\n})\nexport class DbxActionEnforceModifiedDirective {\n readonly source = inject(DbxActionContextStoreSourceInstance, { host: true });\n\n readonly enabled = input<boolean, Maybe<boolean | ''>>(true, { alias: 'dbxActionEnforceModified', transform: (value) => value !== false });\n readonly enabled$ = toObservable(this.enabled);\n\n constructor() {\n cleanSubscription(\n combineLatest([this.source.isModified$, this.enabled$])\n .pipe(delay(0))\n .subscribe(([modified, enableDirective]) => {\n const disable = enableDirective && !modified;\n this.source.disable(APP_ACTION_ENFORCE_MODIFIED_DIRECTIVE_KEY, disable);\n })\n );\n\n clean(() => this.source.enable(APP_ACTION_ENFORCE_MODIFIED_DIRECTIVE_KEY));\n }\n}\n","import { toReadableError, type Destroyable, type Initialized, type Maybe, type ReadableError } from '@dereekb/util';\nimport { switchMap, map, catchError, of, BehaviorSubject, type Observable, shareReplay, combineLatestWith } from 'rxjs';\nimport { type ObservableOrValue, SubscriptionObject, type IsModifiedFunction, asObservable, returnIfIs, filterMaybe, type IsEqualFunction, makeIsModifiedFunctionObservable } from '@dereekb/rxjs';\nimport { type DbxActionContextStoreSourceInstance } from '../../action.store.source';\n\n/**\n * DbxActionValueGetterInstance function. Returns an ObervableGetter that returns a value.\n */\nexport type DbxActionValueGetterValueGetterFunction<T> = () => ObservableOrValue<Maybe<T>>;\n\nexport interface DbxActionValueGetterResult<T = unknown> {\n /**\n * The value to trigger with\n */\n readonly value?: Maybe<T>;\n /**\n * The error to reject with\n */\n readonly reject?: Maybe<ReadableError>;\n}\n\n/**\n * DbxActionValueGetterInstance configuration.\n */\nexport interface DbxActionValueGetterInstanceConfig<T> {\n readonly source: DbxActionContextStoreSourceInstance<T, unknown>;\n readonly valueGetter?: Maybe<DbxActionValueGetterValueGetterFunction<T>>;\n readonly isEqualFunction?: Maybe<IsEqualFunction<T>>;\n readonly isModifiedFunction?: Maybe<IsModifiedFunction<T>>;\n}\n\n/**\n * Utility class that handles trigger events to retrieve a value.\n */\nexport class DbxActionValueGetterInstance<T> implements Initialized, Destroyable {\n private readonly _valueGetterFunction = new BehaviorSubject<Maybe<DbxActionValueGetterValueGetterFunction<T>>>(undefined);\n readonly valueGetterFunction$ = this._valueGetterFunction.pipe(filterMaybe());\n\n private readonly _isModifiedFunction = new BehaviorSubject<Maybe<IsModifiedFunction<T>>>(undefined);\n private readonly _isEqualFunction = new BehaviorSubject<Maybe<IsEqualFunction<T>>>(undefined);\n\n readonly isModifiedFunction$: Observable<IsModifiedFunction<T>> = makeIsModifiedFunctionObservable({\n isModified: this._isModifiedFunction,\n isEqual: this._isEqualFunction\n }).pipe(shareReplay(1));\n\n readonly source: DbxActionContextStoreSourceInstance<T, unknown>;\n\n private readonly _triggeredSub = new SubscriptionObject();\n\n constructor(config: DbxActionValueGetterInstanceConfig<T>) {\n this.source = config.source;\n this.setValueGetterFunction(config.valueGetter);\n this.setIsModifiedFunction(config.isModifiedFunction);\n this.setIsEqualFunction(config.isEqualFunction);\n }\n\n setValueGetterFunction(valueGetterFunction: Maybe<DbxActionValueGetterValueGetterFunction<T>>) {\n this._valueGetterFunction.next(valueGetterFunction);\n }\n\n setIsModifiedFunction(isModifiedFunction: Maybe<IsModifiedFunction<T>>) {\n this._isModifiedFunction.next(isModifiedFunction);\n }\n\n setIsEqualFunction(isEqualFunction: Maybe<IsEqualFunction<T>>) {\n this._isEqualFunction.next(isEqualFunction);\n }\n\n init(): void {\n // Ready the value after the source is triggered. Do modified check one last time.\n this._triggeredSub.subscription = this.source.triggered$\n .pipe(\n switchMap(() =>\n this.valueGetterFunction$.pipe(\n switchMap((valueGetter) => asObservable(valueGetter())),\n combineLatestWith(this.isModifiedFunction$),\n // If the value is not null/undefined and is considered modified, then pass the value.\n switchMap(([value, isModifiedFunction]) => returnIfIs(isModifiedFunction, value, false).pipe(map((value) => ({ value })))),\n // Catch unknown errors and pass them to reject.\n catchError((reject) => of({ reject: toReadableError(reject) }))\n )\n )\n )\n .subscribe((result: DbxActionValueGetterResult<T>) => {\n if (result.value != null) {\n this.source.readyValue(result.value);\n } else {\n this.source.reject(result.reject);\n }\n });\n }\n\n destroy(): void {\n this.source.lockSet.onNextUnlock(() => {\n this._valueGetterFunction.complete();\n this._isModifiedFunction.complete();\n this._isEqualFunction.complete();\n this._triggeredSub.destroy();\n });\n }\n}\n","import { Directive, Injector, Signal, effect, inject, input, runInInjectionContext } from '@angular/core';\nimport { IsEqualFunction, IsModifiedFunction } from '@dereekb/rxjs';\nimport { type Maybe } from '@dereekb/util';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { DbxActionValueGetterValueGetterFunction, DbxActionValueGetterInstance } from './action.value.trigger.instance';\nimport { clean } from '../../../rxjs/clean';\n\nexport interface DbxActionValueGetterDirectiveComputeInputsConfig<T> {\n readonly valueGetterSignal?: Signal<Maybe<DbxActionValueGetterValueGetterFunction<T>>>;\n readonly isModifiedSignal?: Signal<Maybe<IsModifiedFunction>>;\n readonly isEqualSignal?: Signal<Maybe<IsEqualFunction>>;\n}\n\n/**\n * Abstract class for directives that may perform an action when trigger is called, and returns a value.\n */\n@Directive()\nexport abstract class AbstractDbxActionValueGetterDirective<T> {\n private readonly _injector = inject(Injector);\n\n readonly source = inject(DbxActionContextStoreSourceInstance<T, unknown>);\n\n private readonly _triggerInstance: DbxActionValueGetterInstance<T> = new DbxActionValueGetterInstance<T>({\n source: this.source\n });\n\n constructor() {\n this._triggerInstance.init();\n clean(this._triggerInstance);\n }\n\n setValueGetterFunction(valueGetterFunction: Maybe<DbxActionValueGetterValueGetterFunction<T>>) {\n this._triggerInstance.setValueGetterFunction(valueGetterFunction);\n }\n\n protected configureInputs(config: DbxActionValueGetterDirectiveComputeInputsConfig<T>): void {\n runInInjectionContext(this._injector, () => {\n effect(() => {\n if (config?.isModifiedSignal != null) {\n const isModified = config?.isModifiedSignal();\n this._triggerInstance.setIsModifiedFunction(isModified);\n }\n\n if (config?.isEqualSignal != null) {\n const isEqual = config?.isEqualSignal();\n this._triggerInstance.setIsEqualFunction(isEqual);\n }\n\n if (config?.valueGetterSignal != null) {\n const valueGetter = config?.valueGetterSignal();\n this._triggerInstance.setValueGetterFunction(valueGetter);\n }\n });\n });\n }\n}\n\n/**\n * Action directive that uses a getter function instead and waits for the trigger to be called before calling the function.\n *\n * Similar to DbxActionValueDirective, but the getter is called when a trigger is activated.\n * The DbxActionValueDirective always pipes the latests value while waiting for a trigger, and does not allow using a getter.\n */\n@Directive({\n exportAs: 'dbxActionValueGetter',\n selector: '[dbxActionValueGetter]',\n standalone: true\n})\nexport class DbxActionValueTriggerDirective<T = object> extends AbstractDbxActionValueGetterDirective<T> {\n readonly dbxActionValueGetter = input<Maybe<DbxActionValueGetterValueGetterFunction<T>>>();\n readonly dbxActionValueGetterIsModified = input<Maybe<IsModifiedFunction>>();\n readonly dbxActionValueGetterIsEqual = input<Maybe<IsEqualFunction>>();\n\n constructor() {\n super();\n this.configureInputs({\n valueGetterSignal: this.dbxActionValueGetter,\n isModifiedSignal: this.dbxActionValueGetterIsModified,\n isEqualSignal: this.dbxActionValueGetterIsEqual\n });\n }\n}\n","import { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { switchMap, mergeMap, map, withLatestFrom, shareReplay, Observable, of, EMPTY } from 'rxjs';\nimport { Directive, inject, input } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { IsEqualFunction, IsModifiedFunction, makeIsModifiedFunctionObservable } from '@dereekb/rxjs';\nimport { toObservable } from '@angular/core/rxjs-interop';\nimport { cleanSubscriptionWithLockSet } from '../../../rxjs';\n\n/**\n * Directive that watches a value observable for changes and sets the new value and modified states as necessary.\n */\n@Directive({\n selector: '[dbxActionValueStream]',\n standalone: true\n})\nexport class DbxActionValueStreamDirective<T, O> {\n readonly source = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n\n readonly dbxActionValueStream = input<Observable<T>>(EMPTY);\n readonly dbxActionValueStreamIsEqualValue = input<Maybe<IsEqualFunction<T>>>();\n readonly dbxActionValueStreamIsModifiedValue = input<Maybe<IsModifiedFunction<T>>>();\n\n readonly isModifiedFunction$: Observable<IsModifiedFunction<T>> = makeIsModifiedFunctionObservable({\n isModified: toObservable(this.dbxActionValueStreamIsModifiedValue),\n isEqual: toObservable(this.dbxActionValueStreamIsEqualValue)\n }).pipe(shareReplay(1));\n\n readonly modifiedValue$ = toObservable(this.dbxActionValueStream).pipe(\n switchMap((obs) =>\n obs.pipe(\n withLatestFrom(this.isModifiedFunction$),\n mergeMap(([value, dbxActionValueStreamModified]) => {\n let result: Observable<[boolean, T]>;\n\n if (dbxActionValueStreamModified) {\n result = dbxActionValueStreamModified(value).pipe(map((isModified) => [isModified, value] as [boolean, T]));\n } else {\n result = of([true, value]);\n }\n\n return result;\n }),\n shareReplay(1)\n )\n )\n );\n\n constructor() {\n // Update isModified on source\n cleanSubscriptionWithLockSet({\n lockSet: this.source.lockSet,\n sub: this.modifiedValue$.subscribe(([isModified]) => {\n this.source.setIsModified(isModified);\n })\n });\n\n // Set the value on triggers.\n cleanSubscriptionWithLockSet({\n lockSet: this.source.lockSet,\n sub: this.source.triggered$.pipe(switchMap(() => this.modifiedValue$)).subscribe(([isModified, value]) => {\n // only mark ready once modified\n if (isModified) {\n this.source.readyValue(value);\n }\n })\n });\n }\n}\n","import { Directive, inject, input } from '@angular/core';\nimport { emitDelayObs } from '@dereekb/rxjs';\nimport { type Maybe } from '@dereekb/util';\nimport { of, exhaustMap, shareReplay } from 'rxjs';\nimport { AbstractIfDirective } from '../../../view/if.directive';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { transformEmptyStringInputToUndefined } from '../../../util/input';\n\n/**\n * Structural directive that displays the content when the store has been triggered.\n *\n * Can be configured to hide for a temporary period.\n */\n@Directive({\n selector: '[dbxActionTriggered]',\n standalone: true\n})\nexport class DbxActionTriggeredDirective extends AbstractIfDirective {\n private readonly _store = inject(DbxActionContextStoreSourceInstance);\n\n readonly hideAfter = input<Maybe<number>, Maybe<number> | ''>(undefined, { alias: 'dbxActionTriggered', transform: transformEmptyStringInputToUndefined });\n\n readonly show$ = this._store.triggered$.pipe(\n exhaustMap((triggered) => {\n if (triggered) {\n return emitDelayObs(true, false, this.hideAfter());\n } else {\n return of(false);\n }\n }),\n shareReplay(1)\n );\n}\n","import { NgModule } from '@angular/core';\nimport {\n DbxActionDirective,\n DbxActionContextMapDirective,\n DbxActionFromMapDirective,\n DbxActionMapSourceDirective,\n DbxActionMapWorkingDisableDirective,\n DbxActionSourceDirective,\n DbxActionHandlerDirective,\n DbxActionDisabledDirective,\n DbxActionEnforceModifiedDirective,\n DbxActionAutoTriggerDirective,\n DbxActionValueStreamDirective,\n DbxActionAutoModifyDirective,\n DbxActionValueDirective,\n DbxActionContextLoggerDirective,\n DbxActionHasSuccessDirective,\n DbxActionSuccessHandlerDirective,\n DbxActionIsWorkingDirective,\n DbxActionDisabledOnSuccessDirective,\n DbxActionPreSuccessDirective,\n DbxActionIdleDirective,\n DbxActionHandlerValueDirective,\n DbxActionErrorHandlerDirective\n} from './directive';\n\nconst importsAndExports = [\n DbxActionDirective,\n DbxActionContextMapDirective,\n DbxActionFromMapDirective,\n DbxActionMapSourceDirective,\n DbxActionMapWorkingDisableDirective,\n DbxActionSourceDirective,\n DbxActionHandlerDirective,\n DbxActionHandlerValueDirective,\n DbxActionDisabledDirective,\n DbxActionDisabledOnSuccessDirective,\n DbxActionEnforceModifiedDirective,\n DbxActionAutoTriggerDirective,\n DbxActionValueStreamDirective,\n DbxActionAutoModifyDirective,\n DbxActionValueDirective,\n DbxActionContextLoggerDirective,\n DbxActionIdleDirective,\n DbxActionPreSuccessDirective,\n DbxActionHasSuccessDirective,\n DbxActionSuccessHandlerDirective,\n DbxActionErrorHandlerDirective,\n DbxActionIsWorkingDirective\n];\n\n/**\n * Contains all base DbxAction components.\n */\n@NgModule({\n imports: importsAndExports,\n exports: importsAndExports\n})\nexport class DbxCoreActionModule {}\n","import { type Destroyable } from '@dereekb/util';\nimport { type DbxActionContextStoreSourceInstance } from './action.store.source';\n\n/**\n * Acts as a reference to a DbxActionContextStoreSourceInstance that can be destroyed.\n *\n * This is used in cases where the action is passed around and the context it is passed to needs to clean up.\n */\nexport interface DbxActionContextSourceReference<T = unknown, O = unknown> extends Destroyable {\n readonly sourceInstance: DbxActionContextStoreSourceInstance<T, O>;\n}\n\nexport function makeDbxActionContextSourceReference<T, O>(sourceInstance: DbxActionContextStoreSourceInstance<T, O>): DbxActionContextSourceReference<T, O> {\n return {\n sourceInstance,\n destroy: () => 0\n };\n}\n","import { type ArrayOrValue, hasValueOrNotEmpty, type Maybe } from '@dereekb/util';\nimport { map, type Observable } from 'rxjs';\n\nexport type SegueRefRouterLink = string | ArrayOrValue<object>;\n\nexport interface SegueRefRawSegueParams {\n [key: string]: unknown;\n}\n\nexport interface SegueRefOptions<O = object> {\n /**\n * Raw parameters\n */\n refParams?: SegueRefRawSegueParams;\n\n /**\n * Custom Transition Options.\n *\n * For UIRouter, this is TransitionOptions.\n */\n refOptions?: O;\n}\n\n/**\n * Represents a segue ref\n */\nexport interface SegueRef<O = object> extends SegueRefOptions<O> {\n /**\n * Ref path value.\n */\n ref: SegueRefRouterLink;\n}\n\n/**\n * A SegueRef object or a different router link representation.\n */\nexport type SegueRefOrSegueRefRouterLink<O = object> = SegueRef<O> | SegueRefRouterLink;\n\nexport function isSegueRef<O = object>(input: Maybe<SegueRefOrSegueRefRouterLink<O>>): input is SegueRef<O> {\n return typeof input === 'object' && hasValueOrNotEmpty((input as SegueRef).ref);\n}\n\nexport function asSegueRef<O = object>(input: SegueRefOrSegueRefRouterLink<O>): SegueRef<O>;\nexport function asSegueRef<O = object>(input: Maybe<SegueRefOrSegueRefRouterLink<O>>): Maybe<SegueRef<O>>;\nexport function asSegueRef<O = object>(input: Maybe<SegueRefOrSegueRefRouterLink<O>>): Maybe<SegueRef<O>> {\n const type = typeof input;\n\n if (type === 'string') {\n return refStringToSegueRef(input as string);\n } else if (isSegueRef(input)) {\n return input as SegueRef<O>;\n } else {\n return undefined;\n }\n}\n\nexport function asSegueRefString<O = object>(input: SegueRefOrSegueRefRouterLink<O> | string): string;\nexport function asSegueRefString<O = object>(input: Maybe<SegueRefOrSegueRefRouterLink<O> | string>): Maybe<string>;\nexport function asSegueRefString<O = object>(input: Maybe<SegueRefOrSegueRefRouterLink<O> | string>): Maybe<string> {\n if (typeof input === 'string') {\n return input;\n } else if (isSegueRef(input)) {\n return input.ref as string;\n } else {\n throw new Error(`asSegueRefString() failed to convert the input to a string: ${input}`);\n }\n}\n\nexport function refStringToSegueRef<O = object>(ref: string, options?: SegueRefOptions<O>): SegueRef<O> {\n return { ...options, ref };\n}\n\nexport function mapRefStringObsToSegueRefObs<O = object>(obs: Observable<string>, options?: SegueRefOptions<O>): Observable<SegueRef<O>> {\n return obs.pipe(map((x) => refStringToSegueRef(x, options)));\n}\n","import { type Observable } from 'rxjs';\nimport { type AuthRoleSet } from '@dereekb/util';\nimport { type AuthUserIdentifier, type AuthUserState } from '../auth.user';\n\n/**\n * Client auth service used to retrieve info about the current state of client authentication and client roles they may have.\n */\nexport abstract class DbxAuthService {\n /**\n * Whether or not the user is logged in.\n *\n * This will only emit once the authentication has been determined, preventing issues with premature decision making.\n *\n * A user is considered logged in even if there is an anonymous user. For more detailed info, consider using authUserState$.\n */\n abstract readonly isLoggedIn$: Observable<boolean>;\n\n /**\n * Whether or not the user has finished onboarding.\n *\n * This will only emit once the onboarding status has been determined, preventing issues with premature decision making.\n */\n abstract readonly isOnboarded$: Observable<boolean>;\n\n /**\n * Emits an event every time the user logs in.\n */\n abstract readonly onLogIn$: Observable<void>;\n\n /**\n * Emits an event every time the user logs out.\n */\n abstract readonly onLogOut$: Observable<void>;\n\n /**\n * Current state of the user.\n */\n abstract readonly authUserState$: Observable<AuthUserState>;\n\n /**\n * Role set for the current user.\n */\n abstract readonly authRoles$: Observable<AuthRoleSet>;\n\n /**\n * Identifier for the current user.\n */\n abstract readonly userIdentifier$: Observable<AuthUserIdentifier>;\n\n /**\n * Performs the logout action.\n */\n abstract logOut(): Promise<void>;\n}\n","import { type TransitionHookFn, type Transition, type HookResult, type StateService, type UIInjector, type TransitionOptions, type RawParams } from '@uirouter/core';\nimport { catchError, map, first, firstValueFrom, type Observable, of, switchMap } from 'rxjs';\nimport { asSegueRef, asSegueRefString, type SegueRefOrSegueRefRouterLink } from './../../../../router/segue';\nimport { DbxAuthService } from '../../../service/auth.service';\nimport { type FactoryWithRequiredInput, getValueFromGetter, isGetter, type Maybe, type Milliseconds } from '@dereekb/util';\nimport { type Injector } from '@angular/core';\nimport { timeoutStartWith } from '@dereekb/rxjs';\n\n/**\n * authTransitionHookFn() configuration. The values are handled as:\n * - true: continue to the state.\n * - false: redirect to the login page.\n * - StateOrName: redirect to the target page instead.\n */\nexport type AuthTransitionDecision = true | false | SegueRefOrSegueRefRouterLink;\n\nexport interface AuthTransitionDecisionGetterInput {\n readonly transition: Transition;\n readonly injector: Injector;\n readonly authService: DbxAuthService;\n}\n\nexport type AuthTransitionRedirectTarget = Observable<Maybe<SegueRefOrSegueRefRouterLink>>;\nexport type AuthTransitionRedirectTargetGetter = FactoryWithRequiredInput<AuthTransitionRedirectTarget, AuthTransitionDecisionGetterInput>;\nexport type AuthTransitionRedirectTargetOrGetter = Maybe<SegueRefOrSegueRefRouterLink> | AuthTransitionRedirectTargetGetter;\n\nexport interface AuthTransitionHookOptions {\n /**\n * The state to redirect the user to when their auth fails.\n */\n defaultRedirectTarget: string;\n\n /**\n * The state to redirect the user to. Defaults to defaultRedirectTarget.\n */\n errorRedirectTarget?: string;\n\n /**\n * Timeout time for the decision obs. Defaults to 1000ms.\n */\n timeoutTime?: Milliseconds;\n}\n\nexport interface AuthTransitionHookConfig extends AuthTransitionHookOptions {\n /**\n * Creates the decision observable for the transition that decides whether or not to redirect or continue.\n */\n makeDecisionsObs: (transition: Transition, authService: DbxAuthService, injector: UIInjector) => Observable<AuthTransitionDecision>;\n}\n\nexport interface AuthTransitionStateData {\n /**\n * Optional getter/decision maker when a role needs to be\n */\n redirectTo?: AuthTransitionRedirectTargetOrGetter;\n}\n\n/**\n * This generates a TransitionHookFn that can be used with redirecting routes.\n */\nexport function makeAuthTransitionHook(config: AuthTransitionHookConfig): TransitionHookFn {\n const { defaultRedirectTarget, errorRedirectTarget = defaultRedirectTarget, timeoutTime = 1000 } = config;\n\n // https://ui-router.github.io/ng2/docs/latest/modules/transition.html#hookresult\n const assertIsAuthenticated: TransitionHookFn = (transition: Transition): HookResult => {\n const injector = transition.injector();\n const authService: DbxAuthService = injector.get(DbxAuthService);\n const $state: StateService = transition.router.stateService;\n const decisionObs = config.makeDecisionsObs(transition, authService, injector);\n\n function redirectOut(): Observable<HookResult> {\n const stateData: AuthTransitionStateData = transition.targetState().state().data;\n const redirectTo = stateData?.redirectTo;\n\n let redirectToObs: Observable<HookResult>;\n\n if (redirectTo) {\n let resultObs: Observable<Maybe<SegueRefOrSegueRefRouterLink>>;\n\n if (isGetter<AuthTransitionRedirectTarget>(redirectTo)) {\n resultObs = getValueFromGetter(redirectTo, { authService, injector, transition } as AuthTransitionDecisionGetterInput);\n } else {\n resultObs = of(redirectTo as SegueRefOrSegueRefRouterLink);\n }\n\n redirectToObs = resultObs.pipe(\n map((inputStateRef: Maybe<SegueRefOrSegueRefRouterLink>) => {\n const stateRef = asSegueRef(inputStateRef);\n\n let redirectTarget;\n let redirectParams;\n\n if (stateRef) {\n redirectTarget = stateRef.ref;\n redirectParams = stateRef.refParams;\n }\n\n if (!redirectTarget) {\n redirectTarget = defaultRedirectTarget;\n }\n\n return $state.target(redirectTarget, redirectParams);\n })\n );\n } else {\n redirectToObs = of($state.target(defaultRedirectTarget));\n }\n\n return redirectToObs;\n }\n\n const resultObs = decisionObs.pipe(\n // after the timeoutTime seconds of no transition working, redirect with a false decision\n timeoutStartWith(false as AuthTransitionDecision, timeoutTime),\n first(),\n switchMap((decision: AuthTransitionDecision): Observable<HookResult> => {\n if (typeof decision === 'boolean') {\n if (decision) {\n return of(true);\n } else {\n return redirectOut();\n }\n } else {\n const segueRef = asSegueRef(decision);\n return of($state.target(asSegueRefString(segueRef.ref), segueRef.refParams as RawParams, segueRef.refOptions as TransitionOptions));\n }\n }),\n catchError((x) => {\n console.warn(`Encountered error in auth transition hook. Attempting redirect to ${errorRedirectTarget}.`, x);\n return of($state.target(errorRedirectTarget, { location: true })); // Redirect to home\n })\n );\n\n return firstValueFrom(resultObs) as HookResult;\n };\n\n return assertIsAuthenticated;\n}\n","import { first, type Observable, of, switchMap } from 'rxjs';\nimport { getValueFromGetter, isGetter, type Maybe, type ObjectMap } from '@dereekb/util';\nimport { type AuthTransitionDecisionGetterInput, type AuthTransitionRedirectTarget, type AuthTransitionRedirectTargetGetter, type AuthTransitionRedirectTargetOrGetter } from './hook';\nimport { type SegueRefOrSegueRefRouterLink } from '../../../../router/segue';\nimport { type AuthUserState } from '../../../auth.user';\n\n/**\n * Creates a AuthTransitionRedirectTargetGetter that can redirect values based on the current authUserState.\n *\n * @param stateMap\n * @returns\n */\nexport function redirectBasedOnAuthUserState(stateMap: ObjectMap<AuthTransitionRedirectTargetOrGetter>): AuthTransitionRedirectTargetGetter {\n return (input: AuthTransitionDecisionGetterInput) => {\n return input.authService.authUserState$.pipe(\n first(),\n switchMap((authUserState: AuthUserState) => {\n const getter = stateMap[authUserState];\n let result: Maybe<Observable<Maybe<SegueRefOrSegueRefRouterLink>>>;\n\n if (getter) {\n if (isGetter<AuthTransitionRedirectTarget>(getter)) {\n result = getValueFromGetter(getter, input);\n } else {\n result = of(getter);\n }\n }\n\n if (!result) {\n result = of(undefined);\n }\n\n return result;\n })\n );\n };\n}\n","import { type Observable } from 'rxjs';\nimport { type Maybe } from '@dereekb/util';\nimport { type TransitionService, type TransitionHookFn, type Transition, type HookMatchCriteria } from '@uirouter/core';\nimport { type DbxAuthService } from '../../../service/auth.service';\nimport { type AuthTransitionDecision, type AuthTransitionHookOptions, makeAuthTransitionHook } from './hook';\n\nexport interface IsLoggedInHookConfig {\n options: AuthTransitionHookOptions;\n}\n\n/**\n * UIRouter State data with configuration for the hasAuthRoleHook.\n */\nexport interface IsLoggedInStateData {\n /**\n * Whether or not the user needs to be logged in for this state.\n */\n requiredLogIn: boolean;\n}\n\n/**\n * This hook redirects to the configured default state when a user is not logged in for configured states.\n */\nexport function enableIsLoggedInHook(transitionService: TransitionService, config: IsLoggedInHookConfig): void {\n // Matches if the destination state's data property has a truthy 'isSecure' property\n const isSecureCriteria: HookMatchCriteria = {\n entering: (state) => {\n const data = state?.data as Maybe<Partial<IsLoggedInStateData>>;\n const match = Boolean(data?.requiredLogIn);\n return match;\n }\n };\n\n const assertIsLoggedIn: TransitionHookFn = makeAuthTransitionHook({\n ...config.options,\n makeDecisionsObs(transition: Transition, authService: DbxAuthService): Observable<AuthTransitionDecision> {\n return authService.isLoggedIn$;\n }\n });\n\n // Register the \"requires auth\" hook with the TransitionsService\n transitionService.onBefore(isSecureCriteria, assertIsLoggedIn, { priority: 100 });\n}\n","import { map, type Observable, type OperatorFunction } from 'rxjs';\nimport { type AuthRole, type SetIncludesMode, type ArrayOrValue, type Maybe, setIncludes, asArray, type AuthRoleSet } from '@dereekb/util';\nimport { type TransitionService, type TransitionHookFn, type Transition, type HookMatchCriteria } from '@uirouter/core';\nimport { type DbxAuthService } from '../../../service/auth.service';\nimport { type AuthTransitionDecision, type AuthTransitionHookOptions, type AuthTransitionStateData, makeAuthTransitionHook } from './hook';\n\nexport interface HasAuthRoleHookConfig {\n readonly options: AuthTransitionHookOptions;\n}\n\nexport interface HasAuthRoleStateRoleConfig {\n /**\n * Auth roles marked for this state\n */\n readonly authRoles: ArrayOrValue<AuthRole>;\n /**\n * How to use the above auth roles. This defaults to 'all' by default.\n */\n readonly authRolesMode?: SetIncludesMode;\n}\n\nexport interface ParsedHasAuthRoleStateRoleConfig {\n /**\n * Auth roles marked for this state\n */\n readonly requiredRoles: Set<AuthRole>;\n /**\n * How to use the above auth roles. This defaults to 'all' by default.\n */\n readonly authRolesMode?: SetIncludesMode;\n}\n\n/**\n * UIRouter State data with configuration for the hasAuthRoleHook.\n */\nexport interface HasAuthRoleStateData extends AuthTransitionStateData, Pick<HasAuthRoleStateRoleConfig, 'authRolesMode'> {\n /**\n * Auth roles configuration for this state.\n */\n readonly authRoles: ArrayOrValue<AuthRole | HasAuthRoleStateRoleConfig>;\n}\n\n/**\n * This hook redirects to the configured default state when a user:\n *\n * - does not have an allowed state\n * - has a disallowed state\n */\nexport function enableHasAuthRoleHook(transitionService: TransitionService, config: HasAuthRoleHookConfig): void {\n // Matches if the destination state's data property has a truthy 'isSecure' property\n const isSecureCriteria: HookMatchCriteria = {\n entering: (state) => {\n const data = state?.data as Maybe<Partial<HasAuthRoleStateData>>;\n const match = Boolean(data?.authRoles);\n return match;\n }\n };\n\n const assertHasAuthRole: TransitionHookFn = makeAuthTransitionHook({\n ...config.options,\n makeDecisionsObs(transition: Transition, authService: DbxAuthService): Observable<AuthTransitionDecision> {\n const targetState = transition.targetState();\n const data: HasAuthRoleStateData = targetState.state().data;\n const mapFn: OperatorFunction<AuthRoleSet, boolean> = hasAuthRoleDecisionPipe(data);\n return authService.authRoles$.pipe(mapFn);\n }\n });\n\n // Register the \"requires auth\" hook with the TransitionsService\n transitionService.onBefore(isSecureCriteria, assertHasAuthRole, { priority: 100 });\n}\n\nexport function hasAuthRoleDecisionPipe(stateData: HasAuthRoleStateData): OperatorFunction<AuthRoleSet, boolean> {\n const authRolesMode: SetIncludesMode = stateData.authRolesMode || 'all';\n\n const authRoleConfigs: ParsedHasAuthRoleStateRoleConfig[] = asArray(stateData.authRoles).map((x) => {\n let config: HasAuthRoleStateRoleConfig;\n\n if (typeof x === 'string') {\n config = {\n authRoles: x,\n authRolesMode: 'any'\n };\n } else {\n config = x;\n }\n\n return {\n requiredRoles: new Set<AuthRole>(config.authRoles),\n authRolesMode: config.authRolesMode\n };\n });\n\n let mapFn: OperatorFunction<AuthRoleSet, boolean>;\n\n if (authRolesMode === 'any') {\n mapFn = map((x) => authRoleConfigs.findIndex((y) => setIncludes(x, y.requiredRoles, y.authRolesMode)) !== -1); // find the first match\n } else {\n mapFn = map((x) => authRoleConfigs.findIndex((y) => !setIncludes(x, y.requiredRoles, y.authRolesMode)) === -1); // find the first failed match\n }\n\n return mapFn;\n}\n","import { map, type Observable } from 'rxjs';\nimport { type AllowedSet, isAllowed, maybeSet, type ArrayOrValue, type Maybe } from '@dereekb/util';\nimport { type TransitionService, type TransitionHookFn, type Transition, type HookMatchCriteria } from '@uirouter/core';\nimport { type AuthUserState } from '../../../auth.user';\nimport { type DbxAuthService } from '../../../service/auth.service';\nimport { type AuthTransitionDecision, type AuthTransitionHookOptions, type AuthTransitionStateData, makeAuthTransitionHook } from './hook';\n\nexport interface HasAuthStateHookConfig {\n options: AuthTransitionHookOptions;\n}\n\nexport type HasAuthStateConfig = ArrayOrValue<AuthUserState> | HasAuthStateObjectConfig;\n\nexport interface HasAuthStateObjectConfig {\n /**\n * Whether or not this state or any child state is considered \"secure\", which requires the user to be logged in.\n */\n allowedStates?: ArrayOrValue<AuthUserState>;\n\n /**\n * States that are not allowed. If the current state is this state, a rejection is returned.\n */\n disallowedStates?: ArrayOrValue<AuthUserState>;\n}\n\nexport interface HasAuthStateData extends AuthTransitionStateData {\n /**\n * Configuration for the hasAuthStateHook.\n */\n authStates: HasAuthStateConfig;\n}\n\n/**\n * This hook redirects to the configured default state when a user:\n *\n * - does not have an allowed state\n * - has a disallowed state\n */\nexport function enableHasAuthStateHook(transitionService: TransitionService, config: HasAuthStateHookConfig): void {\n // Matches if the destination state's data property has a truthy 'isSecure' property\n const isSecureCriteria: HookMatchCriteria = {\n entering: (state) => {\n const data = state?.data as Maybe<Partial<HasAuthStateData>>;\n const match = Boolean(data?.authStates);\n return match;\n }\n };\n\n const assertHasAuthState: TransitionHookFn = makeAuthTransitionHook({\n ...config.options,\n makeDecisionsObs(transition: Transition, authService: DbxAuthService): Observable<AuthTransitionDecision> {\n const targetState = transition.targetState();\n const data: HasAuthStateData = targetState.state().data;\n const config = toHasAuthStateObjectConfig(data.authStates);\n const allowedStates: ParsedHasAuthStateConfig = toParsedHasAuthStateConfig(config);\n\n return authService.authUserState$.pipe(map((x) => isAllowed(x, allowedStates)));\n }\n });\n\n // Register the \"requires auth\" hook with the TransitionsService\n transitionService.onBefore(isSecureCriteria, assertHasAuthState, { priority: 100 });\n}\n\n// MARK: Utility\nfunction toHasAuthStateObjectConfig(input: HasAuthStateConfig): HasAuthStateObjectConfig {\n const isString = typeof input === 'string';\n\n if (Array.isArray(input) || isString) {\n if (isString) {\n input = [input as AuthUserState];\n }\n\n return {\n allowedStates: input as AuthUserState[]\n };\n } else {\n return input as HasAuthStateObjectConfig;\n }\n}\n\ntype ParsedHasAuthStateConfig = AllowedSet<AuthUserState>;\n\nfunction toParsedHasAuthStateConfig(input: HasAuthStateObjectConfig): ParsedHasAuthStateConfig {\n return {\n allowed: maybeSet(input.allowedStates),\n disallowed: maybeSet(input.disallowedStates)\n };\n}\n","/**\n * A contextual state identifier for a specific section of the app.\n *\n * Some examples are:\n * - init: The default context that is initialized.\n * - public: A public part of the app.\n * - onboarding: The onboarding section of the app.\n * - app: The main portion of the app.\n *\n * More complex apps may have more sub-sections or app portions that could each have their own context state.\n */\nexport type DbxAppContextState = string;\n\n/**\n * The init state of an app after the default context has been initialized.\n */\nexport const DBX_INIT_APP_CONTEXT_STATE = 'init';\n/**\n * The public state of an app, typically when a user opens up the site to a public page.\n */\nexport const DBX_PUBLIC_APP_CONTEXT_STATE = 'public';\n/**\n * The auth state of an app, typically when a user has not finished logging in.\n */\nexport const DBX_AUTH_APP_CONTEXT_STATE = 'auth';\n/**\n * The onboarding state of an app, typically when a user has completed auth but not finished setting up their account.\n */\nexport const DBX_ONBOARD_APP_CONTEXT_STATE = 'onboard';\n/**\n * The app state of an app, typically when a user has completed auth and onboarding.\n */\nexport const DBX_APP_APP_CONTEXT_STATE = 'app';\n\n/**\n * Default AppContextStates.\n *\n * Your app may not use these, but this type is available for convenience.\n */\nexport type DbxKnownAppContextState = typeof DBX_INIT_APP_CONTEXT_STATE | typeof DBX_PUBLIC_APP_CONTEXT_STATE | typeof DBX_AUTH_APP_CONTEXT_STATE | typeof DBX_ONBOARD_APP_CONTEXT_STATE | typeof DBX_APP_APP_CONTEXT_STATE;\n\n/**\n * Array of all DbxKnownAppContextState values, minus the init state.\n */\nexport const DBX_KNOWN_APP_CONTEXT_STATES: DbxKnownAppContextState[] = [DBX_PUBLIC_APP_CONTEXT_STATE, DBX_AUTH_APP_CONTEXT_STATE, DBX_ONBOARD_APP_CONTEXT_STATE, DBX_APP_APP_CONTEXT_STATE];\n","import { createAction, props } from '@ngrx/store';\nimport { type DbxAppContextState } from '../../context';\n\n/**\n * Action to set the current DbxAppContextState value.\n */\nexport const setState = createAction('[App/Context] Set State', props<{ state: DbxAppContextState }>());\n\n/**\n * Resets the app back to the init context.\n */\nexport const resetState = createAction('[App/Context] Reset');\n","import { createReducer, on } from '@ngrx/store';\nimport { type DbxAppContextState, DBX_INIT_APP_CONTEXT_STATE } from '../../context';\nimport { DbxAppContextActions } from '../action';\n\n/**\n * The feature key for these items/reducers.\n */\nexport const dbxAppContextStateFeatureKey = 'data';\n\n/**\n * The typings for this feature.\n */\nexport interface DbxAppContextStateData {\n state: DbxAppContextState;\n}\n\nexport const initialState: DbxAppContextStateData = {\n state: DBX_INIT_APP_CONTEXT_STATE\n};\n\nexport const reducer = createReducer(\n initialState,\n /**\n * When DbxAppContextActions.dbxAppContextSetState is pushed, update the app's state to match the argument state.\n */\n on(DbxAppContextActions.setState, (_, { state }) => ({ state }))\n);\n","import { type Action, combineReducers, createFeatureSelector, createSelector } from '@ngrx/store';\n\nimport * as fromDbxAppContextState from './data.reducer';\n\n/**\n * Global feature key for our app.\n */\nexport const featureKey = 'app.context';\n\n/**\n * This is a \"feature state\", which in this case is a single feature (our app state), but could include keys/states within this feature.\n */\nexport interface DbxAppContextFeatureState {\n [fromDbxAppContextState.dbxAppContextStateFeatureKey]: fromDbxAppContextState.DbxAppContextStateData;\n}\n\n/**\n * Interface typing extension for the DbxAppContextFeatureState, and the typing information for how this feature extends the base state.\n */\nexport interface State {\n [featureKey]: DbxAppContextFeatureState;\n}\n\n/**\n * Reducers mapping for the DbxAppContextFeatureState\n */\nexport function reducers(state: DbxAppContextFeatureState | undefined, action: Action) {\n return combineReducers({\n [fromDbxAppContextState.dbxAppContextStateFeatureKey]: fromDbxAppContextState.reducer\n })(state, action);\n}\n\n/**\n * Selects the DbxAppContextFeatureState feature context.\n *\n * Used by createSelector() to retrieve more specific data from the DbxAppContextFeatureState.\n */\nexport const selectAppContextFeature = createFeatureSelector<DbxAppContextFeatureState>(featureKey);\n\n/**\n * Selector to retrieve the state value from our DbxAppContextStateData in our DbxAppContextFeatureState.\n */\nexport const selectDbxAppContextState = createSelector(selectAppContextFeature, (featureState: DbxAppContextFeatureState) => featureState[fromDbxAppContextState.dbxAppContextStateFeatureKey].state);\n","import { type OnRunEffects, Actions, type EffectNotification, ofType } from '@ngrx/effects';\nimport { Store } from '@ngrx/store';\nimport { type Observable, exhaustMap, filter, takeUntil } from 'rxjs';\nimport { type DbxAppContextState } from '../../context';\nimport { onDbxAppContext } from '../';\nimport { type IterableOrValue, iterableToSet } from '@dereekb/util';\nimport { inject } from '@angular/core';\n\n// MARK: Abstract Context Effects\n/**\n * Abstract effects class that only runs/allows effects when the DbxAppContextState in the ngrx state matches input activeState value.\n */\nexport abstract class AbstractOnDbxAppContextStateEffects<S = unknown> implements OnRunEffects {\n protected readonly actions$ = inject(Actions);\n protected readonly store = inject(Store<S>);\n\n /**\n * The set of state(s) to activate on.\n */\n private _activeStatesSet: Set<DbxAppContextState>;\n\n constructor(activeStates: IterableOrValue<DbxAppContextState>) {\n this._activeStatesSet = iterableToSet(activeStates);\n }\n\n /**\n * Configures all actions of the sub-class to only activate when the DbxAppContextState in App\n *\n * @param resolvedEffects$\n * @returns\n */\n ngrxOnRunEffects(resolvedEffects$: Observable<EffectNotification>): Observable<EffectNotification> {\n return this.actions$.pipe(\n ofType(onDbxAppContext.DbxAppContextActions.setState),\n filter(({ state }) => {\n return this._activeStatesSet.has(state);\n }),\n exhaustMap(() =>\n resolvedEffects$.pipe(\n takeUntil(\n this.actions$.pipe(\n ofType(onDbxAppContext.DbxAppContextActions.setState),\n filter(({ state }) => !this._activeStatesSet.has(state))\n )\n )\n )\n )\n );\n }\n}\n","import { type Maybe } from '@dereekb/util';\n\n/**\n * An application user state.\n *\n * Generic states that define the current state of the user:\n * - none: the user is not logged in\n * - anon: the user is logged in as an anonymous account\n * - error: there was an error loading the correct user state\n * - new: the user has a full account but has not completed onboarding/setup\n * - user: the user has a full account and has completed setup\n */\nexport type AuthUserState = 'none' | 'anon' | 'new' | 'user' | 'error';\n\n/**\n * Arbitrary identifier used to differentiate users.\n */\nexport type AuthUserIdentifier = string;\n\nexport const NO_AUTH_USER_IDENTIFIER = '0';\n\n/**\n * AuthUserIdentifier used to indicate that the user cannot be uniquely identifier.\n */\nexport type NoAuthUserIdentifier = typeof NO_AUTH_USER_IDENTIFIER;\n\n/**\n * Creates an AuthUserIdentifier from the input. If the input is undefined, returns the NoAuthUserIdentifier.\n *\n * @param inputId\n * @returns\n */\nexport function authUserIdentifier(inputId: Maybe<AuthUserIdentifier>): AuthUserIdentifier {\n return inputId ? inputId : NO_AUTH_USER_IDENTIFIER;\n}\n","import { createAction } from '@ngrx/store';\n\n/**\n * Action for when the user has logged in.\n */\nexport const loggedIn = createAction('[App/Auth] Auth Logged In');\n\n/**\n * Action for when the user has logged out.\n */\nexport const loggedOut = createAction('[App/Auth] Auth Logged Out');\n\n/**\n * Action to log the user out.\n */\nexport const logout = createAction('[App/Auth] Auth Logout');\n","import { createAction, props } from '@ngrx/store';\nimport { type AuthRole } from '@dereekb/util';\nimport { type AuthUserIdentifier, type AuthUserState } from '../../auth.user';\n\n/**\n * Sets the user's identifier in the auth.\n */\nexport const setUserIdentifier = createAction('[App/Auth] Set User Identifier', props<{ id: AuthUserIdentifier }>());\n\n/**\n * Sets the user's state in the auth.\n */\nexport const setUserState = createAction('[App/Auth] Set User State', props<{ state: AuthUserState }>());\n\n/**\n * Sets the user's roles in the auth.\n */\nexport const setUserRoles = createAction('[App/Auth] Set User Roles', props<{ roles: AuthRole[] }>());\n\n/**\n * Sets the user's onboarding state.\n */\nexport const setUserIsOnboarded = createAction('[App/Auth] Set User Is Onboarded', props<{ isOnboarded: boolean }>());\n","import { NO_AUTH_USER_IDENTIFIER, type AuthUserIdentifier, type AuthUserState } from '../../auth.user';\nimport { createReducer, on } from '@ngrx/store';\nimport { DbxAppAuthActions, DbxAppAuthUserActions } from '../action';\nimport { type AuthRole } from '@dereekb/util';\n\nexport const dbxAppAuthUserFeatureKey = 'user';\n\nexport interface DbxAppAuthStateUser {\n userId: AuthUserIdentifier;\n isOnboarded: boolean;\n userState: AuthUserState;\n userRoles: AuthRole[];\n}\n\nexport const initialState: DbxAppAuthStateUser = {\n userId: NO_AUTH_USER_IDENTIFIER,\n isOnboarded: false,\n userState: 'none',\n userRoles: []\n};\n\nexport const reducer = createReducer(\n initialState,\n on(DbxAppAuthActions.loggedOut, () => ({ ...initialState })),\n on(DbxAppAuthUserActions.setUserIdentifier, (state, { id: userId }) => ({ ...state, userId })),\n on(DbxAppAuthUserActions.setUserIsOnboarded, (state, { isOnboarded }) => ({ ...state, isOnboarded })),\n on(DbxAppAuthUserActions.setUserState, (state, { state: userState }) => ({ ...state, userState })),\n on(DbxAppAuthUserActions.setUserRoles, (state, { roles: userRoles }) => ({ ...state, userRoles: Array.from(userRoles) }))\n);\n","import { type Action, combineReducers, createFeatureSelector, createSelector } from '@ngrx/store';\nimport * as fromDbxAppAuthUserState from './user.reducer';\n\n/**\n * Global feature key\n */\nexport const featureKey = 'app.auth';\n\nexport interface DbxAppAuthFeatureState {\n [fromDbxAppAuthUserState.dbxAppAuthUserFeatureKey]: fromDbxAppAuthUserState.DbxAppAuthStateUser;\n}\n\n/**\n * Interface typing extension for the DbxAppAuthFeatureState, and the typing information for how this feature extends the base state.\n */\nexport interface State {\n [featureKey]: DbxAppAuthFeatureState;\n}\n\n/**\n * Reducers mapping for the DbxAppAuthFeatureState\n */\nexport function reducers(state: DbxAppAuthFeatureState | undefined, action: Action) {\n return combineReducers({\n [fromDbxAppAuthUserState.dbxAppAuthUserFeatureKey]: fromDbxAppAuthUserState.reducer\n })(state, action);\n}\n\n/**\n * Selects the DbxAppAuthFeatureState feature context.\n */\nexport const selectAppAuthFeature = createFeatureSelector<DbxAppAuthFeatureState>(featureKey);\n\n/**\n * Selector to retrieve the state value from our DbxAppContextStateData in our DbxAppContextFeatureState.\n */\nexport const selectDbxAppAuthUser = createSelector(selectAppAuthFeature, (featureState: DbxAppAuthFeatureState) => featureState[fromDbxAppAuthUserState.dbxAppAuthUserFeatureKey]);\n","import { type ObservableOrValue, asObservable } from '@dereekb/rxjs';\nimport { firstValueFrom } from 'rxjs';\nimport { type SegueRef, type SegueRefOrSegueRefRouterLink } from '../../segue';\nimport { type DbxRouterService } from './router.service';\n\n/**\n * Function that will perform navigation with the input route.\n */\nexport type GoWithRouter = (route: ObservableOrValue<SegueRef>) => Promise<boolean>;\n\n/**\n * Creates a GoWithRouter function.\n *\n * @param dbxRouterService\n * @returns\n */\nexport function goWithRouter(dbxRouterService: DbxRouterService): (route: ObservableOrValue<SegueRefOrSegueRefRouterLink>) => Promise<boolean> {\n return (route) => {\n return firstValueFrom(asObservable(route)).then((x) => dbxRouterService.go(x));\n };\n}\n","import { type Observable } from 'rxjs';\nimport { type DbxRouterTransitionEvent } from '../transition/transition';\n\n/**\n * Router service definition that provides high level information about router transitions.\n */\nexport abstract class DbxRouterTransitionService {\n /**\n * Observable that emits DbxRouterTransitionEvent values as transitions occur.\n */\n abstract readonly transitions$: Observable<DbxRouterTransitionEvent>;\n}\n","import { type ObservableOrValue } from '@dereekb/rxjs';\nimport { type Observable } from 'rxjs';\nimport { type SegueRefOrSegueRefRouterLink, type SegueRefRawSegueParams } from '../../segue';\nimport { DbxRouterTransitionService } from './router.transition.service';\n\n/**\n * Router service definition that can route the app and provide routing details.\n */\nexport abstract class DbxRouterService extends DbxRouterTransitionService {\n /**\n * Params of the current successfully loaded route.\n */\n abstract readonly params$: Observable<SegueRefRawSegueParams>;\n\n /**\n * Navigates to the target SegueRef.\n *\n * @param segueRef\n */\n abstract go(segueRef: ObservableOrValue<SegueRefOrSegueRefRouterLink>): Promise<boolean>;\n\n /**\n * Navigates to the current url with updated parameters. Will be merged with the existing parameters.\n *\n * The new state will replace the current state in the history.\n *\n * @param segueRef\n */\n abstract updateParams(params: ObservableOrValue<SegueRefRawSegueParams>): Promise<boolean>;\n\n /**\n * Returns true if the input segue ref is considered active.\n *\n * @param segueRef\n */\n abstract isActive(segueRef: SegueRefOrSegueRefRouterLink): boolean;\n\n /**\n * Returns true if the input segue ref is considered active exactly.\n *\n * @param segueRef\n */\n abstract isActiveExactly(segueRef: SegueRefOrSegueRefRouterLink): boolean;\n\n /**\n * Compares the two refs for precision for a certain route.\n *\n * For example, if the parent route is input with a child route, the child route is\n * considered more precise.\n *\n * @param a\n * @param b\n */\n abstract comparePrecision(a: SegueRefOrSegueRefRouterLink, b: SegueRefOrSegueRefRouterLink): number;\n}\n","import { type SegueRefOrSegueRefRouterLink } from '../../router/segue';\n\n/**\n * Auth routes configurations for an app.\n */\nexport abstract class DbxAppAuthRoutes {\n abstract readonly loginRef: SegueRefOrSegueRefRouterLink;\n abstract readonly loggedOutRef?: SegueRefOrSegueRefRouterLink;\n abstract readonly onboardRef?: SegueRefOrSegueRefRouterLink;\n abstract readonly appRef: SegueRefOrSegueRefRouterLink;\n}\n","import { BehaviorSubject } from 'rxjs';\nimport { Injectable, OnDestroy, inject } from '@angular/core';\nimport { goWithRouter } from '../../router/router/service/router.go';\nimport { DbxRouterService } from '../../router/router/service/router.service';\nimport { DbxAppAuthRoutes } from './auth.router';\n\n/**\n * Helper service for navigating to important auth-related routes.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class DbxAppAuthRouterService implements OnDestroy {\n readonly dbxRouterService = inject(DbxRouterService);\n readonly dbxAppAuthRoutes = inject(DbxAppAuthRoutes);\n\n private _isAuthRouterEffectsEnabled = new BehaviorSubject<boolean>(true);\n readonly isAuthRouterEffectsEnabled$ = this._isAuthRouterEffectsEnabled.asObservable();\n\n ngOnDestroy(): void {\n this._isAuthRouterEffectsEnabled.complete();\n }\n\n get hasOnboardingState(): boolean {\n return Boolean(this.dbxAppAuthRoutes.onboardRef);\n }\n\n // MARK: Effects\n /**\n * Whether or not DbxAppAuthRouterEffects are enabled.\n */\n get isAuthRouterEffectsEnabled(): boolean {\n return this._isAuthRouterEffectsEnabled.value;\n }\n\n set isAuthRouterEffectsEnabled(enabled: boolean) {\n this._isAuthRouterEffectsEnabled.next(enabled);\n }\n\n // MARK: Navigate\n /**\n * Navigates to the login state.\n *\n * @returns\n */\n goToLogin() {\n return goWithRouter(this.dbxRouterService)(this.dbxAppAuthRoutes.loginRef);\n }\n\n /**\n * Navigates to the logged out state, if it exists, otherwise navigates to the login state.\n *\n * @returns\n */\n goToLoggedOut() {\n return goWithRouter(this.dbxRouterService)(this.dbxAppAuthRoutes.loggedOutRef ?? this.dbxAppAuthRoutes.loginRef);\n }\n\n /**\n * Navigates to the onboarding state if it is available, otherwise navigates to the app.\n *\n * @returns\n */\n goToOnboarding(): Promise<boolean> {\n return goWithRouter(this.dbxRouterService)(this.dbxAppAuthRoutes.onboardRef ?? this.dbxAppAuthRoutes.appRef);\n }\n\n /**\n * Navigates to the app state.\n *\n * @returns\n */\n goToApp() {\n return goWithRouter(this.dbxRouterService)(this.dbxAppAuthRoutes.appRef);\n }\n}\n","import { exhaustMap, filter } from 'rxjs';\nimport { Injectable, InjectionToken, inject } from '@angular/core';\nimport { ArrayOrValue, type Maybe } from '@dereekb/util';\nimport { createEffect, ofType } from '@ngrx/effects';\nimport { DbxAppContextState, DBX_KNOWN_APP_CONTEXT_STATES } from '../../../../context/context';\nimport { AbstractOnDbxAppContextStateEffects } from '../../../../context/state/effect';\nimport { fromDbxAppAuth, onDbxAppAuth } from '../../../state';\nimport { DbxAppAuthRouterService } from '../../auth.router.service';\n\n/**\n * Used by DbxAppAuthRouterEffects to configure the states that should be activve by default.\n */\nexport const DBX_APP_AUTH_ROUTER_EFFECTS_TOKEN = new InjectionToken('DbxAppAuthRouterEffectsActiveStates');\n\n/**\n * Set of ngrx effects that handle navigation in the app when the auth changes in certain ways.\n *\n * Is configurable via the DBX_APP_AUTH_ROUTER_EFFECTS_TOKEN to choose which states this effect is active or not. By default is equal to DBX_KNOWN_APP_CONTEXT_STATES.\n */\n@Injectable()\nexport class DbxAppAuthRouterEffects extends AbstractOnDbxAppContextStateEffects<fromDbxAppAuth.State> {\n readonly dbxAppAuthRouterService = inject(DbxAppAuthRouterService);\n\n constructor() {\n super(inject<Maybe<ArrayOrValue<DbxAppContextState>>>(DBX_APP_AUTH_ROUTER_EFFECTS_TOKEN, { optional: true }) ?? DBX_KNOWN_APP_CONTEXT_STATES);\n }\n\n /**\n * Effect to redirect to the login when logout occurs.\n */\n readonly redirectToLoginOnLogout = createEffect(\n () =>\n this.actions$.pipe(\n ofType(onDbxAppAuth.DbxAppAuthActions.loggedOut),\n filter(() => this.dbxAppAuthRouterService.isAuthRouterEffectsEnabled),\n exhaustMap(() => this.dbxAppAuthRouterService.goToLogin())\n ),\n { dispatch: false }\n );\n\n /**\n * Effect to redirect to the app when login occurs.\n */\n readonly redirectToOnboardOnLogIn = createEffect(\n () =>\n this.actions$.pipe(\n ofType(onDbxAppAuth.DbxAppAuthActions.loggedIn),\n filter(() => this.dbxAppAuthRouterService.isAuthRouterEffectsEnabled),\n exhaustMap(() => this.dbxAppAuthRouterService.goToApp())\n ),\n { dispatch: false }\n );\n}\n","import { type EnvironmentProviders, type Provider, makeEnvironmentProviders } from '@angular/core';\nimport { type ArrayOrValue } from '@dereekb/util';\nimport { provideEffects } from '@ngrx/effects';\nimport { type DbxAppContextState } from '../../../context';\nimport { DbxAppAuthRouterEffects, DBX_APP_AUTH_ROUTER_EFFECTS_TOKEN } from './effect/auth.router.state.effect';\n\n/**\n * Configuration for provideDbxAppAuthRouterState().\n */\nexport interface ProvideDbxAppAuthRouterStateConfig {\n /**\n * Active routes to apply effects to.\n */\n readonly activeRoutesToApplyEffects: ArrayOrValue<DbxAppContextState>;\n}\n\n/**\n * Creates EnvironmentProviders for providing DbxAppAuthRouterState configuration and effects.\n *\n * @param config Configuration\n * @returns EnvironmentProviders\n */\nexport function provideDbxAppAuthRouterState(config: ProvideDbxAppAuthRouterStateConfig): EnvironmentProviders {\n const { activeRoutesToApplyEffects } = config;\n\n const providers: (Provider | EnvironmentProviders)[] = [\n // Token for effects\n {\n provide: DBX_APP_AUTH_ROUTER_EFFECTS_TOKEN,\n useValue: activeRoutesToApplyEffects\n },\n // Effects\n provideEffects(DbxAppAuthRouterEffects)\n ];\n\n return makeEnvironmentProviders(providers);\n}\n","import { type EnvironmentProviders, type Provider, makeEnvironmentProviders } from '@angular/core';\nimport { DbxAppAuthRoutes } from './auth.router';\n\n/**\n * Configuration for provideDbxAppAuthRouter().\n */\nexport interface ProvideDbxAppAuthRouterConfig {\n /**\n * DbxAppAuthRoutes configuration.\n */\n readonly dbxAppAuthRoutes: DbxAppAuthRoutes;\n}\n\n/**\n * Creates EnvironmentProviders for providing DbxAppAuthRoutes configuration.\n *\n * @param config Configuration\n * @returns EnvironmentProviders\n */\nexport function provideDbxAppAuthRouter(config: ProvideDbxAppAuthRouterConfig): EnvironmentProviders {\n const { dbxAppAuthRoutes } = config;\n\n const providers: Provider[] = [\n {\n provide: DbxAppAuthRoutes,\n useValue: dbxAppAuthRoutes\n }\n ];\n\n return makeEnvironmentProviders(providers);\n}\n","import { type AuthRole, type AuthRoleSet, type Maybe } from '@dereekb/util';\nimport { onFalseToTrue, onTrueToFalse, setContainsAllValuesFrom, setContainsNoValueFrom } from '@dereekb/rxjs';\nimport { map, type Observable, type OperatorFunction } from 'rxjs';\n\n/**\n * Convenience operator that emits events when the input observable goes from false to true.\n *\n * @param isLoggedInObs\n * @returns\n */\nexport function loggedInObsFromIsLoggedIn(isLoggedInObs: Observable<boolean>): Observable<void> {\n return isLoggedInObs.pipe(\n onFalseToTrue(),\n map(() => undefined)\n );\n}\n/**\n * Convenience operator that emits events when the input observable goes from true to false.\n *\n * @param isLoggedInObs\n * @returns\n */\nexport function loggedOutObsFromIsLoggedIn(isLoggedInObs: Observable<boolean>): Observable<void> {\n return isLoggedInObs.pipe(\n onTrueToFalse(),\n map(() => undefined)\n );\n}\n\nexport function authRolesSetContainsAllRolesFrom(roles: Observable<Maybe<Iterable<AuthRole>>>): OperatorFunction<AuthRoleSet, boolean> {\n return setContainsAllValuesFrom<AuthRole>(roles);\n}\n\nexport function authRolesSetContainsAnyRoleFrom(roles: Observable<Maybe<Iterable<AuthRole>>>): OperatorFunction<AuthRoleSet, boolean> {\n return setContainsAllValuesFrom<AuthRole>(roles);\n}\n\nexport function authRolesSetContainsNoRolesFrom(roles: Observable<Maybe<Iterable<AuthRole>>>): OperatorFunction<AuthRoleSet, boolean> {\n return setContainsNoValueFrom<AuthRole>(roles);\n}\n","import { Injectable, inject } from '@angular/core';\nimport { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { Store } from '@ngrx/store';\nimport { DbxAuthService } from '../../service/auth.service';\nimport { onDbxAppAuth } from '../';\nimport { map, tap } from 'rxjs';\nimport * as fromDbxAppAuth from '../reducer';\n\n/**\n * Set of ngrx effects that repeat events from DbxAuthService.\n */\n@Injectable()\nexport class DbxAppAuthEffects {\n private readonly dbxAuthService = inject(DbxAuthService);\n protected readonly actions$ = inject(Actions);\n protected readonly store = inject(Store<fromDbxAppAuth.State>);\n\n // MARK: Auth\n readonly emitLoggedIn = createEffect(() => this.dbxAuthService.onLogIn$.pipe(map(() => onDbxAppAuth.DbxAppAuthActions.loggedIn())));\n\n readonly emitLoggedOut = createEffect(() => this.dbxAuthService.onLogOut$.pipe(map(() => onDbxAppAuth.DbxAppAuthActions.loggedOut())));\n\n readonly forwardLogoutToAuthService = createEffect(\n () =>\n this.actions$.pipe(\n ofType(onDbxAppAuth.DbxAppAuthActions.logout),\n tap(() => {\n // Perform the logout\n this.dbxAuthService.logOut();\n })\n ),\n { dispatch: false }\n );\n\n // MARK: Auth\n readonly setUserIdentifier = createEffect(() => this.dbxAuthService.userIdentifier$.pipe(map((id) => onDbxAppAuth.DbxAppAuthUserActions.setUserIdentifier({ id }))));\n\n readonly setUserState = createEffect(() => this.dbxAuthService.authUserState$.pipe(map((state) => onDbxAppAuth.DbxAppAuthUserActions.setUserState({ state }))));\n\n readonly setUserRoles = createEffect(() => this.dbxAuthService.authRoles$.pipe(map((roles) => onDbxAppAuth.DbxAppAuthUserActions.setUserRoles({ roles: Array.from(roles ?? []) }))));\n\n readonly setUserIsOnboarded = createEffect(() => this.dbxAuthService.isOnboarded$.pipe(map((isOnboarded) => onDbxAppAuth.DbxAppAuthUserActions.setUserIsOnboarded({ isOnboarded }))));\n}\n","import { type EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\nimport { provideEffects } from '@ngrx/effects';\nimport { provideState } from '@ngrx/store';\nimport { fromDbxAppAuth } from './state';\nimport { DbxAppAuthEffects } from './state/effect/auth.effect';\n\n/**\n * Creates EnvironmentProviders for providing the DbxAppAuth state and effects.\n *\n * @returns EnvironmentProviders\n */\nexport function provideDbxAppAuthState(): EnvironmentProviders {\n return makeEnvironmentProviders([provideState(fromDbxAppAuth.featureKey, fromDbxAppAuth.reducers), provideEffects(DbxAppAuthEffects)]);\n}\n","import { type EnvironmentProviders, makeEnvironmentProviders, type Provider } from '@angular/core';\nimport { provideDbxAppAuthState } from './auth.state.providers';\nimport { provideDbxAppAuthRouter, type ProvideDbxAppAuthRouterConfig } from './router/auth.router.providers';\nimport { provideDbxAppAuthRouterState, type ProvideDbxAppAuthRouterStateConfig } from './router/state/auth.router.state.providers';\n\nexport interface ProvideDbxAppAuthConfig extends ProvideDbxAppAuthRouterConfig, ProvideDbxAppAuthRouterStateConfig {}\n\n/**\n * The \"all-in-one\" provider for an app's dbx-core auth providers.\n *\n * @param config Configuration\n * @returns EnvironmentProviders\n */\nexport function provideDbxAppAuth(config: ProvideDbxAppAuthConfig): EnvironmentProviders {\n const { dbxAppAuthRoutes, activeRoutesToApplyEffects } = config;\n\n const providers: (Provider | EnvironmentProviders)[] = [provideDbxAppAuthState(), provideDbxAppAuthRouter({ dbxAppAuthRoutes }), provideDbxAppAuthRouterState({ activeRoutesToApplyEffects })];\n\n return makeEnvironmentProviders(providers);\n}\n","import { AuthRole, ArrayOrValue, type Maybe } from '@dereekb/util';\nimport { Observable } from 'rxjs';\nimport { Directive, inject, input } from '@angular/core';\nimport { toObservable } from '@angular/core/rxjs-interop';\nimport { authRolesSetContainsAnyRoleFrom, DbxAuthService } from './service';\nimport { AbstractIfDirective } from '../view/if.directive';\n\n/**\n * Structural decorator directive similar to ngIf that embeds content if the current auth user has any of the target role(s).\n */\n@Directive({\n selector: '[dbxAuthHasAnyRole]',\n standalone: true\n})\nexport class DbxAuthHasAnyRoleDirective extends AbstractIfDirective {\n private readonly _authService = inject(DbxAuthService);\n\n readonly targetRoles = input<Maybe<ArrayOrValue<AuthRole>>>(undefined, { alias: 'dbxAuthHasAnyRole' });\n readonly targetRoles$ = toObservable(this.targetRoles);\n\n readonly show$: Observable<boolean> = this._authService.authRoles$.pipe(authRolesSetContainsAnyRoleFrom(this.targetRoles$));\n}\n","import { Maybe, AuthRole, ArrayOrValue } from '@dereekb/util';\nimport { Observable } from 'rxjs';\nimport { Directive, inject, input } from '@angular/core';\nimport { toObservable } from '@angular/core/rxjs-interop';\nimport { authRolesSetContainsAllRolesFrom, DbxAuthService } from './service';\nimport { AbstractIfDirective } from '../view/if.directive';\n\n/**\n * Structural decorator directive similar to ngIf that embeds content if the current auth user has all of the target role(s).\n */\n@Directive({\n selector: '[dbxAuthHasRoles]',\n standalone: true\n})\nexport class DbxAuthHasRolesDirective extends AbstractIfDirective {\n private readonly _authService = inject(DbxAuthService);\n\n readonly targetRoles = input<Maybe<ArrayOrValue<AuthRole>>>(undefined, { alias: 'dbxAuthHasRoles' });\n readonly targetRoles$ = toObservable(this.targetRoles);\n\n readonly show$: Observable<boolean> = this._authService.authRoles$.pipe(authRolesSetContainsAllRolesFrom(this.targetRoles$));\n}\n","import { Maybe, AuthRole, ArrayOrValue } from '@dereekb/util';\nimport { Observable } from 'rxjs';\nimport { Directive, inject, input } from '@angular/core';\nimport { toObservable } from '@angular/core/rxjs-interop';\nimport { authRolesSetContainsNoRolesFrom, DbxAuthService } from './service';\nimport { AbstractIfDirective } from '../view/if.directive';\n\n/**\n * Structural decorator directive similar to ngIf that embeds content if the current auth user has none of the target role(s).\n */\n@Directive({\n selector: '[dbxAuthNotAnyRole]',\n standalone: true\n})\nexport class DbxAuthNotAnyRoleDirective extends AbstractIfDirective {\n private readonly _authService = inject(DbxAuthService);\n\n readonly targetRoles = input<Maybe<ArrayOrValue<AuthRole>>>(undefined, { alias: 'dbxAuthNotAnyRole' });\n readonly targetRoles$ = toObservable(this.targetRoles);\n\n readonly show$: Observable<boolean> = this._authService.authRoles$.pipe(authRolesSetContainsNoRolesFrom(this.targetRoles$));\n}\n","import { Injectable, inject } from '@angular/core';\nimport { Store } from '@ngrx/store';\nimport { fromDbxAppAuth } from './state';\nimport { DbxAppAuthFullState } from './state/state';\n\n/**\n * State for accessing the app's DbxAppAuthState defined within the DbxAppAuthFullState for the ngrx store.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class DbxAppAuthStateService {\n readonly store = inject(Store<DbxAppAuthFullState>);\n readonly authStateUser$ = this.store.select(fromDbxAppAuth.selectDbxAppAuthUser);\n}\n","import { type Type, type Provider, forwardRef } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { type Observable } from 'rxjs';\nimport { type DbxActionWorkProgress, type DbxActionWorkOrWorkProgress } from '../action/action';\n\nexport type DbxButtonWorkingProgress = DbxActionWorkProgress;\n\n/**\n * Working state for a button.\n *\n * Can be a boolean or a number.\n *\n * True is treated as an indeterminate progress.\n */\nexport type DbxButtonWorking = DbxActionWorkOrWorkProgress;\n\n/**\n * Used for intercepting button click events.\n *\n * Can be used to delay/modify trigger/click behaviors.\n */\nexport interface DbxButtonInterceptor {\n /**\n * Handles a button click event. Returns an observable that will say whether or not to continue the click event.\n */\n interceptButtonClick: () => Observable<boolean>;\n}\n\n/**\n * Text and icon display content for a button.\n */\nexport interface DbxButtonDisplay {\n /**\n * button Icon, if applicable\n */\n readonly icon?: Maybe<string>;\n /**\n * button text, if applicable\n */\n readonly text?: Maybe<string>;\n}\n\nexport abstract class DbxButton {\n /**\n * Observable of the disabled state of the button.\n */\n abstract readonly disabled$: Observable<boolean>;\n /**\n * Observable of the working state of the button.\n */\n abstract readonly working$: Observable<DbxButtonWorking>;\n /**\n * Observable of the clicked event of the button.\n */\n abstract readonly clicked$: Observable<unknown>;\n /**\n * Observable of the display content of the button.\n */\n abstract readonly display$: Observable<DbxButtonDisplay>;\n /**\n * Sets the disabled state of the button. If null/undefined the button will be disabled.\n *\n * @param disabled\n */\n abstract setDisabled(disabled?: Maybe<boolean>): void;\n /**\n * Sets the working state of the button.\n *\n * If a number is passed, then it is treated as a progress percentage.\n *\n * If true is passed, then it is treated as an indeterminate progress.\n *\n * If null/undefined is passed, then the button will not be working.\n */\n abstract setWorking(working?: Maybe<DbxButtonWorking>): void;\n /**\n * Sets the display content of the button.\n *\n * @param content\n */\n abstract setDisplayContent(content: DbxButtonDisplay): void;\n /**\n * Sets the button interceptor. If any interceptor is already set, it is replaced.\n *\n * @param interceptor\n */\n abstract setButtonInterceptor(interceptor: DbxButtonInterceptor): void;\n /**\n * Main function to use for handling clicks on the button.\n */\n abstract clickButton(): void;\n}\n\nexport function provideDbxButton<S extends DbxButton>(sourceType: Type<S>): Provider[] {\n return [\n {\n provide: DbxButton,\n useExisting: forwardRef(() => sourceType)\n }\n ];\n}\n\n// MARK: Display\n/**\n * The display type of a button.\n *\n * text_button: A text button has text or is empty.\n * icon_button: An icon button only has an icon and no text.\n */\nexport type DbxButtonDisplayType = 'text_button' | 'icon_button';\n\n/**\n * Delegate class used for retrieving the DbxButtonDisplay given an input value.\n */\nexport interface DbxButtonDisplayDelegate<T> {\n /**\n * Returns the DbxButtonDisplay for the input value.\n *\n * @param value\n */\n buttonDisplayContentForValue(value: T): DbxButtonDisplay;\n}\n\n/**\n * Returns the DbxButtonDisplayType given the input content.\n *\n * @param content\n * @returns\n */\nexport function dbxButtonDisplayType(content: DbxButtonDisplay): DbxButtonDisplayType {\n return !content.text && content.icon ? 'icon_button' : 'text_button';\n}\n","import { Directive, inject } from '@angular/core';\nimport { cleanSubscription } from '../../rxjs';\nimport { DbxButton } from '../button';\nimport { DbxActionContextStoreSourceInstance } from '../../action/action.store.source';\n\n/**\n * Context used for linking a button to an ActionContext and only look for triggers.\n */\n@Directive({\n selector: '[dbxActionButtonTrigger]',\n standalone: true\n})\nexport class DbxActionButtonTriggerDirective {\n readonly dbxButton = inject(DbxButton, { host: true });\n readonly source = inject(DbxActionContextStoreSourceInstance);\n\n constructor() {\n cleanSubscription(\n this.dbxButton.clicked$.subscribe(() => {\n this._buttonClicked();\n })\n );\n }\n\n protected _buttonClicked(): void {\n this.source.trigger();\n }\n}\n","import { Directive } from '@angular/core';\nimport { DbxActionButtonTriggerDirective } from './action.button.trigger.directive';\nimport { cleanSubscription } from '../../rxjs/subscription';\n\n/**\n * Context used for linking a button to an ActionContext.\n */\n@Directive({\n selector: '[dbxActionButton]',\n standalone: true\n})\nexport class DbxActionButtonDirective extends DbxActionButtonTriggerDirective {\n constructor() {\n super();\n\n cleanSubscription(\n this.source.isWorkingOrWorkProgress$.subscribe((working) => {\n this.dbxButton.setWorking(working);\n })\n );\n\n cleanSubscription(\n this.source.isDisabled$.subscribe((disabled) => {\n this.dbxButton.setDisabled(disabled);\n })\n );\n }\n}\n","import { Directive, inject, input } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { cleanSubscription } from '../../rxjs';\nimport { DbxButton } from '../button';\nimport { DbxRouterService } from '../../router/router/service/router.service';\nimport { SegueRef } from '../../router/segue';\n\n// MARK: Button Directives\n@Directive({\n selector: '[dbxButtonSegue]',\n standalone: true\n})\nexport class DbxButtonSegueDirective {\n readonly dbxButton = inject(DbxButton);\n readonly dbxRouterService = inject(DbxRouterService);\n\n readonly segueRef = input<Maybe<SegueRef>>(undefined, { alias: 'dbxButtonSegue' });\n\n constructor() {\n cleanSubscription(() =>\n this.dbxButton.clicked$.subscribe(() => {\n const segueRef = this.segueRef();\n\n if (segueRef) {\n this.dbxRouterService.go(segueRef);\n }\n })\n );\n }\n}\n","import { Directive, Signal, computed, input, output, signal } from '@angular/core';\nimport { isDefinedAndNotFalse, type Maybe } from '@dereekb/util';\nimport { of, Subject, filter, first, switchMap, BehaviorSubject } from 'rxjs';\nimport { cleanSubscription, completeOnDestroy } from '../rxjs';\nimport { DbxButton, DbxButtonDisplay, DbxButtonDisplayType, dbxButtonDisplayType, DbxButtonInterceptor, DbxButtonWorking, provideDbxButton } from './button';\nimport { outputToObservable, toObservable } from '@angular/core/rxjs-interop';\n\n/**\n * Abstract button component.\n */\n@Directive()\nexport abstract class AbstractDbxButtonDirective implements DbxButton {\n /**\n * Pre-interceptor button click.\n */\n protected readonly _buttonClick = completeOnDestroy(new Subject<void>());\n protected readonly _buttonInterceptor = completeOnDestroy(new BehaviorSubject<Maybe<DbxButtonInterceptor>>(undefined));\n\n readonly buttonClick = output();\n\n readonly disabled = input<boolean, Maybe<boolean>>(false, { transform: Boolean });\n readonly working = input<DbxButtonWorking, Maybe<DbxButtonWorking>>(false, { transform: (x) => (x == null ? false : x) });\n readonly buttonDisplay = input<Maybe<DbxButtonDisplay>>(undefined);\n\n private readonly _disabledSignal = signal<Maybe<boolean>>(undefined);\n private readonly _workingSignal = signal<Maybe<DbxButtonWorking>>(undefined);\n private readonly _buttonDisplayContentSignal = signal<Maybe<DbxButtonDisplay>>(undefined);\n\n readonly disabledSignal = computed(() => this._disabledSignal() ?? this.disabled());\n readonly workingSignal = computed(() => this._workingSignal() ?? this.working());\n\n readonly isWorkingSignal = computed(() => {\n const working = this.workingSignal();\n return isDefinedAndNotFalse(working);\n });\n\n readonly icon = input<Maybe<string>>();\n readonly text = input<Maybe<string>>();\n\n readonly buttonDisplayContentSignal: Signal<DbxButtonDisplay> = computed(() => {\n const icon = this.icon();\n const text = this.text();\n const buttonDisplay = this.buttonDisplay();\n\n const buttonDisplayContent = this._buttonDisplayContentSignal() ?? buttonDisplay;\n return { icon: icon || buttonDisplayContent?.icon, text: text || buttonDisplayContent?.text };\n });\n\n readonly buttonDisplayTypeSignal: Signal<DbxButtonDisplayType> = computed(() => {\n return dbxButtonDisplayType(this.buttonDisplayContentSignal());\n });\n\n readonly iconSignal: Signal<Maybe<string>> = computed(() => this.buttonDisplayContentSignal()?.icon);\n readonly textSignal: Signal<Maybe<string>> = computed(() => this.buttonDisplayContentSignal()?.text);\n\n readonly disabled$ = toObservable(this.disabledSignal);\n readonly working$ = toObservable(this.workingSignal);\n readonly display$ = toObservable(this.buttonDisplayContentSignal);\n readonly clicked$ = outputToObservable(this.buttonClick);\n\n constructor() {\n cleanSubscription(\n this._buttonClick\n .pipe(\n switchMap(() =>\n this._buttonInterceptor.pipe(\n switchMap((x) => {\n if (x) {\n return x.interceptButtonClick().pipe(first());\n } else {\n return of(true);\n }\n }),\n filter((x) => Boolean(x)) // Ignore false values.\n )\n )\n )\n .subscribe(() => {\n this._forceButtonClicked();\n })\n );\n }\n\n setDisabled(disabled?: Maybe<boolean>): void {\n this._disabledSignal.set(disabled);\n }\n\n setWorking(working?: Maybe<DbxButtonWorking>): void {\n this._workingSignal.set(working);\n }\n\n setDisplayContent(content: DbxButtonDisplay): void {\n this._buttonDisplayContentSignal.set(content);\n }\n\n /**\n * Sets the button interceptor. If any interceptor is already set, it is replaced.\n */\n public setButtonInterceptor(interceptor: DbxButtonInterceptor): void {\n this._buttonInterceptor.next(interceptor);\n }\n\n /**\n * Main function to use for handling clicks on the button.\n */\n public clickButton(): void {\n if (!this.disabled()) {\n this._buttonClick.next();\n }\n }\n\n /**\n * Forces a button click. Skips the interceptors if any are configured.\n */\n protected _forceButtonClicked(): void {\n this.buttonClick.emit();\n }\n}\n\n// MARK: Implementation\n/**\n * Provides an DbxButton directive.\n */\n@Directive({\n selector: '[dbxButton]',\n exportAs: 'dbxButton',\n providers: provideDbxButton(DbxButtonDirective),\n standalone: true\n})\nexport class DbxButtonDirective extends AbstractDbxButtonDirective {}\n","import { Directive, effect, inject, input } from '@angular/core';\nimport { LoadingContext, MaybeObservableOrValue, maybeValueFromObservableOrValue } from '@dereekb/rxjs';\nimport { DbxButton } from './button';\nimport { toObservable, toSignal } from '@angular/core/rxjs-interop';\nimport { distinctUntilChanged, shareReplay, Subscription } from 'rxjs';\nimport { cleanSubscription } from '../rxjs/subscription';\n\n/**\n * Context used for linking a button to a LoadingContext.\n *\n * It will be set working when the context is set loading.\n */\n@Directive({\n selector: '[dbxLoadingButton]',\n standalone: true\n})\nexport class DbxLoadingButtonDirective {\n readonly dbxButton = inject(DbxButton, { host: true });\n readonly context = input.required<MaybeObservableOrValue<LoadingContext>>({ alias: 'dbxLoadingButton' });\n readonly context$ = toObservable(this.context).pipe(maybeValueFromObservableOrValue(), distinctUntilChanged(), shareReplay(1));\n readonly contextSignal = toSignal(this.context$);\n\n protected readonly _loadingEffectSub = cleanSubscription();\n protected readonly _loadingEffect = effect(() => {\n const context = this.contextSignal();\n let subscription: Subscription | undefined;\n\n if (context) {\n subscription = context.stream$.subscribe((x) => this.dbxButton.setWorking(x.loading));\n }\n\n this._loadingEffectSub.setSub(subscription);\n });\n}\n","import { NgModule } from '@angular/core';\nimport { DbxActionButtonTriggerDirective, DbxActionButtonDirective } from './action';\nimport { DbxButtonDirective } from './button.directive';\nimport { DbxLoadingButtonDirective } from './button.loading.directive';\nimport { DbxButtonSegueDirective } from './router/button.segue.directive';\n\nconst importsAndExports = [DbxButtonDirective, DbxLoadingButtonDirective, DbxActionButtonTriggerDirective, DbxActionButtonDirective, DbxButtonSegueDirective];\n\n/**\n * Exports the following directives:\n * - DbxButtonDirective\n * - DbxLoadingButtonDirective\n * - DbxActionButtonTriggerDirective\n * - DbxActionButtonDirective\n * - DbxButtonSegueDirective\n */\n@NgModule({\n imports: importsAndExports,\n exports: importsAndExports\n})\nexport class DbxCoreButtonModule {}\n","import { Injectable, inject } from '@angular/core';\nimport { Store } from '@ngrx/store';\nimport { DbxAppContextState } from './context';\nimport { onDbxAppContext, fromDbxAppContext } from './state';\nimport { DbxAppContextFullState } from './state/state';\n\n/**\n * State for accessing the app's DbxAppContextState defined within the DbxAppContextFullState for the ngrx store.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class DbxAppContextService {\n readonly store = inject(Store<DbxAppContextFullState>);\n readonly state$ = this.store.select(fromDbxAppContext.selectDbxAppContextState);\n\n setState(state: DbxAppContextState) {\n this.store.dispatch(onDbxAppContext.DbxAppContextActions.setState({ state }));\n }\n\n resetState() {\n this.store.next(onDbxAppContext.DbxAppContextActions.resetState());\n }\n}\n","import { Directive, effect, inject, input } from '@angular/core';\nimport { DbxAppContextService } from './context.service';\nimport { DbxAppContextState } from './context';\nimport { type Maybe } from '@dereekb/util';\n\n/**\n * Used to set the DbxAppContextState for an app to the input state using the DbxAppContextService.\n */\n@Directive({\n selector: '[dbxAppContextState]',\n standalone: true\n})\nexport class DbxAppContextStateDirective {\n readonly dbxAppContextStateService = inject(DbxAppContextService);\n\n readonly state = input<Maybe<DbxAppContextState>>(undefined, { alias: 'dbxAppContextState' });\n\n protected readonly _stateEffect = effect(() => {\n const state = this.state();\n\n if (state != null) {\n this.dbxAppContextStateService.setState(state);\n }\n });\n}\n","import { type EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\nimport { provideState } from '@ngrx/store';\nimport { fromDbxAppContext } from './state';\n\n/**\n * Creates EnvironmentProviders for providing the DbxAppContext state.\n *\n * @returns EnvironmentProviders\n */\nexport function provideDbxAppContextState(): EnvironmentProviders {\n return makeEnvironmentProviders([provideState(fromDbxAppContext.featureKey, fromDbxAppContext.reducers)]);\n}\n","/**\n * App environment details\n */\nexport abstract class DbxAppEnviroment {\n /**\n * Whether or not this is a production environment.\n */\n abstract production: boolean;\n /**\n * Whether or not this is a testing environment.\n *\n * Generally \"production\" is false when this is true.\n */\n abstract testing?: boolean;\n /**\n * Whether or not this is a staging environment.\n *\n * Generally \"production\" is true when this is true.\n */\n abstract staging?: boolean;\n}\n","import { Injectable, inject } from '@angular/core';\nimport { DbxAppEnviroment } from './environment';\n\n/**\n * Service for accessing the app's environment details.\n */\n@Injectable()\nexport class DbxAppEnviromentService {\n readonly environment = inject(DbxAppEnviroment);\n\n get isProduction() {\n return this.environment.production === true;\n }\n\n get isStaging() {\n return this.environment.staging ?? false;\n }\n\n get isTesting() {\n return this.environment.testing ?? !this.environment.production;\n }\n\n /**\n * Returns the environment, typed as a specific type.\n */\n getEnvironment<T extends DbxAppEnviroment>(): T {\n return this.environment as T;\n }\n}\n","import { type EnvironmentProviders, makeEnvironmentProviders, type Provider } from '@angular/core';\nimport { DbxAppEnviroment } from './environment';\nimport { DbxAppEnviromentService } from './environment.service';\n\n/**\n * Provides the DbxAppEnviromentService and DbxAppEnviroment.\n *\n * @param environment\n */\nexport function provideDbxAppEnviroment(environment: DbxAppEnviroment): EnvironmentProviders {\n const providers: Provider[] = [\n {\n provide: DbxAppEnviroment,\n useValue: environment\n },\n DbxAppEnviromentService\n ];\n\n return makeEnvironmentProviders(providers);\n}\n","import { type MousableFunction } from './mousable';\nimport { type ClickableFunction, type ClickableUrl } from './clickable';\nimport { type SegueRef } from '../segue';\nimport { expandFlattenTreeFunction, expandTreeFunction, type ExpandTreeFunction, type FlattenTreeFunction, flattenTreeToArrayFunction, type Maybe, type TreeNode } from '@dereekb/util';\nimport { type Type, type Provider, forwardRef } from '@angular/core';\nimport { type Observable } from 'rxjs';\nimport { type DbxInjectionComponentConfig } from '../../injection/injection';\n\nexport interface ClickableAnchor extends ClickableFunction, MousableFunction, ClickableUrl, Partial<SegueRef> {\n readonly disabled?: boolean;\n readonly selected?: boolean;\n}\n\n/**\n * Title and an optional icon.\n */\nexport interface IconAndTitle {\n readonly title: string;\n readonly icon?: Maybe<string>;\n}\n\nexport interface ClickableAnchorLink extends ClickableAnchor, IconAndTitle {\n /**\n * Optional detail string/content.\n */\n readonly hint?: string;\n /**\n * Custom injection content for this link.\n */\n readonly content?: DbxInjectionComponentConfig;\n}\n\n/**\n * ClickableAnchorLink that definitely has a SegueRef\n */\nexport type ClickableAnchorLinkSegueRef = ClickableAnchorLink & SegueRef;\n\nexport interface ClickableIconAnchorLink extends Omit<ClickableAnchorLink, 'title'> {\n readonly icon: string;\n}\n\nexport interface ClickableAnchorLinkTree extends ClickableAnchorLink {\n readonly children?: ClickableAnchorLinkTree[];\n}\n\nexport type ExpandedClickableAnchorLinkTree = TreeNode<ClickableAnchorLinkTree>;\n\nexport const expandClickableAnchorLinkTreeNode: ExpandTreeFunction<ClickableAnchorLinkTree, ExpandedClickableAnchorLinkTree> = expandTreeFunction({\n getChildren: (x) => x.children\n});\n\nexport const flattenExpandedClickableAnchorLinkTree: FlattenTreeFunction<ExpandedClickableAnchorLinkTree, ExpandedClickableAnchorLinkTree> = flattenTreeToArrayFunction();\nexport const flattenExpandedClickableAnchorLinkTreeToLinks: FlattenTreeFunction<ExpandedClickableAnchorLinkTree, ClickableAnchorLinkTree> = flattenTreeToArrayFunction((x) => x.value);\n\n/**\n * Fully expands the given parent link and flattens the tree to a single parent link.\n *\n * @param link\n * @returns\n */\nexport function expandClickableAnchorLinkTree(link: ClickableAnchorLinkTree): ExpandedClickableAnchorLinkTree[] {\n return flattenExpandedClickableAnchorLinkTree(expandClickableAnchorLinkTreeNode(link));\n}\n\n/**\n * Expands an array of links into an array of ExpandedClickableAnchorLinkTree tree values.\n */\nexport const expandClickableAnchorLinkTrees = expandFlattenTreeFunction<ClickableAnchorLinkTree, ExpandedClickableAnchorLinkTree>(expandClickableAnchorLinkTreeNode, flattenExpandedClickableAnchorLinkTree);\n\n/**\n * Describes the Anchor type given a ClickableAnchor.\n *\n * - plain: When the anchor has no specific content but is not disabled. It is a passthrough for the content.\n * - clickable: When the anchor has a click handler\n * - sref: When the anchor has a SegueRef\n * - href: When the anchor has a URL\n * - disabled: When the anchor is disabled.\n */\nexport type ClickableAnchorType = 'plain' | 'clickable' | 'sref' | 'href' | 'disabled';\n\nexport function anchorTypeForAnchor(anchor: Maybe<ClickableAnchor>, disabled?: Maybe<boolean>): ClickableAnchorType {\n let type: ClickableAnchorType = 'disabled';\n\n if (!disabled && anchor) {\n if (anchor.disabled) {\n type = 'disabled';\n } else if (anchor.ref) {\n type = 'sref';\n } else if (anchor.onClick) {\n type = 'clickable';\n } else if (anchor.url) {\n type = 'href';\n } else {\n type = 'plain';\n }\n }\n\n return type;\n}\n\nexport abstract class DbxAnchor<T extends ClickableAnchor = ClickableAnchor> {\n abstract readonly disabled$: Observable<Maybe<boolean>>;\n abstract readonly selected$: Observable<Maybe<boolean>>;\n abstract readonly anchor$: Observable<Maybe<T>>;\n abstract readonly type$: Observable<ClickableAnchorType>;\n}\n\nexport function provideDbxAnchor<S extends DbxAnchor>(sourceType: Type<S>): Provider[] {\n return [\n {\n provide: DbxAnchor,\n useExisting: forwardRef(() => sourceType)\n }\n ];\n}\n","import { Observable } from 'rxjs';\nimport { computed, Directive, model } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { ClickableAnchorType, ClickableAnchor, anchorTypeForAnchor, DbxAnchor } from './anchor';\nimport { SegueRefOrSegueRefRouterLink, asSegueRef } from '../segue';\nimport { toObservable } from '@angular/core/rxjs-interop';\n\n/**\n * Abstract anchor directive.\n */\n@Directive()\nexport class AbstractDbxAnchorDirective<T extends ClickableAnchor = ClickableAnchor> implements DbxAnchor {\n readonly ref = model<Maybe<SegueRefOrSegueRefRouterLink>>();\n\n readonly anchor = model<Maybe<T>>();\n readonly disabled = model<Maybe<boolean>>();\n readonly selected = model<Maybe<boolean>>();\n\n readonly anchorSignal = computed(() => {\n const ref = this.ref();\n const anchor = this.anchor();\n\n let result: Maybe<T> = anchor;\n\n if (ref != null) {\n result = asSegueRef(ref) as T;\n }\n\n return result;\n });\n\n readonly selectedSignal = computed(() => {\n const selected = this.selected();\n const anchor = this.anchorSignal();\n\n return selected || anchor?.selected;\n });\n\n readonly typeSignal = computed(() => {\n const anchor = this.anchorSignal();\n const disabled = this.disabled();\n return anchorTypeForAnchor(anchor, disabled);\n });\n\n readonly disabledSignal = computed(() => {\n const disabled = this.disabled();\n const anchor = this.anchorSignal();\n\n return disabled || anchor?.disabled;\n });\n\n readonly urlSignal = computed(() => this.anchorSignal()?.url);\n readonly targetSignal = computed(() => this.anchorSignal()?.target);\n\n readonly anchor$: Observable<Maybe<T>> = toObservable(this.anchorSignal);\n readonly disabled$: Observable<Maybe<boolean>> = toObservable(this.disabledSignal);\n readonly selected$: Observable<Maybe<boolean>> = toObservable(this.selectedSignal);\n readonly type$: Observable<ClickableAnchorType> = toObservable(this.typeSignal);\n\n // MARK: Accessors\n setRef(ref: Maybe<SegueRefOrSegueRefRouterLink>) {\n this.ref.set(ref);\n }\n\n setAnchor(anchor: Maybe<T>) {\n this.anchor.set(anchor);\n }\n\n setDisabled(disabled: Maybe<boolean>) {\n this.disabled.set(disabled);\n }\n\n setSelected(selected: Maybe<boolean>) {\n this.selected.set(selected);\n }\n}\n","import { type E164PhoneNumberWithOptionalExtension, type MailToUrlInput, mailToUrlString, type Maybe, type PhoneNumber, telUrlString, type WebsiteUrl } from '@dereekb/util';\n\nexport interface ClickableFunction {\n readonly onClick?: (event?: Maybe<MouseEvent>) => void;\n}\n\n/**\n * Represents a clickable href/url configuration.\n */\nexport interface ClickableUrl {\n /**\n * href url\n */\n readonly url?: string;\n /**\n * href target attribute.\n */\n readonly target?: string;\n}\n\nexport function clickableUrlInNewTab(url: string | WebsiteUrl): ClickableUrl {\n return {\n url,\n target: '_blank'\n };\n}\n\nexport function clickableUrlMailTo(mailTo: MailToUrlInput): ClickableUrl {\n return {\n url: mailToUrlString(mailTo)\n };\n}\n\nexport function clickableUrlTel(tel: PhoneNumber | E164PhoneNumberWithOptionalExtension): ClickableUrl {\n return {\n url: telUrlString(tel)\n };\n}\n","import { DbxAuthService } from '../../../auth/service/auth.service';\nimport { type TransitionService, type TransitionHookFn, type Transition, type HookResult, type StateService, type HookMatchCriteria } from '@uirouter/core';\nimport { type Maybe, type ModelKey } from '@dereekb/util';\nimport { map, first, switchMap, firstValueFrom, type Observable, of } from 'rxjs';\nimport { type Injector } from '@angular/core';\n\nexport const DEFAULT_REDIRECT_FOR_IDENTIFIER_PARAM_VALUE = '0';\nexport const DEFAULT_REDIRECT_FOR_IDENTIFIER_PARAM_KEY = 'id';\n\nexport interface RedirectForIdentifierParamHookInput {\n /**\n * Factory that returns an observable that sends the default allowed identifier to use when accessing the resource.\n */\n readonly defaultAllowedValue: (authService: DbxAuthService, injector: Injector, transition: Transition) => Observable<ModelKey>;\n /**\n * Route parameter to use.\n *\n * Defaults to \"uid\"\n */\n readonly idParam?: string;\n /**\n * The default param value to check against.\n *\n * Defaults to 0.\n */\n readonly defaultParamValue?: string;\n /**\n * Criteria or route to watch and intercept.\n */\n readonly criteria: HookMatchCriteria | string;\n readonly transitionService: TransitionService;\n /**\n * Whether or not the current user can view the target id.\n *\n * Can return another identifier, or true to allow access, or false/null/undefined to deny access.\n */\n readonly canViewModelWithId: (targetId: ModelKey, authService: DbxAuthService, injector: Injector) => Observable<Maybe<boolean | ModelKey>>;\n /**\n * Hook priority\n */\n readonly priority?: number;\n}\n\n/**\n * This hook asserts the user is allowed to view a route with an identifier as a state parameter.\n */\nexport function redirectForIdentifierParamHook(input: RedirectForIdentifierParamHookInput): void {\n const { defaultAllowedValue, idParam = DEFAULT_REDIRECT_FOR_IDENTIFIER_PARAM_KEY, defaultParamValue = DEFAULT_REDIRECT_FOR_IDENTIFIER_PARAM_VALUE, priority = 100, transitionService, canViewModelWithId: canViewUser } = input;\n const criteria: HookMatchCriteria = typeof input.criteria === 'string' ? { entering: input.criteria } : input.criteria;\n\n // https://ui-router.github.io/ng2/docs/latest/modules/transition.html#hookresult\n const assertAllowedId: TransitionHookFn = (transition: Transition): HookResult => {\n const $state: StateService = transition.router.stateService;\n const injector = transition.injector();\n const authService: DbxAuthService = injector.get(DbxAuthService);\n const params = transition.params();\n\n const transitionTargetId: Maybe<string> = params[idParam];\n const defaultAllowedValueObs$ = defaultAllowedValue(authService, injector, transition);\n\n return firstValueFrom(\n defaultAllowedValueObs$.pipe(\n first(),\n switchMap((defaultAllowedIdValue) => {\n let result: Observable<HookResult> = of(true);\n\n let redirectToId: Maybe<Observable<Maybe<ModelKey>>>;\n\n if (!transitionTargetId || transitionTargetId === defaultParamValue) {\n // If the param isn't set, default to the default value\n redirectToId = of(defaultAllowedIdValue);\n } else if (defaultAllowedIdValue !== transitionTargetId) {\n redirectToId = canViewUser(transitionTargetId, authService, injector).pipe(\n map((x) => {\n if (x == null || typeof x === 'boolean') {\n return x ? transitionTargetId : defaultAllowedIdValue;\n } else {\n return x;\n }\n })\n );\n }\n\n if (redirectToId != null) {\n result = redirectToId.pipe(\n first(),\n map((targetId) => {\n if (targetId !== transitionTargetId) {\n const target = transition.targetState();\n const state = target.state();\n return $state.target(state, { ...params, [idParam]: targetId }, { location: true });\n } else {\n return true;\n }\n })\n );\n }\n\n return result;\n })\n )\n ) as HookResult;\n };\n\n // Register the \"requires auth\" hook with the TransitionsService\n transitionService.onBefore(criteria, assertAllowedId, { priority });\n}\n","import { type AuthUserIdentifier } from '../../../auth/auth.user';\nimport { type DbxAuthService } from '../../../auth/service/auth.service';\nimport { type TransitionService, type HookMatchCriteria } from '@uirouter/core';\nimport { type Maybe } from '@dereekb/util';\nimport { type Observable } from 'rxjs';\nimport { type Injector } from '@angular/core';\nimport { redirectForIdentifierParamHook } from './id.hook';\n\nexport const DEFAULT_REDIRECT_FOR_USER_IDENTIFIER_PARAM_VALUE = '0';\nexport const DEFAULT_REDIRECT_FOR_USER_IDENTIFIER_PARAM_KEY = 'uid';\n\nexport interface RedirectForUserIdentifierParamHookInput {\n /**\n * Route parameter to use.\n *\n * Defaults to \"uid\"\n */\n readonly uidParam?: string;\n /**\n * The default param value to check against.\n *\n * Defaults to 0.\n */\n readonly defaultParamValue?: string;\n /**\n * Criteria or route to watch and intercept.\n */\n readonly criteria: HookMatchCriteria | string;\n readonly transitionService: TransitionService;\n /**\n * Whether or not the current user can view the target user.\n *\n * Can return another users identifier, or true to allow access, or false/null/undefined to deny access.\n */\n readonly canViewUser: (targetUid: AuthUserIdentifier, authService: DbxAuthService, injector: Injector) => Observable<Maybe<boolean | AuthUserIdentifier>>;\n /**\n * Hook priority\n */\n readonly priority?: number;\n}\n\n/**\n * This hook asserts the user is allowed to view a route with a user identifier as a parameter.\n */\nexport function redirectForUserIdentifierParamHook(input: RedirectForUserIdentifierParamHookInput): void {\n const { uidParam = DEFAULT_REDIRECT_FOR_USER_IDENTIFIER_PARAM_KEY, defaultParamValue = DEFAULT_REDIRECT_FOR_USER_IDENTIFIER_PARAM_VALUE, criteria, priority = 100, transitionService, canViewUser } = input;\n\n return redirectForIdentifierParamHook({\n defaultAllowedValue: (authService: DbxAuthService) => authService.userIdentifier$,\n idParam: uidParam,\n defaultParamValue,\n criteria,\n transitionService,\n canViewModelWithId: canViewUser,\n priority\n });\n}\n","export enum DbxRouterTransitionEventType {\n /**\n * A transition started.\n */\n START = 'start',\n /**\n * A transition ended.\n */\n SUCCESS = 'success'\n}\n\nexport interface DbxRouterTransitionEvent {\n type: DbxRouterTransitionEventType;\n}\n","import { map, Observable, combineLatest, firstValueFrom } from 'rxjs';\nimport { asObservable, filterMaybe, ObservableOrValue } from '@dereekb/rxjs';\nimport { DbxRouterService } from '../../service/router.service';\nimport { DbxRouterTransitionService } from '../../service/router.transition.service';\nimport { asSegueRef, SegueRef, SegueRefOrSegueRefRouterLink, SegueRefRawSegueParams } from '../../../segue';\nimport { DbxRouterTransitionEvent, DbxRouterTransitionEventType } from '../../transition/transition';\nimport { ActivatedRoute, NavigationBehaviorOptions, NavigationEnd, NavigationExtras, NavigationStart, Router, UrlTree } from '@angular/router';\nimport { Injectable, inject } from '@angular/core';\nimport { isArray } from 'class-validator';\nimport { KeyValueTypleValueFilter, Maybe, mergeObjects } from '@dereekb/util';\n\n/**\n * AngularRouter implementation of DbxRouterService and DbxRouterTransitionService.\n */\n@Injectable()\nexport class DbxAngularRouterService implements DbxRouterService, DbxRouterTransitionService {\n readonly router = inject(Router);\n readonly activatedRoute = inject(ActivatedRoute);\n\n readonly params$: Observable<SegueRefRawSegueParams> = this.activatedRoute.params;\n\n readonly transitions$ = this.router.events.pipe(\n map((x) => {\n let event: Maybe<DbxRouterTransitionEvent>;\n\n if (x instanceof NavigationStart) {\n event = {\n type: DbxRouterTransitionEventType.START\n };\n } else if (x instanceof NavigationEnd) {\n event = {\n type: DbxRouterTransitionEventType.SUCCESS\n };\n }\n\n return event;\n }),\n filterMaybe()\n );\n\n go(input: ObservableOrValue<SegueRefOrSegueRefRouterLink<NavigationExtras | NavigationBehaviorOptions>>): Promise<boolean> {\n const inputObs = asObservable(input);\n return firstValueFrom(inputObs).then((inputSegueRef) => {\n const segueRef = asSegueRef(inputSegueRef);\n const ref = segueRef.ref;\n\n if (isArray(ref)) {\n return this.router.navigate(ref as unknown[], {\n ...segueRef.refOptions,\n queryParams: segueRef.refParams\n });\n } else {\n return this.router.navigateByUrl(ref as string | UrlTree, {\n ...segueRef.refOptions\n });\n }\n });\n }\n\n updateParams(inputParams: ObservableOrValue<SegueRefRawSegueParams>): Promise<boolean> {\n const segueUpdate: Observable<SegueRefOrSegueRefRouterLink<NavigationExtras | NavigationBehaviorOptions>> = combineLatest([this.activatedRoute.params, asObservable(inputParams)]).pipe(\n map(([currentParams, params]) => {\n const refParams = mergeObjects([currentParams, params], KeyValueTypleValueFilter.UNDEFINED);\n const segueRef: SegueRef<NavigationExtras | NavigationBehaviorOptions> = {\n ref: this.activatedRoute.pathFromRoot,\n refParams,\n refOptions: {\n replaceUrl: true\n }\n };\n\n return segueRef;\n })\n );\n\n return this.go(segueUpdate);\n }\n\n isActive(segueRef: SegueRefOrSegueRefRouterLink): boolean {\n return false; // TODO!\n }\n\n isActiveExactly(segueRef: SegueRefOrSegueRefRouterLink): boolean {\n return false; // TODO!\n }\n\n comparePrecision(a: SegueRefOrSegueRefRouterLink, b: SegueRefOrSegueRefRouterLink): number {\n return 0; // TODO!\n }\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { DbxRouterService } from '../../service/router.service';\nimport { DbxRouterTransitionService } from '../../service/router.transition.service';\nimport { DbxAngularRouterService } from './angular.router.service';\n\n@NgModule({})\nexport class DbxCoreAngularRouterSegueModule {\n static forRoot(): ModuleWithProviders<DbxCoreAngularRouterSegueModule> {\n return {\n ngModule: DbxCoreAngularRouterSegueModule,\n providers: [\n DbxAngularRouterService,\n {\n provide: DbxRouterService,\n useExisting: DbxAngularRouterService\n },\n {\n provide: DbxRouterTransitionService,\n useExisting: DbxAngularRouterService\n }\n ]\n };\n }\n}\n","import { KeyValueTypleValueFilter, mergeObjects } from '@dereekb/util';\nimport { Subject, BehaviorSubject, Observable, firstValueFrom, map } from 'rxjs';\nimport { DbxRouterService } from '../../service/router.service';\nimport { DbxRouterTransitionService } from '../../service/router.transition.service';\nimport { asSegueRef, asSegueRefString, SegueRef, SegueRefOrSegueRefRouterLink, SegueRefRawSegueParams } from '../../../segue';\nimport { StateService, UIRouterGlobals, TransitionOptions, TransitionService } from '@uirouter/core';\nimport { Injectable, OnDestroy, inject } from '@angular/core';\nimport { DbxRouterTransitionEvent, DbxRouterTransitionEventType } from '../../transition/transition';\nimport { ObservableOrValue, asObservable } from '@dereekb/rxjs';\n\n/**\n * UIRouter implementation of DbxRouterService and DbxRouterTransitionService.\n */\n@Injectable()\nexport class DbxUIRouterService implements DbxRouterService, DbxRouterTransitionService, OnDestroy {\n readonly state = inject(StateService);\n readonly transitionService = inject(TransitionService);\n readonly uiRouterGlobals = inject(UIRouterGlobals);\n\n private readonly _params = new BehaviorSubject<SegueRefRawSegueParams>(this.uiRouterGlobals.params);\n\n readonly params$ = this._params.asObservable();\n\n private readonly _transitions = new Subject<DbxRouterTransitionEvent>();\n readonly transitions$ = this._transitions.asObservable();\n\n constructor() {\n const emitTransition = (type: DbxRouterTransitionEventType) => {\n this._transitions.next({\n type\n });\n\n this._params.next(this.uiRouterGlobals.params);\n };\n\n this.transitionService.onStart({}, () => {\n emitTransition(DbxRouterTransitionEventType.START);\n });\n\n this.transitionService.onSuccess({}, () => {\n emitTransition(DbxRouterTransitionEventType.SUCCESS);\n });\n }\n\n ngOnDestroy(): void {\n this._transitions.complete();\n }\n\n get params() {\n return this.uiRouterGlobals.params;\n }\n\n go(input: ObservableOrValue<SegueRefOrSegueRefRouterLink<TransitionOptions>>): Promise<boolean> {\n const inputObs = asObservable(input);\n return firstValueFrom(inputObs).then((inputSegueRef) => {\n const segueRef = asSegueRef(inputSegueRef);\n const params = { ...this.uiRouterGlobals.current.params, ...segueRef.refParams };\n return this.state\n .go(segueRef.ref as string, params, segueRef.refOptions)\n .then(() => true)\n .catch(() => false);\n });\n }\n\n updateParams(inputParams: ObservableOrValue<SegueRefRawSegueParams>): Promise<boolean> {\n const segueUpdate: Observable<SegueRefOrSegueRefRouterLink<TransitionOptions>> = asObservable(inputParams).pipe(\n map((params) => {\n const currentParams = this.uiRouterGlobals.params;\n const refParams = mergeObjects([currentParams, params], KeyValueTypleValueFilter.UNDEFINED);\n\n const ref: SegueRef<TransitionOptions> = {\n ref: '.',\n refParams,\n refOptions: {\n location: 'replace',\n inherit: true\n }\n };\n\n return ref;\n })\n );\n\n return this.go(segueUpdate);\n }\n\n isActive(input: SegueRefOrSegueRefRouterLink): boolean {\n return this.isActiveState(input, false);\n }\n\n isActiveExactly(input: SegueRefOrSegueRefRouterLink): boolean {\n return this.isActiveState(input, true);\n }\n\n comparePrecision(aInput: SegueRefOrSegueRefRouterLink, bInput: SegueRefOrSegueRefRouterLink): number {\n const aRef = asSegueRefString(aInput);\n const bRef = asSegueRefString(bInput);\n\n const aLength = aRef.length;\n const bLength = bRef.length;\n return aLength > bLength ? 1 : aLength === bLength ? 0 : -1;\n }\n\n // MARK: Internal\n isActiveState(input: SegueRefOrSegueRefRouterLink, exactly: boolean): boolean {\n const segueRef = asSegueRef(input);\n const ref = segueRef.ref as string;\n const refParams = segueRef.refParams;\n\n const targetRef = ref.startsWith('.') ? `^${ref}` : ref;\n const active = exactly ? this.state.is(targetRef, refParams) : this.state.includes(targetRef, refParams);\n return active;\n }\n}\n","import { DbxRouterService } from '../../service/router.service';\nimport { DbxRouterTransitionService } from '../../service/router.transition.service';\nimport { type EnvironmentProviders, makeEnvironmentProviders, type Provider } from '@angular/core';\nimport { DbxUIRouterService } from './uirouter.router.service';\n\n/**\n * Provides a DbxUIRouterService and configures it to provide for DbxRouterService and DbxRouterTransitionService.\n *\n * @returns EnvironmentProviders\n */\nexport function provideDbxUIRouterService(): EnvironmentProviders {\n const providers: Provider[] = [\n DbxUIRouterService,\n {\n provide: DbxRouterService,\n useExisting: DbxUIRouterService\n },\n {\n provide: DbxRouterTransitionService,\n useExisting: DbxUIRouterService\n }\n ];\n\n return makeEnvironmentProviders(providers);\n}\n","import { distinctUntilKeysChange } from '@dereekb/rxjs';\nimport { type ArrayOrValue, asArray, filterMaybeArrayValues, type IndexRef } from '@dereekb/util';\nimport { filter, map, type MonoTypeOperatorFunction, type Observable, distinctUntilChanged, shareReplay, startWith } from 'rxjs';\nimport { type SegueRefOrSegueRefRouterLink } from '../../segue';\nimport { type DbxRouterService } from '../service/router.service';\nimport { type DbxRouterTransitionService } from '../service/router.transition.service';\nimport { type DbxRouterTransitionEvent, DbxRouterTransitionEventType } from './transition';\n\n/**\n * Convenience function for filtering success from the input observable.\n *\n * @param obs\n * @returns\n */\nexport function successTransition(obs: Observable<DbxRouterTransitionEvent>): Observable<DbxRouterTransitionEvent> {\n return obs.pipe(filterTransitionSuccess());\n}\n\nexport function filterTransitionSuccess(): MonoTypeOperatorFunction<DbxRouterTransitionEvent> {\n return filterTransitionEvent(DbxRouterTransitionEventType.SUCCESS);\n}\n\nexport function filterTransitionEvent(type: DbxRouterTransitionEventType): MonoTypeOperatorFunction<DbxRouterTransitionEvent> {\n return filter((x) => x.type === type);\n}\n// MARK: LatestSuccessfulRoutesConfig\nexport interface LatestSuccessfulRoutesConfigRoute {\n /**\n * Route to check if it is active or not.\n */\n readonly route: SegueRefOrSegueRefRouterLink;\n /**\n * Whether or not to match the route exactly.\n */\n readonly activeExactly?: boolean;\n}\n\ninterface LatestSuccessfulRoutesConfigRouteItem<T> extends IndexRef {\n readonly r: T;\n}\n\n/**\n * latestSuccessfulRoute() config\n */\nexport interface LatestSuccessfulRoutesConfig<T extends LatestSuccessfulRoutesConfigRoute> {\n readonly dbxRouterTransitionService: DbxRouterTransitionService;\n readonly dbxRouterService: DbxRouterService;\n /**\n * Route or list of routes to check if they're active or not.\n */\n readonly routes: ArrayOrValue<T>;\n}\n\n/**\n * Creates a new observable that uses the input DbxRouterTransitionService and DbxRouterService to determine whether or not any of the configured routes are active.\n *\n * @param obs\n * @param config\n * @returns\n */\nexport function latestSuccessfulRoutes<T extends LatestSuccessfulRoutesConfigRoute>(config: LatestSuccessfulRoutesConfig<T>): Observable<T[]> {\n const { dbxRouterTransitionService, dbxRouterService, routes: inputRoutes } = config;\n const routes: LatestSuccessfulRoutesConfigRouteItem<T>[] = asArray(inputRoutes).map((r, i) => ({ r, i }));\n const checkRoutes: (() => LatestSuccessfulRoutesConfigRouteItem<T> | undefined)[] = routes.map((routeConfig) => {\n const { r: route } = routeConfig;\n return route.activeExactly ? () => (dbxRouterService.isActiveExactly(route.route) ? routeConfig : undefined) : () => (dbxRouterService.isActive(route.route) ? routeConfig : undefined);\n });\n\n return successTransition(dbxRouterTransitionService.transitions$).pipe(\n startWith(undefined),\n map(() => {\n const activeRoutes: LatestSuccessfulRoutesConfigRouteItem<T>[] = filterMaybeArrayValues(checkRoutes.map((x) => x()));\n return activeRoutes;\n }),\n distinctUntilKeysChange((x) => x.i),\n map((x) => x.map((y) => y.r)),\n shareReplay(1)\n );\n}\n\n// MARK: IsLatestSuccessfulRouteConfig\n/**\n * isLatestSuccessfulRoute() config\n */\nexport interface IsLatestSuccessfulRouteConfig {\n readonly dbxRouterTransitionService: DbxRouterTransitionService;\n readonly dbxRouterService: DbxRouterService;\n /**\n * Route or list of routes to check if they're active or not.\n */\n readonly routes: ArrayOrValue<SegueRefOrSegueRefRouterLink>;\n /**\n * Whether or not to match route activity exactly.\n */\n readonly activeExactly?: boolean;\n}\n\n/**\n * Creates a new observable that uses the input DbxRouterTransitionService and DbxRouterService to determine whether or not any of the configured routes are active.\n *\n * @param obs\n * @param config\n * @returns\n */\nexport function isLatestSuccessfulRoute(config: IsLatestSuccessfulRouteConfig): Observable<boolean> {\n const { dbxRouterTransitionService, dbxRouterService, activeExactly } = config;\n const routes = asArray(config.routes);\n const checkRoute: (route: SegueRefOrSegueRefRouterLink) => boolean = activeExactly ? (route: SegueRefOrSegueRefRouterLink) => dbxRouterService.isActiveExactly(route) : (route: SegueRefOrSegueRefRouterLink) => dbxRouterService.isActive(route);\n\n return successTransition(dbxRouterTransitionService.transitions$).pipe(\n startWith(undefined),\n map(() => {\n const isActive = routes.findIndex(checkRoute) !== -1;\n return isActive;\n }),\n distinctUntilChanged(),\n shareReplay(1)\n );\n}\n","import { Observable, startWith } from 'rxjs';\nimport { Directive, inject } from '@angular/core';\nimport { DbxRouterTransitionService } from '../service/router.transition.service';\nimport { successTransition } from './transition.rxjs';\n\n/**\n * Abstract directive that listens to onSuccess transition events and runs a function.\n */\n@Directive()\nexport abstract class AbstractTransitionDirective {\n protected readonly dbxRouterTransitionService = inject(DbxRouterTransitionService);\n\n readonly transitionSuccess$ = successTransition(this.dbxRouterTransitionService.transitions$);\n readonly initAndUpdateOnTransitionSuccess$: Observable<void> = this.transitionSuccess$.pipe(startWith(undefined)) as Observable<void>;\n}\n","import { Directive, NgZone, inject } from '@angular/core';\nimport { AbstractTransitionDirective } from './transition.directive';\nimport { cleanSubscription } from '../../../rxjs/subscription';\n\n/**\n * Abstract directive that listens to onSuccess transition events and runs a function.\n */\n@Directive()\nexport abstract class AbstractTransitionWatcherDirective extends AbstractTransitionDirective {\n protected readonly ngZone = inject(NgZone);\n\n constructor() {\n super();\n\n cleanSubscription(\n this.transitionSuccess$.subscribe(() => {\n this.updateForSuccessfulTransition();\n })\n );\n }\n\n // MARK: Action\n protected zoneUpdateForSuccessfulTransition(): void {\n // TODO: NgZone Deprecation\n // remove this function and replace, if necessary or remove entirely with angular zoneless implementation details.\n this.ngZone.run(() => this.updateForSuccessfulTransition());\n }\n\n protected abstract updateForSuccessfulTransition(): void;\n}\n","import { type Building } from '@dereekb/util';\nimport { type SegueRefOrSegueRefRouterLink } from '../../segue';\nimport { type DbxRouterService } from './router.service';\n\n/**\n * Function that returns true when the configured segueRef is active.\n */\nexport type IsSegueRefActiveFunction = (() => boolean) & {\n readonly _segueRef: SegueRefOrSegueRefRouterLink;\n readonly _activeExactly: boolean;\n};\n\nexport interface IsSegueRefActiveFunctionConfig {\n readonly dbxRouterService: DbxRouterService;\n readonly segueRef: SegueRefOrSegueRefRouterLink;\n /**\n * Whether or not to match the route exactly.\n *\n * False by default.\n */\n readonly activeExactly?: boolean;\n}\n\n/**\n * Creates an IsSegueRefActiveFunction\n *\n * @param config\n * @returns\n */\nexport function isSegueRefActiveFunction(config: IsSegueRefActiveFunctionConfig): IsSegueRefActiveFunction {\n const { dbxRouterService, segueRef, activeExactly = false } = config;\n const result = (activeExactly ? () => dbxRouterService.isActiveExactly(segueRef) : () => dbxRouterService.isActive(segueRef)) as Building<IsSegueRefActiveFunction>;\n\n result._segueRef = segueRef;\n result._activeExactly = activeExactly;\n\n return result as IsSegueRefActiveFunction;\n}\n","import { type Maybe } from '@dereekb/util';\nimport { filter, map, type Observable, of, type OperatorFunction, switchMap, startWith } from 'rxjs';\nimport { type SegueRefOrSegueRefRouterLink } from '../../segue';\nimport { type DbxRouterTransitionEvent, DbxRouterTransitionEventType } from '../transition';\nimport { isSegueRefActiveFunction, type IsSegueRefActiveFunctionConfig } from './router.service.util';\n\n// MARK: Transition Events\nexport function onRouterTransitionEventType(events$: Observable<DbxRouterTransitionEvent>, type: DbxRouterTransitionEventType): Observable<DbxRouterTransitionEvent> {\n return events$.pipe(filter((x) => x.type === type));\n}\n\nexport function onRouterTransitionSuccessEvent(events$: Observable<DbxRouterTransitionEvent>): Observable<DbxRouterTransitionEvent> {\n return onRouterTransitionEventType(events$, DbxRouterTransitionEventType.SUCCESS);\n}\n\n// MARK: Router Service\n/**\n * Creates an observable that returns true when the route for the input segueRef is active.\n *\n * @param dbxRouterService\n * @param segueRef\n */\nexport function isSegueRefActiveOnTransitionSuccess(config: IsSegueRefActiveFunctionConfig): Observable<boolean> {\n const isActiveFn = isSegueRefActiveFunction(config);\n return onRouterTransitionSuccessEvent(config.dbxRouterService.transitions$).pipe(\n startWith(undefined),\n map(() => isActiveFn())\n );\n}\n\nexport interface IsSegueRefActiveConfig extends Pick<IsSegueRefActiveFunctionConfig, 'dbxRouterService' | 'activeExactly'> {\n /**\n * What to pipe if the input segueRef is null.\n */\n readonly defaultIfNull?: boolean;\n}\n\n/**\n * Operator function that maps the input segueRef to a boolean depending on the current route state.\n *\n * @param dbxRouterService\n * @param segueRef\n */\nexport function isSegueRefActive(config: IsSegueRefActiveConfig): OperatorFunction<Maybe<SegueRefOrSegueRefRouterLink>, boolean> {\n const { defaultIfNull = false } = config;\n\n return switchMap((segueRef) => {\n if (segueRef) {\n return isSegueRefActiveOnTransitionSuccess({ ...config, segueRef });\n } else {\n return of(defaultIfNull);\n }\n });\n}\n","import { type ObservableOrValueGetter, type MaybeObservableOrValueGetter, switchMapToDefault, maybeValueFromObservableOrValueGetter, asObservableFromGetter } from '@dereekb/rxjs';\nimport { type Destroyable, type Maybe } from '@dereekb/util';\nimport { BehaviorSubject, combineLatest, distinctUntilChanged, first, map, type Observable, shareReplay } from 'rxjs';\nimport { type DbxRouterService } from '../service/router.service';\n\n/**\n * Interface used for reading a single value from the DbxRouterService. Supports a default value.\n */\nexport interface DbxRouteParamReader<T> {\n /**\n * The param value as read from the current router state.\n */\n readonly paramValue$: Observable<Maybe<T>>;\n\n /**\n * The default value observable.\n */\n readonly defaultValue$: Observable<Maybe<T>>;\n\n /**\n * The current value given the paramValue and the defaultValue.\n */\n readonly value$: Observable<Maybe<T>>;\n\n /**\n * Returns the current param key.\n */\n getParamKey(): string;\n\n /**\n * Sets a new param key. If the value is undefined, the param reader will use the default key.\n */\n setParamKey(paramKey: Maybe<string>): void;\n\n /**\n * Sets the default value source.\n *\n * @param defaultValue\n */\n setDefaultValue(defaultValue: MaybeObservableOrValueGetter<T>): void;\n\n /**\n * Updates the value on the current route for the paramKey.\n *\n * @param value\n */\n setParamValue(value: MaybeObservableOrValueGetter<T>): void;\n}\n\nexport interface DbxRouteParamReaderInstance<T> extends DbxRouteParamReader<T>, Destroyable {\n readonly dbxRouterService: DbxRouterService;\n readonly paramKey$: Observable<string>;\n readonly nextDefaultValue$: Observable<Maybe<T>>;\n readonly value$: Observable<Maybe<T>>;\n}\n\n/**\n * Creates a new DbxRouteParamReaderInstance from the input.\n *\n * @param dbxRouterService\n * @param defaultParamKey\n * @param defaultValue\n * @returns\n */\nexport function dbxRouteParamReaderInstance<T>(dbxRouterService: DbxRouterService, defaultParamKey: string, defaultValue?: MaybeObservableOrValueGetter<T>): DbxRouteParamReaderInstance<T> {\n const _paramKey = new BehaviorSubject<string>(defaultParamKey);\n const _defaultValue = new BehaviorSubject<Maybe<ObservableOrValueGetter<Maybe<T>>>>(defaultValue);\n\n const paramKey$ = _paramKey.asObservable();\n\n const paramValue$ = combineLatest([paramKey$, dbxRouterService.params$]).pipe(\n map(([key, params]) => (params[key] as Maybe<T>) ?? undefined),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n const nextDefaultValue$ = _defaultValue.pipe(maybeValueFromObservableOrValueGetter(), shareReplay(1));\n const defaultValue$ = _defaultValue.pipe(maybeValueFromObservableOrValueGetter(), shareReplay(1));\n const value$ = paramValue$.pipe(switchMapToDefault(defaultValue$), shareReplay(1));\n\n const result: DbxRouteParamReaderInstance<T> = {\n dbxRouterService,\n\n paramKey$,\n paramValue$,\n nextDefaultValue$,\n defaultValue$,\n value$,\n\n destroy() {\n _paramKey.complete();\n _defaultValue.complete();\n },\n\n getParamKey(): string {\n return _paramKey.value;\n },\n\n setParamKey(paramKey: Maybe<string>) {\n _paramKey.next(paramKey || defaultParamKey);\n },\n\n setDefaultValue(newValue: MaybeObservableOrValueGetter<T>) {\n _defaultValue.next(newValue ?? defaultValue);\n },\n\n setParamValue(value: MaybeObservableOrValueGetter<T>) {\n combineLatest([paramKey$, asObservableFromGetter(value)])\n .pipe(first())\n .subscribe(([paramKey, value]) => dbxRouterService.updateParams({ [paramKey]: value }));\n }\n };\n\n return result;\n}\n","import { BehaviorSubject, EMPTY, switchMap, of } from 'rxjs';\nimport { type DbxRouteParamReaderInstance } from './route.reader';\nimport { type Destroyable, type Initialized, type Maybe, type DefaultForwardFunctionFactory, defaultForwardFunctionFactory } from '@dereekb/util';\nimport { SubscriptionObject, switchMapToDefault, type SwitchMapToDefaultFilterFunction, filterMaybe } from '@dereekb/rxjs';\n\nconst DEFAULT_REDIRECT_INSTANCE_FORWARD_FACTORY = defaultForwardFunctionFactory<SwitchMapToDefaultFilterFunction<unknown>>((value) => of(value == null));\n\n/**\n * Utility class used in conjuction with a DbxRouteParamReaderInstance to redirect when the default param is not valid.\n */\nexport class DbxRouteParamDefaultRedirectInstance<T> implements Initialized, Destroyable {\n private readonly instance: DbxRouteParamReaderInstance<T>;\n\n private readonly _enabled = new BehaviorSubject<boolean>(true);\n private readonly _useDefaultFilter = new BehaviorSubject<Maybe<SwitchMapToDefaultFilterFunction<T>>>(undefined);\n private readonly _sub = new SubscriptionObject();\n\n constructor(instance: DbxRouteParamReaderInstance<T>) {\n this.instance = instance;\n }\n\n init(): void {\n this._sub.subscription = this._enabled\n .pipe(\n switchMap((enabled) => {\n if (enabled) {\n return this.instance.paramValue$.pipe(\n switchMapToDefault(this.instance.defaultValue$, (value) => {\n return this._useDefaultFilter.pipe(switchMap((fn) => (DEFAULT_REDIRECT_INSTANCE_FORWARD_FACTORY as DefaultForwardFunctionFactory<SwitchMapToDefaultFilterFunction<T>>)(fn)(value)));\n }),\n filterMaybe(), // do not redirect on MaybeNot values\n switchMap((defaultValue) => {\n return this.redirectWithDefaultValue(defaultValue);\n })\n );\n } else {\n return EMPTY;\n }\n })\n )\n .subscribe();\n }\n\n destroy(): void {\n this._enabled.complete();\n this._useDefaultFilter.complete();\n this._sub.destroy();\n }\n\n protected redirectWithDefaultValue(value: Maybe<T>): Promise<boolean> {\n if (value != null) {\n // perform a segue once\n return this.redirectWithValue(value);\n } else {\n // do nothing\n return Promise.resolve(false);\n }\n }\n\n protected redirectWithValue(value: Maybe<T>): Promise<boolean> {\n return this.instance.dbxRouterService.updateParams({\n [this.instance.getParamKey()]: value\n });\n }\n\n get enabled(): boolean {\n return this._enabled.value;\n }\n\n set enabled(enabled: boolean) {\n this._enabled.next(enabled);\n }\n\n setUseDefaultFilter(useValueFilter: Maybe<SwitchMapToDefaultFilterFunction<T>>): void {\n this._useDefaultFilter.next(useValueFilter);\n }\n}\n","import { type Observable, BehaviorSubject, map, shareReplay, of, switchMap } from 'rxjs';\nimport { type Destroyable, type Initialized, type Maybe, type ModelKey } from '@dereekb/util';\nimport { type MaybeObservableOrValueGetter, type SwitchMapToDefaultFilterFunction } from '@dereekb/rxjs';\nimport { type DbxRouterService } from '../router/service';\nimport { type DbxRouteParamReader, dbxRouteParamReaderInstance, DbxRouteParamDefaultRedirectInstance } from '../router/util';\n\n/**\n * Default identifier used by dbxRouteModelIdParamRedirect() that corresponds to the id param of the model in the current route.\n */\nexport const DBX_ROUTE_MODEL_ID_PARAM_DEFAULT_ID_PARAM_KEY = 'id';\n\n/**\n * Default identifier used by dbxRouteModelIdParamRedirect() that corresponds to the key param of the model in the current route.\n */\nexport const DBX_ROUTE_MODEL_ID_PARAM_DEFAULT_KEY_PARAM_KEY = 'key';\n\n/**\n * Default value used by dbxRouteModelIdParamRedirect() for when a value is not available or provided.\n */\nexport const DBX_ROUTE_MODEL_ID_PARAM_DEFAULT_USE_PARAM_VALUE = '0';\n\n/**\n * Used to read an id with a specific key from the current route.\n *\n * Can be configured to redirect to a default route if a specific value is seen.\n */\nexport interface DbxRouteModelIdParamRedirect extends DbxRouteParamReader<ModelKey> {\n /**\n * The id value as it is from the current state's params.\n */\n readonly idFromParams$: Observable<Maybe<ModelKey>>;\n /**\n * The id value as it is when considering the default value.\n */\n readonly id$: Observable<Maybe<ModelKey>>;\n setRedirectEnabled(redirect: Maybe<boolean>): void;\n setDecider(decider: string | SwitchMapToDefaultFilterFunction<ModelKey>): void;\n}\n\n/**\n *DbxRouteModelIdParamRedirect instance\n */\nexport interface DbxRouteModelIdParamRedirectInstance extends DbxRouteModelIdParamRedirect, DbxRouteParamReader<ModelKey>, Initialized, Destroyable {\n readonly paramValue$: Observable<Maybe<string>>;\n readonly defaultValue$: Observable<Maybe<string>>;\n readonly value$: Observable<Maybe<string>>;\n\n readonly idFromParams$: Observable<Maybe<ModelKey>>;\n readonly id$: Observable<Maybe<ModelKey>>;\n\n setParamKey(paramKey: Maybe<string>): void;\n\n setDefaultValue(defaultValue: MaybeObservableOrValueGetter<string>): void;\n setRedirectEnabled(redirect: Maybe<boolean>): void;\n\n setDecider(decider: string | SwitchMapToDefaultFilterFunction<ModelKey>): void;\n setParamValue(value: MaybeObservableOrValueGetter<string>): void;\n}\n\nexport function dbxRouteModelKeyParamRedirect(dbxRouterService: DbxRouterService, defaultParamKey: string = DBX_ROUTE_MODEL_ID_PARAM_DEFAULT_KEY_PARAM_KEY): DbxRouteModelIdParamRedirectInstance {\n return dbxRouteModelIdParamRedirect(dbxRouterService, defaultParamKey);\n}\n\nexport function dbxRouteModelIdParamRedirect(dbxRouterService: DbxRouterService, defaultParamKey: string = DBX_ROUTE_MODEL_ID_PARAM_DEFAULT_ID_PARAM_KEY): DbxRouteModelIdParamRedirectInstance {\n const _paramReader = dbxRouteParamReaderInstance<ModelKey>(dbxRouterService, defaultParamKey);\n const _paramRedirect = new DbxRouteParamDefaultRedirectInstance<ModelKey>(_paramReader);\n const _useDefaultParamDecider = new BehaviorSubject<string | SwitchMapToDefaultFilterFunction<ModelKey>>(DBX_ROUTE_MODEL_ID_PARAM_DEFAULT_USE_PARAM_VALUE);\n\n const _useDefaultParam$: Observable<SwitchMapToDefaultFilterFunction<ModelKey>> = _useDefaultParamDecider.pipe(\n map((x) => {\n let result: SwitchMapToDefaultFilterFunction<ModelKey>;\n\n if (typeof x === 'string') {\n result = (value: Maybe<ModelKey>) => of(value === x);\n } else {\n result = x;\n }\n\n return result;\n }),\n shareReplay(1)\n );\n\n const setParamKey = (paramKey: Maybe<string>) => {\n _paramReader.setParamKey(paramKey || defaultParamKey);\n };\n\n const paramValue$ = _paramReader.paramValue$;\n const value$ = _paramReader.value$;\n\n const result: DbxRouteModelIdParamRedirectInstance = {\n paramValue$,\n defaultValue$: _paramReader.defaultValue$,\n value$,\n idFromParams$: paramValue$,\n id$: value$,\n\n init(): void {\n _paramRedirect.setUseDefaultFilter((value: Maybe<string>) => {\n return _useDefaultParam$.pipe(switchMap((x) => x(value)));\n });\n\n _paramRedirect.init();\n },\n\n destroy(): void {\n _paramReader.destroy();\n _paramRedirect.destroy();\n _useDefaultParamDecider.complete();\n },\n\n getParamKey(): string {\n return _paramReader.getParamKey();\n },\n\n setParamKey,\n\n setDefaultValue(defaultValue: MaybeObservableOrValueGetter<string>): void {\n _paramReader.setDefaultValue(defaultValue);\n },\n\n setRedirectEnabled(redirect: Maybe<boolean>): void {\n _paramRedirect.enabled = redirect !== false;\n },\n\n setDecider(decider: string | SwitchMapToDefaultFilterFunction<ModelKey>): void {\n _useDefaultParamDecider.next(decider);\n },\n\n setParamValue(value: MaybeObservableOrValueGetter<string>): void {\n _paramReader.setParamValue(value);\n }\n };\n\n return result;\n}\n","import { type Type, type Provider, forwardRef } from '@angular/core';\nimport { type Maybe, type ModelKey } from '@dereekb/util';\nimport { type Observable, type Subscription } from 'rxjs';\n\n// MARK: Id\n/**\n * DbxRouteModelIdDirective delegate that can recieve an observable of the model id from the route.\n */\nexport abstract class DbxRouteModelIdDirectiveDelegate {\n /**\n * Passes the param value and computed value from the DbxRouteModelIdDirective to this delegate.\n *\n * @param idFromParamsObs\n * @param computedIdObs\n */\n abstract useRouteModelIdParamsObservable(idFromParamsObs: Observable<Maybe<ModelKey>>, computedIdObs: Observable<Maybe<ModelKey>>): Subscription;\n}\n\n/**\n * Configures providers for a DbxRouteModelIdDirectiveDelegate.\n */\nexport function provideDbxRouteModelIdDirectiveDelegate<S extends DbxRouteModelIdDirectiveDelegate>(sourceType: Type<S>): Provider[] {\n const providers: Provider[] = [\n {\n provide: DbxRouteModelIdDirectiveDelegate,\n useExisting: forwardRef(() => sourceType)\n }\n ];\n\n return providers;\n}\n\n// MARK: Key\n/**\n * DbxRouteModelKeyDirective delegate that can recieve an observable of the model id from the route.\n */\nexport abstract class DbxRouteModelKeyDirectiveDelegate {\n /**\n * Passes the param value and computed value from the DbxRouteModelKeyDirective to this delegate.\n *\n * @param keyFromParamsObs\n * @param computedKeyObs\n */\n abstract useRouteModelKeyParamsObservable(keyFromParamsObs: Observable<Maybe<ModelKey>>, computedKeyObs: Observable<Maybe<ModelKey>>): Subscription;\n}\n\n/**\n * Configures providers for a DbxRouteModelKeyDirectiveDelegate.\n */\nexport function provideDbxRouteModelKeyDirectiveDelegate<S extends DbxRouteModelKeyDirectiveDelegate>(sourceType: Type<S>): Provider[] {\n const providers: Provider[] = [\n {\n provide: DbxRouteModelKeyDirectiveDelegate,\n useExisting: forwardRef(() => sourceType)\n }\n ];\n\n return providers;\n}\n","import { Directive, inject } from '@angular/core';\nimport { DbxRouteModelIdDirectiveDelegate } from './model.router';\nimport { DbxAuthService } from '../../auth';\nimport { cleanSubscription } from '../../rxjs';\n\n/**\n * Used for retrieving the user's current id DbxAuthService and passes it as an identifier for a DbxRouteModelIdDirectiveDelegate.\n */\n@Directive({\n selector: '[dbxRouteModelIdFromAuthUserId]',\n standalone: true\n})\nexport class DbxRouteModelIdFromAuthUserIdDirective {\n readonly dbxAuthService = inject(DbxAuthService);\n readonly dbxRouteModelIdDelegate = inject(DbxRouteModelIdDirectiveDelegate, { host: true });\n\n constructor() {\n cleanSubscription(this.dbxRouteModelIdDelegate.useRouteModelIdParamsObservable(this.dbxAuthService.userIdentifier$, this.dbxAuthService.userIdentifier$));\n }\n}\n","import { Observable } from 'rxjs';\nimport { Directive, Input, inject } from '@angular/core';\nimport { Maybe, ModelKey } from '@dereekb/util';\nimport { MaybeObservableOrValueGetter, SwitchMapToDefaultFilterFunction } from '@dereekb/rxjs';\nimport { dbxRouteModelIdParamRedirect } from './id.param.redirect';\nimport { DbxRouterService } from '../router/service/router.service';\nimport { DbxRouteModelIdDirectiveDelegate } from './model.router';\nimport { clean, cleanSubscription } from '../../rxjs';\n\n/**\n * Used for retrieving the model's id from the current route using the configured parameter and passes it to its delegate.\n */\n@Directive({\n selector: '[dbxRouteModelId]',\n standalone: true\n})\nexport class DbxRouteModelIdDirective {\n readonly dbxRouterService = inject(DbxRouterService);\n readonly dbxRouteModelIdDelegate = inject(DbxRouteModelIdDirectiveDelegate, { host: true });\n\n private readonly _redirectInstance = clean(dbxRouteModelIdParamRedirect(this.dbxRouterService));\n\n readonly idFromParams$: Observable<Maybe<ModelKey>> = this._redirectInstance.paramValue$;\n readonly id$: Observable<Maybe<ModelKey>> = this._redirectInstance.value$;\n\n constructor() {\n cleanSubscription(this.dbxRouteModelIdDelegate.useRouteModelIdParamsObservable(this.idFromParams$, this.id$));\n this._redirectInstance.init();\n }\n\n // MARK: Input\n @Input('dbxRouteModelId')\n get idParam() {\n return this._redirectInstance.getParamKey();\n }\n\n set idParam(idParam: string) {\n this._redirectInstance.setParamKey(idParam);\n }\n\n @Input()\n set dbxRouteModelIdDefault(defaultValue: MaybeObservableOrValueGetter<ModelKey>) {\n this._redirectInstance.setDefaultValue(defaultValue);\n }\n\n /**\n * Whether or not to enable the redirection. Is enabled by default.\n */\n @Input()\n set dbxRouteModelIdDefaultRedirect(redirect: Maybe<boolean> | '') {\n this._redirectInstance.setRedirectEnabled(redirect !== false); // true by default\n }\n\n @Input()\n set dbxRouteModelIdDefaultDecision(decider: string | SwitchMapToDefaultFilterFunction<ModelKey>) {\n this._redirectInstance.setDecider(decider);\n }\n}\n","import { Observable } from 'rxjs';\nimport { Directive, Input, inject } from '@angular/core';\nimport { Maybe, ModelKey } from '@dereekb/util';\nimport { MaybeObservableOrValueGetter, SwitchMapToDefaultFilterFunction } from '@dereekb/rxjs';\nimport { dbxRouteModelKeyParamRedirect } from './id.param.redirect';\nimport { clean, cleanSubscription } from '../../rxjs';\nimport { DbxRouterService } from '../router/service/router.service';\nimport { DbxRouteModelKeyDirectiveDelegate } from './model.router';\n\n/**\n * Used for retrieving the model's key from the current route using the configured parameter and passes it to its delegate.\n *\n * If the key does not exist in the params, then the p\n */\n@Directive({\n selector: '[dbxRouteModelKey]',\n standalone: true\n})\nexport class DbxRouteModelKeyDirective {\n readonly dbxRouterService = inject(DbxRouterService);\n readonly dbxRouteModelKeyDelegate = inject(DbxRouteModelKeyDirectiveDelegate, { host: true });\n\n private readonly _redirectInstance = clean(dbxRouteModelKeyParamRedirect(this.dbxRouterService));\n\n readonly keyFromParams$: Observable<Maybe<ModelKey>> = this._redirectInstance.paramValue$;\n readonly key$: Observable<Maybe<ModelKey>> = this._redirectInstance.value$;\n\n constructor() {\n cleanSubscription(this.dbxRouteModelKeyDelegate.useRouteModelKeyParamsObservable(this.keyFromParams$, this.key$));\n this._redirectInstance.init();\n }\n\n // MARK: Input\n @Input('dbxRouteModelKey')\n get keyParam() {\n return this._redirectInstance.getParamKey();\n }\n\n set keyParam(idParam: string) {\n this._redirectInstance.setParamKey(idParam);\n }\n\n @Input()\n set dbxRouteModelKeyDefault(defaultValue: MaybeObservableOrValueGetter<ModelKey>) {\n this._redirectInstance.setDefaultValue(defaultValue);\n }\n\n /**\n * Whether or not to enable the redirection. Is enabled by default.\n */\n @Input()\n set dbxRouteModelKeyDefaultRedirect(redirect: Maybe<boolean> | '') {\n this._redirectInstance.setRedirectEnabled(redirect !== false); // true by default\n }\n\n @Input()\n set dbxRouteModelKeyDefaultDecision(decider: string | SwitchMapToDefaultFilterFunction<ModelKey>) {\n this._redirectInstance.setDecider(decider);\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { asObservableFromGetter, ObservableOrValueGetter } from '@dereekb/rxjs';\nimport { Observable } from 'rxjs';\n\n/**\n * Pipes an ObservableOrValueGetter to an Observable value.\n */\n@Pipe({\n name: 'asObservable',\n standalone: true\n})\nexport class AsObservablePipe implements PipeTransform {\n transform<T>(input: ObservableOrValueGetter<T>): Observable<T> {\n return asObservableFromGetter(input);\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { DateRange, formatToDayRangeString } from '@dereekb/date';\n\n@Pipe({\n name: 'dateDayRange',\n standalone: true,\n pure: true\n})\nexport class DateDayRangePipe implements PipeTransform {\n transform(input: Maybe<DateRange>, unavailable: string = 'Not Available'): string {\n if (input) {\n return formatToDayRangeString(input);\n } else {\n return unavailable;\n }\n }\n}\n","import { isValid } from 'date-fns';\nimport { Pipe, PipeTransform } from '@angular/core';\nimport { toJsDate } from '@dereekb/date';\nimport { DateOrDateString, type Maybe } from '@dereekb/util';\n\n@Pipe({\n name: 'toJsDate',\n standalone: true,\n pure: true\n})\nexport class ToJsDatePipe implements PipeTransform {\n public static toJsDate(input: DateOrDateString): Date;\n public static toJsDate(input: Maybe<DateOrDateString>): Maybe<Date>;\n public static toJsDate(input: Maybe<DateOrDateString>): Maybe<Date> {\n let date: Maybe<Date>;\n\n if (input != null) {\n date = toJsDate(input);\n\n if (!isValid(date)) {\n date = undefined;\n }\n }\n\n return date;\n }\n\n transform(input: Maybe<DateOrDateString>): Maybe<Date> {\n return ToJsDatePipe.toJsDate(input);\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { DateOrDateString, type Maybe } from '@dereekb/util';\nimport { ToJsDatePipe } from './tojsdate.pipe';\nimport { formatDateDistance } from '@dereekb/date';\n\n@Pipe({\n name: 'dateDistance',\n standalone: true,\n pure: false\n})\nexport class DateDistancePipe implements PipeTransform {\n transform(input: Maybe<DateOrDateString>, inputTo?: Maybe<Date>, unavailable: string = 'Not Available'): string {\n if (input != null) {\n const to = inputTo ?? new Date();\n const from = ToJsDatePipe.toJsDate(input);\n return formatDateDistance(to, from);\n } else {\n return unavailable;\n }\n }\n}\n","import { Pipe, PipeTransform, LOCALE_ID, inject } from '@angular/core';\nimport { formatDate } from '@angular/common';\nimport { formatDistanceToNow, isValid } from 'date-fns';\nimport { DateOrDateString, type Maybe } from '@dereekb/util';\nimport { toJsDate } from '@dereekb/date';\n\n/**\n * Pipe that takes in a date and appends the distance to it in parenthesis.\n */\n@Pipe({\n name: 'dateFormatDistance',\n standalone: true,\n pure: false\n})\nexport class DateFormatDistancePipe implements PipeTransform {\n private readonly locale = inject(LOCALE_ID);\n\n transform(input: Maybe<DateOrDateString>, format: string, includeSeconds = false): Maybe<string> {\n if (input) {\n const date = toJsDate(input);\n\n if (isValid(date)) {\n const dateString = formatDate(date, format, this.locale);\n\n const distance = formatDistanceToNow(date, {\n includeSeconds,\n addSuffix: true\n });\n\n return `${dateString} (${distance})`;\n }\n }\n\n return undefined;\n }\n}\n","import { addMinutes } from 'date-fns';\nimport { Pipe, PipeTransform, LOCALE_ID, inject } from '@angular/core';\nimport { formatDate } from '@angular/common';\nimport { Maybe, DateOrDateString } from '@dereekb/util';\nimport { formatToTimeString, toJsDate } from '@dereekb/date';\n\n/**\n * Pipe that takes in a date and number of minutes and outputs a formatted date.\n */\n@Pipe({\n name: 'dateFormatFromTo',\n standalone: true,\n pure: true\n})\nexport class DateFormatFromToPipe implements PipeTransform {\n private readonly locale = inject(LOCALE_ID);\n\n static formatFromTo(input: Maybe<DateOrDateString>, format: string, minutes: number, locale: string): Maybe<string> {\n if (input) {\n const date = toJsDate(input);\n const endDate = addMinutes(date, minutes);\n const dateString = formatDate(date, format, locale);\n return dateString + ' - ' + formatToTimeString(endDate);\n }\n\n return undefined;\n }\n\n transform(input: Maybe<DateOrDateString>, format: string, minutes: number): Maybe<string> {\n return DateFormatFromToPipe.formatFromTo(input, format, minutes, this.locale);\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { DateRange, formatToDayTimeRangeString } from '@dereekb/date';\n\n@Pipe({\n name: 'dateDayTimeRange',\n standalone: true,\n pure: true\n})\nexport class DateDayTimeRangePipe implements PipeTransform {\n transform(input: Maybe<DateRange>, unavailable: string = 'Not Available'): string {\n if (input) {\n return formatToDayTimeRangeString(input);\n } else {\n return unavailable;\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { DateRange, formatToTimeRangeString } from '@dereekb/date';\n\n@Pipe({\n name: 'dateTimeRange',\n standalone: true,\n pure: true\n})\nexport class DateTimeRangePipe implements PipeTransform {\n transform(input: Maybe<DateRange>, unavailable: string = 'Not Available'): string {\n if (input) {\n return formatToTimeRangeString(input);\n } else {\n return unavailable;\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { DateRange, formatDateDistance } from '@dereekb/date';\n\n@Pipe({\n name: 'dateRangeDistance',\n standalone: true,\n pure: false\n})\nexport class DateRangeDistancePipe implements PipeTransform {\n transform(input: Maybe<Date | DateRange>, unavailable: string = 'Not Available'): string {\n if (input != null) {\n return formatDateDistance(input as Date, new Date());\n } else {\n return unavailable;\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { DateRange, formatToTimeRangeString } from '@dereekb/date';\n\n@Pipe({\n name: 'dateTimeRangeOnly',\n standalone: true,\n pure: true\n})\nexport class DateTimeRangeOnlyPipe implements PipeTransform {\n transform(input: Maybe<DateRange>, unavailable: string = 'Not Available'): string {\n if (input) {\n return formatToTimeRangeString(input, undefined, true);\n } else {\n return unavailable;\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { TimezoneString, type Maybe } from '@dereekb/util';\nimport { dateTimezoneUtcNormal } from '@dereekb/date';\n\n/**\n * Converts the input date and timezone to a system date that represents that date/time.\n */\n@Pipe({\n name: 'targetDateToSystemDate',\n standalone: true,\n pure: false\n})\nexport class TargetDateToSystemDatePipe implements PipeTransform {\n transform(input: Maybe<Date>, timezone: Maybe<TimezoneString>): Maybe<Date> {\n if (input && timezone) {\n return dateTimezoneUtcNormal({ timezone }).targetDateToSystemDate(input);\n } else {\n return undefined;\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { DateRange, formatDateRangeDistance, FormatDateRangeDistanceFunctionConfig } from '@dereekb/date';\n\n@Pipe({\n name: 'dateTimeRangeOnlyDistance',\n standalone: true,\n pure: true\n})\nexport class DateTimeRangeOnlyDistancePipe implements PipeTransform {\n transform(input: Maybe<DateRange>, config?: FormatDateRangeDistanceFunctionConfig, unavailable: string = 'Not Available'): string {\n if (input) {\n return formatDateRangeDistance(input, { ...config });\n } else {\n return unavailable;\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { TimezoneString, type Maybe } from '@dereekb/util';\nimport { getTimezoneAbbreviation } from '@dereekb/date';\n\n/**\n * Converts the input date and timezone to the proper abbreviation. Uses the input date for the context, or uses now.\n */\n@Pipe({\n name: 'timezoneAbbreviation',\n standalone: true,\n pure: false\n})\nexport class TimezoneAbbreviationPipe implements PipeTransform {\n transform(timezone: Maybe<TimezoneString>, input?: Maybe<Date>): Maybe<string> {\n if (timezone) {\n return getTimezoneAbbreviation(timezone, input ?? undefined);\n } else {\n return undefined;\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { TimezoneString, type Maybe } from '@dereekb/util';\nimport { dateTimezoneUtcNormal } from '@dereekb/date';\n\n/**\n * Converts the input date and timezone to a target date that represents that date/time for the timezone.\n */\n@Pipe({\n name: 'systemDateToTargetDate',\n standalone: true,\n pure: false\n})\nexport class SystemDateToTargetDatePipe implements PipeTransform {\n transform(input: Maybe<Date>, timezone: Maybe<TimezoneString>): Maybe<Date> {\n if (input && timezone) {\n return dateTimezoneUtcNormal({ timezone }).systemDateToTargetDate(input);\n } else {\n return undefined;\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\n\n@Pipe({\n name: 'minutesString',\n standalone: true,\n pure: false\n})\nexport class MinutesStringPipe implements PipeTransform {\n transform(input: Maybe<number | string>): Maybe<string> {\n const minutes = Number(input);\n\n if (input != null && !isNaN(minutes)) {\n if (minutes > 3600) {\n const unrounded = minutes / 3600;\n const days = Math.ceil(unrounded);\n return (unrounded !== days ? '~' : '') + days + ' days';\n } else if (minutes > 180) {\n const unrounded = minutes / 60;\n const hours = Math.ceil(unrounded);\n return (unrounded !== hours ? '~' : '') + hours + ' hours';\n } else {\n return minutes + ' minutes';\n }\n } else {\n return undefined;\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { Maybe, DateOrDateString } from '@dereekb/util';\nimport { formatDistance, isPast } from 'date-fns';\nimport { ToJsDatePipe } from './tojsdate.pipe';\n\n@Pipe({\n name: 'timeCountdownDistance',\n standalone: true,\n pure: false\n})\nexport class TimeDistanceCountdownPipe implements PipeTransform {\n transform(input: Maybe<DateOrDateString>, soonString: string = 'Soon', unavailable: string = 'Not Available'): string {\n if (input) {\n const from = ToJsDatePipe.toJsDate(input);\n\n if (isPast(from)) {\n return soonString;\n } else {\n const to = new Date();\n return formatDistance(from, to, {\n addSuffix: true\n });\n }\n } else {\n return unavailable;\n }\n }\n}\n\n@Pipe({\n name: 'timeDistance',\n standalone: true,\n pure: false\n})\nexport class TimeDistancePipe implements PipeTransform {\n transform(input: Maybe<DateOrDateString>, to?: Maybe<Date>, unavailable: string = 'Not Available'): string {\n if (input) {\n const from = ToJsDatePipe.toJsDate(input);\n return formatDistance(from, to ?? new Date(), {\n addSuffix: true\n });\n } else {\n return unavailable;\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n name: 'toMinutes',\n standalone: true,\n pure: true\n})\nexport class ToMinutesPipe implements PipeTransform {\n transform(milliseconds: number): number {\n if (milliseconds) {\n return Math.floor(milliseconds / (60 * 1000));\n }\n\n return milliseconds;\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\n\n@Pipe({\n name: 'prettyjson',\n standalone: true\n})\nexport class PrettyJsonPipe implements PipeTransform {\n public static toPrettyJson(input: Maybe<unknown>, spacing: number = 2): Maybe<string> {\n let json: Maybe<string>;\n\n if (input) {\n try {\n json = JSON.stringify(input, null, spacing);\n } catch (e) {\n console.error('prettyjson pipe failed parsing input: ', input);\n json = 'ERROR';\n }\n }\n\n return json;\n }\n\n transform(input: Maybe<unknown>, spacing?: number): Maybe<string> {\n return PrettyJsonPipe.toPrettyJson(input, spacing);\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { cutString, type Maybe } from '@dereekb/util';\n\n/**\n * Pipe that cuts the input text to the requested length and adds elipsis.\n */\n@Pipe({\n name: 'cutText',\n standalone: true,\n pure: true\n})\nexport class CutTextPipe implements PipeTransform {\n transform(input: Maybe<string>, maxLength: number, endText?: Maybe<string>): Maybe<string> {\n return input != null ? cutString(input, maxLength, endText) : input;\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { GetterOrValue, getValueFromGetter } from '@dereekb/util';\n\n/**\n * Retrieves the value from the getter. This is a non-pure pipe. Use the getValueOncePipe instead for a pure pipe.\n */\n@Pipe({\n name: 'getValue',\n standalone: true,\n pure: false\n})\nexport class GetValuePipe implements PipeTransform {\n transform<T, A = any>(input: GetterOrValue<T>, args?: A): T {\n return getValueFromGetter(input as any, args);\n }\n}\n\n/**\n * Pipes a GetValuePipe to an Observable value.\n */\n@Pipe({\n name: 'getValueOnce',\n standalone: true,\n pure: true\n})\nexport class GetValueOncePipe implements PipeTransform {\n transform<T, A = any>(input: GetterOrValue<T>, args?: A): T {\n return getValueFromGetter(input as any, args);\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { dollarAmountString, type Maybe } from '@dereekb/util';\n\n/**\n * Pipe that takes in a number and returns the number formatted as a dollar using dollarAmountString().\n *\n * Can provide a default string value to use when the input is null or undefined.\n */\n@Pipe({\n name: 'dollarAmount',\n standalone: true,\n pure: true\n})\nexport class DollarAmountPipe implements PipeTransform {\n transform(input: Maybe<number>, defaultIfNull?: Maybe<string>): Maybe<string> {\n return defaultIfNull == null || input != null ? dollarAmountString(input) : defaultIfNull;\n }\n}\n","import { Observable, BehaviorSubject, of, switchMap, shareReplay } from 'rxjs';\nimport { Directive } from '@angular/core';\nimport { FilterSourceConnector, FilterSource, filterMaybe } from '@dereekb/rxjs';\nimport { type Maybe } from '@dereekb/util';\nimport { completeOnDestroy } from '../rxjs';\n\n/**\n * Abstract FilterSourceConnector directive.\n */\n@Directive()\nexport abstract class AbstractFilterSourceConnectorDirective<F> implements FilterSourceConnector<F>, FilterSource<F> {\n private readonly _source = completeOnDestroy(new BehaviorSubject<Maybe<FilterSource<F>>>(undefined));\n\n readonly filter$: Observable<F> = this._source.pipe(\n switchMap((x) => x?.filter$ ?? of(undefined)),\n filterMaybe(),\n shareReplay(1)\n );\n\n connectWithSource(filterSource: FilterSource<F>): void {\n this._source.next(filterSource);\n }\n}\n","import { FilterSource, FilterSourceConnector } from '@dereekb/rxjs';\nimport { forwardRef, type Provider, type Type } from '@angular/core';\n\n/**\n * Angular provider convenience function for a FilterSource.\n */\nexport function provideFilterSource<S extends FilterSource>(sourceType: Type<S>): Provider[] {\n return [\n {\n provide: FilterSource,\n useExisting: forwardRef(() => sourceType)\n }\n ];\n}\n\n/**\n * Angular provider convenience function for a FilterSourceConnector.\n */\nexport function provideFilterSourceConnector<S extends FilterSourceConnector>(sourceType: Type<S>): Provider[] {\n return [\n {\n provide: FilterSourceConnector,\n useExisting: forwardRef(() => sourceType)\n },\n {\n provide: FilterSource,\n useExisting: forwardRef(() => sourceType)\n }\n ];\n}\n","import { Observable } from 'rxjs';\nimport { Directive, forwardRef, inject, InjectionToken, Injector, OnDestroy, Provider, Type } from '@angular/core';\nimport { FilterSource, FilterSourceInstance, MaybeObservableOrValue } from '@dereekb/rxjs';\nimport { type Maybe } from '@dereekb/util';\nimport { provideFilterSource } from './filter.content';\n\nexport const FILTER_SOURCE_DIRECTIVE_DEFAULT_FILTER_TOKEN = new InjectionToken<Maybe<Observable<Maybe<unknown>>>>('FILTER_SOURCE_DIRECTIVE_DEFAULT_FILTER_SOURCE_TOKEN');\n\nexport abstract class FilterSourceDirective<F = unknown> implements FilterSource<F> {\n abstract readonly filter$: Observable<F>;\n abstract initWithFilter(filterObs: Observable<F>): void;\n abstract setFilter(filter: F): void;\n abstract resetFilter(): void;\n}\n\nexport type ProvideFilterSourceDirectiveDefaultFilterFactoryFunction<F = unknown> = (injector: Injector) => MaybeObservableOrValue<F>;\n\n/**\n * Angular provider convenience function for a FilterSourceDirective.\n */\nexport function provideFilterSourceDirective<S extends FilterSourceDirective<F>, F = unknown>(sourceType: Type<S>, defaultFilterFactory?: ProvideFilterSourceDirectiveDefaultFilterFactoryFunction): Provider[] {\n const providers = [\n {\n provide: FilterSourceDirective,\n useExisting: forwardRef(() => sourceType)\n },\n ...provideFilterSource(sourceType)\n ];\n\n if (defaultFilterFactory != null) {\n providers.push({\n provide: FILTER_SOURCE_DIRECTIVE_DEFAULT_FILTER_TOKEN,\n useFactory: defaultFilterFactory,\n deps: [Injector]\n });\n }\n\n return providers;\n}\n\n/**\n * Abstract FilterSource implementation and directive.\n */\n@Directive()\nexport abstract class AbstractFilterSourceDirective<F = unknown> implements FilterSourceDirective<F>, OnDestroy {\n private readonly _defaultFilter = inject<MaybeObservableOrValue<F>>(FILTER_SOURCE_DIRECTIVE_DEFAULT_FILTER_TOKEN, { optional: true });\n\n protected readonly _defaultFilterSource = new FilterSourceInstance<F>({\n defaultFilter: this._defaultFilter\n });\n\n readonly filter$: Observable<F> = this._defaultFilterSource.filter$;\n\n ngOnDestroy(): void {\n this._defaultFilterSource.destroy();\n }\n\n protected setDefaultFilter(defaultFilter: Observable<Maybe<F>>): void {\n this._defaultFilterSource.setDefaultFilter(defaultFilter);\n console.log('Setting default filter: ', defaultFilter);\n }\n\n initWithFilter(filterObs: Observable<F>): void {\n this._defaultFilterSource.initWithFilter(filterObs);\n }\n\n setFilter(filter: F): void {\n this._defaultFilterSource.setFilter(filter);\n }\n\n resetFilter(): void {\n this._defaultFilterSource.resetFilter();\n }\n\n setInitialFilterTakesPriority(initialFilterTakesPriority: boolean) {\n this._defaultFilterSource.setInitialFilterTakesPriority(initialFilterTakesPriority);\n }\n}\n","import { Directive, OnInit, inject } from '@angular/core';\nimport { FilterSource, FilterSourceConnector } from '@dereekb/rxjs';\n\n/**\n * Connects the host FilterSource to a FilterSourceConnector.\n */\n@Directive({\n selector: '[dbxFilterConnectSource]',\n standalone: true\n})\nexport class DbxFilterConnectSourceDirective<F = unknown> implements OnInit {\n readonly filterSource = inject(FilterSource<F>, { host: true });\n readonly filterSourceConnector = inject(FilterSourceConnector<F>);\n\n ngOnInit(): void {\n this.filterSourceConnector.connectWithSource(this.filterSource);\n }\n}\n","import { Directive } from '@angular/core';\nimport { AbstractFilterSourceConnectorDirective } from './filter.abstract.connector.directive';\nimport { provideFilterSource, provideFilterSourceConnector } from './filter.content';\n\n/**\n * Used as a FilterSource and FilterSourceConnector.\n */\n@Directive({\n selector: '[dbxFilterSourceConnector]',\n providers: [...provideFilterSource(DbxFilterSourceConnectorDirective), ...provideFilterSourceConnector(DbxFilterSourceConnectorDirective)],\n standalone: true\n})\nexport class DbxFilterSourceConnectorDirective<F = unknown> extends AbstractFilterSourceConnectorDirective<F> {}\n","import { filterMaybe, FilterMapKey, FilterMap, MaybeObservableOrValue, maybeValueFromObservableOrValue } from '@dereekb/rxjs';\nimport { Directive, OnDestroy, inject } from '@angular/core';\nimport { BehaviorSubject, distinctUntilChanged } from 'rxjs';\n\n/**\n * Provides a FilterSource from a parent FilterMap.\n */\n@Directive()\nexport abstract class AbstractDbxFilterMapInstanceDirective<F> implements OnDestroy {\n readonly dbxFilterMap = inject(FilterMap<F>);\n private readonly _currentFilterMapKey = new BehaviorSubject<MaybeObservableOrValue<FilterMapKey>>(undefined);\n\n readonly filterMapKey$ = this._currentFilterMapKey.pipe(maybeValueFromObservableOrValue(), filterMaybe(), distinctUntilChanged());\n readonly instance$ = this.dbxFilterMap.instanceObsForKeyObs(this.filterMapKey$);\n\n ngOnDestroy(): void {\n this._currentFilterMapKey.complete();\n }\n\n setFilterMapKey(filterMapKey: MaybeObservableOrValue<FilterMapKey>) {\n this._currentFilterMapKey.next(filterMapKey);\n }\n}\n","import { FilterSource, FilterMapKey } from '@dereekb/rxjs';\nimport { switchMap, first, Observable } from 'rxjs';\nimport { Directive, effect, input } from '@angular/core';\nimport { provideFilterSource } from './filter.content';\nimport { AbstractDbxFilterMapInstanceDirective } from './filter.map.instance.directive';\nimport { type Maybe } from '@dereekb/util';\n\n/**\n * Abstract directive that extends AbstractDbxFilterMapInstanceDirective and implements FilterSource.\n */\n@Directive()\nexport abstract class AbstractDbxFilterMapSourceDirective<F> extends AbstractDbxFilterMapInstanceDirective<F> implements FilterSource<F> {\n readonly filter$: Observable<F> = this.instance$.pipe(switchMap((x) => x.filter$));\n\n initWithFilter(filterObs: Observable<F>): void {\n this.instance$.pipe(first()).subscribe((x) => x.initWithFilter(filterObs));\n }\n}\n\n/**\n * Provides a FilterSource from a parent FilterMap.\n */\n@Directive({\n selector: '[dbxFilterMapSource]',\n exportAs: 'dbxFilterMapSource',\n providers: [provideFilterSource(DbxFilterMapSourceDirective)],\n standalone: true\n})\nexport class DbxFilterMapSourceDirective<F> extends AbstractDbxFilterMapSourceDirective<F> implements FilterSource<F> {\n readonly dbxFilterMapSource = input<Maybe<FilterMapKey>>();\n protected readonly _dbxFilterMapSourceEffect = effect(() => this.setFilterMapKey(this.dbxFilterMapSource()));\n}\n","import { first } from 'rxjs';\nimport { Directive, effect, input } from '@angular/core';\nimport { FilterSourceConnector, FilterSource, FilterMapKey } from '@dereekb/rxjs';\nimport { provideFilterSource, provideFilterSourceConnector } from './filter.content';\nimport { AbstractDbxFilterMapSourceDirective } from './filter.map.source.directive';\nimport { type Maybe } from '@dereekb/util';\n\n/**\n * Acts as an \"input\" FilterSourceConnector for an FilterMap, as well as a source for the FilterSourceConnector.\n */\n@Directive({\n selector: '[dbxFilterMapSourceConnector]',\n exportAs: 'dbxFilterMapSourceConnector',\n providers: [...provideFilterSource(DbxFilterMapSourceConnectorDirective), ...provideFilterSourceConnector(DbxFilterMapSourceConnectorDirective)],\n standalone: true\n})\nexport class DbxFilterMapSourceConnectorDirective<F> extends AbstractDbxFilterMapSourceDirective<F> implements FilterSourceConnector<F> {\n readonly dbxFilterMapSourceConnector = input<Maybe<FilterMapKey>>();\n protected readonly _dbxFilterMapSourceConnectorEffect = effect(() => this.setFilterMapKey(this.dbxFilterMapSourceConnector()));\n\n // MARK: FilterSourceConnector\n connectWithSource(filterSource: FilterSource<F>): void {\n this.instance$.pipe(first()).subscribe((x) => {\n x.connectWithSource(filterSource);\n\n if (filterSource.initWithFilter) {\n filterSource.initWithFilter(this.filter$);\n }\n });\n }\n}\n","import { Directive, inject } from '@angular/core';\nimport { FilterMap } from '@dereekb/rxjs';\nimport { clean } from '../rxjs/clean';\n\n/**\n * Direction that provides a FilterMap.\n */\n@Directive({\n selector: '[dbxFilterMap]',\n exportAs: 'dbxFilterMap',\n providers: [FilterMap],\n standalone: true\n})\nexport class DbxFilterMapDirective<F> {\n readonly filterMap = clean(inject(FilterMap<F>));\n}\n","import { type FilterPresetStringRef, type FilterWithPreset, type FilterWithPresetOptional } from '@dereekb/rxjs';\nimport { type EmptyObject, type GetterOrValue, type Maybe, objectHasKey, objectHasKeys } from '@dereekb/util';\nimport { type ClickableAnchorLink } from '../router/anchor/anchor';\n\nexport interface ClickableFilterPreset<F extends FilterWithPreset<P>, P extends string = string> extends Pick<ClickableAnchorLink, 'title' | 'icon' | 'disabled'>, FilterPresetStringRef<P> {\n /**\n * GetterOrValue that retrieves the filter for this preset.\n *\n * A null value or empty object is used for reset.\n */\n readonly presetValue: GetterOrValue<FilterWithPresetOptional<F>> | EmptyObject | null;\n}\n\nexport function isClickableFilterPreset<F extends FilterWithPreset<P>, P extends string = string>(preset: object): preset is ClickableFilterPreset<F, P> {\n return objectHasKey(preset, 'presetValue');\n}\n\nexport interface ClickablePartialFilterPreset<F> extends Pick<ClickableAnchorLink, 'title' | 'icon' | 'disabled'> {\n /**\n * GetterOrValue that retrieves the partial filter value.\n *\n * A null value or empty object is used for no change.\n */\n readonly partialPresetValue: GetterOrValue<Partial<F>> | EmptyObject | null;\n /**\n * The current value to test against. Returns true if this partial preset is considered active.\n */\n readonly isActive: (currentFilter: Maybe<Partial<F>>) => boolean;\n}\n\nexport function isClickablePartialFilterPreset<F>(preset: object): preset is ClickablePartialFilterPreset<F> {\n return objectHasKeys(preset, ['partialPresetValue', 'isActive']);\n}\n\n/**\n * Convenience type for either a ClickableFilterPreset or a ClickablePartialFilterPreset of the same type.\n */\nexport type ClickableFilterPresetOrPartialPreset<F extends FilterWithPreset<P>, P extends string = string> = ClickableFilterPreset<F, P> | ClickablePartialFilterPreset<F>;\n","import { Directive } from '@angular/core';\nimport { AbstractFilterSourceDirective, provideFilterSourceDirective } from './filter.abstract.source.directive';\n\n/**\n * Basic filter source directive.\n */\n@Directive({\n selector: '[dbxFilterSource]',\n providers: provideFilterSourceDirective(DbxFilterSourceDirective),\n standalone: true\n})\nexport class DbxFilterSourceDirective<F> extends AbstractFilterSourceDirective<F> {}\n","import { NgModule } from '@angular/core';\nimport { DbxFilterMapDirective } from './filter.map.directive';\nimport { DbxFilterMapSourceConnectorDirective } from './filter.map.connector.directive';\nimport { DbxFilterSourceDirective } from './filter.source.directive';\nimport { DbxFilterSourceConnectorDirective } from './filter.connector.directive';\nimport { DbxFilterMapSourceDirective } from './filter.map.source.directive';\nimport { DbxFilterConnectSourceDirective } from './filter.connect.source.directive';\n\nconst importsAndExports = [DbxFilterSourceDirective, DbxFilterMapSourceConnectorDirective, DbxFilterConnectSourceDirective, DbxFilterSourceConnectorDirective, DbxFilterMapDirective, DbxFilterMapSourceDirective];\n\n@NgModule({\n imports: importsAndExports,\n exports: importsAndExports\n})\nexport class DbxCoreFilterModule {}\n","import { InjectionToken, type Injector, type NgModuleRef, type StaticProvider, type TemplateRef, type Type, type ViewRef } from '@angular/core';\nimport { type Configurable, type FactoryWithRequiredInput, filterMaybeArrayValues, type Maybe, mergeArrays, mergeObjects } from '@dereekb/util';\n\nexport const DBX_INJECTION_COMPONENT_DATA = new InjectionToken('DbxInjectionComponentConfigData');\n\nexport interface DbxInjectionComponentConfig<T = unknown> {\n /**\n * Type of Component to initialize.\n */\n readonly componentClass: Type<T>;\n /**\n * (Optional) providers to provide to the existing injector.\n */\n readonly providers?: Maybe<StaticProvider[]>;\n /**\n * (Optional) Custom parent injector to use when creating the component.\n */\n readonly injector?: Maybe<Injector>;\n /**\n * (Optional) Module ref to use when creating the component.\n */\n readonly ngModuleRef?: NgModuleRef<unknown>;\n /**\n * (Optional) Custom initialization code when an instance is created.\n *\n * This is called in an Angular injection context of the created component, so that inject() is available and will be destroyed when the created component is destroyed.\n */\n readonly init?: Maybe<(instance: T) => void>;\n /**\n * unknown optional data to inject into the component.\n */\n readonly data?: Maybe<unknown>;\n}\n\n/**\n * The injector may be important to where the dbxInjection is getting injected at. Some types may disallow setting a custom parent injector.\n */\nexport type DbxInjectionComponentConfigWithoutInjector<T = unknown> = Omit<DbxInjectionComponentConfig<T>, 'injector'>;\n\nexport type DbxInjectionComponentConfigFactory<I, T = unknown> = FactoryWithRequiredInput<DbxInjectionComponentConfig<T>, I>;\n\nexport interface DbxInjectionTemplateConfig<T = unknown> {\n /**\n * Template ref to display.\n */\n readonly templateRef?: Maybe<TemplateRef<T>>;\n /**\n * View ref to inject.\n */\n readonly viewRef?: Maybe<ViewRef>;\n}\n\n/**\n * Merges multiple configurations into a single configuration.\n *\n * @param configs\n * @returns\n */\nexport function mergeDbxInjectionComponentConfigs<T = unknown>(configs: Maybe<Partial<DbxInjectionComponentConfig<T>>>[]): Partial<DbxInjectionComponentConfig<T>> {\n const providers = mergeArrays(filterMaybeArrayValues(configs).map((x) => x.providers));\n const result = mergeObjects(configs) as Configurable<DbxInjectionComponentConfig<T>>;\n result.providers = providers;\n return result;\n}\n","import { type StaticProvider } from '@angular/core';\nimport { type ArrayOrValue, flattenArrayOrValueArray, type Maybe } from '@dereekb/util';\n\n/**\n * Merges the input providers into a single array.\n *\n * @param providers\n * @returns\n */\nexport function mergeStaticProviders(...providers: Maybe<ArrayOrValue<StaticProvider>>[]): StaticProvider[] {\n return flattenArrayOrValueArray<StaticProvider>(providers);\n}\n","import { type ComponentRef, Injector, runInInjectionContext, type ViewContainerRef } from '@angular/core';\nimport { distinctUntilChanged, map, shareReplay, BehaviorSubject, combineLatest } from 'rxjs';\nimport { type DbxInjectionComponentConfig, type DbxInjectionTemplateConfig, DBX_INJECTION_COMPONENT_DATA } from './injection';\nimport { type Initialized, type Destroyable, type Maybe } from '@dereekb/util';\nimport { type MaybeObservableOrValueGetter, SubscriptionObject, filterMaybe, maybeValueFromObservableOrValueGetter, skipAllInitialMaybe } from '@dereekb/rxjs';\nimport { mergeStaticProviders } from './injection.util';\n\n/**\n * Instance used by components to inject content based on the configuration into the view.\n */\nexport class DbxInjectionInstance<T> implements Initialized, Destroyable {\n private readonly _subscriptionObject = new SubscriptionObject();\n\n private readonly _config = new BehaviorSubject<MaybeObservableOrValueGetter<DbxInjectionComponentConfig<T>>>(undefined);\n private readonly _template = new BehaviorSubject<MaybeObservableOrValueGetter<DbxInjectionTemplateConfig<T>>>(undefined);\n\n private readonly _content = new BehaviorSubject<Maybe<ViewContainerRef>>(undefined);\n private readonly _componentRef = new BehaviorSubject<Maybe<ComponentRef<T>>>(undefined);\n\n private readonly _injector: Injector;\n\n readonly config$ = this._config.pipe(maybeValueFromObservableOrValueGetter(), distinctUntilChanged(), shareReplay(1));\n readonly template$ = this._template.pipe(maybeValueFromObservableOrValueGetter(), distinctUntilChanged(), shareReplay(1));\n readonly content$ = this._content.pipe(filterMaybe(), distinctUntilChanged(), shareReplay(1));\n\n get config(): MaybeObservableOrValueGetter<DbxInjectionComponentConfig<T>> {\n return this._config.value;\n }\n\n set config(config: MaybeObservableOrValueGetter<DbxInjectionComponentConfig<T>>) {\n this._config.next(config);\n }\n\n get template(): MaybeObservableOrValueGetter<DbxInjectionTemplateConfig<T>> {\n return this._template.value;\n }\n\n set template(template: MaybeObservableOrValueGetter<DbxInjectionTemplateConfig<T>>) {\n this._template.next(template);\n }\n\n get content(): Maybe<Maybe<ViewContainerRef>> {\n return this._content.value;\n }\n\n set content(content: Maybe<Maybe<ViewContainerRef>>) {\n this._content.next(content);\n }\n\n get componentRef(): Maybe<ComponentRef<T>> {\n return this._componentRef.value;\n }\n\n set componentRef(componentRef: Maybe<ComponentRef<T>>) {\n this._componentRef.next(componentRef);\n }\n\n constructor(injector: Injector) {\n this._injector = injector;\n }\n\n init(): void {\n // Wait until the first of either of the two inputs comes in as not defined, and then emit.\n // We filter the first maybe here between the two items.\n const configTemplateObs = combineLatest([this.config$, this.template$]).pipe(\n map(([config, template]) => {\n if (config || template) {\n return {\n config,\n template\n };\n } else {\n return undefined;\n }\n }),\n skipAllInitialMaybe()\n );\n\n this._subscriptionObject.subscription = combineLatest([configTemplateObs, this.content$]).subscribe(([inputConfig, content]) => {\n const { config, template } = inputConfig ?? {};\n this._reset(content);\n\n if (config) {\n this._initComponent(config, content);\n } else if (template) {\n this._initTemplate(template, content);\n }\n });\n }\n\n destroy(): void {\n this._subscriptionObject.destroy();\n this._config.complete();\n this._template.complete();\n this._content.complete();\n this._componentRef.complete();\n }\n\n private _initComponent(config: DbxInjectionComponentConfig<T>, content: ViewContainerRef): void {\n content.clear();\n\n const { init, injector: inputInjector, providers, ngModuleRef, componentClass, data } = config;\n\n if (!componentClass) {\n throw new Error('DbxInjectionInstance: componentClass was expected in the config but it was unavailable.');\n }\n\n const parentInjector = inputInjector ?? this._injector;\n let injector: Injector | undefined = parentInjector;\n\n if (providers || data) {\n const dataProvider = {\n provide: DBX_INJECTION_COMPONENT_DATA,\n useValue: data\n };\n\n injector = Injector.create({\n parent: parentInjector,\n providers: mergeStaticProviders(dataProvider, providers)\n });\n }\n\n const componentRef: ComponentRef<T> = content.createComponent(componentClass, { injector, ngModuleRef });\n const instance = componentRef.instance;\n\n if (init) {\n runInInjectionContext(componentRef.injector, () => init(instance));\n }\n\n this.componentRef = componentRef;\n }\n\n private _initTemplate(config: DbxInjectionTemplateConfig<T>, content: ViewContainerRef): void {\n content.clear();\n\n const { templateRef, viewRef } = config;\n\n if (templateRef) {\n content.createEmbeddedView(templateRef);\n\n // TODO: Figure out if these items need to be destroyed or not when this item is destroyed. If so, we need a reference to destroy.\n } else if (viewRef) {\n content.insert(viewRef);\n }\n }\n\n private _reset(content: ViewContainerRef): void {\n if (this.componentRef) {\n content.clear();\n this.componentRef = undefined;\n }\n }\n}\n","import { ViewContainerRef, OnInit, OnDestroy, Directive, Injector, inject } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { DbxInjectionComponentConfig, DbxInjectionTemplateConfig } from './injection';\nimport { DbxInjectionInstance as DbxInjectionInstance } from './injection.instance';\nimport { ObservableOrValueGetter } from '@dereekb/rxjs';\n\n/**\n * Abstract directive that injects content based on the configuration into the view.\n */\n@Directive()\nexport abstract class AbstractDbxInjectionDirective<T> implements OnInit, OnDestroy {\n private readonly _instance = new DbxInjectionInstance<T>(inject(Injector));\n\n ngOnInit(): void {\n this._instance.init();\n }\n\n ngOnDestroy(): void {\n this._instance.destroy();\n }\n\n setConfig(config: Maybe<ObservableOrValueGetter<Maybe<DbxInjectionComponentConfig<T>>>>) {\n this._instance.config = config;\n }\n\n setTemplate(template: Maybe<ObservableOrValueGetter<Maybe<DbxInjectionTemplateConfig<T>>>>) {\n this._instance.template = template;\n }\n\n setContent(content: Maybe<ViewContainerRef>) {\n this._instance.content = content;\n }\n}\n","import { Component, ViewContainerRef, input, viewChild, effect } from '@angular/core';\nimport { DbxInjectionComponentConfig, DbxInjectionTemplateConfig } from './injection';\nimport { AbstractDbxInjectionDirective } from './injection.directive';\nimport { type Maybe } from '@dereekb/util';\nimport { ObservableOrValueGetter } from '@dereekb/rxjs';\n\n/**\n * Component that injects content based on the configuration into the view.\n */\n@Component({\n selector: 'dbx-injection, [dbxInjection], [dbx-injection]',\n template: `\n <ng-template #content></ng-template>\n `,\n imports: [],\n standalone: true\n})\nexport class DbxInjectionComponent<T> extends AbstractDbxInjectionDirective<T> {\n readonly content = viewChild('content', { read: ViewContainerRef });\n\n readonly config = input<Maybe<ObservableOrValueGetter<Maybe<DbxInjectionComponentConfig<T>>>>>();\n readonly template = input<Maybe<ObservableOrValueGetter<Maybe<DbxInjectionTemplateConfig<T>>>>>();\n\n // allow signal writes for each as during their initialization they may write to a signal in some cases when initializing\n protected readonly _contentEffect = effect(() => this.setContent(this.content()));\n protected readonly _configEffect = effect(() => this.setConfig(this.config()));\n protected readonly _templateEffect = effect(() => this.setTemplate(this.template()));\n}\n","import { ChangeDetectionStrategy, Component, input } from '@angular/core';\nimport { DbxInjectionArrayEntry } from './injection.array';\nimport { type Maybe } from '@dereekb/util';\nimport { DbxInjectionComponent } from './injection.component';\n\n/**\n * Component that injects content based on the configuration into the view.\n */\n@Component({\n selector: 'dbx-injection-array',\n template: `\n @for (entry of entries(); track entry.key) {\n <dbx-injection [config]=\"entry.injectionConfig\"></dbx-injection>\n }\n `,\n imports: [DbxInjectionComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class DbxInjectionArrayComponent {\n readonly entries = input<Maybe<DbxInjectionArrayEntry[]>>(undefined);\n}\n","import { type Provider, type Type } from '@angular/core';\nimport { type DbxInjectionComponentConfig } from './injection';\n\n/**\n * DbxInjectedViewContext showContext() configuration.\n */\nexport interface DbxInjectionContextConfig<T = unknown, O = unknown> {\n /**\n * Injected config.\n */\n config: DbxInjectionComponentConfig<T>;\n /**\n * Promise used to retrieve data from the given instance.\n */\n use: (instance: T) => Promise<O>;\n}\n\n/**\n * View that can switch to show another arbitrary view, then switch back when the promise ends.\n *\n * It is similar to *ngIf/*ngSwitch, but the original child content is retained instead of discarded,\n * and returns once the special context is done being used.\n */\nexport abstract class DbxInjectionContext {\n /**\n * Shows the given context until the promise ends, then displays the original content.\n *\n * The original content is hidden instead of removed from the context to avoid destruction of children elements.\n */\n abstract showContext<T = unknown, O = unknown>(config: DbxInjectionContextConfig<T>): Promise<O>;\n\n /**\n * Bails out of any current promise, if one is set.\n *\n * Returns true if the bail signal has been sent.\n */\n abstract resetContext(): boolean;\n}\n\n/**\n * Allows a directive to provide a formly context and form.\n */\nexport function provideDbxInjectionContext<T extends DbxInjectionContext>(type: Type<T>): Provider[] {\n return [\n {\n provide: DbxInjectionContext,\n useExisting: type\n }\n ];\n}\n","import { Directive, EmbeddedViewRef, Injector, TemplateRef, ViewContainerRef, OnDestroy, OnInit, inject, effect, input } from '@angular/core';\nimport { DbxInjectionContext, DbxInjectionContextConfig, provideDbxInjectionContext } from './injection.context';\nimport { DbxInjectionInstance } from './injection.instance';\nimport { DbxInjectionComponentConfig } from './injection';\nimport { PromiseOrValue, PromiseReference, promiseReference, type Maybe } from '@dereekb/util';\n\n/**\n * DbxInjectedViewContext implementation. Acts similar to *ngIf, but instead switches to a different view without destroying the original child view.\n */\n@Directive({\n selector: '[dbxInjectionContext]',\n providers: provideDbxInjectionContext(DbxInjectionContextDirective),\n standalone: true\n})\nexport class DbxInjectionContextDirective<O = unknown> implements DbxInjectionContext, OnInit, OnDestroy {\n private readonly _injector = inject(Injector);\n private readonly _templateRef = inject(TemplateRef<O>);\n private readonly _viewContainer = inject(ViewContainerRef);\n\n private readonly _instance = new DbxInjectionInstance(this._injector);\n\n private _currentPromise: Maybe<PromiseReference<unknown>>;\n private _embeddedView!: EmbeddedViewRef<O>;\n private _isDetached = false;\n\n readonly config = input<Maybe<DbxInjectionComponentConfig<unknown>>>();\n\n protected readonly _configEffect = effect(() => {\n this.setConfig(this.config());\n\n // NOTE: we have/call setConfig() because the effect() may not respond to all value changes,\n // especially when setConfig() ends up being called twice quickly in quick succession.\n });\n\n ngOnInit() {\n this._instance.content = this._viewContainer;\n this._instance.init();\n this._embeddedView = this._viewContainer.createEmbeddedView(this._templateRef);\n\n // detach the embedded view\n this._viewContainer.detach();\n\n // reattach it through the template configuration.\n // the template configuration acts as the default.\n this._instance.template = {\n viewRef: this._embeddedView\n };\n }\n\n ngOnDestroy(): void {\n this._instance.destroy();\n this._embeddedView?.destroy(); // destroy our embedded view too if it is set.\n }\n\n async showContext<T, O>(config: DbxInjectionContextConfig<T>): Promise<O> {\n // clear the current context before showing something new.\n this.resetContext();\n\n let promiseRef: Maybe<PromiseReference<O>>;\n\n let result: Maybe<O>;\n let error: unknown;\n\n // wait for the promise to resolve and use to finish using that instance.\n try {\n promiseRef = promiseReference(async (resolve, reject) => {\n const injectionConfig: DbxInjectionComponentConfig<T> = {\n ...config.config,\n init: async (instance: T) => {\n // init if available in the base config.\n if (config.config.init) {\n config.config.init(instance);\n }\n\n try {\n const result = (await config.use(instance)) as PromiseOrValue<O>;\n resolve(result);\n } catch (e) {\n reject(e);\n }\n }\n };\n\n this.setConfig(injectionConfig as DbxInjectionComponentConfig<unknown>);\n });\n\n this._currentPromise = promiseRef as PromiseReference<unknown>;\n\n // await the promise\n await promiseRef.promise;\n } catch (e) {\n error = e;\n }\n\n // if we're still using the same promiseRef\n if (promiseRef && promiseRef === this._currentPromise) {\n // clear the config to reshow the view\n this.setConfig(undefined);\n\n // clear the current promise\n this._currentPromise = undefined;\n }\n\n if (error != null) {\n return Promise.reject(error);\n } else {\n return result as O;\n }\n }\n\n resetContext(): boolean {\n let clearedValue = false;\n\n if (this._currentPromise) {\n const promise = this._currentPromise;\n\n // clear the current promise too\n this._currentPromise = undefined;\n\n // clear the config.\n this.setConfig(undefined);\n\n // send a rejection signal to bail out.\n promise.reject(new Error('dbxInjectionContext bailout'));\n\n clearedValue = true;\n }\n\n return clearedValue;\n }\n\n setConfig(config: Maybe<DbxInjectionComponentConfig<unknown>>) {\n let reattach = false;\n\n if (config) {\n if (!this._isDetached) {\n // detach the original view before setting config.\n this._viewContainer.detach();\n this._isDetached = true;\n }\n } else if (this._isDetached) {\n reattach = true;\n }\n\n this._instance.config = config;\n\n if (reattach) {\n this._viewContainer.insert(this._embeddedView);\n this._isDetached = false;\n }\n }\n}\n","import { Directive, inject } from '@angular/core';\nimport { DbxInjectionContext, DbxInjectionContextConfig } from './injection.context';\n\n/**\n * Abstract DbxInjectionContext implementation that forwards commands to a host DbxInjectionContext.\n *\n * This abstract type is used by related types for dependency injection purposes, so that those types\n * can be injected instead of just any DbxInjectionContext.\n */\n@Directive()\nexport abstract class AbstractForwardDbxInjectionContextDirective implements DbxInjectionContext {\n readonly dbxInjectionContext = inject(DbxInjectionContext, { host: true });\n\n // MARK: DbxInjectionContext\n showContext<T = unknown, O = unknown>(config: DbxInjectionContextConfig<T, unknown>): Promise<O> {\n return this.dbxInjectionContext.showContext(config);\n }\n\n resetContext(): boolean {\n return this.dbxInjectionContext.resetContext();\n }\n}\n","import { asGetter, type GetterOrValue, type Maybe } from '@dereekb/util';\nimport { switchMapObject } from '@dereekb/rxjs';\nimport { type DbxInjectionComponentConfig } from './injection';\nimport { type Type } from '@angular/core';\n\n/**\n * Provides a switchMap that passes configuration from the observable, unless the value is null/undefined/true in which case it passes the default configuration.\n *\n * @param defaultConfig\n * @returns\n */\nexport function switchMapDbxInjectionComponentConfig<T extends DbxInjectionComponentConfig<X>, X = any>(defaultConfig?: GetterOrValue<Maybe<T | Type<X>>>) {\n const defaultAsGetter = asGetter(defaultConfig);\n\n return switchMapObject<T>({\n defaultGetter: () => {\n const value = defaultAsGetter();\n\n if (typeof value === 'function') {\n // is a component class\n return { componentClass: value } as T;\n } else {\n return value;\n }\n }\n });\n}\n","import { type AbstractType, Injector, type Provider, type Type } from '@angular/core';\n\nexport type InjectableType<T> = (Type<T> | AbstractType<T>) & Provider;\n\n/**\n * Creates a new instance of the injectable type with the input injector.\n *\n * @param type\n * @param parent\n * @returns\n */\nexport function newWithInjector<T>(type: InjectableType<T>, parent: Injector): T {\n const injector = Injector.create({ providers: [type], parent });\n return injector.get(type);\n}\n","import { map, Observable } from 'rxjs';\nimport { ComponentStore } from '@ngrx/component-store';\nimport { Inject, Optional, Injectable, OnDestroy } from '@angular/core';\nimport { LockSet, ObservableOrValue, asObservable } from '@dereekb/rxjs';\nimport { type Maybe } from '@dereekb/util';\n\nexport interface LockSetComponent {\n readonly lockSet: LockSet;\n}\n\nexport interface LockSetComponentStoreConfig {\n readonly parent?: Maybe<Observable<LockSetComponent>>;\n readonly locks?: {\n [key: string]: Observable<boolean>;\n };\n}\n\n/**\n * Abstract ComponentStore extension that provides a LockSet and OnDestroy delaying/cleanup.\n */\n@Injectable()\nexport abstract class LockSetComponentStore<S extends object> extends ComponentStore<S> implements OnDestroy {\n readonly lockSet = new LockSet();\n\n protected lockSetDestroyDelayMs = 2000;\n protected lockSetDestroyTimeoutMs: Maybe<number>;\n\n // NOTE: Injection does not occur here, but we need @Injectable to compile properly for Angular usage\n // eslint-disable-next-line @angular-eslint/prefer-inject\n protected constructor(@Inject(null) @Optional() protected readonly initialState?: S) {\n super(initialState);\n }\n\n // MARK: State Changes\n readonly resetStore = this.updater(() => ({ ...this.initialState }) as S);\n\n // MARK: Locks\n protected setupLockSet({ parent, locks }: LockSetComponentStoreConfig): void {\n if (parent) {\n this.setParentLockSet(parent);\n }\n\n if (locks) {\n for (const key in locks) {\n if (locks[key]) {\n this.addLock(key, locks[key]);\n }\n }\n }\n }\n\n setParentLockSet(obs: ObservableOrValue<Maybe<LockSetComponent>>): void {\n this.lockSet.setParentLockSet(asObservable(obs).pipe(map((x) => x?.lockSet)));\n }\n\n addLock(key: string, obs: Observable<boolean>): void {\n this.lockSet.addLock(key, obs);\n }\n\n // MARK: Cleanup\n override ngOnDestroy(): void {\n // Wait for any actions to complete before destroying.\n this.lockSet.destroyOnNextUnlock(\n {\n fn: () => {\n this._destroyNow();\n },\n timeout: this.lockSetDestroyTimeoutMs\n },\n this.lockSetDestroyDelayMs\n );\n }\n\n /**\n * Completes the cleanup of the object.\n */\n _destroyNow() {\n this.lockSet.destroy();\n }\n}\n","import { type Observable, map } from 'rxjs';\nimport { isThrottled, unixDateTimeSecondsNumberForNow, DataDoesNotExistError, DataIsExpiredError, type ReadStoredData, type StoredData, type StoredDataStorageKey, type StoredDataString, type Maybe, hasNonNullValue, splitJoinRemainder } from '@dereekb/util';\nimport { type StorageAccessor } from './storage.accessor';\n\n// MARK: SimpleStorageAccessor\nexport interface SimpleStorageAccessorConverter<T> {\n /**\n * Converts the input value to a string.\n */\n stringifyValue(value: T): StoredDataString;\n /**\n * Converts the data string into a value.\n */\n parseValue(data: StoredDataString): T;\n}\n\n/**\n * SimpleStorageAccessor delegate.\n */\nexport interface SimpleStorageAccessorDelegate<T> extends SimpleStorageAccessorConverter<T>, StorageAccessor<StoredDataString> {}\n\nexport class StringifySimpleStorageAccessorConverter<T> implements SimpleStorageAccessorConverter<T> {\n stringifyValue(value: T): StoredDataString {\n return JSON.stringify(value);\n }\n\n parseValue(data: StoredDataString): T {\n return JSON.parse(data);\n }\n}\n\nexport class WrapperSimpleStorageAccessorDelegate<T> implements SimpleStorageAccessorDelegate<T> {\n private readonly _delegate: StorageAccessor<StoredDataString>;\n private readonly _converter: SimpleStorageAccessorConverter<T>;\n\n constructor(delegate: StorageAccessor<StoredDataString>, converter: SimpleStorageAccessorConverter<T>) {\n this._delegate = delegate;\n this._converter = converter;\n }\n\n get(key: string): Observable<Maybe<StoredDataString>> {\n return this._delegate.get(key);\n }\n\n set(key: string, value: StoredDataString): Observable<void> {\n return this._delegate.set(key, value);\n }\n\n remove(key: string): Observable<void> {\n return this._delegate.remove(key);\n }\n\n clear(): Observable<object> {\n return this._delegate.clear();\n }\n\n all(prefix?: string): Observable<string[]> {\n return this._delegate.all(prefix);\n }\n\n allKeys(prefix?: string): Observable<string[]> {\n return this._delegate.allKeys(prefix);\n }\n\n stringifyValue(value: T): StoredDataString {\n return this._converter.stringifyValue(value);\n }\n\n parseValue(data: StoredDataString): T {\n return this._converter.parseValue(data);\n }\n}\n\nexport interface SimpleStorageAccessorConfig {\n /**\n * Storage Key Prefix\n */\n readonly prefix: string;\n /**\n * Optional prefix/value splitter.\n */\n readonly prefixSplitter?: string;\n /**\n * Number in milliseconds that objects stored will expire in.\n */\n readonly expiresIn?: number;\n}\n\ninterface ConfiguredSimpleStorageAccessorConfig extends SimpleStorageAccessorConfig {\n readonly prefixSplitter: string;\n readonly fullPrefix: string;\n}\n\nexport function assertValidStorageKeyPrefix(prefix: string, prefixSplitter: string): void {\n if (!prefixSplitter) {\n throw new Error('Invalid storage key prefix splitter. Must be defined and not empty.'); // TODO(FUTURE): Consider changing to a concrete error type\n }\n\n if (!isValidStorageKeyPrefix(prefix, prefixSplitter)) {\n throw new Error('Invalid storage key prefix.');\n }\n}\n\nexport function isValidStorageKeyPrefix(prefix: string, prefixSpltter: string): boolean {\n return Boolean(prefix && prefix.indexOf(prefixSpltter) === -1);\n}\n\n/**\n * LimitedStorageAccessor implementation that uses a Delegate\n */\nexport class SimpleStorageAccessor<T> implements StorageAccessor<T> {\n static readonly PREFIX_SPLITTER = '::';\n\n private readonly _delegate: SimpleStorageAccessorDelegate<T>;\n protected readonly _config: ConfiguredSimpleStorageAccessorConfig;\n\n constructor(delegate: SimpleStorageAccessorDelegate<T>, config: SimpleStorageAccessorConfig) {\n const prefix = config.prefix;\n const prefixSplitter = config.prefixSplitter ?? SimpleStorageAccessor.PREFIX_SPLITTER;\n\n assertValidStorageKeyPrefix(prefix, prefixSplitter);\n\n const fullPrefix = `${prefix}${prefixSplitter}`;\n\n this._delegate = delegate;\n this._config = {\n ...config,\n prefixSplitter,\n fullPrefix\n };\n }\n\n get delegate() {\n return this._delegate;\n }\n\n get config() {\n return this._config;\n }\n\n // MARK: LimitedStorageAccessor\n get(inputKey: string): Observable<T> {\n const storeKey = this.makeStorageKey(inputKey);\n return this._delegate.get(storeKey).pipe(\n map((storedData: Maybe<string>) => {\n if (storedData) {\n const readStoredData = this.readStoredData(storedData);\n\n if (!readStoredData.expired) {\n return readStoredData.convertedData;\n } else {\n throw new DataIsExpiredError<T>(readStoredData);\n }\n } else {\n throw new DataDoesNotExistError();\n }\n })\n );\n }\n\n set(inputKey: string, inputValue: T): Observable<void> {\n const storeKey = this.makeStorageKey(inputKey);\n const storeData: StoredData = this.buildStoredData(inputValue);\n const data = JSON.stringify(storeData);\n return this._delegate.set(storeKey, data);\n }\n\n remove(key: string): Observable<void> {\n const storeKey = this.makeStorageKey(key);\n return this._delegate.remove(storeKey);\n }\n\n all(): Observable<T[]> {\n return this._delegate.all(this._config.fullPrefix).pipe(\n map((allStoredData) => {\n return allStoredData\n .map((storedData) => {\n const readStoredData = this.readStoredData(storedData);\n\n if (!readStoredData.expired) {\n return readStoredData.convertedData;\n } else {\n return null;\n }\n })\n .filter(hasNonNullValue);\n })\n );\n }\n\n allKeys(): Observable<string[]> {\n return this._delegate.allKeys(this._config.fullPrefix).pipe(map((keys) => keys.map((x) => this.decodeStorageKey(x))));\n }\n\n clear(): Observable<object> {\n return this._delegate.clear();\n }\n\n // MARK: Stored Values\n protected readStoredData(storedDataString: StoredDataString): ReadStoredData<T> {\n const storedData: StoredData = JSON.parse(storedDataString);\n const expired = this.isExpiredStoredData(storedData);\n const convertedData = this._delegate.parseValue(storedData.data);\n\n return {\n ...storedData,\n expired,\n convertedData\n };\n }\n\n protected buildStoredData(value: T): StoredData {\n return {\n storedAt: unixDateTimeSecondsNumberForNow(),\n data: this.stringifyValue(value)\n };\n }\n\n protected isExpiredStoredData(storeData: StoredData): boolean {\n const expiresIn = this._config.expiresIn;\n if (expiresIn) {\n if (storeData.storedAt) {\n return isThrottled(expiresIn, storeData.storedAt);\n }\n\n return true;\n } else {\n return false;\n }\n }\n\n // MARK: Internal\n protected makeStorageKey(key: string): StoredDataStorageKey {\n return `${this._config.prefix}${this._config.prefixSplitter}${String(key)}`;\n }\n\n protected isKeyOfAccessor(storageKey: StoredDataStorageKey): boolean {\n return storageKey.startsWith(this._config.fullPrefix);\n }\n\n protected decodeStorageKey(storageKey: StoredDataStorageKey): string {\n const split = splitJoinRemainder(storageKey, this._config.prefixSplitter, 2);\n return split[1];\n }\n\n protected stringifyValue(value: T): string {\n return this._delegate.stringifyValue(value);\n }\n}\n","import { filterMaybeArrayValues, type StoredDataString, type FullStorageObject, StorageObjectUtility, type Maybe } from '@dereekb/util';\nimport { Observable, map, shareReplay } from 'rxjs';\nimport { type StorageAccessor } from './storage.accessor';\n\n/**\n * Simple StorageAccessor implementation that wraps a FullStorageObject.\n */\nexport class StringStorageAccessor implements StorageAccessor<StoredDataString> {\n private readonly _storage: FullStorageObject;\n\n constructor(storage: FullStorageObject) {\n this._storage = storage;\n }\n\n get(key: string): Observable<Maybe<StoredDataString>> {\n return new Observable((x) => {\n const value = this._storage.getItem(key);\n x.next(value);\n x.complete();\n });\n }\n\n set(key: string, value: StoredDataString): Observable<void> {\n return new Observable<void>((x) => {\n this._storage.setItem(key, value);\n x.next();\n x.complete();\n });\n }\n\n remove(key: string): Observable<void> {\n return new Observable<void>((x) => {\n this._storage.removeItem(key);\n x.next();\n x.complete();\n });\n }\n\n clear(): Observable<StoredDataString[]> {\n const removed = this._storage.removeAll();\n return new Observable((x) => {\n x.next(removed);\n x.complete();\n });\n }\n\n all(): Observable<StoredDataString[]> {\n return this.allKeys().pipe(\n map((x) => filterMaybeArrayValues(x.map((y) => this._storage.getItem(y)))),\n shareReplay(1)\n );\n }\n\n allKeys(): Observable<string[]> {\n return new Observable((x) => {\n const result = StorageObjectUtility.allKeysFromStorageObject(this._storage);\n x.next(result);\n x.complete();\n });\n }\n}\n","import { InjectionToken } from '@angular/core';\n\nexport const DEFAULT_STORAGE_OBJECT_TOKEN = new InjectionToken('DBX_CORE_DEFAULT_STORAGE_OBJECT');\nexport const DEFAULT_STORAGE_ACCESSOR_FACTORY_TOKEN = new InjectionToken('DBX_CORE_DEFAULT_STORAGE_ACCESSOR_FACTORY');\n","import { Injectable, inject } from '@angular/core';\nimport { StorageAccessor } from './storage.accessor';\nimport { SimpleStorageAccessorConfig, SimpleStorageAccessor, SimpleStorageAccessorConverter, StringifySimpleStorageAccessorConverter, WrapperSimpleStorageAccessorDelegate } from './storage.accessor.simple';\nimport { StringStorageAccessor } from './storage.accessor.string';\nimport { DEFAULT_STORAGE_OBJECT_TOKEN } from './storage.di';\nimport { FullStorageObject, StoredDataString } from '@dereekb/util';\n\nexport interface StorageAccessorFactoryConfig<T> extends SimpleStorageAccessorConfig {\n storage?: StorageAccessor<StoredDataString>;\n converter?: SimpleStorageAccessorConverter<T>;\n}\n\n/**\n * Used for building SimpleStorageAccessor instances from SimpleStorageAccessorConfig.\n */\n@Injectable()\nexport class SimpleStorageAccessorFactory {\n readonly storageObject = inject<FullStorageObject>(DEFAULT_STORAGE_OBJECT_TOKEN);\n\n createStorageAccessor<T>(config: StorageAccessorFactoryConfig<T>): SimpleStorageAccessor<T> {\n const storage = config.storage ?? new StringStorageAccessor(this.storageObject);\n const converter = config.converter ?? new StringifySimpleStorageAccessorConverter<T>();\n const delegate = new WrapperSimpleStorageAccessorDelegate<T>(storage, converter);\n\n const accessorConfig = {\n prefix: config.prefix\n };\n\n return new SimpleStorageAccessor<T>(delegate, accessorConfig);\n }\n}\n","import { type Maybe } from '@dereekb/util';\nimport { type Observable } from 'rxjs';\n\n/**\n * Stored object accessor that can get/set/remove via a key, or be cleared entirely.\n */\nexport abstract class LimitedStorageAccessor<T> {\n /**\n * Attempts to get the value. Throws a DataDoesNotExistError if not available.\n */\n abstract get(key: string): Observable<Maybe<T>>;\n\n abstract set(key: string, value: Maybe<T>): Observable<void>;\n\n abstract remove(key: string): Observable<void>;\n\n abstract clear(): Observable<object>;\n}\n\n/**\n * LimitedStorageAccessor extension that has knowledge of all stored keys.\n */\nexport abstract class StorageAccessor<T> extends LimitedStorageAccessor<T> {\n /**\n * Returns all values. Filtered by keys of a given prefix.\n */\n abstract all(prefix?: string): Observable<T[]>;\n\n /**\n * Returns all keys. Filtered by keys of a given prefix.\n */\n abstract allKeys(prefix?: string): Observable<string[]>;\n}\n\n/**\n * StorageAccessor-like object that has immediate/synchronous functionality for get/set.\n */\nexport abstract class InstantStorageAccessor<T> {\n abstract getNow(key: string): T | undefined;\n\n abstract setNow(key: string, value: T): void;\n\n abstract removeNow(key: string): void;\n}\n","import { type FullStorageObject, type Maybe, type StorageObject, StorageObjectUtility, type StoredDataStorageKey } from '@dereekb/util';\n\n/**\n * StorageObject using LocalStorage.\n */\nexport class FullLocalStorageObject implements FullStorageObject {\n private readonly _localStorage: StorageObject;\n\n constructor(localStorage: StorageObject) {\n this._localStorage = localStorage;\n }\n\n get isPersistant(): boolean {\n return true;\n }\n\n get isAvailable(): boolean {\n const test = '_T_E_S_T_';\n\n try {\n // Tests setting and removing an item. These will throw an\n // exception if the localstorage is not available\n this._localStorage.setItem(test, test);\n this._localStorage.removeItem(test);\n return true;\n } catch (e) {\n return false;\n }\n }\n\n get length(): number {\n return this._localStorage.length;\n }\n\n getItem(key: StoredDataStorageKey): Maybe<string> {\n return this._localStorage.getItem(key);\n }\n\n setItem(key: StoredDataStorageKey, item: string): void {\n this._localStorage.setItem(key, item);\n }\n\n removeItem(key: StoredDataStorageKey): void {\n this._localStorage.removeItem(key);\n }\n\n key(index: number): string | null {\n return this._localStorage.key(index);\n }\n\n removeAll(): string[] {\n const keys = StorageObjectUtility.allKeysFromStorageObject(this);\n keys.forEach((x) => this.removeItem(x));\n return keys;\n }\n}\n","import { SHARED_MEMORY_STORAGE } from '@dereekb/util';\nimport { FullLocalStorageObject } from './storage.object.localstorage';\n\n/**\n * FullStorageObject implementation that uses a localstorage that entirely resides in memory.\n */\nexport class MemoryStorageObject extends FullLocalStorageObject {\n get isLastingStorage(): boolean {\n return false;\n }\n\n override get isAvailable(): boolean {\n return true;\n }\n\n constructor() {\n super(SHARED_MEMORY_STORAGE);\n }\n}\n","import { type EnvironmentProviders, type Provider, makeEnvironmentProviders } from '@angular/core';\nimport { type FullStorageObject } from '@dereekb/util';\nimport { SimpleStorageAccessorFactory } from './storage.accessor.simple.factory';\nimport { DEFAULT_STORAGE_OBJECT_TOKEN, DEFAULT_STORAGE_ACCESSOR_FACTORY_TOKEN } from './storage.di';\nimport { FullLocalStorageObject } from './storage.object.localstorage';\nimport { MemoryStorageObject } from './storage.object.memory';\n\n/**\n * Default storage object factory function that creates a FullLocalStorageObject,\n * falling back to MemoryStorageObject if localStorage is not available.\n */\nexport function defaultStorageObjectFactory(): FullStorageObject {\n let storageObject: FullStorageObject = new FullLocalStorageObject(localStorage);\n\n if (!storageObject.isAvailable) {\n storageObject = new MemoryStorageObject();\n }\n\n return storageObject;\n}\n\n/**\n * Creates EnvironmentProviders for providing a default storage object and SimpleStorageAccessorFactory.\n *\n * @returns EnvironmentProviders\n */\nexport function provideDbxStorage(): EnvironmentProviders {\n const providers: Provider[] = [\n // Storage object\n {\n provide: DEFAULT_STORAGE_OBJECT_TOKEN,\n useFactory: defaultStorageObjectFactory\n },\n // Storage accessor factory\n {\n provide: SimpleStorageAccessorFactory,\n useClass: SimpleStorageAccessorFactory\n },\n {\n provide: DEFAULT_STORAGE_ACCESSOR_FACTORY_TOKEN,\n useExisting: SimpleStorageAccessorFactory\n }\n ];\n\n return makeEnvironmentProviders(providers);\n}\n","import { type MonoTypeOperatorFunction, tap } from 'rxjs';\nimport { type ChangeDetectorRef, type ViewRef, type ElementRef } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\n\n/**\n * Convenience function used within observables for views that need to detect changes after a value changes.\n *\n * @deprecated reminder to move to Angular signals\n *\n * @param cdRef\n * @param timeout\n * @returns\n */\nexport function tapDetectChanges<T>(cdRef: Maybe<ChangeDetectorRef>, timeout = 0): MonoTypeOperatorFunction<T> {\n return cdRef ? tap(() => setTimeout(() => safeDetectChanges(cdRef), timeout)) : tap();\n}\n\n/**\n * Triggers a check for detecting any changes on the model safely to ve registered via detectChanges().\n *\n * @deprecated reminder to move to Angular signals\n *\n * @param cdRef\n */\nexport function safeDetectChanges(cdRef: ChangeDetectorRef): void {\n safeUseCdRef(cdRef, () => cdRef.detectChanges());\n}\n\n/**\n * Convenience function used within observables for views that use the OnPush ChangeDetectionStrategy and needs to call markForCheck when a new observable value is pushed.\n *\n * NOTE: If the observable is being consumed via the \"async\" pipe, this may not be necessary.\n *\n * @deprecated reminder to move to Angular signals\n * @param cdRef\n * @param timeout\n * @returns\n */\nexport function tapSafeMarkForCheck<T>(cdRef: Maybe<ChangeDetectorRef>, timeout = 0): MonoTypeOperatorFunction<T> {\n return cdRef ? tap(() => setTimeout(() => safeMarkForCheck(cdRef), timeout)) : tap();\n}\n\n/**\n * Marks the ChangeDetectorRef for changes as long as the view has not been destroyed.\n *\n * @deprecated reminder to move to Angular signals\n *\n * @param cdRef\n */\nexport function safeMarkForCheck(cdRef: ChangeDetectorRef): void {\n safeUseCdRef(cdRef, () => cdRef.markForCheck());\n}\n\n/**\n * Triggers a detection change on the input view as long as the view has not been destroyed.\n *\n * @deprecated reminder to move to Angular signals\n * @param cdRef\n */\nexport function safeUseCdRef(cdRef: ChangeDetectorRef, use: (cdRef: ChangeDetectorRef) => void): void {\n if (!(cdRef as ViewRef).destroyed) {\n use(cdRef);\n }\n}\n\n/**\n * Used to check an injected ElementRef that wraps an ng-content injection point whether or not any content was injected,\n * or more specifically if the parent component passed any target content to the child. This will still return true if\n * passed content is empty.\n *\n * TS:\n * @ViewChild('customLoading', { static: false }) customCustom: ElementRef;\n *\n * HTML:\n * <div #customContent>\n * <ng-content select=\"[content]\"></ng-content>\n * </div>\n */\nexport function checkNgContentWrapperHasContent(ref: Maybe<ElementRef<Element>>): boolean {\n // https://github.com/angular/angular/issues/26083\n let hasContent = false;\n\n if (ref != null) {\n const childNodes = ref.nativeElement.childNodes;\n const hasChildNodes = childNodes && childNodes.length > 0;\n hasContent = Boolean(hasChildNodes);\n }\n\n return hasContent;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["importsAndExports","initialState","reducer","DbxAppContextActions.setState","featureKey","reducers","fromDbxAppContextState.dbxAppContextStateFeatureKey","fromDbxAppContextState.reducer","onDbxAppContext.DbxAppContextActions.setState","DbxAppAuthActions.loggedOut","DbxAppAuthUserActions.setUserIdentifier","DbxAppAuthUserActions.setUserIsOnboarded","DbxAppAuthUserActions.setUserState","DbxAppAuthUserActions.setUserRoles","fromDbxAppAuthUserState.dbxAppAuthUserFeatureKey","fromDbxAppAuthUserState.reducer","onDbxAppAuth.DbxAppAuthActions.loggedOut","onDbxAppAuth.DbxAppAuthActions.loggedIn","onDbxAppAuth.DbxAppAuthActions.logout","onDbxAppAuth.DbxAppAuthUserActions.setUserIdentifier","onDbxAppAuth.DbxAppAuthUserActions.setUserState","onDbxAppAuth.DbxAppAuthUserActions.setUserRoles","onDbxAppAuth.DbxAppAuthUserActions.setUserIsOnboarded","fromDbxAppAuth.featureKey","fromDbxAppAuth.reducers","fromDbxAppAuth.selectDbxAppAuthUser","fromDbxAppContext.selectDbxAppContextState","onDbxAppContext.DbxAppContextActions.resetState","fromDbxAppContext.featureKey","fromDbxAppContext.reducers"],"mappings":";;;;;;;;;;;;;;;;AAIA;;;;;;;;;;;;;;AAcG;AACG,SAAU,KAAK,CAA0C,KAAQ,EAAA;AACrE,IAAA,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAErC,IAAA,IAAK,KAAqB,CAAC,OAAO,EAAE;QAClC,UAAU,CAAC,SAAS,CAAC,MAA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AK,CAAC,YAAY,EAAE,CAAC;AACjD;AAEA;;;;;AAKG;AACG,SAAU,YAAY,CAAC,KAAwB,EAAE,GAAuC,EAAA;AAC5F,IAAA,IAAI,CAAE,KAAiB,CAAC,SAAS,EAAE;QACjC,GAAG,CAAC,KAAK,CAAC;IACZ;AACF;AAEA;;;;;;;;;;;;AAYG;AACG,SAAU,+BAA+B,CAAC,GAA+B,EAAA;;IAE7E,IAAI,UAAU,GAAG,KAAK;AAEtB,IAAA,IAAI,GAAG,IAAI,IAAI,EAAE;AACf,QAAA,MAAM,UAAU,GAAG,GAAG,CAAC,aAAa,CAAC,UAAU;QAC/C,MAAM,aAAa,GAAG,UAAU,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC;AACzD,QAAA,UAAU,GAAG,OAAO,CAAC,aAAa,CAAC;IACrC;AAEA,IAAA,OAAO,UAAU;AACnB;;ACzFA;;AAEG;;;;"}
1
+ {"version":3,"file":"dereekb-dbx-core.mjs","sources":["../../../../packages/dbx-core/src/lib/rxjs/clean.ts","../../../../packages/dbx-core/src/lib/rxjs/subscription.ts","../../../../packages/dbx-core/src/lib/rxjs/lockset.ts","../../../../packages/dbx-core/src/lib/rxjs/loading.ts","../../../../packages/dbx-core/src/lib/rxjs/destroy.ts","../../../../packages/dbx-core/src/lib/action/action.store.source.ts","../../../../packages/dbx-core/src/lib/action/directive/auto/action.automodify.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/auto/action.autotrigger.directive.ts","../../../../packages/dbx-core/src/lib/action/action.handler.ts","../../../../packages/dbx-core/src/lib/action/action.ts","../../../../packages/dbx-core/src/lib/action/action.store.ts","../../../../packages/dbx-core/src/lib/action/action.holder.ts","../../../../packages/dbx-core/src/lib/action/action.machine.ts","../../../../packages/dbx-core/src/lib/action/action.store.source.provide.ts","../../../../packages/dbx-core/src/lib/action/directive/context/action.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/context/action.source.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/debug/action.logger.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/map/action.map.ts","../../../../packages/dbx-core/src/lib/action/directive/map/action.map.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/map/action.map.key.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/map/action.map.source.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/map/action.map.utility.ts","../../../../packages/dbx-core/src/lib/action/directive/map/action.map.working.disable.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.disabled.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.disableonsuccess.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.handler.instance.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.handler.directive.ts","../../../../packages/dbx-core/src/lib/view/if.directive.ts","../../../../packages/dbx-core/src/lib/util/input.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.idle.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.presuccess.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.success.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.success.handler.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.error.handler.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.value.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.working.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.enforce.modified.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.value.trigger.instance.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.value.trigger.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.value.stream.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.triggered.directive.ts","../../../../packages/dbx-core/src/lib/action/action.module.ts","../../../../packages/dbx-core/src/lib/action/action.reference.ts","../../../../packages/dbx-core/src/lib/router/segue.ts","../../../../packages/dbx-core/src/lib/auth/service/auth.service.ts","../../../../packages/dbx-core/src/lib/auth/router/provider/uirouter/hook.ts","../../../../packages/dbx-core/src/lib/auth/router/provider/uirouter/redirect.ts","../../../../packages/dbx-core/src/lib/auth/router/provider/uirouter/auth.hook.ts","../../../../packages/dbx-core/src/lib/auth/router/provider/uirouter/role.hook.ts","../../../../packages/dbx-core/src/lib/auth/router/provider/uirouter/state.hook.ts","../../../../packages/dbx-core/src/lib/context/context.ts","../../../../packages/dbx-core/src/lib/context/state/action/data.action.ts","../../../../packages/dbx-core/src/lib/context/state/reducer/data.reducer.ts","../../../../packages/dbx-core/src/lib/context/state/reducer/index.ts","../../../../packages/dbx-core/src/lib/context/state/effect/index.ts","../../../../packages/dbx-core/src/lib/auth/auth.user.ts","../../../../packages/dbx-core/src/lib/auth/state/action/auth.action.ts","../../../../packages/dbx-core/src/lib/auth/state/action/user.action.ts","../../../../packages/dbx-core/src/lib/auth/state/reducer/user.reducer.ts","../../../../packages/dbx-core/src/lib/auth/state/reducer/index.ts","../../../../packages/dbx-core/src/lib/router/router/service/router.go.ts","../../../../packages/dbx-core/src/lib/router/router/service/router.transition.service.ts","../../../../packages/dbx-core/src/lib/router/router/service/router.service.ts","../../../../packages/dbx-core/src/lib/auth/router/auth.router.ts","../../../../packages/dbx-core/src/lib/auth/router/auth.router.service.ts","../../../../packages/dbx-core/src/lib/auth/router/state/effect/auth.router.state.effect.ts","../../../../packages/dbx-core/src/lib/auth/router/state/auth.router.state.providers.ts","../../../../packages/dbx-core/src/lib/auth/router/auth.router.providers.ts","../../../../packages/dbx-core/src/lib/auth/service/auth.service.rxjs.ts","../../../../packages/dbx-core/src/lib/auth/state/effect/auth.effect.ts","../../../../packages/dbx-core/src/lib/auth/auth.state.providers.ts","../../../../packages/dbx-core/src/lib/auth/auth.providers.ts","../../../../packages/dbx-core/src/lib/auth/auth.role.any.directive.ts","../../../../packages/dbx-core/src/lib/auth/auth.role.has.directive.ts","../../../../packages/dbx-core/src/lib/auth/auth.role.not.directive.ts","../../../../packages/dbx-core/src/lib/auth/auth.state.service.ts","../../../../packages/dbx-core/src/lib/button/button.ts","../../../../packages/dbx-core/src/lib/button/action/action.button.trigger.directive.ts","../../../../packages/dbx-core/src/lib/button/action/action.button.directive.ts","../../../../packages/dbx-core/src/lib/button/router/button.segue.directive.ts","../../../../packages/dbx-core/src/lib/button/button.directive.ts","../../../../packages/dbx-core/src/lib/button/button.loading.directive.ts","../../../../packages/dbx-core/src/lib/button/button.module.ts","../../../../packages/dbx-core/src/lib/context/context.service.ts","../../../../packages/dbx-core/src/lib/context/context.directive.ts","../../../../packages/dbx-core/src/lib/context/context.providers.ts","../../../../packages/dbx-core/src/lib/environment/environment.ts","../../../../packages/dbx-core/src/lib/environment/environment.service.ts","../../../../packages/dbx-core/src/lib/environment/environment.providers.ts","../../../../packages/dbx-core/src/lib/router/anchor/anchor.ts","../../../../packages/dbx-core/src/lib/router/anchor/anchor.directive.ts","../../../../packages/dbx-core/src/lib/router/anchor/clickable.ts","../../../../packages/dbx-core/src/lib/router/auth/hook/id.hook.ts","../../../../packages/dbx-core/src/lib/router/auth/hook/uid.hook.ts","../../../../packages/dbx-core/src/lib/router/router/transition/transition.ts","../../../../packages/dbx-core/src/lib/router/router/provider/angular/angular.router.service.ts","../../../../packages/dbx-core/src/lib/router/router/provider/angular/angular.router.service.module.ts","../../../../packages/dbx-core/src/lib/router/router/provider/uirouter/uirouter.router.service.ts","../../../../packages/dbx-core/src/lib/router/router/provider/uirouter/uirouter.router.service.providers.ts","../../../../packages/dbx-core/src/lib/router/router/transition/transition.rxjs.ts","../../../../packages/dbx-core/src/lib/router/router/transition/transition.directive.ts","../../../../packages/dbx-core/src/lib/router/router/transition/transition.watcher.directive.ts","../../../../packages/dbx-core/src/lib/router/router/service/router.service.util.ts","../../../../packages/dbx-core/src/lib/router/router/service/router.service.rxjs.ts","../../../../packages/dbx-core/src/lib/router/router/util/route.reader.ts","../../../../packages/dbx-core/src/lib/router/router/util/route.default.ts","../../../../packages/dbx-core/src/lib/router/model/id.param.redirect.ts","../../../../packages/dbx-core/src/lib/router/model/model.router.ts","../../../../packages/dbx-core/src/lib/router/model/model.router.uid.directive.ts","../../../../packages/dbx-core/src/lib/router/model/model.router.id.directive.ts","../../../../packages/dbx-core/src/lib/router/model/model.router.key.directive.ts","../../../../packages/dbx-core/src/lib/pipe/async/asobservable.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/datedayrange.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/tojsdate.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/datedistance.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/dateformatdistance.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/dateformatfromto.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/datedaytimerange.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/datetimerange.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/daterangedistance.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/datetimerangeonly.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/targetdatetosystemdate.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/datetimerangeonlydistance.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/timezoneabbreviation.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/systemdatetotargetdate.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/minutesstring.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/timedistance.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/tominutes.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/misc/prettyjson.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/value/cuttext.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/value/getvalue.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/value/dollar.pipe.ts","../../../../packages/dbx-core/src/lib/filter/filter.abstract.connector.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.content.ts","../../../../packages/dbx-core/src/lib/filter/filter.abstract.source.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.connect.source.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.connector.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.map.instance.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.map.source.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.map.connector.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.map.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.preset.ts","../../../../packages/dbx-core/src/lib/filter/filter.source.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.module.ts","../../../../packages/dbx-core/src/lib/injection/injection.ts","../../../../packages/dbx-core/src/lib/injection/injection.util.ts","../../../../packages/dbx-core/src/lib/injection/injection.instance.ts","../../../../packages/dbx-core/src/lib/injection/injection.directive.ts","../../../../packages/dbx-core/src/lib/injection/injection.component.ts","../../../../packages/dbx-core/src/lib/injection/injection.array.component.ts","../../../../packages/dbx-core/src/lib/injection/injection.context.ts","../../../../packages/dbx-core/src/lib/injection/injection.context.directive.ts","../../../../packages/dbx-core/src/lib/injection/injection.context.forward.directive.ts","../../../../packages/dbx-core/src/lib/injection/injection.rxjs.ts","../../../../packages/dbx-core/src/lib/injection/injector.ts","../../../../packages/dbx-core/src/lib/ngrx/store.lockset.ts","../../../../packages/dbx-core/src/lib/storage/storage.accessor.simple.ts","../../../../packages/dbx-core/src/lib/storage/storage.accessor.string.ts","../../../../packages/dbx-core/src/lib/storage/storage.di.ts","../../../../packages/dbx-core/src/lib/storage/storage.accessor.simple.factory.ts","../../../../packages/dbx-core/src/lib/storage/storage.accessor.ts","../../../../packages/dbx-core/src/lib/storage/storage.object.localstorage.ts","../../../../packages/dbx-core/src/lib/storage/storage.object.memory.ts","../../../../packages/dbx-core/src/lib/storage/storage.providers.ts","../../../../packages/dbx-core/src/lib/util/view.ts","../../../../packages/dbx-core/src/dereekb-dbx-core.ts"],"sourcesContent":["import { DestroyRef, inject } from '@angular/core';\nimport { type Destroyable, type DestroyFunction } from '@dereekb/util';\nimport { type Subject } from 'rxjs';\n\n/**\n * Wraps a Destroyable in a function that registers the input Destroyable to be destroyed\n * when the DestroyRef is destroyed in the context.\n *\n * Must be run in an Angular injection context.\n *\n * @example\n * // Clean up a Destroyable object (e.g., SubscriptionObject, LockSet):\n * const sub = new SubscriptionObject(obs$.subscribe(handler));\n * clean(sub);\n *\n * @example\n * // Clean up a destroy function directly:\n * clean(() => resource.release());\n */\nexport function clean<T extends Destroyable | DestroyFunction>(input: T): T {\n const destroyRef = inject(DestroyRef);\n\n if ((input as Destroyable).destroy) {\n destroyRef.onDestroy(() => (input as Destroyable).destroy());\n } else {\n destroyRef.onDestroy(input as DestroyFunction);\n }\n\n return input;\n}\n\n/**\n * Wraps a Subject in a function that registers the input Subject to be completed\n * when the DestroyRef is destroyed in the context.\n *\n * Must be run in an Angular injection context.\n *\n * @example\n * // Complete a BehaviorSubject when the component is destroyed:\n * readonly value$ = completeOnDestroy(new BehaviorSubject<string>('initial'));\n *\n * @example\n * // Complete a ReplaySubject when the component is destroyed:\n * readonly events$ = completeOnDestroy(new ReplaySubject<Event>(1));\n */\nexport function completeOnDestroy<T extends Pick<Subject<any>, 'complete' | 'error'>>(input: T): T {\n clean(() => input.complete());\n return input;\n}\n","import { SubscriptionObject } from '@dereekb/rxjs';\nimport { type GetterOrValue, getValueFromGetter, type Maybe } from '@dereekb/util';\nimport { type Unsubscribable } from 'rxjs';\nimport { clean } from './clean';\n\n// MARK: cleanSubscription()\n/**\n * Creates a new SubscriptionObject that is automatically destroyed when the context is destroyed.\n *\n * Must be run within an Angular injection context.\n *\n * @example\n * // Pass a subscription directly - it will be cleaned up automatically:\n * cleanSubscription(obs$.subscribe(handler));\n *\n * // Or create first, then set the subscription later:\n * readonly _sub = cleanSubscription();\n * this._sub.subscription = obs$.subscribe(handler);\n */\nexport function cleanSubscription<T extends Unsubscribable = Unsubscribable>(sub?: Maybe<GetterOrValue<T>>): SubscriptionObject<T> {\n const subscription = getValueFromGetter(sub);\n const subscriptionObject = new SubscriptionObject<T>(subscription);\n clean(subscriptionObject);\n return subscriptionObject;\n}\n","import { DestroyRef, inject } from '@angular/core';\nimport { type DestroyOnNextUnlockConfig, LockSet, SubscriptionObject } from '@dereekb/rxjs';\nimport { type Configurable, type DestroyFunction, type GetterOrValue, getValueFromGetter, type Maybe } from '@dereekb/util';\nimport { cleanSubscription } from './subscription';\nimport { type Unsubscribable } from 'rxjs';\n\nexport interface CleanLockSetConfig {\n /**\n * Arbitrary onDestroy function to call when onDestroy is called by the internal DestroyRef.\n */\n readonly onDestroy?: Maybe<() => void>;\n /**\n * Called when the LockSet is finally destroyed.\n */\n readonly onLockSetDestroy?: Maybe<() => void>;\n /**\n * Configures when the lockset should be destroyed.\n */\n readonly destroyLocksetTiming?: Maybe<DestroyOnNextUnlockConfig>;\n}\n\nexport type CleanLockSet = LockSet & { readonly _cleanDestroy: () => void };\n\n/**\n * Creates a new LockSet that is automatically destroyed when the component is destroyed.\n *\n * Must be run within an Angular injection context.\n *\n * @param config Optional configuration for destruction behavior and callbacks.\n *\n * @example\n * // Create a simple lockset:\n * readonly lockSet = cleanLockSet();\n *\n * @example\n * // Create with a callback when the lockset is destroyed:\n * readonly lockSet = cleanLockSet({\n * onLockSetDestroy: () => console.log('lockset destroyed')\n * });\n */\nexport function cleanLockSet(config?: Maybe<CleanLockSetConfig>): CleanLockSet {\n const { onDestroy, onLockSetDestroy, destroyLocksetTiming } = config ?? {};\n\n const destroyRef = inject(DestroyRef);\n const lockSet = new LockSet() as unknown as CleanLockSet;\n\n function cleanDestroy() {\n onDestroy?.();\n lockSet.destroyOnNextUnlock(destroyLocksetTiming); // flag to be destroyed on the next complete unlock\n }\n\n destroyRef.onDestroy(() => cleanDestroy());\n\n if (onLockSetDestroy) {\n const _destroySub = cleanSubscription(\n lockSet.onDestroy$.subscribe(() => {\n onLockSetDestroy();\n _destroySub.destroy();\n })\n );\n }\n\n (lockSet as Configurable<CleanLockSet>)._cleanDestroy = cleanDestroy;\n return lockSet;\n}\n\n// MARK: cleanWithLockSet()\n/**\n * Runs the given onDestroy function when the context is destroyed, and the lock set's next unlock occurs.\n *\n * Must be run within an Angular injection context.\n *\n * @param lockSet The lockset to use.\n * @param onDestroy The function to run when the lockset is unlocked.\n *\n * @example\n * // Defer cleanup until the lockset unlocks after component destroy:\n * cleanWithLockSet(this.lockSet, () => resource.release());\n */\nexport function cleanWithLockSet(lockSet: LockSet, onDestroy: DestroyFunction) {\n const destroyRef = inject(DestroyRef);\n\n destroyRef.onDestroy(() => {\n lockSet.onNextUnlock(() => {\n onDestroy();\n });\n });\n}\n\n// MARK: cleanSubscriptionWithLockSet()\n/**\n * Config for cleanSubscriptionWithLockSet()\n */\nexport interface CleanSubscriptionWithLockSetConfig<T extends Unsubscribable = Unsubscribable> {\n readonly lockSet: LockSet;\n readonly sub?: Maybe<GetterOrValue<T>>;\n}\n\n/**\n * Creates a new SubscriptionObject that is automatically destroyed when the context is destroyed, and the lock set's next unlock occurs.\n *\n * Must be run within an Angular injection context.\n *\n * @example\n * // Pass a subscription that waits for the lockset to unlock before cleanup:\n * readonly _sub = cleanSubscriptionWithLockSet({\n * lockSet: this.lockSet,\n * sub: obs$.subscribe(handler)\n * });\n *\n * @example\n * // Create first, then set the subscription later:\n * readonly _sub = cleanSubscriptionWithLockSet({ lockSet: this.lockSet });\n * this._sub.subscription = obs$.subscribe(handler);\n */\nexport function cleanSubscriptionWithLockSet<T extends Unsubscribable = Unsubscribable>(input: CleanSubscriptionWithLockSetConfig<T>): SubscriptionObject<T> {\n const subscription = getValueFromGetter(input.sub);\n const subscriptionObject = new SubscriptionObject<T>(subscription);\n cleanWithLockSet(input.lockSet, () => subscriptionObject.destroy());\n return subscriptionObject;\n}\n","import { type LoadingState, type LoadingContextEvent, type LoadingStateContextInput, type MutableLoadingStateContext, loadingStateContext, type ListLoadingState, type ListLoadingStateContextInput, type MutableListLoadingStateContext, listLoadingStateContext } from '@dereekb/rxjs';\nimport { clean } from './clean';\n\n/**\n * Creates a new LoadingStateContext that is automatically destroyed when the context is destroyed.\n *\n * Must be run within an Angular injection context.\n *\n * @example\n * // Create with an observable source:\n * readonly context = cleanLoadingContext<MyData>(this.data$);\n *\n * @example\n * // Create empty, then set the observable source later:\n * readonly context = cleanLoadingContext<MyData>();\n * this.context.obs = this.data$;\n */\nexport function cleanLoadingContext<T = unknown, S extends LoadingState<T> = LoadingState<T>, E extends LoadingContextEvent = LoadingContextEvent & S>(input?: LoadingStateContextInput<T, S, E>): MutableLoadingStateContext<T, S, E> {\n return clean(loadingStateContext(input));\n}\n\n/**\n * Creates a new ListLoadingStateContext that is automatically destroyed when the context is destroyed.\n *\n * Must be run within an Angular injection context.\n *\n * @example\n * // Create with an observable source:\n * readonly listContext = cleanListLoadingContext<MyItem>(this.items$);\n *\n * @example\n * // Create empty, then set the observable source later:\n * readonly listContext = cleanListLoadingContext<MyItem>();\n * this.listContext.obs = this.items$;\n */\nexport function cleanListLoadingContext<L = unknown, S extends ListLoadingState<L> = ListLoadingState<L>>(input?: ListLoadingStateContextInput<L, S>): MutableListLoadingStateContext<L, S> {\n return clean(listLoadingStateContext(input));\n}\n","import { type DestroyFunction, DestroyFunctionObject, type Maybe } from '@dereekb/util';\nimport { clean } from './clean';\n\n/**\n * Creates a new DestroyFunctionObject that is automatically destroyed when the context is destroyed.\n *\n * Must be run within an Angular injection context.\n *\n * @example\n * // Pass a destroy function directly:\n * cleanDestroy(() => resource.release());\n *\n * @example\n * // Create first, then set the destroy function later:\n * readonly _destroy = cleanDestroy();\n * this._destroy.setDestroyFunction(() => resource.release());\n */\nexport function cleanDestroy(input?: Maybe<DestroyFunction>): DestroyFunctionObject {\n const destroyFunction = new DestroyFunctionObject(input);\n clean(destroyFunction);\n return destroyFunction;\n}\n","import { first, switchMap, type Observable, type Subscription } from 'rxjs';\nimport { LockSet, filterMaybe, type LoadingState, type LoadingStateType, type MaybeObservableOrValue } from '@dereekb/rxjs';\nimport { type Destroyable, type Maybe, type ReadableError } from '@dereekb/util';\nimport { type ActionContextState, type ActionContextStore } from './action.store';\nimport { type DbxActionDisabledKey, type DbxActionRejectedPair, type DbxActionState, type DbxActionSuccessPair, type DbxActionWorkOrWorkProgress, type DbxActionWorkProgress } from './action';\n\n/**\n * Source that provides a ActionContextStore observable.\n */\nexport abstract class ActionContextStoreSource<T = unknown, O = unknown> {\n /**\n * Observable referencing the ActionContextStore.\n *\n * This observable by design is pre-filtered to not return null values.\n */\n abstract readonly store$: Observable<ActionContextStore<T, O>>;\n}\n\n/**\n * Secondary source. Used by DbxActionContextComponent to find secondary sources.\n */\nexport abstract class SecondaryActionContextStoreSource<T = unknown, O = unknown> extends ActionContextStoreSource<T, O> {}\n\nexport function actionContextStoreSourcePipe<T, O>(obs: Observable<Maybe<ActionContextStore<T, O>>>): Observable<ActionContextStore<T, O>> {\n return obs.pipe(filterMaybe());\n}\n\nexport type PipeActionStoreFunction<R, T, O> = (store: ActionContextStore<T, O>) => Observable<R>;\n\nexport function pipeActionStore<R = unknown, T = unknown, O = unknown>(source: ActionContextStoreSource<T, O>, pipeFn: PipeActionStoreFunction<R, T, O>): Observable<R> {\n return source.store$.pipe(switchMap(pipeFn));\n}\n\nexport type UseActionStoreFunction<T, O> = (store: ActionContextStore<T, O>) => void;\n\n/**\n * Convenience function for subscribing to the input source once and using the provided store.\n */\nexport function useActionStore<T = unknown, O = unknown>(source: ActionContextStoreSource<T, O>, useFn: UseActionStoreFunction<T, O>): Subscription {\n return source.store$.pipe(first()).subscribe(useFn);\n}\n\n/**\n * Service that wraps a ActionContextStoreSource.\n */\nexport class DbxActionContextStoreSourceInstance<T = unknown, O = unknown> implements ActionContextStoreSource<T, O>, Destroyable {\n readonly lockSet = new LockSet();\n\n private readonly _source: ActionContextStoreSource<T, O>;\n\n constructor(source: ActionContextStoreSource<T, O>) {\n if (!source) {\n throw new Error('Source is required.');\n }\n\n this._source = source;\n }\n\n get source(): ActionContextStoreSource<T, O> {\n return this._source;\n }\n\n public destroy(): void {\n this.lockSet.destroyOnNextUnlock();\n }\n\n // MARK: Store\n get store$(): Observable<ActionContextStore<T, O>> {\n return this.source.store$;\n }\n\n pipeStore<R>(pipeFn: PipeActionStoreFunction<R, T, O>): Observable<R> {\n return pipeActionStore(this.source, pipeFn);\n }\n\n useStore(useFn: UseActionStoreFunction<T, O>): Subscription {\n return useActionStore(this.source, useFn);\n }\n\n get state$(): Observable<ActionContextState<T, O>> {\n return this.pipeStore((x) => x.state$);\n }\n\n get idle$(): Observable<boolean> {\n return this.pipeStore((x) => x.idle$);\n }\n\n get triggered$(): Observable<boolean> {\n return this.pipeStore((x) => x.triggered$);\n }\n\n get valueReady$(): Observable<T> {\n return this.pipeStore((x) => x.valueReady$);\n }\n\n get success$(): Observable<Maybe<O>> {\n return this.pipeStore((x) => x.success$);\n }\n\n get successPair$(): Observable<DbxActionSuccessPair<T, O>> {\n return this.pipeStore((x) => x.successPair$);\n }\n\n get workProgress$(): Observable<Maybe<DbxActionWorkProgress>> {\n return this.pipeStore((x) => x.workProgress$);\n }\n\n get error$(): Observable<Maybe<ReadableError>> {\n return this.pipeStore((x) => x.error$);\n }\n\n get rejected$(): Observable<Maybe<ReadableError>> {\n return this.pipeStore((x) => x.rejected$);\n }\n\n get rejectedPair$(): Observable<DbxActionRejectedPair<T>> {\n return this.pipeStore((x) => x.rejectedPair$);\n }\n\n get isModified$(): Observable<boolean> {\n return this.pipeStore((x) => x.isModified$);\n }\n\n get canTrigger$(): Observable<boolean> {\n return this.pipeStore((x) => x.canTrigger$);\n }\n\n get isModifiedAndCanTriggerUpdates$(): Observable<boolean> {\n return this.pipeStore((x) => x.isModifiedAndCanTriggerUpdates$);\n }\n\n get isModifiedAndCanTrigger$(): Observable<boolean> {\n return this.pipeStore((x) => x.isModifiedAndCanTrigger$);\n }\n\n get actionState$(): Observable<DbxActionState> {\n return this.pipeStore((x) => x.actionState$);\n }\n\n get loadingState$(): Observable<LoadingState<O>> {\n return this.pipeStore((x) => x.loadingState$);\n }\n\n get loadingStateType$(): Observable<LoadingStateType> {\n return this.pipeStore((x) => x.loadingStateType$);\n }\n\n get isWorking$(): Observable<boolean> {\n return this.pipeStore((x) => x.isWorking$);\n }\n\n get isWorkingOrWorkProgress$(): Observable<DbxActionWorkOrWorkProgress> {\n return this.pipeStore((x) => x.isWorkingOrWorkProgress$);\n }\n\n get isSuccess$(): Observable<boolean> {\n return this.pipeStore((x) => x.isSuccess$);\n }\n\n get disabledKeys$(): Observable<string[]> {\n return this.pipeStore((x) => x.disabledKeys$);\n }\n\n get isDisabled$(): Observable<boolean> {\n return this.pipeStore((x) => x.isDisabled$);\n }\n\n get errorCountSinceLastSuccess$(): Observable<number> {\n return this.pipeStore((x) => x.errorCountSinceLastSuccess$);\n }\n\n public enable(key?: DbxActionDisabledKey, enable = true): void {\n this.disable(key, !enable);\n }\n\n public disable(key?: DbxActionDisabledKey, disable = true): void {\n this.useStore((x) => (disable ? x.disable(key) : x.enable(key)));\n }\n\n public setIsSame(isSame?: boolean | Observable<boolean> | Observable<void>): void {\n this.useStore((x) => x.setIsSame(isSame));\n }\n\n public setIsModified(isModified?: boolean | Observable<boolean> | Observable<void>): void {\n this.useStore((x) => x.setIsModified(isModified));\n }\n\n public setWorkProgress(workProgress: MaybeObservableOrValue<DbxActionWorkProgress>): void {\n this.useStore((x) => x.setWorkProgress(workProgress));\n }\n\n public trigger(): void {\n this.useStore((x) => x.trigger());\n }\n\n public triggerWithValue(value: T | Observable<T>): void {\n this.useStore((x) => {\n x.trigger();\n x.readyValue(value);\n });\n }\n\n public readyValue(value: T | Observable<T>): void {\n this.useStore((x) => x.readyValue(value));\n }\n\n public startWorking(): void {\n this.useStore((x) => x.startWorking());\n }\n\n public reject(error: Maybe<ReadableError | Observable<ReadableError>>): void {\n this.useStore((x) => x.reject(error));\n }\n\n public resolve(value: O | Observable<O>): void {\n this.useStore((x) => x.resolve(value));\n }\n\n public reset(): void {\n this.useStore((x) => x.reset());\n }\n}\n","import { Directive, inject, input } from '@angular/core';\nimport { cleanSubscriptionWithLockSet } from '../../../rxjs';\nimport { distinctUntilChanged, filter, switchMap, type Observable, EMPTY } from 'rxjs';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { isNotFalse } from '@dereekb/util';\nimport { toObservable } from '@angular/core/rxjs-interop';\n\n@Directive({\n selector: 'dbxActionAutoModify, [dbxActionAutoModify]',\n standalone: true\n})\nexport class DbxActionAutoModifyDirective<T, O> {\n readonly source = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n readonly autoModifyEnabled = input<boolean, string | boolean>(true, { alias: 'dbxActionAutoModify', transform: isNotFalse });\n readonly markAsModified$: Observable<void> = toObservable(this.autoModifyEnabled).pipe(\n distinctUntilChanged(),\n switchMap((x) => {\n let obs: Observable<any>;\n\n if (x) {\n obs = this.source.isModified$.pipe(filter((x) => !x));\n } else {\n obs = EMPTY;\n }\n\n return obs;\n })\n );\n\n constructor() {\n cleanSubscriptionWithLockSet({\n lockSet: this.source.lockSet,\n sub: this.markAsModified$.subscribe(() => {\n this.source.setIsModified(true);\n })\n });\n }\n}\n","import { inject, Directive, input, computed, signal, type Signal } from '@angular/core';\nimport { cleanSubscriptionWithLockSet } from '../../../rxjs';\nimport { debounce, distinctUntilChanged, exhaustMap, filter, first, map, mergeMap, shareReplay, switchMap, throttle, EMPTY, interval, combineLatest, type Observable } from 'rxjs';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { isDefinedAndNotFalse, isNotFalse, type Maybe } from '@dereekb/util';\nimport { toObservable } from '@angular/core/rxjs-interop';\n\nconst DEFAULT_DEBOUNCE_MS = 2 * 1000;\n\nconst DEFAULT_THROTTLE_MS = 10 * 1000;\n\nconst DEFAULT_ERROR_THROTTLE_MS = 3 * 1000;\n\nconst MAX_ERRORS_TO_THROTTLE_ON = 6;\n\nconst DBX_ACTION_AUTO_TRIGGER_FAST_TRIGGER_DEBOUNCE = 200;\nconst DBX_ACTION_AUTO_TRIGGER_INSTANT_TRIGGER_DEBOUNCE = 10;\n\n/**\n * Directive that automatically triggers the action periodically when it is in a modified state.\n *\n * When using auto triggers be sure to make sure that the action is not triggering too often due to misconfiguration.\n */\n@Directive({\n selector: 'dbxActionAutoTrigger,[dbxActionAutoTrigger]',\n standalone: true\n})\nexport class DbxActionAutoTriggerDirective<T = unknown, O = unknown> {\n readonly source = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n\n readonly triggerDebounce = input<Maybe<number>>(undefined);\n readonly triggerThrottle = input<Maybe<number>>(undefined);\n readonly triggerErrorThrottle = input<number, Maybe<number>>(DEFAULT_ERROR_THROTTLE_MS, { transform: (x) => x ?? DEFAULT_ERROR_THROTTLE_MS });\n readonly maxErrorsForThrottle = input<number, Maybe<number>>(MAX_ERRORS_TO_THROTTLE_ON, { transform: (x) => x ?? MAX_ERRORS_TO_THROTTLE_ON });\n readonly triggerLimit = input<Maybe<number>>();\n readonly triggerEnabled = input<boolean, Maybe<string | boolean>>(true, { alias: 'dbxActionAutoTrigger', transform: isNotFalse });\n readonly useFastTriggerPreset = input<boolean, Maybe<'' | boolean>>(false, { transform: isDefinedAndNotFalse });\n readonly useInstantTriggerPreset = input<boolean, Maybe<'' | boolean>>(false, { transform: isDefinedAndNotFalse });\n\n readonly triggerDebounceSignal = computed(() => {\n let debounce = this.triggerDebounce();\n\n if (debounce == null) {\n const useFastTrigger = this.useFastTriggerPreset();\n const useInstantTrigger = this.useInstantTriggerPreset();\n\n if (useFastTrigger) {\n debounce = DBX_ACTION_AUTO_TRIGGER_FAST_TRIGGER_DEBOUNCE;\n } else if (useInstantTrigger) {\n debounce = DBX_ACTION_AUTO_TRIGGER_INSTANT_TRIGGER_DEBOUNCE;\n }\n }\n\n return debounce ?? DEFAULT_DEBOUNCE_MS;\n });\n\n readonly triggerThrottleSignal: Signal<number> = computed(() => {\n let throttle = this.triggerThrottle();\n\n if (throttle == null) {\n const useFastTrigger = this.useFastTriggerPreset();\n const useInstantTrigger = this.useInstantTriggerPreset();\n\n if (useFastTrigger) {\n throttle = DBX_ACTION_AUTO_TRIGGER_FAST_TRIGGER_DEBOUNCE;\n } else if (useInstantTrigger) {\n throttle = DBX_ACTION_AUTO_TRIGGER_INSTANT_TRIGGER_DEBOUNCE;\n }\n }\n\n return throttle ?? DEFAULT_THROTTLE_MS;\n });\n\n readonly triggerCountSignal = signal<number>(0);\n\n readonly _errorCount$ = this.source.errorCountSinceLastSuccess$;\n readonly _triggerCount$ = this.source.isModifiedAndCanTriggerUpdates$.pipe(\n // each time something is triggered the\n filter(() => this.triggerEnabled() ?? false),\n debounce(() => interval(this.triggerDebounceSignal())),\n throttle(\n () =>\n this._errorCount$.pipe(\n first(),\n exhaustMap((errorCount) => {\n const maxErrors = this.maxErrorsForThrottle() ?? MAX_ERRORS_TO_THROTTLE_ON;\n const throttleTime = this.triggerErrorThrottle() ?? DEFAULT_ERROR_THROTTLE_MS;\n const additionalInterval = Math.min(errorCount, maxErrors) * throttleTime;\n\n return interval(this.triggerThrottleSignal() + additionalInterval);\n })\n ),\n { leading: true, trailing: true }\n ),\n // Check again for the \"trailing\" piece.\n filter(() => this.triggerEnabled() ?? false),\n mergeMap(() => this.source.isModifiedAndCanTrigger$.pipe(first())),\n filter((x) => x),\n map(() => {\n const count = this.triggerCountSignal();\n this.triggerCountSignal.update((x) => x + 1);\n return count;\n }),\n shareReplay(1)\n );\n\n /**\n * Observable for the trigger mechanism.\n */\n readonly triggerCount$ = toObservable(this.triggerEnabled).pipe(\n switchMap((enabled) => {\n let countObs: Observable<number>;\n\n if (enabled !== false) {\n countObs = this._triggerCount$;\n } else {\n countObs = EMPTY;\n }\n\n return countObs;\n })\n );\n\n private readonly _isTriggerLimited$: Observable<readonly [number, boolean]> = combineLatest([this.triggerCount$, toObservable(this.triggerLimit)]).pipe(\n map(([triggerCount, limit]) => {\n const isAllowedToRun = limit != null ? triggerCount < limit : true;\n return [triggerCount, isAllowedToRun] as const;\n }),\n shareReplay(1)\n );\n\n readonly isTriggerAllowedToRun$ = this._isTriggerLimited$.pipe(\n map((x) => x[1]),\n shareReplay(1)\n );\n\n readonly automaticTrigger$: Observable<void> = this._isTriggerLimited$.pipe(\n filter((x) => x[1]),\n distinctUntilChanged((a, b) => a[0] === b[0]), // Only trigger when the count changes.\n map(() => undefined as void)\n );\n\n constructor() {\n cleanSubscriptionWithLockSet({\n lockSet: this.source.lockSet,\n sub: this.automaticTrigger$.subscribe(() => {\n this.source.trigger();\n })\n });\n }\n}\n","import { type Maybe, type ReadableError } from '@dereekb/util';\nimport { type DbxActionContextStoreSourceInstance } from './action.store.source';\nimport { type WorkInstanceDelegate } from '@dereekb/rxjs';\nimport { type Observable } from 'rxjs';\n\n/**\n * WorkInstanceDelegate implementation using an DbxActionContextStoreSourceInstance.\n */\nexport class DbxActionWorkInstanceDelegate<T = unknown, O = unknown> implements WorkInstanceDelegate<O> {\n private _source: DbxActionContextStoreSourceInstance<T, O>;\n\n constructor(source: DbxActionContextStoreSourceInstance<T, O>) {\n this._source = source;\n }\n\n get source() {\n return this._source;\n }\n\n startWorking(): void {\n this.source.startWorking();\n }\n\n success(result: O): void {\n this.source.resolve(result);\n }\n\n reject(error: Maybe<ReadableError | Observable<ReadableError>>): void {\n this.source.reject(error);\n }\n}\n","import { LoadingStateType } from '@dereekb/rxjs';\nimport { type PercentNumber, type Maybe } from '@dereekb/util';\n\n/**\n * Used to denote the percent progress of a working action.\n *\n * This is a PercentNumber, a number between 0 and 100.\n */\nexport type DbxActionWorkProgress = PercentNumber;\n\n/**\n * Used for denoting working state or progress.\n *\n * True is working, but no progress level.\n */\nexport type DbxActionWorkOrWorkProgress = boolean | DbxActionWorkProgress;\n\n/**\n * Creates a working progress value from an array of working progress values.\n *\n * @param workOrWorkProgress The array of working progress values to use.\n * @param progressPercent An optional progress percent value to use if the working progress is a boolean.\n * @returns The working progress value.\n */\nexport function dbxActionWorkProgress(workOrWorkProgress: Maybe<DbxActionWorkOrWorkProgress>[], progressPercent?: Maybe<DbxActionWorkProgress>) {\n const workingValue = workOrWorkProgress.reduce((acc, val) => acc ?? val);\n const isWorking = workingValue != null && workingValue !== false;\n\n let workingProgress: DbxActionWorkOrWorkProgress;\n\n if (isWorking) {\n if (typeof workingValue === 'number') {\n workingProgress = workingValue;\n } else {\n workingProgress = progressPercent ?? true;\n }\n } else {\n workingProgress = false;\n }\n\n return workingProgress;\n}\n\n/**\n * Used by ActionContextState to denote what state the action is in.\n */\nexport enum DbxActionState {\n /**\n * No action in progress. Waiting for the trigger.\n */\n IDLE = 'idle',\n /**\n * Idle state that can be set to show that the source is not yet ready.\n */\n DISABLED = 'disabled',\n /**\n * The action was triggered. We wait (and allow) the value to be updated.\n */\n TRIGGERED = 'triggered',\n /**\n * The trigger was accepted and the value is updated. It should begin working immediately.\n *\n * ValueReady cannot be set until triggered is set.\n */\n VALUE_READY = 'valueReady',\n /**\n * The action is in progress.\n */\n WORKING = 'working',\n /**\n * The trigger, action, or value was rejected due to an error or other issue.\n *\n * An error may be specified optionally.\n */\n REJECTED = 'rejected',\n /**\n * The action resolved without issue.\n */\n RESOLVED = 'resolved'\n}\n\n/**\n * Contains the input value and the output result from a DbxAction.\n */\nexport interface DbxActionSuccessPair<T, O> {\n readonly value: T;\n readonly result: Maybe<O>;\n}\n\n/**\n * Contains the input value and the output error from a DbxAction.\n */\nexport interface DbxActionRejectedPair<T> {\n readonly value: T;\n readonly error: unknown;\n}\n\n/**\n * Unique key for disabling/enabling.\n */\nexport type DbxActionDisabledKey = string;\n\nexport const DEFAULT_ACTION_DISABLED_KEY = 'dbx_action_disabled';\n\nexport function isIdleActionState(actionState: DbxActionState): boolean {\n switch (actionState) {\n case DbxActionState.IDLE:\n case DbxActionState.DISABLED:\n case DbxActionState.REJECTED:\n case DbxActionState.RESOLVED:\n return true;\n default:\n return false;\n }\n}\n\nexport function loadingStateTypeForActionState(actionState: DbxActionState): LoadingStateType {\n let loadingStateType: LoadingStateType;\n\n switch (actionState) {\n case DbxActionState.RESOLVED:\n loadingStateType = LoadingStateType.SUCCESS;\n break;\n case DbxActionState.REJECTED:\n loadingStateType = LoadingStateType.ERROR;\n break;\n case DbxActionState.IDLE:\n case DbxActionState.DISABLED:\n loadingStateType = LoadingStateType.IDLE;\n break;\n default:\n loadingStateType = LoadingStateType.LOADING;\n break;\n }\n\n return loadingStateType;\n}\n","import { Injectable, type OnDestroy } from '@angular/core';\nimport { ComponentStore } from '@ngrx/component-store';\nimport { type Observable, distinctUntilChanged, filter, map, shareReplay, switchMap, startWith, of } from 'rxjs';\nimport { type BooleanStringKeyArray, BooleanStringKeyArrayUtility, type Maybe, type ReadableError } from '@dereekb/util';\nimport { type LoadingStateType, idleLoadingState, errorResult, filterMaybe, type LoadingState, scanCount, successResult, beginLoading } from '@dereekb/rxjs';\nimport { type DbxActionDisabledKey, type DbxActionRejectedPair, DbxActionState, type DbxActionSuccessPair, type DbxActionWorkOrWorkProgress, type DbxActionWorkProgress, DEFAULT_ACTION_DISABLED_KEY, isIdleActionState, loadingStateTypeForActionState } from './action';\nimport { cleanLockSet } from '../rxjs';\n\nexport function isActionContextEnabled(state: ActionContextState): boolean {\n return BooleanStringKeyArrayUtility.isFalse(state.disabled);\n}\n\nexport function isActionContextDisabled(state: ActionContextState): boolean {\n return BooleanStringKeyArrayUtility.isTrue(state.disabled);\n}\n\nexport function isDisabledActionContextState(state: ActionContextState): boolean {\n return isIdleActionState(state.actionState) && isActionContextDisabled(state);\n}\n\nexport function isWorkingActionState(actionState: DbxActionState): boolean {\n return !isIdleActionState(actionState);\n}\n\nexport function canTriggerActionState(actionState: DbxActionState): boolean {\n return actionState !== DbxActionState.DISABLED && isIdleActionState(actionState);\n}\n\nexport function canTriggerAction(state: ActionContextState): boolean {\n return isActionContextEnabled(state) && isIdleActionState(state.actionState);\n}\n\nexport function canReadyValue(state: ActionContextState): boolean {\n return state.actionState === DbxActionState.TRIGGERED;\n}\n\nexport function actionContextIsModifiedAndCanTrigger(state: ActionContextState): boolean {\n // console.log('check: ', state, state.isModified, canTriggerAction(state));\n return state.isModified && canTriggerAction(state);\n}\n\nexport function actionContextHasNoErrorAndIsModifiedAndCanTrigger(state: ActionContextState): boolean {\n return !state.error && actionContextIsModifiedAndCanTrigger(state);\n}\n\nexport function loadingStateForActionContextState<O = unknown>(state: ActionContextState<unknown, O>): LoadingState<O> {\n let loadingState: LoadingState<O>;\n\n switch (state.actionState) {\n case DbxActionState.RESOLVED:\n loadingState = successResult(state.result);\n break;\n case DbxActionState.REJECTED:\n loadingState = errorResult(state.error);\n break;\n case DbxActionState.IDLE:\n case DbxActionState.DISABLED:\n loadingState = idleLoadingState();\n break;\n default:\n loadingState = beginLoading(state.workProgress != null ? { loadingProgress: state.workProgress } : undefined);\n break;\n }\n\n return loadingState;\n}\n\nexport function loadingStateTypeForActionContextState(state: ActionContextState): LoadingStateType {\n return loadingStateTypeForActionState(state.actionState);\n}\n\nexport interface ActionContextState<T = unknown, O = unknown> {\n readonly actionState: DbxActionState;\n /**\n * Whether or not this action is flagged as having been modified.\n */\n readonly isModified: boolean;\n /**\n * The working progress of the action.\n *\n * Is reset to null when triggered/ready value is set.\n */\n readonly workProgress?: Maybe<DbxActionWorkProgress>;\n /**\n * Value that is set after a triggered action. Not to be confused with result.\n */\n readonly value?: Maybe<T>;\n /**\n * Resolved result value.\n */\n readonly result?: Maybe<O>;\n /**\n * Rejected error, if available.\n */\n readonly error?: Maybe<ReadableError>;\n /**\n * Current disabled state.\n */\n readonly disabled?: BooleanStringKeyArray;\n /**\n * Number of consecutive errors that have occured.\n */\n readonly errorCount?: number;\n}\n\nconst INITIAL_STATE: ActionContextState = {\n isModified: false,\n actionState: DbxActionState.IDLE\n};\n\nexport const ACTION_CONTEXT_STORE_LOCKSET_DESTROY_DELAY_TIME = 2000;\n\n@Injectable()\nexport class ActionContextStore<T = unknown, O = unknown> extends ComponentStore<ActionContextState<T, O>> implements OnDestroy {\n readonly lockSet = cleanLockSet({\n onLockSetDestroy: () => super.ngOnDestroy(),\n destroyLocksetTiming: {\n delayTime: ACTION_CONTEXT_STORE_LOCKSET_DESTROY_DELAY_TIME\n }\n });\n\n constructor() {\n super({ ...INITIAL_STATE } as ActionContextState<T, O>);\n this.lockSet.addLock('working', this.isWorking$);\n }\n\n // MARK: Accessors\n readonly actionState$ = this.state$.pipe(\n map((x) => (isDisabledActionContextState(x) ? DbxActionState.DISABLED : x.actionState)),\n shareReplay(1)\n );\n\n /**\n * Returns the current disabled reasons/keys.\n */\n readonly disabledKeys$ = this.state$.pipe(\n map((x) => [...(x.disabled ?? [])]),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n /**\n * Current value of the state.\n */\n readonly currentValue$: Observable<Maybe<T>> = this.state$.pipe(map((x) => x.value));\n\n /**\n * Maps the current state to true or not when the action state changes to/from disabled.\n */\n readonly isDisabled$ = this.state$.pipe(map(isDisabledActionContextState), distinctUntilChanged(), shareReplay(1));\n\n /**\n * Pipes when idle but modified.\n */\n readonly isModified$ = this.afterDistinctBoolean((x) => x.isModified);\n\n /**\n * Pipes true when idle.\n */\n readonly idle$ = this.actionState$.pipe(\n map((x) => x === DbxActionState.IDLE),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n /**\n * Pipes true when triggered.\n */\n readonly triggered$ = this.afterDistinctActionState(DbxActionState.TRIGGERED, () => true);\n\n /**\n * Pipes the readied value on ValueReady.\n */\n readonly valueReady$: Observable<T> = this.afterDistinctActionState(DbxActionState.VALUE_READY, (x) => x.value as T);\n\n /**\n * Pipes the working progress on the working state.\n */\n readonly workProgress$ = this.state$.pipe(\n map((x) => x.workProgress),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n /**\n * Pipes the error on the rejection state.\n */\n readonly rejected$ = this.afterDistinctActionState(DbxActionState.REJECTED, (x) => x.error);\n\n /**\n * Pipes the result when the ActionState becomes rejected.\n */\n readonly rejectedPair$ = this.afterDistinctActionState(DbxActionState.RESOLVED, (x) => ({ value: x.value, error: x.error }) as DbxActionRejectedPair<T>);\n\n /**\n * Pipes the result when the ActionState becomes working.\n */\n readonly working$ = this.afterDistinctActionState(DbxActionState.WORKING, () => true);\n\n /**\n * Whether or not it is currently in a working state.\n */\n readonly isWorking$ = this.afterDistinctBoolean((x) => isWorkingActionState(x.actionState));\n\n /**\n * Pipes the current work or work progress.\n */\n readonly isWorkingOrWorkProgress$ = this.isWorking$.pipe(\n switchMap((x) => {\n let obs: Observable<DbxActionWorkOrWorkProgress>;\n\n if (x) {\n obs = this.workProgress$.pipe(\n filter((x) => x != null),\n startWith(x)\n );\n } else {\n obs = of(x);\n }\n\n return obs;\n }),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n /**\n * Pipes the current error.\n */\n readonly error$ = this.state$.pipe(\n map((x) => x.error),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n /**\n * Pipes the result when the ActionState becomes success.\n */\n readonly success$ = this.afterDistinctActionState(DbxActionState.RESOLVED, (x) => x.result);\n\n /**\n * Pipes the result when the ActionState becomes success.\n */\n readonly successPair$ = this.afterDistinctActionState(DbxActionState.RESOLVED, (x) => ({ value: x.value, result: x.result }) as DbxActionSuccessPair<T, O>);\n\n /**\n * Whether or not it is currently in a success state.\n */\n readonly isSuccess$ = this.afterDistinctBoolean((x) => x.actionState === DbxActionState.RESOLVED);\n\n /**\n * Returns a loading state based on the current state.\n */\n readonly loadingState$ = this.afterDistinctLoadingStateTypeChange().pipe(\n switchMap((x) => {\n const base = loadingStateForActionContextState<O>(x);\n let obs: Observable<LoadingState<O>>;\n\n if (base.loading === true) {\n obs = this.workProgress$.pipe(\n filter((x) => x != null),\n map((loadingProgress) => ({ ...base, loadingProgress })),\n startWith(base)\n );\n } else {\n obs = of(base);\n }\n\n return obs;\n }),\n shareReplay(1)\n );\n\n /**\n * Returns the current LoadingStateType based on the current state.\n */\n readonly loadingStateType$ = this.state$.pipe(\n map((x) => loadingStateTypeForActionContextState(x)),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n /**\n * Number of errors since last success.\n */\n readonly errorCountSinceLastSuccess$ = this.isSuccess$.pipe(\n startWith(false),\n distinctUntilChanged(),\n switchMap(() => this.error$.pipe(filterMaybe(), scanCount(), startWith(0))),\n shareReplay(1)\n );\n\n /**\n * Whether or not the state can be triggered.\n */\n readonly canTrigger$ = this.state$.pipe(map(canTriggerAction), distinctUntilChanged(), shareReplay(1));\n\n /**\n * Pipe that maps whether or not this is modified and can be triggered.\n *\n * Updates every state update instead of when the value changes.\n */\n readonly isModifiedAndCanTriggerUpdates$ = this.state$.pipe(map((x) => actionContextIsModifiedAndCanTrigger(x), shareReplay(1)));\n\n /**\n * Whether or not it can be triggered and modified.\n */\n readonly isModifiedAndCanTrigger$ = this.isModifiedAndCanTriggerUpdates$.pipe(distinctUntilChanged());\n\n readonly hasNoErrorAndIsModifiedAndCanTrigger$ = this.state$.pipe(\n map((x) => actionContextHasNoErrorAndIsModifiedAndCanTrigger(x)),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n // MARK: State Changes\n /**\n * Adds a disabled reason.\n */\n readonly disable = this.updater((state, key?: void | DbxActionDisabledKey) => ({\n ...state,\n disabled: BooleanStringKeyArrayUtility.insert(state.disabled, (key as string) ?? DEFAULT_ACTION_DISABLED_KEY)\n }));\n\n /**\n * Removes a disabled reason.\n */\n readonly enable = this.updater((state, key?: void | DbxActionDisabledKey) => ({\n ...state,\n disabled: BooleanStringKeyArrayUtility.remove(state.disabled, (key as string) ?? DEFAULT_ACTION_DISABLED_KEY)\n }));\n\n /**\n * Triggers the modified state, if not disabled.\n *\n * Equivalent to calling setIsModified() with opposite input.\n */\n readonly setIsSame = this.updater<void, void | boolean>(updateIsSameOnActionContextState);\n\n /**\n * Triggers the modified state, if not disabled.\n */\n readonly setIsModified = this.updater<void, void | boolean>(updateIsModifiedOnActionContextState);\n\n /**\n * Triggers the action if the state is currently not idle. The current state is cleared, but the error is retained (as we may need the error from the previous attempt).\n *\n * Will not fire if the action is disabled.\n */\n readonly trigger = this.updater((state) => (canTriggerAction(state) ? { isModified: state.isModified, actionState: DbxActionState.TRIGGERED, error: state.error, value: undefined } : state));\n\n /**\n * Updates the value, setting value ready. The current result is cleared.\n */\n readonly readyValue = this.updater((state, value: T) => (canReadyValue(state) ? { ...state, actionState: DbxActionState.VALUE_READY, value, result: undefined } : state));\n\n /**\n * Notifys the context that the action is in progress.\n */\n readonly startWorking = this.updater((state) => ({ ...state, actionState: DbxActionState.WORKING, workProgress: null }));\n\n /**\n * Updates the working progress.\n */\n readonly setWorkProgress = this.updater((state, workProgress: Maybe<DbxActionWorkProgress>) => ({ ...state, workProgress }));\n\n /**\n * Triggers rejection of the action. The value is cleared.\n */\n readonly reject = this.updater((state, error?: Maybe<ReadableError>) => ({\n isModified: state.isModified,\n actionState: DbxActionState.REJECTED,\n error,\n errorCount: (state.errorCount ?? 0) + 1,\n disabled: state.disabled\n }));\n\n /**\n * Updates the state to success, and optionally sets a result.\n *\n * Clears modified state, and any errors.\n */\n readonly resolve = this.updater((state, result?: Maybe<O>) => ({ isModified: false, actionState: DbxActionState.RESOLVED, value: state.value, result, error: undefined, disabled: state.disabled }));\n\n /**\n * Completely resets the store.\n */\n readonly reset = this.updater(() => ({ ...INITIAL_STATE }) as ActionContextState<T, O>);\n\n // MARK: Utility\n afterDistinctBoolean(fromState: (state: ActionContextState<T, O>) => boolean): Observable<boolean> {\n return this.state$.pipe(\n map((x) => fromState(x)),\n distinctUntilChanged(),\n shareReplay(1)\n );\n }\n\n afterDistinctActionState<X>(actionState: DbxActionState, fromState: (state: ActionContextState<T, O>) => X): Observable<X> {\n return this.afterDistinctActionStateChange().pipe(\n filter((x) => x.actionState === actionState), // Only pipe when the new action state matches.\n map((x) => fromState(x)),\n shareReplay(1)\n );\n }\n\n afterDistinctActionStateChange(): Observable<ActionContextState<T, O>> {\n return this.state$.pipe(\n map((x) => [x, x.actionState] as [ActionContextState, DbxActionState]),\n distinctUntilChanged((a, b) => a?.[1] === b?.[1]), // Filter out when the state remains the same.\n map((x) => x[0] as ActionContextState<T, O>),\n shareReplay(1)\n );\n }\n\n afterDistinctLoadingStateTypeChange(): Observable<ActionContextState<T, O>> {\n return this.state$.pipe(\n map((x) => [x, loadingStateTypeForActionContextState(x)] as [ActionContextState, LoadingStateType]),\n distinctUntilChanged((a, b) => a?.[1] === b?.[1]), // Filter out when the loading state remains the same.\n map((x) => x[0] as ActionContextState<T, O>),\n shareReplay(1)\n );\n }\n\n // MARK: Cleanup\n override ngOnDestroy(): void {\n // do not call super.destroy here, to keep the component store from destroying itself.\n // the lockset is configured to cleanup the component store.\n }\n}\n\nfunction updateIsSameOnActionContextState<T, O>(state: ActionContextState<T, O>, isSame?: void | boolean): ActionContextState<T, O> {\n return updateIsModifiedOnActionContextState(state, isSame == null ? false : !isSame);\n}\n\nfunction updateIsModifiedOnActionContextState<T, O>(state: ActionContextState<T, O>, isModified?: void | boolean): ActionContextState<T, O> {\n return {\n ...state,\n actionState: state.actionState === DbxActionState.RESOLVED ? DbxActionState.IDLE : state.actionState, // Set to idle from success.\n isModified: (isModified as boolean) ?? true // if isModified is not input, default it to true\n };\n}\n","import { type Observable, of } from 'rxjs';\nimport { type Destroyable, type Maybe } from '@dereekb/util';\nimport { type LockSet } from '@dereekb/rxjs';\nimport { type ActionContextStoreSource, DbxActionContextStoreSourceInstance, type SecondaryActionContextStoreSource } from './action.store.source';\nimport { ActionContextStore } from './action.store';\nimport { type DbxActionDisabledKey } from './action';\n\n/**\n * Abstract class that can either use SecondaryActionContextStoreSource or create it's own.\n */\nexport abstract class DbxActionContextBaseSource<T = unknown, O = unknown> implements ActionContextStoreSource<T, O>, Destroyable {\n private readonly _inputSource: Maybe<SecondaryActionContextStoreSource<T, O>>;\n\n private readonly _store?: ActionContextStore<T, O>;\n private readonly _store$: Observable<ActionContextStore<T, O>>;\n private readonly _instance: DbxActionContextStoreSourceInstance<T, O>;\n\n readonly isModified$: Observable<boolean>;\n readonly triggered$: Observable<boolean>;\n readonly success$: Observable<Maybe<O>>;\n\n constructor(inputSource?: Maybe<SecondaryActionContextStoreSource<T, O>>) {\n this._inputSource = inputSource;\n\n if (inputSource) {\n this._store$ = inputSource.store$;\n } else {\n this._store = new ActionContextStore();\n this._store$ = of(this._store);\n }\n\n this._instance = new DbxActionContextStoreSourceInstance(this);\n this.isModified$ = this._instance.isModified$;\n this.triggered$ = this._instance.triggered$;\n this.success$ = this._instance.success$;\n }\n\n destroy(): void {\n if (this._store) {\n this._store.ngOnDestroy();\n this._instance.destroy();\n }\n }\n\n get inputSource() {\n return this._inputSource;\n }\n\n get lockSet(): LockSet {\n return this._instance.lockSet;\n }\n\n get sourceInstance(): DbxActionContextStoreSourceInstance<T, O> {\n return this._instance;\n }\n\n get store$(): Observable<ActionContextStore<T, O>> {\n return this._store$;\n }\n\n /**\n * Use to trigger the action directly.\n */\n public trigger(): void {\n this._instance.trigger();\n }\n\n public readyValue(value: T | Observable<T>): void {\n this._instance.readyValue(value);\n }\n\n /**\n * Triggers the context and then readies the value.\n * @param value\n */\n public triggerWithValue(value: T | Observable<T>): void {\n this._instance.triggerWithValue(value);\n }\n\n public reset(): void {\n this._instance.reset();\n }\n\n public enable(key?: DbxActionDisabledKey, enable?: boolean): void {\n this._instance.enable(key, enable);\n }\n\n public disable(key?: DbxActionDisabledKey, disable?: boolean): void {\n this._instance.disable(key, disable);\n }\n\n public setIsModified(isModified?: boolean): void {\n this._instance.setIsModified(isModified);\n }\n}\n","import { type DbxActionContextSourceReference } from './action.reference';\nimport { delay, first } from 'rxjs';\nimport { type ActionContextStoreSource } from './action.store.source';\nimport { DbxActionWorkInstanceDelegate } from './action.handler';\nimport { DbxActionContextBaseSource } from './action.holder';\nimport { type Destroyable, type Maybe } from '@dereekb/util';\nimport { SubscriptionObject, type Work, workFactory } from '@dereekb/rxjs';\nimport { Injectable } from '@angular/core';\nimport { clean } from '../rxjs/clean';\n\n/**\n * DbxActionContextMachine configuration.\n */\nexport interface DbxActionContextMachineConfig<T = unknown, O = unknown> {\n /**\n * Whether or not the machine should clean itself up after being triggered once.\n */\n oneTimeUse: boolean;\n /**\n * Function to handle any valueReady events.\n *\n * If false, will not subscribe/handle valueReady$ events.\n */\n handleValueReady: Work<T, O> | false;\n /**\n * Optional function to execute after the action has succeeded.\n */\n onSuccess?: (value: Maybe<O>) => void;\n}\n\n/**\n * Configurable machine that handles components of the ActionContextStore lifecycle.\n *\n * It can be configured to activate only once before cleaning itself up. It can be used directly as a DbxActionContextSourceReference in cases where it is created as a one-off action.\n */\nexport class DbxActionContextMachine<T = unknown, O = unknown> extends DbxActionContextBaseSource<T, O> implements DbxActionContextSourceReference<T, O>, Destroyable {\n private _isShutdown = true;\n\n private readonly _config: DbxActionContextMachineConfig<T, O>;\n private readonly _handleValueReadySub = new SubscriptionObject();\n private readonly _successSub = new SubscriptionObject();\n\n constructor(config: DbxActionContextMachineConfig<T, O>, source?: ActionContextStoreSource<T, O>) {\n super(source);\n this._config = config;\n\n // Handle Value Ready\n if (config.handleValueReady !== false) {\n this._handleValueReadySub.subscription = this.sourceInstance.valueReady$.subscribe((value) => {\n const doWork = workFactory({\n work: config.handleValueReady as Work<T, O>,\n delegate: new DbxActionWorkInstanceDelegate<T, O>(this.sourceInstance)\n });\n\n doWork(value);\n });\n }\n\n // If this is a one-time use, then destroy it after the first success comes through.\n if (config.oneTimeUse) {\n this.sourceInstance.success$.pipe(first(), delay(1000)).subscribe(() => {\n this.destroy();\n });\n }\n\n if (config.onSuccess) {\n this._successSub.subscription = this.sourceInstance.success$.subscribe(config.onSuccess);\n }\n }\n\n override destroy(): void {\n super.destroy();\n this._handleValueReadySub.destroy();\n this._successSub.destroy();\n this._isShutdown = true;\n }\n\n get config() {\n return this._config;\n }\n\n get isShutdown(): boolean {\n return this._isShutdown;\n }\n}\n\n/**\n * DbxActionContextMachine configured for use as a Service/Injectable.\n */\n@Injectable()\nexport class DbxActionContextMachineAsService<T = unknown, O = unknown> extends DbxActionContextMachine<T, O> {\n constructor() {\n super({\n oneTimeUse: false,\n handleValueReady: false\n });\n\n clean(() => this.destroy());\n }\n}\n","import { forwardRef, type Provider, type Type } from '@angular/core';\nimport { ActionContextStoreSource, DbxActionContextStoreSourceInstance, SecondaryActionContextStoreSource } from './action.store.source';\nimport { DbxActionContextMachineAsService } from './action.machine';\nimport { clean } from '../rxjs/clean';\n\n/**\n * Provides an ActionContextStoreSource, as well as an DbxActionContextStoreSourceInstance.\n */\nexport function provideActionStoreSource<S extends ActionContextStoreSource>(sourceType: Type<S> | null): Provider[] {\n const storeSourceProvider: Provider =\n sourceType != null\n ? {\n provide: ActionContextStoreSource,\n useExisting: forwardRef(() => sourceType)\n }\n : {\n provide: ActionContextStoreSource,\n useFactory: () => new DbxActionContextMachineAsService()\n };\n\n return [\n storeSourceProvider,\n {\n provide: DbxActionContextStoreSourceInstance,\n useFactory: (source: ActionContextStoreSource) => clean(new DbxActionContextStoreSourceInstance(source)),\n deps: [ActionContextStoreSource]\n }\n ];\n}\n\nexport function provideSecondaryActionStoreSource<S extends SecondaryActionContextStoreSource>(sourceType: Type<S>): Provider[] {\n return [\n {\n provide: SecondaryActionContextStoreSource,\n useExisting: forwardRef(() => sourceType)\n },\n ...provideActionStoreSource(sourceType)\n ];\n}\n","import { Directive, inject } from '@angular/core';\nimport { SecondaryActionContextStoreSource } from '../../action.store.source';\nimport { provideActionStoreSource } from '../../action.store.source.provide';\nimport { DbxActionContextBaseSource } from '../../action.holder';\nimport { clean } from '../../../rxjs/clean';\n\n/**\n * Provides an DbxAction/DbxActionContext.\n */\n@Directive({\n selector: 'dbx-action,[dbxAction]',\n exportAs: 'action,dbxAction',\n providers: provideActionStoreSource(DbxActionDirective),\n standalone: true\n})\nexport class DbxActionDirective<T = unknown, O = unknown> extends DbxActionContextBaseSource<T, O> {\n constructor() {\n super(inject(SecondaryActionContextStoreSource<T, O>, { optional: true, host: true }));\n\n // during cleaning/onDestroy, queue the lockset for cleanup\n clean(() => {\n this.lockSet.destroyOnNextUnlock(() => {\n this.destroy();\n });\n });\n }\n}\n","import { filterMaybe } from '@dereekb/rxjs';\nimport { Directive, input } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { switchMap } from 'rxjs';\nimport { type SecondaryActionContextStoreSource, type ActionContextStoreSource, actionContextStoreSourcePipe } from '../../action.store.source';\nimport { provideSecondaryActionStoreSource } from '../../action.store.source.provide';\nimport { toObservable } from '@angular/core/rxjs-interop';\n\n/**\n * Directive that provides a DbxActionSourceDirective that is passed in.\n */\n@Directive({\n selector: '[dbxActionSource]',\n providers: provideSecondaryActionStoreSource(DbxActionSourceDirective),\n standalone: true\n})\nexport class DbxActionSourceDirective implements SecondaryActionContextStoreSource {\n readonly dbxActionSource = input<Maybe<ActionContextStoreSource>>();\n\n readonly store$ = toObservable(this.dbxActionSource).pipe(\n filterMaybe(),\n switchMap((x) => actionContextStoreSourcePipe(x.store$))\n );\n}\n","import { Directive, inject } from '@angular/core';\nimport { cleanSubscriptionWithLockSet } from '../../../rxjs/lockset';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\n\n/**\n * Prints out the current state to the console. Useful for debugging.\n */\n@Directive({\n selector: '[dbxActionLogger],[dbxActionContextLogger]',\n standalone: true\n})\nexport class DbxActionContextLoggerDirective {\n readonly source = inject(DbxActionContextStoreSourceInstance, { host: true });\n\n constructor() {\n cleanSubscriptionWithLockSet({\n lockSet: this.source.lockSet,\n sub: this.source.state$.subscribe((state) => {\n console.log('dbxActionLogger - state: ', state);\n })\n });\n }\n}\n","import { BehaviorSubject, distinctUntilChanged, map, type Observable, of, shareReplay, switchMap } from 'rxjs';\nimport { type ActionContextStoreSource, actionContextStoreSourcePipe } from '../../action.store.source';\nimport { type Destroyable } from '@dereekb/util';\n\n/**\n * Arbitrary string used to identify an action.\n */\nexport type ActionKey = string;\n\n/**\n * Map that returns sources for ActionKey values.\n */\nexport abstract class ActionContextStoreSourceMap<T = unknown, O = unknown> implements Destroyable {\n /**\n * Returns the read-only map of action keys to sources.\n */\n abstract readonly actionKeySourceMap$: Observable<Map<ActionKey, ActionContextStoreSource<T, O>>>;\n /**\n * Returns a ActionContextStoreSource for the input action key.\n *\n * @param key Action key to retrieve the source for.\n */\n abstract sourceForKey(key: ActionKey): ActionContextStoreSource<T, O>;\n /**\n * Adds the store source for the input key.\n * @param key Action key to add the source for.\n * @param source Store source to add.\n */\n abstract addStoreSource(key: ActionKey, source: ActionContextStoreSource<T, O>): void;\n /**\n * Removes the store source for the input key.\n * @param key Action key to remove the source for.\n */\n abstract removeStoreSource(key: ActionKey): void;\n /**\n * Destroys the map.\n */\n abstract destroy(): void;\n}\n\n/**\n * Creates a new ActionContextStoreSourceMap.\n *\n * @returns A new ActionContextStoreSourceMap.\n */\nexport function actionContextStoreSourceMap<T = unknown, O = unknown>(): ActionContextStoreSourceMap<T, O> {\n const _actionKeySourceMap = new BehaviorSubject<Map<ActionKey, ActionContextStoreSource<T, O>>>(new Map());\n const actionKeySourceMap$ = _actionKeySourceMap.asObservable();\n\n function updateMap(fn: (map: Map<ActionKey, ActionContextStoreSource<T, O>>) => Map<ActionKey, ActionContextStoreSource<T, O>> | void): void {\n const currentMap = _actionKeySourceMap.value;\n const nextMap = fn(currentMap) ?? currentMap;\n _actionKeySourceMap.next(nextMap);\n }\n\n function sourceForKey(key: ActionKey): ActionContextStoreSource<T, O> {\n const _store$ = actionKeySourceMap$.pipe(\n map((x) => x.get(key)),\n distinctUntilChanged(),\n switchMap((x) => x?.store$ ?? of(undefined)),\n shareReplay(1)\n );\n\n const source: ActionContextStoreSource<T, O> = {\n store$: actionContextStoreSourcePipe(_store$)\n };\n\n return source;\n }\n\n function addStoreSource(key: ActionKey, source: ActionContextStoreSource<T, O>): void {\n updateMap((actionKeySourceMap) => {\n if (actionKeySourceMap.has(key)) {\n throw new Error(`Key already existed for \"${key}\" in map. Ensure the previous store is removed before setting another.`);\n } else if (!source) {\n throw new Error('addStoreSource requires a source.');\n }\n\n actionKeySourceMap.set(key, source);\n return actionKeySourceMap;\n });\n }\n\n function removeStoreSource(key: ActionKey): void {\n updateMap((actionKeySourceMap) => {\n if (!actionKeySourceMap.delete(key)) {\n console.warn('removeStore called and no value was found.');\n }\n\n return actionKeySourceMap;\n });\n }\n\n function destroy(): void {\n _actionKeySourceMap.complete();\n }\n\n const result: ActionContextStoreSourceMap<T, O> = {\n actionKeySourceMap$: actionKeySourceMap$,\n sourceForKey: sourceForKey,\n addStoreSource: addStoreSource,\n removeStoreSource: removeStoreSource,\n destroy\n };\n\n return result;\n}\n","import { Directive, inject } from '@angular/core';\nimport { actionContextStoreSourceMap, ActionContextStoreSourceMap } from './action.map';\nimport { clean } from '../../../rxjs/clean';\n\n/**\n * Context used for providing actions based on the action key.\n *\n * This is useful for passing action contexts around via the providers instead of explicit injection.\n */\n@Directive({\n selector: '[dbxActionContextMap]',\n providers: [\n {\n provide: ActionContextStoreSourceMap,\n useFactory: actionContextStoreSourceMap\n }\n ],\n exportAs: 'actionMap',\n standalone: true\n})\nexport class DbxActionContextMapDirective {\n readonly actionContextStoreSourceMap = clean(inject(ActionContextStoreSourceMap));\n}\n","import { filterMaybe } from '@dereekb/rxjs';\nimport { Directive, inject, input } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { switchMap } from 'rxjs';\nimport { ActionContextStoreSourceMap, type ActionKey } from './action.map';\nimport { type SecondaryActionContextStoreSource } from '../../action.store.source';\nimport { provideSecondaryActionStoreSource } from '../../action.store.source.provide';\nimport { toObservable } from '@angular/core/rxjs-interop';\n\n/**\n * Directive that provides a ActionContextStoreSource using the input key and DbxActionContextMapDirective.\n */\n@Directive({\n selector: '[dbxActionFromMap]',\n providers: provideSecondaryActionStoreSource(DbxActionFromMapDirective),\n standalone: true\n})\nexport class DbxActionFromMapDirective implements SecondaryActionContextStoreSource {\n private readonly _actionContextStoreSourceMap = inject(ActionContextStoreSourceMap);\n\n readonly key = input<Maybe<ActionKey>>(undefined, { alias: 'dbxActionFromMap' });\n readonly key$ = toObservable(this.key);\n\n readonly store$ = this.key$.pipe(\n filterMaybe(),\n switchMap((x) => this._actionContextStoreSourceMap.sourceForKey(x).store$)\n );\n}\n","import { Directive, type OnDestroy, effect, inject, input } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { ActionContextStoreSource } from '../../action.store.source';\nimport { ActionContextStoreSourceMap, type ActionKey } from './action.map';\n\n/**\n * Used to communicate with an dbxActionMap and set the ActionContextStore to the store based on the key.\n */\n@Directive({\n selector: '[dbxActionMapSource]',\n standalone: true\n})\nexport class DbxActionMapSourceDirective implements OnDestroy {\n private readonly _actionContextStoreSourceMap = inject(ActionContextStoreSourceMap);\n\n readonly source = inject(ActionContextStoreSource, { host: true });\n\n readonly key = input<Maybe<ActionKey>>(undefined, { alias: 'dbxActionMapSource' });\n private _currentKey: Maybe<ActionKey>;\n\n protected readonly _keyEffect = effect(() => {\n const nextKey = this.key();\n\n if (this._currentKey !== nextKey) {\n this._removeFromToStore();\n }\n\n this._currentKey = nextKey;\n this._addToStore();\n });\n\n ngOnDestroy(): void {\n this._removeFromToStore();\n }\n\n private _addToStore(): void {\n if (this._currentKey) {\n this._actionContextStoreSourceMap.addStoreSource(this._currentKey, this.source);\n }\n }\n\n private _removeFromToStore(): void {\n if (this._currentKey) {\n this._actionContextStoreSourceMap.removeStoreSource(this._currentKey);\n }\n }\n}\n","import { asObservable, combineLatestFromMapValuesObsFn, type IsCheckFunction, type ObservableOrValue } from '@dereekb/rxjs';\nimport { map, type Observable, switchMap } from 'rxjs';\nimport { type ActionContextStore } from '../../action.store';\nimport { type ActionContextStoreSourceMap, type ActionKey } from './action.map';\nimport { type ActionContextStoreSource } from '../../action.store.source';\nimport { reduceBooleansWithOrFn } from '@dereekb/util';\n\n/**\n * Utility interface that provides a set of functions to read from an ActionContextStoreSourceMap.\n */\nexport interface ActionContextStoreSourceMapReader<T = unknown, O = unknown> {\n /**\n * The input key source map.\n */\n readonly actionKeySourceMap$: Observable<Map<ActionKey, ActionContextStoreSource<T, O>>>;\n\n /**\n * Checks if any of the stores in the map match the input checkFunction.\n *\n * @param checkFunction Function to apply to each store.\n * @param emptyArrayValue Value to return if the map is empty.\n */\n checkAny(checkFunction: IsCheckFunction<ActionContextStore<T, O>>, emptyArrayValue?: boolean): Observable<boolean>;\n\n /**\n * Reduces a value from all stores in the map.\n *\n * @param mapFn Function to apply to each store.\n * @param reduceFn Function to apply to the results of the mapFn.\n */\n reduceFromAllSources<X, Y>(mapFn: (input: ActionContextStore<T, O>) => Observable<X>, reduceFn: (values: X[]) => Y): Observable<Y>;\n\n /**\n * Reads a value from each store in the map and returns an array of the results.\n *\n * @param mapFn Function to apply to each store.\n */\n fromAllSources<Y>(mapFn: (input: ActionContextStore<T, O>) => Observable<Y>): Observable<Y[]>;\n}\n\n/**\n * Creates a new ActionContextStoreSourceMapReader from the input.\n \n * @param actionKeySourceMap$ \n */\nexport function actionContextStoreSourceMapReader<T = unknown, O = unknown>(actionKeySourceMap$: ObservableOrValue<Map<ActionKey, ActionContextStoreSource<T, O>>>): ActionContextStoreSourceMapReader<T, O> {\n const sourceMap$ = asObservable(actionKeySourceMap$);\n\n function checkAnyAre(mapFn: (input: ActionContextStore<T, O>) => Observable<boolean>, emptyArrayValue?: boolean): Observable<boolean> {\n return reduceFromAllSources(mapFn, reduceBooleansWithOrFn(emptyArrayValue));\n }\n\n function reduceFromAllSources<X, Y>(mapFn: (input: ActionContextStore<T, O>) => Observable<X>, reduceFn: (values: X[]) => Y): Observable<Y> {\n return fromAllSources<X>(mapFn).pipe(map(reduceFn));\n }\n\n function fromAllSources<Y>(mapFn: (input: ActionContextStore<T, O>) => Observable<Y>): Observable<Y[]> {\n return sourceMap$.pipe(switchMap(combineLatestFromMapValuesObsFn((x) => x.store$.pipe(switchMap(mapFn)))));\n }\n\n return {\n actionKeySourceMap$: sourceMap$,\n fromAllSources,\n checkAny: checkAnyAre,\n reduceFromAllSources\n };\n}\n\n/**\n * Returns an Observable of the results of the mapFn for each source in the actionKeySourceMap$.\n *\n * @param actionKeySourceMap$ Observable of the action key source map.\n * @param mapFn Function to apply to each source.\n * @returns Observable of the results of the mapFn for each source.\n */\nexport function fromAllActionContextStoreSourceMapSources<O>(actionKeySourceMap$: ObservableOrValue<ActionContextStoreSourceMap>, mapFn: (input: ActionContextStore) => Observable<O>): Observable<O[]> {\n return asObservable(actionKeySourceMap$).pipe(\n switchMap((x) => x.actionKeySourceMap$),\n switchMap(combineLatestFromMapValuesObsFn((x) => x.store$.pipe(switchMap(mapFn))))\n );\n}\n","import { Directive, inject, input } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { clean, cleanSubscription } from '../../../rxjs';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { type DbxActionDisabledKey } from '../../action';\nimport { actionContextStoreSourceMapReader } from './action.map.utility';\nimport { ActionContextStoreSourceMap } from './action.map';\n\nexport const DEFAULT_ACTION_MAP_WORKING_DISABLED_KEY = 'action_map_working_disable';\n\n/**\n * Used to communicate with an dbxActionMap and set the ActionContextStore to be disabled if any other element in the map is working.\n */\n@Directive({\n selector: '[dbxActionMapWorkingDisable]',\n standalone: true\n})\nexport class DbxActionMapWorkingDisableDirective {\n private readonly _actionContextStoreSourceMap = inject(ActionContextStoreSourceMap);\n\n readonly source = inject(DbxActionContextStoreSourceInstance, { host: true });\n\n readonly disabledKey = input<Maybe<DbxActionDisabledKey>>(undefined, { alias: 'dbxActionMapWorkingDisable' });\n\n readonly areAnySourcesWorking$ = actionContextStoreSourceMapReader(this._actionContextStoreSourceMap.actionKeySourceMap$).checkAny((x) => x.isWorking$, false);\n\n constructor() {\n cleanSubscription(\n this.areAnySourcesWorking$.subscribe((x) => {\n this.source.disable(this.disabledKey() || DEFAULT_ACTION_MAP_WORKING_DISABLED_KEY, x);\n })\n );\n\n clean(() => {\n this.source.enable(this.disabledKey() || DEFAULT_ACTION_MAP_WORKING_DISABLED_KEY);\n });\n }\n}\n","import { Directive, inject, input } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { clean, cleanSubscription } from '../../../rxjs';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { toObservable } from '@angular/core/rxjs-interop';\n\nexport const APP_ACTION_DISABLED_DIRECTIVE_KEY = 'dbx_action_disabled';\n\n/**\n * Directive that allows disabling an action using the inputs.\n */\n@Directive({\n selector: '[dbxActionDisabled]',\n standalone: true\n})\nexport class DbxActionDisabledDirective<T, O> {\n readonly source = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n\n readonly disabled = input<boolean, Maybe<boolean | ''>>(false, { alias: 'dbxActionDisabled', transform: (value) => value !== false });\n readonly disabled$ = toObservable(this.disabled);\n\n constructor() {\n cleanSubscription(\n this.disabled$.subscribe((x) => {\n this.source.disable(APP_ACTION_DISABLED_DIRECTIVE_KEY, x);\n })\n );\n\n clean(() => this.source.enable(APP_ACTION_DISABLED_DIRECTIVE_KEY));\n }\n}\n","import { Directive, inject, input } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { combineLatest } from 'rxjs';\nimport { clean, cleanSubscription } from '../../../rxjs';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { toObservable } from '@angular/core/rxjs-interop';\n\nexport const APP_ACTION_DISABLED_ON_SUCCESS_DIRECTIVE_KEY = 'dbx_action_disabled_on_success';\n\n/**\n * Directive that will disable the action after the action completes successfully.\n */\n@Directive({\n selector: '[dbxActionDisabledOnSuccess]',\n standalone: true\n})\nexport class DbxActionDisabledOnSuccessDirective<T, O> {\n readonly source = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n\n readonly disabledOnSuccess = input<boolean, Maybe<boolean | ''>>(true, { alias: 'dbxActionDisabledOnSuccess', transform: (value) => value !== false });\n readonly disabledOnSuccess$ = toObservable(this.disabledOnSuccess);\n\n constructor() {\n cleanSubscription(\n combineLatest([this.disabledOnSuccess$, this.source.isSuccess$]).subscribe(([disableOnSuccess, success]) => {\n this.source.disable(APP_ACTION_DISABLED_ON_SUCCESS_DIRECTIVE_KEY, disableOnSuccess && success);\n })\n );\n\n clean(() => this.source.enable(APP_ACTION_DISABLED_ON_SUCCESS_DIRECTIVE_KEY));\n }\n}\n","import { map, shareReplay, switchMap, tap, BehaviorSubject, combineLatest } from 'rxjs';\nimport { type DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { DbxActionWorkInstanceDelegate } from '../../action.handler';\nimport { type Maybe, type Destroyable, type Initialized, type GetterOrValue, asGetter, type FactoryWithInput } from '@dereekb/util';\nimport { filterMaybe, SubscriptionObject, type Work, workFactory } from '@dereekb/rxjs';\n\nexport const DBX_ACTION_HANDLER_LOCK_KEY = 'dbxActionHandler';\n\n/**\n * Context used for defining a function that performs an action using the input function to handle valueReady$ events from an action context.\n */\nexport class DbxActionHandlerInstance<T = unknown, O = unknown> implements Initialized, Destroyable {\n private readonly _delegate: DbxActionWorkInstanceDelegate<T, O>;\n\n private readonly _sub = new SubscriptionObject();\n private readonly _handlerFunction = new BehaviorSubject<Maybe<Work<T, O>>>(undefined);\n private readonly _handlerValue = new BehaviorSubject<Maybe<GetterOrValue<O> | FactoryWithInput<O, T>>>(undefined);\n\n readonly handlerFunction$ = combineLatest([this._handlerValue, this._handlerFunction]).pipe(\n map(([handlerValue, handlerFunction]) => {\n let work: Maybe<Work<T, O>>;\n\n if (handlerFunction != null) {\n work = handlerFunction;\n } else if (handlerValue !== undefined) {\n const getter = asGetter(handlerValue) as FactoryWithInput<O, T>;\n work = (x, c) => c.performTaskWithReturnValue(() => getter(x));\n }\n\n return work;\n }),\n filterMaybe(),\n shareReplay(1)\n );\n\n constructor(source: DbxActionContextStoreSourceInstance<T, O>) {\n this._delegate = new DbxActionWorkInstanceDelegate<T, O>(source);\n }\n\n get source(): DbxActionContextStoreSourceInstance<T, O> {\n return this._delegate.source;\n }\n\n get handlerFunction(): Maybe<Work<T, O>> {\n return this._handlerFunction.value;\n }\n\n get handlerValue(): Maybe<GetterOrValue<O> | FactoryWithInput<O, T>> {\n return this._handlerValue.value;\n }\n\n setHandlerFunction(handlerFunction: Maybe<Work<T, O>>): void {\n this._handlerFunction.next(handlerFunction);\n }\n\n setHandlerValue(handlerValue: Maybe<GetterOrValue<O> | FactoryWithInput<O, T>>): void {\n this._handlerValue.next(handlerValue);\n }\n\n init(): void {\n this._sub.subscription = this.handlerFunction$\n .pipe(\n switchMap((work) =>\n this.source.valueReady$.pipe(\n tap((value) => {\n const context = workFactory({ work, delegate: this._delegate })(value);\n\n if (context) {\n // Add the action to the lockSet for the source to prevent it from being destroyed until the action completes.\n this.source.lockSet.addLock(DBX_ACTION_HANDLER_LOCK_KEY, context.isComplete$.pipe(map((x) => !x)));\n }\n })\n )\n )\n )\n .subscribe();\n }\n\n destroy(): void {\n this.source.lockSet.onNextUnlock(() => {\n this._sub.destroy();\n this._handlerFunction.complete();\n });\n }\n}\n","import { Directive, effect, inject, input } from '@angular/core';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { type FactoryWithInput, type GetterOrValue, type Maybe } from '@dereekb/util';\nimport { DbxActionHandlerInstance } from './action.handler.instance';\nimport { type Work } from '@dereekb/rxjs';\nimport { clean } from '../../../rxjs';\n\n/**\n * Abstract directive that wraps and handles a DbxActionHandlerInstance lifecycle.\n */\n@Directive()\nexport abstract class AbstractDbxActionHandlerDirective<T = unknown, O = unknown> {\n readonly source: DbxActionContextStoreSourceInstance<T, O> = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n\n protected readonly _dbxActionHandlerInstance = clean(new DbxActionHandlerInstance<T, O>(this.source));\n\n constructor() {\n this._dbxActionHandlerInstance.init();\n }\n}\n\n/**\n * Directive that passes a Work function to handle a valueReady$ event from an action context.\n */\n@Directive({\n selector: '[dbxActionHandler]',\n standalone: true\n})\nexport class DbxActionHandlerDirective<T = unknown, O = unknown> extends AbstractDbxActionHandlerDirective<T, O> {\n readonly handlerFunction = input.required<Maybe<Work<T, O>>>({ alias: 'dbxActionHandler' });\n\n protected readonly _handlerFunctionEffect = effect(() => {\n this._dbxActionHandlerInstance.setHandlerFunction(this.handlerFunction());\n });\n}\n\n/**\n * Directive that passes a value to handle a valueReady$ event from an action context.\n */\n@Directive({\n selector: '[dbxActionHandlerValue]',\n standalone: true\n})\nexport class DbxActionHandlerValueDirective<T = unknown, O = unknown> extends AbstractDbxActionHandlerDirective<T, O> {\n readonly handlerValue = input.required<Maybe<GetterOrValue<O> | FactoryWithInput<O, T>>>({ alias: 'dbxActionHandlerValue' });\n protected readonly _handlerValueEffect = effect(() => {\n this._dbxActionHandlerInstance.setHandlerValue(this.handlerValue());\n });\n}\n","import { Directive, type OnInit, TemplateRef, ViewContainerRef, inject } from '@angular/core';\nimport { distinctUntilChanged, type Observable } from 'rxjs';\nimport { cleanSubscription } from '../rxjs/subscription';\n\n/**\n * Abstract directive class that watches a show$ observable and behaves like *ngIf.\n */\n@Directive()\nexport abstract class AbstractIfDirective implements OnInit {\n private readonly _templateRef = inject(TemplateRef);\n private readonly _viewContainer = inject(ViewContainerRef);\n\n /**\n * Observable that is watched for showing/hiding.\n */\n abstract readonly show$: Observable<boolean>;\n\n private readonly _sub = cleanSubscription();\n\n ngOnInit() {\n this._sub.subscription = this.show$.pipe(distinctUntilChanged()).subscribe((show) => {\n if (show) {\n this._viewContainer.createEmbeddedView(this._templateRef);\n } else {\n this._viewContainer.clear();\n }\n });\n }\n}\n","/**\n * Transforms an empty string to undefined.\n *\n * Used for Angular inputs that are optional and share the same alias as the directive.\n */\nexport const transformEmptyStringInputToUndefined = <T>(value: T | '') => (value === '' ? undefined : value);\n","import { Directive, inject, input } from '@angular/core';\nimport { emitDelayObs } from '@dereekb/rxjs';\nimport { type Maybe } from '@dereekb/util';\nimport { of, exhaustMap, shareReplay } from 'rxjs';\nimport { AbstractIfDirective } from '../../../view/if.directive';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { transformEmptyStringInputToUndefined } from '../../../util/input';\n\n/**\n * Structural directive that displays the content before the store has success.\n *\n * Can be configured to hide for a temporary period.\n */\n@Directive({\n selector: '[dbxActionIdle]',\n standalone: true\n})\nexport class DbxActionIdleDirective extends AbstractIfDirective {\n private readonly _store = inject(DbxActionContextStoreSourceInstance);\n\n readonly hideAfter = input<Maybe<number>, Maybe<number> | ''>(undefined, { alias: 'dbxActionIdle', transform: transformEmptyStringInputToUndefined });\n\n readonly show$ = this._store.idle$.pipe(\n exhaustMap((idle) => {\n if (idle) {\n return emitDelayObs(true, false, this.hideAfter());\n } else {\n return of(false);\n }\n }),\n shareReplay(1)\n );\n}\n","import { Directive, inject, input } from '@angular/core';\nimport { emitDelayObs } from '@dereekb/rxjs';\nimport { type Maybe } from '@dereekb/util';\nimport { of, exhaustMap, shareReplay } from 'rxjs';\nimport { AbstractIfDirective } from '../../../view/if.directive';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { transformEmptyStringInputToUndefined } from '../../../util/input';\n\n/**\n * Structural directive that displays the content before the store has success.\n *\n * Can be configured to hide for a temporary period.\n */\n@Directive({\n selector: '[dbxActionPreSuccess]',\n standalone: true\n})\nexport class DbxActionPreSuccessDirective extends AbstractIfDirective {\n private readonly _store = inject(DbxActionContextStoreSourceInstance);\n\n readonly hideFor = input<Maybe<number>, Maybe<number> | ''>(undefined, { alias: 'dbxActionPreSuccess', transform: transformEmptyStringInputToUndefined });\n\n readonly show$ = this._store.isSuccess$.pipe(\n exhaustMap((success) => {\n if (success) {\n return emitDelayObs(false, true, this.hideFor());\n } else {\n return of(true);\n }\n }),\n shareReplay(1)\n );\n}\n","import { Directive, inject, input } from '@angular/core';\nimport { emitDelayObs } from '@dereekb/rxjs';\nimport { type Maybe } from '@dereekb/util';\nimport { of, exhaustMap, shareReplay } from 'rxjs';\nimport { AbstractIfDirective } from '../../../view/if.directive';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { transformEmptyStringInputToUndefined } from '../../../util/input';\n\n/**\n * Structural directive that displays the content when the store has a success value.\n *\n * Can be configured to show for a temporary period.\n */\n@Directive({\n selector: '[dbxActionHasSuccess]',\n standalone: true\n})\nexport class DbxActionHasSuccessDirective extends AbstractIfDirective {\n private readonly _store = inject(DbxActionContextStoreSourceInstance);\n\n readonly hideAfter = input<Maybe<number>, Maybe<number> | ''>(undefined, { alias: 'dbxActionHasSuccess', transform: transformEmptyStringInputToUndefined });\n\n readonly show$ = this._store.isSuccess$.pipe(\n exhaustMap((success) => {\n if (success) {\n return emitDelayObs(true, false, this.hideAfter());\n } else {\n return of(false);\n }\n }),\n shareReplay(1)\n );\n}\n","import { map, tap, shareReplay, switchMap } from 'rxjs';\nimport { filterMaybe } from '@dereekb/rxjs';\nimport { Directive, inject, input } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { cleanSubscriptionWithLockSet } from '../../../rxjs';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { toObservable } from '@angular/core/rxjs-interop';\n\n/**\n * Performs the action on success.\n */\nexport type DbxActionSuccessHandlerFunction<O = unknown> = (value: O) => void;\n\n/**\n * Directive that executes a function on ActionContextStore Success.\n */\n@Directive({\n selector: '[dbxActionSuccessHandler]',\n standalone: true\n})\nexport class DbxActionSuccessHandlerDirective<T, O> {\n readonly source = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n\n readonly dbxActionSuccessHandler = input<Maybe<DbxActionSuccessHandlerFunction<O>>>();\n readonly successFunction$ = toObservable(this.dbxActionSuccessHandler).pipe(filterMaybe(), shareReplay(1));\n\n constructor() {\n cleanSubscriptionWithLockSet({\n lockSet: this.source.lockSet,\n sub: this.successFunction$\n .pipe(\n switchMap((successFunction) =>\n this.source.success$.pipe(\n map((x) => [successFunction, x] as [DbxActionSuccessHandlerFunction<O>, O]),\n tap(([successFn, result]) => {\n successFn(result);\n })\n )\n )\n )\n .subscribe()\n });\n }\n}\n","import { map, tap, shareReplay, switchMap } from 'rxjs';\nimport { filterMaybe } from '@dereekb/rxjs';\nimport { Directive, inject, input } from '@angular/core';\nimport { type ReadableError, type Maybe } from '@dereekb/util';\nimport { cleanSubscriptionWithLockSet } from '../../../rxjs';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { toObservable } from '@angular/core/rxjs-interop';\n\n/**\n * Performs the action on error.\n */\nexport type DbxActionErrorHandlerFunction = (error?: Maybe<ReadableError>) => void;\n\n/**\n * Directive that executes a function on ActionContextStore error.\n */\n@Directive({\n selector: '[dbxActionErrorHandler]',\n standalone: true\n})\nexport class DbxActionErrorHandlerDirective<T, O> {\n readonly source = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n\n readonly dbxActionErrorHandler = input<Maybe<DbxActionErrorHandlerFunction>>();\n readonly errorFunction$ = toObservable(this.dbxActionErrorHandler).pipe(filterMaybe(), shareReplay(1));\n\n constructor() {\n cleanSubscriptionWithLockSet({\n lockSet: this.source.lockSet,\n sub: this.errorFunction$\n .pipe(\n switchMap((errorFunction) =>\n this.source.error$.pipe(\n filterMaybe(),\n map((x) => [errorFunction, x] as const),\n tap(([errorFn, error]) => {\n errorFn(error);\n })\n )\n )\n )\n .subscribe()\n });\n }\n}\n","import { Directive, inject, input } from '@angular/core';\nimport { getValueFromGetter, type Maybe, type GetterOrValue } from '@dereekb/util';\nimport { filterMaybe } from '@dereekb/rxjs';\nimport { BehaviorSubject, combineLatest, map, type Observable, shareReplay, switchMap } from 'rxjs';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { toObservable } from '@angular/core/rxjs-interop';\nimport { cleanSubscriptionWithLockSet } from '../../../rxjs';\n\n/**\n * Directive that provides a default value when triggered.\n *\n * No value is required, allowing the directive to automatically call readyValue.\n *\n * The valueOrFunction will filter on null/undefined input and wait until the input value is non-null.\n *\n * Use a getter if null/undefined values should be passed to the action.\n */\n@Directive({\n selector: 'dbxActionValue,[dbxActionValue]',\n standalone: true\n})\nexport class DbxActionValueDirective<T, O> {\n readonly valueOrFunction = input<Maybe<GetterOrValue<T> | ''>>('', { alias: 'dbxActionValue' });\n\n readonly source = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n\n private readonly _valueOrFunctionOverride = new BehaviorSubject<Maybe<GetterOrValue<T>>>(undefined);\n\n readonly valueOrFunction$: Observable<GetterOrValue<T>> = combineLatest([this._valueOrFunctionOverride, toObservable(this.valueOrFunction)]).pipe(\n map(([x, y]) => x ?? (y as Maybe<GetterOrValue<T>>)),\n filterMaybe(),\n shareReplay(1)\n );\n\n constructor() {\n cleanSubscriptionWithLockSet({\n lockSet: this.source.lockSet,\n sub: this.valueOrFunction$.pipe(switchMap((valueOrFunction) => this.source.triggered$.pipe(map(() => valueOrFunction)))).subscribe((valueOrFunction) => {\n const value: T = getValueFromGetter(valueOrFunction);\n this.source.readyValue(value);\n })\n });\n }\n\n setValueOrFunction(value: Maybe<GetterOrValue<T>>) {\n this._valueOrFunctionOverride.next(value);\n }\n}\n","import { computed, Directive, inject, input } from '@angular/core';\nimport { emitDelayObs } from '@dereekb/rxjs';\nimport { type Maybe } from '@dereekb/util';\nimport { of, exhaustMap, shareReplay } from 'rxjs';\nimport { AbstractIfDirective } from '../../../view/if.directive';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { transformEmptyStringInputToUndefined } from '../../../util/input';\n\n/**\n * Structural directive that displays the content when the store is working.\n *\n * Can specify a period in milliseconds that shows how long to show up after working for a particular number of seconds.\n */\n@Directive({\n selector: '[dbxActionWorking],[dbxActionIsWorking]',\n standalone: true\n})\nexport class DbxActionIsWorkingDirective extends AbstractIfDirective {\n private readonly _store = inject(DbxActionContextStoreSourceInstance);\n\n readonly hideAfter = input<Maybe<number>, Maybe<number> | ''>(undefined, { alias: 'dbxActionWorking', transform: transformEmptyStringInputToUndefined });\n readonly hideAfterIsWorking = input<Maybe<number>, Maybe<number> | ''>(undefined, { alias: 'dbxActionIsWorking', transform: transformEmptyStringInputToUndefined });\n\n readonly hideAfterSignal = computed(() => {\n const hideAfter = this.hideAfter();\n const hideAfterIsWorking = this.hideAfterIsWorking();\n return hideAfter ?? hideAfterIsWorking;\n });\n\n readonly show$ = this._store.isWorking$.pipe(\n exhaustMap((isWorking) => {\n const hideAfter = this.hideAfterSignal();\n\n if (isWorking && hideAfter != null) {\n return emitDelayObs(true, false, hideAfter);\n } else {\n return of(isWorking);\n }\n }),\n shareReplay(1)\n );\n}\n","import { Directive, inject, input } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { combineLatest, delay } from 'rxjs';\nimport { clean, cleanSubscription } from '../../../rxjs';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { toObservable } from '@angular/core/rxjs-interop';\n\nexport const APP_ACTION_ENFORCE_MODIFIED_DIRECTIVE_KEY = 'dbx_action_enforce_modified';\n\n/**\n * Directive that toggles disabling an action if the action is not marked modified.\n */\n@Directive({\n selector: '[dbxActionEnforceModified]',\n standalone: true\n})\nexport class DbxActionEnforceModifiedDirective {\n readonly source = inject(DbxActionContextStoreSourceInstance, { host: true });\n\n readonly enabled = input<boolean, Maybe<boolean | ''>>(true, { alias: 'dbxActionEnforceModified', transform: (value) => value !== false });\n readonly enabled$ = toObservable(this.enabled);\n\n constructor() {\n cleanSubscription(\n combineLatest([this.source.isModified$, this.enabled$])\n .pipe(delay(0))\n .subscribe(([modified, enableDirective]) => {\n const disable = enableDirective && !modified;\n this.source.disable(APP_ACTION_ENFORCE_MODIFIED_DIRECTIVE_KEY, disable);\n })\n );\n\n clean(() => this.source.enable(APP_ACTION_ENFORCE_MODIFIED_DIRECTIVE_KEY));\n }\n}\n","import { toReadableError, type Destroyable, type Initialized, type Maybe, type ReadableError } from '@dereekb/util';\nimport { switchMap, map, catchError, of, BehaviorSubject, type Observable, shareReplay, combineLatestWith } from 'rxjs';\nimport { type ObservableOrValue, SubscriptionObject, type IsModifiedFunction, asObservable, returnIfIs, filterMaybe, type IsEqualFunction, makeIsModifiedFunctionObservable } from '@dereekb/rxjs';\nimport { type DbxActionContextStoreSourceInstance } from '../../action.store.source';\n\n/**\n * DbxActionValueGetterInstance function. Returns an ObervableGetter that returns a value.\n */\nexport type DbxActionValueGetterValueGetterFunction<T> = () => ObservableOrValue<Maybe<T>>;\n\nexport interface DbxActionValueGetterResult<T = unknown> {\n /**\n * The value to trigger with\n */\n readonly value?: Maybe<T>;\n /**\n * The error to reject with\n */\n readonly reject?: Maybe<ReadableError>;\n}\n\n/**\n * DbxActionValueGetterInstance configuration.\n */\nexport interface DbxActionValueGetterInstanceConfig<T> {\n readonly source: DbxActionContextStoreSourceInstance<T, unknown>;\n readonly valueGetter?: Maybe<DbxActionValueGetterValueGetterFunction<T>>;\n readonly isEqualFunction?: Maybe<IsEqualFunction<T>>;\n readonly isModifiedFunction?: Maybe<IsModifiedFunction<T>>;\n}\n\n/**\n * Utility class that handles trigger events to retrieve a value.\n */\nexport class DbxActionValueGetterInstance<T> implements Initialized, Destroyable {\n private readonly _valueGetterFunction = new BehaviorSubject<Maybe<DbxActionValueGetterValueGetterFunction<T>>>(undefined);\n readonly valueGetterFunction$ = this._valueGetterFunction.pipe(filterMaybe());\n\n private readonly _isModifiedFunction = new BehaviorSubject<Maybe<IsModifiedFunction<T>>>(undefined);\n private readonly _isEqualFunction = new BehaviorSubject<Maybe<IsEqualFunction<T>>>(undefined);\n\n readonly isModifiedFunction$: Observable<IsModifiedFunction<T>> = makeIsModifiedFunctionObservable({\n isModified: this._isModifiedFunction,\n isEqual: this._isEqualFunction\n }).pipe(shareReplay(1));\n\n readonly source: DbxActionContextStoreSourceInstance<T, unknown>;\n\n private readonly _triggeredSub = new SubscriptionObject();\n\n constructor(config: DbxActionValueGetterInstanceConfig<T>) {\n this.source = config.source;\n this.setValueGetterFunction(config.valueGetter);\n this.setIsModifiedFunction(config.isModifiedFunction);\n this.setIsEqualFunction(config.isEqualFunction);\n }\n\n setValueGetterFunction(valueGetterFunction: Maybe<DbxActionValueGetterValueGetterFunction<T>>) {\n this._valueGetterFunction.next(valueGetterFunction);\n }\n\n setIsModifiedFunction(isModifiedFunction: Maybe<IsModifiedFunction<T>>) {\n this._isModifiedFunction.next(isModifiedFunction);\n }\n\n setIsEqualFunction(isEqualFunction: Maybe<IsEqualFunction<T>>) {\n this._isEqualFunction.next(isEqualFunction);\n }\n\n init(): void {\n // Ready the value after the source is triggered. Do modified check one last time.\n this._triggeredSub.subscription = this.source.triggered$\n .pipe(\n switchMap(() =>\n this.valueGetterFunction$.pipe(\n switchMap((valueGetter) => asObservable(valueGetter())),\n combineLatestWith(this.isModifiedFunction$),\n // If the value is not null/undefined and is considered modified, then pass the value.\n switchMap(([value, isModifiedFunction]) => returnIfIs(isModifiedFunction, value, false).pipe(map((value) => ({ value })))),\n // Catch unknown errors and pass them to reject.\n catchError((reject) => of({ reject: toReadableError(reject) }))\n )\n )\n )\n .subscribe((result: DbxActionValueGetterResult<T>) => {\n if (result.value != null) {\n this.source.readyValue(result.value);\n } else {\n this.source.reject(result.reject);\n }\n });\n }\n\n destroy(): void {\n this.source.lockSet.onNextUnlock(() => {\n this._valueGetterFunction.complete();\n this._isModifiedFunction.complete();\n this._isEqualFunction.complete();\n this._triggeredSub.destroy();\n });\n }\n}\n","import { Directive, Injector, type Signal, effect, inject, input, runInInjectionContext } from '@angular/core';\nimport { type IsEqualFunction, type IsModifiedFunction } from '@dereekb/rxjs';\nimport { type Maybe } from '@dereekb/util';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { type DbxActionValueGetterValueGetterFunction, DbxActionValueGetterInstance } from './action.value.trigger.instance';\nimport { clean } from '../../../rxjs/clean';\n\nexport interface DbxActionValueGetterDirectiveComputeInputsConfig<T> {\n readonly valueGetterSignal?: Signal<Maybe<DbxActionValueGetterValueGetterFunction<T>>>;\n readonly isModifiedSignal?: Signal<Maybe<IsModifiedFunction>>;\n readonly isEqualSignal?: Signal<Maybe<IsEqualFunction>>;\n}\n\n/**\n * Abstract class for directives that may perform an action when trigger is called, and returns a value.\n */\n@Directive()\nexport abstract class AbstractDbxActionValueGetterDirective<T> {\n private readonly _injector = inject(Injector);\n\n readonly source = inject(DbxActionContextStoreSourceInstance<T, unknown>);\n\n private readonly _triggerInstance: DbxActionValueGetterInstance<T> = new DbxActionValueGetterInstance<T>({\n source: this.source\n });\n\n constructor() {\n this._triggerInstance.init();\n clean(this._triggerInstance);\n }\n\n setValueGetterFunction(valueGetterFunction: Maybe<DbxActionValueGetterValueGetterFunction<T>>) {\n this._triggerInstance.setValueGetterFunction(valueGetterFunction);\n }\n\n protected configureInputs(config: DbxActionValueGetterDirectiveComputeInputsConfig<T>): void {\n runInInjectionContext(this._injector, () => {\n effect(() => {\n if (config?.isModifiedSignal != null) {\n const isModified = config?.isModifiedSignal();\n this._triggerInstance.setIsModifiedFunction(isModified);\n }\n\n if (config?.isEqualSignal != null) {\n const isEqual = config?.isEqualSignal();\n this._triggerInstance.setIsEqualFunction(isEqual);\n }\n\n if (config?.valueGetterSignal != null) {\n const valueGetter = config?.valueGetterSignal();\n this._triggerInstance.setValueGetterFunction(valueGetter);\n }\n });\n });\n }\n}\n\n/**\n * Action directive that uses a getter function instead and waits for the trigger to be called before calling the function.\n *\n * Similar to DbxActionValueDirective, but the getter is called when a trigger is activated.\n * The DbxActionValueDirective always pipes the latests value while waiting for a trigger, and does not allow using a getter.\n */\n@Directive({\n exportAs: 'dbxActionValueGetter',\n selector: '[dbxActionValueGetter]',\n standalone: true\n})\nexport class DbxActionValueTriggerDirective<T = object> extends AbstractDbxActionValueGetterDirective<T> {\n readonly dbxActionValueGetter = input<Maybe<DbxActionValueGetterValueGetterFunction<T>>>();\n readonly dbxActionValueGetterIsModified = input<Maybe<IsModifiedFunction>>();\n readonly dbxActionValueGetterIsEqual = input<Maybe<IsEqualFunction>>();\n\n constructor() {\n super();\n this.configureInputs({\n valueGetterSignal: this.dbxActionValueGetter,\n isModifiedSignal: this.dbxActionValueGetterIsModified,\n isEqualSignal: this.dbxActionValueGetterIsEqual\n });\n }\n}\n","import { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { switchMap, mergeMap, map, withLatestFrom, shareReplay, type Observable, of, EMPTY } from 'rxjs';\nimport { Directive, inject, input } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { type IsEqualFunction, type IsModifiedFunction, makeIsModifiedFunctionObservable } from '@dereekb/rxjs';\nimport { toObservable } from '@angular/core/rxjs-interop';\nimport { cleanSubscriptionWithLockSet } from '../../../rxjs';\n\n/**\n * Directive that watches a value observable for changes and sets the new value and modified states as necessary.\n */\n@Directive({\n selector: '[dbxActionValueStream]',\n standalone: true\n})\nexport class DbxActionValueStreamDirective<T, O> {\n readonly source = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n\n readonly dbxActionValueStream = input<Observable<T>>(EMPTY);\n readonly dbxActionValueStreamIsEqualValue = input<Maybe<IsEqualFunction<T>>>();\n readonly dbxActionValueStreamIsModifiedValue = input<Maybe<IsModifiedFunction<T>>>();\n\n readonly isModifiedFunction$: Observable<IsModifiedFunction<T>> = makeIsModifiedFunctionObservable({\n isModified: toObservable(this.dbxActionValueStreamIsModifiedValue),\n isEqual: toObservable(this.dbxActionValueStreamIsEqualValue)\n }).pipe(shareReplay(1));\n\n readonly modifiedValue$ = toObservable(this.dbxActionValueStream).pipe(\n switchMap((obs) =>\n obs.pipe(\n withLatestFrom(this.isModifiedFunction$),\n mergeMap(([value, dbxActionValueStreamModified]) => {\n let result: Observable<[boolean, T]>;\n\n if (dbxActionValueStreamModified) {\n result = dbxActionValueStreamModified(value).pipe(map((isModified) => [isModified, value] as [boolean, T]));\n } else {\n result = of([true, value]);\n }\n\n return result;\n }),\n shareReplay(1)\n )\n )\n );\n\n constructor() {\n // Update isModified on source\n cleanSubscriptionWithLockSet({\n lockSet: this.source.lockSet,\n sub: this.modifiedValue$.subscribe(([isModified]) => {\n this.source.setIsModified(isModified);\n })\n });\n\n // Set the value on triggers.\n cleanSubscriptionWithLockSet({\n lockSet: this.source.lockSet,\n sub: this.source.triggered$.pipe(switchMap(() => this.modifiedValue$)).subscribe(([isModified, value]) => {\n // only mark ready once modified\n if (isModified) {\n this.source.readyValue(value);\n }\n })\n });\n }\n}\n","import { Directive, inject, input } from '@angular/core';\nimport { emitDelayObs } from '@dereekb/rxjs';\nimport { type Maybe } from '@dereekb/util';\nimport { of, exhaustMap, shareReplay } from 'rxjs';\nimport { AbstractIfDirective } from '../../../view/if.directive';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { transformEmptyStringInputToUndefined } from '../../../util/input';\n\n/**\n * Structural directive that displays the content when the store has been triggered.\n *\n * Can be configured to hide for a temporary period.\n */\n@Directive({\n selector: '[dbxActionTriggered]',\n standalone: true\n})\nexport class DbxActionTriggeredDirective extends AbstractIfDirective {\n private readonly _store = inject(DbxActionContextStoreSourceInstance);\n\n readonly hideAfter = input<Maybe<number>, Maybe<number> | ''>(undefined, { alias: 'dbxActionTriggered', transform: transformEmptyStringInputToUndefined });\n\n readonly show$ = this._store.triggered$.pipe(\n exhaustMap((triggered) => {\n if (triggered) {\n return emitDelayObs(true, false, this.hideAfter());\n } else {\n return of(false);\n }\n }),\n shareReplay(1)\n );\n}\n","import { NgModule } from '@angular/core';\nimport {\n DbxActionDirective,\n DbxActionContextMapDirective,\n DbxActionFromMapDirective,\n DbxActionMapSourceDirective,\n DbxActionMapWorkingDisableDirective,\n DbxActionSourceDirective,\n DbxActionHandlerDirective,\n DbxActionDisabledDirective,\n DbxActionEnforceModifiedDirective,\n DbxActionAutoTriggerDirective,\n DbxActionValueStreamDirective,\n DbxActionAutoModifyDirective,\n DbxActionValueDirective,\n DbxActionContextLoggerDirective,\n DbxActionHasSuccessDirective,\n DbxActionSuccessHandlerDirective,\n DbxActionIsWorkingDirective,\n DbxActionDisabledOnSuccessDirective,\n DbxActionPreSuccessDirective,\n DbxActionIdleDirective,\n DbxActionHandlerValueDirective,\n DbxActionErrorHandlerDirective\n} from './directive';\n\nconst importsAndExports = [\n DbxActionDirective,\n DbxActionContextMapDirective,\n DbxActionFromMapDirective,\n DbxActionMapSourceDirective,\n DbxActionMapWorkingDisableDirective,\n DbxActionSourceDirective,\n DbxActionHandlerDirective,\n DbxActionHandlerValueDirective,\n DbxActionDisabledDirective,\n DbxActionDisabledOnSuccessDirective,\n DbxActionEnforceModifiedDirective,\n DbxActionAutoTriggerDirective,\n DbxActionValueStreamDirective,\n DbxActionAutoModifyDirective,\n DbxActionValueDirective,\n DbxActionContextLoggerDirective,\n DbxActionIdleDirective,\n DbxActionPreSuccessDirective,\n DbxActionHasSuccessDirective,\n DbxActionSuccessHandlerDirective,\n DbxActionErrorHandlerDirective,\n DbxActionIsWorkingDirective\n];\n\n/**\n * Contains all base DbxAction components.\n */\n@NgModule({\n imports: importsAndExports,\n exports: importsAndExports\n})\nexport class DbxCoreActionModule {}\n","import { type Destroyable } from '@dereekb/util';\nimport { type DbxActionContextStoreSourceInstance } from './action.store.source';\n\n/**\n * Acts as a reference to a DbxActionContextStoreSourceInstance that can be destroyed.\n *\n * This is used in cases where the action is passed around and the context it is passed to needs to clean up.\n */\nexport interface DbxActionContextSourceReference<T = unknown, O = unknown> extends Destroyable {\n readonly sourceInstance: DbxActionContextStoreSourceInstance<T, O>;\n}\n\nexport function makeDbxActionContextSourceReference<T, O>(sourceInstance: DbxActionContextStoreSourceInstance<T, O>): DbxActionContextSourceReference<T, O> {\n return {\n sourceInstance,\n destroy: () => 0\n };\n}\n","import { type ArrayOrValue, hasValueOrNotEmpty, type Maybe } from '@dereekb/util';\nimport { map, type Observable } from 'rxjs';\n\nexport type SegueRefRouterLink = string | ArrayOrValue<object>;\n\nexport interface SegueRefRawSegueParams {\n [key: string]: unknown;\n}\n\nexport interface SegueRefOptions<O = object> {\n /**\n * Raw parameters\n */\n refParams?: SegueRefRawSegueParams;\n\n /**\n * Custom Transition Options.\n *\n * For UIRouter, this is TransitionOptions.\n */\n refOptions?: O;\n}\n\n/**\n * Represents a segue ref\n */\nexport interface SegueRef<O = object> extends SegueRefOptions<O> {\n /**\n * Ref path value.\n */\n ref: SegueRefRouterLink;\n}\n\n/**\n * A SegueRef object or a different router link representation.\n */\nexport type SegueRefOrSegueRefRouterLink<O = object> = SegueRef<O> | SegueRefRouterLink;\n\nexport function isSegueRef<O = object>(input: Maybe<SegueRefOrSegueRefRouterLink<O>>): input is SegueRef<O> {\n return typeof input === 'object' && hasValueOrNotEmpty((input as SegueRef).ref);\n}\n\nexport function asSegueRef<O = object>(input: SegueRefOrSegueRefRouterLink<O>): SegueRef<O>;\nexport function asSegueRef<O = object>(input: Maybe<SegueRefOrSegueRefRouterLink<O>>): Maybe<SegueRef<O>>;\nexport function asSegueRef<O = object>(input: Maybe<SegueRefOrSegueRefRouterLink<O>>): Maybe<SegueRef<O>> {\n const type = typeof input;\n\n if (type === 'string') {\n return refStringToSegueRef(input as string);\n } else if (isSegueRef(input)) {\n return input as SegueRef<O>;\n } else {\n return undefined;\n }\n}\n\nexport function asSegueRefString<O = object>(input: SegueRefOrSegueRefRouterLink<O> | string): string;\nexport function asSegueRefString<O = object>(input: Maybe<SegueRefOrSegueRefRouterLink<O> | string>): Maybe<string>;\nexport function asSegueRefString<O = object>(input: Maybe<SegueRefOrSegueRefRouterLink<O> | string>): Maybe<string> {\n if (typeof input === 'string') {\n return input;\n } else if (isSegueRef(input)) {\n return input.ref as string;\n } else {\n throw new Error(`asSegueRefString() failed to convert the input to a string: ${input}`);\n }\n}\n\nexport function refStringToSegueRef<O = object>(ref: string, options?: SegueRefOptions<O>): SegueRef<O> {\n return { ...options, ref };\n}\n\nexport function mapRefStringObsToSegueRefObs<O = object>(obs: Observable<string>, options?: SegueRefOptions<O>): Observable<SegueRef<O>> {\n return obs.pipe(map((x) => refStringToSegueRef(x, options)));\n}\n","import { type Observable } from 'rxjs';\nimport { type AuthRoleSet } from '@dereekb/util';\nimport { type AuthUserIdentifier, type AuthUserState } from '../auth.user';\n\n/**\n * Client auth service used to retrieve info about the current state of client authentication and client roles they may have.\n */\nexport abstract class DbxAuthService {\n /**\n * Whether or not the user is logged in.\n *\n * This will only emit once the authentication has been determined, preventing issues with premature decision making.\n *\n * A user is considered logged in even if there is an anonymous user. For more detailed info, consider using authUserState$.\n */\n abstract readonly isLoggedIn$: Observable<boolean>;\n\n /**\n * Whether or not the user has finished onboarding.\n *\n * This will only emit once the onboarding status has been determined, preventing issues with premature decision making.\n */\n abstract readonly isOnboarded$: Observable<boolean>;\n\n /**\n * Emits an event every time the user logs in.\n */\n abstract readonly onLogIn$: Observable<void>;\n\n /**\n * Emits an event every time the user logs out.\n */\n abstract readonly onLogOut$: Observable<void>;\n\n /**\n * Current state of the user.\n */\n abstract readonly authUserState$: Observable<AuthUserState>;\n\n /**\n * Role set for the current user.\n */\n abstract readonly authRoles$: Observable<AuthRoleSet>;\n\n /**\n * Identifier for the current user.\n */\n abstract readonly userIdentifier$: Observable<AuthUserIdentifier>;\n\n /**\n * Performs the logout action.\n */\n abstract logOut(): Promise<void>;\n}\n","import { type TransitionHookFn, type Transition, type HookResult, type StateService, type UIInjector, type TransitionOptions, type RawParams } from '@uirouter/core';\nimport { catchError, map, first, firstValueFrom, type Observable, of, switchMap } from 'rxjs';\nimport { asSegueRef, asSegueRefString, type SegueRefOrSegueRefRouterLink } from './../../../../router/segue';\nimport { DbxAuthService } from '../../../service/auth.service';\nimport { type FactoryWithRequiredInput, getValueFromGetter, isGetter, type Maybe, type Milliseconds } from '@dereekb/util';\nimport { type Injector } from '@angular/core';\nimport { timeoutStartWith } from '@dereekb/rxjs';\n\n/**\n * authTransitionHookFn() configuration. The values are handled as:\n * - true: continue to the state.\n * - false: redirect to the login page.\n * - StateOrName: redirect to the target page instead.\n */\nexport type AuthTransitionDecision = true | false | SegueRefOrSegueRefRouterLink;\n\nexport interface AuthTransitionDecisionGetterInput {\n readonly transition: Transition;\n readonly injector: Injector;\n readonly authService: DbxAuthService;\n}\n\nexport type AuthTransitionRedirectTarget = Observable<Maybe<SegueRefOrSegueRefRouterLink>>;\nexport type AuthTransitionRedirectTargetGetter = FactoryWithRequiredInput<AuthTransitionRedirectTarget, AuthTransitionDecisionGetterInput>;\nexport type AuthTransitionRedirectTargetOrGetter = Maybe<SegueRefOrSegueRefRouterLink> | AuthTransitionRedirectTargetGetter;\n\nexport interface AuthTransitionHookOptions {\n /**\n * The state to redirect the user to when their auth fails.\n */\n defaultRedirectTarget: string;\n\n /**\n * The state to redirect the user to. Defaults to defaultRedirectTarget.\n */\n errorRedirectTarget?: string;\n\n /**\n * Timeout time for the decision obs. Defaults to 1000ms.\n */\n timeoutTime?: Milliseconds;\n}\n\nexport interface AuthTransitionHookConfig extends AuthTransitionHookOptions {\n /**\n * Creates the decision observable for the transition that decides whether or not to redirect or continue.\n */\n makeDecisionsObs: (transition: Transition, authService: DbxAuthService, injector: UIInjector) => Observable<AuthTransitionDecision>;\n}\n\nexport interface AuthTransitionStateData {\n /**\n * Optional getter/decision maker when a role needs to be\n */\n redirectTo?: AuthTransitionRedirectTargetOrGetter;\n}\n\n/**\n * This generates a TransitionHookFn that can be used with redirecting routes.\n */\nexport function makeAuthTransitionHook(config: AuthTransitionHookConfig): TransitionHookFn {\n const { defaultRedirectTarget, errorRedirectTarget = defaultRedirectTarget, timeoutTime = 1000 } = config;\n\n // https://ui-router.github.io/ng2/docs/latest/modules/transition.html#hookresult\n const assertIsAuthenticated: TransitionHookFn = (transition: Transition): HookResult => {\n const injector = transition.injector();\n const authService: DbxAuthService = injector.get(DbxAuthService);\n const $state: StateService = transition.router.stateService;\n const decisionObs = config.makeDecisionsObs(transition, authService, injector);\n\n function redirectOut(): Observable<HookResult> {\n const stateData: AuthTransitionStateData = transition.targetState().state().data;\n const redirectTo = stateData?.redirectTo;\n\n let redirectToObs: Observable<HookResult>;\n\n if (redirectTo) {\n let resultObs: Observable<Maybe<SegueRefOrSegueRefRouterLink>>;\n\n if (isGetter<AuthTransitionRedirectTarget>(redirectTo)) {\n resultObs = getValueFromGetter(redirectTo, { authService, injector, transition } as AuthTransitionDecisionGetterInput);\n } else {\n resultObs = of(redirectTo as SegueRefOrSegueRefRouterLink);\n }\n\n redirectToObs = resultObs.pipe(\n map((inputStateRef: Maybe<SegueRefOrSegueRefRouterLink>) => {\n const stateRef = asSegueRef(inputStateRef);\n\n let redirectTarget;\n let redirectParams;\n\n if (stateRef) {\n redirectTarget = stateRef.ref;\n redirectParams = stateRef.refParams;\n }\n\n if (!redirectTarget) {\n redirectTarget = defaultRedirectTarget;\n }\n\n return $state.target(redirectTarget, redirectParams);\n })\n );\n } else {\n redirectToObs = of($state.target(defaultRedirectTarget));\n }\n\n return redirectToObs;\n }\n\n const resultObs = decisionObs.pipe(\n // after the timeoutTime seconds of no transition working, redirect with a false decision\n timeoutStartWith(false as AuthTransitionDecision, timeoutTime),\n first(),\n switchMap((decision: AuthTransitionDecision): Observable<HookResult> => {\n if (typeof decision === 'boolean') {\n if (decision) {\n return of(true);\n } else {\n return redirectOut();\n }\n } else {\n const segueRef = asSegueRef(decision);\n return of($state.target(asSegueRefString(segueRef.ref), segueRef.refParams as RawParams, segueRef.refOptions as TransitionOptions));\n }\n }),\n catchError((x) => {\n console.warn(`Encountered error in auth transition hook. Attempting redirect to ${errorRedirectTarget}.`, x);\n return of($state.target(errorRedirectTarget, { location: true })); // Redirect to home\n })\n );\n\n return firstValueFrom(resultObs) as HookResult;\n };\n\n return assertIsAuthenticated;\n}\n","import { first, type Observable, of, switchMap } from 'rxjs';\nimport { getValueFromGetter, isGetter, type Maybe, type ObjectMap } from '@dereekb/util';\nimport { type AuthTransitionDecisionGetterInput, type AuthTransitionRedirectTarget, type AuthTransitionRedirectTargetGetter, type AuthTransitionRedirectTargetOrGetter } from './hook';\nimport { type SegueRefOrSegueRefRouterLink } from '../../../../router/segue';\nimport { type AuthUserState } from '../../../auth.user';\n\n/**\n * Creates a AuthTransitionRedirectTargetGetter that can redirect values based on the current authUserState.\n *\n * @param stateMap\n * @returns\n */\nexport function redirectBasedOnAuthUserState(stateMap: ObjectMap<AuthTransitionRedirectTargetOrGetter>): AuthTransitionRedirectTargetGetter {\n return (input: AuthTransitionDecisionGetterInput) => {\n return input.authService.authUserState$.pipe(\n first(),\n switchMap((authUserState: AuthUserState) => {\n const getter = stateMap[authUserState];\n let result: Maybe<Observable<Maybe<SegueRefOrSegueRefRouterLink>>>;\n\n if (getter) {\n if (isGetter<AuthTransitionRedirectTarget>(getter)) {\n result = getValueFromGetter(getter, input);\n } else {\n result = of(getter);\n }\n }\n\n if (!result) {\n result = of(undefined);\n }\n\n return result;\n })\n );\n };\n}\n","import { type Observable } from 'rxjs';\nimport { type Maybe } from '@dereekb/util';\nimport { type TransitionService, type TransitionHookFn, type Transition, type HookMatchCriteria } from '@uirouter/core';\nimport { type DbxAuthService } from '../../../service/auth.service';\nimport { type AuthTransitionDecision, type AuthTransitionHookOptions, makeAuthTransitionHook } from './hook';\n\nexport interface IsLoggedInHookConfig {\n options: AuthTransitionHookOptions;\n}\n\n/**\n * UIRouter State data with configuration for the hasAuthRoleHook.\n */\nexport interface IsLoggedInStateData {\n /**\n * Whether or not the user needs to be logged in for this state.\n */\n requiredLogIn: boolean;\n}\n\n/**\n * This hook redirects to the configured default state when a user is not logged in for configured states.\n */\nexport function enableIsLoggedInHook(transitionService: TransitionService, config: IsLoggedInHookConfig): void {\n // Matches if the destination state's data property has a truthy 'isSecure' property\n const isSecureCriteria: HookMatchCriteria = {\n entering: (state) => {\n const data = state?.data as Maybe<Partial<IsLoggedInStateData>>;\n const match = Boolean(data?.requiredLogIn);\n return match;\n }\n };\n\n const assertIsLoggedIn: TransitionHookFn = makeAuthTransitionHook({\n ...config.options,\n makeDecisionsObs(transition: Transition, authService: DbxAuthService): Observable<AuthTransitionDecision> {\n return authService.isLoggedIn$;\n }\n });\n\n // Register the \"requires auth\" hook with the TransitionsService\n transitionService.onBefore(isSecureCriteria, assertIsLoggedIn, { priority: 100 });\n}\n","import { map, type Observable, type OperatorFunction } from 'rxjs';\nimport { type AuthRole, type SetIncludesMode, type ArrayOrValue, type Maybe, setIncludes, asArray, type AuthRoleSet } from '@dereekb/util';\nimport { type TransitionService, type TransitionHookFn, type Transition, type HookMatchCriteria } from '@uirouter/core';\nimport { type DbxAuthService } from '../../../service/auth.service';\nimport { type AuthTransitionDecision, type AuthTransitionHookOptions, type AuthTransitionStateData, makeAuthTransitionHook } from './hook';\n\nexport interface HasAuthRoleHookConfig {\n readonly options: AuthTransitionHookOptions;\n}\n\nexport interface HasAuthRoleStateRoleConfig {\n /**\n * Auth roles marked for this state\n */\n readonly authRoles: ArrayOrValue<AuthRole>;\n /**\n * How to use the above auth roles. This defaults to 'all' by default.\n */\n readonly authRolesMode?: SetIncludesMode;\n}\n\nexport interface ParsedHasAuthRoleStateRoleConfig {\n /**\n * Auth roles marked for this state\n */\n readonly requiredRoles: Set<AuthRole>;\n /**\n * How to use the above auth roles. This defaults to 'all' by default.\n */\n readonly authRolesMode?: SetIncludesMode;\n}\n\n/**\n * UIRouter State data with configuration for the hasAuthRoleHook.\n */\nexport interface HasAuthRoleStateData extends AuthTransitionStateData, Pick<HasAuthRoleStateRoleConfig, 'authRolesMode'> {\n /**\n * Auth roles configuration for this state.\n */\n readonly authRoles: ArrayOrValue<AuthRole | HasAuthRoleStateRoleConfig>;\n}\n\n/**\n * This hook redirects to the configured default state when a user:\n *\n * - does not have an allowed state\n * - has a disallowed state\n */\nexport function enableHasAuthRoleHook(transitionService: TransitionService, config: HasAuthRoleHookConfig): void {\n // Matches if the destination state's data property has a truthy 'isSecure' property\n const isSecureCriteria: HookMatchCriteria = {\n entering: (state) => {\n const data = state?.data as Maybe<Partial<HasAuthRoleStateData>>;\n const match = Boolean(data?.authRoles);\n return match;\n }\n };\n\n const assertHasAuthRole: TransitionHookFn = makeAuthTransitionHook({\n ...config.options,\n makeDecisionsObs(transition: Transition, authService: DbxAuthService): Observable<AuthTransitionDecision> {\n const targetState = transition.targetState();\n const data: HasAuthRoleStateData = targetState.state().data;\n const mapFn: OperatorFunction<AuthRoleSet, boolean> = hasAuthRoleDecisionPipe(data);\n return authService.authRoles$.pipe(mapFn);\n }\n });\n\n // Register the \"requires auth\" hook with the TransitionsService\n transitionService.onBefore(isSecureCriteria, assertHasAuthRole, { priority: 100 });\n}\n\nexport function hasAuthRoleDecisionPipe(stateData: HasAuthRoleStateData): OperatorFunction<AuthRoleSet, boolean> {\n const authRolesMode: SetIncludesMode = stateData.authRolesMode || 'all';\n\n const authRoleConfigs: ParsedHasAuthRoleStateRoleConfig[] = asArray(stateData.authRoles).map((x) => {\n let config: HasAuthRoleStateRoleConfig;\n\n if (typeof x === 'string') {\n config = {\n authRoles: x,\n authRolesMode: 'any'\n };\n } else {\n config = x;\n }\n\n return {\n requiredRoles: new Set<AuthRole>(config.authRoles),\n authRolesMode: config.authRolesMode\n };\n });\n\n let mapFn: OperatorFunction<AuthRoleSet, boolean>;\n\n if (authRolesMode === 'any') {\n mapFn = map((x) => authRoleConfigs.findIndex((y) => setIncludes(x, y.requiredRoles, y.authRolesMode)) !== -1); // find the first match\n } else {\n mapFn = map((x) => authRoleConfigs.findIndex((y) => !setIncludes(x, y.requiredRoles, y.authRolesMode)) === -1); // find the first failed match\n }\n\n return mapFn;\n}\n","import { map, type Observable } from 'rxjs';\nimport { type AllowedSet, isAllowed, maybeSet, type ArrayOrValue, type Maybe } from '@dereekb/util';\nimport { type TransitionService, type TransitionHookFn, type Transition, type HookMatchCriteria } from '@uirouter/core';\nimport { type AuthUserState } from '../../../auth.user';\nimport { type DbxAuthService } from '../../../service/auth.service';\nimport { type AuthTransitionDecision, type AuthTransitionHookOptions, type AuthTransitionStateData, makeAuthTransitionHook } from './hook';\n\nexport interface HasAuthStateHookConfig {\n options: AuthTransitionHookOptions;\n}\n\nexport type HasAuthStateConfig = ArrayOrValue<AuthUserState> | HasAuthStateObjectConfig;\n\nexport interface HasAuthStateObjectConfig {\n /**\n * Whether or not this state or any child state is considered \"secure\", which requires the user to be logged in.\n */\n allowedStates?: ArrayOrValue<AuthUserState>;\n\n /**\n * States that are not allowed. If the current state is this state, a rejection is returned.\n */\n disallowedStates?: ArrayOrValue<AuthUserState>;\n}\n\nexport interface HasAuthStateData extends AuthTransitionStateData {\n /**\n * Configuration for the hasAuthStateHook.\n */\n authStates: HasAuthStateConfig;\n}\n\n/**\n * This hook redirects to the configured default state when a user:\n *\n * - does not have an allowed state\n * - has a disallowed state\n */\nexport function enableHasAuthStateHook(transitionService: TransitionService, config: HasAuthStateHookConfig): void {\n // Matches if the destination state's data property has a truthy 'isSecure' property\n const isSecureCriteria: HookMatchCriteria = {\n entering: (state) => {\n const data = state?.data as Maybe<Partial<HasAuthStateData>>;\n const match = Boolean(data?.authStates);\n return match;\n }\n };\n\n const assertHasAuthState: TransitionHookFn = makeAuthTransitionHook({\n ...config.options,\n makeDecisionsObs(transition: Transition, authService: DbxAuthService): Observable<AuthTransitionDecision> {\n const targetState = transition.targetState();\n const data: HasAuthStateData = targetState.state().data;\n const config = toHasAuthStateObjectConfig(data.authStates);\n const allowedStates: ParsedHasAuthStateConfig = toParsedHasAuthStateConfig(config);\n\n return authService.authUserState$.pipe(map((x) => isAllowed(x, allowedStates)));\n }\n });\n\n // Register the \"requires auth\" hook with the TransitionsService\n transitionService.onBefore(isSecureCriteria, assertHasAuthState, { priority: 100 });\n}\n\n// MARK: Utility\nfunction toHasAuthStateObjectConfig(input: HasAuthStateConfig): HasAuthStateObjectConfig {\n const isString = typeof input === 'string';\n\n if (Array.isArray(input) || isString) {\n if (isString) {\n input = [input as AuthUserState];\n }\n\n return {\n allowedStates: input as AuthUserState[]\n };\n } else {\n return input as HasAuthStateObjectConfig;\n }\n}\n\ntype ParsedHasAuthStateConfig = AllowedSet<AuthUserState>;\n\nfunction toParsedHasAuthStateConfig(input: HasAuthStateObjectConfig): ParsedHasAuthStateConfig {\n return {\n allowed: maybeSet(input.allowedStates),\n disallowed: maybeSet(input.disallowedStates)\n };\n}\n","/**\n * A contextual state identifier for a specific section of the app.\n *\n * Some examples are:\n * - init: The default context that is initialized.\n * - public: A public part of the app.\n * - onboarding: The onboarding section of the app.\n * - app: The main portion of the app.\n *\n * More complex apps may have more sub-sections or app portions that could each have their own context state.\n */\nexport type DbxAppContextState = string;\n\n/**\n * The init state of an app after the default context has been initialized.\n */\nexport const DBX_INIT_APP_CONTEXT_STATE = 'init';\n/**\n * The public state of an app, typically when a user opens up the site to a public page.\n */\nexport const DBX_PUBLIC_APP_CONTEXT_STATE = 'public';\n/**\n * The auth state of an app, typically when a user has not finished logging in.\n */\nexport const DBX_AUTH_APP_CONTEXT_STATE = 'auth';\n/**\n * The onboarding state of an app, typically when a user has completed auth but not finished setting up their account.\n */\nexport const DBX_ONBOARD_APP_CONTEXT_STATE = 'onboard';\n/**\n * The app state of an app, typically when a user has completed auth and onboarding.\n */\nexport const DBX_APP_APP_CONTEXT_STATE = 'app';\n\n/**\n * Default AppContextStates.\n *\n * Your app may not use these, but this type is available for convenience.\n */\nexport type DbxKnownAppContextState = typeof DBX_INIT_APP_CONTEXT_STATE | typeof DBX_PUBLIC_APP_CONTEXT_STATE | typeof DBX_AUTH_APP_CONTEXT_STATE | typeof DBX_ONBOARD_APP_CONTEXT_STATE | typeof DBX_APP_APP_CONTEXT_STATE;\n\n/**\n * Array of all DbxKnownAppContextState values, minus the init state.\n */\nexport const DBX_KNOWN_APP_CONTEXT_STATES: DbxKnownAppContextState[] = [DBX_PUBLIC_APP_CONTEXT_STATE, DBX_AUTH_APP_CONTEXT_STATE, DBX_ONBOARD_APP_CONTEXT_STATE, DBX_APP_APP_CONTEXT_STATE];\n","import { createAction, props } from '@ngrx/store';\nimport { type DbxAppContextState } from '../../context';\n\n/**\n * Action to set the current DbxAppContextState value.\n */\nexport const setState = createAction('[App/Context] Set State', props<{ state: DbxAppContextState }>());\n\n/**\n * Resets the app back to the init context.\n */\nexport const resetState = createAction('[App/Context] Reset');\n","import { createReducer, on } from '@ngrx/store';\nimport { type DbxAppContextState, DBX_INIT_APP_CONTEXT_STATE } from '../../context';\nimport { DbxAppContextActions } from '../action';\n\n/**\n * The feature key for these items/reducers.\n */\nexport const dbxAppContextStateFeatureKey = 'data';\n\n/**\n * The typings for this feature.\n */\nexport interface DbxAppContextStateData {\n state: DbxAppContextState;\n}\n\nexport const initialState: DbxAppContextStateData = {\n state: DBX_INIT_APP_CONTEXT_STATE\n};\n\nexport const reducer = createReducer(\n initialState,\n /**\n * When DbxAppContextActions.dbxAppContextSetState is pushed, update the app's state to match the argument state.\n */\n on(DbxAppContextActions.setState, (_, { state }) => ({ state }))\n);\n","import { type Action, combineReducers, createFeatureSelector, createSelector } from '@ngrx/store';\n\nimport * as fromDbxAppContextState from './data.reducer';\n\n/**\n * Global feature key for our app.\n */\nexport const featureKey = 'app.context';\n\n/**\n * This is a \"feature state\", which in this case is a single feature (our app state), but could include keys/states within this feature.\n */\nexport interface DbxAppContextFeatureState {\n [fromDbxAppContextState.dbxAppContextStateFeatureKey]: fromDbxAppContextState.DbxAppContextStateData;\n}\n\n/**\n * Interface typing extension for the DbxAppContextFeatureState, and the typing information for how this feature extends the base state.\n */\nexport interface State {\n [featureKey]: DbxAppContextFeatureState;\n}\n\n/**\n * Reducers mapping for the DbxAppContextFeatureState\n */\nexport function reducers(state: DbxAppContextFeatureState | undefined, action: Action) {\n return combineReducers({\n [fromDbxAppContextState.dbxAppContextStateFeatureKey]: fromDbxAppContextState.reducer\n })(state, action);\n}\n\n/**\n * Selects the DbxAppContextFeatureState feature context.\n *\n * Used by createSelector() to retrieve more specific data from the DbxAppContextFeatureState.\n */\nexport const selectAppContextFeature = createFeatureSelector<DbxAppContextFeatureState>(featureKey);\n\n/**\n * Selector to retrieve the state value from our DbxAppContextStateData in our DbxAppContextFeatureState.\n */\nexport const selectDbxAppContextState = createSelector(selectAppContextFeature, (featureState: DbxAppContextFeatureState) => featureState[fromDbxAppContextState.dbxAppContextStateFeatureKey].state);\n","import { type OnRunEffects, Actions, type EffectNotification, ofType } from '@ngrx/effects';\nimport { Store } from '@ngrx/store';\nimport { type Observable, exhaustMap, filter, takeUntil } from 'rxjs';\nimport { type DbxAppContextState } from '../../context';\nimport { onDbxAppContext } from '../';\nimport { type IterableOrValue, iterableToSet } from '@dereekb/util';\nimport { inject } from '@angular/core';\n\n// MARK: Abstract Context Effects\n/**\n * Abstract effects class that only runs/allows effects when the DbxAppContextState in the ngrx state matches input activeState value.\n */\nexport abstract class AbstractOnDbxAppContextStateEffects<S = unknown> implements OnRunEffects {\n protected readonly actions$ = inject(Actions);\n protected readonly store = inject(Store<S>);\n\n /**\n * The set of state(s) to activate on.\n */\n private _activeStatesSet: Set<DbxAppContextState>;\n\n constructor(activeStates: IterableOrValue<DbxAppContextState>) {\n this._activeStatesSet = iterableToSet(activeStates);\n }\n\n /**\n * Configures all actions of the sub-class to only activate when the DbxAppContextState in App\n *\n * @param resolvedEffects$\n * @returns\n */\n ngrxOnRunEffects(resolvedEffects$: Observable<EffectNotification>): Observable<EffectNotification> {\n return this.actions$.pipe(\n ofType(onDbxAppContext.DbxAppContextActions.setState),\n filter(({ state }) => {\n return this._activeStatesSet.has(state);\n }),\n exhaustMap(() =>\n resolvedEffects$.pipe(\n takeUntil(\n this.actions$.pipe(\n ofType(onDbxAppContext.DbxAppContextActions.setState),\n filter(({ state }) => !this._activeStatesSet.has(state))\n )\n )\n )\n )\n );\n }\n}\n","import { type Maybe } from '@dereekb/util';\n\n/**\n * An application user state.\n *\n * Generic states that define the current state of the user:\n * - none: the user is not logged in\n * - anon: the user is logged in as an anonymous account\n * - error: there was an error loading the correct user state\n * - new: the user has a full account but has not completed onboarding/setup\n * - user: the user has a full account and has completed setup\n */\nexport type AuthUserState = 'none' | 'anon' | 'new' | 'user' | 'error';\n\n/**\n * Arbitrary identifier used to differentiate users.\n */\nexport type AuthUserIdentifier = string;\n\nexport const NO_AUTH_USER_IDENTIFIER = '0';\n\n/**\n * AuthUserIdentifier used to indicate that the user cannot be uniquely identifier.\n */\nexport type NoAuthUserIdentifier = typeof NO_AUTH_USER_IDENTIFIER;\n\n/**\n * Creates an AuthUserIdentifier from the input. If the input is undefined, returns the NoAuthUserIdentifier.\n *\n * @param inputId\n * @returns\n */\nexport function authUserIdentifier(inputId: Maybe<AuthUserIdentifier>): AuthUserIdentifier {\n return inputId ? inputId : NO_AUTH_USER_IDENTIFIER;\n}\n","import { createAction } from '@ngrx/store';\n\n/**\n * Action for when the user has logged in.\n */\nexport const loggedIn = createAction('[App/Auth] Auth Logged In');\n\n/**\n * Action for when the user has logged out.\n */\nexport const loggedOut = createAction('[App/Auth] Auth Logged Out');\n\n/**\n * Action to log the user out.\n */\nexport const logout = createAction('[App/Auth] Auth Logout');\n","import { createAction, props } from '@ngrx/store';\nimport { type AuthRole } from '@dereekb/util';\nimport { type AuthUserIdentifier, type AuthUserState } from '../../auth.user';\n\n/**\n * Sets the user's identifier in the auth.\n */\nexport const setUserIdentifier = createAction('[App/Auth] Set User Identifier', props<{ id: AuthUserIdentifier }>());\n\n/**\n * Sets the user's state in the auth.\n */\nexport const setUserState = createAction('[App/Auth] Set User State', props<{ state: AuthUserState }>());\n\n/**\n * Sets the user's roles in the auth.\n */\nexport const setUserRoles = createAction('[App/Auth] Set User Roles', props<{ roles: AuthRole[] }>());\n\n/**\n * Sets the user's onboarding state.\n */\nexport const setUserIsOnboarded = createAction('[App/Auth] Set User Is Onboarded', props<{ isOnboarded: boolean }>());\n","import { NO_AUTH_USER_IDENTIFIER, type AuthUserIdentifier, type AuthUserState } from '../../auth.user';\nimport { createReducer, on } from '@ngrx/store';\nimport { DbxAppAuthActions, DbxAppAuthUserActions } from '../action';\nimport { type AuthRole } from '@dereekb/util';\n\nexport const dbxAppAuthUserFeatureKey = 'user';\n\nexport interface DbxAppAuthStateUser {\n userId: AuthUserIdentifier;\n isOnboarded: boolean;\n userState: AuthUserState;\n userRoles: AuthRole[];\n}\n\nexport const initialState: DbxAppAuthStateUser = {\n userId: NO_AUTH_USER_IDENTIFIER,\n isOnboarded: false,\n userState: 'none',\n userRoles: []\n};\n\nexport const reducer = createReducer(\n initialState,\n on(DbxAppAuthActions.loggedOut, () => ({ ...initialState })),\n on(DbxAppAuthUserActions.setUserIdentifier, (state, { id: userId }) => ({ ...state, userId })),\n on(DbxAppAuthUserActions.setUserIsOnboarded, (state, { isOnboarded }) => ({ ...state, isOnboarded })),\n on(DbxAppAuthUserActions.setUserState, (state, { state: userState }) => ({ ...state, userState })),\n on(DbxAppAuthUserActions.setUserRoles, (state, { roles: userRoles }) => ({ ...state, userRoles: Array.from(userRoles) }))\n);\n","import { type Action, combineReducers, createFeatureSelector, createSelector } from '@ngrx/store';\nimport * as fromDbxAppAuthUserState from './user.reducer';\n\n/**\n * Global feature key\n */\nexport const featureKey = 'app.auth';\n\nexport interface DbxAppAuthFeatureState {\n [fromDbxAppAuthUserState.dbxAppAuthUserFeatureKey]: fromDbxAppAuthUserState.DbxAppAuthStateUser;\n}\n\n/**\n * Interface typing extension for the DbxAppAuthFeatureState, and the typing information for how this feature extends the base state.\n */\nexport interface State {\n [featureKey]: DbxAppAuthFeatureState;\n}\n\n/**\n * Reducers mapping for the DbxAppAuthFeatureState\n */\nexport function reducers(state: DbxAppAuthFeatureState | undefined, action: Action) {\n return combineReducers({\n [fromDbxAppAuthUserState.dbxAppAuthUserFeatureKey]: fromDbxAppAuthUserState.reducer\n })(state, action);\n}\n\n/**\n * Selects the DbxAppAuthFeatureState feature context.\n */\nexport const selectAppAuthFeature = createFeatureSelector<DbxAppAuthFeatureState>(featureKey);\n\n/**\n * Selector to retrieve the state value from our DbxAppContextStateData in our DbxAppContextFeatureState.\n */\nexport const selectDbxAppAuthUser = createSelector(selectAppAuthFeature, (featureState: DbxAppAuthFeatureState) => featureState[fromDbxAppAuthUserState.dbxAppAuthUserFeatureKey]);\n","import { type ObservableOrValue, asObservable } from '@dereekb/rxjs';\nimport { firstValueFrom } from 'rxjs';\nimport { type SegueRef, type SegueRefOrSegueRefRouterLink } from '../../segue';\nimport { type DbxRouterService } from './router.service';\n\n/**\n * Function that will perform navigation with the input route.\n */\nexport type GoWithRouter = (route: ObservableOrValue<SegueRef>) => Promise<boolean>;\n\n/**\n * Creates a GoWithRouter function.\n *\n * @param dbxRouterService\n * @returns\n */\nexport function goWithRouter(dbxRouterService: DbxRouterService): (route: ObservableOrValue<SegueRefOrSegueRefRouterLink>) => Promise<boolean> {\n return (route) => {\n return firstValueFrom(asObservable(route)).then((x) => dbxRouterService.go(x));\n };\n}\n","import { type Observable } from 'rxjs';\nimport { type DbxRouterTransitionEvent } from '../transition/transition';\n\n/**\n * Router service definition that provides high level information about router transitions.\n */\nexport abstract class DbxRouterTransitionService {\n /**\n * Observable that emits DbxRouterTransitionEvent values as transitions occur.\n */\n abstract readonly transitions$: Observable<DbxRouterTransitionEvent>;\n}\n","import { type ObservableOrValue } from '@dereekb/rxjs';\nimport { type Observable } from 'rxjs';\nimport { type SegueRefOrSegueRefRouterLink, type SegueRefRawSegueParams } from '../../segue';\nimport { DbxRouterTransitionService } from './router.transition.service';\n\n/**\n * Router service definition that can route the app and provide routing details.\n */\nexport abstract class DbxRouterService extends DbxRouterTransitionService {\n /**\n * Params of the current successfully loaded route.\n */\n abstract readonly params$: Observable<SegueRefRawSegueParams>;\n\n /**\n * Navigates to the target SegueRef.\n *\n * @param segueRef\n */\n abstract go(segueRef: ObservableOrValue<SegueRefOrSegueRefRouterLink>): Promise<boolean>;\n\n /**\n * Navigates to the current url with updated parameters. Will be merged with the existing parameters.\n *\n * The new state will replace the current state in the history.\n *\n * @param segueRef\n */\n abstract updateParams(params: ObservableOrValue<SegueRefRawSegueParams>): Promise<boolean>;\n\n /**\n * Returns true if the input segue ref is considered active.\n *\n * @param segueRef\n */\n abstract isActive(segueRef: SegueRefOrSegueRefRouterLink): boolean;\n\n /**\n * Returns true if the input segue ref is considered active exactly.\n *\n * @param segueRef\n */\n abstract isActiveExactly(segueRef: SegueRefOrSegueRefRouterLink): boolean;\n\n /**\n * Compares the two refs for precision for a certain route.\n *\n * For example, if the parent route is input with a child route, the child route is\n * considered more precise.\n *\n * @param a\n * @param b\n */\n abstract comparePrecision(a: SegueRefOrSegueRefRouterLink, b: SegueRefOrSegueRefRouterLink): number;\n}\n","import { type SegueRefOrSegueRefRouterLink } from '../../router/segue';\n\n/**\n * Auth routes configurations for an app.\n */\nexport abstract class DbxAppAuthRoutes {\n abstract readonly loginRef: SegueRefOrSegueRefRouterLink;\n abstract readonly loggedOutRef?: SegueRefOrSegueRefRouterLink;\n abstract readonly onboardRef?: SegueRefOrSegueRefRouterLink;\n abstract readonly appRef: SegueRefOrSegueRefRouterLink;\n}\n","import { BehaviorSubject } from 'rxjs';\nimport { Injectable, type OnDestroy, inject } from '@angular/core';\nimport { goWithRouter } from '../../router/router/service/router.go';\nimport { DbxRouterService } from '../../router/router/service/router.service';\nimport { DbxAppAuthRoutes } from './auth.router';\n\n/**\n * Helper service for navigating to important auth-related routes.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class DbxAppAuthRouterService implements OnDestroy {\n readonly dbxRouterService = inject(DbxRouterService);\n readonly dbxAppAuthRoutes = inject(DbxAppAuthRoutes);\n\n private _isAuthRouterEffectsEnabled = new BehaviorSubject<boolean>(true);\n readonly isAuthRouterEffectsEnabled$ = this._isAuthRouterEffectsEnabled.asObservable();\n\n ngOnDestroy(): void {\n this._isAuthRouterEffectsEnabled.complete();\n }\n\n get hasOnboardingState(): boolean {\n return Boolean(this.dbxAppAuthRoutes.onboardRef);\n }\n\n // MARK: Effects\n /**\n * Whether or not DbxAppAuthRouterEffects are enabled.\n */\n get isAuthRouterEffectsEnabled(): boolean {\n return this._isAuthRouterEffectsEnabled.value;\n }\n\n set isAuthRouterEffectsEnabled(enabled: boolean) {\n this._isAuthRouterEffectsEnabled.next(enabled);\n }\n\n // MARK: Navigate\n /**\n * Navigates to the login state.\n *\n * @returns\n */\n goToLogin() {\n return goWithRouter(this.dbxRouterService)(this.dbxAppAuthRoutes.loginRef);\n }\n\n /**\n * Navigates to the logged out state, if it exists, otherwise navigates to the login state.\n *\n * @returns\n */\n goToLoggedOut() {\n return goWithRouter(this.dbxRouterService)(this.dbxAppAuthRoutes.loggedOutRef ?? this.dbxAppAuthRoutes.loginRef);\n }\n\n /**\n * Navigates to the onboarding state if it is available, otherwise navigates to the app.\n *\n * @returns\n */\n goToOnboarding(): Promise<boolean> {\n return goWithRouter(this.dbxRouterService)(this.dbxAppAuthRoutes.onboardRef ?? this.dbxAppAuthRoutes.appRef);\n }\n\n /**\n * Navigates to the app state.\n *\n * @returns\n */\n goToApp() {\n return goWithRouter(this.dbxRouterService)(this.dbxAppAuthRoutes.appRef);\n }\n}\n","import { exhaustMap, filter } from 'rxjs';\nimport { Injectable, InjectionToken, inject } from '@angular/core';\nimport { type ArrayOrValue, type Maybe } from '@dereekb/util';\nimport { createEffect, ofType } from '@ngrx/effects';\nimport { type DbxAppContextState, DBX_KNOWN_APP_CONTEXT_STATES } from '../../../../context/context';\nimport { AbstractOnDbxAppContextStateEffects } from '../../../../context/state/effect';\nimport { type fromDbxAppAuth, onDbxAppAuth } from '../../../state';\nimport { DbxAppAuthRouterService } from '../../auth.router.service';\n\n/**\n * Used by DbxAppAuthRouterEffects to configure the states that should be activve by default.\n */\nexport const DBX_APP_AUTH_ROUTER_EFFECTS_TOKEN = new InjectionToken('DbxAppAuthRouterEffectsActiveStates');\n\n/**\n * Set of ngrx effects that handle navigation in the app when the auth changes in certain ways.\n *\n * Is configurable via the DBX_APP_AUTH_ROUTER_EFFECTS_TOKEN to choose which states this effect is active or not. By default is equal to DBX_KNOWN_APP_CONTEXT_STATES.\n */\n@Injectable()\nexport class DbxAppAuthRouterEffects extends AbstractOnDbxAppContextStateEffects<fromDbxAppAuth.State> {\n readonly dbxAppAuthRouterService = inject(DbxAppAuthRouterService);\n\n constructor() {\n super(inject<Maybe<ArrayOrValue<DbxAppContextState>>>(DBX_APP_AUTH_ROUTER_EFFECTS_TOKEN, { optional: true }) ?? DBX_KNOWN_APP_CONTEXT_STATES);\n }\n\n /**\n * Effect to redirect to the login when logout occurs.\n */\n readonly redirectToLoginOnLogout = createEffect(\n () =>\n this.actions$.pipe(\n ofType(onDbxAppAuth.DbxAppAuthActions.loggedOut),\n filter(() => this.dbxAppAuthRouterService.isAuthRouterEffectsEnabled),\n exhaustMap(() => this.dbxAppAuthRouterService.goToLogin())\n ),\n { dispatch: false }\n );\n\n /**\n * Effect to redirect to the app when login occurs.\n */\n readonly redirectToOnboardOnLogIn = createEffect(\n () =>\n this.actions$.pipe(\n ofType(onDbxAppAuth.DbxAppAuthActions.loggedIn),\n filter(() => this.dbxAppAuthRouterService.isAuthRouterEffectsEnabled),\n exhaustMap(() => this.dbxAppAuthRouterService.goToApp())\n ),\n { dispatch: false }\n );\n}\n","import { type EnvironmentProviders, type Provider, makeEnvironmentProviders } from '@angular/core';\nimport { type ArrayOrValue } from '@dereekb/util';\nimport { provideEffects } from '@ngrx/effects';\nimport { type DbxAppContextState } from '../../../context';\nimport { DbxAppAuthRouterEffects, DBX_APP_AUTH_ROUTER_EFFECTS_TOKEN } from './effect/auth.router.state.effect';\n\n/**\n * Configuration for provideDbxAppAuthRouterState().\n */\nexport interface ProvideDbxAppAuthRouterStateConfig {\n /**\n * Active routes to apply effects to.\n */\n readonly activeRoutesToApplyEffects: ArrayOrValue<DbxAppContextState>;\n}\n\n/**\n * Creates EnvironmentProviders for providing DbxAppAuthRouterState configuration and effects.\n *\n * @param config Configuration\n * @returns EnvironmentProviders\n */\nexport function provideDbxAppAuthRouterState(config: ProvideDbxAppAuthRouterStateConfig): EnvironmentProviders {\n const { activeRoutesToApplyEffects } = config;\n\n const providers: (Provider | EnvironmentProviders)[] = [\n // Token for effects\n {\n provide: DBX_APP_AUTH_ROUTER_EFFECTS_TOKEN,\n useValue: activeRoutesToApplyEffects\n },\n // Effects\n provideEffects(DbxAppAuthRouterEffects)\n ];\n\n return makeEnvironmentProviders(providers);\n}\n","import { type EnvironmentProviders, type Provider, makeEnvironmentProviders } from '@angular/core';\nimport { DbxAppAuthRoutes } from './auth.router';\n\n/**\n * Configuration for provideDbxAppAuthRouter().\n */\nexport interface ProvideDbxAppAuthRouterConfig {\n /**\n * DbxAppAuthRoutes configuration.\n */\n readonly dbxAppAuthRoutes: DbxAppAuthRoutes;\n}\n\n/**\n * Creates EnvironmentProviders for providing DbxAppAuthRoutes configuration.\n *\n * @param config Configuration\n * @returns EnvironmentProviders\n */\nexport function provideDbxAppAuthRouter(config: ProvideDbxAppAuthRouterConfig): EnvironmentProviders {\n const { dbxAppAuthRoutes } = config;\n\n const providers: Provider[] = [\n {\n provide: DbxAppAuthRoutes,\n useValue: dbxAppAuthRoutes\n }\n ];\n\n return makeEnvironmentProviders(providers);\n}\n","import { type AuthRole, type AuthRoleSet, type Maybe } from '@dereekb/util';\nimport { onFalseToTrue, onTrueToFalse, setContainsAllValuesFrom, setContainsNoValueFrom } from '@dereekb/rxjs';\nimport { map, type Observable, type OperatorFunction } from 'rxjs';\n\n/**\n * Convenience operator that emits events when the input observable goes from false to true.\n *\n * @param isLoggedInObs\n * @returns\n */\nexport function loggedInObsFromIsLoggedIn(isLoggedInObs: Observable<boolean>): Observable<void> {\n return isLoggedInObs.pipe(\n onFalseToTrue(),\n map(() => undefined)\n );\n}\n/**\n * Convenience operator that emits events when the input observable goes from true to false.\n *\n * @param isLoggedInObs\n * @returns\n */\nexport function loggedOutObsFromIsLoggedIn(isLoggedInObs: Observable<boolean>): Observable<void> {\n return isLoggedInObs.pipe(\n onTrueToFalse(),\n map(() => undefined)\n );\n}\n\nexport function authRolesSetContainsAllRolesFrom(roles: Observable<Maybe<Iterable<AuthRole>>>): OperatorFunction<AuthRoleSet, boolean> {\n return setContainsAllValuesFrom<AuthRole>(roles);\n}\n\nexport function authRolesSetContainsAnyRoleFrom(roles: Observable<Maybe<Iterable<AuthRole>>>): OperatorFunction<AuthRoleSet, boolean> {\n return setContainsAllValuesFrom<AuthRole>(roles);\n}\n\nexport function authRolesSetContainsNoRolesFrom(roles: Observable<Maybe<Iterable<AuthRole>>>): OperatorFunction<AuthRoleSet, boolean> {\n return setContainsNoValueFrom<AuthRole>(roles);\n}\n","import { Injectable, inject } from '@angular/core';\nimport { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { Store } from '@ngrx/store';\nimport { DbxAuthService } from '../../service/auth.service';\nimport { onDbxAppAuth } from '../';\nimport { map, tap } from 'rxjs';\nimport type * as fromDbxAppAuth from '../reducer';\n\n/**\n * Set of ngrx effects that repeat events from DbxAuthService.\n */\n@Injectable()\nexport class DbxAppAuthEffects {\n private readonly dbxAuthService = inject(DbxAuthService);\n protected readonly actions$ = inject(Actions);\n protected readonly store = inject(Store<fromDbxAppAuth.State>);\n\n // MARK: Auth\n readonly emitLoggedIn = createEffect(() => this.dbxAuthService.onLogIn$.pipe(map(() => onDbxAppAuth.DbxAppAuthActions.loggedIn())));\n\n readonly emitLoggedOut = createEffect(() => this.dbxAuthService.onLogOut$.pipe(map(() => onDbxAppAuth.DbxAppAuthActions.loggedOut())));\n\n readonly forwardLogoutToAuthService = createEffect(\n () =>\n this.actions$.pipe(\n ofType(onDbxAppAuth.DbxAppAuthActions.logout),\n tap(() => {\n // Perform the logout\n this.dbxAuthService.logOut();\n })\n ),\n { dispatch: false }\n );\n\n // MARK: Auth\n readonly setUserIdentifier = createEffect(() => this.dbxAuthService.userIdentifier$.pipe(map((id) => onDbxAppAuth.DbxAppAuthUserActions.setUserIdentifier({ id }))));\n\n readonly setUserState = createEffect(() => this.dbxAuthService.authUserState$.pipe(map((state) => onDbxAppAuth.DbxAppAuthUserActions.setUserState({ state }))));\n\n readonly setUserRoles = createEffect(() => this.dbxAuthService.authRoles$.pipe(map((roles) => onDbxAppAuth.DbxAppAuthUserActions.setUserRoles({ roles: Array.from(roles ?? []) }))));\n\n readonly setUserIsOnboarded = createEffect(() => this.dbxAuthService.isOnboarded$.pipe(map((isOnboarded) => onDbxAppAuth.DbxAppAuthUserActions.setUserIsOnboarded({ isOnboarded }))));\n}\n","import { type EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\nimport { provideEffects } from '@ngrx/effects';\nimport { provideState } from '@ngrx/store';\nimport { fromDbxAppAuth } from './state';\nimport { DbxAppAuthEffects } from './state/effect/auth.effect';\n\n/**\n * Creates EnvironmentProviders for providing the DbxAppAuth state and effects.\n *\n * @returns EnvironmentProviders\n */\nexport function provideDbxAppAuthState(): EnvironmentProviders {\n return makeEnvironmentProviders([provideState(fromDbxAppAuth.featureKey, fromDbxAppAuth.reducers), provideEffects(DbxAppAuthEffects)]);\n}\n","import { type EnvironmentProviders, makeEnvironmentProviders, type Provider } from '@angular/core';\nimport { provideDbxAppAuthState } from './auth.state.providers';\nimport { provideDbxAppAuthRouter, type ProvideDbxAppAuthRouterConfig } from './router/auth.router.providers';\nimport { provideDbxAppAuthRouterState, type ProvideDbxAppAuthRouterStateConfig } from './router/state/auth.router.state.providers';\n\nexport interface ProvideDbxAppAuthConfig extends ProvideDbxAppAuthRouterConfig, ProvideDbxAppAuthRouterStateConfig {}\n\n/**\n * The \"all-in-one\" provider for an app's dbx-core auth providers.\n *\n * @param config Configuration\n * @returns EnvironmentProviders\n */\nexport function provideDbxAppAuth(config: ProvideDbxAppAuthConfig): EnvironmentProviders {\n const { dbxAppAuthRoutes, activeRoutesToApplyEffects } = config;\n\n const providers: (Provider | EnvironmentProviders)[] = [provideDbxAppAuthState(), provideDbxAppAuthRouter({ dbxAppAuthRoutes }), provideDbxAppAuthRouterState({ activeRoutesToApplyEffects })];\n\n return makeEnvironmentProviders(providers);\n}\n","import { type AuthRole, type ArrayOrValue, type Maybe } from '@dereekb/util';\nimport { type Observable } from 'rxjs';\nimport { Directive, inject, input } from '@angular/core';\nimport { toObservable } from '@angular/core/rxjs-interop';\nimport { authRolesSetContainsAnyRoleFrom, DbxAuthService } from './service';\nimport { AbstractIfDirective } from '../view/if.directive';\n\n/**\n * Structural decorator directive similar to ngIf that embeds content if the current auth user has any of the target role(s).\n */\n@Directive({\n selector: '[dbxAuthHasAnyRole]',\n standalone: true\n})\nexport class DbxAuthHasAnyRoleDirective extends AbstractIfDirective {\n private readonly _authService = inject(DbxAuthService);\n\n readonly targetRoles = input<Maybe<ArrayOrValue<AuthRole>>>(undefined, { alias: 'dbxAuthHasAnyRole' });\n readonly targetRoles$ = toObservable(this.targetRoles);\n\n readonly show$: Observable<boolean> = this._authService.authRoles$.pipe(authRolesSetContainsAnyRoleFrom(this.targetRoles$));\n}\n","import { type Maybe, type AuthRole, type ArrayOrValue } from '@dereekb/util';\nimport { type Observable } from 'rxjs';\nimport { Directive, inject, input } from '@angular/core';\nimport { toObservable } from '@angular/core/rxjs-interop';\nimport { authRolesSetContainsAllRolesFrom, DbxAuthService } from './service';\nimport { AbstractIfDirective } from '../view/if.directive';\n\n/**\n * Structural decorator directive similar to ngIf that embeds content if the current auth user has all of the target role(s).\n */\n@Directive({\n selector: '[dbxAuthHasRoles]',\n standalone: true\n})\nexport class DbxAuthHasRolesDirective extends AbstractIfDirective {\n private readonly _authService = inject(DbxAuthService);\n\n readonly targetRoles = input<Maybe<ArrayOrValue<AuthRole>>>(undefined, { alias: 'dbxAuthHasRoles' });\n readonly targetRoles$ = toObservable(this.targetRoles);\n\n readonly show$: Observable<boolean> = this._authService.authRoles$.pipe(authRolesSetContainsAllRolesFrom(this.targetRoles$));\n}\n","import { type Maybe, type AuthRole, type ArrayOrValue } from '@dereekb/util';\nimport { type Observable } from 'rxjs';\nimport { Directive, inject, input } from '@angular/core';\nimport { toObservable } from '@angular/core/rxjs-interop';\nimport { authRolesSetContainsNoRolesFrom, DbxAuthService } from './service';\nimport { AbstractIfDirective } from '../view/if.directive';\n\n/**\n * Structural decorator directive similar to ngIf that embeds content if the current auth user has none of the target role(s).\n */\n@Directive({\n selector: '[dbxAuthNotAnyRole]',\n standalone: true\n})\nexport class DbxAuthNotAnyRoleDirective extends AbstractIfDirective {\n private readonly _authService = inject(DbxAuthService);\n\n readonly targetRoles = input<Maybe<ArrayOrValue<AuthRole>>>(undefined, { alias: 'dbxAuthNotAnyRole' });\n readonly targetRoles$ = toObservable(this.targetRoles);\n\n readonly show$: Observable<boolean> = this._authService.authRoles$.pipe(authRolesSetContainsNoRolesFrom(this.targetRoles$));\n}\n","import { Injectable, inject } from '@angular/core';\nimport { Store } from '@ngrx/store';\nimport { fromDbxAppAuth } from './state';\nimport { type DbxAppAuthFullState } from './state/state';\n\n/**\n * State for accessing the app's DbxAppAuthState defined within the DbxAppAuthFullState for the ngrx store.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class DbxAppAuthStateService {\n readonly store = inject(Store<DbxAppAuthFullState>);\n readonly authStateUser$ = this.store.select(fromDbxAppAuth.selectDbxAppAuthUser);\n}\n","import { type Type, type Provider, forwardRef } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { type Observable } from 'rxjs';\nimport { type DbxActionWorkProgress, type DbxActionWorkOrWorkProgress } from '../action/action';\n\nexport type DbxButtonWorkingProgress = DbxActionWorkProgress;\n\n/**\n * Working state for a button.\n *\n * Can be a boolean or a number.\n *\n * True is treated as an indeterminate progress.\n */\nexport type DbxButtonWorking = DbxActionWorkOrWorkProgress;\n\n/**\n * Used for intercepting button click events.\n *\n * Can be used to delay/modify trigger/click behaviors.\n */\nexport interface DbxButtonInterceptor {\n /**\n * Handles a button click event. Returns an observable that will say whether or not to continue the click event.\n */\n interceptButtonClick: () => Observable<boolean>;\n}\n\n/**\n * Text and icon display content for a button.\n */\nexport interface DbxButtonDisplay {\n /**\n * button Icon, if applicable\n */\n readonly icon?: Maybe<string>;\n /**\n * button text, if applicable\n */\n readonly text?: Maybe<string>;\n}\n\nexport abstract class DbxButton {\n /**\n * Observable of the disabled state of the button.\n */\n abstract readonly disabled$: Observable<boolean>;\n /**\n * Observable of the working state of the button.\n */\n abstract readonly working$: Observable<DbxButtonWorking>;\n /**\n * Observable of the clicked event of the button.\n */\n abstract readonly clicked$: Observable<unknown>;\n /**\n * Observable of the display content of the button.\n */\n abstract readonly display$: Observable<DbxButtonDisplay>;\n /**\n * Sets the disabled state of the button. If null/undefined the button will be disabled.\n *\n * @param disabled\n */\n abstract setDisabled(disabled?: Maybe<boolean>): void;\n /**\n * Sets the working state of the button.\n *\n * If a number is passed, then it is treated as a progress percentage.\n *\n * If true is passed, then it is treated as an indeterminate progress.\n *\n * If null/undefined is passed, then the button will not be working.\n */\n abstract setWorking(working?: Maybe<DbxButtonWorking>): void;\n /**\n * Sets the display content of the button.\n *\n * @param content\n */\n abstract setDisplayContent(content: DbxButtonDisplay): void;\n /**\n * Sets the button interceptor. If any interceptor is already set, it is replaced.\n *\n * @param interceptor\n */\n abstract setButtonInterceptor(interceptor: DbxButtonInterceptor): void;\n /**\n * Main function to use for handling clicks on the button.\n */\n abstract clickButton(): void;\n}\n\nexport function provideDbxButton<S extends DbxButton>(sourceType: Type<S>): Provider[] {\n return [\n {\n provide: DbxButton,\n useExisting: forwardRef(() => sourceType)\n }\n ];\n}\n\n// MARK: Display\n/**\n * The display type of a button.\n *\n * text_button: A text button has text or is empty.\n * icon_button: An icon button only has an icon and no text.\n */\nexport type DbxButtonDisplayType = 'text_button' | 'icon_button';\n\n/**\n * Delegate class used for retrieving the DbxButtonDisplay given an input value.\n */\nexport interface DbxButtonDisplayDelegate<T> {\n /**\n * Returns the DbxButtonDisplay for the input value.\n *\n * @param value\n */\n buttonDisplayContentForValue(value: T): DbxButtonDisplay;\n}\n\n/**\n * Returns the DbxButtonDisplayType given the input content.\n *\n * @param content\n * @returns\n */\nexport function dbxButtonDisplayType(content: DbxButtonDisplay): DbxButtonDisplayType {\n return !content.text && content.icon ? 'icon_button' : 'text_button';\n}\n","import { Directive, inject } from '@angular/core';\nimport { cleanSubscription } from '../../rxjs';\nimport { DbxButton } from '../button';\nimport { DbxActionContextStoreSourceInstance } from '../../action/action.store.source';\n\n/**\n * Context used for linking a button to an ActionContext and only look for triggers.\n */\n@Directive({\n selector: '[dbxActionButtonTrigger]',\n standalone: true\n})\nexport class DbxActionButtonTriggerDirective {\n readonly dbxButton = inject(DbxButton, { host: true });\n readonly source = inject(DbxActionContextStoreSourceInstance);\n\n constructor() {\n cleanSubscription(\n this.dbxButton.clicked$.subscribe(() => {\n this._buttonClicked();\n })\n );\n }\n\n protected _buttonClicked(): void {\n this.source.trigger();\n }\n}\n","import { Directive } from '@angular/core';\nimport { DbxActionButtonTriggerDirective } from './action.button.trigger.directive';\nimport { cleanSubscription } from '../../rxjs/subscription';\n\n/**\n * Context used for linking a button to an ActionContext.\n */\n@Directive({\n selector: '[dbxActionButton]',\n standalone: true\n})\nexport class DbxActionButtonDirective extends DbxActionButtonTriggerDirective {\n constructor() {\n super();\n\n cleanSubscription(\n this.source.isWorkingOrWorkProgress$.subscribe((working) => {\n this.dbxButton.setWorking(working);\n })\n );\n\n cleanSubscription(\n this.source.isDisabled$.subscribe((disabled) => {\n this.dbxButton.setDisabled(disabled);\n })\n );\n }\n}\n","import { Directive, inject, input } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { cleanSubscription } from '../../rxjs';\nimport { DbxButton } from '../button';\nimport { DbxRouterService } from '../../router/router/service/router.service';\nimport { type SegueRef } from '../../router/segue';\n\n// MARK: Button Directives\n@Directive({\n selector: '[dbxButtonSegue]',\n standalone: true\n})\nexport class DbxButtonSegueDirective {\n readonly dbxButton = inject(DbxButton);\n readonly dbxRouterService = inject(DbxRouterService);\n\n readonly segueRef = input<Maybe<SegueRef>>(undefined, { alias: 'dbxButtonSegue' });\n\n constructor() {\n cleanSubscription(() =>\n this.dbxButton.clicked$.subscribe(() => {\n const segueRef = this.segueRef();\n\n if (segueRef) {\n this.dbxRouterService.go(segueRef);\n }\n })\n );\n }\n}\n","import { Directive, type Signal, computed, input, output, signal } from '@angular/core';\nimport { isDefinedAndNotFalse, type Maybe } from '@dereekb/util';\nimport { of, Subject, filter, first, switchMap, BehaviorSubject } from 'rxjs';\nimport { cleanSubscription, completeOnDestroy } from '../rxjs';\nimport { type DbxButton, type DbxButtonDisplay, type DbxButtonDisplayType, dbxButtonDisplayType, type DbxButtonInterceptor, type DbxButtonWorking, provideDbxButton } from './button';\nimport { outputToObservable, toObservable } from '@angular/core/rxjs-interop';\n\n/**\n * Abstract button component.\n */\n@Directive()\nexport abstract class AbstractDbxButtonDirective implements DbxButton {\n /**\n * Pre-interceptor button click.\n */\n protected readonly _buttonClick = completeOnDestroy(new Subject<void>());\n protected readonly _buttonInterceptor = completeOnDestroy(new BehaviorSubject<Maybe<DbxButtonInterceptor>>(undefined));\n\n readonly buttonClick = output();\n\n readonly disabled = input<boolean, Maybe<boolean>>(false, { transform: Boolean });\n readonly working = input<DbxButtonWorking, Maybe<DbxButtonWorking>>(false, { transform: (x) => (x == null ? false : x) });\n readonly buttonDisplay = input<Maybe<DbxButtonDisplay>>(undefined);\n\n private readonly _disabledSignal = signal<Maybe<boolean>>(undefined);\n private readonly _workingSignal = signal<Maybe<DbxButtonWorking>>(undefined);\n private readonly _buttonDisplayContentSignal = signal<Maybe<DbxButtonDisplay>>(undefined);\n\n readonly disabledSignal = computed(() => this._disabledSignal() ?? this.disabled());\n readonly workingSignal = computed(() => this._workingSignal() ?? this.working());\n\n readonly isWorkingSignal = computed(() => {\n const working = this.workingSignal();\n return isDefinedAndNotFalse(working);\n });\n\n readonly icon = input<Maybe<string>>();\n readonly text = input<Maybe<string>>();\n\n readonly buttonDisplayContentSignal: Signal<DbxButtonDisplay> = computed(() => {\n const icon = this.icon();\n const text = this.text();\n const buttonDisplay = this.buttonDisplay();\n\n const buttonDisplayContent = this._buttonDisplayContentSignal() ?? buttonDisplay;\n return { icon: icon || buttonDisplayContent?.icon, text: text || buttonDisplayContent?.text };\n });\n\n readonly buttonDisplayTypeSignal: Signal<DbxButtonDisplayType> = computed(() => {\n return dbxButtonDisplayType(this.buttonDisplayContentSignal());\n });\n\n readonly iconSignal: Signal<Maybe<string>> = computed(() => this.buttonDisplayContentSignal()?.icon);\n readonly textSignal: Signal<Maybe<string>> = computed(() => this.buttonDisplayContentSignal()?.text);\n\n readonly disabled$ = toObservable(this.disabledSignal);\n readonly working$ = toObservable(this.workingSignal);\n readonly display$ = toObservable(this.buttonDisplayContentSignal);\n readonly clicked$ = outputToObservable(this.buttonClick);\n\n constructor() {\n cleanSubscription(\n this._buttonClick\n .pipe(\n switchMap(() =>\n this._buttonInterceptor.pipe(\n switchMap((x) => {\n if (x) {\n return x.interceptButtonClick().pipe(first());\n } else {\n return of(true);\n }\n }),\n filter((x) => Boolean(x)) // Ignore false values.\n )\n )\n )\n .subscribe(() => {\n this._forceButtonClicked();\n })\n );\n }\n\n setDisabled(disabled?: Maybe<boolean>): void {\n this._disabledSignal.set(disabled);\n }\n\n setWorking(working?: Maybe<DbxButtonWorking>): void {\n this._workingSignal.set(working);\n }\n\n setDisplayContent(content: DbxButtonDisplay): void {\n this._buttonDisplayContentSignal.set(content);\n }\n\n /**\n * Sets the button interceptor. If any interceptor is already set, it is replaced.\n */\n public setButtonInterceptor(interceptor: DbxButtonInterceptor): void {\n this._buttonInterceptor.next(interceptor);\n }\n\n /**\n * Main function to use for handling clicks on the button.\n */\n public clickButton(): void {\n if (!this.disabled()) {\n this._buttonClick.next();\n }\n }\n\n /**\n * Forces a button click. Skips the interceptors if any are configured.\n */\n protected _forceButtonClicked(): void {\n this.buttonClick.emit();\n }\n}\n\n// MARK: Implementation\n/**\n * Provides an DbxButton directive.\n */\n@Directive({\n selector: '[dbxButton]',\n exportAs: 'dbxButton',\n providers: provideDbxButton(DbxButtonDirective),\n standalone: true\n})\nexport class DbxButtonDirective extends AbstractDbxButtonDirective {}\n","import { Directive, effect, inject, input } from '@angular/core';\nimport { type LoadingContext, type MaybeObservableOrValue, maybeValueFromObservableOrValue } from '@dereekb/rxjs';\nimport { DbxButton } from './button';\nimport { toObservable, toSignal } from '@angular/core/rxjs-interop';\nimport { distinctUntilChanged, shareReplay, type Subscription } from 'rxjs';\nimport { cleanSubscription } from '../rxjs/subscription';\n\n/**\n * Context used for linking a button to a LoadingContext.\n *\n * It will be set working when the context is set loading.\n */\n@Directive({\n selector: '[dbxLoadingButton]',\n standalone: true\n})\nexport class DbxLoadingButtonDirective {\n readonly dbxButton = inject(DbxButton, { host: true });\n readonly context = input.required<MaybeObservableOrValue<LoadingContext>>({ alias: 'dbxLoadingButton' });\n readonly context$ = toObservable(this.context).pipe(maybeValueFromObservableOrValue(), distinctUntilChanged(), shareReplay(1));\n readonly contextSignal = toSignal(this.context$);\n\n protected readonly _loadingEffectSub = cleanSubscription();\n protected readonly _loadingEffect = effect(() => {\n const context = this.contextSignal();\n let subscription: Subscription | undefined;\n\n if (context) {\n subscription = context.stream$.subscribe((x) => this.dbxButton.setWorking(x.loading));\n }\n\n this._loadingEffectSub.setSub(subscription);\n });\n}\n","import { NgModule } from '@angular/core';\nimport { DbxActionButtonTriggerDirective, DbxActionButtonDirective } from './action';\nimport { DbxButtonDirective } from './button.directive';\nimport { DbxLoadingButtonDirective } from './button.loading.directive';\nimport { DbxButtonSegueDirective } from './router/button.segue.directive';\n\nconst importsAndExports = [DbxButtonDirective, DbxLoadingButtonDirective, DbxActionButtonTriggerDirective, DbxActionButtonDirective, DbxButtonSegueDirective];\n\n/**\n * Exports the following directives:\n * - DbxButtonDirective\n * - DbxLoadingButtonDirective\n * - DbxActionButtonTriggerDirective\n * - DbxActionButtonDirective\n * - DbxButtonSegueDirective\n */\n@NgModule({\n imports: importsAndExports,\n exports: importsAndExports\n})\nexport class DbxCoreButtonModule {}\n","import { Injectable, inject } from '@angular/core';\nimport { Store } from '@ngrx/store';\nimport { type DbxAppContextState } from './context';\nimport { onDbxAppContext, fromDbxAppContext } from './state';\nimport { type DbxAppContextFullState } from './state/state';\n\n/**\n * State for accessing the app's DbxAppContextState defined within the DbxAppContextFullState for the ngrx store.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class DbxAppContextService {\n readonly store = inject(Store<DbxAppContextFullState>);\n readonly state$ = this.store.select(fromDbxAppContext.selectDbxAppContextState);\n\n setState(state: DbxAppContextState) {\n this.store.dispatch(onDbxAppContext.DbxAppContextActions.setState({ state }));\n }\n\n resetState() {\n this.store.next(onDbxAppContext.DbxAppContextActions.resetState());\n }\n}\n","import { Directive, effect, inject, input } from '@angular/core';\nimport { DbxAppContextService } from './context.service';\nimport { type DbxAppContextState } from './context';\nimport { type Maybe } from '@dereekb/util';\n\n/**\n * Used to set the DbxAppContextState for an app to the input state using the DbxAppContextService.\n */\n@Directive({\n selector: '[dbxAppContextState]',\n standalone: true\n})\nexport class DbxAppContextStateDirective {\n readonly dbxAppContextStateService = inject(DbxAppContextService);\n\n readonly state = input<Maybe<DbxAppContextState>>(undefined, { alias: 'dbxAppContextState' });\n\n protected readonly _stateEffect = effect(() => {\n const state = this.state();\n\n if (state != null) {\n this.dbxAppContextStateService.setState(state);\n }\n });\n}\n","import { type EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\nimport { provideState } from '@ngrx/store';\nimport { fromDbxAppContext } from './state';\n\n/**\n * Creates EnvironmentProviders for providing the DbxAppContext state.\n *\n * @returns EnvironmentProviders\n */\nexport function provideDbxAppContextState(): EnvironmentProviders {\n return makeEnvironmentProviders([provideState(fromDbxAppContext.featureKey, fromDbxAppContext.reducers)]);\n}\n","/**\n * App environment details\n */\nexport abstract class DbxAppEnviroment {\n /**\n * Whether or not this is a production environment.\n */\n abstract production: boolean;\n /**\n * Whether or not this is a testing environment.\n *\n * Generally \"production\" is false when this is true.\n */\n abstract testing?: boolean;\n /**\n * Whether or not this is a staging environment.\n *\n * Generally \"production\" is true when this is true.\n */\n abstract staging?: boolean;\n}\n","import { Injectable, inject } from '@angular/core';\nimport { DbxAppEnviroment } from './environment';\n\n/**\n * Service for accessing the app's environment details.\n */\n@Injectable()\nexport class DbxAppEnviromentService {\n readonly environment = inject(DbxAppEnviroment);\n\n get isProduction() {\n return this.environment.production === true;\n }\n\n get isStaging() {\n return this.environment.staging ?? false;\n }\n\n get isTesting() {\n return this.environment.testing ?? !this.environment.production;\n }\n\n /**\n * Returns the environment, typed as a specific type.\n */\n getEnvironment<T extends DbxAppEnviroment>(): T {\n return this.environment as T;\n }\n}\n","import { type EnvironmentProviders, makeEnvironmentProviders, type Provider } from '@angular/core';\nimport { DbxAppEnviroment } from './environment';\nimport { DbxAppEnviromentService } from './environment.service';\n\n/**\n * Provides the DbxAppEnviromentService and DbxAppEnviroment.\n *\n * @param environment\n */\nexport function provideDbxAppEnviroment(environment: DbxAppEnviroment): EnvironmentProviders {\n const providers: Provider[] = [\n {\n provide: DbxAppEnviroment,\n useValue: environment\n },\n DbxAppEnviromentService\n ];\n\n return makeEnvironmentProviders(providers);\n}\n","import { type MousableFunction } from './mousable';\nimport { type ClickableFunction, type ClickableUrl } from './clickable';\nimport { type SegueRef } from '../segue';\nimport { expandFlattenTreeFunction, expandTreeFunction, type ExpandTreeFunction, type FlattenTreeFunction, flattenTreeToArrayFunction, type Maybe, type TreeNode } from '@dereekb/util';\nimport { type Type, type Provider, forwardRef } from '@angular/core';\nimport { type Observable } from 'rxjs';\nimport { type DbxInjectionComponentConfig } from '../../injection/injection';\n\nexport interface ClickableAnchor extends ClickableFunction, MousableFunction, ClickableUrl, Partial<SegueRef> {\n readonly disabled?: boolean;\n readonly selected?: boolean;\n}\n\n/**\n * Title and an optional icon.\n */\nexport interface IconAndTitle {\n readonly title: string;\n readonly icon?: Maybe<string>;\n}\n\nexport interface ClickableAnchorLink extends ClickableAnchor, IconAndTitle {\n /**\n * Optional detail string/content.\n */\n readonly hint?: string;\n /**\n * Custom injection content for this link.\n */\n readonly content?: DbxInjectionComponentConfig;\n}\n\n/**\n * ClickableAnchorLink that definitely has a SegueRef\n */\nexport type ClickableAnchorLinkSegueRef = ClickableAnchorLink & SegueRef;\n\nexport interface ClickableIconAnchorLink extends Omit<ClickableAnchorLink, 'title'> {\n readonly icon: string;\n}\n\nexport interface ClickableAnchorLinkTree extends ClickableAnchorLink {\n readonly children?: ClickableAnchorLinkTree[];\n}\n\nexport type ExpandedClickableAnchorLinkTree = TreeNode<ClickableAnchorLinkTree>;\n\nexport const expandClickableAnchorLinkTreeNode: ExpandTreeFunction<ClickableAnchorLinkTree, ExpandedClickableAnchorLinkTree> = expandTreeFunction({\n getChildren: (x) => x.children\n});\n\nexport const flattenExpandedClickableAnchorLinkTree: FlattenTreeFunction<ExpandedClickableAnchorLinkTree, ExpandedClickableAnchorLinkTree> = flattenTreeToArrayFunction();\nexport const flattenExpandedClickableAnchorLinkTreeToLinks: FlattenTreeFunction<ExpandedClickableAnchorLinkTree, ClickableAnchorLinkTree> = flattenTreeToArrayFunction((x) => x.value);\n\n/**\n * Fully expands the given parent link and flattens the tree to a single parent link.\n *\n * @param link\n * @returns\n */\nexport function expandClickableAnchorLinkTree(link: ClickableAnchorLinkTree): ExpandedClickableAnchorLinkTree[] {\n return flattenExpandedClickableAnchorLinkTree(expandClickableAnchorLinkTreeNode(link));\n}\n\n/**\n * Expands an array of links into an array of ExpandedClickableAnchorLinkTree tree values.\n */\nexport const expandClickableAnchorLinkTrees = expandFlattenTreeFunction<ClickableAnchorLinkTree, ExpandedClickableAnchorLinkTree>(expandClickableAnchorLinkTreeNode, flattenExpandedClickableAnchorLinkTree);\n\n/**\n * Describes the Anchor type given a ClickableAnchor.\n *\n * - plain: When the anchor has no specific content but is not disabled. It is a passthrough for the content.\n * - clickable: When the anchor has a click handler\n * - sref: When the anchor has a SegueRef\n * - href: When the anchor has a URL\n * - disabled: When the anchor is disabled.\n */\nexport type ClickableAnchorType = 'plain' | 'clickable' | 'sref' | 'href' | 'disabled';\n\nexport function anchorTypeForAnchor(anchor: Maybe<ClickableAnchor>, disabled?: Maybe<boolean>): ClickableAnchorType {\n let type: ClickableAnchorType = 'disabled';\n\n if (!disabled && anchor) {\n if (anchor.disabled) {\n type = 'disabled';\n } else if (anchor.ref) {\n type = 'sref';\n } else if (anchor.onClick) {\n type = 'clickable';\n } else if (anchor.url) {\n type = 'href';\n } else {\n type = 'plain';\n }\n }\n\n return type;\n}\n\nexport abstract class DbxAnchor<T extends ClickableAnchor = ClickableAnchor> {\n abstract readonly disabled$: Observable<Maybe<boolean>>;\n abstract readonly selected$: Observable<Maybe<boolean>>;\n abstract readonly anchor$: Observable<Maybe<T>>;\n abstract readonly type$: Observable<ClickableAnchorType>;\n}\n\nexport function provideDbxAnchor<S extends DbxAnchor>(sourceType: Type<S>): Provider[] {\n return [\n {\n provide: DbxAnchor,\n useExisting: forwardRef(() => sourceType)\n }\n ];\n}\n","import { type Observable } from 'rxjs';\nimport { computed, Directive, model } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { type ClickableAnchorType, type ClickableAnchor, anchorTypeForAnchor, type DbxAnchor } from './anchor';\nimport { type SegueRefOrSegueRefRouterLink, asSegueRef } from '../segue';\nimport { toObservable } from '@angular/core/rxjs-interop';\n\n/**\n * Abstract anchor directive.\n */\n@Directive()\nexport class AbstractDbxAnchorDirective<T extends ClickableAnchor = ClickableAnchor> implements DbxAnchor {\n readonly ref = model<Maybe<SegueRefOrSegueRefRouterLink>>();\n\n readonly anchor = model<Maybe<T>>();\n readonly disabled = model<Maybe<boolean>>();\n readonly selected = model<Maybe<boolean>>();\n\n readonly anchorSignal = computed(() => {\n const ref = this.ref();\n const anchor = this.anchor();\n\n let result: Maybe<T> = anchor;\n\n if (ref != null) {\n result = asSegueRef(ref) as T;\n }\n\n return result;\n });\n\n readonly selectedSignal = computed(() => {\n const selected = this.selected();\n const anchor = this.anchorSignal();\n\n return selected || anchor?.selected;\n });\n\n readonly typeSignal = computed(() => {\n const anchor = this.anchorSignal();\n const disabled = this.disabled();\n return anchorTypeForAnchor(anchor, disabled);\n });\n\n readonly disabledSignal = computed(() => {\n const disabled = this.disabled();\n const anchor = this.anchorSignal();\n\n return disabled || anchor?.disabled;\n });\n\n readonly urlSignal = computed(() => this.anchorSignal()?.url);\n readonly targetSignal = computed(() => this.anchorSignal()?.target);\n\n readonly anchor$: Observable<Maybe<T>> = toObservable(this.anchorSignal);\n readonly disabled$: Observable<Maybe<boolean>> = toObservable(this.disabledSignal);\n readonly selected$: Observable<Maybe<boolean>> = toObservable(this.selectedSignal);\n readonly type$: Observable<ClickableAnchorType> = toObservable(this.typeSignal);\n\n // MARK: Accessors\n setRef(ref: Maybe<SegueRefOrSegueRefRouterLink>) {\n this.ref.set(ref);\n }\n\n setAnchor(anchor: Maybe<T>) {\n this.anchor.set(anchor);\n }\n\n setDisabled(disabled: Maybe<boolean>) {\n this.disabled.set(disabled);\n }\n\n setSelected(selected: Maybe<boolean>) {\n this.selected.set(selected);\n }\n}\n","import { type E164PhoneNumberWithOptionalExtension, type MailToUrlInput, mailToUrlString, type Maybe, type PhoneNumber, telUrlString, type WebsiteUrl } from '@dereekb/util';\n\nexport interface ClickableFunction {\n readonly onClick?: (event?: Maybe<MouseEvent>) => void;\n}\n\n/**\n * Represents a clickable href/url configuration.\n */\nexport interface ClickableUrl {\n /**\n * href url\n */\n readonly url?: string;\n /**\n * href target attribute.\n */\n readonly target?: string;\n}\n\nexport function clickableUrlInNewTab(url: string | WebsiteUrl): ClickableUrl {\n return {\n url,\n target: '_blank'\n };\n}\n\nexport function clickableUrlMailTo(mailTo: MailToUrlInput): ClickableUrl {\n return {\n url: mailToUrlString(mailTo)\n };\n}\n\nexport function clickableUrlTel(tel: PhoneNumber | E164PhoneNumberWithOptionalExtension): ClickableUrl {\n return {\n url: telUrlString(tel)\n };\n}\n","import { DbxAuthService } from '../../../auth/service/auth.service';\nimport { type TransitionService, type TransitionHookFn, type Transition, type HookResult, type StateService, type HookMatchCriteria } from '@uirouter/core';\nimport { type Maybe, type ModelKey } from '@dereekb/util';\nimport { map, first, switchMap, firstValueFrom, type Observable, of } from 'rxjs';\nimport { type Injector } from '@angular/core';\n\nexport const DEFAULT_REDIRECT_FOR_IDENTIFIER_PARAM_VALUE = '0';\nexport const DEFAULT_REDIRECT_FOR_IDENTIFIER_PARAM_KEY = 'id';\n\nexport interface RedirectForIdentifierParamHookInput {\n /**\n * Factory that returns an observable that sends the default allowed identifier to use when accessing the resource.\n */\n readonly defaultAllowedValue: (authService: DbxAuthService, injector: Injector, transition: Transition) => Observable<ModelKey>;\n /**\n * Route parameter to use.\n *\n * Defaults to \"uid\"\n */\n readonly idParam?: string;\n /**\n * The default param value to check against.\n *\n * Defaults to 0.\n */\n readonly defaultParamValue?: string;\n /**\n * Criteria or route to watch and intercept.\n */\n readonly criteria: HookMatchCriteria | string;\n readonly transitionService: TransitionService;\n /**\n * Whether or not the current user can view the target id.\n *\n * Can return another identifier, or true to allow access, or false/null/undefined to deny access.\n */\n readonly canViewModelWithId: (targetId: ModelKey, authService: DbxAuthService, injector: Injector) => Observable<Maybe<boolean | ModelKey>>;\n /**\n * Hook priority\n */\n readonly priority?: number;\n}\n\n/**\n * This hook asserts the user is allowed to view a route with an identifier as a state parameter.\n */\nexport function redirectForIdentifierParamHook(input: RedirectForIdentifierParamHookInput): void {\n const { defaultAllowedValue, idParam = DEFAULT_REDIRECT_FOR_IDENTIFIER_PARAM_KEY, defaultParamValue = DEFAULT_REDIRECT_FOR_IDENTIFIER_PARAM_VALUE, priority = 100, transitionService, canViewModelWithId: canViewUser } = input;\n const criteria: HookMatchCriteria = typeof input.criteria === 'string' ? { entering: input.criteria } : input.criteria;\n\n // https://ui-router.github.io/ng2/docs/latest/modules/transition.html#hookresult\n const assertAllowedId: TransitionHookFn = (transition: Transition): HookResult => {\n const $state: StateService = transition.router.stateService;\n const injector = transition.injector();\n const authService: DbxAuthService = injector.get(DbxAuthService);\n const params = transition.params();\n\n const transitionTargetId: Maybe<string> = params[idParam];\n const defaultAllowedValueObs$ = defaultAllowedValue(authService, injector, transition);\n\n return firstValueFrom(\n defaultAllowedValueObs$.pipe(\n first(),\n switchMap((defaultAllowedIdValue) => {\n let result: Observable<HookResult> = of(true);\n\n let redirectToId: Maybe<Observable<Maybe<ModelKey>>>;\n\n if (!transitionTargetId || transitionTargetId === defaultParamValue) {\n // If the param isn't set, default to the default value\n redirectToId = of(defaultAllowedIdValue);\n } else if (defaultAllowedIdValue !== transitionTargetId) {\n redirectToId = canViewUser(transitionTargetId, authService, injector).pipe(\n map((x) => {\n if (x == null || typeof x === 'boolean') {\n return x ? transitionTargetId : defaultAllowedIdValue;\n } else {\n return x;\n }\n })\n );\n }\n\n if (redirectToId != null) {\n result = redirectToId.pipe(\n first(),\n map((targetId) => {\n if (targetId !== transitionTargetId) {\n const target = transition.targetState();\n const state = target.state();\n return $state.target(state, { ...params, [idParam]: targetId }, { location: true });\n } else {\n return true;\n }\n })\n );\n }\n\n return result;\n })\n )\n ) as HookResult;\n };\n\n // Register the \"requires auth\" hook with the TransitionsService\n transitionService.onBefore(criteria, assertAllowedId, { priority });\n}\n","import { type AuthUserIdentifier } from '../../../auth/auth.user';\nimport { type DbxAuthService } from '../../../auth/service/auth.service';\nimport { type TransitionService, type HookMatchCriteria } from '@uirouter/core';\nimport { type Maybe } from '@dereekb/util';\nimport { type Observable } from 'rxjs';\nimport { type Injector } from '@angular/core';\nimport { redirectForIdentifierParamHook } from './id.hook';\n\nexport const DEFAULT_REDIRECT_FOR_USER_IDENTIFIER_PARAM_VALUE = '0';\nexport const DEFAULT_REDIRECT_FOR_USER_IDENTIFIER_PARAM_KEY = 'uid';\n\nexport interface RedirectForUserIdentifierParamHookInput {\n /**\n * Route parameter to use.\n *\n * Defaults to \"uid\"\n */\n readonly uidParam?: string;\n /**\n * The default param value to check against.\n *\n * Defaults to 0.\n */\n readonly defaultParamValue?: string;\n /**\n * Criteria or route to watch and intercept.\n */\n readonly criteria: HookMatchCriteria | string;\n readonly transitionService: TransitionService;\n /**\n * Whether or not the current user can view the target user.\n *\n * Can return another users identifier, or true to allow access, or false/null/undefined to deny access.\n */\n readonly canViewUser: (targetUid: AuthUserIdentifier, authService: DbxAuthService, injector: Injector) => Observable<Maybe<boolean | AuthUserIdentifier>>;\n /**\n * Hook priority\n */\n readonly priority?: number;\n}\n\n/**\n * This hook asserts the user is allowed to view a route with a user identifier as a parameter.\n */\nexport function redirectForUserIdentifierParamHook(input: RedirectForUserIdentifierParamHookInput): void {\n const { uidParam = DEFAULT_REDIRECT_FOR_USER_IDENTIFIER_PARAM_KEY, defaultParamValue = DEFAULT_REDIRECT_FOR_USER_IDENTIFIER_PARAM_VALUE, criteria, priority = 100, transitionService, canViewUser } = input;\n\n return redirectForIdentifierParamHook({\n defaultAllowedValue: (authService: DbxAuthService) => authService.userIdentifier$,\n idParam: uidParam,\n defaultParamValue,\n criteria,\n transitionService,\n canViewModelWithId: canViewUser,\n priority\n });\n}\n","export enum DbxRouterTransitionEventType {\n /**\n * A transition started.\n */\n START = 'start',\n /**\n * A transition ended.\n */\n SUCCESS = 'success'\n}\n\nexport interface DbxRouterTransitionEvent {\n type: DbxRouterTransitionEventType;\n}\n","import { map, type Observable, combineLatest, firstValueFrom } from 'rxjs';\nimport { asObservable, filterMaybe, type ObservableOrValue } from '@dereekb/rxjs';\nimport { type DbxRouterService } from '../../service/router.service';\nimport { type DbxRouterTransitionService } from '../../service/router.transition.service';\nimport { asSegueRef, type SegueRef, type SegueRefOrSegueRefRouterLink, type SegueRefRawSegueParams } from '../../../segue';\nimport { type DbxRouterTransitionEvent, DbxRouterTransitionEventType } from '../../transition/transition';\nimport { ActivatedRoute, type NavigationBehaviorOptions, NavigationEnd, type NavigationExtras, NavigationStart, Router, type UrlTree } from '@angular/router';\nimport { Injectable, inject } from '@angular/core';\nimport { KeyValueTypleValueFilter, type Maybe, mergeObjects } from '@dereekb/util';\n\n/**\n * AngularRouter implementation of DbxRouterService and DbxRouterTransitionService.\n */\n@Injectable()\nexport class DbxAngularRouterService implements DbxRouterService, DbxRouterTransitionService {\n readonly router = inject(Router);\n readonly activatedRoute = inject(ActivatedRoute);\n\n readonly params$: Observable<SegueRefRawSegueParams> = this.activatedRoute.params;\n\n readonly transitions$ = this.router.events.pipe(\n map((x) => {\n let event: Maybe<DbxRouterTransitionEvent>;\n\n if (x instanceof NavigationStart) {\n event = {\n type: DbxRouterTransitionEventType.START\n };\n } else if (x instanceof NavigationEnd) {\n event = {\n type: DbxRouterTransitionEventType.SUCCESS\n };\n }\n\n return event;\n }),\n filterMaybe()\n );\n\n go(input: ObservableOrValue<SegueRefOrSegueRefRouterLink<NavigationExtras | NavigationBehaviorOptions>>): Promise<boolean> {\n const inputObs = asObservable(input);\n return firstValueFrom(inputObs).then((inputSegueRef) => {\n const segueRef = asSegueRef(inputSegueRef);\n const ref = segueRef.ref;\n\n if (Array.isArray(ref)) {\n return this.router.navigate(ref as unknown[], {\n ...segueRef.refOptions,\n queryParams: segueRef.refParams\n });\n } else {\n return this.router.navigateByUrl(ref as string | UrlTree, {\n ...segueRef.refOptions\n });\n }\n });\n }\n\n updateParams(inputParams: ObservableOrValue<SegueRefRawSegueParams>): Promise<boolean> {\n const segueUpdate: Observable<SegueRefOrSegueRefRouterLink<NavigationExtras | NavigationBehaviorOptions>> = combineLatest([this.activatedRoute.params, asObservable(inputParams)]).pipe(\n map(([currentParams, params]) => {\n const refParams = mergeObjects([currentParams, params], KeyValueTypleValueFilter.UNDEFINED);\n const segueRef: SegueRef<NavigationExtras | NavigationBehaviorOptions> = {\n ref: this.activatedRoute.pathFromRoot,\n refParams,\n refOptions: {\n replaceUrl: true\n }\n };\n\n return segueRef;\n })\n );\n\n return this.go(segueUpdate);\n }\n\n isActive(segueRef: SegueRefOrSegueRefRouterLink): boolean {\n return false; // TODO!\n }\n\n isActiveExactly(segueRef: SegueRefOrSegueRefRouterLink): boolean {\n return false; // TODO!\n }\n\n comparePrecision(a: SegueRefOrSegueRefRouterLink, b: SegueRefOrSegueRefRouterLink): number {\n return 0; // TODO!\n }\n}\n","import { type ModuleWithProviders, NgModule } from '@angular/core';\nimport { DbxRouterService } from '../../service/router.service';\nimport { DbxRouterTransitionService } from '../../service/router.transition.service';\nimport { DbxAngularRouterService } from './angular.router.service';\n\n@NgModule({})\nexport class DbxCoreAngularRouterSegueModule {\n static forRoot(): ModuleWithProviders<DbxCoreAngularRouterSegueModule> {\n return {\n ngModule: DbxCoreAngularRouterSegueModule,\n providers: [\n DbxAngularRouterService,\n {\n provide: DbxRouterService,\n useExisting: DbxAngularRouterService\n },\n {\n provide: DbxRouterTransitionService,\n useExisting: DbxAngularRouterService\n }\n ]\n };\n }\n}\n","import { KeyValueTypleValueFilter, mergeObjects } from '@dereekb/util';\nimport { Subject, BehaviorSubject, type Observable, firstValueFrom, map } from 'rxjs';\nimport { type DbxRouterService } from '../../service/router.service';\nimport { type DbxRouterTransitionService } from '../../service/router.transition.service';\nimport { asSegueRef, asSegueRefString, type SegueRef, type SegueRefOrSegueRefRouterLink, type SegueRefRawSegueParams } from '../../../segue';\nimport { StateService, UIRouterGlobals, type TransitionOptions, TransitionService } from '@uirouter/core';\nimport { Injectable, type OnDestroy, inject } from '@angular/core';\nimport { type DbxRouterTransitionEvent, DbxRouterTransitionEventType } from '../../transition/transition';\nimport { type ObservableOrValue, asObservable } from '@dereekb/rxjs';\n\n/**\n * UIRouter implementation of DbxRouterService and DbxRouterTransitionService.\n */\n@Injectable()\nexport class DbxUIRouterService implements DbxRouterService, DbxRouterTransitionService, OnDestroy {\n readonly state = inject(StateService);\n readonly transitionService = inject(TransitionService);\n readonly uiRouterGlobals = inject(UIRouterGlobals);\n\n private readonly _params = new BehaviorSubject<SegueRefRawSegueParams>(this.uiRouterGlobals.params);\n\n readonly params$ = this._params.asObservable();\n\n private readonly _transitions = new Subject<DbxRouterTransitionEvent>();\n readonly transitions$ = this._transitions.asObservable();\n\n constructor() {\n const emitTransition = (type: DbxRouterTransitionEventType) => {\n this._transitions.next({\n type\n });\n\n this._params.next(this.uiRouterGlobals.params);\n };\n\n this.transitionService.onStart({}, () => {\n emitTransition(DbxRouterTransitionEventType.START);\n });\n\n this.transitionService.onSuccess({}, () => {\n emitTransition(DbxRouterTransitionEventType.SUCCESS);\n });\n }\n\n ngOnDestroy(): void {\n this._transitions.complete();\n }\n\n get params() {\n return this.uiRouterGlobals.params;\n }\n\n go(input: ObservableOrValue<SegueRefOrSegueRefRouterLink<TransitionOptions>>): Promise<boolean> {\n const inputObs = asObservable(input);\n return firstValueFrom(inputObs).then((inputSegueRef) => {\n const segueRef = asSegueRef(inputSegueRef);\n const params = { ...this.uiRouterGlobals.current.params, ...segueRef.refParams };\n return this.state\n .go(segueRef.ref as string, params, segueRef.refOptions)\n .then(() => true)\n .catch(() => false);\n });\n }\n\n updateParams(inputParams: ObservableOrValue<SegueRefRawSegueParams>): Promise<boolean> {\n const segueUpdate: Observable<SegueRefOrSegueRefRouterLink<TransitionOptions>> = asObservable(inputParams).pipe(\n map((params) => {\n const currentParams = this.uiRouterGlobals.params;\n const refParams = mergeObjects([currentParams, params], KeyValueTypleValueFilter.UNDEFINED);\n\n const ref: SegueRef<TransitionOptions> = {\n ref: '.',\n refParams,\n refOptions: {\n location: 'replace',\n inherit: true\n }\n };\n\n return ref;\n })\n );\n\n return this.go(segueUpdate);\n }\n\n isActive(input: SegueRefOrSegueRefRouterLink): boolean {\n return this.isActiveState(input, false);\n }\n\n isActiveExactly(input: SegueRefOrSegueRefRouterLink): boolean {\n return this.isActiveState(input, true);\n }\n\n comparePrecision(aInput: SegueRefOrSegueRefRouterLink, bInput: SegueRefOrSegueRefRouterLink): number {\n const aRef = asSegueRefString(aInput);\n const bRef = asSegueRefString(bInput);\n\n const aLength = aRef.length;\n const bLength = bRef.length;\n return aLength > bLength ? 1 : aLength === bLength ? 0 : -1;\n }\n\n // MARK: Internal\n isActiveState(input: SegueRefOrSegueRefRouterLink, exactly: boolean): boolean {\n const segueRef = asSegueRef(input);\n const ref = segueRef.ref as string;\n const refParams = segueRef.refParams;\n\n const targetRef = ref.startsWith('.') ? `^${ref}` : ref;\n const active = exactly ? this.state.is(targetRef, refParams) : this.state.includes(targetRef, refParams);\n return active;\n }\n}\n","import { DbxRouterService } from '../../service/router.service';\nimport { DbxRouterTransitionService } from '../../service/router.transition.service';\nimport { type EnvironmentProviders, makeEnvironmentProviders, type Provider } from '@angular/core';\nimport { DbxUIRouterService } from './uirouter.router.service';\n\n/**\n * Provides a DbxUIRouterService and configures it to provide for DbxRouterService and DbxRouterTransitionService.\n *\n * @returns EnvironmentProviders\n */\nexport function provideDbxUIRouterService(): EnvironmentProviders {\n const providers: Provider[] = [\n DbxUIRouterService,\n {\n provide: DbxRouterService,\n useExisting: DbxUIRouterService\n },\n {\n provide: DbxRouterTransitionService,\n useExisting: DbxUIRouterService\n }\n ];\n\n return makeEnvironmentProviders(providers);\n}\n","import { distinctUntilKeysChange } from '@dereekb/rxjs';\nimport { type ArrayOrValue, asArray, filterMaybeArrayValues, type IndexRef } from '@dereekb/util';\nimport { filter, map, type MonoTypeOperatorFunction, type Observable, distinctUntilChanged, shareReplay, startWith } from 'rxjs';\nimport { type SegueRefOrSegueRefRouterLink } from '../../segue';\nimport { type DbxRouterService } from '../service/router.service';\nimport { type DbxRouterTransitionService } from '../service/router.transition.service';\nimport { type DbxRouterTransitionEvent, DbxRouterTransitionEventType } from './transition';\n\n/**\n * Convenience function for filtering success from the input observable.\n *\n * @param obs\n * @returns\n */\nexport function successTransition(obs: Observable<DbxRouterTransitionEvent>): Observable<DbxRouterTransitionEvent> {\n return obs.pipe(filterTransitionSuccess());\n}\n\nexport function filterTransitionSuccess(): MonoTypeOperatorFunction<DbxRouterTransitionEvent> {\n return filterTransitionEvent(DbxRouterTransitionEventType.SUCCESS);\n}\n\nexport function filterTransitionEvent(type: DbxRouterTransitionEventType): MonoTypeOperatorFunction<DbxRouterTransitionEvent> {\n return filter((x) => x.type === type);\n}\n// MARK: LatestSuccessfulRoutesConfig\nexport interface LatestSuccessfulRoutesConfigRoute {\n /**\n * Route to check if it is active or not.\n */\n readonly route: SegueRefOrSegueRefRouterLink;\n /**\n * Whether or not to match the route exactly.\n */\n readonly activeExactly?: boolean;\n}\n\ninterface LatestSuccessfulRoutesConfigRouteItem<T> extends IndexRef {\n readonly r: T;\n}\n\n/**\n * latestSuccessfulRoute() config\n */\nexport interface LatestSuccessfulRoutesConfig<T extends LatestSuccessfulRoutesConfigRoute> {\n readonly dbxRouterTransitionService: DbxRouterTransitionService;\n readonly dbxRouterService: DbxRouterService;\n /**\n * Route or list of routes to check if they're active or not.\n */\n readonly routes: ArrayOrValue<T>;\n}\n\n/**\n * Creates a new observable that uses the input DbxRouterTransitionService and DbxRouterService to determine whether or not any of the configured routes are active.\n *\n * @param obs\n * @param config\n * @returns\n */\nexport function latestSuccessfulRoutes<T extends LatestSuccessfulRoutesConfigRoute>(config: LatestSuccessfulRoutesConfig<T>): Observable<T[]> {\n const { dbxRouterTransitionService, dbxRouterService, routes: inputRoutes } = config;\n const routes: LatestSuccessfulRoutesConfigRouteItem<T>[] = asArray(inputRoutes).map((r, i) => ({ r, i }));\n const checkRoutes: (() => LatestSuccessfulRoutesConfigRouteItem<T> | undefined)[] = routes.map((routeConfig) => {\n const { r: route } = routeConfig;\n return route.activeExactly ? () => (dbxRouterService.isActiveExactly(route.route) ? routeConfig : undefined) : () => (dbxRouterService.isActive(route.route) ? routeConfig : undefined);\n });\n\n return successTransition(dbxRouterTransitionService.transitions$).pipe(\n startWith(undefined),\n map(() => {\n const activeRoutes: LatestSuccessfulRoutesConfigRouteItem<T>[] = filterMaybeArrayValues(checkRoutes.map((x) => x()));\n return activeRoutes;\n }),\n distinctUntilKeysChange((x) => x.i),\n map((x) => x.map((y) => y.r)),\n shareReplay(1)\n );\n}\n\n// MARK: IsLatestSuccessfulRouteConfig\n/**\n * isLatestSuccessfulRoute() config\n */\nexport interface IsLatestSuccessfulRouteConfig {\n readonly dbxRouterTransitionService: DbxRouterTransitionService;\n readonly dbxRouterService: DbxRouterService;\n /**\n * Route or list of routes to check if they're active or not.\n */\n readonly routes: ArrayOrValue<SegueRefOrSegueRefRouterLink>;\n /**\n * Whether or not to match route activity exactly.\n */\n readonly activeExactly?: boolean;\n}\n\n/**\n * Creates a new observable that uses the input DbxRouterTransitionService and DbxRouterService to determine whether or not any of the configured routes are active.\n *\n * @param obs\n * @param config\n * @returns\n */\nexport function isLatestSuccessfulRoute(config: IsLatestSuccessfulRouteConfig): Observable<boolean> {\n const { dbxRouterTransitionService, dbxRouterService, activeExactly } = config;\n const routes = asArray(config.routes);\n const checkRoute: (route: SegueRefOrSegueRefRouterLink) => boolean = activeExactly ? (route: SegueRefOrSegueRefRouterLink) => dbxRouterService.isActiveExactly(route) : (route: SegueRefOrSegueRefRouterLink) => dbxRouterService.isActive(route);\n\n return successTransition(dbxRouterTransitionService.transitions$).pipe(\n startWith(undefined),\n map(() => {\n const isActive = routes.findIndex(checkRoute) !== -1;\n return isActive;\n }),\n distinctUntilChanged(),\n shareReplay(1)\n );\n}\n","import { type Observable, startWith } from 'rxjs';\nimport { Directive, inject } from '@angular/core';\nimport { DbxRouterTransitionService } from '../service/router.transition.service';\nimport { successTransition } from './transition.rxjs';\n\n/**\n * Abstract directive that listens to onSuccess transition events and runs a function.\n */\n@Directive()\nexport abstract class AbstractTransitionDirective {\n protected readonly dbxRouterTransitionService = inject(DbxRouterTransitionService);\n\n readonly transitionSuccess$ = successTransition(this.dbxRouterTransitionService.transitions$);\n readonly initAndUpdateOnTransitionSuccess$: Observable<void> = this.transitionSuccess$.pipe(startWith(undefined)) as Observable<void>;\n}\n","import { Directive, NgZone, inject } from '@angular/core';\nimport { AbstractTransitionDirective } from './transition.directive';\nimport { cleanSubscription } from '../../../rxjs/subscription';\n\n/**\n * Abstract directive that listens to onSuccess transition events and runs a function.\n */\n@Directive()\nexport abstract class AbstractTransitionWatcherDirective extends AbstractTransitionDirective {\n protected readonly ngZone = inject(NgZone);\n\n constructor() {\n super();\n\n cleanSubscription(\n this.transitionSuccess$.subscribe(() => {\n this.updateForSuccessfulTransition();\n })\n );\n }\n\n // MARK: Action\n protected zoneUpdateForSuccessfulTransition(): void {\n // TODO: NgZone Deprecation\n // remove this function and replace, if necessary or remove entirely with angular zoneless implementation details.\n this.ngZone.run(() => this.updateForSuccessfulTransition());\n }\n\n protected abstract updateForSuccessfulTransition(): void;\n}\n","import { type Building } from '@dereekb/util';\nimport { type SegueRefOrSegueRefRouterLink } from '../../segue';\nimport { type DbxRouterService } from './router.service';\n\n/**\n * Function that returns true when the configured segueRef is active.\n */\nexport type IsSegueRefActiveFunction = (() => boolean) & {\n readonly _segueRef: SegueRefOrSegueRefRouterLink;\n readonly _activeExactly: boolean;\n};\n\nexport interface IsSegueRefActiveFunctionConfig {\n readonly dbxRouterService: DbxRouterService;\n readonly segueRef: SegueRefOrSegueRefRouterLink;\n /**\n * Whether or not to match the route exactly.\n *\n * False by default.\n */\n readonly activeExactly?: boolean;\n}\n\n/**\n * Creates an IsSegueRefActiveFunction\n *\n * @param config\n * @returns\n */\nexport function isSegueRefActiveFunction(config: IsSegueRefActiveFunctionConfig): IsSegueRefActiveFunction {\n const { dbxRouterService, segueRef, activeExactly = false } = config;\n const result = (activeExactly ? () => dbxRouterService.isActiveExactly(segueRef) : () => dbxRouterService.isActive(segueRef)) as Building<IsSegueRefActiveFunction>;\n\n result._segueRef = segueRef;\n result._activeExactly = activeExactly;\n\n return result as IsSegueRefActiveFunction;\n}\n","import { type Maybe } from '@dereekb/util';\nimport { filter, map, type Observable, of, type OperatorFunction, switchMap, startWith } from 'rxjs';\nimport { type SegueRefOrSegueRefRouterLink } from '../../segue';\nimport { type DbxRouterTransitionEvent, DbxRouterTransitionEventType } from '../transition';\nimport { isSegueRefActiveFunction, type IsSegueRefActiveFunctionConfig } from './router.service.util';\n\n// MARK: Transition Events\nexport function onRouterTransitionEventType(events$: Observable<DbxRouterTransitionEvent>, type: DbxRouterTransitionEventType): Observable<DbxRouterTransitionEvent> {\n return events$.pipe(filter((x) => x.type === type));\n}\n\nexport function onRouterTransitionSuccessEvent(events$: Observable<DbxRouterTransitionEvent>): Observable<DbxRouterTransitionEvent> {\n return onRouterTransitionEventType(events$, DbxRouterTransitionEventType.SUCCESS);\n}\n\n// MARK: Router Service\n/**\n * Creates an observable that returns true when the route for the input segueRef is active.\n *\n * @param dbxRouterService\n * @param segueRef\n */\nexport function isSegueRefActiveOnTransitionSuccess(config: IsSegueRefActiveFunctionConfig): Observable<boolean> {\n const isActiveFn = isSegueRefActiveFunction(config);\n return onRouterTransitionSuccessEvent(config.dbxRouterService.transitions$).pipe(\n startWith(undefined),\n map(() => isActiveFn())\n );\n}\n\nexport interface IsSegueRefActiveConfig extends Pick<IsSegueRefActiveFunctionConfig, 'dbxRouterService' | 'activeExactly'> {\n /**\n * What to pipe if the input segueRef is null.\n */\n readonly defaultIfNull?: boolean;\n}\n\n/**\n * Operator function that maps the input segueRef to a boolean depending on the current route state.\n *\n * @param dbxRouterService\n * @param segueRef\n */\nexport function isSegueRefActive(config: IsSegueRefActiveConfig): OperatorFunction<Maybe<SegueRefOrSegueRefRouterLink>, boolean> {\n const { defaultIfNull = false } = config;\n\n return switchMap((segueRef) => {\n if (segueRef) {\n return isSegueRefActiveOnTransitionSuccess({ ...config, segueRef });\n } else {\n return of(defaultIfNull);\n }\n });\n}\n","import { type ObservableOrValueGetter, type MaybeObservableOrValueGetter, switchMapToDefault, maybeValueFromObservableOrValueGetter, asObservableFromGetter } from '@dereekb/rxjs';\nimport { type Destroyable, type Maybe } from '@dereekb/util';\nimport { BehaviorSubject, combineLatest, distinctUntilChanged, first, map, type Observable, shareReplay } from 'rxjs';\nimport { type DbxRouterService } from '../service/router.service';\n\n/**\n * Interface used for reading a single value from the DbxRouterService. Supports a default value.\n */\nexport interface DbxRouteParamReader<T> {\n /**\n * The param value as read from the current router state.\n */\n readonly paramValue$: Observable<Maybe<T>>;\n\n /**\n * The default value observable.\n */\n readonly defaultValue$: Observable<Maybe<T>>;\n\n /**\n * The current value given the paramValue and the defaultValue.\n */\n readonly value$: Observable<Maybe<T>>;\n\n /**\n * Returns the current param key.\n */\n getParamKey(): string;\n\n /**\n * Sets a new param key. If the value is undefined, the param reader will use the default key.\n */\n setParamKey(paramKey: Maybe<string>): void;\n\n /**\n * Sets the default value source.\n *\n * @param defaultValue\n */\n setDefaultValue(defaultValue: MaybeObservableOrValueGetter<T>): void;\n\n /**\n * Updates the value on the current route for the paramKey.\n *\n * @param value\n */\n setParamValue(value: MaybeObservableOrValueGetter<T>): void;\n}\n\nexport interface DbxRouteParamReaderInstance<T> extends DbxRouteParamReader<T>, Destroyable {\n readonly dbxRouterService: DbxRouterService;\n readonly paramKey$: Observable<string>;\n readonly nextDefaultValue$: Observable<Maybe<T>>;\n readonly value$: Observable<Maybe<T>>;\n}\n\n/**\n * Creates a new DbxRouteParamReaderInstance from the input.\n *\n * @param dbxRouterService\n * @param defaultParamKey\n * @param defaultValue\n * @returns\n */\nexport function dbxRouteParamReaderInstance<T>(dbxRouterService: DbxRouterService, defaultParamKey: string, defaultValue?: MaybeObservableOrValueGetter<T>): DbxRouteParamReaderInstance<T> {\n const _paramKey = new BehaviorSubject<string>(defaultParamKey);\n const _defaultValue = new BehaviorSubject<Maybe<ObservableOrValueGetter<Maybe<T>>>>(defaultValue);\n\n const paramKey$ = _paramKey.asObservable();\n\n const paramValue$ = combineLatest([paramKey$, dbxRouterService.params$]).pipe(\n map(([key, params]) => (params[key] as Maybe<T>) ?? undefined),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n const nextDefaultValue$ = _defaultValue.pipe(maybeValueFromObservableOrValueGetter(), shareReplay(1));\n const defaultValue$ = _defaultValue.pipe(maybeValueFromObservableOrValueGetter(), shareReplay(1));\n const value$ = paramValue$.pipe(switchMapToDefault(defaultValue$), shareReplay(1));\n\n const result: DbxRouteParamReaderInstance<T> = {\n dbxRouterService,\n\n paramKey$,\n paramValue$,\n nextDefaultValue$,\n defaultValue$,\n value$,\n\n destroy() {\n _paramKey.complete();\n _defaultValue.complete();\n },\n\n getParamKey(): string {\n return _paramKey.value;\n },\n\n setParamKey(paramKey: Maybe<string>) {\n _paramKey.next(paramKey || defaultParamKey);\n },\n\n setDefaultValue(newValue: MaybeObservableOrValueGetter<T>) {\n _defaultValue.next(newValue ?? defaultValue);\n },\n\n setParamValue(value: MaybeObservableOrValueGetter<T>) {\n combineLatest([paramKey$, asObservableFromGetter(value)])\n .pipe(first())\n .subscribe(([paramKey, value]) => dbxRouterService.updateParams({ [paramKey]: value }));\n }\n };\n\n return result;\n}\n","import { BehaviorSubject, EMPTY, switchMap, of } from 'rxjs';\nimport { type DbxRouteParamReaderInstance } from './route.reader';\nimport { type Destroyable, type Initialized, type Maybe, type DefaultForwardFunctionFactory, defaultForwardFunctionFactory } from '@dereekb/util';\nimport { SubscriptionObject, switchMapToDefault, type SwitchMapToDefaultFilterFunction, filterMaybe } from '@dereekb/rxjs';\n\nconst DEFAULT_REDIRECT_INSTANCE_FORWARD_FACTORY = defaultForwardFunctionFactory<SwitchMapToDefaultFilterFunction<unknown>>((value) => of(value == null));\n\n/**\n * Utility class used in conjuction with a DbxRouteParamReaderInstance to redirect when the default param is not valid.\n */\nexport class DbxRouteParamDefaultRedirectInstance<T> implements Initialized, Destroyable {\n private readonly instance: DbxRouteParamReaderInstance<T>;\n\n private readonly _enabled = new BehaviorSubject<boolean>(true);\n private readonly _useDefaultFilter = new BehaviorSubject<Maybe<SwitchMapToDefaultFilterFunction<T>>>(undefined);\n private readonly _sub = new SubscriptionObject();\n\n constructor(instance: DbxRouteParamReaderInstance<T>) {\n this.instance = instance;\n }\n\n init(): void {\n this._sub.subscription = this._enabled\n .pipe(\n switchMap((enabled) => {\n if (enabled) {\n return this.instance.paramValue$.pipe(\n switchMapToDefault(this.instance.defaultValue$, (value) => {\n return this._useDefaultFilter.pipe(switchMap((fn) => (DEFAULT_REDIRECT_INSTANCE_FORWARD_FACTORY as DefaultForwardFunctionFactory<SwitchMapToDefaultFilterFunction<T>>)(fn)(value)));\n }),\n filterMaybe(), // do not redirect on MaybeNot values\n switchMap((defaultValue) => {\n return this.redirectWithDefaultValue(defaultValue);\n })\n );\n } else {\n return EMPTY;\n }\n })\n )\n .subscribe();\n }\n\n destroy(): void {\n this._enabled.complete();\n this._useDefaultFilter.complete();\n this._sub.destroy();\n }\n\n protected redirectWithDefaultValue(value: Maybe<T>): Promise<boolean> {\n if (value != null) {\n // perform a segue once\n return this.redirectWithValue(value);\n } else {\n // do nothing\n return Promise.resolve(false);\n }\n }\n\n protected redirectWithValue(value: Maybe<T>): Promise<boolean> {\n return this.instance.dbxRouterService.updateParams({\n [this.instance.getParamKey()]: value\n });\n }\n\n get enabled(): boolean {\n return this._enabled.value;\n }\n\n set enabled(enabled: boolean) {\n this._enabled.next(enabled);\n }\n\n setUseDefaultFilter(useValueFilter: Maybe<SwitchMapToDefaultFilterFunction<T>>): void {\n this._useDefaultFilter.next(useValueFilter);\n }\n}\n","import { type Observable, BehaviorSubject, map, shareReplay, of, switchMap } from 'rxjs';\nimport { type Destroyable, type Initialized, type Maybe, type ModelKey } from '@dereekb/util';\nimport { type MaybeObservableOrValueGetter, type SwitchMapToDefaultFilterFunction } from '@dereekb/rxjs';\nimport { type DbxRouterService } from '../router/service';\nimport { type DbxRouteParamReader, dbxRouteParamReaderInstance, DbxRouteParamDefaultRedirectInstance } from '../router/util';\n\n/**\n * Default identifier used by dbxRouteModelIdParamRedirect() that corresponds to the id param of the model in the current route.\n */\nexport const DBX_ROUTE_MODEL_ID_PARAM_DEFAULT_ID_PARAM_KEY = 'id';\n\n/**\n * Default identifier used by dbxRouteModelIdParamRedirect() that corresponds to the key param of the model in the current route.\n */\nexport const DBX_ROUTE_MODEL_ID_PARAM_DEFAULT_KEY_PARAM_KEY = 'key';\n\n/**\n * Default value used by dbxRouteModelIdParamRedirect() for when a value is not available or provided.\n */\nexport const DBX_ROUTE_MODEL_ID_PARAM_DEFAULT_USE_PARAM_VALUE = '0';\n\n/**\n * Used to read an id with a specific key from the current route.\n *\n * Can be configured to redirect to a default route if a specific value is seen.\n */\nexport interface DbxRouteModelIdParamRedirect extends DbxRouteParamReader<ModelKey> {\n /**\n * The id value as it is from the current state's params.\n */\n readonly idFromParams$: Observable<Maybe<ModelKey>>;\n /**\n * The id value as it is when considering the default value.\n */\n readonly id$: Observable<Maybe<ModelKey>>;\n setRedirectEnabled(redirect: Maybe<boolean>): void;\n setDecider(decider: string | SwitchMapToDefaultFilterFunction<ModelKey>): void;\n}\n\n/**\n *DbxRouteModelIdParamRedirect instance\n */\nexport interface DbxRouteModelIdParamRedirectInstance extends DbxRouteModelIdParamRedirect, DbxRouteParamReader<ModelKey>, Initialized, Destroyable {\n readonly paramValue$: Observable<Maybe<string>>;\n readonly defaultValue$: Observable<Maybe<string>>;\n readonly value$: Observable<Maybe<string>>;\n\n readonly idFromParams$: Observable<Maybe<ModelKey>>;\n readonly id$: Observable<Maybe<ModelKey>>;\n\n setParamKey(paramKey: Maybe<string>): void;\n\n setDefaultValue(defaultValue: MaybeObservableOrValueGetter<string>): void;\n setRedirectEnabled(redirect: Maybe<boolean>): void;\n\n setDecider(decider: string | SwitchMapToDefaultFilterFunction<ModelKey>): void;\n setParamValue(value: MaybeObservableOrValueGetter<string>): void;\n}\n\nexport function dbxRouteModelKeyParamRedirect(dbxRouterService: DbxRouterService, defaultParamKey: string = DBX_ROUTE_MODEL_ID_PARAM_DEFAULT_KEY_PARAM_KEY): DbxRouteModelIdParamRedirectInstance {\n return dbxRouteModelIdParamRedirect(dbxRouterService, defaultParamKey);\n}\n\nexport function dbxRouteModelIdParamRedirect(dbxRouterService: DbxRouterService, defaultParamKey: string = DBX_ROUTE_MODEL_ID_PARAM_DEFAULT_ID_PARAM_KEY): DbxRouteModelIdParamRedirectInstance {\n const _paramReader = dbxRouteParamReaderInstance<ModelKey>(dbxRouterService, defaultParamKey);\n const _paramRedirect = new DbxRouteParamDefaultRedirectInstance<ModelKey>(_paramReader);\n const _useDefaultParamDecider = new BehaviorSubject<string | SwitchMapToDefaultFilterFunction<ModelKey>>(DBX_ROUTE_MODEL_ID_PARAM_DEFAULT_USE_PARAM_VALUE);\n\n const _useDefaultParam$: Observable<SwitchMapToDefaultFilterFunction<ModelKey>> = _useDefaultParamDecider.pipe(\n map((x) => {\n let result: SwitchMapToDefaultFilterFunction<ModelKey>;\n\n if (typeof x === 'string') {\n result = (value: Maybe<ModelKey>) => of(value === x);\n } else {\n result = x;\n }\n\n return result;\n }),\n shareReplay(1)\n );\n\n const setParamKey = (paramKey: Maybe<string>) => {\n _paramReader.setParamKey(paramKey || defaultParamKey);\n };\n\n const paramValue$ = _paramReader.paramValue$;\n const value$ = _paramReader.value$;\n\n const result: DbxRouteModelIdParamRedirectInstance = {\n paramValue$,\n defaultValue$: _paramReader.defaultValue$,\n value$,\n idFromParams$: paramValue$,\n id$: value$,\n\n init(): void {\n _paramRedirect.setUseDefaultFilter((value: Maybe<string>) => {\n return _useDefaultParam$.pipe(switchMap((x) => x(value)));\n });\n\n _paramRedirect.init();\n },\n\n destroy(): void {\n _paramReader.destroy();\n _paramRedirect.destroy();\n _useDefaultParamDecider.complete();\n },\n\n getParamKey(): string {\n return _paramReader.getParamKey();\n },\n\n setParamKey,\n\n setDefaultValue(defaultValue: MaybeObservableOrValueGetter<string>): void {\n _paramReader.setDefaultValue(defaultValue);\n },\n\n setRedirectEnabled(redirect: Maybe<boolean>): void {\n _paramRedirect.enabled = redirect !== false;\n },\n\n setDecider(decider: string | SwitchMapToDefaultFilterFunction<ModelKey>): void {\n _useDefaultParamDecider.next(decider);\n },\n\n setParamValue(value: MaybeObservableOrValueGetter<string>): void {\n _paramReader.setParamValue(value);\n }\n };\n\n return result;\n}\n","import { type Type, type Provider, forwardRef } from '@angular/core';\nimport { type Maybe, type ModelKey } from '@dereekb/util';\nimport { type Observable, type Subscription } from 'rxjs';\n\n// MARK: Id\n/**\n * DbxRouteModelIdDirective delegate that can recieve an observable of the model id from the route.\n */\nexport abstract class DbxRouteModelIdDirectiveDelegate {\n /**\n * Passes the param value and computed value from the DbxRouteModelIdDirective to this delegate.\n *\n * @param idFromParamsObs\n * @param computedIdObs\n */\n abstract useRouteModelIdParamsObservable(idFromParamsObs: Observable<Maybe<ModelKey>>, computedIdObs: Observable<Maybe<ModelKey>>): Subscription;\n}\n\n/**\n * Configures providers for a DbxRouteModelIdDirectiveDelegate.\n */\nexport function provideDbxRouteModelIdDirectiveDelegate<S extends DbxRouteModelIdDirectiveDelegate>(sourceType: Type<S>): Provider[] {\n const providers: Provider[] = [\n {\n provide: DbxRouteModelIdDirectiveDelegate,\n useExisting: forwardRef(() => sourceType)\n }\n ];\n\n return providers;\n}\n\n// MARK: Key\n/**\n * DbxRouteModelKeyDirective delegate that can recieve an observable of the model id from the route.\n */\nexport abstract class DbxRouteModelKeyDirectiveDelegate {\n /**\n * Passes the param value and computed value from the DbxRouteModelKeyDirective to this delegate.\n *\n * @param keyFromParamsObs\n * @param computedKeyObs\n */\n abstract useRouteModelKeyParamsObservable(keyFromParamsObs: Observable<Maybe<ModelKey>>, computedKeyObs: Observable<Maybe<ModelKey>>): Subscription;\n}\n\n/**\n * Configures providers for a DbxRouteModelKeyDirectiveDelegate.\n */\nexport function provideDbxRouteModelKeyDirectiveDelegate<S extends DbxRouteModelKeyDirectiveDelegate>(sourceType: Type<S>): Provider[] {\n const providers: Provider[] = [\n {\n provide: DbxRouteModelKeyDirectiveDelegate,\n useExisting: forwardRef(() => sourceType)\n }\n ];\n\n return providers;\n}\n","import { Directive, inject } from '@angular/core';\nimport { DbxRouteModelIdDirectiveDelegate } from './model.router';\nimport { DbxAuthService } from '../../auth';\nimport { cleanSubscription } from '../../rxjs';\n\n/**\n * Used for retrieving the user's current id DbxAuthService and passes it as an identifier for a DbxRouteModelIdDirectiveDelegate.\n */\n@Directive({\n selector: '[dbxRouteModelIdFromAuthUserId]',\n standalone: true\n})\nexport class DbxRouteModelIdFromAuthUserIdDirective {\n readonly dbxAuthService = inject(DbxAuthService);\n readonly dbxRouteModelIdDelegate = inject(DbxRouteModelIdDirectiveDelegate, { host: true });\n\n constructor() {\n cleanSubscription(this.dbxRouteModelIdDelegate.useRouteModelIdParamsObservable(this.dbxAuthService.userIdentifier$, this.dbxAuthService.userIdentifier$));\n }\n}\n","import { type Observable } from 'rxjs';\nimport { Directive, Input, inject } from '@angular/core';\nimport { type Maybe, type ModelKey } from '@dereekb/util';\nimport { type MaybeObservableOrValueGetter, type SwitchMapToDefaultFilterFunction } from '@dereekb/rxjs';\nimport { dbxRouteModelIdParamRedirect } from './id.param.redirect';\nimport { DbxRouterService } from '../router/service/router.service';\nimport { DbxRouteModelIdDirectiveDelegate } from './model.router';\nimport { clean, cleanSubscription } from '../../rxjs';\n\n/**\n * Used for retrieving the model's id from the current route using the configured parameter and passes it to its delegate.\n */\n@Directive({\n selector: '[dbxRouteModelId]',\n standalone: true\n})\nexport class DbxRouteModelIdDirective {\n readonly dbxRouterService = inject(DbxRouterService);\n readonly dbxRouteModelIdDelegate = inject(DbxRouteModelIdDirectiveDelegate, { host: true });\n\n private readonly _redirectInstance = clean(dbxRouteModelIdParamRedirect(this.dbxRouterService));\n\n readonly idFromParams$: Observable<Maybe<ModelKey>> = this._redirectInstance.paramValue$;\n readonly id$: Observable<Maybe<ModelKey>> = this._redirectInstance.value$;\n\n constructor() {\n cleanSubscription(this.dbxRouteModelIdDelegate.useRouteModelIdParamsObservable(this.idFromParams$, this.id$));\n this._redirectInstance.init();\n }\n\n // MARK: Input\n @Input('dbxRouteModelId')\n get idParam() {\n return this._redirectInstance.getParamKey();\n }\n\n set idParam(idParam: string) {\n this._redirectInstance.setParamKey(idParam);\n }\n\n @Input()\n set dbxRouteModelIdDefault(defaultValue: MaybeObservableOrValueGetter<ModelKey>) {\n this._redirectInstance.setDefaultValue(defaultValue);\n }\n\n /**\n * Whether or not to enable the redirection. Is enabled by default.\n */\n @Input()\n set dbxRouteModelIdDefaultRedirect(redirect: Maybe<boolean> | '') {\n this._redirectInstance.setRedirectEnabled(redirect !== false); // true by default\n }\n\n @Input()\n set dbxRouteModelIdDefaultDecision(decider: string | SwitchMapToDefaultFilterFunction<ModelKey>) {\n this._redirectInstance.setDecider(decider);\n }\n}\n","import { type Observable } from 'rxjs';\nimport { Directive, Input, inject } from '@angular/core';\nimport { type Maybe, type ModelKey } from '@dereekb/util';\nimport { type MaybeObservableOrValueGetter, type SwitchMapToDefaultFilterFunction } from '@dereekb/rxjs';\nimport { dbxRouteModelKeyParamRedirect } from './id.param.redirect';\nimport { clean, cleanSubscription } from '../../rxjs';\nimport { DbxRouterService } from '../router/service/router.service';\nimport { DbxRouteModelKeyDirectiveDelegate } from './model.router';\n\n/**\n * Used for retrieving the model's key from the current route using the configured parameter and passes it to its delegate.\n *\n * If the key does not exist in the params, then the p\n */\n@Directive({\n selector: '[dbxRouteModelKey]',\n standalone: true\n})\nexport class DbxRouteModelKeyDirective {\n readonly dbxRouterService = inject(DbxRouterService);\n readonly dbxRouteModelKeyDelegate = inject(DbxRouteModelKeyDirectiveDelegate, { host: true });\n\n private readonly _redirectInstance = clean(dbxRouteModelKeyParamRedirect(this.dbxRouterService));\n\n readonly keyFromParams$: Observable<Maybe<ModelKey>> = this._redirectInstance.paramValue$;\n readonly key$: Observable<Maybe<ModelKey>> = this._redirectInstance.value$;\n\n constructor() {\n cleanSubscription(this.dbxRouteModelKeyDelegate.useRouteModelKeyParamsObservable(this.keyFromParams$, this.key$));\n this._redirectInstance.init();\n }\n\n // MARK: Input\n @Input('dbxRouteModelKey')\n get keyParam() {\n return this._redirectInstance.getParamKey();\n }\n\n set keyParam(idParam: string) {\n this._redirectInstance.setParamKey(idParam);\n }\n\n @Input()\n set dbxRouteModelKeyDefault(defaultValue: MaybeObservableOrValueGetter<ModelKey>) {\n this._redirectInstance.setDefaultValue(defaultValue);\n }\n\n /**\n * Whether or not to enable the redirection. Is enabled by default.\n */\n @Input()\n set dbxRouteModelKeyDefaultRedirect(redirect: Maybe<boolean> | '') {\n this._redirectInstance.setRedirectEnabled(redirect !== false); // true by default\n }\n\n @Input()\n set dbxRouteModelKeyDefaultDecision(decider: string | SwitchMapToDefaultFilterFunction<ModelKey>) {\n this._redirectInstance.setDecider(decider);\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { asObservableFromGetter, type ObservableOrValueGetter } from '@dereekb/rxjs';\nimport { type Observable } from 'rxjs';\n\n/**\n * Pipes an ObservableOrValueGetter to an Observable value.\n */\n@Pipe({\n name: 'asObservable',\n standalone: true\n})\nexport class AsObservablePipe implements PipeTransform {\n transform<T>(input: ObservableOrValueGetter<T>): Observable<T> {\n return asObservableFromGetter(input);\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { type DateRange, formatToDayRangeString } from '@dereekb/date';\n\n@Pipe({\n name: 'dateDayRange',\n standalone: true,\n pure: true\n})\nexport class DateDayRangePipe implements PipeTransform {\n transform(input: Maybe<DateRange>, unavailable: string = 'Not Available'): string {\n if (input) {\n return formatToDayRangeString(input);\n } else {\n return unavailable;\n }\n }\n}\n","import { isValid } from 'date-fns';\nimport { Pipe, type PipeTransform } from '@angular/core';\nimport { toJsDate } from '@dereekb/date';\nimport { type DateOrDateString, type Maybe } from '@dereekb/util';\n\n@Pipe({\n name: 'toJsDate',\n standalone: true,\n pure: true\n})\nexport class ToJsDatePipe implements PipeTransform {\n public static toJsDate(input: DateOrDateString): Date;\n public static toJsDate(input: Maybe<DateOrDateString>): Maybe<Date>;\n public static toJsDate(input: Maybe<DateOrDateString>): Maybe<Date> {\n let date: Maybe<Date>;\n\n if (input != null) {\n date = toJsDate(input);\n\n if (!isValid(date)) {\n date = undefined;\n }\n }\n\n return date;\n }\n\n transform(input: Maybe<DateOrDateString>): Maybe<Date> {\n return ToJsDatePipe.toJsDate(input);\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { type DateOrDateString, type Maybe } from '@dereekb/util';\nimport { ToJsDatePipe } from './tojsdate.pipe';\nimport { formatDateDistance } from '@dereekb/date';\n\n@Pipe({\n name: 'dateDistance',\n standalone: true,\n pure: false\n})\nexport class DateDistancePipe implements PipeTransform {\n transform(input: Maybe<DateOrDateString>, inputTo?: Maybe<Date>, unavailable: string = 'Not Available'): string {\n if (input != null) {\n const to = inputTo ?? new Date();\n const from = ToJsDatePipe.toJsDate(input);\n return formatDateDistance(to, from);\n } else {\n return unavailable;\n }\n }\n}\n","import { Pipe, type PipeTransform, LOCALE_ID, inject } from '@angular/core';\nimport { formatDate } from '@angular/common';\nimport { formatDistanceToNow, isValid } from 'date-fns';\nimport { type DateOrDateString, type Maybe } from '@dereekb/util';\nimport { toJsDate } from '@dereekb/date';\n\n/**\n * Pipe that takes in a date and appends the distance to it in parenthesis.\n */\n@Pipe({\n name: 'dateFormatDistance',\n standalone: true,\n pure: false\n})\nexport class DateFormatDistancePipe implements PipeTransform {\n private readonly locale = inject(LOCALE_ID);\n\n transform(input: Maybe<DateOrDateString>, format: string, includeSeconds = false): Maybe<string> {\n if (input) {\n const date = toJsDate(input);\n\n if (isValid(date)) {\n const dateString = formatDate(date, format, this.locale);\n\n const distance = formatDistanceToNow(date, {\n includeSeconds,\n addSuffix: true\n });\n\n return `${dateString} (${distance})`;\n }\n }\n\n return undefined;\n }\n}\n","import { addMinutes } from 'date-fns';\nimport { Pipe, type PipeTransform, LOCALE_ID, inject } from '@angular/core';\nimport { formatDate } from '@angular/common';\nimport { type Maybe, type DateOrDateString } from '@dereekb/util';\nimport { formatToTimeString, toJsDate } from '@dereekb/date';\n\n/**\n * Pipe that takes in a date and number of minutes and outputs a formatted date.\n */\n@Pipe({\n name: 'dateFormatFromTo',\n standalone: true,\n pure: true\n})\nexport class DateFormatFromToPipe implements PipeTransform {\n private readonly locale = inject(LOCALE_ID);\n\n static formatFromTo(input: Maybe<DateOrDateString>, format: string, minutes: number, locale: string): Maybe<string> {\n if (input) {\n const date = toJsDate(input);\n const endDate = addMinutes(date, minutes);\n const dateString = formatDate(date, format, locale);\n return dateString + ' - ' + formatToTimeString(endDate);\n }\n\n return undefined;\n }\n\n transform(input: Maybe<DateOrDateString>, format: string, minutes: number): Maybe<string> {\n return DateFormatFromToPipe.formatFromTo(input, format, minutes, this.locale);\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { type DateRange, formatToDayTimeRangeString } from '@dereekb/date';\n\n@Pipe({\n name: 'dateDayTimeRange',\n standalone: true,\n pure: true\n})\nexport class DateDayTimeRangePipe implements PipeTransform {\n transform(input: Maybe<DateRange>, unavailable: string = 'Not Available'): string {\n if (input) {\n return formatToDayTimeRangeString(input);\n } else {\n return unavailable;\n }\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { type DateRange, formatToTimeRangeString } from '@dereekb/date';\n\n@Pipe({\n name: 'dateTimeRange',\n standalone: true,\n pure: true\n})\nexport class DateTimeRangePipe implements PipeTransform {\n transform(input: Maybe<DateRange>, unavailable: string = 'Not Available'): string {\n if (input) {\n return formatToTimeRangeString(input);\n } else {\n return unavailable;\n }\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { type DateRange, formatDateDistance } from '@dereekb/date';\n\n@Pipe({\n name: 'dateRangeDistance',\n standalone: true,\n pure: false\n})\nexport class DateRangeDistancePipe implements PipeTransform {\n transform(input: Maybe<Date | DateRange>, unavailable: string = 'Not Available'): string {\n if (input != null) {\n return formatDateDistance(input as Date, new Date());\n } else {\n return unavailable;\n }\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { type DateRange, formatToTimeRangeString } from '@dereekb/date';\n\n@Pipe({\n name: 'dateTimeRangeOnly',\n standalone: true,\n pure: true\n})\nexport class DateTimeRangeOnlyPipe implements PipeTransform {\n transform(input: Maybe<DateRange>, unavailable: string = 'Not Available'): string {\n if (input) {\n return formatToTimeRangeString(input, undefined, true);\n } else {\n return unavailable;\n }\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { type TimezoneString, type Maybe } from '@dereekb/util';\nimport { dateTimezoneUtcNormal } from '@dereekb/date';\n\n/**\n * Converts the input date and timezone to a system date that represents that date/time.\n */\n@Pipe({\n name: 'targetDateToSystemDate',\n standalone: true,\n pure: false\n})\nexport class TargetDateToSystemDatePipe implements PipeTransform {\n transform(input: Maybe<Date>, timezone: Maybe<TimezoneString>): Maybe<Date> {\n if (input && timezone) {\n return dateTimezoneUtcNormal({ timezone }).targetDateToSystemDate(input);\n } else {\n return undefined;\n }\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { type DateRange, formatDateRangeDistance, type FormatDateRangeDistanceFunctionConfig } from '@dereekb/date';\n\n@Pipe({\n name: 'dateTimeRangeOnlyDistance',\n standalone: true,\n pure: true\n})\nexport class DateTimeRangeOnlyDistancePipe implements PipeTransform {\n transform(input: Maybe<DateRange>, config?: FormatDateRangeDistanceFunctionConfig, unavailable: string = 'Not Available'): string {\n if (input) {\n return formatDateRangeDistance(input, { ...config });\n } else {\n return unavailable;\n }\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { type TimezoneString, type Maybe } from '@dereekb/util';\nimport { getTimezoneAbbreviation } from '@dereekb/date';\n\n/**\n * Converts the input date and timezone to the proper abbreviation. Uses the input date for the context, or uses now.\n */\n@Pipe({\n name: 'timezoneAbbreviation',\n standalone: true,\n pure: false\n})\nexport class TimezoneAbbreviationPipe implements PipeTransform {\n transform(timezone: Maybe<TimezoneString>, input?: Maybe<Date>): Maybe<string> {\n if (timezone) {\n return getTimezoneAbbreviation(timezone, input ?? undefined);\n } else {\n return undefined;\n }\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { type TimezoneString, type Maybe } from '@dereekb/util';\nimport { dateTimezoneUtcNormal } from '@dereekb/date';\n\n/**\n * Converts the input date and timezone to a target date that represents that date/time for the timezone.\n */\n@Pipe({\n name: 'systemDateToTargetDate',\n standalone: true,\n pure: false\n})\nexport class SystemDateToTargetDatePipe implements PipeTransform {\n transform(input: Maybe<Date>, timezone: Maybe<TimezoneString>): Maybe<Date> {\n if (input && timezone) {\n return dateTimezoneUtcNormal({ timezone }).systemDateToTargetDate(input);\n } else {\n return undefined;\n }\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\n\n@Pipe({\n name: 'minutesString',\n standalone: true,\n pure: false\n})\nexport class MinutesStringPipe implements PipeTransform {\n transform(input: Maybe<number | string>): Maybe<string> {\n const minutes = Number(input);\n\n if (input != null && !isNaN(minutes)) {\n if (minutes > 3600) {\n const unrounded = minutes / 3600;\n const days = Math.ceil(unrounded);\n return (unrounded !== days ? '~' : '') + days + ' days';\n } else if (minutes > 180) {\n const unrounded = minutes / 60;\n const hours = Math.ceil(unrounded);\n return (unrounded !== hours ? '~' : '') + hours + ' hours';\n } else {\n return minutes + ' minutes';\n }\n } else {\n return undefined;\n }\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { type Maybe, type DateOrDateString } from '@dereekb/util';\nimport { formatDistance, isPast } from 'date-fns';\nimport { ToJsDatePipe } from './tojsdate.pipe';\n\n@Pipe({\n name: 'timeCountdownDistance',\n standalone: true,\n pure: false\n})\nexport class TimeDistanceCountdownPipe implements PipeTransform {\n transform(input: Maybe<DateOrDateString>, soonString: string = 'Soon', unavailable: string = 'Not Available'): string {\n if (input) {\n const from = ToJsDatePipe.toJsDate(input);\n\n if (isPast(from)) {\n return soonString;\n } else {\n const to = new Date();\n return formatDistance(from, to, {\n addSuffix: true\n });\n }\n } else {\n return unavailable;\n }\n }\n}\n\n@Pipe({\n name: 'timeDistance',\n standalone: true,\n pure: false\n})\nexport class TimeDistancePipe implements PipeTransform {\n transform(input: Maybe<DateOrDateString>, to?: Maybe<Date>, unavailable: string = 'Not Available'): string {\n if (input) {\n const from = ToJsDatePipe.toJsDate(input);\n return formatDistance(from, to ?? new Date(), {\n addSuffix: true\n });\n } else {\n return unavailable;\n }\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\n\n@Pipe({\n name: 'toMinutes',\n standalone: true,\n pure: true\n})\nexport class ToMinutesPipe implements PipeTransform {\n transform(milliseconds: number): number {\n if (milliseconds) {\n return Math.floor(milliseconds / (60 * 1000));\n }\n\n return milliseconds;\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\n\n@Pipe({\n name: 'prettyjson',\n standalone: true\n})\nexport class PrettyJsonPipe implements PipeTransform {\n public static toPrettyJson(input: Maybe<unknown>, spacing: number = 2): Maybe<string> {\n let json: Maybe<string>;\n\n if (input) {\n try {\n json = JSON.stringify(input, null, spacing);\n } catch (e) {\n console.error('prettyjson pipe failed parsing input: ', input);\n json = 'ERROR';\n }\n }\n\n return json;\n }\n\n transform(input: Maybe<unknown>, spacing?: number): Maybe<string> {\n return PrettyJsonPipe.toPrettyJson(input, spacing);\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { cutString, type Maybe } from '@dereekb/util';\n\n/**\n * Pipe that cuts the input text to the requested length and adds elipsis.\n */\n@Pipe({\n name: 'cutText',\n standalone: true,\n pure: true\n})\nexport class CutTextPipe implements PipeTransform {\n transform(input: Maybe<string>, maxLength: number, endText?: Maybe<string>): Maybe<string> {\n return input != null ? cutString(input, maxLength, endText) : input;\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { type GetterOrValue, getValueFromGetter } from '@dereekb/util';\n\n/**\n * Retrieves the value from the getter. This is a non-pure pipe. Use the getValueOncePipe instead for a pure pipe.\n */\n@Pipe({\n name: 'getValue',\n standalone: true,\n pure: false\n})\nexport class GetValuePipe implements PipeTransform {\n transform<T, A = any>(input: GetterOrValue<T>, args?: A): T {\n return getValueFromGetter(input as any, args);\n }\n}\n\n/**\n * Pipes a GetValuePipe to an Observable value.\n */\n@Pipe({\n name: 'getValueOnce',\n standalone: true,\n pure: true\n})\nexport class GetValueOncePipe implements PipeTransform {\n transform<T, A = any>(input: GetterOrValue<T>, args?: A): T {\n return getValueFromGetter(input as any, args);\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { dollarAmountString, type Maybe } from '@dereekb/util';\n\n/**\n * Pipe that takes in a number and returns the number formatted as a dollar using dollarAmountString().\n *\n * Can provide a default string value to use when the input is null or undefined.\n */\n@Pipe({\n name: 'dollarAmount',\n standalone: true,\n pure: true\n})\nexport class DollarAmountPipe implements PipeTransform {\n transform(input: Maybe<number>, defaultIfNull?: Maybe<string>): Maybe<string> {\n return defaultIfNull == null || input != null ? dollarAmountString(input) : defaultIfNull;\n }\n}\n","import { type Observable, BehaviorSubject, of, switchMap, shareReplay } from 'rxjs';\nimport { Directive } from '@angular/core';\nimport { type FilterSourceConnector, type FilterSource, filterMaybe } from '@dereekb/rxjs';\nimport { type Maybe } from '@dereekb/util';\nimport { completeOnDestroy } from '../rxjs';\n\n/**\n * Abstract FilterSourceConnector directive.\n */\n@Directive()\nexport abstract class AbstractFilterSourceConnectorDirective<F> implements FilterSourceConnector<F>, FilterSource<F> {\n private readonly _source = completeOnDestroy(new BehaviorSubject<Maybe<FilterSource<F>>>(undefined));\n\n readonly filter$: Observable<F> = this._source.pipe(\n switchMap((x) => x?.filter$ ?? of(undefined)),\n filterMaybe(),\n shareReplay(1)\n );\n\n connectWithSource(filterSource: FilterSource<F>): void {\n this._source.next(filterSource);\n }\n}\n","import { FilterSource, FilterSourceConnector } from '@dereekb/rxjs';\nimport { forwardRef, type Provider, type Type } from '@angular/core';\n\n/**\n * Angular provider convenience function for a FilterSource.\n */\nexport function provideFilterSource<S extends FilterSource>(sourceType: Type<S>): Provider[] {\n return [\n {\n provide: FilterSource,\n useExisting: forwardRef(() => sourceType)\n }\n ];\n}\n\n/**\n * Angular provider convenience function for a FilterSourceConnector.\n */\nexport function provideFilterSourceConnector<S extends FilterSourceConnector>(sourceType: Type<S>): Provider[] {\n return [\n {\n provide: FilterSourceConnector,\n useExisting: forwardRef(() => sourceType)\n },\n {\n provide: FilterSource,\n useExisting: forwardRef(() => sourceType)\n }\n ];\n}\n","import { type Observable } from 'rxjs';\nimport { Directive, forwardRef, inject, InjectionToken, Injector, type OnDestroy, type Provider, type Type } from '@angular/core';\nimport { type FilterSource, FilterSourceInstance, type MaybeObservableOrValue } from '@dereekb/rxjs';\nimport { type Maybe } from '@dereekb/util';\nimport { provideFilterSource } from './filter.content';\n\nexport const FILTER_SOURCE_DIRECTIVE_DEFAULT_FILTER_TOKEN = new InjectionToken<Maybe<Observable<Maybe<unknown>>>>('FILTER_SOURCE_DIRECTIVE_DEFAULT_FILTER_SOURCE_TOKEN');\n\nexport abstract class FilterSourceDirective<F = unknown> implements FilterSource<F> {\n abstract readonly filter$: Observable<F>;\n abstract initWithFilter(filterObs: Observable<F>): void;\n abstract setFilter(filter: F): void;\n abstract resetFilter(): void;\n}\n\nexport type ProvideFilterSourceDirectiveDefaultFilterFactoryFunction<F = unknown> = (injector: Injector) => MaybeObservableOrValue<F>;\n\n/**\n * Angular provider convenience function for a FilterSourceDirective.\n */\nexport function provideFilterSourceDirective<S extends FilterSourceDirective<F>, F = unknown>(sourceType: Type<S>, defaultFilterFactory?: ProvideFilterSourceDirectiveDefaultFilterFactoryFunction): Provider[] {\n const providers = [\n {\n provide: FilterSourceDirective,\n useExisting: forwardRef(() => sourceType)\n },\n ...provideFilterSource(sourceType)\n ];\n\n if (defaultFilterFactory != null) {\n providers.push({\n provide: FILTER_SOURCE_DIRECTIVE_DEFAULT_FILTER_TOKEN,\n useFactory: defaultFilterFactory,\n deps: [Injector]\n });\n }\n\n return providers;\n}\n\n/**\n * Abstract FilterSource implementation and directive.\n */\n@Directive()\nexport abstract class AbstractFilterSourceDirective<F = unknown> implements FilterSourceDirective<F>, OnDestroy {\n private readonly _defaultFilter = inject<MaybeObservableOrValue<F>>(FILTER_SOURCE_DIRECTIVE_DEFAULT_FILTER_TOKEN, { optional: true });\n\n protected readonly _defaultFilterSource = new FilterSourceInstance<F>({\n defaultFilter: this._defaultFilter\n });\n\n readonly filter$: Observable<F> = this._defaultFilterSource.filter$;\n\n ngOnDestroy(): void {\n this._defaultFilterSource.destroy();\n }\n\n protected setDefaultFilter(defaultFilter: Observable<Maybe<F>>): void {\n this._defaultFilterSource.setDefaultFilter(defaultFilter);\n console.log('Setting default filter: ', defaultFilter);\n }\n\n initWithFilter(filterObs: Observable<F>): void {\n this._defaultFilterSource.initWithFilter(filterObs);\n }\n\n setFilter(filter: F): void {\n this._defaultFilterSource.setFilter(filter);\n }\n\n resetFilter(): void {\n this._defaultFilterSource.resetFilter();\n }\n\n setInitialFilterTakesPriority(initialFilterTakesPriority: boolean) {\n this._defaultFilterSource.setInitialFilterTakesPriority(initialFilterTakesPriority);\n }\n}\n","import { Directive, type OnInit, inject } from '@angular/core';\nimport { FilterSource, FilterSourceConnector } from '@dereekb/rxjs';\n\n/**\n * Connects the host FilterSource to a FilterSourceConnector.\n */\n@Directive({\n selector: '[dbxFilterConnectSource]',\n standalone: true\n})\nexport class DbxFilterConnectSourceDirective<F = unknown> implements OnInit {\n readonly filterSource = inject(FilterSource<F>, { host: true });\n readonly filterSourceConnector = inject(FilterSourceConnector<F>);\n\n ngOnInit(): void {\n this.filterSourceConnector.connectWithSource(this.filterSource);\n }\n}\n","import { Directive } from '@angular/core';\nimport { AbstractFilterSourceConnectorDirective } from './filter.abstract.connector.directive';\nimport { provideFilterSource, provideFilterSourceConnector } from './filter.content';\n\n/**\n * Used as a FilterSource and FilterSourceConnector.\n */\n@Directive({\n selector: '[dbxFilterSourceConnector]',\n providers: [...provideFilterSource(DbxFilterSourceConnectorDirective), ...provideFilterSourceConnector(DbxFilterSourceConnectorDirective)],\n standalone: true\n})\nexport class DbxFilterSourceConnectorDirective<F = unknown> extends AbstractFilterSourceConnectorDirective<F> {}\n","import { filterMaybe, type FilterMapKey, FilterMap, type MaybeObservableOrValue, maybeValueFromObservableOrValue } from '@dereekb/rxjs';\nimport { Directive, type OnDestroy, inject } from '@angular/core';\nimport { BehaviorSubject, distinctUntilChanged } from 'rxjs';\n\n/**\n * Provides a FilterSource from a parent FilterMap.\n */\n@Directive()\nexport abstract class AbstractDbxFilterMapInstanceDirective<F> implements OnDestroy {\n readonly dbxFilterMap = inject(FilterMap<F>);\n private readonly _currentFilterMapKey = new BehaviorSubject<MaybeObservableOrValue<FilterMapKey>>(undefined);\n\n readonly filterMapKey$ = this._currentFilterMapKey.pipe(maybeValueFromObservableOrValue(), filterMaybe(), distinctUntilChanged());\n readonly instance$ = this.dbxFilterMap.instanceObsForKeyObs(this.filterMapKey$);\n\n ngOnDestroy(): void {\n this._currentFilterMapKey.complete();\n }\n\n setFilterMapKey(filterMapKey: MaybeObservableOrValue<FilterMapKey>) {\n this._currentFilterMapKey.next(filterMapKey);\n }\n}\n","import { type FilterSource, type FilterMapKey } from '@dereekb/rxjs';\nimport { switchMap, first, type Observable } from 'rxjs';\nimport { Directive, effect, input } from '@angular/core';\nimport { provideFilterSource } from './filter.content';\nimport { AbstractDbxFilterMapInstanceDirective } from './filter.map.instance.directive';\nimport { type Maybe } from '@dereekb/util';\n\n/**\n * Abstract directive that extends AbstractDbxFilterMapInstanceDirective and implements FilterSource.\n */\n@Directive()\nexport abstract class AbstractDbxFilterMapSourceDirective<F> extends AbstractDbxFilterMapInstanceDirective<F> implements FilterSource<F> {\n readonly filter$: Observable<F> = this.instance$.pipe(switchMap((x) => x.filter$));\n\n initWithFilter(filterObs: Observable<F>): void {\n this.instance$.pipe(first()).subscribe((x) => x.initWithFilter(filterObs));\n }\n}\n\n/**\n * Provides a FilterSource from a parent FilterMap.\n */\n@Directive({\n selector: '[dbxFilterMapSource]',\n exportAs: 'dbxFilterMapSource',\n providers: [provideFilterSource(DbxFilterMapSourceDirective)],\n standalone: true\n})\nexport class DbxFilterMapSourceDirective<F> extends AbstractDbxFilterMapSourceDirective<F> implements FilterSource<F> {\n readonly dbxFilterMapSource = input<Maybe<FilterMapKey>>();\n protected readonly _dbxFilterMapSourceEffect = effect(() => this.setFilterMapKey(this.dbxFilterMapSource()));\n}\n","import { first } from 'rxjs';\nimport { Directive, effect, input } from '@angular/core';\nimport { type FilterSourceConnector, type FilterSource, type FilterMapKey } from '@dereekb/rxjs';\nimport { provideFilterSource, provideFilterSourceConnector } from './filter.content';\nimport { AbstractDbxFilterMapSourceDirective } from './filter.map.source.directive';\nimport { type Maybe } from '@dereekb/util';\n\n/**\n * Acts as an \"input\" FilterSourceConnector for an FilterMap, as well as a source for the FilterSourceConnector.\n */\n@Directive({\n selector: '[dbxFilterMapSourceConnector]',\n exportAs: 'dbxFilterMapSourceConnector',\n providers: [...provideFilterSource(DbxFilterMapSourceConnectorDirective), ...provideFilterSourceConnector(DbxFilterMapSourceConnectorDirective)],\n standalone: true\n})\nexport class DbxFilterMapSourceConnectorDirective<F> extends AbstractDbxFilterMapSourceDirective<F> implements FilterSourceConnector<F> {\n readonly dbxFilterMapSourceConnector = input<Maybe<FilterMapKey>>();\n protected readonly _dbxFilterMapSourceConnectorEffect = effect(() => this.setFilterMapKey(this.dbxFilterMapSourceConnector()));\n\n // MARK: FilterSourceConnector\n connectWithSource(filterSource: FilterSource<F>): void {\n this.instance$.pipe(first()).subscribe((x) => {\n x.connectWithSource(filterSource);\n\n if (filterSource.initWithFilter) {\n filterSource.initWithFilter(this.filter$);\n }\n });\n }\n}\n","import { Directive, inject } from '@angular/core';\nimport { FilterMap } from '@dereekb/rxjs';\nimport { clean } from '../rxjs/clean';\n\n/**\n * Direction that provides a FilterMap.\n */\n@Directive({\n selector: '[dbxFilterMap]',\n exportAs: 'dbxFilterMap',\n providers: [FilterMap],\n standalone: true\n})\nexport class DbxFilterMapDirective<F> {\n readonly filterMap = clean(inject(FilterMap<F>));\n}\n","import { type FilterPresetStringRef, type FilterWithPreset, type FilterWithPresetOptional } from '@dereekb/rxjs';\nimport { type EmptyObject, type GetterOrValue, type Maybe, objectHasKey, objectHasKeys } from '@dereekb/util';\nimport { type ClickableAnchorLink } from '../router/anchor/anchor';\n\nexport interface ClickableFilterPreset<F extends FilterWithPreset<P>, P extends string = string> extends Pick<ClickableAnchorLink, 'title' | 'icon' | 'disabled'>, FilterPresetStringRef<P> {\n /**\n * GetterOrValue that retrieves the filter for this preset.\n *\n * A null value or empty object is used for reset.\n */\n readonly presetValue: GetterOrValue<FilterWithPresetOptional<F>> | EmptyObject | null;\n}\n\nexport function isClickableFilterPreset<F extends FilterWithPreset<P>, P extends string = string>(preset: object): preset is ClickableFilterPreset<F, P> {\n return objectHasKey(preset, 'presetValue');\n}\n\nexport interface ClickablePartialFilterPreset<F> extends Pick<ClickableAnchorLink, 'title' | 'icon' | 'disabled'> {\n /**\n * GetterOrValue that retrieves the partial filter value.\n *\n * A null value or empty object is used for no change.\n */\n readonly partialPresetValue: GetterOrValue<Partial<F>> | EmptyObject | null;\n /**\n * The current value to test against. Returns true if this partial preset is considered active.\n */\n readonly isActive: (currentFilter: Maybe<Partial<F>>) => boolean;\n}\n\nexport function isClickablePartialFilterPreset<F>(preset: object): preset is ClickablePartialFilterPreset<F> {\n return objectHasKeys(preset, ['partialPresetValue', 'isActive']);\n}\n\n/**\n * Convenience type for either a ClickableFilterPreset or a ClickablePartialFilterPreset of the same type.\n */\nexport type ClickableFilterPresetOrPartialPreset<F extends FilterWithPreset<P>, P extends string = string> = ClickableFilterPreset<F, P> | ClickablePartialFilterPreset<F>;\n","import { Directive } from '@angular/core';\nimport { AbstractFilterSourceDirective, provideFilterSourceDirective } from './filter.abstract.source.directive';\n\n/**\n * Basic filter source directive.\n */\n@Directive({\n selector: '[dbxFilterSource]',\n providers: provideFilterSourceDirective(DbxFilterSourceDirective),\n standalone: true\n})\nexport class DbxFilterSourceDirective<F> extends AbstractFilterSourceDirective<F> {}\n","import { NgModule } from '@angular/core';\nimport { DbxFilterMapDirective } from './filter.map.directive';\nimport { DbxFilterMapSourceConnectorDirective } from './filter.map.connector.directive';\nimport { DbxFilterSourceDirective } from './filter.source.directive';\nimport { DbxFilterSourceConnectorDirective } from './filter.connector.directive';\nimport { DbxFilterMapSourceDirective } from './filter.map.source.directive';\nimport { DbxFilterConnectSourceDirective } from './filter.connect.source.directive';\n\nconst importsAndExports = [DbxFilterSourceDirective, DbxFilterMapSourceConnectorDirective, DbxFilterConnectSourceDirective, DbxFilterSourceConnectorDirective, DbxFilterMapDirective, DbxFilterMapSourceDirective];\n\n@NgModule({\n imports: importsAndExports,\n exports: importsAndExports\n})\nexport class DbxCoreFilterModule {}\n","import { InjectionToken, type Injector, type NgModuleRef, type StaticProvider, type TemplateRef, type Type, type ViewRef } from '@angular/core';\nimport { type Configurable, type FactoryWithRequiredInput, filterMaybeArrayValues, type Maybe, mergeArrays, mergeObjects } from '@dereekb/util';\n\nexport const DBX_INJECTION_COMPONENT_DATA = new InjectionToken('DbxInjectionComponentConfigData');\n\nexport interface DbxInjectionComponentConfig<T = unknown> {\n /**\n * Type of Component to initialize.\n */\n readonly componentClass: Type<T>;\n /**\n * (Optional) providers to provide to the existing injector.\n */\n readonly providers?: Maybe<StaticProvider[]>;\n /**\n * (Optional) Custom parent injector to use when creating the component.\n */\n readonly injector?: Maybe<Injector>;\n /**\n * (Optional) Module ref to use when creating the component.\n */\n readonly ngModuleRef?: NgModuleRef<unknown>;\n /**\n * (Optional) Custom initialization code when an instance is created.\n *\n * This is called in an Angular injection context of the created component, so that inject() is available and will be destroyed when the created component is destroyed.\n */\n readonly init?: Maybe<(instance: T) => void>;\n /**\n * unknown optional data to inject into the component.\n */\n readonly data?: Maybe<unknown>;\n}\n\n/**\n * The injector may be important to where the dbxInjection is getting injected at. Some types may disallow setting a custom parent injector.\n */\nexport type DbxInjectionComponentConfigWithoutInjector<T = unknown> = Omit<DbxInjectionComponentConfig<T>, 'injector'>;\n\nexport type DbxInjectionComponentConfigFactory<I, T = unknown> = FactoryWithRequiredInput<DbxInjectionComponentConfig<T>, I>;\n\nexport interface DbxInjectionTemplateConfig<T = unknown> {\n /**\n * Template ref to display.\n */\n readonly templateRef?: Maybe<TemplateRef<T>>;\n /**\n * View ref to inject.\n */\n readonly viewRef?: Maybe<ViewRef>;\n}\n\n/**\n * Merges multiple configurations into a single configuration.\n *\n * @param configs\n * @returns\n */\nexport function mergeDbxInjectionComponentConfigs<T = unknown>(configs: Maybe<Partial<DbxInjectionComponentConfig<T>>>[]): Partial<DbxInjectionComponentConfig<T>> {\n const providers = mergeArrays(filterMaybeArrayValues(configs).map((x) => x.providers));\n const result = mergeObjects(configs) as Configurable<DbxInjectionComponentConfig<T>>;\n result.providers = providers;\n return result;\n}\n","import { type StaticProvider } from '@angular/core';\nimport { type ArrayOrValue, flattenArrayOrValueArray, type Maybe } from '@dereekb/util';\n\n/**\n * Merges the input providers into a single array.\n *\n * @param providers\n * @returns\n */\nexport function mergeStaticProviders(...providers: Maybe<ArrayOrValue<StaticProvider>>[]): StaticProvider[] {\n return flattenArrayOrValueArray<StaticProvider>(providers);\n}\n","import { type ComponentRef, Injector, runInInjectionContext, type ViewContainerRef } from '@angular/core';\nimport { distinctUntilChanged, map, shareReplay, BehaviorSubject, combineLatest } from 'rxjs';\nimport { type DbxInjectionComponentConfig, type DbxInjectionTemplateConfig, DBX_INJECTION_COMPONENT_DATA } from './injection';\nimport { type Initialized, type Destroyable, type Maybe } from '@dereekb/util';\nimport { type MaybeObservableOrValueGetter, SubscriptionObject, filterMaybe, maybeValueFromObservableOrValueGetter, skipAllInitialMaybe } from '@dereekb/rxjs';\nimport { mergeStaticProviders } from './injection.util';\n\n/**\n * Instance used by components to inject content based on the configuration into the view.\n */\nexport class DbxInjectionInstance<T> implements Initialized, Destroyable {\n private readonly _subscriptionObject = new SubscriptionObject();\n\n private readonly _config = new BehaviorSubject<MaybeObservableOrValueGetter<DbxInjectionComponentConfig<T>>>(undefined);\n private readonly _template = new BehaviorSubject<MaybeObservableOrValueGetter<DbxInjectionTemplateConfig<T>>>(undefined);\n\n private readonly _content = new BehaviorSubject<Maybe<ViewContainerRef>>(undefined);\n private readonly _componentRef = new BehaviorSubject<Maybe<ComponentRef<T>>>(undefined);\n\n private readonly _injector: Injector;\n\n readonly config$ = this._config.pipe(maybeValueFromObservableOrValueGetter(), distinctUntilChanged(), shareReplay(1));\n readonly template$ = this._template.pipe(maybeValueFromObservableOrValueGetter(), distinctUntilChanged(), shareReplay(1));\n readonly content$ = this._content.pipe(filterMaybe(), distinctUntilChanged(), shareReplay(1));\n\n get config(): MaybeObservableOrValueGetter<DbxInjectionComponentConfig<T>> {\n return this._config.value;\n }\n\n set config(config: MaybeObservableOrValueGetter<DbxInjectionComponentConfig<T>>) {\n this._config.next(config);\n }\n\n get template(): MaybeObservableOrValueGetter<DbxInjectionTemplateConfig<T>> {\n return this._template.value;\n }\n\n set template(template: MaybeObservableOrValueGetter<DbxInjectionTemplateConfig<T>>) {\n this._template.next(template);\n }\n\n get content(): Maybe<Maybe<ViewContainerRef>> {\n return this._content.value;\n }\n\n set content(content: Maybe<Maybe<ViewContainerRef>>) {\n this._content.next(content);\n }\n\n get componentRef(): Maybe<ComponentRef<T>> {\n return this._componentRef.value;\n }\n\n set componentRef(componentRef: Maybe<ComponentRef<T>>) {\n this._componentRef.next(componentRef);\n }\n\n constructor(injector: Injector) {\n this._injector = injector;\n }\n\n init(): void {\n // Wait until the first of either of the two inputs comes in as not defined, and then emit.\n // We filter the first maybe here between the two items.\n const configTemplateObs = combineLatest([this.config$, this.template$]).pipe(\n map(([config, template]) => {\n if (config || template) {\n return {\n config,\n template\n };\n } else {\n return undefined;\n }\n }),\n skipAllInitialMaybe()\n );\n\n this._subscriptionObject.subscription = combineLatest([configTemplateObs, this.content$]).subscribe(([inputConfig, content]) => {\n const { config, template } = inputConfig ?? {};\n this._reset(content);\n\n if (config) {\n this._initComponent(config, content);\n } else if (template) {\n this._initTemplate(template, content);\n }\n });\n }\n\n destroy(): void {\n this._subscriptionObject.destroy();\n this._config.complete();\n this._template.complete();\n this._content.complete();\n this._componentRef.complete();\n }\n\n private _initComponent(config: DbxInjectionComponentConfig<T>, content: ViewContainerRef): void {\n content.clear();\n\n const { init, injector: inputInjector, providers, ngModuleRef, componentClass, data } = config;\n\n if (!componentClass) {\n throw new Error('DbxInjectionInstance: componentClass was expected in the config but it was unavailable.');\n }\n\n const parentInjector = inputInjector ?? this._injector;\n let injector: Injector | undefined = parentInjector;\n\n if (providers || data) {\n const dataProvider = {\n provide: DBX_INJECTION_COMPONENT_DATA,\n useValue: data\n };\n\n injector = Injector.create({\n parent: parentInjector,\n providers: mergeStaticProviders(dataProvider, providers)\n });\n }\n\n const componentRef: ComponentRef<T> = content.createComponent(componentClass, { injector, ngModuleRef });\n const instance = componentRef.instance;\n\n if (init) {\n runInInjectionContext(componentRef.injector, () => init(instance));\n }\n\n this.componentRef = componentRef;\n }\n\n private _initTemplate(config: DbxInjectionTemplateConfig<T>, content: ViewContainerRef): void {\n content.clear();\n\n const { templateRef, viewRef } = config;\n\n if (templateRef) {\n content.createEmbeddedView(templateRef);\n\n // TODO: Figure out if these items need to be destroyed or not when this item is destroyed. If so, we need a reference to destroy.\n } else if (viewRef) {\n content.insert(viewRef);\n }\n }\n\n private _reset(content: ViewContainerRef): void {\n if (this.componentRef) {\n content.clear();\n this.componentRef = undefined;\n }\n }\n}\n","import { type ViewContainerRef, type OnInit, type OnDestroy, Directive, Injector, inject } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { type DbxInjectionComponentConfig, type DbxInjectionTemplateConfig } from './injection';\nimport { DbxInjectionInstance as DbxInjectionInstance } from './injection.instance';\nimport { type ObservableOrValueGetter } from '@dereekb/rxjs';\n\n/**\n * Abstract directive that injects content based on the configuration into the view.\n */\n@Directive()\nexport abstract class AbstractDbxInjectionDirective<T> implements OnInit, OnDestroy {\n private readonly _instance = new DbxInjectionInstance<T>(inject(Injector));\n\n ngOnInit(): void {\n this._instance.init();\n }\n\n ngOnDestroy(): void {\n this._instance.destroy();\n }\n\n setConfig(config: Maybe<ObservableOrValueGetter<Maybe<DbxInjectionComponentConfig<T>>>>) {\n this._instance.config = config;\n }\n\n setTemplate(template: Maybe<ObservableOrValueGetter<Maybe<DbxInjectionTemplateConfig<T>>>>) {\n this._instance.template = template;\n }\n\n setContent(content: Maybe<ViewContainerRef>) {\n this._instance.content = content;\n }\n}\n","import { Component, ViewContainerRef, input, viewChild, effect } from '@angular/core';\nimport { type DbxInjectionComponentConfig, type DbxInjectionTemplateConfig } from './injection';\nimport { AbstractDbxInjectionDirective } from './injection.directive';\nimport { type Maybe } from '@dereekb/util';\nimport { type ObservableOrValueGetter } from '@dereekb/rxjs';\n\n/**\n * Component that injects content based on the configuration into the view.\n */\n@Component({\n selector: 'dbx-injection, [dbxInjection], [dbx-injection]',\n template: `\n <ng-template #content></ng-template>\n `,\n imports: [],\n standalone: true\n})\nexport class DbxInjectionComponent<T> extends AbstractDbxInjectionDirective<T> {\n readonly content = viewChild('content', { read: ViewContainerRef });\n\n readonly config = input<Maybe<ObservableOrValueGetter<Maybe<DbxInjectionComponentConfig<T>>>>>();\n readonly template = input<Maybe<ObservableOrValueGetter<Maybe<DbxInjectionTemplateConfig<T>>>>>();\n\n // allow signal writes for each as during their initialization they may write to a signal in some cases when initializing\n protected readonly _contentEffect = effect(() => this.setContent(this.content()));\n protected readonly _configEffect = effect(() => this.setConfig(this.config()));\n protected readonly _templateEffect = effect(() => this.setTemplate(this.template()));\n}\n","import { ChangeDetectionStrategy, Component, input } from '@angular/core';\nimport { type DbxInjectionArrayEntry } from './injection.array';\nimport { type Maybe } from '@dereekb/util';\nimport { DbxInjectionComponent } from './injection.component';\n\n/**\n * Component that injects content based on the configuration into the view.\n */\n@Component({\n selector: 'dbx-injection-array',\n template: `\n @for (entry of entries(); track entry.key) {\n <dbx-injection [config]=\"entry.injectionConfig\"></dbx-injection>\n }\n `,\n imports: [DbxInjectionComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class DbxInjectionArrayComponent {\n readonly entries = input<Maybe<DbxInjectionArrayEntry[]>>(undefined);\n}\n","import { type Provider, type Type } from '@angular/core';\nimport { type DbxInjectionComponentConfig } from './injection';\n\n/**\n * DbxInjectedViewContext showContext() configuration.\n */\nexport interface DbxInjectionContextConfig<T = unknown, O = unknown> {\n /**\n * Injected config.\n */\n config: DbxInjectionComponentConfig<T>;\n /**\n * Promise used to retrieve data from the given instance.\n */\n use: (instance: T) => Promise<O>;\n}\n\n/**\n * View that can switch to show another arbitrary view, then switch back when the promise ends.\n *\n * It is similar to *ngIf/*ngSwitch, but the original child content is retained instead of discarded,\n * and returns once the special context is done being used.\n */\nexport abstract class DbxInjectionContext {\n /**\n * Shows the given context until the promise ends, then displays the original content.\n *\n * The original content is hidden instead of removed from the context to avoid destruction of children elements.\n */\n abstract showContext<T = unknown, O = unknown>(config: DbxInjectionContextConfig<T>): Promise<O>;\n\n /**\n * Bails out of any current promise, if one is set.\n *\n * Returns true if the bail signal has been sent.\n */\n abstract resetContext(): boolean;\n}\n\n/**\n * Allows a directive to provide a formly context and form.\n */\nexport function provideDbxInjectionContext<T extends DbxInjectionContext>(type: Type<T>): Provider[] {\n return [\n {\n provide: DbxInjectionContext,\n useExisting: type\n }\n ];\n}\n","import { Directive, type EmbeddedViewRef, Injector, TemplateRef, ViewContainerRef, type OnDestroy, type OnInit, inject, effect, input } from '@angular/core';\nimport { type DbxInjectionContext, type DbxInjectionContextConfig, provideDbxInjectionContext } from './injection.context';\nimport { DbxInjectionInstance } from './injection.instance';\nimport { type DbxInjectionComponentConfig } from './injection';\nimport { type PromiseOrValue, type PromiseReference, promiseReference, type Maybe } from '@dereekb/util';\n\n/**\n * DbxInjectedViewContext implementation. Acts similar to *ngIf, but instead switches to a different view without destroying the original child view.\n */\n@Directive({\n selector: '[dbxInjectionContext]',\n providers: provideDbxInjectionContext(DbxInjectionContextDirective),\n standalone: true\n})\nexport class DbxInjectionContextDirective<O = unknown> implements DbxInjectionContext, OnInit, OnDestroy {\n private readonly _injector = inject(Injector);\n private readonly _templateRef = inject(TemplateRef<O>);\n private readonly _viewContainer = inject(ViewContainerRef);\n\n private readonly _instance = new DbxInjectionInstance(this._injector);\n\n private _currentPromise: Maybe<PromiseReference<unknown>>;\n private _embeddedView!: EmbeddedViewRef<O>;\n private _isDetached = false;\n\n readonly config = input<Maybe<DbxInjectionComponentConfig<unknown>>>();\n\n protected readonly _configEffect = effect(() => {\n this.setConfig(this.config());\n\n // NOTE: we have/call setConfig() because the effect() may not respond to all value changes,\n // especially when setConfig() ends up being called twice quickly in quick succession.\n });\n\n ngOnInit() {\n this._instance.content = this._viewContainer;\n this._instance.init();\n this._embeddedView = this._viewContainer.createEmbeddedView(this._templateRef);\n\n // detach the embedded view\n this._viewContainer.detach();\n\n // reattach it through the template configuration.\n // the template configuration acts as the default.\n this._instance.template = {\n viewRef: this._embeddedView\n };\n }\n\n ngOnDestroy(): void {\n this._instance.destroy();\n this._embeddedView?.destroy(); // destroy our embedded view too if it is set.\n }\n\n async showContext<T, O>(config: DbxInjectionContextConfig<T>): Promise<O> {\n // clear the current context before showing something new.\n this.resetContext();\n\n let promiseRef: Maybe<PromiseReference<O>>;\n\n let result: Maybe<O>;\n let error: unknown;\n\n // wait for the promise to resolve and use to finish using that instance.\n try {\n promiseRef = promiseReference(async (resolve, reject) => {\n const injectionConfig: DbxInjectionComponentConfig<T> = {\n ...config.config,\n init: async (instance: T) => {\n // init if available in the base config.\n if (config.config.init) {\n config.config.init(instance);\n }\n\n try {\n const result = (await config.use(instance)) as PromiseOrValue<O>;\n resolve(result);\n } catch (e) {\n reject(e);\n }\n }\n };\n\n this.setConfig(injectionConfig as DbxInjectionComponentConfig<unknown>);\n });\n\n this._currentPromise = promiseRef as PromiseReference<unknown>;\n\n // await the promise\n await promiseRef.promise;\n } catch (e) {\n error = e;\n }\n\n // if we're still using the same promiseRef\n if (promiseRef && promiseRef === this._currentPromise) {\n // clear the config to reshow the view\n this.setConfig(undefined);\n\n // clear the current promise\n this._currentPromise = undefined;\n }\n\n if (error != null) {\n return Promise.reject(error);\n } else {\n return result as O;\n }\n }\n\n resetContext(): boolean {\n let clearedValue = false;\n\n if (this._currentPromise) {\n const promise = this._currentPromise;\n\n // clear the current promise too\n this._currentPromise = undefined;\n\n // clear the config.\n this.setConfig(undefined);\n\n // send a rejection signal to bail out.\n promise.reject(new Error('dbxInjectionContext bailout'));\n\n clearedValue = true;\n }\n\n return clearedValue;\n }\n\n setConfig(config: Maybe<DbxInjectionComponentConfig<unknown>>) {\n let reattach = false;\n\n if (config) {\n if (!this._isDetached) {\n // detach the original view before setting config.\n this._viewContainer.detach();\n this._isDetached = true;\n }\n } else if (this._isDetached) {\n reattach = true;\n }\n\n this._instance.config = config;\n\n if (reattach) {\n this._viewContainer.insert(this._embeddedView);\n this._isDetached = false;\n }\n }\n}\n","import { Directive, inject } from '@angular/core';\nimport { DbxInjectionContext, type DbxInjectionContextConfig } from './injection.context';\n\n/**\n * Abstract DbxInjectionContext implementation that forwards commands to a host DbxInjectionContext.\n *\n * This abstract type is used by related types for dependency injection purposes, so that those types\n * can be injected instead of just any DbxInjectionContext.\n */\n@Directive()\nexport abstract class AbstractForwardDbxInjectionContextDirective implements DbxInjectionContext {\n readonly dbxInjectionContext = inject(DbxInjectionContext, { host: true });\n\n // MARK: DbxInjectionContext\n showContext<T = unknown, O = unknown>(config: DbxInjectionContextConfig<T, unknown>): Promise<O> {\n return this.dbxInjectionContext.showContext(config);\n }\n\n resetContext(): boolean {\n return this.dbxInjectionContext.resetContext();\n }\n}\n","import { asGetter, type GetterOrValue, type Maybe } from '@dereekb/util';\nimport { switchMapObject } from '@dereekb/rxjs';\nimport { type DbxInjectionComponentConfig } from './injection';\nimport { type Type } from '@angular/core';\n\n/**\n * Provides a switchMap that passes configuration from the observable, unless the value is null/undefined/true in which case it passes the default configuration.\n *\n * @param defaultConfig\n * @returns\n */\nexport function switchMapDbxInjectionComponentConfig<T extends DbxInjectionComponentConfig<X>, X = any>(defaultConfig?: GetterOrValue<Maybe<T | Type<X>>>) {\n const defaultAsGetter = asGetter(defaultConfig);\n\n return switchMapObject<T>({\n defaultGetter: () => {\n const value = defaultAsGetter();\n\n if (typeof value === 'function') {\n // is a component class\n return { componentClass: value } as T;\n } else {\n return value;\n }\n }\n });\n}\n","import { type AbstractType, Injector, type Provider, type Type } from '@angular/core';\n\nexport type InjectableType<T> = (Type<T> | AbstractType<T>) & Provider;\n\n/**\n * Creates a new instance of the injectable type with the input injector.\n *\n * @param type\n * @param parent\n * @returns\n */\nexport function newWithInjector<T>(type: InjectableType<T>, parent: Injector): T {\n const injector = Injector.create({ providers: [type], parent });\n return injector.get(type);\n}\n","import { map, type Observable } from 'rxjs';\nimport { ComponentStore } from '@ngrx/component-store';\nimport { Inject, Optional, Injectable, type OnDestroy } from '@angular/core';\nimport { LockSet, type ObservableOrValue, asObservable } from '@dereekb/rxjs';\nimport { type Maybe } from '@dereekb/util';\n\nexport interface LockSetComponent {\n readonly lockSet: LockSet;\n}\n\nexport interface LockSetComponentStoreConfig {\n readonly parent?: Maybe<Observable<LockSetComponent>>;\n readonly locks?: {\n [key: string]: Observable<boolean>;\n };\n}\n\n/**\n * Abstract ComponentStore extension that provides a LockSet and OnDestroy delaying/cleanup.\n */\n@Injectable()\nexport abstract class LockSetComponentStore<S extends object> extends ComponentStore<S> implements OnDestroy {\n readonly lockSet = new LockSet();\n\n protected lockSetDestroyDelayMs = 2000;\n protected lockSetDestroyTimeoutMs: Maybe<number>;\n\n // NOTE: Injection does not occur here, but we need @Injectable to compile properly for Angular usage\n // eslint-disable-next-line @angular-eslint/prefer-inject\n protected constructor(@Inject(null) @Optional() protected readonly initialState?: S) {\n super(initialState);\n }\n\n // MARK: State Changes\n readonly resetStore = this.updater(() => ({ ...this.initialState }) as S);\n\n // MARK: Locks\n protected setupLockSet({ parent, locks }: LockSetComponentStoreConfig): void {\n if (parent) {\n this.setParentLockSet(parent);\n }\n\n if (locks) {\n for (const key in locks) {\n if (locks[key]) {\n this.addLock(key, locks[key]);\n }\n }\n }\n }\n\n setParentLockSet(obs: ObservableOrValue<Maybe<LockSetComponent>>): void {\n this.lockSet.setParentLockSet(asObservable(obs).pipe(map((x) => x?.lockSet)));\n }\n\n addLock(key: string, obs: Observable<boolean>): void {\n this.lockSet.addLock(key, obs);\n }\n\n // MARK: Cleanup\n override ngOnDestroy(): void {\n // Wait for any actions to complete before destroying.\n this.lockSet.destroyOnNextUnlock(\n {\n fn: () => {\n this._destroyNow();\n },\n timeout: this.lockSetDestroyTimeoutMs\n },\n this.lockSetDestroyDelayMs\n );\n }\n\n /**\n * Completes the cleanup of the object.\n */\n _destroyNow() {\n this.lockSet.destroy();\n }\n}\n","import { type Observable, map } from 'rxjs';\nimport { isThrottled, unixDateTimeSecondsNumberForNow, DataDoesNotExistError, DataIsExpiredError, type ReadStoredData, type StoredData, type StoredDataStorageKey, type StoredDataString, type Maybe, hasNonNullValue, splitJoinRemainder } from '@dereekb/util';\nimport { type StorageAccessor } from './storage.accessor';\n\n// MARK: SimpleStorageAccessor\nexport interface SimpleStorageAccessorConverter<T> {\n /**\n * Converts the input value to a string.\n */\n stringifyValue(value: T): StoredDataString;\n /**\n * Converts the data string into a value.\n */\n parseValue(data: StoredDataString): T;\n}\n\n/**\n * SimpleStorageAccessor delegate.\n */\nexport interface SimpleStorageAccessorDelegate<T> extends SimpleStorageAccessorConverter<T>, StorageAccessor<StoredDataString> {}\n\nexport class StringifySimpleStorageAccessorConverter<T> implements SimpleStorageAccessorConverter<T> {\n stringifyValue(value: T): StoredDataString {\n return JSON.stringify(value);\n }\n\n parseValue(data: StoredDataString): T {\n return JSON.parse(data);\n }\n}\n\nexport class WrapperSimpleStorageAccessorDelegate<T> implements SimpleStorageAccessorDelegate<T> {\n private readonly _delegate: StorageAccessor<StoredDataString>;\n private readonly _converter: SimpleStorageAccessorConverter<T>;\n\n constructor(delegate: StorageAccessor<StoredDataString>, converter: SimpleStorageAccessorConverter<T>) {\n this._delegate = delegate;\n this._converter = converter;\n }\n\n get(key: string): Observable<Maybe<StoredDataString>> {\n return this._delegate.get(key);\n }\n\n set(key: string, value: StoredDataString): Observable<void> {\n return this._delegate.set(key, value);\n }\n\n remove(key: string): Observable<void> {\n return this._delegate.remove(key);\n }\n\n clear(): Observable<object> {\n return this._delegate.clear();\n }\n\n all(prefix?: string): Observable<string[]> {\n return this._delegate.all(prefix);\n }\n\n allKeys(prefix?: string): Observable<string[]> {\n return this._delegate.allKeys(prefix);\n }\n\n stringifyValue(value: T): StoredDataString {\n return this._converter.stringifyValue(value);\n }\n\n parseValue(data: StoredDataString): T {\n return this._converter.parseValue(data);\n }\n}\n\nexport interface SimpleStorageAccessorConfig {\n /**\n * Storage Key Prefix\n */\n readonly prefix: string;\n /**\n * Optional prefix/value splitter.\n */\n readonly prefixSplitter?: string;\n /**\n * Number in milliseconds that objects stored will expire in.\n */\n readonly expiresIn?: number;\n}\n\ninterface ConfiguredSimpleStorageAccessorConfig extends SimpleStorageAccessorConfig {\n readonly prefixSplitter: string;\n readonly fullPrefix: string;\n}\n\nexport function assertValidStorageKeyPrefix(prefix: string, prefixSplitter: string): void {\n if (!prefixSplitter) {\n throw new Error('Invalid storage key prefix splitter. Must be defined and not empty.'); // TODO(FUTURE): Consider changing to a concrete error type\n }\n\n if (!isValidStorageKeyPrefix(prefix, prefixSplitter)) {\n throw new Error('Invalid storage key prefix.');\n }\n}\n\nexport function isValidStorageKeyPrefix(prefix: string, prefixSpltter: string): boolean {\n return Boolean(prefix && prefix.indexOf(prefixSpltter) === -1);\n}\n\n/**\n * LimitedStorageAccessor implementation that uses a Delegate\n */\nexport class SimpleStorageAccessor<T> implements StorageAccessor<T> {\n static readonly PREFIX_SPLITTER = '::';\n\n private readonly _delegate: SimpleStorageAccessorDelegate<T>;\n protected readonly _config: ConfiguredSimpleStorageAccessorConfig;\n\n constructor(delegate: SimpleStorageAccessorDelegate<T>, config: SimpleStorageAccessorConfig) {\n const prefix = config.prefix;\n const prefixSplitter = config.prefixSplitter ?? SimpleStorageAccessor.PREFIX_SPLITTER;\n\n assertValidStorageKeyPrefix(prefix, prefixSplitter);\n\n const fullPrefix = `${prefix}${prefixSplitter}`;\n\n this._delegate = delegate;\n this._config = {\n ...config,\n prefixSplitter,\n fullPrefix\n };\n }\n\n get delegate() {\n return this._delegate;\n }\n\n get config() {\n return this._config;\n }\n\n // MARK: LimitedStorageAccessor\n get(inputKey: string): Observable<T> {\n const storeKey = this.makeStorageKey(inputKey);\n return this._delegate.get(storeKey).pipe(\n map((storedData: Maybe<string>) => {\n if (storedData) {\n const readStoredData = this.readStoredData(storedData);\n\n if (!readStoredData.expired) {\n return readStoredData.convertedData;\n } else {\n throw new DataIsExpiredError<T>(readStoredData);\n }\n } else {\n throw new DataDoesNotExistError();\n }\n })\n );\n }\n\n set(inputKey: string, inputValue: T): Observable<void> {\n const storeKey = this.makeStorageKey(inputKey);\n const storeData: StoredData = this.buildStoredData(inputValue);\n const data = JSON.stringify(storeData);\n return this._delegate.set(storeKey, data);\n }\n\n remove(key: string): Observable<void> {\n const storeKey = this.makeStorageKey(key);\n return this._delegate.remove(storeKey);\n }\n\n all(): Observable<T[]> {\n return this._delegate.all(this._config.fullPrefix).pipe(\n map((allStoredData) => {\n return allStoredData\n .map((storedData) => {\n const readStoredData = this.readStoredData(storedData);\n\n if (!readStoredData.expired) {\n return readStoredData.convertedData;\n } else {\n return null;\n }\n })\n .filter(hasNonNullValue);\n })\n );\n }\n\n allKeys(): Observable<string[]> {\n return this._delegate.allKeys(this._config.fullPrefix).pipe(map((keys) => keys.map((x) => this.decodeStorageKey(x))));\n }\n\n clear(): Observable<object> {\n return this._delegate.clear();\n }\n\n // MARK: Stored Values\n protected readStoredData(storedDataString: StoredDataString): ReadStoredData<T> {\n const storedData: StoredData = JSON.parse(storedDataString);\n const expired = this.isExpiredStoredData(storedData);\n const convertedData = this._delegate.parseValue(storedData.data);\n\n return {\n ...storedData,\n expired,\n convertedData\n };\n }\n\n protected buildStoredData(value: T): StoredData {\n return {\n storedAt: unixDateTimeSecondsNumberForNow(),\n data: this.stringifyValue(value)\n };\n }\n\n protected isExpiredStoredData(storeData: StoredData): boolean {\n const expiresIn = this._config.expiresIn;\n if (expiresIn) {\n if (storeData.storedAt) {\n return isThrottled(expiresIn, storeData.storedAt);\n }\n\n return true;\n } else {\n return false;\n }\n }\n\n // MARK: Internal\n protected makeStorageKey(key: string): StoredDataStorageKey {\n return `${this._config.prefix}${this._config.prefixSplitter}${String(key)}`;\n }\n\n protected isKeyOfAccessor(storageKey: StoredDataStorageKey): boolean {\n return storageKey.startsWith(this._config.fullPrefix);\n }\n\n protected decodeStorageKey(storageKey: StoredDataStorageKey): string {\n const split = splitJoinRemainder(storageKey, this._config.prefixSplitter, 2);\n return split[1];\n }\n\n protected stringifyValue(value: T): string {\n return this._delegate.stringifyValue(value);\n }\n}\n","import { filterMaybeArrayValues, type StoredDataString, type FullStorageObject, StorageObjectUtility, type Maybe } from '@dereekb/util';\nimport { Observable, map, shareReplay } from 'rxjs';\nimport { type StorageAccessor } from './storage.accessor';\n\n/**\n * Simple StorageAccessor implementation that wraps a FullStorageObject.\n */\nexport class StringStorageAccessor implements StorageAccessor<StoredDataString> {\n private readonly _storage: FullStorageObject;\n\n constructor(storage: FullStorageObject) {\n this._storage = storage;\n }\n\n get(key: string): Observable<Maybe<StoredDataString>> {\n return new Observable((x) => {\n const value = this._storage.getItem(key);\n x.next(value);\n x.complete();\n });\n }\n\n set(key: string, value: StoredDataString): Observable<void> {\n return new Observable<void>((x) => {\n this._storage.setItem(key, value);\n x.next();\n x.complete();\n });\n }\n\n remove(key: string): Observable<void> {\n return new Observable<void>((x) => {\n this._storage.removeItem(key);\n x.next();\n x.complete();\n });\n }\n\n clear(): Observable<StoredDataString[]> {\n const removed = this._storage.removeAll();\n return new Observable((x) => {\n x.next(removed);\n x.complete();\n });\n }\n\n all(): Observable<StoredDataString[]> {\n return this.allKeys().pipe(\n map((x) => filterMaybeArrayValues(x.map((y) => this._storage.getItem(y)))),\n shareReplay(1)\n );\n }\n\n allKeys(): Observable<string[]> {\n return new Observable((x) => {\n const result = StorageObjectUtility.allKeysFromStorageObject(this._storage);\n x.next(result);\n x.complete();\n });\n }\n}\n","import { InjectionToken } from '@angular/core';\n\nexport const DEFAULT_STORAGE_OBJECT_TOKEN = new InjectionToken('DBX_CORE_DEFAULT_STORAGE_OBJECT');\nexport const DEFAULT_STORAGE_ACCESSOR_FACTORY_TOKEN = new InjectionToken('DBX_CORE_DEFAULT_STORAGE_ACCESSOR_FACTORY');\n","import { Injectable, inject } from '@angular/core';\nimport { type StorageAccessor } from './storage.accessor';\nimport { type SimpleStorageAccessorConfig, SimpleStorageAccessor, type SimpleStorageAccessorConverter, StringifySimpleStorageAccessorConverter, WrapperSimpleStorageAccessorDelegate } from './storage.accessor.simple';\nimport { StringStorageAccessor } from './storage.accessor.string';\nimport { DEFAULT_STORAGE_OBJECT_TOKEN } from './storage.di';\nimport { type FullStorageObject, type StoredDataString } from '@dereekb/util';\n\nexport interface StorageAccessorFactoryConfig<T> extends SimpleStorageAccessorConfig {\n storage?: StorageAccessor<StoredDataString>;\n converter?: SimpleStorageAccessorConverter<T>;\n}\n\n/**\n * Used for building SimpleStorageAccessor instances from SimpleStorageAccessorConfig.\n */\n@Injectable()\nexport class SimpleStorageAccessorFactory {\n readonly storageObject = inject<FullStorageObject>(DEFAULT_STORAGE_OBJECT_TOKEN);\n\n createStorageAccessor<T>(config: StorageAccessorFactoryConfig<T>): SimpleStorageAccessor<T> {\n const storage = config.storage ?? new StringStorageAccessor(this.storageObject);\n const converter = config.converter ?? new StringifySimpleStorageAccessorConverter<T>();\n const delegate = new WrapperSimpleStorageAccessorDelegate<T>(storage, converter);\n\n const accessorConfig = {\n prefix: config.prefix\n };\n\n return new SimpleStorageAccessor<T>(delegate, accessorConfig);\n }\n}\n","import { type Maybe } from '@dereekb/util';\nimport { type Observable } from 'rxjs';\n\n/**\n * Stored object accessor that can get/set/remove via a key, or be cleared entirely.\n */\nexport abstract class LimitedStorageAccessor<T> {\n /**\n * Attempts to get the value. Throws a DataDoesNotExistError if not available.\n */\n abstract get(key: string): Observable<Maybe<T>>;\n\n abstract set(key: string, value: Maybe<T>): Observable<void>;\n\n abstract remove(key: string): Observable<void>;\n\n abstract clear(): Observable<object>;\n}\n\n/**\n * LimitedStorageAccessor extension that has knowledge of all stored keys.\n */\nexport abstract class StorageAccessor<T> extends LimitedStorageAccessor<T> {\n /**\n * Returns all values. Filtered by keys of a given prefix.\n */\n abstract all(prefix?: string): Observable<T[]>;\n\n /**\n * Returns all keys. Filtered by keys of a given prefix.\n */\n abstract allKeys(prefix?: string): Observable<string[]>;\n}\n\n/**\n * StorageAccessor-like object that has immediate/synchronous functionality for get/set.\n */\nexport abstract class InstantStorageAccessor<T> {\n abstract getNow(key: string): T | undefined;\n\n abstract setNow(key: string, value: T): void;\n\n abstract removeNow(key: string): void;\n}\n","import { type FullStorageObject, type Maybe, type StorageObject, StorageObjectUtility, type StoredDataStorageKey } from '@dereekb/util';\n\n/**\n * StorageObject using LocalStorage.\n */\nexport class FullLocalStorageObject implements FullStorageObject {\n private readonly _localStorage: StorageObject;\n\n constructor(localStorage: StorageObject) {\n this._localStorage = localStorage;\n }\n\n get isPersistant(): boolean {\n return true;\n }\n\n get isAvailable(): boolean {\n const test = '_T_E_S_T_';\n\n try {\n // Tests setting and removing an item. These will throw an\n // exception if the localstorage is not available\n this._localStorage.setItem(test, test);\n this._localStorage.removeItem(test);\n return true;\n } catch (e) {\n return false;\n }\n }\n\n get length(): number {\n return this._localStorage.length;\n }\n\n getItem(key: StoredDataStorageKey): Maybe<string> {\n return this._localStorage.getItem(key);\n }\n\n setItem(key: StoredDataStorageKey, item: string): void {\n this._localStorage.setItem(key, item);\n }\n\n removeItem(key: StoredDataStorageKey): void {\n this._localStorage.removeItem(key);\n }\n\n key(index: number): string | null {\n return this._localStorage.key(index);\n }\n\n removeAll(): string[] {\n const keys = StorageObjectUtility.allKeysFromStorageObject(this);\n keys.forEach((x) => this.removeItem(x));\n return keys;\n }\n}\n","import { SHARED_MEMORY_STORAGE } from '@dereekb/util';\nimport { FullLocalStorageObject } from './storage.object.localstorage';\n\n/**\n * FullStorageObject implementation that uses a localstorage that entirely resides in memory.\n */\nexport class MemoryStorageObject extends FullLocalStorageObject {\n get isLastingStorage(): boolean {\n return false;\n }\n\n override get isAvailable(): boolean {\n return true;\n }\n\n constructor() {\n super(SHARED_MEMORY_STORAGE);\n }\n}\n","import { type EnvironmentProviders, type Provider, makeEnvironmentProviders } from '@angular/core';\nimport { type FullStorageObject } from '@dereekb/util';\nimport { SimpleStorageAccessorFactory } from './storage.accessor.simple.factory';\nimport { DEFAULT_STORAGE_OBJECT_TOKEN, DEFAULT_STORAGE_ACCESSOR_FACTORY_TOKEN } from './storage.di';\nimport { FullLocalStorageObject } from './storage.object.localstorage';\nimport { MemoryStorageObject } from './storage.object.memory';\n\n/**\n * Default storage object factory function that creates a FullLocalStorageObject,\n * falling back to MemoryStorageObject if localStorage is not available.\n */\nexport function defaultStorageObjectFactory(): FullStorageObject {\n let storageObject: FullStorageObject = new FullLocalStorageObject(localStorage);\n\n if (!storageObject.isAvailable) {\n storageObject = new MemoryStorageObject();\n }\n\n return storageObject;\n}\n\n/**\n * Creates EnvironmentProviders for providing a default storage object and SimpleStorageAccessorFactory.\n *\n * @returns EnvironmentProviders\n */\nexport function provideDbxStorage(): EnvironmentProviders {\n const providers: Provider[] = [\n // Storage object\n {\n provide: DEFAULT_STORAGE_OBJECT_TOKEN,\n useFactory: defaultStorageObjectFactory\n },\n // Storage accessor factory\n {\n provide: SimpleStorageAccessorFactory,\n useClass: SimpleStorageAccessorFactory\n },\n {\n provide: DEFAULT_STORAGE_ACCESSOR_FACTORY_TOKEN,\n useExisting: SimpleStorageAccessorFactory\n }\n ];\n\n return makeEnvironmentProviders(providers);\n}\n","import { type MonoTypeOperatorFunction, tap } from 'rxjs';\nimport { type ChangeDetectorRef, type ViewRef, type ElementRef } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\n\n/**\n * Convenience function used within observables for views that need to detect changes after a value changes.\n *\n * @deprecated reminder to move to Angular signals\n *\n * @param cdRef\n * @param timeout\n * @returns\n */\nexport function tapDetectChanges<T>(cdRef: Maybe<ChangeDetectorRef>, timeout = 0): MonoTypeOperatorFunction<T> {\n return cdRef ? tap(() => setTimeout(() => safeDetectChanges(cdRef), timeout)) : tap();\n}\n\n/**\n * Triggers a check for detecting any changes on the model safely to ve registered via detectChanges().\n *\n * @deprecated reminder to move to Angular signals\n *\n * @param cdRef\n */\nexport function safeDetectChanges(cdRef: ChangeDetectorRef): void {\n safeUseCdRef(cdRef, () => cdRef.detectChanges());\n}\n\n/**\n * Convenience function used within observables for views that use the OnPush ChangeDetectionStrategy and needs to call markForCheck when a new observable value is pushed.\n *\n * NOTE: If the observable is being consumed via the \"async\" pipe, this may not be necessary.\n *\n * @deprecated reminder to move to Angular signals\n * @param cdRef\n * @param timeout\n * @returns\n */\nexport function tapSafeMarkForCheck<T>(cdRef: Maybe<ChangeDetectorRef>, timeout = 0): MonoTypeOperatorFunction<T> {\n return cdRef ? tap(() => setTimeout(() => safeMarkForCheck(cdRef), timeout)) : tap();\n}\n\n/**\n * Marks the ChangeDetectorRef for changes as long as the view has not been destroyed.\n *\n * @deprecated reminder to move to Angular signals\n *\n * @param cdRef\n */\nexport function safeMarkForCheck(cdRef: ChangeDetectorRef): void {\n safeUseCdRef(cdRef, () => cdRef.markForCheck());\n}\n\n/**\n * Triggers a detection change on the input view as long as the view has not been destroyed.\n *\n * @deprecated reminder to move to Angular signals\n * @param cdRef\n */\nexport function safeUseCdRef(cdRef: ChangeDetectorRef, use: (cdRef: ChangeDetectorRef) => void): void {\n if (!(cdRef as ViewRef).destroyed) {\n use(cdRef);\n }\n}\n\n/**\n * Used to check an injected ElementRef that wraps an ng-content injection point whether or not any content was injected,\n * or more specifically if the parent component passed any target content to the child. This will still return true if\n * passed content is empty.\n *\n * TS:\n * @ViewChild('customLoading', { static: false }) customCustom: ElementRef;\n *\n * HTML:\n * <div #customContent>\n * <ng-content select=\"[content]\"></ng-content>\n * </div>\n */\nexport function checkNgContentWrapperHasContent(ref: Maybe<ElementRef<Element>>): boolean {\n // https://github.com/angular/angular/issues/26083\n let hasContent = false;\n\n if (ref != null) {\n const childNodes = ref.nativeElement.childNodes;\n const hasChildNodes = childNodes && childNodes.length > 0;\n hasContent = Boolean(hasChildNodes);\n }\n\n return hasContent;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["importsAndExports","initialState","reducer","DbxAppContextActions.setState","featureKey","reducers","fromDbxAppContextState.dbxAppContextStateFeatureKey","fromDbxAppContextState.reducer","onDbxAppContext.DbxAppContextActions.setState","DbxAppAuthActions.loggedOut","DbxAppAuthUserActions.setUserIdentifier","DbxAppAuthUserActions.setUserIsOnboarded","DbxAppAuthUserActions.setUserState","DbxAppAuthUserActions.setUserRoles","fromDbxAppAuthUserState.dbxAppAuthUserFeatureKey","fromDbxAppAuthUserState.reducer","onDbxAppAuth.DbxAppAuthActions.loggedOut","onDbxAppAuth.DbxAppAuthActions.loggedIn","onDbxAppAuth.DbxAppAuthActions.logout","onDbxAppAuth.DbxAppAuthUserActions.setUserIdentifier","onDbxAppAuth.DbxAppAuthUserActions.setUserState","onDbxAppAuth.DbxAppAuthUserActions.setUserRoles","onDbxAppAuth.DbxAppAuthUserActions.setUserIsOnboarded","fromDbxAppAuth.featureKey","fromDbxAppAuth.reducers","fromDbxAppAuth.selectDbxAppAuthUser","fromDbxAppContext.selectDbxAppContextState","onDbxAppContext.DbxAppContextActions.resetState","fromDbxAppContext.featureKey","fromDbxAppContext.reducers"],"mappings":";;;;;;;;;;;;;;;AAIA;;;;;;;;;;;;;;AAcG;AACG,SAAU,KAAK,CAA0C,KAAQ,EAAA;AACrE,IAAA,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAErC,IAAA,IAAK,KAAqB,CAAC,OAAO,EAAE;QAClC,UAAU,CAAC,SAAS,CAAC,MAAO,KAAqB,CAAC,OAAO,EAAE,CAAC;IAC9D;SAAO;AACL,QAAA,UAAU,CAAC,SAAS,CAAC,KAAwB,CAAC;IAChD;AAEA,IAAA,OAAO,KAAK;AACd;AAEA;;;;;;;;;;;;;AAaG;AACG,SAAU,iBAAiB,CAAqD,KAAQ,EAAA;IAC5F,KAAK,CAAC,MAAM,KAAK,CAAC,QAAQ,EAAE,CAAC;AAC7B,IAAA,OAAO,KAAK;AACd;;AC3CA;AACA;;;;;;;;;;;;AAYG;AACG,SAAU,iBAAiB,CAA4C,GAA6B,EAAA;AACxG,IAAA,MAAM,YAAY,GAAG,kBAAkB,CAAC,GAAG,CAAC;AAC5C,IAAA,MAAM,kBAAkB,GAAG,IAAI,kBAAkB,CAAI,YAAY,CAAC;IAClE,KAAK,CAAC,kBAAkB,CAAC;AACzB,IAAA,OAAO,kBAAkB;AAC3B;;ACDA;;;;;;;;;;;;;;;;AAgBG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