@angular/platform-browser 13.0.2 → 13.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/animations/animations.d.ts +1 -1
  2. package/esm2020/animations/src/animation_builder.mjs +3 -3
  3. package/esm2020/animations/src/animation_renderer.mjs +6 -6
  4. package/esm2020/animations/src/module.mjs +8 -8
  5. package/esm2020/animations/src/providers.mjs +3 -3
  6. package/esm2020/src/browser/meta.mjs +3 -3
  7. package/esm2020/src/browser/title.mjs +3 -3
  8. package/esm2020/src/browser/transfer_state.mjs +7 -7
  9. package/esm2020/src/browser/xhr.mjs +3 -3
  10. package/esm2020/src/browser.mjs +6 -24
  11. package/esm2020/src/dom/debug/ng_probe.mjs +2 -24
  12. package/esm2020/src/dom/dom_renderer.mjs +3 -3
  13. package/esm2020/src/dom/events/dom_events.mjs +3 -3
  14. package/esm2020/src/dom/events/event_manager.mjs +3 -3
  15. package/esm2020/src/dom/events/hammer_gestures.mjs +30 -31
  16. package/esm2020/src/dom/events/key_events.mjs +3 -3
  17. package/esm2020/src/dom/shared_styles_host.mjs +6 -6
  18. package/esm2020/src/platform-browser.mjs +2 -4
  19. package/esm2020/src/private_export.mjs +2 -3
  20. package/esm2020/src/security/dom_sanitization_service.mjs +6 -6
  21. package/esm2020/src/version.mjs +1 -1
  22. package/esm2020/testing/src/browser.mjs +6 -8
  23. package/fesm2015/animations.mjs +20 -20
  24. package/fesm2015/animations.mjs.map +1 -1
  25. package/fesm2015/platform-browser.mjs +573 -641
  26. package/fesm2015/platform-browser.mjs.map +1 -1
  27. package/fesm2015/testing.mjs +6 -8
  28. package/fesm2015/testing.mjs.map +1 -1
  29. package/fesm2020/animations.mjs +20 -20
  30. package/fesm2020/animations.mjs.map +1 -1
  31. package/fesm2020/platform-browser.mjs +569 -637
  32. package/fesm2020/platform-browser.mjs.map +1 -1
  33. package/fesm2020/testing.mjs +6 -8
  34. package/fesm2020/testing.mjs.map +1 -1
  35. package/package.json +4 -4
  36. package/platform-browser.d.ts +1 -30
  37. package/testing/testing.d.ts +1 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v13.0.2
2
+ * @license Angular v13.0.3
3
3
  * (c) 2010-2021 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -7,7 +7,7 @@
7
7
  import { ɵDomAdapter, ɵsetRootDomAdapter, ɵparseCookieValue, ɵgetDOM, DOCUMENT, ɵPLATFORM_BROWSER_ID, XhrFactory, CommonModule } from '@angular/common';
8
8
  export { ɵgetDOM } from '@angular/common';
9
9
  import * as i0 from '@angular/core';
10
- import { InjectionToken, ApplicationInitStatus, APP_INITIALIZER, Injector, setTestabilityGetter, ɵglobal, Injectable, ApplicationRef, NgZone, ɵgetDebugNodeR2, NgProbeToken, Optional, Inject, ViewEncapsulation, APP_ID, RendererStyleFlags2, ɵConsole, NgModule, forwardRef, SecurityContext, ɵallowSanitizationBypassAndThrow, ɵunwrapSafeValue, ɵgetSanitizationBypassType, ɵ_sanitizeUrl, ɵ_sanitizeHtml, ɵbypassSanitizationTrustHtml, ɵbypassSanitizationTrustStyle, ɵbypassSanitizationTrustScript, ɵbypassSanitizationTrustUrl, ɵbypassSanitizationTrustResourceUrl, ErrorHandler, ɵsetDocument, PLATFORM_ID, PLATFORM_INITIALIZER, Sanitizer, createPlatformFactory, platformCore, ɵINJECTOR_SCOPE, RendererFactory2, Testability, ApplicationModule, SkipSelf, ɵɵinject, Version } from '@angular/core';
10
+ import { InjectionToken, ApplicationInitStatus, APP_INITIALIZER, Injector, setTestabilityGetter, ɵglobal, Injectable, Inject, ViewEncapsulation, APP_ID, RendererStyleFlags2, ErrorHandler, ɵsetDocument, PLATFORM_ID, PLATFORM_INITIALIZER, createPlatformFactory, platformCore, ɵINJECTOR_SCOPE, NgZone, RendererFactory2, Testability, ApplicationModule, NgModule, Optional, SkipSelf, ɵɵinject, ApplicationRef, ɵConsole, forwardRef, SecurityContext, ɵallowSanitizationBypassAndThrow, ɵunwrapSafeValue, ɵgetSanitizationBypassType, ɵ_sanitizeUrl, ɵ_sanitizeHtml, ɵbypassSanitizationTrustHtml, ɵbypassSanitizationTrustStyle, ɵbypassSanitizationTrustScript, ɵbypassSanitizationTrustUrl, ɵbypassSanitizationTrustResourceUrl, Version } from '@angular/core';
11
11
 
