{"version":3,"file":"odx-angular-utils.mjs","sources":["../../../../libs/angular/utils/src/lib/decorators/pure.ts","../../../../libs/angular/utils/src/lib/helpers/type-guards.ts","../../../../libs/angular/utils/src/lib/helpers/dom.ts","../../../../libs/angular/utils/src/lib/helpers/until-destroyed.ts","../../../../libs/angular/utils/src/lib/helpers/angular.ts","../../../../libs/angular/utils/src/lib/helpers/animations-handler.ts","../../../../libs/angular/utils/src/lib/helpers/array.ts","../../../../libs/angular/utils/src/lib/helpers/build-url.ts","../../../../libs/angular/utils/src/lib/helpers/build-website-url.ts","../../../../libs/angular/utils/src/lib/helpers/cache-storage-client.ts","../../../../libs/angular/utils/src/lib/helpers/coercion.ts","../../../../libs/angular/utils/src/lib/helpers/debounce.ts","../../../../libs/angular/utils/src/lib/helpers/defer-fn.ts","../../../../libs/angular/utils/src/lib/helpers/get-unique-id.ts","../../../../libs/angular/utils/src/lib/helpers/event-manager.ts","../../../../libs/angular/utils/src/lib/types/axis.ts","../../../../libs/angular/utils/src/lib/types/position.ts","../../../../libs/angular/utils/src/lib/types/side.ts","../../../../libs/angular/utils/src/lib/helpers/get-side.ts","../../../../libs/angular/utils/src/lib/helpers/get-axis.ts","../../../../libs/angular/utils/src/lib/helpers/get-language-code.ts","../../../../libs/angular/utils/src/lib/helpers/get-opposite-side.ts","../../../../libs/angular/utils/src/lib/helpers/match-url.ts","../../../../libs/angular/utils/src/lib/helpers/ng-changes.ts","../../../../libs/angular/utils/src/lib/helpers/provide-config.ts","../../../../libs/angular/utils/src/lib/helpers/queue.ts","../../../../libs/angular/utils/src/lib/helpers/sorter.ts","../../../../libs/angular/utils/src/odx-angular-utils.ts"],"sourcesContent":["/**\n * A decorator that transforms a class method or getter into a pure function. For methods, it caches the result\n * of the first invocation with a given set of arguments and returns the cached result on subsequent invocations\n * with the same arguments. For getters, it caches the result of the first access and returns the cached value\n * on subsequent accesses.\n *\n * This decorator is intended to improve performance by avoiding unnecessary recalculations or processing\n * when the inputs have not changed.\n *\n * @template T The type of the property being decorated.\n * @param {object} _target The prototype of the class.\n * @param {string} propertyKey The name of the method or getter.\n * @param {TypedPropertyDescriptor<T>} descriptor The property descriptor for the method or getter.\n * @throws {Error} Throws an error if applied to non-function properties.\n * @returns {TypedPropertyDescriptor<T>} A new descriptor with the getter or method patched for pure behavior.\n *\n * @example\n * Usage with a getter:\n * ```ts\n * class ExampleClass {\n *   private _value: number = Math.random();\n *\n *   @Pure\n *   get value(): number {\n *     console.log('Getter called');\n *     return this._value;\n *   }\n * }\n *\n * const example = new ExampleClass();\n * console.log(example.value); // Logs 'Getter called' and the value\n * console.log(example.value); // Logs only the value, without calling the getter again\n * ```\n *\n * Usage with a method:\n * ```ts\n * class Counter {\n *   private count = 0;\n *\n *   @Pure\n *   increment(step: number) {\n *     console.log('Increment called');\n *     return (this.count += step);\n *   }\n * }\n *\n * const counter = new Counter();\n * console.log(counter.increment(1)); // Logs 'Increment called' and 1\n * console.log(counter.increment(1)); // Logs 1 without calling increment again\n * ```\n */\nexport function Pure<T>(_target: object, propertyKey: string, { get, enumerable, value }: TypedPropertyDescriptor<T>): TypedPropertyDescriptor<T> {\n  if (get) {\n    return {\n      enumerable,\n      get(): T {\n        const value = get.call(this);\n\n        Object.defineProperty(this, propertyKey, { enumerable, value });\n\n        return value;\n      },\n    };\n  }\n\n  if (typeof value !== 'function') {\n    throw new Error('@Pure decorator can only be applied to functions or getters!');\n  }\n\n  const originalValue = value;\n\n  return {\n    enumerable,\n    get(): T {\n      let previousArgs: readonly unknown[] = [];\n      let wasCalled = false;\n      let pureValue: unknown;\n\n      const patched = (...args: unknown[]): unknown => {\n        const isPure = wasCalled && previousArgs.length === args.length && args.every((arg, index) => arg === previousArgs[index]);\n\n        if (isPure) {\n          return pureValue;\n        }\n\n        previousArgs = args;\n        pureValue = originalValue.apply(this, args);\n        wasCalled = true;\n\n        return pureValue;\n      };\n\n      Object.defineProperty(this, propertyKey, { value: patched });\n\n      return patched as unknown as T;\n    },\n  };\n}\n","import { TemplateRef, Type, ViewContainerRef } from '@angular/core';\n\n/**\n * Checks if the given value is a `ViewContainerRef`.\n *\n * @param {unknown} value - The value to check.\n * @returns {value is ViewContainerRef} `true` if the value is a `ViewContainerRef`, otherwise `false`.\n */\nexport function isViewContainer(value: unknown): value is ViewContainerRef {\n  return isFunction((value as ViewContainerRef)?.createComponent);\n}\n\n/**\n * Checks if the given value is a `TemplateRef`.\n *\n * @template T - The embedded view type.\n * @param {unknown} value - The value to check.\n * @returns {value is TemplateRef<T>} `true` if the value is a `TemplateRef`, otherwise `false`.\n */\nexport function isTemplateRef<T = unknown>(value: unknown): value is TemplateRef<T> {\n  return value instanceof TemplateRef;\n}\n\n/**\n * Checks if the given value is an Angular component class.\n *\n * @template T - The component class type.\n * @param {unknown} value - The value to check.\n * @returns {value is Type<T>} `true` if the value is a component class, otherwise `false`.\n */\nexport function isComponent<T = unknown>(value: unknown): value is Type<T> {\n  return isFunction(value);\n}\n\n/**\n * Checks if the given value is a string.\n *\n * @param {unknown} value - The value to check.\n * @returns {value is string} `true` if the value is a string, otherwise `false`.\n */\nexport function isString(value: unknown): value is string {\n  return typeof value === 'string';\n}\n\n/**\n * Checks if the given value is a non-empty string.\n *\n * @param {unknown} value - The value to check.\n * @returns {value is string} `true` if the value is a non-empty string, otherwise `false`.\n */\nexport function isNonEmptyString(value: unknown): value is string {\n  return isString(value) && value.length > 0;\n}\n\n/**\n * Checks if the given value is a boolean.\n *\n * @param {unknown} value - The value to check.\n * @returns {value is boolean} `true` if the value is a boolean, otherwise `false`.\n */\nexport function isBoolean(value: unknown): value is boolean {\n  return value === true || value === false;\n}\n\n/**\n * Checks if the given value is a function.\n *\n * @param {unknown} value - The value to check.\n * @returns {value is CallableFunction} `true` if the value is a function, otherwise `false`.\n */\nexport function isFunction(value: unknown): value is CallableFunction {\n  return typeof value === 'function';\n}\n\n/**\n * Checks if the given value is present (not null or undefined).\n *\n * @template T - The value type.\n * @param {T | null | undefined} value - The value to check.\n * @returns {value is NonNullable<T>} `true` if the value is present, otherwise `false`.\n */\nexport function isPresent<T>(value: T | null | undefined): value is NonNullable<T> {\n  return value !== null && value !== undefined;\n}\n\n/**\n * Checks if the given value is a number.\n *\n * @param {unknown} value - The value to check.\n * @returns {value is number} `true` if the value is a number, otherwise `false`.\n */\nexport function isNumber(value: unknown): value is number {\n  return typeof value === 'number';\n}\n","import { Subscriber } from 'rxjs';\nimport { isNumber, isString } from './type-guards';\n\n/**\n * Applies a set of CSS styles to an HTML element.\n *\n * @param {HTMLElement} element - The element to apply styles to.\n * @param {Partial<CSSStyleDeclaration | Record<keyof CSSStyleDeclaration, string | null>>} styles - An object containing CSS properties and values to apply.\n */\nexport function applyStyles(element: HTMLElement, styles: Partial<CSSStyleDeclaration | Record<keyof CSSStyleDeclaration, string | null>>): void {\n  Object.assign(element.style, styles);\n}\n\n/**\n * Converts a boolean value to a corresponding attribute string.\n *\n * @param {boolean} state - The boolean state to convert.\n * @returns {string} 'true' if the state is true; otherwise, 'false'.\n */\nexport function booleanToAttributeString(state: boolean): string {\n  return booleanToOptionalAttributeString(state) ?? 'false';\n}\n\n/**\n * Converts a boolean value to 'true' or null, useful for setting attributes based on boolean conditions.\n *\n * @param {boolean} state - The boolean state to convert.\n * @returns {string | null} 'true' if the state is true; otherwise, null.\n */\nexport function booleanToOptionalAttributeString(state: boolean): string | null {\n  return state ? 'true' : null;\n}\n\n/**\n * Converts a numeric value to a pixel string, appending 'px' to the number.\n *\n * @param {unknown} value - The value to convert to pixels.\n * @returns {`${number}px`} The value in pixels, or '0px' if the input is not a number.\n */\nexport function px(value: unknown): `${number}px` {\n  return isNumber(value) ? `${value}px` : '0px';\n}\n\n/**\n * Generates a CSS translate3d string for given x and y values.\n *\n * @param {string | 0} x - The translation value along the x-axis.\n * @param {string | 0} y - The translation value along the y-axis.\n * @returns {`translate3d(${string | 0}, ${string | 0}, 0)`} The CSS translate3d value.\n */\nexport function cssTranslate(x: string | 0, y: string | 0): `translate3d(${string | 0}, ${string | 0}, 0)` {\n  return `translate3d(${x}, ${y}, 0)`;\n}\n\n/**\n * Disables or re-enables CSS transitions on an element.\n *\n * @param {HTMLElement} element - The element to modify.\n * @param {boolean} disabled - Whether to disable CSS transitions.\n */\nexport function disableCSSTransitions(element: HTMLElement, disabled: boolean): void {\n  if (disabled) {\n    applyStyles(element, { transition: 'none' });\n  } else {\n    forceLayoutReflow(element);\n    applyStyles(element, { transition: null });\n  }\n}\n\n/**\n * Forces the browser to reflow the layout, useful for triggering CSS transitions or animations.\n *\n * @param {HTMLElement} element - The element to force a reflow on.\n */\nexport function forceLayoutReflow(element: HTMLElement): number {\n  return element.offsetHeight;\n}\n\n/**\n * Sets an attribute on an HTML element, converting the value to a string if necessary.\n *\n * @param {HTMLElement} element - The element to set the attribute on.\n * @param {string} attribute - The name of the attribute to set.\n * @param {unknown} value - The value of the attribute; will be converted to a string if it's not null or undefined.\n */\nexport function setAttribute(element: HTMLElement, attribute: string, value?: unknown) {\n  if (isString(value) || isNumber(value)) {\n    element.setAttribute(attribute, value.toString());\n  } else {\n    element.toggleAttribute(attribute, !!value);\n  }\n}\n\n/**\n * Creates a ResizeObserver instance safely, falling back to a dummy if the API is not supported.\n *\n * @param {ResizeObserverCallback} callback - The callback to execute when an observed element's size changes.\n * @returns {ResizeObserver} A ResizeObserver instance or a dummy object with no-op methods if unsupported.\n */\nexport function createResizeObserver(callback: ResizeObserverCallback): ResizeObserver {\n  try {\n    return new ResizeObserver(callback);\n  } catch {\n    return { observe: () => void 0, disconnect: () => void 0, unobserve: () => void 0 };\n  }\n}\n\n/**\n * Creates a MutationObserver instance safely, falling back to a dummy if the API is not supported.\n *\n * @param {Subscriber<MutationRecord>} observer - The RxJS Subscriber to emit next values to.\n * @param {(mutations: MutationRecord[]) => boolean} callback - The callback that determines whether to notify the observer based on mutations.\n * @returns {MutationObserver} A MutationObserver instance or a dummy object with no-op methods if unsupported.\n */\nexport function createMutationObserver(observer: Subscriber<MutationRecord>, callback: (mutations: MutationRecord[]) => boolean): MutationObserver {\n  try {\n    return new MutationObserver((mutations) => {\n      if (callback(mutations)) {\n        observer.next(mutations[0]);\n      }\n    });\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  } catch (error) {\n    return { disconnect: () => void 0, observe: () => void 0, takeRecords: () => [] };\n  }\n}\n\n/**\n * Checks whether one element contains another in the DOM tree.\n *\n * @param {Element | null} parent - The parent element.\n * @param {Element | null} other - The element to check for containment.\n * @param {boolean} [inclusive=true] - Whether to consider an element as containing itself.\n * @returns {boolean} True if the parent contains the other element; false otherwise.\n */\nexport function containsElement(parent?: Element | null, other?: Element | null, inclusive = true): boolean {\n  if (!parent || !other) return false;\n  if (!inclusive && parent === other) return false;\n  return parent.contains(other);\n}\n","import { DestroyRef, inject } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { MonoTypeOperatorFunction } from 'rxjs';\n\n/**\n * Creates a MonoTypeOperatorFunction that automatically unsubscribes from observables when the host component or service is destroyed.\n * It uses Angular's `DestroyRef` to detect when the component or service is destroyed and triggers the unsubscription at that point.\n * This utility function helps in managing subscriptions and prevents memory leaks by ensuring observables are unsubscribed when no longer needed.\n *\n * @returns A function that returns a `MonoTypeOperatorFunction<T>`, which can be used in an RxJS pipe to automatically unsubscribe\n * based on the component's or service's lifecycle.\n *\n * @example\n * ```ts\n * // In an Angular component or service\n * import { Component } from '@angular/core';\n * import { Observable } from 'rxjs';\n * import { untilDestroyed } from './path/to/untilDestroyed';\n *\n * @Component({\n *   selector: 'app-example',\n *   template: `<div>Example Component</div>`,\n * })\n * export class ExampleComponent {\n *   private readonly takeUntilDestroyed = untilDestroyed();\n *\n *   constructor() {\n *     const exampleObservable$ = new Observable(observer => {\n *       // Observable logic here\n *     });\n *\n *     exampleObservable$.pipe(\n *       this.takeUntilDestroyed(),\n *     ).subscribe(data => {\n *       // Subscription logic here\n *     });\n *   }\n *\n *   // No need to manually implement ngOnDestroy to unsubscribe\n * }\n * ```\n */\nexport function untilDestroyed(): <T>() => MonoTypeOperatorFunction<T> {\n  const destroyRef = inject(DestroyRef);\n\n  return () => takeUntilDestroyed(destroyRef);\n}\n","import { ElementRef, inject } from '@angular/core';\nimport { MonoTypeOperatorFunction, Observable, tap } from 'rxjs';\nimport { setAttribute } from './dom';\nimport { untilDestroyed } from './until-destroyed';\n\nfunction reactiveBinding<T>(updateFn: (state: unknown) => void): MonoTypeOperatorFunction<T> {\n  const takeUntilDestroyed = untilDestroyed();\n\n  return (source$: Observable<T>) =>\n    source$.pipe(\n      tap((state) => updateFn(state)),\n      takeUntilDestroyed(),\n    );\n}\n\n/**\n * Binds an observable to toggle a CSS class on the host element based on the truthiness of the emitted values.\n * The subscription automatically ends when the component is destroyed.\n *\n * @template T The type of items emitted by the source observable.\n * @param {Observable<T> | null | undefined} source$ The observable source emitting truthy or falsy values.\n * @param {string} cssClass The CSS class to toggle based on the emitted values.\n */\nexport function reactiveClassBinding<T>(source$: Observable<T> | null | undefined, cssClass: string): void {\n  const { nativeElement } = injectElement();\n\n  if (source$) {\n    source$.pipe(reactiveBinding((state) => nativeElement.classList.toggle(cssClass, !!state))).subscribe();\n  }\n}\n\n/**\n * Binds an observable to update attributes on the host element with the emitted values.\n * The subscription automatically ends when the component is destroyed.\n *\n * @template T The type of items emitted by the source observable.\n * @param {Observable<T> | null | undefined} source$ The observable source.\n * @param {...string[]} attributes The attributes to set on the host element based on the emitted values.\n */\nexport function reactiveAttributeBinding<T>(source$: Observable<T> | null | undefined, ...attributes: string[]): void {\n  const { nativeElement } = injectElement();\n\n  if (source$) {\n    source$\n      .pipe(\n        reactiveBinding((value) => {\n          for (const attribute of attributes) {\n            setAttribute(nativeElement, attribute, value);\n          }\n        }),\n      )\n      .subscribe();\n  }\n}\n\n/**\n * Injects the ElementRef of the host element in an Angular component or directive.\n *\n * @template T The expected type of the native element.\n * @returns {ElementRef<T>} The injected ElementRef instance.\n */\nexport function injectElement<T = HTMLElement>(): ElementRef<T> {\n  return inject<ElementRef<T>>(ElementRef);\n}\n","/**\n * Waits for all animations on the given element (and optionally its descendants) to finish.\n *\n * @param {Element|null} [element] - The DOM element to check for animations. If not provided or invalid, the function resolves to an empty array.\n * @param {boolean} [subtree=false] - Whether to include animations from child elements (subtree) of the given element.\n * @returns {Promise<Animation[]>} A promise that resolves with an array of finished animations or an empty array if no animations are found.\n *\n * @example\n * // Wait for animations on a specific element and its subtree to complete\n * waitForAnimations(document.querySelector('.my-element'), true).then(() => {\n *   console.log('All animations are finished');\n * });\n */\nexport async function waitForAnimations(element?: Element | null, subtree = false): Promise<Animation[]> {\n  if (!element || typeof element.getAnimations !== 'function') {\n    return [];\n  }\n\n  return Promise.all(element.getAnimations({ subtree }).map((animation) => animation.finished)).catch(() => []);\n}\n","import { isNumber, isString } from './type-guards';\n\n/**\n * Extracts the values of a specified key from each object in an array.\n *\n * @template T - The type of the objects in the array.\n * @template K - The type of the keys of `T`.\n * @param {T[]} arr - The array of objects to pluck values from.\n * @param {K} key - The key whose values are to be plucked from each object in the array.\n * @returns {Array<T[K]>} An array of values corresponding to the specified key from each object.\n * @example\n * ```ts\n * const users = [{ name: 'Alice' }, { name: 'Bob' }];\n * const names = pluckFromArray(users, 'name'); // ['Alice', 'Bob']\n * ```\n */\nexport function pluckFromArray<T, K extends keyof T>(arr: T[], key: K): Array<T[K]> {\n  return arr.map((value) => value[key]);\n}\n\nexport type OrderByDirection = 'ASC' | 'DESC';\n\n/**\n * Creates a compare function for sorting an array of objects based on a specified key and direction.\n *\n * @template T - The type of the objects in the array.\n * @param {keyof T} key - The key to sort by.\n * @param {OrderByDirection} [direction='ASC'] - The direction to sort ('ASC' for ascending, 'DESC' for descending).\n * @returns {(a: T, b: T) => number} A compare function that can be used in the array sort method.\n * @example\n * ```ts\n * const items = [{ value: 10 }, { value: 5 }, { value: 7 }];\n * const sortedItems = items.sort(orderBy('value', 'ASC')); // Sorted by value in ascending order\n * ```\n */\nexport function orderBy<T>(key: keyof T, direction: OrderByDirection = 'ASC'): (a: T, b: T) => number {\n  return (a, b) => {\n    const leftValue = direction === 'ASC' ? a[key] : b[key];\n    const rightValue = direction === 'ASC' ? b[key] : a[key];\n    if (leftValue === undefined) {\n      return -1;\n    }\n    if (rightValue === undefined) {\n      return -1;\n    }\n    if (isNumber(leftValue) && isNumber(rightValue)) {\n      return leftValue - rightValue;\n    }\n    if (isString(leftValue) && isString(rightValue)) {\n      return leftValue.toLowerCase().localeCompare(rightValue.toLowerCase());\n    }\n    return 0;\n  };\n}\n","/**\n * Constructs a URL string from provided segments, ensuring proper slash separation without duplications.\n * It gracefully handles `null`, `undefined`, and symbol values by omitting them from the final URL.\n * Additionally, the function preserves the protocol part of the URL, if specified.\n *\n * @param {...Array<string | number | symbol | null | undefined>} args - The segments to concatenate into a URL.\n * Can be a mix of strings, numbers, symbols (converted to strings), or `null`/`undefined` (which are omitted).\n * @returns {string} The constructed URL string with correctly formatted slashes.\n *\n * @example\n * ```ts\n * // Basic usage\n * console.log(buildUrl('http://example.com', 'path', 'to', 'resource'));\n * // Outputs: \"http://example.com/path/to/resource\"\n *\n * // Removing duplicate slashes\n * console.log(buildUrl('http://example.com/', '/path/', '//to', '/resource/'));\n * // Outputs: \"http://example.com/path/to/resource/\"\n * ```\n */\nexport function buildUrl(...args: Array<string | number | symbol | null | undefined>): string {\n  return args.join('/').replace(/(^.*)(https?:\\/\\/)|(\\/)+/g, '$2$3');\n}\n","import { buildUrl } from './build-url';\n\n/**\n * A constant representing the base URL for the Draeger website.\n * @constant\n * @type {string}\n * @default 'https://www.draeger.com'\n */\nexport const DRAEGER_WEBSITE_URL = 'https://www.draeger.com';\n\n/**\n * Constructs a full URL for the Draeger website by appending the provided path segments to the base URL.\n * This function is a utility for creating fully qualified URLs to various resources or pages within the Draeger website.\n *\n * @function buildWebsiteUrl\n * @param {...(string | number | symbol | null | undefined)} segments - The path segments to append to the base URL.\n * These can include strings, numbers, symbols, or null/undefined values (the latter two are ignored).\n * @returns {string} The fully constructed URL, including the base URL and all provided path segments.\n *\n * @example\n * ```ts\n * // Returns 'https://www.draeger.com/about-us'\n * const url = buildWebsiteUrl('about-us');\n *\n * // Can also handle multiple segments, returning 'https://www.draeger.com/products/search/123'\n * const productUrl = buildWebsiteUrl('products', 'search', 123);\n * ```\n */\nexport function buildWebsiteUrl(...segments: Array<string | number | symbol | null | undefined>): string {\n  return buildUrl(DRAEGER_WEBSITE_URL, ...segments);\n}\n","/**\n * The HTTP 'Etag' header, used for web cache validation.\n */\nexport const HTTP_ETAG_HEADER = 'Etag';\n\n/**\n * The HTTP 'If-None-Match' header, used in conditional requests to compare against the ETag.\n */\nexport const HTTP_IF_NONE_MATCH_HEADER = 'If-None-Match';\n\n/**\n * The HTTP 'Cache-Control' header, used to specify directives for caching mechanisms in requests and responses.\n */\nexport const HTTP_CACHE_CONTROL_HEADER = 'Cache-Control';\n\n/**\n * A client for managing cache storage for web applications. It simplifies interactions with the Cache Storage API,\n * allowing for the caching, retrieval, and deletion of request responses. This class uses HTTP caching headers to\n * optimize network requests and cache management.\n *\n * @example\n * ```ts\n * // Creating an instance of CacheStorageClient\n * const cacheClient = new CacheStorageClient('my-cache');\n *\n * // Requesting and caching data\n * cacheClient.request('https://api.example.com/data').then(data => {\n *   console.log(data);\n * });\n *\n * // Deleting a specific cache entry\n * cacheClient.delete('https://api.example.com/data');\n *\n * // Clearing all cache entries\n * cacheClient.deleteAll();\n * ```\n */\nexport class CacheStorageClient {\n  constructor(\n    private readonly cacheKey: string,\n    private readonly cacheStorage = window.caches,\n  ) {}\n\n  /**\n   * Deletes a specific cache entry.\n   *\n   * @param {RequestInfo | URL} request - The request or URL to delete from the cache.\n   * @returns {Promise<boolean>} A promise that resolves to a boolean indicating whether the deletion was successful.\n   */\n  public async delete(request: RequestInfo | URL): Promise<boolean> {\n    const cache = await this.getCache();\n\n    return cache.delete(request);\n  }\n\n  /**\n   * Deletes all entries from the cache.\n   *\n   * @returns {Promise<void>} A promise that resolves when all entries have been deleted.\n   */\n  public async deleteAll(): Promise<void> {\n    const cache = await this.getCache();\n    for (const key of await cache.keys()) {\n      await cache.delete(key);\n    }\n  }\n\n  /**\n   * Performs a request, caching the response if applicable. If a response is cached for the request and still valid,\n   * it returns the cached response instead of making a new network request.\n   *\n   * @template T - The expected response data type.\n   * @param {RequestInfo | URL} requestInfo - The request information or URL to fetch and cache.\n   * @param {(response: Response) => boolean} [shouldDelete=({ status }) => status >= 400 && status < 500] - An optional function to determine if the cache entry should be deleted based on the response.\n   * @returns {Promise<T | null>} A promise that resolves to the response data, or null if the request fails.\n   */\n  public async request<T>(requestInfo: RequestInfo | URL, shouldDelete = ({ status }: Response) => status >= 400 && status < 500): Promise<T | null> {\n    const cache = await this.getCache();\n    const request = await this.prepareRequest(cache, requestInfo);\n    const response = await this.sendRequest(cache, request);\n    if (response && shouldDelete?.(response)) {\n      await cache.delete(request);\n    }\n    return response?.json() ?? null;\n  }\n\n  protected async getCache(): Promise<Cache> {\n    return this.cacheStorage.open(this.cacheKey);\n  }\n\n  protected async prepareRequest(cache: Cache, requestInfo: RequestInfo | URL): Promise<Request> {\n    const cachedResponse = await cache.match(requestInfo);\n    const etag = cachedResponse?.headers?.get(HTTP_ETAG_HEADER) ?? null;\n    const request = new Request(requestInfo);\n    if (etag) {\n      request.headers.set(HTTP_IF_NONE_MATCH_HEADER, etag);\n    }\n\n    return request;\n  }\n\n  protected async sendRequest(cache: Cache, request: Request): Promise<Response | null> {\n    const response = await fetch(request).catch(() => null);\n    const cacheControl = response?.headers?.get(HTTP_CACHE_CONTROL_HEADER);\n    if (cacheControl === 'no-cache') {\n      await cache.delete(request);\n\n      return response;\n    }\n    if (response?.ok) {\n      await cache.put(request, response).catch(() => null);\n    }\n\n    return cache.match(request).then((res) => res ?? null);\n  }\n}\n","import { coerceArray } from '@angular/cdk/coercion';\n\n/**\n * Coerces a value to an array. If the value is already an array, it is returned directly.\n * If the value is not an array, it is wrapped in an array. This utility is useful for\n * handling values that can be either single values or arrays, ensuring consistent array handling.\n *\n * @param {string | string[]} value - The value to coerce to an array. Can be a single string or an array of strings.\n * @returns {string[]} The coerced value as an array of strings.\n *\n * @example\n * ```ts\n * // Coercing a single string to an array\n * console.log(arrayAttribute('singleValue')); // Outputs: ['singleValue']\n *\n * // Returning an array directly\n * console.log(arrayAttribute(['value1', 'value2'])); // Outputs: ['value1', 'value2']\n * ```\n */\nexport function arrayAttribute(value: string | string[]): string[] {\n  return coerceArray<string>(value);\n}\n\nexport { coerceArray, coerceCssPixelValue, coerceElement, coerceStringArray } from '@angular/cdk/coercion';\n","/**\n * Creates a debounced function that delays invoking the provided function until after `delay` milliseconds\n * have elapsed since the last time the debounced function was invoked. Optionally, the function can be\n * triggered immediately on the first call, then debounced for subsequent calls.\n *\n * @template Args - A tuple representing the types of arguments the `func` accepts.\n * @param {(...args: Args) => void} func - The function to debounce.\n * @param {number} delay - The number of milliseconds to delay.\n * @param {boolean} [immediate=false] - Whether to trigger the function immediately on the first call,\n * and then debounce subsequent calls.\n * @returns {(...args: Args) => void} A new, debounced function.\n *\n * @example\n * ```ts\n * // Example usage with a window resize event\n * const handleResize = debounce(() => {\n *   console.log('Window resized');\n * }, 250);\n * window.addEventListener('resize', handleResize);\n *\n * // Example using immediate invocation\n * const processKeyPress = debounce((event) => {\n *   console.log('Key pressed:', event.key);\n * }, 200, true);\n * document.addEventListener('keypress', processKeyPress);\n * ```\n */\nexport function debounce<Args extends unknown[]>(func: (...args: Args) => void, delay: number, immediate = false): (...args: Args) => void {\n  let timeout: number | null = null;\n\n  return function (this: unknown, ...args: Args) {\n    // eslint-disable-next-line @typescript-eslint/no-this-alias\n    const context = this;\n    const callImmediately = immediate && timeout === null;\n    if (timeout !== null) {\n      clearTimeout(timeout);\n    }\n    timeout = setTimeout(function () {\n      timeout = null;\n      if (!callImmediately) {\n        func.apply(context, args);\n      }\n    }, delay) as unknown as number;\n    if (callImmediately) {\n      func.apply(context, args);\n    }\n  };\n}\n","/**\n * Defers the execution of a function until the current call stack is clear.\n * This is achieved by using `setTimeout` with a delay of `0`, effectively placing the function\n * at the end of the event queue and allowing the browser to complete any pending tasks before execution.\n *\n * @param {() => void} fn - The function to be deferred.\n *\n * @example\n * ```ts\n * // Deferring a simple function\n * deferFn(() => console.log('This will be logged after the current execution context completes.'));\n *\n * // Using deferFn to update the UI after a synchronous operation\n * function updateUI() {\n *   // UI update logic here\n * }\n * // Assume we're inside a synchronous block of code that updates data\n * deferFn(updateUI); // Ensures UI is updated after data changes are fully applied\n * ```\n */\nexport function deferFn(fn: () => void): void {\n  setTimeout(fn, 0);\n}\n","let uniqueIdCache: { [key: string]: number } = {};\n\n/**\n * Generates a unique identifier for a given key. If the key has previously been used,\n * the function increments a counter associated with that key to ensure uniqueness.\n * The generated ID is in the format of `${key}-${counter}`.\n *\n * @param {string} key - The key for which to generate a unique identifier.\n * @returns {string} A unique identifier string based on the provided key.\n *\n * @example\n * ```ts\n * const id1 = getUniqueId('component');\n * console.log(id1); // Outputs: \"component-1\"\n *\n * const id2 = getUniqueId('component');\n * console.log(id2); // Outputs: \"component-2\"\n * ```\n */\nexport function getUniqueId(key: string): string {\n  uniqueIdCache[key] = (uniqueIdCache[key] ?? 0) + 1;\n\n  return `${key}-${uniqueIdCache[key]}`;\n}\n\n/**\n * Clears the cache used by `getUniqueId` to generate unique identifiers. This function\n * resets all counters associated with each key, effectively restarting the generation\n * of unique IDs from their initial state.\n *\n * This can be useful in scenarios such as testing or when starting a new session that\n * requires resetting the state of unique ID generation.\n *\n * @example\n * ```ts\n * getUniqueId('component'); // Returns \"component-1\"\n * getUniqueId('component'); // Returns \"component-2\"\n * clearUniqueIdCache();\n * getUniqueId('component'); // Returns \"component-1\" after cache reset\n * ```\n */\nexport function clearUniqueIdCache(): void {\n  uniqueIdCache = {};\n}\n","import { inject, Injectable, OnDestroy, Renderer2 } from '@angular/core';\nimport { injectElement } from './angular';\nimport { getUniqueId } from './get-unique-id';\nimport { isPresent } from './type-guards';\n\n@Injectable()\nexport class EventManager implements OnDestroy {\n  private readonly element = injectElement();\n  private readonly renderer = inject(Renderer2);\n  private readonly listeners: Map<string, () => void> = new Map<string, () => void>();\n\n  public destroyListeners(): void {\n    this.listeners.forEach((listener: () => void) => {\n      if (listener) {\n        listener();\n      }\n    });\n    this.listeners.clear();\n  }\n\n  public destroyListener(listenerReferenceKey: string): void {\n    if (this.listeners.has(listenerReferenceKey)) {\n      const listenerFn = this.listeners.get(listenerReferenceKey);\n      if (listenerFn) {\n        listenerFn();\n      }\n      this.listeners.delete(listenerReferenceKey);\n    }\n  }\n\n  public register<T extends Event = Event>(\n    eventNames: Array<string | null>,\n    callback: (event?: T) => void,\n    target?: 'document' | 'window' | EventTarget | null,\n  ): Array<string> {\n    return eventNames.filter(isPresent).map((eventName: string) => {\n      const listenerFn = this.renderer.listen(target ?? this.element.nativeElement, eventName, (event) => callback(event));\n      const id = getUniqueId('registeredEvent');\n      this.listeners.set(id, listenerFn);\n      return id;\n    });\n  }\n\n  public ngOnDestroy(): void {\n    this.destroyListeners();\n  }\n\n  public getActiveListenersNames(): string[] {\n    return Array.from(this.listeners.keys());\n  }\n}\n","export type Axis = (typeof Axis)[keyof typeof Axis];\n\nexport const Axis = {\n  X: 'x',\n  Y: 'y',\n} as const;\n","export type Position = (typeof Position)[keyof typeof Position];\n\nexport const Position = {\n  TOP: 'top',\n  TOP_START: 'top-start',\n  TOP_END: 'top-end',\n\n  RIGHT: 'right',\n  RIGHT_START: 'right-start',\n  RIGHT_END: 'right-end',\n\n  BOTTOM: 'bottom',\n  BOTTOM_START: 'bottom-start',\n  BOTTOM_END: 'bottom-end',\n\n  LEFT: 'left',\n  LEFT_START: 'left-start',\n  LEFT_END: 'left-end',\n} as const;\n","export type Side = (typeof Side)[keyof typeof Side];\n\nexport const Side = {\n  TOP: 'top',\n  RIGHT: 'right',\n  BOTTOM: 'bottom',\n  LEFT: 'left',\n} as const;\n","import { Position, Side } from '../types';\n\n/**\n * Extracts the side part from a position string. The position format generally combines\n * a side (e.g., \"top\", \"bottom\", \"left\", \"right\") with an optional alignment\n * (e.g., \"left\", \"center\", \"right\" for vertical positions or \"top\", \"middle\", \"bottom\" for horizontal positions).\n *\n * @param {Position} position - The position string from which to extract the side.\n * @returns {Side} The side part of the position, indicating the general placement direction.\n *\n * @example\n * ```ts\n * // Extracting the side from a position with alignment\n * console.log(getSide('top-left')); // Outputs: 'top'\n *\n * // Extracting the side from a simple position\n * console.log(getSide('bottom')); // Outputs: 'bottom'\n * ```\n */\nexport function getSide(position: Position): Side {\n  return position.split('-')[0] as Side;\n}\n","import { Axis, Position, Side } from '../types';\nimport { getSide } from './get-side';\n\n/**\n * Determines the axis associated with a given position. The function first extracts the side from the position,\n * then evaluates whether that side corresponds to the X-axis (left or right) or the Y-axis (top or bottom).\n *\n * @param {Position} position - The position string, which includes a side (top, bottom, left, right) and possibly an alignment.\n * @returns {Axis} The axis (X or Y) associated with the given position's side.\n *\n * @example\n * ```ts\n * // Determining the axis for different positions\n * console.log(getAxis('top-left')); // Outputs: 'Y'\n * console.log(getAxis('right'));    // Outputs: 'X'\n *\n * // Using getAxis in UI element positioning logic\n * const elementPosition = 'bottom';\n * const axis = getAxis(elementPosition);\n * // Assuming a function that adjusts UI elements based on the axis\n * adjustElementAlongAxis(axis);\n * ```\n */\nexport function getAxis(position: Position): Axis {\n  const side = getSide(position);\n\n  switch (side) {\n    case Side.TOP:\n    case Side.BOTTOM:\n      return Axis.Y;\n    case Side.LEFT:\n    case Side.RIGHT:\n      return Axis.X;\n  }\n}\n","/**\n * Extracts the language code from a language string that may include both a language and a region code.\n * The function supports language strings formatted with either a hyphen (`-`) or an underscore (`_`) as the separator.\n *\n * @param {string} language - The complete language string, potentially including both language and region codes.\n * @returns {string} The extracted language code, converted to lower case.\n *\n * @example\n * ```ts\n * // Extracting language code from a language-region string\n * console.log(getLanguageCode('en-US')); // Outputs: 'en'\n * console.log(getLanguageCode('zh_CN')); // Outputs: 'zh'\n *\n * // Handling language codes without region codes\n * console.log(getLanguageCode('fr'));    // Outputs: 'fr'\n * ```\n */\nexport function getLanguageCode(language: string): string {\n  const [languageCode] = language.split(/-|_/);\n\n  return languageCode?.toLowerCase();\n}\n","import { Position, Side } from '../types';\nimport { getSide } from './get-side';\n\n/**\n * Determines the opposite side for a given position. This function is useful for scenarios\n * where you need to dynamically calculate the positioning or alignment opposite to the current one,\n * such as inverting tooltips, popovers, or any UI elements that adjust based on available viewport space.\n *\n * @param {Position} position - The position string, which includes a side and possibly an alignment.\n * @returns {Side} The opposite side relative to the provided position's side.\n *\n * @example\n * ```ts\n * // Getting the opposite side of a given position\n * console.log(getOppositeSide('top-left')); // Outputs: 'bottom'\n * console.log(getOppositeSide('right'));    // Outputs: 'left'\n *\n * // Using getOppositeSide to adjust UI elements\n * const currentSide = 'left';\n * const newPosition = getOppositeSide(currentSide);\n * // Assuming an element's position or orientation needs to be dynamically updated\n * updateElementPosition(newPosition);\n * ```\n */\nexport function getOppositeSide(position: Position): Side {\n  switch (getSide(position)) {\n    case Side.TOP:\n      return Side.BOTTOM;\n    case Side.RIGHT:\n      return Side.LEFT;\n    case Side.BOTTOM:\n      return Side.TOP;\n    case Side.LEFT:\n      return Side.RIGHT;\n  }\n}\n","import { isString } from './type-guards';\n\n/**\n * Checks if a given value is a valid URL matcher, which can be either a string or a regular expression.\n * This function serves as a type guard to facilitate URL matching operations by verifying the type of the filter.\n *\n * @param {unknown} value - The value to check for being a valid URL matcher.\n * @returns {value is string | RegExp} `true` if the value is a string or RegExp, indicating it can be used for URL matching; otherwise, `false`.\n *\n * @example\n * ```ts\n * // Checking a string URL matcher\n * console.log(isUrlMatcher('https://example.com')); // true\n *\n * // Checking a RegExp URL matcher\n * console.log(isUrlMatcher(/https:\\/\\/example\\.com/)); // true\n *\n * // Checking a non-matcher value\n * console.log(isUrlMatcher(123)); // false\n * ```\n */\nexport function isUrlMatcher(value: unknown): value is string | RegExp {\n  return isString(value) || value instanceof RegExp;\n}\n\n/**\n * Determines if a given URL matches a specified filter, which can be either a string or a regular expression.\n * For string filters, the function checks if the URL starts with the filter value. For RegExp filters,\n * it checks if the URL matches the regular expression pattern.\n *\n * @param {string} url - The URL to be checked against the filter.\n * @param {string | RegExp} filter - The filter used to match the URL, which can be a prefix string or a RegExp pattern.\n * @returns {boolean} `true` if the URL matches the filter; otherwise, `false`.\n *\n * @example\n * ```ts\n * // Matching a URL with a string filter\n * console.log(matchUrl('https://example.com/page', 'https://example.com')); // true\n *\n * // Matching a URL with a RegExp filter\n * console.log(matchUrl('https://example.com/page', /example\\.com\\/page/)); // true\n *\n * // A non-matching example\n * console.log(matchUrl('https://example.com/page', 'https://another.com')); // false\n * ```\n */\nexport function matchUrl(url: string, filter: string | RegExp): boolean {\n  return isString(filter) ? url.startsWith(filter) : !!url.match(filter);\n}\n","import { GetProperties } from '../types';\n\n/**\n * Represents a typed version of Angular's `SimpleChanges` object, describing the changes to each\n * property of a component or directive. This utility enhances type safety when working with Angular's\n * change detection mechanism by providing specific property types.\n *\n * @template C - The component or directive class.\n * @template Properties - The properties of the component or directive, inferred from `C` by default.\n * @type {Object} - A mapping from property names to change information for each property.\n *\n * @example\n * ```ts\n * interface MyComponent {\n *   name: string;\n *   age: number;\n * }\n *\n * function ngOnChanges(changes: NgChanges<MyComponent>) {\n *   if (changes.name) {\n *     console.log('Name changed from', changes.name.previousValue, 'to', changes.name.currentValue);\n *   }\n * }\n * ```\n */\nexport type NgChanges<C, Properties = GetProperties<C>> = {\n  [Key in keyof Properties]: {\n    previousValue: Properties[Key];\n    currentValue: Properties[Key];\n    firstChange: boolean;\n    isFirstChange(): boolean;\n  };\n};\n\n/**\n * Checks if the specified property or properties have changed in the current change detection cycle.\n * Optionally ignores changes that occur during the first change detection cycle (e.g., initialization).\n *\n * @template U - The component or directive class.\n * @template T - The type representing the changes, typically `NgChanges<U>`.\n * @template K - The key or keys representing the properties to check for changes.\n * @param {T} changes - The `NgChanges` object containing information about all changes.\n * @param {K | K[]} keyOrKeys - The property name(s) to check for changes.\n * @param {boolean} [ignoreFirstChange=true] - Whether to ignore changes that occur during the first change detection cycle.\n * @returns {boolean} `true` if the specified property or properties have changed, otherwise `false`.\n *\n * @example\n * ```ts\n * // Example usage within an Angular component's `ngOnChanges` method\n * ngOnChanges(changes: NgChanges<MyComponent>): void {\n *   if (hasChanged(changes, 'name')) {\n *     console.log('Name has changed');\n *   }\n * }\n *\n * // Checking multiple properties for changes\n * ngOnChanges(changes: NgChanges<MyComponent>): void {\n *   if (hasChanged(changes, ['name', 'age'], false)) {\n *     console.log('Name or age has changed (including first change)');\n *   }\n * }\n * ```\n */\nexport function hasChanged<U extends Record<string, unknown>, T extends NgChanges<U>, K extends keyof T>(\n  changes: T,\n  keyOrKeys: K | K[],\n  ignoreFirstChange = true,\n): boolean {\n  if (Array.isArray(keyOrKeys)) {\n    for (const key of keyOrKeys) {\n      if (hasChanged(changes, key, ignoreFirstChange)) {\n        return true;\n      }\n    }\n    return false;\n  } else {\n    return keyOrKeys in changes && (!ignoreFirstChange || !changes[keyOrKeys]?.isFirstChange());\n  }\n}\n","import { FactoryProvider, inject, InjectionToken, Type, ValueProvider } from '@angular/core';\n\nimport { deepmerge } from '@odx/angular/internal';\n\ninterface ConfigFactoryProvider<T, D extends ConfigDependencies> {\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  useFactory: (...args: { [I in keyof D]: D[I] extends Type<unknown> ? InstanceType<D[I]> : D[I] extends InjectionToken<unknown> ? any : never }) => T;\n  deps?: [...D];\n}\n\nexport type ConfigDependencies<T = unknown> = ReadonlyArray<Type<T> | InjectionToken<T>>;\nexport type ConfigProvider<T = unknown, D extends ConfigDependencies = []> = ConfigFactoryProvider<T, D> | T;\nexport type ConfigTransformFn<T = unknown> = (config: Partial<T>) => Partial<T>;\n\n/**\n * Provides a configuration object or a factory for creating the configuration object, optionally applying a transformation function.\n * This utility simplifies the process of defining and injecting configuration objects throughout an Angular application.\n *\n * @template T - The type of the configuration object.\n * @template D - The dependencies required by the configuration factory, if any.\n * @param {InjectionToken<T> | string} token - The injection token or string token associated with the configuration.\n * @param {ConfigProvider<T, D>} config - The configuration object or a factory provider that produces the configuration.\n * @param {ConfigTransformFn<T>} [transform=() => ({}))] - An optional transformation function to apply to the configuration object.\n * @returns {FactoryProvider | ValueProvider} - An Angular provider object for the given configuration.\n *\n * @example\n * ```ts\n * // Define a simple configuration object\n * const appConfig = { apiEndpoint: 'https://api.example.com' };\n *\n * // Provide the configuration with an optional transformation function\n * provideConfig(appConfigToken, appConfig, (config) => ({\n *   ...config,\n *   apiEndpoint: `${config.apiEndpoint}/v2`,\n * }));\n *\n * // Using a factory provider for dynamic configuration\n * provideConfig(appConfigToken, {\n *   useFactory: (envService) => ({ apiEndpoint: envService.getApiEndpoint() }),\n *   deps: [EnvironmentService],\n * });\n * ```\n */\nexport function provideConfig<T extends object, D extends ConfigDependencies = ConfigDependencies>(\n  token: InjectionToken<T> | string,\n  config: ConfigProvider<T, D>,\n  transform: ConfigTransformFn<T> = () => ({}),\n): FactoryProvider | ValueProvider {\n  const prepareConfig = (value: Partial<T>) => deepmerge(value, transform(value));\n  if ('useFactory' in config) {\n    return {\n      provide: token,\n      // eslint-disable-next-line @typescript-eslint/no-explicit-any\n      useFactory: (...args: unknown[]) => prepareConfig(config.useFactory(...(args as any))),\n      deps: config.deps,\n    };\n  }\n\n  return {\n    provide: token,\n    useFactory: () => prepareConfig(config),\n  };\n}\n\nfunction mergeConfig<T>(token: InjectionToken<Partial<T>>, defaultValue: T): Partial<T> {\n  const config = inject(token);\n  const parentConfig = inject(token, { skipSelf: true, optional: true }) ?? {};\n\n  return deepmerge(defaultValue, parentConfig, config) as T;\n}\n\n/**\n * Generates a set of configuration-related tokens and utility functions for managing configuration in an Angular application.\n * This function creates a standardized way to define, provide, and inject configurations, including defaults and transformations.\n *\n * @template T - The type of the configuration object.\n * @template N - The name of the configuration, used to generate token names and utility functions.\n * @param {N} name - The name of the configuration.\n * @param {string} prefix - A prefix for the injection token to ensure uniqueness across the application.\n * @param {T} defaultValue - The default value for the configuration.\n * @param {ConfigTransformFn<T>} [transform] - An optional transformation function to be applied to the configuration.\n * @returns An object containing the generated injection token, default configuration, and utility functions for the configuration.\n *\n * @example\n * ```ts\n * // Create configuration tokens and utilities for \"appConfig\" with a default value and optional transform function\n * const { appConfigConfig, provideAppConfigConfig } = createConfigTokens('appConfig', 'myPrefix', { debug: false }, (config) => ({\n *   ...config,\n *   debug: true, // Enable debug mode by default\n * }));\n *\n * // Later, in a module or component, provide the customized configuration\n * @NgModule({\n *   providers: [provideAppConfigConfig({ apiEndpoint: 'https://api.example.com' })]\n * })\n * class AppModule {}\n * ```\n */\nexport function createConfigTokens<T, N extends string>(name: N, prefix: string, defaultValue: T, transform?: ConfigTransformFn<T>) {\n  type ConfigProviderFn = <D extends ConfigDependencies = ConfigDependencies<Partial<T>>>(\n    config: ConfigProvider<Partial<T>, D>,\n  ) => FactoryProvider | ValueProvider;\n  const configName = `${name}Config` as const;\n  const defaultConfigName = `${name}DefaultConfig` as const;\n  const injectConfigName = `inject${name}Config` as const;\n  const provideConfigName = `provide${name}Config` as const;\n  const tokenName = `${prefix}::${configName}`;\n  const token = new InjectionToken<Partial<T>>(tokenName, { providedIn: 'root', factory: () => defaultValue });\n\n  return {\n    [configName]: token,\n    [defaultConfigName]: defaultValue,\n    [injectConfigName]: () => mergeConfig(token, defaultValue),\n    [provideConfigName]: ((config) => provideConfig(token, config, transform)) as ConfigProviderFn,\n  } as Record<typeof configName, InjectionToken<Partial<T>>> &\n    Record<typeof defaultConfigName, T> &\n    Record<typeof injectConfigName, () => T> &\n    Record<typeof provideConfigName, ConfigProviderFn>;\n}\n","import { Observable, Subject } from 'rxjs';\nimport { concatAll, distinctUntilChanged, filter, map, share, shareReplay, startWith } from 'rxjs/operators';\nimport { isNumber, isString } from './type-guards';\n\ntype QueueItemId = string | number;\ntype QueueItem<T> = T & { id: QueueItemId };\ntype QueueEventType = 'remove' | 'add' | 'update';\ntype QueueEvent<T> = { items: QueueItem<T>[]; type: QueueEventType };\n\nfunction isQueueItemId(value: unknown): value is QueueItemId {\n  return isString(value) || isNumber(value);\n}\n\n/**\n * A class representing a queue structure with advanced functionalities including adding, removing,\n * updating items, and observing changes through RxJS observables. It supports generic queue item types,\n * allowing for flexible usage across different contexts.\n *\n * @template T - The type of items stored in the queue. Each item must extend an object containing a unique `id`.\n */\nexport class Queue<T> {\n  private readonly queue = new Map<string, QueueItem<T>>();\n  private readonly events$$ = new Subject<QueueEvent<T>>();\n  private values: QueueItem<T>[] = [];\n  private firstItem: QueueItem<T> | null = null;\n  private lastItem: QueueItem<T> | null = null;\n\n  /**\n   * An observable that emits when an item is added to the queue.\n   *\n   * @type {Observable<T>}\n   */\n  public readonly onAdd$ = this.createEventObserver('add');\n\n  /**\n   * An observable that emits when an item in the queue is updated.\n   *\n   * @type {Observable<T>}\n   */\n  public readonly onUpdate$ = this.createEventObserver('update');\n\n  /**\n   * An observable that emits when an item is removed from the queue.\n   *\n   * @type {Observable<T>}\n   */\n  public readonly onRemove$ = this.createEventObserver('remove');\n\n  /**\n   * An observable representing the current state of the queue as an array of items.\n   *\n   * @type {Observable<QueueItem<T>[]>}\n   */\n  public readonly value$ = this.events$$.pipe(\n    startWith(() => void 0),\n    map(() => this.values),\n    shareReplay({ bufferSize: 1, refCount: true }),\n  );\n\n  /**\n   * An observable that emits the current size of the queue.\n   *\n   * @type {Observable<number>}\n   */\n  public readonly size$ = this.value$.pipe(\n    map(() => this.size),\n    distinctUntilChanged(),\n    shareReplay({ bufferSize: 1, refCount: true }),\n  );\n\n  /**\n   * Gets the size of the queue.\n   *\n   * @returns {number} - The number of elements in the queue.\n   */\n  public get size(): number {\n    return this.queue.size;\n  }\n\n  /**\n   * Checks if the specified item is the first item in the queue.\n   *\n   * @param {QueueItem<T>} item - The item to check.\n   * @returns {boolean} - Returns `true` if the item is the first item in the queue, `false` otherwise.\n   */\n  public isFirst({ id }: QueueItem<T>): boolean {\n    return this.firstItem?.id === id;\n  }\n\n  /**\n   * Checks if the specified item is the last item in the queue.\n   *\n   * @param {QueueItem<T>} item - The item to check.\n   * @returns {boolean} - Returns true if the item is the last item, otherwise returns false.\n   */\n  public isLast({ id }: QueueItem<T>): boolean {\n    return this.lastItem?.id === id;\n  }\n\n  /**\n   * Retrieves a queue item from the queue based on the provided item or item ID.\n   *\n   * @param {QueueItem<T> | QueueItemId} itemOrId - The queue item or item ID to retrieve.\n   * @returns {QueueItem<T> | null} - The queue item if found, or `null` if not found.\n   */\n  public get(itemOrId: QueueItem<T> | QueueItemId): QueueItem<T> | null {\n    const id = isQueueItemId(itemOrId) ? itemOrId.toString() : itemOrId.id.toString();\n\n    return this.queue.get(id) ?? null;\n  }\n\n  /**\n   * Adds an item to the queue, optionally emitting an event.\n   *\n   * @param {QueueItem<T>} item - The item to add.\n   * @param {boolean} [emitEvent=true] - Whether to emit an event for this action.\n   * @returns {QueueItem<T>} The item added to the queue.\n   */\n  public add(item: QueueItem<T>, emitEvent = true): QueueItem<T> {\n    this.remove(item, false);\n\n    return this.addMany([item], emitEvent)[0];\n  }\n\n  /**\n   * Adds multiple items to the queue.\n   *\n   * @param {Array<QueueItem<T>>} items - An array of items to be added to the queue.\n   * @param {boolean} emitEvent - (Optional) A boolean indicating whether to emit an event after adding the items. Default is true.\n   * @returns {Array<QueueItem<T>>} An array of added items.\n   */\n  public addMany(items: Array<QueueItem<T>>, emitEvent = true): Array<QueueItem<T>> {\n    const addedItems = [];\n    const updatedItems = [];\n    for (const item of items) {\n      if (!this.get(item)) {\n        addedItems.push(item);\n      } else {\n        updatedItems.push(item);\n      }\n      this.queue.set(item.id.toString(), item);\n    }\n    if (addedItems.length) {\n      this.notify({ type: 'add', items: addedItems }, emitEvent);\n    }\n    if (updatedItems.length) {\n      this.notify({ type: 'update', items: updatedItems }, emitEvent);\n    }\n\n    return items;\n  }\n\n  /**\n   * Removes an item from the queue.\n   *\n   * @param {Array<QueueItem<T> | QueueItemId>} itemOrId - The item or ID of the item to be removed.\n   * @param {boolean} emitEvent - Whether to emit an event after removing the item. Default is `true`.\n   * @returns The removed item, or `null` if the item was not found.\n   */\n  public remove(itemOrId: QueueItem<T> | QueueItemId, emitEvent = true): QueueItem<T> | null {\n    return this.removeMany([itemOrId], emitEvent)[0];\n  }\n\n  /**\n   * Removes multiple items from the queue based on the provided item or item IDs.\n   *\n   * @param {Array<QueueItem<T> | QueueItemId>} itemOrIds - An array of QueueItem or QueueItemId objects representing the items to be removed.\n   * @param {boolean} emitEvent - A boolean indicating whether to emit an event after removing the items. Default is true.\n   * @returns {Array<QueueItem<T> | null>} An array of removed QueueItem objects or null values.\n   */\n  public removeMany(itemOrIds: Array<QueueItem<T> | QueueItemId>, emitEvent = true): Array<QueueItem<T> | null> {\n    const items = itemOrIds.map((itemOrId) => this.get(itemOrId)).filter(Boolean) as QueueItem<T>[];\n    const removedItems = [];\n    for (const item of items) {\n      const itemRemoved = this.queue.delete(item.id.toString());\n      if (!itemRemoved) continue;\n      removedItems.push(item);\n    }\n    this.notify({ type: 'remove', items: removedItems }, emitEvent);\n\n    return items;\n  }\n\n  /**\n   * Clears the queue by removing all items.\n   *\n   * @param {boolean} emitEvent - Whether to emit an event after clearing the queue. Default is true.\n   */\n  public clear(emitEvent = true): void {\n    const items = this.toArray();\n    this.queue.clear();\n    this.notify({ type: 'remove', items }, emitEvent);\n  }\n\n  /**\n   * Returns an array representation of the queue.\n   *\n   * @returns {QueueItem<T>[]} An array containing all the items in the queue.\n   */\n  public toArray(): QueueItem<T>[] {\n    return this.values;\n  }\n\n  private notify(event: QueueEvent<T>, emitEvent = true): void {\n    this.values = Array.from(this.queue, ([_, item]) => item).reverse();\n    this.firstItem = this.values[0] ?? null;\n    this.lastItem = this.values[this.values.length - 1] ?? null;\n    if (!emitEvent) return;\n    this.events$$.next(event);\n  }\n\n  private createEventObserver(type: QueueEventType): Observable<T> {\n    return this.events$$.pipe(\n      filter((event) => event.type === type),\n      map(({ items }) => items),\n      concatAll(),\n      share(),\n    );\n  }\n}\n","/**\n * Options for creating a sorter function. Can be used for arrays of objects (with `keyFn`)\n * or arrays of primitives (if `keyFn` is omitted).\n * @template T The type of items to be sorted.\n */\nexport interface SorterOptions<T> {\n  sortDirection?: SortDirection;\n  locale?: string;\n  collatorOptions?: Intl.CollatorOptions;\n  /**\n   * Optional function to extract the sortable value from an item.\n   * If not provided, the item itself is used for comparison (suitable for arrays of primitives).\n   * The extracted value should be a string, number, boolean, null, or undefined.\n   * @default (item: T) => item\n   */\n  keyFn?: (item: T) => string | number | boolean | null | undefined;\n}\n\n/**\n * Defines the possible directions for sorting.\n * It is used to specify how elements should be ordered.\n *\n * - `ASC`: Represents \"ascending\" order (e.g., A to Z, 1 to 10).\n * - `DESC`: Represents \"descending\" order (e.g., Z to A, 10 to 1).\n */\nexport type SortDirection = (typeof SortDirection)[keyof typeof SortDirection];\n\n/**\n * Constant object representing the available sort directions.\n * @property {string} ASC - Sort in ascending order.\n * @property {string} DESC - Sort in descending order.\n * @readonly\n */\nexport const SortDirection = {\n  ASC: 'asc',\n  DESC: 'desc',\n} as const;\n\n/**\n * Handles comparison for null values, assuming undefined has already been handled.\n * - `null` is considered less than any defined (non-null, non-undefined) value.\n * @param valA First value.\n * @param valB Second value.\n * @returns Comparison result (-1, 0, 1) or null if both values are non-null.\n */\nfunction handleNullValues<V>(valA: V, valB: V): number | null {\n  const aIsNull = valA === null;\n  const bIsNull = valB === null;\n\n  if (aIsNull && bIsNull) return 0;\n  if (aIsNull) return -1; // valA is null, valB is not -> valA is \"lesser\"\n  if (bIsNull) return 1; // valB is null, valA is not -> valA is \"greater\"\n\n  return null; // Both are non-null (and non-undefined at this stage of the main sorter)\n}\n\nfunction compareNonNullValues<V>(valA: NonNullable<V>, valB: NonNullable<V>, collator: Intl.Collator): number {\n  if (typeof valA === 'string' && typeof valB === 'string') {\n    return collator.compare(valA, valB);\n  } else if (typeof valA === 'number' && typeof valB === 'number') {\n    return valA - valB;\n  } else if (typeof valA === 'boolean' && typeof valB === 'boolean') {\n    return Number(valA) - Number(valB);\n  }\n  return collator.compare(String(valA), String(valB));\n}\n\n/**\n * Creates a comparison function suitable for Array.prototype.sort(),\n * based on the provided sort parameters.\n * Uses Intl.Collator for string comparison.\n * Can sort arrays of objects by an extracted value (via `keyFn`) or arrays of primitives directly.\n *\n * Behavior for `null` and `undefined` values (either direct or returned by `keyFn`):\n * - `undefined` values are **always** sorted to the end of the array, regardless of the sort direction.\n * - `null` values are sorted to the beginning of the array for ASC sort.\n * - For DESC sort, `null` values are sorted to the end of the array, but before any `undefined` values.\n *\n * @template T The type of items in the array.\n * @param options Optional sorting options. If `keyFn` is not provided, items are compared directly.\n * @returns A comparison function `(a: T, b: T) => number`.\n */\nexport function createSorter<T>(options?: SorterOptions<T>): (a: T, b: T) => number {\n  const { keyFn: userProvidedKeyFn, sortDirection, locale, collatorOptions } = options || {};\n\n  if (!sortDirection || !Object.values(SortDirection).includes(sortDirection)) return () => 0;\n\n  if (userProvidedKeyFn !== undefined && typeof userProvidedKeyFn !== 'function') {\n    console.warn('createSorter: provided keyFn is not a function. Returning a no-op sorter.');\n    return () => 0;\n  }\n\n  // Default keyFn extracts the item itself, suitable for primitives or if T is the sortable value.\n  const keyFn = userProvidedKeyFn ?? ((item: T) => item as unknown as string | number | boolean | null | undefined);\n  const collator = new Intl.Collator(locale, collatorOptions);\n\n  return (itemA: T, itemB: T): number => {\n    const valA = keyFn(itemA);\n    const valB = keyFn(itemB);\n\n    const aIsUndefined = valA === undefined;\n    const bIsUndefined = valB === undefined;\n\n    if (aIsUndefined && bIsUndefined) return 0;\n    if (aIsUndefined) return 1;\n    if (bIsUndefined) return -1;\n\n    let comparison = 0;\n    const nullComparison = handleNullValues(valA, valB);\n\n    if (nullComparison !== null) {\n      comparison = nullComparison;\n    } else {\n      comparison = compareNonNullValues(\n        valA as NonNullable<string | number | boolean>, // valA is known to be not null/undefined here\n        valB as NonNullable<string | number | boolean>, // valB is known to be not null/undefined here\n        collator,\n      );\n    }\n\n    return sortDirection === SortDirection.DESC ? comparison * -1 : comparison;\n  };\n}\n","/**\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