blob: 8bec04cc5cb3cb3f2b5268b4320af1344bce219e [file] [log] [blame]
{"version":3,"file":"a11y.es5.js","sources":["../../../src/cdk/a11y/a11y-module.ts","../../../src/cdk/a11y/fake-mousedown.ts","../../../src/cdk/a11y/focus-monitor/focus-monitor.ts","../../../src/cdk/a11y/live-announcer/live-announcer.ts","../../../src/cdk/a11y/live-announcer/live-announcer-tokens.ts","../../../src/cdk/a11y/focus-trap/focus-trap.ts","../../../src/cdk/a11y/interactivity-checker/interactivity-checker.ts","../../../src/cdk/a11y/key-manager/focus-key-manager.ts","../../../src/cdk/a11y/key-manager/activedescendant-key-manager.ts","../../../src/cdk/a11y/key-manager/list-key-manager.ts","../../../src/cdk/a11y/aria-describer/aria-describer.ts","../../../src/cdk/a11y/aria-describer/aria-reference.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\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://angular.io/license\n */\n\nimport {ObserversModule} from '@angular/cdk/observers';\nimport {PlatformModule} from '@angular/cdk/platform';\nimport {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {CdkMonitorFocus} from './focus-monitor/focus-monitor';\nimport {CdkTrapFocus} from './focus-trap/focus-trap';\nimport {CdkAriaLive} from './live-announcer/live-announcer';\n\n@NgModule({\n imports: [CommonModule, PlatformModule, ObserversModule],\n declarations: [CdkAriaLive, CdkTrapFocus, CdkMonitorFocus],\n exports: [CdkAriaLive, CdkTrapFocus, CdkMonitorFocus],\n})\nexport class A11yModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\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://angular.io/license\n */\n\n/**\n * Screenreaders will often fire fake mousedown events when a focusable element\n * is activated using the keyboard. We can typically distinguish between these faked\n * mousedown events and real mousedown events using the \"buttons\" property. While\n * real mousedowns will indicate the mouse button that was pressed (e.g. \"1\" for\n * the left mouse button), faked mousedowns will usually set the property value to 0.\n */\nexport function isFakeMousedownFromScreenReader(event: MouseEvent): boolean {\n return event.buttons === 0;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\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://angular.io/license\n */\n\nimport {Platform, normalizePassiveListenerOptions} from '@angular/cdk/platform';\nimport {\n Directive,\n ElementRef,\n EventEmitter,\n Injectable,\n NgZone,\n OnDestroy,\n Optional,\n Output,\n SkipSelf,\n} from '@angular/core';\nimport {Observable, of as observableOf, Subject, Subscription} from 'rxjs';\nimport {coerceElement} from '@angular/cdk/coercion';\n\n\n// This is the value used by AngularJS Material. Through trial and error (on iPhone 6S) they found\n// that a value of around 650ms seems appropriate.\nexport const TOUCH_BUFFER_MS = 650;\n\n\nexport type FocusOrigin = 'touch' | 'mouse' | 'keyboard' | 'program' | null;\n\n/**\n * Corresponds to the options that can be passed to the native `focus` event.\n * via https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus\n */\nexport interface FocusOptions {\n /** Whether the browser should scroll to the element when it is focused. */\n preventScroll?: boolean;\n}\n\ntype MonitoredElementInfo = {\n unlisten: Function,\n checkChildren: boolean,\n subject: Subject<FocusOrigin>\n};\n\n/**\n * Event listener options that enable capturing and also\n * mark the listener as passive if the browser supports it.\n */\nconst captureEventListenerOptions = normalizePassiveListenerOptions({\n passive: true,\n capture: true\n});\n\n\n/** Monitors mouse and keyboard events to determine the cause of focus events. */\n@Injectable({providedIn: 'root'})\nexport class FocusMonitor implements OnDestroy {\n /** The focus origin that the next focus event is a result of. */\n private _origin: FocusOrigin = null;\n\n /** The FocusOrigin of the last focus event tracked by the FocusMonitor. */\n private _lastFocusOrigin: FocusOrigin;\n\n /** Whether the window has just been focused. */\n private _windowFocused = false;\n\n /** The target of the last touch event. */\n private _lastTouchTarget: EventTarget | null;\n\n /** The timeout id of the touch timeout, used to cancel timeout later. */\n private _touchTimeoutId: number;\n\n /** The timeout id of the window focus timeout. */\n private _windowFocusTimeoutId: number;\n\n /** The timeout id of the origin clearing timeout. */\n private _originTimeoutId: number;\n\n /** Map of elements being monitored to their info. */\n private _elementInfo = new Map<HTMLElement, MonitoredElementInfo>();\n\n /** The number of elements currently being monitored. */\n private _monitoredElementCount = 0;\n\n /**\n * Event listener for `keydown` events on the document.\n * Needs to be an arrow function in order to preserve the context when it gets bound.\n */\n private _documentKeydownListener = () => {\n // On keydown record the origin and clear any touch event that may be in progress.\n this._lastTouchTarget = null;\n this._setOriginForCurrentEventQueue('keyboard');\n }\n\n /**\n * Event listener for `mousedown` events on the document.\n * Needs to be an arrow function in order to preserve the context when it gets bound.\n */\n private _documentMousedownListener = () => {\n // On mousedown record the origin only if there is not touch\n // target, since a mousedown can happen as a result of a touch event.\n if (!this._lastTouchTarget) {\n this._setOriginForCurrentEventQueue('mouse');\n }\n }\n\n /**\n * Event listener for `touchstart` events on the document.\n * Needs to be an arrow function in order to preserve the context when it gets bound.\n */\n private _documentTouchstartListener = (event: TouchEvent) => {\n // When the touchstart event fires the focus event is not yet in the event queue. This means\n // we can't rely on the trick used above (setting timeout of 1ms). Instead we wait 650ms to\n // see if a focus happens.\n if (this._touchTimeoutId != null) {\n clearTimeout(this._touchTimeoutId);\n }\n this._lastTouchTarget = event.target;\n this._touchTimeoutId = setTimeout(() => this._lastTouchTarget = null, TOUCH_BUFFER_MS);\n }\n\n /**\n * Event listener for `focus` events on the window.\n * Needs to be an arrow function in order to preserve the context when it gets bound.\n */\n private _windowFocusListener = () => {\n // Make a note of when the window regains focus, so we can\n // restore the origin info for the focused element.\n this._windowFocused = true;\n this._windowFocusTimeoutId = setTimeout(() => this._windowFocused = false);\n }\n\n constructor(private _ngZone: NgZone, private _platform: Platform) {}\n\n /**\n * Monitors focus on an element and applies appropriate CSS classes.\n * @param element The element to monitor\n * @param checkChildren Whether to count the element as focused when its children are focused.\n * @returns An observable that emits when the focus state of the element changes.\n * When the element is blurred, null will be emitted.\n */\n monitor(element: HTMLElement, checkChildren?: boolean): Observable<FocusOrigin>;\n\n /**\n * Monitors focus on an element and applies appropriate CSS classes.\n * @param element The element to monitor\n * @param checkChildren Whether to count the element as focused when its children are focused.\n * @returns An observable that emits when the focus state of the element changes.\n * When the element is blurred, null will be emitted.\n */\n monitor(element: ElementRef<HTMLElement>, checkChildren?: boolean): Observable<FocusOrigin>;\n\n monitor(element: HTMLElement | ElementRef<HTMLElement>,\n checkChildren: boolean = false): Observable<FocusOrigin> {\n // Do nothing if we're not on the browser platform.\n if (!this._platform.isBrowser) {\n return observableOf(null);\n }\n\n const nativeElement = coerceElement(element);\n\n // Check if we're already monitoring this element.\n if (this._elementInfo.has(nativeElement)) {\n let cachedInfo = this._elementInfo.get(nativeElement);\n cachedInfo!.checkChildren = checkChildren;\n return cachedInfo!.subject.asObservable();\n }\n\n // Create monitored element info.\n let info: MonitoredElementInfo = {\n unlisten: () => {},\n checkChildren: checkChildren,\n subject: new Subject<FocusOrigin>()\n };\n this._elementInfo.set(nativeElement, info);\n this._incrementMonitoredElementCount();\n\n // Start listening. We need to listen in capture phase since focus events don't bubble.\n let focusListener = (event: FocusEvent) => this._onFocus(event, nativeElement);\n let blurListener = (event: FocusEvent) => this._onBlur(event, nativeElement);\n this._ngZone.runOutsideAngular(() => {\n nativeElement.addEventListener('focus', focusListener, true);\n nativeElement.addEventListener('blur', blurListener, true);\n });\n\n // Create an unlisten function for later.\n info.unlisten = () => {\n nativeElement.removeEventListener('focus', focusListener, true);\n nativeElement.removeEventListener('blur', blurListener, true);\n };\n\n return info.subject.asObservable();\n }\n\n /**\n * Stops monitoring an element and removes all focus classes.\n * @param element The element to stop monitoring.\n */\n stopMonitoring(element: HTMLElement): void;\n\n /**\n * Stops monitoring an element and removes all focus classes.\n * @param element The element to stop monitoring.\n */\n stopMonitoring(element: ElementRef<HTMLElement>): void;\n\n stopMonitoring(element: HTMLElement | ElementRef<HTMLElement>): void {\n const nativeElement = coerceElement(element);\n const elementInfo = this._elementInfo.get(nativeElement);\n\n if (elementInfo) {\n elementInfo.unlisten();\n elementInfo.subject.complete();\n\n this._setClasses(nativeElement);\n this._elementInfo.delete(nativeElement);\n this._decrementMonitoredElementCount();\n }\n }\n\n /**\n * Focuses the element via the specified focus origin.\n * @param element Element to focus.\n * @param origin Focus origin.\n * @param options Options that can be used to configure the focus behavior.\n */\n focusVia(element: HTMLElement, origin: FocusOrigin, options?: FocusOptions): void;\n\n /**\n * Focuses the element via the specified focus origin.\n * @param element Element to focus.\n * @param origin Focus origin.\n * @param options Options that can be used to configure the focus behavior.\n */\n focusVia(element: ElementRef<HTMLElement>, origin: FocusOrigin, options?: FocusOptions): void;\n\n focusVia(element: HTMLElement | ElementRef<HTMLElement>,\n origin: FocusOrigin,\n options?: FocusOptions): void {\n\n const nativeElement = coerceElement(element);\n\n this._setOriginForCurrentEventQueue(origin);\n\n // `focus` isn't available on the server\n if (typeof nativeElement.focus === 'function') {\n // Cast the element to `any`, because the TS typings don't have the `options` parameter yet.\n (nativeElement as any).focus(options);\n }\n }\n\n ngOnDestroy() {\n this._elementInfo.forEach((_info, element) => this.stopMonitoring(element));\n }\n\n private _toggleClass(element: Element, className: string, shouldSet: boolean) {\n if (shouldSet) {\n element.classList.add(className);\n } else {\n element.classList.remove(className);\n }\n }\n\n /**\n * Sets the focus classes on the element based on the given focus origin.\n * @param element The element to update the classes on.\n * @param origin The focus origin.\n */\n private _setClasses(element: HTMLElement, origin?: FocusOrigin): void {\n const elementInfo = this._elementInfo.get(element);\n\n if (elementInfo) {\n this._toggleClass(element, 'cdk-focused', !!origin);\n this._toggleClass(element, 'cdk-touch-focused', origin === 'touch');\n this._toggleClass(element, 'cdk-keyboard-focused', origin === 'keyboard');\n this._toggleClass(element, 'cdk-mouse-focused', origin === 'mouse');\n this._toggleClass(element, 'cdk-program-focused', origin === 'program');\n }\n }\n\n /**\n * Sets the origin and schedules an async function to clear it at the end of the event queue.\n * @param origin The origin to set.\n */\n private _setOriginForCurrentEventQueue(origin: FocusOrigin): void {\n this._ngZone.runOutsideAngular(() => {\n this._origin = origin;\n // Sometimes the focus origin won't be valid in Firefox because Firefox seems to focus *one*\n // tick after the interaction event fired. To ensure the focus origin is always correct,\n // the focus origin will be determined at the beginning of the next tick.\n this._originTimeoutId = setTimeout(() => this._origin = null, 1);\n });\n }\n\n /**\n * Checks whether the given focus event was caused by a touchstart event.\n * @param event The focus event to check.\n * @returns Whether the event was caused by a touch.\n */\n private _wasCausedByTouch(event: FocusEvent): boolean {\n // Note(mmalerba): This implementation is not quite perfect, there is a small edge case.\n // Consider the following dom structure:\n //\n // <div #parent tabindex=\"0\" cdkFocusClasses>\n // <div #child (click)=\"#parent.focus()\"></div>\n // </div>\n //\n // If the user touches the #child element and the #parent is programmatically focused as a\n // result, this code will still consider it to have been caused by the touch event and will\n // apply the cdk-touch-focused class rather than the cdk-program-focused class. This is a\n // relatively small edge-case that can be worked around by using\n // focusVia(parentEl, 'program') to focus the parent element.\n //\n // If we decide that we absolutely must handle this case correctly, we can do so by listening\n // for the first focus event after the touchstart, and then the first blur event after that\n // focus event. When that blur event fires we know that whatever follows is not a result of the\n // touchstart.\n let focusTarget = event.target;\n return this._lastTouchTarget instanceof Node && focusTarget instanceof Node &&\n (focusTarget === this._lastTouchTarget || focusTarget.contains(this._lastTouchTarget));\n }\n\n /**\n * Handles focus events on a registered element.\n * @param event The focus event.\n * @param element The monitored element.\n */\n private _onFocus(event: FocusEvent, element: HTMLElement) {\n // NOTE(mmalerba): We currently set the classes based on the focus origin of the most recent\n // focus event affecting the monitored element. If we want to use the origin of the first event\n // instead we should check for the cdk-focused class here and return if the element already has\n // it. (This only matters for elements that have includesChildren = true).\n\n // If we are not counting child-element-focus as focused, make sure that the event target is the\n // monitored element itself.\n const elementInfo = this._elementInfo.get(element);\n if (!elementInfo || (!elementInfo.checkChildren && element !== event.target)) {\n return;\n }\n\n // If we couldn't detect a cause for the focus event, it's due to one of three reasons:\n // 1) The window has just regained focus, in which case we want to restore the focused state of\n // the element from before the window blurred.\n // 2) It was caused by a touch event, in which case we mark the origin as 'touch'.\n // 3) The element was programmatically focused, in which case we should mark the origin as\n // 'program'.\n let origin = this._origin;\n if (!origin) {\n if (this._windowFocused && this._lastFocusOrigin) {\n origin = this._lastFocusOrigin;\n } else if (this._wasCausedByTouch(event)) {\n origin = 'touch';\n } else {\n origin = 'program';\n }\n }\n\n this._setClasses(element, origin);\n this._emitOrigin(elementInfo.subject, origin);\n this._lastFocusOrigin = origin;\n }\n\n /**\n * Handles blur events on a registered element.\n * @param event The blur event.\n * @param element The monitored element.\n */\n _onBlur(event: FocusEvent, element: HTMLElement) {\n // If we are counting child-element-focus as focused, make sure that we aren't just blurring in\n // order to focus another child of the monitored element.\n const elementInfo = this._elementInfo.get(element);\n\n if (!elementInfo || (elementInfo.checkChildren && event.relatedTarget instanceof Node &&\n element.contains(event.relatedTarget))) {\n return;\n }\n\n this._setClasses(element);\n this._emitOrigin(elementInfo.subject, null);\n }\n\n private _emitOrigin(subject: Subject<FocusOrigin>, origin: FocusOrigin) {\n this._ngZone.run(() => subject.next(origin));\n }\n\n private _incrementMonitoredElementCount() {\n // Register global listeners when first element is monitored.\n if (++this._monitoredElementCount == 1 && this._platform.isBrowser) {\n // Note: we listen to events in the capture phase so we\n // can detect them even if the user stops propagation.\n this._ngZone.runOutsideAngular(() => {\n document.addEventListener('keydown', this._documentKeydownListener,\n captureEventListenerOptions);\n document.addEventListener('mousedown', this._documentMousedownListener,\n captureEventListenerOptions);\n document.addEventListener('touchstart', this._documentTouchstartListener,\n captureEventListenerOptions);\n window.addEventListener('focus', this._windowFocusListener);\n });\n }\n }\n\n private _decrementMonitoredElementCount() {\n // Unregister global listeners when last element is unmonitored.\n if (!--this._monitoredElementCount) {\n document.removeEventListener('keydown', this._documentKeydownListener,\n captureEventListenerOptions);\n document.removeEventListener('mousedown', this._documentMousedownListener,\n captureEventListenerOptions);\n document.removeEventListener('touchstart', this._documentTouchstartListener,\n captureEventListenerOptions);\n window.removeEventListener('focus', this._windowFocusListener);\n\n // Clear timeouts for all potentially pending timeouts to prevent the leaks.\n clearTimeout(this._windowFocusTimeoutId);\n clearTimeout(this._touchTimeoutId);\n clearTimeout(this._originTimeoutId);\n }\n }\n}\n\n\n/**\n * Directive that determines how a particular element was focused (via keyboard, mouse, touch, or\n * programmatically) and adds corresponding classes to the element.\n *\n * There are two variants of this directive:\n * 1) cdkMonitorElementFocus: does not consider an element to be focused if one of its children is\n * focused.\n * 2) cdkMonitorSubtreeFocus: considers an element focused if it or any of its children are focused.\n */\n@Directive({\n selector: '[cdkMonitorElementFocus], [cdkMonitorSubtreeFocus]',\n})\nexport class CdkMonitorFocus implements OnDestroy {\n private _monitorSubscription: Subscription;\n @Output() cdkFocusChange = new EventEmitter<FocusOrigin>();\n\n constructor(private _elementRef: ElementRef<HTMLElement>, private _focusMonitor: FocusMonitor) {\n this._monitorSubscription = this._focusMonitor.monitor(\n this._elementRef,\n this._elementRef.nativeElement.hasAttribute('cdkMonitorSubtreeFocus'))\n .subscribe(origin => this.cdkFocusChange.emit(origin));\n }\n\n ngOnDestroy() {\n this._focusMonitor.stopMonitoring(this._elementRef);\n this._monitorSubscription.unsubscribe();\n }\n}\n\n/** @docs-private @deprecated @breaking-change 8.0.0 */\nexport function FOCUS_MONITOR_PROVIDER_FACTORY(\n parentDispatcher: FocusMonitor, ngZone: NgZone, platform: Platform) {\n return parentDispatcher || new FocusMonitor(ngZone, platform);\n}\n\n/** @docs-private @deprecated @breaking-change 8.0.0 */\nexport const FOCUS_MONITOR_PROVIDER = {\n // If there is already a FocusMonitor available, use that. Otherwise, provide a new one.\n provide: FocusMonitor,\n deps: [[new Optional(), new SkipSelf(), FocusMonitor], NgZone, Platform],\n useFactory: FOCUS_MONITOR_PROVIDER_FACTORY\n};\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\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://angular.io/license\n */\n\nimport {ContentObserver} from '@angular/cdk/observers';\nimport {DOCUMENT} from '@angular/common';\nimport {\n Directive,\n ElementRef,\n Inject,\n Injectable,\n Input,\n NgZone,\n OnDestroy,\n Optional,\n Provider,\n SkipSelf,\n} from '@angular/core';\nimport {Subscription} from 'rxjs';\nimport {\n AriaLivePoliteness,\n LiveAnnouncerDefaultOptions,\n LIVE_ANNOUNCER_ELEMENT_TOKEN,\n LIVE_ANNOUNCER_DEFAULT_OPTIONS,\n} from './live-announcer-tokens';\n\n\n@Injectable({providedIn: 'root'})\nexport class LiveAnnouncer implements OnDestroy {\n private _liveElement: HTMLElement;\n private _document: Document;\n private _previousTimeout?: number;\n\n constructor(\n @Optional() @Inject(LIVE_ANNOUNCER_ELEMENT_TOKEN) elementToken: any,\n private _ngZone: NgZone,\n @Inject(DOCUMENT) _document: any,\n @Optional() @Inject(LIVE_ANNOUNCER_DEFAULT_OPTIONS)\n private _defaultOptions?: LiveAnnouncerDefaultOptions) {\n\n // We inject the live element and document as `any` because the constructor signature cannot\n // reference browser globals (HTMLElement, Document) on non-browser environments, since having\n // a class decorator causes TypeScript to preserve the constructor signature types.\n this._document = _document;\n this._liveElement = elementToken || this._createLiveElement();\n }\n\n /**\n * Announces a message to screenreaders.\n * @param message Message to be announced to the screenreader.\n * @returns Promise that will be resolved when the message is added to the DOM.\n */\n announce(message: string): Promise<void>;\n\n /**\n * Announces a message to screenreaders.\n * @param message Message to be announced to the screenreader.\n * @param politeness The politeness of the announcer element.\n * @returns Promise that will be resolved when the message is added to the DOM.\n */\n announce(message: string, politeness?: AriaLivePoliteness): Promise<void>;\n\n /**\n * Announces a message to screenreaders.\n * @param message Message to be announced to the screenreader.\n * @param duration Time in milliseconds after which to clear out the announcer element. Note\n * that this takes effect after the message has been added to the DOM, which can be up to\n * 100ms after `announce` has been called.\n * @returns Promise that will be resolved when the message is added to the DOM.\n */\n announce(message: string, duration?: number): Promise<void>;\n\n /**\n * Announces a message to screenreaders.\n * @param message Message to be announced to the screenreader.\n * @param politeness The politeness of the announcer element.\n * @param duration Time in milliseconds after which to clear out the announcer element. Note\n * that this takes effect after the message has been added to the DOM, which can be up to\n * 100ms after `announce` has been called.\n * @returns Promise that will be resolved when the message is added to the DOM.\n */\n announce(message: string, politeness?: AriaLivePoliteness, duration?: number): Promise<void>;\n\n announce(message: string, ...args: any[]): Promise<void> {\n const defaultOptions = this._defaultOptions;\n let politeness: AriaLivePoliteness | undefined;\n let duration: number | undefined;\n\n if (args.length === 1 && typeof args[0] === 'number') {\n duration = args[0];\n } else {\n [politeness, duration] = args;\n }\n\n this.clear();\n clearTimeout(this._previousTimeout);\n\n if (!politeness) {\n politeness =\n (defaultOptions && defaultOptions.politeness) ? defaultOptions.politeness : 'polite';\n }\n\n if (duration == null && defaultOptions) {\n duration = defaultOptions.duration;\n }\n\n // TODO: ensure changing the politeness works on all environments we support.\n this._liveElement.setAttribute('aria-live', politeness);\n\n // This 100ms timeout is necessary for some browser + screen-reader combinations:\n // - Both JAWS and NVDA over IE11 will not announce anything without a non-zero timeout.\n // - With Chrome and IE11 with NVDA or JAWS, a repeated (identical) message won't be read a\n // second time without clearing and then using a non-zero delay.\n // (using JAWS 17 at time of this writing).\n return this._ngZone.runOutsideAngular(() => {\n return new Promise(resolve => {\n clearTimeout(this._previousTimeout);\n this._previousTimeout = setTimeout(() => {\n this._liveElement.textContent = message;\n resolve();\n\n if (typeof duration === 'number') {\n this._previousTimeout = setTimeout(() => this.clear(), duration);\n }\n }, 100);\n });\n });\n }\n\n /**\n * Clears the current text from the announcer element. Can be used to prevent\n * screen readers from reading the text out again while the user is going\n * through the page landmarks.\n */\n clear() {\n if (this._liveElement) {\n this._liveElement.textContent = '';\n }\n }\n\n ngOnDestroy() {\n clearTimeout(this._previousTimeout);\n\n if (this._liveElement && this._liveElement.parentNode) {\n this._liveElement.parentNode.removeChild(this._liveElement);\n this._liveElement = null!;\n }\n }\n\n private _createLiveElement(): HTMLElement {\n const elementClass = 'cdk-live-announcer-element';\n const previousElements = this._document.getElementsByClassName(elementClass);\n const liveEl = this._document.createElement('div');\n\n // Remove any old containers. This can happen when coming in from a server-side-rendered page.\n for (let i = 0; i < previousElements.length; i++) {\n previousElements[i].parentNode!.removeChild(previousElements[i]);\n }\n\n liveEl.classList.add(elementClass);\n liveEl.classList.add('cdk-visually-hidden');\n\n liveEl.setAttribute('aria-atomic', 'true');\n liveEl.setAttribute('aria-live', 'polite');\n\n this._document.body.appendChild(liveEl);\n\n return liveEl;\n }\n\n}\n\n\n/**\n * A directive that works similarly to aria-live, but uses the LiveAnnouncer to ensure compatibility\n * with a wider range of browsers and screen readers.\n */\n@Directive({\n selector: '[cdkAriaLive]',\n exportAs: 'cdkAriaLive',\n})\nexport class CdkAriaLive implements OnDestroy {\n /** The aria-live politeness level to use when announcing messages. */\n @Input('cdkAriaLive')\n get politeness(): AriaLivePoliteness { return this._politeness; }\n set politeness(value: AriaLivePoliteness) {\n this._politeness = value === 'polite' || value === 'assertive' ? value : 'off';\n if (this._politeness === 'off') {\n if (this._subscription) {\n this._subscription.unsubscribe();\n this._subscription = null;\n }\n } else if (!this._subscription) {\n this._subscription = this._ngZone.runOutsideAngular(() => {\n return this._contentObserver\n .observe(this._elementRef)\n .subscribe(() => {\n // Note that we use textContent here, rather than innerText, in order to avoid a reflow.\n const elementText = this._elementRef.nativeElement.textContent;\n\n // The `MutationObserver` fires also for attribute\n // changes which we don't want to announce.\n if (elementText !== this._previousAnnouncedText) {\n this._liveAnnouncer.announce(elementText, this._politeness);\n this._previousAnnouncedText = elementText;\n }\n });\n });\n }\n }\n private _politeness: AriaLivePoliteness = 'off';\n\n private _previousAnnouncedText?: string;\n private _subscription: Subscription | null;\n\n constructor(private _elementRef: ElementRef, private _liveAnnouncer: LiveAnnouncer,\n private _contentObserver: ContentObserver, private _ngZone: NgZone) {}\n\n ngOnDestroy() {\n if (this._subscription) {\n this._subscription.unsubscribe();\n }\n }\n}\n\n\n/** @docs-private @deprecated @breaking-change 8.0.0 */\nexport function LIVE_ANNOUNCER_PROVIDER_FACTORY(\n parentAnnouncer: LiveAnnouncer, liveElement: any, _document: any, ngZone: NgZone) {\n return parentAnnouncer || new LiveAnnouncer(liveElement, ngZone, _document);\n}\n\n\n/** @docs-private @deprecated @breaking-change 8.0.0 */\nexport const LIVE_ANNOUNCER_PROVIDER: Provider = {\n // If there is already a LiveAnnouncer available, use that. Otherwise, provide a new one.\n provide: LiveAnnouncer,\n deps: [\n [new Optional(), new SkipSelf(), LiveAnnouncer],\n [new Optional(), new Inject(LIVE_ANNOUNCER_ELEMENT_TOKEN)],\n DOCUMENT,\n NgZone,\n ],\n useFactory: LIVE_ANNOUNCER_PROVIDER_FACTORY\n};\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\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://angular.io/license\n */\n\nimport {InjectionToken} from '@angular/core';\n\n// The tokens for the live announcer are defined in a separate file from LiveAnnouncer\n// as a workaround for https://github.com/angular/angular/issues/22559\n\n/** Possible politeness levels. */\nexport type AriaLivePoliteness = 'off' | 'polite' | 'assertive';\n\nexport const LIVE_ANNOUNCER_ELEMENT_TOKEN =\n new InjectionToken<HTMLElement | null>('liveAnnouncerElement', {\n providedIn: 'root',\n factory: LIVE_ANNOUNCER_ELEMENT_TOKEN_FACTORY,\n });\n\n/** @docs-private */\nexport function LIVE_ANNOUNCER_ELEMENT_TOKEN_FACTORY(): null {\n return null;\n}\n\n/** Object that can be used to configure the default options for the LiveAnnouncer. */\nexport interface LiveAnnouncerDefaultOptions {\n /** Default politeness for the announcements. */\n politeness?: AriaLivePoliteness;\n\n /** Default duration for the announcement messages. */\n duration?: number;\n}\n\n/** Injection token that can be used to configure the default options for the LiveAnnouncer. */\nexport const LIVE_ANNOUNCER_DEFAULT_OPTIONS =\n new InjectionToken<LiveAnnouncerDefaultOptions>('LIVE_ANNOUNCER_DEFAULT_OPTIONS');\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\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://angular.io/license\n */\n\nimport {coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {DOCUMENT} from '@angular/common';\nimport {\n AfterContentInit,\n Directive,\n ElementRef,\n Inject,\n Injectable,\n Input,\n NgZone,\n OnDestroy,\n DoCheck,\n isDevMode,\n} from '@angular/core';\nimport {take} from 'rxjs/operators';\nimport {InteractivityChecker} from '../interactivity-checker/interactivity-checker';\n\n\n/**\n * Class that allows for trapping focus within a DOM element.\n *\n * This class currently uses a relatively simple approach to focus trapping.\n * It assumes that the tab order is the same as DOM order, which is not necessarily true.\n * Things like `tabIndex > 0`, flex `order`, and shadow roots can cause to two to misalign.\n */\nexport class FocusTrap {\n private _startAnchor: HTMLElement | null;\n private _endAnchor: HTMLElement | null;\n private _hasAttached = false;\n\n // Event listeners for the anchors. Need to be regular functions so that we can unbind them later.\n protected startAnchorListener = () => this.focusLastTabbableElement();\n protected endAnchorListener = () => this.focusFirstTabbableElement();\n\n /** Whether the focus trap is active. */\n get enabled(): boolean { return this._enabled; }\n set enabled(value: boolean) {\n this._enabled = value;\n\n if (this._startAnchor && this._endAnchor) {\n this._toggleAnchorTabIndex(value, this._startAnchor);\n this._toggleAnchorTabIndex(value, this._endAnchor);\n }\n }\n private _enabled: boolean = true;\n\n constructor(\n private _element: HTMLElement,\n private _checker: InteractivityChecker,\n private _ngZone: NgZone,\n private _document: Document,\n deferAnchors = false) {\n\n if (!deferAnchors) {\n this.attachAnchors();\n }\n }\n\n /** Destroys the focus trap by cleaning up the anchors. */\n destroy() {\n const startAnchor = this._startAnchor;\n const endAnchor = this._endAnchor;\n\n if (startAnchor) {\n startAnchor.removeEventListener('focus', this.startAnchorListener);\n\n if (startAnchor.parentNode) {\n startAnchor.parentNode.removeChild(startAnchor);\n }\n }\n\n if (endAnchor) {\n endAnchor.removeEventListener('focus', this.endAnchorListener);\n\n if (endAnchor.parentNode) {\n endAnchor.parentNode.removeChild(endAnchor);\n }\n }\n\n this._startAnchor = this._endAnchor = null;\n }\n\n /**\n * Inserts the anchors into the DOM. This is usually done automatically\n * in the constructor, but can be deferred for cases like directives with `*ngIf`.\n * @returns Whether the focus trap managed to attach successfuly. This may not be the case\n * if the target element isn't currently in the DOM.\n */\n attachAnchors(): boolean {\n // If we're not on the browser, there can be no focus to trap.\n if (this._hasAttached) {\n return true;\n }\n\n this._ngZone.runOutsideAngular(() => {\n if (!this._startAnchor) {\n this._startAnchor = this._createAnchor();\n this._startAnchor!.addEventListener('focus', this.startAnchorListener);\n }\n\n if (!this._endAnchor) {\n this._endAnchor = this._createAnchor();\n this._endAnchor!.addEventListener('focus', this.endAnchorListener);\n }\n });\n\n if (this._element.parentNode) {\n this._element.parentNode.insertBefore(this._startAnchor!, this._element);\n this._element.parentNode.insertBefore(this._endAnchor!, this._element.nextSibling);\n this._hasAttached = true;\n }\n\n return this._hasAttached;\n }\n\n /**\n * Waits for the zone to stabilize, then either focuses the first element that the\n * user specified, or the first tabbable element.\n * @returns Returns a promise that resolves with a boolean, depending\n * on whether focus was moved successfuly.\n */\n focusInitialElementWhenReady(): Promise<boolean> {\n return new Promise<boolean>(resolve => {\n this._executeOnStable(() => resolve(this.focusInitialElement()));\n });\n }\n\n /**\n * Waits for the zone to stabilize, then focuses\n * the first tabbable element within the focus trap region.\n * @returns Returns a promise that resolves with a boolean, depending\n * on whether focus was moved successfuly.\n */\n focusFirstTabbableElementWhenReady(): Promise<boolean> {\n return new Promise<boolean>(resolve => {\n this._executeOnStable(() => resolve(this.focusFirstTabbableElement()));\n });\n }\n\n /**\n * Waits for the zone to stabilize, then focuses\n * the last tabbable element within the focus trap region.\n * @returns Returns a promise that resolves with a boolean, depending\n * on whether focus was moved successfuly.\n */\n focusLastTabbableElementWhenReady(): Promise<boolean> {\n return new Promise<boolean>(resolve => {\n this._executeOnStable(() => resolve(this.focusLastTabbableElement()));\n });\n }\n\n /**\n * Get the specified boundary element of the trapped region.\n * @param bound The boundary to get (start or end of trapped region).\n * @returns The boundary element.\n */\n private _getRegionBoundary(bound: 'start' | 'end'): HTMLElement | null {\n // Contains the deprecated version of selector, for temporary backwards comparability.\n let markers = this._element.querySelectorAll(`[cdk-focus-region-${bound}], ` +\n `[cdkFocusRegion${bound}], ` +\n `[cdk-focus-${bound}]`) as NodeListOf<HTMLElement>;\n\n for (let i = 0; i < markers.length; i++) {\n // @breaking-change 8.0.0\n if (markers[i].hasAttribute(`cdk-focus-${bound}`)) {\n console.warn(`Found use of deprecated attribute 'cdk-focus-${bound}', ` +\n `use 'cdkFocusRegion${bound}' instead. The deprecated ` +\n `attribute will be removed in 8.0.0.`, markers[i]);\n } else if (markers[i].hasAttribute(`cdk-focus-region-${bound}`)) {\n console.warn(`Found use of deprecated attribute 'cdk-focus-region-${bound}', ` +\n `use 'cdkFocusRegion${bound}' instead. The deprecated attribute ` +\n `will be removed in 8.0.0.`, markers[i]);\n }\n }\n\n if (bound == 'start') {\n return markers.length ? markers[0] : this._getFirstTabbableElement(this._element);\n }\n return markers.length ?\n markers[markers.length - 1] : this._getLastTabbableElement(this._element);\n }\n\n /**\n * Focuses the element that should be focused when the focus trap is initialized.\n * @returns Whether focus was moved successfuly.\n */\n focusInitialElement(): boolean {\n // Contains the deprecated version of selector, for temporary backwards comparability.\n const redirectToElement = this._element.querySelector(`[cdk-focus-initial], ` +\n `[cdkFocusInitial]`) as HTMLElement;\n\n if (redirectToElement) {\n // @breaking-change 8.0.0\n if (redirectToElement.hasAttribute(`cdk-focus-initial`)) {\n console.warn(`Found use of deprecated attribute 'cdk-focus-initial', ` +\n `use 'cdkFocusInitial' instead. The deprecated attribute ` +\n `will be removed in 8.0.0`, redirectToElement);\n }\n\n // Warn the consumer if the element they've pointed to\n // isn't focusable, when not in production mode.\n if (isDevMode() && !this._checker.isFocusable(redirectToElement)) {\n console.warn(`Element matching '[cdkFocusInitial]' is not focusable.`, redirectToElement);\n }\n\n redirectToElement.focus();\n return true;\n }\n\n return this.focusFirstTabbableElement();\n }\n\n /**\n * Focuses the first tabbable element within the focus trap region.\n * @returns Whether focus was moved successfuly.\n */\n focusFirstTabbableElement(): boolean {\n const redirectToElement = this._getRegionBoundary('start');\n\n if (redirectToElement) {\n redirectToElement.focus();\n }\n\n return !!redirectToElement;\n }\n\n /**\n * Focuses the last tabbable element within the focus trap region.\n * @returns Whether focus was moved successfuly.\n */\n focusLastTabbableElement(): boolean {\n const redirectToElement = this._getRegionBoundary('end');\n\n if (redirectToElement) {\n redirectToElement.focus();\n }\n\n return !!redirectToElement;\n }\n\n /**\n * Checks whether the focus trap has successfuly been attached.\n */\n hasAttached(): boolean {\n return this._hasAttached;\n }\n\n /** Get the first tabbable element from a DOM subtree (inclusive). */\n private _getFirstTabbableElement(root: HTMLElement): HTMLElement | null {\n if (this._checker.isFocusable(root) && this._checker.isTabbable(root)) {\n return root;\n }\n\n // Iterate in DOM order. Note that IE doesn't have `children` for SVG so we fall\n // back to `childNodes` which includes text nodes, comments etc.\n let children = root.children || root.childNodes;\n\n for (let i = 0; i < children.length; i++) {\n let tabbableChild = children[i].nodeType === this._document.ELEMENT_NODE ?\n this._getFirstTabbableElement(children[i] as HTMLElement) :\n null;\n\n if (tabbableChild) {\n return tabbableChild;\n }\n }\n\n return null;\n }\n\n /** Get the last tabbable element from a DOM subtree (inclusive). */\n private _getLastTabbableElement(root: HTMLElement): HTMLElement | null {\n if (this._checker.isFocusable(root) && this._checker.isTabbable(root)) {\n return root;\n }\n\n // Iterate in reverse DOM order.\n let children = root.children || root.childNodes;\n\n for (let i = children.length - 1; i >= 0; i--) {\n let tabbableChild = children[i].nodeType === this._document.ELEMENT_NODE ?\n this._getLastTabbableElement(children[i] as HTMLElement) :\n null;\n\n if (tabbableChild) {\n return tabbableChild;\n }\n }\n\n return null;\n }\n\n /** Creates an anchor element. */\n private _createAnchor(): HTMLElement {\n const anchor = this._document.createElement('div');\n this._toggleAnchorTabIndex(this._enabled, anchor);\n anchor.classList.add('cdk-visually-hidden');\n anchor.classList.add('cdk-focus-trap-anchor');\n anchor.setAttribute('aria-hidden', 'true');\n return anchor;\n }\n\n /**\n * Toggles the `tabindex` of an anchor, based on the enabled state of the focus trap.\n * @param isEnabled Whether the focus trap is enabled.\n * @param anchor Anchor on which to toggle the tabindex.\n */\n private _toggleAnchorTabIndex(isEnabled: boolean, anchor: HTMLElement) {\n // Remove the tabindex completely, rather than setting it to -1, because if the\n // element has a tabindex, the user might still hit it when navigating with the arrow keys.\n isEnabled ? anchor.setAttribute('tabindex', '0') : anchor.removeAttribute('tabindex');\n }\n\n /** Executes a function when the zone is stable. */\n private _executeOnStable(fn: () => any): void {\n if (this._ngZone.isStable) {\n fn();\n } else {\n this._ngZone.onStable.asObservable().pipe(take(1)).subscribe(fn);\n }\n }\n}\n\n\n/** Factory that allows easy instantiation of focus traps. */\n@Injectable({providedIn: 'root'})\nexport class FocusTrapFactory {\n private _document: Document;\n\n constructor(\n private _checker: InteractivityChecker,\n private _ngZone: NgZone,\n @Inject(DOCUMENT) _document: any) {\n\n this._document = _document;\n }\n\n /**\n * Creates a focus-trapped region around the given element.\n * @param element The element around which focus will be trapped.\n * @param deferCaptureElements Defers the creation of focus-capturing elements to be done\n * manually by the user.\n * @returns The created focus trap instance.\n */\n create(element: HTMLElement, deferCaptureElements: boolean = false): FocusTrap {\n return new FocusTrap(\n element, this._checker, this._ngZone, this._document, deferCaptureElements);\n }\n}\n\n/** Directive for trapping focus within a region. */\n@Directive({\n selector: '[cdkTrapFocus]',\n exportAs: 'cdkTrapFocus',\n})\nexport class CdkTrapFocus implements OnDestroy, AfterContentInit, DoCheck {\n private _document: Document;\n\n /** Underlying FocusTrap instance. */\n focusTrap: FocusTrap;\n\n /** Previously focused element to restore focus to upon destroy when using autoCapture. */\n private _previouslyFocusedElement: HTMLElement | null = null;\n\n /** Whether the focus trap is active. */\n @Input('cdkTrapFocus')\n get enabled(): boolean { return this.focusTrap.enabled; }\n set enabled(value: boolean) { this.focusTrap.enabled = coerceBooleanProperty(value); }\n\n /**\n * Whether the directive should automatially move focus into the trapped region upon\n * initialization and return focus to the previous activeElement upon destruction.\n */\n @Input('cdkTrapFocusAutoCapture')\n get autoCapture(): boolean { return this._autoCapture; }\n set autoCapture(value: boolean) { this._autoCapture = coerceBooleanProperty(value); }\n private _autoCapture: boolean;\n\n constructor(\n private _elementRef: ElementRef<HTMLElement>,\n private _focusTrapFactory: FocusTrapFactory,\n @Inject(DOCUMENT) _document: any) {\n\n this._document = _document;\n this.focusTrap = this._focusTrapFactory.create(this._elementRef.nativeElement, true);\n }\n\n ngOnDestroy() {\n this.focusTrap.destroy();\n\n // If we stored a previously focused element when using autoCapture, return focus to that\n // element now that the trapped region is being destroyed.\n if (this._previouslyFocusedElement) {\n this._previouslyFocusedElement.focus();\n this._previouslyFocusedElement = null;\n }\n }\n\n ngAfterContentInit() {\n this.focusTrap.attachAnchors();\n\n if (this.autoCapture) {\n this._previouslyFocusedElement = this._document.activeElement as HTMLElement;\n this.focusTrap.focusInitialElementWhenReady();\n }\n }\n\n ngDoCheck() {\n if (!this.focusTrap.hasAttached()) {\n this.focusTrap.attachAnchors();\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\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://angular.io/license\n */\n\nimport {Platform} from '@angular/cdk/platform';\nimport {Injectable} from '@angular/core';\n\n\n// The InteractivityChecker leans heavily on the ally.js accessibility utilities.\n// Methods like `isTabbable` are only covering specific edge-cases for the browsers which are\n// supported.\n\n/**\n * Utility for checking the interactivity of an element, such as whether is is focusable or\n * tabbable.\n */\n@Injectable({providedIn: 'root'})\nexport class InteractivityChecker {\n\n constructor(private _platform: Platform) {}\n\n /**\n * Gets whether an element is disabled.\n *\n * @param element Element to be checked.\n * @returns Whether the element is disabled.\n */\n isDisabled(element: HTMLElement): boolean {\n // This does not capture some cases, such as a non-form control with a disabled attribute or\n // a form control inside of a disabled form, but should capture the most common cases.\n return element.hasAttribute('disabled');\n }\n\n /**\n * Gets whether an element is visible for the purposes of interactivity.\n *\n * This will capture states like `display: none` and `visibility: hidden`, but not things like\n * being clipped by an `overflow: hidden` parent or being outside the viewport.\n *\n * @returns Whether the element is visible.\n */\n isVisible(element: HTMLElement): boolean {\n return hasGeometry(element) && getComputedStyle(element).visibility === 'visible';\n }\n\n /**\n * Gets whether an element can be reached via Tab key.\n * Assumes that the element has already been checked with isFocusable.\n *\n * @param element Element to be checked.\n * @returns Whether the element is tabbable.\n */\n isTabbable(element: HTMLElement): boolean {\n // Nothing is tabbable on the server 😎\n if (!this._platform.isBrowser) {\n return false;\n }\n\n const frameElement = getFrameElement(getWindow(element));\n\n if (frameElement) {\n const frameType = frameElement && frameElement.nodeName.toLowerCase();\n\n // Frame elements inherit their tabindex onto all child elements.\n if (getTabIndexValue(frameElement) === -1) {\n return false;\n }\n\n // Webkit and Blink consider anything inside of an <object> element as non-tabbable.\n if ((this._platform.BLINK || this._platform.WEBKIT) && frameType === 'object') {\n return false;\n }\n\n // Webkit and Blink disable tabbing to an element inside of an invisible frame.\n if ((this._platform.BLINK || this._platform.WEBKIT) && !this.isVisible(frameElement)) {\n return false;\n }\n\n }\n\n let nodeName = element.nodeName.toLowerCase();\n let tabIndexValue = getTabIndexValue(element);\n\n if (element.hasAttribute('contenteditable')) {\n return tabIndexValue !== -1;\n }\n\n if (nodeName === 'iframe') {\n // The frames may be tabbable depending on content, but it's not possibly to reliably\n // investigate the content of the frames.\n return false;\n }\n\n if (nodeName === 'audio') {\n if (!element.hasAttribute('controls')) {\n // By default an <audio> element without the controls enabled is not tabbable.\n return false;\n } else if (this._platform.BLINK) {\n // In Blink <audio controls> elements are always tabbable.\n return true;\n }\n }\n\n if (nodeName === 'video') {\n if (!element.hasAttribute('controls') && this._platform.TRIDENT) {\n // In Trident a <video> element without the controls enabled is not tabbable.\n return false;\n } else if (this._platform.BLINK || this._platform.FIREFOX) {\n // In Chrome and Firefox <video controls> elements are always tabbable.\n return true;\n }\n }\n\n if (nodeName === 'object' && (this._platform.BLINK || this._platform.WEBKIT)) {\n // In all Blink and WebKit based browsers <object> elements are never tabbable.\n return false;\n }\n\n // In iOS the browser only considers some specific elements as tabbable.\n if (this._platform.WEBKIT && this._platform.IOS && !isPotentiallyTabbableIOS(element)) {\n return false;\n }\n\n return element.tabIndex >= 0;\n }\n\n /**\n * Gets whether an element can be focused by the user.\n *\n * @param element Element to be checked.\n * @returns Whether the element is focusable.\n */\n isFocusable(element: HTMLElement): boolean {\n // Perform checks in order of left to most expensive.\n // Again, naive approach that does not capture many edge cases and browser quirks.\n return isPotentiallyFocusable(element) && !this.isDisabled(element) && this.isVisible(element);\n }\n\n}\n\n/**\n * Returns the frame element from a window object. Since browsers like MS Edge throw errors if\n * the frameElement property is being accessed from a different host address, this property\n * should be accessed carefully.\n */\nfunction getFrameElement(window: Window) {\n try {\n return window.frameElement as HTMLElement;\n } catch {\n return null;\n }\n}\n\n/** Checks whether the specified element has any geometry / rectangles. */\nfunction hasGeometry(element: HTMLElement): boolean {\n // Use logic from jQuery to check for an invisible element.\n // See https://github.com/jquery/jquery/blob/master/src/css/hiddenVisibleSelectors.js#L12\n return !!(element.offsetWidth || element.offsetHeight ||\n (typeof element.getClientRects === 'function' && element.getClientRects().length));\n}\n\n/** Gets whether an element's */\nfunction isNativeFormElement(element: Node) {\n let nodeName = element.nodeName.toLowerCase();\n return nodeName === 'input' ||\n nodeName === 'select' ||\n nodeName === 'button' ||\n nodeName === 'textarea';\n}\n\n/** Gets whether an element is an `<input type=\"hidden\">`. */\nfunction isHiddenInput(element: HTMLElement): boolean {\n return isInputElement(element) && element.type == 'hidden';\n}\n\n/** Gets whether an element is an anchor that has an href attribute. */\nfunction isAnchorWithHref(element: HTMLElement): boolean {\n return isAnchorElement(element) && element.hasAttribute('href');\n}\n\n/** Gets whether an element is an input element. */\nfunction isInputElement(element: HTMLElement): element is HTMLInputElement {\n return element.nodeName.toLowerCase() == 'input';\n}\n\n/** Gets whether an element is an anchor element. */\nfunction isAnchorElement(element: HTMLElement): element is HTMLAnchorElement {\n return element.nodeName.toLowerCase() == 'a';\n}\n\n/** Gets whether an element has a valid tabindex. */\nfunction hasValidTabIndex(element: HTMLElement): boolean {\n if (!element.hasAttribute('tabindex') || element.tabIndex === undefined) {\n return false;\n }\n\n let tabIndex = element.getAttribute('tabindex');\n\n // IE11 parses tabindex=\"\" as the value \"-32768\"\n if (tabIndex == '-32768') {\n return false;\n }\n\n return !!(tabIndex && !isNaN(parseInt(tabIndex, 10)));\n}\n\n/**\n * Returns the parsed tabindex from the element attributes instead of returning the\n * evaluated tabindex from the browsers defaults.\n */\nfunction getTabIndexValue(element: HTMLElement): number | null {\n if (!hasValidTabIndex(element)) {\n return null;\n }\n\n // See browser issue in Gecko https://bugzilla.mozilla.org/show_bug.cgi?id=1128054\n const tabIndex = parseInt(element.getAttribute('tabindex') || '', 10);\n\n return isNaN(tabIndex) ? -1 : tabIndex;\n}\n\n/** Checks whether the specified element is potentially tabbable on iOS */\nfunction isPotentiallyTabbableIOS(element: HTMLElement): boolean {\n let nodeName = element.nodeName.toLowerCase();\n let inputType = nodeName === 'input' && (element as HTMLInputElement).type;\n\n return inputType === 'text'\n || inputType === 'password'\n || nodeName === 'select'\n || nodeName === 'textarea';\n}\n\n/**\n * Gets whether an element is potentially focusable without taking current visible/disabled state\n * into account.\n */\nfunction isPotentiallyFocusable(element: HTMLElement): boolean {\n // Inputs are potentially focusable *unless* they're type=\"hidden\".\n if (isHiddenInput(element)) {\n return false;\n }\n\n return isNativeFormElement(element) ||\n isAnchorWithHref(element) ||\n element.hasAttribute('contenteditable') ||\n hasValidTabIndex(element);\n}\n\n/** Gets the parent window of a DOM node with regards of being inside of an iframe. */\nfunction getWindow(node: HTMLElement): Window {\n // ownerDocument is null if `node` itself *is* a document.\n return node.ownerDocument && node.ownerDocument.defaultView || window;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\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://angular.io/license\n */\n\nimport {ListKeyManager, ListKeyManagerOption} from './list-key-manager';\nimport {FocusOrigin} from '../focus-monitor/focus-monitor';\n\n/**\n * This is the interface for focusable items (used by the FocusKeyManager).\n * Each item must know how to focus itself, whether or not it is currently disabled\n * and be able to supply it's label.\n */\nexport interface FocusableOption extends ListKeyManagerOption {\n /** Focuses the `FocusableOption`. */\n focus(origin?: FocusOrigin): void;\n}\n\nexport class FocusKeyManager<T> extends ListKeyManager<FocusableOption & T> {\n private _origin: FocusOrigin = 'program';\n\n /**\n * Sets the focus origin that will be passed in to the items for any subsequent `focus` calls.\n * @param origin Focus origin to be used when focusing items.\n */\n setFocusOrigin(origin: FocusOrigin): this {\n this._origin = origin;\n return this;\n }\n\n /**\n * Sets the active item to the item at the specified\n * index and focuses the newly active item.\n * @param index Index of the item to be set as active.\n */\n setActiveItem(index: number): void;\n\n /**\n * Sets the active item to the item that is specified and focuses it.\n * @param item Item to be set as active.\n */\n setActiveItem(item: T): void;\n\n setActiveItem(item: any): void {\n super.setActiveItem(item);\n\n if (this.activeItem) {\n this.activeItem.focus(this._origin);\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\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://angular.io/license\n */\n\nimport {ListKeyManager, ListKeyManagerOption} from './list-key-manager';\n\n/**\n * This is the interface for highlightable items (used by the ActiveDescendantKeyManager).\n * Each item must know how to style itself as active or inactive and whether or not it is\n * currently disabled.\n */\nexport interface Highlightable extends ListKeyManagerOption {\n /** Applies the styles for an active item to this item. */\n setActiveStyles(): void;\n\n /** Applies the styles for an inactive item to this item. */\n setInactiveStyles(): void;\n}\n\nexport class ActiveDescendantKeyManager<T> extends ListKeyManager<Highlightable & T> {\n\n /**\n * Sets the active item to the item at the specified index and adds the\n * active styles to the newly active item. Also removes active styles\n * from the previously active item.\n * @param index Index of the item to be set as active.\n */\n setActiveItem(index: number): void;\n\n /**\n * Sets the active item to the item to the specified one and adds the\n * active styles to the it. Also removes active styles from the\n * previously active item.\n * @param item Item to be set as active.\n */\n setActiveItem(item: T): void;\n\n setActiveItem(index: any): void {\n if (this.activeItem) {\n this.activeItem.setInactiveStyles();\n }\n super.setActiveItem(index);\n if (this.activeItem) {\n this.activeItem.setActiveStyles();\n }\n }\n\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\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://angular.io/license\n */\n\nimport {QueryList} from '@angular/core';\nimport {Subject, Subscription} from 'rxjs';\nimport {\n UP_ARROW,\n DOWN_ARROW,\n LEFT_ARROW,\n RIGHT_ARROW,\n TAB,\n A,\n Z,\n ZERO,\n NINE,\n hasModifierKey,\n} from '@angular/cdk/keycodes';\nimport {debounceTime, filter, map, tap} from 'rxjs/operators';\n\n/** This interface is for items that can be passed to a ListKeyManager. */\nexport interface ListKeyManagerOption {\n /** Whether the option is disabled. */\n disabled?: boolean;\n\n /** Gets the label for this option. */\n getLabel?(): string;\n}\n\n/** Modifier keys handled by the ListKeyManager. */\nexport type ListKeyManagerModifierKey = 'altKey' | 'ctrlKey' | 'metaKey' | 'shiftKey';\n\n/**\n * This class manages keyboard events for selectable lists. If you pass it a query list\n * of items, it will set the active item correctly when arrow events occur.\n */\nexport class ListKeyManager<T extends ListKeyManagerOption> {\n private _activeItemIndex = -1;\n private _activeItem: T | null = null;\n private _wrap = false;\n private _letterKeyStream = new Subject<string>();\n private _typeaheadSubscription = Subscription.EMPTY;\n private _vertical = true;\n private _horizontal: 'ltr' | 'rtl' | null;\n private _allowedModifierKeys: ListKeyManagerModifierKey[] = [];\n\n /**\n * Predicate function that can be used to check whether an item should be skipped\n * by the key manager. By default, disabled items are skipped.\n */\n private _skipPredicateFn = (item: T) => item.disabled;\n\n // Buffer for the letters that the user has pressed when the typeahead option is turned on.\n private _pressedLetters: string[] = [];\n\n constructor(private _items: QueryList<T> | T[]) {\n // We allow for the items to be an array because, in some cases, the consumer may\n // not have access to a QueryList of the items they want to manage (e.g. when the\n // items aren't being collected via `ViewChildren` or `ContentChildren`).\n if (_items instanceof QueryList) {\n _items.changes.subscribe((newItems: QueryList<T>) => {\n if (this._activeItem) {\n const itemArray = newItems.toArray();\n const newIndex = itemArray.indexOf(this._activeItem);\n\n if (newIndex > -1 && newIndex !== this._activeItemIndex) {\n this._activeItemIndex = newIndex;\n }\n }\n });\n }\n }\n\n /**\n * Stream that emits any time the TAB key is pressed, so components can react\n * when focus is shifted off of the list.\n */\n tabOut: Subject<void> = new Subject<void>();\n\n /** Stream that emits whenever the active item of the list manager changes. */\n change = new Subject<number>();\n\n /**\n * Sets the predicate function that determines which items should be skipped by the\n * list key manager.\n * @param predicate Function that determines whether the given item should be skipped.\n */\n skipPredicate(predicate: (item: T) => boolean): this {\n this._skipPredicateFn = predicate;\n return this;\n }\n\n /**\n * Configures wrapping mode, which determines whether the active item will wrap to\n * the other end of list when there are no more items in the given direction.\n * @param shouldWrap Whether the list should wrap when reaching the end.\n */\n withWrap(shouldWrap = true): this {\n this._wrap = shouldWrap;\n return this;\n }\n\n /**\n * Configures whether the key manager should be able to move the selection vertically.\n * @param enabled Whether vertical selection should be enabled.\n */\n withVerticalOrientation(enabled: boolean = true): this {\n this._vertical = enabled;\n return this;\n }\n\n /**\n * Configures the key manager to move the selection horizontally.\n * Passing in `null` will disable horizontal movement.\n * @param direction Direction in which the selection can be moved.\n */\n withHorizontalOrientation(direction: 'ltr' | 'rtl' | null): this {\n this._horizontal = direction;\n return this;\n }\n\n /**\n * Modifier keys which are allowed to be held down and whose default actions will be prevented\n * as the user is pressing the arrow keys. Defaults to not allowing any modifier keys.\n */\n withAllowedModifierKeys(keys: ListKeyManagerModifierKey[]): this {\n this._allowedModifierKeys = keys;\n return this;\n }\n\n /**\n * Turns on typeahead mode which allows users to set the active item by typing.\n * @param debounceInterval Time to wait after the last keystroke before setting the active item.\n */\n withTypeAhead(debounceInterval: number = 200): this {\n if (this._items.length && this._items.some(item => typeof item.getLabel !== 'function')) {\n throw Error('ListKeyManager items in typeahead mode must implement the `getLabel` method.');\n }\n\n this._typeaheadSubscription.unsubscribe();\n\n // Debounce the presses of non-navigational keys, collect the ones that correspond to letters\n // and convert those letters back into a string. Afterwards find the first item that starts\n // with that string and select it.\n this._typeaheadSubscription = this._letterKeyStream.pipe(\n tap(keyCode => this._pressedLetters.push(keyCode)),\n debounceTime(debounceInterval),\n filter(() => this._pressedLetters.length > 0),\n map(() => this._pressedLetters.join(''))\n ).subscribe(inputString => {\n const items = this._getItemsArray();\n\n // Start at 1 because we want to start searching at the item immediately\n // following the current active item.\n for (let i = 1; i < items.length + 1; i++) {\n const index = (this._activeItemIndex + i) % items.length;\n const item = items[index];\n\n if (!this._skipPredicateFn(item) &&\n item.getLabel!().toUpperCase().trim().indexOf(inputString) === 0) {\n\n this.setActiveItem(index);\n break;\n }\n }\n\n this._pressedLetters = [];\n });\n\n return this;\n }\n\n /**\n * Sets the active item to the item at the index specified.\n * @param index The index of the item to be set as active.\n */\n setActiveItem(index: number): void;\n\n /**\n * Sets the active item to the specified item.\n * @param item The item to be set as active.\n */\n setActiveItem(item: T): void;\n\n setActiveItem(item: any): void {\n const previousIndex = this._activeItemIndex;\n\n this.updateActiveItem(item);\n\n if (this._activeItemIndex !== previousIndex) {\n this.change.next(this._activeItemIndex);\n }\n }\n\n /**\n * Sets the active item depending on the key event passed in.\n * @param event Keyboard event to be used for determining which element should be active.\n */\n onKeydown(event: KeyboardEvent): void {\n const keyCode = event.keyCode;\n const modifiers: ListKeyManagerModifierKey[] = ['altKey', 'ctrlKey', 'metaKey', 'shiftKey'];\n const isModifierAllowed = modifiers.every(modifier => {\n return !event[modifier] || this._allowedModifierKeys.indexOf(modifier) > -1;\n });\n\n switch (keyCode) {\n case TAB:\n this.tabOut.next();\n return;\n\n case DOWN_ARROW:\n if (this._vertical && isModifierAllowed) {\n this.setNextItemActive();\n break;\n } else {\n return;\n }\n\n case UP_ARROW:\n if (this._vertical && isModifierAllowed) {\n this.setPreviousItemActive();\n break;\n } else {\n return;\n }\n\n case RIGHT_ARROW:\n if (this._horizontal && isModifierAllowed) {\n this._horizontal === 'rtl' ? this.setPreviousItemActive() : this.setNextItemActive();\n break;\n } else {\n return;\n }\n\n case LEFT_ARROW:\n if (this._horizontal && isModifierAllowed) {\n this._horizontal === 'rtl' ? this.setNextItemActive() : this.setPreviousItemActive();\n break;\n } else {\n return;\n }\n\n default:\n if (isModifierAllowed || hasModifierKey(event, 'shiftKey')) {\n // Attempt to use the `event.key` which also maps it to the user's keyboard language,\n // otherwise fall back to resolving alphanumeric characters via the keyCode.\n if (event.key && event.key.length === 1) {\n this._letterKeyStream.next(event.key.toLocaleUpperCase());\n } else if ((keyCode >= A && keyCode <= Z) || (keyCode >= ZERO && keyCode <= NINE)) {\n this._letterKeyStream.next(String.fromCharCode(keyCode));\n }\n }\n\n // Note that we return here, in order to avoid preventing\n // the default action of non-navigational keys.\n return;\n }\n\n this._pressedLetters = [];\n event.preventDefault();\n }\n\n /** Index of the currently active item. */\n get activeItemIndex(): number | null {\n return this._activeItemIndex;\n }\n\n /** The active item. */\n get activeItem(): T | null {\n return this._activeItem;\n }\n\n /** Sets the active item to the first enabled item in the list. */\n setFirstItemActive(): void {\n this._setActiveItemByIndex(0, 1);\n }\n\n /** Sets the active item to the last enabled item in the list. */\n setLastItemActive(): void {\n this._setActiveItemByIndex(this._items.length - 1, -1);\n }\n\n /** Sets the active item to the next enabled item in the list. */\n setNextItemActive(): void {\n this._activeItemIndex < 0 ? this.setFirstItemActive() : this._setActiveItemByDelta(1);\n }\n\n /** Sets the active item to a previous enabled item in the list. */\n setPreviousItemActive(): void {\n this._activeItemIndex < 0 && this._wrap ? this.setLastItemActive()\n : this._setActiveItemByDelta(-1);\n }\n\n /**\n * Allows setting the active without any other effects.\n * @param index Index of the item to be set as active.\n */\n updateActiveItem(index: number): void;\n\n /**\n * Allows setting the active item without any other effects.\n * @param item Item to be set as active.\n */\n updateActiveItem(item: T): void;\n\n updateActiveItem(item: any): void {\n const itemArray = this._getItemsArray();\n const index = typeof item === 'number' ? item : itemArray.indexOf(item);\n const activeItem = itemArray[index];\n\n // Explicitly check for `null` and `undefined` because other falsy values are valid.\n this._activeItem = activeItem == null ? null : activeItem;\n this._activeItemIndex = index;\n }\n\n /**\n * Allows setting of the activeItemIndex without any other effects.\n * @param index The new activeItemIndex.\n * @deprecated Use `updateActiveItem` instead.\n * @breaking-change 8.0.0\n */\n updateActiveItemIndex(index: number): void {\n this.updateActiveItem(index);\n }\n\n /**\n * This method sets the active item, given a list of items and the delta between the\n * currently active item and the new active item. It will calculate differently\n * depending on whether wrap mode is turned on.\n */\n private _setActiveItemByDelta(delta: -1 | 1): void {\n this._wrap ? this._setActiveInWrapMode(delta) : this._setActiveInDefaultMode(delta);\n }\n\n /**\n * Sets the active item properly given \"wrap\" mode. In other words, it will continue to move\n * down the list until it finds an item that is not disabled, and it will wrap if it\n * encounters either end of the list.\n */\n private _setActiveInWrapMode(delta: -1 | 1): void {\n const items = this._getItemsArray();\n\n for (let i = 1; i <= items.length; i++) {\n const index = (this._activeItemIndex + (delta * i) + items.length) % items.length;\n const item = items[index];\n\n if (!this._skipPredicateFn(item)) {\n this.setActiveItem(index);\n return;\n }\n }\n }\n\n /**\n * Sets the active item properly given the default mode. In other words, it will\n * continue to move down the list until it finds an item that is not disabled. If\n * it encounters either end of the list, it will stop and not wrap.\n */\n private _setActiveInDefaultMode(delta: -1 | 1): void {\n this._setActiveItemByIndex(this._activeItemIndex + delta, delta);\n }\n\n /**\n * Sets the active item to the first enabled item starting at the index specified. If the\n * item is disabled, it will move in the fallbackDelta direction until it either\n * finds an enabled item or encounters the end of the list.\n */\n private _setActiveItemByIndex(index: number, fallbackDelta: -1 | 1): void {\n const items = this._getItemsArray();\n\n if (!items[index]) {\n return;\n }\n\n while (this._skipPredicateFn(items[index])) {\n index += fallbackDelta;\n\n if (!items[index]) {\n return;\n }\n }\n\n this.setActiveItem(index);\n }\n\n /** Returns the items as an array. */\n private _getItemsArray(): T[] {\n return this._items instanceof QueryList ? this._items.toArray() : this._items;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\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://angular.io/license\n */\n\nimport {DOCUMENT} from '@angular/common';\nimport {\n Inject,\n Injectable,\n InjectionToken,\n OnDestroy,\n Optional,\n SkipSelf,\n} from '@angular/core';\nimport {addAriaReferencedId, getAriaReferenceIds, removeAriaReferencedId} from './aria-reference';\n\n\n/**\n * Interface used to register message elements and keep a count of how many registrations have\n * the same message and the reference to the message element used for the `aria-describedby`.\n */\nexport interface RegisteredMessage {\n /** The element containing the message. */\n messageElement: Element;\n\n /** The number of elements that reference this message element via `aria-describedby`. */\n referenceCount: number;\n}\n\n/** ID used for the body container where all messages are appended. */\nexport const MESSAGES_CONTAINER_ID = 'cdk-describedby-message-container';\n\n/** ID prefix used for each created message element. */\nexport const CDK_DESCRIBEDBY_ID_PREFIX = 'cdk-describedby-message';\n\n/** Attribute given to each host element that is described by a message element. */\nexport const CDK_DESCRIBEDBY_HOST_ATTRIBUTE = 'cdk-describedby-host';\n\n/** Global incremental identifier for each registered message element. */\nlet nextId = 0;\n\n/** Global map of all registered message elements that have been placed into the document. */\nconst messageRegistry = new Map<string|HTMLElement, RegisteredMessage>();\n\n/** Container for all registered messages. */\nlet messagesContainer: HTMLElement | null = null;\n\n/**\n * Utility that creates visually hidden elements with a message content. Useful for elements that\n * want to use aria-describedby to further describe themselves without adding additional visual\n * content.\n */\n@Injectable({providedIn: 'root'})\nexport class AriaDescriber implements OnDestroy {\n private _document: Document;\n\n constructor(@Inject(DOCUMENT) _document: any) {\n this._document = _document;\n }\n\n /**\n * Adds to the host element an aria-describedby reference to a hidden element that contains\n * the message. If the same message has already been registered, then it will reuse the created\n * message element.\n */\n describe(hostElement: Element, message: string|HTMLElement) {\n if (!this._canBeDescribed(hostElement, message)) {\n return;\n }\n\n if (typeof message !== 'string') {\n // We need to ensure that the element has an ID.\n this._setMessageId(message);\n messageRegistry.set(message, {messageElement: message, referenceCount: 0});\n } else if (!messageRegistry.has(message)) {\n this._createMessageElement(message);\n }\n\n if (!this._isElementDescribedByMessage(hostElement, message)) {\n this._addMessageReference(hostElement, message);\n }\n }\n\n /** Removes the host element's aria-describedby reference to the message element. */\n removeDescription(hostElement: Element, message: string|HTMLElement) {\n if (!this._isElementNode(hostElement)) {\n return;\n }\n\n if (this._isElementDescribedByMessage(hostElement, message)) {\n this._removeMessageReference(hostElement, message);\n }\n\n // If the message is a string, it means that it's one that we created for the\n // consumer so we can remove it safely, otherwise we should leave it in place.\n if (typeof message === 'string') {\n const registeredMessage = messageRegistry.get(message);\n if (registeredMessage && registeredMessage.referenceCount === 0) {\n this._deleteMessageElement(message);\n }\n }\n\n if (messagesContainer && messagesContainer.childNodes.length === 0) {\n this._deleteMessagesContainer();\n }\n }\n\n /** Unregisters all created message elements and removes the message container. */\n ngOnDestroy() {\n const describedElements =\n this._document.querySelectorAll(`[${CDK_DESCRIBEDBY_HOST_ATTRIBUTE}]`);\n\n for (let i = 0; i < describedElements.length; i++) {\n this._removeCdkDescribedByReferenceIds(describedElements[i]);\n describedElements[i].removeAttribute(CDK_DESCRIBEDBY_HOST_ATTRIBUTE);\n }\n\n if (messagesContainer) {\n this._deleteMessagesContainer();\n }\n\n messageRegistry.clear();\n }\n\n /**\n * Creates a new element in the visually hidden message container element with the message\n * as its content and adds it to the message registry.\n */\n private _createMessageElement(message: string) {\n const messageElement = this._document.createElement('div');\n this._setMessageId(messageElement);\n messageElement.textContent = message;\n\n this._createMessagesContainer();\n messagesContainer!.appendChild(messageElement);\n\n messageRegistry.set(message, {messageElement, referenceCount: 0});\n }\n\n /** Assigns a unique ID to an element, if it doesn't have one already. */\n private _setMessageId(element: HTMLElement) {\n if (!element.id) {\n element.id = `${CDK_DESCRIBEDBY_ID_PREFIX}-${nextId++}`;\n }\n }\n\n /** Deletes the message element from the global messages container. */\n private _deleteMessageElement(message: string) {\n const registeredMessage = messageRegistry.get(message);\n const messageElement = registeredMessage && registeredMessage.messageElement;\n if (messagesContainer && messageElement) {\n messagesContainer.removeChild(messageElement);\n }\n messageRegistry.delete(message);\n }\n\n /** Creates the global container for all aria-describedby messages. */\n private _createMessagesContainer() {\n if (!messagesContainer) {\n const preExistingContainer = this._document.getElementById(MESSAGES_CONTAINER_ID);\n\n // When going from the server to the client, we may end up in a situation where there's\n // already a container on the page, but we don't have a reference to it. Clear the\n // old container so we don't get duplicates. Doing this, instead of emptying the previous\n // container, should be slightly faster.\n if (preExistingContainer) {\n preExistingContainer.parentNode!.removeChild(preExistingContainer);\n }\n\n messagesContainer = this._document.createElement('div');\n messagesContainer.id = MESSAGES_CONTAINER_ID;\n messagesContainer.setAttribute('aria-hidden', 'true');\n messagesContainer.style.display = 'none';\n this._document.body.appendChild(messagesContainer);\n }\n }\n\n /** Deletes the global messages container. */\n private _deleteMessagesContainer() {\n if (messagesContainer && messagesContainer.parentNode) {\n messagesContainer.parentNode.removeChild(messagesContainer);\n messagesContainer = null;\n }\n }\n\n /** Removes all cdk-describedby messages that are hosted through the element. */\n private _removeCdkDescribedByReferenceIds(element: Element) {\n // Remove all aria-describedby reference IDs that are prefixed by CDK_DESCRIBEDBY_ID_PREFIX\n const originalReferenceIds = getAriaReferenceIds(element, 'aria-describedby')\n .filter(id => id.indexOf(CDK_DESCRIBEDBY_ID_PREFIX) != 0);\n element.setAttribute('aria-describedby', originalReferenceIds.join(' '));\n }\n\n /**\n * Adds a message reference to the element using aria-describedby and increments the registered\n * message's reference count.\n */\n private _addMessageReference(element: Element, message: string|HTMLElement) {\n const registeredMessage = messageRegistry.get(message)!;\n\n // Add the aria-describedby reference and set the\n // describedby_host attribute to mark the element.\n addAriaReferencedId(element, 'aria-describedby', registeredMessage.messageElement.id);\n element.setAttribute(CDK_DESCRIBEDBY_HOST_ATTRIBUTE, '');\n\n registeredMessage.referenceCount++;\n }\n\n /**\n * Removes a message reference from the element using aria-describedby\n * and decrements the registered message's reference count.\n */\n private _removeMessageReference(element: Element, message: string|HTMLElement) {\n const registeredMessage = messageRegistry.get(message)!;\n registeredMessage.referenceCount--;\n\n removeAriaReferencedId(element, 'aria-describedby', registeredMessage.messageElement.id);\n element.removeAttribute(CDK_DESCRIBEDBY_HOST_ATTRIBUTE);\n }\n\n /** Returns true if the element has been described by the provided message ID. */\n private _isElementDescribedByMessage(element: Element, message: string|HTMLElement): boolean {\n const referenceIds = getAriaReferenceIds(element, 'aria-describedby');\n const registeredMessage = messageRegistry.get(message);\n const messageId = registeredMessage && registeredMessage.messageElement.id;\n\n return !!messageId && referenceIds.indexOf(messageId) != -1;\n }\n\n /** Determines whether a message can be described on a particular element. */\n private _canBeDescribed(element: Element, message: string|HTMLElement|void): boolean {\n if (!this._isElementNode(element)) {\n return false;\n }\n\n if (message && typeof message === 'object') {\n // We'd have to make some assumptions about the description element's text, if the consumer\n // passed in an element. Assume that if an element is passed in, the consumer has verified\n // that it can be used as a description.\n return true;\n }\n\n const trimmedMessage = message == null ? '' : `${message}`.trim();\n const ariaLabel = element.getAttribute('aria-label');\n\n // We shouldn't set descriptions if they're exactly the same as the `aria-label` of the\n // element, because screen readers will end up reading out the same text twice in a row.\n return trimmedMessage ? (!ariaLabel || ariaLabel.trim() !== trimmedMessage) : false;\n }\n\n /** Checks whether a node is an Element node. */\n private _isElementNode(element: Node): element is Element {\n return element.nodeType === this._document.ELEMENT_NODE;\n }\n}\n\n\n/** @docs-private @deprecated @breaking-change 8.0.0 */\nexport function ARIA_DESCRIBER_PROVIDER_FACTORY(parentDispatcher: AriaDescriber, _document: any) {\n return parentDispatcher || new AriaDescriber(_document);\n}\n\n/** @docs-private @deprecated @breaking-change 8.0.0 */\nexport const ARIA_DESCRIBER_PROVIDER = {\n // If there is already an AriaDescriber available, use that. Otherwise, provide a new one.\n provide: AriaDescriber,\n deps: [\n [new Optional(), new SkipSelf(), AriaDescriber],\n DOCUMENT as InjectionToken<any>\n ],\n useFactory: ARIA_DESCRIBER_PROVIDER_FACTORY\n};\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\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://angular.io/license\n */\n\n/** IDs are deliminated by an empty space, as per the spec. */\nconst ID_DELIMINATOR = ' ';\n\n/**\n * Adds the given ID to the specified ARIA attribute on an element.\n * Used for attributes such as aria-labelledby, aria-owns, etc.\n */\nexport function addAriaReferencedId(el: Element, attr: string, id: string) {\n const ids = getAriaReferenceIds(el, attr);\n if (ids.some(existingId => existingId.trim() == id.trim())) { return; }\n ids.push(id.trim());\n\n el.setAttribute(attr, ids.join(ID_DELIMINATOR));\n}\n\n/**\n * Removes the given ID from the specified ARIA attribute on an element.\n * Used for attributes such as aria-labelledby, aria-owns, etc.\n */\nexport function removeAriaReferencedId(el: Element, attr: string, id: string) {\n const ids = getAriaReferenceIds(el, attr);\n const filteredIds = ids.filter(val => val != id.trim());\n\n el.setAttribute(attr, filteredIds.join(ID_DELIMINATOR));\n}\n\n/**\n * Gets the list of IDs referenced by the given ARIA attribute on an element.\n * Used for attributes such as aria-labelledby, aria-owns, etc.\n */\nexport function getAriaReferenceIds(el: Element, attr: string): string[] {\n // Get string array of all individual ids (whitespace deliminated) in the attribute value\n return (el.getAttribute(attr) || '').match(/\\S+/g) || [];\n}\n"],"names":["observableOf","tslib_1.__extends"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AWSA,IAAM,cAAc,GAAG,GAAG,CAA1B;;;;;;;;;AAMA,AAAA,SAAgB,mBAAmB,CAAC,EAAW,EAAE,IAAY,EAAE,EAAU,EAAzE;;IACA,IAAQ,GAAG,GAAG,mBAAmB,CAAC,EAAE,EAAE,IAAI,CAAC,CAA3C;IACE,IAAI,GAAG,CAAC,IAAI;;;;IAAC,UAAA,UAAU,EAAzB,EAA6B,OAAA,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,IAAI,EAAE,CAA3D,EAA2D,EAAC,EAAE;QAAE,OAAO;KAAE;IACvE,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,CAA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