1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | import * as i0 from '@angular/core';
|
8 | import { ɵglobal, ɵRuntimeError, Injectable, InjectionToken, Inject, APP_ID, CSP_NONCE, PLATFORM_ID, Optional, ViewEncapsulation, RendererStyleFlags2, ɵinternalCreateApplication, ErrorHandler, ɵsetDocument, PLATFORM_INITIALIZER, createPlatformFactory, platformCore, ɵTESTABILITY_GETTER, ɵTESTABILITY, Testability, NgZone, TestabilityRegistry, ɵINJECTOR_SCOPE, RendererFactory2, ApplicationModule, NgModule, SkipSelf, ApplicationRef, ɵConsole, forwardRef, ɵXSS_SECURITY_URL, SecurityContext, ɵallowSanitizationBypassAndThrow, ɵunwrapSafeValue, ɵ_sanitizeUrl, ɵ_sanitizeHtml, ɵbypassSanitizationTrustHtml, ɵbypassSanitizationTrustStyle, ɵbypassSanitizationTrustScript, ɵbypassSanitizationTrustUrl, ɵbypassSanitizationTrustResourceUrl, ENVIRONMENT_INITIALIZER, inject, ɵformatRuntimeError, makeEnvironmentProviders, ɵwithDomHydration, Version, makeStateKey as makeStateKey$1, TransferState as TransferState$1 } from '@angular/core';
|
9 | import { ɵDomAdapter, ɵsetRootDomAdapter, ɵparseCookieValue, ɵgetDOM, isPlatformServer, DOCUMENT, ɵPLATFORM_BROWSER_ID, XhrFactory, CommonModule } from '@angular/common';
|
10 | export { ɵgetDOM } from '@angular/common';
|
11 | import { ɵwithHttpTransferCache } from '@angular/common/http';
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 | class GenericBrowserDomAdapter extends ɵDomAdapter {
|
20 | constructor() {
|
21 | super(...arguments);
|
22 | this.supportsDOMEvents = true;
|
23 | }
|
24 | }
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 | class BrowserDomAdapter extends GenericBrowserDomAdapter {
|
34 | static makeCurrent() {
|
35 | ɵsetRootDomAdapter(new BrowserDomAdapter());
|
36 | }
|
37 | onAndCancel(el, evt, listener) {
|
38 | el.addEventListener(evt, listener);
|
39 | return () => {
|
40 | el.removeEventListener(evt, listener);
|
41 | };
|
42 | }
|
43 | dispatchEvent(el, evt) {
|
44 | el.dispatchEvent(evt);
|
45 | }
|
46 | remove(node) {
|
47 | if (node.parentNode) {
|
48 | node.parentNode.removeChild(node);
|
49 | }
|
50 | }
|
51 | createElement(tagName, doc) {
|
52 | doc = doc || this.getDefaultDocument();
|
53 | return doc.createElement(tagName);
|
54 | }
|
55 | createHtmlDocument() {
|
56 | return document.implementation.createHTMLDocument('fakeTitle');
|
57 | }
|
58 | getDefaultDocument() {
|
59 | return document;
|
60 | }
|
61 | isElementNode(node) {
|
62 | return node.nodeType === Node.ELEMENT_NODE;
|
63 | }
|
64 | isShadowRoot(node) {
|
65 | return node instanceof DocumentFragment;
|
66 | }
|
67 |
|
68 | getGlobalEventTarget(doc, target) {
|
69 | if (target === 'window') {
|
70 | return window;
|
71 | }
|
72 | if (target === 'document') {
|
73 | return doc;
|
74 | }
|
75 | if (target === 'body') {
|
76 | return doc.body;
|
77 | }
|
78 | return null;
|
79 | }
|
80 | getBaseHref(doc) {
|
81 | const href = getBaseElementHref();
|
82 | return href == null ? null : relativePath(href);
|
83 | }
|
84 | resetBaseElement() {
|
85 | baseElement = null;
|
86 | }
|
87 | getUserAgent() {
|
88 | return window.navigator.userAgent;
|
89 | }
|
90 | getCookie(name) {
|
91 | return ɵparseCookieValue(document.cookie, name);
|
92 | }
|
93 | }
|
94 | let baseElement = null;
|
95 | function getBaseElementHref() {
|
96 | baseElement = baseElement || document.querySelector('base');
|
97 | return baseElement ? baseElement.getAttribute('href') : null;
|
98 | }
|
99 | function relativePath(url) {
|
100 |
|
101 |
|
102 | return new URL(url, document.baseURI).pathname;
|
103 | }
|
104 |
|
105 | class BrowserGetTestability {
|
106 | addToWindow(registry) {
|
107 | ɵglobal['getAngularTestability'] = (elem, findInAncestors = true) => {
|
108 | const testability = registry.findTestabilityInTree(elem, findInAncestors);
|
109 | if (testability == null) {
|
110 | throw new ɵRuntimeError(5103 , (typeof ngDevMode === 'undefined' || ngDevMode) &&
|
111 | 'Could not find testability for element.');
|
112 | }
|
113 | return testability;
|
114 | };
|
115 | ɵglobal['getAllAngularTestabilities'] = () => registry.getAllTestabilities();
|
116 | ɵglobal['getAllAngularRootElements'] = () => registry.getAllRootElements();
|
117 | const whenAllStable = (callback) => {
|
118 | const testabilities = ɵglobal['getAllAngularTestabilities']();
|
119 | let count = testabilities.length;
|
120 | const decrement = function () {
|
121 | count--;
|
122 | if (count == 0) {
|
123 | callback();
|
124 | }
|
125 | };
|
126 | testabilities.forEach((testability) => {
|
127 | testability.whenStable(decrement);
|
128 | });
|
129 | };
|
130 | if (!ɵglobal['frameworkStabilizers']) {
|
131 | ɵglobal['frameworkStabilizers'] = [];
|
132 | }
|
133 | ɵglobal['frameworkStabilizers'].push(whenAllStable);
|
134 | }
|
135 | findTestabilityInTree(registry, elem, findInAncestors) {
|
136 | if (elem == null) {
|
137 | return null;
|
138 | }
|
139 | const t = registry.getTestability(elem);
|
140 | if (t != null) {
|
141 | return t;
|
142 | }
|
143 | else if (!findInAncestors) {
|
144 | return null;
|
145 | }
|
146 | if (ɵgetDOM().isShadowRoot(elem)) {
|
147 | return this.findTestabilityInTree(registry, elem.host, true);
|
148 | }
|
149 | return this.findTestabilityInTree(registry, elem.parentElement, true);
|
150 | }
|
151 | }
|
152 |
|
153 |
|
154 |
|
155 |
|
156 | class BrowserXhr {
|
157 | build() {
|
158 | return new XMLHttpRequest();
|
159 | }
|
160 | static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: BrowserXhr, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
161 | static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: BrowserXhr }); }
|
162 | }
|
163 | i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: BrowserXhr, decorators: [{
|
164 | type: Injectable
|
165 | }] });
|
166 |
|
167 |
|
168 |
|
169 |
|
170 |
|
171 |
|
172 | const EVENT_MANAGER_PLUGINS = new InjectionToken(ngDevMode ? 'EventManagerPlugins' : '');
|
173 |
|
174 |
|
175 |
|
176 |
|
177 |
|
178 |
|
179 | class EventManager {
|
180 | |
181 |
|
182 |
|
183 | constructor(plugins, _zone) {
|
184 | this._zone = _zone;
|
185 | this._eventNameToPlugin = new Map();
|
186 | plugins.forEach((plugin) => {
|
187 | plugin.manager = this;
|
188 | });
|
189 | this._plugins = plugins.slice().reverse();
|
190 | }
|
191 | |
192 |
|
193 |
|
194 |
|
195 |
|
196 |
|
197 |
|
198 |
|
199 |
|
200 | addEventListener(element, eventName, handler) {
|
201 | const plugin = this._findPluginFor(eventName);
|
202 | return plugin.addEventListener(element, eventName, handler);
|
203 | }
|
204 | |
205 |
|
206 |
|
207 | getZone() {
|
208 | return this._zone;
|
209 | }
|
210 |
|
211 | _findPluginFor(eventName) {
|
212 | let plugin = this._eventNameToPlugin.get(eventName);
|
213 | if (plugin) {
|
214 | return plugin;
|
215 | }
|
216 | const plugins = this._plugins;
|
217 | plugin = plugins.find((plugin) => plugin.supports(eventName));
|
218 | if (!plugin) {
|
219 | throw new ɵRuntimeError(5101 , (typeof ngDevMode === 'undefined' || ngDevMode) &&
|
220 | `No event manager plugin found for event ${eventName}`);
|
221 | }
|
222 | this._eventNameToPlugin.set(eventName, plugin);
|
223 | return plugin;
|
224 | }
|
225 | static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: EventManager, deps: [{ token: EVENT_MANAGER_PLUGINS }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
226 | static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: EventManager }); }
|
227 | }
|
228 | i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: EventManager, decorators: [{
|
229 | type: Injectable
|
230 | }], ctorParameters: () => [{ type: undefined, decorators: [{
|
231 | type: Inject,
|
232 | args: [EVENT_MANAGER_PLUGINS]
|
233 | }] }, { type: i0.NgZone }] });
|
234 |
|
235 |
|
236 |
|
237 |
|
238 |
|
239 |
|
240 |
|
241 |
|
242 | class EventManagerPlugin {
|
243 |
|
244 | constructor(_doc) {
|
245 | this._doc = _doc;
|
246 | }
|
247 | }
|
248 |
|
249 |
|
250 | const APP_ID_ATTRIBUTE_NAME = 'ng-app-id';
|
251 | class SharedStylesHost {
|
252 | constructor(doc, appId, nonce, platformId = {}) {
|
253 | this.doc = doc;
|
254 | this.appId = appId;
|
255 | this.nonce = nonce;
|
256 | this.platformId = platformId;
|
257 |
|
258 | this.styleRef = new Map();
|
259 | this.hostNodes = new Set();
|
260 | this.styleNodesInDOM = this.collectServerRenderedStyles();
|
261 | this.platformIsServer = isPlatformServer(platformId);
|
262 | this.resetHostNodes();
|
263 | }
|
264 | addStyles(styles) {
|
265 | for (const style of styles) {
|
266 | const usageCount = this.changeUsageCount(style, 1);
|
267 | if (usageCount === 1) {
|
268 | this.onStyleAdded(style);
|
269 | }
|
270 | }
|
271 | }
|
272 | removeStyles(styles) {
|
273 | for (const style of styles) {
|
274 | const usageCount = this.changeUsageCount(style, -1);
|
275 | if (usageCount <= 0) {
|
276 | this.onStyleRemoved(style);
|
277 | }
|
278 | }
|
279 | }
|
280 | ngOnDestroy() {
|
281 | const styleNodesInDOM = this.styleNodesInDOM;
|
282 | if (styleNodesInDOM) {
|
283 | styleNodesInDOM.forEach((node) => node.remove());
|
284 | styleNodesInDOM.clear();
|
285 | }
|
286 | for (const style of this.getAllStyles()) {
|
287 | this.onStyleRemoved(style);
|
288 | }
|
289 | this.resetHostNodes();
|
290 | }
|
291 | addHost(hostNode) {
|
292 | this.hostNodes.add(hostNode);
|
293 | for (const style of this.getAllStyles()) {
|
294 | this.addStyleToHost(hostNode, style);
|
295 | }
|
296 | }
|
297 | removeHost(hostNode) {
|
298 | this.hostNodes.delete(hostNode);
|
299 | }
|
300 | getAllStyles() {
|
301 | return this.styleRef.keys();
|
302 | }
|
303 | onStyleAdded(style) {
|
304 | for (const host of this.hostNodes) {
|
305 | this.addStyleToHost(host, style);
|
306 | }
|
307 | }
|
308 | onStyleRemoved(style) {
|
309 | const styleRef = this.styleRef;
|
310 | styleRef.get(style)?.elements?.forEach((node) => node.remove());
|
311 | styleRef.delete(style);
|
312 | }
|
313 | collectServerRenderedStyles() {
|
314 | const styles = this.doc.head?.querySelectorAll(`style[${APP_ID_ATTRIBUTE_NAME}="${this.appId}"]`);
|
315 | if (styles?.length) {
|
316 | const styleMap = new Map();
|
317 | styles.forEach((style) => {
|
318 | if (style.textContent != null) {
|
319 | styleMap.set(style.textContent, style);
|
320 | }
|
321 | });
|
322 | return styleMap;
|
323 | }
|
324 | return null;
|
325 | }
|
326 | changeUsageCount(style, delta) {
|
327 | const map = this.styleRef;
|
328 | if (map.has(style)) {
|
329 | const styleRefValue = map.get(style);
|
330 | styleRefValue.usage += delta;
|
331 | return styleRefValue.usage;
|
332 | }
|
333 | map.set(style, { usage: delta, elements: [] });
|
334 | return delta;
|
335 | }
|
336 | getStyleElement(host, style) {
|
337 | const styleNodesInDOM = this.styleNodesInDOM;
|
338 | const styleEl = styleNodesInDOM?.get(style);
|
339 | if (styleEl?.parentNode === host) {
|
340 |
|
341 | styleNodesInDOM.delete(style);
|
342 | styleEl.removeAttribute(APP_ID_ATTRIBUTE_NAME);
|
343 | if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
344 |
|
345 | styleEl.setAttribute('ng-style-reused', '');
|
346 | }
|
347 | return styleEl;
|
348 | }
|
349 | else {
|
350 | const styleEl = this.doc.createElement('style');
|
351 | if (this.nonce) {
|
352 | styleEl.setAttribute('nonce', this.nonce);
|
353 | }
|
354 | styleEl.textContent = style;
|
355 | if (this.platformIsServer) {
|
356 | styleEl.setAttribute(APP_ID_ATTRIBUTE_NAME, this.appId);
|
357 | }
|
358 | host.appendChild(styleEl);
|
359 | return styleEl;
|
360 | }
|
361 | }
|
362 | addStyleToHost(host, style) {
|
363 | const styleEl = this.getStyleElement(host, style);
|
364 | const styleRef = this.styleRef;
|
365 | const styleElRef = styleRef.get(style)?.elements;
|
366 | if (styleElRef) {
|
367 | styleElRef.push(styleEl);
|
368 | }
|
369 | else {
|
370 | styleRef.set(style, { elements: [styleEl], usage: 1 });
|
371 | }
|
372 | }
|
373 | resetHostNodes() {
|
374 | const hostNodes = this.hostNodes;
|
375 | hostNodes.clear();
|
376 |
|
377 | hostNodes.add(this.doc.head);
|
378 | }
|
379 | static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: SharedStylesHost, deps: [{ token: DOCUMENT }, { token: APP_ID }, { token: CSP_NONCE, optional: true }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
380 | static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: SharedStylesHost }); }
|
381 | }
|
382 | i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: SharedStylesHost, decorators: [{
|
383 | type: Injectable
|
384 | }], ctorParameters: () => [{ type: Document, decorators: [{
|
385 | type: Inject,
|
386 | args: [DOCUMENT]
|
387 | }] }, { type: undefined, decorators: [{
|
388 | type: Inject,
|
389 | args: [APP_ID]
|
390 | }] }, { type: undefined, decorators: [{
|
391 | type: Inject,
|
392 | args: [CSP_NONCE]
|
393 | }, {
|
394 | type: Optional
|
395 | }] }, { type: undefined, decorators: [{
|
396 | type: Inject,
|
397 | args: [PLATFORM_ID]
|
398 | }] }] });
|
399 |
|
400 | const NAMESPACE_URIS = {
|
401 | 'svg': 'http://www.w3.org/2000/svg',
|
402 | 'xhtml': 'http://www.w3.org/1999/xhtml',
|
403 | 'xlink': 'http://www.w3.org/1999/xlink',
|
404 | 'xml': 'http://www.w3.org/XML/1998/namespace',
|
405 | 'xmlns': 'http://www.w3.org/2000/xmlns/',
|
406 | 'math': 'http://www.w3.org/1998/MathML/',
|
407 | };
|
408 | const COMPONENT_REGEX = /%COMP%/g;
|
409 | const COMPONENT_VARIABLE = '%COMP%';
|
410 | const HOST_ATTR = `_nghost-${COMPONENT_VARIABLE}`;
|
411 | const CONTENT_ATTR = `_ngcontent-${COMPONENT_VARIABLE}`;
|
412 |
|
413 |
|
414 |
|
415 | const REMOVE_STYLES_ON_COMPONENT_DESTROY_DEFAULT = true;
|
416 |
|
417 |
|
418 |
|
419 |
|
420 |
|
421 |
|
422 |
|
423 | const REMOVE_STYLES_ON_COMPONENT_DESTROY = new InjectionToken(ngDevMode ? 'RemoveStylesOnCompDestroy' : '', {
|
424 | providedIn: 'root',
|
425 | factory: () => REMOVE_STYLES_ON_COMPONENT_DESTROY_DEFAULT,
|
426 | });
|
427 | function shimContentAttribute(componentShortId) {
|
428 | return CONTENT_ATTR.replace(COMPONENT_REGEX, componentShortId);
|
429 | }
|
430 | function shimHostAttribute(componentShortId) {
|
431 | return HOST_ATTR.replace(COMPONENT_REGEX, componentShortId);
|
432 | }
|
433 | function shimStylesContent(compId, styles) {
|
434 | return styles.map(s => s.replace(COMPONENT_REGEX, compId));
|
435 | }
|
436 | class DomRendererFactory2 {
|
437 | constructor(eventManager, sharedStylesHost, appId, removeStylesOnCompDestroy, doc, platformId, ngZone, nonce = null) {
|
438 | this.eventManager = eventManager;
|
439 | this.sharedStylesHost = sharedStylesHost;
|
440 | this.appId = appId;
|
441 | this.removeStylesOnCompDestroy = removeStylesOnCompDestroy;
|
442 | this.doc = doc;
|
443 | this.platformId = platformId;
|
444 | this.ngZone = ngZone;
|
445 | this.nonce = nonce;
|
446 | this.rendererByCompId = new Map();
|
447 | this.platformIsServer = isPlatformServer(platformId);
|
448 | this.defaultRenderer =
|
449 | new DefaultDomRenderer2(eventManager, doc, ngZone, this.platformIsServer);
|
450 | }
|
451 | createRenderer(element, type) {
|
452 | if (!element || !type) {
|
453 | return this.defaultRenderer;
|
454 | }
|
455 | if (this.platformIsServer && type.encapsulation === ViewEncapsulation.ShadowDom) {
|
456 |
|
457 | type = { ...type, encapsulation: ViewEncapsulation.Emulated };
|
458 | }
|
459 | const renderer = this.getOrCreateRenderer(element, type);
|
460 |
|
461 |
|
462 | if (renderer instanceof EmulatedEncapsulationDomRenderer2) {
|
463 | renderer.applyToHost(element);
|
464 | }
|
465 | else if (renderer instanceof NoneEncapsulationDomRenderer) {
|
466 | renderer.applyStyles();
|
467 | }
|
468 | return renderer;
|
469 | }
|
470 | getOrCreateRenderer(element, type) {
|
471 | const rendererByCompId = this.rendererByCompId;
|
472 | let renderer = rendererByCompId.get(type.id);
|
473 | if (!renderer) {
|
474 | const doc = this.doc;
|
475 | const ngZone = this.ngZone;
|
476 | const eventManager = this.eventManager;
|
477 | const sharedStylesHost = this.sharedStylesHost;
|
478 | const removeStylesOnCompDestroy = this.removeStylesOnCompDestroy;
|
479 | const platformIsServer = this.platformIsServer;
|
480 | switch (type.encapsulation) {
|
481 | case ViewEncapsulation.Emulated:
|
482 | renderer = new EmulatedEncapsulationDomRenderer2(eventManager, sharedStylesHost, type, this.appId, removeStylesOnCompDestroy, doc, ngZone, platformIsServer);
|
483 | break;
|
484 | case ViewEncapsulation.ShadowDom:
|
485 | return new ShadowDomRenderer(eventManager, sharedStylesHost, element, type, doc, ngZone, this.nonce, platformIsServer);
|
486 | default:
|
487 | renderer = new NoneEncapsulationDomRenderer(eventManager, sharedStylesHost, type, removeStylesOnCompDestroy, doc, ngZone, platformIsServer);
|
488 | break;
|
489 | }
|
490 | rendererByCompId.set(type.id, renderer);
|
491 | }
|
492 | return renderer;
|
493 | }
|
494 | ngOnDestroy() {
|
495 | this.rendererByCompId.clear();
|
496 | }
|
497 | static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: DomRendererFactory2, deps: [{ token: EventManager }, { token: SharedStylesHost }, { token: APP_ID }, { token: REMOVE_STYLES_ON_COMPONENT_DESTROY }, { token: DOCUMENT }, { token: PLATFORM_ID }, { token: i0.NgZone }, { token: CSP_NONCE }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
498 | static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: DomRendererFactory2 }); }
|
499 | }
|
500 | i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: DomRendererFactory2, decorators: [{
|
501 | type: Injectable
|
502 | }], ctorParameters: () => [{ type: EventManager }, { type: SharedStylesHost }, { type: undefined, decorators: [{
|
503 | type: Inject,
|
504 | args: [APP_ID]
|
505 | }] }, { type: undefined, decorators: [{
|
506 | type: Inject,
|
507 | args: [REMOVE_STYLES_ON_COMPONENT_DESTROY]
|
508 | }] }, { type: Document, decorators: [{
|
509 | type: Inject,
|
510 | args: [DOCUMENT]
|
511 | }] }, { type: Object, decorators: [{
|
512 | type: Inject,
|
513 | args: [PLATFORM_ID]
|
514 | }] }, { type: i0.NgZone }, { type: undefined, decorators: [{
|
515 | type: Inject,
|
516 | args: [CSP_NONCE]
|
517 | }] }] });
|
518 | class DefaultDomRenderer2 {
|
519 | constructor(eventManager, doc, ngZone, platformIsServer) {
|
520 | this.eventManager = eventManager;
|
521 | this.doc = doc;
|
522 | this.ngZone = ngZone;
|
523 | this.platformIsServer = platformIsServer;
|
524 | this.data = Object.create(null);
|
525 | |
526 |
|
527 |
|
528 |
|
529 | this.throwOnSyntheticProps = true;
|
530 | this.destroyNode = null;
|
531 | }
|
532 | destroy() { }
|
533 | createElement(name, namespace) {
|
534 | if (namespace) {
|
535 |
|
536 |
|
537 |
|
538 |
|
539 |
|
540 |
|
541 |
|
542 |
|
543 |
|
544 | return this.doc.createElementNS(NAMESPACE_URIS[namespace] || namespace, name);
|
545 | }
|
546 | return this.doc.createElement(name);
|
547 | }
|
548 | createComment(value) {
|
549 | return this.doc.createComment(value);
|
550 | }
|
551 | createText(value) {
|
552 | return this.doc.createTextNode(value);
|
553 | }
|
554 | appendChild(parent, newChild) {
|
555 | const targetParent = isTemplateNode(parent) ? parent.content : parent;
|
556 | targetParent.appendChild(newChild);
|
557 | }
|
558 | insertBefore(parent, newChild, refChild) {
|
559 | if (parent) {
|
560 | const targetParent = isTemplateNode(parent) ? parent.content : parent;
|
561 | targetParent.insertBefore(newChild, refChild);
|
562 | }
|
563 | }
|
564 | removeChild(parent, oldChild) {
|
565 | if (parent) {
|
566 | parent.removeChild(oldChild);
|
567 | }
|
568 | }
|
569 | selectRootElement(selectorOrNode, preserveContent) {
|
570 | let el = typeof selectorOrNode === 'string' ? this.doc.querySelector(selectorOrNode) :
|
571 | selectorOrNode;
|
572 | if (!el) {
|
573 | throw new ɵRuntimeError(-5104 , (typeof ngDevMode === 'undefined' || ngDevMode) &&
|
574 | `The selector "${selectorOrNode}" did not match any elements`);
|
575 | }
|
576 | if (!preserveContent) {
|
577 | el.textContent = '';
|
578 | }
|
579 | return el;
|
580 | }
|
581 | parentNode(node) {
|
582 | return node.parentNode;
|
583 | }
|
584 | nextSibling(node) {
|
585 | return node.nextSibling;
|
586 | }
|
587 | setAttribute(el, name, value, namespace) {
|
588 | if (namespace) {
|
589 | name = namespace + ':' + name;
|
590 | const namespaceUri = NAMESPACE_URIS[namespace];
|
591 | if (namespaceUri) {
|
592 | el.setAttributeNS(namespaceUri, name, value);
|
593 | }
|
594 | else {
|
595 | el.setAttribute(name, value);
|
596 | }
|
597 | }
|
598 | else {
|
599 | el.setAttribute(name, value);
|
600 | }
|
601 | }
|
602 | removeAttribute(el, name, namespace) {
|
603 | if (namespace) {
|
604 | const namespaceUri = NAMESPACE_URIS[namespace];
|
605 | if (namespaceUri) {
|
606 | el.removeAttributeNS(namespaceUri, name);
|
607 | }
|
608 | else {
|
609 | el.removeAttribute(`${namespace}:${name}`);
|
610 | }
|
611 | }
|
612 | else {
|
613 | el.removeAttribute(name);
|
614 | }
|
615 | }
|
616 | addClass(el, name) {
|
617 | el.classList.add(name);
|
618 | }
|
619 | removeClass(el, name) {
|
620 | el.classList.remove(name);
|
621 | }
|
622 | setStyle(el, style, value, flags) {
|
623 | if (flags & (RendererStyleFlags2.DashCase | RendererStyleFlags2.Important)) {
|
624 | el.style.setProperty(style, value, flags & RendererStyleFlags2.Important ? 'important' : '');
|
625 | }
|
626 | else {
|
627 | el.style[style] = value;
|
628 | }
|
629 | }
|
630 | removeStyle(el, style, flags) {
|
631 | if (flags & RendererStyleFlags2.DashCase) {
|
632 |
|
633 | el.style.removeProperty(style);
|
634 | }
|
635 | else {
|
636 | el.style[style] = '';
|
637 | }
|
638 | }
|
639 | setProperty(el, name, value) {
|
640 | if (el == null) {
|
641 | return;
|
642 | }
|
643 | (typeof ngDevMode === 'undefined' || ngDevMode) && this.throwOnSyntheticProps &&
|
644 | checkNoSyntheticProp(name, 'property');
|
645 | el[name] = value;
|
646 | }
|
647 | setValue(node, value) {
|
648 | node.nodeValue = value;
|
649 | }
|
650 | listen(target, event, callback) {
|
651 | (typeof ngDevMode === 'undefined' || ngDevMode) && this.throwOnSyntheticProps &&
|
652 | checkNoSyntheticProp(event, 'listener');
|
653 | if (typeof target === 'string') {
|
654 | target = ɵgetDOM().getGlobalEventTarget(this.doc, target);
|
655 | if (!target) {
|
656 | throw new Error(`Unsupported event target ${target} for event ${event}`);
|
657 | }
|
658 | }
|
659 | return this.eventManager.addEventListener(target, event, this.decoratePreventDefault(callback));
|
660 | }
|
661 | decoratePreventDefault(eventHandler) {
|
662 |
|
663 |
|
664 |
|
665 |
|
666 | return (event) => {
|
667 |
|
668 |
|
669 |
|
670 |
|
671 |
|
672 | if (event === '__ngUnwrap__') {
|
673 | return eventHandler;
|
674 | }
|
675 |
|
676 |
|
677 | const allowDefaultBehavior = this.platformIsServer ?
|
678 | this.ngZone.runGuarded(() => eventHandler(event)) :
|
679 | eventHandler(event);
|
680 | if (allowDefaultBehavior === false) {
|
681 | event.preventDefault();
|
682 | }
|
683 | return undefined;
|
684 | };
|
685 | }
|
686 | }
|
687 | const AT_CHARCODE = (() => '@'.charCodeAt(0))();
|
688 | function checkNoSyntheticProp(name, nameKind) {
|
689 | if (name.charCodeAt(0) === AT_CHARCODE) {
|
690 | throw new ɵRuntimeError(5105 , `Unexpected synthetic ${nameKind} ${name} found. Please make sure that:
|
691 | - Either \`BrowserAnimationsModule\` or \`NoopAnimationsModule\` are imported in your application.
|
692 | - There is corresponding configuration for the animation named \`${name}\` defined in the \`animations\` field of the \`@Component\` decorator (see https://angular.io/api/core/Component#animations).`);
|
693 | }
|
694 | }
|
695 | function isTemplateNode(node) {
|
696 | return node.tagName === 'TEMPLATE' && node.content !== undefined;
|
697 | }
|
698 | class ShadowDomRenderer extends DefaultDomRenderer2 {
|
699 | constructor(eventManager, sharedStylesHost, hostEl, component, doc, ngZone, nonce, platformIsServer) {
|
700 | super(eventManager, doc, ngZone, platformIsServer);
|
701 | this.sharedStylesHost = sharedStylesHost;
|
702 | this.hostEl = hostEl;
|
703 | this.shadowRoot = hostEl.attachShadow({ mode: 'open' });
|
704 | this.sharedStylesHost.addHost(this.shadowRoot);
|
705 | const styles = shimStylesContent(component.id, component.styles);
|
706 | for (const style of styles) {
|
707 | const styleEl = document.createElement('style');
|
708 | if (nonce) {
|
709 | styleEl.setAttribute('nonce', nonce);
|
710 | }
|
711 | styleEl.textContent = style;
|
712 | this.shadowRoot.appendChild(styleEl);
|
713 | }
|
714 | }
|
715 | nodeOrShadowRoot(node) {
|
716 | return node === this.hostEl ? this.shadowRoot : node;
|
717 | }
|
718 | appendChild(parent, newChild) {
|
719 | return super.appendChild(this.nodeOrShadowRoot(parent), newChild);
|
720 | }
|
721 | insertBefore(parent, newChild, refChild) {
|
722 | return super.insertBefore(this.nodeOrShadowRoot(parent), newChild, refChild);
|
723 | }
|
724 | removeChild(parent, oldChild) {
|
725 | return super.removeChild(this.nodeOrShadowRoot(parent), oldChild);
|
726 | }
|
727 | parentNode(node) {
|
728 | return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(node)));
|
729 | }
|
730 | destroy() {
|
731 | this.sharedStylesHost.removeHost(this.shadowRoot);
|
732 | }
|
733 | }
|
734 | class NoneEncapsulationDomRenderer extends DefaultDomRenderer2 {
|
735 | constructor(eventManager, sharedStylesHost, component, removeStylesOnCompDestroy, doc, ngZone, platformIsServer, compId) {
|
736 | super(eventManager, doc, ngZone, platformIsServer);
|
737 | this.sharedStylesHost = sharedStylesHost;
|
738 | this.removeStylesOnCompDestroy = removeStylesOnCompDestroy;
|
739 | this.styles = compId ? shimStylesContent(compId, component.styles) : component.styles;
|
740 | }
|
741 | applyStyles() {
|
742 | this.sharedStylesHost.addStyles(this.styles);
|
743 | }
|
744 | destroy() {
|
745 | if (!this.removeStylesOnCompDestroy) {
|
746 | return;
|
747 | }
|
748 | this.sharedStylesHost.removeStyles(this.styles);
|
749 | }
|
750 | }
|
751 | class EmulatedEncapsulationDomRenderer2 extends NoneEncapsulationDomRenderer {
|
752 | constructor(eventManager, sharedStylesHost, component, appId, removeStylesOnCompDestroy, doc, ngZone, platformIsServer) {
|
753 | const compId = appId + '-' + component.id;
|
754 | super(eventManager, sharedStylesHost, component, removeStylesOnCompDestroy, doc, ngZone, platformIsServer, compId);
|
755 | this.contentAttr = shimContentAttribute(compId);
|
756 | this.hostAttr = shimHostAttribute(compId);
|
757 | }
|
758 | applyToHost(element) {
|
759 | this.applyStyles();
|
760 | this.setAttribute(element, this.hostAttr, '');
|
761 | }
|
762 | createElement(parent, name) {
|
763 | const el = super.createElement(parent, name);
|
764 | super.setAttribute(el, this.contentAttr, '');
|
765 | return el;
|
766 | }
|
767 | }
|
768 |
|
769 | class DomEventsPlugin extends EventManagerPlugin {
|
770 | constructor(doc) {
|
771 | super(doc);
|
772 | }
|
773 |
|
774 |
|
775 | supports(eventName) {
|
776 | return true;
|
777 | }
|
778 | addEventListener(element, eventName, handler) {
|
779 | element.addEventListener(eventName, handler, false);
|
780 | return () => this.removeEventListener(element, eventName, handler);
|
781 | }
|
782 | removeEventListener(target, eventName, callback) {
|
783 | return target.removeEventListener(eventName, callback);
|
784 | }
|
785 | static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: DomEventsPlugin, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
786 | static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: DomEventsPlugin }); }
|
787 | }
|
788 | i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: DomEventsPlugin, decorators: [{
|
789 | type: Injectable
|
790 | }], ctorParameters: () => [{ type: undefined, decorators: [{
|
791 | type: Inject,
|
792 | args: [DOCUMENT]
|
793 | }] }] });
|
794 |
|
795 |
|
796 |
|
797 |
|
798 | const MODIFIER_KEYS = ['alt', 'control', 'meta', 'shift'];
|
799 |
|
800 |
|
801 | const _keyMap = {
|
802 | '\b': 'Backspace',
|
803 | '\t': 'Tab',
|
804 | '\x7F': 'Delete',
|
805 | '\x1B': 'Escape',
|
806 | 'Del': 'Delete',
|
807 | 'Esc': 'Escape',
|
808 | 'Left': 'ArrowLeft',
|
809 | 'Right': 'ArrowRight',
|
810 | 'Up': 'ArrowUp',
|
811 | 'Down': 'ArrowDown',
|
812 | 'Menu': 'ContextMenu',
|
813 | 'Scroll': 'ScrollLock',
|
814 | 'Win': 'OS'
|
815 | };
|
816 |
|
817 |
|
818 |
|
819 | const MODIFIER_KEY_GETTERS = {
|
820 | 'alt': (event) => event.altKey,
|
821 | 'control': (event) => event.ctrlKey,
|
822 | 'meta': (event) => event.metaKey,
|
823 | 'shift': (event) => event.shiftKey
|
824 | };
|
825 |
|
826 |
|
827 |
|
828 | class KeyEventsPlugin extends EventManagerPlugin {
|
829 | |
830 |
|
831 |
|
832 |
|
833 | constructor(doc) {
|
834 | super(doc);
|
835 | }
|
836 | |
837 |
|
838 |
|
839 |
|
840 |
|
841 | supports(eventName) {
|
842 | return KeyEventsPlugin.parseEventName(eventName) != null;
|
843 | }
|
844 | |
845 |
|
846 |
|
847 |
|
848 |
|
849 |
|
850 |
|
851 |
|
852 | addEventListener(element, eventName, handler) {
|
853 | const parsedEvent = KeyEventsPlugin.parseEventName(eventName);
|
854 | const outsideHandler = KeyEventsPlugin.eventCallback(parsedEvent['fullKey'], handler, this.manager.getZone());
|
855 | return this.manager.getZone().runOutsideAngular(() => {
|
856 | return ɵgetDOM().onAndCancel(element, parsedEvent['domEventName'], outsideHandler);
|
857 | });
|
858 | }
|
859 | |
860 |
|
861 |
|
862 |
|
863 |
|
864 |
|
865 |
|
866 |
|
867 |
|
868 | static parseEventName(eventName) {
|
869 | const parts = eventName.toLowerCase().split('.');
|
870 | const domEventName = parts.shift();
|
871 | if ((parts.length === 0) || !(domEventName === 'keydown' || domEventName === 'keyup')) {
|
872 | return null;
|
873 | }
|
874 | const key = KeyEventsPlugin._normalizeKey(parts.pop());
|
875 | let fullKey = '';
|
876 | let codeIX = parts.indexOf('code');
|
877 | if (codeIX > -1) {
|
878 | parts.splice(codeIX, 1);
|
879 | fullKey = 'code.';
|
880 | }
|
881 | MODIFIER_KEYS.forEach(modifierName => {
|
882 | const index = parts.indexOf(modifierName);
|
883 | if (index > -1) {
|
884 | parts.splice(index, 1);
|
885 | fullKey += modifierName + '.';
|
886 | }
|
887 | });
|
888 | fullKey += key;
|
889 | if (parts.length != 0 || key.length === 0) {
|
890 |
|
891 | return null;
|
892 | }
|
893 |
|
894 |
|
895 |
|
896 | const result = {};
|
897 | result['domEventName'] = domEventName;
|
898 | result['fullKey'] = fullKey;
|
899 | return result;
|
900 | }
|
901 | |
902 |
|
903 |
|
904 |
|
905 |
|
906 |
|
907 |
|
908 |
|
909 |
|
910 |
|
911 | static matchEventFullKeyCode(event, fullKeyCode) {
|
912 | let keycode = _keyMap[event.key] || event.key;
|
913 | let key = '';
|
914 | if (fullKeyCode.indexOf('code.') > -1) {
|
915 | keycode = event.code;
|
916 | key = 'code.';
|
917 | }
|
918 |
|
919 | if (keycode == null || !keycode)
|
920 | return false;
|
921 | keycode = keycode.toLowerCase();
|
922 | if (keycode === ' ') {
|
923 | keycode = 'space';
|
924 | }
|
925 | else if (keycode === '.') {
|
926 | keycode = 'dot';
|
927 | }
|
928 | MODIFIER_KEYS.forEach(modifierName => {
|
929 | if (modifierName !== keycode) {
|
930 | const modifierGetter = MODIFIER_KEY_GETTERS[modifierName];
|
931 | if (modifierGetter(event)) {
|
932 | key += modifierName + '.';
|
933 | }
|
934 | }
|
935 | });
|
936 | key += keycode;
|
937 | return key === fullKeyCode;
|
938 | }
|
939 | |
940 |
|
941 |
|
942 |
|
943 |
|
944 |
|
945 |
|
946 | static eventCallback(fullKey, handler, zone) {
|
947 | return (event) => {
|
948 | if (KeyEventsPlugin.matchEventFullKeyCode(event, fullKey)) {
|
949 | zone.runGuarded(() => handler(event));
|
950 | }
|
951 | };
|
952 | }
|
953 |
|
954 | static _normalizeKey(keyName) {
|
955 | return keyName === 'esc' ? 'escape' : keyName;
|
956 | }
|
957 | static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: KeyEventsPlugin, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
958 | static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: KeyEventsPlugin }); }
|
959 | }
|
960 | i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: KeyEventsPlugin, decorators: [{
|
961 | type: Injectable
|
962 | }], ctorParameters: () => [{ type: undefined, decorators: [{
|
963 | type: Inject,
|
964 | args: [DOCUMENT]
|
965 | }] }] });
|
966 |
|
967 |
|
968 |
|
969 |
|
970 |
|
971 |
|
972 |
|
973 |
|
974 |
|
975 |
|
976 |
|
977 |
|
978 |
|
979 |
|
980 |
|
981 |
|
982 |
|
983 |
|
984 |
|
985 |
|
986 |
|
987 |
|
988 |
|
989 |
|
990 |
|
991 |
|
992 |
|
993 |
|
994 |
|
995 |
|
996 |
|
997 |
|
998 |
|
999 |
|
1000 |
|
1001 |
|
1002 |
|
1003 |
|
1004 |
|
1005 |
|
1006 |
|
1007 |
|
1008 |
|
1009 |
|
1010 |
|
1011 |
|
1012 |
|
1013 |
|
1014 |
|
1015 |
|
1016 |
|
1017 |
|
1018 |
|
1019 |
|
1020 |
|
1021 |
|
1022 |
|
1023 |
|
1024 |
|
1025 |
|
1026 | function bootstrapApplication(rootComponent, options) {
|
1027 | return ɵinternalCreateApplication({ rootComponent, ...createProvidersConfig(options) });
|
1028 | }
|
1029 |
|
1030 |
|
1031 |
|
1032 |
|
1033 |
|
1034 |
|
1035 |
|
1036 |
|
1037 |
|
1038 |
|
1039 |
|
1040 |
|
1041 | function createApplication(options) {
|
1042 | return ɵinternalCreateApplication(createProvidersConfig(options));
|
1043 | }
|
1044 | function createProvidersConfig(options) {
|
1045 | return {
|
1046 | appProviders: [
|
1047 | ...BROWSER_MODULE_PROVIDERS,
|
1048 | ...(options?.providers ?? []),
|
1049 | ],
|
1050 | platformProviders: INTERNAL_BROWSER_PLATFORM_PROVIDERS
|
1051 | };
|
1052 | }
|
1053 |
|
1054 |
|
1055 |
|
1056 |
|
1057 |
|
1058 |
|
1059 |
|
1060 |
|
1061 |
|
1062 |
|
1063 |
|
1064 | function provideProtractorTestingSupport() {
|
1065 |
|
1066 |
|
1067 |
|
1068 | return [...TESTABILITY_PROVIDERS];
|
1069 | }
|
1070 | function initDomAdapter() {
|
1071 | BrowserDomAdapter.makeCurrent();
|
1072 | }
|
1073 | function errorHandler() {
|
1074 | return new ErrorHandler();
|
1075 | }
|
1076 | function _document() {
|
1077 |
|
1078 | ɵsetDocument(document);
|
1079 | return document;
|
1080 | }
|
1081 | const INTERNAL_BROWSER_PLATFORM_PROVIDERS = [
|
1082 | { provide: PLATFORM_ID, useValue: ɵPLATFORM_BROWSER_ID },
|
1083 | { provide: PLATFORM_INITIALIZER, useValue: initDomAdapter, multi: true },
|
1084 | { provide: DOCUMENT, useFactory: _document, deps: [] },
|
1085 | ];
|
1086 |
|
1087 |
|
1088 |
|
1089 |
|
1090 |
|
1091 |
|
1092 | const platformBrowser = createPlatformFactory(platformCore, 'browser', INTERNAL_BROWSER_PLATFORM_PROVIDERS);
|
1093 |
|
1094 |
|
1095 |
|
1096 |
|
1097 |
|
1098 |
|
1099 | const BROWSER_MODULE_PROVIDERS_MARKER = new InjectionToken((typeof ngDevMode === 'undefined' || ngDevMode) ? 'BrowserModule Providers Marker' : '');
|
1100 | const TESTABILITY_PROVIDERS = [
|
1101 | {
|
1102 | provide: ɵTESTABILITY_GETTER,
|
1103 | useClass: BrowserGetTestability,
|
1104 | deps: [],
|
1105 | },
|
1106 | {
|
1107 | provide: ɵTESTABILITY,
|
1108 | useClass: Testability,
|
1109 | deps: [NgZone, TestabilityRegistry, ɵTESTABILITY_GETTER]
|
1110 | },
|
1111 | {
|
1112 | provide: Testability,
|
1113 | useClass: Testability,
|
1114 | deps: [NgZone, TestabilityRegistry, ɵTESTABILITY_GETTER]
|
1115 | }
|
1116 | ];
|
1117 | const BROWSER_MODULE_PROVIDERS = [
|
1118 | { provide: ɵINJECTOR_SCOPE, useValue: 'root' },
|
1119 | { provide: ErrorHandler, useFactory: errorHandler, deps: [] }, {
|
1120 | provide: EVENT_MANAGER_PLUGINS,
|
1121 | useClass: DomEventsPlugin,
|
1122 | multi: true,
|
1123 | deps: [DOCUMENT, NgZone, PLATFORM_ID]
|
1124 | },
|
1125 | { provide: EVENT_MANAGER_PLUGINS, useClass: KeyEventsPlugin, multi: true, deps: [DOCUMENT] },
|
1126 | DomRendererFactory2, SharedStylesHost, EventManager,
|
1127 | { provide: RendererFactory2, useExisting: DomRendererFactory2 },
|
1128 | { provide: XhrFactory, useClass: BrowserXhr, deps: [] },
|
1129 | (typeof ngDevMode === 'undefined' || ngDevMode) ?
|
1130 | { provide: BROWSER_MODULE_PROVIDERS_MARKER, useValue: true } :
|
1131 | []
|
1132 | ];
|
1133 |
|
1134 |
|
1135 |
|
1136 |
|
1137 |
|
1138 |
|
1139 |
|
1140 |
|
1141 |
|
1142 | class BrowserModule {
|
1143 | constructor(providersAlreadyPresent) {
|
1144 | if ((typeof ngDevMode === 'undefined' || ngDevMode) && providersAlreadyPresent) {
|
1145 | throw new ɵRuntimeError(5100 , `Providers from the \`BrowserModule\` have already been loaded. If you need access ` +
|
1146 | `to common directives such as NgIf and NgFor, import the \`CommonModule\` instead.`);
|
1147 | }
|
1148 | }
|
1149 | |
1150 |
|
1151 |
|
1152 |
|
1153 |
|
1154 |
|
1155 |
|
1156 |
|
1157 |
|
1158 |
|
1159 | static withServerTransition(params) {
|
1160 | return {
|
1161 | ngModule: BrowserModule,
|
1162 | providers: [
|
1163 | { provide: APP_ID, useValue: params.appId },
|
1164 | ],
|
1165 | };
|
1166 | }
|
1167 | static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: BrowserModule, deps: [{ token: BROWSER_MODULE_PROVIDERS_MARKER, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.NgModule }); }
|
1168 | static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.7", ngImport: i0, type: BrowserModule, exports: [CommonModule, ApplicationModule] }); }
|
1169 | static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: BrowserModule, providers: [...BROWSER_MODULE_PROVIDERS, ...TESTABILITY_PROVIDERS], imports: [CommonModule, ApplicationModule] }); }
|
1170 | }
|
1171 | i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: BrowserModule, decorators: [{
|
1172 | type: NgModule,
|
1173 | args: [{
|
1174 | providers: [...BROWSER_MODULE_PROVIDERS, ...TESTABILITY_PROVIDERS],
|
1175 | exports: [CommonModule, ApplicationModule],
|
1176 | }]
|
1177 | }], ctorParameters: () => [{ type: undefined, decorators: [{
|
1178 | type: Optional
|
1179 | }, {
|
1180 | type: SkipSelf
|
1181 | }, {
|
1182 | type: Inject,
|
1183 | args: [BROWSER_MODULE_PROVIDERS_MARKER]
|
1184 | }] }] });
|
1185 |
|
1186 |
|
1187 |
|
1188 |
|
1189 |
|
1190 |
|
1191 |
|
1192 |
|
1193 |
|
1194 |
|
1195 |
|
1196 |
|
1197 |
|
1198 |
|
1199 |
|
1200 |
|
1201 |
|
1202 |
|
1203 |
|
1204 |
|
1205 |
|
1206 |
|
1207 |
|
1208 | class Meta {
|
1209 | constructor(_doc) {
|
1210 | this._doc = _doc;
|
1211 | this._dom = ɵgetDOM();
|
1212 | }
|
1213 | |
1214 |
|
1215 |
|
1216 |
|
1217 |
|
1218 |
|
1219 |
|
1220 |
|
1221 |
|
1222 |
|
1223 | addTag(tag, forceCreation = false) {
|
1224 | if (!tag)
|
1225 | return null;
|
1226 | return this._getOrCreateElement(tag, forceCreation);
|
1227 | }
|
1228 | |
1229 |
|
1230 |
|
1231 |
|
1232 |
|
1233 |
|
1234 |
|
1235 |
|
1236 | addTags(tags, forceCreation = false) {
|
1237 | if (!tags)
|
1238 | return [];
|
1239 | return tags.reduce((result, tag) => {
|
1240 | if (tag) {
|
1241 | result.push(this._getOrCreateElement(tag, forceCreation));
|
1242 | }
|
1243 | return result;
|
1244 | }, []);
|
1245 | }
|
1246 | |
1247 |
|
1248 |
|
1249 |
|
1250 |
|
1251 |
|
1252 | getTag(attrSelector) {
|
1253 | if (!attrSelector)
|
1254 | return null;
|
1255 | return this._doc.querySelector(`meta[${attrSelector}]`) || null;
|
1256 | }
|
1257 | |
1258 |
|
1259 |
|
1260 |
|
1261 |
|
1262 |
|
1263 | getTags(attrSelector) {
|
1264 | if (!attrSelector)
|
1265 | return [];
|
1266 | const list = this._doc.querySelectorAll(`meta[${attrSelector}]`);
|
1267 | return list ? [].slice.call(list) : [];
|
1268 | }
|
1269 | |
1270 |
|
1271 |
|
1272 |
|
1273 |
|
1274 |
|
1275 |
|
1276 |
|
1277 |
|
1278 | updateTag(tag, selector) {
|
1279 | if (!tag)
|
1280 | return null;
|
1281 | selector = selector || this._parseSelector(tag);
|
1282 | const meta = this.getTag(selector);
|
1283 | if (meta) {
|
1284 | return this._setMetaElementAttributes(tag, meta);
|
1285 | }
|
1286 | return this._getOrCreateElement(tag, true);
|
1287 | }
|
1288 | |
1289 |
|
1290 |
|
1291 |
|
1292 |
|
1293 | removeTag(attrSelector) {
|
1294 | this.removeTagElement(this.getTag(attrSelector));
|
1295 | }
|
1296 | |
1297 |
|
1298 |
|
1299 |
|
1300 | removeTagElement(meta) {
|
1301 | if (meta) {
|
1302 | this._dom.remove(meta);
|
1303 | }
|
1304 | }
|
1305 | _getOrCreateElement(meta, forceCreation = false) {
|
1306 | if (!forceCreation) {
|
1307 | const selector = this._parseSelector(meta);
|
1308 |
|
1309 |
|
1310 |
|
1311 | const elem = this.getTags(selector).filter(elem => this._containsAttributes(meta, elem))[0];
|
1312 | if (elem !== undefined)
|
1313 | return elem;
|
1314 | }
|
1315 | const element = this._dom.createElement('meta');
|
1316 | this._setMetaElementAttributes(meta, element);
|
1317 | const head = this._doc.getElementsByTagName('head')[0];
|
1318 | head.appendChild(element);
|
1319 | return element;
|
1320 | }
|
1321 | _setMetaElementAttributes(tag, el) {
|
1322 | Object.keys(tag).forEach((prop) => el.setAttribute(this._getMetaKeyMap(prop), tag[prop]));
|
1323 | return el;
|
1324 | }
|
1325 | _parseSelector(tag) {
|
1326 | const attr = tag.name ? 'name' : 'property';
|
1327 | return `${attr}="${tag[attr]}"`;
|
1328 | }
|
1329 | _containsAttributes(tag, elem) {
|
1330 | return Object.keys(tag).every((key) => elem.getAttribute(this._getMetaKeyMap(key)) === tag[key]);
|
1331 | }
|
1332 | _getMetaKeyMap(prop) {
|
1333 | return META_KEYS_MAP[prop] || prop;
|
1334 | }
|
1335 | static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: Meta, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
1336 | static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: Meta, providedIn: 'root' }); }
|
1337 | }
|
1338 | i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: Meta, decorators: [{
|
1339 | type: Injectable,
|
1340 | args: [{ providedIn: 'root' }]
|
1341 | }], ctorParameters: () => [{ type: undefined, decorators: [{
|
1342 | type: Inject,
|
1343 | args: [DOCUMENT]
|
1344 | }] }] });
|
1345 |
|
1346 |
|
1347 |
|
1348 | const META_KEYS_MAP = {
|
1349 | httpEquiv: 'http-equiv'
|
1350 | };
|
1351 |
|
1352 |
|
1353 |
|
1354 |
|
1355 |
|
1356 |
|
1357 |
|
1358 |
|
1359 |
|
1360 |
|
1361 |
|
1362 | class Title {
|
1363 | constructor(_doc) {
|
1364 | this._doc = _doc;
|
1365 | }
|
1366 | |
1367 |
|
1368 |
|
1369 | getTitle() {
|
1370 | return this._doc.title;
|
1371 | }
|
1372 | |
1373 |
|
1374 |
|
1375 |
|
1376 | setTitle(newTitle) {
|
1377 | this._doc.title = newTitle || '';
|
1378 | }
|
1379 | static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: Title, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
1380 | static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: Title, providedIn: 'root' }); }
|
1381 | }
|
1382 | i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: Title, decorators: [{
|
1383 | type: Injectable,
|
1384 | args: [{ providedIn: 'root' }]
|
1385 | }], ctorParameters: () => [{ type: undefined, decorators: [{
|
1386 | type: Inject,
|
1387 | args: [DOCUMENT]
|
1388 | }] }] });
|
1389 |
|
1390 |
|
1391 |
|
1392 |
|
1393 |
|
1394 |
|
1395 |
|
1396 |
|
1397 | function exportNgVar(name, value) {
|
1398 | if (typeof COMPILED === 'undefined' || !COMPILED) {
|
1399 |
|
1400 |
|
1401 |
|
1402 |
|
1403 | const ng = ɵglobal['ng'] = ɵglobal['ng'] || {};
|
1404 | ng[name] = value;
|
1405 | }
|
1406 | }
|
1407 |
|
1408 | class ChangeDetectionPerfRecord {
|
1409 | constructor(msPerTick, numTicks) {
|
1410 | this.msPerTick = msPerTick;
|
1411 | this.numTicks = numTicks;
|
1412 | }
|
1413 | }
|
1414 |
|
1415 |
|
1416 |
|
1417 |
|
1418 | class AngularProfiler {
|
1419 | constructor(ref) {
|
1420 | this.appRef = ref.injector.get(ApplicationRef);
|
1421 | }
|
1422 |
|
1423 | |
1424 |
|
1425 |
|
1426 |
|
1427 |
|
1428 |
|
1429 |
|
1430 |
|
1431 |
|
1432 |
|
1433 |
|
1434 |
|
1435 |
|
1436 |
|
1437 |
|
1438 |
|
1439 | timeChangeDetection(config) {
|
1440 | const record = config && config['record'];
|
1441 | const profileName = 'Change Detection';
|
1442 |
|
1443 | if (record && 'profile' in console && typeof console.profile === 'function') {
|
1444 | console.profile(profileName);
|
1445 | }
|
1446 | const start = performance.now();
|
1447 | let numTicks = 0;
|
1448 | while (numTicks < 5 || (performance.now() - start) < 500) {
|
1449 | this.appRef.tick();
|
1450 | numTicks++;
|
1451 | }
|
1452 | const end = performance.now();
|
1453 | if (record && 'profileEnd' in console && typeof console.profileEnd === 'function') {
|
1454 | console.profileEnd(profileName);
|
1455 | }
|
1456 | const msPerTick = (end - start) / numTicks;
|
1457 | console.log(`ran ${numTicks} change detection cycles`);
|
1458 | console.log(`${msPerTick.toFixed(2)} ms per check`);
|
1459 | return new ChangeDetectionPerfRecord(msPerTick, numTicks);
|
1460 | }
|
1461 | }
|
1462 |
|
1463 | const PROFILER_GLOBAL_NAME = 'profiler';
|
1464 |
|
1465 |
|
1466 |
|
1467 |
|
1468 |
|
1469 |
|
1470 |
|
1471 |
|
1472 |
|
1473 |
|
1474 |
|
1475 |
|
1476 |
|
1477 | function enableDebugTools(ref) {
|
1478 | exportNgVar(PROFILER_GLOBAL_NAME, new AngularProfiler(ref));
|
1479 | return ref;
|
1480 | }
|
1481 |
|
1482 |
|
1483 |
|
1484 |
|
1485 |
|
1486 | function disableDebugTools() {
|
1487 | exportNgVar(PROFILER_GLOBAL_NAME, null);
|
1488 | }
|
1489 |
|
1490 |
|
1491 |
|
1492 |
|
1493 |
|
1494 |
|
1495 | class By {
|
1496 | |
1497 |
|
1498 |
|
1499 |
|
1500 |
|
1501 |
|
1502 |
|
1503 |
|
1504 | static all() {
|
1505 | return () => true;
|
1506 | }
|
1507 | |
1508 |
|
1509 |
|
1510 |
|
1511 |
|
1512 |
|
1513 |
|
1514 |
|
1515 | static css(selector) {
|
1516 | return (debugElement) => {
|
1517 | return debugElement.nativeElement != null ?
|
1518 | elementMatches(debugElement.nativeElement, selector) :
|
1519 | false;
|
1520 | };
|
1521 | }
|
1522 | |
1523 |
|
1524 |
|
1525 |
|
1526 |
|
1527 |
|
1528 |
|
1529 |
|
1530 | static directive(type) {
|
1531 | return (debugNode) => debugNode.providerTokens.indexOf(type) !== -1;
|
1532 | }
|
1533 | }
|
1534 | function elementMatches(n, selector) {
|
1535 | if (ɵgetDOM().isElementNode(n)) {
|
1536 | return n.matches && n.matches(selector) ||
|
1537 | n.msMatchesSelector && n.msMatchesSelector(selector) ||
|
1538 | n.webkitMatchesSelector && n.webkitMatchesSelector(selector);
|
1539 | }
|
1540 | return false;
|
1541 | }
|
1542 |
|
1543 |
|
1544 |
|
1545 |
|
1546 | const EVENT_NAMES = {
|
1547 |
|
1548 | 'pan': true,
|
1549 | 'panstart': true,
|
1550 | 'panmove': true,
|
1551 | 'panend': true,
|
1552 | 'pancancel': true,
|
1553 | 'panleft': true,
|
1554 | 'panright': true,
|
1555 | 'panup': true,
|
1556 | 'pandown': true,
|
1557 |
|
1558 | 'pinch': true,
|
1559 | 'pinchstart': true,
|
1560 | 'pinchmove': true,
|
1561 | 'pinchend': true,
|
1562 | 'pinchcancel': true,
|
1563 | 'pinchin': true,
|
1564 | 'pinchout': true,
|
1565 |
|
1566 | 'press': true,
|
1567 | 'pressup': true,
|
1568 |
|
1569 | 'rotate': true,
|
1570 | 'rotatestart': true,
|
1571 | 'rotatemove': true,
|
1572 | 'rotateend': true,
|
1573 | 'rotatecancel': true,
|
1574 |
|
1575 | 'swipe': true,
|
1576 | 'swipeleft': true,
|
1577 | 'swiperight': true,
|
1578 | 'swipeup': true,
|
1579 | 'swipedown': true,
|
1580 |
|
1581 | 'tap': true,
|
1582 | 'doubletap': true
|
1583 | };
|
1584 |
|
1585 |
|
1586 |
|
1587 |
|
1588 |
|
1589 |
|
1590 |
|
1591 | const HAMMER_GESTURE_CONFIG = new InjectionToken('HammerGestureConfig');
|
1592 |
|
1593 |
|
1594 |
|
1595 |
|
1596 |
|
1597 | const HAMMER_LOADER = new InjectionToken('HammerLoader');
|
1598 |
|
1599 |
|
1600 |
|
1601 |
|
1602 |
|
1603 | class HammerGestureConfig {
|
1604 | constructor() {
|
1605 | |
1606 |
|
1607 |
|
1608 |
|
1609 |
|
1610 | this.events = [];
|
1611 | |
1612 |
|
1613 |
|
1614 |
|
1615 |
|
1616 |
|
1617 |
|
1618 |
|
1619 |
|
1620 |
|
1621 |
|
1622 |
|
1623 |
|
1624 |
|
1625 |
|
1626 |
|
1627 | this.overrides = {};
|
1628 | }
|
1629 | |
1630 |
|
1631 |
|
1632 |
|
1633 |
|
1634 |
|
1635 | buildHammer(element) {
|
1636 | const mc = new Hammer(element, this.options);
|
1637 | mc.get('pinch').set({ enable: true });
|
1638 | mc.get('rotate').set({ enable: true });
|
1639 | for (const eventName in this.overrides) {
|
1640 | mc.get(eventName).set(this.overrides[eventName]);
|
1641 | }
|
1642 | return mc;
|
1643 | }
|
1644 | static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: HammerGestureConfig, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
1645 | static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: HammerGestureConfig }); }
|
1646 | }
|
1647 | i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: HammerGestureConfig, decorators: [{
|
1648 | type: Injectable
|
1649 | }] });
|
1650 |
|
1651 |
|
1652 |
|
1653 |
|
1654 |
|
1655 | class HammerGesturesPlugin extends EventManagerPlugin {
|
1656 | constructor(doc, _config, console, loader) {
|
1657 | super(doc);
|
1658 | this._config = _config;
|
1659 | this.console = console;
|
1660 | this.loader = loader;
|
1661 | this._loaderPromise = null;
|
1662 | }
|
1663 | supports(eventName) {
|
1664 | if (!EVENT_NAMES.hasOwnProperty(eventName.toLowerCase()) && !this.isCustomEvent(eventName)) {
|
1665 | return false;
|
1666 | }
|
1667 | if (!window.Hammer && !this.loader) {
|
1668 | if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
1669 | this.console.warn(`The "${eventName}" event cannot be bound because Hammer.JS is not ` +
|
1670 | `loaded and no custom loader has been specified.`);
|
1671 | }
|
1672 | return false;
|
1673 | }
|
1674 | return true;
|
1675 | }
|
1676 | addEventListener(element, eventName, handler) {
|
1677 | const zone = this.manager.getZone();
|
1678 | eventName = eventName.toLowerCase();
|
1679 |
|
1680 |
|
1681 | if (!window.Hammer && this.loader) {
|
1682 | this._loaderPromise = this._loaderPromise || zone.runOutsideAngular(() => this.loader());
|
1683 |
|
1684 |
|
1685 |
|
1686 | let cancelRegistration = false;
|
1687 | let deregister = () => {
|
1688 | cancelRegistration = true;
|
1689 | };
|
1690 | zone.runOutsideAngular(() => this._loaderPromise
|
1691 | .then(() => {
|
1692 |
|
1693 | if (!window.Hammer) {
|
1694 | if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
1695 | this.console.warn(`The custom HAMMER_LOADER completed, but Hammer.JS is not present.`);
|
1696 | }
|
1697 | deregister = () => { };
|
1698 | return;
|
1699 | }
|
1700 | if (!cancelRegistration) {
|
1701 |
|
1702 |
|
1703 |
|
1704 | deregister = this.addEventListener(element, eventName, handler);
|
1705 | }
|
1706 | })
|
1707 | .catch(() => {
|
1708 | if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
1709 | this.console.warn(`The "${eventName}" event cannot be bound because the custom ` +
|
1710 | `Hammer.JS loader failed.`);
|
1711 | }
|
1712 | deregister = () => { };
|
1713 | }));
|
1714 |
|
1715 |
|
1716 |
|
1717 | return () => {
|
1718 | deregister();
|
1719 | };
|
1720 | }
|
1721 | return zone.runOutsideAngular(() => {
|
1722 |
|
1723 | const mc = this._config.buildHammer(element);
|
1724 | const callback = function (eventObj) {
|
1725 | zone.runGuarded(function () {
|
1726 | handler(eventObj);
|
1727 | });
|
1728 | };
|
1729 | mc.on(eventName, callback);
|
1730 | return () => {
|
1731 | mc.off(eventName, callback);
|
1732 |
|
1733 | if (typeof mc.destroy === 'function') {
|
1734 | mc.destroy();
|
1735 | }
|
1736 | };
|
1737 | });
|
1738 | }
|
1739 | isCustomEvent(eventName) {
|
1740 | return this._config.events.indexOf(eventName) > -1;
|
1741 | }
|
1742 | static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: HammerGesturesPlugin, deps: [{ token: DOCUMENT }, { token: HAMMER_GESTURE_CONFIG }, { token: i0.ɵConsole }, { token: HAMMER_LOADER, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
1743 | static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: HammerGesturesPlugin }); }
|
1744 | }
|
1745 | i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: HammerGesturesPlugin, decorators: [{
|
1746 | type: Injectable
|
1747 | }], ctorParameters: () => [{ type: undefined, decorators: [{
|
1748 | type: Inject,
|
1749 | args: [DOCUMENT]
|
1750 | }] }, { type: HammerGestureConfig, decorators: [{
|
1751 | type: Inject,
|
1752 | args: [HAMMER_GESTURE_CONFIG]
|
1753 | }] }, { type: i0.ɵConsole }, { type: undefined, decorators: [{
|
1754 | type: Optional
|
1755 | }, {
|
1756 | type: Inject,
|
1757 | args: [HAMMER_LOADER]
|
1758 | }] }] });
|
1759 |
|
1760 |
|
1761 |
|
1762 |
|
1763 |
|
1764 |
|
1765 |
|
1766 |
|
1767 |
|
1768 |
|
1769 |
|
1770 | class HammerModule {
|
1771 | static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: HammerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
1772 | static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.7", ngImport: i0, type: HammerModule }); }
|
1773 | static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: HammerModule, providers: [
|
1774 | {
|
1775 | provide: EVENT_MANAGER_PLUGINS,
|
1776 | useClass: HammerGesturesPlugin,
|
1777 | multi: true,
|
1778 | deps: [DOCUMENT, HAMMER_GESTURE_CONFIG, ɵConsole, [new Optional(), HAMMER_LOADER]]
|
1779 | },
|
1780 | { provide: HAMMER_GESTURE_CONFIG, useClass: HammerGestureConfig, deps: [] },
|
1781 | ] }); }
|
1782 | }
|
1783 | i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: HammerModule, decorators: [{
|
1784 | type: NgModule,
|
1785 | args: [{
|
1786 | providers: [
|
1787 | {
|
1788 | provide: EVENT_MANAGER_PLUGINS,
|
1789 | useClass: HammerGesturesPlugin,
|
1790 | multi: true,
|
1791 | deps: [DOCUMENT, HAMMER_GESTURE_CONFIG, ɵConsole, [new Optional(), HAMMER_LOADER]]
|
1792 | },
|
1793 | { provide: HAMMER_GESTURE_CONFIG, useClass: HammerGestureConfig, deps: [] },
|
1794 | ]
|
1795 | }]
|
1796 | }] });
|
1797 |
|
1798 |
|
1799 |
|
1800 |
|
1801 |
|
1802 |
|
1803 |
|
1804 |
|
1805 |
|
1806 |
|
1807 |
|
1808 |
|
1809 |
|
1810 |
|
1811 |
|
1812 |
|
1813 |
|
1814 |
|
1815 |
|
1816 |
|
1817 |
|
1818 |
|
1819 |
|
1820 |
|
1821 |
|
1822 |
|
1823 |
|
1824 |
|
1825 |
|
1826 |
|
1827 |
|
1828 |
|
1829 | class DomSanitizer {
|
1830 | static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: DomSanitizer, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
1831 | static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: DomSanitizer, providedIn: 'root', useExisting: i0.forwardRef(() => DomSanitizerImpl) }); }
|
1832 | }
|
1833 | i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: DomSanitizer, decorators: [{
|
1834 | type: Injectable,
|
1835 | args: [{ providedIn: 'root', useExisting: forwardRef(() => DomSanitizerImpl) }]
|
1836 | }] });
|
1837 | class DomSanitizerImpl extends DomSanitizer {
|
1838 | constructor(_doc) {
|
1839 | super();
|
1840 | this._doc = _doc;
|
1841 | }
|
1842 | sanitize(ctx, value) {
|
1843 | if (value == null)
|
1844 | return null;
|
1845 | switch (ctx) {
|
1846 | case SecurityContext.NONE:
|
1847 | return value;
|
1848 | case SecurityContext.HTML:
|
1849 | if (ɵallowSanitizationBypassAndThrow(value, "HTML" )) {
|
1850 | return ɵunwrapSafeValue(value);
|
1851 | }
|
1852 | return ɵ_sanitizeHtml(this._doc, String(value)).toString();
|
1853 | case SecurityContext.STYLE:
|
1854 | if (ɵallowSanitizationBypassAndThrow(value, "Style" )) {
|
1855 | return ɵunwrapSafeValue(value);
|
1856 | }
|
1857 | return value;
|
1858 | case SecurityContext.SCRIPT:
|
1859 | if (ɵallowSanitizationBypassAndThrow(value, "Script" )) {
|
1860 | return ɵunwrapSafeValue(value);
|
1861 | }
|
1862 | throw new ɵRuntimeError(5200 , (typeof ngDevMode === 'undefined' || ngDevMode) &&
|
1863 | 'unsafe value used in a script context');
|
1864 | case SecurityContext.URL:
|
1865 | if (ɵallowSanitizationBypassAndThrow(value, "URL" )) {
|
1866 | return ɵunwrapSafeValue(value);
|
1867 | }
|
1868 | return ɵ_sanitizeUrl(String(value));
|
1869 | case SecurityContext.RESOURCE_URL:
|
1870 | if (ɵallowSanitizationBypassAndThrow(value, "ResourceURL" )) {
|
1871 | return ɵunwrapSafeValue(value);
|
1872 | }
|
1873 | throw new ɵRuntimeError(5201 , (typeof ngDevMode === 'undefined' || ngDevMode) &&
|
1874 | `unsafe value used in a resource URL context (see ${ɵXSS_SECURITY_URL})`);
|
1875 | default:
|
1876 | throw new ɵRuntimeError(5202 , (typeof ngDevMode === 'undefined' || ngDevMode) &&
|
1877 | `Unexpected SecurityContext ${ctx} (see ${ɵXSS_SECURITY_URL})`);
|
1878 | }
|
1879 | }
|
1880 | bypassSecurityTrustHtml(value) {
|
1881 | return ɵbypassSanitizationTrustHtml(value);
|
1882 | }
|
1883 | bypassSecurityTrustStyle(value) {
|
1884 | return ɵbypassSanitizationTrustStyle(value);
|
1885 | }
|
1886 | bypassSecurityTrustScript(value) {
|
1887 | return ɵbypassSanitizationTrustScript(value);
|
1888 | }
|
1889 | bypassSecurityTrustUrl(value) {
|
1890 | return ɵbypassSanitizationTrustUrl(value);
|
1891 | }
|
1892 | bypassSecurityTrustResourceUrl(value) {
|
1893 | return ɵbypassSanitizationTrustResourceUrl(value);
|
1894 | }
|
1895 | static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: DomSanitizerImpl, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
1896 | static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: DomSanitizerImpl, providedIn: 'root' }); }
|
1897 | }
|
1898 | i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: DomSanitizerImpl, decorators: [{
|
1899 | type: Injectable,
|
1900 | args: [{ providedIn: 'root' }]
|
1901 | }], ctorParameters: () => [{ type: undefined, decorators: [{
|
1902 | type: Inject,
|
1903 | args: [DOCUMENT]
|
1904 | }] }] });
|
1905 |
|
1906 |
|
1907 |
|
1908 |
|
1909 |
|
1910 |
|
1911 |
|
1912 | var HydrationFeatureKind;
|
1913 | (function (HydrationFeatureKind) {
|
1914 | HydrationFeatureKind[HydrationFeatureKind["NoHttpTransferCache"] = 0] = "NoHttpTransferCache";
|
1915 | HydrationFeatureKind[HydrationFeatureKind["HttpTransferCacheOptions"] = 1] = "HttpTransferCacheOptions";
|
1916 | })(HydrationFeatureKind || (HydrationFeatureKind = {}));
|
1917 |
|
1918 |
|
1919 |
|
1920 | function hydrationFeature(ɵkind, ɵproviders = [], ɵoptions = {}) {
|
1921 | return { ɵkind, ɵproviders };
|
1922 | }
|
1923 |
|
1924 |
|
1925 |
|
1926 |
|
1927 |
|
1928 |
|
1929 | function withNoHttpTransferCache() {
|
1930 |
|
1931 |
|
1932 | return hydrationFeature(HydrationFeatureKind.NoHttpTransferCache);
|
1933 | }
|
1934 |
|
1935 |
|
1936 |
|
1937 |
|
1938 |
|
1939 |
|
1940 |
|
1941 |
|
1942 | function withHttpTransferCacheOptions(options) {
|
1943 |
|
1944 | return hydrationFeature(HydrationFeatureKind.HttpTransferCacheOptions, ɵwithHttpTransferCache(options));
|
1945 | }
|
1946 |
|
1947 |
|
1948 |
|
1949 |
|
1950 |
|
1951 | function provideZoneJsCompatibilityDetector() {
|
1952 | return [{
|
1953 | provide: ENVIRONMENT_INITIALIZER,
|
1954 | useValue: () => {
|
1955 | const ngZone = inject(NgZone);
|
1956 |
|
1957 |
|
1958 | if (ngZone.constructor !== NgZone) {
|
1959 | const console = inject(ɵConsole);
|
1960 | const message = ɵformatRuntimeError(-5000 , 'Angular detected that hydration was enabled for an application ' +
|
1961 | 'that uses a custom or a noop Zone.js implementation. ' +
|
1962 | 'This is not yet a fully supported configuration.');
|
1963 |
|
1964 | console.warn(message);
|
1965 | }
|
1966 | },
|
1967 | multi: true,
|
1968 | }];
|
1969 | }
|
1970 |
|
1971 |
|
1972 |
|
1973 |
|
1974 |
|
1975 |
|
1976 |
|
1977 |
|
1978 |
|
1979 |
|
1980 |
|
1981 |
|
1982 |
|
1983 |
|
1984 |
|
1985 |
|
1986 |
|
1987 |
|
1988 |
|
1989 |
|
1990 |
|
1991 |
|
1992 |
|
1993 |
|
1994 |
|
1995 |
|
1996 |
|
1997 |
|
1998 |
|
1999 |
|
2000 |
|
2001 |
|
2002 |
|
2003 |
|
2004 |
|
2005 |
|
2006 |
|
2007 |
|
2008 |
|
2009 |
|
2010 |
|
2011 |
|
2012 |
|
2013 |
|
2014 | function provideClientHydration(...features) {
|
2015 | const providers = [];
|
2016 | const featuresKind = new Set();
|
2017 | const hasHttpTransferCacheOptions = featuresKind.has(HydrationFeatureKind.HttpTransferCacheOptions);
|
2018 | for (const { ɵproviders, ɵkind } of features) {
|
2019 | featuresKind.add(ɵkind);
|
2020 | if (ɵproviders.length) {
|
2021 | providers.push(ɵproviders);
|
2022 | }
|
2023 | }
|
2024 | if (typeof ngDevMode !== 'undefined' && ngDevMode &&
|
2025 | featuresKind.has(HydrationFeatureKind.NoHttpTransferCache) && hasHttpTransferCacheOptions) {
|
2026 |
|
2027 | throw new Error('Configuration error: found both withHttpTransferCacheOptions() and withNoHttpTransferCache() in the same call to provideClientHydration(), which is a contradiction.');
|
2028 | }
|
2029 | return makeEnvironmentProviders([
|
2030 | (typeof ngDevMode !== 'undefined' && ngDevMode) ? provideZoneJsCompatibilityDetector() : [],
|
2031 | ɵwithDomHydration(),
|
2032 | ((featuresKind.has(HydrationFeatureKind.NoHttpTransferCache) || hasHttpTransferCacheOptions) ?
|
2033 | [] :
|
2034 | ɵwithHttpTransferCache({})),
|
2035 | providers,
|
2036 | ]);
|
2037 | }
|
2038 |
|
2039 |
|
2040 |
|
2041 |
|
2042 |
|
2043 |
|
2044 |
|
2045 |
|
2046 |
|
2047 | const VERSION = new Version('17.3.7');
|
2048 |
|
2049 |
|
2050 |
|
2051 |
|
2052 |
|
2053 |
|
2054 |
|
2055 |
|
2056 |
|
2057 |
|
2058 |
|
2059 |
|
2060 |
|
2061 |
|
2062 |
|
2063 |
|
2064 |
|
2065 |
|
2066 | const makeStateKey = makeStateKey$1;
|
2067 |
|
2068 | const TransferState = TransferState$1;
|
2069 |
|
2070 |
|
2071 |
|
2072 |
|
2073 |
|
2074 |
|
2075 |
|
2076 |
|
2077 |
|
2078 |
|
2079 |
|
2080 |
|
2081 |
|
2082 |
|
2083 | export { BrowserModule, By, DomSanitizer, EVENT_MANAGER_PLUGINS, EventManager, EventManagerPlugin, HAMMER_GESTURE_CONFIG, HAMMER_LOADER, HammerGestureConfig, HammerModule, HydrationFeatureKind, Meta, REMOVE_STYLES_ON_COMPONENT_DESTROY, Title, TransferState, VERSION, bootstrapApplication, createApplication, disableDebugTools, enableDebugTools, makeStateKey, platformBrowser, provideClientHydration, provideProtractorTestingSupport, withHttpTransferCacheOptions, withNoHttpTransferCache, BrowserDomAdapter as ɵBrowserDomAdapter, BrowserGetTestability as ɵBrowserGetTestability, DomEventsPlugin as ɵDomEventsPlugin, DomRendererFactory2 as ɵDomRendererFactory2, DomSanitizerImpl as ɵDomSanitizerImpl, HammerGesturesPlugin as ɵHammerGesturesPlugin, INTERNAL_BROWSER_PLATFORM_PROVIDERS as ɵINTERNAL_BROWSER_PLATFORM_PROVIDERS, KeyEventsPlugin as ɵKeyEventsPlugin, SharedStylesHost as ɵSharedStylesHost, initDomAdapter as ɵinitDomAdapter };
|
2084 |
|