12
12
  /**
13
13
  * @license
@@ -221,97 +221,12 @@ class BrowserXhr {
221
221
  return new XMLHttpRequest();
222
222
  }
223
223
  }
224
- BrowserXhr.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: BrowserXhr, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
225
- BrowserXhr.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: BrowserXhr });
226
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: BrowserXhr, decorators: [{
224
+ BrowserXhr.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: BrowserXhr, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
225
+ BrowserXhr.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: BrowserXhr });
226
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: BrowserXhr, decorators: [{
227
227
  type: Injectable
228
228
  }] });
229
229
 
230
- /**
231
- * @license
232
- * Copyright Google LLC All Rights Reserved.
233
- *
234
- * Use of this source code is governed by an MIT-style license that can be
235
- * found in the LICENSE file at https://angular.io/license
236
- */
237
- const CAMEL_CASE_REGEXP = /([A-Z])/g;
238
- const DASH_CASE_REGEXP = /-([a-z])/g;
239
- function camelCaseToDashCase(input) {
240
- return input.replace(CAMEL_CASE_REGEXP, (...m) => '-' + m[1].toLowerCase());
241
- }
242
- function dashCaseToCamelCase(input) {
243
- return input.replace(DASH_CASE_REGEXP, (...m) => m[1].toUpperCase());
244
- }
245
- /**
246
- * Exports the value under a given `name` in the global property `ng`. For example `ng.probe` if
247
- * `name` is `'probe'`.
248
- * @param name Name under which it will be exported. Keep in mind this will be a property of the
249
- * global `ng` object.
250
- * @param value The value to export.
251
- */
252
- function exportNgVar(name, value) {
253
- if (typeof COMPILED === 'undefined' || !COMPILED) {
254
- // Note: we can't export `ng` when using closure enhanced optimization as:
255
- // - closure declares globals itself for minified names, which sometimes clobber our `ng` global
256
- // - we can't declare a closure extern as the namespace `ng` is already used within Google
257
- // for typings for angularJS (via `goog.provide('ng....')`).
258
- const ng = ɵglobal['ng'] = ɵglobal['ng'] || {};
259
- ng[name] = value;
260
- }
261
- }
262
-
263
- /**
264
- * @license
265
- * Copyright Google LLC All Rights Reserved.
266
- *
267
- * Use of this source code is governed by an MIT-style license that can be
268
- * found in the LICENSE file at https://angular.io/license
269
- */
270
- const CORE_TOKENS = (() => ({
271
- 'ApplicationRef': ApplicationRef,
272
- 'NgZone': NgZone,
273
- }))();
274
- const INSPECT_GLOBAL_NAME = 'probe';
275
- const CORE_TOKENS_GLOBAL_NAME = 'coreTokens';
276
- /**
277
- * Returns a {@link DebugElement} for the given native DOM element, or
278
- * null if the given native element does not have an Angular view associated
279
- * with it.
280
- */
281
- function inspectNativeElementR2(element) {
282
- return ɵgetDebugNodeR2(element);
283
- }
284
- function _createNgProbeR2(coreTokens) {
285
- exportNgVar(INSPECT_GLOBAL_NAME, inspectNativeElementR2);
286
- exportNgVar(CORE_TOKENS_GLOBAL_NAME, Object.assign(Object.assign({}, CORE_TOKENS), _ngProbeTokensToMap(coreTokens || [])));
287
- return () => inspectNativeElementR2;
288
- }
289
- function _ngProbeTokensToMap(tokens) {
290
- return tokens.reduce((prev, t) => (prev[t.name] = t.token, prev), {});
291
- }
292
- /**
293
- * In Ivy, we don't support NgProbe because we have our own set of testing utilities
294
- * with more robust functionality.
295
- *
296
- * We shouldn't bring in NgProbe because it prevents DebugNode and friends from
297
- * tree-shaking properly.
298
- */
299
- const ELEMENT_PROBE_PROVIDERS__POST_R3__ = [];
300
- /**
301
- * Providers which support debugging Angular applications (e.g. via `ng.probe`).
302
- */
303
- const ELEMENT_PROBE_PROVIDERS__PRE_R3__ = [
304
- {
305
- provide: APP_INITIALIZER,
306
- useFactory: _createNgProbeR2,
307
- deps: [
308
- [NgProbeToken, new Optional()],
309
- ],
310
- multi: true,
311
- },
312
- ];
313
- const ELEMENT_PROBE_PROVIDERS = ELEMENT_PROBE_PROVIDERS__POST_R3__;
314
-
315
230
  /**
316
231
  * @license
317
232
  * Copyright Google LLC All Rights Reserved.
@@ -391,9 +306,9 @@ class EventManager {
391
306
  throw new Error(`No event manager plugin found for event ${eventName}`);
392
307
  }
393
308
  }
394
- EventManager.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: EventManager, deps: [{ token: EVENT_MANAGER_PLUGINS }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
395
- EventManager.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: EventManager });
396
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: EventManager, decorators: [{
309
+ EventManager.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: EventManager, deps: [{ token: EVENT_MANAGER_PLUGINS }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
310
+ EventManager.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: EventManager });
311
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: EventManager, decorators: [{
397
312
  type: Injectable
398
313
  }], ctorParameters: function () {
399
314
  return [{ type: undefined, decorators: [{
@@ -441,9 +356,9 @@ class SharedStylesHost {
441
356
  return Array.from(this._stylesSet);
442
357
  }
443
358
  }
444
- SharedStylesHost.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SharedStylesHost, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
445
- SharedStylesHost.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SharedStylesHost });
446
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SharedStylesHost, decorators: [{
359
+ SharedStylesHost.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: SharedStylesHost, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
360
+ SharedStylesHost.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: SharedStylesHost });
361
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: SharedStylesHost, decorators: [{
447
362
  type: Injectable
448
363
  }] });
449
364
  class DomSharedStylesHost extends SharedStylesHost {
@@ -482,9 +397,9 @@ class DomSharedStylesHost extends SharedStylesHost {
482
397
  this._hostNodes.forEach(styleNodes => styleNodes.forEach(removeStyle));
483
398
  }
484
399
  }
485
- DomSharedStylesHost.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: DomSharedStylesHost, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
486
- DomSharedStylesHost.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: DomSharedStylesHost });
487
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: DomSharedStylesHost, decorators: [{
400
+ DomSharedStylesHost.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: DomSharedStylesHost, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
401
+ DomSharedStylesHost.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: DomSharedStylesHost });
402
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: DomSharedStylesHost, decorators: [{
488
403
  type: Injectable
489
404
  }], ctorParameters: function () {
490
405
  return [{ type: undefined, decorators: [{
@@ -606,9 +521,9 @@ class DomRendererFactory2 {
606
521
  begin() { }
607
522
  end() { }
608
523
  }
609
- DomRendererFactory2.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: DomRendererFactory2, deps: [{ token: EventManager }, { token: DomSharedStylesHost }, { token: APP_ID }], target: i0.ɵɵFactoryTarget.Injectable });
610
- DomRendererFactory2.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: DomRendererFactory2 });
611
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: DomRendererFactory2, decorators: [{
524
+ DomRendererFactory2.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: DomRendererFactory2, deps: [{ token: EventManager }, { token: DomSharedStylesHost }, { token: APP_ID }], target: i0.ɵɵFactoryTarget.Injectable });
525
+ DomRendererFactory2.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: DomRendererFactory2 });
526
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: DomRendererFactory2, decorators: [{
612
527
  type: Injectable
613
528
  }], ctorParameters: function () {
614
529
  return [{ type: EventManager }, { type: DomSharedStylesHost }, { type: undefined, decorators: [{
@@ -826,9 +741,9 @@ class DomEventsPlugin extends EventManagerPlugin {
826
741
  return target.removeEventListener(eventName, callback);
827
742
  }
828
743
  }
829
- DomEventsPlugin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: DomEventsPlugin, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
830
- DomEventsPlugin.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: DomEventsPlugin });
831
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: DomEventsPlugin, decorators: [{
744
+ DomEventsPlugin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: DomEventsPlugin, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
745
+ DomEventsPlugin.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: DomEventsPlugin });
746
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: DomEventsPlugin, decorators: [{
832
747
  type: Injectable
833
748
  }], ctorParameters: function () {
834
749
  return [{ type: undefined, decorators: [{
@@ -845,350 +760,86 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImpor
845
760
  * found in the LICENSE file at https://angular.io/license
846
761
  */
847
762
  /**
848
- * Supported HammerJS recognizer event names.
763
+ * Defines supported modifiers for key events.
849
764
  */
