{"version":3,"file":"forty-cdk-date-picker.mjs","sources":["../../../projects/forty-cdk/date-picker/src/date-picker-base.ts","../../../projects/forty-cdk/date-picker/src/date-picker-context.ts","../../../projects/forty-cdk/date-picker/src/date-picker-defaults.ts","../../../projects/forty-cdk/date-picker/src/date-picker.ts","../../../projects/forty-cdk/date-picker/src/date-picker-anchor.ts","../../../projects/forty-cdk/date-picker/src/date-picker-trigger.ts","../../../projects/forty-cdk/date-picker/src/date-picker-content.ts","../../../projects/forty-cdk/date-picker/src/date-picker-value.ts","../../../projects/forty-cdk/date-picker/src/date-picker-host-directive.ts","../../../projects/forty-cdk/date-picker/src/date-range-picker-context.ts","../../../projects/forty-cdk/date-picker/src/date-range-picker-defaults.ts","../../../projects/forty-cdk/date-picker/src/date-range-picker.ts","../../../projects/forty-cdk/date-picker/src/date-range-picker-host-directive.ts","../../../projects/forty-cdk/date-picker/src/forty-cdk-date-picker.ts"],"sourcesContent":["import {\n  booleanAttribute,\n  computed,\n  contentChild,\n  Directive,\n  inject,\n  input,\n  isDevMode,\n  model,\n  output,\n  signal,\n  type Signal,\n  type WritableSignal,\n} from '@angular/core';\nimport type { ReferenceElement } from '@floating-ui/dom';\n\nimport {\n  adoptHostId,\n  createVetoableNativeEvent,\n  type DateAdapter,\n  emitVetoableEvent,\n  fortyError,\n  IdGenerator,\n  injectTextDirection,\n  type VetoableEvent,\n  type VetoableNativeEvent,\n  type WritingDirection,\n} from 'forty-cdk/core';\nimport { AnchoredFormValueControlBase } from 'forty-cdk/core-overlay';\nimport { ForCalendar } from 'forty-cdk/calendar';\nimport type { ForDatePickerContext } from './date-picker-context';\n\n/**\n * Shared overlay / trigger / anchor / content / dismiss / focus machinery for\n * the date-picker roots. Both the single-date `ForDatePicker` and the\n * range-form `ForDateRangePicker` extend it, so the floating surface, the\n * dismissible-layer wiring, the optional positioning anchor, the trigger /\n * content registration, return-focus, and the vetoable dismiss / auto-focus\n * outputs live in one place instead of being duplicated per root.\n *\n * It implements the full {@link ForDatePickerContext} except `formattedValue`,\n * which depends on the concrete value type (single date vs `start – end`).\n * That, plus the `adapter`, the per-root `positioningDefaults` token, and the\n * generated `triggerId` / `contentId`, are declared abstract so each concrete\n * root owns them; everything else is concrete and inherited.\n *\n * Each concrete root keeps ownership of its `value` model (the\n * `FormValueControl` backing), its hidden-input serialization, and its\n * calendar-selection bridge — those are value-type specific and never shared.\n *\n * Internal — not re-exported from `public-api.ts`.\n *\n * @typeParam D The adapter's immutable date type.\n */\n@Directive()\nexport abstract class DatePickerBase<D>\n  extends AnchoredFormValueControlBase\n  implements ForDatePickerContext\n{\n  /** Shared id generator; concrete roots seed {@link triggerId} / {@link contentId} from it. */\n  protected readonly idGen = inject(IdGenerator);\n\n  /** The active date adapter, resolved from `FOR_DATE_ADAPTER` (shared with `ForCalendar`). */\n  abstract readonly adapter: DateAdapter<D>;\n\n  /**\n   * Two-way bindable. Whether the surface is open. The `model()` change emitter\n   * (`(openChange)`) fires only on internal transitions (trigger toggle,\n   * Escape, outside dismissal, selection), never on consumer writes via\n   * `[(open)]`.\n   */\n  readonly open = model<boolean>(false);\n\n  /**\n   * Minimum selectable date (inclusive). Forward to the projected calendar's\n   * `[min]`. Named `minDate` (not `min`) because `FormUiControl.min` is reserved\n   * for a numeric validator bound by `[formField]`.\n   */\n  readonly minDate = input<D | null>(null);\n\n  /**\n   * Maximum selectable date (inclusive). Forward to the projected calendar's\n   * `[max]`. Named `maxDate` (not `max`) for the same reason as {@link minDate}.\n   */\n  readonly maxDate = input<D | null>(null);\n\n  /** Per-date predicate. Forward to the projected calendar's `[isDateUnavailable]`. */\n  readonly isDateUnavailable = input<(date: D) => boolean>(() => false);\n\n  /**\n   * Close the surface after a selection is committed in the projected calendar.\n   * Default `true`.\n   */\n  readonly closeOnSelect = input(true, { transform: booleanAttribute });\n\n  /**\n   * When `true`, the surface is a trapped / inert / scroll-locked modal dialog\n   * (routed through `core-overlay/modal-shell`) instead of the default non-modal\n   * anchored popover. Read once when the content mounts.\n   */\n  readonly modal = input(false, { transform: booleanAttribute });\n\n  /** When true (default), Escape, pointer-down outside, and focus outside close the surface. */\n  readonly dismissible = input(true, { transform: booleanAttribute });\n\n  /** When true (default), focus returns to the trigger on close. */\n  readonly returnFocus = input(true, { transform: booleanAttribute });\n\n  /**\n   * `Intl.DateTimeFormat` options driving the text rendered by\n   * `[forDatePickerValue]`. Default `{ year: 'numeric', month: 'long', day: 'numeric' }`.\n   */\n  readonly formatOptions = input<Intl.DateTimeFormatOptions>({\n    year: 'numeric',\n    month: 'long',\n    day: 'numeric',\n  });\n\n  /**\n   * BCP 47 locale tag driving the text rendered by `[forDatePickerValue]`. When\n   * `null` (default), the adapter formats through the runtime's default locale.\n   * The projected `ForCalendar` is not forwarded this value — bind its own\n   * `[locale]` directly, mirroring how `minDate` / `maxDate` are forwarded.\n   */\n  readonly locale = input<string | null>(null);\n\n  /** Text rendered by `[forDatePickerValue]` when nothing is selected. */\n  readonly placeholder = input<string>('');\n\n  /** Accessible name for the dialog surface. Emits no `aria-label` while `null`. */\n  readonly ariaLabel = input<string | null>(null);\n\n  /**\n   * Writing direction. When unset (default `null`), the inherited ambient\n   * direction is resolved from the nearest ancestor carrying a `dir` attribute\n   * (or `<html dir>`), defaulting to `'ltr'`. An explicit `[dir]` always wins.\n   * The resolved value is reflected to the host `dir` attribute.\n   */\n  readonly _dirInput = input<WritingDirection | null>(null, { alias: 'dir' });\n  readonly dir = injectTextDirection(this._dirInput);\n\n  /**\n   * Fires when the user presses Escape while this surface is the topmost\n   * dismissible layer. Call `preventDefault()` on the veto to suppress the\n   * automatic close.\n   */\n  readonly escapeKeyDown = output<VetoableNativeEvent<KeyboardEvent>>();\n\n  /** Fires when a pointer goes down outside the surface (and trigger). Vetoable. */\n  readonly pointerDownOutside = output<VetoableNativeEvent<PointerEvent>>();\n\n  /** Fires when focus moves outside the surface (and trigger). Vetoable. */\n  readonly focusOutside = output<VetoableNativeEvent<FocusEvent>>();\n\n  /** Composite event: shares veto state with `pointerDownOutside` / `focusOutside`. */\n  readonly interactOutside = output<VetoableNativeEvent<PointerEvent | FocusEvent>>();\n\n  /** Fires just before the surface sends focus into itself on open. Vetoable. */\n  readonly autoFocusOnOpen = output<VetoableEvent>();\n\n  /** Fires just before focus returns to the trigger on close. Vetoable. */\n  readonly autoFocusOnClose = output<VetoableEvent>();\n\n  /** The trigger's `id` for `aria-controls` wiring; concrete roots seed it from {@link idGen}. */\n  abstract readonly triggerId: WritableSignal<string>;\n\n  /** The surface's `id` for `aria-labelledby` wiring; concrete roots seed it from {@link idGen}. */\n  abstract readonly contentId: WritableSignal<string>;\n\n  /** Formatted current value via the adapter, or `null` when empty. */\n  abstract readonly formattedValue: Signal<string | null>;\n\n  readonly #triggerEl = signal<HTMLElement | null>(null);\n  readonly trigger = this.#triggerEl.asReadonly();\n\n  readonly #anchorEl = signal<HTMLElement | null>(null);\n\n  /**\n   * Element floating-ui anchors the surface against. Prefers an optional\n   * `[forDatePickerAnchor]` when registered, otherwise falls back to the\n   * trigger so existing pickers without an anchor keep their behavior.\n   * Decoupled from `trigger` so the trigger keeps driving `aria-controls`, the\n   * click toggle, focus return, and its dismissal exemption regardless of where\n   * the surface paints.\n   */\n  readonly reference = computed<ReferenceElement | null>(\n    () => this.#anchorEl() ?? this.#triggerEl(),\n  );\n\n  readonly #contentEl = signal<HTMLElement | null>(null);\n  readonly content = this.#contentEl.asReadonly();\n\n  /**\n   * The projected `ForCalendar`. Mounts only while the surface is open, so the\n   * query resolves to the live instance on open and to `undefined` on close.\n   * Its `valueChange` / `rangeChange` is the single signal that a selection\n   * happened inside the grid — each concrete root wires the matching one in its\n   * constructor.\n   *\n   * Invariant: the projected calendar MUST resolve the same `DateAdapter` as\n   * this root (the same `FOR_DATE_ADAPTER` scope). Angular's `contentChild`\n   * erases the generic, so a bridge reads `calendar.value` / `calendar.range`\n   * via a cast; a mismatched adapter would leak a wrong-shaped date through that\n   * seam. {@link assertSameAdapter} catches it early in dev mode.\n   */\n  protected readonly calendar = contentChild(ForCalendar, { descendants: true });\n\n  /**\n   * Dev-mode guard for a concrete root's calendar-selection bridge: throws when\n   * the projected `ForCalendar` resolved a different `DateAdapter` than this\n   * root, which would leak a wrong-shaped date through the generic-erased\n   * `contentChild` seam.\n   */\n  protected assertSameAdapter(calendar: ForCalendar<unknown>): void {\n    if (isDevMode() && calendar.adapter !== (this.adapter as DateAdapter<unknown>)) {\n      throw fortyError({\n        code: 'FORCDK-DATE-PICKER-001',\n        message: 'The projected ForCalendar uses a different DateAdapter than the date picker.',\n        cause:\n          'The calendar is read through a generic-erased contentChild, so a second adapter would ' +\n          'leak a wrong-shaped date value into the picker.',\n        fix: 'Provide one DateAdapter for both, or move the calendar under the picker’s providers.',\n      });\n    }\n  }\n\n  registerTrigger(el: HTMLElement): void {\n    adoptHostId(el, this.triggerId);\n    this.#triggerEl.set(el);\n  }\n  unregisterTrigger(el: HTMLElement): void {\n    if (this.#triggerEl() === el) {\n      this.#triggerEl.set(null);\n    }\n  }\n\n  registerAnchor(el: HTMLElement): void {\n    const current = this.#anchorEl();\n    if (current !== null && current !== el) {\n      throw fortyError({\n        code: 'FORCDK-DATE-PICKER-002',\n        message: 'A picker root registered a second [forDatePickerAnchor]; only one is allowed.',\n        fix: 'Keep a single [forDatePickerAnchor] per picker root.',\n      });\n    }\n    this.#anchorEl.set(el);\n  }\n  unregisterAnchor(el: HTMLElement): void {\n    if (this.#anchorEl() === el) {\n      this.#anchorEl.set(null);\n    }\n  }\n\n  registerContent(el: HTMLElement): void {\n    adoptHostId(el, this.contentId);\n    this.#contentEl.set(el);\n  }\n  unregisterContent(el: HTMLElement): void {\n    if (this.#contentEl() === el) {\n      this.#contentEl.set(null);\n    }\n  }\n\n  protected override fieldLabelledElement(): HTMLElement | null {\n    return this.#triggerEl();\n  }\n\n  protected override fieldLabelledElementId(): string {\n    return this.triggerId();\n  }\n\n  /**\n   * Move focus to the trigger, implementing `FormValueControl.focus` from\n   * `@angular/forms/signals`. Without this override Signal Forms would focus the\n   * host `[forDatePicker]` / `[forDateRangePicker]` wrapper — which carries no\n   * focusable role — so focus-on-error would silently go nowhere. No-op when\n   * disabled or before the trigger has registered.\n   */\n  override focus(options?: FocusOptions): void {\n    if (this.effectiveDisabled()) {\n      return;\n    }\n    this.#triggerEl()?.focus(options);\n  }\n\n  toggle(): void {\n    if (this.effectiveDisabled()) {\n      return;\n    }\n    this.open.update((v) => !v);\n  }\n\n  close(): void {\n    this.markTouched();\n    this.open.set(false);\n  }\n\n  override markTouched(): void {\n    super.markTouched();\n  }\n\n  focusCalendarCell(): boolean {\n    return this.calendar()?.focusActiveCell() ?? false;\n  }\n\n  // Both the anchored (`injectOverlayShell`) and modal (`injectModalShell`)\n  // surfaces own the shared `#pendingOutsideVeto` reuse between the specific\n  // outside channels and the composite `interactOutside`, so this root only\n  // forwards the shell-built veto to the matching `output()` and owns the close\n  // decision via `requestClose`. Escape is the one channel this root still owns\n  // end-to-end on the anchored path (the modal path routes it through\n  // `emitEscapeKeyDown` on the shell, which builds the veto and calls\n  // `requestClose` itself).\n\n  /**\n   * Anchored-path Escape. Builds the veto, emits `(escapeKeyDown)`, and —\n   * unless vetoed and `dismissible` is off — stops propagation and closes.\n   */\n  emitEscapeKeyDown(event: KeyboardEvent): void {\n    const veto = createVetoableNativeEvent(event);\n    this.escapeKeyDown.emit(veto);\n    if (!veto.defaultPrevented && this.dismissible()) {\n      event.stopPropagation();\n      this.close();\n    }\n  }\n\n  /**\n   * Outside-interaction emit forwarders shared by both shells. The shell builds\n   * and reuses the veto; these only fire the matching output.\n   */\n  emitPointerDownOutside(veto: VetoableNativeEvent<PointerEvent>): void {\n    this.pointerDownOutside.emit(veto);\n  }\n  emitFocusOutside(veto: VetoableNativeEvent<FocusEvent>): void {\n    this.focusOutside.emit(veto);\n  }\n  emitInteractOutside(veto: VetoableNativeEvent<PointerEvent | FocusEvent>): void {\n    this.interactOutside.emit(veto);\n  }\n\n  /** Modal-path Escape forwarder: emit only; the modal shell owns the close. */\n  forwardEscapeKeyDown(veto: VetoableNativeEvent<KeyboardEvent>): void {\n    this.escapeKeyDown.emit(veto);\n  }\n\n  /**\n   * Implicit close requested by either shell after an un-vetoed outside\n   * interaction (or, on the modal path, an un-vetoed Escape). Marks the control\n   * touched and closes.\n   */\n  requestClose(): void {\n    this.close();\n  }\n\n  emitAutoFocusOnOpen(): boolean {\n    return emitVetoableEvent(this.autoFocusOnOpen);\n  }\n\n  emitAutoFocusOnClose(): boolean {\n    return emitVetoableEvent(this.autoFocusOnClose);\n  }\n}\n","import { computed, inject, InjectionToken, type Signal } from '@angular/core';\nimport type { ReferenceElement } from '@floating-ui/dom';\n\nimport { orphanContextError, unresolvedRootError, type VetoableNativeEvent } from 'forty-cdk/core';\nimport { type FloatingAlign, type FloatingSide } from 'forty-cdk/core-overlay';\n\n/**\n * Coordination contract owned by `[forDatePicker]` (the root). The trigger,\n * content surface, and value pieces inject this token to read state and\n * delegate behavior — they never import the root class directly.\n *\n * The root is the `FormValueControl<D | null>`; the trigger is the focusable\n * element that carries `name` / `disabled` / `invalid` for `[formField]`\n * autowiring.\n *\n * `open` is read-only — route writes through `toggle()` / `close()`. The date\n * `value` is not exposed; the value piece renders the pre-formatted\n * {@link formattedValue}.\n */\nexport interface ForDatePickerContext {\n  /** Whether the surface is open. */\n  readonly open: Signal<boolean>;\n\n  /**\n   * The picker's effective disabled — its own `disabled` input OR'd with a\n   * surrounding disabled `[forFieldset]`. The trigger reads this so a disabled\n   * picker (or fieldset) is inert and reflects the native `disabled` attribute\n   * (its single channel).\n   */\n  readonly effectiveDisabled: Signal<boolean>;\n  readonly readonly: Signal<boolean>;\n  readonly required: Signal<boolean>;\n  readonly invalid: Signal<boolean>;\n  readonly pending: Signal<boolean>;\n\n  /** When `true`, the surface is a trapped / inert / scroll-locked modal dialog. */\n  readonly modal: Signal<boolean>;\n  /** When `true`, Escape / outside-pointer dismiss the surface. */\n  readonly dismissible: Signal<boolean>;\n  /** When `true`, focus returns to the trigger on close. */\n  readonly returnFocus: Signal<boolean>;\n  /** Close the surface after a date is selected in the projected calendar. */\n  readonly closeOnSelect: Signal<boolean>;\n\n  readonly side: Signal<FloatingSide | undefined>;\n  readonly align: Signal<FloatingAlign | undefined>;\n  readonly sideOffset: Signal<number>;\n  readonly alignOffset: Signal<number>;\n  readonly avoidCollisions: Signal<boolean>;\n  readonly collisionPadding: Signal<number>;\n  readonly sticky: Signal<'partial' | 'always' | false>;\n  readonly hideWhenDetached: Signal<boolean>;\n  readonly clipUntilPositioned: Signal<boolean>;\n\n  readonly triggerId: Signal<string>;\n  readonly contentId: Signal<string>;\n  /** Accessible name for the dialog surface. Emits no `aria-label` while `null`. */\n  readonly ariaLabel: Signal<string | null>;\n\n  /** Formatted current value via the adapter, or `null` when empty. Read by `[forDatePickerValue]`. */\n  readonly formattedValue: Signal<string | null>;\n  /** Placeholder shown by `[forDatePickerValue]` when no date is selected. */\n  readonly placeholder: Signal<string>;\n\n  /**\n   * Element floating-ui anchors the surface against. Prefers an optional\n   * `[forDatePickerAnchor]` when registered, otherwise falls back to the\n   * trigger. Decoupled from `trigger` so the trigger keeps driving\n   * `aria-controls`, the click toggle, focus return, and its outside-pointer\n   * exemption regardless of where the surface paints.\n   */\n  readonly reference: Signal<ReferenceElement | null>;\n  /** The trigger button — exempt from outside-pointer checks and the return-focus target. */\n  readonly trigger: Signal<HTMLElement | null>;\n  registerTrigger(el: HTMLElement): void;\n  unregisterTrigger(el: HTMLElement): void;\n\n  /**\n   * Register / unregister an optional `[forDatePickerAnchor]` positioning\n   * element. At most one anchor per root; a second registration throws.\n   * Reference-based unregister, so an anchor torn down inside `@if` restores\n   * the trigger fallback cleanly.\n   */\n  registerAnchor(el: HTMLElement): void;\n  unregisterAnchor(el: HTMLElement): void;\n\n  /** The mounted `[forDatePickerContent]` element. */\n  readonly content: Signal<HTMLElement | null>;\n  registerContent(el: HTMLElement): void;\n  unregisterContent(el: HTMLElement): void;\n\n  /** Toggle from a trigger click. Honours `disabled`. */\n  toggle(): void;\n  /** Close the surface (Escape, outside-pointer, post-selection). Flips `touched`. */\n  close(): void;\n  /** Flip the `touched` model. Called by the trigger on blur-to-outside. */\n  markTouched(): void;\n\n  /**\n   * Move focus to the projected calendar's roving cell (`tabindex=\"0\"`) when\n   * the surface mounts. Returns `false` when no cell is found so the overlay\n   * shell can fall back to the first focusable descendant.\n   */\n  focusCalendarCell(): boolean;\n\n  /**\n   * Anchored-path Escape — consumer-owned. Builds the veto, emits\n   * `(escapeKeyDown)`, and closes unless vetoed (or `dismissible` is off).\n   */\n  emitEscapeKeyDown(event: KeyboardEvent): void;\n  /**\n   * Outside-interaction emit forwarders shared by both shells. The shell\n   * builds and reuses one `VetoableNativeEvent` across the specific and\n   * composite channels; these only fire the matching `output()` and the shell\n   * calls `requestClose` when un-vetoed.\n   */\n  emitPointerDownOutside(veto: VetoableNativeEvent<PointerEvent>): void;\n  emitFocusOutside(veto: VetoableNativeEvent<FocusEvent>): void;\n  emitInteractOutside(veto: VetoableNativeEvent<PointerEvent | FocusEvent>): void;\n  /** Implicit close requested by either shell after an un-vetoed dismissal. */\n  requestClose(): void;\n\n  /**\n   * Modal-path Escape forwarder — the modal-shell builds the veto and owns the\n   * close; this only fires `(escapeKeyDown)`.\n   */\n  forwardEscapeKeyDown(veto: VetoableNativeEvent<KeyboardEvent>): void;\n\n  /**\n   * Auto-focus hooks. Content fires these just before its imperative `.focus()`\n   * (open) or the trigger return-focus (close); `event.preventDefault()` skips\n   * the move. Returns `true` when the consumer vetoed.\n   */\n  emitAutoFocusOnOpen(): boolean;\n  emitAutoFocusOnClose(): boolean;\n}\n\n/** Injection token for {@link ForDatePickerContext}, provided by `ForDatePicker`. */\nexport const FOR_DATE_PICKER_CONTEXT = new InjectionToken<ForDatePickerContext>(\n  'FOR_DATE_PICKER_CONTEXT',\n);\n\n/**\n * Injects the nearest {@link ForDatePickerContext}, throwing a descriptive\n * error when used outside a `[forDatePicker]` element.\n *\n * @param piece Name of the calling directive, used in the error message.\n */\nexport function injectDatePickerContext(piece: string): ForDatePickerContext {\n  const ctx = inject(FOR_DATE_PICKER_CONTEXT, { optional: true });\n  if (!ctx) {\n    throw orphanContextError({\n      code: 'FORCDK-DATE-PICKER-003',\n      piece,\n      root: '[forDatePicker]',\n      token: 'FOR_DATE_PICKER_CONTEXT',\n    });\n  }\n  return ctx;\n}\n\n/**\n * Resolves the trigger's root context: the explicit reference when the\n * `[forDatePickerTrigger]` input carries one, the injected\n * `FOR_DATE_PICKER_CONTEXT` otherwise. The orphan error only fires when neither\n * resolves, on first read of the returned signal. Must be called in an\n * injection context.\n */\nexport function injectDatePickerTriggerContext(\n  explicitRoot: Signal<ForDatePickerContext | ''>,\n): Signal<ForDatePickerContext> {\n  const injected = inject(FOR_DATE_PICKER_CONTEXT, { optional: true });\n  return computed(() => {\n    const explicit = explicitRoot();\n    if (explicit !== '') {\n      return explicit;\n    }\n    if (injected) {\n      return injected;\n    }\n    throw unresolvedRootError({\n      code: 'FORCDK-DATE-PICKER-004',\n      trigger: '[forDatePickerTrigger]',\n      root: '[forDatePicker]',\n      token: 'FOR_DATE_PICKER_CONTEXT',\n      exportAs: 'forDatePicker',\n    });\n  });\n}\n","import { type Provider } from '@angular/core';\n\nimport { createDefaults } from 'forty-cdk/core';\nimport {\n  type AnchoredPositioningSeedDefaults,\n  type FloatingAlign,\n  type FloatingSide,\n} from 'forty-cdk/core-overlay';\n\n/**\n * Defaults inherited by descendant date pickers in the surrounding injector\n * scope. Configure with `provideForDatePickerDefaults` either at the\n * application root or in any component's `providers` array; partial overrides\n * merge with the parent scope.\n */\nexport interface ForDatePickerDefaults extends AnchoredPositioningSeedDefaults {\n  /**\n   * Side the surface is anchored to for pickers that don't override `side`\n   * locally. Ignored in `modal` mode. Library fallback `'bottom'`.\n   */\n  side: FloatingSide;\n  /**\n   * Alignment along the chosen `side` for pickers that don't override `align`\n   * locally. Ignored in `modal` mode. Library fallback `'start'`.\n   */\n  align: FloatingAlign;\n  /**\n   * Distance (px) between the trigger and the floating surface along the\n   * resolved `side` axis. Ignored in `modal`\n   * mode (the dialog is centered, not anchored).\n   */\n  sideOffset: number;\n  /**\n   * Padding (px) added to the viewport edges for collision-aware positioning.\n   * Higher values keep the surface further from the edge when `flip` / `shift`\n   * runs.\n   */\n  collisionPadding: number;\n}\n\n/**\n * Library fallback for date-picker defaults, read at the root injector when no\n * consumer has called `provideForDatePickerDefaults`. Exported for the shared\n * defaults contract spec; not re-exported from the primitive's public entry.\n */\nexport const FOR_DATE_PICKER_FALLBACK_DEFAULTS: ForDatePickerDefaults = {\n  side: 'bottom',\n  align: 'start',\n  sideOffset: 8,\n  collisionPadding: 8,\n};\n\nconst { token, provideDefaults } = createDefaults<ForDatePickerDefaults>(\n  'FOR_DATE_PICKER_DEFAULTS',\n  FOR_DATE_PICKER_FALLBACK_DEFAULTS,\n);\n\n/** Token holding the resolved date-picker defaults for the current scope. */\nexport const FOR_DATE_PICKER_DEFAULTS = token;\n\n/**\n * Configures forty-cdk date-picker defaults for this injector scope. Partial\n * overrides inherit unspecified keys from the parent scope (or library\n * defaults at the root).\n */\nexport function provideForDatePickerDefaults(\n  defaults: Partial<ForDatePickerDefaults> = {},\n): Provider[] {\n  return provideDefaults(defaults);\n}\n","import {\n  computed,\n  Directive,\n  effect,\n  inject,\n  input,\n  isDevMode,\n  model,\n  signal,\n  contentChild,\n} from '@angular/core';\nimport type { FormValueControl } from '@angular/forms/signals';\n\nimport {\n  assertTimeCapable,\n  clampToBounds,\n  composeWithTime,\n  type DateAdapter,\n  type FieldGranularity,\n  FOR_TIME_VALUE_SOURCE,\n  fortyError,\n  injectDateAdapter,\n  injectHiddenInput,\n  serializeISODate,\n} from 'forty-cdk/core';\nimport { DatePickerBase } from './date-picker-base';\nimport { FOR_DATE_PICKER_CONTEXT, type ForDatePickerContext } from './date-picker-context';\nimport { FOR_DATE_PICKER_DEFAULTS } from './date-picker-defaults';\n\n/**\n * Headless date picker — the [WAI-ARIA Date Picker Dialog pattern](https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/examples/datepicker-dialog/)\n * reinterpreted idiomatically for modern Angular: a focusable trigger that opens\n * a floating surface wrapping a projected `ForCalendar`.\n *\n * The root is the form value: it implements `FormValueControl<D | null>`, so it auto-wires with\n * `[formField]` and auto-associates inside a `[forField]`. The trigger is the focusable control\n * carrying `name` / `disabled` / `invalid`.\n *\n * The surface defaults to a non-modal popover anchored to the trigger, dismissed on Escape or an\n * outside pointer, returning focus on close; set `modal` for the trapped, inert, scroll-locked\n * variant. Mounting is the consumer's job — wrap `[forDatePickerContent]` with `@if (open())`.\n *\n * The projected `ForCalendar` is two-way bound by the consumer and forwarded `[min]` / `[max]` /\n * `[isDateUnavailable]` from the picker's accessors. On selection the picker mirrors the value,\n * flips `touched` and — with the default `closeOnSelect` — closes the surface.\n *\n * Setting `granularity` finer than `'day'` makes it a date-time picker: project a `[forTimeField]`\n * beside the calendar and bind both children **one-way** to `picker.value()`, and the picker grafts\n * the entered time onto each selection. That requires a time-capable adapter.\n *\n * For range selection use `ForDateRangePicker`.\n *\n * The bounds are named `minDate` / `maxDate` because `min` / `max` are reserved `FormUiControl`\n * members.\n *\n * @typeParam D The adapter's immutable date (or, with `granularity > 'day'`, date-time) type.\n *\n * @example\n * ```html\n * <div forDatePicker [(value)]=\"date\" [(open)]=\"open\" [minDate]=\"min\" [maxDate]=\"max\"\n *      name=\"dob\" [ariaLabel]=\"'Choose date'\" #picker=\"forDatePicker\">\n *   <button forDatePickerTrigger>\n *     <span forDatePickerValue>Pick a date</span>\n *   </button>\n *\n *   @if (open()) {\n *     <div forDatePickerContent>\n *       <div forCalendar [(value)]=\"date\" [min]=\"picker.minDate()\" [max]=\"picker.maxDate()\">\n *         <!-- …calendar header + grid… -->\n *       </div>\n *     </div>\n *   }\n * </div>\n * ```\n *\n * @example Date-time picker (`granularity=\"minute\"`), children bound one-way:\n * ```html\n * <div forDatePicker [(value)]=\"when\" [(open)]=\"open\" granularity=\"minute\"\n *      [hourCycle]=\"24\" #picker=\"forDatePicker\">\n *   <button forDatePickerTrigger><span forDatePickerValue>Pick date & time</span></button>\n *   @if (open()) {\n *     <div forDatePickerContent>\n *       <div forCalendar [value]=\"picker.value()\" [min]=\"picker.minDate()\">…</div>\n *       <div forTimeField [value]=\"picker.value()\" [hourCycle]=\"picker.hourCycle()\">…</div>\n *     </div>\n *   }\n * </div>\n * ```\n */\n@Directive({\n  selector: '[forDatePicker]',\n  exportAs: 'forDatePicker',\n  host: {\n    '[attr.dir]': 'dir()',\n    '[attr.data-state]': 'open() ? \"open\" : \"closed\"',\n    '[attr.data-disabled]': 'effectiveDisabled() ? \"\" : null',\n    '[attr.data-readonly]': 'readonly() ? \"\" : null',\n  },\n  providers: [{ provide: FOR_DATE_PICKER_CONTEXT, useExisting: ForDatePicker }],\n})\nexport class ForDatePicker<D>\n  extends DatePickerBase<D>\n  implements FormValueControl<D | null>, ForDatePickerContext\n{\n  protected readonly positioningDefaults = inject(FOR_DATE_PICKER_DEFAULTS);\n\n  /** The active date adapter, resolved from `FOR_DATE_ADAPTER` (shared with `ForCalendar`). */\n  readonly adapter: DateAdapter<D> = injectDateAdapter<D>('ForDatePicker', {\n    scope: 'date-picker',\n  });\n\n  readonly triggerId = signal(this.idGen.next('for-date-picker-trigger'));\n  readonly contentId = signal(this.idGen.next('for-date-picker-content'));\n\n  /**\n   * Two-way bindable selected date, or `null`. Required by\n   * `FormValueControl<D | null>`. The `model()` change emitter (`(valueChange)`)\n   * fires only when the picker itself commits a selection, never on consumer\n   * writes via `[(value)]`.\n   */\n  readonly value = model<D | null>(null);\n\n  /**\n   * Date-time precision. `'day'` (default, **non-breaking**) keeps a pure\n   * calendar picker. Anything coarser-than-a-day off — `'hour'` / `'minute'` /\n   * `'second'` — turns it into a date-time picker: the consumer projects a\n   * `[forTimeField]` beside the calendar, a calendar selection preserves the\n   * entered time, and the value carries a time component. Requires a\n   * time-capable adapter (`provideNativeDateAdapter()` or\n   * `provideInternationalizedDateTimeAdapter()`).\n   */\n  readonly granularity = input<FieldGranularity>('day');\n\n  /**\n   * 12- or 24-hour cycle forwarded to `[forDatePickerValue]`'s formatting (and\n   * typically to the projected `[forTimeField][hourCycle]`). When `null`\n   * (default) it is derived from the runtime locale. Only meaningful when\n   * `granularity > 'day'`.\n   */\n  readonly hourCycle = input<12 | 24 | null>(null);\n\n  /**\n   * `formatOptions` augmented with time fields when `granularity > 'day'` and\n   * the consumer hasn't already specified any — so a date-time picker's value\n   * display shows the time without extra wiring, while an explicit\n   * `formatOptions` is always honoured verbatim.\n   */\n  readonly #effectiveFormatOptions = computed<Intl.DateTimeFormatOptions>(() => {\n    const options = this.formatOptions();\n    const granularity = this.granularity();\n    if (\n      granularity === 'day' ||\n      options.hour !== undefined ||\n      options.minute !== undefined ||\n      options.second !== undefined\n    ) {\n      return options;\n    }\n    const cycle = this.hourCycle();\n    return {\n      ...options,\n      hour: 'numeric',\n      minute: '2-digit',\n      ...(granularity === 'second' ? { second: '2-digit' } : {}),\n      ...(cycle !== null ? { hour12: cycle === 12 } : {}),\n    };\n  });\n\n  /** Formatted current value via the adapter, or `null` when empty. */\n  readonly formattedValue = computed<string | null>(() => {\n    const value = this.value();\n    return value === null\n      ? null\n      : this.adapter.format(value, this.#effectiveFormatOptions(), this.locale() ?? undefined);\n  });\n\n  /**\n   * The projected `ForTimeField`, present only in a date-time picker\n   * (`granularity > 'day'`). Like the calendar, it mounts with the surface. The\n   * bridge ignores its transient `null` commits (an incomplete time mid-clear)\n   * so the committed day survives, and grafts a non-null commit's time-of-day\n   * onto the picker's current day — never the time field's internal sentinel.\n   *\n   * Invariant: the projected time field MUST resolve the same `DateAdapter` as\n   * this picker (see {@link DatePickerBase.calendar}). The bridge casts its\n   * `value` to `D | null` because `contentChild` erases the generic; a dev-mode\n   * assertion guards the same-adapter contract.\n   */\n  private readonly timeSource = contentChild(FOR_TIME_VALUE_SOURCE, { descendants: true });\n\n  constructor() {\n    super();\n    injectHiddenInput({\n      name: this.name,\n      values: computed(() => {\n        const value = this.value();\n        if (value === null) {\n          return [];\n        }\n        return [serializeISODate(this.adapter, value, this.granularity(), 'ForDatePicker')];\n      }),\n      disabled: this.effectiveDisabled,\n    });\n\n    // Eager validation: a date-time picker needs a time-capable adapter. Fail\n    // loudly as soon as the granularity input settles, rather than on first\n    // selection deep in a subscription. The throw is raised during change\n    // detection (inside this `effect`) and propagates through Angular's error\n    // handling, so a day-only adapter misconfiguration is surfaced — never\n    // silently swallowed.\n    effect(() => {\n      if (this.granularity() !== 'day') {\n        this.#time();\n      }\n    });\n\n    // Calendar selection bridge. This `effect` does no state derivation — it\n    // only (re)subscribes to the projected calendar's `valueChange` as the\n    // surface mounts / unmounts. The writes happen asynchronously in the\n    // subscription callback (a discrete selection event), exactly like a click\n    // handler, never during the effect's reactive computation.\n    effect((onCleanup) => {\n      const calendar = this.calendar();\n      if (!calendar) {\n        return;\n      }\n      this.assertSameAdapter(calendar);\n\n      const sub = calendar.value.subscribe((date) => {\n        if (this.readonly() || this.effectiveDisabled()) {\n          return;\n        }\n        const selected = date as D | null;\n        // The projected calendar already preserves the time-of-day when it is\n        // one-way bound (`[value]`) to a timed value — `selectDate` re-grafts\n        // the current time via `#withPreservedTime`. This graft is a defensive\n        // fallback for a date-time picker whose calendar value was null or\n        // midnight (e.g. the very first selection): re-apply the previously\n        // entered time-of-day. Reading `value()` here is safe because the\n        // one-way binding means the calendar's own write didn't clobber it.\n        if (selected !== null && this.granularity() !== 'day') {\n          const base = this.value() ?? selected;\n          this.value.set(\n            clampToBounds(\n              this.adapter,\n              composeWithTime(this.#time(), selected, base),\n              this.minDate(),\n              this.maxDate(),\n            ),\n          );\n        } else {\n          this.value.set(\n            selected === null\n              ? null\n              : clampToBounds(this.adapter, selected, this.minDate(), this.maxDate()),\n          );\n        }\n        this.markTouched();\n        // A date-time picker stays open after a day is picked so the time can\n        // still be edited; only a pure day picker honours `closeOnSelect`.\n        if (this.closeOnSelect() && this.granularity() === 'day') {\n          this.close();\n        }\n      });\n      onCleanup(() => sub.unsubscribe());\n    });\n\n    // Time-source bridge (date-time pickers only). The projected time source\n    // (ForTimeField or ForTimePicker) is bound one-way to the picker's value. A\n    // `null` commit (an incomplete time while a segment is cleared) is ignored\n    // so the committed day survives, and a non-null commit grafts only its\n    // time-of-day onto the picker's current day (or today when unset) — so the\n    // time field's internal 2000-01-01 sentinel can never cross into the value.\n    effect((onCleanup) => {\n      const timeSource = this.timeSource();\n      if (!timeSource) {\n        return;\n      }\n      if (isDevMode() && timeSource.adapter !== this.adapter) {\n        throw fortyError({\n          code: 'FORCDK-DATE-PICKER-005',\n          message:\n            'The projected time source (ForTimeField / ForTimePicker) uses a different DateAdapter ' +\n            'than the ForDatePicker.',\n          cause:\n            'The picker composes the time source’s value into its own date, so the two must agree ' +\n            'on the date representation.',\n          fix: 'Provide one DateAdapter for both the picker and its time source.',\n        });\n      }\n      const sub = timeSource.value.subscribe((value) => {\n        if (this.readonly() || this.effectiveDisabled()) {\n          return;\n        }\n        const next = value as D | null;\n        if (next === null) {\n          return;\n        }\n        const day = this.value() ?? this.adapter.today();\n        this.value.set(\n          clampToBounds(\n            this.adapter,\n            composeWithTime(this.#time(), day, next),\n            this.minDate(),\n            this.maxDate(),\n          ),\n        );\n        this.markTouched();\n      });\n      onCleanup(() => sub.unsubscribe());\n    });\n  }\n\n  /** The active adapter, narrowed to a time-capable one; throws when it is day-only. */\n  #time() {\n    return assertTimeCapable(this.adapter, 'ForDatePicker', { scope: 'date-picker' });\n  }\n}\n","import { Directive, ElementRef, inject } from '@angular/core';\n\nimport { registerHandle } from 'forty-cdk/core';\nimport { injectDatePickerContext } from './date-picker-context';\n\n/**\n * Optional positioning anchor. When present, `[forDatePickerContent]` is\n * positioned against this element instead of `[forDatePickerTrigger]` — useful\n * when the trigger lives inside a decorated field box (padding, prefix icon,\n * clear / chevron buttons) and the surface should align to the visible field\n * rather than the inner button.\n *\n * Only positioning changes: the trigger still owns `aria-controls`,\n * `aria-expanded`, the click toggle, focus return on close, and its exemption\n * from outside-pointer dismissal. If no anchor is registered the surface falls\n * back to anchoring against the trigger, so existing usages are unaffected.\n *\n * A date picker's calendar has its own intrinsic width and ignores\n * `--for-floating-anchor-width`, so the practical effect is mostly start / side\n * alignment to the box edge.\n *\n * At most one `[forDatePickerAnchor]` may be registered per `[forDatePicker]`;\n * a second one throws.\n *\n * ```html\n * <div forDatePicker [(value)]=\"date\">\n *   <div forDatePickerAnchor class=\"field-box\">\n *     <icon />\n *     <button forDatePickerTrigger><span forDatePickerValue>…</span></button>\n *     <button class=\"clear\">×</button>\n *   </div>\n *   @if (open()) {\n *     <div forDatePickerContent>…</div>\n *   }\n * </div>\n * ```\n */\n@Directive({\n  selector: '[forDatePickerAnchor]',\n  exportAs: 'forDatePickerAnchor',\n})\nexport class ForDatePickerAnchor {\n  readonly #ctx = injectDatePickerContext('ForDatePickerAnchor');\n  readonly #host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n  constructor() {\n    registerHandle(\n      this.#host.nativeElement,\n      (el) => this.#ctx.registerAnchor(el),\n      (el) => this.#ctx.unregisterAnchor(el),\n    );\n  }\n}\n","import { computed, Directive, effect, ElementRef, inject, input } from '@angular/core';\n\nimport { hostButtonType, reflectDisabled } from 'forty-cdk/core';\nimport { type ForDatePickerContext, injectDatePickerTriggerContext } from './date-picker-context';\n\n/**\n * The button that opens the date-picker surface — and the focusable form\n * control the picker exposes for `[formField]`. Apply on a `<button>` so\n * Space / Enter dispatch native clicks that toggle via `(click)`.\n *\n * Wires APG Date Picker Dialog attributes: `role=\"combobox\"`,\n * `aria-haspopup=\"dialog\"`, `aria-expanded` reflecting `open()`, and\n * `aria-controls` pointing to the content while open. It also reflects the\n * root's form-control state (`aria-readonly` / `aria-required` /\n * `aria-invalid` / `aria-busy`) so the focusable element advertises validity to\n * assistive tech, plus the `data-readonly` styling hook.\n *\n * The role is what makes that reflection legal: `role=\"button\"` — the implicit\n * role of the `<button>` host — supports neither `aria-readonly` nor\n * `aria-required`, so emitting them there was an `aria-allowed-attr` violation\n * that conveyed nothing. `combobox` supports both, and it is the same shape\n * `[forSelectTrigger]` and `[forTimePickerTrigger]` already ship, with\n * `dialog` as the popup token ARIA 1.2 allows for a combobox surface.\n *\n * Disabling: the native `disabled` attribute is the single reflection channel\n * — no `aria-disabled` is emitted, because on a real single-purpose `<button>`\n * trigger the native attribute already conveys the state to assistive\n * technology, and it is what suppresses activation here. It is\n * reflected non-destructively — the directive only removes the attribute when\n * it set it itself — and `data-disabled=\"\"` stays as the styling hook.\n *\n * The trigger is exempt from the surface's dismissible layer — its own click\n * toggles open/close, so an outside-pointer dismissal never races with it.\n *\n * The root is normally resolved via DI from the enclosing `[forDatePicker]`.\n * When the trigger is declared inside an `ng-template` stamped into the root\n * (e.g. via `ngTemplateOutlet`), DI resolves at the template's declaration\n * site and misses the root — pass it explicitly through the selector input,\n * `routerLink`-style: `[forDatePickerTrigger]=\"root\"` with\n * `#root=\"forDatePicker\"`.\n */\n@Directive({\n  selector: '[forDatePickerTrigger]',\n  exportAs: 'forDatePickerTrigger',\n  host: {\n    '[attr.type]': 'buttonType()',\n    role: 'combobox',\n    '[id]': 'ctx().triggerId()',\n    '[attr.aria-haspopup]': '\"dialog\"',\n    '[attr.aria-expanded]': 'ctx().open() ? \"true\" : \"false\"',\n    '[attr.aria-controls]': 'ctx().open() ? ctx().contentId() : null',\n    '[attr.aria-readonly]': 'ctx().readonly() ? \"true\" : null',\n    '[attr.aria-required]': 'ctx().required() ? \"true\" : null',\n    '[attr.aria-invalid]': 'ctx().invalid() ? \"true\" : null',\n    '[attr.aria-busy]': 'ctx().pending() ? \"true\" : null',\n    '[attr.data-state]': 'ctx().open() ? \"open\" : \"closed\"',\n    '[attr.data-disabled]': 'ctx().effectiveDisabled() ? \"\" : null',\n    '[attr.data-readonly]': 'ctx().readonly() ? \"\" : null',\n    '(click)': 'onClick()',\n    '(focusout)': 'onFocusOut($event)',\n  },\n})\nexport class ForDatePickerTrigger {\n  protected readonly buttonType = hostButtonType();\n\n  readonly #host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n  /**\n   * Optional explicit reference to the `[forDatePicker]` root, named after the\n   * selector `routerLink`-style. The bare valueless attribute keeps resolving\n   * the enclosing root via DI; pass the root explicitly\n   * (`[forDatePickerTrigger]=\"root\"`, with `#root=\"forDatePicker\"`) when the\n   * trigger is declared in an `ng-template` stamped inside the root — DI\n   * resolves at the template's declaration site, so the enclosing root is\n   * invisible there. The empty string (what the valueless attribute yields) is\n   * treated as unset.\n   */\n  readonly forDatePickerTrigger = input<ForDatePickerContext | ''>('');\n\n  protected readonly ctx = injectDatePickerTriggerContext(this.forDatePickerTrigger);\n\n  constructor() {\n    const el = this.#host.nativeElement;\n    // Registration is an imperative call into the resolved root's registry,\n    // not state derivation — the effect only re-registers the element when the\n    // resolved root changes (explicit reference swapped at runtime).\n    effect((onCleanup) => {\n      const ctx = this.ctx();\n      ctx.registerTrigger(el);\n      onCleanup(() => ctx.unregisterTrigger(el));\n    });\n    reflectDisabled(computed(() => this.ctx().effectiveDisabled()));\n  }\n\n  protected onClick(): void {\n    this.ctx().toggle();\n  }\n\n  protected onFocusOut(event: FocusEvent): void {\n    const next = event.relatedTarget as HTMLElement | null;\n    if (next) {\n      // Focus moving into the surface we just opened — not a leave.\n      const content = this.ctx().content();\n      if (content && content.contains(next)) {\n        return;\n      }\n      // Focus staying within the trigger's own subtree — not a leave.\n      if (this.#host.nativeElement.contains(next)) {\n        return;\n      }\n    }\n    this.ctx().markTouched();\n  }\n}\n","import { Directive, ElementRef, inject } from '@angular/core';\n\nimport { registerHandle, hostAriaLabel, hostLabelledBy } from 'forty-cdk/core';\nimport {\n  injectModalShell,\n  injectOverlayShell,\n  warnIfMountedWhileClosed,\n} from 'forty-cdk/core-overlay';\nimport { injectDatePickerContext } from './date-picker-context';\n\n/**\n * The date-picker surface. Carries `role=\"dialog\"`, is portaled to\n * `document.body`, and wraps the projected `ForCalendar`. Its lifecycle follows\n * `[forDatePicker].modal`:\n *\n * - **non-modal (default)** — the surface is anchored to the trigger via\n *   `@floating-ui/dom`, dismisses on Escape, pointer-down outside or focus\n *   outside, moves focus to the calendar's roving cell on open, and returns\n *   focus to the trigger on close.\n * - **modal** — focus is trapped, the background is inerted and body scroll is\n *   locked; the dialog is centered and positioned by the consumer's CSS rather\n *   than anchored to the trigger. Same Escape / outside-pointer dismiss and\n *   return-focus.\n *\n * The mode is read once, when the surface is constructed: changing `modal`\n * while the surface is mounted has no effect until it remounts.\n *\n * Mount/unmount of the surface is the consumer's responsibility — wrap with\n * `@if (open())` so `animate.enter` / `animate.leave` fire on the natural\n * mount cycle.\n */\n@Directive({\n  selector: '[forDatePickerContent]',\n  exportAs: 'forDatePickerContent',\n  host: {\n    role: 'dialog',\n    tabindex: '-1',\n    '[id]': 'ctx.contentId()',\n    '[attr.aria-label]': 'resolvedAriaLabel()',\n    '[attr.aria-labelledby]': 'labelledBy()',\n    '[attr.aria-modal]': 'ctx.modal() ? \"true\" : null',\n    '[attr.data-state]': 'ctx.open() ? \"open\" : \"closed\"',\n  },\n})\nexport class ForDatePickerContent {\n  protected readonly ctx = injectDatePickerContext('ForDatePickerContent');\n  readonly #host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n  protected readonly resolvedAriaLabel = hostAriaLabel(() => this.ctx.ariaLabel());\n\n  protected readonly labelledBy = hostLabelledBy(() =>\n    this.resolvedAriaLabel() ? null : this.ctx.triggerId(),\n  );\n\n  constructor() {\n    const ctx = this.ctx;\n    registerHandle(\n      this.#host.nativeElement,\n      (el) => ctx.registerContent(el),\n      (el) => ctx.unregisterContent(el),\n    );\n\n    warnIfMountedWhileClosed({\n      primitive: 'date-picker',\n      piece: '[forDatePickerContent]',\n      condition: 'picker.open()',\n      open: ctx.open,\n    });\n\n    if (ctx.modal()) {\n      injectModalShell({\n        modal: ctx.modal,\n        returnFocus: ctx.returnFocus,\n        // Land on the calendar's active cell with a first-focusable fallback,\n        // matching the non-modal path below — both modes focus the same cell.\n        initialFocus: {\n          move: () => ctx.focusCalendarCell(),\n          veto: () => ctx.emitAutoFocusOnOpen(),\n        },\n        autoFocusOnOpen: () => (event) => {\n          if (ctx.emitAutoFocusOnOpen()) {\n            event.preventDefault();\n          }\n        },\n        autoFocusOnClose: () => (event) => {\n          if (ctx.emitAutoFocusOnClose()) {\n            event.preventDefault();\n          }\n        },\n        dismiss: {\n          dismissible: ctx.dismissible,\n          requestClose: () => ctx.requestClose(),\n          emitEscapeKeyDown: (veto) => ctx.forwardEscapeKeyDown(veto),\n          emitPointerDownOutside: (veto) => ctx.emitPointerDownOutside(veto),\n          emitFocusOutside: (veto) => ctx.emitFocusOutside(veto),\n          emitInteractOutside: (veto) => ctx.emitInteractOutside(veto),\n        },\n      });\n      return;\n    }\n\n    injectOverlayShell({\n      positioner: {\n        kind: 'floating',\n        reference: ctx.reference,\n        open: ctx.open,\n        side: ctx.side,\n        align: ctx.align,\n        sideOffset: ctx.sideOffset,\n        alignOffset: ctx.alignOffset,\n        avoidCollisions: ctx.avoidCollisions,\n        collisionPadding: ctx.collisionPadding,\n        sticky: ctx.sticky,\n        hideWhenDetached: ctx.hideWhenDetached,\n        clipUntilPositioned: ctx.clipUntilPositioned,\n      },\n      dismiss: {\n        dismissible: ctx.dismissible,\n        requestClose: () => ctx.requestClose(),\n        emitEscapeKeyDown: (event) => ctx.emitEscapeKeyDown(event),\n        emitPointerDownOutside: (veto) => ctx.emitPointerDownOutside(veto),\n        emitFocusOutside: (veto) => ctx.emitFocusOutside(veto),\n        emitInteractOutside: (veto) => ctx.emitInteractOutside(veto),\n        // Trigger is exempt — its own click toggles open/close; without\n        // exemption pointer-down-outside would race and double-close.\n        exemptElements: () => {\n          const trigger = ctx.trigger();\n          return trigger ? [trigger] : [];\n        },\n      },\n      // Move focus to the calendar's roving cell on open; the shell falls back\n      // to the first focusable descendant when no cell is found.\n      initialFocus: {\n        move: () => ctx.focusCalendarCell(),\n        veto: () => ctx.emitAutoFocusOnOpen(),\n      },\n      returnFocus: {\n        enabled: ctx.returnFocus,\n        target: () => ctx.trigger(),\n        veto: () => ctx.emitAutoFocusOnClose(),\n      },\n    });\n  }\n}\n","import { computed, Directive, input } from '@angular/core';\n\nimport { injectDatePickerContext } from './date-picker-context';\n\n/**\n * Renders the selected date — formatted through the adapter with the root's\n * `formatOptions` — or the configured placeholder when nothing is selected,\n * into its host element via `textContent`. Apply on a `<span>` (or any inline\n * element) inside `[forDatePickerTrigger]`:\n *\n * ```html\n * <button forDatePickerTrigger>\n *   <span forDatePickerValue placeholder=\"Pick a date…\"></span>\n * </button>\n * ```\n *\n * For fully custom rendering, drop this directive and read\n * `forDatePicker.formattedValue()` / `forDatePicker.value()` from your template.\n */\n@Directive({\n  selector: '[forDatePickerValue]',\n  exportAs: 'forDatePickerValue',\n  host: {\n    '[textContent]': 'displayText()',\n    '[attr.data-placeholder]': 'isPlaceholder() ? \"\" : null',\n  },\n})\nexport class ForDatePickerValue {\n  readonly #ctx = injectDatePickerContext('ForDatePickerValue');\n\n  /** Text shown when no date is selected. Falls back to `[forDatePicker][placeholder]`. */\n  readonly placeholder = input<string>('');\n\n  protected readonly isPlaceholder = computed(() => this.#ctx.formattedValue() === null);\n\n  protected readonly displayText = computed(() => {\n    const formatted = this.#ctx.formattedValue();\n    if (formatted !== null) {\n      return formatted;\n    }\n    return this.placeholder() || this.#ctx.placeholder();\n  });\n}\n","/**\n * Exact public names of every `ForDatePicker` input, its models included. Spread it into the\n * `inputs` array of a `hostDirectives` entry so a wrapper component re-exposes the\n * primitive's full surface — the Signal Forms members `[formField]` binds among them —\n * without hand-maintaining the list. Always spread into an inline object literal as shown\n * below: the literal is what keeps the entry statically analyzable for consumers compiling\n * against the published package. An anti-drift spec fails when this list no longer matches\n * the directive's actual API. See `docs/wrapping-form-primitives.md` for both supported\n * wrapping patterns.\n *\n * @example\n * ```ts\n * @Component({\n *   selector: 'div[myDatePicker]',\n *   template: '',\n *   hostDirectives: [\n *     {\n *       directive: ForDatePicker,\n *       inputs: [...FOR_DATE_PICKER_HOST_DIRECTIVE_INPUTS],\n *       outputs: [...FOR_DATE_PICKER_HOST_DIRECTIVE_OUTPUTS],\n *     },\n *   ],\n * })\n * export class MyDatePicker {}\n * ```\n */\nexport const FOR_DATE_PICKER_HOST_DIRECTIVE_INPUTS = [\n  'value',\n  'open',\n  'align',\n  'alignOffset',\n  'ariaLabel',\n  'avoidCollisions',\n  'clipUntilPositioned',\n  'closeOnSelect',\n  'collisionPadding',\n  'dir',\n  'dirty',\n  'disabled',\n  'dismissible',\n  'errors',\n  'formatOptions',\n  'granularity',\n  'hideWhenDetached',\n  'hourCycle',\n  'invalid',\n  'isDateUnavailable',\n  'locale',\n  'maxDate',\n  'minDate',\n  'modal',\n  'name',\n  'pending',\n  'placeholder',\n  'readonly',\n  'required',\n  'returnFocus',\n  'side',\n  'sideOffset',\n  'sticky',\n  'touched',\n] as const;\n\n/**\n * Exact public names of every `ForDatePicker` output, the Signal Forms `touch` output\n * included. Spread it into the `outputs` array of the same `hostDirectives` entry as\n * {@link FOR_DATE_PICKER_HOST_DIRECTIVE_INPUTS}.\n */\nexport const FOR_DATE_PICKER_HOST_DIRECTIVE_OUTPUTS = [\n  'valueChange',\n  'openChange',\n  'escapeKeyDown',\n  'pointerDownOutside',\n  'focusOutside',\n  'interactOutside',\n  'autoFocusOnOpen',\n  'autoFocusOnClose',\n  'touchedChange',\n  'touch',\n] as const;\n","import { InjectionToken } from '@angular/core';\n\nimport type { ForDatePickerContext } from './date-picker-context';\n\n/**\n * Coordination contract owned by `[forDateRangePicker]` (the range root). It is\n * structurally identical to {@link ForDatePickerContext}: the range root reuses\n * the same trigger / content / value / anchor pieces (which inject\n * `FOR_DATE_PICKER_CONTEXT`), so it provides **both** tokens. This dedicated\n * token exists for advanced consumers and future range-specific pieces that\n * want to resolve the range root unambiguously.\n *\n * Unlike the single-date root, the range root's `formattedValue` renders\n * `start – end` and its form value is the committed `DateRange<D>`.\n */\nexport type ForDateRangePickerContext = ForDatePickerContext;\n\n/** Injection token for {@link ForDateRangePickerContext}, provided by `ForDateRangePicker`. */\nexport const FOR_DATE_RANGE_PICKER_CONTEXT = new InjectionToken<ForDateRangePickerContext>(\n  'FOR_DATE_RANGE_PICKER_CONTEXT',\n);\n","import { type Provider } from '@angular/core';\n\nimport { createDefaults } from 'forty-cdk/core';\nimport {\n  type AnchoredPositioningSeedDefaults,\n  type FloatingAlign,\n  type FloatingSide,\n} from 'forty-cdk/core-overlay';\n\n/**\n * Defaults inherited by descendant date range pickers in the surrounding\n * injector scope. Configure with `provideForDateRangePickerDefaults` either at\n * the application root or in any component's `providers` array; partial\n * overrides merge with the parent scope.\n */\nexport interface ForDateRangePickerDefaults extends AnchoredPositioningSeedDefaults {\n  /**\n   * Side the surface is anchored to for pickers that don't override `side`\n   * locally. Ignored in `modal` mode. Library fallback `'bottom'`.\n   */\n  side: FloatingSide;\n  /**\n   * Alignment along the chosen `side` for pickers that don't override `align`\n   * locally. Ignored in `modal` mode. Library fallback `'start'`.\n   */\n  align: FloatingAlign;\n  /**\n   * Distance (px) between the trigger and the floating surface along the\n   * resolved `side` axis. Ignored in `modal` mode (the dialog is centered, not\n   * anchored).\n   */\n  sideOffset: number;\n  /**\n   * Padding (px) added to the viewport edges for collision-aware positioning.\n   * Higher values keep the surface further from the edge when `flip` / `shift`\n   * runs.\n   */\n  collisionPadding: number;\n}\n\n/**\n * Library fallback for date-range-picker defaults, read at the root injector\n * when no consumer has called `provideForDateRangePickerDefaults`. Exported for\n * the shared defaults contract spec; not re-exported from the primitive's\n * public entry.\n */\nexport const FOR_DATE_RANGE_PICKER_FALLBACK_DEFAULTS: ForDateRangePickerDefaults = {\n  side: 'bottom',\n  align: 'start',\n  sideOffset: 8,\n  collisionPadding: 8,\n};\n\nconst { token, provideDefaults } = createDefaults<ForDateRangePickerDefaults>(\n  'FOR_DATE_RANGE_PICKER_DEFAULTS',\n  FOR_DATE_RANGE_PICKER_FALLBACK_DEFAULTS,\n);\n\n/** Token holding the resolved date-range-picker defaults for the current scope. */\nexport const FOR_DATE_RANGE_PICKER_DEFAULTS = token;\n\n/**\n * Configures forty-cdk date-range-picker defaults for this injector scope.\n * Partial overrides inherit unspecified keys from the parent scope (or library\n * defaults at the root).\n */\nexport function provideForDateRangePickerDefaults(\n  defaults: Partial<ForDateRangePickerDefaults> = {},\n): Provider[] {\n  return provideDefaults(defaults);\n}\n","import {\n  computed,\n  Directive,\n  effect,\n  inject,\n  input,\n  isDevMode,\n  model,\n  signal,\n} from '@angular/core';\nimport type { FormValueControl } from '@angular/forms/signals';\n\nimport {\n  type DateAdapter,\n  type DateRange,\n  fortyError,\n  injectDateAdapter,\n  injectHiddenInput,\n  serializeISODate,\n} from 'forty-cdk/core';\nimport { type ForCalendar } from 'forty-cdk/calendar';\nimport { DatePickerBase } from './date-picker-base';\nimport { FOR_DATE_PICKER_CONTEXT } from './date-picker-context';\nimport {\n  FOR_DATE_RANGE_PICKER_CONTEXT,\n  type ForDateRangePickerContext,\n} from './date-range-picker-context';\nimport { FOR_DATE_RANGE_PICKER_DEFAULTS } from './date-range-picker-defaults';\n\n/**\n * Headless date **range** picker — the form-capable sibling of `ForDatePicker`.\n * It follows the same [WAI-ARIA Date Picker Dialog pattern](https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/examples/datepicker-dialog/)\n * and reuses the same overlay / trigger / anchor / content / value pieces\n * (`[forDatePickerTrigger]`, `[forDatePickerContent]`, `[forDatePickerValue]`,\n * `[forDatePickerAnchor]`) through the shared {@link DatePickerBase}.\n *\n * Where `ForDatePicker[selectionMode=\"range\"]` exposes the range through a\n * plain two-way `[(range)]` model (no form contract), `ForDateRangePicker` is\n * the root **and** the form value: it implements\n * `FormValueControl<DateRange<D> | null>`, so the committed range\n * auto-wires with `[formField]` exactly like any other control. The committed\n * range is the `value` model — the two-click anchor → commit flow keeps `value`\n * `null` until both endpoints are chosen, so the form never sees a half-entered\n * range, and `start <= end` is an invariant (never an error).\n *\n * Project a `ForCalendar` in `selectionMode=\"range\"` inside\n * `[forDatePickerContent]` and bind its `[(range)]` to `picker.value`; the root\n * mirrors each committed range, flips `touched`, and — when `closeOnSelect` is\n * on (default) — closes the surface once both endpoints are set. Range is\n * day-granular in v1 (no time composition).\n *\n * @typeParam D The adapter's immutable date type.\n *\n * Note: the date bounds are named `minDate` / `maxDate`, not `min` / `max` —\n * the latter are reserved `FormUiControl` members typed `number | undefined`,\n * and `FormUiControl.min` / `max` are additionally typed `NonNullable<TValue>`\n * (the range object itself), which is meaningless as a bound.\n *\n * @example\n * ```html\n * <div forDateRangePicker [formField]=\"booking.stay\" [(open)]=\"open\"\n *      [ariaLabel]=\"'Choose date range'\" #picker=\"forDateRangePicker\">\n *   <button forDatePickerTrigger>\n *     <span forDatePickerValue placeholder=\"Pick a range\"></span>\n *   </button>\n *\n *   @if (open()) {\n *     <div forDatePickerContent>\n *       <div forCalendar selectionMode=\"range\" [(range)]=\"picker.value\"\n *            [min]=\"picker.minDate()\" [max]=\"picker.maxDate()\">\n *         <!-- …calendar header + grid… -->\n *       </div>\n *     </div>\n *   }\n * </div>\n * ```\n */\n@Directive({\n  selector: '[forDateRangePicker]',\n  exportAs: 'forDateRangePicker',\n  host: {\n    '[attr.dir]': 'dir()',\n    '[attr.data-state]': 'open() ? \"open\" : \"closed\"',\n    '[attr.data-disabled]': 'effectiveDisabled() ? \"\" : null',\n  },\n  providers: [\n    { provide: FOR_DATE_PICKER_CONTEXT, useExisting: ForDateRangePicker },\n    { provide: FOR_DATE_RANGE_PICKER_CONTEXT, useExisting: ForDateRangePicker },\n  ],\n})\nexport class ForDateRangePicker<D>\n  extends DatePickerBase<D>\n  implements FormValueControl<DateRange<D> | null>, ForDateRangePickerContext\n{\n  protected readonly positioningDefaults = inject(FOR_DATE_RANGE_PICKER_DEFAULTS);\n\n  /** The active date adapter, resolved from `FOR_DATE_ADAPTER` (shared with `ForCalendar`). */\n  readonly adapter: DateAdapter<D> = injectDateAdapter<D>('ForDateRangePicker', {\n    scope: 'date-picker',\n  });\n\n  readonly triggerId = signal(this.idGen.next('for-date-range-picker-trigger'));\n  readonly contentId = signal(this.idGen.next('for-date-range-picker-content'));\n\n  /**\n   * Two-way bindable committed date range, or `null`. Required by\n   * `FormValueControl<DateRange<D> | null>` — this **is** the form\n   * value, so it auto-wires with `[formField]`. The `model()` change emitter\n   * (`(valueChange)`) fires only when the picker itself commits or clears a\n   * range, never on consumer writes via `[(value)]`.\n   */\n  readonly value = model<DateRange<D> | null>(null);\n\n  /**\n   * Minimum inclusive day count for a committed range. Forward to the projected\n   * calendar's `[minRangeLength]`; the calendar's two-click flow rejects a\n   * shorter range as a no-op (anchor preserved). `null` (default) means no\n   * minimum.\n   */\n  readonly minRangeLength = input<number | null>(null);\n\n  /**\n   * Maximum inclusive day count for a committed range. Forward to the projected\n   * calendar's `[maxRangeLength]`. `null` (default) means no maximum.\n   */\n  readonly maxRangeLength = input<number | null>(null);\n\n  /**\n   * Separator rendered between start and end in `[forDatePickerValue]`. Default\n   * `' – '` (en-dash with spaces).\n   */\n  readonly rangeSeparator = input<string>(' – ');\n\n  /** Formatted committed range (`start – end`) via the adapter, or `null` when empty. */\n  readonly formattedValue = computed<string | null>(() => {\n    const range = this.value();\n    if (range === null) {\n      return null;\n    }\n    const fmtOpts = this.formatOptions();\n    const locale = this.locale() ?? undefined;\n    return (\n      this.adapter.format(range.start, fmtOpts, locale) +\n      this.rangeSeparator() +\n      this.adapter.format(range.end, fmtOpts, locale)\n    );\n  });\n\n  constructor() {\n    super();\n\n    const startName = computed(() => (this.name() ? `${this.name()}-start` : ''));\n    const endName = computed(() => (this.name() ? `${this.name()}-end` : ''));\n    injectHiddenInput({\n      name: startName,\n      values: computed(() => {\n        const range = this.value();\n        return range === null\n          ? []\n          : [serializeISODate(this.adapter, range.start, 'day', 'ForDateRangePicker')];\n      }),\n      disabled: this.effectiveDisabled,\n    });\n    injectHiddenInput({\n      name: endName,\n      values: computed(() => {\n        const range = this.value();\n        return range === null\n          ? []\n          : [serializeISODate(this.adapter, range.end, 'day', 'ForDateRangePicker')];\n      }),\n      disabled: this.effectiveDisabled,\n    });\n\n    // Calendar selection bridge. This `effect` does no state derivation — it\n    // only (re)subscribes to the projected calendar's `rangeChange` as the\n    // surface mounts / unmounts. The writes happen asynchronously in the\n    // subscription callback (a discrete selection event), exactly like a click\n    // handler, never during the effect's reactive computation.\n    effect((onCleanup) => {\n      const calendar = this.calendar();\n      if (!calendar) {\n        return;\n      }\n      this.assertSameAdapter(calendar);\n      if (isDevMode() && calendar.selectionMode() !== 'range') {\n        throw fortyError({\n          code: 'FORCDK-DATE-PICKER-006',\n          message: 'ForDateRangePicker projects a ForCalendar that is not in range selection mode.',\n          cause:\n            'The range picker reads the calendar’s `range` output, which only a range calendar emits.',\n          fix: 'Set selectionMode=\"range\" on the projected [forCalendar].',\n        });\n      }\n      const sub = (calendar as ForCalendar<D>).range.subscribe((next) => {\n        if (this.readonly() || this.effectiveDisabled()) {\n          return;\n        }\n        this.value.set(next as DateRange<D> | null);\n        this.markTouched();\n        if (next !== null && this.closeOnSelect()) {\n          this.close();\n        }\n      });\n      onCleanup(() => sub.unsubscribe());\n    });\n  }\n}\n","/**\n * Exact public names of every `ForDateRangePicker` input, its models included. Spread it into\n * the `inputs` array of a `hostDirectives` entry so a wrapper component re-exposes the\n * primitive's full surface — the Signal Forms members `[formField]` binds among them —\n * without hand-maintaining the list. Always spread into an inline object literal as shown\n * below: the literal is what keeps the entry statically analyzable for consumers compiling\n * against the published package. An anti-drift spec fails when this list no longer matches\n * the directive's actual API. See `docs/wrapping-form-primitives.md` for both supported\n * wrapping patterns.\n *\n * @example\n * ```ts\n * @Component({\n *   selector: 'div[myDateRangePicker]',\n *   template: '',\n *   hostDirectives: [\n *     {\n *       directive: ForDateRangePicker,\n *       inputs: [...FOR_DATE_RANGE_PICKER_HOST_DIRECTIVE_INPUTS],\n *       outputs: [...FOR_DATE_RANGE_PICKER_HOST_DIRECTIVE_OUTPUTS],\n *     },\n *   ],\n * })\n * export class MyDateRangePicker {}\n * ```\n */\nexport const FOR_DATE_RANGE_PICKER_HOST_DIRECTIVE_INPUTS = [\n  'value',\n  'open',\n  'align',\n  'alignOffset',\n  'ariaLabel',\n  'avoidCollisions',\n  'clipUntilPositioned',\n  'closeOnSelect',\n  'collisionPadding',\n  'dir',\n  'dirty',\n  'disabled',\n  'dismissible',\n  'errors',\n  'formatOptions',\n  'hideWhenDetached',\n  'invalid',\n  'isDateUnavailable',\n  'locale',\n  'maxDate',\n  'maxRangeLength',\n  'minDate',\n  'minRangeLength',\n  'modal',\n  'name',\n  'pending',\n  'placeholder',\n  'rangeSeparator',\n  'readonly',\n  'required',\n  'returnFocus',\n  'side',\n  'sideOffset',\n  'sticky',\n  'touched',\n] as const;\n\n/**\n * Exact public names of every `ForDateRangePicker` output, the Signal Forms `touch` output\n * included. Spread it into the `outputs` array of the same `hostDirectives` entry as\n * {@link FOR_DATE_RANGE_PICKER_HOST_DIRECTIVE_INPUTS}.\n */\nexport const FOR_DATE_RANGE_PICKER_HOST_DIRECTIVE_OUTPUTS = [\n  'valueChange',\n  'openChange',\n  'escapeKeyDown',\n  'pointerDownOutside',\n  'focusOutside',\n  'interactOutside',\n  'autoFocusOnOpen',\n  'autoFocusOnClose',\n  'touchedChange',\n  'touch',\n] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["token","provideDefaults"],"mappings":";;;;;;AAgCA;;;;;;;;;;;;;;;;;;;;;AAqBG;AAEG,MAAgB,cACpB,SAAQ,4BAA4B,CAAA;;AAIjB,IAAA,KAAK,GAAG,MAAM,CAAC,WAAW,CAAC;AAK9C;;;;;AAKG;IACM,IAAI,GAAG,KAAK,CAAU,KAAK;6EAAC;AAErC;;;;AAIG;IACM,OAAO,GAAG,KAAK,CAAW,IAAI;gFAAC;AAExC;;;AAGG;IACM,OAAO,GAAG,KAAK,CAAW,IAAI;gFAAC;;AAG/B,IAAA,iBAAiB,GAAG,KAAK,CAAuB,MAAM,KAAK;0FAAC;AAErE;;;AAGG;IACM,a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