{"version":3,"file":"ngwr-utils.mjs","sources":["../../../projects/lib/utils/guards/is-defined.ts","../../../projects/lib/utils/guards/is-non-empty-array.ts","../../../projects/lib/utils/guards/is-observable.ts","../../../projects/lib/utils/math/clamp.ts","../../../projects/lib/utils/math/round.ts","../../../projects/lib/utils/coercion/num-attr.ts","../../../projects/lib/utils/dom/get-root-font-size.ts","../../../projects/lib/utils/dom/focus.ts","../../../projects/lib/utils/css-size/resolve-css-size.ts","../../../projects/lib/utils/id/random-id.ts","../../../projects/lib/utils/fn/noop.ts","../../../projects/lib/utils/fn/debounce.ts","../../../projects/lib/utils/fn/throttle.ts","../../../projects/lib/utils/keyboard/keys.ts","../../../projects/lib/utils/keyboard/predicates.ts","../../../projects/lib/utils/log/badge-log.ts","../../../projects/lib/utils/public-api.ts","../../../projects/lib/utils/ngwr-utils.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { Maybe } from '../interfaces';\n\n/**\n * Type guard that checks if a value is neither `null` nor `undefined`.\n *\n * @example\n * ```ts\n * const maybeValue: Maybe<number> = getValue();\n *\n * if (isDefined(maybeValue)) {\n *   // here maybeValue is number\n *   console.log(maybeValue.toFixed(2));\n * }\n * ```\n *\n * @see {@link Maybe}\n */\nexport function isDefined<T>(value: Maybe<T>): value is T {\n  return value !== null && value !== undefined;\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { Maybe } from '../interfaces';\n\n/**\n * Type guard that checks if a value is an array with at least one element.\n *\n * @example\n * ```ts\n * const items: Maybe<string[]> = getItems();\n *\n * if (isNonEmptyArray(items)) {\n *   // items is string[]\n *   console.log(items[0]);\n * }\n * ```\n */\nexport function isNonEmptyArray<T>(value: Maybe<T[]>): value is [T, ...T[]] {\n  return Array.isArray(value) && value.length > 0;\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { Observable } from 'rxjs';\n\n/**\n * Type guard that checks whether a value looks like an RxJS `Observable`.\n *\n * Uses duck-typing: verifies that the object has a `subscribe` function.\n * Does not require an actual `Observable` instance.\n *\n * @example\n * ```ts\n * if (isObservable(stream)) {\n *   stream.subscribe(value => console.log(value));\n * }\n * ```\n */\nexport function isObservable<T = unknown>(value: unknown): value is Observable<T> {\n  return !!value && typeof (value as { subscribe?: unknown }).subscribe === 'function';\n}\n","/**\n * Clamps `value` into the inclusive `[min, max]` range.\n *\n * @example\n * ```ts\n * clamp(140, 0, 100); // 100\n * clamp(-3, 0, 100);  // 0\n * clamp(42, 0, 100);  // 42\n * ```\n */\nexport function clamp(value: number, min: number, max: number): number {\n  return Math.min(max, Math.max(min, value));\n}\n","/**\n * Rounds `value` to `decimals` fraction digits, compensating the usual\n * floating point drift (`0.1 + 0.2` rounds to `0.3`, not `0.30000000000000004`).\n *\n * @example\n * ```ts\n * round(0.1 + 0.2, 2); // 0.3\n * round(1.005, 2);     // 1.01\n * round(7.4);          // 7\n * ```\n */\nexport function round(value: number, decimals = 0): number {\n  const factor = 10 ** decimals;\n  return Math.round((value + Number.EPSILON) * factor) / factor;\n}\n","import { coerceNumberProperty } from '@angular/cdk/coercion';\n\n/**\n * Input-transform factory: coerces any bound value to a number, falling\n * back to `fallback` for `null` / `undefined` / unparsable input. The\n * standard transform for numeric `input()`s across ngwr.\n *\n * @example\n * ```ts\n * readonly speed = input(4, { transform: numAttr(4) });\n * ```\n */\nexport const numAttr =\n  (fallback: number) =>\n  (value: unknown): number =>\n    coerceNumberProperty(value, fallback);\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\n/**\n * Reads the root font size (in pixels) from\n * `getComputedStyle(document.documentElement).fontSize`.\n *\n * Typical use case: converting `rem` values to pixels for layout calculations.\n *\n * Falls back to the provided value when:\n * - DOM is not available (SSR);\n * - `getComputedStyle` fails or returns an unparseable value.\n *\n * @example\n * ```ts\n * const rootFontSize = getRootFontSize();      // e.g. 16\n * const customFallback = getRootFontSize(14);  // uses 14 if DOM is unavailable\n * ```\n *\n * @param fallback - Value in pixels when DOM is unavailable. Defaults to `16`.\n * @returns Root font size in pixels.\n */\nexport function getRootFontSize(fallback = 16): number {\n  try {\n    if (typeof window === 'undefined' || typeof document === 'undefined') {\n      return fallback;\n    }\n\n    const raw = window.getComputedStyle(document.documentElement).fontSize;\n    const parsed = Number.parseFloat(raw);\n\n    return Number.isFinite(parsed) ? parsed : fallback;\n  } catch {\n    return fallback;\n  }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nconst FOCUSABLE_SELECTOR = [\n  'a[href]',\n  'area[href]',\n  'button:not([disabled])',\n  'input:not([disabled]):not([type=\"hidden\"])',\n  'select:not([disabled])',\n  'textarea:not([disabled])',\n  'iframe',\n  'object',\n  'embed',\n  'audio[controls]',\n  'video[controls]',\n  '[contenteditable]:not([contenteditable=\"false\"])',\n  '[tabindex]:not([tabindex=\"-1\"])',\n].join(',');\n\n/** Return every focusable descendant of `root` in DOM order. */\nexport function getFocusableElements(root: HTMLElement): readonly HTMLElement[] {\n  return Array.from(root.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR)).filter(\n    el => el.offsetParent !== null || el === document.activeElement\n  );\n}\n\n/**\n * Trap Tab navigation inside `root` for a keyboard event — call from a\n * `keydown` handler. Cycles focus from first ↔ last focusable element.\n * Returns `true` when focus was redirected (event was handled).\n */\nexport function trapFocus(root: HTMLElement, event: KeyboardEvent): boolean {\n  if (event.key !== 'Tab') return false;\n  const focusable = getFocusableElements(root);\n  if (focusable.length === 0) return false;\n\n  const first = focusable[0];\n  const last = focusable[focusable.length - 1];\n  const active = document.activeElement as HTMLElement | null;\n\n  if (event.shiftKey && active === first) {\n    event.preventDefault();\n    last.focus();\n    return true;\n  }\n  if (!event.shiftKey && active === last) {\n    event.preventDefault();\n    first.focus();\n    return true;\n  }\n  return false;\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { getRootFontSize } from '../dom';\n\nimport type { ResolveCssSizeOptions } from './resolve-css-size-options';\nimport type { ResolvedCssSize } from './resolved-css-size';\n\n/**\n * Resolves a raw size value into a CSS string and an optional pixel equivalent.\n *\n * Supported formats:\n * - `number`   → pixels        (`48`    → `\"48px\"`)\n * - `\"12px\"`   → pixels        (`\"12px\"` → `\"12px\"`)\n * - `\"3rem\"`   → rems via root (`\"3rem\"` → `\"3rem\"`, pxValue = 3 × root font size)\n * - `\"80%\"`    → percentage    (`\"80%\"`  → `\"80%\"`,  pxValue = null)\n * - `\"15\"`     → pixels        (`\"15\"`   → `\"15px\"`)\n * - anything else → passed through as-is, pxValue = null\n *\n * @example\n * ```ts\n * const size = resolveCssSize('3rem', { defaultValue: '6rem' });\n * // size.cssValue === '3rem'\n * // size.pxValue  === 3 * getRootFontSize()\n * ```\n *\n * @param raw - Value to resolve. Accepts numbers, pixel/rem/percent strings, or `null`/`undefined`.\n * @param options - Optional configuration.\n * @returns Resolved CSS value and its pixel equivalent when computable.\n *\n * @see {@link ResolvedCssSize}\n * @see {@link ResolveCssSizeOptions}\n */\nexport function resolveCssSize(raw: unknown, options: ResolveCssSizeOptions = {}): ResolvedCssSize {\n  const rootFontSize = getRootFontSize();\n  const value: unknown = raw ?? options.defaultValue;\n\n  if (value == null) {\n    return { cssValue: '0px', pxValue: 0 };\n  }\n\n  if (typeof value === 'number' && Number.isFinite(value)) {\n    return { cssValue: `${value}px`, pxValue: value };\n  }\n\n  if (typeof value !== 'string') {\n    return { cssValue: '0px', pxValue: 0 };\n  }\n\n  const trimmed = value.trim();\n\n  const remMatch = /^([\\d.]+)\\s*rem$/i.exec(trimmed);\n  if (remMatch) {\n    const rem = Number.parseFloat(remMatch[1]);\n    const px = rem * rootFontSize;\n    return { cssValue: `${rem}rem`, pxValue: Number.isFinite(px) ? px : null };\n  }\n\n  const pxMatch = /^([\\d.]+)\\s*px$/i.exec(trimmed);\n  if (pxMatch) {\n    const px = Number.parseFloat(pxMatch[1]);\n    return { cssValue: `${px}px`, pxValue: Number.isFinite(px) ? px : null };\n  }\n\n  const percentMatch = /^([\\d.]+)\\s*%$/.exec(trimmed);\n  if (percentMatch) {\n    return { cssValue: `${percentMatch[1]}%`, pxValue: null };\n  }\n\n  const numberMatch = /^([\\d.]+)$/.exec(trimmed);\n  if (numberMatch) {\n    const px = Number.parseFloat(numberMatch[1]);\n    return { cssValue: `${px}px`, pxValue: Number.isFinite(px) ? px : null };\n  }\n\n  return { cssValue: trimmed, pxValue: null };\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nconst ALPHABET = 'abcdefghijklmnopqrstuvwxyz0123456789';\nconst MIN_LENGTH = 4;\nconst MAX_LENGTH = 64;\nconst DEFAULT_LENGTH = 12;\n\n/**\n * Returns random bytes using the best available source.\n *\n * @internal\n */\nfunction defaultRandomBytes(count: number): Uint8Array {\n  // Covers: all browsers, Node ≥ 18, Deno, Bun, Cloudflare Workers\n  if (typeof crypto !== 'undefined' && typeof crypto.getRandomValues === 'function') {\n    return crypto.getRandomValues(new Uint8Array(count));\n  }\n\n  // Fallback: Node < 18 or exotic runtimes\n  const buf = new Uint8Array(count);\n  for (let i = 0; i < count; i++) {\n    buf[i] = Math.floor(Math.random() * 256);\n  }\n  return buf;\n}\n\n/**\n * Generates a pseudo-random, DOM-safe identifier.\n *\n * Produced ids:\n * - are prefixed to avoid collisions with host-application ids;\n * - contain only `[a-z0-9-]` characters;\n * - use `crypto.getRandomValues` when available, falling back to `Math.random`.\n *\n * **Not suitable for cryptographic or security-sensitive purposes** —\n * intended only for UI element identifiers (`id`, `for`, `aria-*`, etc.).\n *\n * @example\n * ```ts\n * randomId();\n * // → \"wr-a8f2bx1k9q4z\"\n *\n * randomId('ng', 8);\n * // → \"ng-k2f9mbeo\"\n *\n * randomId('wr', 24);\n * // → \"wr-a8f2bx1k9q4zmneo73wplr\"\n * ```\n *\n * @param prefix - Namespace prefix prepended before the random segment. Defaults to `'wr'`.\n * @param length - Length of the random segment. Clamped to `[4, 64]`. Defaults to `12`.\n * @param random - Custom random byte source `(byteLength) => Uint8Array`.\n *   When omitted, uses `crypto.getRandomValues` with a `Math.random` fallback.\n * @returns A pseudo-random id string matching `/^[a-z]+-[a-z0-9]+$/`.\n */\nexport function randomId(prefix = 'wr', length = DEFAULT_LENGTH, random?: (byteLength: number) => Uint8Array): string {\n  const safeLength = Math.min(Math.max(Math.trunc(length), MIN_LENGTH), MAX_LENGTH);\n\n  const bytes = random ? random(safeLength) : defaultRandomBytes(safeLength);\n\n  let result = '';\n  for (let i = 0; i < safeLength; i++) {\n    result += ALPHABET[bytes[i] % ALPHABET.length];\n  }\n\n  return `${prefix}-${result}`;\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\n/**\n * A function that does nothing.\n *\n * Useful as a default callback, placeholder event handler,\n * or to explicitly signal intentional no-ops.\n *\n * @example\n * ```ts\n * @Component({ ... })\n * export class MyComponent {\n *   onTouched: () => void = noop;\n * }\n * ```\n */\nexport const noop = (): void => undefined;\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\n/** A debounced function — same signature as the original plus `cancel`. */\nexport type WrDebouncedFn<TArgs extends readonly unknown[]> = ((...args: TArgs) => void) & {\n  readonly cancel: () => void;\n};\n\n/**\n * Wrap `fn` so it only fires `waitMs` after the last invocation.\n * Useful for resize / scroll / input handlers.\n *\n * @example\n * ```ts\n * const onResize = debounce(() => recalcLayout(), 150);\n * window.addEventListener('resize', onResize);\n * ```\n */\nexport function debounce<TArgs extends readonly unknown[]>(\n  fn: (...args: TArgs) => void,\n  waitMs: number\n): WrDebouncedFn<TArgs> {\n  let timer: ReturnType<typeof setTimeout> | null = null;\n\n  const debounced = (...args: TArgs): void => {\n    if (timer !== null) clearTimeout(timer);\n    timer = setTimeout(() => {\n      timer = null;\n      fn(...args);\n    }, waitMs);\n  };\n\n  debounced.cancel = (): void => {\n    if (timer !== null) {\n      clearTimeout(timer);\n      timer = null;\n    }\n  };\n\n  return debounced;\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\n/** A throttled function — same signature as the original plus `cancel`. */\nexport type WrThrottledFn<TArgs extends readonly unknown[]> = ((...args: TArgs) => void) & {\n  readonly cancel: () => void;\n};\n\n/**\n * Wrap `fn` so it fires at most once every `waitMs`. Leading-edge call\n * fires immediately; trailing-edge call fires once at the end of the window\n * if there were further invocations.\n */\nexport function throttle<TArgs extends readonly unknown[]>(\n  fn: (...args: TArgs) => void,\n  waitMs: number\n): WrThrottledFn<TArgs> {\n  let lastInvoke = 0;\n  let trailingTimer: ReturnType<typeof setTimeout> | null = null;\n  let pendingArgs: TArgs | null = null;\n\n  const throttled = (...args: TArgs): void => {\n    const now = Date.now();\n    const remaining = waitMs - (now - lastInvoke);\n\n    if (remaining <= 0) {\n      if (trailingTimer !== null) {\n        clearTimeout(trailingTimer);\n        trailingTimer = null;\n      }\n      lastInvoke = now;\n      fn(...args);\n    } else {\n      pendingArgs = args;\n      trailingTimer ??= setTimeout(() => {\n        lastInvoke = Date.now();\n        trailingTimer = null;\n        if (pendingArgs) fn(...pendingArgs);\n        pendingArgs = null;\n      }, remaining);\n    }\n  };\n\n  throttled.cancel = (): void => {\n    if (trailingTimer !== null) {\n      clearTimeout(trailingTimer);\n      trailingTimer = null;\n    }\n    pendingArgs = null;\n    lastInvoke = 0;\n  };\n\n  return throttled;\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\n/**\n * Canonical `KeyboardEvent.key` values used across ngwr components.\n * Use these constants instead of magic strings so refactors are searchable.\n */\nexport const KEYS = {\n  ENTER: 'Enter',\n  ESCAPE: 'Escape',\n  TAB: 'Tab',\n  SPACE: ' ',\n  BACKSPACE: 'Backspace',\n  DELETE: 'Delete',\n  ARROW_UP: 'ArrowUp',\n  ARROW_DOWN: 'ArrowDown',\n  ARROW_LEFT: 'ArrowLeft',\n  ARROW_RIGHT: 'ArrowRight',\n  HOME: 'Home',\n  END: 'End',\n  PAGE_UP: 'PageUp',\n  PAGE_DOWN: 'PageDown',\n} as const;\n\nexport type WrKey = (typeof KEYS)[keyof typeof KEYS];\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\n/** True when any modifier key (Ctrl / Cmd / Alt / Shift / Meta) is held. */\nexport function hasModifier(event: KeyboardEvent): boolean {\n  return event.ctrlKey || event.altKey || event.metaKey || event.shiftKey;\n}\n\n/**\n * True when the key is a single printable character (letters, digits,\n * punctuation, etc.). Skips function keys, arrows, modifiers, and named\n * keys like `Backspace` or `Tab`.\n */\nexport function isPrintableKey(event: KeyboardEvent): boolean {\n  return event.key.length === 1 && !event.ctrlKey && !event.metaKey && !event.altKey;\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\n/**\n * Logs a coloured pill to the browser console followed by a payload.\n *\n * Useful when you need to scan a noisy console for a specific subsystem's\n * messages. The pill is rendered with the CSS `%c` console formatting trick.\n *\n * @example\n * ```ts\n * badgeLog('icons', '#3969e2', { name: 'plus', registered: true });\n * // → [icons] { name: 'plus', registered: true }\n * ```\n *\n * @param badgeText Short label shown inside the pill.\n * @param color    CSS colour applied to the pill border and text.\n * @param message  Anything you'd pass to `console.log` as the second argument.\n *\n * @internal\n */\nexport function badgeLog(badgeText: string, color: string, message: unknown): void {\n  const style = `\n    display: inline-block;\n    border: 1px solid ${color};\n    color: ${color};\n    padding: 1px 3px;\n    border-radius: 4px;\n    margin-right: 0\n  `;\n  // eslint-disable-next-line no-console -- this helper exists to log\n  console.log(`%c${badgeText}`, style, message);\n}\n","// Types\nexport type { Maybe, SafeAny } from './interfaces';\n\n// Guards\nexport { isDefined, isNonEmptyArray, isObservable } from './guards';\n\n// Math\nexport { clamp, round } from './math';\n\n// Coercion\nexport { numAttr } from './coercion';\n\n// CSS size\nexport { resolveCssSize } from './css-size';\nexport type { ResolveCssSizeOptions, ResolvedCssSize } from './css-size';\n\n// DOM\nexport { getRootFontSize, getFocusableElements, trapFocus } from './dom';\n\n// ID\nexport { randomId } from './id';\n\n// Fn\nexport { noop, debounce, throttle } from './fn';\nexport type { WrDebouncedFn, WrThrottledFn } from './fn';\n\n// Keyboard\nexport { KEYS, hasModifier, isPrintableKey } from './keyboard';\nexport type { WrKey } from './keyboard';\n\n// Log\nexport { badgeLog } from './log';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;;;;;AAKG;AAIH;;;;;;;;;;;;;;AAcG;AACG,SAAU,SAAS,CAAI,KAAe,EAAA;AAC1C,IAAA,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS;AAC9C;;AC1BA;;;;;AAKG;AAIH;;;;;;;;;;;;AAYG;AACG,SAAU,eAAe,CAAI,KAAiB,EAAA;AAClD,IAAA,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;AACjD;;ACxBA;;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