850
- const EVENT_NAMES = {
851
- // pan
852
- 'pan': true,
853
- 'panstart': true,
854
- 'panmove': true,
855
- 'panend': true,
856
- 'pancancel': true,
857
- 'panleft': true,
858
- 'panright': true,
859
- 'panup': true,
860
- 'pandown': true,
861
- // pinch
862
- 'pinch': true,
863
- 'pinchstart': true,
864
- 'pinchmove': true,
865
- 'pinchend': true,
866
- 'pinchcancel': true,
867
- 'pinchin': true,
868
- 'pinchout': true,
869
- // press
870
- 'press': true,
871
- 'pressup': true,
872
- // rotate
873
- 'rotate': true,
874
- 'rotatestart': true,
875
- 'rotatemove': true,
876
- 'rotateend': true,
877
- 'rotatecancel': true,
878
- // swipe
879
- 'swipe': true,
880
- 'swipeleft': true,
881
- 'swiperight': true,
882
- 'swipeup': true,
883
- 'swipedown': true,
884
- // tap
885
- 'tap': true,
886
- 'doubletap': true
765
+ const MODIFIER_KEYS = ['alt', 'control', 'meta', 'shift'];
766
+ const DOM_KEY_LOCATION_NUMPAD = 3;
767
+ // Map to convert some key or keyIdentifier values to what will be returned by getEventKey
768
+ const _keyMap = {
769
+ // The following values are here for cross-browser compatibility and to match the W3C standard
770
+ // cf https://www.w3.org/TR/DOM-Level-3-Events-key/
771
+ '\b': 'Backspace',
772
+ '\t': 'Tab',
773
+ '\x7F': 'Delete',
774
+ '\x1B': 'Escape',
775
+ 'Del': 'Delete',
776
+ 'Esc': 'Escape',
777
+ 'Left': 'ArrowLeft',
778
+ 'Right': 'ArrowRight',
779
+ 'Up': 'ArrowUp',
780
+ 'Down': 'ArrowDown',
781
+ 'Menu': 'ContextMenu',
782
+ 'Scroll': 'ScrollLock',
783
+ 'Win': 'OS'
784
+ };
785
+ // There is a bug in Chrome for numeric keypad keys:
786
+ // https://code.google.com/p/chromium/issues/detail?id=155654
787
+ // 1, 2, 3 ... are reported as A, B, C ...
788
+ const _chromeNumKeyPadMap = {
789
+ 'A': '1',
790
+ 'B': '2',
791
+ 'C': '3',
792
+ 'D': '4',
793
+ 'E': '5',
794
+ 'F': '6',
795
+ 'G': '7',
796
+ 'H': '8',
797
+ 'I': '9',
798
+ 'J': '*',
799
+ 'K': '+',
800
+ 'M': '-',
801
+ 'N': '.',
802
+ 'O': '/',
803
+ '\x60': '0',
804
+ '\x90': 'NumLock'
887
805
  };
888
806
  /**
889
- * DI token for providing [HammerJS](https://hammerjs.github.io/) support to Angular.
890
- * @see `HammerGestureConfig`
891
- *
892
- * @ngModule HammerModule
893
- * @publicApi
894
- */
895
- const HAMMER_GESTURE_CONFIG = new InjectionToken('HammerGestureConfig');
896
- /**
897
- * Injection token used to provide a {@link HammerLoader} to Angular.
898
- *
899
- * @publicApi
807
+ * Retrieves modifiers from key-event objects.
900
808
  */
901
- const HAMMER_LOADER = new InjectionToken('HammerLoader');
809
+ const MODIFIER_KEY_GETTERS = {
810
+ 'alt': (event) => event.altKey,
811
+ 'control': (event) => event.ctrlKey,
812
+ 'meta': (event) => event.metaKey,
813
+ 'shift': (event) => event.shiftKey
814
+ };
902
815
  /**
903
- * An injectable [HammerJS Manager](https://hammerjs.github.io/api/#hammermanager)
904
- * for gesture recognition. Configures specific event recognition.
905
816
  * @publicApi
817
+ * A browser plug-in that provides support for handling of key events in Angular.
906
818
  */
907
- class HammerGestureConfig {
908
- constructor() {
909
- /**
910
- * A set of supported event names for gestures to be used in Angular.
911
- * Angular supports all built-in recognizers, as listed in
912
- * [HammerJS documentation](https://hammerjs.github.io/).
913
- */
914
- this.events = [];
915
- /**
916
- * Maps gesture event names to a set of configuration options
917
- * that specify overrides to the default values for specific properties.
918
- *
919
- * The key is a supported event name to be configured,
920
- * and the options object contains a set of properties, with override values
921
- * to be applied to the named recognizer event.
922
- * For example, to disable recognition of the rotate event, specify
923
- * `{"rotate": {"enable": false}}`.
924
- *
925
- * Properties that are not present take the HammerJS default values.
926
- * For information about which properties are supported for which events,
927
- * and their allowed and default values, see
928
- * [HammerJS documentation](https://hammerjs.github.io/).
929
- *
930
- */
931
- this.overrides = {};
932
- }
819
+ class KeyEventsPlugin extends EventManagerPlugin {
933
820
  /**
934
- * Creates a [HammerJS Manager](https://hammerjs.github.io/api/#hammermanager)
935
- * and attaches it to a given HTML element.
936
- * @param element The element that will recognize gestures.
937
- * @returns A HammerJS event-manager object.
821
+ * Initializes an instance of the browser plug-in.
822
+ * @param doc The document in which key events will be detected.
938
823
  */
939
- buildHammer(element) {
940
- const mc = new Hammer(element, this.options);
941
- mc.get('pinch').set({ enable: true });
942
- mc.get('rotate').set({ enable: true });
943
- for (const eventName in this.overrides) {
944
- mc.get(eventName).set(this.overrides[eventName]);
945
- }
946
- return mc;
947
- }
948
- }
949
- HammerGestureConfig.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: HammerGestureConfig, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
950
- HammerGestureConfig.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: HammerGestureConfig });
951
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: HammerGestureConfig, decorators: [{
952
- type: Injectable
953
- }] });
954
- /**
955
- * Event plugin that adds Hammer support to an application.
956
- *
957
- * @ngModule HammerModule
958
- */
959
- class HammerGesturesPlugin extends EventManagerPlugin {
960
- constructor(doc, _config, console, loader) {
824
+ constructor(doc) {
961
825
  super(doc);
962
- this._config = _config;
963
- this.console = console;
964
- this.loader = loader;
965
- this._loaderPromise = null;
966
826
  }
827
+ /**
828
+ * Reports whether a named key event is supported.
829
+ * @param eventName The event name to query.
830
+ * @return True if the named key event is supported.
831
+ */
967
832
  supports(eventName) {
968
- if (!EVENT_NAMES.hasOwnProperty(eventName.toLowerCase()) && !this.isCustomEvent(eventName)) {
969
- return false;
970
- }
971
- if (!window.Hammer && !this.loader) {
972
- if (typeof ngDevMode === 'undefined' || ngDevMode) {
973
- this.console.warn(`The "${eventName}" event cannot be bound because Hammer.JS is not ` +
974
- `loaded and no custom loader has been specified.`);
975
- }
976
- return false;
977
- }
978
- return true;
833
+ return KeyEventsPlugin.parseEventName(eventName) != null;
979
834
  }
980
- addEventListener(element, eventName, handler) {
981
- const zone = this.manager.getZone();
982
- eventName = eventName.toLowerCase();
983
- // If Hammer is not present but a loader is specified, we defer adding the event listener
984
- // until Hammer is loaded.
985
- if (!window.Hammer && this.loader) {
986
- this._loaderPromise = this._loaderPromise || this.loader();
987
- // This `addEventListener` method returns a function to remove the added listener.
988
- // Until Hammer is loaded, the returned function needs to *cancel* the registration rather
989
- // than remove anything.
990
- let cancelRegistration = false;
991
- let deregister = () => {
992
- cancelRegistration = true;
993
- };
994
- this._loaderPromise
995
- .then(() => {
996
- // If Hammer isn't actually loaded when the custom loader resolves, give up.
997
- if (!window.Hammer) {
998
- if (typeof ngDevMode === 'undefined' || ngDevMode) {
999
- this.console.warn(`The custom HAMMER_LOADER completed, but Hammer.JS is not present.`);
1000
- }
1001
- deregister = () => { };
1002
- return;
1003
- }
1004
- if (!cancelRegistration) {
1005
- // Now that Hammer is loaded and the listener is being loaded for real,
1006
- // the deregistration function changes from canceling registration to removal.
1007
- deregister = this.addEventListener(element, eventName, handler);
1008
- }
1009
- })
1010
- .catch(() => {
1011
- if (typeof ngDevMode === 'undefined' || ngDevMode) {
1012
- this.console.warn(`The "${eventName}" event cannot be bound because the custom ` +
1013
- `Hammer.JS loader failed.`);
1014
- }
1015
- deregister = () => { };
1016
- });
1017
- // Return a function that *executes* `deregister` (and not `deregister` itself) so that we
1018
- // can change the behavior of `deregister` once the listener is added. Using a closure in
1019
- // this way allows us to avoid any additional data structures to track listener removal.
1020
- return () => {
1021
- deregister();
1022
- };
1023
- }
1024
- return zone.runOutsideAngular(() => {
1025
- // Creating the manager bind events, must be done outside of angular
1026
- const mc = this._config.buildHammer(element);
1027
- const callback = function (eventObj) {
1028
- zone.runGuarded(function () {
1029
- handler(eventObj);
1030
- });
1031
- };
1032
- mc.on(eventName, callback);
1033
- return () => {
1034
- mc.off(eventName, callback);
1035
- // destroy mc to prevent memory leak
1036
- if (typeof mc.destroy === 'function') {
1037
- mc.destroy();
1038
- }
1039
- };
1040
- });
1041
- }
1042
- isCustomEvent(eventName) {
1043
- return this._config.events.indexOf(eventName) > -1;
1044
- }
1045
- }
1046
- HammerGesturesPlugin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: HammerGesturesPlugin, deps: [{ token: DOCUMENT }, { token: HAMMER_GESTURE_CONFIG }, { token: i0.ɵConsole }, { token: HAMMER_LOADER, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
1047
- HammerGesturesPlugin.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: HammerGesturesPlugin });
1048
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: HammerGesturesPlugin, decorators: [{
1049
- type: Injectable
1050
- }], ctorParameters: function () {
1051
- return [{ type: undefined, decorators: [{
1052
- type: Inject,
1053
- args: [DOCUMENT]
1054
- }] }, { type: HammerGestureConfig, decorators: [{
1055
- type: Inject,
1056
- args: [HAMMER_GESTURE_CONFIG]
1057
- }] }, { type: i0.ɵConsole }, { type: undefined, decorators: [{
1058
- type: Optional
1059
- }, {
1060
- type: Inject,
1061
- args: [HAMMER_LOADER]
1062
- }] }];
1063
- } });
1064
- /**
1065
- * In Ivy, support for Hammer gestures is optional, so applications must
1066
- * import the `HammerModule` at root to turn on support. This means that
1067
- * Hammer-specific code can be tree-shaken away if not needed.
1068
- */
1069
- const HAMMER_PROVIDERS__POST_R3__ = [];
1070
- /**
1071
- * In View Engine, support for Hammer gestures is built-in by default.
1072
- */
1073
- const HAMMER_PROVIDERS__PRE_R3__ = [
1074
- {
1075
- provide: EVENT_MANAGER_PLUGINS,
1076
- useClass: HammerGesturesPlugin,
1077
- multi: true,
1078
- deps: [DOCUMENT, HAMMER_GESTURE_CONFIG, ɵConsole, [new Optional(), HAMMER_LOADER]]
1079
- },
1080
- { provide: HAMMER_GESTURE_CONFIG, useClass: HammerGestureConfig, deps: [] },
1081
- ];
1082
- const HAMMER_PROVIDERS = HAMMER_PROVIDERS__POST_R3__;
1083
- /**
1084
- * Adds support for HammerJS.
1085
- *
1086
- * Import this module at the root of your application so that Angular can work with
1087
- * HammerJS to detect gesture events.
1088
- *
1089
- * Note that applications still need to include the HammerJS script itself. This module
1090
- * simply sets up the coordination layer between HammerJS and Angular's EventManager.
1091
- *
1092
- * @publicApi
1093
- */
1094
- class HammerModule {
1095
- }
1096
- HammerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: HammerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1097
- HammerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: HammerModule });
1098
- HammerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: HammerModule, providers: HAMMER_PROVIDERS__PRE_R3__ });
1099
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: HammerModule, decorators: [{
1100
- type: NgModule,
1101
- args: [{ providers: HAMMER_PROVIDERS__PRE_R3__ }]
1102
- }] });
1103
-
1104
- /**
1105
- * @license
1106
- * Copyright Google LLC All Rights Reserved.
1107
- *
1108
- * Use of this source code is governed by an MIT-style license that can be
1109
- * found in the LICENSE file at https://angular.io/license
1110
- */
1111
- /**
1112
- * Defines supported modifiers for key events.
1113
- */
1114
- const MODIFIER_KEYS = ['alt', 'control', 'meta', 'shift'];
1115
- const DOM_KEY_LOCATION_NUMPAD = 3;
1116
- // Map to convert some key or keyIdentifier values to what will be returned by getEventKey
1117
- const _keyMap = {
1118
- // The following values are here for cross-browser compatibility and to match the W3C standard
1119
- // cf https://www.w3.org/TR/DOM-Level-3-Events-key/
1120
- '\b': 'Backspace',
1121
- '\t': 'Tab',
1122
- '\x7F': 'Delete',
1123
- '\x1B': 'Escape',
1124
- 'Del': 'Delete',
1125
- 'Esc': 'Escape',
1126
- 'Left': 'ArrowLeft',
1127
- 'Right': 'ArrowRight',
1128
- 'Up': 'ArrowUp',
1129
- 'Down': 'ArrowDown',
1130
- 'Menu': 'ContextMenu',
1131
- 'Scroll': 'ScrollLock',
1132
- 'Win': 'OS'
1133
- };
1134
- // There is a bug in Chrome for numeric keypad keys:
1135
- // https://code.google.com/p/chromium/issues/detail?id=155654
1136
- // 1, 2, 3 ... are reported as A, B, C ...
1137
- const _chromeNumKeyPadMap = {
1138
- 'A': '1',
1139
- 'B': '2',
1140
- 'C': '3',
1141
- 'D': '4',
1142
- 'E': '5',
1143
- 'F': '6',
1144
- 'G': '7',
1145
- 'H': '8',
1146
- 'I': '9',
1147
- 'J': '*',
1148
- 'K': '+',
1149
- 'M': '-',
1150
- 'N': '.',
1151
- 'O': '/',
1152
- '\x60': '0',
1153
- '\x90': 'NumLock'
1154
- };
1155
- /**
1156
- * Retrieves modifiers from key-event objects.
1157
- */
1158
- const MODIFIER_KEY_GETTERS = {
1159
- 'alt': (event) => event.altKey,
1160
- 'control': (event) => event.ctrlKey,
1161
- 'meta': (event) => event.metaKey,
1162
- 'shift': (event) => event.shiftKey
1163
- };
1164
- /**
1165
- * @publicApi
1166
- * A browser plug-in that provides support for handling of key events in Angular.
1167
- */
1168
- class KeyEventsPlugin extends EventManagerPlugin {
1169
- /**
1170
- * Initializes an instance of the browser plug-in.
1171
- * @param doc The document in which key events will be detected.
1172
- */
1173
- constructor(doc) {
1174
- super(doc);
1175
- }
1176
- /**
1177
- * Reports whether a named key event is supported.
1178
- * @param eventName The event name to query.
1179
- * @return True if the named key event is supported.
1180
- */
1181
- supports(eventName) {
1182
- return KeyEventsPlugin.parseEventName(eventName) != null;
1183
- }
1184
- /**
1185
- * Registers a handler for a specific element and key event.
1186
- * @param element The HTML element to receive event notifications.
1187
- * @param eventName The name of the key event to listen for.
1188
- * @param handler A function to call when the notification occurs. Receives the
1189
- * event object as an argument.
1190
- * @returns The key event that was registered.
1191
- */
835
+ /**
836
+ * Registers a handler for a specific element and key event.
837
+ * @param element The HTML element to receive event notifications.
838
+ * @param eventName The name of the key event to listen for.
839
+ * @param handler A function to call when the notification occurs. Receives the
840
+ * event object as an argument.
841
+ * @returns The key event that was registered.
842
+ */
1192
843
  addEventListener(element, eventName, handler) {
1193
844
  const parsedEvent = KeyEventsPlugin.parseEventName(eventName);
1194
845
  const outsideHandler = KeyEventsPlugin.eventCallback(parsedEvent['fullKey'], handler, this.manager.getZone());
@@ -1270,9 +921,9 @@ class KeyEventsPlugin extends EventManagerPlugin {
1270
921
  }
1271
922
  }
1272
923
  }
