blob: 5c6b50d077b167acbb867c7cd665cfe8ccf63eec [file] [log] [blame]
{"version":3,"sources":["src/cdk/cdk-scrolling.umd.js"],"names":["global","factory","exports","module","require","define","amd","self","ng","cdk","scrolling","coercion","core","rxjs","operators","platform","common","bidi","collections","this","i0","i1","i2","VIRTUAL_SCROLL_STRATEGY","InjectionToken","FixedSizeVirtualScrollStrategy","itemSize","minBufferPx","maxBufferPx","_scrolledIndexChange","Subject","scrolledIndexChange","pipe","distinctUntilChanged","_viewport","_itemSize","_minBufferPx","_maxBufferPx","prototype","attach","viewport","_updateTotalContentSize","_updateRenderedRange","detach","complete","updateItemAndBufferSize","onContentScrolled","onDataLengthChanged","onContentRendered","onRenderedOffsetChanged","scrollToIndex","index","behavior","scrollToOffset","setTotalContentSize","getDataLength","renderedRange","getRenderedRange","newRange","start","end","viewportSize","getViewportSize","dataLength","scrollOffset","measureScrollOffset","firstVisibleIndex","maxVisibleItems","Math","ceil","newVisibleIndex","max","min","floor","startBuffer","expandStart","endBuffer","expandEnd","setRenderedRange","setRenderedContentOffset","next","_fixedSizeVirtualScrollStrategyFactory","fixedSizeDir","_scrollStrategy","CdkFixedSizeVirtualScroll","Object","defineProperty","get","set","value","coerceNumberProperty","enumerable","configurable","ngOnChanges","decorators","type","Directive","args","selector","providers","provide","useFactory","deps","forwardRef","propDecorators","Input","ScrollDispatcher","_ngZone","_platform","document","_scrolled","_globalSubscription","_scrolledCount","scrollContainers","Map","_document","register","scrollable","_this","has","elementScrolled","subscribe","deregister","scrollableReference","unsubscribe","delete","scrolled","auditTimeInMs","isBrowser","Observable","observer","_addGlobalListener","subscription","auditTime","_removeGlobalListener","of","ngOnDestroy","forEach","_","container","ancestorScrolled","elementOrElementRef","ancestors","getAncestorScrollContainers","filter","target","indexOf","scrollingContainers","_subscription","_scrollableContainsElement","push","_getWindow","defaultView","window","element","coerceElement","scrollableElement","getElementRef","nativeElement","parentElement","runOutsideAngular","fromEvent","ɵprov","ɵɵdefineInjectable","ScrollDispatcher_Factory","ɵɵinject","NgZone","Platform","DOCUMENT","token","providedIn","Injectable","ctorParameters","undefined","Optional","Inject","CdkScrollable","elementRef","scrollDispatcher","ngZone","dir","_destroyed","_elementScrolled","takeUntil","ngOnInit","scrollTo","options","el","isRtl","left","right","bottom","top","scrollHeight","clientHeight","getRtlScrollAxisType","scrollWidth","clientWidth","_applyScrollToOptions","supportsScrollBehavior","scrollTop","scrollLeft","from","ElementRef","Directionality","extendStatics","d","b","setPrototypeOf","__proto__","Array","p","hasOwnProperty","call","ViewportRuler","_change","_changeListener","event","addEventListener","change","_updateViewportSize","removeEventListener","_viewportSize","output","width","height","getViewportRect","scrollPosition","getViewportScrollPosition","_a","documentElement","documentRect","getBoundingClientRect","body","scrollY","scrollX","throttleTime","innerWidth","innerHeight","ViewportRuler_Factory","SCROLL_SCHEDULER","requestAnimationFrame","animationFrameScheduler","asapScheduler","CdkVirtualScrollViewport","_super","_changeDetectorRef","viewportRuler","_detachedSubject","_renderedRangeSubject","_orientation","Promise","resolve","then","run","renderedRangeStream","_totalContentSize","_totalContentWidth","_totalContentHeight","_renderedRange","_dataLength","_renderedContentOffset","_renderedContentOffsetNeedsRewrite","_isChangeDetectionPending","_runAfterChangeDetection","_viewportChanges","Subscription","EMPTY","checkViewportSize","__extends","TypeError","String","__","constructor","create","orientation","_calculateSpacerSize","_measureViewportSize","startWith","_markChangeDetectionNeeded","forOf","_forOf","dataStream","data","newLength","length","_doChangeDetection","size","range","rangesEqual","r1","r2","getOffsetToRenderedContentStart","offset","to","isHorizontal","axis","transform","Number","_renderedContentTransform","measureRenderedContentSize","contentEl","_contentWrapper","offsetWidth","offsetHeight","measureRangeSize","viewportEl","runAfter","e_1","style","markForCheck","runAfterChangeDetection","runAfterChangeDetection_1","__values","o","s","Symbol","iterator","m","i","done","runAfterChangeDetection_1_1","fn","e_1_1","error","return","getOffset","direction","node","rect","Component","template","host","class","[class.cdk-virtual-scroll-orientation-horizontal]","[class.cdk-virtual-scroll-orientation-vertical]","encapsulation","ViewEncapsulation","None","changeDetection","ChangeDetectionStrategy","OnPush","useExisting","styles","ChangeDetectorRef","Output","ViewChild","static","CdkScrollableModule","ScrollingModule","CdkVirtualForOf","_viewContainerRef","_template","_differs","_viewRepeater","viewChange","_dataSourceChanges","pairwise","switchMap","_b","__read","n","r","e","ar","_changeDataSource","shareReplay","_differ","_needsUpdate","_data","_onRenderedDataChange","_cdkVirtualForOf","isDataSource","ArrayDataSource","isObservable","_cdkVirtualForTrackBy","item","viewCacheSize","firstNode","lastNode","renderedStartIndex","rangeLen","view","rootNodes","ngDoCheck","changes","diff","_renderedItems","_applyChanges","_updateContext","slice","find","cdkVirtualForTrackBy","oldDs","newDs","disconnect","connect","count","context","_updateComputedContextProperties","detectChanges","applyChanges","record","_adjustedPreviousIndex","currentIndex","_getEmbeddedViewArgs","forEachIdentityChange","$implicit","first","last","even","odd","templateRef","cdkVirtualForOf","_VIEW_REPEATER_STRATEGY","useClass","_RecycleViewRepeaterStrategy","ViewContainerRef","TemplateRef","IterableDiffers","SkipSelf","cdkVirtualForTemplate","cdkVirtualForTemplateCacheSize","NgModule","declarations","imports","BidiModule","PlatformModule","DEFAULT_RESIZE_TIME","DEFAULT_SCROLL_TIME"],"mappings":"CAAC,SAAUA,EAAQC,GACI,iBAAZC,SAA0C,oBAAXC,OAAyBF,EAAQC,QAASE,QAAQ,yBAA0BA,QAAQ,iBAAkBA,QAAQ,QAASA,QAAQ,kBAAmBA,QAAQ,yBAA0BA,QAAQ,mBAAoBA,QAAQ,qBAAsBA,QAAQ,6BAC1Q,mBAAXC,QAAyBA,OAAOC,IAAMD,OAAO,yBAA0B,CAAC,UAAW,wBAAyB,gBAAiB,OAAQ,iBAAkB,wBAAyB,kBAAmB,oBAAqB,4BAA6BJ,GAClOA,IAAzBD,EAASA,GAAUO,MAAsBC,GAAKR,EAAOQ,IAAM,GAAIR,EAAOQ,GAAGC,IAAMT,EAAOQ,GAAGC,KAAO,GAAIT,EAAOQ,GAAGC,IAAI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,WAAY,CAAC,CAAEC,KAAM3E,EAAGgZ,YAC1D,CAAErU,KAAM3E,EAAGkJ,UAEfwL,EAAgBtP,eAAiB,CAC7BqT,gBAAiB,CAAC,CAAE9T,KAAM3E,EAAGqF,QAC7B+R,qBAAsB,CAAC,CAAEzS,KAAM3E,EAAGqF,QAClC4T,sBAAuB,CAAC,CAAEtU,KAAM3E,EAAGqF,QACnC6T,+BAAgC,CAAC,CAAEvU,KAAM3E,EAAGqF,UAU5CmP,EACA,SAASA,OAIO9P,WAAa,CAC7B,CAAEC,KAAM3E,EAAGmZ,SAAUtU,KAAM,CAAC,CAChB/F,QAAS,CAAC8K,GACVwP,aAAc,CAACxP,QAM3B6K,EACA,SAASA,OAIG/P,WAAa,CACzB,CAAEC,KAAM3E,EAAGmZ,SAAUtU,KAAM,CAAC,CAChBwU,QAAS,CACLxZ,EAAKyZ,WACLrZ,EAAGsZ,eACH/E,GAEJ1V,QAAS,CACLe,EAAKyZ,WACL9E,EACAxQ,EACA0Q,EACA1G,GAEJoL,aAAc,CACVpV,EACA0Q,EACA1G;;;;;;;;AAiBpBlP,EAAQkF,0BAA4BA,EACpClF,EAAQ8K,cAAgBA,EACxB9K,EAAQ0V,oBAAsBA,EAC9B1V,EAAQ4V,gBAAkBA,EAC1B5V,EAAQkP,yBAA2BA,EACnClP,EAAQ0a,oBA71BkB,GA81B1B1a,EAAQ2a,oBA79CkB,GA89C1B3a,EAAQuB,+BAAiCA,EACzCvB,EAAQwG,iBAAmBA,EAC3BxG,EAAQ2V,gBAAkBA,EAC1B3V,EAAQqB,wBAA0BA,EAClCrB,EAAQoN,cAAgBA,EACxBpN,EAAQ+E,uCAAyCA,EAEjDI,OAAOC,eAAepF,EAAS,aAAc,CAAEuF,OAAO","sourcesContent":["(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/cdk/coercion'), require('@angular/core'), require('rxjs'), require('rxjs/operators'), require('@angular/cdk/platform'), require('@angular/common'), require('@angular/cdk/bidi'), require('@angular/cdk/collections')) :\n typeof define === 'function' && define.amd ? define('@angular/cdk/scrolling', ['exports', '@angular/cdk/coercion', '@angular/core', 'rxjs', 'rxjs/operators', '@angular/cdk/platform', '@angular/common', '@angular/cdk/bidi', '@angular/cdk/collections'], factory) :\n (global = global || self, factory((global.ng = global.ng || {}, global.ng.cdk = global.ng.cdk || {}, global.ng.cdk.scrolling = {}), global.ng.cdk.coercion, global.ng.core, global.rxjs, global.rxjs.operators, global.ng.cdk.platform, global.ng.common, global.ng.cdk.bidi, global.ng.cdk.collections));\n}(this, (function (exports, coercion, i0, rxjs, operators, i1, i2, bidi, collections) { 'use strict';\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 /** The injection token used to specify the virtual scrolling strategy. */\n var VIRTUAL_SCROLL_STRATEGY = new i0.InjectionToken('VIRTUAL_SCROLL_STRATEGY');\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 /** Virtual scrolling strategy for lists with items of known fixed size. */\n var FixedSizeVirtualScrollStrategy = /** @class */ (function () {\n /**\n * @param itemSize The size of the items in the virtually scrolling list.\n * @param minBufferPx The minimum amount of buffer (in pixels) before needing to render more\n * @param maxBufferPx The amount of buffer (in pixels) to render when rendering more.\n */\n function FixedSizeVirtualScrollStrategy(itemSize, minBufferPx, maxBufferPx) {\n this._scrolledIndexChange = new rxjs.Subject();\n /** @docs-private Implemented as part of VirtualScrollStrategy. */\n this.scrolledIndexChange = this._scrolledIndexChange.pipe(operators.distinctUntilChanged());\n /** The attached viewport. */\n this._viewport = null;\n this._itemSize = itemSize;\n this._minBufferPx = minBufferPx;\n this._maxBufferPx = maxBufferPx;\n }\n /**\n * Attaches this scroll strategy to a viewport.\n * @param viewport The viewport to attach this strategy to.\n */\n FixedSizeVirtualScrollStrategy.prototype.attach = function (viewport) {\n this._viewport = viewport;\n this._updateTotalContentSize();\n this._updateRenderedRange();\n };\n /** Detaches this scroll strategy from the currently attached viewport. */\n FixedSizeVirtualScrollStrategy.prototype.detach = function () {\n this._scrolledIndexChange.complete();\n this._viewport = null;\n };\n /**\n * Update the item size and buffer size.\n * @param itemSize The size of the items in the virtually scrolling list.\n * @param minBufferPx The minimum amount of buffer (in pixels) before needing to render more\n * @param maxBufferPx The amount of buffer (in pixels) to render when rendering more.\n */\n FixedSizeVirtualScrollStrategy.prototype.updateItemAndBufferSize = function (itemSize, minBufferPx, maxBufferPx) {\n if (maxBufferPx < minBufferPx && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error('CDK virtual scroll: maxBufferPx must be greater than or equal to minBufferPx');\n }\n this._itemSize = itemSize;\n this._minBufferPx = minBufferPx;\n this._maxBufferPx = maxBufferPx;\n this._updateTotalContentSize();\n this._updateRenderedRange();\n };\n /** @docs-private Implemented as part of VirtualScrollStrategy. */\n FixedSizeVirtualScrollStrategy.prototype.onContentScrolled = function () {\n this._updateRenderedRange();\n };\n /** @docs-private Implemented as part of VirtualScrollStrategy. */\n FixedSizeVirtualScrollStrategy.prototype.onDataLengthChanged = function () {\n this._updateTotalContentSize();\n this._updateRenderedRange();\n };\n /** @docs-private Implemented as part of VirtualScrollStrategy. */\n FixedSizeVirtualScrollStrategy.prototype.onContentRendered = function () { };\n /** @docs-private Implemented as part of VirtualScrollStrategy. */\n FixedSizeVirtualScrollStrategy.prototype.onRenderedOffsetChanged = function () { };\n /**\n * Scroll to the offset for the given index.\n * @param index The index of the element to scroll to.\n * @param behavior The ScrollBehavior to use when scrolling.\n */\n FixedSizeVirtualScrollStrategy.prototype.scrollToIndex = function (index, behavior) {\n if (this._viewport) {\n this._viewport.scrollToOffset(index * this._itemSize, behavior);\n }\n };\n /** Update the viewport's total content size. */\n FixedSizeVirtualScrollStrategy.prototype._updateTotalContentSize = function () {\n if (!this._viewport) {\n return;\n }\n this._viewport.setTotalContentSize(this._viewport.getDataLength() * this._itemSize);\n };\n /** Update the viewport's rendered range. */\n FixedSizeVirtualScrollStrategy.prototype._updateRenderedRange = function () {\n if (!this._viewport) {\n return;\n }\n var renderedRange = this._viewport.getRenderedRange();\n var newRange = { start: renderedRange.start, end: renderedRange.end };\n var viewportSize = this._viewport.getViewportSize();\n var dataLength = this._viewport.getDataLength();\n var scrollOffset = this._viewport.measureScrollOffset();\n // Prevent NaN as result when dividing by zero.\n var firstVisibleIndex = (this._itemSize > 0) ? scrollOffset / this._itemSize : 0;\n // If user scrolls to the bottom of the list and data changes to a smaller list\n if (newRange.end > dataLength) {\n // We have to recalculate the first visible index based on new data length and viewport size.\n var maxVisibleItems = Math.ceil(viewportSize / this._itemSize);\n var newVisibleIndex = Math.max(0, Math.min(firstVisibleIndex, dataLength - maxVisibleItems));\n // If first visible index changed we must update scroll offset to handle start/end buffers\n // Current range must also be adjusted to cover the new position (bottom of new list).\n if (firstVisibleIndex != newVisibleIndex) {\n firstVisibleIndex = newVisibleIndex;\n scrollOffset = newVisibleIndex * this._itemSize;\n newRange.start = Math.floor(firstVisibleIndex);\n }\n newRange.end = Math.max(0, Math.min(dataLength, newRange.start + maxVisibleItems));\n }\n var startBuffer = scrollOffset - newRange.start * this._itemSize;\n if (startBuffer < this._minBufferPx && newRange.start != 0) {\n var expandStart = Math.ceil((this._maxBufferPx - startBuffer) / this._itemSize);\n newRange.start = Math.max(0, newRange.start - expandStart);\n newRange.end = Math.min(dataLength, Math.ceil(firstVisibleIndex + (viewportSize + this._minBufferPx) / this._itemSize));\n }\n else {\n var endBuffer = newRange.end * this._itemSize - (scrollOffset + viewportSize);\n if (endBuffer < this._minBufferPx && newRange.end != dataLength) {\n var expandEnd = Math.ceil((this._maxBufferPx - endBuffer) / this._itemSize);\n if (expandEnd > 0) {\n newRange.end = Math.min(dataLength, newRange.end + expandEnd);\n newRange.start = Math.max(0, Math.floor(firstVisibleIndex - this._minBufferPx / this._itemSize));\n }\n }\n }\n this._viewport.setRenderedRange(newRange);\n this._viewport.setRenderedContentOffset(this._itemSize * newRange.start);\n this._scrolledIndexChange.next(Math.floor(firstVisibleIndex));\n };\n return FixedSizeVirtualScrollStrategy;\n }());\n /**\n * Provider factory for `FixedSizeVirtualScrollStrategy` that simply extracts the already created\n * `FixedSizeVirtualScrollStrategy` from the given directive.\n * @param fixedSizeDir The instance of `CdkFixedSizeVirtualScroll` to extract the\n * `FixedSizeVirtualScrollStrategy` from.\n */\n function _fixedSizeVirtualScrollStrategyFactory(fixedSizeDir) {\n return fixedSizeDir._scrollStrategy;\n }\n /** A virtual scroll strategy that supports fixed-size items. */\n var CdkFixedSizeVirtualScroll = /** @class */ (function () {\n function CdkFixedSizeVirtualScroll() {\n this._itemSize = 20;\n this._minBufferPx = 100;\n this._maxBufferPx = 200;\n /** The scroll strategy used by this directive. */\n this._scrollStrategy = new FixedSizeVirtualScrollStrategy(this.itemSize, this.minBufferPx, this.maxBufferPx);\n }\n Object.defineProperty(CdkFixedSizeVirtualScroll.prototype, \"itemSize\", {\n /** The size of the items in the list (in pixels). */\n get: function () { return this._itemSize; },\n set: function (value) { this._itemSize = coercion.coerceNumberProperty(value); },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CdkFixedSizeVirtualScroll.prototype, \"minBufferPx\", {\n /**\n * The minimum amount of buffer rendered beyond the viewport (in pixels).\n * If the amount of buffer dips below this number, more items will be rendered. Defaults to 100px.\n */\n get: function () { return this._minBufferPx; },\n set: function (value) { this._minBufferPx = coercion.coerceNumberProperty(value); },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CdkFixedSizeVirtualScroll.prototype, \"maxBufferPx\", {\n /**\n * The number of pixels worth of buffer to render for when rendering new items. Defaults to 200px.\n */\n get: function () { return this._maxBufferPx; },\n set: function (value) { this._maxBufferPx = coercion.coerceNumberProperty(value); },\n enumerable: false,\n configurable: true\n });\n CdkFixedSizeVirtualScroll.prototype.ngOnChanges = function () {\n this._scrollStrategy.updateItemAndBufferSize(this.itemSize, this.minBufferPx, this.maxBufferPx);\n };\n return CdkFixedSizeVirtualScroll;\n }());\n CdkFixedSizeVirtualScroll.decorators = [\n { type: i0.Directive, args: [{\n selector: 'cdk-virtual-scroll-viewport[itemSize]',\n providers: [{\n provide: VIRTUAL_SCROLL_STRATEGY,\n useFactory: _fixedSizeVirtualScrollStrategyFactory,\n deps: [i0.forwardRef(function () { return CdkFixedSizeVirtualScroll; })],\n }],\n },] }\n ];\n CdkFixedSizeVirtualScroll.propDecorators = {\n itemSize: [{ type: i0.Input }],\n minBufferPx: [{ type: i0.Input }],\n maxBufferPx: [{ type: i0.Input }]\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 /** Time in ms to throttle the scrolling events by default. */\n var DEFAULT_SCROLL_TIME = 20;\n /**\n * Service contained all registered Scrollable references and emits an event when any one of the\n * Scrollable references emit a scrolled event.\n */\n var ScrollDispatcher = /** @class */ (function () {\n function ScrollDispatcher(_ngZone, _platform, document) {\n this._ngZone = _ngZone;\n this._platform = _platform;\n /** Subject for notifying that a registered scrollable reference element has been scrolled. */\n this._scrolled = new rxjs.Subject();\n /** Keeps track of the global `scroll` and `resize` subscriptions. */\n this._globalSubscription = null;\n /** Keeps track of the amount of subscriptions to `scrolled`. Used for cleaning up afterwards. */\n this._scrolledCount = 0;\n /**\n * Map of all the scrollable references that are registered with the service and their\n * scroll event subscriptions.\n */\n this.scrollContainers = new Map();\n this._document = document;\n }\n /**\n * Registers a scrollable instance with the service and listens for its scrolled events. When the\n * scrollable is scrolled, the service emits the event to its scrolled observable.\n * @param scrollable Scrollable instance to be registered.\n */\n ScrollDispatcher.prototype.register = function (scrollable) {\n var _this = this;\n if (!this.scrollContainers.has(scrollable)) {\n this.scrollContainers.set(scrollable, scrollable.elementScrolled()\n .subscribe(function () { return _this._scrolled.next(scrollable); }));\n }\n };\n /**\n * Deregisters a Scrollable reference and unsubscribes from its scroll event observable.\n * @param scrollable Scrollable instance to be deregistered.\n */\n ScrollDispatcher.prototype.deregister = function (scrollable) {\n var scrollableReference = this.scrollContainers.get(scrollable);\n if (scrollableReference) {\n scrollableReference.unsubscribe();\n this.scrollContainers.delete(scrollable);\n }\n };\n /**\n * Returns an observable that emits an event whenever any of the registered Scrollable\n * references (or window, document, or body) fire a scrolled event. Can provide a time in ms\n * to override the default \"throttle\" time.\n *\n * **Note:** in order to avoid hitting change detection for every scroll event,\n * all of the events emitted from this stream will be run outside the Angular zone.\n * If you need to update any data bindings as a result of a scroll event, you have\n * to run the callback using `NgZone.run`.\n */\n ScrollDispatcher.prototype.scrolled = function (auditTimeInMs) {\n var _this = this;\n if (auditTimeInMs === void 0) { auditTimeInMs = DEFAULT_SCROLL_TIME; }\n if (!this._platform.isBrowser) {\n return rxjs.of();\n }\n return new rxjs.Observable(function (observer) {\n if (!_this._globalSubscription) {\n _this._addGlobalListener();\n }\n // In the case of a 0ms delay, use an observable without auditTime\n // since it does add a perceptible delay in processing overhead.\n var subscription = auditTimeInMs > 0 ?\n _this._scrolled.pipe(operators.auditTime(auditTimeInMs)).subscribe(observer) :\n _this._scrolled.subscribe(observer);\n _this._scrolledCount++;\n return function () {\n subscription.unsubscribe();\n _this._scrolledCount--;\n if (!_this._scrolledCount) {\n _this._removeGlobalListener();\n }\n };\n });\n };\n ScrollDispatcher.prototype.ngOnDestroy = function () {\n var _this = this;\n this._removeGlobalListener();\n this.scrollContainers.forEach(function (_, container) { return _this.deregister(container); });\n this._scrolled.complete();\n };\n /**\n * Returns an observable that emits whenever any of the\n * scrollable ancestors of an element are scrolled.\n * @param elementOrElementRef Element whose ancestors to listen for.\n * @param auditTimeInMs Time to throttle the scroll events.\n */\n ScrollDispatcher.prototype.ancestorScrolled = function (elementOrElementRef, auditTimeInMs) {\n var ancestors = this.getAncestorScrollContainers(elementOrElementRef);\n return this.scrolled(auditTimeInMs).pipe(operators.filter(function (target) {\n return !target || ancestors.indexOf(target) > -1;\n }));\n };\n /** Returns all registered Scrollables that contain the provided element. */\n ScrollDispatcher.prototype.getAncestorScrollContainers = function (elementOrElementRef) {\n var _this = this;\n var scrollingContainers = [];\n this.scrollContainers.forEach(function (_subscription, scrollable) {\n if (_this._scrollableContainsElement(scrollable, elementOrElementRef)) {\n scrollingContainers.push(scrollable);\n }\n });\n return scrollingContainers;\n };\n /** Use defaultView of injected document if available or fallback to global window reference */\n ScrollDispatcher.prototype._getWindow = function () {\n return this._document.defaultView || window;\n };\n /** Returns true if the element is contained within the provided Scrollable. */\n ScrollDispatcher.prototype._scrollableContainsElement = function (scrollable, elementOrElementRef) {\n var element = coercion.coerceElement(elementOrElementRef);\n var scrollableElement = scrollable.getElementRef().nativeElement;\n // Traverse through the element parents until we reach null, checking if any of the elements\n // are the scrollable's element.\n do {\n if (element == scrollableElement) {\n return true;\n }\n } while (element = element.parentElement);\n return false;\n };\n /** Sets up the global scroll listeners. */\n ScrollDispatcher.prototype._addGlobalListener = function () {\n var _this = this;\n this._globalSubscription = this._ngZone.runOutsideAngular(function () {\n var window = _this._getWindow();\n return rxjs.fromEvent(window.document, 'scroll').subscribe(function () { return _this._scrolled.next(); });\n });\n };\n /** Cleans up the global scroll listener. */\n ScrollDispatcher.prototype._removeGlobalListener = function () {\n if (this._globalSubscription) {\n this._globalSubscription.unsubscribe();\n this._globalSubscription = null;\n }\n };\n return ScrollDispatcher;\n }());\n ScrollDispatcher.ɵprov = i0.ɵɵdefineInjectable({ factory: function ScrollDispatcher_Factory() { return new ScrollDispatcher(i0.ɵɵinject(i0.NgZone), i0.ɵɵinject(i1.Platform), i0.ɵɵinject(i2.DOCUMENT, 8)); }, token: ScrollDispatcher, providedIn: \"root\" });\n ScrollDispatcher.decorators = [\n { type: i0.Injectable, args: [{ providedIn: 'root' },] }\n ];\n ScrollDispatcher.ctorParameters = function () { return [\n { type: i0.NgZone },\n { type: i1.Platform },\n { type: undefined, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [i2.DOCUMENT,] }] }\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 /**\n * Sends an event when the directive's element is scrolled. Registers itself with the\n * ScrollDispatcher service to include itself as part of its collection of scrolling events that it\n * can be listened to through the service.\n */\n var CdkScrollable = /** @class */ (function () {\n function CdkScrollable(elementRef, scrollDispatcher, ngZone, dir) {\n var _this = this;\n this.elementRef = elementRef;\n this.scrollDispatcher = scrollDispatcher;\n this.ngZone = ngZone;\n this.dir = dir;\n this._destroyed = new rxjs.Subject();\n this._elementScrolled = new rxjs.Observable(function (observer) { return _this.ngZone.runOutsideAngular(function () { return rxjs.fromEvent(_this.elementRef.nativeElement, 'scroll').pipe(operators.takeUntil(_this._destroyed))\n .subscribe(observer); }); });\n }\n CdkScrollable.prototype.ngOnInit = function () {\n this.scrollDispatcher.register(this);\n };\n CdkScrollable.prototype.ngOnDestroy = function () {\n this.scrollDispatcher.deregister(this);\n this._destroyed.next();\n this._destroyed.complete();\n };\n /** Returns observable that emits when a scroll event is fired on the host element. */\n CdkScrollable.prototype.elementScrolled = function () {\n return this._elementScrolled;\n };\n /** Gets the ElementRef for the viewport. */\n CdkScrollable.prototype.getElementRef = function () {\n return this.elementRef;\n };\n /**\n * Scrolls to the specified offsets. This is a normalized version of the browser's native scrollTo\n * method, since browsers are not consistent about what scrollLeft means in RTL. For this method\n * left and right always refer to the left and right side of the scrolling container irrespective\n * of the layout direction. start and end refer to left and right in an LTR context and vice-versa\n * in an RTL context.\n * @param options specified the offsets to scroll to.\n */\n CdkScrollable.prototype.scrollTo = function (options) {\n var el = this.elementRef.nativeElement;\n var isRtl = this.dir && this.dir.value == 'rtl';\n // Rewrite start & end offsets as right or left offsets.\n if (options.left == null) {\n options.left = isRtl ? options.end : options.start;\n }\n if (options.right == null) {\n options.right = isRtl ? options.start : options.end;\n }\n // Rewrite the bottom offset as a top offset.\n if (options.bottom != null) {\n options.top =\n el.scrollHeight - el.clientHeight - options.bottom;\n }\n // Rewrite the right offset as a left offset.\n if (isRtl && i1.getRtlScrollAxisType() != 0 /* NORMAL */) {\n if (options.left != null) {\n options.right =\n el.scrollWidth - el.clientWidth - options.left;\n }\n if (i1.getRtlScrollAxisType() == 2 /* INVERTED */) {\n options.left = options.right;\n }\n else if (i1.getRtlScrollAxisType() == 1 /* NEGATED */) {\n options.left = options.right ? -options.right : options.right;\n }\n }\n else {\n if (options.right != null) {\n options.left =\n el.scrollWidth - el.clientWidth - options.right;\n }\n }\n this._applyScrollToOptions(options);\n };\n CdkScrollable.prototype._applyScrollToOptions = function (options) {\n var el = this.elementRef.nativeElement;\n if (i1.supportsScrollBehavior()) {\n el.scrollTo(options);\n }\n else {\n if (options.top != null) {\n el.scrollTop = options.top;\n }\n if (options.left != null) {\n el.scrollLeft = options.left;\n }\n }\n };\n /**\n * Measures the scroll offset relative to the specified edge of the viewport. This method can be\n * used instead of directly checking scrollLeft or scrollTop, since browsers are not consistent\n * about what scrollLeft means in RTL. The values returned by this method are normalized such that\n * left and right always refer to the left and right side of the scrolling container irrespective\n * of the layout direction. start and end refer to left and right in an LTR context and vice-versa\n * in an RTL context.\n * @param from The edge to measure from.\n */\n CdkScrollable.prototype.measureScrollOffset = function (from) {\n var LEFT = 'left';\n var RIGHT = 'right';\n var el = this.elementRef.nativeElement;\n if (from == 'top') {\n return el.scrollTop;\n }\n if (from == 'bottom') {\n return el.scrollHeight - el.clientHeight - el.scrollTop;\n }\n // Rewrite start & end as left or right offsets.\n var isRtl = this.dir && this.dir.value == 'rtl';\n if (from == 'start') {\n from = isRtl ? RIGHT : LEFT;\n }\n else if (from == 'end') {\n from = isRtl ? LEFT : RIGHT;\n }\n if (isRtl && i1.getRtlScrollAxisType() == 2 /* INVERTED */) {\n // For INVERTED, scrollLeft is (scrollWidth - clientWidth) when scrolled all the way left and\n // 0 when scrolled all the way right.\n if (from == LEFT) {\n return el.scrollWidth - el.clientWidth - el.scrollLeft;\n }\n else {\n return el.scrollLeft;\n }\n }\n else if (isRtl && i1.getRtlScrollAxisType() == 1 /* NEGATED */) {\n // For NEGATED, scrollLeft is -(scrollWidth - clientWidth) when scrolled all the way left and\n // 0 when scrolled all the way right.\n if (from == LEFT) {\n return el.scrollLeft + el.scrollWidth - el.clientWidth;\n }\n else {\n return -el.scrollLeft;\n }\n }\n else {\n // For NORMAL, as well as non-RTL contexts, scrollLeft is 0 when scrolled all the way left and\n // (scrollWidth - clientWidth) when scrolled all the way right.\n if (from == LEFT) {\n return el.scrollLeft;\n }\n else {\n return el.scrollWidth - el.clientWidth - el.scrollLeft;\n }\n }\n };\n return CdkScrollable;\n }());\n CdkScrollable.decorators = [\n { type: i0.Directive, args: [{\n selector: '[cdk-scrollable], [cdkScrollable]'\n },] }\n ];\n CdkScrollable.ctorParameters = function () { return [\n { type: i0.ElementRef },\n { type: ScrollDispatcher },\n { type: i0.NgZone },\n { type: bidi.Directionality, decorators: [{ type: i0.Optional }] }\n ]; };\n\n /*! *****************************************************************************\n Copyright (c) Microsoft Corporation.\n\n Permission to use, copy, modify, and/or distribute this software for any\n purpose with or without fee is hereby granted.\n\n THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n PERFORMANCE OF THIS SOFTWARE.\n ***************************************************************************** */\n /* global Reflect, Promise */\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b)\n if (Object.prototype.hasOwnProperty.call(b, p))\n d[p] = b[p]; };\n return extendStatics(d, b);\n };\n function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n }\n var __assign = function () {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s)\n if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n };\n function __rest(s, e) {\n var t = {};\n for (var p in s)\n if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n }\n function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\")\n r = Reflect.decorate(decorators, target, key, desc);\n else\n for (var i = decorators.length - 1; i >= 0; i--)\n if (d = decorators[i])\n r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n }\n function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); };\n }\n function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\")\n return Reflect.metadata(metadataKey, metadataValue);\n }\n function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try {\n step(generator.next(value));\n }\n catch (e) {\n reject(e);\n } }\n function rejected(value) { try {\n step(generator[\"throw\"](value));\n }\n catch (e) {\n reject(e);\n } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n }\n function __generator(thisArg, body) {\n var _ = { label: 0, sent: function () { if (t[0] & 1)\n throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function () { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f)\n throw new TypeError(\"Generator is already executing.\");\n while (_)\n try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)\n return t;\n if (y = 0, t)\n op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0:\n case 1:\n t = op;\n break;\n case 4:\n _.label++;\n return { value: op[1], done: false };\n case 5:\n _.label++;\n y = op[1];\n op = [0];\n continue;\n case 7:\n op = _.ops.pop();\n _.trys.pop();\n continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {\n _ = 0;\n continue;\n }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {\n _.label = op[1];\n break;\n }\n if (op[0] === 6 && _.label < t[1]) {\n _.label = t[1];\n t = op;\n break;\n }\n if (t && _.label < t[2]) {\n _.label = t[2];\n _.ops.push(op);\n break;\n }\n if (t[2])\n _.ops.pop();\n _.trys.pop();\n continue;\n }\n op = body.call(thisArg, _);\n }\n catch (e) {\n op = [6, e];\n y = 0;\n }\n finally {\n f = t = 0;\n }\n if (op[0] & 5)\n throw op[1];\n return { value: op[0] ? op[1] : void 0, done: true };\n }\n }\n var __createBinding = Object.create ? (function (o, m, k, k2) {\n if (k2 === undefined)\n k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });\n }) : (function (o, m, k, k2) {\n if (k2 === undefined)\n k2 = k;\n o[k2] = m[k];\n });\n function __exportStar(m, o) {\n for (var p in m)\n if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p))\n __createBinding(o, m, p);\n }\n function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m)\n return m.call(o);\n if (o && typeof o.length === \"number\")\n return {\n next: function () {\n if (o && i >= o.length)\n o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n }\n function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m)\n return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done)\n ar.push(r.value);\n }\n catch (error) {\n e = { error: error };\n }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"]))\n m.call(i);\n }\n finally {\n if (e)\n throw e.error;\n }\n }\n return ar;\n }\n /** @deprecated */\n function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n }\n /** @deprecated */\n function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++)\n s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n }\n function __spreadArray(to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n }\n function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n }\n function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator)\n throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\n function verb(n) { if (g[n])\n i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\n function resume(n, v) { try {\n step(g[n](v));\n }\n catch (e) {\n settle(q[0][3], e);\n } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length)\n resume(q[0][0], q[0][1]); }\n }\n function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\n }\n function __asyncValues(o) {\n if (!Symbol.asyncIterator)\n throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }\n }\n function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) {\n Object.defineProperty(cooked, \"raw\", { value: raw });\n }\n else {\n cooked.raw = raw;\n }\n return cooked;\n }\n ;\n var __setModuleDefault = Object.create ? (function (o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n }) : function (o, v) {\n o[\"default\"] = v;\n };\n function __importStar(mod) {\n if (mod && mod.__esModule)\n return mod;\n var result = {};\n if (mod != null)\n for (var k in mod)\n if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k))\n __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n }\n function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n }\n function __classPrivateFieldGet(receiver, privateMap) {\n if (!privateMap.has(receiver)) {\n throw new TypeError(\"attempted to get private field on non-instance\");\n }\n return privateMap.get(receiver);\n }\n function __classPrivateFieldSet(receiver, privateMap, value) {\n if (!privateMap.has(receiver)) {\n throw new TypeError(\"attempted to set private field on non-instance\");\n }\n privateMap.set(receiver, value);\n return value;\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 /** Time in ms to throttle the resize events by default. */\n var DEFAULT_RESIZE_TIME = 20;\n /**\n * Simple utility for getting the bounds of the browser viewport.\n * @docs-private\n */\n var ViewportRuler = /** @class */ (function () {\n function ViewportRuler(_platform, ngZone, document) {\n var _this = this;\n this._platform = _platform;\n /** Stream of viewport change events. */\n this._change = new rxjs.Subject();\n /** Event listener that will be used to handle the viewport change events. */\n this._changeListener = function (event) {\n _this._change.next(event);\n };\n this._document = document;\n ngZone.runOutsideAngular(function () {\n if (_platform.isBrowser) {\n var window = _this._getWindow();\n // Note that bind the events ourselves, rather than going through something like RxJS's\n // `fromEvent` so that we can ensure that they're bound outside of the NgZone.\n window.addEventListener('resize', _this._changeListener);\n window.addEventListener('orientationchange', _this._changeListener);\n }\n // We don't need to keep track of the subscription,\n // because we complete the `change` stream on destroy.\n _this.change().subscribe(function () { return _this._updateViewportSize(); });\n });\n }\n ViewportRuler.prototype.ngOnDestroy = function () {\n if (this._platform.isBrowser) {\n var window = this._getWindow();\n window.removeEventListener('resize', this._changeListener);\n window.removeEventListener('orientationchange', this._changeListener);\n }\n this._change.complete();\n };\n /** Returns the viewport's width and height. */\n ViewportRuler.prototype.getViewportSize = function () {\n if (!this._viewportSize) {\n this._updateViewportSize();\n }\n var output = { width: this._viewportSize.width, height: this._viewportSize.height };\n // If we're not on a browser, don't cache the size since it'll be mocked out anyway.\n if (!this._platform.isBrowser) {\n this._viewportSize = null;\n }\n return output;\n };\n /** Gets a ClientRect for the viewport's bounds. */\n ViewportRuler.prototype.getViewportRect = function () {\n // Use the document element's bounding rect rather than the window scroll properties\n // (e.g. pageYOffset, scrollY) due to in issue in Chrome and IE where window scroll\n // properties and client coordinates (boundingClientRect, clientX/Y, etc.) are in different\n // conceptual viewports. Under most circumstances these viewports are equivalent, but they\n // can disagree when the page is pinch-zoomed (on devices that support touch).\n // See https://bugs.chromium.org/p/chromium/issues/detail?id=489206#c4\n // We use the documentElement instead of the body because, by default (without a css reset)\n // browsers typically give the document body an 8px margin, which is not included in\n // getBoundingClientRect().\n var scrollPosition = this.getViewportScrollPosition();\n var _a = this.getViewportSize(), width = _a.width, height = _a.height;\n return {\n top: scrollPosition.top,\n left: scrollPosition.left,\n bottom: scrollPosition.top + height,\n right: scrollPosition.left + width,\n height: height,\n width: width,\n };\n };\n /** Gets the (top, left) scroll position of the viewport. */\n ViewportRuler.prototype.getViewportScrollPosition = function () {\n // While we can get a reference to the fake document\n // during SSR, it doesn't have getBoundingClientRect.\n if (!this._platform.isBrowser) {\n return { top: 0, left: 0 };\n }\n // The top-left-corner of the viewport is determined by the scroll position of the document\n // body, normally just (scrollLeft, scrollTop). However, Chrome and Firefox disagree about\n // whether `document.body` or `document.documentElement` is the scrolled element, so reading\n // `scrollTop` and `scrollLeft` is inconsistent. However, using the bounding rect of\n // `document.documentElement` works consistently, where the `top` and `left` values will\n // equal negative the scroll position.\n var document = this._document;\n var window = this._getWindow();\n var documentElement = document.documentElement;\n var documentRect = documentElement.getBoundingClientRect();\n var top = -documentRect.top || document.body.scrollTop || window.scrollY ||\n documentElement.scrollTop || 0;\n var left = -documentRect.left || document.body.scrollLeft || window.scrollX ||\n documentElement.scrollLeft || 0;\n return { top: top, left: left };\n };\n /**\n * Returns a stream that emits whenever the size of the viewport changes.\n * @param throttleTime Time in milliseconds to throttle the stream.\n */\n ViewportRuler.prototype.change = function (throttleTime) {\n if (throttleTime === void 0) { throttleTime = DEFAULT_RESIZE_TIME; }\n return throttleTime > 0 ? this._change.pipe(operators.auditTime(throttleTime)) : this._change;\n };\n /** Use defaultView of injected document if available or fallback to global window reference */\n ViewportRuler.prototype._getWindow = function () {\n return this._document.defaultView || window;\n };\n /** Updates the cached viewport size. */\n ViewportRuler.prototype._updateViewportSize = function () {\n var window = this._getWindow();\n this._viewportSize = this._platform.isBrowser ?\n { width: window.innerWidth, height: window.innerHeight } :\n { width: 0, height: 0 };\n };\n return ViewportRuler;\n }());\n ViewportRuler.ɵprov = i0.ɵɵdefineInjectable({ factory: function ViewportRuler_Factory() { return new ViewportRuler(i0.ɵɵinject(i1.Platform), i0.ɵɵinject(i0.NgZone), i0.ɵɵinject(i2.DOCUMENT, 8)); }, token: ViewportRuler, providedIn: \"root\" });\n ViewportRuler.decorators = [\n { type: i0.Injectable, args: [{ providedIn: 'root' },] }\n ];\n ViewportRuler.ctorParameters = function () { return [\n { type: i1.Platform },\n { type: i0.NgZone },\n { type: undefined, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [i2.DOCUMENT,] }] }\n ]; };\n\n /** Checks if the given ranges are equal. */\n function rangesEqual(r1, r2) {\n return r1.start == r2.start && r1.end == r2.end;\n }\n /**\n * Scheduler to be used for scroll events. Needs to fall back to\n * something that doesn't rely on requestAnimationFrame on environments\n * that don't support it (e.g. server-side rendering).\n */\n var SCROLL_SCHEDULER = typeof requestAnimationFrame !== 'undefined' ? rxjs.animationFrameScheduler : rxjs.asapScheduler;\n /** A viewport that virtualizes its scrolling with the help of `CdkVirtualForOf`. */\n var CdkVirtualScrollViewport = /** @class */ (function (_super) {\n __extends(CdkVirtualScrollViewport, _super);\n function CdkVirtualScrollViewport(elementRef, _changeDetectorRef, ngZone, _scrollStrategy, dir, scrollDispatcher, viewportRuler) {\n var _this = _super.call(this, elementRef, scrollDispatcher, ngZone, dir) || this;\n _this.elementRef = elementRef;\n _this._changeDetectorRef = _changeDetectorRef;\n _this._scrollStrategy = _scrollStrategy;\n /** Emits when the viewport is detached from a CdkVirtualForOf. */\n _this._detachedSubject = new rxjs.Subject();\n /** Emits when the rendered range changes. */\n _this._renderedRangeSubject = new rxjs.Subject();\n _this._orientation = 'vertical';\n // Note: we don't use the typical EventEmitter here because we need to subscribe to the scroll\n // strategy lazily (i.e. only if the user is actually listening to the events). We do this because\n // depending on how the strategy calculates the scrolled index, it may come at a cost to\n // performance.\n /** Emits when the index of the first element visible in the viewport changes. */\n _this.scrolledIndexChange = new rxjs.Observable(function (observer) { return _this._scrollStrategy.scrolledIndexChange.subscribe(function (index) { return Promise.resolve().then(function () { return _this.ngZone.run(function () { return observer.next(index); }); }); }); });\n /** A stream that emits whenever the rendered range changes. */\n _this.renderedRangeStream = _this._renderedRangeSubject;\n /**\n * The total size of all content (in pixels), including content that is not currently rendered.\n */\n _this._totalContentSize = 0;\n /** A string representing the `style.width` property value to be used for the spacer element. */\n _this._totalContentWidth = '';\n /** A string representing the `style.height` property value to be used for the spacer element. */\n _this._totalContentHeight = '';\n /** The currently rendered range of indices. */\n _this._renderedRange = { start: 0, end: 0 };\n /** The length of the data bound to this viewport (in number of items). */\n _this._dataLength = 0;\n /** The size of the viewport (in pixels). */\n _this._viewportSize = 0;\n /** The last rendered content offset that was set. */\n _this._renderedContentOffset = 0;\n /**\n * Whether the last rendered content offset was to the end of the content (and therefore needs to\n * be rewritten as an offset to the start of the content).\n */\n _this._renderedContentOffsetNeedsRewrite = false;\n /** Whether there is a pending change detection cycle. */\n _this._isChangeDetectionPending = false;\n /** A list of functions to run after the next change detection cycle. */\n _this._runAfterChangeDetection = [];\n /** Subscription to changes in the viewport size. */\n _this._viewportChanges = rxjs.Subscription.EMPTY;\n if (!_scrollStrategy && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error('Error: cdk-virtual-scroll-viewport requires the \"itemSize\" property to be set.');\n }\n _this._viewportChanges = viewportRuler.change().subscribe(function () {\n _this.checkViewportSize();\n });\n return _this;\n }\n Object.defineProperty(CdkVirtualScrollViewport.prototype, \"orientation\", {\n /** The direction the viewport scrolls. */\n get: function () {\n return this._orientation;\n },\n set: function (orientation) {\n if (this._orientation !== orientation) {\n this._orientation = orientation;\n this._calculateSpacerSize();\n }\n },\n enumerable: false,\n configurable: true\n });\n CdkVirtualScrollViewport.prototype.ngOnInit = function () {\n var _this = this;\n _super.prototype.ngOnInit.call(this);\n // It's still too early to measure the viewport at this point. Deferring with a promise allows\n // the Viewport to be rendered with the correct size before we measure. We run this outside the\n // zone to avoid causing more change detection cycles. We handle the change detection loop\n // ourselves instead.\n this.ngZone.runOutsideAngular(function () { return Promise.resolve().then(function () {\n _this._measureViewportSize();\n _this._scrollStrategy.attach(_this);\n _this.elementScrolled()\n .pipe(\n // Start off with a fake scroll event so we properly detect our initial position.\n operators.startWith(null), \n // Collect multiple events into one until the next animation frame. This way if\n // there are multiple scroll events in the same frame we only need to recheck\n // our layout once.\n operators.auditTime(0, SCROLL_SCHEDULER))\n .subscribe(function () { return _this._scrollStrategy.onContentScrolled(); });\n _this._markChangeDetectionNeeded();\n }); });\n };\n CdkVirtualScrollViewport.prototype.ngOnDestroy = function () {\n this.detach();\n this._scrollStrategy.detach();\n // Complete all subjects\n this._renderedRangeSubject.complete();\n this._detachedSubject.complete();\n this._viewportChanges.unsubscribe();\n _super.prototype.ngOnDestroy.call(this);\n };\n /** Attaches a `CdkVirtualScrollRepeater` to this viewport. */\n CdkVirtualScrollViewport.prototype.attach = function (forOf) {\n var _this = this;\n if (this._forOf && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error('CdkVirtualScrollViewport is already attached.');\n }\n // Subscribe to the data stream of the CdkVirtualForOf to keep track of when the data length\n // changes. Run outside the zone to avoid triggering change detection, since we're managing the\n // change detection loop ourselves.\n this.ngZone.runOutsideAngular(function () {\n _this._forOf = forOf;\n _this._forOf.dataStream.pipe(operators.takeUntil(_this._detachedSubject)).subscribe(function (data) {\n var newLength = data.length;\n if (newLength !== _this._dataLength) {\n _this._dataLength = newLength;\n _this._scrollStrategy.onDataLengthChanged();\n }\n _this._doChangeDetection();\n });\n });\n };\n /** Detaches the current `CdkVirtualForOf`. */\n CdkVirtualScrollViewport.prototype.detach = function () {\n this._forOf = null;\n this._detachedSubject.next();\n };\n /** Gets the length of the data bound to this viewport (in number of items). */\n CdkVirtualScrollViewport.prototype.getDataLength = function () {\n return this._dataLength;\n };\n /** Gets the size of the viewport (in pixels). */\n CdkVirtualScrollViewport.prototype.getViewportSize = function () {\n return this._viewportSize;\n };\n // TODO(mmalerba): This is technically out of sync with what's really rendered until a render\n // cycle happens. I'm being careful to only call it after the render cycle is complete and before\n // setting it to something else, but its error prone and should probably be split into\n // `pendingRange` and `renderedRange`, the latter reflecting whats actually in the DOM.\n /** Get the current rendered range of items. */\n CdkVirtualScrollViewport.prototype.getRenderedRange = function () {\n return this._renderedRange;\n };\n /**\n * Sets the total size of all content (in pixels), including content that is not currently\n * rendered.\n */\n CdkVirtualScrollViewport.prototype.setTotalContentSize = function (size) {\n if (this._totalContentSize !== size) {\n this._totalContentSize = size;\n this._calculateSpacerSize();\n this._markChangeDetectionNeeded();\n }\n };\n /** Sets the currently rendered range of indices. */\n CdkVirtualScrollViewport.prototype.setRenderedRange = function (range) {\n var _this = this;\n if (!rangesEqual(this._renderedRange, range)) {\n this._renderedRangeSubject.next(this._renderedRange = range);\n this._markChangeDetectionNeeded(function () { return _this._scrollStrategy.onContentRendered(); });\n }\n };\n /**\n * Gets the offset from the start of the viewport to the start of the rendered data (in pixels).\n */\n CdkVirtualScrollViewport.prototype.getOffsetToRenderedContentStart = function () {\n return this._renderedContentOffsetNeedsRewrite ? null : this._renderedContentOffset;\n };\n /**\n * Sets the offset from the start of the viewport to either the start or end of the rendered data\n * (in pixels).\n */\n CdkVirtualScrollViewport.prototype.setRenderedContentOffset = function (offset, to) {\n var _this = this;\n if (to === void 0) { to = 'to-start'; }\n // For a horizontal viewport in a right-to-left language we need to translate along the x-axis\n // in the negative direction.\n var isRtl = this.dir && this.dir.value == 'rtl';\n var isHorizontal = this.orientation == 'horizontal';\n var axis = isHorizontal ? 'X' : 'Y';\n var axisDirection = isHorizontal && isRtl ? -1 : 1;\n var transform = \"translate\" + axis + \"(\" + Number(axisDirection * offset) + \"px)\";\n this._renderedContentOffset = offset;\n if (to === 'to-end') {\n transform += \" translate\" + axis + \"(-100%)\";\n // The viewport should rewrite this as a `to-start` offset on the next render cycle. Otherwise\n // elements will appear to expand in the wrong direction (e.g. `mat-expansion-panel` would\n // expand upward).\n this._renderedContentOffsetNeedsRewrite = true;\n }\n if (this._renderedContentTransform != transform) {\n // We know this value is safe because we parse `offset` with `Number()` before passing it\n // into the string.\n this._renderedContentTransform = transform;\n this._markChangeDetectionNeeded(function () {\n if (_this._renderedContentOffsetNeedsRewrite) {\n _this._renderedContentOffset -= _this.measureRenderedContentSize();\n _this._renderedContentOffsetNeedsRewrite = false;\n _this.setRenderedContentOffset(_this._renderedContentOffset);\n }\n else {\n _this._scrollStrategy.onRenderedOffsetChanged();\n }\n });\n }\n };\n /**\n * Scrolls to the given offset from the start of the viewport. Please note that this is not always\n * the same as setting `scrollTop` or `scrollLeft`. In a horizontal viewport with right-to-left\n * direction, this would be the equivalent of setting a fictional `scrollRight` property.\n * @param offset The offset to scroll to.\n * @param behavior The ScrollBehavior to use when scrolling. Default is behavior is `auto`.\n */\n CdkVirtualScrollViewport.prototype.scrollToOffset = function (offset, behavior) {\n if (behavior === void 0) { behavior = 'auto'; }\n var options = { behavior: behavior };\n if (this.orientation === 'horizontal') {\n options.start = offset;\n }\n else {\n options.top = offset;\n }\n this.scrollTo(options);\n };\n /**\n * Scrolls to the offset for the given index.\n * @param index The index of the element to scroll to.\n * @param behavior The ScrollBehavior to use when scrolling. Default is behavior is `auto`.\n */\n CdkVirtualScrollViewport.prototype.scrollToIndex = function (index, behavior) {\n if (behavior === void 0) { behavior = 'auto'; }\n this._scrollStrategy.scrollToIndex(index, behavior);\n };\n /**\n * Gets the current scroll offset from the start of the viewport (in pixels).\n * @param from The edge to measure the offset from. Defaults to 'top' in vertical mode and 'start'\n * in horizontal mode.\n */\n CdkVirtualScrollViewport.prototype.measureScrollOffset = function (from) {\n return from ?\n _super.prototype.measureScrollOffset.call(this, from) :\n _super.prototype.measureScrollOffset.call(this, this.orientation === 'horizontal' ? 'start' : 'top');\n };\n /** Measure the combined size of all of the rendered items. */\n CdkVirtualScrollViewport.prototype.measureRenderedContentSize = function () {\n var contentEl = this._contentWrapper.nativeElement;\n return this.orientation === 'horizontal' ? contentEl.offsetWidth : contentEl.offsetHeight;\n };\n /**\n * Measure the total combined size of the given range. Throws if the range includes items that are\n * not rendered.\n */\n CdkVirtualScrollViewport.prototype.measureRangeSize = function (range) {\n if (!this._forOf) {\n return 0;\n }\n return this._forOf.measureRangeSize(range, this.orientation);\n };\n /** Update the viewport dimensions and re-render. */\n CdkVirtualScrollViewport.prototype.checkViewportSize = function () {\n // TODO: Cleanup later when add logic for handling content resize\n this._measureViewportSize();\n this._scrollStrategy.onDataLengthChanged();\n };\n /** Measure the viewport size. */\n CdkVirtualScrollViewport.prototype._measureViewportSize = function () {\n var viewportEl = this.elementRef.nativeElement;\n this._viewportSize = this.orientation === 'horizontal' ?\n viewportEl.clientWidth : viewportEl.clientHeight;\n };\n /** Queue up change detection to run. */\n CdkVirtualScrollViewport.prototype._markChangeDetectionNeeded = function (runAfter) {\n var _this = this;\n if (runAfter) {\n this._runAfterChangeDetection.push(runAfter);\n }\n // Use a Promise to batch together calls to `_doChangeDetection`. This way if we set a bunch of\n // properties sequentially we only have to run `_doChangeDetection` once at the end.\n if (!this._isChangeDetectionPending) {\n this._isChangeDetectionPending = true;\n this.ngZone.runOutsideAngular(function () { return Promise.resolve().then(function () {\n _this._doChangeDetection();\n }); });\n }\n };\n /** Run change detection. */\n CdkVirtualScrollViewport.prototype._doChangeDetection = function () {\n var e_1, _a;\n var _this = this;\n this._isChangeDetectionPending = false;\n // Apply the content transform. The transform can't be set via an Angular binding because\n // bypassSecurityTrustStyle is banned in Google. However the value is safe, it's composed of\n // string literals, a variable that can only be 'X' or 'Y', and user input that is run through\n // the `Number` function first to coerce it to a numeric value.\n this._contentWrapper.nativeElement.style.transform = this._renderedContentTransform;\n // Apply changes to Angular bindings. Note: We must call `markForCheck` to run change detection\n // from the root, since the repeated items are content projected in. Calling `detectChanges`\n // instead does not properly check the projected content.\n this.ngZone.run(function () { return _this._changeDetectorRef.markForCheck(); });\n var runAfterChangeDetection = this._runAfterChangeDetection;\n this._runAfterChangeDetection = [];\n try {\n for (var runAfterChangeDetection_1 = __values(runAfterChangeDetection), runAfterChangeDetection_1_1 = runAfterChangeDetection_1.next(); !runAfterChangeDetection_1_1.done; runAfterChangeDetection_1_1 = runAfterChangeDetection_1.next()) {\n var fn = runAfterChangeDetection_1_1.value;\n fn();\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (runAfterChangeDetection_1_1 && !runAfterChangeDetection_1_1.done && (_a = runAfterChangeDetection_1.return)) _a.call(runAfterChangeDetection_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n };\n /** Calculates the `style.width` and `style.height` for the spacer element. */\n CdkVirtualScrollViewport.prototype._calculateSpacerSize = function () {\n this._totalContentHeight =\n this.orientation === 'horizontal' ? '' : this._totalContentSize + \"px\";\n this._totalContentWidth =\n this.orientation === 'horizontal' ? this._totalContentSize + \"px\" : '';\n };\n return CdkVirtualScrollViewport;\n }(CdkScrollable));\n CdkVirtualScrollViewport.decorators = [\n { type: i0.Component, args: [{\n selector: 'cdk-virtual-scroll-viewport',\n template: \"<!--\\n Wrap the rendered content in an element that will be used to offset it based on the scroll\\n position.\\n-->\\n<div #contentWrapper class=\\\"cdk-virtual-scroll-content-wrapper\\\">\\n <ng-content></ng-content>\\n</div>\\n<!--\\n Spacer used to force the scrolling container to the correct size for the *total* number of items\\n so that the scrollbar captures the size of the entire data set.\\n-->\\n<div class=\\\"cdk-virtual-scroll-spacer\\\"\\n [style.width]=\\\"_totalContentWidth\\\" [style.height]=\\\"_totalContentHeight\\\"></div>\\n\",\n host: {\n 'class': 'cdk-virtual-scroll-viewport',\n '[class.cdk-virtual-scroll-orientation-horizontal]': 'orientation === \"horizontal\"',\n '[class.cdk-virtual-scroll-orientation-vertical]': 'orientation !== \"horizontal\"',\n },\n encapsulation: i0.ViewEncapsulation.None,\n changeDetection: i0.ChangeDetectionStrategy.OnPush,\n providers: [{\n provide: CdkScrollable,\n useExisting: CdkVirtualScrollViewport,\n }],\n styles: [\"cdk-virtual-scroll-viewport{display:block;position:relative;overflow:auto;contain:strict;transform:translateZ(0);will-change:scroll-position;-webkit-overflow-scrolling:touch}.cdk-virtual-scroll-content-wrapper{position:absolute;top:0;left:0;contain:content}[dir=rtl] .cdk-virtual-scroll-content-wrapper{right:0;left:auto}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper{min-height:100%}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-left:0;padding-right:0;margin-left:0;margin-right:0;border-left-width:0;border-right-width:0;outline:none}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper{min-width:100%}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-top:0;padding-bottom:0;margin-top:0;margin-bottom:0;border-top-width:0;border-bottom-width:0;outline:none}.cdk-virtual-scroll-spacer{position:absolute;top:0;left:0;height:1px;width:1px;transform-origin:0 0}[dir=rtl] .cdk-virtual-scroll-spacer{right:0;left:auto;transform-origin:100% 0}\\n\"]\n },] }\n ];\n CdkVirtualScrollViewport.ctorParameters = function () { return [\n { type: i0.ElementRef },\n { type: i0.ChangeDetectorRef },\n { type: i0.NgZone },\n { type: undefined, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [VIRTUAL_SCROLL_STRATEGY,] }] },\n { type: bidi.Directionality, decorators: [{ type: i0.Optional }] },\n { type: ScrollDispatcher },\n { type: ViewportRuler }\n ]; };\n CdkVirtualScrollViewport.propDecorators = {\n orientation: [{ type: i0.Input }],\n scrolledIndexChange: [{ type: i0.Output }],\n _contentWrapper: [{ type: i0.ViewChild, args: ['contentWrapper', { static: true },] }]\n };\n\n /** Helper to extract the offset of a DOM Node in a certain direction. */\n function getOffset(orientation, direction, node) {\n var el = node;\n if (!el.getBoundingClientRect) {\n return 0;\n }\n var rect = el.getBoundingClientRect();\n if (orientation === 'horizontal') {\n return direction === 'start' ? rect.left : rect.right;\n }\n return direction === 'start' ? rect.top : rect.bottom;\n }\n /**\n * A directive similar to `ngForOf` to be used for rendering data inside a virtual scrolling\n * container.\n */\n var CdkVirtualForOf = /** @class */ (function () {\n function CdkVirtualForOf(\n /** The view container to add items to. */\n _viewContainerRef, \n /** The template to use when stamping out new items. */\n _template, \n /** The set of available differs. */\n _differs, \n /** The strategy used to render items in the virtual scroll viewport. */\n _viewRepeater, \n /** The virtual scrolling viewport that these items are being rendered in. */\n _viewport, ngZone) {\n var _this = this;\n this._viewContainerRef = _viewContainerRef;\n this._template = _template;\n this._differs = _differs;\n this._viewRepeater = _viewRepeater;\n this._viewport = _viewport;\n /** Emits when the rendered view of the data changes. */\n this.viewChange = new rxjs.Subject();\n /** Subject that emits when a new DataSource instance is given. */\n this._dataSourceChanges = new rxjs.Subject();\n /** Emits whenever the data in the current DataSource changes. */\n this.dataStream = this._dataSourceChanges\n .pipe(\n // Start off with null `DataSource`.\n operators.startWith(null), \n // Bundle up the previous and current data sources so we can work with both.\n operators.pairwise(), \n // Use `_changeDataSource` to disconnect from the previous data source and connect to the\n // new one, passing back a stream of data changes which we run through `switchMap` to give\n // us a data stream that emits the latest data from whatever the current `DataSource` is.\n operators.switchMap(function (_a) {\n var _b = __read(_a, 2), prev = _b[0], cur = _b[1];\n return _this._changeDataSource(prev, cur);\n }), \n // Replay the last emitted data when someone subscribes.\n operators.shareReplay(1));\n /** The differ used to calculate changes to the data. */\n this._differ = null;\n /** Whether the rendered data should be updated during the next ngDoCheck cycle. */\n this._needsUpdate = false;\n this._destroyed = new rxjs.Subject();\n this.dataStream.subscribe(function (data) {\n _this._data = data;\n _this._onRenderedDataChange();\n });\n this._viewport.renderedRangeStream.pipe(operators.takeUntil(this._destroyed)).subscribe(function (range) {\n _this._renderedRange = range;\n ngZone.run(function () { return _this.viewChange.next(_this._renderedRange); });\n _this._onRenderedDataChange();\n });\n this._viewport.attach(this);\n }\n Object.defineProperty(CdkVirtualForOf.prototype, \"cdkVirtualForOf\", {\n /** The DataSource to display. */\n get: function () {\n return this._cdkVirtualForOf;\n },\n set: function (value) {\n this._cdkVirtualForOf = value;\n if (collections.isDataSource(value)) {\n this._dataSourceChanges.next(value);\n }\n else {\n // If value is an an NgIterable, convert it to an array.\n this._dataSourceChanges.next(new collections.ArrayDataSource(rxjs.isObservable(value) ? value : Array.from(value || [])));\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CdkVirtualForOf.prototype, \"cdkVirtualForTrackBy\", {\n /**\n * The `TrackByFunction` to use for tracking changes. The `TrackByFunction` takes the index and\n * the item and produces a value to be used as the item's identity when tracking changes.\n */\n get: function () {\n return this._cdkVirtualForTrackBy;\n },\n set: function (fn) {\n var _this = this;\n this._needsUpdate = true;\n this._cdkVirtualForTrackBy = fn ?\n function (index, item) { return fn(index + (_this._renderedRange ? _this._renderedRange.start : 0), item); } :\n undefined;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CdkVirtualForOf.prototype, \"cdkVirtualForTemplate\", {\n /** The template used to stamp out new elements. */\n set: function (value) {\n if (value) {\n this._needsUpdate = true;\n this._template = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CdkVirtualForOf.prototype, \"cdkVirtualForTemplateCacheSize\", {\n /**\n * The size of the cache used to store templates that are not being used for re-use later.\n * Setting the cache size to `0` will disable caching. Defaults to 20 templates.\n */\n get: function () {\n return this._viewRepeater.viewCacheSize;\n },\n set: function (size) {\n this._viewRepeater.viewCacheSize = coercion.coerceNumberProperty(size);\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Measures the combined size (width for horizontal orientation, height for vertical) of all items\n * in the specified range. Throws an error if the range includes items that are not currently\n * rendered.\n */\n CdkVirtualForOf.prototype.measureRangeSize = function (range, orientation) {\n if (range.start >= range.end) {\n return 0;\n }\n if ((range.start < this._renderedRange.start || range.end > this._renderedRange.end) &&\n (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error(\"Error: attempted to measure an item that isn't rendered.\");\n }\n // The index into the list of rendered views for the first item in the range.\n var renderedStartIndex = range.start - this._renderedRange.start;\n // The length of the range we're measuring.\n var rangeLen = range.end - range.start;\n // Loop over all the views, find the first and land node and compute the size by subtracting\n // the top of the first node from the bottom of the last one.\n var firstNode;\n var lastNode;\n // Find the first node by starting from the beginning and going forwards.\n for (var i = 0; i < rangeLen; i++) {\n var view = this._viewContainerRef.get(i + renderedStartIndex);\n if (view && view.rootNodes.length) {\n firstNode = lastNode = view.rootNodes[0];\n break;\n }\n }\n // Find the last node by starting from the end and going backwards.\n for (var i = rangeLen - 1; i > -1; i--) {\n var view = this._viewContainerRef.get(i + renderedStartIndex);\n if (view && view.rootNodes.length) {\n lastNode = view.rootNodes[view.rootNodes.length - 1];\n break;\n }\n }\n return firstNode && lastNode ?\n getOffset(orientation, 'end', lastNode) - getOffset(orientation, 'start', firstNode) : 0;\n };\n CdkVirtualForOf.prototype.ngDoCheck = function () {\n if (this._differ && this._needsUpdate) {\n // TODO(mmalerba): We should differentiate needs update due to scrolling and a new portion of\n // this list being rendered (can use simpler algorithm) vs needs update due to data actually\n // changing (need to do this diff).\n var changes = this._differ.diff(this._renderedItems);\n if (!changes) {\n this._updateContext();\n }\n else {\n this._applyChanges(changes);\n }\n this._needsUpdate = false;\n }\n };\n CdkVirtualForOf.prototype.ngOnDestroy = function () {\n this._viewport.detach();\n this._dataSourceChanges.next(undefined);\n this._dataSourceChanges.complete();\n this.viewChange.complete();\n this._destroyed.next();\n this._destroyed.complete();\n this._viewRepeater.detach();\n };\n /** React to scroll state changes in the viewport. */\n CdkVirtualForOf.prototype._onRenderedDataChange = function () {\n var _this = this;\n if (!this._renderedRange) {\n return;\n }\n this._renderedItems = this._data.slice(this._renderedRange.start, this._renderedRange.end);\n if (!this._differ) {\n // Use a wrapper function for the `trackBy` so any new values are\n // picked up automatically without having to recreate the differ.\n this._differ = this._differs.find(this._renderedItems).create(function (index, item) {\n return _this.cdkVirtualForTrackBy ? _this.cdkVirtualForTrackBy(index, item) : item;\n });\n }\n this._needsUpdate = true;\n };\n /** Swap out one `DataSource` for another. */\n CdkVirtualForOf.prototype._changeDataSource = function (oldDs, newDs) {\n if (oldDs) {\n oldDs.disconnect(this);\n }\n this._needsUpdate = true;\n return newDs ? newDs.connect(this) : rxjs.of();\n };\n /** Update the `CdkVirtualForOfContext` for all views. */\n CdkVirtualForOf.prototype._updateContext = function () {\n var count = this._data.length;\n var i = this._viewContainerRef.length;\n while (i--) {\n var view = this._viewContainerRef.get(i);\n view.context.index = this._renderedRange.start + i;\n view.context.count = count;\n this._updateComputedContextProperties(view.context);\n view.detectChanges();\n }\n };\n /** Apply changes to the DOM. */\n CdkVirtualForOf.prototype._applyChanges = function (changes) {\n var _this = this;\n this._viewRepeater.applyChanges(changes, this._viewContainerRef, function (record, _adjustedPreviousIndex, currentIndex) { return _this._getEmbeddedViewArgs(record, currentIndex); }, function (record) { return record.item; });\n // Update $implicit for any items that had an identity change.\n changes.forEachIdentityChange(function (record) {\n var view = _this._viewContainerRef.get(record.currentIndex);\n view.context.$implicit = record.item;\n });\n // Update the context variables on all items.\n var count = this._data.length;\n var i = this._viewContainerRef.length;\n while (i--) {\n var view = this._viewContainerRef.get(i);\n view.context.index = this._renderedRange.start + i;\n view.context.count = count;\n this._updateComputedContextProperties(view.context);\n }\n };\n /** Update the computed properties on the `CdkVirtualForOfContext`. */\n CdkVirtualForOf.prototype._updateComputedContextProperties = function (context) {\n context.first = context.index === 0;\n context.last = context.index === context.count - 1;\n context.even = context.index % 2 === 0;\n context.odd = !context.even;\n };\n CdkVirtualForOf.prototype._getEmbeddedViewArgs = function (record, index) {\n // Note that it's important that we insert the item directly at the proper index,\n // rather than inserting it and the moving it in place, because if there's a directive\n // on the same node that injects the `ViewContainerRef`, Angular will insert another\n // comment node which can throw off the move when it's being repeated for all items.\n return {\n templateRef: this._template,\n context: {\n $implicit: record.item,\n // It's guaranteed that the iterable is not \"undefined\" or \"null\" because we only\n // generate views for elements if the \"cdkVirtualForOf\" iterable has elements.\n cdkVirtualForOf: this._cdkVirtualForOf,\n index: -1,\n count: -1,\n first: false,\n last: false,\n odd: false,\n even: false\n },\n index: index,\n };\n };\n return CdkVirtualForOf;\n }());\n CdkVirtualForOf.decorators = [\n { type: i0.Directive, args: [{\n selector: '[cdkVirtualFor][cdkVirtualForOf]',\n providers: [\n { provide: collections._VIEW_REPEATER_STRATEGY, useClass: collections._RecycleViewRepeaterStrategy },\n ]\n },] }\n ];\n CdkVirtualForOf.ctorParameters = function () { return [\n { type: i0.ViewContainerRef },\n { type: i0.TemplateRef },\n { type: i0.IterableDiffers },\n { type: collections._RecycleViewRepeaterStrategy, decorators: [{ type: i0.Inject, args: [collections._VIEW_REPEATER_STRATEGY,] }] },\n { type: CdkVirtualScrollViewport, decorators: [{ type: i0.SkipSelf }] },\n { type: i0.NgZone }\n ]; };\n CdkVirtualForOf.propDecorators = {\n cdkVirtualForOf: [{ type: i0.Input }],\n cdkVirtualForTrackBy: [{ type: i0.Input }],\n cdkVirtualForTemplate: [{ type: i0.Input }],\n cdkVirtualForTemplateCacheSize: [{ type: i0.Input }]\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 var CdkScrollableModule = /** @class */ (function () {\n function CdkScrollableModule() {\n }\n return CdkScrollableModule;\n }());\n CdkScrollableModule.decorators = [\n { type: i0.NgModule, args: [{\n exports: [CdkScrollable],\n declarations: [CdkScrollable]\n },] }\n ];\n /**\n * @docs-primary-export\n */\n var ScrollingModule = /** @class */ (function () {\n function ScrollingModule() {\n }\n return ScrollingModule;\n }());\n ScrollingModule.decorators = [\n { type: i0.NgModule, args: [{\n imports: [\n bidi.BidiModule,\n i1.PlatformModule,\n CdkScrollableModule\n ],\n exports: [\n bidi.BidiModule,\n CdkScrollableModule,\n CdkFixedSizeVirtualScroll,\n CdkVirtualForOf,\n CdkVirtualScrollViewport,\n ],\n declarations: [\n CdkFixedSizeVirtualScroll,\n CdkVirtualForOf,\n CdkVirtualScrollViewport,\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\n /**\n * Generated bundle index. Do not edit.\n */\n\n exports.CdkFixedSizeVirtualScroll = CdkFixedSizeVirtualScroll;\n exports.CdkScrollable = CdkScrollable;\n exports.CdkScrollableModule = CdkScrollableModule;\n exports.CdkVirtualForOf = CdkVirtualForOf;\n exports.CdkVirtualScrollViewport = CdkVirtualScrollViewport;\n exports.DEFAULT_RESIZE_TIME = DEFAULT_RESIZE_TIME;\n exports.DEFAULT_SCROLL_TIME = DEFAULT_SCROLL_TIME;\n exports.FixedSizeVirtualScrollStrategy = FixedSizeVirtualScrollStrategy;\n exports.ScrollDispatcher = ScrollDispatcher;\n exports.ScrollingModule = ScrollingModule;\n exports.VIRTUAL_SCROLL_STRATEGY = VIRTUAL_SCROLL_STRATEGY;\n exports.ViewportRuler = ViewportRuler;\n exports._fixedSizeVirtualScrollStrategyFactory = _fixedSizeVirtualScrollStrategyFactory;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n})));\n//# sourceMappingURL=cdk-scrolling.umd.js.map\n"]}