{"version":3,"file":"ngx-com-components-popover.mjs","sources":["../../../projects/com/components/popover/popover.variants.ts","../../../projects/com/components/popover/popover.utils.ts","../../../projects/com/components/popover/popover-arrow.component.ts","../../../projects/com/components/popover/popover-content.component.ts","../../../projects/com/components/popover/popover-tokens.ts","../../../projects/com/components/popover/popover-positions.ts","../../../projects/com/components/popover/popover-trigger.directive.ts","../../../projects/com/components/popover/popover-close.directive.ts","../../../projects/com/components/popover/popover-template.directive.ts","../../../projects/com/components/popover/index.ts","../../../projects/com/components/popover/ngx-com-components-popover.ts"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\n\n// ─── Type Definitions ───\n\nexport type PopoverPosition = 'above' | 'below' | 'left' | 'right' | 'auto';\nexport type PopoverAlignment = 'start' | 'center' | 'end';\nexport type PopoverTriggerOn = 'click' | 'focus' | 'manual';\nexport type PopoverVariant = 'default' | 'compact' | 'wide' | 'flush';\nexport type PopoverBackdrop = 'transparent' | 'dimmed' | 'none';\nexport type PopoverSide = 'top' | 'bottom' | 'left' | 'right';\n\n// ─── Popover Panel Variants ───\n\n/**\n * Popover panel styling variants.\n *\n * @tokens `--color-popover`, `--color-popover-foreground`, `--color-border`, `--shadow-overlay`, `--radius-popover`, `--radius-overlay`\n */\nexport const popoverPanelVariants: ReturnType<\n  typeof cva<{ variant: Record<PopoverVariant, string> }>\n> = cva(\n  ['relative', 'bg-popover text-popover-foreground', 'border border-border', 'shadow-overlay', 'overflow-hidden'],\n  {\n    variants: {\n      variant: {\n        default: 'rounded-popover p-4 min-w-48 max-w-sm',\n        compact: 'rounded-overlay p-2 min-w-32 max-w-xs',\n        wide: 'rounded-popover p-5 min-w-64 max-w-lg',\n        flush: 'rounded-popover p-0',\n      },\n    },\n    defaultVariants: {\n      variant: 'default',\n    },\n  },\n);\n\nexport type PopoverPanelVariants = VariantProps<typeof popoverPanelVariants>;\n\n// ─── Popover Arrow Variants ───\n\n/**\n * Popover arrow positioning variants.\n * The arrow is positioned on the edge of the popover pointing toward the trigger.\n *\n * @tokens `--color-popover`, `--color-border`\n */\nexport const popoverArrowVariants: ReturnType<\n  typeof cva<{ side: Record<PopoverSide, string> }>\n> = cva('absolute z-10 text-popover', {\n  variants: {\n    side: {\n      top: 'left-1/2 top-full -translate-x-1/2 -translate-y-px rotate-180',\n      bottom: 'left-1/2 bottom-full -translate-x-1/2 translate-y-px',\n      left: 'top-1/2 right-0 -translate-y-1/2 translate-x-[11px] rotate-90',\n      right: 'top-1/2 left-0 -translate-y-1/2 -translate-x-[11px] -rotate-90',\n    },\n  },\n  defaultVariants: {\n    side: 'bottom',\n  },\n});\n\nexport type PopoverArrowVariants = VariantProps<typeof popoverArrowVariants>;\n","export { mergeClasses } from 'ngx-com/utils';\n\nlet popoverIdCounter = 0;\n\n/**\n * Generate a unique ID for a popover instance.\n */\nexport function generatePopoverId(): string {\n  return `popover-${++popoverIdCounter}`;\n}\n","import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';\nimport type { InputSignal, Signal } from '@angular/core';\nimport type { PopoverAlignment, PopoverSide } from './popover.variants';\nimport { popoverArrowVariants } from './popover.variants';\nimport { mergeClasses } from './popover.utils';\n\n/** Alignment offset classes for arrow positioning. */\nconst ALIGNMENT_OFFSETS: Record<PopoverSide, Record<PopoverAlignment, string>> = {\n  top: { start: 'left-4 -translate-x-0', center: '', end: 'left-auto right-4 translate-x-0' },\n  bottom: { start: 'left-4 -translate-x-0', center: '', end: 'left-auto right-4 translate-x-0' },\n  left: { start: 'top-4 -translate-y-0', center: '', end: 'top-auto bottom-4 translate-y-0' },\n  right: { start: 'top-4 -translate-y-0', center: '', end: 'top-auto bottom-4 translate-y-0' },\n};\n\n/**\n * Internal arrow component rendered inside the popover panel.\n * Points toward the trigger element based on the active position.\n *\n * @internal Not exported in public API\n *\n * @tokens `--color-popover`, `--color-border`\n */\n@Component({\n  selector: 'com-popover-arrow',\n  template: `\n    <svg\n      [class]=\"arrowClasses()\"\n      width=\"16\"\n      height=\"8\"\n      viewBox=\"0 0 16 8\"\n      fill=\"none\"\n      xmlns=\"http://www.w3.org/2000/svg\"\n      aria-hidden=\"true\"\n    >\n      <!-- Border stroke (rendered underneath) -->\n      <path\n        d=\"M0 8L8 1L16 8\"\n        fill=\"none\"\n        stroke=\"currentColor\"\n        stroke-width=\"1\"\n        class=\"text-border\"\n      />\n      <!-- Fill (covers the stroke at the base) -->\n      <path d=\"M1 8L8 1.5L15 8\" fill=\"currentColor\" class=\"text-popover\" />\n    </svg>\n  `,\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  host: {\n    class: 'pointer-events-none',\n  },\n})\nexport class ComPopoverArrow {\n  /** Which side of the popover the arrow is on. */\n  readonly side: InputSignal<PopoverSide> = input<PopoverSide>('top');\n\n  /** Alignment along the edge (for offset positioning). */\n  readonly alignment: InputSignal<PopoverAlignment> = input<PopoverAlignment>('center');\n\n  /** Computed CSS classes for the arrow. */\n  protected readonly arrowClasses: Signal<string> = computed(() =>\n    mergeClasses(popoverArrowVariants({ side: this.side() }), ALIGNMENT_OFFSETS[this.side()][this.alignment()]),\n  );\n}\n","import { ChangeDetectionStrategy, Component, computed, signal } from '@angular/core';\nimport type { Signal, WritableSignal } from '@angular/core';\nimport { CdkPortalOutlet, type Portal } from '@angular/cdk/portal';\nimport { ComPopoverArrow } from './popover-arrow.component';\nimport type { PopoverAlignment, PopoverSide, PopoverVariant } from './popover.variants';\nimport { popoverPanelVariants } from './popover.variants';\nimport { mergeClasses } from './popover.utils';\n\n/**\n * Internal content wrapper component for the popover.\n * Renders the panel styling, arrow, and consumer content.\n *\n * @internal Not exported in public API\n *\n * @tokens `--color-popover`, `--color-popover-foreground`, `--color-border`, `--shadow-overlay`, `--radius-popover`, `--radius-overlay`\n */\n@Component({\n  selector: 'com-popover-content',\n  template: `\n    <div\n      class=\"relative\"\n      [attr.data-state]=\"animationState()\"\n      [attr.data-side]=\"activeSide()\"\n    >\n      @if (showArrow()) {\n        <com-popover-arrow [side]=\"activeSide()\" [alignment]=\"activeAlignment()\" />\n      }\n      <div\n        [class]=\"panelClasses()\"\n        role=\"dialog\"\n        [attr.id]=\"popoverId()\"\n        [attr.aria-label]=\"ariaLabel() || null\"\n      >\n        <ng-template [cdkPortalOutlet]=\"contentPortal()\" />\n      </div>\n    </div>\n  `,\n  styles: `\n    :host {\n      display: contents;\n    }\n\n    /* Animation styles */\n    [data-state='open'] {\n      animation: popover-in 150ms ease-out;\n    }\n\n    [data-state='closed'] {\n      animation: popover-out 100ms ease-in forwards;\n    }\n\n    /* Transform origin based on side */\n    [data-side='top'] {\n      transform-origin: bottom center;\n    }\n\n    [data-side='bottom'] {\n      transform-origin: top center;\n    }\n\n    [data-side='left'] {\n      transform-origin: right center;\n    }\n\n    [data-side='right'] {\n      transform-origin: left center;\n    }\n\n    @keyframes popover-in {\n      from {\n        opacity: 0;\n        transform: scale(0.96) translateY(4px);\n      }\n      to {\n        opacity: 1;\n        transform: scale(1) translateY(0);\n      }\n    }\n\n    @keyframes popover-out {\n      from {\n        opacity: 1;\n      }\n      to {\n        opacity: 0;\n      }\n    }\n\n    @media (prefers-reduced-motion: reduce) {\n      [data-state='open'],\n      [data-state='closed'] {\n        animation: none;\n      }\n    }\n  `,\n  imports: [CdkPortalOutlet, ComPopoverArrow],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ComPopoverContent {\n  /** The portal containing consumer content to render. */\n  readonly contentPortal: WritableSignal<Portal<unknown> | null> = signal<Portal<unknown> | null>(null);\n\n  /** Size/padding variant for the panel. */\n  readonly variant: WritableSignal<PopoverVariant> = signal<PopoverVariant>('default');\n\n  /** Whether to render the arrow. */\n  readonly showArrow: WritableSignal<boolean> = signal(true);\n\n  /** Which side the popover is on relative to the trigger. */\n  readonly activeSide: WritableSignal<PopoverSide> = signal<PopoverSide>('top');\n\n  /** Alignment along the cross-axis. */\n  readonly activeAlignment: WritableSignal<PopoverAlignment> = signal<PopoverAlignment>('center');\n\n  /** Unique ID for accessibility. */\n  readonly popoverId: WritableSignal<string> = signal('');\n\n  /** Optional accessibility label. */\n  readonly ariaLabel: WritableSignal<string | undefined> = signal<string | undefined>(undefined);\n\n  /** Animation state for enter/leave. */\n  readonly animationState: WritableSignal<'open' | 'closed'> = signal<'open' | 'closed'>('open');\n\n  /** Additional CSS classes for the panel. */\n  readonly panelClass: WritableSignal<string> = signal('');\n\n  /** Computed CSS classes for the panel. */\n  protected readonly panelClasses: Signal<string> = computed(() =>\n    mergeClasses(popoverPanelVariants({ variant: this.variant() }), this.panelClass()),\n  );\n}\n","import { InjectionToken } from '@angular/core';\n\n/**\n * Interface for the popover reference injected into content.\n * Provides methods to control the popover from within content.\n */\nexport interface PopoverRef {\n  /** Programmatically open the popover. */\n  open(): void;\n  /** Programmatically close the popover. */\n  close(): void;\n  /** Toggle the popover open/close state. */\n  toggle(): void;\n  /** Force recalculation of position. */\n  reposition(): void;\n}\n\n/**\n * Data passed to a component rendered inside the popover.\n * Inject this token to access the data provided via `popoverData` input.\n *\n * @example\n * ```ts\n * @Component({ ... })\n * export class UserProfilePopover {\n *   readonly data = inject(POPOVER_DATA); // { userId: '123' }\n * }\n * ```\n */\nexport const POPOVER_DATA: InjectionToken<unknown> = new InjectionToken<unknown>('POPOVER_DATA');\n\n/**\n * Reference to the popover trigger directive for closing from inside the popover.\n * Inject this token to programmatically close the popover from within content.\n *\n * @example\n * ```ts\n * @Component({ ... })\n * export class UserProfilePopover {\n *   readonly popoverRef = inject(POPOVER_REF);\n *\n *   save(): void {\n *     // ... save logic\n *     this.popoverRef.close();\n *   }\n * }\n * ```\n */\nexport const POPOVER_REF: InjectionToken<PopoverRef> = new InjectionToken<PopoverRef>('POPOVER_REF');\n","import type { ConnectedPosition, ConnectionPositionPair } from '@angular/cdk/overlay';\nimport type { PopoverAlignment, PopoverPosition, PopoverSide } from './popover.variants';\n\n/**\n * Build an ordered list of position pairs for the CDK overlay.\n * The first position is the preferred position; remaining positions are fallbacks.\n *\n * @param position - Preferred position direction ('above', 'below', 'left', 'right', 'auto')\n * @param alignment - Alignment along the cross-axis ('start', 'center', 'end')\n * @param offset - Gap in pixels between trigger and popover edge (default: 8)\n * @returns Array of ConnectedPosition for FlexibleConnectedPositionStrategy\n */\nexport function buildPopoverPositions(\n  position: PopoverPosition,\n  alignment: PopoverAlignment,\n  offset = 8,\n): ConnectedPosition[] {\n  const allPositions = buildAllPositions(offset);\n\n  if (position === 'auto') {\n    // For auto, try below first, then above, then right, then left\n    return [\n      ...getPositionsForDirection('below', alignment, allPositions),\n      ...getPositionsForDirection('above', alignment, allPositions),\n      ...getPositionsForDirection('right', alignment, allPositions),\n      ...getPositionsForDirection('left', alignment, allPositions),\n    ];\n  }\n\n  // Start with preferred direction, then add fallbacks\n  const preferred = getPositionsForDirection(position, alignment, allPositions);\n  const fallbacks = ['below', 'above', 'left', 'right']\n    .filter((dir) => dir !== position)\n    .flatMap((dir) => getPositionsForDirection(dir as PopoverPosition, alignment, allPositions));\n\n  return [...preferred, ...fallbacks];\n}\n\n/**\n * Build all 12 position combinations (4 directions × 3 alignments).\n */\nfunction buildAllPositions(offset: number): Map<string, ConnectedPosition> {\n  const positions = new Map<string, ConnectedPosition>();\n\n  // Below positions\n  positions.set('below-start', {\n    originX: 'start',\n    originY: 'bottom',\n    overlayX: 'start',\n    overlayY: 'top',\n    offsetY: offset,\n  });\n  positions.set('below-center', {\n    originX: 'center',\n    originY: 'bottom',\n    overlayX: 'center',\n    overlayY: 'top',\n    offsetY: offset,\n  });\n  positions.set('below-end', {\n    originX: 'end',\n    originY: 'bottom',\n    overlayX: 'end',\n    overlayY: 'top',\n    offsetY: offset,\n  });\n\n  // Above positions\n  positions.set('above-start', {\n    originX: 'start',\n    originY: 'top',\n    overlayX: 'start',\n    overlayY: 'bottom',\n    offsetY: -offset,\n  });\n  positions.set('above-center', {\n    originX: 'center',\n    originY: 'top',\n    overlayX: 'center',\n    overlayY: 'bottom',\n    offsetY: -offset,\n  });\n  positions.set('above-end', {\n    originX: 'end',\n    originY: 'top',\n    overlayX: 'end',\n    overlayY: 'bottom',\n    offsetY: -offset,\n  });\n\n  // Left positions\n  positions.set('left-start', {\n    originX: 'start',\n    originY: 'top',\n    overlayX: 'end',\n    overlayY: 'top',\n    offsetX: -offset,\n  });\n  positions.set('left-center', {\n    originX: 'start',\n    originY: 'center',\n    overlayX: 'end',\n    overlayY: 'center',\n    offsetX: -offset,\n  });\n  positions.set('left-end', {\n    originX: 'start',\n    originY: 'bottom',\n    overlayX: 'end',\n    overlayY: 'bottom',\n    offsetX: -offset,\n  });\n\n  // Right positions\n  positions.set('right-start', {\n    originX: 'end',\n    originY: 'top',\n    overlayX: 'start',\n    overlayY: 'top',\n    offsetX: offset,\n  });\n  positions.set('right-center', {\n    originX: 'end',\n    originY: 'center',\n    overlayX: 'start',\n    overlayY: 'center',\n    offsetX: offset,\n  });\n  positions.set('right-end', {\n    originX: 'end',\n    originY: 'bottom',\n    overlayX: 'start',\n    overlayY: 'bottom',\n    offsetX: offset,\n  });\n\n  return positions;\n}\n\n/**\n * Get positions for a specific direction, ordered by alignment preference.\n */\nfunction getPositionsForDirection(\n  direction: PopoverPosition,\n  alignment: PopoverAlignment,\n  allPositions: Map<string, ConnectedPosition>,\n): ConnectedPosition[] {\n  if (direction === 'auto') {\n    return [];\n  }\n\n  // Order alignments with preferred first\n  const alignmentOrder: Record<PopoverAlignment, PopoverAlignment[]> = {\n    start: ['start', 'center', 'end'],\n    center: ['center', 'start', 'end'],\n    end: ['end', 'center', 'start'],\n  };\n\n  return alignmentOrder[alignment]\n    .map((align) => allPositions.get(`${direction}-${align}`))\n    .filter((pos): pos is ConnectedPosition => pos !== undefined);\n}\n\n/**\n * Derive which side of the trigger the popover is on from a connection pair.\n * Used to position the arrow correctly.\n *\n * The returned side indicates where the popover sits relative to the trigger:\n * - 'bottom': popover is below trigger, arrow at top pointing up\n * - 'top': popover is above trigger, arrow at bottom pointing down\n * - 'right': popover is right of trigger, arrow at left pointing left\n * - 'left': popover is left of trigger, arrow at right pointing right\n */\nexport function deriveSideFromPosition(pair: ConnectionPositionPair): PopoverSide {\n  const originX = pair.originX as string;\n  const originY = pair.originY as string;\n  const overlayX = pair.overlayX as string;\n  const overlayY = pair.overlayY as string;\n\n  if (originY === 'bottom' && overlayY === 'top') return 'bottom';\n  if (originY === 'top' && overlayY === 'bottom') return 'top';\n  if (originX === 'end' && overlayX === 'start') return 'right';\n  if (originX === 'start' && overlayX === 'end') return 'left';\n\n  return 'bottom';\n}\n\n/**\n * Derive alignment from a connection pair.\n */\nexport function deriveAlignmentFromPosition(pair: ConnectionPositionPair): PopoverAlignment {\n  const originX = pair.originX as string;\n  const originY = pair.originY as string;\n  const overlayX = pair.overlayX as string;\n  const overlayY = pair.overlayY as string;\n\n  // For vertical positioning (above/below), check X alignment\n  if (originY === 'bottom' || originY === 'top') {\n    if (originX === 'start' && overlayX === 'start') return 'start';\n    if (originX === 'end' && overlayX === 'end') return 'end';\n    return 'center';\n  }\n\n  // For horizontal positioning (left/right), check Y alignment\n  if (originY === 'top' && overlayY === 'top') return 'start';\n  if (originY === 'bottom' && overlayY === 'bottom') return 'end';\n  return 'center';\n}\n","import {\n  booleanAttribute,\n  computed,\n  DestroyRef,\n  Directive,\n  effect,\n  ElementRef,\n  inject,\n  Injector,\n  input,\n  model,\n  output,\n  signal,\n  TemplateRef,\n  Type,\n  ViewContainerRef,\n} from '@angular/core';\nimport type {\n  InputSignal,\n  InputSignalWithTransform,\n  ModelSignal,\n  OutputEmitterRef,\n  Signal,\n  WritableSignal,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { DOCUMENT } from '@angular/common';\nimport { Overlay, OverlayRef } from '@angular/cdk/overlay';\nimport type { ConnectedOverlayPositionChange, FlexibleConnectedPositionStrategy } from '@angular/cdk/overlay';\nimport { ComponentPortal, TemplatePortal } from '@angular/cdk/portal';\nimport { FocusTrap, FocusTrapFactory } from '@angular/cdk/a11y';\nimport { filter } from 'rxjs/operators';\nimport { ComPopoverContent } from './popover-content.component';\nimport { POPOVER_DATA, POPOVER_REF } from './popover-tokens';\nimport { buildPopoverPositions, deriveAlignmentFromPosition, deriveSideFromPosition } from './popover-positions';\nimport { generatePopoverId, mergeClasses } from './popover.utils';\nimport type {\n  PopoverAlignment,\n  PopoverBackdrop,\n  PopoverPosition,\n  PopoverSide,\n  PopoverTriggerOn,\n  PopoverVariant,\n} from './popover.variants';\n\n/**\n * Popover trigger directive — manages the popover overlay lifecycle.\n * Applied to the trigger element, it handles opening, closing, positioning,\n * and accessibility for floating popover content.\n *\n * @tokens `--color-popover`, `--color-popover-foreground`, `--color-border`, `--shadow-overlay`, `--color-ring`\n *\n * @example Basic usage with template\n * ```html\n * <button comButton [comPopoverTrigger]=\"helpContent\">Help</button>\n * <ng-template #helpContent>\n *   <p>This is help content.</p>\n * </ng-template>\n * ```\n *\n * @example With positioning\n * ```html\n * <button\n *   comButton\n *   [comPopoverTrigger]=\"menuContent\"\n *   popoverPosition=\"below\"\n *   popoverAlignment=\"start\"\n *   [popoverShowArrow]=\"false\"\n * >\n *   Menu\n * </button>\n * ```\n *\n * @example With component content\n * ```html\n * <button\n *   comButton\n *   [comPopoverTrigger]=\"UserProfilePopover\"\n *   [popoverData]=\"{ userId: user.id }\"\n * >\n *   Profile\n * </button>\n * ```\n *\n * @example Manual control\n * ```html\n * <button\n *   comButton\n *   [comPopoverTrigger]=\"content\"\n *   popoverTriggerOn=\"manual\"\n *   [(popoverOpen)]=\"isOpen\"\n * >\n *   Controlled\n * </button>\n * ```\n */\n@Directive({\n  selector: '[comPopoverTrigger]',\n  exportAs: 'comPopoverTrigger',\n  host: {\n    '[attr.aria-haspopup]': '\"dialog\"',\n    '[attr.aria-expanded]': 'popoverOpen()',\n    '[attr.aria-controls]': 'ariaControls()',\n    '(click)': 'onTriggerClick($event)',\n    '(focus)': 'onTriggerFocus()',\n    '(blur)': 'onTriggerBlur()',\n    '(keydown.escape)': 'onEscapeKey($event)',\n  },\n})\nexport class ComPopoverTrigger {\n  private readonly overlay = inject(Overlay);\n  private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n  private readonly viewContainerRef = inject(ViewContainerRef);\n  private readonly injector = inject(Injector);\n  private readonly destroyRef = inject(DestroyRef);\n  private readonly focusTrapFactory = inject(FocusTrapFactory);\n  private readonly document = inject(DOCUMENT);\n\n  private overlayRef: OverlayRef | null = null;\n  private focusTrap: FocusTrap | null = null;\n  private scrollCleanup: (() => void) | null = null;\n  private closeTimeoutId: ReturnType<typeof setTimeout> | null = null;\n  private destroyed = false;\n  private readonly popoverId: string = generatePopoverId();\n\n  // ─── Inputs ───\n\n  /** Content to render: TemplateRef or Component class. */\n  readonly comPopoverTrigger: InputSignal<TemplateRef<unknown> | Type<unknown>> = input.required();\n\n  /** Preferred position direction. */\n  readonly popoverPosition: InputSignal<PopoverPosition> = input<PopoverPosition>('auto');\n\n  /** Alignment along the cross-axis. */\n  readonly popoverAlignment: InputSignal<PopoverAlignment> = input<PopoverAlignment>('center');\n\n  /** What interaction opens the popover. */\n  readonly popoverTriggerOn: InputSignal<PopoverTriggerOn> = input<PopoverTriggerOn>('click');\n\n  /** Gap in px between trigger and popover edge. */\n  readonly popoverOffset: InputSignal<number> = input(8);\n\n  /** Whether to render the connecting arrow. */\n  readonly popoverShowArrow: InputSignalWithTransform<boolean, unknown> = input(true, {\n    transform: booleanAttribute,\n  });\n\n  /** Size/padding preset for the content panel. */\n  readonly popoverVariant: InputSignal<PopoverVariant> = input<PopoverVariant>('default');\n\n  /** Backdrop behavior. */\n  readonly popoverBackdrop: InputSignal<PopoverBackdrop> = input<PopoverBackdrop>('transparent');\n\n  /** Close when clicking outside the popover. */\n  readonly popoverCloseOnOutside: InputSignalWithTransform<boolean, unknown> = input(true, {\n    transform: booleanAttribute,\n  });\n\n  /** Close on Escape key. */\n  readonly popoverCloseOnEscape: InputSignalWithTransform<boolean, unknown> = input(true, {\n    transform: booleanAttribute,\n  });\n\n  /** Close when ancestor scrollable container scrolls. */\n  readonly popoverCloseOnScroll: InputSignalWithTransform<boolean, unknown> = input(false, {\n    transform: booleanAttribute,\n  });\n\n  /** Prevents opening when true. */\n  readonly popoverDisabled: InputSignalWithTransform<boolean, unknown> = input(false, {\n    transform: booleanAttribute,\n  });\n\n  /** Two-way bindable open state. */\n  readonly popoverOpen: ModelSignal<boolean> = model(false);\n\n  /** Arbitrary data passed to the content component/template. */\n  readonly popoverData: InputSignal<unknown> = input<unknown>(undefined);\n\n  /** Custom CSS class(es) on the overlay panel. */\n  readonly popoverPanelClass: InputSignal<string | string[]> = input<string | string[]>('');\n\n  /** Trap focus inside popover. */\n  readonly popoverTrapFocus: InputSignalWithTransform<boolean, unknown> = input(false, {\n    transform: booleanAttribute,\n  });\n\n  /** Optional accessibility label for the popover dialog. */\n  readonly popoverAriaLabel: InputSignal<string | undefined> = input<string | undefined>(undefined);\n\n  // ─── Outputs ───\n\n  /** Emitted after popup opens and is visible. */\n  readonly popoverOpened: OutputEmitterRef<void> = output<void>();\n\n  /** Emitted after popup closes and is detached. */\n  readonly popoverClosed: OutputEmitterRef<void> = output<void>();\n\n  // ─── Internal State ───\n\n  private readonly activeSide: WritableSignal<PopoverSide> = signal<PopoverSide>('top');\n  private readonly activeAlignment: WritableSignal<PopoverAlignment> = signal<PopoverAlignment>('center');\n  private readonly animationState: WritableSignal<'open' | 'closed'> = signal<'open' | 'closed'>('open');\n  private contentComponentRef: ComPopoverContent | null = null;\n\n  // ─── Computed ───\n\n  private readonly hasBackdrop: Signal<boolean> = computed(() => this.popoverBackdrop() !== 'none');\n\n  private readonly backdropClass: Signal<string> = computed(() =>\n    this.popoverBackdrop() === 'dimmed' ? 'cdk-overlay-dark-backdrop' : 'cdk-overlay-transparent-backdrop',\n  );\n\n  protected readonly ariaControls: Signal<string | null> = computed(() =>\n    this.popoverOpen() ? this.popoverId : null,\n  );\n\n  private readonly panelClassArray: Signal<string[]> = computed(() => {\n    const panelClass = this.popoverPanelClass();\n    if (Array.isArray(panelClass)) return panelClass;\n    return panelClass ? [panelClass] : [];\n  });\n\n  constructor() {\n    // React to external open state changes\n    effect(() => {\n      const isOpen = this.popoverOpen();\n      if (isOpen && !this.overlayRef?.hasAttached()) {\n        this.openPopover();\n      } else if (!isOpen && this.overlayRef?.hasAttached()) {\n        this.closePopover();\n      }\n    });\n\n    // Cleanup on destroy\n    this.destroyRef.onDestroy(() => {\n      this.destroyed = true;\n      this.cancelPendingClose();\n      this.disposeOverlay();\n    });\n  }\n\n  // ─── Public API ───\n\n  /** Programmatically open the popover. */\n  open(): void {\n    if (!this.popoverDisabled() && !this.overlayRef?.hasAttached()) {\n      this.popoverOpen.set(true);\n    }\n  }\n\n  /** Programmatically close the popover. */\n  close(): void {\n    if (this.overlayRef?.hasAttached()) {\n      this.popoverOpen.set(false);\n    }\n  }\n\n  /** Toggle the popover open/close state. */\n  toggle(): void {\n    if (this.popoverOpen()) {\n      this.close();\n    } else {\n      this.open();\n    }\n  }\n\n  /** Force recalculation of position. */\n  reposition(): void {\n    this.overlayRef?.updatePosition();\n  }\n\n  // ─── Event Handlers ───\n\n  protected onTriggerClick(event: MouseEvent): void {\n    if (this.popoverTriggerOn() === 'click') {\n      event.preventDefault();\n      this.toggle();\n    }\n  }\n\n  protected onTriggerFocus(): void {\n    if (this.popoverTriggerOn() === 'focus') {\n      this.open();\n    }\n  }\n\n  protected onTriggerBlur(): void {\n    if (this.popoverTriggerOn() === 'focus') {\n      // Delay to allow focus to move to popover content\n      setTimeout(() => {\n        if (this.destroyed) return;\n        if (!this.overlayRef?.overlayElement.contains(this.document.activeElement)) {\n          this.close();\n        }\n      }, 0);\n    }\n  }\n\n  protected onEscapeKey(event: Event): void {\n    if (this.popoverCloseOnEscape() && this.popoverOpen()) {\n      event.preventDefault();\n      event.stopPropagation();\n      this.close();\n      this.elementRef.nativeElement.focus();\n    }\n  }\n\n  // ─── Private Methods ───\n\n  private openPopover(): void {\n    if (this.popoverDisabled()) return;\n\n    this.createOverlay();\n    this.attachContent();\n    this.subscribeToCloseEvents();\n    this.subscribeToScrollEvents();\n    this.setupFocusTrap();\n\n    this.animationState.set('open');\n    this.popoverOpened.emit();\n  }\n\n  private closePopover(): void {\n    this.animationState.set('closed');\n    this.unsubscribeFromScrollEvents();\n    this.cancelPendingClose();\n\n    // Wait for animation to complete before detaching\n    this.closeTimeoutId = setTimeout(() => {\n      this.closeTimeoutId = null;\n      if (this.destroyed) return;\n      this.detachContent();\n      this.destroyFocusTrap();\n      this.popoverClosed.emit();\n    }, 100); // Match animation duration\n  }\n\n  private cancelPendingClose(): void {\n    if (this.closeTimeoutId !== null) {\n      clearTimeout(this.closeTimeoutId);\n      this.closeTimeoutId = null;\n    }\n  }\n\n  private subscribeToScrollEvents(): void {\n    if (this.popoverCloseOnScroll()) return;\n\n    const scrollHandler = (): void => this.overlayRef?.updatePosition();\n    this.document.addEventListener('scroll', scrollHandler, true);\n    this.scrollCleanup = () => this.document.removeEventListener('scroll', scrollHandler, true);\n  }\n\n  private unsubscribeFromScrollEvents(): void {\n    this.scrollCleanup?.();\n    this.scrollCleanup = null;\n  }\n\n  private createOverlay(): void {\n    if (this.overlayRef) return;\n\n    const positionStrategy = this.overlay\n      .position()\n      .flexibleConnectedTo(this.elementRef)\n      .withPositions(buildPopoverPositions(this.popoverPosition(), this.popoverAlignment(), this.popoverOffset()))\n      .withFlexibleDimensions(false)\n      .withPush(true)\n      .withViewportMargin(8);\n\n    this.overlayRef = this.overlay.create({\n      positionStrategy,\n      scrollStrategy: this.popoverCloseOnScroll()\n        ? this.overlay.scrollStrategies.close()\n        : this.overlay.scrollStrategies.reposition(),\n      hasBackdrop: this.hasBackdrop(),\n      backdropClass: this.backdropClass(),\n      panelClass: ['com-popover-panel', ...this.panelClassArray()],\n    });\n\n    // Track position changes for arrow placement\n    (positionStrategy as FlexibleConnectedPositionStrategy).positionChanges\n      .pipe(takeUntilDestroyed(this.destroyRef))\n      .subscribe((change: ConnectedOverlayPositionChange) => {\n        this.activeSide.set(deriveSideFromPosition(change.connectionPair));\n        this.activeAlignment.set(deriveAlignmentFromPosition(change.connectionPair));\n        this.updateContentComponentInputs();\n      });\n  }\n\n  private attachContent(): void {\n    if (!this.overlayRef) return;\n\n    const content = this.comPopoverTrigger();\n\n    // Create the content wrapper component\n    const contentInjector = Injector.create({\n      parent: this.injector,\n      providers: [\n        { provide: POPOVER_DATA, useValue: this.popoverData() },\n        { provide: POPOVER_REF, useValue: this },\n      ],\n    });\n\n    const contentPortal = new ComponentPortal(ComPopoverContent, this.viewContainerRef, contentInjector);\n    const contentRef = this.overlayRef.attach(contentPortal);\n    this.contentComponentRef = contentRef.instance;\n\n    // Create the inner content portal (template or component)\n    let innerPortal: TemplatePortal<unknown> | ComponentPortal<unknown>;\n\n    if (content instanceof TemplateRef) {\n      innerPortal = new TemplatePortal(content, this.viewContainerRef, {\n        $implicit: this.popoverData(),\n        close: () => this.close(),\n      });\n    } else {\n      const componentInjector = Injector.create({\n        parent: this.injector,\n        providers: [\n          { provide: POPOVER_DATA, useValue: this.popoverData() },\n          { provide: POPOVER_REF, useValue: this },\n        ],\n      });\n      innerPortal = new ComponentPortal(content, this.viewContainerRef, componentInjector);\n    }\n\n    // Set content component inputs\n    this.updateContentComponentInputs(innerPortal);\n  }\n\n  private updateContentComponentInputs(innerPortal?: TemplatePortal<unknown> | ComponentPortal<unknown>): void {\n    const ref = this.contentComponentRef;\n    if (!ref) return;\n\n    if (innerPortal) {\n      ref.contentPortal.set(innerPortal);\n    }\n    ref.variant.set(this.popoverVariant());\n    ref.showArrow.set(this.popoverShowArrow());\n    ref.activeSide.set(this.activeSide());\n    ref.activeAlignment.set(this.activeAlignment());\n    ref.popoverId.set(this.popoverId);\n    ref.ariaLabel.set(this.popoverAriaLabel());\n    ref.animationState.set(this.animationState());\n    ref.panelClass.set(mergeClasses(...this.panelClassArray()));\n  }\n\n  private detachContent(): void {\n    if (this.overlayRef?.hasAttached()) {\n      this.overlayRef.detach();\n    }\n    this.contentComponentRef = null;\n  }\n\n  private subscribeToCloseEvents(): void {\n    if (!this.overlayRef) return;\n\n    // Close on backdrop click\n    if (this.popoverCloseOnOutside()) {\n      this.overlayRef\n        .backdropClick()\n        .pipe(takeUntilDestroyed(this.destroyRef))\n        .subscribe(() => this.close());\n    }\n\n    // Close on escape key (handled by overlay)\n    if (this.popoverCloseOnEscape()) {\n      this.overlayRef\n        .keydownEvents()\n        .pipe(\n          filter((event) => event.key === 'Escape'),\n          takeUntilDestroyed(this.destroyRef),\n        )\n        .subscribe((event) => {\n          event.preventDefault();\n          this.close();\n          this.elementRef.nativeElement.focus();\n        });\n    }\n\n    // Handle detachment\n    this.overlayRef\n      .detachments()\n      .pipe(takeUntilDestroyed(this.destroyRef))\n      .subscribe(() => {\n        if (this.destroyed) return;\n        this.popoverOpen.set(false);\n      });\n  }\n\n  private setupFocusTrap(): void {\n    if (this.popoverTrapFocus() && this.overlayRef) {\n      this.focusTrap = this.focusTrapFactory.create(this.overlayRef.overlayElement);\n      this.focusTrap.focusInitialElementWhenReady();\n    }\n  }\n\n  private destroyFocusTrap(): void {\n    if (this.focusTrap) {\n      this.focusTrap.destroy();\n      this.focusTrap = null;\n    }\n  }\n\n  private disposeOverlay(): void {\n    this.destroyFocusTrap();\n    if (this.overlayRef) {\n      this.overlayRef.dispose();\n      this.overlayRef = null;\n    }\n    this.contentComponentRef = null;\n  }\n}\n","import { Directive, inject, input } from '@angular/core';\nimport type { InputSignal } from '@angular/core';\nimport { POPOVER_REF, type PopoverRef } from './popover-tokens';\n\n/**\n * Convenience directive that closes the parent popover when clicked.\n * Applied to elements inside the popover that should dismiss it.\n *\n * @tokens none\n *\n * @example\n * ```html\n * <ng-template #confirmPop>\n *   <div class=\"space-y-3\">\n *     <p>Are you sure?</p>\n *     <div class=\"flex gap-2\">\n *       <button comButton variant=\"ghost\" comPopoverClose>Cancel</button>\n *       <button comButton (click)=\"confirm()\" comPopoverClose>Confirm</button>\n *     </div>\n *   </div>\n * </ng-template>\n * ```\n *\n * @example With a result value\n * ```html\n * <button [comPopoverClose]=\"'confirmed'\" (click)=\"onConfirm()\">Yes</button>\n * <button [comPopoverClose]=\"'cancelled'\">No</button>\n * ```\n */\n@Directive({\n  selector: '[comPopoverClose]',\n  exportAs: 'comPopoverClose',\n  host: {\n    '(click)': 'closePopover()',\n    '[attr.type]': '\"button\"',\n  },\n})\nexport class ComPopoverClose {\n  private readonly popoverRef: PopoverRef | null = inject(POPOVER_REF, { optional: true });\n\n  /**\n   * Optional result value to pass when closing.\n   * This value is emitted via the trigger's close event.\n   */\n  readonly comPopoverClose: InputSignal<unknown> = input<unknown>(undefined);\n\n  protected closePopover(): void {\n    this.popoverRef?.close();\n  }\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\n/**\n * Marker directive for lazy popover content templates.\n * Applied to `<ng-template>` to indicate content that should be\n * lazily instantiated when the popover opens.\n *\n * This directive is primarily semantic — it marks the template as popover content\n * and provides access to the TemplateRef for potential content queries.\n *\n * @tokens none\n *\n * @example\n * ```html\n * <button [comPopoverTrigger]=\"helpContent\">Help</button>\n * <ng-template comPopoverTemplate #helpContent>\n *   <p>This is help content.</p>\n * </ng-template>\n * ```\n *\n * Note: You can also pass a template reference directly without this directive:\n * ```html\n * <button [comPopoverTrigger]=\"helpContent\">Help</button>\n * <ng-template #helpContent>\n *   <p>This also works.</p>\n * </ng-template>\n * ```\n */\n@Directive({\n  selector: '[comPopoverTemplate]',\n  exportAs: 'comPopoverTemplate',\n})\nexport class ComPopoverTemplate {\n  /** Reference to the template for rendering. */\n  readonly templateRef: TemplateRef<unknown> = inject(TemplateRef);\n}\n","// Public API for the popover component\n\n// Main directive\nexport { ComPopoverTrigger } from './popover-trigger.directive';\n\n// Supporting directives\nexport { ComPopoverClose } from './popover-close.directive';\nexport { ComPopoverTemplate } from './popover-template.directive';\n\n// Injection tokens and types\nexport { POPOVER_DATA, POPOVER_REF, type PopoverRef } from './popover-tokens';\n\n// Position utilities\nexport { buildPopoverPositions, deriveSideFromPosition, deriveAlignmentFromPosition } from './popover-positions';\n\n// Variants and types\nexport {\n  popoverArrowVariants,\n  popoverPanelVariants,\n  type PopoverAlignment,\n  type PopoverArrowVariants,\n  type PopoverBackdrop,\n  type PopoverPanelVariants,\n  type PopoverPosition,\n  type PopoverSide,\n  type PopoverTriggerOn,\n  type PopoverVariant,\n} from './popover.variants';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAWA;AAEA;;;;AAIG;AACI,MAAM,oBAAoB,GAE7B,GAAG,CACL,CAAC,UAAU,EAAE,oCAAoC,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,iBAAiB,CAAC,EAC/G;AACE,IAAA,QAAQ,EAAE;AACR,QAAA,OAAO,EAAE;AACP,YAAA,OAAO,EAAE,uCAAuC;AAChD,YAAA,OAAO,EAAE,uCAAuC;AAChD,YAAA,IAAI,EAAE,uCAAuC;AAC7C,YAAA,KAAK,EAAE,qBAAqB;AAC7B,SAAA;AACF,KAAA;AACD,IAAA,eAAe,EAAE;AACf,QAAA,OAAO,EAAE,SAAS;AACnB,KAAA;AACF,CAAA;AAKH;AAEA;;;;;AAKG;AACI,MAAM,oBAAoB,GAE7B,GAAG,CAAC,4BAA4B,EAAE;AACpC,IAAA,QAAQ,EAAE;AACR,QAAA,IAAI,EAAE;AACJ,YAAA,GAAG,EAAE,+DAA+D;AACpE,YAAA,MAAM,EAAE,sDAAsD;AAC9D,YAAA,IAAI,EAAE,+DAA+D;AACrE,YAAA,KAAK,EAAE,gEAAgE;AACxE,SAAA;AACF,KAAA;AACD,IAAA,eAAe,EAAE;AACf,QAAA,IAAI,EAAE,QAAQ;AACf,KAAA;AACF,CAAA;;AC3DD,IAAI,gBAAgB,GAAG,CAAC;AAExB;;AAEG;SACa,iBAAiB,GAAA;AAC/B,IAAA,OAAO,CAAA,QAAA,EAAW,EAAE,gBAAgB,CAAA,CAAE;AACxC;;ACHA;AACA,MAAM,iBAAiB,GAA0D;AAC/E,IAAA,GAAG,EAAE,EAAE,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