1273
- KeyEventsPlugin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: KeyEventsPlugin, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
1274
- KeyEventsPlugin.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: KeyEventsPlugin });
1275
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: KeyEventsPlugin, decorators: [{
924
+ KeyEventsPlugin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: KeyEventsPlugin, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
925
+ KeyEventsPlugin.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: KeyEventsPlugin });
926
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: KeyEventsPlugin, decorators: [{
1276
927
  type: Injectable
1277
928
  }], ctorParameters: function () {
1278
929
  return [{ type: undefined, decorators: [{
@@ -1310,191 +961,58 @@ function getEventKey(event) {
1310
961
  * Use of this source code is governed by an MIT-style license that can be
1311
962
  * found in the LICENSE file at https://angular.io/license
1312
963
  */
964
+ function initDomAdapter() {
965
+ BrowserDomAdapter.makeCurrent();
966
+ BrowserGetTestability.init();
967
+ }
968
+ function errorHandler() {
969
+ return new ErrorHandler();
970
+ }
971
+ function _document() {
972
+ // Tell ivy about the global document
973
+ ɵsetDocument(document);
974
+ return document;
975
+ }
976
+ const INTERNAL_BROWSER_PLATFORM_PROVIDERS = [
977
+ { provide: PLATFORM_ID, useValue: ɵPLATFORM_BROWSER_ID },
978
+ { provide: PLATFORM_INITIALIZER, useValue: initDomAdapter, multi: true },
979
+ { provide: DOCUMENT, useFactory: _document, deps: [] },
980
+ ];
1313
981
  /**
1314
- * DomSanitizer helps preventing Cross Site Scripting Security bugs (XSS) by sanitizing
1315
- * values to be safe to use in the different DOM contexts.
1316
- *
1317
- * For example, when binding a URL in an `<a [href]="someValue">` hyperlink, `someValue` will be
1318
- * sanitized so that an attacker cannot inject e.g. a `javascript:` URL that would execute code on
1319
- * the website.
1320
- *
1321
- * In specific situations, it might be necessary to disable sanitization, for example if the
1322
- * application genuinely needs to produce a `javascript:` style link with a dynamic value in it.
1323
- * Users can bypass security by constructing a value with one of the `bypassSecurityTrust...`
1324
- * methods, and then binding to that value from the template.
1325
- *
1326
- * These situations should be very rare, and extraordinary care must be taken to avoid creating a
1327
- * Cross Site Scripting (XSS) security bug!
1328
- *
1329
- * When using `bypassSecurityTrust...`, make sure to call the method as early as possible and as
1330
- * close as possible to the source of the value, to make it easy to verify no security bug is
1331
- * created by its use.
1332
- *
1333
- * It is not required (and not recommended) to bypass security if the value is safe, e.g. a URL that
1334
- * does not start with a suspicious protocol, or an HTML snippet that does not contain dangerous
1335
- * code. The sanitizer leaves safe values intact.
982
+ * A factory function that returns a `PlatformRef` instance associated with browser service
983
+ * providers.
1336
984
  *
1337
- * @security Calling any of the `bypassSecurityTrust...` APIs disables Angular's built-in
1338
- * sanitization for the value passed in. Carefully check and audit all values and code paths going
1339
- * into this call. Make sure any user data is appropriately escaped for this security context.
1340
- * For more detail, see the [Security Guide](https://g.co/ng/security).
1341
- *
1342
- * @publicApi
1343
- */
1344
- class DomSanitizer {
1345
- }
1346
- DomSanitizer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: DomSanitizer, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1347
- DomSanitizer.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: DomSanitizer, providedIn: 'root', useExisting: i0.forwardRef(function () { return DomSanitizerImpl; }) });
1348
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: DomSanitizer, decorators: [{
1349
- type: Injectable,
1350
- args: [{ providedIn: 'root', useExisting: forwardRef(() => DomSanitizerImpl) }]
1351
- }] });
1352
- function domSanitizerImplFactory(injector) {
1353
- return new DomSanitizerImpl(injector.get(DOCUMENT));
1354
- }
1355
- class DomSanitizerImpl extends DomSanitizer {
1356
- constructor(_doc) {
1357
- super();
1358
- this._doc = _doc;
1359
- }
1360
- sanitize(ctx, value) {
1361
- if (value == null)
1362
- return null;
1363
- switch (ctx) {
1364
- case SecurityContext.NONE:
1365
- return value;
1366
- case SecurityContext.HTML:
1367
- if (ɵallowSanitizationBypassAndThrow(value, "HTML" /* Html */)) {
1368
- return ɵunwrapSafeValue(value);
1369
- }
1370
- return ɵ_sanitizeHtml(this._doc, String(value)).toString();
1371
- case SecurityContext.STYLE:
1372
- if (ɵallowSanitizationBypassAndThrow(value, "Style" /* Style */)) {
1373
- return ɵunwrapSafeValue(value);
1374
- }
1375
- return value;
1376
- case SecurityContext.SCRIPT:
1377
- if (ɵallowSanitizationBypassAndThrow(value, "Script" /* Script */)) {
1378
- return ɵunwrapSafeValue(value);
1379
- }
1380
- throw new Error('unsafe value used in a script context');
1381
- case SecurityContext.URL:
1382
- const type = ɵgetSanitizationBypassType(value);
1383
- if (ɵallowSanitizationBypassAndThrow(value, "URL" /* Url */)) {
1384
- return ɵunwrapSafeValue(value);
1385
- }
1386
- return ɵ_sanitizeUrl(String(value));
1387
- case SecurityContext.RESOURCE_URL:
1388
- if (ɵallowSanitizationBypassAndThrow(value, "ResourceURL" /* ResourceUrl */)) {
1389
- return ɵunwrapSafeValue(value);
1390
- }
1391
- throw new Error('unsafe value used in a resource URL context (see https://g.co/ng/security#xss)');
1392
- default:
1393
- throw new Error(`Unexpected SecurityContext ${ctx} (see https://g.co/ng/security#xss)`);
1394
- }
1395
- }
1396
- bypassSecurityTrustHtml(value) {
1397
- return ɵbypassSanitizationTrustHtml(value);
1398
- }
1399
- bypassSecurityTrustStyle(value) {
1400
- return ɵbypassSanitizationTrustStyle(value);
1401
- }
1402
- bypassSecurityTrustScript(value) {
1403
- return ɵbypassSanitizationTrustScript(value);
1404
- }
1405
- bypassSecurityTrustUrl(value) {
1406
- return ɵbypassSanitizationTrustUrl(value);
1407
- }
1408
- bypassSecurityTrustResourceUrl(value) {
1409
- return ɵbypassSanitizationTrustResourceUrl(value);
1410
- }
1411
- }
1412
- DomSanitizerImpl.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: DomSanitizerImpl, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
1413
- DomSanitizerImpl.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: DomSanitizerImpl, providedIn: 'root', useFactory: domSanitizerImplFactory, deps: [{ token: Injector }] });
1414
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: DomSanitizerImpl, decorators: [{
1415
- type: Injectable,
1416
- args: [{ providedIn: 'root', useFactory: domSanitizerImplFactory, deps: [Injector] }]
1417
- }], ctorParameters: function () {
1418
- return [{ type: undefined, decorators: [{
1419
- type: Inject,
1420
- args: [DOCUMENT]
1421
- }] }];
1422
- } });
1423
-
1424
- /**
1425
- * @license
1426
- * Copyright Google LLC All Rights Reserved.
1427
- *
1428
- * Use of this source code is governed by an MIT-style license that can be
1429
- * found in the LICENSE file at https://angular.io/license
1430
- */
1431
- function initDomAdapter() {
1432
- BrowserDomAdapter.makeCurrent();
1433
- BrowserGetTestability.init();
1434
- }
1435
- function errorHandler() {
1436
- return new ErrorHandler();
1437
- }
1438
- function _document() {
1439
- // Tell ivy about the global document
1440
- ɵsetDocument(document);
1441
- return document;
1442
- }
1443
- const INTERNAL_BROWSER_PLATFORM_PROVIDERS = [
1444
- { provide: PLATFORM_ID, useValue: ɵPLATFORM_BROWSER_ID },
1445
- { provide: PLATFORM_INITIALIZER, useValue: initDomAdapter, multi: true },
1446
- { provide: DOCUMENT, useFactory: _document, deps: [] },
1447
- ];
1448
- const BROWSER_SANITIZATION_PROVIDERS__PRE_R3__ = [
1449
- { provide: Sanitizer, useExisting: DomSanitizer },
1450
- { provide: DomSanitizer, useClass: DomSanitizerImpl, deps: [DOCUMENT] },
1451
- ];
1452
- const BROWSER_SANITIZATION_PROVIDERS__POST_R3__ = [];
1453
- /**
1454
- * @security Replacing built-in sanitization providers exposes the application to XSS risks.
1455
- * Attacker-controlled data introduced by an unsanitized provider could expose your
1456
- * application to XSS risks. For more detail, see the [Security Guide](https://g.co/ng/security).
1457
- * @publicApi
1458
- */
1459
- const BROWSER_SANITIZATION_PROVIDERS = BROWSER_SANITIZATION_PROVIDERS__POST_R3__;
1460
- /**
1461
- * A factory function that returns a `PlatformRef` instance associated with browser service
1462
- * providers.
1463
- *
1464
- * @publicApi
1465
- */
1466
- const platformBrowser = createPlatformFactory(platformCore, 'browser', INTERNAL_BROWSER_PLATFORM_PROVIDERS);
1467
- const BROWSER_MODULE_PROVIDERS = [
1468
- BROWSER_SANITIZATION_PROVIDERS,
1469
- { provide: ɵINJECTOR_SCOPE, useValue: 'root' },
1470
- { provide: ErrorHandler, useFactory: errorHandler, deps: [] },
1471
- {
1472
- provide: EVENT_MANAGER_PLUGINS,
1473
- useClass: DomEventsPlugin,
1474
- multi: true,
1475
- deps: [DOCUMENT, NgZone, PLATFORM_ID]
1476
- },
1477
- { provide: EVENT_MANAGER_PLUGINS, useClass: KeyEventsPlugin, multi: true, deps: [DOCUMENT] },
1478
- HAMMER_PROVIDERS,
1479
- {
1480
- provide: DomRendererFactory2,
1481
- useClass: DomRendererFactory2,
1482
- deps: [EventManager, DomSharedStylesHost, APP_ID]
1483
- },
1484
- { provide: RendererFactory2, useExisting: DomRendererFactory2 },
1485
- { provide: SharedStylesHost, useExisting: DomSharedStylesHost },
1486
- { provide: DomSharedStylesHost, useClass: DomSharedStylesHost, deps: [DOCUMENT] },
1487
- { provide: Testability, useClass: Testability, deps: [NgZone] },
1488
- { provide: EventManager, useClass: EventManager, deps: [EVENT_MANAGER_PLUGINS, NgZone] },
1489
- { provide: XhrFactory, useClass: BrowserXhr, deps: [] },
1490
- ELEMENT_PROBE_PROVIDERS,
1491
- ];
1492
- /**
1493
- * Exports required infrastructure for all Angular apps.
1494
- * Included by default in all Angular apps created with the CLI
1495
- * `new` command.
1496
- * Re-exports `CommonModule` and `ApplicationModule`, making their
1497
- * exports and providers available to all apps.
985
+ * @publicApi
986
+ */
987
+ const platformBrowser = createPlatformFactory(platformCore, 'browser', INTERNAL_BROWSER_PLATFORM_PROVIDERS);
988
+ const BROWSER_MODULE_PROVIDERS = [
989
+ { provide: ɵINJECTOR_SCOPE, useValue: 'root' },
990
+ { provide: ErrorHandler, useFactory: errorHandler, deps: [] },
991
+ {
992
+ provide: EVENT_MANAGER_PLUGINS,
993
+ useClass: DomEventsPlugin,
994
+ multi: true,
995
+ deps: [DOCUMENT, NgZone, PLATFORM_ID]
996
+ },
997
+ { provide: EVENT_MANAGER_PLUGINS, useClass: KeyEventsPlugin, multi: true, deps: [DOCUMENT] },
998
+ {
999
+ provide: DomRendererFactory2,
1000
+ useClass: DomRendererFactory2,
1001
+ deps: [EventManager, DomSharedStylesHost, APP_ID]
1002
+ },
1003
+ { provide: RendererFactory2, useExisting: DomRendererFactory2 },
1004
+ { provide: SharedStylesHost, useExisting: DomSharedStylesHost },
1005
+ { provide: DomSharedStylesHost, useClass: DomSharedStylesHost, deps: [DOCUMENT] },
1006
+ { provide: Testability, useClass: Testability, deps: [NgZone] },
1007
+ { provide: EventManager, useClass: EventManager, deps: [EVENT_MANAGER_PLUGINS, NgZone] },
1008
+ { provide: XhrFactory, useClass: BrowserXhr, deps: [] },
1009
+ ];
1010
+ /**
1011
+ * Exports required infrastructure for all Angular apps.
1012
+ * Included by default in all Angular apps created with the CLI
1013
+ * `new` command.
1014
+ * Re-exports `CommonModule` and `ApplicationModule`, making their
1015
+ * exports and providers available to all apps.
1498
1016
  *
1499
1017
  * @publicApi
1500
1018
  */
