{"version":3,"sources":["components/ads-alert/ads-alert.types.ts","utils/timingHelper.ts","components/ads-alert/components/ads-alert-close-button/ads-alert-close-button.tsx","components/ads-alert/ads-alert.tsx","components/ads-alert/ads-alert.scss?tag=ads-alert&encapsulation=shadow","components/core/global/pipeline.ts","components/core/utils/pipeline.ts","components/core/utils/components.ts","utils/imageHelper.tsx","utils/breakpointHelper.ts","utils/resizeHelper.ts","../node_modules/@fortawesome/pro-light-svg-icons/faXmark.js","../node_modules/@fortawesome/pro-light-svg-icons/faTimes.js"],"names":["AdsAlertErrors","AlertAnimationDirections","AlertLevels","a","shouldDelay","delay","Promise","resolve","setTimeout","label","clickHandler","class","onClick","data","svgPathData","height","width","this","el","setAttribute","identifier","component","registerComponent","newValue","handleVisibility","Object","values","toString","includes","INVALID_ANIMATION_DIRECTION","INVALID_ALERT_LEVEL","animation","DELAY_SET_WITHOUT_ANIMATION","isVisibleInternal","isVisible","undefined","visible","visibleChange","emit","visibleChangeHandler","alert","shadowRoot","querySelector","animationDelay","Math","abs","then","classList","remove","catch","add","Pipeline.addComponent","level","Pipeline.removeComponent","classes","isDialog","hasCloseButton","push","get","closeButton","close","attributes","role","isImportant","hostAttributes","join","id","text","window","pipeline","set","tagName","toLowerCase","config","getBoolean","trackEvent","name","COMPONENT_REGISTER","componentId","environment","version","host","location","err","console","log","sendCustomEvent","addComponent","Pipeline.add","removeComponent","delete","Pipeline.remove","generateId","namespace","generateRandomString","random","substr","getClassFromSize","size","MEDIUM","SMALL","getClassFromLevel","PRIMARY","SECONDARY","TERTIARY","getMediaQueryBreakpointClassUp","bp","getMediaQueryBreakpointClassDown","showErrorMessage","message","ADS_CONSOLE_ERROR","warn","generateSVGImage","icon","className","xmlns","viewBox","d","MediaTypes","getBreakpointInPixels","breakpoint","parseInt","breakpoints","mediaQueryLists","addMatchMedia","mediaType","listenerFunction","foundMatchMedia","find","m","media","newMatchMedia","matchMedia","addEventListener","removeMatchMedia","removeEventListener","callbacks","onresize","map","cb","timeout","callback","duration","subscribeToWindowResize","timeoutDuration","unSubscribeToWindowResize","index","findIndex","clearTimeout","splice","defineProperty","exports","value","aliases","prefix","iconName","definition","source","unicode"],"mappings":"gIAGYA,EA6BAC,EAuBAC,E,2FChDC,G,OAAK,uCAAG,0CAAAC,EAAA,6DAAOC,EAAP,gCAA4BC,EAA5B,+BAAoC,IAApC,kBACZ,IAAIC,SAAQ,SAACC,GAClB,IAAKH,EACH,OAAOG,IAETC,WAAWD,EAASF,OALH,2CAAH,sD,wDDJlB,SAAYL,GACV,4DACA,4CACA,uIAHF,CAAYA,MAAc,KA6B1B,SAAYC,GACV,UACA,cAFF,CAAYA,MAAwB,KAuBpC,SAAYC,GACV,oBACA,oBACA,kBAHF,CAAYA,MAAW,KExChB,IAAM,EAAgE,SAAC,GAA+C,IAA7CO,EAA6C,EAA7CA,MAAOC,EAAsC,EAAtCA,aACrF,OACE,sBAAQC,MAAK,iBAAkB,aAAcF,EAAK,aAAa,OAAM,mBAAmBA,EAAOG,QAASF,GACrG,YAAiB,CAAEG,KAAMC,gBAAW,OAAEC,WAAM,MAAEC,cCmBxC,EAAQ,WAMnB,kC,mGAW6B,E,iEAgBa,E,yCAWA,E,kBAMH,E,oEA3CrCC,KAAKC,GAAGC,aAAa,KAAMF,KAAKG,YAAc,YAAW,cACzDH,KAAKI,UAAY,YACjB,IAAWC,kBAAkBL,MATZ,mEAgFIM,GACrBN,KAAKC,GAAGC,aAAa,KAAMI,GAAY,YAAW,gBAjFjC,0CA0FCA,GACbN,KAAKO,iBAAiBD,KA3FV,yCAoGAA,GACbA,IAAaE,OAAOC,OAAOzB,GAA0B0B,WAAWC,SAASL,IAC3E,YAAiBvB,EAAe6B,4BAA6BZ,KAAKC,MAtGnD,qCAgHJK,GACTA,IAAaE,OAAOC,OAAOxB,GAAayB,WAAWC,SAASL,IAC9D,YAAiBvB,EAAe8B,oBAAqBb,KAAKC,MAlH3C,8CA4HKK,GAAgB,WAEtCf,YAAW,WACLe,IAAa,EAAKQ,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/js/16.fe2c602b.chunk.js","sourcesContent":["/**\n * Collection of alert errors\n */\nexport enum AdsAlertErrors {\n INVALID_ANIMATION_DIRECTION = 'Invalid animation direction',\n INVALID_ALERT_LEVEL = 'Invalid alert level',\n DELAY_SET_WITHOUT_ANIMATION = \"Prop 'animationDelay' was set without 'animation'. Please set 'animation' for the delay to take effect\",\n}\n\n/**\n * Interface for visibleChange handler\n */\nexport type VisibleChangeHandler = (evt: VisibleChangeEvent) => void;\n\n/**\n * An interface for the 'visibleChange' event\n * @docs\n */\nexport interface VisibleChangeEvent {\n el: HTMLElement;\n visible: boolean;\n}\n\n/**\n * The alert animation directions\n * @example\n * ```\n * <ads-alert animation=\"up\"></ads-alert>\n * <ads-alert animation=\"down\"></ads-alert>\n * ```\n * @public\n */\nexport enum AlertAnimationDirections {\n UP = 'up',\n DOWN = 'down',\n}\n\nexport type AlertAnimationDirectionUp = 'up';\nexport type AlertAnimationDirectionDown = 'down';\n\n/**\n * Animation direction options\n */\nexport type AlertAnimationDirection = AlertAnimationDirectionUp | AlertAnimationDirectionDown;\n\n/**\n * The alert levels\n * @example\n * ```\n * <ads-alert level=\"success\"></ads-alert>\n * <ads-alert level=\"warning\"></ads-alert>\n * <ads-alert level=\"danger\"></ads-alert>\n * ```\n * @public\n */\nexport enum AlertLevels {\n SUCCESS = 'success',\n WARNING = 'warning',\n DANGER = 'danger',\n}\n\nexport type AlertLevelSuccess = 'success';\nexport type AlertLevelWarning = 'warning';\nexport type AlertLevelDanger = 'danger';\n\n/**\n * Alert level options\n */\nexport type AlertLevel = AlertLevelSuccess | AlertLevelWarning | AlertLevelDanger;\n","/**\n * Initiate a delay if required\n * @param {Boolean} shouldDelay Whether or not a delay is in place\n * @param {Number} delay The delay value\n * @return {Promise} The promise that will be resolved after the delay\n * @hidden\n */\nexport const delay = async (shouldDelay = false, delay = 250): Promise<void> => {\n return new Promise((resolve) => {\n if (!shouldDelay) {\n return resolve();\n }\n setTimeout(resolve, delay);\n });\n};\n","import { FunctionalComponent, VNode, h } from '@stencil/core';\nimport { generateSVGImage } from 'utils/imageHelper';\nimport { height, svgPathData, width } from '@fortawesome/pro-light-svg-icons/faTimes';\n\n/**\n * @hidden\n */\ninterface IAlertCloseButtonProps {\n label: string;\n clickHandler: (evt: MouseEvent) => void;\n}\n\n/**\n * @return {FunctionalComponent} The close button\n */\nexport const AlertCloseButton: FunctionalComponent<IAlertCloseButtonProps> = ({ label, clickHandler }: IAlertCloseButtonProps) => {\n return (\n <button class={`c-alert__close`} aria-label={label} data-track=\"true\" data-track-value={label} onClick={clickHandler}>\n {generateSVGImage({ data: svgPathData, height, width })}\n </button>\n ) as VNode;\n};\n","import * as Pipeline from '../core/utils/pipeline';\nimport {\n AdsAlertErrors,\n AlertAnimationDirection,\n AlertAnimationDirections,\n AlertLevel,\n AlertLevels,\n VisibleChangeEvent,\n VisibleChangeHandler,\n} from './ads-alert.types';\nimport { AlertCloseButton } from './components/ads-alert-close-button/ads-alert-close-button';\nimport { BaseComponent } from '../core/interfaces/BaseComponent';\nimport { Component, Element, Event, EventEmitter, Host, Method, Prop, State, VNode, Watch, h } from '@stencil/core';\nimport { Dictionary } from '../core/classes/Dictionary';\nimport { delay, existValueInEnum, isNullOrUndefined, isNullOrUndefinedOrEmpty } from 'utils/index';\nimport { generateId, showErrorMessage } from '../core/utils/components';\n\n/**\n * Alerts provide contextual application-level messaging. Alerts classes indicate the state of the application and provide contextual information about what the user should do.\n * Alert text should be as short as possible, can include links and can be dismissed. There are 4 alert classes:\n * \"Default\" is used for informational messages where the user does not need to take immediate action.\n * \"Success\" is used to indicate the successful completion of a user action.\n * \"Warning\" is used to indicate a problem occurred completing the user action where further action may be necessary.\n * \"Danger\" is used to indicate failures where the user action could not be completed.\n * @tag `<ads-alert>`\n * @slot - Content rendered as rich text inside the component\n * @example\n * <ads-alert class=is-default>This alert indicates the default style</ads-alert>\n * <ads-alert class=is-success>This alert indicates success</ads-alert>\n * <ads-alert class=is-warning>This alert indicates warnings</ads-alert>\n * <ads-alert class=is-danger>This alert indicates failures</ads-alert>\n */\n@Component({\n tag: 'ads-alert',\n styleUrl: 'ads-alert.scss',\n shadow: true,\n})\nexport class AdsAlert implements BaseComponent {\n /**\n * @hidden\n */\n public component: string;\n\n constructor() {\n this.el.setAttribute('id', this.identifier || generateId('ads-alert'));\n this.component = 'ads-alert';\n Dictionary.registerComponent(this);\n }\n\n @Element() private el: HTMLAdsAlertElement;\n\n /**\n * @hidden\n */\n @State() isVisibleInternal = true;\n\n /**\n * The unique identifier (optional)\n */\n @Prop({ attribute: 'id' }) identifier?: string;\n\n /**\n * The animation direction (optional)\n */\n @Prop({ reflect: true }) animation?: AlertAnimationDirection;\n\n /**\n * The animation delay in milliseconds (optional)\n * @default 0\n */\n @Prop({ reflect: true }) animationDelay = 0;\n\n /**\n * Whether or not the alert is visible (optional)\n */\n @Prop({ reflect: true }) visible?: boolean;\n\n /**\n * Whether or not the alert has a close button (optional)\n * @default true\n */\n @Prop({ reflect: true }) hasCloseButton = true;\n\n /**\n * Whether the alert should notify the user (screen reader) immediately and interrupt on change, or wait until the screen reader is free (optional)\n * @default false\n */\n @Prop({ reflect: true }) isImportant = false;\n\n /**\n * The alert level (optional)\n */\n @Prop({ reflect: true }) level?: AlertLevel;\n\n /**\n * The alert content when not provided via a slot (optional)\n */\n @Prop({ reflect: true }) text?: string;\n\n /**\n * Callback function for visibleChange events (optional)\n */\n @Prop() visibleChangeHandler?: VisibleChangeHandler;\n\n /**\n * Emits the 'visibleChange' custom event, when an attempt to change the visibility is made\n * Usage: `document.querySelector('ads-alert').addEventListener('visibleChange', function(evt) {});`\n * @event\n */\n @Event({ bubbles: false }) visibleChange: EventEmitter<VisibleChangeEvent>;\n\n /**\n * Handle identifier property changes\n * @param {string} newValue The new value for \"identifier\"\n * @hidden\n */\n @Watch('identifier')\n handleIdentifierChange(newValue: string): void {\n this.el.setAttribute('id', newValue || generateId('ads-alert'));\n }\n\n /**\n * Handle visible property changes\n * @param {boolean} newValue The new value for \"visible\"\n * @hidden\n */\n @Watch('visible')\n handleVisibleChange(newValue: boolean): void {\n void this.handleVisibility(newValue);\n }\n\n /**\n * Called when animation prop changes\n * @param {AlertAnimationDirection} newValue new value\n * @hidden\n */\n @Watch('animation')\n onAnimationChanged(newValue: AlertAnimationDirection): void {\n if (newValue && !Object.values(AlertAnimationDirections).toString().includes(newValue)) {\n showErrorMessage(AdsAlertErrors.INVALID_ANIMATION_DIRECTION, this.el);\n }\n }\n\n /**\n * Called when level prop changes\n * @param {AlertLevel} newValue new value\n * @hidden\n */\n @Watch('level')\n onLevelChanged(newValue: AlertLevel): void {\n if (newValue && !Object.values(AlertLevels).toString().includes(newValue)) {\n showErrorMessage(AdsAlertErrors.INVALID_ALERT_LEVEL, this.el);\n }\n }\n\n /**\n * Called when animationDelay prop changes\n * @param {number} newValue new value\n * @hidden\n */\n @Watch('animationDelay')\n onAnimationDelayChanged(newValue: number): void {\n // wait for next frame in case this.animation is also going to update\n setTimeout(() => {\n if (newValue && !this.animation) {\n showErrorMessage(AdsAlertErrors.DELAY_SET_WITHOUT_ANIMATION, this.el);\n }\n }, 50);\n }\n\n /**\n * Opens the alert box\n * @return {Promise<void>} Opens the alert\n */\n @Method()\n open(): Promise<void> {\n return !this.isVisibleInternal ? this.handleVisibility(true) : null;\n }\n\n /**\n * Closes the alert box\n * @return {Promise<void>} Closes the alert\n */\n @Method()\n close(): Promise<void> {\n return this.isVisibleInternal ? this.handleVisibility(false) : null;\n }\n\n /**\n * Returns whether the alert is currently visible or not\n * @return {Promise<boolean>} Whether the alert is visible\n */\n @Method()\n value(): Promise<boolean> {\n return Promise.resolve(this.isVisibleInternal);\n }\n\n /**\n * Handles resolving the visibility change of the alert\n * @param {boolean} isVisible True if visible. False otherwise\n * @return {Promise<void>} Visibility promise\n * @hidden\n */\n private async handleVisibility(isVisible: boolean): Promise<void> {\n // Emit the event without updating anything.\n if (this.visible !== undefined && this.visible !== null && this.visible !== isVisible) {\n this.visibleChange.emit({ el: this.el, visible: isVisible });\n\n if (!isNullOrUndefined(this.visibleChangeHandler)) {\n this.visibleChangeHandler({ el: this.el, visible: isVisible });\n }\n\n return;\n }\n\n return new Promise((resolve) => {\n const alert = this.el.shadowRoot.querySelector('.c-alert');\n\n if (isVisible) {\n // Delay opening the box\n delay(!isNullOrUndefinedOrEmpty(this.animation) && this.animationDelay > 0, Math.abs(this.animationDelay))\n .then(() => {\n alert.classList.remove('is-hidden');\n alert.classList.remove('is-closed');\n\n // Delay sending the emit until the box disappears (500ms set in css)\n delay(!isNullOrUndefinedOrEmpty(this.animation), 500)\n .then(() => {\n this.isVisibleInternal = isVisible;\n\n if (this.visible !== this.isVisibleInternal) {\n this.visibleChange.emit({ el: this.el, visible: true });\n !isNullOrUndefined(this.visibleChangeHandler) ? this.visibleChangeHandler({ el: this.el, visible: true }) : null;\n }\n\n return resolve();\n })\n .catch(() => {\n return;\n });\n })\n .catch(() => {\n return;\n });\n } else if (isVisible === false) {\n alert.classList.add('is-closed');\n // Delay sending the emit until the box disappears (500ms set in css)\n delay(!isNullOrUndefinedOrEmpty(this.animation), 500)\n .then(() => {\n alert.classList.add('is-hidden');\n this.isVisibleInternal = isVisible;\n\n if (this.visible !== this.isVisibleInternal) {\n this.visibleChange.emit({ el: this.el, visible: false });\n !isNullOrUndefined(this.visibleChangeHandler) ? this.visibleChangeHandler({ el: this.el, visible: false }) : null;\n }\n\n return resolve();\n })\n .catch(() => {\n return;\n });\n }\n });\n }\n\n protected componentDidLoad(): void {\n Pipeline.addComponent(this.el);\n this.visible !== undefined && this.visible !== null && !this.visible ? void this.handleVisibility(false) : null;\n\n if (this.animation && !Object.values(AlertAnimationDirections).toString().includes(this.animation)) {\n showErrorMessage(AdsAlertErrors.INVALID_ANIMATION_DIRECTION, this.el);\n }\n\n if (this.level && !Object.values(AlertLevels).toString().includes(this.level)) {\n showErrorMessage(AdsAlertErrors.INVALID_ALERT_LEVEL, this.el);\n }\n\n if (this.animationDelay && isNullOrUndefinedOrEmpty(this.animation)) {\n showErrorMessage(AdsAlertErrors.DELAY_SET_WITHOUT_ANIMATION, this.el);\n }\n }\n\n protected disconnectedCallback(): void {\n Pipeline.removeComponent(this.el);\n }\n\n protected render(): VNode {\n // Generate the class list\n const classes = ['c-alert'];\n const isDialog = this.hasCloseButton;\n const hasAnimation = this.animation && existValueInEnum(AlertAnimationDirections, this.animation);\n if (hasAnimation) {\n classes.push(`is-animated is-animated-${this.animation}`);\n }\n\n // Generate the close button, if required\n const label = Dictionary.get('Dismiss message', 'DISMISS_MESSAGE');\n const closeButton = this.hasCloseButton ? ((<AlertCloseButton label={label} clickHandler={() => this.close()} />) as HTMLElement) : null;\n\n const attributes = {\n role: isDialog ? 'alertdialog' : 'alert',\n 'aria-describedby': isDialog ? `ads:alert:${this.identifier}` : null,\n 'aria-live': this.isImportant ? 'assertive' : 'polite',\n };\n\n const hostAttributes = {\n 'data-id': this.identifier,\n class: !isNullOrUndefinedOrEmpty(this.level) ? `is-${this.level}` : null,\n };\n\n return (\n <Host {...hostAttributes}>\n <div class={classes.join(' ')} {...attributes}>\n <div class=\"c-alert__container\">\n <div class=\"c-alert__text\" id={`ads:alert:${this.identifier}`}>\n {!isNullOrUndefinedOrEmpty(this.text) ? this.text : <slot />}\n </div>\n {closeButton}\n </div>\n </div>\n </Host>\n ) as VNode;\n }\n}\n","@import 'core';\n\n@import 'ads-alert.animations.scss';\n\n/**\n * @prop --ads-alert-background-color: Background color\n * @prop --ads-alert-background-color-danger: Danger background color\n * @prop --ads-alert-background-color-success: Success background color\n * @prop --ads-alert-background-color-warning: Warning background color\n *\n * @prop --ads-alert-color: Text color\n * @prop --ads-alert-color-danger: Danger text color\n * @prop --ads-alert-color-success: Success text color\n * @prop --ads-alert-color-warning: Warning text color\n *\n * @prop --ads-alert-z-index: Z-index layer height\n */\n\n::slotted(*) {\n display: inline-block !important;\n}\n\n:host {\n display: block;\n position: relative;\n width: 100%;\n z-index: var(--ads-alert-z-index, $ads-alert-z-index);\n}\n\n:host([theme='default']) {\n @include ads-vars-component-alert-default;\n}\n\n:host([theme='dark']) {\n @include ads-vars-component-alert-dark;\n}\n\n:host([dir='ltr']) {\n @include ads-vars-component-alert-ltr;\n}\n\n:host([dir='rtl']) {\n @include ads-vars-component-alert-rtl;\n}\n\n.c-alert {\n background-color: var(--ads-alert-background-color, $ads-alert-background-color);\n box-sizing: border-box;\n color: var(--ads-alert-color, $ads-alert-color);\n fill: var(--ads-alert-color, $ads-alert-color);\n display: block !important;\n max-height: $ads-alert-animation-max-height;\n opacity: 1;\n position: relative;\n text-align: center;\n width: 100%;\n z-index: inherit;\n\n &.is-closed {\n pointer-events: none;\n }\n\n &.is-hidden {\n display: none !important;\n }\n\n &:not(.is-animated).is-closed {\n display: none !important;\n }\n\n &__container {\n background: transparent;\n }\n\n &.is-animated {\n animation-duration: 1s;\n }\n\n &.is-animated:not(.is-closed) {\n animation-name: animate-height-increase;\n }\n\n &.is-closed.is-animated {\n animation-duration: $ads-alert-animation-duration;\n animation-name: animate-height-decrease;\n max-height: 0;\n }\n\n &.is-animated &__container {\n animation-duration: $ads-alert-animation-duration;\n }\n\n &.is-animated-up &__container {\n animation-name: animate-up;\n }\n\n &.is-animated-down &__container {\n animation-name: animate-down;\n }\n\n &.is-closed.is-animated &__container {\n opacity: 0;\n }\n\n &.is-closed.is-animated-down &__container {\n animation-name: animate-down-closed;\n transform: translateY(-$ads-alert-animation-offset);\n }\n\n &.is-closed.is-animated-up &__container {\n animation-name: animate-up-closed;\n transform: translateY($ads-alert-animation-offset);\n }\n\n &__text {\n color: inherit;\n font-family: var(--ads-font-family);\n font-size: 16px;\n margin: 0 auto;\n max-width: $ads-container-breakpoint-xl;\n padding: 16px 58px;\n }\n\n &__close {\n align-items: center;\n background: transparent;\n border: none;\n cursor: pointer;\n display: flex;\n fill: inherit;\n height: 44px;\n justify-content: center;\n left: var(--ads-alert-close-button-left, $ads-alert-close-button-left-ltr);\n position: absolute;\n right: var(--ads-alert-close-button-right, $ads-alert-close-button-right-ltr);\n text-overflow: clip;\n top: 4px;\n width: 44px;\n\n svg {\n height: 20px;\n width: 20px;\n }\n\n &:active {\n color: inherit;\n }\n }\n}\n\n:host(.is-success) .c-alert {\n background-color: var(--ads-alert-background-color-success, $ads-alert-background-color-success);\n color: var(--ads-alert-color-success, $ads-alert-color-success);\n fill: var(--ads-alert-color-success, $ads-alert-color-success);\n}\n\n:host(.is-warning) .c-alert {\n background-color: var(--ads-alert-background-color-warning, $ads-alert-background-color-warning);\n color: var(--ads-alert-color-warning, $ads-alert-color-warning);\n fill: var(--ads-alert-color-success, $ads-alert-color-success);\n}\n\n:host(.is-danger) .c-alert {\n background-color: var(--ads-alert-background-color-danger, $ads-alert-background-color-danger);\n color: var(--ads-alert-color-danger, $ads-alert-color-danger);\n fill: var(--ads-alert-color-success, $ads-alert-color-success);\n}\n","import { EventTypes, environment, version } from './AppInsights/constants';\nimport { WindowGlobal } from '../types/globalTypes';\n\n/**\n * Send custom event to AppInsights\n * @param {string} component The reference to the component\n * @returns {void}\n * @hidden\n */\nconst sendCustomEvent = (component: HTMLElement): void => {\n try {\n (window as WindowGlobal)['AppInsights'].trackEvent(\n {\n name: EventTypes.COMPONENT_REGISTER,\n },\n {\n component: component.tagName.toLowerCase(),\n componentId: component.id,\n environment,\n version,\n host: window.location.host,\n }\n );\n } catch (err) {\n // eslint-disable-next-line no-console\n console.log('[APP INSIGHTS] Could not send event', err);\n }\n};\n\n/**\n * Add the component to the pipeline and send component events to AppInsights\n * @param {HTMLElement} component The component element\n * @returns {void}\n * @hidden\n */\nexport function add(component: HTMLElement): void {\n (window as WindowGlobal)['ArmDesignSystem'].pipeline.set(component.id, component.tagName.toLowerCase());\n\n // Disable sending events to AppInsights during unit tests\n if (!(window as WindowGlobal)['ArmDesignSystem'].config.getBoolean('_isTesting')) {\n sendCustomEvent(component);\n }\n}\n\n/**\n * Remove the component from the pipeline\n * @param {HTMLElement} component The component element\n * @returns {void}\n * @hidden\n */\nexport function remove(component: HTMLElement): void {\n (window as WindowGlobal)['ArmDesignSystem'].pipeline.delete(component.id);\n}\n","import * as Pipeline from '../global/pipeline';\n\n/**\n * Add a component to the ADS pipeline\n * @param {HTMLElement} component The component element\n * @return {void}\n */\nexport const addComponent = (component: HTMLElement): void => {\n Pipeline.add(component);\n};\n\n/**\n * Remove a component from the ADS pipeline\n * @param {HTMLElement} component The component element\n * @return {void}\n */\nexport const removeComponent = (component: HTMLElement): void => {\n Pipeline.remove(component);\n};\n","import { Breakpoint, ButtonLevel, ButtonLevels, ButtonSize, ButtonSizes, WindowGlobal } from '../types/globalTypes';\nimport { EventTypes, environment, version } from '../global/AppInsights/constants';\n\nexport type ShadowRootLegacy = ShadowRoot & { tagName: string };\n\n/**\n * Generates a unique component ID\n * @param {string} namespace The unique id's namespace (e.g. ads)\n * @returns {string} A generated random id (e.g. ads-1234)\n */\nexport const generateId = (namespace = 'ads'): string => {\n return `${namespace}-${generateRandomString()}`;\n};\n\n/**\n * Generates a randon string\n * @returns {string} A generated random string\n */\nexport const generateRandomString = (): string => {\n return Math.random().toString(36).substr(2, 16);\n};\n\n/**\n * Generates a size class based on a button size\n * @param {ButtonSize} size The size of the button (e.g. ButtonSizes.SMALL)\n * @returns {string} The button size class (e.g. 'is-small')\n */\nexport const getClassFromSize = (size: ButtonSize): string => {\n switch (size) {\n case ButtonSizes.MEDIUM:\n return 'is-medium';\n case ButtonSizes.SMALL:\n return 'is-small';\n default:\n return '';\n }\n};\n\n/**\n * Generates a level class based on button a level\n * @param {ButtonLevel} level The level of the button (e.g. ButtonLevels.PRIMARY)\n * @returns {string} The button level class (e.g. 'is-primary')\n */\nexport const getClassFromLevel = (level: ButtonLevel): string => {\n switch (level) {\n case ButtonLevels.PRIMARY:\n return 'is-primary';\n case ButtonLevels.SECONDARY:\n return 'is-secondary';\n case ButtonLevels.TERTIARY:\n return 'is-tertiary';\n default:\n return '';\n }\n};\n\n/**\n * Given a breakpoint it will return the appropriate class for the media-queries (breakpoints-up).\n * @param {Breakpoint} bp The breakpoint.\n * @returns {string} The class.\n */\nexport const getMediaQueryBreakpointClassUp = (bp: Breakpoint): string => `${bp.toString()}-up`;\n\n/**\n * Given a breakpoint it will return the appropriate class for the media-queries (breakpoints-down).\n * @param {Breakpoint} bp The breakpoint.\n * @returns {string} The class.\n */\nexport const getMediaQueryBreakpointClassDown = (bp: Breakpoint): string => `${bp.toString()}-down`;\n\n/**\n * Display an ADS warning with the given message\n * @param {string} message The error message to show\n * @param {string} component The reference to the component\n * @returns {void}\n */\nexport const showErrorMessage = (message: string, component: HTMLElement): void => {\n try {\n (window as WindowGlobal)['AppInsights'].trackEvent(\n {\n name: EventTypes.ADS_CONSOLE_ERROR as string,\n },\n {\n component: component.tagName.toLowerCase(),\n componentId: component.id,\n message: message,\n environment,\n version,\n host: window.location.host,\n }\n );\n } catch (err) {\n // eslint-disable-next-line no-console\n console.log('[APP INSIGHTS] Could not send console error', err);\n }\n // eslint-disable-next-line no-console\n console.warn(`ADS-Warning: ${message}`);\n};\n","import { SVGIconData } from '../components/core/interfaces/Icon';\nimport { h } from '@stencil/core';\n\n/**\n * Generates an SVG image\n * @param {IconData} icon The SVG image properties\n * @param {string} className The SVG image class name\n * @returns {HTMLElement} The generated SVG image\n */\nexport const generateSVGImage = (icon: SVGIconData, className?: string): HTMLElement => {\n return (\n <svg class={className ? className : null} xmlns=\"http://www.w3.org/2000/svg\" viewBox={`0 0 ${icon.width} ${icon.height}`}>\n <path d={icon.data} />\n </svg>\n ) as HTMLElement;\n};\n","import { Breakpoint } from '../components/core/types/globalTypes';\nimport { isNullOrUndefined } from './collection';\nimport config from './../styles/settings/configs/breakpoints-config.json';\n\n/**\n * Match media types\n */\nexport enum MediaTypes {\n minWidth = 'min-width',\n maxWidth = 'max-width',\n}\n\n/**\n * Returns the list all of breakpoint keys\n * @returns {Breakpoint[]} The list of breakpoints\n */\nexport const getBreakpoints = (): Breakpoint[] => Object.keys(config.breakpoints) as Breakpoint[];\n\n/**\n * Returns the breakpoint in pixels\n * @param {Breakpoint} breakpoint The breakpoint\n * @returns {number} The breakpoint value in pixels\n */\nexport const getBreakpointInPixels = (breakpoint: Breakpoint): number => parseInt(config.breakpoints[breakpoint], 10);\n\n/**\n * Returns the breakpoint key for given pixels\n * @param {number} pixels The pixels of the breakpoint\n * @returns {Breakpoint} The breakpoint key\n */\nexport const getBreakpointFromPixels = (pixels: number): Breakpoint =>\n Object.keys(config.breakpoints)[\n Object.values(config.breakpoints)\n .map((bp) => parseInt(bp, 10))\n .findIndex((bpPixels) => bpPixels === pixels)\n ] as Breakpoint;\n\nconst mediaQueryLists: MediaQueryList[] = [];\n\n/**\n * Adds matchMedia to window with the given properties.\n * @param {MediaTypes} mediaType The type of media\n * @param {Sizes} breakpoint The media size\n * @param {Function} listenerFunction Callback function for the listener\n */\nexport const addMatchMedia = (\n mediaType: MediaTypes,\n breakpoint: Breakpoint,\n listenerFunction: (this: MediaQueryList, ev: MediaQueryListEvent) => unknown\n): void => {\n const foundMatchMedia = mediaQueryLists.find((m) => m.media === `(${mediaType}: ${config.breakpoints[breakpoint]})`);\n if (!isNullOrUndefined(foundMatchMedia)) {\n foundMatchMedia.addEventListener('change', listenerFunction);\n } else {\n const newMatchMedia = window.matchMedia(`(${mediaType}: ${config.breakpoints[breakpoint]})`);\n mediaQueryLists.push(newMatchMedia);\n newMatchMedia.addEventListener('change', listenerFunction);\n }\n};\n\n/**\n * Removes matchMedia from window with the given properties.\n * @param {MediaTypes} mediaType The type of media\n * @param {Sizes} breakpoint The media size\n * @param {Function} listenerFunction Callback function to be removed from the listener\n */\nexport const removeMatchMedia = (\n mediaType: MediaTypes,\n breakpoint: Breakpoint,\n listenerFunction: (this: MediaQueryList, ev: MediaQueryListEvent) => unknown\n): void => {\n mediaQueryLists.find((m) => m.media === `(${mediaType}: ${config.breakpoints[breakpoint]})`)?.removeEventListener('change', listenerFunction);\n};\n\n/**\n * Matches the current window with the given media type and breakpoint\n * @param {MediaTypes} mediaType The media type\n * @param {Breakpoint} breakpoint The breakpoint\n * @returns {boolean} True if it matches, false otherwise\n */\nexport const mediaMatchingBreakpoint = (mediaType: MediaTypes, breakpoint: Breakpoint): boolean => {\n const foundMatchMedia = mediaQueryLists.find((m) => m.media === `(${mediaType}: ${config.breakpoints[breakpoint]})`);\n if (!isNullOrUndefined(foundMatchMedia)) {\n return foundMatchMedia.matches;\n }\n const newMatchMedia = window.matchMedia(`(${mediaType}: ${config.breakpoints[breakpoint]})`);\n mediaQueryLists.push(newMatchMedia);\n return newMatchMedia.matches;\n};\n","import { isNullOrUndefined } from './collection';\n\ninterface ResizeCallback {\n callback: () => void;\n duration: number;\n timeout?: NodeJS.Timeout;\n}\n\nconst defaultTimeout = 50;\n\nconst callbacks: ResizeCallback[] = [];\n\nwindow.onresize = () => {\n callbacks.map((cb: ResizeCallback) => {\n if (isNullOrUndefined(cb.timeout)) {\n cb.callback();\n cb.timeout = setTimeout(() => {\n cb.timeout = null;\n }, cb.duration);\n }\n });\n};\n\n/**\n * Subscribe to the resize listener\n * @param {function} callback The callback function to run on resize\n * @param {number} timeoutDuration The throttle timeout duration\n */\nexport const subscribeToWindowResize = (callback: () => void, timeoutDuration: number = defaultTimeout): void => {\n callbacks.push({ callback, duration: timeoutDuration });\n};\n\n/**\n * Unsubscribe to the resize listener\n * @param {function} callback The callback function to unsubscribe\n */\nexport const unSubscribeToWindowResize = (callback: () => void): void => {\n const index = callbacks.findIndex((cb: ResizeCallback) => cb.callback === callback);\n if (index >= 0) {\n if (!isNullOrUndefined(callbacks[index].timeout)) {\n clearTimeout(callbacks[index].timeout);\n }\n callbacks.splice(index, 1);\n }\n};\n","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fal';\nvar iconName = 'xmark';\nvar width = 384;\nvar height = 512;\nvar aliases = [128473,10005,10006,10060,215,\"close\",\"multiply\",\"remove\",\"times\"];\nvar unicode = 'f00d';\nvar svgPathData = 'M324.5 411.1c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6L214.6 256 347.1 123.5c6.2-6.2 6.2-16.4 0-22.6s-16.4-6.2-22.6 0L192 233.4 59.5 100.9c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6L169.4 256 36.9 388.5c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0L192 278.6 324.5 411.1z';\n\nexports.definition = {\n prefix: prefix,\n iconName: iconName,\n icon: [\n width,\n height,\n aliases,\n unicode,\n svgPathData\n ]};\n\nexports.faXmark = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar source = require('./faXmark');\nexports.definition = {\n prefix: source.prefix,\n iconName: source.iconName,\n icon: [\n source.width,\n source.height,\n source.aliases,\n source.unicode,\n source.svgPathData\n ]};\n\nexports.faTimes = exports.definition;\nexports.prefix = source.prefix;\nexports.iconName = source.iconName;\nexports.width = source.width;\nexports.height = source.height;\nexports.ligatures = source.aliases;\nexports.unicode = source.unicode;\nexports.svgPathData = source.svgPathData;\nexports.aliases = source.aliases;"],"sourceRoot":""}