{"version":3,"file":"cdk-layout.umd.js","sources":["cdk/layout.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 { Injectable, NgModule, NgZone } from '@angular/core';\nimport { Platform, PlatformModule } from '@angular/cdk/platform';\nimport { Subject } from 'rxjs/Subject';\nimport { RxChain, map, startWith, takeUntil } from '@angular/cdk/rxjs';\nimport { coerceArray } from '@angular/cdk/coercion';\nimport { combineLatest } from 'rxjs/observable/combineLatest';\nimport { fromEventPattern } from 'rxjs/observable/fromEventPattern';\n\n/**\n * Global registry for all dynamically-created, injected style tags.\n */\nvar styleElementForWebkitCompatibility = new Map();\n/**\n * A utility for calling matchMedia queries.\n */\nvar MediaMatcher = (function () {\n /**\n * @param {?} platform\n */\n function MediaMatcher(platform) {\n this.platform = platform;\n this._matchMedia = this.platform.isBrowser ?\n // matchMedia is bound to the window scope intentionally as it is an illegal invocation to\n // call it from a different scope.\n window.matchMedia.bind(window) :\n noopMatchMedia;\n }\n /**\n * Confirms the layout engine will trigger for the selector query provided and returns the\n * MediaQueryList for the query provided.\n * @param {?} query\n * @return {?}\n */\n MediaMatcher.prototype.matchMedia = function (query) {\n if (this.platform.WEBKIT) {\n createEmptyStyleRule(query);\n }\n return this._matchMedia(query);\n };\n MediaMatcher.decorators = [\n { type: Injectable },\n ];\n /**\n * @nocollapse\n */\n MediaMatcher.ctorParameters = function () { return [\n { type: Platform, },\n ]; };\n return MediaMatcher;\n}());\n/**\n * For Webkit engines that only trigger the MediaQueryListListener when there is at least one CSS\n * selector for the respective media query.\n * @param {?} query\n * @return {?}\n */\nfunction createEmptyStyleRule(query) {\n if (!styleElementForWebkitCompatibility.has(query)) {\n try {\n var /** @type {?} */ style = document.createElement('style');\n style.setAttribute('type', 'text/css');\n if (!style.sheet) {\n var /** @type {?} */ cssText = \"@media \" + query + \" {.fx-query-test{ }}\";\n style.appendChild(document.createTextNode(cssText));\n }\n document.getElementsByTagName('head')[0].appendChild(style);\n // Store in private global registry\n styleElementForWebkitCompatibility.set(query, style);\n }\n catch (e) {\n console.error(e);\n }\n }\n}\n/**\n * No-op matchMedia replacement for non-browser platforms.\n * @param {?} query\n * @return {?}\n */\nfunction noopMatchMedia(query) {\n return {\n matches: query === 'all' || query === '',\n media: query,\n addListener: function () { },\n removeListener: function () { }\n };\n}\n\n/**\n * Utility for checking the matching state of \\@media queries.\n */\nvar BreakpointObserver = (function () {\n /**\n * @param {?} mediaMatcher\n * @param {?} zone\n */\n function BreakpointObserver(mediaMatcher, zone) {\n this.mediaMatcher = mediaMatcher;\n this.zone = zone;\n /**\n * A map of all media queries currently being listened for.\n */\n this._queries = new Map();\n /**\n * A subject for all other observables to takeUntil based on.\n */\n this._destroySubject = new Subject();\n }\n /**\n * Completes the active subject, signalling to all other observables to complete.\n * @return {?}\n */\n BreakpointObserver.prototype.ngOnDestroy = function () {\n this._destroySubject.next();\n this._destroySubject.complete();\n };\n /**\n * Whether the query currently is matched.\n * @param {?} value\n * @return {?}\n */\n BreakpointObserver.prototype.isMatched = function (value) {\n var _this = this;\n var /** @type {?} */ queries = coerceArray(value);\n return queries.some(function (mediaQuery) { return _this._registerQuery(mediaQuery).mql.matches; });\n };\n /**\n * Gets an observable of results for the given queries that will emit new results for any changes\n * in matching of the given queries.\n * @param {?} value\n * @return {?}\n */\n BreakpointObserver.prototype.observe = function (value) {\n var _this = this;\n var /** @type {?} */ queries = coerceArray(value);\n var /** @type {?} */ observables = queries.map(function (query) { return _this._registerQuery(query).observable; });\n return combineLatest(observables, function (a, b) {\n return {\n matches: !!((a && a.matches) || (b && b.matches)),\n };\n });\n };\n /**\n * Registers a specific query to be listened for.\n * @param {?} query\n * @return {?}\n */\n BreakpointObserver.prototype._registerQuery = function (query) {\n var _this = this;\n // Only set up a new MediaQueryList if it is not already being listened for.\n if (this._queries.has(query)) {\n return ((this._queries.get(query)));\n }\n var /** @type {?} */ mql = this.mediaMatcher.matchMedia(query);\n // Create callback for match changes and add it is as a listener.\n var /** @type {?} */ queryObservable = RxChain.from(fromEventPattern(\n // Listener callback methods are wrapped to be placed back in ngZone. Callbacks must be placed\n // back into the zone because matchMedia is only included in Zone.js by loading the\n // webapis-media-query.js file alongside the zone.js file. Additionally, some browsers do not\n // have MediaQueryList inherit from EventTarget, which causes inconsistencies in how Zone.js\n // patches it.\n function (listener) {\n mql.addListener(function (e) { return _this.zone.run(function () { return listener(e); }); });\n }, function (listener) {\n mql.removeListener(function (e) { return _this.zone.run(function () { return listener(e); }); });\n }))\n .call(takeUntil, this._destroySubject)\n .call(startWith, mql)\n .call(map, function (nextMql) { return ({ matches: nextMql.matches }); })\n .result();\n // Add the MediaQueryList to the set of queries.\n var /** @type {?} */ output = { observable: queryObservable, mql: mql };\n this._queries.set(query, output);\n return output;\n };\n BreakpointObserver.decorators = [\n { type: Injectable },\n ];\n /**\n * @nocollapse\n */\n BreakpointObserver.ctorParameters = function () { return [\n { type: MediaMatcher, },\n { type: NgZone, },\n ]; };\n return BreakpointObserver;\n}());\n\n// PascalCase is being used as Breakpoints is used like an enum.\n// tslint:disable-next-line:variable-name\nvar Breakpoints = {\n Handset: '(max-width: 599px) and (orientation: portrait), ' +\n '(max-width: 959px) and (orientation: landscape)',\n Tablet: '(min-width: 600px) and (max-width: 839px) and (orientation: portrait), ' +\n '(min-width: 960px) and (max-width: 1279px) and (orientation: landscape)',\n Web: '(min-width: 840px) and (orientation: portrait), ' +\n '(min-width: 1280px) and (orientation: landscape)',\n HandsetPortrait: '(max-width: 599px) and (orientation: portrait)',\n TabletPortrait: '(min-width: 600px) and (max-width: 839px) and (orientation: portrait)',\n WebPortrait: '(min-width: 840px) and (orientation: portrait)',\n HandsetLandscape: '(max-width: 959px) and (orientation: landscape)',\n TabletLandscape: '(min-width: 960px) and (max-width: 1279px) and (orientation: landscape)',\n WebLandscape: '(min-width: 1280px) and (orientation: landscape)',\n};\n\nvar LayoutModule = (function () {\n function LayoutModule() {\n }\n LayoutModule.decorators = [\n { type: NgModule, args: [{\n providers: [BreakpointObserver, MediaMatcher],\n imports: [PlatformModule],\n },] },\n ];\n /**\n * @nocollapse\n */\n LayoutModule.ctorParameters = function () { return []; };\n return LayoutModule;\n}());\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { LayoutModule, BreakpointObserver, Breakpoints, MediaMatcher };\n//# sourceMappingURL=layout.es5.js.map\n"],"names":["Injectable","Platform","Subject","coerceArray","combineLatest","RxChain","fromEventPattern","takeUntil","startWith","map","NgZone","NgModule","PlatformModule"],"mappings":";;;;;;;;;;;;;AAeA;;;AAGA,IAAI,kCAAkC,GAAG,IAAI,GAAG,EAAE,CAAC;;;;AAInD,IAAI,YAAY,IAAI,YAAY;;;;IAI5B,SAAS,YAAY,CAAC,QAAQ,EAAE;QAC5B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS;;;YAGtC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC;YAC9B,cAAc,CAAC;KACtB;;;;;;;IAOD,YAAY,CAAC,SAAS,CAAC,UAAU,GAAG,UAAU,KAAK,EAAE;QACjD,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;YACtB,oBAAoB,CAAC,KAAK,CAAC,CAAC;SAC/B;QACD,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;KAClC,CAAC;IACF,YAAY,CAAC,UAAU,GAAG;QACtB,EAAE,IAAI,EAAEA,wBAAU,EAAE;KACvB,CAAC;;;;IAIF,YAAY,CAAC,cAAc,GAAG,YAAY,EAAE,OAAO;QAC/C,EAAE,IAAI,EAAEC,8BAAQ,GAAG;KACtB,CAAC,EAAE,CAAC;IACL,OAAO,YAAY,CAAC;CACvB,EAAE,CAAC,CAAC;;;;;;;AAOL,SAAS,oBAAoB,CAAC,KAAK,EAAE;IACjC,IAAI,C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