@@ -1523,10 +1041,10 @@ class BrowserModule {
1523
1041
  };
1524
1042
  }
1525
1043
  }
1526
- BrowserModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: BrowserModule, deps: [{ token: BrowserModule, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.NgModule });
1527
- BrowserModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: BrowserModule, exports: [CommonModule, ApplicationModule] });
1528
- BrowserModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: BrowserModule, providers: BROWSER_MODULE_PROVIDERS, imports: [CommonModule, ApplicationModule] });
1529
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: BrowserModule, decorators: [{
1044
+ BrowserModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: BrowserModule, deps: [{ token: BrowserModule, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.NgModule });
1045
+ BrowserModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: BrowserModule, exports: [CommonModule, ApplicationModule] });
1046
+ BrowserModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: BrowserModule, providers: BROWSER_MODULE_PROVIDERS, imports: [CommonModule, ApplicationModule] });
1047
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: BrowserModule, decorators: [{
1530
1048
  type: NgModule,
1531
1049
  args: [{ providers: BROWSER_MODULE_PROVIDERS, exports: [CommonModule, ApplicationModule] }]
1532
1050
  }], ctorParameters: function () {
@@ -1703,9 +1221,9 @@ class Meta {
1703
1221
  return META_KEYS_MAP[prop] || prop;
1704
1222
  }
1705
1223
  }
