{"version":3,"file":"cdk-observers.umd.js","sources":["cdk/observers.es5.js"],"sourcesContent":["/**\n * @license\n * Copyright Google Inc. 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 */\nimport { Directive, ElementRef, EventEmitter, Injectable, Input, NgModule, NgZone, Output } from '@angular/core';\nimport { Subject } from 'rxjs/Subject';\nimport { RxChain, debounceTime } from '@angular/cdk/rxjs';\n\n/**\n * Factory that creates a new MutationObserver and allows us to stub it out in unit tests.\n * \\@docs-private\n */\nvar MatMutationObserverFactory = (function () {\n function MatMutationObserverFactory() {\n }\n /**\n * @param {?} callback\n * @return {?}\n */\n MatMutationObserverFactory.prototype.create = function (callback) {\n return typeof MutationObserver === 'undefined' ? null : new MutationObserver(callback);\n };\n MatMutationObserverFactory.decorators = [\n { type: Injectable },\n ];\n /**\n * @nocollapse\n */\n MatMutationObserverFactory.ctorParameters = function () { return []; };\n return MatMutationObserverFactory;\n}());\n/**\n * Directive that triggers a callback whenever the content of\n * its associated element has changed.\n */\nvar ObserveContent = (function () {\n /**\n * @param {?} _mutationObserverFactory\n * @param {?} _elementRef\n * @param {?} _ngZone\n */\n function ObserveContent(_mutationObserverFactory, _elementRef, _ngZone) {\n this._mutationObserverFactory = _mutationObserverFactory;\n this._elementRef = _elementRef;\n this._ngZone = _ngZone;\n /**\n * Event emitted for each change in the element's content.\n */\n this.event = new EventEmitter();\n /**\n * Used for debouncing the emitted values to the observeContent event.\n */\n this._debouncer = new Subject();\n }\n /**\n * @return {?}\n */\n ObserveContent.prototype.ngAfterContentInit = function () {\n var _this = this;\n if (this.debounce > 0) {\n this._ngZone.runOutsideAngular(function () {\n RxChain.from(_this._debouncer)\n .call(debounceTime, _this.debounce)\n .subscribe(function (mutations) { return _this.event.emit(mutations); });\n });\n }\n else {\n this._debouncer.subscribe(function (mutations) { return _this.event.emit(mutations); });\n }\n this._observer = this._ngZone.runOutsideAngular(function () {\n return _this._mutationObserverFactory.create(function (mutations) {\n _this._debouncer.next(mutations);\n });\n });\n if (this._observer) {\n this._observer.observe(this._elementRef.nativeElement, {\n characterData: true,\n childList: true,\n subtree: true\n });\n }\n };\n /**\n * @return {?}\n */\n ObserveContent.prototype.ngOnDestroy = function () {\n if (this._observer) {\n this._observer.disconnect();\n }\n this._debouncer.complete();\n };\n ObserveContent.decorators = [\n { type: Directive, args: [{\n selector: '[cdkObserveContent]',\n exportAs: 'cdkObserveContent',\n },] },\n ];\n /**\n * @nocollapse\n */\n ObserveContent.ctorParameters = function () { return [\n { type: MatMutationObserverFactory, },\n { type: ElementRef, },\n { type: NgZone, },\n ]; };\n ObserveContent.propDecorators = {\n 'event': [{ type: Output, args: ['cdkObserveContent',] },],\n 'debounce': [{ type: Input },],\n };\n return ObserveContent;\n}());\nvar ObserversModule = (function () {\n function ObserversModule() {\n }\n ObserversModule.decorators = [\n { type: NgModule, args: [{\n exports: [ObserveContent],\n declarations: [ObserveContent],\n providers: [MatMutationObserverFactory]\n },] },\n ];\n /**\n * @nocollapse\n */\n ObserversModule.ctorParameters = function () { return []; };\n return ObserversModule;\n}());\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { MatMutationObserverFactory, ObserveContent, ObserversModule };\n//# sourceMappingURL=observers.es5.js.map\n"],"names":["Injectable","EventEmitter","Subject","RxChain","debounceTime","Directive","ElementRef","NgZone","Output","Input","NgModule"],"mappings":";;;;;;;;;;;;;AAWA;;;;AAIA,IAAI,0BAA0B,IAAI,YAAY;IAC1C,SAAS,0BAA0B,GAAG;KACrC;;;;;IAKD,0BAA0B,CAAC,SAAS,CAAC,MAAM,GAAG,UAAU,QAAQ,EAAE;QAC9D,OAAO,OAAO,gBAAgB,KAAK,WAAW,GAAG,IAAI,GAAG,IAAI,gBAAgB,CAAC,QAAQ,CAAC,CAAC;KAC1F,CAAC;IACF,0BAA0B,CAAC,UAAU,GAAG;QACpC,EAAE,IAAI,EAAEA,wBAAU,EAAE;KACvB,CAAC;;;;IAIF,0BAA0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