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,GAAS3W,OAAOC,SACpB2W,EAAepO,aAAa8N,YAAc9N,EAAEgO,QAGhDvX,KAAK4X,QAAS,EAGd5X,KAAKgG,IAAIC,YACLjG,KACA0X,EAAI,GAAA9O,OACD+O,EAAe,QAAU,QAAO,QACnCT,EAA6BW,KAAK7X,OAEtCA,KAAKgG,IAAIC,YAAYjG,KAAM0X,EAAM,GAAF9O,OAAK+O,EAAe,WAAa,YAAcpO,IAE1EvJ,KAAK4X,QAAS,EACd5X,KAAKgG,IAAI8R,mBAAmB9X,MAG5BkX,EAA6BvN,KAAK3J,KAAMuJ,EAAE,GAElD,C","sources":["src/components/ember-dragula-container.hbs","src/components/ember-dragula-container.ts","src/utils/can-use-dom.ts","src/components/ember-dragula.hbs","src/components/ember-dragula.ts","src/components/action-sheet.hbs","src/components/action-sheet.ts","src/components/color-pickers/analogous-picker.hbs","src/components/color-pickers/analogous-picker.ts","src/components/dimmer-switch.hbs","src/components/dimmer-switch.ts","src/components/element-host.hbs","src/components/element-host.ts","src/utils/color-pickers/preset.ts","src/components/color-pickers/presets-picker.hbs","src/components/color-pickers/presets-picker.ts","src/components/color-pickers/temperature-picker.hbs","src/components/color-pickers/temperature-picker.ts","src/components/lightbulb-color-picker.hbs","src/components/lightbulb-color-picker.ts","src/utils/color-pickers/common.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"\\n {{yield}}\\n\")","import Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nimport type { Drake } from 'dragula';\n\nexport interface EmberDragulaContainerSignature {\n Element: HTMLDivElement;\n Args: {\n /** The Drake yielded from the `` component. */\n drake?: Drake;\n };\n Blocks: {\n default: [];\n };\n}\n\n/**\n * The dragula item container (contained within the dragula container).\n */\nexport default class EmberDragulaContainer extends Component {\n /**\n * Called to add this container to the drake.\n */\n @action setupDrake(el: HTMLElement): void {\n const { drake } = this.args;\n if (!drake) {\n return;\n }\n\n const { containers } = drake;\n if (containers.indexOf(el) === -1) {\n containers.push(el);\n }\n }\n\n /**\n * Called to detach from the drake.\n */\n @action cleanUpDrake(el: HTMLElement): void {\n const { drake } = this.args,\n index = drake?.containers.indexOf(el) ?? -1;\n\n if (index > -1) {\n drake?.containers.splice(index, 1);\n }\n }\n}\n\ndeclare module '@glint/environment-ember-loose/registry' {\n export default interface Registry {\n /**\n * The container for a group of elements that can be dragged. There can be multiple of these within on ``.\n *\n * @example \n */\n EmberDragulaContainer: typeof EmberDragulaContainer;\n }\n}\n","const canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);\n\nexport default canUseDOM;\n","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"\\n {{yield this.drake}}\\n\")","import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { isArray } from '@ember/array';\nimport { action } from '@ember/object';\nimport dragula from 'dragula';\nimport canUseDOM from '../utils/can-use-dom.ts';\n\n// Import the styles to be consumed by the app\nimport '../styles/dragula.css';\nimport type { Drake, DragulaOptions } from 'dragula';\n\nexport type DragulaEventName = 'drag' | 'dragend' | 'drop' | 'cancel' | 'remove' | 'shadow' | 'over' | 'out' | 'cloned';\ntype DragulaEventHandlers =\n | 'onDrag'\n | 'onDragEnd'\n | 'onDrop'\n | 'onCancel'\n | 'onRemove'\n | 'onShadow'\n | 'onOver'\n | 'onOut'\n | 'onCloned';\n\nconst emberEvents = {\n drag: 'onDrag',\n dragend: 'onDragEnd',\n drop: 'onDrop',\n cancel: 'onCancel',\n remove: 'onRemove',\n shadow: 'onShadow',\n over: 'onOver',\n out: 'onOut',\n cloned: 'onCloned'\n};\n\ninterface DragulaConfig {\n options?: DragulaOptions;\n enabledEvents?: DragulaEventName[];\n}\n\ntype DragulaEvents = {\n [key in DragulaEventHandlers]?: (...args: any[]) => void;\n};\n\nexport interface EmberDragulaSignature {\n Element: HTMLDivElement;\n Args: DragulaEvents & {\n config?: DragulaConfig;\n };\n Blocks: {\n default: [Drake?];\n };\n}\n\n/**\n * The root dragula element, which can contain multiple dragula containers.\n */\nexport default class EmberDragula extends Component {\n /**\n * The dragula drake object.\n */\n @tracked drake?: Drake;\n\n /**\n * detaches the drake from the passed element and then destroys it.\n */\n private destroyDrake(el: HTMLElement): void {\n const { drake } = this;\n\n if (drake) {\n if (el) {\n // Not 100% sure if this is right, but removing this element from drake's containers.\n const index = drake.containers?.indexOf(el);\n if (index !== -1) {\n drake.containers.splice(index, 1);\n }\n }\n\n drake.destroy();\n }\n }\n\n /**\n * Called to configure the drake.\n */\n @action setupDrake(el: HTMLElement): void {\n this.destroyDrake(el);\n\n if (!canUseDOM) {\n return;\n }\n\n const { config } = this.args,\n drake = (this.drake = dragula(config?.options ?? {}));\n\n const enabledEvents = config?.enabledEvents;\n if (isArray(enabledEvents)) {\n enabledEvents.forEach((eventName: DragulaEventName) => {\n drake.on(eventName as 'drag', (...args: any[]) => {\n const handler = this.args[emberEvents[eventName] as keyof EmberDragulaSignature['Args']];\n if (typeof handler === 'function') {\n handler(...args, this.drake);\n }\n });\n });\n }\n }\n\n /**\n * Called to dispose of the drake.\n */\n @action cleanUpDrake(el: HTMLElement): void {\n this.destroyDrake(el);\n this.drake = undefined;\n }\n}\n\ndeclare module '@glint/environment-ember-loose/registry' {\n export default interface Registry {\n /**\n * The root dragula element, which contains at least one ``.\n *\n * @example\n * \n * \n */\n EmberDragula: typeof EmberDragula;\n }\n}\n","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{#if (has-block \\\"trigger\\\")}}\\n {{yield to=\\\"trigger\\\"}}\\n{{/if}}\\n{{#if @isActive}}\\n \\n \\n
\\n
\\n {{#if @title}}\\n

{{@title}}

\\n {{else if (has-block \\\"header\\\")}}\\n {{yield to=\\\"header\\\"}}\\n {{/if}}\\n
\\n \\n
\\n {{#if (has-block \\\"subheader\\\")}}\\n
\\n {{yield to=\\\"subheader\\\"}}\\n
\\n {{/if}}\\n \\n
\\n {{yield}}\\n\\n \\n {{#if buttons}}\\n
\\n {{#each buttons as |btn|}}\\n \\n {{/each}}\\n
\\n {{/if}}\\n
\\n
\\n
\\n {{#if (has-block \\\"footer\\\")}}\\n {{yield to=\\\"footer\\\"}}\\n {{/if}}\\n {{#if (and @imageSrc @imageAlt)}}\\n {{@imageAlt}}\\n {{/if}}\\n \\n
\\n{{/if}}\")","import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { isEscapeCode } from '@adc/ember-utils/utils/a11y';\nimport { A } from '@ember/array';\nimport { assert } from '@ember/debug';\nimport { action, computed } from '@ember/object';\nimport { notEmpty } from '@ember/object/computed';\nimport { or } from '@ember/object/computed';\nimport { inject as service } from '@ember/service';\nimport { toggleBodyScroll } from '../utils/general.ts';\n\nimport type DomService from '@adc/ember-utils/services/dom';\nimport type ModalService from '../services/modals.ts';\nimport type { ButtonSimpleSignature } from './button/simple';\n\nexport interface ActionSheetButton {\n text: string;\n fn: VoidFunction;\n disabled?: boolean;\n color?: ButtonSimpleSignature['Args']['buttonColor'];\n}\n\nexport interface ActionSheetSignature {\n Element: HTMLDivElement;\n Args: {\n /** Indicates the action sheet is open. */\n isActive: boolean;\n /** Triggered when the user wants to close the action sheet. */\n close(): void;\n /** Optional title for the action sheet. */\n title?: string;\n /** Optional URI for the image to be displayed at the bottom of the action sheet. */\n imageSrc?: string;\n /** Alt text for the bottom image (must be provided if the image src is). */\n imageAlt?: string;\n /** Collection of buttons to render at the bottom of the body of the action sheet. When docked the buttons will appear stacked, 100% width, with primary buttons sorted to the top. When not docked the buttons will appear at the bottom, right aligned, with primary buttons sorted to the right. */\n buttons?: ActionSheetButton[] | Promise;\n };\n Blocks: {\n /** Optional block for rendering a trigger element. */\n trigger: [];\n /** Will render into the action sheet header, but only if a `@title` was not provided. */\n header: [];\n /** Will render into a space just below the action sheet header. */\n subheader: [];\n /** The body of the action sheet. */\n default: [];\n /** Will render below the body. */\n footer: [];\n };\n}\n\n/**\n * @classdesc\n * A popup container with a customizable title, sub-header, footer and content. Renders as a popup on large screens, and docked to the bottom of the screen with a max height slightly shorter than the screen on small screens. The main content will scroll if it overflows the action sheet.\n *\n * @see https://bitbucket.corp.adcinternal.com/projects/FALCOR/repos/adc-web-frontend/browse/addons/adc-ui-components/package/doc/action-sheet.md\n */\nexport default class ActionSheet extends Component {\n @service declare media: ADCResponsiveMediaService;\n @service declare modals: ModalService;\n @service declare dom: DomService;\n\n @tracked isFocusTrapActive = false;\n\n @notEmpty('modals.modalsToRender')\n declare areAnyModalsOpen: boolean;\n\n curtain?: Element | null;\n closeListener?: string;\n\n focusTrapOptions = {\n allowOutsideClick: true,\n escapeDeactivates: false\n };\n\n @or('media.isMobile', 'media.isTabletPortrait')\n declare isDocked: boolean;\n\n @computed('args.buttons.[]', 'isDocked')\n get buttons(): Promise {\n return (async () => {\n const all = A((await this.args.buttons) ?? []),\n buttons = [...all.filterBy('color', 'primary'), ...all.rejectBy('color', 'primary')];\n\n return this.isDocked ? buttons : buttons.reverse();\n })();\n }\n\n /**\n * Called when the action sheet element is inserted.\n */\n @action opened(el: Element): void {\n // Cache curtain so we can access in closed.\n this.curtain = this.toggleCurtain(true, el);\n\n // Is the sheet NOT docked?\n if (!this.isDocked) {\n // Need to set focus trap here because element will not transition.\n this.isFocusTrapActive = true;\n\n const { close } = this.args;\n this.closeListener = this.dom.addListener(this, el, 'keyup', (evt: KeyboardEvent & { target: Element }) => {\n if (isEscapeCode(evt.code) && evt.target.tagName.toLowerCase() !== 'input') {\n close();\n }\n });\n }\n }\n\n /**\n * Called when the action sheet element is about to be removed.\n */\n @action closed(): void {\n const { closeListener } = this;\n if (closeListener) {\n this.dom.removeListener(this, closeListener);\n }\n\n this.toggleCurtain(false);\n this.isFocusTrapActive = false;\n this.curtain = null;\n }\n\n private toggleCurtain(isOpen: boolean, el = this.curtain): Element {\n assert('[@adc/ui-components] Action sheet element not found', el);\n\n toggleBodyScroll(isOpen);\n\n const curtain = el.closest('.action-sheet-host')?.querySelector('.curtain');\n assert(\n '[@adc/ui-components] Action sheet found no host or curtain, are you sure the action-sheet-host is rendered?',\n curtain\n );\n\n curtain.classList.toggle('is-open', isOpen);\n return curtain;\n }\n}\n","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{! template-lint-disable no-inline-styles }}\\n\\n
\\n
\\n {{! template-lint-disable no-pointer-down-event-binding }}\\n
\\n \\n\\n \\n\")","import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { isArrowCode } from '@adc/ember-utils/utils/a11y';\nimport { assert } from '@ember/debug';\nimport { computed, action, getProperties } from '@ember/object';\nimport { inject as service } from '@ember/service';\nimport { htmlSafe } from '@ember/template';\nimport { isPresent } from '@ember/utils';\nimport { fnGradient, constrainHueValue } from '../../utils/color-pickers/color.ts';\nimport {\n getNormalizedEventCoordinates,\n LEFT_MOUSE_BUTTON_CODE,\n processEvent\n} from '../../utils/color-pickers/common.ts';\n\nimport type DomService from '@adc/ember-utils/services/dom';\nimport type { SafeString } from 'handlebars';\nimport type { Color, Hue, Lightness } from '../../utils/color-pickers/color.ts';\n\nconst ON_SELECT_ACTION = 'on-select';\nconst TRANSPARENT_GRADIENT_VALUE = 'rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.67) 50%, #ffffff';\n\n/**\n * The half size of the hue values range to show in the picker interactive surface.\n * One half before and one half after the baseHue value.\n */\nconst HUE_STEP = 60 as const;\n\nexport interface AnalogousPickerSignature {\n Element: HTMLDivElement;\n Args: {\n /** Optional color sheet width, in pixels (defaults to 216). */\n width?: number;\n /** Optional color sheet height, in pixels (defaults to 216). */\n height?: number;\n /** The current base hue (defaults to 25). */\n baseHue?: Hue;\n /** The currently selected hue (defaults to 25). */\n hue?: Hue;\n /** The currently selected lightness value (defaults to 51). */\n lightness?: Lightness;\n /** Triggered when the user selects a new color. */\n [ON_SELECT_ACTION]: (item: Color) => void;\n };\n}\n\n/**\n * @classdesc\n * Adds support for selecting a color and returns it in the HSL format.\n */\nexport default class AnalogousPickerComponent extends Component {\n // region Properties\n\n @service declare dom: DomService;\n @tracked isBusy = false;\n\n /**\n * The picker height, in pixels.\n */\n @computed('args.height')\n get height(): number {\n return this.args.height ?? 216;\n }\n\n /**\n * The picker width, in pixels.\n */\n @computed('args.width')\n get width(): number {\n return this.args.width ?? 216;\n }\n\n /**\n * The hue this range of colors will be based on.\n */\n @computed('args.baseHue')\n get baseHue(): Hue {\n return this.args.baseHue ?? 25;\n }\n\n /**\n * The selected hue (should be within 60 degrees of the base hue).\n */\n @computed('args.hue')\n get hue(): Hue {\n return this.args.hue ?? 25;\n }\n\n /**\n * The selected lightness (should be between 50 and 100).\n */\n @computed('args.lightness')\n get lightness(): Lightness {\n return this.args.lightness ?? 51;\n }\n\n // endregion\n\n // region Computed Properties\n\n /**\n * Generates the background image CSS for the analogous picker interactive surface.\n */\n @computed('baseHue')\n get pickerBackgroundStyle(): SafeString {\n const hueRange = [-HUE_STEP, 0, HUE_STEP]\n .map((offset) => constrainHueValue(offset, this.baseHue))\n .map((hue, idx) => `hsl(${hue}, 100%, 50%)${idx === 1 ? ' 50%' : ''}`);\n\n return htmlSafe(\n `background-image: ${fnGradient('top', TRANSPARENT_GRADIENT_VALUE)}, ${fnGradient(\n 'right',\n hueRange.join(', ')\n )}`\n );\n }\n\n /**\n * The slider thumb color style.\n */\n @computed('baseHue')\n get sliderThumbColorStyle(): SafeString {\n return htmlSafe(`color: hsl(${this.baseHue}, 100%, 50%);`);\n }\n\n /**\n * Sets the width and height for the clickable surface of the picker, according to the values of the *width* and *height* properties.\n */\n @computed('width', 'height')\n get pickerSurfaceStyle(): SafeString {\n return htmlSafe(`width: ${this.width}px; height: ${this.height}px;`);\n }\n\n /**\n * Combines the inherited picker surface style with the background style.\n */\n @computed('pickerSurfaceStyle', 'pickerBackgroundStyle')\n get pickerStyle(): SafeString {\n return htmlSafe(`${this.pickerBackgroundStyle}; ${this.pickerSurfaceStyle}`);\n }\n\n /**\n * Generates the position transform CSS for the selector.\n */\n @computed('baseHue', 'hue', 'lightness', 'width', 'height')\n get selectorPositionStyle(): SafeString {\n const { baseHue, hue, lightness, width, height } = this,\n bottomRange = constrainHueValue(-HUE_STEP, baseHue),\n hueDelta = hue >= bottomRange ? hue - bottomRange : hue + (360 - bottomRange);\n\n return htmlSafe(\n `transform: translate(${(hueDelta / (2 * HUE_STEP)) * width}px, ${(1 - (lightness - 50) / 50) * height}px);`\n );\n }\n\n // endregion\n\n /**\n * Calls the 'on-select' action.\n */\n @action changeSelectedColor(e: Event): void {\n const [x, y] = getNormalizedEventCoordinates.call(this, e);\n if (x && y) {\n const hue = constrainHueValue(Math.round((x - 0.5) * (HUE_STEP * 2)), this.baseHue),\n lightness = Math.round((1 - y) * 50 + 50) as Lightness;\n\n // Pass new color value out of picker.\n this.args[ON_SELECT_ACTION]({\n hue,\n saturation: 100,\n lightness\n });\n }\n }\n\n /**\n * Validates the passed component attributes.\n */\n @action validateAttributes() {\n const requiredProperties = getProperties(this, 'baseHue', 'hue', 'lightness', 'height', 'width'),\n fnGetErrorText = (reason: string) => `[@adc/ui-components] Analogous Color Picker: ${reason}`,\n fnCompareRange = (name: keyof typeof requiredProperties, min: number, max: number) => {\n const value = requiredProperties[name];\n assert(\n fnGetErrorText(`The \"${name}\" value (${value}) must be between ${min} and ${max} (inclusive)`),\n value >= min && value <= max\n );\n };\n\n // Verify all values are present and are numbers.\n Object.keys(requiredProperties).forEach((name: keyof typeof requiredProperties) => {\n const value = requiredProperties[name];\n assert(\n fnGetErrorText(`The \"${name}\" must be a valid number`),\n isPresent(value) && typeof value === 'number'\n );\n });\n\n // Verify hues and lightness are within supported levels.\n ['baseHue', 'hue'].forEach((name: keyof typeof requiredProperties) => fnCompareRange(name, 0, 360));\n fnCompareRange('lightness', 50, 100);\n\n const { baseHue, hue } = requiredProperties,\n minValue = constrainHueValue(-HUE_STEP, baseHue),\n maxValue = constrainHueValue(HUE_STEP, baseHue);\n\n assert(\n fnGetErrorText(`The \"hue\" and \"baseHue\" values must be within ${HUE_STEP} degrees of one another`),\n minValue > maxValue ? hue >= minValue || hue <= maxValue : hue >= minValue && hue <= maxValue\n );\n }\n\n /**\n * Changes the base hue, preserving the current baseHue/hue relationship.\n */\n @action onHueSliderChange(newBaseHue: Hue): void {\n // Get current base hue and selected hue.\n const { baseHue, hue, lightness } = this;\n\n // Did the hue actually change?\n if (newBaseHue !== baseHue) {\n // Pass new color value out of picker.\n this.args[ON_SELECT_ACTION]({\n baseHue: newBaseHue,\n hue: constrainHueValue(hue - baseHue, newBaseHue),\n saturation: 100,\n lightness\n });\n }\n }\n\n /**\n * Updates the selected hue and lightness based on the position of the left mouse click.\n */\n @action mouseDownAction(e: MouseEvent): void {\n // If this event was fired by left-click\n if (e.which === LEFT_MOUSE_BUTTON_CODE) {\n try {\n processEvent.call(this, e);\n this.changeSelectedColor(e);\n } catch (e) {\n // VID-58056: clicked on the edge of picker\n }\n }\n }\n\n /**\n * Updates the selected hue and lightness based on the position of the touch.\n */\n @action touchStartAction(e: Event): void {\n processEvent.call(this, e);\n this.changeSelectedColor(e);\n }\n\n /**\n * Selects a color from a keyup on the thumb.\n */\n @action keyUpOnThumb(e: KeyboardEvent): void {\n if (isArrowCode(e.code)) {\n this.changeSelectedColor(e);\n }\n }\n}\n","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"
\\n \\n\\n
\\n \\n
\\n\\n \\n
\")","import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { equal } from '@ember/object/computed';\nimport { inject as service } from '@ember/service';\nimport { ON, OFF, UNKNOWN } from '../utils/dimmer-switch.ts';\n\nimport type { Registry as ServiceRegistry } from '@ember/service';\nimport type { DimmerState } from '../utils/dimmer-switch';\nimport type { SliderAdcSignature } from './slider-adc';\n\ntype SliderAdcSignatureArgs = SliderAdcSignature['Args'];\n\ninterface DimmerSwitchSignature {\n Element: HTMLDivElement;\n Args: {\n /** The current dimmer state. */\n state: DimmerState;\n /** The current dimmer slider value. */\n value: SliderAdcSignatureArgs['value'];\n /** Triggered when the dimmer value changes. */\n onChange: (state: DimmerState, percentage: number, isFromSlider: boolean, isMouseUp: boolean) => unknown;\n /** Indicates the dimmer switch should be disabled. */\n disabled?: boolean;\n /** Indicates whether to show the dimmer vertically. */\n showVertically?: SliderAdcSignatureArgs['showVertically'];\n /** The icon for the off button. */\n offButtonIcon?: string;\n /** The text of the off button */\n offButtonText?: string;\n /** The icon for the on button. */\n onButtonIcon?: string;\n /** The text of the on button. */\n onButtonText?: string;\n /** Optional slider title. */\n sliderTitle?: SliderAdcSignatureArgs['title'];\n /** The aria value text. */\n sliderValueText?: SliderAdcSignatureArgs['valueText'];\n };\n Blocks: {\n default: [];\n };\n}\n\ninterface ButtonInfo {\n icon: string;\n text: string;\n action: VoidFunction;\n type: 'on' | 'off';\n}\n\n/**\n * @classdesc\n * A slider control in between on/off buttons that control the state of the slider.\n */\nexport default class DimmerSwitch extends Component {\n @service declare intl: ServiceRegistry['adc-intl'];\n\n /**\n * The state that the dimmer is in.\n */\n get state(): DimmerState {\n return this.args.state ?? UNKNOWN;\n }\n\n /**\n * Indicates the dimmer state is ON.\n */\n @equal('state', ON)\n declare isDimmerOn: boolean;\n\n // #region Button properties\n\n get offButton(): ButtonInfo {\n return {\n icon: this.args.offButtonIcon ?? 'light-off',\n text: this.args.offButtonText ?? this.intl.t('@adc/ui-components.lightOff'),\n action: this.turnOff,\n type: 'off'\n };\n }\n\n get onButton(): ButtonInfo {\n return {\n icon: this.args.onButtonIcon ?? 'light-on',\n text: this.args.onButtonText ?? this.intl.t('@adc/ui-components.lightOn'),\n action: this.turnOn,\n type: 'on'\n };\n }\n\n get startButton(): ButtonInfo {\n return this.args.showVertically ? this.onButton : this.offButton;\n }\n\n get endButton(): ButtonInfo {\n return this.args.showVertically ? this.offButton : this.onButton;\n }\n\n // #endregion\n\n /**\n * Turns the dimmer's state to ON.\n */\n @action turnOn(): void {\n // Note: Do not move the slider percentage, unless it was zero, then set it to the max percentage.\n this.args.onChange(ON, this.args.value || 100, false, true);\n }\n\n /**\n * Turns the dimmer's state to OFF.\n */\n @action turnOff(): void {\n // Note: Do not move the slider percentage.\n this.args.onChange(OFF, this.args.value, false, true);\n }\n\n /**\n * Updates the dimmer state whenever the slider changes value.\n */\n @action sliderValueChanged(newPercentage: number, isFromSlider = true, isMouseUp = true): void {\n this.args.onChange(newPercentage > 0 ? ON : OFF, newPercentage, isFromSlider, isMouseUp);\n }\n}\n","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"
\\n{{#if this.isReady}}\\n {{#in-element this.hostEl}}\\n {{yield}}\\n {{/in-element}}\\n{{/if}}\")","import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { action } from '@ember/object';\nimport { scheduleOnce } from '@ember/runloop';\n\nexport interface ElementHostSignature {\n Args: {\n /** A valid CSS selector to the element that should host the yielded content. */\n hostSelector: string;\n };\n Blocks: {\n default: [];\n };\n}\n\nexport default class ElementHost extends Component {\n @tracked isReady = false;\n\n /**\n * Returns the target host element.\n */\n get hostEl(): HTMLElement {\n return document.querySelector(this.args.hostSelector)!;\n }\n\n @action scheduleRender(): void {\n // Do not copy this deprecated usage. If you see this, please fix it\n // eslint-disable-next-line ember/no-runloop\n scheduleOnce('afterRender', this, this.updateIsReady);\n }\n\n private updateIsReady(): void {\n this.isReady = true;\n }\n}\n","interface Preset {\n id?: number;\n color?: {\n percentWarmth?: number;\n };\n label?: string;\n props?: Preset;\n}\n\n/**\n * Checks that the given property exists and has the given type on the given object. Logs console error if not.\n */\nfunction ensureObjectHasPropertyOfType(obj: T, propName: keyof T, type: string, message: string): boolean {\n if (typeof obj[propName] !== type) {\n console.error(message);\n\n return false;\n }\n\n return true;\n}\n\n/**\n * Checks that the given color preset config has the mandatory props for the analogous-color-picker color preset item to be generated,\n * logs error otherwise.\n */\nexport function isColorPresetConfigValid(\n preset: any,\n componentName = 'lightbulb-color-picker',\n extraChecks: (p?: Preset, c?: string) => boolean = () => true\n): boolean {\n const propChecks = [\n ['id', 'number', `${componentName}: Missing \"id\" property on the preset with ID=${preset.id}`],\n ['labelName', 'string', `${componentName}: Missing \"labelName\" property on the preset with ID=${preset.id}`],\n [\n 'backgroundImage',\n 'string',\n `${componentName}: Missing \"backgroundImage\" property on the preset with ID=${preset.id}`\n ]\n ];\n\n return (\n propChecks.every((check) =>\n ensureObjectHasPropertyOfType(preset, check[0], check[1], check[2])\n ) &&\n ensurePresetHasColor(preset, componentName) &&\n extraChecks(preset, componentName)\n );\n}\n\n/**\n * Checks that the given color preset has the mandatory props, logs error otherwise.\n */\nexport function isColorPresetValid(\n preset: any,\n componentName = 'lightbulb-color-picker',\n extraChecks: (p?: Preset, c?: string) => boolean = () => true\n): boolean {\n return isPresetValid(preset, componentName, () => {\n const propChecks = [\n [\n 'backgroundImage',\n 'string',\n `${componentName}: Missing \"backgroundImage\" property on the preset with ID=${preset?.props?.id}`\n ]\n ];\n\n return (\n propChecks.every((check) =>\n ensureObjectHasPropertyOfType(preset.props, check[0], check[1], check[2])\n ) &&\n ensurePresetHasColor(preset, componentName) &&\n extraChecks(preset, componentName)\n );\n });\n}\n\n/**\n * Checks that the preset has the color object defined as expected, logs error otherwise.\n */\nfunction ensurePresetHasColor(preset: Preset, componentName: string): boolean {\n const context = preset.props ?? preset;\n\n if (\n !ensureObjectHasPropertyOfType(\n context,\n 'color',\n 'object',\n `${componentName}: Missing \"color\" object on the preset with ID=${context.id}`\n )\n ) {\n return false;\n }\n\n return ['hue', 'saturation', 'lightness'].every((propName) =>\n ensureObjectHasPropertyOfType(\n context.color,\n propName as keyof typeof context.color,\n 'number',\n `${componentName}: Missing \"${propName}\" property on the color object of the preset with ID=${context.id}`\n )\n );\n}\n\n/**\n * Validates the given preset config for the props mandatory for the presets-picker component.\n * Logs console errors if something is missing.\n */\nfunction isPresetValid(preset: Preset, componentName = 'presets-picker', extraChecks = () => true): boolean {\n return (\n ensureObjectHasPropertyOfType(\n preset.props,\n 'id' as keyof typeof preset.props,\n 'number',\n `${componentName}: Missing \"id\" property on the preset object:`\n ) &&\n ensureObjectHasPropertyOfType(\n preset,\n 'label',\n 'string',\n `${componentName}: Missing \"label\" property on the preset object wit ID=${preset.id}`\n ) &&\n extraChecks()\n );\n}\n","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{! template-lint-disable no-inline-styles }}\\n
\\n \\n \\n {{preset.label}}\\n
\\n \\n\")","import Component from '@glimmer/component';\nimport { computed, action } from '@ember/object';\nimport { later } from '@ember/runloop';\nimport { htmlSafe } from '@ember/template';\n\nimport type { SafeString } from 'handlebars';\nimport type { Color } from '../../utils/color-pickers/color.ts';\nimport type { BinaryListItem } from '../simple-binary/list.ts';\n\nexport type PresetItemProps = {\n id: number;\n labelName: string;\n color: Color;\n backgroundStyle: SafeString;\n};\n\nexport type PresetItem = BinaryListItem;\n\n/**\n * The parent preset ID and preset ID.\n * This is updated when a new preset is selected.\n */\nlet lastFocusedPresetItemId: string;\n\nexport interface PresetsPickerSignature {\n Element: HTMLDivElement;\n Args: {\n /** The preset items to show. */\n items: PresetItem[];\n /** Optional preset picker width, in pixels (defaults to 216). */\n width?: number;\n /** Optional preset picker height, in pixels (defaults to 216). */\n height?: number;\n /** A dumb property that somebody added instead of adjusting the passed in height (please don't use this). */\n extraHeight?: number;\n /** Triggered when the user selects a new preset value. */\n 'on-select': (item: PresetItem) => void;\n };\n}\n\n/**\n * @classdesc\n * Provides supports for selecting between a list of preset items. This component is built for the lightbulb-color-picker.\n */\nexport default class PresetsPickerComponent extends Component {\n // region Properties\n\n /**\n * The width of the picker.\n */\n get width(): number {\n return this.args.width ?? 216;\n }\n\n /**\n * The height of the picker.\n */\n get height(): number {\n return this.args.height ?? 216;\n }\n\n // endregion\n\n // region Computed Properties\n\n /**\n * The style for the component.\n */\n @computed('width', 'height', 'args.extraHeight')\n get componentStyle(): SafeString {\n return htmlSafe(`width: ${this.width}px; height: ${this.height + (this.args.extraHeight ?? 0)}px;`);\n }\n\n // endregion\n\n /**\n * Focuses a preset if one was previously selected.\n */\n @action focusLastPreset(el: HTMLDivElement & { parentNode: HTMLElement }): void {\n const { parentNode } = el;\n\n if (lastFocusedPresetItemId === parentNode.dataset.buttonListItemId) {\n // Do not copy this deprecated usage. If you see this, please fix it\n // eslint-disable-next-line ember/no-runloop\n later(() => parentNode.focus(), 0);\n }\n }\n\n /**\n * Forwards the preset to the on-select action.\n */\n @action onPresetSelected(items: PresetItem[]): void {\n const preset = items.find(({ state }) => state === true);\n if (preset) {\n this.args['on-select'](preset);\n lastFocusedPresetItemId = String(preset.props.id);\n }\n }\n}\n","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"
\\n {{#if this.isPresetsSelected}}\\n \\n {{else}}\\n
\\n
\\n {{! template-lint-disable no-pointer-down-event-binding }}\\n
\\n
\\n {{/if}}\\n\\n
\\n \\n \\n
\\n\")","import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { isArrowCode } from '@adc/ember-utils/utils/a11y';\nimport { A } from '@ember/array';\nimport { computed, action } from '@ember/object';\nimport { inject as service } from '@ember/service';\nimport { htmlSafe } from '@ember/template';\nimport {\n fnGradient,\n TEMPERATURES_GRADIENT_VALUE,\n hslFromPercentWarmth,\n getHSLCss\n} from '../../utils/color-pickers/color.ts';\nimport {\n PICKER_THUMB_SIZE,\n LEFT_MOUSE_BUTTON_CODE,\n getNormalizedEventCoordinates,\n processEvent\n} from '../../utils/color-pickers/common.ts';\nimport { BinaryListItem } from '../simple-binary/list.ts';\n\nimport type DomService from '@adc/ember-utils/services/dom';\nimport type ADCIntlService from '@adc/i18n/services/adc-intl';\nimport type { SafeString } from 'handlebars';\nimport type { Warmth } from '../../utils/color-pickers/color.ts';\nimport type { PresetItemProps } from './presets-picker.ts';\n\n/**\n * Temperature presets configuration.\n */\nconst defaultPresets = [\n ['warmWhite', 0],\n ['softWhite', 30],\n ['dayWhite', 70],\n ['coolWhite', 100]\n].map(([label, percentWarmth]: [string, Warmth], idx) => ({\n id: idx + 1,\n labelName: `@adc/ui-components.${label}`,\n color: {\n ...hslFromPercentWarmth(percentWarmth),\n percentWarmth\n }\n}));\n\nexport interface TemperaturePickerSignature {\n Element: HTMLDivElement;\n Args: {\n /** Optional preset picker width, in pixels (defaults to 216). */\n width?: number;\n /** Optional preset picker height, in pixels (defaults to 216). */\n height?: number;\n /** Current warmth percentage. */\n percentWarmth?: Warmth;\n /** Triggered when the user selects a new temperature. */\n 'on-select': (item: { percentWarmth?: Warmth }) => void;\n };\n}\n\n/**\n * @classdesc\n * Adds support for picking a color temperature. Outputs both the HSL color and the percentWarmth percentage value [0, 100].\n */\nexport default class TemperaturePickerComponent extends Component {\n @service declare intl: ADCIntlService;\n @service declare dom: DomService;\n\n // region Properties\n\n @tracked isBusy = false;\n\n /**\n * The picker width, in pixels.\n */\n @computed('args.width')\n get width(): number {\n return this.args.width ?? 216;\n }\n\n /**\n * The warmth percent.\n */\n @computed('args.percentWarmth')\n get percentWarmth(): number {\n return this.args.percentWarmth ?? 70;\n }\n\n // endregion\n\n // region Component state\n\n /**\n * Whether or not the presets tab is open.\n */\n @tracked isPresetsSelected = true;\n\n // endregion\n\n // region Computed Properties\n\n /**\n * The collection of color temperature preset items.\n */\n @computed('args.percentWarmth')\n get presetItems(): BinaryListItem[] {\n const { percentWarmth } = this;\n\n return A(\n defaultPresets.map((config) => {\n const { labelName, color } = config;\n\n return new BinaryListItem({\n label: this.intl.t(labelName),\n state: color.percentWarmth === percentWarmth,\n props: {\n ...config,\n backgroundStyle: htmlSafe(`background-color: ${getHSLCss(color)}`)\n }\n });\n })\n ).toArray();\n }\n\n /**\n * The adjusted height of the picker. We subtract from the original height to exclude the tab buttons height.\n */\n @computed('args.height')\n get internalHeight(): number {\n const height = this.args.height ?? 216;\n\n return height - PICKER_THUMB_SIZE;\n }\n\n /**\n * Sets the width and height for the clickable surface of the picker, according to the values of the *width* and *height* properties.\n */\n @computed('width', 'internalHeight')\n get pickerSurfaceStyle(): SafeString {\n return htmlSafe(`width: ${this.width}px; height: ${this.internalHeight}px;`);\n }\n\n /**\n * Generates the background image for the temperature picker clickable area.\n */\n get pickerBackgroundStyle(): SafeString {\n return htmlSafe(`background-image: ${fnGradient('right', TEMPERATURES_GRADIENT_VALUE)}`);\n }\n\n /**\n * Combines the picker surface style (width and height) with the background style.\n */\n @computed('pickerSurfaceStyle', 'pickerBackgroundStyle')\n get pickerStyle(): SafeString {\n return htmlSafe(`${this.pickerBackgroundStyle}; ${this.pickerSurfaceStyle}`);\n }\n\n /**\n * Generates the style for the color selector (the position of the circle which indicates the currently selected color).\n */\n @computed('percentWarmth', 'width', 'internalHeight')\n get selectorPositionStyle(): SafeString {\n return htmlSafe(\n `transform: translate(${(this.percentWarmth / 100) * this.width}px, ${this.internalHeight / 2}px);`\n );\n }\n\n // endregion\n\n /**\n * Executes the on-select action.\n */\n @action changeSelectedColor(e: Event): void {\n const [x] = getNormalizedEventCoordinates.call(this, e);\n if (x) {\n this.args['on-select']({\n percentWarmth: Math.round(x * 100) as Warmth\n });\n }\n }\n\n /**\n * Selects the clicked tab.\n */\n @action switchActiveTab(isPresetsSelected: boolean, event: MouseEvent): void {\n event.preventDefault();\n\n this.isPresetsSelected = isPresetsSelected;\n }\n\n /**\n * Executes when a preset is picked. It calls the temperature pickers \"on-select\" action, passing it the color from the preset.\n */\n @action onPresetSelect(preset: TemperaturePickerComponent['presetItems'][0]): void {\n this.args['on-select']({\n percentWarmth: preset.props.color?.percentWarmth\n });\n }\n\n /**\n * Selects a color from a keyup on the thumb.\n */\n @action keyUpOnThumb(e: KeyboardEvent): void {\n if (isArrowCode(e.code)) {\n this.changeSelectedColor(e);\n }\n }\n\n /**\n * Updates the selected hue and lightness based on the position of the touch.\n */\n @action touchStartAction(e: TouchEvent): void {\n processEvent.call(this, e);\n\n this.changeSelectedColor(e);\n }\n\n /**\n * Updates the selected hue and lightness based on the position of the left mouse click.\n */\n @action mouseDownAction(e: MouseEvent): void {\n if (e.which === LEFT_MOUSE_BUTTON_CODE) {\n processEvent.call(this, e);\n\n this.changeSelectedColor(e);\n }\n }\n}\n","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"\\n\\n
\\n
\\n
\\n {{#if @supportsHSL}}\\n {{#if this.isPresetsTabSelected}}\\n \\n {{/if}}\\n\\n {{#if this.isColorsTabSelected}}\\n \\n {{/if}}\\n {{/if}}\\n\\n {{#if (and @supportsTemperature this.isTemperatureTabSelected)}}\\n \\n {{/if}}\\n
\\n\\n {{#if @showDimmer}}\\n \\n {{/if}}\\n
\\n\\n {{#if this.showTabBar}}\\n
\\n \\n
\\n {{/if}}\\n
\\n\")","import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { A } from '@ember/array';\nimport { action, computed, set, get } from '@ember/object';\nimport { gt } from '@ember/object/computed';\nimport { next } from '@ember/runloop';\nimport { inject as service } from '@ember/service';\nimport { htmlSafe } from '@ember/template';\nimport { isEmpty } from '@ember/utils';\nimport { hslFromPercentWarmth } from '../utils/color-pickers/color.ts';\nimport { PICKER_THUMB_SIZE } from '../utils/color-pickers/common.ts';\nimport { isColorPresetConfigValid, isColorPresetValid } from '../utils/color-pickers/preset.ts';\nimport { ON } from '../utils/dimmer-switch.ts';\nimport { BinaryListItem } from './simple-binary/list.ts';\n\nimport type ADCIntlService from '@adc/i18n/services/adc-intl';\nimport type { Hue, Saturation, Lightness, Warmth, Color } from '../utils/color-pickers/color.ts';\nimport type { DimmerState, DimmerArgs } from '../utils/dimmer-switch.ts';\nimport type { PresetsPickerSignature } from './color-pickers/presets-picker.ts';\nimport type { PresetItemProps } from './color-pickers/presets-picker.ts';\nimport type { TemperaturePickerSignature } from './color-pickers/temperature-picker.ts';\nimport type { PopoverMenuSignature } from './popover-menu.ts';\n\ntype PopoverMenuSignatureArgs = PopoverMenuSignature['Args'];\ntype PresetsPickerSignatureArgs = PresetsPickerSignature['Args'];\ntype TemperaturePickerSignatureArgs = TemperaturePickerSignature['Args'];\n\n/**\n * Unique identifiers for the three main tabs.\n */\nconst PRESETS_TAB_ID = 1,\n COLORS_TAB_ID = 2,\n TEMPERATURE_TAB_ID = 3;\n\n/**\n * The array of color preset configuration items, one for each color preset.\n */\nconst defaultPresetItems = [\n ['nebula', [275, 98, 51], 'purple'],\n ['pacific', [194, 97, 66], 'blue'],\n ['fiji', [117, 100, 55], 'teal'],\n ['aurora', [99, 100, 50], 'green'],\n ['daybreak', [58, 98, 50], 'yellow'],\n ['canyon', [27, 98, 50], 'orange'],\n ['dusk', [1, 98, 50], 'red'],\n ['cherryBlossom', [324, 97, 64], 'pink']\n].map(([labelName, [hue, saturation, lightness], bg]: [string, [Hue, Saturation, Lightness], string], idx) => ({\n id: idx + 1,\n labelName,\n color: { hue, saturation, lightness },\n backgroundImage: `light-preset-${bg}.png`\n}));\n\nexport interface LightBulbColorPickerComponentSignature {\n Args: Pick &\n Pick & {\n /** The currently selected hue value (1 - 360) */\n hue?: Hue;\n /** The currently selected saturation value (1 - 100) */\n saturation?: Saturation;\n /** The currently selected lightness value (50 - 100) */\n lightness?: Lightness;\n /** The currently selected dimmer value (1 - 100) */\n dimPercentage?: Warmth;\n /** The currently selected dimmer state */\n dimmerState?: 'unknown' | 'on' | 'off';\n /** The URI to the preset picker background images (defaults to `/assets/images`). */\n presetBackgroundImagesRepoURI?: string;\n /** The color hue that will appear at the center of the x-axis (1 - 360). */\n baseHue?: Hue;\n /** The size of the color slider thumb, in pixels (defaults to 24). */\n thumbSize?: number;\n /** Indicates whether to show the analogous color picker tab. */\n supportsHSL: boolean;\n isTemperatureFormat: boolean;\n supportsTemperature: boolean;\n /** Triggered when the user selects a new color. */\n colorChanged: (color: Color) => void;\n /** Triggered when the user selects a new dimmer percentage value. */\n dimmerChanged?: (v: DimmerArgs) => void;\n /** The light temperature value. */\n percentWarmth?: TemperaturePickerSignatureArgs['percentWarmth'];\n /** Indicates the dimmer slider should be visible. */\n showDimmer?: boolean;\n };\n}\n\n/**\n * Validates that the base hue value is within range of the currently selected hue, and updates if it isn't.\n */\nfunction validateBaseHue(this: LightbulbColorPicker, hue: Hue): void {\n let { baseHue } = this.args;\n\n if (baseHue && !isEmpty(baseHue)) {\n let minHue = hue - 60,\n maxHue = hue + 60,\n isOutOfRange;\n\n minHue = minHue < 0 ? 360 + minHue : minHue;\n maxHue = maxHue > 360 ? 360 - maxHue : maxHue;\n\n if (minHue < maxHue) {\n isOutOfRange = baseHue <= minHue || baseHue >= maxHue;\n } else {\n isOutOfRange = baseHue <= minHue && baseHue > maxHue;\n }\n\n if (isOutOfRange) {\n baseHue = hue;\n }\n } else {\n baseHue = hue;\n }\n\n // Do not copy this deprecated usage. If you see this, please fix it\n // eslint-disable-next-line ember/no-runloop\n next(this, () => set(this, 'baseHue', baseHue));\n}\n\n/**\n * Updates the selected preset based on the passed color.\n */\nfunction updateSelectedPreset(this: LightbulbColorPicker, hslColor: Color): void {\n // Update preset selection.\n const { hue, saturation, lightness } = hslColor;\n this.presetItems.forEach(\n (p) =>\n (p.state =\n p.props.color.hue === hue &&\n p.props.color.saturation === saturation &&\n p.props.color.lightness === lightness)\n );\n}\n\n/**\n * @classdesc\n * Allows users to pick a color in three ways: pick from a gradient of colors, pick from a range of light temperatures, pick from a list of preset colors.\n */\nexport default class LightbulbColorPicker extends Component {\n @service declare intl: ADCIntlService;\n\n /**\n * option for focus-trap modifier\n */\n focusTrapOptions = {\n escapeDeactivates: false,\n allowOutsideClick: true,\n initialFocus: '.tab-content > *:first-child'\n };\n // region Passed properties\n\n /**\n * The current hue (for RGB light format).\n */\n get hue(): Hue {\n return this.args.hue ?? 0;\n }\n\n /**\n * The current saturation (for RGB light format).\n */\n get saturation(): Saturation {\n return this.args.saturation ?? 0;\n }\n\n /**\n * The current lightness (for RGB light format).\n */\n get lightness(): Lightness {\n return this.args.lightness ?? 50;\n }\n\n /**\n * The light dim percentage (can be from 0 to 100).\n */\n get dimPercentage(): Warmth {\n return this.args.dimPercentage ?? 90;\n }\n\n /**\n * Holds the state of the dimmer.\n * Can be used to determine whether or not the dim percentage should be taken into consideration.\n */\n get dimmerState(): DimmerState {\n return this.args.dimmerState ?? ON;\n }\n\n /**\n * Where to get the background images for the default color presets from?\n */\n get presetBackgroundImagesRepoURI(): string {\n return this.args.presetBackgroundImagesRepoURI ?? '/assets/images';\n }\n\n // endregion\n\n // region Component state\n\n /**\n * The hue this range of colors will be based on.\n */\n @tracked _baseHue: Hue | undefined;\n get baseHue(): Hue | undefined {\n return this._baseHue ?? this.args.baseHue;\n }\n set baseHue(v: Hue | undefined) {\n this._baseHue = v;\n }\n\n /**\n * The picker thumb size (height and width).\n */\n get thumbSize(): number {\n return this.args.thumbSize ?? PICKER_THUMB_SIZE;\n }\n\n /**\n * The color presets to display.\n */\n presetItems: BinaryListItem[] = defaultPresetItems\n .filter((config) => isColorPresetConfigValid(config))\n .map(\n (config) =>\n new BinaryListItem({\n label: this.intl.t(`@adc/ui-components.${config.labelName}`),\n state: false,\n props: {\n ...config,\n // generate some extra props\n backgroundStyle: htmlSafe(\n `background-image: linear-gradient(rgba(0,0,0,0.1), rgba(0,0,0,0.1)), url('${this.presetBackgroundImagesRepoURI}/${config.backgroundImage}'); background-size: cover;`\n )\n }\n })\n )\n .filter((preset) => isColorPresetValid(preset));\n\n // endregion\n\n // region Computed Properties\n\n /**\n * Indicated which tab is active right now. Initially the Colors tab is active.\n */\n @tracked _activeTabId?: number;\n set activeTabId(v: number) {\n this._activeTabId = v;\n }\n get activeTabId(): number {\n return this._activeTabId ?? (this.args.isTemperatureFormat ? TEMPERATURE_TAB_ID : COLORS_TAB_ID);\n }\n\n /**\n * The tabs to display.\n */\n @computed('activeTabId', 'args.{supportsHSL,supportsTemperature}')\n get tabItems(): BinaryListItem<{ id: number }>[] {\n const { supportsTemperature, supportsHSL } = this.args,\n { activeTabId } = this;\n\n const items: [boolean, number, string, string?][] = [\n [supportsHSL, PRESETS_TAB_ID, 'presets'],\n [supportsHSL, COLORS_TAB_ID, 'colors', 'picker'],\n [supportsTemperature, TEMPERATURE_TAB_ID, 'temperature']\n ];\n\n return A(\n items.map(([check, id, labelName, icon = labelName]) => {\n return check\n ? new BinaryListItem<{ id: number }>({\n label: this.intl.t(`@adc/ui-components.${labelName}`),\n icon: `color-${icon}`,\n state: activeTabId === id,\n props: { id }\n })\n : undefined;\n })\n ).compact();\n }\n\n /**\n * Indicates the tab bar should be visible (more than one tab).\n */\n @gt('tabItems.length', 1)\n showTabBar?: boolean;\n\n /**\n * Whether or not the presets picker tab is selected.\n */\n @computed('args.supportsHSL', 'activeTabId')\n get isPresetsTabSelected(): boolean {\n return this.args.supportsHSL && this.activeTabId === PRESETS_TAB_ID;\n }\n\n /**\n * Whether or not the colors picker tab is selected.\n */\n @computed('args.supportsHSL', 'activeTabId')\n get isColorsTabSelected(): boolean {\n return this.args.supportsHSL && this.activeTabId === COLORS_TAB_ID;\n }\n\n /**\n * Whether or not the temperature picker tab is selected.\n */\n @computed('args.supportsTemperature', 'activeTabId')\n get isTemperatureTabSelected(): boolean {\n return this.args.supportsTemperature && this.activeTabId === TEMPERATURE_TAB_ID;\n }\n\n // endregion\n\n /**\n * Validates the base hue property.\n */\n @action validateBaseHue() {\n if (this.args.supportsHSL) {\n validateBaseHue.call(this, this.hue);\n }\n }\n\n /**\n * Changes the dimmer state and dim percentage.\n */\n @action onDimmerChange(dimmerState: string, dimPercentage: number): void {\n if (dimmerState !== this.dimmerState || dimPercentage !== this.dimPercentage) {\n this.args.dimmerChanged?.({ dimmerState, dimPercentage });\n }\n }\n\n /**\n * Activates the new tab.\n */\n @action onTabChange(items: LightbulbColorPicker['tabItems']): void {\n set(this, 'activeTabId', A(items).findBy('state')!.props.id);\n }\n\n /**\n * Activates the new preset.\n */\n @action onPresetSelect(preset: any): void {\n const { color } = preset.props;\n\n // Did the color NOT change?\n if (['hue', 'saturation', 'lightness'].every((n) => get(this, n as keyof this) === color[n])) {\n return;\n }\n\n // Adjust base hue for new color.\n validateBaseHue.call(this, color.hue);\n\n // Announce the new selected color.\n this.args.colorChanged(color);\n }\n\n /**\n * Changes the selected HSL color.\n */\n @action changeHSLColor(hslColor: Color): void {\n const { baseHue, ...cleanHslColor } = hslColor;\n\n // Did base hue change?\n if (!isEmpty(baseHue)) {\n set(this, 'baseHue', baseHue);\n }\n\n updateSelectedPreset.call(this, cleanHslColor);\n\n // Notify the color changed.\n this.args.colorChanged(cleanHslColor);\n }\n\n /**\n * Changes the selected temperature color.\n */\n @action changeTemperatureColor(temperatureColor: Color): void {\n updateSelectedPreset.call(this, hslFromPercentWarmth(temperatureColor.percentWarmth as Warmth));\n\n // Notify the color changed.\n this.args.colorChanged(temperatureColor);\n }\n}\n","import { isArrowDownCode, isArrowCode, isArrowLeftCode, isArrowUpCode } from '@adc/ember-utils/utils/a11y';\nimport { guidFor } from '@ember/object/internals';\n\nimport type DomService from '@adc/ember-utils/services/dom';\n\ninterface Coordinates {\n clientX: number;\n clientY: number;\n}\n\n/**\n * The picker thumb size (height and width).\n */\nexport const PICKER_THUMB_SIZE = 24;\n\nexport const LEFT_MOUSE_BUTTON_CODE = 1;\n\n/**\n * Cancels the propagation of the event.\n */\nexport function cancelEvent(e: Event): void {\n e.stopPropagation();\n e.stopImmediatePropagation();\n if (!(e instanceof TouchEvent)) {\n e.preventDefault();\n }\n}\n\n/**\n * Get coordinates for the picker selector\n */\nfunction getSelectorCoordinates(element: HTMLElement): Coordinates {\n const { left, top, width, height } = element.getBoundingClientRect();\n\n return {\n clientX: left + width / 2,\n clientY: top + height / 2\n };\n}\n\n/**\n * Determines the normalized coordinates of the event relative to the picker interactive surface.\n * After normalization, the coordinates will have a fractional value between 0 and 1.\n */\nexport function getNormalizedEventCoordinates(\n this: { width: number; height?: number },\n e: KeyboardEvent & { clientX: number; clientY: number }\n): Array {\n // Get the event coordinates.\n let { clientX, clientY } = e;\n const el = document.getElementById(guidFor(this)) as HTMLElement;\n\n // Cache document scroll, position/size of element (adjusted for scroll) and keyboard event code.\n const picker = el.querySelector('.picker') as HTMLElement;\n const { top, left } = picker.getBoundingClientRect(),\n { width, height } = this,\n { code } = e;\n\n if (isArrowCode(code)) {\n const selector = el.querySelector('.selector') as HTMLElement;\n const selectorCoordinates = getSelectorCoordinates(selector),\n isUp = isArrowUpCode(code),\n step = isUp || isArrowLeftCode(code) ? -5 : 5;\n\n clientX = selectorCoordinates.clientX;\n clientY = selectorCoordinates.clientY;\n\n // Is this a vertical arrow?\n if (isUp || isArrowDownCode(code)) {\n clientY += step;\n } else {\n clientX += step;\n }\n }\n\n // Normalize the X and Y coordinates. This outputs values between 0 and 1.\n return [\n [clientX, left, width],\n [clientY, top, height ?? 0]\n ].map(([coordinate, base, dimension]) => Math.max(Math.min((coordinate - base) / dimension, 0.99), 0.01));\n}\n\n/**\n * Validates the event, acquires the coordinates, trigger the color update.\n */\nfunction handlePickerInteractionEvent(e: TouchEvent): void {\n // Cancel the event and check for touches.\n cancelEvent(e);\n\n const { touches } = e;\n\n // Was this a touch event?\n if (touches !== undefined) {\n // Use the first touch event.\n const touch = Array.from(touches || []).pop();\n\n // Is there no touch?\n if (!touch) {\n // The touchend event doesn't have any touches, so there is nothing to do.\n return;\n }\n }\n}\n\n/**\n * Handles the mouseDown and touchStart events.\n */\nexport function processEvent(this: { isBusy: boolean; dom: DomService }, e: MouseEvent | TouchEvent): void {\n const { body } = window.document,\n isTouchEvent = e instanceof TouchEvent && e.touches;\n\n // Set the busy flag.\n this.isBusy = true;\n\n // Add move and up listeners.\n this.dom.addListener(\n this,\n body,\n `${isTouchEvent ? 'touch' : 'mouse'}move`,\n handlePickerInteractionEvent.bind(this)\n );\n this.dom.addListener(this, body, `${isTouchEvent ? 'touchend' : 'mouseup'}`, (e: TouchEvent) => {\n // Clear the listeners and busy status.\n this.isBusy = false;\n this.dom.removeAllListeners(this);\n\n // Handle the event to update the color.\n handlePickerInteractionEvent.call(this, e);\n });\n}\n"],"names":["TEMPLATE","createTemplateFactory","scope","didInsert_","didUpdate_","willDestroy_","EmberDragulaContainer","Component","setupDrake","el","drake","this","args","containers","indexOf","push","cleanUpDrake","_drake$containers$ind","index","splice","_EmberDragulaContainer","n","prototype","action","setComponentTemplate","canUseDOM","window","document","createElement","emberEvents","drag","dragend","drop","cancel","remove","shadow","over","out","cloned","_drake","WeakMap","EmberDragula","constructor","arguments","i","destroyDrake","_drake$containers","destroy","_config$options","_this","config","dragula","options","enabledEvents","isArray","forEach","eventName","on","handler","_len","length","Array","_key","undefined","_EmberDragula","g","tracked","elementHost_","addDelayedCss_","onClickOutside_","preventDefault_","stopPropagation_","fn","focusTrap_","and_","not_","buttonIcon_","t_","scrollContainer_","asyncLoader_","buttonAsync_","_media","_modals","_dom","_isFocusTrapActive","_areAnyModalsOpen","_isDocked","ActionSheet","_classPrivateFieldInitSpec","_defineProperty","allowOutsideClick","escapeDeactivates","buttons","async","all","A","_await$this$args$butt","filterBy","rejectBy","isDocked","reverse","opened","curtain","toggleCurtain","isFocusTrapActive","close","closeListener","dom","addListener","evt","isEscapeCode","code","target","tagName","toLowerCase","closed","removeListener","isOpen","_el$closest","toggleBodyScroll","closest","querySelector","classList","toggle","_ActionSheet","inject","notEmpty","or","computed","guidFor_","sliderAdc_","ON_SELECT_ACTION","HUE_STEP","_isBusy","AnalogousPickerComponent","height","_this$args$height","width","_this$args$width","baseHue","_this$args$baseHue","hue","_this$args$hue","lightness","_this$args$lightness","pickerBackgroundStyle","hueRange","map","offset","constrainHueValue","idx","concat","htmlSafe","fnGradient","join","sliderThumbColorStyle","pickerSurfaceStyle","pickerStyle","selectorPositionStyle","bottomRange","hueDelta","changeSelectedColor","e","x","y","getNormalizedEventCoordinates","call","Math","round","saturation","validateAttributes","requiredProperties","getProperties","fnCompareRange","name","min","max","Object","keys","onHueSliderChange","newBaseHue","mouseDownAction","which","LEFT_MOUSE_BUTTON_CODE","processEvent","touchStartAction","keyUpOnThumb","isArrowCode","_AnalogousPickerComponent","toBoolean_","_intl","_isDimmerOn","DimmerSwitch","state","_this$args$state","UNKNOWN","offButton","_this$args$offButtonI","_this$args$offButtonT","icon","offButtonIcon","text","offButtonText","intl","t","turnOff","type","onButton","_this$args$onButtonIc","_this$args$onButtonTe","onButtonIcon","onButtonText","turnOn","startButton","showVertically","endButton","onChange","ON","value","OFF","sliderValueChanged","newPercentage","isFromSlider","isMouseUp","_DimmerSwitch","equal","_isReady","ElementHost","hostEl","hostSelector","scheduleRender","scheduleOnce","updateIsReady","isReady","_ElementHost","ensureObjectHasPropertyOfType","obj","propName","message","console","error","ensurePresetHasColor","preset","componentName","_preset$props2","context","props","id","every","color","simpleBinaryButtonList_","coalesce_","lastFocusedPresetItemId","PresetsPickerComponent","componentStyle","_this$args$extraHeigh","extraHeight","focusLastPreset","parentNode","dataset","buttonListItemId","later","focus","onPresetSelected","items","find","_ref","String","_PresetsPickerComponent","colorPickersPresetsPicker_","buttonSimple_","defaultPresets","label","percentWarmth","labelName","_objectSpread","hslFromPercentWarmth","_isPresetsSelected","TemperaturePickerComponent","_this$args$percentWar","presetItems","BinaryListItem","backgroundStyle","getHSLCss","toArray","internalHeight","PICKER_THUMB_SIZE","TEMPERATURES_GRADIENT_VALUE","switchActiveTab","isPresetsSelected","event","preventDefault","onPresetSelect","_preset$props$color","_TemperaturePickerComponent","popoverMenu_","colorPickersAnalogousPicker_","colorPickersTemperaturePicker_","dimmerSwitch_","defaultPresetItems","bg","backgroundImage","validateBaseHue","isEmpty","isOutOfRange","minHue","maxHue","next","set","updateSelectedPreset","hslColor","p","_baseHue","_activeTabId","_showTabBar","LightbulbColorPicker","initialFocus","filter","extraChecks","check","isColorPresetConfigValid","presetBackgroundImagesRepoURI","isPresetValid","_preset$props","isColorPresetValid","_this$args$saturation","dimPercentage","_this$args$dimPercent","dimmerState","_this$args$dimmerStat","_this$args$presetBack","_this$_baseHue","v","thumbSize","_this$args$thumbSize","activeTabId","_this$_activeTabId","isTemperatureFormat","tabItems","supportsTemperature","supportsHSL","_ref2","compact","isPresetsTabSelected","isColorsTabSelected","isTemperatureTabSelected","onDimmerChange","_this$args$dimmerChan","_this$args","dimmerChanged","onTabChange","findBy","get","colorChanged","changeHSLColor","cleanHslColor","_objectWithoutProperties","_excluded","changeTemperatureColor","temperatureColor","_LightbulbColorPicker","gt","clientX","clientY","getElementById","guidFor","picker","top","left","getBoundingClientRect","selectorCoordinates","element","getSelectorCoordinates","isUp","isArrowUpCode","step","isArrowLeftCode","isArrowDownCode","coordinate","base","dimension","handlePickerInteractionEvent","stopPropagation","stopImmediatePropagation","TouchEvent","cancelEvent","touches","from","pop","body","isTouchEvent","isBusy","bind","removeAllListeners"],"sourceRoot":""}