1706
- Meta.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: Meta, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
1707
- Meta.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: Meta, providedIn: 'root', useFactory: createMeta, deps: [] });
1708
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: Meta, decorators: [{
1224
+ Meta.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: Meta, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
1225
+ Meta.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: Meta, providedIn: 'root', useFactory: createMeta, deps: [] });
1226
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: Meta, decorators: [{
1709
1227
  type: Injectable,
1710
1228
  args: [{ providedIn: 'root', useFactory: createMeta, deps: [] }]
1711
1229
  }], ctorParameters: function () {
@@ -1762,9 +1280,9 @@ class Title {
1762
1280
  this._doc.title = newTitle || '';
1763
1281
  }
1764
1282
  }
1765
- Title.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: Title, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
1766
- Title.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: Title, providedIn: 'root', useFactory: createTitle, deps: [] });
1767
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: Title, decorators: [{
1283
+ Title.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: Title, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
1284
+ Title.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: Title, providedIn: 'root', useFactory: createTitle, deps: [] });
1285
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: Title, decorators: [{
1768
1286
  type: Injectable,
1769
1287
  args: [{ providedIn: 'root', useFactory: createTitle, deps: [] }]
1770
1288
  }], ctorParameters: function () {
@@ -1774,6 +1292,39 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImpor
1774
1292
  }] }];
1775
1293
  } });
1776
1294
 
1295
+ /**
1296
+ * @license
1297
+ * Copyright Google LLC All Rights Reserved.
1298
+ *
1299
+ * Use of this source code is governed by an MIT-style license that can be
1300
+ * found in the LICENSE file at https://angular.io/license
1301
+ */
1302
+ const CAMEL_CASE_REGEXP = /([A-Z])/g;
1303
+ const DASH_CASE_REGEXP = /-([a-z])/g;
1304
+ function camelCaseToDashCase(input) {
1305
+ return input.replace(CAMEL_CASE_REGEXP, (...m) => '-' + m[1].toLowerCase());
1306
+ }
1307
+ function dashCaseToCamelCase(input) {
1308
+ return input.replace(DASH_CASE_REGEXP, (...m) => m[1].toUpperCase());
1309
+ }
1310
+ /**
1311
+ * Exports the value under a given `name` in the global property `ng`. For example `ng.probe` if
1312
+ * `name` is `'probe'`.
1313
+ * @param name Name under which it will be exported. Keep in mind this will be a property of the
1314
+ * global `ng` object.
1315
+ * @param value The value to export.
1316
+ */
1317
+ function exportNgVar(name, value) {
1318
+ if (typeof COMPILED === 'undefined' || !COMPILED) {
1319
+ // Note: we can't export `ng` when using closure enhanced optimization as:
1320
+ // - closure declares globals itself for minified names, which sometimes clobber our `ng` global
1321
+ // - we can't declare a closure extern as the namespace `ng` is already used within Google
1322
+ // for typings for angularJS (via `goog.provide('ng....')`).
1323
+ const ng = ɵglobal['ng'] = ɵglobal['ng'] || {};
1324
+ ng[name] = value;
1325
+ }
1326
+ }
1327
+
1777
1328
  /**
1778
1329
  * @license
1779
1330
  * Copyright Google LLC All Rights Reserved.
@@ -2000,9 +1551,9 @@ class TransferState {
2000
1551
  return JSON.stringify(this.store);
2001
1552
  }
2002
1553
  }
2003
- TransferState.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: TransferState, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2004
- TransferState.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: TransferState });
2005
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: TransferState, decorators: [{
1554
+ TransferState.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: TransferState, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1555
+ TransferState.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: TransferState });
1556
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: TransferState, decorators: [{
2006
1557
  type: Injectable
2007
1558
  }] });
2008
1559
  function initTransferState(doc, appId) {
@@ -2029,10 +1580,10 @@ function initTransferState(doc, appId) {
2029
1580
  */
2030
1581
  class BrowserTransferStateModule {
2031
1582
  }
