platform-browser.umd.js 116 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674
  1. /**
  2. * @license Angular v8.1.3
  3. * (c) 2010-2019 Google LLC. https://angular.io/
  4. * License: MIT
  5. */
  6. (function (global, factory) {
  7. typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core')) :
  8. typeof define === 'function' && define.amd ? define('@angular/platform-browser', ['exports', '@angular/common', '@angular/core'], factory) :
  9. (global = global || self, factory((global.ng = global.ng || {}, global.ng.platformBrowser = {}), global.ng.common, global.ng.core));
  10. }(this, function (exports, common, i0) { 'use strict';
  11. /*! *****************************************************************************
  12. Copyright (c) Microsoft Corporation. All rights reserved.
  13. Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  14. this file except in compliance with the License. You may obtain a copy of the
  15. License at http://www.apache.org/licenses/LICENSE-2.0
  16. THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  17. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  18. WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  19. MERCHANTABLITY OR NON-INFRINGEMENT.
  20. See the Apache Version 2.0 License for specific language governing permissions
  21. and limitations under the License.
  22. ***************************************************************************** */
  23. /* global Reflect, Promise */
  24. var extendStatics = function(d, b) {
  25. extendStatics = Object.setPrototypeOf ||
  26. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  27. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  28. return extendStatics(d, b);
  29. };
  30. function __extends(d, b) {
  31. extendStatics(d, b);
  32. function __() { this.constructor = d; }
  33. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  34. }
  35. var __assign = function() {
  36. __assign = Object.assign || function __assign(t) {
  37. for (var s, i = 1, n = arguments.length; i < n; i++) {
  38. s = arguments[i];
  39. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  40. }
  41. return t;
  42. };
  43. return __assign.apply(this, arguments);
  44. };
  45. function __decorate(decorators, target, key, desc) {
  46. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  47. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  48. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  49. return c > 3 && r && Object.defineProperty(target, key, r), r;
  50. }
  51. function __param(paramIndex, decorator) {
  52. return function (target, key) { decorator(target, key, paramIndex); }
  53. }
  54. function __metadata(metadataKey, metadataValue) {
  55. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
  56. }
  57. function __read(o, n) {
  58. var m = typeof Symbol === "function" && o[Symbol.iterator];
  59. if (!m) return o;
  60. var i = m.call(o), r, ar = [], e;
  61. try {
  62. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  63. }
  64. catch (error) { e = { error: error }; }
  65. finally {
  66. try {
  67. if (r && !r.done && (m = i["return"])) m.call(i);
  68. }
  69. finally { if (e) throw e.error; }
  70. }
  71. return ar;
  72. }
  73. function __spread() {
  74. for (var ar = [], i = 0; i < arguments.length; i++)
  75. ar = ar.concat(__read(arguments[i]));
  76. return ar;
  77. }
  78. /**
  79. * @license
  80. * Copyright Google Inc. All Rights Reserved.
  81. *
  82. * Use of this source code is governed by an MIT-style license that can be
  83. * found in the LICENSE file at https://angular.io/license
  84. */
  85. var _DOM = null;
  86. function getDOM() {
  87. return _DOM;
  88. }
  89. function setRootDomAdapter(adapter) {
  90. if (!_DOM) {
  91. _DOM = adapter;
  92. }
  93. }
  94. /* tslint:disable:requireParameterType */
  95. /**
  96. * Provides DOM operations in an environment-agnostic way.
  97. *
  98. * @security Tread carefully! Interacting with the DOM directly is dangerous and
  99. * can introduce XSS risks.
  100. */
  101. var DomAdapter = /** @class */ (function () {
  102. function DomAdapter() {
  103. this.resourceLoaderType = null;
  104. }
  105. Object.defineProperty(DomAdapter.prototype, "attrToPropMap", {
  106. /**
  107. * Maps attribute names to their corresponding property names for cases
  108. * where attribute name doesn't match property name.
  109. */
  110. get: function () { return this._attrToPropMap; },
  111. set: function (value) { this._attrToPropMap = value; },
  112. enumerable: true,
  113. configurable: true
  114. });
  115. return DomAdapter;
  116. }());
  117. /**
  118. * @license
  119. * Copyright Google Inc. All Rights Reserved.
  120. *
  121. * Use of this source code is governed by an MIT-style license that can be
  122. * found in the LICENSE file at https://angular.io/license
  123. */
  124. /**
  125. * Provides DOM operations in any browser environment.
  126. *
  127. * @security Tread carefully! Interacting with the DOM directly is dangerous and
  128. * can introduce XSS risks.
  129. */
  130. var GenericBrowserDomAdapter = /** @class */ (function (_super) {
  131. __extends(GenericBrowserDomAdapter, _super);
  132. function GenericBrowserDomAdapter() {
  133. var _this = _super.call(this) || this;
  134. _this._animationPrefix = null;
  135. _this._transitionEnd = null;
  136. try {
  137. var element_1 = _this.createElement('div', document);
  138. if (_this.getStyle(element_1, 'animationName') != null) {
  139. _this._animationPrefix = '';
  140. }
  141. else {
  142. var domPrefixes = ['Webkit', 'Moz', 'O', 'ms'];
  143. for (var i = 0; i < domPrefixes.length; i++) {
  144. if (_this.getStyle(element_1, domPrefixes[i] + 'AnimationName') != null) {
  145. _this._animationPrefix = '-' + domPrefixes[i].toLowerCase() + '-';
  146. break;
  147. }
  148. }
  149. }
  150. var transEndEventNames_1 = {
  151. WebkitTransition: 'webkitTransitionEnd',
  152. MozTransition: 'transitionend',
  153. OTransition: 'oTransitionEnd otransitionend',
  154. transition: 'transitionend'
  155. };
  156. Object.keys(transEndEventNames_1).forEach(function (key) {
  157. if (_this.getStyle(element_1, key) != null) {
  158. _this._transitionEnd = transEndEventNames_1[key];
  159. }
  160. });
  161. }
  162. catch (_a) {
  163. _this._animationPrefix = null;
  164. _this._transitionEnd = null;
  165. }
  166. return _this;
  167. }
  168. GenericBrowserDomAdapter.prototype.getDistributedNodes = function (el) { return el.getDistributedNodes(); };
  169. GenericBrowserDomAdapter.prototype.resolveAndSetHref = function (el, baseUrl, href) {
  170. el.href = href == null ? baseUrl : baseUrl + '/../' + href;
  171. };
  172. GenericBrowserDomAdapter.prototype.supportsDOMEvents = function () { return true; };
  173. GenericBrowserDomAdapter.prototype.supportsNativeShadowDOM = function () {
  174. return typeof document.body.createShadowRoot === 'function';
  175. };
  176. GenericBrowserDomAdapter.prototype.getAnimationPrefix = function () { return this._animationPrefix ? this._animationPrefix : ''; };
  177. GenericBrowserDomAdapter.prototype.getTransitionEnd = function () { return this._transitionEnd ? this._transitionEnd : ''; };
  178. GenericBrowserDomAdapter.prototype.supportsAnimation = function () {
  179. return this._animationPrefix != null && this._transitionEnd != null;
  180. };
  181. return GenericBrowserDomAdapter;
  182. }(DomAdapter));
  183. /**
  184. * @license
  185. * Copyright Google Inc. All Rights Reserved.
  186. *
  187. * Use of this source code is governed by an MIT-style license that can be
  188. * found in the LICENSE file at https://angular.io/license
  189. */
  190. var _attrToPropMap = {
  191. 'class': 'className',
  192. 'innerHtml': 'innerHTML',
  193. 'readonly': 'readOnly',
  194. 'tabindex': 'tabIndex',
  195. };
  196. var DOM_KEY_LOCATION_NUMPAD = 3;
  197. // Map to convert some key or keyIdentifier values to what will be returned by getEventKey
  198. var _keyMap = {
  199. // The following values are here for cross-browser compatibility and to match the W3C standard
  200. // cf http://www.w3.org/TR/DOM-Level-3-Events-key/
  201. '\b': 'Backspace',
  202. '\t': 'Tab',
  203. '\x7F': 'Delete',
  204. '\x1B': 'Escape',
  205. 'Del': 'Delete',
  206. 'Esc': 'Escape',
  207. 'Left': 'ArrowLeft',
  208. 'Right': 'ArrowRight',
  209. 'Up': 'ArrowUp',
  210. 'Down': 'ArrowDown',
  211. 'Menu': 'ContextMenu',
  212. 'Scroll': 'ScrollLock',
  213. 'Win': 'OS'
  214. };
  215. // There is a bug in Chrome for numeric keypad keys:
  216. // https://code.google.com/p/chromium/issues/detail?id=155654
  217. // 1, 2, 3 ... are reported as A, B, C ...
  218. var _chromeNumKeyPadMap = {
  219. 'A': '1',
  220. 'B': '2',
  221. 'C': '3',
  222. 'D': '4',
  223. 'E': '5',
  224. 'F': '6',
  225. 'G': '7',
  226. 'H': '8',
  227. 'I': '9',
  228. 'J': '*',
  229. 'K': '+',
  230. 'M': '-',
  231. 'N': '.',
  232. 'O': '/',
  233. '\x60': '0',
  234. '\x90': 'NumLock'
  235. };
  236. var ɵ0 = function () {
  237. if (i0.ɵglobal['Node']) {
  238. return i0.ɵglobal['Node'].prototype.contains || function (node) {
  239. return !!(this.compareDocumentPosition(node) & 16);
  240. };
  241. }
  242. return undefined;
  243. };
  244. var nodeContains = (ɵ0)();
  245. /**
  246. * A `DomAdapter` powered by full browser DOM APIs.
  247. *
  248. * @security Tread carefully! Interacting with the DOM directly is dangerous and
  249. * can introduce XSS risks.
  250. */
  251. /* tslint:disable:requireParameterType no-console */
  252. var BrowserDomAdapter = /** @class */ (function (_super) {
  253. __extends(BrowserDomAdapter, _super);
  254. function BrowserDomAdapter() {
  255. return _super !== null && _super.apply(this, arguments) || this;
  256. }
  257. BrowserDomAdapter.prototype.parse = function (templateHtml) { throw new Error('parse not implemented'); };
  258. BrowserDomAdapter.makeCurrent = function () { setRootDomAdapter(new BrowserDomAdapter()); };
  259. BrowserDomAdapter.prototype.hasProperty = function (element, name) { return name in element; };
  260. BrowserDomAdapter.prototype.setProperty = function (el, name, value) { el[name] = value; };
  261. BrowserDomAdapter.prototype.getProperty = function (el, name) { return el[name]; };
  262. BrowserDomAdapter.prototype.invoke = function (el, methodName, args) {
  263. var _a;
  264. (_a = el)[methodName].apply(_a, __spread(args));
  265. };
  266. // TODO(tbosch): move this into a separate environment class once we have it
  267. BrowserDomAdapter.prototype.logError = function (error) {
  268. if (window.console) {
  269. if (console.error) {
  270. console.error(error);
  271. }
  272. else {
  273. console.log(error);
  274. }
  275. }
  276. };
  277. BrowserDomAdapter.prototype.log = function (error) {
  278. if (window.console) {
  279. window.console.log && window.console.log(error);
  280. }
  281. };
  282. BrowserDomAdapter.prototype.logGroup = function (error) {
  283. if (window.console) {
  284. window.console.group && window.console.group(error);
  285. }
  286. };
  287. BrowserDomAdapter.prototype.logGroupEnd = function () {
  288. if (window.console) {
  289. window.console.groupEnd && window.console.groupEnd();
  290. }
  291. };
  292. Object.defineProperty(BrowserDomAdapter.prototype, "attrToPropMap", {
  293. get: function () { return _attrToPropMap; },
  294. enumerable: true,
  295. configurable: true
  296. });
  297. BrowserDomAdapter.prototype.contains = function (nodeA, nodeB) { return nodeContains.call(nodeA, nodeB); };
  298. BrowserDomAdapter.prototype.querySelector = function (el, selector) { return el.querySelector(selector); };
  299. BrowserDomAdapter.prototype.querySelectorAll = function (el, selector) { return el.querySelectorAll(selector); };
  300. BrowserDomAdapter.prototype.on = function (el, evt, listener) { el.addEventListener(evt, listener, false); };
  301. BrowserDomAdapter.prototype.onAndCancel = function (el, evt, listener) {
  302. el.addEventListener(evt, listener, false);
  303. // Needed to follow Dart's subscription semantic, until fix of
  304. // https://code.google.com/p/dart/issues/detail?id=17406
  305. return function () { el.removeEventListener(evt, listener, false); };
  306. };
  307. BrowserDomAdapter.prototype.dispatchEvent = function (el, evt) { el.dispatchEvent(evt); };
  308. BrowserDomAdapter.prototype.createMouseEvent = function (eventType) {
  309. var evt = this.getDefaultDocument().createEvent('MouseEvent');
  310. evt.initEvent(eventType, true, true);
  311. return evt;
  312. };
  313. BrowserDomAdapter.prototype.createEvent = function (eventType) {
  314. var evt = this.getDefaultDocument().createEvent('Event');
  315. evt.initEvent(eventType, true, true);
  316. return evt;
  317. };
  318. BrowserDomAdapter.prototype.preventDefault = function (evt) {
  319. evt.preventDefault();
  320. evt.returnValue = false;
  321. };
  322. BrowserDomAdapter.prototype.isPrevented = function (evt) {
  323. return evt.defaultPrevented || evt.returnValue != null && !evt.returnValue;
  324. };
  325. BrowserDomAdapter.prototype.getInnerHTML = function (el) { return el.innerHTML; };
  326. BrowserDomAdapter.prototype.getTemplateContent = function (el) {
  327. return 'content' in el && this.isTemplateElement(el) ? el.content : null;
  328. };
  329. BrowserDomAdapter.prototype.getOuterHTML = function (el) { return el.outerHTML; };
  330. BrowserDomAdapter.prototype.nodeName = function (node) { return node.nodeName; };
  331. BrowserDomAdapter.prototype.nodeValue = function (node) { return node.nodeValue; };
  332. BrowserDomAdapter.prototype.type = function (node) { return node.type; };
  333. BrowserDomAdapter.prototype.content = function (node) {
  334. if (this.hasProperty(node, 'content')) {
  335. return node.content;
  336. }
  337. else {
  338. return node;
  339. }
  340. };
  341. BrowserDomAdapter.prototype.firstChild = function (el) { return el.firstChild; };
  342. BrowserDomAdapter.prototype.nextSibling = function (el) { return el.nextSibling; };
  343. BrowserDomAdapter.prototype.parentElement = function (el) { return el.parentNode; };
  344. BrowserDomAdapter.prototype.childNodes = function (el) { return el.childNodes; };
  345. BrowserDomAdapter.prototype.childNodesAsList = function (el) {
  346. var childNodes = el.childNodes;
  347. var res = new Array(childNodes.length);
  348. for (var i = 0; i < childNodes.length; i++) {
  349. res[i] = childNodes[i];
  350. }
  351. return res;
  352. };
  353. BrowserDomAdapter.prototype.clearNodes = function (el) {
  354. while (el.firstChild) {
  355. el.removeChild(el.firstChild);
  356. }
  357. };
  358. BrowserDomAdapter.prototype.appendChild = function (el, node) { el.appendChild(node); };
  359. BrowserDomAdapter.prototype.removeChild = function (el, node) { el.removeChild(node); };
  360. BrowserDomAdapter.prototype.replaceChild = function (el, newChild, oldChild) { el.replaceChild(newChild, oldChild); };
  361. BrowserDomAdapter.prototype.remove = function (node) {
  362. if (node.parentNode) {
  363. node.parentNode.removeChild(node);
  364. }
  365. return node;
  366. };
  367. BrowserDomAdapter.prototype.insertBefore = function (parent, ref, node) { parent.insertBefore(node, ref); };
  368. BrowserDomAdapter.prototype.insertAllBefore = function (parent, ref, nodes) {
  369. nodes.forEach(function (n) { return parent.insertBefore(n, ref); });
  370. };
  371. BrowserDomAdapter.prototype.insertAfter = function (parent, ref, node) { parent.insertBefore(node, ref.nextSibling); };
  372. BrowserDomAdapter.prototype.setInnerHTML = function (el, value) { el.innerHTML = value; };
  373. BrowserDomAdapter.prototype.getText = function (el) { return el.textContent; };
  374. BrowserDomAdapter.prototype.setText = function (el, value) { el.textContent = value; };
  375. BrowserDomAdapter.prototype.getValue = function (el) { return el.value; };
  376. BrowserDomAdapter.prototype.setValue = function (el, value) { el.value = value; };
  377. BrowserDomAdapter.prototype.getChecked = function (el) { return el.checked; };
  378. BrowserDomAdapter.prototype.setChecked = function (el, value) { el.checked = value; };
  379. BrowserDomAdapter.prototype.createComment = function (text) { return this.getDefaultDocument().createComment(text); };
  380. BrowserDomAdapter.prototype.createTemplate = function (html) {
  381. var t = this.getDefaultDocument().createElement('template');
  382. t.innerHTML = html;
  383. return t;
  384. };
  385. BrowserDomAdapter.prototype.createElement = function (tagName, doc) {
  386. doc = doc || this.getDefaultDocument();
  387. return doc.createElement(tagName);
  388. };
  389. BrowserDomAdapter.prototype.createElementNS = function (ns, tagName, doc) {
  390. doc = doc || this.getDefaultDocument();
  391. return doc.createElementNS(ns, tagName);
  392. };
  393. BrowserDomAdapter.prototype.createTextNode = function (text, doc) {
  394. doc = doc || this.getDefaultDocument();
  395. return doc.createTextNode(text);
  396. };
  397. BrowserDomAdapter.prototype.createScriptTag = function (attrName, attrValue, doc) {
  398. doc = doc || this.getDefaultDocument();
  399. var el = doc.createElement('SCRIPT');
  400. el.setAttribute(attrName, attrValue);
  401. return el;
  402. };
  403. BrowserDomAdapter.prototype.createStyleElement = function (css, doc) {
  404. doc = doc || this.getDefaultDocument();
  405. var style = doc.createElement('style');
  406. this.appendChild(style, this.createTextNode(css, doc));
  407. return style;
  408. };
  409. BrowserDomAdapter.prototype.createShadowRoot = function (el) { return el.createShadowRoot(); };
  410. BrowserDomAdapter.prototype.getShadowRoot = function (el) { return el.shadowRoot; };
  411. BrowserDomAdapter.prototype.getHost = function (el) { return el.host; };
  412. BrowserDomAdapter.prototype.clone = function (node) { return node.cloneNode(true); };
  413. BrowserDomAdapter.prototype.getElementsByClassName = function (element, name) {
  414. return element.getElementsByClassName(name);
  415. };
  416. BrowserDomAdapter.prototype.getElementsByTagName = function (element, name) {
  417. return element.getElementsByTagName(name);
  418. };
  419. BrowserDomAdapter.prototype.classList = function (element) { return Array.prototype.slice.call(element.classList, 0); };
  420. BrowserDomAdapter.prototype.addClass = function (element, className) { element.classList.add(className); };
  421. BrowserDomAdapter.prototype.removeClass = function (element, className) { element.classList.remove(className); };
  422. BrowserDomAdapter.prototype.hasClass = function (element, className) {
  423. return element.classList.contains(className);
  424. };
  425. BrowserDomAdapter.prototype.setStyle = function (element, styleName, styleValue) {
  426. element.style[styleName] = styleValue;
  427. };
  428. BrowserDomAdapter.prototype.removeStyle = function (element, stylename) {
  429. // IE requires '' instead of null
  430. // see https://github.com/angular/angular/issues/7916
  431. element.style[stylename] = '';
  432. };
  433. BrowserDomAdapter.prototype.getStyle = function (element, stylename) { return element.style[stylename]; };
  434. BrowserDomAdapter.prototype.hasStyle = function (element, styleName, styleValue) {
  435. var value = this.getStyle(element, styleName) || '';
  436. return styleValue ? value == styleValue : value.length > 0;
  437. };
  438. BrowserDomAdapter.prototype.tagName = function (element) { return element.tagName; };
  439. BrowserDomAdapter.prototype.attributeMap = function (element) {
  440. var res = new Map();
  441. var elAttrs = element.attributes;
  442. for (var i = 0; i < elAttrs.length; i++) {
  443. var attrib = elAttrs.item(i);
  444. res.set(attrib.name, attrib.value);
  445. }
  446. return res;
  447. };
  448. BrowserDomAdapter.prototype.hasAttribute = function (element, attribute) {
  449. return element.hasAttribute(attribute);
  450. };
  451. BrowserDomAdapter.prototype.hasAttributeNS = function (element, ns, attribute) {
  452. return element.hasAttributeNS(ns, attribute);
  453. };
  454. BrowserDomAdapter.prototype.getAttribute = function (element, attribute) {
  455. return element.getAttribute(attribute);
  456. };
  457. BrowserDomAdapter.prototype.getAttributeNS = function (element, ns, name) {
  458. return element.getAttributeNS(ns, name);
  459. };
  460. BrowserDomAdapter.prototype.setAttribute = function (element, name, value) { element.setAttribute(name, value); };
  461. BrowserDomAdapter.prototype.setAttributeNS = function (element, ns, name, value) {
  462. element.setAttributeNS(ns, name, value);
  463. };
  464. BrowserDomAdapter.prototype.removeAttribute = function (element, attribute) { element.removeAttribute(attribute); };
  465. BrowserDomAdapter.prototype.removeAttributeNS = function (element, ns, name) {
  466. element.removeAttributeNS(ns, name);
  467. };
  468. BrowserDomAdapter.prototype.templateAwareRoot = function (el) { return this.isTemplateElement(el) ? this.content(el) : el; };
  469. BrowserDomAdapter.prototype.createHtmlDocument = function () {
  470. return document.implementation.createHTMLDocument('fakeTitle');
  471. };
  472. BrowserDomAdapter.prototype.getDefaultDocument = function () { return document; };
  473. BrowserDomAdapter.prototype.getBoundingClientRect = function (el) {
  474. try {
  475. return el.getBoundingClientRect();
  476. }
  477. catch (_a) {
  478. return { top: 0, bottom: 0, left: 0, right: 0, width: 0, height: 0 };
  479. }
  480. };
  481. BrowserDomAdapter.prototype.getTitle = function (doc) { return doc.title; };
  482. BrowserDomAdapter.prototype.setTitle = function (doc, newTitle) { doc.title = newTitle || ''; };
  483. BrowserDomAdapter.prototype.elementMatches = function (n, selector) {
  484. if (this.isElementNode(n)) {
  485. return n.matches && n.matches(selector) ||
  486. n.msMatchesSelector && n.msMatchesSelector(selector) ||
  487. n.webkitMatchesSelector && n.webkitMatchesSelector(selector);
  488. }
  489. return false;
  490. };
  491. BrowserDomAdapter.prototype.isTemplateElement = function (el) {
  492. return this.isElementNode(el) && el.nodeName === 'TEMPLATE';
  493. };
  494. BrowserDomAdapter.prototype.isTextNode = function (node) { return node.nodeType === Node.TEXT_NODE; };
  495. BrowserDomAdapter.prototype.isCommentNode = function (node) { return node.nodeType === Node.COMMENT_NODE; };
  496. BrowserDomAdapter.prototype.isElementNode = function (node) { return node.nodeType === Node.ELEMENT_NODE; };
  497. BrowserDomAdapter.prototype.hasShadowRoot = function (node) {
  498. return node.shadowRoot != null && node instanceof HTMLElement;
  499. };
  500. BrowserDomAdapter.prototype.isShadowRoot = function (node) { return node instanceof DocumentFragment; };
  501. BrowserDomAdapter.prototype.importIntoDoc = function (node) { return document.importNode(this.templateAwareRoot(node), true); };
  502. BrowserDomAdapter.prototype.adoptNode = function (node) { return document.adoptNode(node); };
  503. BrowserDomAdapter.prototype.getHref = function (el) { return el.getAttribute('href'); };
  504. BrowserDomAdapter.prototype.getEventKey = function (event) {
  505. var key = event.key;
  506. if (key == null) {
  507. key = event.keyIdentifier;
  508. // keyIdentifier is defined in the old draft of DOM Level 3 Events implemented by Chrome and
  509. // Safari cf
  510. // http://www.w3.org/TR/2007/WD-DOM-Level-3-Events-20071221/events.html#Events-KeyboardEvents-Interfaces
  511. if (key == null) {
  512. return 'Unidentified';
  513. }
  514. if (key.startsWith('U+')) {
  515. key = String.fromCharCode(parseInt(key.substring(2), 16));
  516. if (event.location === DOM_KEY_LOCATION_NUMPAD && _chromeNumKeyPadMap.hasOwnProperty(key)) {
  517. // There is a bug in Chrome for numeric keypad keys:
  518. // https://code.google.com/p/chromium/issues/detail?id=155654
  519. // 1, 2, 3 ... are reported as A, B, C ...
  520. key = _chromeNumKeyPadMap[key];
  521. }
  522. }
  523. }
  524. return _keyMap[key] || key;
  525. };
  526. BrowserDomAdapter.prototype.getGlobalEventTarget = function (doc, target) {
  527. if (target === 'window') {
  528. return window;
  529. }
  530. if (target === 'document') {
  531. return doc;
  532. }
  533. if (target === 'body') {
  534. return doc.body;
  535. }
  536. return null;
  537. };
  538. BrowserDomAdapter.prototype.getHistory = function () { return window.history; };
  539. BrowserDomAdapter.prototype.getLocation = function () { return window.location; };
  540. BrowserDomAdapter.prototype.getBaseHref = function (doc) {
  541. var href = getBaseElementHref();
  542. return href == null ? null : relativePath(href);
  543. };
  544. BrowserDomAdapter.prototype.resetBaseElement = function () { baseElement = null; };
  545. BrowserDomAdapter.prototype.getUserAgent = function () { return window.navigator.userAgent; };
  546. BrowserDomAdapter.prototype.setData = function (element, name, value) {
  547. this.setAttribute(element, 'data-' + name, value);
  548. };
  549. BrowserDomAdapter.prototype.getData = function (element, name) {
  550. return this.getAttribute(element, 'data-' + name);
  551. };
  552. BrowserDomAdapter.prototype.getComputedStyle = function (element) { return getComputedStyle(element); };
  553. // TODO(tbosch): move this into a separate environment class once we have it
  554. BrowserDomAdapter.prototype.supportsWebAnimation = function () {
  555. return typeof Element.prototype['animate'] === 'function';
  556. };
  557. BrowserDomAdapter.prototype.performanceNow = function () {
  558. // performance.now() is not available in all browsers, see
  559. // http://caniuse.com/#search=performance.now
  560. return window.performance && window.performance.now ? window.performance.now() :
  561. new Date().getTime();
  562. };
  563. BrowserDomAdapter.prototype.supportsCookies = function () { return true; };
  564. BrowserDomAdapter.prototype.getCookie = function (name) { return common.ɵparseCookieValue(document.cookie, name); };
  565. BrowserDomAdapter.prototype.setCookie = function (name, value) {
  566. // document.cookie is magical, assigning into it assigns/overrides one cookie value, but does
  567. // not clear other cookies.
  568. document.cookie = encodeURIComponent(name) + '=' + encodeURIComponent(value);
  569. };
  570. return BrowserDomAdapter;
  571. }(GenericBrowserDomAdapter));
  572. var baseElement = null;
  573. function getBaseElementHref() {
  574. if (!baseElement) {
  575. baseElement = document.querySelector('base');
  576. if (!baseElement) {
  577. return null;
  578. }
  579. }
  580. return baseElement.getAttribute('href');
  581. }
  582. // based on urlUtils.js in AngularJS 1
  583. var urlParsingNode;
  584. function relativePath(url) {
  585. if (!urlParsingNode) {
  586. urlParsingNode = document.createElement('a');
  587. }
  588. urlParsingNode.setAttribute('href', url);
  589. return (urlParsingNode.pathname.charAt(0) === '/') ? urlParsingNode.pathname :
  590. '/' + urlParsingNode.pathname;
  591. }
  592. /**
  593. * @license
  594. * Copyright Google Inc. All Rights Reserved.
  595. *
  596. * Use of this source code is governed by an MIT-style license that can be
  597. * found in the LICENSE file at https://angular.io/license
  598. */
  599. function supportsState() {
  600. return !!window.history.pushState;
  601. }
  602. /**
  603. * @license
  604. * Copyright Google Inc. All Rights Reserved.
  605. *
  606. * Use of this source code is governed by an MIT-style license that can be
  607. * found in the LICENSE file at https://angular.io/license
  608. */
  609. /**
  610. * `PlatformLocation` encapsulates all of the direct calls to platform APIs.
  611. * This class should not be used directly by an application developer. Instead, use
  612. * {@link Location}.
  613. */
  614. var BrowserPlatformLocation = /** @class */ (function (_super) {
  615. __extends(BrowserPlatformLocation, _super);
  616. function BrowserPlatformLocation(_doc) {
  617. var _this = _super.call(this) || this;
  618. _this._doc = _doc;
  619. _this._init();
  620. return _this;
  621. }
  622. // This is moved to its own method so that `MockPlatformLocationStrategy` can overwrite it
  623. /** @internal */
  624. BrowserPlatformLocation.prototype._init = function () {
  625. this.location = getDOM().getLocation();
  626. this._history = getDOM().getHistory();
  627. };
  628. BrowserPlatformLocation.prototype.getBaseHrefFromDOM = function () { return getDOM().getBaseHref(this._doc); };
  629. BrowserPlatformLocation.prototype.onPopState = function (fn) {
  630. getDOM().getGlobalEventTarget(this._doc, 'window').addEventListener('popstate', fn, false);
  631. };
  632. BrowserPlatformLocation.prototype.onHashChange = function (fn) {
  633. getDOM().getGlobalEventTarget(this._doc, 'window').addEventListener('hashchange', fn, false);
  634. };
  635. Object.defineProperty(BrowserPlatformLocation.prototype, "href", {
  636. get: function () { return this.location.href; },
  637. enumerable: true,
  638. configurable: true
  639. });
  640. Object.defineProperty(BrowserPlatformLocation.prototype, "protocol", {
  641. get: function () { return this.location.protocol; },
  642. enumerable: true,
  643. configurable: true
  644. });
  645. Object.defineProperty(BrowserPlatformLocation.prototype, "hostname", {
  646. get: function () { return this.location.hostname; },
  647. enumerable: true,
  648. configurable: true
  649. });
  650. Object.defineProperty(BrowserPlatformLocation.prototype, "port", {
  651. get: function () { return this.location.port; },
  652. enumerable: true,
  653. configurable: true
  654. });
  655. Object.defineProperty(BrowserPlatformLocation.prototype, "pathname", {
  656. get: function () { return this.location.pathname; },
  657. set: function (newPath) { this.location.pathname = newPath; },
  658. enumerable: true,
  659. configurable: true
  660. });
  661. Object.defineProperty(BrowserPlatformLocation.prototype, "search", {
  662. get: function () { return this.location.search; },
  663. enumerable: true,
  664. configurable: true
  665. });
  666. Object.defineProperty(BrowserPlatformLocation.prototype, "hash", {
  667. get: function () { return this.location.hash; },
  668. enumerable: true,
  669. configurable: true
  670. });
  671. BrowserPlatformLocation.prototype.pushState = function (state, title, url) {
  672. if (supportsState()) {
  673. this._history.pushState(state, title, url);
  674. }
  675. else {
  676. this.location.hash = url;
  677. }
  678. };
  679. BrowserPlatformLocation.prototype.replaceState = function (state, title, url) {
  680. if (supportsState()) {
  681. this._history.replaceState(state, title, url);
  682. }
  683. else {
  684. this.location.hash = url;
  685. }
  686. };
  687. BrowserPlatformLocation.prototype.forward = function () { this._history.forward(); };
  688. BrowserPlatformLocation.prototype.back = function () { this._history.back(); };
  689. BrowserPlatformLocation.prototype.getState = function () { return this._history.state; };
  690. BrowserPlatformLocation = __decorate([
  691. i0.Injectable(),
  692. __param(0, i0.Inject(common.DOCUMENT)),
  693. __metadata("design:paramtypes", [Object])
  694. ], BrowserPlatformLocation);
  695. return BrowserPlatformLocation;
  696. }(common.PlatformLocation));
  697. /**
  698. * @license
  699. * Copyright Google Inc. All Rights Reserved.
  700. *
  701. * Use of this source code is governed by an MIT-style license that can be
  702. * found in the LICENSE file at https://angular.io/license
  703. */
  704. /**
  705. * An id that identifies a particular application being bootstrapped, that should
  706. * match across the client/server boundary.
  707. */
  708. var TRANSITION_ID = new i0.InjectionToken('TRANSITION_ID');
  709. function appInitializerFactory(transitionId, document, injector) {
  710. return function () {
  711. // Wait for all application initializers to be completed before removing the styles set by
  712. // the server.
  713. injector.get(i0.ApplicationInitStatus).donePromise.then(function () {
  714. var dom = getDOM();
  715. var styles = Array.prototype.slice.apply(dom.querySelectorAll(document, "style[ng-transition]"));
  716. styles.filter(function (el) { return dom.getAttribute(el, 'ng-transition') === transitionId; })
  717. .forEach(function (el) { return dom.remove(el); });
  718. });
  719. };
  720. }
  721. var SERVER_TRANSITION_PROVIDERS = [
  722. {
  723. provide: i0.APP_INITIALIZER,
  724. useFactory: appInitializerFactory,
  725. deps: [TRANSITION_ID, common.DOCUMENT, i0.Injector],
  726. multi: true
  727. },
  728. ];
  729. /**
  730. * @license
  731. * Copyright Google Inc. All Rights Reserved.
  732. *
  733. * Use of this source code is governed by an MIT-style license that can be
  734. * found in the LICENSE file at https://angular.io/license
  735. */
  736. var BrowserGetTestability = /** @class */ (function () {
  737. function BrowserGetTestability() {
  738. }
  739. BrowserGetTestability.init = function () { i0.setTestabilityGetter(new BrowserGetTestability()); };
  740. BrowserGetTestability.prototype.addToWindow = function (registry) {
  741. i0.ɵglobal['getAngularTestability'] = function (elem, findInAncestors) {
  742. if (findInAncestors === void 0) { findInAncestors = true; }
  743. var testability = registry.findTestabilityInTree(elem, findInAncestors);
  744. if (testability == null) {
  745. throw new Error('Could not find testability for element.');
  746. }
  747. return testability;
  748. };
  749. i0.ɵglobal['getAllAngularTestabilities'] = function () { return registry.getAllTestabilities(); };
  750. i0.ɵglobal['getAllAngularRootElements'] = function () { return registry.getAllRootElements(); };
  751. var whenAllStable = function (callback /** TODO #9100 */) {
  752. var testabilities = i0.ɵglobal['getAllAngularTestabilities']();
  753. var count = testabilities.length;
  754. var didWork = false;
  755. var decrement = function (didWork_ /** TODO #9100 */) {
  756. didWork = didWork || didWork_;
  757. count--;
  758. if (count == 0) {
  759. callback(didWork);
  760. }
  761. };
  762. testabilities.forEach(function (testability /** TODO #9100 */) {
  763. testability.whenStable(decrement);
  764. });
  765. };
  766. if (!i0.ɵglobal['frameworkStabilizers']) {
  767. i0.ɵglobal['frameworkStabilizers'] = [];
  768. }
  769. i0.ɵglobal['frameworkStabilizers'].push(whenAllStable);
  770. };
  771. BrowserGetTestability.prototype.findTestabilityInTree = function (registry, elem, findInAncestors) {
  772. if (elem == null) {
  773. return null;
  774. }
  775. var t = registry.getTestability(elem);
  776. if (t != null) {
  777. return t;
  778. }
  779. else if (!findInAncestors) {
  780. return null;
  781. }
  782. if (getDOM().isShadowRoot(elem)) {
  783. return this.findTestabilityInTree(registry, getDOM().getHost(elem), true);
  784. }
  785. return this.findTestabilityInTree(registry, getDOM().parentElement(elem), true);
  786. };
  787. return BrowserGetTestability;
  788. }());
  789. /**
  790. * @license
  791. * Copyright Google Inc. All Rights Reserved.
  792. *
  793. * Use of this source code is governed by an MIT-style license that can be
  794. * found in the LICENSE file at https://angular.io/license
  795. */
  796. /**
  797. * Exports the value under a given `name` in the global property `ng`. For example `ng.probe` if
  798. * `name` is `'probe'`.
  799. * @param name Name under which it will be exported. Keep in mind this will be a property of the
  800. * global `ng` object.
  801. * @param value The value to export.
  802. */
  803. function exportNgVar(name, value) {
  804. if (typeof COMPILED === 'undefined' || !COMPILED) {
  805. // Note: we can't export `ng` when using closure enhanced optimization as:
  806. // - closure declares globals itself for minified names, which sometimes clobber our `ng` global
  807. // - we can't declare a closure extern as the namespace `ng` is already used within Google
  808. // for typings for angularJS (via `goog.provide('ng....')`).
  809. var ng = i0.ɵglobal['ng'] = i0.ɵglobal['ng'] || {};
  810. ng[name] = value;
  811. }
  812. }
  813. /**
  814. * @license
  815. * Copyright Google Inc. All Rights Reserved.
  816. *
  817. * Use of this source code is governed by an MIT-style license that can be
  818. * found in the LICENSE file at https://angular.io/license
  819. */
  820. var ɵ0$1 = function () { return ({
  821. 'ApplicationRef': i0.ApplicationRef,
  822. 'NgZone': i0.NgZone,
  823. }); };
  824. var CORE_TOKENS = (ɵ0$1)();
  825. var INSPECT_GLOBAL_NAME = 'probe';
  826. var CORE_TOKENS_GLOBAL_NAME = 'coreTokens';
  827. /**
  828. * Returns a {@link DebugElement} for the given native DOM element, or
  829. * null if the given native element does not have an Angular view associated
  830. * with it.
  831. */
  832. function inspectNativeElement(element) {
  833. return i0.getDebugNode(element);
  834. }
  835. function _createNgProbe(coreTokens) {
  836. exportNgVar(INSPECT_GLOBAL_NAME, inspectNativeElement);
  837. exportNgVar(CORE_TOKENS_GLOBAL_NAME, __assign({}, CORE_TOKENS, _ngProbeTokensToMap(coreTokens || [])));
  838. return function () { return inspectNativeElement; };
  839. }
  840. function _ngProbeTokensToMap(tokens) {
  841. return tokens.reduce(function (prev, t) { return (prev[t.name] = t.token, prev); }, {});
  842. }
  843. /**
  844. * In Ivy, we don't support NgProbe because we have our own set of testing utilities
  845. * with more robust functionality.
  846. *
  847. * We shouldn't bring in NgProbe because it prevents DebugNode and friends from
  848. * tree-shaking properly.
  849. */
  850. var ELEMENT_PROBE_PROVIDERS__POST_R3__ = [];
  851. /**
  852. * Providers which support debugging Angular applications (e.g. via `ng.probe`).
  853. */
  854. var ELEMENT_PROBE_PROVIDERS__PRE_R3__ = [
  855. {
  856. provide: i0.APP_INITIALIZER,
  857. useFactory: _createNgProbe,
  858. deps: [
  859. [i0.NgProbeToken, new i0.Optional()],
  860. ],
  861. multi: true,
  862. },
  863. ];
  864. var ELEMENT_PROBE_PROVIDERS = ELEMENT_PROBE_PROVIDERS__PRE_R3__;
  865. /**
  866. * @license
  867. * Copyright Google Inc. All Rights Reserved.
  868. *
  869. * Use of this source code is governed by an MIT-style license that can be
  870. * found in the LICENSE file at https://angular.io/license
  871. */
  872. /**
  873. * The injection token for the event-manager plug-in service.
  874. *
  875. * @publicApi
  876. */
  877. var EVENT_MANAGER_PLUGINS = new i0.InjectionToken('EventManagerPlugins');
  878. /**
  879. * An injectable service that provides event management for Angular
  880. * through a browser plug-in.
  881. *
  882. * @publicApi
  883. */
  884. var EventManager = /** @class */ (function () {
  885. /**
  886. * Initializes an instance of the event-manager service.
  887. */
  888. function EventManager(plugins, _zone) {
  889. var _this = this;
  890. this._zone = _zone;
  891. this._eventNameToPlugin = new Map();
  892. plugins.forEach(function (p) { return p.manager = _this; });
  893. this._plugins = plugins.slice().reverse();
  894. }
  895. /**
  896. * Registers a handler for a specific element and event.
  897. *
  898. * @param element The HTML element to receive event notifications.
  899. * @param eventName The name of the event to listen for.
  900. * @param handler A function to call when the notification occurs. Receives the
  901. * event object as an argument.
  902. * @returns A callback function that can be used to remove the handler.
  903. */
  904. EventManager.prototype.addEventListener = function (element, eventName, handler) {
  905. var plugin = this._findPluginFor(eventName);
  906. return plugin.addEventListener(element, eventName, handler);
  907. };
  908. /**
  909. * Registers a global handler for an event in a target view.
  910. *
  911. * @param target A target for global event notifications. One of "window", "document", or "body".
  912. * @param eventName The name of the event to listen for.
  913. * @param handler A function to call when the notification occurs. Receives the
  914. * event object as an argument.
  915. * @returns A callback function that can be used to remove the handler.
  916. */
  917. EventManager.prototype.addGlobalEventListener = function (target, eventName, handler) {
  918. var plugin = this._findPluginFor(eventName);
  919. return plugin.addGlobalEventListener(target, eventName, handler);
  920. };
  921. /**
  922. * Retrieves the compilation zone in which event listeners are registered.
  923. */
  924. EventManager.prototype.getZone = function () { return this._zone; };
  925. /** @internal */
  926. EventManager.prototype._findPluginFor = function (eventName) {
  927. var plugin = this._eventNameToPlugin.get(eventName);
  928. if (plugin) {
  929. return plugin;
  930. }
  931. var plugins = this._plugins;
  932. for (var i = 0; i < plugins.length; i++) {
  933. var plugin_1 = plugins[i];
  934. if (plugin_1.supports(eventName)) {
  935. this._eventNameToPlugin.set(eventName, plugin_1);
  936. return plugin_1;
  937. }
  938. }
  939. throw new Error("No event manager plugin found for event " + eventName);
  940. };
  941. EventManager = __decorate([
  942. i0.Injectable(),
  943. __param(0, i0.Inject(EVENT_MANAGER_PLUGINS)),
  944. __metadata("design:paramtypes", [Array, i0.NgZone])
  945. ], EventManager);
  946. return EventManager;
  947. }());
  948. var EventManagerPlugin = /** @class */ (function () {
  949. function EventManagerPlugin(_doc) {
  950. this._doc = _doc;
  951. }
  952. EventManagerPlugin.prototype.addGlobalEventListener = function (element, eventName, handler) {
  953. var target = getDOM().getGlobalEventTarget(this._doc, element);
  954. if (!target) {
  955. throw new Error("Unsupported event target " + target + " for event " + eventName);
  956. }
  957. return this.addEventListener(target, eventName, handler);
  958. };
  959. return EventManagerPlugin;
  960. }());
  961. /**
  962. * @license
  963. * Copyright Google Inc. All Rights Reserved.
  964. *
  965. * Use of this source code is governed by an MIT-style license that can be
  966. * found in the LICENSE file at https://angular.io/license
  967. */
  968. var SharedStylesHost = /** @class */ (function () {
  969. function SharedStylesHost() {
  970. /** @internal */
  971. this._stylesSet = new Set();
  972. }
  973. SharedStylesHost.prototype.addStyles = function (styles) {
  974. var _this = this;
  975. var additions = new Set();
  976. styles.forEach(function (style) {
  977. if (!_this._stylesSet.has(style)) {
  978. _this._stylesSet.add(style);
  979. additions.add(style);
  980. }
  981. });
  982. this.onStylesAdded(additions);
  983. };
  984. SharedStylesHost.prototype.onStylesAdded = function (additions) { };
  985. SharedStylesHost.prototype.getAllStyles = function () { return Array.from(this._stylesSet); };
  986. SharedStylesHost = __decorate([
  987. i0.Injectable()
  988. ], SharedStylesHost);
  989. return SharedStylesHost;
  990. }());
  991. var DomSharedStylesHost = /** @class */ (function (_super) {
  992. __extends(DomSharedStylesHost, _super);
  993. function DomSharedStylesHost(_doc) {
  994. var _this = _super.call(this) || this;
  995. _this._doc = _doc;
  996. _this._hostNodes = new Set();
  997. _this._styleNodes = new Set();
  998. _this._hostNodes.add(_doc.head);
  999. return _this;
  1000. }
  1001. DomSharedStylesHost.prototype._addStylesToHost = function (styles, host) {
  1002. var _this = this;
  1003. styles.forEach(function (style) {
  1004. var styleEl = _this._doc.createElement('style');
  1005. styleEl.textContent = style;
  1006. _this._styleNodes.add(host.appendChild(styleEl));
  1007. });
  1008. };
  1009. DomSharedStylesHost.prototype.addHost = function (hostNode) {
  1010. this._addStylesToHost(this._stylesSet, hostNode);
  1011. this._hostNodes.add(hostNode);
  1012. };
  1013. DomSharedStylesHost.prototype.removeHost = function (hostNode) { this._hostNodes.delete(hostNode); };
  1014. DomSharedStylesHost.prototype.onStylesAdded = function (additions) {
  1015. var _this = this;
  1016. this._hostNodes.forEach(function (hostNode) { return _this._addStylesToHost(additions, hostNode); });
  1017. };
  1018. DomSharedStylesHost.prototype.ngOnDestroy = function () { this._styleNodes.forEach(function (styleNode) { return getDOM().remove(styleNode); }); };
  1019. DomSharedStylesHost = __decorate([
  1020. i0.Injectable(),
  1021. __param(0, i0.Inject(common.DOCUMENT)),
  1022. __metadata("design:paramtypes", [Object])
  1023. ], DomSharedStylesHost);
  1024. return DomSharedStylesHost;
  1025. }(SharedStylesHost));
  1026. /**
  1027. * @license
  1028. * Copyright Google Inc. All Rights Reserved.
  1029. *
  1030. * Use of this source code is governed by an MIT-style license that can be
  1031. * found in the LICENSE file at https://angular.io/license
  1032. */
  1033. var NAMESPACE_URIS = {
  1034. 'svg': 'http://www.w3.org/2000/svg',
  1035. 'xhtml': 'http://www.w3.org/1999/xhtml',
  1036. 'xlink': 'http://www.w3.org/1999/xlink',
  1037. 'xml': 'http://www.w3.org/XML/1998/namespace',
  1038. 'xmlns': 'http://www.w3.org/2000/xmlns/',
  1039. };
  1040. var COMPONENT_REGEX = /%COMP%/g;
  1041. var COMPONENT_VARIABLE = '%COMP%';
  1042. var HOST_ATTR = "_nghost-" + COMPONENT_VARIABLE;
  1043. var CONTENT_ATTR = "_ngcontent-" + COMPONENT_VARIABLE;
  1044. function shimContentAttribute(componentShortId) {
  1045. return CONTENT_ATTR.replace(COMPONENT_REGEX, componentShortId);
  1046. }
  1047. function shimHostAttribute(componentShortId) {
  1048. return HOST_ATTR.replace(COMPONENT_REGEX, componentShortId);
  1049. }
  1050. function flattenStyles(compId, styles, target) {
  1051. for (var i = 0; i < styles.length; i++) {
  1052. var style = styles[i];
  1053. if (Array.isArray(style)) {
  1054. flattenStyles(compId, style, target);
  1055. }
  1056. else {
  1057. style = style.replace(COMPONENT_REGEX, compId);
  1058. target.push(style);
  1059. }
  1060. }
  1061. return target;
  1062. }
  1063. function decoratePreventDefault(eventHandler) {
  1064. return function (event) {
  1065. var allowDefaultBehavior = eventHandler(event);
  1066. if (allowDefaultBehavior === false) {
  1067. // TODO(tbosch): move preventDefault into event plugins...
  1068. event.preventDefault();
  1069. event.returnValue = false;
  1070. }
  1071. };
  1072. }
  1073. var DomRendererFactory2 = /** @class */ (function () {
  1074. function DomRendererFactory2(eventManager, sharedStylesHost, appId) {
  1075. this.eventManager = eventManager;
  1076. this.sharedStylesHost = sharedStylesHost;
  1077. this.appId = appId;
  1078. this.rendererByCompId = new Map();
  1079. this.defaultRenderer = new DefaultDomRenderer2(eventManager);
  1080. }
  1081. DomRendererFactory2.prototype.createRenderer = function (element, type) {
  1082. if (!element || !type) {
  1083. return this.defaultRenderer;
  1084. }
  1085. switch (type.encapsulation) {
  1086. case i0.ViewEncapsulation.Emulated: {
  1087. var renderer = this.rendererByCompId.get(type.id);
  1088. if (!renderer) {
  1089. renderer = new EmulatedEncapsulationDomRenderer2(this.eventManager, this.sharedStylesHost, type, this.appId);
  1090. this.rendererByCompId.set(type.id, renderer);
  1091. }
  1092. renderer.applyToHost(element);
  1093. return renderer;
  1094. }
  1095. case i0.ViewEncapsulation.Native:
  1096. case i0.ViewEncapsulation.ShadowDom:
  1097. return new ShadowDomRenderer(this.eventManager, this.sharedStylesHost, element, type);
  1098. default: {
  1099. if (!this.rendererByCompId.has(type.id)) {
  1100. var styles = flattenStyles(type.id, type.styles, []);
  1101. this.sharedStylesHost.addStyles(styles);
  1102. this.rendererByCompId.set(type.id, this.defaultRenderer);
  1103. }
  1104. return this.defaultRenderer;
  1105. }
  1106. }
  1107. };
  1108. DomRendererFactory2.prototype.begin = function () { };
  1109. DomRendererFactory2.prototype.end = function () { };
  1110. DomRendererFactory2 = __decorate([
  1111. i0.Injectable(),
  1112. __param(2, i0.Inject(i0.APP_ID)),
  1113. __metadata("design:paramtypes", [EventManager, DomSharedStylesHost, String])
  1114. ], DomRendererFactory2);
  1115. return DomRendererFactory2;
  1116. }());
  1117. var DefaultDomRenderer2 = /** @class */ (function () {
  1118. function DefaultDomRenderer2(eventManager) {
  1119. this.eventManager = eventManager;
  1120. this.data = Object.create(null);
  1121. }
  1122. DefaultDomRenderer2.prototype.destroy = function () { };
  1123. DefaultDomRenderer2.prototype.createElement = function (name, namespace) {
  1124. if (namespace) {
  1125. // In cases where Ivy (not ViewEngine) is giving us the actual namespace, the look up by key
  1126. // will result in undefined, so we just return the namespace here.
  1127. return document.createElementNS(NAMESPACE_URIS[namespace] || namespace, name);
  1128. }
  1129. return document.createElement(name);
  1130. };
  1131. DefaultDomRenderer2.prototype.createComment = function (value) { return document.createComment(value); };
  1132. DefaultDomRenderer2.prototype.createText = function (value) { return document.createTextNode(value); };
  1133. DefaultDomRenderer2.prototype.appendChild = function (parent, newChild) { parent.appendChild(newChild); };
  1134. DefaultDomRenderer2.prototype.insertBefore = function (parent, newChild, refChild) {
  1135. if (parent) {
  1136. parent.insertBefore(newChild, refChild);
  1137. }
  1138. };
  1139. DefaultDomRenderer2.prototype.removeChild = function (parent, oldChild) {
  1140. if (parent) {
  1141. parent.removeChild(oldChild);
  1142. }
  1143. };
  1144. DefaultDomRenderer2.prototype.selectRootElement = function (selectorOrNode, preserveContent) {
  1145. var el = typeof selectorOrNode === 'string' ? document.querySelector(selectorOrNode) :
  1146. selectorOrNode;
  1147. if (!el) {
  1148. throw new Error("The selector \"" + selectorOrNode + "\" did not match any elements");
  1149. }
  1150. if (!preserveContent) {
  1151. el.textContent = '';
  1152. }
  1153. return el;
  1154. };
  1155. DefaultDomRenderer2.prototype.parentNode = function (node) { return node.parentNode; };
  1156. DefaultDomRenderer2.prototype.nextSibling = function (node) { return node.nextSibling; };
  1157. DefaultDomRenderer2.prototype.setAttribute = function (el, name, value, namespace) {
  1158. if (namespace) {
  1159. name = namespace + ':' + name;
  1160. // TODO(benlesh): Ivy may cause issues here because it's passing around
  1161. // full URIs for namespaces, therefore this lookup will fail.
  1162. var namespaceUri = NAMESPACE_URIS[namespace];
  1163. if (namespaceUri) {
  1164. el.setAttributeNS(namespaceUri, name, value);
  1165. }
  1166. else {
  1167. el.setAttribute(name, value);
  1168. }
  1169. }
  1170. else {
  1171. el.setAttribute(name, value);
  1172. }
  1173. };
  1174. DefaultDomRenderer2.prototype.removeAttribute = function (el, name, namespace) {
  1175. if (namespace) {
  1176. // TODO(benlesh): Ivy may cause issues here because it's passing around
  1177. // full URIs for namespaces, therefore this lookup will fail.
  1178. var namespaceUri = NAMESPACE_URIS[namespace];
  1179. if (namespaceUri) {
  1180. el.removeAttributeNS(namespaceUri, name);
  1181. }
  1182. else {
  1183. // TODO(benlesh): Since ivy is passing around full URIs for namespaces
  1184. // this could result in properties like `http://www.w3.org/2000/svg:cx="123"`,
  1185. // which is wrong.
  1186. el.removeAttribute(namespace + ":" + name);
  1187. }
  1188. }
  1189. else {
  1190. el.removeAttribute(name);
  1191. }
  1192. };
  1193. DefaultDomRenderer2.prototype.addClass = function (el, name) { el.classList.add(name); };
  1194. DefaultDomRenderer2.prototype.removeClass = function (el, name) { el.classList.remove(name); };
  1195. DefaultDomRenderer2.prototype.setStyle = function (el, style, value, flags) {
  1196. if (flags & i0.RendererStyleFlags2.DashCase) {
  1197. el.style.setProperty(style, value, !!(flags & i0.RendererStyleFlags2.Important) ? 'important' : '');
  1198. }
  1199. else {
  1200. el.style[style] = value;
  1201. }
  1202. };
  1203. DefaultDomRenderer2.prototype.removeStyle = function (el, style, flags) {
  1204. if (flags & i0.RendererStyleFlags2.DashCase) {
  1205. el.style.removeProperty(style);
  1206. }
  1207. else {
  1208. // IE requires '' instead of null
  1209. // see https://github.com/angular/angular/issues/7916
  1210. el.style[style] = '';
  1211. }
  1212. };
  1213. DefaultDomRenderer2.prototype.setProperty = function (el, name, value) {
  1214. checkNoSyntheticProp(name, 'property');
  1215. el[name] = value;
  1216. };
  1217. DefaultDomRenderer2.prototype.setValue = function (node, value) { node.nodeValue = value; };
  1218. DefaultDomRenderer2.prototype.listen = function (target, event, callback) {
  1219. checkNoSyntheticProp(event, 'listener');
  1220. if (typeof target === 'string') {
  1221. return this.eventManager.addGlobalEventListener(target, event, decoratePreventDefault(callback));
  1222. }
  1223. return this.eventManager.addEventListener(target, event, decoratePreventDefault(callback));
  1224. };
  1225. return DefaultDomRenderer2;
  1226. }());
  1227. var ɵ0$2 = function () { return '@'.charCodeAt(0); };
  1228. var AT_CHARCODE = (ɵ0$2)();
  1229. function checkNoSyntheticProp(name, nameKind) {
  1230. if (name.charCodeAt(0) === AT_CHARCODE) {
  1231. throw new Error("Found the synthetic " + nameKind + " " + name + ". Please include either \"BrowserAnimationsModule\" or \"NoopAnimationsModule\" in your application.");
  1232. }
  1233. }
  1234. var EmulatedEncapsulationDomRenderer2 = /** @class */ (function (_super) {
  1235. __extends(EmulatedEncapsulationDomRenderer2, _super);
  1236. function EmulatedEncapsulationDomRenderer2(eventManager, sharedStylesHost, component, appId) {
  1237. var _this = _super.call(this, eventManager) || this;
  1238. _this.component = component;
  1239. var styles = flattenStyles(appId + '-' + component.id, component.styles, []);
  1240. sharedStylesHost.addStyles(styles);
  1241. _this.contentAttr = shimContentAttribute(appId + '-' + component.id);
  1242. _this.hostAttr = shimHostAttribute(appId + '-' + component.id);
  1243. return _this;
  1244. }
  1245. EmulatedEncapsulationDomRenderer2.prototype.applyToHost = function (element) { _super.prototype.setAttribute.call(this, element, this.hostAttr, ''); };
  1246. EmulatedEncapsulationDomRenderer2.prototype.createElement = function (parent, name) {
  1247. var el = _super.prototype.createElement.call(this, parent, name);
  1248. _super.prototype.setAttribute.call(this, el, this.contentAttr, '');
  1249. return el;
  1250. };
  1251. return EmulatedEncapsulationDomRenderer2;
  1252. }(DefaultDomRenderer2));
  1253. var ShadowDomRenderer = /** @class */ (function (_super) {
  1254. __extends(ShadowDomRenderer, _super);
  1255. function ShadowDomRenderer(eventManager, sharedStylesHost, hostEl, component) {
  1256. var _this = _super.call(this, eventManager) || this;
  1257. _this.sharedStylesHost = sharedStylesHost;
  1258. _this.hostEl = hostEl;
  1259. _this.component = component;
  1260. if (component.encapsulation === i0.ViewEncapsulation.ShadowDom) {
  1261. _this.shadowRoot = hostEl.attachShadow({ mode: 'open' });
  1262. }
  1263. else {
  1264. _this.shadowRoot = hostEl.createShadowRoot();
  1265. }
  1266. _this.sharedStylesHost.addHost(_this.shadowRoot);
  1267. var styles = flattenStyles(component.id, component.styles, []);
  1268. for (var i = 0; i < styles.length; i++) {
  1269. var styleEl = document.createElement('style');
  1270. styleEl.textContent = styles[i];
  1271. _this.shadowRoot.appendChild(styleEl);
  1272. }
  1273. return _this;
  1274. }
  1275. ShadowDomRenderer.prototype.nodeOrShadowRoot = function (node) { return node === this.hostEl ? this.shadowRoot : node; };
  1276. ShadowDomRenderer.prototype.destroy = function () { this.sharedStylesHost.removeHost(this.shadowRoot); };
  1277. ShadowDomRenderer.prototype.appendChild = function (parent, newChild) {
  1278. return _super.prototype.appendChild.call(this, this.nodeOrShadowRoot(parent), newChild);
  1279. };
  1280. ShadowDomRenderer.prototype.insertBefore = function (parent, newChild, refChild) {
  1281. return _super.prototype.insertBefore.call(this, this.nodeOrShadowRoot(parent), newChild, refChild);
  1282. };
  1283. ShadowDomRenderer.prototype.removeChild = function (parent, oldChild) {
  1284. return _super.prototype.removeChild.call(this, this.nodeOrShadowRoot(parent), oldChild);
  1285. };
  1286. ShadowDomRenderer.prototype.parentNode = function (node) {
  1287. return this.nodeOrShadowRoot(_super.prototype.parentNode.call(this, this.nodeOrShadowRoot(node)));
  1288. };
  1289. return ShadowDomRenderer;
  1290. }(DefaultDomRenderer2));
  1291. /**
  1292. * @license
  1293. * Copyright Google Inc. All Rights Reserved.
  1294. *
  1295. * Use of this source code is governed by an MIT-style license that can be
  1296. * found in the LICENSE file at https://angular.io/license
  1297. */
  1298. var ɵ0$3 = function () { return (typeof Zone !== 'undefined') && Zone['__symbol__'] ||
  1299. function (v) { return '__zone_symbol__' + v; }; };
  1300. /**
  1301. * Detect if Zone is present. If it is then use simple zone aware 'addEventListener'
  1302. * since Angular can do much more
  1303. * efficient bookkeeping than Zone can, because we have additional information. This speeds up
  1304. * addEventListener by 3x.
  1305. */
  1306. var __symbol__ = (ɵ0$3)();
  1307. var ADD_EVENT_LISTENER = __symbol__('addEventListener');
  1308. var REMOVE_EVENT_LISTENER = __symbol__('removeEventListener');
  1309. var symbolNames = {};
  1310. var FALSE = 'FALSE';
  1311. var ANGULAR = 'ANGULAR';
  1312. var NATIVE_ADD_LISTENER = 'addEventListener';
  1313. var NATIVE_REMOVE_LISTENER = 'removeEventListener';
  1314. // use the same symbol string which is used in zone.js
  1315. var stopSymbol = '__zone_symbol__propagationStopped';
  1316. var stopMethodSymbol = '__zone_symbol__stopImmediatePropagation';
  1317. var ɵ1 = function () {
  1318. var blackListedEvents = (typeof Zone !== 'undefined') && Zone[__symbol__('BLACK_LISTED_EVENTS')];
  1319. if (blackListedEvents) {
  1320. var res_1 = {};
  1321. blackListedEvents.forEach(function (eventName) { res_1[eventName] = eventName; });
  1322. return res_1;
  1323. }
  1324. return undefined;
  1325. };
  1326. var blackListedMap = (ɵ1)();
  1327. var isBlackListedEvent = function (eventName) {
  1328. if (!blackListedMap) {
  1329. return false;
  1330. }
  1331. return blackListedMap.hasOwnProperty(eventName);
  1332. };
  1333. // a global listener to handle all dom event,
  1334. // so we do not need to create a closure every time
  1335. var globalListener = function (event) {
  1336. var symbolName = symbolNames[event.type];
  1337. if (!symbolName) {
  1338. return;
  1339. }
  1340. var taskDatas = this[symbolName];
  1341. if (!taskDatas) {
  1342. return;
  1343. }
  1344. var args = [event];
  1345. if (taskDatas.length === 1) {
  1346. // if taskDatas only have one element, just invoke it
  1347. var taskData = taskDatas[0];
  1348. if (taskData.zone !== Zone.current) {
  1349. // only use Zone.run when Zone.current not equals to stored zone
  1350. return taskData.zone.run(taskData.handler, this, args);
  1351. }
  1352. else {
  1353. return taskData.handler.apply(this, args);
  1354. }
  1355. }
  1356. else {
  1357. // copy tasks as a snapshot to avoid event handlers remove
  1358. // itself or others
  1359. var copiedTasks = taskDatas.slice();
  1360. for (var i = 0; i < copiedTasks.length; i++) {
  1361. // if other listener call event.stopImmediatePropagation
  1362. // just break
  1363. if (event[stopSymbol] === true) {
  1364. break;
  1365. }
  1366. var taskData = copiedTasks[i];
  1367. if (taskData.zone !== Zone.current) {
  1368. // only use Zone.run when Zone.current not equals to stored zone
  1369. taskData.zone.run(taskData.handler, this, args);
  1370. }
  1371. else {
  1372. taskData.handler.apply(this, args);
  1373. }
  1374. }
  1375. }
  1376. };
  1377. var DomEventsPlugin = /** @class */ (function (_super) {
  1378. __extends(DomEventsPlugin, _super);
  1379. function DomEventsPlugin(doc, ngZone, platformId) {
  1380. var _this = _super.call(this, doc) || this;
  1381. _this.ngZone = ngZone;
  1382. if (!platformId || !common.isPlatformServer(platformId)) {
  1383. _this.patchEvent();
  1384. }
  1385. return _this;
  1386. }
  1387. DomEventsPlugin.prototype.patchEvent = function () {
  1388. if (typeof Event === 'undefined' || !Event || !Event.prototype) {
  1389. return;
  1390. }
  1391. if (Event.prototype[stopMethodSymbol]) {
  1392. // already patched by zone.js
  1393. return;
  1394. }
  1395. var delegate = Event.prototype[stopMethodSymbol] =
  1396. Event.prototype.stopImmediatePropagation;
  1397. Event.prototype.stopImmediatePropagation = function () {
  1398. if (this) {
  1399. this[stopSymbol] = true;
  1400. }
  1401. // should call native delegate in case
  1402. // in some environment part of the application
  1403. // will not use the patched Event
  1404. delegate && delegate.apply(this, arguments);
  1405. };
  1406. };
  1407. // This plugin should come last in the list of plugins, because it accepts all
  1408. // events.
  1409. DomEventsPlugin.prototype.supports = function (eventName) { return true; };
  1410. DomEventsPlugin.prototype.addEventListener = function (element, eventName, handler) {
  1411. var _this = this;
  1412. var zoneJsLoaded = element[ADD_EVENT_LISTENER];
  1413. var callback = handler;
  1414. // if zonejs is loaded and current zone is not ngZone
  1415. // we keep Zone.current on target for later restoration.
  1416. if (zoneJsLoaded && (!i0.NgZone.isInAngularZone() || isBlackListedEvent(eventName))) {
  1417. var symbolName = symbolNames[eventName];
  1418. if (!symbolName) {
  1419. symbolName = symbolNames[eventName] = __symbol__(ANGULAR + eventName + FALSE);
  1420. }
  1421. var taskDatas = element[symbolName];
  1422. var globalListenerRegistered = taskDatas && taskDatas.length > 0;
  1423. if (!taskDatas) {
  1424. taskDatas = element[symbolName] = [];
  1425. }
  1426. var zone = isBlackListedEvent(eventName) ? Zone.root : Zone.current;
  1427. if (taskDatas.length === 0) {
  1428. taskDatas.push({ zone: zone, handler: callback });
  1429. }
  1430. else {
  1431. var callbackRegistered = false;
  1432. for (var i = 0; i < taskDatas.length; i++) {
  1433. if (taskDatas[i].handler === callback) {
  1434. callbackRegistered = true;
  1435. break;
  1436. }
  1437. }
  1438. if (!callbackRegistered) {
  1439. taskDatas.push({ zone: zone, handler: callback });
  1440. }
  1441. }
  1442. if (!globalListenerRegistered) {
  1443. element[ADD_EVENT_LISTENER](eventName, globalListener, false);
  1444. }
  1445. }
  1446. else {
  1447. element[NATIVE_ADD_LISTENER](eventName, callback, false);
  1448. }
  1449. return function () { return _this.removeEventListener(element, eventName, callback); };
  1450. };
  1451. DomEventsPlugin.prototype.removeEventListener = function (target, eventName, callback) {
  1452. var underlyingRemove = target[REMOVE_EVENT_LISTENER];
  1453. // zone.js not loaded, use native removeEventListener
  1454. if (!underlyingRemove) {
  1455. return target[NATIVE_REMOVE_LISTENER].apply(target, [eventName, callback, false]);
  1456. }
  1457. var symbolName = symbolNames[eventName];
  1458. var taskDatas = symbolName && target[symbolName];
  1459. if (!taskDatas) {
  1460. // addEventListener not using patched version
  1461. // just call native removeEventListener
  1462. return target[NATIVE_REMOVE_LISTENER].apply(target, [eventName, callback, false]);
  1463. }
  1464. // fix issue 20532, should be able to remove
  1465. // listener which was added inside of ngZone
  1466. var found = false;
  1467. for (var i = 0; i < taskDatas.length; i++) {
  1468. // remove listener from taskDatas if the callback equals
  1469. if (taskDatas[i].handler === callback) {
  1470. found = true;
  1471. taskDatas.splice(i, 1);
  1472. break;
  1473. }
  1474. }
  1475. if (found) {
  1476. if (taskDatas.length === 0) {
  1477. // all listeners are removed, we can remove the globalListener from target
  1478. underlyingRemove.apply(target, [eventName, globalListener, false]);
  1479. }
  1480. }
  1481. else {
  1482. // not found in taskDatas, the callback may be added inside of ngZone
  1483. // use native remove listener to remove the callback
  1484. target[NATIVE_REMOVE_LISTENER].apply(target, [eventName, callback, false]);
  1485. }
  1486. };
  1487. DomEventsPlugin = __decorate([
  1488. i0.Injectable(),
  1489. __param(0, i0.Inject(common.DOCUMENT)),
  1490. __param(2, i0.Optional()), __param(2, i0.Inject(i0.PLATFORM_ID)),
  1491. __metadata("design:paramtypes", [Object, i0.NgZone, Object])
  1492. ], DomEventsPlugin);
  1493. return DomEventsPlugin;
  1494. }(EventManagerPlugin));
  1495. /**
  1496. * @license
  1497. * Copyright Google Inc. All Rights Reserved.
  1498. *
  1499. * Use of this source code is governed by an MIT-style license that can be
  1500. * found in the LICENSE file at https://angular.io/license
  1501. */
  1502. /**
  1503. * Supported HammerJS recognizer event names.
  1504. */
  1505. var EVENT_NAMES = {
  1506. // pan
  1507. 'pan': true,
  1508. 'panstart': true,
  1509. 'panmove': true,
  1510. 'panend': true,
  1511. 'pancancel': true,
  1512. 'panleft': true,
  1513. 'panright': true,
  1514. 'panup': true,
  1515. 'pandown': true,
  1516. // pinch
  1517. 'pinch': true,
  1518. 'pinchstart': true,
  1519. 'pinchmove': true,
  1520. 'pinchend': true,
  1521. 'pinchcancel': true,
  1522. 'pinchin': true,
  1523. 'pinchout': true,
  1524. // press
  1525. 'press': true,
  1526. 'pressup': true,
  1527. // rotate
  1528. 'rotate': true,
  1529. 'rotatestart': true,
  1530. 'rotatemove': true,
  1531. 'rotateend': true,
  1532. 'rotatecancel': true,
  1533. // swipe
  1534. 'swipe': true,
  1535. 'swipeleft': true,
  1536. 'swiperight': true,
  1537. 'swipeup': true,
  1538. 'swipedown': true,
  1539. // tap
  1540. 'tap': true,
  1541. };
  1542. /**
  1543. * DI token for providing [HammerJS](http://hammerjs.github.io/) support to Angular.
  1544. * @see `HammerGestureConfig`
  1545. *
  1546. * @publicApi
  1547. */
  1548. var HAMMER_GESTURE_CONFIG = new i0.InjectionToken('HammerGestureConfig');
  1549. /**
  1550. * Injection token used to provide a {@link HammerLoader} to Angular.
  1551. *
  1552. * @publicApi
  1553. */
  1554. var HAMMER_LOADER = new i0.InjectionToken('HammerLoader');
  1555. /**
  1556. * An injectable [HammerJS Manager](http://hammerjs.github.io/api/#hammer.manager)
  1557. * for gesture recognition. Configures specific event recognition.
  1558. * @publicApi
  1559. */
  1560. var HammerGestureConfig = /** @class */ (function () {
  1561. function HammerGestureConfig() {
  1562. /**
  1563. * A set of supported event names for gestures to be used in Angular.
  1564. * Angular supports all built-in recognizers, as listed in
  1565. * [HammerJS documentation](http://hammerjs.github.io/).
  1566. */
  1567. this.events = [];
  1568. /**
  1569. * Maps gesture event names to a set of configuration options
  1570. * that specify overrides to the default values for specific properties.
  1571. *
  1572. * The key is a supported event name to be configured,
  1573. * and the options object contains a set of properties, with override values
  1574. * to be applied to the named recognizer event.
  1575. * For example, to disable recognition of the rotate event, specify
  1576. * `{"rotate": {"enable": false}}`.
  1577. *
  1578. * Properties that are not present take the HammerJS default values.
  1579. * For information about which properties are supported for which events,
  1580. * and their allowed and default values, see
  1581. * [HammerJS documentation](http://hammerjs.github.io/).
  1582. *
  1583. */
  1584. this.overrides = {};
  1585. }
  1586. /**
  1587. * Creates a [HammerJS Manager](http://hammerjs.github.io/api/#hammer.manager)
  1588. * and attaches it to a given HTML element.
  1589. * @param element The element that will recognize gestures.
  1590. * @returns A HammerJS event-manager object.
  1591. */
  1592. HammerGestureConfig.prototype.buildHammer = function (element) {
  1593. var mc = new Hammer(element, this.options);
  1594. mc.get('pinch').set({ enable: true });
  1595. mc.get('rotate').set({ enable: true });
  1596. for (var eventName in this.overrides) {
  1597. mc.get(eventName).set(this.overrides[eventName]);
  1598. }
  1599. return mc;
  1600. };
  1601. HammerGestureConfig = __decorate([
  1602. i0.Injectable()
  1603. ], HammerGestureConfig);
  1604. return HammerGestureConfig;
  1605. }());
  1606. var HammerGesturesPlugin = /** @class */ (function (_super) {
  1607. __extends(HammerGesturesPlugin, _super);
  1608. function HammerGesturesPlugin(doc, _config, console, loader) {
  1609. var _this = _super.call(this, doc) || this;
  1610. _this._config = _config;
  1611. _this.console = console;
  1612. _this.loader = loader;
  1613. return _this;
  1614. }
  1615. HammerGesturesPlugin.prototype.supports = function (eventName) {
  1616. if (!EVENT_NAMES.hasOwnProperty(eventName.toLowerCase()) && !this.isCustomEvent(eventName)) {
  1617. return false;
  1618. }
  1619. if (!window.Hammer && !this.loader) {
  1620. this.console.warn("The \"" + eventName + "\" event cannot be bound because Hammer.JS is not " +
  1621. "loaded and no custom loader has been specified.");
  1622. return false;
  1623. }
  1624. return true;
  1625. };
  1626. HammerGesturesPlugin.prototype.addEventListener = function (element, eventName, handler) {
  1627. var _this = this;
  1628. var zone = this.manager.getZone();
  1629. eventName = eventName.toLowerCase();
  1630. // If Hammer is not present but a loader is specified, we defer adding the event listener
  1631. // until Hammer is loaded.
  1632. if (!window.Hammer && this.loader) {
  1633. // This `addEventListener` method returns a function to remove the added listener.
  1634. // Until Hammer is loaded, the returned function needs to *cancel* the registration rather
  1635. // than remove anything.
  1636. var cancelRegistration_1 = false;
  1637. var deregister_1 = function () { cancelRegistration_1 = true; };
  1638. this.loader()
  1639. .then(function () {
  1640. // If Hammer isn't actually loaded when the custom loader resolves, give up.
  1641. if (!window.Hammer) {
  1642. _this.console.warn("The custom HAMMER_LOADER completed, but Hammer.JS is not present.");
  1643. deregister_1 = function () { };
  1644. return;
  1645. }
  1646. if (!cancelRegistration_1) {
  1647. // Now that Hammer is loaded and the listener is being loaded for real,
  1648. // the deregistration function changes from canceling registration to removal.
  1649. deregister_1 = _this.addEventListener(element, eventName, handler);
  1650. }
  1651. })
  1652. .catch(function () {
  1653. _this.console.warn("The \"" + eventName + "\" event cannot be bound because the custom " +
  1654. "Hammer.JS loader failed.");
  1655. deregister_1 = function () { };
  1656. });
  1657. // Return a function that *executes* `deregister` (and not `deregister` itself) so that we
  1658. // can change the behavior of `deregister` once the listener is added. Using a closure in
  1659. // this way allows us to avoid any additional data structures to track listener removal.
  1660. return function () { deregister_1(); };
  1661. }
  1662. return zone.runOutsideAngular(function () {
  1663. // Creating the manager bind events, must be done outside of angular
  1664. var mc = _this._config.buildHammer(element);
  1665. var callback = function (eventObj) {
  1666. zone.runGuarded(function () { handler(eventObj); });
  1667. };
  1668. mc.on(eventName, callback);
  1669. return function () {
  1670. mc.off(eventName, callback);
  1671. // destroy mc to prevent memory leak
  1672. if (typeof mc.destroy === 'function') {
  1673. mc.destroy();
  1674. }
  1675. };
  1676. });
  1677. };
  1678. HammerGesturesPlugin.prototype.isCustomEvent = function (eventName) { return this._config.events.indexOf(eventName) > -1; };
  1679. HammerGesturesPlugin = __decorate([
  1680. i0.Injectable(),
  1681. __param(0, i0.Inject(common.DOCUMENT)),
  1682. __param(1, i0.Inject(HAMMER_GESTURE_CONFIG)),
  1683. __param(3, i0.Optional()), __param(3, i0.Inject(HAMMER_LOADER)),
  1684. __metadata("design:paramtypes", [Object, HammerGestureConfig, i0.ɵConsole, Object])
  1685. ], HammerGesturesPlugin);
  1686. return HammerGesturesPlugin;
  1687. }(EventManagerPlugin));
  1688. /**
  1689. * @license
  1690. * Copyright Google Inc. All Rights Reserved.
  1691. *
  1692. * Use of this source code is governed by an MIT-style license that can be
  1693. * found in the LICENSE file at https://angular.io/license
  1694. */
  1695. /**
  1696. * Defines supported modifiers for key events.
  1697. */
  1698. var MODIFIER_KEYS = ['alt', 'control', 'meta', 'shift'];
  1699. var ɵ0$4 = function (event) { return event.altKey; }, ɵ1$1 = function (event) { return event.ctrlKey; }, ɵ2 = function (event) { return event.metaKey; }, ɵ3 = function (event) { return event.shiftKey; };
  1700. /**
  1701. * Retrieves modifiers from key-event objects.
  1702. */
  1703. var MODIFIER_KEY_GETTERS = {
  1704. 'alt': ɵ0$4,
  1705. 'control': ɵ1$1,
  1706. 'meta': ɵ2,
  1707. 'shift': ɵ3
  1708. };
  1709. /**
  1710. * @publicApi
  1711. * A browser plug-in that provides support for handling of key events in Angular.
  1712. */
  1713. var KeyEventsPlugin = /** @class */ (function (_super) {
  1714. __extends(KeyEventsPlugin, _super);
  1715. /**
  1716. * Initializes an instance of the browser plug-in.
  1717. * @param doc The document in which key events will be detected.
  1718. */
  1719. function KeyEventsPlugin(doc) {
  1720. return _super.call(this, doc) || this;
  1721. }
  1722. KeyEventsPlugin_1 = KeyEventsPlugin;
  1723. /**
  1724. * Reports whether a named key event is supported.
  1725. * @param eventName The event name to query.
  1726. * @return True if the named key event is supported.
  1727. */
  1728. KeyEventsPlugin.prototype.supports = function (eventName) { return KeyEventsPlugin_1.parseEventName(eventName) != null; };
  1729. /**
  1730. * Registers a handler for a specific element and key event.
  1731. * @param element The HTML element to receive event notifications.
  1732. * @param eventName The name of the key event to listen for.
  1733. * @param handler A function to call when the notification occurs. Receives the
  1734. * event object as an argument.
  1735. * @returns The key event that was registered.
  1736. */
  1737. KeyEventsPlugin.prototype.addEventListener = function (element, eventName, handler) {
  1738. var parsedEvent = KeyEventsPlugin_1.parseEventName(eventName);
  1739. var outsideHandler = KeyEventsPlugin_1.eventCallback(parsedEvent['fullKey'], handler, this.manager.getZone());
  1740. return this.manager.getZone().runOutsideAngular(function () {
  1741. return getDOM().onAndCancel(element, parsedEvent['domEventName'], outsideHandler);
  1742. });
  1743. };
  1744. KeyEventsPlugin.parseEventName = function (eventName) {
  1745. var parts = eventName.toLowerCase().split('.');
  1746. var domEventName = parts.shift();
  1747. if ((parts.length === 0) || !(domEventName === 'keydown' || domEventName === 'keyup')) {
  1748. return null;
  1749. }
  1750. var key = KeyEventsPlugin_1._normalizeKey(parts.pop());
  1751. var fullKey = '';
  1752. MODIFIER_KEYS.forEach(function (modifierName) {
  1753. var index = parts.indexOf(modifierName);
  1754. if (index > -1) {
  1755. parts.splice(index, 1);
  1756. fullKey += modifierName + '.';
  1757. }
  1758. });
  1759. fullKey += key;
  1760. if (parts.length != 0 || key.length === 0) {
  1761. // returning null instead of throwing to let another plugin process the event
  1762. return null;
  1763. }
  1764. var result = {};
  1765. result['domEventName'] = domEventName;
  1766. result['fullKey'] = fullKey;
  1767. return result;
  1768. };
  1769. KeyEventsPlugin.getEventFullKey = function (event) {
  1770. var fullKey = '';
  1771. var key = getDOM().getEventKey(event);
  1772. key = key.toLowerCase();
  1773. if (key === ' ') {
  1774. key = 'space'; // for readability
  1775. }
  1776. else if (key === '.') {
  1777. key = 'dot'; // because '.' is used as a separator in event names
  1778. }
  1779. MODIFIER_KEYS.forEach(function (modifierName) {
  1780. if (modifierName != key) {
  1781. var modifierGetter = MODIFIER_KEY_GETTERS[modifierName];
  1782. if (modifierGetter(event)) {
  1783. fullKey += modifierName + '.';
  1784. }
  1785. }
  1786. });
  1787. fullKey += key;
  1788. return fullKey;
  1789. };
  1790. /**
  1791. * Configures a handler callback for a key event.
  1792. * @param fullKey The event name that combines all simultaneous keystrokes.
  1793. * @param handler The function that responds to the key event.
  1794. * @param zone The zone in which the event occurred.
  1795. * @returns A callback function.
  1796. */
  1797. KeyEventsPlugin.eventCallback = function (fullKey, handler, zone) {
  1798. return function (event /** TODO #9100 */) {
  1799. if (KeyEventsPlugin_1.getEventFullKey(event) === fullKey) {
  1800. zone.runGuarded(function () { return handler(event); });
  1801. }
  1802. };
  1803. };
  1804. /** @internal */
  1805. KeyEventsPlugin._normalizeKey = function (keyName) {
  1806. // TODO: switch to a Map if the mapping grows too much
  1807. switch (keyName) {
  1808. case 'esc':
  1809. return 'escape';
  1810. default:
  1811. return keyName;
  1812. }
  1813. };
  1814. var KeyEventsPlugin_1;
  1815. KeyEventsPlugin = KeyEventsPlugin_1 = __decorate([
  1816. i0.Injectable(),
  1817. __param(0, i0.Inject(common.DOCUMENT)),
  1818. __metadata("design:paramtypes", [Object])
  1819. ], KeyEventsPlugin);
  1820. return KeyEventsPlugin;
  1821. }(EventManagerPlugin));
  1822. /**
  1823. * @license
  1824. * Copyright Google Inc. All Rights Reserved.
  1825. *
  1826. * Use of this source code is governed by an MIT-style license that can be
  1827. * found in the LICENSE file at https://angular.io/license
  1828. */
  1829. /**
  1830. * DomSanitizer helps preventing Cross Site Scripting Security bugs (XSS) by sanitizing
  1831. * values to be safe to use in the different DOM contexts.
  1832. *
  1833. * For example, when binding a URL in an `<a [href]="someValue">` hyperlink, `someValue` will be
  1834. * sanitized so that an attacker cannot inject e.g. a `javascript:` URL that would execute code on
  1835. * the website.
  1836. *
  1837. * In specific situations, it might be necessary to disable sanitization, for example if the
  1838. * application genuinely needs to produce a `javascript:` style link with a dynamic value in it.
  1839. * Users can bypass security by constructing a value with one of the `bypassSecurityTrust...`
  1840. * methods, and then binding to that value from the template.
  1841. *
  1842. * These situations should be very rare, and extraordinary care must be taken to avoid creating a
  1843. * Cross Site Scripting (XSS) security bug!
  1844. *
  1845. * When using `bypassSecurityTrust...`, make sure to call the method as early as possible and as
  1846. * close as possible to the source of the value, to make it easy to verify no security bug is
  1847. * created by its use.
  1848. *
  1849. * It is not required (and not recommended) to bypass security if the value is safe, e.g. a URL that
  1850. * does not start with a suspicious protocol, or an HTML snippet that does not contain dangerous
  1851. * code. The sanitizer leaves safe values intact.
  1852. *
  1853. * @security Calling any of the `bypassSecurityTrust...` APIs disables Angular's built-in
  1854. * sanitization for the value passed in. Carefully check and audit all values and code paths going
  1855. * into this call. Make sure any user data is appropriately escaped for this security context.
  1856. * For more detail, see the [Security Guide](http://g.co/ng/security).
  1857. *
  1858. * @publicApi
  1859. */
  1860. var DomSanitizer = /** @class */ (function () {
  1861. function DomSanitizer() {
  1862. }
  1863. return DomSanitizer;
  1864. }());
  1865. var DomSanitizerImpl = /** @class */ (function (_super) {
  1866. __extends(DomSanitizerImpl, _super);
  1867. function DomSanitizerImpl(_doc) {
  1868. var _this = _super.call(this) || this;
  1869. _this._doc = _doc;
  1870. return _this;
  1871. }
  1872. DomSanitizerImpl.prototype.sanitize = function (ctx, value) {
  1873. if (value == null)
  1874. return null;
  1875. switch (ctx) {
  1876. case i0.SecurityContext.NONE:
  1877. return value;
  1878. case i0.SecurityContext.HTML:
  1879. if (value instanceof SafeHtmlImpl)
  1880. return value.changingThisBreaksApplicationSecurity;
  1881. this.checkNotSafeValue(value, 'HTML');
  1882. return i0.ɵ_sanitizeHtml(this._doc, String(value));
  1883. case i0.SecurityContext.STYLE:
  1884. if (value instanceof SafeStyleImpl)
  1885. return value.changingThisBreaksApplicationSecurity;
  1886. this.checkNotSafeValue(value, 'Style');
  1887. return i0.ɵ_sanitizeStyle(value);
  1888. case i0.SecurityContext.SCRIPT:
  1889. if (value instanceof SafeScriptImpl)
  1890. return value.changingThisBreaksApplicationSecurity;
  1891. this.checkNotSafeValue(value, 'Script');
  1892. throw new Error('unsafe value used in a script context');
  1893. case i0.SecurityContext.URL:
  1894. if (value instanceof SafeResourceUrlImpl || value instanceof SafeUrlImpl) {
  1895. // Allow resource URLs in URL contexts, they are strictly more trusted.
  1896. return value.changingThisBreaksApplicationSecurity;
  1897. }
  1898. this.checkNotSafeValue(value, 'URL');
  1899. return i0.ɵ_sanitizeUrl(String(value));
  1900. case i0.SecurityContext.RESOURCE_URL:
  1901. if (value instanceof SafeResourceUrlImpl) {
  1902. return value.changingThisBreaksApplicationSecurity;
  1903. }
  1904. this.checkNotSafeValue(value, 'ResourceURL');
  1905. throw new Error('unsafe value used in a resource URL context (see http://g.co/ng/security#xss)');
  1906. default:
  1907. throw new Error("Unexpected SecurityContext " + ctx + " (see http://g.co/ng/security#xss)");
  1908. }
  1909. };
  1910. DomSanitizerImpl.prototype.checkNotSafeValue = function (value, expectedType) {
  1911. if (value instanceof SafeValueImpl) {
  1912. throw new Error("Required a safe " + expectedType + ", got a " + value.getTypeName() + " " +
  1913. "(see http://g.co/ng/security#xss)");
  1914. }
  1915. };
  1916. DomSanitizerImpl.prototype.bypassSecurityTrustHtml = function (value) { return new SafeHtmlImpl(value); };
  1917. DomSanitizerImpl.prototype.bypassSecurityTrustStyle = function (value) { return new SafeStyleImpl(value); };
  1918. DomSanitizerImpl.prototype.bypassSecurityTrustScript = function (value) { return new SafeScriptImpl(value); };
  1919. DomSanitizerImpl.prototype.bypassSecurityTrustUrl = function (value) { return new SafeUrlImpl(value); };
  1920. DomSanitizerImpl.prototype.bypassSecurityTrustResourceUrl = function (value) {
  1921. return new SafeResourceUrlImpl(value);
  1922. };
  1923. DomSanitizerImpl = __decorate([
  1924. i0.Injectable(),
  1925. __param(0, i0.Inject(common.DOCUMENT)),
  1926. __metadata("design:paramtypes", [Object])
  1927. ], DomSanitizerImpl);
  1928. return DomSanitizerImpl;
  1929. }(DomSanitizer));
  1930. var SafeValueImpl = /** @class */ (function () {
  1931. function SafeValueImpl(changingThisBreaksApplicationSecurity) {
  1932. this.changingThisBreaksApplicationSecurity = changingThisBreaksApplicationSecurity;
  1933. // empty
  1934. }
  1935. SafeValueImpl.prototype.toString = function () {
  1936. return "SafeValue must use [property]=binding: " + this.changingThisBreaksApplicationSecurity +
  1937. " (see http://g.co/ng/security#xss)";
  1938. };
  1939. return SafeValueImpl;
  1940. }());
  1941. var SafeHtmlImpl = /** @class */ (function (_super) {
  1942. __extends(SafeHtmlImpl, _super);
  1943. function SafeHtmlImpl() {
  1944. return _super !== null && _super.apply(this, arguments) || this;
  1945. }
  1946. SafeHtmlImpl.prototype.getTypeName = function () { return 'HTML'; };
  1947. return SafeHtmlImpl;
  1948. }(SafeValueImpl));
  1949. var SafeStyleImpl = /** @class */ (function (_super) {
  1950. __extends(SafeStyleImpl, _super);
  1951. function SafeStyleImpl() {
  1952. return _super !== null && _super.apply(this, arguments) || this;
  1953. }
  1954. SafeStyleImpl.prototype.getTypeName = function () { return 'Style'; };
  1955. return SafeStyleImpl;
  1956. }(SafeValueImpl));
  1957. var SafeScriptImpl = /** @class */ (function (_super) {
  1958. __extends(SafeScriptImpl, _super);
  1959. function SafeScriptImpl() {
  1960. return _super !== null && _super.apply(this, arguments) || this;
  1961. }
  1962. SafeScriptImpl.prototype.getTypeName = function () { return 'Script'; };
  1963. return SafeScriptImpl;
  1964. }(SafeValueImpl));
  1965. var SafeUrlImpl = /** @class */ (function (_super) {
  1966. __extends(SafeUrlImpl, _super);
  1967. function SafeUrlImpl() {
  1968. return _super !== null && _super.apply(this, arguments) || this;
  1969. }
  1970. SafeUrlImpl.prototype.getTypeName = function () { return 'URL'; };
  1971. return SafeUrlImpl;
  1972. }(SafeValueImpl));
  1973. var SafeResourceUrlImpl = /** @class */ (function (_super) {
  1974. __extends(SafeResourceUrlImpl, _super);
  1975. function SafeResourceUrlImpl() {
  1976. return _super !== null && _super.apply(this, arguments) || this;
  1977. }
  1978. SafeResourceUrlImpl.prototype.getTypeName = function () { return 'ResourceURL'; };
  1979. return SafeResourceUrlImpl;
  1980. }(SafeValueImpl));
  1981. /**
  1982. * @license
  1983. * Copyright Google Inc. All Rights Reserved.
  1984. *
  1985. * Use of this source code is governed by an MIT-style license that can be
  1986. * found in the LICENSE file at https://angular.io/license
  1987. */
  1988. var ɵ0$5 = common.ɵPLATFORM_BROWSER_ID;
  1989. var INTERNAL_BROWSER_PLATFORM_PROVIDERS = [
  1990. { provide: i0.PLATFORM_ID, useValue: ɵ0$5 },
  1991. { provide: i0.PLATFORM_INITIALIZER, useValue: initDomAdapter, multi: true },
  1992. { provide: common.PlatformLocation, useClass: BrowserPlatformLocation, deps: [common.DOCUMENT] },
  1993. { provide: common.DOCUMENT, useFactory: _document, deps: [] },
  1994. ];
  1995. /**
  1996. * @security Replacing built-in sanitization providers exposes the application to XSS risks.
  1997. * Attacker-controlled data introduced by an unsanitized provider could expose your
  1998. * application to XSS risks. For more detail, see the [Security Guide](http://g.co/ng/security).
  1999. * @publicApi
  2000. */
  2001. var BROWSER_SANITIZATION_PROVIDERS = [
  2002. { provide: i0.Sanitizer, useExisting: DomSanitizer },
  2003. { provide: DomSanitizer, useClass: DomSanitizerImpl, deps: [common.DOCUMENT] },
  2004. ];
  2005. /**
  2006. * @publicApi
  2007. */
  2008. var platformBrowser = i0.createPlatformFactory(i0.platformCore, 'browser', INTERNAL_BROWSER_PLATFORM_PROVIDERS);
  2009. function initDomAdapter() {
  2010. BrowserDomAdapter.makeCurrent();
  2011. BrowserGetTestability.init();
  2012. }
  2013. function errorHandler() {
  2014. return new i0.ErrorHandler();
  2015. }
  2016. function _document() {
  2017. return document;
  2018. }
  2019. var BROWSER_MODULE_PROVIDERS = [
  2020. BROWSER_SANITIZATION_PROVIDERS,
  2021. { provide: i0.ɵAPP_ROOT, useValue: true },
  2022. { provide: i0.ErrorHandler, useFactory: errorHandler, deps: [] },
  2023. {
  2024. provide: EVENT_MANAGER_PLUGINS,
  2025. useClass: DomEventsPlugin,
  2026. multi: true,
  2027. deps: [common.DOCUMENT, i0.NgZone, i0.PLATFORM_ID]
  2028. },
  2029. { provide: EVENT_MANAGER_PLUGINS, useClass: KeyEventsPlugin, multi: true, deps: [common.DOCUMENT] },
  2030. {
  2031. provide: EVENT_MANAGER_PLUGINS,
  2032. useClass: HammerGesturesPlugin,
  2033. multi: true,
  2034. deps: [common.DOCUMENT, HAMMER_GESTURE_CONFIG, i0.ɵConsole, [new i0.Optional(), HAMMER_LOADER]]
  2035. },
  2036. { provide: HAMMER_GESTURE_CONFIG, useClass: HammerGestureConfig, deps: [] },
  2037. {
  2038. provide: DomRendererFactory2,
  2039. useClass: DomRendererFactory2,
  2040. deps: [EventManager, DomSharedStylesHost, i0.APP_ID]
  2041. },
  2042. { provide: i0.RendererFactory2, useExisting: DomRendererFactory2 },
  2043. { provide: SharedStylesHost, useExisting: DomSharedStylesHost },
  2044. { provide: DomSharedStylesHost, useClass: DomSharedStylesHost, deps: [common.DOCUMENT] },
  2045. { provide: i0.Testability, useClass: i0.Testability, deps: [i0.NgZone] },
  2046. { provide: EventManager, useClass: EventManager, deps: [EVENT_MANAGER_PLUGINS, i0.NgZone] },
  2047. ELEMENT_PROBE_PROVIDERS,
  2048. ];
  2049. /**
  2050. * Exports required infrastructure for all Angular apps.
  2051. * Included by default in all Angular apps created with the CLI
  2052. * `new` command.
  2053. * Re-exports `CommonModule` and `ApplicationModule`, making their
  2054. * exports and providers available to all apps.
  2055. *
  2056. * @publicApi
  2057. */
  2058. var BrowserModule = /** @class */ (function () {
  2059. function BrowserModule(parentModule) {
  2060. if (parentModule) {
  2061. throw new Error("BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.");
  2062. }
  2063. }
  2064. BrowserModule_1 = BrowserModule;
  2065. /**
  2066. * Configures a browser-based app to transition from a server-rendered app, if
  2067. * one is present on the page.
  2068. *
  2069. * @param params An object containing an identifier for the app to transition.
  2070. * The ID must match between the client and server versions of the app.
  2071. * @returns The reconfigured `BrowserModule` to import into the app's root `AppModule`.
  2072. */
  2073. BrowserModule.withServerTransition = function (params) {
  2074. return {
  2075. ngModule: BrowserModule_1,
  2076. providers: [
  2077. { provide: i0.APP_ID, useValue: params.appId },
  2078. { provide: TRANSITION_ID, useExisting: i0.APP_ID },
  2079. SERVER_TRANSITION_PROVIDERS,
  2080. ],
  2081. };
  2082. };
  2083. var BrowserModule_1;
  2084. BrowserModule = BrowserModule_1 = __decorate([
  2085. i0.NgModule({ providers: BROWSER_MODULE_PROVIDERS, exports: [common.CommonModule, i0.ApplicationModule] }),
  2086. __param(0, i0.Optional()), __param(0, i0.SkipSelf()), __param(0, i0.Inject(BrowserModule_1)),
  2087. __metadata("design:paramtypes", [Object])
  2088. ], BrowserModule);
  2089. return BrowserModule;
  2090. }());
  2091. /**
  2092. * Factory to create Meta service.
  2093. */
  2094. function createMeta() {
  2095. return new Meta(i0.ɵɵinject(common.DOCUMENT));
  2096. }
  2097. /**
  2098. * A service that can be used to get and add meta tags.
  2099. *
  2100. * @publicApi
  2101. */
  2102. var Meta = /** @class */ (function () {
  2103. function Meta(_doc) {
  2104. this._doc = _doc;
  2105. this._dom = getDOM();
  2106. }
  2107. Meta.prototype.addTag = function (tag, forceCreation) {
  2108. if (forceCreation === void 0) { forceCreation = false; }
  2109. if (!tag)
  2110. return null;
  2111. return this._getOrCreateElement(tag, forceCreation);
  2112. };
  2113. Meta.prototype.addTags = function (tags, forceCreation) {
  2114. var _this = this;
  2115. if (forceCreation === void 0) { forceCreation = false; }
  2116. if (!tags)
  2117. return [];
  2118. return tags.reduce(function (result, tag) {
  2119. if (tag) {
  2120. result.push(_this._getOrCreateElement(tag, forceCreation));
  2121. }
  2122. return result;
  2123. }, []);
  2124. };
  2125. Meta.prototype.getTag = function (attrSelector) {
  2126. if (!attrSelector)
  2127. return null;
  2128. return this._dom.querySelector(this._doc, "meta[" + attrSelector + "]") || null;
  2129. };
  2130. Meta.prototype.getTags = function (attrSelector) {
  2131. if (!attrSelector)
  2132. return [];
  2133. var list /*NodeList*/ = this._dom.querySelectorAll(this._doc, "meta[" + attrSelector + "]");
  2134. return list ? [].slice.call(list) : [];
  2135. };
  2136. Meta.prototype.updateTag = function (tag, selector) {
  2137. if (!tag)
  2138. return null;
  2139. selector = selector || this._parseSelector(tag);
  2140. var meta = this.getTag(selector);
  2141. if (meta) {
  2142. return this._setMetaElementAttributes(tag, meta);
  2143. }
  2144. return this._getOrCreateElement(tag, true);
  2145. };
  2146. Meta.prototype.removeTag = function (attrSelector) { this.removeTagElement(this.getTag(attrSelector)); };
  2147. Meta.prototype.removeTagElement = function (meta) {
  2148. if (meta) {
  2149. this._dom.remove(meta);
  2150. }
  2151. };
  2152. Meta.prototype._getOrCreateElement = function (meta, forceCreation) {
  2153. if (forceCreation === void 0) { forceCreation = false; }
  2154. if (!forceCreation) {
  2155. var selector = this._parseSelector(meta);
  2156. var elem = this.getTag(selector);
  2157. // It's allowed to have multiple elements with the same name so it's not enough to
  2158. // just check that element with the same name already present on the page. We also need to
  2159. // check if element has tag attributes
  2160. if (elem && this._containsAttributes(meta, elem))
  2161. return elem;
  2162. }
  2163. var element = this._dom.createElement('meta');
  2164. this._setMetaElementAttributes(meta, element);
  2165. var head = this._dom.getElementsByTagName(this._doc, 'head')[0];
  2166. this._dom.appendChild(head, element);
  2167. return element;
  2168. };
  2169. Meta.prototype._setMetaElementAttributes = function (tag, el) {
  2170. var _this = this;
  2171. Object.keys(tag).forEach(function (prop) { return _this._dom.setAttribute(el, prop, tag[prop]); });
  2172. return el;
  2173. };
  2174. Meta.prototype._parseSelector = function (tag) {
  2175. var attr = tag.name ? 'name' : 'property';
  2176. return attr + "=\"" + tag[attr] + "\"";
  2177. };
  2178. Meta.prototype._containsAttributes = function (tag, elem) {
  2179. var _this = this;
  2180. return Object.keys(tag).every(function (key) { return _this._dom.getAttribute(elem, key) === tag[key]; });
  2181. };
  2182. Meta.ngInjectableDef = i0.ɵɵdefineInjectable({ factory: createMeta, token: Meta, providedIn: "root" });
  2183. Meta = __decorate([
  2184. i0.Injectable({ providedIn: 'root', useFactory: createMeta, deps: [] }),
  2185. __param(0, i0.Inject(common.DOCUMENT)),
  2186. __metadata("design:paramtypes", [Object])
  2187. ], Meta);
  2188. return Meta;
  2189. }());
  2190. /**
  2191. * Factory to create Title service.
  2192. */
  2193. function createTitle() {
  2194. return new Title(i0.ɵɵinject(common.DOCUMENT));
  2195. }
  2196. /**
  2197. * A service that can be used to get and set the title of a current HTML document.
  2198. *
  2199. * Since an Angular application can't be bootstrapped on the entire HTML document (`<html>` tag)
  2200. * it is not possible to bind to the `text` property of the `HTMLTitleElement` elements
  2201. * (representing the `<title>` tag). Instead, this service can be used to set and get the current
  2202. * title value.
  2203. *
  2204. * @publicApi
  2205. */
  2206. var Title = /** @class */ (function () {
  2207. function Title(_doc) {
  2208. this._doc = _doc;
  2209. }
  2210. /**
  2211. * Get the title of the current HTML document.
  2212. */
  2213. Title.prototype.getTitle = function () { return getDOM().getTitle(this._doc); };
  2214. /**
  2215. * Set the title of the current HTML document.
  2216. * @param newTitle
  2217. */
  2218. Title.prototype.setTitle = function (newTitle) { getDOM().setTitle(this._doc, newTitle); };
  2219. Title.ngInjectableDef = i0.ɵɵdefineInjectable({ factory: createTitle, token: Title, providedIn: "root" });
  2220. Title = __decorate([
  2221. i0.Injectable({ providedIn: 'root', useFactory: createTitle, deps: [] }),
  2222. __param(0, i0.Inject(common.DOCUMENT)),
  2223. __metadata("design:paramtypes", [Object])
  2224. ], Title);
  2225. return Title;
  2226. }());
  2227. /**
  2228. * @license
  2229. * Copyright Google Inc. All Rights Reserved.
  2230. *
  2231. * Use of this source code is governed by an MIT-style license that can be
  2232. * found in the LICENSE file at https://angular.io/license
  2233. */
  2234. var win = typeof window !== 'undefined' && window || {};
  2235. /**
  2236. * @license
  2237. * Copyright Google Inc. All Rights Reserved.
  2238. *
  2239. * Use of this source code is governed by an MIT-style license that can be
  2240. * found in the LICENSE file at https://angular.io/license
  2241. */
  2242. var ChangeDetectionPerfRecord = /** @class */ (function () {
  2243. function ChangeDetectionPerfRecord(msPerTick, numTicks) {
  2244. this.msPerTick = msPerTick;
  2245. this.numTicks = numTicks;
  2246. }
  2247. return ChangeDetectionPerfRecord;
  2248. }());
  2249. /**
  2250. * Entry point for all Angular profiling-related debug tools. This object
  2251. * corresponds to the `ng.profiler` in the dev console.
  2252. */
  2253. var AngularProfiler = /** @class */ (function () {
  2254. function AngularProfiler(ref) {
  2255. this.appRef = ref.injector.get(i0.ApplicationRef);
  2256. }
  2257. // tslint:disable:no-console
  2258. /**
  2259. * Exercises change detection in a loop and then prints the average amount of
  2260. * time in milliseconds how long a single round of change detection takes for
  2261. * the current state of the UI. It runs a minimum of 5 rounds for a minimum
  2262. * of 500 milliseconds.
  2263. *
  2264. * Optionally, a user may pass a `config` parameter containing a map of
  2265. * options. Supported options are:
  2266. *
  2267. * `record` (boolean) - causes the profiler to record a CPU profile while
  2268. * it exercises the change detector. Example:
  2269. *
  2270. * ```
  2271. * ng.profiler.timeChangeDetection({record: true})
  2272. * ```
  2273. */
  2274. AngularProfiler.prototype.timeChangeDetection = function (config) {
  2275. var record = config && config['record'];
  2276. var profileName = 'Change Detection';
  2277. // Profiler is not available in Android browsers, nor in IE 9 without dev tools opened
  2278. var isProfilerAvailable = win.console.profile != null;
  2279. if (record && isProfilerAvailable) {
  2280. win.console.profile(profileName);
  2281. }
  2282. var start = getDOM().performanceNow();
  2283. var numTicks = 0;
  2284. while (numTicks < 5 || (getDOM().performanceNow() - start) < 500) {
  2285. this.appRef.tick();
  2286. numTicks++;
  2287. }
  2288. var end = getDOM().performanceNow();
  2289. if (record && isProfilerAvailable) {
  2290. win.console.profileEnd(profileName);
  2291. }
  2292. var msPerTick = (end - start) / numTicks;
  2293. win.console.log("ran " + numTicks + " change detection cycles");
  2294. win.console.log(msPerTick.toFixed(2) + " ms per check");
  2295. return new ChangeDetectionPerfRecord(msPerTick, numTicks);
  2296. };
  2297. return AngularProfiler;
  2298. }());
  2299. /**
  2300. * @license
  2301. * Copyright Google Inc. All Rights Reserved.
  2302. *
  2303. * Use of this source code is governed by an MIT-style license that can be
  2304. * found in the LICENSE file at https://angular.io/license
  2305. */
  2306. var PROFILER_GLOBAL_NAME = 'profiler';
  2307. /**
  2308. * Enabled Angular debug tools that are accessible via your browser's
  2309. * developer console.
  2310. *
  2311. * Usage:
  2312. *
  2313. * 1. Open developer console (e.g. in Chrome Ctrl + Shift + j)
  2314. * 1. Type `ng.` (usually the console will show auto-complete suggestion)
  2315. * 1. Try the change detection profiler `ng.profiler.timeChangeDetection()`
  2316. * then hit Enter.
  2317. *
  2318. * @publicApi
  2319. */
  2320. function enableDebugTools(ref) {
  2321. exportNgVar(PROFILER_GLOBAL_NAME, new AngularProfiler(ref));
  2322. return ref;
  2323. }
  2324. /**
  2325. * Disables Angular tools.
  2326. *
  2327. * @publicApi
  2328. */
  2329. function disableDebugTools() {
  2330. exportNgVar(PROFILER_GLOBAL_NAME, null);
  2331. }
  2332. /**
  2333. * @license
  2334. * Copyright Google Inc. All Rights Reserved.
  2335. *
  2336. * Use of this source code is governed by an MIT-style license that can be
  2337. * found in the LICENSE file at https://angular.io/license
  2338. */
  2339. function escapeHtml(text) {
  2340. var escapedText = {
  2341. '&': '&a;',
  2342. '"': '&q;',
  2343. '\'': '&s;',
  2344. '<': '&l;',
  2345. '>': '&g;',
  2346. };
  2347. return text.replace(/[&"'<>]/g, function (s) { return escapedText[s]; });
  2348. }
  2349. function unescapeHtml(text) {
  2350. var unescapedText = {
  2351. '&a;': '&',
  2352. '&q;': '"',
  2353. '&s;': '\'',
  2354. '&l;': '<',
  2355. '&g;': '>',
  2356. };
  2357. return text.replace(/&[^;]+;/g, function (s) { return unescapedText[s]; });
  2358. }
  2359. /**
  2360. * Create a `StateKey<T>` that can be used to store value of type T with `TransferState`.
  2361. *
  2362. * Example:
  2363. *
  2364. * ```
  2365. * const COUNTER_KEY = makeStateKey<number>('counter');
  2366. * let value = 10;
  2367. *
  2368. * transferState.set(COUNTER_KEY, value);
  2369. * ```
  2370. *
  2371. * @publicApi
  2372. */
  2373. function makeStateKey(key) {
  2374. return key;
  2375. }
  2376. /**
  2377. * A key value store that is transferred from the application on the server side to the application
  2378. * on the client side.
  2379. *
  2380. * `TransferState` will be available as an injectable token. To use it import
  2381. * `ServerTransferStateModule` on the server and `BrowserTransferStateModule` on the client.
  2382. *
  2383. * The values in the store are serialized/deserialized using JSON.stringify/JSON.parse. So only
  2384. * boolean, number, string, null and non-class objects will be serialized and deserialzied in a
  2385. * non-lossy manner.
  2386. *
  2387. * @publicApi
  2388. */
  2389. var TransferState = /** @class */ (function () {
  2390. function TransferState() {
  2391. this.store = {};
  2392. this.onSerializeCallbacks = {};
  2393. }
  2394. TransferState_1 = TransferState;
  2395. /** @internal */
  2396. TransferState.init = function (initState) {
  2397. var transferState = new TransferState_1();
  2398. transferState.store = initState;
  2399. return transferState;
  2400. };
  2401. /**
  2402. * Get the value corresponding to a key. Return `defaultValue` if key is not found.
  2403. */
  2404. TransferState.prototype.get = function (key, defaultValue) {
  2405. return this.store[key] !== undefined ? this.store[key] : defaultValue;
  2406. };
  2407. /**
  2408. * Set the value corresponding to a key.
  2409. */
  2410. TransferState.prototype.set = function (key, value) { this.store[key] = value; };
  2411. /**
  2412. * Remove a key from the store.
  2413. */
  2414. TransferState.prototype.remove = function (key) { delete this.store[key]; };
  2415. /**
  2416. * Test whether a key exists in the store.
  2417. */
  2418. TransferState.prototype.hasKey = function (key) { return this.store.hasOwnProperty(key); };
  2419. /**
  2420. * Register a callback to provide the value for a key when `toJson` is called.
  2421. */
  2422. TransferState.prototype.onSerialize = function (key, callback) {
  2423. this.onSerializeCallbacks[key] = callback;
  2424. };
  2425. /**
  2426. * Serialize the current state of the store to JSON.
  2427. */
  2428. TransferState.prototype.toJson = function () {
  2429. // Call the onSerialize callbacks and put those values into the store.
  2430. for (var key in this.onSerializeCallbacks) {
  2431. if (this.onSerializeCallbacks.hasOwnProperty(key)) {
  2432. try {
  2433. this.store[key] = this.onSerializeCallbacks[key]();
  2434. }
  2435. catch (e) {
  2436. console.warn('Exception in onSerialize callback: ', e);
  2437. }
  2438. }
  2439. }
  2440. return JSON.stringify(this.store);
  2441. };
  2442. var TransferState_1;
  2443. TransferState = TransferState_1 = __decorate([
  2444. i0.Injectable()
  2445. ], TransferState);
  2446. return TransferState;
  2447. }());
  2448. function initTransferState(doc, appId) {
  2449. // Locate the script tag with the JSON data transferred from the server.
  2450. // The id of the script tag is set to the Angular appId + 'state'.
  2451. var script = doc.getElementById(appId + '-state');
  2452. var initialState = {};
  2453. if (script && script.textContent) {
  2454. try {
  2455. initialState = JSON.parse(unescapeHtml(script.textContent));
  2456. }
  2457. catch (e) {
  2458. console.warn('Exception while restoring TransferState for app ' + appId, e);
  2459. }
  2460. }
  2461. return TransferState.init(initialState);
  2462. }
  2463. /**
  2464. * NgModule to install on the client side while using the `TransferState` to transfer state from
  2465. * server to client.
  2466. *
  2467. * @publicApi
  2468. */
  2469. var BrowserTransferStateModule = /** @class */ (function () {
  2470. function BrowserTransferStateModule() {
  2471. }
  2472. BrowserTransferStateModule = __decorate([
  2473. i0.NgModule({
  2474. providers: [{ provide: TransferState, useFactory: initTransferState, deps: [common.DOCUMENT, i0.APP_ID] }],
  2475. })
  2476. ], BrowserTransferStateModule);
  2477. return BrowserTransferStateModule;
  2478. }());
  2479. /**
  2480. * @license
  2481. * Copyright Google Inc. All Rights Reserved.
  2482. *
  2483. * Use of this source code is governed by an MIT-style license that can be
  2484. * found in the LICENSE file at https://angular.io/license
  2485. */
  2486. /**
  2487. * Predicates for use with {@link DebugElement}'s query functions.
  2488. *
  2489. * @publicApi
  2490. */
  2491. var By = /** @class */ (function () {
  2492. function By() {
  2493. }
  2494. /**
  2495. * Match all elements.
  2496. *
  2497. * @usageNotes
  2498. * ### Example
  2499. *
  2500. * {@example platform-browser/dom/debug/ts/by/by.ts region='by_all'}
  2501. */
  2502. By.all = function () { return function (debugElement) { return true; }; };
  2503. /**
  2504. * Match elements by the given CSS selector.
  2505. *
  2506. * @usageNotes
  2507. * ### Example
  2508. *
  2509. * {@example platform-browser/dom/debug/ts/by/by.ts region='by_css'}
  2510. */
  2511. By.css = function (selector) {
  2512. return function (debugElement) {
  2513. return debugElement.nativeElement != null ?
  2514. getDOM().elementMatches(debugElement.nativeElement, selector) :
  2515. false;
  2516. };
  2517. };
  2518. /**
  2519. * Match elements that have the given directive present.
  2520. *
  2521. * @usageNotes
  2522. * ### Example
  2523. *
  2524. * {@example platform-browser/dom/debug/ts/by/by.ts region='by_directive'}
  2525. */
  2526. By.directive = function (type) {
  2527. return function (debugElement) { return debugElement.providerTokens.indexOf(type) !== -1; };
  2528. };
  2529. return By;
  2530. }());
  2531. /**
  2532. * @license
  2533. * Copyright Google Inc. All Rights Reserved.
  2534. *
  2535. * Use of this source code is governed by an MIT-style license that can be
  2536. * found in the LICENSE file at https://angular.io/license
  2537. */
  2538. /**
  2539. * @license
  2540. * Copyright Google Inc. All Rights Reserved.
  2541. *
  2542. * Use of this source code is governed by an MIT-style license that can be
  2543. * found in the LICENSE file at https://angular.io/license
  2544. */
  2545. /**
  2546. * @publicApi
  2547. */
  2548. var VERSION = new i0.Version('8.1.3');
  2549. /**
  2550. * @license
  2551. * Copyright Google Inc. All Rights Reserved.
  2552. *
  2553. * Use of this source code is governed by an MIT-style license that can be
  2554. * found in the LICENSE file at https://angular.io/license
  2555. */
  2556. /**
  2557. * @license
  2558. * Copyright Google Inc. All Rights Reserved.
  2559. *
  2560. * Use of this source code is governed by an MIT-style license that can be
  2561. * found in the LICENSE file at https://angular.io/license
  2562. */
  2563. // This file only reexports content of the `src` folder. Keep it that way.
  2564. /**
  2565. * @license
  2566. * Copyright Google Inc. All Rights Reserved.
  2567. *
  2568. * Use of this source code is governed by an MIT-style license that can be
  2569. * found in the LICENSE file at https://angular.io/license
  2570. */
  2571. /**
  2572. * Generated bundle index. Do not edit.
  2573. */
  2574. exports.ɵangular_packages_platform_browser_platform_browser_c = BROWSER_MODULE_PROVIDERS;
  2575. exports.ɵangular_packages_platform_browser_platform_browser_b = _document;
  2576. exports.ɵangular_packages_platform_browser_platform_browser_a = errorHandler;
  2577. exports.ɵangular_packages_platform_browser_platform_browser_l = GenericBrowserDomAdapter;
  2578. exports.ɵangular_packages_platform_browser_platform_browser_d = createMeta;
  2579. exports.ɵangular_packages_platform_browser_platform_browser_i = SERVER_TRANSITION_PROVIDERS;
  2580. exports.ɵangular_packages_platform_browser_platform_browser_h = appInitializerFactory;
  2581. exports.ɵangular_packages_platform_browser_platform_browser_e = createTitle;
  2582. exports.ɵangular_packages_platform_browser_platform_browser_f = initTransferState;
  2583. exports.ɵangular_packages_platform_browser_platform_browser_k = ELEMENT_PROBE_PROVIDERS__PRE_R3__;
  2584. exports.ɵangular_packages_platform_browser_platform_browser_j = _createNgProbe;
  2585. exports.ɵangular_packages_platform_browser_platform_browser_g = EventManagerPlugin;
  2586. exports.BrowserModule = BrowserModule;
  2587. exports.platformBrowser = platformBrowser;
  2588. exports.Meta = Meta;
  2589. exports.Title = Title;
  2590. exports.disableDebugTools = disableDebugTools;
  2591. exports.enableDebugTools = enableDebugTools;
  2592. exports.BrowserTransferStateModule = BrowserTransferStateModule;
  2593. exports.TransferState = TransferState;
  2594. exports.makeStateKey = makeStateKey;
  2595. exports.By = By;
  2596. exports.EVENT_MANAGER_PLUGINS = EVENT_MANAGER_PLUGINS;
  2597. exports.EventManager = EventManager;
  2598. exports.HAMMER_GESTURE_CONFIG = HAMMER_GESTURE_CONFIG;
  2599. exports.HAMMER_LOADER = HAMMER_LOADER;
  2600. exports.HammerGestureConfig = HammerGestureConfig;
  2601. exports.DomSanitizer = DomSanitizer;
  2602. exports.VERSION = VERSION;
  2603. exports.ɵELEMENT_PROBE_PROVIDERS__POST_R3__ = ELEMENT_PROBE_PROVIDERS__POST_R3__;
  2604. exports.ɵBROWSER_SANITIZATION_PROVIDERS = BROWSER_SANITIZATION_PROVIDERS;
  2605. exports.ɵINTERNAL_BROWSER_PLATFORM_PROVIDERS = INTERNAL_BROWSER_PLATFORM_PROVIDERS;
  2606. exports.ɵinitDomAdapter = initDomAdapter;
  2607. exports.ɵBrowserDomAdapter = BrowserDomAdapter;
  2608. exports.ɵBrowserPlatformLocation = BrowserPlatformLocation;
  2609. exports.ɵTRANSITION_ID = TRANSITION_ID;
  2610. exports.ɵBrowserGetTestability = BrowserGetTestability;
  2611. exports.ɵescapeHtml = escapeHtml;
  2612. exports.ɵELEMENT_PROBE_PROVIDERS = ELEMENT_PROBE_PROVIDERS;
  2613. exports.ɵDomAdapter = DomAdapter;
  2614. exports.ɵgetDOM = getDOM;
  2615. exports.ɵsetRootDomAdapter = setRootDomAdapter;
  2616. exports.ɵDomRendererFactory2 = DomRendererFactory2;
  2617. exports.ɵNAMESPACE_URIS = NAMESPACE_URIS;
  2618. exports.ɵflattenStyles = flattenStyles;
  2619. exports.ɵshimContentAttribute = shimContentAttribute;
  2620. exports.ɵshimHostAttribute = shimHostAttribute;
  2621. exports.ɵDomEventsPlugin = DomEventsPlugin;
  2622. exports.ɵHammerGesturesPlugin = HammerGesturesPlugin;
  2623. exports.ɵKeyEventsPlugin = KeyEventsPlugin;
  2624. exports.ɵDomSharedStylesHost = DomSharedStylesHost;
  2625. exports.ɵSharedStylesHost = SharedStylesHost;
  2626. exports.ɵDomSanitizerImpl = DomSanitizerImpl;
  2627. Object.defineProperty(exports, '__esModule', { value: true });
  2628. }));
  2629. //# sourceMappingURL=platform-browser.umd.js.map