{"version":3,"file":"ngwr-color-picker.mjs","sources":["../../../projects/lib/color-picker/color/rgb-to-hsv.ts","../../../projects/lib/color-picker/color/hsv-to-rgb.ts","../../../projects/lib/color-picker/color/rgb-to-hsl.ts","../../../projects/lib/color-picker/color/hsl-to-rgb.ts","../../../projects/lib/color-picker/color/parse-hex.ts","../../../projects/lib/color-picker/color/to-hex.ts","../../../projects/lib/color-picker/color-picker.ts","../../../projects/lib/color-picker/color-picker.html","../../../projects/lib/color-picker/color-picker-trigger.ts","../../../projects/lib/color-picker/ngwr-color-picker.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { WrHsv } from './wr-hsv';\nimport type { WrRgb } from './wr-rgb';\n\n/**\n * Convert sRGB to HSV. Preserves alpha.\n */\nexport function rgbToHsv(rgb: WrRgb): WrHsv {\n  const r = rgb.r / 255;\n  const g = rgb.g / 255;\n  const b = rgb.b / 255;\n  const max = Math.max(r, g, b);\n  const min = Math.min(r, g, b);\n  const d = max - min;\n\n  let h = 0;\n  if (d !== 0) {\n    if (max === r) h = ((g - b) / d) % 6;\n    else if (max === g) h = (b - r) / d + 2;\n    else h = (r - g) / d + 4;\n    h *= 60;\n    if (h < 0) h += 360;\n  }\n\n  const s = max === 0 ? 0 : d / max;\n  const v = max;\n\n  return { h, s, v, a: rgb.a };\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { WrHsv } from './wr-hsv';\nimport type { WrRgb } from './wr-rgb';\n\n/**\n * Convert HSV to sRGB. Preserves alpha. Returns integer channels in `[0, 255]`.\n */\nexport function hsvToRgb(hsv: WrHsv): WrRgb {\n  const { h, s, v } = hsv;\n  const c = v * s;\n  const x = c * (1 - Math.abs(((h / 60) % 2) - 1));\n  const m = v - c;\n\n  let r = 0;\n  let g = 0;\n  let b = 0;\n\n  if (h < 60) {\n    r = c;\n    g = x;\n  } else if (h < 120) {\n    r = x;\n    g = c;\n  } else if (h < 180) {\n    g = c;\n    b = x;\n  } else if (h < 240) {\n    g = x;\n    b = c;\n  } else if (h < 300) {\n    r = x;\n    b = c;\n  } else {\n    r = c;\n    b = x;\n  }\n\n  return {\n    r: Math.round((r + m) * 255),\n    g: Math.round((g + m) * 255),\n    b: Math.round((b + m) * 255),\n    a: hsv.a,\n  };\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { WrHsl } from './wr-hsl';\nimport type { WrRgb } from './wr-rgb';\n\n/**\n * Convert sRGB to HSL. Preserves alpha.\n */\nexport function rgbToHsl(rgb: WrRgb): WrHsl {\n  const r = rgb.r / 255;\n  const g = rgb.g / 255;\n  const b = rgb.b / 255;\n  const max = Math.max(r, g, b);\n  const min = Math.min(r, g, b);\n  const d = max - min;\n  const l = (max + min) / 2;\n\n  let h = 0;\n  let s = 0;\n\n  if (d !== 0) {\n    s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n\n    if (max === r) h = (g - b) / d + (g < b ? 6 : 0);\n    else if (max === g) h = (b - r) / d + 2;\n    else h = (r - g) / d + 4;\n\n    h *= 60;\n  }\n\n  return { h, s, l, a: rgb.a };\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { WrHsl } from './wr-hsl';\nimport type { WrRgb } from './wr-rgb';\n\nfunction hueToChannel(p: number, q: number, t: number): number {\n  let x = t;\n  if (x < 0) x += 1;\n  if (x > 1) x -= 1;\n  if (x < 1 / 6) return p + (q - p) * 6 * x;\n  if (x < 1 / 2) return q;\n  if (x < 2 / 3) return p + (q - p) * (2 / 3 - x) * 6;\n  return p;\n}\n\n/**\n * Convert HSL to sRGB. Preserves alpha. Returns integer channels in `[0, 255]`.\n */\nexport function hslToRgb(hsl: WrHsl): WrRgb {\n  const h = hsl.h / 360;\n  const { s, l } = hsl;\n\n  let r: number;\n  let g: number;\n  let b: number;\n\n  if (s === 0) {\n    r = l;\n    g = l;\n    b = l;\n  } else {\n    const q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n    const p = 2 * l - q;\n    r = hueToChannel(p, q, h + 1 / 3);\n    g = hueToChannel(p, q, h);\n    b = hueToChannel(p, q, h - 1 / 3);\n  }\n\n  return {\n    r: Math.round(r * 255),\n    g: Math.round(g * 255),\n    b: Math.round(b * 255),\n    a: hsl.a,\n  };\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { WrRgb } from './wr-rgb';\n\n/**\n * Parse a CSS hex colour into {@link WrRgb}. Accepts 3, 4, 6, or 8 digit\n * forms with or without a leading `#`. Returns `null` for anything that\n * isn't a valid hex string.\n *\n * @example\n * ```ts\n * parseHex('#f00');       // { r: 255, g: 0, b: 0, a: 1 }\n * parseHex('3969e2');     // { r: 57,  g: 105, b: 226, a: 1 }\n * parseHex('#3969e2ff');  // { r: 57,  g: 105, b: 226, a: 1 }\n * parseHex('nope');       // null\n * ```\n */\nexport function parseHex(input: string): WrRgb | null {\n  if (typeof input !== 'string') return null;\n\n  let str = input.trim().replace(/^#/, '').toLowerCase();\n\n  // Expand shorthand: rgb → rrggbb, rgba → rrggbbaa\n  if (str.length === 3 || str.length === 4) {\n    str = str\n      .split('')\n      .map(c => c + c)\n      .join('');\n  }\n\n  if (str.length !== 6 && str.length !== 8) return null;\n  if (!/^[0-9a-f]+$/.test(str)) return null;\n\n  const r = parseInt(str.slice(0, 2), 16);\n  const g = parseInt(str.slice(2, 4), 16);\n  const b = parseInt(str.slice(4, 6), 16);\n  const a = str.length === 8 ? parseInt(str.slice(6, 8), 16) / 255 : 1;\n\n  return { r, g, b, a };\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { WrRgb } from './wr-rgb';\n\nfunction channelToHex(n: number): string {\n  const clamped = Math.max(0, Math.min(255, Math.round(n)));\n  return clamped.toString(16).padStart(2, '0');\n}\n\n/**\n * Format a {@link WrRgb} as a CSS hex string with a leading `#`. When\n * `withAlpha` is `true` the result is 8 digits (`#rrggbbaa`); otherwise\n * 6 digits.\n *\n * @example\n * ```ts\n * toHex({ r: 57, g: 105, b: 226, a: 1 });         // '#3969e2'\n * toHex({ r: 57, g: 105, b: 226, a: 0.5 }, true); // '#3969e280'\n * ```\n */\nexport function toHex(rgb: WrRgb, withAlpha = false): string {\n  const r = channelToHex(rgb.r);\n  const g = channelToHex(rgb.g);\n  const b = channelToHex(rgb.b);\n  if (withAlpha) {\n    const a = channelToHex(rgb.a * 255);\n    return `#${r}${g}${b}${a}`;\n  }\n  return `#${r}${g}${b}`;\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { DecimalPipe } from '@angular/common';\nimport { Component, ViewEncapsulation, computed, forwardRef, input, signal } from '@angular/core';\nimport { type ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\n\nimport { WrSegmented, type WrSegmentedOption } from 'ngwr/segmented';\nimport { clamp, noop } from 'ngwr/utils';\n\nimport { hslToRgb, hsvToRgb, parseHex, rgbToHsl, rgbToHsv, toHex, type WrHsl, type WrRgb } from './color';\nimport type { WrColorFormat } from './interfaces';\n\ntype Tab = 'hex' | 'rgb' | 'hsl';\n\ntype Edges = 'sv' | 'hue' | 'alpha';\n\n/**\n * Inline colour picker — HSV canvas, hue slider, optional alpha slider, HEX\n * input. Implements `ControlValueAccessor`, so it binds with `[(ngModel)]`,\n * `[formControl]`, or `formControlName`. Output is always a string in the\n * format chosen via `[format]`.\n *\n * @example\n * ```html\n * <wr-color-picker [(ngModel)]=\"brandColor\" />\n * <wr-color-picker [(ngModel)]=\"brandColor\" [alpha]=\"false\" />\n * ```\n *\n * @see https://ngwr.dev/components/color-picker\n */\n@Component({\n  selector: 'wr-color-picker',\n  templateUrl: './color-picker.html',\n  encapsulation: ViewEncapsulation.None,\n  host: {\n    '[class]': 'classes()',\n    '[style.--wr-color-picker-hue]': 'hueCss()',\n    '[style.--wr-color-picker-rgb]': 'rgbCss()',\n  },\n  imports: [DecimalPipe, WrSegmented],\n  providers: [\n    {\n      provide: NG_VALUE_ACCESSOR,\n      // eslint-disable-next-line @angular-eslint/no-forward-ref\n      useExisting: forwardRef(() => WrColorPicker),\n      multi: true,\n    },\n  ],\n})\nexport class WrColorPicker implements ControlValueAccessor {\n  /** Render the alpha slider and emit 8-digit hex / `rgba()`. @default true */\n  readonly alpha = input(true, { transform: coerceBooleanProperty });\n\n  /** Disable interaction. @default false */\n  readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n  /** Output format produced through the CVA. @default 'hex' */\n  readonly format = input<WrColorFormat>('hex');\n\n  /** Preset hex colours rendered as a clickable row beneath the inputs. Empty = no row. @default [] */\n  readonly swatches = input<readonly string[]>([]);\n\n  // Source of truth: HSV + alpha\n\n  protected readonly h = signal(0);\n  protected readonly s = signal(0);\n  protected readonly v = signal(0);\n  protected readonly a = signal(1);\n\n  private readonly disabledFromCva = signal(false);\n\n  protected readonly effectiveDisabled = computed(() => this.disabled() || this.disabledFromCva());\n\n  // Derived values\n\n  /** RGB view of the current colour, computed lazily. */\n  protected readonly rgb = computed<WrRgb>(() => hsvToRgb({ h: this.h(), s: this.s(), v: this.v(), a: this.a() }));\n\n  /** Canonical hex (used by the input field and by drag emits). */\n  protected readonly hex = computed(() => toHex(this.rgb(), this.alpha()));\n\n  /** SV canvas background colour (full-saturation hue). */\n  protected readonly hueCss = computed(() => `hsl(${this.h()}, 100%, 50%)`);\n\n  /** RGB string used for the alpha-slider gradient. */\n  protected readonly rgbCss = computed(() => {\n    const { r, g, b } = this.rgb();\n    return `${r}, ${g}, ${b}`;\n  });\n\n  /** Thumb positions in % for each surface. */\n  protected readonly svThumbX = computed(() => this.s() * 100);\n  protected readonly svThumbY = computed(() => (1 - this.v()) * 100);\n  protected readonly hueThumbX = computed(() => (this.h() / 360) * 100);\n  protected readonly alphaThumbX = computed(() => this.a() * 100);\n\n  /** Mirror of the canonical hex, edited by the user via the input field. */\n  protected readonly hexInput = signal('');\n\n  /** Active tab in the input switcher. */\n  protected readonly activeTab = signal<Tab>('hex');\n\n  /** HSL view of the current colour, computed lazily. */\n  protected readonly hslView = computed<WrHsl>(() => rgbToHsl(this.rgb()));\n\n  /** Alpha as integer percent for display in numeric tabs. */\n  protected readonly alphaPercent = computed(() => Math.round(this.a() * 100));\n\n  protected readonly tabOptions: readonly WrSegmentedOption<Tab>[] = [\n    { value: 'hex', label: 'HEX' },\n    { value: 'rgb', label: 'RGB' },\n    { value: 'hsl', label: 'HSL' },\n  ];\n\n  protected readonly classes = computed(() => {\n    const parts = ['wr-color-picker'];\n    if (this.alpha()) parts.push('wr-color-picker--alpha');\n    if (this.effectiveDisabled()) parts.push('wr-color-picker--disabled');\n    return parts.join(' ');\n  });\n\n  // ControlValueAccessor\n\n  private onChange: (value: string) => void = noop;\n  private onTouched: () => void = noop;\n\n  writeValue(value: string | null): void {\n    const rgb = parseHex(value ?? '') ?? { r: 0, g: 0, b: 0, a: 1 };\n    const hsv = rgbToHsv(rgb);\n    this.h.set(hsv.h);\n    this.s.set(hsv.s);\n    this.v.set(hsv.v);\n    this.a.set(hsv.a);\n    this.hexInput.set(this.hex());\n  }\n\n  registerOnChange(fn: (value: string) => void): void {\n    this.onChange = fn;\n  }\n\n  registerOnTouched(fn: () => void): void {\n    this.onTouched = fn;\n  }\n\n  setDisabledState(isDisabled: boolean): void {\n    this.disabledFromCva.set(coerceBooleanProperty(isDisabled));\n  }\n\n  // Drag handlers\n\n  protected onPointerDown(event: PointerEvent, surface: Edges): void {\n    if (this.effectiveDisabled()) return;\n    event.preventDefault();\n    const target = event.currentTarget as HTMLElement;\n    target.setPointerCapture(event.pointerId);\n\n    const update = (e: PointerEvent): void => this.updateFromEvent(e, target, surface);\n    const cleanup = (e: PointerEvent): void => {\n      target.releasePointerCapture(e.pointerId);\n      target.removeEventListener('pointermove', update);\n      target.removeEventListener('pointerup', cleanup);\n      this.onTouched();\n    };\n\n    target.addEventListener('pointermove', update);\n    target.addEventListener('pointerup', cleanup);\n    this.updateFromEvent(event, target, surface);\n  }\n\n  private updateFromEvent(event: PointerEvent, target: HTMLElement, surface: Edges): void {\n    const rect = target.getBoundingClientRect();\n    const x = clamp((event.clientX - rect.left) / rect.width, 0, 1);\n\n    if (surface === 'sv') {\n      const y = clamp((event.clientY - rect.top) / rect.height, 0, 1);\n      this.s.set(x);\n      this.v.set(1 - y);\n    } else if (surface === 'hue') {\n      this.h.set(x * 360);\n    } else {\n      this.a.set(x);\n    }\n    this.emit();\n  }\n\n  // Hex input handlers\n\n  protected onHexInput(event: Event): void {\n    const raw = (event.target as HTMLInputElement).value;\n    this.hexInput.set(raw);\n    const rgb = parseHex(raw);\n    if (!rgb) return;\n    const hsv = rgbToHsv(rgb);\n    this.h.set(hsv.h);\n    this.s.set(hsv.s);\n    this.v.set(hsv.v);\n    this.a.set(hsv.a);\n    this.emitWithoutHexSync();\n  }\n\n  protected onHexBlur(): void {\n    // Re-sync the input with the canonical value (in case the user typed invalid).\n    this.hexInput.set(this.hex());\n    this.onTouched();\n  }\n\n  // Emission\n\n  private emit(): void {\n    this.emitWithoutHexSync();\n    this.hexInput.set(this.hex());\n  }\n\n  private emitWithoutHexSync(): void {\n    this.onChange(this.hex());\n  }\n\n  // Tab + channel handlers\n\n  protected onTabChange(tab: Tab | null): void {\n    if (tab) this.activeTab.set(tab);\n  }\n\n  protected onRgbChannel(channel: 'r' | 'g' | 'b', event: Event): void {\n    const n = clamp(Number((event.target as HTMLInputElement).value), 0, 255);\n    if (Number.isNaN(n)) return;\n    const current = this.rgb();\n    const next: WrRgb = { ...current, [channel]: n };\n    this.applyRgb(next);\n  }\n\n  protected onHslChannel(channel: 'h' | 's' | 'l', event: Event): void {\n    const n = Number((event.target as HTMLInputElement).value);\n    if (Number.isNaN(n)) return;\n    const current = this.hslView();\n    const next: WrHsl =\n      channel === 'h' ? { ...current, h: clamp(n, 0, 360) } : { ...current, [channel]: clamp(n, 0, 100) / 100 };\n    this.applyRgb(hslToRgb(next));\n  }\n\n  protected onAlphaPercent(event: Event): void {\n    const n = clamp(Number((event.target as HTMLInputElement).value), 0, 100);\n    if (Number.isNaN(n)) return;\n    this.a.set(n / 100);\n    this.emit();\n  }\n\n  protected onSwatchClick(hex: string): void {\n    if (this.effectiveDisabled()) return;\n    const rgb = parseHex(hex);\n    if (!rgb) return;\n    this.applyRgb(rgb);\n  }\n\n  /** Push an RGB triple into the HSV source of truth (preserving the current alpha if the swap removes it). */\n  private applyRgb(rgb: WrRgb): void {\n    const hsv = rgbToHsv(rgb);\n    this.h.set(hsv.h);\n    this.s.set(hsv.s);\n    this.v.set(hsv.v);\n    this.a.set(hsv.a);\n    this.emit();\n  }\n}\n","<div class=\"wr-color-picker__sv\" (pointerdown)=\"onPointerDown($event, 'sv')\">\n  <span class=\"wr-color-picker__thumb\" [style.left.%]=\"svThumbX()\" [style.top.%]=\"svThumbY()\"></span>\n</div>\n\n<div class=\"wr-color-picker__slider wr-color-picker__slider--hue\" (pointerdown)=\"onPointerDown($event, 'hue')\">\n  <span class=\"wr-color-picker__thumb wr-color-picker__thumb--slider\" [style.left.%]=\"hueThumbX()\"></span>\n</div>\n\n@if (alpha()) {\n  <div class=\"wr-color-picker__slider wr-color-picker__slider--alpha\" (pointerdown)=\"onPointerDown($event, 'alpha')\">\n    <span class=\"wr-color-picker__thumb wr-color-picker__thumb--slider\" [style.left.%]=\"alphaThumbX()\"></span>\n  </div>\n}\n\n<div class=\"wr-color-picker__chrome\">\n  <span class=\"wr-color-picker__preview\" [style.background]=\"hex()\"></span>\n  <wr-segmented\n    class=\"wr-color-picker__tabs\"\n    [options]=\"tabOptions\"\n    [value]=\"activeTab()\"\n    (valueChange)=\"onTabChange($event)\"\n  />\n</div>\n\n@switch (activeTab()) {\n  @case ('hex') {\n    <div class=\"wr-color-picker__inputs wr-color-picker__inputs--hex\">\n      <label class=\"wr-color-picker__field wr-color-picker__field--wide\">\n        <input\n          type=\"text\"\n          spellcheck=\"false\"\n          autocomplete=\"off\"\n          [value]=\"hexInput()\"\n          [disabled]=\"effectiveDisabled()\"\n          (input)=\"onHexInput($event)\"\n          (blur)=\"onHexBlur()\"\n        />\n        <span class=\"wr-color-picker__field-label\">HEX</span>\n      </label>\n    </div>\n  }\n  @case ('rgb') {\n    <div class=\"wr-color-picker__inputs\">\n      <label class=\"wr-color-picker__field\">\n        <input\n          type=\"number\"\n          min=\"0\"\n          max=\"255\"\n          [value]=\"rgb().r\"\n          [disabled]=\"effectiveDisabled()\"\n          (input)=\"onRgbChannel('r', $event)\"\n        />\n        <span class=\"wr-color-picker__field-label\">R</span>\n      </label>\n      <label class=\"wr-color-picker__field\">\n        <input\n          type=\"number\"\n          min=\"0\"\n          max=\"255\"\n          [value]=\"rgb().g\"\n          [disabled]=\"effectiveDisabled()\"\n          (input)=\"onRgbChannel('g', $event)\"\n        />\n        <span class=\"wr-color-picker__field-label\">G</span>\n      </label>\n      <label class=\"wr-color-picker__field\">\n        <input\n          type=\"number\"\n          min=\"0\"\n          max=\"255\"\n          [value]=\"rgb().b\"\n          [disabled]=\"effectiveDisabled()\"\n          (input)=\"onRgbChannel('b', $event)\"\n        />\n        <span class=\"wr-color-picker__field-label\">B</span>\n      </label>\n      @if (alpha()) {\n        <label class=\"wr-color-picker__field\">\n          <input\n            type=\"number\"\n            min=\"0\"\n            max=\"100\"\n            [value]=\"alphaPercent()\"\n            [disabled]=\"effectiveDisabled()\"\n            (input)=\"onAlphaPercent($event)\"\n          />\n          <span class=\"wr-color-picker__field-label\">A%</span>\n        </label>\n      }\n    </div>\n  }\n  @case ('hsl') {\n    <div class=\"wr-color-picker__inputs\">\n      <label class=\"wr-color-picker__field\">\n        <input\n          type=\"number\"\n          min=\"0\"\n          max=\"360\"\n          [value]=\"hslView().h | number: '1.0-0'\"\n          [disabled]=\"effectiveDisabled()\"\n          (input)=\"onHslChannel('h', $event)\"\n        />\n        <span class=\"wr-color-picker__field-label\">H</span>\n      </label>\n      <label class=\"wr-color-picker__field\">\n        <input\n          type=\"number\"\n          min=\"0\"\n          max=\"100\"\n          [value]=\"hslView().s * 100 | number: '1.0-0'\"\n          [disabled]=\"effectiveDisabled()\"\n          (input)=\"onHslChannel('s', $event)\"\n        />\n        <span class=\"wr-color-picker__field-label\">S%</span>\n      </label>\n      <label class=\"wr-color-picker__field\">\n        <input\n          type=\"number\"\n          min=\"0\"\n          max=\"100\"\n          [value]=\"hslView().l * 100 | number: '1.0-0'\"\n          [disabled]=\"effectiveDisabled()\"\n          (input)=\"onHslChannel('l', $event)\"\n        />\n        <span class=\"wr-color-picker__field-label\">L%</span>\n      </label>\n      @if (alpha()) {\n        <label class=\"wr-color-picker__field\">\n          <input\n            type=\"number\"\n            min=\"0\"\n            max=\"100\"\n            [value]=\"alphaPercent()\"\n            [disabled]=\"effectiveDisabled()\"\n            (input)=\"onAlphaPercent($event)\"\n          />\n          <span class=\"wr-color-picker__field-label\">A%</span>\n        </label>\n      }\n    </div>\n  }\n}\n\n@if (swatches().length > 0) {\n  <div class=\"wr-color-picker__swatches\">\n    @for (color of swatches(); track color) {\n      <button\n        type=\"button\"\n        class=\"wr-color-picker__swatch\"\n        [style.background]=\"color\"\n        [attr.aria-label]=\"color\"\n        [disabled]=\"effectiveDisabled()\"\n        (click)=\"onSwatchClick(color)\"\n      ></button>\n    }\n  </div>\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { type OverlayRef, ScrollStrategyOptions } from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport {\n  DestroyRef,\n  Directive,\n  ElementRef,\n  ViewContainerRef,\n  inject,\n  input,\n  model,\n  output,\n  signal,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nimport { WR_OVERLAY } from 'ngwr/overlay';\n\nimport { WrColorPicker } from './color-picker';\nimport type { WrColorFormat } from './interfaces';\n\n/**\n * Opens a `<wr-color-picker>` in an overlay anchored to the host element.\n *\n * Apply to any clickable element (typically a button). Two-way binds the\n * current colour through `[(value)]`; forwards `alpha` / `format` /\n * `swatches` / `disabled` to the inner picker.\n *\n * Same overlay isolation as the rest of the lib — uses {@link WR_OVERLAY},\n * not CDK's root container.\n *\n * @example\n * ```html\n * <button wrColorPickerTrigger\n *         [(value)]=\"brandColor\"\n *         [swatches]=\"palette\">\n *   <span class=\"swatch\" [style.background]=\"brandColor\"></span>\n *   {{ brandColor }}\n * </button>\n * ```\n *\n * @see https://ngwr.dev/components/color-picker\n */\n@Directive({\n  selector: '[wrColorPickerTrigger]',\n  host: { '(click)': 'toggle()' },\n})\nexport class WrColorPickerTrigger {\n  /** Two-way bindable colour value (hex string). */\n  readonly value = model<string>('');\n\n  /** Forwarded to the inner picker. @default true */\n  readonly alpha = input(true, { transform: coerceBooleanProperty });\n\n  /** Forwarded to the inner picker. @default 'hex' */\n  readonly format = input<WrColorFormat>('hex');\n\n  /** Forwarded to the inner picker. @default [] */\n  readonly swatches = input<readonly string[]>([]);\n\n  /** Disable the trigger entirely. @default false */\n  readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n  /** Fires after the picker opens. */\n  readonly opened = output<void>();\n\n  /** Fires after the picker closes. */\n  readonly closed = output<void>();\n\n  private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n  private readonly overlay = inject(WR_OVERLAY);\n  private readonly vcr = inject(ViewContainerRef);\n  private readonly scrollStrategies = inject(ScrollStrategyOptions);\n  private readonly destroyRef = inject(DestroyRef);\n\n  private readonly isOpen = signal(false);\n  private overlayRef: OverlayRef | null = null;\n\n  constructor() {\n    this.destroyRef.onDestroy(() => this.dispose());\n  }\n\n  /** Toggle the picker. Open if closed, close if open. */\n  toggle(): void {\n    if (this.disabled()) return;\n    if (this.isOpen()) {\n      this.close();\n    } else {\n      this.open();\n    }\n  }\n\n  /** Open the picker. No-op if already open. */\n  open(): void {\n    if (this.isOpen() || this.disabled()) return;\n\n    const positionStrategy = this.overlay\n      .position()\n      .flexibleConnectedTo(this.host)\n      .withPositions([\n        { originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top', offsetY: 4 },\n        { originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom', offsetY: -4 },\n        { originX: 'end', originY: 'bottom', overlayX: 'end', overlayY: 'top', offsetY: 4 },\n        { originX: 'end', originY: 'top', overlayX: 'end', overlayY: 'bottom', offsetY: -4 },\n      ])\n      .withPush(true);\n\n    this.overlayRef = this.overlay.create({\n      positionStrategy,\n      scrollStrategy: this.scrollStrategies.reposition(),\n      panelClass: 'wr-color-picker-overlay',\n    });\n\n    const portal = new ComponentPortal(WrColorPicker, this.vcr);\n    const ref = this.overlayRef.attach(portal);\n\n    ref.setInput('alpha', this.alpha());\n    ref.setInput('format', this.format());\n    ref.setInput('swatches', this.swatches());\n    ref.setInput('disabled', this.disabled());\n    ref.instance.writeValue(this.value());\n\n    // Bridge inner picker's CVA onChange to our two-way [(value)] model.\n    ref.instance.registerOnChange((next: string) => this.value.set(next));\n\n    // Outside-click → close (CDK's outsidePointerEvents only fires for clicks\n    // outside the overlay pane; we also need to ignore re-clicks on the host).\n    this.overlayRef\n      .outsidePointerEvents()\n      .pipe(takeUntilDestroyed(this.destroyRef))\n      .subscribe(event => {\n        if (this.host.nativeElement.contains(event.target as Node)) return;\n        this.close();\n      });\n\n    // Escape → close.\n    this.overlayRef\n      .keydownEvents()\n      .pipe(takeUntilDestroyed(this.destroyRef))\n      .subscribe(event => {\n        if (event.key === 'Escape') {\n          event.preventDefault();\n          this.close();\n        }\n      });\n\n    this.isOpen.set(true);\n    this.opened.emit();\n  }\n\n  /** Close the picker. No-op if already closed. */\n  close(): void {\n    if (!this.isOpen()) return;\n    this.dispose();\n    this.isOpen.set(false);\n    this.closed.emit();\n  }\n\n  private dispose(): void {\n    if (this.overlayRef) {\n      this.overlayRef.dispose();\n      this.overlayRef = null;\n    }\n  }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;AAKG;AAKH;;AAEG;AACG,SAAU,QAAQ,CAAC,GAAU,EAAA;AACjC,IAAA,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG;AACrB,IAAA,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG;AACrB,IAAA,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG;AACrB,IAAA,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AAC7B,IAAA,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AAC7B,IAAA,MAAM,CAAC,GAAG,GAAG,GAAG,GAAG;IAEnB,IAAI,CAAC,GAAG,CAAC;AACT,IAAA,IAAI,CAAC,KAAK,CAAC,EAAE;QACX,IAAI,GAAG,KAAK,CAAC;AAAE,YAAA,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;aAC/B,IAAI,GAAG,KAAK,CAAC;YAAE,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC;;YAClC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,G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