2032
- BrowserTransferStateModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: BrowserTransferStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2033
- BrowserTransferStateModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: BrowserTransferStateModule });
2034
- BrowserTransferStateModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: BrowserTransferStateModule, providers: [{ provide: TransferState, useFactory: initTransferState, deps: [DOCUMENT, APP_ID] }] });
2035
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: BrowserTransferStateModule, decorators: [{
1583
+ BrowserTransferStateModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: BrowserTransferStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1584
+ BrowserTransferStateModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: BrowserTransferStateModule });
1585
+ BrowserTransferStateModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: BrowserTransferStateModule, providers: [{ provide: TransferState, useFactory: initTransferState, deps: [DOCUMENT, APP_ID] }] });
1586
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: BrowserTransferStateModule, decorators: [{
2036
1587
  type: NgModule,
2037
1588
  args: [{
2038
1589
  providers: [{ provide: TransferState, useFactory: initTransferState, deps: [DOCUMENT, APP_ID] }],
@@ -2099,6 +1650,387 @@ function elementMatches(n, selector) {
2099
1650
  return false;
2100
1651
  }
2101
1652
 
1653
+ /**
1654
+ * @license
1655
+ * Copyright Google LLC All Rights Reserved.
1656
+ *
1657
+ * Use of this source code is governed by an MIT-style license that can be
1658
+ * found in the LICENSE file at https://angular.io/license
1659
+ */
1660
+ /**
1661
+ * Supported HammerJS recognizer event names.
1662
+ */
1663
+ const EVENT_NAMES = {
1664
+ // pan
1665
+ 'pan': true,
1666
+ 'panstart': true,
1667
+ 'panmove': true,
1668
+ 'panend': true,
1669
+ 'pancancel': true,
1670
+ 'panleft': true,
1671
+ 'panright': true,
1672
+ 'panup': true,
1673
+ 'pandown': true,
1674
+ // pinch
1675
+ 'pinch': true,
1676
+ 'pinchstart': true,
1677
+ 'pinchmove': true,
1678
+ 'pinchend': true,
1679
+ 'pinchcancel': true,
1680
+ 'pinchin': true,
1681
+ 'pinchout': true,
1682
+ // press
1683
+ 'press': true,
1684
+ 'pressup': true,
1685
+ // rotate
1686
+ 'rotate': true,
1687
+ 'rotatestart': true,
1688
+ 'rotatemove': true,
1689
+ 'rotateend': true,
1690
+ 'rotatecancel': true,
1691
+ // swipe
1692
+ 'swipe': true,
1693
+ 'swipeleft': true,
1694
+ 'swiperight': true,
1695
+ 'swipeup': true,
1696
+ 'swipedown': true,
1697
+ // tap
1698
+ 'tap': true,
1699
+ 'doubletap': true
1700
+ };
1701
+ /**
1702
+ * DI token for providing [HammerJS](https://hammerjs.github.io/) support to Angular.
1703
+ * @see `HammerGestureConfig`
1704
+ *
1705
+ * @ngModule HammerModule
1706
+ * @publicApi
1707
+ */
1708
+ const HAMMER_GESTURE_CONFIG = new InjectionToken('HammerGestureConfig');
1709
+ /**
1710
+ * Injection token used to provide a {@link HammerLoader} to Angular.
1711
+ *
1712
+ * @publicApi
1713
+ */
1714
+ const HAMMER_LOADER = new InjectionToken('HammerLoader');
1715
+ /**
1716
+ * An injectable [HammerJS Manager](https://hammerjs.github.io/api/#hammermanager)
1717
+ * for gesture recognition. Configures specific event recognition.
1718
+ * @publicApi
1719
+ */
1720
+ class HammerGestureConfig {
1721
+ constructor() {
1722
+ /**
1723
+ * A set of supported event names for gestures to be used in Angular.
1724
+ * Angular supports all built-in recognizers, as listed in
1725
+ * [HammerJS documentation](https://hammerjs.github.io/).
1726
+ */
1727
+ this.events = [];
1728
+ /**
1729
+ * Maps gesture event names to a set of configuration options
1730
+ * that specify overrides to the default values for specific properties.
1731
+ *
1732
+ * The key is a supported event name to be configured,
1733
+ * and the options object contains a set of properties, with override values
1734
+ * to be applied to the named recognizer event.
1735
+ * For example, to disable recognition of the rotate event, specify
1736
+ * `{"rotate": {"enable": false}}`.
1737
+ *
1738
+ * Properties that are not present take the HammerJS default values.
1739
+ * For information about which properties are supported for which events,
1740
+ * and their allowed and default values, see
1741
+ * [HammerJS documentation](https://hammerjs.github.io/).
1742
+ *
1743
+ */
1744
+ this.overrides = {};
1745
+ }
1746
+ /**
1747
+ * Creates a [HammerJS Manager](https://hammerjs.github.io/api/#hammermanager)
1748
+ * and attaches it to a given HTML element.
1749
+ * @param element The element that will recognize gestures.
1750
+ * @returns A HammerJS event-manager object.
1751
+ */
1752
+ buildHammer(element) {
1753
+ const mc = new Hammer(element, this.options);
1754
+ mc.get('pinch').set({ enable: true });
1755
+ mc.get('rotate').set({ enable: true });
1756
+ for (const eventName in this.overrides) {
1757
+ mc.get(eventName).set(this.overrides[eventName]);
1758
+ }
1759
+ return mc;
1760
+ }
1761
+ }
1762
+ HammerGestureConfig.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: HammerGestureConfig, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1763
+ HammerGestureConfig.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: HammerGestureConfig });
1764
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: HammerGestureConfig, decorators: [{
1765
+ type: Injectable
1766
+ }] });
1767
+ /**
1768
+ * Event plugin that adds Hammer support to an application.
1769
+ *
1770
+ * @ngModule HammerModule
1771
+ */
1772
+ class HammerGesturesPlugin extends EventManagerPlugin {
1773
+ constructor(doc, _config, console, loader) {
1774
+ super(doc);
1775
+ this._config = _config;
1776
+ this.console = console;
1777
+ this.loader = loader;
1778
+ this._loaderPromise = null;
1779
+ }
1780
+ supports(eventName) {
1781
+ if (!EVENT_NAMES.hasOwnProperty(eventName.toLowerCase()) && !this.isCustomEvent(eventName)) {
1782
+ return false;
1783
+ }
1784
+ if (!window.Hammer && !this.loader) {
1785
+ if (typeof ngDevMode === 'undefined' || ngDevMode) {
1786
+ this.console.warn(`The "${eventName}" event cannot be bound because Hammer.JS is not ` +
1787
+ `loaded and no custom loader has been specified.`);
1788
+ }
1789
+ return false;
1790
+ }
1791
+ return true;
1792
+ }
1793
+ addEventListener(element, eventName, handler) {
1794
+ const zone = this.manager.getZone();
1795
+ eventName = eventName.toLowerCase();
1796
+ // If Hammer is not present but a loader is specified, we defer adding the event listener
1797
+ // until Hammer is loaded.
1798
+ if (!window.Hammer && this.loader) {
1799
+ this._loaderPromise = this._loaderPromise || this.loader();
1800
+ // This `addEventListener` method returns a function to remove the added listener.
1801
+ // Until Hammer is loaded, the returned function needs to *cancel* the registration rather
1802
+ // than remove anything.
1803
+ let cancelRegistration = false;
1804
+ let deregister = () => {
1805
+ cancelRegistration = true;
1806
+ };
1807
+ this._loaderPromise
1808
+ .then(() => {
1809
+ // If Hammer isn't actually loaded when the custom loader resolves, give up.
1810
+ if (!window.Hammer) {
1811
+ if (typeof ngDevMode === 'undefined' || ngDevMode) {
1812
+ this.console.warn(`The custom HAMMER_LOADER completed, but Hammer.JS is not present.`);
1813
+ }
1814
+ deregister = () => { };
1815
+ return;
1816
+ }
1817
+ if (!cancelRegistration) {
1818
+ // Now that Hammer is loaded and the listener is being loaded for real,
1819
+ // the deregistration function changes from canceling registration to removal.
1820
+ deregister = this.addEventListener(element, eventName, handler);
1821
+ }
1822
+ })
1823
+ .catch(() => {
1824
+ if (typeof ngDevMode === 'undefined' || ngDevMode) {
1825
+ this.console.warn(`The "${eventName}" event cannot be bound because the custom ` +
1826
+ `Hammer.JS loader failed.`);
1827
+ }
1828
+ deregister = () => { };
1829
+ });
1830
+ // Return a function that *executes* `deregister` (and not `deregister` itself) so that we
1831
+ // can change the behavior of `deregister` once the listener is added. Using a closure in
1832
+ // this way allows us to avoid any additional data structures to track listener removal.
1833
+ return () => {
1834
+ deregister();
1835
+ };
1836
+ }
1837
+ return zone.runOutsideAngular(() => {
1838
+ // Creating the manager bind events, must be done outside of angular
1839
+ const mc = this._config.buildHammer(element);
1840
+ const callback = function (eventObj) {
1841
+ zone.runGuarded(function () {
1842
+ handler(eventObj);
1843
+ });
1844
+ };
1845
+ mc.on(eventName, callback);
1846
+ return () => {
1847
+ mc.off(eventName, callback);
1848
+ // destroy mc to prevent memory leak
1849
+ if (typeof mc.destroy === 'function') {
1850
+ mc.destroy();
1851
+ }
1852
+ };
1853
+ });
1854
+ }
1855
+ isCustomEvent(eventName) {
1856
+ return this._config.events.indexOf(eventName) > -1;
1857
+ }
1858
+ }
1859
+ HammerGesturesPlugin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: HammerGesturesPlugin, deps: [{ token: DOCUMENT }, { token: HAMMER_GESTURE_CONFIG }, { token: i0.ɵConsole }, { token: HAMMER_LOADER, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
1860
+ HammerGesturesPlugin.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: HammerGesturesPlugin });
1861
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: HammerGesturesPlugin, decorators: [{
1862
+ type: Injectable
1863
+ }], ctorParameters: function () {
1864
+ return [{ type: undefined, decorators: [{
1865
+ type: Inject,
1866
+ args: [DOCUMENT]
1867
+ }] }, { type: HammerGestureConfig, decorators: [{
1868
+ type: Inject,
1869
+ args: [HAMMER_GESTURE_CONFIG]
1870
+ }] }, { type: i0.ɵConsole }, { type: undefined, decorators: [{
1871
+ type: Optional
1872
+ }, {
1873
+ type: Inject,
1874
+ args: [HAMMER_LOADER]
1875
+ }] }];
1876
+ } });
1877
+ /**
1878
+ * Adds support for HammerJS.
1879
+ *
1880
+ * Import this module at the root of your application so that Angular can work with
1881
+ * HammerJS to detect gesture events.
1882
+ *
1883
+ * Note that applications still need to include the HammerJS script itself. This module
1884
+ * simply sets up the coordination layer between HammerJS and Angular's EventManager.
1885
+ *
1886
+ * @publicApi
1887
+ */
1888
+ class HammerModule {
1889
+ }
1890
+ HammerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: HammerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1891
+ HammerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: HammerModule });
1892
+ HammerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: HammerModule, providers: [
1893
+ {
1894
+ provide: EVENT_MANAGER_PLUGINS,
1895
+ useClass: HammerGesturesPlugin,
1896
+ multi: true,
1897
+ deps: [DOCUMENT, HAMMER_GESTURE_CONFIG, ɵConsole, [new Optional(), HAMMER_LOADER]]
1898
+ },
1899
+ { provide: HAMMER_GESTURE_CONFIG, useClass: HammerGestureConfig, deps: [] },
1900
+ ] });
1901
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: HammerModule, decorators: [{
1902
+ type: NgModule,
1903
+ args: [{
1904
+ providers: [
1905
+ {
1906
+ provide: EVENT_MANAGER_PLUGINS,
1907
+ useClass: HammerGesturesPlugin,
1908
+ multi: true,
1909
+ deps: [DOCUMENT, HAMMER_GESTURE_CONFIG, ɵConsole, [new Optional(), HAMMER_LOADER]]
1910
+ },
1911
+ { provide: HAMMER_GESTURE_CONFIG, useClass: HammerGestureConfig, deps: [] },
1912
+ ]
1913
+ }]
1914
+ }] });
1915
+
1916
+ /**
1917
+ * @license
1918
+ * Copyright Google LLC All Rights Reserved.
1919
+ *
1920
+ * Use of this source code is governed by an MIT-style license that can be
1921
+ * found in the LICENSE file at https://angular.io/license
1922
+ */
1923
+ /**
1924
+ * DomSanitizer helps preventing Cross Site Scripting Security bugs (XSS) by sanitizing
1925
+ * values to be safe to use in the different DOM contexts.
1926
+ *
1927
+ * For example, when binding a URL in an `<a [href]="someValue">` hyperlink, `someValue` will be
1928
+ * sanitized so that an attacker cannot inject e.g. a `javascript:` URL that would execute code on
1929
+ * the website.
1930
+ *
1931
+ * In specific situations, it might be necessary to disable sanitization, for example if the
1932
+ * application genuinely needs to produce a `javascript:` style link with a dynamic value in it.
1933
+ * Users can bypass security by constructing a value with one of the `bypassSecurityTrust...`
1934
+ * methods, and then binding to that value from the template.
1935
+ *
1936
+ * These situations should be very rare, and extraordinary care must be taken to avoid creating a
1937
+ * Cross Site Scripting (XSS) security bug!
1938
+ *
1939
+ * When using `bypassSecurityTrust...`, make sure to call the method as early as possible and as
1940
+ * close as possible to the source of the value, to make it easy to verify no security bug is
1941
+ * created by its use.
1942
+ *
1943
+ * It is not required (and not recommended) to bypass security if the value is safe, e.g. a URL that
1944
+ * does not start with a suspicious protocol, or an HTML snippet that does not contain dangerous
1945
+ * code. The sanitizer leaves safe values intact.
1946
+ *
1947
+ * @security Calling any of the `bypassSecurityTrust...` APIs disables Angular's built-in
1948
+ * sanitization for the value passed in. Carefully check and audit all values and code paths going
1949
+ * into this call. Make sure any user data is appropriately escaped for this security context.
1950
+ * For more detail, see the [Security Guide](https://g.co/ng/security).
1951
+ *
1952
+ * @publicApi
1953
+ */
1954
+ class DomSanitizer {
1955
+ }
1956
+ DomSanitizer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: DomSanitizer, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1957
+ DomSanitizer.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: DomSanitizer, providedIn: 'root', useExisting: i0.forwardRef(function () { return DomSanitizerImpl; }) });
1958
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: DomSanitizer, decorators: [{
1959
+ type: Injectable,
1960
+ args: [{ providedIn: 'root', useExisting: forwardRef(() => DomSanitizerImpl) }]
1961
+ }] });
1962
+ function domSanitizerImplFactory(injector) {
1963
+ return new DomSanitizerImpl(injector.get(DOCUMENT));
1964
+ }
1965
+ class DomSanitizerImpl extends DomSanitizer {
1966
+ constructor(_doc) {
1967
+ super();
1968
+ this._doc = _doc;
1969
+ }
1970
+ sanitize(ctx, value) {
1971
+ if (value == null)
1972
+ return null;
1973
+ switch (ctx) {
1974
+ case SecurityContext.NONE:
1975
+ return value;
1976
+ case SecurityContext.HTML:
1977
+ if (ɵallowSanitizationBypassAndThrow(value, "HTML" /* Html */)) {
1978
+ return ɵunwrapSafeValue(value);
1979
+ }
1980
+ return ɵ_sanitizeHtml(this._doc, String(value)).toString();
1981
+ case SecurityContext.STYLE:
1982
+ if (ɵallowSanitizationBypassAndThrow(value, "Style" /* Style */)) {
1983
+ return ɵunwrapSafeValue(value);
1984
+ }
1985
+ return value;
1986
+ case SecurityContext.SCRIPT:
1987
+ if (ɵallowSanitizationBypassAndThrow(value, "Script" /* Script */)) {
1988
+ return ɵunwrapSafeValue(value);
1989
+ }
1990
+ throw new Error('unsafe value used in a script context');
1991
+ case SecurityContext.URL:
1992
+ const type = ɵgetSanitizationBypassType(value);
1993
+ if (ɵallowSanitizationBypassAndThrow(value, "URL" /* Url */)) {
1994
+ return ɵunwrapSafeValue(value);
1995
+ }
1996
+ return ɵ_sanitizeUrl(String(value));
1997
+ case SecurityContext.RESOURCE_URL:
1998
+ if (ɵallowSanitizationBypassAndThrow(value, "ResourceURL" /* ResourceUrl */)) {
1999
+ return ɵunwrapSafeValue(value);
2000
+ }
2001
+ throw new Error('unsafe value used in a resource URL context (see https://g.co/ng/security#xss)');
2002
+ default:
2003
+ throw new Error(`Unexpected SecurityContext ${ctx} (see https://g.co/ng/security#xss)`);
2004
+ }
2005
+ }
2006
+ bypassSecurityTrustHtml(value) {
2007
+ return ɵbypassSanitizationTrustHtml(value);
2008
+ }
2009
+ bypassSecurityTrustStyle(value) {
2010
+ return ɵbypassSanitizationTrustStyle(value);
2011
+ }
2012
+ bypassSecurityTrustScript(value) {
2013
+ return ɵbypassSanitizationTrustScript(value);
2014
+ }
2015
+ bypassSecurityTrustUrl(value) {
2016
+ return ɵbypassSanitizationTrustUrl(value);
2017
+ }
2018
+ bypassSecurityTrustResourceUrl(value) {
2019
+ return ɵbypassSanitizationTrustResourceUrl(value);
2020
+ }
2021
+ }
2022
+ DomSanitizerImpl.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: DomSanitizerImpl, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
2023
+ DomSanitizerImpl.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: DomSanitizerImpl, providedIn: 'root', useFactory: domSanitizerImplFactory, deps: [{ token: Injector }] });
2024
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: DomSanitizerImpl, decorators: [{
2025
+ type: Injectable,
2026
+ args: [{ providedIn: 'root', useFactory: domSanitizerImplFactory, deps: [Injector] }]
2027
+ }], ctorParameters: function () {
2028
+ return [{ type: undefined, decorators: [{
2029
+ type: Inject,
2030
+ args: [DOCUMENT]
2031
+ }] }];
2032
+ } });
2033
+
2102
2034
  /**
2103
2035
  * @license
2104
2036
  * Copyright Google LLC All Rights Reserved.
@@ -2117,7 +2049,7 @@ function elementMatches(n, selector) {
2117
2049
  /**
2118
2050
  * @publicApi
2119
2051
  */
