blob: 5729f7e86189e04e8cdbf8d28ffe1b32b0610640 [file] [log] [blame]
{"version":3,"sources":["src/cdk/cdk-platform.umd.js"],"names":["global","factory","exports","module","require","define","amd","self","ng","cdk","platform","core","common","this","i0","hasV8BreakIterator","Platform","supportedInputTypes","PlatformModule","Intl","v8BreakIterator","_a","_platformId","isBrowser","isPlatformBrowser","document","EDGE","test","navigator","userAgent","TRIDENT","BLINK","window","chrome","CSS","WEBKIT","IOS","FIREFOX","ANDROID","SAFARI","ɵprov","ɵɵdefineInjectable","Platform_Factory","ɵɵinject","PLATFORM_ID","token","providedIn","decorators","type","Injectable","args","ctorParameters","Object","Inject","NgModule","supportsPassiveEvents","rtlScrollAxisType","scrollBehaviorSupported","shadowDomIsSupported","candidateInputTypes","supportsPassiveEventListeners","addEventListener","defineProperty","get","_supportsShadowDom","head","createShadowRoot","attachShadow","_getShadowRoot","element","rootNode","getRootNode","ShadowRoot","getRtlScrollAxisType","scrollContainer","createElement","containerStyle","style","dir","width","overflow","visibility","pointerEvents","position","content","contentStyle","height","appendChild","body","scrollLeft","parentNode","removeChild","getSupportedInputTypes","Set","featureTestInput","filter","value","setAttribute","normalizePassiveListenerOptions","options","capture","supportsScrollBehavior","Element","documentElement","scrollToFunction","prototype","scrollTo","toString"],"mappings":"CAAC,SAAUA,EAAQC,GACI,iBAAZC,SAA0C,oBAAXC,OAAyBF,EAAQC,QAASE,QAAQ,iBAAkBA,QAAQ,oBAChG,mBAAXC,QAAyBA,OAAOC,IAAMD,OAAO,wBAAyB,CAAC,UAAW,gBAAiB,mBAAoBJ,GACpGA,IAAzBD,EAASA,GAAUO,MAAsBC,GAAKR,EAAOQ,IAAM,GAAIR,EAAOQ,GAAGC,IAAMT,EAAOQ,GAAGC,KAAO,GAAIT,EAAOQ,GAAGC,IAAIC,SAAW,IAAKV,EAAOQ,GAAGG,KAAMX,EAAOQ,GAAGI,QAHjK,CAIEC,MAAM,SAAWX,EAASY,EAAIF,GAAU;;;;;;;OAWtC,IAAI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,EAAaC,OAAS,MACtBZ,EAAgBa,YAAYH,GAC5B3D,SAAS+D,KAAKD,YAAYb,GAC1BlB,EAAoB,EAIe,IAA/BkB,EAAgBe,aAKhBf,EAAgBe,WAAa,EAC7BjC,EACmC,IAA/BkB,EAAgBe,WAAmB,EAAkB,GAE7Df,EAAgBgB,WAAWC,YAAYjB,GAE3C,OAAOlB;;;;;;;QAiDXtD,EAAQ0F,uBA3LR,SAASA,IAEL,GAAI3E,EACA,OAAOA,EAKX,GAAwB,iBAAbQ,WAA0BA,SAEjC,OADAR,EAAsB,IAAI4E,IAAIlC,GAGlC,IAAImC,EAAmBrE,SAASkD,cAAc,SAK9C,OAJA1D,EAAsB,IAAI4E,IAAIlC,EAAoBoC,QAAO,SAAUC,GAE/D,OADAF,EAAiBG,aAAa,OAAQD,GAC/BF,EAAiB9C,OAASgD;;;;;;;QA6KzC9F,EAAQgG,gCAxIR,SAASA,EAAgCC,GACrC,OAAOvC,IAAkCuC,IAAYA,EAAQC;;;;;;;QAwIjElG,EAAQ0D,8BAAgCA,EACxC1D,EAAQmG,uBA1HR,SAASA,IACL,GAA+B,MAA3B5C,EAAiC,CAGjC,GAAwB,iBAAbhC,WAA0BA,UAA+B,mBAAZ6E,UAA2BA,QAE/E,OADA7C,GAA0B,EAI9B,GAAI,mBAAoBhC,SAAS8E,gBAAgB1B,MAC7CpB,GAA0B,MAEzB,CAGD,IAAI+C,EAAmBF,QAAQG,UAAUC,SAMrCjD,IALA+C,IAK2B,4BAA4B7E,KAAK6E,EAAiBG,aAOzF,OAAOlD,GAgGXL,OAAOU,eAAe5D,EAAS,aAAc,CAAE8F,OAAO","sourcesContent":["(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common')) :\n typeof define === 'function' && define.amd ? define('@angular/cdk/platform', ['exports', '@angular/core', '@angular/common'], factory) :\n (global = global || self, factory((global.ng = global.ng || {}, global.ng.cdk = global.ng.cdk || {}, global.ng.cdk.platform = {}), global.ng.core, global.ng.common));\n}(this, (function (exports, i0, common) { '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 // Whether the current platform supports the V8 Break Iterator. The V8 check\n // is necessary to detect all Blink based browsers.\n var hasV8BreakIterator;\n // We need a try/catch around the reference to `Intl`, because accessing it in some cases can\n // cause IE to throw. These cases are tied to particular versions of Windows and can happen if\n // the consumer is providing a polyfilled `Map`. See:\n // https://github.com/Microsoft/ChakraCore/issues/3189\n // https://github.com/angular/components/issues/15687\n try {\n hasV8BreakIterator = (typeof Intl !== 'undefined' && Intl.v8BreakIterator);\n }\n catch (_a) {\n hasV8BreakIterator = false;\n }\n /**\n * Service to detect the current platform by comparing the userAgent strings and\n * checking browser-specific global properties.\n */\n var Platform = /** @class */ (function () {\n function Platform(_platformId) {\n this._platformId = _platformId;\n // We want to use the Angular platform check because if the Document is shimmed\n // without the navigator, the following checks will fail. This is preferred because\n // sometimes the Document may be shimmed without the user's knowledge or intention\n /** Whether the Angular application is being rendered in the browser. */\n this.isBrowser = this._platformId ?\n common.isPlatformBrowser(this._platformId) : typeof document === 'object' && !!document;\n /** Whether the current browser is Microsoft Edge. */\n this.EDGE = this.isBrowser && /(edge)/i.test(navigator.userAgent);\n /** Whether the current rendering engine is Microsoft Trident. */\n this.TRIDENT = this.isBrowser && /(msie|trident)/i.test(navigator.userAgent);\n // EdgeHTML and Trident mock Blink specific things and need to be excluded from this check.\n /** Whether the current rendering engine is Blink. */\n this.BLINK = this.isBrowser && (!!(window.chrome || hasV8BreakIterator) &&\n typeof CSS !== 'undefined' && !this.EDGE && !this.TRIDENT);\n // Webkit is part of the userAgent in EdgeHTML, Blink and Trident. Therefore we need to\n // ensure that Webkit runs standalone and is not used as another engine's base.\n /** Whether the current rendering engine is WebKit. */\n this.WEBKIT = this.isBrowser &&\n /AppleWebKit/i.test(navigator.userAgent) && !this.BLINK && !this.EDGE && !this.TRIDENT;\n /** Whether the current platform is Apple iOS. */\n this.IOS = this.isBrowser && /iPad|iPhone|iPod/.test(navigator.userAgent) &&\n !('MSStream' in window);\n // It's difficult to detect the plain Gecko engine, because most of the browsers identify\n // them self as Gecko-like browsers and modify the userAgent's according to that.\n // Since we only cover one explicit Firefox case, we can simply check for Firefox\n // instead of having an unstable check for Gecko.\n /** Whether the current browser is Firefox. */\n this.FIREFOX = this.isBrowser && /(firefox|minefield)/i.test(navigator.userAgent);\n /** Whether the current platform is Android. */\n // Trident on mobile adds the android platform to the userAgent to trick detections.\n this.ANDROID = this.isBrowser && /android/i.test(navigator.userAgent) && !this.TRIDENT;\n // Safari browsers will include the Safari keyword in their userAgent. Some browsers may fake\n // this and just place the Safari keyword in the userAgent. To be more safe about Safari every\n // Safari browser should also use Webkit as its layout engine.\n /** Whether the current browser is Safari. */\n this.SAFARI = this.isBrowser && /safari/i.test(navigator.userAgent) && this.WEBKIT;\n }\n return Platform;\n }());\n Platform.ɵprov = i0.ɵɵdefineInjectable({ factory: function Platform_Factory() { return new Platform(i0.ɵɵinject(i0.PLATFORM_ID)); }, token: Platform, providedIn: \"root\" });\n Platform.decorators = [\n { type: i0.Injectable, args: [{ providedIn: 'root' },] }\n ];\n Platform.ctorParameters = function () { return [\n { type: Object, decorators: [{ type: i0.Inject, args: [i0.PLATFORM_ID,] }] }\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 PlatformModule = /** @class */ (function () {\n function PlatformModule() {\n }\n return PlatformModule;\n }());\n PlatformModule.decorators = [\n { type: i0.NgModule, args: [{},] }\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 /** Cached result Set of input types support by the current browser. */\n var supportedInputTypes;\n /** Types of `<input>` that *might* be supported. */\n var candidateInputTypes = [\n // `color` must come first. Chrome 56 shows a warning if we change the type to `color` after\n // first changing it to something else:\n // The specified value \"\" does not conform to the required format.\n // The format is \"#rrggbb\" where rr, gg, bb are two-digit hexadecimal numbers.\n 'color',\n 'button',\n 'checkbox',\n 'date',\n 'datetime-local',\n 'email',\n 'file',\n 'hidden',\n 'image',\n 'month',\n 'number',\n 'password',\n 'radio',\n 'range',\n 'reset',\n 'search',\n 'submit',\n 'tel',\n 'text',\n 'time',\n 'url',\n 'week',\n ];\n /** @returns The input types supported by this browser. */\n function getSupportedInputTypes() {\n // Result is cached.\n if (supportedInputTypes) {\n return supportedInputTypes;\n }\n // We can't check if an input type is not supported until we're on the browser, so say that\n // everything is supported when not on the browser. We don't use `Platform` here since it's\n // just a helper function and can't inject it.\n if (typeof document !== 'object' || !document) {\n supportedInputTypes = new Set(candidateInputTypes);\n return supportedInputTypes;\n }\n var featureTestInput = document.createElement('input');\n supportedInputTypes = new Set(candidateInputTypes.filter(function (value) {\n featureTestInput.setAttribute('type', value);\n return featureTestInput.type === value;\n }));\n return supportedInputTypes;\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 /** Cached result of whether the user's browser supports passive event listeners. */\n var supportsPassiveEvents;\n /**\n * Checks whether the user's browser supports passive event listeners.\n * See: https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md\n */\n function supportsPassiveEventListeners() {\n if (supportsPassiveEvents == null && typeof window !== 'undefined') {\n try {\n window.addEventListener('test', null, Object.defineProperty({}, 'passive', {\n get: function () { return supportsPassiveEvents = true; }\n }));\n }\n finally {\n supportsPassiveEvents = supportsPassiveEvents || false;\n }\n }\n return supportsPassiveEvents;\n }\n /**\n * Normalizes an `AddEventListener` object to something that can be passed\n * to `addEventListener` on any browser, no matter whether it supports the\n * `options` parameter.\n * @param options Object to be normalized.\n */\n function normalizePassiveListenerOptions(options) {\n return supportsPassiveEventListeners() ? options : !!options.capture;\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 /** Cached result of the way the browser handles the horizontal scroll axis in RTL mode. */\n var rtlScrollAxisType;\n /** Cached result of the check that indicates whether the browser supports scroll behaviors. */\n var scrollBehaviorSupported;\n /** Check whether the browser supports scroll behaviors. */\n function supportsScrollBehavior() {\n if (scrollBehaviorSupported == null) {\n // If we're not in the browser, it can't be supported. Also check for `Element`, because\n // some projects stub out the global `document` during SSR which can throw us off.\n if (typeof document !== 'object' || !document || typeof Element !== 'function' || !Element) {\n scrollBehaviorSupported = false;\n return scrollBehaviorSupported;\n }\n // If the element can have a `scrollBehavior` style, we can be sure that it's supported.\n if ('scrollBehavior' in document.documentElement.style) {\n scrollBehaviorSupported = true;\n }\n else {\n // At this point we have 3 possibilities: `scrollTo` isn't supported at all, it's\n // supported but it doesn't handle scroll behavior, or it has been polyfilled.\n var scrollToFunction = Element.prototype.scrollTo;\n if (scrollToFunction) {\n // We can detect if the function has been polyfilled by calling `toString` on it. Native\n // functions are obfuscated using `[native code]`, whereas if it was overwritten we'd get\n // the actual function source. Via https://davidwalsh.name/detect-native-function. Consider\n // polyfilled functions as supporting scroll behavior.\n scrollBehaviorSupported = !/\\{\\s*\\[native code\\]\\s*\\}/.test(scrollToFunction.toString());\n }\n else {\n scrollBehaviorSupported = false;\n }\n }\n }\n return scrollBehaviorSupported;\n }\n /**\n * Checks the type of RTL scroll axis used by this browser. As of time of writing, Chrome is NORMAL,\n * Firefox & Safari are NEGATED, and IE & Edge are INVERTED.\n */\n function getRtlScrollAxisType() {\n // We can't check unless we're on the browser. Just assume 'normal' if we're not.\n if (typeof document !== 'object' || !document) {\n return 0 /* NORMAL */;\n }\n if (rtlScrollAxisType == null) {\n // Create a 1px wide scrolling container and a 2px wide content element.\n var scrollContainer = document.createElement('div');\n var containerStyle = scrollContainer.style;\n scrollContainer.dir = 'rtl';\n containerStyle.width = '1px';\n containerStyle.overflow = 'auto';\n containerStyle.visibility = 'hidden';\n containerStyle.pointerEvents = 'none';\n containerStyle.position = 'absolute';\n var content = document.createElement('div');\n var contentStyle = content.style;\n contentStyle.width = '2px';\n contentStyle.height = '1px';\n scrollContainer.appendChild(content);\n document.body.appendChild(scrollContainer);\n rtlScrollAxisType = 0 /* NORMAL */;\n // The viewport starts scrolled all the way to the right in RTL mode. If we are in a NORMAL\n // browser this would mean that the scrollLeft should be 1. If it's zero instead we know we're\n // dealing with one of the other two types of browsers.\n if (scrollContainer.scrollLeft === 0) {\n // In a NEGATED browser the scrollLeft is always somewhere in [-maxScrollAmount, 0]. For an\n // INVERTED browser it is always somewhere in [0, maxScrollAmount]. We can determine which by\n // setting to the scrollLeft to 1. This is past the max for a NEGATED browser, so it will\n // return 0 when we read it again.\n scrollContainer.scrollLeft = 1;\n rtlScrollAxisType =\n scrollContainer.scrollLeft === 0 ? 1 /* NEGATED */ : 2 /* INVERTED */;\n }\n scrollContainer.parentNode.removeChild(scrollContainer);\n }\n return rtlScrollAxisType;\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 shadowDomIsSupported;\n /** Checks whether the user's browser support Shadow DOM. */\n function _supportsShadowDom() {\n if (shadowDomIsSupported == null) {\n var head = typeof document !== 'undefined' ? document.head : null;\n shadowDomIsSupported = !!(head && (head.createShadowRoot || head.attachShadow));\n }\n return shadowDomIsSupported;\n }\n /** Gets the shadow root of an element, if supported and the element is inside the Shadow DOM. */\n function _getShadowRoot(element) {\n if (_supportsShadowDom()) {\n var rootNode = element.getRootNode ? element.getRootNode() : null;\n // Note that this should be caught by `_supportsShadowDom`, but some\n // teams have been able to hit this code path on unsupported browsers.\n if (typeof ShadowRoot !== 'undefined' && ShadowRoot && rootNode instanceof ShadowRoot) {\n return rootNode;\n }\n }\n return null;\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.Platform = Platform;\n exports.PlatformModule = PlatformModule;\n exports._getShadowRoot = _getShadowRoot;\n exports._supportsShadowDom = _supportsShadowDom;\n exports.getRtlScrollAxisType = getRtlScrollAxisType;\n exports.getSupportedInputTypes = getSupportedInputTypes;\n exports.normalizePassiveListenerOptions = normalizePassiveListenerOptions;\n exports.supportsPassiveEventListeners = supportsPassiveEventListeners;\n exports.supportsScrollBehavior = supportsScrollBehavior;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n})));\n//# sourceMappingURL=cdk-platform.umd.js.map\n"]}