2120
- const VERSION = new Version('13.0.2');
2052
+ const VERSION = new Version('13.0.3');
2121
2053
 
2122
2054
  /**
2123
2055
  * @license
@@ -2148,5 +2080,5 @@ const VERSION = new Version('13.0.2');
2148
2080
  * Generated bundle index. Do not edit.
2149
2081
  */
2150
2082
 
2151
- export { BrowserModule, BrowserTransferStateModule, By, DomSanitizer, EVENT_MANAGER_PLUGINS, EventManager, HAMMER_GESTURE_CONFIG, HAMMER_LOADER, HammerGestureConfig, HammerModule, Meta, Title, TransferState, VERSION, disableDebugTools, enableDebugTools, makeStateKey, platformBrowser, BROWSER_SANITIZATION_PROVIDERS as ɵBROWSER_SANITIZATION_PROVIDERS, BROWSER_SANITIZATION_PROVIDERS__POST_R3__ as ɵBROWSER_SANITIZATION_PROVIDERS__POST_R3__, BrowserDomAdapter as ɵBrowserDomAdapter, BrowserGetTestability as ɵBrowserGetTestability, DomEventsPlugin as ɵDomEventsPlugin, DomRendererFactory2 as ɵDomRendererFactory2, DomSanitizerImpl as ɵDomSanitizerImpl, DomSharedStylesHost as ɵDomSharedStylesHost, ELEMENT_PROBE_PROVIDERS as ɵELEMENT_PROBE_PROVIDERS, ELEMENT_PROBE_PROVIDERS__POST_R3__ as ɵELEMENT_PROBE_PROVIDERS__POST_R3__, HAMMER_PROVIDERS__POST_R3__ as ɵHAMMER_PROVIDERS__POST_R3__, HammerGesturesPlugin as ɵHammerGesturesPlugin, INTERNAL_BROWSER_PLATFORM_PROVIDERS as ɵINTERNAL_BROWSER_PLATFORM_PROVIDERS, KeyEventsPlugin as ɵKeyEventsPlugin, NAMESPACE_URIS as ɵNAMESPACE_URIS, SharedStylesHost as ɵSharedStylesHost, TRANSITION_ID as ɵTRANSITION_ID, escapeHtml as ɵescapeHtml, flattenStyles as ɵflattenStyles, initDomAdapter as ɵinitDomAdapter, shimContentAttribute as ɵshimContentAttribute, shimHostAttribute as ɵshimHostAttribute };
2083
+ export { BrowserModule, BrowserTransferStateModule, By, DomSanitizer, EVENT_MANAGER_PLUGINS, EventManager, HAMMER_GESTURE_CONFIG, HAMMER_LOADER, HammerGestureConfig, HammerModule, Meta, Title, TransferState, VERSION, disableDebugTools, enableDebugTools, makeStateKey, platformBrowser, BrowserDomAdapter as ɵBrowserDomAdapter, BrowserGetTestability as ɵBrowserGetTestability, DomEventsPlugin as ɵDomEventsPlugin, DomRendererFactory2 as ɵDomRendererFactory2, DomSanitizerImpl as ɵDomSanitizerImpl, DomSharedStylesHost as ɵDomSharedStylesHost, HammerGesturesPlugin as ɵHammerGesturesPlugin, INTERNAL_BROWSER_PLATFORM_PROVIDERS as ɵINTERNAL_BROWSER_PLATFORM_PROVIDERS, KeyEventsPlugin as ɵKeyEventsPlugin, NAMESPACE_URIS as ɵNAMESPACE_URIS, SharedStylesHost as ɵSharedStylesHost, TRANSITION_ID as ɵTRANSITION_ID, escapeHtml as ɵescapeHtml, flattenStyles as ɵflattenStyles, initDomAdapter as ɵinitDomAdapter, shimContentAttribute as ɵshimContentAttribute, shimHostAttribute as ɵshimHostAttribute };
2152
2084
  //# sourceMappingURL=platform-browser.mjs.map